@limetech/lime-elements 40.23.0 → 40.24.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 (361) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/dom-BWMDM6En.js +32 -0
  3. package/dist/cjs/lime-elements.cjs.js +1 -1
  4. package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +1 -1
  5. package/dist/cjs/limel-action-bar_3.cjs.entry.js +4 -5
  6. package/dist/cjs/limel-ai-avatar.cjs.entry.js +2 -3
  7. package/dist/cjs/limel-badge_7.cjs.entry.js +12 -12
  8. package/dist/cjs/limel-banner.cjs.entry.js +1 -1
  9. package/dist/cjs/limel-button-group.cjs.entry.js +1 -1
  10. package/dist/cjs/limel-button.cjs.entry.js +2 -2
  11. package/dist/cjs/limel-callout.cjs.entry.js +2 -3
  12. package/dist/cjs/limel-card.cjs.entry.js +1 -1
  13. package/dist/cjs/limel-chart.cjs.entry.js +5 -6
  14. package/dist/cjs/limel-checkbox.cjs.entry.js +1 -1
  15. package/dist/cjs/limel-chip-set.cjs.entry.js +2 -3
  16. package/dist/cjs/limel-chip_2.cjs.entry.js +2 -3
  17. package/dist/cjs/limel-circular-progress.cjs.entry.js +1 -1
  18. package/dist/cjs/limel-code-diff.cjs.entry.js +2 -3
  19. package/dist/cjs/limel-code-editor.cjs.entry.js +2 -3
  20. package/dist/cjs/limel-collapsible-section.cjs.entry.js +2 -3
  21. package/dist/cjs/limel-color-picker-palette.cjs.entry.js +2 -2
  22. package/dist/cjs/limel-color-picker.cjs.entry.js +1 -1
  23. package/dist/cjs/limel-date-picker.cjs.entry.js +438 -27
  24. package/dist/cjs/limel-dialog.cjs.entry.js +2 -2
  25. package/dist/cjs/limel-dock.cjs.entry.js +3 -4
  26. package/dist/cjs/limel-drag-handle_2.cjs.entry.js +4 -5
  27. package/dist/cjs/limel-email-viewer.cjs.entry.js +2 -3
  28. package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +2 -2
  29. package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -2
  30. package/dist/cjs/limel-file.cjs.entry.js +2 -3
  31. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +123 -15
  32. package/dist/cjs/limel-flex-container.cjs.entry.js +1 -1
  33. package/dist/cjs/limel-form-header.cjs.entry.js +1 -1
  34. package/dist/cjs/limel-form.cjs.entry.js +65 -5
  35. package/dist/cjs/limel-grid.cjs.entry.js +1 -1
  36. package/dist/cjs/limel-header.cjs.entry.js +1 -1
  37. package/dist/cjs/limel-help_2.cjs.entry.js +3 -3
  38. package/dist/cjs/limel-helper-line_3.cjs.entry.js +4 -4
  39. package/dist/cjs/limel-hotkey_4.cjs.entry.js +5 -5
  40. package/dist/cjs/limel-icon-button.cjs.entry.js +1 -1
  41. package/dist/cjs/limel-icon.cjs.entry.js +1 -1
  42. package/dist/cjs/limel-info-tile.cjs.entry.js +2 -2
  43. package/dist/cjs/limel-list-item.cjs.entry.js +3 -4
  44. package/dist/cjs/limel-markdown.cjs.entry.js +1 -1
  45. package/dist/cjs/limel-masonry-layout.cjs.entry.js +1 -1
  46. package/dist/cjs/limel-menu-item-meta.cjs.entry.js +1 -1
  47. package/dist/cjs/limel-pagination-jump.cjs.entry.js +1 -2
  48. package/dist/cjs/limel-pagination.cjs.entry.js +6 -7
  49. package/dist/cjs/limel-picker.cjs.entry.js +6 -6
  50. package/dist/cjs/limel-popover_2.cjs.entry.js +2 -2
  51. package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -2
  52. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +2 -3
  53. package/dist/cjs/limel-radio-button-group.cjs.entry.js +1 -1
  54. package/dist/cjs/limel-radio-button.cjs.entry.js +2 -2
  55. package/dist/cjs/limel-resize-handle.cjs.entry.js +2 -3
  56. package/dist/cjs/limel-select.cjs.entry.js +1 -1
  57. package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
  58. package/dist/cjs/limel-side-panel.cjs.entry.js +2 -3
  59. package/dist/cjs/limel-slider.cjs.entry.js +4 -5
  60. package/dist/cjs/limel-snackbar.cjs.entry.js +3 -4
  61. package/dist/cjs/limel-split-button.cjs.entry.js +2 -2
  62. package/dist/cjs/limel-switch.cjs.entry.js +1 -1
  63. package/dist/cjs/limel-tab-bar.cjs.entry.js +1 -1
  64. package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
  65. package/dist/cjs/limel-table.cjs.entry.js +3 -4
  66. package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +4 -5
  67. package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
  68. package/dist/cjs/{live-message-BNl3Ihcz.js → live-message-CwxlKd60.js} +0 -30
  69. package/dist/cjs/loader.cjs.js +1 -1
  70. package/dist/cjs/{translations-JLP5icQ9.js → translations-BPsptVkN.js} +73 -3
  71. package/dist/collection/components/3d-hover-effect-glow/3d-hover-effect-glow.js +1 -1
  72. package/dist/collection/components/action-bar/action-bar-item/action-bar-overflow-menu.js +1 -1
  73. package/dist/collection/components/action-bar/action-bar.js +2 -2
  74. package/dist/collection/components/ai-avatar/ai-avatar.js +1 -1
  75. package/dist/collection/components/badge/badge.js +2 -2
  76. package/dist/collection/components/banner/banner.js +1 -1
  77. package/dist/collection/components/breadcrumbs/breadcrumbs.js +1 -1
  78. package/dist/collection/components/button/button.js +2 -2
  79. package/dist/collection/components/button-group/button-group.js +1 -1
  80. package/dist/collection/components/callout/callout.js +1 -1
  81. package/dist/collection/components/card/card.js +1 -1
  82. package/dist/collection/components/checkbox/checkbox.js +1 -1
  83. package/dist/collection/components/chip/chip.js +1 -1
  84. package/dist/collection/components/chip-set/chip-set.js +1 -1
  85. package/dist/collection/components/circular-progress/circular-progress.js +1 -1
  86. package/dist/collection/components/code-diff/code-diff.js +1 -1
  87. package/dist/collection/components/code-editor/code-editor.js +1 -1
  88. package/dist/collection/components/collapsible-section/collapsible-section.js +1 -1
  89. package/dist/collection/components/color-picker/color-picker-palette.js +2 -2
  90. package/dist/collection/components/color-picker/color-picker.js +1 -1
  91. package/dist/collection/components/date-picker/date-formatter.js +147 -1
  92. package/dist/collection/components/date-picker/date-picker.css +112 -0
  93. package/dist/collection/components/date-picker/date-picker.js +307 -26
  94. package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +77 -30
  95. package/dist/collection/components/date-picker/pickers/month-picker.js +3 -0
  96. package/dist/collection/components/date-picker/pickers/picker.js +37 -1
  97. package/dist/collection/components/date-picker/pickers/quarter-picker.js +3 -0
  98. package/dist/collection/components/date-picker/pickers/week-picker.js +21 -0
  99. package/dist/collection/components/date-picker/pickers/year-picker.js +24 -0
  100. package/dist/collection/components/dialog/dialog.js +2 -2
  101. package/dist/collection/components/dock/dock.js +2 -2
  102. package/dist/collection/components/drag-handle/drag-handle.js +1 -1
  103. package/dist/collection/components/email-viewer/email-viewer.js +1 -1
  104. package/dist/collection/components/file/file.js +1 -1
  105. package/dist/collection/components/file-dropzone/file-dropzone.js +1 -1
  106. package/dist/collection/components/file-input/file-input.js +1 -1
  107. package/dist/collection/components/flex-container/flex-container.js +1 -1
  108. package/dist/collection/components/form/fields/schema-field.js +19 -1
  109. package/dist/collection/components/form/form.js +30 -3
  110. package/dist/collection/components/form/form.test-schemas.js +11 -0
  111. package/dist/collection/components/form/invalid-input.js +14 -0
  112. package/dist/collection/components/form/widgets/date-picker.js +3 -1
  113. package/dist/collection/components/form-header/form-header.js +1 -1
  114. package/dist/collection/components/grid/grid.js +1 -1
  115. package/dist/collection/components/header/header.js +1 -1
  116. package/dist/collection/components/help/help-content.js +1 -1
  117. package/dist/collection/components/help/help.js +2 -2
  118. package/dist/collection/components/helper-line/helper-line.js +2 -2
  119. package/dist/collection/components/hotkey/hotkey.js +1 -1
  120. package/dist/collection/components/icon/icon.js +1 -1
  121. package/dist/collection/components/icon-button/icon-button.js +1 -1
  122. package/dist/collection/components/info-tile/info-tile.js +2 -2
  123. package/dist/collection/components/input-field/input-field.js +1 -1
  124. package/dist/collection/components/list/list.js +1 -1
  125. package/dist/collection/components/list-item/list-item.js +2 -2
  126. package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.js +1 -1
  127. package/dist/collection/components/markdown/markdown.js +1 -1
  128. package/dist/collection/components/masonry-layout/masonry-layout.js +1 -1
  129. package/dist/collection/components/menu/menu.js +1 -1
  130. package/dist/collection/components/menu-list/menu-list.js +1 -1
  131. package/dist/collection/components/menu-surface/menu-surface.js +1 -1
  132. package/dist/collection/components/notched-outline/notched-outline.js +1 -1
  133. package/dist/collection/components/pagination/pagination.js +1 -1
  134. package/dist/collection/components/picker/picker.js +1 -1
  135. package/dist/collection/components/popover/popover.js +1 -1
  136. package/dist/collection/components/popover-surface/popover-surface.js +1 -1
  137. package/dist/collection/components/portal/portal.js +1 -1
  138. package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
  139. package/dist/collection/components/radio-button-group/radio-button.js +2 -2
  140. package/dist/collection/components/resize-handle/resize-handle.js +1 -1
  141. package/dist/collection/components/scroller/scroller.js +2 -2
  142. package/dist/collection/components/select/select.js +1 -1
  143. package/dist/collection/components/shortcut/shortcut.js +1 -1
  144. package/dist/collection/components/side-panel/side-panel.js +1 -1
  145. package/dist/collection/components/slider/slider.js +3 -3
  146. package/dist/collection/components/snackbar/snackbar.js +2 -2
  147. package/dist/collection/components/spinner/spinner.js +1 -1
  148. package/dist/collection/components/split-button/split-button.js +2 -2
  149. package/dist/collection/components/switch/switch.js +1 -1
  150. package/dist/collection/components/tab-bar/tab-bar.js +1 -1
  151. package/dist/collection/components/tab-panel/tab-panel.js +1 -1
  152. package/dist/collection/components/table/table.js +2 -2
  153. package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +3 -3
  154. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +1 -1
  155. package/dist/collection/components/text-editor/text-editor.js +1 -1
  156. package/dist/collection/components/tooltip/tooltip-content.js +1 -1
  157. package/dist/collection/components/tooltip/tooltip.js +2 -2
  158. package/dist/collection/translations/da.js +2 -0
  159. package/dist/collection/translations/de.js +2 -0
  160. package/dist/collection/translations/en.js +2 -0
  161. package/dist/collection/translations/fi.js +2 -0
  162. package/dist/collection/translations/fr.js +2 -0
  163. package/dist/collection/translations/nl.js +2 -0
  164. package/dist/collection/translations/no.js +2 -0
  165. package/dist/collection/translations/sv.js +2 -0
  166. package/dist/esm/dom-B9Ofc5RB.js +30 -0
  167. package/dist/esm/lime-elements.js +1 -1
  168. package/dist/esm/limel-3d-hover-effect-glow.entry.js +1 -1
  169. package/dist/esm/limel-action-bar_3.entry.js +4 -5
  170. package/dist/esm/limel-ai-avatar.entry.js +2 -3
  171. package/dist/esm/limel-badge_7.entry.js +11 -11
  172. package/dist/esm/limel-banner.entry.js +1 -1
  173. package/dist/esm/limel-button-group.entry.js +1 -1
  174. package/dist/esm/limel-button.entry.js +2 -2
  175. package/dist/esm/limel-callout.entry.js +2 -3
  176. package/dist/esm/limel-card.entry.js +1 -1
  177. package/dist/esm/limel-chart.entry.js +1 -2
  178. package/dist/esm/limel-checkbox.entry.js +1 -1
  179. package/dist/esm/limel-chip-set.entry.js +2 -3
  180. package/dist/esm/limel-chip_2.entry.js +2 -3
  181. package/dist/esm/limel-circular-progress.entry.js +1 -1
  182. package/dist/esm/limel-code-diff.entry.js +2 -3
  183. package/dist/esm/limel-code-editor.entry.js +2 -3
  184. package/dist/esm/limel-collapsible-section.entry.js +2 -3
  185. package/dist/esm/limel-color-picker-palette.entry.js +2 -2
  186. package/dist/esm/limel-color-picker.entry.js +1 -1
  187. package/dist/esm/limel-date-picker.entry.js +435 -24
  188. package/dist/esm/limel-dialog.entry.js +2 -2
  189. package/dist/esm/limel-dock.entry.js +3 -4
  190. package/dist/esm/limel-drag-handle_2.entry.js +4 -5
  191. package/dist/esm/limel-email-viewer.entry.js +2 -3
  192. package/dist/esm/limel-file-dropzone_2.entry.js +2 -2
  193. package/dist/esm/limel-file-viewer.entry.js +1 -2
  194. package/dist/esm/limel-file.entry.js +2 -3
  195. package/dist/esm/limel-flatpickr-adapter.entry.js +118 -10
  196. package/dist/esm/limel-flex-container.entry.js +1 -1
  197. package/dist/esm/limel-form-header.entry.js +1 -1
  198. package/dist/esm/limel-form.entry.js +65 -5
  199. package/dist/esm/limel-grid.entry.js +1 -1
  200. package/dist/esm/limel-header.entry.js +1 -1
  201. package/dist/esm/limel-help_2.entry.js +3 -3
  202. package/dist/esm/limel-helper-line_3.entry.js +4 -4
  203. package/dist/esm/limel-hotkey_4.entry.js +5 -5
  204. package/dist/esm/limel-icon-button.entry.js +1 -1
  205. package/dist/esm/limel-icon.entry.js +1 -1
  206. package/dist/esm/limel-info-tile.entry.js +2 -2
  207. package/dist/esm/limel-list-item.entry.js +3 -4
  208. package/dist/esm/limel-markdown.entry.js +1 -1
  209. package/dist/esm/limel-masonry-layout.entry.js +1 -1
  210. package/dist/esm/limel-menu-item-meta.entry.js +1 -1
  211. package/dist/esm/limel-pagination-jump.entry.js +1 -2
  212. package/dist/esm/limel-pagination.entry.js +2 -3
  213. package/dist/esm/limel-picker.entry.js +4 -4
  214. package/dist/esm/limel-popover_2.entry.js +2 -2
  215. package/dist/esm/limel-profile-picture.entry.js +1 -2
  216. package/dist/esm/limel-prosemirror-adapter.entry.js +2 -3
  217. package/dist/esm/limel-radio-button-group.entry.js +1 -1
  218. package/dist/esm/limel-radio-button.entry.js +2 -2
  219. package/dist/esm/limel-resize-handle.entry.js +2 -3
  220. package/dist/esm/limel-select.entry.js +1 -1
  221. package/dist/esm/limel-shortcut.entry.js +1 -1
  222. package/dist/esm/limel-side-panel.entry.js +2 -3
  223. package/dist/esm/limel-slider.entry.js +4 -5
  224. package/dist/esm/limel-snackbar.entry.js +3 -4
  225. package/dist/esm/limel-split-button.entry.js +2 -2
  226. package/dist/esm/limel-switch.entry.js +1 -1
  227. package/dist/esm/limel-tab-bar.entry.js +1 -1
  228. package/dist/esm/limel-tab-panel.entry.js +1 -1
  229. package/dist/esm/limel-table.entry.js +3 -4
  230. package/dist/esm/limel-text-editor-link-menu.entry.js +4 -5
  231. package/dist/esm/limel-text-editor.entry.js +1 -1
  232. package/dist/esm/{live-message-BQAYeNiX.js → live-message-BKB4vu28.js} +1 -30
  233. package/dist/esm/loader.js +1 -1
  234. package/dist/esm/{translations-D9ZGrMhe.js → translations--i932i_D.js} +70 -2
  235. package/dist/lime-elements/lime-elements.esm.js +1 -1
  236. package/dist/lime-elements/p--i932i_D.js +1 -0
  237. package/dist/lime-elements/p-0700e83f.entry.js +1 -0
  238. package/dist/lime-elements/{p-95a486c8.entry.js → p-083aa41f.entry.js} +1 -1
  239. package/dist/lime-elements/p-08b1bfad.entry.js +1 -0
  240. package/dist/lime-elements/{p-8fe28845.entry.js → p-127ff801.entry.js} +1 -1
  241. package/dist/lime-elements/{p-764d2f86.entry.js → p-156ea100.entry.js} +1 -1
  242. package/dist/lime-elements/{p-1e0ced6a.entry.js → p-15f5e45e.entry.js} +1 -1
  243. package/dist/lime-elements/p-1c7fcafc.entry.js +1 -0
  244. package/dist/lime-elements/p-1e699935.entry.js +1 -0
  245. package/dist/lime-elements/{p-f71fbc9e.entry.js → p-1fa0fd7a.entry.js} +4 -4
  246. package/dist/lime-elements/{p-ce71c5b9.entry.js → p-22aaa1ae.entry.js} +1 -1
  247. package/dist/lime-elements/p-2a5113ef.entry.js +1 -0
  248. package/dist/lime-elements/p-2d698983.entry.js +1 -0
  249. package/dist/lime-elements/p-373032c0.entry.js +1 -0
  250. package/dist/lime-elements/{p-8e80a884.entry.js → p-391305a7.entry.js} +3 -3
  251. package/dist/lime-elements/p-391a227e.entry.js +1 -0
  252. package/dist/lime-elements/p-3a421be9.entry.js +1 -0
  253. package/dist/lime-elements/p-3d6ba932.entry.js +1 -0
  254. package/dist/lime-elements/{p-c8a34cef.entry.js → p-3f9acb22.entry.js} +1 -1
  255. package/dist/lime-elements/p-46695dd3.entry.js +1 -0
  256. package/dist/lime-elements/p-490ac19d.entry.js +1 -0
  257. package/dist/lime-elements/p-4bc550e5.entry.js +1 -0
  258. package/dist/lime-elements/{p-438fe49b.entry.js → p-4de3b35b.entry.js} +1 -1
  259. package/dist/lime-elements/p-4eee17f7.entry.js +1 -0
  260. package/dist/lime-elements/p-507965d9.entry.js +1 -0
  261. package/dist/lime-elements/p-51fde63a.entry.js +1 -0
  262. package/dist/lime-elements/{p-db9cb7ef.entry.js → p-557f0e46.entry.js} +1 -1
  263. package/dist/lime-elements/p-558a7e27.entry.js +1 -0
  264. package/dist/lime-elements/{p-c6b3448c.entry.js → p-5fcb39b8.entry.js} +1 -1
  265. package/dist/lime-elements/p-61c81d09.entry.js +16 -0
  266. package/dist/lime-elements/{p-f59447bf.entry.js → p-63f2f0b7.entry.js} +1 -1
  267. package/dist/lime-elements/p-65199efa.entry.js +1 -0
  268. package/dist/lime-elements/p-6567de01.entry.js +1 -0
  269. package/dist/lime-elements/{p-a6387dc7.entry.js → p-664dbc43.entry.js} +1 -1
  270. package/dist/lime-elements/{p-6ae093c8.entry.js → p-6b6b8ffe.entry.js} +1 -1
  271. package/dist/lime-elements/p-6f8305ac.entry.js +1 -0
  272. package/dist/lime-elements/{p-c0ebf7cc.entry.js → p-718431c1.entry.js} +1 -1
  273. package/dist/lime-elements/p-71ed9466.entry.js +1 -0
  274. package/dist/lime-elements/{p-7d0ffc60.entry.js → p-81c43fe9.entry.js} +1 -1
  275. package/dist/lime-elements/p-8e46d111.entry.js +1 -0
  276. package/dist/lime-elements/{p-d3f13124.entry.js → p-9cbfedad.entry.js} +1 -1
  277. package/dist/lime-elements/p-9e5a15d1.entry.js +1 -0
  278. package/dist/lime-elements/p-B9Ofc5RB.js +1 -0
  279. package/dist/lime-elements/p-CMedqTpE.js +1 -0
  280. package/dist/lime-elements/{p-e5abe390.entry.js → p-a1cd0dc0.entry.js} +1 -1
  281. package/dist/lime-elements/p-a5aa8c06.entry.js +1 -0
  282. package/dist/lime-elements/{p-c61e9b83.entry.js → p-ae634a68.entry.js} +1 -1
  283. package/dist/lime-elements/{p-c2056ebc.entry.js → p-b6334f4b.entry.js} +1 -1
  284. package/dist/lime-elements/{p-28957b5c.entry.js → p-b810b854.entry.js} +1 -1
  285. package/dist/lime-elements/{p-cf2d43c7.entry.js → p-bb45a5bb.entry.js} +1 -1
  286. package/dist/lime-elements/{p-54537c85.entry.js → p-be653ca9.entry.js} +1 -1
  287. package/dist/lime-elements/{p-40940a6c.entry.js → p-bfb98b0e.entry.js} +1 -1
  288. package/dist/lime-elements/{p-3f7fa772.entry.js → p-c1dbad1e.entry.js} +1 -1
  289. package/dist/lime-elements/{p-39d1e157.entry.js → p-c3b86df2.entry.js} +1 -1
  290. package/dist/lime-elements/p-c3d1aa57.entry.js +1 -0
  291. package/dist/lime-elements/p-c63d294b.entry.js +1 -0
  292. package/dist/lime-elements/{p-f3b93ce8.entry.js → p-c6eed240.entry.js} +1 -1
  293. package/dist/lime-elements/p-c7bcae67.entry.js +1 -0
  294. package/dist/lime-elements/p-ce418df1.entry.js +159 -0
  295. package/dist/lime-elements/{p-6053608a.entry.js → p-d078ea89.entry.js} +1 -1
  296. package/dist/lime-elements/p-d2f784a8.entry.js +1 -0
  297. package/dist/lime-elements/{p-48a412ed.entry.js → p-d51bf98b.entry.js} +1 -1
  298. package/dist/lime-elements/p-da9be21e.entry.js +1 -0
  299. package/dist/lime-elements/{p-a891f3e8.entry.js → p-e3cf45ed.entry.js} +1 -1
  300. package/dist/lime-elements/{p-909466b8.entry.js → p-e481fb53.entry.js} +1 -1
  301. package/dist/lime-elements/{p-0319f07f.entry.js → p-e8665e99.entry.js} +1 -1
  302. package/dist/lime-elements/{p-5dce791c.entry.js → p-eb812303.entry.js} +1 -1
  303. package/dist/types/components/date-picker/date-formatter.d.ts +12 -0
  304. package/dist/types/components/date-picker/date-picker.d.ts +59 -3
  305. package/dist/types/components/date-picker/flatpickr-adapter/flatpickr-adapter.d.ts +13 -2
  306. package/dist/types/components/date-picker/pickers/month-picker.d.ts +1 -0
  307. package/dist/types/components/date-picker/pickers/picker.d.ts +8 -1
  308. package/dist/types/components/date-picker/pickers/quarter-picker.d.ts +1 -0
  309. package/dist/types/components/date-picker/pickers/week-picker.d.ts +4 -0
  310. package/dist/types/components/date-picker/pickers/year-picker.d.ts +7 -0
  311. package/dist/types/components/form/fields/schema-field.d.ts +2 -0
  312. package/dist/types/components/form/form.d.ts +2 -0
  313. package/dist/types/components/form/form.test-schemas.d.ts +1 -0
  314. package/dist/types/components/form/invalid-input.d.ts +14 -0
  315. package/dist/types/components/form/widgets/date-picker.d.ts +1 -0
  316. package/dist/types/components.d.ts +31 -11
  317. package/dist/types/translations/da.d.ts +2 -0
  318. package/dist/types/translations/de.d.ts +2 -0
  319. package/dist/types/translations/en.d.ts +2 -0
  320. package/dist/types/translations/fi.d.ts +2 -0
  321. package/dist/types/translations/fr.d.ts +2 -0
  322. package/dist/types/translations/nl.d.ts +2 -0
  323. package/dist/types/translations/no.d.ts +2 -0
  324. package/dist/types/translations/sv.d.ts +2 -0
  325. package/package.json +2 -2
  326. package/dist/cjs/language-s0bKUCvO.js +0 -58
  327. package/dist/esm/language-VamkUr90.js +0 -55
  328. package/dist/lime-elements/p-0a7cbdc3.entry.js +0 -1
  329. package/dist/lime-elements/p-0f96e94d.entry.js +0 -1
  330. package/dist/lime-elements/p-1a0c5e45.entry.js +0 -1
  331. package/dist/lime-elements/p-401d5c92.entry.js +0 -1
  332. package/dist/lime-elements/p-430db3b9.entry.js +0 -1
  333. package/dist/lime-elements/p-43b62587.entry.js +0 -1
  334. package/dist/lime-elements/p-48dccb83.entry.js +0 -1
  335. package/dist/lime-elements/p-5c918155.entry.js +0 -1
  336. package/dist/lime-elements/p-66101ed6.entry.js +0 -1
  337. package/dist/lime-elements/p-7ab72b52.entry.js +0 -1
  338. package/dist/lime-elements/p-8d602078.entry.js +0 -1
  339. package/dist/lime-elements/p-8d9a2a22.entry.js +0 -1
  340. package/dist/lime-elements/p-8de4f0f3.entry.js +0 -1
  341. package/dist/lime-elements/p-99984c66.entry.js +0 -1
  342. package/dist/lime-elements/p-9d46f720.entry.js +0 -1
  343. package/dist/lime-elements/p-9e2b426c.entry.js +0 -1
  344. package/dist/lime-elements/p-C9dBa_Im.js +0 -1
  345. package/dist/lime-elements/p-Cw7VQSGU.js +0 -1
  346. package/dist/lime-elements/p-VamkUr90.js +0 -1
  347. package/dist/lime-elements/p-b1c7033b.entry.js +0 -16
  348. package/dist/lime-elements/p-b5451350.entry.js +0 -1
  349. package/dist/lime-elements/p-c75f3b0d.entry.js +0 -1
  350. package/dist/lime-elements/p-ca4247c4.entry.js +0 -1
  351. package/dist/lime-elements/p-d53421af.entry.js +0 -1
  352. package/dist/lime-elements/p-d8901e39.entry.js +0 -1
  353. package/dist/lime-elements/p-d89553b3.entry.js +0 -1
  354. package/dist/lime-elements/p-d93b8ce0.entry.js +0 -1
  355. package/dist/lime-elements/p-e97340c4.entry.js +0 -1
  356. package/dist/lime-elements/p-ec0c113d.entry.js +0 -1
  357. package/dist/lime-elements/p-f036ad27.entry.js +0 -1
  358. package/dist/lime-elements/p-f197000b.entry.js +0 -159
  359. package/dist/lime-elements/p-f5bb17eb.entry.js +0 -1
  360. package/dist/lime-elements/p-f6bc6658.entry.js +0 -1
  361. package/dist/lime-elements/p-fa1aa440.entry.js +0 -1
