@refinitiv-ui/elements 5.3.3 → 5.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (558) hide show
  1. package/lib/accordion/custom-elements.json +49 -0
  2. package/lib/accordion/index.d.ts +76 -0
  3. package/lib/accordion/index.js +139 -0
  4. package/lib/accordion/themes/halo/dark/index.js +3 -0
  5. package/lib/accordion/themes/halo/light/index.js +3 -0
  6. package/lib/accordion/themes/solar/charcoal/index.js +3 -0
  7. package/lib/accordion/themes/solar/pearl/index.js +3 -0
  8. package/lib/appstate-bar/custom-elements.json +49 -0
  9. package/lib/appstate-bar/index.d.ts +65 -0
  10. package/lib/appstate-bar/index.js +103 -0
  11. package/lib/appstate-bar/themes/halo/dark/index.js +3 -0
  12. package/lib/appstate-bar/themes/halo/light/index.js +3 -0
  13. package/lib/appstate-bar/themes/solar/charcoal/index.js +3 -0
  14. package/lib/appstate-bar/themes/solar/pearl/index.js +3 -0
  15. package/lib/autosuggest/custom-elements.json +223 -0
  16. package/lib/autosuggest/helpers/const.d.ts +2 -0
  17. package/lib/autosuggest/helpers/const.js +3 -0
  18. package/lib/autosuggest/helpers/types.d.ts +54 -0
  19. package/lib/autosuggest/helpers/types.js +1 -0
  20. package/lib/autosuggest/helpers/utils.d.ts +39 -0
  21. package/lib/autosuggest/helpers/utils.js +76 -0
  22. package/lib/autosuggest/index.d.ts +533 -0
  23. package/lib/autosuggest/index.js +1248 -0
  24. package/lib/autosuggest/themes/halo/dark/index.js +5 -0
  25. package/lib/autosuggest/themes/halo/light/index.js +5 -0
  26. package/lib/autosuggest/themes/solar/charcoal/index.js +5 -0
  27. package/lib/autosuggest/themes/solar/pearl/index.js +5 -0
  28. package/lib/button/custom-elements.json +119 -0
  29. package/lib/button/index.d.ts +132 -0
  30. package/lib/button/index.js +213 -0
  31. package/lib/button/themes/halo/dark/index.js +3 -0
  32. package/lib/button/themes/halo/light/index.js +3 -0
  33. package/lib/button/themes/solar/charcoal/index.js +3 -0
  34. package/lib/button/themes/solar/pearl/index.js +3 -0
  35. package/lib/button-bar/custom-elements.json +26 -0
  36. package/lib/button-bar/index.d.ts +76 -0
  37. package/lib/button-bar/index.js +157 -0
  38. package/lib/button-bar/themes/halo/dark/index.js +3 -0
  39. package/lib/button-bar/themes/halo/light/index.js +3 -0
  40. package/lib/button-bar/themes/solar/charcoal/index.js +3 -0
  41. package/lib/button-bar/themes/solar/pearl/index.js +3 -0
  42. package/lib/calendar/custom-elements.json +199 -0
  43. package/lib/calendar/index.d.ts +321 -0
  44. package/lib/calendar/index.js +926 -0
  45. package/lib/calendar/locales.d.ts +31 -0
  46. package/lib/calendar/locales.js +144 -0
  47. package/lib/calendar/themes/halo/dark/index.js +3 -0
  48. package/lib/calendar/themes/halo/light/index.js +3 -0
  49. package/lib/calendar/themes/solar/charcoal/index.js +3 -0
  50. package/lib/calendar/themes/solar/pearl/index.js +3 -0
  51. package/lib/calendar/types.d.ts +33 -0
  52. package/lib/calendar/types.js +6 -0
  53. package/lib/calendar/utils.d.ts +12 -0
  54. package/lib/calendar/utils.js +17 -0
  55. package/lib/canvas/custom-elements.json +69 -0
  56. package/lib/canvas/index.d.ts +100 -0
  57. package/lib/canvas/index.js +175 -0
  58. package/lib/canvas/themes/halo/dark/index.js +2 -0
  59. package/lib/canvas/themes/halo/light/index.js +2 -0
  60. package/lib/canvas/themes/solar/charcoal/index.js +2 -0
  61. package/lib/canvas/themes/solar/pearl/index.js +2 -0
  62. package/lib/card/custom-elements.json +59 -0
  63. package/lib/card/helpers/types.d.ts +12 -0
  64. package/lib/card/helpers/types.js +1 -0
  65. package/lib/card/index.d.ts +140 -0
  66. package/lib/card/index.js +247 -0
  67. package/lib/card/themes/halo/dark/index.js +5 -0
  68. package/lib/card/themes/halo/light/index.js +5 -0
  69. package/lib/card/themes/solar/charcoal/index.js +5 -0
  70. package/lib/card/themes/solar/pearl/index.js +5 -0
  71. package/lib/chart/custom-elements.json +42 -0
  72. package/lib/chart/helpers/index.d.ts +2 -0
  73. package/lib/chart/helpers/index.js +2 -0
  74. package/lib/chart/helpers/legend.d.ts +5 -0
  75. package/lib/chart/helpers/legend.js +78 -0
  76. package/lib/chart/helpers/merge.d.ts +15 -0
  77. package/lib/chart/helpers/merge.js +28 -0
  78. package/lib/chart/helpers/types.d.ts +69 -0
  79. package/lib/chart/helpers/types.js +1 -0
  80. package/lib/chart/index.d.ts +187 -0
  81. package/lib/chart/index.js +493 -0
  82. package/lib/chart/plugins/doughnut-center-label.d.ts +3 -0
  83. package/lib/chart/plugins/doughnut-center-label.js +196 -0
  84. package/lib/chart/themes/halo/dark/index.js +4 -0
  85. package/lib/chart/themes/halo/light/index.js +4 -0
  86. package/lib/chart/themes/solar/charcoal/index.js +4 -0
  87. package/lib/chart/themes/solar/pearl/index.js +4 -0
  88. package/lib/checkbox/custom-elements.json +71 -0
  89. package/lib/checkbox/index.d.ts +89 -0
  90. package/lib/checkbox/index.js +170 -0
  91. package/lib/checkbox/themes/halo/dark/index.js +4 -0
  92. package/lib/checkbox/themes/halo/light/index.js +4 -0
  93. package/lib/checkbox/themes/solar/charcoal/index.js +4 -0
  94. package/lib/checkbox/themes/solar/pearl/index.js +4 -0
  95. package/lib/clock/custom-elements.json +108 -0
  96. package/lib/clock/index.d.ts +309 -0
  97. package/lib/clock/index.js +564 -0
  98. package/lib/clock/themes/halo/dark/index.js +2 -0
  99. package/lib/clock/themes/halo/light/index.js +2 -0
  100. package/lib/clock/themes/solar/charcoal/index.js +2 -0
  101. package/lib/clock/themes/solar/pearl/index.js +2 -0
  102. package/lib/clock/utils/TickManager.d.ts +14 -0
  103. package/lib/clock/utils/TickManager.js +66 -0
  104. package/lib/clock/utils/timestamps.d.ts +6 -0
  105. package/lib/clock/utils/timestamps.js +6 -0
  106. package/lib/collapse/custom-elements.json +79 -0
  107. package/lib/collapse/index.d.ts +119 -0
  108. package/lib/collapse/index.js +199 -0
  109. package/lib/collapse/themes/halo/dark/index.js +5 -0
  110. package/lib/collapse/themes/halo/light/index.js +5 -0
  111. package/lib/collapse/themes/solar/charcoal/index.js +5 -0
  112. package/lib/collapse/themes/solar/pearl/index.js +5 -0
  113. package/lib/color-dialog/custom-elements.json +193 -0
  114. package/lib/color-dialog/elements/color-palettes.d.ts +52 -0
  115. package/lib/color-dialog/elements/color-palettes.js +105 -0
  116. package/lib/color-dialog/elements/grayscale-palettes.d.ts +67 -0
  117. package/lib/color-dialog/elements/grayscale-palettes.js +164 -0
  118. package/lib/color-dialog/elements/palettes.d.ts +58 -0
  119. package/lib/color-dialog/elements/palettes.js +119 -0
  120. package/lib/color-dialog/helpers/color-helpers.d.ts +62 -0
  121. package/lib/color-dialog/helpers/color-helpers.js +258 -0
  122. package/lib/color-dialog/helpers/value-model.d.ts +75 -0
  123. package/lib/color-dialog/helpers/value-model.js +139 -0
  124. package/lib/color-dialog/index.d.ts +232 -0
  125. package/lib/color-dialog/index.js +457 -0
  126. package/lib/color-dialog/themes/halo/dark/index.js +7 -0
  127. package/lib/color-dialog/themes/halo/light/index.js +7 -0
  128. package/lib/color-dialog/themes/solar/charcoal/index.js +7 -0
  129. package/lib/color-dialog/themes/solar/pearl/index.js +7 -0
  130. package/lib/combo-box/custom-elements.json +207 -0
  131. package/lib/combo-box/helpers/filter.d.ts +10 -0
  132. package/lib/combo-box/helpers/filter.js +29 -0
  133. package/lib/combo-box/helpers/keyboard-event.d.ts +17 -0
  134. package/lib/combo-box/helpers/keyboard-event.js +19 -0
  135. package/lib/combo-box/helpers/types.d.ts +11 -0
  136. package/lib/combo-box/helpers/types.js +1 -0
  137. package/lib/combo-box/index.d.ts +523 -0
  138. package/lib/combo-box/index.js +1146 -0
  139. package/lib/combo-box/themes/halo/dark/index.js +8 -0
  140. package/lib/combo-box/themes/halo/light/index.js +8 -0
  141. package/lib/combo-box/themes/solar/charcoal/index.js +8 -0
  142. package/lib/combo-box/themes/solar/pearl/index.js +8 -0
  143. package/lib/counter/custom-elements.json +35 -0
  144. package/lib/counter/index.d.ts +89 -0
  145. package/lib/counter/index.js +155 -0
  146. package/lib/counter/themes/halo/dark/index.js +3 -0
  147. package/lib/counter/themes/halo/light/index.js +3 -0
  148. package/lib/counter/themes/solar/charcoal/index.js +3 -0
  149. package/lib/counter/themes/solar/pearl/index.js +3 -0
  150. package/lib/counter/utils.d.ts +13 -0
  151. package/lib/counter/utils.js +52 -0
  152. package/lib/datetime-picker/custom-elements.json +333 -0
  153. package/lib/datetime-picker/index.d.ts +498 -0
  154. package/lib/datetime-picker/index.js +1164 -0
  155. package/lib/datetime-picker/locales.d.ts +8 -0
  156. package/lib/datetime-picker/locales.js +46 -0
  157. package/lib/datetime-picker/themes/halo/dark/index.js +7 -0
  158. package/lib/datetime-picker/themes/halo/light/index.js +7 -0
  159. package/lib/datetime-picker/themes/solar/charcoal/index.js +7 -0
  160. package/lib/datetime-picker/themes/solar/pearl/index.js +7 -0
  161. package/lib/datetime-picker/types.d.ts +3 -0
  162. package/lib/datetime-picker/types.js +1 -0
  163. package/lib/datetime-picker/utils.d.ts +55 -0
  164. package/lib/datetime-picker/utils.js +92 -0
  165. package/lib/dialog/custom-elements.json +136 -0
  166. package/lib/dialog/draggable-element.d.ts +14 -0
  167. package/lib/dialog/draggable-element.js +221 -0
  168. package/lib/dialog/index.d.ts +199 -0
  169. package/lib/dialog/index.js +331 -0
  170. package/lib/dialog/themes/halo/dark/index.js +7 -0
  171. package/lib/dialog/themes/halo/light/index.js +7 -0
  172. package/lib/dialog/themes/solar/charcoal/index.js +7 -0
  173. package/lib/dialog/themes/solar/pearl/index.js +7 -0
  174. package/lib/email-field/custom-elements.json +199 -0
  175. package/lib/email-field/index.d.ts +152 -0
  176. package/lib/email-field/index.js +287 -0
  177. package/lib/email-field/themes/halo/dark/index.js +3 -0
  178. package/lib/email-field/themes/halo/light/index.js +3 -0
  179. package/lib/email-field/themes/solar/charcoal/index.js +3 -0
  180. package/lib/email-field/themes/solar/pearl/index.js +3 -0
  181. package/lib/events.d.ts +121 -0
  182. package/lib/events.js +2 -0
  183. package/lib/flag/custom-elements.json +35 -0
  184. package/lib/flag/index.d.ts +94 -0
  185. package/lib/flag/index.js +168 -0
  186. package/lib/flag/themes/halo/dark/index.js +2 -0
  187. package/lib/flag/themes/halo/light/index.js +2 -0
  188. package/lib/flag/themes/solar/charcoal/index.js +2 -0
  189. package/lib/flag/themes/solar/pearl/index.js +2 -0
  190. package/lib/flag/utils/FlagLoader.d.ts +47 -0
  191. package/lib/flag/utils/FlagLoader.js +86 -0
  192. package/lib/header/custom-elements.json +36 -0
  193. package/lib/header/index.d.ts +46 -0
  194. package/lib/header/index.js +76 -0
  195. package/lib/header/themes/halo/dark/index.js +2 -0
  196. package/lib/header/themes/halo/light/index.js +2 -0
  197. package/lib/header/themes/solar/charcoal/index.js +2 -0
  198. package/lib/header/themes/solar/pearl/index.js +2 -0
  199. package/lib/heatmap/custom-elements.json +151 -0
  200. package/lib/heatmap/helpers/color.d.ts +30 -0
  201. package/lib/heatmap/helpers/color.js +68 -0
  202. package/lib/heatmap/helpers/text.d.ts +26 -0
  203. package/lib/heatmap/helpers/text.js +91 -0
  204. package/lib/heatmap/helpers/track.d.ts +102 -0
  205. package/lib/heatmap/helpers/track.js +160 -0
  206. package/lib/heatmap/helpers/types.d.ts +40 -0
  207. package/lib/heatmap/helpers/types.js +1 -0
  208. package/lib/heatmap/index.d.ts +453 -0
  209. package/lib/heatmap/index.js +1104 -0
  210. package/lib/heatmap/themes/halo/dark/index.js +4 -0
  211. package/lib/heatmap/themes/halo/light/index.js +4 -0
  212. package/lib/heatmap/themes/solar/charcoal/index.js +4 -0
  213. package/lib/heatmap/themes/solar/pearl/index.js +4 -0
  214. package/lib/icon/custom-elements.json +34 -0
  215. package/lib/icon/index.d.ts +87 -0
  216. package/lib/icon/index.js +161 -0
  217. package/lib/icon/themes/halo/dark/index.js +2 -0
  218. package/lib/icon/themes/halo/light/index.js +2 -0
  219. package/lib/icon/themes/solar/charcoal/index.js +2 -0
  220. package/lib/icon/themes/solar/pearl/index.js +2 -0
  221. package/lib/icon/utils/IconLoader.d.ts +47 -0
  222. package/lib/icon/utils/IconLoader.js +86 -0
  223. package/lib/index.d.ts +2 -0
  224. package/lib/index.js +2 -0
  225. package/lib/interactive-chart/custom-elements.json +86 -0
  226. package/lib/interactive-chart/helpers/merge.d.ts +15 -0
  227. package/lib/interactive-chart/helpers/merge.js +28 -0
  228. package/lib/interactive-chart/helpers/types.d.ts +45 -0
  229. package/lib/interactive-chart/helpers/types.js +6 -0
  230. package/lib/interactive-chart/index.d.ts +380 -0
  231. package/lib/interactive-chart/index.js +1093 -0
  232. package/lib/interactive-chart/themes/halo/dark/index.js +3 -0
  233. package/lib/interactive-chart/themes/halo/light/index.js +3 -0
  234. package/lib/interactive-chart/themes/solar/charcoal/index.js +3 -0
  235. package/lib/interactive-chart/themes/solar/pearl/index.js +3 -0
  236. package/lib/item/custom-elements.json +153 -0
  237. package/lib/item/helpers/types.d.ts +57 -0
  238. package/lib/item/helpers/types.js +1 -0
  239. package/lib/item/index.d.ts +149 -0
  240. package/lib/item/index.js +252 -0
  241. package/lib/item/themes/halo/dark/index.js +4 -0
  242. package/lib/item/themes/halo/light/index.js +4 -0
  243. package/lib/item/themes/solar/charcoal/index.js +4 -0
  244. package/lib/item/themes/solar/pearl/index.js +4 -0
  245. package/lib/jsx.d.ts +223 -0
  246. package/lib/label/custom-elements.json +52 -0
  247. package/lib/label/index.d.ts +102 -0
  248. package/lib/label/index.js +252 -0
  249. package/lib/label/themes/halo/dark/index.js +3 -0
  250. package/lib/label/themes/halo/light/index.js +3 -0
  251. package/lib/label/themes/solar/charcoal/index.js +3 -0
  252. package/lib/label/themes/solar/pearl/index.js +3 -0
  253. package/lib/layout/custom-elements.json +163 -0
  254. package/lib/layout/index.d.ts +107 -0
  255. package/lib/layout/index.js +215 -0
  256. package/lib/layout/themes/halo/dark/index.js +2 -0
  257. package/lib/layout/themes/halo/light/index.js +2 -0
  258. package/lib/layout/themes/solar/charcoal/index.js +2 -0
  259. package/lib/layout/themes/solar/pearl/index.js +2 -0
  260. package/lib/led-gauge/custom-elements.json +113 -0
  261. package/lib/led-gauge/index.d.ts +143 -0
  262. package/lib/led-gauge/index.js +440 -0
  263. package/lib/led-gauge/themes/halo/dark/index.js +3 -0
  264. package/lib/led-gauge/themes/halo/light/index.js +3 -0
  265. package/lib/led-gauge/themes/solar/charcoal/index.js +3 -0
  266. package/lib/led-gauge/themes/solar/pearl/index.js +3 -0
  267. package/lib/list/custom-elements.json +111 -0
  268. package/lib/list/extensible-function.d.ts +8 -0
  269. package/lib/list/extensible-function.js +13 -0
  270. package/lib/list/helpers/list-renderer.d.ts +9 -0
  271. package/lib/list/helpers/list-renderer.js +35 -0
  272. package/lib/list/helpers/types.d.ts +3 -0
  273. package/lib/list/helpers/types.js +1 -0
  274. package/lib/list/index.d.ts +292 -0
  275. package/lib/list/index.js +604 -0
  276. package/lib/list/renderer.d.ts +36 -0
  277. package/lib/list/renderer.js +9 -0
  278. package/lib/list/themes/halo/dark/index.js +3 -0
  279. package/lib/list/themes/halo/light/index.js +3 -0
  280. package/lib/list/themes/solar/charcoal/index.js +3 -0
  281. package/lib/list/themes/solar/pearl/index.js +3 -0
  282. package/lib/loader/custom-elements.json +9 -0
  283. package/lib/loader/index.d.ts +41 -0
  284. package/lib/loader/index.js +65 -0
  285. package/lib/loader/themes/halo/dark/index.js +2 -0
  286. package/lib/loader/themes/halo/light/index.js +2 -0
  287. package/lib/loader/themes/solar/charcoal/index.js +2 -0
  288. package/lib/loader/themes/solar/pearl/index.js +2 -0
  289. package/lib/multi-input/custom-elements.json +238 -0
  290. package/lib/multi-input/helpers/types.d.ts +11 -0
  291. package/lib/multi-input/helpers/types.js +1 -0
  292. package/lib/multi-input/index.d.ts +297 -0
  293. package/lib/multi-input/index.js +591 -0
  294. package/lib/multi-input/themes/halo/dark/index.js +4 -0
  295. package/lib/multi-input/themes/halo/light/index.js +4 -0
  296. package/lib/multi-input/themes/solar/charcoal/index.js +4 -0
  297. package/lib/multi-input/themes/solar/pearl/index.js +4 -0
  298. package/lib/notification/custom-elements.json +95 -0
  299. package/lib/notification/elements/notification-tray.d.ts +97 -0
  300. package/lib/notification/elements/notification-tray.js +170 -0
  301. package/lib/notification/elements/notification.d.ts +90 -0
  302. package/lib/notification/elements/notification.js +157 -0
  303. package/lib/notification/helpers/status.d.ts +30 -0
  304. package/lib/notification/helpers/status.js +130 -0
  305. package/lib/notification/helpers/types.d.ts +10 -0
  306. package/lib/notification/helpers/types.js +1 -0
  307. package/lib/notification/index.d.ts +2 -0
  308. package/lib/notification/index.js +2 -0
  309. package/lib/notification/themes/halo/dark/index.js +5 -0
  310. package/lib/notification/themes/halo/light/index.js +5 -0
  311. package/lib/notification/themes/solar/charcoal/index.js +5 -0
  312. package/lib/notification/themes/solar/pearl/index.js +5 -0
  313. package/lib/number-field/custom-elements.json +200 -0
  314. package/lib/number-field/index.d.ts +294 -0
  315. package/lib/number-field/index.js +708 -0
  316. package/lib/number-field/themes/halo/dark/index.js +3 -0
  317. package/lib/number-field/themes/halo/light/index.js +3 -0
  318. package/lib/number-field/themes/solar/charcoal/index.js +3 -0
  319. package/lib/number-field/themes/solar/pearl/index.js +3 -0
  320. package/lib/overlay/custom-elements.json +342 -0
  321. package/lib/overlay/elements/overlay-backdrop.d.ts +46 -0
  322. package/lib/overlay/elements/overlay-backdrop.js +67 -0
  323. package/lib/overlay/elements/overlay-viewport.d.ts +40 -0
  324. package/lib/overlay/elements/overlay-viewport.js +56 -0
  325. package/lib/overlay/elements/overlay.d.ts +403 -0
  326. package/lib/overlay/elements/overlay.js +1427 -0
  327. package/lib/overlay/helpers/functions.d.ts +13 -0
  328. package/lib/overlay/helpers/functions.js +16 -0
  329. package/lib/overlay/helpers/types.d.ts +97 -0
  330. package/lib/overlay/helpers/types.js +16 -0
  331. package/lib/overlay/index.d.ts +2 -0
  332. package/lib/overlay/index.js +1 -0
  333. package/lib/overlay/managers/backdrop-manager.d.ts +45 -0
  334. package/lib/overlay/managers/backdrop-manager.js +96 -0
  335. package/lib/overlay/managers/close-manager.d.ts +54 -0
  336. package/lib/overlay/managers/close-manager.js +138 -0
  337. package/lib/overlay/managers/focus-manager.d.ts +71 -0
  338. package/lib/overlay/managers/focus-manager.js +228 -0
  339. package/lib/overlay/managers/interaction-lock-manager.d.ts +138 -0
  340. package/lib/overlay/managers/interaction-lock-manager.js +375 -0
  341. package/lib/overlay/managers/viewport-manager.d.ts +93 -0
  342. package/lib/overlay/managers/viewport-manager.js +207 -0
  343. package/lib/overlay/managers/zindex-manager.d.ts +80 -0
  344. package/lib/overlay/managers/zindex-manager.js +195 -0
  345. package/lib/overlay/themes/halo/dark/index.js +4 -0
  346. package/lib/overlay/themes/halo/light/index.js +4 -0
  347. package/lib/overlay/themes/solar/charcoal/index.js +4 -0
  348. package/lib/overlay/themes/solar/pearl/index.js +4 -0
  349. package/lib/overlay-menu/custom-elements.json +196 -0
  350. package/lib/overlay-menu/helpers/types.d.ts +8 -0
  351. package/lib/overlay-menu/helpers/types.js +1 -0
  352. package/lib/overlay-menu/helpers/uuid.d.ts +7 -0
  353. package/lib/overlay-menu/helpers/uuid.js +13 -0
  354. package/lib/overlay-menu/index.d.ts +380 -0
  355. package/lib/overlay-menu/index.js +921 -0
  356. package/lib/overlay-menu/managers/menu-manager.d.ts +98 -0
  357. package/lib/overlay-menu/managers/menu-manager.js +240 -0
  358. package/lib/overlay-menu/themes/halo/dark/index.js +5 -0
  359. package/lib/overlay-menu/themes/halo/light/index.js +5 -0
  360. package/lib/overlay-menu/themes/solar/charcoal/index.js +5 -0
  361. package/lib/overlay-menu/themes/solar/pearl/index.js +5 -0
  362. package/lib/pagination/custom-elements.json +93 -0
  363. package/lib/pagination/helpers/types.d.ts +9 -0
  364. package/lib/pagination/helpers/types.js +1 -0
  365. package/lib/pagination/index.d.ts +207 -0
  366. package/lib/pagination/index.js +400 -0
  367. package/lib/pagination/themes/halo/dark/index.js +6 -0
  368. package/lib/pagination/themes/halo/light/index.js +6 -0
  369. package/lib/pagination/themes/solar/charcoal/index.js +6 -0
  370. package/lib/pagination/themes/solar/pearl/index.js +6 -0
  371. package/lib/panel/custom-elements.json +39 -0
  372. package/lib/panel/index.d.ts +48 -0
  373. package/lib/panel/index.js +77 -0
  374. package/lib/panel/themes/halo/dark/index.js +2 -0
  375. package/lib/panel/themes/halo/light/index.js +2 -0
  376. package/lib/panel/themes/solar/charcoal/index.js +2 -0
  377. package/lib/panel/themes/solar/pearl/index.js +2 -0
  378. package/lib/password-field/custom-elements.json +156 -0
  379. package/lib/password-field/index.d.ts +140 -0
  380. package/lib/password-field/index.js +258 -0
  381. package/lib/password-field/themes/halo/dark/index.js +3 -0
  382. package/lib/password-field/themes/halo/light/index.js +3 -0
  383. package/lib/password-field/themes/solar/charcoal/index.js +3 -0
  384. package/lib/password-field/themes/solar/pearl/index.js +3 -0
  385. package/lib/pill/custom-elements.json +95 -0
  386. package/lib/pill/index.d.ts +97 -0
  387. package/lib/pill/index.js +162 -0
  388. package/lib/pill/themes/halo/dark/index.js +3 -0
  389. package/lib/pill/themes/halo/light/index.js +3 -0
  390. package/lib/pill/themes/solar/charcoal/index.js +3 -0
  391. package/lib/pill/themes/solar/pearl/index.js +3 -0
  392. package/lib/progress-bar/custom-elements.json +58 -0
  393. package/lib/progress-bar/index.d.ts +82 -0
  394. package/lib/progress-bar/index.js +159 -0
  395. package/lib/progress-bar/themes/halo/dark/index.js +2 -0
  396. package/lib/progress-bar/themes/halo/light/index.js +2 -0
  397. package/lib/progress-bar/themes/solar/charcoal/index.js +2 -0
  398. package/lib/progress-bar/themes/solar/pearl/index.js +2 -0
  399. package/lib/radio-button/custom-elements.json +84 -0
  400. package/lib/radio-button/index.d.ts +106 -0
  401. package/lib/radio-button/index.js +195 -0
  402. package/lib/radio-button/radio-button-registry.d.ts +21 -0
  403. package/lib/radio-button/radio-button-registry.js +40 -0
  404. package/lib/radio-button/themes/halo/dark/index.js +3 -0
  405. package/lib/radio-button/themes/halo/light/index.js +3 -0
  406. package/lib/radio-button/themes/solar/charcoal/index.js +3 -0
  407. package/lib/radio-button/themes/solar/pearl/index.js +3 -0
  408. package/lib/rating/custom-elements.json +58 -0
  409. package/lib/rating/index.d.ts +91 -0
  410. package/lib/rating/index.js +158 -0
  411. package/lib/rating/themes/halo/dark/index.js +2 -0
  412. package/lib/rating/themes/halo/light/index.js +2 -0
  413. package/lib/rating/themes/solar/charcoal/index.js +2 -0
  414. package/lib/rating/themes/solar/pearl/index.js +2 -0
  415. package/lib/search-field/custom-elements.json +173 -0
  416. package/lib/search-field/index.d.ts +134 -0
  417. package/lib/search-field/index.js +254 -0
  418. package/lib/search-field/themes/halo/dark/index.js +3 -0
  419. package/lib/search-field/themes/halo/light/index.js +3 -0
  420. package/lib/search-field/themes/solar/charcoal/index.js +3 -0
  421. package/lib/search-field/themes/solar/pearl/index.js +3 -0
  422. package/lib/select/custom-elements.json +103 -0
  423. package/lib/select/helpers/types.d.ts +3 -0
  424. package/lib/select/helpers/types.js +1 -0
  425. package/lib/select/index.d.ts +388 -0
  426. package/lib/select/index.js +942 -0
  427. package/lib/select/themes/halo/dark/index.js +5 -0
  428. package/lib/select/themes/halo/light/index.js +5 -0
  429. package/lib/select/themes/solar/charcoal/index.js +5 -0
  430. package/lib/select/themes/solar/pearl/index.js +5 -0
  431. package/lib/sidebar-layout/custom-elements.json +72 -0
  432. package/lib/sidebar-layout/index.d.ts +69 -0
  433. package/lib/sidebar-layout/index.js +135 -0
  434. package/lib/sidebar-layout/themes/halo/dark/index.js +3 -0
  435. package/lib/sidebar-layout/themes/halo/light/index.js +3 -0
  436. package/lib/sidebar-layout/themes/solar/charcoal/index.js +3 -0
  437. package/lib/sidebar-layout/themes/solar/pearl/index.js +3 -0
  438. package/lib/slider/custom-elements.json +181 -0
  439. package/lib/slider/index.d.ts +409 -0
  440. package/lib/slider/index.js +1188 -0
  441. package/lib/slider/themes/halo/dark/index.js +3 -0
  442. package/lib/slider/themes/halo/light/index.js +3 -0
  443. package/lib/slider/themes/solar/charcoal/index.js +3 -0
  444. package/lib/slider/themes/solar/pearl/index.js +3 -0
  445. package/lib/sparkline/custom-elements.json +59 -0
  446. package/lib/sparkline/index.d.ts +107 -0
  447. package/lib/sparkline/index.js +188 -0
  448. package/lib/sparkline/themes/halo/dark/index.js +2 -0
  449. package/lib/sparkline/themes/halo/light/index.js +2 -0
  450. package/lib/sparkline/themes/solar/charcoal/index.js +2 -0
  451. package/lib/sparkline/themes/solar/pearl/index.js +2 -0
  452. package/lib/swing-gauge/const.d.ts +22 -0
  453. package/lib/swing-gauge/const.js +26 -0
  454. package/lib/swing-gauge/custom-elements.json +109 -0
  455. package/lib/swing-gauge/helpers.d.ts +8 -0
  456. package/lib/swing-gauge/helpers.js +105 -0
  457. package/lib/swing-gauge/index.d.ts +294 -0
  458. package/lib/swing-gauge/index.js +762 -0
  459. package/lib/swing-gauge/themes/halo/dark/index.js +3 -0
  460. package/lib/swing-gauge/themes/halo/light/index.js +3 -0
  461. package/lib/swing-gauge/themes/solar/charcoal/index.js +3 -0
  462. package/lib/swing-gauge/themes/solar/pearl/index.js +3 -0
  463. package/lib/swing-gauge/types.d.ts +34 -0
  464. package/lib/swing-gauge/types.js +1 -0
  465. package/lib/tab/custom-elements.json +123 -0
  466. package/lib/tab/index.d.ts +118 -0
  467. package/lib/tab/index.js +211 -0
  468. package/lib/tab/themes/halo/dark/index.js +4 -0
  469. package/lib/tab/themes/halo/light/index.js +4 -0
  470. package/lib/tab/themes/solar/charcoal/index.js +4 -0
  471. package/lib/tab/themes/solar/pearl/index.js +4 -0
  472. package/lib/tab-bar/custom-elements.json +52 -0
  473. package/lib/tab-bar/helpers/animate.d.ts +16 -0
  474. package/lib/tab-bar/helpers/animate.js +53 -0
  475. package/lib/tab-bar/index.d.ts +108 -0
  476. package/lib/tab-bar/index.js +220 -0
  477. package/lib/tab-bar/themes/halo/dark/index.js +4 -0
  478. package/lib/tab-bar/themes/halo/light/index.js +4 -0
  479. package/lib/tab-bar/themes/solar/charcoal/index.js +4 -0
  480. package/lib/tab-bar/themes/solar/pearl/index.js +4 -0
  481. package/lib/text-field/custom-elements.json +210 -0
  482. package/lib/text-field/index.d.ts +171 -0
  483. package/lib/text-field/index.js +319 -0
  484. package/lib/text-field/themes/halo/dark/index.js +3 -0
  485. package/lib/text-field/themes/halo/light/index.js +3 -0
  486. package/lib/text-field/themes/solar/charcoal/index.js +3 -0
  487. package/lib/text-field/themes/solar/pearl/index.js +3 -0
  488. package/lib/time-picker/custom-elements.json +124 -0
  489. package/lib/time-picker/index.d.ts +379 -0
  490. package/lib/time-picker/index.js +777 -0
  491. package/lib/time-picker/themes/halo/dark/index.js +4 -0
  492. package/lib/time-picker/themes/halo/light/index.js +4 -0
  493. package/lib/time-picker/themes/solar/charcoal/index.js +4 -0
  494. package/lib/time-picker/themes/solar/pearl/index.js +4 -0
  495. package/lib/toggle/custom-elements.json +84 -0
  496. package/lib/toggle/index.d.ts +77 -0
  497. package/lib/toggle/index.js +134 -0
  498. package/lib/toggle/themes/halo/dark/index.js +2 -0
  499. package/lib/toggle/themes/halo/light/index.js +2 -0
  500. package/lib/toggle/themes/solar/charcoal/index.js +2 -0
  501. package/lib/toggle/themes/solar/pearl/index.js +2 -0
  502. package/lib/tooltip/custom-elements.json +62 -0
  503. package/lib/tooltip/elements/title-tooltip.d.ts +1 -0
  504. package/lib/tooltip/elements/title-tooltip.js +18 -0
  505. package/lib/tooltip/elements/tooltip-element.d.ts +21 -0
  506. package/lib/tooltip/elements/tooltip-element.js +54 -0
  507. package/lib/tooltip/helpers/overflow-tooltip.d.ts +9 -0
  508. package/lib/tooltip/helpers/overflow-tooltip.js +19 -0
  509. package/lib/tooltip/helpers/renderer.d.ts +8 -0
  510. package/lib/tooltip/helpers/renderer.js +11 -0
  511. package/lib/tooltip/helpers/types.d.ts +23 -0
  512. package/lib/tooltip/helpers/types.js +1 -0
  513. package/lib/tooltip/index.d.ts +232 -0
  514. package/lib/tooltip/index.js +479 -0
  515. package/lib/tooltip/managers/tooltip-manager.d.ts +15 -0
  516. package/lib/tooltip/managers/tooltip-manager.js +144 -0
  517. package/lib/tooltip/themes/halo/dark/index.js +3 -0
  518. package/lib/tooltip/themes/halo/light/index.js +3 -0
  519. package/lib/tooltip/themes/solar/charcoal/index.js +3 -0
  520. package/lib/tooltip/themes/solar/pearl/index.js +3 -0
  521. package/lib/tornado-chart/custom-elements.json +45 -0
  522. package/lib/tornado-chart/elements/tornado-chart.d.ts +78 -0
  523. package/lib/tornado-chart/elements/tornado-chart.js +125 -0
  524. package/lib/tornado-chart/elements/tornado-item.d.ts +110 -0
  525. package/lib/tornado-chart/elements/tornado-item.js +209 -0
  526. package/lib/tornado-chart/index.d.ts +2 -0
  527. package/lib/tornado-chart/index.js +2 -0
  528. package/lib/tornado-chart/themes/halo/dark/index.js +6 -0
  529. package/lib/tornado-chart/themes/halo/light/index.js +6 -0
  530. package/lib/tornado-chart/themes/solar/charcoal/index.js +6 -0
  531. package/lib/tornado-chart/themes/solar/pearl/index.js +6 -0
  532. package/lib/tree/custom-elements.json +100 -0
  533. package/lib/tree/elements/tree-item.d.ts +96 -0
  534. package/lib/tree/elements/tree-item.js +182 -0
  535. package/lib/tree/elements/tree.d.ts +156 -0
  536. package/lib/tree/elements/tree.js +286 -0
  537. package/lib/tree/helpers/renderer.d.ts +5 -0
  538. package/lib/tree/helpers/renderer.js +33 -0
  539. package/lib/tree/helpers/types.d.ts +17 -0
  540. package/lib/tree/helpers/types.js +1 -0
  541. package/lib/tree/index.d.ts +4 -0
  542. package/lib/tree/index.js +3 -0
  543. package/lib/tree/managers/tree-manager.d.ts +236 -0
  544. package/lib/tree/managers/tree-manager.js +379 -0
  545. package/lib/tree/themes/halo/dark/index.js +7 -0
  546. package/lib/tree/themes/halo/light/index.js +7 -0
  547. package/lib/tree/themes/solar/charcoal/index.js +7 -0
  548. package/lib/tree/themes/solar/pearl/index.js +7 -0
  549. package/lib/tree-select/custom-elements.json +107 -0
  550. package/lib/tree-select/helpers/types.d.ts +4 -0
  551. package/lib/tree-select/helpers/types.js +1 -0
  552. package/lib/tree-select/index.d.ts +400 -0
  553. package/lib/tree-select/index.js +881 -0
  554. package/lib/tree-select/themes/halo/dark/index.js +12 -0
  555. package/lib/tree-select/themes/halo/light/index.js +12 -0
  556. package/lib/tree-select/themes/solar/charcoal/index.js +12 -0
  557. package/lib/tree-select/themes/solar/pearl/index.js +12 -0
  558. package/package.json +9 -9
