1 line
12 KiB
JSON
1 line
12 KiB
JSON
|
{"ast":null,"code":"\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport ExclamationCircleFilled from \"@ant-design/icons/es/icons/ExclamationCircleFilled\";\nimport classNames from 'classnames';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport omit from \"rc-util/es/omit\";\nimport { ConfigContext } from '../config-provider';\nimport Popover from '../popover';\nimport PurePanel, { Overlay } from './PurePanel';\nimport useStyle from './style';\nconst InternalPopconfirm = /*#__PURE__*/React.forwardRef((props, ref) => {\n var _a, _b;\n const {\n prefixCls: customizePrefixCls,\n placement = 'top',\n trigger = 'click',\n okType = 'primary',\n icon = /*#__PURE__*/React.createElement(ExclamationCircleFilled, null),\n children,\n overlayClassName,\n onOpenChange,\n onVisibleChange\n } = props,\n restProps = __rest(props, [\"prefixCls\", \"placement\", \"trigger\", \"okType\", \"icon\", \"children\", \"overlayClassName\", \"onOpenChange\", \"onVisibleChange\"]);\n const {\n getPrefixCls\n } = React.useContext(ConfigContext);\n const [open, setOpen] = useMergedState(false, {\n value: (_a = props.open) !== null && _a !== void 0 ? _a : props.visible,\n defaultValue: (_b = props.defaultOpen) !== null && _b !== void 0 ? _b : props.defaultVisible\n });\n const settingOpen = (value, e) => {\n setOpen(value, true);\n onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(value);\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(value, e);\n };\n const close = e => {\n settingOpen(false, e);\n };\n const onConfirm = e => {\n var _a;\n return (_a = props.onConfirm) === null || _a === void 0 ? void 0 : _a.call(this, e);\n };\n const onCancel = e => {\n var _a;\n settingOpen(false, e);\n (_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(this, e);\n };\n const onInternalOpenChange = (value, e) => {\n const {\n disabled = false\n } = props;\n if (disabled) {\n return;\n }\n settingOpen(value, e);\n };\n const prefixCls = getPrefixCls('popconfirm', customizePrefixCls);\n const overlayClassNames = classNames(prefixCls, overlayClassName);\n const [wrapCSSVar] = useStyle(prefixCls);\n return wrapCSSVar( /*#__PURE__*/React.createElement(Popover, Object.assign({}, omit(restProps, ['title']), {\n trigger: trigger,\n placement: placement,\n onOpenChange: onInternalOpenChange,\n open: open,\n ref: ref,\n overlayClassName: overlayClassNames,\n content: /*#__PURE__*/React.createElement(Overlay, Object.assign({\n okType: okType,\n icon: icon\n }, props, {\n prefixCls: prefixCls,\n close: close,\n onConfirm: onConfirm,\n onCancel: onCancel\n })),\n \"data-popover-inject\": true\n }), children));\n});\nconst Popconfirm = InternalPopconfirm;\n// We don't care debug panel\n/* istanbul ignore next */\nPopconfirm._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;\nif (process.env.NODE_ENV !== 'production') {\n Popconfirm.displayName = 'Popconfirm';\n}\nexport default Popconfirm;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","ExclamationCircleFilled","classNames","useMergedState","omit","ConfigContext","Popover","PurePanel","Overlay","useStyle","InternalPopconfirm","forwardRef","props","ref","_a","_b","prefixCls","customizePrefixCls","placement","trigger","okType","icon","createElement","children","overlayC
|