fe7f928532d923f5e56ff411638a8ae5.json
59.1 KB
{"ast":null,"code":"function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nimport * as React from 'react';\nimport Trigger from 'rc-trigger';\nimport warning from 'warning';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport arrayTreeFilter from 'array-tree-filter';\nimport { isEqualArrays } from './utils';\nimport Menus from './Menus';\nimport BUILT_IN_PLACEMENTS from './placements';\n\nvar Cascader = /*#__PURE__*/function (_React$Component) {\n _inherits(Cascader, _React$Component);\n\n var _super = _createSuper(Cascader);\n\n function Cascader(props) {\n var _this;\n\n _classCallCheck(this, Cascader);\n\n _this = _super.call(this, props);\n\n _this.setPopupVisible = function (popupVisible) {\n var value = _this.state.value;\n\n if (!('popupVisible' in _this.props)) {\n _this.setState({\n popupVisible: popupVisible\n });\n } // sync activeValue with value when panel open\n\n\n if (popupVisible && !_this.state.popupVisible) {\n _this.setState({\n activeValue: value\n });\n }\n\n _this.props.onPopupVisibleChange(popupVisible);\n };\n\n _this.handleChange = function (options, _ref, e) {\n var visible = _ref.visible;\n\n if (e.type !== 'keydown' || e.keyCode === KeyCode.ENTER) {\n _this.props.onChange(options.map(function (o) {\n return o[_this.getFieldName('value')];\n }), options);\n\n _this.setPopupVisible(visible);\n }\n };\n\n _this.handlePopupVisibleChange = function (popupVisible) {\n _this.setPopupVisible(popupVisible);\n };\n\n _this.handleMenuSelect = function (targetOption, menuIndex, e) {\n // Keep focused state for keyboard support\n var triggerNode = _this.trigger.getRootDomNode();\n\n if (triggerNode && triggerNode.focus) {\n triggerNode.focus();\n }\n\n var _this$props = _this.props,\n changeOnSelect = _this$props.changeOnSelect,\n loadData = _this$props.loadData,\n expandTrigger = _this$props.expandTrigger;\n\n if (!targetOption || targetOption.disabled) {\n return;\n }\n\n var activeValue = _this.state.activeValue;\n activeValue = activeValue.slice(0, menuIndex + 1);\n activeValue[menuIndex] = targetOption[_this.getFieldName('value')];\n\n var activeOptions = _this.getActiveOptions(activeValue);\n\n if (targetOption.isLeaf === false && !targetOption[_this.getFieldName('children')] && loadData) {\n if (changeOnSelect) {\n _this.handleChange(activeOptions, {\n visible: true\n }, e);\n }\n\n _this.setState({\n activeValue: activeValue\n });\n\n loadData(activeOptions);\n return;\n }\n\n var newState = {};\n\n if (!targetOption[_this.getFieldName('children')] || !targetOption[_this.getFieldName('children')].length) {\n _this.handleChange(activeOptions, {\n visible: false\n }, e); // set value to activeValue when select leaf option\n\n\n newState.value = activeValue; // add e.type judgement to prevent `onChange` being triggered by mouseEnter\n } else if (changeOnSelect && (e.type === 'click' || e.type === 'keydown')) {\n if (expandTrigger === 'hover') {\n _this.handleChange(activeOptions, {\n visible: false\n }, e);\n } else {\n _this.handleChange(activeOptions, {\n visible: true\n }, e);\n } // set value to activeValue on every select\n\n\n newState.value = activeValue;\n }\n\n newState.activeValue = activeValue; // not change the value by keyboard\n\n if ('value' in _this.props || e.type === 'keydown' && e.keyCode !== KeyCode.ENTER) {\n delete newState.value;\n }\n\n _this.setState(newState);\n };\n\n _this.handleItemDoubleClick = function () {\n var changeOnSelect = _this.props.changeOnSelect;\n\n if (changeOnSelect) {\n _this.setPopupVisible(false);\n }\n };\n\n _this.handleKeyDown = function (e) {\n var children = _this.props.children; // https://github.com/ant-design/ant-design/issues/6717\n // Don't bind keyboard support when children specify the onKeyDown\n\n if (children && children.props.onKeyDown) {\n children.props.onKeyDown(e);\n return;\n }\n\n var activeValue = _toConsumableArray(_this.state.activeValue);\n\n var currentLevel = activeValue.length - 1 < 0 ? 0 : activeValue.length - 1;\n\n var currentOptions = _this.getCurrentLevelOptions();\n\n var currentIndex = currentOptions.map(function (o) {\n return o[_this.getFieldName('value')];\n }).indexOf(activeValue[currentLevel]);\n\n if (e.keyCode !== KeyCode.DOWN && e.keyCode !== KeyCode.UP && e.keyCode !== KeyCode.LEFT && e.keyCode !== KeyCode.RIGHT && e.keyCode !== KeyCode.ENTER && e.keyCode !== KeyCode.SPACE && e.keyCode !== KeyCode.BACKSPACE && e.keyCode !== KeyCode.ESC && e.keyCode !== KeyCode.TAB) {\n return;\n } // Press any keys above to reopen menu\n\n\n if (!_this.state.popupVisible && e.keyCode !== KeyCode.BACKSPACE && e.keyCode !== KeyCode.LEFT && e.keyCode !== KeyCode.RIGHT && e.keyCode !== KeyCode.ESC && e.keyCode !== KeyCode.TAB) {\n _this.setPopupVisible(true);\n\n return;\n }\n\n if (e.keyCode === KeyCode.DOWN || e.keyCode === KeyCode.UP) {\n e.preventDefault();\n var nextIndex = currentIndex;\n\n if (nextIndex !== -1) {\n if (e.keyCode === KeyCode.DOWN) {\n nextIndex += 1;\n nextIndex = nextIndex >= currentOptions.length ? 0 : nextIndex;\n } else {\n nextIndex -= 1;\n nextIndex = nextIndex < 0 ? currentOptions.length - 1 : nextIndex;\n }\n } else {\n nextIndex = 0;\n }\n\n activeValue[currentLevel] = currentOptions[nextIndex][_this.getFieldName('value')];\n } else if (e.keyCode === KeyCode.LEFT || e.keyCode === KeyCode.BACKSPACE) {\n e.preventDefault();\n activeValue.splice(activeValue.length - 1, 1);\n } else if (e.keyCode === KeyCode.RIGHT) {\n e.preventDefault();\n\n if (currentOptions[currentIndex] && currentOptions[currentIndex][_this.getFieldName('children')]) {\n activeValue.push(currentOptions[currentIndex][_this.getFieldName('children')][0][_this.getFieldName('value')]);\n }\n } else if (e.keyCode === KeyCode.ESC || e.keyCode === KeyCode.TAB) {\n _this.setPopupVisible(false);\n\n return;\n }\n\n if (!activeValue || activeValue.length === 0) {\n _this.setPopupVisible(false);\n }\n\n var activeOptions = _this.getActiveOptions(activeValue);\n\n var targetOption = activeOptions[activeOptions.length - 1];\n\n _this.handleMenuSelect(targetOption, activeOptions.length - 1, e);\n\n if (_this.props.onKeyDown) {\n _this.props.onKeyDown(e);\n }\n };\n\n _this.saveTrigger = function (node) {\n _this.trigger = node;\n };\n\n var initialValue = [];\n\n if ('value' in props) {\n initialValue = props.value || [];\n } else if ('defaultValue' in props) {\n initialValue = props.defaultValue || [];\n }\n\n warning(!('filedNames' in props), '`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead.');\n _this.state = {\n popupVisible: props.popupVisible,\n activeValue: initialValue,\n value: initialValue,\n prevProps: props\n };\n _this.defaultFieldNames = {\n label: 'label',\n value: 'value',\n children: 'children'\n };\n return _this;\n }\n\n _createClass(Cascader, [{\n key: \"getPopupDOMNode\",\n value: function getPopupDOMNode() {\n return this.trigger.getPopupDomNode();\n }\n }, {\n key: \"getFieldName\",\n value: function getFieldName(name) {\n var defaultFieldNames = this.defaultFieldNames;\n var _this$props2 = this.props,\n fieldNames = _this$props2.fieldNames,\n filedNames = _this$props2.filedNames;\n\n if ('filedNames' in this.props) {\n return filedNames[name] || defaultFieldNames[name]; // For old compatibility\n }\n\n return fieldNames[name] || defaultFieldNames[name];\n }\n }, {\n key: \"getFieldNames\",\n value: function getFieldNames() {\n var _this$props3 = this.props,\n fieldNames = _this$props3.fieldNames,\n filedNames = _this$props3.filedNames;\n\n if ('filedNames' in this.props) {\n return filedNames; // For old compatibility\n }\n\n return fieldNames;\n }\n }, {\n key: \"getCurrentLevelOptions\",\n value: function getCurrentLevelOptions() {\n var _this2 = this;\n\n var _this$props$options = this.props.options,\n options = _this$props$options === void 0 ? [] : _this$props$options;\n var _this$state$activeVal = this.state.activeValue,\n activeValue = _this$state$activeVal === void 0 ? [] : _this$state$activeVal;\n var result = arrayTreeFilter(options, function (o, level) {\n return o[_this2.getFieldName('value')] === activeValue[level];\n }, {\n childrenKeyName: this.getFieldName('children')\n });\n\n if (result[result.length - 2]) {\n return result[result.length - 2][this.getFieldName('children')];\n }\n\n return _toConsumableArray(options).filter(function (o) {\n return !o.disabled;\n });\n }\n }, {\n key: \"getActiveOptions\",\n value: function getActiveOptions(activeValue) {\n var _this3 = this;\n\n return arrayTreeFilter(this.props.options || [], function (o, level) {\n return o[_this3.getFieldName('value')] === activeValue[level];\n }, {\n childrenKeyName: this.getFieldName('children')\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props4 = this.props,\n prefixCls = _this$props4.prefixCls,\n transitionName = _this$props4.transitionName,\n popupClassName = _this$props4.popupClassName,\n _this$props4$options = _this$props4.options,\n options = _this$props4$options === void 0 ? [] : _this$props4$options,\n disabled = _this$props4.disabled,\n builtinPlacements = _this$props4.builtinPlacements,\n popupPlacement = _this$props4.popupPlacement,\n children = _this$props4.children,\n dropdownRender = _this$props4.dropdownRender,\n restProps = _objectWithoutProperties(_this$props4, [\"prefixCls\", \"transitionName\", \"popupClassName\", \"options\", \"disabled\", \"builtinPlacements\", \"popupPlacement\", \"children\", \"dropdownRender\"]); // Did not show popup when there is no options\n\n\n var menus = React.createElement(\"div\", null);\n var emptyMenuClassName = '';\n\n if (options && options.length > 0) {\n menus = React.createElement(Menus, Object.assign({}, this.props, {\n fieldNames: this.getFieldNames(),\n defaultFieldNames: this.defaultFieldNames,\n activeValue: this.state.activeValue,\n onSelect: this.handleMenuSelect,\n onItemDoubleClick: this.handleItemDoubleClick,\n visible: this.state.popupVisible\n }));\n } else {\n emptyMenuClassName = \" \".concat(prefixCls, \"-menus-empty\");\n }\n\n var popupNode = menus;\n\n if (dropdownRender) {\n popupNode = dropdownRender(menus);\n }\n\n return React.createElement(Trigger, Object.assign({\n ref: this.saveTrigger\n }, restProps, {\n popupPlacement: popupPlacement,\n builtinPlacements: builtinPlacements,\n popupTransitionName: transitionName,\n action: disabled ? [] : ['click'],\n popupVisible: disabled ? false : this.state.popupVisible,\n onPopupVisibleChange: this.handlePopupVisibleChange,\n prefixCls: \"\".concat(prefixCls, \"-menus\"),\n popupClassName: popupClassName + emptyMenuClassName,\n popup: popupNode\n }), React.cloneElement(children, {\n onKeyDown: this.handleKeyDown,\n tabIndex: disabled ? undefined : 0\n }));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var _prevState$prevProps = prevState.prevProps,\n prevProps = _prevState$prevProps === void 0 ? {} : _prevState$prevProps;\n var newState = {\n prevProps: nextProps\n };\n\n if ('value' in nextProps && !isEqualArrays(prevProps.value, nextProps.value)) {\n newState.value = nextProps.value || []; // allow activeValue diff from value\n // https://github.com/ant-design/ant-design/issues/2767\n\n if (!('loadData' in nextProps)) {\n newState.activeValue = nextProps.value || [];\n }\n }\n\n if ('popupVisible' in nextProps) {\n newState.popupVisible = nextProps.popupVisible;\n }\n\n return newState;\n }\n }]);\n\n return Cascader;\n}(React.Component);\n\nCascader.defaultProps = {\n onChange: function onChange() {},\n onPopupVisibleChange: function onPopupVisibleChange() {},\n disabled: false,\n transitionName: '',\n prefixCls: 'rc-cascader',\n popupClassName: '',\n popupPlacement: 'bottomLeft',\n builtinPlacements: BUILT_IN_PLACEMENTS,\n expandTrigger: 'click',\n fieldNames: {\n label: 'label',\n value: 'value',\n children: 'children'\n },\n expandIcon: '>'\n};\nexport default Cascader;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-cascader/es/Cascader.js"],"names":["_typeof","obj","Symbol","iterator","constructor","prototype","_objectWithoutProperties","source","excluded","target","_objectWithoutPropertiesLoose","key","i","Object","getOwnPropertySymbols","sourceSymbolKeys","length","indexOf","propertyIsEnumerable","call","sourceKeys","keys","_toConsumableArray","arr","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","name","Array","from","test","iter","isArray","len","arr2","_classCallCheck","instance","Constructor","_defineProperties","props","descriptor","enumerable","configurable","writable","defineProperty","_createClass","protoProps","staticProps","_inherits","subClass","superClass","create","value","_setPrototypeOf","p","setPrototypeOf","__proto__","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf","result","NewTarget","Reflect","construct","arguments","apply","_possibleConstructorReturn","self","_assertThisInitialized","ReferenceError","sham","Proxy","Date","e","getPrototypeOf","React","Trigger","warning","KeyCode","arrayTreeFilter","isEqualArrays","Menus","BUILT_IN_PLACEMENTS","Cascader","_React$Component","_super","_this","setPopupVisible","popupVisible","state","setState","activeValue","onPopupVisibleChange","handleChange","options","_ref","visible","type","keyCode","ENTER","onChange","map","getFieldName","handlePopupVisibleChange","handleMenuSelect","targetOption","menuIndex","triggerNode","trigger","getRootDomNode","focus","_this$props","changeOnSelect","loadData","expandTrigger","disabled","activeOptions","getActiveOptions","isLeaf","newState","handleItemDoubleClick","handleKeyDown","children","onKeyDown","currentLevel","currentOptions","getCurrentLevelOptions","currentIndex","DOWN","UP","LEFT","RIGHT","SPACE","BACKSPACE","ESC","TAB","preventDefault","nextIndex","splice","push","saveTrigger","node","initialValue","defaultValue","prevProps","defaultFieldNames","label","getPopupDOMNode","getPopupDomNode","_this$props2","fieldNames","filedNames","getFieldNames","_this$props3","_this2","_this$props$options","_this$state$activeVal","level","childrenKeyName","filter","_this3","render","_this$props4","prefixCls","transitionName","popupClassName","_this$props4$options","builtinPlacements","popupPlacement","dropdownRender","restProps","menus","createElement","emptyMenuClassName","assign","onSelect","onItemDoubleClick","concat","popupNode","ref","popupTransitionName","action","popup","cloneElement","tabIndex","undefined","getDerivedStateFromProps","nextProps","prevState","_prevState$prevProps","Component","defaultProps","expandIcon"],"mappings":"AAAA,S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\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport Trigger from 'rc-trigger';\nimport warning from 'warning';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport arrayTreeFilter from 'array-tree-filter';\nimport { isEqualArrays } from './utils';\nimport Menus from './Menus';\nimport BUILT_IN_PLACEMENTS from './placements';\n\nvar Cascader = /*#__PURE__*/function (_React$Component) {\n _inherits(Cascader, _React$Component);\n\n var _super = _createSuper(Cascader);\n\n function Cascader(props) {\n var _this;\n\n _classCallCheck(this, Cascader);\n\n _this = _super.call(this, props);\n\n _this.setPopupVisible = function (popupVisible) {\n var value = _this.state.value;\n\n if (!('popupVisible' in _this.props)) {\n _this.setState({\n popupVisible: popupVisible\n });\n } // sync activeValue with value when panel open\n\n\n if (popupVisible && !_this.state.popupVisible) {\n _this.setState({\n activeValue: value\n });\n }\n\n _this.props.onPopupVisibleChange(popupVisible);\n };\n\n _this.handleChange = function (options, _ref, e) {\n var visible = _ref.visible;\n\n if (e.type !== 'keydown' || e.keyCode === KeyCode.ENTER) {\n _this.props.onChange(options.map(function (o) {\n return o[_this.getFieldName('value')];\n }), options);\n\n _this.setPopupVisible(visible);\n }\n };\n\n _this.handlePopupVisibleChange = function (popupVisible) {\n _this.setPopupVisible(popupVisible);\n };\n\n _this.handleMenuSelect = function (targetOption, menuIndex, e) {\n // Keep focused state for keyboard support\n var triggerNode = _this.trigger.getRootDomNode();\n\n if (triggerNode && triggerNode.focus) {\n triggerNode.focus();\n }\n\n var _this$props = _this.props,\n changeOnSelect = _this$props.changeOnSelect,\n loadData = _this$props.loadData,\n expandTrigger = _this$props.expandTrigger;\n\n if (!targetOption || targetOption.disabled) {\n return;\n }\n\n var activeValue = _this.state.activeValue;\n activeValue = activeValue.slice(0, menuIndex + 1);\n activeValue[menuIndex] = targetOption[_this.getFieldName('value')];\n\n var activeOptions = _this.getActiveOptions(activeValue);\n\n if (targetOption.isLeaf === false && !targetOption[_this.getFieldName('children')] && loadData) {\n if (changeOnSelect) {\n _this.handleChange(activeOptions, {\n visible: true\n }, e);\n }\n\n _this.setState({\n activeValue: activeValue\n });\n\n loadData(activeOptions);\n return;\n }\n\n var newState = {};\n\n if (!targetOption[_this.getFieldName('children')] || !targetOption[_this.getFieldName('children')].length) {\n _this.handleChange(activeOptions, {\n visible: false\n }, e); // set value to activeValue when select leaf option\n\n\n newState.value = activeValue; // add e.type judgement to prevent `onChange` being triggered by mouseEnter\n } else if (changeOnSelect && (e.type === 'click' || e.type === 'keydown')) {\n if (expandTrigger === 'hover') {\n _this.handleChange(activeOptions, {\n visible: false\n }, e);\n } else {\n _this.handleChange(activeOptions, {\n visible: true\n }, e);\n } // set value to activeValue on every select\n\n\n newState.value = activeValue;\n }\n\n newState.activeValue = activeValue; // not change the value by keyboard\n\n if ('value' in _this.props || e.type === 'keydown' && e.keyCode !== KeyCode.ENTER) {\n delete newState.value;\n }\n\n _this.setState(newState);\n };\n\n _this.handleItemDoubleClick = function () {\n var changeOnSelect = _this.props.changeOnSelect;\n\n if (changeOnSelect) {\n _this.setPopupVisible(false);\n }\n };\n\n _this.handleKeyDown = function (e) {\n var children = _this.props.children; // https://github.com/ant-design/ant-design/issues/6717\n // Don't bind keyboard support when children specify the onKeyDown\n\n if (children && children.props.onKeyDown) {\n children.props.onKeyDown(e);\n return;\n }\n\n var activeValue = _toConsumableArray(_this.state.activeValue);\n\n var currentLevel = activeValue.length - 1 < 0 ? 0 : activeValue.length - 1;\n\n var currentOptions = _this.getCurrentLevelOptions();\n\n var currentIndex = currentOptions.map(function (o) {\n return o[_this.getFieldName('value')];\n }).indexOf(activeValue[currentLevel]);\n\n if (e.keyCode !== KeyCode.DOWN && e.keyCode !== KeyCode.UP && e.keyCode !== KeyCode.LEFT && e.keyCode !== KeyCode.RIGHT && e.keyCode !== KeyCode.ENTER && e.keyCode !== KeyCode.SPACE && e.keyCode !== KeyCode.BACKSPACE && e.keyCode !== KeyCode.ESC && e.keyCode !== KeyCode.TAB) {\n return;\n } // Press any keys above to reopen menu\n\n\n if (!_this.state.popupVisible && e.keyCode !== KeyCode.BACKSPACE && e.keyCode !== KeyCode.LEFT && e.keyCode !== KeyCode.RIGHT && e.keyCode !== KeyCode.ESC && e.keyCode !== KeyCode.TAB) {\n _this.setPopupVisible(true);\n\n return;\n }\n\n if (e.keyCode === KeyCode.DOWN || e.keyCode === KeyCode.UP) {\n e.preventDefault();\n var nextIndex = currentIndex;\n\n if (nextIndex !== -1) {\n if (e.keyCode === KeyCode.DOWN) {\n nextIndex += 1;\n nextIndex = nextIndex >= currentOptions.length ? 0 : nextIndex;\n } else {\n nextIndex -= 1;\n nextIndex = nextIndex < 0 ? currentOptions.length - 1 : nextIndex;\n }\n } else {\n nextIndex = 0;\n }\n\n activeValue[currentLevel] = currentOptions[nextIndex][_this.getFieldName('value')];\n } else if (e.keyCode === KeyCode.LEFT || e.keyCode === KeyCode.BACKSPACE) {\n e.preventDefault();\n activeValue.splice(activeValue.length - 1, 1);\n } else if (e.keyCode === KeyCode.RIGHT) {\n e.preventDefault();\n\n if (currentOptions[currentIndex] && currentOptions[currentIndex][_this.getFieldName('children')]) {\n activeValue.push(currentOptions[currentIndex][_this.getFieldName('children')][0][_this.getFieldName('value')]);\n }\n } else if (e.keyCode === KeyCode.ESC || e.keyCode === KeyCode.TAB) {\n _this.setPopupVisible(false);\n\n return;\n }\n\n if (!activeValue || activeValue.length === 0) {\n _this.setPopupVisible(false);\n }\n\n var activeOptions = _this.getActiveOptions(activeValue);\n\n var targetOption = activeOptions[activeOptions.length - 1];\n\n _this.handleMenuSelect(targetOption, activeOptions.length - 1, e);\n\n if (_this.props.onKeyDown) {\n _this.props.onKeyDown(e);\n }\n };\n\n _this.saveTrigger = function (node) {\n _this.trigger = node;\n };\n\n var initialValue = [];\n\n if ('value' in props) {\n initialValue = props.value || [];\n } else if ('defaultValue' in props) {\n initialValue = props.defaultValue || [];\n }\n\n warning(!('filedNames' in props), '`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead.');\n _this.state = {\n popupVisible: props.popupVisible,\n activeValue: initialValue,\n value: initialValue,\n prevProps: props\n };\n _this.defaultFieldNames = {\n label: 'label',\n value: 'value',\n children: 'children'\n };\n return _this;\n }\n\n _createClass(Cascader, [{\n key: \"getPopupDOMNode\",\n value: function getPopupDOMNode() {\n return this.trigger.getPopupDomNode();\n }\n }, {\n key: \"getFieldName\",\n value: function getFieldName(name) {\n var defaultFieldNames = this.defaultFieldNames;\n var _this$props2 = this.props,\n fieldNames = _this$props2.fieldNames,\n filedNames = _this$props2.filedNames;\n\n if ('filedNames' in this.props) {\n return filedNames[name] || defaultFieldNames[name]; // For old compatibility\n }\n\n return fieldNames[name] || defaultFieldNames[name];\n }\n }, {\n key: \"getFieldNames\",\n value: function getFieldNames() {\n var _this$props3 = this.props,\n fieldNames = _this$props3.fieldNames,\n filedNames = _this$props3.filedNames;\n\n if ('filedNames' in this.props) {\n return filedNames; // For old compatibility\n }\n\n return fieldNames;\n }\n }, {\n key: \"getCurrentLevelOptions\",\n value: function getCurrentLevelOptions() {\n var _this2 = this;\n\n var _this$props$options = this.props.options,\n options = _this$props$options === void 0 ? [] : _this$props$options;\n var _this$state$activeVal = this.state.activeValue,\n activeValue = _this$state$activeVal === void 0 ? [] : _this$state$activeVal;\n var result = arrayTreeFilter(options, function (o, level) {\n return o[_this2.getFieldName('value')] === activeValue[level];\n }, {\n childrenKeyName: this.getFieldName('children')\n });\n\n if (result[result.length - 2]) {\n return result[result.length - 2][this.getFieldName('children')];\n }\n\n return _toConsumableArray(options).filter(function (o) {\n return !o.disabled;\n });\n }\n }, {\n key: \"getActiveOptions\",\n value: function getActiveOptions(activeValue) {\n var _this3 = this;\n\n return arrayTreeFilter(this.props.options || [], function (o, level) {\n return o[_this3.getFieldName('value')] === activeValue[level];\n }, {\n childrenKeyName: this.getFieldName('children')\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props4 = this.props,\n prefixCls = _this$props4.prefixCls,\n transitionName = _this$props4.transitionName,\n popupClassName = _this$props4.popupClassName,\n _this$props4$options = _this$props4.options,\n options = _this$props4$options === void 0 ? [] : _this$props4$options,\n disabled = _this$props4.disabled,\n builtinPlacements = _this$props4.builtinPlacements,\n popupPlacement = _this$props4.popupPlacement,\n children = _this$props4.children,\n dropdownRender = _this$props4.dropdownRender,\n restProps = _objectWithoutProperties(_this$props4, [\"prefixCls\", \"transitionName\", \"popupClassName\", \"options\", \"disabled\", \"builtinPlacements\", \"popupPlacement\", \"children\", \"dropdownRender\"]); // Did not show popup when there is no options\n\n\n var menus = React.createElement(\"div\", null);\n var emptyMenuClassName = '';\n\n if (options && options.length > 0) {\n menus = React.createElement(Menus, Object.assign({}, this.props, {\n fieldNames: this.getFieldNames(),\n defaultFieldNames: this.defaultFieldNames,\n activeValue: this.state.activeValue,\n onSelect: this.handleMenuSelect,\n onItemDoubleClick: this.handleItemDoubleClick,\n visible: this.state.popupVisible\n }));\n } else {\n emptyMenuClassName = \" \".concat(prefixCls, \"-menus-empty\");\n }\n\n var popupNode = menus;\n\n if (dropdownRender) {\n popupNode = dropdownRender(menus);\n }\n\n return React.createElement(Trigger, Object.assign({\n ref: this.saveTrigger\n }, restProps, {\n popupPlacement: popupPlacement,\n builtinPlacements: builtinPlacements,\n popupTransitionName: transitionName,\n action: disabled ? [] : ['click'],\n popupVisible: disabled ? false : this.state.popupVisible,\n onPopupVisibleChange: this.handlePopupVisibleChange,\n prefixCls: \"\".concat(prefixCls, \"-menus\"),\n popupClassName: popupClassName + emptyMenuClassName,\n popup: popupNode\n }), React.cloneElement(children, {\n onKeyDown: this.handleKeyDown,\n tabIndex: disabled ? undefined : 0\n }));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var _prevState$prevProps = prevState.prevProps,\n prevProps = _prevState$prevProps === void 0 ? {} : _prevState$prevProps;\n var newState = {\n prevProps: nextProps\n };\n\n if ('value' in nextProps && !isEqualArrays(prevProps.value, nextProps.value)) {\n newState.value = nextProps.value || []; // allow activeValue diff from value\n // https://github.com/ant-design/ant-design/issues/2767\n\n if (!('loadData' in nextProps)) {\n newState.activeValue = nextProps.value || [];\n }\n }\n\n if ('popupVisible' in nextProps) {\n newState.popupVisible = nextProps.popupVisible;\n }\n\n return newState;\n }\n }]);\n\n return Cascader;\n}(React.Component);\n\nCascader.defaultProps = {\n onChange: function onChange() {},\n onPopupVisibleChange: function onPopupVisibleChange() {},\n disabled: false,\n transitionName: '',\n prefixCls: 'rc-cascader',\n popupClassName: '',\n popupPlacement: 'bottomLeft',\n builtinPlacements: BUILT_IN_PLACEMENTS,\n expandTrigger: 'click',\n fieldNames: {\n label: 'label',\n value: 'value',\n children: 'children'\n },\n expandIcon: '>'\n};\nexport default Cascader;"]},"metadata":{},"sourceType":"module"}