@yester/virtual-table 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -0
- package/dist/components/Icons/DownCircleOutlined.d.ts +4 -0
- package/dist/components/Icons/UpCircleOutlined.d.ts +4 -0
- package/dist/components/VirtualTable/Cell.d.ts +15 -0
- package/dist/components/VirtualTable/Renderer.d.ts +25 -0
- package/dist/components/VirtualTable/TableHeader.d.ts +10 -0
- package/dist/components/VirtualTable/index.d.ts +13 -0
- package/dist/index.d.ts +4 -0
- package/dist/style.css +1 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/types/index.d.ts +80 -0
- package/dist/utils/cloneDeep.d.ts +1 -0
- package/dist/utils/dataHandler.d.ts +47 -0
- package/dist/utils/pivotHandler.d.ts +15 -0
- package/dist/utils/vars.d.ts +9 -0
- package/dist/virtual-table.es.js +2837 -0
- package/dist/virtual-table.es.js.map +1 -0
- package/dist/virtual-table.umd.js +53 -0
- package/dist/virtual-table.umd.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
(function(ye,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],E):(ye=typeof globalThis<"u"?globalThis:ye||self,E(ye.VirtualTable={},ye.React,ye.ReactDOM))})(this,function(ye,E,mt){"use strict";function or(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ee=or(E);function ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ue={exports:{}},De={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var gt;function sr(){if(gt)return De;gt=1;var e=E,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(l,c,v){var u,m={},w=null,k=null;v!==void 0&&(w=""+v),c.key!==void 0&&(w=""+c.key),c.ref!==void 0&&(k=c.ref);for(u in c)n.call(c,u)&&!s.hasOwnProperty(u)&&(m[u]=c[u]);if(l&&l.defaultProps)for(u in c=l.defaultProps,c)m[u]===void 0&&(m[u]=c[u]);return{$$typeof:t,type:l,key:w,ref:k,props:m,_owner:i.current}}return De.Fragment=r,De.jsx=a,De.jsxs=a,De}var $e={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var bt;function ar(){return bt||(bt=1,process.env.NODE_ENV!=="production"&&function(){var e=E,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),$=Symbol.iterator,R="@@iterator";function d(o){if(o===null||typeof o!="object")return null;var f=$&&o[$]||o[R];return typeof f=="function"?f:null}var L=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function N(o){{for(var f=arguments.length,p=new Array(f>1?f-1:0),z=1;z<f;z++)p[z-1]=arguments[z];se("error",o,p)}}function se(o,f,p){{var z=L.ReactDebugCurrentFrame,Y=z.getStackAddendum();Y!==""&&(f+="%s",p=p.concat([Y]));var J=p.map(function(V){return String(V)});J.unshift("Warning: "+f),Function.prototype.apply.call(console[o],console,J)}}var j=!1,O=!1,I=!1,P=!1,M=!1,H;H=Symbol.for("react.module.reference");function T(o){return!!(typeof o=="string"||typeof o=="function"||o===n||o===s||M||o===i||o===v||o===u||P||o===k||j||O||I||typeof o=="object"&&o!==null&&(o.$$typeof===w||o.$$typeof===m||o.$$typeof===a||o.$$typeof===l||o.$$typeof===c||o.$$typeof===H||o.getModuleId!==void 0))}function W(o,f,p){var z=o.displayName;if(z)return z;var Y=f.displayName||f.name||"";return Y!==""?p+"("+Y+")":p}function q(o){return o.displayName||"Context"}function U(o){if(o==null)return null;if(typeof o.tag=="number"&&N("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case n:return"Fragment";case r:return"Portal";case s:return"Profiler";case i:return"StrictMode";case v:return"Suspense";case u:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case l:var f=o;return q(f)+".Consumer";case a:var p=o;return q(p._context)+".Provider";case c:return W(o,o.render,"ForwardRef");case m:var z=o.displayName||null;return z!==null?z:U(o.type)||"Memo";case w:{var Y=o,J=Y._payload,V=Y._init;try{return U(V(J))}catch{return null}}}return null}var te=Object.assign,ue=0,be,Oe,we,he,b,_,x;function g(){}g.__reactDisabledLog=!0;function h(){{if(ue===0){be=console.log,Oe=console.info,we=console.warn,he=console.error,b=console.group,_=console.groupCollapsed,x=console.groupEnd;var o={configurable:!0,enumerable:!0,value:g,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}ue++}}function C(){{if(ue--,ue===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:te({},o,{value:be}),info:te({},o,{value:Oe}),warn:te({},o,{value:we}),error:te({},o,{value:he}),group:te({},o,{value:b}),groupCollapsed:te({},o,{value:_}),groupEnd:te({},o,{value:x})})}ue<0&&N("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var D=L.ReactCurrentDispatcher,S;function A(o,f,p){{if(S===void 0)try{throw Error()}catch(Y){var z=Y.stack.trim().match(/\n( *(at )?)/);S=z&&z[1]||""}return`
|
|
18
|
+
`+S+o}}var B=!1,Z;{var _e=typeof WeakMap=="function"?WeakMap:Map;Z=new _e}function ae(o,f){if(!o||B)return"";{var p=Z.get(o);if(p!==void 0)return p}var z;B=!0;var Y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var J;J=D.current,D.current=null,h();try{if(f){var V=function(){throw Error()};if(Object.defineProperty(V.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(V,[])}catch(fe){z=fe}Reflect.construct(o,[],V)}else{try{V.call()}catch(fe){z=fe}o.call(V.prototype)}}else{try{throw Error()}catch(fe){z=fe}o()}}catch(fe){if(fe&&z&&typeof fe.stack=="string"){for(var F=fe.stack.split(`
|
|
19
|
+
`),ce=z.stack.split(`
|
|
20
|
+
`),ne=F.length-1,ie=ce.length-1;ne>=1&&ie>=0&&F[ne]!==ce[ie];)ie--;for(;ne>=1&&ie>=0;ne--,ie--)if(F[ne]!==ce[ie]){if(ne!==1||ie!==1)do if(ne--,ie--,ie<0||F[ne]!==ce[ie]){var ge=`
|
|
21
|
+
`+F[ne].replace(" at new "," at ");return o.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",o.displayName)),typeof o=="function"&&Z.set(o,ge),ge}while(ne>=1&&ie>=0);break}}}finally{B=!1,D.current=J,C(),Error.prepareStackTrace=Y}var Le=o?o.displayName||o.name:"",je=Le?A(Le):"";return typeof o=="function"&&Z.set(o,je),je}function le(o,f,p){return ae(o,!1)}function y(o){var f=o.prototype;return!!(f&&f.isReactComponent)}function oe(o,f,p){if(o==null)return"";if(typeof o=="function")return ae(o,y(o));if(typeof o=="string")return A(o);switch(o){case v:return A("Suspense");case u:return A("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case c:return le(o.render);case m:return oe(o.type,f,p);case w:{var z=o,Y=z._payload,J=z._init;try{return oe(J(Y),f,p)}catch{}}}return""}var re=Object.prototype.hasOwnProperty,Re={},ve=L.ReactDebugCurrentFrame;function Q(o){if(o){var f=o._owner,p=oe(o.type,o._source,f?f.type:null);ve.setExtraStackFrame(p)}else ve.setExtraStackFrame(null)}function Te(o,f,p,z,Y){{var J=Function.call.bind(re);for(var V in o)if(J(o,V)){var F=void 0;try{if(typeof o[V]!="function"){var ce=Error((z||"React class")+": "+p+" type `"+V+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[V]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ce.name="Invariant Violation",ce}F=o[V](f,V,z,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ne){F=ne}F&&!(F instanceof Error)&&(Q(Y),N("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",z||"React class",p,V,typeof F),Q(null)),F instanceof Error&&!(F.message in Re)&&(Re[F.message]=!0,Q(Y),N("Failed %s type: %s",p,F.message),Q(null))}}}var ze=Array.isArray;function Pe(o){return ze(o)}function We(o){{var f=typeof Symbol=="function"&&Symbol.toStringTag,p=f&&o[Symbol.toStringTag]||o.constructor.name||"Object";return p}}function me(o){try{return Ie(o),!1}catch{return!0}}function Ie(o){return""+o}function Ut(o){if(me(o))return N("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",We(o)),Ie(o)}var Ve=L.ReactCurrentOwner,Cn={key:!0,ref:!0,__self:!0,__source:!0},qt,Jt,ft;ft={};function On(o){if(re.call(o,"ref")){var f=Object.getOwnPropertyDescriptor(o,"ref").get;if(f&&f.isReactWarning)return!1}return o.ref!==void 0}function Rn(o){if(re.call(o,"key")){var f=Object.getOwnPropertyDescriptor(o,"key").get;if(f&&f.isReactWarning)return!1}return o.key!==void 0}function xn(o,f){if(typeof o.ref=="string"&&Ve.current&&f&&Ve.current.stateNode!==f){var p=U(Ve.current.type);ft[p]||(N('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',U(Ve.current.type),o.ref),ft[p]=!0)}}function Tn(o,f){{var p=function(){qt||(qt=!0,N("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};p.isReactWarning=!0,Object.defineProperty(o,"key",{get:p,configurable:!0})}}function Pn(o,f){{var p=function(){Jt||(Jt=!0,N("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};p.isReactWarning=!0,Object.defineProperty(o,"ref",{get:p,configurable:!0})}}var jn=function(o,f,p,z,Y,J,V){var F={$$typeof:t,type:o,key:f,ref:p,props:V,_owner:J};return F._store={},Object.defineProperty(F._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(F,"_self",{configurable:!1,enumerable:!1,writable:!1,value:z}),Object.defineProperty(F,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Y}),Object.freeze&&(Object.freeze(F.props),Object.freeze(F)),F};function Mn(o,f,p,z,Y){{var J,V={},F=null,ce=null;p!==void 0&&(Ut(p),F=""+p),Rn(f)&&(Ut(f.key),F=""+f.key),On(f)&&(ce=f.ref,xn(f,Y));for(J in f)re.call(f,J)&&!Cn.hasOwnProperty(J)&&(V[J]=f[J]);if(o&&o.defaultProps){var ne=o.defaultProps;for(J in ne)V[J]===void 0&&(V[J]=ne[J])}if(F||ce){var ie=typeof o=="function"?o.displayName||o.name||"Unknown":o;F&&Tn(V,ie),ce&&Pn(V,ie)}return jn(o,F,ce,Y,z,Ve.current,V)}}var dt=L.ReactCurrentOwner,Xt=L.ReactDebugCurrentFrame;function ke(o){if(o){var f=o._owner,p=oe(o.type,o._source,f?f.type:null);Xt.setExtraStackFrame(p)}else Xt.setExtraStackFrame(null)}var ht;ht=!1;function pt(o){return typeof o=="object"&&o!==null&&o.$$typeof===t}function Zt(){{if(dt.current){var o=U(dt.current.type);if(o)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+o+"`."}return""}}function An(o){{if(o!==void 0){var f=o.fileName.replace(/^.*[\\\/]/,""),p=o.lineNumber;return`
|
|
24
|
+
|
|
25
|
+
Check your code at `+f+":"+p+"."}return""}}var Qt={};function zn(o){{var f=Zt();if(!f){var p=typeof o=="string"?o:o.displayName||o.name;p&&(f=`
|
|
26
|
+
|
|
27
|
+
Check the top-level render call using <`+p+">.")}return f}}function er(o,f){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var p=zn(f);if(Qt[p])return;Qt[p]=!0;var z="";o&&o._owner&&o._owner!==dt.current&&(z=" It was passed a child from "+U(o._owner.type)+"."),ke(o),N('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,z),ke(null)}}function tr(o,f){{if(typeof o!="object")return;if(Pe(o))for(var p=0;p<o.length;p++){var z=o[p];pt(z)&&er(z,f)}else if(pt(o))o._store&&(o._store.validated=!0);else if(o){var Y=d(o);if(typeof Y=="function"&&Y!==o.entries)for(var J=Y.call(o),V;!(V=J.next()).done;)pt(V.value)&&er(V.value,f)}}}function In(o){{var f=o.type;if(f==null||typeof f=="string")return;var p;if(typeof f=="function")p=f.propTypes;else if(typeof f=="object"&&(f.$$typeof===c||f.$$typeof===m))p=f.propTypes;else return;if(p){var z=U(f);Te(p,o.props,"prop",z,o)}else if(f.PropTypes!==void 0&&!ht){ht=!0;var Y=U(f);N("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Y||"Unknown")}typeof f.getDefaultProps=="function"&&!f.getDefaultProps.isReactClassApproved&&N("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function kn(o){{for(var f=Object.keys(o.props),p=0;p<f.length;p++){var z=f[p];if(z!=="children"&&z!=="key"){ke(o),N("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",z),ke(null);break}}o.ref!==null&&(ke(o),N("Invalid attribute `ref` supplied to `React.Fragment`."),ke(null))}}var rr={};function nr(o,f,p,z,Y,J){{var V=T(o);if(!V){var F="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(F+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ce=An(Y);ce?F+=ce:F+=Zt();var ne;o===null?ne="null":Pe(o)?ne="array":o!==void 0&&o.$$typeof===t?(ne="<"+(U(o.type)||"Unknown")+" />",F=" Did you accidentally export a JSX literal instead of a component?"):ne=typeof o,N("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ne,F)}var ie=Mn(o,f,p,Y,J);if(ie==null)return ie;if(V){var ge=f.children;if(ge!==void 0)if(z)if(Pe(ge)){for(var Le=0;Le<ge.length;Le++)tr(ge[Le],o);Object.freeze&&Object.freeze(ge)}else N("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else tr(ge,o)}if(re.call(f,"key")){var je=U(o),fe=Object.keys(f).filter(function(Wn){return Wn!=="key"}),vt=fe.length>0?"{key: someKey, "+fe.join(": ..., ")+": ...}":"{key: someKey}";if(!rr[je+vt]){var Fn=fe.length>0?"{"+fe.join(": ..., ")+": ...}":"{}";N(`A props object containing a "key" prop is being spread into JSX:
|
|
28
|
+
let props = %s;
|
|
29
|
+
<%s {...props} />
|
|
30
|
+
React keys must be passed directly to JSX without using spread:
|
|
31
|
+
let props = %s;
|
|
32
|
+
<%s key={someKey} {...props} />`,vt,je,Fn,je),rr[je+vt]=!0}}return o===n?kn(ie):In(ie),ie}}function Ln(o,f,p){return nr(o,f,p,!0)}function Dn(o,f,p){return nr(o,f,p,!1)}var $n=Dn,Nn=Ln;$e.Fragment=n,$e.jsx=$n,$e.jsxs=Nn}()),$e}process.env.NODE_ENV==="production"?Ue.exports=sr():Ue.exports=ar();var X=Ue.exports;function qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qe.apply(null,arguments)}function Ee(e){"@babel/helpers - typeof";return Ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ee(e)}var lr=Symbol.for("react.element"),cr=Symbol.for("react.transitional.element"),ur=Symbol.for("react.fragment");function yt(e){return e&&Ee(e)==="object"&&(e.$$typeof===lr||e.$$typeof===cr)&&e.type===ur}function Je(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=[];return E.Children.forEach(e,function(n){n==null&&!t.keepEmpty||(Array.isArray(n)?r=r.concat(Je(n)):yt(n)&&n.props?r=r.concat(Je(n.props.children,t)):r.push(n))}),r}var fr=[];function Et(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0){var r=fr.reduce(function(n,i){return i(n??"","warning")},t);r&&console.error("Warning: ".concat(r))}}function dr(e,t){if(Ee(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ee(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wt(e){var t=dr(e,"string");return Ee(t)=="symbol"?t:t+""}function hr(e,t,r){return(t=wt(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function St(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_t(Object(r),!0).forEach(function(n){hr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ct(e){return e instanceof HTMLElement||e instanceof SVGElement}function pr(e){return e&&Ee(e)==="object"&&Ct(e.nativeElement)?e.nativeElement:Ct(e)?e:null}function Xe(e){var t=pr(e);if(t)return t;if(e instanceof E.Component){var r;return(r=mt.findDOMNode)===null||r===void 0?void 0:r.call(mt,e)}return null}var Ze={exports:{}},K={};/**
|
|
33
|
+
* @license React
|
|
34
|
+
* react-is.production.min.js
|
|
35
|
+
*
|
|
36
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the MIT license found in the
|
|
39
|
+
* LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/var Ot;function vr(){if(Ot)return K;Ot=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),$;$=Symbol.for("react.module.reference");function R(d){if(typeof d=="object"&&d!==null){var L=d.$$typeof;switch(L){case e:switch(d=d.type,d){case r:case i:case n:case v:case u:return d;default:switch(d=d&&d.$$typeof,d){case l:case a:case c:case w:case m:case s:return d;default:return L}}case t:return L}}}return K.ContextConsumer=a,K.ContextProvider=s,K.Element=e,K.ForwardRef=c,K.Fragment=r,K.Lazy=w,K.Memo=m,K.Portal=t,K.Profiler=i,K.StrictMode=n,K.Suspense=v,K.SuspenseList=u,K.isAsyncMode=function(){return!1},K.isConcurrentMode=function(){return!1},K.isContextConsumer=function(d){return R(d)===a},K.isContextProvider=function(d){return R(d)===s},K.isElement=function(d){return typeof d=="object"&&d!==null&&d.$$typeof===e},K.isForwardRef=function(d){return R(d)===c},K.isFragment=function(d){return R(d)===r},K.isLazy=function(d){return R(d)===w},K.isMemo=function(d){return R(d)===m},K.isPortal=function(d){return R(d)===t},K.isProfiler=function(d){return R(d)===i},K.isStrictMode=function(d){return R(d)===n},K.isSuspense=function(d){return R(d)===v},K.isSuspenseList=function(d){return R(d)===u},K.isValidElementType=function(d){return typeof d=="string"||typeof d=="function"||d===r||d===i||d===n||d===v||d===u||d===k||typeof d=="object"&&d!==null&&(d.$$typeof===w||d.$$typeof===m||d.$$typeof===s||d.$$typeof===a||d.$$typeof===c||d.$$typeof===$||d.getModuleId!==void 0)},K.typeOf=R,K}var G={};/**
|
|
41
|
+
* @license React
|
|
42
|
+
* react-is.development.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/var Rt;function mr(){return Rt||(Rt=1,process.env.NODE_ENV!=="production"&&function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),$=!1,R=!1,d=!1,L=!1,N=!1,se;se=Symbol.for("react.module.reference");function j(y){return!!(typeof y=="string"||typeof y=="function"||y===r||y===i||N||y===n||y===v||y===u||L||y===k||$||R||d||typeof y=="object"&&y!==null&&(y.$$typeof===w||y.$$typeof===m||y.$$typeof===s||y.$$typeof===a||y.$$typeof===c||y.$$typeof===se||y.getModuleId!==void 0))}function O(y){if(typeof y=="object"&&y!==null){var oe=y.$$typeof;switch(oe){case e:var re=y.type;switch(re){case r:case i:case n:case v:case u:return re;default:var Re=re&&re.$$typeof;switch(Re){case l:case a:case c:case w:case m:case s:return Re;default:return oe}}case t:return oe}}}var I=a,P=s,M=e,H=c,T=r,W=w,q=m,U=t,te=i,ue=n,be=v,Oe=u,we=!1,he=!1;function b(y){return we||(we=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function _(y){return he||(he=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function x(y){return O(y)===a}function g(y){return O(y)===s}function h(y){return typeof y=="object"&&y!==null&&y.$$typeof===e}function C(y){return O(y)===c}function D(y){return O(y)===r}function S(y){return O(y)===w}function A(y){return O(y)===m}function B(y){return O(y)===t}function Z(y){return O(y)===i}function _e(y){return O(y)===n}function ae(y){return O(y)===v}function le(y){return O(y)===u}G.ContextConsumer=I,G.ContextProvider=P,G.Element=M,G.ForwardRef=H,G.Fragment=T,G.Lazy=W,G.Memo=q,G.Portal=U,G.Profiler=te,G.StrictMode=ue,G.Suspense=be,G.SuspenseList=Oe,G.isAsyncMode=b,G.isConcurrentMode=_,G.isContextConsumer=x,G.isContextProvider=g,G.isElement=h,G.isForwardRef=C,G.isFragment=D,G.isLazy=S,G.isMemo=A,G.isPortal=B,G.isProfiler=Z,G.isStrictMode=_e,G.isSuspense=ae,G.isSuspenseList=le,G.isValidElementType=j,G.typeOf=O}()),G}process.env.NODE_ENV==="production"?Ze.exports=vr():Ze.exports=mr();var Qe=Ze.exports;function gr(e,t,r){var n=ee.useRef({});return(!("value"in n.current)||r(n.current.condition,t))&&(n.current.value=e(),n.current.condition=t),n.current.value}var br=Number(E.version.split(".")[0]),yr=function(t,r){typeof t=="function"?t(r):Ee(t)==="object"&&t&&"current"in t&&(t.current=r)},Er=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r.filter(Boolean);return i.length<=1?i[0]:function(s){r.forEach(function(a){yr(a,s)})}},wr=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return gr(function(){return Er.apply(void 0,r)},r,function(i,s){return i.length!==s.length||i.every(function(a,l){return a!==s[l]})})},_r=function(t){var r,n;if(!t)return!1;if(xt(t)&&br>=19)return!0;var i=Qe.isMemo(t)?t.type.type:t.type;return!(typeof i=="function"&&!((r=i.prototype)!==null&&r!==void 0&&r.render)&&i.$$typeof!==Qe.ForwardRef||typeof t=="function"&&!((n=t.prototype)!==null&&n!==void 0&&n.render)&&t.$$typeof!==Qe.ForwardRef)};function xt(e){return E.isValidElement(e)&&!yt(e)}var Sr=function(t){if(t&&xt(t)){var r=t;return r.props.propertyIsEnumerable("ref")?r.props.ref:r.ref}return null},et=ee.createContext(null);function Cr(e){var t=e.children,r=e.onBatchResize,n=ee.useRef(0),i=ee.useRef([]),s=ee.useContext(et),a=ee.useCallback(function(l,c,v){n.current+=1;var u=n.current;i.current.push({size:l,element:c,data:v}),Promise.resolve().then(function(){u===n.current&&(r==null||r(i.current),i.current=[])}),s==null||s(l,c,v)},[r,s]);return ee.createElement(et.Provider,{value:a},t)}var Tt=function(){if(typeof Map<"u")return Map;function e(t,r){var n=-1;return t.some(function(i,s){return i[0]===r?(n=s,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(r,n){var i=e(this.__entries__,r);~i?this.__entries__[i][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,i=e(n,r);~i&&n.splice(i,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var i=0,s=this.__entries__;i<s.length;i++){var a=s[i];r.call(n,a[1],a[0])}},t}()}(),tt=typeof window<"u"&&typeof document<"u"&&window.document===document,He=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Or=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(He):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Rr=2;function xr(e,t){var r=!1,n=!1,i=0;function s(){r&&(r=!1,e()),n&&l()}function a(){Or(s)}function l(){var c=Date.now();if(r){if(c-i<Rr)return;n=!0}else r=!0,n=!1,setTimeout(a,t);i=c}return l}var Tr=20,Pr=["top","right","bottom","left","width","height","size","weight"],jr=typeof MutationObserver<"u",Mr=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=xr(this.refresh.bind(this),Tr)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var r=this.observers_,n=r.indexOf(t);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return t.forEach(function(r){return r.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!tt||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),jr?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!tt||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,i=Pr.some(function(s){return!!~n.indexOf(s)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Pt=function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},Me=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||He},jt=Ye(0,0,0,0);function Be(e){return parseFloat(e)||0}function Mt(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce(function(n,i){var s=e["border-"+i+"-width"];return n+Be(s)},0)}function Ar(e){for(var t=["top","right","bottom","left"],r={},n=0,i=t;n<i.length;n++){var s=i[n],a=e["padding-"+s];r[s]=Be(a)}return r}function zr(e){var t=e.getBBox();return Ye(0,0,t.width,t.height)}function Ir(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return jt;var n=Me(e).getComputedStyle(e),i=Ar(n),s=i.left+i.right,a=i.top+i.bottom,l=Be(n.width),c=Be(n.height);if(n.boxSizing==="border-box"&&(Math.round(l+s)!==t&&(l-=Mt(n,"left","right")+s),Math.round(c+a)!==r&&(c-=Mt(n,"top","bottom")+a)),!Lr(e)){var v=Math.round(l+s)-t,u=Math.round(c+a)-r;Math.abs(v)!==1&&(l-=v),Math.abs(u)!==1&&(c-=u)}return Ye(i.left,i.top,l,c)}var kr=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Me(e).SVGGraphicsElement}:function(e){return e instanceof Me(e).SVGElement&&typeof e.getBBox=="function"}}();function Lr(e){return e===Me(e).document.documentElement}function Dr(e){return tt?kr(e)?zr(e):Ir(e):jt}function $r(e){var t=e.x,r=e.y,n=e.width,i=e.height,s=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(s.prototype);return Pt(a,{x:t,y:r,width:n,height:i,top:r,right:t+n,bottom:i+r,left:t}),a}function Ye(e,t,r,n){return{x:e,y:t,width:r,height:n}}var Nr=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ye(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=Dr(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),Fr=function(){function e(t,r){var n=$r(r);Pt(this,{target:t,contentRect:n})}return e}(),Wr=function(){function e(t,r,n){if(this.activeObservations_=[],this.observations_=new Tt,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=r,this.callbackCtx_=n}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Me(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)||(r.set(t,new Nr(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Me(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)&&(r.delete(t),r.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&t.activeObservations_.push(r)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new Fr(n.target,n.broadcastRect())});this.callback_.call(t,r,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),At=typeof WeakMap<"u"?new WeakMap:new Tt,zt=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=Mr.getInstance(),n=new Wr(t,r,this);At.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){zt.prototype[e]=function(){var t;return(t=At.get(this))[e].apply(t,arguments)}});var Vr=function(){return typeof He.ResizeObserver<"u"?He.ResizeObserver:zt}(),Se=new Map;function It(e){e.forEach(function(t){var r,n=t.target;(r=Se.get(n))===null||r===void 0||r.forEach(function(i){return i(n)})})}var kt=new Vr(It);process.env.NODE_ENV,process.env.NODE_ENV;function Hr(e,t){Se.has(e)||(Se.set(e,new Set),kt.observe(e)),Se.get(e).add(t)}function Br(e,t){Se.has(e)&&(Se.get(e).delete(t),Se.get(e).size||(kt.unobserve(e),Se.delete(e)))}function Yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wt(n.key),n)}}function Kr(e,t,r){return t&&Lt(e.prototype,t),r&&Lt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function rt(e,t){return rt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},rt(e,t)}function Gr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rt(e,t)}function Ke(e){return Ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ke(e)}function Dt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Dt=function(){return!!e})()}function Ur(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qr(e,t){if(t&&(Ee(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ur(e)}function Jr(e){var t=Dt();return function(){var r,n=Ke(e);if(t){var i=Ke(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return qr(this,r)}}var Xr=function(e){Gr(r,e);var t=Jr(r);function r(){return Yr(this,r),t.apply(this,arguments)}return Kr(r,[{key:"render",value:function(){return this.props.children}}]),r}(ee.Component);function Zr(e,t){var r=e.children,n=e.disabled,i=ee.useRef(null),s=ee.useRef(null),a=ee.useContext(et),l=typeof r=="function",c=l?r(i):r,v=ee.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!l&&ee.isValidElement(c)&&_r(c),m=u?Sr(c):null,w=wr(m,i),k=function(){var L;return Xe(i.current)||(i.current&&Ee(i.current)==="object"?Xe((L=i.current)===null||L===void 0?void 0:L.nativeElement):null)||Xe(s.current)};ee.useImperativeHandle(t,function(){return k()});var $=ee.useRef(e);$.current=e;var R=ee.useCallback(function(d){var L=$.current,N=L.onResize,se=L.data,j=d.getBoundingClientRect(),O=j.width,I=j.height,P=d.offsetWidth,M=d.offsetHeight,H=Math.floor(O),T=Math.floor(I);if(v.current.width!==H||v.current.height!==T||v.current.offsetWidth!==P||v.current.offsetHeight!==M){var W={width:H,height:T,offsetWidth:P,offsetHeight:M};v.current=W;var q=P===Math.round(O)?O:P,U=M===Math.round(I)?I:M,te=St(St({},W),{},{offsetWidth:q,offsetHeight:U});a==null||a(te,d,se),N&&Promise.resolve().then(function(){N(te,d)})}},[]);return ee.useEffect(function(){var d=k();return d&&!n&&Hr(d,R),function(){return Br(d,R)}},[i.current,n]),ee.createElement(Xr,{ref:s},u?ee.cloneElement(c,{ref:w}):c)}var $t=ee.forwardRef(Zr);process.env.NODE_ENV!=="production"&&($t.displayName="SingleObserver");var Qr="rc-observer-key";function en(e,t){var r=e.children,n=typeof r=="function"?[r]:Je(r);return process.env.NODE_ENV!=="production"&&(n.length>1?Et(!1,"Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead."):n.length===0&&Et(!1,"`children` of ResizeObserver is empty. Nothing is in observe.")),n.map(function(i,s){var a=(i==null?void 0:i.key)||"".concat(Qr,"-").concat(s);return ee.createElement($t,qe({},e,{key:a,ref:s===0?t:void 0}),i)})}var nt=ee.forwardRef(en);process.env.NODE_ENV!=="production"&&(nt.displayName="ResizeObserver"),nt.Collection=Cr;var Nt={exports:{}};/*!
|
|
49
|
+
Copyright (c) 2018 Jed Watson.
|
|
50
|
+
Licensed under the MIT License (MIT), see
|
|
51
|
+
http://jedwatson.github.io/classnames
|
|
52
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var s="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(s=i(s,n(l)))}return s}function n(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return r.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var l in s)t.call(s,l)&&s[l]&&(a=i(a,l));return a}function i(s,a){return a?s?s+" "+a:s+a:s}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Nt);var tn=Nt.exports;const ot=ir(tn),Vn="",rn=E.forwardRef(({columns:e,width:t,onScroll:r},n)=>{const i=E.useMemo(()=>{const s=[],a=v=>{let u=0;return v.forEach(m=>{if(m.children&&m.children.length>0){const w=a(m.children);w>u&&(u=w)}}),u+1},l=a(e),c=(v,u)=>{s[u]||(s[u]=[]),v.forEach(m=>{var k;const w={key:m.field||m.dataIndex||m.title||String(Math.random()),title:m.title,width:m.width,align:((k=m.style)==null?void 0:k.textAlign)||"center",className:void 0,colSpan:1,rowSpan:1};if(m.children&&m.children.length>0){const $=R=>R.children&&R.children.length>0?R.children.reduce((d,L)=>d+$(L),0):1;w.colSpan=$(m),s[u].push(w),c(m.children,u+1)}else w.rowSpan=l-u,s[u].push(w)})};return c(e,0),s},[e]);return X.jsx("div",{ref:n,className:"virtual-table-header hide-scrollbar",style:{overflow:"auto",width:t},onScroll:r,children:X.jsxs("table",{style:{tableLayout:"fixed",width:"100%"},children:[X.jsx("colgroup",{children:e.map((s,a)=>{const l=c=>c.children&&c.children.length>0?c.children.flatMap(l):[c.width];return l(s).map((c,v)=>X.jsx("col",{style:{width:c,minWidth:c}},`${a}-${v}`))}).flat()}),X.jsx("thead",{className:"virtual-table-thead",children:i.map((s,a)=>X.jsx("tr",{className:"virtual-table-row",children:s.map((l,c)=>X.jsx("th",{className:ot("virtual-table-cell",l.className),colSpan:l.colSpan,rowSpan:l.rowSpan,title:l.title,style:{textAlign:l.align},children:l.title},c))},a))})]})})}),it=e=>{if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(r=>it(r));const t={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=it(e[r]));return t},Ft=43,nn=100,Ce="-",Wt="合计";function on(e){let t=e;for(;t;){if(t.dir)return t.dir==="rtl";t=t.parentElement}return!1}function sn(e,t){const[r,n]=E.useState(t==="rtl");return E.useLayoutEffect(()=>{e&&(t||n(on(e)))},[t,e]),r}const Ge=typeof window<"u"?E.useLayoutEffect:E.useEffect;function Vt(e){if(e!==void 0)switch(typeof e){case"number":return e;case"string":{if(e.endsWith("px"))return parseFloat(e);break}}}function an({box:e,defaultHeight:t,defaultWidth:r,disabled:n,element:i,mode:s,style:a}){const{styleHeight:l,styleWidth:c}=E.useMemo(()=>({styleHeight:Vt(a==null?void 0:a.height),styleWidth:Vt(a==null?void 0:a.width)}),[a==null?void 0:a.height,a==null?void 0:a.width]),[v,u]=E.useState({height:t,width:r}),m=n||s==="only-height"&&l!==void 0||s==="only-width"&&c!==void 0||l!==void 0&&c!==void 0;return Ge(()=>{if(i===null||m)return;const w=new ResizeObserver(k=>{for(const $ of k){const{contentRect:R,target:d}=$;i===d&&u(L=>L.height===R.height&&L.width===R.width?L:{height:R.height,width:R.width})}});return w.observe(i,{box:e}),()=>{w==null||w.unobserve(i)}},[e,m,i,l,c]),E.useMemo(()=>({height:l??v.height,width:c??v.width}),[v,l,c])}function ln(e){const t=E.useRef(()=>{throw new Error("Cannot call during render.")});return Ge(()=>{t.current=e},[e]),E.useCallback(r=>{var n;return(n=t.current)==null?void 0:n.call(t,r)},[t])}let Ae=null;function cn(e=!1){if(Ae===null||e){const t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";const n=document.createElement("div"),i=n.style;return i.width="100px",i.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?Ae="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Ae="negative":Ae="positive-ascending"),document.body.removeChild(t),Ae}return Ae}function st({containerElement:e,direction:t,isRtl:r,scrollOffset:n}){if(t==="horizontal"&&r)switch(cn()){case"negative":return-n;case"positive-descending":{if(e){const{clientWidth:i,scrollLeft:s,scrollWidth:a}=e;return a-i-s}break}}return n}function xe(e,t="Assertion error"){if(!e)throw console.error(t),Error(t)}function Ne(e,t){if(e===t)return!0;if(!!e!=!!t||(xe(e!==void 0),xe(t!==void 0),Object.keys(e).length!==Object.keys(t).length))return!1;for(const r in e)if(!Object.is(t[r],e[r]))return!1;return!0}function Ht({cachedBounds:e,itemCount:t,itemSize:r}){if(t===0)return 0;if(typeof r=="number")return t*r;{const n=e.get(e.size===0?0:e.size-1);xe(n!==void 0,"Unexpected bounds cache miss");const i=(n.scrollOffset+n.size)/e.size;return t*i}}function un({align:e,cachedBounds:t,index:r,itemCount:n,itemSize:i,containerScrollOffset:s,containerSize:a}){if(r<0||r>=n)throw RangeError(`Invalid index specified: ${r}`,{cause:`Index ${r} is not within the range of 0 - ${n-1}`});const l=Ht({cachedBounds:t,itemCount:n,itemSize:i}),c=t.get(r),v=Math.max(0,Math.min(l-a,c.scrollOffset)),u=Math.max(0,c.scrollOffset-a+c.size);switch(e==="smart"&&(s>=u&&s<=v?e="auto":e="center"),e){case"start":return v;case"end":return u;case"center":return c.scrollOffset<=a/2?0:c.scrollOffset+c.size/2>=l-a/2?l-a:c.scrollOffset+c.size/2-a/2;case"auto":default:return s>=u&&s<=v?s:s<u?u:v}}function at({cachedBounds:e,containerScrollOffset:t,containerSize:r,itemCount:n,overscanCount:i}){const s=n-1;let a=0,l=-1,c=0,v=-1,u=0;for(;u<s;){const m=e.get(u);if(m.scrollOffset+m.size>t)break;u++}for(a=u,c=Math.max(0,a-i);u<s;){const m=e.get(u);if(m.scrollOffset+m.size>=t+r)break;u++}return l=Math.min(s,u),v=Math.min(n-1,l+i),a<0&&(a=0,l=-1,c=0,v=-1),{startIndexVisible:a,stopIndexVisible:l,startIndexOverscan:c,stopIndexOverscan:v}}function fn({itemCount:e,itemProps:t,itemSize:r}){const n=new Map;return{get(i){for(xe(i<e,`Invalid index ${i}`);n.size-1<i;){const a=n.size;let l;switch(typeof r){case"function":{l=r(a,t);break}case"number":{l=r;break}}if(a===0)n.set(a,{size:l,scrollOffset:0});else{const c=n.get(a-1);xe(c!==void 0,`Unexpected bounds cache miss for index ${i}`),n.set(a,{scrollOffset:c.scrollOffset+c.size,size:l})}}const s=n.get(i);return xe(s!==void 0,`Unexpected bounds cache miss for index ${i}`),s},set(i,s){n.set(i,s)},get size(){return n.size}}}function dn({itemCount:e,itemProps:t,itemSize:r}){return E.useMemo(()=>fn({itemCount:e,itemProps:t,itemSize:r}),[e,t,r])}function hn({containerSize:e,itemSize:t}){let r;switch(typeof t){case"string":{xe(t.endsWith("%"),`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`),xe(e!==void 0,"Container size must be defined if a percentage item size is specified"),r=e*parseInt(t)/100;break}default:{r=t;break}}return r}function Bt({containerElement:e,containerStyle:t,defaultContainerSize:r=0,direction:n,isRtl:i=!1,itemCount:s,itemProps:a,itemSize:l,onResize:c,overscanCount:v}){const{height:u=r,width:m=r}=an({defaultHeight:n==="vertical"?r:void 0,defaultWidth:n==="horizontal"?r:void 0,element:e,mode:n==="vertical"?"only-height":"only-width",style:t}),w=E.useRef({height:0,width:0}),k=n==="vertical"?u:m,$=hn({containerSize:k,itemSize:l});E.useLayoutEffect(()=>{if(typeof c=="function"){const T=w.current;(T.height!==u||T.width!==m)&&(c({height:u,width:m},{...T}),T.height=u,T.width=m)}},[u,c,m]);const R=dn({itemCount:s,itemProps:a,itemSize:$}),d=E.useCallback(T=>R.get(T),[R]),[L,N]=E.useState(()=>at({cachedBounds:R,containerScrollOffset:0,containerSize:k,itemCount:s,overscanCount:v})),{startIndexVisible:se,startIndexOverscan:j,stopIndexVisible:O,stopIndexOverscan:I}={startIndexVisible:Math.min(s-1,L.startIndexVisible),startIndexOverscan:Math.min(s-1,L.startIndexOverscan),stopIndexVisible:Math.min(s-1,L.stopIndexVisible),stopIndexOverscan:Math.min(s-1,L.stopIndexOverscan)},P=E.useCallback(()=>Ht({cachedBounds:R,itemCount:s,itemSize:$}),[R,s,$]),M=E.useCallback(T=>{const W=st({containerElement:e,direction:n,isRtl:i,scrollOffset:T});return at({cachedBounds:R,containerScrollOffset:W,containerSize:k,itemCount:s,overscanCount:v})},[R,e,k,n,i,s,v]);Ge(()=>{const T=(n==="vertical"?e==null?void 0:e.scrollTop:e==null?void 0:e.scrollLeft)??0;N(M(T))},[e,n,M]),Ge(()=>{if(!e)return;const T=()=>{N(W=>{const{scrollLeft:q,scrollTop:U}=e,te=st({containerElement:e,direction:n,isRtl:i,scrollOffset:n==="vertical"?U:q}),ue=at({cachedBounds:R,containerScrollOffset:te,containerSize:k,itemCount:s,overscanCount:v});return Ne(ue,W)?W:ue})};return e.addEventListener("scroll",T),()=>{e.removeEventListener("scroll",T)}},[R,e,k,n,s,v]);const H=ln(({align:T="auto",containerScrollOffset:W,index:q})=>{let U=un({align:T,cachedBounds:R,containerScrollOffset:W,containerSize:k,index:q,itemCount:s,itemSize:$});if(e){if(U=st({containerElement:e,direction:n,isRtl:i,scrollOffset:U}),typeof e.scrollTo!="function"){const te=M(U);Ne(L,te)||N(te)}return U}});return{getCellBounds:d,getEstimatedSize:P,scrollToIndex:H,startIndexOverscan:j,startIndexVisible:se,stopIndexOverscan:I,stopIndexVisible:O}}function pn(e){return E.useMemo(()=>e,Object.values(e))}function vn(e,t){const{ariaAttributes:r,style:n,...i}=e,{ariaAttributes:s,style:a,...l}=t;return Ne(r,s)&&Ne(n,a)&&Ne(i,l)}function mn({cellComponent:e,cellProps:t,children:r,className:n,columnCount:i,columnWidth:s,defaultHeight:a=0,defaultWidth:l=0,dir:c,gridRef:v,onCellsRendered:u,onResize:m,overscanCount:w=3,rowCount:k,rowHeight:$,style:R,tagName:d="div",...L}){const N=pn(t),se=E.useMemo(()=>E.memo(e,vn),[e]),[j,O]=E.useState(null),I=sn(j,c),{getCellBounds:P,getEstimatedSize:M,startIndexOverscan:H,startIndexVisible:T,scrollToIndex:W,stopIndexOverscan:q,stopIndexVisible:U}=Bt({containerElement:j,containerStyle:R,defaultContainerSize:l,direction:"horizontal",isRtl:I,itemCount:i,itemProps:N,itemSize:s,onResize:m,overscanCount:w}),{getCellBounds:te,getEstimatedSize:ue,startIndexOverscan:be,startIndexVisible:Oe,scrollToIndex:we,stopIndexOverscan:he,stopIndexVisible:b}=Bt({containerElement:j,containerStyle:R,defaultContainerSize:a,direction:"vertical",itemCount:k,itemProps:N,itemSize:$,onResize:m,overscanCount:w});E.useImperativeHandle(v,()=>({get element(){return j},scrollToCell({behavior:g="auto",columnAlign:h="auto",columnIndex:C,rowAlign:D="auto",rowIndex:S}){const A=W({align:h,containerScrollOffset:(j==null?void 0:j.scrollLeft)??0,index:C}),B=we({align:D,containerScrollOffset:(j==null?void 0:j.scrollTop)??0,index:S});typeof(j==null?void 0:j.scrollTo)=="function"&&j.scrollTo({behavior:g,left:A,top:B})},scrollToColumn({align:g="auto",behavior:h="auto",index:C}){const D=W({align:g,containerScrollOffset:(j==null?void 0:j.scrollLeft)??0,index:C});typeof(j==null?void 0:j.scrollTo)=="function"&&j.scrollTo({behavior:h,left:D})},scrollToRow({align:g="auto",behavior:h="auto",index:C}){const D=we({align:g,containerScrollOffset:(j==null?void 0:j.scrollTop)??0,index:C});typeof(j==null?void 0:j.scrollTo)=="function"&&j.scrollTo({behavior:h,top:D})}}),[j,W,we]),E.useEffect(()=>{H>=0&&q>=0&&be>=0&&he>=0&&u&&u({columnStartIndex:T,columnStopIndex:U,rowStartIndex:Oe,rowStopIndex:b},{columnStartIndex:H,columnStopIndex:q,rowStartIndex:be,rowStopIndex:he})},[u,H,T,q,U,be,Oe,he,b]);const _=E.useMemo(()=>{const g=[];if(i>0&&k>0)for(let h=be;h<=he;h++){const C=te(h),D=[];for(let S=H;S<=q;S++){const A=P(S);D.push(E.createElement(se,{...N,ariaAttributes:{"aria-colindex":S+1,role:"gridcell"},columnIndex:S,key:S,rowIndex:h,style:{position:"absolute",left:I?void 0:0,right:I?0:void 0,transform:`translate(${I?-A.scrollOffset:A.scrollOffset}px, ${C.scrollOffset}px)`,height:C.size,width:A.size}}))}g.push(X.jsx("div",{role:"row","aria-rowindex":h+1,children:D},h))}return g},[se,N,i,H,q,P,te,I,k,be,he]),x=X.jsx("div",{"aria-hidden":!0,style:{height:ue(),width:M(),zIndex:-1}});return E.createElement(d,{"aria-colcount":i,"aria-rowcount":k,role:"grid",...L,className:n,dir:c,ref:O,style:{position:"relative",maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...R}},_,r,x)}const gn=e=>X.jsxs("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",...e,children:[X.jsx("path",{d:"M518.5 360.3a7.95 7.95 0 00-12.9 0l-178 246c-3.8 5.3 0 12.7 6.5 12.7H381c10.2 0 19.9-4.9 25.9-13.2L512 460.4l105.2 145.4c6 8.3 15.6 13.2 25.9 13.2H690c6.5 0 10.3-7.4 6.5-12.7l-178-246z"}),X.jsx("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"})]}),bn=e=>X.jsxs("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",...e,children:[X.jsx("path",{d:"M690 405h-46.9c-10.2 0-19.9 4.9-25.9 13.2L512 563.6 406.8 418.2c-6-8.3-15.6-13.2-25.9-13.2H334c-6.5 0-10.3 7.4-6.5 12.7l178 246c3.2 4.4 9.7 4.4 12.9 0l178-246c3.9-5.3.1-12.7-6.4-12.7z"}),X.jsx("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"})]}),yn=(e,t,r)=>{var i;const n=(i=r[e])==null?void 0:i[t];return!n||n.rowspan===0||n.colspan===0},En=(e,t,r,n,i)=>{var c,v,u;const s=(c=n[e])==null?void 0:c[t];if(!s||s.rowspan===0||s.colspan===0)return;const a={...r},l=i[t];if(s.colspan>1){let m=0;for(let w=t;w<t+s.colspan;w++)m+=Number((v=i[w])==null?void 0:v.width)||100;a.width=m}return s.rowspan>1&&(a.height=s.rowspan*Ft),(u=l==null?void 0:l.style)!=null&&u.textAlign&&(a.textAlign=l.style.textAlign,l.style.textAlign==="right"&&(a.justifyContent="flex-end"),l.style.textAlign==="center"&&(a.justifyContent="center")),a.border="1px solid #f0f0f0",a.padding="8px 16px",a.display="flex",a.alignItems="center",a.backgroundColor="#fff",a},wn=({columnIndex:e,rowIndex:t,style:r,mergedData:n,columns:i,handleExpand:s,meta:a})=>{if(yn(t,e,n))return null;const l=n[t][e],c=En(t,e,r,n,i),v=i[e],u=a==null?void 0:a.find(k=>k.field===v.field),m=E.isValidElement(l.content);let w;if(w=l.content,u!=null&&u.clickHandler&&!m&&w!==null&&w!==void 0){const k=l.data;w=X.jsx("a",{href:"javascript:void(0)",onClick:$=>{$.preventDefault(),$.stopPropagation(),u.clickHandler(k)},style:{cursor:"pointer",textDecoration:"underline",color:"#1890ff"},children:w})}return X.jsxs("div",{style:c,className:ot("table-cell","virtual-table-cell",{"virtual-table-cell-last":e===i.length-1}),title:typeof w=="string"?w:void 0,children:[X.jsx("span",{className:"expand-icon",children:l.expandable?l.expanded?X.jsx(bn,{onClick:()=>{console.log("DownCircleOutlined onClick",l),l.onClick&&l.onClick(l),s(l)}}):X.jsx(gn,{onClick:()=>{console.log("UpCircleOutlined onClick",l),l.onClick&&l.onClick(l),s(l)}}):null}),w]})},_n=e=>{const{data:t,info:r,scroll:n,columns:i,tableWidth:s}=e,{ref:a,onScroll:l}=r,c=E.useRef(),v=E.useMemo(()=>{const O={};return Object.defineProperty(O,"scrollLeft",{get:()=>{var I,P;return((P=(I=c.current)==null?void 0:I.element)==null?void 0:P.scrollLeft)||0},set:I=>{var P;(P=c.current)!=null&&P.element&&(c.current.element.scrollLeft=I)}}),Object.defineProperty(O,"scrollTop",{get:()=>{var I,P;return((P=(I=c.current)==null?void 0:I.element)==null?void 0:P.scrollTop)||0},set:I=>{var P;(P=c.current)!=null&&P.element&&(c.current.element.scrollTop=I)}}),O},[]);E.useEffect(()=>{a&&(a.current=v)},[a,v]);const u=t,m=u.length,w=E.useCallback(O=>{let I=0;return O.forEach(P=>{P!=null&&P.children&&P.children.length>0?I+=w(P.children):I+=1}),I},[]),k=w(i),$=E.useCallback(O=>{let I=[];return O.forEach(P=>{P!=null&&P.children&&P.children.length>0?I=[...I,...$(P.children)]:I.push(P)}),I},[]),R=$(i),d=E.useCallback(O=>{const I=R[O];let P=(I==null?void 0:I.width)||100;return typeof P=="string"&&(P=parseInt(P.replace("px",""))||100),P},[R]),L=E.useCallback(O=>Ft,[]),N=E.useMemo(()=>u.map(O=>O.cells),[u]),se=E.useCallback(O=>{if(O&&typeof O.scrollLeft=="number"){l&&l(O);return}if(O&&O.target){const{scrollLeft:I,scrollTop:P}=O.target;l&&l({scrollLeft:I,scrollTop:P})}},[l]),j=(typeof(n==null?void 0:n.y)=="number"?n.y:parseInt((n==null?void 0:n.y)||"400"))||400;return X.jsx(mn,{gridRef:c,columnCount:k,columnWidth:d,rowCount:m,rowHeight:L,style:{height:j-40,width:s},onScroll:se,className:"virtual-grid",overscanCount:20,cellComponent:wn,cellProps:{mergedData:N,columns:R,data:u,handleExpand:e.handleExpand,meta:e.meta}})},Fe=e=>{const t=[],r=n=>{n.children&&n.children.length>0?n.children.forEach(i=>r(i)):t.push(n)};return e.forEach(n=>r(n)),t},de=(e,t)=>{const r=t.split(".");let n=e;for(const i of r){if(n==null)return n;n=n[i]}return n==null&&(n=Ce),n},lt=(e,t)=>"|"+t.map(n=>de(e,n)).join("|"),Yt={sum:e=>e.reduce((t,r)=>t+(Number(r)||0),0),avg:e=>{const t=e.filter(r=>!isNaN(Number(r)));return t.length>0?t.reduce((r,n)=>r+Number(n),0)/t.length:0},count:e=>e.length,min:e=>Math.min(...e.map(t=>Number(t)||1/0)),max:e=>Math.max(...e.map(t=>Number(t)||-1/0)),d_count:e=>new Set(e).size,variance:e=>{const t=e.map(i=>Number(i)).filter(i=>!isNaN(i));if(t.length===0)return 0;const r=t.reduce((i,s)=>i+s,0)/t.length;return t.map(i=>Math.pow(i-r,2)).reduce((i,s)=>i+s,0)/t.length},stddev:e=>{const t=e.map(s=>Number(s)).filter(s=>!isNaN(s));if(t.length===0)return 0;const r=t.reduce((s,a)=>s+a,0)/t.length,i=t.map(s=>Math.pow(s-r,2)).reduce((s,a)=>s+a,0)/t.length;return Math.sqrt(i)}},pe=new Map,ct=new Map,ut=new Map,Kt=e=>{const{data:t,sortParams:r,fields:n}=e,{rows:i,columns:s,values:a}=n;if(!t||t.length===0||!i.length&&!s.length&&!a.length)return{list:[],dataExpandFilter:b=>b};console.group("透视表数据处理");const l=Fe(i),c=Fe(s),v=Fe(a),u=l.map(b=>b.field),m=c.map(b=>b.field),w=new Map,k=new Map,$=new Map;t.forEach(b=>{const _=lt(b,u);w.has(_)||w.set(_,[]),w.get(_).push(b);const x=lt(b,m);k.has(x)||k.set(x,[]),k.get(x).push(b);const g=`${_}||${x}`;$.has(g)||$.set(g,[]),$.get(g).push(b)});const R=()=>Array.from(w.entries()).sort(([b,_],[x,g])=>{if(r&&r.length>0)for(const h of r){const{field:C,sortType:D}=h,S=D==="asc",A=de(_[0],C),B=de(g[0],C);if(A<B)return S?-1:1;if(A>B)return S?1:-1}for(let h=0;h<u.length;h++){const C=u[h],D=l[h],S=de(_[0],C),A=de(g[0],C);if(S!==A)if(D.sort&&D.sort.enabled){const B=D.sort.type==="asc";if(S<A)return B?-1:1;if(S>A)return B?1:-1}else{if(S<A)return-1;if(S>A)return 1}}return 0}),d=()=>Array.from(k.entries()).sort(([b,_],[x,g])=>{for(let h=0;h<m.length;h++){const C=m[h],D=c[h],S=de(_[0],C),A=de(g[0],C);if(S!==A)if(D.sort&&D.sort.enabled){const B=D.sort.type==="asc";if(S<A)return B?-1:1;if(S>A)return B?1:-1}else{if(S<A)return-1;if(S>A)return 1}}return 0}),L=()=>{const b=[],_=Fe(i);for(let x=1;x<=_.length;x++)b.push(_.slice(0,x));return b},N=()=>{const b=L(),_=new Set;return b.forEach((x,g)=>{const h=x[x.length-1];h.total&&h.total.enabled&&_.add(g)}),_},se=()=>{const b=L(),_=[],x=N();return x.size===0||x.forEach(g=>{let h=[];g>0&&(h=b[g-1]);const C={};t.forEach(D=>{let S="";if(g>0?S=h.map(A=>de(D,A.field)).join("|"):S="__GLOBAL__",!C[S]){const B=b[g][g].total;C[S]={records:[],config:B}}C[S].records.push(D)}),_.push({level:g,data:C})}),_},j=d(),O=new Map,I=(b,_)=>{if(console.log("toggleExpand",b,_),pe.has(b)){const x=pe.get(b),g=x.get(_);x.set(_,!g),ct.set("rowKey",_),ct.set("level",b),ct.set("expanded",!g)}},P=b=>{const _=se(),x=[...b];if(_.length===0)return x;for(let g=0;g<_.length;g++){const{level:h,data:C}=_[g];Object.keys(C).forEach(D=>{const{records:S,config:A}=C[D],{label:B=Wt,position:Z="bottom"}=A||{},_e=D.split("|");let ae=-1,le=-1;if(h===0)ae=0,le=x.length-1;else for(let y=0;y<x.length;y++){const oe=x[y];u.slice(0,h).every((Re,ve)=>{var Q;return((Q=oe[ve])==null?void 0:Q.content)===_e[ve]})&&(ae===-1&&(ae=y),le=y)}if(ae!==-1){const y=[];let oe="";u.forEach((Re,ve)=>{let Q=Ce;const Te=ve+1,ze=Te<u.length,Pe=l[ve];ve<=h&&(ve===h?Q=B:Q=_e[ve],oe+=`|${Q}`);const We=pe.has(Te)&&pe.get(Te).get(oe)||!0;(Q===Ce||Q===null||Q===void 0)&&Pe.emptyReplace&&(Q=Pe.emptyReplace),y.push({content:Q,rowspan:1,colspan:1,data:null,rowKey:oe,expandable:Z==="top"&&ze&&Q!==Ce&&Q!==Wt,expanded:Z==="top"?We:!1,level:Te,onClick:Z==="top"&&ze?me=>I(me.level,me.rowKey):void 0})}),j.forEach(([Re,ve])=>{v.forEach(Q=>{const Te=Q.field,ze=Q.calculateType||"sum",We=S.filter(Ie=>lt(Ie,m)===Re).map(Ie=>de(Ie,Te));let me=Yt[ze](We);(me===Ce||me===null||me===void 0||typeof me=="number"&&isNaN(me))&&Q.emptyReplace&&(me=Q.emptyReplace),y.push({content:me,rowspan:1,colspan:1,data:null})})});const re=Z==="top"?ae:le+1;ut.has(oe)||(x.splice(re,0,y),ut.set(oe,1),Z==="top"&&h>0&&O.set(D,oe))}})}return x},M=Fe(i);pe.clear(),t.forEach(b=>{let _="";u.forEach((x,g)=>{const h=g+1,C=de(b,x);_+=`|${C}`,pe.has(h)||pe.set(h,new Map),pe.get(h).set(_,!0)})});const H=R();let T=[];const W=new Map;H.forEach(([b,_])=>{const x=_[0];let g="";u.forEach((h,C)=>{const D=de(x,h),S=C+1;g+=`|${D}`,W.has(S)||W.set(S,new Map);const A=W.get(S);A.set(g,(A.get(g)||0)+1)})}),H.forEach(([b,_])=>{const x=_[0],g=[];let h="";u.forEach((C,D)=>{var oe;let S=de(x,C);const A=D+1,B=A<u.length,Z=l[D];h+=`|${S}`;let _e=b;const ae=M.find(re=>re.field===C);if((oe=ae==null?void 0:ae.total)!=null&&oe.enabled&&ae.total.label&&(_e=`${h}|${ae.total.label}`),B){const re=h;O.has(re)||O.set(re,_e)}const le=pe.has(A)&&pe.get(A).get(h)||!0,y=A<u.length?(W.get(A).get(h)||0)>1:!1;(S===Ce||S===null||S===void 0)&&Z.emptyReplace&&(S=Z.emptyReplace),g.push({content:S,rowspan:1,colspan:1,data:x,expandable:B&&y,expanded:le,level:A,rowKey:h,onClick:B&&y?re=>I(re.level,re.rowKey):void 0})}),j.forEach(([C,D])=>{v.forEach(S=>{const A=S.field,B=S.calculateType||"sum",Z=`${b}||${C}`,ae=($.get(Z)||[]).map(y=>de(y,A));let le=Yt[B](ae);(le===Ce||le===null||le===void 0||typeof le=="number"&&isNaN(le))&&S.emptyReplace&&(le=S.emptyReplace),g.push({content:le,rowspan:1,colspan:1,data:x})})}),T.push({cells:g,rowKey:h})});const q=b=>{const x=b.split("|").filter(Boolean).length;for(let g=1;g<x;g++)if(pe.has(g)){const h=pe.get(g),C=b.split("|").slice(0,g+1).join("|");if(h.has(C)&&!h.get(C)){const D=C,S=O.get(D);if(b!==S)return!1}}return!0},U=b=>{var _,x;if(!b||b.length===0)return b;for(let g=0;g<l.length;g++){let h=b[0][g].content,C=0,D=l[g],S=(_=D.total)==null?void 0:_.enabled,A=((x=D.total)==null?void 0:x.label)||"";for(let B=1;B<b.length;B++){const Z=b[B][g];Z.content!==Ce&&(!S||Z.content!==A)&&Z.content===h?(Z.rowspan=0,b[C][g].rowspan++):(h=Z.content,C=B)}}return b},te=b=>{console.group("透视表数据处理 - 过滤可见行");const _=b.filter(h=>q(h.rowKey)),x=_.map(h=>h.cells.map(C=>({...C})));U(x);const g=_.map((h,C)=>({rowKey:h.rowKey,cells:x[C]}));return console.groupEnd(),g};ut.clear();const ue=T.map(b=>b.cells),Oe=P(ue).map((b,_)=>{let x="";return b.forEach((g,h)=>{h<u.length&&g.rowKey&&(x=g.rowKey)}),{cells:b,rowKey:x}}),he=(()=>{const b=[];return l.forEach(_=>{b.push({..._,width:_.width||100,fixed:"left",key:_.field})}),c.length===0?v.forEach(_=>{b.push({..._,width:_.width||100,key:_.field})}):j.forEach(([_,x])=>{const g=_.split("|").filter(h=>h!=="");v.forEach(h=>{let C=g.join(" - ");C?C+=` - ${h.title||h.field}`:C=h.title||h.field,b.push({...h,field:`${_}||${h.field}`,title:C,width:h.width||100,key:`${_}||${h.field}`})})}),b})();return console.groupEnd(),{list:Oe,dataExpandFilter:te,tableColumns:he}},Gt=e=>{const{data:t,fields:r}=e,{rows:n,columns:i,values:s}=r;if(!s||s.length===0)return{list:[],dataExpandFilter:a=>a};if(!t||t.length===0)return{list:[],dataExpandFilter:a=>a};if(n.length===0&&i.length===0){const a=s.map(c=>({...c,width:c.width||100,key:c.field}));return{list:t.map((c,v)=>({cells:s.map(m=>({content:c[m.field]??Ce,rowspan:1,colspan:1,style:m.style})),rowKey:v.toString()})),dataExpandFilter:c=>c,tableColumns:a}}return Kt(e)},Sn=E.memo(e=>{const{scroll:t,data:r,meta:n,sortParams:i,fields:s}=e,[a,l]=E.useState(0),[c,v]=E.useState([]),[u,m]=E.useState([]);console.log("list",c);const w=E.useRef(null),k=E.useCallback(()=>{if(w.current){let M=w.current;if(console.log("rs=",M),!M||!M.list||!M.dataExpandFilter)return;v(M.dataExpandFilter(M.list))}},[]);E.useEffect(()=>{let H=Gt({data:r,meta:n,sortParams:i,fields:s});w.current=H,H.tableColumns&&m(H.tableColumns),k()},[r,n,i,s,k]);const $=E.useCallback(M=>M?typeof M=="string"?parseInt(M.replace("px",""))||0:typeof M=="number"?M:0:0,[]),{baseWidth:R,colCount:d}=E.useMemo(()=>{let M=0,H=0;const T=W=>{W.forEach(q=>{q.type!=="group"&&(M+=$(q.width),H+=1),q!=null&&q.children&&q.children.length>0&&T(q.children)})};return T(u),{baseWidth:M,colCount:H}},[u,$]),L=E.useMemo(()=>{const M=H=>H.map(T=>{let W=0;R<a&&d>0&&(W=Math.floor((a-R)/d));const U=(T.width?$(T.width):nn)+W;return T.colSpan&&T.colSpan>1?T.width=U*T.colSpan:T.width=U,T.fixed&&(T.fixed=!1),T!=null&&T.children&&T.children.length>0&&(T.children=M(T.children)),T});return M(it(u))},[u,R,a,d,$]),N=E.useMemo(()=>{let M=0;const H=T=>{T.forEach(W=>{W.type!=="group"&&(M+=$(W.width)),W!=null&&W.children&&W.children.length>0&&H(W.children)})};return H(L),M},[L,$]),se=E.useRef(null),j=E.useRef(null),O=E.useRef(!1),I=E.useCallback(({scrollLeft:M})=>{O.current||(O.current=!0,se.current&&(se.current.scrollLeft=M),requestAnimationFrame(()=>{O.current=!1}))},[]),P=E.useCallback(M=>{if(O.current)return;O.current=!0;const H=M.currentTarget.scrollLeft;j.current&&(j.current.scrollLeft=H),requestAnimationFrame(()=>{O.current=!1})},[]);return X.jsx(nt,{onResize:({width:M})=>{M&&M!==a&&l(M)},children:X.jsxs("div",{className:ot("virtual-table",e.className),style:{width:"100%",...e.style},children:[X.jsx(rn,{ref:se,columns:L,width:a,onScroll:P}),X.jsx("div",{className:"virtual-table-body",style:{width:"100%"},children:X.jsx(_n,{data:c,info:{ref:j,onScroll:I},scroll:t,columns:L,tableWidth:a,gridWidth:N,handleExpand:k,meta:n})})]})})});ye.VirtualTable=Sn,ye.dataHandler=Gt,ye.pivotDataHandler=Kt,Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"})});
|
|
53
|
+
//# sourceMappingURL=virtual-table.umd.js.map
|