@ids-group-ltd/ids-design-system 0.14.8 → 0.15.1
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 +1145 -234
- package/components.md +122 -53
- package/docs/agent/INDEX.md +5 -3
- package/docs/agent/charts/column-series-component.md +1 -1
- package/docs/agent/charts/ds-bar-chart.md +7 -4
- package/docs/agent/charts/ds-chart.md +1 -1
- package/docs/agent/charts/ds-column-chart.md +2 -1
- package/docs/agent/charts/ds-funnel-chart.md +1 -1
- package/docs/agent/charts/ds-heatmap-chart.md +2 -1
- package/docs/agent/charts/ds-line-chart.md +3 -3
- package/docs/agent/charts/ds-pie-chart.md +3 -2
- package/docs/agent/charts/ds-scatter-chart.md +2 -1
- package/docs/agent/charts/ds-waterfall-chart.md +2 -2
- package/docs/agent/charts/line-series-component.md +1 -1
- package/docs/agent/feedback/ds-alert.md +1 -0
- package/docs/agent/feedback/ds-banner.md +1 -0
- package/docs/agent/feedback/ds-loading-overlay.md +2 -0
- package/docs/agent/feedback/ds-skeleton.md +1 -1
- package/docs/agent/feedback/ds-toast.md +2 -0
- package/docs/agent/forms/ds-autocomplete.md +1 -1
- package/docs/agent/forms/ds-button.md +1 -0
- package/docs/agent/forms/ds-checkbox.md +1 -1
- package/docs/agent/forms/ds-color-picker.md +1 -1
- package/docs/agent/forms/ds-date-picker.md +2 -1
- package/docs/agent/forms/ds-icon-button.md +1 -1
- package/docs/agent/forms/ds-input.md +1 -1
- package/docs/agent/forms/ds-multi-select.md +1 -1
- package/docs/agent/forms/ds-otp-input.md +1 -1
- package/docs/agent/forms/ds-radio-group.md +1 -1
- package/docs/agent/forms/ds-segmented.md +1 -1
- package/docs/agent/forms/ds-select.md +1 -1
- package/docs/agent/forms/ds-slider.md +1 -1
- package/docs/agent/forms/ds-switch.md +1 -1
- package/docs/agent/forms/ds-textarea.md +1 -1
- package/docs/agent/forms/ds-time-picker.md +1 -1
- package/docs/agent/forms/the-picker-family-ds-select-ds-multi-select-ds-autocomplete.md +1 -1
- package/docs/agent/foundations/global-helper-classes.md +4 -4
- package/docs/agent/foundations/tokens.md +1 -1
- package/docs/agent/navigation/ds-pagination.md +2 -1
- package/docs/agent/overlays/ds-bottom-sheet.md +1 -1
- package/docs/agent/overlays/ds-definition-term.md +10 -0
- package/docs/agent/overlays/ds-drawer.md +1 -1
- package/docs/agent/overlays/ds-info-hint.md +29 -0
- package/docs/agent/overlays/ds-menu.md +1 -1
- package/docs/agent/overlays/ds-modal-card.md +1 -1
- package/docs/agent/overlays/ds-modal.md +19 -1
- package/docs/agent/overlays/ds-tooltip-panel.md +1 -1
- package/docs/agent/overlays/ds-tooltip.md +3 -3
- package/docs/agent/tables/ds-table-columns.md +2 -0
- package/docs/agent/tables/ds-table.md +4 -3
- package/eslint/deprecated-api.json +889 -0
- package/eslint/index.mjs +394 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +6 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +6 -12
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +27 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +6 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +169 -37
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +8 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +7 -17
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +875 -90
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +2183 -1232
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +10 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +15 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +50 -11
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +22 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-definition-term.mjs +107 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-definition-term.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +5 -15
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs +44 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +11 -22
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs +51 -21
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +5 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-info-hint.mjs +110 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-info-hint.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +11 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs +6 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +41 -46
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +183 -31
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +21 -26
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +27 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +10 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +14 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +106 -29
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +7 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +12 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +140 -26
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +10 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +29 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-show-dirty.mjs +55 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-show-dirty.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +6 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +10 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sparkline.mjs +5 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-sparkline.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +10 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +36 -18
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs +17 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +193 -19
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +15 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +26 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +20 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +434 -157
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +18 -11
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +323 -68
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +27 -83
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +3 -0
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.10.0.json +79 -21
- package/migrations/0.10.1.json +38 -21
- package/migrations/0.10.2.json +44 -7
- package/migrations/0.10.3.json +7 -5
- package/migrations/0.11.0.json +10 -7
- package/migrations/0.11.1.json +25 -14
- package/migrations/0.11.2.json +3 -3
- package/migrations/0.11.3.json +9 -6
- package/migrations/0.11.4.json +13 -12
- package/migrations/0.12.1.json +41 -14
- package/migrations/0.12.2.json +7 -6
- package/migrations/0.12.3.json +3 -3
- package/migrations/0.13.0.json +11 -11
- package/migrations/0.13.1.json +60 -8
- package/migrations/0.13.2.json +98 -44
- package/migrations/0.13.3.json +46 -16
- package/migrations/0.13.4.json +23 -22
- package/migrations/0.14.0.json +5 -5
- package/migrations/0.14.1.json +5 -5
- package/migrations/0.14.2.json +1 -1
- package/migrations/0.14.4.json +6 -5
- package/migrations/0.14.5.json +13 -7
- package/migrations/0.14.6.json +2 -2
- package/migrations/0.14.8.json +26 -2
- package/migrations/0.15.0.json +999 -0
- package/migrations/0.15.1.json +738 -0
- package/migrations/0.2.0.json +2 -2
- package/migrations/0.3.0.json +43 -6
- package/migrations/0.4.0.json +95 -13
- package/migrations/0.5.0.json +116 -10
- package/migrations/0.5.1.json +97 -11
- package/migrations/0.6.0.json +30 -1
- package/migrations/0.6.1.json +22 -1
- package/migrations/0.6.2.json +8 -4
- package/migrations/0.6.3.json +17 -5
- package/migrations/0.7.0.json +58 -9
- package/migrations/0.7.1.json +62 -8
- package/migrations/0.8.0.json +60 -12
- package/migrations/0.9.0.json +68 -25
- package/migrations/0.9.1.json +1 -1
- package/migrations/README.md +57 -3
- package/package.json +27 -1
- package/schematics/check-overrides/index.cjs +4 -11
- package/schematics/check-overrides/scan.cjs +12 -1
- package/schematics/check-overrides/surface.json +94 -11
- package/schematics/ng-add/index.cjs +7 -1
- package/stylelint/deprecated-tokens.json +2711 -0
- package/stylelint/index.mjs +94 -0
- package/stylelint/since-version.mjs +26 -0
- package/styles/_chart-frame.scss +14 -0
- package/styles/_chart-interactive.scss +26 -1
- package/styles/_chart-motion.scss +50 -17
- package/styles/_chip-row.scss +5 -2
- package/styles/_clear-button.scss +2 -0
- package/styles/_component-base.scss +56 -0
- package/styles/_dismiss-button.scss +16 -0
- package/styles/_dropdown-overlay.scss +19 -0
- package/styles/_focus.scss +4 -1
- package/styles/_link.scss +35 -12
- package/styles/_overlay-motion.scss +4 -6
- package/styles/_pinned.scss +43 -0
- package/styles/_skeleton-shimmer.scss +2 -8
- package/styles/_table-controls.scss +4 -0
- package/styles/_target.scss +40 -0
- package/styles/_text-clip.scss +23 -4
- package/styles/_tokens.scss +3 -1
- package/styles/_typography.scss +2 -0
- package/styles/_visually-hidden.scss +2 -0
- package/styles/ds.scss +0 -1
- package/themes/README.md +60 -7
- package/themes/_semantic.scss +5 -8
- package/themes/dark/_theme.scss +5 -8
- package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +74 -4
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +3 -2
- package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +4 -4
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +87 -7
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +207 -29
- package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +30 -4
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-definition-term.d.ts +22 -0
- package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +0 -1
- package/types/ids-group-ltd-ids-design-system-components-field-message.d.ts +19 -2
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +7 -6
- package/types/ids-group-ltd-ids-design-system-components-heatmap-chart.d.ts +22 -8
- package/types/ids-group-ltd-ids-design-system-components-icon-button.d.ts +3 -2
- package/types/ids-group-ltd-ids-design-system-components-info-hint.d.ts +23 -0
- package/types/ids-group-ltd-ids-design-system-components-input.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +18 -7
- package/types/ids-group-ltd-ids-design-system-components-menu.d.ts +14 -3
- package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +0 -2
- package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-otp-input.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +5 -3
- package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +26 -7
- package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +2 -1
- package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +52 -10
- package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-show-dirty.d.ts +29 -0
- package/types/ids-group-ltd-ids-design-system-components-slider.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-table-resize.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +39 -9
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +54 -24
- package/types/ids-group-ltd-ids-design-system-components-waterfall-chart.d.ts +9 -2
- package/types/ids-group-ltd-ids-design-system-components.d.ts +135 -35
- package/types/ids-group-ltd-ids-design-system-core.d.ts +46 -23
- package/types/ids-group-ltd-ids-design-system.d.ts +6 -3
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed, inject, ElementRef, afterRenderEffect, ChangeDetectionStrategy, ViewEncapsulation, Component, ViewContainerRef, effect, DestroyRef, Directive, signal, InjectionToken, output, booleanAttribute } from '@angular/core';
|
|
2
|
+
import { input, computed, inject, ElementRef, afterRenderEffect, ChangeDetectionStrategy, ViewEncapsulation, Component, ViewContainerRef, effect, DestroyRef, Directive, signal, PLATFORM_ID, NgZone, InjectionToken, output, booleanAttribute } from '@angular/core';
|
|
3
3
|
import { Overlay } from '@angular/cdk/overlay';
|
|
4
4
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
5
|
-
import { forwardOverlayTokens, closeOnScroll, disposeWithLeave, chartDwell } from '@ids-group-ltd/ids-design-system/components';
|
|
6
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
5
|
+
import { forwardOverlayTokens, closeOnScroll, listenForEscape, chartTiming, CHART_GLIDE_HEAD_START_MS, disposeWithLeave, chartDwell, chartOf, afterTwoFrames, skeletonWaterfallSteps, skeletonColumnHeights, skeletonLineClip, CHART_SKELETON_COUNT } from '@ids-group-ltd/ids-design-system/components';
|
|
6
|
+
import { NgTemplateOutlet, isPlatformBrowser } from '@angular/common';
|
|
7
7
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
8
8
|
import { ICONS, DS_INTL } from '@ids-group-ltd/ids-design-system/core';
|
|
9
|
+
import { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';
|
|
10
|
+
import { LoadingOverlayComponent } from '@ids-group-ltd/ids-design-system/components/loading-overlay';
|
|
9
11
|
|
|
10
12
|
// Below this the dot reads as the panel itself, as the palest heat step does on a light panel (1.14:1).
|
|
11
13
|
// A merely low-contrast hue still reads as a colour next to its label and takes no ring.
|
|
@@ -87,14 +89,14 @@ class ChartTooltipPanelComponent {
|
|
|
87
89
|
});
|
|
88
90
|
}
|
|
89
91
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartTooltipPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
90
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartTooltipPanelComponent, isStandalone: true, selector: "ds-chart-tooltip-panel", inputs: { context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null }, swatches: { classPropertyName: "swatches", publicName: "swatches", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" } }, ngImport: i0, template: "@if (template(); as projected) {\n <ng-container\n [ngTemplateOutlet]=\"projected\"\n [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n} @else {\n @if (context().category) {\n <p class=\"category\">\n {{ context().category }}\n </p>\n }\n\n <ul\n class=\"entries\"\n [class.no-swatches]=\"!showsSwatches()\">\n @for (entry of context().entries; track $index) {\n <li class=\"entry\">\n @if (showsSwatches()) {\n <span\n class=\"swatch\"\n [class.hatched]=\"entry.hatched\"\n [style.background-color]=\"entry.color\">\n </span>\n }\n\n <span class=\"label\">\n {{ entry.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formatted }}\n </span>\n\n @if (entry.detail) {\n <span class=\"detail\">\n {{ entry.detail }}\n </span>\n }\n </li>\n }\n </ul>\n}\n", styles: [":host{--_chart-tooltip-bg-color: var(--ds-chart-tooltip-bg-color);--_chart-tooltip-text-color: var(--ds-chart-tooltip-text-color);--_chart-tooltip-border-color: var(--ds-chart-tooltip-border-color);--_chart-tooltip-hatch-color: var(--ds-chart-hatch-color, var(--surface-default));--_chart-tooltip-hatch-width: var(--ds-chart-hatch-width);display:block;background:var(--_chart-tooltip-bg-color);color:var(--_chart-tooltip-text-color);border:var(--border-width-default) solid var(--_chart-tooltip-border-color);border-radius:var(--ds-radius-control);box-shadow:var(--ds-elevation-overlay);padding:var(--space-2) var(--space-2-5);max-width:var(--tooltip-maxw);max-height:calc(100dvh - 2 * var(--space-3));overflow-y:auto;z-index:var(--layer-tooltip);font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans)
|
|
92
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartTooltipPanelComponent, isStandalone: true, selector: "ds-chart-tooltip-panel", inputs: { context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null }, swatches: { classPropertyName: "swatches", publicName: "swatches", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" } }, ngImport: i0, template: "@if (template(); as projected) {\n <ng-container\n [ngTemplateOutlet]=\"projected\"\n [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n} @else {\n @if (context().category) {\n <p class=\"category\">\n {{ context().category }}\n </p>\n }\n\n <ul\n class=\"entries\"\n [class.no-swatches]=\"!showsSwatches()\">\n @for (entry of context().entries; track $index) {\n <li class=\"entry\">\n @if (showsSwatches()) {\n <span\n class=\"swatch\"\n [class.hatched]=\"entry.hatched\"\n [style.background-color]=\"entry.color\">\n </span>\n }\n\n <span class=\"label\">\n {{ entry.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formatted }}\n </span>\n\n @if (entry.detail) {\n <span class=\"detail\">\n {{ entry.detail }}\n </span>\n }\n </li>\n }\n </ul>\n}\n", styles: ["@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}:host{--_chart-tooltip-bg-color: var(--ds-chart-tooltip-bg-color);--_chart-tooltip-text-color: var(--ds-chart-tooltip-text-color);--_chart-tooltip-border-color: var(--ds-chart-tooltip-border-color);--_chart-tooltip-hatch-color: var(--ds-chart-hatch-color, var(--surface-default));--_chart-tooltip-hatch-width: var(--ds-chart-hatch-width);display:block;background:var(--_chart-tooltip-bg-color);color:var(--_chart-tooltip-text-color);border:var(--border-width-default) solid var(--_chart-tooltip-border-color);border-radius:var(--ds-radius-control);box-shadow:var(--ds-elevation-overlay);padding:var(--space-2) var(--space-2-5);max-width:var(--tooltip-maxw);max-height:calc(100dvh - 2 * var(--space-3));overflow-y:auto;z-index:var(--layer-tooltip);font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans)}.category{margin:0 0 var(--space-1-5);font-weight:var(--font-weight-medium)}.entries{display:grid;gap:var(--space-1);margin:0;padding:0;list-style:none}.entry{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:var(--space-2)}.no-swatches .entry{grid-template-columns:1fr auto}.detail{grid-column:2/-1;margin-block-start:calc(var(--space-1) * -1);color:var(--_chart-tooltip-text-color);opacity:.7;font-size:var(--font-size-2xs)}.no-swatches .detail{grid-column:1/-1}.swatch{inline-size:var(--space-3);block-size:var(--space-3);border-radius:var(--radius-pill)}.swatch.ringed{box-shadow:inset 0 0 0 1.5px var(--_chart-tooltip-text-color)}.swatch.hatched{background-image:linear-gradient(-45deg,transparent calc(50% - var(--_chart-tooltip-hatch-width) / 2),var(--_chart-tooltip-hatch-color) calc(50% - var(--_chart-tooltip-hatch-width) / 2),var(--_chart-tooltip-hatch-color) calc(50% + var(--_chart-tooltip-hatch-width) / 2),transparent calc(50% + var(--_chart-tooltip-hatch-width) / 2))}.value{font-variant-numeric:tabular-nums;font-weight:var(--font-weight-medium)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
91
93
|
}
|
|
92
94
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartTooltipPanelComponent, decorators: [{
|
|
93
95
|
type: Component,
|
|
94
96
|
args: [{ selector: 'ds-chart-tooltip-panel', standalone: true, imports: [NgTemplateOutlet], host: {
|
|
95
97
|
// Hidden from AT: every interactive mark's `aria-label` already carries the reading.
|
|
96
98
|
'aria-hidden': 'true',
|
|
97
|
-
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (template(); as projected) {\n <ng-container\n [ngTemplateOutlet]=\"projected\"\n [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n} @else {\n @if (context().category) {\n <p class=\"category\">\n {{ context().category }}\n </p>\n }\n\n <ul\n class=\"entries\"\n [class.no-swatches]=\"!showsSwatches()\">\n @for (entry of context().entries; track $index) {\n <li class=\"entry\">\n @if (showsSwatches()) {\n <span\n class=\"swatch\"\n [class.hatched]=\"entry.hatched\"\n [style.background-color]=\"entry.color\">\n </span>\n }\n\n <span class=\"label\">\n {{ entry.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formatted }}\n </span>\n\n @if (entry.detail) {\n <span class=\"detail\">\n {{ entry.detail }}\n </span>\n }\n </li>\n }\n </ul>\n}\n", styles: [":host{--_chart-tooltip-bg-color: var(--ds-chart-tooltip-bg-color);--_chart-tooltip-text-color: var(--ds-chart-tooltip-text-color);--_chart-tooltip-border-color: var(--ds-chart-tooltip-border-color);--_chart-tooltip-hatch-color: var(--ds-chart-hatch-color, var(--surface-default));--_chart-tooltip-hatch-width: var(--ds-chart-hatch-width);display:block;background:var(--_chart-tooltip-bg-color);color:var(--_chart-tooltip-text-color);border:var(--border-width-default) solid var(--_chart-tooltip-border-color);border-radius:var(--ds-radius-control);box-shadow:var(--ds-elevation-overlay);padding:var(--space-2) var(--space-2-5);max-width:var(--tooltip-maxw);max-height:calc(100dvh - 2 * var(--space-3));overflow-y:auto;z-index:var(--layer-tooltip);font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans)
|
|
99
|
+
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (template(); as projected) {\n <ng-container\n [ngTemplateOutlet]=\"projected\"\n [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n} @else {\n @if (context().category) {\n <p class=\"category\">\n {{ context().category }}\n </p>\n }\n\n <ul\n class=\"entries\"\n [class.no-swatches]=\"!showsSwatches()\">\n @for (entry of context().entries; track $index) {\n <li class=\"entry\">\n @if (showsSwatches()) {\n <span\n class=\"swatch\"\n [class.hatched]=\"entry.hatched\"\n [style.background-color]=\"entry.color\">\n </span>\n }\n\n <span class=\"label\">\n {{ entry.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formatted }}\n </span>\n\n @if (entry.detail) {\n <span class=\"detail\">\n {{ entry.detail }}\n </span>\n }\n </li>\n }\n </ul>\n}\n", styles: ["@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}:host{--_chart-tooltip-bg-color: var(--ds-chart-tooltip-bg-color);--_chart-tooltip-text-color: var(--ds-chart-tooltip-text-color);--_chart-tooltip-border-color: var(--ds-chart-tooltip-border-color);--_chart-tooltip-hatch-color: var(--ds-chart-hatch-color, var(--surface-default));--_chart-tooltip-hatch-width: var(--ds-chart-hatch-width);display:block;background:var(--_chart-tooltip-bg-color);color:var(--_chart-tooltip-text-color);border:var(--border-width-default) solid var(--_chart-tooltip-border-color);border-radius:var(--ds-radius-control);box-shadow:var(--ds-elevation-overlay);padding:var(--space-2) var(--space-2-5);max-width:var(--tooltip-maxw);max-height:calc(100dvh - 2 * var(--space-3));overflow-y:auto;z-index:var(--layer-tooltip);font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans)}.category{margin:0 0 var(--space-1-5);font-weight:var(--font-weight-medium)}.entries{display:grid;gap:var(--space-1);margin:0;padding:0;list-style:none}.entry{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:var(--space-2)}.no-swatches .entry{grid-template-columns:1fr auto}.detail{grid-column:2/-1;margin-block-start:calc(var(--space-1) * -1);color:var(--_chart-tooltip-text-color);opacity:.7;font-size:var(--font-size-2xs)}.no-swatches .detail{grid-column:1/-1}.swatch{inline-size:var(--space-3);block-size:var(--space-3);border-radius:var(--radius-pill)}.swatch.ringed{box-shadow:inset 0 0 0 1.5px var(--_chart-tooltip-text-color)}.swatch.hatched{background-image:linear-gradient(-45deg,transparent calc(50% - var(--_chart-tooltip-hatch-width) / 2),var(--_chart-tooltip-hatch-color) calc(50% - var(--_chart-tooltip-hatch-width) / 2),var(--_chart-tooltip-hatch-color) calc(50% + var(--_chart-tooltip-hatch-width) / 2),transparent calc(50% + var(--_chart-tooltip-hatch-width) / 2))}.value{font-variant-numeric:tabular-nums;font-weight:var(--font-weight-medium)}\n"] }]
|
|
98
100
|
}], ctorParameters: () => [], propDecorators: { context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: true }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], swatches: [{ type: i0.Input, args: [{ isSignal: true, alias: "swatches", required: false }] }] } });
|
|
99
101
|
|
|
100
102
|
const POINTER_GAP_PX = 10;
|
|
@@ -193,7 +195,8 @@ class ChartTooltipDirective {
|
|
|
193
195
|
this.detachScrollReposition = closeOnScroll(this.overlayRef, () => this.dsChartTooltipPinned()
|
|
194
196
|
? this.overlayRef?.updatePosition()
|
|
195
197
|
: this.close());
|
|
196
|
-
|
|
198
|
+
// WCAG 1.4.13: dismissable without moving pointer or focus. Stays closed until the context or origin changes.
|
|
199
|
+
this.detachEscape = listenForEscape(typeof document === 'undefined' ? null : document, () => this.close());
|
|
197
200
|
this.detachOffscreen = hideWhileOffscreen(this.overlayRef.overlayElement, this.host.nativeElement);
|
|
198
201
|
}
|
|
199
202
|
else {
|
|
@@ -218,17 +221,11 @@ class ChartTooltipDirective {
|
|
|
218
221
|
if ((deltaX === 0 && deltaY === 0) || typeof pane.animate !== 'function') {
|
|
219
222
|
return;
|
|
220
223
|
}
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
if (duration <= 0) {
|
|
224
|
+
const timing = chartTiming(pane, 'tooltip-move');
|
|
225
|
+
if (!timing) {
|
|
224
226
|
return;
|
|
225
227
|
}
|
|
226
|
-
this.glide = pane.animate([{ translate: `${deltaX}px ${deltaY}px` }, { translate: '0 0' }], {
|
|
227
|
-
duration,
|
|
228
|
-
easing: style
|
|
229
|
-
.getPropertyValue('--ds-motion-chart-tooltip-move-easing')
|
|
230
|
-
.trim() || 'ease',
|
|
231
|
-
});
|
|
228
|
+
this.glide = pane.animate([{ translate: `${deltaX}px ${deltaY}px` }, { translate: '0 0' }], { ...timing, delay: -CHART_GLIDE_HEAD_START_MS });
|
|
232
229
|
}
|
|
233
230
|
strategyFor(origin) {
|
|
234
231
|
const gap = coarsePointer()
|
|
@@ -242,19 +239,6 @@ class ChartTooltipDirective {
|
|
|
242
239
|
.withViewportMargin(VIEWPORT_MARGIN_PX)
|
|
243
240
|
.withPositions(positionsFor(gap));
|
|
244
241
|
}
|
|
245
|
-
// WCAG 1.4.13: dismissable without moving pointer or focus. Stays closed until the context or origin changes.
|
|
246
|
-
closeOnEscape() {
|
|
247
|
-
if (typeof document === 'undefined') {
|
|
248
|
-
return () => undefined;
|
|
249
|
-
}
|
|
250
|
-
const onKeydown = (event) => {
|
|
251
|
-
if (event.key === 'Escape') {
|
|
252
|
-
this.close();
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
document.addEventListener('keydown', onKeydown, true);
|
|
256
|
-
return () => document.removeEventListener('keydown', onKeydown, true);
|
|
257
|
-
}
|
|
258
242
|
close() {
|
|
259
243
|
this.detachEscape?.();
|
|
260
244
|
this.detachEscape = null;
|
|
@@ -289,13 +273,6 @@ function hideWhileOffscreen(pane, chart) {
|
|
|
289
273
|
observer.observe(chart);
|
|
290
274
|
return () => observer.disconnect();
|
|
291
275
|
}
|
|
292
|
-
function milliseconds(duration) {
|
|
293
|
-
const value = parseFloat(duration);
|
|
294
|
-
if (!Number.isFinite(value)) {
|
|
295
|
-
return 0;
|
|
296
|
-
}
|
|
297
|
-
return duration.trim().endsWith('ms') ? value : value * 1000;
|
|
298
|
-
}
|
|
299
276
|
function coarsePointer() {
|
|
300
277
|
return (typeof window !== 'undefined' &&
|
|
301
278
|
window.matchMedia('(pointer: coarse)').matches);
|
|
@@ -366,17 +343,20 @@ function chartActiveMark(lingerMs = () => 0, hoverDelayMs = () => 0) {
|
|
|
366
343
|
pendingClear = null;
|
|
367
344
|
}
|
|
368
345
|
};
|
|
346
|
+
const clearHover = () => {
|
|
347
|
+
cancelPendingClear();
|
|
348
|
+
index.set(-1);
|
|
349
|
+
origin.set(null);
|
|
350
|
+
document.removeEventListener('pointerover', trackPointer, true);
|
|
351
|
+
};
|
|
369
352
|
const scheduleClear = () => {
|
|
370
353
|
cancelPendingClear();
|
|
371
|
-
pendingClear = setTimeout(()
|
|
372
|
-
pendingClear = null;
|
|
373
|
-
index.set(-1);
|
|
374
|
-
origin.set(null);
|
|
375
|
-
document.removeEventListener('pointerover', trackPointer, true);
|
|
376
|
-
}, Math.max(lingerMs(), 0));
|
|
354
|
+
pendingClear = setTimeout(clearHover, Math.max(lingerMs(), 0));
|
|
377
355
|
};
|
|
378
356
|
// `pointerover` fires per element crossed: the panel cancels the clear, anything else but the mark
|
|
379
|
-
// schedules one. Without that a panel the pointer once touched never closes.
|
|
357
|
+
// schedules one. Without that a panel the pointer once touched never closes. A pending clear is
|
|
358
|
+
// kept, not restarted, or a pointer moving over another chart holds this one open forever. The
|
|
359
|
+
// wait bridges the gaps between marks; a pointer that left the chart clears it at once.
|
|
380
360
|
const trackPointer = (event) => {
|
|
381
361
|
if (!(event.target instanceof Element)) {
|
|
382
362
|
return;
|
|
@@ -386,12 +366,20 @@ function chartActiveMark(lingerMs = () => 0, hoverDelayMs = () => 0) {
|
|
|
386
366
|
return;
|
|
387
367
|
}
|
|
388
368
|
// Host, not anchor: a legend item and the arc its panel points at are disjoint.
|
|
389
|
-
if (
|
|
369
|
+
if (host && host.contains(event.target)) {
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
if (host && chartOf(event.target) !== chartOf(host)) {
|
|
373
|
+
clearHover();
|
|
374
|
+
}
|
|
375
|
+
else if (pendingClear === null) {
|
|
390
376
|
scheduleClear();
|
|
391
377
|
}
|
|
392
378
|
};
|
|
393
|
-
const chartOf = (element) => element ? element.closest('figure') : null;
|
|
394
379
|
const release = (event) => {
|
|
380
|
+
if (!isPrimaryPress(event)) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
395
383
|
if (!(event.target instanceof Element)) {
|
|
396
384
|
clear();
|
|
397
385
|
return;
|
|
@@ -408,7 +396,6 @@ function chartActiveMark(lingerMs = () => 0, hoverDelayMs = () => 0) {
|
|
|
408
396
|
};
|
|
409
397
|
if (typeof document !== 'undefined') {
|
|
410
398
|
inject(DestroyRef).onDestroy(() => {
|
|
411
|
-
dwell.cancel();
|
|
412
399
|
cancelPendingClear();
|
|
413
400
|
document.removeEventListener('pointerdown', release, true);
|
|
414
401
|
document.removeEventListener('keydown', releaseOnEscape, true);
|
|
@@ -448,9 +435,16 @@ function chartActiveMark(lingerMs = () => 0, hoverDelayMs = () => 0) {
|
|
|
448
435
|
clear();
|
|
449
436
|
}
|
|
450
437
|
},
|
|
438
|
+
pinnedAt(lookup) {
|
|
439
|
+
return computed(() => {
|
|
440
|
+
const at = index();
|
|
441
|
+
const value = pinned() ? lookup(at) : null;
|
|
442
|
+
return value ? [{ index: at, value }] : [];
|
|
443
|
+
});
|
|
444
|
+
},
|
|
451
445
|
pin(at, event, anchor, mark) {
|
|
452
446
|
dwell.cancel();
|
|
453
|
-
if (typeof document === 'undefined') {
|
|
447
|
+
if (typeof document === 'undefined' || !isPrimaryPress(event)) {
|
|
454
448
|
return;
|
|
455
449
|
}
|
|
456
450
|
if (pinned() && index() === at) {
|
|
@@ -486,6 +480,39 @@ function chartActiveMark(lingerMs = () => 0, hoverDelayMs = () => 0) {
|
|
|
486
480
|
}
|
|
487
481
|
}
|
|
488
482
|
}
|
|
483
|
+
/** Whether `event` may take or drop a pin: a key or a touch always, a mouse only by its main button.
|
|
484
|
+
*
|
|
485
|
+
* @internal */
|
|
486
|
+
function isPrimaryPress(event) {
|
|
487
|
+
return !(event instanceof MouseEvent) || event.button === 0;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Adds `placed` to its host two frames after the host enters the DOM. A chart element that glides
|
|
492
|
+
* between positions gates its `transition` on `.placed`: the browser can compute the host's style
|
|
493
|
+
* before its position binding lands, and an ungated transition then starts it at the origin.
|
|
494
|
+
* Two frames, because after one the bound position may still be unstyled.
|
|
495
|
+
*
|
|
496
|
+
* @internal
|
|
497
|
+
*/
|
|
498
|
+
class ChartPlacedDirective {
|
|
499
|
+
constructor() {
|
|
500
|
+
if (!isPlatformBrowser(inject(PLATFORM_ID))) {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
const host = inject(ElementRef).nativeElement;
|
|
504
|
+
inject(DestroyRef).onDestroy(afterTwoFrames(inject(NgZone), () => host.classList.add('placed')));
|
|
505
|
+
}
|
|
506
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartPlacedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
507
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.22", type: ChartPlacedDirective, isStandalone: true, selector: "[dsChartPlaced]", ngImport: i0 });
|
|
508
|
+
}
|
|
509
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartPlacedDirective, decorators: [{
|
|
510
|
+
type: Directive,
|
|
511
|
+
args: [{
|
|
512
|
+
selector: '[dsChartPlaced]',
|
|
513
|
+
standalone: true,
|
|
514
|
+
}]
|
|
515
|
+
}], ctorParameters: () => [] });
|
|
489
516
|
|
|
490
517
|
/** Radius of the pin disc, in plot pixels.
|
|
491
518
|
*
|
|
@@ -509,46 +536,50 @@ class ChartPinMarkerComponent {
|
|
|
509
536
|
glyphOffset = -GLYPH_SIZE / 2;
|
|
510
537
|
glyph = inject(DomSanitizer).bypassSecurityTrustHtml(ICONS.pin);
|
|
511
538
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartPinMarkerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
512
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.22", type: ChartPinMarkerComponent, isStandalone: true, selector: "g[dsChartPinMarker]", host: { attributes: { "aria-hidden": "true" }, classAttribute: "pin-marker" }, ngImport: i0, template: `
|
|
513
|
-
<svg:
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
539
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.22", type: ChartPinMarkerComponent, isStandalone: true, selector: "g[dsChartPinMarker]", host: { attributes: { "aria-hidden": "true" }, classAttribute: "pin-marker" }, hostDirectives: [{ directive: ChartPlacedDirective }], ngImport: i0, template: `
|
|
540
|
+
<svg:g class="pin-body">
|
|
541
|
+
<svg:circle class="pin-disc" [attr.r]="radius" />
|
|
542
|
+
|
|
543
|
+
<svg:svg
|
|
544
|
+
class="pin-glyph"
|
|
545
|
+
viewBox="0 0 24 24"
|
|
546
|
+
fill="none"
|
|
547
|
+
stroke="currentColor"
|
|
548
|
+
stroke-width="1.75"
|
|
549
|
+
stroke-linecap="round"
|
|
550
|
+
stroke-linejoin="round"
|
|
551
|
+
[attr.x]="glyphOffset"
|
|
552
|
+
[attr.y]="glyphOffset"
|
|
553
|
+
[attr.width]="glyphSize"
|
|
554
|
+
[attr.height]="glyphSize"
|
|
555
|
+
[innerHTML]="glyph" />
|
|
556
|
+
</svg:g>
|
|
557
|
+
`, isInline: true, styles: ["@keyframes ds-chart-mark-grow-y{0%{transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-settle{0%{opacity:0;transform:scale(.96)}}@keyframes ds-chart-line-draw{0%{stroke-dashoffset:1}}@keyframes ds-chart-mark-exit{to{opacity:0}}@keyframes ds-chart-pin-pop{0%{scale:.4;opacity:0}}@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}:host{pointer-events:none}:host(.placed){transition:transform var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.pin-body{animation:ds-chart-pin-pop var(--ds-motion-chart-mark-duration) var(--ease-spring) backwards}.pin-disc{fill:var(--surface-default);stroke:var(--border-divider);stroke-width:var(--border-width-default)}.pin-glyph{color:var(--text-primary)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
529
558
|
}
|
|
530
559
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartPinMarkerComponent, decorators: [{
|
|
531
560
|
type: Component,
|
|
532
|
-
args: [{ selector: 'g[dsChartPinMarker]', standalone: true, template: `
|
|
533
|
-
<svg:
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
561
|
+
args: [{ selector: 'g[dsChartPinMarker]', standalone: true, hostDirectives: [ChartPlacedDirective], template: `
|
|
562
|
+
<svg:g class="pin-body">
|
|
563
|
+
<svg:circle class="pin-disc" [attr.r]="radius" />
|
|
564
|
+
|
|
565
|
+
<svg:svg
|
|
566
|
+
class="pin-glyph"
|
|
567
|
+
viewBox="0 0 24 24"
|
|
568
|
+
fill="none"
|
|
569
|
+
stroke="currentColor"
|
|
570
|
+
stroke-width="1.75"
|
|
571
|
+
stroke-linecap="round"
|
|
572
|
+
stroke-linejoin="round"
|
|
573
|
+
[attr.x]="glyphOffset"
|
|
574
|
+
[attr.y]="glyphOffset"
|
|
575
|
+
[attr.width]="glyphSize"
|
|
576
|
+
[attr.height]="glyphSize"
|
|
577
|
+
[innerHTML]="glyph" />
|
|
578
|
+
</svg:g>
|
|
548
579
|
`, host: {
|
|
549
580
|
class: 'pin-marker',
|
|
550
581
|
'aria-hidden': 'true',
|
|
551
|
-
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{pointer-events:none}.pin-disc{fill:var(--surface-default);stroke:var(--border-divider);stroke-width:var(--border-width-default)}.pin-glyph{color:var(--text-primary)}\n"] }]
|
|
582
|
+
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["@keyframes ds-chart-mark-grow-y{0%{transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-settle{0%{opacity:0;transform:scale(.96)}}@keyframes ds-chart-line-draw{0%{stroke-dashoffset:1}}@keyframes ds-chart-mark-exit{to{opacity:0}}@keyframes ds-chart-pin-pop{0%{scale:.4;opacity:0}}@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}:host{pointer-events:none}:host(.placed){transition:transform var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.pin-body{animation:ds-chart-pin-pop var(--ds-motion-chart-mark-duration) var(--ease-spring) backwards}.pin-disc{fill:var(--surface-default);stroke:var(--border-divider);stroke-width:var(--border-width-default)}.pin-glyph{color:var(--text-primary)}\n"] }]
|
|
552
583
|
}] });
|
|
553
584
|
|
|
554
585
|
/**
|
|
@@ -575,7 +606,7 @@ class ChartUnpinComponent {
|
|
|
575
606
|
{{ intl().chart.unpin }}
|
|
576
607
|
</button>
|
|
577
608
|
}
|
|
578
|
-
`, isInline: true, styles: [":host{display:contents}.pin-reset{position:absolute;inset-block-start:var(--_chart-pin-reset-inset, 0);inset-inline-end:var(--_chart-pin-reset-inset, 0);z-index:1;display:inline-flex;align-items:center;gap:var(--space-1);block-size:var(--space-6);padding:0 var(--space-2-5);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:before{position:absolute;inset:50% auto auto 50%;inline-size:max(100%,var(--hit-comfy));block-size:var(--hit-comfy);transform:translate(-50%,-50%);content:\"\"}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
609
|
+
`, isInline: true, styles: ["@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}:host{display:contents}.pin-reset{position:absolute;inset-block-start:var(--_chart-pin-reset-inset, 0);inset-inline-end:var(--_chart-pin-reset-inset, 0);z-index:1;display:inline-flex;align-items:center;gap:var(--space-1);block-size:var(--space-6);padding:0 var(--space-2-5);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:before{position:absolute;inset:50% auto auto 50%;inline-size:max(100%,var(--hit-comfy));block-size:var(--hit-comfy);transform:translate(-50%,-50%);content:\"\"}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
579
610
|
}
|
|
580
611
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartUnpinComponent, decorators: [{
|
|
581
612
|
type: Component,
|
|
@@ -587,9 +618,571 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
587
618
|
}
|
|
588
619
|
`, host: {
|
|
589
620
|
'[class.is-pinned]': 'pinned()',
|
|
590
|
-
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:contents}.pin-reset{position:absolute;inset-block-start:var(--_chart-pin-reset-inset, 0);inset-inline-end:var(--_chart-pin-reset-inset, 0);z-index:1;display:inline-flex;align-items:center;gap:var(--space-1);block-size:var(--space-6);padding:0 var(--space-2-5);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:before{position:absolute;inset:50% auto auto 50%;inline-size:max(100%,var(--hit-comfy));block-size:var(--hit-comfy);transform:translate(-50%,-50%);content:\"\"}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}\n"] }]
|
|
621
|
+
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}:host{display:contents}.pin-reset{position:absolute;inset-block-start:var(--_chart-pin-reset-inset, 0);inset-inline-end:var(--_chart-pin-reset-inset, 0);z-index:1;display:inline-flex;align-items:center;gap:var(--space-1);block-size:var(--space-6);padding:0 var(--space-2-5);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:before{position:absolute;inset:50% auto auto 50%;inline-size:max(100%,var(--hit-comfy));block-size:var(--hit-comfy);transform:translate(-50%,-50%);content:\"\"}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}\n"] }]
|
|
591
622
|
}], propDecorators: { pinned: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinned", required: true }] }], release: [{ type: i0.Output, args: ["release"] }] } });
|
|
592
623
|
|
|
624
|
+
const TICK_POSITIONS = [0, 25, 50, 75, 100];
|
|
625
|
+
/** Height of the category label band under the plot, as the drawn chart budgets it. @internal */
|
|
626
|
+
const CHART_SKELETON_CATEGORY_BAND = 30;
|
|
627
|
+
/**
|
|
628
|
+
* The loading silhouette of a chart on a category axis: tick pills, the axis L, marks and category
|
|
629
|
+
* pills, laid out on the same value space, plot height and gutter as the drawn chart so the card
|
|
630
|
+
* keeps its height when the data lands.
|
|
631
|
+
*
|
|
632
|
+
* @internal
|
|
633
|
+
*/
|
|
634
|
+
class ChartSkeletonComponent {
|
|
635
|
+
marks = input('columns', ...(ngDevMode ? [{ debugName: "marks" }] : /* istanbul ignore next */ []));
|
|
636
|
+
count = input.required(...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
|
|
637
|
+
/** A CSS length, so a chart can pass its own height token. */
|
|
638
|
+
plotHeight = input.required(...(ngDevMode ? [{ debugName: "plotHeight" }] : /* istanbul ignore next */ []));
|
|
639
|
+
valueSpace = input.required(...(ngDevMode ? [{ debugName: "valueSpace" }] : /* istanbul ignore next */ []));
|
|
640
|
+
axisGutter = input.required(...(ngDevMode ? [{ debugName: "axisGutter" }] : /* istanbul ignore next */ []));
|
|
641
|
+
shimmer = input(true, ...(ngDevMode ? [{ debugName: "shimmer" }] : /* istanbul ignore next */ []));
|
|
642
|
+
ticks = TICK_POSITIONS;
|
|
643
|
+
categoryBand = CHART_SKELETON_CATEGORY_BAND;
|
|
644
|
+
bars = computed(() => this.marks() === 'steps'
|
|
645
|
+
? skeletonWaterfallSteps(this.count()).map(({ bottom, height }) => ({
|
|
646
|
+
bottom: `${bottom * 100}%`,
|
|
647
|
+
height: `${height * 100}%`,
|
|
648
|
+
}))
|
|
649
|
+
: skeletonColumnHeights(this.count()).map((height) => ({
|
|
650
|
+
bottom: '0',
|
|
651
|
+
height: `${height * 100}%`,
|
|
652
|
+
})), ...(ngDevMode ? [{ debugName: "bars" }] : /* istanbul ignore next */ []));
|
|
653
|
+
lineClip = computed(() => skeletonLineClip(this.count()), ...(ngDevMode ? [{ debugName: "lineClip" }] : /* istanbul ignore next */ []));
|
|
654
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
655
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartSkeletonComponent, isStandalone: true, selector: "ds-chart-skeleton", inputs: { marks: { classPropertyName: "marks", publicName: "marks", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: true, transformFunction: null }, plotHeight: { classPropertyName: "plotHeight", publicName: "plotHeight", isSignal: true, isRequired: true, transformFunction: null }, valueSpace: { classPropertyName: "valueSpace", publicName: "valueSpace", isSignal: true, isRequired: true, transformFunction: null }, axisGutter: { classPropertyName: "axisGutter", publicName: "axisGutter", isSignal: true, isRequired: true, transformFunction: null }, shimmer: { classPropertyName: "shimmer", publicName: "shimmer", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "style.--_chart-skeleton-plot-height": "plotHeight()", "style.--_chart-skeleton-value-space.px": "valueSpace()", "style.--_chart-skeleton-axis-gutter.px": "axisGutter()", "style.--_chart-skeleton-category-band.px": "categoryBand" } }, ngImport: i0, template: `
|
|
656
|
+
<div class="ticks">
|
|
657
|
+
@for (tick of ticks; track tick) {
|
|
658
|
+
<ds-skeleton
|
|
659
|
+
class="pill"
|
|
660
|
+
height="var(--space-2)"
|
|
661
|
+
width="var(--space-6)"
|
|
662
|
+
[style.top.%]="tick"
|
|
663
|
+
[shimmer]="shimmer()" />
|
|
664
|
+
}
|
|
665
|
+
</div>
|
|
666
|
+
|
|
667
|
+
<div class="plot" data-morph="fade">
|
|
668
|
+
@if (marks() === 'line') {
|
|
669
|
+
<ds-skeleton
|
|
670
|
+
class="line"
|
|
671
|
+
data-morph="line"
|
|
672
|
+
[style.clip-path]="lineClip()"
|
|
673
|
+
[shimmer]="shimmer()" />
|
|
674
|
+
} @else {
|
|
675
|
+
@for (bar of bars(); track $index) {
|
|
676
|
+
<span class="band">
|
|
677
|
+
<ds-skeleton
|
|
678
|
+
class="bar"
|
|
679
|
+
data-morph="mark"
|
|
680
|
+
width="50%"
|
|
681
|
+
[height]="bar.height"
|
|
682
|
+
[style.inset-block-end]="bar.bottom"
|
|
683
|
+
[shimmer]="shimmer()" />
|
|
684
|
+
</span>
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
</div>
|
|
688
|
+
|
|
689
|
+
<div class="categories">
|
|
690
|
+
@for (bar of bars(); track $index) {
|
|
691
|
+
<span class="band">
|
|
692
|
+
<ds-skeleton
|
|
693
|
+
class="pill"
|
|
694
|
+
height="var(--space-2)"
|
|
695
|
+
width="var(--space-8)"
|
|
696
|
+
[shimmer]="shimmer()" />
|
|
697
|
+
</span>
|
|
698
|
+
}
|
|
699
|
+
</div>
|
|
700
|
+
`, isInline: true, styles: ["@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}:host{display:grid;grid-template-columns:var(--_chart-skeleton-axis-gutter) minmax(0,1fr);grid-template-rows:var(--_chart-skeleton-value-space) var(--_chart-skeleton-plot-height) var(--_chart-skeleton-category-band);padding-inline-end:12px}.ticks{grid-area:2/1;position:relative}.ticks .pill{position:absolute;inset-inline-end:var(--space-2);translate:0 -50%}.plot{grid-area:2/2;position:relative;display:flex;border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.band{flex:1 1 0;display:flex;justify-content:center;align-items:flex-end;min-inline-size:0}.bar{border-end-start-radius:0;border-end-end-radius:0}.line{position:absolute;inset:0;border-radius:0}.categories{grid-area:3/2;display:flex}.categories .band{align-items:flex-start;padding-block-start:var(--space-2-5)}.pill{border-radius:var(--radius-pill)}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline", "shimmer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
701
|
+
}
|
|
702
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartSkeletonComponent, decorators: [{
|
|
703
|
+
type: Component,
|
|
704
|
+
args: [{ selector: 'ds-chart-skeleton', standalone: true, imports: [SkeletonComponent], template: `
|
|
705
|
+
<div class="ticks">
|
|
706
|
+
@for (tick of ticks; track tick) {
|
|
707
|
+
<ds-skeleton
|
|
708
|
+
class="pill"
|
|
709
|
+
height="var(--space-2)"
|
|
710
|
+
width="var(--space-6)"
|
|
711
|
+
[style.top.%]="tick"
|
|
712
|
+
[shimmer]="shimmer()" />
|
|
713
|
+
}
|
|
714
|
+
</div>
|
|
715
|
+
|
|
716
|
+
<div class="plot" data-morph="fade">
|
|
717
|
+
@if (marks() === 'line') {
|
|
718
|
+
<ds-skeleton
|
|
719
|
+
class="line"
|
|
720
|
+
data-morph="line"
|
|
721
|
+
[style.clip-path]="lineClip()"
|
|
722
|
+
[shimmer]="shimmer()" />
|
|
723
|
+
} @else {
|
|
724
|
+
@for (bar of bars(); track $index) {
|
|
725
|
+
<span class="band">
|
|
726
|
+
<ds-skeleton
|
|
727
|
+
class="bar"
|
|
728
|
+
data-morph="mark"
|
|
729
|
+
width="50%"
|
|
730
|
+
[height]="bar.height"
|
|
731
|
+
[style.inset-block-end]="bar.bottom"
|
|
732
|
+
[shimmer]="shimmer()" />
|
|
733
|
+
</span>
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
</div>
|
|
737
|
+
|
|
738
|
+
<div class="categories">
|
|
739
|
+
@for (bar of bars(); track $index) {
|
|
740
|
+
<span class="band">
|
|
741
|
+
<ds-skeleton
|
|
742
|
+
class="pill"
|
|
743
|
+
height="var(--space-2)"
|
|
744
|
+
width="var(--space-8)"
|
|
745
|
+
[shimmer]="shimmer()" />
|
|
746
|
+
</span>
|
|
747
|
+
}
|
|
748
|
+
</div>
|
|
749
|
+
`, host: {
|
|
750
|
+
'aria-hidden': 'true',
|
|
751
|
+
'[style.--_chart-skeleton-plot-height]': 'plotHeight()',
|
|
752
|
+
'[style.--_chart-skeleton-value-space.px]': 'valueSpace()',
|
|
753
|
+
'[style.--_chart-skeleton-axis-gutter.px]': 'axisGutter()',
|
|
754
|
+
'[style.--_chart-skeleton-category-band.px]': 'categoryBand',
|
|
755
|
+
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}:host{display:grid;grid-template-columns:var(--_chart-skeleton-axis-gutter) minmax(0,1fr);grid-template-rows:var(--_chart-skeleton-value-space) var(--_chart-skeleton-plot-height) var(--_chart-skeleton-category-band);padding-inline-end:12px}.ticks{grid-area:2/1;position:relative}.ticks .pill{position:absolute;inset-inline-end:var(--space-2);translate:0 -50%}.plot{grid-area:2/2;position:relative;display:flex;border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.band{flex:1 1 0;display:flex;justify-content:center;align-items:flex-end;min-inline-size:0}.bar{border-end-start-radius:0;border-end-end-radius:0}.line{position:absolute;inset:0;border-radius:0}.categories{grid-area:3/2;display:flex}.categories .band{align-items:flex-start;padding-block-start:var(--space-2-5)}.pill{border-radius:var(--radius-pill)}\n"] }]
|
|
756
|
+
}], propDecorators: { marks: [{ type: i0.Input, args: [{ isSignal: true, alias: "marks", required: false }] }], count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: true }] }], plotHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "plotHeight", required: true }] }], valueSpace: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueSpace", required: true }] }], axisGutter: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisGutter", required: true }] }], shimmer: [{ type: i0.Input, args: [{ isSignal: true, alias: "shimmer", required: false }] }] } });
|
|
757
|
+
|
|
758
|
+
/** Put on the figure while the drawn chart waits, hidden, for its geometry to land. */
|
|
759
|
+
const HOLD_CLASS = 'skeleton-morph';
|
|
760
|
+
// The real mark takes over from its ghost only once the ghost has (all but) landed on it.
|
|
761
|
+
const HANDOVER_AT = 0.95;
|
|
762
|
+
const BAND_SAMPLES = 24;
|
|
763
|
+
const PATH_SAMPLES = 96;
|
|
764
|
+
const MAX_WAIT_FRAMES = 60;
|
|
765
|
+
const COPIED_STYLES = [
|
|
766
|
+
'background-color',
|
|
767
|
+
'border-radius',
|
|
768
|
+
'border-top',
|
|
769
|
+
'border-right',
|
|
770
|
+
'border-bottom',
|
|
771
|
+
'border-left',
|
|
772
|
+
'clip-path',
|
|
773
|
+
'mask-image',
|
|
774
|
+
'mask-composite',
|
|
775
|
+
'mask-size',
|
|
776
|
+
'mask-position',
|
|
777
|
+
'mask-repeat',
|
|
778
|
+
];
|
|
779
|
+
/**
|
|
780
|
+
* Turns the loading skeleton inside `host` into the chart drawn in its place, in one motion. Call
|
|
781
|
+
* while the skeleton is still in the DOM and the chart is about to replace it. Returns `null` when
|
|
782
|
+
* there is nothing to morph: a skeleton that was not loading, or motion that is off.
|
|
783
|
+
*
|
|
784
|
+
* Placeholders are the skeleton's `ds-skeleton` elements and anything marked `data-morph`; the drawn
|
|
785
|
+
* chart marks what they become with `data-morph`:
|
|
786
|
+
* - `mark`: a placeholder travels to the mark with the same `data-morph-key`, else the same order,
|
|
787
|
+
* taking its size and colour; a mark without one arrives by `growth`, a placeholder without one
|
|
788
|
+
* leaves by it; under `up`, a mark with `data-morph-from="top"` (one hanging below the zero
|
|
789
|
+
* line) grows down from its top edge;
|
|
790
|
+
* - `line`: the skeleton's band travels onto the first drawn line; the others draw on as they would;
|
|
791
|
+
* - `hold`: stays hidden until the marks have landed;
|
|
792
|
+
* - `self`: a part the chart animates from the skeleton itself, such as a ring turning its slices
|
|
793
|
+
* from the skeleton's: it skips its own entrance and travels from the `self` placeholder in the
|
|
794
|
+
* same order, which fades out on the way;
|
|
795
|
+
* - `fade` (the default for a placeholder): fades out in place while the chart fades in.
|
|
796
|
+
*
|
|
797
|
+
* @internal
|
|
798
|
+
*/
|
|
799
|
+
function startSkeletonMorph(host, growth, done) {
|
|
800
|
+
const growTiming = chartTiming(host, 'mark-grow');
|
|
801
|
+
const elements = Array.from(host.querySelectorAll('ds-skeleton, [data-morph]'));
|
|
802
|
+
const loading = elements.some((element) => element.localName === 'ds-skeleton' &&
|
|
803
|
+
!element.classList.contains('still'));
|
|
804
|
+
if (!growTiming || !loading || typeof host.animate !== 'function') {
|
|
805
|
+
return null;
|
|
806
|
+
}
|
|
807
|
+
const timing = { ...growTiming, fill: 'both' };
|
|
808
|
+
const layer = document.createElement('div');
|
|
809
|
+
layer.setAttribute('aria-hidden', 'true');
|
|
810
|
+
layer.style.cssText =
|
|
811
|
+
'position: absolute; inset: 0 auto auto 0; z-index: 1; pointer-events: none;';
|
|
812
|
+
host.append(layer);
|
|
813
|
+
const origin = layer.getBoundingClientRect();
|
|
814
|
+
const placeholders = [];
|
|
815
|
+
for (const element of elements) {
|
|
816
|
+
const rect = element.getBoundingClientRect();
|
|
817
|
+
if (rect.width === 0 && rect.height === 0) {
|
|
818
|
+
continue;
|
|
819
|
+
}
|
|
820
|
+
const style = getComputedStyle(element);
|
|
821
|
+
const shape = {
|
|
822
|
+
left: rect.left - origin.left,
|
|
823
|
+
top: rect.top - origin.top,
|
|
824
|
+
width: rect.width,
|
|
825
|
+
height: rect.height,
|
|
826
|
+
clip: parsePolygon(style.clipPath, rect),
|
|
827
|
+
color: style.backgroundColor,
|
|
828
|
+
radius: style.borderRadius,
|
|
829
|
+
};
|
|
830
|
+
const ghost = ghostAt(layer, shape);
|
|
831
|
+
for (const property of COPIED_STYLES) {
|
|
832
|
+
ghost.style.setProperty(property, style.getPropertyValue(property));
|
|
833
|
+
}
|
|
834
|
+
const role = element.dataset['morph'] ?? 'fade';
|
|
835
|
+
ghost.dataset['morph'] = role;
|
|
836
|
+
placeholders.push({
|
|
837
|
+
role,
|
|
838
|
+
key: element.dataset['morphKey'] ?? null,
|
|
839
|
+
ghost,
|
|
840
|
+
shape,
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
host.classList.add(HOLD_CLASS);
|
|
844
|
+
const animations = [];
|
|
845
|
+
let frame = 0;
|
|
846
|
+
let finished = false;
|
|
847
|
+
const finish = () => {
|
|
848
|
+
if (finished) {
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
finished = true;
|
|
852
|
+
cancelAnimationFrame(frame);
|
|
853
|
+
for (const animation of animations) {
|
|
854
|
+
animation.cancel();
|
|
855
|
+
}
|
|
856
|
+
layer.remove();
|
|
857
|
+
host.classList.remove(HOLD_CLASS);
|
|
858
|
+
done();
|
|
859
|
+
};
|
|
860
|
+
const travel = (ghost, from, to, startOpacity = 1) => {
|
|
861
|
+
const [start, end] = matchClips(from, to);
|
|
862
|
+
animations.push(ghost.animate([
|
|
863
|
+
keyframe(start, startOpacity),
|
|
864
|
+
{ ...keyframe(end, 1), offset: HANDOVER_AT },
|
|
865
|
+
keyframe(end, 0),
|
|
866
|
+
], timing));
|
|
867
|
+
};
|
|
868
|
+
const carry = (target, placeholder, to) => {
|
|
869
|
+
const from = placeholder.shape;
|
|
870
|
+
const shift = `${from.left + from.width / 2 - (to.left + to.width / 2)}px ${from.top + from.height / 2 - (to.top + to.height / 2)}px`;
|
|
871
|
+
const scale = `${to.width ? from.width / to.width : 1} ${to.height ? from.height / to.height : 1}`;
|
|
872
|
+
animations.push(target.animate([
|
|
873
|
+
{ translate: shift, scale },
|
|
874
|
+
{ translate: '0px 0px', scale: '1 1' },
|
|
875
|
+
], timing), placeholder.ghost.animate([
|
|
876
|
+
{ ...boxFrame(from), opacity: 1 },
|
|
877
|
+
{ ...boxFrame(to), opacity: 0 },
|
|
878
|
+
], timing));
|
|
879
|
+
};
|
|
880
|
+
const play = (body) => {
|
|
881
|
+
const lineTarget = body.querySelector('[data-morph="line"]');
|
|
882
|
+
const targets = Array.from(body.querySelectorAll('[data-morph="mark"], [data-morph="hold"], [data-morph="self"]'));
|
|
883
|
+
if (lineTarget) {
|
|
884
|
+
targets.push(lineTarget);
|
|
885
|
+
}
|
|
886
|
+
for (const target of targets) {
|
|
887
|
+
for (const animation of target.getAnimations({ subtree: true })) {
|
|
888
|
+
if (animation.effect?.getTiming().iterations !== Infinity) {
|
|
889
|
+
animation.finish();
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
const keyed = new Map();
|
|
894
|
+
const ordered = [];
|
|
895
|
+
for (const placeholder of placeholders) {
|
|
896
|
+
if (placeholder.role === 'mark' && placeholder.key !== null) {
|
|
897
|
+
keyed.set(placeholder.key, placeholder);
|
|
898
|
+
}
|
|
899
|
+
else if (placeholder.role === 'mark') {
|
|
900
|
+
ordered.push(placeholder);
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
const arrived = new Set();
|
|
904
|
+
const line = placeholders.find(({ role }) => role === 'line');
|
|
905
|
+
const selves = placeholders.filter(({ role }) => role === 'self');
|
|
906
|
+
let nextOrdered = 0;
|
|
907
|
+
let nextSelf = 0;
|
|
908
|
+
for (const target of targets) {
|
|
909
|
+
const role = target.getAttribute('data-morph');
|
|
910
|
+
if (role === 'self') {
|
|
911
|
+
const placeholder = selves[nextSelf++];
|
|
912
|
+
if (placeholder) {
|
|
913
|
+
arrived.add(placeholder);
|
|
914
|
+
carry(target, placeholder, markShape(target, origin));
|
|
915
|
+
}
|
|
916
|
+
continue;
|
|
917
|
+
}
|
|
918
|
+
if (role === 'mark') {
|
|
919
|
+
const key = target.getAttribute('data-morph-key');
|
|
920
|
+
const placeholder = key === null ? ordered[nextOrdered++] : keyed.get(key);
|
|
921
|
+
const to = markShape(target, origin);
|
|
922
|
+
if (placeholder) {
|
|
923
|
+
arrived.add(placeholder);
|
|
924
|
+
travel(placeholder.ghost, placeholder.shape, to);
|
|
925
|
+
}
|
|
926
|
+
else {
|
|
927
|
+
const from = collapse(to, growth, target);
|
|
928
|
+
const ghost = ghostAt(layer, to);
|
|
929
|
+
ghost.dataset['morph'] = 'mark';
|
|
930
|
+
travel(ghost, from, to, from === to ? 0 : 1);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
else if (role === 'line' && line) {
|
|
934
|
+
arrived.add(line);
|
|
935
|
+
travel(line.ghost, bandOfPlaceholder(line.shape), lineShape(target, origin));
|
|
936
|
+
}
|
|
937
|
+
animations.push(target.animate([{ opacity: 0 }, { opacity: 0, offset: HANDOVER_AT }, { opacity: 1 }], timing));
|
|
938
|
+
}
|
|
939
|
+
for (const placeholder of placeholders) {
|
|
940
|
+
if (arrived.has(placeholder)) {
|
|
941
|
+
continue;
|
|
942
|
+
}
|
|
943
|
+
animations.push(placeholder.ghost.animate(placeholder.role === 'mark'
|
|
944
|
+
? [
|
|
945
|
+
keyframe(placeholder.shape, 1),
|
|
946
|
+
keyframe(collapse(placeholder.shape, growth, body), 0),
|
|
947
|
+
]
|
|
948
|
+
: [{ opacity: 1 }, { opacity: 0 }], timing));
|
|
949
|
+
}
|
|
950
|
+
animations.push(body.animate([{ opacity: 0 }, { opacity: 1 }], timing));
|
|
951
|
+
host.classList.remove(HOLD_CLASS);
|
|
952
|
+
Promise.all(animations.map(({ finished }) => finished)).then(finish, () => undefined);
|
|
953
|
+
};
|
|
954
|
+
let frames = 0;
|
|
955
|
+
const waitForLanding = () => {
|
|
956
|
+
frames++;
|
|
957
|
+
const body = host.querySelector(':scope > .reload-overlay');
|
|
958
|
+
if (body &&
|
|
959
|
+
(frames >= MAX_WAIT_FRAMES ||
|
|
960
|
+
(frames >= 2 && !body.querySelector('.measuring')))) {
|
|
961
|
+
play(body);
|
|
962
|
+
}
|
|
963
|
+
else if (frames >= MAX_WAIT_FRAMES) {
|
|
964
|
+
finish();
|
|
965
|
+
}
|
|
966
|
+
else {
|
|
967
|
+
frame = requestAnimationFrame(waitForLanding);
|
|
968
|
+
}
|
|
969
|
+
};
|
|
970
|
+
frame = requestAnimationFrame(waitForLanding);
|
|
971
|
+
return finish;
|
|
972
|
+
}
|
|
973
|
+
function ghostAt(layer, shape) {
|
|
974
|
+
const ghost = document.createElement('div');
|
|
975
|
+
ghost.style.position = 'absolute';
|
|
976
|
+
ghost.style.left = `${shape.left}px`;
|
|
977
|
+
ghost.style.top = `${shape.top}px`;
|
|
978
|
+
ghost.style.width = `${shape.width}px`;
|
|
979
|
+
ghost.style.height = `${shape.height}px`;
|
|
980
|
+
if (shape.color) {
|
|
981
|
+
ghost.style.backgroundColor = shape.color;
|
|
982
|
+
}
|
|
983
|
+
layer.append(ghost);
|
|
984
|
+
return ghost;
|
|
985
|
+
}
|
|
986
|
+
function boxFrame(shape) {
|
|
987
|
+
return {
|
|
988
|
+
left: `${shape.left}px`,
|
|
989
|
+
top: `${shape.top}px`,
|
|
990
|
+
width: `${shape.width}px`,
|
|
991
|
+
height: `${shape.height}px`,
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
function keyframe(shape, opacity) {
|
|
995
|
+
return {
|
|
996
|
+
...boxFrame(shape),
|
|
997
|
+
clipPath: shape.clip
|
|
998
|
+
? `polygon(${shape.clip.map(({ x, y }) => `${x}px ${y}px`).join(', ')})`
|
|
999
|
+
: 'none',
|
|
1000
|
+
backgroundColor: shape.color ?? 'transparent',
|
|
1001
|
+
borderRadius: shape.radius ?? '0',
|
|
1002
|
+
opacity,
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
// Clip paths interpolate only between polygons of as many vertices: a plain box becomes its four
|
|
1006
|
+
// corners, and two polygons that cannot pair up fall back to their boxes.
|
|
1007
|
+
function matchClips(from, to) {
|
|
1008
|
+
const color = to.color ?? from.color;
|
|
1009
|
+
const radius = to.radius ?? from.radius;
|
|
1010
|
+
if (!from.clip && !to.clip) {
|
|
1011
|
+
return [from, { ...to, color, radius }];
|
|
1012
|
+
}
|
|
1013
|
+
const fromClip = from.clip ?? corners(from);
|
|
1014
|
+
const toClip = to.clip ?? corners(to);
|
|
1015
|
+
if (fromClip.length !== toClip.length) {
|
|
1016
|
+
return [
|
|
1017
|
+
{ ...from, clip: null },
|
|
1018
|
+
{ ...to, clip: null, color, radius },
|
|
1019
|
+
];
|
|
1020
|
+
}
|
|
1021
|
+
return [
|
|
1022
|
+
{ ...from, clip: fromClip },
|
|
1023
|
+
{ ...to, clip: toClip, color, radius },
|
|
1024
|
+
];
|
|
1025
|
+
}
|
|
1026
|
+
function corners({ width, height }) {
|
|
1027
|
+
return [
|
|
1028
|
+
{ x: 0, y: 0 },
|
|
1029
|
+
{ x: width, y: 0 },
|
|
1030
|
+
{ x: width, y: height },
|
|
1031
|
+
{ x: 0, y: height },
|
|
1032
|
+
];
|
|
1033
|
+
}
|
|
1034
|
+
function collapse(shape, growth, context) {
|
|
1035
|
+
if (growth === 'up') {
|
|
1036
|
+
const fromTop = context.getAttribute('data-morph-from') === 'top';
|
|
1037
|
+
return {
|
|
1038
|
+
...shape,
|
|
1039
|
+
top: fromTop ? shape.top : shape.top + shape.height,
|
|
1040
|
+
height: 0,
|
|
1041
|
+
clip: shape.clip?.map(({ x }) => ({ x, y: 0 })) ?? null,
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
if (growth === 'across') {
|
|
1045
|
+
const fromEnd = getComputedStyle(context).direction === 'rtl';
|
|
1046
|
+
return {
|
|
1047
|
+
...shape,
|
|
1048
|
+
left: fromEnd ? shape.left + shape.width : shape.left,
|
|
1049
|
+
width: 0,
|
|
1050
|
+
clip: shape.clip?.map(({ y }) => ({ x: 0, y })) ?? null,
|
|
1051
|
+
};
|
|
1052
|
+
}
|
|
1053
|
+
return shape;
|
|
1054
|
+
}
|
|
1055
|
+
function markShape(target, origin) {
|
|
1056
|
+
const rect = target.getBoundingClientRect();
|
|
1057
|
+
const style = getComputedStyle(target);
|
|
1058
|
+
let clip = null;
|
|
1059
|
+
if (target instanceof SVGPolygonElement) {
|
|
1060
|
+
const matrix = target.getScreenCTM();
|
|
1061
|
+
clip = matrix
|
|
1062
|
+
? Array.from({ length: target.points.numberOfItems }, (unused, index) => {
|
|
1063
|
+
const { x, y } = target.points.getItem(index);
|
|
1064
|
+
const point = new DOMPoint(x, y).matrixTransform(matrix);
|
|
1065
|
+
return { x: point.x - rect.left, y: point.y - rect.top };
|
|
1066
|
+
})
|
|
1067
|
+
: null;
|
|
1068
|
+
}
|
|
1069
|
+
else if (target instanceof HTMLElement) {
|
|
1070
|
+
clip = parsePolygon(style.clipPath, rect);
|
|
1071
|
+
}
|
|
1072
|
+
return {
|
|
1073
|
+
left: rect.left - origin.left,
|
|
1074
|
+
top: rect.top - origin.top,
|
|
1075
|
+
width: rect.width,
|
|
1076
|
+
height: rect.height,
|
|
1077
|
+
clip,
|
|
1078
|
+
color: markColor(target),
|
|
1079
|
+
radius: target instanceof HTMLElement ? style.borderRadius : null,
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
// The colour a mark is painted in: its own fill or background, else the first part of it that has one.
|
|
1083
|
+
function markColor(target) {
|
|
1084
|
+
for (const element of [target, ...Array.from(target.querySelectorAll('*'))]) {
|
|
1085
|
+
if (element instanceof SVGGElement) {
|
|
1086
|
+
continue;
|
|
1087
|
+
}
|
|
1088
|
+
const style = getComputedStyle(element);
|
|
1089
|
+
const color = element instanceof SVGElement ? style.fill : style.backgroundColor;
|
|
1090
|
+
if (isPaint(color)) {
|
|
1091
|
+
return color;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
return null;
|
|
1095
|
+
}
|
|
1096
|
+
function isPaint(color) {
|
|
1097
|
+
return (/^(rgb|hsl|color|lab|lch|oklab|oklch|#)/.test(color) &&
|
|
1098
|
+
!/^rgba\(\s*0,\s*0,\s*0,\s*0\s*\)$/.test(color));
|
|
1099
|
+
}
|
|
1100
|
+
// The skeleton's band as evenly spaced vertices, so it pairs up with the drawn line's whatever the counts.
|
|
1101
|
+
function bandOfPlaceholder(shape) {
|
|
1102
|
+
const vertices = (shape.clip ?? corners(shape)).map(({ x, y }) => ({
|
|
1103
|
+
x: x + shape.left,
|
|
1104
|
+
y: y + shape.top,
|
|
1105
|
+
}));
|
|
1106
|
+
const half = Math.floor(vertices.length / 2);
|
|
1107
|
+
const upper = vertices.slice(0, half);
|
|
1108
|
+
const lower = vertices.slice(half).reverse();
|
|
1109
|
+
return polygonShape(band(upper, lower), shape.color, shape.radius);
|
|
1110
|
+
}
|
|
1111
|
+
function lineShape(target, origin) {
|
|
1112
|
+
const style = getComputedStyle(target);
|
|
1113
|
+
const matrix = target instanceof SVGGeometryElement ? target.getScreenCTM() : null;
|
|
1114
|
+
if (!(target instanceof SVGGeometryElement) || !matrix) {
|
|
1115
|
+
return markShape(target, origin);
|
|
1116
|
+
}
|
|
1117
|
+
const length = target.getTotalLength();
|
|
1118
|
+
const centre = Array.from({ length: PATH_SAMPLES + 1 }, (unused, index) => {
|
|
1119
|
+
const { x, y } = target.getPointAtLength((length * index) / PATH_SAMPLES);
|
|
1120
|
+
const point = new DOMPoint(x, y).matrixTransform(matrix);
|
|
1121
|
+
return { x: point.x - origin.left, y: point.y - origin.top };
|
|
1122
|
+
}).sort((first, second) => first.x - second.x);
|
|
1123
|
+
const half = (parseFloat(style.strokeWidth) * Math.hypot(matrix.a, matrix.b)) / 2 || 1;
|
|
1124
|
+
return polygonShape(band(centre.map(({ x, y }) => ({ x, y: y - half })), centre.map(({ x, y }) => ({ x, y: y + half }))), isPaint(style.stroke) ? style.stroke : null, '0');
|
|
1125
|
+
}
|
|
1126
|
+
function band(upper, lower) {
|
|
1127
|
+
const start = upper[0]?.x ?? 0;
|
|
1128
|
+
const end = upper[upper.length - 1]?.x ?? start;
|
|
1129
|
+
const xs = Array.from({ length: BAND_SAMPLES }, (unused, index) => start + ((end - start) * index) / (BAND_SAMPLES - 1));
|
|
1130
|
+
return [
|
|
1131
|
+
...xs.map((x) => ({ x, y: yAt(upper, x) })),
|
|
1132
|
+
...xs.reverse().map((x) => ({ x, y: yAt(lower, x) })),
|
|
1133
|
+
];
|
|
1134
|
+
}
|
|
1135
|
+
function yAt(points, x) {
|
|
1136
|
+
const after = points.findIndex((point) => point.x >= x);
|
|
1137
|
+
if (after <= 0) {
|
|
1138
|
+
return points[after === 0 ? 0 : points.length - 1]?.y ?? 0;
|
|
1139
|
+
}
|
|
1140
|
+
const before = points[after - 1];
|
|
1141
|
+
const next = points[after];
|
|
1142
|
+
const span = next.x - before.x;
|
|
1143
|
+
return span
|
|
1144
|
+
? before.y + ((next.y - before.y) * (x - before.x)) / span
|
|
1145
|
+
: next.y;
|
|
1146
|
+
}
|
|
1147
|
+
function polygonShape(points, color, radius) {
|
|
1148
|
+
const left = Math.min(...points.map(({ x }) => x));
|
|
1149
|
+
const top = Math.min(...points.map(({ y }) => y));
|
|
1150
|
+
return {
|
|
1151
|
+
left,
|
|
1152
|
+
top,
|
|
1153
|
+
width: Math.max(...points.map(({ x }) => x)) - left,
|
|
1154
|
+
height: Math.max(...points.map(({ y }) => y)) - top,
|
|
1155
|
+
clip: points.map(({ x, y }) => ({ x: x - left, y: y - top })),
|
|
1156
|
+
color,
|
|
1157
|
+
radius,
|
|
1158
|
+
};
|
|
1159
|
+
}
|
|
1160
|
+
// A computed `polygon(...)` in pixels from the box's corner; lengths are `%`, `px` or a `calc()` of both.
|
|
1161
|
+
function parsePolygon(value, box) {
|
|
1162
|
+
if (!value.startsWith('polygon(')) {
|
|
1163
|
+
return null;
|
|
1164
|
+
}
|
|
1165
|
+
const vertices = value
|
|
1166
|
+
.slice('polygon('.length, -1)
|
|
1167
|
+
.split(',')
|
|
1168
|
+
.map((vertex) => vertex.trim().match(/calc\([^)]*\)|\S+/g) ?? []);
|
|
1169
|
+
if (vertices[0]?.length === 1) {
|
|
1170
|
+
vertices.shift();
|
|
1171
|
+
}
|
|
1172
|
+
return vertices.map(([x = '0', y = '0']) => ({
|
|
1173
|
+
x: resolveLength(x, box.width),
|
|
1174
|
+
y: resolveLength(y, box.height),
|
|
1175
|
+
}));
|
|
1176
|
+
}
|
|
1177
|
+
function resolveLength(length, size) {
|
|
1178
|
+
let total = 0;
|
|
1179
|
+
for (const [, sign, magnitude, unit] of length.matchAll(/([+-]?)\s*(-?[\d.]+)(%|px)?/g)) {
|
|
1180
|
+
const value = parseFloat(magnitude) * (sign === '-' ? -1 : 1);
|
|
1181
|
+
total += unit === '%' ? (value / 100) * size : value;
|
|
1182
|
+
}
|
|
1183
|
+
return total;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
593
1186
|
/**
|
|
594
1187
|
* The Unpin control, caption and error / loading / empty states every chart draws, then `body`.
|
|
595
1188
|
* It sits on the chart's own `<figure>` so the caption stays the figure's direct child, which is
|
|
@@ -606,7 +1199,14 @@ class ChartStatesComponent {
|
|
|
606
1199
|
caption = input(null, ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
607
1200
|
error = input(false, ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
608
1201
|
errorText = input('', ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
1202
|
+
/** Draws `skeleton` in place of `body`: there is nothing to draw yet. */
|
|
609
1203
|
pending = input(false, ...(ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []));
|
|
1204
|
+
/** Holds the room of the chart's data-table disclosure under the skeleton, open under `'visible'`. */
|
|
1205
|
+
dataTable = input('none', ...(ngDevMode ? [{ debugName: "dataTable" }] : /* istanbul ignore next */ []));
|
|
1206
|
+
/** Whether the data-table placeholder shimmers, as the chart's own skeleton does. */
|
|
1207
|
+
shimmer = input(true, ...(ngDevMode ? [{ debugName: "shimmer" }] : /* istanbul ignore next */ []));
|
|
1208
|
+
/** Keeps `body` on screen under a loading overlay bound to it, the caption left uncovered. */
|
|
1209
|
+
reloading = input(false, ...(ngDevMode ? [{ debugName: "reloading" }] : /* istanbul ignore next */ []));
|
|
610
1210
|
empty = input(false, ...(ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []));
|
|
611
1211
|
emptyText = input('', ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
612
1212
|
/** Draws the axis L along the message box's start and bottom edges. */
|
|
@@ -615,8 +1215,44 @@ class ChartStatesComponent {
|
|
|
615
1215
|
body = input.required(...(ngDevMode ? [{ debugName: "body" }] : /* istanbul ignore next */ []));
|
|
616
1216
|
/** Replaces the default error and empty paragraph. */
|
|
617
1217
|
message = input(null, ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
1218
|
+
/** How a mark the loading skeleton had no placeholder for arrives when the data lands. */
|
|
1219
|
+
morphGrowth = input(null, ...(ngDevMode ? [{ debugName: "morphGrowth" }] : /* istanbul ignore next */ []));
|
|
1220
|
+
placeholderRows = Array.from({
|
|
1221
|
+
length: CHART_SKELETON_COUNT,
|
|
1222
|
+
});
|
|
1223
|
+
morphingState = signal(false, ...(ngDevMode ? [{ debugName: "morphingState" }] : /* istanbul ignore next */ []));
|
|
1224
|
+
/** Whether the loading skeleton is turning into the drawn chart; a chart animating its own marks
|
|
1225
|
+
* starts them from the skeleton while it is. */
|
|
1226
|
+
morphing = this.morphingState.asReadonly();
|
|
1227
|
+
host = inject(ElementRef);
|
|
1228
|
+
zone = inject(NgZone);
|
|
1229
|
+
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
1230
|
+
stopMorph = () => undefined;
|
|
1231
|
+
constructor() {
|
|
1232
|
+
inject(DestroyRef).onDestroy(() => this.stopMorph());
|
|
1233
|
+
}
|
|
1234
|
+
// Before the view swaps the skeleton out, while its placeholders can still be measured.
|
|
1235
|
+
ngOnChanges(changes) {
|
|
1236
|
+
const pending = changes['pending'];
|
|
1237
|
+
if (!pending || pending.firstChange) {
|
|
1238
|
+
return;
|
|
1239
|
+
}
|
|
1240
|
+
this.stopMorph();
|
|
1241
|
+
if (!pending.previousValue ||
|
|
1242
|
+
pending.currentValue ||
|
|
1243
|
+
!this.isBrowser ||
|
|
1244
|
+
this.error() ||
|
|
1245
|
+
this.empty()) {
|
|
1246
|
+
return;
|
|
1247
|
+
}
|
|
1248
|
+
const stop = this.zone.runOutsideAngular(() => startSkeletonMorph(this.host.nativeElement, this.morphGrowth(), () => this.morphingState.set(false)));
|
|
1249
|
+
if (stop) {
|
|
1250
|
+
this.stopMorph = stop;
|
|
1251
|
+
this.morphingState.set(true);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
618
1254
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartStatesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
619
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartStatesComponent, isStandalone: true, selector: "figure[dsChartStates]", inputs: { unpin: { classPropertyName: "unpin", publicName: "unpin", isSignal: true, isRequired: false, transformFunction: null }, pinned: { classPropertyName: "pinned", publicName: "pinned", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, pending: { classPropertyName: "pending", publicName: "pending", isSignal: true, isRequired: false, transformFunction: null }, empty: { classPropertyName: "empty", publicName: "empty", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, messageAxes: { classPropertyName: "messageAxes", publicName: "messageAxes", isSignal: true, isRequired: false, transformFunction: null }, skeleton: { classPropertyName: "skeleton", publicName: "skeleton", isSignal: true, isRequired: true, transformFunction: null }, body: { classPropertyName: "body", publicName: "body", isSignal: true, isRequired: true, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { release: "release" }, host: { properties: { "class.message-axes": "messageAxes()" } }, ngImport: i0, template: `
|
|
1255
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartStatesComponent, isStandalone: true, selector: "figure[dsChartStates]", inputs: { unpin: { classPropertyName: "unpin", publicName: "unpin", isSignal: true, isRequired: false, transformFunction: null }, pinned: { classPropertyName: "pinned", publicName: "pinned", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, pending: { classPropertyName: "pending", publicName: "pending", isSignal: true, isRequired: false, transformFunction: null }, dataTable: { classPropertyName: "dataTable", publicName: "dataTable", isSignal: true, isRequired: false, transformFunction: null }, shimmer: { classPropertyName: "shimmer", publicName: "shimmer", isSignal: true, isRequired: false, transformFunction: null }, reloading: { classPropertyName: "reloading", publicName: "reloading", isSignal: true, isRequired: false, transformFunction: null }, empty: { classPropertyName: "empty", publicName: "empty", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, messageAxes: { classPropertyName: "messageAxes", publicName: "messageAxes", isSignal: true, isRequired: false, transformFunction: null }, skeleton: { classPropertyName: "skeleton", publicName: "skeleton", isSignal: true, isRequired: true, transformFunction: null }, body: { classPropertyName: "body", publicName: "body", isSignal: true, isRequired: true, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, morphGrowth: { classPropertyName: "morphGrowth", publicName: "morphGrowth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { release: "release" }, host: { properties: { "class.message-axes": "messageAxes()" } }, usesOnChanges: true, ngImport: i0, template: `
|
|
620
1256
|
@if (unpin()) {
|
|
621
1257
|
<ds-chart-unpin [pinned]="pinned()" (release)="release.emit()" />
|
|
622
1258
|
}
|
|
@@ -639,6 +1275,73 @@ class ChartStatesComponent {
|
|
|
639
1275
|
}
|
|
640
1276
|
} @else if (pending()) {
|
|
641
1277
|
<ng-container [ngTemplateOutlet]="skeleton()" />
|
|
1278
|
+
|
|
1279
|
+
@if (dataTable() !== 'none') {
|
|
1280
|
+
<details
|
|
1281
|
+
class="data-table"
|
|
1282
|
+
aria-hidden="true"
|
|
1283
|
+
inert
|
|
1284
|
+
[open]="dataTable() === 'visible'">
|
|
1285
|
+
<summary>
|
|
1286
|
+
<ds-skeleton
|
|
1287
|
+
inline
|
|
1288
|
+
class="data-table-label"
|
|
1289
|
+
width="var(--space-16)"
|
|
1290
|
+
height="var(--space-2)"
|
|
1291
|
+
[shimmer]="shimmer()" />
|
|
1292
|
+
</summary>
|
|
1293
|
+
|
|
1294
|
+
@if (dataTable() === 'visible') {
|
|
1295
|
+
<table>
|
|
1296
|
+
<thead>
|
|
1297
|
+
<tr>
|
|
1298
|
+
<th>
|
|
1299
|
+
<ds-skeleton
|
|
1300
|
+
inline
|
|
1301
|
+
class="data-table-label"
|
|
1302
|
+
width="var(--space-12)"
|
|
1303
|
+
height="var(--space-2)"
|
|
1304
|
+
[shimmer]="shimmer()" />
|
|
1305
|
+
</th>
|
|
1306
|
+
|
|
1307
|
+
<th>
|
|
1308
|
+
<ds-skeleton
|
|
1309
|
+
inline
|
|
1310
|
+
class="data-table-label"
|
|
1311
|
+
width="var(--space-8)"
|
|
1312
|
+
height="var(--space-2)"
|
|
1313
|
+
[shimmer]="shimmer()" />
|
|
1314
|
+
</th>
|
|
1315
|
+
</tr>
|
|
1316
|
+
</thead>
|
|
1317
|
+
|
|
1318
|
+
<tbody>
|
|
1319
|
+
@for (row of placeholderRows; track $index) {
|
|
1320
|
+
<tr>
|
|
1321
|
+
<td>
|
|
1322
|
+
<ds-skeleton
|
|
1323
|
+
inline
|
|
1324
|
+
class="data-table-label"
|
|
1325
|
+
width="var(--space-20)"
|
|
1326
|
+
height="var(--space-2)"
|
|
1327
|
+
[shimmer]="shimmer()" />
|
|
1328
|
+
</td>
|
|
1329
|
+
|
|
1330
|
+
<td>
|
|
1331
|
+
<ds-skeleton
|
|
1332
|
+
inline
|
|
1333
|
+
class="data-table-label"
|
|
1334
|
+
width="var(--space-10)"
|
|
1335
|
+
height="var(--space-2)"
|
|
1336
|
+
[shimmer]="shimmer()" />
|
|
1337
|
+
</td>
|
|
1338
|
+
</tr>
|
|
1339
|
+
}
|
|
1340
|
+
</tbody>
|
|
1341
|
+
</table>
|
|
1342
|
+
}
|
|
1343
|
+
</details>
|
|
1344
|
+
}
|
|
642
1345
|
} @else if (empty()) {
|
|
643
1346
|
@if (message(); as messageTemplate) {
|
|
644
1347
|
<ng-container
|
|
@@ -653,13 +1356,23 @@ class ChartStatesComponent {
|
|
|
653
1356
|
</p>
|
|
654
1357
|
}
|
|
655
1358
|
} @else {
|
|
656
|
-
<
|
|
1359
|
+
<ds-loading-overlay
|
|
1360
|
+
class="reload-overlay"
|
|
1361
|
+
[loading]="reloading()"
|
|
1362
|
+
[blur]="true">
|
|
1363
|
+
<ng-container [ngTemplateOutlet]="body()" />
|
|
1364
|
+
</ds-loading-overlay>
|
|
657
1365
|
}
|
|
658
|
-
`, isInline: true, styles: ["figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}:host:has(>ds-chart-unpin.is-pinned)>figcaption{padding-inline-end:calc(5rem + var(--space-2))}.empty{display:grid;place-items:center;min-block-size:var(--_chart-message-height);margin:0;color:var(--text-secondary);text-align:center}.empty.is-error{color:var(--error)}:host(.message-axes) .empty{border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}\n"], dependencies: [{ kind: "component", type: ChartUnpinComponent, selector: "ds-chart-unpin", inputs: ["pinned"], outputs: ["release"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1366
|
+
`, isInline: true, styles: ["@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.data-table-label{border-radius:var(--radius-pill)}.data-table>summary{min-block-size:calc(1lh + 2 * var(--space-1))}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}:host:has(>ds-chart-unpin.is-pinned)>figcaption{padding-inline-end:calc(5rem + var(--space-2))}.empty{display:grid;place-items:center;min-block-size:var(--_chart-message-height);margin:0;color:var(--text-secondary);text-align:center}.empty.is-error{color:var(--error)}:host(.message-axes) .empty{border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.reload-overlay{--ds-loading-overlay-radius: var(--radius-md);margin:calc(-1 * var(--space-2));padding:var(--space-2)}:host(.funnel-chart) .reload-overlay{margin-inline:0;padding-inline:0}:host(.skeleton-morph)>.reload-overlay{opacity:0}\n"], dependencies: [{ kind: "component", type: ChartUnpinComponent, selector: "ds-chart-unpin", inputs: ["pinned"], outputs: ["release"] }, { kind: "component", type: LoadingOverlayComponent, selector: "ds-loading-overlay", inputs: ["loading", "label", "blur", "spinnerSize", "insetTop", "inertContent"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline", "shimmer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
659
1367
|
}
|
|
660
1368
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartStatesComponent, decorators: [{
|
|
661
1369
|
type: Component,
|
|
662
|
-
args: [{ selector: 'figure[dsChartStates]', standalone: true, imports: [
|
|
1370
|
+
args: [{ selector: 'figure[dsChartStates]', standalone: true, imports: [
|
|
1371
|
+
ChartUnpinComponent,
|
|
1372
|
+
LoadingOverlayComponent,
|
|
1373
|
+
NgTemplateOutlet,
|
|
1374
|
+
SkeletonComponent,
|
|
1375
|
+
], template: `
|
|
663
1376
|
@if (unpin()) {
|
|
664
1377
|
<ds-chart-unpin [pinned]="pinned()" (release)="release.emit()" />
|
|
665
1378
|
}
|
|
@@ -682,6 +1395,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
682
1395
|
}
|
|
683
1396
|
} @else if (pending()) {
|
|
684
1397
|
<ng-container [ngTemplateOutlet]="skeleton()" />
|
|
1398
|
+
|
|
1399
|
+
@if (dataTable() !== 'none') {
|
|
1400
|
+
<details
|
|
1401
|
+
class="data-table"
|
|
1402
|
+
aria-hidden="true"
|
|
1403
|
+
inert
|
|
1404
|
+
[open]="dataTable() === 'visible'">
|
|
1405
|
+
<summary>
|
|
1406
|
+
<ds-skeleton
|
|
1407
|
+
inline
|
|
1408
|
+
class="data-table-label"
|
|
1409
|
+
width="var(--space-16)"
|
|
1410
|
+
height="var(--space-2)"
|
|
1411
|
+
[shimmer]="shimmer()" />
|
|
1412
|
+
</summary>
|
|
1413
|
+
|
|
1414
|
+
@if (dataTable() === 'visible') {
|
|
1415
|
+
<table>
|
|
1416
|
+
<thead>
|
|
1417
|
+
<tr>
|
|
1418
|
+
<th>
|
|
1419
|
+
<ds-skeleton
|
|
1420
|
+
inline
|
|
1421
|
+
class="data-table-label"
|
|
1422
|
+
width="var(--space-12)"
|
|
1423
|
+
height="var(--space-2)"
|
|
1424
|
+
[shimmer]="shimmer()" />
|
|
1425
|
+
</th>
|
|
1426
|
+
|
|
1427
|
+
<th>
|
|
1428
|
+
<ds-skeleton
|
|
1429
|
+
inline
|
|
1430
|
+
class="data-table-label"
|
|
1431
|
+
width="var(--space-8)"
|
|
1432
|
+
height="var(--space-2)"
|
|
1433
|
+
[shimmer]="shimmer()" />
|
|
1434
|
+
</th>
|
|
1435
|
+
</tr>
|
|
1436
|
+
</thead>
|
|
1437
|
+
|
|
1438
|
+
<tbody>
|
|
1439
|
+
@for (row of placeholderRows; track $index) {
|
|
1440
|
+
<tr>
|
|
1441
|
+
<td>
|
|
1442
|
+
<ds-skeleton
|
|
1443
|
+
inline
|
|
1444
|
+
class="data-table-label"
|
|
1445
|
+
width="var(--space-20)"
|
|
1446
|
+
height="var(--space-2)"
|
|
1447
|
+
[shimmer]="shimmer()" />
|
|
1448
|
+
</td>
|
|
1449
|
+
|
|
1450
|
+
<td>
|
|
1451
|
+
<ds-skeleton
|
|
1452
|
+
inline
|
|
1453
|
+
class="data-table-label"
|
|
1454
|
+
width="var(--space-10)"
|
|
1455
|
+
height="var(--space-2)"
|
|
1456
|
+
[shimmer]="shimmer()" />
|
|
1457
|
+
</td>
|
|
1458
|
+
</tr>
|
|
1459
|
+
}
|
|
1460
|
+
</tbody>
|
|
1461
|
+
</table>
|
|
1462
|
+
}
|
|
1463
|
+
</details>
|
|
1464
|
+
}
|
|
685
1465
|
} @else if (empty()) {
|
|
686
1466
|
@if (message(); as messageTemplate) {
|
|
687
1467
|
<ng-container
|
|
@@ -696,14 +1476,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
696
1476
|
</p>
|
|
697
1477
|
}
|
|
698
1478
|
} @else {
|
|
699
|
-
<
|
|
1479
|
+
<ds-loading-overlay
|
|
1480
|
+
class="reload-overlay"
|
|
1481
|
+
[loading]="reloading()"
|
|
1482
|
+
[blur]="true">
|
|
1483
|
+
<ng-container [ngTemplateOutlet]="body()" />
|
|
1484
|
+
</ds-loading-overlay>
|
|
700
1485
|
}
|
|
701
|
-
`, host: { '[class.message-axes]': 'messageAxes()' }, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}:host:has(>ds-chart-unpin.is-pinned)>figcaption{padding-inline-end:calc(5rem + var(--space-2))}.empty{display:grid;place-items:center;min-block-size:var(--_chart-message-height);margin:0;color:var(--text-secondary);text-align:center}.empty.is-error{color:var(--error)}:host(.message-axes) .empty{border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}\n"] }]
|
|
702
|
-
}], propDecorators: { unpin: [{ type: i0.Input, args: [{ isSignal: true, alias: "unpin", required: false }] }], pinned: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinned", required: false }] }], release: [{ type: i0.Output, args: ["release"] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], pending: [{ type: i0.Input, args: [{ isSignal: true, alias: "pending", required: false }] }], empty: [{ type: i0.Input, args: [{ isSignal: true, alias: "empty", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], messageAxes: [{ type: i0.Input, args: [{ isSignal: true, alias: "messageAxes", required: false }] }], skeleton: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeleton", required: true }] }], body: [{ type: i0.Input, args: [{ isSignal: true, alias: "body", required: true }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }] } });
|
|
1486
|
+
`, host: { '[class.message-axes]': 'messageAxes()' }, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["@layer ds-component-base{:host{box-sizing:border-box;interpolate-size:allow-keywords}*,*:before,*:after{box-sizing:border-box}button,input,select,textarea{font-family:inherit}h1,h2,h3,h4,h5,h6{margin:0}:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--focus-ring-radius)}@media(forced-colors:active){:host(:where(:focus-visible)),:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.data-table-label{border-radius:var(--radius-pill)}.data-table>summary{min-block-size:calc(1lh + 2 * var(--space-1))}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}:host:has(>ds-chart-unpin.is-pinned)>figcaption{padding-inline-end:calc(5rem + var(--space-2))}.empty{display:grid;place-items:center;min-block-size:var(--_chart-message-height);margin:0;color:var(--text-secondary);text-align:center}.empty.is-error{color:var(--error)}:host(.message-axes) .empty{border-inline-start:1px solid var(--ds-chart-axis-line-color);border-block-end:1px solid var(--ds-chart-axis-line-color)}.reload-overlay{--ds-loading-overlay-radius: var(--radius-md);margin:calc(-1 * var(--space-2));padding:var(--space-2)}:host(.funnel-chart) .reload-overlay{margin-inline:0;padding-inline:0}:host(.skeleton-morph)>.reload-overlay{opacity:0}\n"] }]
|
|
1487
|
+
}], ctorParameters: () => [], propDecorators: { unpin: [{ type: i0.Input, args: [{ isSignal: true, alias: "unpin", required: false }] }], pinned: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinned", required: false }] }], release: [{ type: i0.Output, args: ["release"] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], pending: [{ type: i0.Input, args: [{ isSignal: true, alias: "pending", required: false }] }], dataTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTable", required: false }] }], shimmer: [{ type: i0.Input, args: [{ isSignal: true, alias: "shimmer", required: false }] }], reloading: [{ type: i0.Input, args: [{ isSignal: true, alias: "reloading", required: false }] }], empty: [{ type: i0.Input, args: [{ isSignal: true, alias: "empty", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], messageAxes: [{ type: i0.Input, args: [{ isSignal: true, alias: "messageAxes", required: false }] }], skeleton: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeleton", required: true }] }], body: [{ type: i0.Input, args: [{ isSignal: true, alias: "body", required: true }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], morphGrowth: [{ type: i0.Input, args: [{ isSignal: true, alias: "morphGrowth", required: false }] }] } });
|
|
703
1488
|
|
|
704
1489
|
/**
|
|
705
1490
|
* Generated bundle index. Do not edit.
|
|
706
1491
|
*/
|
|
707
1492
|
|
|
708
|
-
export { CHART_PIN_GAP, CHART_PIN_RADIUS, CHART_UNPIN_DRAWN_BY_HOST, ChartPinMarkerComponent, ChartStatesComponent, ChartTooltipDirective, ChartUnpinComponent, chartActiveMark };
|
|
1493
|
+
export { CHART_PIN_GAP, CHART_PIN_RADIUS, CHART_SKELETON_CATEGORY_BAND, CHART_UNPIN_DRAWN_BY_HOST, ChartPinMarkerComponent, ChartPlacedDirective, ChartSkeletonComponent, ChartStatesComponent, ChartTooltipDirective, ChartUnpinComponent, chartActiveMark, isPrimaryPress };
|
|
709
1494
|
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map
|