@mescius/wijmo.grid.transposed 5.20232.939 → 5.20241.2-rc

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 CHANGED
@@ -1,4 +1,4 @@
1
- [English](#wijmo) | [日本語](#wijmo-jp) | [中文](#wijmo-cn) | [한국어](#wijmo-kr)
1
+ [English](#wijmo) | [日本語](#wijmo-jp) | [한국어](#wijmo-kr)
2
2
 
3
3
  # Wijmo
4
4
 
@@ -59,19 +59,19 @@ Sample source code available with our [Wijmo Developer Pack](https://developer.m
59
59
  ### To install latest release version:
60
60
 
61
61
  ```sh
62
- npm install @grapecity/wijmo.all
62
+ npm install @mescius/wijmo.all
63
63
  ```
64
64
 
65
65
  ### To install latest nightly build:
66
66
 
67
67
  ```sh
68
- npm install @grapecity/wijmo.all@nightly
68
+ npm install @mescius/wijmo.all@nightly
69
69
  ```
70
70
 
71
71
  ### To install latest RC build:
72
72
 
73
73
  ```sh
74
- npm install @grapecity/wijmo.all@rc
74
+ npm install @mescius/wijmo.all@rc
75
75
  ```
76
76
 
77
77
  ## Documentation
@@ -159,99 +159,6 @@ Submit questions to our team of [Wijmo Experts](https://developer.mescius.com/fo
159
159
  - [サポート&サービス](https://developer.mescius.jp/support)
160
160
  - [サブスクリプションサービス利用規約](https://download.mescius.jp/license/other/componentone-subscriptionservice.pdf)
161
161
 
162
- ## Wijmo CN
163
-
164
- Wijmo 是一套完整的企业级 JavaScript UI 开发组件。 它包括强大的表格、图表、数据透视、输入等组件,并且可以支持各类主流前端框架,包括 Angular、React 和 Vue。
165
-
166
- Wijmo 的轻量级、高性能 JavaScript UI 组件可以将您的开发时间缩短一半。
167
-
168
- 查看我们 [FlexGrid 表格](https://demo.grapecity.com.cn/wijmo/demos/Grid/Overview/purejs) 组件.
169
-
170
-
171
- ---
172
-
173
- ## 从 NPM 获取您所缺少的开发包!
174
-
175
- 请务必下载 Wijmo 以获得完整的开发包。 NPM 仅包含我们的 JS 组件,但我们的开发包包含数百个示例,其中包含每个 JS 框架的源代码、实际参考应用程序等等!
176
-
177
- **[下载 Wijmo 开发包](https://www.grapecity.com.cn/developer/wijmojs/download) 以启动您的项目。**
178
-
179
- ---
180
-
181
- ## 示例
182
-
183
- 每种 JavaScript 框架中都提供超过 450 个功能示例
184
-
185
- - [JavaScript 示例](https://demo.grapecity.com.cn/wijmo/demos/Grid/Overview/purejs)
186
- - [Vue 示例](https://demo.grapecity.com.cn/wijmo/demos/Grid/Overview/vue)
187
- - [Angular 示例](https://demo.grapecity.com.cn/wijmo/demos/Grid/Overview/angular)
188
- - [React 示例](https://demo.grapecity.com.cn/wijmo/demos/Grid/Overview/react)
189
-
190
- 我们还提供了 JavaScript 框架中可用的实际应用示例
191
-
192
-
193
- - [Vue 参考应用](https://www.grapecity.com/wijmo/demos/reference-samples/#GeoDashboard)
194
- - [Angular 参考应用](https://demos.wijmo.com/5/SampleExplorer/SampleExplorer/Sample/WealthHealth)
195
- - [React 参考应用](https://www.grapecity.com/wijmo/demos/reference-samples/#GeoDashboard)
196
- - [React Redux 参考应用](https://www.grapecity.com/wijmo/demos/reference-samples/#CryptoCurrencyTracking)
197
-
198
- [Wijmo 开发包](https://www.grapecity.com.cn/developer/wijmojs/download) 中提供了示例源代码。
199
-
200
- ## 安装
201
-
202
- ### 安装最新版本:
203
-
204
- ```sh
205
- npm install @grapecity/wijmo.all
206
- ```
207
-
208
- ### 安装最新的 nightly 版本:
209
- ```sh
210
- npm install @grapecity/wijmo.all@nightly
211
- ```
212
-
213
- ### 安装最新的 RC 版本:
214
-
215
- ```sh
216
- npm install @grapecity/wijmo.all@rc
217
- ```
218
-
219
- ## 文档
220
-
221
- 在线文档可在此处获取:
222
-
223
- - [API Reference](https://demo.grapecity.com.cn/wijmo/api/)
224
- - [Documentation Guides](https://demo.grapecity.com.cn/wijmo/docs/GettingStarted/Introduction)
225
-
226
- ## 许可
227
-
228
- Wijmo授权由开发授权和部署授权组成
229
-
230
- 了解 [WijmoJS 价格与授权方式](https://www.grapecity.com.cn/developer/wijmojs#price).
231
-
232
- ## 资源
233
-
234
- - [快速入门指南](https://demo.grapecity.com.cn/wijmo/docs/GettingStarted/QuickStart/QuickStart-PureJS)
235
- - [Wijmo 产品介绍](https://www.grapecity.com.cn/developer/wijmojs)
236
- - [博客](https://www.grapecity.com.cn/blogs/tags/wijmo)
237
- - [论坛](https://gcdn.grapecity.com.cn/showforum-140-1.html)
238
-
239
- Wijmo 开发包可以从 [这里](https://www.grapecity.com.cn/developer/wijmojs/download) 下载
240
-
241
- ## 支持
242
-
243
- **Wijmo 随时为您提供支持**
244
-
245
- 提供多种售前支持方式。您可以通过电话热线、邮件、售前顾问、在线咨询、添加企业微信等方式获取获取售前咨询、产品解决方案、产品选型等1V1服务。帮您快速了解产品特性,助您POC验证成功,节省时间成本。
246
-
247
- - [联系我们](https://www.grapecity.com.cn/support#goumaizixun)
248
-
249
-
250
- ## 问题反馈
251
-
252
- 我们重视您的反馈并利用建议来帮助创建产品路线图。 告诉我们你的想法。
253
-
254
- [提交您的问题和反馈建议](https://gcdn.grapecity.com.cn/showforum-173-1.html)
255
162
 
256
163
  # Wijmo KR
257
164
 
@@ -302,19 +209,19 @@ Wijmo는 또한 NPM을 지원합니다. 이를 통해 최신 버전의 Wijmo 라
302
209
  **[최신 정식 버전]**
303
210
 
304
211
  ```sh
305
- npm install @grapecity/wijmo.all
212
+ npm install @mescius/wijmo.all
306
213
  ```
307
214
 
308
215
  **[Nightly 버전]**
309
216
 
310
217
  ```sh
311
- npm install @grapecity/wijmo.all@nightly
218
+ npm install @mescius/wijmo.all@nightly
312
219
  ```
313
220
 
314
221
  **[RC 버전]**
315
222
 
316
223
  ```sh
317
- npm install @grapecity/wijmo.all@rc
224
+ npm install @mescius/wijmo.all@rc
318
225
  ```
319
226
 
320
227
  ## 빠른시작 가이드
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20232.939
3
+ * Wijmo Library 5.20241.2
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 __importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});const wijmo_grid_1=require("@mescius/wijmo.grid"),wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.grid.transposed"));class _MergeManager extends wijmo_grid_1.MergeManager{getMergedRange(e,t,o,r=!0){let i=e.grid,s=i._hasColumnGroups();if(e==i.columnHeaders&&s)return null;if(e==i.rowHeaders&&s){if(t<0||t>=e.rows.length||o<0||o>=e.columns.length)return null;let r=i._getColumnGroup(t,o);if(r){let o=r._rng,i=e.rows;if(i.isFrozen(o.row)!=i.isFrozen(o.row2)){o=o.clone();i.isFrozen(t)?o.row2=i.frozen-1:o.row=i.frozen}return o}return null}return super.getMergedRange(e,t,o,r)}}exports._MergeManager=_MergeManager;class TransposedGrid extends wijmo_grid_1.FlexGrid{constructor(e,t){super(e,null);this._keyPrefix="item";this._autoGenRows=!0;wijmo_1.addClass(this.hostElement,"wj-transposed-grid");this.allowSorting=wijmo_grid_1.AllowSorting.None;this.headersVisibility=wijmo_grid_1.HeadersVisibility.Row;this._rowInfo=new wijmo_grid_1.ColumnCollection(this,this.columns.defaultSize);this._grpHdl=new _RowGroupHandler(this);this.mergeManager=new _MergeManager;this.initialize(t);this._rowInfo.collectionChanged.addHandler(this._rowInfoChanged,this);this.deferUpdate(()=>{let e=this.rowHeaders.columns;if(e.length){e[e.length-1].width=this.columns.defaultSize}})}get autoGenerateRows(){return this._autoGenRows}set autoGenerateRows(e){this._autoGenRows=wijmo_1.asBoolean(e)}get rowGroups(){return this._grpHdl.getGroupDefinitions()}set rowGroups(e){this._rowInfo.deferUpdate(()=>{this.autoGenerateRows=!1;this._rowInfo.clear();this._grpHdl.createColumnGroups(wijmo_1.asArray(e))})}refresh(e){let t=this._rowInfo;if(t._dirty){t._dirty=!1;this._rowInfoChanged()}else super.refresh(e)}get allowAddNew(){return!1}set allowAddNew(e){}get allowDelete(){return!1}set allowDelete(e){}get allowSorting(){return wijmo_grid_1.AllowSorting.None}set allowSorting(e){wijmo_1.assert(e===wijmo_grid_1.AllowSorting.None,"TransposedGrid does not support sorting.");this._alSorting=e}get columnGroups(){return null}set columnGroups(e){throw"TransposedGrid does not support columnGroups, use rowGroups instead."}onRowEditEnded(e){let t=wijmo_1.tryCast(this._sourceItems,"ICollectionView");if(t){let e=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Change);t.collectionChanged.raise(t,e)}super.onRowEditEnded(e)}_getCollectionView(e){let t=wijmo_1.tryCast(this._sourceItems,"ICollectionView");t&&t.collectionChanged.removeHandler(this._sourceViewChanged);t=wijmo_1.tryCast(e,"ICollectionView");let o=e;if(wijmo_1.isArray(e))o=this._transposeItemsSource(e);else if(t){t.collectionChanged.addHandler(this._sourceViewChanged,this);o=this._transposeItemsSource(t.items)}this.autoGenerateColumns=!0;let r=super._getCollectionView(o),i=null;t instanceof wijmo_1.CollectionView&&(i=t.getError);i&&r instanceof wijmo_1.CollectionView&&(this._supportsProxies()?r.getError=(e,t)=>{if(null==t)return null;let o=e._keys.indexOf(t);return i(e._arr[o],e._bnd.path)}:r.getError=(e,t)=>{if(null==t)return null;let o=parseInt(t.substr(this._keyPrefix.length));return i(e._arr[o],e._rowInfo.binding)});this._sourceItems=e;return r}_getColumnTypes(e){let t,o;if(this._sourceItems)if(wijmo_1.isArray(this._sourceItems))o=this._sourceItems;else{let e=wijmo_1.tryCast(this._sourceItems,"ICollectionView");e&&(o=e.items)}return t=o?o.map((e,t)=>({binding:this._keyPrefix+t,dataType:wijmo_1.DataType.Object})):wijmo_1.getTypes(e)}_copy(e,t){if(/rows|columns/.test(e)){wijmo_1.assert(wijmo_1.isArray(t),"Array Expected.");let e=wijmo_1.asArray(t);e.some(e=>null!=e.columns)?this.rowGroups=e:this._rowInfo.deferUpdate(()=>{this.autoGenerateRows=!1;this._rowInfo.clear();t.forEach(e=>{let t=new TransposedGridRow(e);this._rowInfo.push(t)})});return!0}return super._copy(e,t)}onLoadedRows(e){let t=this.columns;for(let e=0;e<t.length;e++){let o=t[e];o.align=null;o.dataType=0}let o=this.rowHeaders.columns;for(let e=0;e<o.length;e++){o[e].align="left";o[e].width=0}let r=wijmo_grid_1.FlexGrid._getSerializableProperties(wijmo_grid_1.Row);this.rows.forEach(e=>{let t=e.dataItem._rowInfo;if(t){this._copyProps(t,e,r,["showDropDown","width","size"]);if(this._hasColumnGroups())for(let t=0;t<o.length;t++){let o=this._grpHdl.getColumnGroup(e.index,t);o&&this._updateRowHeaders(e.index,t,o)}else o.length&&this._updateRowHeaders(e.index,o.length-1,t)}});for(let e=0;e<o.length;e++)0===o[e].width&&(o[e].width=this.columns.defaultSize);super.onLoadedRows(e)}_getBindingColumn(e,t,o){let r=o;if(e!=this.cells)return r;let i=e.rows[t],s=i&&i.dataItem&&i.dataItem._rowInfo;if(wijmo_1.isUndefined(s))return r;r=new wijmo_grid_1.Column;let n=wijmo_grid_1.FlexGrid._getSerializableProperties(wijmo_grid_1.Column);this._copyProps(s,r,n);r.binding=o.binding;r.header=s.header||wijmo_1.toHeaderCase(s.binding);return r}_isTransposed(){return!0}_autoSizeRows(){this.autoSizeMode&wijmo_grid_1.AutoSizeMode.Both&&this.autoSizeRows();super._autoSizeRows()}_copyProps(e,t,o,r=[]){for(let i in e)if(o.indexOf(i)>-1&&-1===r.indexOf(i)){let o=e[i];if(!wijmo_1.isUndefined(o))try{t[i]=o}catch(e){}}}_updateRowHeaders(e,t,o){let r=o.header||wijmo_1.toHeaderCase(o.binding);this.rowHeaders.setCellData(e,t,r);let i=this.rowHeaders.columns,s=o.width;if(wijmo_1.isNumber(s)&&s>0){let e=o._rng;if(e&&e instanceof wijmo_grid_1.CellRange&&e.isValid){let t=e.columnSpan;wijmo_1.assert(t>0,"Column span is negative or equal to 0");s/=t}i[t].width=Math.max(i[t].width,s)}}_rowInfoChanged(){this._toRowInfo&&clearTimeout(this._toRowInfo);this._toRowInfo=setTimeout(()=>{let e=this.selection,t=this.itemsSource;this.itemsSource=null;this.itemsSource=t;this.selection=e},wijmo_1.Control._REFRESH_INTERVAL)}_sourceViewChanged(e,t){this.activeEditor||this.invalidate()}_transposeItemsSource(e){let t=new wijmo_1.ObservableArray,o=wijmo_1.getTypes(e),r=e.map((e,t)=>this._keyPrefix+t);(this.autoGenerateRows?this._getRowInfo(e):this._rowInfo).forEach((i,s)=>{let n=new wijmo_1.Binding(i.binding);if(null==i.dataType&&e.length){let t=n.getValue(e[0]);i.dataType=null!=t?wijmo_1.getType(t):o[s].dataType}if(this._supportsProxies()){let o=this._createProxy(e,i,r);t.push(o)}else{let o=this._createTransposedObject(e,i,this._keyPrefix);t.push(o)}});e instanceof wijmo_1.ObservableArray&&e.collectionChanged.addHandler((e,o)=>{if(o.action===wijmo_1.NotifyCollectionChangedAction.Change)this.activeEditor||this.invalidate();else{let e=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Reset);t.onCollectionChanged(e);this._rowInfoChanged()}});return t}_supportsProxies(){return null!=window.Proxy}_createProxy(e,t,o){let r={_arr:e,_rowInfo:t,_bnd:new wijmo_1.Binding(t.binding),_keys:o};return new Proxy(r,{ownKeys:e=>e._keys,getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0,writable:!0}),get:(e,t)=>{let o=e._keys.indexOf(t);return o>-1?e._bnd.getValue(e._arr[o]):e[t]},set:(e,t,o)=>{let r=e._keys.indexOf(t);if(r>-1){let t=e._arr,i=t[r];e._bnd.setValue(i,o);if(t instanceof wijmo_1.ObservableArray){let e=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Change,i,r);t.onCollectionChanged(e)}return!0}return!1}})}_createTransposedObject(e,t,o){let r={_arr:e,_rowInfo:t},i=new wijmo_1.Binding(t.binding);for(let t=0;t<e.length;t++){let s=e[t];Object.defineProperty(r,o+t,{enumerable:!0,get:()=>i.getValue(s),set:o=>{i.setValue(s,o);if(e instanceof wijmo_1.ObservableArray){let o=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Change,s,t);e.onCollectionChanged(o)}return!0}})}return r}_getRowInfo(e){let t=[];wijmo_1.getTypes(e).forEach(e=>{let o=e.binding,r=e.dataType;if(r!=wijmo_1.DataType.Object&&r!=wijmo_1.DataType.Array){let e={binding:o,header:wijmo_1.toHeaderCase(o),dataType:r},i=wijmo_grid_1.FlexGrid._defTypeWidth[r];if(null!=i){if(wijmo_1.isString(i)){let e=Math.round(parseFloat(i));i=i.indexOf("*")<0?e:e*this.columns.defaultSize}wijmo_1.isNumber(i)&&i>0&&(e.width=i)}t.push(e)}});return t}}exports.TransposedGrid=TransposedGrid;class TransposedGridRow extends wijmo_grid_1.Column{get height(){return this._height}set height(e){this._height=e}}exports.TransposedGridRow=TransposedGridRow;class _RowGroupHandler{constructor(e){this._grid=e}get columnGroups(){return null}createColumnGroups(e){this._createRowGroups(e)}hasColumnGroups(){return null!=this._colGroups&&this._colGroups.length>0}getGroupDefinitions(){return this._groupDefs}getColumnGroup(e,t){let o=this._grid;if(t<o.rowHeaders.columns.length&&e<o._rowInfo.length)for(let o=this._colGroups;o;){let r=o;for(let r=0;r<o.length;r++){let i=o[r],s=i._rng;if(s.containsRow(e)){if(s.containsColumn(t)||0==i.columns.length)return i;o=i.columns;break}}if(o==r)break}return null}canMoveColumnGroup(e,t,o,r){return this._grid.columns.canMoveElement(t,r)}moveColumnGroup(e,t,o,r,i){return this._grid.columns.moveElement(t,r)}_createRowGroups(e){let t=this._grid;this._groupDefs=wijmo_1.asArray(e);t.autoGenerateRows=!1;t._rowInfo.clear();this._colGroups=[];e.forEach(e=>{this._colGroups.push(new _RowGroup(e,null))});let o=1;this._colGroups.forEach(e=>{this._addRowGroup(e);o=Math.max(o,e._getMaxLevel())});this._colGroups.forEach(e=>{e._expandRange(o)});let r=t.rowHeaders.columns;r.clear();for(let e=0;e<=o;e++){let t=new wijmo_grid_1.Column;r.splice(e,0,t);e<o&&(t.cssClassAll="wj-colgroup")}}_addRowGroup(e){let t=this._grid;e._grid=t;e._rng.row=t._rowInfo.length;0==e.columns.length?t._rowInfo.push(e):e.columns.forEach(e=>{this._addRowGroup(e)});e._rng.row2=t._rowInfo.length-1}}exports._RowGroupHandler=_RowGroupHandler;class _RowGroup extends wijmo_grid_1.Column{constructor(e,t){super();this._rng=new wijmo_grid_1.CellRange(-1,0);this._cols=[];this._lvl=0;this._collapsed=!1;this._pGrp=t;this._lvl=0;for(let e=t;e;e=e._pGrp)this._lvl++;t&&t.columns.indexOf(this)<0&&t.columns.push(this);this._rng.col=this._rng.col2=this._lvl;this.allowDragging=!1;wijmo_1.copy(this,e)}get columns(){return this._cols}set columns(e){let t=this._cols=[];e.forEach(e=>{let o=new _RowGroup(e,this);t.indexOf(o)<0&&t.push(o)})}get rows(){return this._cols}get isEmpty(){return 0===this._cols.length}get height(){return this._height}set height(e){this._height=e}get level(){let e=this,t=0;for(;e._pGrp;){e=e._pGrp;t++}return t}get collapseTo(){return this._collTo}set collapseTo(e){wijmo_1.assert(wijmo_1.isArray(e)||wijmo_1.isString(e),"collapseTo should be an array or a string.");this._collTo=e}get isCollapsed(){return this._collapsed}set isCollapsed(e){if(e!=this._collapsed){let t=this._grid;if(t){let o=new wijmo_grid_1.CellRangeEventArgs(t.rowHeaders,this._rng,this);if(t.onColumnGroupCollapsedChanging(o)){this._collapsed=wijmo_1.asBoolean(e);t.onColumnGroupCollapsedChanged(o)}}else this._collapsed=wijmo_1.asBoolean(e)}setTimeout(()=>{this._updateCollapsedState()})}_copy(e,t){if(/rows|columns/.test(e)){let e=wijmo_1.asArray(t);this.columns=e;return!0}return!1}_updateCollapsedState(){let e=this._grid._rowInfo,t=this._rng,o=this._collapsed;this._cols.forEach(e=>{if(e instanceof _RowGroup){e._collapsed=o;e._updateCollapsedState()}});let r=this._getCollapseToIndices();for(let i=t.topRow;i<=t.bottomRow;i++)e[i].visible=!o||r.indexOf(i)>-1}_getMaxLevel(){let e=this._lvl;this.columns.forEach(t=>{e=Math.max(e,t._getMaxLevel())});return e}_expandRange(e){let t=e-this._getMaxLevel();if(t>0){this._rng.col2+=t;this._cols.forEach(e=>{e._shiftRange(t)})}let o=this._grid._rowInfo,r=this._rng;for(let t=r.row;t<=r.row2;t++){o[t]._rng.col2=e}}_shiftRange(e){this._rng.col+=e;this._rng.col2+=e;this._cols.forEach(t=>{t._shiftRange(e)})}_getCollapseToBindings(){let e=this.collapseTo;return wijmo_1.isString(e)?[e]:e}_getCollapseToIndices(){let e=this._grid,t=this._rng,o=this._getCollapseToBindings();if(o&&o.length){let r=[],i=e._rowInfo;for(let e=0;e<o.length;e++)switch(o[e]){case"$first":r.push(t.topRow);break;case"$last":r.push(t.bottomRow);break;default:let s=i.indexOf(o[e]);s>-1&&r.push(s)}if(r.length)return r}return[t.bottomRow]}}exports._RowGroup=_RowGroup;wijmo_1._registerModule("wijmo.grid.transposed",selfModule);
14
+ "use strict";var __importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});const wijmo_grid_1=require("@mescius/wijmo.grid"),wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.grid.transposed"));class _MergeManager extends wijmo_grid_1.MergeManager{getMergedRange(e,t,o,r=!0){let i=e.grid,s=i._hasColumnGroups();if(e==i.columnHeaders&&s)return null;if(e==i.rowHeaders&&s){if(t<0||t>=e.rows.length||o<0||o>=e.columns.length)return null;let r=i._getColumnGroup(t,o);if(r){let o=r._rng,i=e.rows;if(i.isFrozen(o.row)!=i.isFrozen(o.row2)){o=o.clone();i.isFrozen(t)?o.row2=i.frozen-1:o.row=i.frozen}return o}return null}return super.getMergedRange(e,t,o,r)}}exports._MergeManager=_MergeManager;class TransposedGrid extends wijmo_grid_1.FlexGrid{constructor(e,t){super(e,null);this._keyPrefix="item";this._autoGenRows=!0;wijmo_1.addClass(this.hostElement,"wj-transposed-grid");this.allowSorting=wijmo_grid_1.AllowSorting.None;this.headersVisibility=wijmo_grid_1.HeadersVisibility.Row;this._rowInfo=new wijmo_grid_1.ColumnCollection(this,this.columns.defaultSize);this._grpHdl=new _RowGroupHandler(this);this.mergeManager=new _MergeManager;this.initialize(t);this._rowInfo.collectionChanged.addHandler(this._rowInfoChanged,this);this.deferUpdate(()=>{let e=this.rowHeaders.columns;if(e.length){e[e.length-1].width=this.columns.defaultSize}})}get autoGenerateRows(){return this._autoGenRows}set autoGenerateRows(e){this._autoGenRows=wijmo_1.asBoolean(e)}get rowGroups(){return this._grpHdl.getGroupDefinitions()}set rowGroups(e){this._rowInfo.deferUpdate(()=>{this.autoGenerateRows=!1;this._rowInfo.clear();this._grpHdl.createColumnGroups(wijmo_1.asArray(e))})}refresh(e){let t=this._rowInfo;if(t._dirty){t._dirty=!1;this._rowInfoChanged()}else super.refresh(e)}get allowAddNew(){return!1}set allowAddNew(e){}get allowDelete(){return!1}set allowDelete(e){}get allowSorting(){return wijmo_grid_1.AllowSorting.None}set allowSorting(e){wijmo_1.assert(e===wijmo_grid_1.AllowSorting.None,"TransposedGrid does not support sorting.");this._alSorting=e}get columnGroups(){return null}set columnGroups(e){throw"TransposedGrid does not support columnGroups, use rowGroups instead."}onRowEditEnded(e){let t=wijmo_1.tryCast(this._sourceItems,"ICollectionView");if(t){let e=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Change);t.collectionChanged.raise(t,e)}super.onRowEditEnded(e)}_getCollectionView(e){let t=wijmo_1.tryCast(this._sourceItems,"ICollectionView");t&&t.collectionChanged.removeHandler(this._sourceViewChanged);t=wijmo_1.tryCast(e,"ICollectionView");let o=e;if(wijmo_1.isArray(e))o=this._transposeItemsSource(e);else if(t){t.collectionChanged.addHandler(this._sourceViewChanged,this);o=this._transposeItemsSource(t.items)}this.autoGenerateColumns=!0;let r=super._getCollectionView(o),i=null;t instanceof wijmo_1.CollectionView&&(i=t.getError);i&&r instanceof wijmo_1.CollectionView&&(this._supportsProxies()?r.getError=(e,t)=>{if(null==t)return null;let o=e._keys.indexOf(t);return i(e._arr[o],e._bnd.path)}:r.getError=(e,t)=>{if(null==t)return null;let o=parseInt(t.substr(this._keyPrefix.length));return i(e._arr[o],e._rowInfo.binding)});this._sourceItems=e;return r}_getColumnTypes(e){let t,o;if(this._sourceItems)if(wijmo_1.isArray(this._sourceItems))o=this._sourceItems;else{let e=wijmo_1.tryCast(this._sourceItems,"ICollectionView");e&&(o=e.items)}return t=o?o.map((e,t)=>({binding:this._keyPrefix+t,dataType:wijmo_1.DataType.Object})):wijmo_1.getTypes(e,0,!0)}_copy(e,t){if(/rows|columns/.test(e)){wijmo_1.assert(wijmo_1.isArray(t),"Array Expected.");let e=wijmo_1.asArray(t);e.some(e=>null!=e.columns)?this.rowGroups=e:this._rowInfo.deferUpdate(()=>{this.autoGenerateRows=!1;this._rowInfo.clear();t.forEach(e=>{let t=new TransposedGridRow(e);this._rowInfo.push(t)})});return!0}return super._copy(e,t)}onLoadedRows(e){let t=this.columns;for(let e=0;e<t.length;e++){let o=t[e];o.align=null;o.dataType=0}let o=this.rowHeaders.columns;for(let e=0;e<o.length;e++){o[e].align="left";o[e].width=0}let r=wijmo_grid_1.FlexGrid._getSerializableProperties(wijmo_grid_1.Row);this.rows.forEach(e=>{let t=e.dataItem._rowInfo;if(t){this._copyProps(t,e,r,["showDropDown","width","size"]);if(this._hasColumnGroups())for(let t=0;t<o.length;t++){let o=this._grpHdl.getColumnGroup(e.index,t);o&&this._updateRowHeaders(e.index,t,o)}else o.length&&this._updateRowHeaders(e.index,o.length-1,t)}});for(let e=0;e<o.length;e++)0===o[e].width&&(o[e].width=this.columns.defaultSize);super.onLoadedRows(e)}_getBindingColumn(e,t,o){let r=o;if(e!=this.cells)return r;let i=e.rows[t],s=i&&i.dataItem&&i.dataItem._rowInfo;if(wijmo_1.isUndefined(s))return r;r=new wijmo_grid_1.Column;let n=wijmo_grid_1.FlexGrid._getSerializableProperties(wijmo_grid_1.Column);this._copyProps(s,r,n);r.binding=o.binding;r.header=s.header||wijmo_1.toHeaderCase(s.binding);return r}_isTransposed(){return!0}_autoSizeRows(){this.autoSizeMode&wijmo_grid_1.AutoSizeMode.Both&&this.autoSizeRows();super._autoSizeRows()}_copyProps(e,t,o,r=[]){for(let i in e)if(o.indexOf(i)>-1&&-1===r.indexOf(i)){let o=e[i];if(!wijmo_1.isUndefined(o))try{t[i]=o}catch(e){}}}_updateRowHeaders(e,t,o){let r=o.header||wijmo_1.toHeaderCase(o.binding);this.rowHeaders.setCellData(e,t,r);let i=this.rowHeaders.columns,s=o.width;if(wijmo_1.isNumber(s)&&s>0){let e=o._rng;if(e&&e instanceof wijmo_grid_1.CellRange&&e.isValid){let t=e.columnSpan;wijmo_1.assert(t>0,"Column span is negative or equal to 0");s/=t}i[t].width=Math.max(i[t].width,s)}}_rowInfoChanged(){this._toRowInfo&&clearTimeout(this._toRowInfo);this._toRowInfo=setTimeout(()=>{let e=this.selection,t=this.itemsSource;this.itemsSource=null;this.itemsSource=t;this.selection=e},wijmo_1.Control._REFRESH_INTERVAL)}_sourceViewChanged(e,t){this.activeEditor||this.invalidate()}_transposeItemsSource(e){let t=new wijmo_1.ObservableArray,o=wijmo_1.getTypes(e,0,!0),r=e.map((e,t)=>this._keyPrefix+t);(this.autoGenerateRows?this._getRowInfo(e):this._rowInfo).forEach((i,s)=>{let n=new wijmo_1.Binding(i.binding);if(null==i.dataType&&e.length){let t=n.getValue(e[0]);i.dataType=null!=t?wijmo_1.getType(t):o[s].dataType}if(this._supportsProxies()){let o=this._createProxy(e,i,r);t.push(o)}else{let o=this._createTransposedObject(e,i,this._keyPrefix);t.push(o)}});e instanceof wijmo_1.ObservableArray&&e.collectionChanged.addHandler((e,o)=>{if(o.action===wijmo_1.NotifyCollectionChangedAction.Change)this.activeEditor||this.invalidate();else{let e=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Reset);t.onCollectionChanged(e);this._rowInfoChanged()}});return t}_supportsProxies(){return null!=window.Proxy}_createProxy(e,t,o){let r={_arr:e,_rowInfo:t,_bnd:new wijmo_1.Binding(t.binding),_keys:o};return new Proxy(r,{ownKeys:e=>e._keys,getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0,writable:!0}),get:(e,t)=>{let o=e._keys.indexOf(t);return o>-1?e._bnd.getValue(e._arr[o]):e[t]},set:(e,t,o)=>{let r=e._keys.indexOf(t);if(r>-1){let t=e._arr,i=t[r];e._bnd.setValue(i,o);if(t instanceof wijmo_1.ObservableArray){let e=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Change,i,r);t.onCollectionChanged(e)}return!0}return!1}})}_createTransposedObject(e,t,o){let r={_arr:e,_rowInfo:t},i=new wijmo_1.Binding(t.binding);for(let t=0;t<e.length;t++){let s=e[t];Object.defineProperty(r,o+t,{enumerable:!0,get:()=>i.getValue(s),set:o=>{i.setValue(s,o);if(e instanceof wijmo_1.ObservableArray){let o=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Change,s,t);e.onCollectionChanged(o)}return!0}})}return r}_getRowInfo(e){let t=[];wijmo_1.getTypes(e,0,!0).forEach(e=>{let o=e.binding,r=e.dataType;if(r!=wijmo_1.DataType.Object){let e={binding:o,header:wijmo_1.toHeaderCase(o),dataType:r},i=wijmo_grid_1.FlexGrid._defTypeWidth[r];if(null!=i){if(wijmo_1.isString(i)){let e=Math.round(parseFloat(i));i=i.indexOf("*")<0?e:e*this.columns.defaultSize}wijmo_1.isNumber(i)&&i>0&&(e.width=i)}t.push(e)}});return t}getRowDataItem(e,t){let o=this.cells;if(o.rows[e].dataItem._rowInfo instanceof TransposedGridRow){let e={};for(let r=0;r<o.rows.length;r++){e[o.rows[r].dataItem._rowInfo._binding.path]=o.getCellData(r,t,!1)}return e}return super.getRowDataItem(e,t)}}exports.TransposedGrid=TransposedGrid;class TransposedGridRow extends wijmo_grid_1.Column{get height(){return this._height}set height(e){this._height=e}}exports.TransposedGridRow=TransposedGridRow;class _RowGroupHandler{constructor(e){this._grid=e}get columnGroups(){return null}createColumnGroups(e){this._createRowGroups(e)}hasColumnGroups(){return null!=this._colGroups&&this._colGroups.length>0}getGroupDefinitions(){return this._groupDefs}getColumnGroup(e,t){let o=this._grid;if(t<o.rowHeaders.columns.length&&e<o._rowInfo.length)for(let o=this._colGroups;o;){let r=o;for(let r=0;r<o.length;r++){let i=o[r],s=i._rng;if(s.containsRow(e)){if(s.containsColumn(t)||0==i.columns.length)return i;o=i.columns;break}}if(o==r)break}return null}canMoveColumnGroup(e,t,o,r){return this._grid.columns.canMoveElement(t,r)}moveColumnGroup(e,t,o,r,i){return this._grid.columns.moveElement(t,r)}_createRowGroups(e){let t=this._grid;this._groupDefs=wijmo_1.asArray(e);t.autoGenerateRows=!1;t._rowInfo.clear();this._colGroups=[];e.forEach(e=>{this._colGroups.push(new _RowGroup(e,null))});let o=1;this._colGroups.forEach(e=>{this._addRowGroup(e);o=Math.max(o,e._getMaxLevel())});this._colGroups.forEach(e=>{e._expandRange(o)});let r=t.rowHeaders.columns;r.clear();for(let e=0;e<=o;e++){let t=new wijmo_grid_1.Column;r.splice(e,0,t);e<o&&(t.cssClassAll="wj-colgroup")}}_addRowGroup(e){let t=this._grid;e._grid=t;e._rng.row=t._rowInfo.length;0==e.columns.length?t._rowInfo.push(e):e.columns.forEach(e=>{this._addRowGroup(e)});e._rng.row2=t._rowInfo.length-1}}exports._RowGroupHandler=_RowGroupHandler;class _RowGroup extends wijmo_grid_1.Column{constructor(e,t){super();this._rng=new wijmo_grid_1.CellRange(-1,0);this._cols=[];this._lvl=0;this._collapsed=!1;this._pGrp=t;this._lvl=0;for(let e=t;e;e=e._pGrp)this._lvl++;t&&t.columns.indexOf(this)<0&&t.columns.push(this);this._rng.col=this._rng.col2=this._lvl;this.allowDragging=!1;wijmo_1.copy(this,e)}get columns(){return this._cols}set columns(e){let t=this._cols=[];e.forEach(e=>{let o=new _RowGroup(e,this);t.indexOf(o)<0&&t.push(o)})}get rows(){return this._cols}get isEmpty(){return 0===this._cols.length}get height(){return this._height}set height(e){this._height=e}get level(){let e=this,t=0;for(;e._pGrp;){e=e._pGrp;t++}return t}get collapseTo(){return this._collTo}set collapseTo(e){wijmo_1.assert(wijmo_1.isArray(e)||wijmo_1.isString(e),"collapseTo should be an array or a string.");this._collTo=e}get isCollapsed(){return this._collapsed}set isCollapsed(e){if(e!=this._collapsed){let t=this._grid;if(t){let o=new wijmo_grid_1.CellRangeEventArgs(t.rowHeaders,this._rng,this);if(t.onColumnGroupCollapsedChanging(o)){this._collapsed=wijmo_1.asBoolean(e);t.onColumnGroupCollapsedChanged(o)}}else this._collapsed=wijmo_1.asBoolean(e)}setTimeout(()=>{this._updateCollapsedState()})}_copy(e,t){if(/rows|columns/.test(e)){let e=wijmo_1.asArray(t);this.columns=e;return!0}return!1}_updateCollapsedState(){let e=this._grid._rowInfo,t=this._rng,o=this._collapsed;this._cols.forEach(e=>{if(e instanceof _RowGroup){e._collapsed=o;e._updateCollapsedState()}});let r=this._getCollapseToIndices();for(let i=t.topRow;i<=t.bottomRow;i++)e[i].visible=!o||r.indexOf(i)>-1}_getMaxLevel(){let e=this._lvl;this.columns.forEach(t=>{e=Math.max(e,t._getMaxLevel())});return e}_expandRange(e){let t=e-this._getMaxLevel();if(t>0){this._rng.col2+=t;this._cols.forEach(e=>{e._shiftRange(t)})}let o=this._grid._rowInfo,r=this._rng;for(let t=r.row;t<=r.row2;t++){o[t]._rng.col2=e}}_shiftRange(e){this._rng.col+=e;this._rng.col2+=e;this._cols.forEach(t=>{t._shiftRange(e)})}_getCollapseToBindings(){let e=this.collapseTo;return wijmo_1.isString(e)?[e]:e}_getCollapseToIndices(){let e=this._grid,t=this._rng,o=this._getCollapseToBindings();if(o&&o.length){let r=[],i=e._rowInfo;for(let e=0;e<o.length;e++)switch(o[e]){case"$first":r.push(t.topRow);break;case"$last":r.push(t.bottomRow);break;default:let s=i.indexOf(o[e]);s>-1&&r.push(s)}if(r.length)return r}return[t.bottomRow]}}exports._RowGroup=_RowGroup;wijmo_1._registerModule("wijmo.grid.transposed",selfModule);
package/es2015-esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20232.939
3
+ * Wijmo Library 5.20241.2
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
- import{MergeManager,CellRange,FlexGrid,Row,Column,ColumnCollection,CellRangeEventArgs,AllowSorting,HeadersVisibility,AutoSizeMode}from"@mescius/wijmo.grid";import{asArray,assert,isArray,isString,isNumber,isUndefined,asBoolean,getTypes,getType,tryCast,toHeaderCase,addClass,DataType,Binding,Control,CollectionView,ObservableArray,NotifyCollectionChangedEventArgs,NotifyCollectionChangedAction,copy,_registerModule}from"@mescius/wijmo";import*as selfModule from"@mescius/wijmo.grid.transposed";export class _MergeManager extends MergeManager{getMergedRange(e,t,o,r=!0){let s=e.grid,i=s._hasColumnGroups();if(e==s.columnHeaders&&i)return null;if(e==s.rowHeaders&&i){if(t<0||t>=e.rows.length||o<0||o>=e.columns.length)return null;let r=s._getColumnGroup(t,o);if(r){let o=r._rng,s=e.rows;if(s.isFrozen(o.row)!=s.isFrozen(o.row2)){o=o.clone();s.isFrozen(t)?o.row2=s.frozen-1:o.row=s.frozen}return o}return null}return super.getMergedRange(e,t,o,r)}}export class TransposedGrid extends FlexGrid{constructor(e,t){super(e,null);this._keyPrefix="item";this._autoGenRows=!0;addClass(this.hostElement,"wj-transposed-grid");this.allowSorting=AllowSorting.None;this.headersVisibility=HeadersVisibility.Row;this._rowInfo=new ColumnCollection(this,this.columns.defaultSize);this._grpHdl=new _RowGroupHandler(this);this.mergeManager=new _MergeManager;this.initialize(t);this._rowInfo.collectionChanged.addHandler(this._rowInfoChanged,this);this.deferUpdate(()=>{let e=this.rowHeaders.columns;if(e.length){e[e.length-1].width=this.columns.defaultSize}})}get autoGenerateRows(){return this._autoGenRows}set autoGenerateRows(e){this._autoGenRows=asBoolean(e)}get rowGroups(){return this._grpHdl.getGroupDefinitions()}set rowGroups(e){this._rowInfo.deferUpdate(()=>{this.autoGenerateRows=!1;this._rowInfo.clear();this._grpHdl.createColumnGroups(asArray(e))})}refresh(e){let t=this._rowInfo;if(t._dirty){t._dirty=!1;this._rowInfoChanged()}else super.refresh(e)}get allowAddNew(){return!1}set allowAddNew(e){}get allowDelete(){return!1}set allowDelete(e){}get allowSorting(){return AllowSorting.None}set allowSorting(e){assert(e===AllowSorting.None,"TransposedGrid does not support sorting.");this._alSorting=e}get columnGroups(){return null}set columnGroups(e){throw"TransposedGrid does not support columnGroups, use rowGroups instead."}onRowEditEnded(e){let t=tryCast(this._sourceItems,"ICollectionView");if(t){let e=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change);t.collectionChanged.raise(t,e)}super.onRowEditEnded(e)}_getCollectionView(e){let t=tryCast(this._sourceItems,"ICollectionView");t&&t.collectionChanged.removeHandler(this._sourceViewChanged);t=tryCast(e,"ICollectionView");let o=e;if(isArray(e))o=this._transposeItemsSource(e);else if(t){t.collectionChanged.addHandler(this._sourceViewChanged,this);o=this._transposeItemsSource(t.items)}this.autoGenerateColumns=!0;let r=super._getCollectionView(o),s=null;t instanceof CollectionView&&(s=t.getError);s&&r instanceof CollectionView&&(this._supportsProxies()?r.getError=(e,t)=>{if(null==t)return null;let o=e._keys.indexOf(t);return s(e._arr[o],e._bnd.path)}:r.getError=(e,t)=>{if(null==t)return null;let o=parseInt(t.substr(this._keyPrefix.length));return s(e._arr[o],e._rowInfo.binding)});this._sourceItems=e;return r}_getColumnTypes(e){let t,o;if(this._sourceItems)if(isArray(this._sourceItems))o=this._sourceItems;else{let e=tryCast(this._sourceItems,"ICollectionView");e&&(o=e.items)}return t=o?o.map((e,t)=>({binding:this._keyPrefix+t,dataType:DataType.Object})):getTypes(e)}_copy(e,t){if(/rows|columns/.test(e)){assert(isArray(t),"Array Expected.");let e=asArray(t);e.some(e=>null!=e.columns)?this.rowGroups=e:this._rowInfo.deferUpdate(()=>{this.autoGenerateRows=!1;this._rowInfo.clear();t.forEach(e=>{let t=new TransposedGridRow(e);this._rowInfo.push(t)})});return!0}return super._copy(e,t)}onLoadedRows(e){let t=this.columns;for(let e=0;e<t.length;e++){let o=t[e];o.align=null;o.dataType=0}let o=this.rowHeaders.columns;for(let e=0;e<o.length;e++){o[e].align="left";o[e].width=0}let r=FlexGrid._getSerializableProperties(Row);this.rows.forEach(e=>{let t=e.dataItem._rowInfo;if(t){this._copyProps(t,e,r,["showDropDown","width","size"]);if(this._hasColumnGroups())for(let t=0;t<o.length;t++){let o=this._grpHdl.getColumnGroup(e.index,t);o&&this._updateRowHeaders(e.index,t,o)}else o.length&&this._updateRowHeaders(e.index,o.length-1,t)}});for(let e=0;e<o.length;e++)0===o[e].width&&(o[e].width=this.columns.defaultSize);super.onLoadedRows(e)}_getBindingColumn(e,t,o){let r=o;if(e!=this.cells)return r;let s=e.rows[t],i=s&&s.dataItem&&s.dataItem._rowInfo;if(isUndefined(i))return r;r=new Column;let n=FlexGrid._getSerializableProperties(Column);this._copyProps(i,r,n);r.binding=o.binding;r.header=i.header||toHeaderCase(i.binding);return r}_isTransposed(){return!0}_autoSizeRows(){this.autoSizeMode&AutoSizeMode.Both&&this.autoSizeRows();super._autoSizeRows()}_copyProps(e,t,o,r=[]){for(let s in e)if(o.indexOf(s)>-1&&-1===r.indexOf(s)){let o=e[s];if(!isUndefined(o))try{t[s]=o}catch(e){}}}_updateRowHeaders(e,t,o){let r=o.header||toHeaderCase(o.binding);this.rowHeaders.setCellData(e,t,r);let s=this.rowHeaders.columns,i=o.width;if(isNumber(i)&&i>0){let e=o._rng;if(e&&e instanceof CellRange&&e.isValid){let t=e.columnSpan;assert(t>0,"Column span is negative or equal to 0");i/=t}s[t].width=Math.max(s[t].width,i)}}_rowInfoChanged(){this._toRowInfo&&clearTimeout(this._toRowInfo);this._toRowInfo=setTimeout(()=>{let e=this.selection,t=this.itemsSource;this.itemsSource=null;this.itemsSource=t;this.selection=e},Control._REFRESH_INTERVAL)}_sourceViewChanged(e,t){this.activeEditor||this.invalidate()}_transposeItemsSource(e){let t=new ObservableArray,o=getTypes(e),r=e.map((e,t)=>this._keyPrefix+t);(this.autoGenerateRows?this._getRowInfo(e):this._rowInfo).forEach((s,i)=>{let n=new Binding(s.binding);if(null==s.dataType&&e.length){let t=n.getValue(e[0]);s.dataType=null!=t?getType(t):o[i].dataType}if(this._supportsProxies()){let o=this._createProxy(e,s,r);t.push(o)}else{let o=this._createTransposedObject(e,s,this._keyPrefix);t.push(o)}});e instanceof ObservableArray&&e.collectionChanged.addHandler((e,o)=>{if(o.action===NotifyCollectionChangedAction.Change)this.activeEditor||this.invalidate();else{let e=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset);t.onCollectionChanged(e);this._rowInfoChanged()}});return t}_supportsProxies(){return null!=window.Proxy}_createProxy(e,t,o){let r={_arr:e,_rowInfo:t,_bnd:new Binding(t.binding),_keys:o};return new Proxy(r,{ownKeys:e=>e._keys,getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0,writable:!0}),get:(e,t)=>{let o=e._keys.indexOf(t);return o>-1?e._bnd.getValue(e._arr[o]):e[t]},set:(e,t,o)=>{let r=e._keys.indexOf(t);if(r>-1){let t=e._arr,s=t[r];e._bnd.setValue(s,o);if(t instanceof ObservableArray){let e=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change,s,r);t.onCollectionChanged(e)}return!0}return!1}})}_createTransposedObject(e,t,o){let r={_arr:e,_rowInfo:t},s=new Binding(t.binding);for(let t=0;t<e.length;t++){let i=e[t];Object.defineProperty(r,o+t,{enumerable:!0,get:()=>s.getValue(i),set:o=>{s.setValue(i,o);if(e instanceof ObservableArray){let o=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change,i,t);e.onCollectionChanged(o)}return!0}})}return r}_getRowInfo(e){let t=[];getTypes(e).forEach(e=>{let o=e.binding,r=e.dataType;if(r!=DataType.Object&&r!=DataType.Array){let e={binding:o,header:toHeaderCase(o),dataType:r},s=FlexGrid._defTypeWidth[r];if(null!=s){if(isString(s)){let e=Math.round(parseFloat(s));s=s.indexOf("*")<0?e:e*this.columns.defaultSize}isNumber(s)&&s>0&&(e.width=s)}t.push(e)}});return t}}export class TransposedGridRow extends Column{get height(){return this._height}set height(e){this._height=e}}export class _RowGroupHandler{constructor(e){this._grid=e}get columnGroups(){return null}createColumnGroups(e){this._createRowGroups(e)}hasColumnGroups(){return null!=this._colGroups&&this._colGroups.length>0}getGroupDefinitions(){return this._groupDefs}getColumnGroup(e,t){let o=this._grid;if(t<o.rowHeaders.columns.length&&e<o._rowInfo.length)for(let o=this._colGroups;o;){let r=o;for(let r=0;r<o.length;r++){let s=o[r],i=s._rng;if(i.containsRow(e)){if(i.containsColumn(t)||0==s.columns.length)return s;o=s.columns;break}}if(o==r)break}return null}canMoveColumnGroup(e,t,o,r){return this._grid.columns.canMoveElement(t,r)}moveColumnGroup(e,t,o,r,s){return this._grid.columns.moveElement(t,r)}_createRowGroups(e){let t=this._grid;this._groupDefs=asArray(e);t.autoGenerateRows=!1;t._rowInfo.clear();this._colGroups=[];e.forEach(e=>{this._colGroups.push(new _RowGroup(e,null))});let o=1;this._colGroups.forEach(e=>{this._addRowGroup(e);o=Math.max(o,e._getMaxLevel())});this._colGroups.forEach(e=>{e._expandRange(o)});let r=t.rowHeaders.columns;r.clear();for(let e=0;e<=o;e++){let t=new Column;r.splice(e,0,t);e<o&&(t.cssClassAll="wj-colgroup")}}_addRowGroup(e){let t=this._grid;e._grid=t;e._rng.row=t._rowInfo.length;0==e.columns.length?t._rowInfo.push(e):e.columns.forEach(e=>{this._addRowGroup(e)});e._rng.row2=t._rowInfo.length-1}}export class _RowGroup extends Column{constructor(e,t){super();this._rng=new CellRange(-1,0);this._cols=[];this._lvl=0;this._collapsed=!1;this._pGrp=t;this._lvl=0;for(let e=t;e;e=e._pGrp)this._lvl++;t&&t.columns.indexOf(this)<0&&t.columns.push(this);this._rng.col=this._rng.col2=this._lvl;this.allowDragging=!1;copy(this,e)}get columns(){return this._cols}set columns(e){let t=this._cols=[];e.forEach(e=>{let o=new _RowGroup(e,this);t.indexOf(o)<0&&t.push(o)})}get rows(){return this._cols}get isEmpty(){return 0===this._cols.length}get height(){return this._height}set height(e){this._height=e}get level(){let e=this,t=0;for(;e._pGrp;){e=e._pGrp;t++}return t}get collapseTo(){return this._collTo}set collapseTo(e){assert(isArray(e)||isString(e),"collapseTo should be an array or a string.");this._collTo=e}get isCollapsed(){return this._collapsed}set isCollapsed(e){if(e!=this._collapsed){let t=this._grid;if(t){let o=new CellRangeEventArgs(t.rowHeaders,this._rng,this);if(t.onColumnGroupCollapsedChanging(o)){this._collapsed=asBoolean(e);t.onColumnGroupCollapsedChanged(o)}}else this._collapsed=asBoolean(e)}setTimeout(()=>{this._updateCollapsedState()})}_copy(e,t){if(/rows|columns/.test(e)){let e=asArray(t);this.columns=e;return!0}return!1}_updateCollapsedState(){let e=this._grid._rowInfo,t=this._rng,o=this._collapsed;this._cols.forEach(e=>{if(e instanceof _RowGroup){e._collapsed=o;e._updateCollapsedState()}});let r=this._getCollapseToIndices();for(let s=t.topRow;s<=t.bottomRow;s++)e[s].visible=!o||r.indexOf(s)>-1}_getMaxLevel(){let e=this._lvl;this.columns.forEach(t=>{e=Math.max(e,t._getMaxLevel())});return e}_expandRange(e){let t=e-this._getMaxLevel();if(t>0){this._rng.col2+=t;this._cols.forEach(e=>{e._shiftRange(t)})}let o=this._grid._rowInfo,r=this._rng;for(let t=r.row;t<=r.row2;t++){o[t]._rng.col2=e}}_shiftRange(e){this._rng.col+=e;this._rng.col2+=e;this._cols.forEach(t=>{t._shiftRange(e)})}_getCollapseToBindings(){let e=this.collapseTo;return isString(e)?[e]:e}_getCollapseToIndices(){let e=this._grid,t=this._rng,o=this._getCollapseToBindings();if(o&&o.length){let r=[],s=e._rowInfo;for(let e=0;e<o.length;e++)switch(o[e]){case"$first":r.push(t.topRow);break;case"$last":r.push(t.bottomRow);break;default:let i=s.indexOf(o[e]);i>-1&&r.push(i)}if(r.length)return r}return[t.bottomRow]}}_registerModule("wijmo.grid.transposed",selfModule);
14
+ import{MergeManager,CellRange,FlexGrid,Row,Column,ColumnCollection,CellRangeEventArgs,AllowSorting,HeadersVisibility,AutoSizeMode}from"@mescius/wijmo.grid";import{asArray,assert,isArray,isString,isNumber,isUndefined,asBoolean,getTypes,getType,tryCast,toHeaderCase,addClass,DataType,Binding,Control,CollectionView,ObservableArray,NotifyCollectionChangedEventArgs,NotifyCollectionChangedAction,copy,_registerModule}from"@mescius/wijmo";import*as selfModule from"@mescius/wijmo.grid.transposed";export class _MergeManager extends MergeManager{getMergedRange(e,t,o,r=!0){let s=e.grid,n=s._hasColumnGroups();if(e==s.columnHeaders&&n)return null;if(e==s.rowHeaders&&n){if(t<0||t>=e.rows.length||o<0||o>=e.columns.length)return null;let r=s._getColumnGroup(t,o);if(r){let o=r._rng,s=e.rows;if(s.isFrozen(o.row)!=s.isFrozen(o.row2)){o=o.clone();s.isFrozen(t)?o.row2=s.frozen-1:o.row=s.frozen}return o}return null}return super.getMergedRange(e,t,o,r)}}export class TransposedGrid extends FlexGrid{constructor(e,t){super(e,null);this._keyPrefix="item";this._autoGenRows=!0;addClass(this.hostElement,"wj-transposed-grid");this.allowSorting=AllowSorting.None;this.headersVisibility=HeadersVisibility.Row;this._rowInfo=new ColumnCollection(this,this.columns.defaultSize);this._grpHdl=new _RowGroupHandler(this);this.mergeManager=new _MergeManager;this.initialize(t);this._rowInfo.collectionChanged.addHandler(this._rowInfoChanged,this);this.deferUpdate(()=>{let e=this.rowHeaders.columns;if(e.length){e[e.length-1].width=this.columns.defaultSize}})}get autoGenerateRows(){return this._autoGenRows}set autoGenerateRows(e){this._autoGenRows=asBoolean(e)}get rowGroups(){return this._grpHdl.getGroupDefinitions()}set rowGroups(e){this._rowInfo.deferUpdate(()=>{this.autoGenerateRows=!1;this._rowInfo.clear();this._grpHdl.createColumnGroups(asArray(e))})}refresh(e){let t=this._rowInfo;if(t._dirty){t._dirty=!1;this._rowInfoChanged()}else super.refresh(e)}get allowAddNew(){return!1}set allowAddNew(e){}get allowDelete(){return!1}set allowDelete(e){}get allowSorting(){return AllowSorting.None}set allowSorting(e){assert(e===AllowSorting.None,"TransposedGrid does not support sorting.");this._alSorting=e}get columnGroups(){return null}set columnGroups(e){throw"TransposedGrid does not support columnGroups, use rowGroups instead."}onRowEditEnded(e){let t=tryCast(this._sourceItems,"ICollectionView");if(t){let e=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change);t.collectionChanged.raise(t,e)}super.onRowEditEnded(e)}_getCollectionView(e){let t=tryCast(this._sourceItems,"ICollectionView");t&&t.collectionChanged.removeHandler(this._sourceViewChanged);t=tryCast(e,"ICollectionView");let o=e;if(isArray(e))o=this._transposeItemsSource(e);else if(t){t.collectionChanged.addHandler(this._sourceViewChanged,this);o=this._transposeItemsSource(t.items)}this.autoGenerateColumns=!0;let r=super._getCollectionView(o),s=null;t instanceof CollectionView&&(s=t.getError);s&&r instanceof CollectionView&&(this._supportsProxies()?r.getError=(e,t)=>{if(null==t)return null;let o=e._keys.indexOf(t);return s(e._arr[o],e._bnd.path)}:r.getError=(e,t)=>{if(null==t)return null;let o=parseInt(t.substr(this._keyPrefix.length));return s(e._arr[o],e._rowInfo.binding)});this._sourceItems=e;return r}_getColumnTypes(e){let t,o;if(this._sourceItems)if(isArray(this._sourceItems))o=this._sourceItems;else{let e=tryCast(this._sourceItems,"ICollectionView");e&&(o=e.items)}return t=o?o.map((e,t)=>({binding:this._keyPrefix+t,dataType:DataType.Object})):getTypes(e,0,!0)}_copy(e,t){if(/rows|columns/.test(e)){assert(isArray(t),"Array Expected.");let e=asArray(t);e.some(e=>null!=e.columns)?this.rowGroups=e:this._rowInfo.deferUpdate(()=>{this.autoGenerateRows=!1;this._rowInfo.clear();t.forEach(e=>{let t=new TransposedGridRow(e);this._rowInfo.push(t)})});return!0}return super._copy(e,t)}onLoadedRows(e){let t=this.columns;for(let e=0;e<t.length;e++){let o=t[e];o.align=null;o.dataType=0}let o=this.rowHeaders.columns;for(let e=0;e<o.length;e++){o[e].align="left";o[e].width=0}let r=FlexGrid._getSerializableProperties(Row);this.rows.forEach(e=>{let t=e.dataItem._rowInfo;if(t){this._copyProps(t,e,r,["showDropDown","width","size"]);if(this._hasColumnGroups())for(let t=0;t<o.length;t++){let o=this._grpHdl.getColumnGroup(e.index,t);o&&this._updateRowHeaders(e.index,t,o)}else o.length&&this._updateRowHeaders(e.index,o.length-1,t)}});for(let e=0;e<o.length;e++)0===o[e].width&&(o[e].width=this.columns.defaultSize);super.onLoadedRows(e)}_getBindingColumn(e,t,o){let r=o;if(e!=this.cells)return r;let s=e.rows[t],n=s&&s.dataItem&&s.dataItem._rowInfo;if(isUndefined(n))return r;r=new Column;let i=FlexGrid._getSerializableProperties(Column);this._copyProps(n,r,i);r.binding=o.binding;r.header=n.header||toHeaderCase(n.binding);return r}_isTransposed(){return!0}_autoSizeRows(){this.autoSizeMode&AutoSizeMode.Both&&this.autoSizeRows();super._autoSizeRows()}_copyProps(e,t,o,r=[]){for(let s in e)if(o.indexOf(s)>-1&&-1===r.indexOf(s)){let o=e[s];if(!isUndefined(o))try{t[s]=o}catch(e){}}}_updateRowHeaders(e,t,o){let r=o.header||toHeaderCase(o.binding);this.rowHeaders.setCellData(e,t,r);let s=this.rowHeaders.columns,n=o.width;if(isNumber(n)&&n>0){let e=o._rng;if(e&&e instanceof CellRange&&e.isValid){let t=e.columnSpan;assert(t>0,"Column span is negative or equal to 0");n/=t}s[t].width=Math.max(s[t].width,n)}}_rowInfoChanged(){this._toRowInfo&&clearTimeout(this._toRowInfo);this._toRowInfo=setTimeout(()=>{let e=this.selection,t=this.itemsSource;this.itemsSource=null;this.itemsSource=t;this.selection=e},Control._REFRESH_INTERVAL)}_sourceViewChanged(e,t){this.activeEditor||this.invalidate()}_transposeItemsSource(e){let t=new ObservableArray,o=getTypes(e,0,!0),r=e.map((e,t)=>this._keyPrefix+t);(this.autoGenerateRows?this._getRowInfo(e):this._rowInfo).forEach((s,n)=>{let i=new Binding(s.binding);if(null==s.dataType&&e.length){let t=i.getValue(e[0]);s.dataType=null!=t?getType(t):o[n].dataType}if(this._supportsProxies()){let o=this._createProxy(e,s,r);t.push(o)}else{let o=this._createTransposedObject(e,s,this._keyPrefix);t.push(o)}});e instanceof ObservableArray&&e.collectionChanged.addHandler((e,o)=>{if(o.action===NotifyCollectionChangedAction.Change)this.activeEditor||this.invalidate();else{let e=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset);t.onCollectionChanged(e);this._rowInfoChanged()}});return t}_supportsProxies(){return null!=window.Proxy}_createProxy(e,t,o){let r={_arr:e,_rowInfo:t,_bnd:new Binding(t.binding),_keys:o};return new Proxy(r,{ownKeys:e=>e._keys,getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0,writable:!0}),get:(e,t)=>{let o=e._keys.indexOf(t);return o>-1?e._bnd.getValue(e._arr[o]):e[t]},set:(e,t,o)=>{let r=e._keys.indexOf(t);if(r>-1){let t=e._arr,s=t[r];e._bnd.setValue(s,o);if(t instanceof ObservableArray){let e=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change,s,r);t.onCollectionChanged(e)}return!0}return!1}})}_createTransposedObject(e,t,o){let r={_arr:e,_rowInfo:t},s=new Binding(t.binding);for(let t=0;t<e.length;t++){let n=e[t];Object.defineProperty(r,o+t,{enumerable:!0,get:()=>s.getValue(n),set:o=>{s.setValue(n,o);if(e instanceof ObservableArray){let o=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change,n,t);e.onCollectionChanged(o)}return!0}})}return r}_getRowInfo(e){let t=[];getTypes(e,0,!0).forEach(e=>{let o=e.binding,r=e.dataType;if(r!=DataType.Object){let e={binding:o,header:toHeaderCase(o),dataType:r},s=FlexGrid._defTypeWidth[r];if(null!=s){if(isString(s)){let e=Math.round(parseFloat(s));s=s.indexOf("*")<0?e:e*this.columns.defaultSize}isNumber(s)&&s>0&&(e.width=s)}t.push(e)}});return t}getRowDataItem(e,t){let o=this.cells;if(o.rows[e].dataItem._rowInfo instanceof TransposedGridRow){let e={};for(let r=0;r<o.rows.length;r++){e[o.rows[r].dataItem._rowInfo._binding.path]=o.getCellData(r,t,!1)}return e}return super.getRowDataItem(e,t)}}export class TransposedGridRow extends Column{get height(){return this._height}set height(e){this._height=e}}export class _RowGroupHandler{constructor(e){this._grid=e}get columnGroups(){return null}createColumnGroups(e){this._createRowGroups(e)}hasColumnGroups(){return null!=this._colGroups&&this._colGroups.length>0}getGroupDefinitions(){return this._groupDefs}getColumnGroup(e,t){let o=this._grid;if(t<o.rowHeaders.columns.length&&e<o._rowInfo.length)for(let o=this._colGroups;o;){let r=o;for(let r=0;r<o.length;r++){let s=o[r],n=s._rng;if(n.containsRow(e)){if(n.containsColumn(t)||0==s.columns.length)return s;o=s.columns;break}}if(o==r)break}return null}canMoveColumnGroup(e,t,o,r){return this._grid.columns.canMoveElement(t,r)}moveColumnGroup(e,t,o,r,s){return this._grid.columns.moveElement(t,r)}_createRowGroups(e){let t=this._grid;this._groupDefs=asArray(e);t.autoGenerateRows=!1;t._rowInfo.clear();this._colGroups=[];e.forEach(e=>{this._colGroups.push(new _RowGroup(e,null))});let o=1;this._colGroups.forEach(e=>{this._addRowGroup(e);o=Math.max(o,e._getMaxLevel())});this._colGroups.forEach(e=>{e._expandRange(o)});let r=t.rowHeaders.columns;r.clear();for(let e=0;e<=o;e++){let t=new Column;r.splice(e,0,t);e<o&&(t.cssClassAll="wj-colgroup")}}_addRowGroup(e){let t=this._grid;e._grid=t;e._rng.row=t._rowInfo.length;0==e.columns.length?t._rowInfo.push(e):e.columns.forEach(e=>{this._addRowGroup(e)});e._rng.row2=t._rowInfo.length-1}}export class _RowGroup extends Column{constructor(e,t){super();this._rng=new CellRange(-1,0);this._cols=[];this._lvl=0;this._collapsed=!1;this._pGrp=t;this._lvl=0;for(let e=t;e;e=e._pGrp)this._lvl++;t&&t.columns.indexOf(this)<0&&t.columns.push(this);this._rng.col=this._rng.col2=this._lvl;this.allowDragging=!1;copy(this,e)}get columns(){return this._cols}set columns(e){let t=this._cols=[];e.forEach(e=>{let o=new _RowGroup(e,this);t.indexOf(o)<0&&t.push(o)})}get rows(){return this._cols}get isEmpty(){return 0===this._cols.length}get height(){return this._height}set height(e){this._height=e}get level(){let e=this,t=0;for(;e._pGrp;){e=e._pGrp;t++}return t}get collapseTo(){return this._collTo}set collapseTo(e){assert(isArray(e)||isString(e),"collapseTo should be an array or a string.");this._collTo=e}get isCollapsed(){return this._collapsed}set isCollapsed(e){if(e!=this._collapsed){let t=this._grid;if(t){let o=new CellRangeEventArgs(t.rowHeaders,this._rng,this);if(t.onColumnGroupCollapsedChanging(o)){this._collapsed=asBoolean(e);t.onColumnGroupCollapsedChanged(o)}}else this._collapsed=asBoolean(e)}setTimeout(()=>{this._updateCollapsedState()})}_copy(e,t){if(/rows|columns/.test(e)){let e=asArray(t);this.columns=e;return!0}return!1}_updateCollapsedState(){let e=this._grid._rowInfo,t=this._rng,o=this._collapsed;this._cols.forEach(e=>{if(e instanceof _RowGroup){e._collapsed=o;e._updateCollapsedState()}});let r=this._getCollapseToIndices();for(let s=t.topRow;s<=t.bottomRow;s++)e[s].visible=!o||r.indexOf(s)>-1}_getMaxLevel(){let e=this._lvl;this.columns.forEach(t=>{e=Math.max(e,t._getMaxLevel())});return e}_expandRange(e){let t=e-this._getMaxLevel();if(t>0){this._rng.col2+=t;this._cols.forEach(e=>{e._shiftRange(t)})}let o=this._grid._rowInfo,r=this._rng;for(let t=r.row;t<=r.row2;t++){o[t]._rng.col2=e}}_shiftRange(e){this._rng.col+=e;this._rng.col2+=e;this._cols.forEach(t=>{t._shiftRange(e)})}_getCollapseToBindings(){let e=this.collapseTo;return isString(e)?[e]:e}_getCollapseToIndices(){let e=this._grid,t=this._rng,o=this._getCollapseToBindings();if(o&&o.length){let r=[],s=e._rowInfo;for(let e=0;e<o.length;e++)switch(o[e]){case"$first":r.push(t.topRow);break;case"$last":r.push(t.bottomRow);break;default:let n=s.indexOf(o[e]);n>-1&&r.push(n)}if(r.length)return r}return[t.bottomRow]}}_registerModule("wijmo.grid.transposed",selfModule);
package/es5-esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20232.939
3
+ * Wijmo Library 5.20241.2
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 __extends=this&&this.__extends||function(){var extendStatics=function(e,o){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var r in o)o.hasOwnProperty(r)&&(e[r]=o[r])})(e,o)};return function(e,o){extendStatics(e,o);function __(){this.constructor=e}e.prototype=null===o?Object.create(o):(__.prototype=o.prototype,new __)}}();import{MergeManager,CellRange,FlexGrid,Row,Column,ColumnCollection,CellRangeEventArgs,AllowSorting,HeadersVisibility,AutoSizeMode}from"@mescius/wijmo.grid";import{asArray,assert,isArray,isString,isNumber,isUndefined,asBoolean,getTypes,getType,tryCast,toHeaderCase,addClass,DataType,Binding,Control,CollectionView,ObservableArray,NotifyCollectionChangedEventArgs,NotifyCollectionChangedAction,copy,_registerModule}from"@mescius/wijmo";import*as selfModule from"@mescius/wijmo.grid.transposed";var _MergeManager=function(e){__extends(_MergeManager,e);function _MergeManager(){return null!==e&&e.apply(this,arguments)||this}_MergeManager.prototype.getMergedRange=function(o,r,t,n){void 0===n&&(n=!0);var i=o.grid,s=i._hasColumnGroups();if(o==i.columnHeaders&&s)return null;if(o==i.rowHeaders&&s){if(r<0||r>=o.rows.length||t<0||t>=o.columns.length)return null;var a=i._getColumnGroup(r,t);if(a){var l=a._rng,u=o.rows;if(u.isFrozen(l.row)!=u.isFrozen(l.row2)){l=l.clone();u.isFrozen(r)?l.row2=u.frozen-1:l.row=u.frozen}return l}return null}return e.prototype.getMergedRange.call(this,o,r,t,n)};return _MergeManager}(MergeManager);export{_MergeManager};var TransposedGrid=function(e){__extends(TransposedGrid,e);function TransposedGrid(o,r){var t=e.call(this,o,null)||this;t._keyPrefix="item";t._autoGenRows=!0;addClass(t.hostElement,"wj-transposed-grid");t.allowSorting=AllowSorting.None;t.headersVisibility=HeadersVisibility.Row;t._rowInfo=new ColumnCollection(t,t.columns.defaultSize);t._grpHdl=new _RowGroupHandler(t);t.mergeManager=new _MergeManager;t.initialize(r);t._rowInfo.collectionChanged.addHandler(t._rowInfoChanged,t);t.deferUpdate((function(){var e=t.rowHeaders.columns;if(e.length){e[e.length-1].width=t.columns.defaultSize}}));return t}Object.defineProperty(TransposedGrid.prototype,"autoGenerateRows",{get:function(){return this._autoGenRows},set:function(e){this._autoGenRows=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"rowGroups",{get:function(){return this._grpHdl.getGroupDefinitions()},set:function(e){var o=this;this._rowInfo.deferUpdate((function(){o.autoGenerateRows=!1;o._rowInfo.clear();o._grpHdl.createColumnGroups(asArray(e))}))},enumerable:!0,configurable:!0});TransposedGrid.prototype.refresh=function(o){var r=this._rowInfo;if(r._dirty){r._dirty=!1;this._rowInfoChanged()}else e.prototype.refresh.call(this,o)};Object.defineProperty(TransposedGrid.prototype,"allowAddNew",{get:function(){return!1},set:function(e){},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"allowDelete",{get:function(){return!1},set:function(e){},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"allowSorting",{get:function(){return AllowSorting.None},set:function(e){assert(e===AllowSorting.None,"TransposedGrid does not support sorting.");this._alSorting=e},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"columnGroups",{get:function(){return null},set:function(e){throw"TransposedGrid does not support columnGroups, use rowGroups instead."},enumerable:!0,configurable:!0});TransposedGrid.prototype.onRowEditEnded=function(o){var r=tryCast(this._sourceItems,"ICollectionView");if(r){var t=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change);r.collectionChanged.raise(r,t)}e.prototype.onRowEditEnded.call(this,o)};TransposedGrid.prototype._getCollectionView=function(o){var r=this,t=tryCast(this._sourceItems,"ICollectionView");t&&t.collectionChanged.removeHandler(this._sourceViewChanged);t=tryCast(o,"ICollectionView");var n=o;if(isArray(o))n=this._transposeItemsSource(o);else if(t){t.collectionChanged.addHandler(this._sourceViewChanged,this);n=this._transposeItemsSource(t.items)}this.autoGenerateColumns=!0;var i=e.prototype._getCollectionView.call(this,n),s=null;t instanceof CollectionView&&(s=t.getError);s&&i instanceof CollectionView&&(this._supportsProxies()?i.getError=function(e,o){if(null==o)return null;var r=e._keys.indexOf(o);return s(e._arr[r],e._bnd.path)}:i.getError=function(e,o){if(null==o)return null;var t=parseInt(o.substr(r._keyPrefix.length));return s(e._arr[t],e._rowInfo.binding)});this._sourceItems=o;return i};TransposedGrid.prototype._getColumnTypes=function(e){var o,r=this;if(this._sourceItems)if(isArray(this._sourceItems))o=this._sourceItems;else{var t=tryCast(this._sourceItems,"ICollectionView");t&&(o=t.items)}return o?o.map((function(e,o){return{binding:r._keyPrefix+o,dataType:DataType.Object}})):getTypes(e)};TransposedGrid.prototype._copy=function(o,r){var t=this;if(/rows|columns/.test(o)){assert(isArray(r),"Array Expected.");var n=asArray(r);n.some((function(e){return null!=e.columns}))?this.rowGroups=n:this._rowInfo.deferUpdate((function(){t.autoGenerateRows=!1;t._rowInfo.clear();r.forEach((function(e){var o=new TransposedGridRow(e);t._rowInfo.push(o)}))}));return!0}return e.prototype._copy.call(this,o,r)};TransposedGrid.prototype.onLoadedRows=function(o){for(var r=this,t=this.columns,n=0;n<t.length;n++){var i=t[n];i.align=null;i.dataType=0}var s=this.rowHeaders.columns;for(n=0;n<s.length;n++){s[n].align="left";s[n].width=0}var a=FlexGrid._getSerializableProperties(Row);this.rows.forEach((function(e){var o=e.dataItem._rowInfo;if(o){r._copyProps(o,e,a,["showDropDown","width","size"]);if(r._hasColumnGroups())for(var t=0;t<s.length;t++){var n=r._grpHdl.getColumnGroup(e.index,t);n&&r._updateRowHeaders(e.index,t,n)}else s.length&&r._updateRowHeaders(e.index,s.length-1,o)}}));for(n=0;n<s.length;n++)0===s[n].width&&(s[n].width=this.columns.defaultSize);e.prototype.onLoadedRows.call(this,o)};TransposedGrid.prototype._getBindingColumn=function(e,o,r){var t=r;if(e!=this.cells)return t;var n=e.rows[o],i=n&&n.dataItem&&n.dataItem._rowInfo;if(isUndefined(i))return t;t=new Column;var s=FlexGrid._getSerializableProperties(Column);this._copyProps(i,t,s);t.binding=r.binding;t.header=i.header||toHeaderCase(i.binding);return t};TransposedGrid.prototype._isTransposed=function(){return!0};TransposedGrid.prototype._autoSizeRows=function(){this.autoSizeMode&AutoSizeMode.Both&&this.autoSizeRows();e.prototype._autoSizeRows.call(this)};TransposedGrid.prototype._copyProps=function(e,o,r,t){void 0===t&&(t=[]);for(var n in e)if(r.indexOf(n)>-1&&-1===t.indexOf(n)){var i=e[n];if(!isUndefined(i))try{o[n]=i}catch(e){}}};TransposedGrid.prototype._updateRowHeaders=function(e,o,r){var t=r.header||toHeaderCase(r.binding);this.rowHeaders.setCellData(e,o,t);var n=this.rowHeaders.columns,i=r.width;if(isNumber(i)&&i>0){var s=r._rng;if(s&&s instanceof CellRange&&s.isValid){var a=s.columnSpan;assert(a>0,"Column span is negative or equal to 0");i/=a}n[o].width=Math.max(n[o].width,i)}};TransposedGrid.prototype._rowInfoChanged=function(){var e=this;this._toRowInfo&&clearTimeout(this._toRowInfo);this._toRowInfo=setTimeout((function(){var o=e.selection,r=e.itemsSource;e.itemsSource=null;e.itemsSource=r;e.selection=o}),Control._REFRESH_INTERVAL)};TransposedGrid.prototype._sourceViewChanged=function(e,o){this.activeEditor||this.invalidate()};TransposedGrid.prototype._transposeItemsSource=function(e){var o=this,r=new ObservableArray,t=getTypes(e),n=e.map((function(e,r){return o._keyPrefix+r}));(this.autoGenerateRows?this._getRowInfo(e):this._rowInfo).forEach((function(i,s){var a=new Binding(i.binding);if(null==i.dataType&&e.length){var l=a.getValue(e[0]);i.dataType=null!=l?getType(l):t[s].dataType}if(o._supportsProxies()){var u=o._createProxy(e,i,n);r.push(u)}else{var p=o._createTransposedObject(e,i,o._keyPrefix);r.push(p)}}));e instanceof ObservableArray&&e.collectionChanged.addHandler((function(e,t){if(t.action===NotifyCollectionChangedAction.Change)o.activeEditor||o.invalidate();else{var n=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset);r.onCollectionChanged(n);o._rowInfoChanged()}}));return r};TransposedGrid.prototype._supportsProxies=function(){return null!=window.Proxy};TransposedGrid.prototype._createProxy=function(e,o,r){var t={_arr:e,_rowInfo:o,_bnd:new Binding(o.binding),_keys:r};return new Proxy(t,{ownKeys:function(e){return e._keys},getOwnPropertyDescriptor:function(){return{enumerable:!0,configurable:!0,writable:!0}},get:function(e,o){var r=e._keys.indexOf(o);return r>-1?e._bnd.getValue(e._arr[r]):e[o]},set:function(e,o,r){var t=e._keys.indexOf(o);if(t>-1){var n=e._arr,i=n[t];e._bnd.setValue(i,r);if(n instanceof ObservableArray){var s=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change,i,t);n.onCollectionChanged(s)}return!0}return!1}})};TransposedGrid.prototype._createTransposedObject=function(e,o,r){for(var t={_arr:e,_rowInfo:o},n=new Binding(o.binding),_loop_1=function(o){var i=e[o];Object.defineProperty(t,r+o,{enumerable:!0,get:function(){return n.getValue(i)},set:function(r){n.setValue(i,r);if(e instanceof ObservableArray){var t=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change,i,o);e.onCollectionChanged(t)}return!0}})},i=0;i<e.length;i++)_loop_1(i);return t};TransposedGrid.prototype._getRowInfo=function(e){var o=this,r=[];getTypes(e).forEach((function(e){var t=e.binding,n=e.dataType;if(n!=DataType.Object&&n!=DataType.Array){var i={binding:t,header:toHeaderCase(t),dataType:n},s=FlexGrid._defTypeWidth[n];if(null!=s){if(isString(s)){var a=Math.round(parseFloat(s));s=s.indexOf("*")<0?a:a*o.columns.defaultSize}isNumber(s)&&s>0&&(i.width=s)}r.push(i)}}));return r};return TransposedGrid}(FlexGrid);export{TransposedGrid};var TransposedGridRow=function(e){__extends(TransposedGridRow,e);function TransposedGridRow(){return null!==e&&e.apply(this,arguments)||this}Object.defineProperty(TransposedGridRow.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!0,configurable:!0});return TransposedGridRow}(Column);export{TransposedGridRow};var _RowGroupHandler=function(){function _RowGroupHandler(e){this._grid=e}Object.defineProperty(_RowGroupHandler.prototype,"columnGroups",{get:function(){return null},enumerable:!0,configurable:!0});_RowGroupHandler.prototype.createColumnGroups=function(e){this._createRowGroups(e)};_RowGroupHandler.prototype.hasColumnGroups=function(){return null!=this._colGroups&&this._colGroups.length>0};_RowGroupHandler.prototype.getGroupDefinitions=function(){return this._groupDefs};_RowGroupHandler.prototype.getColumnGroup=function(e,o){var r=this._grid;if(o<r.rowHeaders.columns.length&&e<r._rowInfo.length)for(var t=this._colGroups;t;){for(var n=t,i=0;i<t.length;i++){var s=t[i],a=s._rng;if(a.containsRow(e)){if(a.containsColumn(o)||0==s.columns.length)return s;t=s.columns;break}}if(t==n)break}return null};_RowGroupHandler.prototype.canMoveColumnGroup=function(e,o,r,t){return this._grid.columns.canMoveElement(o,t)};_RowGroupHandler.prototype.moveColumnGroup=function(e,o,r,t,n){return this._grid.columns.moveElement(o,t)};_RowGroupHandler.prototype._createRowGroups=function(e){var o=this,r=this._grid;this._groupDefs=asArray(e);r.autoGenerateRows=!1;r._rowInfo.clear();this._colGroups=[];e.forEach((function(e){o._colGroups.push(new _RowGroup(e,null))}));var t=1;this._colGroups.forEach((function(e){o._addRowGroup(e);t=Math.max(t,e._getMaxLevel())}));this._colGroups.forEach((function(e){e._expandRange(t)}));var n=r.rowHeaders.columns;n.clear();for(var i=0;i<=t;i++){var s=new Column;n.splice(i,0,s);i<t&&(s.cssClassAll="wj-colgroup")}};_RowGroupHandler.prototype._addRowGroup=function(e){var o=this,r=this._grid;e._grid=r;e._rng.row=r._rowInfo.length;0==e.columns.length?r._rowInfo.push(e):e.columns.forEach((function(e){o._addRowGroup(e)}));e._rng.row2=r._rowInfo.length-1};return _RowGroupHandler}();export{_RowGroupHandler};var _RowGroup=function(e){__extends(_RowGroup,e);function _RowGroup(o,r){var t=e.call(this)||this;t._rng=new CellRange(-1,0);t._cols=[];t._lvl=0;t._collapsed=!1;t._pGrp=r;t._lvl=0;for(var n=r;n;n=n._pGrp)t._lvl++;r&&r.columns.indexOf(t)<0&&r.columns.push(t);t._rng.col=t._rng.col2=t._lvl;t.allowDragging=!1;copy(t,o);return t}Object.defineProperty(_RowGroup.prototype,"columns",{get:function(){return this._cols},set:function(e){var o=this,r=this._cols=[];e.forEach((function(e){var t=new _RowGroup(e,o);r.indexOf(t)<0&&r.push(t)}))},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"rows",{get:function(){return this._cols},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"isEmpty",{get:function(){return 0===this._cols.length},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"level",{get:function(){for(var e=this,o=0;e._pGrp;){e=e._pGrp;o++}return o},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"collapseTo",{get:function(){return this._collTo},set:function(e){assert(isArray(e)||isString(e),"collapseTo should be an array or a string.");this._collTo=e},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"isCollapsed",{get:function(){return this._collapsed},set:function(e){var o=this;if(e!=this._collapsed){var r=this._grid;if(r){var t=new CellRangeEventArgs(r.rowHeaders,this._rng,this);if(r.onColumnGroupCollapsedChanging(t)){this._collapsed=asBoolean(e);r.onColumnGroupCollapsedChanged(t)}}else this._collapsed=asBoolean(e)}setTimeout((function(){o._updateCollapsedState()}))},enumerable:!0,configurable:!0});_RowGroup.prototype._copy=function(e,o){if(/rows|columns/.test(e)){var r=asArray(o);this.columns=r;return!0}return!1};_RowGroup.prototype._updateCollapsedState=function(){var e=this._grid._rowInfo,o=this._rng,r=this._collapsed;this._cols.forEach((function(e){if(e instanceof _RowGroup){e._collapsed=r;e._updateCollapsedState()}}));for(var t=this._getCollapseToIndices(),n=o.topRow;n<=o.bottomRow;n++)e[n].visible=!r||t.indexOf(n)>-1};_RowGroup.prototype._getMaxLevel=function(){var e=this._lvl;this.columns.forEach((function(o){e=Math.max(e,o._getMaxLevel())}));return e};_RowGroup.prototype._expandRange=function(e){var o=e-this._getMaxLevel();if(o>0){this._rng.col2+=o;this._cols.forEach((function(e){e._shiftRange(o)}))}for(var r=this._grid._rowInfo,t=this._rng,n=t.row;n<=t.row2;n++){r[n]._rng.col2=e}};_RowGroup.prototype._shiftRange=function(e){this._rng.col+=e;this._rng.col2+=e;this._cols.forEach((function(o){o._shiftRange(e)}))};_RowGroup.prototype._getCollapseToBindings=function(){var e=this.collapseTo;return isString(e)?[e]:e};_RowGroup.prototype._getCollapseToIndices=function(){var e=this._grid,o=this._rng,r=this._getCollapseToBindings();if(r&&r.length){for(var t=[],n=e._rowInfo,i=0;i<r.length;i++)switch(r[i]){case"$first":t.push(o.topRow);break;case"$last":t.push(o.bottomRow);break;default:var s=n.indexOf(r[i]);s>-1&&t.push(s)}if(t.length)return t}return[o.bottomRow]};return _RowGroup}(Column);export{_RowGroup};_registerModule("wijmo.grid.transposed",selfModule);
14
+ var __extends=this&&this.__extends||function(){var extendStatics=function(e,o){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var r in o)o.hasOwnProperty(r)&&(e[r]=o[r])})(e,o)};return function(e,o){extendStatics(e,o);function __(){this.constructor=e}e.prototype=null===o?Object.create(o):(__.prototype=o.prototype,new __)}}();import{MergeManager,CellRange,FlexGrid,Row,Column,ColumnCollection,CellRangeEventArgs,AllowSorting,HeadersVisibility,AutoSizeMode}from"@mescius/wijmo.grid";import{asArray,assert,isArray,isString,isNumber,isUndefined,asBoolean,getTypes,getType,tryCast,toHeaderCase,addClass,DataType,Binding,Control,CollectionView,ObservableArray,NotifyCollectionChangedEventArgs,NotifyCollectionChangedAction,copy,_registerModule}from"@mescius/wijmo";import*as selfModule from"@mescius/wijmo.grid.transposed";var _MergeManager=function(e){__extends(_MergeManager,e);function _MergeManager(){return null!==e&&e.apply(this,arguments)||this}_MergeManager.prototype.getMergedRange=function(o,r,t,n){void 0===n&&(n=!0);var i=o.grid,s=i._hasColumnGroups();if(o==i.columnHeaders&&s)return null;if(o==i.rowHeaders&&s){if(r<0||r>=o.rows.length||t<0||t>=o.columns.length)return null;var a=i._getColumnGroup(r,t);if(a){var l=a._rng,u=o.rows;if(u.isFrozen(l.row)!=u.isFrozen(l.row2)){l=l.clone();u.isFrozen(r)?l.row2=u.frozen-1:l.row=u.frozen}return l}return null}return e.prototype.getMergedRange.call(this,o,r,t,n)};return _MergeManager}(MergeManager);export{_MergeManager};var TransposedGrid=function(e){__extends(TransposedGrid,e);function TransposedGrid(o,r){var t=e.call(this,o,null)||this;t._keyPrefix="item";t._autoGenRows=!0;addClass(t.hostElement,"wj-transposed-grid");t.allowSorting=AllowSorting.None;t.headersVisibility=HeadersVisibility.Row;t._rowInfo=new ColumnCollection(t,t.columns.defaultSize);t._grpHdl=new _RowGroupHandler(t);t.mergeManager=new _MergeManager;t.initialize(r);t._rowInfo.collectionChanged.addHandler(t._rowInfoChanged,t);t.deferUpdate((function(){var e=t.rowHeaders.columns;if(e.length){e[e.length-1].width=t.columns.defaultSize}}));return t}Object.defineProperty(TransposedGrid.prototype,"autoGenerateRows",{get:function(){return this._autoGenRows},set:function(e){this._autoGenRows=asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"rowGroups",{get:function(){return this._grpHdl.getGroupDefinitions()},set:function(e){var o=this;this._rowInfo.deferUpdate((function(){o.autoGenerateRows=!1;o._rowInfo.clear();o._grpHdl.createColumnGroups(asArray(e))}))},enumerable:!0,configurable:!0});TransposedGrid.prototype.refresh=function(o){var r=this._rowInfo;if(r._dirty){r._dirty=!1;this._rowInfoChanged()}else e.prototype.refresh.call(this,o)};Object.defineProperty(TransposedGrid.prototype,"allowAddNew",{get:function(){return!1},set:function(e){},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"allowDelete",{get:function(){return!1},set:function(e){},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"allowSorting",{get:function(){return AllowSorting.None},set:function(e){assert(e===AllowSorting.None,"TransposedGrid does not support sorting.");this._alSorting=e},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"columnGroups",{get:function(){return null},set:function(e){throw"TransposedGrid does not support columnGroups, use rowGroups instead."},enumerable:!0,configurable:!0});TransposedGrid.prototype.onRowEditEnded=function(o){var r=tryCast(this._sourceItems,"ICollectionView");if(r){var t=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change);r.collectionChanged.raise(r,t)}e.prototype.onRowEditEnded.call(this,o)};TransposedGrid.prototype._getCollectionView=function(o){var r=this,t=tryCast(this._sourceItems,"ICollectionView");t&&t.collectionChanged.removeHandler(this._sourceViewChanged);t=tryCast(o,"ICollectionView");var n=o;if(isArray(o))n=this._transposeItemsSource(o);else if(t){t.collectionChanged.addHandler(this._sourceViewChanged,this);n=this._transposeItemsSource(t.items)}this.autoGenerateColumns=!0;var i=e.prototype._getCollectionView.call(this,n),s=null;t instanceof CollectionView&&(s=t.getError);s&&i instanceof CollectionView&&(this._supportsProxies()?i.getError=function(e,o){if(null==o)return null;var r=e._keys.indexOf(o);return s(e._arr[r],e._bnd.path)}:i.getError=function(e,o){if(null==o)return null;var t=parseInt(o.substr(r._keyPrefix.length));return s(e._arr[t],e._rowInfo.binding)});this._sourceItems=o;return i};TransposedGrid.prototype._getColumnTypes=function(e){var o,r=this;if(this._sourceItems)if(isArray(this._sourceItems))o=this._sourceItems;else{var t=tryCast(this._sourceItems,"ICollectionView");t&&(o=t.items)}return o?o.map((function(e,o){return{binding:r._keyPrefix+o,dataType:DataType.Object}})):getTypes(e,0,!0)};TransposedGrid.prototype._copy=function(o,r){var t=this;if(/rows|columns/.test(o)){assert(isArray(r),"Array Expected.");var n=asArray(r);n.some((function(e){return null!=e.columns}))?this.rowGroups=n:this._rowInfo.deferUpdate((function(){t.autoGenerateRows=!1;t._rowInfo.clear();r.forEach((function(e){var o=new TransposedGridRow(e);t._rowInfo.push(o)}))}));return!0}return e.prototype._copy.call(this,o,r)};TransposedGrid.prototype.onLoadedRows=function(o){for(var r=this,t=this.columns,n=0;n<t.length;n++){var i=t[n];i.align=null;i.dataType=0}var s=this.rowHeaders.columns;for(n=0;n<s.length;n++){s[n].align="left";s[n].width=0}var a=FlexGrid._getSerializableProperties(Row);this.rows.forEach((function(e){var o=e.dataItem._rowInfo;if(o){r._copyProps(o,e,a,["showDropDown","width","size"]);if(r._hasColumnGroups())for(var t=0;t<s.length;t++){var n=r._grpHdl.getColumnGroup(e.index,t);n&&r._updateRowHeaders(e.index,t,n)}else s.length&&r._updateRowHeaders(e.index,s.length-1,o)}}));for(n=0;n<s.length;n++)0===s[n].width&&(s[n].width=this.columns.defaultSize);e.prototype.onLoadedRows.call(this,o)};TransposedGrid.prototype._getBindingColumn=function(e,o,r){var t=r;if(e!=this.cells)return t;var n=e.rows[o],i=n&&n.dataItem&&n.dataItem._rowInfo;if(isUndefined(i))return t;t=new Column;var s=FlexGrid._getSerializableProperties(Column);this._copyProps(i,t,s);t.binding=r.binding;t.header=i.header||toHeaderCase(i.binding);return t};TransposedGrid.prototype._isTransposed=function(){return!0};TransposedGrid.prototype._autoSizeRows=function(){this.autoSizeMode&AutoSizeMode.Both&&this.autoSizeRows();e.prototype._autoSizeRows.call(this)};TransposedGrid.prototype._copyProps=function(e,o,r,t){void 0===t&&(t=[]);for(var n in e)if(r.indexOf(n)>-1&&-1===t.indexOf(n)){var i=e[n];if(!isUndefined(i))try{o[n]=i}catch(e){}}};TransposedGrid.prototype._updateRowHeaders=function(e,o,r){var t=r.header||toHeaderCase(r.binding);this.rowHeaders.setCellData(e,o,t);var n=this.rowHeaders.columns,i=r.width;if(isNumber(i)&&i>0){var s=r._rng;if(s&&s instanceof CellRange&&s.isValid){var a=s.columnSpan;assert(a>0,"Column span is negative or equal to 0");i/=a}n[o].width=Math.max(n[o].width,i)}};TransposedGrid.prototype._rowInfoChanged=function(){var e=this;this._toRowInfo&&clearTimeout(this._toRowInfo);this._toRowInfo=setTimeout((function(){var o=e.selection,r=e.itemsSource;e.itemsSource=null;e.itemsSource=r;e.selection=o}),Control._REFRESH_INTERVAL)};TransposedGrid.prototype._sourceViewChanged=function(e,o){this.activeEditor||this.invalidate()};TransposedGrid.prototype._transposeItemsSource=function(e){var o=this,r=new ObservableArray,t=getTypes(e,0,!0),n=e.map((function(e,r){return o._keyPrefix+r}));(this.autoGenerateRows?this._getRowInfo(e):this._rowInfo).forEach((function(i,s){var a=new Binding(i.binding);if(null==i.dataType&&e.length){var l=a.getValue(e[0]);i.dataType=null!=l?getType(l):t[s].dataType}if(o._supportsProxies()){var u=o._createProxy(e,i,n);r.push(u)}else{var p=o._createTransposedObject(e,i,o._keyPrefix);r.push(p)}}));e instanceof ObservableArray&&e.collectionChanged.addHandler((function(e,t){if(t.action===NotifyCollectionChangedAction.Change)o.activeEditor||o.invalidate();else{var n=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset);r.onCollectionChanged(n);o._rowInfoChanged()}}));return r};TransposedGrid.prototype._supportsProxies=function(){return null!=window.Proxy};TransposedGrid.prototype._createProxy=function(e,o,r){var t={_arr:e,_rowInfo:o,_bnd:new Binding(o.binding),_keys:r};return new Proxy(t,{ownKeys:function(e){return e._keys},getOwnPropertyDescriptor:function(){return{enumerable:!0,configurable:!0,writable:!0}},get:function(e,o){var r=e._keys.indexOf(o);return r>-1?e._bnd.getValue(e._arr[r]):e[o]},set:function(e,o,r){var t=e._keys.indexOf(o);if(t>-1){var n=e._arr,i=n[t];e._bnd.setValue(i,r);if(n instanceof ObservableArray){var s=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change,i,t);n.onCollectionChanged(s)}return!0}return!1}})};TransposedGrid.prototype._createTransposedObject=function(e,o,r){for(var t={_arr:e,_rowInfo:o},n=new Binding(o.binding),_loop_1=function(o){var i=e[o];Object.defineProperty(t,r+o,{enumerable:!0,get:function(){return n.getValue(i)},set:function(r){n.setValue(i,r);if(e instanceof ObservableArray){var t=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Change,i,o);e.onCollectionChanged(t)}return!0}})},i=0;i<e.length;i++)_loop_1(i);return t};TransposedGrid.prototype._getRowInfo=function(e){var o=this,r=[];getTypes(e,0,!0).forEach((function(e){var t=e.binding,n=e.dataType;if(n!=DataType.Object){var i={binding:t,header:toHeaderCase(t),dataType:n},s=FlexGrid._defTypeWidth[n];if(null!=s){if(isString(s)){var a=Math.round(parseFloat(s));s=s.indexOf("*")<0?a:a*o.columns.defaultSize}isNumber(s)&&s>0&&(i.width=s)}r.push(i)}}));return r};TransposedGrid.prototype.getRowDataItem=function(o,r){var t=this.cells;if(t.rows[o].dataItem._rowInfo instanceof TransposedGridRow){for(var n={},i=0;i<t.rows.length;i++){n[t.rows[i].dataItem._rowInfo._binding.path]=t.getCellData(i,r,!1)}return n}return e.prototype.getRowDataItem.call(this,o,r)};return TransposedGrid}(FlexGrid);export{TransposedGrid};var TransposedGridRow=function(e){__extends(TransposedGridRow,e);function TransposedGridRow(){return null!==e&&e.apply(this,arguments)||this}Object.defineProperty(TransposedGridRow.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!0,configurable:!0});return TransposedGridRow}(Column);export{TransposedGridRow};var _RowGroupHandler=function(){function _RowGroupHandler(e){this._grid=e}Object.defineProperty(_RowGroupHandler.prototype,"columnGroups",{get:function(){return null},enumerable:!0,configurable:!0});_RowGroupHandler.prototype.createColumnGroups=function(e){this._createRowGroups(e)};_RowGroupHandler.prototype.hasColumnGroups=function(){return null!=this._colGroups&&this._colGroups.length>0};_RowGroupHandler.prototype.getGroupDefinitions=function(){return this._groupDefs};_RowGroupHandler.prototype.getColumnGroup=function(e,o){var r=this._grid;if(o<r.rowHeaders.columns.length&&e<r._rowInfo.length)for(var t=this._colGroups;t;){for(var n=t,i=0;i<t.length;i++){var s=t[i],a=s._rng;if(a.containsRow(e)){if(a.containsColumn(o)||0==s.columns.length)return s;t=s.columns;break}}if(t==n)break}return null};_RowGroupHandler.prototype.canMoveColumnGroup=function(e,o,r,t){return this._grid.columns.canMoveElement(o,t)};_RowGroupHandler.prototype.moveColumnGroup=function(e,o,r,t,n){return this._grid.columns.moveElement(o,t)};_RowGroupHandler.prototype._createRowGroups=function(e){var o=this,r=this._grid;this._groupDefs=asArray(e);r.autoGenerateRows=!1;r._rowInfo.clear();this._colGroups=[];e.forEach((function(e){o._colGroups.push(new _RowGroup(e,null))}));var t=1;this._colGroups.forEach((function(e){o._addRowGroup(e);t=Math.max(t,e._getMaxLevel())}));this._colGroups.forEach((function(e){e._expandRange(t)}));var n=r.rowHeaders.columns;n.clear();for(var i=0;i<=t;i++){var s=new Column;n.splice(i,0,s);i<t&&(s.cssClassAll="wj-colgroup")}};_RowGroupHandler.prototype._addRowGroup=function(e){var o=this,r=this._grid;e._grid=r;e._rng.row=r._rowInfo.length;0==e.columns.length?r._rowInfo.push(e):e.columns.forEach((function(e){o._addRowGroup(e)}));e._rng.row2=r._rowInfo.length-1};return _RowGroupHandler}();export{_RowGroupHandler};var _RowGroup=function(e){__extends(_RowGroup,e);function _RowGroup(o,r){var t=e.call(this)||this;t._rng=new CellRange(-1,0);t._cols=[];t._lvl=0;t._collapsed=!1;t._pGrp=r;t._lvl=0;for(var n=r;n;n=n._pGrp)t._lvl++;r&&r.columns.indexOf(t)<0&&r.columns.push(t);t._rng.col=t._rng.col2=t._lvl;t.allowDragging=!1;copy(t,o);return t}Object.defineProperty(_RowGroup.prototype,"columns",{get:function(){return this._cols},set:function(e){var o=this,r=this._cols=[];e.forEach((function(e){var t=new _RowGroup(e,o);r.indexOf(t)<0&&r.push(t)}))},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"rows",{get:function(){return this._cols},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"isEmpty",{get:function(){return 0===this._cols.length},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"level",{get:function(){for(var e=this,o=0;e._pGrp;){e=e._pGrp;o++}return o},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"collapseTo",{get:function(){return this._collTo},set:function(e){assert(isArray(e)||isString(e),"collapseTo should be an array or a string.");this._collTo=e},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"isCollapsed",{get:function(){return this._collapsed},set:function(e){var o=this;if(e!=this._collapsed){var r=this._grid;if(r){var t=new CellRangeEventArgs(r.rowHeaders,this._rng,this);if(r.onColumnGroupCollapsedChanging(t)){this._collapsed=asBoolean(e);r.onColumnGroupCollapsedChanged(t)}}else this._collapsed=asBoolean(e)}setTimeout((function(){o._updateCollapsedState()}))},enumerable:!0,configurable:!0});_RowGroup.prototype._copy=function(e,o){if(/rows|columns/.test(e)){var r=asArray(o);this.columns=r;return!0}return!1};_RowGroup.prototype._updateCollapsedState=function(){var e=this._grid._rowInfo,o=this._rng,r=this._collapsed;this._cols.forEach((function(e){if(e instanceof _RowGroup){e._collapsed=r;e._updateCollapsedState()}}));for(var t=this._getCollapseToIndices(),n=o.topRow;n<=o.bottomRow;n++)e[n].visible=!r||t.indexOf(n)>-1};_RowGroup.prototype._getMaxLevel=function(){var e=this._lvl;this.columns.forEach((function(o){e=Math.max(e,o._getMaxLevel())}));return e};_RowGroup.prototype._expandRange=function(e){var o=e-this._getMaxLevel();if(o>0){this._rng.col2+=o;this._cols.forEach((function(e){e._shiftRange(o)}))}for(var r=this._grid._rowInfo,t=this._rng,n=t.row;n<=t.row2;n++){r[n]._rng.col2=e}};_RowGroup.prototype._shiftRange=function(e){this._rng.col+=e;this._rng.col2+=e;this._cols.forEach((function(o){o._shiftRange(e)}))};_RowGroup.prototype._getCollapseToBindings=function(){var e=this.collapseTo;return isString(e)?[e]:e};_RowGroup.prototype._getCollapseToIndices=function(){var e=this._grid,o=this._rng,r=this._getCollapseToBindings();if(r&&r.length){for(var t=[],n=e._rowInfo,i=0;i<r.length;i++)switch(r[i]){case"$first":t.push(o.topRow);break;case"$last":t.push(o.bottomRow);break;default:var s=n.indexOf(r[i]);s>-1&&t.push(s)}if(t.length)return t}return[o.bottomRow]};return _RowGroup}(Column);export{_RowGroup};_registerModule("wijmo.grid.transposed",selfModule);
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20232.939
3
+ * Wijmo Library 5.20241.2
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
@@ -24,8 +24,8 @@
24
24
  *
25
25
  */
26
26
  export declare var ___keepComment: any;
27
- import { MergeManager, GridPanel, CellRange, FlexGrid, Column, ColumnCollection, CellRangeEventArgs, AllowSorting, _IColumnGroupHandler, _ColumnGroupProperties, ColumnGroupCollection } from '@grapecity/wijmo.grid';
28
- import { EventArgs, ICollectionView, IBindingInfo, ObservableArray, NotifyCollectionChangedEventArgs } from '@grapecity/wijmo';
27
+ import { MergeManager, GridPanel, CellRange, FlexGrid, Column, ColumnCollection, CellRangeEventArgs, AllowSorting, _IColumnGroupHandler, _ColumnGroupProperties, ColumnGroupCollection } from '@mescius/wijmo.grid';
28
+ import { EventArgs, ICollectionView, IBindingInfo, ObservableArray, NotifyCollectionChangedEventArgs } from '@mescius/wijmo';
29
29
  /**
30
30
  * Provides custom merging for {@link TransposedGrid} controls.
31
31
  */
@@ -69,7 +69,7 @@ export declare class _MergeManager extends MergeManager {
69
69
  * {@link Column.editor}, {@link FlexGridFilter},
70
70
  * {@link Selector}.
71
71
  */
72
- export declare class TransposedGrid extends FlexGrid {
72
+ export declare class TransposedGrid<T = any> extends FlexGrid {
73
73
  protected _sourceItems: any;
74
74
  protected _keyPrefix: string;
75
75
  protected _autoGenRows: boolean;
@@ -144,7 +144,7 @@ export declare class TransposedGrid extends FlexGrid {
144
144
  */
145
145
  columnGroups: any[];
146
146
  onRowEditEnded(e: CellRangeEventArgs): void;
147
- protected _getCollectionView(value: any): ICollectionView;
147
+ protected _getCollectionView(value: any): ICollectionView<T>;
148
148
  _getColumnTypes(arr: any[]): IBindingInfo[];
149
149
  _copy(key: string, value: any): boolean;
150
150
  onLoadedRows(e?: EventArgs): void;
@@ -163,6 +163,7 @@ export declare class TransposedGrid extends FlexGrid {
163
163
  _rowInfo: any;
164
164
  };
165
165
  _getRowInfo(arr: any[]): any[];
166
+ getRowDataItem(r: number, c: number): any;
166
167
  }
167
168
  /**
168
169
  * This class is for internal use only.
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20232.939
3
+ * Wijmo Library 5.20241.2
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 __extends=this&&this.__extends||function(){var extendStatics=function(o,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,e){o.__proto__=e}||function(o,e){for(var r in e)e.hasOwnProperty(r)&&(o[r]=e[r])})(o,e)};return function(o,e){extendStatics(o,e);function __(){this.constructor=o}o.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}(),__importStar=this&&this.__importStar||function(o){if(o&&o.__esModule)return o;var e={};if(null!=o)for(var r in o)Object.hasOwnProperty.call(o,r)&&(e[r]=o[r]);e.default=o;return e};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_grid_1=require("@mescius/wijmo.grid"),wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.grid.transposed")),_MergeManager=function(o){__extends(_MergeManager,o);function _MergeManager(){return null!==o&&o.apply(this,arguments)||this}_MergeManager.prototype.getMergedRange=function(e,r,t,n){void 0===n&&(n=!0);var i=e.grid,s=i._hasColumnGroups();if(e==i.columnHeaders&&s)return null;if(e==i.rowHeaders&&s){if(r<0||r>=e.rows.length||t<0||t>=e.columns.length)return null;var a=i._getColumnGroup(r,t);if(a){var u=a._rng,l=e.rows;if(l.isFrozen(u.row)!=l.isFrozen(u.row2)){u=u.clone();l.isFrozen(r)?u.row2=l.frozen-1:u.row=l.frozen}return u}return null}return o.prototype.getMergedRange.call(this,e,r,t,n)};return _MergeManager}(wijmo_grid_1.MergeManager);exports._MergeManager=_MergeManager;var TransposedGrid=function(o){__extends(TransposedGrid,o);function TransposedGrid(e,r){var t=o.call(this,e,null)||this;t._keyPrefix="item";t._autoGenRows=!0;wijmo_1.addClass(t.hostElement,"wj-transposed-grid");t.allowSorting=wijmo_grid_1.AllowSorting.None;t.headersVisibility=wijmo_grid_1.HeadersVisibility.Row;t._rowInfo=new wijmo_grid_1.ColumnCollection(t,t.columns.defaultSize);t._grpHdl=new _RowGroupHandler(t);t.mergeManager=new _MergeManager;t.initialize(r);t._rowInfo.collectionChanged.addHandler(t._rowInfoChanged,t);t.deferUpdate((function(){var o=t.rowHeaders.columns;if(o.length){o[o.length-1].width=t.columns.defaultSize}}));return t}Object.defineProperty(TransposedGrid.prototype,"autoGenerateRows",{get:function(){return this._autoGenRows},set:function(o){this._autoGenRows=wijmo_1.asBoolean(o)},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"rowGroups",{get:function(){return this._grpHdl.getGroupDefinitions()},set:function(o){var e=this;this._rowInfo.deferUpdate((function(){e.autoGenerateRows=!1;e._rowInfo.clear();e._grpHdl.createColumnGroups(wijmo_1.asArray(o))}))},enumerable:!0,configurable:!0});TransposedGrid.prototype.refresh=function(e){var r=this._rowInfo;if(r._dirty){r._dirty=!1;this._rowInfoChanged()}else o.prototype.refresh.call(this,e)};Object.defineProperty(TransposedGrid.prototype,"allowAddNew",{get:function(){return!1},set:function(o){},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"allowDelete",{get:function(){return!1},set:function(o){},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"allowSorting",{get:function(){return wijmo_grid_1.AllowSorting.None},set:function(o){wijmo_1.assert(o===wijmo_grid_1.AllowSorting.None,"TransposedGrid does not support sorting.");this._alSorting=o},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"columnGroups",{get:function(){return null},set:function(o){throw"TransposedGrid does not support columnGroups, use rowGroups instead."},enumerable:!0,configurable:!0});TransposedGrid.prototype.onRowEditEnded=function(e){var r=wijmo_1.tryCast(this._sourceItems,"ICollectionView");if(r){var t=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Change);r.collectionChanged.raise(r,t)}o.prototype.onRowEditEnded.call(this,e)};TransposedGrid.prototype._getCollectionView=function(e){var r=this,t=wijmo_1.tryCast(this._sourceItems,"ICollectionView");t&&t.collectionChanged.removeHandler(this._sourceViewChanged);t=wijmo_1.tryCast(e,"ICollectionView");var n=e;if(wijmo_1.isArray(e))n=this._transposeItemsSource(e);else if(t){t.collectionChanged.addHandler(this._sourceViewChanged,this);n=this._transposeItemsSource(t.items)}this.autoGenerateColumns=!0;var i=o.prototype._getCollectionView.call(this,n),s=null;t instanceof wijmo_1.CollectionView&&(s=t.getError);s&&i instanceof wijmo_1.CollectionView&&(this._supportsProxies()?i.getError=function(o,e){if(null==e)return null;var r=o._keys.indexOf(e);return s(o._arr[r],o._bnd.path)}:i.getError=function(o,e){if(null==e)return null;var t=parseInt(e.substr(r._keyPrefix.length));return s(o._arr[t],o._rowInfo.binding)});this._sourceItems=e;return i};TransposedGrid.prototype._getColumnTypes=function(o){var e,r=this;if(this._sourceItems)if(wijmo_1.isArray(this._sourceItems))e=this._sourceItems;else{var t=wijmo_1.tryCast(this._sourceItems,"ICollectionView");t&&(e=t.items)}return e?e.map((function(o,e){return{binding:r._keyPrefix+e,dataType:wijmo_1.DataType.Object}})):wijmo_1.getTypes(o)};TransposedGrid.prototype._copy=function(e,r){var t=this;if(/rows|columns/.test(e)){wijmo_1.assert(wijmo_1.isArray(r),"Array Expected.");var n=wijmo_1.asArray(r);n.some((function(o){return null!=o.columns}))?this.rowGroups=n:this._rowInfo.deferUpdate((function(){t.autoGenerateRows=!1;t._rowInfo.clear();r.forEach((function(o){var e=new TransposedGridRow(o);t._rowInfo.push(e)}))}));return!0}return o.prototype._copy.call(this,e,r)};TransposedGrid.prototype.onLoadedRows=function(e){for(var r=this,t=this.columns,n=0;n<t.length;n++){var i=t[n];i.align=null;i.dataType=0}var s=this.rowHeaders.columns;for(n=0;n<s.length;n++){s[n].align="left";s[n].width=0}var a=wijmo_grid_1.FlexGrid._getSerializableProperties(wijmo_grid_1.Row);this.rows.forEach((function(o){var e=o.dataItem._rowInfo;if(e){r._copyProps(e,o,a,["showDropDown","width","size"]);if(r._hasColumnGroups())for(var t=0;t<s.length;t++){var n=r._grpHdl.getColumnGroup(o.index,t);n&&r._updateRowHeaders(o.index,t,n)}else s.length&&r._updateRowHeaders(o.index,s.length-1,e)}}));for(n=0;n<s.length;n++)0===s[n].width&&(s[n].width=this.columns.defaultSize);o.prototype.onLoadedRows.call(this,e)};TransposedGrid.prototype._getBindingColumn=function(o,e,r){var t=r;if(o!=this.cells)return t;var n=o.rows[e],i=n&&n.dataItem&&n.dataItem._rowInfo;if(wijmo_1.isUndefined(i))return t;t=new wijmo_grid_1.Column;var s=wijmo_grid_1.FlexGrid._getSerializableProperties(wijmo_grid_1.Column);this._copyProps(i,t,s);t.binding=r.binding;t.header=i.header||wijmo_1.toHeaderCase(i.binding);return t};TransposedGrid.prototype._isTransposed=function(){return!0};TransposedGrid.prototype._autoSizeRows=function(){this.autoSizeMode&wijmo_grid_1.AutoSizeMode.Both&&this.autoSizeRows();o.prototype._autoSizeRows.call(this)};TransposedGrid.prototype._copyProps=function(o,e,r,t){void 0===t&&(t=[]);for(var n in o)if(r.indexOf(n)>-1&&-1===t.indexOf(n)){var i=o[n];if(!wijmo_1.isUndefined(i))try{e[n]=i}catch(o){}}};TransposedGrid.prototype._updateRowHeaders=function(o,e,r){var t=r.header||wijmo_1.toHeaderCase(r.binding);this.rowHeaders.setCellData(o,e,t);var n=this.rowHeaders.columns,i=r.width;if(wijmo_1.isNumber(i)&&i>0){var s=r._rng;if(s&&s instanceof wijmo_grid_1.CellRange&&s.isValid){var a=s.columnSpan;wijmo_1.assert(a>0,"Column span is negative or equal to 0");i/=a}n[e].width=Math.max(n[e].width,i)}};TransposedGrid.prototype._rowInfoChanged=function(){var o=this;this._toRowInfo&&clearTimeout(this._toRowInfo);this._toRowInfo=setTimeout((function(){var e=o.selection,r=o.itemsSource;o.itemsSource=null;o.itemsSource=r;o.selection=e}),wijmo_1.Control._REFRESH_INTERVAL)};TransposedGrid.prototype._sourceViewChanged=function(o,e){this.activeEditor||this.invalidate()};TransposedGrid.prototype._transposeItemsSource=function(o){var e=this,r=new wijmo_1.ObservableArray,t=wijmo_1.getTypes(o),n=o.map((function(o,r){return e._keyPrefix+r}));(this.autoGenerateRows?this._getRowInfo(o):this._rowInfo).forEach((function(i,s){var a=new wijmo_1.Binding(i.binding);if(null==i.dataType&&o.length){var u=a.getValue(o[0]);i.dataType=null!=u?wijmo_1.getType(u):t[s].dataType}if(e._supportsProxies()){var l=e._createProxy(o,i,n);r.push(l)}else{var p=e._createTransposedObject(o,i,e._keyPrefix);r.push(p)}}));o instanceof wijmo_1.ObservableArray&&o.collectionChanged.addHandler((function(o,t){if(t.action===wijmo_1.NotifyCollectionChangedAction.Change)e.activeEditor||e.invalidate();else{var n=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Reset);r.onCollectionChanged(n);e._rowInfoChanged()}}));return r};TransposedGrid.prototype._supportsProxies=function(){return null!=window.Proxy};TransposedGrid.prototype._createProxy=function(o,e,r){var t={_arr:o,_rowInfo:e,_bnd:new wijmo_1.Binding(e.binding),_keys:r};return new Proxy(t,{ownKeys:function(o){return o._keys},getOwnPropertyDescriptor:function(){return{enumerable:!0,configurable:!0,writable:!0}},get:function(o,e){var r=o._keys.indexOf(e);return r>-1?o._bnd.getValue(o._arr[r]):o[e]},set:function(o,e,r){var t=o._keys.indexOf(e);if(t>-1){var n=o._arr,i=n[t];o._bnd.setValue(i,r);if(n instanceof wijmo_1.ObservableArray){var s=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Change,i,t);n.onCollectionChanged(s)}return!0}return!1}})};TransposedGrid.prototype._createTransposedObject=function(o,e,r){for(var t={_arr:o,_rowInfo:e},n=new wijmo_1.Binding(e.binding),_loop_1=function(e){var i=o[e];Object.defineProperty(t,r+e,{enumerable:!0,get:function(){return n.getValue(i)},set:function(r){n.setValue(i,r);if(o instanceof wijmo_1.ObservableArray){var t=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Change,i,e);o.onCollectionChanged(t)}return!0}})},i=0;i<o.length;i++)_loop_1(i);return t};TransposedGrid.prototype._getRowInfo=function(o){var e=this,r=[];wijmo_1.getTypes(o).forEach((function(o){var t=o.binding,n=o.dataType;if(n!=wijmo_1.DataType.Object&&n!=wijmo_1.DataType.Array){var i={binding:t,header:wijmo_1.toHeaderCase(t),dataType:n},s=wijmo_grid_1.FlexGrid._defTypeWidth[n];if(null!=s){if(wijmo_1.isString(s)){var a=Math.round(parseFloat(s));s=s.indexOf("*")<0?a:a*e.columns.defaultSize}wijmo_1.isNumber(s)&&s>0&&(i.width=s)}r.push(i)}}));return r};return TransposedGrid}(wijmo_grid_1.FlexGrid);exports.TransposedGrid=TransposedGrid;var TransposedGridRow=function(o){__extends(TransposedGridRow,o);function TransposedGridRow(){return null!==o&&o.apply(this,arguments)||this}Object.defineProperty(TransposedGridRow.prototype,"height",{get:function(){return this._height},set:function(o){this._height=o},enumerable:!0,configurable:!0});return TransposedGridRow}(wijmo_grid_1.Column);exports.TransposedGridRow=TransposedGridRow;var _RowGroupHandler=function(){function _RowGroupHandler(o){this._grid=o}Object.defineProperty(_RowGroupHandler.prototype,"columnGroups",{get:function(){return null},enumerable:!0,configurable:!0});_RowGroupHandler.prototype.createColumnGroups=function(o){this._createRowGroups(o)};_RowGroupHandler.prototype.hasColumnGroups=function(){return null!=this._colGroups&&this._colGroups.length>0};_RowGroupHandler.prototype.getGroupDefinitions=function(){return this._groupDefs};_RowGroupHandler.prototype.getColumnGroup=function(o,e){var r=this._grid;if(e<r.rowHeaders.columns.length&&o<r._rowInfo.length)for(var t=this._colGroups;t;){for(var n=t,i=0;i<t.length;i++){var s=t[i],a=s._rng;if(a.containsRow(o)){if(a.containsColumn(e)||0==s.columns.length)return s;t=s.columns;break}}if(t==n)break}return null};_RowGroupHandler.prototype.canMoveColumnGroup=function(o,e,r,t){return this._grid.columns.canMoveElement(e,t)};_RowGroupHandler.prototype.moveColumnGroup=function(o,e,r,t,n){return this._grid.columns.moveElement(e,t)};_RowGroupHandler.prototype._createRowGroups=function(o){var e=this,r=this._grid;this._groupDefs=wijmo_1.asArray(o);r.autoGenerateRows=!1;r._rowInfo.clear();this._colGroups=[];o.forEach((function(o){e._colGroups.push(new _RowGroup(o,null))}));var t=1;this._colGroups.forEach((function(o){e._addRowGroup(o);t=Math.max(t,o._getMaxLevel())}));this._colGroups.forEach((function(o){o._expandRange(t)}));var n=r.rowHeaders.columns;n.clear();for(var i=0;i<=t;i++){var s=new wijmo_grid_1.Column;n.splice(i,0,s);i<t&&(s.cssClassAll="wj-colgroup")}};_RowGroupHandler.prototype._addRowGroup=function(o){var e=this,r=this._grid;o._grid=r;o._rng.row=r._rowInfo.length;0==o.columns.length?r._rowInfo.push(o):o.columns.forEach((function(o){e._addRowGroup(o)}));o._rng.row2=r._rowInfo.length-1};return _RowGroupHandler}();exports._RowGroupHandler=_RowGroupHandler;var _RowGroup=function(o){__extends(_RowGroup,o);function _RowGroup(e,r){var t=o.call(this)||this;t._rng=new wijmo_grid_1.CellRange(-1,0);t._cols=[];t._lvl=0;t._collapsed=!1;t._pGrp=r;t._lvl=0;for(var n=r;n;n=n._pGrp)t._lvl++;r&&r.columns.indexOf(t)<0&&r.columns.push(t);t._rng.col=t._rng.col2=t._lvl;t.allowDragging=!1;wijmo_1.copy(t,e);return t}Object.defineProperty(_RowGroup.prototype,"columns",{get:function(){return this._cols},set:function(o){var e=this,r=this._cols=[];o.forEach((function(o){var t=new _RowGroup(o,e);r.indexOf(t)<0&&r.push(t)}))},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"rows",{get:function(){return this._cols},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"isEmpty",{get:function(){return 0===this._cols.length},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"height",{get:function(){return this._height},set:function(o){this._height=o},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"level",{get:function(){for(var o=this,e=0;o._pGrp;){o=o._pGrp;e++}return e},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"collapseTo",{get:function(){return this._collTo},set:function(o){wijmo_1.assert(wijmo_1.isArray(o)||wijmo_1.isString(o),"collapseTo should be an array or a string.");this._collTo=o},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"isCollapsed",{get:function(){return this._collapsed},set:function(o){var e=this;if(o!=this._collapsed){var r=this._grid;if(r){var t=new wijmo_grid_1.CellRangeEventArgs(r.rowHeaders,this._rng,this);if(r.onColumnGroupCollapsedChanging(t)){this._collapsed=wijmo_1.asBoolean(o);r.onColumnGroupCollapsedChanged(t)}}else this._collapsed=wijmo_1.asBoolean(o)}setTimeout((function(){e._updateCollapsedState()}))},enumerable:!0,configurable:!0});_RowGroup.prototype._copy=function(o,e){if(/rows|columns/.test(o)){var r=wijmo_1.asArray(e);this.columns=r;return!0}return!1};_RowGroup.prototype._updateCollapsedState=function(){var o=this._grid._rowInfo,e=this._rng,r=this._collapsed;this._cols.forEach((function(o){if(o instanceof _RowGroup){o._collapsed=r;o._updateCollapsedState()}}));for(var t=this._getCollapseToIndices(),n=e.topRow;n<=e.bottomRow;n++)o[n].visible=!r||t.indexOf(n)>-1};_RowGroup.prototype._getMaxLevel=function(){var o=this._lvl;this.columns.forEach((function(e){o=Math.max(o,e._getMaxLevel())}));return o};_RowGroup.prototype._expandRange=function(o){var e=o-this._getMaxLevel();if(e>0){this._rng.col2+=e;this._cols.forEach((function(o){o._shiftRange(e)}))}for(var r=this._grid._rowInfo,t=this._rng,n=t.row;n<=t.row2;n++){r[n]._rng.col2=o}};_RowGroup.prototype._shiftRange=function(o){this._rng.col+=o;this._rng.col2+=o;this._cols.forEach((function(e){e._shiftRange(o)}))};_RowGroup.prototype._getCollapseToBindings=function(){var o=this.collapseTo;return wijmo_1.isString(o)?[o]:o};_RowGroup.prototype._getCollapseToIndices=function(){var o=this._grid,e=this._rng,r=this._getCollapseToBindings();if(r&&r.length){for(var t=[],n=o._rowInfo,i=0;i<r.length;i++)switch(r[i]){case"$first":t.push(e.topRow);break;case"$last":t.push(e.bottomRow);break;default:var s=n.indexOf(r[i]);s>-1&&t.push(s)}if(t.length)return t}return[e.bottomRow]};return _RowGroup}(wijmo_grid_1.Column);exports._RowGroup=_RowGroup;wijmo_1._registerModule("wijmo.grid.transposed",selfModule);
14
+ "use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(o,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,e){o.__proto__=e}||function(o,e){for(var r in e)e.hasOwnProperty(r)&&(o[r]=e[r])})(o,e)};return function(o,e){extendStatics(o,e);function __(){this.constructor=o}o.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}(),__importStar=this&&this.__importStar||function(o){if(o&&o.__esModule)return o;var e={};if(null!=o)for(var r in o)Object.hasOwnProperty.call(o,r)&&(e[r]=o[r]);e.default=o;return e};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_grid_1=require("@mescius/wijmo.grid"),wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.grid.transposed")),_MergeManager=function(o){__extends(_MergeManager,o);function _MergeManager(){return null!==o&&o.apply(this,arguments)||this}_MergeManager.prototype.getMergedRange=function(e,r,t,n){void 0===n&&(n=!0);var i=e.grid,s=i._hasColumnGroups();if(e==i.columnHeaders&&s)return null;if(e==i.rowHeaders&&s){if(r<0||r>=e.rows.length||t<0||t>=e.columns.length)return null;var a=i._getColumnGroup(r,t);if(a){var u=a._rng,l=e.rows;if(l.isFrozen(u.row)!=l.isFrozen(u.row2)){u=u.clone();l.isFrozen(r)?u.row2=l.frozen-1:u.row=l.frozen}return u}return null}return o.prototype.getMergedRange.call(this,e,r,t,n)};return _MergeManager}(wijmo_grid_1.MergeManager);exports._MergeManager=_MergeManager;var TransposedGrid=function(o){__extends(TransposedGrid,o);function TransposedGrid(e,r){var t=o.call(this,e,null)||this;t._keyPrefix="item";t._autoGenRows=!0;wijmo_1.addClass(t.hostElement,"wj-transposed-grid");t.allowSorting=wijmo_grid_1.AllowSorting.None;t.headersVisibility=wijmo_grid_1.HeadersVisibility.Row;t._rowInfo=new wijmo_grid_1.ColumnCollection(t,t.columns.defaultSize);t._grpHdl=new _RowGroupHandler(t);t.mergeManager=new _MergeManager;t.initialize(r);t._rowInfo.collectionChanged.addHandler(t._rowInfoChanged,t);t.deferUpdate((function(){var o=t.rowHeaders.columns;if(o.length){o[o.length-1].width=t.columns.defaultSize}}));return t}Object.defineProperty(TransposedGrid.prototype,"autoGenerateRows",{get:function(){return this._autoGenRows},set:function(o){this._autoGenRows=wijmo_1.asBoolean(o)},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"rowGroups",{get:function(){return this._grpHdl.getGroupDefinitions()},set:function(o){var e=this;this._rowInfo.deferUpdate((function(){e.autoGenerateRows=!1;e._rowInfo.clear();e._grpHdl.createColumnGroups(wijmo_1.asArray(o))}))},enumerable:!0,configurable:!0});TransposedGrid.prototype.refresh=function(e){var r=this._rowInfo;if(r._dirty){r._dirty=!1;this._rowInfoChanged()}else o.prototype.refresh.call(this,e)};Object.defineProperty(TransposedGrid.prototype,"allowAddNew",{get:function(){return!1},set:function(o){},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"allowDelete",{get:function(){return!1},set:function(o){},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"allowSorting",{get:function(){return wijmo_grid_1.AllowSorting.None},set:function(o){wijmo_1.assert(o===wijmo_grid_1.AllowSorting.None,"TransposedGrid does not support sorting.");this._alSorting=o},enumerable:!0,configurable:!0});Object.defineProperty(TransposedGrid.prototype,"columnGroups",{get:function(){return null},set:function(o){throw"TransposedGrid does not support columnGroups, use rowGroups instead."},enumerable:!0,configurable:!0});TransposedGrid.prototype.onRowEditEnded=function(e){var r=wijmo_1.tryCast(this._sourceItems,"ICollectionView");if(r){var t=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Change);r.collectionChanged.raise(r,t)}o.prototype.onRowEditEnded.call(this,e)};TransposedGrid.prototype._getCollectionView=function(e){var r=this,t=wijmo_1.tryCast(this._sourceItems,"ICollectionView");t&&t.collectionChanged.removeHandler(this._sourceViewChanged);t=wijmo_1.tryCast(e,"ICollectionView");var n=e;if(wijmo_1.isArray(e))n=this._transposeItemsSource(e);else if(t){t.collectionChanged.addHandler(this._sourceViewChanged,this);n=this._transposeItemsSource(t.items)}this.autoGenerateColumns=!0;var i=o.prototype._getCollectionView.call(this,n),s=null;t instanceof wijmo_1.CollectionView&&(s=t.getError);s&&i instanceof wijmo_1.CollectionView&&(this._supportsProxies()?i.getError=function(o,e){if(null==e)return null;var r=o._keys.indexOf(e);return s(o._arr[r],o._bnd.path)}:i.getError=function(o,e){if(null==e)return null;var t=parseInt(e.substr(r._keyPrefix.length));return s(o._arr[t],o._rowInfo.binding)});this._sourceItems=e;return i};TransposedGrid.prototype._getColumnTypes=function(o){var e,r=this;if(this._sourceItems)if(wijmo_1.isArray(this._sourceItems))e=this._sourceItems;else{var t=wijmo_1.tryCast(this._sourceItems,"ICollectionView");t&&(e=t.items)}return e?e.map((function(o,e){return{binding:r._keyPrefix+e,dataType:wijmo_1.DataType.Object}})):wijmo_1.getTypes(o,0,!0)};TransposedGrid.prototype._copy=function(e,r){var t=this;if(/rows|columns/.test(e)){wijmo_1.assert(wijmo_1.isArray(r),"Array Expected.");var n=wijmo_1.asArray(r);n.some((function(o){return null!=o.columns}))?this.rowGroups=n:this._rowInfo.deferUpdate((function(){t.autoGenerateRows=!1;t._rowInfo.clear();r.forEach((function(o){var e=new TransposedGridRow(o);t._rowInfo.push(e)}))}));return!0}return o.prototype._copy.call(this,e,r)};TransposedGrid.prototype.onLoadedRows=function(e){for(var r=this,t=this.columns,n=0;n<t.length;n++){var i=t[n];i.align=null;i.dataType=0}var s=this.rowHeaders.columns;for(n=0;n<s.length;n++){s[n].align="left";s[n].width=0}var a=wijmo_grid_1.FlexGrid._getSerializableProperties(wijmo_grid_1.Row);this.rows.forEach((function(o){var e=o.dataItem._rowInfo;if(e){r._copyProps(e,o,a,["showDropDown","width","size"]);if(r._hasColumnGroups())for(var t=0;t<s.length;t++){var n=r._grpHdl.getColumnGroup(o.index,t);n&&r._updateRowHeaders(o.index,t,n)}else s.length&&r._updateRowHeaders(o.index,s.length-1,e)}}));for(n=0;n<s.length;n++)0===s[n].width&&(s[n].width=this.columns.defaultSize);o.prototype.onLoadedRows.call(this,e)};TransposedGrid.prototype._getBindingColumn=function(o,e,r){var t=r;if(o!=this.cells)return t;var n=o.rows[e],i=n&&n.dataItem&&n.dataItem._rowInfo;if(wijmo_1.isUndefined(i))return t;t=new wijmo_grid_1.Column;var s=wijmo_grid_1.FlexGrid._getSerializableProperties(wijmo_grid_1.Column);this._copyProps(i,t,s);t.binding=r.binding;t.header=i.header||wijmo_1.toHeaderCase(i.binding);return t};TransposedGrid.prototype._isTransposed=function(){return!0};TransposedGrid.prototype._autoSizeRows=function(){this.autoSizeMode&wijmo_grid_1.AutoSizeMode.Both&&this.autoSizeRows();o.prototype._autoSizeRows.call(this)};TransposedGrid.prototype._copyProps=function(o,e,r,t){void 0===t&&(t=[]);for(var n in o)if(r.indexOf(n)>-1&&-1===t.indexOf(n)){var i=o[n];if(!wijmo_1.isUndefined(i))try{e[n]=i}catch(o){}}};TransposedGrid.prototype._updateRowHeaders=function(o,e,r){var t=r.header||wijmo_1.toHeaderCase(r.binding);this.rowHeaders.setCellData(o,e,t);var n=this.rowHeaders.columns,i=r.width;if(wijmo_1.isNumber(i)&&i>0){var s=r._rng;if(s&&s instanceof wijmo_grid_1.CellRange&&s.isValid){var a=s.columnSpan;wijmo_1.assert(a>0,"Column span is negative or equal to 0");i/=a}n[e].width=Math.max(n[e].width,i)}};TransposedGrid.prototype._rowInfoChanged=function(){var o=this;this._toRowInfo&&clearTimeout(this._toRowInfo);this._toRowInfo=setTimeout((function(){var e=o.selection,r=o.itemsSource;o.itemsSource=null;o.itemsSource=r;o.selection=e}),wijmo_1.Control._REFRESH_INTERVAL)};TransposedGrid.prototype._sourceViewChanged=function(o,e){this.activeEditor||this.invalidate()};TransposedGrid.prototype._transposeItemsSource=function(o){var e=this,r=new wijmo_1.ObservableArray,t=wijmo_1.getTypes(o,0,!0),n=o.map((function(o,r){return e._keyPrefix+r}));(this.autoGenerateRows?this._getRowInfo(o):this._rowInfo).forEach((function(i,s){var a=new wijmo_1.Binding(i.binding);if(null==i.dataType&&o.length){var u=a.getValue(o[0]);i.dataType=null!=u?wijmo_1.getType(u):t[s].dataType}if(e._supportsProxies()){var l=e._createProxy(o,i,n);r.push(l)}else{var p=e._createTransposedObject(o,i,e._keyPrefix);r.push(p)}}));o instanceof wijmo_1.ObservableArray&&o.collectionChanged.addHandler((function(o,t){if(t.action===wijmo_1.NotifyCollectionChangedAction.Change)e.activeEditor||e.invalidate();else{var n=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Reset);r.onCollectionChanged(n);e._rowInfoChanged()}}));return r};TransposedGrid.prototype._supportsProxies=function(){return null!=window.Proxy};TransposedGrid.prototype._createProxy=function(o,e,r){var t={_arr:o,_rowInfo:e,_bnd:new wijmo_1.Binding(e.binding),_keys:r};return new Proxy(t,{ownKeys:function(o){return o._keys},getOwnPropertyDescriptor:function(){return{enumerable:!0,configurable:!0,writable:!0}},get:function(o,e){var r=o._keys.indexOf(e);return r>-1?o._bnd.getValue(o._arr[r]):o[e]},set:function(o,e,r){var t=o._keys.indexOf(e);if(t>-1){var n=o._arr,i=n[t];o._bnd.setValue(i,r);if(n instanceof wijmo_1.ObservableArray){var s=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Change,i,t);n.onCollectionChanged(s)}return!0}return!1}})};TransposedGrid.prototype._createTransposedObject=function(o,e,r){for(var t={_arr:o,_rowInfo:e},n=new wijmo_1.Binding(e.binding),_loop_1=function(e){var i=o[e];Object.defineProperty(t,r+e,{enumerable:!0,get:function(){return n.getValue(i)},set:function(r){n.setValue(i,r);if(o instanceof wijmo_1.ObservableArray){var t=new wijmo_1.NotifyCollectionChangedEventArgs(wijmo_1.NotifyCollectionChangedAction.Change,i,e);o.onCollectionChanged(t)}return!0}})},i=0;i<o.length;i++)_loop_1(i);return t};TransposedGrid.prototype._getRowInfo=function(o){var e=this,r=[];wijmo_1.getTypes(o,0,!0).forEach((function(o){var t=o.binding,n=o.dataType;if(n!=wijmo_1.DataType.Object){var i={binding:t,header:wijmo_1.toHeaderCase(t),dataType:n},s=wijmo_grid_1.FlexGrid._defTypeWidth[n];if(null!=s){if(wijmo_1.isString(s)){var a=Math.round(parseFloat(s));s=s.indexOf("*")<0?a:a*e.columns.defaultSize}wijmo_1.isNumber(s)&&s>0&&(i.width=s)}r.push(i)}}));return r};TransposedGrid.prototype.getRowDataItem=function(e,r){var t=this.cells;if(t.rows[e].dataItem._rowInfo instanceof TransposedGridRow){for(var n={},i=0;i<t.rows.length;i++){n[t.rows[i].dataItem._rowInfo._binding.path]=t.getCellData(i,r,!1)}return n}return o.prototype.getRowDataItem.call(this,e,r)};return TransposedGrid}(wijmo_grid_1.FlexGrid);exports.TransposedGrid=TransposedGrid;var TransposedGridRow=function(o){__extends(TransposedGridRow,o);function TransposedGridRow(){return null!==o&&o.apply(this,arguments)||this}Object.defineProperty(TransposedGridRow.prototype,"height",{get:function(){return this._height},set:function(o){this._height=o},enumerable:!0,configurable:!0});return TransposedGridRow}(wijmo_grid_1.Column);exports.TransposedGridRow=TransposedGridRow;var _RowGroupHandler=function(){function _RowGroupHandler(o){this._grid=o}Object.defineProperty(_RowGroupHandler.prototype,"columnGroups",{get:function(){return null},enumerable:!0,configurable:!0});_RowGroupHandler.prototype.createColumnGroups=function(o){this._createRowGroups(o)};_RowGroupHandler.prototype.hasColumnGroups=function(){return null!=this._colGroups&&this._colGroups.length>0};_RowGroupHandler.prototype.getGroupDefinitions=function(){return this._groupDefs};_RowGroupHandler.prototype.getColumnGroup=function(o,e){var r=this._grid;if(e<r.rowHeaders.columns.length&&o<r._rowInfo.length)for(var t=this._colGroups;t;){for(var n=t,i=0;i<t.length;i++){var s=t[i],a=s._rng;if(a.containsRow(o)){if(a.containsColumn(e)||0==s.columns.length)return s;t=s.columns;break}}if(t==n)break}return null};_RowGroupHandler.prototype.canMoveColumnGroup=function(o,e,r,t){return this._grid.columns.canMoveElement(e,t)};_RowGroupHandler.prototype.moveColumnGroup=function(o,e,r,t,n){return this._grid.columns.moveElement(e,t)};_RowGroupHandler.prototype._createRowGroups=function(o){var e=this,r=this._grid;this._groupDefs=wijmo_1.asArray(o);r.autoGenerateRows=!1;r._rowInfo.clear();this._colGroups=[];o.forEach((function(o){e._colGroups.push(new _RowGroup(o,null))}));var t=1;this._colGroups.forEach((function(o){e._addRowGroup(o);t=Math.max(t,o._getMaxLevel())}));this._colGroups.forEach((function(o){o._expandRange(t)}));var n=r.rowHeaders.columns;n.clear();for(var i=0;i<=t;i++){var s=new wijmo_grid_1.Column;n.splice(i,0,s);i<t&&(s.cssClassAll="wj-colgroup")}};_RowGroupHandler.prototype._addRowGroup=function(o){var e=this,r=this._grid;o._grid=r;o._rng.row=r._rowInfo.length;0==o.columns.length?r._rowInfo.push(o):o.columns.forEach((function(o){e._addRowGroup(o)}));o._rng.row2=r._rowInfo.length-1};return _RowGroupHandler}();exports._RowGroupHandler=_RowGroupHandler;var _RowGroup=function(o){__extends(_RowGroup,o);function _RowGroup(e,r){var t=o.call(this)||this;t._rng=new wijmo_grid_1.CellRange(-1,0);t._cols=[];t._lvl=0;t._collapsed=!1;t._pGrp=r;t._lvl=0;for(var n=r;n;n=n._pGrp)t._lvl++;r&&r.columns.indexOf(t)<0&&r.columns.push(t);t._rng.col=t._rng.col2=t._lvl;t.allowDragging=!1;wijmo_1.copy(t,e);return t}Object.defineProperty(_RowGroup.prototype,"columns",{get:function(){return this._cols},set:function(o){var e=this,r=this._cols=[];o.forEach((function(o){var t=new _RowGroup(o,e);r.indexOf(t)<0&&r.push(t)}))},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"rows",{get:function(){return this._cols},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"isEmpty",{get:function(){return 0===this._cols.length},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"height",{get:function(){return this._height},set:function(o){this._height=o},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"level",{get:function(){for(var o=this,e=0;o._pGrp;){o=o._pGrp;e++}return e},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"collapseTo",{get:function(){return this._collTo},set:function(o){wijmo_1.assert(wijmo_1.isArray(o)||wijmo_1.isString(o),"collapseTo should be an array or a string.");this._collTo=o},enumerable:!0,configurable:!0});Object.defineProperty(_RowGroup.prototype,"isCollapsed",{get:function(){return this._collapsed},set:function(o){var e=this;if(o!=this._collapsed){var r=this._grid;if(r){var t=new wijmo_grid_1.CellRangeEventArgs(r.rowHeaders,this._rng,this);if(r.onColumnGroupCollapsedChanging(t)){this._collapsed=wijmo_1.asBoolean(o);r.onColumnGroupCollapsedChanged(t)}}else this._collapsed=wijmo_1.asBoolean(o)}setTimeout((function(){e._updateCollapsedState()}))},enumerable:!0,configurable:!0});_RowGroup.prototype._copy=function(o,e){if(/rows|columns/.test(o)){var r=wijmo_1.asArray(e);this.columns=r;return!0}return!1};_RowGroup.prototype._updateCollapsedState=function(){var o=this._grid._rowInfo,e=this._rng,r=this._collapsed;this._cols.forEach((function(o){if(o instanceof _RowGroup){o._collapsed=r;o._updateCollapsedState()}}));for(var t=this._getCollapseToIndices(),n=e.topRow;n<=e.bottomRow;n++)o[n].visible=!r||t.indexOf(n)>-1};_RowGroup.prototype._getMaxLevel=function(){var o=this._lvl;this.columns.forEach((function(e){o=Math.max(o,e._getMaxLevel())}));return o};_RowGroup.prototype._expandRange=function(o){var e=o-this._getMaxLevel();if(e>0){this._rng.col2+=e;this._cols.forEach((function(o){o._shiftRange(e)}))}for(var r=this._grid._rowInfo,t=this._rng,n=t.row;n<=t.row2;n++){r[n]._rng.col2=o}};_RowGroup.prototype._shiftRange=function(o){this._rng.col+=o;this._rng.col2+=o;this._cols.forEach((function(e){e._shiftRange(o)}))};_RowGroup.prototype._getCollapseToBindings=function(){var o=this.collapseTo;return wijmo_1.isString(o)?[o]:o};_RowGroup.prototype._getCollapseToIndices=function(){var o=this._grid,e=this._rng,r=this._getCollapseToBindings();if(r&&r.length){for(var t=[],n=o._rowInfo,i=0;i<r.length;i++)switch(r[i]){case"$first":t.push(e.topRow);break;case"$last":t.push(e.bottomRow);break;default:var s=n.indexOf(r[i]);s>-1&&t.push(s)}if(t.length)return t}return[e.bottomRow]};return _RowGroup}(wijmo_grid_1.Column);exports._RowGroup=_RowGroup;wijmo_1._registerModule("wijmo.grid.transposed",selfModule);
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@mescius/wijmo.grid.transposed",
3
- "version": "5.20232.939",
3
+ "version": "5.20241.2-rc",
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
- "@mescius/wijmo": "5.20232.939",
11
- "@mescius/wijmo.grid": "5.20232.939"
10
+ "@mescius/wijmo": "5.20241.2-rc",
11
+ "@mescius/wijmo.grid": "5.20241.2-rc"
12
12
  },
13
13
  "homepage": "https://developer.mescius.com/wijmo",
14
14
  "bugs": {