first commit
This commit is contained in:
20
frontend/node_modules/antd/es/popconfirm/PurePanel.d.ts
generated
vendored
Normal file
20
frontend/node_modules/antd/es/popconfirm/PurePanel.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import * as React from 'react';
|
||||
import type { PopconfirmProps } from '.';
|
||||
export interface PopconfirmLocale {
|
||||
okText: string;
|
||||
cancelText: string;
|
||||
}
|
||||
export interface OverlayProps extends Pick<PopconfirmProps, 'icon' | 'okButtonProps' | 'cancelButtonProps' | 'cancelText' | 'okText' | 'okType' | 'showCancel' | 'title' | 'description' | 'onPopupClick'> {
|
||||
prefixCls: string;
|
||||
close?: (...args: any[]) => void;
|
||||
onConfirm?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
|
||||
onCancel?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
|
||||
}
|
||||
export declare const Overlay: React.FC<OverlayProps>;
|
||||
export interface PurePanelProps extends Omit<OverlayProps, 'prefixCls'>, Pick<PopconfirmProps, 'placement'> {
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
prefixCls?: string;
|
||||
}
|
||||
declare const PurePanel: React.FC<PurePanelProps>;
|
||||
export default PurePanel;
|
||||
97
frontend/node_modules/antd/es/popconfirm/PurePanel.js
generated
vendored
Normal file
97
frontend/node_modules/antd/es/popconfirm/PurePanel.js
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
"use client";
|
||||
|
||||
var __rest = this && this.__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
import * as React from 'react';
|
||||
import ExclamationCircleFilled from "@ant-design/icons/es/icons/ExclamationCircleFilled";
|
||||
import classNames from 'classnames';
|
||||
import ActionButton from '../_util/ActionButton';
|
||||
import { getRenderPropValue } from '../_util/getRenderPropValue';
|
||||
import Button from '../button';
|
||||
import { convertLegacyProps } from '../button/buttonHelpers';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import { useLocale } from '../locale';
|
||||
import defaultLocale from '../locale/en_US';
|
||||
import PopoverPurePanel from '../popover/PurePanel';
|
||||
import useStyle from './style';
|
||||
export const Overlay = props => {
|
||||
const {
|
||||
prefixCls,
|
||||
okButtonProps,
|
||||
cancelButtonProps,
|
||||
title,
|
||||
description,
|
||||
cancelText,
|
||||
okText,
|
||||
okType = 'primary',
|
||||
icon = /*#__PURE__*/React.createElement(ExclamationCircleFilled, null),
|
||||
showCancel = true,
|
||||
close,
|
||||
onConfirm,
|
||||
onCancel,
|
||||
onPopupClick
|
||||
} = props;
|
||||
const {
|
||||
getPrefixCls
|
||||
} = React.useContext(ConfigContext);
|
||||
const [contextLocale] = useLocale('Popconfirm', defaultLocale.Popconfirm);
|
||||
const titleNode = getRenderPropValue(title);
|
||||
const descriptionNode = getRenderPropValue(description);
|
||||
return /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-inner-content`,
|
||||
onClick: onPopupClick
|
||||
}, /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-message`
|
||||
}, icon && /*#__PURE__*/React.createElement("span", {
|
||||
className: `${prefixCls}-message-icon`
|
||||
}, icon), /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-message-text`
|
||||
}, titleNode && /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-title`
|
||||
}, titleNode), descriptionNode && /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-description`
|
||||
}, descriptionNode))), /*#__PURE__*/React.createElement("div", {
|
||||
className: `${prefixCls}-buttons`
|
||||
}, showCancel && (/*#__PURE__*/React.createElement(Button, Object.assign({
|
||||
onClick: onCancel,
|
||||
size: "small"
|
||||
}, cancelButtonProps), cancelText || (contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.cancelText))), /*#__PURE__*/React.createElement(ActionButton, {
|
||||
buttonProps: Object.assign(Object.assign({
|
||||
size: 'small'
|
||||
}, convertLegacyProps(okType)), okButtonProps),
|
||||
actionFn: onConfirm,
|
||||
close: close,
|
||||
prefixCls: getPrefixCls('btn'),
|
||||
quitOnNullishReturnValue: true,
|
||||
emitEvent: true
|
||||
}, okText || (contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.okText))));
|
||||
};
|
||||
const PurePanel = props => {
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
placement,
|
||||
className,
|
||||
style
|
||||
} = props,
|
||||
restProps = __rest(props, ["prefixCls", "placement", "className", "style"]);
|
||||
const {
|
||||
getPrefixCls
|
||||
} = React.useContext(ConfigContext);
|
||||
const prefixCls = getPrefixCls('popconfirm', customizePrefixCls);
|
||||
const [wrapCSSVar] = useStyle(prefixCls);
|
||||
return wrapCSSVar(/*#__PURE__*/React.createElement(PopoverPurePanel, {
|
||||
placement: placement,
|
||||
className: classNames(prefixCls, className),
|
||||
style: style,
|
||||
content: /*#__PURE__*/React.createElement(Overlay, Object.assign({
|
||||
prefixCls: prefixCls
|
||||
}, restProps))
|
||||
}));
|
||||
};
|
||||
export default PurePanel;
|
||||
30
frontend/node_modules/antd/es/popconfirm/index.d.ts
generated
vendored
Normal file
30
frontend/node_modules/antd/es/popconfirm/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import * as React from 'react';
|
||||
import type { RenderFunction } from '../_util/getRenderPropValue';
|
||||
import type { ButtonProps, LegacyButtonType } from '../button/button';
|
||||
import type { AbstractTooltipProps, TooltipRef } from '../tooltip';
|
||||
import PurePanel from './PurePanel';
|
||||
export interface PopconfirmProps extends AbstractTooltipProps {
|
||||
title: React.ReactNode | RenderFunction;
|
||||
description?: React.ReactNode | RenderFunction;
|
||||
disabled?: boolean;
|
||||
onConfirm?: (e?: React.MouseEvent<HTMLElement>) => void;
|
||||
onCancel?: (e?: React.MouseEvent<HTMLElement>) => void;
|
||||
okText?: React.ReactNode;
|
||||
okType?: LegacyButtonType;
|
||||
cancelText?: React.ReactNode;
|
||||
okButtonProps?: ButtonProps;
|
||||
cancelButtonProps?: ButtonProps;
|
||||
showCancel?: boolean;
|
||||
icon?: React.ReactNode;
|
||||
onOpenChange?: (open: boolean, e?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLDivElement>) => void;
|
||||
onPopupClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
||||
}
|
||||
export interface PopconfirmState {
|
||||
open?: boolean;
|
||||
}
|
||||
declare const InternalPopconfirm: React.ForwardRefExoticComponent<PopconfirmProps & React.RefAttributes<TooltipRef>>;
|
||||
type CompoundedComponent = typeof InternalPopconfirm & {
|
||||
_InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
|
||||
};
|
||||
declare const Popconfirm: CompoundedComponent;
|
||||
export default Popconfirm;
|
||||
111
frontend/node_modules/antd/es/popconfirm/index.js
generated
vendored
Normal file
111
frontend/node_modules/antd/es/popconfirm/index.js
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
"use client";
|
||||
|
||||
var __rest = this && this.__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
import * as React from 'react';
|
||||
import ExclamationCircleFilled from "@ant-design/icons/es/icons/ExclamationCircleFilled";
|
||||
import classNames from 'classnames';
|
||||
import useMergedState from "rc-util/es/hooks/useMergedState";
|
||||
import omit from "rc-util/es/omit";
|
||||
import { useComponentConfig } from '../config-provider/context';
|
||||
import Popover from '../popover';
|
||||
import PurePanel, { Overlay } from './PurePanel';
|
||||
import useStyle from './style';
|
||||
const InternalPopconfirm = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
var _a, _b;
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
placement = 'top',
|
||||
trigger = 'click',
|
||||
okType = 'primary',
|
||||
icon = /*#__PURE__*/React.createElement(ExclamationCircleFilled, null),
|
||||
children,
|
||||
overlayClassName,
|
||||
onOpenChange,
|
||||
onVisibleChange,
|
||||
overlayStyle,
|
||||
styles,
|
||||
classNames: popconfirmClassNames
|
||||
} = props,
|
||||
restProps = __rest(props, ["prefixCls", "placement", "trigger", "okType", "icon", "children", "overlayClassName", "onOpenChange", "onVisibleChange", "overlayStyle", "styles", "classNames"]);
|
||||
const {
|
||||
getPrefixCls,
|
||||
className: contextClassName,
|
||||
style: contextStyle,
|
||||
classNames: contextClassNames,
|
||||
styles: contextStyles
|
||||
} = useComponentConfig('popconfirm');
|
||||
const [open, setOpen] = useMergedState(false, {
|
||||
value: (_a = props.open) !== null && _a !== void 0 ? _a : props.visible,
|
||||
defaultValue: (_b = props.defaultOpen) !== null && _b !== void 0 ? _b : props.defaultVisible
|
||||
});
|
||||
const settingOpen = (value, e) => {
|
||||
setOpen(value, true);
|
||||
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(value);
|
||||
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(value, e);
|
||||
};
|
||||
const close = e => {
|
||||
settingOpen(false, e);
|
||||
};
|
||||
const onConfirm = e => {
|
||||
var _a;
|
||||
return (_a = props.onConfirm) === null || _a === void 0 ? void 0 : _a.call(this, e);
|
||||
};
|
||||
const onCancel = e => {
|
||||
var _a;
|
||||
settingOpen(false, e);
|
||||
(_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(this, e);
|
||||
};
|
||||
const onInternalOpenChange = (value, e) => {
|
||||
const {
|
||||
disabled = false
|
||||
} = props;
|
||||
if (disabled) {
|
||||
return;
|
||||
}
|
||||
settingOpen(value, e);
|
||||
};
|
||||
const prefixCls = getPrefixCls('popconfirm', customizePrefixCls);
|
||||
const rootClassNames = classNames(prefixCls, contextClassName, overlayClassName, contextClassNames.root, popconfirmClassNames === null || popconfirmClassNames === void 0 ? void 0 : popconfirmClassNames.root);
|
||||
const bodyClassNames = classNames(contextClassNames.body, popconfirmClassNames === null || popconfirmClassNames === void 0 ? void 0 : popconfirmClassNames.body);
|
||||
const [wrapCSSVar] = useStyle(prefixCls);
|
||||
return wrapCSSVar(/*#__PURE__*/React.createElement(Popover, Object.assign({}, omit(restProps, ['title']), {
|
||||
trigger: trigger,
|
||||
placement: placement,
|
||||
onOpenChange: onInternalOpenChange,
|
||||
open: open,
|
||||
ref: ref,
|
||||
classNames: {
|
||||
root: rootClassNames,
|
||||
body: bodyClassNames
|
||||
},
|
||||
styles: {
|
||||
root: Object.assign(Object.assign(Object.assign(Object.assign({}, contextStyles.root), contextStyle), overlayStyle), styles === null || styles === void 0 ? void 0 : styles.root),
|
||||
body: Object.assign(Object.assign({}, contextStyles.body), styles === null || styles === void 0 ? void 0 : styles.body)
|
||||
},
|
||||
content: /*#__PURE__*/React.createElement(Overlay, Object.assign({
|
||||
okType: okType,
|
||||
icon: icon
|
||||
}, props, {
|
||||
prefixCls: prefixCls,
|
||||
close: close,
|
||||
onConfirm: onConfirm,
|
||||
onCancel: onCancel
|
||||
})),
|
||||
"data-popover-inject": true
|
||||
}), children));
|
||||
});
|
||||
const Popconfirm = InternalPopconfirm;
|
||||
// We don't care debug panel
|
||||
/* istanbul ignore next */
|
||||
Popconfirm._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Popconfirm.displayName = 'Popconfirm';
|
||||
}
|
||||
export default Popconfirm;
|
||||
17
frontend/node_modules/antd/es/popconfirm/style/index.d.ts
generated
vendored
Normal file
17
frontend/node_modules/antd/es/popconfirm/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { FullToken, GetDefaultToken } from '../../theme/internal';
|
||||
export interface ComponentToken {
|
||||
/**
|
||||
* @desc 确认框 z-index
|
||||
* @descEN z-index of Popconfirm
|
||||
*/
|
||||
zIndexPopup: number;
|
||||
}
|
||||
/**
|
||||
* @desc Popconfirm 组件的 Token
|
||||
* @descEN Token for Popconfirm component
|
||||
*/
|
||||
export interface PopconfirmToken extends FullToken<'Popconfirm'> {
|
||||
}
|
||||
export declare const prepareComponentToken: GetDefaultToken<'Popconfirm'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
67
frontend/node_modules/antd/es/popconfirm/style/index.js
generated
vendored
Normal file
67
frontend/node_modules/antd/es/popconfirm/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
import { genStyleHooks } from '../../theme/internal';
|
||||
// =============================== Base ===============================
|
||||
const genBaseStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
iconCls,
|
||||
antCls,
|
||||
zIndexPopup,
|
||||
colorText,
|
||||
colorWarning,
|
||||
marginXXS,
|
||||
marginXS,
|
||||
fontSize,
|
||||
fontWeightStrong,
|
||||
colorTextHeading
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: {
|
||||
zIndex: zIndexPopup,
|
||||
[`&${antCls}-popover`]: {
|
||||
fontSize
|
||||
},
|
||||
[`${componentCls}-message`]: {
|
||||
marginBottom: marginXS,
|
||||
display: 'flex',
|
||||
flexWrap: 'nowrap',
|
||||
alignItems: 'start',
|
||||
[`> ${componentCls}-message-icon ${iconCls}`]: {
|
||||
color: colorWarning,
|
||||
fontSize,
|
||||
lineHeight: 1,
|
||||
marginInlineEnd: marginXS
|
||||
},
|
||||
[`${componentCls}-title`]: {
|
||||
fontWeight: fontWeightStrong,
|
||||
color: colorTextHeading,
|
||||
'&:only-child': {
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
[`${componentCls}-description`]: {
|
||||
marginTop: marginXXS,
|
||||
color: colorText
|
||||
}
|
||||
},
|
||||
[`${componentCls}-buttons`]: {
|
||||
textAlign: 'end',
|
||||
whiteSpace: 'nowrap',
|
||||
button: {
|
||||
marginInlineStart: marginXS
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
// ============================== Export ==============================
|
||||
export const prepareComponentToken = token => {
|
||||
const {
|
||||
zIndexPopupBase
|
||||
} = token;
|
||||
return {
|
||||
zIndexPopup: zIndexPopupBase + 60
|
||||
};
|
||||
};
|
||||
export default genStyleHooks('Popconfirm', token => genBaseStyle(token), prepareComponentToken, {
|
||||
resetStyle: false
|
||||
});
|
||||
Reference in New Issue
Block a user