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