77a46953549168ed18450d58233a42cf.json
20.5 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\";\n/* eslint react/prop-types: 0 */\n\nimport React from 'react';\nimport KEYCODE from './KeyCode';\n\nvar Options = /*#__PURE__*/function (_React$Component) {\n _inherits(Options, _React$Component);\n\n var _super = _createSuper(Options);\n\n function Options() {\n var _this;\n\n _classCallCheck(this, Options);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n _this.state = {\n goInputText: ''\n };\n\n _this.buildOptionText = function (value) {\n return \"\".concat(value, \" \").concat(_this.props.locale.items_per_page);\n };\n\n _this.changeSize = function (value) {\n _this.props.changeSize(Number(value));\n };\n\n _this.handleChange = function (e) {\n _this.setState({\n goInputText: e.target.value\n });\n };\n\n _this.handleBlur = function (e) {\n var _this$props = _this.props,\n goButton = _this$props.goButton,\n quickGo = _this$props.quickGo,\n rootPrefixCls = _this$props.rootPrefixCls;\n var goInputText = _this.state.goInputText;\n\n if (goButton || goInputText === '') {\n return;\n }\n\n if (e.relatedTarget && (e.relatedTarget.className.indexOf(\"\".concat(rootPrefixCls, \"-prev\")) >= 0 || e.relatedTarget.className.indexOf(\"\".concat(rootPrefixCls, \"-next\")) >= 0)) {\n return;\n }\n\n _this.setState({\n goInputText: ''\n });\n\n quickGo(_this.getValidValue());\n };\n\n _this.go = function (e) {\n var goInputText = _this.state.goInputText;\n\n if (goInputText === '') {\n return;\n }\n\n if (e.keyCode === KEYCODE.ENTER || e.type === 'click') {\n _this.setState({\n goInputText: ''\n });\n\n _this.props.quickGo(_this.getValidValue());\n }\n };\n\n return _this;\n }\n\n _createClass(Options, [{\n key: \"getValidValue\",\n value: function getValidValue() {\n var _this$state = this.state,\n goInputText = _this$state.goInputText,\n current = _this$state.current; // eslint-disable-next-line no-restricted-globals\n\n return !goInputText || isNaN(goInputText) ? current : Number(goInputText);\n }\n }, {\n key: \"getPageSizeOptions\",\n value: function getPageSizeOptions() {\n var _this$props2 = this.props,\n pageSize = _this$props2.pageSize,\n pageSizeOptions = _this$props2.pageSizeOptions;\n\n if (pageSizeOptions.some(function (option) {\n return option.toString() === pageSize.toString();\n })) {\n return pageSizeOptions;\n }\n\n return pageSizeOptions.concat([pageSize.toString()]).sort(function (a, b) {\n // eslint-disable-next-line no-restricted-globals\n var numberA = isNaN(Number(a)) ? 0 : Number(a); // eslint-disable-next-line no-restricted-globals\n\n var numberB = isNaN(Number(b)) ? 0 : Number(b);\n return numberA - numberB;\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n pageSize = _this$props3.pageSize,\n locale = _this$props3.locale,\n rootPrefixCls = _this$props3.rootPrefixCls,\n changeSize = _this$props3.changeSize,\n quickGo = _this$props3.quickGo,\n goButton = _this$props3.goButton,\n selectComponentClass = _this$props3.selectComponentClass,\n buildOptionText = _this$props3.buildOptionText,\n selectPrefixCls = _this$props3.selectPrefixCls,\n disabled = _this$props3.disabled;\n var goInputText = this.state.goInputText;\n var prefixCls = \"\".concat(rootPrefixCls, \"-options\");\n var Select = selectComponentClass;\n var changeSelect = null;\n var goInput = null;\n var gotoButton = null;\n\n if (!changeSize && !quickGo) {\n return null;\n }\n\n var pageSizeOptions = this.getPageSizeOptions();\n\n if (changeSize && Select) {\n var options = pageSizeOptions.map(function (opt, i) {\n return /*#__PURE__*/React.createElement(Select.Option, {\n key: i,\n value: opt.toString()\n }, (buildOptionText || _this2.buildOptionText)(opt));\n });\n changeSelect = /*#__PURE__*/React.createElement(Select, {\n disabled: disabled,\n prefixCls: selectPrefixCls,\n showSearch: false,\n className: \"\".concat(prefixCls, \"-size-changer\"),\n optionLabelProp: \"children\",\n dropdownMatchSelectWidth: false,\n value: (pageSize || pageSizeOptions[0]).toString(),\n onChange: this.changeSize,\n getPopupContainer: function getPopupContainer(triggerNode) {\n return triggerNode.parentNode;\n }\n }, options);\n }\n\n if (quickGo) {\n if (goButton) {\n gotoButton = typeof goButton === 'boolean' ? /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: this.go,\n onKeyUp: this.go,\n disabled: disabled,\n className: \"\".concat(prefixCls, \"-quick-jumper-button\")\n }, locale.jump_to_confirm) : /*#__PURE__*/React.createElement(\"span\", {\n onClick: this.go,\n onKeyUp: this.go\n }, goButton);\n }\n\n goInput = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-quick-jumper\")\n }, locale.jump_to, /*#__PURE__*/React.createElement(\"input\", {\n disabled: disabled,\n type: \"text\",\n value: goInputText,\n onChange: this.handleChange,\n onKeyUp: this.go,\n onBlur: this.handleBlur\n }), locale.page, gotoButton);\n }\n\n return /*#__PURE__*/React.createElement(\"li\", {\n className: \"\".concat(prefixCls)\n }, changeSelect, goInput);\n }\n }]);\n\n return Options;\n}(React.Component);\n\nOptions.defaultProps = {\n pageSizeOptions: ['10', '20', '50', '100']\n};\nexport default Options;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-pagination/es/Options.js"],"names":["_classCallCheck","_createClass","_inherits","_createSuper","React","KEYCODE","Options","_React$Component","_super","_this","_len","arguments","length","args","Array","_key","call","apply","concat","state","goInputText","buildOptionText","value","props","locale","items_per_page","changeSize","Number","handleChange","e","setState","target","handleBlur","_this$props","goButton","quickGo","rootPrefixCls","relatedTarget","className","indexOf","getValidValue","go","keyCode","ENTER","type","key","_this$state","current","isNaN","getPageSizeOptions","_this$props2","pageSize","pageSizeOptions","some","option","toString","sort","a","b","numberA","numberB","render","_this2","_this$props3","selectComponentClass","selectPrefixCls","disabled","prefixCls","Select","changeSelect","goInput","gotoButton","options","map","opt","i","createElement","Option","showSearch","optionLabelProp","dropdownMatchSelectWidth","onChange","getPopupContainer","triggerNode","parentNode","onClick","onKeyUp","jump_to_confirm","jump_to","onBlur","page","Component","defaultProps"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,2CAA5B;AACA,OAAOC,YAAP,MAAyB,wCAAzB;AACA,OAAOC,SAAP,MAAsB,qCAAtB;AACA,OAAOC,YAAP,MAAyB,wCAAzB;AAEA;;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,OAAP,MAAoB,WAApB;;AAEA,IAAIC,OAAO,GAAG,aAAa,UAAUC,gBAAV,EAA4B;AACrDL,EAAAA,SAAS,CAACI,OAAD,EAAUC,gBAAV,CAAT;;AAEA,MAAIC,MAAM,GAAGL,YAAY,CAACG,OAAD,CAAzB;;AAEA,WAASA,OAAT,GAAmB;AACjB,QAAIG,KAAJ;;AAEAT,IAAAA,eAAe,CAAC,IAAD,EAAOM,OAAP,CAAf;;AAEA,SAAK,IAAII,IAAI,GAAGC,SAAS,CAACC,MAArB,EAA6BC,IAAI,GAAG,IAAIC,KAAJ,CAAUJ,IAAV,CAApC,EAAqDK,IAAI,GAAG,CAAjE,EAAoEA,IAAI,GAAGL,IAA3E,EAAiFK,IAAI,EAArF,EAAyF;AACvFF,MAAAA,IAAI,CAACE,IAAD,CAAJ,GAAaJ,SAAS,CAACI,IAAD,CAAtB;AACD;;AAEDN,IAAAA,KAAK,GAAGD,MAAM,CAACQ,IAAP,CAAYC,KAAZ,CAAkBT,MAAlB,EAA0B,CAAC,IAAD,EAAOU,MAAP,CAAcL,IAAd,CAA1B,CAAR;AACAJ,IAAAA,KAAK,CAACU,KAAN,GAAc;AACZC,MAAAA,WAAW,EAAE;AADD,KAAd;;AAIAX,IAAAA,KAAK,CAACY,eAAN,GAAwB,UAAUC,KAAV,EAAiB;AACvC,aAAO,GAAGJ,MAAH,CAAUI,KAAV,EAAiB,GAAjB,EAAsBJ,MAAtB,CAA6BT,KAAK,CAACc,KAAN,CAAYC,MAAZ,CAAmBC,cAA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,IATY,EASNnB,UATM,CAAvB;AAUD;;AAED,aAAO,aAAanE,KAAK,CAACwE,aAAN,CAAoB,IAApB,EAA0B;AAC5CtC,QAAAA,SAAS,EAAE,GAAGpB,MAAH,CAAUiD,SAAV;AADiC,OAA1B,EAEjBE,YAFiB,EAEHC,OAFG,CAApB;AAGD;AAhFA,GA9BmB,CAAV,CAAZ;;AAiHA,SAAOhE,OAAP;AACD,CA5L0B,CA4LzBF,KAAK,CAACuF,SA5LmB,CAA3B;;AA8LArF,OAAO,CAACsF,YAAR,GAAuB;AACrBxC,EAAAA,eAAe,EAAE,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,KAAnB;AADI,CAAvB;AAGA,eAAe9C,OAAf","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\";\n\n/* eslint react/prop-types: 0 */\nimport React from 'react';\nimport KEYCODE from './KeyCode';\n\nvar Options = /*#__PURE__*/function (_React$Component) {\n _inherits(Options, _React$Component);\n\n var _super = _createSuper(Options);\n\n function Options() {\n var _this;\n\n _classCallCheck(this, Options);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n _this.state = {\n goInputText: ''\n };\n\n _this.buildOptionText = function (value) {\n return \"\".concat(value, \" \").concat(_this.props.locale.items_per_page);\n };\n\n _this.changeSize = function (value) {\n _this.props.changeSize(Number(value));\n };\n\n _this.handleChange = function (e) {\n _this.setState({\n goInputText: e.target.value\n });\n };\n\n _this.handleBlur = function (e) {\n var _this$props = _this.props,\n goButton = _this$props.goButton,\n quickGo = _this$props.quickGo,\n rootPrefixCls = _this$props.rootPrefixCls;\n var goInputText = _this.state.goInputText;\n\n if (goButton || goInputText === '') {\n return;\n }\n\n if (e.relatedTarget && (e.relatedTarget.className.indexOf(\"\".concat(rootPrefixCls, \"-prev\")) >= 0 || e.relatedTarget.className.indexOf(\"\".concat(rootPrefixCls, \"-next\")) >= 0)) {\n return;\n }\n\n _this.setState({\n goInputText: ''\n });\n\n quickGo(_this.getValidValue());\n };\n\n _this.go = function (e) {\n var goInputText = _this.state.goInputText;\n\n if (goInputText === '') {\n return;\n }\n\n if (e.keyCode === KEYCODE.ENTER || e.type === 'click') {\n _this.setState({\n goInputText: ''\n });\n\n _this.props.quickGo(_this.getValidValue());\n }\n };\n\n return _this;\n }\n\n _createClass(Options, [{\n key: \"getValidValue\",\n value: function getValidValue() {\n var _this$state = this.state,\n goInputText = _this$state.goInputText,\n current = _this$state.current; // eslint-disable-next-line no-restricted-globals\n\n return !goInputText || isNaN(goInputText) ? current : Number(goInputText);\n }\n }, {\n key: \"getPageSizeOptions\",\n value: function getPageSizeOptions() {\n var _this$props2 = this.props,\n pageSize = _this$props2.pageSize,\n pageSizeOptions = _this$props2.pageSizeOptions;\n\n if (pageSizeOptions.some(function (option) {\n return option.toString() === pageSize.toString();\n })) {\n return pageSizeOptions;\n }\n\n return pageSizeOptions.concat([pageSize.toString()]).sort(function (a, b) {\n // eslint-disable-next-line no-restricted-globals\n var numberA = isNaN(Number(a)) ? 0 : Number(a); // eslint-disable-next-line no-restricted-globals\n\n var numberB = isNaN(Number(b)) ? 0 : Number(b);\n return numberA - numberB;\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n pageSize = _this$props3.pageSize,\n locale = _this$props3.locale,\n rootPrefixCls = _this$props3.rootPrefixCls,\n changeSize = _this$props3.changeSize,\n quickGo = _this$props3.quickGo,\n goButton = _this$props3.goButton,\n selectComponentClass = _this$props3.selectComponentClass,\n buildOptionText = _this$props3.buildOptionText,\n selectPrefixCls = _this$props3.selectPrefixCls,\n disabled = _this$props3.disabled;\n var goInputText = this.state.goInputText;\n var prefixCls = \"\".concat(rootPrefixCls, \"-options\");\n var Select = selectComponentClass;\n var changeSelect = null;\n var goInput = null;\n var gotoButton = null;\n\n if (!changeSize && !quickGo) {\n return null;\n }\n\n var pageSizeOptions = this.getPageSizeOptions();\n\n if (changeSize && Select) {\n var options = pageSizeOptions.map(function (opt, i) {\n return /*#__PURE__*/React.createElement(Select.Option, {\n key: i,\n value: opt.toString()\n }, (buildOptionText || _this2.buildOptionText)(opt));\n });\n changeSelect = /*#__PURE__*/React.createElement(Select, {\n disabled: disabled,\n prefixCls: selectPrefixCls,\n showSearch: false,\n className: \"\".concat(prefixCls, \"-size-changer\"),\n optionLabelProp: \"children\",\n dropdownMatchSelectWidth: false,\n value: (pageSize || pageSizeOptions[0]).toString(),\n onChange: this.changeSize,\n getPopupContainer: function getPopupContainer(triggerNode) {\n return triggerNode.parentNode;\n }\n }, options);\n }\n\n if (quickGo) {\n if (goButton) {\n gotoButton = typeof goButton === 'boolean' ? /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: this.go,\n onKeyUp: this.go,\n disabled: disabled,\n className: \"\".concat(prefixCls, \"-quick-jumper-button\")\n }, locale.jump_to_confirm) : /*#__PURE__*/React.createElement(\"span\", {\n onClick: this.go,\n onKeyUp: this.go\n }, goButton);\n }\n\n goInput = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-quick-jumper\")\n }, locale.jump_to, /*#__PURE__*/React.createElement(\"input\", {\n disabled: disabled,\n type: \"text\",\n value: goInputText,\n onChange: this.handleChange,\n onKeyUp: this.go,\n onBlur: this.handleBlur\n }), locale.page, gotoButton);\n }\n\n return /*#__PURE__*/React.createElement(\"li\", {\n className: \"\".concat(prefixCls)\n }, changeSelect, goInput);\n }\n }]);\n\n return Options;\n}(React.Component);\n\nOptions.defaultProps = {\n pageSizeOptions: ['10', '20', '50', '100']\n};\nexport default Options;"]},"metadata":{},"sourceType":"module"}