@refinitiv-ui/efx-grid 6.0.39 → 6.0.41
Sign up to get free protection for your applications and to get access to all the features.
- 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 +39 -28
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/grid/Core.js +34 -26
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +5 -2
- package/lib/grid/index.js +1 -1
- package/lib/row-segmenting/es6/RowSegmenting.js +4 -4
- package/lib/rt-grid/dist/rt-grid.js +2191 -1780
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +1 -0
- package/lib/rt-grid/es6/ColumnDefinition.js +7 -8
- package/lib/rt-grid/es6/Grid.d.ts +2 -0
- package/lib/rt-grid/es6/Grid.js +91 -30
- package/lib/rt-grid/es6/RowDefinition.d.ts +4 -5
- package/lib/rt-grid/es6/RowDefinition.js +103 -52
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +26 -40
- package/lib/tr-grid-contextmenu/es6/ContextMenu.d.ts +27 -27
- package/lib/tr-grid-contextmenu/es6/ContextMenu.js +97 -93
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +3 -3
- package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +2 -2
- package/lib/tr-grid-contextmenu/es6/PopupMenu.d.ts +5 -5
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +30 -12
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +2 -1
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +50 -18
- 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/ContextMenu.d.ts +27 -27
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +3 -0
- package/lib/types/es6/ExtensionOptions.d.ts +2 -0
- package/lib/types/es6/Extensions.d.ts +3 -1
- package/lib/types/es6/MenuEventAPI.d.ts +3 -3
- package/lib/types/es6/MenuItem.d.ts +2 -2
- package/lib/types/es6/PopupMenu.d.ts +5 -5
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +1 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +2 -0
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +4 -5
- package/lib/types/es6/index.d.ts +1 -0
- package/lib/versions.json +10 -10
- 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
@@ -25392,6 +25392,7 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
|
|
25392
25392
|
* @property {string} rowId
|
25393
25393
|
* @property {number} rowIndex
|
25394
25394
|
*/
|
25395
|
+
/** @event Core#beforeContentBinding */
|
25395
25396
|
/** @event Core#postSectionDataBinding */
|
25396
25397
|
/** @event Core#rowHighlighted */
|
25397
25398
|
|
@@ -25554,6 +25555,7 @@ var Core_Core = function (opt_initializer) {
|
|
25554
25555
|
"postDataSourceChanged",
|
25555
25556
|
"preSectionRender",
|
25556
25557
|
"postSectionRender",
|
25558
|
+
"beforeContentBinding",
|
25557
25559
|
"preSectionDataBinding",
|
25558
25560
|
"postSectionDataBinding",
|
25559
25561
|
"rowExpansionBinding",
|
@@ -25915,7 +25917,7 @@ Core_Core.prototype._batches = null;
|
|
25915
25917
|
* @return {string}
|
25916
25918
|
*/
|
25917
25919
|
Core_Core.getVersion = function () {
|
25918
|
-
return "5.1.
|
25920
|
+
return "5.1.59";
|
25919
25921
|
};
|
25920
25922
|
/** {@link ElementWrapper#dispose}
|
25921
25923
|
* @override
|
@@ -26717,6 +26719,7 @@ Core_Core.prototype.getColumnCount = function () {
|
|
26717
26719
|
* @fires Core#columnAdded
|
26718
26720
|
* @fires Core#preSectionRender
|
26719
26721
|
* @fires Core#columnRender
|
26722
|
+
* @fires Core#beforeContentBinding
|
26720
26723
|
* @fires Core#preSectionDataBinding
|
26721
26724
|
* @fires Core#columnDataBinding
|
26722
26725
|
* @fires Core#postSectionDataBinding
|
@@ -26744,6 +26747,7 @@ Core_Core.prototype.setColumnCount = function(num) {
|
|
26744
26747
|
* @fires Core#columnAdded
|
26745
26748
|
* @fires Core#preSectionRender
|
26746
26749
|
* @fires Core#columnRender
|
26750
|
+
* @fires Core#beforeContentBinding
|
26747
26751
|
* @fires Core#preSectionDataBinding
|
26748
26752
|
* @fires Core#columnDataBinding
|
26749
26753
|
* @fires Core#postSectionDataBinding
|
@@ -26860,16 +26864,12 @@ Core_Core.prototype.removeColumnAt = function (index) {
|
|
26860
26864
|
|
26861
26865
|
if (this._hasListener("columnRemoved")) {
|
26862
26866
|
var e = {};
|
26863
|
-
var batches = this._batches;
|
26864
|
-
if(batches){
|
26865
|
-
e["batches"] = batches;
|
26866
|
-
}
|
26867
26867
|
e["atTheMiddle"] = true;
|
26868
26868
|
e["colIndex"] = index;
|
26869
26869
|
e["columns"] = "deprecated";
|
26870
26870
|
e["columnData"] = colDef["columnData"];
|
26871
26871
|
e["colId"] = colDef["id"] || "";
|
26872
|
-
this.
|
26872
|
+
this._dispatchColumnEvent("columnRemoved", e);
|
26873
26873
|
}
|
26874
26874
|
|
26875
26875
|
// Last index in view here might be different from before moving column if columns have different width.
|
@@ -27122,7 +27122,7 @@ Core_Core.prototype._moveColumn = function (fromCol, destCol) {
|
|
27122
27122
|
e["fromColIndex"] = fromCol;
|
27123
27123
|
e["toColIndex"] = destCol;
|
27124
27124
|
e["colId"] = colId; // TODO: Id may not needed
|
27125
|
-
this.
|
27125
|
+
this._dispatchColumnEvent("columnMoved", e); // add remove move
|
27126
27126
|
}
|
27127
27127
|
|
27128
27128
|
// Last index in view here might be different from before moving column if columns have different width.
|
@@ -27192,6 +27192,9 @@ Core_Core.prototype.reorderColumns = function (colRefs, destCol) {
|
|
27192
27192
|
destId = destCol;
|
27193
27193
|
}
|
27194
27194
|
|
27195
|
+
this.startBatch("move");
|
27196
|
+
|
27197
|
+
var dirty = 0;
|
27195
27198
|
if(Array.isArray(colRefs)) {
|
27196
27199
|
var srcLen = colRefs.length;
|
27197
27200
|
if(srcLen > 1) {
|
@@ -27234,7 +27237,6 @@ Core_Core.prototype.reorderColumns = function (colRefs, destCol) {
|
|
27234
27237
|
}
|
27235
27238
|
}
|
27236
27239
|
|
27237
|
-
var dirty = 0;
|
27238
27240
|
for(i = srcLen; --i >= 0;) {
|
27239
27241
|
srcId = srcIds[i]; // Only valid source columns are left at this point
|
27240
27242
|
srcIdx = this.getColumnIndex(srcId);
|
@@ -27245,17 +27247,15 @@ Core_Core.prototype.reorderColumns = function (colRefs, destCol) {
|
|
27245
27247
|
dirty |= this._moveColumnByIndex(srcIdx, destIdx);
|
27246
27248
|
destId = srcId;
|
27247
27249
|
}
|
27248
|
-
return dirty ? true : false;
|
27249
27250
|
} else {
|
27250
|
-
|
27251
|
+
dirty = this.moveColumnById(colRefs[0], destId);
|
27251
27252
|
}
|
27252
|
-
}
|
27253
|
-
|
27254
|
-
if(colRefs != null) {
|
27253
|
+
} else if(colRefs != null) {
|
27255
27254
|
// colRefs will be a number or string
|
27256
|
-
|
27255
|
+
dirty = this.moveColumnById(colRefs, destId);
|
27257
27256
|
}
|
27258
|
-
|
27257
|
+
this.stopBatch("move");
|
27258
|
+
return dirty ? true : false;
|
27259
27259
|
};
|
27260
27260
|
|
27261
27261
|
/** @public
|
@@ -27362,6 +27362,7 @@ Core_Core.prototype._deserializeColumn = function (index, jsonObj) {
|
|
27362
27362
|
* @param {number=} opt_num Default is one row
|
27363
27363
|
* @fires Core#preSectionRender
|
27364
27364
|
* @fires Core#columnRender
|
27365
|
+
* @fires Core#beforeContentBinding
|
27365
27366
|
* @fires Core#preSectionDataBinding
|
27366
27367
|
* @fires Core#columnDataBinding
|
27367
27368
|
* @fires Core#postSectionDataBinding
|
@@ -29165,6 +29166,7 @@ Core_Core.prototype.synchronizeHScrollbar = function (subGrid) {
|
|
29165
29166
|
* @param {number=} fromRowIndex INCLUSIVE If the value is undefined, the first row index will be used
|
29166
29167
|
* @param {number=} lastRowIndex INCLUSIVE If the value is undefined, the last row index will be used
|
29167
29168
|
* @param {Object=} userParam Addtional parameters to be fired with the event
|
29169
|
+
* @fires Core#beforeContentBinding
|
29168
29170
|
* @fires Core#preSectionDataBinding
|
29169
29171
|
* @fires Core#columnDataBinding
|
29170
29172
|
* @fires Core#postSectionDataBinding
|
@@ -29807,6 +29809,17 @@ Core_Core.prototype.stopBatch = function (batchType) {
|
|
29807
29809
|
|
29808
29810
|
//#region Private Methods
|
29809
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
|
29810
29823
|
*/
|
29811
29824
|
Core_Core.prototype._dispatchColumnPositionChanged = function () {
|
29812
29825
|
if(this._columnPositionConflator.conflate()) {
|
@@ -30046,20 +30059,16 @@ Core_Core.prototype._dispatchColumnAddedEvent = function (at, count, atTheMiddle
|
|
30046
30059
|
if (this._hasListener("columnAdded")) {
|
30047
30060
|
var e = {};
|
30048
30061
|
e["atTheMiddle"] = atTheMiddle;
|
30049
|
-
var batches = this._batches;
|
30050
|
-
if(batches){
|
30051
|
-
e["batches"] = batches;
|
30052
|
-
}
|
30053
30062
|
if(count === 1) {
|
30054
30063
|
e["colIndex"] = at;
|
30055
30064
|
e["context"] = ctx;
|
30056
|
-
this.
|
30065
|
+
this._dispatchColumnEvent("columnAdded", e);
|
30057
30066
|
} else {
|
30058
30067
|
var ary = Array.isArray(ctx) ? ctx : [];
|
30059
30068
|
for (var i = 0; i < count; ++i) {
|
30060
30069
|
e["colIndex"] = at + i;
|
30061
30070
|
e["context"] = ary[i];
|
30062
|
-
this.
|
30071
|
+
this._dispatchColumnEvent("columnAdded", e);
|
30063
30072
|
}
|
30064
30073
|
}
|
30065
30074
|
}
|
@@ -30201,15 +30210,11 @@ Core_Core.prototype._removeColumn = function (num) { // TODO: change the logic
|
|
30201
30210
|
|
30202
30211
|
if (this._hasListener("columnRemoved")) {
|
30203
30212
|
var e = {};
|
30204
|
-
var batches = this._batches;
|
30205
|
-
if(batches){
|
30206
|
-
e["batches"] = batches;
|
30207
|
-
}
|
30208
30213
|
for (var c = colCount; --c >= newCount; ) {
|
30209
30214
|
var colDef = removedCols[c - newCount];
|
30210
30215
|
e["colIndex"] = c;
|
30211
30216
|
e["columnData"] = colDef ? colDef["columnData"] : null;
|
30212
|
-
this.
|
30217
|
+
this._dispatchColumnEvent("columnRemoved", e);
|
30213
30218
|
}
|
30214
30219
|
}
|
30215
30220
|
};
|
@@ -30242,6 +30247,9 @@ Core_Core.prototype._onSectionDataChanged = function (e) {
|
|
30242
30247
|
rowDataCollection = dataView.getMultipleRowData(rids, fromR, toR);
|
30243
30248
|
e["dataRows"] = rowDataCollection;
|
30244
30249
|
}
|
30250
|
+
if(e["sectionType"] === "content"){
|
30251
|
+
this._dispatch("beforeContentBinding", e);
|
30252
|
+
}
|
30245
30253
|
this._dispatch("preSectionDataBinding", e);
|
30246
30254
|
|
30247
30255
|
var dataMap = this.getDataColumnMap();
|
@@ -32724,8 +32732,11 @@ SortableTitlePlugin.prototype._onColumnAdded = function (e) {
|
|
32724
32732
|
|
32725
32733
|
var sortOrder = column["sortOrder"] || column["sort"];
|
32726
32734
|
if(sortOrder != null) {
|
32727
|
-
|
32728
|
-
|
32735
|
+
sortOrder = SortableTitlePlugin._toSortOrder(sortOrder); // Invalid input will return "n"
|
32736
|
+
if(sortOrder !== "n") {
|
32737
|
+
t.clearSortState(); // clear previous sorting state
|
32738
|
+
t.sortColumn(colIndex, sortOrder);
|
32739
|
+
}
|
32729
32740
|
}
|
32730
32741
|
};
|
32731
32742
|
|