@grapecity/wijmo.react.base 5.20252.42 → 5.20261.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/es2015-commonjs.js +4 -2
- package/es2015-esm.js +4 -2
- package/es5-esm.js +2 -2
- package/index.d.ts +50 -50
- package/index.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# Wijmo
|
|
4
4
|
|
|
5
|
+
**Note: Starting from 2027v1, Wijmo npm packages will be published only under the @mescius scope. Users using the @grapecity scope during the 2026 period will need to migrate to @mescius.**
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
5
9
|
Wijmo is a complete set of [JavaScript UI components](https://developer.mescius.com/wijmo?utm_source=npmwebsite&utm_medium=prospects&utm_campaign=wijmo_npm) for enterprise development. It includes a powerful data grid, charts, pivot tools, inputs, and much more and is available in your favorite framework, including [Angular](https://developer.mescius.com/wijmo/angular-ui-components?utm_source=npmwebsite&utm_medium=prospects&utm_campaign=wijmo_npm), [React](https://developer.mescius.com/wijmo/react-ui-components?utm_source=npmwebsite&utm_medium=prospects&utm_campaign=wijmo_npm), and [Vue](https://developer.mescius.com/wijmo/vue-ui-components?utm_source=npmwebsite&utm_medium=prospects&utm_campaign=wijmo_npm).
|
|
6
10
|
|
|
7
11
|
Cut your development time in half with Wijmo's lightweight, high-performance JavaScript UI components.
|
|
@@ -122,6 +126,10 @@ Submit questions to our team of [Wijmo Experts](https://developer.mescius.com/fo
|
|
|
122
126
|
|
|
123
127
|
## Wijmo JP
|
|
124
128
|
|
|
129
|
+
**注:2027v1以降、Wijmoのnpmパッケージは@mesciusスコープでのみ公開されます。2026年期間中に@grapecityスコープを使用しているユーザーは、@mesciusに移行する必要があります。**
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
125
133
|
[Wijmo](https://developer.mescius.jp/wijmo)は、Webアプリケーション開発に最適な数多くのUIを搭載するJavaScriptコンポーネントセットです。高速・軽量であり、開発工数の削減に大きく寄与します。データグリッド、チャート、ピボットテーブル、入力など、業務アプリケーション開発に必要となるコントロールを多数収録し、またAngularやReact、Vue.jsといったJavaScriptフレームワークにも対応しています。
|
|
126
134
|
|
|
127
135
|
なお、日本語版での動作保証は日本語版サイトで公開しているバージョンのみとなります。
|
|
@@ -161,6 +169,10 @@ Submit questions to our team of [Wijmo Experts](https://developer.mescius.com/fo
|
|
|
161
169
|
|
|
162
170
|
## Wijmo CN
|
|
163
171
|
|
|
172
|
+
**注意:从 2027v1 开始,Wijmo 的 npm 包将仅在 @mescius 作用域下发布。在 2026 年期间仍在使用 @grapecity 作用域的用户,需要迁移到 @mescius。**
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
164
176
|
Wijmo 是一套完整的企业级 JavaScript UI 开发组件。 它包括强大的表格、图表、数据透视、输入等组件,并且可以支持各类主流前端框架,包括 Angular、React 和 Vue。
|
|
165
177
|
|
|
166
178
|
Wijmo 的轻量级、高性能 JavaScript UI 组件可以将您的开发时间缩短一半。
|
|
@@ -255,6 +267,11 @@ Wijmo 开发包可以从 [这里](https://www.grapecity.com.cn/developer/wijmojs
|
|
|
255
267
|
|
|
256
268
|
# Wijmo KR
|
|
257
269
|
|
|
270
|
+
**참고: 2027 v1부터 Wijmo npm 패키지는 @mescius 스코프에서만 제공됩니다.
|
|
271
|
+
현재 @grapecity 스코프를 사용 중인 사용자는 2026년 내에 @mescius 스코프로 마이그레이션해 주시기 바랍니다.**
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
258
275
|
Wijmo(위즈모)는 고성능의 Web App 개발을 위한 완전한 JavaScript UI 컴포넌트 세트입니다. 강력한 데이터 그리드(DataGrid), 차트(Chart), 피벗 도구(OLAP/Pivop), 입력(Input) 등 개발에 필요한 100+의 다양한 컨트롤이 포함되어 있습니다.
|
|
259
276
|
|
|
260
277
|
또한, Wijmo는 Angular, React 및 Vue 등 개발자가 빠른 웹 개발과 효율적인 코드 유지 관리를 쉽게 할 수 있도록 JavaScript 프레임워크에 대한 지원을 제공합니다.
|
package/es2015-commonjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* Wijmo Library 5.
|
|
3
|
+
* Wijmo Library 5.20261.48
|
|
4
4
|
* https://developer.mescius.com/wijmo
|
|
5
5
|
*
|
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
@@ -11,4 +11,6 @@
|
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
"use strict";var __awaiter=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))((function(o,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n.throw(e))}catch(e){s(e)}}function step(e){e.done?o(e.value):new t((function(r){r(e.value)})).then(fulfilled,rejected)}step((n=n.apply(e,r||[])).next())}))},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.hasOwnProperty.call(e,t)&&(r[t]=e[t]);r.default=e;return r};Object.defineProperty(exports,"__esModule",{value:!0});const wijmo_1=require("@grapecity/wijmo"),ReactDOM=__importStar(require("react-dom")),React=__importStar(require("react")),flushSyncPolyfill=e=>{e()},createRootPolyfill=()=>{throw"Wijmo: React dependencies not loaded properly"},ReactDomPolyfill={flushSync:flushSyncPolyfill,createRoot:createRootPolyfill};let reactDomClient=ReactDOM||ReactDomPolyfill,flushSync=reactDomClient.flushSync;function lazyImportDomClient(){return __awaiter(this,void 0,void 0,(function*(){try{const e=require("react-dom/client");reactDomClient=e||ReactDOM||ReactDomPolyfill;flushSync=e.flushSync||flushSync}catch(e){reactDomClient=ReactDOM||ReactDomPolyfill}}))}let _reactMajorVersion,elemRootMap=[];if(!_reactMajorVersion){const e=parseInt(React.version);_reactMajorVersion=e;e>=18&&lazyImportDomClient()}function wjForwardRef(e){return _reactMajorVersion>=19?r=>e(r,r.ref):React.forwardRef(e)}exports.wjForwardRef=wjForwardRef;let _oldSyncBehavior=!0;function strictStateMode(e=!1){e==_oldSyncBehavior&&(_oldSyncBehavior=!wijmo_1.asBoolean(e,!1))}exports.strictStateMode=strictStateMode;exports.ControlBaseMeta={inputs:["isDisabled","tabOrder"],events:["gotFocus","invalidInput","lostFocus","refreshed","refreshing"]};const alwaysClearProps=new Set(["columns","columnGroups"]),unsuppressedChangedEventProps=new Set(["panes","columnGroups","columns","items"]),specialProps=new Set(["initialized","wjItemTemplate"]),buildInProps=new Set(["className"]);function updateChildProperties(e,r){const t=e.controlRef.current,n={},o={};if(r){const s=wijmo_1.isArray(r)?r.flat(1/0):[r],c=[];let i=0;const l=new Set;for(let e of s){if(e&&e.type&&e.type.$$typeof==Symbol.for("react.forward_ref")){_reactMajorVersion>=19?c.push(e.type.render(e.props,e.props.ref)):c.push(e.type.render(e.props,e.ref));c[c.length-1].$index=i;c[c.length-1].$key=e.key}else if(e&&wijmo_1.isFunction(e.type)){c.push(e.type(e.props));c[c.length-1].$index=i;c[c.length-1].$key=e.key}e||l.add(i);i++}const a=[];for(let e of c)if(e.assignedToParent){if(e.wjProperty){e.parentProp=wijmo_1.asString(e.wjProperty);e.isParentPropArray=t[e.parentProp]&&wijmo_1.isArray(t[e.parentProp])}e.isParentPropArray&&!n[e.parentProp]&&(n[e.parentProp]=[]);e.isParentPropArray?n[e.parentProp].push({getInstance:e.getInstance,props:e.props,$key:e.$key,$index:e.$index}):n[e.parentProp]={getInstance:e.getInstance,props:e.props}}else a.push(e);const u=e.childInfo;for(let e in n)if(wijmo_1.isArray(n[e])){let r=!1;if(t[e]&&null!=t[e]._updating&&!unsuppressedChangedEventProps.has(e)){t[e]._updating++;r=!0}let s=u[e];o[e]=[];let c=!1;if(!u[e]){s=[];if(t[e]&&t[e].clear){t[e].clear();c=!0}else t[e]||(t[e]=new wijmo_1.ObservableArray)}if(!_oldSyncBehavior&&alwaysClearProps.has(e)){if(t[e]&&t[e].clear){t[e].clear();c=!0}}else if(!isKeyOrderSame(s,n[e],"$key")&&t[e]&&t[e].clear){t[e].clear();c=!0}if(_oldSyncBehavior)for(let r=s.length-1;r>=0;r--)if(l.has(s[r].$index)){t[e].remove(s[r].instance);s.splice(r,1)}const i=[],a={};for(let e of s)null!=e.$key?a[""+e.$key]=e:i.push(e);let p=0;const getExistingInstance=(e=null)=>{if(null!=e){let r=a[e];null!=r&&delete a[e];return r}return i[p++]};for(let r=0;r<n[e].length;r++){let s=getExistingInstance(n[e][r].$key),i=!1;if(s)s.updateProps(n[e][r].props);else{s=n[e][r].getInstance(t);i=!0}s.$index=n[e][r].$index;s.$key=n[e][r].$key;(c||i)&&(t[e].length==r?t[e].push(s.instance):t[e].splice(r,0,s.instance));o[e].push(s)}for(let r of Object.keys(a))t[e].remove(a[r].instance);for(;!_oldSyncBehavior&&t[e].length>o[e].length;)t[e].pop();if(r){t[e]._updating--;!c&&u[e]&&u[e].length==n[e].length||t[e]._raiseCollectionChanged&&t[e]._raiseCollectionChanged()}}else{let r=u[e];if(r)r.updateProps(n[e].props);else{r=n[e].getInstance(t);t[e]=r.instance}o[e]=r}const p=[];for(let e of u.$_nonassignable||[])l.has(e.$index)?e.instance&&e.instance.dispose&&wijmo_1.isFunction(e.instance.dispose)&&e.instance.dispose():p.push(e);const f=[];let d=0;for(;d<a.length;d++){let e=p[d];e?e.updateProps(a[d].props):e=a[d].getInstance(t);e.$index=a[d].$index;f.push(e)}o.$_nonassignable=f;for(;d<p.length;d++)p[d].instance&&p[d].instance.dispose&&wijmo_1.isFunction(p[d].instance.dispose)&&p[d].instance.dispose()}if(_oldSyncBehavior)for(let r of Object.keys(e.childInfo))if(wijmo_1.isArray(e.childInfo[r])&&!n[r]&&t[r]&&t[r].remove)for(let n of e.childInfo[r])t[r].remove(n.instance);return o}function getPropsAccordingToSyncMode(e,r,t=null){if(!r||!_oldSyncBehavior){return Object.assign({},e)}let n={};for(let o in e){let s=!1;t&&(s=t.knowProperties.has(o)||t.knowEvents.has(o)||t.knowCustomProps.has(o));(t&&!s||e[o]!==r[o])&&(n[o]=e[o])}return n}function useWjComponentBase(e){const r=React.useRef({}),t=React.useRef(),n=React.useRef(),o=React.useRef(),s=React.useRef(),c=React.useRef({}),i=React.useRef(!1),l=React.useRef(null),a=React.useRef(null);e.customProps||(e.customProps={});if(!t.current){t.current={};t.current.knowProperties=new Set(e.properties);t.current.knowEvents=new Set(e.events);t.current.knowCustomProps=new Set(Object.keys(e.customProps))}let u=e.props;if(s.current){u=getPropsAccordingToSyncMode(e.props,r.current,t.current);r.current=e.props}const p={},f={},d={},h={},m={},y=e.ref||null;for(let r in u)if(t.current.knowProperties.has(r))p[r]=u[r];else if(t.current.knowEvents.has(r)){f[r]=u[r];p[r]=u[r]}else e.customProps[r]?h[r]=u[r]:buildInProps.has(r)?m[r]=u[r]:specialProps.has(r)||(d[r]=u[r]);if(s.current&&_oldSyncBehavior)for(let e in f)delete p[e];const updateProps=()=>{y&&y.current&&(y.current.props=e.props);updateChildProps();let r=[],t=p;if(o.current&&s.current&&!_oldSyncBehavior){for(let e in o.current)if(s.current[e]){if(s.current[e]._handlersChanged){s.current[e]._cachedHandlersChanged=s.current[e]._handlersChanged;s.current[e]._handlersChanged=null;r.push(s.current[e])}s.current[e].removeHandler(o.current[e])}t=Object.assign({},p);for(let e in f){delete t[e];s.current[e].addHandler(f[e])}}else if(!o.current){t=Object.assign({},p);for(let e in f)delete t[e]}o.current=f;if(s.current){wijmo_1.copy(s.current,t,!1,!0);for(let e in m)_setHostAttribute(s.current.hostElement,e,m[e]);for(let r in h)e.customProps[r](s.current,h[r]);(()=>{for(let e of r)if(e._cachedHandlersChanged){e._handlersChanged=e._cachedHandlersChanged;e._cachedHandlersChanged=null}r=[]})()}},updateChildProps=()=>{c.current=updateChildProperties({controlRef:s,childInfo:c.current},e.props.children)};React.useLayoutEffect(()=>{if(n.current&&!s.current){s.current=new e.constructor(n.current,p);e.prePropsInit&&e.prePropsInit(s.current);if(y)if(wijmo_1.isFunction(y)){const r=y({control:s.current,props:e.props});wijmo_1.isFunction(r)&&(l.current=r)}else y.current&&y.current.control==s.current||(y.current={control:s.current,props:e.props});for(let e in m)_setHostAttribute(s.current.hostElement,e,m[e]);e.props.children&&updateProps();e.initControl&&e.initControl(s.current);e.props.initialized&&setTimeout(()=>{s.current&&e.props.initialized(s.current)})}else i.current&&(i.current=!1);return()=>{if(s.current){const e=s.current;i.current=!0;queueMicrotask(()=>{if(i.current){e.dispose();s.current=null;c.current={};i.current=!1;l.current&&l.current()}})}}},[]);s.current&&queueMicrotask(()=>updateProps());const _=React.createElement("div",Object.assign({},d,{ref:n}),[]),_setHostAttribute=(e,r,t)=>{if(e)switch(r){case"className":const r=a.current;if(r!==t){wijmo_1.removeClass(e,r);wijmo_1.addClass(e,t);a.current=t}}};return{renderResult:_,wjControl:s.current}}exports.useWjComponentBase=useWjComponentBase;function filterKnownProps(e,r,t){const n={};for(let o in e)(r.has(o)||t.has(o))&&(n[o]=e[o]);return n}function clearAndGetEvents(e,r,t,n){const o=n.current,s={};for(let e in r)t.has(e)&&(s[e]=r[e]);for(let t in o)e[t]&&(!_oldSyncBehavior||r[t]?e[t].removeHandler(o[t]):s[t]=o[t]);return s}function getCustomPropsData(e,r){const t={};for(let n in r)void 0!==e[n]&&(t[n]=e[n]);return t}function useWjComponentChildBase(e){const r={};r.knowProperties=new Set(e.properties);r.knowEvents=new Set(e.events);e.customProps||(e.customProps={});return{getInstance:t=>{const n={current:{}},o={current:{}},s={current:{}},c=getPropsAccordingToSyncMode(e.props,n.current),i=filterKnownProps(c,r.knowProperties,r.knowEvents),l=getCustomPropsData(c,e.customProps||{}),a=e.customConstructor?e.customConstructor(t,i,l):new e.constructor(e.needParentInstance?t:i,e.needParentInstance?i:void 0);e.ref&&(wijmo_1.isFunction(e.ref)?e.ref({control:a,props:e.props}):e.ref.current&&e.ref.current.control==a||(e.ref.current={control:a,props:e.props}));s.current=clearAndGetEvents(a,c,r.knowEvents,s);const updateProps=t=>{const c=getPropsAccordingToSyncMode(t,n.current);n.current=t;e.ref&&e.ref.current&&(e.ref.current.props=t);s.current=clearAndGetEvents(a,c,r.knowEvents,s);const i=filterKnownProps(c,r.knowProperties,r.knowEvents);a.initialize?a.initialize(i):wijmo_1.copy(a,i,!1,!0);for(let r in e.customProps)void 0!==c[r]&&e.customProps[r](a,c[r]);(e=>{o.current=updateChildProperties({controlRef:{current:a},childInfo:o.current},e)})(t.children||[])};updateProps(e.props||[]);e.props.initialized&&wijmo_1.isFunction(e.props.initialized)&&e.props.initialized(a);return{instance:a,updateProps:updateProps}},props:e.props,parentProp:e.parentProp,wjProperty:e.props.wjProperty,isParentPropArray:e.isParentPropArray,assignedToParent:e.assignedToParent}}exports.useWjComponentChildBase=useWjComponentChildBase;const flushSyncStateCache={isReactRendering:null};function isReactRendering(){if(null==flushSyncStateCache.isReactRendering)try{const e=console.error;let r=!1;console.error=function(){const e=arguments[0]||"";e.includes("flushSync")&&(r=!0)};flushSync(()=>{});console.error=e;flushSyncStateCache.isReactRendering=r}catch(e){}finally{queueMicrotask(()=>{flushSyncStateCache.isReactRendering=null})}return!!flushSyncStateCache.isReactRendering}function getReactDOM(){return ReactDOM}function selectiveDomRender(e,r,t=!1){if(_reactMajorVersion<18){(0,getReactDOM().render)(e,r)}else{isReactRendering()&&(t=!0);const n=elemRootMap.findIndex(e=>e.host===r);let o;if(-1===n){o=reactDomClient.createRoot(r);elemRootMap.push({host:r,root:o})}else o=elemRootMap[n].root;o.__scheduledForUnmount=!1;t?queueMicrotask(()=>{flushSync(()=>{o.render(e)})}):flushSync(()=>{o.render(e)})}return r}exports.selectiveDomRender=selectiveDomRender;function unmountSafely(e){const r=e._internalRoot&&e._internalRoot.containerInfo.firstChild,t=e._internalRoot&&e._internalRoot.current&&e._internalRoot.current.child&&e._internalRoot.current.child.stateNode;t&&r==t?e.unmount():e._internalRoot=null;e.__scheduledForUnmount=null}function selectiveDomUnmount(e){if(_reactMajorVersion<18){(0,getReactDOM().unmountComponentAtNode)(e)}else{const r=elemRootMap.findIndex(r=>r.host===e);if(-1!==r){const e=elemRootMap[r].root;if(isReactRendering()){e.__scheduledForUnmount=!0;queueMicrotask(()=>{e.__scheduledForUnmount&&flushSync(()=>{unmountSafely(e);elemRootMap.splice(r,1)})})}else flushSync(()=>{unmountSafely(e);elemRootMap.splice(r,1)})}}}exports.selectiveDomUnmount=selectiveDomUnmount;function isKeyOrderSame(e,r,t){if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(e[n][t]!=r[n][t])return!1;return!0}function baseFlushSync(){flushSync(()=>{})}exports.baseFlushSync=baseFlushSync;
|
|
14
|
+
"use strict";var __awaiter=this&&this.__awaiter||function(e,n,t,r){return new(t||(t=Promise))((function(o,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r.throw(e))}catch(e){s(e)}}function step(e){e.done?o(e.value):new t((function(n){n(e.value)})).then(fulfilled,rejected)}step((r=r.apply(e,n||[])).next())}))},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var t in e)Object.hasOwnProperty.call(e,t)&&(n[t]=e[t]);n.default=e;return n};Object.defineProperty(exports,"__esModule",{value:!0});const wijmo_1=require("@grapecity/wijmo"),ReactDOM=__importStar(require("react-dom")),React=__importStar(require("react")),flushSyncPolyfill=e=>{e()},createRootPolyfill=()=>{throw"Wijmo: React dependencies not loaded properly"},ReactDomPolyfill={flushSync:flushSyncPolyfill,createRoot:createRootPolyfill};let reactDomClient=ReactDOM||ReactDomPolyfill,flushSync=reactDomClient.flushSync,reactDomClientLoadPromise=null,reactDomClientReady=!1;function setReactDomClient(e){reactDomClient=e||ReactDOM||ReactDomPolyfill;flushSync=e&&e.flushSync||flushSync}function lazyImportDomClient(){return __awaiter(this,void 0,void 0,(function*(){try{
|
|
15
|
+
// Fix bug WJM-37456: webpackIgnore prevents Webpack from statically analyzing
|
|
16
|
+
const e=yield Promise.resolve().then(()=>__importStar(require(/* webpackIgnore: true */"react-dom/client")));setReactDomClient(e.default||e)}catch(e){try{setReactDomClient(require("react-dom/client"))}catch(e){reactDomClient=ReactDOM||ReactDomPolyfill}}reactDomClientReady=!0}))}function ensureReactDomClientLoaded(){return __awaiter(this,void 0,void 0,(function*(){reactDomClientLoadPromise&&(yield reactDomClientLoadPromise)}))}let _reactMajorVersion,elemRootMap=[];if(!_reactMajorVersion){const e=parseInt(React.version);_reactMajorVersion=e;e>=18?reactDomClientLoadPromise=lazyImportDomClient():reactDomClientReady=!0}function wjForwardRef(e){return _reactMajorVersion>=19?n=>e(n,n.ref):React.forwardRef(e)}exports.wjForwardRef=wjForwardRef;let _oldSyncBehavior=!0;function strictStateMode(e=!1){e==_oldSyncBehavior&&(_oldSyncBehavior=!wijmo_1.asBoolean(e,!1))}exports.strictStateMode=strictStateMode;exports.ControlBaseMeta={inputs:["isDisabled","tabOrder"],events:["gotFocus","invalidInput","lostFocus","refreshed","refreshing"]};const alwaysClearProps=new Set(["columns","columnGroups"]),unsuppressedChangedEventProps=new Set(["panes","columnGroups","columns","items"]),specialProps=new Set(["initialized","wjItemTemplate"]),buildInProps=new Set(["className"]);function updateChildProperties(e,n){const t=e.controlRef.current,r={},o={};if(n){const s=wijmo_1.isArray(n)?n.flat(1/0):[n],c=[];let i=0;const a=new Set;for(const e of s){if(e&&e.type&&e.type.$$typeof==Symbol.for("react.forward_ref")){_reactMajorVersion>=19?c.push(e.type.render(e.props,e.props.ref)):c.push(e.type.render(e.props,e.ref));c[c.length-1].$index=i;c[c.length-1].$key=e.key}else if(e&&wijmo_1.isFunction(e.type)){c.push(e.type(e.props));c[c.length-1].$index=i;c[c.length-1].$key=e.key}e||a.add(i);i++}const l=[];for(const e of c)if(e.assignedToParent){if(e.wjProperty){e.parentProp=wijmo_1.asString(e.wjProperty);e.isParentPropArray=t[e.parentProp]&&wijmo_1.isArray(t[e.parentProp])}e.isParentPropArray&&!r[e.parentProp]&&(r[e.parentProp]=[]);e.isParentPropArray?r[e.parentProp].push({getInstance:e.getInstance,props:e.props,$key:e.$key,$index:e.$index}):r[e.parentProp]={getInstance:e.getInstance,props:e.props}}else l.push(e);const u=e.childInfo;for(const e in r)if(wijmo_1.isArray(r[e])){let n=!1;if(t[e]&&null!=t[e]._updating&&!unsuppressedChangedEventProps.has(e)){t[e]._updating++;n=!0}let s=u[e];o[e]=[];let c=!1;if(!u[e]){s=[];if(t[e]&&t[e].clear){t[e].clear();c=!0}else t[e]||(t[e]=new wijmo_1.ObservableArray)}if(!_oldSyncBehavior&&alwaysClearProps.has(e)){if(t[e]&&t[e].clear){t[e].clear();c=!0}}else if(!isKeyOrderSame(s,r[e],"$key")&&t[e]&&t[e].clear){t[e].clear();c=!0}if(_oldSyncBehavior)for(let n=s.length-1;n>=0;n--)if(a.has(s[n].$index)){t[e].remove(s[n].instance);s.splice(n,1)}const i=[],l={};for(const e of s)null!=e.$key?l[""+e.$key]=e:i.push(e);let p=0;const getExistingInstance=(e=null)=>{if(null!=e){const n=l[e];null!=n&&delete l[e];return n}return i[p++]};for(let n=0;n<r[e].length;n++){let s=getExistingInstance(r[e][n].$key),i=!1;if(s)s.updateProps(r[e][n].props);else{s=r[e][n].getInstance(t);i=!0}s.$index=r[e][n].$index;s.$key=r[e][n].$key;(c||i)&&(t[e].length==n?t[e].push(s.instance):t[e].splice(n,0,s.instance));o[e].push(s)}for(const n of Object.keys(l))t[e].remove(l[n].instance);for(;!_oldSyncBehavior&&t[e].length>o[e].length;)t[e].pop();if(n){t[e]._updating--;!c&&u[e]&&u[e].length==r[e].length||t[e]._raiseCollectionChanged&&t[e]._raiseCollectionChanged()}}else{let n=u[e];if(n)n.updateProps(r[e].props);else{n=r[e].getInstance(t);t[e]=n.instance}o[e]=n}const p=[];for(const e of u.$_nonassignable||[])a.has(e.$index)?e.instance&&e.instance.dispose&&wijmo_1.isFunction(e.instance.dispose)&&e.instance.dispose():p.push(e);const d=[];let f=0;for(;f<l.length;f++){let e=p[f];e?e.updateProps(l[f].props):e=l[f].getInstance(t);e.$index=l[f].$index;d.push(e)}o.$_nonassignable=d;for(;f<p.length;f++)p[f].instance&&p[f].instance.dispose&&wijmo_1.isFunction(p[f].instance.dispose)&&p[f].instance.dispose()}if(_oldSyncBehavior)for(const n of Object.keys(e.childInfo))if(wijmo_1.isArray(e.childInfo[n])&&!r[n]&&t[n]&&t[n].remove)for(const r of e.childInfo[n])t[n].remove(r.instance);return o}function getPropsAccordingToSyncMode(e,n,t=null){if(!n||!_oldSyncBehavior){return Object.assign({},e)}const r={};for(const o in e){let s=!1;t&&(s=t.knowProperties.has(o)||t.knowEvents.has(o)||t.knowCustomProps.has(o));(t&&!s||e[o]!==n[o])&&(r[o]=e[o])}return r}function useWjComponentBase(e){const n=React.useRef({}),t=React.useRef(),r=React.useRef(),o=React.useRef(),s=React.useRef(),c=React.useRef({}),i=React.useRef(!1),a=React.useRef(null),l=React.useRef(null);e.customProps||(e.customProps={});if(!t.current){t.current={};t.current.knowProperties=new Set(e.properties);t.current.knowEvents=new Set(e.events);t.current.knowCustomProps=new Set(Object.keys(e.customProps))}let u=e.props;if(s.current){u=getPropsAccordingToSyncMode(e.props,n.current,t.current);n.current=e.props}const p={},d={},f={},h={},m={},y=e.ref||null;for(const n in u)if(t.current.knowProperties.has(n))p[n]=u[n];else if(t.current.knowEvents.has(n)){d[n]=u[n];p[n]=u[n]}else e.customProps[n]?h[n]=u[n]:buildInProps.has(n)?m[n]=u[n]:specialProps.has(n)||(f[n]=u[n]);if(s.current&&_oldSyncBehavior)for(const e in d)delete p[e];const updateProps=()=>{y&&y.current&&(y.current.props=e.props);updateChildProps();let n=[],t=p;if(o.current&&s.current&&!_oldSyncBehavior){for(const e in o.current)if(s.current[e]){if(s.current[e]._handlersChanged){s.current[e]._cachedHandlersChanged=s.current[e]._handlersChanged;s.current[e]._handlersChanged=null;n.push(s.current[e])}s.current[e].removeHandler(o.current[e])}t=Object.assign({},p);for(const e in d){delete t[e];s.current[e].addHandler(d[e])}}else if(!o.current){t=Object.assign({},p);for(const e in d)delete t[e]}o.current=d;if(s.current){wijmo_1.copy(s.current,t,!1,!0);for(const e in m)_setHostAttribute(s.current.hostElement,e,m[e]);for(const n in h)e.customProps[n](s.current,h[n]);(()=>{for(const e of n)if(e._cachedHandlersChanged){e._handlersChanged=e._cachedHandlersChanged;e._cachedHandlersChanged=null}n=[]})()}},updateChildProps=()=>{c.current=updateChildProperties({controlRef:s,childInfo:c.current},e.props.children)};React.useLayoutEffect(()=>{if(r.current&&!s.current){s.current=new e.constructor(r.current,p);e.prePropsInit&&e.prePropsInit(s.current);if(y)if(wijmo_1.isFunction(y)){const n=y({control:s.current,props:e.props});wijmo_1.isFunction(n)&&(a.current=n)}else y.current&&y.current.control==s.current||(y.current={control:s.current,props:e.props});for(const e in m)_setHostAttribute(s.current.hostElement,e,m[e]);e.props.children&&updateProps();e.initControl&&e.initControl(s.current);e.props.initialized&&setTimeout(()=>{s.current&&e.props.initialized(s.current)})}else i.current&&(i.current=!1);return()=>{if(s.current){const e=s.current;i.current=!0;queueMicrotask(()=>{if(i.current){e.dispose();s.current=null;c.current={};i.current=!1;a.current&&a.current()}})}}},[]);s.current&&queueMicrotask(()=>updateProps());const _=React.createElement("div",Object.assign({},f,{ref:r}),[]),_setHostAttribute=(e,n,t)=>{if(e)switch(n){case"className":{const n=l.current;if(n!==t){wijmo_1.removeClass(e,n);wijmo_1.addClass(e,t);l.current=t}break}}};return{renderResult:_,wjControl:s.current}}exports.useWjComponentBase=useWjComponentBase;function filterKnownProps(e,n,t){const r={};for(const o in e)(n.has(o)||t.has(o))&&(r[o]=e[o]);return r}function clearAndGetEvents(e,n,t,r){const o=r.current,s={};for(const e in n)t.has(e)&&(s[e]=n[e]);for(const t in o)e[t]&&(!_oldSyncBehavior||n[t]?e[t].removeHandler(o[t]):s[t]=o[t]);return s}function getCustomPropsData(e,n){const t={};for(const r in n)void 0!==e[r]&&(t[r]=e[r]);return t}function useWjComponentChildBase(e){const n={};n.knowProperties=new Set(e.properties);n.knowEvents=new Set(e.events);e.customProps||(e.customProps={});return{getInstance:t=>{const r={current:{}},o={current:{}},s={current:{}},c=getPropsAccordingToSyncMode(e.props,r.current),i=filterKnownProps(c,n.knowProperties,n.knowEvents),a=getCustomPropsData(c,e.customProps||{}),l=e.customConstructor?e.customConstructor(t,i,a):new e.constructor(e.needParentInstance?t:i,e.needParentInstance?i:void 0);e.ref&&(wijmo_1.isFunction(e.ref)?e.ref({control:l,props:e.props}):e.ref.current&&e.ref.current.control==l||(e.ref.current={control:l,props:e.props}));s.current=clearAndGetEvents(l,c,n.knowEvents,s);const updateProps=t=>{const c=getPropsAccordingToSyncMode(t,r.current);r.current=t;e.ref&&e.ref.current&&(e.ref.current.props=t);s.current=clearAndGetEvents(l,c,n.knowEvents,s);const i=filterKnownProps(c,n.knowProperties,n.knowEvents);l.initialize?l.initialize(i):wijmo_1.copy(l,i,!1,!0);for(const n in e.customProps)void 0!==c[n]&&e.customProps[n](l,c[n]);a=t.children||[],o.current=updateChildProperties({controlRef:{current:l},childInfo:o.current},a);var a};updateProps(e.props||[]);e.props.initialized&&wijmo_1.isFunction(e.props.initialized)&&e.props.initialized(l);return{instance:l,updateProps:updateProps}},props:e.props,parentProp:e.parentProp,wjProperty:e.props.wjProperty,isParentPropArray:e.isParentPropArray,assignedToParent:e.assignedToParent}}exports.useWjComponentChildBase=useWjComponentChildBase;const flushSyncStateCache={isReactRendering:null};function isReactRendering(){if(null==flushSyncStateCache.isReactRendering)try{const e=console.error;let n=!1;console.error=function(){const e=arguments[0]||"";e.includes("flushSync")&&(n=!0)};flushSync(()=>{});console.error=e;flushSyncStateCache.isReactRendering=n}catch(e){}finally{queueMicrotask(()=>{flushSyncStateCache.isReactRendering=null})}return!!flushSyncStateCache.isReactRendering}function getReactDOM(){return ReactDOM}function _doRender(e,n,t=!1){isReactRendering()&&(t=!0);const r=elemRootMap.findIndex(e=>e.host===n);let o;if(-1===r){o=reactDomClient.createRoot(n);elemRootMap.push({host:n,root:o})}else o=elemRootMap[r].root;o.__scheduledForUnmount=!1;t?queueMicrotask(()=>{flushSync(()=>{o.render(e)})}):flushSync(()=>{o.render(e)})}function selectiveDomRender(e,n,t=!1){if(_reactMajorVersion<18){(0,getReactDOM().render)(e,n)}else if(reactDomClientReady)_doRender(e,n,t);else{(()=>__awaiter(this,void 0,void 0,(function*(){yield ensureReactDomClientLoaded();_doRender(e,n,t)})))()}return n}exports.selectiveDomRender=selectiveDomRender;function unmountSafely(e){const n=e._internalRoot&&e._internalRoot.containerInfo.firstChild,t=e._internalRoot&&e._internalRoot.current&&e._internalRoot.current.child&&e._internalRoot.current.child.stateNode;t&&n==t?e.unmount():e._internalRoot=null;e.__scheduledForUnmount=null}function _doUnmount(e){const n=elemRootMap.findIndex(n=>n.host===e);if(-1!==n){const e=elemRootMap[n].root;if(isReactRendering()){e.__scheduledForUnmount=!0;queueMicrotask(()=>{e.__scheduledForUnmount&&flushSync(()=>{unmountSafely(e);elemRootMap.splice(n,1)})})}else flushSync(()=>{unmountSafely(e);elemRootMap.splice(n,1)})}}function selectiveDomUnmount(e){if(_reactMajorVersion<18){(0,getReactDOM().unmountComponentAtNode)(e)}else if(reactDomClientReady)_doUnmount(e);else{(()=>__awaiter(this,void 0,void 0,(function*(){yield ensureReactDomClientLoaded();_doUnmount(e)})))()}}exports.selectiveDomUnmount=selectiveDomUnmount;function isKeyOrderSame(e,n,t){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(e[r][t]!=n[r][t])return!1;return!0}function baseFlushSync(){flushSync(()=>{})}exports.baseFlushSync=baseFlushSync;
|
package/es2015-esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* Wijmo Library 5.
|
|
3
|
+
* Wijmo Library 5.20261.48
|
|
4
4
|
* https://developer.mescius.com/wijmo
|
|
5
5
|
*
|
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
@@ -11,4 +11,6 @@
|
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
var __awaiter=this&&this.__awaiter||function(e,r,n,t){return new(n||(n=Promise))((function(o,s){function fulfilled(e){try{step(t.next(e))}catch(e){s(e)}}function rejected(e){try{step(t.throw(e))}catch(e){s(e)}}function step(e){e.done?o(e.value):new n((function(r){r(e.value)})).then(fulfilled,rejected)}step((t=t.apply(e,r||[])).next())}))};import{ObservableArray,asString,copy,isArray,isFunction,removeClass,addClass,asBoolean}from"@grapecity/wijmo";import*as ReactDOM from"react-dom";import*as React from"react";const flushSyncPolyfill=e=>{e()},createRootPolyfill=()=>{throw"Wijmo: React dependencies not loaded properly"},ReactDomPolyfill={flushSync:flushSyncPolyfill,createRoot:createRootPolyfill};let reactDomClient=ReactDOM||ReactDomPolyfill,flushSync=reactDomClient.flushSync;function lazyImportDomClient(){return __awaiter(this,void 0,void 0,(function*(){try{const e=require("react-dom/client");reactDomClient=e||ReactDOM||ReactDomPolyfill;flushSync=e.flushSync||flushSync}catch(e){reactDomClient=ReactDOM||ReactDomPolyfill}}))}let _reactMajorVersion,elemRootMap=[];if(!_reactMajorVersion){const e=parseInt(React.version);_reactMajorVersion=e;e>=18&&lazyImportDomClient()}export function wjForwardRef(e){return _reactMajorVersion>=19?r=>e(r,r.ref):React.forwardRef(e)}let _oldSyncBehavior=!0;export function strictStateMode(e=!1){e==_oldSyncBehavior&&(_oldSyncBehavior=!asBoolean(e,!1))}export const ControlBaseMeta={inputs:["isDisabled","tabOrder"],events:["gotFocus","invalidInput","lostFocus","refreshed","refreshing"]};const alwaysClearProps=new Set(["columns","columnGroups"]),unsuppressedChangedEventProps=new Set(["panes","columnGroups","columns","items"]),specialProps=new Set(["initialized","wjItemTemplate"]),buildInProps=new Set(["className"]);function updateChildProperties(e,r){const n=e.controlRef.current,t={},o={};if(r){const s=isArray(r)?r.flat(1/0):[r],c=[];let i=0;const l=new Set;for(let e of s){if(e&&e.type&&e.type.$$typeof==Symbol.for("react.forward_ref")){_reactMajorVersion>=19?c.push(e.type.render(e.props,e.props.ref)):c.push(e.type.render(e.props,e.ref));c[c.length-1].$index=i;c[c.length-1].$key=e.key}else if(e&&isFunction(e.type)){c.push(e.type(e.props));c[c.length-1].$index=i;c[c.length-1].$key=e.key}e||l.add(i);i++}const a=[];for(let e of c)if(e.assignedToParent){if(e.wjProperty){e.parentProp=asString(e.wjProperty);e.isParentPropArray=n[e.parentProp]&&isArray(n[e.parentProp])}e.isParentPropArray&&!t[e.parentProp]&&(t[e.parentProp]=[]);e.isParentPropArray?t[e.parentProp].push({getInstance:e.getInstance,props:e.props,$key:e.$key,$index:e.$index}):t[e.parentProp]={getInstance:e.getInstance,props:e.props}}else a.push(e);const u=e.childInfo;for(let e in t)if(isArray(t[e])){let r=!1;if(n[e]&&null!=n[e]._updating&&!unsuppressedChangedEventProps.has(e)){n[e]._updating++;r=!0}let s=u[e];o[e]=[];let c=!1;if(!u[e]){s=[];if(n[e]&&n[e].clear){n[e].clear();c=!0}else n[e]||(n[e]=new ObservableArray)}if(!_oldSyncBehavior&&alwaysClearProps.has(e)){if(n[e]&&n[e].clear){n[e].clear();c=!0}}else if(!isKeyOrderSame(s,t[e],"$key")&&n[e]&&n[e].clear){n[e].clear();c=!0}if(_oldSyncBehavior)for(let r=s.length-1;r>=0;r--)if(l.has(s[r].$index)){n[e].remove(s[r].instance);s.splice(r,1)}const i=[],a={};for(let e of s)null!=e.$key?a[""+e.$key]=e:i.push(e);let p=0;const getExistingInstance=(e=null)=>{if(null!=e){let r=a[e];null!=r&&delete a[e];return r}return i[p++]};for(let r=0;r<t[e].length;r++){let s=getExistingInstance(t[e][r].$key),i=!1;if(s)s.updateProps(t[e][r].props);else{s=t[e][r].getInstance(n);i=!0}s.$index=t[e][r].$index;s.$key=t[e][r].$key;(c||i)&&(n[e].length==r?n[e].push(s.instance):n[e].splice(r,0,s.instance));o[e].push(s)}for(let r of Object.keys(a))n[e].remove(a[r].instance);for(;!_oldSyncBehavior&&n[e].length>o[e].length;)n[e].pop();if(r){n[e]._updating--;!c&&u[e]&&u[e].length==t[e].length||n[e]._raiseCollectionChanged&&n[e]._raiseCollectionChanged()}}else{let r=u[e];if(r)r.updateProps(t[e].props);else{r=t[e].getInstance(n);n[e]=r.instance}o[e]=r}const p=[];for(let e of u.$_nonassignable||[])l.has(e.$index)?e.instance&&e.instance.dispose&&isFunction(e.instance.dispose)&&e.instance.dispose():p.push(e);const f=[];let d=0;for(;d<a.length;d++){let e=p[d];e?e.updateProps(a[d].props):e=a[d].getInstance(n);e.$index=a[d].$index;f.push(e)}o.$_nonassignable=f;for(;d<p.length;d++)p[d].instance&&p[d].instance.dispose&&isFunction(p[d].instance.dispose)&&p[d].instance.dispose()}if(_oldSyncBehavior)for(let r of Object.keys(e.childInfo))if(isArray(e.childInfo[r])&&!t[r]&&n[r]&&n[r].remove)for(let t of e.childInfo[r])n[r].remove(t.instance);return o}function getPropsAccordingToSyncMode(e,r,n=null){if(!r||!_oldSyncBehavior){return Object.assign({},e)}let t={};for(let o in e){let s=!1;n&&(s=n.knowProperties.has(o)||n.knowEvents.has(o)||n.knowCustomProps.has(o));(n&&!s||e[o]!==r[o])&&(t[o]=e[o])}return t}export function useWjComponentBase(e){const r=React.useRef({}),n=React.useRef(),t=React.useRef(),o=React.useRef(),s=React.useRef(),c=React.useRef({}),i=React.useRef(!1),l=React.useRef(null),a=React.useRef(null);e.customProps||(e.customProps={});if(!n.current){n.current={};n.current.knowProperties=new Set(e.properties);n.current.knowEvents=new Set(e.events);n.current.knowCustomProps=new Set(Object.keys(e.customProps))}let u=e.props;if(s.current){u=getPropsAccordingToSyncMode(e.props,r.current,n.current);r.current=e.props}const p={},f={},d={},h={},y={},m=e.ref||null;for(let r in u)if(n.current.knowProperties.has(r))p[r]=u[r];else if(n.current.knowEvents.has(r)){f[r]=u[r];p[r]=u[r]}else e.customProps[r]?h[r]=u[r]:buildInProps.has(r)?y[r]=u[r]:specialProps.has(r)||(d[r]=u[r]);if(s.current&&_oldSyncBehavior)for(let e in f)delete p[e];const updateProps=()=>{m&&m.current&&(m.current.props=e.props);updateChildProps();let r=[],n=p;if(o.current&&s.current&&!_oldSyncBehavior){for(let e in o.current)if(s.current[e]){if(s.current[e]._handlersChanged){s.current[e]._cachedHandlersChanged=s.current[e]._handlersChanged;s.current[e]._handlersChanged=null;r.push(s.current[e])}s.current[e].removeHandler(o.current[e])}n=Object.assign({},p);for(let e in f){delete n[e];s.current[e].addHandler(f[e])}}else if(!o.current){n=Object.assign({},p);for(let e in f)delete n[e]}o.current=f;if(s.current){copy(s.current,n,!1,!0);for(let e in y)_setHostAttribute(s.current.hostElement,e,y[e]);for(let r in h)e.customProps[r](s.current,h[r]);(()=>{for(let e of r)if(e._cachedHandlersChanged){e._handlersChanged=e._cachedHandlersChanged;e._cachedHandlersChanged=null}r=[]})()}},updateChildProps=()=>{c.current=updateChildProperties({controlRef:s,childInfo:c.current},e.props.children)};React.useLayoutEffect(()=>{if(t.current&&!s.current){s.current=new e.constructor(t.current,p);e.prePropsInit&&e.prePropsInit(s.current);if(m)if(isFunction(m)){const r=m({control:s.current,props:e.props});isFunction(r)&&(l.current=r)}else m.current&&m.current.control==s.current||(m.current={control:s.current,props:e.props});for(let e in y)_setHostAttribute(s.current.hostElement,e,y[e]);e.props.children&&updateProps();e.initControl&&e.initControl(s.current);e.props.initialized&&setTimeout(()=>{s.current&&e.props.initialized(s.current)})}else i.current&&(i.current=!1);return()=>{if(s.current){const e=s.current;i.current=!0;queueMicrotask(()=>{if(i.current){e.dispose();s.current=null;c.current={};i.current=!1;l.current&&l.current()}})}}},[]);s.current&&queueMicrotask(()=>updateProps());const P=React.createElement("div",Object.assign({},d,{ref:t}),[]),_setHostAttribute=(e,r,n)=>{if(e)switch(r){case"className":const r=a.current;if(r!==n){removeClass(e,r);addClass(e,n);a.current=n}}};return{renderResult:P,wjControl:s.current}}function filterKnownProps(e,r,n){const t={};for(let o in e)(r.has(o)||n.has(o))&&(t[o]=e[o]);return t}function clearAndGetEvents(e,r,n,t){const o=t.current,s={};for(let e in r)n.has(e)&&(s[e]=r[e]);for(let n in o)e[n]&&(!_oldSyncBehavior||r[n]?e[n].removeHandler(o[n]):s[n]=o[n]);return s}function getCustomPropsData(e,r){const n={};for(let t in r)void 0!==e[t]&&(n[t]=e[t]);return n}export function useWjComponentChildBase(e){const r={};r.knowProperties=new Set(e.properties);r.knowEvents=new Set(e.events);e.customProps||(e.customProps={});return{getInstance:n=>{const t={current:{}},o={current:{}},s={current:{}},c=getPropsAccordingToSyncMode(e.props,t.current),i=filterKnownProps(c,r.knowProperties,r.knowEvents),l=getCustomPropsData(c,e.customProps||{}),a=e.customConstructor?e.customConstructor(n,i,l):new e.constructor(e.needParentInstance?n:i,e.needParentInstance?i:void 0);e.ref&&(isFunction(e.ref)?e.ref({control:a,props:e.props}):e.ref.current&&e.ref.current.control==a||(e.ref.current={control:a,props:e.props}));s.current=clearAndGetEvents(a,c,r.knowEvents,s);const updateProps=n=>{const c=getPropsAccordingToSyncMode(n,t.current);t.current=n;e.ref&&e.ref.current&&(e.ref.current.props=n);s.current=clearAndGetEvents(a,c,r.knowEvents,s);const i=filterKnownProps(c,r.knowProperties,r.knowEvents);a.initialize?a.initialize(i):copy(a,i,!1,!0);for(let r in e.customProps)void 0!==c[r]&&e.customProps[r](a,c[r]);(e=>{o.current=updateChildProperties({controlRef:{current:a},childInfo:o.current},e)})(n.children||[])};updateProps(e.props||[]);e.props.initialized&&isFunction(e.props.initialized)&&e.props.initialized(a);return{instance:a,updateProps:updateProps}},props:e.props,parentProp:e.parentProp,wjProperty:e.props.wjProperty,isParentPropArray:e.isParentPropArray,assignedToParent:e.assignedToParent}}const flushSyncStateCache={isReactRendering:null};function isReactRendering(){if(null==flushSyncStateCache.isReactRendering)try{const e=console.error;let r=!1;console.error=function(){const e=arguments[0]||"";e.includes("flushSync")&&(r=!0)};flushSync(()=>{});console.error=e;flushSyncStateCache.isReactRendering=r}catch(e){}finally{queueMicrotask(()=>{flushSyncStateCache.isReactRendering=null})}return!!flushSyncStateCache.isReactRendering}function getReactDOM(){return ReactDOM}export function selectiveDomRender(e,r,n=!1){if(_reactMajorVersion<18){(0,getReactDOM().render)(e,r)}else{isReactRendering()&&(n=!0);const t=elemRootMap.findIndex(e=>e.host===r);let o;if(-1===t){o=reactDomClient.createRoot(r);elemRootMap.push({host:r,root:o})}else o=elemRootMap[t].root;o.__scheduledForUnmount=!1;n?queueMicrotask(()=>{flushSync(()=>{o.render(e)})}):flushSync(()=>{o.render(e)})}return r}function unmountSafely(e){const r=e._internalRoot&&e._internalRoot.containerInfo.firstChild,n=e._internalRoot&&e._internalRoot.current&&e._internalRoot.current.child&&e._internalRoot.current.child.stateNode;n&&r==n?e.unmount():e._internalRoot=null;e.__scheduledForUnmount=null}export function selectiveDomUnmount(e){if(_reactMajorVersion<18){(0,getReactDOM().unmountComponentAtNode)(e)}else{const r=elemRootMap.findIndex(r=>r.host===e);if(-1!==r){const e=elemRootMap[r].root;if(isReactRendering()){e.__scheduledForUnmount=!0;queueMicrotask(()=>{e.__scheduledForUnmount&&flushSync(()=>{unmountSafely(e);elemRootMap.splice(r,1)})})}else flushSync(()=>{unmountSafely(e);elemRootMap.splice(r,1)})}}}function isKeyOrderSame(e,r,n){if(e.length!=r.length)return!1;for(let t=0;t<e.length;t++)if(e[t][n]!=r[t][n])return!1;return!0}export function baseFlushSync(){flushSync(()=>{})}
|
|
14
|
+
var __awaiter=this&&this.__awaiter||function(e,n,t,r){return new(t||(t=Promise))((function(o,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r.throw(e))}catch(e){s(e)}}function step(e){e.done?o(e.value):new t((function(n){n(e.value)})).then(fulfilled,rejected)}step((r=r.apply(e,n||[])).next())}))};import{ObservableArray,asString,copy,isArray,isFunction,removeClass,addClass,asBoolean}from"@grapecity/wijmo";import*as ReactDOM from"react-dom";import*as React from"react";const flushSyncPolyfill=e=>{e()},createRootPolyfill=()=>{throw"Wijmo: React dependencies not loaded properly"},ReactDomPolyfill={flushSync:flushSyncPolyfill,createRoot:createRootPolyfill};let reactDomClient=ReactDOM||ReactDomPolyfill,flushSync=reactDomClient.flushSync,reactDomClientLoadPromise=null,reactDomClientReady=!1;function setReactDomClient(e){reactDomClient=e||ReactDOM||ReactDomPolyfill;flushSync=e&&e.flushSync||flushSync}function lazyImportDomClient(){return __awaiter(this,void 0,void 0,(function*(){try{
|
|
15
|
+
// Fix bug WJM-37456: webpackIgnore prevents Webpack from statically analyzing
|
|
16
|
+
const e=yield import(/* webpackIgnore: true */"react-dom/client");setReactDomClient(e.default||e)}catch(e){try{setReactDomClient(require("react-dom/client"))}catch(e){reactDomClient=ReactDOM||ReactDomPolyfill}}reactDomClientReady=!0}))}function ensureReactDomClientLoaded(){return __awaiter(this,void 0,void 0,(function*(){reactDomClientLoadPromise&&(yield reactDomClientLoadPromise)}))}let _reactMajorVersion,elemRootMap=[];if(!_reactMajorVersion){const e=parseInt(React.version);_reactMajorVersion=e;e>=18?reactDomClientLoadPromise=lazyImportDomClient():reactDomClientReady=!0}export function wjForwardRef(e){return _reactMajorVersion>=19?n=>e(n,n.ref):React.forwardRef(e)}let _oldSyncBehavior=!0;export function strictStateMode(e=!1){e==_oldSyncBehavior&&(_oldSyncBehavior=!asBoolean(e,!1))}export const ControlBaseMeta={inputs:["isDisabled","tabOrder"],events:["gotFocus","invalidInput","lostFocus","refreshed","refreshing"]};const alwaysClearProps=new Set(["columns","columnGroups"]),unsuppressedChangedEventProps=new Set(["panes","columnGroups","columns","items"]),specialProps=new Set(["initialized","wjItemTemplate"]),buildInProps=new Set(["className"]);function updateChildProperties(e,n){const t=e.controlRef.current,r={},o={};if(n){const s=isArray(n)?n.flat(1/0):[n],c=[];let i=0;const a=new Set;for(const e of s){if(e&&e.type&&e.type.$$typeof==Symbol.for("react.forward_ref")){_reactMajorVersion>=19?c.push(e.type.render(e.props,e.props.ref)):c.push(e.type.render(e.props,e.ref));c[c.length-1].$index=i;c[c.length-1].$key=e.key}else if(e&&isFunction(e.type)){c.push(e.type(e.props));c[c.length-1].$index=i;c[c.length-1].$key=e.key}e||a.add(i);i++}const l=[];for(const e of c)if(e.assignedToParent){if(e.wjProperty){e.parentProp=asString(e.wjProperty);e.isParentPropArray=t[e.parentProp]&&isArray(t[e.parentProp])}e.isParentPropArray&&!r[e.parentProp]&&(r[e.parentProp]=[]);e.isParentPropArray?r[e.parentProp].push({getInstance:e.getInstance,props:e.props,$key:e.$key,$index:e.$index}):r[e.parentProp]={getInstance:e.getInstance,props:e.props}}else l.push(e);const u=e.childInfo;for(const e in r)if(isArray(r[e])){let n=!1;if(t[e]&&null!=t[e]._updating&&!unsuppressedChangedEventProps.has(e)){t[e]._updating++;n=!0}let s=u[e];o[e]=[];let c=!1;if(!u[e]){s=[];if(t[e]&&t[e].clear){t[e].clear();c=!0}else t[e]||(t[e]=new ObservableArray)}if(!_oldSyncBehavior&&alwaysClearProps.has(e)){if(t[e]&&t[e].clear){t[e].clear();c=!0}}else if(!isKeyOrderSame(s,r[e],"$key")&&t[e]&&t[e].clear){t[e].clear();c=!0}if(_oldSyncBehavior)for(let n=s.length-1;n>=0;n--)if(a.has(s[n].$index)){t[e].remove(s[n].instance);s.splice(n,1)}const i=[],l={};for(const e of s)null!=e.$key?l[""+e.$key]=e:i.push(e);let p=0;const getExistingInstance=(e=null)=>{if(null!=e){const n=l[e];null!=n&&delete l[e];return n}return i[p++]};for(let n=0;n<r[e].length;n++){let s=getExistingInstance(r[e][n].$key),i=!1;if(s)s.updateProps(r[e][n].props);else{s=r[e][n].getInstance(t);i=!0}s.$index=r[e][n].$index;s.$key=r[e][n].$key;(c||i)&&(t[e].length==n?t[e].push(s.instance):t[e].splice(n,0,s.instance));o[e].push(s)}for(const n of Object.keys(l))t[e].remove(l[n].instance);for(;!_oldSyncBehavior&&t[e].length>o[e].length;)t[e].pop();if(n){t[e]._updating--;!c&&u[e]&&u[e].length==r[e].length||t[e]._raiseCollectionChanged&&t[e]._raiseCollectionChanged()}}else{let n=u[e];if(n)n.updateProps(r[e].props);else{n=r[e].getInstance(t);t[e]=n.instance}o[e]=n}const p=[];for(const e of u.$_nonassignable||[])a.has(e.$index)?e.instance&&e.instance.dispose&&isFunction(e.instance.dispose)&&e.instance.dispose():p.push(e);const d=[];let f=0;for(;f<l.length;f++){let e=p[f];e?e.updateProps(l[f].props):e=l[f].getInstance(t);e.$index=l[f].$index;d.push(e)}o.$_nonassignable=d;for(;f<p.length;f++)p[f].instance&&p[f].instance.dispose&&isFunction(p[f].instance.dispose)&&p[f].instance.dispose()}if(_oldSyncBehavior)for(const n of Object.keys(e.childInfo))if(isArray(e.childInfo[n])&&!r[n]&&t[n]&&t[n].remove)for(const r of e.childInfo[n])t[n].remove(r.instance);return o}function getPropsAccordingToSyncMode(e,n,t=null){if(!n||!_oldSyncBehavior){return Object.assign({},e)}const r={};for(const o in e){let s=!1;t&&(s=t.knowProperties.has(o)||t.knowEvents.has(o)||t.knowCustomProps.has(o));(t&&!s||e[o]!==n[o])&&(r[o]=e[o])}return r}export function useWjComponentBase(e){const n=React.useRef({}),t=React.useRef(),r=React.useRef(),o=React.useRef(),s=React.useRef(),c=React.useRef({}),i=React.useRef(!1),a=React.useRef(null),l=React.useRef(null);e.customProps||(e.customProps={});if(!t.current){t.current={};t.current.knowProperties=new Set(e.properties);t.current.knowEvents=new Set(e.events);t.current.knowCustomProps=new Set(Object.keys(e.customProps))}let u=e.props;if(s.current){u=getPropsAccordingToSyncMode(e.props,n.current,t.current);n.current=e.props}const p={},d={},f={},h={},y={},m=e.ref||null;for(const n in u)if(t.current.knowProperties.has(n))p[n]=u[n];else if(t.current.knowEvents.has(n)){d[n]=u[n];p[n]=u[n]}else e.customProps[n]?h[n]=u[n]:buildInProps.has(n)?y[n]=u[n]:specialProps.has(n)||(f[n]=u[n]);if(s.current&&_oldSyncBehavior)for(const e in d)delete p[e];const updateProps=()=>{m&&m.current&&(m.current.props=e.props);updateChildProps();let n=[],t=p;if(o.current&&s.current&&!_oldSyncBehavior){for(const e in o.current)if(s.current[e]){if(s.current[e]._handlersChanged){s.current[e]._cachedHandlersChanged=s.current[e]._handlersChanged;s.current[e]._handlersChanged=null;n.push(s.current[e])}s.current[e].removeHandler(o.current[e])}t=Object.assign({},p);for(const e in d){delete t[e];s.current[e].addHandler(d[e])}}else if(!o.current){t=Object.assign({},p);for(const e in d)delete t[e]}o.current=d;if(s.current){copy(s.current,t,!1,!0);for(const e in y)_setHostAttribute(s.current.hostElement,e,y[e]);for(const n in h)e.customProps[n](s.current,h[n]);(()=>{for(const e of n)if(e._cachedHandlersChanged){e._handlersChanged=e._cachedHandlersChanged;e._cachedHandlersChanged=null}n=[]})()}},updateChildProps=()=>{c.current=updateChildProperties({controlRef:s,childInfo:c.current},e.props.children)};React.useLayoutEffect(()=>{if(r.current&&!s.current){s.current=new e.constructor(r.current,p);e.prePropsInit&&e.prePropsInit(s.current);if(m)if(isFunction(m)){const n=m({control:s.current,props:e.props});isFunction(n)&&(a.current=n)}else m.current&&m.current.control==s.current||(m.current={control:s.current,props:e.props});for(const e in y)_setHostAttribute(s.current.hostElement,e,y[e]);e.props.children&&updateProps();e.initControl&&e.initControl(s.current);e.props.initialized&&setTimeout(()=>{s.current&&e.props.initialized(s.current)})}else i.current&&(i.current=!1);return()=>{if(s.current){const e=s.current;i.current=!0;queueMicrotask(()=>{if(i.current){e.dispose();s.current=null;c.current={};i.current=!1;a.current&&a.current()}})}}},[]);s.current&&queueMicrotask(()=>updateProps());const R=React.createElement("div",Object.assign({},f,{ref:r}),[]),_setHostAttribute=(e,n,t)=>{if(e)switch(n){case"className":{const n=l.current;if(n!==t){removeClass(e,n);addClass(e,t);l.current=t}break}}};return{renderResult:R,wjControl:s.current}}function filterKnownProps(e,n,t){const r={};for(const o in e)(n.has(o)||t.has(o))&&(r[o]=e[o]);return r}function clearAndGetEvents(e,n,t,r){const o=r.current,s={};for(const e in n)t.has(e)&&(s[e]=n[e]);for(const t in o)e[t]&&(!_oldSyncBehavior||n[t]?e[t].removeHandler(o[t]):s[t]=o[t]);return s}function getCustomPropsData(e,n){const t={};for(const r in n)void 0!==e[r]&&(t[r]=e[r]);return t}export function useWjComponentChildBase(e){const n={};n.knowProperties=new Set(e.properties);n.knowEvents=new Set(e.events);e.customProps||(e.customProps={});return{getInstance:t=>{const r={current:{}},o={current:{}},s={current:{}},c=getPropsAccordingToSyncMode(e.props,r.current),i=filterKnownProps(c,n.knowProperties,n.knowEvents),a=getCustomPropsData(c,e.customProps||{}),l=e.customConstructor?e.customConstructor(t,i,a):new e.constructor(e.needParentInstance?t:i,e.needParentInstance?i:void 0);e.ref&&(isFunction(e.ref)?e.ref({control:l,props:e.props}):e.ref.current&&e.ref.current.control==l||(e.ref.current={control:l,props:e.props}));s.current=clearAndGetEvents(l,c,n.knowEvents,s);const updateProps=t=>{const c=getPropsAccordingToSyncMode(t,r.current);r.current=t;e.ref&&e.ref.current&&(e.ref.current.props=t);s.current=clearAndGetEvents(l,c,n.knowEvents,s);const i=filterKnownProps(c,n.knowProperties,n.knowEvents);l.initialize?l.initialize(i):copy(l,i,!1,!0);for(const n in e.customProps)void 0!==c[n]&&e.customProps[n](l,c[n]);a=t.children||[],o.current=updateChildProperties({controlRef:{current:l},childInfo:o.current},a);var a};updateProps(e.props||[]);e.props.initialized&&isFunction(e.props.initialized)&&e.props.initialized(l);return{instance:l,updateProps:updateProps}},props:e.props,parentProp:e.parentProp,wjProperty:e.props.wjProperty,isParentPropArray:e.isParentPropArray,assignedToParent:e.assignedToParent}}const flushSyncStateCache={isReactRendering:null};function isReactRendering(){if(null==flushSyncStateCache.isReactRendering)try{const e=console.error;let n=!1;console.error=function(){const e=arguments[0]||"";e.includes("flushSync")&&(n=!0)};flushSync(()=>{});console.error=e;flushSyncStateCache.isReactRendering=n}catch(e){}finally{queueMicrotask(()=>{flushSyncStateCache.isReactRendering=null})}return!!flushSyncStateCache.isReactRendering}function getReactDOM(){return ReactDOM}function _doRender(e,n,t=!1){isReactRendering()&&(t=!0);const r=elemRootMap.findIndex(e=>e.host===n);let o;if(-1===r){o=reactDomClient.createRoot(n);elemRootMap.push({host:n,root:o})}else o=elemRootMap[r].root;o.__scheduledForUnmount=!1;t?queueMicrotask(()=>{flushSync(()=>{o.render(e)})}):flushSync(()=>{o.render(e)})}export function selectiveDomRender(e,n,t=!1){if(_reactMajorVersion<18){(0,getReactDOM().render)(e,n)}else if(reactDomClientReady)_doRender(e,n,t);else{(()=>__awaiter(this,void 0,void 0,(function*(){yield ensureReactDomClientLoaded();_doRender(e,n,t)})))()}return n}function unmountSafely(e){const n=e._internalRoot&&e._internalRoot.containerInfo.firstChild,t=e._internalRoot&&e._internalRoot.current&&e._internalRoot.current.child&&e._internalRoot.current.child.stateNode;t&&n==t?e.unmount():e._internalRoot=null;e.__scheduledForUnmount=null}function _doUnmount(e){const n=elemRootMap.findIndex(n=>n.host===e);if(-1!==n){const e=elemRootMap[n].root;if(isReactRendering()){e.__scheduledForUnmount=!0;queueMicrotask(()=>{e.__scheduledForUnmount&&flushSync(()=>{unmountSafely(e);elemRootMap.splice(n,1)})})}else flushSync(()=>{unmountSafely(e);elemRootMap.splice(n,1)})}}export function selectiveDomUnmount(e){if(_reactMajorVersion<18){(0,getReactDOM().unmountComponentAtNode)(e)}else if(reactDomClientReady)_doUnmount(e);else{(()=>__awaiter(this,void 0,void 0,(function*(){yield ensureReactDomClientLoaded();_doUnmount(e)})))()}}function isKeyOrderSame(e,n,t){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(e[r][t]!=n[r][t])return!1;return!0}export function baseFlushSync(){flushSync(()=>{})}
|
package/es5-esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* Wijmo Library 5.
|
|
3
|
+
* Wijmo Library 5.20261.48
|
|
4
4
|
* https://developer.mescius.com/wijmo
|
|
5
5
|
*
|
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(e,r,n,t){return new(n||(n=Promise))((function(o,a){function fulfilled(e){try{step(t.next(e))}catch(e){a(e)}}function rejected(e){try{step(t.throw(e))}catch(e){a(e)}}function step(e){e.done?o(e.value):new n((function(r){r(e.value)})).then(fulfilled,rejected)}step((t=t.apply(e,r||[])).next())}))},__generator=this&&this.__generator||function(e,r){var n,t,o,a,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function verb(a){return function(i){return function step(a){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;(t=0,o)&&(a=[2&a[0],o.value]);switch(a[0]){case 0:case 1:o=a;break;case 4:s.label++;return{value:a[1],done:!1};case 5:s.label++;t=a[1];a=[0];continue;case 7:a=s.ops.pop();s.trys.pop();continue;default:if(!(o=s.trys,o=o.length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1];o=a;break}if(o&&s.label<o[2]){s.label=o[2];s.ops.push(a);break}o[2]&&s.ops.pop();s.trys.pop();continue}a=r.call(e,s)}catch(e){a=[6,e];t=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}};import{ObservableArray,asString,copy,isArray,isFunction,removeClass,addClass,asBoolean}from"@grapecity/wijmo";import*as ReactDOM from"react-dom";import*as React from"react";var flushSyncPolyfill=function(e){e()},createRootPolyfill=function(){throw"Wijmo: React dependencies not loaded properly"},ReactDomPolyfill={flushSync:flushSyncPolyfill,createRoot:createRootPolyfill},reactDomClient=ReactDOM||ReactDomPolyfill,flushSync=reactDomClient.flushSync;function lazyImportDomClient(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){try{e=require("react-dom/client");reactDomClient=e||ReactDOM||ReactDomPolyfill;flushSync=e.flushSync||flushSync}catch(e){reactDomClient=ReactDOM||ReactDomPolyfill}return[2]}))}))}var _reactMajorVersion,elemRootMap=[];if(!_reactMajorVersion){var version=parseInt(React.version);_reactMajorVersion=version;version>=18&&lazyImportDomClient()}export function wjForwardRef(e){return _reactMajorVersion>=19?function(r){return e(r,r.ref)}:React.forwardRef(e)}var _oldSyncBehavior=!0;export function strictStateMode(e){void 0===e&&(e=!1);e==_oldSyncBehavior&&(_oldSyncBehavior=!asBoolean(e,!1))}export var ControlBaseMeta={inputs:["isDisabled","tabOrder"],events:["gotFocus","invalidInput","lostFocus","refreshed","refreshing"]};var alwaysClearProps=new Set(["columns","columnGroups"]),unsuppressedChangedEventProps=new Set(["panes","columnGroups","columns","items"]),specialProps=new Set(["initialized","wjItemTemplate"]),buildInProps=new Set(["className"]);function updateChildProperties(e,r){var n=e.controlRef.current,t={},o={};if(r){for(var a=isArray(r)?r.flat(1/0):[r],s=[],i=0,c=new Set,u=0,l=a;u<l.length;u++){if((P=l[u])&&P.type&&P.type.$$typeof==Symbol.for("react.forward_ref")){_reactMajorVersion>=19?s.push(P.type.render(P.props,P.props.ref)):s.push(P.type.render(P.props,P.ref));s[s.length-1].$index=i;s[s.length-1].$key=P.key}else if(P&&isFunction(P.type)){s.push(P.type(P.props));s[s.length-1].$index=i;s[s.length-1].$key=P.key}P||c.add(i);i++}for(var p=[],f=0,d=s;f<d.length;f++){if((P=d[f]).assignedToParent){if(P.wjProperty){P.parentProp=asString(P.wjProperty);P.isParentPropArray=n[P.parentProp]&&isArray(n[P.parentProp])}P.isParentPropArray&&!t[P.parentProp]&&(t[P.parentProp]=[]);P.isParentPropArray?t[P.parentProp].push({getInstance:P.getInstance,props:P.props,$key:P.$key,$index:P.$index}):t[P.parentProp]={getInstance:P.getInstance,props:P.props}}else p.push(P)}var h=e.childInfo,_loop_1=function(e){if(isArray(t[e])){var r=!1;if(n[e]&&null!=n[e]._updating&&!unsuppressedChangedEventProps.has(e)){n[e]._updating++;r=!0}var a=h[e];o[e]=[];var s=!1;if(!h[e]){a=[];if(n[e]&&n[e].clear){n[e].clear();s=!0}else n[e]||(n[e]=new ObservableArray)}if(!_oldSyncBehavior&&alwaysClearProps.has(e)){if(n[e]&&n[e].clear){n[e].clear();s=!0}}else if(!isKeyOrderSame(a,t[e],"$key")&&n[e]&&n[e].clear){n[e].clear();s=!0}if(_oldSyncBehavior)for(var i=a.length-1;i>=0;i--)if(c.has(a[i].$index)){n[e].remove(a[i].instance);a.splice(i,1)}for(var u=[],l={},p=0,f=a;p<f.length;p++){var d=f[p];null!=d.$key?l[""+d.$key]=d:u.push(d)}for(var v=0,getExistingInstance=function(e){void 0===e&&(e=null);if(null!=e){var r=l[e];null!=r&&delete l[e];return r}return u[v++]},y=0;y<t[e].length;y++){var g=!1;if(_=getExistingInstance(t[e][y].$key))_.updateProps(t[e][y].props);else{_=t[e][y].getInstance(n);g=!0}_.$index=t[e][y].$index;_.$key=t[e][y].$key;(s||g)&&(n[e].length==y?n[e].push(_.instance):n[e].splice(y,0,_.instance));o[e].push(_)}for(var m=0,P=Object.keys(l);m<P.length;m++){var R=P[m];n[e].remove(l[R].instance)}for(;!_oldSyncBehavior&&n[e].length>o[e].length;)n[e].pop();if(r){n[e]._updating--;!s&&h[e]&&h[e].length==t[e].length||n[e]._raiseCollectionChanged&&n[e]._raiseCollectionChanged()}}else{var _;if(_=h[e])_.updateProps(t[e].props);else{_=t[e].getInstance(n);n[e]=_.instance}o[e]=_}};for(var v in t)_loop_1(v);for(var y=[],g=0,m=h.$_nonassignable||[];g<m.length;g++){var P=m[g];c.has(P.$index)?P.instance&&P.instance.dispose&&isFunction(P.instance.dispose)&&P.instance.dispose():y.push(P)}for(var R=[],_=0;_<p.length;_++){var S=y[_];S?S.updateProps(p[_].props):S=p[_].getInstance(n);S.$index=p[_].$index;R.push(S)}o.$_nonassignable=R;for(;_<y.length;_++)y[_].instance&&y[_].instance.dispose&&isFunction(y[_].instance.dispose)&&y[_].instance.dispose()}if(_oldSyncBehavior)for(var w=0,C=Object.keys(e.childInfo);w<C.length;w++){var k=C[w];if(isArray(e.childInfo[k])&&!t[k]&&n[k]&&n[k].remove)for(var b=0,M=e.childInfo[k];b<M.length;b++){var I=M[b];n[k].remove(I.instance)}}return o}function getPropsAccordingToSyncMode(e,r,n){void 0===n&&(n=null);if(!r||!_oldSyncBehavior){return __assign({},e)}var t={};for(var o in e){var a=!1;n&&(a=n.knowProperties.has(o)||n.knowEvents.has(o)||n.knowCustomProps.has(o));(n&&!a||e[o]!==r[o])&&(t[o]=e[o])}return t}export function useWjComponentBase(e){var r=React.useRef({}),n=React.useRef(),t=React.useRef(),o=React.useRef(),a=React.useRef(),s=React.useRef({}),i=React.useRef(!1),c=React.useRef(null),u=React.useRef(null);e.customProps||(e.customProps={});if(!n.current){n.current={};n.current.knowProperties=new Set(e.properties);n.current.knowEvents=new Set(e.events);n.current.knowCustomProps=new Set(Object.keys(e.customProps))}var l=e.props;if(a.current){l=getPropsAccordingToSyncMode(e.props,r.current,n.current);r.current=e.props}var p={},f={},d={},h={},v={},y=e.ref||null;for(var g in l)if(n.current.knowProperties.has(g))p[g]=l[g];else if(n.current.knowEvents.has(g)){f[g]=l[g];p[g]=l[g]}else e.customProps[g]?h[g]=l[g]:buildInProps.has(g)?v[g]=l[g]:specialProps.has(g)||(d[g]=l[g]);if(a.current&&_oldSyncBehavior)for(var g in f)delete p[g];var updateProps=function(){y&&y.current&&(y.current.props=e.props);updateChildProps();var r=[],n=p;if(o.current&&a.current&&!_oldSyncBehavior){for(var t in o.current)if(a.current[t]){if(a.current[t]._handlersChanged){a.current[t]._cachedHandlersChanged=a.current[t]._handlersChanged;a.current[t]._handlersChanged=null;r.push(a.current[t])}a.current[t].removeHandler(o.current[t])}n=__assign({},p);for(var s in f){delete n[s];a.current[s].addHandler(f[s])}}else if(!o.current){n=__assign({},p);for(var s in f)delete n[s]}o.current=f;if(a.current){copy(a.current,n,!1,!0);for(var i in v)_setHostAttribute(a.current.hostElement,i,v[i]);for(var i in h)e.customProps[i](a.current,h[i]);!function(){for(var e=0,n=r;e<n.length;e++){var t=n[e];if(t._cachedHandlersChanged){t._handlersChanged=t._cachedHandlersChanged;t._cachedHandlersChanged=null}}r=[]}()}},updateChildProps=function(){s.current=updateChildProperties({controlRef:a,childInfo:s.current},e.props.children)};React.useLayoutEffect((function(){if(t.current&&!a.current){a.current=new e.constructor(t.current,p);e.prePropsInit&&e.prePropsInit(a.current);if(y)if(isFunction(y)){var r=y({control:a.current,props:e.props});isFunction(r)&&(c.current=r)}else y.current&&y.current.control==a.current||(y.current={control:a.current,props:e.props});for(var n in v)_setHostAttribute(a.current.hostElement,n,v[n]);e.props.children&&updateProps();e.initControl&&e.initControl(a.current);e.props.initialized&&setTimeout((function(){a.current&&e.props.initialized(a.current)}))}else i.current&&(i.current=!1);return function(){if(a.current){var e=a.current;i.current=!0;queueMicrotask((function(){if(i.current){e.dispose();a.current=null;s.current={};i.current=!1;c.current&&c.current()}}))}}}),[]);a.current&&queueMicrotask((function(){return updateProps()}));var m=React.createElement("div",__assign({},d,{ref:t}),[]),_setHostAttribute=function(e,r,n){if(e)switch(r){case"className":var t=u.current;if(t!==n){removeClass(e,t);addClass(e,n);u.current=n}}};return{renderResult:m,wjControl:a.current}}function filterKnownProps(e,r,n){var t={};for(var o in e)(r.has(o)||n.has(o))&&(t[o]=e[o]);return t}function clearAndGetEvents(e,r,n,t){var o=t.current,a={};for(var s in r)n.has(s)&&(a[s]=r[s]);for(var i in o)e[i]&&(!_oldSyncBehavior||r[i]?e[i].removeHandler(o[i]):a[i]=o[i]);return a}function getCustomPropsData(e,r){var n={};for(var t in r)void 0!==e[t]&&(n[t]=e[t]);return n}export function useWjComponentChildBase(e){var r={};r.knowProperties=new Set(e.properties);r.knowEvents=new Set(e.events);e.customProps||(e.customProps={});return{getInstance:function(n){var t={current:{}},o={current:{}},a={current:{}},s=getPropsAccordingToSyncMode(e.props,t.current),i=filterKnownProps(s,r.knowProperties,r.knowEvents),c=getCustomPropsData(s,e.customProps||{}),u=e.customConstructor?e.customConstructor(n,i,c):new e.constructor(e.needParentInstance?n:i,e.needParentInstance?i:void 0);e.ref&&(isFunction(e.ref)?e.ref({control:u,props:e.props}):e.ref.current&&e.ref.current.control==u||(e.ref.current={control:u,props:e.props}));a.current=clearAndGetEvents(u,s,r.knowEvents,a);var updateProps=function(n){var s=getPropsAccordingToSyncMode(n,t.current);t.current=n;e.ref&&e.ref.current&&(e.ref.current.props=n);a.current=clearAndGetEvents(u,s,r.knowEvents,a);var i,c=filterKnownProps(s,r.knowProperties,r.knowEvents);u.initialize?u.initialize(c):copy(u,c,!1,!0);for(var l in e.customProps)void 0!==s[l]&&e.customProps[l](u,s[l]);i=n.children||[],o.current=updateChildProperties({controlRef:{current:u},childInfo:o.current},i)};updateProps(e.props||[]);e.props.initialized&&isFunction(e.props.initialized)&&e.props.initialized(u);return{instance:u,updateProps:updateProps}},props:e.props,parentProp:e.parentProp,wjProperty:e.props.wjProperty,isParentPropArray:e.isParentPropArray,assignedToParent:e.assignedToParent}}var flushSyncStateCache={isReactRendering:null};function isReactRendering(){if(null==flushSyncStateCache.isReactRendering)try{var e=console.error,r=!1;console.error=function(){var e=arguments[0]||"";e.includes("flushSync")&&(r=!0)};flushSync((function(){}));console.error=e;flushSyncStateCache.isReactRendering=r}catch(e){}finally{queueMicrotask((function(){flushSyncStateCache.isReactRendering=null}))}return!!flushSyncStateCache.isReactRendering}function getReactDOM(){return ReactDOM}export function selectiveDomRender(e,r,n){void 0===n&&(n=!1);if(_reactMajorVersion<18){(0,getReactDOM().render)(e,r)}else{isReactRendering()&&(n=!0);var t,o=elemRootMap.findIndex((function(e){return e.host===r}));if(-1===o){t=reactDomClient.createRoot(r);elemRootMap.push({host:r,root:t})}else t=elemRootMap[o].root;t.__scheduledForUnmount=!1;n?queueMicrotask((function(){flushSync((function(){t.render(e)}))})):flushSync((function(){t.render(e)}))}return r}function unmountSafely(e){var r=e._internalRoot&&e._internalRoot.containerInfo.firstChild,n=e._internalRoot&&e._internalRoot.current&&e._internalRoot.current.child&&e._internalRoot.current.child.stateNode;n&&r==n?e.unmount():e._internalRoot=null;e.__scheduledForUnmount=null}export function selectiveDomUnmount(e){if(_reactMajorVersion<18){(0,getReactDOM().unmountComponentAtNode)(e)}else{var r=elemRootMap.findIndex((function(r){return r.host===e}));if(-1!==r){var n=elemRootMap[r].root;if(isReactRendering()){n.__scheduledForUnmount=!0;queueMicrotask((function(){n.__scheduledForUnmount&&flushSync((function(){unmountSafely(n);elemRootMap.splice(r,1)}))}))}else flushSync((function(){unmountSafely(n);elemRootMap.splice(r,1)}))}}}function isKeyOrderSame(e,r,n){if(e.length!=r.length)return!1;for(var t=0;t<e.length;t++)if(e[t][n]!=r[t][n])return!1;return!0}export function baseFlushSync(){flushSync((function(){}))}
|
|
14
|
+
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(e,r,n,t){return new(n||(n=Promise))((function(o,a){function fulfilled(e){try{step(t.next(e))}catch(e){a(e)}}function rejected(e){try{step(t.throw(e))}catch(e){a(e)}}function step(e){e.done?o(e.value):new n((function(r){r(e.value)})).then(fulfilled,rejected)}step((t=t.apply(e,r||[])).next())}))},__generator=this&&this.__generator||function(e,r){var n,t,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function verb(a){return function(s){return function step(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;(t=0,o)&&(a=[2&a[0],o.value]);switch(a[0]){case 0:case 1:o=a;break;case 4:i.label++;return{value:a[1],done:!1};case 5:i.label++;t=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}o[2]&&i.ops.pop();i.trys.pop();continue}a=r.call(e,i)}catch(e){a=[6,e];t=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};import{ObservableArray,asString,copy,isArray,isFunction,removeClass,addClass,asBoolean}from"@grapecity/wijmo";import*as ReactDOM from"react-dom";import*as React from"react";var flushSyncPolyfill=function(e){e()},createRootPolyfill=function(){throw"Wijmo: React dependencies not loaded properly"},ReactDomPolyfill={flushSync:flushSyncPolyfill,createRoot:createRootPolyfill},reactDomClient=ReactDOM||ReactDomPolyfill,flushSync=reactDomClient.flushSync,reactDomClientLoadPromise=null,reactDomClientReady=!1;function setReactDomClient(e){reactDomClient=e||ReactDOM||ReactDomPolyfill;flushSync=e&&e.flushSync||flushSync}function lazyImportDomClient(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,import(/* webpackIgnore: true */"react-dom/client")];case 1:e=r.sent();setReactDomClient(e.default||e);return[3,3];case 2:r.sent();try{setReactDomClient(require("react-dom/client"))}catch(e){reactDomClient=ReactDOM||ReactDomPolyfill}return[3,3];case 3:reactDomClientReady=!0;return[2]}}))}))}function ensureReactDomClientLoaded(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return reactDomClientLoadPromise?[4,reactDomClientLoadPromise]:[3,2];case 1:e.sent();e.label=2;case 2:return[2]}}))}))}var _reactMajorVersion,elemRootMap=[];if(!_reactMajorVersion){var version=parseInt(React.version);_reactMajorVersion=version;version>=18?reactDomClientLoadPromise=lazyImportDomClient():reactDomClientReady=!0}export function wjForwardRef(e){return _reactMajorVersion>=19?function(r){return e(r,r.ref)}:React.forwardRef(e)}var _oldSyncBehavior=!0;export function strictStateMode(e){void 0===e&&(e=!1);e==_oldSyncBehavior&&(_oldSyncBehavior=!asBoolean(e,!1))}export var ControlBaseMeta={inputs:["isDisabled","tabOrder"],events:["gotFocus","invalidInput","lostFocus","refreshed","refreshing"]};var alwaysClearProps=new Set(["columns","columnGroups"]),unsuppressedChangedEventProps=new Set(["panes","columnGroups","columns","items"]),specialProps=new Set(["initialized","wjItemTemplate"]),buildInProps=new Set(["className"]);function updateChildProperties(e,r){var n=e.controlRef.current,t={},o={};if(r){for(var a=isArray(r)?r.flat(1/0):[r],i=[],s=0,c=new Set,u=0,l=a;u<l.length;u++){if((_=l[u])&&_.type&&_.type.$$typeof==Symbol.for("react.forward_ref")){_reactMajorVersion>=19?i.push(_.type.render(_.props,_.props.ref)):i.push(_.type.render(_.props,_.ref));i[i.length-1].$index=s;i[i.length-1].$key=_.key}else if(_&&isFunction(_.type)){i.push(_.type(_.props));i[i.length-1].$index=s;i[i.length-1].$key=_.key}_||c.add(s);s++}for(var p=[],f=0,d=i;f<d.length;f++){if((_=d[f]).assignedToParent){if(_.wjProperty){_.parentProp=asString(_.wjProperty);_.isParentPropArray=n[_.parentProp]&&isArray(n[_.parentProp])}_.isParentPropArray&&!t[_.parentProp]&&(t[_.parentProp]=[]);_.isParentPropArray?t[_.parentProp].push({getInstance:_.getInstance,props:_.props,$key:_.$key,$index:_.$index}):t[_.parentProp]={getInstance:_.getInstance,props:_.props}}else p.push(_)}var h=e.childInfo,_loop_1=function(e){if(isArray(t[e])){var r=!1;if(n[e]&&null!=n[e]._updating&&!unsuppressedChangedEventProps.has(e)){n[e]._updating++;r=!0}var a=h[e];o[e]=[];var i=!1;if(!h[e]){a=[];if(n[e]&&n[e].clear){n[e].clear();i=!0}else n[e]||(n[e]=new ObservableArray)}if(!_oldSyncBehavior&&alwaysClearProps.has(e)){if(n[e]&&n[e].clear){n[e].clear();i=!0}}else if(!isKeyOrderSame(a,t[e],"$key")&&n[e]&&n[e].clear){n[e].clear();i=!0}if(_oldSyncBehavior)for(var s=a.length-1;s>=0;s--)if(c.has(a[s].$index)){n[e].remove(a[s].instance);a.splice(s,1)}for(var u=[],l={},p=0,f=a;p<f.length;p++){var d=f[p];null!=d.$key?l[""+d.$key]=d:u.push(d)}for(var v=0,getExistingInstance=function(e){void 0===e&&(e=null);if(null!=e){var r=l[e];null!=r&&delete l[e];return r}return u[v++]},y=0;y<t[e].length;y++){var m=!1;if(P=getExistingInstance(t[e][y].$key))P.updateProps(t[e][y].props);else{P=t[e][y].getInstance(n);m=!0}P.$index=t[e][y].$index;P.$key=t[e][y].$key;(i||m)&&(n[e].length==y?n[e].push(P.instance):n[e].splice(y,0,P.instance));o[e].push(P)}for(var g=0,_=Object.keys(l);g<_.length;g++){var R=_[g];n[e].remove(l[R].instance)}for(;!_oldSyncBehavior&&n[e].length>o[e].length;)n[e].pop();if(r){n[e]._updating--;!i&&h[e]&&h[e].length==t[e].length||n[e]._raiseCollectionChanged&&n[e]._raiseCollectionChanged()}}else{var P;if(P=h[e])P.updateProps(t[e].props);else{P=t[e].getInstance(n);n[e]=P.instance}o[e]=P}};for(var v in t)_loop_1(v);for(var y=[],m=0,g=h.$_nonassignable||[];m<g.length;m++){var _=g[m];c.has(_.$index)?_.instance&&_.instance.dispose&&isFunction(_.instance.dispose)&&_.instance.dispose():y.push(_)}for(var R=[],P=0;P<p.length;P++){var w=y[P];w?w.updateProps(p[P].props):w=p[P].getInstance(n);w.$index=p[P].$index;R.push(w)}o.$_nonassignable=R;for(;P<y.length;P++)y[P].instance&&y[P].instance.dispose&&isFunction(y[P].instance.dispose)&&y[P].instance.dispose()}if(_oldSyncBehavior)for(var C=0,S=Object.keys(e.childInfo);C<S.length;C++){var b=S[C];if(isArray(e.childInfo[b])&&!t[b]&&n[b]&&n[b].remove)for(var k=0,D=e.childInfo[b];k<D.length;k++){var M=D[k];n[b].remove(M.instance)}}return o}function getPropsAccordingToSyncMode(e,r,n){void 0===n&&(n=null);if(!r||!_oldSyncBehavior){return __assign({},e)}var t={};for(var o in e){var a=!1;n&&(a=n.knowProperties.has(o)||n.knowEvents.has(o)||n.knowCustomProps.has(o));(n&&!a||e[o]!==r[o])&&(t[o]=e[o])}return t}export function useWjComponentBase(e){var r=React.useRef({}),n=React.useRef(),t=React.useRef(),o=React.useRef(),a=React.useRef(),i=React.useRef({}),s=React.useRef(!1),c=React.useRef(null),u=React.useRef(null);e.customProps||(e.customProps={});if(!n.current){n.current={};n.current.knowProperties=new Set(e.properties);n.current.knowEvents=new Set(e.events);n.current.knowCustomProps=new Set(Object.keys(e.customProps))}var l=e.props;if(a.current){l=getPropsAccordingToSyncMode(e.props,r.current,n.current);r.current=e.props}var p={},f={},d={},h={},v={},y=e.ref||null;for(var m in l)if(n.current.knowProperties.has(m))p[m]=l[m];else if(n.current.knowEvents.has(m)){f[m]=l[m];p[m]=l[m]}else e.customProps[m]?h[m]=l[m]:buildInProps.has(m)?v[m]=l[m]:specialProps.has(m)||(d[m]=l[m]);if(a.current&&_oldSyncBehavior)for(var m in f)delete p[m];var updateProps=function(){y&&y.current&&(y.current.props=e.props);updateChildProps();var r=[],n=p;if(o.current&&a.current&&!_oldSyncBehavior){for(var t in o.current)if(a.current[t]){if(a.current[t]._handlersChanged){a.current[t]._cachedHandlersChanged=a.current[t]._handlersChanged;a.current[t]._handlersChanged=null;r.push(a.current[t])}a.current[t].removeHandler(o.current[t])}n=__assign({},p);for(var i in f){delete n[i];a.current[i].addHandler(f[i])}}else if(!o.current){n=__assign({},p);for(var i in f)delete n[i]}o.current=f;if(a.current){copy(a.current,n,!1,!0);for(var s in v)_setHostAttribute(a.current.hostElement,s,v[s]);for(var s in h)e.customProps[s](a.current,h[s]);!function(){for(var e=0,n=r;e<n.length;e++){var t=n[e];if(t._cachedHandlersChanged){t._handlersChanged=t._cachedHandlersChanged;t._cachedHandlersChanged=null}}r=[]}()}},updateChildProps=function(){i.current=updateChildProperties({controlRef:a,childInfo:i.current},e.props.children)};React.useLayoutEffect((function(){if(t.current&&!a.current){a.current=new e.constructor(t.current,p);e.prePropsInit&&e.prePropsInit(a.current);if(y)if(isFunction(y)){var r=y({control:a.current,props:e.props});isFunction(r)&&(c.current=r)}else y.current&&y.current.control==a.current||(y.current={control:a.current,props:e.props});for(var n in v)_setHostAttribute(a.current.hostElement,n,v[n]);e.props.children&&updateProps();e.initControl&&e.initControl(a.current);e.props.initialized&&setTimeout((function(){a.current&&e.props.initialized(a.current)}))}else s.current&&(s.current=!1);return function(){if(a.current){var e=a.current;s.current=!0;queueMicrotask((function(){if(s.current){e.dispose();a.current=null;i.current={};s.current=!1;c.current&&c.current()}}))}}}),[]);a.current&&queueMicrotask((function(){return updateProps()}));var g=React.createElement("div",__assign({},d,{ref:t}),[]),_setHostAttribute=function(e,r,n){if(e)switch(r){case"className":var t=u.current;if(t!==n){removeClass(e,t);addClass(e,n);u.current=n}}};return{renderResult:g,wjControl:a.current}}function filterKnownProps(e,r,n){var t={};for(var o in e)(r.has(o)||n.has(o))&&(t[o]=e[o]);return t}function clearAndGetEvents(e,r,n,t){var o=t.current,a={};for(var i in r)n.has(i)&&(a[i]=r[i]);for(var s in o)e[s]&&(!_oldSyncBehavior||r[s]?e[s].removeHandler(o[s]):a[s]=o[s]);return a}function getCustomPropsData(e,r){var n={};for(var t in r)void 0!==e[t]&&(n[t]=e[t]);return n}export function useWjComponentChildBase(e){var r={};r.knowProperties=new Set(e.properties);r.knowEvents=new Set(e.events);e.customProps||(e.customProps={});return{getInstance:function(n){var t={current:{}},o={current:{}},a={current:{}},i=getPropsAccordingToSyncMode(e.props,t.current),s=filterKnownProps(i,r.knowProperties,r.knowEvents),c=getCustomPropsData(i,e.customProps||{}),u=e.customConstructor?e.customConstructor(n,s,c):new e.constructor(e.needParentInstance?n:s,e.needParentInstance?s:void 0);e.ref&&(isFunction(e.ref)?e.ref({control:u,props:e.props}):e.ref.current&&e.ref.current.control==u||(e.ref.current={control:u,props:e.props}));a.current=clearAndGetEvents(u,i,r.knowEvents,a);var updateProps=function(n){var i=getPropsAccordingToSyncMode(n,t.current);t.current=n;e.ref&&e.ref.current&&(e.ref.current.props=n);a.current=clearAndGetEvents(u,i,r.knowEvents,a);var s,c=filterKnownProps(i,r.knowProperties,r.knowEvents);u.initialize?u.initialize(c):copy(u,c,!1,!0);for(var l in e.customProps)void 0!==i[l]&&e.customProps[l](u,i[l]);s=n.children||[],o.current=updateChildProperties({controlRef:{current:u},childInfo:o.current},s)};updateProps(e.props||[]);e.props.initialized&&isFunction(e.props.initialized)&&e.props.initialized(u);return{instance:u,updateProps:updateProps}},props:e.props,parentProp:e.parentProp,wjProperty:e.props.wjProperty,isParentPropArray:e.isParentPropArray,assignedToParent:e.assignedToParent}}var flushSyncStateCache={isReactRendering:null};function isReactRendering(){if(null==flushSyncStateCache.isReactRendering)try{var e=console.error,r=!1;console.error=function(){var e=arguments[0]||"";e.includes("flushSync")&&(r=!0)};flushSync((function(){}));console.error=e;flushSyncStateCache.isReactRendering=r}catch(e){}finally{queueMicrotask((function(){flushSyncStateCache.isReactRendering=null}))}return!!flushSyncStateCache.isReactRendering}function getReactDOM(){return ReactDOM}function _doRender(e,r,n){void 0===n&&(n=!1);isReactRendering()&&(n=!0);var t,o=elemRootMap.findIndex((function(e){return e.host===r}));if(-1===o){t=reactDomClient.createRoot(r);elemRootMap.push({host:r,root:t})}else t=elemRootMap[o].root;t.__scheduledForUnmount=!1;n?queueMicrotask((function(){flushSync((function(){t.render(e)}))})):flushSync((function(){t.render(e)}))}export function selectiveDomRender(e,r,n){var t=this;void 0===n&&(n=!1);if(_reactMajorVersion<18){(0,getReactDOM().render)(e,r)}else if(reactDomClientReady)_doRender(e,r,n);else{__awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,ensureReactDomClientLoaded()];case 1:t.sent();_doRender(e,r,n);return[2]}}))}))}return r}function unmountSafely(e){var r=e._internalRoot&&e._internalRoot.containerInfo.firstChild,n=e._internalRoot&&e._internalRoot.current&&e._internalRoot.current.child&&e._internalRoot.current.child.stateNode;n&&r==n?e.unmount():e._internalRoot=null;e.__scheduledForUnmount=null}function _doUnmount(e){var r=elemRootMap.findIndex((function(r){return r.host===e}));if(-1!==r){var n=elemRootMap[r].root;if(isReactRendering()){n.__scheduledForUnmount=!0;queueMicrotask((function(){n.__scheduledForUnmount&&flushSync((function(){unmountSafely(n);elemRootMap.splice(r,1)}))}))}else flushSync((function(){unmountSafely(n);elemRootMap.splice(r,1)}))}}export function selectiveDomUnmount(e){var r=this;if(_reactMajorVersion<18){(0,getReactDOM().unmountComponentAtNode)(e)}else if(reactDomClientReady)_doUnmount(e);else{__awaiter(r,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,ensureReactDomClientLoaded()];case 1:r.sent();_doUnmount(e);return[2]}}))}))}}function isKeyOrderSame(e,r,n){if(e.length!=r.length)return!1;for(var t=0;t<e.length;t++)if(e[t][n]!=r[t][n])return!1;return!0}export function baseFlushSync(){flushSync((function(){}))}
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* Wijmo Library 5.
|
|
3
|
+
* Wijmo Library 5.20261.48
|
|
4
4
|
* https://developer.mescius.com/wijmo
|
|
5
5
|
*
|
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
@@ -24,58 +24,58 @@ export interface WjForwardRefExoticComponent<P> extends React.NamedExoticCompone
|
|
|
24
24
|
defaultProps?: Partial<P>;
|
|
25
25
|
propTypes?: React.WeakValidationMap<P>;
|
|
26
26
|
/** bugFix: WJM-35713
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
(props: P):
|
|
27
|
+
* **NOTE**: Due to the limitations of React Exotic components, we need to
|
|
28
|
+
* redeclare the props function signature here.
|
|
29
|
+
*
|
|
30
|
+
* Exotic components in React (such as those created by `React.forwardRef`
|
|
31
|
+
* or `React.memo`) are treated as non-callable. This means that the default
|
|
32
|
+
* behavior of exotic components doesn't allow us to directly call them as
|
|
33
|
+
* normal functions. As a workaround, we explicitly redeclare the function
|
|
34
|
+
* signature to ensure proper handling of `props` in our custom implementation.
|
|
35
|
+
*
|
|
36
|
+
* This is done to maintain compatibility with React's internal `ExoticComponent`
|
|
37
|
+
* type while allowing the component to function as expected with `props`.
|
|
38
|
+
*/
|
|
39
|
+
(props: P): React.ReactElement | null;
|
|
40
40
|
}
|
|
41
41
|
export declare function wjForwardRef(fn: any): any;
|
|
42
42
|
/**
|
|
43
|
-
* From 5.20241.19, React interop now supports strict state mode.
|
|
44
|
-
* This means that on each re-render cycle, all of the component properties
|
|
45
|
-
* get synced with their values provided in the JSX.
|
|
46
|
-
* Setting properties via JSX will make that prop externally controlled, and
|
|
47
|
-
* changing its value will be allowed only by updating the state variables passed in JSX.
|
|
48
|
-
*
|
|
49
|
-
* By default, this option is set to false to maintain compatibility with existing user applications.
|
|
50
|
-
* If users want to utilize the Wijmo API in accordance with React's state management philosophy,
|
|
51
|
-
* they can set **strictStateMode** to true.
|
|
52
|
-
*
|
|
53
|
-
* When the strictStateMode flag is false, the value of the underlying component gets synced only when
|
|
54
|
-
* the prop value changes and not when the component re-renders. This makes it possible for JSX to become
|
|
55
|
-
* out of sync with the rendered state.
|
|
56
|
-
*
|
|
57
|
-
* Consider the following: if you set the value on an input control like {@link InputDate} and if strictStateMode
|
|
58
|
-
* is false, it is possible to select a different value in the control. After the value is selected,
|
|
59
|
-
* there is a mismatch between the React-provided state and the rendered state. This leads to potential bugs.
|
|
60
|
-
* That is why React recommends using controlled components. In controlled components, once the value is
|
|
61
|
-
* provided externally via JSX, the control value is not allowed to change unless the externally provided value
|
|
62
|
-
* is changed itself. So in the above scenario (for strictStateMode = true), to be able to change the value,
|
|
63
|
-
* we need to handle the valueChanged event and update the state variable to update the controlled value.
|
|
64
|
-
*
|
|
65
|
-
* ```typescript
|
|
66
|
-
* function App() {
|
|
67
|
-
* const [date, setDate] = useState(new Date());
|
|
68
|
-
*
|
|
69
|
-
* return (
|
|
70
|
-
* <div>
|
|
71
|
-
* <InputDate value={date} valueChanged={(s) => setDate(s.value)} />
|
|
72
|
-
* </div>
|
|
73
|
-
* );
|
|
74
|
-
* }
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
|
-
* @param value Whether to use the strict state mode or not
|
|
78
|
-
*/
|
|
43
|
+
* From 5.20241.19, React interop now supports strict state mode.
|
|
44
|
+
* This means that on each re-render cycle, all of the component properties
|
|
45
|
+
* get synced with their values provided in the JSX.
|
|
46
|
+
* Setting properties via JSX will make that prop externally controlled, and
|
|
47
|
+
* changing its value will be allowed only by updating the state variables passed in JSX.
|
|
48
|
+
*
|
|
49
|
+
* By default, this option is set to false to maintain compatibility with existing user applications.
|
|
50
|
+
* If users want to utilize the Wijmo API in accordance with React's state management philosophy,
|
|
51
|
+
* they can set **strictStateMode** to true.
|
|
52
|
+
*
|
|
53
|
+
* When the strictStateMode flag is false, the value of the underlying component gets synced only when
|
|
54
|
+
* the prop value changes and not when the component re-renders. This makes it possible for JSX to become
|
|
55
|
+
* out of sync with the rendered state.
|
|
56
|
+
*
|
|
57
|
+
* Consider the following: if you set the value on an input control like {@link InputDate} and if strictStateMode
|
|
58
|
+
* is false, it is possible to select a different value in the control. After the value is selected,
|
|
59
|
+
* there is a mismatch between the React-provided state and the rendered state. This leads to potential bugs.
|
|
60
|
+
* That is why React recommends using controlled components. In controlled components, once the value is
|
|
61
|
+
* provided externally via JSX, the control value is not allowed to change unless the externally provided value
|
|
62
|
+
* is changed itself. So in the above scenario (for strictStateMode = true), to be able to change the value,
|
|
63
|
+
* we need to handle the valueChanged event and update the state variable to update the controlled value.
|
|
64
|
+
*
|
|
65
|
+
* ```typescript
|
|
66
|
+
* function App() {
|
|
67
|
+
* const [date, setDate] = useState(new Date());
|
|
68
|
+
*
|
|
69
|
+
* return (
|
|
70
|
+
* <div>
|
|
71
|
+
* <InputDate value={date} valueChanged={(s) => setDate(s.value)} />
|
|
72
|
+
* </div>
|
|
73
|
+
* );
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @param value Whether to use the strict state mode or not
|
|
78
|
+
*/
|
|
79
79
|
export declare function strictStateMode(value?: boolean): void;
|
|
80
80
|
export declare type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
|
|
81
81
|
export declare type WjRef<T> = {
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* Wijmo Library 5.
|
|
3
|
+
* Wijmo Library 5.20261.48
|
|
4
4
|
* https://developer.mescius.com/wijmo
|
|
5
5
|
*
|
|
6
6
|
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(e,r,n,t){return new(n||(n=Promise))((function(o,i){function fulfilled(e){try{step(t.next(e))}catch(e){i(e)}}function rejected(e){try{step(t.throw(e))}catch(e){i(e)}}function step(e){e.done?o(e.value):new n((function(r){r(e.value)})).then(fulfilled,rejected)}step((t=t.apply(e,r||[])).next())}))},__generator=this&&this.__generator||function(e,r){var n,t,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function verb(i){return function(a){return function step(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,t&&(o=2&i[0]?t.return:i[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,i[1])).done)return o;(t=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:s.label++;return{value:i[1],done:!1};case 5:s.label++;t=i[1];i=[0];continue;case 7:i=s.ops.pop();s.trys.pop();continue;default:if(!(o=s.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1];o=i;break}if(o&&s.label<o[2]){s.label=o[2];s.ops.push(i);break}o[2]&&s.ops.pop();s.trys.pop();continue}i=r.call(e,s)}catch(e){i=[6,e];t=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(r[n]=e[n]);r.default=e;return r};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_1=require("@grapecity/wijmo"),ReactDOM=__importStar(require("react-dom")),React=__importStar(require("react")),flushSyncPolyfill=function(e){e()},createRootPolyfill=function(){throw"Wijmo: React dependencies not loaded properly"},ReactDomPolyfill={flushSync:flushSyncPolyfill,createRoot:createRootPolyfill},reactDomClient=ReactDOM||ReactDomPolyfill,flushSync=reactDomClient.flushSync;function lazyImportDomClient(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){try{e=require("react-dom/client");reactDomClient=e||ReactDOM||ReactDomPolyfill;flushSync=e.flushSync||flushSync}catch(e){reactDomClient=ReactDOM||ReactDomPolyfill}return[2]}))}))}var _reactMajorVersion,elemRootMap=[];if(!_reactMajorVersion){var version=parseInt(React.version);_reactMajorVersion=version;version>=18&&lazyImportDomClient()}function wjForwardRef(e){return _reactMajorVersion>=19?function(r){return e(r,r.ref)}:React.forwardRef(e)}exports.wjForwardRef=wjForwardRef;var _oldSyncBehavior=!0;function strictStateMode(e){void 0===e&&(e=!1);e==_oldSyncBehavior&&(_oldSyncBehavior=!wijmo_1.asBoolean(e,!1))}exports.strictStateMode=strictStateMode;exports.ControlBaseMeta={inputs:["isDisabled","tabOrder"],events:["gotFocus","invalidInput","lostFocus","refreshed","refreshing"]};var alwaysClearProps=new Set(["columns","columnGroups"]),unsuppressedChangedEventProps=new Set(["panes","columnGroups","columns","items"]),specialProps=new Set(["initialized","wjItemTemplate"]),buildInProps=new Set(["className"]);function updateChildProperties(e,r){var n=e.controlRef.current,t={},o={};if(r){for(var i=wijmo_1.isArray(r)?r.flat(1/0):[r],s=[],a=0,c=new Set,u=0,l=i;u<l.length;u++){if((g=l[u])&&g.type&&g.type.$$typeof==Symbol.for("react.forward_ref")){_reactMajorVersion>=19?s.push(g.type.render(g.props,g.props.ref)):s.push(g.type.render(g.props,g.ref));s[s.length-1].$index=a;s[s.length-1].$key=g.key}else if(g&&wijmo_1.isFunction(g.type)){s.push(g.type(g.props));s[s.length-1].$index=a;s[s.length-1].$key=g.key}g||c.add(a);a++}for(var p=[],f=0,d=s;f<d.length;f++){if((g=d[f]).assignedToParent){if(g.wjProperty){g.parentProp=wijmo_1.asString(g.wjProperty);g.isParentPropArray=n[g.parentProp]&&wijmo_1.isArray(n[g.parentProp])}g.isParentPropArray&&!t[g.parentProp]&&(t[g.parentProp]=[]);g.isParentPropArray?t[g.parentProp].push({getInstance:g.getInstance,props:g.props,$key:g.$key,$index:g.$index}):t[g.parentProp]={getInstance:g.getInstance,props:g.props}}else p.push(g)}var h=e.childInfo,_loop_1=function(e){if(wijmo_1.isArray(t[e])){var r=!1;if(n[e]&&null!=n[e]._updating&&!unsuppressedChangedEventProps.has(e)){n[e]._updating++;r=!0}var i=h[e];o[e]=[];var s=!1;if(!h[e]){i=[];if(n[e]&&n[e].clear){n[e].clear();s=!0}else n[e]||(n[e]=new wijmo_1.ObservableArray)}if(!_oldSyncBehavior&&alwaysClearProps.has(e)){if(n[e]&&n[e].clear){n[e].clear();s=!0}}else if(!isKeyOrderSame(i,t[e],"$key")&&n[e]&&n[e].clear){n[e].clear();s=!0}if(_oldSyncBehavior)for(var a=i.length-1;a>=0;a--)if(c.has(i[a].$index)){n[e].remove(i[a].instance);i.splice(a,1)}for(var u=[],l={},p=0,f=i;p<f.length;p++){var d=f[p];null!=d.$key?l[""+d.$key]=d:u.push(d)}for(var v=0,getExistingInstance=function(e){void 0===e&&(e=null);if(null!=e){var r=l[e];null!=r&&delete l[e];return r}return u[v++]},y=0;y<t[e].length;y++){var m=!1;if(P=getExistingInstance(t[e][y].$key))P.updateProps(t[e][y].props);else{P=t[e][y].getInstance(n);m=!0}P.$index=t[e][y].$index;P.$key=t[e][y].$key;(s||m)&&(n[e].length==y?n[e].push(P.instance):n[e].splice(y,0,P.instance));o[e].push(P)}for(var _=0,g=Object.keys(l);_<g.length;_++){var w=g[_];n[e].remove(l[w].instance)}for(;!_oldSyncBehavior&&n[e].length>o[e].length;)n[e].pop();if(r){n[e]._updating--;!s&&h[e]&&h[e].length==t[e].length||n[e]._raiseCollectionChanged&&n[e]._raiseCollectionChanged()}}else{var P;if(P=h[e])P.updateProps(t[e].props);else{P=t[e].getInstance(n);n[e]=P.instance}o[e]=P}};for(var v in t)_loop_1(v);for(var y=[],m=0,_=h.$_nonassignable||[];m<_.length;m++){var g=_[m];c.has(g.$index)?g.instance&&g.instance.dispose&&wijmo_1.isFunction(g.instance.dispose)&&g.instance.dispose():y.push(g)}for(var w=[],P=0;P<p.length;P++){var R=y[P];R?R.updateProps(p[P].props):R=p[P].getInstance(n);R.$index=p[P].$index;w.push(R)}o.$_nonassignable=w;for(;P<y.length;P++)y[P].instance&&y[P].instance.dispose&&wijmo_1.isFunction(y[P].instance.dispose)&&y[P].instance.dispose()}if(_oldSyncBehavior)for(var S=0,C=Object.keys(e.childInfo);S<C.length;S++){var j=C[S];if(wijmo_1.isArray(e.childInfo[j])&&!t[j]&&n[j]&&n[j].remove)for(var k=0,M=e.childInfo[j];k<M.length;k++){var b=M[k];n[j].remove(b.instance)}}return o}function getPropsAccordingToSyncMode(e,r,n){void 0===n&&(n=null);if(!r||!_oldSyncBehavior){return __assign({},e)}var t={};for(var o in e){var i=!1;n&&(i=n.knowProperties.has(o)||n.knowEvents.has(o)||n.knowCustomProps.has(o));(n&&!i||e[o]!==r[o])&&(t[o]=e[o])}return t}function useWjComponentBase(e){var r=React.useRef({}),n=React.useRef(),t=React.useRef(),o=React.useRef(),i=React.useRef(),s=React.useRef({}),a=React.useRef(!1),c=React.useRef(null),u=React.useRef(null);e.customProps||(e.customProps={});if(!n.current){n.current={};n.current.knowProperties=new Set(e.properties);n.current.knowEvents=new Set(e.events);n.current.knowCustomProps=new Set(Object.keys(e.customProps))}var l=e.props;if(i.current){l=getPropsAccordingToSyncMode(e.props,r.current,n.current);r.current=e.props}var p={},f={},d={},h={},v={},y=e.ref||null;for(var m in l)if(n.current.knowProperties.has(m))p[m]=l[m];else if(n.current.knowEvents.has(m)){f[m]=l[m];p[m]=l[m]}else e.customProps[m]?h[m]=l[m]:buildInProps.has(m)?v[m]=l[m]:specialProps.has(m)||(d[m]=l[m]);if(i.current&&_oldSyncBehavior)for(var m in f)delete p[m];var updateProps=function(){y&&y.current&&(y.current.props=e.props);updateChildProps();var r=[],n=p;if(o.current&&i.current&&!_oldSyncBehavior){for(var t in o.current)if(i.current[t]){if(i.current[t]._handlersChanged){i.current[t]._cachedHandlersChanged=i.current[t]._handlersChanged;i.current[t]._handlersChanged=null;r.push(i.current[t])}i.current[t].removeHandler(o.current[t])}n=__assign({},p);for(var s in f){delete n[s];i.current[s].addHandler(f[s])}}else if(!o.current){n=__assign({},p);for(var s in f)delete n[s]}o.current=f;if(i.current){wijmo_1.copy(i.current,n,!1,!0);for(var a in v)_setHostAttribute(i.current.hostElement,a,v[a]);for(var a in h)e.customProps[a](i.current,h[a]);!function(){for(var e=0,n=r;e<n.length;e++){var t=n[e];if(t._cachedHandlersChanged){t._handlersChanged=t._cachedHandlersChanged;t._cachedHandlersChanged=null}}r=[]}()}},updateChildProps=function(){s.current=updateChildProperties({controlRef:i,childInfo:s.current},e.props.children)};React.useLayoutEffect((function(){if(t.current&&!i.current){i.current=new e.constructor(t.current,p);e.prePropsInit&&e.prePropsInit(i.current);if(y)if(wijmo_1.isFunction(y)){var r=y({control:i.current,props:e.props});wijmo_1.isFunction(r)&&(c.current=r)}else y.current&&y.current.control==i.current||(y.current={control:i.current,props:e.props});for(var n in v)_setHostAttribute(i.current.hostElement,n,v[n]);e.props.children&&updateProps();e.initControl&&e.initControl(i.current);e.props.initialized&&setTimeout((function(){i.current&&e.props.initialized(i.current)}))}else a.current&&(a.current=!1);return function(){if(i.current){var e=i.current;a.current=!0;queueMicrotask((function(){if(a.current){e.dispose();i.current=null;s.current={};a.current=!1;c.current&&c.current()}}))}}}),[]);i.current&&queueMicrotask((function(){return updateProps()}));var _=React.createElement("div",__assign({},d,{ref:t}),[]),_setHostAttribute=function(e,r,n){if(e)switch(r){case"className":var t=u.current;if(t!==n){wijmo_1.removeClass(e,t);wijmo_1.addClass(e,n);u.current=n}}};return{renderResult:_,wjControl:i.current}}exports.useWjComponentBase=useWjComponentBase;function filterKnownProps(e,r,n){var t={};for(var o in e)(r.has(o)||n.has(o))&&(t[o]=e[o]);return t}function clearAndGetEvents(e,r,n,t){var o=t.current,i={};for(var s in r)n.has(s)&&(i[s]=r[s]);for(var a in o)e[a]&&(!_oldSyncBehavior||r[a]?e[a].removeHandler(o[a]):i[a]=o[a]);return i}function getCustomPropsData(e,r){var n={};for(var t in r)void 0!==e[t]&&(n[t]=e[t]);return n}function useWjComponentChildBase(e){var r={};r.knowProperties=new Set(e.properties);r.knowEvents=new Set(e.events);e.customProps||(e.customProps={});return{getInstance:function(n){var t={current:{}},o={current:{}},i={current:{}},s=getPropsAccordingToSyncMode(e.props,t.current),a=filterKnownProps(s,r.knowProperties,r.knowEvents),c=getCustomPropsData(s,e.customProps||{}),u=e.customConstructor?e.customConstructor(n,a,c):new e.constructor(e.needParentInstance?n:a,e.needParentInstance?a:void 0);e.ref&&(wijmo_1.isFunction(e.ref)?e.ref({control:u,props:e.props}):e.ref.current&&e.ref.current.control==u||(e.ref.current={control:u,props:e.props}));i.current=clearAndGetEvents(u,s,r.knowEvents,i);var updateProps=function(n){var s=getPropsAccordingToSyncMode(n,t.current);t.current=n;e.ref&&e.ref.current&&(e.ref.current.props=n);i.current=clearAndGetEvents(u,s,r.knowEvents,i);var a,c=filterKnownProps(s,r.knowProperties,r.knowEvents);u.initialize?u.initialize(c):wijmo_1.copy(u,c,!1,!0);for(var l in e.customProps)void 0!==s[l]&&e.customProps[l](u,s[l]);a=n.children||[],o.current=updateChildProperties({controlRef:{current:u},childInfo:o.current},a)};updateProps(e.props||[]);e.props.initialized&&wijmo_1.isFunction(e.props.initialized)&&e.props.initialized(u);return{instance:u,updateProps:updateProps}},props:e.props,parentProp:e.parentProp,wjProperty:e.props.wjProperty,isParentPropArray:e.isParentPropArray,assignedToParent:e.assignedToParent}}exports.useWjComponentChildBase=useWjComponentChildBase;var flushSyncStateCache={isReactRendering:null};function isReactRendering(){if(null==flushSyncStateCache.isReactRendering)try{var e=console.error,r=!1;console.error=function(){var e=arguments[0]||"";e.includes("flushSync")&&(r=!0)};flushSync((function(){}));console.error=e;flushSyncStateCache.isReactRendering=r}catch(e){}finally{queueMicrotask((function(){flushSyncStateCache.isReactRendering=null}))}return!!flushSyncStateCache.isReactRendering}function getReactDOM(){return ReactDOM}function selectiveDomRender(e,r,n){void 0===n&&(n=!1);if(_reactMajorVersion<18){(0,getReactDOM().render)(e,r)}else{isReactRendering()&&(n=!0);var t,o=elemRootMap.findIndex((function(e){return e.host===r}));if(-1===o){t=reactDomClient.createRoot(r);elemRootMap.push({host:r,root:t})}else t=elemRootMap[o].root;t.__scheduledForUnmount=!1;n?queueMicrotask((function(){flushSync((function(){t.render(e)}))})):flushSync((function(){t.render(e)}))}return r}exports.selectiveDomRender=selectiveDomRender;function unmountSafely(e){var r=e._internalRoot&&e._internalRoot.containerInfo.firstChild,n=e._internalRoot&&e._internalRoot.current&&e._internalRoot.current.child&&e._internalRoot.current.child.stateNode;n&&r==n?e.unmount():e._internalRoot=null;e.__scheduledForUnmount=null}function selectiveDomUnmount(e){if(_reactMajorVersion<18){(0,getReactDOM().unmountComponentAtNode)(e)}else{var r=elemRootMap.findIndex((function(r){return r.host===e}));if(-1!==r){var n=elemRootMap[r].root;if(isReactRendering()){n.__scheduledForUnmount=!0;queueMicrotask((function(){n.__scheduledForUnmount&&flushSync((function(){unmountSafely(n);elemRootMap.splice(r,1)}))}))}else flushSync((function(){unmountSafely(n);elemRootMap.splice(r,1)}))}}}exports.selectiveDomUnmount=selectiveDomUnmount;function isKeyOrderSame(e,r,n){if(e.length!=r.length)return!1;for(var t=0;t<e.length;t++)if(e[t][n]!=r[t][n])return!1;return!0}function baseFlushSync(){flushSync((function(){}))}exports.baseFlushSync=baseFlushSync;
|
|
14
|
+
"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(e,r,n,t){return new(n||(n=Promise))((function(o,i){function fulfilled(e){try{step(t.next(e))}catch(e){i(e)}}function rejected(e){try{step(t.throw(e))}catch(e){i(e)}}function step(e){e.done?o(e.value):new n((function(r){r(e.value)})).then(fulfilled,rejected)}step((t=t.apply(e,r||[])).next())}))},__generator=this&&this.__generator||function(e,r){var n,t,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function verb(i){return function(s){return function step(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,t&&(o=2&i[0]?t.return:i[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,i[1])).done)return o;(t=0,o)&&(i=[2&i[0],o.value]);switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:!1};case 5:a.label++;t=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}o[2]&&a.ops.pop();a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e];t=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(r[n]=e[n]);r.default=e;return r};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_1=require("@grapecity/wijmo"),ReactDOM=__importStar(require("react-dom")),React=__importStar(require("react")),flushSyncPolyfill=function(e){e()},createRootPolyfill=function(){throw"Wijmo: React dependencies not loaded properly"},ReactDomPolyfill={flushSync:flushSyncPolyfill,createRoot:createRootPolyfill},reactDomClient=ReactDOM||ReactDomPolyfill,flushSync=reactDomClient.flushSync,reactDomClientLoadPromise=null,reactDomClientReady=!1;function setReactDomClient(e){reactDomClient=e||ReactDOM||ReactDomPolyfill;flushSync=e&&e.flushSync||flushSync}function lazyImportDomClient(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,Promise.resolve().then((function(){return __importStar(require(/* webpackIgnore: true */"react-dom/client"))}))];case 1:e=r.sent();setReactDomClient(e.default||e);return[3,3];case 2:r.sent();try{setReactDomClient(require("react-dom/client"))}catch(e){reactDomClient=ReactDOM||ReactDomPolyfill}return[3,3];case 3:reactDomClientReady=!0;return[2]}}))}))}function ensureReactDomClientLoaded(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return reactDomClientLoadPromise?[4,reactDomClientLoadPromise]:[3,2];case 1:e.sent();e.label=2;case 2:return[2]}}))}))}var _reactMajorVersion,elemRootMap=[];if(!_reactMajorVersion){var version=parseInt(React.version);_reactMajorVersion=version;version>=18?reactDomClientLoadPromise=lazyImportDomClient():reactDomClientReady=!0}function wjForwardRef(e){return _reactMajorVersion>=19?function(r){return e(r,r.ref)}:React.forwardRef(e)}exports.wjForwardRef=wjForwardRef;var _oldSyncBehavior=!0;function strictStateMode(e){void 0===e&&(e=!1);e==_oldSyncBehavior&&(_oldSyncBehavior=!wijmo_1.asBoolean(e,!1))}exports.strictStateMode=strictStateMode;exports.ControlBaseMeta={inputs:["isDisabled","tabOrder"],events:["gotFocus","invalidInput","lostFocus","refreshed","refreshing"]};var alwaysClearProps=new Set(["columns","columnGroups"]),unsuppressedChangedEventProps=new Set(["panes","columnGroups","columns","items"]),specialProps=new Set(["initialized","wjItemTemplate"]),buildInProps=new Set(["className"]);function updateChildProperties(e,r){var n=e.controlRef.current,t={},o={};if(r){for(var i=wijmo_1.isArray(r)?r.flat(1/0):[r],a=[],s=0,c=new Set,u=0,l=i;u<l.length;u++){if((R=l[u])&&R.type&&R.type.$$typeof==Symbol.for("react.forward_ref")){_reactMajorVersion>=19?a.push(R.type.render(R.props,R.props.ref)):a.push(R.type.render(R.props,R.ref));a[a.length-1].$index=s;a[a.length-1].$key=R.key}else if(R&&wijmo_1.isFunction(R.type)){a.push(R.type(R.props));a[a.length-1].$index=s;a[a.length-1].$key=R.key}R||c.add(s);s++}for(var p=[],f=0,d=a;f<d.length;f++){if((R=d[f]).assignedToParent){if(R.wjProperty){R.parentProp=wijmo_1.asString(R.wjProperty);R.isParentPropArray=n[R.parentProp]&&wijmo_1.isArray(n[R.parentProp])}R.isParentPropArray&&!t[R.parentProp]&&(t[R.parentProp]=[]);R.isParentPropArray?t[R.parentProp].push({getInstance:R.getInstance,props:R.props,$key:R.$key,$index:R.$index}):t[R.parentProp]={getInstance:R.getInstance,props:R.props}}else p.push(R)}var h=e.childInfo,_loop_1=function(e){if(wijmo_1.isArray(t[e])){var r=!1;if(n[e]&&null!=n[e]._updating&&!unsuppressedChangedEventProps.has(e)){n[e]._updating++;r=!0}var i=h[e];o[e]=[];var a=!1;if(!h[e]){i=[];if(n[e]&&n[e].clear){n[e].clear();a=!0}else n[e]||(n[e]=new wijmo_1.ObservableArray)}if(!_oldSyncBehavior&&alwaysClearProps.has(e)){if(n[e]&&n[e].clear){n[e].clear();a=!0}}else if(!isKeyOrderSame(i,t[e],"$key")&&n[e]&&n[e].clear){n[e].clear();a=!0}if(_oldSyncBehavior)for(var s=i.length-1;s>=0;s--)if(c.has(i[s].$index)){n[e].remove(i[s].instance);i.splice(s,1)}for(var u=[],l={},p=0,f=i;p<f.length;p++){var d=f[p];null!=d.$key?l[""+d.$key]=d:u.push(d)}for(var v=0,getExistingInstance=function(e){void 0===e&&(e=null);if(null!=e){var r=l[e];null!=r&&delete l[e];return r}return u[v++]},m=0;m<t[e].length;m++){var _=!1;if(w=getExistingInstance(t[e][m].$key))w.updateProps(t[e][m].props);else{w=t[e][m].getInstance(n);_=!0}w.$index=t[e][m].$index;w.$key=t[e][m].$key;(a||_)&&(n[e].length==m?n[e].push(w.instance):n[e].splice(m,0,w.instance));o[e].push(w)}for(var y=0,R=Object.keys(l);y<R.length;y++){var g=R[y];n[e].remove(l[g].instance)}for(;!_oldSyncBehavior&&n[e].length>o[e].length;)n[e].pop();if(r){n[e]._updating--;!a&&h[e]&&h[e].length==t[e].length||n[e]._raiseCollectionChanged&&n[e]._raiseCollectionChanged()}}else{var w;if(w=h[e])w.updateProps(t[e].props);else{w=t[e].getInstance(n);n[e]=w.instance}o[e]=w}};for(var v in t)_loop_1(v);for(var m=[],_=0,y=h.$_nonassignable||[];_<y.length;_++){var R=y[_];c.has(R.$index)?R.instance&&R.instance.dispose&&wijmo_1.isFunction(R.instance.dispose)&&R.instance.dispose():m.push(R)}for(var g=[],w=0;w<p.length;w++){var P=m[w];P?P.updateProps(p[w].props):P=p[w].getInstance(n);P.$index=p[w].$index;g.push(P)}o.$_nonassignable=g;for(;w<m.length;w++)m[w].instance&&m[w].instance.dispose&&wijmo_1.isFunction(m[w].instance.dispose)&&m[w].instance.dispose()}if(_oldSyncBehavior)for(var S=0,C=Object.keys(e.childInfo);S<C.length;S++){var j=C[S];if(wijmo_1.isArray(e.childInfo[j])&&!t[j]&&n[j]&&n[j].remove)for(var D=0,b=e.childInfo[j];D<b.length;D++){var k=b[D];n[j].remove(k.instance)}}return o}function getPropsAccordingToSyncMode(e,r,n){void 0===n&&(n=null);if(!r||!_oldSyncBehavior){return __assign({},e)}var t={};for(var o in e){var i=!1;n&&(i=n.knowProperties.has(o)||n.knowEvents.has(o)||n.knowCustomProps.has(o));(n&&!i||e[o]!==r[o])&&(t[o]=e[o])}return t}function useWjComponentBase(e){var r=React.useRef({}),n=React.useRef(),t=React.useRef(),o=React.useRef(),i=React.useRef(),a=React.useRef({}),s=React.useRef(!1),c=React.useRef(null),u=React.useRef(null);e.customProps||(e.customProps={});if(!n.current){n.current={};n.current.knowProperties=new Set(e.properties);n.current.knowEvents=new Set(e.events);n.current.knowCustomProps=new Set(Object.keys(e.customProps))}var l=e.props;if(i.current){l=getPropsAccordingToSyncMode(e.props,r.current,n.current);r.current=e.props}var p={},f={},d={},h={},v={},m=e.ref||null;for(var _ in l)if(n.current.knowProperties.has(_))p[_]=l[_];else if(n.current.knowEvents.has(_)){f[_]=l[_];p[_]=l[_]}else e.customProps[_]?h[_]=l[_]:buildInProps.has(_)?v[_]=l[_]:specialProps.has(_)||(d[_]=l[_]);if(i.current&&_oldSyncBehavior)for(var _ in f)delete p[_];var updateProps=function(){m&&m.current&&(m.current.props=e.props);updateChildProps();var r=[],n=p;if(o.current&&i.current&&!_oldSyncBehavior){for(var t in o.current)if(i.current[t]){if(i.current[t]._handlersChanged){i.current[t]._cachedHandlersChanged=i.current[t]._handlersChanged;i.current[t]._handlersChanged=null;r.push(i.current[t])}i.current[t].removeHandler(o.current[t])}n=__assign({},p);for(var a in f){delete n[a];i.current[a].addHandler(f[a])}}else if(!o.current){n=__assign({},p);for(var a in f)delete n[a]}o.current=f;if(i.current){wijmo_1.copy(i.current,n,!1,!0);for(var s in v)_setHostAttribute(i.current.hostElement,s,v[s]);for(var s in h)e.customProps[s](i.current,h[s]);!function(){for(var e=0,n=r;e<n.length;e++){var t=n[e];if(t._cachedHandlersChanged){t._handlersChanged=t._cachedHandlersChanged;t._cachedHandlersChanged=null}}r=[]}()}},updateChildProps=function(){a.current=updateChildProperties({controlRef:i,childInfo:a.current},e.props.children)};React.useLayoutEffect((function(){if(t.current&&!i.current){i.current=new e.constructor(t.current,p);e.prePropsInit&&e.prePropsInit(i.current);if(m)if(wijmo_1.isFunction(m)){var r=m({control:i.current,props:e.props});wijmo_1.isFunction(r)&&(c.current=r)}else m.current&&m.current.control==i.current||(m.current={control:i.current,props:e.props});for(var n in v)_setHostAttribute(i.current.hostElement,n,v[n]);e.props.children&&updateProps();e.initControl&&e.initControl(i.current);e.props.initialized&&setTimeout((function(){i.current&&e.props.initialized(i.current)}))}else s.current&&(s.current=!1);return function(){if(i.current){var e=i.current;s.current=!0;queueMicrotask((function(){if(s.current){e.dispose();i.current=null;a.current={};s.current=!1;c.current&&c.current()}}))}}}),[]);i.current&&queueMicrotask((function(){return updateProps()}));var y=React.createElement("div",__assign({},d,{ref:t}),[]),_setHostAttribute=function(e,r,n){if(e)switch(r){case"className":var t=u.current;if(t!==n){wijmo_1.removeClass(e,t);wijmo_1.addClass(e,n);u.current=n}}};return{renderResult:y,wjControl:i.current}}exports.useWjComponentBase=useWjComponentBase;function filterKnownProps(e,r,n){var t={};for(var o in e)(r.has(o)||n.has(o))&&(t[o]=e[o]);return t}function clearAndGetEvents(e,r,n,t){var o=t.current,i={};for(var a in r)n.has(a)&&(i[a]=r[a]);for(var s in o)e[s]&&(!_oldSyncBehavior||r[s]?e[s].removeHandler(o[s]):i[s]=o[s]);return i}function getCustomPropsData(e,r){var n={};for(var t in r)void 0!==e[t]&&(n[t]=e[t]);return n}function useWjComponentChildBase(e){var r={};r.knowProperties=new Set(e.properties);r.knowEvents=new Set(e.events);e.customProps||(e.customProps={});return{getInstance:function(n){var t={current:{}},o={current:{}},i={current:{}},a=getPropsAccordingToSyncMode(e.props,t.current),s=filterKnownProps(a,r.knowProperties,r.knowEvents),c=getCustomPropsData(a,e.customProps||{}),u=e.customConstructor?e.customConstructor(n,s,c):new e.constructor(e.needParentInstance?n:s,e.needParentInstance?s:void 0);e.ref&&(wijmo_1.isFunction(e.ref)?e.ref({control:u,props:e.props}):e.ref.current&&e.ref.current.control==u||(e.ref.current={control:u,props:e.props}));i.current=clearAndGetEvents(u,a,r.knowEvents,i);var updateProps=function(n){var a=getPropsAccordingToSyncMode(n,t.current);t.current=n;e.ref&&e.ref.current&&(e.ref.current.props=n);i.current=clearAndGetEvents(u,a,r.knowEvents,i);var s,c=filterKnownProps(a,r.knowProperties,r.knowEvents);u.initialize?u.initialize(c):wijmo_1.copy(u,c,!1,!0);for(var l in e.customProps)void 0!==a[l]&&e.customProps[l](u,a[l]);s=n.children||[],o.current=updateChildProperties({controlRef:{current:u},childInfo:o.current},s)};updateProps(e.props||[]);e.props.initialized&&wijmo_1.isFunction(e.props.initialized)&&e.props.initialized(u);return{instance:u,updateProps:updateProps}},props:e.props,parentProp:e.parentProp,wjProperty:e.props.wjProperty,isParentPropArray:e.isParentPropArray,assignedToParent:e.assignedToParent}}exports.useWjComponentChildBase=useWjComponentChildBase;var flushSyncStateCache={isReactRendering:null};function isReactRendering(){if(null==flushSyncStateCache.isReactRendering)try{var e=console.error,r=!1;console.error=function(){var e=arguments[0]||"";e.includes("flushSync")&&(r=!0)};flushSync((function(){}));console.error=e;flushSyncStateCache.isReactRendering=r}catch(e){}finally{queueMicrotask((function(){flushSyncStateCache.isReactRendering=null}))}return!!flushSyncStateCache.isReactRendering}function getReactDOM(){return ReactDOM}function _doRender(e,r,n){void 0===n&&(n=!1);isReactRendering()&&(n=!0);var t,o=elemRootMap.findIndex((function(e){return e.host===r}));if(-1===o){t=reactDomClient.createRoot(r);elemRootMap.push({host:r,root:t})}else t=elemRootMap[o].root;t.__scheduledForUnmount=!1;n?queueMicrotask((function(){flushSync((function(){t.render(e)}))})):flushSync((function(){t.render(e)}))}function selectiveDomRender(e,r,n){var t=this;void 0===n&&(n=!1);if(_reactMajorVersion<18){(0,getReactDOM().render)(e,r)}else if(reactDomClientReady)_doRender(e,r,n);else{__awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,ensureReactDomClientLoaded()];case 1:t.sent();_doRender(e,r,n);return[2]}}))}))}return r}exports.selectiveDomRender=selectiveDomRender;function unmountSafely(e){var r=e._internalRoot&&e._internalRoot.containerInfo.firstChild,n=e._internalRoot&&e._internalRoot.current&&e._internalRoot.current.child&&e._internalRoot.current.child.stateNode;n&&r==n?e.unmount():e._internalRoot=null;e.__scheduledForUnmount=null}function _doUnmount(e){var r=elemRootMap.findIndex((function(r){return r.host===e}));if(-1!==r){var n=elemRootMap[r].root;if(isReactRendering()){n.__scheduledForUnmount=!0;queueMicrotask((function(){n.__scheduledForUnmount&&flushSync((function(){unmountSafely(n);elemRootMap.splice(r,1)}))}))}else flushSync((function(){unmountSafely(n);elemRootMap.splice(r,1)}))}}function selectiveDomUnmount(e){var r=this;if(_reactMajorVersion<18){(0,getReactDOM().unmountComponentAtNode)(e)}else if(reactDomClientReady)_doUnmount(e);else{__awaiter(r,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,ensureReactDomClientLoaded()];case 1:r.sent();_doUnmount(e);return[2]}}))}))}}exports.selectiveDomUnmount=selectiveDomUnmount;function isKeyOrderSame(e,r,n){if(e.length!=r.length)return!1;for(var t=0;t<e.length;t++)if(e[t][n]!=r[t][n])return!1;return!0}function baseFlushSync(){flushSync((function(){}))}exports.baseFlushSync=baseFlushSync;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grapecity/wijmo.react.base",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.20261.48",
|
|
4
4
|
"description": "UI library for pure JS, Angular, React, Vue and more...",
|
|
5
5
|
"author": "MESCIUS inc",
|
|
6
6
|
"license": "Commercial",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"types": "./index.d.ts",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@grapecity/wijmo": "5.
|
|
10
|
+
"@grapecity/wijmo": "5.20261.48"
|
|
11
11
|
},
|
|
12
12
|
"homepage": "https://developer.mescius.com/wijmo",
|
|
13
13
|
"bugs": {
|