@refinitiv-ui/efx-grid 6.0.18 → 6.0.20
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/column-format-dialog/themes/elemental/dark/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/elemental/dark/es5/all-elements.js +1 -1
- package/lib/column-format-dialog/themes/elemental/light/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/elemental/light/es5/all-elements.js +1 -1
- package/lib/column-format-dialog/themes/halo/dark/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/column-format-dialog/themes/halo/light/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/column-format-dialog/themes/luna/default/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/luna/default/es5/all-elements.js +1 -1
- package/lib/column-format-dialog/themes/solar/charcoal/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/solar/charcoal/es5/all-elements.js +1 -1
- package/lib/column-format-dialog/themes/solar/pearl/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/solar/pearl/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +2 -1
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +89 -8
- 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 +40 -23
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataView.d.ts +4 -0
- package/lib/core/es6/data/DataView.js +19 -1
- package/lib/core/es6/data/SegmentCollection.js +20 -8
- package/lib/core/es6/grid/Core.js +1 -1
- package/lib/core/es6/grid/components/Cell.js +0 -13
- package/lib/filter-dialog/lib/checkbox-list.js +148 -81
- package/lib/filter-dialog/lib/filter-dialog.js +170 -139
- package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/light/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/halo/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +1 -1
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +22 -23
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/tr-grid-checkbox/es6/Checkbox.js +63 -12
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +70 -110
- package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +1 -1
- package/lib/tr-grid-filter-input/es6/FilterInput.js +10 -9
- package/lib/tr-grid-pagination/es6/Pagination.d.ts +1 -0
- package/lib/tr-grid-pagination/es6/Pagination.js +35 -29
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +15 -14
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +44 -6
- package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +5 -0
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +30 -0
- package/lib/tr-grid-util/es6/Popup.js +5 -1
- package/lib/types/es6/Core/data/DataView.d.ts +4 -0
- package/lib/types/es6/FilterInput.d.ts +1 -0
- package/lib/types/es6/Pagination.d.ts +1 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +1 -1
- package/lib/types/es6/RowDragging.d.ts +15 -14
- package/lib/types/es6/RowGrouping.d.ts +5 -0
- package/lib/versions.json +10 -10
- package/package.json +1 -1
@@ -31,6 +31,11 @@ import "./checkbox-list.js";
|
|
31
31
|
* @property {Function=} sortChanged Sort changed handler
|
32
32
|
*/
|
33
33
|
|
34
|
+
/** @type {number}
|
35
|
+
* @private
|
36
|
+
* @constant
|
37
|
+
*/
|
38
|
+
const ITEM_LIMIT = 500;
|
34
39
|
/** @type {Array.<Array>}
|
35
40
|
* @private
|
36
41
|
* @constant
|
@@ -126,12 +131,15 @@ class FilterDialog extends BasicElement {
|
|
126
131
|
}
|
127
132
|
|
128
133
|
static get is() {
|
129
|
-
return
|
134
|
+
return "filter-dialog";
|
130
135
|
}
|
131
136
|
|
132
137
|
constructor() {
|
133
138
|
super();
|
134
139
|
|
140
|
+
this._updateDialogHeight = this._updateDialogHeight.bind(this);
|
141
|
+
this._afterDialogOpened = this._afterDialogOpened.bind(this);
|
142
|
+
|
135
143
|
this.lang = "en";
|
136
144
|
this._lang = "en";
|
137
145
|
this._translation = translation;
|
@@ -147,19 +155,21 @@ class FilterDialog extends BasicElement {
|
|
147
155
|
});
|
148
156
|
this._popup.enableUIBlocking(true);
|
149
157
|
this._dialogHeightTimerId = 0;
|
150
|
-
this._updateDialogHeight = this._updateDialogHeight.bind(this);
|
151
158
|
ElementObserver.addLanguageListener(this);
|
152
159
|
}
|
153
160
|
|
154
161
|
/**
|
155
|
-
|
156
|
-
|
157
|
-
|
162
|
+
* @private
|
163
|
+
* @param {Object} changedProperties
|
164
|
+
*/
|
158
165
|
update(changedProperties) {
|
159
166
|
|
160
167
|
if(changedProperties.has("lang")) {
|
161
168
|
this._lang = ElfUtil.toLangString(this.lang);
|
162
169
|
}
|
170
|
+
if(changedProperties.has("target")) {
|
171
|
+
this._popup.attachTo(this.target);
|
172
|
+
}
|
163
173
|
|
164
174
|
if(changedProperties.has("config")) {
|
165
175
|
var options = this.config;
|
@@ -182,6 +192,7 @@ class FilterDialog extends BasicElement {
|
|
182
192
|
|
183
193
|
if (options.target) {
|
184
194
|
this.target = options.target;
|
195
|
+
this._popup.attachTo(this.target);
|
185
196
|
}
|
186
197
|
|
187
198
|
if (typeof options.filterChanged === "function") {
|
@@ -224,9 +235,9 @@ class FilterDialog extends BasicElement {
|
|
224
235
|
}
|
225
236
|
|
226
237
|
/** A `TemplateResult` that will be used to render the updated internal template
|
227
|
-
|
228
|
-
|
229
|
-
|
238
|
+
* @private
|
239
|
+
* @return {*}
|
240
|
+
*/
|
230
241
|
render() {
|
231
242
|
var lang = this._translation[this._lang] ? this._lang : "en";
|
232
243
|
var t = this._translation[lang];
|
@@ -294,9 +305,9 @@ class FilterDialog extends BasicElement {
|
|
294
305
|
}
|
295
306
|
|
296
307
|
/**
|
297
|
-
|
298
|
-
|
299
|
-
|
308
|
+
* @private
|
309
|
+
* @override
|
310
|
+
*/
|
300
311
|
firstUpdated(changedProps) {
|
301
312
|
this._initialized = true;
|
302
313
|
|
@@ -356,13 +367,13 @@ class FilterDialog extends BasicElement {
|
|
356
367
|
}
|
357
368
|
|
358
369
|
/**
|
359
|
-
|
360
|
-
|
361
|
-
|
370
|
+
* @private
|
371
|
+
* @override
|
372
|
+
*/
|
362
373
|
updated(changedProps) {
|
363
374
|
// Update Sort UI
|
364
|
-
var isHiddenSortUIChanged = changedProps.has(
|
365
|
-
var isHiddenFilterUIChanged = changedProps.has(
|
375
|
+
var isHiddenSortUIChanged = changedProps.has("hiddenSortUI");
|
376
|
+
var isHiddenFilterUIChanged = changedProps.has("hiddenFilterUI");
|
366
377
|
if (isHiddenSortUIChanged) {
|
367
378
|
let pn = this._sortUI.parentNode;
|
368
379
|
if (this.hiddenSortUI) {
|
@@ -388,47 +399,56 @@ class FilterDialog extends BasicElement {
|
|
388
399
|
if (pn) {
|
389
400
|
pn.removeChild(this._filterUI);
|
390
401
|
}
|
391
|
-
this._dialogContent.classList.add(
|
402
|
+
this._dialogContent.classList.add("no-filter-ui");
|
392
403
|
} else {
|
393
404
|
if (!pn) {
|
394
405
|
this._dialogContent.appendChild(this._filterUI);
|
395
406
|
}
|
396
|
-
this._dialogContent.classList.remove(
|
407
|
+
this._dialogContent.classList.remove("no-filter-ui");
|
397
408
|
}
|
398
409
|
}
|
399
410
|
|
400
411
|
if (isHiddenSortUIChanged || isHiddenFilterUIChanged) {
|
401
412
|
var isHide = this.hiddenSortUI || this.hiddenFilterUI;
|
402
|
-
this._separator.classList.toggle(
|
413
|
+
this._separator.classList.toggle("hide", isHide);
|
403
414
|
}
|
404
415
|
|
405
|
-
if (changedProps.has(
|
416
|
+
if (changedProps.has("isShown")) {
|
406
417
|
if (this.isShown) {
|
407
|
-
this._popup.attachTo(this.target, "bottom"); // This will cause popup to recalculate its position
|
408
418
|
this._updateUIState(); // should updateUIState everytime popup being show
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
419
|
+
this._popup.show(); // Update position
|
420
|
+
setTimeout(this._afterDialogOpened, 0); //use setTimeout to make sure everything is rendered before focus
|
421
|
+
} else { // This is to handle the case where isShown is directly modified from the dialog. We need to synchronize the states
|
422
|
+
this._popup.hide();
|
423
|
+
}
|
424
|
+
}
|
425
|
+
}
|
426
|
+
|
427
|
+
/**
|
428
|
+
* @private
|
429
|
+
*/
|
430
|
+
_afterDialogOpened() {
|
431
|
+
if(this.isShown) {
|
432
|
+
this._cancelBtn.focus(); // Keep focus on cancel button when open dialog
|
433
|
+
this._updateDialogHeight(true);
|
434
|
+
if(!this._firstRendered) {
|
435
|
+
this._firstRendered = true;
|
436
|
+
this._popup.show(); // Update position
|
416
437
|
}
|
417
|
-
this._popup.show(this.isShown);
|
418
438
|
}
|
419
439
|
}
|
420
440
|
|
421
441
|
/** Initialize dialog
|
422
|
-
|
423
|
-
|
424
|
-
|
442
|
+
* @public
|
443
|
+
* @param {FilterDialog~Config} options - initial data
|
444
|
+
*/
|
425
445
|
init(options) {
|
426
446
|
this.config = options;
|
427
447
|
}
|
428
448
|
|
429
449
|
/** Show the dialog as a popup
|
430
|
-
|
431
|
-
|
450
|
+
* @public
|
451
|
+
*/
|
432
452
|
show() {
|
433
453
|
this._popup.appendChild(this); // To force first time initialization, focus is already included in updated()
|
434
454
|
|
@@ -436,62 +456,66 @@ class FilterDialog extends BasicElement {
|
|
436
456
|
}
|
437
457
|
|
438
458
|
/** Hide the dialog
|
439
|
-
|
440
|
-
|
459
|
+
* @public
|
460
|
+
*/
|
441
461
|
hide() {
|
442
462
|
this._popup.hide();
|
443
463
|
}
|
444
464
|
|
445
465
|
/**
|
446
|
-
|
447
|
-
|
466
|
+
* @private
|
467
|
+
*/
|
448
468
|
_onPopupShown() {
|
449
469
|
this.isShown = true; // To trigger update
|
450
470
|
}
|
451
471
|
/**
|
452
|
-
|
453
|
-
|
472
|
+
* @private
|
473
|
+
*/
|
454
474
|
_onPopupHidden() {
|
455
475
|
this.isShown = false; // For backward compatability
|
476
|
+
if (this._dialogHeightTimerId) {
|
477
|
+
clearTimeout(this._dialogHeightTimerId);
|
478
|
+
this._dialogHeightTimerId = 0;
|
479
|
+
}
|
456
480
|
}
|
457
481
|
|
458
482
|
/**
|
459
|
-
|
460
|
-
|
461
|
-
|
483
|
+
* @private
|
484
|
+
*/
|
485
|
+
_onWindowResize() {
|
462
486
|
if(!this._dialogHeightTimerId && this.isShown){
|
463
487
|
this._dialogHeightTimerId = setTimeout(this._updateDialogHeight, 500);
|
464
488
|
}
|
465
489
|
}
|
466
490
|
|
467
491
|
/**
|
468
|
-
|
469
|
-
|
470
|
-
|
492
|
+
* @public
|
493
|
+
* @param {string} val Sorting state "d" or "a"
|
494
|
+
*/
|
471
495
|
setSortState(val) {
|
472
496
|
this.sortState = (val) ? val.charAt(0).toLowerCase() : "";
|
473
497
|
}
|
474
498
|
|
475
499
|
/** Hide Sort UI block
|
476
|
-
|
477
|
-
|
478
|
-
|
500
|
+
* @public
|
501
|
+
* @param {boolean} val - value
|
502
|
+
*/
|
479
503
|
hideSortUI(val) {
|
480
504
|
this.hiddenSortUI = val;
|
481
505
|
}
|
482
506
|
|
483
507
|
/**
|
484
|
-
|
485
|
-
|
486
|
-
|
508
|
+
* @private
|
509
|
+
* @param {*} e
|
510
|
+
*/
|
487
511
|
_filterData(e) {
|
488
512
|
this._dataSelector.filter(e.detail.value);
|
489
513
|
}
|
490
514
|
|
491
515
|
/**
|
492
|
-
|
493
|
-
|
494
|
-
|
516
|
+
* @private
|
517
|
+
* @param {*} e
|
518
|
+
*/
|
495
519
|
_onCondSelectorKeyDown(e) {
|
496
520
|
if (e.keyCode == 13) {
|
497
521
|
e.stopPropagation();
|
@@ -499,10 +523,10 @@ class FilterDialog extends BasicElement {
|
|
499
523
|
}
|
500
524
|
|
501
525
|
/**
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
526
|
+
* Click on sort buttons
|
527
|
+
* @private
|
528
|
+
* @param {object} e - event
|
529
|
+
*/
|
506
530
|
_onClickSort(e) {
|
507
531
|
const tgt = e.target;
|
508
532
|
let sortState = "n";
|
@@ -516,7 +540,7 @@ class FilterDialog extends BasicElement {
|
|
516
540
|
}
|
517
541
|
this.sortState = sortState;
|
518
542
|
|
519
|
-
this.dispatchEvent(new CustomEvent(
|
543
|
+
this.dispatchEvent(new CustomEvent("sortChanged", {
|
520
544
|
detail: {
|
521
545
|
value: sortState
|
522
546
|
}
|
@@ -527,10 +551,10 @@ class FilterDialog extends BasicElement {
|
|
527
551
|
}
|
528
552
|
|
529
553
|
/**
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
554
|
+
* Click on Filter By Value Condition buttons
|
555
|
+
* @private
|
556
|
+
* @param {object} e - event
|
557
|
+
*/
|
534
558
|
_onClickFilter(e) {
|
535
559
|
const tgt = e.target;
|
536
560
|
const children = this._filterBtns.children;
|
@@ -538,13 +562,13 @@ class FilterDialog extends BasicElement {
|
|
538
562
|
e.preventDefault();
|
539
563
|
e.stopPropagation();
|
540
564
|
this._updateFilterModeSelectionUI();
|
541
|
-
this._updateDialogHeight();
|
565
|
+
this._updateDialogHeight(true);
|
542
566
|
}
|
543
567
|
|
544
568
|
/**
|
545
|
-
|
546
|
-
|
547
|
-
|
569
|
+
* @private
|
570
|
+
* @param {object} e - event
|
571
|
+
*/
|
548
572
|
_onDoneBtnClick(e) {
|
549
573
|
let context;
|
550
574
|
if (this._isAdvancedFilterMode()) {
|
@@ -626,17 +650,17 @@ class FilterDialog extends BasicElement {
|
|
626
650
|
}
|
627
651
|
|
628
652
|
/**
|
629
|
-
|
630
|
-
|
631
|
-
|
653
|
+
* @private
|
654
|
+
* @param {object} e - event
|
655
|
+
*/
|
632
656
|
_onCancelBtnClick(e) {
|
633
|
-
this.dispatchEvent(new CustomEvent(
|
657
|
+
this.dispatchEvent(new CustomEvent("cancel"));
|
634
658
|
this.hide();
|
635
659
|
}
|
636
660
|
|
637
661
|
/**
|
638
|
-
|
639
|
-
|
662
|
+
* @private
|
663
|
+
*/
|
640
664
|
_clearAdvanceFilterUI() {
|
641
665
|
var defaultVal = "";
|
642
666
|
var dateTimeType = toDateTimeType(this.fieldDataType);
|
@@ -662,8 +686,8 @@ class FilterDialog extends BasicElement {
|
|
662
686
|
}
|
663
687
|
}
|
664
688
|
/**
|
665
|
-
|
666
|
-
|
689
|
+
* @private
|
690
|
+
*/
|
667
691
|
_updateGeneralComboBoxes() {
|
668
692
|
if(this._initialized) {
|
669
693
|
var filterItems;
|
@@ -683,10 +707,10 @@ class FilterDialog extends BasicElement {
|
|
683
707
|
}
|
684
708
|
|
685
709
|
/**
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
710
|
+
* Filter is Advanced (By Condition) or Custom (By Value)
|
711
|
+
* @private
|
712
|
+
* @return {boolean}
|
713
|
+
*/
|
690
714
|
_isAdvancedFilterMode() {
|
691
715
|
const ch = this.filterMode ? this.filterMode.charAt(0).toLowerCase() : "";
|
692
716
|
// a - Advanced Filter by Condition; c - Custom Filter by Value
|
@@ -694,10 +718,10 @@ class FilterDialog extends BasicElement {
|
|
694
718
|
}
|
695
719
|
|
696
720
|
/**
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
721
|
+
* @private
|
722
|
+
* @param {Element} elem ef-combo-box element
|
723
|
+
* @param {string} defaultVal=""
|
724
|
+
*/
|
701
725
|
_clearValue(elem, defaultVal) {
|
702
726
|
if(elem.clearSelection) { // clearSelection is deprecated in ELF v4
|
703
727
|
elem.clearSelection();
|
@@ -706,34 +730,34 @@ class FilterDialog extends BasicElement {
|
|
706
730
|
// So wee need to remove free-text and re-set again
|
707
731
|
// to track bug https://jira.refinitiv.com/browse/ELF-1694
|
708
732
|
// TODO:: need to remove WORKAROUND after ELF-1694 fixed
|
709
|
-
var hasFreeTextMode = elem.getAttribute(
|
733
|
+
var hasFreeTextMode = elem.getAttribute("free-text") != null;
|
710
734
|
if (hasFreeTextMode) {
|
711
|
-
elem.removeAttribute(
|
735
|
+
elem.removeAttribute("free-text");
|
712
736
|
}
|
713
737
|
|
714
738
|
elem.value = defaultVal || "";
|
715
739
|
|
716
740
|
if (hasFreeTextMode) {
|
717
|
-
elem.setAttribute(
|
741
|
+
elem.setAttribute("free-text", "");
|
718
742
|
}
|
719
743
|
}
|
720
744
|
}
|
721
745
|
|
722
746
|
/** to prepare and sync state from config into all UI
|
723
|
-
|
724
|
-
|
747
|
+
* @private
|
748
|
+
*/
|
725
749
|
_updateUIState() {
|
726
750
|
this._updateFilterModeSelectionUI();
|
727
751
|
this._dataFilter.value = "";
|
728
|
-
this._dataSelector.filter(
|
752
|
+
this._dataSelector.filter("");
|
729
753
|
this._updateValueSelector();
|
730
754
|
this._updateAdvanceFilterUI();
|
731
755
|
this._updateSortButtonUI();
|
732
756
|
}
|
733
757
|
|
734
758
|
/**
|
735
|
-
|
736
|
-
|
759
|
+
* @private
|
760
|
+
*/
|
737
761
|
_updateAdvanceFilterUI() {
|
738
762
|
// Reset Advance Filter UIs
|
739
763
|
this._clearAdvanceFilterUI();
|
@@ -784,9 +808,14 @@ class FilterDialog extends BasicElement {
|
|
784
808
|
}
|
785
809
|
}
|
786
810
|
/**
|
787
|
-
|
788
|
-
|
789
|
-
|
811
|
+
* @private
|
812
|
+
* @param {boolean=} afterOpened
|
813
|
+
*/
|
814
|
+
_updateDialogHeight(afterOpened) {
|
815
|
+
if(!afterOpened) {
|
816
|
+
this._dialogHeightTimerId = 0;
|
817
|
+
}
|
818
|
+
|
790
819
|
this._rootContainer.classList.remove("compact");
|
791
820
|
this._rootContainer.style.height = "";
|
792
821
|
|
@@ -810,34 +839,36 @@ class FilterDialog extends BasicElement {
|
|
810
839
|
this._rootContainer.classList.add("compact");
|
811
840
|
}
|
812
841
|
}
|
813
|
-
|
814
|
-
if(this._dialogHeightTimerId){
|
815
|
-
this._dialogHeightTimerId = 0;
|
816
|
-
}
|
817
842
|
}
|
818
843
|
/**
|
819
|
-
|
820
|
-
|
844
|
+
* @private
|
845
|
+
*/
|
821
846
|
_updateValueSelector() {
|
822
|
-
|
823
|
-
|
824
|
-
let data = this.data || [];
|
825
|
-
let items = null;
|
847
|
+
let data = this.data;
|
848
|
+
let ary = null;
|
826
849
|
if (Array.isArray(data)) {
|
827
|
-
|
850
|
+
ary = data;
|
851
|
+
} else if(data) {
|
852
|
+
ary = Object.keys(data); // TODO: Obsolete this
|
828
853
|
} else {
|
829
|
-
|
854
|
+
ary = [];
|
830
855
|
}
|
831
856
|
|
857
|
+
// Data selector can take large number of items
|
858
|
+
this._dataSelector.data = ary; // Preserve original referencing
|
859
|
+
|
832
860
|
// Value selector for Filter by Condition
|
833
|
-
|
834
|
-
|
861
|
+
if(ary.length > ITEM_LIMIT) {
|
862
|
+
ary = ary.slice(0, ITEM_LIMIT); // Prevent combo box from over population
|
863
|
+
}
|
864
|
+
this._generalComboBoxes[1].data = ary.map(this._toComboBoxItem);
|
865
|
+
this._generalComboBoxes[3].data = ary.map(this._toComboBoxItem);
|
835
866
|
}
|
836
867
|
/**
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
868
|
+
* @private
|
869
|
+
* @param {*} obj
|
870
|
+
* @returns {Object}
|
871
|
+
*/
|
841
872
|
_toComboBoxItem(obj) {
|
842
873
|
let itemVal = (typeof obj === "string") ? obj : obj.title || "";
|
843
874
|
return {
|
@@ -847,11 +878,11 @@ class FilterDialog extends BasicElement {
|
|
847
878
|
}
|
848
879
|
|
849
880
|
/**
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
881
|
+
* Return date string in format yyyy-MM-dd
|
882
|
+
* @private
|
883
|
+
* @param {Object|string} date
|
884
|
+
* @return {string}
|
885
|
+
*/
|
855
886
|
_getDateString(date) {
|
856
887
|
var dateString = "";
|
857
888
|
var dateFormat = "yyyy-MM-dd";
|
@@ -864,12 +895,12 @@ class FilterDialog extends BasicElement {
|
|
864
895
|
}
|
865
896
|
|
866
897
|
/**
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
898
|
+
* Return date object
|
899
|
+
* @private
|
900
|
+
* @param {string} dateString // Date string in UTC format yyyy-MM-dd
|
901
|
+
* @return {Date}
|
902
|
+
*/
|
903
|
+
_getDateObject(dateString) {
|
873
904
|
var date = new Date(dateString);
|
874
905
|
if(date && this.useUTCTime == false){
|
875
906
|
date.setTime(date.getTime() + (date.getTimezoneOffset() * 60000)); // convert to local time
|
@@ -878,19 +909,19 @@ class FilterDialog extends BasicElement {
|
|
878
909
|
}
|
879
910
|
|
880
911
|
/**
|
881
|
-
|
882
|
-
|
883
|
-
|
912
|
+
* @private
|
913
|
+
* @return {Object}
|
914
|
+
*/
|
884
915
|
_getTranslation() {
|
885
|
-
var lang = this._translation[this._lang] ? this._lang :
|
916
|
+
var lang = this._translation[this._lang] ? this._lang : "en";
|
886
917
|
return this._translation[lang];
|
887
918
|
}
|
888
919
|
|
889
920
|
/**
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
921
|
+
* @private
|
922
|
+
* @param {Array} filters
|
923
|
+
* @return {Array}
|
924
|
+
*/
|
894
925
|
_translateFilters(filters) {
|
895
926
|
let trans = this._getTranslation();
|
896
927
|
var len = filters.length;
|
@@ -904,9 +935,9 @@ class FilterDialog extends BasicElement {
|
|
904
935
|
}
|
905
936
|
|
906
937
|
/**
|
907
|
-
|
908
|
-
|
909
|
-
|
938
|
+
* Set filter Visibilities of layout
|
939
|
+
* @private
|
940
|
+
*/
|
910
941
|
_updateFilterModeSelectionUI() {
|
911
942
|
// Filter By Value - Condition buttons
|
912
943
|
const children = this._filterBtns.children;
|
@@ -923,9 +954,9 @@ class FilterDialog extends BasicElement {
|
|
923
954
|
}
|
924
955
|
|
925
956
|
/**
|
926
|
-
|
927
|
-
|
928
|
-
|
957
|
+
* to update state of sort button
|
958
|
+
* @private
|
959
|
+
*/
|
929
960
|
_updateSortButtonUI() {
|
930
961
|
const sortState = this.sortState;
|
931
962
|
const children = this._sortBtns.children;
|
@@ -934,7 +965,7 @@ class FilterDialog extends BasicElement {
|
|
934
965
|
}
|
935
966
|
}
|
936
967
|
|
937
|
-
customElement(
|
968
|
+
customElement("filter-dialog")(FilterDialog);
|
938
969
|
|
939
970
|
export { FilterDialog };
|
940
971
|
export default FilterDialog;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import "./imports/native-elements.js";
|
2
2
|
|
3
3
|
|
4
|
-
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'checkbox-list', styles: ':host{display:block;scrollbar-face-color:#3e444f;scrollbar-shadow-color:#3e444f;scrollbar-highlight-color:#3e444f;scrollbar-arrow-color:#3e444f;scrollbar-track-color:#21242a;scrollbar-3dlight-color:#21242a;scrollbar-darkshadow-color:#21242a;scrollbar-color:#3e444f #21242a}:host .hidden{display:none}:host .select-btn{margin-top:0;margin-bottom:0;border-bottom:none}:host #container{border:1px solid #3e444f;overflow-y:auto;min-height:48px;flex-grow:1}:host .item-container{display:flex;width:100%;align-items:center}:host .item-label{margin-left:7px;min-width:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .root{display:flex;flex-flow:column;overflow:hidden}::-webkit-scrollbar{width:15px;height:15px}::-webkit-scrollbar-button{background:0 0/1px 2px no-repeat #21242a;height:15px;width:15px;display:block}::-webkit-scrollbar-thumb{background:#3e444f;border-radius:8px;border:2px solid #21242a}::-webkit-scrollbar-thumb:hover{background:#b7bcc6}::-webkit-scrollbar-thumb:active{background:#707a8e}::-webkit-scrollbar-track{background:#21242a}::-webkit-scrollbar-corner{background:#21242a}::-webkit-scrollbar-button:end:decrement,::-webkit-scrollbar-button:start:increment{display:none}::-webkit-scrollbar-button:horizontal{background-size:2px 1px}::-webkit-scrollbar-button:vertical:start:decrement{background-image:linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f);background-position:12px 8.5px,11px 7.5px,10px 6.5px,9px 5.5px,8px 4.5px,7px 3.5px,6px 4.5px,5px 5.5px,4px 6.5px,3px 7.5px,2px 8.5px}::-webkit-scrollbar-button:vertical:start:decrement:hover{background-image:linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6);background-position:12px 8.5px,11px 7.5px,10px 6.5px,9px 5.5px,8px 4.5px,7px 3.5px,6px 4.5px,5px 5.5px,4px 6.5px,3px 7.5px,2px 8.5px}::-webkit-scrollbar-button:vertical:start:decrement:active{background-image:linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e);background-position:12px 8.5px,11px 7.5px,10px 6.5px,9px 5.5px,8px 4.5px,7px 3.5px,6px 4.5px,5px 5.5px,4px 6.5px,3px 7.5px,2px 8.5px}::-webkit-scrollbar-button:vertical:end:increment{background-image:linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f);background-position:12px 4.5px,11px 5.5px,10px 6.5px,9px 7.5px,8px 8.5px,7px 9.5px,6px 8.5px,5px 7.5px,4px 6.5px,3px 5.5px,2px 4.5px}::-webkit-scrollbar-button:vertical:end:increment:hover{background-image:linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6);background-position:12px 4.5px,11px 5.5px,10px 6.5px,9px 7.5px,8px 8.5px,7px 9.5px,6px 8.5px,5px 7.5px,4px 6.5px,3px 5.5px,2px 4.5px}::-webkit-scrollbar-button:vertical:end:increment:active{background-image:linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e);background-position:12px 4.5px,11px 5.5px,10px 6.5px,9px 7.5px,8px 8.5px,7px 9.5px,6px 8.5px,5px 7.5px,4px 6.5px,3px 5.5px,2px 4.5px}::-webkit-scrollbar-button:horizontal:start:decrement{background-image:linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f);background-position:8.5px 12px,7.5px 11px,6.5px 10px,5.5px 9px,4.5px 8px,3.5px 7px,4.5px 6px,5.5px 5px,6.5px 4px,7.5px 3px,8.5px 2px}::-webkit-scrollbar-button:horizontal:start:decrement:hover{background-image:linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6);background-position:8.5px 12px,7.5px 11px,6.5px 10px,5.5px 9px,4.5px 8px,3.5px 7px,4.5px 6px,5.5px 5px,6.5px 4px,7.5px 3px,8.5px 2px}::-webkit-scrollbar-button:horizontal:start:decrement:active{background-image:linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e);background-position:8.5px 12px,7.5px 11px,6.5px 10px,5.5px 9px,4.5px 8px,3.5px 7px,4.5px 6px,5.5px 5px,6.5px 4px,7.5px 3px,8.5px 2px}::-webkit-scrollbar-button:horizontal:end:increment{background-image:linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f),linear-gradient(#3e444f,#3e444f);background-position:4.5px 12px,5.5px 11px,6.5px 10px,7.5px 9px,8.5px 8px,9.5px 7px,8.5px 6px,7.5px 5px,6.5px 4px,5.5px 3px,4.5px 2px}::-webkit-scrollbar-button:horizontal:end:increment:hover{background-image:linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6),linear-gradient(#b7bcc6,#b7bcc6);background-position:4.5px 12px,5.5px 11px,6.5px 10px,7.5px 9px,8.5px 8px,9.5px 7px,8.5px 6px,7.5px 5px,6.5px 4px,5.5px 3px,4.5px 2px}::-webkit-scrollbar-button:horizontal:end:increment:active{background-image:linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e),linear-gradient(#707a8e,#707a8e);background-position:4.5px 12px,5.5px 11px,6.5px 10px,7.5px 9px,8.5px 8px,9.5px 7px,8.5px 6px,7.5px 5px,6.5px 4px,5.5px 3px,4.5px 2px}' }}));
|