@refinitiv-ui/elements 5.5.0 → 5.8.1

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.
Files changed (328) hide show
  1. package/CHANGELOG.md +65 -8
  2. package/lib/accordion/custom-elements.md +18 -0
  3. package/lib/accordion/index.d.ts +5 -5
  4. package/lib/accordion/index.js +8 -11
  5. package/lib/appstate-bar/custom-elements.md +22 -0
  6. package/lib/appstate-bar/index.d.ts +5 -5
  7. package/lib/appstate-bar/index.js +8 -11
  8. package/lib/autosuggest/custom-elements.json +24 -4
  9. package/lib/autosuggest/custom-elements.md +54 -0
  10. package/lib/autosuggest/helpers/types.d.ts +1 -1
  11. package/lib/autosuggest/helpers/utils.d.ts +2 -2
  12. package/lib/autosuggest/helpers/utils.js +1 -2
  13. package/lib/autosuggest/index.d.ts +13 -8
  14. package/lib/autosuggest/index.js +38 -31
  15. package/lib/button/custom-elements.json +2 -2
  16. package/lib/button/custom-elements.md +23 -0
  17. package/lib/button/index.d.ts +13 -13
  18. package/lib/button/index.js +41 -31
  19. package/lib/button-bar/custom-elements.md +9 -0
  20. package/lib/button-bar/index.d.ts +3 -3
  21. package/lib/button-bar/index.js +8 -10
  22. package/lib/calendar/constants.d.ts +22 -0
  23. package/lib/calendar/constants.js +23 -0
  24. package/lib/calendar/custom-elements.json +8 -6
  25. package/lib/calendar/custom-elements.md +35 -0
  26. package/lib/calendar/index.d.ts +9 -7
  27. package/lib/calendar/index.js +20 -38
  28. package/lib/calendar/locales.d.ts +1 -31
  29. package/lib/calendar/locales.js +0 -104
  30. package/lib/calendar/types.d.ts +1 -5
  31. package/lib/calendar/types.js +1 -6
  32. package/lib/calendar/utils.d.ts +31 -1
  33. package/lib/calendar/utils.js +104 -2
  34. package/lib/canvas/custom-elements.json +7 -5
  35. package/lib/canvas/custom-elements.md +27 -0
  36. package/lib/canvas/index.d.ts +4 -3
  37. package/lib/canvas/index.js +8 -10
  38. package/lib/card/custom-elements.json +3 -1
  39. package/lib/card/custom-elements.md +24 -0
  40. package/lib/card/helpers/types.d.ts +1 -1
  41. package/lib/card/index.d.ts +10 -8
  42. package/lib/card/index.js +14 -13
  43. package/lib/chart/custom-elements.json +1 -1
  44. package/lib/chart/custom-elements.md +16 -0
  45. package/lib/chart/helpers/index.d.ts +2 -2
  46. package/lib/chart/helpers/index.js +2 -2
  47. package/lib/chart/index.d.ts +6 -6
  48. package/lib/chart/index.js +12 -14
  49. package/lib/checkbox/custom-elements.json +4 -4
  50. package/lib/checkbox/custom-elements.md +18 -0
  51. package/lib/checkbox/index.d.ts +21 -13
  52. package/lib/checkbox/index.js +56 -31
  53. package/lib/clock/custom-elements.json +21 -4
  54. package/lib/clock/custom-elements.md +28 -0
  55. package/lib/clock/index.d.ts +17 -5
  56. package/lib/clock/index.js +37 -18
  57. package/lib/clock/themes/halo/dark/index.js +1 -1
  58. package/lib/clock/themes/halo/light/index.js +1 -1
  59. package/lib/clock/themes/solar/charcoal/index.js +1 -1
  60. package/lib/clock/themes/solar/pearl/index.js +1 -1
  61. package/lib/clock/utils/TickManager.js +2 -2
  62. package/lib/collapse/custom-elements.md +27 -0
  63. package/lib/collapse/index.d.ts +7 -7
  64. package/lib/collapse/index.js +11 -13
  65. package/lib/color-dialog/custom-elements.json +29 -16
  66. package/lib/color-dialog/custom-elements.md +39 -0
  67. package/lib/color-dialog/elements/color-palettes.d.ts +5 -5
  68. package/lib/color-dialog/elements/color-palettes.js +8 -12
  69. package/lib/color-dialog/elements/grayscale-palettes.d.ts +5 -5
  70. package/lib/color-dialog/elements/grayscale-palettes.js +9 -12
  71. package/lib/color-dialog/elements/palettes.d.ts +3 -3
  72. package/lib/color-dialog/elements/palettes.js +49 -47
  73. package/lib/color-dialog/helpers/value-model.js +2 -2
  74. package/lib/color-dialog/index.d.ts +19 -19
  75. package/lib/color-dialog/index.js +36 -35
  76. package/lib/combo-box/custom-elements.json +28 -16
  77. package/lib/combo-box/custom-elements.md +35 -0
  78. package/lib/combo-box/helpers/filter.d.ts +4 -4
  79. package/lib/combo-box/helpers/types.d.ts +2 -2
  80. package/lib/combo-box/index.d.ts +26 -18
  81. package/lib/combo-box/index.js +36 -27
  82. package/lib/combo-box/themes/halo/dark/index.js +1 -1
  83. package/lib/combo-box/themes/halo/light/index.js +1 -1
  84. package/lib/combo-box/themes/solar/charcoal/index.js +1 -1
  85. package/lib/combo-box/themes/solar/pearl/index.js +1 -1
  86. package/lib/counter/custom-elements.json +8 -4
  87. package/lib/counter/custom-elements.md +11 -0
  88. package/lib/counter/index.d.ts +5 -3
  89. package/lib/counter/index.js +11 -12
  90. package/lib/datetime-picker/custom-elements.json +52 -23
  91. package/lib/datetime-picker/custom-elements.md +57 -0
  92. package/lib/datetime-picker/index.d.ts +25 -14
  93. package/lib/datetime-picker/index.js +46 -35
  94. package/lib/datetime-picker/locales.d.ts +1 -1
  95. package/lib/datetime-picker/locales.js +12 -1
  96. package/lib/datetime-picker/types.d.ts +1 -1
  97. package/lib/datetime-picker/utils.js +1 -1
  98. package/lib/dialog/custom-elements.json +34 -12
  99. package/lib/dialog/custom-elements.md +47 -0
  100. package/lib/dialog/index.d.ts +17 -20
  101. package/lib/dialog/index.js +28 -31
  102. package/lib/email-field/custom-elements.json +81 -94
  103. package/lib/email-field/custom-elements.md +37 -0
  104. package/lib/email-field/index.d.ts +44 -116
  105. package/lib/email-field/index.js +48 -249
  106. package/lib/events.d.ts +2 -2
  107. package/lib/events.js +1 -2
  108. package/lib/flag/custom-elements.md +10 -0
  109. package/lib/flag/index.d.ts +6 -4
  110. package/lib/flag/index.js +12 -12
  111. package/lib/flag/utils/FlagLoader.d.ts +1 -1
  112. package/lib/flag/utils/FlagLoader.js +1 -1
  113. package/lib/header/custom-elements.md +18 -0
  114. package/lib/header/index.d.ts +2 -2
  115. package/lib/header/index.js +5 -8
  116. package/lib/heatmap/custom-elements.md +26 -0
  117. package/lib/heatmap/helpers/color.d.ts +1 -1
  118. package/lib/heatmap/helpers/color.js +1 -1
  119. package/lib/heatmap/helpers/text.d.ts +1 -1
  120. package/lib/heatmap/index.d.ts +7 -7
  121. package/lib/heatmap/index.js +15 -16
  122. package/lib/icon/custom-elements.json +6 -4
  123. package/lib/icon/custom-elements.md +8 -0
  124. package/lib/icon/index.d.ts +9 -6
  125. package/lib/icon/index.js +28 -18
  126. package/lib/icon/utils/IconLoader.d.ts +6 -1
  127. package/lib/icon/utils/IconLoader.js +24 -17
  128. package/lib/index.d.ts +2 -1
  129. package/lib/index.js +2 -1
  130. package/lib/interactive-chart/custom-elements.json +6 -10
  131. package/lib/interactive-chart/custom-elements.md +31 -0
  132. package/lib/interactive-chart/helpers/types.d.ts +2 -2
  133. package/lib/interactive-chart/index.d.ts +11 -8
  134. package/lib/interactive-chart/index.js +17 -17
  135. package/lib/item/custom-elements.json +4 -4
  136. package/lib/item/custom-elements.md +29 -0
  137. package/lib/item/helpers/types.d.ts +1 -1
  138. package/lib/item/index.d.ts +18 -8
  139. package/lib/item/index.js +36 -16
  140. package/lib/label/custom-elements.md +11 -0
  141. package/lib/label/index.d.ts +3 -3
  142. package/lib/label/index.js +12 -20
  143. package/lib/layout/custom-elements.md +26 -0
  144. package/lib/layout/index.d.ts +3 -3
  145. package/lib/layout/index.js +6 -9
  146. package/lib/led-gauge/custom-elements.json +4 -4
  147. package/lib/led-gauge/custom-elements.md +17 -0
  148. package/lib/led-gauge/index.d.ts +5 -4
  149. package/lib/led-gauge/index.js +9 -11
  150. package/lib/list/custom-elements.json +18 -5
  151. package/lib/list/custom-elements.md +32 -0
  152. package/lib/list/helpers/list-renderer.d.ts +2 -2
  153. package/lib/list/helpers/list-renderer.js +4 -2
  154. package/lib/list/helpers/types.d.ts +2 -2
  155. package/lib/list/index.d.ts +27 -10
  156. package/lib/list/index.js +54 -25
  157. package/lib/list/renderer.d.ts +2 -2
  158. package/lib/list/renderer.js +1 -1
  159. package/lib/loader/custom-elements.md +5 -0
  160. package/lib/loader/index.js +4 -8
  161. package/lib/multi-input/custom-elements.json +7 -6
  162. package/lib/multi-input/custom-elements.md +43 -0
  163. package/lib/multi-input/helpers/types.d.ts +1 -1
  164. package/lib/multi-input/index.d.ts +11 -7
  165. package/lib/multi-input/index.js +20 -17
  166. package/lib/notification/custom-elements.md +26 -0
  167. package/lib/notification/elements/notification-tray.d.ts +2 -2
  168. package/lib/notification/elements/notification-tray.js +6 -9
  169. package/lib/notification/elements/notification.d.ts +5 -5
  170. package/lib/notification/elements/notification.js +8 -11
  171. package/lib/notification/helpers/status.d.ts +1 -1
  172. package/lib/notification/helpers/status.js +1 -1
  173. package/lib/notification/helpers/types.d.ts +1 -1
  174. package/lib/notification/index.d.ts +2 -2
  175. package/lib/notification/index.js +2 -2
  176. package/lib/number-field/custom-elements.json +99 -54
  177. package/lib/number-field/custom-elements.md +42 -0
  178. package/lib/number-field/index.d.ts +96 -51
  179. package/lib/number-field/index.js +121 -89
  180. package/lib/overlay/custom-elements.json +26 -13
  181. package/lib/overlay/custom-elements.md +54 -0
  182. package/lib/overlay/elements/overlay-backdrop.d.ts +4 -4
  183. package/lib/overlay/elements/overlay-backdrop.js +6 -9
  184. package/lib/overlay/elements/overlay-viewport.d.ts +3 -3
  185. package/lib/overlay/elements/overlay-viewport.js +5 -9
  186. package/lib/overlay/elements/overlay.d.ts +10 -5
  187. package/lib/overlay/elements/overlay.js +18 -23
  188. package/lib/overlay/index.d.ts +2 -2
  189. package/lib/overlay/index.js +1 -1
  190. package/lib/overlay/managers/backdrop-manager.d.ts +1 -1
  191. package/lib/overlay/managers/backdrop-manager.js +2 -2
  192. package/lib/overlay/managers/close-manager.js +1 -1
  193. package/lib/overlay/managers/focus-manager.js +2 -2
  194. package/lib/overlay/managers/interaction-lock-manager.js +2 -2
  195. package/lib/overlay/managers/viewport-manager.d.ts +2 -2
  196. package/lib/overlay/managers/viewport-manager.js +6 -2
  197. package/lib/overlay/managers/zindex-manager.js +1 -1
  198. package/lib/overlay-menu/custom-elements.json +70 -20
  199. package/lib/overlay-menu/custom-elements.md +44 -0
  200. package/lib/overlay-menu/helpers/types.d.ts +3 -3
  201. package/lib/overlay-menu/index.d.ts +21 -19
  202. package/lib/overlay-menu/index.js +32 -31
  203. package/lib/overlay-menu/managers/menu-manager.d.ts +2 -2
  204. package/lib/overlay-menu/managers/menu-manager.js +3 -3
  205. package/lib/pagination/custom-elements.md +27 -0
  206. package/lib/pagination/index.d.ts +8 -8
  207. package/lib/pagination/index.js +13 -15
  208. package/lib/panel/custom-elements.md +11 -0
  209. package/lib/panel/index.d.ts +3 -3
  210. package/lib/panel/index.js +6 -9
  211. package/lib/password-field/custom-elements.json +62 -67
  212. package/lib/password-field/custom-elements.md +39 -0
  213. package/lib/password-field/index.d.ts +43 -94
  214. package/lib/password-field/index.js +52 -198
  215. package/lib/pill/custom-elements.json +8 -6
  216. package/lib/pill/custom-elements.md +22 -0
  217. package/lib/pill/index.d.ts +5 -5
  218. package/lib/pill/index.js +9 -11
  219. package/lib/progress-bar/custom-elements.md +18 -0
  220. package/lib/progress-bar/index.d.ts +3 -3
  221. package/lib/progress-bar/index.js +7 -9
  222. package/lib/radio-button/custom-elements.json +4 -4
  223. package/lib/radio-button/custom-elements.md +19 -0
  224. package/lib/radio-button/index.d.ts +25 -8
  225. package/lib/radio-button/index.js +84 -21
  226. package/lib/radio-button/radio-button-registry.d.ts +3 -2
  227. package/lib/radio-button/radio-button-registry.js +57 -4
  228. package/lib/rating/custom-elements.md +17 -0
  229. package/lib/rating/index.d.ts +3 -3
  230. package/lib/rating/index.js +9 -10
  231. package/lib/search-field/custom-elements.json +70 -74
  232. package/lib/search-field/custom-elements.md +41 -0
  233. package/lib/search-field/index.d.ts +44 -101
  234. package/lib/search-field/index.js +50 -220
  235. package/lib/select/custom-elements.json +5 -4
  236. package/lib/select/custom-elements.md +24 -0
  237. package/lib/select/helpers/types.d.ts +1 -1
  238. package/lib/select/index.d.ts +18 -10
  239. package/lib/select/index.js +84 -45
  240. package/lib/sidebar-layout/custom-elements.json +2 -6
  241. package/lib/sidebar-layout/custom-elements.md +21 -0
  242. package/lib/sidebar-layout/index.d.ts +7 -6
  243. package/lib/sidebar-layout/index.js +9 -10
  244. package/lib/slider/custom-elements.json +4 -4
  245. package/lib/slider/custom-elements.md +28 -0
  246. package/lib/slider/index.d.ts +4 -4
  247. package/lib/slider/index.js +9 -10
  248. package/lib/sparkline/custom-elements.json +4 -4
  249. package/lib/sparkline/custom-elements.md +16 -0
  250. package/lib/sparkline/index.d.ts +6 -4
  251. package/lib/sparkline/index.js +10 -10
  252. package/lib/swing-gauge/custom-elements.json +5 -3
  253. package/lib/swing-gauge/custom-elements.md +17 -0
  254. package/lib/swing-gauge/helpers.d.ts +1 -1
  255. package/lib/swing-gauge/helpers.js +1 -1
  256. package/lib/swing-gauge/index.d.ts +9 -7
  257. package/lib/swing-gauge/index.js +17 -15
  258. package/lib/tab/custom-elements.json +2 -2
  259. package/lib/tab/custom-elements.md +22 -0
  260. package/lib/tab/index.d.ts +5 -5
  261. package/lib/tab/index.js +9 -12
  262. package/lib/tab-bar/custom-elements.md +11 -0
  263. package/lib/tab-bar/index.d.ts +4 -4
  264. package/lib/tab-bar/index.js +9 -11
  265. package/lib/text-field/custom-elements.json +78 -89
  266. package/lib/text-field/custom-elements.md +35 -0
  267. package/lib/text-field/index.d.ts +59 -79
  268. package/lib/text-field/index.js +99 -158
  269. package/lib/time-picker/custom-elements.json +4 -4
  270. package/lib/time-picker/custom-elements.md +28 -0
  271. package/lib/time-picker/index.d.ts +7 -4
  272. package/lib/time-picker/index.js +15 -14
  273. package/lib/toggle/custom-elements.json +4 -4
  274. package/lib/toggle/custom-elements.md +19 -0
  275. package/lib/toggle/index.d.ts +14 -4
  276. package/lib/toggle/index.js +31 -12
  277. package/lib/tooltip/custom-elements.md +14 -0
  278. package/lib/tooltip/elements/title-tooltip.js +2 -2
  279. package/lib/tooltip/elements/tooltip-element.d.ts +1 -1
  280. package/lib/tooltip/helpers/overflow-tooltip.d.ts +1 -1
  281. package/lib/tooltip/helpers/overflow-tooltip.js +1 -1
  282. package/lib/tooltip/helpers/renderer.d.ts +1 -1
  283. package/lib/tooltip/helpers/types.d.ts +1 -1
  284. package/lib/tooltip/index.d.ts +9 -9
  285. package/lib/tooltip/index.js +18 -20
  286. package/lib/tooltip/managers/tooltip-manager.d.ts +2 -2
  287. package/lib/tooltip/managers/tooltip-manager.js +3 -7
  288. package/lib/tornado-chart/custom-elements.md +18 -0
  289. package/lib/tornado-chart/elements/tornado-chart.d.ts +4 -4
  290. package/lib/tornado-chart/elements/tornado-chart.js +8 -11
  291. package/lib/tornado-chart/elements/tornado-item.d.ts +5 -5
  292. package/lib/tornado-chart/elements/tornado-item.js +10 -12
  293. package/lib/tornado-chart/index.d.ts +2 -2
  294. package/lib/tornado-chart/index.js +2 -2
  295. package/lib/tree/custom-elements.json +4 -3
  296. package/lib/tree/custom-elements.md +32 -0
  297. package/lib/tree/elements/tree-item.d.ts +4 -4
  298. package/lib/tree/elements/tree-item.js +10 -13
  299. package/lib/tree/elements/tree.d.ts +6 -5
  300. package/lib/tree/elements/tree.js +9 -12
  301. package/lib/tree/helpers/filter.d.ts +2 -2
  302. package/lib/tree/helpers/renderer.d.ts +2 -2
  303. package/lib/tree/helpers/renderer.js +3 -3
  304. package/lib/tree/helpers/types.d.ts +1 -1
  305. package/lib/tree/index.d.ts +4 -4
  306. package/lib/tree/index.js +3 -3
  307. package/lib/tree/managers/tree-manager.d.ts +22 -10
  308. package/lib/tree/managers/tree-manager.js +56 -40
  309. package/lib/tree/themes/halo/dark/index.js +1 -1
  310. package/lib/tree/themes/halo/light/index.js +1 -1
  311. package/lib/tree/themes/solar/charcoal/index.js +1 -1
  312. package/lib/tree/themes/solar/pearl/index.js +1 -1
  313. package/lib/tree-select/custom-elements.json +10 -6
  314. package/lib/tree-select/custom-elements.md +26 -0
  315. package/lib/tree-select/helpers/types.d.ts +2 -2
  316. package/lib/tree-select/index.d.ts +28 -20
  317. package/lib/tree-select/index.js +44 -31
  318. package/lib/tree-select/themes/halo/dark/index.js +1 -1
  319. package/lib/tree-select/themes/halo/light/index.js +1 -1
  320. package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
  321. package/lib/tree-select/themes/solar/pearl/index.js +1 -1
  322. package/lib/version.d.ts +1 -0
  323. package/lib/version.js +1 -0
  324. package/package.json +298 -15
  325. package/lib/autosuggest/helpers/const.d.ts +0 -2
  326. package/lib/autosuggest/helpers/const.js +0 -3
  327. package/lib/overlay-menu/helpers/uuid.d.ts +0 -7
  328. package/lib/overlay-menu/helpers/uuid.js +0 -13
