@limetech/lime-elements 40.18.3 → 40.20.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 (352) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/cjs/controlled-element-Ajn5eA-q.js +26 -0
  3. package/dist/cjs/{index-zZvs6xK-.js → index-DIiA99Er.js} +271 -71
  4. package/dist/cjs/keyboard-navigation-VyqkMDKy.js +152 -0
  5. package/dist/cjs/lime-elements.cjs.js +1 -1
  6. package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +1 -1
  7. package/dist/cjs/limel-action-bar_3.cjs.entry.js +4 -4
  8. package/dist/cjs/limel-ai-avatar.cjs.entry.js +2 -2
  9. package/dist/cjs/{limel-breadcrumbs_6.cjs.entry.js → limel-badge_7.cjs.entry.js} +98 -12
  10. package/dist/cjs/limel-banner.cjs.entry.js +1 -1
  11. package/dist/cjs/limel-button-group.cjs.entry.js +1 -1
  12. package/dist/cjs/limel-button.cjs.entry.js +2 -2
  13. package/dist/cjs/limel-callout.cjs.entry.js +2 -2
  14. package/dist/cjs/limel-card.cjs.entry.js +1 -1
  15. package/dist/cjs/limel-chart.cjs.entry.js +51362 -270
  16. package/dist/cjs/limel-checkbox.cjs.entry.js +1 -1
  17. package/dist/cjs/limel-chip-set.cjs.entry.js +23 -4
  18. package/dist/cjs/limel-chip_2.cjs.entry.js +2 -2
  19. package/dist/cjs/limel-circular-progress.cjs.entry.js +1 -1
  20. package/dist/cjs/limel-code-diff.cjs.entry.js +2 -2
  21. package/dist/cjs/limel-code-editor.cjs.entry.js +2 -2
  22. package/dist/cjs/limel-collapsible-section.cjs.entry.js +2 -2
  23. package/dist/cjs/limel-color-picker-palette.cjs.entry.js +2 -2
  24. package/dist/cjs/limel-color-picker.cjs.entry.js +1 -1
  25. package/dist/cjs/limel-dialog.cjs.entry.js +2 -2
  26. package/dist/cjs/limel-dock.cjs.entry.js +3 -3
  27. package/dist/cjs/limel-drag-handle_2.cjs.entry.js +4 -4
  28. package/dist/cjs/limel-email-viewer.cjs.entry.js +2 -2
  29. package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +2 -2
  30. package/dist/cjs/limel-file-viewer.cjs.entry.js +2 -2
  31. package/dist/cjs/limel-file.cjs.entry.js +2 -2
  32. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +2 -2
  33. package/dist/cjs/limel-flex-container.cjs.entry.js +1 -1
  34. package/dist/cjs/limel-form-header.cjs.entry.js +1 -1
  35. package/dist/cjs/limel-form.cjs.entry.js +1 -1
  36. package/dist/cjs/limel-grid.cjs.entry.js +1 -1
  37. package/dist/cjs/limel-header.cjs.entry.js +1 -1
  38. package/dist/cjs/limel-help_2.cjs.entry.js +3 -3
  39. package/dist/cjs/limel-helper-line_3.cjs.entry.js +6 -5
  40. package/dist/cjs/limel-hotkey_4.cjs.entry.js +5 -5
  41. package/dist/cjs/limel-icon-button.cjs.entry.js +1 -1
  42. package/dist/cjs/limel-icon.cjs.entry.js +1 -1
  43. package/dist/cjs/limel-info-tile.cjs.entry.js +2 -2
  44. package/dist/cjs/limel-list-item.cjs.entry.js +3 -3
  45. package/dist/cjs/limel-markdown.cjs.entry.js +4 -4
  46. package/dist/cjs/limel-masonry-layout.cjs.entry.js +1 -1
  47. package/dist/cjs/limel-menu-item-meta.cjs.entry.js +1 -1
  48. package/dist/cjs/limel-pagination-jump.cjs.entry.js +1 -1
  49. package/dist/cjs/limel-pagination.cjs.entry.js +2 -2
  50. package/dist/cjs/limel-picker.cjs.entry.js +51 -24
  51. package/dist/cjs/limel-popover_2.cjs.entry.js +4 -11
  52. package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -1
  53. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +4 -4
  54. package/dist/cjs/limel-radio-button-group.cjs.entry.js +1 -1
  55. package/dist/cjs/limel-radio-button.cjs.entry.js +2 -2
  56. package/dist/cjs/limel-resize-handle.cjs.entry.js +2 -2
  57. package/dist/cjs/limel-select.cjs.entry.js +1 -1
  58. package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
  59. package/dist/cjs/limel-side-panel.cjs.entry.js +2 -2
  60. package/dist/cjs/limel-slider.cjs.entry.js +4 -4
  61. package/dist/cjs/limel-snackbar.cjs.entry.js +3 -3
  62. package/dist/cjs/limel-split-button.cjs.entry.js +2 -2
  63. package/dist/cjs/limel-switch.cjs.entry.js +1 -1
  64. package/dist/cjs/limel-tab-bar.cjs.entry.js +7 -150
  65. package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
  66. package/dist/cjs/limel-table.cjs.entry.js +3 -3
  67. package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +4 -4
  68. package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
  69. package/dist/cjs/live-message-BNl3Ihcz.js +65 -0
  70. package/dist/cjs/loader.cjs.js +1 -1
  71. package/dist/cjs/{markdown-exporter-VtX_2D1d.js → markdown-exporter-BWS2EBxq.js} +2 -2
  72. package/dist/cjs/{markdown-parser-BYtTHL4W.js → markdown-parser-toAp9-Eq.js} +1 -1
  73. package/dist/cjs/{translations-CLSqfR3x.js → translations-CqJEWcfw.js} +8 -0
  74. package/dist/collection/components/3d-hover-effect-glow/3d-hover-effect-glow.js +1 -1
  75. package/dist/collection/components/action-bar/action-bar-item/action-bar-overflow-menu.js +1 -1
  76. package/dist/collection/components/action-bar/action-bar.js +2 -2
  77. package/dist/collection/components/ai-avatar/ai-avatar.js +1 -1
  78. package/dist/collection/components/badge/badge.js +2 -2
  79. package/dist/collection/components/banner/banner.js +1 -1
  80. package/dist/collection/components/breadcrumbs/breadcrumbs.js +1 -1
  81. package/dist/collection/components/button/button.js +2 -2
  82. package/dist/collection/components/button-group/button-group.js +1 -1
  83. package/dist/collection/components/callout/callout.js +1 -1
  84. package/dist/collection/components/card/card.js +1 -1
  85. package/dist/collection/components/chart/chart.css +63 -927
  86. package/dist/collection/components/chart/chart.js +330 -288
  87. package/dist/collection/components/chart/options.js +572 -0
  88. package/dist/collection/components/chart/scale.js +193 -0
  89. package/dist/collection/components/chart/theme.js +133 -0
  90. package/dist/collection/components/checkbox/checkbox.js +1 -1
  91. package/dist/collection/components/chip/chip.js +1 -1
  92. package/dist/collection/components/chip-set/chip-set.js +66 -3
  93. package/dist/collection/components/circular-progress/circular-progress.js +1 -1
  94. package/dist/collection/components/code-diff/code-diff.js +1 -1
  95. package/dist/collection/components/code-editor/code-editor.js +1 -1
  96. package/dist/collection/components/collapsible-section/collapsible-section.js +1 -1
  97. package/dist/collection/components/color-picker/color-picker-palette.js +2 -2
  98. package/dist/collection/components/color-picker/color-picker.js +1 -1
  99. package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +1 -1
  100. package/dist/collection/components/dialog/dialog.js +2 -2
  101. package/dist/collection/components/dock/dock.js +2 -2
  102. package/dist/collection/components/drag-handle/drag-handle.js +1 -1
  103. package/dist/collection/components/email-viewer/email-viewer.js +1 -1
  104. package/dist/collection/components/file/file.js +1 -1
  105. package/dist/collection/components/file-dropzone/file-dropzone.js +1 -1
  106. package/dist/collection/components/file-input/file-input.js +1 -1
  107. package/dist/collection/components/flex-container/flex-container.js +1 -1
  108. package/dist/collection/components/form/form.js +1 -1
  109. package/dist/collection/components/form-header/form-header.js +1 -1
  110. package/dist/collection/components/grid/grid.js +1 -1
  111. package/dist/collection/components/header/header.js +1 -1
  112. package/dist/collection/components/help/help-content.js +1 -1
  113. package/dist/collection/components/help/help.js +2 -2
  114. package/dist/collection/components/helper-line/helper-line.js +2 -2
  115. package/dist/collection/components/hotkey/hotkey.js +1 -1
  116. package/dist/collection/components/icon/icon.js +1 -1
  117. package/dist/collection/components/icon-button/icon-button.js +1 -1
  118. package/dist/collection/components/info-tile/info-tile.js +2 -2
  119. package/dist/collection/components/input-field/input-field.css +13 -0
  120. package/dist/collection/components/input-field/input-field.js +86 -5
  121. package/dist/collection/components/list/list-renderer.js +1 -1
  122. package/dist/collection/components/list/list.js +22 -1
  123. package/dist/collection/components/list-item/list-item.js +2 -2
  124. package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.js +1 -1
  125. package/dist/collection/components/markdown/markdown.js +1 -1
  126. package/dist/collection/components/masonry-layout/masonry-layout.js +1 -1
  127. package/dist/collection/components/menu/menu.js +1 -1
  128. package/dist/collection/components/menu-list/menu-list.js +1 -1
  129. package/dist/collection/components/menu-surface/menu-surface.js +1 -1
  130. package/dist/collection/components/notched-outline/notched-outline.js +1 -1
  131. package/dist/collection/components/pagination/pagination.js +1 -1
  132. package/dist/collection/components/picker/picker.css +112 -0
  133. package/dist/collection/components/picker/picker.js +49 -20
  134. package/dist/collection/components/popover/popover.js +3 -10
  135. package/dist/collection/components/popover-surface/popover-surface.js +1 -1
  136. package/dist/collection/components/portal/portal.js +1 -1
  137. package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
  138. package/dist/collection/components/radio-button-group/radio-button.js +2 -2
  139. package/dist/collection/components/resize-handle/resize-handle.js +1 -1
  140. package/dist/collection/components/scroller/scroller.js +3 -3
  141. package/dist/collection/components/select/select.js +1 -1
  142. package/dist/collection/components/shortcut/shortcut.js +1 -1
  143. package/dist/collection/components/side-panel/side-panel.js +1 -1
  144. package/dist/collection/components/slider/slider.js +3 -3
  145. package/dist/collection/components/snackbar/snackbar.js +2 -2
  146. package/dist/collection/components/spinner/spinner.js +1 -1
  147. package/dist/collection/components/split-button/split-button.js +2 -2
  148. package/dist/collection/components/switch/switch.js +1 -1
  149. package/dist/collection/components/tab-bar/tab-bar.js +1 -1
  150. package/dist/collection/components/tab-panel/tab-panel.js +1 -1
  151. package/dist/collection/components/table/table.js +2 -2
  152. package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +3 -3
  153. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +1 -1
  154. package/dist/collection/components/text-editor/text-editor.js +1 -1
  155. package/dist/collection/components/tooltip/tooltip-content.js +1 -1
  156. package/dist/collection/components/tooltip/tooltip.js +2 -2
  157. package/dist/collection/translations/da.js +1 -0
  158. package/dist/collection/translations/de.js +1 -0
  159. package/dist/collection/translations/en.js +1 -0
  160. package/dist/collection/translations/fi.js +1 -0
  161. package/dist/collection/translations/fr.js +1 -0
  162. package/dist/collection/translations/nl.js +1 -0
  163. package/dist/collection/translations/no.js +1 -0
  164. package/dist/collection/translations/sv.js +1 -0
  165. package/dist/collection/util/controlled-element.js +22 -0
  166. package/dist/collection/util/live-message.js +30 -0
  167. package/dist/esm/controlled-element-ByOXsysp.js +24 -0
  168. package/dist/esm/{index-BN64nlbO.js → index-CofmbCdQ.js} +271 -71
  169. package/dist/esm/keyboard-navigation-BF7IKmnG.js +147 -0
  170. package/dist/esm/{keycodes-Bu6-QXrA.js → keycodes-DQ5DmW_Y.js} +1 -1
  171. package/dist/esm/lime-elements.js +1 -1
  172. package/dist/esm/limel-3d-hover-effect-glow.entry.js +1 -1
  173. package/dist/esm/limel-action-bar_3.entry.js +4 -4
  174. package/dist/esm/limel-ai-avatar.entry.js +2 -2
  175. package/dist/esm/{limel-breadcrumbs_6.entry.js → limel-badge_7.entry.js} +100 -15
  176. package/dist/esm/limel-banner.entry.js +1 -1
  177. package/dist/esm/limel-button-group.entry.js +1 -1
  178. package/dist/esm/limel-button.entry.js +2 -2
  179. package/dist/esm/limel-callout.entry.js +2 -2
  180. package/dist/esm/limel-card.entry.js +1 -1
  181. package/dist/esm/limel-chart.entry.js +51363 -271
  182. package/dist/esm/limel-checkbox.entry.js +1 -1
  183. package/dist/esm/limel-chip-set.entry.js +24 -5
  184. package/dist/esm/limel-chip_2.entry.js +3 -3
  185. package/dist/esm/limel-circular-progress.entry.js +1 -1
  186. package/dist/esm/limel-code-diff.entry.js +2 -2
  187. package/dist/esm/limel-code-editor.entry.js +2 -2
  188. package/dist/esm/limel-collapsible-section.entry.js +2 -2
  189. package/dist/esm/limel-color-picker-palette.entry.js +2 -2
  190. package/dist/esm/limel-color-picker.entry.js +1 -1
  191. package/dist/esm/limel-dialog.entry.js +2 -2
  192. package/dist/esm/limel-dock.entry.js +3 -3
  193. package/dist/esm/limel-drag-handle_2.entry.js +4 -4
  194. package/dist/esm/limel-email-viewer.entry.js +2 -2
  195. package/dist/esm/limel-file-dropzone_2.entry.js +2 -2
  196. package/dist/esm/limel-file-viewer.entry.js +2 -2
  197. package/dist/esm/limel-file.entry.js +2 -2
  198. package/dist/esm/limel-flatpickr-adapter.entry.js +2 -2
  199. package/dist/esm/limel-flex-container.entry.js +1 -1
  200. package/dist/esm/limel-form-header.entry.js +1 -1
  201. package/dist/esm/limel-form.entry.js +1 -1
  202. package/dist/esm/limel-grid.entry.js +1 -1
  203. package/dist/esm/limel-header.entry.js +1 -1
  204. package/dist/esm/limel-help_2.entry.js +3 -3
  205. package/dist/esm/limel-helper-line_3.entry.js +6 -5
  206. package/dist/esm/limel-hotkey_4.entry.js +5 -5
  207. package/dist/esm/limel-icon-button.entry.js +1 -1
  208. package/dist/esm/limel-icon.entry.js +1 -1
  209. package/dist/esm/limel-info-tile.entry.js +2 -2
  210. package/dist/esm/limel-list-item.entry.js +3 -3
  211. package/dist/esm/limel-markdown.entry.js +4 -4
  212. package/dist/esm/limel-masonry-layout.entry.js +1 -1
  213. package/dist/esm/limel-menu-item-meta.entry.js +1 -1
  214. package/dist/esm/limel-pagination-jump.entry.js +2 -2
  215. package/dist/esm/limel-pagination.entry.js +2 -2
  216. package/dist/esm/limel-picker.entry.js +52 -25
  217. package/dist/esm/limel-popover_2.entry.js +5 -12
  218. package/dist/esm/limel-profile-picture.entry.js +1 -1
  219. package/dist/esm/limel-prosemirror-adapter.entry.js +4 -4
  220. package/dist/esm/limel-radio-button-group.entry.js +1 -1
  221. package/dist/esm/limel-radio-button.entry.js +2 -2
  222. package/dist/esm/limel-resize-handle.entry.js +3 -3
  223. package/dist/esm/limel-select.entry.js +3 -3
  224. package/dist/esm/limel-shortcut.entry.js +1 -1
  225. package/dist/esm/limel-side-panel.entry.js +3 -3
  226. package/dist/esm/limel-slider.entry.js +4 -4
  227. package/dist/esm/limel-snackbar.entry.js +3 -3
  228. package/dist/esm/limel-split-button.entry.js +2 -2
  229. package/dist/esm/limel-switch.entry.js +1 -1
  230. package/dist/esm/limel-tab-bar.entry.js +3 -146
  231. package/dist/esm/limel-tab-panel.entry.js +1 -1
  232. package/dist/esm/limel-table.entry.js +3 -3
  233. package/dist/esm/limel-text-editor-link-menu.entry.js +5 -5
  234. package/dist/esm/limel-text-editor.entry.js +1 -1
  235. package/dist/esm/live-message-BQAYeNiX.js +62 -0
  236. package/dist/esm/loader.js +1 -1
  237. package/dist/esm/{markdown-exporter-tb8ft8Gq.js → markdown-exporter-B2vFxSLw.js} +2 -2
  238. package/dist/esm/{markdown-parser-DFP65EFu.js → markdown-parser-Cw8iW5R9.js} +1 -1
  239. package/dist/esm/{translations-Drl5LNAD.js → translations-kct5Kybu.js} +8 -0
  240. package/dist/esm/{typeahead-DOlnT3wh.js → typeahead-B4PwrlM3.js} +1 -1
  241. package/dist/lime-elements/lime-elements.esm.js +1 -1
  242. package/dist/lime-elements/{p-a608ebe3.entry.js → p-0319f07f.entry.js} +1 -1
  243. package/dist/lime-elements/{p-300f80e7.entry.js → p-07f3565b.entry.js} +1 -1
  244. package/dist/lime-elements/{p-a7a84633.entry.js → p-1a7d1d2b.entry.js} +1 -1
  245. package/dist/lime-elements/{p-f8566c5b.entry.js → p-1d9bc526.entry.js} +1 -1
  246. package/dist/lime-elements/{p-e0ab0046.entry.js → p-1e0ced6a.entry.js} +1 -1
  247. package/dist/lime-elements/{p-dd383c12.entry.js → p-22e9e327.entry.js} +1 -1
  248. package/dist/lime-elements/{p-65eafc85.entry.js → p-23067836.entry.js} +1 -1
  249. package/dist/lime-elements/{p-5f2a34ed.entry.js → p-28957b5c.entry.js} +1 -1
  250. package/dist/lime-elements/{p-3ae5fb67.entry.js → p-39d1e157.entry.js} +1 -1
  251. package/dist/lime-elements/{p-d0908a85.entry.js → p-3ac39bd5.entry.js} +2 -2
  252. package/dist/lime-elements/{p-7f1a1ed5.entry.js → p-3f7fa772.entry.js} +1 -1
  253. package/dist/lime-elements/{p-b80433be.entry.js → p-40940a6c.entry.js} +1 -1
  254. package/dist/lime-elements/{p-7235d147.entry.js → p-438fe49b.entry.js} +1 -1
  255. package/dist/lime-elements/{p-0c314c3c.entry.js → p-47fe76a8.entry.js} +1 -1
  256. package/dist/lime-elements/{p-22c44279.entry.js → p-48a412ed.entry.js} +1 -1
  257. package/dist/lime-elements/{p-eb5a18ff.entry.js → p-496b2437.entry.js} +1 -1
  258. package/dist/lime-elements/{p-5d9a2877.entry.js → p-4c080cd9.entry.js} +1 -1
  259. package/dist/lime-elements/{p-be0a8125.entry.js → p-54537c85.entry.js} +1 -1
  260. package/dist/lime-elements/{p-2c29c27f.entry.js → p-55fa19ae.entry.js} +1 -1
  261. package/dist/lime-elements/{p-fad7a3fa.entry.js → p-56e2fa48.entry.js} +1 -1
  262. package/dist/lime-elements/{p-da4b4a81.entry.js → p-5dce791c.entry.js} +1 -1
  263. package/dist/lime-elements/{p-67acf39d.entry.js → p-5e408c27.entry.js} +1 -1
  264. package/dist/lime-elements/{p-b983531f.entry.js → p-6053608a.entry.js} +1 -1
  265. package/dist/lime-elements/{p-164e1ad0.entry.js → p-6ae093c8.entry.js} +1 -1
  266. package/dist/lime-elements/{p-29815107.entry.js → p-6d2d25b9.entry.js} +1 -1
  267. package/dist/lime-elements/{p-9e30d206.entry.js → p-6d9b89db.entry.js} +1 -1
  268. package/dist/lime-elements/{p-be2b8c1e.entry.js → p-6e9eeb0a.entry.js} +1 -1
  269. package/dist/lime-elements/{p-68129487.entry.js → p-764d2f86.entry.js} +1 -1
  270. package/dist/lime-elements/{p-49a53f0b.entry.js → p-7ab726c2.entry.js} +1 -1
  271. package/dist/lime-elements/{p-cced022b.entry.js → p-7b87e547.entry.js} +1 -1
  272. package/dist/lime-elements/{p-586ee40c.entry.js → p-7d0ffc60.entry.js} +1 -1
  273. package/dist/lime-elements/p-7fcd48c6.entry.js +1 -0
  274. package/dist/lime-elements/{p-7d27d572.entry.js → p-814b4934.entry.js} +1 -1
  275. package/dist/lime-elements/p-8514480b.entry.js +56 -0
  276. package/dist/lime-elements/p-8d602078.entry.js +1 -0
  277. package/dist/lime-elements/p-8fe28845.entry.js +1 -0
  278. package/dist/lime-elements/{p-f35880ef.entry.js → p-909466b8.entry.js} +1 -1
  279. package/dist/lime-elements/{p-545c087b.entry.js → p-933ffaa8.entry.js} +1 -1
  280. package/dist/lime-elements/{p-cc8d6198.entry.js → p-95a486c8.entry.js} +1 -1
  281. package/dist/lime-elements/{p-565c85ac.entry.js → p-9b2623fe.entry.js} +1 -1
  282. package/dist/lime-elements/{p-C0wwdPYT.js → p-Bd37Vplf.js} +2 -2
  283. package/dist/lime-elements/p-ByOXsysp.js +1 -0
  284. package/dist/lime-elements/{p-_UXAljNc.js → p-CbPYnlF-.js} +1 -1
  285. package/dist/lime-elements/{p-Bgn2bikC.js → p-CvHpvp0f.js} +1 -1
  286. package/dist/lime-elements/p-Cw7VQSGU.js +1 -0
  287. package/dist/lime-elements/{p-fYs7n6yY.js → p-DNYOwOWu.js} +1 -1
  288. package/dist/lime-elements/{p-Bu6-QXrA.js → p-DQ5DmW_Y.js} +1 -1
  289. package/dist/lime-elements/p-Dzp8dXTo.js +1 -0
  290. package/dist/lime-elements/p-_1yBt1pG.js +1 -0
  291. package/dist/lime-elements/{p-565e5ea7.entry.js → p-a6387dc7.entry.js} +1 -1
  292. package/dist/lime-elements/{p-40a48f70.entry.js → p-a6c6a31b.entry.js} +1 -1
  293. package/dist/lime-elements/{p-e8255f0b.entry.js → p-a7be03e1.entry.js} +1 -1
  294. package/dist/lime-elements/p-a807a45f.entry.js +159 -0
  295. package/dist/lime-elements/{p-707d4b28.entry.js → p-bffb5ed2.entry.js} +1 -1
  296. package/dist/lime-elements/{p-7035d93d.entry.js → p-c0ebf7cc.entry.js} +1 -1
  297. package/dist/lime-elements/{p-7aae3d13.entry.js → p-c2056ebc.entry.js} +1 -1
  298. package/dist/lime-elements/{p-19681a98.entry.js → p-c2f993cc.entry.js} +1 -1
  299. package/dist/lime-elements/{p-c73f4160.entry.js → p-c61e9b83.entry.js} +1 -1
  300. package/dist/lime-elements/{p-519603f5.entry.js → p-c6b3448c.entry.js} +1 -1
  301. package/dist/lime-elements/p-c8a34cef.entry.js +1 -0
  302. package/dist/lime-elements/p-cd479c23.entry.js +1 -0
  303. package/dist/lime-elements/{p-153e91e1.entry.js → p-ce71c5b9.entry.js} +1 -1
  304. package/dist/lime-elements/p-cf2d43c7.entry.js +1 -0
  305. package/dist/lime-elements/{p-2a375a65.entry.js → p-d35d2859.entry.js} +1 -1
  306. package/dist/lime-elements/{p-26347009.entry.js → p-d3f13124.entry.js} +1 -1
  307. package/dist/lime-elements/{p-a2dc6645.entry.js → p-d8559847.entry.js} +1 -1
  308. package/dist/lime-elements/{p-c8f09dd5.entry.js → p-db9cb7ef.entry.js} +1 -1
  309. package/dist/lime-elements/{p-05c1f5a0.entry.js → p-e5abe390.entry.js} +1 -1
  310. package/dist/lime-elements/p-f036ad27.entry.js +1 -0
  311. package/dist/lime-elements/{p-c1678d3a.entry.js → p-f3b93ce8.entry.js} +2 -2
  312. package/dist/lime-elements/{p-2f5face5.entry.js → p-f59447bf.entry.js} +1 -1
  313. package/dist/lime-elements/{p-a81f6962.entry.js → p-f5bb17eb.entry.js} +1 -1
  314. package/dist/types/components/chart/chart.d.ts +51 -52
  315. package/dist/types/components/chart/chart.types.d.ts +5 -0
  316. package/dist/types/components/chart/options.d.ts +88 -0
  317. package/dist/types/components/chart/scale.d.ts +101 -0
  318. package/dist/types/components/chart/theme.d.ts +52 -0
  319. package/dist/types/components/chip-set/chip-set.d.ts +15 -0
  320. package/dist/types/components/input-field/input-field.d.ts +13 -0
  321. package/dist/types/components/list/list-renderer-config.d.ts +1 -0
  322. package/dist/types/components/list/list.d.ts +6 -0
  323. package/dist/types/components/picker/picker.d.ts +12 -5
  324. package/dist/types/components/popover/popover.d.ts +0 -1
  325. package/dist/types/components.d.ts +53 -38
  326. package/dist/types/translations/da.d.ts +1 -0
  327. package/dist/types/translations/de.d.ts +1 -0
  328. package/dist/types/translations/en.d.ts +1 -0
  329. package/dist/types/translations/fi.d.ts +1 -0
  330. package/dist/types/translations/fr.d.ts +1 -0
  331. package/dist/types/translations/nl.d.ts +1 -0
  332. package/dist/types/translations/no.d.ts +1 -0
  333. package/dist/types/translations/sv.d.ts +1 -0
  334. package/dist/types/util/controlled-element.d.ts +11 -0
  335. package/dist/types/util/live-message.d.ts +17 -0
  336. package/package.json +3 -2
  337. package/dist/cjs/dom-BWMDM6En.js +0 -32
  338. package/dist/cjs/limel-badge.cjs.entry.js +0 -37
  339. package/dist/esm/dom-B9Ofc5RB.js +0 -30
  340. package/dist/esm/limel-badge.entry.js +0 -35
  341. package/dist/lime-elements/p-513d2a5e.entry.js +0 -1
  342. package/dist/lime-elements/p-55abec82.entry.js +0 -1
  343. package/dist/lime-elements/p-55f7c9f5.entry.js +0 -1
  344. package/dist/lime-elements/p-70272ea2.entry.js +0 -1
  345. package/dist/lime-elements/p-813cb15c.entry.js +0 -1
  346. package/dist/lime-elements/p-895a68c5.entry.js +0 -1
  347. package/dist/lime-elements/p-93a2d3b3.entry.js +0 -159
  348. package/dist/lime-elements/p-9bbf2612.entry.js +0 -1
  349. package/dist/lime-elements/p-B26k4gw8.js +0 -1
  350. package/dist/lime-elements/p-B9Ofc5RB.js +0 -1
  351. package/dist/lime-elements/p-ea11f365.entry.js +0 -1
  352. package/dist/lime-elements/p-fdc7da58.entry.js +0 -1
