@limetech/lime-elements 40.2.5 → 40.4.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 (360) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/{checkbox.template-BewtdTin.js → checkbox.template-BPk8WkQF.js} +1 -1
  3. package/dist/cjs/{image.template-DZC6_5a4.js → image.template-DY7qwbuy.js} +1 -1
  4. package/dist/cjs/{index-DYg_7kkT.js → index--B6-r0uo.js} +3 -3
  5. package/dist/cjs/lime-elements.cjs.js +2 -2
  6. package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +2 -2
  7. package/dist/cjs/limel-action-bar_3.cjs.entry.js +8 -8
  8. package/dist/cjs/limel-ai-avatar.cjs.entry.js +3 -3
  9. package/dist/cjs/limel-badge.cjs.entry.js +3 -3
  10. package/dist/cjs/limel-banner.cjs.entry.js +2 -2
  11. package/dist/cjs/limel-breadcrumbs_8.cjs.entry.js +21 -21
  12. package/dist/cjs/limel-button-group.cjs.entry.js +3 -3
  13. package/dist/cjs/limel-button.cjs.entry.js +3 -3
  14. package/dist/cjs/limel-callout.cjs.entry.js +3 -3
  15. package/dist/cjs/limel-card.cjs.entry.js +4 -4
  16. package/dist/cjs/limel-chart.cjs.entry.js +3 -3
  17. package/dist/cjs/limel-checkbox.cjs.entry.js +4 -4
  18. package/dist/cjs/limel-chip-set.cjs.entry.js +8 -8
  19. package/dist/cjs/limel-chip_2.cjs.entry.js +6 -6
  20. package/dist/cjs/limel-circular-progress.cjs.entry.js +2 -2
  21. package/dist/cjs/limel-code-diff.cjs.entry.js +3 -3
  22. package/dist/cjs/limel-code-editor.cjs.entry.js +4 -4
  23. package/dist/cjs/limel-collapsible-section.cjs.entry.js +6 -6
  24. package/dist/cjs/limel-color-picker-palette.cjs.entry.js +4 -4
  25. package/dist/cjs/limel-color-picker.cjs.entry.js +3 -3
  26. package/dist/cjs/limel-config.cjs.entry.js +1 -1
  27. package/dist/cjs/limel-date-picker.cjs.entry.js +2 -2
  28. package/dist/cjs/limel-dialog.cjs.entry.js +5 -5
  29. package/dist/cjs/limel-dock-button.cjs.entry.js +4 -4
  30. package/dist/cjs/limel-dock.cjs.entry.js +7 -7
  31. package/dist/cjs/limel-drag-handle.cjs.entry.js +3 -3
  32. package/dist/cjs/limel-dynamic-label.cjs.entry.js +1 -1
  33. package/dist/cjs/limel-email-viewer.cjs.entry.js +4 -4
  34. package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +6 -6
  35. package/dist/cjs/limel-file-viewer.cjs.entry.js +4 -4
  36. package/dist/cjs/limel-file.cjs.entry.js +5 -5
  37. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +4 -4
  38. package/dist/cjs/limel-flex-container.cjs.entry.js +2 -2
  39. package/dist/cjs/limel-form.cjs.entry.js +14 -5
  40. package/dist/cjs/limel-grid.cjs.entry.js +2 -2
  41. package/dist/cjs/limel-header.cjs.entry.js +2 -2
  42. package/dist/cjs/limel-help-content.cjs.entry.js +2 -2
  43. package/dist/cjs/limel-help.cjs.entry.js +3 -3
  44. package/dist/cjs/limel-helper-line.cjs.entry.js +3 -3
  45. package/dist/cjs/limel-hotkey_4.cjs.entry.js +6 -6
  46. package/dist/cjs/limel-icon-button.cjs.entry.js +2 -2
  47. package/dist/cjs/limel-icon.cjs.entry.js +2 -2
  48. package/dist/cjs/limel-info-tile.cjs.entry.js +3 -3
  49. package/dist/cjs/limel-list-item.cjs.entry.js +7 -7
  50. package/dist/cjs/limel-markdown.cjs.entry.js +2 -2
  51. package/dist/cjs/limel-masonry-layout.cjs.entry.js +2 -2
  52. package/dist/cjs/limel-menu-item-meta.cjs.entry.js +2 -2
  53. package/dist/cjs/limel-pagination.cjs.entry.js +619 -0
  54. package/dist/cjs/limel-picker.cjs.entry.js +6 -6
  55. package/dist/cjs/limel-popover_2.cjs.entry.js +4 -4
  56. package/dist/cjs/limel-profile-picture.cjs.entry.js +5 -5
  57. package/dist/cjs/limel-progress-flow-item.cjs.entry.js +2 -2
  58. package/dist/cjs/limel-progress-flow.cjs.entry.js +2 -2
  59. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +7 -7
  60. package/dist/cjs/limel-radio-button-group.cjs.entry.js +3 -3
  61. package/dist/cjs/limel-radio-button.cjs.entry.js +3 -3
  62. package/dist/cjs/limel-select.cjs.entry.js +31 -20
  63. package/dist/cjs/limel-shortcut.cjs.entry.js +2 -2
  64. package/dist/cjs/limel-slider.cjs.entry.js +6 -6
  65. package/dist/cjs/limel-snackbar.cjs.entry.js +6 -6
  66. package/dist/cjs/limel-split-button.cjs.entry.js +4 -4
  67. package/dist/cjs/limel-switch.cjs.entry.js +3 -3
  68. package/dist/cjs/limel-tab-bar.cjs.entry.js +4 -4
  69. package/dist/cjs/limel-tab-panel.cjs.entry.js +3 -3
  70. package/dist/cjs/limel-table.cjs.entry.js +12 -12
  71. package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +8 -8
  72. package/dist/cjs/limel-text-editor.cjs.entry.js +9 -9
  73. package/dist/cjs/loader.cjs.js +2 -2
  74. package/dist/cjs/{render-list-component-1GrRKk_R.js → render-list-component-5ZKWpCnM.js} +1 -1
  75. package/dist/cjs/{translations-ZgjCRtut.js → translations-C5T2-_rH.js} +72 -0
  76. package/dist/collection/collection-manifest.json +1 -0
  77. package/dist/collection/components/3d-hover-effect-glow/3d-hover-effect-glow.js +1 -1
  78. package/dist/collection/components/action-bar/action-bar-item/action-bar-overflow-menu.js +1 -1
  79. package/dist/collection/components/action-bar/action-bar.js +2 -2
  80. package/dist/collection/components/ai-avatar/ai-avatar.js +1 -1
  81. package/dist/collection/components/badge/badge.js +2 -2
  82. package/dist/collection/components/banner/banner.js +1 -1
  83. package/dist/collection/components/breadcrumbs/breadcrumbs.js +1 -1
  84. package/dist/collection/components/button/button.js +2 -2
  85. package/dist/collection/components/button-group/button-group.js +1 -1
  86. package/dist/collection/components/callout/callout.js +1 -1
  87. package/dist/collection/components/card/card.js +1 -1
  88. package/dist/collection/components/checkbox/checkbox.js +1 -1
  89. package/dist/collection/components/chip/chip.js +1 -1
  90. package/dist/collection/components/chip-set/chip-set.js +1 -1
  91. package/dist/collection/components/circular-progress/circular-progress.js +1 -1
  92. package/dist/collection/components/code-diff/code-diff.js +1 -1
  93. package/dist/collection/components/code-editor/code-editor.js +1 -1
  94. package/dist/collection/components/collapsible-section/collapsible-section.js +1 -1
  95. package/dist/collection/components/color-picker/color-picker-palette.js +2 -2
  96. package/dist/collection/components/color-picker/color-picker.js +1 -1
  97. package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +1 -1
  98. package/dist/collection/components/dialog/dialog.js +2 -2
  99. package/dist/collection/components/dock/dock.js +2 -2
  100. package/dist/collection/components/drag-handle/drag-handle.js +1 -1
  101. package/dist/collection/components/email-viewer/email-viewer.js +1 -1
  102. package/dist/collection/components/file/file.js +1 -1
  103. package/dist/collection/components/file-dropzone/file-dropzone.js +1 -1
  104. package/dist/collection/components/file-input/file-input.js +1 -1
  105. package/dist/collection/components/flex-container/flex-container.js +1 -1
  106. package/dist/collection/components/form/form.js +1 -1
  107. package/dist/collection/components/form/form.test-schemas.js +55 -0
  108. package/dist/collection/components/form/widgets/select.js +10 -1
  109. package/dist/collection/components/grid/grid.js +1 -1
  110. package/dist/collection/components/header/header.js +1 -1
  111. package/dist/collection/components/help/help-content.js +1 -1
  112. package/dist/collection/components/help/help.js +2 -2
  113. package/dist/collection/components/helper-line/helper-line.js +2 -2
  114. package/dist/collection/components/hotkey/hotkey.js +1 -1
  115. package/dist/collection/components/icon/icon.js +1 -1
  116. package/dist/collection/components/icon-button/icon-button.js +1 -1
  117. package/dist/collection/components/info-tile/info-tile.js +2 -2
  118. package/dist/collection/components/input-field/input-field.js +1 -1
  119. package/dist/collection/components/list/list.js +1 -1
  120. package/dist/collection/components/list-item/list-item.js +2 -2
  121. package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.js +1 -1
  122. package/dist/collection/components/markdown/markdown.js +1 -1
  123. package/dist/collection/components/masonry-layout/masonry-layout.js +1 -1
  124. package/dist/collection/components/menu/menu.js +1 -1
  125. package/dist/collection/components/menu-list/menu-list.js +1 -1
  126. package/dist/collection/components/menu-surface/menu-surface.js +1 -1
  127. package/dist/collection/components/notched-outline/notched-outline.js +1 -1
  128. package/dist/collection/components/pagination/pagination.css +227 -0
  129. package/dist/collection/components/pagination/pagination.js +668 -0
  130. package/dist/collection/components/pagination/pagination.types.js +1 -0
  131. package/dist/collection/components/pagination/pagination.util.js +113 -0
  132. package/dist/collection/components/picker/picker.js +1 -1
  133. package/dist/collection/components/popover/popover.js +1 -1
  134. package/dist/collection/components/popover-surface/popover-surface.js +1 -1
  135. package/dist/collection/components/portal/portal.js +1 -1
  136. package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
  137. package/dist/collection/components/radio-button-group/radio-button.js +2 -2
  138. package/dist/collection/components/select/select.js +29 -17
  139. package/dist/collection/components/shortcut/shortcut.js +1 -1
  140. package/dist/collection/components/slider/slider.js +3 -3
  141. package/dist/collection/components/snackbar/snackbar.js +2 -2
  142. package/dist/collection/components/spinner/spinner.js +1 -1
  143. package/dist/collection/components/split-button/split-button.js +2 -2
  144. package/dist/collection/components/switch/switch.js +1 -1
  145. package/dist/collection/components/tab-bar/tab-bar.js +2 -2
  146. package/dist/collection/components/tab-panel/tab-panel.js +1 -1
  147. package/dist/collection/components/table/table.js +2 -2
  148. package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +3 -3
  149. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +1 -1
  150. package/dist/collection/components/text-editor/text-editor.js +1 -1
  151. package/dist/collection/components/tooltip/tooltip-content.js +1 -1
  152. package/dist/collection/components/tooltip/tooltip.js +2 -2
  153. package/dist/collection/interface.js +1 -0
  154. package/dist/collection/translations/da.js +9 -0
  155. package/dist/collection/translations/de.js +9 -0
  156. package/dist/collection/translations/en.js +9 -0
  157. package/dist/collection/translations/fi.js +9 -0
  158. package/dist/collection/translations/fr.js +9 -0
  159. package/dist/collection/translations/nl.js +9 -0
  160. package/dist/collection/translations/no.js +9 -0
  161. package/dist/collection/translations/sv.js +9 -0
  162. package/dist/esm/{checkbox.template-LN1xNaDw.js → checkbox.template-Cx_3u92S.js} +1 -1
  163. package/dist/esm/{image.template-BXDvrqGw.js → image.template-wqMwmOF-.js} +1 -1
  164. package/dist/esm/{index-BGxJfR2f.js → index-Bnc9lzk2.js} +3 -3
  165. package/dist/esm/lime-elements.js +3 -3
  166. package/dist/esm/limel-3d-hover-effect-glow.entry.js +2 -2
  167. package/dist/esm/limel-action-bar_3.entry.js +8 -8
  168. package/dist/esm/limel-ai-avatar.entry.js +3 -3
  169. package/dist/esm/limel-badge.entry.js +3 -3
  170. package/dist/esm/limel-banner.entry.js +2 -2
  171. package/dist/esm/limel-breadcrumbs_8.entry.js +21 -21
  172. package/dist/esm/limel-button-group.entry.js +3 -3
  173. package/dist/esm/limel-button.entry.js +3 -3
  174. package/dist/esm/limel-callout.entry.js +3 -3
  175. package/dist/esm/limel-card.entry.js +4 -4
  176. package/dist/esm/limel-chart.entry.js +3 -3
  177. package/dist/esm/limel-checkbox.entry.js +4 -4
  178. package/dist/esm/limel-chip-set.entry.js +8 -8
  179. package/dist/esm/limel-chip_2.entry.js +6 -6
  180. package/dist/esm/limel-circular-progress.entry.js +2 -2
  181. package/dist/esm/limel-code-diff.entry.js +3 -3
  182. package/dist/esm/limel-code-editor.entry.js +4 -4
  183. package/dist/esm/limel-collapsible-section.entry.js +6 -6
  184. package/dist/esm/limel-color-picker-palette.entry.js +4 -4
  185. package/dist/esm/limel-color-picker.entry.js +3 -3
  186. package/dist/esm/limel-config.entry.js +1 -1
  187. package/dist/esm/limel-date-picker.entry.js +2 -2
  188. package/dist/esm/limel-dialog.entry.js +5 -5
  189. package/dist/esm/limel-dock-button.entry.js +4 -4
  190. package/dist/esm/limel-dock.entry.js +7 -7
  191. package/dist/esm/limel-drag-handle.entry.js +3 -3
  192. package/dist/esm/limel-dynamic-label.entry.js +1 -1
  193. package/dist/esm/limel-email-viewer.entry.js +4 -4
  194. package/dist/esm/limel-file-dropzone_2.entry.js +6 -6
  195. package/dist/esm/limel-file-viewer.entry.js +4 -4
  196. package/dist/esm/limel-file.entry.js +5 -5
  197. package/dist/esm/limel-flatpickr-adapter.entry.js +4 -4
  198. package/dist/esm/limel-flex-container.entry.js +2 -2
  199. package/dist/esm/limel-form.entry.js +14 -5
  200. package/dist/esm/limel-grid.entry.js +2 -2
  201. package/dist/esm/limel-header.entry.js +2 -2
  202. package/dist/esm/limel-help-content.entry.js +2 -2
  203. package/dist/esm/limel-help.entry.js +3 -3
  204. package/dist/esm/limel-helper-line.entry.js +3 -3
  205. package/dist/esm/limel-hotkey_4.entry.js +6 -6
  206. package/dist/esm/limel-icon-button.entry.js +2 -2
  207. package/dist/esm/limel-icon.entry.js +2 -2
  208. package/dist/esm/limel-info-tile.entry.js +3 -3
  209. package/dist/esm/limel-list-item.entry.js +7 -7
  210. package/dist/esm/limel-markdown.entry.js +2 -2
  211. package/dist/esm/limel-masonry-layout.entry.js +2 -2
  212. package/dist/esm/limel-menu-item-meta.entry.js +2 -2
  213. package/dist/esm/limel-pagination.entry.js +617 -0
  214. package/dist/esm/limel-picker.entry.js +6 -6
  215. package/dist/esm/limel-popover_2.entry.js +4 -4
  216. package/dist/esm/limel-profile-picture.entry.js +5 -5
  217. package/dist/esm/limel-progress-flow-item.entry.js +2 -2
  218. package/dist/esm/limel-progress-flow.entry.js +2 -2
  219. package/dist/esm/limel-prosemirror-adapter.entry.js +7 -7
  220. package/dist/esm/limel-radio-button-group.entry.js +3 -3
  221. package/dist/esm/limel-radio-button.entry.js +3 -3
  222. package/dist/esm/limel-select.entry.js +31 -20
  223. package/dist/esm/limel-shortcut.entry.js +2 -2
  224. package/dist/esm/limel-slider.entry.js +6 -6
  225. package/dist/esm/limel-snackbar.entry.js +6 -6
  226. package/dist/esm/limel-split-button.entry.js +4 -4
  227. package/dist/esm/limel-switch.entry.js +3 -3
  228. package/dist/esm/limel-tab-bar.entry.js +4 -4
  229. package/dist/esm/limel-tab-panel.entry.js +3 -3
  230. package/dist/esm/limel-table.entry.js +12 -12
  231. package/dist/esm/limel-text-editor-link-menu.entry.js +8 -8
  232. package/dist/esm/limel-text-editor.entry.js +9 -9
  233. package/dist/esm/loader.js +3 -3
  234. package/dist/esm/{render-list-component-CUJ2wdo4.js → render-list-component-cicbMp0l.js} +1 -1
  235. package/dist/esm/{translations-CPFNSfWw.js → translations-Bwm2y2E4.js} +72 -0
  236. package/dist/lime-elements/lime-elements.esm.js +1 -1
  237. package/dist/lime-elements/{p-c0263530.entry.js → p-02812dc8.entry.js} +2 -2
  238. package/dist/lime-elements/{p-fe531211.entry.js → p-03fb2603.entry.js} +1 -1
  239. package/dist/lime-elements/{p-86b9f9d0.entry.js → p-052c3bc6.entry.js} +1 -1
  240. package/dist/lime-elements/{p-1b25f158.entry.js → p-055b11f7.entry.js} +2 -2
  241. package/dist/lime-elements/{p-4682ddb0.entry.js → p-1162dd39.entry.js} +1 -1
  242. package/dist/lime-elements/{p-12fe8fe1.entry.js → p-1a478498.entry.js} +3 -3
  243. package/dist/lime-elements/p-21109d9b.entry.js +1 -0
  244. package/dist/lime-elements/p-22f85b99.entry.js +1 -0
  245. package/dist/lime-elements/{p-2ad8eed9.entry.js → p-24041bbb.entry.js} +1 -1
  246. package/dist/lime-elements/p-2bbdac10.entry.js +1 -0
  247. package/dist/lime-elements/p-2d84ea04.entry.js +1 -0
  248. package/dist/lime-elements/{p-a1c15727.entry.js → p-35fa1063.entry.js} +1 -1
  249. package/dist/lime-elements/p-38b09f87.entry.js +1 -0
  250. package/dist/lime-elements/p-3916b316.entry.js +1 -0
  251. package/dist/lime-elements/p-3fd7e8aa.entry.js +1 -0
  252. package/dist/lime-elements/{p-de070191.entry.js → p-408c4dcb.entry.js} +1 -1
  253. package/dist/lime-elements/p-459eea13.entry.js +1 -0
  254. package/dist/lime-elements/p-48928b4f.entry.js +1 -0
  255. package/dist/lime-elements/p-4c65dee7.entry.js +1 -0
  256. package/dist/lime-elements/p-4ffbfc79.entry.js +1 -0
  257. package/dist/lime-elements/{p-943e708f.entry.js → p-51dc5f0b.entry.js} +1 -1
  258. package/dist/lime-elements/p-532ea234.entry.js +1 -0
  259. package/dist/lime-elements/p-54793c06.entry.js +1 -0
  260. package/dist/lime-elements/{p-be5cc2ae.entry.js → p-54dcf46f.entry.js} +1 -1
  261. package/dist/lime-elements/{p-eeb7fcb3.entry.js → p-5b371d6b.entry.js} +2 -2
  262. package/dist/lime-elements/p-65cded0e.entry.js +1 -0
  263. package/dist/lime-elements/p-66b125f2.entry.js +1 -0
  264. package/dist/lime-elements/{p-33ccc617.entry.js → p-6b7ff8e0.entry.js} +1 -1
  265. package/dist/lime-elements/{p-a579e80f.entry.js → p-6d5b23ad.entry.js} +1 -1
  266. package/dist/lime-elements/{p-1907a5be.entry.js → p-74bd0c1a.entry.js} +1 -1
  267. package/dist/lime-elements/{p-f2c8b10b.entry.js → p-7cbf50fc.entry.js} +1 -1
  268. package/dist/lime-elements/p-7e212fa7.entry.js +1 -0
  269. package/dist/lime-elements/{p-bb9b399c.entry.js → p-8115da75.entry.js} +1 -1
  270. package/dist/lime-elements/{p-d19ab443.entry.js → p-82696d24.entry.js} +1 -1
  271. package/dist/lime-elements/{p-21558be2.entry.js → p-835149c4.entry.js} +1 -1
  272. package/dist/lime-elements/{p-f09822a6.entry.js → p-8475a3b8.entry.js} +1 -1
  273. package/dist/lime-elements/{p-94191814.entry.js → p-8af3e4a1.entry.js} +2 -2
  274. package/dist/lime-elements/{p-25555311.entry.js → p-8fa9c9ea.entry.js} +1 -1
  275. package/dist/lime-elements/{p-c0a03b7c.entry.js → p-9ac39039.entry.js} +1 -1
  276. package/dist/lime-elements/{p-CYivp4-w.js → p-BY85K-4J.js} +1 -1
  277. package/dist/lime-elements/p-Bnc9lzk2.js +2 -0
  278. package/dist/lime-elements/p-DAFuhe5e.js +1 -0
  279. package/dist/lime-elements/p-DQJU9gzh.js +1 -0
  280. package/dist/lime-elements/p-DpJgXIWf.js +1 -0
  281. package/dist/lime-elements/{p-ccb77bcf.entry.js → p-a41b5ff3.entry.js} +1 -1
  282. package/dist/lime-elements/p-a462aeb7.entry.js +1 -0
  283. package/dist/lime-elements/p-ac9c5c88.entry.js +1 -0
  284. package/dist/lime-elements/p-b194a212.entry.js +1 -0
  285. package/dist/lime-elements/p-b4988a9b.entry.js +1 -0
  286. package/dist/lime-elements/p-b5484494.entry.js +1 -0
  287. package/dist/lime-elements/p-b81a2728.entry.js +1 -0
  288. package/dist/lime-elements/p-be8610ff.entry.js +1 -0
  289. package/dist/lime-elements/{p-70087de6.entry.js → p-c2a3ca7c.entry.js} +1 -1
  290. package/dist/lime-elements/{p-6665e14b.entry.js → p-c2a60508.entry.js} +1 -1
  291. package/dist/lime-elements/p-c2ff132c.entry.js +1 -0
  292. package/dist/lime-elements/p-c72e5007.entry.js +1 -0
  293. package/dist/lime-elements/{p-9c2b3cf4.entry.js → p-c823054d.entry.js} +1 -1
  294. package/dist/lime-elements/p-cb407bef.entry.js +1 -0
  295. package/dist/lime-elements/{p-7fe6a073.entry.js → p-d0cec424.entry.js} +1 -1
  296. package/dist/lime-elements/{p-120182f5.entry.js → p-d351b9ae.entry.js} +1 -1
  297. package/dist/lime-elements/{p-6acd82ce.entry.js → p-d6dadc61.entry.js} +1 -1
  298. package/dist/lime-elements/p-d93b7b9f.entry.js +23 -0
  299. package/dist/lime-elements/p-dadd2e17.entry.js +1 -0
  300. package/dist/lime-elements/{p-ab0c7eeb.entry.js → p-de631fc3.entry.js} +1 -1
  301. package/dist/lime-elements/{p-09036073.entry.js → p-e508771f.entry.js} +1 -1
  302. package/dist/lime-elements/{p-d79ee300.entry.js → p-f0a79cdd.entry.js} +1 -1
  303. package/dist/lime-elements/p-f309ceb8.entry.js +1 -0
  304. package/dist/lime-elements/{p-93df903a.entry.js → p-f333f12d.entry.js} +1 -1
  305. package/dist/lime-elements/p-f6361b03.entry.js +1 -0
  306. package/dist/lime-elements/p-f717cd7a.entry.js +1 -0
  307. package/dist/lime-elements/p-f72ee01b.entry.js +1 -0
  308. package/dist/lime-elements/{p-0ecf8399.entry.js → p-f81dc23a.entry.js} +1 -1
  309. package/dist/types/components/form/form.test-schemas.d.ts +2 -0
  310. package/dist/types/components/form/form.types.d.ts +5 -0
  311. package/dist/types/components/pagination/pagination.d.ts +288 -0
  312. package/dist/types/components/pagination/pagination.types.d.ts +42 -0
  313. package/dist/types/components/pagination/pagination.util.d.ts +38 -0
  314. package/dist/types/components/select/select.d.ts +9 -3
  315. package/dist/types/components.d.ts +155 -0
  316. package/dist/types/interface.d.ts +1 -0
  317. package/dist/types/translations/da.d.ts +9 -0
  318. package/dist/types/translations/de.d.ts +9 -0
  319. package/dist/types/translations/en.d.ts +9 -0
  320. package/dist/types/translations/fi.d.ts +9 -0
  321. package/dist/types/translations/fr.d.ts +9 -0
  322. package/dist/types/translations/nl.d.ts +9 -0
  323. package/dist/types/translations/no.d.ts +9 -0
  324. package/dist/types/translations/sv.d.ts +9 -0
  325. package/package.json +1 -1
  326. package/dist/lime-elements/p-057356b0.entry.js +0 -1
  327. package/dist/lime-elements/p-0a46959b.entry.js +0 -1
  328. package/dist/lime-elements/p-0c47d262.entry.js +0 -1
  329. package/dist/lime-elements/p-15bedc64.entry.js +0 -1
  330. package/dist/lime-elements/p-191efd88.entry.js +0 -1
  331. package/dist/lime-elements/p-20297168.entry.js +0 -1
  332. package/dist/lime-elements/p-24354198.entry.js +0 -1
  333. package/dist/lime-elements/p-26fed26a.entry.js +0 -1
  334. package/dist/lime-elements/p-2737cade.entry.js +0 -1
  335. package/dist/lime-elements/p-2b01c1f2.entry.js +0 -1
  336. package/dist/lime-elements/p-3b052fff.entry.js +0 -1
  337. package/dist/lime-elements/p-46bcdf3c.entry.js +0 -1
  338. package/dist/lime-elements/p-4b91d2c3.entry.js +0 -1
  339. package/dist/lime-elements/p-715cc741.entry.js +0 -1
  340. package/dist/lime-elements/p-7bfac292.entry.js +0 -1
  341. package/dist/lime-elements/p-8175c53a.entry.js +0 -1
  342. package/dist/lime-elements/p-88e40db2.entry.js +0 -1
  343. package/dist/lime-elements/p-946a33ea.entry.js +0 -1
  344. package/dist/lime-elements/p-BGxJfR2f.js +0 -2
  345. package/dist/lime-elements/p-DQvn9bzh.js +0 -1
  346. package/dist/lime-elements/p-Dhnynzqz.js +0 -1
  347. package/dist/lime-elements/p-Dpg0OkbJ.js +0 -1
  348. package/dist/lime-elements/p-abf3dce5.entry.js +0 -1
  349. package/dist/lime-elements/p-aee66710.entry.js +0 -1
  350. package/dist/lime-elements/p-b03367f0.entry.js +0 -1
  351. package/dist/lime-elements/p-b1fb33a2.entry.js +0 -23
  352. package/dist/lime-elements/p-b3274e2e.entry.js +0 -1
  353. package/dist/lime-elements/p-c8ce60a0.entry.js +0 -1
  354. package/dist/lime-elements/p-cf955cc2.entry.js +0 -1
  355. package/dist/lime-elements/p-d70c53ae.entry.js +0 -1
  356. package/dist/lime-elements/p-d873e490.entry.js +0 -1
  357. package/dist/lime-elements/p-dd9591a3.entry.js +0 -1
  358. package/dist/lime-elements/p-e3ba7e15.entry.js +0 -1
  359. package/dist/lime-elements/p-ea34a4bc.entry.js +0 -1
  360. package/dist/lime-elements/p-eecd1132.entry.js +0 -1
