@refinitiv-ui/elements 5.3.3 → 5.7.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.
Files changed (617) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/lib/accordion/custom-elements.json +49 -0
  3. package/lib/accordion/custom-elements.md +18 -0
  4. package/lib/accordion/index.d.ts +76 -0
  5. package/lib/accordion/index.js +136 -0
  6. package/lib/accordion/themes/halo/dark/index.js +3 -0
  7. package/lib/accordion/themes/halo/light/index.js +3 -0
  8. package/lib/accordion/themes/solar/charcoal/index.js +3 -0
  9. package/lib/accordion/themes/solar/pearl/index.js +3 -0
  10. package/lib/appstate-bar/custom-elements.json +49 -0
  11. package/lib/appstate-bar/custom-elements.md +22 -0
  12. package/lib/appstate-bar/index.d.ts +65 -0
  13. package/lib/appstate-bar/index.js +100 -0
  14. package/lib/appstate-bar/themes/halo/dark/index.js +3 -0
  15. package/lib/appstate-bar/themes/halo/light/index.js +3 -0
  16. package/lib/appstate-bar/themes/solar/charcoal/index.js +3 -0
  17. package/lib/appstate-bar/themes/solar/pearl/index.js +3 -0
  18. package/lib/autosuggest/custom-elements.json +233 -0
  19. package/lib/autosuggest/custom-elements.md +47 -0
  20. package/lib/autosuggest/helpers/types.d.ts +54 -0
  21. package/lib/autosuggest/helpers/types.js +1 -0
  22. package/lib/autosuggest/helpers/utils.d.ts +39 -0
  23. package/lib/autosuggest/helpers/utils.js +75 -0
  24. package/lib/autosuggest/index.d.ts +534 -0
  25. package/lib/autosuggest/index.js +1251 -0
  26. package/lib/autosuggest/themes/halo/dark/index.js +5 -0
  27. package/lib/autosuggest/themes/halo/light/index.js +5 -0
  28. package/lib/autosuggest/themes/solar/charcoal/index.js +5 -0
  29. package/lib/autosuggest/themes/solar/pearl/index.js +5 -0
  30. package/lib/button/custom-elements.json +119 -0
  31. package/lib/button/custom-elements.md +23 -0
  32. package/lib/button/index.d.ts +132 -0
  33. package/lib/button/index.js +223 -0
  34. package/lib/button/themes/halo/dark/index.js +3 -0
  35. package/lib/button/themes/halo/light/index.js +3 -0
  36. package/lib/button/themes/solar/charcoal/index.js +3 -0
  37. package/lib/button/themes/solar/pearl/index.js +3 -0
  38. package/lib/button-bar/custom-elements.json +26 -0
  39. package/lib/button-bar/custom-elements.md +9 -0
  40. package/lib/button-bar/index.d.ts +76 -0
  41. package/lib/button-bar/index.js +155 -0
  42. package/lib/button-bar/themes/halo/dark/index.js +3 -0
  43. package/lib/button-bar/themes/halo/light/index.js +3 -0
  44. package/lib/button-bar/themes/solar/charcoal/index.js +3 -0
  45. package/lib/button-bar/themes/solar/pearl/index.js +3 -0
  46. package/lib/calendar/constants.d.ts +22 -0
  47. package/lib/calendar/constants.js +23 -0
  48. package/lib/calendar/custom-elements.json +199 -0
  49. package/lib/calendar/custom-elements.md +35 -0
  50. package/lib/calendar/index.d.ts +321 -0
  51. package/lib/calendar/index.js +906 -0
  52. package/lib/calendar/locales.d.ts +1 -0
  53. package/lib/calendar/locales.js +40 -0
  54. package/lib/calendar/themes/halo/dark/index.js +3 -0
  55. package/lib/calendar/themes/halo/light/index.js +3 -0
  56. package/lib/calendar/themes/solar/charcoal/index.js +3 -0
  57. package/lib/calendar/themes/solar/pearl/index.js +3 -0
  58. package/lib/calendar/types.d.ts +29 -0
  59. package/lib/calendar/types.js +1 -0
  60. package/lib/calendar/utils.d.ts +42 -0
  61. package/lib/calendar/utils.js +119 -0
  62. package/lib/canvas/custom-elements.json +69 -0
  63. package/lib/canvas/custom-elements.md +27 -0
  64. package/lib/canvas/index.d.ts +100 -0
  65. package/lib/canvas/index.js +172 -0
  66. package/lib/canvas/themes/halo/dark/index.js +2 -0
  67. package/lib/canvas/themes/halo/light/index.js +2 -0
  68. package/lib/canvas/themes/solar/charcoal/index.js +2 -0
  69. package/lib/canvas/themes/solar/pearl/index.js +2 -0
  70. package/lib/card/custom-elements.json +59 -0
  71. package/lib/card/custom-elements.md +24 -0
  72. package/lib/card/helpers/types.d.ts +12 -0
  73. package/lib/card/helpers/types.js +1 -0
  74. package/lib/card/index.d.ts +140 -0
  75. package/lib/card/index.js +246 -0
  76. package/lib/card/themes/halo/dark/index.js +5 -0
  77. package/lib/card/themes/halo/light/index.js +5 -0
  78. package/lib/card/themes/solar/charcoal/index.js +5 -0
  79. package/lib/card/themes/solar/pearl/index.js +5 -0
  80. package/lib/chart/custom-elements.json +42 -0
  81. package/lib/chart/custom-elements.md +16 -0
  82. package/lib/chart/helpers/index.d.ts +2 -0
  83. package/lib/chart/helpers/index.js +2 -0
  84. package/lib/chart/helpers/legend.d.ts +5 -0
  85. package/lib/chart/helpers/legend.js +78 -0
  86. package/lib/chart/helpers/merge.d.ts +15 -0
  87. package/lib/chart/helpers/merge.js +28 -0
  88. package/lib/chart/helpers/types.d.ts +69 -0
  89. package/lib/chart/helpers/types.js +1 -0
  90. package/lib/chart/index.d.ts +187 -0
  91. package/lib/chart/index.js +491 -0
  92. package/lib/chart/plugins/doughnut-center-label.d.ts +3 -0
  93. package/lib/chart/plugins/doughnut-center-label.js +196 -0
  94. package/lib/chart/themes/halo/dark/index.js +4 -0
  95. package/lib/chart/themes/halo/light/index.js +4 -0
  96. package/lib/chart/themes/solar/charcoal/index.js +4 -0
  97. package/lib/chart/themes/solar/pearl/index.js +4 -0
  98. package/lib/checkbox/custom-elements.json +67 -0
  99. package/lib/checkbox/custom-elements.md +18 -0
  100. package/lib/checkbox/index.d.ts +95 -0
  101. package/lib/checkbox/index.js +193 -0
  102. package/lib/checkbox/themes/halo/dark/index.js +4 -0
  103. package/lib/checkbox/themes/halo/light/index.js +4 -0
  104. package/lib/checkbox/themes/solar/charcoal/index.js +4 -0
  105. package/lib/checkbox/themes/solar/pearl/index.js +4 -0
  106. package/lib/clock/custom-elements.json +121 -0
  107. package/lib/clock/custom-elements.md +28 -0
  108. package/lib/clock/index.d.ts +319 -0
  109. package/lib/clock/index.js +581 -0
  110. package/lib/clock/themes/halo/dark/index.js +2 -0
  111. package/lib/clock/themes/halo/light/index.js +2 -0
  112. package/lib/clock/themes/solar/charcoal/index.js +2 -0
  113. package/lib/clock/themes/solar/pearl/index.js +2 -0
  114. package/lib/clock/utils/TickManager.d.ts +14 -0
  115. package/lib/clock/utils/TickManager.js +66 -0
  116. package/lib/clock/utils/timestamps.d.ts +6 -0
  117. package/lib/clock/utils/timestamps.js +6 -0
  118. package/lib/collapse/custom-elements.json +79 -0
  119. package/lib/collapse/custom-elements.md +27 -0
  120. package/lib/collapse/index.d.ts +119 -0
  121. package/lib/collapse/index.js +197 -0
  122. package/lib/collapse/themes/halo/dark/index.js +5 -0
  123. package/lib/collapse/themes/halo/light/index.js +5 -0
  124. package/lib/collapse/themes/solar/charcoal/index.js +5 -0
  125. package/lib/collapse/themes/solar/pearl/index.js +5 -0
  126. package/lib/color-dialog/custom-elements.json +193 -0
  127. package/lib/color-dialog/custom-elements.md +39 -0
  128. package/lib/color-dialog/elements/color-palettes.d.ts +52 -0
  129. package/lib/color-dialog/elements/color-palettes.js +101 -0
  130. package/lib/color-dialog/elements/grayscale-palettes.d.ts +67 -0
  131. package/lib/color-dialog/elements/grayscale-palettes.js +161 -0
  132. package/lib/color-dialog/elements/palettes.d.ts +65 -0
  133. package/lib/color-dialog/elements/palettes.js +132 -0
  134. package/lib/color-dialog/helpers/color-helpers.d.ts +16 -0
  135. package/lib/color-dialog/helpers/color-helpers.js +161 -0
  136. package/lib/color-dialog/helpers/value-model.d.ts +75 -0
  137. package/lib/color-dialog/helpers/value-model.js +141 -0
  138. package/lib/color-dialog/index.d.ts +232 -0
  139. package/lib/color-dialog/index.js +459 -0
  140. package/lib/color-dialog/themes/halo/dark/index.js +7 -0
  141. package/lib/color-dialog/themes/halo/light/index.js +7 -0
  142. package/lib/color-dialog/themes/solar/charcoal/index.js +7 -0
  143. package/lib/color-dialog/themes/solar/pearl/index.js +7 -0
  144. package/lib/combo-box/custom-elements.json +210 -0
  145. package/lib/combo-box/custom-elements.md +35 -0
  146. package/lib/combo-box/helpers/filter.d.ts +10 -0
  147. package/lib/combo-box/helpers/filter.js +29 -0
  148. package/lib/combo-box/helpers/keyboard-event.d.ts +17 -0
  149. package/lib/combo-box/helpers/keyboard-event.js +19 -0
  150. package/lib/combo-box/helpers/types.d.ts +11 -0
  151. package/lib/combo-box/helpers/types.js +1 -0
  152. package/lib/combo-box/index.d.ts +523 -0
  153. package/lib/combo-box/index.js +1146 -0
  154. package/lib/combo-box/themes/halo/dark/index.js +8 -0
  155. package/lib/combo-box/themes/halo/light/index.js +8 -0
  156. package/lib/combo-box/themes/solar/charcoal/index.js +8 -0
  157. package/lib/combo-box/themes/solar/pearl/index.js +8 -0
  158. package/lib/counter/custom-elements.json +35 -0
  159. package/lib/counter/custom-elements.md +11 -0
  160. package/lib/counter/index.d.ts +89 -0
  161. package/lib/counter/index.js +152 -0
  162. package/lib/counter/themes/halo/dark/index.js +3 -0
  163. package/lib/counter/themes/halo/light/index.js +3 -0
  164. package/lib/counter/themes/solar/charcoal/index.js +3 -0
  165. package/lib/counter/themes/solar/pearl/index.js +3 -0
  166. package/lib/counter/utils.d.ts +13 -0
  167. package/lib/counter/utils.js +52 -0
  168. package/lib/datetime-picker/custom-elements.json +333 -0
  169. package/lib/datetime-picker/custom-elements.md +49 -0
  170. package/lib/datetime-picker/index.d.ts +498 -0
  171. package/lib/datetime-picker/index.js +1164 -0
  172. package/lib/datetime-picker/locales.d.ts +8 -0
  173. package/lib/datetime-picker/locales.js +57 -0
  174. package/lib/datetime-picker/themes/halo/dark/index.js +7 -0
  175. package/lib/datetime-picker/themes/halo/light/index.js +7 -0
  176. package/lib/datetime-picker/themes/solar/charcoal/index.js +7 -0
  177. package/lib/datetime-picker/themes/solar/pearl/index.js +7 -0
  178. package/lib/datetime-picker/types.d.ts +3 -0
  179. package/lib/datetime-picker/types.js +1 -0
  180. package/lib/datetime-picker/utils.d.ts +55 -0
  181. package/lib/datetime-picker/utils.js +92 -0
  182. package/lib/dialog/custom-elements.json +136 -0
  183. package/lib/dialog/custom-elements.md +47 -0
  184. package/lib/dialog/draggable-element.d.ts +14 -0
  185. package/lib/dialog/draggable-element.js +221 -0
  186. package/lib/dialog/index.d.ts +199 -0
  187. package/lib/dialog/index.js +331 -0
  188. package/lib/dialog/themes/halo/dark/index.js +7 -0
  189. package/lib/dialog/themes/halo/light/index.js +7 -0
  190. package/lib/dialog/themes/solar/charcoal/index.js +7 -0
  191. package/lib/dialog/themes/solar/pearl/index.js +7 -0
  192. package/lib/email-field/custom-elements.json +199 -0
  193. package/lib/email-field/custom-elements.md +35 -0
  194. package/lib/email-field/index.d.ts +152 -0
  195. package/lib/email-field/index.js +286 -0
  196. package/lib/email-field/themes/halo/dark/index.js +3 -0
  197. package/lib/email-field/themes/halo/light/index.js +3 -0
  198. package/lib/email-field/themes/solar/charcoal/index.js +3 -0
  199. package/lib/email-field/themes/solar/pearl/index.js +3 -0
  200. package/lib/events.d.ts +121 -0
  201. package/lib/events.js +1 -0
  202. package/lib/flag/custom-elements.json +35 -0
  203. package/lib/flag/custom-elements.md +10 -0
  204. package/lib/flag/index.d.ts +94 -0
  205. package/lib/flag/index.js +166 -0
  206. package/lib/flag/themes/halo/dark/index.js +2 -0
  207. package/lib/flag/themes/halo/light/index.js +2 -0
  208. package/lib/flag/themes/solar/charcoal/index.js +2 -0
  209. package/lib/flag/themes/solar/pearl/index.js +2 -0
  210. package/lib/flag/utils/FlagLoader.d.ts +47 -0
  211. package/lib/flag/utils/FlagLoader.js +86 -0
  212. package/lib/header/custom-elements.json +36 -0
  213. package/lib/header/custom-elements.md +18 -0
  214. package/lib/header/index.d.ts +46 -0
  215. package/lib/header/index.js +73 -0
  216. package/lib/header/themes/halo/dark/index.js +2 -0
  217. package/lib/header/themes/halo/light/index.js +2 -0
  218. package/lib/header/themes/solar/charcoal/index.js +2 -0
  219. package/lib/header/themes/solar/pearl/index.js +2 -0
  220. package/lib/heatmap/custom-elements.json +151 -0
  221. package/lib/heatmap/custom-elements.md +26 -0
  222. package/lib/heatmap/helpers/color.d.ts +30 -0
  223. package/lib/heatmap/helpers/color.js +68 -0
  224. package/lib/heatmap/helpers/text.d.ts +26 -0
  225. package/lib/heatmap/helpers/text.js +91 -0
  226. package/lib/heatmap/helpers/track.d.ts +102 -0
  227. package/lib/heatmap/helpers/track.js +160 -0
  228. package/lib/heatmap/helpers/types.d.ts +40 -0
  229. package/lib/heatmap/helpers/types.js +1 -0
  230. package/lib/heatmap/index.d.ts +453 -0
  231. package/lib/heatmap/index.js +1103 -0
  232. package/lib/heatmap/themes/halo/dark/index.js +4 -0
  233. package/lib/heatmap/themes/halo/light/index.js +4 -0
  234. package/lib/heatmap/themes/solar/charcoal/index.js +4 -0
  235. package/lib/heatmap/themes/solar/pearl/index.js +4 -0
  236. package/lib/icon/custom-elements.json +36 -0
  237. package/lib/icon/custom-elements.md +8 -0
  238. package/lib/icon/index.d.ts +88 -0
  239. package/lib/icon/index.js +169 -0
  240. package/lib/icon/themes/halo/dark/index.js +2 -0
  241. package/lib/icon/themes/halo/light/index.js +2 -0
  242. package/lib/icon/themes/solar/charcoal/index.js +2 -0
  243. package/lib/icon/themes/solar/pearl/index.js +2 -0
  244. package/lib/icon/utils/IconLoader.d.ts +52 -0
  245. package/lib/icon/utils/IconLoader.js +93 -0
  246. package/lib/index.d.ts +3 -0
  247. package/lib/index.js +3 -0
  248. package/lib/interactive-chart/custom-elements.json +86 -0
  249. package/lib/interactive-chart/custom-elements.md +32 -0
  250. package/lib/interactive-chart/helpers/merge.d.ts +15 -0
  251. package/lib/interactive-chart/helpers/merge.js +28 -0
  252. package/lib/interactive-chart/helpers/types.d.ts +45 -0
  253. package/lib/interactive-chart/helpers/types.js +6 -0
  254. package/lib/interactive-chart/index.d.ts +380 -0
  255. package/lib/interactive-chart/index.js +1090 -0
  256. package/lib/interactive-chart/themes/halo/dark/index.js +3 -0
  257. package/lib/interactive-chart/themes/halo/light/index.js +3 -0
  258. package/lib/interactive-chart/themes/solar/charcoal/index.js +3 -0
  259. package/lib/interactive-chart/themes/solar/pearl/index.js +3 -0
  260. package/lib/item/custom-elements.json +151 -0
  261. package/lib/item/custom-elements.md +29 -0
  262. package/lib/item/helpers/types.d.ts +57 -0
  263. package/lib/item/helpers/types.js +1 -0
  264. package/lib/item/index.d.ts +158 -0
  265. package/lib/item/index.js +271 -0
  266. package/lib/item/themes/halo/dark/index.js +4 -0
  267. package/lib/item/themes/halo/light/index.js +4 -0
  268. package/lib/item/themes/solar/charcoal/index.js +4 -0
  269. package/lib/item/themes/solar/pearl/index.js +4 -0
  270. package/lib/jsx.d.ts +223 -0
  271. package/lib/label/custom-elements.json +52 -0
  272. package/lib/label/custom-elements.md +11 -0
  273. package/lib/label/index.d.ts +102 -0
  274. package/lib/label/index.js +244 -0
  275. package/lib/label/themes/halo/dark/index.js +3 -0
  276. package/lib/label/themes/halo/light/index.js +3 -0
  277. package/lib/label/themes/solar/charcoal/index.js +3 -0
  278. package/lib/label/themes/solar/pearl/index.js +3 -0
  279. package/lib/layout/custom-elements.json +163 -0
  280. package/lib/layout/custom-elements.md +26 -0
  281. package/lib/layout/index.d.ts +107 -0
  282. package/lib/layout/index.js +212 -0
  283. package/lib/layout/themes/halo/dark/index.js +2 -0
  284. package/lib/layout/themes/halo/light/index.js +2 -0
  285. package/lib/layout/themes/solar/charcoal/index.js +2 -0
  286. package/lib/layout/themes/solar/pearl/index.js +2 -0
  287. package/lib/led-gauge/custom-elements.json +113 -0
  288. package/lib/led-gauge/custom-elements.md +17 -0
  289. package/lib/led-gauge/index.d.ts +143 -0
  290. package/lib/led-gauge/index.js +437 -0
  291. package/lib/led-gauge/themes/halo/dark/index.js +3 -0
  292. package/lib/led-gauge/themes/halo/light/index.js +3 -0
  293. package/lib/led-gauge/themes/solar/charcoal/index.js +3 -0
  294. package/lib/led-gauge/themes/solar/pearl/index.js +3 -0
  295. package/lib/list/custom-elements.json +111 -0
  296. package/lib/list/custom-elements.md +30 -0
  297. package/lib/list/extensible-function.d.ts +8 -0
  298. package/lib/list/extensible-function.js +13 -0
  299. package/lib/list/helpers/list-renderer.d.ts +9 -0
  300. package/lib/list/helpers/list-renderer.js +35 -0
  301. package/lib/list/helpers/types.d.ts +3 -0
  302. package/lib/list/helpers/types.js +1 -0
  303. package/lib/list/index.d.ts +292 -0
  304. package/lib/list/index.js +600 -0
  305. package/lib/list/renderer.d.ts +36 -0
  306. package/lib/list/renderer.js +9 -0
  307. package/lib/list/themes/halo/dark/index.js +3 -0
  308. package/lib/list/themes/halo/light/index.js +3 -0
  309. package/lib/list/themes/solar/charcoal/index.js +3 -0
  310. package/lib/list/themes/solar/pearl/index.js +3 -0
  311. package/lib/loader/custom-elements.json +9 -0
  312. package/lib/loader/custom-elements.md +5 -0
  313. package/lib/loader/index.d.ts +41 -0
  314. package/lib/loader/index.js +61 -0
  315. package/lib/loader/themes/halo/dark/index.js +2 -0
  316. package/lib/loader/themes/halo/light/index.js +2 -0
  317. package/lib/loader/themes/solar/charcoal/index.js +2 -0
  318. package/lib/loader/themes/solar/pearl/index.js +2 -0
  319. package/lib/multi-input/custom-elements.json +238 -0
  320. package/lib/multi-input/custom-elements.md +43 -0
  321. package/lib/multi-input/helpers/types.d.ts +11 -0
  322. package/lib/multi-input/helpers/types.js +1 -0
  323. package/lib/multi-input/index.d.ts +297 -0
  324. package/lib/multi-input/index.js +590 -0
  325. package/lib/multi-input/themes/halo/dark/index.js +4 -0
  326. package/lib/multi-input/themes/halo/light/index.js +4 -0
  327. package/lib/multi-input/themes/solar/charcoal/index.js +4 -0
  328. package/lib/multi-input/themes/solar/pearl/index.js +4 -0
  329. package/lib/notification/custom-elements.json +95 -0
  330. package/lib/notification/custom-elements.md +26 -0
  331. package/lib/notification/elements/notification-tray.d.ts +97 -0
  332. package/lib/notification/elements/notification-tray.js +167 -0
  333. package/lib/notification/elements/notification.d.ts +90 -0
  334. package/lib/notification/elements/notification.js +154 -0
  335. package/lib/notification/helpers/status.d.ts +30 -0
  336. package/lib/notification/helpers/status.js +130 -0
  337. package/lib/notification/helpers/types.d.ts +10 -0
  338. package/lib/notification/helpers/types.js +1 -0
  339. package/lib/notification/index.d.ts +2 -0
  340. package/lib/notification/index.js +2 -0
  341. package/lib/notification/themes/halo/dark/index.js +5 -0
  342. package/lib/notification/themes/halo/light/index.js +5 -0
  343. package/lib/notification/themes/solar/charcoal/index.js +5 -0
  344. package/lib/notification/themes/solar/pearl/index.js +5 -0
  345. package/lib/number-field/custom-elements.json +200 -0
  346. package/lib/number-field/custom-elements.md +37 -0
  347. package/lib/number-field/index.d.ts +294 -0
  348. package/lib/number-field/index.js +707 -0
  349. package/lib/number-field/themes/halo/dark/index.js +3 -0
  350. package/lib/number-field/themes/halo/light/index.js +3 -0
  351. package/lib/number-field/themes/solar/charcoal/index.js +3 -0
  352. package/lib/number-field/themes/solar/pearl/index.js +3 -0
  353. package/lib/overlay/custom-elements.json +345 -0
  354. package/lib/overlay/custom-elements.md +54 -0
  355. package/lib/overlay/elements/overlay-backdrop.d.ts +46 -0
  356. package/lib/overlay/elements/overlay-backdrop.js +64 -0
  357. package/lib/overlay/elements/overlay-viewport.d.ts +40 -0
  358. package/lib/overlay/elements/overlay-viewport.js +52 -0
  359. package/lib/overlay/elements/overlay.d.ts +403 -0
  360. package/lib/overlay/elements/overlay.js +1426 -0
  361. package/lib/overlay/helpers/functions.d.ts +13 -0
  362. package/lib/overlay/helpers/functions.js +16 -0
  363. package/lib/overlay/helpers/types.d.ts +97 -0
  364. package/lib/overlay/helpers/types.js +16 -0
  365. package/lib/overlay/index.d.ts +2 -0
  366. package/lib/overlay/index.js +1 -0
  367. package/lib/overlay/managers/backdrop-manager.d.ts +45 -0
  368. package/lib/overlay/managers/backdrop-manager.js +96 -0
  369. package/lib/overlay/managers/close-manager.d.ts +54 -0
  370. package/lib/overlay/managers/close-manager.js +138 -0
  371. package/lib/overlay/managers/focus-manager.d.ts +71 -0
  372. package/lib/overlay/managers/focus-manager.js +228 -0
  373. package/lib/overlay/managers/interaction-lock-manager.d.ts +138 -0
  374. package/lib/overlay/managers/interaction-lock-manager.js +375 -0
  375. package/lib/overlay/managers/viewport-manager.d.ts +93 -0
  376. package/lib/overlay/managers/viewport-manager.js +211 -0
  377. package/lib/overlay/managers/zindex-manager.d.ts +80 -0
  378. package/lib/overlay/managers/zindex-manager.js +195 -0
  379. package/lib/overlay/themes/halo/dark/index.js +4 -0
  380. package/lib/overlay/themes/halo/light/index.js +4 -0
  381. package/lib/overlay/themes/solar/charcoal/index.js +4 -0
  382. package/lib/overlay/themes/solar/pearl/index.js +4 -0
  383. package/lib/overlay-menu/custom-elements.json +194 -0
  384. package/lib/overlay-menu/custom-elements.md +44 -0
  385. package/lib/overlay-menu/helpers/types.d.ts +8 -0
  386. package/lib/overlay-menu/helpers/types.js +1 -0
  387. package/lib/overlay-menu/index.d.ts +385 -0
  388. package/lib/overlay-menu/index.js +933 -0
  389. package/lib/overlay-menu/managers/menu-manager.d.ts +98 -0
  390. package/lib/overlay-menu/managers/menu-manager.js +240 -0
  391. package/lib/overlay-menu/themes/halo/dark/index.js +5 -0
  392. package/lib/overlay-menu/themes/halo/light/index.js +5 -0
  393. package/lib/overlay-menu/themes/solar/charcoal/index.js +5 -0
  394. package/lib/overlay-menu/themes/solar/pearl/index.js +5 -0
  395. package/lib/pagination/custom-elements.json +93 -0
  396. package/lib/pagination/custom-elements.md +27 -0
  397. package/lib/pagination/helpers/types.d.ts +9 -0
  398. package/lib/pagination/helpers/types.js +1 -0
  399. package/lib/pagination/index.d.ts +207 -0
  400. package/lib/pagination/index.js +398 -0
  401. package/lib/pagination/themes/halo/dark/index.js +6 -0
  402. package/lib/pagination/themes/halo/light/index.js +6 -0
  403. package/lib/pagination/themes/solar/charcoal/index.js +6 -0
  404. package/lib/pagination/themes/solar/pearl/index.js +6 -0
  405. package/lib/panel/custom-elements.json +39 -0
  406. package/lib/panel/custom-elements.md +11 -0
  407. package/lib/panel/index.d.ts +48 -0
  408. package/lib/panel/index.js +74 -0
  409. package/lib/panel/themes/halo/dark/index.js +2 -0
  410. package/lib/panel/themes/halo/light/index.js +2 -0
  411. package/lib/panel/themes/solar/charcoal/index.js +2 -0
  412. package/lib/panel/themes/solar/pearl/index.js +2 -0
  413. package/lib/password-field/custom-elements.json +156 -0
  414. package/lib/password-field/custom-elements.md +31 -0
  415. package/lib/password-field/index.d.ts +141 -0
  416. package/lib/password-field/index.js +258 -0
  417. package/lib/password-field/themes/halo/dark/index.js +3 -0
  418. package/lib/password-field/themes/halo/light/index.js +3 -0
  419. package/lib/password-field/themes/solar/charcoal/index.js +3 -0
  420. package/lib/password-field/themes/solar/pearl/index.js +3 -0
  421. package/lib/pill/custom-elements.json +95 -0
  422. package/lib/pill/custom-elements.md +22 -0
  423. package/lib/pill/index.d.ts +97 -0
  424. package/lib/pill/index.js +160 -0
  425. package/lib/pill/themes/halo/dark/index.js +3 -0
  426. package/lib/pill/themes/halo/light/index.js +3 -0
  427. package/lib/pill/themes/solar/charcoal/index.js +3 -0
  428. package/lib/pill/themes/solar/pearl/index.js +3 -0
  429. package/lib/progress-bar/custom-elements.json +58 -0
  430. package/lib/progress-bar/custom-elements.md +18 -0
  431. package/lib/progress-bar/index.d.ts +82 -0
  432. package/lib/progress-bar/index.js +157 -0
  433. package/lib/progress-bar/themes/halo/dark/index.js +2 -0
  434. package/lib/progress-bar/themes/halo/light/index.js +2 -0
  435. package/lib/progress-bar/themes/solar/charcoal/index.js +2 -0
  436. package/lib/progress-bar/themes/solar/pearl/index.js +2 -0
  437. package/lib/radio-button/custom-elements.json +82 -0
  438. package/lib/radio-button/custom-elements.md +19 -0
  439. package/lib/radio-button/index.d.ts +122 -0
  440. package/lib/radio-button/index.js +257 -0
  441. package/lib/radio-button/radio-button-registry.d.ts +22 -0
  442. package/lib/radio-button/radio-button-registry.js +93 -0
  443. package/lib/radio-button/themes/halo/dark/index.js +3 -0
  444. package/lib/radio-button/themes/halo/light/index.js +3 -0
  445. package/lib/radio-button/themes/solar/charcoal/index.js +3 -0
  446. package/lib/radio-button/themes/solar/pearl/index.js +3 -0
  447. package/lib/rating/custom-elements.json +58 -0
  448. package/lib/rating/custom-elements.md +17 -0
  449. package/lib/rating/index.d.ts +91 -0
  450. package/lib/rating/index.js +157 -0
  451. package/lib/rating/themes/halo/dark/index.js +2 -0
  452. package/lib/rating/themes/halo/light/index.js +2 -0
  453. package/lib/rating/themes/solar/charcoal/index.js +2 -0
  454. package/lib/rating/themes/solar/pearl/index.js +2 -0
  455. package/lib/search-field/custom-elements.json +173 -0
  456. package/lib/search-field/custom-elements.md +33 -0
  457. package/lib/search-field/index.d.ts +134 -0
  458. package/lib/search-field/index.js +253 -0
  459. package/lib/search-field/themes/halo/dark/index.js +3 -0
  460. package/lib/search-field/themes/halo/light/index.js +3 -0
  461. package/lib/search-field/themes/solar/charcoal/index.js +3 -0
  462. package/lib/search-field/themes/solar/pearl/index.js +3 -0
  463. package/lib/select/custom-elements.json +103 -0
  464. package/lib/select/custom-elements.md +24 -0
  465. package/lib/select/helpers/types.d.ts +3 -0
  466. package/lib/select/helpers/types.js +1 -0
  467. package/lib/select/index.d.ts +388 -0
  468. package/lib/select/index.js +942 -0
  469. package/lib/select/themes/halo/dark/index.js +5 -0
  470. package/lib/select/themes/halo/light/index.js +5 -0
  471. package/lib/select/themes/solar/charcoal/index.js +5 -0
  472. package/lib/select/themes/solar/pearl/index.js +5 -0
  473. package/lib/sidebar-layout/custom-elements.json +72 -0
  474. package/lib/sidebar-layout/custom-elements.md +22 -0
  475. package/lib/sidebar-layout/index.d.ts +69 -0
  476. package/lib/sidebar-layout/index.js +134 -0
  477. package/lib/sidebar-layout/themes/halo/dark/index.js +3 -0
  478. package/lib/sidebar-layout/themes/halo/light/index.js +3 -0
  479. package/lib/sidebar-layout/themes/solar/charcoal/index.js +3 -0
  480. package/lib/sidebar-layout/themes/solar/pearl/index.js +3 -0
  481. package/lib/slider/custom-elements.json +181 -0
  482. package/lib/slider/custom-elements.md +28 -0
  483. package/lib/slider/index.d.ts +409 -0
  484. package/lib/slider/index.js +1187 -0
  485. package/lib/slider/themes/halo/dark/index.js +3 -0
  486. package/lib/slider/themes/halo/light/index.js +3 -0
  487. package/lib/slider/themes/solar/charcoal/index.js +3 -0
  488. package/lib/slider/themes/solar/pearl/index.js +3 -0
  489. package/lib/sparkline/custom-elements.json +59 -0
  490. package/lib/sparkline/custom-elements.md +16 -0
  491. package/lib/sparkline/index.d.ts +107 -0
  492. package/lib/sparkline/index.js +186 -0
  493. package/lib/sparkline/themes/halo/dark/index.js +2 -0
  494. package/lib/sparkline/themes/halo/light/index.js +2 -0
  495. package/lib/sparkline/themes/solar/charcoal/index.js +2 -0
  496. package/lib/sparkline/themes/solar/pearl/index.js +2 -0
  497. package/lib/swing-gauge/const.d.ts +22 -0
  498. package/lib/swing-gauge/const.js +26 -0
  499. package/lib/swing-gauge/custom-elements.json +109 -0
  500. package/lib/swing-gauge/custom-elements.md +17 -0
  501. package/lib/swing-gauge/helpers.d.ts +8 -0
  502. package/lib/swing-gauge/helpers.js +105 -0
  503. package/lib/swing-gauge/index.d.ts +294 -0
  504. package/lib/swing-gauge/index.js +762 -0
  505. package/lib/swing-gauge/themes/halo/dark/index.js +3 -0
  506. package/lib/swing-gauge/themes/halo/light/index.js +3 -0
  507. package/lib/swing-gauge/themes/solar/charcoal/index.js +3 -0
  508. package/lib/swing-gauge/themes/solar/pearl/index.js +3 -0
  509. package/lib/swing-gauge/types.d.ts +34 -0
  510. package/lib/swing-gauge/types.js +1 -0
  511. package/lib/tab/custom-elements.json +123 -0
  512. package/lib/tab/custom-elements.md +22 -0
  513. package/lib/tab/index.d.ts +118 -0
  514. package/lib/tab/index.js +208 -0
  515. package/lib/tab/themes/halo/dark/index.js +4 -0
  516. package/lib/tab/themes/halo/light/index.js +4 -0
  517. package/lib/tab/themes/solar/charcoal/index.js +4 -0
  518. package/lib/tab/themes/solar/pearl/index.js +4 -0
  519. package/lib/tab-bar/custom-elements.json +52 -0
  520. package/lib/tab-bar/custom-elements.md +11 -0
  521. package/lib/tab-bar/helpers/animate.d.ts +16 -0
  522. package/lib/tab-bar/helpers/animate.js +53 -0
  523. package/lib/tab-bar/index.d.ts +108 -0
  524. package/lib/tab-bar/index.js +218 -0
  525. package/lib/tab-bar/themes/halo/dark/index.js +4 -0
  526. package/lib/tab-bar/themes/halo/light/index.js +4 -0
  527. package/lib/tab-bar/themes/solar/charcoal/index.js +4 -0
  528. package/lib/tab-bar/themes/solar/pearl/index.js +4 -0
  529. package/lib/text-field/custom-elements.json +210 -0
  530. package/lib/text-field/custom-elements.md +37 -0
  531. package/lib/text-field/index.d.ts +193 -0
  532. package/lib/text-field/index.js +409 -0
  533. package/lib/text-field/themes/halo/dark/index.js +3 -0
  534. package/lib/text-field/themes/halo/light/index.js +3 -0
  535. package/lib/text-field/themes/solar/charcoal/index.js +3 -0
  536. package/lib/text-field/themes/solar/pearl/index.js +3 -0
  537. package/lib/time-picker/custom-elements.json +124 -0
  538. package/lib/time-picker/custom-elements.md +28 -0
  539. package/lib/time-picker/index.d.ts +379 -0
  540. package/lib/time-picker/index.js +775 -0
  541. package/lib/time-picker/themes/halo/dark/index.js +4 -0
  542. package/lib/time-picker/themes/halo/light/index.js +4 -0
  543. package/lib/time-picker/themes/solar/charcoal/index.js +4 -0
  544. package/lib/time-picker/themes/solar/pearl/index.js +4 -0
  545. package/lib/toggle/custom-elements.json +82 -0
  546. package/lib/toggle/custom-elements.md +19 -0
  547. package/lib/toggle/index.d.ts +86 -0
  548. package/lib/toggle/index.js +152 -0
  549. package/lib/toggle/themes/halo/dark/index.js +2 -0
  550. package/lib/toggle/themes/halo/light/index.js +2 -0
  551. package/lib/toggle/themes/solar/charcoal/index.js +2 -0
  552. package/lib/toggle/themes/solar/pearl/index.js +2 -0
  553. package/lib/tooltip/custom-elements.json +62 -0
  554. package/lib/tooltip/custom-elements.md +14 -0
  555. package/lib/tooltip/elements/title-tooltip.d.ts +1 -0
  556. package/lib/tooltip/elements/title-tooltip.js +18 -0
  557. package/lib/tooltip/elements/tooltip-element.d.ts +21 -0
  558. package/lib/tooltip/elements/tooltip-element.js +54 -0
  559. package/lib/tooltip/helpers/overflow-tooltip.d.ts +9 -0
  560. package/lib/tooltip/helpers/overflow-tooltip.js +19 -0
  561. package/lib/tooltip/helpers/renderer.d.ts +8 -0
  562. package/lib/tooltip/helpers/renderer.js +11 -0
  563. package/lib/tooltip/helpers/types.d.ts +23 -0
  564. package/lib/tooltip/helpers/types.js +1 -0
  565. package/lib/tooltip/index.d.ts +232 -0
  566. package/lib/tooltip/index.js +477 -0
  567. package/lib/tooltip/managers/tooltip-manager.d.ts +15 -0
  568. package/lib/tooltip/managers/tooltip-manager.js +140 -0
  569. package/lib/tooltip/themes/halo/dark/index.js +3 -0
  570. package/lib/tooltip/themes/halo/light/index.js +3 -0
  571. package/lib/tooltip/themes/solar/charcoal/index.js +3 -0
  572. package/lib/tooltip/themes/solar/pearl/index.js +3 -0
  573. package/lib/tornado-chart/custom-elements.json +45 -0
  574. package/lib/tornado-chart/custom-elements.md +18 -0
  575. package/lib/tornado-chart/elements/tornado-chart.d.ts +78 -0
  576. package/lib/tornado-chart/elements/tornado-chart.js +122 -0
  577. package/lib/tornado-chart/elements/tornado-item.d.ts +110 -0
  578. package/lib/tornado-chart/elements/tornado-item.js +207 -0
  579. package/lib/tornado-chart/index.d.ts +2 -0
  580. package/lib/tornado-chart/index.js +2 -0
  581. package/lib/tornado-chart/themes/halo/dark/index.js +6 -0
  582. package/lib/tornado-chart/themes/halo/light/index.js +6 -0
  583. package/lib/tornado-chart/themes/solar/charcoal/index.js +6 -0
  584. package/lib/tornado-chart/themes/solar/pearl/index.js +6 -0
  585. package/lib/tree/custom-elements.json +113 -0
  586. package/lib/tree/custom-elements.md +32 -0
  587. package/lib/tree/elements/tree-item.d.ts +96 -0
  588. package/lib/tree/elements/tree-item.js +179 -0
  589. package/lib/tree/elements/tree.d.ts +201 -0
  590. package/lib/tree/elements/tree.js +412 -0
  591. package/lib/tree/helpers/filter.d.ts +8 -0
  592. package/lib/tree/helpers/filter.js +33 -0
  593. package/lib/tree/helpers/renderer.d.ts +5 -0
  594. package/lib/tree/helpers/renderer.js +33 -0
  595. package/lib/tree/helpers/types.d.ts +25 -0
  596. package/lib/tree/helpers/types.js +1 -0
  597. package/lib/tree/index.d.ts +4 -0
  598. package/lib/tree/index.js +3 -0
  599. package/lib/tree/managers/tree-manager.d.ts +248 -0
  600. package/lib/tree/managers/tree-manager.js +395 -0
  601. package/lib/tree/themes/halo/dark/index.js +7 -0
  602. package/lib/tree/themes/halo/light/index.js +7 -0
  603. package/lib/tree/themes/solar/charcoal/index.js +7 -0
  604. package/lib/tree/themes/solar/pearl/index.js +7 -0
  605. package/lib/tree-select/custom-elements.json +107 -0
  606. package/lib/tree-select/custom-elements.md +26 -0
  607. package/lib/tree-select/helpers/types.d.ts +4 -0
  608. package/lib/tree-select/helpers/types.js +1 -0
  609. package/lib/tree-select/index.d.ts +402 -0
  610. package/lib/tree-select/index.js +890 -0
  611. package/lib/tree-select/themes/halo/dark/index.js +12 -0
  612. package/lib/tree-select/themes/halo/light/index.js +12 -0
  613. package/lib/tree-select/themes/solar/charcoal/index.js +12 -0
  614. package/lib/tree-select/themes/solar/pearl/index.js +12 -0
  615. package/lib/version.d.ts +1 -0
  616. package/lib/version.js +1 -0
  617. package/package.json +298 -15
