7ea41c14b3e86365566836cea260c58e.json
28.2 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/createSuper\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';\nimport { tuple } from '../_util/type';\nimport { getInputClassName } from './Input';\nimport { cloneElement } from '../_util/reactNode';\nvar ClearableInputType = tuple('text', 'input');\nexport function hasPrefixSuffix(props) {\n return !!(props.prefix || props.suffix || props.allowClear);\n}\n\nfunction hasAddon(props) {\n return !!(props.addonBefore || props.addonAfter);\n}\n\nvar ClearableLabeledInput = /*#__PURE__*/function (_React$Component) {\n _inherits(ClearableLabeledInput, _React$Component);\n\n var _super = _createSuper(ClearableLabeledInput);\n\n function ClearableLabeledInput() {\n var _this;\n\n _classCallCheck(this, ClearableLabeledInput);\n\n _this = _super.apply(this, arguments);\n /** @private Do not use out of this class. We do not promise this is always keep. */\n\n _this.containerRef = /*#__PURE__*/React.createRef();\n\n _this.onInputMouseUp = function (e) {\n var _a;\n\n if ((_a = _this.containerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {\n var triggerFocus = _this.props.triggerFocus;\n triggerFocus === null || triggerFocus === void 0 ? void 0 : triggerFocus();\n }\n };\n\n return _this;\n }\n\n _createClass(ClearableLabeledInput, [{\n key: \"renderClearIcon\",\n value: function renderClearIcon(prefixCls) {\n var _this$props = this.props,\n allowClear = _this$props.allowClear,\n value = _this$props.value,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly,\n handleReset = _this$props.handleReset;\n\n if (!allowClear) {\n return null;\n }\n\n var needClear = !disabled && !readOnly && value;\n var className = \"\".concat(prefixCls, \"-clear-icon\");\n return /*#__PURE__*/React.createElement(CloseCircleFilled, {\n onClick: handleReset,\n className: classNames(_defineProperty({}, \"\".concat(className, \"-hidden\"), !needClear), className),\n role: \"button\"\n });\n }\n }, {\n key: \"renderSuffix\",\n value: function renderSuffix(prefixCls) {\n var _this$props2 = this.props,\n suffix = _this$props2.suffix,\n allowClear = _this$props2.allowClear;\n\n if (suffix || allowClear) {\n return /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-suffix\")\n }, this.renderClearIcon(prefixCls), suffix);\n }\n\n return null;\n }\n }, {\n key: \"renderLabeledIcon\",\n value: function renderLabeledIcon(prefixCls, element) {\n var _classNames2;\n\n var _this$props3 = this.props,\n focused = _this$props3.focused,\n value = _this$props3.value,\n prefix = _this$props3.prefix,\n className = _this$props3.className,\n size = _this$props3.size,\n suffix = _this$props3.suffix,\n disabled = _this$props3.disabled,\n allowClear = _this$props3.allowClear,\n direction = _this$props3.direction,\n style = _this$props3.style,\n readOnly = _this$props3.readOnly,\n bordered = _this$props3.bordered;\n var suffixNode = this.renderSuffix(prefixCls);\n\n if (!hasPrefixSuffix(this.props)) {\n return cloneElement(element, {\n value: value\n });\n }\n\n var prefixNode = prefix ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-prefix\")\n }, prefix) : null;\n var affixWrapperCls = classNames(\"\".concat(prefixCls, \"-affix-wrapper\"), (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-focused\"), focused), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-disabled\"), disabled), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-sm\"), size === 'small'), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-lg\"), size === 'large'), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-input-with-clear-btn\"), suffix && allowClear && value), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-rtl\"), direction === 'rtl'), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-readonly\"), readOnly), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-borderless\"), !bordered), _defineProperty(_classNames2, \"\".concat(className), !hasAddon(this.props) && className), _classNames2));\n return /*#__PURE__*/React.createElement(\"span\", {\n ref: this.containerRef,\n className: affixWrapperCls,\n style: style,\n onMouseUp: this.onInputMouseUp\n }, prefixNode, cloneElement(element, {\n style: null,\n value: value,\n className: getInputClassName(prefixCls, bordered, size, disabled)\n }), suffixNode);\n }\n }, {\n key: \"renderInputWithLabel\",\n value: function renderInputWithLabel(prefixCls, labeledElement) {\n var _classNames4;\n\n var _this$props4 = this.props,\n addonBefore = _this$props4.addonBefore,\n addonAfter = _this$props4.addonAfter,\n style = _this$props4.style,\n size = _this$props4.size,\n className = _this$props4.className,\n direction = _this$props4.direction; // Not wrap when there is not addons\n\n if (!hasAddon(this.props)) {\n return labeledElement;\n }\n\n var wrapperClassName = \"\".concat(prefixCls, \"-group\");\n var addonClassName = \"\".concat(wrapperClassName, \"-addon\");\n var addonBeforeNode = addonBefore ? /*#__PURE__*/React.createElement(\"span\", {\n className: addonClassName\n }, addonBefore) : null;\n var addonAfterNode = addonAfter ? /*#__PURE__*/React.createElement(\"span\", {\n className: addonClassName\n }, addonAfter) : null;\n var mergedWrapperClassName = classNames(\"\".concat(prefixCls, \"-wrapper\"), wrapperClassName, _defineProperty({}, \"\".concat(wrapperClassName, \"-rtl\"), direction === 'rtl'));\n var mergedGroupClassName = classNames(\"\".concat(prefixCls, \"-group-wrapper\"), (_classNames4 = {}, _defineProperty(_classNames4, \"\".concat(prefixCls, \"-group-wrapper-sm\"), size === 'small'), _defineProperty(_classNames4, \"\".concat(prefixCls, \"-group-wrapper-lg\"), size === 'large'), _defineProperty(_classNames4, \"\".concat(prefixCls, \"-group-wrapper-rtl\"), direction === 'rtl'), _classNames4), className); // Need another wrapper for changing display:table to display:inline-block\n // and put style prop in wrapper\n\n return /*#__PURE__*/React.createElement(\"span\", {\n className: mergedGroupClassName,\n style: style\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: mergedWrapperClassName\n }, addonBeforeNode, cloneElement(labeledElement, {\n style: null\n }), addonAfterNode));\n }\n }, {\n key: \"renderTextAreaWithClearIcon\",\n value: function renderTextAreaWithClearIcon(prefixCls, element) {\n var _classNames5;\n\n var _this$props5 = this.props,\n value = _this$props5.value,\n allowClear = _this$props5.allowClear,\n className = _this$props5.className,\n style = _this$props5.style,\n direction = _this$props5.direction,\n bordered = _this$props5.bordered;\n\n if (!allowClear) {\n return cloneElement(element, {\n value: value\n });\n }\n\n var affixWrapperCls = classNames(\"\".concat(prefixCls, \"-affix-wrapper\"), \"\".concat(prefixCls, \"-affix-wrapper-textarea-with-clear-btn\"), (_classNames5 = {}, _defineProperty(_classNames5, \"\".concat(prefixCls, \"-affix-wrapper-rtl\"), direction === 'rtl'), _defineProperty(_classNames5, \"\".concat(prefixCls, \"-affix-wrapper-borderless\"), !bordered), _defineProperty(_classNames5, \"\".concat(className), !hasAddon(this.props) && className), _classNames5));\n return /*#__PURE__*/React.createElement(\"span\", {\n className: affixWrapperCls,\n style: style\n }, cloneElement(element, {\n style: null,\n value: value\n }), this.renderClearIcon(prefixCls));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props6 = this.props,\n prefixCls = _this$props6.prefixCls,\n inputType = _this$props6.inputType,\n element = _this$props6.element;\n\n if (inputType === ClearableInputType[0]) {\n return this.renderTextAreaWithClearIcon(prefixCls, element);\n }\n\n return this.renderInputWithLabel(prefixCls, this.renderLabeledIcon(prefixCls, element));\n }\n }]);\n\n return ClearableLabeledInput;\n}(React.Component);\n\nexport default ClearableLabeledInput;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/input/ClearableLabeledInput.js"],"names":["_defineProperty","_classCallCheck","_createClass","_inherits","_createSuper","React","classNames","CloseCircleFilled","tuple","getInputClassName","cloneElement","ClearableInputType","hasPrefixSuffix","props","prefix","suffix","allowClear","hasAddon","addonBefore","addonAfter","ClearableLabeledInput","_React$Component","_super","_this","apply","arguments","containerRef","createRef","onInputMouseUp","e","_a","current","contains","target","triggerFocus","key","value","renderClearIcon","prefixCls","_this$props","disabled","readOnly","handleReset","needClear","className","concat","createElement","onClick","role","renderSuffix","_this$props2","renderLabeledIcon","element","_classNames2","_this$props3","focused","size","direction","style","bordered","suffixNode","prefixNode","affixWrapperCls","ref","onMouseUp","renderInputWithLabel","labeledElement","_classNames4","_this$props4","wrapperClassName","addonClassName","addonBeforeNode","addonAfterNode","mergedWrapperClassName","mergedGroupClassName","renderTextAreaWithClearIcon","_classNames5","_this$props5","render","_this$props6","inputType","Component"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uCAA5B;AACA,OAAOC,eAAP,MAA4B,uCAA5B;AACA,OAAOC,YAAP,MAAyB,oCAAzB;AACA,OAAOC,SAAP,MAAsB,iCAAtB;AACA,OAAOC,YAAP,MAAyB,oCAAzB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,iBAAP,MAA8B,qCAA9B;AACA,SAASC,KAAT,QAAsB,eAAtB;AACA,SAASC,iBAAT,QAAkC,SAAlC;AACA,SAASC,YAAT,QAA6B,oBAA7B;AACA,IAAIC,kBAAkB,GAAGH,KAAK,CAAC,MAAD,EAAS,OAAT,CAA9B;AACA,OAAO,SAASI,eAAT,CAAyBC,KAAzB,EAAgC;AACrC,SAAO,CAAC,EAAEA,KAAK,CAACC,MAAN,IAAgBD,KAAK,CAACE,MAAtB,IAAgCF,KAAK,CAACG,UAAxC,CAAR;AACD;;AAED,SAASC,QAAT,CAAkBJ,KAAlB,EAAyB;AACvB,SAAO,CAAC,EAAEA,KAAK,CAACK,WAAN,IAAqBL,KAAK,CAACM,UAA7B,CAAR;AACD;;AAED,IAAIC,qBAAqB,GAAG,aAAa,UAAUC,gBAAV,EAA4B;AACnElB,EAAAA,SAAS,CAACiB,qB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AAN,CAAoB,MAApB,EAA4B;AAC9CF,QAAAA,SAAS,EAAEkB,eADmC;AAE9CJ,QAAAA,KAAK,EAAEA;AAFuC,OAA5B,EAGjBhD,YAAY,CAAC0C,OAAD,EAAU;AACvBM,QAAAA,KAAK,EAAE,IADgB;AAEvBtB,QAAAA,KAAK,EAAEA;AAFgB,OAAV,CAHK,EAMhB,KAAKC,eAAL,CAAqBC,SAArB,CANgB,CAApB;AAOD;AA3BA,GApHiC,EAgJjC;AACDH,IAAAA,GAAG,EAAE,QADJ;AAEDC,IAAAA,KAAK,EAAE,SAAS0C,MAAT,GAAkB;AACvB,UAAIC,YAAY,GAAG,KAAKlE,KAAxB;AAAA,UACIyB,SAAS,GAAGyC,YAAY,CAACzC,SAD7B;AAAA,UAEI0C,SAAS,GAAGD,YAAY,CAACC,SAF7B;AAAA,UAGI5B,OAAO,GAAG2B,YAAY,CAAC3B,OAH3B;;AAKA,UAAI4B,SAAS,KAAKrE,kBAAkB,CAAC,CAAD,CAApC,EAAyC;AACvC,eAAO,KAAKgE,2BAAL,CAAiCrC,SAAjC,EAA4Cc,OAA5C,CAAP;AACD;;AAED,aAAO,KAAKa,oBAAL,CAA0B3B,SAA1B,EAAqC,KAAKa,iBAAL,CAAuBb,SAAvB,EAAkCc,OAAlC,CAArC,CAAP;AACD;AAbA,GAhJiC,CAAxB,CAAZ;;AAgKA,SAAOhC,qBAAP;AACD,CA5LwC,CA4LvCf,KAAK,CAAC4E,SA5LiC,CAAzC;;AA8LA,eAAe7D,qBAAf","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/createSuper\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';\nimport { tuple } from '../_util/type';\nimport { getInputClassName } from './Input';\nimport { cloneElement } from '../_util/reactNode';\nvar ClearableInputType = tuple('text', 'input');\nexport function hasPrefixSuffix(props) {\n return !!(props.prefix || props.suffix || props.allowClear);\n}\n\nfunction hasAddon(props) {\n return !!(props.addonBefore || props.addonAfter);\n}\n\nvar ClearableLabeledInput = /*#__PURE__*/function (_React$Component) {\n _inherits(ClearableLabeledInput, _React$Component);\n\n var _super = _createSuper(ClearableLabeledInput);\n\n function ClearableLabeledInput() {\n var _this;\n\n _classCallCheck(this, ClearableLabeledInput);\n\n _this = _super.apply(this, arguments);\n /** @private Do not use out of this class. We do not promise this is always keep. */\n\n _this.containerRef = /*#__PURE__*/React.createRef();\n\n _this.onInputMouseUp = function (e) {\n var _a;\n\n if ((_a = _this.containerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {\n var triggerFocus = _this.props.triggerFocus;\n triggerFocus === null || triggerFocus === void 0 ? void 0 : triggerFocus();\n }\n };\n\n return _this;\n }\n\n _createClass(ClearableLabeledInput, [{\n key: \"renderClearIcon\",\n value: function renderClearIcon(prefixCls) {\n var _this$props = this.props,\n allowClear = _this$props.allowClear,\n value = _this$props.value,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly,\n handleReset = _this$props.handleReset;\n\n if (!allowClear) {\n return null;\n }\n\n var needClear = !disabled && !readOnly && value;\n var className = \"\".concat(prefixCls, \"-clear-icon\");\n return /*#__PURE__*/React.createElement(CloseCircleFilled, {\n onClick: handleReset,\n className: classNames(_defineProperty({}, \"\".concat(className, \"-hidden\"), !needClear), className),\n role: \"button\"\n });\n }\n }, {\n key: \"renderSuffix\",\n value: function renderSuffix(prefixCls) {\n var _this$props2 = this.props,\n suffix = _this$props2.suffix,\n allowClear = _this$props2.allowClear;\n\n if (suffix || allowClear) {\n return /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-suffix\")\n }, this.renderClearIcon(prefixCls), suffix);\n }\n\n return null;\n }\n }, {\n key: \"renderLabeledIcon\",\n value: function renderLabeledIcon(prefixCls, element) {\n var _classNames2;\n\n var _this$props3 = this.props,\n focused = _this$props3.focused,\n value = _this$props3.value,\n prefix = _this$props3.prefix,\n className = _this$props3.className,\n size = _this$props3.size,\n suffix = _this$props3.suffix,\n disabled = _this$props3.disabled,\n allowClear = _this$props3.allowClear,\n direction = _this$props3.direction,\n style = _this$props3.style,\n readOnly = _this$props3.readOnly,\n bordered = _this$props3.bordered;\n var suffixNode = this.renderSuffix(prefixCls);\n\n if (!hasPrefixSuffix(this.props)) {\n return cloneElement(element, {\n value: value\n });\n }\n\n var prefixNode = prefix ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-prefix\")\n }, prefix) : null;\n var affixWrapperCls = classNames(\"\".concat(prefixCls, \"-affix-wrapper\"), (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-focused\"), focused), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-disabled\"), disabled), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-sm\"), size === 'small'), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-lg\"), size === 'large'), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-input-with-clear-btn\"), suffix && allowClear && value), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-rtl\"), direction === 'rtl'), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-readonly\"), readOnly), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-affix-wrapper-borderless\"), !bordered), _defineProperty(_classNames2, \"\".concat(className), !hasAddon(this.props) && className), _classNames2));\n return /*#__PURE__*/React.createElement(\"span\", {\n ref: this.containerRef,\n className: affixWrapperCls,\n style: style,\n onMouseUp: this.onInputMouseUp\n }, prefixNode, cloneElement(element, {\n style: null,\n value: value,\n className: getInputClassName(prefixCls, bordered, size, disabled)\n }), suffixNode);\n }\n }, {\n key: \"renderInputWithLabel\",\n value: function renderInputWithLabel(prefixCls, labeledElement) {\n var _classNames4;\n\n var _this$props4 = this.props,\n addonBefore = _this$props4.addonBefore,\n addonAfter = _this$props4.addonAfter,\n style = _this$props4.style,\n size = _this$props4.size,\n className = _this$props4.className,\n direction = _this$props4.direction; // Not wrap when there is not addons\n\n if (!hasAddon(this.props)) {\n return labeledElement;\n }\n\n var wrapperClassName = \"\".concat(prefixCls, \"-group\");\n var addonClassName = \"\".concat(wrapperClassName, \"-addon\");\n var addonBeforeNode = addonBefore ? /*#__PURE__*/React.createElement(\"span\", {\n className: addonClassName\n }, addonBefore) : null;\n var addonAfterNode = addonAfter ? /*#__PURE__*/React.createElement(\"span\", {\n className: addonClassName\n }, addonAfter) : null;\n var mergedWrapperClassName = classNames(\"\".concat(prefixCls, \"-wrapper\"), wrapperClassName, _defineProperty({}, \"\".concat(wrapperClassName, \"-rtl\"), direction === 'rtl'));\n var mergedGroupClassName = classNames(\"\".concat(prefixCls, \"-group-wrapper\"), (_classNames4 = {}, _defineProperty(_classNames4, \"\".concat(prefixCls, \"-group-wrapper-sm\"), size === 'small'), _defineProperty(_classNames4, \"\".concat(prefixCls, \"-group-wrapper-lg\"), size === 'large'), _defineProperty(_classNames4, \"\".concat(prefixCls, \"-group-wrapper-rtl\"), direction === 'rtl'), _classNames4), className); // Need another wrapper for changing display:table to display:inline-block\n // and put style prop in wrapper\n\n return /*#__PURE__*/React.createElement(\"span\", {\n className: mergedGroupClassName,\n style: style\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: mergedWrapperClassName\n }, addonBeforeNode, cloneElement(labeledElement, {\n style: null\n }), addonAfterNode));\n }\n }, {\n key: \"renderTextAreaWithClearIcon\",\n value: function renderTextAreaWithClearIcon(prefixCls, element) {\n var _classNames5;\n\n var _this$props5 = this.props,\n value = _this$props5.value,\n allowClear = _this$props5.allowClear,\n className = _this$props5.className,\n style = _this$props5.style,\n direction = _this$props5.direction,\n bordered = _this$props5.bordered;\n\n if (!allowClear) {\n return cloneElement(element, {\n value: value\n });\n }\n\n var affixWrapperCls = classNames(\"\".concat(prefixCls, \"-affix-wrapper\"), \"\".concat(prefixCls, \"-affix-wrapper-textarea-with-clear-btn\"), (_classNames5 = {}, _defineProperty(_classNames5, \"\".concat(prefixCls, \"-affix-wrapper-rtl\"), direction === 'rtl'), _defineProperty(_classNames5, \"\".concat(prefixCls, \"-affix-wrapper-borderless\"), !bordered), _defineProperty(_classNames5, \"\".concat(className), !hasAddon(this.props) && className), _classNames5));\n return /*#__PURE__*/React.createElement(\"span\", {\n className: affixWrapperCls,\n style: style\n }, cloneElement(element, {\n style: null,\n value: value\n }), this.renderClearIcon(prefixCls));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props6 = this.props,\n prefixCls = _this$props6.prefixCls,\n inputType = _this$props6.inputType,\n element = _this$props6.element;\n\n if (inputType === ClearableInputType[0]) {\n return this.renderTextAreaWithClearIcon(prefixCls, element);\n }\n\n return this.renderInputWithLabel(prefixCls, this.renderLabeledIcon(prefixCls, element));\n }\n }]);\n\n return ClearableLabeledInput;\n}(React.Component);\n\nexport default ClearableLabeledInput;"]},"metadata":{},"sourceType":"module"}