mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-18 21:27:49 +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 Ob
|