1 line
43 KiB
JavaScript
1 line
43 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[0],{"2fM7":function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return I}));var o=n("q1tI"),r=n("17x9"),i=n("i+PK"),a=n("TSYQ"),l=n.n(a),u=n("BGR+"),c=n("H84U"),s=n("6CfX"),p=n("CtXQ"),f=n("CWQg");function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=O(e);if(t){var r=O(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return g(this,n)}}function g(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},S=Object(f.a)("default","large","small"),C=(Object(f.a)("default","multiple","tags","combobox","SECRET_COMBOBOX_MODE_DO_NOT_USE"),{prefixCls:r.string,className:r.string,size:r.oneOf(S),notFoundContent:r.any,showSearch:r.bool,optionLabelProp:r.string,transitionName:r.string,choiceTransitionName:r.string,id:r.string}),I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(f,e);var t,n,r,a=y(f);function f(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(t=a.call(this,e)).saveSelect=function(e){t.rcSelect=e},t.renderSelect=function(e){var n,r=e.getPopupContainer,a=e.getPrefixCls,c=e.renderEmpty,s=t.props,f=s.prefixCls,d=s.className,h=void 0===d?"":d,b=s.size,y=s.mode,g=s.getPopupContainer,O=s.removeIcon,S=s.clearIcon,C=s.menuItemSelectedIcon,I=s.showArrow,_=w(s,["prefixCls","className","size","mode","getPopupContainer","removeIcon","clearIcon","menuItemSelectedIcon","showArrow"]),E=Object(u.default)(_,["inputIcon"]),x=a("select",f),V=l()((v(n={},"".concat(x,"-lg"),"large"===b),v(n,"".concat(x,"-sm"),"small"===b),v(n,"".concat(x,"-show-arrow"),I),n),h),P=t.props.optionLabelProp;t.isCombobox()&&(P=P||"value");var D={multiple:"multiple"===y,tags:"tags"===y,combobox:t.isCombobox()},T=O&&(o.isValidElement(O)?o.cloneElement(O,{className:l()(O.props.className,"".concat(x,"-remove-icon"))}):O)||o.createElement(p.default,{type:"close",className:"".concat(x,"-remove-icon")}),N=S&&(o.isValidElement(S)?o.cloneElement(S,{className:l()(S.props.className,"".concat(x,"-clear-icon"))}):S)||o.createElement(p.default,{type:"close-circle",theme:"filled",className:"".concat(x,"-clear-icon")}),k=C&&(o.isValidElement(C)?o.cloneElement(C,{className:l()(C.props.className,"".concat(x,"-selected-icon"))}):C)||o.createElement(p.default,{type:"check",className:"".concat(x,"-selected-icon")});return o.createElement(i.c,m({inputIcon:t.renderSuffixIcon(x),removeIcon:T,clearIcon:N,menuItemSelectedIcon:k,showArrow:I},E,D,{prefixCls:x,className:V,optionLabelProp:P||"children",notFoundContent:t.getNotFoundContent(c),getPopupContainer:g||r,ref:t.saveSelect}))},Object(s.a)("combobox"!==e.mode,"Select","The combobox mode is deprecated, it will be removed in next major version, please use AutoComplete instead"),t}return t=f,(n=[{key:"getNotFoundContent",value:function(e){var t=this.props.notFoundContent;return void 0!==t?t:this.isCombobox()?null:e("Select")}},{key:"focus",value:function(){this.rcSelect.focus()}},{key:"blur",value:function(){this.rcSelect.blur()}},{key:"isCombobox",value:function(){var e=this.props.mode;return"combobox"===e||e===f.SECRET_COMBOBOX_MODE_DO_NOT_USE}},{key:"renderSuffixIcon",value:function(e){var t=this.props,n=t.loading,r=t.suffixIcon;return r?o.isValidElement(r)?o.cloneElement(r,{className:l()(r.props.className,"".concat(e,"-arrow-icon"))}):r:n?o.createElement(p.default,{type:"loading"}):o.createElement(p.default,{type:"down",className:"".concat(e,"-arrow-icon")})}},{key:"render",value:function(){return o.createElement(c.a,null,this.renderSelect)}}])&&h(t.prototype,n),r&&h(t,r),f}(o.Component);I.Option=i.b,I.OptGroup=i.a,I.SECRET_COMBOBOX_MODE_DO_NOT_USE="SECRET_COMBOBOX_MODE_DO_NOT_USE",I.defaultProps={showSearch:!1,transitionName:"slide-up",choiceTransitionName:"zoom"},I.propTypes=C},"8QGh":function(e,t,n){"use strict";n.r(t);n("SchZ"),n("IYBL"),n("vAZS")},IYBL:function(e,t,n){},Zm9Q:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("q1tI"),r=n.n(o),i=n("TOwV");function a(e){var t=[];return r.a.Children.forEach(e,(function(e){null!=e&&(Array.isArray(e)?t=t.concat(a(e)):Object(i.isFragment)(e)&&e.props?t=t.concat(a(e.props.children)):t.push(e))})),t}},"i+PK":function(e,t,n){"use strict";n.d(t,"b",(function(){return v})),n.d(t,"a",(function(){return c}));var o=n("q1tI"),r=n.n(o);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=function(e){function t(){return i(this,t),a(this,l(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,e),t}(o.Component);c.isSelectOptGroup=!0;var s=n("17x9");function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var v=function(e){function t(){return p(this,t),f(this,d(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(t,e),t}(o.Component);function h(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function b(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=t[0],r=t[1],i=t[2],a=t.slice(3),l=s.oneOfType([s.string,s.number]),u=s.shape({key:l.isRequired,label:s.node});if(!o.labelInValue){if(("multiple"===o.mode||"tags"===o.mode||o.multiple||o.tags)&&""===o[r])return new Error("Invalid prop `".concat(r,"` of type `string` supplied to `").concat(i,"`, ")+"expected `array` when `multiple` or `tags` is `true`.");var c=s.oneOfType([s.arrayOf(l),l]);return c.apply(void 0,[o,r,i].concat(h(a)))}var p=s.oneOfType([s.arrayOf(u),u]),f=p.apply(void 0,[o,r,i].concat(h(a)));return f?new Error("Invalid prop `".concat(r,"` supplied to `").concat(i,"`, ")+"when you set `labelInValue` to `true`, `".concat(r,"` should in ")+"shape of `{ key: string | number, label?: ReactNode }`."):null}v.propTypes={value:s.oneOfType([s.string,s.number])},v.isSelectOption=!0;var y={id:s.string,defaultActiveFirstOption:s.bool,multiple:s.bool,filterOption:s.any,children:s.any,showSearch:s.bool,disabled:s.bool,allowClear:s.bool,showArrow:s.bool,tags:s.bool,prefixCls:s.string,className:s.string,transitionName:s.string,optionLabelProp:s.string,optionFilterProp:s.string,animation:s.string,choiceTransitionName:s.string,open:s.bool,defaultOpen:s.bool,onChange:s.func,onBlur:s.func,onFocus:s.func,onSelect:s.func,onSearch:s.func,onPopupScroll:s.func,onMouseEnter:s.func,onMouseLeave:s.func,onInputKeyDown:s.func,placeholder:s.any,onDeselect:s.func,labelInValue:s.bool,loading:s.bool,value:b,defaultValue:b,dropdownStyle:s.object,maxTagTextLength:s.number,maxTagCount:s.number,maxTagPlaceholder:s.oneOfType([s.node,s.func]),tokenSeparators:s.arrayOf(s.string),getInputElement:s.func,showAction:s.arrayOf(s.string),clearIcon:s.node,inputIcon:s.node,removeIcon:s.node,menuItemSelectedIcon:s.oneOfType([s.func,s.node]),dropdownRender:s.func},g=n("TSYQ"),O=n.n(g),w=n("PFWz"),S=n.n(w),C=n("MFj2"),I=n("1j5w"),_=n("Zm9Q"),E=n("4IlW"),x=n("i8i4"),V=n("VCL8"),P=n("2W6z"),D=n.n(P),T=n("61SU"),N=n.n(T),k=n("uciX"),M=n("9Do8"),R=n.n(M);function F(e){return"string"==typeof e?e:""}function j(e){if(!e)return null;var t=e.props;if("value"in t)return t.value;if(e.key)return e.key;if(e.type&&e.type.isSelectOptGroup&&t.label)return t.label;throw new Error("Need at least a key or a value or a label (only for OptGroup) for ".concat(e))}function A(e,t){return"value"===t?j(e):e.props[t]}function B(e){return e.combobox}function L(e){return e.multiple||e.tags}function W(e){return L(e)||B(e)}function K(e){return!W(e)}function U(e){var t=e;return void 0===e?t=[]:Array.isArray(e)||(t=[e]),t}function G(e){return"".concat(typeof e,"-").concat(e)}function X(e){e.preventDefault()}function Y(e,t){var n=-1;if(e)for(var o=0;o<e.length;o++)if(e[o]===t){n=o;break}return n}function Q(e,t){var n;if(e=U(e))for(var o=0;o<e.length;o++)if(e[o].key===t){n=e[o].label;break}return n}var z={userSelect:"none",WebkitUserSelect:"none"},q={unselectable:"on"};function Z(e,t){return!t.props.disabled&&U(A(t,this.props.optionFilterProp)).join("").toLowerCase().indexOf(e.toLowerCase())>-1}function H(e,t){return function(n){e[t]=n}}function J(){return(J=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function $(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ee(e){return(ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function te(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ne(e,t){return(ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var oe=function(e){function t(e){var n,i,a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i=this,a=ee(t).call(this,e),(n=!a||"object"!=typeof a&&"function"!=typeof a?te(i):a).rafInstance=null,n.lastVisible=!1,n.scrollActiveItemToView=function(){var e=Object(x.findDOMNode)(n.firstActiveItem),t=n.props,o=t.visible,r=t.firstActiveValue,i=n.props.value;if(e&&o){var a={onlyScrollIfNeeded:!0};i&&0!==i.length||!r||(a.alignWithTop=!0),n.rafInstance=N()((function(){R()(e,Object(x.findDOMNode)(n.menuRef),a)}))}},n.renderMenu=function(){var e=n.props,t=e.menuItems,i=e.menuItemSelectedIcon,a=e.defaultActiveFirstOption,l=e.prefixCls,u=e.multiple,c=e.onMenuSelect,s=e.inputValue,p=e.backfillValue,f=e.onMenuDeselect,d=e.visible,m=n.props.firstActiveValue;if(t&&t.length){var v={};u?(v.onDeselect=f,v.onSelect=c):v.onClick=c;var h=n.props.value,b=function e(t,n){if(null==n)return[];var o=[];return r.a.Children.forEach(t,(function(t){if(t.type.isMenuItemGroup)o=o.concat(e(t.props.children,n));else{var r=j(t),i=t.key;-1!==Y(n,r)&&i&&o.push(i)}})),o}(t,h),y={},g=a,O=t;if(b.length||m){d&&!n.lastVisible?y.activeKey=b[0]||m:d||(b[0]&&(g=!1),y.activeKey=void 0);var w=!1,S=function(e){var t=e.key;return!w&&-1!==b.indexOf(t)||!w&&!b.length&&-1!==m.indexOf(e.key)?(w=!0,o.cloneElement(e,{ref:function(e){n.firstActiveItem=e}})):e};O=t.map((function(e){if(e.type.isMenuItemGroup){var t=Object(_.a)(e.props.children).map(S);return o.cloneElement(e,{},t)}return S(e)}))}else n.firstActiveItem=null;var C=h&&h[h.length-1];return s===n.lastInputValue||C&&C===p||(y.activeKey=""),o.createElement(I.e,J({ref:n.saveMenuRef,style:n.props.dropdownMenuStyle,defaultActiveFirst:g,role:"listbox",itemIcon:u?i:null},y,{multiple:u},v,{selectedKeys:b,prefixCls:"".concat(l,"-menu")}),O)}return null},n.lastInputValue=e.inputValue,n.saveMenuRef=H(te(n),"menuRef"),n}var n,i,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ne(e,t)}(t,e),n=t,(i=[{key:"componentDidMount",value:function(){this.scrollActiveItemToView(),this.lastVisible=this.props.visible}},{key:"shouldComponentUpdate",value:function(e){return e.visible||(this.lastVisible=!1),this.props.visible&&!e.visible||e.visible||e.inputValue!==this.props.inputValue}},{key:"componentDidUpdate",value:function(e){var t=this.props;!e.visible&&t.visible&&this.scrollActiveItemToView(),this.lastVisible=t.visible,this.lastInputValue=t.inputValue}},{key:"componentWillUnmount",value:function(){this.rafInstance&&N.a.cancel(this.rafInstance)}},{key:"render",value:function(){var e=this.renderMenu();return e?o.createElement("div",{style:{overflow:"auto",transform:"translateZ(0)"},id:this.props.ariaId,onFocus:this.props.onPopupFocus,onMouseDown:X,onScroll:this.props.onPopupScroll},e):null}}])&&$(n.prototype,i),a&&$(n,a),t}(o.Component);function re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ie(){return(ie=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function ae(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function le(e){return(le=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ue(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ce(e,t){return(ce=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}oe.displayName="DropdownMenu",oe.propTypes={ariaId:s.string,defaultActiveFirstOption:s.bool,value:s.any,dropdownMenuStyle:s.object,multiple:s.bool,onPopupFocus:s.func,onPopupScroll:s.func,onMenuDeSelect:s.func,onMenuSelect:s.func,prefixCls:s.string,menuItems:s.any,inputValue:s.string,visible:s.bool,firstActiveValue:s.string,menuItemSelectedIcon:s.oneOfType([s.func,s.node])};var se=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};k.a.displayName="Trigger";var pe={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:0,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}},fe=function(e){function t(e){var n,r,i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,i=le(t).call(this,e),(n=!i||"object"!=typeof i&&"function"!=typeof i?ue(r):i).dropdownMenuRef=null,n.rafInstance=null,n.setDropdownWidth=function(){n.cancelRafInstance(),n.rafInstance=N()((function(){var e=x.findDOMNode(ue(n)).offsetWidth;e!==n.state.dropdownWidth&&n.setState({dropdownWidth:e})}))},n.cancelRafInstance=function(){n.rafInstance&&N.a.cancel(n.rafInstance)},n.getInnerMenu=function(){return n.dropdownMenuRef&&n.dropdownMenuRef.menuRef},n.getPopupDOMNode=function(){return n.triggerRef.getPopupDomNode()},n.getDropdownElement=function(e){var t=n.props,r=t.dropdownRender,i=t.ariaId,a=o.createElement(oe,ie({ref:n.saveDropdownMenuRef},e,{ariaId:i,prefixCls:n.getDropdownPrefixCls(),onMenuSelect:t.onMenuSelect,onMenuDeselect:t.onMenuDeselect,onPopupScroll:t.onPopupScroll,value:t.value,backfillValue:t.backfillValue,firstActiveValue:t.firstActiveValue,defaultActiveFirstOption:t.defaultActiveFirstOption,dropdownMenuStyle:t.dropdownMenuStyle,menuItemSelectedIcon:t.menuItemSelectedIcon}));return r?r(a,t):null},n.getDropdownTransitionName=function(){var e=n.props,t=e.transitionName;return!t&&e.animation&&(t="".concat(n.getDropdownPrefixCls(),"-").concat(e.animation)),t},n.getDropdownPrefixCls=function(){return"".concat(n.props.prefixCls,"-dropdown")},n.saveDropdownMenuRef=H(ue(n),"dropdownMenuRef"),n.saveTriggerRef=H(ue(n),"triggerRef"),n.state={dropdownWidth:0},n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ce(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.setDropdownWidth()}},{key:"componentDidUpdate",value:function(){this.setDropdownWidth()}},{key:"componentWillUnmount",value:function(){this.cancelRafInstance()}},{key:"render",value:function(){var e,t,n=this.props,r=n.onPopupFocus,i=n.empty,a=se(n,["onPopupFocus","empty"]),l=a.multiple,u=a.visible,c=a.inputValue,s=a.dropdownAlign,p=a.disabled,f=a.showSearch,d=a.dropdownClassName,m=a.dropdownStyle,v=a.dropdownMatchSelectWidth,h=this.getDropdownPrefixCls(),b=(re(e={},d,!!d),re(e,"".concat(h,"--").concat(l?"multiple":"single"),1),re(e,"".concat(h,"--empty"),i),e),y=this.getDropdownElement({menuItems:a.options,onPopupFocus:r,multiple:l,inputValue:c,visible:u});t=p?[]:K(a)&&!f?["click"]:["blur"];var g=ie({},m),w=v?"width":"minWidth";return this.state.dropdownWidth&&(g[w]="".concat(this.state.dropdownWidth,"px")),o.createElement(k.a,ie({},a,{showAction:p?[]:this.props.showAction,hideAction:t,ref:this.saveTriggerRef,popupPlacement:"bottomLeft",builtinPlacements:pe,prefixCls:h,popupTransitionName:this.getDropdownTransitionName(),onPopupVisibleChange:a.onDropdownVisibleChange,popup:y,popupAlign:s,popupVisible:u,getPopupContainer:a.getPopupContainer,popupClassName:O()(b),popupStyle:g}),a.children)}}])&&ae(n.prototype,r),i&&ae(n,i),t}(o.Component);function de(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function me(){return(me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function ve(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function be(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ye(e,t){return(ye=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}fe.defaultProps={dropdownRender:function(e){return e}},fe.propTypes={onPopupFocus:s.func,onPopupScroll:s.func,dropdownMatchSelectWidth:s.bool,dropdownAlign:s.object,visible:s.bool,disabled:s.bool,showSearch:s.bool,dropdownClassName:s.string,multiple:s.bool,inputValue:s.string,filterOption:s.any,options:s.any,prefixCls:s.string,popupClassName:s.string,children:s.any,showAction:s.arrayOf(s.string),menuItemSelectedIcon:s.oneOfType([s.func,s.node]),dropdownRender:s.func,ariaId:s.string},fe.displayName="SelectTrigger";var ge=function(){return null};function Oe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];for(var r=0;r<t.length;r++)t[r]&&"function"==typeof t[r]&&t[r].apply(Oe,n)}}var we=function(e){function t(e){var n,r,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,i=he(t).call(this,e),(n=!i||"object"!=typeof i&&"function"!=typeof i?be(r):i).inputRef=null,n.inputMirrorRef=null,n.topCtrlRef=null,n.selectTriggerRef=null,n.rootRef=null,n.selectionRef=null,n.dropdownContainer=null,n.blurTimer=null,n.focusTimer=null,n.comboboxTimer=null,n._focused=!1,n._mouseDown=!1,n._options=[],n._empty=!1,n.onInputChange=function(e){var t=n.props.tokenSeparators,o=e.target.value;if(L(n.props)&&t.length&&function(e,t){for(var n=0;n<t.length;++n)if(e.lastIndexOf(t[n])>0)return!0;return!1}(o,t)){var r=n.getValueByInput(o);return void 0!==r&&n.fireChange(r),n.setOpenState(!1,{needFocus:!0}),void n.setInputValue("",!1)}n.setInputValue(o),n.setState({open:!0}),B(n.props)&&n.fireChange([o])},n.onDropdownVisibleChange=function(e){e&&!n._focused&&(n.clearBlurTime(),n.timeoutFocus(),n._focused=!0,n.updateFocusClassName()),n.setOpenState(e)},n.onKeyDown=function(e){var t=n.state.open;if(!n.props.disabled){var o=e.keyCode;t&&!n.getInputDOMNode()?n.onInputKeyDown(e):o===E.a.ENTER||o===E.a.DOWN?(t||n.setOpenState(!0),e.preventDefault()):o===E.a.SPACE&&(t||(n.setOpenState(!0),e.preventDefault()))}},n.onInputKeyDown=function(e){var t=n.props,o=t.disabled,r=t.combobox,i=t.defaultActiveFirstOption;if(!o){var a=n.state,l=n.getRealOpenState(a),u=e.keyCode;if(!L(n.props)||e.target.value||u!==E.a.BACKSPACE){if(u===E.a.DOWN){if(!a.open)return n.openIfHasChildren(),e.preventDefault(),void e.stopPropagation()}else if(u===E.a.ENTER&&a.open)!l&&r||e.preventDefault(),l&&r&&!1===i&&(n.comboboxTimer=setTimeout((function(){n.setOpenState(!1)})));else if(u===E.a.ESC)return void(a.open&&(n.setOpenState(!1),e.preventDefault(),e.stopPropagation()));if(l&&n.selectTriggerRef){var c=n.selectTriggerRef.getInnerMenu();c&&c.onKeyDown(e,n.handleBackfill)&&(e.preventDefault(),e.stopPropagation())}}else{e.preventDefault();var s=a.value;s.length&&n.removeSelected(s[s.length-1])}}},n.onMenuSelect=function(e){var t=e.item;if(t){var o=n.state.value,r=n.props,i=j(t),a=o[o.length-1],l=!1;if(L(r)?-1!==Y(o,i)?l=!0:o=o.concat([i]):B(r)||void 0===a||a!==i||i===n.state.backfillValue?(o=[i],n.setOpenState(!1,{needFocus:!0,fireSearch:!1})):(n.setOpenState(!1,{needFocus:!0,fireSearch:!1}),l=!0),l||n.fireChange(o),n.fireSelect(i),!l){var u=B(r)?A(t,r.optionLabelProp):"";r.autoClearSearchValue&&n.setInputValue(u,!1)}}},n.onMenuDeselect=function(e){var t=e.item,o=e.domEvent;if("keydown"!==o.type||o.keyCode!==E.a.ENTER){var r;"click"===o.type&&n.removeSelected(j(t)),n.props.autoClearSearchValue&&n.setInputValue("")}else{var i=x.findDOMNode(t);(r=i)&&null!==r.offsetParent&&n.removeSelected(j(t))}},n.onArrowClick=function(e){e.stopPropagation(),e.preventDefault(),n.props.disabled||n.setOpenState(!n.state.open,{needFocus:!n.state.open})},n.onPlaceholderClick=function(){n.getInputDOMNode&&n.getInputDOMNode()&&n.getInputDOMNode().focus()},n.onOuterFocus=function(e){if(n.props.disabled)e.preventDefault();else{n.clearBlurTime();var t=n.getInputDOMNode();t&&e.target===n.rootRef||(W(n.props)||e.target!==t)&&(n._focused||(n._focused=!0,n.updateFocusClassName(),L(n.props)&&n._mouseDown||n.timeoutFocus()))}},n.onPopupFocus=function(){n.maybeFocus(!0,!0)},n.onOuterBlur=function(e){n.props.disabled?e.preventDefault():n.blurTimer=window.setTimeout((function(){n._focused=!1,n.updateFocusClassName();var e=n.props,t=n.state.value,o=n.state.inputValue;if(K(e)&&e.showSearch&&o&&e.defaultActiveFirstOption){var r=n._options||[];if(r.length){var i=function e(t){for(var n=0;n<t.length;n++){var o=t[n];if(o.type.isMenuItemGroup){var r=e(o.props.children);if(r)return r}else if(!o.props.disabled)return o}return null}(r);i&&(t=[j(i)],n.fireChange(t))}}else if(L(e)&&o){n._mouseDown?n.setInputValue(""):(n.state.inputValue="",n.getInputDOMNode&&n.getInputDOMNode()&&(n.getInputDOMNode().value=""));var a=n.getValueByInput(o);void 0!==a&&(t=a,n.fireChange(t))}if(L(e)&&n._mouseDown)return n.maybeFocus(!0,!0),void(n._mouseDown=!1);n.setOpenState(!1),e.onBlur&&e.onBlur(n.getVLForOnChange(t))}),10)},n.onClearSelection=function(e){var t=n.props,o=n.state;if(!t.disabled){var r=o.inputValue,i=o.value;e.stopPropagation(),(r||i.length)&&(i.length&&n.fireChange([]),n.setOpenState(!1,{needFocus:!0}),r&&n.setInputValue(""))}},n.onChoiceAnimationLeave=function(){n.forcePopupAlign()},n.getOptionInfoBySingleValue=function(e,t){var r;if((t=t||n.state.optionsInfo)[G(e)]&&(r=t[G(e)]),r)return r;var i=e;if(n.props.labelInValue){var a=Q(n.props.value,e),l=Q(n.props.defaultValue,e);void 0!==a?i=a:void 0!==l&&(i=l)}return{option:o.createElement(v,{value:e,key:e},e),value:e,label:i}},n.getOptionBySingleValue=function(e){return n.getOptionInfoBySingleValue(e).option},n.getOptionsBySingleValue=function(e){return e.map((function(e){return n.getOptionBySingleValue(e)}))},n.getValueByLabel=function(e){if(void 0===e)return null;var t=null;return Object.keys(n.state.optionsInfo).forEach((function(o){var r=n.state.optionsInfo[o];if(!r.disabled){var i=U(r.label);i&&i.join("")===e&&(t=r.value)}})),t},n.getVLBySingleValue=function(e){return n.props.labelInValue?{key:e,label:n.getLabelBySingleValue(e)}:e},n.getVLForOnChange=function(e){var t=e;return void 0!==t?(t=n.props.labelInValue?t.map((function(e){return{key:e,label:n.getLabelBySingleValue(e)}})):t.map((function(e){return e})),L(n.props)?t:t[0]):t},n.getLabelBySingleValue=function(e,t){return n.getOptionInfoBySingleValue(e,t).label},n.getDropdownContainer=function(){return n.dropdownContainer||(n.dropdownContainer=document.createElement("div"),document.body.appendChild(n.dropdownContainer)),n.dropdownContainer},n.getPlaceholderElement=function(){var e=n.props,t=n.state,r=!1;t.inputValue&&(r=!0);var i=t.value;i.length&&(r=!0),B(e)&&1===i.length&&t.value&&!t.value[0]&&(r=!1);var a=e.placeholder;return a?o.createElement("div",me({onMouseDown:X,style:me({display:r?"none":"block"},z)},q,{onClick:n.onPlaceholderClick,className:"".concat(e.prefixCls,"-selection__placeholder")}),a):null},n.getInputElement=function(){var e=n.props,t=o.createElement("input",{id:e.id,autoComplete:"off"}),r=e.getInputElement?e.getInputElement():t,i=O()(r.props.className,de({},"".concat(e.prefixCls,"-search__field"),!0));return o.createElement("div",{className:"".concat(e.prefixCls,"-search__field__wrap")},o.cloneElement(r,{ref:n.saveInputRef,onChange:n.onInputChange,onKeyDown:Oe(n.onInputKeyDown,r.props.onKeyDown,n.props.onInputKeyDown),value:n.state.inputValue,disabled:e.disabled,className:i}),o.createElement("span",{ref:n.saveInputMirrorRef,className:"".concat(e.prefixCls,"-search__field__mirror")},n.state.inputValue," "))},n.getInputDOMNode=function(){return n.topCtrlRef?n.topCtrlRef.querySelector("input,textarea,div[contentEditable]"):n.inputRef},n.getInputMirrorDOMNode=function(){return n.inputMirrorRef},n.getPopupDOMNode=function(){if(n.selectTriggerRef)return n.selectTriggerRef.getPopupDOMNode()},n.getPopupMenuComponent=function(){if(n.selectTriggerRef)return n.selectTriggerRef.getInnerMenu()},n.setOpenState=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.needFocus,r=t.fireSearch,i=n.props,a=n.state;if(a.open!==e){n.props.onDropdownVisibleChange&&n.props.onDropdownVisibleChange(e);var l={open:e,backfillValue:""};!e&&K(i)&&i.showSearch&&n.setInputValue("",r),e||n.maybeFocus(e,!!o),n.setState(me({open:e},l),(function(){e&&n.maybeFocus(e,!!o)}))}else n.maybeFocus(e,!!o)},n.setInputValue=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=n.props.onSearch;e!==n.state.inputValue&&n.setState((function(n){return t&&e!==n.inputValue&&o&&o(e),{inputValue:e}}),n.forcePopupAlign)},n.getValueByInput=function(e){var t=n.props,o=t.multiple,r=t.tokenSeparators,i=n.state.value,a=!1;return function(e,t){var n=new RegExp("[".concat(t.join(),"]"));return e.split(n).filter((function(e){return e}))}(e,r).forEach((function(e){var t=[e];if(o){var r=n.getValueByLabel(e);r&&-1===Y(i,r)&&(i=i.concat(r),a=!0,n.fireSelect(r))}else-1===Y(i,e)&&(i=i.concat(t),a=!0,n.fireSelect(e))})),a?i:void 0},n.getRealOpenState=function(e){var t=n.props.open;if("boolean"==typeof t)return t;var o=(e||n.state).open,r=n._options||[];return!W(n.props)&&n.props.showSearch||o&&!r.length&&(o=!1),o},n.markMouseDown=function(){n._mouseDown=!0},n.markMouseLeave=function(){n._mouseDown=!1},n.handleBackfill=function(e){if(n.props.backfill&&(K(n.props)||B(n.props))){var t=j(e);B(n.props)&&n.setInputValue(t,!1),n.setState({value:[t],backfillValue:t})}},n.filterOption=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Z,r=n.state.value,i=r[r.length-1];if(!e||i&&i===n.state.backfillValue)return!0;var a=n.props.filterOption;return"filterOption"in n.props?!0===a&&(a=o.bind(be(n))):a=o.bind(be(n)),!a||("function"==typeof a?a.call(be(n),e,t):!t.props.disabled)},n.timeoutFocus=function(){var e=n.props.onFocus;n.focusTimer&&n.clearFocusTime(),n.focusTimer=window.setTimeout((function(){e&&e()}),10)},n.clearFocusTime=function(){n.focusTimer&&(clearTimeout(n.focusTimer),n.focusTimer=null)},n.clearBlurTime=function(){n.blurTimer&&(clearTimeout(n.blurTimer),n.blurTimer=null)},n.clearComboboxTime=function(){n.comboboxTimer&&(clearTimeout(n.comboboxTimer),n.comboboxTimer=null)},n.updateFocusClassName=function(){var e=n.rootRef,t=n.props;n._focused?S()(e).add("".concat(t.prefixCls,"-focused")):S()(e).remove("".concat(t.prefixCls,"-focused"))},n.maybeFocus=function(e,t){if(t||e){var o=n.getInputDOMNode(),r=document.activeElement;o&&(e||W(n.props))?r!==o&&(o.focus(),n._focused=!0):r!==n.selectionRef&&n.selectionRef&&(n.selectionRef.focus(),n._focused=!0)}},n.removeSelected=function(e,t){var o=n.props;if(!o.disabled&&!n.isChildDisabled(e)){t&&t.stopPropagation&&t.stopPropagation();var r=n.state.value.filter((function(t){return t!==e}));if(L(o)){var i=e;o.labelInValue&&(i={key:e,label:n.getLabelBySingleValue(e)}),o.onDeselect&&o.onDeselect(i,n.getOptionBySingleValue(e))}n.fireChange(r)}},n.openIfHasChildren=function(){var e=n.props;(o.Children.count(e.children)||K(e))&&n.setOpenState(!0)},n.fireSelect=function(e){n.props.onSelect&&n.props.onSelect(n.getVLBySingleValue(e),n.getOptionBySingleValue(e))},n.fireChange=function(e){var t=n.props;"value"in t||n.setState({value:e},n.forcePopupAlign);var o=n.getVLForOnChange(e),r=n.getOptionsBySingleValue(e);t.onChange&&t.onChange(o,L(n.props)?r:r[0])},n.isChildDisabled=function(e){return Object(_.a)(n.props.children).some((function(t){return j(t)===e&&t.props&&t.props.disabled}))},n.forcePopupAlign=function(){n.state.open&&n.selectTriggerRef&&n.selectTriggerRef.triggerRef&&n.selectTriggerRef.triggerRef.forcePopupAlign()},n.renderFilterOptions=function(){var e=n.state.inputValue,t=n.props,r=t.children,i=t.tags,a=t.notFoundContent,l=[],u=[],c=!1,s=n.renderFilterOptionsFromChildren(r,u,l);if(i){var p=n.state.value;(p=p.filter((function(t){return-1===u.indexOf(t)&&(!e||String(t).indexOf(String(e))>-1)}))).sort((function(e,t){return e.length-t.length})),p.forEach((function(e){var t=e,n=o.createElement(I.b,{style:z,role:"option",attribute:q,value:t,key:t},t);s.push(n),l.push(n)})),e&&l.every((function(t){return j(t)!==e}))&&s.unshift(o.createElement(I.b,{style:z,role:"option",attribute:q,value:e,key:e},e))}return!s.length&&a&&(c=!0,s=[o.createElement(I.b,{style:z,attribute:q,disabled:!0,role:"option",value:"NOT_FOUND",key:"NOT_FOUND"},a)]),{empty:c,options:s}},n.renderFilterOptionsFromChildren=function(e,t,r){var i=[],a=n.props,l=n.state.inputValue,u=a.tags;return o.Children.forEach(e,(function(e){if(e){var a=e.type;if(a.isSelectOptGroup){var c=e.props.label,s=e.key;if(s||"string"!=typeof c?!c&&s&&(c=s):s=c,l&&n.filterOption(l,e)){var p=Object(_.a)(e.props.children).map((function(e){var t=j(e)||e.key;return o.createElement(I.b,me({key:t,value:t},e.props))}));i.push(o.createElement(I.c,{key:s,title:c},p))}else{var f=n.renderFilterOptionsFromChildren(e.props.children,t,r);f.length&&i.push(o.createElement(I.c,{key:s,title:c},f))}}else{D()(a.isSelectOption,"the children of `Select` should be `Select.Option` or `Select.OptGroup`, "+"instead of `".concat(a.name||a.displayName||e.type,"`."));var d=j(e);if(function(e,t){if(!K(t)&&!function(e){return e.multiple}(t)&&"string"!=typeof e)throw new Error("Invalid `value` of type `".concat(typeof e,"` supplied to Option, ")+"expected `string` when `tags/combobox` is `true`.")}(d,n.props),n.filterOption(l,e)){var m=o.createElement(I.b,me({style:z,attribute:q,value:d,key:d,role:"option"},e.props));i.push(m),r.push(m)}u&&t.push(d)}}})),i},n.renderTopControlNode=function(){var e=n.state,t=e.open,r=e.inputValue,i=n.state.value,a=n.props,l=a.choiceTransitionName,u=a.prefixCls,c=a.maxTagTextLength,s=a.maxTagCount,p=a.showSearch,f=a.removeIcon,d=a.maxTagPlaceholder,m="".concat(u,"-selection__rendered"),v=null;if(K(a)){var h=null;if(i.length){var b=!1,y=1;p&&t?(b=!r)&&(y=.4):b=!0;var g=i[0],O=n.getOptionInfoBySingleValue(g),w=O.label,S=O.title;h=o.createElement("div",{key:"value",className:"".concat(u,"-selection-selected-value"),title:F(S||w),style:{display:b?"block":"none",opacity:y}},w)}v=p?[h,o.createElement("div",{className:"".concat(u,"-search ").concat(u,"-search--inline"),key:"input",style:{display:t?"block":"none"}},n.getInputElement())]:[h]}else{var I,_=[],E=i;if(void 0!==s&&i.length>s){E=E.slice(0,s);var x=n.getVLForOnChange(i.slice(s,i.length)),V="+ ".concat(i.length-s," ...");d&&(V="function"==typeof d?d(x):d),I=o.createElement("li",me({style:z},q,{role:"presentation",onMouseDown:X,className:"".concat(u,"-selection__choice ").concat(u,"-selection__choice__disabled"),key:"maxTagPlaceholder",title:F(V)}),o.createElement("div",{className:"".concat(u,"-selection__choice__content")},V))}L(a)&&(_=E.map((function(e){var t=n.getOptionInfoBySingleValue(e),r=t.label,i=t.title||r;c&&"string"==typeof r&&r.length>c&&(r="".concat(r.slice(0,c),"..."));var a=n.isChildDisabled(e),l=a?"".concat(u,"-selection__choice ").concat(u,"-selection__choice__disabled"):"".concat(u,"-selection__choice");return o.createElement("li",me({style:z},q,{onMouseDown:X,className:l,role:"presentation",key:e||"RC_SELECT_EMPTY_VALUE_KEY",title:F(i)}),o.createElement("div",{className:"".concat(u,"-selection__choice__content")},r),a?null:o.createElement("span",{onClick:function(t){n.removeSelected(e,t)},className:"".concat(u,"-selection__choice__remove")},f||o.createElement("i",{className:"".concat(u,"-selection__choice__remove-icon")},"×")))}))),I&&_.push(I),_.push(o.createElement("li",{className:"".concat(u,"-search ").concat(u,"-search--inline"),key:"__input"},n.getInputElement())),v=L(a)&&l?o.createElement(C.a,{onLeave:n.onChoiceAnimationLeave,component:"ul",transitionName:l},_):o.createElement("ul",null,_)}return o.createElement("div",{className:m,ref:n.saveTopCtrlRef},n.getPlaceholderElement(),v)};var a=t.getOptionsInfoFromProps(e);if(e.tags&&"function"!=typeof e.filterOption){var l=Object.keys(a).some((function(e){return a[e].disabled}));D()(!l,"Please avoid setting option to disabled in tags mode since user can always type text as tag.")}return n.state={value:t.getValueFromProps(e,!0),inputValue:e.combobox?t.getInputValueForCombobox(e,a,!0):"",open:e.defaultOpen,optionsInfo:a,backfillValue:"",skipBuildOptionsInfo:!0,ariaId:""},n.saveInputRef=H(be(n),"inputRef"),n.saveInputMirrorRef=H(be(n),"inputMirrorRef"),n.saveTopCtrlRef=H(be(n),"topCtrlRef"),n.saveSelectTriggerRef=H(be(n),"selectTriggerRef"),n.saveRootRef=H(be(n),"rootRef"),n.saveSelectionRef=H(be(n),"selectionRef"),n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ye(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e;(this.props.autoFocus||this.state.open)&&this.focus(),this.setState({ariaId:(e=(new Date).getTime(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:7&n|8).toString(16)})))})}},{key:"componentDidUpdate",value:function(){if(L(this.props)){var e=this.getInputDOMNode(),t=this.getInputMirrorDOMNode();e&&e.value&&t?(e.style.width="",e.style.width="".concat(t.clientWidth,"px")):e&&(e.style.width="")}this.forcePopupAlign()}},{key:"componentWillUnmount",value:function(){this.clearFocusTime(),this.clearBlurTime(),this.clearComboboxTime(),this.dropdownContainer&&(x.unmountComponentAtNode(this.dropdownContainer),document.body.removeChild(this.dropdownContainer),this.dropdownContainer=null)}},{key:"focus",value:function(){K(this.props)&&this.selectionRef?this.selectionRef.focus():this.getInputDOMNode()&&this.getInputDOMNode().focus()}},{key:"blur",value:function(){K(this.props)&&this.selectionRef?this.selectionRef.blur():this.getInputDOMNode()&&this.getInputDOMNode().blur()}},{key:"renderArrow",value:function(e){var t=this.props,n=t.showArrow,r=void 0===n?!e:n,i=t.loading,a=t.inputIcon,l=t.prefixCls;if(!r&&!i)return null;var u=i?o.createElement("i",{className:"".concat(l,"-arrow-loading")}):o.createElement("i",{className:"".concat(l,"-arrow-icon")});return o.createElement("span",me({key:"arrow",className:"".concat(l,"-arrow"),style:z},q,{onClick:this.onArrowClick}),a||u)}},{key:"renderClear",value:function(){var e=this.props,t=e.prefixCls,n=e.allowClear,r=e.clearIcon,i=this.state.inputValue,a=this.state.value,l=o.createElement("span",me({key:"clear",className:"".concat(t,"-selection__clear"),onMouseDown:X,style:z},q,{onClick:this.onClearSelection}),r||o.createElement("i",{className:"".concat(t,"-selection__clear-icon")},"×"));return n?B(this.props)?i?l:null:i||a.length?l:null:null}},{key:"render",value:function(){var e,t=this.props,n=L(t),r=t.showArrow,i=void 0===r||r,a=this.state,l=t.className,u=t.disabled,c=t.prefixCls,s=t.loading,p=this.renderTopControlNode(),f=this.state,d=f.open,m=f.ariaId;if(d){var v=this.renderFilterOptions();this._empty=v.empty,this._options=v.options}var h=this.getRealOpenState(),b=this._empty,y=this._options||[],g={};Object.keys(t).forEach((function(e){!Object.prototype.hasOwnProperty.call(t,e)||"data-"!==e.substr(0,5)&&"aria-"!==e.substr(0,5)&&"role"!==e||(g[e]=t[e])}));var w=me({},g);W(t)||(w=me(me({},w),{onKeyDown:this.onKeyDown,tabIndex:t.disabled?-1:t.tabIndex}));var S=(de(e={},l,!!l),de(e,c,1),de(e,"".concat(c,"-open"),d),de(e,"".concat(c,"-focused"),d||!!this._focused),de(e,"".concat(c,"-combobox"),B(t)),de(e,"".concat(c,"-disabled"),u),de(e,"".concat(c,"-enabled"),!u),de(e,"".concat(c,"-allow-clear"),!!t.allowClear),de(e,"".concat(c,"-no-arrow"),!i),de(e,"".concat(c,"-loading"),!!s),e);return o.createElement(fe,{onPopupFocus:this.onPopupFocus,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,dropdownAlign:t.dropdownAlign,dropdownClassName:t.dropdownClassName,dropdownMatchSelectWidth:t.dropdownMatchSelectWidth,defaultActiveFirstOption:t.defaultActiveFirstOption,dropdownMenuStyle:t.dropdownMenuStyle,transitionName:t.transitionName,animation:t.animation,prefixCls:t.prefixCls,dropdownStyle:t.dropdownStyle,combobox:t.combobox,showSearch:t.showSearch,options:y,empty:b,multiple:n,disabled:u,visible:h,inputValue:a.inputValue,value:a.value,backfillValue:a.backfillValue,firstActiveValue:t.firstActiveValue,onDropdownVisibleChange:this.onDropdownVisibleChange,getPopupContainer:t.getPopupContainer,onMenuSelect:this.onMenuSelect,onMenuDeselect:this.onMenuDeselect,onPopupScroll:t.onPopupScroll,showAction:t.showAction,ref:this.saveSelectTriggerRef,menuItemSelectedIcon:t.menuItemSelectedIcon,dropdownRender:t.dropdownRender,ariaId:m},o.createElement("div",{id:t.id,style:t.style,ref:this.saveRootRef,onBlur:this.onOuterBlur,onFocus:this.onOuterFocus,className:O()(S),onMouseDown:this.markMouseDown,onMouseUp:this.markMouseLeave,onMouseOut:this.markMouseLeave},o.createElement("div",me({ref:this.saveSelectionRef,key:"selection",className:"".concat(c,"-selection\n ").concat(c,"-selection--").concat(n?"multiple":"single"),role:"combobox","aria-autocomplete":"list","aria-haspopup":"true","aria-controls":m,"aria-expanded":h},w),p,this.renderClear(),this.renderArrow(!!n))))}}])&&ve(n.prototype,r),i&&ve(n,i),t}(o.Component);we.propTypes=y,we.defaultProps={prefixCls:"rc-select",defaultOpen:!1,labelInValue:!1,defaultActiveFirstOption:!0,showSearch:!0,allowClear:!1,placeholder:"",onChange:ge,onFocus:ge,onBlur:ge,onSelect:ge,onSearch:ge,onDeselect:ge,onInputKeyDown:ge,dropdownMatchSelectWidth:!0,dropdownStyle:{},dropdownMenuStyle:{},optionFilterProp:"value",optionLabelProp:"value",notFoundContent:"Not Found",backfill:!1,showAction:["click"],tokenSeparators:[],autoClearSearchValue:!0,tabIndex:0,dropdownRender:function(e){return e}},we.getDerivedStateFromProps=function(e,t){var n=t.skipBuildOptionsInfo?t.optionsInfo:we.getOptionsInfoFromProps(e,t),o={optionsInfo:n,skipBuildOptionsInfo:!1};if("open"in e&&(o.open=e.open),e.disabled&&t.open&&(o.open=!1),"value"in e){var r=we.getValueFromProps(e);o.value=r,e.combobox&&(o.inputValue=we.getInputValueForCombobox(e,n))}return o},we.getOptionsFromChildren=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return o.Children.forEach(e,(function(e){e&&(e.type.isSelectOptGroup?we.getOptionsFromChildren(e.props.children,t):t.push(e))})),t},we.getInputValueForCombobox=function(e,t,n){var o=[];if("value"in e&&!n&&(o=U(e.value)),"defaultValue"in e&&n&&(o=U(e.defaultValue)),!o.length)return"";var r=o=o[0];return e.labelInValue?r=o.label:t[G(o)]&&(r=t[G(o)].label),void 0===r&&(r=""),r},we.getLabelFromOption=function(e,t){return A(t,e.optionLabelProp)},we.getOptionsInfoFromProps=function(e,t){var n=we.getOptionsFromChildren(e.children),o={};if(n.forEach((function(t){var n=j(t);o[G(n)]={option:t,value:n,label:we.getLabelFromOption(e,t),title:t.props.title,disabled:t.props.disabled}})),t){var r=t.optionsInfo,i=t.value;i&&i.forEach((function(e){var t=G(e);o[t]||void 0===r[t]||(o[t]=r[t])}))}return o},we.getValueFromProps=function(e,t){var n=[];return"value"in e&&!t&&(n=U(e.value)),"defaultValue"in e&&t&&(n=U(e.defaultValue)),e.labelInValue&&(n=n.map((function(e){return e.key}))),n},we.displayName="Select",Object(V.polyfill)(we);var Se=we;Se.Option=v,Se.OptGroup=c;t.c=Se}}]); |