@visactor/react-vtable 0.19.1 → 0.19.2-alpha.1
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/cjs/components/base-component.d.ts +1 -0
- package/cjs/components/base-component.js +9 -35
- package/cjs/components/base-component.js.map +1 -1
- package/cjs/context/table.d.ts +0 -1
- package/cjs/context/table.js.map +1 -1
- package/cjs/tables/base-table.d.ts +1 -0
- package/cjs/tables/base-table.js +49 -56
- package/cjs/tables/base-table.js.map +1 -1
- package/dist/react-vtable.js +59 -103
- package/dist/react-vtable.min.js +2 -2
- package/es/components/base-component.d.ts +1 -0
- package/es/components/base-component.js +9 -36
- package/es/components/base-component.js.map +1 -1
- package/es/context/table.d.ts +0 -1
- package/es/context/table.js.map +1 -1
- package/es/tables/base-table.d.ts +1 -0
- package/es/tables/base-table.js +47 -55
- package/es/tables/base-table.js.map +1 -1
- package/package.json +3 -3
package/dist/react-vtable.min.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/"production"===process.env.NODE_ENV?u.exports=function(){if(a)return i;a=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.iterator,y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,h={};function v(e,t,r){this.props=e,this.context=t,this.refs=h,this.updater=r||y}function b(){}function _(e,t,r){this.props=e,this.context=t,this.refs=h,this.updater=r||y}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=v.prototype;var g=_.prototype=new b;g.constructor=_,m(g,v.prototype),g.isPureReactComponent=!0;var E=Array.isArray,C=Object.prototype.hasOwnProperty,S={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function w(t,r,n){var o,a={},u=null,i=null;if(null!=r)for(o in void 0!==r.ref&&(i=r.ref),void 0!==r.key&&(u=""+r.key),r)C.call(r,o)&&!O.hasOwnProperty(o)&&(a[o]=r[o]);var c=arguments.length-2;if(1===c)a.children=n;else if(1<c){for(var s=Array(c),l=0;l<c;l++)s[l]=arguments[l+2];a.children=s}if(t&&t.defaultProps)for(o in c=t.defaultProps)void 0===a[o]&&(a[o]=c[o]);return{$$typeof:e,type:t,key:u,ref:i,props:a,_owner:S.current}}function R(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var k=/\/+/g;function T(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function P(r,n,o,a,u){var i=typeof r;"undefined"!==i&&"boolean"!==i||(r=null);var c=!1;if(null===r)c=!0;else switch(i){case"string":case"number":c=!0;break;case"object":switch(r.$$typeof){case e:case t:c=!0}}if(c)return u=u(c=r),r=""===a?"."+T(c,0):a,E(u)?(o="",null!=r&&(o=r.replace(k,"$&/")+"/"),P(u,n,o,"",(function(e){return e}))):null!=u&&(R(u)&&(u=function(t,r){return{$$typeof:e,type:t.type,key:r,ref:t.ref,props:t.props,_owner:t._owner}}(u,o+(!u.key||c&&c.key===u.key?"":(""+u.key).replace(k,"$&/")+"/")+r)),n.push(u)),1;if(c=0,a=""===a?".":a+":",E(r))for(var s=0;s<r.length;s++){var l=a+T(i=r[s],s);c+=P(i,n,o,l,u)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(r),"function"==typeof l)for(r=l.call(r),s=0;!(i=r.next()).done;)c+=P(i=i.value,n,o,l=a+T(i,s++),u);else if("object"===i)throw n=String(r),Error("Objects are not valid as a React child (found: "+("[object Object]"===n?"object with keys {"+Object.keys(r).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.");return c}function L(e,t,r){if(null==e)return e;var n=[],o=0;return P(e,n,"","",(function(e){return t.call(r,e,o++)})),n}function j(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var $={current:null},x={transition:null},I={ReactCurrentDispatcher:$,ReactCurrentBatchConfig:x,ReactCurrentOwner:S};return i.Children={map:L,forEach:function(e,t,r){L(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return L(e,(function(){t++})),t},toArray:function(e){return L(e,(function(e){return e}))||[]},only:function(e){if(!R(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},i.Component=v,i.Fragment=r,i.Profiler=o,i.PureComponent=_,i.StrictMode=n,i.Suspense=l,i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,i.cloneElement=function(t,r,n){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o=m({},t.props),a=t.key,u=t.ref,i=t._owner;if(null!=r){if(void 0!==r.ref&&(u=r.ref,i=S.current),void 0!==r.key&&(a=""+r.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(s in r)C.call(r,s)&&!O.hasOwnProperty(s)&&(o[s]=void 0===r[s]&&void 0!==c?c[s]:r[s])}var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){c=Array(s);for(var l=0;l<s;l++)c[l]=arguments[l+2];o.children=c}return{$$typeof:e,type:t.type,key:a,ref:u,props:o,_owner:i}},i.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:u,_context:e},e.Consumer=e},i.createElement=w,i.createFactory=function(e){var t=w.bind(null,e);return t.type=e,t},i.createRef=function(){return{current:null}},i.forwardRef=function(e){return{$$typeof:s,render:e}},i.isValidElement=R,i.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:j}},i.memo=function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},i.startTransition=function(e){var t=x.transition;x.transition={};try{e()}finally{x.transition=t}},i.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},i.useCallback=function(e,t){return $.current.useCallback(e,t)},i.useContext=function(e){return $.current.useContext(e)},i.useDebugValue=function(){},i.useDeferredValue=function(e){return $.current.useDeferredValue(e)},i.useEffect=function(e,t){return $.current.useEffect(e,t)},i.useId=function(){return $.current.useId()},i.useImperativeHandle=function(e,t,r){return $.current.useImperativeHandle(e,t,r)},i.useInsertionEffect=function(e,t){return $.current.useInsertionEffect(e,t)},i.useLayoutEffect=function(e,t){return $.current.useLayoutEffect(e,t)},i.useMemo=function(e,t){return $.current.useMemo(e,t)},i.useReducer=function(e,t,r){return $.current.useReducer(e,t,r)},i.useRef=function(e){return $.current.useRef(e)},i.useState=function(e){return $.current.useState(e)},i.useSyncExternalStore=function(e,t,r){return $.current.useSyncExternalStore(e,t,r)},i.useTransition=function(){return $.current.useTransition()},i.version="18.2.0",i}():u.exports=(c||(c=1,function(e,t){"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),m=Symbol.iterator,h="@@iterator";function v(e){if(null===e||"object"!=typeof e)return null;var t=m&&e[m]||e[h];return"function"==typeof t?t:null}var b={current:null},_={transition:null},g={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},E={current:null},C={},S=null;function O(e){S=e}C.setExtraStackFrame=function(e){S=e},C.getCurrentStack=null,C.getStackAddendum=function(){var e="";S&&(e+=S);var t=C.getCurrentStack;return t&&(e+=t()||""),e};var w=!1,R=!1,k=!1,T=!1,P=!1,L={ReactCurrentDispatcher:b,ReactCurrentBatchConfig:_,ReactCurrentOwner:E};function j(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];x("warn",e,r)}function $(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];x("error",e,r)}function x(e,t,r){var n=L.ReactDebugCurrentFrame.getStackAddendum();""!==n&&(t+="%s",r=r.concat([n]));var o=r.map((function(e){return String(e)}));o.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,o)}L.ReactDebugCurrentFrame=C,L.ReactCurrentActQueue=g;var I={};function M(e,t){var r=e.constructor,n=r&&(r.displayName||r.name)||"ReactClass",o=n+"."+t;I[o]||($("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,n),I[o]=!0)}var N={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){M(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){M(e,"replaceState")},enqueueSetState:function(e,t,r,n){M(e,"setState")}},D=Object.assign,A={};function F(e,t,r){this.props=e,this.context=t,this.refs=A,this.updater=r||N}Object.freeze(A),F.prototype.isReactComponent={},F.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},F.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var U={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},V=function(e,t){Object.defineProperty(F.prototype,e,{get:function(){j("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var H in U)U.hasOwnProperty(H)&&V(H,U[H]);function z(){}function B(e,t,r){this.props=e,this.context=t,this.refs=A,this.updater=r||N}z.prototype=F.prototype;var Y=B.prototype=new z;Y.constructor=B,D(Y,F.prototype),Y.isPureReactComponent=!0;var K=Array.isArray;function q(e){return K(e)}function W(e){return""+e}function G(e){if(function(e){try{return W(e),!1}catch(e){return!0}}(e))return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),W(e)}function X(e){return e.displayName||"Context"}function Z(e){if(null==e)return null;if("number"==typeof e.tag&&$("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case o:return"Fragment";case n:return"Portal";case u:return"Profiler";case a:return"StrictMode";case l:return"Suspense";case f:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return X(e)+".Consumer";case i:return X(e._context)+".Provider";case s:return function(e,t,r){var n=e.displayName;if(n)return n;var o=t.displayName||t.name||"";return""!==o?r+"("+o+")":r}(e,e.render,"ForwardRef");case p:var t=e.displayName||null;return null!==t?t:Z(e.type)||"Memo";case d:var r=e,y=r._payload,m=r._init;try{return Z(m(y))}catch(e){return null}}return null}var J,Q,ee,te=Object.prototype.hasOwnProperty,re={key:!0,ref:!0,__self:!0,__source:!0};function ne(e){if(te.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function oe(e){if(te.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}ee={};var ae=function(e,t,n,o,a,u,i){var c={$$typeof:r,type:e,key:t,ref:n,props:i,_owner:u,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function ue(e,t,r){var n,o={},a=null,u=null,i=null,c=null;if(null!=t)for(n in ne(t)&&(u=t.ref,function(e){if("string"==typeof e.ref&&E.current&&e.__self&&E.current.stateNode!==e.__self){var t=Z(E.current.type);ee[t]||($('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',t,e.ref),ee[t]=!0)}}(t)),oe(t)&&(G(t.key),a=""+t.key),i=void 0===t.__self?null:t.__self,c=void 0===t.__source?null:t.__source,t)te.call(t,n)&&!re.hasOwnProperty(n)&&(o[n]=t[n]);var s=arguments.length-2;if(1===s)o.children=r;else if(s>1){for(var l=Array(s),f=0;f<s;f++)l[f]=arguments[f+2];Object.freeze&&Object.freeze(l),o.children=l}if(e&&e.defaultProps){var p=e.defaultProps;for(n in p)void 0===o[n]&&(o[n]=p[n])}if(a||u){var d="function"==typeof e?e.displayName||e.name||"Unknown":e;a&&function(e,t){var r=function(){J||(J=!0,$("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}(o,d),u&&function(e,t){var r=function(){Q||(Q=!0,$("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}(o,d)}return ae(e,a,u,i,c,E.current,o)}function ie(e,t,r){if(null==e)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n,o,a=D({},e.props),u=e.key,i=e.ref,c=e._self,s=e._source,l=e._owner;if(null!=t)for(n in ne(t)&&(i=t.ref,l=E.current),oe(t)&&(G(t.key),u=""+t.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)te.call(t,n)&&!re.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==o?a[n]=o[n]:a[n]=t[n]);var f=arguments.length-2;if(1===f)a.children=r;else if(f>1){for(var p=Array(f),d=0;d<f;d++)p[d]=arguments[d+2];a.children=p}return ae(e.type,u,i,c,s,l,a)}function ce(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var se=".",le=":",fe=!1,pe=/\/+/g;function de(e){return e.replace(pe,"$&/")}function ye(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(G(e.key),r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,(function(e){return n[e]}))):t.toString(36);var r,n}function me(e,t,o,a,u){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var c,s,l,f=!1;if(null===e)f=!0;else switch(i){case"string":case"number":f=!0;break;case"object":switch(e.$$typeof){case r:case n:f=!0}}if(f){var p=e,d=u(p),y=""===a?se+ye(p,0):a;if(q(d)){var m="";null!=y&&(m=de(y)+"/"),me(d,t,m,"",(function(e){return e}))}else null!=d&&(ce(d)&&(!d.key||p&&p.key===d.key||G(d.key),c=d,s=o+(!d.key||p&&p.key===d.key?"":de(""+d.key)+"/")+y,d=ae(c.type,s,c.ref,c._self,c._source,c._owner,c.props)),t.push(d));return 1}var h=0,b=""===a?se:a+le;if(q(e))for(var _=0;_<e.length;_++)h+=me(l=e[_],t,o,b+ye(l,_),u);else{var g=v(e);if("function"==typeof g){var E=e;g===E.entries&&(fe||j("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),fe=!0);for(var C,S=g.call(E),O=0;!(C=S.next()).done;)h+=me(l=C.value,t,o,b+ye(l,O++),u)}else if("object"===i){var w=String(e);throw new Error("Objects are not valid as a React child (found: "+("[object Object]"===w?"object with keys {"+Object.keys(e).join(", ")+"}":w)+"). If you meant to render a collection of children, use an array instead.")}}return h}function he(e,t,r){if(null==e)return e;var n=[],o=0;return me(e,n,"","",(function(e){return t.call(r,e,o++)})),n}var ve,be=-1,_e=0,ge=1,Ee=2;function Ce(e){if(e._status===be){var t=(0,e._result)();if(t.then((function(t){if(e._status===_e||e._status===be){var r=e;r._status=ge,r._result=t}}),(function(t){if(e._status===_e||e._status===be){var r=e;r._status=Ee,r._result=t}})),e._status===be){var r=e;r._status=_e,r._result=t}}if(e._status===ge){var n=e._result;return void 0===n&&$("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",n),"default"in n||$("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",n),n.default}throw e._result}function Se(e){return"string"==typeof e||"function"==typeof e||!!(e===o||e===u||P||e===a||e===l||e===f||T||e===y||w||R||k)||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===p||e.$$typeof===i||e.$$typeof===c||e.$$typeof===s||e.$$typeof===ve||void 0!==e.getModuleId)}function Oe(){var e=b.current;return null===e&&$("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."),e}ve=Symbol.for("react.module.reference");var we,Re,ke,Te,Pe,Le,je,$e=0;function xe(){}xe.__reactDisabledLog=!0;var Ie,Me=L.ReactCurrentDispatcher;function Ne(e,t,r){if(void 0===Ie)try{throw Error()}catch(e){var n=e.stack.trim().match(/\n( *(at )?)/);Ie=n&&n[1]||""}return"\n"+Ie+e}var De,Ae=!1,Fe="function"==typeof WeakMap?WeakMap:Map;function Ue(e,t){if(!e||Ae)return"";var r,n=De.get(e);if(void 0!==n)return n;Ae=!0;var o,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=Me.current,Me.current=null,function(){if(0===$e){we=console.log,Re=console.info,ke=console.warn,Te=console.error,Pe=console.group,Le=console.groupCollapsed,je=console.groupEnd;var e={configurable:!0,enumerable:!0,value:xe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}$e++}();try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(u,[])}catch(e){r=e}Reflect.construct(e,[],u)}else{try{u.call()}catch(e){r=e}e.call(u.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),c=r.stack.split("\n"),s=i.length-1,l=c.length-1;s>=1&&l>=0&&i[s]!==c[l];)l--;for(;s>=1&&l>=0;s--,l--)if(i[s]!==c[l]){if(1!==s||1!==l)do{if(s--,--l<0||i[s]!==c[l]){var f="\n"+i[s].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),"function"==typeof e&&De.set(e,f),f}}while(s>=1&&l>=0);break}}}finally{Ae=!1,Me.current=o,function(){if(0==--$e){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:we}),info:D({},e,{value:Re}),warn:D({},e,{value:ke}),error:D({},e,{value:Te}),group:D({},e,{value:Pe}),groupCollapsed:D({},e,{value:Le}),groupEnd:D({},e,{value:je})})}$e<0&&$("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var p=e?e.displayName||e.name:"",d=p?Ne(p):"";return"function"==typeof e&&De.set(e,d),d}function Ve(e,t,r){if(null==e)return"";if("function"==typeof e)return Ue(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return Ne(e);switch(e){case l:return Ne("Suspense");case f:return Ne("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case s:return Ue(e.render,!1);case p:return Ve(e.type,t,r);case d:var n=e,o=n._payload,a=n._init;try{return Ve(a(o),t,r)}catch(e){}}return""}De=new Fe;var He,ze={},Be=L.ReactDebugCurrentFrame;function Ye(e){if(e){var t=e._owner,r=Ve(e.type,e._source,t?t.type:null);Be.setExtraStackFrame(r)}else Be.setExtraStackFrame(null)}function Ke(e){if(e){var t=e._owner;O(Ve(e.type,e._source,t?t.type:null))}else O(null)}function qe(){if(E.current){var e=Z(E.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}He=!1;var We={};function Ge(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var r=function(e){var t=qe();if(!t){var r="string"==typeof e?e:e.displayName||e.name;r&&(t="\n\nCheck the top-level render call using <"+r+">.")}return t}(t);if(!We[r]){We[r]=!0;var n="";e&&e._owner&&e._owner!==E.current&&(n=" It was passed a child from "+Z(e._owner.type)+"."),Ke(e),$('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,n),Ke(null)}}}function Xe(e,t){if("object"==typeof e)if(q(e))for(var r=0;r<e.length;r++){var n=e[r];ce(n)&&Ge(n,t)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var o=v(e);if("function"==typeof o&&o!==e.entries)for(var a,u=o.call(e);!(a=u.next()).done;)ce(a.value)&&Ge(a.value,t)}}function Ze(e){var t,r=e.type;if(null!=r&&"string"!=typeof r){if("function"==typeof r)t=r.propTypes;else{if("object"!=typeof r||r.$$typeof!==s&&r.$$typeof!==p)return;t=r.propTypes}if(t){var n=Z(r);!function(e,t,r,n,o){var a=Function.call.bind(te);for(var u in e)if(a(e,u)){var i=void 0;try{if("function"!=typeof e[u]){var c=Error((n||"React class")+": "+r+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}i=e[u](t,u,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){i=e}!i||i instanceof Error||(Ye(o),$("%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",r,u,typeof i),Ye(null)),i instanceof Error&&!(i.message in ze)&&(ze[i.message]=!0,Ye(o),$("Failed %s type: %s",r,i.message),Ye(null))}}(t,e.props,"prop",n,e)}else void 0===r.PropTypes||He||(He=!0,$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Z(r)||"Unknown"));"function"!=typeof r.getDefaultProps||r.getDefaultProps.isReactClassApproved||$("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Je(e,t,n){var a,u,i=Se(e);if(!i){var c,s="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(s+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),s+=(null!=(a=t)&&void 0!==(u=a.__source)?"\n\nCheck your code at "+u.fileName.replace(/^.*[\\\/]/,"")+":"+u.lineNumber+".":"")||qe(),null===e?c="null":q(e)?c="array":void 0!==e&&e.$$typeof===r?(c="<"+(Z(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):c=typeof e,$("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,s)}var l=ue.apply(this,arguments);if(null==l)return l;if(i)for(var f=2;f<arguments.length;f++)Xe(arguments[f],e);return e===o?function(e){for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){Ke(e),$("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),Ke(null);break}}null!==e.ref&&(Ke(e),$("Invalid attribute `ref` supplied to `React.Fragment`."),Ke(null))}(l):Ze(l),l}var Qe=!1,et=!1,tt=null,rt=0,nt=!1;function ot(e){e!==rt-1&&$("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),rt=e}function at(t,r,n){var o=g.current;if(null!==o)try{it(o),function(t){if(null===tt)try{var r=("require"+Math.random()).slice(0,7);tt=(e&&e[r]).call(e,"timers").setImmediate}catch(e){tt=function(e){!1===et&&(et=!0,"undefined"==typeof MessageChannel&&$("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}tt(t)}((function(){0===o.length?(g.current=null,r(t)):at(t,r,n)}))}catch(e){n(e)}else r(t)}var ut=!1;function it(e){if(!ut){ut=!0;var t=0;try{for(;t<e.length;t++){var r=e[t];do{r=r(!0)}while(null!==r)}e.length=0}catch(r){throw e=e.slice(t+1),r}finally{ut=!1}}}var ct=Je,st=function(e,t,r){for(var n=ie.apply(this,arguments),o=2;o<arguments.length;o++)Xe(arguments[o],n.type);return Ze(n),n},lt=function(e){var t=Je.bind(null,e);return t.type=e,Qe||(Qe=!0,j("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return j("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},ft={map:he,forEach:function(e,t,r){he(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return he(e,(function(){t++})),t},toArray:function(e){return he(e,(function(e){return e}))||[]},only:function(e){if(!ce(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}};t.Children=ft,t.Component=F,t.Fragment=o,t.Profiler=u,t.PureComponent=B,t.StrictMode=a,t.Suspense=l,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L,t.cloneElement=st,t.createContext=function(e){var t={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};t.Provider={$$typeof:i,_context:t};var r=!1,n=!1,o=!1,a={$$typeof:c,_context:t};return Object.defineProperties(a,{Provider:{get:function(){return n||(n=!0,$("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),t.Provider},set:function(e){t.Provider=e}},_currentValue:{get:function(){return t._currentValue},set:function(e){t._currentValue=e}},_currentValue2:{get:function(){return t._currentValue2},set:function(e){t._currentValue2=e}},_threadCount:{get:function(){return t._threadCount},set:function(e){t._threadCount=e}},Consumer:{get:function(){return r||(r=!0,$("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),t.Consumer}},displayName:{get:function(){return t.displayName},set:function(e){o||(j("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e),o=!0)}}}),t.Consumer=a,t._currentRenderer=null,t._currentRenderer2=null,t},t.createElement=ct,t.createFactory=lt,t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){null!=e&&e.$$typeof===p?$("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?$("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&$("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||$("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"));var t,r={$$typeof:s,render:e};return Object.defineProperty(r,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(r){t=r,e.name||e.displayName||(e.displayName=r)}}),r},t.isValidElement=ce,t.lazy=function(e){var t,r,n={$$typeof:d,_payload:{_status:be,_result:e},_init:Ce};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){$("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){$("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},t.memo=function(e,t){Se(e)||$("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e);var r,n={$$typeof:p,type:e,compare:void 0===t?null:t};return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return r},set:function(t){r=t,e.name||e.displayName||(e.displayName=t)}}),n},t.startTransition=function(e,t){var r=_.transition;_.transition={};var n=_.transition;_.transition._updatedFibers=new Set;try{e()}finally{_.transition=r,null===r&&n._updatedFibers&&(n._updatedFibers.size>10&&j("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),n._updatedFibers.clear())}},t.unstable_act=function(e){var t=rt;rt++,null===g.current&&(g.current=[]);var r,n=g.isBatchingLegacy;try{if(g.isBatchingLegacy=!0,r=e(),!n&&g.didScheduleLegacyUpdate){var o=g.current;null!==o&&(g.didScheduleLegacyUpdate=!1,it(o))}}catch(e){throw ot(t),e}finally{g.isBatchingLegacy=n}if(null!==r&&"object"==typeof r&&"function"==typeof r.then){var a=r,u=!1,i={then:function(e,r){u=!0,a.then((function(n){ot(t),0===rt?at(n,e,r):e(n)}),(function(e){ot(t),r(e)}))}};return nt||"undefined"==typeof Promise||Promise.resolve().then((function(){})).then((function(){u||(nt=!0,$("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))})),i}var c=r;if(ot(t),0===rt){var s=g.current;return null!==s&&(it(s),g.current=null),{then:function(e,t){null===g.current?(g.current=[],at(c,e,t)):e(c)}}}return{then:function(e,t){e(c)}}},t.useCallback=function(e,t){return Oe().useCallback(e,t)},t.useContext=function(e){var t=Oe();if(void 0!==e._context){var r=e._context;r.Consumer===e?$("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&$("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return t.useContext(e)},t.useDebugValue=function(e,t){return Oe().useDebugValue(e,t)},t.useDeferredValue=function(e){return Oe().useDeferredValue(e)},t.useEffect=function(e,t){return Oe().useEffect(e,t)},t.useId=function(){return Oe().useId()},t.useImperativeHandle=function(e,t,r){return Oe().useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return Oe().useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return Oe().useLayoutEffect(e,t)},t.useMemo=function(e,t){return Oe().useMemo(e,t)},t.useReducer=function(e,t,r){return Oe().useReducer(e,t,r)},t.useRef=function(e){return Oe().useRef(e)},t.useState=function(e){return Oe().useState(e)},t.useSyncExternalStore=function(e,t,r){return Oe().useSyncExternalStore(e,t,r)},t.useTransition=function(){return Oe().useTransition()},t.version="18.2.0","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()}(s,s.exports)),s.exports);var l=u.exports,f=o(l);const p=f.createContext(null);p.displayName="TableContext";var d=(e,t)=>Object.prototype.toString.call(e)===`[object ${t}]`;var y=e=>"function"==typeof e;var m=e=>null==e;var h=e=>"object"==typeof e&&null!==e;var v=function(e){if(!h(e)||!d(e,"Object"))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t};var b=function(e){const t=typeof e;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===t:"string"===t||d(e,"String")};var _=e=>Array.isArray?Array.isArray(e):d(e,"Array");function g(e,t){if(!e||!v(e))return e;const r={};return Object.keys(e).forEach((n=>{const o=e[n];let a=!1;t.forEach((e=>{(b(e)&&e===n||e instanceof RegExp&&n.match(e))&&(a=!0)})),a||(r[n]=o)})),r}function E(e){return Object.prototype.toString.call(e)}function C(e){return Object.keys(e)}function S(e,t,r){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(null==e||null==t)return!1;if(Number.isNaN(e)&&Number.isNaN(t))return!0;if(E(e)!==E(t))return!1;if(y(e))return!!(null==r?void 0:r.skipFunction);if("object"!=typeof e)return!1;if(_(e)){if(e.length!==t.length)return!1;for(let n=e.length-1;n>=0;n--)if(!S(e[n],t[n],r))return!1;return!0}if(!v(e))return!1;const n=C(e),o=C(t);if(n.length!==o.length)return!1;n.sort(),o.sort();for(let e=n.length-1;e>=0;e--)if(n[e]!=o[e])return!1;for(let o=n.length-1;o>=0;o--){const a=n[o];if(!S(e[a],t[a],r))return!1}return!0}var O,w={exports:{}},R={};var k,T={};
|
|
10
|
+
*/"production"===process.env.NODE_ENV?u.exports=function(){if(a)return i;a=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.iterator,y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,v={};function h(e,t,r){this.props=e,this.context=t,this.refs=v,this.updater=r||y}function b(){}function _(e,t,r){this.props=e,this.context=t,this.refs=v,this.updater=r||y}h.prototype.isReactComponent={},h.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},h.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=h.prototype;var g=_.prototype=new b;g.constructor=_,m(g,h.prototype),g.isPureReactComponent=!0;var E=Array.isArray,C=Object.prototype.hasOwnProperty,S={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function w(t,r,n){var o,a={},u=null,i=null;if(null!=r)for(o in void 0!==r.ref&&(i=r.ref),void 0!==r.key&&(u=""+r.key),r)C.call(r,o)&&!O.hasOwnProperty(o)&&(a[o]=r[o]);var c=arguments.length-2;if(1===c)a.children=n;else if(1<c){for(var s=Array(c),l=0;l<c;l++)s[l]=arguments[l+2];a.children=s}if(t&&t.defaultProps)for(o in c=t.defaultProps)void 0===a[o]&&(a[o]=c[o]);return{$$typeof:e,type:t,key:u,ref:i,props:a,_owner:S.current}}function R(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var k=/\/+/g;function T(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function P(r,n,o,a,u){var i=typeof r;"undefined"!==i&&"boolean"!==i||(r=null);var c=!1;if(null===r)c=!0;else switch(i){case"string":case"number":c=!0;break;case"object":switch(r.$$typeof){case e:case t:c=!0}}if(c)return u=u(c=r),r=""===a?"."+T(c,0):a,E(u)?(o="",null!=r&&(o=r.replace(k,"$&/")+"/"),P(u,n,o,"",(function(e){return e}))):null!=u&&(R(u)&&(u=function(t,r){return{$$typeof:e,type:t.type,key:r,ref:t.ref,props:t.props,_owner:t._owner}}(u,o+(!u.key||c&&c.key===u.key?"":(""+u.key).replace(k,"$&/")+"/")+r)),n.push(u)),1;if(c=0,a=""===a?".":a+":",E(r))for(var s=0;s<r.length;s++){var l=a+T(i=r[s],s);c+=P(i,n,o,l,u)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(r),"function"==typeof l)for(r=l.call(r),s=0;!(i=r.next()).done;)c+=P(i=i.value,n,o,l=a+T(i,s++),u);else if("object"===i)throw n=String(r),Error("Objects are not valid as a React child (found: "+("[object Object]"===n?"object with keys {"+Object.keys(r).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.");return c}function L(e,t,r){if(null==e)return e;var n=[],o=0;return P(e,n,"","",(function(e){return t.call(r,e,o++)})),n}function j(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var $={current:null},N={transition:null},I={ReactCurrentDispatcher:$,ReactCurrentBatchConfig:N,ReactCurrentOwner:S};return i.Children={map:L,forEach:function(e,t,r){L(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return L(e,(function(){t++})),t},toArray:function(e){return L(e,(function(e){return e}))||[]},only:function(e){if(!R(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},i.Component=h,i.Fragment=r,i.Profiler=o,i.PureComponent=_,i.StrictMode=n,i.Suspense=l,i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,i.cloneElement=function(t,r,n){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o=m({},t.props),a=t.key,u=t.ref,i=t._owner;if(null!=r){if(void 0!==r.ref&&(u=r.ref,i=S.current),void 0!==r.key&&(a=""+r.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(s in r)C.call(r,s)&&!O.hasOwnProperty(s)&&(o[s]=void 0===r[s]&&void 0!==c?c[s]:r[s])}var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){c=Array(s);for(var l=0;l<s;l++)c[l]=arguments[l+2];o.children=c}return{$$typeof:e,type:t.type,key:a,ref:u,props:o,_owner:i}},i.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:u,_context:e},e.Consumer=e},i.createElement=w,i.createFactory=function(e){var t=w.bind(null,e);return t.type=e,t},i.createRef=function(){return{current:null}},i.forwardRef=function(e){return{$$typeof:s,render:e}},i.isValidElement=R,i.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:j}},i.memo=function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},i.startTransition=function(e){var t=N.transition;N.transition={};try{e()}finally{N.transition=t}},i.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},i.useCallback=function(e,t){return $.current.useCallback(e,t)},i.useContext=function(e){return $.current.useContext(e)},i.useDebugValue=function(){},i.useDeferredValue=function(e){return $.current.useDeferredValue(e)},i.useEffect=function(e,t){return $.current.useEffect(e,t)},i.useId=function(){return $.current.useId()},i.useImperativeHandle=function(e,t,r){return $.current.useImperativeHandle(e,t,r)},i.useInsertionEffect=function(e,t){return $.current.useInsertionEffect(e,t)},i.useLayoutEffect=function(e,t){return $.current.useLayoutEffect(e,t)},i.useMemo=function(e,t){return $.current.useMemo(e,t)},i.useReducer=function(e,t,r){return $.current.useReducer(e,t,r)},i.useRef=function(e){return $.current.useRef(e)},i.useState=function(e){return $.current.useState(e)},i.useSyncExternalStore=function(e,t,r){return $.current.useSyncExternalStore(e,t,r)},i.useTransition=function(){return $.current.useTransition()},i.version="18.2.0",i}():u.exports=(c||(c=1,function(e,t){"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),m=Symbol.iterator,v="@@iterator";function h(e){if(null===e||"object"!=typeof e)return null;var t=m&&e[m]||e[v];return"function"==typeof t?t:null}var b={current:null},_={transition:null},g={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},E={current:null},C={},S=null;function O(e){S=e}C.setExtraStackFrame=function(e){S=e},C.getCurrentStack=null,C.getStackAddendum=function(){var e="";S&&(e+=S);var t=C.getCurrentStack;return t&&(e+=t()||""),e};var w=!1,R=!1,k=!1,T=!1,P=!1,L={ReactCurrentDispatcher:b,ReactCurrentBatchConfig:_,ReactCurrentOwner:E};function j(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];N("warn",e,r)}function $(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];N("error",e,r)}function N(e,t,r){var n=L.ReactDebugCurrentFrame.getStackAddendum();""!==n&&(t+="%s",r=r.concat([n]));var o=r.map((function(e){return String(e)}));o.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,o)}L.ReactDebugCurrentFrame=C,L.ReactCurrentActQueue=g;var I={};function x(e,t){var r=e.constructor,n=r&&(r.displayName||r.name)||"ReactClass",o=n+"."+t;I[o]||($("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,n),I[o]=!0)}var M={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){x(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){x(e,"replaceState")},enqueueSetState:function(e,t,r,n){x(e,"setState")}},D=Object.assign,A={};function F(e,t,r){this.props=e,this.context=t,this.refs=A,this.updater=r||M}Object.freeze(A),F.prototype.isReactComponent={},F.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},F.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var V={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},U=function(e,t){Object.defineProperty(F.prototype,e,{get:function(){j("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var H in V)V.hasOwnProperty(H)&&U(H,V[H]);function z(){}function B(e,t,r){this.props=e,this.context=t,this.refs=A,this.updater=r||M}z.prototype=F.prototype;var Y=B.prototype=new z;Y.constructor=B,D(Y,F.prototype),Y.isPureReactComponent=!0;var K=Array.isArray;function q(e){return K(e)}function W(e){return""+e}function G(e){if(function(e){try{return W(e),!1}catch(e){return!0}}(e))return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),W(e)}function X(e){return e.displayName||"Context"}function Z(e){if(null==e)return null;if("number"==typeof e.tag&&$("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case o:return"Fragment";case n:return"Portal";case u:return"Profiler";case a:return"StrictMode";case l:return"Suspense";case f:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return X(e)+".Consumer";case i:return X(e._context)+".Provider";case s:return function(e,t,r){var n=e.displayName;if(n)return n;var o=t.displayName||t.name||"";return""!==o?r+"("+o+")":r}(e,e.render,"ForwardRef");case p:var t=e.displayName||null;return null!==t?t:Z(e.type)||"Memo";case d:var r=e,y=r._payload,m=r._init;try{return Z(m(y))}catch(e){return null}}return null}var J,Q,ee,te=Object.prototype.hasOwnProperty,re={key:!0,ref:!0,__self:!0,__source:!0};function ne(e){if(te.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function oe(e){if(te.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}ee={};var ae=function(e,t,n,o,a,u,i){var c={$$typeof:r,type:e,key:t,ref:n,props:i,_owner:u,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function ue(e,t,r){var n,o={},a=null,u=null,i=null,c=null;if(null!=t)for(n in ne(t)&&(u=t.ref,function(e){if("string"==typeof e.ref&&E.current&&e.__self&&E.current.stateNode!==e.__self){var t=Z(E.current.type);ee[t]||($('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',t,e.ref),ee[t]=!0)}}(t)),oe(t)&&(G(t.key),a=""+t.key),i=void 0===t.__self?null:t.__self,c=void 0===t.__source?null:t.__source,t)te.call(t,n)&&!re.hasOwnProperty(n)&&(o[n]=t[n]);var s=arguments.length-2;if(1===s)o.children=r;else if(s>1){for(var l=Array(s),f=0;f<s;f++)l[f]=arguments[f+2];Object.freeze&&Object.freeze(l),o.children=l}if(e&&e.defaultProps){var p=e.defaultProps;for(n in p)void 0===o[n]&&(o[n]=p[n])}if(a||u){var d="function"==typeof e?e.displayName||e.name||"Unknown":e;a&&function(e,t){var r=function(){J||(J=!0,$("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}(o,d),u&&function(e,t){var r=function(){Q||(Q=!0,$("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}(o,d)}return ae(e,a,u,i,c,E.current,o)}function ie(e,t,r){if(null==e)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n,o,a=D({},e.props),u=e.key,i=e.ref,c=e._self,s=e._source,l=e._owner;if(null!=t)for(n in ne(t)&&(i=t.ref,l=E.current),oe(t)&&(G(t.key),u=""+t.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)te.call(t,n)&&!re.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==o?a[n]=o[n]:a[n]=t[n]);var f=arguments.length-2;if(1===f)a.children=r;else if(f>1){for(var p=Array(f),d=0;d<f;d++)p[d]=arguments[d+2];a.children=p}return ae(e.type,u,i,c,s,l,a)}function ce(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var se=".",le=":",fe=!1,pe=/\/+/g;function de(e){return e.replace(pe,"$&/")}function ye(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(G(e.key),r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,(function(e){return n[e]}))):t.toString(36);var r,n}function me(e,t,o,a,u){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var c,s,l,f=!1;if(null===e)f=!0;else switch(i){case"string":case"number":f=!0;break;case"object":switch(e.$$typeof){case r:case n:f=!0}}if(f){var p=e,d=u(p),y=""===a?se+ye(p,0):a;if(q(d)){var m="";null!=y&&(m=de(y)+"/"),me(d,t,m,"",(function(e){return e}))}else null!=d&&(ce(d)&&(!d.key||p&&p.key===d.key||G(d.key),c=d,s=o+(!d.key||p&&p.key===d.key?"":de(""+d.key)+"/")+y,d=ae(c.type,s,c.ref,c._self,c._source,c._owner,c.props)),t.push(d));return 1}var v=0,b=""===a?se:a+le;if(q(e))for(var _=0;_<e.length;_++)v+=me(l=e[_],t,o,b+ye(l,_),u);else{var g=h(e);if("function"==typeof g){var E=e;g===E.entries&&(fe||j("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),fe=!0);for(var C,S=g.call(E),O=0;!(C=S.next()).done;)v+=me(l=C.value,t,o,b+ye(l,O++),u)}else if("object"===i){var w=String(e);throw new Error("Objects are not valid as a React child (found: "+("[object Object]"===w?"object with keys {"+Object.keys(e).join(", ")+"}":w)+"). If you meant to render a collection of children, use an array instead.")}}return v}function ve(e,t,r){if(null==e)return e;var n=[],o=0;return me(e,n,"","",(function(e){return t.call(r,e,o++)})),n}var he,be=-1,_e=0,ge=1,Ee=2;function Ce(e){if(e._status===be){var t=(0,e._result)();if(t.then((function(t){if(e._status===_e||e._status===be){var r=e;r._status=ge,r._result=t}}),(function(t){if(e._status===_e||e._status===be){var r=e;r._status=Ee,r._result=t}})),e._status===be){var r=e;r._status=_e,r._result=t}}if(e._status===ge){var n=e._result;return void 0===n&&$("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",n),"default"in n||$("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",n),n.default}throw e._result}function Se(e){return"string"==typeof e||"function"==typeof e||!!(e===o||e===u||P||e===a||e===l||e===f||T||e===y||w||R||k)||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===p||e.$$typeof===i||e.$$typeof===c||e.$$typeof===s||e.$$typeof===he||void 0!==e.getModuleId)}function Oe(){var e=b.current;return null===e&&$("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."),e}he=Symbol.for("react.module.reference");var we,Re,ke,Te,Pe,Le,je,$e=0;function Ne(){}Ne.__reactDisabledLog=!0;var Ie,xe=L.ReactCurrentDispatcher;function Me(e,t,r){if(void 0===Ie)try{throw Error()}catch(e){var n=e.stack.trim().match(/\n( *(at )?)/);Ie=n&&n[1]||""}return"\n"+Ie+e}var De,Ae=!1,Fe="function"==typeof WeakMap?WeakMap:Map;function Ve(e,t){if(!e||Ae)return"";var r,n=De.get(e);if(void 0!==n)return n;Ae=!0;var o,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=xe.current,xe.current=null,function(){if(0===$e){we=console.log,Re=console.info,ke=console.warn,Te=console.error,Pe=console.group,Le=console.groupCollapsed,je=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ne,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}$e++}();try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(u,[])}catch(e){r=e}Reflect.construct(e,[],u)}else{try{u.call()}catch(e){r=e}e.call(u.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),c=r.stack.split("\n"),s=i.length-1,l=c.length-1;s>=1&&l>=0&&i[s]!==c[l];)l--;for(;s>=1&&l>=0;s--,l--)if(i[s]!==c[l]){if(1!==s||1!==l)do{if(s--,--l<0||i[s]!==c[l]){var f="\n"+i[s].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),"function"==typeof e&&De.set(e,f),f}}while(s>=1&&l>=0);break}}}finally{Ae=!1,xe.current=o,function(){if(0==--$e){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:we}),info:D({},e,{value:Re}),warn:D({},e,{value:ke}),error:D({},e,{value:Te}),group:D({},e,{value:Pe}),groupCollapsed:D({},e,{value:Le}),groupEnd:D({},e,{value:je})})}$e<0&&$("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var p=e?e.displayName||e.name:"",d=p?Me(p):"";return"function"==typeof e&&De.set(e,d),d}function Ue(e,t,r){if(null==e)return"";if("function"==typeof e)return Ve(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return Me(e);switch(e){case l:return Me("Suspense");case f:return Me("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case s:return Ve(e.render,!1);case p:return Ue(e.type,t,r);case d:var n=e,o=n._payload,a=n._init;try{return Ue(a(o),t,r)}catch(e){}}return""}De=new Fe;var He,ze={},Be=L.ReactDebugCurrentFrame;function Ye(e){if(e){var t=e._owner,r=Ue(e.type,e._source,t?t.type:null);Be.setExtraStackFrame(r)}else Be.setExtraStackFrame(null)}function Ke(e){if(e){var t=e._owner;O(Ue(e.type,e._source,t?t.type:null))}else O(null)}function qe(){if(E.current){var e=Z(E.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}He=!1;var We={};function Ge(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var r=function(e){var t=qe();if(!t){var r="string"==typeof e?e:e.displayName||e.name;r&&(t="\n\nCheck the top-level render call using <"+r+">.")}return t}(t);if(!We[r]){We[r]=!0;var n="";e&&e._owner&&e._owner!==E.current&&(n=" It was passed a child from "+Z(e._owner.type)+"."),Ke(e),$('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,n),Ke(null)}}}function Xe(e,t){if("object"==typeof e)if(q(e))for(var r=0;r<e.length;r++){var n=e[r];ce(n)&&Ge(n,t)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var o=h(e);if("function"==typeof o&&o!==e.entries)for(var a,u=o.call(e);!(a=u.next()).done;)ce(a.value)&&Ge(a.value,t)}}function Ze(e){var t,r=e.type;if(null!=r&&"string"!=typeof r){if("function"==typeof r)t=r.propTypes;else{if("object"!=typeof r||r.$$typeof!==s&&r.$$typeof!==p)return;t=r.propTypes}if(t){var n=Z(r);!function(e,t,r,n,o){var a=Function.call.bind(te);for(var u in e)if(a(e,u)){var i=void 0;try{if("function"!=typeof e[u]){var c=Error((n||"React class")+": "+r+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}i=e[u](t,u,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){i=e}!i||i instanceof Error||(Ye(o),$("%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",r,u,typeof i),Ye(null)),i instanceof Error&&!(i.message in ze)&&(ze[i.message]=!0,Ye(o),$("Failed %s type: %s",r,i.message),Ye(null))}}(t,e.props,"prop",n,e)}else void 0===r.PropTypes||He||(He=!0,$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Z(r)||"Unknown"));"function"!=typeof r.getDefaultProps||r.getDefaultProps.isReactClassApproved||$("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Je(e,t,n){var a,u,i=Se(e);if(!i){var c,s="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(s+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),s+=(null!=(a=t)&&void 0!==(u=a.__source)?"\n\nCheck your code at "+u.fileName.replace(/^.*[\\\/]/,"")+":"+u.lineNumber+".":"")||qe(),null===e?c="null":q(e)?c="array":void 0!==e&&e.$$typeof===r?(c="<"+(Z(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):c=typeof e,$("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,s)}var l=ue.apply(this,arguments);if(null==l)return l;if(i)for(var f=2;f<arguments.length;f++)Xe(arguments[f],e);return e===o?function(e){for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){Ke(e),$("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),Ke(null);break}}null!==e.ref&&(Ke(e),$("Invalid attribute `ref` supplied to `React.Fragment`."),Ke(null))}(l):Ze(l),l}var Qe=!1,et=!1,tt=null,rt=0,nt=!1;function ot(e){e!==rt-1&&$("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),rt=e}function at(t,r,n){var o=g.current;if(null!==o)try{it(o),function(t){if(null===tt)try{var r=("require"+Math.random()).slice(0,7);tt=(e&&e[r]).call(e,"timers").setImmediate}catch(e){tt=function(e){!1===et&&(et=!0,"undefined"==typeof MessageChannel&&$("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}tt(t)}((function(){0===o.length?(g.current=null,r(t)):at(t,r,n)}))}catch(e){n(e)}else r(t)}var ut=!1;function it(e){if(!ut){ut=!0;var t=0;try{for(;t<e.length;t++){var r=e[t];do{r=r(!0)}while(null!==r)}e.length=0}catch(r){throw e=e.slice(t+1),r}finally{ut=!1}}}var ct=Je,st=function(e,t,r){for(var n=ie.apply(this,arguments),o=2;o<arguments.length;o++)Xe(arguments[o],n.type);return Ze(n),n},lt=function(e){var t=Je.bind(null,e);return t.type=e,Qe||(Qe=!0,j("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return j("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},ft={map:ve,forEach:function(e,t,r){ve(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return ve(e,(function(){t++})),t},toArray:function(e){return ve(e,(function(e){return e}))||[]},only:function(e){if(!ce(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}};t.Children=ft,t.Component=F,t.Fragment=o,t.Profiler=u,t.PureComponent=B,t.StrictMode=a,t.Suspense=l,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L,t.cloneElement=st,t.createContext=function(e){var t={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};t.Provider={$$typeof:i,_context:t};var r=!1,n=!1,o=!1,a={$$typeof:c,_context:t};return Object.defineProperties(a,{Provider:{get:function(){return n||(n=!0,$("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),t.Provider},set:function(e){t.Provider=e}},_currentValue:{get:function(){return t._currentValue},set:function(e){t._currentValue=e}},_currentValue2:{get:function(){return t._currentValue2},set:function(e){t._currentValue2=e}},_threadCount:{get:function(){return t._threadCount},set:function(e){t._threadCount=e}},Consumer:{get:function(){return r||(r=!0,$("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),t.Consumer}},displayName:{get:function(){return t.displayName},set:function(e){o||(j("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e),o=!0)}}}),t.Consumer=a,t._currentRenderer=null,t._currentRenderer2=null,t},t.createElement=ct,t.createFactory=lt,t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){null!=e&&e.$$typeof===p?$("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?$("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&$("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||$("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"));var t,r={$$typeof:s,render:e};return Object.defineProperty(r,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(r){t=r,e.name||e.displayName||(e.displayName=r)}}),r},t.isValidElement=ce,t.lazy=function(e){var t,r,n={$$typeof:d,_payload:{_status:be,_result:e},_init:Ce};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){$("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){$("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},t.memo=function(e,t){Se(e)||$("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e);var r,n={$$typeof:p,type:e,compare:void 0===t?null:t};return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return r},set:function(t){r=t,e.name||e.displayName||(e.displayName=t)}}),n},t.startTransition=function(e,t){var r=_.transition;_.transition={};var n=_.transition;_.transition._updatedFibers=new Set;try{e()}finally{_.transition=r,null===r&&n._updatedFibers&&(n._updatedFibers.size>10&&j("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),n._updatedFibers.clear())}},t.unstable_act=function(e){var t=rt;rt++,null===g.current&&(g.current=[]);var r,n=g.isBatchingLegacy;try{if(g.isBatchingLegacy=!0,r=e(),!n&&g.didScheduleLegacyUpdate){var o=g.current;null!==o&&(g.didScheduleLegacyUpdate=!1,it(o))}}catch(e){throw ot(t),e}finally{g.isBatchingLegacy=n}if(null!==r&&"object"==typeof r&&"function"==typeof r.then){var a=r,u=!1,i={then:function(e,r){u=!0,a.then((function(n){ot(t),0===rt?at(n,e,r):e(n)}),(function(e){ot(t),r(e)}))}};return nt||"undefined"==typeof Promise||Promise.resolve().then((function(){})).then((function(){u||(nt=!0,$("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))})),i}var c=r;if(ot(t),0===rt){var s=g.current;return null!==s&&(it(s),g.current=null),{then:function(e,t){null===g.current?(g.current=[],at(c,e,t)):e(c)}}}return{then:function(e,t){e(c)}}},t.useCallback=function(e,t){return Oe().useCallback(e,t)},t.useContext=function(e){var t=Oe();if(void 0!==e._context){var r=e._context;r.Consumer===e?$("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&$("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return t.useContext(e)},t.useDebugValue=function(e,t){return Oe().useDebugValue(e,t)},t.useDeferredValue=function(e){return Oe().useDeferredValue(e)},t.useEffect=function(e,t){return Oe().useEffect(e,t)},t.useId=function(){return Oe().useId()},t.useImperativeHandle=function(e,t,r){return Oe().useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return Oe().useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return Oe().useLayoutEffect(e,t)},t.useMemo=function(e,t){return Oe().useMemo(e,t)},t.useReducer=function(e,t,r){return Oe().useReducer(e,t,r)},t.useRef=function(e){return Oe().useRef(e)},t.useState=function(e){return Oe().useState(e)},t.useSyncExternalStore=function(e,t,r){return Oe().useSyncExternalStore(e,t,r)},t.useTransition=function(){return Oe().useTransition()},t.version="18.2.0","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()}(s,s.exports)),s.exports);var l=u.exports,f=o(l);const p=f.createContext(null);p.displayName="TableContext";var d=(e,t)=>Object.prototype.toString.call(e)===`[object ${t}]`;var y=e=>"function"==typeof e;var m=e=>null==e;var v=e=>"object"==typeof e&&null!==e;var h=function(e){if(!v(e)||!d(e,"Object"))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t};var b=function(e){const t=typeof e;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===t:"string"===t||d(e,"String")};var _=e=>Array.isArray?Array.isArray(e):d(e,"Array");function g(e,t){if(!e||!h(e))return e;const r={};return Object.keys(e).forEach((n=>{const o=e[n];let a=!1;t.forEach((e=>{(b(e)&&e===n||e instanceof RegExp&&n.match(e))&&(a=!0)})),a||(r[n]=o)})),r}function E(e){return Object.prototype.toString.call(e)}function C(e){return Object.keys(e)}function S(e,t,r){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(null==e||null==t)return!1;if(Number.isNaN(e)&&Number.isNaN(t))return!0;if(E(e)!==E(t))return!1;if(y(e))return!!(null==r?void 0:r.skipFunction);if("object"!=typeof e)return!1;if(_(e)){if(e.length!==t.length)return!1;for(let n=e.length-1;n>=0;n--)if(!S(e[n],t[n],r))return!1;return!0}if(!h(e))return!1;const n=C(e),o=C(t);if(n.length!==o.length)return!1;n.sort(),o.sort();for(let e=n.length-1;e>=0;e--)if(n[e]!=o[e])return!1;for(let o=n.length-1;o>=0;o--){const a=n[o];if(!S(e[a],t[a],r))return!1}return!0}var O,w={exports:{}},R={};var k,T={};
|
|
11
11
|
/**
|
|
12
12
|
* @license React
|
|
13
13
|
* react-is.development.js
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
*
|
|
17
17
|
* This source code is licensed under the MIT license found in the
|
|
18
18
|
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/"production"===process.env.NODE_ENV?w.exports=function(){if(O)return R;O=1;var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.server_context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen");function m(e){if("object"==typeof e&&null!==e){var y=e.$$typeof;switch(y){case t:switch(e=e.type){case n:case a:case o:case l:case f:return e;default:switch(e=e&&e.$$typeof){case c:case i:case s:case d:case p:case u:return e;default:return y}}case r:return y}}}return e=Symbol.for("react.module.reference"),R.ContextConsumer=i,R.ContextProvider=u,R.Element=t,R.ForwardRef=s,R.Fragment=n,R.Lazy=d,R.Memo=p,R.Portal=r,R.Profiler=a,R.StrictMode=o,R.Suspense=l,R.SuspenseList=f,R.isAsyncMode=function(){return!1},R.isConcurrentMode=function(){return!1},R.isContextConsumer=function(e){return m(e)===i},R.isContextProvider=function(e){return m(e)===u},R.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},R.isForwardRef=function(e){return m(e)===s},R.isFragment=function(e){return m(e)===n},R.isLazy=function(e){return m(e)===d},R.isMemo=function(e){return m(e)===p},R.isPortal=function(e){return m(e)===r},R.isProfiler=function(e){return m(e)===a},R.isStrictMode=function(e){return m(e)===o},R.isSuspense=function(e){return m(e)===l},R.isSuspenseList=function(e){return m(e)===f},R.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===a||t===o||t===l||t===f||t===y||"object"==typeof t&&null!==t&&(t.$$typeof===d||t.$$typeof===p||t.$$typeof===u||t.$$typeof===i||t.$$typeof===s||t.$$typeof===e||void 0!==t.getModuleId)},R.typeOf=m,R}():w.exports=(k||(k=1,"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.server_context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen");function m(e){if("object"==typeof e&&null!==e){var y=e.$$typeof;switch(y){case t:var m=e.type;switch(m){case n:case a:case o:case l:case f:return m;default:var h=m&&m.$$typeof;switch(h){case c:case i:case s:case d:case p:case u:return h;default:return y}}case r:return y}}}e=Symbol.for("react.module.reference");var h=i,v=u,b=t,_=s,g=n,E=d,C=p,S=r,O=a,w=o,R=l,k=f,P=!1,L=!1;T.ContextConsumer=h,T.ContextProvider=v,T.Element=b,T.ForwardRef=_,T.Fragment=g,T.Lazy=E,T.Memo=C,T.Portal=S,T.Profiler=O,T.StrictMode=w,T.Suspense=R,T.SuspenseList=k,T.isAsyncMode=function(e){return P||(P=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},T.isConcurrentMode=function(e){return L||(L=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},T.isContextConsumer=function(e){return m(e)===i},T.isContextProvider=function(e){return m(e)===u},T.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},T.isForwardRef=function(e){return m(e)===s},T.isFragment=function(e){return m(e)===n},T.isLazy=function(e){return m(e)===d},T.isMemo=function(e){return m(e)===p},T.isPortal=function(e){return m(e)===r},T.isProfiler=function(e){return m(e)===a},T.isStrictMode=function(e){return m(e)===o},T.isSuspense=function(e){return m(e)===l},T.isSuspenseList=function(e){return m(e)===f},T.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===a||t===o||t===l||t===f||t===y||"object"==typeof t&&null!==t&&(t.$$typeof===d||t.$$typeof===p||t.$$typeof===u||t.$$typeof===i||t.$$typeof===s||t.$$typeof===e||void 0!==t.getModuleId)},T.typeOf=m}()),T);var P=w.exports;let L=0;const j=e=>e?`${e}-${L++}`:""+L++,$=e=>{let t=[];return f.Children.forEach(e,(e=>{m(e)||(P.isFragment(e)?t=t.concat($(e.props.children)):t.push(e))})),t},x={...t.ListTable.EVENT_TYPE,...t.PivotTable.EVENT_TYPE,...t.PivotChart.EVENT_TYPE},I={onClickCell:x.CLICK_CELL,onDblClickCell:x.DBLCLICK_CELL,onMouseDownCell:x.MOUSEDOWN_CELL,onMouseUpCell:x.MOUSEUP_CELL,onSelectedCell:x.SELECTED_CELL,onKeyDown:x.KEYDOWN,onMouseEnterTable:x.MOUSEENTER_TABLE,onMouseLeaveTable:x.MOUSELEAVE_TABLE,onMouseMoveCell:x.MOUSEMOVE_CELL,onMouseEnterCell:x.MOUSEENTER_CELL,onMouseLeaveCell:x.MOUSELEAVE_CELL,onContextMenuCell:x.CONTEXTMENU_CELL,onResizeColumn:x.RESIZE_COLUMN,onResizeColumnEnd:x.RESIZE_COLUMN_END,onChangeHeaderPosition:x.CHANGE_HEADER_POSITION,onSortClick:x.SORT_CLICK,onFreezeClick:x.FREEZE_CLICK,onScroll:x.SCROLL,onDropdownMenuClick:x.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:x.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:x.DRAG_SELECT_END,onDropdownIconClick:x.DROPDOWN_ICON_CLICK,onDropdownMenuClear:x.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:x.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:x.SHOW_MENU,onHideMenu:x.HIDE_MENU,onIconClick:x.ICON_CLICK,onLegendItemClick:x.LEGEND_ITEM_CLICK,onLegendItemHover:x.LEGEND_ITEM_HOVER,onLegendItemUnHover:x.LEGEND_ITEM_UNHOVER,onLegendChange:x.LEGEND_CHANGE,onMouseEnterAxis:x.MOUSEENTER_AXIS,onMouseLeaveAxis:x.MOUSELEAVE_AXIS,onCheckboxStateChange:x.CHECKBOX_STATE_CHANGE,onAfterRender:x.AFTER_RENDER,onInitialized:x.INITIALIZED,onPivotSortClick:x.PIVOT_SORT_CLICK,onDrillMenuClick:x.DRILLMENU_CLICK,onVChartEventType:x.VCHART_EVENT_TYPE},M=Object.keys(I),N=(e,t=I)=>{const r={};return Object.keys(e).forEach((n=>{t[n]&&(r[n]=e[n])})),r},D=(e,t,r,n=I)=>{if(!t&&!r||!e)return!1;const o=r?N(r,n):null,a=t?N(t,n):null;return o&&Object.keys(o).forEach((t=>{a&&a[t]&&a[t]===o[t]||e.off(n[t],r[t])})),a&&Object.keys(a).forEach((t=>{o&&o[t]&&o[t]===a[t]||e.on(n[t],a[t])})),!0},A=["children","hooks","ref",...M,"skipFunctionDiff","onError","onReady","option","records","container"],F=f.forwardRef(((e,t)=>{const[r,o]=l.useState(0),a=l.useRef({optionFromChildren:{}});l.useImperativeHandle(t,(()=>a.current.table));const u=!!e.option,i=!!e.records,c=l.useRef(!1),s=l.useRef(g(e,A)),d=l.useRef(e.records),y=f.useRef(null),m=!!e.skipFunctionDiff,h=l.useCallback((e=>u&&e.option?i&&e.records?{...e.option,records:e.records}:e.option:{records:e.records,...s.current,...a.current.optionFromChildren}),[u,i]),v=l.useCallback((e=>{let t;t="pivot-table"===e.type?new n.PivotTable(e.container,h(e)):"pivot-chart"===e.type?new n.PivotChart(e.container,h(e)):new n.ListTable(e.container,h(e)),a.current={...a.current,table:t}}),[h]),b=l.useCallback((()=>{D(a.current.table,e,y.current,I),c.current||(o(r+1),e.onReady&&e.onReady(a.current.table,0===r))}),[r,o,e]),_=l.useCallback((()=>{if(a.current.table){const t=a.current.table.renderAsync().then(b);e.onError&&t.catch(e.onError)}}),[b,e]);return l.useEffect((()=>{if(!a.current?.table)return v(e),_(),D(a.current.table,e,null,I),a.current={...a.current,isChildrenUpdated:!1},void(y.current=e);if(u){if(S(y.current.option,e.option,{skipFunction:m})){if(i&&!S(y.current.records,e.records,{skipFunction:m})){y.current=e,a.current.table.setRecords(e.records);const t=a.current.table.renderAsync().then(b);e.onError&&t.catch(e.onError)}}else{y.current=e,a.current.table.updateOption(h(e));const t=a.current.table.renderAsync().then(b);e.onError&&t.catch(e.onError)}return}const t=g(e,A);if(!S(t,s.current,{skipFunction:m})||a.current.isChildrenUpdated){s.current=t,a.current.table.updateOption(h(e));const r=a.current.table.renderAsync().then(b);e.onError&&r.catch(e.onError)}else if(i&&!S(e.records,d.current,{skipFunction:m})){d.current=e.records,a.current.table.setRecords(e.records);const t=a.current.table.renderAsync().then(b);e.onError&&t.catch(e.onError)}a.current={...a.current,isChildrenUpdated:!1}}),[v,u,i,h,b,_,m,e]),l.useEffect((()=>()=>{a&&(a.current.table&&a.current.table.release(),a.current=null),c.current=!0}),[]),f.createElement(p.Provider,{value:a.current},$(e.children).map(((e,t)=>f.createElement(f.Fragment,{key:e?.props?.id??e?.id??`child-${t}`},f.cloneElement(e,{updateId:r})))))})),U=(e,t,r)=>{const n=function(e,t="TableContainer",r){const n=f.forwardRef(((t,n)=>{const o=l.useRef(),[a,u]=l.useState(!1),{className:i,style:c,width:s,...p}=t;return l.useLayoutEffect((()=>{u(!0)}),[]),f.createElement("div",{ref:o,className:i,style:{position:"relative",height:t.height||"100%",width:t.width||"100%",...c}},a?f.createElement(e,{ref:n,container:o.current,...r?r(p):p}):f.createElement(f.Fragment,null))}));return n.displayName=t||e.name,n}(F,e,(e=>(e.type=t,r?r(e):t?{...e,type:t}:e)));return n.displayName=e,n},V=U("ListTable","list-table"),H=U("PivotTable","pivot-table"),z=U("PivotChart","pivot-chart");const B=(e,t,r,n)=>{const o=["id","updateId"],a=r?Object.keys(r).concat(o):o,u=e=>{const o=l.useContext(p),u=f.useRef(m(e.id)?j(t):e.id),i=f.useRef(null),c=f.useRef(e.updateId),s=f.useRef();if(e.updateId!==c.current){c.current=e.updateId;!!r&&D(o.table,e,i.current,r)&&(i.current=e)}else{const r=g(e,a);S(r,s.current)||(s.current=r,Y(o,u.current,t,n,r))}return l.useEffect((()=>()=>{r&&D(o.table,null,i.current,r),K(o,u.current,t,n)}),[]),null};return u.displayName=e,u},Y=(e,t,r,n,o)=>{if(e.optionFromChildren){if(n)e.optionFromChildren[r]={...o};else{e.optionFromChildren[r]||(e.optionFromChildren[r]=[]);const n=e.optionFromChildren[r],a=n.findIndex((e=>e.id===t));a>=0?n[a]={id:t,...o}:e.optionFromChildren[r].push({id:t,...o})}e.isChildrenUpdated=!0}},K=(e,t,r,n)=>{if(e.optionFromChildren)if(n)e.optionFromChildren[r]=null;else{const n=e.optionFromChildren[r]??[],o=n.findIndex((e=>e.id===t));if(o>=0){const t=n.slice(0,o-1).concat(n.slice(o+1));e.optionFromChildren[r]=t,e.isChildrenUpdated=!0}}},q=B("ListColumn","columns"),W=B("PivotColumnDimension","columns"),G=B("PivotRowDimension","rows"),X=B("PivotIndicator","indicators"),Z=B("PivotColumnHeaderTitle","columnHeaderTitle",void 0,!0),J=B("PivotRowHeaderTitle","rowHeaderTitle",void 0,!0),Q=B("PivotCorner","corner",void 0,!0),ee=B("Menu","menu",void 0,!0),te=B("Tooltip","tooltip",void 0,!0);e.VTable=n,e.ListColumn=q,e.ListTable=V,e.Menu=ee,e.PivotChart=z,e.PivotColumnDimension=W,e.PivotColumnHeaderTitle=Z,e.PivotCorner=Q,e.PivotIndicator=X,e.PivotRowDimension=G,e.PivotRowHeaderTitle=J,e.PivotTable=H,e.Tooltip=te,e.registerChartModule=function(e,t){n.register.chartModule(e,t)}}));
|
|
19
|
+
*/"production"===process.env.NODE_ENV?w.exports=function(){if(O)return R;O=1;var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.server_context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen");function m(e){if("object"==typeof e&&null!==e){var y=e.$$typeof;switch(y){case t:switch(e=e.type){case n:case a:case o:case l:case f:return e;default:switch(e=e&&e.$$typeof){case c:case i:case s:case d:case p:case u:return e;default:return y}}case r:return y}}}return e=Symbol.for("react.module.reference"),R.ContextConsumer=i,R.ContextProvider=u,R.Element=t,R.ForwardRef=s,R.Fragment=n,R.Lazy=d,R.Memo=p,R.Portal=r,R.Profiler=a,R.StrictMode=o,R.Suspense=l,R.SuspenseList=f,R.isAsyncMode=function(){return!1},R.isConcurrentMode=function(){return!1},R.isContextConsumer=function(e){return m(e)===i},R.isContextProvider=function(e){return m(e)===u},R.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},R.isForwardRef=function(e){return m(e)===s},R.isFragment=function(e){return m(e)===n},R.isLazy=function(e){return m(e)===d},R.isMemo=function(e){return m(e)===p},R.isPortal=function(e){return m(e)===r},R.isProfiler=function(e){return m(e)===a},R.isStrictMode=function(e){return m(e)===o},R.isSuspense=function(e){return m(e)===l},R.isSuspenseList=function(e){return m(e)===f},R.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===a||t===o||t===l||t===f||t===y||"object"==typeof t&&null!==t&&(t.$$typeof===d||t.$$typeof===p||t.$$typeof===u||t.$$typeof===i||t.$$typeof===s||t.$$typeof===e||void 0!==t.getModuleId)},R.typeOf=m,R}():w.exports=(k||(k=1,"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.server_context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen");function m(e){if("object"==typeof e&&null!==e){var y=e.$$typeof;switch(y){case t:var m=e.type;switch(m){case n:case a:case o:case l:case f:return m;default:var v=m&&m.$$typeof;switch(v){case c:case i:case s:case d:case p:case u:return v;default:return y}}case r:return y}}}e=Symbol.for("react.module.reference");var v=i,h=u,b=t,_=s,g=n,E=d,C=p,S=r,O=a,w=o,R=l,k=f,P=!1,L=!1;T.ContextConsumer=v,T.ContextProvider=h,T.Element=b,T.ForwardRef=_,T.Fragment=g,T.Lazy=E,T.Memo=C,T.Portal=S,T.Profiler=O,T.StrictMode=w,T.Suspense=R,T.SuspenseList=k,T.isAsyncMode=function(e){return P||(P=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},T.isConcurrentMode=function(e){return L||(L=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},T.isContextConsumer=function(e){return m(e)===i},T.isContextProvider=function(e){return m(e)===u},T.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},T.isForwardRef=function(e){return m(e)===s},T.isFragment=function(e){return m(e)===n},T.isLazy=function(e){return m(e)===d},T.isMemo=function(e){return m(e)===p},T.isPortal=function(e){return m(e)===r},T.isProfiler=function(e){return m(e)===a},T.isStrictMode=function(e){return m(e)===o},T.isSuspense=function(e){return m(e)===l},T.isSuspenseList=function(e){return m(e)===f},T.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===a||t===o||t===l||t===f||t===y||"object"==typeof t&&null!==t&&(t.$$typeof===d||t.$$typeof===p||t.$$typeof===u||t.$$typeof===i||t.$$typeof===s||t.$$typeof===e||void 0!==t.getModuleId)},T.typeOf=m}()),T);var P=w.exports;const L=e=>{let t=[];return f.Children.forEach(e,(e=>{m(e)||(P.isFragment(e)?t=t.concat(L(e.props.children)):t.push(e))})),t},j={...t.ListTable.EVENT_TYPE,...t.PivotTable.EVENT_TYPE,...t.PivotChart.EVENT_TYPE},$={onClickCell:j.CLICK_CELL,onDblClickCell:j.DBLCLICK_CELL,onMouseDownCell:j.MOUSEDOWN_CELL,onMouseUpCell:j.MOUSEUP_CELL,onSelectedCell:j.SELECTED_CELL,onKeyDown:j.KEYDOWN,onMouseEnterTable:j.MOUSEENTER_TABLE,onMouseLeaveTable:j.MOUSELEAVE_TABLE,onMouseMoveCell:j.MOUSEMOVE_CELL,onMouseEnterCell:j.MOUSEENTER_CELL,onMouseLeaveCell:j.MOUSELEAVE_CELL,onContextMenuCell:j.CONTEXTMENU_CELL,onResizeColumn:j.RESIZE_COLUMN,onResizeColumnEnd:j.RESIZE_COLUMN_END,onChangeHeaderPosition:j.CHANGE_HEADER_POSITION,onSortClick:j.SORT_CLICK,onFreezeClick:j.FREEZE_CLICK,onScroll:j.SCROLL,onDropdownMenuClick:j.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:j.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:j.DRAG_SELECT_END,onDropdownIconClick:j.DROPDOWN_ICON_CLICK,onDropdownMenuClear:j.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:j.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:j.SHOW_MENU,onHideMenu:j.HIDE_MENU,onIconClick:j.ICON_CLICK,onLegendItemClick:j.LEGEND_ITEM_CLICK,onLegendItemHover:j.LEGEND_ITEM_HOVER,onLegendItemUnHover:j.LEGEND_ITEM_UNHOVER,onLegendChange:j.LEGEND_CHANGE,onMouseEnterAxis:j.MOUSEENTER_AXIS,onMouseLeaveAxis:j.MOUSELEAVE_AXIS,onCheckboxStateChange:j.CHECKBOX_STATE_CHANGE,onAfterRender:j.AFTER_RENDER,onInitialized:j.INITIALIZED,onPivotSortClick:j.PIVOT_SORT_CLICK,onDrillMenuClick:j.DRILLMENU_CLICK,onVChartEventType:j.VCHART_EVENT_TYPE},N=Object.keys($),I=(e,t=$)=>{const r={};return Object.keys(e).forEach((n=>{t[n]&&(r[n]=e[n])})),r},x=(e,t,r,n=$)=>{if(!t&&!r||!e)return!1;const o=r?I(r,n):null,a=t?I(t,n):null;return o&&Object.keys(o).forEach((t=>{a&&a[t]&&a[t]===o[t]||e.off(n[t],r[t])})),a&&Object.keys(a).forEach((t=>{o&&o[t]&&o[t]===a[t]||e.on(n[t],a[t])})),!0},M=["children","hooks","ref",...N,"skipFunctionDiff","onError","onReady","option","records","container"],D=f.forwardRef(((e,t)=>{const[r,o]=l.useState(0),a=l.useRef({});l.useImperativeHandle(t,(()=>a.current?.table));const u=!!e.option,i=!!e.records,c=l.useRef(!1),s=l.useRef(g(e,M)),d=l.useRef(null),y=l.useRef(e.records),m=f.useRef(null),v=!!e.skipFunctionDiff,h=l.useCallback((e=>u&&e.option?i&&e.records?{...e.option,records:e.records}:e.option:{records:e.records,...s.current,...d.current}),[u,i]),b=l.useCallback((e=>{let t;t="pivot-table"===e.type?new n.PivotTable(e.container,h(e)):"pivot-chart"===e.type?new n.PivotChart(e.container,h(e)):new n.ListTable(e.container,h(e)),a.current={...a.current,table:t}}),[h]),_=l.useCallback((()=>{if(!c.current){if(!a.current||!a.current.table)return;x(a.current.table,e,m.current,$),o(r+1),e.onReady&&e.onReady(a.current.table,0===r)}}),[r,o,e]),E=l.useCallback((()=>{a.current.table&&(a.current.table.render(),_())}),[_]);return l.useEffect((()=>{const t=u?null:(e=>{const t={};return L(e.children).map((e=>{const r=e&&e.type&&e.type.parseOption;if(r&&e.props){const n=r(e.props);n.isSingle?t[n.optionName]=n.option:(t[n.optionName]||(t[n.optionName]=[]),t[n.optionName].push(n.option))}})),t})(e);if(!a.current?.table)return u||(d.current=t),b(e),E(),x(a.current.table,e,null,$),void(m.current=e);if(u)return void(S(m.current.option,e.option,{skipFunction:v})?i&&!S(m.current.records,e.records,{skipFunction:v})&&(m.current=e,a.current.table.setRecords(e.records),_()):(m.current=e,a.current.table.updateOption(h(e)),_()));const r=g(e,M);S(r,s.current,{skipFunction:v})&&S(t,d.current)?i&&!S(e.records,y.current,{skipFunction:v})&&(y.current=e.records,a.current.table.setRecords(e.records),_()):(s.current=r,d.current=t,a.current.table.updateOption(h(e)),_())}),[b,u,i,h,_,E,v,e]),l.useEffect((()=>()=>{a&&a.current&&a.current.table&&(a.current.table.release(),a.current=null),c.current=!0}),[]),f.createElement(p.Provider,{value:a.current},L(e.children).map(((e,t)=>{if("string"==typeof e)return;const n=`${e&&e.type&&(e.type.displayName||e.type.name)}-${t}`;return f.createElement(f.Fragment,{key:n},f.cloneElement(e,{updateId:r,componentId:n}))})))})),A=(e,t,r)=>{const n=function(e,t="TableContainer",r){const n=f.forwardRef(((t,n)=>{const o=l.useRef(),[a,u]=l.useState(!1),{className:i,style:c,width:s,...p}=t;return l.useLayoutEffect((()=>{u(!0)}),[]),f.createElement("div",{ref:o,className:i,style:{position:"relative",height:t.height||"100%",width:t.width||"100%",...c}},a?f.createElement(e,{ref:n,container:o.current,...r?r(p):p}):f.createElement(f.Fragment,null))}));return n.displayName=t||e.name,n}(D,e,(e=>(e.type=t,r?r(e):t?{...e,type:t}:e)));return n.displayName=e,n},F=A("ListTable","list-table"),V=A("PivotTable","pivot-table"),U=A("PivotChart","pivot-chart");const H=(e,t,r,n)=>{const o=["id","updateId","componentId"],a=r?Object.keys(r).concat(o):o,u=e=>{const t=l.useContext(p),n=f.useRef(null),o=f.useRef(e.updateId);if(e.updateId!==o.current){o.current=e.updateId;!!r&&x(t.table,e,n.current,r)&&(n.current=e)}return l.useEffect((()=>()=>{r&&x(t.table,null,n.current,r)}),[]),null};return u.displayName=e,u.parseOption=e=>({option:g(e,a),optionName:t,isSingle:n}),u},z=H("ListColumn","columns"),B=H("PivotColumnDimension","columns"),Y=H("PivotRowDimension","rows"),K=H("PivotIndicator","indicators"),q=H("PivotColumnHeaderTitle","columnHeaderTitle",void 0,!0),W=H("PivotRowHeaderTitle","rowHeaderTitle",void 0,!0),G=H("PivotCorner","corner",void 0,!0),X=H("Menu","menu",void 0,!0),Z=H("Tooltip","tooltip",void 0,!0);e.VTable=n,e.ListColumn=z,e.ListTable=F,e.Menu=X,e.PivotChart=U,e.PivotColumnDimension=B,e.PivotColumnHeaderTitle=q,e.PivotCorner=G,e.PivotIndicator=K,e.PivotRowDimension=Y,e.PivotRowHeaderTitle=W,e.PivotTable=V,e.Tooltip=Z,e.registerChartModule=function(e,t){n.register.chartModule(e,t)}}));
|
|
@@ -4,6 +4,7 @@ export interface BaseComponentProps {
|
|
|
4
4
|
}
|
|
5
5
|
type ComponentProps = BaseComponentProps & {
|
|
6
6
|
updateId?: number;
|
|
7
|
+
componentId?: number;
|
|
7
8
|
};
|
|
8
9
|
export declare const createComponent: <T extends ComponentProps>(componentName: string, optionName: string, supportedEvents?: Record<string, string> | null, isSingle?: boolean) => React.FC<T>;
|
|
9
10
|
export {};
|
|
@@ -1,53 +1,26 @@
|
|
|
1
1
|
import React, { useContext, useEffect } from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { pickWithout } from "@visactor/vutils";
|
|
4
4
|
|
|
5
5
|
import RootTableContext from "../context/table";
|
|
6
6
|
|
|
7
7
|
import { bindEventsToTable } from "../eventsUtils";
|
|
8
8
|
|
|
9
|
-
import { uid } from "../util";
|
|
10
|
-
|
|
11
9
|
export const createComponent = (componentName, optionName, supportedEvents, isSingle) => {
|
|
12
|
-
const ignoreKeys = [ "id", "updateId" ], notOptionKeys = supportedEvents ? Object.keys(supportedEvents).concat(ignoreKeys) : ignoreKeys, Comp = props => {
|
|
13
|
-
const context = useContext(RootTableContext),
|
|
10
|
+
const ignoreKeys = [ "id", "updateId", "componentId" ], notOptionKeys = supportedEvents ? Object.keys(supportedEvents).concat(ignoreKeys) : ignoreKeys, Comp = props => {
|
|
11
|
+
const context = useContext(RootTableContext), eventsBinded = React.useRef(null), updateId = React.useRef(props.updateId);
|
|
14
12
|
if (props.updateId !== updateId.current) {
|
|
15
13
|
updateId.current = props.updateId;
|
|
16
14
|
!!supportedEvents && bindEventsToTable(context.table, props, eventsBinded.current, supportedEvents) && (eventsBinded.current = props);
|
|
17
|
-
} else {
|
|
18
|
-
const newComponentOption = pickWithout(props, notOptionKeys);
|
|
19
|
-
isEqual(newComponentOption, componentOption.current) || (componentOption.current = newComponentOption,
|
|
20
|
-
updateToContext(context, id.current, optionName, isSingle, newComponentOption));
|
|
21
15
|
}
|
|
22
16
|
return useEffect((() => () => {
|
|
23
|
-
supportedEvents && bindEventsToTable(context.table, null, eventsBinded.current, supportedEvents)
|
|
24
|
-
deleteToContext(context, id.current, optionName, isSingle);
|
|
17
|
+
supportedEvents && bindEventsToTable(context.table, null, eventsBinded.current, supportedEvents);
|
|
25
18
|
}), []), null;
|
|
26
19
|
};
|
|
27
|
-
return Comp.displayName = componentName, Comp
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (isSingle) context.optionFromChildren[optionName] = Object.assign({}, props); else {
|
|
33
|
-
context.optionFromChildren[optionName] || (context.optionFromChildren[optionName] = []);
|
|
34
|
-
const comps = context.optionFromChildren[optionName], index = comps.findIndex((entry => entry.id === id));
|
|
35
|
-
index >= 0 ? comps[index] = Object.assign({
|
|
36
|
-
id: id
|
|
37
|
-
}, props) : context.optionFromChildren[optionName].push(Object.assign({
|
|
38
|
-
id: id
|
|
39
|
-
}, props));
|
|
40
|
-
}
|
|
41
|
-
context.isChildrenUpdated = !0;
|
|
42
|
-
}
|
|
43
|
-
}, deleteToContext = (context, id, optionName, isSingle) => {
|
|
44
|
-
var _a;
|
|
45
|
-
if (context.optionFromChildren) if (isSingle) context.optionFromChildren[optionName] = null; else {
|
|
46
|
-
const comps = null !== (_a = context.optionFromChildren[optionName]) && void 0 !== _a ? _a : [], index = comps.findIndex((entry => entry.id === id));
|
|
47
|
-
if (index >= 0) {
|
|
48
|
-
const newComps = comps.slice(0, index - 1).concat(comps.slice(index + 1));
|
|
49
|
-
context.optionFromChildren[optionName] = newComps, context.isChildrenUpdated = !0;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
20
|
+
return Comp.displayName = componentName, Comp.parseOption = props => ({
|
|
21
|
+
option: pickWithout(props, notOptionKeys),
|
|
22
|
+
optionName: optionName,
|
|
23
|
+
isSingle: isSingle
|
|
24
|
+
}), Comp;
|
|
52
25
|
};
|
|
53
26
|
//# sourceMappingURL=base-component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/base-component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,
|
|
1
|
+
{"version":3,"sources":["components/base-component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAkB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/D,OAAO,gBAAgB,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AASnD,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,aAAqB,EACrB,UAAkB,EAClB,eAA+C,EAC/C,QAAkB,EAClB,EAAE;IACF,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IACrD,MAAM,aAAa,GAAG,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IAErG,MAAM,IAAI,GAAgB,CAAC,KAAQ,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;QAG7C,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAI,IAAI,CAAC,CAAC;QAC3C,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAS,KAAK,CAAC,QAAQ,CAAC,CAAC;QAGtD,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,CAAC,OAAO,EAAE;YAEvC,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC;YAGlC,MAAM,mBAAmB,GAAG,eAAe;gBACzC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,OAAO,EAAE,eAAe,CAAC;gBAChF,CAAC,CAAC,KAAK,CAAC;YACV,IAAI,mBAAmB,EAAE;gBACvB,YAAY,CAAC,OAAO,GAAG,KAAK,CAAC;aAC9B;SAQF;QAED,SAAS,CAAC,GAAG,EAAE;YACb,OAAO,GAAG,EAAE;gBACV,IAAI,eAAe,EAAE;oBACnB,iBAAiB,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;iBAC/E;YAEH,CAAC,CAAC;QACJ,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,IAAI,CAAC,WAAW,GAAG,aAAa,CAAC;IAEhC,IAAY,CAAC,WAAW,GAAG,CAAC,KAAsD,EAAE,EAAE;QACrF,MAAM,kBAAkB,GAAe,WAAW,CAAI,KAAK,EAAE,aAAa,CAAC,CAAC;QAE5E,OAAO;YACL,MAAM,EAAE,kBAAkB;YAC1B,UAAU;YACV,QAAQ;SACT,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","file":"base-component.js","sourcesContent":["import React, { useContext, useEffect } from 'react';\nimport { isEqual, isNil, pickWithout } from '@visactor/vutils';\n\nimport type { TableContextType } from '../context/table';\nimport RootTableContext from '../context/table';\nimport { bindEventsToTable } from '../eventsUtils';\nimport { uid } from '../util';\n\nexport interface BaseComponentProps {\n id?: string | number;\n}\n\ntype ComponentProps = BaseComponentProps & { updateId?: number; componentId?: number };\n\nexport const createComponent = <T extends ComponentProps>(\n componentName: string,\n optionName: string,\n supportedEvents?: Record<string, string> | null,\n isSingle?: boolean\n) => {\n const ignoreKeys = ['id', 'updateId', 'componentId'];\n const notOptionKeys = supportedEvents ? Object.keys(supportedEvents).concat(ignoreKeys) : ignoreKeys;\n\n const Comp: React.FC<T> = (props: T) => {\n const context = useContext(RootTableContext);\n // const id = React.useRef<string | number>(isNil(props.id) ? uid(optionName) : props.id);\n\n const eventsBinded = React.useRef<T>(null);\n const updateId = React.useRef<number>(props.updateId);\n // const componentOption = React.useRef<Partial<T>>();\n\n if (props.updateId !== updateId.current) {\n // update triggered by table when table is rendered\n updateId.current = props.updateId;\n\n // rebind events after table render\n const hasPrevEventsBinded = supportedEvents\n ? bindEventsToTable(context.table, props, eventsBinded.current, supportedEvents)\n : false;\n if (hasPrevEventsBinded) {\n eventsBinded.current = props;\n }\n // } else {\n // const newComponentOption: Partial<T> = pickWithout<T>(props, notOptionKeys);\n\n // if (!isEqual(newComponentOption, componentOption.current)) {\n // componentOption.current = newComponentOption;\n // updateToContext(context, id.current, optionName, isSingle, newComponentOption);\n // }\n }\n\n useEffect(() => {\n return () => {\n if (supportedEvents) {\n bindEventsToTable(context.table, null, eventsBinded.current, supportedEvents);\n }\n // deleteToContext(context, id.current, optionName, isSingle);\n };\n }, []);\n\n return null;\n };\n\n Comp.displayName = componentName;\n\n (Comp as any).parseOption = (props: T & { updateId?: number; componentId?: string }) => {\n const newComponentOption: Partial<T> = pickWithout<T>(props, notOptionKeys);\n\n return {\n option: newComponentOption,\n optionName,\n isSingle\n };\n };\n\n return Comp;\n};\n\n// const updateToContext = (\n// context: TableContextType,\n// id: string | number,\n// optionName: string,\n// isSingle: boolean,\n// props: Partial<ComponentProps>\n// ) => {\n// if (!context.optionFromChildren) {\n// return;\n// }\n\n// if (isSingle) {\n// context.optionFromChildren[optionName] = { ...props };\n// } else {\n// if (!context.optionFromChildren[optionName]) {\n// context.optionFromChildren[optionName] = [];\n// }\n\n// const comps = context.optionFromChildren[optionName];\n// const index = comps.findIndex((entry: any) => entry.id === id);\n\n// if (index >= 0) {\n// comps[index] = {\n// id,\n// ...props\n// };\n// } else {\n// context.optionFromChildren[optionName].push({\n// id,\n// ...props\n// });\n// }\n// }\n// context.isChildrenUpdated = true;\n// };\n\n// const deleteToContext = (context: TableContextType, id: string | number, optionName: string, isSingle: boolean) => {\n// if (!context.optionFromChildren) {\n// return;\n// }\n\n// if (isSingle) {\n// context.optionFromChildren[optionName] = null;\n// } else {\n// const comps = context.optionFromChildren[optionName] ?? [];\n// const index = comps.findIndex((entry: any) => entry.id === id);\n\n// if (index >= 0) {\n// const newComps = comps.slice(0, index - 1).concat(comps.slice(index + 1));\n\n// context.optionFromChildren[optionName] = newComps;\n// context.isChildrenUpdated = true;\n// }\n// }\n// };\n"]}
|
package/es/context/table.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import type { ListTable, PivotTable, PivotChart } from '@visactor/vtable';
|
|
3
3
|
export interface TableContextType {
|
|
4
4
|
table?: ListTable | PivotTable | PivotChart;
|
|
5
|
-
optionFromChildren: any;
|
|
6
5
|
isChildrenUpdated?: boolean;
|
|
7
6
|
}
|
|
8
7
|
declare const TableContext: React.Context<TableContextType>;
|
package/es/context/table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["context/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAAmB,IAAI,CAAC,CAAC;AACjE,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,MAAM,UAAU,iBAAiB,CAAI,SAAiC;IACpE,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAS,CAAC,KAAQ,EAAE,GAAG,EAAE,EAAE;QACrD,OAAO,CACL,oBAAC,YAAY,CAAC,QAAQ,QACnB,CAAC,GAAqB,EAAE,EAAE,CAAC,oBAAC,SAAS,kBAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,IAAM,KAAK,EAAI,CAC1D,CACzB,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC;IACjC,OAAO,GAAG,CAAC;AACb,CAAC;AAED,eAAe,YAAY,CAAC","file":"table.js","sourcesContent":["import React from 'react';\nimport type { ListTable, PivotTable, PivotChart } from '@visactor/vtable';\n\nexport interface TableContextType {\n table?: ListTable | PivotTable | PivotChart;\n optionFromChildren: any;\n isChildrenUpdated?: boolean;\n}\n\nconst TableContext = React.createContext<TableContextType>(null);\nTableContext.displayName = 'TableContext';\n\nexport function withTableInstance<T>(Component: typeof React.Component) {\n const Com = React.forwardRef<any, T>((props: T, ref) => {\n return (\n <TableContext.Consumer>\n {(ctx: TableContextType) => <Component ref={ref} table={ctx.table} {...props} />}\n </TableContext.Consumer>\n );\n });\n Com.displayName = Component.name;\n return Com;\n}\n\nexport default TableContext;\n"]}
|
|
1
|
+
{"version":3,"sources":["context/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAAmB,IAAI,CAAC,CAAC;AACjE,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,MAAM,UAAU,iBAAiB,CAAI,SAAiC;IACpE,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAS,CAAC,KAAQ,EAAE,GAAG,EAAE,EAAE;QACrD,OAAO,CACL,oBAAC,YAAY,CAAC,QAAQ,QACnB,CAAC,GAAqB,EAAE,EAAE,CAAC,oBAAC,SAAS,kBAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,IAAM,KAAK,EAAI,CAC1D,CACzB,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC;IACjC,OAAO,GAAG,CAAC;AACb,CAAC;AAED,eAAe,YAAY,CAAC","file":"table.js","sourcesContent":["import React from 'react';\nimport type { ListTable, PivotTable, PivotChart } from '@visactor/vtable';\n\nexport interface TableContextType {\n table?: ListTable | PivotTable | PivotChart;\n // optionFromChildren: any;\n isChildrenUpdated?: boolean;\n}\n\nconst TableContext = React.createContext<TableContextType>(null);\nTableContext.displayName = 'TableContext';\n\nexport function withTableInstance<T>(Component: typeof React.Component) {\n const Com = React.forwardRef<any, T>((props: T, ref) => {\n return (\n <TableContext.Consumer>\n {(ctx: TableContextType) => <Component ref={ref} table={ctx.table} {...props} />}\n </TableContext.Consumer>\n );\n });\n Com.displayName = Component.name;\n return Com;\n}\n\nexport default TableContext;\n"]}
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import type { ContainerProps } from '../containers/withContainer';
|
|
4
4
|
import type { EventsProps } from '../eventsUtils';
|
|
5
5
|
export type IVTable = VTable.ListTable | VTable.PivotTable | VTable.PivotChart;
|
|
6
|
+
export type IOption = VTable.ListTableConstructorOptions | VTable.PivotTableConstructorOptions | VTable.PivotChartConstructorOptions;
|
|
6
7
|
export interface BaseTableProps extends EventsProps {
|
|
7
8
|
type?: string;
|
|
8
9
|
container?: HTMLDivElement;
|
package/es/tables/base-table.js
CHANGED
|
@@ -14,84 +14,76 @@ import { REACT_PRIVATE_PROPS } from "../constants";
|
|
|
14
14
|
|
|
15
15
|
import { bindEventsToTable, TABLE_EVENTS_KEYS, TABLE_EVENTS } from "../eventsUtils";
|
|
16
16
|
|
|
17
|
-
const notOptionKeys = [ ...REACT_PRIVATE_PROPS, ...TABLE_EVENTS_KEYS, "skipFunctionDiff", "onError", "onReady", "option", "records", "container" ],
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
const notOptionKeys = [ ...REACT_PRIVATE_PROPS, ...TABLE_EVENTS_KEYS, "skipFunctionDiff", "onError", "onReady", "option", "records", "container" ], parseOptionFromChildren = props => {
|
|
18
|
+
const optionFromChildren = {};
|
|
19
|
+
return toArray(props.children).map((child => {
|
|
20
|
+
const parseOption = child && child.type && child.type.parseOption;
|
|
21
|
+
if (parseOption && child.props) {
|
|
22
|
+
const optionResult = parseOption(child.props);
|
|
23
|
+
optionResult.isSingle ? optionFromChildren[optionResult.optionName] = optionResult.option : (optionFromChildren[optionResult.optionName] || (optionFromChildren[optionResult.optionName] = []),
|
|
24
|
+
optionFromChildren[optionResult.optionName].push(optionResult.option));
|
|
25
|
+
}
|
|
26
|
+
})), optionFromChildren;
|
|
27
|
+
}, BaseTable = React.forwardRef(((props, ref) => {
|
|
28
|
+
const [updateId, setUpdateId] = useState(0), tableContext = useRef({});
|
|
29
|
+
useImperativeHandle(ref, (() => {
|
|
30
|
+
var _a;
|
|
31
|
+
return null === (_a = tableContext.current) || void 0 === _a ? void 0 : _a.table;
|
|
32
|
+
}));
|
|
33
|
+
const hasOption = !!props.option, hasRecords = !!props.records, isUnmount = useRef(!1), prevOption = useRef(pickWithout(props, notOptionKeys)), optionFromChildren = useRef(null), prevRecords = useRef(props.records), eventsBinded = React.useRef(null), skipFunctionDiff = !!props.skipFunctionDiff, parseOption = useCallback((props => hasOption && props.option ? hasRecords && props.records ? Object.assign(Object.assign({}, props.option), {
|
|
23
34
|
records: props.records
|
|
24
35
|
}) : props.option : Object.assign(Object.assign({
|
|
25
36
|
records: props.records
|
|
26
|
-
}, prevOption.current),
|
|
37
|
+
}, prevOption.current), optionFromChildren.current)), [ hasOption, hasRecords ]), createTable = useCallback((props => {
|
|
27
38
|
let vtable;
|
|
28
39
|
vtable = "pivot-table" === props.type ? new VTable.PivotTable(props.container, parseOption(props)) : "pivot-chart" === props.type ? new VTable.PivotChart(props.container, parseOption(props)) : new VTable.ListTable(props.container, parseOption(props)),
|
|
29
40
|
tableContext.current = Object.assign(Object.assign({}, tableContext.current), {
|
|
30
41
|
table: vtable
|
|
31
42
|
});
|
|
32
43
|
}), [ parseOption ]), handleTableRender = useCallback((() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const renderPromise = tableContext.current.table.renderAsync().then(handleTableRender);
|
|
38
|
-
props.onError && renderPromise.catch(props.onError);
|
|
44
|
+
if (!isUnmount.current) {
|
|
45
|
+
if (!tableContext.current || !tableContext.current.table) return;
|
|
46
|
+
bindEventsToTable(tableContext.current.table, props, eventsBinded.current, TABLE_EVENTS),
|
|
47
|
+
setUpdateId(updateId + 1), props.onReady && props.onReady(tableContext.current.table, 0 === updateId);
|
|
39
48
|
}
|
|
40
|
-
}), [
|
|
49
|
+
}), [ updateId, setUpdateId, props ]), renderTable = useCallback((() => {
|
|
50
|
+
tableContext.current.table && (tableContext.current.table.render(), handleTableRender());
|
|
51
|
+
}), [ handleTableRender ]);
|
|
41
52
|
return useEffect((() => {
|
|
42
53
|
var _a;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
tableContext.current
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
})) {
|
|
55
|
-
eventsBinded.current = props, tableContext.current.table.setRecords(props.records);
|
|
56
|
-
const updatePromise = tableContext.current.table.renderAsync().then(handleTableRender);
|
|
57
|
-
props.onError && updatePromise.catch(props.onError);
|
|
58
|
-
}
|
|
59
|
-
} else {
|
|
60
|
-
eventsBinded.current = props, tableContext.current.table.updateOption(parseOption(props));
|
|
61
|
-
const updatePromise = tableContext.current.table.renderAsync().then(handleTableRender);
|
|
62
|
-
props.onError && updatePromise.catch(props.onError);
|
|
63
|
-
}
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
54
|
+
const newOptionFromChildren = hasOption ? null : parseOptionFromChildren(props);
|
|
55
|
+
if (!(null === (_a = tableContext.current) || void 0 === _a ? void 0 : _a.table)) return hasOption || (optionFromChildren.current = newOptionFromChildren),
|
|
56
|
+
createTable(props), renderTable(), bindEventsToTable(tableContext.current.table, props, null, TABLE_EVENTS),
|
|
57
|
+
void (eventsBinded.current = props);
|
|
58
|
+
if (hasOption) return void (isEqual(eventsBinded.current.option, props.option, {
|
|
59
|
+
skipFunction: skipFunctionDiff
|
|
60
|
+
}) ? hasRecords && !isEqual(eventsBinded.current.records, props.records, {
|
|
61
|
+
skipFunction: skipFunctionDiff
|
|
62
|
+
}) && (eventsBinded.current = props, tableContext.current.table.setRecords(props.records),
|
|
63
|
+
handleTableRender()) : (eventsBinded.current = props, tableContext.current.table.updateOption(parseOption(props)),
|
|
64
|
+
handleTableRender()));
|
|
66
65
|
const newOption = pickWithout(props, notOptionKeys);
|
|
67
|
-
|
|
66
|
+
isEqual(newOption, prevOption.current, {
|
|
68
67
|
skipFunction: skipFunctionDiff
|
|
69
|
-
})
|
|
70
|
-
prevOption.current = newOption, tableContext.current.table.updateOption(parseOption(props));
|
|
71
|
-
const updatePromise = tableContext.current.table.renderAsync().then(handleTableRender);
|
|
72
|
-
props.onError && updatePromise.catch(props.onError);
|
|
73
|
-
} else if (hasRecords && !isEqual(props.records, prevRecords.current, {
|
|
68
|
+
}) && isEqual(newOptionFromChildren, optionFromChildren.current) ? hasRecords && !isEqual(props.records, prevRecords.current, {
|
|
74
69
|
skipFunction: skipFunctionDiff
|
|
75
|
-
}))
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
props.onError && updatePromise.catch(props.onError);
|
|
79
|
-
}
|
|
80
|
-
tableContext.current = Object.assign(Object.assign({}, tableContext.current), {
|
|
81
|
-
isChildrenUpdated: !1
|
|
82
|
-
});
|
|
70
|
+
}) && (prevRecords.current = props.records, tableContext.current.table.setRecords(props.records),
|
|
71
|
+
handleTableRender()) : (prevOption.current = newOption, optionFromChildren.current = newOptionFromChildren,
|
|
72
|
+
tableContext.current.table.updateOption(parseOption(props)), handleTableRender());
|
|
83
73
|
}), [ createTable, hasOption, hasRecords, parseOption, handleTableRender, renderTable, skipFunctionDiff, props ]),
|
|
84
74
|
useEffect((() => () => {
|
|
85
|
-
tableContext &&
|
|
75
|
+
tableContext && tableContext.current && tableContext.current.table && (tableContext.current.table.release(),
|
|
86
76
|
tableContext.current = null), isUnmount.current = !0;
|
|
87
77
|
}), []), React.createElement(RootTableContext.Provider, {
|
|
88
78
|
value: tableContext.current
|
|
89
79
|
}, toArray(props.children).map(((child, index) => {
|
|
90
|
-
|
|
80
|
+
if ("string" == typeof child) return;
|
|
81
|
+
const childId = `${child && child.type && (child.type.displayName || child.type.name)}-${index}`;
|
|
91
82
|
return React.createElement(React.Fragment, {
|
|
92
|
-
key:
|
|
83
|
+
key: childId
|
|
93
84
|
}, React.cloneElement(child, {
|
|
94
|
-
updateId: updateId
|
|
85
|
+
updateId: updateId,
|
|
86
|
+
componentId: childId
|
|
95
87
|
}));
|
|
96
88
|
})));
|
|
97
89
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["tables/base-table.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAE7F,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAExD,OAAO,gBAAgB,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAanD,OAAO,EAAE,iBAAiB,E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AC,GAAG,CAAC,CAAC,KAAsB,EAAE,KAAa,EAAE,EAAE;;QACrE,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,MAAA,MAAA,MAAC,KAAa,aAAb,KAAK,uBAAL,KAAK,CAAU,KAAK,0CAAE,EAAE,mCAAK,KAAa,aAAb,KAAK,uBAAL,KAAK,CAAU,EAAE,mCAAI,SAAS,KAAK,EAAE,IACrF,KAAK,CAAC,YAAY,CAAC,KAAqB,EAAE;YACzC,QAAQ,EAAE,QAAQ;SACnB,CAAC,CACa,CAClB,CAAC;IACJ,CAAC,CAAC,CACwB,CAC7B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAkB,aAAqB,EAAE,IAAa,EAAE,QAA0B,EAAE,EAAE;IAC/G,MAAM,GAAG,GAAG,aAAa,CAAoB,SAAgB,EAAE,aAAa,EAAE,CAAC,KAAQ,EAAE,EAAE;QACzF,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,QAAQ,EAAE;YACZ,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;SACxB;QAED,IAAI,IAAI,EAAE;YACR,uCAAY,KAAK,KAAE,IAAI,IAAG;SAC3B;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,WAAW,GAAG,aAAa,CAAC;IAChC,OAAO,GAAG,CAAC;AACb,CAAC,CAAC","file":"base-table.js","sourcesContent":["/* eslint-disable react/display-name */\nimport * as VTable from '@visactor/vtable';\nimport React, { useState, useEffect, useRef, useImperativeHandle, useCallback } from 'react';\nimport type { ContainerProps } from '../containers/withContainer';\nimport withContainer from '../containers/withContainer';\nimport type { TableContextType } from '../context/table';\nimport RootTableContext from '../context/table';\nimport { isEqual, pickWithout } from '@visactor/vutils';\nimport { toArray } from '../util';\nimport { REACT_PRIVATE_PROPS } from '../constants';\nimport type { IMarkElement } from '../components';\nimport type {\n EventsProps\n // LegendEventProps,\n // ScrollBarEventProps,\n // BrushEventProps,\n // DataZoomEventProps,\n // PlayerEventProps,\n // DimensionEventProps,\n // HierarchyEventProps,\n // TableLifeCycleEventProps\n} from '../eventsUtils';\nimport { bindEventsToTable, TABLE_EVENTS_KEYS, TABLE_EVENTS } from '../eventsUtils';\n\nexport type IVTable = VTable.ListTable | VTable.PivotTable | VTable.PivotChart;\n\nexport interface BaseTableProps extends EventsProps {\n type?: string;\n /** 上层container */\n container?: HTMLDivElement;\n /** option */\n option?: any;\n /** 数据 */\n records?: any;\n /** 画布宽度 */\n width?: number;\n /** 画布高度 */\n height?: number;\n skipFunctionDiff?: boolean;\n\n /** 表格渲染完成事件 */\n onReady?: (instance: IVTable, isInitial: boolean) => void;\n /** throw error when chart run into an error */\n onError?: (err: Error) => void;\n}\n\ntype Props = React.PropsWithChildren<BaseTableProps>;\n\nconst notOptionKeys = [\n ...REACT_PRIVATE_PROPS,\n ...TABLE_EVENTS_KEYS,\n 'skipFunctionDiff',\n 'onError',\n 'onReady',\n 'option',\n 'records',\n 'container'\n];\n\nconst BaseTable: React.FC<Props> = React.forwardRef((props, ref) => {\n const [updateId, setUpdateId] = useState<number>(0);\n const tableContext = useRef<TableContextType>({\n optionFromChildren: {}\n });\n useImperativeHandle(ref, () => tableContext.current.table);\n const hasOption = !!props.option;\n const hasRecords = !!props.records;\n const isUnmount = useRef<boolean>(false);\n const prevOption = useRef(pickWithout(props, notOptionKeys));\n const prevRecords = useRef(props.records);\n const eventsBinded = React.useRef<BaseTableProps>(null);\n const skipFunctionDiff = !!props.skipFunctionDiff;\n\n const parseOption = useCallback(\n (props: Props) => {\n if (hasOption && props.option) {\n if (hasRecords && props.records) {\n return {\n ...props.option,\n records: props.records\n };\n }\n return props.option;\n }\n\n return {\n records: props.records,\n ...prevOption.current,\n ...tableContext.current.optionFromChildren\n };\n },\n [hasOption, hasRecords]\n );\n\n const createTable = useCallback(\n (props: Props) => {\n let vtable;\n if (props.type === 'pivot-table') {\n vtable = new VTable.PivotTable(props.container, parseOption(props));\n } else if (props.type === 'pivot-chart') {\n vtable = new VTable.PivotChart(props.container, parseOption(props));\n } else {\n vtable = new VTable.ListTable(props.container, parseOption(props));\n }\n tableContext.current = { ...tableContext.current, table: vtable };\n },\n [parseOption]\n );\n\n const handleTableRender = useCallback(() => {\n // rebind events after render\n bindEventsToTable(tableContext.current.table, props, eventsBinded.current, TABLE_EVENTS);\n\n if (!isUnmount.current) {\n // to be fixed\n // will cause another useEffect\n setUpdateId(updateId + 1);\n if (props.onReady) {\n props.onReady(tableContext.current.table, updateId === 0);\n }\n }\n }, [updateId, setUpdateId, props]);\n\n const renderTable = useCallback(() => {\n if (tableContext.current.table) {\n // eslint-disable-next-line promise/catch-or-return\n const renderPromise = tableContext.current.table.renderAsync().then(handleTableRender);\n\n if (props.onError) {\n renderPromise.catch(props.onError);\n }\n }\n }, [handleTableRender, props]);\n\n useEffect(() => {\n if (!tableContext.current?.table) {\n createTable(props);\n renderTable();\n bindEventsToTable(tableContext.current.table, props, null, TABLE_EVENTS);\n tableContext.current = {\n ...tableContext.current,\n isChildrenUpdated: false\n };\n eventsBinded.current = props;\n return;\n }\n\n if (hasOption) {\n if (!isEqual(eventsBinded.current.option, props.option, { skipFunction: skipFunctionDiff })) {\n eventsBinded.current = props;\n // eslint-disable-next-line promise/catch-or-return\n tableContext.current.table.updateOption(parseOption(props));\n const updatePromise = tableContext.current.table.renderAsync().then(handleTableRender);\n\n if (props.onError) {\n updatePromise.catch(props.onError);\n }\n } else if (\n hasRecords &&\n !isEqual(eventsBinded.current.records, props.records, { skipFunction: skipFunctionDiff })\n ) {\n eventsBinded.current = props;\n tableContext.current.table.setRecords(props.records);\n const updatePromise = tableContext.current.table.renderAsync().then(handleTableRender);\n\n if (props.onError) {\n updatePromise.catch(props.onError);\n }\n }\n return;\n }\n\n const newOption = pickWithout(props, notOptionKeys);\n\n if (\n !isEqual(newOption, prevOption.current, { skipFunction: skipFunctionDiff }) ||\n tableContext.current.isChildrenUpdated\n ) {\n prevOption.current = newOption;\n // eslint-disable-next-line promise/catch-or-return\n tableContext.current.table.updateOption(parseOption(props));\n const updatePromise = tableContext.current.table.renderAsync().then(handleTableRender);\n\n if (props.onError) {\n updatePromise.catch(props.onError);\n }\n } else if (hasRecords && !isEqual(props.records, prevRecords.current, { skipFunction: skipFunctionDiff })) {\n prevRecords.current = props.records;\n tableContext.current.table.setRecords(props.records);\n const updatePromise = tableContext.current.table.renderAsync().then(handleTableRender);\n\n if (props.onError) {\n updatePromise.catch(props.onError);\n }\n }\n tableContext.current = {\n ...tableContext.current,\n isChildrenUpdated: false\n };\n }, [createTable, hasOption, hasRecords, parseOption, handleTableRender, renderTable, skipFunctionDiff, props]);\n\n useEffect(() => {\n return () => {\n if (tableContext) {\n if (tableContext.current.table) {\n tableContext.current.table.release();\n }\n tableContext.current = null;\n }\n isUnmount.current = true;\n };\n }, []);\n\n return (\n <RootTableContext.Provider value={tableContext.current}>\n {toArray(props.children).map((child: React.ReactNode, index: number) => {\n return (\n <React.Fragment key={(child as any)?.props?.id ?? (child as any)?.id ?? `child-${index}`}>\n {React.cloneElement(child as IMarkElement, {\n updateId: updateId\n })}\n </React.Fragment>\n );\n })}\n </RootTableContext.Provider>\n );\n});\n\nexport const createTable = <T extends Props>(componentName: string, type?: string, callback?: (props: T) => T) => {\n const Com = withContainer<ContainerProps, T>(BaseTable as any, componentName, (props: T) => {\n props.type = type;\n\n if (callback) {\n return callback(props);\n }\n\n if (type) {\n return { ...props, type };\n }\n return props;\n });\n Com.displayName = componentName;\n return Com;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["tables/base-table.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAE7F,OAAO,aAAa,MAAM,6BAA6B,C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AQ,EAAE;YACZ,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;SACxB;QAED,IAAI,IAAI,EAAE;YACR,uCAAY,KAAK,KAAE,IAAI,IAAG;SAC3B;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,WAAW,GAAG,aAAa,CAAC;IAChC,OAAO,GAAG,CAAC;AACb,CAAC,CAAC","file":"base-table.js","sourcesContent":["/* eslint-disable react/display-name */\nimport * as VTable from '@visactor/vtable';\nimport React, { useState, useEffect, useRef, useImperativeHandle, useCallback } from 'react';\nimport type { ContainerProps } from '../containers/withContainer';\nimport withContainer from '../containers/withContainer';\nimport type { TableContextType } from '../context/table';\nimport RootTableContext from '../context/table';\nimport { isEqual, pickWithout } from '@visactor/vutils';\nimport { toArray } from '../util';\nimport { REACT_PRIVATE_PROPS } from '../constants';\nimport type { IMarkElement } from '../components';\nimport type {\n EventsProps\n // LegendEventProps,\n // ScrollBarEventProps,\n // BrushEventProps,\n // DataZoomEventProps,\n // PlayerEventProps,\n // DimensionEventProps,\n // HierarchyEventProps,\n // TableLifeCycleEventProps\n} from '../eventsUtils';\nimport { bindEventsToTable, TABLE_EVENTS_KEYS, TABLE_EVENTS } from '../eventsUtils';\n\nexport type IVTable = VTable.ListTable | VTable.PivotTable | VTable.PivotChart;\nexport type IOption =\n | VTable.ListTableConstructorOptions\n | VTable.PivotTableConstructorOptions\n | VTable.PivotChartConstructorOptions;\n\nexport interface BaseTableProps extends EventsProps {\n type?: string;\n /** 上层container */\n container?: HTMLDivElement;\n /** option */\n option?: any;\n /** 数据 */\n records?: any;\n /** 画布宽度 */\n width?: number;\n /** 画布高度 */\n height?: number;\n skipFunctionDiff?: boolean;\n\n /** 表格渲染完成事件 */\n onReady?: (instance: IVTable, isInitial: boolean) => void;\n /** throw error when chart run into an error */\n onError?: (err: Error) => void;\n}\n\ntype Props = React.PropsWithChildren<BaseTableProps>;\n\nconst notOptionKeys = [\n ...REACT_PRIVATE_PROPS,\n ...TABLE_EVENTS_KEYS,\n 'skipFunctionDiff',\n 'onError',\n 'onReady',\n 'option',\n 'records',\n 'container'\n];\n\nconst parseOptionFromChildren = (props: Props) => {\n const optionFromChildren: Omit<IOption, 'type' | 'data' | 'width' | 'height'> = {};\n\n toArray(props.children).map(child => {\n const parseOption = child && (child as any).type && (child as any).type.parseOption;\n\n if (parseOption && (child as any).props) {\n const optionResult = parseOption((child as any).props);\n\n if (optionResult.isSingle) {\n optionFromChildren[optionResult.optionName] = optionResult.option;\n } else {\n if (!optionFromChildren[optionResult.optionName]) {\n optionFromChildren[optionResult.optionName] = [];\n }\n\n optionFromChildren[optionResult.optionName].push(optionResult.option);\n }\n }\n });\n\n return optionFromChildren;\n};\n\nconst BaseTable: React.FC<Props> = React.forwardRef((props, ref) => {\n const [updateId, setUpdateId] = useState<number>(0);\n const tableContext = useRef<TableContextType>({\n // optionFromChildren: {}\n });\n useImperativeHandle(ref, () => tableContext.current?.table);\n const hasOption = !!props.option;\n const hasRecords = !!props.records;\n const isUnmount = useRef<boolean>(false);\n const prevOption = useRef(pickWithout(props, notOptionKeys));\n const optionFromChildren = useRef<Omit<IOption, 'records'>>(null);\n const prevRecords = useRef(props.records);\n const eventsBinded = React.useRef<BaseTableProps>(null);\n const skipFunctionDiff = !!props.skipFunctionDiff;\n\n const parseOption = useCallback(\n (props: Props) => {\n if (hasOption && props.option) {\n if (hasRecords && props.records) {\n return {\n ...props.option,\n records: props.records\n };\n }\n return props.option;\n }\n return {\n records: props.records,\n ...prevOption.current,\n ...optionFromChildren.current\n // ...tableContext.current?.optionFromChildren\n } as IOption;\n },\n [hasOption, hasRecords]\n );\n\n const createTable = useCallback(\n (props: Props) => {\n let vtable;\n if (props.type === 'pivot-table') {\n vtable = new VTable.PivotTable(props.container, parseOption(props));\n } else if (props.type === 'pivot-chart') {\n vtable = new VTable.PivotChart(props.container, parseOption(props));\n } else {\n vtable = new VTable.ListTable(props.container, parseOption(props));\n }\n tableContext.current = { ...tableContext.current, table: vtable };\n },\n [parseOption]\n );\n\n const handleTableRender = useCallback(() => {\n if (!isUnmount.current) {\n if (!tableContext.current || !tableContext.current.table) {\n return;\n }\n // rebind events after render\n bindEventsToTable(tableContext.current.table, props, eventsBinded.current, TABLE_EVENTS);\n\n // to be fixed\n // will cause another useEffect\n setUpdateId(updateId + 1);\n if (props.onReady) {\n props.onReady(tableContext.current.table, updateId === 0);\n }\n }\n }, [updateId, setUpdateId, props]);\n\n const renderTable = useCallback(() => {\n if (tableContext.current.table) {\n // eslint-disable-next-line promise/catch-or-return\n tableContext.current.table.render();\n handleTableRender();\n }\n }, [handleTableRender]);\n\n useEffect(() => {\n const newOptionFromChildren = hasOption ? null : parseOptionFromChildren(props);\n\n if (!tableContext.current?.table) {\n if (!hasOption) {\n optionFromChildren.current = newOptionFromChildren;\n }\n\n createTable(props);\n renderTable();\n bindEventsToTable(tableContext.current.table, props, null, TABLE_EVENTS);\n // tableContext.current = {\n // ...tableContext.current,\n // isChildrenUpdated: false\n // };\n eventsBinded.current = props;\n return;\n }\n\n if (hasOption) {\n if (!isEqual(eventsBinded.current.option, props.option, { skipFunction: skipFunctionDiff })) {\n eventsBinded.current = props;\n // eslint-disable-next-line promise/catch-or-return\n tableContext.current.table.updateOption(parseOption(props));\n handleTableRender();\n } else if (\n hasRecords &&\n !isEqual(eventsBinded.current.records, props.records, { skipFunction: skipFunctionDiff })\n ) {\n eventsBinded.current = props;\n tableContext.current.table.setRecords(props.records);\n handleTableRender();\n }\n return;\n }\n\n const newOption = pickWithout(props, notOptionKeys);\n\n if (\n !isEqual(newOption, prevOption.current, { skipFunction: skipFunctionDiff }) ||\n // tableContext.current.isChildrenUpdated\n !isEqual(newOptionFromChildren, optionFromChildren.current)\n ) {\n prevOption.current = newOption;\n optionFromChildren.current = newOptionFromChildren;\n\n // eslint-disable-next-line promise/catch-or-return\n tableContext.current.table.updateOption(parseOption(props));\n handleTableRender();\n } else if (hasRecords && !isEqual(props.records, prevRecords.current, { skipFunction: skipFunctionDiff })) {\n prevRecords.current = props.records;\n tableContext.current.table.setRecords(props.records);\n handleTableRender();\n }\n // tableContext.current = {\n // ...tableContext.current,\n // isChildrenUpdated: false\n // };\n }, [createTable, hasOption, hasRecords, parseOption, handleTableRender, renderTable, skipFunctionDiff, props]);\n\n useEffect(() => {\n return () => {\n if (tableContext) {\n if (tableContext.current && tableContext.current.table) {\n tableContext.current.table.release();\n tableContext.current = null;\n }\n }\n isUnmount.current = true;\n };\n }, []);\n\n return (\n <RootTableContext.Provider value={tableContext.current}>\n {toArray(props.children).map((child: React.ReactNode, index: number) => {\n if (typeof child === 'string') {\n return;\n }\n\n const componentName =\n child && (child as any).type && ((child as any).type.displayName || (child as any).type.name);\n const childId = `${componentName}-${index}`;\n\n return (\n // <React.Fragment key={(child as any)?.props?.id ?? (child as any)?.id ?? `child-${index}`}>\n // {React.cloneElement(child as IMarkElement, {\n // updateId: updateId\n // })}\n // </React.Fragment>\n <React.Fragment key={childId}>\n {React.cloneElement(child as React.ReactElement<any, React.JSXElementConstructor<any>>, {\n updateId: updateId,\n componentId: childId\n })}\n </React.Fragment>\n );\n })}\n </RootTableContext.Provider>\n );\n});\n\nexport const createTable = <T extends Props>(componentName: string, type?: string, callback?: (props: T) => T) => {\n const Com = withContainer<ContainerProps, T>(BaseTable as any, componentName, (props: T) => {\n props.type = type;\n\n if (callback) {\n return callback(props);\n }\n\n if (type) {\n return { ...props, type };\n }\n return props;\n });\n Com.displayName = componentName;\n return Com;\n};\n"]}
|