@refinitiv-ui/efx-grid 6.0.31 → 6.0.33
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/core/dist/core.js +376 -126
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/grid/Core.d.ts +4 -0
- package/lib/core/es6/grid/Core.js +79 -33
- package/lib/core/es6/grid/ILayoutGrid.js +3 -3
- package/lib/core/es6/grid/LayoutGrid.js +67 -23
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +92 -55
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +1 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +29 -5
- package/lib/core/es6/grid/util/SelectionList.d.ts +6 -2
- package/lib/core/es6/grid/util/SelectionList.js +76 -7
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +521 -179
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.js +14 -13
- package/lib/rt-grid/es6/RowDefinition.js +1 -1
- package/lib/statistics-row/es6/StatisticsRow.d.ts +25 -25
- package/lib/statistics-row/es6/StatisticsRow.js +9 -4
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +4 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +58 -30
- package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +2 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +14 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +2 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +35 -12
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +23 -1
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +339 -40
- package/lib/tr-grid-util/es6/GroupDefinitions.d.ts +2 -0
- package/lib/tr-grid-util/es6/GroupDefinitions.js +15 -0
- package/lib/tr-grid-util/es6/Util.d.ts +3 -0
- package/lib/tr-grid-util/es6/Util.js +15 -0
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/CollectionDict.js +12 -2
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +170 -47
- package/lib/types/es6/ColumnGrouping.d.ts +4 -0
- package/lib/types/es6/ColumnSelection.d.ts +2 -0
- package/lib/types/es6/ColumnStack.d.ts +2 -0
- package/lib/types/es6/Core/grid/util/SelectionList.d.ts +6 -2
- package/lib/types/es6/RowDragging.d.ts +23 -1
- package/lib/types/es6/StatisticsRow.d.ts +25 -25
- package/lib/versions.json +6 -6
- package/package.json +1 -1
package/lib/rt-grid/es6/Grid.js
CHANGED
@@ -2337,7 +2337,7 @@ Grid.prototype.removeRow = function(rowRef) {
|
|
2337
2337
|
if(this._mainGrid) {
|
2338
2338
|
return this._mainGrid.removeRow(this._getRowId(rowRef));
|
2339
2339
|
}
|
2340
|
-
var rowDef = this.
|
2340
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
2341
2341
|
if(rowDef) {
|
2342
2342
|
if(!rowDef.isAutoGenerated()) { // Users cannot remove auto-generated row by themselves
|
2343
2343
|
this._removeRow(rowDef);
|
@@ -2368,7 +2368,7 @@ Grid.prototype.removeRows = function(rowRefs) {
|
|
2368
2368
|
|
2369
2369
|
// Verify user input
|
2370
2370
|
for(i = 0; i < len; ++i) {
|
2371
|
-
rowDef = this.
|
2371
|
+
rowDef = this._getRowDefinitionByRef(rowRefs[i]);
|
2372
2372
|
if(rowDef) {
|
2373
2373
|
if(!rowDef.isAutoGenerated()) {
|
2374
2374
|
rowDefs.push(rowDef);
|
@@ -2504,7 +2504,7 @@ Grid.prototype.setRic = function(rowRef, str, options) {
|
|
2504
2504
|
this._mainGrid.setRic(this._toRowId(rowRef), str);
|
2505
2505
|
return;
|
2506
2506
|
}
|
2507
|
-
var rowDef = this.
|
2507
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
2508
2508
|
if(rowDef) {
|
2509
2509
|
options = options || {};
|
2510
2510
|
var newChain = false;
|
@@ -2539,7 +2539,7 @@ Grid.prototype.setRic = function(rowRef, str, options) {
|
|
2539
2539
|
* @param {Grid~RowReference} rowRef
|
2540
2540
|
*/
|
2541
2541
|
Grid.prototype.unlinkChain = function(rowRef) {
|
2542
|
-
var rowDef = this.
|
2542
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
2543
2543
|
if(!rowDef) {
|
2544
2544
|
return;
|
2545
2545
|
}
|
@@ -2718,7 +2718,8 @@ Grid.prototype.getRowType = function(rowRef) {
|
|
2718
2718
|
var rowDef = this.getRowDefinition(rowRef);
|
2719
2719
|
return rowDef ? rowDef.getType() : "";
|
2720
2720
|
};
|
2721
|
-
/**
|
2721
|
+
/** Get RowDefinition object by either number or row id
|
2722
|
+
* @public
|
2722
2723
|
* @param {number|string} rowRef Row index as shown in the view or row id (string)
|
2723
2724
|
* @return {RowDefinition}
|
2724
2725
|
*/
|
@@ -2748,7 +2749,7 @@ Grid.prototype._getRowDefinitionById = function(rowId) {
|
|
2748
2749
|
* @param {Grid~RowReference} rowRef
|
2749
2750
|
* @return {RowDefinition}
|
2750
2751
|
*/
|
2751
|
-
Grid.prototype.
|
2752
|
+
Grid.prototype._getRowDefinitionByRef = function(rowRef) {
|
2752
2753
|
if(rowRef instanceof RowDefinition) {
|
2753
2754
|
if(rowRef.getRowId()) { // The row may have been removed from the grid
|
2754
2755
|
return /** @type{!RowDefinition} */(rowRef);
|
@@ -2852,7 +2853,7 @@ Grid.prototype.setRicData = function(ric, values) {
|
|
2852
2853
|
* @param {Object} values {"FIELD1": value1, "FIELD2": value2, ...} Use null to remove current row data (not row in the view).
|
2853
2854
|
*/
|
2854
2855
|
Grid.prototype.setRowData = function(rowRef, values) {
|
2855
|
-
var rowDef = this.
|
2856
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
2856
2857
|
if(rowDef) {
|
2857
2858
|
rowDef.setRowData(values);
|
2858
2859
|
}
|
@@ -2864,7 +2865,7 @@ Grid.prototype.setRowData = function(rowRef, values) {
|
|
2864
2865
|
* @param {Object} values
|
2865
2866
|
*/
|
2866
2867
|
Grid.prototype.setStaticRowData = function(rowRef, values) {
|
2867
|
-
var rowDef = this.
|
2868
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
2868
2869
|
if(rowDef) {
|
2869
2870
|
rowDef.setStaticRowData(values);
|
2870
2871
|
}
|
@@ -2877,7 +2878,7 @@ Grid.prototype.setStaticRowData = function(rowRef, values) {
|
|
2877
2878
|
* @param {*} value
|
2878
2879
|
*/
|
2879
2880
|
Grid.prototype.setStaticData = function(rowRef, field, value) {
|
2880
|
-
var rowDef = this.
|
2881
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
2881
2882
|
if(rowDef) {
|
2882
2883
|
rowDef.setStaticData(field, value);
|
2883
2884
|
}
|
@@ -3227,7 +3228,7 @@ Grid.prototype._onDataChanged = function(e) {
|
|
3227
3228
|
// The new data update has no row definition, meaning that we have found a new constituent from a chain.
|
3228
3229
|
var subId = rowData[SUB_ID]; // The constituent will share the same sub id as its parent
|
3229
3230
|
if(subId) {
|
3230
|
-
var parentDef = this.
|
3231
|
+
var parentDef = this._getRowDefinitionById(subId);
|
3231
3232
|
if(parentDef && parentDef.getRic() !== rowData["RIC"]) { // TODO: Check for delayed ric
|
3232
3233
|
if(!this._chainMembers) {
|
3233
3234
|
this._chainMembers = {};
|
@@ -3259,7 +3260,7 @@ Grid.prototype._addMemberOfChain = function(rowData) {
|
|
3259
3260
|
for(i = 0; i < len; ++i) {
|
3260
3261
|
rowData = /** @type{!Object} */(rows[i]);
|
3261
3262
|
var subId = rowData[SUB_ID];
|
3262
|
-
var parentDef = this.
|
3263
|
+
var parentDef = this._getRowDefinitionById(subId);
|
3263
3264
|
if(parentDef) {
|
3264
3265
|
var childDef = parentDef.addConstituent(/** @type{string} */(rowData["RIC"]), this._dt);
|
3265
3266
|
if(childDef) {
|
@@ -3405,7 +3406,7 @@ Grid.prototype.getPageCount = function() {
|
|
3405
3406
|
* @param {Grid~RowReference} rowRef
|
3406
3407
|
*/
|
3407
3408
|
Grid.prototype.toggleChain = function(rowRef) {
|
3408
|
-
var rowDef = this.
|
3409
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
3409
3410
|
if(rowDef) {
|
3410
3411
|
rowDef.toggleChain();
|
3411
3412
|
}
|
@@ -3417,7 +3418,7 @@ Grid.prototype.toggleChain = function(rowRef) {
|
|
3417
3418
|
* @return {boolean}
|
3418
3419
|
*/
|
3419
3420
|
Grid.prototype.setClassification = function(rowRef, fields) {
|
3420
|
-
var rowDef = this.
|
3421
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
3421
3422
|
if(rowDef) {
|
3422
3423
|
return this._dt.setSegmentClassification(rowDef.getRowId(), fields);
|
3423
3424
|
}
|
@@ -49,7 +49,7 @@ var ROW_TYPES = {
|
|
49
49
|
*/
|
50
50
|
var RowDefinition = function(rowOptions) {
|
51
51
|
this._changes = {};
|
52
|
-
if(rowOptions && rowOptions["segmentId"]) {
|
52
|
+
if(rowOptions && rowOptions["segmentId"]) { // This row will be classification header row
|
53
53
|
this._dataId = this._rowId = rowOptions["segmentId"];
|
54
54
|
this._autoGenerated = true;
|
55
55
|
this._subSegment = true;
|
@@ -4,42 +4,42 @@ import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
|
4
4
|
declare namespace StatisticsRowPlugin {
|
5
5
|
|
6
6
|
type Options = {
|
7
|
-
rows?: any[],
|
8
|
-
invalidText?: string,
|
9
|
-
noColoring?: boolean,
|
10
|
-
noFormatting?: boolean,
|
11
|
-
postCalculation?: ((...params: any[]) => any),
|
12
|
-
postRendering?: ((...params: any[]) => any)
|
7
|
+
rows?: any[]|null,
|
8
|
+
invalidText?: string|null,
|
9
|
+
noColoring?: boolean|null,
|
10
|
+
noFormatting?: boolean|null,
|
11
|
+
postCalculation?: ((...params: any[]) => any)|null,
|
12
|
+
postRendering?: ((...params: any[]) => any)|null
|
13
13
|
};
|
14
14
|
|
15
15
|
type ColumnOptions = {
|
16
|
-
statistics?: (boolean|string)
|
16
|
+
statistics?: (boolean|string)|null
|
17
17
|
};
|
18
18
|
|
19
19
|
type RowOptions = {
|
20
|
-
placement?: string,
|
21
|
-
statistic?: string,
|
22
|
-
label?: string,
|
23
|
-
id?: string
|
20
|
+
placement?: string|null,
|
21
|
+
statistic?: string|null,
|
22
|
+
label?: string|null,
|
23
|
+
id?: string|null
|
24
24
|
};
|
25
25
|
|
26
|
-
type RowReference = string|number;
|
26
|
+
type RowReference = string|number|null;
|
27
27
|
|
28
28
|
type Stats = {
|
29
|
-
field?: string,
|
30
|
-
label?: boolean,
|
31
|
-
count?: number,
|
32
|
-
sum?: number,
|
33
|
-
average?: number,
|
34
|
-
min?: number,
|
35
|
-
max?: number
|
29
|
+
field?: string|null,
|
30
|
+
label?: boolean|null,
|
31
|
+
count?: number|null,
|
32
|
+
sum?: number|null,
|
33
|
+
average?: number|null,
|
34
|
+
min?: number|null,
|
35
|
+
max?: number|null
|
36
36
|
};
|
37
37
|
|
38
38
|
}
|
39
39
|
|
40
40
|
declare class StatisticsRowPlugin extends GridPlugin {
|
41
41
|
|
42
|
-
constructor(options?: StatisticsRowPlugin.Options);
|
42
|
+
constructor(options?: StatisticsRowPlugin.Options|null);
|
43
43
|
|
44
44
|
public getName(): string;
|
45
45
|
|
@@ -51,15 +51,15 @@ declare class StatisticsRowPlugin extends GridPlugin {
|
|
51
51
|
|
52
52
|
public getConfigObject(gridOptions?: any): any;
|
53
53
|
|
54
|
-
public setStatisticsRows(rows: (StatisticsRowPlugin.RowOptions)[]): void;
|
54
|
+
public setStatisticsRows(rows: (StatisticsRowPlugin.RowOptions)[]|null): void;
|
55
55
|
|
56
|
-
public getStatisticsRows(): (StatisticsRowPlugin.RowOptions)[];
|
56
|
+
public getStatisticsRows(): (StatisticsRowPlugin.RowOptions)[]|null;
|
57
57
|
|
58
|
-
public setStatisticsRow(rowRef: StatisticsRowPlugin.RowReference, options: StatisticsRowPlugin.RowOptions): boolean;
|
58
|
+
public setStatisticsRow(rowRef: StatisticsRowPlugin.RowReference|null, options: StatisticsRowPlugin.RowOptions|null): boolean;
|
59
59
|
|
60
|
-
public addStatisticsRow(options: StatisticsRowPlugin.RowOptions): void;
|
60
|
+
public addStatisticsRow(options: StatisticsRowPlugin.RowOptions|null): void;
|
61
61
|
|
62
|
-
public removeStatisticsRow(rowRef: StatisticsRowPlugin.RowReference): void;
|
62
|
+
public removeStatisticsRow(rowRef: StatisticsRowPlugin.RowReference|null): void;
|
63
63
|
|
64
64
|
}
|
65
65
|
|
@@ -734,13 +734,13 @@ StatisticsRowPlugin.prototype._renderStatistics = function (colIndex, stats, act
|
|
734
734
|
|
735
735
|
var r, rowCount;
|
736
736
|
if(this._headerSect) {
|
737
|
-
rowCount = this.
|
737
|
+
rowCount = this._headerRows.length;
|
738
738
|
for(r = 0; r < rowCount; ++r) {
|
739
739
|
this._headerRows[r].cell = this._headerSect.getCell(colIndex, r);
|
740
740
|
}
|
741
741
|
}
|
742
742
|
if(this._footerSect) {
|
743
|
-
rowCount = this.
|
743
|
+
rowCount = this._footerRows.length;
|
744
744
|
for(r = 0; r < rowCount; ++r) {
|
745
745
|
this._footerRows[r].cell = this._footerSect.getCell(colIndex, r);
|
746
746
|
}
|
@@ -752,6 +752,11 @@ StatisticsRowPlugin.prototype._renderStatistics = function (colIndex, stats, act
|
|
752
752
|
var row = rows[r];
|
753
753
|
var txt = null;
|
754
754
|
|
755
|
+
var cell = row.cell;
|
756
|
+
if(cell == null) {
|
757
|
+
continue;
|
758
|
+
}
|
759
|
+
|
755
760
|
var statistic = row.statistic;
|
756
761
|
if(stats.label) {
|
757
762
|
txt = row.label;
|
@@ -770,12 +775,12 @@ StatisticsRowPlugin.prototype._renderStatistics = function (colIndex, stats, act
|
|
770
775
|
if(this._ccExt && !this._noColoring) {
|
771
776
|
var rowData = row.cachedData;
|
772
777
|
rowData[stats.field] = num;
|
773
|
-
this._ccExt.applyColor(colIndex,
|
778
|
+
this._ccExt.applyColor(colIndex, cell, rowData, actualUpdate);
|
774
779
|
}
|
775
780
|
}
|
776
781
|
}
|
777
782
|
|
778
|
-
|
783
|
+
cell.setContent(txt);
|
779
784
|
row.cell = null;
|
780
785
|
}
|
781
786
|
};
|
@@ -37,6 +37,8 @@ declare class ColumnGroupingPlugin extends GridPlugin {
|
|
37
37
|
|
38
38
|
public getConfigObject(gridOptions?: any): any;
|
39
39
|
|
40
|
+
public renderGroups(): void;
|
41
|
+
|
40
42
|
public addColumnToGroup(column: any, groupId: string, colIndex: number): void;
|
41
43
|
|
42
44
|
public addGroup(groupDef: ColumnGroupingPlugin.GroupDefinition|null): string;
|
@@ -55,6 +57,8 @@ declare class ColumnGroupingPlugin extends GridPlugin {
|
|
55
57
|
|
56
58
|
public setGroupChildren(groupId: string, newChildList: (string)[]|null): boolean;
|
57
59
|
|
60
|
+
public setGroupName(groupId: string, groupName: string): void;
|
61
|
+
|
58
62
|
public getGroupChildren(groupId: string): (string)[]|null;
|
59
63
|
|
60
64
|
public getChildColumnIndices(groupId: string): (number)[]|null;
|
@@ -661,9 +661,10 @@ ColumnGroupingPlugin.prototype._spanGroupHorizontally = function (titleSection)
|
|
661
661
|
}
|
662
662
|
}
|
663
663
|
};
|
664
|
-
/**
|
664
|
+
/** Render all column group headers without affecting cell spans.
|
665
|
+
* @public
|
665
666
|
*/
|
666
|
-
ColumnGroupingPlugin.prototype.
|
667
|
+
ColumnGroupingPlugin.prototype.renderGroups = function () {
|
667
668
|
var hostCount = this._hosts.length;
|
668
669
|
var groupMap = this._visibleGroupMap;
|
669
670
|
for (var i = 0; i < hostCount; ++i) {
|
@@ -671,35 +672,42 @@ ColumnGroupingPlugin.prototype._renderGroups = function () {
|
|
671
672
|
if (!section) {
|
672
673
|
continue;
|
673
674
|
}
|
674
|
-
var arg = {};
|
675
675
|
for (var id in groupMap) {
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
676
|
+
this._renderGroup(groupMap[id], section);
|
677
|
+
}
|
678
|
+
}
|
679
|
+
};
|
680
|
+
/** Render single column group header without affecting cell span.
|
681
|
+
* @private
|
682
|
+
* @param {Object} groupDef
|
683
|
+
* @param {Object} section
|
684
|
+
*/
|
685
|
+
ColumnGroupingPlugin.prototype._renderGroup = function (groupDef, section) {
|
686
|
+
var colIndex = groupDef["colIndex"];
|
687
|
+
if (colIndex == null) {
|
688
|
+
return;
|
689
|
+
}
|
690
|
+
var rowIndex = groupDef["onRow"];
|
691
|
+
var cell = section.getCell(colIndex, rowIndex);
|
692
|
+
if (cell) {
|
693
|
+
// Overide the defaults
|
694
|
+
cell.setStyle("text-align", groupDef["alignment"] || "");
|
695
|
+
cell.setTooltip(ColumnGroupingPlugin._getTooltip(groupDef));
|
696
|
+
cell.setContent(groupDef["name"] || groupDef["title"]);
|
688
697
|
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
}
|
698
|
+
// Additional cell settings must be removed in the _applyGrouping() method
|
699
|
+
cell.addClass("no-sort");
|
700
|
+
cell.setAttribute("group-id", groupDef["id"]);
|
701
|
+
if (groupDef["legacyRender"]) {
|
702
|
+
// Built-in version if render receive colIndex, cell, groupDefinition as arguments
|
703
|
+
groupDef["legacyRender"](colIndex, cell, groupDef);
|
704
|
+
}
|
705
|
+
if (groupDef["render"]) {
|
706
|
+
var arg = {};
|
707
|
+
arg["cell"] = cell;
|
708
|
+
arg["colIndex"] = colIndex;
|
709
|
+
arg["groupNode"] = groupDef;
|
710
|
+
groupDef["render"](arg);
|
703
711
|
}
|
704
712
|
}
|
705
713
|
};
|
@@ -709,7 +717,7 @@ ColumnGroupingPlugin.prototype._renderGroups = function () {
|
|
709
717
|
*/
|
710
718
|
ColumnGroupingPlugin.prototype._onPostSectionRender = function (e) {
|
711
719
|
if (e.sectionType === "title" && !this._restructuring) {
|
712
|
-
this.
|
720
|
+
this.renderGroups();
|
713
721
|
}
|
714
722
|
};
|
715
723
|
|
@@ -1029,6 +1037,26 @@ ColumnGroupingPlugin.prototype.setGroupChildren = function (groupId, newChildLis
|
|
1029
1037
|
}
|
1030
1038
|
return false;
|
1031
1039
|
};
|
1040
|
+
/** @public
|
1041
|
+
* @param {string} groupId
|
1042
|
+
* @param {string} groupName
|
1043
|
+
*/
|
1044
|
+
ColumnGroupingPlugin.prototype.setGroupName = function (groupId, groupName) {
|
1045
|
+
if (this._groupDefs.setGroupName(groupId, groupName)) {
|
1046
|
+
var groupDef = this._visibleGroupMap[groupId];
|
1047
|
+
if (groupDef) {
|
1048
|
+
groupDef.name = groupName;
|
1049
|
+
var hostCount = this._hosts.length;
|
1050
|
+
for (var i = 0; i < hostCount; ++i) {
|
1051
|
+
var section = this._hosts[i].getSection("title");
|
1052
|
+
if (!section) {
|
1053
|
+
continue;
|
1054
|
+
}
|
1055
|
+
this._renderGroup(groupDef, section);
|
1056
|
+
}
|
1057
|
+
}
|
1058
|
+
}
|
1059
|
+
};
|
1032
1060
|
/** @private
|
1033
1061
|
* @param {string} groupId
|
1034
1062
|
* @return {!Array.<string>} The list of immediate valid child, including invisible child groups
|
@@ -1333,6 +1333,20 @@ ColumnSelectionPlugin.prototype._dispatchSelectionChanged = function (e, colInde
|
|
1333
1333
|
"event": e
|
1334
1334
|
});
|
1335
1335
|
};
|
1336
|
+
/** @public
|
1337
|
+
*/
|
1338
|
+
|
1339
|
+
|
1340
|
+
ColumnSelectionPlugin.prototype.dispatchSelectionChanged = function () {
|
1341
|
+
var selectedCols = this.getSelectedColumns();
|
1342
|
+
var colIndex = selectedCols.length ? selectedCols[0] : -1;
|
1343
|
+
|
1344
|
+
this._dispatch("selectionChanged", {
|
1345
|
+
"selectedCols": selectedCols,
|
1346
|
+
"colIndex": colIndex,
|
1347
|
+
"grid": this._activeGrid
|
1348
|
+
});
|
1349
|
+
};
|
1336
1350
|
|
1337
1351
|
export default ColumnSelectionPlugin;
|
1338
1352
|
export { ColumnSelectionPlugin, ColumnSelectionPlugin as ColumnSelection, ColumnSelectionPlugin as ColumnSelectionExtension };
|
@@ -119,6 +119,8 @@ declare class ColumnStackPlugin extends GridPlugin {
|
|
119
119
|
|
120
120
|
public getActiveColumnField(stackId: string): string;
|
121
121
|
|
122
|
+
public getActiveColumnIndex(stackId: string): number;
|
123
|
+
|
122
124
|
public addStackChild(stackId: string, colRef: number|string|null): void;
|
123
125
|
|
124
126
|
public removeStackChild(stackId: string, colRef: number|string|null): void;
|
@@ -1045,8 +1045,22 @@ ColumnStackPlugin.prototype.stackColumns = function(colRefs, stackId, options) {
|
|
1045
1045
|
stack.activeColumn = stack.stackRefs[stack.stackRefs.length - 1]; // Right most column is the active column
|
1046
1046
|
} else {
|
1047
1047
|
var csp = this._getPlugin("ColumnSelectionPlugin");
|
1048
|
-
if(csp && csp.isEnabled())
|
1049
|
-
|
1048
|
+
if(csp && csp.isEnabled()){
|
1049
|
+
var stackSelection = false;
|
1050
|
+
for(i = 0; i < len; ++i){
|
1051
|
+
colIndex = colRefs[i];
|
1052
|
+
if(colIndex === activeIndex){
|
1053
|
+
continue;
|
1054
|
+
}
|
1055
|
+
if(csp.isSelectedColumn(colIndex)){
|
1056
|
+
stackSelection = true;
|
1057
|
+
break;
|
1058
|
+
}
|
1059
|
+
}
|
1060
|
+
if(stackSelection) {
|
1061
|
+
csp.selectSingleColumn(activeIndex);
|
1062
|
+
csp.dispatchSelectionChanged();
|
1063
|
+
}
|
1050
1064
|
}
|
1051
1065
|
}
|
1052
1066
|
|
@@ -1113,7 +1127,6 @@ ColumnStackPlugin.prototype.unstackColumns = function(colIndices) {
|
|
1113
1127
|
}
|
1114
1128
|
|
1115
1129
|
var dirty = false;
|
1116
|
-
var selFrom, selLen;
|
1117
1130
|
|
1118
1131
|
for(var sid in stacks) {
|
1119
1132
|
var stack = this._stacks[sid];
|
@@ -1124,8 +1137,6 @@ ColumnStackPlugin.prototype.unstackColumns = function(colIndices) {
|
|
1124
1137
|
|
1125
1138
|
var stackRefs = stack.stackRefs;
|
1126
1139
|
len = stackRefs.length;
|
1127
|
-
selFrom = this._getColumnIndex(stack.stackRefs[0]);
|
1128
|
-
selLen = len - 1;
|
1129
1140
|
|
1130
1141
|
for(i = 0; i < len; ++i) {
|
1131
1142
|
var stackRef = stackRefs[i];
|
@@ -1140,10 +1151,6 @@ ColumnStackPlugin.prototype.unstackColumns = function(colIndices) {
|
|
1140
1151
|
delete this._stacks[sid]; // Remove all reference to the stack
|
1141
1152
|
}
|
1142
1153
|
if(dirty) {
|
1143
|
-
var csp = this._getPlugin("ColumnSelectionPlugin");
|
1144
|
-
if(csp && csp.isEnabled()) {
|
1145
|
-
csp.selectRange(selFrom, selLen);
|
1146
|
-
}
|
1147
1154
|
var cfp = this._getPlugin("ColumnFilterPlugin");
|
1148
1155
|
if(cfp) {
|
1149
1156
|
cfp["refresh"]();
|
@@ -1256,6 +1263,7 @@ ColumnStackPlugin.prototype.swapColumn = function(colRef, swappingIndex) {
|
|
1256
1263
|
var csp = this._getPlugin("ColumnSelectionPlugin");
|
1257
1264
|
if(csp && csp.isEnabled()) {
|
1258
1265
|
csp.selectSingleColumn(newActiveColumnIndex);
|
1266
|
+
csp.dispatchSelectionChanged();
|
1259
1267
|
}
|
1260
1268
|
var cfp = this._getPlugin("ColumnFilterPlugin");
|
1261
1269
|
if(cfp) {
|
@@ -1513,6 +1521,7 @@ ColumnStackPlugin.prototype._onStackButtonClicked = function(e) {
|
|
1513
1521
|
pos["columnIndices"] = colIndices;
|
1514
1522
|
pos["activeColIndex"] = this._getColumnIndex(colData.activeColumn);
|
1515
1523
|
pos["event"] = e;
|
1524
|
+
pos["stackId"] = colData.stackId;
|
1516
1525
|
|
1517
1526
|
elem.focus();
|
1518
1527
|
this._dispatch("clicked", pos);
|
@@ -1809,15 +1818,29 @@ ColumnStackPlugin.prototype.getStackName = function(stackId) {
|
|
1809
1818
|
*/
|
1810
1819
|
ColumnStackPlugin.prototype.getActiveColumnField = function(stackId) {
|
1811
1820
|
var field = "";
|
1821
|
+
var activeColIndex = this.getActiveColumnIndex(stackId);
|
1822
|
+
if(activeColIndex !== -1){
|
1823
|
+
field = this._getField(activeColIndex);
|
1824
|
+
}
|
1825
|
+
return field;
|
1826
|
+
};
|
1827
|
+
|
1828
|
+
/** @public
|
1829
|
+
* @description Get active column index of specific stack
|
1830
|
+
* @param {string} stackId
|
1831
|
+
* @return {number} active column index
|
1832
|
+
*/
|
1833
|
+
ColumnStackPlugin.prototype.getActiveColumnIndex = function(stackId) {
|
1834
|
+
var activeColIndex = -1;
|
1812
1835
|
if(stackId !== null) {
|
1813
1836
|
var stack = this._stacks[stackId];
|
1814
1837
|
if(stack){
|
1815
|
-
|
1816
|
-
field = this._getField(activeColIndex);
|
1838
|
+
activeColIndex = this._getColumnIndex(stack.activeColumn);
|
1817
1839
|
}
|
1818
1840
|
}
|
1819
|
-
return
|
1841
|
+
return activeColIndex;
|
1820
1842
|
};
|
1843
|
+
//getActiveColumnIndex
|
1821
1844
|
|
1822
1845
|
/** @public
|
1823
1846
|
* @param {string} stackId
|
@@ -39,7 +39,7 @@ declare class RowDraggingPlugin extends GridPlugin {
|
|
39
39
|
|
40
40
|
public getConfigObject(out_obj?: any): any;
|
41
41
|
|
42
|
-
public startDrag(startRef
|
42
|
+
public startDrag(startRef?: any): void;
|
43
43
|
|
44
44
|
public stopDrag(): void;
|
45
45
|
|
@@ -53,6 +53,28 @@ declare class RowDraggingPlugin extends GridPlugin {
|
|
53
53
|
|
54
54
|
public disableUIs(disabled?: boolean|null): void;
|
55
55
|
|
56
|
+
public allowDrag(allowed?: boolean|null): void;
|
57
|
+
|
58
|
+
public allowDrop(allowed?: boolean|null): void;
|
59
|
+
|
60
|
+
public setDragContent(content: any): void;
|
61
|
+
|
62
|
+
public getDragBox(): Element|null;
|
63
|
+
|
64
|
+
public getDragSource(): string;
|
65
|
+
|
66
|
+
public isDragging(): boolean;
|
67
|
+
|
68
|
+
public disableDragging(disabled?: boolean|null): void;
|
69
|
+
|
70
|
+
public enableJETDragAndDrop(enabled?: boolean|null): void;
|
71
|
+
|
72
|
+
public getJETDragContent(): any;
|
73
|
+
|
74
|
+
public setJETDragContent(content: any): void;
|
75
|
+
|
76
|
+
public setJETDragContent(content: any): void;
|
77
|
+
|
56
78
|
}
|
57
79
|
|
58
80
|
export default RowDraggingPlugin;
|