@limetech/lime-elements 40.22.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 (363) hide show
  1. package/CHANGELOG.md +19 -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 +266 -19
  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/filled-defaults.js +132 -0
  110. package/dist/collection/components/form/form.js +122 -17
  111. package/dist/collection/components/form/form.test-schemas.js +61 -0
  112. package/dist/collection/components/form/invalid-input.js +14 -0
  113. package/dist/collection/components/form/widgets/date-picker.js +3 -1
  114. package/dist/collection/components/form-header/form-header.js +1 -1
  115. package/dist/collection/components/grid/grid.js +1 -1
  116. package/dist/collection/components/header/header.js +1 -1
  117. package/dist/collection/components/help/help-content.js +1 -1
  118. package/dist/collection/components/help/help.js +2 -2
  119. package/dist/collection/components/helper-line/helper-line.js +2 -2
  120. package/dist/collection/components/hotkey/hotkey.js +1 -1
  121. package/dist/collection/components/icon/icon.js +1 -1
  122. package/dist/collection/components/icon-button/icon-button.js +1 -1
  123. package/dist/collection/components/info-tile/info-tile.js +2 -2
  124. package/dist/collection/components/input-field/input-field.js +1 -1
  125. package/dist/collection/components/list/list.js +1 -1
  126. package/dist/collection/components/list-item/list-item.js +2 -2
  127. package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.js +1 -1
  128. package/dist/collection/components/markdown/markdown.js +1 -1
  129. package/dist/collection/components/masonry-layout/masonry-layout.js +1 -1
  130. package/dist/collection/components/menu/menu.js +1 -1
  131. package/dist/collection/components/menu-list/menu-list.js +1 -1
  132. package/dist/collection/components/menu-surface/menu-surface.js +1 -1
  133. package/dist/collection/components/notched-outline/notched-outline.js +1 -1
  134. package/dist/collection/components/pagination/pagination.js +1 -1
  135. package/dist/collection/components/picker/picker.js +1 -1
  136. package/dist/collection/components/popover/popover.js +1 -1
  137. package/dist/collection/components/popover-surface/popover-surface.js +1 -1
  138. package/dist/collection/components/portal/portal.js +1 -1
  139. package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
  140. package/dist/collection/components/radio-button-group/radio-button.js +2 -2
  141. package/dist/collection/components/resize-handle/resize-handle.js +1 -1
  142. package/dist/collection/components/scroller/scroller.js +2 -2
  143. package/dist/collection/components/select/select.js +1 -1
  144. package/dist/collection/components/shortcut/shortcut.js +1 -1
  145. package/dist/collection/components/side-panel/side-panel.js +1 -1
  146. package/dist/collection/components/slider/slider.js +3 -3
  147. package/dist/collection/components/snackbar/snackbar.js +2 -2
  148. package/dist/collection/components/spinner/spinner.js +1 -1
  149. package/dist/collection/components/split-button/split-button.js +2 -2
  150. package/dist/collection/components/switch/switch.js +1 -1
  151. package/dist/collection/components/tab-bar/tab-bar.js +1 -1
  152. package/dist/collection/components/tab-panel/tab-panel.js +1 -1
  153. package/dist/collection/components/table/table.js +2 -2
  154. package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +3 -3
  155. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +1 -1
  156. package/dist/collection/components/text-editor/text-editor.js +1 -1
  157. package/dist/collection/components/tooltip/tooltip-content.js +1 -1
  158. package/dist/collection/components/tooltip/tooltip.js +2 -2
  159. package/dist/collection/translations/da.js +2 -0
  160. package/dist/collection/translations/de.js +2 -0
  161. package/dist/collection/translations/en.js +2 -0
  162. package/dist/collection/translations/fi.js +2 -0
  163. package/dist/collection/translations/fr.js +2 -0
  164. package/dist/collection/translations/nl.js +2 -0
  165. package/dist/collection/translations/no.js +2 -0
  166. package/dist/collection/translations/sv.js +2 -0
  167. package/dist/esm/dom-B9Ofc5RB.js +30 -0
  168. package/dist/esm/lime-elements.js +1 -1
  169. package/dist/esm/limel-3d-hover-effect-glow.entry.js +1 -1
  170. package/dist/esm/limel-action-bar_3.entry.js +4 -5
  171. package/dist/esm/limel-ai-avatar.entry.js +2 -3
  172. package/dist/esm/limel-badge_7.entry.js +11 -11
  173. package/dist/esm/limel-banner.entry.js +1 -1
  174. package/dist/esm/limel-button-group.entry.js +1 -1
  175. package/dist/esm/limel-button.entry.js +2 -2
  176. package/dist/esm/limel-callout.entry.js +2 -3
  177. package/dist/esm/limel-card.entry.js +1 -1
  178. package/dist/esm/limel-chart.entry.js +1 -2
  179. package/dist/esm/limel-checkbox.entry.js +1 -1
  180. package/dist/esm/limel-chip-set.entry.js +2 -3
  181. package/dist/esm/limel-chip_2.entry.js +2 -3
  182. package/dist/esm/limel-circular-progress.entry.js +1 -1
  183. package/dist/esm/limel-code-diff.entry.js +2 -3
  184. package/dist/esm/limel-code-editor.entry.js +2 -3
  185. package/dist/esm/limel-collapsible-section.entry.js +2 -3
  186. package/dist/esm/limel-color-picker-palette.entry.js +2 -2
  187. package/dist/esm/limel-color-picker.entry.js +1 -1
  188. package/dist/esm/limel-date-picker.entry.js +435 -24
  189. package/dist/esm/limel-dialog.entry.js +2 -2
  190. package/dist/esm/limel-dock.entry.js +3 -4
  191. package/dist/esm/limel-drag-handle_2.entry.js +4 -5
  192. package/dist/esm/limel-email-viewer.entry.js +2 -3
  193. package/dist/esm/limel-file-dropzone_2.entry.js +2 -2
  194. package/dist/esm/limel-file-viewer.entry.js +1 -2
  195. package/dist/esm/limel-file.entry.js +2 -3
  196. package/dist/esm/limel-flatpickr-adapter.entry.js +118 -10
  197. package/dist/esm/limel-flex-container.entry.js +1 -1
  198. package/dist/esm/limel-form-header.entry.js +1 -1
  199. package/dist/esm/limel-form.entry.js +266 -19
  200. package/dist/esm/limel-grid.entry.js +1 -1
  201. package/dist/esm/limel-header.entry.js +1 -1
  202. package/dist/esm/limel-help_2.entry.js +3 -3
  203. package/dist/esm/limel-helper-line_3.entry.js +4 -4
  204. package/dist/esm/limel-hotkey_4.entry.js +5 -5
  205. package/dist/esm/limel-icon-button.entry.js +1 -1
  206. package/dist/esm/limel-icon.entry.js +1 -1
  207. package/dist/esm/limel-info-tile.entry.js +2 -2
  208. package/dist/esm/limel-list-item.entry.js +3 -4
  209. package/dist/esm/limel-markdown.entry.js +1 -1
  210. package/dist/esm/limel-masonry-layout.entry.js +1 -1
  211. package/dist/esm/limel-menu-item-meta.entry.js +1 -1
  212. package/dist/esm/limel-pagination-jump.entry.js +1 -2
  213. package/dist/esm/limel-pagination.entry.js +2 -3
  214. package/dist/esm/limel-picker.entry.js +4 -4
  215. package/dist/esm/limel-popover_2.entry.js +2 -2
  216. package/dist/esm/limel-profile-picture.entry.js +1 -2
  217. package/dist/esm/limel-prosemirror-adapter.entry.js +2 -3
  218. package/dist/esm/limel-radio-button-group.entry.js +1 -1
  219. package/dist/esm/limel-radio-button.entry.js +2 -2
  220. package/dist/esm/limel-resize-handle.entry.js +2 -3
  221. package/dist/esm/limel-select.entry.js +1 -1
  222. package/dist/esm/limel-shortcut.entry.js +1 -1
  223. package/dist/esm/limel-side-panel.entry.js +2 -3
  224. package/dist/esm/limel-slider.entry.js +4 -5
  225. package/dist/esm/limel-snackbar.entry.js +3 -4
  226. package/dist/esm/limel-split-button.entry.js +2 -2
  227. package/dist/esm/limel-switch.entry.js +1 -1
  228. package/dist/esm/limel-tab-bar.entry.js +1 -1
  229. package/dist/esm/limel-tab-panel.entry.js +1 -1
  230. package/dist/esm/limel-table.entry.js +3 -4
  231. package/dist/esm/limel-text-editor-link-menu.entry.js +4 -5
  232. package/dist/esm/limel-text-editor.entry.js +1 -1
  233. package/dist/esm/{live-message-BQAYeNiX.js → live-message-BKB4vu28.js} +1 -30
  234. package/dist/esm/loader.js +1 -1
  235. package/dist/esm/{translations-D9ZGrMhe.js → translations--i932i_D.js} +70 -2
  236. package/dist/lime-elements/lime-elements.esm.js +1 -1
  237. package/dist/lime-elements/p--i932i_D.js +1 -0
  238. package/dist/lime-elements/p-0700e83f.entry.js +1 -0
  239. package/dist/lime-elements/{p-95a486c8.entry.js → p-083aa41f.entry.js} +1 -1
  240. package/dist/lime-elements/p-08b1bfad.entry.js +1 -0
  241. package/dist/lime-elements/{p-8fe28845.entry.js → p-127ff801.entry.js} +1 -1
  242. package/dist/lime-elements/{p-764d2f86.entry.js → p-156ea100.entry.js} +1 -1
  243. package/dist/lime-elements/{p-1e0ced6a.entry.js → p-15f5e45e.entry.js} +1 -1
  244. package/dist/lime-elements/p-1c7fcafc.entry.js +1 -0
  245. package/dist/lime-elements/p-1e699935.entry.js +1 -0
  246. package/dist/lime-elements/{p-9b2623fe.entry.js → p-1fa0fd7a.entry.js} +4 -4
  247. package/dist/lime-elements/{p-ce71c5b9.entry.js → p-22aaa1ae.entry.js} +1 -1
  248. package/dist/lime-elements/p-2a5113ef.entry.js +1 -0
  249. package/dist/lime-elements/p-2d698983.entry.js +1 -0
  250. package/dist/lime-elements/p-373032c0.entry.js +1 -0
  251. package/dist/lime-elements/{p-8e80a884.entry.js → p-391305a7.entry.js} +3 -3
  252. package/dist/lime-elements/p-391a227e.entry.js +1 -0
  253. package/dist/lime-elements/p-3a421be9.entry.js +1 -0
  254. package/dist/lime-elements/p-3d6ba932.entry.js +1 -0
  255. package/dist/lime-elements/{p-c8a34cef.entry.js → p-3f9acb22.entry.js} +1 -1
  256. package/dist/lime-elements/p-46695dd3.entry.js +1 -0
  257. package/dist/lime-elements/p-490ac19d.entry.js +1 -0
  258. package/dist/lime-elements/p-4bc550e5.entry.js +1 -0
  259. package/dist/lime-elements/{p-438fe49b.entry.js → p-4de3b35b.entry.js} +1 -1
  260. package/dist/lime-elements/p-4eee17f7.entry.js +1 -0
  261. package/dist/lime-elements/p-507965d9.entry.js +1 -0
  262. package/dist/lime-elements/p-51fde63a.entry.js +1 -0
  263. package/dist/lime-elements/{p-db9cb7ef.entry.js → p-557f0e46.entry.js} +1 -1
  264. package/dist/lime-elements/p-558a7e27.entry.js +1 -0
  265. package/dist/lime-elements/{p-c6b3448c.entry.js → p-5fcb39b8.entry.js} +1 -1
  266. package/dist/lime-elements/p-61c81d09.entry.js +16 -0
  267. package/dist/lime-elements/{p-f59447bf.entry.js → p-63f2f0b7.entry.js} +1 -1
  268. package/dist/lime-elements/p-65199efa.entry.js +1 -0
  269. package/dist/lime-elements/p-6567de01.entry.js +1 -0
  270. package/dist/lime-elements/{p-a6387dc7.entry.js → p-664dbc43.entry.js} +1 -1
  271. package/dist/lime-elements/{p-6ae093c8.entry.js → p-6b6b8ffe.entry.js} +1 -1
  272. package/dist/lime-elements/p-6f8305ac.entry.js +1 -0
  273. package/dist/lime-elements/{p-c0ebf7cc.entry.js → p-718431c1.entry.js} +1 -1
  274. package/dist/lime-elements/p-71ed9466.entry.js +1 -0
  275. package/dist/lime-elements/{p-7d0ffc60.entry.js → p-81c43fe9.entry.js} +1 -1
  276. package/dist/lime-elements/p-8e46d111.entry.js +1 -0
  277. package/dist/lime-elements/{p-d3f13124.entry.js → p-9cbfedad.entry.js} +1 -1
  278. package/dist/lime-elements/p-9e5a15d1.entry.js +1 -0
  279. package/dist/lime-elements/p-B9Ofc5RB.js +1 -0
  280. package/dist/lime-elements/p-CMedqTpE.js +1 -0
  281. package/dist/lime-elements/{p-e5abe390.entry.js → p-a1cd0dc0.entry.js} +1 -1
  282. package/dist/lime-elements/p-a5aa8c06.entry.js +1 -0
  283. package/dist/lime-elements/{p-c61e9b83.entry.js → p-ae634a68.entry.js} +1 -1
  284. package/dist/lime-elements/{p-c2056ebc.entry.js → p-b6334f4b.entry.js} +1 -1
  285. package/dist/lime-elements/{p-28957b5c.entry.js → p-b810b854.entry.js} +1 -1
  286. package/dist/lime-elements/{p-cf2d43c7.entry.js → p-bb45a5bb.entry.js} +1 -1
  287. package/dist/lime-elements/{p-54537c85.entry.js → p-be653ca9.entry.js} +1 -1
  288. package/dist/lime-elements/{p-40940a6c.entry.js → p-bfb98b0e.entry.js} +1 -1
  289. package/dist/lime-elements/{p-3f7fa772.entry.js → p-c1dbad1e.entry.js} +1 -1
  290. package/dist/lime-elements/{p-39d1e157.entry.js → p-c3b86df2.entry.js} +1 -1
  291. package/dist/lime-elements/p-c3d1aa57.entry.js +1 -0
  292. package/dist/lime-elements/p-c63d294b.entry.js +1 -0
  293. package/dist/lime-elements/{p-f3b93ce8.entry.js → p-c6eed240.entry.js} +1 -1
  294. package/dist/lime-elements/p-c7bcae67.entry.js +1 -0
  295. package/dist/lime-elements/p-ce418df1.entry.js +159 -0
  296. package/dist/lime-elements/{p-6053608a.entry.js → p-d078ea89.entry.js} +1 -1
  297. package/dist/lime-elements/p-d2f784a8.entry.js +1 -0
  298. package/dist/lime-elements/{p-48a412ed.entry.js → p-d51bf98b.entry.js} +1 -1
  299. package/dist/lime-elements/p-da9be21e.entry.js +1 -0
  300. package/dist/lime-elements/{p-a891f3e8.entry.js → p-e3cf45ed.entry.js} +1 -1
  301. package/dist/lime-elements/{p-909466b8.entry.js → p-e481fb53.entry.js} +1 -1
  302. package/dist/lime-elements/{p-0319f07f.entry.js → p-e8665e99.entry.js} +1 -1
  303. package/dist/lime-elements/{p-5dce791c.entry.js → p-eb812303.entry.js} +1 -1
  304. package/dist/types/components/date-picker/date-formatter.d.ts +12 -0
  305. package/dist/types/components/date-picker/date-picker.d.ts +59 -3
  306. package/dist/types/components/date-picker/flatpickr-adapter/flatpickr-adapter.d.ts +13 -2
  307. package/dist/types/components/date-picker/pickers/month-picker.d.ts +1 -0
  308. package/dist/types/components/date-picker/pickers/picker.d.ts +8 -1
  309. package/dist/types/components/date-picker/pickers/quarter-picker.d.ts +1 -0
  310. package/dist/types/components/date-picker/pickers/week-picker.d.ts +4 -0
  311. package/dist/types/components/date-picker/pickers/year-picker.d.ts +7 -0
  312. package/dist/types/components/form/fields/schema-field.d.ts +2 -0
  313. package/dist/types/components/form/filled-defaults.d.ts +12 -0
  314. package/dist/types/components/form/form.d.ts +19 -0
  315. package/dist/types/components/form/form.test-schemas.d.ts +3 -0
  316. package/dist/types/components/form/invalid-input.d.ts +14 -0
  317. package/dist/types/components/form/widgets/date-picker.d.ts +1 -0
  318. package/dist/types/components.d.ts +46 -11
  319. package/dist/types/translations/da.d.ts +2 -0
  320. package/dist/types/translations/de.d.ts +2 -0
  321. package/dist/types/translations/en.d.ts +2 -0
  322. package/dist/types/translations/fi.d.ts +2 -0
  323. package/dist/types/translations/fr.d.ts +2 -0
  324. package/dist/types/translations/nl.d.ts +2 -0
  325. package/dist/types/translations/no.d.ts +2 -0
  326. package/dist/types/translations/sv.d.ts +2 -0
  327. package/package.json +4 -4
  328. package/dist/cjs/language-s0bKUCvO.js +0 -58
  329. package/dist/esm/language-VamkUr90.js +0 -55
  330. package/dist/lime-elements/p-0a7cbdc3.entry.js +0 -1
  331. package/dist/lime-elements/p-0f96e94d.entry.js +0 -1
  332. package/dist/lime-elements/p-1a0c5e45.entry.js +0 -1
  333. package/dist/lime-elements/p-401d5c92.entry.js +0 -1
  334. package/dist/lime-elements/p-430db3b9.entry.js +0 -1
  335. package/dist/lime-elements/p-43b62587.entry.js +0 -1
  336. package/dist/lime-elements/p-48dccb83.entry.js +0 -1
  337. package/dist/lime-elements/p-5c918155.entry.js +0 -1
  338. package/dist/lime-elements/p-66101ed6.entry.js +0 -1
  339. package/dist/lime-elements/p-7ab72b52.entry.js +0 -1
  340. package/dist/lime-elements/p-8d602078.entry.js +0 -1
  341. package/dist/lime-elements/p-8d9a2a22.entry.js +0 -1
  342. package/dist/lime-elements/p-8de4f0f3.entry.js +0 -1
  343. package/dist/lime-elements/p-99984c66.entry.js +0 -1
  344. package/dist/lime-elements/p-9d46f720.entry.js +0 -1
  345. package/dist/lime-elements/p-9e2b426c.entry.js +0 -1
  346. package/dist/lime-elements/p-C9dBa_Im.js +0 -1
  347. package/dist/lime-elements/p-Cw7VQSGU.js +0 -1
  348. package/dist/lime-elements/p-VamkUr90.js +0 -1
  349. package/dist/lime-elements/p-b1c7033b.entry.js +0 -16
  350. package/dist/lime-elements/p-b5451350.entry.js +0 -1
  351. package/dist/lime-elements/p-c75f3b0d.entry.js +0 -1
  352. package/dist/lime-elements/p-ca4247c4.entry.js +0 -1
  353. package/dist/lime-elements/p-d53421af.entry.js +0 -1
  354. package/dist/lime-elements/p-d8901e39.entry.js +0 -1
  355. package/dist/lime-elements/p-d89553b3.entry.js +0 -1
  356. package/dist/lime-elements/p-d93b8ce0.entry.js +0 -1
  357. package/dist/lime-elements/p-e97340c4.entry.js +0 -1
  358. package/dist/lime-elements/p-ec0c113d.entry.js +0 -1
  359. package/dist/lime-elements/p-f036ad27.entry.js +0 -1
  360. package/dist/lime-elements/p-f197000b.entry.js +0 -159
  361. package/dist/lime-elements/p-f5bb17eb.entry.js +0 -1
  362. package/dist/lime-elements/p-f6bc6658.entry.js +0 -1
  363. package/dist/lime-elements/p-fa1aa440.entry.js +0 -1
