11.chunk.js 27.9 KB
webpackJsonpantd([11],{796:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function l(){}function i(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];for(var l=0;l<t.length;l++)t[l]&&"function"===typeof t[l]&&t[l].apply(this,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,r,u,s=n(9),p=o(s),d=n(1),f=o(d),c=n(6),h=o(c),v=n(2),m=o(v),g=n(5),b=o(g),y=n(3),C=o(y),E=n(4),T=o(E),S=n(0),O=o(S),w=n(10),M=o(w),_=n(52),k=o(_),V=n(138),N=o(V),L=n(7),A=o(L),D=n(17),I=o(D),F=n(244),P=o(F),x=n(815),B=n(18),R=o(B),U=n(144),W=n(30),j=o(W),K=n(831),Y=n(919),G=o(Y),z=n(263),H=(r=a=function(e){function t(e){(0,m.default)(this,t);var n=(0,C.default)(this,(t.__proto__||(0,h.default)(t)).call(this,e));u.call(n);var o=[];o="value"in e?(0,K.toArray)(e.value):(0,K.toArray)(e.defaultValue),o=n.addLabelToValue(e,o),o=n.addTitleToValue(e,o);var l="";e.combobox&&(l=o.length?n.getLabelFromProps(e,o[0].key):"");var i=e.open;return void 0===i&&(i=e.defaultOpen),e.open&&window.onWeaDialogOpen&&window.onWeaDialogOpen(),n.state={value:o,inputValue:l,open:i},n.adjustOpenState(),n}return(0,T.default)(t,e),(0,b.default)(t,[{key:"componentDidMount",value:function(){this.props.autoFocus&&this.focus()}},{key:"componentWillUpdate",value:function(e,t){this.props=e,this.state=t,this.adjustOpenState()}},{key:"componentDidUpdate",value:function(){if((0,K.isMultipleOrTags)(this.props)){var e=this.getInputDOMNode(),t=this.getInputMirrorDOMNode();e.value?(e.style.width="",e.style.width=t.clientWidth+"px"):e.style.width=""}}},{key:"componentWillUnmount",value:function(){this.clearFocusTime(),this.clearBlurTime(),this.clearAdjustTimer(),this.dropdownContainer&&(M.default.unmountComponentAtNode(this.dropdownContainer),j.default.getTop().document.body.removeChild(this.dropdownContainer),this.dropdownContainer=null)}},{key:"focus",value:function(){(0,K.isSingleMode)(this.props)?this.selectionRef.focus():this.getInputDOMNode().focus()}},{key:"blur",value:function(){(0,K.isSingleMode)(this.props)?this.selectionRef.blur():this.getInputDOMNode().blur()}},{key:"renderClear",value:function(){var e=this.props,t=e.prefixCls,n=e.allowClear,o=this.state,l=o.value,i=o.inputValue,a=O.default.createElement("span",(0,f.default)({key:"clear",onMouseDown:K.preventDefaultEvent,style:K.UNSELECTABLE_STYLE},K.UNSELECTABLE_ATTRIBUTE,{className:t+"-selection__clear",onClick:this.onClearSelection}));return n?(0,K.isCombobox)(this.props)?i?a:null:i||l.length?a:null:null}},{key:"render",value:function(){var e,t=this.props,n=(0,K.isMultipleOrTags)(t),o=this.state,l=t.className,i=t.disabled,a=t.prefixCls,r=this.renderTopControlNode(),u={},s=this.state.open,d=this._options;(0,K.isMultipleOrTagsOrCombobox)(t)||(u={onKeyDown:this.onKeyDown,tabIndex:t.disabled?-1:0});var c=(e={},(0,p.default)(e,l,!!l),(0,p.default)(e,a,1),(0,p.default)(e,a+"-open",s),(0,p.default)(e,a+"-focused",s||!!this._focused),(0,p.default)(e,a+"-combobox",(0,K.isCombobox)(t)),(0,p.default)(e,a+"-disabled",i),(0,p.default)(e,a+"-enabled",!i),(0,p.default)(e,a+"-allow-clear",!!t.allowClear),e);return O.default.createElement(G.default,{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:d,multiple:n,disabled:i,visible:s,inputValue:o.inputValue,value:o.value,firstActiveValue:t.firstActiveValue,onDropdownVisibleChange:this.onDropdownVisibleChange,getPopupContainer:t.getPopupContainer,onMenuSelect:this.onMenuSelect,onMenuDeselect:this.onMenuDeselect,onPopupScroll:t.onPopupScroll,showAction:t.showAction,ref:(0,K.saveRef)(this,"selectTriggerRef")},O.default.createElement("div",{style:t.style,ref:(0,K.saveRef)(this,"rootRef"),onBlur:this.onOuterBlur,onFocus:this.onOuterFocus,className:(0,A.default)(c)},O.default.createElement("div",(0,f.default)({ref:(0,K.saveRef)(this,"selectionRef"),key:"selection",className:a+"-selection\n            "+a+"-selection--"+(n?"multiple":"single"),role:"combobox","aria-autocomplete":"list","aria-haspopup":"true","aria-expanded":s},u),r,this.renderClear(),n||!t.showArrow?null:O.default.createElement("span",(0,f.default)({key:"arrow",className:a+"-arrow "+(s?"icon-coms-up2":"icon-coms-down2"),style:K.UNSELECTABLE_STYLE},K.UNSELECTABLE_ATTRIBUTE,{onClick:this.onArrowClick}),O.default.createElement("b",null)))))}}]),t}(O.default.Component),a.propTypes=z.SelectPropTypes,a.defaultProps={prefixCls:"rc-select",defaultOpen:!1,labelInValue:!1,defaultActiveFirstOption:!0,showSearch:!0,allowClear:!1,placeholder:"",onChange:l,onFocus:l,onBlur:l,onSelect:l,onSearch:l,onDeselect:l,onInputKeyDown:l,showArrow:!0,dropdownMatchSelectWidth:!0,dropdownStyle:{},dropdownMenuStyle:{},optionFilterProp:"value",optionLabelProp:"value",notFoundContent:"Not Found",backfill:!1,showAction:["click"]},u=function(){var e=this;this.componentWillReceiveProps=function(t){if("open"in t&&e.state.open!==t.visible&&(t.open?window.onWeaDialogOpen&&window.onWeaDialogOpen():window.onWeaDialogClose&&window.onWeaDialogClose()),"value"in t){var n=(0,K.toArray)(t.value);n=e.addLabelToValue(t,n),n=e.addTitleToValue(t,n),e.setState({value:n}),t.combobox&&e.setState({inputValue:n.length?e.getLabelFromProps(t,n[0].key):""})}},this.onInputChange=function(t){var n=e.props.tokenSeparators,o=t.target.value;if((0,K.isMultipleOrTags)(e.props)&&n&&(0,K.includesSeparators)(o,n)){var l=e.tokenize(o);return e.fireChange(l),e.setOpenState(!1,!0),void e.setInputValue("",!1)}e.setInputValue(o),e.setState({open:!0}),(0,K.isCombobox)(e.props)&&e.fireChange([{key:o}])},this.onDropdownVisibleChange=function(t){t&&!e._focused&&(e.clearBlurTime(),e.timeoutFocus(),e._focused=!0,e.updateFocusClassName()),e.setOpenState(t)},this.onKeyDown=function(t){if(!e.props.disabled){var n=t.keyCode;e.state.open&&!e.getInputDOMNode()?e.onInputKeyDown(t):n!==k.default.ENTER&&n!==k.default.DOWN||(e.setOpenState(!0),t.preventDefault())}},this.onInputKeyDown=function(t){var n=e.props;if(!n.disabled){var o=e.state,l=t.keyCode;if((0,K.isMultipleOrTags)(n)&&!t.target.value&&l===k.default.BACKSPACE){t.preventDefault();var i=o.value;return void(i.length&&e.removeSelected(i[i.length-1].key))}if(l===k.default.DOWN){if(!o.open)return e.openIfHasChildren(),t.preventDefault(),void t.stopPropagation()}else if(l===k.default.ESC)return void(o.open&&(e.setOpenState(!1),t.preventDefault(),t.stopPropagation()));if(o.open){var a=e.selectTriggerRef.getInnerMenu();a&&a.onKeyDown(t,e.handleBackfill)&&(t.preventDefault(),t.stopPropagation())}}},this.onMenuSelect=function(t){var n=t.item,o=e.state.value,l=e.props,i=(0,K.getValuePropValue)(n),a=e.getLabelFromOption(n),r=o[o.length-1],u=i;l.labelInValue&&(u={key:u,label:a}),l.onSelect(u,n);var s=n.props.title;if((0,K.isMultipleOrTags)(l)){if(-1!==(0,K.findIndexInValueByKey)(o,i))return;o=o.concat([{key:i,label:a,title:s}])}else{if((0,K.isCombobox)(l)&&(e.skipAdjustOpen=!0,e.clearAdjustTimer(),e.skipAdjustOpenTimer=setTimeout(function(){e.skipAdjustOpen=!1},0)),r&&r.key===i&&!r.backfill)return void e.setOpenState(!1,!0);o=[{key:i,label:a,title:s}],e.setOpenState(!1,!0)}e.fireChange(o);var p=void 0;p=(0,K.isCombobox)(l)?(0,K.getPropValue)(n,l.optionLabelProp):"",e.setInputValue(p,!1)},this.onMenuDeselect=function(t){var n=t.item;"click"===t.domEvent.type&&e.removeSelected((0,K.getValuePropValue)(n)),e.setInputValue("",!1)},this.onArrowClick=function(t){t.stopPropagation(),e.props.disabled||e.setOpenState(!e.state.open,!e.state.open)},this.onPlaceholderClick=function(){e.getInputDOMNode()&&e.getInputDOMNode().focus()},this.onOuterFocus=function(t){if(e.props.disabled)return void t.preventDefault();e.clearBlurTime(),((0,K.isMultipleOrTagsOrCombobox)(e.props)||t.target!==e.getInputDOMNode())&&(e._focused||(e._focused=!0,e.updateFocusClassName(),e.timeoutFocus()))},this.onPopupFocus=function(){e.maybeFocus(!0,!0)},this.onOuterBlur=function(t){if(e.props.disabled)return void t.preventDefault();e.blurTimer=setTimeout(function(){e._focused=!1,e.updateFocusClassName();var t=e.props,n=e.state.value,o=e.state.inputValue;if((0,K.isSingleMode)(t)&&t.showSearch&&o&&t.defaultActiveFirstOption){var l=e._options||[];if(l.length){var i=(0,K.findFirstMenuItem)(l);i&&(n=[{key:i.key,label:e.getLabelFromOption(i)}],e.fireChange(n))}}else(0,K.isMultipleOrTags)(t)&&o&&(e.state.inputValue=e.getInputDOMNode().value="");t.onBlur(e.getVLForOnChange(n)),e.setOpenState(!1)},10)},this.onClearSelection=function(t){var n=e.props,o=e.state;if(!n.disabled){var l=o.inputValue,i=o.value;t.stopPropagation(),(l||i.length)&&(i.length&&e.fireChange([]),e.setOpenState(!1,!0),l&&e.setInputValue(""))}},this.onChoiceAnimationLeave=function(){e.selectTriggerRef.triggerRef.forcePopupAlign()},this.getLabelBySingleValue=function(t,n){if(void 0===n)return null;var o=null;return O.default.Children.forEach(t,function(t){if(t)if(t.type.isSelectOptGroup){var l=e.getLabelBySingleValue(t.props.children,n);null!==l&&(o=l)}else(0,K.getValuePropValue)(t)===n&&(o=e.getLabelFromOption(t))}),o},this.getValueByLabel=function(t,n){if(void 0===n)return null;var o=null;return O.default.Children.forEach(t,function(t){if(t)if(t.type.isSelectOptGroup){var l=e.getValueByLabel(t.props.children,n);null!==l&&(o=l)}else(0,K.toArray)(e.getLabelFromOption(t)).join("")===n&&(o=(0,K.getValuePropValue)(t))}),o},this.getLabelFromOption=function(t){return(0,K.getPropValue)(t,e.props.optionLabelProp)},this.getLabelFromProps=function(t,n){return e.getLabelByValue(t.children,n)},this.getVLForOnChange=function(t){var n=t;return void 0!==n?(n=e.props.labelInValue?n.map(function(e){return{key:e.key,label:e.label}}):n.map(function(e){return e.key}),(0,K.isMultipleOrTags)(e.props)?n:n[0]):n},this.getLabelByValue=function(t,n){var o=e.getLabelBySingleValue(t,n);return null===o?n:o},this.getDropdownContainer=function(){return e.dropdownContainer||(e.dropdownContainer=document.createElement("div"),j.default.getTop().document.body.appendChild(e.dropdownContainer),(0,U.loadCss)()),e.dropdownContainer},this.getPlaceholderElement=function(){var t=e.props,n=e.state,o=!1;n.inputValue&&(o=!0),n.value.length&&(o=!0),1!==n.value.length||n.value[0].key||(o=!1);var l=t.placeholder;return l?O.default.createElement("div",(0,f.default)({onMouseDown:K.preventDefaultEvent,style:(0,f.default)({display:o?"none":"block"},K.UNSELECTABLE_STYLE)},K.UNSELECTABLE_ATTRIBUTE,{onClick:e.onPlaceholderClick,className:t.prefixCls+"-selection__placeholder"}),l):null},this.getInputElement=function(){var t=e.props,n=t.getInputElement?t.getInputElement():O.default.createElement("input",{id:t.id,autoComplete:"off"}),o=(0,A.default)(n.props.className,(0,p.default)({},t.prefixCls+"-search__field",!0));return O.default.createElement("div",{className:t.prefixCls+"-search__field__wrap"},O.default.cloneElement(n,{ref:(0,K.saveRef)(e,"inputRef"),onChange:e.onInputChange,onKeyDown:i(e.onInputKeyDown,n.props.onKeyDown,e.props.onInputKeyDown),value:e.state.inputValue,disabled:t.disabled,className:o}),O.default.createElement("span",{ref:(0,K.saveRef)(e,"inputMirrorRef"),className:t.prefixCls+"-search__field__mirror"},e.state.inputValue," "))},this.getInputDOMNode=function(){return e.topCtrlRef?e.topCtrlRef.querySelector("input,textarea,div[contentEditable]"):e.inputRef},this.getInputMirrorDOMNode=function(){return e.inputMirrorRef},this.getPopupDOMNode=function(){return e.selectTriggerRef.getPopupDOMNode()},this.getPopupMenuComponent=function(){return e.selectTriggerRef.getInnerMenu()},this.setOpenState=function(t,n){var o=e.props;if(e.state.open===t)return void e.maybeFocus(t,n);var l={open:t};!t&&(0,K.isSingleMode)(o)&&o.showSearch&&e.setInputValue(""),t||e.maybeFocus(t,n),e.setState(l,function(){t&&e.maybeFocus(t,n)})},this.setInputValue=function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t!==e.state.inputValue&&(e.setState({inputValue:t}),n&&e.props.onSearch(t))},this.handleBackfill=function(t){if(e.props.backfill&&((0,K.isSingleMode)(e.props)||(0,K.isCombobox)(e.props))){var n=(0,K.getValuePropValue)(t),o=e.getLabelFromOption(t),l={key:n,label:o,backfill:!0};(0,K.isCombobox)(e.props)&&e.setInputValue(n,!1),e.setState({value:[l]})}},this.filterOption=function(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:K.defaultFilterFn,l=e.state.value,i=l[l.length-1];if(!t||i&&i.backfill)return!0;var a=e.props.filterOption;return"filterOption"in e.props?!0===e.props.filterOption&&(a=o):a=o,!a||("function"===typeof a?a.call(e,t,n):!n.props.disabled)},this.timeoutFocus=function(){e.focusTimer&&e.clearFocusTime(),e.focusTimer=setTimeout(function(){e.props.onFocus()},10)},this.clearFocusTime=function(){e.focusTimer&&(clearTimeout(e.focusTimer),e.focusTimer=null)},this.clearBlurTime=function(){e.blurTimer&&(clearTimeout(e.blurTimer),e.blurTimer=null)},this.clearAdjustTimer=function(){e.skipAdjustOpenTimer&&(clearTimeout(e.skipAdjustOpenTimer),e.skipAdjustOpenTimer=null)},this.updateFocusClassName=function(){var t=e.rootRef,n=e.props;e._focused?(0,P.default)(t).add(n.prefixCls+"-focused"):(0,P.default)(t).remove(n.prefixCls+"-focused")},this.maybeFocus=function(t,n){if(n||t){var o=e.getInputDOMNode(),l=document,i=l.activeElement;o&&(t||(0,K.isMultipleOrTagsOrCombobox)(e.props))?i!==o&&(o.focus(),e._focused=!0):i!==e.selectionRef&&(e.selectionRef.focus(),e._focused=!0)}},this.addLabelToValue=function(t,n){var o=n;return t.labelInValue?o.forEach(function(n){n.label=n.label||e.getLabelFromProps(t,n.key)}):o=o.map(function(n){return{key:n,label:e.getLabelFromProps(t,n)}}),o},this.addTitleToValue=function(t,n){var o=n,l=n.map(function(e){return e.key});return O.default.Children.forEach(t.children,function(t){if(t)if(t.type.isSelectOptGroup)o=e.addTitleToValue(t.props,o);else{var n=(0,K.getValuePropValue)(t),i=l.indexOf(n);i>-1&&(o[i].title=t.props.title)}}),o},this.removeSelected=function(t){var n=e.props;if(!n.disabled&&!e.isChildDisabled(t)){var o=void 0,l=e.state.value.filter(function(e){return e.key===t&&(o=e.label),e.key!==t});if((0,K.isMultipleOrTags)(n)){var i=t;n.labelInValue&&(i={key:t,label:o}),n.onDeselect(i)}e.fireChange(l)}},this.openIfHasChildren=function(){var t=e.props;(O.default.Children.count(t.children)||(0,K.isSingleMode)(t))&&e.setOpenState(!0)},this.fireChange=function(t){var n=e.props;"value"in n||e.setState({value:t}),n.onChange(e.getVLForOnChange(t))},this.isChildDisabled=function(t){return(0,N.default)(e.props.children).some(function(e){return(0,K.getValuePropValue)(e)===t&&e.props&&e.props.disabled})},this.tokenize=function(t){var n=e.props,o=n.multiple,l=n.tokenSeparators,i=n.children,a=e.state.value;return(0,K.splitBySeparators)(t,l).forEach(function(t){var n={key:t,label:t};if(-1===(0,K.findIndexInValueByLabel)(a,t))if(o){var l=e.getValueByLabel(i,t);l&&(n.key=l,a=a.concat(n))}else a=a.concat(n)}),a},this.adjustOpenState=function(){if(!e.skipAdjustOpen){var t=e.state.open,n=[];(t||e.hiddenForNoOptions)&&(n=e.renderFilterOptions()),e._options=n,!(0,K.isMultipleOrTagsOrCombobox)(e.props)&&e.props.showSearch||(t&&!n.length&&(t=!1,e.hiddenForNoOptions=!0),e.hiddenForNoOptions&&n.length&&(t=!0,e.hiddenForNoOptions=!1)),e.state.open=t}},this.renderFilterOptions=function(t){return e.renderFilterOptionsFromChildren(e.props.children,!0,t)},this.renderFilterOptionsFromChildren=function(t,n,o){var l=[],i=e.props,a=void 0===o?e.state.inputValue:o,r=[],u=i.tags;if(O.default.Children.forEach(t,function(t){if(t)if(t.type.isSelectOptGroup){var n=e.renderFilterOptionsFromChildren(t.props.children,!1);if(n.length){var o=t.props.label,i=t.key;i||"string"!==typeof o?!o&&i&&(o=i):i=o,l.push(O.default.createElement(x.ItemGroup,{key:i,title:o},n))}}else{(0,R.default)(t.type.isSelectOption,"the children of `Select` should be `Select.Option` or `Select.OptGroup`, instead of `"+(t.type.name||t.type.displayName||t.type)+"`.");var s=(0,K.getValuePropValue)(t);(0,K.validateOptionValue)(s,e.props),e.filterOption(a,t)&&l.push(O.default.createElement(x.Item,(0,f.default)({style:K.UNSELECTABLE_STYLE,attribute:K.UNSELECTABLE_ATTRIBUTE,value:s,key:s},t.props))),u&&!t.props.disabled&&r.push(s)}}),u){var s=e.state.value||[];if(s=s.filter(function(e){return-1===r.indexOf(e.key)&&(!a||String(e.key).indexOf(String(a))>-1)}),l=l.concat(s.map(function(e){var t=e.key;return O.default.createElement(x.Item,{style:K.UNSELECTABLE_STYLE,attribute:K.UNSELECTABLE_ATTRIBUTE,value:t,key:t},t)})),a){l.every(function(t){var n=function(){return(0,K.getValuePropValue)(t)===a};return!1!==e.props.filterOption?!e.filterOption.call(e,a,t,n):!n()})&&l.unshift(O.default.createElement(x.Item,{style:K.UNSELECTABLE_STYLE,attribute:K.UNSELECTABLE_ATTRIBUTE,value:a,key:a},a))}}return!l.length&&n&&i.notFoundContent&&(l=[O.default.createElement(x.Item,{style:K.UNSELECTABLE_STYLE,attribute:K.UNSELECTABLE_ATTRIBUTE,disabled:!0,value:"NOT_FOUND",key:"NOT_FOUND"},i.notFoundContent)]),l},this.renderTopControlNode=function(){var t=e.state,n=t.value,o=t.open,l=t.inputValue,i=e.props,a=i.choiceTransitionName,r=i.prefixCls,u=i.maxTagTextLength,s=i.maxTagCount,p=i.maxTagPlaceholder,d=i.showSearch,c=r+"-selection__rendered",h=null;if((0,K.isSingleMode)(i)){var v=null;if(n.length){var m=!1,g=1;d&&o?(m=!l)&&(g=.4):m=!0;var b=n[0];v=O.default.createElement("div",{key:"value",className:r+"-selection-selected-value",title:b.title||b.label,style:{display:m?"block":"none",opacity:g}},n[0].label)}h=d?[v,O.default.createElement("div",{className:r+"-search "+r+"-search--inline",key:"input",style:{display:o?"block":"none"}},e.getInputElement())]:[v]}else{var y=[],C=n,E=void 0;if(s&&n.length>s){C=C.slice(0,s);var T=e.getVLForOnChange(n.slice(s,n.length)),S="+ "+(n.length-s)+" ...";p&&(S="function"===typeof p?p(T):p),E=O.default.createElement("li",(0,f.default)({style:K.UNSELECTABLE_STYLE},K.UNSELECTABLE_ATTRIBUTE,{onMouseDown:K.preventDefaultEvent,className:r+"-selection__choice "+r+"-selection__choice__disabled",key:"maxTagPlaceholder",title:S}),O.default.createElement("div",{className:r+"-selection__choice__content"},S))}(0,K.isMultipleOrTags)(i)&&(y=C.map(function(t){var n=t.label,o=t.title||n;u&&"string"===typeof n&&n.length>u&&(n=n.slice(0,u)+"...");var l=e.isChildDisabled(t.key),i=l?r+"-selection__choice "+r+"-selection__choice__disabled":r+"-selection__choice";return O.default.createElement("li",(0,f.default)({style:K.UNSELECTABLE_STYLE},K.UNSELECTABLE_ATTRIBUTE,{onMouseDown:K.preventDefaultEvent,className:i,key:t.key,title:o}),O.default.createElement("div",{className:r+"-selection__choice__content"},n),l?null:O.default.createElement("span",{className:r+"-selection__choice__remove",onClick:e.removeSelected.bind(e,t.key)}))})),E&&y.push(E),y.push(O.default.createElement("li",{className:r+"-search "+r+"-search--inline",key:"__input"},e.getInputElement())),h=(0,K.isMultipleOrTags)(i)&&a?O.default.createElement(I.default,{onLeave:e.onChoiceAnimationLeave,component:"ul",transitionName:a},y):O.default.createElement("ul",null,y)}return O.default.createElement("div",{className:c,ref:(0,K.saveRef)(e,"topCtrlRef")},e.getPlaceholderElement(),h)}},r);t.default=H,H.displayName="Select"},831:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function l(e){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 "+e)}function i(e,t){return"value"===t?l(e):e.props[t]}function a(e){return e.multiple}function r(e){return e.combobox}function u(e){return e.multiple||e.tags}function s(e){return u(e)||r(e)}function p(e){return!s(e)}function d(e){var t=e;return void 0===e?t=[]:Array.isArray(e)||(t=[e]),t}function f(e){e.preventDefault()}function c(e,t){for(var n=-1,o=0;o<e.length;o++)if(e[o].key===t){n=o;break}return n}function h(e,t){for(var n=-1,o=0;o<e.length;o++)if(d(e[o].label).join("")===t){n=o;break}return n}function v(e,t){if(null===t||void 0===t)return[];var n=[];return w.default.Children.forEach(e,function(e){if(e.type.isMenuItemGroup)n=n.concat(v(e.props.children,t));else{var o=l(e),i=e.key;-1!==c(t,o)&&i&&n.push(i)}}),n}function m(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.type.isMenuItemGroup){var o=m(n.props.children);if(o)return o}else if(!n.props.disabled)return n}return null}function g(e,t){for(var n=0;n<t.length;++n)if(e.lastIndexOf(t[n])>0)return!0;return!1}function b(e,t){var n=new RegExp("["+t.join()+"]");return e.split(n).filter(function(e){return e})}function y(e,t){return!t.props.disabled&&String(i(t,this.props.optionFilterProp)).toLowerCase().indexOf(e.toLowerCase())>-1}function C(e,t){if(!p(t)&&!a(t)&&"string"!==typeof e)throw new Error("Invalid `value` of type `"+("undefined"===typeof e?"undefined":(0,S.default)(e))+"` supplied to Option, expected `string` when `tags/combobox` is `true`.")}function E(e,t){return function(n){e[t]=n}}Object.defineProperty(t,"__esModule",{value:!0}),t.UNSELECTABLE_ATTRIBUTE=t.UNSELECTABLE_STYLE=void 0;var T=n(24),S=o(T);t.getValuePropValue=l,t.getPropValue=i,t.isMultiple=a,t.isCombobox=r,t.isMultipleOrTags=u,t.isMultipleOrTagsOrCombobox=s,t.isSingleMode=p,t.toArray=d,t.preventDefaultEvent=f,t.findIndexInValueByKey=c,t.findIndexInValueByLabel=h,t.getSelectKeys=v,t.findFirstMenuItem=m,t.includesSeparators=g,t.splitBySeparators=b,t.defaultFilterFn=y,t.validateOptionValue=C,t.saveRef=E;var O=n(0),w=o(O);t.UNSELECTABLE_STYLE={userSelect:"none",WebkitUserSelect:"none"},t.UNSELECTABLE_ATTRIBUTE={unselectable:"unselectable"}},919:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l,i,a=n(9),r=o(a),u=n(11),s=o(u),p=n(1),d=o(p),f=n(6),c=o(f),h=n(2),v=o(h),m=n(5),g=o(m),b=n(3),y=o(b),C=n(4),E=o(C),T=n(136),S=o(T),O=n(0),w=o(O),M=n(13),_=o(M),k=n(7),V=o(k),N=n(920),L=o(N),A=n(10),D=o(A),I=n(831);S.default.displayName="Trigger";var F={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:0,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}},P=(i=l=function(e){function t(){var e,n,o,l;(0,v.default)(this,t);for(var i=arguments.length,a=Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=o=(0,y.default)(this,(e=t.__proto__||(0,c.default)(t)).call.apply(e,[this].concat(a))),o.state={dropdownWidth:null},o.setDropdownWidth=function(){var e=D.default.findDOMNode(o).offsetWidth;e!==o.state.dropdownWidth&&o.setState({dropdownWidth:e})},o.getInnerMenu=function(){return o.dropdownMenuRef&&o.dropdownMenuRef.menuRef},o.getPopupDOMNode=function(){return o.triggerRef.getPopupDomNode()},o.getDropdownElement=function(e){var t=o.props;return w.default.createElement(L.default,(0,d.default)({ref:(0,I.saveRef)(o,"dropdownMenuRef")},e,{prefixCls:o.getDropdownPrefixCls(),onMenuSelect:t.onMenuSelect,onMenuDeselect:t.onMenuDeselect,onPopupScroll:t.onPopupScroll,value:t.value,firstActiveValue:t.firstActiveValue,defaultActiveFirstOption:t.defaultActiveFirstOption,dropdownMenuStyle:t.dropdownMenuStyle}))},o.getDropdownTransitionName=function(){var e=o.props,t=e.transitionName;return!t&&e.animation&&(t=o.getDropdownPrefixCls()+"-"+e.animation),t},o.getDropdownPrefixCls=function(){return o.props.prefixCls+"-dropdown"},l=n,(0,y.default)(o,l)}return(0,E.default)(t,e),(0,g.default)(t,[{key:"componentDidMount",value:function(){this.setDropdownWidth()}},{key:"componentDidUpdate",value:function(){this.setDropdownWidth()}},{key:"render",value:function(){var e,t=this.props,n=t.onPopupFocus,o=(0,s.default)(t,["onPopupFocus"]),l=o.multiple,i=o.visible,a=o.inputValue,u=o.dropdownAlign,p=o.disabled,f=o.showSearch,c=o.dropdownClassName,h=o.dropdownStyle,v=o.dropdownMatchSelectWidth,m=this.getDropdownPrefixCls(),g=(e={},(0,r.default)(e,c,!!c),(0,r.default)(e,m+"--"+(l?"multiple":"single"),1),e),b=this.getDropdownElement({menuItems:o.options,onPopupFocus:n,multiple:l,inputValue:a,visible:i}),y=void 0;y=p?[]:(0,I.isSingleMode)(o)&&!f?["click"]:["blur"];var C=(0,d.default)({},h),E=v?"width":"minWidth";return this.state.dropdownWidth&&(C[E]=this.state.dropdownWidth+"px"),w.default.createElement(S.default,(0,d.default)({},o,{showAction:p?[]:this.props.showAction,hideAction:y,ref:(0,I.saveRef)(this,"triggerRef"),popupPlacement:"bottomLeft",builtinPlacements:F,prefixCls:m,popupTransitionName:this.getDropdownTransitionName(),onPopupVisibleChange:o.onDropdownVisibleChange,popup:b,popupAlign:u,popupVisible:i,getPopupContainer:o.getPopupContainer,popupClassName:(0,V.default)(g),popupStyle:C}),o.children)}}]),t}(w.default.Component),l.propTypes={onPopupFocus:_.default.func,onPopupScroll:_.default.func,dropdownMatchSelectWidth:_.default.bool,dropdownAlign:_.default.object,visible:_.default.bool,disabled:_.default.bool,showSearch:_.default.bool,dropdownClassName:_.default.string,multiple:_.default.bool,inputValue:_.default.string,filterOption:_.default.any,options:_.default.any,prefixCls:_.default.string,popupClassName:_.default.string,children:_.default.any,showAction:_.default.arrayOf(_.default.string)},i);t.default=P,P.displayName="SelectTrigger"},920:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l,i,a=n(1),r=o(a),u=n(6),s=o(u),p=n(2),d=o(p),f=n(5),c=o(f),h=n(3),v=o(h),m=n(4),g=o(m),b=n(0),y=o(b),C=n(10),E=n(13),T=o(E),S=n(138),O=o(S),w=n(815),M=o(w),_=n(140),k=o(_),V=n(831),N=(i=l=function(e){function t(){var e,n,o,l;(0,d.default)(this,t);for(var i=arguments.length,a=Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=o=(0,v.default)(this,(e=t.__proto__||(0,s.default)(t)).call.apply(e,[this].concat(a))),o.scrollActiveItemToView=function(){var e=(0,C.findDOMNode)(o.firstActiveItem),t=o.props;if(e){var n={onlyScrollIfNeeded:!0};t.value&&0!==t.value.length||!t.firstActiveValue||(n.alignWithTop=!0),(0,k.default)(e,(0,C.findDOMNode)(o.menuRef),n)}},l=n,(0,v.default)(o,l)}return(0,g.default)(t,e),(0,c.default)(t,[{key:"componentWillMount",value:function(){this.lastInputValue=this.props.inputValue}},{key:"componentDidMount",value:function(){this.scrollActiveItemToView(),this.lastVisible=this.props.visible}},{key:"shouldComponentUpdate",value:function(e){return e.visible||(this.lastVisible=!1),e.visible}},{key:"componentDidUpdate",value:function(e){var t=this.props;!e.visible&&t.visible&&this.scrollActiveItemToView(),this.lastVisible=t.visible,this.lastInputValue=t.inputValue}},{key:"renderMenu",value:function(){var e=this,t=this.props,n=t.menuItems,o=t.defaultActiveFirstOption,l=t.value,i=t.prefixCls,a=t.multiple,u=t.onMenuSelect,s=t.inputValue,p=t.firstActiveValue;if(n&&n.length){var d={};a?(d.onDeselect=t.onMenuDeselect,d.onSelect=u):d.onClick=u;var f=(0,V.getSelectKeys)(n,l),c={},h=n;if(f.length||p){t.visible&&!this.lastVisible&&(c.activeKey=f[0]||p);var v=!1,m=function(t){return!v&&-1!==f.indexOf(t.key)||!v&&!f.length&&-1!==p.indexOf(t.key)?(v=!0,(0,b.cloneElement)(t,{ref:function(t){e.firstActiveItem=t}})):t};h=n.map(function(e){if(e.type.isMenuItemGroup){var t=(0,O.default)(e.props.children).map(m);return(0,b.cloneElement)(e,{},t)}return m(e)})}var g=l&&l[l.length-1];return s===this.lastInputValue||g&&g.backfill||(c.activeKey=""),y.default.createElement(M.default,(0,r.default)({ref:(0,V.saveRef)(this,"menuRef"),style:this.props.dropdownMenuStyle,defaultActiveFirst:o},c,{multiple:a,focusable:!1},d,{selectedKeys:f,prefixCls:i+"-menu"}),h)}return null}},{key:"render",value:function(){var e=this.renderMenu();return e?y.default.createElement("div",{style:{overflow:"auto"},onFocus:this.props.onPopupFocus,onMouseDown:V.preventDefaultEvent,onScroll:this.props.onPopupScroll},e):null}}]),t}(y.default.Component),l.propTypes={defaultActiveFirstOption:T.default.bool,value:T.default.any,dropdownMenuStyle:T.default.object,multiple:T.default.bool,onPopupFocus:T.default.func,onPopupScroll:T.default.func,onMenuDeSelect:T.default.func,onMenuSelect:T.default.func,prefixCls:T.default.string,menuItems:T.default.any,inputValue:T.default.string,visible:T.default.bool},i);t.default=N,N.displayName="DropdownMenu"}});
//# sourceMappingURL=11.chunk.js.map?v=05b45625