@@ -0,0 +1,619 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index--B6-r0uo.js');
4
+ var translations = require('./translations-C5T2-_rH.js');
5
+ var randomString = require('./random-string-BTzDB2ee.js');
6
+ var language = require('./language-CaqPKPyW.js');
7
+
8
+ /**
9
+ * How many positions are rendered at once, counting both page numbers and gap
10
+ * markers. Constant, so the control keeps its width as the user pages through
11
+ * a set — a gap and a page number take up the same room, so what matters is
12
+ * how many positions there are, not how many of them are numbers.
13
+ */
14
+ const VISIBLE_SLOTS = 7;
15
+ /** How many pages to keep either side of the current one. */
16
+ const SIBLINGS = 1;
17
+ const FIRST_PAGE$1 = 1;
18
+ /**
19
+ * Build the list of positions to render for a given page count.
20
+ *
21
+ * The first and the last page are always included, so both ends of the set are
22
+ * always one click away. The rest of the room goes to the pages around the
23
+ * current one, and whatever is skipped becomes a gap.
24
+ *
25
+ * `Number.isSafeInteger` rather than `Number.isInteger`: past 2^53 arithmetic
26
+ * on page numbers stops being exact. The component validates these too; this
27
+ * guards them again because the cost of being wrong here is a wrong window
28
+ * during render.
29
+ *
30
+ * @param currentPage - the page the user is on, 1-based
31
+ * @param totalPages - how many pages there are in total
32
+ * @returns the positions to render, in order
33
+ */
34
+ function getPageSlots(currentPage, totalPages) {
35
+ if (!Number.isSafeInteger(totalPages) || totalPages < FIRST_PAGE$1) {
36
+ return [];
37
+ }
38
+ const pages = collectVisiblePages(clampToSet(currentPage, totalPages), totalPages);
39
+ return withGaps(pages);
40
+ }
41
+ /**
42
+ * @param page - the page to pull into the set
43
+ * @param totalPages - how many pages there are in total
44
+ * @returns a whole page number within `1..totalPages`
45
+ */
46
+ function clampToSet(page, totalPages) {
47
+ if (!Number.isSafeInteger(Math.floor(page))) {
48
+ return FIRST_PAGE$1;
49
+ }
50
+ return Math.min(Math.max(FIRST_PAGE$1, Math.floor(page)), totalPages);
51
+ }
52
+ /**
53
+ * Pick which page numbers to render, so that `withGaps` turns them into
54
+ * exactly `VISIBLE_SLOTS` positions.
55
+ *
56
+ * Which of the three shapes applies depends only on whether there is anything
57
+ * to skip on each side. With one gap there is room for six numbers, with two
58
+ * there is room for five, and the gaps make up the difference.
59
+ *
60
+ * @param currentPage - the page the user is on, 1-based
61
+ * @param totalPages - how many pages there are in total
62
+ * @returns the page numbers to render, ascending
63
+ */
64
+ function collectVisiblePages(currentPage, totalPages) {
65
+ if (totalPages <= VISIBLE_SLOTS) {
66
+ return range(FIRST_PAGE$1, totalPages);
67
+ }
68
+ const firstSibling = Math.max(currentPage - SIBLINGS, FIRST_PAGE$1);
69
+ const lastSibling = Math.min(currentPage + SIBLINGS, totalPages);
70
+ if (firstSibling <= FIRST_PAGE$1 + 1) {
71
+ return [...range(FIRST_PAGE$1, VISIBLE_SLOTS - 2), totalPages];
72
+ }
73
+ if (lastSibling >= totalPages - 1) {
74
+ return [
75
+ FIRST_PAGE$1,
76
+ ...range(totalPages - (VISIBLE_SLOTS - 3), totalPages),
77
+ ];
78
+ }
79
+ return [FIRST_PAGE$1, ...range(firstSibling, lastSibling), totalPages];
80
+ }
81
+ /**
82
+ * @param from - the first number, inclusive
83
+ * @param to - the last number, inclusive
84
+ * @returns every whole number between the two
85
+ */
86
+ function range(from, to) {
87
+ return Array.from({ length: to - from + 1 }, (_, step) => from + step);
88
+ }
89
+ /**
90
+ * Insert a gap wherever the rendered page numbers are not consecutive.
91
+ *
92
+ * A gap that would hide a single page is rendered as that page instead: the
93
+ * marker is as wide as a page number, so it would save no room.
94
+ *
95
+ * @param pages - the page numbers to render, ascending
96
+ * @returns the positions to render, in order
97
+ */
98
+ function withGaps(pages) {
99
+ return pages.flatMap((page, index) => {
100
+ const slot = { kind: 'page', page: page };
101
+ if (index === 0) {
102
+ return [slot];
103
+ }
104
+ const skipped = page - pages[index - 1] - 1;
105
+ if (skipped === 0) {
106
+ return [slot];
107
+ }
108
+ if (skipped === 1) {
109
+ return [{ kind: 'page', page: page - 1 }, slot];
110
+ }
111
+ return [
112
+ {
113
+ kind: 'gap',
114
+ from: pages[index - 1] + 1,
115
+ to: page - 1,
116
+ },
117
+ slot,
118
+ ];
119
+ });
120
+ }
121
+
122
+ const paginationCss = () => `@charset "UTF-8";:host(limel-pagination){display:block;box-sizing:border-box}*{box-sizing:border-box}nav{display:flex;align-items:center}button{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit}button:focus{outline:none}button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:1.75rem;min-width:1.75rem;border-radius:1.75rem;padding:0 0.5rem;font-variant-numeric:tabular-nums}button:not([aria-disabled=true]):not([aria-current=page]){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:rgb(var(--contrast-1100));background-color:transparent}button:not([aria-disabled=true]):not([aria-current=page]):hover,button:not([aria-disabled=true]):not([aria-current=page]):focus,button:not([aria-disabled=true]):not([aria-current=page]):focus-visible{will-change:color, background-color, box-shadow, transform}button:not([aria-disabled=true]):not([aria-current=page]):hover,button:not([aria-disabled=true]):not([aria-current=page]):focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}button:not([aria-disabled=true]):not([aria-current=page]):hover{box-shadow:var(--button-shadow-hovered)}button:not([aria-disabled=true]):not([aria-current=page]):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:not([aria-disabled=true]):not([aria-current=page]):hover,button:not([aria-disabled=true]):not([aria-current=page]):active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}button[aria-disabled=true]:not([aria-current=page]){opacity:0.4}button[aria-disabled=true]{cursor:default}button[aria-current=page]{background-color:var(--limel-theme-surface-background-color);box-shadow:var(--button-shadow-inset)}button limel-spinner{position:absolute;pointer-events:none}.gap{display:inline-flex;align-items:center;justify-content:center;height:1.75rem;width:1.75rem;color:rgb(var(--contrast-1100))}.arrow span{display:block;border-style:solid;border-color:transparent;border-width:0.25rem 0 0.25rem 0.375rem;border-left-color:currentColor;transition:transform 0.2s ease}.arrow.previous span{transform:rotateZ(180deg)}.arrow:not([aria-disabled=true]):hover.next span{transform:translate3d(0.1rem, 0, 0)}.arrow:not([aria-disabled=true]):hover.previous span{transform:translate3d(-0.1rem, 0, 0) rotateZ(180deg)}.live-region{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}`;
123
+
124
+ const FIRST_PAGE = 1;
125
+ const DEFAULT_PAGE_SIZE = 100;
126
+ /** Where `global/translations` lands when it cannot use a language. */
127
+ const FALLBACK_LANGUAGE = 'en';
128
+ const Pagination = class {
129
+ constructor(hostRef) {
130
+ index.registerInstance(this, hostRef);
131
+ this.goToPage = index.createEvent(this, "goToPage", 6);
132
+ /**
133
+ * Which page to show. The first page is `1`, not `0`.
134
+ * Set it to the page from `goToPage` to move the control.
135
+ */
136
+ this.page = FIRST_PAGE;
137
+ /**
138
+ * Number of items that fit on one page.
139
+ * Together with `totalItems`, used by the component to calculate the total number of pages.
140
+ */
141
+ this.pageSize = DEFAULT_PAGE_SIZE;
142
+ /**
143
+ * How many items there are in total, across every page.
144
+ * `null` means the count has not arrived yet.
145
+ * Together with `pageSize`, used by the component to calculate the total number of pages.
146
+ */
147
+ this.totalItems = null;
148
+ /**
149
+ * Set this to `true` while you are fetching a page.
150
+ */
151
+ this.loading = false;
152
+ /**
153
+ * The language used for the labels and the tooltips, and for the way
154
+ * numbers are written.
155
+ */
156
+ this.language = 'en';
157
+ /**
158
+ * The count from the last time we had one, so the control can hold its
159
+ * shape while a new one is on its way. The count rather than the page count
160
+ * it implies, because `pageSize` may change while we are waiting.
161
+ */
162
+ this.lastKnownTotalItems = null;
163
+ this.liveMessage = '';
164
+ /** Ids are per slot, not per page: a page moves between slots, a slot does not. */
165
+ this.idPrefix = randomString.createRandomString();
166
+ /** The value each prop was last complained about with. */
167
+ this.warnedAbout = new Map();
168
+ /** Settled once per render, and the only thing `render` reads. */
169
+ this.view = {
170
+ page: FIRST_PAGE,
171
+ pageCount: null,
172
+ pageSize: DEFAULT_PAGE_SIZE,
173
+ totalItems: null,
174
+ };
175
+ /**
176
+ * A gap marker, or a page button.
177
+ *
178
+ * @param slot - the position to render
179
+ * @param index - where the position sits in the window
180
+ * @returns the rendered slot
181
+ */
182
+ this.renderSlot = (slot, index$1) => {
183
+ if (slot.kind === 'gap') {
184
+ return (index.h("span", { key: `gap-${index$1}`, class: "gap", "aria-hidden": "true" }, "\u00B7\u00B7\u00B7"));
185
+ }
186
+ const isCurrent = slot.page === this.currentPage;
187
+ return (index.h("button", { key: `page-${index$1}`, id: this.slotId(index$1), class: "page", "aria-current": isCurrent ? 'page' : null, "aria-disabled": this.loading ? 'true' : null, "aria-label": this.pageLabel(slot.page, isCurrent), "data-page": slot.page, onClick: this.selectPage }, this.formatNumber(slot.page), this.renderSpinner(isCurrent), this.renderTooltip(slot.page, index$1)));
188
+ };
189
+ // Bound once: a handler built per render is a new identity each time, so
190
+ // every button would have its listener swapped on every page change.
191
+ this.step = (event) => {
192
+ const direction = event.currentTarget.dataset
193
+ .direction;
194
+ if (this.isArrowDisabled(direction)) {
195
+ return;
196
+ }
197
+ this.goTo(this.currentPage + (direction === 'next' ? 1 : -1));
198
+ };
199
+ this.selectPage = (event) => {
200
+ if (this.loading) {
201
+ return;
202
+ }
203
+ const { page } = event.currentTarget.dataset;
204
+ this.goTo(Number(page));
205
+ };
206
+ this.translate = (key, params) => {
207
+ return translations.translate.get(key, this.language, params);
208
+ };
209
+ }
210
+ /**
211
+ * Settling here rather than in a `@Watch` keeps the result the same
212
+ * however the consumer assigns the props. A watcher runs the moment one
213
+ * property is set, so `totalItems` and `page` assigned in the same tick
214
+ * would settle twice, the first time against a page count about to change.
215
+ */
216
+ componentWillRender() {
217
+ // The only place the three validators run. Everything after this reads
218
+ // the answers rather than asking again.
219
+ const totalItems = this.knownTotalItems;
220
+ const pageSize = this.usablePageSize;
221
+ const usable = this.wholePage(this.page);
222
+ if (totalItems !== null) {
223
+ this.lastKnownTotalItems = totalItems;
224
+ }
225
+ const pageCount = this.countPages(totalItems !== null && totalItems !== void 0 ? totalItems : this.lastKnownTotalItems, pageSize);
226
+ const page = this.capToLastPage(usable, pageCount);
227
+ this.view = {
228
+ page: page,
229
+ pageCount: pageCount,
230
+ pageSize: pageSize,
231
+ totalItems: totalItems,
232
+ };
233
+ this.readOut(page);
234
+ this.reconcile(page, usable);
235
+ this.shownPage = page;
236
+ }
237
+ /**
238
+ * @param total - the count to divide, or `null` if none is known
239
+ * @param pageSize - how many items fit on one page
240
+ * @returns how many pages that makes, or `null` when nothing is known
241
+ */
242
+ countPages(total, pageSize) {
243
+ if (total === null) {
244
+ return null;
245
+ }
246
+ return Math.max(FIRST_PAGE, Math.ceil(total / pageSize));
247
+ }
248
+ componentDidRender() {
249
+ const page = this.pendingCorrection;
250
+ if (page === undefined) {
251
+ return;
252
+ }
253
+ this.pendingCorrection = undefined;
254
+ this.emitGoToPage(page, 'clamped');
255
+ }
256
+ /**
257
+ * Read out the page whenever what it holds changes — not only when its
258
+ * number does. A page size that doubles leaves the user on page 3 of a
259
+ * different set, and someone who cannot see the screen is owed that.
260
+ *
261
+ * Compared as numbers rather than as the sentence they make. The same
262
+ * items in another language, or a count going away while the next one
263
+ * loads, both rewrite the sentence without anything having moved.
264
+ *
265
+ * @param page - the page about to be rendered
266
+ */
267
+ readOut(page) {
268
+ const range = this.rangeIdentity(page);
269
+ const previous = this.lastRange;
270
+ this.lastRange = range;
271
+ if (this.shownPage === undefined) {
272
+ return;
273
+ }
274
+ const hasMoved = page !== this.shownPage;
275
+ const holdsSomethingElse = range !== null && previous !== null && range !== previous;
276
+ if (hasMoved || holdsSomethingElse) {
277
+ this.liveMessage =
278
+ this.rangeLabel(page) || this.pageLabel(page, true);
279
+ }
280
+ }
281
+ /**
282
+ * The items themselves, not the numbers that imply them: a total that
283
+ * ticks from 248 to 249 leaves every page but the last one holding exactly
284
+ * what it held.
285
+ *
286
+ * @param page - the page about to be rendered
287
+ * @returns which items the page holds, or `null` while that is unknown
288
+ */
289
+ rangeIdentity(page) {
290
+ const items = this.itemsOn(page);
291
+ return items === null ? null : `${items.from}:${items.to}`;
292
+ }
293
+ /**
294
+ * @param page - the page to measure, 1-based
295
+ * @returns how many items come before it
296
+ */
297
+ offsetOf(page) {
298
+ return (page - FIRST_PAGE) * this.view.pageSize;
299
+ }
300
+ /**
301
+ * The one place that works out which items a page holds. The last page is
302
+ * usually short, so the upper bound is capped at what exists.
303
+ *
304
+ * @param page - the page to measure, 1-based
305
+ * @returns the first and last item on it, or `null` with no count
306
+ */
307
+ itemsOn(page) {
308
+ const { totalItems, pageSize } = this.view;
309
+ if (totalItems === null) {
310
+ return null;
311
+ }
312
+ const from = this.offsetOf(page) + 1;
313
+ return { from: from, to: Math.min(from + pageSize - 1, totalItems) };
314
+ }
315
+ /**
316
+ * Tell the consumer when we are not showing what they asked for.
317
+ *
318
+ * A page we had to *correct* is always news: the value was unusable
319
+ * whatever the count says. A page we had to *clamp* is only news when we
320
+ * have a count of our own to justify it — while one is in flight we hold
321
+ * the shape we last knew, and a shape is not evidence that the consumer's
322
+ * page is wrong. Asserting it against a stale count destroys a page that
323
+ * was about to turn out valid, and nothing later can undo that.
324
+ *
325
+ * @param page - the page about to be rendered
326
+ * @param usable - the page they asked for, once validated
327
+ */
328
+ reconcile(page, usable) {
329
+ const asked = this.page;
330
+ const isCorrected = !Object.is(usable, asked);
331
+ const isClamped = page !== usable;
332
+ const shouldTell = isCorrected || (isClamped && this.view.totalItems !== null);
333
+ // Forget only when we are genuinely showing what was asked for. Going
334
+ // quiet because we cannot vouch for a bound is not the same thing: a
335
+ // clamp we already reported would be reported again the moment the
336
+ // count came back.
337
+ if (!isCorrected && !isClamped) {
338
+ this.reportedAsk = undefined;
339
+ }
340
+ if (!shouldTell) {
341
+ return;
342
+ }
343
+ // Said once per page-and-ask. `Object.is`, so a `NaN` page counts as
344
+ // reported rather than being re-sent on every render for the life of
345
+ // the component.
346
+ if (page === this.shownPage && Object.is(asked, this.reportedAsk)) {
347
+ return;
348
+ }
349
+ this.reportedAsk = asked;
350
+ this.pendingCorrection = page;
351
+ }
352
+ handleLanguageChange() {
353
+ this.numberFormat = undefined;
354
+ }
355
+ render() {
356
+ const { page, pageCount } = this.view;
357
+ const slots = this.slotsFor(page, pageCount);
358
+ return (index.h(index.Host, { key: '40d6123ac887f519fc31690fce7fcb46e73f2199' }, index.h("nav", { key: '183d264e761d168c74b8e2bfa8d04f3ee391c937', "aria-label": this.translate('pagination.label'), "aria-busy": this.loading ? 'true' : null }, this.renderArrow('previous'), slots.map((slot, index) => this.renderSlot(slot, index)), this.renderArrow('next')), index.h("span", { key: 'e59f62c2644a9a4a513ab3a3455854084434aabc', class: "live-region", "aria-live": "polite" }, this.liveMessage)));
359
+ }
360
+ /**
361
+ * Without a count we know where the user is but not how far the set goes,
362
+ * so we show that one page rather than nothing. A strip of arrows with no
363
+ * number on it says less than it looks like it does.
364
+ *
365
+ * @param page - the page being shown
366
+ * @param pageCount - how many pages there are, or `null` if not yet known
367
+ * @returns the positions to render
368
+ */
369
+ slotsFor(page, pageCount) {
370
+ if (pageCount === null) {
371
+ return [{ kind: 'page', page: page }];
372
+ }
373
+ return getPageSlots(page, pageCount);
374
+ }
375
+ /**
376
+ * A spinner around the page the user is heading for, while it loads.
377
+ *
378
+ * @param isCurrent - whether this is the page being loaded
379
+ * @returns the rendered spinner
380
+ */
381
+ renderSpinner(isCurrent) {
382
+ if (!isCurrent || !this.loading) {
383
+ return;
384
+ }
385
+ return index.h("limel-spinner", null);
386
+ }
387
+ /**
388
+ * Names the page a button leads to, and what that page holds.
389
+ *
390
+ * Nested inside the button so the two are created and torn down as one:
391
+ * `limel-tooltip` resolves its owner element once and never looks again.
392
+ *
393
+ * @param page - the page the tooltip describes
394
+ * @param index - where the page sits in the window
395
+ * @returns the rendered tooltip
396
+ */
397
+ renderTooltip(page, index$1) {
398
+ return (index.h("limel-tooltip", { elementId: this.slotId(index$1), label: this.translate('pagination.page', {
399
+ page: this.formatNumber(page),
400
+ }), helperLabel: this.rangeLabel(page) }));
401
+ }
402
+ /**
403
+ * @param direction - which arrow to render
404
+ * @returns the rendered arrow
405
+ */
406
+ renderArrow(direction) {
407
+ const isDisabled = this.isArrowDisabled(direction);
408
+ return (index.h("button", { id: this.arrowId(direction), class: `arrow ${direction}`, "aria-label": this.translate(`pagination.${direction}-page`), "aria-disabled": isDisabled ? 'true' : null, "data-direction": direction, onClick: this.step }, index.h("span", { "aria-hidden": "true" }), this.renderArrowTooltip(direction)));
409
+ }
410
+ /**
411
+ * Says what the arrow does, which its glyph only implies, and where it
412
+ * lands. At either end of the set there is nowhere to land.
413
+ *
414
+ * @param direction - which arrow to describe
415
+ * @returns the rendered tooltip
416
+ */
417
+ renderArrowTooltip(direction) {
418
+ if (this.isArrowDisabled(direction)) {
419
+ return;
420
+ }
421
+ const target = direction === 'next' ? this.currentPage + 1 : this.currentPage - 1;
422
+ return (index.h("limel-tooltip", { elementId: this.arrowId(direction), label: this.translate(`pagination.go-to-${direction}-page`), helperLabel: this.translate('pagination.page', {
423
+ page: this.formatNumber(target),
424
+ }) }));
425
+ }
426
+ isArrowDisabled(direction) {
427
+ if (this.loading) {
428
+ return true;
429
+ }
430
+ const { page, pageCount } = this.view;
431
+ if (direction === 'previous') {
432
+ return page <= FIRST_PAGE;
433
+ }
434
+ return pageCount === null || page >= pageCount;
435
+ }
436
+ /**
437
+ * @param page - the page to ask for, 1-based
438
+ */
439
+ goTo(page) {
440
+ if (page === this.currentPage) {
441
+ return;
442
+ }
443
+ this.emitGoToPage(page, 'user');
444
+ }
445
+ /** The page on screen: the one asked for, within the range that exists. */
446
+ get currentPage() {
447
+ return this.view.page;
448
+ }
449
+ emitGoToPage(page, reason) {
450
+ this.goToPage.emit({
451
+ page: page,
452
+ reason: reason,
453
+ pageSize: this.view.pageSize,
454
+ offset: this.offsetOf(page),
455
+ });
456
+ }
457
+ /**
458
+ * `totalItems` when it is a count we can do arithmetic with, and `null`
459
+ * — "not known yet" — when it is not. A `NaN` count would make the page
460
+ * count `NaN`, which no comparison catches.
461
+ */
462
+ get knownTotalItems() {
463
+ const { totalItems } = this;
464
+ if (totalItems === null || totalItems === undefined) {
465
+ return null;
466
+ }
467
+ if (Number.isSafeInteger(totalItems) && totalItems >= 0) {
468
+ this.warnedAbout.delete('totalItems');
469
+ return totalItems;
470
+ }
471
+ this.warnOnce('totalItems', totalItems, () => `\`totalItems\` must be a whole number of at least 0, or null, but was ${totalItems}. Ignoring it and keeping the last count it had.`);
472
+ return null;
473
+ }
474
+ /** `pageSize`, or the default when we were given something unusable. */
475
+ get usablePageSize() {
476
+ return this.countable('pageSize', this.pageSize, FIRST_PAGE, DEFAULT_PAGE_SIZE);
477
+ }
478
+ /**
479
+ * A page number we can count with, whatever the consumer supplied.
480
+ *
481
+ * @param page - the value the consumer gave
482
+ * @returns a whole number of at least 1
483
+ */
484
+ wholePage(page) {
485
+ return this.countable('page', page, FIRST_PAGE, FIRST_PAGE);
486
+ }
487
+ /**
488
+ * A prop as a whole number we can safely count with, or the fallback.
489
+ *
490
+ * `Number.isSafeInteger` rather than `Number.isFinite`: past 2^53 a page
491
+ * number cannot be incremented, and arithmetic on it stops being exact.
492
+ *
493
+ * @param prop - the prop being read, for the message
494
+ * @param value - what the consumer gave
495
+ * @param least - the smallest value that makes sense
496
+ * @param fallback - what to use when the value does not
497
+ * @returns a whole number of at least `least`
498
+ */
499
+ countable(prop, value, least, fallback) {
500
+ if (Number.isSafeInteger(value) && value >= least) {
501
+ this.warnedAbout.delete(prop);
502
+ return value;
503
+ }
504
+ this.warnOnce(prop, value, () => `\`${prop}\` must be a whole number of at least ${least}, but was ${value}. Using ${fallback}.`);
505
+ return fallback;
506
+ }
507
+ /**
508
+ * Caps only the top; callers have already raised the page to at least one.
509
+ *
510
+ * @param page - the page to cap
511
+ * @param pageCount
512
+ * @returns the page, or the last one if it is beyond the end
513
+ */
514
+ capToLastPage(page, pageCount) {
515
+ return pageCount === null ? page : Math.min(page, pageCount);
516
+ }
517
+ /**
518
+ * Keyed on the prop and the value, so repeated renders stay quiet while a
519
+ * new fault still gets said — including the same fault returning after the
520
+ * prop has been usable in between. The message is built only when it is
521
+ * going to be read: these run several times per render.
522
+ *
523
+ * @param prop - the prop being complained about
524
+ * @param value - what it held
525
+ * @param message - what is wrong and what was done instead
526
+ */
527
+ warnOnce(prop, value, message) {
528
+ if (this.warnedAbout.has(prop) &&
529
+ Object.is(this.warnedAbout.get(prop), value)) {
530
+ return;
531
+ }
532
+ this.warnedAbout.set(prop, value);
533
+ console.warn(`limel-pagination: ${message()}`);
534
+ }
535
+ pageLabel(page, isCurrent) {
536
+ const key = isCurrent
537
+ ? 'pagination.current-page'
538
+ : 'pagination.go-to-page';
539
+ return this.translate(key, { page: this.formatNumber(page) });
540
+ }
541
+ /**
542
+ * `21–40 of 248` for a given page. The last page is usually short, so the
543
+ * upper bound is capped at the number of items that actually exist.
544
+ *
545
+ * @param page - the page to describe, 1-based
546
+ * @returns the translated range
547
+ */
548
+ rangeLabel(page) {
549
+ const { totalItems: total, pageSize } = this.view;
550
+ if (total === null) {
551
+ return '';
552
+ }
553
+ const from = (page - FIRST_PAGE) * pageSize + 1;
554
+ const to = page * pageSize;
555
+ return this.translate('pagination.items-range', {
556
+ from: this.formatNumber(from),
557
+ to: this.formatNumber(Math.min(to, total)),
558
+ total: this.formatNumber(total),
559
+ });
560
+ }
561
+ slotId(index) {
562
+ return `${this.idPrefix}-slot-${index}`;
563
+ }
564
+ arrowId(direction) {
565
+ return `${this.idPrefix}-${direction}`;
566
+ }
567
+ /**
568
+ * The formatter is built once and kept until `language` changes: a page and
569
+ * its tooltip need six formatted numbers between them.
570
+ *
571
+ * @param value - the number to write out
572
+ * @returns the number in the current language
573
+ */
574
+ formatNumber(value) {
575
+ var _a;
576
+ (_a = this.numberFormat) !== null && _a !== void 0 ? _a : (this.numberFormat = this.createNumberFormat());
577
+ return this.numberFormat.format(value);
578
+ }
579
+ /**
580
+ * `Intl.NumberFormat` throws on a language it cannot parse, and this is
581
+ * called from `render`, so an unusable one would leave the control drawing
582
+ * nothing at all — the single state a user cannot click their way out of.
583
+ * `src/util/language.ts` states the rule this keeps.
584
+ *
585
+ * A tag it cannot parse throws; a well-formed tag it does not support, like
586
+ * `zz`, does not — it quietly resolves to whatever locale the machine runs
587
+ * in. Both end up formatting numbers in something other than what was
588
+ * asked for, so both are worth saying out loud.
589
+ *
590
+ * @returns a formatter, in the given language where that is possible
591
+ */
592
+ createNumberFormat() {
593
+ const { language: language$1 } = this;
594
+ try {
595
+ const format = new Intl.NumberFormat(language$1);
596
+ const resolved = format.resolvedOptions().locale;
597
+ if (language.getPrimarySubtag(resolved) === language.getPrimarySubtag(language$1)) {
598
+ this.warnedAbout.delete('language');
599
+ return format;
600
+ }
601
+ }
602
+ catch (_a) {
603
+ // Fall through to the warning below.
604
+ }
605
+ this.warnOnce('language', language$1, () => `\`language\` must be one this browser can write numbers in, but was ${JSON.stringify(language$1)}. Using ${FALLBACK_LANGUAGE}.`);
606
+ // Where the translations land for the same unusable value, rather than
607
+ // the viewer's own locale — English labels beside system digit
608
+ // grouping would read differently on every machine.
609
+ return new Intl.NumberFormat(FALLBACK_LANGUAGE);
610
+ }
611
+ static get watchers() { return {
612
+ "language": [{
613
+ "handleLanguageChange": 0
614
+ }]
615
+ }; }
616
+ };
617
+ Pagination.style = paginationCss();
618
+
619
+ exports.limel_pagination = Pagination;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-DYg_7kkT.js');
4
- var translations = require('./translations-ZgjCRtut.js');
3
+ var index = require('./index--B6-r0uo.js');
4
+ var translations = require('./translations-C5T2-_rH.js');
5
5
  var dom = require('./dom-BWMDM6En.js');
