@refinitiv-ui/efx-grid 6.0.7 → 6.0.9
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/lib/column-dragging/es6/index.js +1 -1
- package/lib/grid/index.js +1 -1
- package/lib/grid/lib/efx-grid.d.ts +3 -3
- package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
- package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/grid/themes/halo/light/efx-grid.js +1 -1
- package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/grid/themes/solar/charcoal/efx-grid.js +1 -1
- package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
- package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
- package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
- package/lib/row-segmenting/es6/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +205 -69
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.d.ts +4 -0
- package/lib/rt-grid/es6/Grid.js +26 -0
- package/lib/rt-grid/es6/index.js +3 -3
- package/lib/statistics-row/es6/index.js +1 -1
- package/lib/tr-grid-auto-tooltip/es6/index.js +1 -1
- package/lib/tr-grid-cell-selection/es6/index.js +1 -1
- package/lib/tr-grid-checkbox/es6/index.js +1 -1
- package/lib/tr-grid-column-fitter/es6/index.js +1 -1
- package/lib/tr-grid-column-formatting/es6/index.js +1 -1
- package/lib/tr-grid-column-grouping/es6/index.js +1 -1
- package/lib/tr-grid-column-resizing/es6/index.js +1 -1
- package/lib/tr-grid-column-selection/es6/index.js +1 -1
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +15 -1
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +261 -19
- package/lib/tr-grid-column-stack/es6/index.js +1 -1
- package/lib/tr-grid-conditional-coloring/es6/index.js +1 -1
- package/lib/tr-grid-content-wrap/es6/index.js +1 -1
- package/lib/tr-grid-contextmenu/es6/index.js +1 -1
- package/lib/tr-grid-filter-input/es6/index.js +1 -1
- package/lib/tr-grid-heat-map/es6/index.js +1 -1
- package/lib/tr-grid-in-cell-editing/es6/index.js +1 -1
- package/lib/tr-grid-pagination/es6/index.js +1 -1
- package/lib/tr-grid-percent-bar/es6/index.js +1 -1
- package/lib/tr-grid-printer/es6/index.js +1 -1
- package/lib/tr-grid-range-bar/es6/index.js +1 -1
- package/lib/tr-grid-row-dragging/es6/index.js +1 -1
- package/lib/tr-grid-row-filtering/es6/index.js +1 -1
- package/lib/tr-grid-row-grouping/es6/index.js +1 -1
- package/lib/tr-grid-row-selection/es6/index.js +1 -1
- package/lib/tr-grid-rowcoloring/es6/index.js +1 -1
- package/lib/tr-grid-textformatting/es6/index.js +1 -1
- package/lib/tr-grid-titlewrap/es6/index.js +1 -1
- package/lib/tr-grid-util/es6/RowPainter.js +6 -1
- package/lib/types/es6/ColumnStack.d.ts +15 -1
- package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +2 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +4 -0
- package/lib/versions.json +2 -2
- package/lib/zoom/es6/index.js +1 -1
- package/package.json +2 -2
@@ -229,6 +229,10 @@ declare class Grid extends EventDispatcher {
|
|
229
229
|
|
230
230
|
public setRowData(rowRef: Grid.RowReference|null, values: any): void;
|
231
231
|
|
232
|
+
public setStaticRowData(rowRef: Grid.RowReference|null, values: any): void;
|
233
|
+
|
234
|
+
public setStaticData(rowRef: Grid.RowReference|null, field: string, value: any): void;
|
235
|
+
|
232
236
|
public getColumnIndex(colRef: Grid.ColumnReference|null): number;
|
233
237
|
|
234
238
|
public getColumnIndices(colRefs: (Grid.ColumnReference)[]|null): (number)[];
|
package/lib/rt-grid/es6/Grid.js
CHANGED
@@ -2543,6 +2543,32 @@ Grid.prototype.setRowData = function(rowRef, values) {
|
|
2543
2543
|
rowDef.setRowData(values);
|
2544
2544
|
}
|
2545
2545
|
};
|
2546
|
+
|
2547
|
+
/**
|
2548
|
+
* @public
|
2549
|
+
* @param {Grid~RowReference} rowRef
|
2550
|
+
* @param {Object} values
|
2551
|
+
*/
|
2552
|
+
Grid.prototype.setStaticRowData = function(rowRef, values) {
|
2553
|
+
var rowDef = this._getRowDefinition(rowRef);
|
2554
|
+
if(rowDef) {
|
2555
|
+
rowDef.setStaticRowData(values);
|
2556
|
+
}
|
2557
|
+
};
|
2558
|
+
|
2559
|
+
/**
|
2560
|
+
* @public
|
2561
|
+
* @param {Grid~RowReference} rowRef
|
2562
|
+
* @param {string} field
|
2563
|
+
* @param {*} value
|
2564
|
+
*/
|
2565
|
+
Grid.prototype.setStaticData = function(rowRef, field, value) {
|
2566
|
+
var rowDef = this._getRowDefinition(rowRef);
|
2567
|
+
if(rowDef) {
|
2568
|
+
rowDef.setStaticData(field, value);
|
2569
|
+
}
|
2570
|
+
};
|
2571
|
+
|
2546
2572
|
/** @private
|
2547
2573
|
* @param {Grid~RowReference=} rowRef
|
2548
2574
|
* @return {string}
|
package/lib/rt-grid/es6/index.js
CHANGED
@@ -3,9 +3,9 @@ import {Grid} from "./Grid.js";
|
|
3
3
|
/* eslint-enable */
|
4
4
|
|
5
5
|
// tsd-disable
|
6
|
-
import {MockJET} from "
|
7
|
-
import {Dom} from "
|
8
|
-
import {CellPainter} from "
|
6
|
+
import {MockJET} from "../../tr-grid-util/es6/jet/MockJET.js";
|
7
|
+
import {Dom} from "../../tr-grid-util/es6/Dom.js";
|
8
|
+
import {CellPainter} from "../../tr-grid-util/es6/CellPainter.js";
|
9
9
|
|
10
10
|
if (window) {
|
11
11
|
var trNamespace = window['tr'];
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./StatisticsRow";
|
1
|
+
export * from "./StatisticsRow.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./AutoTooltip";
|
1
|
+
export * from "./AutoTooltip.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./CellSelection";
|
1
|
+
export * from "./CellSelection.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./Checkbox";
|
1
|
+
export * from "./Checkbox.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./ColumnFitter";
|
1
|
+
export * from "./ColumnFitter.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./ColumnFormatting";
|
1
|
+
export * from "./ColumnFormatting.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./ColumnGrouping";
|
1
|
+
export * from "./ColumnGrouping.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./ColumnResizing";
|
1
|
+
export * from "./ColumnResizing.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./ColumnSelection";
|
1
|
+
export * from "./ColumnSelection.js";
|
@@ -66,7 +66,7 @@ declare class ColumnStackPlugin extends GridPlugin {
|
|
66
66
|
|
67
67
|
public getStackId(colIndex: number): string;
|
68
68
|
|
69
|
-
public stackColumns(colRefs?: (number|string)[]|null, stackId?: string|null, options?: any): boolean;
|
69
|
+
public stackColumns(colRefs?: (number|string)[]|null, stackId?: string|null, options?: any, sort?: boolean|null): boolean;
|
70
70
|
|
71
71
|
public setStack(colRefs?: (number|string)[]|null): boolean;
|
72
72
|
|
@@ -76,6 +76,20 @@ declare class ColumnStackPlugin extends GridPlugin {
|
|
76
76
|
|
77
77
|
public swapColumn(colRef: number|Event|null, swappingIndex: number): boolean;
|
78
78
|
|
79
|
+
public getStackMemberIndices(stackId: string): (number)[];
|
80
|
+
|
81
|
+
public getStackMemberIds(stackId: string): (string)[];
|
82
|
+
|
83
|
+
public getColumnIdsByIndex(columnIndex: number|(number)[]|null): (string)[];
|
84
|
+
|
85
|
+
public getColumnIndicesByColumnIds(columnId: string|(string)[]|null): (string)[];
|
86
|
+
|
87
|
+
public addColumnToStack(colRef: number|string|null, stackId: string): void;
|
88
|
+
|
89
|
+
public removeColumnFromStack(colRef: number|string|null): void;
|
90
|
+
|
91
|
+
public reorderStackColumns(colRefs: (number|string)[]|null, stackId: string): void;
|
92
|
+
|
79
93
|
}
|
80
94
|
|
81
95
|
export default ColumnStackPlugin;
|
@@ -35,10 +35,12 @@ var ColumnStackPlugin = function () {
|
|
35
35
|
this._onColumnAdded = this._onColumnAdded.bind(this);
|
36
36
|
this._onStackButtonClicked = this._onStackButtonClicked.bind(this);
|
37
37
|
this._updateUI = this._updateUI.bind(this);
|
38
|
+
this._setStack = this._setStack.bind(this);
|
38
39
|
this._hosts = [];
|
39
40
|
this._stacks = {};
|
40
41
|
|
41
42
|
this._conflator = new Conflator(100, this._updateUI);
|
43
|
+
this._stackConflator = new Conflator(100, this._setStack);
|
42
44
|
};
|
43
45
|
|
44
46
|
Ext.inherits(ColumnStackPlugin, GridPlugin);
|
@@ -133,6 +135,7 @@ ColumnStackPlugin.prototype.unload = function (host) {
|
|
133
135
|
|
134
136
|
if(this._hosts.length <= 0) {
|
135
137
|
this._conflator.reset();
|
138
|
+
this._stackConflator.reset();
|
136
139
|
this._stacks = {};
|
137
140
|
}
|
138
141
|
this._dispose();
|
@@ -384,6 +387,9 @@ ColumnStackPlugin.prototype._moveStackedColumns = function (stackRefs) {
|
|
384
387
|
for(var i = 1; i < len; ++i) {
|
385
388
|
var fromIndex = this._getColumnIndex(stackRefs[i]);
|
386
389
|
var destIndex = this._getColumnIndex(stackRefs[0]); // Active Column may be shifted due to the move
|
390
|
+
if(fromIndex < destIndex){
|
391
|
+
destIndex -= 1;
|
392
|
+
}
|
387
393
|
this._moveColumn(fromIndex, destIndex + i);
|
388
394
|
}
|
389
395
|
};
|
@@ -766,14 +772,15 @@ ColumnStackPlugin.prototype.getStackId = function(colIndex) {
|
|
766
772
|
* @param {Array.<number|string>=} colRefs Names of fields or column indices. If not specified, selected columns will be used.
|
767
773
|
* @param {string=} stackId Must be unique
|
768
774
|
* @param {Object=} options
|
775
|
+
* @param {boolean=} sort Default to true. If enable and colRefs are column indices, column in stack will be sorted
|
769
776
|
* @return {boolean} Return true if all of the given columns is stacked together
|
770
777
|
*/
|
771
|
-
ColumnStackPlugin.prototype.stackColumns = function(colRefs, stackId, options) {
|
778
|
+
ColumnStackPlugin.prototype.stackColumns = function(colRefs, stackId, options, sort) {
|
772
779
|
if(!colRefs) {
|
773
780
|
colRefs = this._getSelectedColumns();
|
774
781
|
}
|
775
782
|
|
776
|
-
var needSorting = true;
|
783
|
+
var needSorting = sort !== null ? sort : true;
|
777
784
|
if(colRefs.length) {
|
778
785
|
if(typeof colRefs[0] === "string") {// Do not sort in the case of field stack
|
779
786
|
needSorting = false;
|
@@ -826,14 +833,12 @@ ColumnStackPlugin.prototype.stackColumns = function(colRefs, stackId, options) {
|
|
826
833
|
}
|
827
834
|
}
|
828
835
|
|
836
|
+
// Make sure that all columns stay packed together
|
837
|
+
this._moveStackedColumns(stack.stackRefs);
|
838
|
+
|
829
839
|
if(stack.spreading) {
|
830
|
-
// Make sure that all columns stay packed together
|
831
|
-
this._moveStackedColumns(stack.stackRefs);
|
832
840
|
stack.activeColumn = stack.stackRefs[stack.stackRefs.length - 1]; // Right most column is the active column
|
833
841
|
} else {
|
834
|
-
// Do not move column here to prevent column header from being unrendered because of swapped column index in header binding.
|
835
|
-
// Stacked columns will be moved in the unstacking method.
|
836
|
-
// TODO: Column title will not be rendered in Realtime Grid in the case of column added event.
|
837
842
|
stack.activeColumn = stack.stackRefs[0]; // Left most column is the active column
|
838
843
|
var csp = this._getPlugin("ColumnSelectionPlugin");
|
839
844
|
if(csp && csp.isEnabled()) {
|
@@ -944,6 +949,10 @@ ColumnStackPlugin.prototype.setStack = function(colRefs) {
|
|
944
949
|
this._setColumnVisibility(colIndex, false);
|
945
950
|
}
|
946
951
|
}
|
952
|
+
|
953
|
+
// Make sure that all columns stay packed together
|
954
|
+
this._moveStackedColumns(stack.stackRefs);
|
955
|
+
|
947
956
|
stack.activeColumn = stack.stackRefs[0]; // The first stacking (the first given columns) is the active column
|
948
957
|
this._stacks[sid] = stack;
|
949
958
|
var cfp = this._getPlugin("ColumnFilterPlugin");
|
@@ -974,7 +983,7 @@ ColumnStackPlugin.prototype.unstackColumns = function(colIndices) {
|
|
974
983
|
if(!stackOpt) {
|
975
984
|
continue; // Invalid index
|
976
985
|
}
|
977
|
-
if(stackOpt.collapsed === true) {
|
986
|
+
if(stackOpt.collapsed === true && stackOpt.spreading === true) {
|
978
987
|
this.expandGroup(colIndex);
|
979
988
|
}
|
980
989
|
stacks[stackOpt.stackId] = 1; // Exclude duplicate stacks
|
@@ -992,9 +1001,6 @@ ColumnStackPlugin.prototype.unstackColumns = function(colIndices) {
|
|
992
1001
|
dirty = true;
|
993
1002
|
|
994
1003
|
var stackRefs = stack.stackRefs;
|
995
|
-
if(stack.spreading !== true) {
|
996
|
-
this._moveStackedColumns(stackRefs);
|
997
|
-
}
|
998
1004
|
len = stackRefs.length;
|
999
1005
|
if(stack.spreading) {
|
1000
1006
|
selFrom = this._getColumnIndex(stack.stackRefs[0]);
|
@@ -1038,9 +1044,6 @@ ColumnStackPlugin.prototype.removeAllStacks = function(enableUpdateUI) {
|
|
1038
1044
|
dirty = true;
|
1039
1045
|
|
1040
1046
|
var stackRefs = stack.stackRefs;
|
1041
|
-
if(stack.spreading !== true && enableUpdateUI) {
|
1042
|
-
this._moveStackedColumns(stackRefs);
|
1043
|
-
}
|
1044
1047
|
|
1045
1048
|
var len = stackRefs.length;
|
1046
1049
|
for(var i = 0; i < len; ++i) {
|
@@ -1297,11 +1300,7 @@ ColumnStackPlugin.prototype._onColumnAdded = function (e) {
|
|
1297
1300
|
|
1298
1301
|
var columnStack = this._columnStack;
|
1299
1302
|
if (columnStack) {
|
1300
|
-
|
1301
|
-
if (colIndices.length > 1) {
|
1302
|
-
this.removeAllStacks(false);
|
1303
|
-
this.stackColumns(columnStack.fields, null, columnStack);
|
1304
|
-
}
|
1303
|
+
this._setStack(); // asynchronous
|
1305
1304
|
} else {
|
1306
1305
|
// add to group
|
1307
1306
|
var leftStackOpt = this._getColumnStackOptions(colIndex - 1);
|
@@ -1364,6 +1363,249 @@ ColumnStackPlugin.prototype._onStackButtonClicked = function(e) {
|
|
1364
1363
|
this._dispatch("clicked", pos);
|
1365
1364
|
};
|
1366
1365
|
|
1366
|
+
/** Remove existing stacks and apply persist stack
|
1367
|
+
* @private
|
1368
|
+
*/
|
1369
|
+
ColumnStackPlugin.prototype._setStack = function() {
|
1370
|
+
if(this._stackConflator.conflate()) {
|
1371
|
+
return;
|
1372
|
+
}
|
1373
|
+
|
1374
|
+
var columnStack = this._columnStack;
|
1375
|
+
if(columnStack){
|
1376
|
+
var colIndices = this.getColumnIndices(columnStack.fields);
|
1377
|
+
if (colIndices.length > 1) {
|
1378
|
+
this.removeAllStacks(false);
|
1379
|
+
this.stackColumns(columnStack.fields, null, columnStack);
|
1380
|
+
}
|
1381
|
+
}
|
1382
|
+
};
|
1383
|
+
|
1384
|
+
/** @public
|
1385
|
+
* @description Get member column indices in a stack
|
1386
|
+
* @param {string} stackId
|
1387
|
+
* @return {!Array.<number>} Member column indices
|
1388
|
+
*/
|
1389
|
+
ColumnStackPlugin.prototype.getStackMemberIndices = function(stackId) {
|
1390
|
+
var memberIndices = [];
|
1391
|
+
if(stackId !== null) {
|
1392
|
+
var stack = this._stacks[stackId];
|
1393
|
+
if(stack){
|
1394
|
+
var stackRefs = stack.stackRefs;
|
1395
|
+
for(var i = 0; i < stackRefs.length; ++i) {
|
1396
|
+
var stackRef = stackRefs[i];
|
1397
|
+
var colIndex = this._getColumnIndex(stackRef);
|
1398
|
+
memberIndices.push(colIndex);
|
1399
|
+
}
|
1400
|
+
}
|
1401
|
+
}
|
1402
|
+
return memberIndices;
|
1403
|
+
};
|
1404
|
+
|
1405
|
+
/** @public
|
1406
|
+
* @description Get list member column id in a stack
|
1407
|
+
* @param {string} stackId
|
1408
|
+
* @return {!Array.<string>} Member column ids
|
1409
|
+
*/
|
1410
|
+
ColumnStackPlugin.prototype.getStackMemberIds = function(stackId) {
|
1411
|
+
var memberIndices = this.getStackMemberIndices(stackId);
|
1412
|
+
return this.getColumnIdsByIndex(memberIndices);
|
1413
|
+
};
|
1414
|
+
|
1415
|
+
/** @public
|
1416
|
+
* @description Get column id by column index or indices
|
1417
|
+
* @param {number|Array<number>} columnIndex
|
1418
|
+
* @return {!Array.<string>} Column ids
|
1419
|
+
*/
|
1420
|
+
ColumnStackPlugin.prototype.getColumnIdsByIndex = function(columnIndex) {
|
1421
|
+
var colIndices = [];
|
1422
|
+
var colIds = [];
|
1423
|
+
if(Array.isArray(columnIndex)){
|
1424
|
+
colIndices = columnIndex;
|
1425
|
+
} else {
|
1426
|
+
colIndices.push(colIds);
|
1427
|
+
}
|
1428
|
+
for(var i = 0; i < colIndices.length; ++i) {
|
1429
|
+
var colId = this.getColumnId(colIndices[i]);
|
1430
|
+
colIds.push(colId);
|
1431
|
+
}
|
1432
|
+
return colIds;
|
1433
|
+
};
|
1434
|
+
|
1435
|
+
/** @public
|
1436
|
+
* @description Get column indices by column ids
|
1437
|
+
* @param {string|Array<string>} columnId
|
1438
|
+
* @return {!Array.<string>} Column indices
|
1439
|
+
*/
|
1440
|
+
ColumnStackPlugin.prototype.getColumnIndicesByColumnIds = function(columnId) {
|
1441
|
+
var colIndices = [];
|
1442
|
+
var colIds = [];
|
1443
|
+
if(Array.isArray(columnId)){
|
1444
|
+
colIds = columnId;
|
1445
|
+
} else {
|
1446
|
+
colIds.push(colIds);
|
1447
|
+
}
|
1448
|
+
for(var i = 0; i < colIds.length; ++i) {
|
1449
|
+
var colId = this.getColumnIndex(colIds[i]);
|
1450
|
+
colIndices.push(colId);
|
1451
|
+
}
|
1452
|
+
return colIndices;
|
1453
|
+
};
|
1454
|
+
|
1455
|
+
/** @public
|
1456
|
+
* @description Add specific column to a stack
|
1457
|
+
* @param {number|string} colRef column field or column index
|
1458
|
+
* @param {string} stackId
|
1459
|
+
*/
|
1460
|
+
ColumnStackPlugin.prototype.addColumnToStack = function(colRef, stackId) {
|
1461
|
+
if(typeof colRef === "string") {
|
1462
|
+
var colIndices = this.getColumnIndices([colRef]);
|
1463
|
+
if(colIndices.length){
|
1464
|
+
colRef = colIndices[0];
|
1465
|
+
}
|
1466
|
+
}
|
1467
|
+
|
1468
|
+
var stack = this._stacks[stackId];
|
1469
|
+
var isColumnStackable = this.isColumnStackable([colRef]);
|
1470
|
+
|
1471
|
+
// if column not stackable or destination stack not exist, do nothing
|
1472
|
+
if(!isColumnStackable || !stack){
|
1473
|
+
return;
|
1474
|
+
}
|
1475
|
+
|
1476
|
+
var isCollapsed = stack.spreading && stack.collapsed;
|
1477
|
+
if(isCollapsed){
|
1478
|
+
this.expandGroup(this._getColumnIndex(stack.activeColumn));
|
1479
|
+
}
|
1480
|
+
|
1481
|
+
// Prevent from flashing in stack mode
|
1482
|
+
if(colRef !== activeIndex && stack.collapsed !== false) {
|
1483
|
+
this._setColumnVisibility(colRef, false);
|
1484
|
+
}
|
1485
|
+
|
1486
|
+
// apply stacking
|
1487
|
+
this._setColumnStackOptions(colRef, stack);
|
1488
|
+
stack.stackRefs.push(this._getColumnStacking(colRef));
|
1489
|
+
|
1490
|
+
if(stack.spreading) {
|
1491
|
+
stack.activeColumn = stack.stackRefs[stack.stackRefs.length - 1];
|
1492
|
+
stack.collapsed = isCollapsed;
|
1493
|
+
} else {
|
1494
|
+
stack.activeColumn = stack.stackRefs[0];
|
1495
|
+
}
|
1496
|
+
|
1497
|
+
var activeIndex = this._getColumnIndex(stack.activeColumn);
|
1498
|
+
|
1499
|
+
// Pack stacked columns together
|
1500
|
+
this._moveStackedColumns(stack.stackRefs);
|
1501
|
+
|
1502
|
+
this._updateUI();
|
1503
|
+
};
|
1504
|
+
|
1505
|
+
/** @public
|
1506
|
+
* @description Remove specific column from a stack
|
1507
|
+
* @param {number|string} colRef column field or column index
|
1508
|
+
*/
|
1509
|
+
ColumnStackPlugin.prototype.removeColumnFromStack = function(colRef) {
|
1510
|
+
if(typeof colRef === "string") {
|
1511
|
+
var colIndices = this.getColumnIndices([colRef]);
|
1512
|
+
if(colIndices.length){
|
1513
|
+
colRef = colIndices[0];
|
1514
|
+
}
|
1515
|
+
}
|
1516
|
+
|
1517
|
+
var stackId = this.getStackId(colRef);
|
1518
|
+
var stack = this._stacks[stackId];
|
1519
|
+
if(!stack || colRef == -1) {
|
1520
|
+
return; // Invalid column index or stackId
|
1521
|
+
}
|
1522
|
+
|
1523
|
+
var stackMembers = this.getStackMemberIndices(stackId);
|
1524
|
+
var stackRefs = stack.stackRefs;
|
1525
|
+
|
1526
|
+
if(stackMembers.length < 3){
|
1527
|
+
this.unstackColumns(stackMembers);
|
1528
|
+
} else {
|
1529
|
+
var isCollapsed = stack.spreading && stack.collapsed;
|
1530
|
+
|
1531
|
+
for(var i = 0; i < stackRefs.length; ++i) {
|
1532
|
+
var stackRef = stackRefs[i];
|
1533
|
+
var colIndex = this._getColumnIndex(stackRef);
|
1534
|
+
|
1535
|
+
if(colIndex === colRef){
|
1536
|
+
if(isCollapsed) {
|
1537
|
+
this._collapseMember(stackMembers[i], false);
|
1538
|
+
}
|
1539
|
+
stackRefs.splice(i, 1);
|
1540
|
+
break;
|
1541
|
+
}
|
1542
|
+
}
|
1543
|
+
|
1544
|
+
this._removeColumnStackOptions(colRef);
|
1545
|
+
this._setColumnVisibility(colRef, true);
|
1546
|
+
|
1547
|
+
if(stack.spreading) {
|
1548
|
+
stack.activeColumn = stackRefs[stackRefs.length - 1];
|
1549
|
+
stack.collapsed = isCollapsed;
|
1550
|
+
} else {
|
1551
|
+
stack.activeColumn = stackRefs[0];
|
1552
|
+
}
|
1553
|
+
this._stacks[stackId] = stack;
|
1554
|
+
|
1555
|
+
this._moveStackedColumns(stack.stackRefs);
|
1556
|
+
this._updateUI();
|
1557
|
+
}
|
1558
|
+
};
|
1559
|
+
|
1560
|
+
/** @public
|
1561
|
+
* @description Reorder columns in a stack
|
1562
|
+
* @param {Array.<number|string>} colRefs column fields or column indices
|
1563
|
+
* @param {string} stackId
|
1564
|
+
*/
|
1565
|
+
ColumnStackPlugin.prototype.reorderStackColumns = function(colRefs, stackId) {
|
1566
|
+
var stack = this._stacks[stackId];
|
1567
|
+
if(!stack) {
|
1568
|
+
return;
|
1569
|
+
}
|
1570
|
+
|
1571
|
+
var stackMemberIndices = this.getStackMemberIndices(stackId);
|
1572
|
+
var stackMemberCount = stackMemberIndices.length;
|
1573
|
+
var len = colRefs.length;
|
1574
|
+
if(len) {
|
1575
|
+
if(typeof colRefs[0] === "string") {
|
1576
|
+
colRefs = this.getColumnIndices(colRefs);
|
1577
|
+
}
|
1578
|
+
}
|
1579
|
+
|
1580
|
+
var newStackMembers = [];
|
1581
|
+
for(var i = 0; i < len; i++ ){
|
1582
|
+
var colIndex = colRefs[i];
|
1583
|
+
if(stackMemberIndices.indexOf(colIndex) !== -1){
|
1584
|
+
newStackMembers.push(colIndex);
|
1585
|
+
}
|
1586
|
+
}
|
1587
|
+
if(newStackMembers.length !== stackMemberCount){
|
1588
|
+
for(i = 0; i < stackMemberCount; i++ ){
|
1589
|
+
var columnIndex = stackMemberIndices[i];
|
1590
|
+
if(newStackMembers.indexOf(columnIndex) === -1){
|
1591
|
+
newStackMembers.push(columnIndex);
|
1592
|
+
if(newStackMembers.length === stackMemberCount){
|
1593
|
+
break;
|
1594
|
+
}
|
1595
|
+
}
|
1596
|
+
}
|
1597
|
+
}
|
1598
|
+
|
1599
|
+
var options = {
|
1600
|
+
spreading: stack.spreading,
|
1601
|
+
collapsed: stack.collapsed
|
1602
|
+
};
|
1603
|
+
|
1604
|
+
this.unstackColumns(stackMemberIndices);
|
1605
|
+
this.stackColumns(newStackMembers, stackId, options, false);
|
1606
|
+
|
1607
|
+
};
|
1608
|
+
|
1367
1609
|
|
1368
1610
|
export default ColumnStackPlugin;
|
1369
1611
|
export { ColumnStackPlugin, ColumnStackPlugin as ColumnStack, ColumnStackPlugin as ColumnStackExtension };
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./ColumnStack";
|
1
|
+
export * from "./ColumnStack.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./ConditionalColoring";
|
1
|
+
export * from "./ConditionalColoring.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./ContentWrap";
|
1
|
+
export * from "./ContentWrap.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./ContextMenu";
|
1
|
+
export * from "./ContextMenu.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./FilterInput";
|
1
|
+
export * from "./FilterInput.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./HeatMap";
|
1
|
+
export * from "./HeatMap.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./InCellEditing";
|
1
|
+
export * from "./InCellEditing.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./Pagination";
|
1
|
+
export * from "./Pagination.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./PercentBar";
|
1
|
+
export * from "./PercentBar.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./GridPrinter";
|
1
|
+
export * from "./GridPrinter.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./RangeBar";
|
1
|
+
export * from "./RangeBar.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./RowDragging";
|
1
|
+
export * from "./RowDragging.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./RowFiltering";
|
1
|
+
export * from "./RowFiltering.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./RowGrouping";
|
1
|
+
export * from "./RowGrouping.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./RowSelection";
|
1
|
+
export * from "./RowSelection.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./RowColoring";
|
1
|
+
export * from "./RowColoring.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./TextFormatting";
|
1
|
+
export * from "./TextFormatting.js";
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./TitleWrap";
|
1
|
+
export * from "./TitleWrap.js";
|
@@ -289,7 +289,12 @@ RowPainter.prototype.applyHeaderStyle = function(e) {
|
|
289
289
|
|
290
290
|
section.enableRowClass(e.rowIndex, "group-member", false);
|
291
291
|
if (stretching) {
|
292
|
-
|
292
|
+
var stretchedCell = section.getStretchedCell(mainCol, r);
|
293
|
+
if(!stretchedCell) {
|
294
|
+
cell = e.cell = section.stretchCell(mainCol, r, stretching, true); // No left stretching. Header background is covered by folder class
|
295
|
+
} else {
|
296
|
+
cell = e.cell = stretchedCell;
|
297
|
+
}
|
293
298
|
|
294
299
|
// Remove content from cells that are on left side of the stretched cell
|
295
300
|
this._clearCellContent(section, 0, mainCol, r, checkboxColumnIndex);
|
@@ -66,7 +66,7 @@ declare class ColumnStackPlugin extends GridPlugin {
|
|
66
66
|
|
67
67
|
public getStackId(colIndex: number): string;
|
68
68
|
|
69
|
-
public stackColumns(colRefs?: (number|string)[]|null, stackId?: string|null, options?: any): boolean;
|
69
|
+
public stackColumns(colRefs?: (number|string)[]|null, stackId?: string|null, options?: any, sort?: boolean|null): boolean;
|
70
70
|
|
71
71
|
public setStack(colRefs?: (number|string)[]|null): boolean;
|
72
72
|
|
@@ -76,6 +76,20 @@ declare class ColumnStackPlugin extends GridPlugin {
|
|
76
76
|
|
77
77
|
public swapColumn(colRef: number|Event|null, swappingIndex: number): boolean;
|
78
78
|
|
79
|
+
public getStackMemberIndices(stackId: string): (number)[];
|
80
|
+
|
81
|
+
public getStackMemberIds(stackId: string): (string)[];
|
82
|
+
|
83
|
+
public getColumnIdsByIndex(columnIndex: number|(number)[]|null): (string)[];
|
84
|
+
|
85
|
+
public getColumnIndicesByColumnIds(columnId: string|(string)[]|null): (string)[];
|
86
|
+
|
87
|
+
public addColumnToStack(colRef: number|string|null, stackId: string): void;
|
88
|
+
|
89
|
+
public removeColumnFromStack(colRef: number|string|null): void;
|
90
|
+
|
91
|
+
public reorderStackColumns(colRefs: (number|string)[]|null, stackId: string): void;
|
92
|
+
|
79
93
|
}
|
80
94
|
|
81
95
|
export default ColumnStackPlugin;
|
@@ -7,6 +7,8 @@ declare class CellFloatingPanel extends ElementWrapper {
|
|
7
7
|
|
8
8
|
public hasItem(): boolean;
|
9
9
|
|
10
|
+
public containItem(icon: Element|null): boolean;
|
11
|
+
|
10
12
|
public insertItem(item: Element|null, opt_order?: number|null): void;
|
11
13
|
|
12
14
|
public removeItem(elemRef?: (Element|string)|null): Element|null|null;
|
@@ -231,6 +231,10 @@ declare class Grid extends EventDispatcher {
|
|
231
231
|
|
232
232
|
public setRowData(rowRef: Grid.RowReference|null, values: any): void;
|
233
233
|
|
234
|
+
public setStaticRowData(rowRef: Grid.RowReference|null, values: any): void;
|
235
|
+
|
236
|
+
public setStaticData(rowRef: Grid.RowReference|null, field: string, value: any): void;
|
237
|
+
|
234
238
|
public getColumnIndex(colRef: Grid.ColumnReference|null): number;
|
235
239
|
|
236
240
|
public getColumnIndices(colRefs: (Grid.ColumnReference)[]|null): (number)[];
|
package/lib/versions.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"tr-grid-util": "1.3.
|
2
|
+
"tr-grid-util": "1.3.78",
|
3
3
|
"@grid/column-dragging": "1.0.10",
|
4
4
|
"@grid/row-segmenting": "1.0.20",
|
5
5
|
"@grid/statistics-row": "1.0.13",
|
@@ -12,7 +12,7 @@
|
|
12
12
|
"tr-grid-column-grouping": "1.0.24",
|
13
13
|
"tr-grid-column-resizing": "1.0.26",
|
14
14
|
"tr-grid-column-selection": "1.0.25",
|
15
|
-
"tr-grid-column-stack": "1.0.
|
15
|
+
"tr-grid-column-stack": "1.0.41",
|
16
16
|
"tr-grid-conditional-coloring": "1.0.56",
|
17
17
|
"tr-grid-content-wrap": "1.0.19",
|
18
18
|
"tr-grid-contextmenu": "1.0.38",
|
package/lib/zoom/es6/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * from "./Zoom";
|
1
|
+
export * from "./Zoom.js";
|