@@ -38,7 +38,43 @@ export class Picker {
38
38
  }
39
39
  setValue(value) {
40
40
  var _a;
41
- (_a = this.flatpickr) === null || _a === void 0 ? void 0 : _a.setDate(value, false);
41
+ const currentlySelected = (_a = this.flatpickr) === null || _a === void 0 ? void 0 : _a.selectedDates[0];
42
+ const isUnchanged = currentlySelected
43
+ ? (value === null || value === void 0 ? void 0 : value.getTime()) === currentlySelected.getTime()
44
+ : !value;
45
+ if (!this.flatpickr || isUnchanged) {
46
+ // Runs on every re-render, so skip an unchanged date.
47
+ return;
48
+ }
49
+ this.flatpickr.setDate(value, false);
50
+ this.redrawSelection();
51
+ }
52
+ /**
53
+ * A silent `setDate` fires no Flatpickr hooks, so a picker that marks
54
+ * its selection from hooks does it here instead.
55
+ */
56
+ redrawSelection() {
57
+ // The default day grid is redrawn by Flatpickr itself.
58
+ }
59
+ // Flatpickr only does this on key presses in the input it is bound to.
60
+ focusDay() {
61
+ const day = this.getDayToFocus();
62
+ day === null || day === void 0 ? void 0 : day.focus();
63
+ return !!day;
64
+ }
65
+ // The same order Flatpickr uses.
66
+ getDayToFocus() {
67
+ var _a;
68
+ const days = (_a = this.flatpickr) === null || _a === void 0 ? void 0 : _a.daysContainer;
69
+ if (!days) {
70
+ return;
71
+ }
72
+ const isVisible = (day) => (day === null || day === void 0 ? void 0 : day.isConnected) && days.contains(day);
73
+ return [
74
+ this.flatpickr.selectedDateElem,
75
+ this.flatpickr.todayDateElem,
76
+ days.querySelector('.flatpickr-day:not(.prevMonthDay):not(.nextMonthDay)'),
77
+ ].find(isVisible);
42
78
  }
