@limetech/lime-elements 40.23.0 → 40.25.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.
- package/CHANGELOG.md +20 -0
- package/dist/cjs/{checkbox.template-CNJ29zDR.js → checkbox.template-DgiUCPna.js} +1 -1
- package/dist/cjs/dom-BWMDM6En.js +32 -0
- package/dist/cjs/{image.template-DlF-f23b.js → image.template-B_HZH9t-.js} +1 -1
- package/dist/cjs/{index-BlsqxTB1.js → index-CQn9p_mp.js} +12 -0
- package/dist/cjs/lime-elements.cjs.js +2 -2
- package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +2 -2
- package/dist/cjs/limel-action-bar_3.cjs.entry.js +5 -6
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +3 -4
- package/dist/cjs/limel-badge_7.cjs.entry.js +13 -13
- package/dist/cjs/limel-banner.cjs.entry.js +2 -2
- package/dist/cjs/limel-button-group.cjs.entry.js +2 -2
- package/dist/cjs/limel-button.cjs.entry.js +3 -3
- package/dist/cjs/limel-callout.cjs.entry.js +3 -4
- package/dist/cjs/limel-card.cjs.entry.js +3 -3
- package/dist/cjs/limel-chart.cjs.entry.js +782 -180
- package/dist/cjs/limel-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/limel-chip-set.cjs.entry.js +3 -4
- package/dist/cjs/limel-chip_2.cjs.entry.js +4 -5
- package/dist/cjs/limel-circular-progress.cjs.entry.js +2 -2
- package/dist/cjs/limel-code-diff.cjs.entry.js +3 -4
- package/dist/cjs/limel-code-editor.cjs.entry.js +3 -4
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +3 -4
- package/dist/cjs/limel-color-picker-palette.cjs.entry.js +3 -3
- package/dist/cjs/limel-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/limel-config.cjs.entry.js +1 -1
- package/dist/cjs/limel-date-picker.cjs.entry.js +439 -28
- package/dist/cjs/limel-dialog.cjs.entry.js +3 -3
- package/dist/cjs/limel-dock-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-dock.cjs.entry.js +4 -5
- package/dist/cjs/limel-drag-handle_2.cjs.entry.js +5 -6
- package/dist/cjs/limel-dynamic-label.cjs.entry.js +1 -1
- package/dist/cjs/limel-email-viewer.cjs.entry.js +3 -4
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +3 -3
- package/dist/cjs/limel-file-viewer.cjs.entry.js +3 -4
- package/dist/cjs/limel-file.cjs.entry.js +3 -4
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +124 -16
- package/dist/cjs/limel-flex-container.cjs.entry.js +2 -2
- package/dist/cjs/limel-form-header.cjs.entry.js +2 -2
- package/dist/cjs/limel-form.cjs.entry.js +66 -6
- package/dist/cjs/limel-grid.cjs.entry.js +2 -2
- package/dist/cjs/limel-header.cjs.entry.js +2 -2
- package/dist/cjs/limel-help_2.cjs.entry.js +4 -4
- package/dist/cjs/limel-helper-line_3.cjs.entry.js +5 -5
- package/dist/cjs/limel-hotkey_4.cjs.entry.js +6 -6
- package/dist/cjs/limel-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-icon.cjs.entry.js +2 -2
- package/dist/cjs/limel-info-tile.cjs.entry.js +3 -3
- package/dist/cjs/limel-list-item.cjs.entry.js +7 -8
- package/dist/cjs/limel-markdown.cjs.entry.js +2 -2
- package/dist/cjs/limel-masonry-layout.cjs.entry.js +2 -2
- package/dist/cjs/limel-menu-item-meta.cjs.entry.js +2 -2
- package/dist/cjs/limel-pagination-jump.cjs.entry.js +2 -3
- package/dist/cjs/limel-pagination.cjs.entry.js +7 -8
- package/dist/cjs/limel-picker.cjs.entry.js +7 -7
- package/dist/cjs/limel-popover_2.cjs.entry.js +3 -3
- package/dist/cjs/limel-profile-picture.cjs.entry.js +3 -4
- package/dist/cjs/limel-progress-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/limel-progress-flow.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +3 -4
- package/dist/cjs/limel-radio-button-group.cjs.entry.js +2 -2
- package/dist/cjs/limel-radio-button.cjs.entry.js +3 -3
- package/dist/cjs/limel-resize-handle.cjs.entry.js +3 -4
- package/dist/cjs/limel-select.cjs.entry.js +3 -3
- package/dist/cjs/limel-shortcut.cjs.entry.js +2 -2
- package/dist/cjs/limel-side-panel.cjs.entry.js +3 -4
- package/dist/cjs/limel-slider.cjs.entry.js +5 -6
- package/dist/cjs/limel-snackbar.cjs.entry.js +4 -5
- package/dist/cjs/limel-split-button.cjs.entry.js +3 -3
- package/dist/cjs/limel-switch.cjs.entry.js +2 -2
- package/dist/cjs/limel-tab-bar.cjs.entry.js +2 -2
- package/dist/cjs/limel-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/limel-table.cjs.entry.js +4 -5
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +5 -6
- package/dist/cjs/limel-text-editor.cjs.entry.js +2 -2
- package/dist/cjs/{live-message-BNl3Ihcz.js → live-message-CwxlKd60.js} +0 -30
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{render-list-component-BtAliHQp.js → render-list-component-BOYFHMFE.js} +1 -1
- package/dist/cjs/{translations-JLP5icQ9.js → translations-BPsptVkN.js} +73 -3
- package/dist/collection/components/3d-hover-effect-glow/3d-hover-effect-glow.js +1 -1
- package/dist/collection/components/action-bar/action-bar-item/action-bar-overflow-menu.js +1 -1
- package/dist/collection/components/action-bar/action-bar.js +2 -2
- package/dist/collection/components/ai-avatar/ai-avatar.js +1 -1
- package/dist/collection/components/badge/badge.js +2 -2
- package/dist/collection/components/banner/banner.js +1 -1
- package/dist/collection/components/breadcrumbs/breadcrumbs.js +1 -1
- package/dist/collection/components/button/button.js +2 -2
- package/dist/collection/components/button-group/button-group.js +1 -1
- package/dist/collection/components/callout/callout.js +1 -1
- package/dist/collection/components/card/card.js +1 -1
- package/dist/collection/components/chart/chart.css +29 -0
- package/dist/collection/components/chart/chart.js +352 -67
- package/dist/collection/components/chart/options.js +342 -109
- package/dist/collection/components/chart/scale.js +25 -2
- package/dist/collection/components/chart/series.js +110 -0
- package/dist/collection/components/checkbox/checkbox.js +1 -1
- package/dist/collection/components/chip/chip.js +1 -1
- package/dist/collection/components/chip-set/chip-set.js +1 -1
- package/dist/collection/components/circular-progress/circular-progress.js +1 -1
- package/dist/collection/components/code-diff/code-diff.js +1 -1
- package/dist/collection/components/code-editor/code-editor.js +1 -1
- package/dist/collection/components/collapsible-section/collapsible-section.js +1 -1
- package/dist/collection/components/color-picker/color-picker-palette.js +2 -2
- package/dist/collection/components/color-picker/color-picker.js +1 -1
- package/dist/collection/components/date-picker/date-formatter.js +147 -1
- package/dist/collection/components/date-picker/date-picker.css +112 -0
- package/dist/collection/components/date-picker/date-picker.js +307 -26
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +77 -30
- package/dist/collection/components/date-picker/pickers/month-picker.js +3 -0
- package/dist/collection/components/date-picker/pickers/picker.js +37 -1
- package/dist/collection/components/date-picker/pickers/quarter-picker.js +3 -0
- package/dist/collection/components/date-picker/pickers/week-picker.js +21 -0
- package/dist/collection/components/date-picker/pickers/year-picker.js +24 -0
- package/dist/collection/components/dialog/dialog.js +2 -2
- package/dist/collection/components/dock/dock.js +2 -2
- package/dist/collection/components/drag-handle/drag-handle.js +1 -1
- package/dist/collection/components/email-viewer/email-viewer.js +1 -1
- package/dist/collection/components/file/file.js +1 -1
- package/dist/collection/components/file-dropzone/file-dropzone.js +1 -1
- package/dist/collection/components/file-input/file-input.js +1 -1
- package/dist/collection/components/flex-container/flex-container.js +1 -1
- package/dist/collection/components/form/fields/schema-field.js +19 -1
- package/dist/collection/components/form/form.js +30 -3
- package/dist/collection/components/form/form.test-schemas.js +11 -0
- package/dist/collection/components/form/invalid-input.js +14 -0
- package/dist/collection/components/form/widgets/date-picker.js +3 -1
- package/dist/collection/components/form-header/form-header.js +1 -1
- package/dist/collection/components/grid/grid.js +1 -1
- package/dist/collection/components/header/header.js +1 -1
- package/dist/collection/components/help/help-content.js +1 -1
- package/dist/collection/components/help/help.js +2 -2
- package/dist/collection/components/helper-line/helper-line.js +2 -2
- package/dist/collection/components/hotkey/hotkey.js +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon-button/icon-button.js +1 -1
- package/dist/collection/components/info-tile/info-tile.js +2 -2
- package/dist/collection/components/input-field/input-field.js +1 -1
- package/dist/collection/components/list/list.js +1 -1
- package/dist/collection/components/list-item/list-item.js +2 -2
- package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.js +1 -1
- package/dist/collection/components/markdown/markdown.js +1 -1
- package/dist/collection/components/masonry-layout/masonry-layout.js +1 -1
- package/dist/collection/components/menu/menu.js +1 -1
- package/dist/collection/components/menu-list/menu-list.js +1 -1
- package/dist/collection/components/menu-surface/menu-surface.js +1 -1
- package/dist/collection/components/notched-outline/notched-outline.js +1 -1
- package/dist/collection/components/pagination/pagination.js +1 -1
- package/dist/collection/components/picker/picker.js +1 -1
- package/dist/collection/components/popover/popover.js +1 -1
- package/dist/collection/components/popover-surface/popover-surface.js +1 -1
- package/dist/collection/components/portal/portal.js +1 -1
- package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
- package/dist/collection/components/radio-button-group/radio-button.js +2 -2
- package/dist/collection/components/resize-handle/resize-handle.js +1 -1
- package/dist/collection/components/scroller/scroller.js +2 -2
- package/dist/collection/components/select/select.js +1 -1
- package/dist/collection/components/shortcut/shortcut.js +1 -1
- package/dist/collection/components/side-panel/side-panel.js +1 -1
- package/dist/collection/components/slider/slider.js +3 -3
- package/dist/collection/components/snackbar/snackbar.js +2 -2
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/split-button/split-button.js +2 -2
- package/dist/collection/components/switch/switch.js +1 -1
- package/dist/collection/components/tab-bar/tab-bar.js +1 -1
- package/dist/collection/components/tab-panel/tab-panel.js +1 -1
- package/dist/collection/components/table/table.js +2 -2
- package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +3 -3
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +1 -1
- package/dist/collection/components/text-editor/text-editor.js +1 -1
- package/dist/collection/components/tooltip/tooltip-content.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/collection/translations/da.js +2 -0
- package/dist/collection/translations/de.js +2 -0
- package/dist/collection/translations/en.js +2 -0
- package/dist/collection/translations/fi.js +2 -0
- package/dist/collection/translations/fr.js +2 -0
- package/dist/collection/translations/nl.js +2 -0
- package/dist/collection/translations/no.js +2 -0
- package/dist/collection/translations/sv.js +2 -0
- package/dist/esm/{checkbox.template-CAja2LKZ.js → checkbox.template-BJJmiDJP.js} +1 -1
- package/dist/esm/dom-B9Ofc5RB.js +30 -0
- package/dist/esm/{image.template-BGjw97m_.js → image.template-Cw2q5IS7.js} +1 -1
- package/dist/esm/{index-BU9IJqli.js → index-D3SUrFhp.js} +12 -1
- package/dist/esm/{keyboard-navigation-BF7IKmnG.js → keyboard-navigation-DeMxdkNf.js} +1 -1
- package/dist/esm/lime-elements.js +3 -3
- package/dist/esm/limel-3d-hover-effect-glow.entry.js +2 -2
- package/dist/esm/limel-action-bar_3.entry.js +5 -6
- package/dist/esm/limel-ai-avatar.entry.js +3 -4
- package/dist/esm/limel-badge_7.entry.js +12 -12
- package/dist/esm/limel-banner.entry.js +2 -2
- package/dist/esm/limel-button-group.entry.js +2 -2
- package/dist/esm/limel-button.entry.js +3 -3
- package/dist/esm/limel-callout.entry.js +3 -4
- package/dist/esm/limel-card.entry.js +3 -3
- package/dist/esm/limel-chart.entry.js +779 -177
- package/dist/esm/limel-checkbox.entry.js +3 -3
- package/dist/esm/limel-chip-set.entry.js +3 -4
- package/dist/esm/limel-chip_2.entry.js +4 -5
- package/dist/esm/limel-circular-progress.entry.js +2 -2
- package/dist/esm/limel-code-diff.entry.js +3 -4
- package/dist/esm/limel-code-editor.entry.js +3 -4
- package/dist/esm/limel-collapsible-section.entry.js +3 -4
- package/dist/esm/limel-color-picker-palette.entry.js +3 -3
- package/dist/esm/limel-color-picker.entry.js +2 -2
- package/dist/esm/limel-config.entry.js +1 -1
- package/dist/esm/limel-date-picker.entry.js +436 -25
- package/dist/esm/limel-dialog.entry.js +3 -3
- package/dist/esm/limel-dock-button.entry.js +1 -1
- package/dist/esm/limel-dock.entry.js +4 -5
- package/dist/esm/limel-drag-handle_2.entry.js +5 -6
- package/dist/esm/limel-dynamic-label.entry.js +1 -1
- package/dist/esm/limel-email-viewer.entry.js +3 -4
- package/dist/esm/limel-file-dropzone_2.entry.js +3 -3
- package/dist/esm/limel-file-viewer.entry.js +3 -4
- package/dist/esm/limel-file.entry.js +3 -4
- package/dist/esm/limel-flatpickr-adapter.entry.js +118 -10
- package/dist/esm/limel-flex-container.entry.js +2 -2
- package/dist/esm/limel-form-header.entry.js +2 -2
- package/dist/esm/limel-form.entry.js +66 -6
- package/dist/esm/limel-grid.entry.js +2 -2
- package/dist/esm/limel-header.entry.js +2 -2
- package/dist/esm/limel-help_2.entry.js +4 -4
- package/dist/esm/limel-helper-line_3.entry.js +5 -5
- package/dist/esm/limel-hotkey_4.entry.js +6 -6
- package/dist/esm/limel-icon-button.entry.js +2 -2
- package/dist/esm/limel-icon.entry.js +2 -2
- package/dist/esm/limel-info-tile.entry.js +3 -3
- package/dist/esm/limel-list-item.entry.js +7 -8
- package/dist/esm/limel-markdown.entry.js +2 -2
- package/dist/esm/limel-masonry-layout.entry.js +2 -2
- package/dist/esm/limel-menu-item-meta.entry.js +2 -2
- package/dist/esm/limel-pagination-jump.entry.js +2 -3
- package/dist/esm/limel-pagination.entry.js +3 -4
- package/dist/esm/limel-picker.entry.js +5 -5
- package/dist/esm/limel-popover_2.entry.js +3 -3
- package/dist/esm/limel-profile-picture.entry.js +3 -4
- package/dist/esm/limel-progress-flow-item.entry.js +1 -1
- package/dist/esm/limel-progress-flow.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +3 -4
- package/dist/esm/limel-radio-button-group.entry.js +2 -2
- package/dist/esm/limel-radio-button.entry.js +3 -3
- package/dist/esm/limel-resize-handle.entry.js +3 -4
- package/dist/esm/limel-select.entry.js +3 -3
- package/dist/esm/limel-shortcut.entry.js +2 -2
- package/dist/esm/limel-side-panel.entry.js +3 -4
- package/dist/esm/limel-slider.entry.js +5 -6
- package/dist/esm/limel-snackbar.entry.js +4 -5
- package/dist/esm/limel-split-button.entry.js +3 -3
- package/dist/esm/limel-switch.entry.js +2 -2
- package/dist/esm/limel-tab-bar.entry.js +3 -3
- package/dist/esm/limel-tab-panel.entry.js +2 -2
- package/dist/esm/limel-table.entry.js +4 -5
- package/dist/esm/limel-text-editor-link-menu.entry.js +5 -6
- package/dist/esm/limel-text-editor.entry.js +2 -2
- package/dist/esm/{live-message-BQAYeNiX.js → live-message-BKB4vu28.js} +1 -30
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{render-list-component-J1IzNpbv.js → render-list-component-CnMNjOaj.js} +1 -1
- package/dist/esm/{translations-D9ZGrMhe.js → translations--i932i_D.js} +70 -2
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p--i932i_D.js +1 -0
- package/dist/lime-elements/p-07961d4f.entry.js +1 -0
- package/dist/lime-elements/p-099e9e1a.entry.js +1 -0
- package/dist/lime-elements/p-0dd5cb25.entry.js +1 -0
- package/dist/lime-elements/{p-40940a6c.entry.js → p-1d57370e.entry.js} +1 -1
- package/dist/lime-elements/p-1ef92aa3.entry.js +1 -0
- package/dist/lime-elements/p-1eff9347.entry.js +56 -0
- package/dist/lime-elements/{p-6053608a.entry.js → p-22458db2.entry.js} +2 -2
- package/dist/lime-elements/{p-db9cb7ef.entry.js → p-2520a91b.entry.js} +1 -1
- package/dist/lime-elements/{p-85318636.entry.js → p-25473848.entry.js} +1 -1
- package/dist/lime-elements/p-27000dfb.entry.js +1 -0
- package/dist/lime-elements/p-29800b71.entry.js +1 -0
- package/dist/lime-elements/{p-438fe49b.entry.js → p-2e1fd8c4.entry.js} +1 -1
- package/dist/lime-elements/p-2f6ee1b0.entry.js +1 -0
- package/dist/lime-elements/{p-c61e9b83.entry.js → p-427a3da3.entry.js} +1 -1
- package/dist/lime-elements/p-447a2633.entry.js +1 -0
- package/dist/lime-elements/{p-909466b8.entry.js → p-4c54780d.entry.js} +1 -1
- package/dist/lime-elements/p-4f81f0b4.entry.js +1 -0
- package/dist/lime-elements/{p-7d0ffc60.entry.js → p-5062b51a.entry.js} +1 -1
- package/dist/lime-elements/p-5295b4c7.entry.js +1 -0
- package/dist/lime-elements/p-5a1b7f4d.entry.js +1 -0
- package/dist/lime-elements/{p-a6387dc7.entry.js → p-5b9c1f8f.entry.js} +1 -1
- package/dist/lime-elements/p-5be1e9e8.entry.js +159 -0
- package/dist/lime-elements/p-5c6589aa.entry.js +1 -0
- package/dist/lime-elements/{p-3f7fa772.entry.js → p-5e7ca1fd.entry.js} +1 -1
- package/dist/lime-elements/{p-95a486c8.entry.js → p-5f66e497.entry.js} +1 -1
- package/dist/lime-elements/p-667759da.entry.js +1 -0
- package/dist/lime-elements/{p-48a412ed.entry.js → p-6a340609.entry.js} +1 -1
- package/dist/lime-elements/{p-a891f3e8.entry.js → p-6d3cde2e.entry.js} +1 -1
- package/dist/lime-elements/{p-f59447bf.entry.js → p-6e529563.entry.js} +1 -1
- package/dist/lime-elements/{p-c2056ebc.entry.js → p-743f014f.entry.js} +1 -1
- package/dist/lime-elements/{p-c6b3448c.entry.js → p-7aa034e2.entry.js} +1 -1
- package/dist/lime-elements/p-7b2ec934.entry.js +1 -0
- package/dist/lime-elements/p-7b99624f.entry.js +1 -0
- package/dist/lime-elements/p-7ea96b80.entry.js +1 -0
- package/dist/lime-elements/{p-e5abe390.entry.js → p-7fe1d9ad.entry.js} +1 -1
- package/dist/lime-elements/p-842694af.entry.js +1 -0
- package/dist/lime-elements/{p-d3f13124.entry.js → p-848aeaa6.entry.js} +1 -1
- package/dist/lime-elements/{p-1e0ced6a.entry.js → p-868a8b12.entry.js} +1 -1
- package/dist/lime-elements/p-891f6a07.entry.js +1 -0
- package/dist/lime-elements/{p-28957b5c.entry.js → p-8dcb9ef1.entry.js} +1 -1
- package/dist/lime-elements/p-92f79a62.entry.js +1 -0
- package/dist/lime-elements/p-93907698.entry.js +16 -0
- package/dist/lime-elements/{p-c0ebf7cc.entry.js → p-9b3c7341.entry.js} +1 -1
- package/dist/lime-elements/p-B9Ofc5RB.js +1 -0
- package/dist/lime-elements/{p-_1yBt1pG.js → p-BJrZuSu3.js} +1 -1
- package/dist/lime-elements/{p-Cadm4-WZ.js → p-BzHrLZdr.js} +1 -1
- package/dist/lime-elements/p-CMedqTpE.js +1 -0
- package/dist/lime-elements/{p-BU9IJqli.js → p-D3SUrFhp.js} +2 -2
- package/dist/lime-elements/p-DpXrxCh5.js +1 -0
- package/dist/lime-elements/p-DwxRLqY6.js +1 -0
- package/dist/lime-elements/{p-c8a34cef.entry.js → p-a0501e84.entry.js} +1 -1
- package/dist/lime-elements/p-a5419b44.entry.js +1 -0
- package/dist/lime-elements/{p-ce71c5b9.entry.js → p-abd612b3.entry.js} +1 -1
- package/dist/lime-elements/{p-f3b93ce8.entry.js → p-aeac9588.entry.js} +2 -2
- package/dist/lime-elements/p-b01e8af9.entry.js +1 -0
- package/dist/lime-elements/{p-f97ec7a5.entry.js → p-b08c9b52.entry.js} +1 -1
- package/dist/lime-elements/{p-54537c85.entry.js → p-b1f6412e.entry.js} +1 -1
- package/dist/lime-elements/{p-6ae093c8.entry.js → p-b3967ab3.entry.js} +1 -1
- package/dist/lime-elements/{p-5dce791c.entry.js → p-b8bfec0e.entry.js} +1 -1
- package/dist/lime-elements/p-ba4b44ad.entry.js +1 -0
- package/dist/lime-elements/{p-783fd221.entry.js → p-bf726f16.entry.js} +1 -1
- package/dist/lime-elements/p-c2f27d2a.entry.js +1 -0
- package/dist/lime-elements/{p-271662d4.entry.js → p-c3bd19ea.entry.js} +1 -1
- package/dist/lime-elements/p-cc560bbd.entry.js +1 -0
- package/dist/lime-elements/{p-0319f07f.entry.js → p-d2953c11.entry.js} +1 -1
- package/dist/lime-elements/{p-764d2f86.entry.js → p-d3d01dd4.entry.js} +1 -1
- package/dist/lime-elements/{p-4b75e653.entry.js → p-d9e6175b.entry.js} +1 -1
- package/dist/lime-elements/p-dab5421d.entry.js +1 -0
- package/dist/lime-elements/p-dcaeefc9.entry.js +1 -0
- package/dist/lime-elements/{p-f71fbc9e.entry.js → p-df8aa135.entry.js} +4 -4
- package/dist/lime-elements/p-e2fb2af4.entry.js +1 -0
- package/dist/lime-elements/p-e929fc64.entry.js +1 -0
- package/dist/lime-elements/p-ea02dade.entry.js +1 -0
- package/dist/lime-elements/p-ecd633cb.entry.js +1 -0
- package/dist/lime-elements/{p-39d1e157.entry.js → p-f5cd53e8.entry.js} +1 -1
- package/dist/lime-elements/{p-8fe28845.entry.js → p-f7cae25a.entry.js} +1 -1
- package/dist/types/components/chart/chart.d.ts +59 -8
- package/dist/types/components/chart/chart.types.d.ts +23 -0
- package/dist/types/components/chart/options.d.ts +83 -8
- package/dist/types/components/chart/scale.d.ts +10 -0
- package/dist/types/components/chart/series.d.ts +71 -0
- package/dist/types/components/date-picker/date-formatter.d.ts +12 -0
- package/dist/types/components/date-picker/date-picker.d.ts +59 -3
- package/dist/types/components/date-picker/flatpickr-adapter/flatpickr-adapter.d.ts +13 -2
- package/dist/types/components/date-picker/pickers/month-picker.d.ts +1 -0
- package/dist/types/components/date-picker/pickers/picker.d.ts +8 -1
- package/dist/types/components/date-picker/pickers/quarter-picker.d.ts +1 -0
- package/dist/types/components/date-picker/pickers/week-picker.d.ts +4 -0
- package/dist/types/components/date-picker/pickers/year-picker.d.ts +7 -0
- package/dist/types/components/form/fields/schema-field.d.ts +2 -0
- package/dist/types/components/form/form.d.ts +2 -0
- package/dist/types/components/form/form.test-schemas.d.ts +1 -0
- package/dist/types/components/form/invalid-input.d.ts +14 -0
- package/dist/types/components/form/widgets/date-picker.d.ts +1 -0
- package/dist/types/components.d.ts +73 -26
- package/dist/types/translations/da.d.ts +2 -0
- package/dist/types/translations/de.d.ts +2 -0
- package/dist/types/translations/en.d.ts +2 -0
- package/dist/types/translations/fi.d.ts +2 -0
- package/dist/types/translations/fr.d.ts +2 -0
- package/dist/types/translations/nl.d.ts +2 -0
- package/dist/types/translations/no.d.ts +2 -0
- package/dist/types/translations/sv.d.ts +2 -0
- package/package.json +3 -3
- package/dist/cjs/language-s0bKUCvO.js +0 -58
- package/dist/esm/language-VamkUr90.js +0 -55
- package/dist/lime-elements/p-0a7cbdc3.entry.js +0 -1
- package/dist/lime-elements/p-0f96e94d.entry.js +0 -1
- package/dist/lime-elements/p-1a0c5e45.entry.js +0 -1
- package/dist/lime-elements/p-401d5c92.entry.js +0 -1
- package/dist/lime-elements/p-430db3b9.entry.js +0 -1
- package/dist/lime-elements/p-43b62587.entry.js +0 -1
- package/dist/lime-elements/p-48dccb83.entry.js +0 -1
- package/dist/lime-elements/p-5c918155.entry.js +0 -1
- package/dist/lime-elements/p-66101ed6.entry.js +0 -1
- package/dist/lime-elements/p-7ab72b52.entry.js +0 -1
- package/dist/lime-elements/p-8d602078.entry.js +0 -1
- package/dist/lime-elements/p-8d9a2a22.entry.js +0 -1
- package/dist/lime-elements/p-8de4f0f3.entry.js +0 -1
- package/dist/lime-elements/p-8e80a884.entry.js +0 -56
- package/dist/lime-elements/p-99984c66.entry.js +0 -1
- package/dist/lime-elements/p-9d46f720.entry.js +0 -1
- package/dist/lime-elements/p-9e2b426c.entry.js +0 -1
- package/dist/lime-elements/p-C9dBa_Im.js +0 -1
- package/dist/lime-elements/p-Cw7VQSGU.js +0 -1
- package/dist/lime-elements/p-N9vxZMhe.js +0 -1
- package/dist/lime-elements/p-VamkUr90.js +0 -1
- package/dist/lime-elements/p-b1c7033b.entry.js +0 -16
- package/dist/lime-elements/p-b5451350.entry.js +0 -1
- package/dist/lime-elements/p-c75f3b0d.entry.js +0 -1
- package/dist/lime-elements/p-ca4247c4.entry.js +0 -1
- package/dist/lime-elements/p-cf2d43c7.entry.js +0 -1
- package/dist/lime-elements/p-d53421af.entry.js +0 -1
- package/dist/lime-elements/p-d8901e39.entry.js +0 -1
- package/dist/lime-elements/p-d89553b3.entry.js +0 -1
- package/dist/lime-elements/p-d93b8ce0.entry.js +0 -1
- package/dist/lime-elements/p-e97340c4.entry.js +0 -1
- package/dist/lime-elements/p-eF09GxA_.js +0 -1
- package/dist/lime-elements/p-ec0c113d.entry.js +0 -1
- package/dist/lime-elements/p-f036ad27.entry.js +0 -1
- package/dist/lime-elements/p-f197000b.entry.js +0 -159
- package/dist/lime-elements/p-f5bb17eb.entry.js +0 -1
- package/dist/lime-elements/p-f6bc6658.entry.js +0 -1
- package/dist/lime-elements/p-fa1aa440.entry.js +0 -1
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import { h, Host, } from "@stencil/core";
|
|
1
|
+
import { forceUpdate, h, Host, } from "@stencil/core";
|
|
2
2
|
import { BarChart, GaugeChart, LineChart, PieChart, ScatterChart, } from "echarts/charts";
|
|
3
3
|
import { GridComponent, PolarComponent, TooltipComponent, } from "echarts/components";
|
|
4
4
|
import { init, use } from "echarts/core";
|
|
5
5
|
import { SVGRenderer } from "echarts/renderers";
|
|
6
6
|
import translate from "../../global/translations";
|
|
7
7
|
import { findNavigationTarget, findTabStop, isNavigationKey, NO_NAVIGATION_TARGET, } from "../../util/keyboard-navigation";
|
|
8
|
-
import { drawChart, fitItemTexts,
|
|
9
|
-
import { getAxisRange, isDate, MAX_AXIS_STEPS, usesAxisIncrement, } from "./scale";
|
|
8
|
+
import { drawChart, findItem, fitItemTexts, getDrawnItems, getDrawnSeries, getItemLabel, getSeriesGrid, getSeriesOfDrawnItems, getSwatchStyle, isStacked, locateItem, } from "./options";
|
|
9
|
+
import { canDrawSeries, canStack, getAxisRange, isDate, MAX_AXIS_STEPS, usesAxisIncrement, } from "./scale";
|
|
10
|
+
import { getAllItems, getAxisItems, getItemAt, getNearestSeries, } from "./series";
|
|
10
11
|
import { canWriteIn, formatValue, isCurrencyCode } from "./format";
|
|
11
12
|
import { createThemeReader, watchTheme, } from "./theme";
|
|
12
13
|
const orientations = ['horizontal', 'vertical'];
|
|
14
|
+
const SERIES_COLOR_COUNT = 8;
|
|
15
|
+
const getDefaultSeriesColor = (index) => `var(--limel-chart-series-color-${(index % SERIES_COLOR_COUNT) + 1})`;
|
|
16
|
+
const copyItem = (item) => ({
|
|
17
|
+
text: item.text,
|
|
18
|
+
value: item.value,
|
|
19
|
+
formattedValue: item.formattedValue,
|
|
20
|
+
color: item.color,
|
|
21
|
+
clickable: item.clickable,
|
|
22
|
+
});
|
|
13
23
|
const extensions = [
|
|
14
24
|
BarChart,
|
|
15
25
|
GaugeChart,
|
|
@@ -30,8 +40,6 @@ const extensions = [
|
|
|
30
40
|
* @exampleComponent limel-example-chart-orientation
|
|
31
41
|
* @exampleComponent limel-example-chart-max-value
|
|
32
42
|
* @exampleComponent limel-example-chart-display-item-percentage
|
|
33
|
-
* @exampleComponent limel-example-chart-value-format
|
|
34
|
-
* @exampleComponent limel-example-chart-value-format-date
|
|
35
43
|
* @exampleComponent limel-example-chart-type-bar
|
|
36
44
|
* @exampleComponent limel-example-chart-type-dot
|
|
37
45
|
* @exampleComponent limel-example-chart-type-area
|
|
@@ -47,9 +55,13 @@ const extensions = [
|
|
|
47
55
|
* @exampleComponent limel-example-chart-multi-axis-area-with-negative-start-values
|
|
48
56
|
* @exampleComponent limel-example-chart-type-scatter-negative
|
|
49
57
|
* @exampleComponent limel-example-chart-axis-increment
|
|
58
|
+
* @exampleComponent limel-example-chart-value-format
|
|
59
|
+
* @exampleComponent limel-example-chart-value-format-date
|
|
50
60
|
* @exampleComponent limel-example-chart-clickable-items
|
|
51
61
|
* @exampleComponent limel-example-chart-accessibility
|
|
52
62
|
* @exampleComponent limel-example-chart-axis-labels
|
|
63
|
+
* @exampleComponent limel-example-chart-series
|
|
64
|
+
* @exampleComponent limel-example-chart-series-stacked
|
|
53
65
|
* @exampleComponent limel-example-chart-styling
|
|
54
66
|
* @beta
|
|
55
67
|
*/
|
|
@@ -86,6 +98,15 @@ export class Chart {
|
|
|
86
98
|
* Applies to `proportion-bar`, `pie`, `doughnut`, and `ring` charts.
|
|
87
99
|
*/
|
|
88
100
|
this.displayItemPercentage = true;
|
|
101
|
+
/**
|
|
102
|
+
* Stacks the `series` on each other, so that each place on the axis
|
|
103
|
+
* shows their total, such as the revenue of each product, which adds up
|
|
104
|
+
* to the revenue of the month. Positive and negative values are stacked
|
|
105
|
+
* on their own side of zero, and a range adds its extent to the stack.
|
|
106
|
+
* Applies to `bar`, `line`, and `area` charts, but not when
|
|
107
|
+
* `valueFormat` is `date`.
|
|
108
|
+
*/
|
|
109
|
+
this.stacked = false;
|
|
89
110
|
/**
|
|
90
111
|
* Defines how items are visualized in the chart.
|
|
91
112
|
* `stacked-bar` is the old name of `proportion-bar`. It still works, but
|
|
@@ -114,7 +135,9 @@ export class Chart {
|
|
|
114
135
|
/**
|
|
115
136
|
* The item that last had focus, which is the one that Tab returns to.
|
|
116
137
|
*/
|
|
117
|
-
this.
|
|
138
|
+
this.focusedPosition = { series: 0, index: 0 };
|
|
139
|
+
this.grid = { categories: [], series: [] };
|
|
140
|
+
this.seriesColors = [];
|
|
118
141
|
this.themeMayHaveChanged = false;
|
|
119
142
|
this.warnings = new Map();
|
|
120
143
|
this.invalidColors = new Set();
|
|
@@ -133,7 +156,7 @@ export class Chart {
|
|
|
133
156
|
if (!this.drawing) {
|
|
134
157
|
return;
|
|
135
158
|
}
|
|
136
|
-
const item = this.getClickableItem(
|
|
159
|
+
const item = this.getClickableItem(this.getClickedPosition(event));
|
|
137
160
|
if (!item) {
|
|
138
161
|
return;
|
|
139
162
|
}
|
|
@@ -147,7 +170,7 @@ export class Chart {
|
|
|
147
170
|
this.highlightItemAt(event, false);
|
|
148
171
|
};
|
|
149
172
|
this.handleClick = (event) => {
|
|
150
|
-
const item = this.getClickableItem(this.
|
|
173
|
+
const item = this.getClickableItem(this.getEventPosition(event));
|
|
151
174
|
if (!item) {
|
|
152
175
|
return;
|
|
153
176
|
}
|
|
@@ -158,13 +181,13 @@ export class Chart {
|
|
|
158
181
|
const orientation = orientations.find((option) => isNavigationKey(event, { orientation: option }));
|
|
159
182
|
if (orientation) {
|
|
160
183
|
event.preventDefault();
|
|
161
|
-
this.focusItem(
|
|
184
|
+
this.focusItem(this.findTarget(event.key, this.getEventPosition(event), orientation));
|
|
162
185
|
return;
|
|
163
186
|
}
|
|
164
187
|
if (event.key !== 'Enter' && event.key !== ' ') {
|
|
165
188
|
return;
|
|
166
189
|
}
|
|
167
|
-
const item = this.getClickableItem(this.
|
|
190
|
+
const item = this.getClickableItem(this.getEventPosition(event));
|
|
168
191
|
if (!item) {
|
|
169
192
|
return;
|
|
170
193
|
}
|
|
@@ -172,9 +195,9 @@ export class Chart {
|
|
|
172
195
|
this.interact.emit(item);
|
|
173
196
|
};
|
|
174
197
|
this.handleFocus = (event) => {
|
|
175
|
-
const
|
|
176
|
-
this.
|
|
177
|
-
this.showItem(
|
|
198
|
+
const element = event.currentTarget;
|
|
199
|
+
this.focusedPosition = this.getPosition(element);
|
|
200
|
+
this.showItem(element, true);
|
|
178
201
|
};
|
|
179
202
|
this.handleBlur = (event) => {
|
|
180
203
|
this.showItem(event.currentTarget, false);
|
|
@@ -184,10 +207,17 @@ export class Chart {
|
|
|
184
207
|
this.warnAboutOldTypeName();
|
|
185
208
|
}
|
|
186
209
|
componentWillRender() {
|
|
210
|
+
this.grid = getSeriesGrid({
|
|
211
|
+
type: this.chartType,
|
|
212
|
+
items: this.items,
|
|
213
|
+
series: this.series,
|
|
214
|
+
});
|
|
187
215
|
this.warnOnChange('axisIncrement', this.getAxisIncrementWarning());
|
|
188
216
|
this.warnOnChange('language', this.getLanguageWarning());
|
|
189
217
|
this.warnOnChange('currency', this.getCurrencyWarning());
|
|
190
218
|
this.warnOnChange('items', this.getDateWarning());
|
|
219
|
+
this.warnOnChange('series', this.getSeriesWarning());
|
|
220
|
+
this.warnOnChange('stacked', this.getStackedWarning());
|
|
191
221
|
}
|
|
192
222
|
connectedCallback() {
|
|
193
223
|
this.draw();
|
|
@@ -229,11 +259,10 @@ export class Chart {
|
|
|
229
259
|
return `limel-chart: \`currency\` must be a three-letter code such as \`SEK\` when \`valueFormat\` is \`currency\`, but was ${JSON.stringify(this.currency)}. Writing the values as numbers instead.`;
|
|
230
260
|
}
|
|
231
261
|
getDateWarning() {
|
|
232
|
-
var _a;
|
|
233
262
|
if (this.valueFormat !== 'date') {
|
|
234
263
|
return;
|
|
235
264
|
}
|
|
236
|
-
const wrong = (
|
|
265
|
+
const wrong = getAllItems(this.grid)
|
|
237
266
|
.flatMap((item) => [item.value].flat())
|
|
238
267
|
.find((value) => !isDate(value));
|
|
239
268
|
if (wrong === undefined) {
|
|
@@ -242,6 +271,56 @@ export class Chart {
|
|
|
242
271
|
const shown = typeof wrong === 'number' ? wrong : JSON.stringify(wrong);
|
|
243
272
|
return `limel-chart: with \`valueFormat\` \`date\`, each value must be a date in milliseconds since 1970, as \`Date.getTime()\` gives, but was ${shown}. Showing it as it is.`;
|
|
244
273
|
}
|
|
274
|
+
getSeriesWarning() {
|
|
275
|
+
var _a, _b, _c;
|
|
276
|
+
if (!((_a = this.series) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
if (!canDrawSeries(this.chartType)) {
|
|
280
|
+
const drawn = ((_b = this.items) === null || _b === void 0 ? void 0 : _b.length)
|
|
281
|
+
? '`items`'
|
|
282
|
+
: 'the items of the first series';
|
|
283
|
+
return `limel-chart: \`series\` can only be drawn by \`bar\`, \`dot\`, \`line\`, and \`area\` charts, but \`type\` is \`${this.type}\`. Drawing ${drawn} instead.`;
|
|
284
|
+
}
|
|
285
|
+
if ((_c = this.items) === null || _c === void 0 ? void 0 : _c.length) {
|
|
286
|
+
return 'limel-chart: both `items` and `series` are set. Drawing `series`, and leaving out `items`.';
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
getStackedWarning() {
|
|
290
|
+
if (!this.stacked) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
if (!canStack(this.chartType)) {
|
|
294
|
+
return `limel-chart: \`stacked\` can only stack the series of \`bar\`, \`line\`, and \`area\` charts, but \`type\` is \`${this.type}\`. Ignoring \`stacked\`.`;
|
|
295
|
+
}
|
|
296
|
+
if (this.valueFormat === 'date') {
|
|
297
|
+
return 'limel-chart: `stacked` cannot stack dates. Ignoring `stacked`.';
|
|
298
|
+
}
|
|
299
|
+
if (!this.drawsSeries) {
|
|
300
|
+
return 'limel-chart: `stacked` stacks the `series` of a chart, but this chart has none. Ignoring `stacked`.';
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
get stacksSeries() {
|
|
304
|
+
return isStacked({
|
|
305
|
+
type: this.chartType,
|
|
306
|
+
series: this.series,
|
|
307
|
+
stacked: this.stacked,
|
|
308
|
+
valueFormat: this.valueFormat,
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
get drawsSeries() {
|
|
312
|
+
return Boolean(this.drawnSeries);
|
|
313
|
+
}
|
|
314
|
+
get drawnSeries() {
|
|
315
|
+
return getDrawnSeries({ type: this.chartType, series: this.series });
|
|
316
|
+
}
|
|
317
|
+
get drawnItems() {
|
|
318
|
+
return getDrawnItems({
|
|
319
|
+
type: this.chartType,
|
|
320
|
+
items: this.items,
|
|
321
|
+
series: this.series,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
245
324
|
get valueStyle() {
|
|
246
325
|
return {
|
|
247
326
|
type: this.chartType,
|
|
@@ -254,7 +333,6 @@ export class Chart {
|
|
|
254
333
|
return this.type === 'stacked-bar' ? 'proportion-bar' : this.type;
|
|
255
334
|
}
|
|
256
335
|
getAxisIncrementWarning() {
|
|
257
|
-
var _a;
|
|
258
336
|
const increment = this.axisIncrement;
|
|
259
337
|
if (increment === undefined ||
|
|
260
338
|
increment === null ||
|
|
@@ -267,7 +345,7 @@ export class Chart {
|
|
|
267
345
|
if (!usesAxisIncrement(this.chartType)) {
|
|
268
346
|
return;
|
|
269
347
|
}
|
|
270
|
-
const range = getAxisRange((
|
|
348
|
+
const range = getAxisRange(getAxisItems(this.grid, this.stacksSeries), this.maxValue, increment);
|
|
271
349
|
if (range.increment !== increment) {
|
|
272
350
|
return `limel-chart: \`axisIncrement\` ${increment} would divide the axis into more than ${MAX_AXIS_STEPS} steps. Working out a step from the values instead.`;
|
|
273
351
|
}
|
|
@@ -276,7 +354,19 @@ export class Chart {
|
|
|
276
354
|
if (this.loading) {
|
|
277
355
|
return h("limel-spinner", { limeBranded: false });
|
|
278
356
|
}
|
|
279
|
-
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.
|
|
357
|
+
return (h(Host, null, this.renderLegend(), h("div", { class: "plot", "aria-hidden": "true", ref: this.setPlot }), h("table", { "aria-live": "polite" }, this.renderCaption(), this.renderTableHeader(), h("tbody", null, this.drawsSeries
|
|
358
|
+
? this.renderCategories()
|
|
359
|
+
: this.renderItems()))));
|
|
360
|
+
}
|
|
361
|
+
get hasLegend() {
|
|
362
|
+
var _a, _b;
|
|
363
|
+
return ((_b = (_a = this.drawnSeries) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 1;
|
|
364
|
+
}
|
|
365
|
+
renderLegend() {
|
|
366
|
+
if (!this.hasLegend) {
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
return (h("ul", { "aria-hidden": "true" }, this.drawnSeries.map((series, index) => (h("li", null, h("span", { style: getSwatchStyle(this.chartType, this.seriesColors[index]) }), series.text)))));
|
|
280
370
|
}
|
|
281
371
|
renderCaption() {
|
|
282
372
|
if (!this.accessibleLabel) {
|
|
@@ -285,7 +375,18 @@ export class Chart {
|
|
|
285
375
|
return h("caption", null, this.accessibleLabel);
|
|
286
376
|
}
|
|
287
377
|
renderTableHeader() {
|
|
288
|
-
|
|
378
|
+
var _a, _b;
|
|
379
|
+
const columns = (_b = (_a = this.drawnSeries) === null || _a === void 0 ? void 0 : _a.map((series) => series.text)) !== null && _b !== void 0 ? _b : [
|
|
380
|
+
this.valuesLabel,
|
|
381
|
+
];
|
|
382
|
+
return (h("thead", null, this.renderSeriesGroupHeader(), h("tr", null, h("th", { scope: "col" }, this.itemsLabel), columns.map((column) => (h("th", { scope: "col" }, column))))));
|
|
383
|
+
}
|
|
384
|
+
renderSeriesGroupHeader() {
|
|
385
|
+
const allSeries = this.drawnSeries;
|
|
386
|
+
if (!allSeries || !this.accessibleValuesLabel) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
return (h("tr", null, h("td", null), h("th", { scope: "col", colSpan: allSeries.length }, this.accessibleValuesLabel)));
|
|
289
390
|
}
|
|
290
391
|
get itemsLabel() {
|
|
291
392
|
var _a;
|
|
@@ -296,13 +397,46 @@ export class Chart {
|
|
|
296
397
|
return ((_a = this.accessibleValuesLabel) !== null && _a !== void 0 ? _a : translate.get('value', this.language));
|
|
297
398
|
}
|
|
298
399
|
renderItems() {
|
|
299
|
-
|
|
300
|
-
const tabStop = findTabStop(
|
|
301
|
-
return
|
|
400
|
+
const items = this.drawnItems;
|
|
401
|
+
const tabStop = findTabStop(items, this.focusedPosition.index);
|
|
402
|
+
return items.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.valueStyle)))));
|
|
302
403
|
}
|
|
303
404
|
getRowDescription(index) {
|
|
304
|
-
const
|
|
305
|
-
|
|
405
|
+
const items = this.drawnItems;
|
|
406
|
+
const label = getItemLabel(Object.assign(Object.assign({}, this.valueStyle), { items: items, maxValue: this.maxValue, displayItemPercentage: this.displayItemPercentage }), index);
|
|
407
|
+
return label === items[index].text ? undefined : label;
|
|
408
|
+
}
|
|
409
|
+
renderCategories() {
|
|
410
|
+
const grid = this.grid;
|
|
411
|
+
const tabStop = this.findTabStopInGrid(grid);
|
|
412
|
+
return grid.categories.map((category, index) => (h("tr", null, h("th", { scope: "row" }, category), grid.series.map((series, seriesIndex) => this.renderCell(series.items[index], { series: seriesIndex, index: index }, tabStop)))));
|
|
413
|
+
}
|
|
414
|
+
renderCell(item, position, tabStop) {
|
|
415
|
+
if (!item) {
|
|
416
|
+
return h("td", null);
|
|
417
|
+
}
|
|
418
|
+
const isTabStop = position.series === (tabStop === null || tabStop === void 0 ? void 0 : tabStop.series) &&
|
|
419
|
+
position.index === (tabStop === null || tabStop === void 0 ? void 0 : tabStop.index);
|
|
420
|
+
return (h("td", { "data-series": position.series, "data-index": position.index, tabIndex: isTabStop ? 0 : -1, role: item.clickable ? 'button' : undefined, "aria-label": item.clickable ? this.getButtonLabel(item, position) : null, onClick: this.handleClick, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }, formatValue(item, this.valueStyle)));
|
|
421
|
+
}
|
|
422
|
+
getButtonLabel(item, position) {
|
|
423
|
+
return [
|
|
424
|
+
this.grid.categories[position.index],
|
|
425
|
+
this.grid.series[position.series].text,
|
|
426
|
+
formatValue(item, this.valueStyle),
|
|
427
|
+
].join(', ');
|
|
428
|
+
}
|
|
429
|
+
findTabStopInGrid(grid) {
|
|
430
|
+
const focused = this.focusedPosition;
|
|
431
|
+
if (getItemAt(grid, focused)) {
|
|
432
|
+
return focused;
|
|
433
|
+
}
|
|
434
|
+
const first = { series: 0, index: 0 };
|
|
435
|
+
const series = getNearestSeries(grid, first);
|
|
436
|
+
if (series === undefined) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
return Object.assign(Object.assign({}, first), { series: series });
|
|
306
440
|
}
|
|
307
441
|
draw() {
|
|
308
442
|
var _a;
|
|
@@ -379,20 +513,23 @@ export class Chart {
|
|
|
379
513
|
this.chart.on('mouseout', this.handleChartOut);
|
|
380
514
|
}
|
|
381
515
|
updateChart() {
|
|
382
|
-
var _a, _b;
|
|
516
|
+
var _a, _b, _c, _d;
|
|
383
517
|
const settings = this.getSettings();
|
|
384
518
|
const drawnSettings = JSON.stringify(settings);
|
|
385
519
|
if (drawnSettings === this.drawnSettings && !this.themeMayHaveChanged) {
|
|
386
520
|
return;
|
|
387
521
|
}
|
|
388
522
|
this.themeMayHaveChanged = false;
|
|
389
|
-
(_a = this.
|
|
390
|
-
|
|
391
|
-
const theme = this.themeReader.theme();
|
|
523
|
+
(_a = this.stopWatchingTheme) !== null && _a !== void 0 ? _a : (this.stopWatchingTheme = watchTheme(this.host, this.handleThemeChange));
|
|
524
|
+
const theme = this.getThemeReader().theme();
|
|
392
525
|
const coloredSettings = this.withItemColors(settings, theme);
|
|
393
526
|
const drawnTheme = JSON.stringify({
|
|
394
527
|
theme: theme,
|
|
395
528
|
itemColors: coloredSettings.items.map((item) => item.color),
|
|
529
|
+
seriesColors: (_b = coloredSettings.series) === null || _b === void 0 ? void 0 : _b.map((series) => [
|
|
530
|
+
series.color,
|
|
531
|
+
...series.items.map((item) => item.color),
|
|
532
|
+
]),
|
|
396
533
|
});
|
|
397
534
|
if (drawnSettings === this.drawnSettings &&
|
|
398
535
|
drawnTheme === this.drawnTheme) {
|
|
@@ -402,9 +539,10 @@ export class Chart {
|
|
|
402
539
|
this.drawnTheme = drawnTheme;
|
|
403
540
|
this.drawing = drawChart(coloredSettings, theme, this.itemSpace);
|
|
404
541
|
this.chart.setOption(this.drawing.option, { notMerge: true });
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
542
|
+
this.showSeriesColors((_d = (_c = coloredSettings.series) === null || _c === void 0 ? void 0 : _c.map((series) => series.color)) !== null && _d !== void 0 ? _d : []);
|
|
543
|
+
const focused = this.host.shadowRoot.activeElement;
|
|
544
|
+
if (focused instanceof HTMLElement && focused.dataset.index) {
|
|
545
|
+
this.showItem(focused, true);
|
|
408
546
|
}
|
|
409
547
|
}
|
|
410
548
|
fitItemTextsToSize() {
|
|
@@ -424,33 +562,74 @@ export class Chart {
|
|
|
424
562
|
}
|
|
425
563
|
getSettings() {
|
|
426
564
|
var _a;
|
|
427
|
-
return Object.assign(Object.assign({ items: ((_a = this.
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
565
|
+
return Object.assign(Object.assign({ items: this.drawnItems.map((item) => copyItem(item)), series: (_a = this.drawnSeries) === null || _a === void 0 ? void 0 : _a.map((series) => {
|
|
566
|
+
var _a;
|
|
567
|
+
return ({
|
|
568
|
+
text: series.text,
|
|
569
|
+
color: series.color,
|
|
570
|
+
items: ((_a = series.items) !== null && _a !== void 0 ? _a : []).map((item) => copyItem(item)),
|
|
571
|
+
});
|
|
572
|
+
}), stacked: this.stacksSeries }, this.valueStyle), { orientation: this.orientation, maxValue: this.maxValue, axisIncrement: this.axisIncrement, displayAxisLabels: this.displayAxisLabels, itemsLabel: this.itemsLabel, valuesLabel: this.valuesLabel, displayItemText: this.displayItemText, displayItemValue: this.displayItemValue, displayItemPercentage: this.displayItemPercentage });
|
|
434
573
|
}
|
|
435
574
|
withItemColors(settings, theme) {
|
|
436
|
-
|
|
575
|
+
var _a;
|
|
576
|
+
const seriesOfItems = getSeriesOfDrawnItems({
|
|
577
|
+
type: this.chartType,
|
|
578
|
+
items: this.items,
|
|
579
|
+
series: this.series,
|
|
580
|
+
});
|
|
581
|
+
const itemColor = seriesOfItems
|
|
582
|
+
? this.getSeriesColor(seriesOfItems, 0, theme)
|
|
583
|
+
: theme.itemColor;
|
|
584
|
+
const itemFallback = seriesOfItems
|
|
585
|
+
? 'the color of its series'
|
|
586
|
+
: 'the default item color';
|
|
587
|
+
return Object.assign(Object.assign({}, settings), { items: settings.items.map((item) => {
|
|
588
|
+
var _a;
|
|
589
|
+
return (Object.assign(Object.assign({}, item), { color: (_a = this.readColor(item.color, 'item', itemFallback)) !== null && _a !== void 0 ? _a : itemColor }));
|
|
590
|
+
}), series: (_a = settings.series) === null || _a === void 0 ? void 0 : _a.map((series, index) => {
|
|
591
|
+
const color = this.getSeriesColor(series, index, theme);
|
|
592
|
+
return Object.assign(Object.assign({}, series), { color: color, items: series.items.map((item) => {
|
|
593
|
+
var _a;
|
|
594
|
+
return (Object.assign(Object.assign({}, item), { color: (_a = this.readColor(item.color, 'item', 'the color of its series')) !== null && _a !== void 0 ? _a : color }));
|
|
595
|
+
}) });
|
|
596
|
+
}) });
|
|
437
597
|
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
598
|
+
getSeriesColor(series, index, theme) {
|
|
599
|
+
var _a, _b;
|
|
600
|
+
return ((_b = (_a = this.readColor(series.color, 'series', 'the default series color')) !== null && _a !== void 0 ? _a : this.getThemeReader().color(getDefaultSeriesColor(index))) !== null && _b !== void 0 ? _b : theme.itemColor);
|
|
601
|
+
}
|
|
602
|
+
showSeriesColors(colors) {
|
|
603
|
+
const shown = this.seriesColors;
|
|
604
|
+
const same = colors.length === shown.length &&
|
|
605
|
+
colors.every((color, index) => color === shown[index]);
|
|
606
|
+
if (same) {
|
|
607
|
+
return;
|
|
441
608
|
}
|
|
442
|
-
|
|
443
|
-
if (
|
|
444
|
-
|
|
609
|
+
this.seriesColors = colors;
|
|
610
|
+
if (this.hasLegend) {
|
|
611
|
+
forceUpdate(this);
|
|
445
612
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
613
|
+
}
|
|
614
|
+
readColor(color, owner, fallback) {
|
|
615
|
+
if (!color) {
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
const resolved = this.getThemeReader().color(color);
|
|
619
|
+
if (!resolved && !this.invalidColors.has(color)) {
|
|
620
|
+
this.invalidColors.add(color);
|
|
621
|
+
const hint = color.includes('var(')
|
|
449
622
|
? ' Check that its variables are set, and that they make a color.'
|
|
450
623
|
: '';
|
|
451
|
-
|
|
624
|
+
const article = owner === 'item' ? 'an' : 'a';
|
|
625
|
+
console.warn(`limel-chart: the color of ${article} ${owner} must be a CSS color, but was \`${color}\`.${hint} Using ${fallback} instead.`);
|
|
452
626
|
}
|
|
453
|
-
return
|
|
627
|
+
return resolved;
|
|
628
|
+
}
|
|
629
|
+
getThemeReader() {
|
|
630
|
+
var _a;
|
|
631
|
+
(_a = this.themeReader) !== null && _a !== void 0 ? _a : (this.themeReader = createThemeReader(this.host.shadowRoot));
|
|
632
|
+
return this.themeReader;
|
|
454
633
|
}
|
|
455
634
|
observeSize() {
|
|
456
635
|
if (this.resizeObserver || typeof ResizeObserver === 'undefined') {
|
|
@@ -468,40 +647,102 @@ export class Chart {
|
|
|
468
647
|
this.drawnTheme = undefined;
|
|
469
648
|
this.itemSpace = undefined;
|
|
470
649
|
}
|
|
650
|
+
getClickedPosition(event) {
|
|
651
|
+
const position = findItem(this.drawing, event);
|
|
652
|
+
if (event.seriesType !== 'line' || !event.event) {
|
|
653
|
+
return position;
|
|
654
|
+
}
|
|
655
|
+
return Object.assign(Object.assign({}, position), { index: this.getNearestPlace(event.event) });
|
|
656
|
+
}
|
|
657
|
+
getNearestPlace(pixel) {
|
|
658
|
+
const landscape = this.orientation === 'landscape';
|
|
659
|
+
const place = this.chart.convertFromPixel(landscape ? { xAxisIndex: 0 } : { yAxisIndex: 0 }, landscape ? pixel.offsetX : pixel.offsetY);
|
|
660
|
+
return Math.round(place);
|
|
661
|
+
}
|
|
471
662
|
highlightItemAt(event, highlight) {
|
|
472
663
|
if (!this.drawing) {
|
|
473
664
|
return;
|
|
474
665
|
}
|
|
475
|
-
const location = locateItem(this.drawing,
|
|
666
|
+
const location = locateItem(this.drawing, findItem(this.drawing, event));
|
|
476
667
|
if (location.seriesIndex === event.seriesIndex) {
|
|
477
668
|
return;
|
|
478
669
|
}
|
|
479
670
|
this.chart.dispatchAction(Object.assign({ type: highlight ? 'highlight' : 'downplay' }, location));
|
|
480
671
|
}
|
|
481
|
-
getClickableItem(
|
|
482
|
-
const item = this.
|
|
672
|
+
getClickableItem(position) {
|
|
673
|
+
const item = getItemAt(this.grid, position);
|
|
483
674
|
if (!(item === null || item === void 0 ? void 0 : item.clickable)) {
|
|
484
675
|
return;
|
|
485
676
|
}
|
|
486
677
|
return item;
|
|
487
678
|
}
|
|
488
|
-
|
|
489
|
-
|
|
679
|
+
getPosition(element) {
|
|
680
|
+
var _a;
|
|
681
|
+
return {
|
|
682
|
+
series: Number((_a = element.dataset.series) !== null && _a !== void 0 ? _a : 0),
|
|
683
|
+
index: Number(element.dataset.index),
|
|
684
|
+
};
|
|
490
685
|
}
|
|
491
|
-
|
|
492
|
-
|
|
686
|
+
getEventPosition(event) {
|
|
687
|
+
return this.getPosition(event.currentTarget);
|
|
688
|
+
}
|
|
689
|
+
findTarget(key, position, orientation) {
|
|
690
|
+
if (!this.drawsSeries) {
|
|
691
|
+
const items = this.drawnItems;
|
|
692
|
+
const index = findNavigationTarget(items, key, position.index, {
|
|
693
|
+
orientation: orientation,
|
|
694
|
+
});
|
|
695
|
+
return { series: 0, index: index };
|
|
696
|
+
}
|
|
697
|
+
const grid = this.grid;
|
|
698
|
+
if (orientation === 'horizontal') {
|
|
699
|
+
const items = grid.series.map((series) => series.items[position.index]);
|
|
700
|
+
const series = findNavigationTarget(items, key, position.series, {
|
|
701
|
+
orientation: orientation,
|
|
702
|
+
isDisabled: (item) => !item,
|
|
703
|
+
});
|
|
704
|
+
return { series: series, index: position.index };
|
|
705
|
+
}
|
|
706
|
+
const index = findNavigationTarget(grid.categories, key, position.index, { orientation: orientation });
|
|
707
|
+
const series = getNearestSeries(grid, {
|
|
708
|
+
series: position.series,
|
|
709
|
+
index: index,
|
|
710
|
+
});
|
|
711
|
+
return { series: series !== null && series !== void 0 ? series : NO_NAVIGATION_TARGET, index: index };
|
|
712
|
+
}
|
|
713
|
+
focusItem(position) {
|
|
714
|
+
if (position.series === NO_NAVIGATION_TARGET ||
|
|
715
|
+
position.index === NO_NAVIGATION_TARGET) {
|
|
493
716
|
return;
|
|
494
717
|
}
|
|
495
|
-
const
|
|
496
|
-
|
|
718
|
+
const series = this.drawsSeries
|
|
719
|
+
? `[data-series="${position.series}"]`
|
|
720
|
+
: '';
|
|
721
|
+
const element = this.host.shadowRoot.querySelector(`tbody [data-index="${position.index}"]${series}`);
|
|
722
|
+
element === null || element === void 0 ? void 0 : element.focus();
|
|
497
723
|
}
|
|
498
|
-
showItem(
|
|
724
|
+
showItem(element, show) {
|
|
499
725
|
if (!this.chart || !this.drawing) {
|
|
500
726
|
return;
|
|
501
727
|
}
|
|
502
|
-
const
|
|
728
|
+
const position = this.getPosition(element);
|
|
729
|
+
const location = locateItem(this.drawing, position);
|
|
503
730
|
this.chart.dispatchAction(Object.assign({ type: show ? 'highlight' : 'downplay' }, location));
|
|
504
|
-
|
|
731
|
+
if (!show) {
|
|
732
|
+
this.chart.dispatchAction(this.drawsSeries
|
|
733
|
+
? { type: 'updateAxisPointer', currTrigger: 'leave' }
|
|
734
|
+
: { type: 'hideTip' });
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
this.chart.dispatchAction(Object.assign({ type: 'showTip' }, (this.drawsSeries
|
|
738
|
+
? this.getMiddleOfPlace(position.index)
|
|
739
|
+
: location)));
|
|
740
|
+
}
|
|
741
|
+
getMiddleOfPlace(index) {
|
|
742
|
+
const { minValue, maxValue } = this.drawing.valueRange;
|
|
743
|
+
const middle = (minValue + maxValue) / 2;
|
|
744
|
+
const [x, y] = this.chart.convertToPixel({ gridIndex: 0 }, this.orientation === 'landscape' ? [index, middle] : [middle, index]);
|
|
745
|
+
return { x: x, y: y };
|
|
505
746
|
}
|
|
506
747
|
static get is() { return "limel-chart"; }
|
|
507
748
|
static get encapsulation() { return "shadow"; }
|
|
@@ -594,7 +835,7 @@ export class Chart {
|
|
|
594
835
|
"optional": true,
|
|
595
836
|
"docs": {
|
|
596
837
|
"tags": [],
|
|
597
|
-
"text": "Helps users of assistive technologies to understand\nwhat the values in the chart represent.\nDefaults to the translation for \"value\" in the current language."
|
|
838
|
+
"text": "Helps users of assistive technologies to understand\nwhat the values in the chart represent.\nDefaults to the translation for \"value\" in the current language.\nIn a chart with series, the series name the columns of values, and\nthis label, when it is set, heads them all."
|
|
598
839
|
},
|
|
599
840
|
"getter": false,
|
|
600
841
|
"setter": false,
|
|
@@ -696,8 +937,8 @@ export class Chart {
|
|
|
696
937
|
}
|
|
697
938
|
}
|
|
698
939
|
},
|
|
699
|
-
"required":
|
|
700
|
-
"optional":
|
|
940
|
+
"required": false,
|
|
941
|
+
"optional": true,
|
|
701
942
|
"docs": {
|
|
702
943
|
"tags": [],
|
|
703
944
|
"text": "List of items in the chart,\neach representing a data point."
|
|
@@ -705,6 +946,50 @@ export class Chart {
|
|
|
705
946
|
"getter": false,
|
|
706
947
|
"setter": false
|
|
707
948
|
},
|
|
949
|
+
"series": {
|
|
950
|
+
"type": "unknown",
|
|
951
|
+
"mutable": false,
|
|
952
|
+
"complexType": {
|
|
953
|
+
"original": "ChartSeries[]",
|
|
954
|
+
"resolved": "ChartSeries[]",
|
|
955
|
+
"references": {
|
|
956
|
+
"ChartSeries": {
|
|
957
|
+
"location": "import",
|
|
958
|
+
"path": "./chart.types",
|
|
959
|
+
"id": "src/components/chart/chart.types.ts::ChartSeries",
|
|
960
|
+
"referenceLocation": "ChartSeries"
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
},
|
|
964
|
+
"required": false,
|
|
965
|
+
"optional": true,
|
|
966
|
+
"docs": {
|
|
967
|
+
"tags": [],
|
|
968
|
+
"text": "Groups of items that are drawn side by side, each in a color of its\nown, such as the revenue and the costs of each month. Items of\ndifferent series that have the same `text` are drawn together, at the\nsame place on the axis. When there are two series or more, a legend\nnames them.\n\n`bar`, `dot`, `line`, and `area` charts draw `series` instead of\n`items`. Other types draw `items`, or the items of the first series\nwhen `items` is not set."
|
|
969
|
+
},
|
|
970
|
+
"getter": false,
|
|
971
|
+
"setter": false
|
|
972
|
+
},
|
|
973
|
+
"stacked": {
|
|
974
|
+
"type": "boolean",
|
|
975
|
+
"mutable": false,
|
|
976
|
+
"complexType": {
|
|
977
|
+
"original": "boolean",
|
|
978
|
+
"resolved": "boolean",
|
|
979
|
+
"references": {}
|
|
980
|
+
},
|
|
981
|
+
"required": false,
|
|
982
|
+
"optional": false,
|
|
983
|
+
"docs": {
|
|
984
|
+
"tags": [],
|
|
985
|
+
"text": "Stacks the `series` on each other, so that each place on the axis\nshows their total, such as the revenue of each product, which adds up\nto the revenue of the month. Positive and negative values are stacked\non their own side of zero, and a range adds its extent to the stack.\nApplies to `bar`, `line`, and `area` charts, but not when\n`valueFormat` is `date`."
|
|
986
|
+
},
|
|
987
|
+
"getter": false,
|
|
988
|
+
"setter": false,
|
|
989
|
+
"reflect": true,
|
|
990
|
+
"attribute": "stacked",
|
|
991
|
+
"defaultValue": "false"
|
|
992
|
+
},
|
|
708
993
|
"type": {
|
|
709
994
|
"type": "string",
|
|
710
995
|
"mutable": false,
|
|
@@ -860,7 +1145,7 @@ export class Chart {
|
|
|
860
1145
|
}
|
|
861
1146
|
static get states() {
|
|
862
1147
|
return {
|
|
863
|
-
"
|
|
1148
|
+
"focusedPosition": {}
|
|
864
1149
|
};
|
|
865
1150
|
}
|
|
866
1151
|
static get events() {
|
|
@@ -872,7 +1157,7 @@ export class Chart {
|
|
|
872
1157
|
"composed": true,
|
|
873
1158
|
"docs": {
|
|
874
1159
|
"tags": [],
|
|
875
|
-
"text": "Fired when a chart item with `clickable` set to `true` is clicked"
|
|
1160
|
+
"text": "Fired when a chart item with `clickable` set to `true` is clicked.\nThe detail is the item itself, the same object as in `items` or in\n`series`, so a chart with series can tell which series the item\nbelongs to by comparing it with the items of each series."
|
|
876
1161
|
},
|
|
877
1162
|
"complexType": {
|
|
878
1163
|
"original": "ChartItem",
|