@refinitiv-ui/efx-grid 6.0.131 → 6.0.133
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/filter-dialog/lib/checkbox-list.js +5 -0
- package/lib/filter-dialog/lib/filter-dialog.js +10 -8
- package/lib/filter-dialog/themes/base.less +12 -0
- package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +1 -1
- package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/filter-dialog.less +7 -1
- package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/filter-dialog/themes/halo/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +1 -1
- package/lib/grid/index.js +1 -1
- package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.js +69 -66
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +5 -2
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +37 -5
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +0 -2
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +47 -49
- package/lib/tr-grid-row-selection/es6/RowSelection.js +37 -32
- package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +0 -2
- package/lib/tr-grid-textformatting/es6/TextFormatting.js +352 -333
- package/lib/types/es6/RowFiltering.d.ts +0 -2
- package/lib/types/es6/TextFormatting.d.ts +0 -1
- package/lib/versions.json +6 -6
- package/package.json +1 -1
@@ -2,7 +2,10 @@ import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
|
2
2
|
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
3
3
|
import { Conflator } from "../../tr-grid-util/es6/Conflator.js";
|
4
4
|
|
5
|
-
|
5
|
+
/** @private
|
6
|
+
* @type {boolean}
|
7
|
+
*/
|
8
|
+
let isSafari = navigator.vendor &&
|
6
9
|
navigator.vendor.indexOf('Apple') > -1 &&
|
7
10
|
navigator.userAgent &&
|
8
11
|
navigator.userAgent.indexOf('CriOS') == -1 &&
|
@@ -26,7 +29,7 @@ var isSafari = navigator.vendor &&
|
|
26
29
|
* @param {AutoTooltipPlugin~Options=} options
|
27
30
|
* @extends {GridPlugin}
|
28
31
|
*/
|
29
|
-
|
32
|
+
let AutoTooltipPlugin = function (options) {
|
30
33
|
this.applyTooltipToAllColumns = this.applyTooltipToAllColumns.bind(this);
|
31
34
|
this._onPreSectionDataBinding = this._onPreSectionDataBinding.bind(this);
|
32
35
|
this._onPostSectionDataBinding = this._onPostSectionDataBinding.bind(this);
|
@@ -62,7 +65,7 @@ AutoTooltipPlugin._isColumnVisible = function(column) {
|
|
62
65
|
return false;
|
63
66
|
}
|
64
67
|
|
65
|
-
|
68
|
+
let colElem = column.getElement();
|
66
69
|
if(!colElem) {
|
67
70
|
return false;
|
68
71
|
}
|
@@ -75,7 +78,7 @@ AutoTooltipPlugin._isColumnVisible = function(column) {
|
|
75
78
|
* @return {boolean}
|
76
79
|
*/
|
77
80
|
AutoTooltipPlugin._isUpdateRequired = function(hosts) {
|
78
|
-
|
81
|
+
let len = hosts.length;
|
79
82
|
if(len <= 0 || isSafari) {
|
80
83
|
return false;
|
81
84
|
}
|
@@ -147,7 +150,7 @@ AutoTooltipPlugin.prototype.initialize = function (host, options) {
|
|
147
150
|
* @param {Object} host core grid
|
148
151
|
*/
|
149
152
|
AutoTooltipPlugin.prototype.unload = function (host) {
|
150
|
-
|
153
|
+
let at = this._hosts.indexOf(host);
|
151
154
|
if (at < 0) { return; }
|
152
155
|
this._hosts.splice(at, 1);
|
153
156
|
|
@@ -170,10 +173,10 @@ AutoTooltipPlugin.prototype.unload = function (host) {
|
|
170
173
|
AutoTooltipPlugin.prototype.config = function (options) {
|
171
174
|
if (!options) { return; }
|
172
175
|
|
173
|
-
|
176
|
+
let extOptions = options.autoTooltip;
|
174
177
|
if(extOptions) {
|
175
178
|
// header is alias of title
|
176
|
-
|
179
|
+
let val = extOptions["title"] || extOptions["header"];
|
177
180
|
if (val != null) {
|
178
181
|
this._title = val ? true : false;
|
179
182
|
}
|
@@ -189,10 +192,10 @@ AutoTooltipPlugin.prototype.config = function (options) {
|
|
189
192
|
}
|
190
193
|
|
191
194
|
// Retrive auto tooltip data from columns
|
192
|
-
|
195
|
+
let columns = options["columns"];
|
193
196
|
if (columns) {
|
194
|
-
|
195
|
-
for (
|
197
|
+
let len = columns.length;
|
198
|
+
for (let c = 0; c < len; ++c) {
|
196
199
|
this._configColumn(c, columns[c]);
|
197
200
|
}
|
198
201
|
}
|
@@ -203,27 +206,27 @@ AutoTooltipPlugin.prototype.config = function (options) {
|
|
203
206
|
* @return {!Object}
|
204
207
|
*/
|
205
208
|
AutoTooltipPlugin.prototype.getConfigObject = function (gridOptions) {
|
206
|
-
|
209
|
+
let obj = gridOptions || {};
|
207
210
|
|
208
|
-
|
211
|
+
let columns = obj.columns;
|
209
212
|
if(!columns) {
|
210
213
|
columns = obj.columns = [];
|
211
214
|
}
|
212
215
|
|
213
|
-
|
214
|
-
for(
|
215
|
-
|
216
|
+
let len = this.getColumnCount();
|
217
|
+
for(let i = 0; i < len; ++i) {
|
218
|
+
let column = columns[i];
|
216
219
|
if(!column) {
|
217
220
|
column = columns[i] = {};
|
218
221
|
}
|
219
222
|
|
220
|
-
|
223
|
+
let colOptions = this._getColumnOption(i, "autoTooltip");
|
221
224
|
if(colOptions === true) {
|
222
225
|
column.autoTooltip = true;
|
223
226
|
}
|
224
227
|
}
|
225
228
|
|
226
|
-
|
229
|
+
let extOptions = obj.autoTooltip;
|
227
230
|
if(!extOptions) {
|
228
231
|
extOptions = obj.autoTooltip = {};
|
229
232
|
}
|
@@ -249,7 +252,7 @@ AutoTooltipPlugin.prototype.getConfigObject = function (gridOptions) {
|
|
249
252
|
*/
|
250
253
|
AutoTooltipPlugin.prototype._configColumn = function(colIndex, columnConfig) {
|
251
254
|
if(columnConfig) {
|
252
|
-
|
255
|
+
let val = columnConfig["autoTooltip"];
|
253
256
|
if (val != null) {
|
254
257
|
this._newColumnData(colIndex)["autoTooltip"] = val ? true : false;
|
255
258
|
}
|
@@ -263,22 +266,22 @@ AutoTooltipPlugin.prototype._configColumn = function(colIndex, columnConfig) {
|
|
263
266
|
* @param {number=} toR End row index
|
264
267
|
*/
|
265
268
|
AutoTooltipPlugin.prototype.applyTooltip = function (colIndex, fromR, toR) {
|
266
|
-
|
269
|
+
let hosts = this._hosts;
|
267
270
|
if(!AutoTooltipPlugin._isUpdateRequired(hosts)) {
|
268
271
|
return;
|
269
272
|
}
|
270
273
|
|
271
|
-
for (
|
272
|
-
|
274
|
+
for (let i = 0; i < hosts.length; ++i) {
|
275
|
+
let host = this._hosts[i];
|
273
276
|
if (this._title) {
|
274
|
-
|
275
|
-
for (
|
277
|
+
let titles = host.getAllSections("title");
|
278
|
+
for (let t = titles.length; --t >= 0;) {
|
276
279
|
this._updateNonContentSection(titles[t], colIndex);
|
277
280
|
}
|
278
281
|
}
|
279
282
|
if (this._footer) {
|
280
|
-
|
281
|
-
for (
|
283
|
+
let footers = host.getAllSections("footer");
|
284
|
+
for (let j = footers.length; --j >= 0;) {
|
282
285
|
this._updateNonContentSection(footers[j], colIndex);
|
283
286
|
}
|
284
287
|
}
|
@@ -294,10 +297,10 @@ AutoTooltipPlugin.prototype.applyTooltip = function (colIndex, fromR, toR) {
|
|
294
297
|
* @param {Array.<number>=} colIndices Column indices
|
295
298
|
*/
|
296
299
|
AutoTooltipPlugin.prototype.applyTooltipToColumns = function (colIndices) {
|
297
|
-
|
300
|
+
let host = this._hosts ? this._hosts[0] : null;
|
298
301
|
if (host && host.getElement()) {
|
299
|
-
|
300
|
-
for (
|
302
|
+
let len = colIndices ? colIndices.length : 0;
|
303
|
+
for (let i = 0; i < len; ++i) {
|
301
304
|
this.applyTooltip(colIndices[i]);
|
302
305
|
}
|
303
306
|
}
|
@@ -308,8 +311,8 @@ AutoTooltipPlugin.prototype.applyTooltipToColumns = function (colIndices) {
|
|
308
311
|
*/
|
309
312
|
AutoTooltipPlugin.prototype.applyTooltipToAllColumns = function () {
|
310
313
|
this._applyTimer = 0;
|
311
|
-
|
312
|
-
for (
|
314
|
+
let colCount = this.getColumnCount();
|
315
|
+
for (let c = 0; c < colCount; ++c) {
|
313
316
|
this.applyTooltip(c);
|
314
317
|
}
|
315
318
|
};
|
@@ -343,17 +346,17 @@ AutoTooltipPlugin.prototype._requestNonContentSectionUpdate = function () {
|
|
343
346
|
return;
|
344
347
|
}
|
345
348
|
|
346
|
-
|
349
|
+
let hosts = this._hosts;
|
347
350
|
if(!AutoTooltipPlugin._isUpdateRequired(hosts)) {
|
348
351
|
return;
|
349
352
|
}
|
350
353
|
|
351
354
|
this._nonContentSectionUpdated = true;
|
352
355
|
|
353
|
-
|
354
|
-
|
355
|
-
for(
|
356
|
-
|
356
|
+
let colCount = this.getColumnCount();
|
357
|
+
let sections, s, c;
|
358
|
+
for(let i = 0; i < hosts.length; ++i) {
|
359
|
+
let host = hosts[i];
|
357
360
|
|
358
361
|
sections = host.getAllSections("title");
|
359
362
|
for(s = 0; s < sections.length; s++) {
|
@@ -379,15 +382,15 @@ AutoTooltipPlugin.prototype._requestContentSectionUpdate = function () {
|
|
379
382
|
return;
|
380
383
|
}
|
381
384
|
|
382
|
-
|
385
|
+
let hosts = this._hosts;
|
383
386
|
if(!AutoTooltipPlugin._isUpdateRequired(hosts)) {
|
384
387
|
return;
|
385
388
|
}
|
386
389
|
|
387
|
-
|
388
|
-
for(
|
389
|
-
|
390
|
-
for(
|
390
|
+
let colCount = this.getColumnCount();
|
391
|
+
for(let i = 0; i < hosts.length; ++i) {
|
392
|
+
let section = hosts[i].getSection("content");
|
393
|
+
for(let c = 0; c < colCount; c++) {
|
391
394
|
if(this._isTooltipCandidate(c)) {
|
392
395
|
this._updateContentSection(section, c);
|
393
396
|
}
|
@@ -404,20 +407,20 @@ AutoTooltipPlugin.prototype._requestContentSectionUpdate = function () {
|
|
404
407
|
AutoTooltipPlugin.prototype._updateNonContentSection = function (section, colIndex) {
|
405
408
|
if(!section) { return false; }
|
406
409
|
|
407
|
-
|
410
|
+
let column = section.getColumn(colIndex);
|
408
411
|
if(!AutoTooltipPlugin._isColumnVisible(column)) {
|
409
412
|
return false;
|
410
413
|
}
|
411
414
|
|
412
|
-
|
413
|
-
for(
|
414
|
-
|
415
|
+
let rowCount = section.getRowCount();
|
416
|
+
for(let r = 0; r < rowCount; ++r) {
|
417
|
+
let cell = section.getCell(colIndex, r, false); // Ignore cell span
|
415
418
|
if(!cell || !cell.isVisible()) { return false; }
|
416
419
|
|
417
|
-
|
420
|
+
let elem = cell.getContent();
|
418
421
|
if(!elem) { return false; }
|
419
422
|
|
420
|
-
|
423
|
+
let tooltipInfo = cell.getTooltipInfo();
|
421
424
|
if(tooltipInfo) {
|
422
425
|
if(tooltipInfo["userTooltip"] != null ||
|
423
426
|
tooltipInfo["groupHeaderDefault"] != null ||
|
@@ -430,11 +433,11 @@ AutoTooltipPlugin.prototype._updateNonContentSection = function (section, colInd
|
|
430
433
|
}
|
431
434
|
|
432
435
|
// Set tooltip only if text's length is longer than column width.
|
433
|
-
|
436
|
+
let sw = elem.scrollWidth;
|
434
437
|
if(sw && sw > elem.offsetWidth) {
|
435
438
|
cell.setTooltipInfo("clippedText", true);
|
436
439
|
|
437
|
-
|
440
|
+
let tooltip = cell.getTextContent();
|
438
441
|
cell.setTooltipInfo("clippedTextTooltip", tooltip);
|
439
442
|
cell.setAttribute("ef-title", tooltip);
|
440
443
|
} else {
|
@@ -471,7 +474,7 @@ AutoTooltipPlugin.prototype._updateContentSection = function (section, colIndex,
|
|
471
474
|
return false;
|
472
475
|
}
|
473
476
|
|
474
|
-
|
477
|
+
let columnObj = section.getColumn(colIndex);
|
475
478
|
if (!columnObj) {
|
476
479
|
return false;
|
477
480
|
}
|
@@ -480,24 +483,24 @@ AutoTooltipPlugin.prototype._updateContentSection = function (section, colIndex,
|
|
480
483
|
return false;
|
481
484
|
}
|
482
485
|
|
483
|
-
|
486
|
+
let colElem = columnObj.getElement();
|
484
487
|
if (!colElem) {
|
485
488
|
return false;
|
486
489
|
}
|
487
490
|
|
488
|
-
for (
|
489
|
-
|
491
|
+
for (let r = fromR; r < toR; ++r) {
|
492
|
+
let cell = section.getCell(colIndex, r, false); // Ignore cell span
|
490
493
|
if (cell && cell.isVisible()) {
|
491
494
|
|
492
495
|
if (cell._userDefinedTooltip == null) {
|
493
|
-
|
496
|
+
let tooltipProp = cell.getTooltip() || cell.getAttribute('ef-title');
|
494
497
|
cell._userDefinedTooltip = tooltipProp || '';
|
495
498
|
}
|
496
499
|
|
497
|
-
|
498
|
-
|
500
|
+
let elem = cell.getContent();
|
501
|
+
let tooltip = "";
|
499
502
|
if (elem) {
|
500
|
-
|
503
|
+
let sw = elem.scrollWidth;
|
501
504
|
|
502
505
|
// Set tooltip only if text's length is longer than column width.
|
503
506
|
if (sw && sw > elem.offsetWidth) {
|
@@ -533,8 +536,8 @@ AutoTooltipPlugin.prototype._clearTooltipCache = function (section, colIndex, fr
|
|
533
536
|
return;
|
534
537
|
}
|
535
538
|
|
536
|
-
for (
|
537
|
-
|
539
|
+
for (let rowIndex = fromRowIndex; rowIndex < toRowIndex; rowIndex++) {
|
540
|
+
let cell = section.getCell(colIndex, rowIndex);
|
538
541
|
// if isDataChange = true
|
539
542
|
if (isDataChange || (cell && cell._userDefinedTooltip != null)) {
|
540
543
|
cell._userDefinedTooltip = null;
|
@@ -549,7 +552,7 @@ AutoTooltipPlugin.prototype._clearTooltipCache = function (section, colIndex, fr
|
|
549
552
|
if (cell._previousPos === rowIndex + '-' + colIndex
|
550
553
|
&& !isDataChange // in case isDataChange be true then we need to clear all tooltip cache in else block
|
551
554
|
) {
|
552
|
-
|
555
|
+
let tooltip = cell.getTooltip() || cell.getAttribute('ef-title');
|
553
556
|
if (tooltip) {
|
554
557
|
cell.removeAttribute('ef-title');
|
555
558
|
cell.setTooltip(tooltip);
|
@@ -565,27 +568,27 @@ AutoTooltipPlugin.prototype._clearTooltipCache = function (section, colIndex, fr
|
|
565
568
|
};
|
566
569
|
|
567
570
|
/** @private
|
568
|
-
* @param {
|
571
|
+
* @param {Object} e event from preSectionDataBinding
|
569
572
|
*/
|
570
573
|
AutoTooltipPlugin.prototype._onPreSectionDataBinding = function (e) {
|
571
574
|
if (e && e.sectionType === "content") {
|
572
|
-
|
573
|
-
|
574
|
-
for (
|
575
|
+
let colCount = this.getColumnCount();
|
576
|
+
let isDataChange = e.actualUpdate === true;
|
577
|
+
for (let c = 0; c < colCount; ++c) {
|
575
578
|
this._clearTooltipCache(e.section, c, e.fromRowIndex, e.toRowIndex, isDataChange);
|
576
579
|
}
|
577
580
|
}
|
578
581
|
};
|
579
582
|
|
580
583
|
/** @private
|
581
|
-
* @param {
|
584
|
+
* @param {Object} e event from preSectionDataBinding
|
582
585
|
*/
|
583
586
|
AutoTooltipPlugin.prototype._onPostSectionDataBinding = function (e) {
|
584
587
|
this._requestAllSectionsUpdate();
|
585
588
|
};
|
586
589
|
|
587
590
|
/** @private
|
588
|
-
* @param {
|
591
|
+
* @param {Object} e
|
589
592
|
*/
|
590
593
|
AutoTooltipPlugin.prototype._onColumnAdded = function(e) {
|
591
594
|
if(e.context && e.colIndex != null) {
|
@@ -601,7 +604,7 @@ AutoTooltipPlugin.prototype._onColumnAdded = function(e) {
|
|
601
604
|
* @return {boolean}
|
602
605
|
*/
|
603
606
|
AutoTooltipPlugin.prototype._isTooltipCandidate = function (colIndex) {
|
604
|
-
|
607
|
+
let bool = this._getColumnOption(colIndex, "autoTooltip");
|
605
608
|
if(bool != null) {
|
606
609
|
return bool ? true : false;
|
607
610
|
}
|
@@ -1,11 +1,14 @@
|
|
1
1
|
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
2
|
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
3
3
|
import { GroupDefinitions } from "../../tr-grid-util/es6/GroupDefinitions.js";
|
4
|
-
import { cloneObject, injectCss, prettifyCss, deepEqual } from "../../tr-grid-util/es6/Util.js";
|
4
|
+
import { cloneObject, injectCss, prettifyCss, deepEqual, isEmptyObject } from "../../tr-grid-util/es6/Util.js";
|
5
5
|
|
6
6
|
declare namespace ColumnGroupingPlugin {
|
7
7
|
|
8
|
-
type Options =
|
8
|
+
type Options = {
|
9
|
+
groupDefinitions: ColumnGroupingPlugin.GroupDefinitions|null,
|
10
|
+
minChildCount?: number|null
|
11
|
+
};
|
9
12
|
|
10
13
|
type GroupDefinitions = (ColumnGroupingPlugin.GroupDefinition)[]|null;
|
11
14
|
|
@@ -1,10 +1,12 @@
|
|
1
1
|
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
2
|
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
3
3
|
import { GroupDefinitions } from "../../tr-grid-util/es6/GroupDefinitions.js";
|
4
|
-
import { cloneObject, injectCss, prettifyCss, deepEqual } from "../../tr-grid-util/es6/Util.js";
|
4
|
+
import { cloneObject, injectCss, prettifyCss, deepEqual, isEmptyObject } from "../../tr-grid-util/es6/Util.js";
|
5
5
|
|
6
|
-
/** @typedef {
|
6
|
+
/** @typedef {Object} ColumnGroupingPlugin~Options
|
7
7
|
* @description This options can be specified by `columnGrouping` property of the main grid's options or extension options.
|
8
|
+
* @property {ColumnGroupingPlugin~GroupDefinitions} groupDefinitions A collection of group definition objects
|
9
|
+
* @property {number=} minChildCount=2 The minimum number of child columns required for group to be visible
|
8
10
|
*/
|
9
11
|
|
10
12
|
/** @typedef {Array<ColumnGroupingPlugin~GroupDefinition>} ColumnGroupingPlugin~GroupDefinitions
|
@@ -89,6 +91,10 @@ ColumnGroupingPlugin.prototype._legacyColumnGroups = null;
|
|
89
91
|
* @private
|
90
92
|
*/
|
91
93
|
ColumnGroupingPlugin.prototype._selectedColMap;
|
94
|
+
/** @type {number}
|
95
|
+
* @private
|
96
|
+
*/
|
97
|
+
ColumnGroupingPlugin.prototype._minChildCount = 2;
|
92
98
|
|
93
99
|
/** @private
|
94
100
|
* @param {number} a
|
@@ -334,7 +340,17 @@ ColumnGroupingPlugin.prototype.config = function (options) {
|
|
334
340
|
let extOptions = options["columnGrouping"];
|
335
341
|
let groupDefs = null;
|
336
342
|
if(Array.isArray(extOptions)) {
|
337
|
-
groupDefs = extOptions
|
343
|
+
groupDefs = extOptions;
|
344
|
+
} else if(typeof extOptions === "object") {
|
345
|
+
groupDefs = extOptions["groupDefinitions"];
|
346
|
+
let minChildCount = extOptions["minChildCount"];
|
347
|
+
if(typeof minChildCount === "number" && minChildCount > 0) {
|
348
|
+
this._minChildCount = minChildCount;
|
349
|
+
}
|
350
|
+
}
|
351
|
+
|
352
|
+
if(groupDefs) {
|
353
|
+
groupDefs = groupDefs.filter(ColumnGroupingPlugin._hasGroupId);
|
338
354
|
groupDefs = groupDefs.map(ColumnGroupingPlugin._cloneObject);
|
339
355
|
}
|
340
356
|
|
@@ -355,11 +371,26 @@ ColumnGroupingPlugin.prototype.config = function (options) {
|
|
355
371
|
ColumnGroupingPlugin.prototype.getConfigObject = function (gridOptions) {
|
356
372
|
let obj = gridOptions || {};
|
357
373
|
|
374
|
+
let extOptions = {};
|
375
|
+
|
358
376
|
// TODO: Handle legacyRender method that has been migrated
|
359
377
|
let groupDefs = this.getGroupDefinitions();
|
360
378
|
groupDefs = groupDefs.filter(ColumnGroupingPlugin._isNotTimeSeriesGroup);
|
361
379
|
if(groupDefs.length) {
|
362
|
-
|
380
|
+
extOptions.groupDefinitions = groupDefs;
|
381
|
+
}
|
382
|
+
|
383
|
+
if(this._minChildCount !== 2) {
|
384
|
+
extOptions.minChildCount = this._minChildCount;
|
385
|
+
}
|
386
|
+
|
387
|
+
if(!isEmptyObject(extOptions)) {
|
388
|
+
let extUserOptions = obj.columnGrouping;
|
389
|
+
if(extUserOptions != null && typeof extUserOptions === "object") {
|
390
|
+
Object.assign(extUserOptions, extOptions);
|
391
|
+
} else {
|
392
|
+
obj.columnGrouping = extOptions;
|
393
|
+
}
|
363
394
|
}
|
364
395
|
|
365
396
|
return obj;
|
@@ -669,6 +700,7 @@ ColumnGroupingPlugin.prototype._verifySingleChild = function(groupMap) {
|
|
669
700
|
validIds[groupIds[i]] = 1;
|
670
701
|
}
|
671
702
|
|
703
|
+
let minChildCount = this._minChildCount;
|
672
704
|
let removable = true;
|
673
705
|
while(removable){
|
674
706
|
removable = false;
|
@@ -689,7 +721,7 @@ ColumnGroupingPlugin.prototype._verifySingleChild = function(groupMap) {
|
|
689
721
|
}
|
690
722
|
}
|
691
723
|
|
692
|
-
if(validChildren.length <
|
724
|
+
if(validChildren.length < minChildCount) {
|
693
725
|
delete groupMap[groupId];
|
694
726
|
validIds[groupId] = 0;
|
695
727
|
removable = true;
|
@@ -145,8 +145,6 @@ declare class RowFilteringPlugin extends GridPlugin {
|
|
145
145
|
|
146
146
|
declare function colSettings(colIndex: number, exp: RowFilteringPlugin.Expression|null, ctx?: (any|string)|null): boolean;
|
147
147
|
|
148
|
-
declare function selCount(sortOrder: string): void;
|
149
|
-
|
150
148
|
declare function crf(enabled?: boolean|null): void;
|
151
149
|
|
152
150
|
export default RowFilteringPlugin;
|
@@ -231,6 +231,9 @@ let RowFilteringPlugin = function () {
|
|
231
231
|
t.refresh = t.refresh.bind(t);
|
232
232
|
t._requestFilterRefresh = t._requestFilterRefresh.bind(t);
|
233
233
|
|
234
|
+
t._onDialogSortChanged = t._onDialogSortChanged.bind(t);
|
235
|
+
t._onDialogFilterChanged = t._onDialogFilterChanged.bind(t);
|
236
|
+
t._onDialogClosed = t._onDialogClosed.bind(t);
|
234
237
|
|
235
238
|
t._globalFilters = [];
|
236
239
|
t._globalContexts = [];
|
@@ -1779,11 +1782,11 @@ RowFilteringPlugin.prototype.openDialog = function(colIndex, runtimeDialogOption
|
|
1779
1782
|
if(!stp) {
|
1780
1783
|
this._filterDialog.hideSortUI();
|
1781
1784
|
} else {
|
1782
|
-
this._filterDialog.addEventListener("sortChanged", this._onDialogSortChanged
|
1785
|
+
this._filterDialog.addEventListener("sortChanged", this._onDialogSortChanged);
|
1783
1786
|
}
|
1784
|
-
this._filterDialog.addEventListener("filterChanged", this._onDialogFilterChanged
|
1785
|
-
this._filterDialog.addEventListener("confirm", this._onDialogClosed
|
1786
|
-
this._filterDialog.addEventListener("cancel", this._onDialogClosed
|
1787
|
+
this._filterDialog.addEventListener("filterChanged", this._onDialogFilterChanged);
|
1788
|
+
this._filterDialog.addEventListener("confirm", this._onDialogClosed);
|
1789
|
+
this._filterDialog.addEventListener("cancel", this._onDialogClosed);
|
1787
1790
|
}
|
1788
1791
|
}
|
1789
1792
|
|
@@ -2185,44 +2188,34 @@ RowFilteringPlugin.prototype._onDialogClosed = function(e) {
|
|
2185
2188
|
this._hosts[0].focus();
|
2186
2189
|
}
|
2187
2190
|
};
|
2188
|
-
|
2189
|
-
* @ignore
|
2190
|
-
* @param {*} val
|
2191
|
-
*/
|
2192
|
-
RowFilteringPlugin.prototype.mockDialogFilterChange = function(val) {
|
2193
|
-
if(this._filterDialog) {
|
2194
|
-
let arg = {
|
2195
|
-
detail: {}
|
2196
|
-
};
|
2197
|
-
if(Array.isArray(val)) {
|
2198
|
-
if(Array.isArray(val[0])) {
|
2199
|
-
arg.detail.conditions = val;
|
2200
|
-
} else {
|
2201
|
-
arg.detail.value = val;
|
2202
|
-
}
|
2203
|
-
} else {
|
2204
|
-
arg.detail.value = val;
|
2205
|
-
}
|
2206
|
-
this._onDialogFilterChanged(arg);
|
2207
|
-
}
|
2208
|
-
};
|
2191
|
+
|
2209
2192
|
/** @private
|
2210
2193
|
* @param {Object} e
|
2211
2194
|
*/
|
2212
2195
|
RowFilteringPlugin.prototype._onDialogFilterChanged = function(e) {
|
2213
2196
|
let colIndex = this._filterDialog._colIndex;
|
2214
2197
|
let cfo = this._getColumnFilterOption(colIndex);
|
2215
|
-
let uniqueValues =
|
2216
|
-
let rawDataAccessor =
|
2217
|
-
let formattedDataAccessor =
|
2198
|
+
let uniqueValues = null;
|
2199
|
+
let rawDataAccessor = null;
|
2200
|
+
let formattedDataAccessor = null;
|
2218
2201
|
let ctx = null;
|
2219
|
-
|
2220
|
-
|
2221
|
-
|
2222
|
-
|
2223
|
-
|
2202
|
+
|
2203
|
+
if(cfo) {
|
2204
|
+
// TODO: Move uniqueValues out from column filter option object
|
2205
|
+
uniqueValues = cfo.uniqueValues; // Unique values have to be stored before the removal of the filter
|
2206
|
+
rawDataAccessor = cfo._rawDataAccessor;
|
2207
|
+
formattedDataAccessor = cfo._formattedDataAccessor;
|
2208
|
+
|
2209
|
+
if(rawDataAccessor || formattedDataAccessor) {
|
2210
|
+
ctx = {
|
2211
|
+
"rawDataAccessor": rawDataAccessor || null,
|
2212
|
+
"formattedDataAccessor": formattedDataAccessor || null
|
2213
|
+
};
|
2214
|
+
}
|
2215
|
+
this.removeColumnFilters(colIndex);
|
2216
|
+
} else {
|
2217
|
+
uniqueValues = e.uniqueValues || {};
|
2224
2218
|
}
|
2225
|
-
this.removeColumnFilters(colIndex);
|
2226
2219
|
|
2227
2220
|
// Check inputs from advanced filter UIs
|
2228
2221
|
let conditions = e.detail.conditions;
|
@@ -2291,7 +2284,13 @@ RowFilteringPlugin.prototype._onDialogFilterChanged = function(e) {
|
|
2291
2284
|
let jLen = rawVals.length;
|
2292
2285
|
for(let j = 0; j < jLen; ++j) {
|
2293
2286
|
let rawVal = rawVals[j];
|
2294
|
-
|
2287
|
+
if(rawVal) {
|
2288
|
+
itemMap[rawVal] = (rawVal instanceof Date) ? rawVal.getTime() : rawVal;
|
2289
|
+
} else if(rawVal === 0) {
|
2290
|
+
itemMap["0"] = true;
|
2291
|
+
} else if(rawVal === false) {
|
2292
|
+
itemMap["false"] = true;
|
2293
|
+
}
|
2295
2294
|
}
|
2296
2295
|
}
|
2297
2296
|
if(atLeastOne) {
|
@@ -2304,19 +2303,6 @@ RowFilteringPlugin.prototype._onDialogFilterChanged = function(e) {
|
|
2304
2303
|
});
|
2305
2304
|
};
|
2306
2305
|
|
2307
|
-
/** @public
|
2308
|
-
* @ignore
|
2309
|
-
* @param {string} sortOrder
|
2310
|
-
*/
|
2311
|
-
RowFilteringPlugin.prototype.mockDialogSortChange = function(sortOrder) {
|
2312
|
-
if(this._filterDialog) {
|
2313
|
-
let arg = {
|
2314
|
-
detail: {}
|
2315
|
-
};
|
2316
|
-
arg.detail.value = sortOrder;
|
2317
|
-
this._onDialogSortChanged(arg);
|
2318
|
-
}
|
2319
|
-
};
|
2320
2306
|
/** @private
|
2321
2307
|
* @param {Object} e
|
2322
2308
|
*/
|
@@ -2329,7 +2315,7 @@ RowFilteringPlugin.prototype._onDialogSortChanged = function(e) {
|
|
2329
2315
|
if(stp.getSortOrder(colIndex) === eDetail) {
|
2330
2316
|
stp.sortColumn(colIndex, "n", { "isUserAction": true });
|
2331
2317
|
} else {
|
2332
|
-
stp.sortColumn(colIndex, eDetail, { "isUserAction": true }
|
2318
|
+
stp.sortColumn(colIndex, eDetail, { "isUserAction": true });
|
2333
2319
|
}
|
2334
2320
|
this._dispatch("dialogCommitted", {
|
2335
2321
|
"sortOrder": e.detail.value,
|
@@ -2430,6 +2416,18 @@ RowFilteringPlugin.prototype.hideColumnFilterIcon = function(colIndex, hidden) {
|
|
2430
2416
|
}
|
2431
2417
|
};
|
2432
2418
|
|
2419
|
+
/** @public
|
2420
|
+
* @ignore
|
2421
|
+
* @return {!Object}
|
2422
|
+
*/
|
2423
|
+
RowFilteringPlugin.prototype._getEventHandlers = function() {
|
2424
|
+
return {
|
2425
|
+
"dialogSortChanged": this._onDialogSortChanged,
|
2426
|
+
"dialogFilterChanged": this._onDialogFilterChanged,
|
2427
|
+
"dialogClosed": this._onDialogClosed
|
2428
|
+
};
|
2429
|
+
};
|
2430
|
+
|
2433
2431
|
|
2434
2432
|
|
2435
2433
|
export default RowFilteringPlugin;
|