@refinitiv-ui/efx-grid 6.0.110 → 6.0.111
Sign up to get free protection for your applications and to get access to all the features.
package/lib/grid/index.js
CHANGED
@@ -47,11 +47,24 @@ import { CoralItems } from '../../tr-grid-util/es6/CoralItems.js';
|
|
47
47
|
* @property {Object} section Section(ILayoutGrid) contains all of the filter inputs
|
48
48
|
*/
|
49
49
|
|
50
|
+
/** @private
|
51
|
+
* @param {string} str
|
52
|
+
* @return {string}
|
53
|
+
*/
|
54
|
+
|
55
|
+
function convertToLowerCase(str) {
|
56
|
+
if (typeof str === "string") {
|
57
|
+
return str.toLowerCase();
|
58
|
+
}
|
59
|
+
|
60
|
+
return "";
|
61
|
+
}
|
50
62
|
/** @constructor
|
51
63
|
* @extends {GridPlugin}
|
52
64
|
* @param {FilterInputPlugin~Options=} options
|
53
65
|
*/
|
54
66
|
|
67
|
+
|
55
68
|
var FilterInputPlugin = function FilterInputPlugin(options) {
|
56
69
|
this._onInputChanged = this._onInputChanged.bind(this);
|
57
70
|
this._onOpenedChanged = this._onOpenedChanged.bind(this);
|
@@ -465,14 +478,14 @@ FilterInputPlugin.prototype._createColumnInputs = function (section, host) {
|
|
465
478
|
var defaultValue = colOpt.defaultValue;
|
466
479
|
|
467
480
|
if (defaultValue) {
|
468
|
-
var
|
481
|
+
var elemType = convertToLowerCase(colOpt.type);
|
469
482
|
|
470
|
-
if (
|
483
|
+
if (elemType === "date") {
|
471
484
|
var dateObj = ElfDate.from(defaultValue);
|
472
485
|
defaultValue = dateObj ? dateObj.toDateString().substr(4) : "";
|
473
486
|
}
|
474
487
|
|
475
|
-
if (
|
488
|
+
if (elemType === "multiselect") {
|
476
489
|
var textMap = FilterInputPlugin._createMapObject(defaultValue);
|
477
490
|
|
478
491
|
this.filterColumn(c, "", textMap);
|
@@ -500,12 +513,7 @@ FilterInputPlugin._uiMap = {
|
|
500
513
|
*/
|
501
514
|
|
502
515
|
FilterInputPlugin.prototype._createFilterUI = function (colOpt) {
|
503
|
-
var elemType = colOpt.type;
|
504
|
-
|
505
|
-
if (elemType) {
|
506
|
-
elemType = elemType.toLowerCase();
|
507
|
-
}
|
508
|
-
|
516
|
+
var elemType = convertToLowerCase(colOpt.type);
|
509
517
|
var defaultValue = colOpt.defaultValue;
|
510
518
|
var elemTrigger = colOpt.trigger != null ? colOpt.trigger : this._inputTrigger;
|
511
519
|
var uiTag = FilterInputPlugin._uiMap[elemType] || "input";
|
@@ -663,11 +671,10 @@ FilterInputPlugin.prototype._retrieveColumnOption = function (colIndex, colDef)
|
|
663
671
|
var option = this._newExtColumnOption(colIndex);
|
664
672
|
|
665
673
|
if (filterOption) {
|
666
|
-
var
|
674
|
+
var elemType = convertToLowerCase(filterOption["type"]);
|
667
675
|
|
668
|
-
if (
|
669
|
-
type =
|
670
|
-
option["type"] = type;
|
676
|
+
if (elemType) {
|
677
|
+
option["type"] = elemType;
|
671
678
|
}
|
672
679
|
|
673
680
|
var defaultLogic = filterOption["filterLogic"] || filterOption["defaultLogic"];
|
@@ -680,7 +687,7 @@ FilterInputPlugin.prototype._retrieveColumnOption = function (colIndex, colDef)
|
|
680
687
|
}
|
681
688
|
}
|
682
689
|
|
683
|
-
if (
|
690
|
+
if (elemType === "multiselect" && option._comparingLogic === FilterInputPlugin._containingFilter) {
|
684
691
|
option._comparingLogic = FilterInputPlugin._multiSelectionFilter;
|
685
692
|
}
|
686
693
|
|
@@ -700,7 +707,7 @@ FilterInputPlugin.prototype._retrieveColumnOption = function (colIndex, colDef)
|
|
700
707
|
|
701
708
|
if (Array.isArray(entries)) {
|
702
709
|
// Add Clear filter option
|
703
|
-
if (
|
710
|
+
if (elemType === "select") {
|
704
711
|
entries.push({
|
705
712
|
label: 'No Filter',
|
706
713
|
value: 'No Filter'
|
@@ -851,15 +858,15 @@ FilterInputPlugin.prototype.setInputValue = function (colIndex, value) {
|
|
851
858
|
|
852
859
|
var colOpt = this._getExtColumnOption(colIndex);
|
853
860
|
|
854
|
-
var
|
861
|
+
var elemType = convertToLowerCase(colOpt.type);
|
855
862
|
var dateValue;
|
856
863
|
|
857
|
-
if (
|
864
|
+
if (elemType === "date") {
|
858
865
|
var dateObj = ElfDate.from(value);
|
859
866
|
dateValue = dateObj ? dateObj.toDateString().substr(4) : "";
|
860
867
|
}
|
861
868
|
|
862
|
-
if (
|
869
|
+
if (elemType === "multiselect") {
|
863
870
|
inputElem.values = value;
|
864
871
|
|
865
872
|
var textMap = FilterInputPlugin._createMapObject(value);
|
@@ -867,7 +874,7 @@ FilterInputPlugin.prototype.setInputValue = function (colIndex, value) {
|
|
867
874
|
this.filterColumn(colIndex, "", textMap);
|
868
875
|
} else {
|
869
876
|
inputElem.value = value;
|
870
|
-
this.filterColumn(colIndex,
|
877
|
+
this.filterColumn(colIndex, elemType === "date" ? dateValue : value);
|
871
878
|
}
|
872
879
|
};
|
873
880
|
/** @public
|
package/lib/versions.json
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
"tr-grid-conditional-coloring": "1.0.70",
|
18
18
|
"tr-grid-content-wrap": "1.0.20",
|
19
19
|
"tr-grid-contextmenu": "1.0.41",
|
20
|
-
"tr-grid-filter-input": "0.9.
|
20
|
+
"tr-grid-filter-input": "0.9.41",
|
21
21
|
"tr-grid-heat-map": "1.0.29",
|
22
22
|
"tr-grid-in-cell-editing": "1.0.87",
|
23
23
|
"tr-grid-pagination": "1.0.24",
|
package/package.json
CHANGED
@@ -56,6 +56,7 @@
|
|
56
56
|
"./extensions": "./lib/index.js",
|
57
57
|
"./window-exporter": "./lib/window-exporter.js",
|
58
58
|
"./grid": "./lib/grid/lib/efx-grid.js",
|
59
|
+
"./formatters": "./lib/formatters/es6/index.js",
|
59
60
|
"./formatters/*": "./lib/formatters/es6/*.js",
|
60
61
|
"./utils": "./lib/utils/index.js",
|
61
62
|
"./types": "./lib/types/index.d.ts"
|
@@ -67,5 +68,5 @@
|
|
67
68
|
"publishConfig": {
|
68
69
|
"access": "public"
|
69
70
|
},
|
70
|
-
"version": "6.0.
|
71
|
+
"version": "6.0.111"
|
71
72
|
}
|