@@ -1,13 +1,13 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { ControlElement, TemplateResult, MultiValue, PropertyValues, CSSResult } from '@refinitiv-ui/core';
3
- import '../calendar';
4
- import '../icon';
5
- import '../overlay';
6
- import '../text-field';
7
- import '../time-picker';
8
- import { DatetimePickerDuplex, DatetimePickerFilter } from './types';
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
- * @slots header - Header slot
26
- * @slots right - Right slot
27
- * @slots footer - Footer slot
28
- * @slots left - Left slot
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 `CSSResult` that will be used
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(): CSSResult | CSSResult[];
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
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { ControlElement, html, css, customElement, property, query, ifDefined, WarningNotice } from '@refinitiv-ui/core';
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 { format as inputFormat, parse as inputParse, isValid } from 'date-fns';
16
- import { addMonths, subMonths, isAfter, isBefore, isValidDate, isValidDateTime, DateFormat, DateTimeFormat, parse, format } from '@refinitiv-ui/utils';
17
- import { DateTimeSegment, formatToView, getCurrentTime } from './utils';
18
- import { preload } from '../icon';
19
- import { VERSION } from '../';
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
- * @slots header - Header slot
44
- * @slots right - Right slot
45
- * @slots footer - Footer slot
46
- * @slots left - Left slot
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 `CSSResult` that will be used
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
- void this.requestUpdate('min', oldMin);
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
- void this.requestUpdate('max', oldMax);
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
- void this.requestUpdate('_values', oldValues); /* segments are populated in update */
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
- void this.requestUpdate('placeholder', oldPlaceholder);
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
- void this.requestUpdate('format', oldFormat);
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
- void this.requestUpdate('views', oldViews);
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
- return this.timepicker
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
- void this.requestUpdate();
790
+ this.requestUpdate();
780
791
  }
