@refinitiv-ui/efx-grid 6.0.14 → 6.0.16
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-format-dialog/index.d.ts +2 -1
- package/lib/column-format-dialog/index.js +2 -1
- package/lib/column-selection-dialog/index.d.ts +2 -1
- package/lib/column-selection-dialog/index.js +2 -1
- package/lib/core/dist/core.js +19 -9
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataTable.js +1 -1
- package/lib/core/es6/data/Segment.d.ts +3 -3
- package/lib/core/es6/data/Segment.js +14 -6
- package/lib/core/es6/data/SegmentCollection.d.ts +1 -1
- package/lib/core/es6/data/SegmentCollection.js +3 -1
- package/lib/core/es6/grid/Core.js +1 -1
- package/lib/filter-dialog/index.d.ts +2 -1
- package/lib/filter-dialog/index.js +2 -1
- package/lib/grid/index.d.ts +2 -1
- package/lib/grid/index.js +3 -2
- package/lib/rt-grid/dist/rt-grid.js +740 -84
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +10 -0
- package/lib/rt-grid/es6/ColumnDefinition.js +110 -1
- package/lib/rt-grid/es6/FieldDefinition.d.ts +6 -0
- package/lib/rt-grid/es6/FieldDefinition.js +43 -0
- package/lib/rt-grid/es6/Grid.d.ts +2 -0
- package/lib/rt-grid/es6/Grid.js +206 -8
- package/lib/rt-grid/es6/RowDefinition.d.ts +4 -0
- package/lib/rt-grid/es6/RowDefinition.js +57 -0
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +1 -0
- package/lib/rt-grid/es6/SnapshotFiller.js +125 -17
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +2 -2
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +30 -29
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +176 -98
- package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +17 -15
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +89 -159
- package/lib/versions.json +4 -4
- package/package.json +15 -2
@@ -9,6 +9,20 @@ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
|
9
9
|
* @description click event is dispatched when a user clicks the column filter icon.
|
10
10
|
*/
|
11
11
|
|
12
|
+
/** @event RowFilteringPlugin#beforeDialogOpened
|
13
|
+
* @description Fired before the opening of filter dialog. This can be used to cancel the operation or set a dialog configuration at runtime.
|
14
|
+
* @property {number} colIndex Column index
|
15
|
+
* @property {string} field Field
|
16
|
+
* @property {Object} grid Core grid instance
|
17
|
+
* @example
|
18
|
+
* beforeDialogOpened: function(e) {
|
19
|
+
* e.cancel = true; // To cancel the operation
|
20
|
+
* },
|
21
|
+
* beforeDialogOpened: function(e) {
|
22
|
+
* e.dialogOptions = { sortLogic: func }; // To set a dialog configuration
|
23
|
+
* },
|
24
|
+
*/
|
25
|
+
|
12
26
|
/** @event RowFilteringPlugin#iconCreated
|
13
27
|
* @description iconCreated event is dispatched when a new column filter icon is created.
|
14
28
|
* @property {Element} icon Filter icon element
|
@@ -60,7 +74,7 @@ The expression can take various forms:<br>
|
|
60
74
|
*/
|
61
75
|
|
62
76
|
/** @typedef {Object} RowFilteringPlugin~FilterDialogOptions
|
63
|
-
* @description Options that
|
77
|
+
* @description Options that specify UIs of filter dialog
|
64
78
|
* @property {boolean=} sortUI show/hide sort UI
|
65
79
|
* @property {boolean=} filterUI show/hide filter UI
|
66
80
|
* @property {string=} fieldDataType data type of column
|
@@ -72,8 +86,9 @@ The expression can take various forms:<br>
|
|
72
86
|
|
73
87
|
/** @typedef {Object} RowFilteringPlugin~Options
|
74
88
|
* @description The options can be specified by `rowFiltering` property of the main grid's options
|
75
|
-
* @property {boolean=} disabledUI=false
|
89
|
+
* @property {boolean=} disabledUI=false Deprecated in favor of `iconActivation`. Set iconActivation to none instead.
|
76
90
|
* @property {string=} iconActivation=onActiveFilter Filter icon redering behavior, can be set to `always`,`onHover`,`onActiveFilter`,or `none`
|
91
|
+
* @property {RowFilteringPlugin~FilterDialogOptions=} dialogOptions=null Default configuration for Filter Dialog, applying to all columns.
|
77
92
|
* @property {Function=} click=null Event handler dispatched when a user clicks the column filter icon.
|
78
93
|
* @property {Function=} clicked=null Alias to `click` event handler
|
79
94
|
* @property {Function=} iconCreated=null Event handler dispatched when a new column filter icon is created.
|
@@ -105,7 +120,7 @@ var RowFilteringPlugin = function RowFilteringPlugin() {
|
|
105
120
|
t._onPreSectionRender = t._onPreSectionRender.bind(t);
|
106
121
|
t._onColumnAdded = t._onColumnAdded.bind(t);
|
107
122
|
t._onColumnRemoved = t._onColumnRemoved.bind(t);
|
108
|
-
t.
|
123
|
+
t._onIconClicked = t._onIconClicked.bind(t);
|
109
124
|
t._filterLogic = t._filterLogic.bind(t);
|
110
125
|
t._updateAllColumnIcons = t._updateAllColumnIcons.bind(t);
|
111
126
|
t.refresh = t.refresh.bind(t);
|
@@ -203,6 +218,11 @@ RowFilteringPlugin.prototype._rowTransform = null;
|
|
203
218
|
*/
|
204
219
|
|
205
220
|
RowFilteringPlugin.prototype._filterDialog = null;
|
221
|
+
/** @type {RowFilteringPlugin~FilterDialogOptions}
|
222
|
+
* @private
|
223
|
+
*/
|
224
|
+
|
225
|
+
RowFilteringPlugin.prototype._dialogOptions = null;
|
206
226
|
/** @type {FilterBuilder}
|
207
227
|
* @private
|
208
228
|
*/
|
@@ -308,11 +328,16 @@ RowFilteringPlugin.prototype.config = function (options) {
|
|
308
328
|
}
|
309
329
|
}
|
310
330
|
|
331
|
+
if (rowFiltering["dialogOptions"]) {
|
332
|
+
this._dialogOptions = rowFiltering["dialogOptions"];
|
333
|
+
}
|
334
|
+
|
311
335
|
if (rowFiltering["clicked"]) {
|
312
336
|
rowFiltering["click"] = rowFiltering["clicked"];
|
313
337
|
}
|
314
338
|
|
315
339
|
this.addListener(rowFiltering, "click");
|
340
|
+
this.addListener(rowFiltering, "beforeDialogOpened");
|
316
341
|
this.addListener(rowFiltering, "iconCreated");
|
317
342
|
this.addListener(rowFiltering, "filterChanged");
|
318
343
|
this.addListener(rowFiltering, "refreshed");
|
@@ -356,17 +381,17 @@ RowFilteringPlugin.prototype.getConfigObject = function (gridOptions) {
|
|
356
381
|
column = columns[i] = {};
|
357
382
|
}
|
358
383
|
|
359
|
-
var
|
384
|
+
var cfo = this._getColumnFilterOption(i);
|
360
385
|
|
361
|
-
if (
|
362
|
-
var exp =
|
386
|
+
if (cfo) {
|
387
|
+
var exp = cfo._expressions[0];
|
363
388
|
|
364
389
|
if (exp && typeof exp !== "function") {
|
365
390
|
// TODO: Accept function type
|
366
391
|
column.filter = exp; // This could be string, array, or object
|
367
392
|
}
|
368
393
|
|
369
|
-
var ctx =
|
394
|
+
var ctx = cfo._context[0];
|
370
395
|
|
371
396
|
if (ctx != null) {
|
372
397
|
if (_typeof(ctx) !== "object" || !ctx._autoGenerated) {
|
@@ -382,7 +407,14 @@ RowFilteringPlugin.prototype.getConfigObject = function (gridOptions) {
|
|
382
407
|
extOptions = obj.rowFiltering = {};
|
383
408
|
}
|
384
409
|
|
385
|
-
|
410
|
+
if (this._iconActivation !== "onActiveFilter") {
|
411
|
+
extOptions.iconActivation = this._iconActivation;
|
412
|
+
}
|
413
|
+
|
414
|
+
if (this._dialogOptions) {
|
415
|
+
extOptions.dialogOptions = this._dialogOptions; // TODO: dialogOptions should not contain any function
|
416
|
+
}
|
417
|
+
|
386
418
|
return obj;
|
387
419
|
};
|
388
420
|
/** All filter logics in DataView will be temporarily removed until re-enabling. This is useful when trying to insert an item at the specified index. After re-enabling, both logics and icons will be restored.
|
@@ -617,7 +649,8 @@ RowFilteringPlugin.prototype.setColumnFilter = function (colIndex, exp, ctx) {
|
|
617
649
|
|
618
650
|
return removed || added;
|
619
651
|
};
|
620
|
-
/**
|
652
|
+
/** Set data to colData["rowFiltering"]
|
653
|
+
* @private
|
621
654
|
* @param {number} colIndex
|
622
655
|
* @param {RowFilteringPlugin~ColumnOptions} columnOptions
|
623
656
|
* @example
|
@@ -658,7 +691,7 @@ RowFilteringPlugin.prototype._setColumnOptions = function (colIndex, columnOptio
|
|
658
691
|
};
|
659
692
|
/** @private
|
660
693
|
* @param {number} colIndex
|
661
|
-
* @return {Object
|
694
|
+
* @return {Object} colData["rowFiltering"]
|
662
695
|
*/
|
663
696
|
|
664
697
|
|
@@ -684,7 +717,7 @@ RowFilteringPlugin.prototype._newExtColumnOptions = function (colIndex) {
|
|
684
717
|
};
|
685
718
|
/** @private
|
686
719
|
* @param {number} colIndex
|
687
|
-
* @return {Object
|
720
|
+
* @return {Object} colData["rowFiltering"]["filterOption"]
|
688
721
|
*/
|
689
722
|
|
690
723
|
|
@@ -697,7 +730,8 @@ RowFilteringPlugin.prototype._getColumnFilterOption = function (colIndex) {
|
|
697
730
|
return null;
|
698
731
|
}
|
699
732
|
};
|
700
|
-
/**
|
733
|
+
/** Set data to colData["rowFiltering"]["filterOption"]
|
734
|
+
* @private
|
701
735
|
* @param {number} colIndex
|
702
736
|
* @param {Object} filterOption
|
703
737
|
*/
|
@@ -1098,15 +1132,14 @@ RowFilteringPlugin.prototype._onPreSectionRender = function (e) {
|
|
1098
1132
|
*/
|
1099
1133
|
|
1100
1134
|
|
1101
|
-
RowFilteringPlugin.prototype.
|
1135
|
+
RowFilteringPlugin.prototype._onIconClicked = function (e) {
|
1102
1136
|
var host = this._hosts[0];
|
1103
1137
|
|
1104
1138
|
if (!host) {
|
1105
1139
|
return;
|
1106
1140
|
}
|
1107
1141
|
|
1108
|
-
var pos = host.getRelativePosition(e);
|
1109
|
-
|
1142
|
+
var pos = host.getRelativePosition(e);
|
1110
1143
|
this.openDialog(pos.colIndex);
|
1111
1144
|
e.stopPropagation();
|
1112
1145
|
e.preventDefault();
|
@@ -1308,7 +1341,7 @@ RowFilteringPlugin.prototype._updateColumnIcon = function (colIndex) {
|
|
1308
1341
|
|
1309
1342
|
filterIcon.classList.add("title-filter-icon"); // Icon reference
|
1310
1343
|
|
1311
|
-
filterIcon.addEventListener("click", this.
|
1344
|
+
filterIcon.addEventListener("click", this._onIconClicked, false);
|
1312
1345
|
|
1313
1346
|
this._dispatch("iconCreated", {
|
1314
1347
|
"icon": filterIcon,
|
@@ -1552,11 +1585,11 @@ RowFilteringPlugin.prototype.getUniqueValues = function (field, formatter, fmtFi
|
|
1552
1585
|
};
|
1553
1586
|
/** @public
|
1554
1587
|
* @param {number} colIndex
|
1555
|
-
* @param {RowFilteringPlugin~FilterDialogOptions=}
|
1588
|
+
* @param {RowFilteringPlugin~FilterDialogOptions=} runtimeDialogOptions
|
1556
1589
|
*/
|
1557
1590
|
|
1558
1591
|
|
1559
|
-
RowFilteringPlugin.prototype.openDialog = function (colIndex,
|
1592
|
+
RowFilteringPlugin.prototype.openDialog = function (colIndex, runtimeDialogOptions) {
|
1560
1593
|
var stp = this._getPlugin("SortableTitlePlugin");
|
1561
1594
|
|
1562
1595
|
if (!this._filterDialog) {
|
@@ -1584,7 +1617,7 @@ RowFilteringPlugin.prototype.openDialog = function (colIndex, options) {
|
|
1584
1617
|
}
|
1585
1618
|
|
1586
1619
|
if (this._filterDialog.isShown) {
|
1587
|
-
this._filterDialog.hide(); // Hide previously
|
1620
|
+
this._filterDialog.hide(); // Hide previously opened dialog
|
1588
1621
|
|
1589
1622
|
|
1590
1623
|
if (this._filterDialog._colIndex === colIndex) {
|
@@ -1620,27 +1653,89 @@ RowFilteringPlugin.prototype.openDialog = function (colIndex, options) {
|
|
1620
1653
|
return; // The specified column has no field
|
1621
1654
|
}
|
1622
1655
|
|
1656
|
+
if (this.hasListener("beforeDialogOpened")) {
|
1657
|
+
var arg = {
|
1658
|
+
colIndex: colIndex,
|
1659
|
+
field: field,
|
1660
|
+
grid: host
|
1661
|
+
};
|
1662
|
+
|
1663
|
+
if (runtimeDialogOptions) {
|
1664
|
+
arg["dialogOptions"] = runtimeDialogOptions;
|
1665
|
+
}
|
1666
|
+
|
1667
|
+
this._dispatch("beforeDialogOpened", arg);
|
1668
|
+
|
1669
|
+
if (arg["cancel"]) {
|
1670
|
+
return;
|
1671
|
+
}
|
1672
|
+
|
1673
|
+
if (arg["dialogOptions"]) {
|
1674
|
+
runtimeDialogOptions = arg["dialogOptions"];
|
1675
|
+
}
|
1676
|
+
}
|
1677
|
+
|
1678
|
+
if (_typeof(runtimeDialogOptions) !== "object") {
|
1679
|
+
runtimeDialogOptions = null;
|
1680
|
+
}
|
1681
|
+
|
1623
1682
|
if (stp) {
|
1624
1683
|
this._filterDialog.setSortState(stp.getSortOrder(colIndex)); // This is for ELF v3
|
1625
1684
|
|
1626
|
-
} //
|
1685
|
+
} // Setting up dialog configuration
|
1686
|
+
// cfo is required for storing unique entries in the dialog, even though no filter is active
|
1627
1687
|
|
1628
1688
|
|
1629
|
-
var cfo = this._initColumnFilterOption(colIndex);
|
1689
|
+
var cfo = this._initColumnFilterOption(colIndex); // colData["rowFiltering"]["filterOption"]
|
1630
1690
|
|
1631
|
-
var rawDataAccessor = cfo._rawDataAccessor || null;
|
1632
|
-
var formattedDataAccessor = cfo._formattedDataAccessor || null;
|
1633
1691
|
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1692
|
+
var colOptions = this._getExtColumnOptions(colIndex); // colData["rowFiltering"]
|
1693
|
+
|
1694
|
+
|
1695
|
+
var colData = host.getColumnData(colIndex);
|
1696
|
+
var formatOptions = colData.formatOptions;
|
1697
|
+
var useUTCTime = false;
|
1698
|
+
|
1699
|
+
if (formatOptions) {
|
1700
|
+
if (formatOptions.formatType) {
|
1701
|
+
useUTCTime = true;
|
1702
|
+
|
1703
|
+
if (formatOptions.useUTCTime != null) {
|
1704
|
+
useUTCTime = formatOptions.useUTCTime;
|
1705
|
+
}
|
1637
1706
|
}
|
1707
|
+
}
|
1638
1708
|
|
1639
|
-
|
1640
|
-
|
1709
|
+
var dialogConfig = {
|
1710
|
+
// default config
|
1711
|
+
sortUI: true,
|
1712
|
+
filterUI: true,
|
1713
|
+
fieldDataType: "",
|
1714
|
+
lang: "",
|
1715
|
+
rawDataAccessor: null,
|
1716
|
+
formattedDataAccessor: null,
|
1717
|
+
sortLogic: null
|
1718
|
+
};
|
1719
|
+
var columnDialogOptions = null;
|
1720
|
+
|
1721
|
+
if (colOptions) {
|
1722
|
+
if (colOptions.fieldDataType) {
|
1723
|
+
// TODO: Use data type from Composite Grid (getColumnDataType) or Realtime Grid (getDataType) instead
|
1724
|
+
columnDialogOptions = {
|
1725
|
+
fieldDataType: colOptions.fieldDataType
|
1726
|
+
};
|
1641
1727
|
}
|
1642
|
-
}
|
1728
|
+
}
|
1729
|
+
|
1730
|
+
RowFilteringPlugin._overrideConfig(dialogConfig, this._dialogOptions);
|
1643
1731
|
|
1732
|
+
RowFilteringPlugin._overrideConfig(dialogConfig, columnDialogOptions);
|
1733
|
+
|
1734
|
+
RowFilteringPlugin._overrideConfig(dialogConfig, runtimeDialogOptions);
|
1735
|
+
|
1736
|
+
var rawDataAccessor = cfo._rawDataAccessor = dialogConfig.rawDataAccessor || null;
|
1737
|
+
var formattedDataAccessor = cfo._formattedDataAccessor = dialogConfig.formattedDataAccessor || null;
|
1738
|
+
var sortLogic = dialogConfig.sortLogic || null; // Populate data for filter dialog based on existing states
|
1644
1739
|
|
1645
1740
|
var customFilter = cfo._expressions[0] || "";
|
1646
1741
|
var ctx = cfo._context[0];
|
@@ -1655,8 +1750,7 @@ RowFilteringPlugin.prototype.openDialog = function (colIndex, options) {
|
|
1655
1750
|
var uniqueValues = cfo.uniqueValues = this.getUniqueValues(field, this._getFormatter(colIndex), "", rawDataAccessor, formattedDataAccessor);
|
1656
1751
|
var keys = Object.keys(uniqueValues);
|
1657
1752
|
|
1658
|
-
if (
|
1659
|
-
var sortLogic = options.sortLogic;
|
1753
|
+
if (sortLogic) {
|
1660
1754
|
keys.sort(function (a, b) {
|
1661
1755
|
var rawValueA = uniqueValues[a][0];
|
1662
1756
|
var rawValueB = uniqueValues[b][0];
|
@@ -1671,96 +1765,80 @@ RowFilteringPlugin.prototype.openDialog = function (colIndex, options) {
|
|
1671
1765
|
nodes: [],
|
1672
1766
|
checked: selectedItems[formattedVal] ? true : false
|
1673
1767
|
};
|
1674
|
-
}); //
|
1768
|
+
}); // Initialize dialog
|
1675
1769
|
|
1676
|
-
|
1770
|
+
if (this._filterDialog.init) {
|
1771
|
+
// TODO: support initiailization in v1
|
1772
|
+
this._filterDialog.init(dialogConfig);
|
1773
|
+
} // TODO: Move all settings to configuration object
|
1677
1774
|
|
1678
|
-
var fdt = "";
|
1679
|
-
var sui = true;
|
1680
|
-
var fui = true;
|
1681
|
-
var lang = "";
|
1682
1775
|
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1776
|
+
this._filterDialog.useUTCTime = useUTCTime;
|
1777
|
+
this._filterDialog.target = cell.getElement();
|
1778
|
+
this._filterDialog._colIndex = colIndex;
|
1779
|
+
this._filterDialog.data = items; // TODO: Move all settings to configuration object
|
1687
1780
|
|
1688
|
-
|
1689
|
-
|
1690
|
-
}
|
1781
|
+
this._filterDialog.filterMode = customFilter ? "advanced" : "";
|
1782
|
+
this._filterDialog.conditions = customFilter; // WARNING: This must be 2D Array
|
1691
1783
|
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1784
|
+
this._filterDialog.show();
|
1785
|
+
};
|
1786
|
+
/** @private
|
1787
|
+
* @function
|
1788
|
+
* @param {Object} config
|
1789
|
+
* @param {RowFilteringPlugin~FilterDialogOptions=} userConfig
|
1790
|
+
*/
|
1695
1791
|
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1792
|
+
|
1793
|
+
RowFilteringPlugin._overrideConfig = function (config, userConfig) {
|
1794
|
+
if (!userConfig) {
|
1795
|
+
return;
|
1699
1796
|
}
|
1700
1797
|
|
1701
|
-
var
|
1702
|
-
sortUI: sui,
|
1703
|
-
filterUI: fui,
|
1704
|
-
fieldDataType: fdt,
|
1705
|
-
lang: lang
|
1706
|
-
};
|
1798
|
+
var sortUI = userConfig["sortUI"];
|
1707
1799
|
|
1708
|
-
if (
|
1709
|
-
|
1710
|
-
|
1711
|
-
var filterUI = options["filterUI"];
|
1712
|
-
var optionLang = options["lang"];
|
1800
|
+
if (sortUI != null) {
|
1801
|
+
config.sortUI = sortUI;
|
1802
|
+
}
|
1713
1803
|
|
1714
|
-
|
1715
|
-
dialogConfig.sortUI = sortUI;
|
1716
|
-
colOptions.sortUI = sortUI;
|
1717
|
-
}
|
1804
|
+
var filterUI = userConfig["filterUI"];
|
1718
1805
|
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
}
|
1806
|
+
if (filterUI != null) {
|
1807
|
+
config.filterUI = filterUI;
|
1808
|
+
}
|
1723
1809
|
|
1724
|
-
|
1725
|
-
dialogConfig.fieldDataType = fieldDataType;
|
1726
|
-
colOptions.fieldDataType = fieldDataType;
|
1727
|
-
}
|
1810
|
+
var fieldDataType = userConfig["fieldDataType"];
|
1728
1811
|
|
1729
|
-
|
1730
|
-
|
1731
|
-
colOptions.lang = optionLang;
|
1732
|
-
}
|
1812
|
+
if (fieldDataType != null) {
|
1813
|
+
config.fieldDataType = fieldDataType;
|
1733
1814
|
}
|
1734
1815
|
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1816
|
+
var lang = userConfig["lang"];
|
1817
|
+
|
1818
|
+
if (lang != null) {
|
1819
|
+
config.lang = lang;
|
1738
1820
|
}
|
1739
1821
|
|
1740
|
-
var
|
1741
|
-
var formatOptions = colData.formatOptions;
|
1742
|
-
var useUTCTime = false;
|
1822
|
+
var rawDataAccessor = userConfig["rawDataAccessor"];
|
1743
1823
|
|
1744
|
-
if (
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
if (formatOptions.useUTCTime != null) {
|
1749
|
-
useUTCTime = formatOptions.useUTCTime;
|
1750
|
-
}
|
1751
|
-
}
|
1824
|
+
if (typeof rawDataAccessor === "function" || rawDataAccessor === null) {
|
1825
|
+
// Allow null value
|
1826
|
+
config.rawDataAccessor = rawDataAccessor;
|
1752
1827
|
}
|
1753
1828
|
|
1754
|
-
|
1755
|
-
this._filterDialog.target = cell.getElement();
|
1756
|
-
this._filterDialog._colIndex = colIndex;
|
1757
|
-
this._filterDialog.data = items; // TODO: Move all settings to configuration object
|
1829
|
+
var formattedDataAccessor = userConfig["formattedDataAccessor"];
|
1758
1830
|
|
1759
|
-
|
1831
|
+
if (typeof formattedDataAccessor === "function" || formattedDataAccessor === null) {
|
1832
|
+
// Allow null value
|
1833
|
+
config.formattedDataAccessor = formattedDataAccessor;
|
1834
|
+
}
|
1760
1835
|
|
1761
|
-
|
1836
|
+
var sortLogic = userConfig["sortLogic"];
|
1762
1837
|
|
1763
|
-
|
1838
|
+
if (typeof sortLogic === "function" || sortLogic === null) {
|
1839
|
+
// Allow null value
|
1840
|
+
config.sortLogic = sortLogic;
|
1841
|
+
}
|
1764
1842
|
};
|
1765
1843
|
/** @private
|
1766
1844
|
* @param {number} colIndex
|
@@ -5,20 +5,22 @@ import {injectCss, prettifyCss} from "../../tr-grid-util/es6/Util.js";
|
|
5
5
|
declare namespace RowColoringPlugin {
|
6
6
|
|
7
7
|
type Options = {
|
8
|
-
bgColoring?: boolean,
|
9
|
-
textColoring?: boolean,
|
10
|
-
bgColorField?: string,
|
11
|
-
textColorField?: string,
|
12
|
-
cssField?: string,
|
8
|
+
bgColoring?: boolean|null,
|
9
|
+
textColoring?: boolean|null,
|
10
|
+
bgColorField?: string|null,
|
11
|
+
textColorField?: string|null,
|
12
|
+
cssField?: string|null,
|
13
|
+
cssRangeField?: string|null,
|
14
|
+
altCssField?: string|null,
|
13
15
|
predefinedColors?: any,
|
14
|
-
predefinedColoring?: boolean
|
16
|
+
predefinedColoring?: boolean|null
|
15
17
|
};
|
16
18
|
|
17
19
|
}
|
18
20
|
|
19
21
|
declare class RowColoringPlugin extends GridPlugin {
|
20
22
|
|
21
|
-
constructor(options?: RowColoringPlugin.Options);
|
23
|
+
constructor(options?: RowColoringPlugin.Options|null);
|
22
24
|
|
23
25
|
public getName(): string;
|
24
26
|
|
@@ -30,25 +32,25 @@ declare class RowColoringPlugin extends GridPlugin {
|
|
30
32
|
|
31
33
|
public getConfigObject(gridOptions?: any): any;
|
32
34
|
|
33
|
-
public setRowColor(rowRef: string|number, bgColor?: (string|null), txtColor?: (string|null)): void;
|
35
|
+
public setRowColor(rowRef: string|number|null, bgColor?: (string|null)|null, txtColor?: (string|null)|null): void;
|
34
36
|
|
35
|
-
public getRowColor(rowRef: string|number): string;
|
37
|
+
public getRowColor(rowRef: string|number|null): string;
|
36
38
|
|
37
|
-
public removeRowColor(rowRef: string|number): void;
|
39
|
+
public removeRowColor(rowRef: string|number|null): void;
|
38
40
|
|
39
|
-
public toggleRowColor(rowRef: string|number, bgColor?: (string|null), txtColor?: (string|null), state?: boolean): boolean;
|
41
|
+
public toggleRowColor(rowRef: string|number|null, bgColor?: (string|null)|null, txtColor?: (string|null)|null, state?: boolean|null): boolean;
|
40
42
|
|
41
|
-
public setRowPredefinedColor(rowRef: string|number, color?: (string|null)): void;
|
43
|
+
public setRowPredefinedColor(rowRef: string|number|null, color?: (string|null)|null, range?: (number)[]|null, altColor?: (string|null)|null): void;
|
42
44
|
|
43
45
|
public getPredefinedColors(): any;
|
44
46
|
|
45
47
|
public setPredefinedColors(predefinedColors: any): void;
|
46
48
|
|
47
|
-
public disableTextColoring(opt_bool?: boolean): void;
|
49
|
+
public disableTextColoring(opt_bool?: boolean|null): void;
|
48
50
|
|
49
|
-
public disableBgColoring(opt_bool?: boolean): void;
|
51
|
+
public disableBgColoring(opt_bool?: boolean|null): void;
|
50
52
|
|
51
|
-
public disableRowColoring(disabled?: boolean): void;
|
53
|
+
public disableRowColoring(disabled?: boolean|null): void;
|
52
54
|
|
53
55
|
public static getContrastColor(hexColor: string): string;
|
54
56
|
|