@@ -1,17 +1,167 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-BlsqxTB1.js');
4
+ var liveMessage = require('./live-message-CwxlKd60.js');
4
5
  var randomString = require('./random-string-CFCtFh5l.js');
5
6
  var device = require('./device-C9O7lYI9.js');
6
7
  require('./sv-Co78RX70.js');
7
8
  var moment = require('./moment-Cfsz2WF1.js');
8
- var language = require('./language-s0bKUCvO.js');
9
+ var translations = require('./translations-BPsptVkN.js');
9
10
  var component = require('./component-Cz24PdGy.js');
11
+ require('./debounce-DgDnRSlt.js');
12
+ require('./isObject-B6Osvvqp.js');
13
+ require('./toNumber-v-1DEwWD.js');
14
+ require('./isSymbol-DxAVNJfH.js');
15
+ require('./isObjectLike-Dlpn-j-1.js');
10
16
  require('./_commonjsHelpers-CFO10eej.js');
11
17
  require('./ponyfill-CHp7Zocr.js');
12
18
  require('./component-GW2n79GH.js');
13
19
  require('./component-DNiVfYHV.js');
14
20
 
21
+ // Literals first, so an `l` inside `[...]` is not expanded. Then longest
22
+ // first, since alternation takes the first match, not the longest.
23
+ const LONG_DATE_FORMAT_TOKENS = /\[[^\][]*\]|LTS|LLLL|LLL|LL|LT|L|lts|llll|lll|ll|lt|l/g;
24
+ // Literals, tokens (runs of one repeated letter) and separators.
25
+ const FORMAT_PARTS = /\[[^\][]*\]|([a-zA-Z])\1*|[^a-zA-Z[]+/g;
26
+ // Tokens moment parses leniently as one or two digits.
27
+ const ONE_OR_TWO_DIGIT_TOKENS = /^([MDHhkmsWw])\1?$/;
28
+ // Includes the narrow no-break space `Intl` puts before AM/PM.
29
+ const WHITESPACE = /\s+/g;
30
+ // ` - ` or `, ` between a date and a time. Separators inside a date, such
31
+ // as `-` in `YYYY-MM-DD`, must still be typed as in the format.
32
+ const DATE_TIME_JOINER = / ?, ?| - /g;
33
+ const TIME_SEPARATOR = /([Hhk]{1,2}|m{1,2})([:.])(?=m{1,2}|s{1,2})/g;
34
+ // Such as `[w]` in `[w] W GGGG`.
35
+ const WEEK_PREFIX = /^\[[^\][]*\]\s*(?=[Ww])/;
36
+ /**
37
+ * Expands localized tokens, e.g. `L` to `MM/DD/YYYY` for `en`.
38
+ * @param format - the moment format to expand, e.g. `L` or `L - LT`
39
+ * @param locale - the moment locale to expand it for
40
+ */
41
+ function expandLongDateFormatTokens(format, locale) {
42
+ if (!format) {
43
+ return format;
44
+ }
45
+ const localeData = moment.moment.localeData(locale);
46
+ return format.replaceAll(LONG_DATE_FORMAT_TOKENS, (token) => {
47
+ if (token.startsWith('[')) {
48
+ return token;
49
+ }
50
+ return (localeData.longDateFormat(token) ||
51
+ token);
52
+ });
53
+ }
54
+ /**
55
+ * Accepts fewer digits than the format has, e.g. `1/24/20` for
56
+ * `MM/DD/YYYY`, but rejects text that leaves part of the format unmatched.
57
+ * Moment's lenient mode alone accepts "01" as a complete date.
58
+ *
59
+ * Times and weeks are accepted in more forms than their format, e.g.
60
+ * `15.30` for `HH:mm` and `v. 4 26` for `[w] W GGGG`.
61
+ * @param date - the raw text to parse
62
+ * @param format - the moment format to parse it against
63
+ * @param locale - the moment locale to parse it in
64
+ */
65
+ function parseComplete(date, format, locale) {
66
+ const text = normalizeSeparators(date);
67
+ const expandedFormat = normalizeSeparators(expandLongDateFormatTokens(format, locale));
68
+ for (const candidate of getTimeSeparatorVariants(expandedFormat)) {
69
+ const parsed = parseLeniently(text, candidate, locale);
70
+ if (parsed) {
71
+ return parsed;
72
+ }
73
+ }
74
+ return null;
75
+ }
76
+ function parseLeniently(date, format, locale) {
77
+ const [weekText, weekFormat] = dropWeekPrefix(date, format);
78
+ const text = pivotWeekYears(weekText, weekFormat);
79
+ const parsed = moment.moment(text, weekFormat, locale, false);
80
+ if (!parsed.isValid()) {
81
+ return null;
82
+ }
83
+ const flags = parsed.parsingFlags();
84
+ if (flags.charsLeftOver > 0 ||
85
+ flags.unusedTokens.length > 0 ||
86
+ hasAmbiguousYear(text, weekFormat)) {
87
+ return null;
88
+ }
89
+ return parsed.toDate();
90
+ }
91
+ // Applied to both the text and the format, so they stay aligned.
92
+ function normalizeSeparators(text) {
93
+ return text
94
+ .trim()
95
+ .replaceAll(WHITESPACE, ' ')
96
+ .replaceAll(DATE_TIME_JOINER, ' ');
97
+ }
98
+ function getTimeSeparatorVariants(format) {
99
+ const swapped = format.replaceAll(TIME_SEPARATOR, (_, part, separator) => part + (separator === ':' ? '.' : ':'));
100
+ return swapped === format ? [format] : [format, swapped];
101
+ }
102
+ // Accepts any prefix, e.g. `v.`, `w` or none, for `[w] W GGGG`.
103
+ function dropWeekPrefix(date, format) {
104
+ if (!WEEK_PREFIX.test(format)) {
105
+ return [date, format];
106
+ }
107
+ return [date.replace(/^\D*/, ''), format.replace(WEEK_PREFIX, '')];
108
+ }
109
+ // Moment pivots a 2-digit `YYYY`, e.g. `26` to 2026, but not `GGGG`.
110
+ function pivotWeekYears(date, format) {
111
+ const twoDigitWeekYears = findYears(date, format).filter(({ token, start, end }) => token === 'GGGG' && end - start === 2);
112
+ return twoDigitWeekYears.reduceRight((text, { start, end }) => text.slice(0, start) +
113
+ moment.moment.parseTwoDigitYear(text.slice(start, end)) +
114
+ text.slice(end), date);
115
+ }
116
+ // Lenient parsing reads a half-typed year such as "1/24/2" as year 2.
117
+ function hasAmbiguousYear(date, format) {
118
+ return findYears(date, format).some(({ start, end }) => {
119
+ const digitCount = end - start;
120
+ return digitCount !== 2 && digitCount !== 4;
121
+ });
122
+ }
123
+ function findYears(date, format) {
124
+ const formatParts = format.match(FORMAT_PARTS) || [];
125
+ const inputPattern = formatParts.map(formatPartToPattern).join('');
126
+ const match = new RegExp(`^${inputPattern}$`, 'd').exec(date);
127
+ if (!match) {
128
+ return [];
129
+ }
130
+ return formatParts.filter(isYearToken).map((token, index) => {
131
+ const [start, end] = match.indices[index + 1];
132
+ return { token: token, start: start, end: end };
133
+ });
134
+ }
135
+ function isYearToken(part) {
136
+ return part === 'YYYY' || part === 'GGGG';
137
+ }
138
+ /**
139
+ * Literals and separators are optional, since lenient parsing skips them
140
+ * when they are not typed, e.g. `01242026` for `MM/DD/YYYY`.
141
+ * @param part - a literal, token or separator of the format
142
+ */
143
+ function formatPartToPattern(part) {
144
+ if (part.startsWith('[')) {
145
+ return optional(part.slice(1, -1));
146
+ }
147
+ if (isYearToken(part)) {
148
+ return String.raw `(\d{1,4})`;
149
+ }
150
+ if (ONE_OR_TWO_DIGIT_TOKENS.test(part)) {
151
+ return String.raw `\d{1,2}`;
152
+ }
153
+ if (/^[a-zA-Z]+$/.test(part)) {
154
+ return '.+?';
155
+ }
156
+ // Moment matches each separator character on its own.
157
+ return [...part].map(optional).join('');
158
+ }
159
+ function optional(text) {
160
+ return `(?:${escapeRegExp(text)})?`;
161
+ }
162
+ function escapeRegExp(text) {
163
+ return text.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw `\$&`);
164
+ }
15
165
  class DateFormatter {
16
166
  constructor(language = 'en') {
17
167
  this.language = language;
@@ -24,16 +174,18 @@ class DateFormatter {
24
174
  }
25
175
  parseDate(date, dateFormat) {
26
176
  if (date) {
27
- return moment.moment(date, dateFormat).toDate();
177
+ // Importing the moment locales changes moment's global default
178
+ // locale, so tokens like `L` must be parsed with ours.
179
+ return parseComplete(date, dateFormat, this.getLanguage());
28
180
  }
29
181
  return null;
30
182
  }
31
183
  getLanguage() {
32
- const language$1 = language.getPrimarySubtag(this.language);
33
- if (language$1 === 'no') {
184
+ const language = translations.getPrimarySubtag(this.language);
185
+ if (language === 'no') {
34
186
  return 'nb';
35
187
  }
36
- return language$1;
188
+ return language;
37
189
  }
38
190
  getDateFormat(type) {
39
191
  return ({
@@ -48,7 +200,7 @@ class DateFormatter {
48
200
  }
49
201
  }
50
202
 
51
- const datePickerCss = () => `:host(limel-date-picker){position:relative}limel-input-field[disabled],limel-input-field[readonly]{pointer-events:none}`;
203
+ const datePickerCss = () => `@charset "UTF-8";:host(limel-date-picker){position:relative}limel-input-field[disabled],limel-input-field[readonly]{pointer-events:none}.error-message{position:absolute;width:0;height:0;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap}`;
52
204
 
53
205
  // tslint:disable:no-duplicate-string
54
206
  const nativeTypeForConsumerType = {
@@ -75,6 +227,7 @@ const DatePicker = class {
75
227
  constructor(hostRef) {
76
228
  index.registerInstance(this, hostRef);
77
229
  this.change = index.createEvent(this, "change", 7);
230
+ this.invalidInput = index.createEvent(this, "invalidInput", 7);
78
231
  /**
79
232
  * Set to `true` to disable the field.
80
233
  * Use `disabled` to indicate that the field can normally be interacted
@@ -90,7 +243,8 @@ const DatePicker = class {
90
243
  this.readonly = false;
91
244
  /**
92
245
  * Set to `true` to indicate that the current value of the date picker is
93
- * invalid.
246
+ * invalid. Typed text that is not a valid date is flagged by the
247
+ * component itself, whatever this is set to.
94
248
  */
95
249
  this.invalid = false;
96
250
  /**
@@ -107,15 +261,85 @@ const DatePicker = class {
107
261
  */
108
262
  this.language = 'en';
109
263
  this.showPortal = false;
264
+ this.parseError = false;
265
+ this.isEditing = false;
110
266
  this.portalId = `date-picker-calendar-${randomString.createRandomString()}`;
267
+ // Screen readers don't announce a changed description of the focused
268
+ // field, so the error is spoken through a live region.
269
+ this.errorMessage = liveMessage.createLiveMessage(() => this.parseError ? this.getHelperText() : '');
111
270
  this.documentClickListener = (event) => {
112
271
  if (event.composedPath().includes(this.textField)) {
113
272
  return;
114
273
  }
115
274
  const element = document.querySelector(`#${this.portalId}`);
116
- if (!element.contains(event.target)) {
117
- this.hideCalendar();
275
+ if (element.contains(event.target)) {
276
+ return;
277
+ }
278
+ // The input's own blur, which follows, closes the calendar with the
279
+ // final typed text.
280
+ if (this.textField.shadowRoot.activeElement === this.inputElement) {
281
+ return;
118
282
  }
283
+ this.hideCalendar();
284
+ };
285
+ this.handleKeyDown = (event) => {
286
+ var _a;
287
+ if (this.disabled || this.readonly) {
288
+ return;
289
+ }
290
+ this.discardedText = undefined;
291
+ const handlers = {
292
+ ArrowDown: this.handleArrowDown,
293
+ Escape: this.handleEscape,
294
+ Enter: this.handleEnter,
295
+ Backspace: this.handleDelete,
296
+ Delete: this.handleDelete,
297
+ };
298
+ (_a = handlers[event.key]) === null || _a === void 0 ? void 0 : _a.call(handlers, event);
299
+ };
300
+ this.handleArrowDown = async (event) => {
301
+ var _a;
302
+ event.preventDefault();
303
+ if (!this.showPortal) {
304
+ this.showPortal = true;
305
+ return;
306
+ }
307
+ await ((_a = this.datePickerCalendar) === null || _a === void 0 ? void 0 : _a.focusDay());
308
+ };
309
+ // The first Escape discards typed text, the next closes the calendar.
310
+ // Stopping it keeps a surrounding dialog open.
311
+ this.handleEscape = (event) => {
312
+ if (this.hasTypedText()) {
313
+ this.discardTypedText();
314
+ }
315
+ else if (this.showPortal) {
316
+ this.showPortal = false;
317
+ }
318
+ else {
319
+ return;
320
+ }
321
+ event.preventDefault();
322
+ event.stopPropagation();
323
+ };
324
+ // Reads the input, since the input field emits its text debounced.
325
+ this.handleEnter = () => {
326
+ var _a, _b;
327
+ if (!this.acceptsTypedInput()) {
328
+ return;
329
+ }
330
+ const currentText = (_b = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
331
+ this.rawInputValue = currentText;
332
+ if (currentText !== '' && !this.parseText(currentText)) {
333
+ this.parseError = true;
334
+ return;
335
+ }
336
+ this.commitTypedText();
337
+ };
338
+ this.handleDelete = () => {
339
+ if (this.acceptsTypedInput() || !this.value) {
340
+ return;
341
+ }
342
+ this.clearValue();
119
343
  };
120
344
  this.formatValue = (value) => this.dateFormatter.formatDate(value, this.internalFormat);
121
345
  this.handleCalendarChange = this.handleCalendarChange.bind(this);
@@ -129,6 +353,8 @@ const DatePicker = class {
129
353
  this.nativeChangeHandler = this.nativeChangeHandler.bind(this);
130
354
  this.preventBlurFromCalendarContainer =
131
355
  this.preventBlurFromCalendarContainer.bind(this);
356
+ this.commitTypedText = this.commitTypedText.bind(this);
357
+ this.handleInputBlur = this.handleInputBlur.bind(this);
132
358
  }
133
359
  componentWillLoad() {
134
360
  this.useNative = !this.readonly && (device.isIOSDevice() || device.isAndroidDevice());
@@ -138,7 +364,28 @@ const DatePicker = class {
138
364
  this.updateInternalFormatAndType();
139
365
  }
140
366
  disconnectedCallback() {
367
+ var _a;
141
368
  this.removeDocumentListeners();
369
+ (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.removeEventListener('blur', this.handleInputBlur);
370
+ this.errorMessage.update.cancel();
371
+ }
372
+ // Consumers such as `limel-form` pass a new `Date` on every render.
373
+ watchValue(newValue, oldValue) {
374
+ if ((newValue === null || newValue === void 0 ? void 0 : newValue.getTime()) === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.getTime())) {
375
+ return;
376
+ }
377
+ this.resetTypedText();
378
+ }
379
+ watchParseError() {
380
+ this.errorMessage.update();
381
+ this.invalidInput.emit(this.parseError ? this.getInvalidInputMessage() : null);
382
+ }
383
+ watchFormatInputs() {
384
+ this.resetTypedText();
385
+ }
386
+ watchLanguage() {
387
+ this.dateFormatter = new DateFormatter(this.language);
388
+ this.resetTypedText();
142
389
  }
143
390
  render() {
144
391
  const inputProps = {
@@ -147,24 +394,56 @@ const DatePicker = class {
147
394
  if (this.value && !this.readonly && !this.disabled) {
148
395
  inputProps.trailingIcon = 'clear_symbol';
149
396
  }
150
- const helperText = this.disabled || this.readonly ? undefined : this.helperText;
397
+ const helperText = this.getHelperText();
151
398
  if (this.useNative) {
152
399
  return (index.h("limel-input-field", { disabled: this.disabled, readonly: this.readonly, invalid: this.invalid, label: this.label, helperText: helperText, required: this.required, value: this.formatValue(this.value), type: this.nativeType, onChange: this.nativeChangeHandler }));
153
400
  }
154
401
  const dropdownZIndex = getComputedStyle(this.host).getPropertyValue('--dropdown-z-index');
155
402
  const formatter = this.formatter || this.formatValue;
156
403
  return [
157
- index.h("limel-input-field", Object.assign({ disabled: this.disabled, readonly: this.readonly, invalid: this.invalid, label: this.label, placeholder: this.placeholder, helperText: helperText, required: this.required, value: this.value ? formatter(this.value) : '', onFocus: this.showCalendar, onBlur: this.hideCalendar, onClick: this.onInputClick, onChange: this.handleInputElementChange, ref: (el) => (this.textField = el) }, inputProps)),
158
- index.h("limel-portal", { containerId: this.portalId, visible: this.showPortal, containerStyle: { 'z-index': dropdownZIndex } }, index.h("limel-flatpickr-adapter", { format: this.internalFormat, language: this.language, type: this.type, value: this.value, ref: (el) => (this.datePickerCalendar = el), isOpen: this.showPortal, formatter: formatter, onChange: this.handleCalendarChange })),
404
+ index.h("limel-input-field", Object.assign({ disabled: this.disabled, readonly: this.readonly, invalid: this.invalid || this.parseError, label: this.label, placeholder: this.placeholder, helperText: helperText, required: this.required, value: this.getDisplayValue(formatter), onFocus: this.showCalendar, onBlur: this.hideCalendar, onClick: this.onInputClick, onChange: this.handleInputElementChange, onKeyDown: this.handleKeyDown, ref: (el) => (this.textField = el) }, inputProps)),
405
+ index.h("span", { class: "error-message", "aria-live": "polite", ref: this.errorMessage.setElement }),
406
+ index.h("limel-portal", { containerId: this.portalId, visible: this.showPortal, containerStyle: { 'z-index': dropdownZIndex } }, index.h("limel-flatpickr-adapter", { format: this.internalFormat, language: this.language, type: this.type, value: this.value, previewValue: this.previewValue, ref: (el) => (this.datePickerCalendar = el), isOpen: this.showPortal, onChange: this.handleCalendarChange })),
159
407
  ];
160
408
  }
409
+ getDisplayValue(formatter) {
410
+ if (this.rawInputValue !== undefined) {
411
+ return this.rawInputValue;
412
+ }
413
+ if (!this.value) {
414
+ return '';
415
+ }
416
+ return this.isEditing && this.acceptsTypedInput()
417
+ ? this.formatValue(this.value)
418
+ : formatter(this.value);
419
+ }
420
+ acceptsTypedInput() {
421
+ return !this.formatter || !!this.format;
422
+ }
423
+ getHelperText() {
424
+ if (this.parseError) {
425
+ return this.getInvalidInputMessage();
426
+ }
427
+ if (this.disabled || this.readonly) {
428
+ return undefined;
429
+ }
430
+ return this.helperText;
431
+ }
432
+ getInvalidInputMessage() {
433
+ const key = this.type === 'time'
434
+ ? 'date-picker.invalid-time-format'
435
+ : 'date-picker.invalid-format';
436
+ return translations.translations.get(key, this.language, {
437
+ example: this.formatValue(new Date()),
438
+ });
439
+ }
161
440
  updateInternalFormatAndType() {
162
441
  this.nativeType = nativeTypeForConsumerType[this.type || 'default'];
163
442
  this.nativeFormat = nativeFormatForType[this.nativeType];
164
443
  if (this.useNative) {
165
444
  this.internalFormat = this.nativeFormat;
166
445
  }
167
- else if (this.formatter || this.format) {
446
+ else if (this.format) {
168
447
  this.internalFormat = this.format;
169
448
  }
170
449
  else {
@@ -173,19 +452,27 @@ const DatePicker = class {
173
452
  }
174
453
  nativeChangeHandler(event) {
175
454
  event.stopPropagation();
176
- const date = this.dateFormatter.parseDate(event.detail, this.internalFormat);
177
- this.change.emit(date);
455
+ if (event.detail === '') {
456
+ this.clearValue();
457
+ return;
458
+ }
459
+ const date = this.parseText(event.detail);
460
+ if (date) {
461
+ this.change.emit(date);
462
+ }
178
463
  }
179
464
  showCalendar(event) {
180
465
  if (this.disabled || this.readonly) {
181
466
  event.stopPropagation();
182
467
  return;
183
468
  }
469
+ this.isEditing = true;
184
470
  this.showPortal = true;
185
- const inputElement = this.textField.shadowRoot.querySelector('input');
186
- setTimeout(() => {
187
- this.datePickerCalendar.inputElement = inputElement;
188
- }, 0);
471
+ this.setUpInputElement();
472
+ // Wait for the adapter to render. This creates the calendar.
473
+ queueMicrotask(() => {
474
+ this.datePickerCalendar.inputElement = this.inputElement;
475
+ });
189
476
  event.stopPropagation();
190
477
  document.addEventListener('mousedown', this.documentClickListener, {
191
478
  passive: true,
@@ -194,6 +481,25 @@ const DatePicker = class {
194
481
  capture: true,
195
482
  });
196
483
  }
484
+ // Tabbing to the clear icon doesn't blur the input field, only its
485
+ // input. Its `readonly` prop would also stop the calendar from opening.
486
+ setUpInputElement() {
487
+ this.inputElement = this.textField.shadowRoot.querySelector('input');
488
+ this.inputElement.readOnly = !this.acceptsTypedInput();
489
+ this.inputElement.addEventListener('blur', this.handleInputBlur);
490
+ }
491
+ handleInputBlur(event) {
492
+ const nextFocus = event.relatedTarget;
493
+ this.commitTypedText();
494
+ if (!nextFocus) {
495
+ return;
496
+ }
497
+ requestAnimationFrame(() => {
498
+ if (!nextFocus.isConnected) {
499
+ this.inputElement.focus();
500
+ }
501
+ });
502
+ }
197
503
  preventBlurFromCalendarContainer(event) {
198
504
  // We don't want the input element to lose focus when we pick
199
505
  // a date in the calendar container.
@@ -205,6 +511,8 @@ const DatePicker = class {
205
511
  }
206
512
  }
207
513
  hideCalendar() {
514
+ this.isEditing = false;
515
+ this.commitTypedText();
208
516
  setTimeout(() => {
209
517
  this.showPortal = false;
210
518
  }, 0);
@@ -227,15 +535,21 @@ const DatePicker = class {
227
535
  }
228
536
  const mdcTextField = new component.MDCTextField(root);
229
537
  mdcTextField.getDefaultFoundation().deactivateFocus();
230
- mdcTextField.valid = !this.invalid;
538
+ mdcTextField.valid = !(this.invalid || this.parseError);
539
+ // Removes the listeners but keeps the classes set above.
540
+ mdcTextField.destroy();
231
541
  }
232
542
  handleCalendarChange(event) {
233
- const date = event.detail;
543
+ var _a;
234
544
  event.stopPropagation();
545
+ // Reset before hiding, or text typed earlier is committed over the
546
+ // pick. Preview the pick until the consumer echoes it back.
547
+ this.resetTypedText();
548
+ this.previewValue = (_a = event.detail) !== null && _a !== void 0 ? _a : undefined;
235
549
  if (this.pickerIsAutoClosing()) {
236
550
  this.hideCalendar();
237
551
  }
238
- this.change.emit(date);
552
+ this.change.emit(event.detail);
239
553
  }
240
554
  onInputClick(event) {
241
555
  if (this.disabled || this.readonly || this.showPortal) {
@@ -244,22 +558,119 @@ const DatePicker = class {
244
558
  this.showCalendar(event);
245
559
  }
246
560
  handleInputElementChange(event) {
247
- if (this.disabled || this.readonly) {
248
- event.stopPropagation();
561
+ event.stopPropagation();
562
+ if (this.disabled || this.readonly || !this.acceptsTypedInput()) {
249
563
  return;
250
564
  }
251
- if (event.detail === '') {
252
- this.clearValue();
565
+ const text = event.detail;
566
+ if (text === this.discardedText) {
567
+ return;
253
568
  }
254
- event.stopPropagation();
569
+ const date = text === '' ? null : this.parseText(text);
570
+ this.rawInputValue = text;
571
+ this.previewValue = date !== null && date !== void 0 ? date : undefined;
572
+ // Half-typed text is only flagged on commit.
573
+ if (date || text === '') {
574
+ this.parseError = false;
575
+ }
576
+ }
577
+ hasTypedText() {
578
+ var _a;
579
+ return (this.rawInputValue !== undefined ||
580
+ ((_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value) !== this.getCommittedText());
581
+ }
582
+ // The input field only rewrites its text when its `value` changes.
583
+ discardTypedText() {
584
+ var _a;
585
+ this.discardedText = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value;
586
+ this.resetTypedText();
587
+ if (this.inputElement) {
588
+ this.inputElement.value = this.getCommittedText();
589
+ }
590
+ }
591
+ getCommittedText() {
592
+ return this.getDisplayValue(this.formatter || this.formatValue);
593
+ }
594
+ commitTypedText() {
595
+ const text = this.rawInputValue;
596
+ if (text === undefined || text === this.committedText) {
597
+ return;
598
+ }
599
+ const currentText = this.value ? this.formatValue(this.value) : '';
600
+ if (text === currentText) {
601
+ this.resetTypedText();
602
+ return;
603
+ }
604
+ if (text === '') {
605
+ this.commitEmptyText();
606
+ return;
607
+ }
608
+ this.commitDate(text);
609
+ }
610
+ commitEmptyText() {
611
+ this.parseError = false;
612
+ if (this.value) {
613
+ this.emitCommitted('', null);
614
+ }
615
+ else {
616
+ this.rawInputValue = undefined;
617
+ }
618
+ }
619
+ commitDate(text) {
620
+ var _a;
621
+ const date = this.parseText(text);
622
+ if (!date) {
623
+ this.parseError = true;
624
+ return;
625
+ }
626
+ if (date.getTime() === ((_a = this.value) === null || _a === void 0 ? void 0 : _a.getTime())) {
627
+ this.resetTypedText();
628
+ return;
629
+ }
630
+ this.parseError = false;
631
+ this.emitCommitted(text, date);
632
+ }
633
+ // Keeps `rawInputValue` until `watchValue` resets it, or the old value
634
+ // flashes.
635
+ emitCommitted(text, date) {
636
+ this.committedText = text;
637
+ this.change.emit(date);
638
+ }
639
+ parseText(text) {
640
+ const date = this.dateFormatter.parseDate(text, this.internalFormat);
641
+ return date && !Number.isNaN(date.getTime()) ? date : null;
642
+ }
643
+ resetTypedText() {
644
+ this.parseError = false;
645
+ this.committedText = undefined;
646
+ this.rawInputValue = undefined;
647
+ this.previewValue = undefined;
255
648
  }
256
649
  pickerIsAutoClosing() {
257
650
  return this.type !== 'datetime' && this.type !== 'time';
258
651
  }
259
652
  clearValue() {
653
+ this.resetTypedText();
260
654
  this.change.emit(null);
261
655
  }
262
656
  get host() { return index.getElement(this); }
657
+ static get watchers() { return {
658
+ "value": [{
659
+ "watchValue": 0
660
+ }],
661
+ "parseError": [{
662
+ "watchParseError": 0
663
+ }],
664
+ "format": [{
665
+ "watchFormatInputs": 0
666
+ }],
667
+ "type": [{
668
+ "watchFormatInputs": 0
669
+ }],
670
+ "language": [{
671
+ "watchLanguage": 0
672
+ }]
673
+ }; }
263
674
  };
264
675
  DatePicker.style = datePickerCss();
265
676
 
@@ -1020,10 +1020,10 @@ const Dialog = class {
1020
1020
  this.mdcDialog.destroy();
1021
1021
  }
1022
1022
  render() {
1023
- return (index.h("div", { key: 'a9a3f26e3da86f1659487affe5a8758dca4cefb9', class: {
1023
+ return (index.h("div", { key: '3e1a6defb45d3a7db6569742226cb0f6f417fb6e', class: {
1024
1024
  'mdc-dialog': true,
1025
1025
  'full-screen': !!this.fullscreen,
1026
- }, role: "alertdialog", "aria-modal": "true", "aria-labelledby": 'limel-dialog-title-' + this.id, "aria-describedby": 'limel-dialog-content-' + this.id }, index.h("input", { key: '792d35f0b5c497bac447327c2aafdd74e3b8c0ee', hidden: true, id: "initialFocusEl" }), index.h("div", { key: 'a4331ee65f7ff242ee2af707281a1051f307a218', class: "mdc-dialog__container" }, index.h("div", { key: 'c4e1ef542e1078fe65bb6c299a890da6242c154e', class: "mdc-dialog__surface" }, index.h("input", { key: '626470072fbed50ef98ab29e32ad0d219018cb51', type: "button", id: "initialFocusElement" }), this.renderHeading(), index.h("div", { key: '8399fa33d6b6d342848f7051fc92b4bde9b02f8e', class: "mdc-dialog__content", id: 'limel-dialog-content-' + this.id }, index.h("slot", { key: '94f1d56d78fd5e5f0cc483c622b1138ed7148a2e' })), this.renderFooter())), index.h("div", { key: '22a1c2516049f8a8d444fbb60c0009cb96dffe9f', class: "mdc-dialog__scrim" })));
1026
+ }, role: "alertdialog", "aria-modal": "true", "aria-labelledby": 'limel-dialog-title-' + this.id, "aria-describedby": 'limel-dialog-content-' + this.id }, index.h("input", { key: '4a5f5cbd39cefc237854e87a3bd26c9a371d0703', hidden: true, id: "initialFocusEl" }), index.h("div", { key: 'cea96e7efebe5f92b65c36f9e9ff4b4814cf6245', class: "mdc-dialog__container" }, index.h("div", { key: '2002f463e8289d8e11974818e8339cd8506d9172', class: "mdc-dialog__surface" }, index.h("input", { key: 'ff0f029260dcd53f59f0ac7882b917e7fdff41a1', type: "button", id: "initialFocusElement" }), this.renderHeading(), index.h("div", { key: 'd2f23c68ef6fa558c7d40b7a729173bfc6c1e120', class: "mdc-dialog__content", id: 'limel-dialog-content-' + this.id }, index.h("slot", { key: '7b990ba91a610dad210627c1e6075b4db6ecd0c8' })), this.renderFooter())), index.h("div", { key: 'b878b47719571bac33c5f8f04e6271d11fd7bf69', class: "mdc-dialog__scrim" })));
1027
1027
  }
1028
1028
  watchHandler(newValue, oldValue) {
1029
1029
  if (oldValue === newValue || !this.mdcDialog) {
@@ -1,8 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-BlsqxTB1.js');
4
- var translations = require('./translations-JLP5icQ9.js');
5
- require('./language-s0bKUCvO.js');
4
+ var translations = require('./translations-BPsptVkN.js');
6
5
 
7
6
  const dockCss = () => `@charset "UTF-8";button.expand-shrink{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit;box-sizing:border-box;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent}button.expand-shrink:hover,button.expand-shrink:focus,button.expand-shrink:focus-visible{will-change:color, background-color, box-shadow, transform}button.expand-shrink:hover,button.expand-shrink:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}button.expand-shrink:hover{box-shadow:var(--button-shadow-hovered)}button.expand-shrink:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}button.expand-shrink:hover,button.expand-shrink:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}button.expand-shrink:focus{outline:none}button.expand-shrink:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button.expand-shrink{display:flex;justify-content:center;align-items:center;height:var(--dock-expand-shrink-button-height);padding:0 0.5rem;margin:var(--limel-dock-padding);border-radius:0.375rem}button.expand-shrink.expanded{justify-content:flex-end}button.expand-shrink.expanded limel-icon{transform:rotateY(180deg)}button.expand-shrink limel-icon{width:calc(var(--dock-expand-shrink-button-height) - 0.25rem);color:var(--dock-item-icon-color, var(--limel-dock-item-text-color))}:host(limel-dock){--badge-background-color:rgb(var(--color-red-default));--badge-text-color:rgb(var(--color-white));--dock-item-height:2.75rem;--limel-dock-padding:0.25rem;--dock-expand-shrink-button-height:1rem;--limel-dock-item-text-color:var( --dock-item-text-color, rgb(var(--contrast-1100)) );--limel-dock-item-text-color--selected:var( --dock-item-text-color--selected, rgb(var(--contrast-1300)) );isolation:isolate;position:relative;box-sizing:border-box;display:inline-flex;flex-direction:column;background-color:var(--dock-background-color, rgb(var(--contrast-100)));box-shadow:var(--shadow-depth-8);padding-top:var(--dock-padding-top);padding-right:var(--dock-padding-right);padding-bottom:var(--dock-padding-bottom);padding-left:var(--dock-padding-left)}:host(limel-dock:not(.has-mobile-layout)){height:100%;width:calc(var(--limel-dock-padding) * 2 + var(--dock-item-height) + var(--dock-padding-left, 0px) + var(--dock-padding-right, 0px))}:host(limel-dock:not(.has-mobile-layout)) nav{padding-bottom:calc(var(--limel-dock-padding) + 0.25rem)}:host(limel-dock.expanded:not(.has-mobile-layout)){width:calc(var(--dock-expanded-max-width, 10rem) + var(--dock-padding-left, 0px) + var(--dock-padding-right, 0px))}.footer-separator{margin-top:auto;justify-self:flex-end}nav{box-sizing:border-box;display:inline-flex;flex-direction:column;gap:0.375rem;flex-grow:1;padding:var(--limel-dock-padding);overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}nav::-webkit-scrollbar{display:none}:host(limel-dock.has-mobile-layout) nav{justify-content:space-between;flex-direction:row}limel-dock-button:first-of-type{--limel-custom-home-icon-enabler:var(--crm-custom-home-icon-enabler);--limel-custom-home-icon:var(--crm-custom-home-icon)}`;
8
7
 
@@ -97,11 +96,11 @@ const Dock = class {
97
96
  this.resizeObserver.disconnect();
98
97
  }
99
98
  render() {
100
- return (index.h(index.Host, { key: '5f27f5d6ed669bdee199afc2dfe151495a67b05b', class: {
99
+ return (index.h(index.Host, { key: 'a2389035294a8e9faaf4de889fef82c3775dd3aa', class: {
101
100
  dock: true,
102
101
  expanded: this.expanded,
103
102
  'has-mobile-layout': this.useMobileLayout,
104
- } }, index.h("nav", { key: '9f7befc311318c7ff2486714adc0a6ec0e6b4cea', "aria-label": this.accessibleLabel }, this.dockItems.map(this.renderDockItem), this.renderSeparator(), this.dockFooterItems.map(this.renderDockItem)), this.renderExpandShrinkToggle()));
103
+ } }, index.h("nav", { key: '7a5ef68e234cb744eaef4ee59a3d9cfed70af4aa', "aria-label": this.accessibleLabel }, this.dockItems.map(this.renderDockItem), this.renderSeparator(), this.dockFooterItems.map(this.renderDockItem)), this.renderExpandShrinkToggle()));
105
104
  }
106
105
  renderExpandShrinkToggle() {
107
106
  if (this.useMobileLayout || !this.allowResize) {