@refinitiv-ui/elements 5.3.4 → 5.8.0
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 +89 -0
- package/lib/accordion/custom-elements.md +18 -0
- package/lib/accordion/index.d.ts +5 -5
- package/lib/accordion/index.js +8 -11
- package/lib/appstate-bar/custom-elements.md +22 -0
- package/lib/appstate-bar/index.d.ts +5 -5
- package/lib/appstate-bar/index.js +8 -11
- package/lib/autosuggest/custom-elements.json +24 -4
- package/lib/autosuggest/custom-elements.md +54 -0
- package/lib/autosuggest/helpers/types.d.ts +1 -1
- package/lib/autosuggest/helpers/utils.d.ts +2 -2
- package/lib/autosuggest/helpers/utils.js +1 -2
- package/lib/autosuggest/index.d.ts +13 -8
- package/lib/autosuggest/index.js +38 -31
- package/lib/button/custom-elements.json +2 -2
- package/lib/button/custom-elements.md +23 -0
- package/lib/button/index.d.ts +13 -13
- package/lib/button/index.js +41 -31
- package/lib/button-bar/custom-elements.md +9 -0
- package/lib/button-bar/index.d.ts +3 -3
- package/lib/button-bar/index.js +8 -10
- package/lib/calendar/constants.d.ts +22 -0
- package/lib/calendar/constants.js +23 -0
- package/lib/calendar/custom-elements.json +8 -6
- package/lib/calendar/custom-elements.md +35 -0
- package/lib/calendar/index.d.ts +9 -7
- package/lib/calendar/index.js +20 -38
- package/lib/calendar/locales.d.ts +1 -31
- package/lib/calendar/locales.js +0 -104
- package/lib/calendar/types.d.ts +1 -5
- package/lib/calendar/types.js +1 -6
- package/lib/calendar/utils.d.ts +31 -1
- package/lib/calendar/utils.js +104 -2
- package/lib/canvas/custom-elements.json +7 -5
- package/lib/canvas/custom-elements.md +27 -0
- package/lib/canvas/index.d.ts +4 -3
- package/lib/canvas/index.js +8 -10
- package/lib/card/custom-elements.json +3 -1
- package/lib/card/custom-elements.md +24 -0
- package/lib/card/helpers/types.d.ts +1 -1
- package/lib/card/index.d.ts +10 -8
- package/lib/card/index.js +14 -13
- package/lib/chart/custom-elements.json +1 -1
- package/lib/chart/custom-elements.md +16 -0
- package/lib/chart/helpers/index.d.ts +2 -2
- package/lib/chart/helpers/index.js +2 -2
- package/lib/chart/index.d.ts +6 -6
- package/lib/chart/index.js +12 -14
- package/lib/checkbox/custom-elements.json +4 -4
- package/lib/checkbox/custom-elements.md +18 -0
- package/lib/checkbox/index.d.ts +21 -13
- package/lib/checkbox/index.js +56 -31
- package/lib/clock/custom-elements.json +21 -4
- package/lib/clock/custom-elements.md +28 -0
- package/lib/clock/index.d.ts +17 -5
- package/lib/clock/index.js +37 -18
- package/lib/clock/themes/halo/dark/index.js +1 -1
- package/lib/clock/themes/halo/light/index.js +1 -1
- package/lib/clock/themes/solar/charcoal/index.js +1 -1
- package/lib/clock/themes/solar/pearl/index.js +1 -1
- package/lib/clock/utils/TickManager.js +2 -2
- package/lib/collapse/custom-elements.md +27 -0
- package/lib/collapse/index.d.ts +7 -7
- package/lib/collapse/index.js +11 -13
- package/lib/color-dialog/custom-elements.json +29 -16
- package/lib/color-dialog/custom-elements.md +39 -0
- package/lib/color-dialog/elements/color-palettes.d.ts +5 -5
- package/lib/color-dialog/elements/color-palettes.js +9 -13
- package/lib/color-dialog/elements/grayscale-palettes.d.ts +5 -5
- package/lib/color-dialog/elements/grayscale-palettes.js +10 -13
- package/lib/color-dialog/elements/palettes.d.ts +10 -3
- package/lib/color-dialog/elements/palettes.js +58 -45
- package/lib/color-dialog/helpers/color-helpers.d.ts +7 -53
- package/lib/color-dialog/helpers/color-helpers.js +12 -109
- package/lib/color-dialog/helpers/value-model.d.ts +1 -1
- package/lib/color-dialog/helpers/value-model.js +18 -16
- package/lib/color-dialog/index.d.ts +19 -19
- package/lib/color-dialog/index.js +47 -45
- package/lib/combo-box/custom-elements.json +28 -16
- package/lib/combo-box/custom-elements.md +35 -0
- package/lib/combo-box/helpers/filter.d.ts +4 -4
- package/lib/combo-box/helpers/types.d.ts +2 -2
- package/lib/combo-box/index.d.ts +26 -18
- package/lib/combo-box/index.js +36 -27
- package/lib/combo-box/themes/halo/dark/index.js +1 -1
- package/lib/combo-box/themes/halo/light/index.js +1 -1
- package/lib/combo-box/themes/solar/charcoal/index.js +1 -1
- package/lib/combo-box/themes/solar/pearl/index.js +1 -1
- package/lib/counter/custom-elements.json +8 -4
- package/lib/counter/custom-elements.md +11 -0
- package/lib/counter/index.d.ts +5 -3
- package/lib/counter/index.js +11 -12
- package/lib/datetime-picker/custom-elements.json +52 -23
- package/lib/datetime-picker/custom-elements.md +57 -0
- package/lib/datetime-picker/index.d.ts +25 -14
- package/lib/datetime-picker/index.js +46 -35
- package/lib/datetime-picker/locales.d.ts +1 -1
- package/lib/datetime-picker/locales.js +12 -1
- package/lib/datetime-picker/themes/solar/charcoal/index.js +1 -1
- package/lib/datetime-picker/themes/solar/pearl/index.js +1 -1
- package/lib/datetime-picker/types.d.ts +1 -1
- package/lib/datetime-picker/utils.js +1 -1
- package/lib/dialog/custom-elements.json +34 -12
- package/lib/dialog/custom-elements.md +47 -0
- package/lib/dialog/index.d.ts +17 -20
- package/lib/dialog/index.js +28 -31
- package/lib/email-field/custom-elements.json +81 -94
- package/lib/email-field/custom-elements.md +37 -0
- package/lib/email-field/index.d.ts +44 -116
- package/lib/email-field/index.js +48 -249
- package/lib/email-field/themes/solar/charcoal/index.js +1 -1
- package/lib/email-field/themes/solar/pearl/index.js +1 -1
- package/lib/events.d.ts +2 -2
- package/lib/events.js +1 -2
- package/lib/flag/custom-elements.md +10 -0
- package/lib/flag/index.d.ts +6 -4
- package/lib/flag/index.js +12 -12
- package/lib/flag/utils/FlagLoader.d.ts +1 -1
- package/lib/flag/utils/FlagLoader.js +1 -1
- package/lib/header/custom-elements.md +18 -0
- package/lib/header/index.d.ts +2 -2
- package/lib/header/index.js +5 -8
- package/lib/heatmap/custom-elements.md +26 -0
- package/lib/heatmap/helpers/color.d.ts +1 -1
- package/lib/heatmap/helpers/color.js +1 -1
- package/lib/heatmap/helpers/text.d.ts +1 -1
- package/lib/heatmap/index.d.ts +7 -7
- package/lib/heatmap/index.js +15 -16
- package/lib/icon/custom-elements.json +6 -4
- package/lib/icon/custom-elements.md +8 -0
- package/lib/icon/index.d.ts +9 -6
- package/lib/icon/index.js +28 -18
- package/lib/icon/utils/IconLoader.d.ts +6 -1
- package/lib/icon/utils/IconLoader.js +24 -17
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/interactive-chart/custom-elements.json +6 -10
- package/lib/interactive-chart/custom-elements.md +31 -0
- package/lib/interactive-chart/helpers/types.d.ts +2 -2
- package/lib/interactive-chart/index.d.ts +11 -8
- package/lib/interactive-chart/index.js +17 -17
- package/lib/item/custom-elements.json +4 -4
- package/lib/item/custom-elements.md +29 -0
- package/lib/item/helpers/types.d.ts +1 -1
- package/lib/item/index.d.ts +18 -8
- package/lib/item/index.js +36 -16
- package/lib/label/custom-elements.md +11 -0
- package/lib/label/index.d.ts +3 -3
- package/lib/label/index.js +12 -20
- package/lib/layout/custom-elements.md +26 -0
- package/lib/layout/index.d.ts +3 -3
- package/lib/layout/index.js +6 -9
- package/lib/led-gauge/custom-elements.json +4 -4
- package/lib/led-gauge/custom-elements.md +17 -0
- package/lib/led-gauge/index.d.ts +5 -4
- package/lib/led-gauge/index.js +9 -11
- package/lib/list/custom-elements.json +18 -5
- package/lib/list/custom-elements.md +32 -0
- package/lib/list/helpers/list-renderer.d.ts +2 -2
- package/lib/list/helpers/list-renderer.js +4 -2
- package/lib/list/helpers/types.d.ts +2 -2
- package/lib/list/index.d.ts +27 -10
- package/lib/list/index.js +54 -25
- package/lib/list/renderer.d.ts +2 -2
- package/lib/list/renderer.js +1 -1
- package/lib/loader/custom-elements.md +5 -0
- package/lib/loader/index.js +4 -8
- package/lib/multi-input/custom-elements.json +7 -6
- package/lib/multi-input/custom-elements.md +43 -0
- package/lib/multi-input/helpers/types.d.ts +1 -1
- package/lib/multi-input/index.d.ts +11 -7
- package/lib/multi-input/index.js +20 -17
- package/lib/multi-input/themes/solar/charcoal/index.js +1 -1
- package/lib/multi-input/themes/solar/pearl/index.js +1 -1
- package/lib/notification/custom-elements.md +26 -0
- package/lib/notification/elements/notification-tray.d.ts +2 -2
- package/lib/notification/elements/notification-tray.js +6 -9
- package/lib/notification/elements/notification.d.ts +5 -5
- package/lib/notification/elements/notification.js +8 -11
- package/lib/notification/helpers/status.d.ts +1 -1
- package/lib/notification/helpers/status.js +1 -1
- package/lib/notification/helpers/types.d.ts +1 -1
- package/lib/notification/index.d.ts +2 -2
- package/lib/notification/index.js +2 -2
- package/lib/number-field/custom-elements.json +99 -54
- package/lib/number-field/custom-elements.md +42 -0
- package/lib/number-field/index.d.ts +96 -51
- package/lib/number-field/index.js +121 -89
- package/lib/number-field/themes/solar/charcoal/index.js +1 -1
- package/lib/number-field/themes/solar/pearl/index.js +1 -1
- package/lib/overlay/custom-elements.json +26 -13
- package/lib/overlay/custom-elements.md +54 -0
- package/lib/overlay/elements/overlay-backdrop.d.ts +4 -4
- package/lib/overlay/elements/overlay-backdrop.js +6 -9
- package/lib/overlay/elements/overlay-viewport.d.ts +3 -3
- package/lib/overlay/elements/overlay-viewport.js +5 -9
- package/lib/overlay/elements/overlay.d.ts +10 -5
- package/lib/overlay/elements/overlay.js +27 -28
- package/lib/overlay/index.d.ts +2 -2
- package/lib/overlay/index.js +1 -1
- package/lib/overlay/managers/backdrop-manager.d.ts +1 -1
- package/lib/overlay/managers/backdrop-manager.js +2 -2
- package/lib/overlay/managers/close-manager.js +1 -1
- package/lib/overlay/managers/focus-manager.js +2 -2
- package/lib/overlay/managers/interaction-lock-manager.js +2 -2
- package/lib/overlay/managers/viewport-manager.d.ts +2 -2
- package/lib/overlay/managers/viewport-manager.js +6 -2
- package/lib/overlay/managers/zindex-manager.js +1 -1
- package/lib/overlay-menu/custom-elements.json +70 -20
- package/lib/overlay-menu/custom-elements.md +44 -0
- package/lib/overlay-menu/helpers/types.d.ts +3 -3
- package/lib/overlay-menu/index.d.ts +26 -19
- package/lib/overlay-menu/index.js +47 -33
- package/lib/overlay-menu/managers/menu-manager.d.ts +2 -2
- package/lib/overlay-menu/managers/menu-manager.js +3 -3
- package/lib/pagination/custom-elements.md +27 -0
- package/lib/pagination/index.d.ts +8 -8
- package/lib/pagination/index.js +13 -15
- package/lib/panel/custom-elements.md +11 -0
- package/lib/panel/index.d.ts +3 -3
- package/lib/panel/index.js +6 -9
- package/lib/password-field/custom-elements.json +62 -67
- package/lib/password-field/custom-elements.md +39 -0
- package/lib/password-field/index.d.ts +43 -94
- package/lib/password-field/index.js +52 -198
- package/lib/password-field/themes/solar/charcoal/index.js +1 -1
- package/lib/password-field/themes/solar/pearl/index.js +1 -1
- package/lib/pill/custom-elements.json +8 -6
- package/lib/pill/custom-elements.md +22 -0
- package/lib/pill/index.d.ts +5 -5
- package/lib/pill/index.js +9 -11
- package/lib/progress-bar/custom-elements.md +18 -0
- package/lib/progress-bar/index.d.ts +3 -3
- package/lib/progress-bar/index.js +7 -9
- package/lib/radio-button/custom-elements.json +4 -4
- package/lib/radio-button/custom-elements.md +19 -0
- package/lib/radio-button/index.d.ts +25 -8
- package/lib/radio-button/index.js +84 -21
- package/lib/radio-button/radio-button-registry.d.ts +3 -2
- package/lib/radio-button/radio-button-registry.js +57 -4
- package/lib/rating/custom-elements.md +17 -0
- package/lib/rating/index.d.ts +3 -3
- package/lib/rating/index.js +9 -10
- package/lib/search-field/custom-elements.json +70 -74
- package/lib/search-field/custom-elements.md +41 -0
- package/lib/search-field/index.d.ts +44 -101
- package/lib/search-field/index.js +50 -220
- package/lib/search-field/themes/solar/charcoal/index.js +1 -1
- package/lib/search-field/themes/solar/pearl/index.js +1 -1
- package/lib/select/custom-elements.json +5 -4
- package/lib/select/custom-elements.md +24 -0
- package/lib/select/helpers/types.d.ts +1 -1
- package/lib/select/index.d.ts +18 -10
- package/lib/select/index.js +84 -45
- package/lib/sidebar-layout/custom-elements.json +2 -6
- package/lib/sidebar-layout/custom-elements.md +21 -0
- package/lib/sidebar-layout/index.d.ts +7 -6
- package/lib/sidebar-layout/index.js +9 -10
- package/lib/slider/custom-elements.json +4 -4
- package/lib/slider/custom-elements.md +28 -0
- package/lib/slider/index.d.ts +4 -4
- package/lib/slider/index.js +9 -10
- package/lib/sparkline/custom-elements.json +4 -4
- package/lib/sparkline/custom-elements.md +16 -0
- package/lib/sparkline/index.d.ts +6 -4
- package/lib/sparkline/index.js +10 -10
- package/lib/swing-gauge/custom-elements.json +5 -3
- package/lib/swing-gauge/custom-elements.md +17 -0
- package/lib/swing-gauge/helpers.d.ts +1 -1
- package/lib/swing-gauge/helpers.js +1 -1
- package/lib/swing-gauge/index.d.ts +9 -7
- package/lib/swing-gauge/index.js +17 -15
- package/lib/tab/custom-elements.json +2 -2
- package/lib/tab/custom-elements.md +22 -0
- package/lib/tab/index.d.ts +5 -5
- package/lib/tab/index.js +9 -12
- package/lib/tab/themes/solar/charcoal/index.js +1 -1
- package/lib/tab/themes/solar/pearl/index.js +1 -1
- package/lib/tab-bar/custom-elements.md +11 -0
- package/lib/tab-bar/index.d.ts +4 -4
- package/lib/tab-bar/index.js +9 -11
- package/lib/tab-bar/themes/solar/charcoal/index.js +1 -1
- package/lib/tab-bar/themes/solar/pearl/index.js +1 -1
- package/lib/text-field/custom-elements.json +78 -89
- package/lib/text-field/custom-elements.md +35 -0
- package/lib/text-field/index.d.ts +59 -79
- package/lib/text-field/index.js +99 -158
- package/lib/text-field/themes/solar/charcoal/index.js +1 -1
- package/lib/text-field/themes/solar/pearl/index.js +1 -1
- package/lib/time-picker/custom-elements.json +4 -4
- package/lib/time-picker/custom-elements.md +28 -0
- package/lib/time-picker/index.d.ts +7 -4
- package/lib/time-picker/index.js +15 -14
- package/lib/time-picker/themes/solar/charcoal/index.js +1 -1
- package/lib/time-picker/themes/solar/pearl/index.js +1 -1
- package/lib/toggle/custom-elements.json +4 -4
- package/lib/toggle/custom-elements.md +19 -0
- package/lib/toggle/index.d.ts +14 -4
- package/lib/toggle/index.js +31 -12
- package/lib/tooltip/custom-elements.md +14 -0
- package/lib/tooltip/elements/title-tooltip.js +2 -2
- package/lib/tooltip/elements/tooltip-element.d.ts +1 -1
- package/lib/tooltip/helpers/overflow-tooltip.d.ts +1 -1
- package/lib/tooltip/helpers/overflow-tooltip.js +1 -1
- package/lib/tooltip/helpers/renderer.d.ts +1 -1
- package/lib/tooltip/helpers/types.d.ts +1 -1
- package/lib/tooltip/index.d.ts +9 -9
- package/lib/tooltip/index.js +18 -20
- package/lib/tooltip/managers/tooltip-manager.d.ts +2 -2
- package/lib/tooltip/managers/tooltip-manager.js +3 -7
- package/lib/tornado-chart/custom-elements.md +18 -0
- package/lib/tornado-chart/elements/tornado-chart.d.ts +4 -4
- package/lib/tornado-chart/elements/tornado-chart.js +8 -11
- package/lib/tornado-chart/elements/tornado-item.d.ts +5 -5
- package/lib/tornado-chart/elements/tornado-item.js +10 -12
- package/lib/tornado-chart/index.d.ts +2 -2
- package/lib/tornado-chart/index.js +2 -2
- package/lib/tree/custom-elements.json +17 -3
- package/lib/tree/custom-elements.md +32 -0
- package/lib/tree/elements/tree-item.d.ts +4 -4
- package/lib/tree/elements/tree-item.js +10 -13
- package/lib/tree/elements/tree.d.ts +51 -5
- package/lib/tree/elements/tree.js +138 -11
- package/lib/tree/helpers/filter.d.ts +8 -0
- package/lib/tree/helpers/filter.js +33 -0
- package/lib/tree/helpers/renderer.d.ts +2 -2
- package/lib/tree/helpers/renderer.js +3 -3
- package/lib/tree/helpers/types.d.ts +9 -1
- package/lib/tree/index.d.ts +4 -4
- package/lib/tree/index.js +3 -3
- package/lib/tree/managers/tree-manager.d.ts +22 -10
- package/lib/tree/managers/tree-manager.js +56 -40
- package/lib/tree/themes/halo/dark/index.js +1 -1
- package/lib/tree/themes/halo/light/index.js +1 -1
- package/lib/tree/themes/solar/charcoal/index.js +1 -1
- package/lib/tree/themes/solar/pearl/index.js +1 -1
- package/lib/tree-select/custom-elements.json +10 -6
- package/lib/tree-select/custom-elements.md +26 -0
- package/lib/tree-select/helpers/types.d.ts +2 -2
- package/lib/tree-select/index.d.ts +32 -28
- package/lib/tree-select/index.js +54 -44
- package/lib/tree-select/themes/halo/dark/index.js +1 -1
- package/lib/tree-select/themes/halo/light/index.js +1 -1
- package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
- package/lib/tree-select/themes/solar/pearl/index.js +1 -1
- package/lib/version.d.ts +1 -0
- package/lib/version.js +1 -0
- package/package.json +298 -15
- package/lib/autosuggest/helpers/const.d.ts +0 -2
- package/lib/autosuggest/helpers/const.js +0 -3
- package/lib/overlay-menu/helpers/uuid.d.ts +0 -7
- package/lib/overlay-menu/helpers/uuid.js +0 -13
|
@@ -8,12 +8,14 @@
|
|
|
8
8
|
{
|
|
9
9
|
"name": "min",
|
|
10
10
|
"description": "Set minimum date",
|
|
11
|
-
"type": "string"
|
|
11
|
+
"type": "string",
|
|
12
|
+
"default": "\"\""
|
|
12
13
|
},
|
|
13
14
|
{
|
|
14
15
|
"name": "max",
|
|
15
16
|
"description": "Set maximum date",
|
|
16
|
-
"type": "string"
|
|
17
|
+
"type": "string",
|
|
18
|
+
"default": "\"\""
|
|
17
19
|
},
|
|
18
20
|
{
|
|
19
21
|
"name": "weekdays-only",
|
|
@@ -41,12 +43,14 @@
|
|
|
41
43
|
{
|
|
42
44
|
"name": "value",
|
|
43
45
|
"description": "Current date time value",
|
|
44
|
-
"type": "string"
|
|
46
|
+
"type": "string",
|
|
47
|
+
"default": "\"\""
|
|
45
48
|
},
|
|
46
49
|
{
|
|
47
50
|
"name": "values",
|
|
48
51
|
"description": "Set multiple selected values",
|
|
49
|
-
"type": "string[]"
|
|
52
|
+
"type": "string[]",
|
|
53
|
+
"default": "[]"
|
|
50
54
|
},
|
|
51
55
|
{
|
|
52
56
|
"name": "am-pm",
|
|
@@ -63,7 +67,8 @@
|
|
|
63
67
|
{
|
|
64
68
|
"name": "placeholder",
|
|
65
69
|
"description": "Placeholder to display when no value is set",
|
|
66
|
-
"type": "string"
|
|
70
|
+
"type": "string",
|
|
71
|
+
"default": "\"\""
|
|
67
72
|
},
|
|
68
73
|
{
|
|
69
74
|
"name": "opened",
|
|
@@ -104,7 +109,8 @@
|
|
|
104
109
|
{
|
|
105
110
|
"name": "format",
|
|
106
111
|
"description": "Set the datetime format\nBased on dane-fns datetime formats",
|
|
107
|
-
"type": "string"
|
|
112
|
+
"type": "string",
|
|
113
|
+
"default": "\"\""
|
|
108
114
|
},
|
|
109
115
|
{
|
|
110
116
|
"name": "timepicker",
|
|
@@ -120,19 +126,20 @@
|
|
|
120
126
|
{
|
|
121
127
|
"name": "view",
|
|
122
128
|
"description": "Set the current calendar view.\nAccepted format: 'yyyy-MM'",
|
|
123
|
-
"type": "string"
|
|
129
|
+
"type": "string",
|
|
130
|
+
"default": "\"\""
|
|
124
131
|
},
|
|
125
132
|
{
|
|
126
133
|
"name": "readonly",
|
|
127
134
|
"description": "Set readonly state",
|
|
128
135
|
"type": "boolean",
|
|
129
|
-
"default": "
|
|
136
|
+
"default": "false"
|
|
130
137
|
},
|
|
131
138
|
{
|
|
132
139
|
"name": "disabled",
|
|
133
140
|
"description": "Set disabled state",
|
|
134
141
|
"type": "boolean",
|
|
135
|
-
"default": "
|
|
142
|
+
"default": "false"
|
|
136
143
|
}
|
|
137
144
|
],
|
|
138
145
|
"properties": [
|
|
@@ -140,13 +147,15 @@
|
|
|
140
147
|
"name": "min",
|
|
141
148
|
"attribute": "min",
|
|
142
149
|
"description": "Set minimum date",
|
|
143
|
-
"type": "string"
|
|
150
|
+
"type": "string",
|
|
151
|
+
"default": "\"\""
|
|
144
152
|
},
|
|
145
153
|
{
|
|
146
154
|
"name": "max",
|
|
147
155
|
"attribute": "max",
|
|
148
156
|
"description": "Set maximum date",
|
|
149
|
-
"type": "string"
|
|
157
|
+
"type": "string",
|
|
158
|
+
"default": "\"\""
|
|
150
159
|
},
|
|
151
160
|
{
|
|
152
161
|
"name": "weekdaysOnly",
|
|
@@ -180,21 +189,19 @@
|
|
|
180
189
|
"type": "boolean",
|
|
181
190
|
"default": "false"
|
|
182
191
|
},
|
|
183
|
-
{
|
|
184
|
-
"name": "multiple",
|
|
185
|
-
"type": "boolean"
|
|
186
|
-
},
|
|
187
192
|
{
|
|
188
193
|
"name": "value",
|
|
189
194
|
"attribute": "value",
|
|
190
195
|
"description": "Current date time value",
|
|
191
|
-
"type": "string"
|
|
196
|
+
"type": "string",
|
|
197
|
+
"default": "\"\""
|
|
192
198
|
},
|
|
193
199
|
{
|
|
194
200
|
"name": "values",
|
|
195
201
|
"attribute": "values",
|
|
196
202
|
"description": "Set multiple selected values",
|
|
197
|
-
"type": "string[]"
|
|
203
|
+
"type": "string[]",
|
|
204
|
+
"default": "[]"
|
|
198
205
|
},
|
|
199
206
|
{
|
|
200
207
|
"name": "amPm",
|
|
@@ -214,7 +221,8 @@
|
|
|
214
221
|
"name": "placeholder",
|
|
215
222
|
"attribute": "placeholder",
|
|
216
223
|
"description": "Placeholder to display when no value is set",
|
|
217
|
-
"type": "string"
|
|
224
|
+
"type": "string",
|
|
225
|
+
"default": "\"\""
|
|
218
226
|
},
|
|
219
227
|
{
|
|
220
228
|
"name": "opened",
|
|
@@ -262,7 +270,8 @@
|
|
|
262
270
|
"name": "format",
|
|
263
271
|
"attribute": "format",
|
|
264
272
|
"description": "Set the datetime format\nBased on dane-fns datetime formats",
|
|
265
|
-
"type": "string"
|
|
273
|
+
"type": "string",
|
|
274
|
+
"default": "\"\""
|
|
266
275
|
},
|
|
267
276
|
{
|
|
268
277
|
"name": "timepicker",
|
|
@@ -281,26 +290,28 @@
|
|
|
281
290
|
"name": "view",
|
|
282
291
|
"attribute": "view",
|
|
283
292
|
"description": "Set the current calendar view.\nAccepted format: 'yyyy-MM'",
|
|
284
|
-
"type": "string"
|
|
293
|
+
"type": "string",
|
|
294
|
+
"default": "\"\""
|
|
285
295
|
},
|
|
286
296
|
{
|
|
287
297
|
"name": "views",
|
|
288
298
|
"description": "Set the current calendar views for duplex mode\nAccepted format: 'yyyy-MM'",
|
|
289
|
-
"type": "string[]"
|
|
299
|
+
"type": "string[]",
|
|
300
|
+
"default": "[]"
|
|
290
301
|
},
|
|
291
302
|
{
|
|
292
303
|
"name": "readonly",
|
|
293
304
|
"attribute": "readonly",
|
|
294
305
|
"description": "Set readonly state",
|
|
295
306
|
"type": "boolean",
|
|
296
|
-
"default": "
|
|
307
|
+
"default": "false"
|
|
297
308
|
},
|
|
298
309
|
{
|
|
299
310
|
"name": "disabled",
|
|
300
311
|
"attribute": "disabled",
|
|
301
312
|
"description": "Set disabled state",
|
|
302
313
|
"type": "boolean",
|
|
303
|
-
"default": "
|
|
314
|
+
"default": "false"
|
|
304
315
|
}
|
|
305
316
|
],
|
|
306
317
|
"events": [
|
|
@@ -321,6 +332,24 @@
|
|
|
321
332
|
"description": "Dispatched when internal view changes"
|
|
322
333
|
}
|
|
323
334
|
],
|
|
335
|
+
"slots": [
|
|
336
|
+
{
|
|
337
|
+
"name": "header",
|
|
338
|
+
"description": "Slot to add custom contents at the top of popup"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"name": "right",
|
|
342
|
+
"description": "Slot to add custom contents at the right of popup"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"name": "footer",
|
|
346
|
+
"description": "Slot to add custom contents at the bottom of popup"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"name": "left",
|
|
350
|
+
"description": "Slot to add custom contents at the left of popup"
|
|
351
|
+
}
|
|
352
|
+
],
|
|
324
353
|
"methods": [
|
|
325
354
|
{
|
|
326
355
|
"name": "validateInput",
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# ef-datetime-picker
|
|
2
|
+
|
|
3
|
+
Control to pick date and time
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
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 state to error |
|
|
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` | "" | 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` | "" | Placeholder to display when no value is set |
|
|
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 state to warning |
|
|
32
|
+
| `weekdaysOnly` | `weekdays-only` | `boolean` | false | Only enable weekdays |
|
|
33
|
+
| `weekendsOnly` | `weekends-only` | `boolean` | false | Only enable weekends |
|
|
34
|
+
|
|
35
|
+
## Methods
|
|
36
|
+
|
|
37
|
+
| Method | Type | Description |
|
|
38
|
+
|-----------------|------------|--------------------------------------------------|
|
|
39
|
+
| `validateInput` | `(): void` | Validates the input, marking the element as invalid if its value does not meet the validation criteria. |
|
|
40
|
+
|
|
41
|
+
## Events
|
|
42
|
+
|
|
43
|
+
| Event | Description |
|
|
44
|
+
|------------------|--------------------------------------------------|
|
|
45
|
+
| `error-changed` | Dispatched when error state changes |
|
|
46
|
+
| `opened-changed` | Dispatched when when opened attribute changes internally |
|
|
47
|
+
| `value-changed` | Dispatched when value changes |
|
|
48
|
+
| `view-changed` | Dispatched when internal view changes |
|
|
49
|
+
|
|
50
|
+
## Slots
|
|
51
|
+
|
|
52
|
+
| Name | Description |
|
|
53
|
+
|----------|--------------------------------------------------|
|
|
54
|
+
| `footer` | Slot to add custom contents at the bottom of popup |
|
|
55
|
+
| `header` | Slot to add custom contents at the top of popup |
|
|
56
|
+
| `left` | Slot to add custom contents at the left of popup |
|
|
57
|
+
| `right` | Slot to add custom contents at the right of popup |
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { ControlElement, TemplateResult, MultiValue, PropertyValues,
|
|
3
|
-
import '
|
|
4
|
-
import '../
|
|
5
|
-
import '../
|
|
6
|
-
import '../
|
|
7
|
-
import '../
|
|
8
|
-
import
|
|
2
|
+
import { ControlElement, TemplateResult, MultiValue, PropertyValues, CSSResultGroup } from '@refinitiv-ui/core';
|
|
3
|
+
import type { DatetimePickerDuplex, DatetimePickerFilter } from './types';
|
|
4
|
+
import '../calendar/index.js';
|
|
5
|
+
import '../icon/index.js';
|
|
6
|
+
import '../overlay/index.js';
|
|
7
|
+
import '../text-field/index.js';
|
|
8
|
+
import '../time-picker/index.js';
|
|
9
9
|
import { TranslateDirective } from '@refinitiv-ui/translate';
|
|
10
|
-
export { DatetimePickerFilter, DatetimePickerDuplex };
|
|
10
|
+
export type { DatetimePickerFilter, DatetimePickerDuplex };
|
|
11
11
|
/**
|
|
12
12
|
* Control to pick date and time
|
|
13
13
|
*
|
|
@@ -22,10 +22,10 @@ export { DatetimePickerFilter, DatetimePickerDuplex };
|
|
|
22
22
|
* @attr {boolean} disabled - Set disabled state
|
|
23
23
|
* @prop {boolean} [disabled=false] - Set disabled state
|
|
24
24
|
*
|
|
25
|
-
* @
|
|
26
|
-
* @
|
|
27
|
-
* @
|
|
28
|
-
* @
|
|
25
|
+
* @slot header - Slot to add custom contents at the top of popup
|
|
26
|
+
* @slot right - Slot to add custom contents at the right of popup
|
|
27
|
+
* @slot footer - Slot to add custom contents at the bottom of popup
|
|
28
|
+
* @slot left - Slot to add custom contents at the left of popup
|
|
29
29
|
*/
|
|
30
30
|
export declare class DatetimePicker extends ControlElement implements MultiValue {
|
|
31
31
|
/**
|
|
@@ -34,12 +34,12 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
34
34
|
*/
|
|
35
35
|
static get version(): string;
|
|
36
36
|
/**
|
|
37
|
-
* A `
|
|
37
|
+
* A `CSSResultGroup` that will be used
|
|
38
38
|
* to style the host, slotted children
|
|
39
39
|
* and the internal template of the element.
|
|
40
40
|
* @return CSS template
|
|
41
41
|
*/
|
|
42
|
-
static get styles():
|
|
42
|
+
static get styles(): CSSResultGroup;
|
|
43
43
|
private lazyRendered;
|
|
44
44
|
private calendarValues;
|
|
45
45
|
private timepickerValues;
|
|
@@ -50,6 +50,7 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
50
50
|
/**
|
|
51
51
|
* Set minimum date
|
|
52
52
|
* @param min date
|
|
53
|
+
* @default -
|
|
53
54
|
*/
|
|
54
55
|
set min(min: string);
|
|
55
56
|
get min(): string;
|
|
@@ -58,6 +59,7 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
58
59
|
/**
|
|
59
60
|
* Set maximum date
|
|
60
61
|
* @param max date
|
|
62
|
+
* @default -
|
|
61
63
|
*/
|
|
62
64
|
set max(max: string);
|
|
63
65
|
get max(): string;
|
|
@@ -90,10 +92,14 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
90
92
|
* @param multiple Multiple
|
|
91
93
|
*/
|
|
92
94
|
set multiple(multiple: boolean);
|
|
95
|
+
/**
|
|
96
|
+
* @ignore
|
|
97
|
+
*/
|
|
93
98
|
get multiple(): boolean;
|
|
94
99
|
/**
|
|
95
100
|
* Current date time value
|
|
96
101
|
* @param value Calendar value
|
|
102
|
+
* @default -
|
|
97
103
|
*/
|
|
98
104
|
set value(value: string);
|
|
99
105
|
get value(): string;
|
|
@@ -103,6 +109,7 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
103
109
|
* Set multiple selected values
|
|
104
110
|
* @param values Values to set
|
|
105
111
|
* @type {string[]}
|
|
112
|
+
* @default []
|
|
106
113
|
*/
|
|
107
114
|
set values(values: string[]);
|
|
108
115
|
get values(): string[];
|
|
@@ -119,6 +126,7 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
119
126
|
/**
|
|
120
127
|
* Placeholder to display when no value is set
|
|
121
128
|
* @param placeholder Placeholder
|
|
129
|
+
* @default -
|
|
122
130
|
*/
|
|
123
131
|
set placeholder(placeholder: string);
|
|
124
132
|
get placeholder(): string;
|
|
@@ -152,6 +160,7 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
152
160
|
* Set the datetime format
|
|
153
161
|
* Based on dane-fns datetime formats
|
|
154
162
|
* @param format Date format
|
|
163
|
+
* @default -
|
|
155
164
|
*/
|
|
156
165
|
set format(format: string);
|
|
157
166
|
get format(): string;
|
|
@@ -168,6 +177,7 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
168
177
|
* Set the current calendar view.
|
|
169
178
|
* Accepted format: 'yyyy-MM'
|
|
170
179
|
* @param view view date
|
|
180
|
+
* @default -
|
|
171
181
|
*/
|
|
172
182
|
set view(view: string);
|
|
173
183
|
get view(): string;
|
|
@@ -177,6 +187,7 @@ export declare class DatetimePicker extends ControlElement implements MultiValue
|
|
|
177
187
|
* Accepted format: 'yyyy-MM'
|
|
178
188
|
* @param views view dates
|
|
179
189
|
* @type {string[]}
|
|
190
|
+
* @default []
|
|
180
191
|
*/
|
|
181
192
|
set views(views: string[]);
|
|
182
193
|
get views(): string[];
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import {
|
|
8
|
-
import '../calendar';
|
|
9
|
-
import '../icon';
|
|
10
|
-
import '../overlay';
|
|
11
|
-
import '../text-field';
|
|
12
|
-
import '../time-picker';
|
|
13
|
-
import { getDateFNSLocale } from './locales';
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { ControlElement, html, css, WarningNotice } from '@refinitiv-ui/core';
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
|
|
5
|
+
import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
|
|
6
|
+
import { ifDefined } from '@refinitiv-ui/core/lib/directives/if-defined.js';
|
|
7
|
+
import { VERSION } from '../version.js';
|
|
8
|
+
import '../calendar/index.js';
|
|
9
|
+
import '../icon/index.js';
|
|
10
|
+
import '../overlay/index.js';
|
|
11
|
+
import '../text-field/index.js';
|
|
12
|
+
import '../time-picker/index.js';
|
|
14
13
|
import { translate, getLocale, TranslatePropertyKey } from '@refinitiv-ui/translate';
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
14
|
+
import { getDateFNSLocale } from './locales.js';
|
|
15
|
+
import inputFormat from 'date-fns/esm/format/index.js';
|
|
16
|
+
import inputParse from 'date-fns/esm/parse/index.js';
|
|
17
|
+
import isValid from 'date-fns/esm/isValid/index.js';
|
|
18
|
+
import { addMonths, subMonths, isAfter, isBefore, isValidDate, isValidDateTime, DateFormat, DateTimeFormat, parse, format } from '@refinitiv-ui/utils/lib/date.js';
|
|
19
|
+
import { DateTimeSegment, formatToView, getCurrentTime } from './utils.js';
|
|
20
|
+
import { preload } from '../icon/index.js';
|
|
20
21
|
preload('calendar', 'down', 'left', 'right'); /* preload calendar icons for faster loading */
|
|
21
22
|
const POPUP_POSITION = ['bottom-start', 'top-start', 'bottom-end', 'top-end', 'bottom-middle', 'top-middle'];
|
|
22
23
|
const INPUT_FORMAT = {
|
|
@@ -40,10 +41,10 @@ const INPUT_FORMAT = {
|
|
|
40
41
|
* @attr {boolean} disabled - Set disabled state
|
|
41
42
|
* @prop {boolean} [disabled=false] - Set disabled state
|
|
42
43
|
*
|
|
43
|
-
* @
|
|
44
|
-
* @
|
|
45
|
-
* @
|
|
46
|
-
* @
|
|
44
|
+
* @slot header - Slot to add custom contents at the top of popup
|
|
45
|
+
* @slot right - Slot to add custom contents at the right of popup
|
|
46
|
+
* @slot footer - Slot to add custom contents at the bottom of popup
|
|
47
|
+
* @slot left - Slot to add custom contents at the left of popup
|
|
47
48
|
*/
|
|
48
49
|
let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
49
50
|
constructor() {
|
|
@@ -132,7 +133,7 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
132
133
|
return VERSION;
|
|
133
134
|
}
|
|
134
135
|
/**
|
|
135
|
-
* A `
|
|
136
|
+
* A `CSSResultGroup` that will be used
|
|
136
137
|
* to style the host, slotted children
|
|
137
138
|
* and the internal template of the element.
|
|
138
139
|
* @return CSS template
|
|
@@ -181,6 +182,7 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
181
182
|
/**
|
|
182
183
|
* Set minimum date
|
|
183
184
|
* @param min date
|
|
185
|
+
* @default -
|
|
184
186
|
*/
|
|
185
187
|
set min(min) {
|
|
186
188
|
if (!this.isValidValue(min)) {
|
|
@@ -191,7 +193,7 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
191
193
|
if (oldMin !== min) {
|
|
192
194
|
this._min = min;
|
|
193
195
|
this.minDate = min ? format(parse(min), DateFormat.yyyyMMdd) : '';
|
|
194
|
-
|
|
196
|
+
this.requestUpdate('min', oldMin);
|
|
195
197
|
}
|
|
196
198
|
}
|
|
197
199
|
get min() {
|
|
@@ -200,6 +202,7 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
200
202
|
/**
|
|
201
203
|
* Set maximum date
|
|
202
204
|
* @param max date
|
|
205
|
+
* @default -
|
|
203
206
|
*/
|
|
204
207
|
set max(max) {
|
|
205
208
|
if (!this.isValidValue(max)) {
|
|
@@ -210,7 +213,7 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
210
213
|
if (oldMax !== max) {
|
|
211
214
|
this._max = max;
|
|
212
215
|
this.maxDate = max ? format(parse(max), DateFormat.yyyyMMdd) : '';
|
|
213
|
-
|
|
216
|
+
this.requestUpdate('max', oldMax);
|
|
214
217
|
}
|
|
215
218
|
}
|
|
216
219
|
get max() {
|
|
@@ -225,12 +228,16 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
225
228
|
set multiple(multiple) {
|
|
226
229
|
new WarningNotice('multiple is not currently supported').show();
|
|
227
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* @ignore
|
|
233
|
+
*/
|
|
228
234
|
get multiple() {
|
|
229
235
|
return false;
|
|
230
236
|
}
|
|
231
237
|
/**
|
|
232
238
|
* Current date time value
|
|
233
239
|
* @param value Calendar value
|
|
240
|
+
* @default -
|
|
234
241
|
*/
|
|
235
242
|
set value(value) {
|
|
236
243
|
this.values = value ? [value] : [];
|
|
@@ -242,12 +249,14 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
242
249
|
* Set multiple selected values
|
|
243
250
|
* @param values Values to set
|
|
244
251
|
* @type {string[]}
|
|
252
|
+
* @default []
|
|
245
253
|
*/
|
|
246
254
|
set values(values) {
|
|
247
255
|
const oldValues = this._values;
|
|
248
256
|
if (String(oldValues) !== String(values)) {
|
|
249
257
|
this._values = values;
|
|
250
|
-
|
|
258
|
+
this.valuesToSegments();
|
|
259
|
+
this.requestUpdate('_values', oldValues); /* segments are populated in update */
|
|
251
260
|
}
|
|
252
261
|
}
|
|
253
262
|
get values() {
|
|
@@ -256,12 +265,13 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
256
265
|
/**
|
|
257
266
|
* Placeholder to display when no value is set
|
|
258
267
|
* @param placeholder Placeholder
|
|
268
|
+
* @default -
|
|
259
269
|
*/
|
|
260
270
|
set placeholder(placeholder) {
|
|
261
271
|
const oldPlaceholder = this._placeholder;
|
|
262
272
|
if (oldPlaceholder !== placeholder) {
|
|
263
273
|
this._placeholder = placeholder;
|
|
264
|
-
|
|
274
|
+
this.requestUpdate('placeholder', oldPlaceholder);
|
|
265
275
|
}
|
|
266
276
|
}
|
|
267
277
|
get placeholder() {
|
|
@@ -271,12 +281,13 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
271
281
|
* Set the datetime format
|
|
272
282
|
* Based on dane-fns datetime formats
|
|
273
283
|
* @param format Date format
|
|
284
|
+
* @default -
|
|
274
285
|
*/
|
|
275
286
|
set format(format) {
|
|
276
287
|
const oldFormat = this._format;
|
|
277
288
|
if (oldFormat !== format) {
|
|
278
289
|
this._format = format;
|
|
279
|
-
|
|
290
|
+
this.requestUpdate('format', oldFormat);
|
|
280
291
|
}
|
|
281
292
|
}
|
|
282
293
|
get format() {
|
|
@@ -290,6 +301,7 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
290
301
|
* Set the current calendar view.
|
|
291
302
|
* Accepted format: 'yyyy-MM'
|
|
292
303
|
* @param view view date
|
|
304
|
+
* @default -
|
|
293
305
|
*/
|
|
294
306
|
set view(view) {
|
|
295
307
|
this.views = view ? [view] : [];
|
|
@@ -302,13 +314,14 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
302
314
|
* Accepted format: 'yyyy-MM'
|
|
303
315
|
* @param views view dates
|
|
304
316
|
* @type {string[]}
|
|
317
|
+
* @default []
|
|
305
318
|
*/
|
|
306
319
|
set views(views) {
|
|
307
320
|
const oldViews = this._views;
|
|
308
321
|
views = this.filterAndWarnInvalidViews(views);
|
|
309
322
|
if (oldViews.toString() !== views.toString()) {
|
|
310
323
|
this._views = views;
|
|
311
|
-
|
|
324
|
+
this.requestUpdate('views', oldViews);
|
|
312
325
|
}
|
|
313
326
|
}
|
|
314
327
|
get views() {
|
|
@@ -345,9 +358,6 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
345
358
|
* @returns {void}
|
|
346
359
|
*/
|
|
347
360
|
update(changedProperties) {
|
|
348
|
-
if (changedProperties.has('_values')) {
|
|
349
|
-
this.valuesToSegments();
|
|
350
|
-
}
|
|
351
361
|
if (changedProperties.has('opened') && this.opened) {
|
|
352
362
|
this.lazyRendered = true;
|
|
353
363
|
}
|
|
@@ -383,7 +393,9 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
383
393
|
if (value === '') {
|
|
384
394
|
return true;
|
|
385
395
|
}
|
|
386
|
-
|
|
396
|
+
// Need to check for the attribute to cover the case when
|
|
397
|
+
// timepicker and value attributes are set
|
|
398
|
+
return (this.timepicker || this.hasAttribute('timepicker'))
|
|
387
399
|
? isValidDateTime(value)
|
|
388
400
|
: isValidDate(value, DateFormat.yyyyMMdd);
|
|
389
401
|
}
|
|
@@ -602,7 +614,6 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
602
614
|
notifyValuesChange(values) {
|
|
603
615
|
if (this.values.toString() !== values.toString()) {
|
|
604
616
|
this.values = values;
|
|
605
|
-
this.valuesToSegments(); /* need to be here to get correct value synchronously */
|
|
606
617
|
this.notifyPropertyChange('value', this.value);
|
|
607
618
|
}
|
|
608
619
|
}
|
|
@@ -776,7 +787,7 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
776
787
|
const inputValues = [...this.inputValues];
|
|
777
788
|
inputValues[index] = formattedValue;
|
|
778
789
|
this.inputValues = inputValues;
|
|
779
|
-
|
|
790
|
+
this.requestUpdate();
|
|
780
791
|
}
|
|
781
792
|
}
|
|
782
793
|
/**
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { Phrasebook } from '@refinitiv-ui/phrasebook';
|
|
2
2
|
import { resolveLocale, DEFAULT_LOCALE } from '@refinitiv-ui/i18n';
|
|
3
|
-
import
|
|
3
|
+
import enGB from 'date-fns/esm/locale/en-GB/index.js';
|
|
4
|
+
import enUS from 'date-fns/esm/locale/en-US/index.js';
|
|
5
|
+
import de from 'date-fns/esm/locale/de/index.js';
|
|
6
|
+
import es from 'date-fns/esm/locale/es/index.js';
|
|
7
|
+
import fr from 'date-fns/esm/locale/fr/index.js';
|
|
8
|
+
import it from 'date-fns/esm/locale/it/index.js';
|
|
9
|
+
import ja from 'date-fns/esm/locale/ja/index.js';
|
|
10
|
+
import ko from 'date-fns/esm/locale/ko/index.js';
|
|
11
|
+
import pl from 'date-fns/esm/locale/pl/index.js';
|
|
12
|
+
import ru from 'date-fns/esm/locale/ru/index.js';
|
|
13
|
+
import th from 'date-fns/esm/locale/th/index.js';
|
|
14
|
+
import zhCN from 'date-fns/esm/locale/zh-CN/index.js';
|
|
4
15
|
// This file is a transition between using date-fns and Intl object to format dates
|
|
5
16
|
// As of now, use Phraseboook to just resolve languages and locales
|
|
6
17
|
// and match against the date-fns locales.
|
|
@@ -4,4 +4,4 @@ import '@refinitiv-ui/elements/lib/overlay/themes/solar/charcoal';
|
|
|
4
4
|
import '@refinitiv-ui/elements/lib/time-picker/themes/solar/charcoal';
|
|
5
5
|
import '@refinitiv-ui/elements/lib/text-field/themes/solar/charcoal';
|
|
6
6
|
|
|
7
|
-
elf.customStyles.define('ef-datetime-picker', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;width:140px;max-width:100%;padding:0 5px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#c2c2c2;border-radius:0;text-overflow:ellipsis;background-color:#000;border:1px solid #4a4a52}:host([error]),:host([error][warning]){border:1px solid #f5475b}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(194,194,194,.6);border:1px solid rgba(245,71,91,.6)}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#f93;border-style:dotted}:host [part=time-picker]{margin:0}:host [part=timepicker-wrapper]{box-shadow:inset 0 1px 0 0 #0a0a0a;box-shadow:none;padding:0 3px 3px}:host([range]) ef-text-field{text-align:center}:host [part=input]{color:inherit}:host [part=icon]{color:#e2e2e2}:host [part=input-separator]{line-height:23px;background:#c2c2c2;width:.4em;margin:auto 0;height:1px}:host([disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6)}:host([readonly]){border:1px solid rgba(74,74,82,.6)}:host(:not([focused]):not(:focus):hover){border:1px solid #77777d}:host([warning]){background-color:#000;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(194,194,194,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#000;border:1px solid #f5475b}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(245,71,91,.6);color:rgba(194,194,194,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(245,71,91,.6)}:host([error]:not([focused]):not(:focus):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):hover){border:1px solid #f87584}:host([highlight]){background-color:#1b252f;border:1px solid #4a4a52}:host([highlight][disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6);background-color:rgba(27,37,47,.6)}:host([highlight][readonly]){border:1px solid rgba(74,74,82,.6)}:host([highlight]:not([focused]):not(:focus):hover){border:1px solid #77777d}:host([indirect]){color:#0fd;background-color:#000;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,255,221,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):hover){border:1px solid #a7a45a}:host [part=calendar]{width:224px;padding:4px}:host [part=list]{margin-top:1px}:host([range]){width:280px}');
|
|
7
|
+
elf.customStyles.define('ef-datetime-picker', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;width:140px;max-width:100%;padding:0 5px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#c2c2c2;border-radius:0;text-overflow:ellipsis;background-color:#000;border:1px solid #4a4a52}:host([error]),:host([error][warning]){border:1px solid #f5475b}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(194,194,194,.6);border:1px solid rgba(245,71,91,.6)}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#f93;border-style:dotted}:host [part=time-picker]{margin:0}:host [part=timepicker-wrapper]{box-shadow:inset 0 1px 0 0 #0a0a0a;box-shadow:none;padding:0 3px 3px}:host([range]) ef-text-field{text-align:center}:host [part=input]{color:inherit}:host [part=icon]{color:#e2e2e2}:host [part=input-separator]{line-height:23px;background:#c2c2c2;width:.4em;margin:auto 0;height:1px}:host([disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6)}:host([readonly]){border:1px solid rgba(74,74,82,.6)}:host(:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #77777d}:host([warning]){background-color:#000;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(194,194,194,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#000;border:1px solid #f5475b}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(245,71,91,.6);color:rgba(194,194,194,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(245,71,91,.6)}:host([error]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #f87584}:host([highlight]){background-color:#1b252f;border:1px solid #4a4a52}:host([highlight][disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6);background-color:rgba(27,37,47,.6)}:host([highlight][readonly]){border:1px solid rgba(74,74,82,.6)}:host([highlight]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #77777d}:host([indirect]){color:#0fd;background-color:#000;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,255,221,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #a7a45a}:host [part=calendar]{width:224px;padding:4px}:host [part=list]{margin-top:1px}:host([range]){width:280px}');
|
|
@@ -4,4 +4,4 @@ import '@refinitiv-ui/elements/lib/overlay/themes/solar/pearl';
|
|
|
4
4
|
import '@refinitiv-ui/elements/lib/time-picker/themes/solar/pearl';
|
|
5
5
|
import '@refinitiv-ui/elements/lib/text-field/themes/solar/pearl';
|
|
6
6
|
|
|
7
|
-
elf.customStyles.define('ef-datetime-picker', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;width:140px;max-width:100%;padding:0 5px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#484848;border-radius:0;text-overflow:ellipsis;background-color:#fff;border:1px solid #a9afba}:host([error]),:host([error][warning]){border:1px solid #d94255}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(72,72,72,.6);border:1px solid rgba(217,66,85,.6)}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#ffb266;border-style:dotted}:host [part=time-picker]{margin:0}:host [part=timepicker-wrapper]{box-shadow:inset 0 1px 0 0 #d5d8db;box-shadow:none;padding:0 3px 3px}:host([range]) ef-text-field{text-align:center}:host [part=input]{color:inherit}:host [part=icon]{color:#acafb5}:host [part=input-separator]{line-height:23px;background:#484848;width:.4em;margin:auto 0;height:1px}:host([disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6)}:host([readonly]){border:1px solid rgba(169,175,186,.6)}:host(:not([focused]):not(:focus):hover){border:1px solid #bfc3cb}:host([warning]){background-color:#fff;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(72,72,72,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#fff;border:1px solid #d94255}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(217,66,85,.6);color:rgba(72,72,72,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(217,66,85,.6)}:host([error]:not([focused]):not(:focus):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):hover){border:1px solid #e37180}:host([highlight]){background-color:#b0ffff;border:1px solid #a9afba}:host([highlight][disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6);background-color:rgba(176,255,255,.6)}:host([highlight][readonly]){border:1px solid rgba(169,175,186,.6)}:host([highlight]:not([focused]):not(:focus):hover){border:1px solid #bfc3cb}:host([indirect]){color:#009494;background-color:#effefe;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,148,148,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):hover){border:1px solid #a7a45a}:host [part=calendar]{width:224px;padding:4px}:host [part=list]{margin-top:1px}:host([range]){width:280px}');
|
|
7
|
+
elf.customStyles.define('ef-datetime-picker', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;width:140px;max-width:100%;padding:0 5px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#484848;border-radius:0;text-overflow:ellipsis;background-color:#fff;border:1px solid #a9afba}:host([error]),:host([error][warning]){border:1px solid #d94255}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(72,72,72,.6);border:1px solid rgba(217,66,85,.6)}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#ffb266;border-style:dotted}:host [part=time-picker]{margin:0}:host [part=timepicker-wrapper]{box-shadow:inset 0 1px 0 0 #d5d8db;box-shadow:none;padding:0 3px 3px}:host([range]) ef-text-field{text-align:center}:host [part=input]{color:inherit}:host [part=icon]{color:#acafb5}:host [part=input-separator]{line-height:23px;background:#484848;width:.4em;margin:auto 0;height:1px}:host([disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6)}:host([readonly]){border:1px solid rgba(169,175,186,.6)}:host(:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #bfc3cb}:host([warning]){background-color:#fff;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(72,72,72,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#fff;border:1px solid #d94255}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(217,66,85,.6);color:rgba(72,72,72,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(217,66,85,.6)}:host([error]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #e37180}:host([highlight]){background-color:#b0ffff;border:1px solid #a9afba}:host([highlight][disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6);background-color:rgba(176,255,255,.6)}:host([highlight][readonly]){border:1px solid rgba(169,175,186,.6)}:host([highlight]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #bfc3cb}:host([indirect]){color:#009494;background-color:#effefe;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,148,148,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #a7a45a}:host [part=calendar]{width:224px;padding:4px}:host [part=list]{margin-top:1px}:host([range]){width:280px}');
|