@@ -0,0 +1,1164 @@
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';
13
+ import { translate, getLocale, TranslatePropertyKey } from '@refinitiv-ui/translate';
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';
21
+ preload('calendar', 'down', 'left', 'right'); /* preload calendar icons for faster loading */
22
+ const POPUP_POSITION = ['bottom-start', 'top-start', 'bottom-end', 'top-end', 'bottom-middle', 'top-middle'];
23
+ const INPUT_FORMAT = {
24
+ DATE: 'dd-MMM-yyyy',
25
+ DATETIME: 'dd-MMM-yyyy HH:mm',
26
+ DATETIME_AM_PM: 'dd-MMM-yyyy hh:mm aaa',
27
+ DATETIME_SECONDS: 'dd-MMM-yyyy HH:mm:ss',
28
+ DATETIME_SECONDS_AM_PM: 'dd-MMM-yyyy hh:mm:ss aaa'
29
+ };
30
+ /**
31
+ * Control to pick date and time
32
+ *
33
+ * @fires opened-changed - Dispatched when when opened attribute changes internally
34
+ * @fires value-changed - Dispatched when value changes
35
+ * @fires error-changed - Dispatched when error state changes
36
+ * @fires view-changed - Dispatched when internal view changes
37
+ *
38
+ * @attr {boolean} readonly - Set readonly state
39
+ * @prop {boolean} [readonly=false] - Set readonly state
40
+ *
41
+ * @attr {boolean} disabled - Set disabled state
42
+ * @prop {boolean} [disabled=false] - Set disabled state
43
+ *
44
+ * @slots header - Header slot
45
+ * @slots right - Right slot
46
+ * @slots footer - Footer slot
47
+ * @slots left - Left slot
48
+ */
49
+ let DatetimePicker = class DatetimePicker extends ControlElement {
50
+ constructor() {
51
+ super(...arguments);
52
+ this.lazyRendered = false; /* speed up rendering by not populating popup window on first load */
53
+ this.calendarValues = []; /* used to store date information for calendars */
54
+ this.timepickerValues = []; /* used to store time information for timepickers */
55
+ this.inputValues = []; /* used to formatted datetime value for inputs */
56
+ this.inputSyncing = true; /* true when inputs and pickers are in sync. False while user types in input */
57
+ this._min = '';
58
+ this.minDate = '';
59
+ this._max = '';
60
+ this.maxDate = '';
61
+ /**
62
+ * Only enable weekdays
63
+ */
64
+ this.weekdaysOnly = false;
65
+ /**
66
+ * Only enable weekends
67
+ */
68
+ this.weekendsOnly = false;
69
+ /**
70
+ * Custom filter, used for enabling/disabling certain dates
71
+ * @type {DatetimePickerFilter | null}
72
+ */
73
+ this.filter = null;
74
+ /**
75
+ * Set to switch to range select mode
76
+ */
77
+ this.range = false;
78
+ this._values = []; /* list of values as passed by the user */
79
+ this._segments = []; /* filtered and processed list of values */
80
+ /**
81
+ * Toggles 12hr time display
82
+ */
83
+ this.amPm = false;
84
+ /**
85
+ * Flag to show seconds time segment in display.
86
+ * Seconds are automatically shown when `hh:mm:ss` time format is provided as a value.
87
+ */
88
+ this.showSeconds = false;
89
+ this._placeholder = '';
90
+ /**
91
+ * Toggles the opened state of the list
92
+ */
93
+ this.opened = false;
94
+ /**
95
+ * Set state to error
96
+ */
97
+ this.error = false;
98
+ /**
99
+ * Set state to warning
100
+ */
101
+ this.warning = false;
102
+ /**
103
+ * Only open picker panel when calendar icon is clicked.
104
+ * Clicking on the input will no longer open the picker.
105
+ */
106
+ this.inputTriggerDisabled = false;
107
+ /**
108
+ * Disable input part of the picker
109
+ */
110
+ this.inputDisabled = false;
111
+ /**
112
+ * Disable the popup
113
+ */
114
+ this.popupDisabled = false;
115
+ this._format = '';
116
+ /**
117
+ * Toggle to display the time picker
118
+ */
119
+ this.timepicker = false;
120
+ /**
121
+ * Display two calendar pickers.
122
+ * @type {"" | "consecutive" | "split"}
123
+ */
124
+ this.duplex = null;
125
+ this._views = [];
126
+ this._interimSegments = [];
127
+ }
128
+ /**
129
+ * Element version number
130
+ * @returns version number
131
+ */
132
+ static get version() {
133
+ return VERSION;
134
+ }
135
+ /**
136
+ * A `CSSResultGroup` that will be used
137
+ * to style the host, slotted children
138
+ * and the internal template of the element.
139
+ * @return CSS template
140
+ */
141
+ static get styles() {
142
+ return css `
143
+ :host {
144
+ display: inline-block;
145
+ height: 48px;
146
+ outline: none;
147
+ cursor: text;
148
+ }
149
+ [part=input-wrapper] {
150
+ display: flex;
151
+ flex: 1;
152
+ }
153
+ [part=body] {
154
+ display: flex;
155
+ }
156
+ [part=timepicker-wrapper] {
157
+ display: flex;
158
+ justify-content: space-between;
159
+ }
160
+ [part=timepicker-wrapper]:before,
161
+ [part=timepicker-wrapper]:after {
162
+ content: '';
163
+ }
164
+ [part=input] {
165
+ flex: 1;
166
+ width: auto;
167
+ height: auto;
168
+ padding: 0;
169
+ margin: 0;
170
+ }
171
+ [part=calendar-wrapper] {
172
+ display: inline-flex;
173
+ }
174
+ [part=icon] {
175
+ cursor: pointer;
176
+ }
177
+ :host([popup-disabled]) [part=icon], :host([readonly]) [part=icon] {
178
+ pointer-event: none;
179
+ }
180
+ `;
181
+ }
182
+ /**
183
+ * Set minimum date
184
+ * @param min date
185
+ */
186
+ set min(min) {
187
+ if (!this.isValidValue(min)) {
188
+ this.warnInvalidValue(min);
189
+ min = '';
190
+ }
191
+ const oldMin = this.min;
192
+ if (oldMin !== min) {
193
+ this._min = min;
194
+ this.minDate = min ? format(parse(min), DateFormat.yyyyMMdd) : '';
195
+ this.requestUpdate('min', oldMin);
196
+ }
197
+ }
198
+ get min() {
199
+ return this._min;
200
+ }
201
+ /**
202
+ * Set maximum date
203
+ * @param max date
204
+ */
205
+ set max(max) {
206
+ if (!this.isValidValue(max)) {
207
+ this.warnInvalidValue(max);
208
+ max = '';
209
+ }
210
+ const oldMax = this.max;
211
+ if (oldMax !== max) {
212
+ this._max = max;
213
+ this.maxDate = max ? format(parse(max), DateFormat.yyyyMMdd) : '';
214
+ this.requestUpdate('max', oldMax);
215
+ }
216
+ }
217
+ get max() {
218
+ return this._max;
219
+ }
220
+ /**
221
+ * Set to switch to multiple select mode
222
+ * @ignore
223
+ * @param multiple Multiple
224
+ */
225
+ /* istanbul ignore next */
226
+ set multiple(multiple) {
227
+ new WarningNotice('multiple is not currently supported').show();
228
+ }
229
+ get multiple() {
230
+ return false;
231
+ }
232
+ /**
233
+ * Current date time value
234
+ * @param value Calendar value
235
+ */
236
+ set value(value) {
237
+ this.values = value ? [value] : [];
238
+ }
239
+ get value() {
240
+ return this.values[0] || '';
241
+ }
242
+ /**
243
+ * Set multiple selected values
244
+ * @param values Values to set
245
+ * @type {string[]}
246
+ */
247
+ set values(values) {
248
+ const oldValues = this._values;
249
+ if (String(oldValues) !== String(values)) {
250
+ this._values = values;
251
+ this.valuesToSegments();
252
+ this.requestUpdate('_values', oldValues); /* segments are populated in update */
253
+ }
254
+ }
255
+ get values() {
256
+ return this._segments.map(segment => segment.value);
257
+ }
258
+ /**
259
+ * Placeholder to display when no value is set
260
+ * @param placeholder Placeholder
261
+ */
262
+ set placeholder(placeholder) {
263
+ const oldPlaceholder = this._placeholder;
264
+ if (oldPlaceholder !== placeholder) {
265
+ this._placeholder = placeholder;
266
+ this.requestUpdate('placeholder', oldPlaceholder);
267
+ }
268
+ }
269
+ get placeholder() {
270
+ return this._placeholder || this.format;
271
+ }
272
+ /**
273
+ * Set the datetime format
274
+ * Based on dane-fns datetime formats
275
+ * @param format Date format
276
+ */
277
+ set format(format) {
278
+ const oldFormat = this._format;
279
+ if (oldFormat !== format) {
280
+ this._format = format;
281
+ this.requestUpdate('format', oldFormat);
282
+ }
283
+ }
284
+ get format() {
285
+ return this._format || (this.timepicker
286
+ ? (this.showSeconds
287
+ ? (this.amPm ? INPUT_FORMAT.DATETIME_SECONDS_AM_PM : INPUT_FORMAT.DATETIME_SECONDS)
288
+ : (this.amPm ? INPUT_FORMAT.DATETIME_AM_PM : INPUT_FORMAT.DATETIME))
289
+ : INPUT_FORMAT.DATE);
290
+ }
291
+ /**
292
+ * Set the current calendar view.
293
+ * Accepted format: 'yyyy-MM'
294
+ * @param view view date
295
+ */
296
+ set view(view) {
297
+ this.views = view ? [view] : [];
298
+ }
299
+ get view() {
300
+ return this.views[0] || '';
301
+ }
302
+ /**
303
+ * Set the current calendar views for duplex mode
304
+ * Accepted format: 'yyyy-MM'
305
+ * @param views view dates
306
+ * @type {string[]}
307
+ */
308
+ set views(views) {
309
+ const oldViews = this._views;
310
+ views = this.filterAndWarnInvalidViews(views);
311
+ if (oldViews.toString() !== views.toString()) {
312
+ this._views = views;
313
+ this.requestUpdate('views', oldViews);
314
+ }
315
+ }
316
+ get views() {
317
+ if (this._views.length) {
318
+ return this._views;
319
+ }
320
+ const now = new Date();
321
+ const from = this.values[0];
322
+ if (!this.isDuplex()) {
323
+ return [formatToView(from || now)];
324
+ }
325
+ const to = this.values[1];
326
+ // default duplex mode
327
+ if (this.isDuplexConsecutive() || !from || !to || formatToView(from) === formatToView(to) || isBefore(to, from)) {
328
+ return this.composeViews(formatToView(from || to || now), !from && to ? 1 : 0, []);
329
+ }
330
+ // duplex split if as from and to
331
+ return [formatToView(from), formatToView(to)];
332
+ }
333
+ /**
334
+ * Validates the input, marking the element as invalid if its value does not meet the validation criteria.
335
+ * @returns {void}
336
+ */
337
+ validateInput() {
338
+ const hasError = this.hasError();
339
+ if (this.error !== hasError) {
340
+ this.error = hasError;
341
+ this.notifyPropertyChange('error', this.error);
342
+ }
343
+ }
344
+ /**
345
+ * Updates the element
346
+ * @param changedProperties Properties that has changed
347
+ * @returns {void}
348
+ */
349
+ update(changedProperties) {
350
+ if (changedProperties.has('opened') && this.opened) {
351
+ this.lazyRendered = true;
352
+ }
353
+ // make sure to close popup for disabled
354
+ if (this.opened && !this.canOpenPopup) {
355
+ this.opened = false; /* this cannot be nor stopped nor listened */
356
+ }
357
+ if (changedProperties.has('_values') || changedProperties.has(TranslatePropertyKey)) {
358
+ this.syncInputValues();
359
+ }
360
+ if (this.shouldValidateValue(changedProperties)) {
361
+ this.validateInput();
362
+ }
363
+ super.update(changedProperties);
364
+ }
365
+ /**
366
+ * Called after the component is first rendered
367
+ * @param changedProperties Properties which have changed
368
+ * @returns {void}
369
+ */
370
+ firstUpdated(changedProperties) {
371
+ super.firstUpdated(changedProperties);
372
+ this.addEventListener('keydown', this.onKeyDown);
373
+ this.addEventListener('tap', this.onTap);
374
+ }
375
+ /**
376
+ * Overwrite validation method for value
377
+ *
378
+ * @param value value
379
+ * @returns {boolean} result
380
+ */
381
+ isValidValue(value) {
382
+ if (value === '') {
383
+ return true;
384
+ }
385
+ // Need to check for the attribute to cover the case when
386
+ // timepicker and value attributes are set
387
+ return (this.timepicker || this.hasAttribute('timepicker'))
388
+ ? isValidDateTime(value)
389
+ : isValidDate(value, DateFormat.yyyyMMdd);
390
+ }
391
+ /**
392
+ * Used to show a warning when the value does not pass the validation
393
+ * @param value that is invalid
394
+ * @returns {void}
395
+ */
396
+ warnInvalidValue(value) {
397
+ new WarningNotice(`The specified value "${value}" does not conform to the required format. The format is ${this.timepicker ? '"yyyy-MM-ddThh:mm" followed by optional ":ss" or ":ss.SSS"' : '"yyyy-MM-dd"'}.`).show();
398
+ }
399
+ /**
400
+ * Show invalid view message
401
+ * @param value Invalid value
402
+ * @returns {void}
403
+ */
404
+ warnInvalidView(value) {
405
+ new WarningNotice(`The specified value "${value}" does not conform to the required format. The format is "yyyy-MM".`).show();
406
+ }
407
+ /**
408
+ * Convert value string array to date segments
409
+ * Warn invalid value if passed value does not confirm a segment
410
+ * @returns {void}
411
+ */
412
+ valuesToSegments() {
413
+ const newSegments = this.filterAndWarnInvalidValues(this._values).map(value => DateTimeSegment.fromString(value));
414
+ this._segments = newSegments;
415
+ this.interimSegments = newSegments;
416
+ }
417
+ /**
418
+ * Check if the value needs re-validation against min/max and format
419
+ * @param changedProperties Properties which have changed
420
+ * @returns needs re-validation
421
+ */
422
+ shouldValidateValue(changedProperties) {
423
+ // do not validate default value
424
+ if (changedProperties.has('_values') && changedProperties.get('_values') !== undefined
425
+ || changedProperties.has('min') && changedProperties.get('min') !== undefined
426
+ || changedProperties.has('max') && changedProperties.get('max') !== undefined
427
+ || changedProperties.has('showSeconds') && changedProperties.get('showSeconds') !== undefined) {
428
+ return true;
429
+ }
430
+ return false;
431
+ }
432
+ /**
433
+ * A helper method to make sure that only valid values are passed
434
+ * Warn if passed value is invalid
435
+ * @param values Values to check
436
+ * @returns Filtered collection of values
437
+ */
438
+ filterAndWarnInvalidValues(values) {
439
+ return values.map(value => {
440
+ if (this.isValidValue(value)) {
441
+ return value;
442
+ }
443
+ this.warnInvalidValue(value);
444
+ return '';
445
+ });
446
+ }
447
+ /**
448
+ * A helper method to make sure that only valid views are passed
449
+ * Warn if passed view is invalid
450
+ * @param views Views to check
451
+ * @returns Filtered collection of values
452
+ */
453
+ filterAndWarnInvalidViews(views) {
454
+ for (let i = 0; i < views.length; i += 1) {
455
+ const view = views[i];
456
+ if (!isValidDate(view, DateFormat.yyyyMM)) {
457
+ this.warnInvalidView(view);
458
+ return []; /* if at least one view is invalid, do not care about the rest to avoid empty views */
459
+ }
460
+ }
461
+ return views;
462
+ }
463
+ /**
464
+ * Return true if calendar is in duplex mode
465
+ * @returns duplex
466
+ */
467
+ isDuplex() {
468
+ return this.isDuplexSplit() || this.isDuplexConsecutive();
469
+ }
470
+ /**
471
+ * Return true if calendar is in duplex split mode
472
+ * @returns duplex split
473
+ */
474
+ isDuplexSplit() {
475
+ return this.duplex === 'split';
476
+ }
477
+ /**
478
+ * Return true if calendar is in duplex consecutive mode
479
+ * @returns duplex consecutive
480
+ */
481
+ isDuplexConsecutive() {
482
+ return this.duplex === '' || this.duplex === 'consecutive';
483
+ }
484
+ /**
485
+ * Stop syncing input values and picker values
486
+ * @returns {void}
487
+ */
488
+ disableInputSync() {
489
+ this.inputSyncing = false;
490
+ }
491
+ /**
492
+ * Start syncing input values and picker values
493
+ * @returns {void}
494
+ */
495
+ enableInputSync() {
496
+ this.inputSyncing = true;
497
+ }
498
+ /**
499
+ * Synchronise input values and values
500
+ * @return {void}
501
+ */
502
+ syncInputValues() {
503
+ if (!this.inputSyncing) {
504
+ return;
505
+ }
506
+ // input values cannot be populated off interim segments as require a valid date
507
+ // date-fns formats to local if there is time info
508
+ this.inputValues = this._segments.map(segment => this.formatSegment(segment));
509
+ }
510
+ /**
511
+ * Format date segment according to format and locale
512
+ * @param segment Date segment
513
+ * @returns formatted string
514
+ */
515
+ formatSegment(segment) {
516
+ return segment.value ? inputFormat(segment.getTime(), this.format, {
517
+ locale: getDateFNSLocale(getLocale(this))
518
+ }) : '';
519
+ }
520
+ /**
521
+ * Construct view collection
522
+ * @param view The view that has changed
523
+ * @param index View index (0 - single, or from); (1 - to)
524
+ * @param [views=this.views] The original views collection
525
+ * @returns the new view collection
526
+ */
527
+ composeViews(view, index, views = this.views) {
528
+ view = formatToView(view);
529
+ if (!this.isDuplex()) {
530
+ return [view];
531
+ }
532
+ if (this.isDuplexConsecutive()) {
533
+ if (index === 0) { /* from */
534
+ return [view, formatToView(addMonths(view, 1))];
535
+ }
536
+ else { /* to */
537
+ return [formatToView(subMonths(view, 1)), view];
538
+ }
539
+ }
540
+ // duplex split
541
+ if (index === 0) { /* from. to must be after or the same */
542
+ let after = views[1] || addMonths(view, 1);
543
+ if (isBefore(after, view)) {
544
+ after = view;
545
+ }
546
+ return [view, formatToView(after)];
547
+ }
548
+ if (index === 1) { /* to. from must be before or the same */
549
+ let before = views[0] || subMonths(view, 1);
550
+ if (isAfter(before, view)) {
551
+ before = view;
552
+ }
553
+ return [formatToView(before), view];
554
+ }
555
+ return [];
556
+ }
557
+ /**
558
+ * An interim collection of segments to push values when all parts are populated
559
+ * and validated
560
+ * @param segments Segments
561
+ */
562
+ set interimSegments(segments) {
563
+ const interimSegments = segments.map(segment => DateTimeSegment.fromDateTimeSegment(segment));
564
+ this._interimSegments = interimSegments;
565
+ // cannot populate calendar if from is after to, it looks broken
566
+ this.calendarValues = this.isFromBeforeTo() ? interimSegments.map(segment => segment.dateSegment) : [];
567
+ this.timepickerValues = interimSegments.map(segment => segment.timeSegment);
568
+ }
569
+ /**
570
+ * Get interim segments. These are free to modify
571
+ * @returns interim segments
572
+ */
573
+ get interimSegments() {
574
+ return this._interimSegments;
575
+ }
576
+ /**
577
+ * Submit interim segments to values.
578
+ * Notify value-changed event.
579
+ * @returns true if values have changed. False otherwise
580
+ */
581
+ submitInterimSegments() {
582
+ const oldSegments = this._segments;
583
+ const newSegments = this.interimSegments;
584
+ // compare if different
585
+ if (oldSegments.toString() === newSegments.toString()) {
586
+ return false;
587
+ }
588
+ const newValues = newSegments.map(segment => segment.value);
589
+ // validate
590
+ for (let i = 0; i < newValues.length; i += 1) { /* need this step in case timepicker is not populated */
591
+ if (!this.isValidValue(newValues[i])) {
592
+ return false;
593
+ }
594
+ }
595
+ this.notifyValuesChange(newValues);
596
+ return true;
597
+ }
598
+ /**
599
+ * Notify that values array has been changed
600
+ * @param values A collection of string dates
601
+ * @returns {void}
602
+ */
603
+ notifyValuesChange(values) {
604
+ if (this.values.toString() !== values.toString()) {
605
+ this.values = values;
606
+ this.notifyPropertyChange('value', this.value);
607
+ }
608
+ }
609
+ /**
610
+ * Notify that views array has been changed
611
+ * @param views A collection of string dates
612
+ * @returns {void}
613
+ */
614
+ notifyViewsChange(views) {
615
+ if (this._views.toString() !== views.toString()) {
616
+ this.views = views;
617
+ this.notifyPropertyChange('view', this.view);
618
+ }
619
+ }
620
+ /**
621
+ * Handles key input on datetime picker
622
+ * @param event Key down event object
623
+ * @returns {void}
624
+ */
625
+ onKeyDown(event) {
626
+ switch (event.key) {
627
+ case 'Down':
628
+ case 'ArrowDown':
629
+ this.setOpened(true);
630
+ break;
631
+ case 'Up':
632
+ case 'ArrowUp':
633
+ !event.defaultPrevented && this.setOpened(false);
634
+ break;
635
+ default:
636
+ return;
637
+ }
638
+ event.preventDefault();
639
+ }
640
+ /**
641
+ * Handles key input on calendar picker
642
+ * @param event Key down event object
643
+ * @returns {void}
644
+ */
645
+ onCalendarKeyDown(event) {
646
+ switch (event.key) {
647
+ case 'Esc':
648
+ case 'Escape':
649
+ this.resetViews();
650
+ this.setOpened(false);
651
+ break;
652
+ default:
653
+ return;
654
+ }
655
+ event.preventDefault();
656
+ }
657
+ /**
658
+ * Handles key input on text field
659
+ * @param event Key down event object
660
+ * @returns {void}
661
+ */
662
+ onInputKeyDown(event) {
663
+ switch (event.key) {
664
+ case 'Esc':
665
+ case 'Escape':
666
+ !this.opened && this.blur();
667
+ this.setOpened(false);
668
+ break;
669
+ case 'Enter':
670
+ this.toggleOpened();
671
+ break;
672
+ default:
673
+ return;
674
+ }
675
+ event.preventDefault();
676
+ }
677
+ /**
678
+ * Run on tap event
679
+ * @param event Tap event
680
+ * @returns {void}
681
+ */
682
+ onTap(event) {
683
+ const path = event.composedPath();
684
+ if (this.popupEl && path.includes(this.popupEl)) {
685
+ return; /* popup is managed separately */
686
+ }
687
+ if (path.includes(this.iconEl)) {
688
+ this.toggleOpened();
689
+ }
690
+ else if (!this.inputTriggerDisabled) {
691
+ this.setOpened(true);
692
+ }
693
+ }
694
+ /**
695
+ * Run when popup opened flag changes
696
+ * @param event opened-change event
697
+ * @returns {void}
698
+ */
699
+ onPopupOpenedChanged(event) {
700
+ event.preventDefault(); /* re-target opened changed event */
701
+ this.setOpened(event.detail.value);
702
+ }
703
+ /**
704
+ * Run on calendar view-changed event
705
+ * @param event view-changed event
706
+ * @returns {void}
707
+ */
708
+ onCalendarViewChanged(event) {
709
+ const index = event.target === this.calendarToEl ? 1 : 0; /* 0 - from, single; 1 - to */
710
+ const view = event.detail.value;
711
+ this.notifyViewsChange(this.composeViews(view, index));
712
+ }
713
+ /**
714
+ * Run on calendar value-changed event
715
+ * @param event value-changed event
716
+ * @returns {void}
717
+ */
718
+ onCalendarValueChanged(event) {
719
+ var _a, _b;
720
+ const values = event.target.values;
721
+ this.interimSegments = values.map((value, index) => {
722
+ const segment = this.interimSegments[index] || new DateTimeSegment();
723
+ segment.dateSegment = value;
724
+ if (this.timepicker && !segment.timeSegment) {
725
+ segment.timeSegment = getCurrentTime(this.showSeconds); /* populate time, as otherwise time picker looks broken */
726
+ }
727
+ return segment;
728
+ });
729
+ this.submitInterimSegments();
730
+ // in duplex mode, avoid jumping on views
731
+ // Therefore if any of values have changed, save the current view
732
+ if (this.isDuplex() && this.calendarEl && this.calendarToEl) {
733
+ this.notifyViewsChange([(_a = this.calendarEl) === null || _a === void 0 ? void 0 : _a.view, (_b = this.calendarToEl) === null || _b === void 0 ? void 0 : _b.view]);
734
+ }
735
+ // Close popup if there is no time picker
736
+ const newValues = this.values;
737
+ if (!this.timepicker && newValues[0] && (this.range ? newValues[1] : true)) {
738
+ this.setOpened(false);
739
+ }
740
+ }
741
+ /**
742
+ * Run on time-picker value-changed event
743
+ * @param event value-changed event
744
+ * @returns {void}
745
+ */
746
+ onTimePickerValueChanged(event) {
747
+ const target = event.target;
748
+ const index = target === this.timepickerToEl ? 1 : 0; /* 0 - from, single; 1 - to */
749
+ const segment = this.interimSegments[index] || new DateTimeSegment();
750
+ segment.timeSegment = target.value;
751
+ this.interimSegments[index] = segment;
752
+ this.submitInterimSegments();
753
+ }
754
+ /**
755
+ * Run on input focus
756
+ * @returns {void}
757
+ */
758
+ onInputFocus() {
759
+ this.disableInputSync();
760
+ }
761
+ /**
762
+ * Run on input blur
763
+ * @param event blur event
764
+ * @returns {void}
765
+ */
766
+ onInputBlur(event) {
767
+ this.enableInputSync();
768
+ // remove all code once strict formatting is supported in date-fns
769
+ const index = event.target === this.inputToEl ? 1 : 0;
770
+ const segment = this._segments[index];
771
+ if (!segment || !segment.value) {
772
+ return;
773
+ }
774
+ const formattedValue = segment ? this.formatSegment(segment) : '';
775
+ if (formattedValue !== this.inputValues[index]) {
776
+ const inputValues = [...this.inputValues];
777
+ inputValues[index] = formattedValue;
778
+ this.inputValues = inputValues;
779
+ this.requestUpdate();
780
+ }
781
+ }
782
+ /**
783
+ * Run on input value-changed event
784
+ * @param event value-changed event
785
+ * @returns {void}
786
+ */
787
+ onInputValueChanged(event) {
788
+ const target = event.target;
789
+ const index = target === this.inputToEl ? 1 : 0; /* 0 - from, single; 1 - to */
790
+ const inputValue = target.value;
791
+ const inputValues = [...this.inputValues];
792
+ inputValues[index] = inputValue;
793
+ this.inputValues = inputValues;
794
+ let dateString = '';
795
+ if (inputValue) {
796
+ const recoveryDate = (this.interimSegments[index] || new DateTimeSegment()).getTime();
797
+ const date = inputParse(inputValue, this.format, recoveryDate, {
798
+ locale: getDateFNSLocale(getLocale(this))
799
+ });
800
+ if (isValid(date)) {
801
+ dateString = inputFormat(date, this.timepicker ? this.showSeconds ? DateTimeFormat.yyyMMddTHHmmss : DateTimeFormat.yyyMMddTHHmm : DateFormat.yyyyMMdd);
802
+ this.resetViews(); /* user input should be treated similar to manually switching the views */
803
+ }
804
+ }
805
+ else {
806
+ this.resetViews();
807
+ }
808
+ this.interimSegments[index] = DateTimeSegment.fromString(dateString);
809
+ this.submitInterimSegments();
810
+ this.validateInput();
811
+ }
812
+ /**
813
+ * Check if input format conforms to value format
814
+ * @returns true if valid format
815
+ */
816
+ isValidFormat() {
817
+ const inputValues = this.inputValues;
818
+ const values = this.values;
819
+ // No need to format values to validate.
820
+ // If input is invalid, value is not populated
821
+ for (let i = 0; i < inputValues.length; i += 1) {
822
+ if (inputValues[i] && !values[i]) {
823
+ return false;
824
+ }
825
+ }
826
+ return true;
827
+ }
828
+ /**
829
+ * Check if `value` is within `min` and `max`
830
+ * @returns true if value is within
831
+ */
832
+ isValueWithinMinMax() {
833
+ if (this.min || this.max) {
834
+ const minTime = this.min ? parse(this.min).getTime() : -Infinity;
835
+ const maxTime = this.max ? parse(this.max).getTime() : Infinity;
836
+ for (let i = 0; i < this.values.length; i += 1) {
837
+ const valueTime = parse(this.values[i]).getTime();
838
+ if (minTime > valueTime || maxTime < valueTime) {
839
+ return false;
840
+ }
841
+ }
842
+ }
843
+ return true;
844
+ }
845
+ /**
846
+ * Check if `from` is before or the same as `to`
847
+ * @returns true if `from` is before or the same as `to`
848
+ */
849
+ isFromBeforeTo() {
850
+ if (this.range) {
851
+ const from = this.values[0];
852
+ const to = this.values[1];
853
+ if (from && to) {
854
+ if (parse(from).getTime() > parse(to).getTime()) {
855
+ return false;
856
+ }
857
+ }
858
+ }
859
+ return true;
860
+ }
861
+ /**
862
+ * Check if datetime picker has an error
863
+ * @returns true if error
864
+ */
865
+ hasError() {
866
+ return !(this.isValidFormat() && this.isValueWithinMinMax() && this.isFromBeforeTo());
867
+ }
868
+ /**
869
+ * Toggles the opened state of the list
870
+ * @returns {void}
871
+ */
872
+ toggleOpened() {
873
+ this.setOpened(!this.opened);
874
+ }
875
+ /**
876
+ * Return true if popup can be opened
877
+ */
878
+ get canOpenPopup() {
879
+ return !(this.disabled || this.readonly || this.popupDisabled);
880
+ }
881
+ /**
882
+ * Set opened state with event
883
+ * @param opened True if opened
884
+ * @returns {void}
885
+ */
886
+ setOpened(opened) {
887
+ if (opened && !this.canOpenPopup) { /* never allow to open popup if cannot do so */
888
+ return;
889
+ }
890
+ if (this.opened !== opened && this.notifyPropertyChange('opened', opened, true)) {
891
+ this.opened = opened;
892
+ }
893
+ }
894
+ /**
895
+ * Reset views to default
896
+ * @returns {void}
897
+ */
898
+ resetViews() {
899
+ this.notifyViewsChange([]);
900
+ }
901
+ /**
902
+ * Get time picker template
903
+ * @param id Timepicker identifier
904
+ * @param value Time picker value
905
+ * @returns template result
906
+ */
907
+ getTimepickerTemplate(id, value = '') {
908
+ return html `<ef-time-picker
909
+ id="${id}"
910
+ part="time-picker"
911
+ .showSeconds=${this.showSeconds}
912
+ .amPm=${this.amPm}
913
+ .value=${value}
914
+ @value-changed=${this.onTimePickerValueChanged}></ef-time-picker>`;
915
+ }
916
+ /**
917
+ * Get calendar template
918
+ * @param id Calendar identifier
919
+ * @param view Calendar view
920
+ * @returns template result
921
+ */
922
+ getCalendarTemplate(id, view = '') {
923
+ return html `<ef-calendar
924
+ part="calendar"
925
+ id=${id}
926
+ lang=${ifDefined(this.lang || undefined)}
927
+ .fillCells=${!this.isDuplex()}
928
+ .range=${this.range}
929
+ .multiple=${this.multiple}
930
+ .min=${this.minDate}
931
+ .max=${this.maxDate}
932
+ .weekdaysOnly=${this.weekdaysOnly}
933
+ .weekendsOnly=${this.weekendsOnly}
934
+ .firstDayOfWeek=${ifDefined(this.firstDayOfWeek)}
935
+ .values=${this.calendarValues}
936
+ .filter=${this.filter}
937
+ .view=${view}
938
+ @keydown=${this.onCalendarKeyDown}
939
+ @view-changed=${this.onCalendarViewChanged}
940
+ @value-changed=${this.onCalendarValueChanged}></ef-calendar>`;
941
+ }
942
+ /**
943
+ * Get calendar templates
944
+ */
945
+ get calendarsTemplate() {
946
+ return html `
947
+ ${this.getCalendarTemplate('calendar', this.views[0])}
948
+ ${this.isDuplex() ? this.getCalendarTemplate('calendar-to', this.views[1]) : undefined}
949
+ `;
950
+ }
951
+ /**
952
+ * Get timepicker templates
953
+ */
954
+ get timepickersTemplate() {
955
+ // TODO: how can we add support timepicker with multiple?
956
+ const values = this.timepickerValues;
957
+ return html `
958
+ ${this.getTimepickerTemplate('timepicker', values[0])}
959
+ ${this.range ? html `<div part="input-separator"></div>` : undefined}
960
+ ${this.range ? this.getTimepickerTemplate('timepicker-to', values[1]) : undefined}
961
+ `;
962
+ }
963
+ /**
964
+ * Get input template
965
+ * @param id Input identifier
966
+ * @param value Input value
967
+ * @returns template result
968
+ */
969
+ getInputTemplate(id, value = '') {
970
+ return html `
971
+ <ef-text-field
972
+ id=${id}
973
+ part="input"
974
+ transparent
975
+ ?disabled="${this.disabled}"
976
+ ?readonly="${this.readonly || this.inputDisabled}"
977
+ .value=${value}
978
+ .placeholder="${this.placeholder}"
979
+ @focus=${this.onInputFocus}
980
+ @blur=${this.onInputBlur}
981
+ @keydown=${this.onInputKeyDown}
982
+ @value-changed=${this.onInputValueChanged}></ef-text-field>
983
+ `;
984
+ }
985
+ /**
986
+ * Template for rendering an icon
987
+ */
988
+ get iconTemplate() {
989
+ return html `
990
+ <ef-icon
991
+ part="icon"
992
+ icon="calendar"></ef-icon>
993
+ `;
994
+ }
995
+ /**
996
+ * Template for inputs
997
+ * @returns inputTemplate
998
+ */
999
+ get inputTemplates() {
1000
+ const values = this.inputValues;
1001
+ return html `
1002
+ <div part="input-wrapper">
1003
+ ${this.getInputTemplate('input', values[0])}
1004
+ ${this.range ? html `<div part="input-separator"></div>` : undefined}
1005
+ ${this.range ? this.getInputTemplate('input-to', values[1]) : undefined}
1006
+ </div>
1007
+ `;
1008
+ }
1009
+ /**
1010
+ * Popup panel template
1011
+ */
1012
+ get popupTemplate() {
1013
+ if (this.lazyRendered) {
1014
+ return html `<ef-overlay
1015
+ tabindex="0"
1016
+ part="list"
1017
+ with-shadow
1018
+ no-cancel-on-esc-key
1019
+ no-autofocus
1020
+ .delegatesFocus=${true}
1021
+ .focusBoundary=${this}
1022
+ .positionTarget=${this}
1023
+ .position=${POPUP_POSITION}
1024
+ ?opened=${this.opened}
1025
+ @opened-changed=${this.onPopupOpenedChanged}>
1026
+ <div><slot name="header"></div>
1027
+ <div part="body">
1028
+ <div><slot name="left"></div>
1029
+ <div part="selectors-wrapper">
1030
+ <div part="calendar-wrapper">
1031
+ ${this.calendarsTemplate}
1032
+ </div>
1033
+ ${this.timepicker ? html `<div part="timepicker-wrapper">${this.timepickersTemplate}</div>` : undefined}
1034
+ </div>
1035
+ <div><slot name="right"></div>
1036
+ </div>
1037
+ <div><slot name="footer"></div>
1038
+ </ef-overlay>`;
1039
+ }
1040
+ }
1041
+ /**
1042
+ * A `TemplateResult` that will be used
1043
+ * to render the updated internal template.
1044
+ * @return Render template
1045
+ */
1046
+ render() {
1047
+ return html `
1048
+ ${this.inputTemplates}
1049
+ ${this.iconTemplate}
1050
+ ${this.popupTemplate}
1051
+ `;
1052
+ }
1053
+ };
1054
+ __decorate([
1055
+ property({ type: String })
1056
+ ], DatetimePicker.prototype, "min", null);
1057
+ __decorate([
1058
+ property({ type: String })
1059
+ ], DatetimePicker.prototype, "max", null);
1060
+ __decorate([
1061
+ property({ type: Boolean, attribute: 'weekdays-only' })
1062
+ ], DatetimePicker.prototype, "weekdaysOnly", void 0);
1063
+ __decorate([
1064
+ property({ type: Boolean, attribute: 'weekends-only' })
1065
+ ], DatetimePicker.prototype, "weekendsOnly", void 0);
1066
+ __decorate([
1067
+ property({ attribute: false })
1068
+ ], DatetimePicker.prototype, "filter", void 0);
1069
+ __decorate([
1070
+ property({ type: Number, attribute: 'first-day-of-week' })
1071
+ ], DatetimePicker.prototype, "firstDayOfWeek", void 0);
1072
+ __decorate([
1073
+ property({ type: Boolean, reflect: true })
1074
+ ], DatetimePicker.prototype, "range", void 0);
1075
+ __decorate([
1076
+ property({ type: Boolean })
1077
+ ], DatetimePicker.prototype, "multiple", null);
1078
+ __decorate([
1079
+ property({ type: String })
1080
+ ], DatetimePicker.prototype, "value", null);
1081
+ __decorate([
1082
+ property({
1083
+ converter: {
1084
+ fromAttribute: function (value) {
1085
+ return value.split(',');
1086
+ }
1087
+ }
1088
+ })
1089
+ ], DatetimePicker.prototype, "values", null);
1090
+ __decorate([
1091
+ property({ type: Boolean, attribute: 'am-pm', reflect: true })
1092
+ ], DatetimePicker.prototype, "amPm", void 0);
1093
+ __decorate([
1094
+ property({ type: Boolean, attribute: 'show-seconds', reflect: true })
1095
+ ], DatetimePicker.prototype, "showSeconds", void 0);
1096
+ __decorate([
1097
+ property({ type: String })
1098
+ ], DatetimePicker.prototype, "placeholder", null);
1099
+ __decorate([
1100
+ property({ type: Boolean, reflect: true })
1101
+ ], DatetimePicker.prototype, "opened", void 0);
1102
+ __decorate([
1103
+ property({ type: Boolean, reflect: true })
1104
+ ], DatetimePicker.prototype, "error", void 0);
1105
+ __decorate([
1106
+ property({ type: Boolean, reflect: true })
1107
+ ], DatetimePicker.prototype, "warning", void 0);
1108
+ __decorate([
1109
+ property({ type: Boolean, attribute: 'input-trigger-disabled' })
1110
+ ], DatetimePicker.prototype, "inputTriggerDisabled", void 0);
1111
+ __decorate([
1112
+ property({ type: Boolean, attribute: 'input-disabled', reflect: true })
1113
+ ], DatetimePicker.prototype, "inputDisabled", void 0);
1114
+ __decorate([
1115
+ property({ type: Boolean, attribute: 'popup-disabled', reflect: true })
1116
+ ], DatetimePicker.prototype, "popupDisabled", void 0);
1117
+ __decorate([
1118
+ property({ type: String })
1119
+ ], DatetimePicker.prototype, "format", null);
1120
+ __decorate([
1121
+ property({ type: Boolean, reflect: true })
1122
+ ], DatetimePicker.prototype, "timepicker", void 0);
1123
+ __decorate([
1124
+ property({ type: String, reflect: true })
1125
+ ], DatetimePicker.prototype, "duplex", void 0);
1126
+ __decorate([
1127
+ property({ type: String })
1128
+ ], DatetimePicker.prototype, "view", null);
1129
+ __decorate([
1130
+ property({ attribute: false })
1131
+ ], DatetimePicker.prototype, "views", null);
1132
+ __decorate([
1133
+ translate({ mode: 'directive', scope: 'ef-datetime-picker' })
1134
+ ], DatetimePicker.prototype, "t", void 0);
1135
+ __decorate([
1136
+ query('[part=icon]', true)
1137
+ ], DatetimePicker.prototype, "iconEl", void 0);
1138
+ __decorate([
1139
+ query('[part=list]')
1140
+ ], DatetimePicker.prototype, "popupEl", void 0);
1141
+ __decorate([
1142
+ query('#timepicker')
1143
+ ], DatetimePicker.prototype, "timepickerEl", void 0);
1144
+ __decorate([
1145
+ query('#timepicker-to')
1146
+ ], DatetimePicker.prototype, "timepickerToEl", void 0);
1147
+ __decorate([
1148
+ query('#calendar')
1149
+ ], DatetimePicker.prototype, "calendarEl", void 0);
1150
+ __decorate([
1151
+ query('#calendar-to')
1152
+ ], DatetimePicker.prototype, "calendarToEl", void 0);
1153
+ __decorate([
1154
+ query('#input')
1155
+ ], DatetimePicker.prototype, "inputEl", void 0);
1156
+ __decorate([
1157
+ query('#input-to')
1158
+ ], DatetimePicker.prototype, "inputToEl", void 0);
1159
+ DatetimePicker = __decorate([
1160
+ customElement('ef-datetime-picker', {
1161
+ alias: 'emerald-datetime-picker'
1162
+ })
1163
+ ], DatetimePicker);
1164
+ export { DatetimePicker };