@refinitiv-ui/efx-grid 6.0.61 → 6.0.63
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/grid/index.js +1 -1
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +3 -0
- package/lib/row-segmenting/es6/RowSegmenting.js +34 -5
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +13 -3
- package/lib/tr-grid-range-bar/es6/RangeBar.js +11 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +5 -4
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +111 -30
- package/lib/tr-grid-util/es6/FilterBuilder.js +10 -11
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +25 -23
- package/lib/tr-grid-util/es6/FilterOperators.js +26 -25
- package/lib/types/es6/RowFiltering.d.ts +4 -4
- package/lib/types/es6/RowSegmenting.d.ts +3 -0
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.js +2 -1
- package/lib/versions.json +6 -6
- package/package.json +1 -1
package/lib/grid/index.js
CHANGED
@@ -4,6 +4,7 @@ import { ExpanderIcon } from "../../tr-grid-util/es6/ExpanderIcon.js";
|
|
4
4
|
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
5
5
|
import { RowPainter } from "../../tr-grid-util/es6/RowPainter.js";
|
6
6
|
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
7
|
+
import { Conflator } from "../../tr-grid-util/es6/Conflator.js";
|
7
8
|
|
8
9
|
declare namespace RowSegmentingPlugin {
|
9
10
|
|
@@ -33,6 +34,8 @@ declare class RowSegmentingPlugin extends GridPlugin {
|
|
33
34
|
|
34
35
|
public initialize(host: any, options?: any): void;
|
35
36
|
|
37
|
+
public requestSeparatorRefresh(): void;
|
38
|
+
|
36
39
|
public unload(host?: any): void;
|
37
40
|
|
38
41
|
public config(options?: any): void;
|
@@ -4,6 +4,7 @@ import { ExpanderIcon } from "../../tr-grid-util/es6/ExpanderIcon.js";
|
|
4
4
|
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
5
5
|
import { RowPainter } from "../../tr-grid-util/es6/RowPainter.js";
|
6
6
|
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
7
|
+
import { Conflator } from "../../tr-grid-util/es6/Conflator.js";
|
7
8
|
|
8
9
|
/** @typedef {Object} RowSegmentingPlugin~Options
|
9
10
|
* @description The options can be specified by `rowSegmenting` property of the main grid's options
|
@@ -37,6 +38,8 @@ var RowSegmentingPlugin = function (options) {
|
|
37
38
|
t._updateHeader = t._updateHeader.bind(t);
|
38
39
|
t._onArrowClick = t._onArrowClick.bind(t);
|
39
40
|
t._rtSortingLogic = t._rtSortingLogic.bind(t);
|
41
|
+
t._refreshSegmentSeparator = t._refreshSegmentSeparator.bind(t);
|
42
|
+
t._separatorRefreshConflator = new Conflator(10, t._refreshSegmentSeparator);
|
40
43
|
|
41
44
|
t._hosts = [];
|
42
45
|
this.config({ rowSegmenting: options });
|
@@ -51,6 +54,10 @@ RowSegmentingPlugin.prototype._userSortingLogic = null;
|
|
51
54
|
* @private
|
52
55
|
*/
|
53
56
|
RowSegmentingPlugin.prototype._spanning = true;
|
57
|
+
/** @type {boolean}
|
58
|
+
* @private
|
59
|
+
*/
|
60
|
+
RowSegmentingPlugin.prototype._prevSegmentBySegmentId = false;
|
54
61
|
/** @type {Array.<number>}
|
55
62
|
* @private
|
56
63
|
*/
|
@@ -83,6 +90,10 @@ RowSegmentingPlugin.prototype._segmentIdField = "SEGMENT_ID";
|
|
83
90
|
* @private
|
84
91
|
*/
|
85
92
|
RowSegmentingPlugin.prototype._runningId = 0;
|
93
|
+
/** @type {Conflator}
|
94
|
+
* @private
|
95
|
+
*/
|
96
|
+
RowSegmentingPlugin.prototype._separatorRefreshConflator = null;
|
86
97
|
/** @type {Object}
|
87
98
|
* @private
|
88
99
|
*/
|
@@ -146,11 +157,25 @@ RowSegmentingPlugin.prototype.initialize = function (host, options) {
|
|
146
157
|
enabled = this._headerMenuClicked;
|
147
158
|
RowPainter.enableHeaderMenu(host, enabled ? true : false);
|
148
159
|
};
|
149
|
-
|
150
|
-
|
151
|
-
* @
|
160
|
+
|
161
|
+
/** request to set the segment separator with the segment ID field in row data
|
162
|
+
* @public
|
152
163
|
*/
|
153
|
-
RowSegmentingPlugin.prototype.
|
164
|
+
RowSegmentingPlugin.prototype.requestSeparatorRefresh = function () {
|
165
|
+
if(this._separatorRefreshConflator.conflate()) {
|
166
|
+
return;
|
167
|
+
}
|
168
|
+
this._refreshSegmentSeparator();
|
169
|
+
};
|
170
|
+
|
171
|
+
/** remove all segment separators then set the segment separator with the segment ID field in row data
|
172
|
+
* @private
|
173
|
+
*/
|
174
|
+
RowSegmentingPlugin.prototype._refreshSegmentSeparator = function () {
|
175
|
+
if(this._prevSegmentBySegmentId) { // Check only the segmentation set by the segment ID field and exclude the segment separator set by the runtime API using the setSegmentSeparator method
|
176
|
+
this._prevSegmentBySegmentId = false;
|
177
|
+
this.unsetAllSegmentSeparators();
|
178
|
+
}
|
154
179
|
var dv = this._getDataView();
|
155
180
|
if(dv) {
|
156
181
|
var rowIds = dv.getAllRowIds();
|
@@ -169,8 +194,8 @@ RowSegmentingPlugin.prototype._afterInit = function () {
|
|
169
194
|
separatorMapping[segmentId] = rowId;
|
170
195
|
this.setSegmentSeparator(rowId);
|
171
196
|
}
|
197
|
+
this._prevSegmentBySegmentId = true;
|
172
198
|
}
|
173
|
-
|
174
199
|
}
|
175
200
|
}
|
176
201
|
};
|
@@ -184,6 +209,9 @@ RowSegmentingPlugin.prototype.unload = function (host) {
|
|
184
209
|
}
|
185
210
|
host.unlisten("preSectionDataBinding", this._onPreSectionDataBinding);
|
186
211
|
this._hosts.splice(at, 1);
|
212
|
+
if(this._hosts.length <= 0) {
|
213
|
+
this._separatorRefreshConflator.reset();
|
214
|
+
}
|
187
215
|
this._dispose();
|
188
216
|
};
|
189
217
|
|
@@ -233,6 +261,7 @@ RowSegmentingPlugin.prototype.config = function (options) {
|
|
233
261
|
this.addListener(option, "clicked");
|
234
262
|
this.addListener(option, "segmentSeparatorBinding");
|
235
263
|
this.addListener(option, "nonSegmentSeparatorBinding");
|
264
|
+
this.requestSeparatorRefresh();
|
236
265
|
};
|
237
266
|
|
238
267
|
/** @public
|
@@ -83,7 +83,8 @@ import { CoralItems } from "../../tr-grid-util/es6/CoralItems.js";
|
|
83
83
|
* @description Fired after the text editor has been closed and all operations are done. This is useful to clean up left over resource and get result text entered.
|
84
84
|
* @type {Object}
|
85
85
|
* @property {string=} text Text that user has entered
|
86
|
-
* @property {boolean=} groupHeader
|
86
|
+
* @property {boolean=} groupHeader This value is set to true if the editing row is a group header.
|
87
|
+
* @property {boolean=} segmentSeparator This value is set to true if the editing row is a segment separator.
|
87
88
|
* @property {Object} suggestionDetail Suggestion detail for auto suggest "item-select" event
|
88
89
|
* @property {boolean} cancelled Readonly flag. Indicates whether the commit operation has been cancelled
|
89
90
|
* @property {boolean} committed Readonly flag. The opposite of `cancelled` flag
|
@@ -94,7 +95,8 @@ import { CoralItems } from "../../tr-grid-util/es6/CoralItems.js";
|
|
94
95
|
* @type {Object}
|
95
96
|
* @property {string=} text Text that user has entered
|
96
97
|
* @property {boolean=} cancel Set to true to cancel the commit operation.
|
97
|
-
* @property {boolean=} groupHeader
|
98
|
+
* @property {boolean=} groupHeader This value is set to true if the editing row is a group header.
|
99
|
+
* @property {boolean=} segmentSeparator This value is set to true if the editing row is a segment separator.
|
98
100
|
* @property {Object} suggestionDetail Suggestion detail for auto suggest "item-select" event
|
99
101
|
* @example
|
100
102
|
* var cep = new InCellEditingPlugin();
|
@@ -1012,6 +1014,13 @@ InCellEditingPlugin.prototype._onDoubleClick = function (e, opt_host) {
|
|
1012
1014
|
} else if (sectionType === "header") {
|
1013
1015
|
return;
|
1014
1016
|
}
|
1017
|
+
var dataSource = arg["dataSource"];
|
1018
|
+
if (dataSource != null) {
|
1019
|
+
var rowId = dataSource.getRowId(arg["rowIndex"]);
|
1020
|
+
if (dataSource.getGroupByRowId(rowId)) {
|
1021
|
+
return;
|
1022
|
+
}
|
1023
|
+
}
|
1015
1024
|
|
1016
1025
|
// Initialize internal states
|
1017
1026
|
if (e["preventDefault"]) {
|
@@ -1069,7 +1078,8 @@ InCellEditingPlugin.prototype._openEditor = function (e, host, arg) {
|
|
1069
1078
|
var dataSource = arg["dataSource"];
|
1070
1079
|
if (dataSource != null) {
|
1071
1080
|
var rowId = arg["rowId"] = this._getRowId(arg["rowIndex"]);
|
1072
|
-
arg["
|
1081
|
+
arg["segmentSeparator"] = dataSource.isSegmentSeparator(rowId);
|
1082
|
+
arg["groupHeader"] = dataSource.getGroupByRowId(rowId);
|
1073
1083
|
arg["rowData"] = this._getRow(dataSource, rowId);
|
1074
1084
|
}
|
1075
1085
|
|
@@ -90,6 +90,10 @@ var RangeBarPlugin = function RangeBarPlugin() {
|
|
90
90
|
};
|
91
91
|
Ext.inherits(RangeBarPlugin, GridPlugin);
|
92
92
|
|
93
|
+
/** @type {boolean}
|
94
|
+
* @private
|
95
|
+
*/
|
96
|
+
RangeBarPlugin._LEDGuage = true;
|
93
97
|
/** @type {boolean}
|
94
98
|
* @private
|
95
99
|
*/
|
@@ -144,6 +148,10 @@ RangeBarPlugin.prototype.initialize = function (host, options) {
|
|
144
148
|
* @ignore
|
145
149
|
*/
|
146
150
|
RangeBarPlugin.prototype._afterInit = function () {
|
151
|
+
if (!ElfUtil.hasComponent("ef-led-gauge")) {
|
152
|
+
console.log("The LED Gauge component is required for the range bar extension. Please make sure to import both the LED Gauge component and its theme.");
|
153
|
+
RangeBarPlugin._LEDGuage = false;
|
154
|
+
}
|
147
155
|
var colCount = this.getColumnCount();
|
148
156
|
for (var i = 0; i < colCount; ++i) {
|
149
157
|
this._setColumnRenderer(i);
|
@@ -449,6 +457,9 @@ RangeBarPlugin.prototype._onThemeLoaded = function () {
|
|
449
457
|
* @param {Object} e
|
450
458
|
*/
|
451
459
|
RangeBarPlugin.prototype._onPostSectionBinding = function (e) {
|
460
|
+
if (!RangeBarPlugin._LEDGuage) {
|
461
|
+
return;
|
462
|
+
}
|
452
463
|
var section = e["section"];
|
453
464
|
var dataRows = /** @type{Array.<Object>} */e["dataRows"];
|
454
465
|
var colCount = section.getColumnCount();
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import {Ext} from
|
2
|
-
import {GridPlugin} from
|
3
|
-
import {FilterBuilder} from
|
4
|
-
import {
|
1
|
+
import {Ext} from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import {GridPlugin} from "../../tr-grid-util/es6/GridPlugin.js";
|
3
|
+
import {FilterBuilder} from "../../tr-grid-util/es6/FilterBuilder.js";
|
4
|
+
import {FilterOperators} from "../../tr-grid-util/es6/FilterOperators.js";
|
5
|
+
import {ElfUtil} from "../../tr-grid-util/es6/ElfUtil.js";
|
5
6
|
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
6
7
|
|
7
8
|
declare namespace RowFilteringPlugin {
|
@@ -1,9 +1,10 @@
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
2
2
|
|
3
|
-
import { Ext } from
|
4
|
-
import { GridPlugin } from
|
5
|
-
import { FilterBuilder } from
|
6
|
-
import {
|
3
|
+
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
4
|
+
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
5
|
+
import { FilterBuilder } from "../../tr-grid-util/es6/FilterBuilder.js";
|
6
|
+
import { FilterOperators } from "../../tr-grid-util/es6/FilterOperators.js";
|
7
|
+
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
7
8
|
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
8
9
|
/** @event RowFilteringPlugin#click
|
9
10
|
* @description click event is dispatched when a user clicks the column filter icon.
|
@@ -70,7 +71,7 @@ The expression can take various forms:<br>
|
|
70
71
|
* @description Extension column options that can be specified on each individual grid's column option:
|
71
72
|
* @property {RowFilteringPlugin~Expression=} filter An expression string or Function
|
72
73
|
* @property {*=} filterState Context object that will be passed as the third parameter for the filter logic
|
73
|
-
* @property {boolean=} filterIcon=true If disabled, filter icon will not be shown. This property only works with
|
74
|
+
* @property {boolean=} filterIcon=true If disabled, filter icon will not be shown. This property only works with "always" mode
|
74
75
|
*/
|
75
76
|
|
76
77
|
/** @typedef {Object} RowFilteringPlugin~FilterDialogOptions
|
@@ -121,6 +122,7 @@ var RowFilteringPlugin = function RowFilteringPlugin() {
|
|
121
122
|
t._onPreSectionRender = t._onPreSectionRender.bind(t);
|
122
123
|
t._onColumnAdded = t._onColumnAdded.bind(t);
|
123
124
|
t._onColumnRemoved = t._onColumnRemoved.bind(t);
|
125
|
+
t._onPreLoadedDialog = t._onPreLoadedDialog.bind(t);
|
124
126
|
t._onIconClicked = t._onIconClicked.bind(t);
|
125
127
|
t._filterLogic = t._filterLogic.bind(t);
|
126
128
|
t._updateAllColumnIcons = t._updateAllColumnIcons.bind(t);
|
@@ -219,6 +221,11 @@ RowFilteringPlugin.prototype._rowTransform = null;
|
|
219
221
|
*/
|
220
222
|
|
221
223
|
RowFilteringPlugin.prototype._filterDialog = null;
|
224
|
+
/** @type {boolean}
|
225
|
+
* @private
|
226
|
+
*/
|
227
|
+
|
228
|
+
RowFilteringPlugin.prototype._dialogInitialized = false;
|
222
229
|
/** @type {RowFilteringPlugin~FilterDialogOptions}
|
223
230
|
* @private
|
224
231
|
*/
|
@@ -229,6 +236,12 @@ RowFilteringPlugin.prototype._dialogOptions = null;
|
|
229
236
|
*/
|
230
237
|
|
231
238
|
RowFilteringPlugin._filterBuilder = null;
|
239
|
+
/** @type {string}
|
240
|
+
* @private
|
241
|
+
*/
|
242
|
+
|
243
|
+
RowFilteringPlugin._dialogTagName; // intentionally left undefined
|
244
|
+
|
232
245
|
/** Array of DataView objects
|
233
246
|
* @type {!Array.<Object>}
|
234
247
|
* @private
|
@@ -292,8 +305,50 @@ RowFilteringPlugin.prototype.unload = function (host) {
|
|
292
305
|
host.unlisten("columnAdded", this._onColumnAdded);
|
293
306
|
host.unlisten("columnRemoved", this._onColumnRemoved);
|
294
307
|
|
308
|
+
if (!this._hosts.length) {
|
309
|
+
if (this._filterDialog) {
|
310
|
+
this._filterDialog.hide(); // Remove the dialog from document
|
311
|
+
|
312
|
+
|
313
|
+
this._filterDialog = null;
|
314
|
+
this._dialogInitialized = false;
|
315
|
+
}
|
316
|
+
}
|
317
|
+
|
295
318
|
this._dispose();
|
296
319
|
};
|
320
|
+
/**
|
321
|
+
* @protected
|
322
|
+
* @ignore
|
323
|
+
*/
|
324
|
+
|
325
|
+
|
326
|
+
RowFilteringPlugin.prototype._afterInit = function () {
|
327
|
+
if (!this._filterDialog) {
|
328
|
+
this._filterDialog = RowFilteringPlugin._createDialog();
|
329
|
+
this._dialogInitialized = false;
|
330
|
+
|
331
|
+
if (this._filterDialog) {
|
332
|
+
this._filterDialog.style.display = "none";
|
333
|
+
document.body.appendChild(this._filterDialog);
|
334
|
+
setTimeout(this._onPreLoadedDialog, 10);
|
335
|
+
}
|
336
|
+
}
|
337
|
+
};
|
338
|
+
/** @private
|
339
|
+
*/
|
340
|
+
|
341
|
+
|
342
|
+
RowFilteringPlugin.prototype._onPreLoadedDialog = function () {
|
343
|
+
if (this._filterDialog) {
|
344
|
+
this._filterDialog.style.display = "";
|
345
|
+
var pn = this._filterDialog.parentNode;
|
346
|
+
|
347
|
+
if (pn) {
|
348
|
+
pn.removeChild(this._filterDialog);
|
349
|
+
}
|
350
|
+
}
|
351
|
+
};
|
297
352
|
/** @public
|
298
353
|
* @param {Object=} options
|
299
354
|
*/
|
@@ -881,10 +936,10 @@ RowFilteringPlugin.prototype._removeColumnFilters = function (colIndex) {
|
|
881
936
|
this._setColumnFilterOption(colIndex, null); // filterChanged fired
|
882
937
|
|
883
938
|
|
884
|
-
var inputExt = this._getPlugin(
|
939
|
+
var inputExt = this._getPlugin("FilterInputPlugin"); // TODO: Use the event instead
|
885
940
|
|
886
941
|
|
887
|
-
inputExt && inputExt.updateUI(colIndex,
|
942
|
+
inputExt && inputExt.updateUI(colIndex, "");
|
888
943
|
|
889
944
|
this._requestFilterRefresh();
|
890
945
|
}
|
@@ -909,7 +964,7 @@ RowFilteringPlugin.prototype.removeAllColumnFilters = function () {
|
|
909
964
|
if (this._columnFilters.length) {
|
910
965
|
this._columnFilters.length = 0;
|
911
966
|
|
912
|
-
var inputExt = this._getPlugin(
|
967
|
+
var inputExt = this._getPlugin("FilterInputPlugin");
|
913
968
|
|
914
969
|
var colCount = this._getColumnCount();
|
915
970
|
|
@@ -917,7 +972,7 @@ RowFilteringPlugin.prototype.removeAllColumnFilters = function () {
|
|
917
972
|
this._setColumnFilterOption(i, null); // filterChanged fired
|
918
973
|
|
919
974
|
|
920
|
-
inputExt && inputExt.updateUI(i,
|
975
|
+
inputExt && inputExt.updateUI(i, ""); // TODO: Use the event instead
|
921
976
|
}
|
922
977
|
|
923
978
|
this._updateAllColumnIcons();
|
@@ -1598,6 +1653,29 @@ RowFilteringPlugin.prototype.getUniqueValues = function (field, formatter, fmtFi
|
|
1598
1653
|
|
1599
1654
|
return uniqueValues;
|
1600
1655
|
};
|
1656
|
+
/** @private
|
1657
|
+
* @function
|
1658
|
+
* @returns {Element}
|
1659
|
+
*/
|
1660
|
+
|
1661
|
+
|
1662
|
+
RowFilteringPlugin._createDialog = function () {
|
1663
|
+
var tag = RowFilteringPlugin._dialogTagName;
|
1664
|
+
|
1665
|
+
if (tag == null) {
|
1666
|
+
var dialogVersion = ElfUtil.hasComponent("filter-dialog"); // WARNING: this cannot detect version 2 or less
|
1667
|
+
|
1668
|
+
if (dialogVersion) {
|
1669
|
+
RowFilteringPlugin._dialogTagName = dialogVersion >= 3 ? "filter-dialog" : "tr-grid-filter-dialog";
|
1670
|
+
} else {
|
1671
|
+
RowFilteringPlugin._dialogTagName = "";
|
1672
|
+
}
|
1673
|
+
|
1674
|
+
tag = RowFilteringPlugin._dialogTagName;
|
1675
|
+
}
|
1676
|
+
|
1677
|
+
return tag ? document.createElement(tag) : null;
|
1678
|
+
};
|
1601
1679
|
/** @public
|
1602
1680
|
* @param {number} colIndex
|
1603
1681
|
* @param {RowFilteringPlugin~FilterDialogOptions=} runtimeDialogOptions
|
@@ -1607,28 +1685,27 @@ RowFilteringPlugin.prototype.getUniqueValues = function (field, formatter, fmtFi
|
|
1607
1685
|
RowFilteringPlugin.prototype.openDialog = function (colIndex, runtimeDialogOptions) {
|
1608
1686
|
var stp = this._getPlugin("SortableTitlePlugin");
|
1609
1687
|
|
1610
|
-
if (!this._filterDialog) {
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
if (!dialogVersion) {
|
1615
|
-
console.log("Filter dialog doesn't exist");
|
1616
|
-
return;
|
1688
|
+
if (!this._filterDialog || !this._dialogInitialized) {
|
1689
|
+
if (!this._filterDialog) {
|
1690
|
+
this._filterDialog = RowFilteringPlugin._createDialog();
|
1617
1691
|
}
|
1618
1692
|
|
1619
|
-
if (
|
1620
|
-
this.
|
1621
|
-
} else if (dialogVersion < 2) {
|
1622
|
-
this._filterDialog = document.createElement("tr-grid-filter-dialog");
|
1623
|
-
}
|
1693
|
+
if (this._filterDialog) {
|
1694
|
+
this._dialogInitialized = true;
|
1624
1695
|
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1696
|
+
if (!stp) {
|
1697
|
+
this._filterDialog.hideSortUI();
|
1698
|
+
} else {
|
1699
|
+
this._filterDialog.addEventListener("sortChanged", this._onDialogSortChanged.bind(this));
|
1700
|
+
}
|
1701
|
+
|
1702
|
+
this._filterDialog.addEventListener("filterChanged", this._onDialogFilterChanged.bind(this));
|
1629
1703
|
}
|
1704
|
+
}
|
1630
1705
|
|
1631
|
-
|
1706
|
+
if (!this._filterDialog) {
|
1707
|
+
console.log("Filter dialog does not exist");
|
1708
|
+
return;
|
1632
1709
|
}
|
1633
1710
|
|
1634
1711
|
if (this._filterDialog.isShown) {
|
@@ -1920,12 +1997,16 @@ RowFilteringPlugin.prototype._onDialogFilterChanged = function (e) {
|
|
1920
1997
|
|
1921
1998
|
for (var m = 0; m < condCount; ++m) {
|
1922
1999
|
var cond = conditions[m];
|
1923
|
-
var
|
2000
|
+
var opDef = FilterOperators[cond[0]]; // string type has no need for formatted data or raw data. What is in display is the most important
|
1924
2001
|
|
1925
|
-
|
2002
|
+
if (opDef && opDef.type !== "string") {
|
2003
|
+
var inputVal = cond[1]; // inputVal is hardcoded at index 1
|
1926
2004
|
|
1927
|
-
|
1928
|
-
|
2005
|
+
var rawValues = uniqueValues[inputVal];
|
2006
|
+
|
2007
|
+
if (rawValues != null) {
|
2008
|
+
cond[1] = rawValues[0];
|
2009
|
+
}
|
1929
2010
|
}
|
1930
2011
|
}
|
1931
2012
|
|
@@ -110,7 +110,7 @@ var _filterByConditions = function(ctx, rowData) {
|
|
110
110
|
if(ctx._rawDataAccessor) {
|
111
111
|
val = ctx._rawDataAccessor(val);
|
112
112
|
}
|
113
|
-
var str, num, dateVal; // intentionally left undefined
|
113
|
+
var str, lowercasedStr, num, dateVal; // intentionally left undefined
|
114
114
|
var finalResult = false;
|
115
115
|
var result = false;
|
116
116
|
for(var i = 0; i < condCount; ++i) {
|
@@ -163,12 +163,16 @@ var _filterByConditions = function(ctx, rowData) {
|
|
163
163
|
str = val;
|
164
164
|
}
|
165
165
|
str = convertToString(str);
|
166
|
-
if(!opDef.caseSensitive) {
|
167
|
-
str = str.toLowerCase();
|
168
|
-
}
|
169
166
|
}
|
170
167
|
|
171
|
-
|
168
|
+
if(opDef.caseSensitive) {
|
169
|
+
result = opFunc(str, cond.value);
|
170
|
+
} else {
|
171
|
+
if(lowercasedStr == null) {
|
172
|
+
lowercasedStr = str.toLowerCase();
|
173
|
+
}
|
174
|
+
result = opFunc(lowercasedStr, cond.value);
|
175
|
+
}
|
172
176
|
}
|
173
177
|
if(i > 0) {
|
174
178
|
if(orConnector) {
|
@@ -450,12 +454,7 @@ FilterBuilder.prototype.buildFilter = function() {
|
|
450
454
|
cond.useUTCTime != null ? cond.useUTCTime : this._useUTCTime
|
451
455
|
);
|
452
456
|
} else if(opType === "string") {
|
453
|
-
|
454
|
-
var dummyRow = {};
|
455
|
-
dummyRow[fieldName] = inputStr;
|
456
|
-
dummyRow[fmtFieldName] = inputStr;
|
457
|
-
value = formatter(dummyRow); // WARNING: dummyRow may not provide enough data for formatting correctly
|
458
|
-
}
|
457
|
+
// There is no need to format user input in the user condition
|
459
458
|
value = convertToString(value);
|
460
459
|
if(!opDef.caseSensitive) {
|
461
460
|
value = value.toLowerCase();
|
@@ -11,33 +11,35 @@ declare namespace FilterOperators {
|
|
11
11
|
};
|
12
12
|
|
13
13
|
type Operators = {
|
14
|
-
EQ: FilterOperators.Operator
|
15
|
-
NEQ: FilterOperators.Operator
|
16
|
-
NUMEQ: FilterOperators.Operator
|
17
|
-
NUMNEQ: FilterOperators.Operator
|
18
|
-
GT: FilterOperators.Operator
|
19
|
-
GTE: FilterOperators.Operator
|
20
|
-
LT: FilterOperators.Operator
|
21
|
-
LTE: FilterOperators.Operator
|
22
|
-
BEGIN: FilterOperators.Operator
|
23
|
-
NBEGIN: FilterOperators.Operator
|
24
|
-
END: FilterOperators.Operator
|
25
|
-
NEND: FilterOperators.Operator
|
26
|
-
CONT: FilterOperators.Operator
|
27
|
-
NCONT: FilterOperators.Operator
|
28
|
-
EQ_BLANK: FilterOperators.Operator
|
29
|
-
EQ_NBLANK: FilterOperators.Operator
|
30
|
-
DT: FilterOperators.Operator
|
31
|
-
DTA: FilterOperators.Operator
|
32
|
-
DTB: FilterOperators.Operator
|
33
|
-
TXTEQ: FilterOperators.Operator
|
34
|
-
BLANK: FilterOperators.Operator
|
35
|
-
NBLANK: FilterOperators.Operator
|
14
|
+
EQ: FilterOperators.Operator,
|
15
|
+
NEQ: FilterOperators.Operator,
|
16
|
+
NUMEQ: FilterOperators.Operator,
|
17
|
+
NUMNEQ: FilterOperators.Operator,
|
18
|
+
GT: FilterOperators.Operator,
|
19
|
+
GTE: FilterOperators.Operator,
|
20
|
+
LT: FilterOperators.Operator,
|
21
|
+
LTE: FilterOperators.Operator,
|
22
|
+
BEGIN: FilterOperators.Operator,
|
23
|
+
NBEGIN: FilterOperators.Operator,
|
24
|
+
END: FilterOperators.Operator,
|
25
|
+
NEND: FilterOperators.Operator,
|
26
|
+
CONT: FilterOperators.Operator,
|
27
|
+
NCONT: FilterOperators.Operator,
|
28
|
+
EQ_BLANK: FilterOperators.Operator,
|
29
|
+
EQ_NBLANK: FilterOperators.Operator,
|
30
|
+
DT: FilterOperators.Operator,
|
31
|
+
DTA: FilterOperators.Operator,
|
32
|
+
DTB: FilterOperators.Operator,
|
33
|
+
TXTEQ: FilterOperators.Operator,
|
34
|
+
BLANK: FilterOperators.Operator,
|
35
|
+
NBLANK: FilterOperators.Operator
|
36
36
|
};
|
37
37
|
|
38
38
|
}
|
39
39
|
|
40
|
-
declare const
|
40
|
+
declare const FilterOperators: FilterOperators.Operators;
|
41
|
+
|
42
|
+
declare const OperatorFunctions: { [key: string]: ((...params: any[]) => any) };
|
41
43
|
|
42
44
|
export default FilterOperators;
|
43
45
|
export { FilterOperators, OperatorFunctions };
|
@@ -6,33 +6,34 @@
|
|
6
6
|
* @property {string} formula Formula expression used by the operator
|
7
7
|
*/
|
8
8
|
|
9
|
-
/** @typedef {Object.<string, FilterOperators~
|
10
|
-
* @property {FilterOperators~Operator} EQ Equal
|
11
|
-
* @property {FilterOperators~Operator} NEQ Not equal
|
12
|
-
* @property {FilterOperators~Operator} NUMEQ Number equal to
|
13
|
-
* @property {FilterOperators~Operator} NUMNEQ Number not equal to
|
14
|
-
* @property {FilterOperators~Operator} GT Greater than
|
15
|
-
* @property {FilterOperators~Operator} GTE Greater than or equal
|
16
|
-
* @property {FilterOperators~Operator} LT Less than
|
17
|
-
* @property {FilterOperators~Operator} LTE Less than or equal
|
18
|
-
* @property {FilterOperators~Operator} BEGIN Begin
|
19
|
-
* @property {FilterOperators~Operator} NBEGIN Not begin
|
20
|
-
* @property {FilterOperators~Operator} END End
|
21
|
-
* @property {FilterOperators~Operator} NEND Not end
|
22
|
-
* @property {FilterOperators~Operator} CONT Contain
|
23
|
-
* @property {FilterOperators~Operator} NCONT Not contain
|
24
|
-
* @property {FilterOperators~Operator} EQ_BLANK Equal to blank value
|
25
|
-
* @property {FilterOperators~Operator} EQ_NBLANK Equal to non blank value
|
26
|
-
* @property {FilterOperators~Operator} DT Date is
|
27
|
-
* @property {FilterOperators~Operator} DTA Date is after
|
28
|
-
* @property {FilterOperators~Operator} DTB Date is before
|
29
|
-
* @property {FilterOperators~Operator} TXTEQ Alias to EQ
|
30
|
-
* @property {FilterOperators~Operator} BLANK Alias to EQ_BLANK
|
31
|
-
* @property {FilterOperators~Operator} NBLANK Alias to EQ_NBLANK
|
9
|
+
/** @typedef {Object.<string, FilterOperators~Operator>} FilterOperators~Operators
|
10
|
+
* @property {!FilterOperators~Operator} EQ Equal
|
11
|
+
* @property {!FilterOperators~Operator} NEQ Not equal
|
12
|
+
* @property {!FilterOperators~Operator} NUMEQ Number equal to
|
13
|
+
* @property {!FilterOperators~Operator} NUMNEQ Number not equal to
|
14
|
+
* @property {!FilterOperators~Operator} GT Greater than
|
15
|
+
* @property {!FilterOperators~Operator} GTE Greater than or equal
|
16
|
+
* @property {!FilterOperators~Operator} LT Less than
|
17
|
+
* @property {!FilterOperators~Operator} LTE Less than or equal
|
18
|
+
* @property {!FilterOperators~Operator} BEGIN Begin
|
19
|
+
* @property {!FilterOperators~Operator} NBEGIN Not begin
|
20
|
+
* @property {!FilterOperators~Operator} END End
|
21
|
+
* @property {!FilterOperators~Operator} NEND Not end
|
22
|
+
* @property {!FilterOperators~Operator} CONT Contain
|
23
|
+
* @property {!FilterOperators~Operator} NCONT Not contain
|
24
|
+
* @property {!FilterOperators~Operator} EQ_BLANK Equal to blank value
|
25
|
+
* @property {!FilterOperators~Operator} EQ_NBLANK Equal to non blank value
|
26
|
+
* @property {!FilterOperators~Operator} DT Date is
|
27
|
+
* @property {!FilterOperators~Operator} DTA Date is after
|
28
|
+
* @property {!FilterOperators~Operator} DTB Date is before
|
29
|
+
* @property {!FilterOperators~Operator} TXTEQ Alias to EQ
|
30
|
+
* @property {!FilterOperators~Operator} BLANK Alias to EQ_BLANK
|
31
|
+
* @property {!FilterOperators~Operator} NBLANK Alias to EQ_NBLANK
|
32
32
|
*/
|
33
33
|
|
34
|
-
/** @
|
34
|
+
/** @type {!FilterOperators~Operators}
|
35
35
|
* @public
|
36
|
+
* @const
|
36
37
|
*/
|
37
38
|
var FilterOperators = {
|
38
39
|
EQ: {
|
@@ -196,7 +197,7 @@ FilterOperators.BLANK = FilterOperators.EQ_BLANK;
|
|
196
197
|
FilterOperators.NBLANK = FilterOperators.EQ_NBLANK;
|
197
198
|
|
198
199
|
|
199
|
-
/** @type {Object.<string, Function>}
|
200
|
+
/** @type {!Object.<string, Function>}
|
200
201
|
* @public
|
201
202
|
* @const
|
202
203
|
*/
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import {Ext} from
|
2
|
-
import {GridPlugin} from
|
3
|
-
import {FilterBuilder} from
|
4
|
-
import {ElfUtil} from
|
1
|
+
import {Ext} from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import {GridPlugin} from "../../tr-grid-util/es6/GridPlugin.js";
|
3
|
+
import {FilterBuilder} from "../../tr-grid-util/es6/FilterBuilder.js";
|
4
|
+
import {ElfUtil} from "../../tr-grid-util/es6/ElfUtil.js";
|
5
5
|
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
6
6
|
|
7
7
|
declare namespace RowFilteringPlugin {
|
@@ -4,6 +4,7 @@ import { ExpanderIcon } from "../../tr-grid-util/es6/ExpanderIcon.js";
|
|
4
4
|
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
5
5
|
import { RowPainter } from "../../tr-grid-util/es6/RowPainter.js";
|
6
6
|
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
7
|
+
import { Conflator } from "../../tr-grid-util/es6/Conflator.js";
|
7
8
|
|
8
9
|
declare namespace RowSegmentingPlugin {
|
9
10
|
|
@@ -33,6 +34,8 @@ declare class RowSegmentingPlugin extends GridPlugin {
|
|
33
34
|
|
34
35
|
public initialize(host: any, options?: any): void;
|
35
36
|
|
37
|
+
public requestSeparatorRefresh(): void;
|
38
|
+
|
36
39
|
public unload(host?: any): void;
|
37
40
|
|
38
41
|
public config(options?: any): void;
|
package/lib/utils/index.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { GridPrinter } from "../tr-grid-printer/es6/GridPrinter.js";
|
2
2
|
import { Table } from "../tr-grid-util/es6/Table.js";
|
3
3
|
import { MultiTableManager } from "../tr-grid-util/es6/MultiTableManager.js";
|
4
|
+
import { FilterOperators, OperatorFunctions } from "../tr-grid-util/es6/FilterOperators.js";
|
4
5
|
import { DataGenerator } from "../tr-grid-util/es6/jet/DataGenerator.js";
|
5
6
|
import { MockRTK } from "../tr-grid-util/es6/jet/MockRTK.js";
|
6
|
-
export { GridPrinter, Table, MultiTableManager, DataGenerator, MockRTK };
|
7
|
+
export { GridPrinter, Table, MultiTableManager, DataGenerator, MockRTK, FilterOperators, OperatorFunctions };
|
package/lib/utils/index.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { GridPrinter } from "../tr-grid-printer/es6/GridPrinter.js";
|
2
2
|
import { Table } from "../tr-grid-util/es6/Table.js";
|
3
3
|
import { MultiTableManager } from "../tr-grid-util/es6/MultiTableManager.js";
|
4
|
+
import { FilterOperators, OperatorFunctions } from "../tr-grid-util/es6/FilterOperators.js";
|
4
5
|
import { DataGenerator } from "../tr-grid-util/es6/jet/DataGenerator.js";
|
5
6
|
import { MockRTK } from "../tr-grid-util/es6/jet/MockRTK.js";
|
6
|
-
export { GridPrinter, Table, MultiTableManager, DataGenerator, MockRTK };
|
7
|
+
export { GridPrinter, Table, MultiTableManager, DataGenerator, MockRTK, FilterOperators, OperatorFunctions };
|
package/lib/versions.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
|
-
"tr-grid-util": "1.3.
|
2
|
+
"tr-grid-util": "1.3.129",
|
3
3
|
"tr-grid-printer": "1.0.16",
|
4
4
|
"@grid/column-dragging": "1.0.14",
|
5
|
-
"@grid/row-segmenting": "1.0.
|
5
|
+
"@grid/row-segmenting": "1.0.26",
|
6
6
|
"@grid/statistics-row": "1.0.15",
|
7
7
|
"@grid/zoom": "1.0.11",
|
8
8
|
"tr-grid-auto-tooltip": "1.1.6",
|
@@ -10,7 +10,7 @@
|
|
10
10
|
"tr-grid-checkbox": "1.0.60",
|
11
11
|
"tr-grid-column-fitter": "1.0.39",
|
12
12
|
"tr-grid-column-formatting": "0.9.34",
|
13
|
-
"tr-grid-column-grouping": "1.0.
|
13
|
+
"tr-grid-column-grouping": "1.0.55",
|
14
14
|
"tr-grid-column-resizing": "1.0.28",
|
15
15
|
"tr-grid-column-selection": "1.0.29",
|
16
16
|
"tr-grid-column-stack": "1.0.70",
|
@@ -19,12 +19,12 @@
|
|
19
19
|
"tr-grid-contextmenu": "1.0.39",
|
20
20
|
"tr-grid-filter-input": "0.9.33",
|
21
21
|
"tr-grid-heat-map": "1.0.29",
|
22
|
-
"tr-grid-in-cell-editing": "1.0.
|
22
|
+
"tr-grid-in-cell-editing": "1.0.80",
|
23
23
|
"tr-grid-pagination": "1.0.24",
|
24
24
|
"tr-grid-percent-bar": "1.0.22",
|
25
|
-
"tr-grid-range-bar": "2.0.
|
25
|
+
"tr-grid-range-bar": "2.0.5",
|
26
26
|
"tr-grid-row-dragging": "1.0.29",
|
27
|
-
"tr-grid-row-filtering": "1.0.
|
27
|
+
"tr-grid-row-filtering": "1.0.59",
|
28
28
|
"tr-grid-row-grouping": "1.0.81",
|
29
29
|
"tr-grid-row-selection": "1.0.23",
|
30
30
|
"tr-grid-rowcoloring": "1.0.24",
|
package/package.json
CHANGED