6
6
  var keycodes = require('./keycodes-k-EdzcMX.js');
7
7
  var randomString = require('./random-string-BTzDB2ee.js');
@@ -21,9 +21,9 @@ const DEFAULT_SEARCHER_MAX_RESULTS = 20;
21
21
  const Picker = class {
22
22
  constructor(hostRef) {
23
23
  index.registerInstance(this, hostRef);
24
- this.change = index.createEvent(this, "change");
25
- this.interact = index.createEvent(this, "interact");
26
- this.action = index.createEvent(this, "action");
24
+ this.change = index.createEvent(this, "change", 7);
25
+ this.interact = index.createEvent(this, "interact", 7);
26
+ this.action = index.createEvent(this, "action", 7);
27
27
  /**
28
28
  * True if the picker should be disabled
29
29
  */
@@ -197,7 +197,7 @@ const Picker = class {
197
197
  props.maxItems = 1;
198
198
  }
199
199
  return [
200
- index.h("limel-chip-set", Object.assign({ key: '281a5f2451505c012b72c04610d897cf22717420', type: "input", inputType: "search", label: this.label, helperText: this.helperText, leadingIcon: this.leadingIcon, value: this.chips, disabled: this.disabled, invalid: this.invalid, delimiter: this.renderDelimiter(), readonly: this.readonly, required: this.required, searchLabel: this.searchLabel, language: this.language, onInput: this.handleTextInput, onKeyDown: this.handleInputKeyDown, onChange: this.handleChange, onInteract: this.handleInteract, onStartEdit: this.handleInputFieldFocus, onStopEdit: this.handleStopEditAndBlur, emptyInputOnBlur: false, emptyInputOnChange: false, clearAllButton: this.multiple && !this.chipSetEditMode }, props)),
200
+ index.h("limel-chip-set", Object.assign({ key: '3596e789685aa295baf079c38f4cc4cab0fa3317', type: "input", inputType: "search", label: this.label, helperText: this.helperText, leadingIcon: this.leadingIcon, value: this.chips, disabled: this.disabled, invalid: this.invalid, delimiter: this.renderDelimiter(), readonly: this.readonly, required: this.required, searchLabel: this.searchLabel, language: this.language, onInput: this.handleTextInput, onKeyDown: this.handleInputKeyDown, onChange: this.handleChange, onInteract: this.handleInteract, onStartEdit: this.handleInputFieldFocus, onStopEdit: this.handleStopEditAndBlur, emptyInputOnBlur: false, emptyInputOnChange: false, clearAllButton: this.multiple && !this.chipSetEditMode }, props)),
201
201
  this.renderDropdown(),
202
202
  ];
203
203
  }