781
792
  }
782
793
  /**
@@ -1,4 +1,4 @@
1
- import { Locale } from 'date-fns';
1
+ import type { Locale } from 'date-fns';
2
2
  /**
3
3
  * Get date-fns locale or default locale
4
4
  * @param [locale] BCP47 locale tag
@@ -1,6 +1,17 @@
1
1
  import { Phrasebook } from '@refinitiv-ui/phrasebook';
2
2
  import { resolveLocale, DEFAULT_LOCALE } from '@refinitiv-ui/i18n';
3
- import { enGB, enUS, de, es, fr, it, ja, ko, pl, ru, th, zhCN } from 'date-fns/esm/locale';
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.
@@ -1,3 +1,3 @@
1
- import { CalendarFilter as DatetimePickerFilter } from '../calendar';
1
+ import type { CalendarFilter as DatetimePickerFilter } from '../calendar';
2
2
  declare type DatetimePickerDuplex = '' | 'consecutive' | 'split';
3
3
  export { DatetimePickerDuplex, DatetimePickerFilter };
@@ -1,4 +1,4 @@
1
- import { format, DateFormat, parse, TimeFormat, toTimeSegment } from '@refinitiv-ui/utils';
1
+ import { format, DateFormat, parse, TimeFormat, toTimeSegment } from '@refinitiv-ui/utils/lib/date.js';
2
2
  /**
3
3
  * A helper class to split date time string into date and time segments
4
4
  */
