2 lines
18 KiB
JavaScript
2 lines
18 KiB
JavaScript
|
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[60143],{3519:function(){},18480:function(rn,ze,f){"use strict";f.d(ze,{Z:function(){return Bn}});var ue=f(22122),L=f(96156),ye=f(90484),_=f(85061),je=f(67724),Xe=f(7085),on=f(8812),ln=f(94184),Oe=f.n(ln),se=f(28481),cn=f(81253),Ae=f(74484),un=f(88708),Ne=f(17341),Ge=f(21770),r=f(67294),sn=r.createContext(null),Ee=sn,Te="__RC_CASCADER_SPLIT__",Je="SHOW_PARENT",Ye="SHOW_CHILD";function he(e){return e.join(Te)}function be(e){return e.map(he)}function dn(e){return e.split(Te)}function vn(e){var n=e||{},a=n.label,t=n.value,o=n.children,l=t||"value";return{label:a||"label",value:l,key:l,children:o||"children"}}function Ie(e,n){var a,t;return(a=e.isLeaf)!==null&&a!==void 0?a:!((t=e[n.children])===null||t===void 0?void 0:t.length)}function fn(e){var n=e.parentElement;if(!!n){var a=e.offsetTop-n.offsetTop;a-n.scrollTop<0?n.scrollTo({top:a}):a+e.offsetHeight-n.scrollTop>n.offsetHeight&&n.scrollTo({top:a+e.offsetHeight-n.offsetHeight})}}function Qe(e,n,a){var t=new Set(e),o=n();return e.filter(function(l){var i=o[l],c=i?i.parent:null,d=i?i.children:null;return a===Ye?!(d&&d.some(function(u){return u.key&&t.has(u.key)})):!(c&&!c.node.disabled&&t.has(c.key))})}function Ze(e,n,a){for(var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=n,l=[],i=function(u){var b,m,O,C=e[u],p=(b=o)===null||b===void 0?void 0:b.findIndex(function(g){var E=g[a.value];return t?String(E)===String(C):E===C}),v=p!==-1?(m=o)===null||m===void 0?void 0:m[p]:null;l.push({value:(O=v==null?void 0:v[a.value])!==null&&O!==void 0?O:C,index:p,option:v}),o=v==null?void 0:v[a.children]},c=0;c<e.length;c+=1)i(c);return l}var pn=function(e,n,a,t,o){return r.useMemo(function(){var l=o||function(i){var c=t?i.slice(-1):i,d=" / ";return c.every(function(u){return["string","number"].includes((0,ye.Z)(u))})?c.join(d):c.reduce(function(u,b,m){var O=r.isValidElement(b)?r.cloneElement(b,{key:m}):b;return m===0?[O]:[].concat((0,_.Z)(u),[d,O])},[])};return e.map(function(i){var c,d,u=Ze(i,n,a),b=l(u.map(function(O){var C,p=O.option,v=O.value;return(C=p==null?void 0:p[a.label])!==null&&C!==void 0?C:v}),u.map(function(O){var C=O.option;return C})),m=he(i);return{label:b,value:m,key:m,valueCells:i,disabled:(c=u[u.length-1])===null||c===void 0||(d=c.option)===null||d===void 0?void 0:d.disabled}})},[e,n,a,o,t])},me=f(28991),hn=f(1089),mn=function(e,n){var a=r.useRef({options:null,info:null}),t=r.useCallback(function(){return a.current.options!==e&&(a.current.options=e,a.current.info=(0,hn.I8)(e,{fieldNames:n,initWrapper:function(l){return(0,me.Z)((0,me.Z)({},l),{},{pathKeyEntities:{}})},processEntity:function(l,i){var c=l.nodes.map(function(d){return d[n.value]}).join(Te);i.pathKeyEntities[c]=l,l.key=c}})),a.current.info.pathKeyEntities},[n,e]);return t},gn=function(e,n){return r.useCallback(function(a){var t=[],o=[];return a.forEach(function(l){var i=Ze(l,e,n);i.every(function(c){return c.option})?o.push(l):t.push(l)}),[o,t]},[e,n])};function _e(e){var n=r.useRef();n.current=e;var a=r.useCallback(function(){return n.current.apply(n,arguments)},[]);return a}var ta=f(80334);function Cn(e){return r.useMemo(function(){if(!e)return[!1,{}];var n={matchInputWidth:!0,limit:50};return e&&(0,ye.Z)(e)==="object"&&(n=(0,me.Z)((0,me.Z)({},n),e)),n.limit<=0&&delete n.limit,[!0,n]},[e])}var we="__rc_cascader_search_mark__",Sn=function(n,a,t){var o=t.label;return a.some(function(l){return String(l[o]).toLowerCase().includes(n.toLowerCase())})},Pn=function(n,a,t,o){return a.map(function(l){return l[o.label]}).join(" / ")},yn=function(e,n,a,t,o,l){var i=o.filter,c=i===void 0?Sn:i,d=o.render,u=d===void 0?Pn:d,b=o.limit,m=b===void 0?50:b,O=o.sort;return r.useMemo(function(){var C=[];if(!e)return[];function p(v,g){v.forEach(function(E){if(!(!O&&m>0&&C.length>=m)){var $=[].concat((0,_.Z)(g),[E]),P=E[a.children];if((!P||P.length===0||l)&&c(e,$,{label:a.label})){var N;C.push((0,me.Z)((0,me.Z)({},E),{},(N={},(0,L.Z)(N,a.label,u(e,$,t,a)),(0,L.Z)(N,we,$),N)))}P&&p(E[a.children],$)}})}return p(n,[]),O&&C.sort(function(v,g){r
|