9684a6c199176bf905f9acfa9c9a097c.json 9.47 KB
{"ast":null,"code":"import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport Trigger from 'rc-trigger';\nimport * as React from 'react';\nimport DropdownMenu from './DropdownMenu';\nvar BUILT_IN_PLACEMENTS = {\n  bottomRight: {\n    points: ['tl', 'br'],\n    offset: [0, 4],\n    overflow: {\n      adjustX: 0,\n      adjustY: 1\n    }\n  },\n  bottomLeft: {\n    points: ['tr', 'bl'],\n    offset: [0, 4],\n    overflow: {\n      adjustX: 0,\n      adjustY: 1\n    }\n  },\n  topRight: {\n    points: ['bl', 'tr'],\n    offset: [0, -4],\n    overflow: {\n      adjustX: 0,\n      adjustY: 1\n    }\n  },\n  topLeft: {\n    points: ['br', 'tl'],\n    offset: [0, -4],\n    overflow: {\n      adjustX: 0,\n      adjustY: 1\n    }\n  }\n};\n\nvar KeywordTrigger = /*#__PURE__*/function (_React$Component) {\n  _inherits(KeywordTrigger, _React$Component);\n\n  var _super = _createSuper(KeywordTrigger);\n\n  function KeywordTrigger() {\n    var _this;\n\n    _classCallCheck(this, KeywordTrigger);\n\n    _this = _super.apply(this, arguments);\n\n    _this.getDropdownPrefix = function () {\n      return \"\".concat(_this.props.prefixCls, \"-dropdown\");\n    };\n\n    _this.getDropdownElement = function () {\n      var options = _this.props.options;\n      return React.createElement(DropdownMenu, {\n        prefixCls: _this.getDropdownPrefix(),\n        options: options\n      });\n    };\n\n    _this.getDropDownPlacement = function () {\n      var _this$props = _this.props,\n          placement = _this$props.placement,\n          direction = _this$props.direction;\n      var popupPlacement = 'topRight';\n\n      if (direction === 'rtl') {\n        popupPlacement = placement === 'top' ? 'topLeft' : 'bottomLeft';\n      } else {\n        popupPlacement = placement === 'top' ? 'topRight' : 'bottomRight';\n      }\n\n      return popupPlacement;\n    };\n\n    return _this;\n  }\n\n  _createClass(KeywordTrigger, [{\n    key: \"render\",\n    value: function render() {\n      var _this$props2 = this.props,\n          children = _this$props2.children,\n          visible = _this$props2.visible,\n          transitionName = _this$props2.transitionName,\n          getPopupContainer = _this$props2.getPopupContainer;\n      var popupElement = this.getDropdownElement();\n      return React.createElement(Trigger, {\n        prefixCls: this.getDropdownPrefix(),\n        popupVisible: visible,\n        popup: popupElement,\n        popupPlacement: this.getDropDownPlacement(),\n        popupTransitionName: transitionName,\n        builtinPlacements: BUILT_IN_PLACEMENTS,\n        getPopupContainer: getPopupContainer\n      }, children);\n    }\n  }]);\n\n  return KeywordTrigger;\n}(React.Component);\n\nexport default KeywordTrigger;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-mentions/es/KeywordTrigger.js"],"names":["_classCallCheck","_createClass","_inherits","_createSuper","Trigger","React","DropdownMenu","BUILT_IN_PLACEMENTS","bottomRight","points","offset","overflow","adjustX","adjustY","bottomLeft","topRight","topLeft","KeywordTrigger","_React$Component","_super","_this","apply","arguments","getDropdownPrefix","concat","props","prefixCls","getDropdownElement","options","createElement","getDropDownPlacement","_this$props","placement","direction","popupPlacement","key","value","render","_this$props2","children","visible","transitionName","getPopupContainer","popupElement","popupVisible","popup","popupTransitionName","builtinPlacements","Component"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,2CAA5B;AACA,OAAOC,YAAP,MAAyB,wCAAzB;AACA,OAAOC,SAAP,MAAsB,qCAAtB;AACA,OAAOC,YAAP,MAAyB,wCAAzB;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,IAAIC,mBAAmB,GAAG;AACxBC,EAAAA,WAAW,EAAE;AACXC,IAAAA,MAAM,EAAE,CAAC,IAAD,EAAO,IAAP,CADG;AAEXC,IAAAA,MAAM,EAAE,CAAC,CAAD,EAAI,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KA,UAAIC,YAAY,GAAG,KAAKhB,kBAAL,EAAnB;AACA,aAAOtB,KAAK,CAACwB,aAAN,CAAoBzB,OAApB,EAA6B;AAClCsB,QAAAA,SAAS,EAAE,KAAKH,iBAAL,EADuB;AAElCqB,QAAAA,YAAY,EAAEJ,OAFoB;AAGlCK,QAAAA,KAAK,EAAEF,YAH2B;AAIlCT,QAAAA,cAAc,EAAE,KAAKJ,oBAAL,EAJkB;AAKlCgB,QAAAA,mBAAmB,EAAEL,cALa;AAMlCM,QAAAA,iBAAiB,EAAExC,mBANe;AAOlCmC,QAAAA,iBAAiB,EAAEA;AAPe,OAA7B,EAQJH,QARI,CAAP;AASD;AAlB2B,GAAD,CAAjB,CAAZ;;AAqBA,SAAOtB,cAAP;AACD,CAhEiC,CAgEhCZ,KAAK,CAAC2C,SAhE0B,CAAlC;;AAkEA,eAAe/B,cAAf","sourcesContent":["import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport Trigger from 'rc-trigger';\nimport * as React from 'react';\nimport DropdownMenu from './DropdownMenu';\nvar BUILT_IN_PLACEMENTS = {\n  bottomRight: {\n    points: ['tl', 'br'],\n    offset: [0, 4],\n    overflow: {\n      adjustX: 0,\n      adjustY: 1\n    }\n  },\n  bottomLeft: {\n    points: ['tr', 'bl'],\n    offset: [0, 4],\n    overflow: {\n      adjustX: 0,\n      adjustY: 1\n    }\n  },\n  topRight: {\n    points: ['bl', 'tr'],\n    offset: [0, -4],\n    overflow: {\n      adjustX: 0,\n      adjustY: 1\n    }\n  },\n  topLeft: {\n    points: ['br', 'tl'],\n    offset: [0, -4],\n    overflow: {\n      adjustX: 0,\n      adjustY: 1\n    }\n  }\n};\n\nvar KeywordTrigger = /*#__PURE__*/function (_React$Component) {\n  _inherits(KeywordTrigger, _React$Component);\n\n  var _super = _createSuper(KeywordTrigger);\n\n  function KeywordTrigger() {\n    var _this;\n\n    _classCallCheck(this, KeywordTrigger);\n\n    _this = _super.apply(this, arguments);\n\n    _this.getDropdownPrefix = function () {\n      return \"\".concat(_this.props.prefixCls, \"-dropdown\");\n    };\n\n    _this.getDropdownElement = function () {\n      var options = _this.props.options;\n      return React.createElement(DropdownMenu, {\n        prefixCls: _this.getDropdownPrefix(),\n        options: options\n      });\n    };\n\n    _this.getDropDownPlacement = function () {\n      var _this$props = _this.props,\n          placement = _this$props.placement,\n          direction = _this$props.direction;\n      var popupPlacement = 'topRight';\n\n      if (direction === 'rtl') {\n        popupPlacement = placement === 'top' ? 'topLeft' : 'bottomLeft';\n      } else {\n        popupPlacement = placement === 'top' ? 'topRight' : 'bottomRight';\n      }\n\n      return popupPlacement;\n    };\n\n    return _this;\n  }\n\n  _createClass(KeywordTrigger, [{\n    key: \"render\",\n    value: function render() {\n      var _this$props2 = this.props,\n          children = _this$props2.children,\n          visible = _this$props2.visible,\n          transitionName = _this$props2.transitionName,\n          getPopupContainer = _this$props2.getPopupContainer;\n      var popupElement = this.getDropdownElement();\n      return React.createElement(Trigger, {\n        prefixCls: this.getDropdownPrefix(),\n        popupVisible: visible,\n        popup: popupElement,\n        popupPlacement: this.getDropDownPlacement(),\n        popupTransitionName: transitionName,\n        builtinPlacements: BUILT_IN_PLACEMENTS,\n        getPopupContainer: getPopupContainer\n      }, children);\n    }\n  }]);\n\n  return KeywordTrigger;\n}(React.Component);\n\nexport default KeywordTrigger;"]},"metadata":{},"sourceType":"module"}