@@ -20,23 +20,40 @@
20
20
  "name": "opened",
21
21
  "description": "Set dialog to open",
22
22
  "type": "boolean",
23
- "default": "\"false\""
23
+ "default": "false"
24
+ },
25
+ {
26
+ "name": "no-cancel-on-esc-key",
27
+ "description": "Prevents dialog to close when user presses ESC key",
28
+ "type": "boolean",
29
+ "default": "false"
24
30
  },
25
31
  {
26
32
  "name": "x",
27
33
  "description": "Set a specific x coordinate of dialog",
28
- "type": "string"
34
+ "type": "string | undefined"
29
35
  },
30
36
  {
31
37
  "name": "y",
32
38
  "description": "Set a specific y coordinate of dialog",
33
- "type": "string"
39
+ "type": "string | undefined"
40
+ },
41
+ {
42
+ "name": "full-screen",
43
+ "description": "Set dialog to full screen",
44
+ "type": "boolean",
45
+ "default": "false"
46
+ },
47
+ {
48
+ "name": "position-target",
49
+ "description": "Set position of dialog i.e. `top`, `right`, `left`, `bottom`, `center` or combination of theme e.g. `top right`.",
50
+ "type": "string | undefined"
34
51
  },
35
52
  {
36
53
  "name": "no-cancel-on-esc-key",
37
54
  "description": "Prevents dialog to close when user presses ESC key",
38
55
  "type": "boolean",
39
- "default": "\"false\""
56
+ "default": "false"
40
57
  },
