@refinitiv-ui/efx-grid 6.0.93 → 6.0.95
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/formatters/es6/CoralButtonFormatter.d.ts +0 -2
- package/lib/formatters/es6/CoralButtonFormatter.js +9 -4
- package/lib/formatters/es6/CoralCheckboxFormatter.js +10 -5
- package/lib/formatters/es6/CoralComboBoxFormatter.js +13 -12
- package/lib/formatters/es6/CoralIconFormatter.d.ts +0 -2
- package/lib/formatters/es6/CoralIconFormatter.js +9 -4
- package/lib/formatters/es6/CoralInputFormatter.js +9 -4
- package/lib/formatters/es6/CoralRadioButtonFormatter.d.ts +0 -2
- package/lib/formatters/es6/CoralRadioButtonFormatter.js +20 -15
- package/lib/formatters/es6/CoralSelectFormatter.js +12 -7
- package/lib/formatters/es6/CoralToggleFormatter.js +4 -4
- package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.js +20 -20
- package/lib/formatters/es6/EFButtonFormatter.d.ts +0 -2
- package/lib/formatters/es6/EFButtonFormatter.js +9 -4
- package/lib/formatters/es6/EFCheckboxFormatter.js +10 -5
- package/lib/formatters/es6/EFComboBoxFormatter.js +17 -7
- package/lib/formatters/es6/EFDateTimePickerFormatter.js +11 -6
- package/lib/formatters/es6/EFIconFormatter.d.ts +0 -2
- package/lib/formatters/es6/EFIconFormatter.js +9 -4
- package/lib/formatters/es6/EFNumberFieldFormatter.js +9 -4
- package/lib/formatters/es6/EFRadioButtonFormatter.d.ts +0 -2
- package/lib/formatters/es6/EFRadioButtonFormatter.js +25 -15
- package/lib/formatters/es6/EFSelectFormatter.js +17 -7
- package/lib/formatters/es6/EFTextFieldFormatter.js +4 -4
- package/lib/formatters/es6/EFToggleFormatter.js +4 -4
- package/lib/formatters/es6/EmeraldDateTimePickerFormatter.js +6 -6
- package/lib/formatters/es6/FormatterBuilder.js +32 -32
- package/lib/formatters/es6/NumericInputFormatter.js +7 -7
- package/lib/formatters/es6/PercentBarFormatter.js +5 -5
- package/lib/formatters/es6/SimpleImageFormatter.js +3 -3
- package/lib/formatters/es6/SimpleInputFormatter.js +4 -4
- package/lib/formatters/es6/SimpleLinkFormatter.js +4 -4
- package/lib/formatters/es6/SimpleTickerFormatter.js +5 -5
- package/lib/formatters/es6/SimpleToggleFormatter.js +16 -16
- package/lib/formatters/es6/TextFormatter.js +4 -4
- package/lib/grid/index.js +1 -1
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +1 -1
- package/lib/tr-grid-checkbox/es6/Checkbox.js +1 -1
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +1 -1
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +1537 -1425
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +139 -137
- package/lib/tr-grid-row-selection/es6/RowSelection.js +260 -279
- package/lib/tr-grid-util/es6/DragUI.js +1 -1
- package/lib/types/es6/ColumnGrouping.d.ts +1 -2
- package/lib/types/es6/CoralButtonFormatter.d.ts +0 -2
- package/lib/types/es6/CoralIconFormatter.d.ts +0 -2
- package/lib/types/es6/CoralRadioButtonFormatter.d.ts +0 -2
- package/lib/types/es6/EFButtonFormatter.d.ts +0 -2
- package/lib/types/es6/EFIconFormatter.d.ts +0 -2
- package/lib/types/es6/EFRadioButtonFormatter.d.ts +0 -2
- package/lib/versions.json +8 -8
- package/package.json +1 -1
@@ -5,15 +5,20 @@ import FormatterBuilder from "./FormatterBuilder.js";
|
|
5
5
|
* @property {string=} label
|
6
6
|
*/
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
/** @private
|
9
|
+
* @function
|
10
|
+
* @param {Element} element
|
11
|
+
* @param {Object} ctx
|
12
|
+
*/
|
13
|
+
let onElementUpdated = function (element, ctx) {
|
14
|
+
let label = (typeof ctx.label === "string") ? ctx.label : ctx.value;
|
10
15
|
element.textContent = label;
|
11
16
|
};
|
12
17
|
|
13
18
|
/** @constructor
|
14
19
|
* @param {*=} options
|
15
20
|
*/
|
16
|
-
|
21
|
+
let CoralButtonFormatter = function (options) {
|
17
22
|
|
18
23
|
};
|
19
24
|
|
@@ -22,7 +27,7 @@ var CoralButtonFormatter = function (options) {
|
|
22
27
|
* @return {Object}
|
23
28
|
*/
|
24
29
|
CoralButtonFormatter.create = function (options) {
|
25
|
-
|
30
|
+
let defaultOpt = {
|
26
31
|
tagName: "ef-button",
|
27
32
|
refName: "CoralButtonFormatter",
|
28
33
|
styles: {
|
@@ -1,9 +1,14 @@
|
|
1
1
|
import FormatterBuilder from "./FormatterBuilder.js";
|
2
2
|
|
3
|
-
|
3
|
+
/** @private
|
4
|
+
* @function
|
5
|
+
* @param {Element} element
|
6
|
+
* @param {Object} ctx
|
7
|
+
*/
|
8
|
+
let onElementUpdated = function (element, ctx) {
|
4
9
|
element.checked = ctx.value;
|
5
10
|
if (ctx.labelField) {
|
6
|
-
|
11
|
+
let text = ctx.getData(ctx.labelField);
|
7
12
|
element.textContent = (text != null) ? text : '';
|
8
13
|
}
|
9
14
|
};
|
@@ -13,7 +18,7 @@ var onElementUpdated = function (element, ctx) {
|
|
13
18
|
* @param {*} e
|
14
19
|
* @param {*} ctx
|
15
20
|
*/
|
16
|
-
|
21
|
+
let _changeHandler = function (e, ctx) {
|
17
22
|
ctx.value = e.detail.value;
|
18
23
|
ctx.setData(ctx.field, ctx.value);
|
19
24
|
};
|
@@ -21,7 +26,7 @@ var _changeHandler = function (e, ctx) {
|
|
21
26
|
/** @constructor
|
22
27
|
* @param {*=} options
|
23
28
|
*/
|
24
|
-
|
29
|
+
let CoralCheckboxFormatter = function (options) {
|
25
30
|
|
26
31
|
};
|
27
32
|
|
@@ -30,7 +35,7 @@ var CoralCheckboxFormatter = function (options) {
|
|
30
35
|
* @return {Object}
|
31
36
|
*/
|
32
37
|
CoralCheckboxFormatter.create = function (options) {
|
33
|
-
|
38
|
+
let defaultOpt = {
|
34
39
|
tagName: "ef-checkbox",
|
35
40
|
refName: "CoralCheckboxFormatter",
|
36
41
|
onElementUpdated: onElementUpdated,
|
@@ -12,13 +12,14 @@ import ElfUtil from "../../tr-grid-util/es6/ElfUtil.js";
|
|
12
12
|
* @param {Object} ctx Context object
|
13
13
|
* @param {Object} options User options
|
14
14
|
*/
|
15
|
-
|
16
|
-
|
15
|
+
let onContextCreated = function (ctx, options) {
|
16
|
+
let userItems = options.data || options.entries || options.items;
|
17
17
|
if(Array.isArray(userItems)) {
|
18
|
-
|
19
|
-
|
18
|
+
let i;
|
19
|
+
let len = userItems.length;
|
20
|
+
let userItem;
|
20
21
|
for(i = 0; i < len; ++i) {
|
21
|
-
|
22
|
+
userItem = userItems[i];
|
22
23
|
if(userItem != null) {
|
23
24
|
if (typeof userItem !== "object") {
|
24
25
|
userItem = { value: userItem };
|
@@ -26,7 +27,7 @@ var onContextCreated = function (ctx, options) {
|
|
26
27
|
} else {
|
27
28
|
userItem = {value: ""};
|
28
29
|
}
|
29
|
-
|
30
|
+
let label = userItem.label;
|
30
31
|
if(!label && typeof label !== "string") { // 0, false, null, undefined, NaN
|
31
32
|
userItem.label = userItem.value + "";
|
32
33
|
}
|
@@ -34,7 +35,7 @@ var onContextCreated = function (ctx, options) {
|
|
34
35
|
}
|
35
36
|
ctx.data = userItems;
|
36
37
|
|
37
|
-
|
38
|
+
let mappedData = ctx._mappedData = {}; // WORKAROUND: Since combobox does not accept raw value for selection, it actually needs item element
|
38
39
|
for (i = 0; i < len; ++i) {
|
39
40
|
userItem = userItems[i];
|
40
41
|
mappedData[userItem.value] = userItem;
|
@@ -42,11 +43,11 @@ var onContextCreated = function (ctx, options) {
|
|
42
43
|
}
|
43
44
|
};
|
44
45
|
|
45
|
-
|
46
|
+
let onElementCreated = function (element, ctx) {
|
46
47
|
element.data = ctx.data;
|
47
48
|
};
|
48
49
|
|
49
|
-
|
50
|
+
let onElementUpdated = function (element, ctx) {
|
50
51
|
if (ctx._mappedData) {
|
51
52
|
if(ElfUtil.getElfVersion() > 3) {
|
52
53
|
element.value = ctx.value;
|
@@ -56,7 +57,7 @@ var onElementUpdated = function (element, ctx) {
|
|
56
57
|
}
|
57
58
|
};
|
58
59
|
|
59
|
-
|
60
|
+
let _changeHandler = function (e, ctx) {
|
60
61
|
if (e.detail.value == null) {
|
61
62
|
return;
|
62
63
|
}
|
@@ -71,7 +72,7 @@ var _changeHandler = function (e, ctx) {
|
|
71
72
|
/** @constructor
|
72
73
|
* @param {*=} options
|
73
74
|
*/
|
74
|
-
|
75
|
+
let CoralComboBoxFormatter = function (options) {
|
75
76
|
|
76
77
|
};
|
77
78
|
|
@@ -80,7 +81,7 @@ var CoralComboBoxFormatter = function (options) {
|
|
80
81
|
* @return {Object}
|
81
82
|
*/
|
82
83
|
CoralComboBoxFormatter.create = function (options) {
|
83
|
-
|
84
|
+
let defaultOpt = {
|
84
85
|
tagName: "ef-combo-box",
|
85
86
|
refName: "CoralComboBoxFormatter",
|
86
87
|
styles: {
|
@@ -6,8 +6,13 @@ import FormatterBuilder from "./FormatterBuilder.js";
|
|
6
6
|
* @property {(number|string)=} size
|
7
7
|
*/
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
/** @private
|
10
|
+
* @function
|
11
|
+
* @param {Element} element
|
12
|
+
* @param {Object} ctx
|
13
|
+
*/
|
14
|
+
let onElementUpdated = function (element, ctx) {
|
15
|
+
let icon = ctx.value;
|
11
16
|
if (ctx.icon != null && typeof ctx.icon === "object") {
|
12
17
|
icon = ctx.icon[ctx.value];
|
13
18
|
}
|
@@ -21,7 +26,7 @@ var onElementUpdated = function (element, ctx) {
|
|
21
26
|
/** @constructor
|
22
27
|
* @param {*=} options
|
23
28
|
*/
|
24
|
-
|
29
|
+
let CoralIconFormatter = function (options) {
|
25
30
|
|
26
31
|
};
|
27
32
|
|
@@ -30,7 +35,7 @@ var CoralIconFormatter = function (options) {
|
|
30
35
|
* @return {Object}
|
31
36
|
*/
|
32
37
|
CoralIconFormatter.create = function (options) {
|
33
|
-
|
38
|
+
let defaultOpt = {
|
34
39
|
tagName: "ef-icon",
|
35
40
|
refName: "CoralIconFormatter",
|
36
41
|
onElementUpdated: onElementUpdated,
|
@@ -1,10 +1,15 @@
|
|
1
1
|
import FormatterBuilder from "./FormatterBuilder.js";
|
2
2
|
|
3
|
-
|
3
|
+
/** @private
|
4
|
+
* @function
|
5
|
+
* @param {Element} element
|
6
|
+
* @param {Object} ctx
|
7
|
+
*/
|
8
|
+
let onElementUpdated = function (element, ctx) {
|
4
9
|
element.value = ctx.value;
|
5
10
|
};
|
6
11
|
|
7
|
-
|
12
|
+
let _changeHandler = function (e, ctx) {
|
8
13
|
ctx.value = e.detail.value;
|
9
14
|
ctx.setData(ctx.field, ctx.value);
|
10
15
|
};
|
@@ -12,7 +17,7 @@ var _changeHandler = function (e, ctx) {
|
|
12
17
|
/** @constructor
|
13
18
|
* @param {*=} options
|
14
19
|
*/
|
15
|
-
|
20
|
+
let CoralInputFormatter = function (options) {
|
16
21
|
|
17
22
|
};
|
18
23
|
|
@@ -21,7 +26,7 @@ var CoralInputFormatter = function (options) {
|
|
21
26
|
* @return {Object}
|
22
27
|
*/
|
23
28
|
CoralInputFormatter.create = function (options) {
|
24
|
-
|
29
|
+
let defaultOpt = {
|
25
30
|
tagName: "ef-input",
|
26
31
|
refName: "CoralInputFormatter",
|
27
32
|
onElementUpdated: onElementUpdated,
|
@@ -5,11 +5,16 @@ import FormatterBuilder from "./FormatterBuilder.js";
|
|
5
5
|
* @property {number=} initialIndex
|
6
6
|
*/
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
/** @private
|
9
|
+
* @function
|
10
|
+
* @param {Element} element
|
11
|
+
* @param {Object} ctx
|
12
|
+
*/
|
13
|
+
let onElementCreated = function (element, ctx) {
|
14
|
+
let dv = ctx.grid.getDataSource();
|
15
|
+
let rid = dv.getRowId(ctx.rowIndex);
|
16
|
+
let index = dv.getRowIndex(rid);
|
17
|
+
let checked = index === ctx.initialIndex;
|
13
18
|
if (checked) {
|
14
19
|
ctx.previousId = rid;
|
15
20
|
ctx.setData(ctx.field, checked);
|
@@ -17,10 +22,10 @@ var onElementCreated = function (element, ctx) {
|
|
17
22
|
ctx.value = checked;
|
18
23
|
};
|
19
24
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
25
|
+
let onElementUpdated = function (element, ctx) {
|
26
|
+
let dv = ctx.grid.getDataSource();
|
27
|
+
let rid = dv.getRowId(ctx.rowIndex);
|
28
|
+
let checked = (rid === ctx.previousId) && ctx.value;
|
24
29
|
element.checked = checked;
|
25
30
|
};
|
26
31
|
|
@@ -29,14 +34,14 @@ var onElementUpdated = function (element, ctx) {
|
|
29
34
|
* @param {*} e
|
30
35
|
* @param {*} ctx
|
31
36
|
*/
|
32
|
-
|
37
|
+
let _changeHandler = function (e, ctx) {
|
33
38
|
ctx.value = e.detail.value;
|
34
39
|
ctx.setData(ctx.field, ctx.value);
|
35
40
|
|
36
|
-
|
37
|
-
|
41
|
+
let dv = ctx.grid.getDataSource();
|
42
|
+
let rid = dv.getRowId(ctx.rowIndex);
|
38
43
|
if (ctx.previousId && ctx.previousId !== rid) {
|
39
|
-
|
44
|
+
let row = dv.getRowData(ctx.previousId);
|
40
45
|
if (row) {
|
41
46
|
if (row["ROW_DEF"]) {
|
42
47
|
row["ROW_DEF"].setData(ctx.field, false);
|
@@ -51,7 +56,7 @@ var _changeHandler = function (e, ctx) {
|
|
51
56
|
/** @constructor
|
52
57
|
* @param {*=} options
|
53
58
|
*/
|
54
|
-
|
59
|
+
let CoralRadioButtonFormatter = function (options) {
|
55
60
|
|
56
61
|
};
|
57
62
|
|
@@ -60,7 +65,7 @@ var CoralRadioButtonFormatter = function (options) {
|
|
60
65
|
* @return {Object}
|
61
66
|
*/
|
62
67
|
CoralRadioButtonFormatter.create = function (options) {
|
63
|
-
|
68
|
+
let defaultOpt = {
|
64
69
|
tagName: "ef-radio-button",
|
65
70
|
refName: "CoralRadioButtonFormatter",
|
66
71
|
styles: {
|
@@ -12,22 +12,27 @@ import CoralItems from "../../tr-grid-util/es6/CoralItems.js";
|
|
12
12
|
* @param {Object} ctx Context object
|
13
13
|
* @param {Object} options User options
|
14
14
|
*/
|
15
|
-
|
16
|
-
|
15
|
+
let onContextCreated = function (ctx, options) {
|
16
|
+
let userItems = options.data || options.entries || options.items;
|
17
17
|
ctx.data = CoralItems.create(userItems);
|
18
18
|
};
|
19
19
|
|
20
|
-
|
20
|
+
/** @private
|
21
|
+
* @function
|
22
|
+
* @param {Element} element
|
23
|
+
* @param {Object} ctx
|
24
|
+
*/
|
25
|
+
let onElementCreated = function (element, ctx) {
|
21
26
|
if (ctx.data) {
|
22
27
|
element.data = ctx.data;
|
23
28
|
}
|
24
29
|
};
|
25
30
|
|
26
|
-
|
31
|
+
let onElementUpdated = function (element, ctx) {
|
27
32
|
element.value = ctx.value;
|
28
33
|
};
|
29
34
|
|
30
|
-
|
35
|
+
let _changeHandler = function (e, ctx) {
|
31
36
|
ctx.value = e.detail.value;
|
32
37
|
ctx.setData(ctx.field, ctx.value);
|
33
38
|
};
|
@@ -35,7 +40,7 @@ var _changeHandler = function (e, ctx) {
|
|
35
40
|
/** @constructor
|
36
41
|
* @param {*=} options
|
37
42
|
*/
|
38
|
-
|
43
|
+
let CoralSelectFormatter = function (options) {
|
39
44
|
|
40
45
|
};
|
41
46
|
|
@@ -44,7 +49,7 @@ var CoralSelectFormatter = function (options) {
|
|
44
49
|
* @return {Object}
|
45
50
|
*/
|
46
51
|
CoralSelectFormatter.create = function (options) {
|
47
|
-
|
52
|
+
let defaultOpt = {
|
48
53
|
tagName: "ef-select",
|
49
54
|
refName: "CoralSelectFormatter",
|
50
55
|
styles: {
|
@@ -5,7 +5,7 @@ import FormatterBuilder from "./FormatterBuilder.js";
|
|
5
5
|
* @param {Element} element
|
6
6
|
* @param {Object} ctx
|
7
7
|
*/
|
8
|
-
|
8
|
+
let onElementUpdated = function (element, ctx) {
|
9
9
|
element.checked = ctx.value;
|
10
10
|
};
|
11
11
|
|
@@ -15,7 +15,7 @@ var onElementUpdated = function (element, ctx) {
|
|
15
15
|
* @param {*} e
|
16
16
|
* @param {*} ctx
|
17
17
|
*/
|
18
|
-
|
18
|
+
let _changeHandler = function (e, ctx) {
|
19
19
|
ctx.value = e.detail.value;
|
20
20
|
ctx.setData(ctx.field, ctx.value);
|
21
21
|
};
|
@@ -23,7 +23,7 @@ var _changeHandler = function (e, ctx) {
|
|
23
23
|
/** @constructor
|
24
24
|
* @param {*=} options
|
25
25
|
*/
|
26
|
-
|
26
|
+
let CoralToggleFormatter = function (options) {
|
27
27
|
|
28
28
|
};
|
29
29
|
|
@@ -32,7 +32,7 @@ var CoralToggleFormatter = function (options) {
|
|
32
32
|
* @return {Object}
|
33
33
|
*/
|
34
34
|
CoralToggleFormatter.create = function (options) {
|
35
|
-
|
35
|
+
let defaultOpt = {
|
36
36
|
tagName: "ef-toggle",
|
37
37
|
refName: "CoralToggleFormatter",
|
38
38
|
onElementUpdated: onElementUpdated,
|
@@ -2,15 +2,15 @@ import FormatterBuilder from "./FormatterBuilder.js";
|
|
2
2
|
import ElfDate from "../../tr-grid-util/es6/ElfDate.js";
|
3
3
|
import ElfUtil from "../../tr-grid-util/es6/ElfUtil.js";
|
4
4
|
|
5
|
-
|
5
|
+
let onDuplexContextCreated = function (ctx, options) {
|
6
6
|
ctx.ElfDate = ElfDate;
|
7
7
|
ctx.fromField = options.from;
|
8
8
|
ctx.toField = options.to;
|
9
9
|
};
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
let _onElementUpdated = function (element, ctx) {
|
12
|
+
let from = ctx.ElfDate.from(ctx.getData(ctx.fromField));
|
13
|
+
let to = ctx.ElfDate.from(ctx.getData(ctx.toField));
|
14
14
|
|
15
15
|
if(!ctx.ElfDate.equal(element.from, from)) {
|
16
16
|
element.from = from;
|
@@ -20,27 +20,27 @@ var _onElementUpdated = function (element, ctx) {
|
|
20
20
|
}
|
21
21
|
};
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
let _onElfV4ElementUpdated = function (element, ctx) {
|
24
|
+
let from = ctx.ElfDate.from(ctx.getData(ctx.fromField));
|
25
|
+
let to = ctx.ElfDate.from(ctx.getData(ctx.toField));
|
26
26
|
|
27
27
|
element.values = [ctx.ElfDate.toYMD(from), ctx.ElfDate.toYMD(to)];
|
28
28
|
};
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
let _onFieldFromBound = function (e, ctx) {
|
31
|
+
let from = ctx.ElfDate.from(e.currentTarget.from);
|
32
|
+
let currentData = ctx.getData(ctx.fromField);
|
33
33
|
if (!ctx.ElfDate.equal(currentData, from)) {
|
34
34
|
ctx.setData(ctx.fromField, from);
|
35
35
|
}
|
36
36
|
};
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
let _onFieldToBound = function (e, ctx) {
|
39
|
+
let to = ctx.ElfDate.from(e.currentTarget.to);
|
40
40
|
if (to == null) {
|
41
41
|
return;
|
42
42
|
}
|
43
|
-
|
43
|
+
let currentData = ctx.getData(ctx.toField);
|
44
44
|
if (!ctx.ElfDate.equal(currentData, to)) {
|
45
45
|
ctx.setData(ctx.toField, to);
|
46
46
|
}
|
@@ -50,10 +50,10 @@ var _onFieldToBound = function (e, ctx) {
|
|
50
50
|
* @param {Object} e
|
51
51
|
* @param {Object} ctx
|
52
52
|
*/
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
let _onElfV4ValueChanged = function (e, ctx) {
|
54
|
+
let dates = e.currentTarget.values;
|
55
|
+
let from = null;
|
56
|
+
let to = null;
|
57
57
|
if(typeof dates === "string") {
|
58
58
|
dates = dates.split(",");
|
59
59
|
}
|
@@ -65,7 +65,7 @@ var _onElfV4ValueChanged = function (e, ctx) {
|
|
65
65
|
return;
|
66
66
|
}
|
67
67
|
|
68
|
-
|
68
|
+
let currentData = ctx.getData(ctx.fromField);
|
69
69
|
if (!ctx.ElfDate.equal(currentData, from)) {
|
70
70
|
ctx.setData(ctx.fromField, from);
|
71
71
|
}
|
@@ -79,7 +79,7 @@ var _onElfV4ValueChanged = function (e, ctx) {
|
|
79
79
|
/** @constructor
|
80
80
|
* @param {*=} options
|
81
81
|
*/
|
82
|
-
|
82
|
+
let DuplexEmeraldDateTimePickerFormatter = function (options) {
|
83
83
|
|
84
84
|
};
|
85
85
|
|
@@ -88,7 +88,7 @@ var DuplexEmeraldDateTimePickerFormatter = function (options) {
|
|
88
88
|
* @return {Object}
|
89
89
|
*/
|
90
90
|
DuplexEmeraldDateTimePickerFormatter.create = function (options) {
|
91
|
-
|
91
|
+
let defaultOpt = {
|
92
92
|
tagName: "ef-datetime-picker",
|
93
93
|
refName: "DuplexEmeraldDateTimePickerFormatter",
|
94
94
|
onContextCreated: onDuplexContextCreated,
|
@@ -5,15 +5,20 @@ import FormatterBuilder from "./FormatterBuilder.js";
|
|
5
5
|
* @property {string=} label
|
6
6
|
*/
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
/** @private
|
9
|
+
* @function
|
10
|
+
* @param {Element} element
|
11
|
+
* @param {Object} ctx
|
12
|
+
*/
|
13
|
+
let onElementUpdated = function (element, ctx) {
|
14
|
+
let label = (typeof ctx.label === "string") ? ctx.label : ctx.value;
|
10
15
|
element.textContent = label;
|
11
16
|
};
|
12
17
|
|
13
18
|
/** @constructor
|
14
19
|
* @param {*=} options
|
15
20
|
*/
|
16
|
-
|
21
|
+
let EFButtonFormatter = function (options) {
|
17
22
|
|
18
23
|
};
|
19
24
|
|
@@ -22,7 +27,7 @@ var EFButtonFormatter = function (options) {
|
|
22
27
|
* @return {Object}
|
23
28
|
*/
|
24
29
|
EFButtonFormatter.create = function (options) {
|
25
|
-
|
30
|
+
let defaultOpt = {
|
26
31
|
tagName: "ef-button",
|
27
32
|
refName: "EFButtonFormatter",
|
28
33
|
styles: {
|
@@ -1,9 +1,14 @@
|
|
1
1
|
import FormatterBuilder from "./FormatterBuilder.js";
|
2
2
|
|
3
|
-
|
3
|
+
/** @private
|
4
|
+
* @function
|
5
|
+
* @param {Element} element
|
6
|
+
* @param {Object} ctx
|
7
|
+
*/
|
8
|
+
let onElementUpdated = function (element, ctx) {
|
4
9
|
element.checked = ctx.value;
|
5
10
|
if (ctx.labelField) {
|
6
|
-
|
11
|
+
let text = ctx.getData(ctx.labelField);
|
7
12
|
element.textContent = (text != null) ? text : '';
|
8
13
|
}
|
9
14
|
};
|
@@ -13,7 +18,7 @@ var onElementUpdated = function (element, ctx) {
|
|
13
18
|
* @param {*} e
|
14
19
|
* @param {*} ctx
|
15
20
|
*/
|
16
|
-
|
21
|
+
let _changeHandler = function (e, ctx) {
|
17
22
|
ctx.value = e.detail.value;
|
18
23
|
ctx.setData(ctx.field, ctx.value);
|
19
24
|
};
|
@@ -21,7 +26,7 @@ var _changeHandler = function (e, ctx) {
|
|
21
26
|
/** @constructor
|
22
27
|
* @param {*=} options
|
23
28
|
*/
|
24
|
-
|
29
|
+
let EFCheckboxFormatter = function (options) {
|
25
30
|
|
26
31
|
};
|
27
32
|
|
@@ -30,7 +35,7 @@ var EFCheckboxFormatter = function (options) {
|
|
30
35
|
* @return {Object}
|
31
36
|
*/
|
32
37
|
EFCheckboxFormatter.create = function (options) {
|
33
|
-
|
38
|
+
let defaultOpt = {
|
34
39
|
tagName: "ef-checkbox",
|
35
40
|
refName: "EFCheckboxFormatter",
|
36
41
|
onElementUpdated: onElementUpdated,
|
@@ -12,20 +12,30 @@ import CoralItems from "../../tr-grid-util/es6/CoralItems.js";
|
|
12
12
|
* @param {Object} ctx Context object
|
13
13
|
* @param {Object} options User options
|
14
14
|
*/
|
15
|
-
|
16
|
-
|
15
|
+
let onContextCreated = function (ctx, options) {
|
16
|
+
let userItems = options.data || options.entries || options.items;
|
17
17
|
ctx.data = CoralItems.create(userItems);
|
18
18
|
};
|
19
19
|
|
20
|
-
|
20
|
+
/** @private
|
21
|
+
* @function
|
22
|
+
* @param {Element} element
|
23
|
+
* @param {Object} ctx
|
24
|
+
*/
|
25
|
+
let onElementCreated = function (element, ctx) {
|
21
26
|
element.data = ctx.data;
|
22
27
|
};
|
23
28
|
|
24
|
-
|
29
|
+
/** @private
|
30
|
+
* @function
|
31
|
+
* @param {Element} element
|
32
|
+
* @param {Object} ctx
|
33
|
+
*/
|
34
|
+
let onElementUpdated = function (element, ctx) {
|
25
35
|
element.value = ctx.value;
|
26
36
|
};
|
27
37
|
|
28
|
-
|
38
|
+
let _changeHandler = function (e, ctx) {
|
29
39
|
if (e.detail.value == null) {
|
30
40
|
return;
|
31
41
|
}
|
@@ -37,7 +47,7 @@ var _changeHandler = function (e, ctx) {
|
|
37
47
|
/** @constructor
|
38
48
|
* @param {*=} options
|
39
49
|
*/
|
40
|
-
|
50
|
+
let EFComboBoxFormatter = function (options) {
|
41
51
|
|
42
52
|
};
|
43
53
|
|
@@ -46,7 +56,7 @@ var EFComboBoxFormatter = function (options) {
|
|
46
56
|
* @return {Object}
|
47
57
|
*/
|
48
58
|
EFComboBoxFormatter.create = function (options) {
|
49
|
-
|
59
|
+
let defaultOpt = {
|
50
60
|
tagName: "ef-combo-box",
|
51
61
|
refName: "EFComboBoxFormatter",
|
52
62
|
styles: {
|