@@ -1,18 +1,25 @@
1
- import { h } from "@stencil/core";
1
+ import { h, Host, } from "@stencil/core";
2
+ import { BarChart, GaugeChart, LineChart, PieChart, ScatterChart, } from "echarts/charts";
3
+ import { GridComponent, PolarComponent, TooltipComponent, } from "echarts/components";
4
+ import { init, use } from "echarts/core";
5
+ import { SVGRenderer } from "echarts/renderers";
2
6
  import translate from "../../global/translations";
3
- import { createRandomString } from "../../util/random-string";
4
- const PERCENT = 100;
5
- const DEFAULT_INCREMENT_SIZE = 10;
6
- /**
7
- * Types whose items are parts of one whole. They draw no axis, and an item's
8
- * value or range extent is its share of `maxValue`, or of the combined items.
9
- */
10
- const WHOLE_TYPES = new Set([
11
- 'stacked-bar',
12
- 'pie',
13
- 'doughnut',
14
- 'ring',
15
- ]);
7
+ import { findNavigationTarget, findTabStop, isNavigationKey, NO_NAVIGATION_TARGET, } from "../../util/keyboard-navigation";
8
+ import { drawChart, fitItemTexts, getItemIndex, getItemLabel, locateItem, } from "./options";
9
+ import { formatValue, getAxisRange, MAX_AXIS_STEPS, usesAxisIncrement, } from "./scale";
10
+ import { createThemeReader, watchTheme, } from "./theme";
11
+ const orientations = ['horizontal', 'vertical'];
12
+ const extensions = [
13
+ BarChart,
14
+ GaugeChart,
15
+ LineChart,
16
+ PieChart,
17
+ ScatterChart,
18
+ GridComponent,
19
+ PolarComponent,
20
+ TooltipComponent,
21
+ SVGRenderer,
22
+ ];
16
23
  /**
17
24
  * A chart is a graphical representation of data, in which
18
25
  * visual symbols such as such bars, dots, lines, or slices, represent
@@ -41,7 +48,6 @@ const WHOLE_TYPES = new Set([
41
48
  * @exampleComponent limel-example-chart-accessibility
42
49
  * @exampleComponent limel-example-chart-axis-labels
43
50
  * @exampleComponent limel-example-chart-styling
44
- * @exampleComponent limel-example-chart-creative-styling
45
51
  * @beta
46
52
  */