41
58
  {
42
59
  "name": "full-screen",
@@ -46,7 +63,7 @@
46
63
  {
47
64
  "name": "position-target",
48
65
  "description": "Set position of dialog i.e. `top`, `right`, `left`, `bottom`, `center` or combination of theme e.g. `top right`.",
49
- "type": "string"
66
+ "type": "string | undefined"
50
67
  }
51
68
  ],
52
69
  "properties": [
@@ -66,42 +83,47 @@
66
83
  {
67
84
  "name": "noCancelOnOutsideClick",
68
85
  "description": "Prevents dialog to close when user clicks outside the dialog.",
69
- "type": "boolean"
86
+ "type": "boolean",
87
+ "default": "true"
70
88
  },
71
89
  {
72
90
  "name": "opened",
73
91
  "attribute": "opened",
74
92
  "description": "Set dialog to open",
75
93
  "type": "boolean",
76
- "default": "\"false\""
94
+ "default": "false"
77
95
  },
78
96
  {
79
97
  "name": "noCancelOnEscKey",
98
+ "attribute": "no-cancel-on-esc-key",
80
99
  "description": "Prevents dialog to close when user presses ESC key",
81
100
  "type": "boolean",
82
- "default": "\"false\""
101
+ "default": "false"
83
102
  },
84
103
  {
85
104
  "name": "x",
86
105
  "attribute": "x",
87
106
  "description": "Set a specific x coordinate of dialog",
88
- "type": "string"
107
+ "type": "string | undefined"
89
108
  },
90
109
  {
91
110
  "name": "y",
92
111
  "attribute": "y",
93
112
  "description": "Set a specific y coordinate of dialog",
94
- "type": "string"
113
+ "type": "string | undefined"
95
114
  },
96
115
  {
97
116
  "name": "fullScreen",
117
+ "attribute": "full-screen",
98
118
  "description": "Set dialog to full screen",
99
- "type": "boolean"
119
+ "type": "boolean",
120
+ "default": "false"
100
121
  },
101
122
  {
102
123
  "name": "positionTarget",
124
+ "attribute": "position-target",
103
125
  "description": "Set position of dialog i.e. `top`, `right`, `left`, `bottom`, `center` or combination of theme e.g. `top right`.",
104
- "type": "string"
126
+ "type": "string | undefined"
105
127
  }
106
128
  ],
