@refinitiv-ui/efx-grid 6.0.44 → 6.0.46
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 +3 -1
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +24 -3
- package/lib/column-selection-dialog/themes/base.less +23 -12
- package/lib/column-selection-dialog/themes/elemental/dark/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/elemental/dark/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/elemental/light/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/elemental/light/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/solar/charcoal/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/solar/charcoal/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/solar/pearl/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/solar/pearl/es5/all-elements.js +1 -1
- package/lib/core/dist/core.js +204 -186
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataView.d.ts +2 -0
- package/lib/core/es6/data/DataView.js +170 -81
- package/lib/core/es6/data/Segment.d.ts +2 -0
- package/lib/core/es6/data/Segment.js +6 -0
- package/lib/core/es6/grid/Core.d.ts +0 -4
- package/lib/core/es6/grid/Core.js +28 -105
- package/lib/grid/index.js +1 -1
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -4
- package/lib/tr-grid-printer/es6/GridPrinter.js +5 -5
- package/lib/tr-grid-printer/es6/index.js +1 -1
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +5 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +30 -1
- package/lib/tr-grid-util/es6/CoralItems.js +2 -2
- package/lib/tr-grid-util/es6/ElfDate.js +1 -1
- package/lib/tr-grid-util/es6/ElfUtil.js +2 -2
- package/lib/tr-grid-util/es6/ExpanderIcon.js +1 -1
- package/lib/tr-grid-util/es6/GridPlugin.js +1 -1
- package/lib/tr-grid-util/es6/Icon.js +3 -3
- package/lib/tr-grid-util/es6/MultiTableManager.js +3 -3
- package/lib/tr-grid-util/es6/RowPainter.js +6 -2
- package/lib/tr-grid-util/es6/jet/Adc.d.ts +9 -0
- package/lib/tr-grid-util/es6/jet/Adc.js +268 -0
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +96 -7
- package/lib/tr-grid-util/es6/jet/MockUtil.d.ts +7 -0
- package/lib/tr-grid-util/es6/jet/MockUtil.js +25 -0
- package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +2 -3
- package/lib/tr-grid-util/es6/jet/mockDataAPI.js +3 -288
- package/lib/types/es6/Core/data/DataView.d.ts +2 -0
- package/lib/types/es6/Core/data/Segment.d.ts +2 -0
- package/lib/types/es6/Core/grid/Core.d.ts +0 -4
- package/lib/types/es6/RowFiltering.d.ts +5 -0
- package/lib/utils/index.d.ts +5 -3
- package/lib/utils/index.js +5 -3
- package/lib/versions.json +3 -5
- package/lib/window-exporter.js +5 -0
- package/package.json +1 -1
@@ -31,7 +31,6 @@ import VirtualizedLayoutGrid from "./VirtualizedLayoutGrid.js";
|
|
31
31
|
* @property {string} rowId
|
32
32
|
* @property {number} rowIndex
|
33
33
|
*/
|
34
|
-
/** @event Core#beforeContentBinding */
|
35
34
|
/** @event Core#postSectionDataBinding */
|
36
35
|
/** @event Core#rowHighlighted */
|
37
36
|
|
@@ -82,7 +81,6 @@ var Core = function (opt_initializer) {
|
|
82
81
|
|
83
82
|
_t._onMouseMove = _t._onMouseMove.bind(_t);
|
84
83
|
_t._onRowHightlighted = _t._onRowHightlighted.bind(_t);
|
85
|
-
_t._onGridClicked = _t._onGridClicked.bind(_t);
|
86
84
|
|
87
85
|
_t._onWindowResize = _t._onWindowResize.bind(_t);
|
88
86
|
_t._onSectionDataChanged = _t._onSectionDataChanged.bind(_t);
|
@@ -168,16 +166,11 @@ var Core = function (opt_initializer) {
|
|
168
166
|
_t._hscrollbar.setOtherScrollbar(_t._vscrollbar);
|
169
167
|
_t._vscrollbar.setOtherScrollbar(_t._hscrollbar);
|
170
168
|
|
171
|
-
if (Util.isMobile
|
169
|
+
if (Util.isMobile) {
|
172
170
|
_t._element.addEventListener("touchmove", this._onMouseMove, false);
|
173
171
|
} else {
|
174
172
|
_t._element.addEventListener("mousemove", this._onMouseMove, false);
|
175
173
|
}
|
176
|
-
|
177
|
-
if(Util.isSafari){
|
178
|
-
_t._element.addEventListener("click", this._onGridClicked);
|
179
|
-
}
|
180
|
-
|
181
174
|
window.addEventListener("resize", _t._onWindowResize, false); // Should be unlistened after destroyed
|
182
175
|
_t._rowVirtualizer.listen("indexChanged", _t._onRowInViewChanged);
|
183
176
|
_t._colVirtualizer.listen("indexChanged", _t._onColInViewChanged);
|
@@ -200,7 +193,6 @@ var Core = function (opt_initializer) {
|
|
200
193
|
"postDataSourceChanged",
|
201
194
|
"preSectionRender",
|
202
195
|
"postSectionRender",
|
203
|
-
"beforeContentBinding",
|
204
196
|
"preSectionDataBinding",
|
205
197
|
"postSectionDataBinding",
|
206
198
|
"rowExpansionBinding",
|
@@ -562,7 +554,7 @@ Core.prototype._batches = null;
|
|
562
554
|
* @return {string}
|
563
555
|
*/
|
564
556
|
Core.getVersion = function () {
|
565
|
-
return "5.1.
|
557
|
+
return "5.1.65";
|
566
558
|
};
|
567
559
|
/** {@link ElementWrapper#dispose}
|
568
560
|
* @override
|
@@ -1364,7 +1356,6 @@ Core.prototype.getColumnCount = function () {
|
|
1364
1356
|
* @fires Core#columnAdded
|
1365
1357
|
* @fires Core#preSectionRender
|
1366
1358
|
* @fires Core#columnRender
|
1367
|
-
* @fires Core#beforeContentBinding
|
1368
1359
|
* @fires Core#preSectionDataBinding
|
1369
1360
|
* @fires Core#columnDataBinding
|
1370
1361
|
* @fires Core#postSectionDataBinding
|
@@ -1392,7 +1383,6 @@ Core.prototype.setColumnCount = function(num) {
|
|
1392
1383
|
* @fires Core#columnAdded
|
1393
1384
|
* @fires Core#preSectionRender
|
1394
1385
|
* @fires Core#columnRender
|
1395
|
-
* @fires Core#beforeContentBinding
|
1396
1386
|
* @fires Core#preSectionDataBinding
|
1397
1387
|
* @fires Core#columnDataBinding
|
1398
1388
|
* @fires Core#postSectionDataBinding
|
@@ -1509,12 +1499,16 @@ Core.prototype.removeColumnAt = function (index) {
|
|
1509
1499
|
|
1510
1500
|
if (this._hasListener("columnRemoved")) {
|
1511
1501
|
var e = {};
|
1502
|
+
var batches = this._batches;
|
1503
|
+
if(batches){
|
1504
|
+
e["batches"] = batches;
|
1505
|
+
}
|
1512
1506
|
e["atTheMiddle"] = true;
|
1513
1507
|
e["colIndex"] = index;
|
1514
1508
|
e["columns"] = "deprecated";
|
1515
1509
|
e["columnData"] = colDef["columnData"];
|
1516
1510
|
e["colId"] = colDef["id"] || "";
|
1517
|
-
this.
|
1511
|
+
this._dispatch("columnRemoved", e);
|
1518
1512
|
}
|
1519
1513
|
|
1520
1514
|
// Last index in view here might be different from before moving column if columns have different width.
|
@@ -1767,7 +1761,7 @@ Core.prototype._moveColumn = function (fromCol, destCol) {
|
|
1767
1761
|
e["fromColIndex"] = fromCol;
|
1768
1762
|
e["toColIndex"] = destCol;
|
1769
1763
|
e["colId"] = colId; // TODO: Id may not needed
|
1770
|
-
this.
|
1764
|
+
this._dispatch("columnMoved", e);
|
1771
1765
|
}
|
1772
1766
|
|
1773
1767
|
// Last index in view here might be different from before moving column if columns have different width.
|
@@ -1837,9 +1831,6 @@ Core.prototype.reorderColumns = function (colRefs, destCol) {
|
|
1837
1831
|
destId = destCol;
|
1838
1832
|
}
|
1839
1833
|
|
1840
|
-
this.startBatch("move");
|
1841
|
-
|
1842
|
-
var dirty = 0;
|
1843
1834
|
if(Array.isArray(colRefs)) {
|
1844
1835
|
var srcLen = colRefs.length;
|
1845
1836
|
if(srcLen > 1) {
|
@@ -1882,6 +1873,7 @@ Core.prototype.reorderColumns = function (colRefs, destCol) {
|
|
1882
1873
|
}
|
1883
1874
|
}
|
1884
1875
|
|
1876
|
+
var dirty = 0;
|
1885
1877
|
for(i = srcLen; --i >= 0;) {
|
1886
1878
|
srcId = srcIds[i]; // Only valid source columns are left at this point
|
1887
1879
|
srcIdx = this.getColumnIndex(srcId);
|
@@ -1892,15 +1884,17 @@ Core.prototype.reorderColumns = function (colRefs, destCol) {
|
|
1892
1884
|
dirty |= this._moveColumnByIndex(srcIdx, destIdx);
|
1893
1885
|
destId = srcId;
|
1894
1886
|
}
|
1887
|
+
return dirty ? true : false;
|
1895
1888
|
} else {
|
1896
|
-
|
1889
|
+
return this.moveColumnById(colRefs[0], destId);
|
1897
1890
|
}
|
1898
|
-
}
|
1891
|
+
}
|
1892
|
+
|
1893
|
+
if(colRefs != null) {
|
1899
1894
|
// colRefs will be a number or string
|
1900
|
-
|
1895
|
+
return this.moveColumnById(colRefs, destId);
|
1901
1896
|
}
|
1902
|
-
|
1903
|
-
return dirty ? true : false;
|
1897
|
+
return false;
|
1904
1898
|
};
|
1905
1899
|
|
1906
1900
|
/** @public
|
@@ -2007,7 +2001,6 @@ Core.prototype._deserializeColumn = function (index, jsonObj) {
|
|
2007
2001
|
* @param {number=} opt_num Default is one row
|
2008
2002
|
* @fires Core#preSectionRender
|
2009
2003
|
* @fires Core#columnRender
|
2010
|
-
* @fires Core#beforeContentBinding
|
2011
2004
|
* @fires Core#preSectionDataBinding
|
2012
2005
|
* @fires Core#columnDataBinding
|
2013
2006
|
* @fires Core#postSectionDataBinding
|
@@ -3811,7 +3804,6 @@ Core.prototype.synchronizeHScrollbar = function (subGrid) {
|
|
3811
3804
|
* @param {number=} fromRowIndex INCLUSIVE If the value is undefined, the first row index will be used
|
3812
3805
|
* @param {number=} lastRowIndex INCLUSIVE If the value is undefined, the last row index will be used
|
3813
3806
|
* @param {Object=} userParam Addtional parameters to be fired with the event
|
3814
|
-
* @fires Core#beforeContentBinding
|
3815
3807
|
* @fires Core#preSectionDataBinding
|
3816
3808
|
* @fires Core#columnDataBinding
|
3817
3809
|
* @fires Core#postSectionDataBinding
|
@@ -4417,53 +4409,6 @@ Core.prototype.getColumnGroupChildIds = function (groupId) {
|
|
4417
4409
|
return null;
|
4418
4410
|
};
|
4419
4411
|
|
4420
|
-
/** @public
|
4421
|
-
* @description Get a list of objects with column id and column index in sorted order
|
4422
|
-
* @param {Array.<string>} colIds
|
4423
|
-
* @param {Object=} columnMap
|
4424
|
-
* @return {!Array.<string>} Return column array with corresponding order to UI
|
4425
|
-
* @example
|
4426
|
-
* core.getValidColumnList(["c1","c2","c5"]); // Get list of valid columns
|
4427
|
-
* core.getValidColumnList(["c1","c2","c5"],{ "c2":true, "c5":true }); // Get list of valid columns from specific mapping
|
4428
|
-
*/
|
4429
|
-
Core.prototype.getValidColumnList = function (colIds, columnMap) {
|
4430
|
-
var colList = [];
|
4431
|
-
if(!colIds){
|
4432
|
-
return colList;
|
4433
|
-
}
|
4434
|
-
if(!columnMap){
|
4435
|
-
columnMap = this.createColumnMap(colIds);
|
4436
|
-
}
|
4437
|
-
var colCount = this.getColumnCount();
|
4438
|
-
for(var c = 0; c < colCount; ++c) {
|
4439
|
-
var id = this._getColumnDef(c)["id"];
|
4440
|
-
if(columnMap[id] != null){
|
4441
|
-
colList.push({"index": c, "id": id});
|
4442
|
-
}
|
4443
|
-
}
|
4444
|
-
return colList;
|
4445
|
-
};
|
4446
|
-
|
4447
|
-
/** @public
|
4448
|
-
* @description Create mapping object from an array of strings
|
4449
|
-
* @param {Array.<string>=} colIds
|
4450
|
-
* @return {!Object} Column mapping object
|
4451
|
-
*/
|
4452
|
-
Core.prototype.createColumnMap = function (colIds) {
|
4453
|
-
if(!colIds){
|
4454
|
-
colIds = this.getColumnIds();
|
4455
|
-
}
|
4456
|
-
var mappingObj = {};
|
4457
|
-
var count = colIds.length;
|
4458
|
-
for(var i = 0; i < count; i++){
|
4459
|
-
var colId = colIds[i];
|
4460
|
-
if(colId){
|
4461
|
-
mappingObj[colId] = true;
|
4462
|
-
}
|
4463
|
-
}
|
4464
|
-
return mappingObj;
|
4465
|
-
};
|
4466
|
-
|
4467
4412
|
/** @public
|
4468
4413
|
* @param {string} batchType
|
4469
4414
|
* @return {boolean}
|
@@ -4501,17 +4446,6 @@ Core.prototype.stopBatch = function (batchType) {
|
|
4501
4446
|
|
4502
4447
|
//#region Private Methods
|
4503
4448
|
/** @private
|
4504
|
-
* @param {string} type
|
4505
|
-
* @param {!Object} eventArg
|
4506
|
-
*/
|
4507
|
-
Core.prototype._dispatchColumnEvent = function (type, eventArg) {
|
4508
|
-
var batches = this._batches;
|
4509
|
-
if(batches){
|
4510
|
-
eventArg["batches"] = batches;
|
4511
|
-
}
|
4512
|
-
this._dispatch(type, eventArg);
|
4513
|
-
};
|
4514
|
-
/** @private
|
4515
4449
|
*/
|
4516
4450
|
Core.prototype._dispatchColumnPositionChanged = function () {
|
4517
4451
|
if(this._columnPositionConflator.conflate()) {
|
@@ -4751,16 +4685,20 @@ Core.prototype._dispatchColumnAddedEvent = function (at, count, atTheMiddle, ctx
|
|
4751
4685
|
if (this._hasListener("columnAdded")) {
|
4752
4686
|
var e = {};
|
4753
4687
|
e["atTheMiddle"] = atTheMiddle;
|
4688
|
+
var batches = this._batches;
|
4689
|
+
if(batches){
|
4690
|
+
e["batches"] = batches;
|
4691
|
+
}
|
4754
4692
|
if(count === 1) {
|
4755
4693
|
e["colIndex"] = at;
|
4756
4694
|
e["context"] = ctx;
|
4757
|
-
this.
|
4695
|
+
this._dispatch("columnAdded", e);
|
4758
4696
|
} else {
|
4759
4697
|
var ary = Array.isArray(ctx) ? ctx : [];
|
4760
4698
|
for (var i = 0; i < count; ++i) {
|
4761
4699
|
e["colIndex"] = at + i;
|
4762
4700
|
e["context"] = ary[i];
|
4763
|
-
this.
|
4701
|
+
this._dispatch("columnAdded", e);
|
4764
4702
|
}
|
4765
4703
|
}
|
4766
4704
|
}
|
@@ -4902,11 +4840,15 @@ Core.prototype._removeColumn = function (num) { // TODO: change the logic to us
|
|
4902
4840
|
|
4903
4841
|
if (this._hasListener("columnRemoved")) {
|
4904
4842
|
var e = {};
|
4843
|
+
var batches = this._batches;
|
4844
|
+
if(batches){
|
4845
|
+
e["batches"] = batches;
|
4846
|
+
}
|
4905
4847
|
for (var c = colCount; --c >= newCount; ) {
|
4906
4848
|
var colDef = removedCols[c - newCount];
|
4907
4849
|
e["colIndex"] = c;
|
4908
4850
|
e["columnData"] = colDef ? colDef["columnData"] : null;
|
4909
|
-
this.
|
4851
|
+
this._dispatch("columnRemoved", e);
|
4910
4852
|
}
|
4911
4853
|
}
|
4912
4854
|
};
|
@@ -4939,9 +4881,6 @@ Core.prototype._onSectionDataChanged = function (e) {
|
|
4939
4881
|
rowDataCollection = dataView.getMultipleRowData(rids, fromR, toR);
|
4940
4882
|
e["dataRows"] = rowDataCollection;
|
4941
4883
|
}
|
4942
|
-
if(e["sectionType"] === "content"){
|
4943
|
-
this._dispatch("beforeContentBinding", e);
|
4944
|
-
}
|
4945
4884
|
this._dispatch("preSectionDataBinding", e);
|
4946
4885
|
|
4947
4886
|
var dataMap = this.getDataColumnMap();
|
@@ -4956,13 +4895,9 @@ Core.prototype._onSectionDataChanged = function (e) {
|
|
4956
4895
|
for (var r = fromR; r < toR; ++r) {
|
4957
4896
|
if(hasDataView) {
|
4958
4897
|
var rowData = rowDataCollection[r];
|
4959
|
-
if(!rowData) { // This is a header row
|
4960
|
-
continue;
|
4961
|
-
}
|
4962
|
-
|
4963
4898
|
e["rowData"] = rowData;
|
4964
4899
|
e["rowId"] = rids[r];
|
4965
|
-
e["dataValue"] = rowData[cid];
|
4900
|
+
e["dataValue"] = rowData ? rowData[cid] : null;
|
4966
4901
|
}
|
4967
4902
|
e["rowIndex"] = r;
|
4968
4903
|
e["cell"] = section["getCell"](c, r, false); // Accessing cell by using bracket allows extenal object to mock Section
|
@@ -5303,18 +5238,6 @@ Core.prototype._onMouseMove = function () {
|
|
5303
5238
|
this._vscrollbar.flash();
|
5304
5239
|
this._hscrollbar.flash();
|
5305
5240
|
};
|
5306
|
-
/** @private */
|
5307
|
-
Core.prototype._onGridClicked = function () {
|
5308
|
-
// research for dragging
|
5309
|
-
var selection = window.getSelection();
|
5310
|
-
if(selection.toString()){
|
5311
|
-
return;
|
5312
|
-
}
|
5313
|
-
var activeElem = document.activeElement;
|
5314
|
-
if(!this._element.contains(activeElem)){
|
5315
|
-
this.focus();
|
5316
|
-
}
|
5317
|
-
};
|
5318
5241
|
|
5319
5242
|
/** @private
|
5320
5243
|
* @param {Object} e
|
package/lib/grid/index.js
CHANGED
package/lib/index.d.ts
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
// Util
|
2
|
-
import {DataGenerator} from "./tr-grid-util/es6/jet/DataGenerator.js"
|
3
|
-
|
4
1
|
// Extensions
|
5
2
|
import {ColumnDragging} from "./column-dragging/es6/ColumnDragging.js";
|
6
3
|
import {RowSegmenting} from "./row-segmenting/es6/RowSegmenting.js";
|
@@ -53,7 +50,6 @@ import {SimpleToggleFormatter} from "./formatters/es6/SimpleToggleFormatter.js";
|
|
53
50
|
import {TextFormatter} from "./formatters/es6/TextFormatter.js";
|
54
51
|
|
55
52
|
export {
|
56
|
-
DataGenerator,
|
57
53
|
ColumnDragging,
|
58
54
|
RowSegmenting,
|
59
55
|
StatisticsRow,
|
package/lib/index.js
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
// Util
|
2
|
-
import {DataGenerator} from "./tr-grid-util/es6/jet/DataGenerator.js"
|
3
|
-
|
4
1
|
// Extensions
|
5
2
|
import {ColumnDragging} from "./column-dragging/es6/ColumnDragging.js";
|
6
3
|
import {RowSegmenting} from "./row-segmenting/es6/RowSegmenting.js";
|
@@ -53,7 +50,6 @@ import {SimpleToggleFormatter} from "./formatters/es6/SimpleToggleFormatter.js";
|
|
53
50
|
import {TextFormatter} from "./formatters/es6/TextFormatter.js";
|
54
51
|
|
55
52
|
export {
|
56
|
-
DataGenerator,
|
57
53
|
ColumnDragging,
|
58
54
|
RowSegmenting,
|
59
55
|
StatisticsRow,
|
@@ -114,13 +114,13 @@ var _setColumnAlignment = function (tbl, colIndex, alignment) {
|
|
114
114
|
};
|
115
115
|
|
116
116
|
/** @private
|
117
|
-
* @param {*} grid grid element, currently supports atlas-blotter,
|
117
|
+
* @param {*} grid grid element, currently supports atlas-blotter, emerald-grid, tr.CompositeGrid, rt.Grid and Core
|
118
118
|
* @return {Object} core grid
|
119
119
|
*/
|
120
120
|
var _getCoreGrid = function (grid) {
|
121
121
|
var core = null;
|
122
122
|
try {
|
123
|
-
if (grid.api) { //
|
123
|
+
if (grid.api) { // emerald-grid or atlas-blotter
|
124
124
|
core = grid.api.getCoreGrid();
|
125
125
|
} else if (grid.getCoreGrid) { // tr.CompositeGrid or rt.Grid
|
126
126
|
core = grid.getCoreGrid();
|
@@ -352,7 +352,7 @@ GridPrinter.getPreFlightInfo = function (grid, options) {
|
|
352
352
|
};
|
353
353
|
|
354
354
|
/** @public
|
355
|
-
* @param {*} grid grid element, currently supports atlas-blotter,
|
355
|
+
* @param {*} grid grid element, currently supports atlas-blotter, emerald-grid, tr.CompositeGrid, rt.Grid and Core
|
356
356
|
* @param {Object=} options
|
357
357
|
* @return {Element}
|
358
358
|
*/
|
@@ -523,7 +523,7 @@ GridPrinter._applyCss = function () {
|
|
523
523
|
".tr-printing-root .tr-align-center", [
|
524
524
|
"text-align: center;"
|
525
525
|
],
|
526
|
-
".tr-printing-root .cell
|
526
|
+
".tr-printing-root .cell coral-icon", [
|
527
527
|
"margin-top: 3px;"
|
528
528
|
],
|
529
529
|
".tr-printing-root .cell .sort-symbol", [
|
@@ -647,7 +647,7 @@ GridPrinter._applyCss = function () {
|
|
647
647
|
};
|
648
648
|
|
649
649
|
/** @public
|
650
|
-
* @param {*} grid grid element, currently supports atlas-blotter,
|
650
|
+
* @param {*} grid grid element, currently supports atlas-blotter, emerald-grid, tr.CompositeGrid, rt.Grid and Core
|
651
651
|
*/
|
652
652
|
GridPrinter.print = function (grid) {
|
653
653
|
var core = null;
|
@@ -1 +1 @@
|
|
1
|
-
export * from "./GridPrinter
|
1
|
+
export * from "./GridPrinter";
|
@@ -33,6 +33,7 @@ declare namespace RowFilteringPlugin {
|
|
33
33
|
};
|
34
34
|
|
35
35
|
type Options = {
|
36
|
+
emptySegmentFiltering?: boolean|null,
|
36
37
|
disabledUI?: boolean|null,
|
37
38
|
iconActivation?: string|null,
|
38
39
|
dialogOptions?: RowFilteringPlugin.FilterDialogOptions|null,
|
@@ -114,9 +115,13 @@ declare class RowFilteringPlugin extends GridPlugin {
|
|
114
115
|
|
115
116
|
public openDialog(colIndex: number, runtimeDialogOptions?: RowFilteringPlugin.FilterDialogOptions|null): void;
|
116
117
|
|
118
|
+
public enableEmptySegmentFiltering(enabled?: boolean|null): void;
|
119
|
+
|
117
120
|
}
|
118
121
|
|
119
122
|
declare function field(colIndex: number, exp: RowFilteringPlugin.Expression|null, ctx?: (any|string)|null): boolean;
|
120
123
|
|
124
|
+
declare function crf(enabled?: boolean|null): void;
|
125
|
+
|
121
126
|
export default RowFilteringPlugin;
|
122
127
|
export { RowFilteringPlugin, RowFilteringPlugin as RowFiltering, RowFilteringPlugin as RowFilteringExtension };
|
@@ -86,6 +86,7 @@ The expression can take various forms:<br>
|
|
86
86
|
|
87
87
|
/** @typedef {Object} RowFilteringPlugin~Options
|
88
88
|
* @description The options can be specified by `rowFiltering` property of the main grid's options
|
89
|
+
* @property {boolean=} emptySegmentFiltering=false If enabled, the filter will automatically hide empty segment when all of its member are filtered out. If there is no active filter, any empty segment will not be hidden. Collapsed segment does not count as having a filter.
|
89
90
|
* @property {boolean=} disabledUI=false Deprecated in favor of `iconActivation`. Set iconActivation to none instead.
|
90
91
|
* @property {string=} iconActivation=onActiveFilter Filter icon redering behavior, can be set to `always`,`onHover`,`onActiveFilter`,or `none`
|
91
92
|
* @property {RowFilteringPlugin~FilterDialogOptions=} dialogOptions=null Default configuration for Filter Dialog, applying to all columns.
|
@@ -310,6 +311,11 @@ RowFilteringPlugin.prototype.config = function (options) {
|
|
310
311
|
this._iconActivation = "none";
|
311
312
|
}
|
312
313
|
|
314
|
+
if (rowFiltering["emptySegmentFiltering"] != null) {
|
315
|
+
// TODO: there is a chance that there is no DataView during the configuration
|
316
|
+
this.enableEmptySegmentFiltering(rowFiltering["emptySegmentFiltering"] ? true : false);
|
317
|
+
}
|
318
|
+
|
313
319
|
if (rowFiltering["iconActivation"]) {
|
314
320
|
this._iconActivation = rowFiltering["iconActivation"];
|
315
321
|
|
@@ -402,17 +408,26 @@ RowFilteringPlugin.prototype.getConfigObject = function (gridOptions) {
|
|
402
408
|
}
|
403
409
|
|
404
410
|
var extOptions = obj.rowFiltering;
|
411
|
+
var dirty = false;
|
405
412
|
|
406
413
|
if (!extOptions) {
|
407
|
-
extOptions =
|
414
|
+
extOptions = {};
|
408
415
|
}
|
409
416
|
|
410
417
|
if (this._iconActivation !== "onActiveFilter") {
|
411
418
|
extOptions.iconActivation = this._iconActivation;
|
419
|
+
dirty = true;
|
412
420
|
}
|
413
421
|
|
414
422
|
if (this._dialogOptions) {
|
415
423
|
extOptions.dialogOptions = this._dialogOptions; // TODO: dialogOptions should not contain any function
|
424
|
+
|
425
|
+
dirty = true;
|
426
|
+
} // TODO: get emptySegmentFiltering setting from DataView
|
427
|
+
|
428
|
+
|
429
|
+
if (dirty) {
|
430
|
+
obj.rowFiltering = extOptions;
|
416
431
|
}
|
417
432
|
|
418
433
|
return obj;
|
@@ -2056,6 +2071,20 @@ RowFilteringPlugin.prototype._onColumnRemoved = function (e) {
|
|
2056
2071
|
this._requestFilterRefresh();
|
2057
2072
|
}
|
2058
2073
|
};
|
2074
|
+
/** the filter will automatically hide empty segment when all of its member are filtered out. If there is no active filter, any empty segment will not be hidden. Collapsed segment does not count as having a filter.
|
2075
|
+
* @public
|
2076
|
+
* @param {boolean=} enabled=true
|
2077
|
+
*/
|
2078
|
+
|
2079
|
+
|
2080
|
+
RowFilteringPlugin.prototype.enableEmptySegmentFiltering = function (enabled) {
|
2081
|
+
var host = this._hosts[0];
|
2082
|
+
var dv = host ? host.getDataSource() : null;
|
2083
|
+
|
2084
|
+
if (dv && dv.enableEmptySegmentFiltering) {
|
2085
|
+
dv.enableEmptySegmentFiltering(enabled);
|
2086
|
+
}
|
2087
|
+
};
|
2059
2088
|
|
2060
2089
|
export default RowFilteringPlugin;
|
2061
2090
|
export { RowFilteringPlugin, RowFilteringPlugin as RowFiltering, RowFilteringPlugin as RowFilteringExtension };
|
@@ -1,11 +1,11 @@
|
|
1
1
|
/** @namespace */
|
2
2
|
var CoralItems = {};
|
3
3
|
|
4
|
-
/** Create new array with valid object items to be consumed by
|
4
|
+
/** Create new array with valid object items to be consumed by coral-select's data property from the given input
|
5
5
|
* @public
|
6
6
|
* @function
|
7
7
|
* @param {Array} userItems This can be array of anything (e.g. texts, numbers, objects or etc.).
|
8
|
-
* @return {Array.<Object>} Valid data objects for generating
|
8
|
+
* @return {Array.<Object>} Valid data objects for generating coral-item by coral-select
|
9
9
|
* @example
|
10
10
|
* CoralItems.create(["a", "b"]); // [{label: "a", value: "a"}, {label: "b", value: "b"}]
|
11
11
|
* CoralItems.create([33]); // [{label: "33", value: 33}]
|
@@ -62,7 +62,7 @@ ElfDate.prefixSingleDigit = function (n) {
|
|
62
62
|
*/
|
63
63
|
ElfDate._ymdRe = /^\d{4}\-d{2}\-\d{2}/; // eslint-disable-line
|
64
64
|
|
65
|
-
/** Returns yyyy-MM-dd string format for
|
65
|
+
/** Returns yyyy-MM-dd string format for emerald-datetime-picker.
|
66
66
|
* @public
|
67
67
|
* @function
|
68
68
|
* @param {string|Date} d
|
@@ -156,7 +156,7 @@ ElfUtil.getElfVersion = function () {
|
|
156
156
|
* @param {string} compName
|
157
157
|
* @return {number}
|
158
158
|
* @example
|
159
|
-
* ElfUtil.hasComponent("
|
159
|
+
* ElfUtil.hasComponent("coral-button"); // 1 or 3
|
160
160
|
* ElfUtil.hasComponent("unknown-button"); // 0
|
161
161
|
*/
|
162
162
|
ElfUtil.hasComponent = function (compName) {
|
@@ -329,7 +329,7 @@ ElfUtil.prepareIconPreloading = function() {
|
|
329
329
|
var iconList = ElfUtil.getIconList();
|
330
330
|
if(iconList.length) {
|
331
331
|
setTimeout(ElfUtil._onIconPreloaded, 10);
|
332
|
-
var dummyIcon = ElfUtil._dummyIcon = document.createElement("
|
332
|
+
var dummyIcon = ElfUtil._dummyIcon = document.createElement("coral-icon");
|
333
333
|
dummyIcon.style.transform = "scale(0)";
|
334
334
|
document.body.appendChild(dummyIcon);
|
335
335
|
return iconList;
|
@@ -11,7 +11,7 @@ import { ElfUtil } from "./ElfUtil.js";
|
|
11
11
|
var ExpanderIcon = function () {
|
12
12
|
var elem;
|
13
13
|
if (ExpanderIcon._iconName) {
|
14
|
-
elem = document.createElement("
|
14
|
+
elem = document.createElement("coral-icon");
|
15
15
|
elem.setAttribute("icon", ExpanderIcon._iconName);
|
16
16
|
} else {
|
17
17
|
elem = document.createElement("span");
|
@@ -419,7 +419,7 @@ GridPlugin.prototype._requestPlugin = function (host, pluginRef, configObj) {
|
|
419
419
|
};
|
420
420
|
/** Make a request to load a plugin/extension into the given core grid (tr-grid). Return a promise of plugin/extension instance
|
421
421
|
* @public
|
422
|
-
* @param {*} ref This can be
|
422
|
+
* @param {*} ref This can be emerald-grid, atlas-blotter, composite grid, real-time grid, or core grid.
|
423
423
|
* @param {*} pluginRef Plugin/Extension name or instance
|
424
424
|
* @param {Object=} configObj
|
425
425
|
* @param {*=} compositeGrid
|
@@ -5,10 +5,10 @@ var Icon = {};
|
|
5
5
|
* @function
|
6
6
|
* @param {string=} iconName
|
7
7
|
* @param {string=} className
|
8
|
-
* @return {!Element}
|
8
|
+
* @return {!Element} coral-icon element
|
9
9
|
*/
|
10
10
|
Icon.create = function(iconName, className) {
|
11
|
-
var icon = document.createElement("
|
11
|
+
var icon = document.createElement("coral-icon");
|
12
12
|
if(className) {
|
13
13
|
icon.className = className;
|
14
14
|
}
|
@@ -47,7 +47,7 @@ Icon.box = function(iconName, className, boxRef) {
|
|
47
47
|
|
48
48
|
/** @public
|
49
49
|
* @function
|
50
|
-
* @param {Element} iconElem
|
50
|
+
* @param {Element} iconElem coral-icon element
|
51
51
|
* @param {string=} iconName
|
52
52
|
*/
|
53
53
|
Icon.change = function(iconElem, iconName) {
|
@@ -12,7 +12,7 @@ import { Dom } from "./Dom.js";
|
|
12
12
|
var GridElements = {
|
13
13
|
"EFX-GRID": 1,
|
14
14
|
"ATLAS-BLOTTER": 1,
|
15
|
-
"
|
15
|
+
"EMERALD-GRID": 1
|
16
16
|
};
|
17
17
|
/** @type {Object.<string, number>}
|
18
18
|
* @private
|
@@ -23,7 +23,7 @@ var InvalidHostElements = {
|
|
23
23
|
"HTML": 1,
|
24
24
|
"EFX-GRID": 1,
|
25
25
|
"ATLAS-BLOTTER": 1,
|
26
|
-
"
|
26
|
+
"EMERALD-GRID": 1
|
27
27
|
};
|
28
28
|
|
29
29
|
/** @private
|
@@ -76,7 +76,7 @@ var MultiTableManager = function (gridElem) {
|
|
76
76
|
|
77
77
|
this._tables = [];
|
78
78
|
if(gridElem) {
|
79
|
-
this._emeraldGrid = gridElem.tagName === "
|
79
|
+
this._emeraldGrid = gridElem.tagName === "EMERALD-GRID";
|
80
80
|
this._tables.push(gridElem);
|
81
81
|
}
|
82
82
|
};
|
@@ -314,14 +314,17 @@ RowPainter.prototype.applyHeaderStyle = function(e) {
|
|
314
314
|
}
|
315
315
|
|
316
316
|
if (footerRow) {
|
317
|
+
// Clear the group header styles and retain only the "header" for footer style like a header. We do not currently have a design for the footer row.
|
318
|
+
cell.removeClass("main-group");
|
319
|
+
cell.removeClass("closed");
|
320
|
+
cell.removeClass("folder");
|
321
|
+
cell.unlisten("click", this._onCellClicked); // The footer rows should not be clickable
|
317
322
|
if(stretching) {
|
318
323
|
cell.setContent("");
|
319
324
|
}
|
320
|
-
// TODO: Render color tag for footer rows
|
321
325
|
} else {
|
322
326
|
cell.enableClass("main-group", e.groupLevel === 1); // For color tag of root group header
|
323
327
|
cell.enableClass("closed", e.collapsed ? true : false);
|
324
|
-
cell.enableClass("header");
|
325
328
|
cell.enableClass("folder");
|
326
329
|
if (stretching) {
|
327
330
|
if (this._headerMenuClicked) {
|
@@ -345,6 +348,7 @@ RowPainter.prototype.applyHeaderStyle = function(e) {
|
|
345
348
|
cell.setContent(e.groupId || "");
|
346
349
|
}
|
347
350
|
}
|
351
|
+
cell.enableClass("header");
|
348
352
|
cell.enableClass("color-tag", true);
|
349
353
|
RowPainter._applyColorTagClass(cell, e.colorTagClass);
|
350
354
|
cell.setStyle("paddingLeft", (e.indentSize > 0) ? e.indentSize + "px" : "");
|