43
79
  redraw() {
44
80
  var _a;
@@ -47,6 +47,9 @@ export class QuarterPicker extends Picker {
47
47
  }
48
48
  async handleClose(selectedDates) {
49
49
  await super.handleClose(selectedDates);
50
+ this.redrawSelection();
51
+ }
52
+ redrawSelection() {
50
53
  this.selectQuarter(this.flatpickr.selectedDates, this.flatpickr.input.value, this.flatpickr);
51
54
  }
52
55
  handleReady(_, __, fp) {
@@ -1,5 +1,6 @@
1
1
  import weekSelectPlugin from "flatpickr/dist/plugins/weekSelect/weekSelect";
2
2
  import { Picker } from "./picker";
3
+ const DAYS_PER_WEEK = 7;
3
4
  export class WeekPicker extends Picker {
4
5
  constructor(language, change, dateFormat = '[w] W GGGG') {
5
6
  super(language, change, dateFormat);
@@ -12,4 +13,24 @@ export class WeekPicker extends Picker {
12
13
  }
13
14
  return config;
14
15
  }
16
+ /**
17
+ * Marks the selected week the way the `weekSelect` plugin does.
18
+ */
19
+ redrawSelection() {
20
+ var _a, _b;
21
+ const days = (_a = this.flatpickr.days) === null || _a === void 0 ? void 0 : _a.childNodes;
22
+ const selectedIndex = (_b = this.flatpickr.selectedDateElem) === null || _b === void 0 ? void 0 : _b.$i;
23
+ // `clear()` leaves `selectedDateElem` on the old cell.
24
+ const hasSelection = this.flatpickr.selectedDates.length > 0;
25
+ if (this.nativePicker ||
26
+ !days ||
27
+ !hasSelection ||
28
+ selectedIndex === undefined) {
29
+ return;
30
+ }
31
+ const weekStart = DAYS_PER_WEEK * Math.floor(selectedIndex / DAYS_PER_WEEK);
32
+ for (let i = weekStart; i < weekStart + DAYS_PER_WEEK; i++) {
33
+ days[i].classList.add('week', 'selected');
34
+ }
35
+ }
15
36
  }
@@ -67,8 +67,32 @@ export class YearPicker extends Picker {
67
67
  }
68
68
  async handleClose(selectedDates) {
69
69
  await super.handleClose(selectedDates);
70
+ this.redrawSelection();
71
+ }
72
+ redrawSelection() {
73
+ const selected = this.flatpickr.selectedDates[0];
74
+ if (selected) {
75
+ this.showYear(selected.getFullYear());
76
+ }
70
77
  this.selectYear(this.flatpickr.selectedDates, this.flatpickr.input.value);
71
78
  }
79
+ /**
80
+ * Moves the year window, which only the arrows move otherwise, so that
81
+ * `year` has a cell to highlight.
82
+ * @param year
83
+ */
84
+ showYear(year) {
85
+ var _a, _b;
86
+ const first = (_a = this.years[0]) === null || _a === void 0 ? void 0 : _a.year();
87
+ const last = (_b = this.years.at(-1)) === null || _b === void 0 ? void 0 : _b.year();
88
+ if (first === undefined || last === undefined) {
89
+ return;
90
+ }
91
+ if (year >= first && year <= last) {
92
+ return;
93
+ }
94
+ this.addYears(year - this.years[YEAR_INTERVAL / 2].year());
95
+ }
72
96
  handleReady(_, __, fp) {
73
97
  this.bootstrapYearPicker(fp);
74
98
  this.selectYear(fp.selectedDates, fp.input.value);
@@ -84,10 +84,10 @@ export class Dialog {
84
84
  this.mdcDialog.destroy();
85
85
  }
86
86
  render() {
87
- return (h("div", { key: 'a9a3f26e3da86f1659487affe5a8758dca4cefb9', class: {
87
+ return (h("div", { key: '3e1a6defb45d3a7db6569742226cb0f6f417fb6e', class: {
88
88
  'mdc-dialog': true,
89
89
  'full-screen': !!this.fullscreen,
90
- }, role: "alertdialog", "aria-modal": "true", "aria-labelledby": 'limel-dialog-title-' + this.id, "aria-describedby": 'limel-dialog-content-' + this.id }, h("input", { key: '792d35f0b5c497bac447327c2aafdd74e3b8c0ee', hidden: true, id: "initialFocusEl" }), h("div", { key: 'a4331ee65f7ff242ee2af707281a1051f307a218', class: "mdc-dialog__container" }, h("div", { key: 'c4e1ef542e1078fe65bb6c299a890da6242c154e', class: "mdc-dialog__surface" }, h("input", { key: '626470072fbed50ef98ab29e32ad0d219018cb51', type: "button", id: "initialFocusElement" }), this.renderHeading(), h("div", { key: '8399fa33d6b6d342848f7051fc92b4bde9b02f8e', class: "mdc-dialog__content", id: 'limel-dialog-content-' + this.id }, h("slot", { key: '94f1d56d78fd5e5f0cc483c622b1138ed7148a2e' })), this.renderFooter())), h("div", { key: '22a1c2516049f8a8d444fbb60c0009cb96dffe9f', class: "mdc-dialog__scrim" })));
90
+ }, role: "alertdialog", "aria-modal": "true", "aria-labelledby": 'limel-dialog-title-' + this.id, "aria-describedby": 'limel-dialog-content-' + this.id }, h("input", { key: '4a5f5cbd39cefc237854e87a3bd26c9a371d0703', hidden: true, id: "initialFocusEl" }), h("div", { key: 'cea96e7efebe5f92b65c36f9e9ff4b4814cf6245', class: "mdc-dialog__container" }, h("div", { key: '2002f463e8289d8e11974818e8339cd8506d9172', class: "mdc-dialog__surface" }, h("input", { key: 'ff0f029260dcd53f59f0ac7882b917e7fdff41a1', type: "button", id: "initialFocusElement" }), this.renderHeading(), h("div", { key: 'd2f23c68ef6fa558c7d40b7a729173bfc6c1e120', class: "mdc-dialog__content", id: 'limel-dialog-content-' + this.id }, h("slot", { key: '7b990ba91a610dad210627c1e6075b4db6ecd0c8' })), this.renderFooter())), h("div", { key: 'b878b47719571bac33c5f8f04e6271d11fd7bf69', class: "mdc-dialog__scrim" })));
91
91
  }
92
92
  watchHandler(newValue, oldValue) {
93
93
  if (oldValue === newValue || !this.mdcDialog) {
@@ -94,11 +94,11 @@ export class Dock {
94
94
  this.resizeObserver.disconnect();
95
95
  }
96
96
  render() {
97
- return (h(Host, { key: '5f27f5d6ed669bdee199afc2dfe151495a67b05b', class: {
97
+ return (h(Host, { key: 'a2389035294a8e9faaf4de889fef82c3775dd3aa', class: {
98
98
  dock: true,
99
99
  expanded: this.expanded,
100
100
  'has-mobile-layout': this.useMobileLayout,
101
- } }, h("nav", { key: '9f7befc311318c7ff2486714adc0a6ec0e6b4cea', "aria-label": this.accessibleLabel }, this.dockItems.map(this.renderDockItem), this.renderSeparator(), this.dockFooterItems.map(this.renderDockItem)), this.renderExpandShrinkToggle()));
101
+ } }, h("nav", { key: '7a5ef68e234cb744eaef4ee59a3d9cfed70af4aa', "aria-label": this.accessibleLabel }, this.dockItems.map(this.renderDockItem), this.renderSeparator(), this.dockFooterItems.map(this.renderDockItem)), this.renderExpandShrinkToggle()));
102
102
  }
103
103
  renderExpandShrinkToggle() {
104
104
  if (this.useMobileLayout || !this.allowResize) {
@@ -51,7 +51,7 @@ export class DragHandleComponent {
51
51
  render() {
52
52
  const tooltipLabel = translate.get('drag-handle.drag-to-reorder', this.language);
53
53
  const ariaLabel = translate.get('drag-handle.drag-handle', this.language);
54
- return (h(Host, { key: '2656fb1a09ca8bd8db8fe5849b4d5aa231d13e6e' }, h("button", { key: 'f2239eca3b4a11dd09f551d53c08aec30e780904', "data-drag-handle": true, type: "button", class: "limel-drag-handle", tabindex: -1, "aria-label": ariaLabel, id: this.dragHandleId, onClick: this.handleClick }, h("div", { key: '3c47f3612efa43a3e020f432e88b71524b15190b', class: "drag-icon", role: "presentation", "aria-hidden": "true" }, h("div", { key: "1" }), h("div", { key: "2" }), h("div", { key: "3" }), h("div", { key: "4" }), h("div", { key: "5" }), h("div", { key: "6" })), h("limel-tooltip", { key: 'e2706e1f4757b75ac8bce97d549e6e81ee53ecca', openDirection: this.tooltipOpenDirection, elementId: this.dragHandleId, label: tooltipLabel }))));
54
+ return (h(Host, { key: '2f2da901278a10d69a28e8a8054b5dd95a449fc4' }, h("button", { key: 'a0515c4b75a5442b9dab1f93d1b00b24506e2996', "data-drag-handle": true, type: "button", class: "limel-drag-handle", tabindex: -1, "aria-label": ariaLabel, id: this.dragHandleId, onClick: this.handleClick }, h("div", { key: '493353f7fdd9f7fd9e0ae3f805e041072e58dee0', class: "drag-icon", role: "presentation", "aria-hidden": "true" }, h("div", { key: "1" }), h("div", { key: "2" }), h("div", { key: "3" }), h("div", { key: "4" }), h("div", { key: "5" }), h("div", { key: "6" })), h("limel-tooltip", { key: '93ce003748dba6771876e8b83e4ba5cb021c8a5f', openDirection: this.tooltipOpenDirection, elementId: this.dragHandleId, label: tooltipLabel }))));
55
55
  }
56
56
  static get is() { return "limel-drag-handle"; }
57
57
  static get originalStyleUrls() {
@@ -75,7 +75,7 @@ export class EmailViewer {
75
75
  }
76
76
  }
77
77
  render() {
78
- return (h(Host, { key: '85990dff64a6fc62c1c3d4ca58c188ceee3aa639' }, h("div", { key: '6e1ab5f5210789e68256cd8bc2c50df7de3fe9e1', class: "email", part: "email" }, this.renderHeaders(), this.renderRemoteImageBanner(), h("section", { key: '523d7d19938312506bdfd735fde3251dfc408c75' }, this.renderAttachments(), this.renderBody()))));
78
+ return (h(Host, { key: 'f3190e64d1a5334ff9e172e4f47eaafb8c854851' }, h("div", { key: 'ad8cb6e436784d255f357fe2393a682998371cd1', class: "email", part: "email" }, this.renderHeaders(), this.renderRemoteImageBanner(), h("section", { key: '42adf034350835f0e91888bb99123fbcd79e698a' }, this.renderAttachments(), this.renderBody()))));
79
79
  }
80
80
  renderHeaders() {
81
81
  const headerFields = [
@@ -154,7 +154,7 @@ export class File {
154
154
  this.resizingFile = undefined;
155
155
  }
156
156
  render() {
157
- return (h(Host, { key: 'fde08c4a882443f122caf923cd5d4eae1603342d', "aria-busy": this.isBusy ? 'true' : 'false' }, h("limel-file-dropzone", { key: 'bbafe0b47742c71cca1dd78a380072ceb6646c37', disabled: this.disabled || this.readonly || !!this.displayedFile, accept: this.accept, onFilesSelected: this.handleNewFiles }, this.renderChipset()), this.renderDragAndDropTip(), this.renderSpinner()));
157
+ return (h(Host, { key: '00d4776052cbffc0066deba3a1c162d49d9c4e02', "aria-busy": this.isBusy ? 'true' : 'false' }, h("limel-file-dropzone", { key: 'a3e031aba6715b825fde01d91a9d2667f300a606', disabled: this.disabled || this.readonly || !!this.displayedFile, accept: this.accept, onFilesSelected: this.handleNewFiles }, this.renderChipset()), this.renderDragAndDropTip(), this.renderSpinner()));
158
158
  }
159
159
  get statusText() {
160
160
  var _a, _b, _c;
@@ -90,7 +90,7 @@ export class FileDropzone {
90
90
  };
91
91
  }
92
92
  render() {
93
- return (h(Host, { key: '0a8c13ab0d5f60152669965bb43981cc1f6c430f', onDrop: this.handleDrop, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave }, h("slot", { key: '740de02e64e7cebca2cd67d10c148d9761ac85bb' }), this.renderOnDragLayout()));
93
+ return (h(Host, { key: '15f9995e7746e8019c3f0d9cd6590bb38bd61e84', onDrop: this.handleDrop, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave }, h("slot", { key: 'f55bf7a4630b1c72fb7839db63cdb9df1c4d5b60' }), this.renderOnDragLayout()));
94
94
  }
95
95
  static get is() { return "limel-file-dropzone"; }
96
96
  static get encapsulation() { return "shadow"; }
@@ -72,7 +72,7 @@ export class FileInput {
72
72
  this.fileInput = this.element.shadowRoot.getElementById(this.fileInputId);
73
73
  }
74
74
  render() {
75
- return (h(Host, { key: '1bedc75973c5a12ff099607e35991153811f3166', onClick: this.handleClick, onKeyUp: this.handleKeyUp, onKeyDown: this.handleKeyDown }, h("input", { key: '583506fe7cbc9319bece58aefe5d793fc563dbc2', hidden: true, id: this.fileInputId, onChange: this.handleFileChange, type: "file", accept: this.accept, disabled: this.disabled, multiple: this.multiple }), h("slot", { key: 'fef95ae5ffdc6a4cc00be7f6e021ea39ed253412' })));
75
+ return (h(Host, { key: 'fb2eee15dce908e1206d6021b59779b75568a1cd', onClick: this.handleClick, onKeyUp: this.handleKeyUp, onKeyDown: this.handleKeyDown }, h("input", { key: '12071d39f562b4d8fa058aee903393297501ece5', hidden: true, id: this.fileInputId, onChange: this.handleFileChange, type: "file", accept: this.accept, disabled: this.disabled, multiple: this.multiple }), h("slot", { key: '0569c37440177e0b191a9885cf035be5a0a50881' })));
76
76
  }
77
77
  handleKeyDown(event) {
78
78
  if (['Tab', 'Backspace', 'Enter'].includes(event.code)) {
@@ -31,7 +31,7 @@ export class FlexContainer {
31
31
  console.warn('limel-flex-container is deprecated, please use CSS instead: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox');
32
32
  }
33
33
  render() {
34
- return h("slot", { key: 'f5baf3c618a69e1beaaf8574af3388e88306f5bf' });
34
+ return h("slot", { key: 'd73b0afc5cbdb3b9754360c1c638d24578cd8331' });
35
35
  }
36
36
  static get is() { return "limel-flex-container"; }
37
37
  static get encapsulation() { return "shadow"; }
@@ -9,7 +9,9 @@ import { getHelpComponent } from "../help";
9
9
  import { TimePicker } from "../widgets/time-picker";
10
10
  import { isIntegerType, isNumberType } from "../schema";
11
11
  import { RowLayoutContext } from "../row/row-context";
12
+ import { listenForInvalidInput } from "../invalid-input";
12
13
  const { fields: defaultFields } = getDefaultRegistry();
14
+ const DATE_FORMATS = new Set(['date', 'date-time', 'time']);
13
15
  const BaseSchemaField = defaultFields.SchemaField;
14
16
  /**
15
17
  * If given a value and schema, check if the value should be translated
@@ -88,10 +90,23 @@ export class SchemaField extends React.Component {
88
90
  this.state = {
89
91
  modified: false,
90
92
  };
93
+ // The date picker never emits text it rejects, so the value stays valid
94
+ // while the field shows an error.
95
+ this.reportInvalidInput = (message) => {
96
+ var _a, _b;
97
+ const { registry, fieldPathId } = this.props;
98
+ if (!fieldPathId) {
99
+ return;
100
+ }
101
+ (_b = (_a = registry.formContext) === null || _a === void 0 ? void 0 : _a.setInvalidInput) === null || _b === void 0 ? void 0 : _b.call(_a, fieldPathId.path, message);
102
+ };
91
103
  this.handleChange = this.handleChange.bind(this);
92
104
  this.handleCustomComponentChange =
93
105
  this.handleCustomComponentChange.bind(this);
94
106
  }
107
+ componentWillUnmount() {
108
+ this.reportInvalidInput(null);
109
+ }
95
110
  isInvalid() {
96
111
  var _a;
97
112
  const { modified } = this.state;
@@ -166,7 +181,7 @@ export class SchemaField extends React.Component {
166
181
  name: name,
167
182
  schemaPath: (_a = fieldPathId === null || fieldPathId === void 0 ? void 0 : fieldPathId.path) === null || _a === void 0 ? void 0 : _a.map(String),
168
183
  };
169
- return () => { };
184
+ return listenForInvalidInput(element, this.reportInvalidInput);
170
185
  } });
171
186
  }
172
187
  renderCustomComponent(props) {
@@ -191,6 +206,9 @@ export class SchemaField extends React.Component {
191
206
  if (this.props.schema.format === 'time') {
192
207
  fieldProps.uiSchema = Object.assign({ 'ui:widget': TimePicker }, fieldProps.uiSchema);
193
208
  }
209
+ if (DATE_FORMATS.has(this.props.schema.format)) {
210
+ fieldProps.uiSchema = Object.assign(Object.assign({}, fieldProps.uiSchema), { 'ui:onInvalidInput': this.reportInvalidInput });
211
+ }
194
212
  // Our text widget renders a native `<input type="number">` for numeric
195
213
  // schemas. `@rjsf/core` otherwise rewrites the value to the locale's
196
214
  // decimal separator, which such an input cannot display.
@@ -0,0 +1,132 @@
1
+ import { isEmpty, isEqual, isPlainObject } from "lodash-es";
2
+ /**
3
+ * The value without the defaults that were filled into the value the form was
4
+ * given, as long as they still hold their default. A default the user changed
5
+ * stays, and so do the defaults of what the user added, such as a list item.
6
+ *
7
+ * @param value - the value the form holds, with the defaults filled in
8
+ * @param filled - the value the form was given, with the defaults filled in
9
+ * @param given - the value the form was given
10
+ * @returns the value without the defaults that were filled in
11
+ */
12
+ export function withoutFilledDefaults(value, filled, given) {
13
+ // A change can bring in objects that hold nothing, which mean nothing
14
+ if (isPlainObject(value)) {
15
+ return withoutFilledProperties(value, isPlainObject(filled) ? filled : {}, given);
16
+ }
17
+ if (Array.isArray(value)) {
18
+ return withoutFilledItems(value, Array.isArray(filled) ? filled : [], given);
19
+ }
20
+ return given === undefined && isEqual(value, filled) ? undefined : value;
21
+ }
22
+ function withoutFilledProperties(value, filled, given) {
23
+ const givenProperties = isPlainObject(given)
24
+ ? given
25
+ : {};
26
+ // In the order they were given, so a saved value keeps its key order
27
+ const keys = new Set([
28
+ ...Object.keys(givenProperties),
29
+ ...Object.keys(value),
30
+ ]);
31
+ const result = {};
32
+ for (const key of keys) {
33
+ if (!Object.hasOwn(value, key)) {
34
+ continue;
35
+ }
36
+ const kept = withoutFilledDefaults(value[key], filled[key], givenProperties[key]);
37
+ if (kept !== undefined) {
38
+ result[key] = kept;
39
+ }
40
+ }
41
+ return isEmpty(result) && given == null ? given : result;
42
+ }
43
+ // Items are paired with the ones the form was given by content, so a removed
44
+ // or moved item does not shift the others onto the defaults of their
45
+ // neighbors. An item that no longer equals any of them is paired with the one
46
+ // it has the most in common with, so an edited item still loses its defaults
47
+ function withoutFilledItems(items, filled, given) {
48
+ // A list that was not given is a default as a whole: once the user
49
+ // changes it, it is the user's
50
+ if (!Array.isArray(given)) {
51
+ return isEqual(items, filled) ? given : items;
52
+ }
53
+ const givenItems = given;
54
+ const matches = pairItems(items, filled);
55
+ const result = [];
56
+ for (const [index, item] of items.entries()) {
57
+ const match = matches.get(index);
58
+ if (match === undefined) {
59
+ result.push(item);
60
+ continue;
61
+ }
62
+ const kept = withoutFilledDefaults(item, filled[match], givenItems[match]);
63
+ if (kept !== undefined) {
64
+ result.push(kept);
65
+ }
66
+ }
67
+ return result;
68
+ }
69
+ function pairItems(items, filled) {
70
+ const matches = new Map();
71
+ const unmatched = new Set(filled.keys());
72
+ const pair = (index, match) => {
73
+ matches.set(index, match);
74
+ unmatched.delete(match);
75
+ };
76
+ for (const [index, item] of items.entries()) {
77
+ if (unmatched.has(index) && isEqual(item, filled[index])) {
78
+ pair(index, index);
79
+ }
80
+ }
81
+ for (const [index, item] of items.entries()) {
82
+ if (matches.has(index)) {
83
+ continue;
84
+ }
85
+ const same = [...unmatched].find((i) => isEqual(item, filled[i]));
86
+ if (same !== undefined) {
87
+ pair(index, same);
88
+ }
89
+ }
90
+ for (const [index, item] of items.entries()) {
91
+ if (matches.has(index)) {
92
+ continue;
93
+ }
94
+ const closest = findClosest(item, filled, unmatched);
95
+ if (closest !== undefined) {
96
+ pair(index, closest);
97
+ }
98
+ }
99
+ return matches;
100
+ }
101
+ // The one item that shares the most equal properties, if it shares any at
102
+ // all. When several share as many there is no telling which the item was, and
103
+ // it is left as it is, since a kept default means the same as a missing one
104
+ // while a lost value does not
105
+ function findClosest(item, filled, candidates) {
106
+ if (!isPlainObject(item)) {
107
+ return undefined;
108
+ }
109
+ let closest;
110
+ let best = 0;
111
+ let isTied = false;
112
+ for (const candidate of candidates) {
113
+ const score = sharedProperties(item, filled[candidate]);
114
+ if (score === best) {
115
+ isTied = true;
116
+ continue;
117
+ }
118
+ if (score < best) {
119
+ continue;
120
+ }
121
+ best = score;
122
+ closest = candidate;
123
+ isTied = false;
124
+ }
125
+ return isTied ? undefined : closest;
126
+ }
127
+ function sharedProperties(item, other) {
128
+ if (!isPlainObject(other)) {
129
+ return 0;
130
+ }
131
+ return Object.entries(item).filter(([key, value]) => isEqual(value, other[key])).length;
132
+ }
@@ -14,6 +14,7 @@ import { h, } from "@stencil/core";
14
14
  import React from "react";
15
15
  import { createRoot } from "react-dom/client";
16
16
  import JSONSchemaForm from "@rjsf/core";
17
+ import { getDefaultFormState, } from "@rjsf/utils";
17
18
  import { isHeadingLevel } from "../../util/heading-level";
18
19
  import { ArrayFieldTemplate, ArrayFieldItemTemplate, FieldTemplate, ObjectFieldTemplate, } from "./templates";
19
20
  import { SchemaField as CustomSchemaField } from "./fields/schema-field";
@@ -23,7 +24,17 @@ import { widgets } from "./widgets";
23
24
  import { rjsfValidator } from "./validator";
24
25
  import { isEqual, mapValues } from "lodash-es";
25
26
  import { showField, stopShowingField } from "./show-field";
27
+ import { withoutFilledDefaults } from "./filled-defaults";
26
28
  import { HeadingLevelContext } from "./templates/heading-level";
29
+ // `@rjsf/core` v6 treats a `const` inside `oneOf`/`anyOf` as a default and
30
+ // auto-selects the first option, so an optional enum can never be left empty
31
+ // (clearing it just gets repopulated on the next render). `skipOneOf` keeps this
32
+ // off for enums while still applying genuine `default` values, matching the
33
+ // pre-v6 behavior.
34
+ const FILL_DEFAULTS = {
35
+ constAsDefaults: 'skipOneOf',
36
+ requiredBooleanDefault: 'skip',
37
+ };
27
38
  /**
28
39
  * @exampleComponent limel-example-form
29
40
  * @exampleComponent limel-example-nested-form
@@ -44,6 +55,7 @@ import { HeadingLevelContext } from "./templates/heading-level";
44
55
  * @exampleComponent limel-example-code-editor-form
45
56
  * @exampleComponent limel-example-form-highlighted-field
46
57
  * @exampleComponent limel-example-form-heading-level
58
+ * @exampleComponent limel-example-form-include-defaults
47
59
  */
48
60
  export class Form {
49
61
  constructor() {
@@ -73,17 +85,41 @@ export class Form {
73
85
  * which keeps untouched required-empty fields silent.
74
86
  */
75
87
  this.revealErrors = false;
88
+ /**
89
+ * Set to `false` to leave the defaults of the schema out of the value,
90
+ * so that it stays as it was given until the user changes something. The
91
+ * form still shows the defaults. A default the user changes is in the
92
+ * value from then on, and so are the defaults that a change brings in,
93
+ * such as those of a new list item or of fields that depend on the
94
+ * changed one. Pass the value the form emits back in as `value`.
95
+ * The form validates what it shows, defaults included. When the user
96
+ * changes everything back, the value is what the form was given, also
97
+ * when that is `null` or `undefined`.
98
+ */
99
+ this.includeDefaults = true;
76
100
  this.isValid = true;
101
+ // Their value is still the last valid one, so the schema can't tell.
102
+ this.invalidInputErrors = new Map();
77
103
  this.initialized = false;
78
104
  this.handleChange = this.handleChange.bind(this);
79
105
  this.getCustomErrorMessages = this.getCustomErrorMessages.bind(this);
106
+ this.setInvalidInput = this.setInvalidInput.bind(this);
80
107
  }
81
108
  connectedCallback() {
82
109
  this.initialize();
83
110
  }
84
111
  componentWillLoad() {
112
+ this.currentValue = this.value;
85
113
  this.warnIfHeadingLevelIsInvalid();
86
114
  }
115
+ handleValueChange() {
116
+ // The host usually hands back the value the form emitted, as a new
117
+ // object, which is not a new value to leave the defaults out of
118
+ if (!isEqual(this.value, this.currentValue)) {
119
+ this.givenValue = undefined;
120
+ }
121
+ this.currentValue = this.value;
122
+ }
87
123
  componentDidLoad() {
88
124
  this.initialize();
89
125
  this.showHighlightedField();
@@ -125,7 +161,7 @@ export class Form {
125
161
  this.initialized = false;
126
162
  }
127
163
  render() {
128
- return h("div", { key: '549ba8cd825aadedc4ec9e696f6d03bee028cb89', class: "root" });
164
+ return h("div", { key: 'c6f8c1df8165c5ac23b133a369ebb0f58563d74f', class: "root" });
129
165
  }
130
166
  reactRender() {
131
167
  if (!this.root) {
@@ -138,21 +174,12 @@ export class Form {
138
174
  : 1,
139
175
  }, React.createElement(JSONSchemaForm, {
140
176
  schema: this.prepareSchema(this.schema),
141
- formData: this.value,
177
+ formData: this.currentValue,
142
178
  onChange: this.handleChange,
143
179
  widgets: widgets,
144
180
  validator: rjsfValidator,
145
181
  liveValidate: 'onChange',
146
- // `@rjsf/core` v6 treats a `const` inside `oneOf`/`anyOf`
147
- // as a default and auto-selects the first option, so an
148
- // optional enum can never be left empty (clearing it just
149
- // gets repopulated on the next render). `skipOneOf` keeps
150
- // this off for enums while still applying genuine
151
- // `default` values, matching the pre-v6 behavior.
152
- experimental_defaultFormStateBehavior: {
153
- constAsDefaults: 'skipOneOf',
154
- requiredBooleanDefault: 'skip',
155
- },
182
+ experimental_defaultFormStateBehavior: FILL_DEFAULTS,
156
183
  showErrorList: false,
157
184
  extraErrors: this.getExtraErrors(this.errors),
158
185
  templates: {
@@ -168,6 +195,7 @@ export class Form {
168
195
  rootValue: this.value,
169
196
  propsFactory: this.propsFactory,
170
197
  revealErrors: this.revealErrors,
198
+ setInvalidInput: this.setInvalidInput,
171
199
  },
172
200
  fields: {
173
201
  SchemaField: CustomSchemaField,
@@ -186,11 +214,42 @@ export class Form {
186
214
  return this.host.shadowRoot.querySelector('.root');
187
215
  }
188
216
  handleChange(event) {
189
- this.change.emit(event.formData);
217
+ if (this.includeDefaults) {
218
+ this.currentValue = event.formData;
219
+ this.change.emit(event.formData);
220
+ return;
221
+ }
222
+ const { given, filled } = this.getGivenValue();
223
+ this.givenValue.held = event.formData;
224
+ const value = withoutFilledDefaults(event.formData, filled, given);
225
+ if (isEqual(value, this.currentValue)) {
226
+ // What the form holds changed, even though the value did not
227
+ this.emitValidationStatus(event.errors);
228
+ return;
229
+ }
230
+ this.currentValue = value;
231
+ this.change.emit(this.currentValue);
190
232
  }
191
- validateFormData() {
233
+ getGivenValue() {
192
234
  var _a;
193
- const { errors } = rjsfValidator.validateFormData((_a = this.value) !== null && _a !== void 0 ? _a : {}, this.prepareSchema(this.schema));
235
+ const schema = this.prepareSchema(this.schema);
236
+ if (((_a = this.givenValue) === null || _a === void 0 ? void 0 : _a.schemaId) !== schema.$id) {
237
+ const filled = getDefaultFormState(rjsfValidator, schema, this.currentValue, schema, false, FILL_DEFAULTS);
238
+ this.givenValue = {
239
+ schemaId: schema.$id,
240
+ given: this.currentValue,
241
+ filled,
242
+ held: filled,
243
+ };
244
+ }
245
+ return this.givenValue;
246
+ }
247
+ validateFormData() {
248
+ // With the defaults left out of the value, the form holds more than it
249
+ const value = this.includeDefaults
250
+ ? this.value
251
+ : this.getGivenValue().held;
252
+ const { errors } = rjsfValidator.validateFormData(value !== null && value !== void 0 ? value : {}, this.prepareSchema(this.schema));
194
253
  this.emitValidationStatus(errors);
195
254
  }
196
255
  /**
@@ -218,12 +277,35 @@ export class Form {
218
277
  const contentId = (fingerprint >>> 0).toString(36);
219
278
  return Object.assign(Object.assign({}, schema), { $id: $id ? `${$id}-${contentId}` : contentId });
220
279
  }
280
+ setInvalidInput(path, message) {
281
+ var _a;
282
+ const property = `.${path.join('.')}`;
283
+ const current = this.invalidInputErrors.get(property);
284
+ if (((_a = current === null || current === void 0 ? void 0 : current.message) !== null && _a !== void 0 ? _a : null) === message) {
285
+ return;
286
+ }
287
+ if (message === null) {
288
+ this.invalidInputErrors.delete(property);
289
+ }
290
+ else {
291
+ this.invalidInputErrors.set(property, {
292
+ name: 'invalidInput',
293
+ property: property,
294
+ message: message,
295
+ schemaPath: '',
296
+ });
297
+ }
298
+ this.validateFormData();
299
+ }
221
300
  hasExtraErrors() {
222
301
  return !!this.errors && Object.keys(this.errors).length > 0;
223
302
  }
224
303
  emitValidationStatus(errors) {
225
- const valid = (!errors || errors.length === 0) && !this.hasExtraErrors();
226
- const formErrors = this.mapErrors(errors !== null && errors !== void 0 ? errors : []);
304
+ const formErrors = [
305
+ ...this.mapErrors(errors !== null && errors !== void 0 ? errors : []),
306
+ ...this.invalidInputErrors.values(),
307
+ ];
308
+ const valid = formErrors.length === 0 && !this.hasExtraErrors();
227
309
  const status = { valid: valid, errors: formErrors };
228
310
  if (this.isValid !== valid || !valid) {
229
311
  this.validate.emit(status);
@@ -465,6 +547,26 @@ export class Form {
465
547
  "attribute": "reveal-errors",
466
548
  "defaultValue": "false"
467
549
  },
550
+ "includeDefaults": {
551
+ "type": "boolean",
552
+ "mutable": false,
553
+ "complexType": {
554
+ "original": "boolean",
555
+ "resolved": "boolean",
556
+ "references": {}
557
+ },
558
+ "required": false,
559
+ "optional": false,
560
+ "docs": {
561
+ "tags": [],
562
+ "text": "Set to `false` to leave the defaults of the schema out of the value,\nso that it stays as it was given until the user changes something. The\nform still shows the defaults. A default the user changes is in the\nvalue from then on, and so are the defaults that a change brings in,\nsuch as those of a new list item or of fields that depend on the\nchanged one. Pass the value the form emits back in as `value`.\nThe form validates what it shows, defaults included. When the user\nchanges everything back, the value is what the form was given, also\nwhen that is `null` or `undefined`."
563
+ },
564
+ "getter": false,
565
+ "setter": false,
566
+ "reflect": false,
567
+ "attribute": "include-defaults",
568
+ "defaultValue": "true"
569
+ },
468
570
  "highlightedField": {
469
571
  "type": "unknown",
470
572
  "mutable": false,
@@ -535,6 +637,9 @@ export class Form {
535
637
  static get elementRef() { return "host"; }
536
638
  static get watchers() {
537
639
  return [{
640
+ "propName": "value",
641
+ "methodName": "handleValueChange"
642
+ }, {
538
643
  "propName": "headingLevel",
539
644
  "methodName": "handleHeadingLevelChange"
540
645
  }, {