107
129
  "events": [
@@ -0,0 +1,47 @@
1
+ # ef-dialog
2
+
3
+ Popup window, designed to contain and show any HTML content.
4
+ It provides modal and dragging functionality,
5
+ and also allows custom footers and control buttons to be used.
6
+
7
+ ## Attributes
8
+
9
+ | Attribute | Type | Default | Description |
10
+ |------------------------|-----------------------|---------|--------------------------------------------------|
11
+ | `full-screen` | `boolean` | | Set dialog to full screen |
12
+ | `no-cancel-on-esc-key` | `boolean` | false | Prevents dialog to close when user presses ESC key |
13
+ | `position-target` | `string \| undefined` | | Set position of dialog i.e. `top`, `right`, `left`, `bottom`, `center` or combination of theme e.g. `top right`. |
14
+
15
+ ## Properties
16
+
17
+ | Property | Attribute | Type | Default | Description |
18
+ |--------------------------|------------------------|-----------------------|---------|--------------------------------------------------|
19
+ | `draggable` | `draggable` | `boolean` | false | Should the dialog be draggable |
20
+ | `fullScreen` | `full-screen` | `boolean` | false | Set dialog to full screen |
21
+ | `header` | `header` | `string \| null` | null | Set Header/Title of the dialog |
22
+ | `noCancelOnEscKey` | `no-cancel-on-esc-key` | `boolean` | false | Prevents dialog to close when user presses ESC key |
23
+ | `noCancelOnOutsideClick` | | `boolean` | true | Prevents dialog to close when user clicks outside the dialog. |
24
+ | `opened` | `opened` | `boolean` | false | Set dialog to open |
25
+ | `positionTarget` | `position-target` | `string \| undefined` | | Set position of dialog i.e. `top`, `right`, `left`, `bottom`, `center` or combination of theme e.g. `top right`. |
26
+ | `x` | `x` | `string \| undefined` | | Set a specific x coordinate of dialog |
27
+ | `y` | `y` | `string \| undefined` | | Set a specific y coordinate of dialog |
28
+
29
+ ## Methods
30
+
31
+ | Method | Type | Description |
32
+ |---------|------------|--------------------------------------------------|
33
+ | `refit` | `(): void` | Clear all cached values and fit the popup.<br />Use this function only if maxWidth, maxHeight, minWidth, minHeight, height, width are changed |
34
+
35
+ ## Events
36
+
37
+ | Event | Description |
38
+ |------------------|--------------------------------------------------|
39
+ | `cancel` | Fired when dialog is closed by user clicked a default Cancel button, clicked outside to close dialog or press ESC to close the dialog. Prevent default to stop default action |
40
+ | `confirm` | Fired when dialog is closed by user clicked a default OK button. Prevent default to stop default action |
41
+ | `opened-changed` | Fired when value of `opened` property is changed. Prevent default to stop default action |
42
+
43
+ ## Slots
44
+
45
+ | Name | Description |
46
+ |----------|--------------------------------------------------|
47
+ | `footer` | Hide default OK and Cancel button and replace dialog's footer with your custom content. |
@@ -1,12 +1,12 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { CSSResult, TemplateResult, ElementSize, PropertyValues } from '@refinitiv-ui/core';
3
- import { Overlay } from '../overlay';
4
- import '../icon';
5
- import '../panel';
6
- import '../header';
7
- import '../button';
2
+ import { CSSResultGroup, TemplateResult, ElementSize, PropertyValues } from '@refinitiv-ui/core';
3
+ import { Overlay } from '../overlay/index.js';
4
+ import '../icon/index.js';
5
+ import '../panel/index.js';
6
+ import '../header/index.js';
7
+ import '../button/index.js';
8
8
  import { Translate } from '@refinitiv-ui/translate';
9
- import '@refinitiv-ui/phrasebook/lib/locale/en/dialog';
9
+ import '@refinitiv-ui/phrasebook/lib/locale/en/dialog.js';
10
10
  /**
11
11
  * Popup window, designed to contain and show any HTML content.
12
12
  * It provides modal and dragging functionality,
@@ -20,17 +20,17 @@ import '@refinitiv-ui/phrasebook/lib/locale/en/dialog';
20
20
  * @attr {boolean} [no-cancel-on-esc-key=false] - Prevents dialog to close when user presses ESC key
21
21
  * @prop {boolean} [noCancelOnEscKey=false] - Prevents dialog to close when user presses ESC key
22
22
  *
23
- * @attr {string} x - Set a specific x coordinate of dialog
24
- * @prop {string} x - Set a specific x coordinate of dialog
23
+ * @attr {string | undefined} x - Set a specific x coordinate of dialog
24
+ * @prop {string | undefined} x - Set a specific x coordinate of dialog
25
25
  *
26
- * @attr {string} y - Set a specific y coordinate of dialog
27
- * @prop {string} y - Set a specific y coordinate of dialog
26
+ * @attr {string | undefined} y - Set a specific y coordinate of dialog
27
+ * @prop {string | undefined} y - Set a specific y coordinate of dialog
28
28
  *
29
29
  * @attr {boolean} full-screen - Set dialog to full screen
30
- * @prop {boolean} fullScreen - Set dialog to full screen
30
+ * @prop {boolean} [fullScreen=false] - Set dialog to full screen
31
31
  *
32
- * @attr {string} position-target - Set position of dialog i.e. `top`, `right`, `left`, `bottom`, `center` or combination of theme e.g. `top right`.
33
- * @prop {string} positionTarget - Set position of dialog i.e. `top`, `right`, `left`, `bottom`, `center` or combination of theme e.g. `top right`.
32
+ * @attr {string | undefined} position-target - Set position of dialog i.e. `top`, `right`, `left`, `bottom`, `center` or combination of theme e.g. `top right`.
33
+ * @prop {string | undefined} positionTarget - Set position of dialog i.e. `top`, `right`, `left`, `bottom`, `center` or combination of theme e.g. `top right`.
34
34
  *
35
35
  * @fires opened-changed - Fired when value of `opened` property is changed. Prevent default to stop default action
36
36
  * @fires confirm - Fired when dialog is closed by user clicked a default OK button. Prevent default to stop default action
@@ -45,12 +45,12 @@ export declare class Dialog extends Overlay {
45
45
  */
46
46
  static get version(): string;
47
47
  /**
48
- * A `CSSResult` that will be used
48
+ * A `CSSResultGroup` that will be used
49
49
  * to style the host, slotted children
50
50
  * and the internal template of the element.
51
- * @return {CSSResult | CSSResult[]} CSS template
51
+ * @returns CSS template
52
52
  */
53
- static get styles(): CSSResult | CSSResult[];
53
+ static get styles(): CSSResultGroup;
54
54
  /**
55
55
  * Set Header/Title of the dialog
56
56
  */
@@ -79,9 +79,6 @@ export declare class Dialog extends Overlay {
79
79
  * Footer Element
80
80
  */
81
81
  private footerElement;
82
- /**
83
- * @ignore
84
- */
85
82
  noCancelOnOutsideClick: boolean;
86
83
  /**
87
84
  * @ignore