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