You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
20 KiB
1 line
20 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[34379,74324],{56762:function(e,o,t){t.d(o,{Z:function(){return r}});var n=t(59301);function r(){const[,e]=n.useReducer((e=>e+1),0);return e}},24905:function(e,o,t){t.d(o,{Z:function(){return w}});var n=t(92310),r=t.n(n),l=t(5630),a=t(59301),i=t(36355),s=t(1684),c=t(32441);var d=a.createContext(null),u=t(98447),p=t(14088),f=t(4572),b=function(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t};const m=(e,o)=>{var t;const{prefixCls:n,className:m,rootClassName:g,children:v,indeterminate:h=!1,style:C,onMouseEnter:y,onMouseLeave:O,skipGroup:$=!1,disabled:x}=e,w=b(e,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:k,direction:S,checkbox:E}=a.useContext(i.E_),I=a.useContext(d),{isFormItemInput:P}=a.useContext(c.aM),N=a.useContext(s.Z),j=null!==(t=(null==I?void 0:I.disabled)||x)&&void 0!==t?t:N,Z=a.useRef(w.value);a.useEffect((()=>{null==I||I.registerValue(w.value)}),[]),a.useEffect((()=>{if(!$)return w.value!==Z.current&&(null==I||I.cancelValue(Z.current),null==I||I.registerValue(w.value),Z.current=w.value),()=>null==I?void 0:I.cancelValue(w.value)}),[w.value]);const M=k("checkbox",n),[T,R]=(0,u.ZP)(M),B=Object.assign({},w);I&&!$&&(B.onChange=function(){w.onChange&&w.onChange.apply(w,arguments),I.toggleOption&&I.toggleOption({label:v,value:w.value})},B.name=I.name,B.checked=I.value.includes(w.value));const z=r()(`${M}-wrapper`,{[`${M}-rtl`]:"rtl"===S,[`${M}-wrapper-checked`]:B.checked,[`${M}-wrapper-disabled`]:j,[`${M}-wrapper-in-form-item`]:P},null==E?void 0:E.className,m,g,R),F=r()({[`${M}-indeterminate`]:h},f.A,R),W=h?"mixed":void 0;return T(a.createElement(p.Z,{component:"Checkbox",disabled:j},a.createElement("label",{className:z,style:Object.assign(Object.assign({},null==E?void 0:E.style),C),onMouseEnter:y,onMouseLeave:O},a.createElement(l.Z,Object.assign({"aria-checked":W},B,{prefixCls:M,className:F,disabled:j,ref:o})),void 0!==v&&a.createElement("span",null,v))))};var g=a.forwardRef(m),v=t(61414),h=t(55405),C=function(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t};const y=(e,o)=>{const{defaultValue:t,children:n,options:l=[],prefixCls:s,className:c,rootClassName:p,style:f,onChange:b}=e,m=C(e,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:y,direction:O}=a.useContext(i.E_),[$,x]=a.useState(m.value||t||[]),[w,k]=a.useState([]);a.useEffect((()=>{"value"in m&&x(m.value||[])}),[m.value]);const S=a.useMemo((()=>l.map((e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e))),[l]),E=y("checkbox",s),I=`${E}-group`,[P,N]=(0,u.ZP)(E),j=(0,h.Z)(m,["value","disabled"]),Z=l.length?S.map((e=>a.createElement(g,{prefixCls:E,key:e.value.toString(),disabled:"disabled"in e?e.disabled:m.disabled,value:e.value,checked:$.includes(e.value),onChange:e.onChange,className:`${I}-item`,style:e.style,title:e.title},e.label))):n,M={toggleOption:e=>{const o=$.indexOf(e.value),t=(0,v.Z)($);-1===o?t.push(e.value):t.splice(o,1),"value"in m||x(t),null==b||b(t.filter((e=>w.includes(e))).sort(((e,o)=>S.findIndex((o=>o.value===e))-S.findIndex((e=>e.value===o)))))},value:$,disabled:m.disabled,name:m.name,registerValue:e=>{k((o=>[].concat((0,v.Z)(o),[e])))},cancelValue:e=>{k((o=>o.filter((o=>o!==e))))}},T=r()(I,{[`${I}-rtl`]:"rtl"===O},c,p,N);return P(a.createElement("div",Object.assign({className:T,style:f},j,{ref:o}),a.createElement(d.Provider,{value:M},Z)))},O=a.forwardRef(y);var $=a.memo(O);const x=g;x.Group=$,x.__ANT_CHECKBOX=!0;var w=x},98447:function(e,o,t){t.d(o,{C2:function(){return i}});var n=t(17313),r=t(37613),l=t(83116);const a=e=>{const{checkboxCls:o}=e,t=`${o}-wrapper`;return[{[`${o}-group`]:Object.assign(Object.assign({},(0,n.Wf)(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}}),[t]:Object.assign(Object.assign({},(0,n.Wf)(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${t}`]:{marginInlineStart:0},[`&${t}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[o]:Object.assign(Object.assign({},(0,n.Wf)(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",[`${o}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${o}-inner`]:Object.assign({},(0,n.oN)(e))},[`${o}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:`all ${e.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:e.checkboxSize/14*5,height:e.checkboxSize/14*8,border:`${e.lineWidthBold}px solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{[`\n ${t}:not(${t}-disabled),\n ${o}:not(${o}-disabled)\n `]:{[`&:hover ${o}-inner`]:{borderColor:e.colorPrimary}},[`${t}:not(${t}-disabled)`]:{[`&:hover ${o}-checked:not(${o}-disabled) ${o}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${o}-checked:not(${o}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${o}-checked`]:{[`${o}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}}},[`\n ${t}-checked:not(${t}-disabled),\n ${o}-checked:not(${o}-disabled)\n `]:{[`&:hover ${o}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[o]:{"&-indeterminate":{[`${o}-inner`]:{backgroundColor:e.colorBgContainer,borderColor:e.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:e.fontSizeLG/2,height:e.fontSizeLG/2,backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${t}-disabled`]:{cursor:"not-allowed"},[`${o}-disabled`]:{[`&, ${o}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${o}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},[`&${o}-indeterminate ${o}-inner::after`]:{background:e.colorTextDisabled}}}]};function i(e,o){const t=(0,r.TS)(o,{checkboxCls:`.${e}`,checkboxSize:o.controlInteractiveSize});return[a(t)]}o.ZP=(0,l.Z)("Checkbox",((e,o)=>{let{prefixCls:t}=o;return[i(t,e)]}))},57809:function(e,o,t){var n=t(92310),r=t.n(n),l=t(77861),a=t(55405),i=t(59301),s=t(53487),c=t(62892),d=t(19080),u=t(36355),p=t(1684),f=t(93891),b=t(19716),m=t(32441),g=t(33234),v=t(14154),h=t(58582),C=t(84443),y=t(66339),O=function(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t};const $="SECRET_COMBOBOX_MODE_DO_NOT_USE",x=(e,o)=>{var t,{prefixCls:n,bordered:s=!0,className:x,rootClassName:w,getPopupContainer:k,popupClassName:S,dropdownClassName:E,listHeight:I=256,placement:P,listItemHeight:N=24,size:j,disabled:Z,notFoundContent:M,status:T,builtinPlacements:R,dropdownMatchSelectWidth:B,popupMatchSelectWidth:z,direction:F,style:W,allowClear:D}=e,H=O(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:_,getPrefixCls:A,renderEmpty:L,direction:V,virtual:X,popupMatchSelectWidth:G,popupOverflow:U,select:Y}=i.useContext(u.E_),Q=A("select",n),K=A(),q=null!=F?F:V,{compactSize:J,compactItemClassnames:ee}=(0,g.ri)(Q,q),[oe,te]=(0,v.Z)(Q),ne=i.useMemo((()=>{const{mode:e}=H;if("combobox"!==e)return e===$?"combobox":e}),[H.mode]),re="multiple"===ne||"tags"===ne,le=(0,C.Z)(H.suffixIcon,H.showArrow),ae=null!==(t=null!=z?z:B)&&void 0!==t?t:G,{status:ie,hasFeedback:se,isFormItemInput:ce,feedbackIcon:de}=i.useContext(m.aM),ue=(0,d.F)(ie,T);let pe;pe=void 0!==M?M:"combobox"===ne?null:(null==L?void 0:L("Select"))||i.createElement(f.Z,{componentName:"Select"});const{suffixIcon:fe,itemIcon:be,removeIcon:me,clearIcon:ge}=(0,y.Z)(Object.assign(Object.assign({},H),{multiple:re,hasFeedback:se,feedbackIcon:de,showSuffixIcon:le,prefixCls:Q,showArrow:H.showArrow,componentName:"Select"})),ve=!0===D?{clearIcon:ge}:D,he=(0,a.Z)(H,["suffixIcon","itemIcon"]),Ce=r()(S||E,{[`${Q}-dropdown-${q}`]:"rtl"===q},w,te),ye=(0,b.Z)((e=>{var o;return null!==(o=null!=j?j:J)&&void 0!==o?o:e})),Oe=i.useContext(p.Z),$e=null!=Z?Z:Oe,xe=r()({[`${Q}-lg`]:"large"===ye,[`${Q}-sm`]:"small"===ye,[`${Q}-rtl`]:"rtl"===q,[`${Q}-borderless`]:!s,[`${Q}-in-form-item`]:ce},(0,d.Z)(Q,ue,se),ee,null==Y?void 0:Y.className,x,w,te),we=i.useMemo((()=>void 0!==P?P:"rtl"===q?"bottomRight":"bottomLeft"),[P,q]),ke=(0,h.Z)(R,U);return oe(i.createElement(l.ZP,Object.assign({ref:o,virtual:X,showSearch:null==Y?void 0:Y.showSearch},he,{style:Object.assign(Object.assign({},null==Y?void 0:Y.style),W),dropdownMatchSelectWidth:ae,builtinPlacements:ke,transitionName:(0,c.m)(K,"slide-up",H.transitionName),listHeight:I,listItemHeight:N,mode:ne,prefixCls:Q,placement:we,direction:q,suffixIcon:fe,menuItemSelectedIcon:be,removeIcon:me,allowClear:ve,notFoundContent:pe,className:xe,getPopupContainer:k||_,dropdownClassName:Ce,disabled:$e})))};const w=i.forwardRef(x),k=(0,s.Z)(w);w.SECRET_COMBOBOX_MODE_DO_NOT_USE=$,w.Option=l.Wx,w.OptGroup=l.Xo,w._InternalPanelDoNotUseOrYouWillBeFired=k,o.default=w},8378:function(e,o){o.Z=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}})},12563:function(e,o,t){t.d(o,{Z:function(){return S}});var n=t(59301),r=t(53043),l=t(92310),a=t.n(l),i=t(36785),s=t(47729),c=t(14088),d=t(36355),u=t(17313),p=t(37613),f=t(83116);const b=e=>{const{lineWidth:o,fontSizeIcon:t}=e,n=e.fontSizeSM,r=e.lineHeightSM*n+"px";return(0,p.TS)(e,{tagFontSize:n,tagLineHeight:r,tagIconSize:t-2*o,tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary})},m=e=>({defaultBg:e.colorFillQuaternary,defaultColor:e.colorText});var g=(0,f.Z)("Tag",(e=>(e=>{const{paddingXXS:o,lineWidth:t,tagPaddingHorizontal:n,componentCls:r}=e,l=n-t,a=o-t;return{[r]:Object.assign(Object.assign({},(0,u.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:l,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${r}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${r}-close-icon`]:{marginInlineStart:a,color:e.colorTextDescription,fontSize:e.tagIconSize,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${r}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${r}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:l}}),[`${r}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}})(b(e))),m),v=function(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t};var h=e=>{const{prefixCls:o,style:t,className:r,checked:l,onChange:i,onClick:s}=e,c=v(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:u,tag:p}=n.useContext(d.E_),f=u("tag",o),[b,m]=g(f),h=a()(f,`${f}-checkable`,{[`${f}-checkable-checked`]:l},null==p?void 0:p.className,r,m);return b(n.createElement("span",Object.assign({},c,{style:Object.assign(Object.assign({},t),null==p?void 0:p.style),className:h,onClick:e=>{null==i||i(!l),null==s||s(e)}})))},C=t(45157);var y=(0,f.b)(["Tag","preset"],(e=>(e=>(0,C.Z)(e,((o,t)=>{let{textColor:n,lightBorderColor:r,lightColor:l,darkColor:a}=t;return{[`${e.componentCls}-${o}`]:{color:n,background:l,borderColor:r,"&-inverse":{color:e.colorTextLightSolid,background:a,borderColor:a},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}})))(b(e))),m);const O=(e,o,t)=>{const n="string"!=typeof(r=t)?r:r.charAt(0).toUpperCase()+r.slice(1);var r;return{[`${e.componentCls}-${o}`]:{color:e[`color${t}`],background:e[`color${n}Bg`],borderColor:e[`color${n}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}};var $=(0,f.b)(["Tag","status"],(e=>{const o=b(e);return[O(o,"success","Success"),O(o,"processing","Info"),O(o,"error","Error"),O(o,"warning","Warning")]}),m),x=function(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t};const w=(e,o)=>{const{prefixCls:t,className:l,rootClassName:u,style:p,children:f,icon:b,color:m,onClose:v,closeIcon:h,closable:C,bordered:O=!0}=e,w=x(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:k,direction:S,tag:E}=n.useContext(d.E_),[I,P]=n.useState(!0);n.useEffect((()=>{"visible"in w&&P(w.visible)}),[w.visible]);const N=(0,i.o2)(m),j=(0,i.yT)(m),Z=N||j,M=Object.assign(Object.assign({backgroundColor:m&&!Z?m:void 0},null==E?void 0:E.style),p),T=k("tag",t),[R,B]=g(T),z=a()(T,null==E?void 0:E.className,{[`${T}-${m}`]:Z,[`${T}-has-color`]:m&&!Z,[`${T}-hidden`]:!I,[`${T}-rtl`]:"rtl"===S,[`${T}-borderless`]:!O},l,u,B),F=e=>{e.stopPropagation(),null==v||v(e),e.defaultPrevented||P(!1)},[,W]=(0,s.Z)(C,h,(e=>null===e?n.createElement(r.Z,{className:`${T}-close-icon`,onClick:F}):n.createElement("span",{className:`${T}-close-icon`,onClick:F},e)),null,!1),D="function"==typeof w.onClick||f&&"a"===f.type,H=b||null,_=H?n.createElement(n.Fragment,null,H,f&&n.createElement("span",null,f)):f,A=n.createElement("span",Object.assign({},w,{ref:o,className:z,style:M}),_,W,N&&n.createElement(y,{key:"preset",prefixCls:T}),j&&n.createElement($,{key:"status",prefixCls:T}));return R(D?n.createElement(c.Z,{component:"Tag"},A):A)},k=n.forwardRef(w);k.CheckableTag=h;var S=k},31561:function(e,o,t){t.d(o,{Z:function(){return $}});var n=t(33614),r=t(24018),l=t(54099),a=t(63011),i=t(35593),s=t(92310),c=t.n(s),d=t(25629),u=t(59301),p=t(20287),f=t(71783),b=p.Z.ESC,m=p.Z.TAB;var g=(0,u.forwardRef)((function(e,o){var t=e.overlay,n=e.arrow,r=e.prefixCls,l=(0,u.useMemo)((function(){return"function"==typeof t?t():t}),[t]),a=(0,d.sQ)(o,null==l?void 0:l.ref);return u.createElement(u.Fragment,null,n&&u.createElement("div",{className:"".concat(r,"-arrow")}),u.cloneElement(l,{ref:(0,d.Yr)(l)?a:void 0}))})),v={adjustX:1,adjustY:1},h=[0,0],C={topLeft:{points:["bl","tl"],overflow:v,offset:[0,-4],targetOffset:h},top:{points:["bc","tc"],overflow:v,offset:[0,-4],targetOffset:h},topRight:{points:["br","tr"],overflow:v,offset:[0,-4],targetOffset:h},bottomLeft:{points:["tl","bl"],overflow:v,offset:[0,4],targetOffset:h},bottom:{points:["tc","bc"],overflow:v,offset:[0,4],targetOffset:h},bottomRight:{points:["tr","br"],overflow:v,offset:[0,4],targetOffset:h}},y=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function O(e,o){var t,s=e.arrow,p=void 0!==s&&s,v=e.prefixCls,h=void 0===v?"rc-dropdown":v,O=e.transitionName,$=e.animation,x=e.align,w=e.placement,k=void 0===w?"bottomLeft":w,S=e.placements,E=void 0===S?C:S,I=e.getPopupContainer,P=e.showAction,N=e.hideAction,j=e.overlayClassName,Z=e.overlayStyle,M=e.visible,T=e.trigger,R=void 0===T?["hover"]:T,B=e.autoFocus,z=e.overlay,F=e.children,W=e.onVisibleChange,D=(0,a.Z)(e,y),H=u.useState(),_=(0,l.Z)(H,2),A=_[0],L=_[1],V="visible"in e?M:A,X=u.useRef(null),G=u.useRef(null),U=u.useRef(null);u.useImperativeHandle(o,(function(){return X.current}));var Y=function(e){L(e),null==W||W(e)};!function(e){var o=e.visible,t=e.triggerRef,n=e.onVisibleChange,r=e.autoFocus,l=e.overlayRef,a=u.useRef(!1),i=function(){var e,r;o&&(null===(e=t.current)||void 0===e||null===(r=e.focus)||void 0===r||r.call(e),null==n||n(!1))},s=function(){var e;return!(null===(e=l.current)||void 0===e||!e.focus||(l.current.focus(),a.current=!0,0))},c=function(e){switch(e.keyCode){case b:i();break;case m:var o=!1;a.current||(o=s()),o?e.preventDefault():i()}};u.useEffect((function(){return o?(window.addEventListener("keydown",c),r&&(0,f.Z)(s,3),function(){window.removeEventListener("keydown",c),a.current=!1}):function(){a.current=!1}}),[o])}({visible:V,triggerRef:U,onVisibleChange:Y,autoFocus:B,overlayRef:G});var Q,K,q,J=function(){return u.createElement(g,{ref:G,overlay:z,prefixCls:h,arrow:p})},ee=u.cloneElement(F,{className:c()(null===(t=F.props)||void 0===t?void 0:t.className,V&&(Q=e.openClassName,void 0!==Q?Q:"".concat(h,"-open"))),ref:(0,d.Yr)(F)?(0,d.sQ)(U,F.ref):void 0}),oe=N;return oe||-1===R.indexOf("contextMenu")||(oe=["click"]),u.createElement(i.Z,(0,n.Z)({builtinPlacements:E},D,{prefixCls:h,ref:X,popupClassName:c()(j,(0,r.Z)({},"".concat(h,"-show-arrow"),p)),popupStyle:Z,action:R,showAction:P,hideAction:oe,popupPlacement:k,popupAlign:x,popupTransitionName:O,popupAnimation:$,popupVisible:V,stretch:(K=e.minOverlayWidthMatchTrigger,q=e.alignPoint,("minOverlayWidthMatchTrigger"in e?K:!q)?"minWidth":""),popup:"function"==typeof z?J:J(),onPopupVisibleChange:Y,onPopupClick:function(o){var t=e.onOverlayClick;L(!1),t&&t(o)},getPopupContainer:I}),ee)}var $=u.forwardRef(O)}}]); |