317b03b2b18b6119ce8196ed8253dde1.json
16 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\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};\n\nimport * as React from 'react';\nimport Dialog from 'rc-dialog';\nimport classNames from 'classnames';\nimport CloseOutlined from '@ant-design/icons/CloseOutlined';\nimport useModal from './useModal';\nimport { getConfirmLocale } from './locale';\nimport Button from '../button';\nimport { convertLegacyProps } from '../button/button';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\nimport { ConfigContext } from '../config-provider';\nvar mousePosition;\nexport var destroyFns = []; // ref: https://github.com/ant-design/ant-design/issues/15795\n\nvar getClickPosition = function getClickPosition(e) {\n mousePosition = {\n x: e.pageX,\n y: e.pageY\n }; // 100ms 内发生过点击事件,则从点击位置动画展示\n // 否则直接 zoom 展示\n // 这样可以兼容非点击方式展开\n\n setTimeout(function () {\n mousePosition = null;\n }, 100);\n}; // 只有点击事件支持从鼠标位置动画展开\n\n\nif (typeof window !== 'undefined' && window.document && window.document.documentElement) {\n document.documentElement.addEventListener('click', getClickPosition, true);\n}\n\nvar Modal = function Modal(props) {\n var _classNames;\n\n var _React$useContext = React.useContext(ConfigContext),\n getContextPopupContainer = _React$useContext.getPopupContainer,\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var handleCancel = function handleCancel(e) {\n var onCancel = props.onCancel;\n\n if (onCancel) {\n onCancel(e);\n }\n };\n\n var handleOk = function handleOk(e) {\n var onOk = props.onOk;\n\n if (onOk) {\n onOk(e);\n }\n };\n\n var renderFooter = function renderFooter(locale) {\n var okText = props.okText,\n okType = props.okType,\n cancelText = props.cancelText,\n confirmLoading = props.confirmLoading;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _extends({\n onClick: handleCancel\n }, props.cancelButtonProps), cancelText || locale.cancelText), /*#__PURE__*/React.createElement(Button, _extends({}, convertLegacyProps(okType), {\n loading: confirmLoading,\n onClick: handleOk\n }, props.okButtonProps), okText || locale.okText));\n };\n\n var customizePrefixCls = props.prefixCls,\n footer = props.footer,\n visible = props.visible,\n wrapClassName = props.wrapClassName,\n centered = props.centered,\n getContainer = props.getContainer,\n closeIcon = props.closeIcon,\n _props$focusTriggerAf = props.focusTriggerAfterClose,\n focusTriggerAfterClose = _props$focusTriggerAf === void 0 ? true : _props$focusTriggerAf,\n restProps = __rest(props, [\"prefixCls\", \"footer\", \"visible\", \"wrapClassName\", \"centered\", \"getContainer\", \"closeIcon\", \"focusTriggerAfterClose\"]);\n\n var prefixCls = getPrefixCls('modal', customizePrefixCls);\n var defaultFooter = /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"Modal\",\n defaultLocale: getConfirmLocale()\n }, renderFooter);\n var closeIconToRender = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-close-x\")\n }, closeIcon || /*#__PURE__*/React.createElement(CloseOutlined, {\n className: \"\".concat(prefixCls, \"-close-icon\")\n }));\n var wrapClassNameExtended = classNames(wrapClassName, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-centered\"), !!centered), _defineProperty(_classNames, \"\".concat(prefixCls, \"-wrap-rtl\"), direction === 'rtl'), _classNames));\n return /*#__PURE__*/React.createElement(Dialog, _extends({}, restProps, {\n getContainer: getContainer === undefined ? getContextPopupContainer : getContainer,\n prefixCls: prefixCls,\n wrapClassName: wrapClassNameExtended,\n footer: footer === undefined ? defaultFooter : footer,\n visible: visible,\n mousePosition: mousePosition,\n onClose: handleCancel,\n closeIcon: closeIconToRender,\n focusTriggerAfterClose: focusTriggerAfterClose\n }));\n};\n\nModal.useModal = useModal;\nModal.defaultProps = {\n width: 520,\n transitionName: 'zoom',\n maskTransitionName: 'fade',\n confirmLoading: false,\n visible: false,\n okType: 'primary'\n};\nexport default Modal;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/modal/Modal.js"],"names":["_defineProperty","_extends","__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","Dialog","classNames","CloseOutlined","useModal","getConfirmLocale","Button","convertLegacyProps","LocaleReceiver","ConfigContext","mousePosition","destroyFns","getClickPosition","x","pageX","y","pageY","setTimeout","window","document","documentElement","addEventListener","Modal","props","_classNames","_React$useContext","useContext","getContextPopupContainer","getPopupContainer","getPrefixCls","direction","handleCancel","onCancel","handleOk","onOk","renderFooter","locale","okText","okType","cancelText","confirmLoading","createElement","Fragment","onClick","cancelButtonProps","loading","okButtonProps","customizePrefixCls","prefixCls","footer","visible","wrapClassName","centered","getContainer","closeIcon","_props$focusTriggerAf","focusTriggerAfterClose","restProps","defaultFooter","componentName","defaultLocale","closeIconToRender","className","concat","wrapClassNameExtended","undefined","onClose","defaultProps","width","transitionName","maskTransitionName"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uCAA5B;AACA,OAAOC,QAAP,MAAqB,gCAArB;;AAEA,IAAIC,MAAM,GAAG,QAAQ,KAAKA,MAAb,IAAuB,UAAUC,CAAV,EAAaC,CAAb,EAAgB;AAClD,MAAIC,CAAC,GAAG,EAAR;;AAEA,OAAK,IAAIC,CAAT,IAAcH,CAAd,EAAiB;AACf,QAAII,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCP,CAArC,EAAwCG,CAAxC,KAA8CF,CAAC,CAACO,OAAF,CAAUL,CAAV,IAAe,CAAjE,EAAoED,CAAC,CA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a,EAAEa,qBAHuD;AAItEf,IAAAA,MAAM,EAAEA,MAAM,KAAKgB,SAAX,GAAuBP,aAAvB,GAAuCT,MAJuB;AAKtEC,IAAAA,OAAO,EAAEA,OAL6D;AAMtExC,IAAAA,aAAa,EAAEA,aANuD;AAOtEwD,IAAAA,OAAO,EAAEnC,YAP6D;AAQtEuB,IAAAA,SAAS,EAAEO,iBAR2D;AAStEL,IAAAA,sBAAsB,EAAEA;AAT8C,GAAhB,CAApC,CAApB;AAWD,CAtED;;AAwEAlC,KAAK,CAAClB,QAAN,GAAiBA,QAAjB;AACAkB,KAAK,CAAC6C,YAAN,GAAqB;AACnBC,EAAAA,KAAK,EAAE,GADY;AAEnBC,EAAAA,cAAc,EAAE,MAFG;AAGnBC,EAAAA,kBAAkB,EAAE,MAHD;AAInB9B,EAAAA,cAAc,EAAE,KAJG;AAKnBU,EAAAA,OAAO,EAAE,KALU;AAMnBZ,EAAAA,MAAM,EAAE;AANW,CAArB;AAQA,eAAehB,KAAf","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\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};\n\nimport * as React from 'react';\nimport Dialog from 'rc-dialog';\nimport classNames from 'classnames';\nimport CloseOutlined from '@ant-design/icons/CloseOutlined';\nimport useModal from './useModal';\nimport { getConfirmLocale } from './locale';\nimport Button from '../button';\nimport { convertLegacyProps } from '../button/button';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\nimport { ConfigContext } from '../config-provider';\nvar mousePosition;\nexport var destroyFns = []; // ref: https://github.com/ant-design/ant-design/issues/15795\n\nvar getClickPosition = function getClickPosition(e) {\n mousePosition = {\n x: e.pageX,\n y: e.pageY\n }; // 100ms 内发生过点击事件,则从点击位置动画展示\n // 否则直接 zoom 展示\n // 这样可以兼容非点击方式展开\n\n setTimeout(function () {\n mousePosition = null;\n }, 100);\n}; // 只有点击事件支持从鼠标位置动画展开\n\n\nif (typeof window !== 'undefined' && window.document && window.document.documentElement) {\n document.documentElement.addEventListener('click', getClickPosition, true);\n}\n\nvar Modal = function Modal(props) {\n var _classNames;\n\n var _React$useContext = React.useContext(ConfigContext),\n getContextPopupContainer = _React$useContext.getPopupContainer,\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var handleCancel = function handleCancel(e) {\n var onCancel = props.onCancel;\n\n if (onCancel) {\n onCancel(e);\n }\n };\n\n var handleOk = function handleOk(e) {\n var onOk = props.onOk;\n\n if (onOk) {\n onOk(e);\n }\n };\n\n var renderFooter = function renderFooter(locale) {\n var okText = props.okText,\n okType = props.okType,\n cancelText = props.cancelText,\n confirmLoading = props.confirmLoading;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _extends({\n onClick: handleCancel\n }, props.cancelButtonProps), cancelText || locale.cancelText), /*#__PURE__*/React.createElement(Button, _extends({}, convertLegacyProps(okType), {\n loading: confirmLoading,\n onClick: handleOk\n }, props.okButtonProps), okText || locale.okText));\n };\n\n var customizePrefixCls = props.prefixCls,\n footer = props.footer,\n visible = props.visible,\n wrapClassName = props.wrapClassName,\n centered = props.centered,\n getContainer = props.getContainer,\n closeIcon = props.closeIcon,\n _props$focusTriggerAf = props.focusTriggerAfterClose,\n focusTriggerAfterClose = _props$focusTriggerAf === void 0 ? true : _props$focusTriggerAf,\n restProps = __rest(props, [\"prefixCls\", \"footer\", \"visible\", \"wrapClassName\", \"centered\", \"getContainer\", \"closeIcon\", \"focusTriggerAfterClose\"]);\n\n var prefixCls = getPrefixCls('modal', customizePrefixCls);\n var defaultFooter = /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"Modal\",\n defaultLocale: getConfirmLocale()\n }, renderFooter);\n var closeIconToRender = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-close-x\")\n }, closeIcon || /*#__PURE__*/React.createElement(CloseOutlined, {\n className: \"\".concat(prefixCls, \"-close-icon\")\n }));\n var wrapClassNameExtended = classNames(wrapClassName, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-centered\"), !!centered), _defineProperty(_classNames, \"\".concat(prefixCls, \"-wrap-rtl\"), direction === 'rtl'), _classNames));\n return /*#__PURE__*/React.createElement(Dialog, _extends({}, restProps, {\n getContainer: getContainer === undefined ? getContextPopupContainer : getContainer,\n prefixCls: prefixCls,\n wrapClassName: wrapClassNameExtended,\n footer: footer === undefined ? defaultFooter : footer,\n visible: visible,\n mousePosition: mousePosition,\n onClose: handleCancel,\n closeIcon: closeIconToRender,\n focusTriggerAfterClose: focusTriggerAfterClose\n }));\n};\n\nModal.useModal = useModal;\nModal.defaultProps = {\n width: 520,\n transitionName: 'zoom',\n maskTransitionName: 'fade',\n confirmLoading: false,\n visible: false,\n okType: 'primary'\n};\nexport default Modal;"]},"metadata":{},"sourceType":"module"}