@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,7 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-
|
|
2
|
-
import { t as translations } from './translations
|
|
3
|
-
import { i as isNavigationKey, f as
|
|
4
|
-
import { g as getSupportedLocale } from './language-VamkUr90.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, f as forceUpdate, a as getElement } from './index-D3SUrFhp.js';
|
|
2
|
+
import { g as getSupportedLocale, t as translations } from './translations--i932i_D.js';
|
|
3
|
+
import { i as isNavigationKey, f as findTabStop, a as findNavigationTarget, N as NO_NAVIGATION_TARGET } from './keyboard-navigation-DeMxdkNf.js';
|
|
5
4
|
import './keycodes-DQ5DmW_Y.js';
|
|
6
5
|
|
|
7
6
|
/*! *****************************************************************************
|
|
@@ -25329,7 +25328,7 @@ var tmpNotUsedArr = [];
|
|
|
25329
25328
|
* specific language governing permissions and limitations
|
|
25330
25329
|
* under the License.
|
|
25331
25330
|
*/
|
|
25332
|
-
var AXIS_TYPES = {
|
|
25331
|
+
var AXIS_TYPES$1 = {
|
|
25333
25332
|
value: 1,
|
|
25334
25333
|
category: 1,
|
|
25335
25334
|
time: 1,
|
|
@@ -25345,7 +25344,7 @@ function determineAxisType(model) {
|
|
|
25345
25344
|
// PENDING: Theoretically, a customized `Scale` is probably impossible, since
|
|
25346
25345
|
// the interface of `Scale` does not guarantee stability. But we still literally
|
|
25347
25346
|
// support it for backward compat, though type incorrect.
|
|
25348
|
-
|| !hasOwn(AXIS_TYPES, type) && !Scale.getClass(type)) {
|
|
25347
|
+
|| !hasOwn(AXIS_TYPES$1, type) && !Scale.getClass(type)) {
|
|
25349
25348
|
type = 'value';
|
|
25350
25349
|
}
|
|
25351
25350
|
return type;
|
|
@@ -42060,7 +42059,7 @@ var axisDefault = {
|
|
|
42060
42059
|
* @param axisName 'x' 'y' 'radius' 'angle' 'parallel' ...
|
|
42061
42060
|
*/
|
|
42062
42061
|
function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {
|
|
42063
|
-
each$3(AXIS_TYPES, function (v, axisType) {
|
|
42062
|
+
each$3(AXIS_TYPES$1, function (v, axisType) {
|
|
42064
42063
|
var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);
|
|
42065
42064
|
var AxisModel = /** @class */function (_super) {
|
|
42066
42065
|
__extends$1(AxisModel, _super);
|
|
@@ -50189,12 +50188,21 @@ const WHOLE_TYPES = new Set([
|
|
|
50189
50188
|
'doughnut',
|
|
50190
50189
|
'ring',
|
|
50191
50190
|
]);
|
|
50192
|
-
|
|
50191
|
+
/**
|
|
50192
|
+
* Types that draw their values along an axis, against the texts of the items
|
|
50193
|
+
* along another one.
|
|
50194
|
+
*/
|
|
50195
|
+
const AXIS_TYPES = new Set([
|
|
50193
50196
|
'bar',
|
|
50194
50197
|
'dot',
|
|
50195
50198
|
'area',
|
|
50196
50199
|
'line',
|
|
50197
50200
|
]);
|
|
50201
|
+
const STACK_TYPES = new Set([
|
|
50202
|
+
'bar',
|
|
50203
|
+
'area',
|
|
50204
|
+
'line',
|
|
50205
|
+
]);
|
|
50198
50206
|
/**
|
|
50199
50207
|
* Whether the items of a chart of this type are parts of one whole.
|
|
50200
50208
|
* @param type - the chart type
|
|
@@ -50208,7 +50216,21 @@ function isPartOfWhole(type) {
|
|
|
50208
50216
|
* @param type - the chart type
|
|
50209
50217
|
*/
|
|
50210
50218
|
function usesAxisIncrement(type) {
|
|
50211
|
-
return
|
|
50219
|
+
return AXIS_TYPES.has(type);
|
|
50220
|
+
}
|
|
50221
|
+
/**
|
|
50222
|
+
* Whether a chart of this type can draw `series`.
|
|
50223
|
+
* @param type - the chart type
|
|
50224
|
+
*/
|
|
50225
|
+
function canDrawSeries(type) {
|
|
50226
|
+
return AXIS_TYPES.has(type);
|
|
50227
|
+
}
|
|
50228
|
+
/**
|
|
50229
|
+
* Whether a chart of this type can stack its `series` on each other.
|
|
50230
|
+
* @param type - the chart type
|
|
50231
|
+
*/
|
|
50232
|
+
function canStack(type) {
|
|
50233
|
+
return STACK_TYPES.has(type);
|
|
50212
50234
|
}
|
|
50213
50235
|
/**
|
|
50214
50236
|
* Whether the item has a `[start, end]` range, or an `[x, y]` point in a
|
|
@@ -50780,11 +50802,123 @@ function findLocale(language) {
|
|
|
50780
50802
|
return locales.get(language);
|
|
50781
50803
|
}
|
|
50782
50804
|
|
|
50805
|
+
/**
|
|
50806
|
+
* Lines up the items of the series by their text, since items of different
|
|
50807
|
+
* series that have the same text belong to the same category. When a series
|
|
50808
|
+
* has several items with the same text, its second item with that text lines
|
|
50809
|
+
* up with the second one of the other series, and so on.
|
|
50810
|
+
* @param series - the series
|
|
50811
|
+
*/
|
|
50812
|
+
function alignSeries(series) {
|
|
50813
|
+
const categories = [];
|
|
50814
|
+
const placesOfTexts = new Map();
|
|
50815
|
+
const placedSeries = series.map((current) => {
|
|
50816
|
+
var _a;
|
|
50817
|
+
const timesSeen = new Map();
|
|
50818
|
+
return ((_a = current.items) !== null && _a !== void 0 ? _a : []).map((item) => {
|
|
50819
|
+
var _a, _b;
|
|
50820
|
+
const occurrence = (_a = timesSeen.get(item.text)) !== null && _a !== void 0 ? _a : 0;
|
|
50821
|
+
timesSeen.set(item.text, occurrence + 1);
|
|
50822
|
+
const places = (_b = placesOfTexts.get(item.text)) !== null && _b !== void 0 ? _b : [];
|
|
50823
|
+
placesOfTexts.set(item.text, places);
|
|
50824
|
+
if (occurrence === places.length) {
|
|
50825
|
+
places.push(categories.length);
|
|
50826
|
+
categories.push(item.text);
|
|
50827
|
+
}
|
|
50828
|
+
return { item: item, index: places[occurrence] };
|
|
50829
|
+
});
|
|
50830
|
+
});
|
|
50831
|
+
return {
|
|
50832
|
+
categories: categories,
|
|
50833
|
+
series: series.map((current, index) => {
|
|
50834
|
+
const itemsByCategory = new Map(placedSeries[index].map((placed) => [placed.index, placed.item]));
|
|
50835
|
+
return {
|
|
50836
|
+
text: current.text,
|
|
50837
|
+
color: current.color,
|
|
50838
|
+
items: categories.map((_, category) => itemsByCategory.get(category)),
|
|
50839
|
+
};
|
|
50840
|
+
}),
|
|
50841
|
+
};
|
|
50842
|
+
}
|
|
50843
|
+
/**
|
|
50844
|
+
* The item at a position, if there is one.
|
|
50845
|
+
* @param grid - the series
|
|
50846
|
+
* @param position - where the item is
|
|
50847
|
+
*/
|
|
50848
|
+
function getItemAt(grid, position) {
|
|
50849
|
+
var _a;
|
|
50850
|
+
return (_a = grid.series[position.series]) === null || _a === void 0 ? void 0 : _a.items[position.index];
|
|
50851
|
+
}
|
|
50852
|
+
/**
|
|
50853
|
+
* The series that has an item at a place on the axis and is nearest to a
|
|
50854
|
+
* series: the series itself when it has an item there, otherwise the closest
|
|
50855
|
+
* one, and the earlier of two that are as close.
|
|
50856
|
+
* @param grid - the series
|
|
50857
|
+
* @param position - the place on the axis, and the series to start from
|
|
50858
|
+
*/
|
|
50859
|
+
function getNearestSeries(grid, position) {
|
|
50860
|
+
const distance = (series) => Math.abs(series - position.series);
|
|
50861
|
+
const [nearest] = [...grid.series.keys()]
|
|
50862
|
+
.filter((series) => getItemAt(grid, Object.assign(Object.assign({}, position), { series: series })))
|
|
50863
|
+
.sort((a, b) => distance(a) - distance(b));
|
|
50864
|
+
return nearest;
|
|
50865
|
+
}
|
|
50866
|
+
/**
|
|
50867
|
+
* The items of every series, in no particular order.
|
|
50868
|
+
* @param grid - the series
|
|
50869
|
+
*/
|
|
50870
|
+
function getAllItems(grid) {
|
|
50871
|
+
return grid.series.flatMap((series) => series.items.filter((item) => item !== undefined));
|
|
50872
|
+
}
|
|
50873
|
+
/**
|
|
50874
|
+
* The items that the value axis has to reach: every item, or, when the
|
|
50875
|
+
* series are stacked, the two ends of the stack at each place on the axis.
|
|
50876
|
+
* Positive and negative values are stacked on their own side of zero, and a
|
|
50877
|
+
* range adds its extent to the stack.
|
|
50878
|
+
* @param grid - the series
|
|
50879
|
+
* @param stacked - whether the series are stacked on each other
|
|
50880
|
+
*/
|
|
50881
|
+
function getAxisItems(grid, stacked) {
|
|
50882
|
+
if (!stacked) {
|
|
50883
|
+
return getAllItems(grid);
|
|
50884
|
+
}
|
|
50885
|
+
return grid.categories.flatMap((text, index) => {
|
|
50886
|
+
const values = grid.series
|
|
50887
|
+
.map((series) => series.items[index])
|
|
50888
|
+
.filter((item) => item !== undefined)
|
|
50889
|
+
.map((item) => getValueSpan(item));
|
|
50890
|
+
const sum = (side) => values.filter((value) => side(value)).reduce((a, b) => a + b, 0);
|
|
50891
|
+
return [
|
|
50892
|
+
{ text: text, value: sum((value) => value > 0) },
|
|
50893
|
+
{ text: text, value: sum((value) => value < 0) },
|
|
50894
|
+
];
|
|
50895
|
+
});
|
|
50896
|
+
}
|
|
50897
|
+
/**
|
|
50898
|
+
* Whether the item at a position ends its stack, since no later series has
|
|
50899
|
+
* an item on the same side of zero at that place on the axis.
|
|
50900
|
+
* @param grid - the stacked series
|
|
50901
|
+
* @param position - where the item is
|
|
50902
|
+
*/
|
|
50903
|
+
function endsStack(grid, position) {
|
|
50904
|
+
const side = Math.sign(getStackedValue(grid, position));
|
|
50905
|
+
return grid.series.slice(position.series + 1).every((_, offset) => Math.sign(getStackedValue(grid, {
|
|
50906
|
+
series: position.series + 1 + offset,
|
|
50907
|
+
index: position.index,
|
|
50908
|
+
})) !== side);
|
|
50909
|
+
}
|
|
50910
|
+
function getStackedValue(grid, position) {
|
|
50911
|
+
const item = getItemAt(grid, position);
|
|
50912
|
+
return item ? getValueSpan(item) : 0;
|
|
50913
|
+
}
|
|
50914
|
+
|
|
50783
50915
|
const DOT_SIZE = 8;
|
|
50784
50916
|
const LINE_DOT_SIZE = 6;
|
|
50785
50917
|
const CONNECTOR_WIDTH = 2;
|
|
50786
50918
|
const DIMMED_OPACITY = 0.4;
|
|
50787
50919
|
const AREA_OPACITY = 0.4;
|
|
50920
|
+
const SERIES_AREA_OPACITY = 0.15;
|
|
50921
|
+
const SERIES_STACK = { stack: 'series', stackStrategy: 'samesign' };
|
|
50788
50922
|
const PADDING = 8;
|
|
50789
50923
|
const NPS_MIN = -100;
|
|
50790
50924
|
const NPS_MAX = 100;
|
|
@@ -50795,6 +50929,15 @@ const NPS_ARC_WIDTH = 16;
|
|
|
50795
50929
|
const ITEM_TEXT_MIN_WIDTH = 40;
|
|
50796
50930
|
const ITEM_TEXT_GAP = 4;
|
|
50797
50931
|
const ITEM_TEXT_LINE_HEIGHT = 14;
|
|
50932
|
+
const SWATCH = {
|
|
50933
|
+
width: '0.625rem',
|
|
50934
|
+
height: '0.625rem',
|
|
50935
|
+
'border-radius': '0.125rem',
|
|
50936
|
+
};
|
|
50937
|
+
const SWATCH_SHAPES = {
|
|
50938
|
+
line: { height: '0.125rem' },
|
|
50939
|
+
dot: { 'border-radius': '50%' },
|
|
50940
|
+
};
|
|
50798
50941
|
const emphasis = { focus: 'self' };
|
|
50799
50942
|
const blur = { itemStyle: { opacity: DIMMED_OPACITY } };
|
|
50800
50943
|
const hidden = { show: false };
|
|
@@ -50806,34 +50949,116 @@ const hidden = { show: false };
|
|
|
50806
50949
|
* when it is known from an earlier drawing
|
|
50807
50950
|
*/
|
|
50808
50951
|
function drawChart(settings, theme, itemSpace) {
|
|
50809
|
-
const
|
|
50810
|
-
|
|
50811
|
-
|
|
50812
|
-
|
|
50813
|
-
|
|
50814
|
-
|
|
50815
|
-
|
|
50816
|
-
|
|
50817
|
-
|
|
50818
|
-
}
|
|
50819
|
-
/**
|
|
50820
|
-
* The
|
|
50952
|
+
const drawn = getDrawnSettings(settings);
|
|
50953
|
+
const grid = getSeriesGrid(drawn);
|
|
50954
|
+
const drawing = drawSeries(drawn, grid, theme, itemSpace);
|
|
50955
|
+
return Object.assign(Object.assign({}, drawing), { option: Object.assign({ animation: theme.animate, textStyle: { fontFamily: theme.fontFamily, color: theme.textColor }, tooltip: Object.assign({ appendTo: 'body', backgroundColor: theme.surfaceColor, borderColor: theme.axisLineColor, textStyle: { color: theme.textColor } }, (drawn.series
|
|
50956
|
+
? getCategoryTooltipOption(drawn, grid, theme)
|
|
50957
|
+
: {
|
|
50958
|
+
trigger: 'item',
|
|
50959
|
+
formatter: (params) => getTooltip(drawn, findItem(drawing, params).index),
|
|
50960
|
+
})) }, drawing.option) });
|
|
50961
|
+
}
|
|
50962
|
+
/**
|
|
50963
|
+
* The item drawn at a position, if an item is drawn there. A position in a
|
|
50964
|
+
* series of ECharts that draws no items of its own, such as the invisible
|
|
50965
|
+
* column of an item, belongs to the first series.
|
|
50821
50966
|
* @param drawing - the drawing of the chart
|
|
50822
50967
|
* @param location - a position within the drawn series
|
|
50823
50968
|
*/
|
|
50824
|
-
function
|
|
50825
|
-
|
|
50969
|
+
function findItem(drawing, location) {
|
|
50970
|
+
var _a, _b;
|
|
50971
|
+
if (drawing.itemsAreSeries) {
|
|
50972
|
+
return { series: 0, index: location.seriesIndex };
|
|
50973
|
+
}
|
|
50974
|
+
return {
|
|
50975
|
+
series: (_b = (_a = drawing.partsOfSeries) === null || _a === void 0 ? void 0 : _a[location.seriesIndex]) !== null && _b !== void 0 ? _b : 0,
|
|
50976
|
+
index: location.dataIndex,
|
|
50977
|
+
};
|
|
50826
50978
|
}
|
|
50827
50979
|
/**
|
|
50828
50980
|
* Where an item is drawn, for highlighting it and showing its tooltip.
|
|
50829
50981
|
* @param drawing - the drawing of the chart
|
|
50830
|
-
* @param
|
|
50982
|
+
* @param position - where the item is among the series
|
|
50831
50983
|
*/
|
|
50832
|
-
function locateItem(drawing,
|
|
50984
|
+
function locateItem(drawing, position) {
|
|
50833
50985
|
if (drawing.itemsAreSeries) {
|
|
50834
|
-
return { seriesIndex: index, dataIndex: 0 };
|
|
50986
|
+
return { seriesIndex: position.index, dataIndex: 0 };
|
|
50987
|
+
}
|
|
50988
|
+
return {
|
|
50989
|
+
seriesIndex: drawing.seriesIndexes[position.series],
|
|
50990
|
+
dataIndex: position.index,
|
|
50991
|
+
};
|
|
50992
|
+
}
|
|
50993
|
+
/**
|
|
50994
|
+
* The series that the chart draws: its series, when its type can draw them.
|
|
50995
|
+
* @param settings - what the chart is given
|
|
50996
|
+
*/
|
|
50997
|
+
function getDrawnSeries(settings) {
|
|
50998
|
+
var _a;
|
|
50999
|
+
if (!((_a = settings.series) === null || _a === void 0 ? void 0 : _a.length) || !canDrawSeries(settings.type)) {
|
|
51000
|
+
return;
|
|
51001
|
+
}
|
|
51002
|
+
return settings.series;
|
|
51003
|
+
}
|
|
51004
|
+
/**
|
|
51005
|
+
* The series whose items the chart draws as its items: its first series,
|
|
51006
|
+
* when its type cannot draw series and it has no items.
|
|
51007
|
+
* @param settings - what the chart is given
|
|
51008
|
+
*/
|
|
51009
|
+
function getSeriesOfDrawnItems(settings) {
|
|
51010
|
+
var _a, _b;
|
|
51011
|
+
if (getDrawnSeries(settings) || ((_a = settings.items) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
51012
|
+
return;
|
|
51013
|
+
}
|
|
51014
|
+
return (_b = settings.series) === null || _b === void 0 ? void 0 : _b[0];
|
|
51015
|
+
}
|
|
51016
|
+
/**
|
|
51017
|
+
* The items that the chart draws when it draws no series: its items, or the
|
|
51018
|
+
* items of its first series when it has no items.
|
|
51019
|
+
* @param settings - what the chart is given
|
|
51020
|
+
*/
|
|
51021
|
+
function getDrawnItems(settings) {
|
|
51022
|
+
var _a, _b, _c;
|
|
51023
|
+
if (getDrawnSeries(settings)) {
|
|
51024
|
+
return [];
|
|
50835
51025
|
}
|
|
50836
|
-
return
|
|
51026
|
+
return (_c = (_b = (_a = getSeriesOfDrawnItems(settings)) === null || _a === void 0 ? void 0 : _a.items) !== null && _b !== void 0 ? _b : settings.items) !== null && _c !== void 0 ? _c : [];
|
|
51027
|
+
}
|
|
51028
|
+
/**
|
|
51029
|
+
* Whether the chart stacks its series on each other. Only the types that
|
|
51030
|
+
* can stack series do, and never with dates, since a sum of dates means
|
|
51031
|
+
* nothing.
|
|
51032
|
+
* @param settings - what the chart is given
|
|
51033
|
+
*/
|
|
51034
|
+
function isStacked(settings) {
|
|
51035
|
+
return Boolean(settings.stacked &&
|
|
51036
|
+
getDrawnSeries(settings) &&
|
|
51037
|
+
canStack(settings.type) &&
|
|
51038
|
+
settings.valueFormat !== 'date');
|
|
51039
|
+
}
|
|
51040
|
+
function getDrawnSettings(settings) {
|
|
51041
|
+
return Object.assign(Object.assign({}, settings), { items: getDrawnItems(settings), series: getDrawnSeries(settings), stacked: isStacked(settings) });
|
|
51042
|
+
}
|
|
51043
|
+
/**
|
|
51044
|
+
* The series that the chart draws lined up by category, or the items it
|
|
51045
|
+
* draws as the only series when it draws no series.
|
|
51046
|
+
* @param settings - what the chart is given
|
|
51047
|
+
*/
|
|
51048
|
+
function getSeriesGrid(settings) {
|
|
51049
|
+
var _a;
|
|
51050
|
+
return alignSeries((_a = getDrawnSeries(settings)) !== null && _a !== void 0 ? _a : [
|
|
51051
|
+
{ text: '', items: getDrawnItems(settings) },
|
|
51052
|
+
]);
|
|
51053
|
+
}
|
|
51054
|
+
/**
|
|
51055
|
+
* The style of the marker of a series, in the legend and in the tooltip: a
|
|
51056
|
+
* square for bars and areas, a line for lines, and a dot for dots.
|
|
51057
|
+
* @param type - the chart type
|
|
51058
|
+
* @param color - the color of the series
|
|
51059
|
+
*/
|
|
51060
|
+
function getSwatchStyle(type, color = '') {
|
|
51061
|
+
return Object.assign(Object.assign(Object.assign({}, SWATCH), SWATCH_SHAPES[type]), { 'background-color': color });
|
|
50837
51062
|
}
|
|
50838
51063
|
/**
|
|
50839
51064
|
* Shows the text of every item on the axis, cut short to the space of the
|
|
@@ -50892,7 +51117,51 @@ function getTooltip(settings, index) {
|
|
|
50892
51117
|
.map((text) => encodeHTML(text))
|
|
50893
51118
|
.join('<br/>');
|
|
50894
51119
|
}
|
|
50895
|
-
|
|
51120
|
+
/**
|
|
51121
|
+
* The tooltip of a category of a chart with series, as HTML: its text, and
|
|
51122
|
+
* the name and value of each series that has an item there.
|
|
51123
|
+
* @param grid - the series of the chart, lined up by category
|
|
51124
|
+
* @param style - how the chart writes values
|
|
51125
|
+
* @param index - the index of the category
|
|
51126
|
+
*/
|
|
51127
|
+
function getCategoryTooltip(grid, style, index) {
|
|
51128
|
+
const category = grid.categories[index];
|
|
51129
|
+
if (category === undefined) {
|
|
51130
|
+
return '';
|
|
51131
|
+
}
|
|
51132
|
+
const lines = grid.series
|
|
51133
|
+
.filter((series) => series.items[index] !== undefined)
|
|
51134
|
+
.map((series) => {
|
|
51135
|
+
var _a;
|
|
51136
|
+
const item = series.items[index];
|
|
51137
|
+
return getTooltipLine(getSwatch(style.type, (_a = item.color) !== null && _a !== void 0 ? _a : series.color), series.text, formatValue(item, style));
|
|
51138
|
+
});
|
|
51139
|
+
return [`<div>${encodeHTML(category)}</div>`, ...lines].join('');
|
|
51140
|
+
}
|
|
51141
|
+
function getTooltipLine(swatch, name, value) {
|
|
51142
|
+
return `<div style="display:flex;justify-content:space-between;gap:1rem"><span>${swatch}${encodeHTML(name)}</span><span>${encodeHTML(value)}</span></div>`;
|
|
51143
|
+
}
|
|
51144
|
+
function getSwatch(type, color = '') {
|
|
51145
|
+
const style = Object.assign({ display: 'inline-block', 'vertical-align': 'middle', 'margin-right': '0.375rem' }, getSwatchStyle(type, encodeHTML(color)));
|
|
51146
|
+
const declarations = Object.entries(style).map(([property, value]) => `${property}:${value}`);
|
|
51147
|
+
return `<span style="${declarations.join(';')}"></span>`;
|
|
51148
|
+
}
|
|
51149
|
+
function getCategoryTooltipOption(settings, grid, theme) {
|
|
51150
|
+
return {
|
|
51151
|
+
trigger: 'axis',
|
|
51152
|
+
axisPointer: settings.type === 'bar'
|
|
51153
|
+
? {
|
|
51154
|
+
type: 'shadow',
|
|
51155
|
+
shadowStyle: { color: theme.axisLineColor, opacity: 0.2 },
|
|
51156
|
+
}
|
|
51157
|
+
: { type: 'line', lineStyle: { color: theme.axisLineColor } },
|
|
51158
|
+
formatter: (params) => {
|
|
51159
|
+
const [first] = [params].flat();
|
|
51160
|
+
return getCategoryTooltip(grid, settings, first === null || first === void 0 ? void 0 : first.dataIndex);
|
|
51161
|
+
},
|
|
51162
|
+
};
|
|
51163
|
+
}
|
|
51164
|
+
function drawSeries(settings, grid, theme, itemSpace) {
|
|
50896
51165
|
switch (settings.type) {
|
|
50897
51166
|
case 'pie':
|
|
50898
51167
|
case 'doughnut': {
|
|
@@ -50911,46 +51180,54 @@ function drawSeries(settings, theme, itemSpace) {
|
|
|
50911
51180
|
return drawNps(settings, theme);
|
|
50912
51181
|
}
|
|
50913
51182
|
default: {
|
|
50914
|
-
return drawOnAxes(settings, theme, itemSpace);
|
|
51183
|
+
return drawOnAxes(settings, grid, theme, itemSpace);
|
|
50915
51184
|
}
|
|
50916
51185
|
}
|
|
50917
51186
|
}
|
|
50918
|
-
function drawOnAxes(settings, theme, itemSpace) {
|
|
50919
|
-
const {
|
|
50920
|
-
const range = settings
|
|
50921
|
-
|
|
50922
|
-
|
|
50923
|
-
getMaximumValue(item),
|
|
50924
|
-
]), settings.maxValue)
|
|
50925
|
-
: getAxisRange(items, settings.maxValue, settings.axisIncrement);
|
|
50926
|
-
const itemTextAxis = getItemTextAxis(settings);
|
|
50927
|
-
const categoryAxis = Object.assign(Object.assign(Object.assign({}, getCategoryAxis(settings)), { axisLabel: Object.assign({ show: settings.displayItemText, color: theme.textColor }, (itemTextAxis &&
|
|
51187
|
+
function drawOnAxes(settings, grid, theme, itemSpace) {
|
|
51188
|
+
const { orientation } = settings;
|
|
51189
|
+
const range = getValueRange(settings, grid);
|
|
51190
|
+
const itemTextAxis = getItemTextAxis(settings, grid);
|
|
51191
|
+
const categoryAxis = Object.assign(Object.assign(Object.assign({}, getCategoryAxis(settings, grid)), { axisLabel: Object.assign({ show: settings.displayItemText, color: theme.textColor }, (itemTextAxis &&
|
|
50928
51192
|
itemSpace &&
|
|
50929
51193
|
getItemTextLayout(itemTextAxis, itemSpace))), axisTick: hidden, axisLine: { lineStyle: { color: theme.axisLineColor } } }), getAxisName(settings, settings.itemsLabel, theme));
|
|
50930
51194
|
const valueAxis = getValueAxis(range, getAxisName(settings, settings.valuesLabel, theme), settings, theme);
|
|
50931
|
-
const { series,
|
|
51195
|
+
const { series, seriesIndexes, partsOfSeries } = getAxisSeries(settings, grid, theme);
|
|
50932
51196
|
const option = {
|
|
50933
51197
|
grid: getGrid(theme),
|
|
50934
51198
|
xAxis: orientation === 'landscape' ? categoryAxis : valueAxis,
|
|
50935
51199
|
yAxis: orientation === 'landscape' ? valueAxis : categoryAxis,
|
|
50936
51200
|
series: series,
|
|
50937
51201
|
};
|
|
51202
|
+
const hasColumns = settings.type !== 'bar' && !settings.series;
|
|
50938
51203
|
return {
|
|
50939
|
-
|
|
51204
|
+
seriesIndexes: seriesIndexes,
|
|
51205
|
+
partsOfSeries: partsOfSeries,
|
|
50940
51206
|
itemsAreSeries: false,
|
|
50941
51207
|
itemTextAxis: itemTextAxis,
|
|
50942
|
-
|
|
51208
|
+
valueRange: range,
|
|
51209
|
+
option: hasColumns ? withColumns(option, settings, grid) : option,
|
|
50943
51210
|
};
|
|
50944
51211
|
}
|
|
50945
|
-
function
|
|
51212
|
+
function getValueRange(settings, grid) {
|
|
51213
|
+
const items = getAxisItems(grid, Boolean(settings.stacked));
|
|
51214
|
+
if (settings.valueFormat === 'date') {
|
|
51215
|
+
return getDateRange(items.flatMap((item) => [
|
|
51216
|
+
getMinimumValue(item),
|
|
51217
|
+
getMaximumValue(item),
|
|
51218
|
+
]), settings.maxValue);
|
|
51219
|
+
}
|
|
51220
|
+
return getAxisRange(items, settings.maxValue, settings.axisIncrement);
|
|
51221
|
+
}
|
|
51222
|
+
function getCategoryAxis(settings, grid) {
|
|
50946
51223
|
return {
|
|
50947
51224
|
type: 'category',
|
|
50948
|
-
data:
|
|
51225
|
+
data: grid.categories,
|
|
50949
51226
|
inverse: settings.orientation === 'portrait',
|
|
50950
51227
|
};
|
|
50951
51228
|
}
|
|
50952
|
-
function getItemTextAxis(settings) {
|
|
50953
|
-
if (!settings.displayItemText ||
|
|
51229
|
+
function getItemTextAxis(settings, grid) {
|
|
51230
|
+
if (!settings.displayItemText || grid.categories.length < 2) {
|
|
50954
51231
|
return;
|
|
50955
51232
|
}
|
|
50956
51233
|
return settings.orientation === 'landscape' ? 'xAxis' : 'yAxis';
|
|
@@ -50959,9 +51236,9 @@ function getItemTextAxis(settings) {
|
|
|
50959
51236
|
// column across the whole plot that shows its tooltip and takes its clicks.
|
|
50960
51237
|
// The columns have axes of their own, so they are not laid out next to the
|
|
50961
51238
|
// bars that draw ranges.
|
|
50962
|
-
function withColumns(option, settings) {
|
|
51239
|
+
function withColumns(option, settings, grid) {
|
|
50963
51240
|
const { items, orientation } = settings;
|
|
50964
|
-
const categoryAxis = Object.assign(Object.assign({}, getCategoryAxis(settings)), { show: false });
|
|
51241
|
+
const categoryAxis = Object.assign(Object.assign({}, getCategoryAxis(settings, grid)), { show: false });
|
|
50965
51242
|
const valueAxis = { type: 'value', min: 0, max: 1, show: false };
|
|
50966
51243
|
const columns = {
|
|
50967
51244
|
type: 'bar',
|
|
@@ -50976,78 +51253,140 @@ function withColumns(option, settings) {
|
|
|
50976
51253
|
const landscape = orientation === 'landscape';
|
|
50977
51254
|
return Object.assign(Object.assign({}, option), { xAxis: [option.xAxis, landscape ? categoryAxis : valueAxis], yAxis: [option.yAxis, landscape ? valueAxis : categoryAxis], series: [...option.series, columns] });
|
|
50978
51255
|
}
|
|
50979
|
-
function getAxisSeries(settings, theme) {
|
|
51256
|
+
function getAxisSeries(settings, grid, theme) {
|
|
51257
|
+
const series = [];
|
|
51258
|
+
const seriesIndexes = [];
|
|
51259
|
+
const partsOfSeries = [];
|
|
51260
|
+
for (const index of grid.series.keys()) {
|
|
51261
|
+
const drawn = drawItemSeries(settings, grid, index, theme);
|
|
51262
|
+
seriesIndexes.push(series.length + drawn.seriesIndex);
|
|
51263
|
+
series.push(...drawn.series);
|
|
51264
|
+
partsOfSeries.push(...drawn.series.map(() => index));
|
|
51265
|
+
}
|
|
51266
|
+
return {
|
|
51267
|
+
series: series,
|
|
51268
|
+
seriesIndexes: seriesIndexes,
|
|
51269
|
+
partsOfSeries: partsOfSeries,
|
|
51270
|
+
};
|
|
51271
|
+
}
|
|
51272
|
+
function drawItemSeries(settings, grid, index, theme) {
|
|
51273
|
+
const series = grid.series[index];
|
|
50980
51274
|
if (settings.type === 'line' || settings.type === 'area') {
|
|
50981
|
-
return getLineSeries(settings, theme);
|
|
51275
|
+
return getLineSeries(settings, series, index, theme);
|
|
50982
51276
|
}
|
|
50983
51277
|
if (settings.type === 'dot') {
|
|
50984
|
-
return getDotSeries(settings, theme);
|
|
51278
|
+
return getDotSeries(settings, series, index, theme);
|
|
50985
51279
|
}
|
|
50986
|
-
|
|
51280
|
+
if (settings.stacked) {
|
|
51281
|
+
return {
|
|
51282
|
+
series: [getStackedBars(settings, grid, index, theme)],
|
|
51283
|
+
seriesIndex: 0,
|
|
51284
|
+
};
|
|
51285
|
+
}
|
|
51286
|
+
return getBarSeries(settings, series, index, theme);
|
|
50987
51287
|
}
|
|
50988
|
-
function
|
|
50989
|
-
const
|
|
51288
|
+
function getStackedBars(settings, grid, index, theme) {
|
|
51289
|
+
const series = grid.series[index];
|
|
51290
|
+
return Object.assign(Object.assign({ type: 'bar' }, SERIES_STACK), { data: series.items.map((item, category) => item
|
|
51291
|
+
? {
|
|
51292
|
+
value: getValueSpan(item),
|
|
51293
|
+
itemStyle: {
|
|
51294
|
+
color: item.color,
|
|
51295
|
+
borderRadius: endsStack(grid, {
|
|
51296
|
+
series: index,
|
|
51297
|
+
index: category,
|
|
51298
|
+
})
|
|
51299
|
+
? getOuterCorners(settings, item, theme)
|
|
51300
|
+
: 0,
|
|
51301
|
+
borderColor: theme.dividerColor,
|
|
51302
|
+
borderWidth: 1,
|
|
51303
|
+
},
|
|
51304
|
+
}
|
|
51305
|
+
: null), label: Object.assign(Object.assign({}, getValueLabel(settings, series, theme)), { position: 'inside', color: undefined }), cursor: getSeriesCursor(series.items), emphasis: emphasis, blur: blur });
|
|
51306
|
+
}
|
|
51307
|
+
function getOuterCorners(settings, item, theme) {
|
|
51308
|
+
const [topLeft, topRight, bottomRight, bottomLeft] = theme.itemBorderRadius;
|
|
51309
|
+
const positive = getValueSpan(item) >= 0;
|
|
51310
|
+
if (settings.orientation === 'portrait') {
|
|
51311
|
+
return positive
|
|
51312
|
+
? [0, topRight, bottomRight, 0]
|
|
51313
|
+
: [topLeft, 0, 0, bottomLeft];
|
|
51314
|
+
}
|
|
51315
|
+
return positive
|
|
51316
|
+
? [topLeft, topRight, 0, 0]
|
|
51317
|
+
: [0, 0, bottomRight, bottomLeft];
|
|
51318
|
+
}
|
|
51319
|
+
function getBarSeries(settings, series, index, theme) {
|
|
51320
|
+
const { items } = series;
|
|
50990
51321
|
const bars = {
|
|
50991
51322
|
type: 'bar',
|
|
50992
|
-
data: items.map((item) =>
|
|
50993
|
-
|
|
50994
|
-
|
|
50995
|
-
|
|
50996
|
-
|
|
50997
|
-
|
|
50998
|
-
|
|
50999
|
-
|
|
51323
|
+
data: items.map((item) => item
|
|
51324
|
+
? {
|
|
51325
|
+
value: getValueSpan(item),
|
|
51326
|
+
itemStyle: {
|
|
51327
|
+
color: item.color,
|
|
51328
|
+
borderRadius: theme.itemBorderRadius,
|
|
51329
|
+
},
|
|
51330
|
+
}
|
|
51331
|
+
: null),
|
|
51332
|
+
label: getValueLabel(settings, series, theme),
|
|
51000
51333
|
cursor: getSeriesCursor(items),
|
|
51001
51334
|
emphasis: emphasis,
|
|
51002
51335
|
blur: blur,
|
|
51003
51336
|
};
|
|
51004
|
-
if (
|
|
51337
|
+
if (!hasRanges(items)) {
|
|
51005
51338
|
return { series: [bars], seriesIndex: 0 };
|
|
51006
51339
|
}
|
|
51007
51340
|
return {
|
|
51008
51341
|
series: [
|
|
51009
|
-
Object.assign(Object.assign({ type: 'bar' },
|
|
51010
|
-
Object.assign(Object.assign({}, bars),
|
|
51342
|
+
Object.assign(Object.assign({ type: 'bar' }, getRangeBase(index)), { data: getRangeStarts(items) }),
|
|
51343
|
+
Object.assign(Object.assign({}, bars), getRangeStack(index)),
|
|
51011
51344
|
],
|
|
51012
51345
|
seriesIndex: 1,
|
|
51013
51346
|
};
|
|
51014
51347
|
}
|
|
51015
|
-
function getDotSeries(settings, theme) {
|
|
51016
|
-
const { items
|
|
51017
|
-
const
|
|
51348
|
+
function getDotSeries(settings, series, index, theme) {
|
|
51349
|
+
const { items } = series;
|
|
51350
|
+
const { orientation } = settings;
|
|
51351
|
+
const point = (category, value) => orientation === 'landscape' ? [category, value] : [value, category];
|
|
51018
51352
|
const ends = {
|
|
51019
51353
|
type: 'scatter',
|
|
51020
51354
|
symbolSize: DOT_SIZE,
|
|
51021
|
-
data: items.map((item,
|
|
51022
|
-
|
|
51023
|
-
|
|
51024
|
-
|
|
51025
|
-
|
|
51355
|
+
data: items.map((item, category) => item
|
|
51356
|
+
? {
|
|
51357
|
+
value: point(category, getMaximumValue(item)),
|
|
51358
|
+
itemStyle: { color: item.color },
|
|
51359
|
+
}
|
|
51360
|
+
: null),
|
|
51361
|
+
label: getValueLabel(settings, series, theme),
|
|
51026
51362
|
cursor: getSeriesCursor(items),
|
|
51027
51363
|
emphasis: emphasis,
|
|
51028
51364
|
blur: blur,
|
|
51029
51365
|
};
|
|
51030
|
-
if (
|
|
51366
|
+
if (!hasRanges(items)) {
|
|
51031
51367
|
return { series: [ends], seriesIndex: 0 };
|
|
51032
51368
|
}
|
|
51033
|
-
const connectors = Object.assign(Object.assign({ type: 'bar' },
|
|
51034
|
-
|
|
51035
|
-
|
|
51036
|
-
|
|
51369
|
+
const connectors = Object.assign(Object.assign({ type: 'bar' }, getRangeStack(index)), { cursor: getSeriesCursor(items), emphasis: { disabled: true }, barWidth: CONNECTOR_WIDTH, barGap: '-100%', data: items.map((item) => item && isRangeItem(item)
|
|
51370
|
+
? {
|
|
51371
|
+
value: getValueSpan(item),
|
|
51372
|
+
itemStyle: { color: item.color },
|
|
51373
|
+
}
|
|
51374
|
+
: null) });
|
|
51037
51375
|
const starts = {
|
|
51038
51376
|
type: 'scatter',
|
|
51039
|
-
|
|
51377
|
+
cursor: getSeriesCursor(items),
|
|
51378
|
+
emphasis: { disabled: true },
|
|
51040
51379
|
symbolSize: DOT_SIZE,
|
|
51041
|
-
data: items.map((item,
|
|
51042
|
-
|
|
51043
|
-
|
|
51044
|
-
:
|
|
51045
|
-
|
|
51046
|
-
|
|
51380
|
+
data: items.map((item, category) => item && isRangeItem(item)
|
|
51381
|
+
? {
|
|
51382
|
+
value: point(category, getMinimumValue(item)),
|
|
51383
|
+
itemStyle: { color: item.color },
|
|
51384
|
+
}
|
|
51385
|
+
: null),
|
|
51047
51386
|
};
|
|
51048
51387
|
return {
|
|
51049
51388
|
series: [
|
|
51050
|
-
Object.assign(Object.assign({ type: 'bar' },
|
|
51389
|
+
Object.assign(Object.assign({ type: 'bar' }, getRangeBase(index)), { barGap: '-100%', data: getRangeStarts(items) }),
|
|
51051
51390
|
connectors,
|
|
51052
51391
|
starts,
|
|
51053
51392
|
ends,
|
|
@@ -51055,38 +51394,63 @@ function getDotSeries(settings, theme) {
|
|
|
51055
51394
|
seriesIndex: 3,
|
|
51056
51395
|
};
|
|
51057
51396
|
}
|
|
51058
|
-
function getLineSeries(settings, theme) {
|
|
51059
|
-
|
|
51060
|
-
const
|
|
51397
|
+
function getLineSeries(settings, series, index, theme) {
|
|
51398
|
+
var _a;
|
|
51399
|
+
const { items } = series;
|
|
51400
|
+
const color = (_a = series.color) !== null && _a !== void 0 ? _a : theme.lineColor;
|
|
51061
51401
|
const area = settings.type === 'area';
|
|
51062
|
-
const line = {
|
|
51063
|
-
|
|
51064
|
-
|
|
51065
|
-
|
|
51066
|
-
|
|
51067
|
-
|
|
51068
|
-
|
|
51069
|
-
|
|
51070
|
-
|
|
51071
|
-
|
|
51072
|
-
|
|
51073
|
-
|
|
51074
|
-
|
|
51075
|
-
|
|
51076
|
-
}
|
|
51077
|
-
if (
|
|
51402
|
+
const line = Object.assign(Object.assign({ type: 'line', color: color, symbol: 'circle', symbolSize: LINE_DOT_SIZE }, (settings.series &&
|
|
51403
|
+
hasClickableItems(items) && {
|
|
51404
|
+
showAllSymbol: true,
|
|
51405
|
+
labelLayout: { hideOverlap: true },
|
|
51406
|
+
})), { data: items.map((item) => item
|
|
51407
|
+
? {
|
|
51408
|
+
value: getValueSpan(item),
|
|
51409
|
+
itemStyle: { color: item.color },
|
|
51410
|
+
}
|
|
51411
|
+
: null), areaStyle: area
|
|
51412
|
+
? { color: color, opacity: getAreaOpacity(settings) }
|
|
51413
|
+
: undefined, label: getValueLabel(settings, series, theme), cursor: getSeriesCursor(items), emphasis: emphasis, blur: blur });
|
|
51414
|
+
if (settings.stacked) {
|
|
51415
|
+
return { series: [Object.assign(Object.assign({}, line), SERIES_STACK)], seriesIndex: 0 };
|
|
51416
|
+
}
|
|
51417
|
+
if (!hasRanges(items)) {
|
|
51078
51418
|
return { series: [line], seriesIndex: 0 };
|
|
51079
51419
|
}
|
|
51080
|
-
const base = Object.assign(Object.assign({ type: 'line' },
|
|
51081
|
-
return {
|
|
51420
|
+
const base = Object.assign(Object.assign({ type: 'line' }, getRangeBase(index)), { symbol: 'none', color: color, lineStyle: { opacity: area ? 0 : 1 }, data: getRangeStarts(items) });
|
|
51421
|
+
return {
|
|
51422
|
+
series: [base, Object.assign(Object.assign({}, line), getRangeStack(index))],
|
|
51423
|
+
seriesIndex: 1,
|
|
51424
|
+
};
|
|
51425
|
+
}
|
|
51426
|
+
function getAreaOpacity(settings) {
|
|
51427
|
+
var _a;
|
|
51428
|
+
return ((_a = settings.series) === null || _a === void 0 ? void 0 : _a.length) > 1 && !settings.stacked
|
|
51429
|
+
? SERIES_AREA_OPACITY
|
|
51430
|
+
: AREA_OPACITY;
|
|
51431
|
+
}
|
|
51432
|
+
function hasClickableItems(items) {
|
|
51433
|
+
return items.some((item) => item === null || item === void 0 ? void 0 : item.clickable);
|
|
51434
|
+
}
|
|
51435
|
+
function hasRanges(items) {
|
|
51436
|
+
return items.some((item) => item && isRangeItem(item));
|
|
51082
51437
|
}
|
|
51083
|
-
const stacked = { stack: 'range', stackStrategy: 'all' };
|
|
51084
51438
|
// A range is drawn as a stack of an invisible part from zero to its start,
|
|
51085
51439
|
// and a visible part from its start to its end. Items that are not ranges
|
|
51086
|
-
// start at zero.
|
|
51087
|
-
|
|
51440
|
+
// start at zero. Each series has a stack of its own.
|
|
51441
|
+
function getRangeStack(index) {
|
|
51442
|
+
return { stack: `range${index}`, stackStrategy: 'all' };
|
|
51443
|
+
}
|
|
51444
|
+
function getRangeBase(index) {
|
|
51445
|
+
return Object.assign(Object.assign({}, getRangeStack(index)), { silent: true, tooltip: hidden, emphasis: { disabled: true }, itemStyle: { color: 'transparent' } });
|
|
51446
|
+
}
|
|
51088
51447
|
function getRangeStarts(items) {
|
|
51089
|
-
return items.map((item) =>
|
|
51448
|
+
return items.map((item) => {
|
|
51449
|
+
if (!item) {
|
|
51450
|
+
return null;
|
|
51451
|
+
}
|
|
51452
|
+
return isRangeItem(item) ? getMinimumValue(item) : 0;
|
|
51453
|
+
});
|
|
51090
51454
|
}
|
|
51091
51455
|
function drawScatter(settings, theme) {
|
|
51092
51456
|
const { items } = settings;
|
|
@@ -51116,7 +51480,7 @@ function drawScatter(settings, theme) {
|
|
|
51116
51480
|
blur: blur,
|
|
51117
51481
|
};
|
|
51118
51482
|
return {
|
|
51119
|
-
|
|
51483
|
+
seriesIndexes: [0],
|
|
51120
51484
|
itemsAreSeries: false,
|
|
51121
51485
|
option: {
|
|
51122
51486
|
grid: getGrid(theme),
|
|
@@ -51145,7 +51509,7 @@ function drawPie(settings, theme) {
|
|
|
51145
51509
|
}
|
|
51146
51510
|
const innerRadius = settings.type === 'doughnut' ? '50%' : 0;
|
|
51147
51511
|
return {
|
|
51148
|
-
|
|
51512
|
+
seriesIndexes: [0],
|
|
51149
51513
|
itemsAreSeries: false,
|
|
51150
51514
|
option: {
|
|
51151
51515
|
series: [
|
|
@@ -51180,7 +51544,7 @@ function drawProportionBar(settings, theme) {
|
|
|
51180
51544
|
const categoryAxis = { type: 'category', data: [''], show: false };
|
|
51181
51545
|
const landscape = settings.orientation === 'landscape';
|
|
51182
51546
|
return {
|
|
51183
|
-
|
|
51547
|
+
seriesIndexes: [0],
|
|
51184
51548
|
itemsAreSeries: true,
|
|
51185
51549
|
option: {
|
|
51186
51550
|
backgroundColor: theme.backgroundColor,
|
|
@@ -51209,7 +51573,7 @@ function drawRing(settings, theme) {
|
|
|
51209
51573
|
const { items } = settings;
|
|
51210
51574
|
const whole = getWholeRange(items, settings.maxValue).totalRange;
|
|
51211
51575
|
return {
|
|
51212
|
-
|
|
51576
|
+
seriesIndexes: [0],
|
|
51213
51577
|
itemsAreSeries: false,
|
|
51214
51578
|
option: {
|
|
51215
51579
|
polar: { radius: ['20%', '90%'] },
|
|
@@ -51246,7 +51610,7 @@ function drawRing(settings, theme) {
|
|
|
51246
51610
|
function drawNps(settings, theme) {
|
|
51247
51611
|
const { items } = settings;
|
|
51248
51612
|
return {
|
|
51249
|
-
|
|
51613
|
+
seriesIndexes: [0],
|
|
51250
51614
|
itemsAreSeries: false,
|
|
51251
51615
|
option: {
|
|
51252
51616
|
series: [
|
|
@@ -51335,8 +51699,8 @@ function getAxisName(settings, name, theme) {
|
|
|
51335
51699
|
nameTextStyle: { color: theme.textColor },
|
|
51336
51700
|
};
|
|
51337
51701
|
}
|
|
51338
|
-
function getValueLabel(settings, theme) {
|
|
51339
|
-
return Object.assign(Object.assign({ show: settings.displayItemValue, position: settings.orientation === 'landscape' ? 'top' : 'right' }, getLabelStyle(theme)), { formatter: ({ dataIndex }) => formatValue(
|
|
51702
|
+
function getValueLabel(settings, series, theme) {
|
|
51703
|
+
return Object.assign(Object.assign({ show: settings.displayItemValue, position: settings.orientation === 'landscape' ? 'top' : 'right' }, getLabelStyle(theme)), { formatter: ({ dataIndex }) => formatValue(series.items[dataIndex], settings) });
|
|
51340
51704
|
}
|
|
51341
51705
|
function getLabelStyle(theme) {
|
|
51342
51706
|
return { color: theme.textColor, textBorderWidth: 0 };
|
|
@@ -51352,7 +51716,7 @@ function getPointLabel(settings, item) {
|
|
|
51352
51716
|
return parts.join(' ');
|
|
51353
51717
|
}
|
|
51354
51718
|
function getSeriesCursor(items) {
|
|
51355
|
-
return getCursor(items
|
|
51719
|
+
return getCursor(hasClickableItems(items));
|
|
51356
51720
|
}
|
|
51357
51721
|
function getCursor(clickable) {
|
|
51358
51722
|
return clickable ? 'pointer' : 'default';
|
|
@@ -51504,9 +51868,18 @@ function paintToRgba(context, color) {
|
|
|
51504
51868
|
return `rgba(${red}, ${green}, ${blue}, ${alpha / MAX_CHANNEL})`;
|
|
51505
51869
|
}
|
|
51506
51870
|
|
|
51507
|
-
const chartCss = () => `@charset "UTF-8";:host(limel-chart){--limel-chart-item-color:var( --chart-item-color, rgb(var(--contrast-1100), 0.8) );--limel-chart-axis-line-color:var( --chart-axis-line-color, rgb(var(--contrast-900), 0.4) );--limel-chart-background-color:var(--chart-background-color, transparent);--limel-chart-item-divider-color:var( --chart-item-divider-color, rgb(var(--contrast-100), 0.6) );--limel-chart-item-border-radius:var(--chart-item-border-radius, 0);--limel-chart-scatter-item-size:var(--chart-scatter-item-size, 0.5rem);--limel-chart-text-color:rgb(var(--contrast-1000));--limel-chart-line-color:rgb(var(--contrast-900));--limel-chart-surface-color:rgb(var(--contrast-100));--limel-chart-nps-detractors-color:rgb(var(--color-coral-default));--limel-chart-nps-passives-color:rgb(var(--color-amber-light));--limel-chart-nps-good-color:rgb(var(--color-lime-light));--limel-chart-nps-excellent-color:rgb(var(--color-lime-default));box-sizing:border-box;position:relative;display:flex;width:100%;height:100%;min-width:0;min-height:0}:host(limel-chart[type=bar]){--limel-chart-item-border-radius:var(--chart-item-border-radius, 0.125rem)}:host(limel-chart[type=proportion-bar]),:host(limel-chart[type=stacked-bar]){--limel-chart-background-color:var( --chart-background-color, rgb(var(--contrast-800), 0.2) )}:host(limel-chart[type=proportion-bar][orientation=landscape]),:host(limel-chart[type=proportion-bar][orientation=landscape]) .plot,:host(limel-chart[type=stacked-bar][orientation=landscape]),:host(limel-chart[type=stacked-bar][orientation=landscape]) .plot{min-height:0.5rem}:host(limel-chart[type=proportion-bar][orientation=portrait]),:host(limel-chart[type=proportion-bar][orientation=portrait]) .plot,:host(limel-chart[type=stacked-bar][orientation=portrait]),:host(limel-chart[type=stacked-bar][orientation=portrait]) .plot{min-width:0.5rem}:host(limel-chart[type=pie]),:host(limel-chart[type=doughnut]),:host(limel-chart[type=ring]){--limel-chart-background-color:var( --chart-background-color, rgb(var(--contrast-200)) )}:host(limel-chart[type=nps]){--limel-chart-background-color:var( --chart-background-color, rgb(var(--contrast-100)) )}:host(limel-chart[type=pie]),:host(limel-chart[type=doughnut]),:host(limel-chart[type=ring]),:host(limel-chart[type=nps]){aspect-ratio:1}:host(limel-chart[type=bar][data-fallback-height]),:host(limel-chart[type=dot][data-fallback-height]),:host(limel-chart[type=line][data-fallback-height]),:host(limel-chart[type=area][data-fallback-height]),:host(limel-chart[type=scatter][data-fallback-height]){aspect-ratio:2}.plot{flex-grow:1;contain:size}:host(limel-chart[type=proportion-bar]) .plot,:host(limel-chart[type=stacked-bar]) .plot{border-radius:0.25rem;overflow:hidden}table{position:absolute;width:0;height:0;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap}limel-spinner{margin:auto}`;
|
|
51871
|
+
const chartCss = () => `@charset "UTF-8";:host(limel-chart){--limel-chart-item-color:var( --chart-item-color, rgb(var(--contrast-1100), 0.8) );--limel-chart-axis-line-color:var( --chart-axis-line-color, rgb(var(--contrast-900), 0.4) );--limel-chart-background-color:var(--chart-background-color, transparent);--limel-chart-item-divider-color:var( --chart-item-divider-color, rgb(var(--contrast-100), 0.6) );--limel-chart-item-border-radius:var(--chart-item-border-radius, 0);--limel-chart-scatter-item-size:var(--chart-scatter-item-size, 0.5rem);--limel-chart-text-color:rgb(var(--contrast-1000));--limel-chart-line-color:rgb(var(--contrast-900));--limel-chart-surface-color:rgb(var(--contrast-100));--limel-chart-nps-detractors-color:rgb(var(--color-coral-default));--limel-chart-nps-passives-color:rgb(var(--color-amber-light));--limel-chart-nps-good-color:rgb(var(--color-lime-light));--limel-chart-nps-excellent-color:rgb(var(--color-lime-default));--limel-chart-series-color-1:rgb(var(--color-blue-default));--limel-chart-series-color-2:rgb(var(--color-coral-default));--limel-chart-series-color-3:rgb(var(--color-teal-default));--limel-chart-series-color-4:rgb(var(--color-amber-default));--limel-chart-series-color-5:rgb(var(--color-magenta-default));--limel-chart-series-color-6:rgb(var(--color-green-default));--limel-chart-series-color-7:rgb(var(--color-violet-default));--limel-chart-series-color-8:rgb(var(--color-red-default));box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0}:host(limel-chart[type=bar]){--limel-chart-item-border-radius:var(--chart-item-border-radius, 0.125rem)}:host(limel-chart[type=proportion-bar]),:host(limel-chart[type=stacked-bar]){--limel-chart-background-color:var( --chart-background-color, rgb(var(--contrast-800), 0.2) )}:host(limel-chart[type=proportion-bar][orientation=landscape]),:host(limel-chart[type=proportion-bar][orientation=landscape]) .plot,:host(limel-chart[type=stacked-bar][orientation=landscape]),:host(limel-chart[type=stacked-bar][orientation=landscape]) .plot{min-height:0.5rem}:host(limel-chart[type=proportion-bar][orientation=portrait]),:host(limel-chart[type=proportion-bar][orientation=portrait]) .plot,:host(limel-chart[type=stacked-bar][orientation=portrait]),:host(limel-chart[type=stacked-bar][orientation=portrait]) .plot{min-width:0.5rem}:host(limel-chart[type=pie]),:host(limel-chart[type=doughnut]),:host(limel-chart[type=ring]){--limel-chart-background-color:var( --chart-background-color, rgb(var(--contrast-200)) )}:host(limel-chart[type=nps]){--limel-chart-background-color:var( --chart-background-color, rgb(var(--contrast-100)) )}:host(limel-chart[type=pie]),:host(limel-chart[type=doughnut]),:host(limel-chart[type=ring]),:host(limel-chart[type=nps]){aspect-ratio:1}:host(limel-chart[type=bar][data-fallback-height]),:host(limel-chart[type=dot][data-fallback-height]),:host(limel-chart[type=line][data-fallback-height]),:host(limel-chart[type=area][data-fallback-height]),:host(limel-chart[type=scatter][data-fallback-height]){aspect-ratio:2}.plot{flex-grow:1;contain:size}ul{display:flex;flex-wrap:wrap;gap:0.25rem 0.875rem;margin:0 0 0.5rem 0;padding:0;list-style:none;font-size:0.75rem;color:rgb(var(--contrast-1100))}li{display:inline-flex;align-items:center;gap:0.375rem}li>span{flex-shrink:0}:host(limel-chart[type=proportion-bar]) .plot,:host(limel-chart[type=stacked-bar]) .plot{border-radius:0.25rem;overflow:hidden}table{position:absolute;width:0;height:0;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap}limel-spinner{margin:auto}`;
|
|
51508
51872
|
|
|
51509
51873
|
const orientations = ['horizontal', 'vertical'];
|
|
51874
|
+
const SERIES_COLOR_COUNT = 8;
|
|
51875
|
+
const getDefaultSeriesColor = (index) => `var(--limel-chart-series-color-${(index % SERIES_COLOR_COUNT) + 1})`;
|
|
51876
|
+
const copyItem = (item) => ({
|
|
51877
|
+
text: item.text,
|
|
51878
|
+
value: item.value,
|
|
51879
|
+
formattedValue: item.formattedValue,
|
|
51880
|
+
color: item.color,
|
|
51881
|
+
clickable: item.clickable,
|
|
51882
|
+
});
|
|
51510
51883
|
const extensions = [
|
|
51511
51884
|
install$9,
|
|
51512
51885
|
install$5,
|
|
@@ -51553,6 +51926,15 @@ const Chart = class {
|
|
|
51553
51926
|
* Applies to `proportion-bar`, `pie`, `doughnut`, and `ring` charts.
|
|
51554
51927
|
*/
|
|
51555
51928
|
this.displayItemPercentage = true;
|
|
51929
|
+
/**
|
|
51930
|
+
* Stacks the `series` on each other, so that each place on the axis
|
|
51931
|
+
* shows their total, such as the revenue of each product, which adds up
|
|
51932
|
+
* to the revenue of the month. Positive and negative values are stacked
|
|
51933
|
+
* on their own side of zero, and a range adds its extent to the stack.
|
|
51934
|
+
* Applies to `bar`, `line`, and `area` charts, but not when
|
|
51935
|
+
* `valueFormat` is `date`.
|
|
51936
|
+
*/
|
|
51937
|
+
this.stacked = false;
|
|
51556
51938
|
/**
|
|
51557
51939
|
* Defines how items are visualized in the chart.
|
|
51558
51940
|
* `stacked-bar` is the old name of `proportion-bar`. It still works, but
|
|
@@ -51581,7 +51963,9 @@ const Chart = class {
|
|
|
51581
51963
|
/**
|
|
51582
51964
|
* The item that last had focus, which is the one that Tab returns to.
|
|
51583
51965
|
*/
|
|
51584
|
-
this.
|
|
51966
|
+
this.focusedPosition = { series: 0, index: 0 };
|
|
51967
|
+
this.grid = { categories: [], series: [] };
|
|
51968
|
+
this.seriesColors = [];
|
|
51585
51969
|
this.themeMayHaveChanged = false;
|
|
51586
51970
|
this.warnings = new Map();
|
|
51587
51971
|
this.invalidColors = new Set();
|
|
@@ -51600,7 +51984,7 @@ const Chart = class {
|
|
|
51600
51984
|
if (!this.drawing) {
|
|
51601
51985
|
return;
|
|
51602
51986
|
}
|
|
51603
|
-
const item = this.getClickableItem(
|
|
51987
|
+
const item = this.getClickableItem(this.getClickedPosition(event));
|
|
51604
51988
|
if (!item) {
|
|
51605
51989
|
return;
|
|
51606
51990
|
}
|
|
@@ -51614,7 +51998,7 @@ const Chart = class {
|
|
|
51614
51998
|
this.highlightItemAt(event, false);
|
|
51615
51999
|
};
|
|
51616
52000
|
this.handleClick = (event) => {
|
|
51617
|
-
const item = this.getClickableItem(this.
|
|
52001
|
+
const item = this.getClickableItem(this.getEventPosition(event));
|
|
51618
52002
|
if (!item) {
|
|
51619
52003
|
return;
|
|
51620
52004
|
}
|
|
@@ -51625,13 +52009,13 @@ const Chart = class {
|
|
|
51625
52009
|
const orientation = orientations.find((option) => isNavigationKey(event, { orientation: option }));
|
|
51626
52010
|
if (orientation) {
|
|
51627
52011
|
event.preventDefault();
|
|
51628
|
-
this.focusItem(
|
|
52012
|
+
this.focusItem(this.findTarget(event.key, this.getEventPosition(event), orientation));
|
|
51629
52013
|
return;
|
|
51630
52014
|
}
|
|
51631
52015
|
if (event.key !== 'Enter' && event.key !== ' ') {
|
|
51632
52016
|
return;
|
|
51633
52017
|
}
|
|
51634
|
-
const item = this.getClickableItem(this.
|
|
52018
|
+
const item = this.getClickableItem(this.getEventPosition(event));
|
|
51635
52019
|
if (!item) {
|
|
51636
52020
|
return;
|
|
51637
52021
|
}
|
|
@@ -51639,9 +52023,9 @@ const Chart = class {
|
|
|
51639
52023
|
this.interact.emit(item);
|
|
51640
52024
|
};
|
|
51641
52025
|
this.handleFocus = (event) => {
|
|
51642
|
-
const
|
|
51643
|
-
this.
|
|
51644
|
-
this.showItem(
|
|
52026
|
+
const element = event.currentTarget;
|
|
52027
|
+
this.focusedPosition = this.getPosition(element);
|
|
52028
|
+
this.showItem(element, true);
|
|
51645
52029
|
};
|
|
51646
52030
|
this.handleBlur = (event) => {
|
|
51647
52031
|
this.showItem(event.currentTarget, false);
|
|
@@ -51651,10 +52035,17 @@ const Chart = class {
|
|
|
51651
52035
|
this.warnAboutOldTypeName();
|
|
51652
52036
|
}
|
|
51653
52037
|
componentWillRender() {
|
|
52038
|
+
this.grid = getSeriesGrid({
|
|
52039
|
+
type: this.chartType,
|
|
52040
|
+
items: this.items,
|
|
52041
|
+
series: this.series,
|
|
52042
|
+
});
|
|
51654
52043
|
this.warnOnChange('axisIncrement', this.getAxisIncrementWarning());
|
|
51655
52044
|
this.warnOnChange('language', this.getLanguageWarning());
|
|
51656
52045
|
this.warnOnChange('currency', this.getCurrencyWarning());
|
|
51657
52046
|
this.warnOnChange('items', this.getDateWarning());
|
|
52047
|
+
this.warnOnChange('series', this.getSeriesWarning());
|
|
52048
|
+
this.warnOnChange('stacked', this.getStackedWarning());
|
|
51658
52049
|
}
|
|
51659
52050
|
connectedCallback() {
|
|
51660
52051
|
this.draw();
|
|
@@ -51696,11 +52087,10 @@ const Chart = class {
|
|
|
51696
52087
|
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.`;
|
|
51697
52088
|
}
|
|
51698
52089
|
getDateWarning() {
|
|
51699
|
-
var _a;
|
|
51700
52090
|
if (this.valueFormat !== 'date') {
|
|
51701
52091
|
return;
|
|
51702
52092
|
}
|
|
51703
|
-
const wrong = (
|
|
52093
|
+
const wrong = getAllItems(this.grid)
|
|
51704
52094
|
.flatMap((item) => [item.value].flat())
|
|
51705
52095
|
.find((value) => !isDate(value));
|
|
51706
52096
|
if (wrong === undefined) {
|
|
@@ -51709,6 +52099,56 @@ const Chart = class {
|
|
|
51709
52099
|
const shown = typeof wrong === 'number' ? wrong : JSON.stringify(wrong);
|
|
51710
52100
|
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.`;
|
|
51711
52101
|
}
|
|
52102
|
+
getSeriesWarning() {
|
|
52103
|
+
var _a, _b, _c;
|
|
52104
|
+
if (!((_a = this.series) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
52105
|
+
return;
|
|
52106
|
+
}
|
|
52107
|
+
if (!canDrawSeries(this.chartType)) {
|
|
52108
|
+
const drawn = ((_b = this.items) === null || _b === void 0 ? void 0 : _b.length)
|
|
52109
|
+
? '`items`'
|
|
52110
|
+
: 'the items of the first series';
|
|
52111
|
+
return `limel-chart: \`series\` can only be drawn by \`bar\`, \`dot\`, \`line\`, and \`area\` charts, but \`type\` is \`${this.type}\`. Drawing ${drawn} instead.`;
|
|
52112
|
+
}
|
|
52113
|
+
if ((_c = this.items) === null || _c === void 0 ? void 0 : _c.length) {
|
|
52114
|
+
return 'limel-chart: both `items` and `series` are set. Drawing `series`, and leaving out `items`.';
|
|
52115
|
+
}
|
|
52116
|
+
}
|
|
52117
|
+
getStackedWarning() {
|
|
52118
|
+
if (!this.stacked) {
|
|
52119
|
+
return;
|
|
52120
|
+
}
|
|
52121
|
+
if (!canStack(this.chartType)) {
|
|
52122
|
+
return `limel-chart: \`stacked\` can only stack the series of \`bar\`, \`line\`, and \`area\` charts, but \`type\` is \`${this.type}\`. Ignoring \`stacked\`.`;
|
|
52123
|
+
}
|
|
52124
|
+
if (this.valueFormat === 'date') {
|
|
52125
|
+
return 'limel-chart: `stacked` cannot stack dates. Ignoring `stacked`.';
|
|
52126
|
+
}
|
|
52127
|
+
if (!this.drawsSeries) {
|
|
52128
|
+
return 'limel-chart: `stacked` stacks the `series` of a chart, but this chart has none. Ignoring `stacked`.';
|
|
52129
|
+
}
|
|
52130
|
+
}
|
|
52131
|
+
get stacksSeries() {
|
|
52132
|
+
return isStacked({
|
|
52133
|
+
type: this.chartType,
|
|
52134
|
+
series: this.series,
|
|
52135
|
+
stacked: this.stacked,
|
|
52136
|
+
valueFormat: this.valueFormat,
|
|
52137
|
+
});
|
|
52138
|
+
}
|
|
52139
|
+
get drawsSeries() {
|
|
52140
|
+
return Boolean(this.drawnSeries);
|
|
52141
|
+
}
|
|
52142
|
+
get drawnSeries() {
|
|
52143
|
+
return getDrawnSeries({ type: this.chartType, series: this.series });
|
|
52144
|
+
}
|
|
52145
|
+
get drawnItems() {
|
|
52146
|
+
return getDrawnItems({
|
|
52147
|
+
type: this.chartType,
|
|
52148
|
+
items: this.items,
|
|
52149
|
+
series: this.series,
|
|
52150
|
+
});
|
|
52151
|
+
}
|
|
51712
52152
|
get valueStyle() {
|
|
51713
52153
|
return {
|
|
51714
52154
|
type: this.chartType,
|
|
@@ -51721,7 +52161,6 @@ const Chart = class {
|
|
|
51721
52161
|
return this.type === 'stacked-bar' ? 'proportion-bar' : this.type;
|
|
51722
52162
|
}
|
|
51723
52163
|
getAxisIncrementWarning() {
|
|
51724
|
-
var _a;
|
|
51725
52164
|
const increment = this.axisIncrement;
|
|
51726
52165
|
if (increment === undefined ||
|
|
51727
52166
|
increment === null ||
|
|
@@ -51734,7 +52173,7 @@ const Chart = class {
|
|
|
51734
52173
|
if (!usesAxisIncrement(this.chartType)) {
|
|
51735
52174
|
return;
|
|
51736
52175
|
}
|
|
51737
|
-
const range = getAxisRange((
|
|
52176
|
+
const range = getAxisRange(getAxisItems(this.grid, this.stacksSeries), this.maxValue, increment);
|
|
51738
52177
|
if (range.increment !== increment) {
|
|
51739
52178
|
return `limel-chart: \`axisIncrement\` ${increment} would divide the axis into more than ${MAX_AXIS_STEPS} steps. Working out a step from the values instead.`;
|
|
51740
52179
|
}
|
|
@@ -51743,7 +52182,19 @@ const Chart = class {
|
|
|
51743
52182
|
if (this.loading) {
|
|
51744
52183
|
return h("limel-spinner", { limeBranded: false });
|
|
51745
52184
|
}
|
|
51746
|
-
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.
|
|
52185
|
+
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
|
|
52186
|
+
? this.renderCategories()
|
|
52187
|
+
: this.renderItems()))));
|
|
52188
|
+
}
|
|
52189
|
+
get hasLegend() {
|
|
52190
|
+
var _a, _b;
|
|
52191
|
+
return ((_b = (_a = this.drawnSeries) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 1;
|
|
52192
|
+
}
|
|
52193
|
+
renderLegend() {
|
|
52194
|
+
if (!this.hasLegend) {
|
|
52195
|
+
return;
|
|
52196
|
+
}
|
|
52197
|
+
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)))));
|
|
51747
52198
|
}
|
|
51748
52199
|
renderCaption() {
|
|
51749
52200
|
if (!this.accessibleLabel) {
|
|
@@ -51752,7 +52203,18 @@ const Chart = class {
|
|
|
51752
52203
|
return h("caption", null, this.accessibleLabel);
|
|
51753
52204
|
}
|
|
51754
52205
|
renderTableHeader() {
|
|
51755
|
-
|
|
52206
|
+
var _a, _b;
|
|
52207
|
+
const columns = (_b = (_a = this.drawnSeries) === null || _a === void 0 ? void 0 : _a.map((series) => series.text)) !== null && _b !== void 0 ? _b : [
|
|
52208
|
+
this.valuesLabel,
|
|
52209
|
+
];
|
|
52210
|
+
return (h("thead", null, this.renderSeriesGroupHeader(), h("tr", null, h("th", { scope: "col" }, this.itemsLabel), columns.map((column) => (h("th", { scope: "col" }, column))))));
|
|
52211
|
+
}
|
|
52212
|
+
renderSeriesGroupHeader() {
|
|
52213
|
+
const allSeries = this.drawnSeries;
|
|
52214
|
+
if (!allSeries || !this.accessibleValuesLabel) {
|
|
52215
|
+
return;
|
|
52216
|
+
}
|
|
52217
|
+
return (h("tr", null, h("td", null), h("th", { scope: "col", colSpan: allSeries.length }, this.accessibleValuesLabel)));
|
|
51756
52218
|
}
|
|
51757
52219
|
get itemsLabel() {
|
|
51758
52220
|
var _a;
|
|
@@ -51763,13 +52225,46 @@ const Chart = class {
|
|
|
51763
52225
|
return ((_a = this.accessibleValuesLabel) !== null && _a !== void 0 ? _a : translations.get('value', this.language));
|
|
51764
52226
|
}
|
|
51765
52227
|
renderItems() {
|
|
51766
|
-
|
|
51767
|
-
const tabStop = findTabStop(
|
|
51768
|
-
return
|
|
52228
|
+
const items = this.drawnItems;
|
|
52229
|
+
const tabStop = findTabStop(items, this.focusedPosition.index);
|
|
52230
|
+
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)))));
|
|
51769
52231
|
}
|
|
51770
52232
|
getRowDescription(index) {
|
|
51771
|
-
const
|
|
51772
|
-
|
|
52233
|
+
const items = this.drawnItems;
|
|
52234
|
+
const label = getItemLabel(Object.assign(Object.assign({}, this.valueStyle), { items: items, maxValue: this.maxValue, displayItemPercentage: this.displayItemPercentage }), index);
|
|
52235
|
+
return label === items[index].text ? undefined : label;
|
|
52236
|
+
}
|
|
52237
|
+
renderCategories() {
|
|
52238
|
+
const grid = this.grid;
|
|
52239
|
+
const tabStop = this.findTabStopInGrid(grid);
|
|
52240
|
+
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)))));
|
|
52241
|
+
}
|
|
52242
|
+
renderCell(item, position, tabStop) {
|
|
52243
|
+
if (!item) {
|
|
52244
|
+
return h("td", null);
|
|
52245
|
+
}
|
|
52246
|
+
const isTabStop = position.series === (tabStop === null || tabStop === void 0 ? void 0 : tabStop.series) &&
|
|
52247
|
+
position.index === (tabStop === null || tabStop === void 0 ? void 0 : tabStop.index);
|
|
52248
|
+
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)));
|
|
52249
|
+
}
|
|
52250
|
+
getButtonLabel(item, position) {
|
|
52251
|
+
return [
|
|
52252
|
+
this.grid.categories[position.index],
|
|
52253
|
+
this.grid.series[position.series].text,
|
|
52254
|
+
formatValue(item, this.valueStyle),
|
|
52255
|
+
].join(', ');
|
|
52256
|
+
}
|
|
52257
|
+
findTabStopInGrid(grid) {
|
|
52258
|
+
const focused = this.focusedPosition;
|
|
52259
|
+
if (getItemAt(grid, focused)) {
|
|
52260
|
+
return focused;
|
|
52261
|
+
}
|
|
52262
|
+
const first = { series: 0, index: 0 };
|
|
52263
|
+
const series = getNearestSeries(grid, first);
|
|
52264
|
+
if (series === undefined) {
|
|
52265
|
+
return;
|
|
52266
|
+
}
|
|
52267
|
+
return Object.assign(Object.assign({}, first), { series: series });
|
|
51773
52268
|
}
|
|
51774
52269
|
draw() {
|
|
51775
52270
|
var _a;
|
|
@@ -51846,20 +52341,23 @@ const Chart = class {
|
|
|
51846
52341
|
this.chart.on('mouseout', this.handleChartOut);
|
|
51847
52342
|
}
|
|
51848
52343
|
updateChart() {
|
|
51849
|
-
var _a, _b;
|
|
52344
|
+
var _a, _b, _c, _d;
|
|
51850
52345
|
const settings = this.getSettings();
|
|
51851
52346
|
const drawnSettings = JSON.stringify(settings);
|
|
51852
52347
|
if (drawnSettings === this.drawnSettings && !this.themeMayHaveChanged) {
|
|
51853
52348
|
return;
|
|
51854
52349
|
}
|
|
51855
52350
|
this.themeMayHaveChanged = false;
|
|
51856
|
-
(_a = this.
|
|
51857
|
-
|
|
51858
|
-
const theme = this.themeReader.theme();
|
|
52351
|
+
(_a = this.stopWatchingTheme) !== null && _a !== void 0 ? _a : (this.stopWatchingTheme = watchTheme(this.host, this.handleThemeChange));
|
|
52352
|
+
const theme = this.getThemeReader().theme();
|
|
51859
52353
|
const coloredSettings = this.withItemColors(settings, theme);
|
|
51860
52354
|
const drawnTheme = JSON.stringify({
|
|
51861
52355
|
theme: theme,
|
|
51862
52356
|
itemColors: coloredSettings.items.map((item) => item.color),
|
|
52357
|
+
seriesColors: (_b = coloredSettings.series) === null || _b === void 0 ? void 0 : _b.map((series) => [
|
|
52358
|
+
series.color,
|
|
52359
|
+
...series.items.map((item) => item.color),
|
|
52360
|
+
]),
|
|
51863
52361
|
});
|
|
51864
52362
|
if (drawnSettings === this.drawnSettings &&
|
|
51865
52363
|
drawnTheme === this.drawnTheme) {
|
|
@@ -51869,9 +52367,10 @@ const Chart = class {
|
|
|
51869
52367
|
this.drawnTheme = drawnTheme;
|
|
51870
52368
|
this.drawing = drawChart(coloredSettings, theme, this.itemSpace);
|
|
51871
52369
|
this.chart.setOption(this.drawing.option, { notMerge: true });
|
|
51872
|
-
|
|
51873
|
-
|
|
51874
|
-
|
|
52370
|
+
this.showSeriesColors((_d = (_c = coloredSettings.series) === null || _c === void 0 ? void 0 : _c.map((series) => series.color)) !== null && _d !== void 0 ? _d : []);
|
|
52371
|
+
const focused = this.host.shadowRoot.activeElement;
|
|
52372
|
+
if (focused instanceof HTMLElement && focused.dataset.index) {
|
|
52373
|
+
this.showItem(focused, true);
|
|
51875
52374
|
}
|
|
51876
52375
|
}
|
|
51877
52376
|
fitItemTextsToSize() {
|
|
@@ -51891,33 +52390,74 @@ const Chart = class {
|
|
|
51891
52390
|
}
|
|
51892
52391
|
getSettings() {
|
|
51893
52392
|
var _a;
|
|
51894
|
-
return Object.assign(Object.assign({ items: ((_a = this.
|
|
51895
|
-
|
|
51896
|
-
|
|
51897
|
-
|
|
51898
|
-
|
|
51899
|
-
|
|
51900
|
-
|
|
52393
|
+
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) => {
|
|
52394
|
+
var _a;
|
|
52395
|
+
return ({
|
|
52396
|
+
text: series.text,
|
|
52397
|
+
color: series.color,
|
|
52398
|
+
items: ((_a = series.items) !== null && _a !== void 0 ? _a : []).map((item) => copyItem(item)),
|
|
52399
|
+
});
|
|
52400
|
+
}), 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 });
|
|
51901
52401
|
}
|
|
51902
52402
|
withItemColors(settings, theme) {
|
|
51903
|
-
|
|
52403
|
+
var _a;
|
|
52404
|
+
const seriesOfItems = getSeriesOfDrawnItems({
|
|
52405
|
+
type: this.chartType,
|
|
52406
|
+
items: this.items,
|
|
52407
|
+
series: this.series,
|
|
52408
|
+
});
|
|
52409
|
+
const itemColor = seriesOfItems
|
|
52410
|
+
? this.getSeriesColor(seriesOfItems, 0, theme)
|
|
52411
|
+
: theme.itemColor;
|
|
52412
|
+
const itemFallback = seriesOfItems
|
|
52413
|
+
? 'the color of its series'
|
|
52414
|
+
: 'the default item color';
|
|
52415
|
+
return Object.assign(Object.assign({}, settings), { items: settings.items.map((item) => {
|
|
52416
|
+
var _a;
|
|
52417
|
+
return (Object.assign(Object.assign({}, item), { color: (_a = this.readColor(item.color, 'item', itemFallback)) !== null && _a !== void 0 ? _a : itemColor }));
|
|
52418
|
+
}), series: (_a = settings.series) === null || _a === void 0 ? void 0 : _a.map((series, index) => {
|
|
52419
|
+
const color = this.getSeriesColor(series, index, theme);
|
|
52420
|
+
return Object.assign(Object.assign({}, series), { color: color, items: series.items.map((item) => {
|
|
52421
|
+
var _a;
|
|
52422
|
+
return (Object.assign(Object.assign({}, item), { color: (_a = this.readColor(item.color, 'item', 'the color of its series')) !== null && _a !== void 0 ? _a : color }));
|
|
52423
|
+
}) });
|
|
52424
|
+
}) });
|
|
52425
|
+
}
|
|
52426
|
+
getSeriesColor(series, index, theme) {
|
|
52427
|
+
var _a, _b;
|
|
52428
|
+
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);
|
|
51904
52429
|
}
|
|
51905
|
-
|
|
51906
|
-
|
|
51907
|
-
|
|
52430
|
+
showSeriesColors(colors) {
|
|
52431
|
+
const shown = this.seriesColors;
|
|
52432
|
+
const same = colors.length === shown.length &&
|
|
52433
|
+
colors.every((color, index) => color === shown[index]);
|
|
52434
|
+
if (same) {
|
|
52435
|
+
return;
|
|
51908
52436
|
}
|
|
51909
|
-
|
|
51910
|
-
if (
|
|
51911
|
-
|
|
52437
|
+
this.seriesColors = colors;
|
|
52438
|
+
if (this.hasLegend) {
|
|
52439
|
+
forceUpdate(this);
|
|
52440
|
+
}
|
|
52441
|
+
}
|
|
52442
|
+
readColor(color, owner, fallback) {
|
|
52443
|
+
if (!color) {
|
|
52444
|
+
return;
|
|
51912
52445
|
}
|
|
51913
|
-
|
|
51914
|
-
|
|
51915
|
-
|
|
52446
|
+
const resolved = this.getThemeReader().color(color);
|
|
52447
|
+
if (!resolved && !this.invalidColors.has(color)) {
|
|
52448
|
+
this.invalidColors.add(color);
|
|
52449
|
+
const hint = color.includes('var(')
|
|
51916
52450
|
? ' Check that its variables are set, and that they make a color.'
|
|
51917
52451
|
: '';
|
|
51918
|
-
|
|
52452
|
+
const article = owner === 'item' ? 'an' : 'a';
|
|
52453
|
+
console.warn(`limel-chart: the color of ${article} ${owner} must be a CSS color, but was \`${color}\`.${hint} Using ${fallback} instead.`);
|
|
51919
52454
|
}
|
|
51920
|
-
return
|
|
52455
|
+
return resolved;
|
|
52456
|
+
}
|
|
52457
|
+
getThemeReader() {
|
|
52458
|
+
var _a;
|
|
52459
|
+
(_a = this.themeReader) !== null && _a !== void 0 ? _a : (this.themeReader = createThemeReader(this.host.shadowRoot));
|
|
52460
|
+
return this.themeReader;
|
|
51921
52461
|
}
|
|
51922
52462
|
observeSize() {
|
|
51923
52463
|
if (this.resizeObserver || typeof ResizeObserver === 'undefined') {
|
|
@@ -51935,40 +52475,102 @@ const Chart = class {
|
|
|
51935
52475
|
this.drawnTheme = undefined;
|
|
51936
52476
|
this.itemSpace = undefined;
|
|
51937
52477
|
}
|
|
52478
|
+
getClickedPosition(event) {
|
|
52479
|
+
const position = findItem(this.drawing, event);
|
|
52480
|
+
if (event.seriesType !== 'line' || !event.event) {
|
|
52481
|
+
return position;
|
|
52482
|
+
}
|
|
52483
|
+
return Object.assign(Object.assign({}, position), { index: this.getNearestPlace(event.event) });
|
|
52484
|
+
}
|
|
52485
|
+
getNearestPlace(pixel) {
|
|
52486
|
+
const landscape = this.orientation === 'landscape';
|
|
52487
|
+
const place = this.chart.convertFromPixel(landscape ? { xAxisIndex: 0 } : { yAxisIndex: 0 }, landscape ? pixel.offsetX : pixel.offsetY);
|
|
52488
|
+
return Math.round(place);
|
|
52489
|
+
}
|
|
51938
52490
|
highlightItemAt(event, highlight) {
|
|
51939
52491
|
if (!this.drawing) {
|
|
51940
52492
|
return;
|
|
51941
52493
|
}
|
|
51942
|
-
const location = locateItem(this.drawing,
|
|
52494
|
+
const location = locateItem(this.drawing, findItem(this.drawing, event));
|
|
51943
52495
|
if (location.seriesIndex === event.seriesIndex) {
|
|
51944
52496
|
return;
|
|
51945
52497
|
}
|
|
51946
52498
|
this.chart.dispatchAction(Object.assign({ type: highlight ? 'highlight' : 'downplay' }, location));
|
|
51947
52499
|
}
|
|
51948
|
-
getClickableItem(
|
|
51949
|
-
const item = this.
|
|
52500
|
+
getClickableItem(position) {
|
|
52501
|
+
const item = getItemAt(this.grid, position);
|
|
51950
52502
|
if (!(item === null || item === void 0 ? void 0 : item.clickable)) {
|
|
51951
52503
|
return;
|
|
51952
52504
|
}
|
|
51953
52505
|
return item;
|
|
51954
52506
|
}
|
|
51955
|
-
|
|
51956
|
-
|
|
52507
|
+
getPosition(element) {
|
|
52508
|
+
var _a;
|
|
52509
|
+
return {
|
|
52510
|
+
series: Number((_a = element.dataset.series) !== null && _a !== void 0 ? _a : 0),
|
|
52511
|
+
index: Number(element.dataset.index),
|
|
52512
|
+
};
|
|
52513
|
+
}
|
|
52514
|
+
getEventPosition(event) {
|
|
52515
|
+
return this.getPosition(event.currentTarget);
|
|
51957
52516
|
}
|
|
51958
|
-
|
|
51959
|
-
if (
|
|
52517
|
+
findTarget(key, position, orientation) {
|
|
52518
|
+
if (!this.drawsSeries) {
|
|
52519
|
+
const items = this.drawnItems;
|
|
52520
|
+
const index = findNavigationTarget(items, key, position.index, {
|
|
52521
|
+
orientation: orientation,
|
|
52522
|
+
});
|
|
52523
|
+
return { series: 0, index: index };
|
|
52524
|
+
}
|
|
52525
|
+
const grid = this.grid;
|
|
52526
|
+
if (orientation === 'horizontal') {
|
|
52527
|
+
const items = grid.series.map((series) => series.items[position.index]);
|
|
52528
|
+
const series = findNavigationTarget(items, key, position.series, {
|
|
52529
|
+
orientation: orientation,
|
|
52530
|
+
isDisabled: (item) => !item,
|
|
52531
|
+
});
|
|
52532
|
+
return { series: series, index: position.index };
|
|
52533
|
+
}
|
|
52534
|
+
const index = findNavigationTarget(grid.categories, key, position.index, { orientation: orientation });
|
|
52535
|
+
const series = getNearestSeries(grid, {
|
|
52536
|
+
series: position.series,
|
|
52537
|
+
index: index,
|
|
52538
|
+
});
|
|
52539
|
+
return { series: series !== null && series !== void 0 ? series : NO_NAVIGATION_TARGET, index: index };
|
|
52540
|
+
}
|
|
52541
|
+
focusItem(position) {
|
|
52542
|
+
if (position.series === NO_NAVIGATION_TARGET ||
|
|
52543
|
+
position.index === NO_NAVIGATION_TARGET) {
|
|
51960
52544
|
return;
|
|
51961
52545
|
}
|
|
51962
|
-
const
|
|
51963
|
-
|
|
52546
|
+
const series = this.drawsSeries
|
|
52547
|
+
? `[data-series="${position.series}"]`
|
|
52548
|
+
: '';
|
|
52549
|
+
const element = this.host.shadowRoot.querySelector(`tbody [data-index="${position.index}"]${series}`);
|
|
52550
|
+
element === null || element === void 0 ? void 0 : element.focus();
|
|
51964
52551
|
}
|
|
51965
|
-
showItem(
|
|
52552
|
+
showItem(element, show) {
|
|
51966
52553
|
if (!this.chart || !this.drawing) {
|
|
51967
52554
|
return;
|
|
51968
52555
|
}
|
|
51969
|
-
const
|
|
52556
|
+
const position = this.getPosition(element);
|
|
52557
|
+
const location = locateItem(this.drawing, position);
|
|
51970
52558
|
this.chart.dispatchAction(Object.assign({ type: show ? 'highlight' : 'downplay' }, location));
|
|
51971
|
-
|
|
52559
|
+
if (!show) {
|
|
52560
|
+
this.chart.dispatchAction(this.drawsSeries
|
|
52561
|
+
? { type: 'updateAxisPointer', currTrigger: 'leave' }
|
|
52562
|
+
: { type: 'hideTip' });
|
|
52563
|
+
return;
|
|
52564
|
+
}
|
|
52565
|
+
this.chart.dispatchAction(Object.assign({ type: 'showTip' }, (this.drawsSeries
|
|
52566
|
+
? this.getMiddleOfPlace(position.index)
|
|
52567
|
+
: location)));
|
|
52568
|
+
}
|
|
52569
|
+
getMiddleOfPlace(index) {
|
|
52570
|
+
const { minValue, maxValue } = this.drawing.valueRange;
|
|
52571
|
+
const middle = (minValue + maxValue) / 2;
|
|
52572
|
+
const [x, y] = this.chart.convertToPixel({ gridIndex: 0 }, this.orientation === 'landscape' ? [index, middle] : [middle, index]);
|
|
52573
|
+
return { x: x, y: y };
|
|
51972
52574
|
}
|
|
51973
52575
|
get host() { return getElement(this); }
|
|
51974
52576
|
static get watchers() { return {
|