47
53
  export class Chart {
@@ -90,8 +96,42 @@ export class Chart {
90
96
  * Indicates whether the chart is in a loading state.
91
97
  */
92
98
  this.loading = false;
99
+ /**
100
+ * The item that last had focus, which is the one that Tab returns to.
101
+ */
102
+ this.focusedIndex = 0;
103
+ this.themeMayHaveChanged = false;
104
+ this.invalidColors = new Set();
105
+ this.setPlot = (element) => {
106
+ this.plot = element;
107
+ };
108
+ this.handleResize = () => {
109
+ this.draw();
110
+ };
111
+ this.handleThemeChange = () => {
112
+ this.themeMayHaveChanged = true;
113
+ this.draw();
114
+ };
115
+ this.handleChartClick = (event) => {
116
+ var _a, _b;
117
+ if (!this.drawing) {
118
+ return;
119
+ }
120
+ const item = this.getClickableItem(getItemIndex(this.drawing, event));
121
+ if (!item) {
122
+ return;
123
+ }
124
+ (_b = (_a = event.event) === null || _a === void 0 ? void 0 : _a.event) === null || _b === void 0 ? void 0 : _b.stopPropagation();
125
+ this.interact.emit(item);
126
+ };
127
+ this.handleChartOver = (event) => {
128
+ this.highlightItemAt(event, true);
129
+ };
130
+ this.handleChartOut = (event) => {
131
+ this.highlightItemAt(event, false);
132
+ };
93
133
  this.handleClick = (event) => {
94
- const item = this.getClickableItem(event.currentTarget);
134
+ const item = this.getClickableItem(this.getRowIndex(event));
95
135
  if (!item) {
96
136
  return;
97
137
  }
@@ -99,27 +139,79 @@ export class Chart {
99
139
  this.interact.emit(item);
100
140
  };
101
141
  this.handleKeyDown = (event) => {
142
+ const orientation = orientations.find((option) => isNavigationKey(event, { orientation: option }));
143
+ if (orientation) {
144
+ event.preventDefault();
145
+ this.focusItem(findNavigationTarget(this.items, event.key, this.getRowIndex(event), { orientation: orientation }));
146
+ return;
147
+ }
102
148
  if (event.key !== 'Enter' && event.key !== ' ') {
103
149
  return;
104
150
  }
105
- const item = this.getClickableItem(event.currentTarget);
151
+ const item = this.getClickableItem(this.getRowIndex(event));
106
152
  if (!item) {
107
153
  return;
108
154
  }
109
155
  event.preventDefault();
110
156
  this.interact.emit(item);
111
157
  };
158
+ this.handleFocus = (event) => {
159
+ const row = event.currentTarget;
160
+ this.focusedIndex = Number(row.dataset.index);
161
+ this.showItem(row, true);
162
+ };
163
+ this.handleBlur = (event) => {
164
+ this.showItem(event.currentTarget, false);
165
+ };
112
166
  }
113
167
  componentWillLoad() {
114
- this.recalculateRangeData();
168
+ this.warnAboutAxisIncrement();
169
+ }
170
+ connectedCallback() {
171
+ this.draw();
172
+ }
173
+ componentDidRender() {
174
+ this.draw();
175
+ }
176
+ disconnectedCallback() {
177
+ var _a, _b, _c;
178
+ this.disposeChart();
179
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
180
+ this.resizeObserver = undefined;
181
+ (_b = this.stopWatchingTheme) === null || _b === void 0 ? void 0 : _b.call(this);
182
+ this.stopWatchingTheme = undefined;
183
+ (_c = this.themeReader) === null || _c === void 0 ? void 0 : _c.dispose();
184
+ this.themeReader = undefined;
185
+ }
186
+ warnAboutAxisIncrement() {
187
+ const warning = this.getAxisIncrementWarning();
188
+ if (warning && warning !== this.axisIncrementWarning) {
189
+ console.warn(warning);
190
+ }
191
+ this.axisIncrementWarning = warning;
192
+ }
193
+ getAxisIncrementWarning() {
194
+ var _a;
195
+ const increment = this.axisIncrement;
196
+ if (increment === undefined || increment === null) {
197
+ return;
198
+ }
199
+ if (increment <= 0 || Number.isNaN(increment)) {
200
+ return `limel-chart: \`axisIncrement\` must be above 0, but was ${increment}. Working out a step from the values instead.`;
201
+ }
202
+ if (!usesAxisIncrement(this.type)) {
203
+ return;
204
+ }
205
+ const range = getAxisRange((_a = this.items) !== null && _a !== void 0 ? _a : [], this.maxValue, increment);
206
+ if (range.increment !== increment) {
207
+ return `limel-chart: \`axisIncrement\` ${increment} would divide the axis into more than ${MAX_AXIS_STEPS} steps. Working out a step from the values instead.`;
208
+ }
115
209
  }
116
210
  render() {
117
211
  if (this.loading) {
118
212
  return h("limel-spinner", { limeBranded: false });
119
213
  }
120
- return (h("table", { "aria-busy": this.loading ? 'true' : 'false', "aria-live": "polite", style: {
121
- '--limel-chart-number-of-items': this.items.length.toString(),
122
- } }, this.renderCaption(), this.renderTableHeader(), this.renderAxises(), h("tbody", { class: "chart" }, this.renderItems())));
214
+ return (h(Host, null, h("div", { class: "plot", "aria-hidden": "true", ref: this.setPlot }), h("table", { "aria-live": "polite" }, this.renderCaption(), this.renderTableHeader(), h("tbody", null, this.renderItems()))));
123
215
  }
124
216
  renderCaption() {
125
217
  if (!this.accessibleLabel) {
@@ -128,300 +220,237 @@ export class Chart {
128
220
  return h("caption", null, this.accessibleLabel);
129
221
  }
130
222
  renderTableHeader() {
131
- var _a, _b;
132
- return (h("thead", null, h("tr", null, h("th", { scope: "col" }, (_a = this.accessibleItemsLabel) !== null && _a !== void 0 ? _a : translate.get('items', this.language)), h("th", { scope: "col" }, (_b = this.accessibleValuesLabel) !== null && _b !== void 0 ? _b : translate.get('value', this.language)))));
223
+ return (h("thead", null, h("tr", null, h("th", { scope: "col" }, this.itemsLabel), h("th", { scope: "col" }, this.valuesLabel))));
133
224
  }
134
- renderAxises() {
135
- if (!['bar', 'dot', 'area', 'line', 'scatter'].includes(this.type)) {
225
+ get itemsLabel() {
226
+ var _a;
227
+ return ((_a = this.accessibleItemsLabel) !== null && _a !== void 0 ? _a : translate.get('items', this.language));
228
+ }
229
+ get valuesLabel() {
230
+ var _a;
231
+ return ((_a = this.accessibleValuesLabel) !== null && _a !== void 0 ? _a : translate.get('value', this.language));
232
+ }
233
+ renderItems() {
234
+ var _a, _b;
235
+ const tabStop = findTabStop((_a = this.items) !== null && _a !== void 0 ? _a : [], this.focusedIndex);
236
+ return (_b = this.items) === null || _b === void 0 ? void 0 : _b.map((item, index) => (h("tr", { "data-index": index, "aria-description": this.getRowDescription(index), tabIndex: index === tabStop ? 0 : -1, role: item.clickable ? 'button' : null, onClick: this.handleClick, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("td", null, item.text), h("td", null, formatValue(item, this.type)))));
237
+ }
238
+ getRowDescription(index) {
239
+ const label = getItemLabel({
240
+ items: this.items,
241
+ type: this.type,
242
+ maxValue: this.maxValue,
243
+ displayItemPercentage: this.displayItemPercentage,
244
+ }, index);
245
+ return label === this.items[index].text ? undefined : label;
246
+ }
247
+ draw() {
248
+ var _a;
249
+ if (!((_a = this.plot) === null || _a === void 0 ? void 0 : _a.isConnected)) {
250
+ this.disposeChart();
136
251
  return;
137
252
  }
138
- if (this.type === 'scatter') {
139
- return this.renderScatterAxises();
140
- }
141
- return this.renderAxisLines(this.range);
142
- }
143
- // Two value axes, so a full grid: horizontal lines for the vertical axis,
144
- // vertical lines for the horizontal one. Which range maps to which flips
145
- // with `orientation`, like the points.
146
- renderScatterAxises() {
147
- const portrait = this.orientation === 'portrait';
148
- const horizontalLines = portrait ? this.secondaryAxisRange : this.range;
149
- const verticalLines = portrait ? this.range : this.secondaryAxisRange;
150
- return [
151
- this.renderAxisLines(horizontalLines, 'horizontal-lines'),
152
- this.renderAxisLines(verticalLines, 'vertical-lines'),
153
- ];
154
- }
155
- renderAxisLines(range, direction) {
156
- const { minValue, maxValue, increment } = range;
157
- const lines = [];
158
- for (let value = minValue; value <= maxValue; value += increment) {
159
- lines.push(h("div", { class: {
160
- 'axis-line': true,
161
- 'zero-line': value === 0,
162
- }, role: "presentation" }, h("limel-badge", { label: value })));
253
+ this.observeSize();
254
+ const { clientWidth: width, clientHeight: height } = this.plot;
255
+ if (!width || !height) {
256
+ return;
163
257
  }
164
- const cssClass = { axises: true };
165
- if (direction) {
166
- cssClass[direction] = true;
258
+ this.createChart();
259
+ if (width !== this.chart.getWidth() ||
260
+ height !== this.chart.getHeight()) {
261
+ this.chart.resize();
167
262
  }
168
- return (h("div", { class: cssClass, role: "presentation", key: direction }, lines));
263
+ this.updateChart();
264
+ this.fitItemTextsToSize();
169
265
  }
170
- renderItems() {
266
+ createChart() {
171
267
  var _a;
172
- if (!((_a = this.items) === null || _a === void 0 ? void 0 : _a.length)) {
268
+ if (((_a = this.chart) === null || _a === void 0 ? void 0 : _a.getDom()) === this.plot) {
173
269
  return;
174
270
  }
175
- let cumulativeOffset = 0;
176
- return this.items.map((item, index) => {
177
- const itemId = createRandomString();
178
- const sizeAndOffset = this.calculateSizeAndOffset(item);
179
- const size = sizeAndOffset.size;
180
- let offset = sizeAndOffset.offset;
181
- if (this.type === 'pie' || this.type === 'doughnut') {
182
- offset = cumulativeOffset;
183
- cumulativeOffset += size;
184
- }
185
- return (h("tr", { style: this.getItemStyle(item, index, size, offset), class: this.getItemClass(item), key: itemId, id: itemId, "data-index": index, tabIndex: 0, role: item.clickable ? 'button' : null, onClick: this.handleClick, onKeyDown: this.handleKeyDown }, h("td", { class: "text" }, this.getItemText(item)), h("td", { class: "value" }, this.getFormattedValue(item)), this.renderTooltip(item, itemId, size)));
186
- });
271
+ this.disposeChart();
272
+ /*!
273
+ * Apache ECharts
274
+ * Copyright 2017-2026 The Apache Software Foundation
275
+ *
276
+ * This product includes software developed at
277
+ * The Apache Software Foundation (https://www.apache.org/).
278
+ *
279
+ * Licensed under the Apache License, Version 2.0
280
+ * (https://www.apache.org/licenses/LICENSE-2.0).
281
+ *
282
+ *
283
+ * ZRender
284
+ * Copyright (c) 2017, Baidu Inc.
285
+ * All rights reserved.
286
+ *
287
+ * Redistribution and use in source and binary forms, with or without
288
+ * modification, are permitted provided that the following conditions are met:
289
+ *
290
+ * * Redistributions of source code must retain the above copyright notice, this
291
+ * list of conditions and the following disclaimer.
292
+ *
293
+ * * Redistributions in binary form must reproduce the above copyright notice,
294
+ * this list of conditions and the following disclaimer in the documentation
295
+ * and/or other materials provided with the distribution.
296
+ *
297
+ * * Neither the name of the copyright holder nor the names of its
298
+ * contributors may be used to endorse or promote products derived from
299
+ * this software without specific prior written permission.
300
+ *
301
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
302
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
303
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
304
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
305
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
306
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
307
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
308
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
309
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
310
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
311
+ */
312
+ use(extensions);
313
+ this.chart = init(this.plot, null, { renderer: 'svg' });
314
+ this.chart.on('click', this.handleChartClick);
315
+ this.chart.on('mouseover', this.handleChartOver);
316
+ this.chart.on('mouseout', this.handleChartOut);
187
317
  }
188
- getItemStyle(item, index, size, offset) {
189
- if (this.type === 'scatter') {
190
- return this.getScatterItemStyle(item, index);
318
+ updateChart() {
319
+ var _a, _b;
320
+ const settings = this.getSettings();
321
+ const drawnSettings = JSON.stringify(settings);
322
+ if (drawnSettings === this.drawnSettings && !this.themeMayHaveChanged) {
323
+ return;
191
324
  }
192
- const style = {
193
- '--limel-chart-item-offset': `${offset}`,
194
- '--limel-chart-item-size': `${size}`,
195
- '--limel-chart-item-index': `${index}`,
196
- '--limel-chart-item-value': `${item.value}`,
197
- };
198
- if (item.color) {
199
- style['--limel-chart-item-color'] = item.color;
325
+ this.themeMayHaveChanged = false;
326
+ (_a = this.themeReader) !== null && _a !== void 0 ? _a : (this.themeReader = createThemeReader(this.host.shadowRoot));
327
+ (_b = this.stopWatchingTheme) !== null && _b !== void 0 ? _b : (this.stopWatchingTheme = watchTheme(this.host, this.handleThemeChange));
328
+ const theme = this.themeReader.theme();
329
+ const coloredSettings = this.withItemColors(settings, theme);
330
+ const drawnTheme = JSON.stringify({
331
+ theme: theme,
332
+ itemColors: coloredSettings.items.map((item) => item.color),
333
+ });
334
+ if (drawnSettings === this.drawnSettings &&
335
+ drawnTheme === this.drawnTheme) {
336
+ return;
200
337
  }
201
- if (this.type === 'line' || this.type === 'area') {
202
- const nextItem = this.calculateSizeAndOffset(this.items[index + 1]);
203
- style['--limel-chart-next-item-size'] = `${nextItem.size}`;
204
- style['--limel-chart-next-item-offset'] = `${nextItem.offset}`;
338
+ this.drawnSettings = drawnSettings;
339
+ this.drawnTheme = drawnTheme;
340
+ this.drawing = drawChart(coloredSettings, theme, this.itemSpace);
341
+ this.chart.setOption(this.drawing.option, { notMerge: true });
342
+ const focusedRow = this.host.shadowRoot.activeElement;
343
+ if (focusedRow instanceof HTMLElement && focusedRow.dataset.index) {
344
+ this.showItem(focusedRow, true);
205
345
  }
206
- return style;
207
346
  }
208
- getScatterItemStyle(item, index) {
209
- const style = {
210
- '--limel-chart-item-offset-x': `${this.normalize(this.getXValue(item), this.secondaryAxisRange)}`,
211
- '--limel-chart-item-offset-y': `${this.normalize(this.getYValue(item), this.range)}`,
212
- '--limel-chart-item-index': `${index}`,
213
- };
214
- if (item.color) {
215
- style['--limel-chart-item-color'] = item.color;
347
+ fitItemTextsToSize() {
348
+ var _a;
349
+ const axis = (_a = this.drawing) === null || _a === void 0 ? void 0 : _a.itemTextAxis;
350
+ if (!axis) {
351
+ return;
216
352
  }
217
- return style;
353
+ const finder = { [`${axis}Index`]: 0 };
354
+ const itemSpace = Math.floor(Math.abs(this.chart.convertToPixel(finder, 1) -
355
+ this.chart.convertToPixel(finder, 0)));
356
+ if (itemSpace === this.itemSpace) {
357
+ return;
358
+ }
359
+ this.itemSpace = itemSpace;
360
+ this.chart.setOption(fitItemTexts(this.drawing, itemSpace));
218
361
  }
219
- getItemClass(item) {
362
+ getSettings() {
363
+ var _a;
220
364
  return {
221
- item: true,
222
- 'has-start-value': this.type !== 'scatter' && Array.isArray(item.value),
223
- 'has-negative-value-only': this.getMaximumValue(item) < 0 && !this.isRangeItem(item),
224
- // Scatter coordinates are independent values, so "value is zero"
225
- // (which hides the value label elsewhere) must not apply.
226
- 'has-value-zero': this.type !== 'scatter' && this.getMaximumValue(item) === 0,
365
+ items: ((_a = this.items) !== null && _a !== void 0 ? _a : []).map((item) => ({
366
+ text: item.text,
367
+ value: item.value,
368
+ formattedValue: item.formattedValue,
369
+ color: item.color,
370
+ clickable: item.clickable,
371
+ })),
372
+ type: this.type,
373
+ orientation: this.orientation,
374
+ maxValue: this.maxValue,
375
+ axisIncrement: this.axisIncrement,
376
+ displayAxisLabels: this.displayAxisLabels,
377
+ itemsLabel: this.itemsLabel,
378
+ valuesLabel: this.valuesLabel,
379
+ displayItemText: this.displayItemText,
380
+ displayItemValue: this.displayItemValue,
381
+ displayItemPercentage: this.displayItemPercentage,
227
382
  };
228
383
  }
229
- calculateSizeAndOffset(item) {
230
- const { minValue, totalRange } = this.range;
231
- if (!item) {
232
- return {
233
- size: 0,
234
- offset: 0,
235
- };
236
- }
237
- if (this.isPartOfWhole()) {
238
- return {
239
- size: (this.getValueSpan(item) / totalRange) * PERCENT,
240
- offset: 0,
241
- };
242
- }
243
- let startValue = 0;
244
- if (this.isRangeItem(item)) {
245
- startValue = this.getMinimumValue(item);
246
- }
247
- const normalizedStart = ((startValue - minValue) / totalRange) * PERCENT;
248
- const normalizedEnd = ((this.getMaximumValue(item) - minValue) / totalRange) * PERCENT;
249
- return {
250
- size: normalizedEnd - normalizedStart,
251
- offset: normalizedStart,
252
- };
384
+ withItemColors(settings, theme) {
385
+ return Object.assign(Object.assign({}, settings), { items: settings.items.map((item) => (Object.assign(Object.assign({}, item), { color: this.getItemColor(item, theme) }))) });
253
386
  }
254
- getFormattedValue(item) {
255
- const { value, formattedValue } = item;
256
- if (formattedValue) {
257
- return formattedValue;
387
+ getItemColor(item, theme) {
388
+ if (!item.color) {
389
+ return theme.itemColor;
258
390
  }
259
- if (Array.isArray(value)) {
260
- if (this.type === 'scatter') {
261
- return `(${value[0]}, ${value[1]})`;
262
- }
263
- return `${value[0]} — ${value[1]}`;
391
+ const color = this.themeReader.color(item.color);
392
+ if (color) {
393
+ return color;
264
394
  }
265
- return `${value}`;
266
- }
267
- getItemText(item) {
268
- return item.text;
269
- }
270
- renderTooltip(item, itemId, size) {
271
- const text = this.getItemText(item);
272
- const PERCENT_DECIMAL = 2;
273
- const formattedValue = this.getFormattedValue(item);
274
- const tooltipProps = {
275
- label: text,
276
- helperLabel: formattedValue,
277
- elementId: itemId,
278
- };
279
- if (this.displayItemPercentage && this.isPartOfWhole()) {
280
- tooltipProps.label = `${text} (${size.toFixed(PERCENT_DECIMAL)}%)`;
395
+ if (!this.invalidColors.has(item.color)) {
396
+ this.invalidColors.add(item.color);
397
+ const hint = item.color.includes('var(')
398
+ ? ' Check that its variables are set, and that they make a color.'
399
+ : '';
400
+ console.warn(`limel-chart: the color of an item must be a CSS color, but was \`${item.color}\`.${hint} Using the default item color instead.`);
281
401
  }
282
- return (h("limel-tooltip", Object.assign({}, tooltipProps, { openDirection: this.orientation === 'portrait' ? 'right' : 'top' })));
402
+ return theme.itemColor;
283
403
  }
284
- calculateRange() {
285
- var _a;
286
- if (this.range) {
287
- return this.range;
288
- }
289
- if (this.isPartOfWhole()) {
290
- return this.calculateWholeRange();
291
- }
292
- const minRange = Math.min(0, ...this.items.map(this.getMinimumValue));
293
- const maxRange = Math.max(...this.items.map(this.getMaximumValue));
294
- const finalMaxRange = (_a = this.maxValue) !== null && _a !== void 0 ? _a : maxRange;
295
- if (!this.axisIncrement) {
296
- this.axisIncrement = this.calculateAxisIncrement(this.items.map(this.getMaximumValue));
404
+ observeSize() {
405
+ if (this.resizeObserver || typeof ResizeObserver === 'undefined') {
406
+ return;
297
407
  }
298
- const visualMaxValue = Math.ceil(finalMaxRange / this.axisIncrement) * this.axisIncrement;
299
- const visualMinValue = Math.floor(minRange / this.axisIncrement) * this.axisIncrement;
300
- const totalRange = visualMaxValue - visualMinValue;
301
- return {
302
- minValue: visualMinValue,
303
- maxValue: visualMaxValue,
304
- totalRange: totalRange,
305
- increment: this.axisIncrement,
306
- };
408
+ this.resizeObserver = new ResizeObserver(this.handleResize);
409
+ this.resizeObserver.observe(this.host);
307
410
  }
308
- /**
309
- * The range of a chart whose items are parts of one whole: `maxValue`
310
- * when set, otherwise the combined item values or range extents. The value
311
- * is a scale, not a cap, so the combined size can exceed it. The whole is
312
- * not rounded to an axis step, since these types draw no axis and an item's
313
- * size has to be its exact share.
314
- */
315
- calculateWholeRange() {
411
+ disposeChart() {
316
412
  var _a;
317
- const sum = this.items.reduce((total, item) => total + this.getValueSpan(item), 0);
318
- const inferredWhole = sum > 0 ? sum : 1;
319
- // An explicit zero also falls back to 1, so normalization stays finite.
320
- const whole = ((_a = this.maxValue) !== null && _a !== void 0 ? _a : inferredWhole) || 1;
321
- return {
322
- minValue: 0,
323
- maxValue: whole,
324
- totalRange: whole,
325
- increment: whole,
326
- };
327
- }
328
- isPartOfWhole() {
329
- return WHOLE_TYPES.has(this.type);
330
- }
331
- calculateAxisIncrement(values, steps = DEFAULT_INCREMENT_SIZE) {
332
- return this.calculateNiceStep(Math.max(...values), steps);
333
- }
334
- // A "nice" step (…× 10ⁿ) dividing `span` into ~`steps` intervals. Takes the
335
- // axis length, not a raw max, so it's sign-safe (a negative max would make
336
- // `Math.log10` return `NaN`).
337
- calculateNiceStep(span, steps = DEFAULT_INCREMENT_SIZE) {
338
- if (span <= 0) {
339
- // Every value is identical (e.g. all zero); any positive step works.
340
- return 1;
413
+ (_a = this.chart) === null || _a === void 0 ? void 0 : _a.dispose();
414
+ this.chart = undefined;
415
+ this.drawing = undefined;
416
+ this.drawnSettings = undefined;
417
+ this.drawnTheme = undefined;
418
+ this.itemSpace = undefined;
419
+ }
420
+ highlightItemAt(event, highlight) {
421
+ if (!this.drawing) {
422
+ return;
341
423
  }
342
- const roughStep = span / steps;
343
- const magnitude = 10 ** Math.floor(Math.log10(roughStep));
344
- return Math.ceil(roughStep / magnitude) * magnitude;
345
- }
346
- // Axis length measured through zero, so the origin is always included.
347
- axisSpan(values) {
348
- return Math.max(0, ...values) - Math.min(0, ...values);
349
- }
350
- // A "nice" rounded range for one scatter axis. Both bounds include zero, so
351
- // a fully-negative axis still shows its origin (and zero line).
352
- calculateAxisRange(values, increment) {
353
- const minValue = Math.floor(Math.min(0, ...values) / increment) * increment;
354
- const maxValue = Math.ceil(Math.max(0, ...values) / increment) * increment;
355
- return {
356
- minValue: minValue,
357
- maxValue: maxValue,
358
- totalRange: maxValue - minValue,
359
- increment: increment,
360
- };
361
- }
362
- normalize(value, range) {
363
- if (range.totalRange === 0) {
364
- // Degenerate axis (every value is zero): center the point so it
365
- // stays visible instead of dividing by zero.
366
- return PERCENT / 2;
424
+ const location = locateItem(this.drawing, getItemIndex(this.drawing, event));
425
+ if (location.seriesIndex === event.seriesIndex) {
426
+ return;
367
427
  }
368
- return ((value - range.minValue) / range.totalRange) * PERCENT;
428
+ this.chart.dispatchAction(Object.assign({ type: highlight ? 'highlight' : 'downplay' }, location));
369
429
  }
370
- getXValue(item) {
371
- return Array.isArray(item.value) ? item.value[0] : item.value;
372
- }
373
- getYValue(item) {
374
- return Array.isArray(item.value) ? item.value[1] : item.value;
375
- }
376
- getMinimumValue(item) {
377
- const value = item.value;
378
- return Array.isArray(value) ? Math.min(...value) : value;
379
- }
380
- getMaximumValue(item) {
381
- const value = item.value;
382
- return Array.isArray(value) ? Math.max(...value) : value;
383
- }
384
- getValueSpan(item) {
385
- const startValue = this.isRangeItem(item)
386
- ? this.getMinimumValue(item)
387
- : 0;
388
- return this.getMaximumValue(item) - startValue;
389
- }
390
- isRangeItem(item) {
391
- return Array.isArray(item.value);
392
- }
393
- handleChange() {
394
- this.range = null;
395
- this.secondaryAxisRange = null;
396
- this.recalculateRangeData();
397
- }
398
- recalculateRangeData() {
399
- if (this.type === 'scatter') {
400
- this.recalculateScatterRanges();
430
+ getClickableItem(index) {
431
+ const item = this.items[index];
432
+ if (!(item === null || item === void 0 ? void 0 : item.clickable)) {
401
433
  return;
402
434
  }
403
- this.range = this.calculateRange();
404
- }
405
- // Each axis derives its own range and step from its own zero-anchored span
406
- // (positive, negative, and zero-crossing data all grid sensibly). The single
407
- // `axisIncrement` prop can't describe two independent axes, so scatter
408
- // ignores it and auto-derives both, like it does `maxValue`.
409
- recalculateScatterRanges() {
410
- const xValues = this.items.map((item) => this.getXValue(item));
411
- const yValues = this.items.map((item) => this.getYValue(item));
412
- this.range = this.calculateAxisRange(yValues, this.calculateNiceStep(this.axisSpan(yValues)));
413
- this.secondaryAxisRange = this.calculateAxisRange(xValues, this.calculateNiceStep(this.axisSpan(xValues)));
414
- }
415
- getClickableItem(target) {
416
- const index = target.dataset.index;
417
- if (index === undefined) {
435
+ return item;
436
+ }
437
+ getRowIndex(event) {
438
+ return Number(event.currentTarget.dataset.index);
439
+ }
440
+ focusItem(index) {
441
+ if (index === NO_NAVIGATION_TARGET) {
418
442
  return;
419
443
  }
420
- const item = this.items[Number(index)];
421
- if (!item.clickable) {
444
+ const rows = this.host.shadowRoot.querySelectorAll('tbody tr');
445
+ rows[index].focus();
446
+ }
447
+ showItem(row, show) {
448
+ if (!this.chart || !this.drawing) {
422
449
  return;
423
450
  }
424
- return item;
451
+ const location = locateItem(this.drawing, Number(row.dataset.index));
452
+ this.chart.dispatchAction(Object.assign({ type: show ? 'highlight' : 'downplay' }, location));
453
+ this.chart.dispatchAction(Object.assign({ type: show ? 'showTip' : 'hideTip' }, location));
425
454
  }
426
455
  static get is() { return "limel-chart"; }
427
456
  static get encapsulation() { return "shadow"; }
@@ -629,9 +658,16 @@ export class Chart {
629
658
  "type": "string",
630
659
  "mutable": false,
631
660
  "complexType": {
632
- "original": "| 'area'\n | 'bar'\n | 'doughnut'\n | 'line'\n | 'nps'\n | 'pie'\n | 'ring'\n | 'dot'\n | 'scatter'\n | 'stacked-bar'",
661
+ "original": "ChartType",
633
662
  "resolved": "\"area\" | \"bar\" | \"dot\" | \"doughnut\" | \"line\" | \"nps\" | \"pie\" | \"ring\" | \"scatter\" | \"stacked-bar\"",
634
- "references": {}
663
+ "references": {
664
+ "ChartType": {
665
+ "location": "import",
666
+ "path": "./chart.types",
667
+ "id": "src/components/chart/chart.types.ts::ChartType",
668
+ "referenceLocation": "ChartType"
669
+ }
670
+ }
635
671
  },
636
672
  "required": false,
637
673
  "optional": true,
@@ -696,7 +732,7 @@ export class Chart {
696
732
  "optional": true,
697
733
  "docs": {
698
734
  "tags": [],
699
- "text": "Sets the axis increment for `bar`, `dot`, `area`, and `line` charts.\nHas no effect on other chart types."
735
+ "text": "Sets the axis increment for `bar`, `dot`, `area`, and `line` charts.\nWhen it is not set, or not above zero, the chart works out a step\nfrom the values. It also does that when the step would divide the\naxis into more than 100 parts, so that it does not draw too many lines.\nHas no effect on other chart types."
700
736
  },
701
737
  "getter": false,
702
738
  "setter": false,
@@ -725,6 +761,11 @@ export class Chart {
725
761
  }
726
762
  };
727
763
  }
764
+ static get states() {
765
+ return {
766
+ "focusedIndex": {}
767
+ };
768
+ }
728
769
  static get events() {
729
770
  return [{
730
771
  "method": "interact",
@@ -750,19 +791,20 @@ export class Chart {
750
791
  }
751
792
  }];
752
793
  }
794
+ static get elementRef() { return "host"; }
753
795
  static get watchers() {
754
796
  return [{
755
- "propName": "items",
756
- "methodName": "handleChange"
757
- }, {
758
797
  "propName": "axisIncrement",
759
- "methodName": "handleChange"
798
+ "methodName": "warnAboutAxisIncrement"
799
+ }, {
800
+ "propName": "items",
801
+ "methodName": "warnAboutAxisIncrement"
760
802
  }, {
761
803
  "propName": "maxValue",
762
- "methodName": "handleChange"
804
+ "methodName": "warnAboutAxisIncrement"
763
805
  }, {
764
806
  "propName": "type",
765
- "methodName": "handleChange"
807
+ "methodName": "warnAboutAxisIncrement"
766
808
  }];
767
809
  }
768
810
  }