@refinitiv-ui/efx-grid 6.0.40 → 6.0.41
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-selection-dialog/lib/column-selection-dialog.d.ts +2 -1
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +23 -7
- package/lib/core/dist/core.js +25 -26
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/grid/Core.js +25 -26
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +2083 -1753
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.js +55 -7
- package/lib/rt-grid/es6/RowDefinition.d.ts +2 -2
- package/lib/rt-grid/es6/RowDefinition.js +37 -18
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +26 -40
- package/lib/tr-grid-util/es6/CellPainter.d.ts +2 -1
- package/lib/tr-grid-util/es6/CellPainter.js +6 -4
- package/lib/tr-grid-util/es6/ExpressionParser.d.ts +10 -0
- package/lib/tr-grid-util/es6/ExpressionParser.js +366 -0
- package/lib/tr-grid-util/es6/FilterBuilder.d.ts +10 -6
- package/lib/tr-grid-util/es6/FilterBuilder.js +264 -234
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +3 -1
- package/lib/tr-grid-util/es6/FilterOperators.js +51 -2
- package/lib/tr-grid-util/es6/Util.d.ts +0 -3
- package/lib/tr-grid-util/es6/Util.js +0 -53
- package/lib/tr-grid-util/es6/formula/Formula.js +3 -3
- package/lib/types/es6/ColumnDragging.d.ts +51 -0
- package/lib/types/es6/ExtensionOptions.d.ts +2 -0
- package/lib/types/es6/Extensions.d.ts +3 -1
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -2
- package/lib/types/es6/index.d.ts +1 -0
- package/lib/versions.json +3 -3
- package/package.json +1 -1
@@ -23,7 +23,8 @@ declare namespace ColumnSelectionDialog {
|
|
23
23
|
excludedRightColumns?: number|null,
|
24
24
|
unmovableColumns?: number|null,
|
25
25
|
descriptionBox?: boolean|null,
|
26
|
-
middleSeparator?: string|null
|
26
|
+
middleSeparator?: string|null,
|
27
|
+
collapseAll?: boolean|null
|
27
28
|
};
|
28
29
|
|
29
30
|
}
|
@@ -22,6 +22,7 @@ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
|
22
22
|
* @property {number=} unmovableColumns Depricated, Alias with stationary column option. Number of columns that is unmovable in Visible Columns.
|
23
23
|
* @property {boolean=} descriptionBox Show description box
|
24
24
|
* @property {string=} middleSeparator Field of column which used as middle separator to divide grid into two sides
|
25
|
+
* @property {boolean=} collapseAll=false Default collapse property applies to all groups
|
25
26
|
*/
|
26
27
|
|
27
28
|
/** Insert multiple items to the given array. This is an in-place modification.
|
@@ -256,10 +257,15 @@ const _getSelectedItemIndexes = function (list) {
|
|
256
257
|
* @private
|
257
258
|
* @param {Object} colObj
|
258
259
|
* @param {string} parent parent of this group
|
260
|
+
* @param {boolean} defaultExpanded default expand state for tree item
|
259
261
|
* @return {Object}
|
260
262
|
*/
|
261
|
-
const _toCoralTreeItem = function (colObj, parent) {
|
263
|
+
const _toCoralTreeItem = function (colObj, parent, defaultExpanded) {
|
262
264
|
var label = colObj.label || colObj.title || colObj.name || colObj.field;
|
265
|
+
var expanded = defaultExpanded;
|
266
|
+
if(colObj.expanded != null){
|
267
|
+
expanded = colObj.expanded;
|
268
|
+
}
|
263
269
|
var currentId;
|
264
270
|
if(parent) {
|
265
271
|
currentId = parent + '/' + label;
|
@@ -272,9 +278,9 @@ const _toCoralTreeItem = function (colObj, parent) {
|
|
272
278
|
rawValue: colObj.id,
|
273
279
|
value: colObj.id,
|
274
280
|
items: colObj.items.map(function (obj) {
|
275
|
-
return _toCoralTreeItem(obj, currentId);
|
281
|
+
return _toCoralTreeItem(obj, currentId, defaultExpanded);
|
276
282
|
}),
|
277
|
-
expanded:
|
283
|
+
expanded: expanded,
|
278
284
|
isGroup: true
|
279
285
|
};
|
280
286
|
} else {
|
@@ -494,6 +500,7 @@ class ColumnSelectionDialog extends BasicElement {
|
|
494
500
|
this._pendingTreeRefresh = false;
|
495
501
|
this._pendingResetSearchInput = false;
|
496
502
|
this._middleSeparator = "";
|
503
|
+
this._defaultExpanded = true;
|
497
504
|
|
498
505
|
this._allItemMapping = {};
|
499
506
|
this._filterItemMapping = {};
|
@@ -574,6 +581,10 @@ class ColumnSelectionDialog extends BasicElement {
|
|
574
581
|
this._descriptionBox = !!this.config.descriptionBox;
|
575
582
|
}
|
576
583
|
|
584
|
+
if (this.config.collapseAll != null) {
|
585
|
+
this._defaultExpanded = !this.config.collapseAll;
|
586
|
+
}
|
587
|
+
|
577
588
|
this._defaultItems = this.config.defaultItems;
|
578
589
|
}
|
579
590
|
}
|
@@ -766,7 +777,10 @@ class ColumnSelectionDialog extends BasicElement {
|
|
766
777
|
}
|
767
778
|
|
768
779
|
if(this._pendingScroll) {
|
769
|
-
|
780
|
+
var selectedIndexes = _getSelectedItemIndexes(this._visibleColumnList);
|
781
|
+
if (selectedIndexes.length) {
|
782
|
+
scrollToItem(this._visibleColumnsContainer, selectedIndexes[0]);
|
783
|
+
}
|
770
784
|
this._pendingScroll = false;
|
771
785
|
}
|
772
786
|
|
@@ -879,9 +893,11 @@ class ColumnSelectionDialog extends BasicElement {
|
|
879
893
|
|
880
894
|
}
|
881
895
|
|
882
|
-
this._allColumnList =
|
883
|
-
|
884
|
-
|
896
|
+
this._allColumnList = [];
|
897
|
+
for(i = 0; i < allItems.length; i++){
|
898
|
+
item = allItems[i];
|
899
|
+
this._allColumnList.push(_toCoralTreeItem(item, null, this._defaultExpanded));
|
900
|
+
}
|
885
901
|
this._allItemMapping = _createMapping(this._allColumnList, 'value');
|
886
902
|
|
887
903
|
this._visibleColumnList = [];
|
package/lib/core/dist/core.js
CHANGED
@@ -25917,7 +25917,7 @@ Core_Core.prototype._batches = null;
|
|
25917
25917
|
* @return {string}
|
25918
25918
|
*/
|
25919
25919
|
Core_Core.getVersion = function () {
|
25920
|
-
return "5.1.
|
25920
|
+
return "5.1.59";
|
25921
25921
|
};
|
25922
25922
|
/** {@link ElementWrapper#dispose}
|
25923
25923
|
* @override
|
@@ -26864,16 +26864,12 @@ Core_Core.prototype.removeColumnAt = function (index) {
|
|
26864
26864
|
|
26865
26865
|
if (this._hasListener("columnRemoved")) {
|
26866
26866
|
var e = {};
|
26867
|
-
var batches = this._batches;
|
26868
|
-
if(batches){
|
26869
|
-
e["batches"] = batches;
|
26870
|
-
}
|
26871
26867
|
e["atTheMiddle"] = true;
|
26872
26868
|
e["colIndex"] = index;
|
26873
26869
|
e["columns"] = "deprecated";
|
26874
26870
|
e["columnData"] = colDef["columnData"];
|
26875
26871
|
e["colId"] = colDef["id"] || "";
|
26876
|
-
this.
|
26872
|
+
this._dispatchColumnEvent("columnRemoved", e);
|
26877
26873
|
}
|
26878
26874
|
|
26879
26875
|
// Last index in view here might be different from before moving column if columns have different width.
|
@@ -27126,7 +27122,7 @@ Core_Core.prototype._moveColumn = function (fromCol, destCol) {
|
|
27126
27122
|
e["fromColIndex"] = fromCol;
|
27127
27123
|
e["toColIndex"] = destCol;
|
27128
27124
|
e["colId"] = colId; // TODO: Id may not needed
|
27129
|
-
this.
|
27125
|
+
this._dispatchColumnEvent("columnMoved", e); // add remove move
|
27130
27126
|
}
|
27131
27127
|
|
27132
27128
|
// Last index in view here might be different from before moving column if columns have different width.
|
@@ -27196,6 +27192,9 @@ Core_Core.prototype.reorderColumns = function (colRefs, destCol) {
|
|
27196
27192
|
destId = destCol;
|
27197
27193
|
}
|
27198
27194
|
|
27195
|
+
this.startBatch("move");
|
27196
|
+
|
27197
|
+
var dirty = 0;
|
27199
27198
|
if(Array.isArray(colRefs)) {
|
27200
27199
|
var srcLen = colRefs.length;
|
27201
27200
|
if(srcLen > 1) {
|
@@ -27238,7 +27237,6 @@ Core_Core.prototype.reorderColumns = function (colRefs, destCol) {
|
|
27238
27237
|
}
|
27239
27238
|
}
|
27240
27239
|
|
27241
|
-
var dirty = 0;
|
27242
27240
|
for(i = srcLen; --i >= 0;) {
|
27243
27241
|
srcId = srcIds[i]; // Only valid source columns are left at this point
|
27244
27242
|
srcIdx = this.getColumnIndex(srcId);
|
@@ -27249,17 +27247,15 @@ Core_Core.prototype.reorderColumns = function (colRefs, destCol) {
|
|
27249
27247
|
dirty |= this._moveColumnByIndex(srcIdx, destIdx);
|
27250
27248
|
destId = srcId;
|
27251
27249
|
}
|
27252
|
-
return dirty ? true : false;
|
27253
27250
|
} else {
|
27254
|
-
|
27251
|
+
dirty = this.moveColumnById(colRefs[0], destId);
|
27255
27252
|
}
|
27256
|
-
}
|
27257
|
-
|
27258
|
-
if(colRefs != null) {
|
27253
|
+
} else if(colRefs != null) {
|
27259
27254
|
// colRefs will be a number or string
|
27260
|
-
|
27255
|
+
dirty = this.moveColumnById(colRefs, destId);
|
27261
27256
|
}
|
27262
|
-
|
27257
|
+
this.stopBatch("move");
|
27258
|
+
return dirty ? true : false;
|
27263
27259
|
};
|
27264
27260
|
|
27265
27261
|
/** @public
|
@@ -29813,6 +29809,17 @@ Core_Core.prototype.stopBatch = function (batchType) {
|
|
29813
29809
|
|
29814
29810
|
//#region Private Methods
|
29815
29811
|
/** @private
|
29812
|
+
* @param {string} type
|
29813
|
+
* @param {!Object} eventArg
|
29814
|
+
*/
|
29815
|
+
Core_Core.prototype._dispatchColumnEvent = function (type, eventArg) {
|
29816
|
+
var batches = this._batches;
|
29817
|
+
if(batches){
|
29818
|
+
eventArg["batches"] = batches;
|
29819
|
+
}
|
29820
|
+
this._dispatch(type, eventArg);
|
29821
|
+
};
|
29822
|
+
/** @private
|
29816
29823
|
*/
|
29817
29824
|
Core_Core.prototype._dispatchColumnPositionChanged = function () {
|
29818
29825
|
if(this._columnPositionConflator.conflate()) {
|
@@ -30052,20 +30059,16 @@ Core_Core.prototype._dispatchColumnAddedEvent = function (at, count, atTheMiddle
|
|
30052
30059
|
if (this._hasListener("columnAdded")) {
|
30053
30060
|
var e = {};
|
30054
30061
|
e["atTheMiddle"] = atTheMiddle;
|
30055
|
-
var batches = this._batches;
|
30056
|
-
if(batches){
|
30057
|
-
e["batches"] = batches;
|
30058
|
-
}
|
30059
30062
|
if(count === 1) {
|
30060
30063
|
e["colIndex"] = at;
|
30061
30064
|
e["context"] = ctx;
|
30062
|
-
this.
|
30065
|
+
this._dispatchColumnEvent("columnAdded", e);
|
30063
30066
|
} else {
|
30064
30067
|
var ary = Array.isArray(ctx) ? ctx : [];
|
30065
30068
|
for (var i = 0; i < count; ++i) {
|
30066
30069
|
e["colIndex"] = at + i;
|
30067
30070
|
e["context"] = ary[i];
|
30068
|
-
this.
|
30071
|
+
this._dispatchColumnEvent("columnAdded", e);
|
30069
30072
|
}
|
30070
30073
|
}
|
30071
30074
|
}
|
@@ -30207,15 +30210,11 @@ Core_Core.prototype._removeColumn = function (num) { // TODO: change the logic
|
|
30207
30210
|
|
30208
30211
|
if (this._hasListener("columnRemoved")) {
|
30209
30212
|
var e = {};
|
30210
|
-
var batches = this._batches;
|
30211
|
-
if(batches){
|
30212
|
-
e["batches"] = batches;
|
30213
|
-
}
|
30214
30213
|
for (var c = colCount; --c >= newCount; ) {
|
30215
30214
|
var colDef = removedCols[c - newCount];
|
30216
30215
|
e["colIndex"] = c;
|
30217
30216
|
e["columnData"] = colDef ? colDef["columnData"] : null;
|
30218
|
-
this.
|
30217
|
+
this._dispatchColumnEvent("columnRemoved", e);
|
30219
30218
|
}
|
30220
30219
|
}
|
30221
30220
|
};
|