@@ -0,0 +1,1164 @@
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';
14
+ 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 '../';
20
+ preload('calendar', 'down', 'left', 'right'); /* preload calendar icons for faster loading */
21
+ const POPUP_POSITION = ['bottom-start', 'top-start', 'bottom-end', 'top-end', 'bottom-middle', 'top-middle'];
22
+ const INPUT_FORMAT = {
23
+ DATE: 'dd-MMM-yyyy',
24
+ DATETIME: 'dd-MMM-yyyy HH:mm',
25
+ DATETIME_AM_PM: 'dd-MMM-yyyy hh:mm aaa',
26
+ DATETIME_SECONDS: 'dd-MMM-yyyy HH:mm:ss',
27
+ DATETIME_SECONDS_AM_PM: 'dd-MMM-yyyy hh:mm:ss aaa'
28
+ };
29
+ /**
30
+ * Control to pick date and time
31
+ *
32
+ * @fires opened-changed - Dispatched when when opened attribute changes internally
33
+ * @fires value-changed - Dispatched when value changes
34
+ * @fires error-changed - Dispatched when error state changes
35
+ * @fires view-changed - Dispatched when internal view changes
36
+ *
37
+ * @attr {boolean} readonly - Set readonly state
38
+ * @prop {boolean} [readonly=false] - Set readonly state
39
+ *
40
+ * @attr {boolean} disabled - Set disabled state
41
+ * @prop {boolean} [disabled=false] - Set disabled state
42
+ *
43
+ * @slots header - Header slot
44
+ * @slots right - Right slot
45
+ * @slots footer - Footer slot
46
+ * @slots left - Left slot
47
+ */
48
+ let DatetimePicker = class DatetimePicker extends ControlElement {
49
+ constructor() {
50
+ super(...arguments);
51
+ this.lazyRendered = false; /* speed up rendering by not populating popup window on first load */
52
+ this.calendarValues = []; /* used to store date information for calendars */
53
+ this.timepickerValues = []; /* used to store time information for timepickers */
54
+ this.inputValues = []; /* used to formatted datetime value for inputs */
55
+ this.inputSyncing = true; /* true when inputs and pickers are in sync. False while user types in input */
56
+ this._min = '';
57
+ this.minDate = '';
58
+ this._max = '';
59
+ this.maxDate = '';
60
+ /**
61
+ * Only enable weekdays
62
+ */
63
+ this.weekdaysOnly = false;
64
+ /**
65
+ * Only enable weekends
66
+ */
67
+ this.weekendsOnly = false;
68
+ /**
69
+ * Custom filter, used for enabling/disabling certain dates
70
+ * @type {DatetimePickerFilter | null}
71
+ */
72
+ this.filter = null;
73
+ /**
74
+ * Set to switch to range select mode
75
+ */
76
+ this.range = false;
77
+ this._values = []; /* list of values as passed by the user */
78
+ this._segments = []; /* filtered and processed list of values */
79
+ /**
80
+ * Toggles 12hr time display
81
+ */
82
+ this.amPm = false;
83
+ /**
84
+ * Flag to show seconds time segment in display.
85
+ * Seconds are automatically shown when `hh:mm:ss` time format is provided as a value.
86
+ */
87
+ this.showSeconds = false;
88
+ this._placeholder = '';
89
+ /**
90
+ * Toggles the opened state of the list
91
+ */
92
+ this.opened = false;
93
+ /**
94
+ * Set state to error
95
+ */
96
+ this.error = false;
97
+ /**
98
+ * Set state to warning
99
+ */
100
+ this.warning = false;
101
+ /**
102
+ * Only open picker panel when calendar icon is clicked.
103
+ * Clicking on the input will no longer open the picker.
104
+ */
105
+ this.inputTriggerDisabled = false;
106
+ /**
107
+ * Disable input part of the picker
108
+ */
109
+ this.inputDisabled = false;
110
+ /**
111
+ * Disable the popup
112
+ */
113
+ this.popupDisabled = false;
114
+ this._format = '';
115
+ /**
116
+ * Toggle to display the time picker
117
+ */
118
+ this.timepicker = false;
119
+ /**
120
+ * Display two calendar pickers.
121
+ * @type {"" | "consecutive" | "split"}
122
+ */
123
+ this.duplex = null;
124
+ this._views = [];
125
+ this._interimSegments = [];
126
+ }
127
+ /**
128
+ * Element version number
129
+ * @returns version number
130
+ */
131
+ static get version() {
132
+ return VERSION;
133
+ }
134
+ /**
135
+ * A `CSSResult` that will be used
136
+ * to style the host, slotted children
137
+ * and the internal template of the element.
138
+ * @return CSS template
139
+ */
140
+ static get styles() {
141
+ return css `
142
+ :host {
143
+ display: inline-block;
144
+ height: 48px;
145
+ outline: none;
146
+ cursor: text;
147
+ }
148
+ [part=input-wrapper] {
149
+ display: flex;
150
+ flex: 1;
151
+ }
152
+ [part=body] {
153
+ display: flex;
154
+ }
155
+ [part=timepicker-wrapper] {
156
+ display: flex;
157
+ justify-content: space-between;
158
+ }
159
+ [part=timepicker-wrapper]:before,
160
+ [part=timepicker-wrapper]:after {
161
+ content: '';
162
+ }
163
+ [part=input] {
164
+ flex: 1;
165
+ width: auto;
166
+ height: auto;
167
+ padding: 0;
168
+ margin: 0;
169
+ }
170
+ [part=calendar-wrapper] {
171
+ display: inline-flex;
172
+ }
173
+ [part=icon] {
174
+ cursor: pointer;
175
+ }
176
+ :host([popup-disabled]) [part=icon], :host([readonly]) [part=icon] {
177
+ pointer-event: none;
178
+ }
179
+ `;
180
+ }
181
+ /**
182
+ * Set minimum date
183
+ * @param min date
184
+ */
185
+ set min(min) {
186
+ if (!this.isValidValue(min)) {
187
+ this.warnInvalidValue(min);
188
+ min = '';
189
+ }
190
+ const oldMin = this.min;
191
+ if (oldMin !== min) {
192
+ this._min = min;
193
+ this.minDate = min ? format(parse(min), DateFormat.yyyyMMdd) : '';
194
+ void this.requestUpdate('min', oldMin);
195
+ }
196
+ }
197
+ get min() {
198
+ return this._min;
199
+ }
200
+ /**
201
+ * Set maximum date
202
+ * @param max date
203
+ */
204
+ set max(max) {
205
+ if (!this.isValidValue(max)) {
206
+ this.warnInvalidValue(max);
207
+ max = '';
208
+ }
209
+ const oldMax = this.max;
210
+ if (oldMax !== max) {
211
+ this._max = max;
212
+ this.maxDate = max ? format(parse(max), DateFormat.yyyyMMdd) : '';
213
+ void this.requestUpdate('max', oldMax);
214
+ }
215
+ }
216
+ get max() {
217
+ return this._max;
218
+ }
219
+ /**
220
+ * Set to switch to multiple select mode
221
+ * @ignore
222
+ * @param multiple Multiple
223
+ */
224
+ /* istanbul ignore next */
225
+ set multiple(multiple) {
226
+ new WarningNotice('multiple is not currently supported').show();
227
+ }
228
+ get multiple() {
229
+ return false;
230
+ }
231
+ /**
232
+ * Current date time value
233
+ * @param value Calendar value
234
+ */
235
+ set value(value) {
236
+ this.values = value ? [value] : [];
237
+ }
238
+ get value() {
239
+ return this.values[0] || '';
240
+ }
241
+ /**
242
+ * Set multiple selected values
243
+ * @param values Values to set
244
+ * @type {string[]}
245
+ */
246
+ set values(values) {
247
+ const oldValues = this._values;
248
+ if (String(oldValues) !== String(values)) {
249
+ this._values = values;
250
+ void this.requestUpdate('_values', oldValues); /* segments are populated in update */
251
+ }
252
+ }
253
+ get values() {
254
+ return this._segments.map(segment => segment.value);
255
+ }
256
+ /**
257
+ * Placeholder to display when no value is set
258
+ * @param placeholder Placeholder
259
+ */
260
+ set placeholder(placeholder) {
261
+ const oldPlaceholder = this._placeholder;
262
+ if (oldPlaceholder !== placeholder) {
263
+ this._placeholder = placeholder;
264
+ void this.requestUpdate('placeholder', oldPlaceholder);
265
+ }
266
+ }
267
+ get placeholder() {
268
+ return this._placeholder || this.format;
269
+ }
270
+ /**
271
+ * Set the datetime format
272
+ * Based on dane-fns datetime formats
273
+ * @param format Date format
274
+ */
275
+ set format(format) {
276
+ const oldFormat = this._format;
277
+ if (oldFormat !== format) {
278
+ this._format = format;
279
+ void this.requestUpdate('format', oldFormat);
280
+ }
281
+ }
282
+ get format() {
283
+ return this._format || (this.timepicker
284
+ ? (this.showSeconds
285
+ ? (this.amPm ? INPUT_FORMAT.DATETIME_SECONDS_AM_PM : INPUT_FORMAT.DATETIME_SECONDS)
286
+ : (this.amPm ? INPUT_FORMAT.DATETIME_AM_PM : INPUT_FORMAT.DATETIME))
287
+ : INPUT_FORMAT.DATE);
288
+ }
289
+ /**
290
+ * Set the current calendar view.
291
+ * Accepted format: 'yyyy-MM'
292
+ * @param view view date
293
+ */
294
+ set view(view) {
295
+ this.views = view ? [view] : [];
296
+ }
297
+ get view() {
298
+ return this.views[0] || '';
299
+ }
300
+ /**
301
+ * Set the current calendar views for duplex mode
302
+ * Accepted format: 'yyyy-MM'
303
+ * @param views view dates
304
+ * @type {string[]}
305
+ */
306
+ set views(views) {
307
+ const oldViews = this._views;
308
+ views = this.filterAndWarnInvalidViews(views);
309
+ if (oldViews.toString() !== views.toString()) {
310
+ this._views = views;
311
+ void this.requestUpdate('views', oldViews);
312
+ }
313
+ }
314
+ get views() {
315
+ if (this._views.length) {
316
+ return this._views;
317
+ }
318
+ const now = new Date();
319
+ const from = this.values[0];
320
+ if (!this.isDuplex()) {
321
+ return [formatToView(from || now)];
322
+ }
323
+ const to = this.values[1];
324
+ // default duplex mode
325
+ if (this.isDuplexConsecutive() || !from || !to || formatToView(from) === formatToView(to) || isBefore(to, from)) {
326
+ return this.composeViews(formatToView(from || to || now), !from && to ? 1 : 0, []);
327
+ }
328
+ // duplex split if as from and to
329
+ return [formatToView(from), formatToView(to)];
330
+ }
331
+ /**
332
+ * Validates the input, marking the element as invalid if its value does not meet the validation criteria.
333
+ * @returns {void}
334
+ */
335
+ validateInput() {
336
+ const hasError = this.hasError();
337
+ if (this.error !== hasError) {
338
+ this.error = hasError;
339
+ this.notifyPropertyChange('error', this.error);
340
+ }
341
+ }
342
+ /**
343
+ * Updates the element
344
+ * @param changedProperties Properties that has changed
345
+ * @returns {void}
346
+ */
347
+ update(changedProperties) {
348
+ if (changedProperties.has('_values')) {
349
+ this.valuesToSegments();
350
+ }
351
+ if (changedProperties.has('opened') && this.opened) {
352
+ this.lazyRendered = true;
353
+ }
354
+ // make sure to close popup for disabled
355
+ if (this.opened && !this.canOpenPopup) {
356
+ this.opened = false; /* this cannot be nor stopped nor listened */
357
+ }
358
+ if (changedProperties.has('_values') || changedProperties.has(TranslatePropertyKey)) {
359
+ this.syncInputValues();
360
+ }
361
+ if (this.shouldValidateValue(changedProperties)) {
362
+ this.validateInput();
363
+ }
364
+ super.update(changedProperties);
365
+ }
366
+ /**
367
+ * Called after the component is first rendered
368
+ * @param changedProperties Properties which have changed
369
+ * @returns {void}
370
+ */
371
+ firstUpdated(changedProperties) {
372
+ super.firstUpdated(changedProperties);
373
+ this.addEventListener('keydown', this.onKeyDown);
374
+ this.addEventListener('tap', this.onTap);
375
+ }
376
+ /**
377
+ * Overwrite validation method for value
378
+ *
379
+ * @param value value
380
+ * @returns {boolean} result
381
+ */
382
+ isValidValue(value) {
383
+ if (value === '') {
384
+ return true;
385
+ }
386
+ return this.timepicker
387
+ ? isValidDateTime(value)
388
+ : isValidDate(value, DateFormat.yyyyMMdd);
389
+ }
390
+ /**
391
+ * Used to show a warning when the value does not pass the validation
392
+ * @param value that is invalid
393
+ * @returns {void}
394
+ */
395
+ warnInvalidValue(value) {
396
+ 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();
397
+ }
398
+ /**
399
+ * Show invalid view message
400
+ * @param value Invalid value
401
+ * @returns {void}
402
+ */
403
+ warnInvalidView(value) {
404
+ new WarningNotice(`The specified value "${value}" does not conform to the required format. The format is "yyyy-MM".`).show();
405
+ }
406
+ /**
407
+ * Convert value string array to date segments
408
+ * Warn invalid value if passed value does not confirm a segment
409
+ * @returns {void}
410
+ */
411
+ valuesToSegments() {
412
+ const newSegments = this.filterAndWarnInvalidValues(this._values).map(value => DateTimeSegment.fromString(value));
413
+ this._segments = newSegments;
414
+ this.interimSegments = newSegments;
415
+ }
416
+ /**
417
+ * Check if the value needs re-validation against min/max and format
418
+ * @param changedProperties Properties which have changed
419
+ * @returns needs re-validation
420
+ */
421
+ shouldValidateValue(changedProperties) {
422
+ // do not validate default value
423
+ if (changedProperties.has('_values') && changedProperties.get('_values') !== undefined
424
+ || changedProperties.has('min') && changedProperties.get('min') !== undefined
425
+ || changedProperties.has('max') && changedProperties.get('max') !== undefined
426
+ || changedProperties.has('showSeconds') && changedProperties.get('showSeconds') !== undefined) {
427
+ return true;
428
+ }
429
+ return false;
430
+ }
431
+ /**
432
+ * A helper method to make sure that only valid values are passed
433
+ * Warn if passed value is invalid
434
+ * @param values Values to check
435
+ * @returns Filtered collection of values
436
+ */
437
+ filterAndWarnInvalidValues(values) {
438
+ return values.map(value => {
439
+ if (this.isValidValue(value)) {
440
+ return value;
441
+ }
442
+ this.warnInvalidValue(value);
443
+ return '';
444
+ });
445
+ }
446
+ /**
447
+ * A helper method to make sure that only valid views are passed
448
+ * Warn if passed view is invalid
449
+ * @param views Views to check
450
+ * @returns Filtered collection of values
451
+ */
452
+ filterAndWarnInvalidViews(views) {
453
+ for (let i = 0; i < views.length; i += 1) {
454
+ const view = views[i];
455
+ if (!isValidDate(view, DateFormat.yyyyMM)) {
456
+ this.warnInvalidView(view);
457
+ return []; /* if at least one view is invalid, do not care about the rest to avoid empty views */
458
+ }
459
+ }
460
+ return views;
461
+ }
462
+ /**
463
+ * Return true if calendar is in duplex mode
464
+ * @returns duplex
465
+ */
466
+ isDuplex() {
467
+ return this.isDuplexSplit() || this.isDuplexConsecutive();
468
+ }
469
+ /**
470
+ * Return true if calendar is in duplex split mode
471
+ * @returns duplex split
472
+ */
473
+ isDuplexSplit() {
474
+ return this.duplex === 'split';
475
+ }
476
+ /**
477
+ * Return true if calendar is in duplex consecutive mode
478
+ * @returns duplex consecutive
479
+ */
480
+ isDuplexConsecutive() {
481
+ return this.duplex === '' || this.duplex === 'consecutive';
482
+ }
483
+ /**
484
+ * Stop syncing input values and picker values
485
+ * @returns {void}
486
+ */
487
+ disableInputSync() {
488
+ this.inputSyncing = false;
489
+ }
490
+ /**
491
+ * Start syncing input values and picker values
492
+ * @returns {void}
493
+ */
494
+ enableInputSync() {
495
+ this.inputSyncing = true;
496
+ }
497
+ /**
498
+ * Synchronise input values and values
499
+ * @return {void}
500
+ */
501
+ syncInputValues() {
502
+ if (!this.inputSyncing) {
503
+ return;
504
+ }
505
+ // input values cannot be populated off interim segments as require a valid date
506
+ // date-fns formats to local if there is time info
507
+ this.inputValues = this._segments.map(segment => this.formatSegment(segment));
508
+ }
509
+ /**
510
+ * Format date segment according to format and locale
511
+ * @param segment Date segment
512
+ * @returns formatted string
513
+ */
514
+ formatSegment(segment) {
515
+ return segment.value ? inputFormat(segment.getTime(), this.format, {
516
+ locale: getDateFNSLocale(getLocale(this))
517
+ }) : '';
518
+ }
519
+ /**
520
+ * Construct view collection
521
+ * @param view The view that has changed
522
+ * @param index View index (0 - single, or from); (1 - to)
523
+ * @param [views=this.views] The original views collection
524
+ * @returns the new view collection
525
+ */
526
+ composeViews(view, index, views = this.views) {
527
+ view = formatToView(view);
528
+ if (!this.isDuplex()) {
529
+ return [view];
530
+ }
531
+ if (this.isDuplexConsecutive()) {
532
+ if (index === 0) { /* from */
533
+ return [view, formatToView(addMonths(view, 1))];
534
+ }
535
+ else { /* to */
536
+ return [formatToView(subMonths(view, 1)), view];
537
+ }
538
+ }
539
+ // duplex split
540
+ if (index === 0) { /* from. to must be after or the same */
541
+ let after = views[1] || addMonths(view, 1);
542
+ if (isBefore(after, view)) {
543
+ after = view;
544
+ }
545
+ return [view, formatToView(after)];
546
+ }
547
+ if (index === 1) { /* to. from must be before or the same */
548
+ let before = views[0] || subMonths(view, 1);
549
+ if (isAfter(before, view)) {
550
+ before = view;
551
+ }
552
+ return [formatToView(before), view];
553
+ }
554
+ return [];
555
+ }
556
+ /**
557
+ * An interim collection of segments to push values when all parts are populated
558
+ * and validated
559
+ * @param segments Segments
560
+ */
561
+ set interimSegments(segments) {
562
+ const interimSegments = segments.map(segment => DateTimeSegment.fromDateTimeSegment(segment));
563
+ this._interimSegments = interimSegments;
564
+ // cannot populate calendar if from is after to, it looks broken
565
+ this.calendarValues = this.isFromBeforeTo() ? interimSegments.map(segment => segment.dateSegment) : [];
566
+ this.timepickerValues = interimSegments.map(segment => segment.timeSegment);
567
+ }
568
+ /**
569
+ * Get interim segments. These are free to modify
570
+ * @returns interim segments
571
+ */
572
+ get interimSegments() {
573
+ return this._interimSegments;
574
+ }
575
+ /**
576
+ * Submit interim segments to values.
577
+ * Notify value-changed event.
578
+ * @returns true if values have changed. False otherwise
579
+ */
580
+ submitInterimSegments() {
581
+ const oldSegments = this._segments;
582
+ const newSegments = this.interimSegments;
583
+ // compare if different
584
+ if (oldSegments.toString() === newSegments.toString()) {
585
+ return false;
586
+ }
587
+ const newValues = newSegments.map(segment => segment.value);
588
+ // validate
589
+ for (let i = 0; i < newValues.length; i += 1) { /* need this step in case timepicker is not populated */
590
+ if (!this.isValidValue(newValues[i])) {
591
+ return false;
592
+ }
593
+ }
594
+ this.notifyValuesChange(newValues);
595
+ return true;
596
+ }
597
+ /**
598
+ * Notify that values array has been changed
599
+ * @param values A collection of string dates
600
+ * @returns {void}
601
+ */
602
+ notifyValuesChange(values) {
603
+ if (this.values.toString() !== values.toString()) {
604
+ this.values = values;
605
+ this.valuesToSegments(); /* need to be here to get correct value synchronously */
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
+ void 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 };