@refinitiv-ui/elements 6.15.3 → 6.15.4
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/CHANGELOG.md +7 -0
- package/lib/collapse/index.js +1 -0
- package/lib/collapse/themes/halo/dark/index.js +1 -1
- package/lib/collapse/themes/halo/light/index.js +1 -1
- package/lib/collapse/themes/solar/charcoal/index.js +1 -1
- package/lib/collapse/themes/solar/pearl/index.js +1 -1
- package/lib/datetime-picker/constants.d.ts +21 -0
- package/lib/datetime-picker/constants.js +28 -0
- package/lib/datetime-picker/custom-elements.json +41 -41
- package/lib/datetime-picker/custom-elements.md +27 -27
- package/lib/datetime-picker/index.d.ts +28 -26
- package/lib/datetime-picker/index.js +42 -57
- package/lib/datetime-picker/locales.js +10 -13
- package/lib/version.js +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [6.15.4](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.15.3...@refinitiv-ui/elements@6.15.4) (2024-02-12)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **collapse:** update focus style to align with halo design ([#1095](https://github.com/Refinitiv/refinitiv-ui/issues/1095)) ([447dd18](https://github.com/Refinitiv/refinitiv-ui/commit/447dd18ae69ace17762d6d8a861bc061ef272278))
|
|
11
|
+
- **datetime-picker:** cannot be used with label with aria-label, aria-labelledby and label ([#1088](https://github.com/Refinitiv/refinitiv-ui/issues/1088)) ([294ee72](https://github.com/Refinitiv/refinitiv-ui/commit/294ee72c34abeb3febe69d2453fa94260221134a))
|
|
12
|
+
|
|
6
13
|
## [6.15.3](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.15.2...@refinitiv-ui/elements@6.15.3) (2024-01-22)
|
|
7
14
|
|
|
8
15
|
### Bug Fixes
|
package/lib/collapse/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/panel/themes/halo/dark';
|
|
2
2
|
import '@refinitiv-ui/elements/header/themes/halo/dark';
|
|
3
3
|
import '@refinitiv-ui/elements/icon/themes/halo/dark';
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.1s;opacity:.5;margin-right:.25em;margin-left:8px;flex-shrink:0;pointer-events:none;opacity:1}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{touch-action:manipulation;cursor:pointer;padding:0}:host [part~=header][focused=visible]{background-color:#1429bd}:host [part=header-label]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;outline:0}@keyframes expand{from{height:0}to{height:var(--target-height)}}@keyframes collapse{from{height:var(--target-height)}to{height:0}}:host [part=content]{animation-duration:.1s;animation-timing-function:ease;text-transform:none}:host(:not([expanded])) [part=content]{height:0;animation-name:collapse}:host(:not([expanded])) [part=toggle]{transform:rotate(0)}:host([expanded]) [part=content]{animation-name:expand}:host [part=content] ef-panel{overflow:auto}:host [part=content] ef-panel:not([spacing]){padding:var(--panel-padding)}:host{text-transform:uppercase}:host [part=header]{text-transform:inherit}:host [part=header]:hover,:host [part~=header][focused=visible],:host([expanded]) [part=header]{color:#fff;background-color:#404040}:host [part=header]:hover[level=\'1\'],:host [part~=header][focused=visible][level=\'1\'],:host([expanded]) [part=header][level=\'1\']{background-color:#5a5a5a}:host [part=header]:hover[level=\'2\'],:host [part~=header][focused=visible][level=\'2\'],:host([expanded]) [part=header][level=\'2\']{background-color:#4d4d4d}:host [part=header]:hover[level=\'4\'],:host [part~=header][focused=visible][level=\'4\'],:host([expanded]) [part=header][level=\'4\']{background-color:#343434}' }}));
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.1s;opacity:.5;margin-right:.25em;margin-left:8px;flex-shrink:0;pointer-events:none;opacity:1}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{touch-action:manipulation;cursor:pointer;padding:0}:host [part~=header][focused=visible]{background-color:#1429bd;outline:#334bff solid 1px;outline-offset:-1px}:host [part=header-label]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;outline:0}@keyframes expand{from{height:0}to{height:var(--target-height)}}@keyframes collapse{from{height:var(--target-height)}to{height:0}}:host [part=content]{animation-duration:.1s;animation-timing-function:ease;text-transform:none}:host(:not([expanded])) [part=content]{height:0;animation-name:collapse}:host(:not([expanded])) [part=toggle]{transform:rotate(0)}:host([expanded]) [part=content]{animation-name:expand}:host [part=content] ef-panel{overflow:auto}:host [part=content] ef-panel:not([spacing]){padding:var(--panel-padding)}:host{text-transform:uppercase}:host [part=header]{text-transform:inherit}:host [part=header]:hover,:host [part~=header][focused=visible],:host([expanded]) [part=header]{color:#fff;background-color:#404040}:host [part=header]:hover[level=\'1\'],:host [part~=header][focused=visible][level=\'1\'],:host([expanded]) [part=header][level=\'1\']{background-color:#5a5a5a}:host [part=header]:hover[level=\'2\'],:host [part~=header][focused=visible][level=\'2\'],:host([expanded]) [part=header][level=\'2\']{background-color:#4d4d4d}:host [part=header]:hover[level=\'4\'],:host [part~=header][focused=visible][level=\'4\'],:host([expanded]) [part=header][level=\'4\']{background-color:#343434}' }}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/panel/themes/halo/light';
|
|
2
2
|
import '@refinitiv-ui/elements/header/themes/halo/light';
|
|
3
3
|
import '@refinitiv-ui/elements/icon/themes/halo/light';
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.1s;opacity:.5;margin-right:.25em;margin-left:8px;flex-shrink:0;pointer-events:none;opacity:1}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{touch-action:manipulation;cursor:pointer;padding:0}:host [part~=header][focused=visible]{background-color:#1429bd}:host [part=header-label]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;outline:0}@keyframes expand{from{height:0}to{height:var(--target-height)}}@keyframes collapse{from{height:var(--target-height)}to{height:0}}:host [part=content]{animation-duration:.1s;animation-timing-function:ease;text-transform:none}:host(:not([expanded])) [part=content]{height:0;animation-name:collapse}:host(:not([expanded])) [part=toggle]{transform:rotate(0)}:host([expanded]) [part=content]{animation-name:expand}:host [part=content] ef-panel{overflow:auto}:host [part=content] ef-panel:not([spacing]){padding:var(--panel-padding)}:host{text-transform:uppercase}:host [part=header]{text-transform:inherit}:host [part=header]:hover,:host [part~=header][focused=visible],:host([expanded]) [part=header]{color:#0d0d0d;background-color:#eaeaea}:host [part=header]:hover[level=\'1\'],:host [part~=header][focused=visible][level=\'1\'],:host([expanded]) [part=header][level=\'1\']{background-color:#d1d1d1}:host [part=header]:hover[level=\'2\'],:host [part~=header][focused=visible][level=\'2\'],:host([expanded]) [part=header][level=\'2\']{background-color:#dedede}:host [part=header]:hover[level=\'4\'],:host [part~=header][focused=visible][level=\'4\'],:host([expanded]) [part=header][level=\'4\']{background-color:#f2f2f2}' }}));
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.1s;opacity:.5;margin-right:.25em;margin-left:8px;flex-shrink:0;pointer-events:none;opacity:1}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{touch-action:manipulation;cursor:pointer;padding:0}:host [part~=header][focused=visible]{background-color:#1429bd;outline:#334bff solid 1px;outline-offset:-1px}:host [part=header-label]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;outline:0}@keyframes expand{from{height:0}to{height:var(--target-height)}}@keyframes collapse{from{height:var(--target-height)}to{height:0}}:host [part=content]{animation-duration:.1s;animation-timing-function:ease;text-transform:none}:host(:not([expanded])) [part=content]{height:0;animation-name:collapse}:host(:not([expanded])) [part=toggle]{transform:rotate(0)}:host([expanded]) [part=content]{animation-name:expand}:host [part=content] ef-panel{overflow:auto}:host [part=content] ef-panel:not([spacing]){padding:var(--panel-padding)}:host{text-transform:uppercase}:host [part=header]{text-transform:inherit}:host [part=header]:hover,:host [part~=header][focused=visible],:host([expanded]) [part=header]{color:#0d0d0d;background-color:#eaeaea}:host [part=header]:hover[level=\'1\'],:host [part~=header][focused=visible][level=\'1\'],:host([expanded]) [part=header][level=\'1\']{background-color:#d1d1d1}:host [part=header]:hover[level=\'2\'],:host [part~=header][focused=visible][level=\'2\'],:host([expanded]) [part=header][level=\'2\']{background-color:#dedede}:host [part=header]:hover[level=\'4\'],:host [part~=header][focused=visible][level=\'4\'],:host([expanded]) [part=header][level=\'4\']{background-color:#f2f2f2}' }}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/panel/themes/solar/charcoal';
|
|
2
2
|
import '@refinitiv-ui/elements/header/themes/solar/charcoal';
|
|
3
3
|
import '@refinitiv-ui/elements/icon/themes/solar/charcoal';
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.2s;opacity:.5;margin-right:.25em;margin-left:10px;flex-shrink:0;pointer-events:none}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{touch-action:manipulation;cursor:pointer;padding:0}:host [part~=header][focused=visible]{background-color:#4d4d55}:host [part=header-label]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;outline:0}@keyframes expand{from{height:0}to{height:var(--target-height)}}@keyframes collapse{from{height:var(--target-height)}to{height:0}}:host [part=content]{animation-duration:.2s;animation-timing-function:ease}:host(:not([expanded])) [part=content]{height:0;animation-name:collapse}:host(:not([expanded])) [part=toggle]{transform:rotate(0)}:host([expanded]) [part=content]{animation-name:expand}:host [part=content] ef-panel{overflow:auto}:host [part=content] ef-panel:not([spacing]){padding:var(--panel-padding)}' }}));
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.2s;opacity:.5;margin-right:.25em;margin-left:10px;flex-shrink:0;pointer-events:none}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{touch-action:manipulation;cursor:pointer;padding:0}:host [part~=header][focused=visible]{background-color:#4d4d55;outline:#f93 solid 1px;outline-offset:-1px}:host [part=header-label]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;outline:0}@keyframes expand{from{height:0}to{height:var(--target-height)}}@keyframes collapse{from{height:var(--target-height)}to{height:0}}:host [part=content]{animation-duration:.2s;animation-timing-function:ease}:host(:not([expanded])) [part=content]{height:0;animation-name:collapse}:host(:not([expanded])) [part=toggle]{transform:rotate(0)}:host([expanded]) [part=content]{animation-name:expand}:host [part=content] ef-panel{overflow:auto}:host [part=content] ef-panel:not([spacing]){padding:var(--panel-padding)}' }}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/panel/themes/solar/pearl';
|
|
2
2
|
import '@refinitiv-ui/elements/header/themes/solar/pearl';
|
|
3
3
|
import '@refinitiv-ui/elements/icon/themes/solar/pearl';
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.2s;opacity:.5;margin-right:.25em;margin-left:10px;flex-shrink:0;pointer-events:none}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{touch-action:manipulation;cursor:pointer;padding:0}:host [part~=header][focused=visible]{background-color:#fff}:host [part=header-label]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;outline:0}@keyframes expand{from{height:0}to{height:var(--target-height)}}@keyframes collapse{from{height:var(--target-height)}to{height:0}}:host [part=content]{animation-duration:.2s;animation-timing-function:ease}:host(:not([expanded])) [part=content]{height:0;animation-name:collapse}:host(:not([expanded])) [part=toggle]{transform:rotate(0)}:host([expanded]) [part=content]{animation-name:expand}:host [part=content] ef-panel{overflow:auto}:host [part=content] ef-panel:not([spacing]){padding:var(--panel-padding)}' }}));
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.2s;opacity:.5;margin-right:.25em;margin-left:10px;flex-shrink:0;pointer-events:none}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{touch-action:manipulation;cursor:pointer;padding:0}:host [part~=header][focused=visible]{background-color:#fff;outline:#ffb266 solid 1px;outline-offset:-1px}:host [part=header-label]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;outline:0}@keyframes expand{from{height:0}to{height:var(--target-height)}}@keyframes collapse{from{height:var(--target-height)}to{height:0}}:host [part=content]{animation-duration:.2s;animation-timing-function:ease}:host(:not([expanded])) [part=content]{height:0;animation-name:collapse}:host(:not([expanded])) [part=toggle]{transform:rotate(0)}:host([expanded]) [part=content]{animation-name:expand}:host [part=content] ef-panel{overflow:auto}:host [part=content] ef-panel:not([spacing]){padding:var(--panel-padding)}' }}));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const TRANSLATION_KEYS: {
|
|
2
|
+
FROM: string;
|
|
3
|
+
TO: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const POPUP_POSITION: string[];
|
|
6
|
+
export declare const INPUT_FORMAT: {
|
|
7
|
+
DATE: string;
|
|
8
|
+
DATETIME: string;
|
|
9
|
+
DATETIME_AM_PM: string;
|
|
10
|
+
DATETIME_SECONDS: string;
|
|
11
|
+
DATETIME_SECONDS_AM_PM: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const CALENDAR_ID = "calendar";
|
|
14
|
+
export declare const CALENDAR_FROM_ID = "calendar-from";
|
|
15
|
+
export declare const CALENDAR_TO_ID = "calendar-to";
|
|
16
|
+
export declare const TIMEPICKER_ID = "timepicker";
|
|
17
|
+
export declare const TIMEPICKER_FROM_ID = "timepicker-from";
|
|
18
|
+
export declare const TIMEPICKER_TO_ID = "timepicker-to";
|
|
19
|
+
export declare const INPUT_ID = "input";
|
|
20
|
+
export declare const INPUT_FROM_ID = "input-from";
|
|
21
|
+
export declare const INPUT_TO_ID = "input-to";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const TRANSLATION_KEYS = {
|
|
2
|
+
FROM: 'FROM',
|
|
3
|
+
TO: 'TO'
|
|
4
|
+
};
|
|
5
|
+
export const POPUP_POSITION = [
|
|
6
|
+
'bottom-start',
|
|
7
|
+
'top-start',
|
|
8
|
+
'bottom-end',
|
|
9
|
+
'top-end',
|
|
10
|
+
'bottom-middle',
|
|
11
|
+
'top-middle'
|
|
12
|
+
];
|
|
13
|
+
export const INPUT_FORMAT = {
|
|
14
|
+
DATE: 'dd-MMM-yyyy',
|
|
15
|
+
DATETIME: 'dd-MMM-yyyy HH:mm',
|
|
16
|
+
DATETIME_AM_PM: 'dd-MMM-yyyy hh:mm aaa',
|
|
17
|
+
DATETIME_SECONDS: 'dd-MMM-yyyy HH:mm:ss',
|
|
18
|
+
DATETIME_SECONDS_AM_PM: 'dd-MMM-yyyy hh:mm:ss aaa'
|
|
19
|
+
};
|
|
20
|
+
export const CALENDAR_ID = 'calendar';
|
|
21
|
+
export const CALENDAR_FROM_ID = 'calendar-from';
|
|
22
|
+
export const CALENDAR_TO_ID = 'calendar-to';
|
|
23
|
+
export const TIMEPICKER_ID = 'timepicker';
|
|
24
|
+
export const TIMEPICKER_FROM_ID = 'timepicker-from';
|
|
25
|
+
export const TIMEPICKER_TO_ID = 'timepicker-to';
|
|
26
|
+
export const INPUT_ID = 'input';
|
|
27
|
+
export const INPUT_FROM_ID = 'input-from';
|
|
28
|
+
export const INPUT_TO_ID = 'input-to';
|
|
@@ -64,30 +64,12 @@
|
|
|
64
64
|
"type": "boolean",
|
|
65
65
|
"default": "false"
|
|
66
66
|
},
|
|
67
|
-
{
|
|
68
|
-
"name": "placeholder",
|
|
69
|
-
"description": "Placeholder to display when no value is set",
|
|
70
|
-
"type": "string",
|
|
71
|
-
"default": "\"\""
|
|
72
|
-
},
|
|
73
67
|
{
|
|
74
68
|
"name": "opened",
|
|
75
69
|
"description": "Toggles the opened state of the list",
|
|
76
70
|
"type": "boolean",
|
|
77
71
|
"default": "false"
|
|
78
72
|
},
|
|
79
|
-
{
|
|
80
|
-
"name": "error",
|
|
81
|
-
"description": "Set error state",
|
|
82
|
-
"type": "boolean",
|
|
83
|
-
"default": "false"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"name": "warning",
|
|
87
|
-
"description": "Set warning state",
|
|
88
|
-
"type": "boolean",
|
|
89
|
-
"default": "false"
|
|
90
|
-
},
|
|
91
73
|
{
|
|
92
74
|
"name": "input-trigger-disabled",
|
|
93
75
|
"description": "Only open picker panel when calendar icon is clicked.\nClicking on the input will no longer open the picker.",
|
|
@@ -110,7 +92,7 @@
|
|
|
110
92
|
"name": "format",
|
|
111
93
|
"description": "Set the datetime format\nBased on dane-fns datetime formats",
|
|
112
94
|
"type": "string",
|
|
113
|
-
"default": "\"\""
|
|
95
|
+
"default": "\"dd-MMM-yyyy\""
|
|
114
96
|
},
|
|
115
97
|
{
|
|
116
98
|
"name": "timepicker",
|
|
@@ -140,6 +122,24 @@
|
|
|
140
122
|
"description": "Set disabled state",
|
|
141
123
|
"type": "boolean",
|
|
142
124
|
"default": "false"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "error",
|
|
128
|
+
"description": "Set error state",
|
|
129
|
+
"type": "boolean",
|
|
130
|
+
"default": "false"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "warning",
|
|
134
|
+
"description": "Set warning state",
|
|
135
|
+
"type": "boolean",
|
|
136
|
+
"default": "false"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "placeholder",
|
|
140
|
+
"description": "Set placeholder text default depends on format",
|
|
141
|
+
"type": "string",
|
|
142
|
+
"default": "\"dd-MMM-yyyy\""
|
|
143
143
|
}
|
|
144
144
|
],
|
|
145
145
|
"properties": [
|
|
@@ -217,13 +217,6 @@
|
|
|
217
217
|
"type": "boolean",
|
|
218
218
|
"default": "false"
|
|
219
219
|
},
|
|
220
|
-
{
|
|
221
|
-
"name": "placeholder",
|
|
222
|
-
"attribute": "placeholder",
|
|
223
|
-
"description": "Placeholder to display when no value is set",
|
|
224
|
-
"type": "string",
|
|
225
|
-
"default": "\"\""
|
|
226
|
-
},
|
|
227
220
|
{
|
|
228
221
|
"name": "opened",
|
|
229
222
|
"attribute": "opened",
|
|
@@ -231,20 +224,6 @@
|
|
|
231
224
|
"type": "boolean",
|
|
232
225
|
"default": "false"
|
|
233
226
|
},
|
|
234
|
-
{
|
|
235
|
-
"name": "error",
|
|
236
|
-
"attribute": "error",
|
|
237
|
-
"description": "Set error state",
|
|
238
|
-
"type": "boolean",
|
|
239
|
-
"default": "false"
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"name": "warning",
|
|
243
|
-
"attribute": "warning",
|
|
244
|
-
"description": "Set warning state",
|
|
245
|
-
"type": "boolean",
|
|
246
|
-
"default": "false"
|
|
247
|
-
},
|
|
248
227
|
{
|
|
249
228
|
"name": "inputTriggerDisabled",
|
|
250
229
|
"attribute": "input-trigger-disabled",
|
|
@@ -271,7 +250,7 @@
|
|
|
271
250
|
"attribute": "format",
|
|
272
251
|
"description": "Set the datetime format\nBased on dane-fns datetime formats",
|
|
273
252
|
"type": "string",
|
|
274
|
-
"default": "\"\""
|
|
253
|
+
"default": "\"dd-MMM-yyyy\""
|
|
275
254
|
},
|
|
276
255
|
{
|
|
277
256
|
"name": "timepicker",
|
|
@@ -312,6 +291,27 @@
|
|
|
312
291
|
"description": "Set disabled state",
|
|
313
292
|
"type": "boolean",
|
|
314
293
|
"default": "false"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"name": "error",
|
|
297
|
+
"attribute": "error",
|
|
298
|
+
"description": "Set error state",
|
|
299
|
+
"type": "boolean",
|
|
300
|
+
"default": "false"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"name": "warning",
|
|
304
|
+
"attribute": "warning",
|
|
305
|
+
"description": "Set warning state",
|
|
306
|
+
"type": "boolean",
|
|
307
|
+
"default": "false"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"name": "placeholder",
|
|
311
|
+
"attribute": "placeholder",
|
|
312
|
+
"description": "Set placeholder text default depends on format",
|
|
313
|
+
"type": "string",
|
|
314
|
+
"default": "\"dd-MMM-yyyy\""
|
|
315
315
|
}
|
|
316
316
|
],
|
|
317
317
|
"events": [
|
|
@@ -4,33 +4,33 @@ Control to pick date and time
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
| Property | Attribute | Type | Default
|
|
8
|
-
|
|
9
|
-
| `amPm` | `am-pm` | `boolean` | false
|
|
10
|
-
| `disabled` | `disabled` | `boolean` | false
|
|
11
|
-
| `duplex` | `duplex` | `"" \| "consecutive" \| "split"` | null
|
|
12
|
-
| `error` | `error` | `boolean` | false
|
|
13
|
-
| `filter` | | `DatetimePickerFilter \| null` | null
|
|
14
|
-
| `firstDayOfWeek` | `first-day-of-week` | `number \| undefined` |
|
|
15
|
-
| `format` | `format` | `string` | ""
|
|
16
|
-
| `inputDisabled` | `input-disabled` | `boolean` | false
|
|
17
|
-
| `inputTriggerDisabled` | `input-trigger-disabled` | `boolean` | false
|
|
18
|
-
| `max` | `max` | `string` | ""
|
|
19
|
-
| `min` | `min` | `string` | ""
|
|
20
|
-
| `opened` | `opened` | `boolean` | false
|
|
21
|
-
| `placeholder` | `placeholder` | `string` | ""
|
|
22
|
-
| `popupDisabled` | `popup-disabled` | `boolean` | false
|
|
23
|
-
| `range` | `range` | `boolean` | false
|
|
24
|
-
| `readonly` | `readonly` | `boolean` | false
|
|
25
|
-
| `showSeconds` | `show-seconds` | `boolean` | false
|
|
26
|
-
| `timepicker` | `timepicker` | `boolean` | false
|
|
27
|
-
| `value` | `value` | `string` | ""
|
|
28
|
-
| `values` | `values` | `string[]` | []
|
|
29
|
-
| `view` | `view` | `string` | ""
|
|
30
|
-
| `views` | | `string[]` | []
|
|
31
|
-
| `warning` | `warning` | `boolean` | false
|
|
32
|
-
| `weekdaysOnly` | `weekdays-only` | `boolean` | false
|
|
33
|
-
| `weekendsOnly` | `weekends-only` | `boolean` | false
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|------------------------|--------------------------|----------------------------------|---------------|--------------------------------------------------|
|
|
9
|
+
| `amPm` | `am-pm` | `boolean` | false | Toggles 12hr time display |
|
|
10
|
+
| `disabled` | `disabled` | `boolean` | false | Set disabled state |
|
|
11
|
+
| `duplex` | `duplex` | `"" \| "consecutive" \| "split"` | null | Display two calendar pickers. |
|
|
12
|
+
| `error` | `error` | `boolean` | false | Set error state |
|
|
13
|
+
| `filter` | | `DatetimePickerFilter \| null` | null | Custom filter, used for enabling/disabling certain dates |
|
|
14
|
+
| `firstDayOfWeek` | `first-day-of-week` | `number \| undefined` | | Set the first day of the week.<br />0 - for Sunday, 6 - for Saturday |
|
|
15
|
+
| `format` | `format` | `string` | "dd-MMM-yyyy" | Set the datetime format<br />Based on dane-fns datetime formats |
|
|
16
|
+
| `inputDisabled` | `input-disabled` | `boolean` | false | Disable input part of the picker |
|
|
17
|
+
| `inputTriggerDisabled` | `input-trigger-disabled` | `boolean` | false | Only open picker panel when calendar icon is clicked.<br />Clicking on the input will no longer open the picker. |
|
|
18
|
+
| `max` | `max` | `string` | "" | Set maximum date |
|
|
19
|
+
| `min` | `min` | `string` | "" | Set minimum date |
|
|
20
|
+
| `opened` | `opened` | `boolean` | false | Toggles the opened state of the list |
|
|
21
|
+
| `placeholder` | `placeholder` | `string` | "dd-MMM-yyyy" | Set placeholder text default depends on format |
|
|
22
|
+
| `popupDisabled` | `popup-disabled` | `boolean` | false | Disable the popup |
|
|
23
|
+
| `range` | `range` | `boolean` | false | Set to switch to range select mode |
|
|
24
|
+
| `readonly` | `readonly` | `boolean` | false | Set readonly state |
|
|
25
|
+
| `showSeconds` | `show-seconds` | `boolean` | false | Flag to show seconds time segment in display.<br />Seconds are automatically shown when `hh:mm:ss` time format is provided as a value. |
|
|
26
|
+
| `timepicker` | `timepicker` | `boolean` | false | Toggle to display the time picker |
|
|
27
|
+
| `value` | `value` | `string` | "" | Current date time value |
|
|
28
|
+
| `values` | `values` | `string[]` | [] | Set multiple selected values |
|
|
29
|
+
| `view` | `view` | `string` | "" | Set the current calendar view.<br />Accepted format: 'yyyy-MM' |
|
|
30
|
+
| `views` | | `string[]` | [] | Set the current calendar views for duplex mode<br />Accepted format: 'yyyy-MM' |
|
|
31
|
+
| `warning` | `warning` | `boolean` | false | Set warning state |
|
|
32
|
+
| `weekdaysOnly` | `weekdays-only` | `boolean` | false | Only enable weekdays |
|
|
33
|
+
| `weekendsOnly` | `weekends-only` | `boolean` | false | Only enable weekends |
|
|
34
34
|
|
|
35
35
|
## Methods
|
|
36
36
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { CSSResultGroup,
|
|
3
|
-
import
|
|
2
|
+
import { CSSResultGroup, FormFieldElement, MultiValue, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
3
|
+
import '@refinitiv-ui/phrasebook/locale/en/datetime-picker.js';
|
|
4
|
+
import { TranslatePromise } from '@refinitiv-ui/translate';
|
|
4
5
|
import '../calendar/index.js';
|
|
5
6
|
import '../icon/index.js';
|
|
6
7
|
import '../overlay/index.js';
|
|
7
8
|
import '../text-field/index.js';
|
|
8
9
|
import '../time-picker/index.js';
|
|
9
10
|
import type { DatetimePickerDuplex, DatetimePickerFilter } from './types';
|
|
10
|
-
export type {
|
|
11
|
+
export type { DatetimePickerDuplex, DatetimePickerFilter };
|
|
11
12
|
/**
|
|
12
13
|
* Control to pick date and time
|
|
13
14
|
*
|
|
@@ -22,6 +23,15 @@ export type { DatetimePickerFilter, DatetimePickerDuplex };
|
|
|
22
23
|
* @attr {boolean} disabled - Set disabled state
|
|
23
24
|
* @prop {boolean} [disabled=false] - Set disabled state
|
|
24
25
|
*
|
|
26
|
+
* @attr {boolean} error - Set error state
|
|
27
|
+
* @prop {boolean} [error=false] - Set error state
|
|
28
|
+
*
|
|
29
|
+
* @attr {boolean} warning - Set warning state
|
|
30
|
+
* @prop {boolean} [warning=false] - Set warning state
|
|
31
|
+
*
|
|
32
|
+
* @attr {string} placeholder - Set placeholder text default depends on format
|
|
33
|
+
* @prop {string} [placeholder="dd-MMM-yyyy"] - Set placeholder text default depends on format
|
|
34
|
+
*
|
|
25
35
|
* @slot header - Slot to add custom contents at the top of popup
|
|
26
36
|
* @slot right - Slot to add custom contents at the right of popup
|
|
27
37
|
* @slot footer - Slot to add custom contents at the bottom of popup
|
|
@@ -30,7 +40,7 @@ export type { DatetimePickerFilter, DatetimePickerDuplex };
|
|
|
30
40
|
* @slot from-yyyy-MM-dd - Slot to add custom contents on any date cells of left calendar in `duplex` mode e.g. `from-2023-01-01`. Use `from-yyyy` or `from-yyyy-MM` if the cell is year or month
|
|
31
41
|
* @slot to-yyyy-MM-dd - Slot to add custom contents on any date cells of right calendar in `duplex` mode e.g. `to-2023-01-01`. Use `to-yyyy` or `to-yyyy-MM` if the cell is year or month
|
|
32
42
|
*/
|
|
33
|
-
export declare class DatetimePicker extends
|
|
43
|
+
export declare class DatetimePicker extends FormFieldElement implements MultiValue {
|
|
34
44
|
/**
|
|
35
45
|
* Element version number
|
|
36
46
|
* @returns version number
|
|
@@ -50,6 +60,13 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
50
60
|
private inputSyncing;
|
|
51
61
|
private _min;
|
|
52
62
|
private minDate;
|
|
63
|
+
/** Aria label for 'to' and 'from' value, resolved based on locale. */
|
|
64
|
+
private toAriaLabel;
|
|
65
|
+
private fromAriaLabel;
|
|
66
|
+
/**
|
|
67
|
+
* Datetime picker internal translation strings
|
|
68
|
+
*/
|
|
69
|
+
protected labelTPromise: TranslatePromise;
|
|
53
70
|
/**
|
|
54
71
|
* Set minimum date
|
|
55
72
|
* @param min date
|
|
@@ -125,26 +142,10 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
125
142
|
* Seconds are automatically shown when `hh:mm:ss` time format is provided as a value.
|
|
126
143
|
*/
|
|
127
144
|
showSeconds: boolean;
|
|
128
|
-
private _placeholder;
|
|
129
|
-
/**
|
|
130
|
-
* Placeholder to display when no value is set
|
|
131
|
-
* @param placeholder Placeholder
|
|
132
|
-
* @default -
|
|
133
|
-
*/
|
|
134
|
-
set placeholder(placeholder: string);
|
|
135
|
-
get placeholder(): string;
|
|
136
145
|
/**
|
|
137
146
|
* Toggles the opened state of the list
|
|
138
147
|
*/
|
|
139
148
|
opened: boolean;
|
|
140
|
-
/**
|
|
141
|
-
* Set error state
|
|
142
|
-
*/
|
|
143
|
-
error: boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Set warning state
|
|
146
|
-
*/
|
|
147
|
-
warning: boolean;
|
|
148
149
|
/**
|
|
149
150
|
* Only open picker panel when calendar icon is clicked.
|
|
150
151
|
* Clicking on the input will no longer open the picker.
|
|
@@ -163,7 +164,7 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
163
164
|
* Set the datetime format
|
|
164
165
|
* Based on dane-fns datetime formats
|
|
165
166
|
* @param format Date format
|
|
166
|
-
* @default -
|
|
167
|
+
* @default dd-MMM-yyyy
|
|
167
168
|
*/
|
|
168
169
|
set format(format: string);
|
|
169
170
|
get format(): string;
|
|
@@ -199,10 +200,6 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
199
200
|
* @returns {void}
|
|
200
201
|
*/
|
|
201
202
|
validateInput(): void;
|
|
202
|
-
/**
|
|
203
|
-
* Used for translations
|
|
204
|
-
*/
|
|
205
|
-
protected t: TranslateDirective;
|
|
206
203
|
private iconEl;
|
|
207
204
|
private popupEl?;
|
|
208
205
|
private timepickerEl?;
|
|
@@ -226,6 +223,11 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
226
223
|
* @returns {void}
|
|
227
224
|
*/
|
|
228
225
|
protected firstUpdated(changedProperties: PropertyValues): void;
|
|
226
|
+
/**
|
|
227
|
+
* Perform asynchronous update
|
|
228
|
+
* @returns promise
|
|
229
|
+
*/
|
|
230
|
+
protected performUpdate(): Promise<void>;
|
|
229
231
|
/**
|
|
230
232
|
* Overwrite validation method for value
|
|
231
233
|
*
|
|
@@ -523,7 +525,7 @@ declare global {
|
|
|
523
525
|
|
|
524
526
|
namespace JSX {
|
|
525
527
|
interface IntrinsicElements {
|
|
526
|
-
'ef-datetime-picker': Partial<DatetimePicker> | JSXInterface.
|
|
528
|
+
'ef-datetime-picker': Partial<DatetimePicker> | JSXInterface.HTMLAttributes<DatetimePicker>;
|
|
527
529
|
}
|
|
528
530
|
}
|
|
529
531
|
}
|
|
@@ -2,10 +2,11 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import inputFormat from 'date-fns/esm/format/index.js';
|
|
3
3
|
import isValid from 'date-fns/esm/isValid/index.js';
|
|
4
4
|
import inputParse from 'date-fns/esm/parse/index.js';
|
|
5
|
-
import {
|
|
5
|
+
import { FormFieldElement, WarningNotice, css, html, nothing } from '@refinitiv-ui/core';
|
|
6
6
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
7
7
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
8
8
|
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
9
|
+
import '@refinitiv-ui/phrasebook/locale/en/datetime-picker.js';
|
|
9
10
|
import { TranslatePropertyKey, getLocale, translate } from '@refinitiv-ui/translate';
|
|
10
11
|
import { DateFormat, DateTimeFormat, addMonths, format, isAfter, isBefore, isValidDate, isValidDateTime, parse, subMonths } from '@refinitiv-ui/utils/date.js';
|
|
11
12
|
import '../calendar/index.js';
|
|
@@ -15,27 +16,10 @@ import '../overlay/index.js';
|
|
|
15
16
|
import '../text-field/index.js';
|
|
16
17
|
import '../time-picker/index.js';
|
|
17
18
|
import { VERSION } from '../version.js';
|
|
19
|
+
import { CALENDAR_FROM_ID, CALENDAR_ID, CALENDAR_TO_ID, INPUT_FORMAT, INPUT_FROM_ID, INPUT_ID, INPUT_TO_ID, POPUP_POSITION, TIMEPICKER_FROM_ID, TIMEPICKER_ID, TIMEPICKER_TO_ID, TRANSLATION_KEYS } from './constants.js';
|
|
18
20
|
import { getDateFNSLocale } from './locales.js';
|
|
19
21
|
import { DateTimeSegment, formatToView, getCurrentTime } from './utils.js';
|
|
20
22
|
preload('calendar', 'down', 'left', 'right'); /* preload calendar icons for faster loading */
|
|
21
|
-
const POPUP_POSITION = ['bottom-start', 'top-start', 'bottom-end', 'top-end', 'bottom-middle', 'top-middle'];
|
|
22
|
-
const INPUT_FORMAT = {
|
|
23
|
-
DATE: 'dd-MMM-yyyy',
|
|
24
|
-
DATETIME: 'dd-MMM-yyyy HH:mm',
|
|
25
|
-
DATETIME_AM_PM: 'dd-MMM-yyyy hh:mm aaa',
|
|
26
|
-
DATETIME_SECONDS: 'dd-MMM-yyyy HH:mm:ss',
|
|
27
|
-
DATETIME_SECONDS_AM_PM: 'dd-MMM-yyyy hh:mm:ss aaa'
|
|
28
|
-
};
|
|
29
|
-
// public API
|
|
30
|
-
const CALENDAR_ID = 'calendar';
|
|
31
|
-
const CALENDAR_FROM_ID = 'calendar-from';
|
|
32
|
-
const CALENDAR_TO_ID = 'calendar-to';
|
|
33
|
-
const TIMEPICKER_ID = 'timepicker';
|
|
34
|
-
const TIMEPICKER_FROM_ID = 'timepicker-from';
|
|
35
|
-
const TIMEPICKER_TO_ID = 'timepicker-to';
|
|
36
|
-
const INPUT_ID = 'input';
|
|
37
|
-
const INPUT_FROM_ID = 'input-from';
|
|
38
|
-
const INPUT_TO_ID = 'input-to';
|
|
39
23
|
/**
|
|
40
24
|
* Control to pick date and time
|
|
41
25
|
*
|
|
@@ -50,6 +34,15 @@ const INPUT_TO_ID = 'input-to';
|
|
|
50
34
|
* @attr {boolean} disabled - Set disabled state
|
|
51
35
|
* @prop {boolean} [disabled=false] - Set disabled state
|
|
52
36
|
*
|
|
37
|
+
* @attr {boolean} error - Set error state
|
|
38
|
+
* @prop {boolean} [error=false] - Set error state
|
|
39
|
+
*
|
|
40
|
+
* @attr {boolean} warning - Set warning state
|
|
41
|
+
* @prop {boolean} [warning=false] - Set warning state
|
|
42
|
+
*
|
|
43
|
+
* @attr {string} placeholder - Set placeholder text default depends on format
|
|
44
|
+
* @prop {string} [placeholder="dd-MMM-yyyy"] - Set placeholder text default depends on format
|
|
45
|
+
*
|
|
53
46
|
* @slot header - Slot to add custom contents at the top of popup
|
|
54
47
|
* @slot right - Slot to add custom contents at the right of popup
|
|
55
48
|
* @slot footer - Slot to add custom contents at the bottom of popup
|
|
@@ -58,7 +51,7 @@ const INPUT_TO_ID = 'input-to';
|
|
|
58
51
|
* @slot from-yyyy-MM-dd - Slot to add custom contents on any date cells of left calendar in `duplex` mode e.g. `from-2023-01-01`. Use `from-yyyy` or `from-yyyy-MM` if the cell is year or month
|
|
59
52
|
* @slot to-yyyy-MM-dd - Slot to add custom contents on any date cells of right calendar in `duplex` mode e.g. `to-2023-01-01`. Use `to-yyyy` or `to-yyyy-MM` if the cell is year or month
|
|
60
53
|
*/
|
|
61
|
-
let DatetimePicker = class DatetimePicker extends
|
|
54
|
+
let DatetimePicker = class DatetimePicker extends FormFieldElement {
|
|
62
55
|
constructor() {
|
|
63
56
|
super(...arguments);
|
|
64
57
|
this.lazyRendered = false; /* speed up rendering by not populating popup window on first load */
|
|
@@ -68,6 +61,9 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
68
61
|
this.inputSyncing = true; /* true when inputs and pickers are in sync. False while user types in input */
|
|
69
62
|
this._min = '';
|
|
70
63
|
this.minDate = '';
|
|
64
|
+
/** Aria label for 'to' and 'from' value, resolved based on locale. */
|
|
65
|
+
this.toAriaLabel = TRANSLATION_KEYS.TO;
|
|
66
|
+
this.fromAriaLabel = TRANSLATION_KEYS.FROM;
|
|
71
67
|
this._max = '';
|
|
72
68
|
this.maxDate = '';
|
|
73
69
|
/**
|
|
@@ -98,19 +94,10 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
98
94
|
* Seconds are automatically shown when `hh:mm:ss` time format is provided as a value.
|
|
99
95
|
*/
|
|
100
96
|
this.showSeconds = false;
|
|
101
|
-
this._placeholder = '';
|
|
102
97
|
/**
|
|
103
98
|
* Toggles the opened state of the list
|
|
104
99
|
*/
|
|
105
100
|
this.opened = false;
|
|
106
|
-
/**
|
|
107
|
-
* Set error state
|
|
108
|
-
*/
|
|
109
|
-
this.error = false;
|
|
110
|
-
/**
|
|
111
|
-
* Set warning state
|
|
112
|
-
*/
|
|
113
|
-
this.warning = false;
|
|
114
101
|
/**
|
|
115
102
|
* Only open picker panel when calendar icon is clicked.
|
|
116
103
|
* Clicking on the input will no longer open the picker.
|
|
@@ -275,26 +262,11 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
275
262
|
get values() {
|
|
276
263
|
return this._segments.map((segment) => segment.value);
|
|
277
264
|
}
|
|
278
|
-
/**
|
|
279
|
-
* Placeholder to display when no value is set
|
|
280
|
-
* @param placeholder Placeholder
|
|
281
|
-
* @default -
|
|
282
|
-
*/
|
|
283
|
-
set placeholder(placeholder) {
|
|
284
|
-
const oldPlaceholder = this._placeholder;
|
|
285
|
-
if (oldPlaceholder !== placeholder) {
|
|
286
|
-
this._placeholder = placeholder;
|
|
287
|
-
this.requestUpdate('placeholder', oldPlaceholder);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
get placeholder() {
|
|
291
|
-
return this._placeholder || this.format;
|
|
292
|
-
}
|
|
293
265
|
/**
|
|
294
266
|
* Set the datetime format
|
|
295
267
|
* Based on dane-fns datetime formats
|
|
296
268
|
* @param format Date format
|
|
297
|
-
* @default -
|
|
269
|
+
* @default dd-MMM-yyyy
|
|
298
270
|
*/
|
|
299
271
|
set format(format) {
|
|
300
272
|
const oldFormat = this._format;
|
|
@@ -390,6 +362,9 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
390
362
|
if (changedProperties.has('_values') || changedProperties.has(TranslatePropertyKey)) {
|
|
391
363
|
this.syncInputValues();
|
|
392
364
|
}
|
|
365
|
+
if (changedProperties.has('placeholder')) {
|
|
366
|
+
this.placeholder = this.placeholder || this.format; /* `format` is the default value of `placeholder` */
|
|
367
|
+
}
|
|
393
368
|
if (this.shouldValidateValue(changedProperties)) {
|
|
394
369
|
this.validateInput();
|
|
395
370
|
}
|
|
@@ -405,6 +380,17 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
405
380
|
this.addEventListener('keydown', this.onKeyDown);
|
|
406
381
|
this.addEventListener('tap', this.onTap);
|
|
407
382
|
}
|
|
383
|
+
/**
|
|
384
|
+
* Perform asynchronous update
|
|
385
|
+
* @returns promise
|
|
386
|
+
*/
|
|
387
|
+
async performUpdate() {
|
|
388
|
+
[this.toAriaLabel, this.fromAriaLabel] = await Promise.all([
|
|
389
|
+
this.labelTPromise(TRANSLATION_KEYS.TO),
|
|
390
|
+
this.labelTPromise(TRANSLATION_KEYS.FROM)
|
|
391
|
+
]);
|
|
392
|
+
void super.performUpdate();
|
|
393
|
+
}
|
|
408
394
|
/**
|
|
409
395
|
* Overwrite validation method for value
|
|
410
396
|
*
|
|
@@ -1062,9 +1048,17 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
1062
1048
|
* @returns template result
|
|
1063
1049
|
*/
|
|
1064
1050
|
getInputTemplate(id, value = '') {
|
|
1051
|
+
let label = this.inputAriaLabel || undefined;
|
|
1052
|
+
if (id === INPUT_FROM_ID) {
|
|
1053
|
+
label = label ? `${label} ${this.fromAriaLabel}` : this.fromAriaLabel;
|
|
1054
|
+
}
|
|
1055
|
+
else if (id === INPUT_TO_ID) {
|
|
1056
|
+
label = label ? `${label} ${this.toAriaLabel}` : this.toAriaLabel;
|
|
1057
|
+
}
|
|
1065
1058
|
return html `
|
|
1066
1059
|
<ef-text-field
|
|
1067
1060
|
id=${id}
|
|
1061
|
+
aria-label=${label || nothing}
|
|
1068
1062
|
part="input"
|
|
1069
1063
|
transparent
|
|
1070
1064
|
?disabled="${this.disabled}"
|
|
@@ -1141,6 +1135,9 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
1141
1135
|
return html ` ${this.inputTemplates} ${this.iconTemplate} ${this.popupTemplate} `;
|
|
1142
1136
|
}
|
|
1143
1137
|
};
|
|
1138
|
+
__decorate([
|
|
1139
|
+
translate({ mode: 'promise', scope: 'ef-datetime-picker' })
|
|
1140
|
+
], DatetimePicker.prototype, "labelTPromise", void 0);
|
|
1144
1141
|
__decorate([
|
|
1145
1142
|
property({ type: String })
|
|
1146
1143
|
], DatetimePicker.prototype, "min", null);
|
|
@@ -1183,18 +1180,9 @@ __decorate([
|
|
|
1183
1180
|
__decorate([
|
|
1184
1181
|
property({ type: Boolean, attribute: 'show-seconds', reflect: true })
|
|
1185
1182
|
], DatetimePicker.prototype, "showSeconds", void 0);
|
|
1186
|
-
__decorate([
|
|
1187
|
-
property({ type: String })
|
|
1188
|
-
], DatetimePicker.prototype, "placeholder", null);
|
|
1189
1183
|
__decorate([
|
|
1190
1184
|
property({ type: Boolean, reflect: true })
|
|
1191
1185
|
], DatetimePicker.prototype, "opened", void 0);
|
|
1192
|
-
__decorate([
|
|
1193
|
-
property({ type: Boolean, reflect: true })
|
|
1194
|
-
], DatetimePicker.prototype, "error", void 0);
|
|
1195
|
-
__decorate([
|
|
1196
|
-
property({ type: Boolean, reflect: true })
|
|
1197
|
-
], DatetimePicker.prototype, "warning", void 0);
|
|
1198
1186
|
__decorate([
|
|
1199
1187
|
property({ type: Boolean, attribute: 'input-trigger-disabled' })
|
|
1200
1188
|
], DatetimePicker.prototype, "inputTriggerDisabled", void 0);
|
|
@@ -1219,9 +1207,6 @@ __decorate([
|
|
|
1219
1207
|
__decorate([
|
|
1220
1208
|
property({ attribute: false })
|
|
1221
1209
|
], DatetimePicker.prototype, "views", null);
|
|
1222
|
-
__decorate([
|
|
1223
|
-
translate({ mode: 'directive', scope: 'ef-datetime-picker' })
|
|
1224
|
-
], DatetimePicker.prototype, "t", void 0);
|
|
1225
1210
|
__decorate([
|
|
1226
1211
|
query('[part=icon]', true)
|
|
1227
1212
|
], DatetimePicker.prototype, "iconEl", void 0);
|
|
@@ -12,25 +12,22 @@ import th from 'date-fns/esm/locale/th/index.js';
|
|
|
12
12
|
import zhCN from 'date-fns/esm/locale/zh-CN/index.js';
|
|
13
13
|
import { DEFAULT_LOCALE, resolveLocale } from '@refinitiv-ui/i18n';
|
|
14
14
|
import { Phrasebook } from '@refinitiv-ui/phrasebook';
|
|
15
|
+
import translations from '@refinitiv-ui/phrasebook/locale/en/datetime-picker.js';
|
|
15
16
|
// This file is a transition between using date-fns and Intl object to format dates
|
|
16
17
|
// As of now, use Phraseboook to just resolve languages and locales
|
|
17
18
|
// and match against the date-fns locales.
|
|
18
19
|
// match locales against date-fns
|
|
19
20
|
// This will be used with resolveLocale function
|
|
20
|
-
|
|
21
|
+
// de, en, ja, zh & zh-hant have been defined in Phrasebook already.
|
|
21
22
|
const scope = 'ef-datetime-picker';
|
|
22
|
-
Phrasebook.define('en', scope,
|
|
23
|
-
Phrasebook.define('
|
|
24
|
-
Phrasebook.define('
|
|
25
|
-
Phrasebook.define('
|
|
26
|
-
Phrasebook.define('
|
|
27
|
-
Phrasebook.define('
|
|
28
|
-
Phrasebook.define('
|
|
29
|
-
Phrasebook.define('
|
|
30
|
-
Phrasebook.define('pl', scope, globals);
|
|
31
|
-
Phrasebook.define('ru', scope, globals);
|
|
32
|
-
Phrasebook.define('th', scope, globals);
|
|
33
|
-
Phrasebook.define('zh', scope, globals);
|
|
23
|
+
Phrasebook.define('en-GB', scope, translations);
|
|
24
|
+
Phrasebook.define('es', scope, translations);
|
|
25
|
+
Phrasebook.define('fr', scope, translations);
|
|
26
|
+
Phrasebook.define('it', scope, translations);
|
|
27
|
+
Phrasebook.define('ko', scope, translations);
|
|
28
|
+
Phrasebook.define('pl', scope, translations);
|
|
29
|
+
Phrasebook.define('ru', scope, translations);
|
|
30
|
+
Phrasebook.define('th', scope, translations);
|
|
34
31
|
const locales = {
|
|
35
32
|
en: enUS,
|
|
36
33
|
'en-GB': enGB,
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '6.15.
|
|
1
|
+
export const VERSION = '6.15.4';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refinitiv-ui/elements",
|
|
3
|
-
"version": "6.15.
|
|
3
|
+
"version": "6.15.4",
|
|
4
4
|
"description": "Element Framework Elements",
|
|
5
5
|
"author": "LSEG",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -339,8 +339,8 @@
|
|
|
339
339
|
},
|
|
340
340
|
"dependencies": {
|
|
341
341
|
"@lit-labs/context": "^0.3.1",
|
|
342
|
-
"@refinitiv-ui/halo-theme": "^6.7.
|
|
343
|
-
"@refinitiv-ui/solar-theme": "^6.4.
|
|
342
|
+
"@refinitiv-ui/halo-theme": "^6.7.4",
|
|
343
|
+
"@refinitiv-ui/solar-theme": "^6.4.7",
|
|
344
344
|
"@types/chart.js": "^2.9.31",
|
|
345
345
|
"chart.js": "~2.9.4",
|
|
346
346
|
"d3-interpolate": "^3.0.1",
|
|
@@ -351,24 +351,24 @@
|
|
|
351
351
|
},
|
|
352
352
|
"devDependencies": {
|
|
353
353
|
"@refinitiv-ui/core": "^6.5.5",
|
|
354
|
-
"@refinitiv-ui/demo-block": "^6.1.
|
|
355
|
-
"@refinitiv-ui/i18n": "^6.0.
|
|
356
|
-
"@refinitiv-ui/phrasebook": "^6.3.
|
|
354
|
+
"@refinitiv-ui/demo-block": "^6.1.21",
|
|
355
|
+
"@refinitiv-ui/i18n": "^6.0.21",
|
|
356
|
+
"@refinitiv-ui/phrasebook": "^6.3.9",
|
|
357
357
|
"@refinitiv-ui/test-helpers": "^6.0.15",
|
|
358
|
-
"@refinitiv-ui/translate": "^6.0.
|
|
358
|
+
"@refinitiv-ui/translate": "^6.0.32",
|
|
359
359
|
"@refinitiv-ui/utils": "^6.3.2",
|
|
360
360
|
"@types/d3-interpolate": "^3.0.1"
|
|
361
361
|
},
|
|
362
362
|
"peerDependencies": {
|
|
363
363
|
"@refinitiv-ui/browser-sparkline": "^1.0.0 || ^2.0.0",
|
|
364
364
|
"@refinitiv-ui/core": "^6.5.5",
|
|
365
|
-
"@refinitiv-ui/i18n": "^6.0.
|
|
366
|
-
"@refinitiv-ui/phrasebook": "^6.3.
|
|
367
|
-
"@refinitiv-ui/translate": "^6.0.
|
|
365
|
+
"@refinitiv-ui/i18n": "^6.0.21",
|
|
366
|
+
"@refinitiv-ui/phrasebook": "^6.3.9",
|
|
367
|
+
"@refinitiv-ui/translate": "^6.0.32",
|
|
368
368
|
"@refinitiv-ui/utils": "^6.3.2"
|
|
369
369
|
},
|
|
370
370
|
"publishConfig": {
|
|
371
371
|
"access": "public"
|
|
372
372
|
},
|
|
373
|
-
"gitHead": "
|
|
373
|
+
"gitHead": "df44042e5b13d8a38f5626e5d0b30750fd1ec861"
|
|
374
374
|
}
|