@mescius/wijmo.grid.multirow 5.20232.939

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/index.d.ts ADDED
@@ -0,0 +1,515 @@
1
+ /*!
2
+ *
3
+ * Wijmo Library 5.20232.939
4
+ * https://developer.mescius.com/wijmo
5
+ *
6
+ * Copyright(c) MESCIUS inc. All rights reserved.
7
+ *
8
+ * Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
9
+ * us.sales@mescius.com
10
+ * https://developer.mescius.com/wijmo/licensing
11
+ *
12
+ */
13
+ /**
14
+ * {@module wijmo.grid.multirow}
15
+ * Defines the {@link MultiRow} control and its associated classes.
16
+ */
17
+ /**
18
+ *
19
+ */
20
+ export declare var ___keepComment: any;
21
+ import { ObservableArray, NotifyCollectionChangedEventArgs, Event, EventArgs, CancelEventArgs, CollectionViewGroup } from '@grapecity/wijmo';
22
+ import { Row, GroupRow, CellRange, CellRangeEventArgs, Column, GridPanel, ColumnCollection, FlexGrid, _AddNewHandler, _NewRowTemplate, SelMove, _SelectionHandler, _EditHandler, MergeManager } from '@grapecity/wijmo.grid';
23
+ import * as selfModule from '@grapecity/wijmo.grid.multirow';
24
+ /**
25
+ * Handles the grid's selection.
26
+ */
27
+ export declare class _MultiRowSelectionHandler extends _SelectionHandler {
28
+ _getNextColumnCell(r: number, c: number, move: SelMove, pageSize?: number): any;
29
+ }
30
+ /**
31
+ * Extends the {@link Row} class to provide additional information for multi-row records.
32
+ */
33
+ export declare class _MultiRow extends Row {
34
+ _idxRecord: number;
35
+ /**
36
+ * Initializes a new instance of the {@link Row} class.
37
+ *
38
+ * @param dataItem The data item this row is bound to.
39
+ * @param dataIndex The index of the record within the items source.
40
+ * @param recordIndex The index of this row within the record (data item).
41
+ */
42
+ constructor(dataItem: any, dataIndex: number, recordIndex: number);
43
+ /**
44
+ * Gets the index of this row within the record (data item) it represents.
45
+ */
46
+ readonly recordIndex: number;
47
+ }
48
+ /**
49
+ * Extends the {@link GroupRow} class to provide additional information for multi-row records.
50
+ */
51
+ export declare class _MultiGroupRow extends GroupRow {
52
+ _idxRecord: number;
53
+ /**
54
+ * Initializes a new instance of the {@link Row} class.
55
+ *
56
+ * @param dataItem The data item this row is bound to.
57
+ * @param recordIndex The index of this row within the record (group header).
58
+ */
59
+ constructor(dataItem: any, recordIndex: number);
60
+ /**
61
+ * Gets the index of this row within the record (data item) it represents.
62
+ */
63
+ readonly recordIndex: number;
64
+ /**
65
+ * _MultiGroupRow rows always have children...
66
+ */
67
+ readonly hasChildren: boolean;
68
+ /**
69
+ * Get cell range taking into account multi-row header rows.
70
+ */
71
+ getCellRange(): CellRange;
72
+ /**
73
+ * Gets or sets a value that indicates whether this _MultiGroupRow is
74
+ * collapsed (child rows are hidden) or expanded (child rows are visible).
75
+ */
76
+ isCollapsed: boolean;
77
+ _setCollapsed(collapsed: boolean): void;
78
+ private _getLastRowInHeader;
79
+ }
80
+ /**
81
+ * Handles the multirow's editing.
82
+ */
83
+ export declare class _MultiRowEditHandler extends _EditHandler {
84
+ _selectionChanging(e: CellRangeEventArgs): void;
85
+ }
86
+ /**
87
+ * Extends the {@link ObservableArray} class to track layout changes.
88
+ */
89
+ export declare class MultiRowCellCollection<T extends MultiRowCell> extends ObservableArray<T> {
90
+ private _layout;
91
+ _setLayout(layout: _MultiRowLayout): void;
92
+ /**
93
+ * Tracks layout changes.
94
+ */
95
+ onCollectionChanged(e?: NotifyCollectionChangedEventArgs<any>): void;
96
+ }
97
+ /**
98
+ * Class that parses {@link MultiRow} layout definitions.
99
+ */
100
+ export declare class _MultiRowLayout {
101
+ private _initialized;
102
+ private _disposed;
103
+ private _multiRowGroupHeaderRange;
104
+ _grid: MultiRow;
105
+ _rowsPerItem: number;
106
+ _bindingGroups: MultiRowCellCollection<MultiRowCellGroup>;
107
+ _groupsByColumn: any;
108
+ _changeCallback: () => void;
109
+ /**
110
+ * Initializes a new instance of the {@link _LayoutDef} class.
111
+ *
112
+ * @param grid {@link MultiRow} that owns this layout.
113
+ * @param layoutDef Array that contains the layout definition.
114
+ * @param changeCallback Callback invoked when layout changes.
115
+ */
116
+ constructor(grid: MultiRow, layoutDef: any[], changeCallback: () => void);
117
+ _dispose(): void;
118
+ _onLayoutChanged(): void;
119
+ private _parseCellGroups;
120
+ private _getMultiRowGroupHeaderRange;
121
+ private _expandMultiRowGroupHeaderToAggregate;
122
+ private _getSingleRowGroupHeaderRange;
123
+ _getGroupHeaderMergedRange(p: GridPanel, r: number, c: number, multiRowGroupHeaders: boolean): CellRange;
124
+ _getGroupByColumn(c: number): any;
125
+ _updateCellTypes(item: any): void;
126
+ }
127
+ /**
128
+ * Extends the {@link Column} class with <b>colspan</b> property to
129
+ * describe a cell in a {@link MultiRowCellGroup}.
130
+ */
131
+ export declare class MultiRowCell extends Column {
132
+ private _layout;
133
+ private _row;
134
+ private _col;
135
+ private _colspan;
136
+ private _rowspan;
137
+ _colspanEff: number;
138
+ _rowspanEff: number;
139
+ /**
140
+ * Initializes a new instance of the {@link MultiRowCell} class.
141
+ *
142
+ * @param options JavaScript object containing initialization data for the {@link MultiRowCell}.
143
+ */
144
+ constructor(options?: any);
145
+ /**
146
+ * Gets or sets the row index of this {@link MultiRowCell} within the cell group.
147
+ */
148
+ row: number;
149
+ /**
150
+ * Gets or sets the column index of this {@link MultiRowCell} within the cell group.
151
+ */
152
+ col: number;
153
+ /**
154
+ * Gets or sets the number of physical columns spanned by the {@link MultiRowCell}.
155
+ */
156
+ colspan: number;
157
+ /**
158
+ * Gets or sets the number of physical rows spanned by the {@link MultiRowCell}.
159
+ */
160
+ rowspan: number;
161
+ _setLayout(layout: _MultiRowLayout): void;
162
+ protected _onLayoutPropertyChanged(): void;
163
+ }
164
+ /**
165
+ * Describes a group of cells that may span multiple rows and columns.
166
+ */
167
+ export declare class MultiRowCellGroup extends MultiRowCell {
168
+ private _isRowHeader;
169
+ _colstart: number;
170
+ private _cellsDef;
171
+ private _cells;
172
+ _cols: ColumnCollection;
173
+ _hasAggregates: boolean;
174
+ private _rng;
175
+ private _isParsed;
176
+ /**
177
+ * Initializes a new instance of the {@link MultiRowCellGroup} class.
178
+ *
179
+ * @param options JavaScript object containing initialization data for the new {@link MultiRowCellGroup}.
180
+ */
181
+ constructor(options?: any);
182
+ _copy(key: string, value: any): boolean;
183
+ readonly cells: MultiRowCellCollection<MultiRowCell>;
184
+ isRowHeader: boolean;
185
+ openGroup(): void;
186
+ closeGroup(g: MultiRow, rowsPerItem: number): void;
187
+ getColumnWidth(c: number): any;
188
+ getMergedRange(p: GridPanel, r: number, c: number): CellRange;
189
+ getBindingColumn(p: GridPanel, r: number, c: number): Column;
190
+ getColumn(name: string): Column;
191
+ _getCellRange(r: number, c: number): CellRange;
192
+ private _parseCells;
193
+ private _clearCalculations;
194
+ private _calculate;
195
+ private _cellFits;
196
+ private _slotTaken;
197
+ }
198
+ /**
199
+ * Extends the {@link FlexGrid} control to provide multiple rows per item.
200
+ *
201
+ * Use the {@link layoutDefinition} property to define the layout of the
202
+ * rows used to display each data item.
203
+ *
204
+ * A few {@link FlexGrid} properties are disabled in the {@link MultiRow}
205
+ * control because they would interfere with the custom multi-row layouts.
206
+ * The list of disabled properties includes the following:
207
+ *
208
+ * {@link FlexGrid.allowMerging}, {@link FlexGrid.mergeManager},
209
+ * {@link FlexGrid.autoGenerateColumns}, {@link FlexGrid.columnGroups},
210
+ * {@link FlexGrid.allowDragging}, {@link FlexGrid.allowPinning},
211
+ * {@link FlexGrid.childItemsPath}, {@link FlexGridDetailProvider}, and
212
+ * {@link Column.visible}.
213
+ *
214
+ * Note also that cells in the {@link FlexGrid.columnFooters} panel
215
+ * do not follow the multi-row layout. That is because those cells
216
+ * belong to rows that are not created by the grid itself, but by
217
+ * custom code.
218
+ */
219
+ export declare class MultiRow extends FlexGrid {
220
+ _layoutDef: any[];
221
+ _layout: _MultiRowLayout;
222
+ _hdrLayoutDef: any[];
223
+ _hdrLayout: _MultiRowLayout;
224
+ _centerVert: boolean;
225
+ _collapsedHeaders: boolean;
226
+ _multiRowGroupHeaders: boolean;
227
+ _collapsedHeadersWasNull: boolean;
228
+ _btnCollapse: HTMLElement;
229
+ _rowHdrCnt: number;
230
+ /**
231
+ * Initializes a new instance of the {@link MultiRow} class.
232
+ *
233
+ * In most cases, the **options** parameter will include the value for the
234
+ * {@link layoutDefinition} property.
235
+ *
236
+ * @param element The DOM element that hosts the control, or a CSS selector for the host element (e.g. '#theCtrl').
237
+ * @param options JavaScript object containing initialization data for the control.
238
+ */
239
+ constructor(element: any, options?: any);
240
+ _getProductInfo(): string;
241
+ /**
242
+ * Gets or sets an array that defines the layout of the rows used to display each data item.
243
+ *
244
+ * The array contains a list of cell group objects which have the following properties:
245
+ *
246
+ * <ul>
247
+ * <li><b>header</b>: Group header (shown when the headers are collapsed).</li>
248
+ * <li><b>isRowHeader</b>: Whether cells in this group should be displayed and
249
+ * treated as row header cells.</li>
250
+ * <li><b>colspan</b>: Number of grid columns spanned by the group.</li>
251
+ * <li><b>cells</b>: Array of cell objects, which extend {@link Column} with a
252
+ * <b>colspan</b> property.</li>
253
+ * </ul>
254
+ *
255
+ * When the {@link layoutDefinition} property is set, the grid scans the cells in each
256
+ * group as follows:
257
+ *
258
+ * <ol>
259
+ * <li>The grid calculates the <b>colspan</b> of the group either as group's own <b>colspan</b>
260
+ * or as span of the widest cell in the group, whichever is wider.</li>
261
+ * <li>If the cell fits the current row within the group, it is added to the current row.</li>
262
+ * <li>If it doesn't fit, it is added to a new row.</li>
263
+ * </ol>
264
+ *
265
+ * When all groups are ready, the grid calculates the number of rows per record to the maximum
266
+ * **rowspan** of all groups, and adds rows to each group to pad their height as needed.
267
+ *
268
+ * This scheme is simple and flexible. For example:
269
+ * ```
270
+ * { header: 'Group 1', cells: [{ binding: 'c1' }, { binding: 'c2'}, { binding: 'c3' }]}
271
+ * ```
272
+ *
273
+ * The group has **colspan** 1, so there will be one cell per column. The result is:
274
+ * ```
275
+ * | C1 |
276
+ * | C2 |
277
+ * | C3 |
278
+ * ```
279
+ *
280
+ * To create a group with two columns, set the **colspan** property of the group:
281
+ * ```
282
+ * { header: 'Group 1', colspan: 2, cells:[{ binding: 'c1' }, { binding: 'c2'}, { binding: 'c3' }]}
283
+ * ```
284
+ *
285
+ * The cells will wrap as follows:
286
+ * ```
287
+ * | C1 | C2 |
288
+ * | C3 |
289
+ * ```
290
+ *
291
+ * Note that the last cell spans two columns (to fill the group).
292
+ *
293
+ * You can also specify the **colspan** on individual cells rather than on the group:
294
+ * ```
295
+ * { header: 'Group 1', cells: [{binding: 'c1', colspan: 2 }, { binding: 'c2'}, { binding: 'c3' }]}
296
+ * ```
297
+ *
298
+ * Now the first cell has **colspan** 2, so the result is:
299
+ * ```
300
+ * | C1 |
301
+ * | C2 | C3 |
302
+ * ```
303
+ *
304
+ * You can also make cells extend vertically using the cell's **rowspan** property:
305
+ * ```
306
+ * { header: 'Group 1', cells: [{binding: 'c1', rowspan: 2 }, { binding: 'c2'}, { binding: 'c3' }]}
307
+ * ```
308
+ *
309
+ * Now the first cell has **rowspan** 2, so the result is:
310
+ * ```
311
+ * | C1 | C2 |
312
+ * | | C3 |
313
+ * ```
314
+ *
315
+ * Because cells extend the {@link Column} class, you can add all the usual {@link Column}
316
+ * properties to any cells:
317
+ * ```
318
+ * { header: 'Group 1', cells: [
319
+ * { binding: 'c1', colspan: 2 },
320
+ * { binding: 'c2'},
321
+ * { binding: 'c3', format: 'n0', required: false, etc... }
322
+ * ]}
323
+ * ```
324
+ *
325
+ * The **isRowHeader** property of the cell groups allows you to create groups
326
+ * to be displayed as row header cells. This is done using frozen columns, so even
327
+ * though the row headers are regular cells, they look and behave like header cells.
328
+ *
329
+ * Setting the **isRowHeader** property to true automatically sets the cell's
330
+ * **isReadOnly** property to true (headers cannot be edited), adds a 'wj-header'
331
+ * style to the cell's **cssClass** property (so the cells are styled as headers),
332
+ * and sets the cell's **cellTemplate** property to its **header** value
333
+ * (so the cell shows the header as an unbound string). You may choose to set the
334
+ * cell's **binding** property instead of **header** if you want to show
335
+ * bound values in the row header cells.
336
+ */
337
+ layoutDefinition: any[];
338
+ /**
339
+ * Similar with viewRange
340
+ * but row is first record index instead of first row index
341
+ * row2 is last record index instead of last records row index
342
+ */
343
+ readonly recordViewRange: CellRange;
344
+ /**
345
+ * Gets or sets an array that defines the layout of the rows used to display
346
+ * the grid's column headers.
347
+ *
348
+ * The array contains a list of cell group objects similar to those used with
349
+ * the {@link layoutDefinition} property.
350
+ *
351
+ * The default value for this property is **null**, which causes the grid to
352
+ * use the {@link layoutDefinition} property to create the column headers.
353
+ */
354
+ headerLayoutDefinition: any[] | null;
355
+ /**
356
+ * Gets the number of rows used to display each item.
357
+ *
358
+ * This value is calculated automatically based on the value
359
+ * of the **layoutDefinition** property.
360
+ */
361
+ readonly rowsPerItem: number;
362
+ /**
363
+ * Gets the {@link Column} object used to bind a data item to a grid cell.
364
+ *
365
+ * @param p {@link GridPanel} that contains the cell.
366
+ * @param r Index of the row that contains the cell.
367
+ * @param c Index of the column that contains the cell.
368
+ */
369
+ getBindingColumn(p: GridPanel, r: number, c: number): Column;
370
+ /**
371
+ * Gets a column by name or by binding.
372
+ *
373
+ * The method searches the column by name. If a column with the given name
374
+ * is not found, it searches by binding. The searches are case-sensitive.
375
+ *
376
+ * @param name The name or binding to find.
377
+ * @param header Whether to search column defined for header.
378
+ * @return The column with the specified name or binding, or null if not found.
379
+ */
380
+ getColumn(name: string, header?: boolean): Column;
381
+ /**
382
+ * Gets or sets a value that determines whether the content of cells
383
+ * that span multiple rows should be vertically centered.
384
+ *
385
+ * The default value for this property is **true**.
386
+ */
387
+ centerHeadersVertically: boolean;
388
+ /**
389
+ * Gets or sets a value that determines whether column headers
390
+ * should be collapsed and displayed as a single row containing
391
+ * the group headers.
392
+ *
393
+ * If you set the {@link collapsedHeaders} property to **true**,
394
+ * remember to set the **header** property of every group in
395
+ * order to avoid empty header cells.
396
+ *
397
+ * Setting the {@link collapsedHeaders} property to **null** causes
398
+ * the grid to show all header information (groups and columns).
399
+ * In this case, the first row will show the group headers and the
400
+ * remaining rows will show the individual column headers.
401
+ *
402
+ * The default value for this property is **false**.
403
+ */
404
+ collapsedHeaders: boolean | null;
405
+ /**
406
+ * Gets or sets a value that determines whether the grid should display
407
+ * a button in the column header panel to allow users to collapse and
408
+ * expand the column headers.
409
+ *
410
+ * If the button is visible, clicking on it will cause the grid to
411
+ * toggle the value of the **collapsedHeaders** property.
412
+ *
413
+ * The default value for this property is **false**.
414
+ */
415
+ showHeaderCollapseButton: boolean;
416
+ /**
417
+ * Gets or sets a value that determines whether group headers should
418
+ * have multiple rows instead of a single header row.
419
+ *
420
+ * This property is useful when you want to display aggregate values
421
+ * in the group headers (see the {@link Column.aggregate} property).
422
+ *
423
+ * The default value for this property is **false**.
424
+ */
425
+ multiRowGroupHeaders: boolean;
426
+ /**
427
+ * Occurs after the value of the {@link collapsedHeaders} property changes.
428
+ */
429
+ readonly collapsedHeadersChanging: Event<MultiRow, CancelEventArgs>;
430
+ /**
431
+ * Raises the {@link collapsedHeadersChanging} event.
432
+ *
433
+ * @param e {@link CancelEventArgs} that contains the event data.
434
+ * @return True if the event was not canceled.
435
+ */
436
+ onCollapsedHeadersChanging(e: CancelEventArgs): boolean;
437
+ /**
438
+ * Occurs after the value of the {@link collapsedHeaders} property has changed.
439
+ */
440
+ readonly collapsedHeadersChanged: Event<MultiRow, EventArgs>;
441
+ /**
442
+ * Raises the {@link collapsedHeadersChanged} event.
443
+ */
444
+ onCollapsedHeadersChanged(e?: EventArgs): void;
445
+ allowPinning: boolean;
446
+ onSelectionChanging(e: CellRangeEventArgs): boolean;
447
+ protected _createSelHdl(): _SelectionHandler;
448
+ _getDeleteColumnIndex(): number;
449
+ _getQuickAutoSize(): boolean;
450
+ _addBoundRow(items: any[], index: number): void;
451
+ _addNode(items: any[], index: number, level: number): void;
452
+ _addGroupRow(group: CollectionViewGroup): void;
453
+ _bindColumns(): void;
454
+ _updateCollapsedHeaders(): void;
455
+ _updateColumnTypes(): void;
456
+ _getBindingColumn(p: GridPanel, r: number, c: Column): Column;
457
+ _getBindingColumns(): Column[];
458
+ _getRowsPerItem(): number;
459
+ _cvCollectionChanged(sender: any, e: NotifyCollectionChangedEventArgs): void;
460
+ _getGroupByColumn(c: number, hdr: boolean): MultiRowCellGroup;
461
+ private _onLayoutChanged;
462
+ private _onHeaderLayoutChanged;
463
+ private _formatItem;
464
+ _updateButtonGlyph(): void;
465
+ _getError(p: GridPanel, r: number, c: number, parsing?: boolean): string | null;
466
+ _getEmptyRequiredCell(row: number): any;
467
+ }
468
+ /**
469
+ * Provides custom merging for {@link MultiRow} controls.
470
+ */
471
+ export declare class _MergeManager extends MergeManager {
472
+ /**
473
+ * Gets a {@link CellRange} that specifies the merged extent of a cell
474
+ * in a {@link GridPanel}.
475
+ *
476
+ * @param p The {@link GridPanel} that contains the range.
477
+ * @param r The index of the row that contains the cell.
478
+ * @param c The index of the column that contains the cell.
479
+ * @param clip Specifies whether to clip the merged range to the grid's current view range.
480
+ * @return A {@link CellRange} that specifies the merged range, or null if the cell is not merged.
481
+ */
482
+ getMergedRange(p: GridPanel, r: number, c: number, clip?: boolean): CellRange;
483
+ private _getGroupRowMergedRange;
484
+ }
485
+ /**
486
+ * Manages the new row template used to add rows to the grid.
487
+ */
488
+ export declare class _MultiRowAddNewHandler extends _AddNewHandler {
489
+ /**
490
+ * Initializes a new instance of the {@link _AddNewHandler} class.
491
+ *
492
+ * @param grid {@link FlexGrid} that owns this {@link _AddNewHandler}.
493
+ */
494
+ constructor(grid: FlexGrid);
495
+ /**
496
+ * Updates the new row template to ensure that it is visible only when the grid is
497
+ * bound to a data source that supports adding new items, and that it is
498
+ * in the right position.
499
+ */
500
+ updateNewRowTemplate(): void;
501
+ _keydown(e: KeyboardEvent): void;
502
+ _beginningEdit(s: MultiRow, e: CellRangeEventArgs): void;
503
+ _rowEditStarting(s: FlexGrid, e: CellRangeEventArgs): void;
504
+ _rowEditEnded(s: MultiRow, e: CellRangeEventArgs): void;
505
+ _copyNewDataItem(): void;
506
+ _removeNewRowTemplate(): void;
507
+ }
508
+ /**
509
+ * Represents a row template used to add items to the source collection.
510
+ */
511
+ export declare class _MultiRowNewRowTemplate extends _NewRowTemplate {
512
+ _idxRecord: number;
513
+ constructor(indexInRecord: number);
514
+ readonly recordIndex: number;
515
+ }
package/index.js ADDED
@@ -0,0 +1,14 @@
1
+ /*!
2
+ *
3
+ * Wijmo Library 5.20232.939
4
+ * https://developer.mescius.com/wijmo
5
+ *
6
+ * Copyright(c) MESCIUS inc. All rights reserved.
7
+ *
8
+ * Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
9
+ * us.sales@mescius.com
10
+ * https://developer.mescius.com/wijmo/licensing
11
+ *
12
+ */
13
+
14
+ "use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++){t=arguments[o];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)},__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});var wijmo_1=require("@mescius/wijmo"),wijmo_grid_1=require("@mescius/wijmo.grid"),selfModule=__importStar(require("@mescius/wijmo.grid.multirow")),_MultiRowSelectionHandler=function(e){__extends(_MultiRowSelectionHandler,e);function _MultiRowSelectionHandler(){return null!==e&&e.apply(this,arguments)||this}_MultiRowSelectionHandler.prototype._getNextColumnCell=function(t,o,r,i){void 0===i&&(i=0);var n=this._g,l=n.cells,a=n.columns,s=wijmo_grid_1.SelMove;switch(r){case s.NextEditableCell:for(var u=o+1;u<a.length;u++){if((_=n._getBindingColumn(l,t,a[u])).renderSize>0&&!_.isReadOnly)return u}return o;case s.PrevEditableCell:for(u=o-1;u>=0;u--){var _;if((_=n._getBindingColumn(l,t,a[u])).renderSize>0&&!_.isReadOnly)return u}return o}return e.prototype._getNextColumnCell.call(this,t,o,r,i)};return _MultiRowSelectionHandler}(wijmo_grid_1._SelectionHandler);exports._MultiRowSelectionHandler=_MultiRowSelectionHandler;var _MultiRow=function(e){__extends(_MultiRow,e);function _MultiRow(t,o,r){var i=e.call(this,t)||this;i._idxData=o;i._idxRecord=r;return i}Object.defineProperty(_MultiRow.prototype,"recordIndex",{get:function(){return this._idxRecord},enumerable:!0,configurable:!0});return _MultiRow}(wijmo_grid_1.Row);exports._MultiRow=_MultiRow;var _MultiGroupRow=function(e){__extends(_MultiGroupRow,e);function _MultiGroupRow(t,o){var r=e.call(this,t)||this;r._idxRecord=o;return r}Object.defineProperty(_MultiGroupRow.prototype,"recordIndex",{get:function(){return this._idxRecord},enumerable:!0,configurable:!0});Object.defineProperty(_MultiGroupRow.prototype,"hasChildren",{get:function(){return!0},enumerable:!0,configurable:!0});_MultiGroupRow.prototype.getCellRange=function(){var t=this._getLastRowInHeader();return t!=this?t.getCellRange():e.prototype.getCellRange.call(this)};Object.defineProperty(_MultiGroupRow.prototype,"isCollapsed",{get:function(){return this._getLastRowInHeader()._getFlag(wijmo_grid_1.RowColFlags.Collapsed)},set:function(e){var t=this._getLastRowInHeader();e!=t.isCollapsed&&null!=t._list&&t._setCollapsed(wijmo_1.asBoolean(e))},enumerable:!0,configurable:!0});_MultiGroupRow.prototype._setCollapsed=function(e){var t=this,o=this.grid,r=o.rows,i=this.getCellRange(),n=new wijmo_grid_1.CellRangeEventArgs(o.cells,new wijmo_grid_1.CellRange(this.index,-1));if(o.onGroupCollapsedChanging(n)){o.deferUpdate((function(){r.deferUpdate((function(){t._setFlag(wijmo_grid_1.RowColFlags.Collapsed,e,!0);for(var o=i.topRow+1;o<=i.bottomRow&&o>-1&&o<r.length;o++){r[o]._setFlag(wijmo_grid_1.RowColFlags.ParentCollapsed,e,!0);var n=r[o];if(n instanceof _MultiGroupRow){var l=n._getLastRowInHeader();for(o+=1;o<=l.index;o++)(n=r[o])._setFlag(wijmo_grid_1.RowColFlags.ParentCollapsed,e,!0);o--}n instanceof wijmo_grid_1.GroupRow&&n.isCollapsed&&(o=n.getCellRange().bottomRow)}}))}));o.onGroupCollapsedChanged(n)}};_MultiGroupRow.prototype._getLastRowInHeader=function(){var e=this.grid,t=this;if(e&&e.multiRowGroupHeaders)for(var o=e.rows,r=this.dataItem,i=this.index+1;i<o.length&&o[i].dataItem==r;i++)t=o[i];wijmo_1.assert(t instanceof _MultiGroupRow,"last row in header should be a _MultiRowGroup");return t};return _MultiGroupRow}(wijmo_grid_1.GroupRow);exports._MultiGroupRow=_MultiGroupRow;var _MultiRowEditHandler=function(e){__extends(_MultiRowEditHandler,e);function _MultiRowEditHandler(){return null!==e&&e.apply(this,arguments)||this}_MultiRowEditHandler.prototype._selectionChanging=function(e){var t=this;if(this.finishEditing()){var o=this._g._selHdl.selection.row;if(o!=e.row){var r=this._g.rows.length;if((o>-1&&o<r?this._g.rows[o].dataItem:null)!=(e.row>-1&&e.row<r?this._g.rows[e.row].dataItem:null)){this._commitRowEdits();if(this._g._getHasValidation()&&this._g.validateEdits){var i=!this._g.rows[o]||this._g.rows[o]&&Object.getPrototypeOf(this._g.rows[o])!==_MultiRow.prototype?null:this._g.getEmptyRequiredCell(o);null!==i&&setTimeout((function(){t._g.select(i);t.startEditing(!0,i.row,i.col,!0,e)}))}}}}else e.cancel=!0};return _MultiRowEditHandler}(wijmo_grid_1._EditHandler);exports._MultiRowEditHandler=_MultiRowEditHandler;var MultiRowCellCollection=function(e){__extends(MultiRowCellCollection,e);function MultiRowCellCollection(){return null!==e&&e.apply(this,arguments)||this}MultiRowCellCollection.prototype._setLayout=function(e){this._layout=e;this.forEach((function(t){return t._setLayout(e)}))};MultiRowCellCollection.prototype.onCollectionChanged=function(t){void 0===t&&(t=wijmo_1.NotifyCollectionChangedEventArgs.reset);var o=this._layout;o&&o._onLayoutChanged();e.prototype.onCollectionChanged.call(this,t)};return MultiRowCellCollection}(wijmo_1.ObservableArray);exports.MultiRowCellCollection=MultiRowCellCollection;var _MultiRowLayout=function(){function _MultiRowLayout(e,t,o){this._initialized=!1;this._disposed=!1;this._rowsPerItem=1;this._groupsByColumn={};this._grid=e;this._changeCallback=o;this._bindingGroups=this._parseCellGroups(t);this._initialized=!0}_MultiRowLayout.prototype._dispose=function(){if(!this._disposed){this._disposed=!0;var e=this._bindingGroups;e.forEach((function(e){e.cells._setLayout(null)}));e._setLayout(null);this._bindingGroups=null}};_MultiRowLayout.prototype._onLayoutChanged=function(){this._initialized&&!this._disposed&&this._changeCallback&&this._changeCallback()};_MultiRowLayout.prototype._parseCellGroups=function(e){var t=this,o=this._grid,r=null,i=1;if(e){if(e instanceof MultiRowCellCollection){e.forEach((function(e){wijmo_1.assert(e instanceof MultiRowCellGroup,"groups contain items of invalid type")}));r=e}else{r=new MultiRowCellCollection;for(var n=0;n<e.length;n++){var l=null;l=e[n]instanceof MultiRowCellGroup?e[n]:new MultiRowCellGroup(e[n]);r.push(l)}}r.forEach((function(e){e.openGroup()}));n=0;for(var a=0;n<r.length;n++){(l=r[n])._colstart=a;a+=l._colspanEff;i=Math.max(i,l._rowspanEff)}r.forEach((function(e){e.closeGroup(o,i)}));this._rowsPerItem=i}else r=new MultiRowCellCollection;this._multiRowGroupHeaderRange=this._getMultiRowGroupHeaderRange(r);r.forEach((function(e){e.cells._setLayout(t)}));r._setLayout(this);return r};_MultiRowLayout.prototype._getMultiRowGroupHeaderRange=function(e){for(var t=this._rowsPerItem,o=new wijmo_grid_1.CellRange(0,0,t-1,0),r=0;r<e.length;r++){var i=e[r];if(i._hasAggregates){0===r&&this._expandMultiRowGroupHeaderToAggregate(o,i);return o}o.col2=i._colstart+i._colspanEff-1}return o};_MultiRowLayout.prototype._expandMultiRowGroupHeaderToAggregate=function(e,t){var o=this._rowsPerItem,r=t._colspanEff,i=t.cells.filter((function(e){return e.col>0&&0!=e.aggregate})).map((function(e){return e.col})).reduce((function(e,t){return t<e?t:e}),r);e.col2=Math.max(t._colstart+i-1,e.col2);for(var n=i;n<r;n++){for(var l=!0,a=0;a<o;a++){var s=t._getCellRange(a,n);l=l&&s.col===n}if(l){e.col2=Math.max(t._colstart+n-1,e.col2);return}}};_MultiRowLayout.prototype._getSingleRowGroupHeaderRange=function(e,t,o){var r=this._bindingGroups;if(0===r.length)return null;var i=this._getGroupByColumn(o);wijmo_1.assert(null!=i,"Failed to get the group!");var n=i._getCellRange(0,o-i._colstart),l=new wijmo_grid_1.CellRange(t,i._colstart+n.col,t,i._colstart+n.col2);if(0!=i.getBindingColumn(e,t,o).aggregate)return l;for(var a=r[0]._colstart,s=o-1;s>=a;s--){var u=this._getGroupByColumn(s);wijmo_1.assert(null!=u,"Failed to get the group!");if(0!=u.getBindingColumn(e,t,s).aggregate)break;n=u._getCellRange(0,s-u._colstart);l.col=u._colstart+n.col}var _=r[r.length-1],c=_._colstart+_._colspanEff;for(s=o+1;s<c;s++){var w=this._getGroupByColumn(s);wijmo_1.assert(null!=w,"Failed to get the group!");if(0!=w.getBindingColumn(e,t,s).aggregate)break;n=w._getCellRange(0,s-w._colstart);l.col2=w._colstart+n.col2}return l};_MultiRowLayout.prototype._getGroupHeaderMergedRange=function(e,t,o,r){if(r){var i=this._multiRowGroupHeaderRange;if(i.containsColumn(o)){var n=this._rowsPerItem,l=Math.floor(t/n)*n;return new wijmo_grid_1.CellRange(l+i.row,i.col,l+i.row2,i.col2)}var a=this._getGroupByColumn(o);wijmo_1.assert(a instanceof MultiRowCellGroup,"Failed to get the group!");return a.getMergedRange(e,t,o)}return this._getSingleRowGroupHeaderRange(e,t,o)};_MultiRowLayout.prototype._getGroupByColumn=function(e){var t=this._groupsByColumn[e];if(!t)for(var o=this._bindingGroups,r=0;r<o.length;r++)if(e>=(t=o[r])._colstart&&e<=t._colstart+t._colspanEff-1){this._groupsByColumn[e]=t;break}return t};_MultiRowLayout.prototype._updateCellTypes=function(e){this._bindingGroups.forEach((function(t){t._cols.forEach((function(t){null==t.dataType&&t._binding&&(t.dataType=wijmo_1.getType(t._binding.getValue(e)));if(!t.isReadOnly){var o=wijmo_1.isIE()?null:Object.getOwnPropertyDescriptor(e,t.binding);t.isReadOnly=o&&!o.writable&&!o.set}}))}))};return _MultiRowLayout}();exports._MultiRowLayout=_MultiRowLayout;var MultiRowCell=function(e){__extends(MultiRowCell,e);function MultiRowCell(t){var o=e.call(this)||this;o._row=o._col=0;o._rowspan=o._colspan=1;wijmo_1.copy(o,t);return o}Object.defineProperty(MultiRowCell.prototype,"row",{get:function(){return this._row},set:function(e){var t=wijmo_1.asInt(e,!1,!0);if(this._row!=t){this._row=t;this._onLayoutPropertyChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiRowCell.prototype,"col",{get:function(){return this._col},set:function(e){var t=wijmo_1.asInt(e,!1,!0);if(this._col!=t){this._col=t;this._onLayoutPropertyChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiRowCell.prototype,"colspan",{get:function(){return this._colspan},set:function(e){var t=wijmo_1.asInt(e,!1,!0);wijmo_1.assert(t>0,"colspan must be >= 1");if(this._colspan!=t){this._colspan=t;this._onLayoutPropertyChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiRowCell.prototype,"rowspan",{get:function(){return this._rowspan},set:function(e){var t=wijmo_1.asInt(e,!1,!0);wijmo_1.assert(t>0,"rowspan must be >= 1");if(this._rowspan!=t){this._rowspan=t;this._onLayoutPropertyChanged()}},enumerable:!0,configurable:!0});MultiRowCell.prototype._setLayout=function(e){this._layout=e};MultiRowCell.prototype._onLayoutPropertyChanged=function(){var e=this._layout;e&&e._onLayoutChanged()};return MultiRowCell}(wijmo_grid_1.Column);exports.MultiRowCell=MultiRowCell;var MultiRowCellGroup=function(e){__extends(MultiRowCellGroup,e);function MultiRowCellGroup(t){var o=e.call(this)||this;o._isRowHeader=!1;o._colstart=0;o._cells=new MultiRowCellCollection;wijmo_1.copy(o,t);return o}MultiRowCellGroup.prototype._copy=function(e,t){if("cells"==e){wijmo_1.isArray(t)&&(this._cellsDef=t);return!0}return!1};Object.defineProperty(MultiRowCellGroup.prototype,"cells",{get:function(){return this._cells},enumerable:!0,configurable:!0});Object.defineProperty(MultiRowCellGroup.prototype,"isRowHeader",{get:function(){return this._isRowHeader},set:function(e){var t=wijmo_1.asBoolean(e);if(this._isRowHeader!=t){this._isRowHeader=t;this._onLayoutPropertyChanged()}},enumerable:!0,configurable:!0});MultiRowCellGroup.prototype.openGroup=function(){if(!this._isParsed){this._cells=this._parseCells(this._cellsDef);this._isParsed=!0}this._calculate()};MultiRowCellGroup.prototype.closeGroup=function(e,t){var o=this;if(t>this._rowspanEff){this._cells.forEach((function(e){e.row==o._rowspanEff-1&&(e._rowspanEff=t-e.row)}));this._rowspanEff=t}this._cells.forEach((function(e){for(;e.col+e._colspanEff<o._colspanEff&&!o._slotTaken(e.row,e.col+e._colspanEff);)e._colspanEff++}));this._cells.forEach((function(e){for(;e.row+e._rowspanEff<o._rowspanEff&&!o._slotTaken(e.row+e._rowspanEff,e.col);)e._rowspanEff++}));if(this._cells.length>0)for(var r=0;r<this._rowspanEff;r++)for(var i=0;i<this._colspanEff;i++)wijmo_1.assert(this._slotTaken(r,i),"Invalid layout (empty cells).");this._cols=new wijmo_grid_1.ColumnCollection(e,e.columns.defaultSize);this._rng=new Array(t*this._colspanEff);this._cells.forEach((function(e){for(var t=0;t<e._rowspanEff;t++)for(var r=0;r<e._colspanEff;r++){var i=(e.row+t)*o._colspanEff+e.col+r;o._cols.setAt(i,e);var n=new wijmo_grid_1.CellRange(0-t,0-r,0-t+e._rowspanEff-1,0-r+e._colspanEff-1);n.isSingleCell||(o._rng[i]=n)}}));var n=this._colstart;this._rng[-1]=new wijmo_grid_1.CellRange(0,n,0,n+this._colspanEff-1);this._hasAggregates=!1;for(var l=0;l<this._cells.length&&!this._hasAggregates;l++)this._hasAggregates=0!=this._cells[l].aggregate};MultiRowCellGroup.prototype.getColumnWidth=function(e){for(var t=0;t<this._cells.length;t++){var o=this._cells[t];if(o.col==e&&1==o._colspanEff)return o.width}return null};MultiRowCellGroup.prototype.getMergedRange=function(e,t,o){if(t<0)return this._rng[-1];var r=e.rows[t],i=null!=r.recordIndex?r.recordIndex:t%this._rowspanEff,n=o-this._colstart,l=this._rng[i*this._colspanEff+n];e.cellType==wijmo_grid_1.CellType.ColumnHeader&&t++;return l?new wijmo_grid_1.CellRange(t+l.row,o+l.col,t+l.row2,o+l.col2):null};MultiRowCellGroup.prototype.getBindingColumn=function(e,t,o){if(t<0)return this;var r=e.rows[t],i=r&&null!=r.recordIndex?r.recordIndex:t%this._rowspanEff,n=o-this._colstart;return this._cols[i*this._colspanEff+n]};MultiRowCellGroup.prototype.getColumn=function(e){return this._cols.getColumn(e)};MultiRowCellGroup.prototype._getCellRange=function(e,t){var o=this._rng[e*this._colspanEff+t];return o?new wijmo_grid_1.CellRange(e+o.row,t+o.col,e+o.row2,t+o.col2):new wijmo_grid_1.CellRange(e,t)};MultiRowCellGroup.prototype._parseCells=function(e){var t=this._cells;if(e){if(e instanceof MultiRowCellCollection){e.forEach((function(e){wijmo_1.assert(e instanceof MultiRowCell,"cells contain items of invalid type")}));t=e}else e.forEach((function(e){var o=null;o=e instanceof MultiRowCell?e:new MultiRowCell(e);t.push(o)}));t.forEach((function(e){e.binding&&!e.header&&(e.header=wijmo_1.toHeaderCase(e.binding))}))}return t};MultiRowCellGroup.prototype._clearCalculations=function(){this._colstart=0;this._cols=null;this._hasAggregates=!1;this._rng=null;this.row=0;this.col=0;this._colspanEff=0;this._rowspanEff=0;this._cells.forEach((function(e){e.row=0;e.col=0;e._colspanEff=0;e._rowspanEff=0}))};MultiRowCellGroup.prototype._calculate=function(){var e=this;this._clearCalculations();this._colspanEff=this.colspan;this._rowspanEff=this.rowspan;this._cells.forEach((function(t){e._colspanEff=Math.max(e._colspanEff,t.colspan);t._colspanEff=t.colspan;t._rowspanEff=t.rowspan}));var t=0,o=0;this._cells.forEach((function(r,i){for(;!e._cellFits(r,i,t,o);)0==(o=(o+1)%e._colspanEff)&&t++;r.row=t;r.col=o}));var r=1,i=1;this._cells.forEach((function(e){r=Math.max(r,e.row+e._rowspanEff);i=Math.max(i,e.col+e._colspanEff)}));this._rowspanEff=r;this._colspanEff=i};MultiRowCellGroup.prototype._cellFits=function(e,t,o,r){if(r>0&&r+e._colspanEff>this._colspanEff)return!1;for(var i=0;i<e._colspanEff;i++)if(this._slotTaken(o,r+i,t))return!1;this._colspanEff=Math.max(this._colspanEff,r+e._colspanEff-1);return!0};MultiRowCellGroup.prototype._slotTaken=function(e,t,o){void 0===o&&(o=this._cells.length);for(var r=0;r<o;r++){var i=this._cells[r];if(e>=i.row&&e<=i.row+i._rowspanEff-1&&t>=i.col&&t<=i.col+i._colspanEff-1)return!0}return!1};return MultiRowCellGroup}(MultiRowCell);exports.MultiRowCellGroup=MultiRowCellGroup;var MultiRow=function(e){__extends(MultiRow,e);function MultiRow(t,o){var r=e.call(this,t)||this;r._hdrLayoutDef=null;r._centerVert=!0;r._collapsedHeaders=!1;r._multiRowGroupHeaders=!1;r._rowHdrCnt=0;r.collapsedHeadersChanging=new wijmo_1.Event;r.collapsedHeadersChanged=new wijmo_1.Event;r._layoutDef=new MultiRowCellCollection;r._layout=new _MultiRowLayout(r,r._layoutDef,(function(){return r._onLayoutChanged()}));wijmo_1.addClass(r.hostElement,"wj-multirow");var i=r.columnHeaders.hostElement.parentElement,n=wijmo_1.createElement('<div class="wj-hdr-collapse"><span></span></div>');n.style.display="none";i.appendChild(n);r._btnCollapse=n;r._updateButtonGlyph();r.addEventListener(n,"mousedown",(function(e){switch(r.collapsedHeaders){case null:case!1:r._collapsedHeadersWasNull=null==r.collapsedHeaders;r.collapsedHeaders=!0;break;case!0:r.collapsedHeaders=!!r._collapsedHeadersWasNull&&null}e.preventDefault();r.focus()}),!0);var l=r.hostElement;r.addEventListener(l,"mousedown",(function(e){if(!r._mouseHdl._szRowCol){var t=r._layout?r._layout._bindingGroups:null,o=t&&t.length?t[0]:null;if(o&&o.isRowHeader){var i=r.hitTest(e);if(i.panel==r.columnHeaders&&i.col<r.columns.frozen){e.preventDefault();r.selectAll()}}}}),!0);["dragover","dragleave","dragdrop"].forEach((function(e){r.removeEventListener(l,e)}));r._edtHdl=new _MultiRowEditHandler(r);r._addHdl=new _MultiRowAddNewHandler(r);r.formatItem.addHandler(r._formatItem,r);r.autoGenerateColumns=!1;r.allowDragging=wijmo_grid_1.AllowDragging.None;r.mergeManager=new _MergeManager;r.initialize(o);return r}MultiRow.prototype._getProductInfo=function(){return"H87K,MultiRow"};Object.defineProperty(MultiRow.prototype,"layoutDefinition",{get:function(){return this._layoutDef},set:function(e){var t=this;this.finishEditing()||this.finishEditing(!0);this._layoutDef=wijmo_1.asArray(e);if(this._layout){this._layout._dispose();this._layout=null}this._layout=new _MultiRowLayout(this,e,(function(){return t._onLayoutChanged()}));this._rowHdrCnt=0;if(this._layout)for(var o=this._layout._bindingGroups,r=0;r<o.length;r++){var i=o[r];if(!i.isRowHeader)break;this._rowHdrCnt=i._colstart+i._colspanEff;i.cells.forEach((function(e){e.isReadOnly=!0;!e.header||e.binding||e.cellTemplate||(e.cellTemplate=e.header);e.cssClass?e.cssClass.indexOf("wj-header")<0&&(e.cssClass+=" wj-header"):e.cssClass="wj-header"}))}this._rowHdrCnt&&(this.columns.frozen=this._rowHdrCnt);this._bindGrid(!0);this._rowHdrCnt&&this.selectionMode&&this.select(this.selection.row,this._rowHdrCnt)},enumerable:!0,configurable:!0});Object.defineProperty(MultiRow.prototype,"recordViewRange",{get:function(){var e=Math.floor(this.viewRange.row/this.rowsPerItem),t=Math.ceil(this.viewRange.row2/this.rowsPerItem);return __assign({},this.viewRange,{row:e,row2:t,_row:e,_row2:t})},enumerable:!0,configurable:!0});Object.defineProperty(MultiRow.prototype,"headerLayoutDefinition",{get:function(){return this._hdrLayoutDef},set:function(e){var t=this;this._hdrLayoutDef=wijmo_1.asArray(e);if(this._hdrLayout){this._hdrLayout._dispose();this._hdrLayout=null}var o=null;e&&(o=new _MultiRowLayout(this,e,(function(){return t._onHeaderLayoutChanged()})));this._hdrLayout=o;this._bindGrid(!0)},enumerable:!0,configurable:!0});Object.defineProperty(MultiRow.prototype,"rowsPerItem",{get:function(){return this._layout._rowsPerItem},enumerable:!0,configurable:!0});MultiRow.prototype.getBindingColumn=function(e,t,o){return this._getBindingColumn(e,t,e.columns[o])};MultiRow.prototype.getColumn=function(t,o){if(wijmo_1.isString(t)){for(var r=o&&this._hdrLayout,i=(r?this._hdrLayout:this._layout)._bindingGroups,n=null,l=0;l<i.length&&!n;l++)n=i[l].getColumn(t);return!n&&r?this.getColumn(t,!1):n}return e.prototype.getColumn.call(this,t)};Object.defineProperty(MultiRow.prototype,"centerHeadersVertically",{get:function(){return this._centerVert},set:function(e){if(e!=this._centerVert){this._centerVert=wijmo_1.asBoolean(e);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(MultiRow.prototype,"collapsedHeaders",{get:function(){return this._collapsedHeaders},set:function(e){if(e!=this._collapsedHeaders){var t=new wijmo_1.CancelEventArgs;if(this.onCollapsedHeadersChanging(t)){this._collapsedHeaders=wijmo_1.asBoolean(e,!0);this._updateCollapsedHeaders();this._updateButtonGlyph();this.onCollapsedHeadersChanged(t)}}},enumerable:!0,configurable:!0});Object.defineProperty(MultiRow.prototype,"showHeaderCollapseButton",{get:function(){return""==this._btnCollapse.style.display},set:function(e){e!=this.showHeaderCollapseButton&&(this._btnCollapse.style.display=wijmo_1.asBoolean(e)?"":"none")},enumerable:!0,configurable:!0});Object.defineProperty(MultiRow.prototype,"multiRowGroupHeaders",{get:function(){return this._multiRowGroupHeaders},set:function(e){if(e!=this._multiRowGroupHeaders){this._multiRowGroupHeaders=wijmo_1.asBoolean(e);this._bindGrid(!0)}},enumerable:!0,configurable:!0});MultiRow.prototype.onCollapsedHeadersChanging=function(e){this.collapsedHeadersChanging.raise(this,e);return!e.cancel};MultiRow.prototype.onCollapsedHeadersChanged=function(e){this.collapsedHeadersChanged.raise(this,e)};Object.defineProperty(MultiRow.prototype,"allowPinning",{get:function(){return!1},set:function(e){wijmo_1.assert(!e,"MultiRow does not support pinning.")},enumerable:!0,configurable:!0});MultiRow.prototype.onSelectionChanging=function(t){var o=t._rng;if(o&&o.isValid&&this.selectionMode){var r=this._mouseHdl._htDown,i=this.rows,n=this.columns,l=this._rowHdrCnt;if(l){o.col=Math.max(o.col,l);o.col2=Math.max(o.col2,l)}if(r&&(r.panel==this.rowHeaders||r.panel==this.cells&&r.col<l)){var a=i[o.topRow],s=i[o.bottomRow];if(a&&null!=a.recordIndex){var u=a.index-a.recordIndex,_=s instanceof _MultiGroupRow&&!this._multiRowGroupHeaders?1:this.rowsPerItem,c=s.index-s.recordIndex+_-1,w=n.length-1,d=o.row!=o.topRow?new wijmo_grid_1.CellRange(c,0,u,w):new wijmo_grid_1.CellRange(u,0,c,w);o.row=d.row;o.row2=d.row2;o.col2=w;switch(this.selectionMode){case wijmo_grid_1.SelectionMode.Cell:o.row2=d.row;o.col2=d.col;break;case wijmo_grid_1.SelectionMode.Row:o.row2=d.row}}}}return e.prototype.onSelectionChanging.call(this,t)};MultiRow.prototype._createSelHdl=function(){return new _MultiRowSelectionHandler(this)};MultiRow.prototype._getDeleteColumnIndex=function(){return this._rowHdrCnt};MultiRow.prototype._getQuickAutoSize=function(){return wijmo_1.isBoolean(this.quickAutoSize)?this.quickAutoSize:this.formatItem.handlerCount<=1&&null==this.itemFormatter};MultiRow.prototype._addBoundRow=function(e,t){for(var o=e[t],r=0;r<this.rowsPerItem;r++)this.rows.push(new _MultiRow(o,t,r))};MultiRow.prototype._addNode=function(e,t,o){this._addBoundRow(e,t)};MultiRow.prototype._addGroupRow=function(e){for(var t=this._multiRowGroupHeaders?this.rowsPerItem:1,o=0;o<t;o++)this.rows.push(new _MultiGroupRow(e,o))};MultiRow.prototype._bindColumns=function(){for(var e=this,t=this.columnHeaders.rows,o=this._layout,r=this._hdrLayout,i=(r?r._rowsPerItem:this.rowsPerItem)+1;t.length>i;)t.removeAt(t.length-1);for(;t.length<i;)t.push(new wijmo_grid_1.Row);this._updateCollapsedHeaders();this.columns.clear();if(o&&o._bindingGroups){var n="width,minWidth,maxWidth,binding,header,format,dataMap,name,aggregate,cellTemplate".split(",");o._bindingGroups.forEach((function(t){for(var _loop_1=function(o){if(0===t.cells.length)return"continue";for(var r=new wijmo_grid_1.Column,_loop_2=function(e){var i=t.cells[e];i.col==o&&n.forEach((function(e){null!=i[e]&&i[e]!=r[e]&&(r[e]=i[e])}))},i=0;i<t.cells.length;i++)_loop_2(i);e.columns.push(r)},o=0;o<t._colspanEff;o++)_loop_1(o)}))}};MultiRow.prototype._updateCollapsedHeaders=function(){var e=this.columnHeaders.rows,t=this.collapsedHeaders;e[0].visible=0!=t;for(var o=1;o<e.length;o++)e[o].visible=1!=t};MultiRow.prototype._updateColumnTypes=function(){e.prototype._updateColumnTypes.call(this);var t=this.collectionView;if(wijmo_1.hasItems(t)){var o=t.items[0];this._layout&&this._layout._updateCellTypes(o);this._hdrLayout&&this._hdrLayout._updateCellTypes(o)}};MultiRow.prototype._getBindingColumn=function(e,t,o){if(o&&(e==this.cells||e==this.columnHeaders)){var r=e.cellType==wijmo_grid_1.CellType.ColumnHeader;r&&t--;o=this._getGroupByColumn(o.index,r).getBindingColumn(e,t,o.index)}return o};MultiRow.prototype._getBindingColumns=function(){var e=[];this._layout._bindingGroups.forEach((function(t){t._cols.forEach((function(t){e.indexOf(t)<0&&e.push(t)}))}));return e};MultiRow.prototype._getRowsPerItem=function(){return this.rowsPerItem};MultiRow.prototype._cvCollectionChanged=function(e,t){if(this.autoGenerateColumns&&0==this.columns.length)this._bindGrid(!0);else{var o=wijmo_1.NotifyCollectionChangedAction;switch(t.action){case o.Change:this.invalidate();break;case o.Add:if(t.index==this.collectionView.items.length-1){for(var r=this.rows.length;r>0&&this.rows[r-1]instanceof wijmo_grid_1._NewRowTemplate;)r--;for(var i=0;i<this.rowsPerItem;i++)this.rows.insert(r+i,new _MultiRow(t.item,t.index,i));return}wijmo_1.assert(!1,"added item should be the last one.");break;default:this._bindGrid(!1)}}};MultiRow.prototype._getGroupByColumn=function(e,t){var o=null;t&&this._hdrLayout&&!this.collapsedHeaders&&(o=this._hdrLayout._getGroupByColumn(e));o||(o=this._layout._getGroupByColumn(e));wijmo_1.assert(o instanceof MultiRowCellGroup,"Failed to get the group!");return o};MultiRow.prototype._onLayoutChanged=function(){this.layoutDefinition=this._layoutDef};MultiRow.prototype._onHeaderLayoutChanged=function(){this.headerLayoutDefinition=this._hdrLayoutDef};MultiRow.prototype._formatItem=function(e,t){var o=this.rowsPerItem,r=t.panel,i=r.cellType,n=r.rows[t.range.row],l=r.rows[t.range.row2],a=t.cell,s=wijmo_grid_1.CellType;i==s.ColumnHeader&&wijmo_1.toggleClass(a,"wj-group-header",0==t.range.row);if(i==s.Cell||i==s.ColumnHeader){var u=this._getGroupByColumn(t.col,i==s.ColumnHeader);wijmo_1.toggleClass(a,"wj-group-start",u._colstart==t.range.col);wijmo_1.toggleClass(a,"wj-group-end",u._colstart+u._colspanEff-1==t.range.col2)}if(o>1&&(i==s.Cell||i==s.RowHeader)){var _=n instanceof _MultiRow||n instanceof _MultiRowNewRowTemplate,c=l instanceof _MultiRow||l instanceof _MultiRowNewRowTemplate;wijmo_1.toggleClass(a,"wj-record-start",!!_&&0==n.recordIndex);wijmo_1.toggleClass(a,"wj-record-end",!!c&&l.recordIndex==o-1)}var w=this.alternatingRowStep;if(w){var d=!1;if(n instanceof _MultiRow){d=n.dataIndex%(w+1)==0;1==w&&(d=!d)}wijmo_1.toggleClass(a,"wj-alt",d)}if(this._centerVert&&!a.getAttribute("wj-state-measuring")){var p=t.range.rowSpan>1;if(p&&t.updateContent)if(0==a.childElementCount)a.innerHTML="<div>"+a.innerHTML+"</div>";else{var h=document.createElement("div"),f=document.createRange();f.selectNodeContents(a);f.surroundContents(h)}wijmo_1.toggleClass(a,"wj-center-vert",p)}};MultiRow.prototype._updateButtonGlyph=function(){var e=this._btnCollapse.querySelector("span");e instanceof HTMLElement&&(e.className=this.collapsedHeaders?"wj-glyph-left":"wj-glyph-down-left")};MultiRow.prototype._getError=function(t,o,r,i){if(wijmo_1.isFunction(this.itemValidator)&&t==this.rowHeaders){for(var n=[],l=0;l<this.rowsPerItem;l++)for(r=0;r<this.columns.length;r++){var a=this.itemValidator(o+l,r,i);if(a){var s=this.getMergedRange(this.cells,o+l,r);s&&(s.columnSpan>1&&s.col<r||s.rowSpan>1&&s.row<o+l)||n.push(a)}}if(n.length){var u=this.errorTip,_=!!u&&u.isContentHtml;return n.join(_?"<br/>":"\n")}}return e.prototype._getError.call(this,t,o,r,i)};MultiRow.prototype._getEmptyRequiredCell=function(e){if(e>=0){e-=this.rows[e].recordIndex;for(var t=0;t<this._getRowsPerItem();t++)for(var o=e+t,r=0;r<this.columns.length;r++){var i=this._getBindingColumn(this.cells,o,this.columns[r]),n=this.getCellData(o,r,!1);if(i.getIsRequired(this.rows[o])&&(""===n||null==n)){if(!i.isReadOnly)return new wijmo_grid_1.CellRange(o,r);console.warn("Incorrect data. Column "+r+" is at the same time required, empty and read-only")}}}return null};return MultiRow}(wijmo_grid_1.FlexGrid);exports.MultiRow=MultiRow;var _MergeManager=function(e){__extends(_MergeManager,e);function _MergeManager(){return null!==e&&e.apply(this,arguments)||this}_MergeManager.prototype.getMergedRange=function(e,t,o,r){void 0===r&&(r=!0);var i=e.grid;if(t<0||t>=e.rows.length||o<0||o>=e.columns.length)return null;switch(e.cellType){case wijmo_grid_1.CellType.Cell:case wijmo_grid_1.CellType.RowHeader:if(e.rows[t]instanceof wijmo_grid_1.GroupRow&&!i.multiRowGroupHeaders)return this._getGroupRowMergedRange(e,t,o,r,!1)}switch(e.cellType){case wijmo_grid_1.CellType.Cell:if(e.rows[t]instanceof wijmo_grid_1.GroupRow)return this._getGroupRowMergedRange(e,t,o,r,i.multiRowGroupHeaders);case wijmo_grid_1.CellType.ColumnHeader:var n=e.cellType==wijmo_grid_1.CellType.ColumnHeader,l=i._getGroupByColumn(o,n);wijmo_1.assert(l instanceof MultiRowCellGroup,"Failed to get the group!");var a=n?l.getMergedRange(e,t-1,o):l.getMergedRange(e,t,o),s=e.columns.frozen;if(s&&a&&a.columnSpan>1&&a.col<s&&a.col2>=s){a=a.clone();o<s?a.col2=s-1:a.col=s}var u=e.rows.frozen;if(u&&a&&a.rowSpan>1&&e.cellType==wijmo_grid_1.CellType.Cell&&a.row<u&&a.row2>=u){a=a.clone();t<u?a.row2=u-1:a.row=u}wijmo_1.assert(!a||a.contains(t,o),"Merged range must contain source cell");return a;case wijmo_grid_1.CellType.RowHeader:var _=i.rowsPerItem,c=t-e.rows[t].recordIndex,w=Math.min(c+_-1,e.rows.length-1);return new wijmo_grid_1.CellRange(c,0,w,e.columns.length-1);case wijmo_grid_1.CellType.TopLeft:var d=i.collapsedHeaders,p=e.rows.length-1,h=p>0?1:0,f=0!=d?0:h,g=1!=d?p:h;return new wijmo_grid_1.CellRange(f,0,g,e.columns.length-1)}return null};_MergeManager.prototype._getGroupRowMergedRange=function(t,o,r,i,n){void 0===i&&(i=!0);var l=t.grid,a=t.cellType,s=t.rows[o];if(l.showGroups&&!l.childItemsPath&&s instanceof _MultiGroupRow&&s.dataItem instanceof wijmo_1.CollectionViewGroup&&a==wijmo_grid_1.CellType.Cell){return l._layout._getGroupHeaderMergedRange(t,o,r,n)}return e.prototype.getMergedRange.call(this,t,o,r,i)};return _MergeManager}(wijmo_grid_1.MergeManager);exports._MergeManager=_MergeManager;var _MultiRowAddNewHandler=function(e){__extends(_MultiRowAddNewHandler,e);function _MultiRowAddNewHandler(t){t._addHdl._detach();return e.call(this,t)||this}_MultiRowAddNewHandler.prototype.updateNewRowTemplate=function(){for(var e=this._g.editableCollectionView,t=this._g,o=t.rows,r=e&&e.canAddNew&&t.allowAddNew&&!t.isReadOnly,i=-1,n=0;n<o.length;n+=t.rowsPerItem)if(o[n]instanceof _MultiRowNewRowTemplate){i=n;break}if(r&&i>-1&&(this._top&&i>0||!this._top&&0==i)){i=-1;this._removeNewRowTemplate()}if(r&&i<0)for(n=0;n<t.rowsPerItem;n++){var l=new _MultiRowNewRowTemplate(n);0==n&&(this._nrt=l);this._top?o.insert(n,l):o.push(l)}!r&&i>-1&&this._removeNewRowTemplate()};_MultiRowAddNewHandler.prototype._keydown=function(t){e.prototype._keydown.call(this,t);t.defaultPrevented||t.keyCode!=wijmo_1.Key.Escape||this._copyNewDataItem()};_MultiRowAddNewHandler.prototype._beginningEdit=function(t,o){e.prototype._beginningEdit.call(this,t,o);this._top&&this._copyNewDataItem()};_MultiRowAddNewHandler.prototype._rowEditStarting=function(t,o){e.prototype._rowEditStarting.call(this,t,o);this._top&&this._copyNewDataItem()};_MultiRowAddNewHandler.prototype._rowEditEnded=function(t,o){e.prototype._rowEditEnded.call(this,t,o);this._copyNewDataItem()};_MultiRowAddNewHandler.prototype._copyNewDataItem=function(){if(this._top)for(var e=this._g,t=e.rows,o=0;o<e.rowsPerItem;o++)t[o]instanceof wijmo_grid_1._NewRowTemplate&&(t[o].dataItem=this._nrt.dataItem)};_MultiRowAddNewHandler.prototype._removeNewRowTemplate=function(){for(var e=0,t=this._g.rows;e<t.length;e++)if(t[e]instanceof wijmo_grid_1._NewRowTemplate){t.removeAt(e);e--}};return _MultiRowAddNewHandler}(wijmo_grid_1._AddNewHandler);exports._MultiRowAddNewHandler=_MultiRowAddNewHandler;var _MultiRowNewRowTemplate=function(e){__extends(_MultiRowNewRowTemplate,e);function _MultiRowNewRowTemplate(t){var o=e.call(this)||this;o._idxRecord=t;return o}Object.defineProperty(_MultiRowNewRowTemplate.prototype,"recordIndex",{get:function(){return this._idxRecord},enumerable:!0,configurable:!0});return _MultiRowNewRowTemplate}(wijmo_grid_1._NewRowTemplate);exports._MultiRowNewRowTemplate=_MultiRowNewRowTemplate;wijmo_1._registerModule("wijmo.grid.multirow",selfModule);
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@mescius/wijmo.grid.multirow",
3
+ "version": "5.20232.939",
4
+ "description": "UI library for pure JS, Angular, React, Vue and more...",
5
+ "author": "MESCIUS inc",
6
+ "license": "Commercial",
7
+ "main": "./index.js",
8
+ "types": "./index.d.ts",
9
+ "dependencies": {
10
+ "@mescius/wijmo": "5.20232.939",
11
+ "@mescius/wijmo.input": "5.20232.939",
12
+ "@mescius/wijmo.grid": "5.20232.939"
13
+ },
14
+ "homepage": "https://developer.mescius.com/wijmo",
15
+ "bugs": {
16
+ "url": "https://developer.mescius.com/forums/wijmo"
17
+ },
18
+ "keywords": [
19
+ "control",
20
+ "component",
21
+ "ui",
22
+ "control library",
23
+ "component library",
24
+ "ui library",
25
+ "control-library",
26
+ "component-library",
27
+ "ui-library",
28
+ "grid",
29
+ "data grid",
30
+ "data-grid",
31
+ "datagrid",
32
+ "angular grid",
33
+ "react grid",
34
+ "vue grid",
35
+ "angular-grid",
36
+ "react-grid",
37
+ "vue-grid"
38
+ ],
39
+ "module": "./es5-esm.js",
40
+ "esm5": "./es5-esm.js",
41
+ "wj-esm5": "./es5-esm.js",
42
+ "es2015Cjs": "./es2015-commonjs.js",
43
+ "wj-es2015Cjs": "./es2015-commonjs.js",
44
+ "esm2015": "./es2015-esm.js",
45
+ "wj-esm2015": "./es2015-esm.js"
46
+ }