6ed2296f9f70002250ef05c67ebbd81b.json
16.3 KB
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\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 classNames from 'classnames';\nimport RcMentions from 'rc-mentions';\nimport { composeRef } from \"rc-util/es/ref\";\nimport Spin from '../spin';\nimport { ConfigContext } from '../config-provider';\nvar Option = RcMentions.Option;\nexport { Option };\n\nfunction loadingFilterOption() {\n return true;\n}\n\nvar InternalMentions = function InternalMentions(_a, ref) {\n var _classNames;\n\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n disabled = _a.disabled,\n loading = _a.loading,\n filterOption = _a.filterOption,\n children = _a.children,\n notFoundContent = _a.notFoundContent,\n restProps = __rest(_a, [\"prefixCls\", \"className\", \"disabled\", \"loading\", \"filterOption\", \"children\", \"notFoundContent\"]);\n\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n focused = _React$useState2[0],\n setFocused = _React$useState2[1];\n\n var innerRef = React.useRef();\n var mergedRef = composeRef(ref, innerRef);\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n renderEmpty = _React$useContext.renderEmpty,\n direction = _React$useContext.direction;\n\n var onFocus = function onFocus() {\n if (restProps.onFocus) {\n restProps.onFocus.apply(restProps, arguments);\n }\n\n setFocused(true);\n };\n\n var onBlur = function onBlur() {\n if (restProps.onBlur) {\n restProps.onBlur.apply(restProps, arguments);\n }\n\n setFocused(false);\n };\n\n var getNotFoundContent = function getNotFoundContent() {\n if (notFoundContent !== undefined) {\n return notFoundContent;\n }\n\n return renderEmpty('Select');\n };\n\n var getOptions = function getOptions() {\n if (loading) {\n return /*#__PURE__*/React.createElement(Option, {\n value: \"ANTD_SEARCHING\",\n disabled: true\n }, /*#__PURE__*/React.createElement(Spin, {\n size: \"small\"\n }));\n }\n\n return children;\n };\n\n var getFilterOption = function getFilterOption() {\n if (loading) {\n return loadingFilterOption;\n }\n\n return filterOption;\n };\n\n var prefixCls = getPrefixCls('mentions', customizePrefixCls);\n var mergedClassName = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-disabled\"), disabled), _defineProperty(_classNames, \"\".concat(prefixCls, \"-focused\"), focused), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames), className);\n return /*#__PURE__*/React.createElement(RcMentions, _extends({\n prefixCls: prefixCls,\n notFoundContent: getNotFoundContent(),\n className: mergedClassName,\n disabled: disabled,\n direction: direction\n }, restProps, {\n filterOption: getFilterOption(),\n onFocus: onFocus,\n onBlur: onBlur,\n ref: mergedRef\n }), getOptions());\n};\n\nvar Mentions = /*#__PURE__*/React.forwardRef(InternalMentions);\nMentions.displayName = 'Mentions';\nMentions.Option = Option;\n\nMentions.getMentions = function () {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var config = arguments.length > 1 ? arguments[1] : undefined;\n\n var _ref = config || {},\n _ref$prefix = _ref.prefix,\n prefix = _ref$prefix === void 0 ? '@' : _ref$prefix,\n _ref$split = _ref.split,\n split = _ref$split === void 0 ? ' ' : _ref$split;\n\n var prefixList = Array.isArray(prefix) ? prefix : [prefix];\n return value.split(split).map(function () {\n var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var hitPrefix = null;\n prefixList.some(function (prefixStr) {\n var startStr = str.slice(0, prefixStr.length);\n\n if (startStr === prefixStr) {\n hitPrefix = prefixStr;\n return true;\n }\n\n return false;\n });\n\n if (hitPrefix !== null) {\n return {\n prefix: hitPrefix,\n value: str.slice(hitPrefix.length)\n };\n }\n\n return null;\n }).filter(function (entity) {\n return !!entity && !!entity.value;\n });\n};\n\nexport default Mentions;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/mentions/index.js"],"names":["_extends","_defineProperty","_slicedToArray","__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","classNames","RcMentions","composeRef","Spin","ConfigContext","Option","loadingFilterOption","InternalMentions","_a","ref","_classNames","customizePrefixCls","prefixCls","className","disabled","loading","filterOption","children","notFoundContent","restProps","_React$useState","useState","_React$useState2","focused","setFocused","innerRef","useRef","mergedRef","_React$useContext","useContext","getPrefixCls","renderEmpty","direction","onFocus","apply","arguments","onBlur","getNotFoundContent","undefined","getOptions","createElement","value","size","getFilterOption","mergedClassName","concat","Mentions","forwardRef","displayName","getMentions","config","_ref","_ref$prefix","prefix","_ref$split","split","prefixList","Array","isArray","map","str","hitPrefix","some","prefixStr","startStr","slice","filter","entity"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,gCAArB;AACA,OAAOC,eAAP,MAA4B,uCAA5B;AACA,OAAOC,cAAP,MAA2B,sCAA3B;;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,CAACC,CAAD,CAAD,GAAOH,CAAC,CAACG,CAAD,CAAR;A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A,UAJ1C;;AAMA,MAAIE,UAAU,GAAGC,KAAK,CAACC,OAAN,CAAcL,MAAd,IAAwBA,MAAxB,GAAiC,CAACA,MAAD,CAAlD;AACA,SAAOZ,KAAK,CAACc,KAAN,CAAYA,KAAZ,EAAmBI,GAAnB,CAAuB,YAAY;AACxC,QAAIC,GAAG,GAAGzB,SAAS,CAACtC,MAAV,GAAmB,CAAnB,IAAwBsC,SAAS,CAAC,CAAD,CAAT,KAAiBG,SAAzC,GAAqDH,SAAS,CAAC,CAAD,CAA9D,GAAoE,EAA9E;AACA,QAAI0B,SAAS,GAAG,IAAhB;AACAL,IAAAA,UAAU,CAACM,IAAX,CAAgB,UAAUC,SAAV,EAAqB;AACnC,UAAIC,QAAQ,GAAGJ,GAAG,CAACK,KAAJ,CAAU,CAAV,EAAaF,SAAS,CAAClE,MAAvB,CAAf;;AAEA,UAAImE,QAAQ,KAAKD,SAAjB,EAA4B;AAC1BF,QAAAA,SAAS,GAAGE,SAAZ;AACA,eAAO,IAAP;AACD;;AAED,aAAO,KAAP;AACD,KATD;;AAWA,QAAIF,SAAS,KAAK,IAAlB,EAAwB;AACtB,aAAO;AACLR,QAAAA,MAAM,EAAEQ,SADH;AAELpB,QAAAA,KAAK,EAAEmB,GAAG,CAACK,KAAJ,CAAUJ,SAAS,CAAChE,MAApB;AAFF,OAAP;AAID;;AAED,WAAO,IAAP;AACD,GAtBM,EAsBJqE,MAtBI,CAsBG,UAAUC,MAAV,EAAkB;AAC1B,WAAO,CAAC,CAACA,MAAF,IAAY,CAAC,CAACA,MAAM,CAAC1B,KAA5B;AACD,GAxBM,CAAP;AAyBD,CApCD;;AAsCA,eAAeK,QAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\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 classNames from 'classnames';\nimport RcMentions from 'rc-mentions';\nimport { composeRef } from \"rc-util/es/ref\";\nimport Spin from '../spin';\nimport { ConfigContext } from '../config-provider';\nvar Option = RcMentions.Option;\nexport { Option };\n\nfunction loadingFilterOption() {\n return true;\n}\n\nvar InternalMentions = function InternalMentions(_a, ref) {\n var _classNames;\n\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n disabled = _a.disabled,\n loading = _a.loading,\n filterOption = _a.filterOption,\n children = _a.children,\n notFoundContent = _a.notFoundContent,\n restProps = __rest(_a, [\"prefixCls\", \"className\", \"disabled\", \"loading\", \"filterOption\", \"children\", \"notFoundContent\"]);\n\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n focused = _React$useState2[0],\n setFocused = _React$useState2[1];\n\n var innerRef = React.useRef();\n var mergedRef = composeRef(ref, innerRef);\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n renderEmpty = _React$useContext.renderEmpty,\n direction = _React$useContext.direction;\n\n var onFocus = function onFocus() {\n if (restProps.onFocus) {\n restProps.onFocus.apply(restProps, arguments);\n }\n\n setFocused(true);\n };\n\n var onBlur = function onBlur() {\n if (restProps.onBlur) {\n restProps.onBlur.apply(restProps, arguments);\n }\n\n setFocused(false);\n };\n\n var getNotFoundContent = function getNotFoundContent() {\n if (notFoundContent !== undefined) {\n return notFoundContent;\n }\n\n return renderEmpty('Select');\n };\n\n var getOptions = function getOptions() {\n if (loading) {\n return /*#__PURE__*/React.createElement(Option, {\n value: \"ANTD_SEARCHING\",\n disabled: true\n }, /*#__PURE__*/React.createElement(Spin, {\n size: \"small\"\n }));\n }\n\n return children;\n };\n\n var getFilterOption = function getFilterOption() {\n if (loading) {\n return loadingFilterOption;\n }\n\n return filterOption;\n };\n\n var prefixCls = getPrefixCls('mentions', customizePrefixCls);\n var mergedClassName = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-disabled\"), disabled), _defineProperty(_classNames, \"\".concat(prefixCls, \"-focused\"), focused), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames), className);\n return /*#__PURE__*/React.createElement(RcMentions, _extends({\n prefixCls: prefixCls,\n notFoundContent: getNotFoundContent(),\n className: mergedClassName,\n disabled: disabled,\n direction: direction\n }, restProps, {\n filterOption: getFilterOption(),\n onFocus: onFocus,\n onBlur: onBlur,\n ref: mergedRef\n }), getOptions());\n};\n\nvar Mentions = /*#__PURE__*/React.forwardRef(InternalMentions);\nMentions.displayName = 'Mentions';\nMentions.Option = Option;\n\nMentions.getMentions = function () {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var config = arguments.length > 1 ? arguments[1] : undefined;\n\n var _ref = config || {},\n _ref$prefix = _ref.prefix,\n prefix = _ref$prefix === void 0 ? '@' : _ref$prefix,\n _ref$split = _ref.split,\n split = _ref$split === void 0 ? ' ' : _ref$split;\n\n var prefixList = Array.isArray(prefix) ? prefix : [prefix];\n return value.split(split).map(function () {\n var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var hitPrefix = null;\n prefixList.some(function (prefixStr) {\n var startStr = str.slice(0, prefixStr.length);\n\n if (startStr === prefixStr) {\n hitPrefix = prefixStr;\n return true;\n }\n\n return false;\n });\n\n if (hitPrefix !== null) {\n return {\n prefix: hitPrefix,\n value: str.slice(hitPrefix.length)\n };\n }\n\n return null;\n }).filter(function (entity) {\n return !!entity && !!entity.value;\n });\n};\n\nexport default Mentions;"]},"metadata":{},"sourceType":"module"}