mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-14 19:27:53 +00:00
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[7033],{77033:function(e,t,n){n.d(t,{Z:function(){return B}});var a=n(44194),l=n(51865),o=n.n(l);const s=(0,a.forwardRef)(((e,t)=>{const{prefixCls:n,className:l,children:s,size:r,style:i={}}=e,c=o()(`${n}-panel`,{[`${n}-panel-hidden`]:0===r},l),p=void 0!==r;return a.createElement("div",{ref:t,className:c,style:Object.assign(Object.assign({},i),{flexBasis:p?r:"auto",flexGrow:p?0:1})},s)}));var r=()=>null,i=n(20488),c=n(97721),p=n(31246),u=n(1648),b=n(54387),d=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(a=Object.getOwnPropertySymbols(e);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(n[a[l]]=e[a[l]])}return n};function h(e){if(e&&"object"==typeof e)return Object.assign(Object.assign({},e),{showCollapsibleIcon:void 0===e.showCollapsibleIcon?"auto":e.showCollapsibleIcon});const t=!!e;return{start:t,end:t,showCollapsibleIcon:"auto"}}var f=function(e){return a.useMemo((()=>(0,b.Z)(e).filter((e=>a.isValidElement(e))).map((e=>{const{props:t}=e,{collapsible:n}=t,a=d(t,["collapsible"]);return Object.assign(Object.assign({},a),{collapsible:h(n)})}))),[e])};function m(e,t){return e.collapsible&&t.collapsible?!0===e.showCollapsibleIcon||!0===t.showCollapsibleIcon||("auto"===e.showCollapsibleIcon||"auto"===t.showCollapsibleIcon)&&"auto":e.collapsible?e.showCollapsibleIcon:!!t.collapsible&&t.showCollapsibleIcon}var g=n(28548);function v(e){return Number(e.slice(0,-1))/100}function w(e){return"string"==typeof e&&e.endsWith("%")}function $(e,t){const n=e.map((e=>e.size)),l=e.length,o=t||0,s=e=>e*o,[r,i]=a.useState((()=>e.map((e=>e.defaultSize)))),c=a.useMemo((()=>{var e;const t=[];for(let a=0;a<l;a+=1)t[a]=null!==(e=n[a])&&void 0!==e?e:r[a];return t}),[l,r,n]),p=a.useMemo((()=>e.map((e=>w(e.min)?v(e.min):(e.min||0)/o))),[e,o]),u=a.useMemo((()=>e.map((e=>w(e.max)?v(e.max):(e.max||o)/o))),[e,o]),b=a.useMemo((()=>{const e=[];for(let t=0;t<l;t+=1){const n=c[t];if(w(n))e[t]=v(n);else if(n||0===n){const a=Number(n);Number.isNaN(a)||(e[t]=a/o)}else e[t]=void 0}return function(e,t,n){let a=0;const l=[];e.forEach(((e,t)=>{void 0===e?l.push(t):a+=e}));const o=1-a,s=l.length;if(o<0){const t=1/a;return e.map((e=>void 0===e?0:e*t))}let r=0,i=0,c=0,p=1;for(const e of l){const a=t[e]||0,l=n[e]||1;r+=a,i+=l,c=Math.max(c,a),p=Math.min(p,l)}if(r>1&&i<1){const t=1/s;return e.map((e=>void 0===e?t:e))}const u=o/s;if(c<=u&&u<=p)return e.map((e=>void 0===e?u:e));const b=(0,g.Z)(e);let d=o-r;for(let e=0;e<s;e+=1){const a=l[e],o=t[a]||0,s=n[a]||1;b[a]=o;const r=s-o,i=Math.min(r,d);b[a]+=i,d-=i}return b}(e,p,u)}),[c,o,p,u]),d=a.useMemo((()=>b.map(s)),[b,o]);return[a.useMemo((()=>t?d:c),[d,t]),d,b,p,u,i]}var z=n(70927),C=n(81121),x=n(46193),I=n(53886),S=n(99047);function y(e){return"number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)?Math.round(e):0}var O=e=>{const{prefixCls:t,vertical:n,index:l,active:s,ariaNow:r,ariaMin:i,ariaMax:p,resizable:u,startCollapsible:b,endCollapsible:d,onOffsetStart:h,onOffsetUpdate:f,onOffsetEnd:m,onCollapse:g,lazy:v,containerSize:w,showStartCollapsibleIcon:$,showEndCollapsibleIcon:O}=e,E=`${t}-bar`,[M,j]=(0,a.useState)(null),[k,N]=(0,a.useState)(0),Z=n?0:k,_=n?k:0,B=(0,c.Z)(((e,t)=>{const a=(e=>{const t=w*r/100,n=t+e,a=Math.max(0,w*i/100),l=Math.min(w,w*p/100);return Math.max(a,Math.min(l,n))-t})(n?t:e);N(a)})),P=(0,c.Z)((()=>{f(l,Z,_,!0),N(0),m(!0)})),R=e=>{switch(e){case!0:return`${E}-collapse-bar-always-visible`;case!1:return`${E}-collapse-bar-always-hidden`;case"auto":return`${E}-collapse-bar-hover-only`}};(0,S.Z)((()=>{if(!M)return;const e={mousemove:e=>{const{pageX:t,pageY:n}=e,a=t-M[0],o=n-M[1];v?B(a,o):f(l,a,o)},mouseup:()=>{v?P():m(),j(null)},touchmove:e=>{if(1===e.touches.length){const t=e.touches[0],n=t.pageX-M[0],a=t.pageY-M[1];v?B(n,a):f(l,n,a)}},touchend:()=>{v?P():m(),j(null)}};for(const[t,n]of Object.entries(e))window.addEventListener(t,n);return()=>{for(const[t,n]of Object.entries(e))window.removeEventListener(t,n)}}),[M,l,v]);const X={[`--${E}-preview-offset`]:`${k}px`},Y=n?I.Z:C.Z,D=n?z.Z:x.Z;return a.createElement("div",{className:E,role:"separator","aria-valuenow":y(r),"aria-valuemin":y(i),"aria-valuemax":y(p)},v&&a.createElement("div",{className:o()(`${E}-preview`,{[`${E}-preview-active`]:!!k}),style:X}),a.createElement("div",{className:o()(`${E}-dragger`,{[`${E}-dragger-disabled`]:!u,[`${E}-dragger-active`]:s}),onMouseDown:e=>{u&&e.currentTarget&&(j([e.pageX,e.pageY]),h(l))},onTouchStart:e=>{if(u&&1===e.touches.length){const t=e.touches[0];j([t.pageX,t.pageY]),h(l)}}}),b&&a.createElement("div",{className:o()(`${E}-collapse-bar`,`${E}-collapse-bar-start`,R($)),onClick:()=>g(l,"start")},a.createElement(Y,{className:o()(`${E}-collapse-icon`,`${E}-collapse-start`)})),d&&a.createElement("div",{className:o()(`${E}-collapse-bar`,`${E}-collapse-bar-end`,R(O)),onClick:()=>g(l,"end")},a.createElement(D,{className:o()(`${E}-collapse-icon`,`${E}-collapse-end`)})))},E=n(54184),M=n(51858);const j=e=>{const{componentCls:t}=e;return{[`&-rtl${t}-horizontal`]:{[`> ${t}-bar`]:{[`${t}-bar-collapse-previous`]:{insetInlineEnd:0,insetInlineStart:"unset"},[`${t}-bar-collapse-next`]:{insetInlineEnd:"unset",insetInlineStart:0}}},[`&-rtl${t}-vertical`]:{[`> ${t}-bar`]:{[`${t}-bar-collapse-previous`]:{insetInlineEnd:"50%",insetInlineStart:"unset"},[`${t}-bar-collapse-next`]:{insetInlineEnd:"50%",insetInlineStart:"unset"}}}}},k={position:"absolute",top:"50%",left:{_skip_check_:!0,value:"50%"},transform:"translate(-50%, -50%)"};var N=(0,M.I$)("Splitter",(e=>{const{componentCls:t,colorFill:n,splitBarDraggableSize:a,splitBarSize:l,splitTriggerSize:o,controlItemBgHover:s,controlItemBgActive:r,controlItemBgActiveHover:i,prefixCls:c}=e,p=`${t}-bar`,u=`${t}-mask`,b=`${t}-panel`,d=e.calc(o).div(2).equal(),h=`${c}-bar-preview-offset`,f={position:"absolute",background:e.colorPrimary,opacity:.2,pointerEvents:"none",transition:"none",zIndex:1,display:"none"};return{[t]:Object.assign(Object.assign(Object.assign({},(0,E.Wf)(e)),{display:"flex",width:"100%",height:"100%",alignItems:"stretch",[`> ${p}`]:{flex:"none",position:"relative",userSelect:"none",[`${p}-dragger`]:Object.assign(Object.assign({},k),{zIndex:1,"&::before":Object.assign({content:'""',background:s},k),"&::after":Object.assign({content:'""',background:n},k),[`&:hover:not(${p}-dragger-active)`]:{"&::before":{background:r}},"&-active":{zIndex:2,"&::before":{background:i}},[`&-disabled${p}-dragger`]:{zIndex:0,"&, &:hover, &-active":{cursor:"default","&::before":{background:s}},"&::after":{display:"none"}}}),[`${p}-collapse-bar`]:Object.assign(Object.assign({},k),{zIndex:e.zIndexPopupBase,background:s,fontSize:e.fontSizeSM,borderRadius:e.borderRadiusXS,color:e.colorText,cursor:"pointer",opacity:0,display:"flex",alignItems:"center",justifyContent:"center","&:hover":{background:r},"&:active":{background:i}}),"&:hover, &:active":{[`${p}-collapse-bar-hover-only`]:{opacity:1}},[`${p}-collapse-bar-hover-only`]:{"@media(hover:none)":{opacity:1}},[`${p}-collapse-bar-always-hidden`]:{display:"none"},[`${p}-collapse-bar-always-visible`]:{opacity:1}},[u]:{position:"fixed",zIndex:e.zIndexPopupBase,inset:0,"&-horizontal":{cursor:"col-resize"},"&-vertical":{cursor:"row-resize"}},"&-horizontal":{flexDirection:"row",[`> ${p}`]:{width:0,[`${p}-preview`]:Object.assign(Object.assign({height:"100%",width:l},f),{[`&${p}-preview-active`]:{display:"block",transform:`translateX(var(--${h}))`}}),[`${p}-dragger`]:{cursor:"col-resize",height:"100%",width:o,"&::before":{height:"100%",width:l},"&::after":{height:a,width:l}},[`${p}-collapse-bar`]:{width:e.fontSizeSM,height:e.controlHeightSM,"&-start":{left:{_skip_check_:!0,value:"auto"},right:{_skip_check_:!0,value:d},transform:"translateY(-50%)"},"&-end":{left:{_skip_check_:!0,value:d},right:{_skip_check_:!0,value:"auto"},transform:"translateY(-50%)"}}}},"&-vertical":{flexDirection:"column",[`> ${p}`]:{height:0,[`${p}-preview`]:Object.assign(Object.assign({height:l,width:"100%"},f),{[`&${p}-preview-active`]:{display:"block",transform:`translateY(var(--${h}))`}}),[`${p}-dragger`]:{cursor:"row-resize",width:"100%",height:o,"&::before":{width:"100%",height:l},"&::after":{width:a,height:l}},[`${p}-collapse-bar`]:{height:e.fontSizeSM,width:e.controlHeightSM,"&-start":{top:"auto",bottom:d,transform:"translateX(-50%)"},"&-end":{top:d,bottom:"auto",transform:"translateX(-50%)"}}}},[b]:{overflow:"auto",padding:"0 1px",scrollbarWidth:"thin",boxSizing:"border-box","&-hidden":{padding:0,overflow:"hidden"},[`&:has(${t}:only-child)`]:{overflow:"hidden"}}}),j(e))}}),(e=>{var t;const n=e.splitBarSize||2,a=e.splitTriggerSize||6,l=e.resizeSpinnerSize||20;return{splitBarSize:n,splitTriggerSize:a,splitBarDraggableSize:null!==(t=e.splitBarDraggableSize)&&void 0!==t?t:l,resizeSpinnerSize:l}}));var Z=e=>{const{prefixCls:t,className:n,style:l,layout:r="horizontal",children:b,rootClassName:d,onResizeStart:h,onResize:w,onResizeEnd:z,lazy:C}=e,{getPrefixCls:x,direction:I,className:S,style:y}=(0,p.dj)("splitter"),E=x("splitter",t),M=(0,u.Z)(E),[j,k,Z]=N(E,M),_="vertical"===r,B="rtl"===I,P=!_&&B,R=f(b);const[X,Y]=(0,a.useState)(),[D,T,H,W,F,L]=$(R,X),A=function(e,t,n){return a.useMemo((()=>{const a=[];for(let l=0;l<e.length-1;l+=1){const o=e[l],s=e[l+1],r=t[l],i=t[l+1],{resizable:c=!0,min:p,collapsible:u}=o,{resizable:b=!0,min:d,collapsible:h}=s,f=c&&b&&(0!==r||!p)&&(0!==i||!d),g=!!u.end&&r>0,v=!!h.start&&0===i&&r>0,w=g||v,$=!!h.start&&i>0,z=!!u.end&&0===r&&i>0,C=$||z,x=m({collapsible:g,showCollapsibleIcon:u.showCollapsibleIcon},{collapsible:v,showCollapsibleIcon:h.showCollapsibleIcon}),I=m({collapsible:$,showCollapsibleIcon:h.showCollapsibleIcon},{collapsible:z,showCollapsibleIcon:u.showCollapsibleIcon});a[l]={resizable:f,startCollapsible:!!(n?C:w),endCollapsible:!!(n?w:C),showStartCollapsibleIcon:n?I:x,showEndCollapsibleIcon:n?x:I}}return a}),[t,e,n])}(R,T,B),[U,q,G,V,J]=function(e,t,n,l,o,s){const r=e.map((e=>[e.min,e.max])),i=l||0,c=e=>e*i;function p(e,t){return"string"==typeof e?c(v(e)):null!=e?e:t}const[u,b]=a.useState([]),d=a.useRef([]),[h,f]=a.useState(null),m=()=>n.map(c);return[e=>{b(m()),f({index:e,confirmed:!1})},(e,n)=>{var a;let l=null;if(!(h&&h.confirmed||0===n))if(n>0)l=e,f({index:e,confirmed:!0});else for(let n=e;n>=0;n-=1)if(u[n]>0&&t[n].resizable){l=n,f({index:n,confirmed:!0});break}const s=null!==(a=null!=l?l:null==h?void 0:h.index)&&void 0!==a?a:e,c=(0,g.Z)(u),b=s+1,d=p(r[s][0],0),m=p(r[b][0],0),v=p(r[s][1],i),w=p(r[b][1],i);let $=n;return c[s]+$<d&&($=d-c[s]),c[b]-$<m&&($=c[b]-m),c[s]+$>v&&($=v-c[s]),c[b]-$>w&&($=c[b]-w),c[s]+=$,c[b]-=$,o(c),c},()=>{f(null)},(e,t)=>{const n=m(),a=s?"start"===t?"end":"start":t,l="start"===a?e:e+1,c="start"===a?e+1:e,u=n[l],b=n[c];if(0!==u&&0!==b)n[l]=0,n[c]+=u,d.current[e]=u;else{const t=u+b,a=p(r[l][0],0),o=p(r[l][1],i),s=p(r[c][0],0),h=p(r[c][1],i),f=Math.max(a,t-h),m=Math.min(o,t-s),g=s||(m-f)/2,v=d.current[e],w=t-v;v&&v<=h&&v>=s&&w<=o&&w>=a?(n[c]=v,n[l]=w):(n[l]-=g,n[c]+=g)}return o(n),n},null==h?void 0:h.index]}(R,A,H,X,L,B),K=(0,c.Z)((e=>{U(e),null==h||h(T)})),Q=(0,c.Z)(((e,t,n)=>{const a=q(e,t);n?null==z||z(a):null==w||w(a)})),ee=(0,c.Z)((e=>{G(),e||null==z||z(T)})),te=(0,c.Z)(((t,n)=>{var a;const l=V(t,n);null==w||w(l),null==z||z(l);const o=l.map((e=>Math.abs(e)<Number.EPSILON));null===(a=e.onCollapse)||void 0===a||a.call(e,o,l)})),ne=o()(E,n,`${E}-${r}`,{[`${E}-rtl`]:B},d,S,Z,M,k),ae=`${E}-mask`,le=a.useMemo((()=>{const e=[];let t=0;const n=R.length;for(let a=0;a<n;a+=1)t+=H[a],e.push(t);return e}),[H,R.length]),oe=Object.assign(Object.assign({},y),l);return j(a.createElement(i.Z,{onResize:e=>{const{offsetWidth:t,offsetHeight:n}=e,a=_?n:t;0!==a&&Y(a)}},a.createElement("div",{style:oe,className:ne},R.map(((e,t)=>{const n=a.createElement(s,Object.assign({},e,{prefixCls:E,size:D[t]}));let l=null;const o=A[t];if(o){const e=(le[t-1]||0)+W[t],n=(le[t+1]||100)-F[t+1],s=(le[t-1]||0)+F[t],r=(le[t+1]||100)-W[t+1];l=a.createElement(O,{lazy:C,index:t,active:J===t,prefixCls:E,vertical:_,resizable:o.resizable,ariaNow:100*le[t],ariaMin:100*Math.max(e,n),ariaMax:100*Math.min(s,r),startCollapsible:o.startCollapsible,endCollapsible:o.endCollapsible,showStartCollapsibleIcon:o.showStartCollapsibleIcon,showEndCollapsibleIcon:o.showEndCollapsibleIcon,onOffsetStart:K,onOffsetUpdate:(e,t,n,a)=>{let l=_?n:t;P&&(l=-l),Q(e,l,a)},onOffsetEnd:ee,onCollapse:te,containerSize:X||0})}return a.createElement(a.Fragment,{key:`split-panel-${t}`},n,l)})),"number"==typeof J&&a.createElement("div",{"aria-hidden":!0,className:o()(ae,`${ae}-${r}`)}))))};const _=Z;_.Panel=r;var B=_}}]); |