@ids-group-ltd/ids-design-system 0.14.4 → 0.14.5
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 +160 -0
- package/components.md +14 -14
- package/docs/agent/INDEX.md +1 -1
- package/docs/agent/charts/ds-bar-chart.md +1 -1
- package/docs/agent/charts/ds-chart.md +1 -1
- package/docs/agent/charts/ds-column-chart.md +1 -1
- package/docs/agent/charts/ds-funnel-chart.md +1 -1
- package/docs/agent/charts/ds-heatmap-chart.md +1 -1
- package/docs/agent/charts/ds-line-chart.md +1 -1
- package/docs/agent/charts/ds-pie-chart.md +3 -3
- package/docs/agent/charts/ds-scatter-chart.md +1 -1
- package/docs/agent/charts/ds-waterfall-chart.md +1 -1
- package/docs/agent/navigation/ds-breadcrumbs.md +1 -1
- package/docs/agent/overlays/ds-tooltip.md +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +4 -6
- 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 +2 -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 +58 -163
- 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 +21 -34
- 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 +34 -105
- 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 +3 -3
- 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 +22 -48
- 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 +7 -7
- 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 -10
- 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 +28 -130
- 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 +11 -29
- 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 +10 -28
- 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 +16 -13
- 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 +3 -3
- 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 +42 -69
- 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 +15 -20
- 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 +6 -7
- 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 +3 -10
- 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 +12 -28
- 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 +58 -112
- 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 +182 -432
- 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 +8 -12
- 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 +8 -22
- 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 +28 -123
- 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 +45 -116
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +3 -3
- 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 +4 -6
- 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 +7 -16
- 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 +7 -8
- 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 +3 -3
- 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 +16 -45
- 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 +10 -14
- 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 +19 -41
- 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 +48 -163
- 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 +27 -85
- 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 +17 -25
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +21 -41
- 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 +3 -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 +50 -166
- 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 +7 -7
- 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 +6 -11
- 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 +19 -36
- 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 +30 -57
- 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 +37 -103
- 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 +5 -6
- 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 +9 -15
- 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 +1 -1
- 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 +8 -12
- 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 +9 -24
- 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 +32 -120
- 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 +14 -24
- 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 +15 -24
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs +9 -16
- package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +27 -91
- 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 +16 -41
- 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 +8 -11
- 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 +18 -52
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +4 -7
- 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 +30 -49
- 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 +8 -12
- 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 +6 -7
- 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 +29 -13
- 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 +3 -3
- 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 +8 -9
- 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 +5 -20
- 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 +4 -4
- 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 +3 -3
- 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 +5 -9
- 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 +11 -23
- 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 +7 -16
- 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 +9 -43
- 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 +167 -353
- 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 +33 -86
- 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 +7 -7
- 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 +23 -47
- 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 +21 -49
- 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 +35 -63
- 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 -3
- 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 +38 -50
- 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 +3 -5
- 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 +3 -3
- 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 +28 -85
- 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 +325 -579
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +51 -85
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +4 -21
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs +4 -13
- package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs +1 -2
- package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs.map +1 -1
- package/migrations/0.14.5.json +311 -0
- package/package.json +1 -1
- package/schematics/check-overrides/surface.json +17 -2
- package/styles/_breakpoints.scss +6 -23
- package/styles/_chart-data-table.scss +3 -11
- package/styles/_chart-frame.scss +14 -63
- package/styles/_chart-interactive.scss +8 -36
- package/styles/_chart-motion.scss +11 -39
- package/styles/_check-box.scss +7 -26
- package/styles/_check-mark.scss +7 -23
- package/styles/_chip-row.scss +3 -14
- package/styles/_clear-button.scss +2 -7
- package/styles/_control-label.scss +2 -13
- package/styles/_control-line.scss +2 -6
- package/styles/_dropdown-overlay.scss +8 -33
- package/styles/_ds-color.scss +9 -28
- package/styles/_field-box.scss +4 -16
- package/styles/_field-group-segment.scss +6 -6
- package/styles/_field-label.scss +3 -14
- package/styles/_field-state.scss +5 -10
- package/styles/_focus.scss +20 -60
- package/styles/_icon-base.scss +0 -2
- package/styles/_layout-utils.scss +0 -3
- package/styles/_link.scss +4 -18
- package/styles/_overlay-motion.scss +15 -38
- package/styles/_page-grid.scss +4 -29
- package/styles/_press.scss +5 -18
- package/styles/_reset.scss +1 -14
- package/styles/_scrollbar.scss +0 -2
- package/styles/_skeleton-shimmer.scss +3 -14
- package/styles/_status.scss +5 -13
- package/styles/_surface-motion.scss +7 -34
- package/styles/_table-controls.scss +3 -6
- package/styles/_text-clip.scss +2 -6
- package/styles/_theme-activation.scss +7 -20
- package/styles/_toast-overlay.scss +2 -6
- package/styles/_tokens-charts.scss +31 -90
- package/styles/_tokens.scss +111 -156
- package/styles/_typography.scss +6 -13
- package/styles/_visually-hidden.scss +2 -3
- package/styles/ds.scss +2 -10
- package/themes/_base-palette.scss +12 -35
- package/themes/_semantic.scss +29 -98
- package/themes/dark/_palette.scss +15 -29
- package/themes/dark/_theme.scss +14 -32
- package/themes/light/_palette.scss +2 -17
- package/themes/light/_theme.scss +1 -7
- package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +2 -6
- package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +2 -3
- package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +45 -119
- package/types/ids-group-ltd-ids-design-system-components-auth-layout.d.ts +19 -32
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +29 -92
- package/types/ids-group-ltd-ids-design-system-components-avatar-group.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-avatar.d.ts +23 -46
- package/types/ids-group-ltd-ids-design-system-components-badge.d.ts +5 -5
- package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +4 -8
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +27 -136
- package/types/ids-group-ltd-ids-design-system-components-bar.d.ts +13 -32
- package/types/ids-group-ltd-ids-design-system-components-bottom-sheet.d.ts +6 -12
- package/types/ids-group-ltd-ids-design-system-components-breadcrumbs.d.ts +6 -9
- package/types/ids-group-ltd-ids-design-system-components-button-group.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +36 -55
- package/types/ids-group-ltd-ids-design-system-components-calendar-day.d.ts +13 -18
- package/types/ids-group-ltd-ids-design-system-components-card.d.ts +2 -2
- package/types/ids-group-ltd-ids-design-system-components-chart-data-table.d.ts +5 -11
- package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +10 -26
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +27 -49
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +161 -385
- package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +6 -10
- package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +5 -14
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +29 -124
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +23 -70
- package/types/ids-group-ltd-ids-design-system-components-description-list.d.ts +3 -3
- package/types/ids-group-ltd-ids-design-system-components-divider.d.ts +3 -7
- package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +1 -3
- package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +6 -8
- package/types/ids-group-ltd-ids-design-system-components-empty-state.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-field-group.d.ts +17 -50
- package/types/ids-group-ltd-ids-design-system-components-field-message.d.ts +8 -12
- package/types/ids-group-ltd-ids-design-system-components-filter-bar.d.ts +13 -28
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +25 -113
- package/types/ids-group-ltd-ids-design-system-components-heatmap-chart.d.ts +17 -85
- package/types/ids-group-ltd-ids-design-system-components-icon-button.d.ts +15 -23
- package/types/ids-group-ltd-ids-design-system-components-input.d.ts +18 -37
- package/types/ids-group-ltd-ids-design-system-components-layout.d.ts +3 -3
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +51 -160
- package/types/ids-group-ltd-ids-design-system-components-list.d.ts +3 -3
- package/types/ids-group-ltd-ids-design-system-components-loading-overlay.d.ts +4 -9
- package/types/ids-group-ltd-ids-design-system-components-menu.d.ts +13 -21
- package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +15 -28
- package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +27 -83
- package/types/ids-group-ltd-ids-design-system-components-number-stepper.d.ts +5 -6
- package/types/ids-group-ltd-ids-design-system-components-otp-input.d.ts +5 -7
- package/types/ids-group-ltd-ids-design-system-components-page-footer.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +6 -10
- package/types/ids-group-ltd-ids-design-system-components-password-rules.d.ts +8 -22
- package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +18 -102
- package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +7 -11
- package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +14 -25
- package/types/ids-group-ltd-ids-design-system-components-reserve-messages.d.ts +7 -12
- package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +21 -96
- package/types/ids-group-ltd-ids-design-system-components-search.d.ts +12 -33
- package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +6 -7
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +12 -41
- package/types/ids-group-ltd-ids-design-system-components-sidenav-footer.d.ts +8 -15
- package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +23 -40
- package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +3 -5
- package/types/ids-group-ltd-ids-design-system-components-slider.d.ts +4 -4
- package/types/ids-group-ltd-ids-design-system-components-sparkline.d.ts +14 -10
- package/types/ids-group-ltd-ids-design-system-components-spinner.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-split-button.d.ts +6 -7
- package/types/ids-group-ltd-ids-design-system-components-stat.d.ts +2 -15
- package/types/ids-group-ltd-ids-design-system-components-status-dot.d.ts +2 -2
- package/types/ids-group-ltd-ids-design-system-components-stepper.d.ts +4 -6
- package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +5 -9
- package/types/ids-group-ltd-ids-design-system-components-table-columns.d.ts +3 -7
- package/types/ids-group-ltd-ids-design-system-components-table-export.d.ts +4 -8
- package/types/ids-group-ltd-ids-design-system-components-table-resize.d.ts +9 -43
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +160 -369
- package/types/ids-group-ltd-ids-design-system-components-tabs.d.ts +21 -49
- package/types/ids-group-ltd-ids-design-system-components-tag.d.ts +5 -5
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +17 -34
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +17 -38
- package/types/ids-group-ltd-ids-design-system-components-timeline.d.ts +2 -2
- package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +20 -37
- package/types/ids-group-ltd-ids-design-system-components-toggle-button.d.ts +2 -3
- package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +17 -36
- package/types/ids-group-ltd-ids-design-system-components-tree.d.ts +2 -2
- package/types/ids-group-ltd-ids-design-system-components-w3w.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-waterfall-chart.d.ts +21 -70
- package/types/ids-group-ltd-ids-design-system-components.d.ts +262 -415
- package/types/ids-group-ltd-ids-design-system-core.d.ts +133 -260
- package/types/ids-group-ltd-ids-design-system-icons.d.ts +2 -24
- package/types/ids-group-ltd-ids-design-system-overlay.d.ts +4 -13
- package/types/ids-group-ltd-ids-design-system-theme.d.ts +4 -6
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, computed, signal, PLATFORM_ID, DestroyRef, InjectionToken, ElementRef, afterNextRender, NgZone, untracked, afterRenderEffect, TemplateRef, Directive, Injector, isDevMode, input, booleanAttribute, effect, DOCUMENT } from '@angular/core';
|
|
3
|
-
import { DS_CONFIG,
|
|
2
|
+
import { inject, computed, signal, PLATFORM_ID, DestroyRef, InjectionToken, ElementRef, afterNextRender, NgZone, untracked, afterRenderEffect, TemplateRef, Directive, Injector, isDevMode, input, booleanAttribute, effect, numberAttribute, DOCUMENT } from '@angular/core';
|
|
3
|
+
import { DS_CONFIG, injectDsLocale, DS_INTL, resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';
|
|
4
4
|
import { isPlatformBrowser } from '@angular/common';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { NgForm, FormGroupDirective, NgControl } from '@angular/forms';
|
|
7
7
|
import { Router, ActivatedRoute, UrlTree } from '@angular/router';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
* `
|
|
12
|
-
* identically on every screen, so the answer belongs in one provider rather than
|
|
13
|
-
* in four bindings per template.
|
|
14
|
-
*
|
|
15
|
-
* Same `null`-means-unset shape as `resolveReserveMessage` — here `''` is an
|
|
16
|
-
* explicit "this screen has no brand", and each field resolves on its own.
|
|
10
|
+
* Resolves one brand string against the app-level default. `null` means unset;
|
|
11
|
+
* `''` is an explicit "this screen has no brand". Each field resolves on its own.
|
|
17
12
|
* @internal
|
|
18
13
|
*/
|
|
19
14
|
function resolveBrandValue(value, key) {
|
|
@@ -107,8 +102,7 @@ function formatValue(value, locale) {
|
|
|
107
102
|
}
|
|
108
103
|
const chartFormats = new Map();
|
|
109
104
|
/** The built-in `valueFormat` in one locale: compact on a tick (`1.2M`), spelled out everywhere
|
|
110
|
-
* else (`1,248,392`). A caller-supplied formatter receives the same `location
|
|
111
|
-
* itself; this is only the default.
|
|
105
|
+
* else (`1,248,392`). A caller-supplied formatter receives the same `location`.
|
|
112
106
|
*
|
|
113
107
|
* @internal */
|
|
114
108
|
function chartValueFormat(locale) {
|
|
@@ -149,8 +143,7 @@ function formatPercent(value, total, locale) {
|
|
|
149
143
|
}
|
|
150
144
|
const fraction = value / total;
|
|
151
145
|
const formatter = percentFormatter(locale, 1);
|
|
152
|
-
// A real share must never print as an exact zero
|
|
153
|
-
// "0.0%" beside a bar too short to see, and the row reads as nothing when it is not nothing.
|
|
146
|
+
// A real share must never print as an exact zero.
|
|
154
147
|
if (fraction !== 0 && Math.abs(fraction) < 0.0005) {
|
|
155
148
|
return fraction > 0
|
|
156
149
|
? `<${formatter.format(0.001)}`
|
|
@@ -164,10 +157,9 @@ function formatPercent(value, total, locale) {
|
|
|
164
157
|
function formatWholePercent(percent, locale) {
|
|
165
158
|
return percentFormatter(locale, 0).format(percent / 100);
|
|
166
159
|
}
|
|
167
|
-
/** Whole percentages that sum to exactly 100
|
|
168
|
-
* gives 33/33/33 for three equal parts, and a legend that visibly loses 1%.
|
|
160
|
+
/** Whole percentages that sum to exactly 100 (rounding each alone gives 33/33/33).
|
|
169
161
|
*
|
|
170
|
-
* @internal
|
|
162
|
+
* @internal */
|
|
171
163
|
function largestRemainder(values) {
|
|
172
164
|
const total = values.reduce((sum, value) => sum + value, 0);
|
|
173
165
|
if (!total) {
|
|
@@ -197,8 +189,7 @@ function formatTick(value, step) {
|
|
|
197
189
|
if (Math.abs(value) < 1000) {
|
|
198
190
|
return String(value);
|
|
199
191
|
}
|
|
200
|
-
// The unit follows the
|
|
201
|
-
// a step of 200M labels 1e9 as 1000M, never 1B beside 800M.
|
|
192
|
+
// The unit follows the step, not the value, so every label on an axis shares a suffix.
|
|
202
193
|
const units = [
|
|
203
194
|
{ suffix: 'B', scale: 1e9 },
|
|
204
195
|
{ suffix: 'M', scale: 1e6 },
|
|
@@ -206,19 +197,14 @@ function formatTick(value, step) {
|
|
|
206
197
|
];
|
|
207
198
|
const unit = units.find((candidate) => Math.abs(step) >= candidate.scale) ?? units[2];
|
|
208
199
|
const scaled = value / unit.scale;
|
|
209
|
-
// A step that divides its unit evenly needs no decimal;
|
|
210
|
-
//
|
|
211
|
-
// whole branch matters too: a caller passing a raw datum instead of a tick would otherwise print
|
|
212
|
-
// every digit of the division, as 987.654321M.
|
|
200
|
+
// A step that divides its unit evenly needs no decimal; otherwise exactly one on every label.
|
|
201
|
+
// Rounding the whole branch keeps a raw datum from printing 987.654321M.
|
|
213
202
|
return step % unit.scale === 0
|
|
214
203
|
? `${Math.round(scaled)}${unit.suffix}`
|
|
215
204
|
: `${scaled.toFixed(1)}${unit.suffix}`;
|
|
216
205
|
}
|
|
217
|
-
/** One mark's share of the total its siblings add up to, as a bare percentage
|
|
218
|
-
*
|
|
219
|
-
* Empty for a lone mark, which is the whole of its own total, and empty for a reading that is not
|
|
220
|
-
* part of a total anyone can see: negatives and non-finite values are excluded from the total
|
|
221
|
-
* rather than subtracted from it, so a negative mark has no share rather than a misleading one.
|
|
206
|
+
/** One mark's share of the total its siblings add up to, as a bare percentage; empty for a lone mark,
|
|
207
|
+
* and for a negative or non-finite reading (excluded from the total, not subtracted).
|
|
222
208
|
*
|
|
223
209
|
* @internal */
|
|
224
210
|
function shareOfTotal(values, index, locale) {
|
|
@@ -231,8 +217,7 @@ function shareOfTotal(values, index, locale) {
|
|
|
231
217
|
.reduce((sum, entry) => sum + entry, 0);
|
|
232
218
|
return total > 0 ? formatPercent(value, total, locale) : '';
|
|
233
219
|
}
|
|
234
|
-
/** The same share, phrased for a tooltip line
|
|
235
|
-
* the percentage is OF.
|
|
220
|
+
/** The same share, phrased for a tooltip line.
|
|
236
221
|
*
|
|
237
222
|
* @internal */
|
|
238
223
|
function describeShare(values, index, locale, phrase) {
|
|
@@ -240,8 +225,7 @@ function describeShare(values, index, locale, phrase) {
|
|
|
240
225
|
return share ? phrase(share) : '';
|
|
241
226
|
}
|
|
242
227
|
|
|
243
|
-
/** Container width as a signal
|
|
244
|
-
* `display: none`, and before the first observation.
|
|
228
|
+
/** Container width as a signal; 0 under SSR, while `display: none`, and before the first observation.
|
|
245
229
|
*
|
|
246
230
|
* @internal */
|
|
247
231
|
function elementWidth(host) {
|
|
@@ -260,8 +244,7 @@ function elementWidth(host) {
|
|
|
260
244
|
}
|
|
261
245
|
const widths = new WeakMap();
|
|
262
246
|
let observer$1 = null;
|
|
263
|
-
// One observer for every chart on the page
|
|
264
|
-
// rather than one callback per chart.
|
|
247
|
+
// One observer for every chart on the page: a resize is one callback carrying every entry.
|
|
265
248
|
function sharedObserver() {
|
|
266
249
|
observer$1 ??= new ResizeObserver((entries) => {
|
|
267
250
|
for (const entry of entries) {
|
|
@@ -271,8 +254,7 @@ function sharedObserver() {
|
|
|
271
254
|
return observer$1;
|
|
272
255
|
}
|
|
273
256
|
|
|
274
|
-
/** Provided by a chart that has already waited for the viewport, so
|
|
275
|
-
* through builds at once instead of waiting a second time.
|
|
257
|
+
/** Provided by a chart that has already waited for the viewport, so its `ds-chart` builds at once.
|
|
276
258
|
*
|
|
277
259
|
* @internal */
|
|
278
260
|
const CHART_RENDER_GATE_PASSED = new InjectionToken('CHART_RENDER_GATE_PASSED');
|
|
@@ -295,7 +277,7 @@ function drain() {
|
|
|
295
277
|
}
|
|
296
278
|
draining = false;
|
|
297
279
|
}
|
|
298
|
-
// An idle period with less than this left would run a
|
|
280
|
+
// An idle period with less than this left would run a build into the next frame.
|
|
299
281
|
const IDLE_ROOM_MS = 12;
|
|
300
282
|
function buildWhileIdle(deadline) {
|
|
301
283
|
idleScheduled = false;
|
|
@@ -329,8 +311,6 @@ function observer(root, margin, queue, schedule) {
|
|
|
329
311
|
found = new IntersectionObserver((entries) => {
|
|
330
312
|
for (const entry of entries) {
|
|
331
313
|
const build = builders.get(entry.target);
|
|
332
|
-
// A chart the reader has already scrolled past leaves the queue instead of being built
|
|
333
|
-
// behind them.
|
|
334
314
|
if (build && entry.isIntersecting) {
|
|
335
315
|
queue.set(entry.target, build);
|
|
336
316
|
}
|
|
@@ -350,10 +330,9 @@ function scheduleDrain() {
|
|
|
350
330
|
setTimeout(drain);
|
|
351
331
|
}
|
|
352
332
|
}
|
|
353
|
-
// A margin on the root only widens the root: an element
|
|
354
|
-
//
|
|
355
|
-
//
|
|
356
|
-
// auto` too - so the container also has to be taller inside than out.
|
|
333
|
+
// A margin on the root only widens the root: an element in a scrolling container is clipped by it
|
|
334
|
+
// first, so the container must be the root. Overflow alone is not enough (a sideways-only scroller
|
|
335
|
+
// computes `overflow-y: auto` too), so it must also be taller inside than out.
|
|
357
336
|
function scrollRoot(host) {
|
|
358
337
|
for (let node = host.parentElement; node; node = node.parentElement) {
|
|
359
338
|
const overflow = getComputedStyle(node).overflowY;
|
|
@@ -366,14 +345,14 @@ function scrollRoot(host) {
|
|
|
366
345
|
}
|
|
367
346
|
return null;
|
|
368
347
|
}
|
|
369
|
-
/** Whether a chart may build its plot yet, under `DS_CONFIG.chart.rendering`. `true` from the
|
|
370
|
-
*
|
|
371
|
-
*
|
|
348
|
+
/** Whether a chart may build its plot yet, under `DS_CONFIG.chart.rendering`. `true` from the start
|
|
349
|
+
* unless `deferUntilVisible` is on; then `true` once the chart nears the viewport or is built ahead
|
|
350
|
+
* while the page is idle, and it stays `true`. Call from an injection context.
|
|
372
351
|
*
|
|
373
352
|
* @internal */
|
|
374
353
|
function chartRenderGate() {
|
|
375
354
|
const rendering = inject(DS_CONFIG).chart?.rendering;
|
|
376
|
-
// `skipSelf`: a preset provides the token to its own view
|
|
355
|
+
// `skipSelf`: a preset provides the token to its own view and must not read it back.
|
|
377
356
|
const passed = inject(CHART_RENDER_GATE_PASSED, {
|
|
378
357
|
optional: true,
|
|
379
358
|
skipSelf: true,
|
|
@@ -407,7 +386,7 @@ function chartRenderGate() {
|
|
|
407
386
|
builders.set(host, () => {
|
|
408
387
|
release();
|
|
409
388
|
if (skipWhileOffscreen) {
|
|
410
|
-
// `auto` remembers the
|
|
389
|
+
// `auto` remembers the last rendered height, so skipping moves nothing.
|
|
411
390
|
host.style.contentVisibility = 'auto';
|
|
412
391
|
host.style.containIntrinsicBlockSize = 'auto 300px';
|
|
413
392
|
}
|
|
@@ -421,15 +400,11 @@ function chartRenderGate() {
|
|
|
421
400
|
return ready.asReadonly();
|
|
422
401
|
}
|
|
423
402
|
|
|
424
|
-
/** A label turned 45 degrees takes this fraction of its width across the axis.
|
|
425
|
-
* policy stops: past it the eye has to tilt rather than glance. */
|
|
403
|
+
/** A label turned 45 degrees takes this fraction of its width across the axis. */
|
|
426
404
|
const ROTATED_FOOTPRINT = Math.sin(Math.PI / 4);
|
|
427
|
-
/**
|
|
428
|
-
* its width PLUS this. 16 sits in the middle of the 12-36 band the probe's cases allow, so a later
|
|
429
|
-
* nudge does not flip an interval. */
|
|
405
|
+
/** Labels that merely fail to overlap read as one run, so a footprint is its width plus this. */
|
|
430
406
|
const LABEL_GAP = 16;
|
|
431
|
-
/** The
|
|
432
|
-
* the one long month name, and a reader meets the collision rather than the average.
|
|
407
|
+
/** The widest label decides for all.
|
|
433
408
|
*
|
|
434
409
|
* @internal */
|
|
435
410
|
function labelInterval(labelWidths, step, rotated) {
|
|
@@ -441,7 +416,7 @@ function labelInterval(labelWidths, step, rotated) {
|
|
|
441
416
|
const footprint = (rotated ? widest * ROTATED_FOOTPRINT : widest) + LABEL_GAP;
|
|
442
417
|
return Math.max(1, Math.ceil(footprint / step));
|
|
443
418
|
}
|
|
444
|
-
/** Asked before thinning
|
|
419
|
+
/** Asked before thinning: a tilt is spent before a reading.
|
|
445
420
|
*
|
|
446
421
|
* @internal */
|
|
447
422
|
function rotationWouldFit(labelWidths, step) {
|
|
@@ -449,11 +424,9 @@ function rotationWouldFit(labelWidths, step) {
|
|
|
449
424
|
labelInterval(labelWidths, step, true) === 1);
|
|
450
425
|
}
|
|
451
426
|
|
|
452
|
-
/** A series only decimates past
|
|
453
|
-
* any profile and the loss of detail is not, so the trade is the wrong way round. */
|
|
427
|
+
/** A series only decimates past four times the target: below that the saving is invisible and the loss of detail is not. */
|
|
454
428
|
const DECIMATION_HEADROOM = 4;
|
|
455
|
-
/** How many marks the plot can carry: one per pixel of its
|
|
456
|
-
* screen has one pixel is two DOM nodes the reader cannot tell apart.
|
|
429
|
+
/** How many marks the plot can carry: one per pixel of its width.
|
|
457
430
|
*
|
|
458
431
|
* @internal */
|
|
459
432
|
function decimationTarget(plotWidth) {
|
|
@@ -467,17 +440,14 @@ function needsDecimating(count, target) {
|
|
|
467
440
|
}
|
|
468
441
|
/** Buckets the series by position and keeps each bucket's highest and lowest reading.
|
|
469
442
|
*
|
|
470
|
-
* The default
|
|
471
|
-
*
|
|
472
|
-
* point that was dropped. It also parallelises and stays stable while the reader pans, since a
|
|
473
|
-
* bucket's answer does not depend on the buckets around it.
|
|
443
|
+
* The default: a bucket's extremum is in the output by construction, so a spike cannot be dropped,
|
|
444
|
+
* and the result is stable while panning.
|
|
474
445
|
*
|
|
475
446
|
* @internal */
|
|
476
447
|
function minMaxDecimate(points, target) {
|
|
477
448
|
if (target <= 0 || points.length <= target) {
|
|
478
449
|
return points;
|
|
479
450
|
}
|
|
480
|
-
// Two points leave each bucket, so the bucket count is half the budget.
|
|
481
451
|
const buckets = Math.max(1, Math.floor(target / 2));
|
|
482
452
|
const size = points.length / buckets;
|
|
483
453
|
const kept = [];
|
|
@@ -497,7 +467,6 @@ function minMaxDecimate(points, target) {
|
|
|
497
467
|
highest = points[index];
|
|
498
468
|
}
|
|
499
469
|
}
|
|
500
|
-
// In the order they occur, so the output still reads left to right.
|
|
501
470
|
const [first, second] = lowest.x <= highest.x ? [lowest, highest] : [highest, lowest];
|
|
502
471
|
kept.push(first);
|
|
503
472
|
if (second !== first) {
|
|
@@ -509,9 +478,8 @@ function minMaxDecimate(points, target) {
|
|
|
509
478
|
/** Largest Triangle Three Buckets: keeps the reading in each bucket that makes the biggest triangle
|
|
510
479
|
* with the point already kept and the next bucket's centre of mass.
|
|
511
480
|
*
|
|
512
|
-
*
|
|
513
|
-
*
|
|
514
|
-
* for it where the outline is the reading and an individual point is not.
|
|
481
|
+
* Draws a truer shape than MinMax at the same budget but does not promise the extremum: use where
|
|
482
|
+
* the outline is the reading.
|
|
515
483
|
*
|
|
516
484
|
* @internal */
|
|
517
485
|
function lttbDecimate(points, target) {
|
|
@@ -519,7 +487,6 @@ function lttbDecimate(points, target) {
|
|
|
519
487
|
return points;
|
|
520
488
|
}
|
|
521
489
|
const kept = [points[0]];
|
|
522
|
-
// The first and the last are fixed, so the buckets divide what is between them.
|
|
523
490
|
const size = (points.length - 2) / (target - 2);
|
|
524
491
|
let previous = points[0];
|
|
525
492
|
for (let bucket = 0; bucket < target - 2; bucket++) {
|
|
@@ -588,9 +555,8 @@ function lineSegments(points) {
|
|
|
588
555
|
}
|
|
589
556
|
return segments;
|
|
590
557
|
}
|
|
591
|
-
/** `''` rather than a partial list when a coordinate is unplottable: one `NaN`
|
|
592
|
-
* `points`
|
|
593
|
-
* with nothing logged.
|
|
558
|
+
/** `''` rather than a partial list when a coordinate is unplottable: one `NaN` voids the whole
|
|
559
|
+
* `points` attribute and the line vanishes silently.
|
|
594
560
|
*
|
|
595
561
|
* @internal */
|
|
596
562
|
function polylinePoints(segment) {
|
|
@@ -599,9 +565,8 @@ function polylinePoints(segment) {
|
|
|
599
565
|
}
|
|
600
566
|
return segment.map((point) => coordinatePair(point)).join(' ');
|
|
601
567
|
}
|
|
602
|
-
/** Fritsch-Carlson tangents: the slope at each reading, clamped so no segment
|
|
603
|
-
*
|
|
604
|
-
* plateau flat instead of bulging through it. */
|
|
568
|
+
/** Fritsch-Carlson tangents: the slope at each reading, clamped so no segment turns back on itself.
|
|
569
|
+
* A zero slope on either side pins the tangent flat, keeping a plateau flat. */
|
|
605
570
|
function monotoneTangents(segment) {
|
|
606
571
|
const count = segment.length;
|
|
607
572
|
const secants = [];
|
|
@@ -623,8 +588,7 @@ function monotoneTangents(segment) {
|
|
|
623
588
|
tangents[index + 1] = 0;
|
|
624
589
|
continue;
|
|
625
590
|
}
|
|
626
|
-
//
|
|
627
|
-
// sits on is what makes the cubic monotone on that span.
|
|
591
|
+
// Tangent within three times its secant keeps the cubic monotone on that span.
|
|
628
592
|
const alpha = tangents[index] / secant;
|
|
629
593
|
const beta = tangents[index + 1] / secant;
|
|
630
594
|
const magnitude = Math.hypot(alpha, beta);
|
|
@@ -657,8 +621,7 @@ function smoothPath(segment) {
|
|
|
657
621
|
}
|
|
658
622
|
return path;
|
|
659
623
|
}
|
|
660
|
-
/** One unbroken run as a path `d`. `''`
|
|
661
|
-
* unplottable: one `NaN` voids the whole attribute and the line vanishes with nothing logged.
|
|
624
|
+
/** One unbroken run as a path `d`. `''` when a coordinate is unplottable (one `NaN` voids the attribute).
|
|
662
625
|
*
|
|
663
626
|
* @internal */
|
|
664
627
|
function linePath(segment, curve = 'linear') {
|
|
@@ -677,10 +640,8 @@ function linePath(segment, curve = 'linear') {
|
|
|
677
640
|
}
|
|
678
641
|
return smoothPath(segment);
|
|
679
642
|
}
|
|
680
|
-
/** The filled band between two edges
|
|
681
|
-
*
|
|
682
|
-
* the reversed points rather than reused: a monotone cubic is not symmetric, and closing the shape
|
|
683
|
-
* along the forward path would bend the bottom of the band the wrong way.
|
|
643
|
+
/** The filled band between two edges. The lower edge is walked backwards, so its curve is rebuilt
|
|
644
|
+
* from the reversed points: a monotone cubic is not symmetric.
|
|
684
645
|
*
|
|
685
646
|
* @internal */
|
|
686
647
|
function bandPath(upper, lower, curve = 'linear') {
|
|
@@ -693,8 +654,8 @@ function bandPath(upper, lower, curve = 'linear') {
|
|
|
693
654
|
const back = linePath([...lower].reverse(), curve);
|
|
694
655
|
return `${linePath(upper, curve)} L ${back.slice('M '.length)} Z`;
|
|
695
656
|
}
|
|
696
|
-
/** The same run as `linePath`, closed down to the baseline. It takes the curve so a
|
|
697
|
-
*
|
|
657
|
+
/** The same run as `linePath`, closed down to the baseline. It takes the curve so a fill and its
|
|
658
|
+
* line share one edge.
|
|
698
659
|
*
|
|
699
660
|
* @internal */
|
|
700
661
|
function areaPath(segment, baselineY, curve = 'linear') {
|
|
@@ -712,8 +673,7 @@ function areaPath(segment, baselineY, curve = 'linear') {
|
|
|
712
673
|
const E10 = Math.sqrt(50);
|
|
713
674
|
const E5 = Math.sqrt(10);
|
|
714
675
|
const E2 = Math.sqrt(2);
|
|
715
|
-
/** d3's tick-increment rule
|
|
716
|
-
* no reader parses; this snaps to 1, 2, 5 or 10 times a power of ten. */
|
|
676
|
+
/** d3's tick-increment rule: snaps to 1, 2, 5 or 10 times a power of ten, not `span / count` steps like 482. */
|
|
717
677
|
function tickIncrement(span, targetCount) {
|
|
718
678
|
const step = span / Math.max(1, targetCount);
|
|
719
679
|
const power = Math.floor(Math.log10(step));
|
|
@@ -721,8 +681,7 @@ function tickIncrement(span, targetCount) {
|
|
|
721
681
|
const factor = error >= E10 ? 10 : error >= E5 ? 5 : error >= E2 ? 2 : 1;
|
|
722
682
|
return factor * Math.pow(10, power);
|
|
723
683
|
}
|
|
724
|
-
/** The floor of a domain that has to include zero: zero
|
|
725
|
-
* series, and the most negative reading otherwise.
|
|
684
|
+
/** The floor of a domain that has to include zero: zero for an all-positive series, else the most negative reading.
|
|
726
685
|
*
|
|
727
686
|
* @internal */
|
|
728
687
|
function domainMinOf(values) {
|
|
@@ -755,8 +714,7 @@ function niceDomain(domainMin, domainMax, targetCount) {
|
|
|
755
714
|
max: Math.ceil(domainMax / step) * step,
|
|
756
715
|
};
|
|
757
716
|
}
|
|
758
|
-
/** Distance between two ticks, which `formatTick` needs to pick a precision.
|
|
759
|
-
* degenerate series yields a single tick and therefore no step.
|
|
717
|
+
/** Distance between two ticks, which `formatTick` needs to pick a precision; a single tick has no step.
|
|
760
718
|
*
|
|
761
719
|
* @internal */
|
|
762
720
|
function tickStep(ticks) {
|
|
@@ -770,12 +728,11 @@ function linearScale(domainMin, domainMax, rangeSize) {
|
|
|
770
728
|
}
|
|
771
729
|
return (value) => ((value - domainMin) / span) * rangeSize;
|
|
772
730
|
}
|
|
773
|
-
/** Positions for marks that sit
|
|
774
|
-
*
|
|
775
|
-
* floating half a slot inside it. A single reading has no run to fill and takes the middle.
|
|
731
|
+
/** Positions for marks that sit at a category rather than inside it (a line's readings): first at
|
|
732
|
+
* the plot's start, last at its end, a single reading in the middle.
|
|
776
733
|
*
|
|
777
|
-
* `step` is the distance between neighbours
|
|
778
|
-
*
|
|
734
|
+
* `step` is the distance between neighbours; at the two ends that slot is half outside the plot and
|
|
735
|
+
* the caller clamps it.
|
|
779
736
|
*
|
|
780
737
|
* @internal */
|
|
781
738
|
function pointScale(count, rangeSize) {
|
|
@@ -797,8 +754,7 @@ function pointScale(count, rangeSize) {
|
|
|
797
754
|
step,
|
|
798
755
|
count: total,
|
|
799
756
|
position: (index) => Math.min(Math.max(index, 0), total - 1) * step,
|
|
800
|
-
// Nearest reading, not the slot the pointer is over:
|
|
801
|
-
// last slots are half-width, and rounding is what makes both of them reachable.
|
|
757
|
+
// Nearest reading, not the slot the pointer is over: the end slots are half-width.
|
|
802
758
|
indexAt: (offset) => {
|
|
803
759
|
if (!Number.isFinite(offset) || step === 0) {
|
|
804
760
|
return -1;
|
|
@@ -830,14 +786,11 @@ function bandScale(count, rangeSize, paddingRatio) {
|
|
|
830
786
|
};
|
|
831
787
|
}
|
|
832
788
|
const ROUND_STEP_FACTORS = [1, 2, 5, 10];
|
|
833
|
-
// A step divided out
|
|
834
|
-
//
|
|
835
|
-
// whole axis up a rung.
|
|
789
|
+
// A step divided out and multiplied back rarely lands on itself: a candidate equal to the minimum
|
|
790
|
+
// can compare smaller by one bit and push the axis up a rung.
|
|
836
791
|
const ROUND_STEP_TOLERANCE = 1 - 1e-12;
|
|
837
|
-
/** The smallest 1/2/5/10 x power-of-ten step
|
|
838
|
-
*
|
|
839
|
-
* axis drawn against the first's gridlines has to reach its data within the intervals
|
|
840
|
-
* the first already drew.
|
|
792
|
+
/** The smallest 1/2/5/10 x power-of-ten step not below `minimumStep`. `niceDomain` picks its own
|
|
793
|
+
* interval count, so it cannot answer this.
|
|
841
794
|
*
|
|
842
795
|
* @internal */
|
|
843
796
|
function roundStepAtLeast(minimumStep) {
|
|
@@ -854,12 +807,10 @@ function roundStepAtLeast(minimumStep) {
|
|
|
854
807
|
return 10 * base;
|
|
855
808
|
}
|
|
856
809
|
|
|
857
|
-
// The whole spread of a series' arrival
|
|
858
|
-
// starts reading as a queue.
|
|
810
|
+
// The whole spread of a series' arrival; past it the entrance reads as a queue, not one gesture.
|
|
859
811
|
const STAGGER_BUDGET_MS = 260;
|
|
860
812
|
/** Entrance delay for the mark at `index` of `count`, in milliseconds: `stepMs` apart, narrowed so
|
|
861
|
-
* the last mark starts within the budget.
|
|
862
|
-
* arrives in order instead of landing all at once past the cap. `stepMs` of `0` means no stagger.
|
|
813
|
+
* the last mark starts within the budget. `stepMs` of `0` means no stagger.
|
|
863
814
|
*
|
|
864
815
|
* @internal */
|
|
865
816
|
function staggerDelay(index, count, stepMs) {
|
|
@@ -868,19 +819,15 @@ function staggerDelay(index, count, stepMs) {
|
|
|
868
819
|
}
|
|
869
820
|
return index * Math.min(stepMs, STAGGER_BUDGET_MS / (count - 1));
|
|
870
821
|
}
|
|
871
|
-
/** Starts a mark's exit, bound as `(animate.leave)="leaveMark($event)"
|
|
872
|
-
*
|
|
873
|
-
* not `animate.leave="mark-leave"`: the class form calls `getAnimations()` once per leaving mark,
|
|
874
|
-
* and in Chrome that call costs more the more animations are running.
|
|
822
|
+
/** Starts a mark's exit, bound as `(animate.leave)="leaveMark($event)"`. The function form, not
|
|
823
|
+
* `animate.leave="mark-leave"`: the class form calls `getAnimations()` once per leaving mark.
|
|
875
824
|
*
|
|
876
825
|
* @internal */
|
|
877
826
|
function leaveMark(event) {
|
|
878
827
|
event.target.classList.add('mark-leave');
|
|
879
828
|
}
|
|
880
829
|
|
|
881
|
-
// A chart stays warm from its first answer until the pointer leaves it,
|
|
882
|
-
// the marks is answered at once rather than waiting at every mark. One set for the whole page:
|
|
883
|
-
// a legend and the plot beside it are one chart.
|
|
830
|
+
// A chart stays warm from its first answer until the pointer leaves it; one set for the page, as a legend and its plot are one chart.
|
|
884
831
|
const warmCharts = new WeakSet();
|
|
885
832
|
function chartOf(event) {
|
|
886
833
|
const node = event.currentTarget ?? event.target;
|
|
@@ -899,8 +846,7 @@ function warmUp(chart) {
|
|
|
899
846
|
};
|
|
900
847
|
document.addEventListener('pointerover', coolOnLeave, true);
|
|
901
848
|
}
|
|
902
|
-
/** Call from anywhere; the
|
|
903
|
-
* `schedule`, so a config that changes is picked up on the next rest.
|
|
849
|
+
/** Call from anywhere; the caller's own `leave` cancels the wait. `delayMs` is read at each `schedule`.
|
|
904
850
|
*
|
|
905
851
|
* @internal */
|
|
906
852
|
function chartDwell(delayMs) {
|
|
@@ -946,9 +892,7 @@ function chartDwell(delayMs) {
|
|
|
946
892
|
}
|
|
947
893
|
|
|
948
894
|
/** Where a roving tabindex lands after `key`, or `null` when the key does not traverse.
|
|
949
|
-
*
|
|
950
|
-
* The ends wrap, as they do in `ds-radio-group`: a chart's marks are a closed set, and Home and
|
|
951
|
-
* End are the direct way to either extreme.
|
|
895
|
+
* The ends wrap, as in `ds-radio-group`; Home and End jump to either extreme.
|
|
952
896
|
*
|
|
953
897
|
* @internal */
|
|
954
898
|
function nextRovingIndex(key, current, count) {
|
|
@@ -970,15 +914,13 @@ function nextRovingIndex(key, current, count) {
|
|
|
970
914
|
return null;
|
|
971
915
|
}
|
|
972
916
|
}
|
|
973
|
-
/** The mark `index` within `scope`. `within` narrows the search for a chart whose marks repeat
|
|
974
|
-
* same index once per series.
|
|
917
|
+
/** The mark `index` within `scope`. `within` narrows the search for a chart whose marks repeat an index per series.
|
|
975
918
|
*
|
|
976
919
|
* @internal */
|
|
977
920
|
function markAt(scope, index, within = '') {
|
|
978
921
|
return scope?.querySelector(`${within}[data-mark-index="${index}"]`) ?? null;
|
|
979
922
|
}
|
|
980
|
-
/** Moves DOM focus to the mark `index` within `scope
|
|
981
|
-
* traversal rather than a state change nobody can see.
|
|
923
|
+
/** Moves DOM focus to the mark `index` within `scope`.
|
|
982
924
|
*
|
|
983
925
|
* @internal */
|
|
984
926
|
function focusMark(scope, index, within = '') {
|
|
@@ -1004,9 +946,7 @@ function rovingMarks(count) {
|
|
|
1004
946
|
},
|
|
1005
947
|
};
|
|
1006
948
|
}
|
|
1007
|
-
/** The mark an event on the marks' parent came from
|
|
1008
|
-
* parent - for a chart that listens once per series rather than once per mark. `null` when the
|
|
1009
|
-
* event did not start on a mark.
|
|
949
|
+
/** The mark an event on the marks' parent came from (the nearest `[data-mark-index]`), or `null`.
|
|
1010
950
|
*
|
|
1011
951
|
* @internal */
|
|
1012
952
|
function markOf(event, scope = event.currentTarget) {
|
|
@@ -1020,10 +960,9 @@ function markOf(event, scope = event.currentTarget) {
|
|
|
1020
960
|
}
|
|
1021
961
|
return { element, index: Number(element.getAttribute('data-mark-index')) };
|
|
1022
962
|
}
|
|
1023
|
-
/** Focus arriving on and leaving a mark inside `scope`, heard from the document
|
|
1024
|
-
*
|
|
1025
|
-
*
|
|
1026
|
-
* ring every mark it holds. Call from an injection context.
|
|
963
|
+
/** Focus arriving on and leaving a mark inside `scope`, heard from the document, not the marks' group:
|
|
964
|
+
* Chromium makes an SVG element focusable once it has a focus listener, so a listening group would
|
|
965
|
+
* take focus on a click and ring every mark it holds. Call from an injection context.
|
|
1027
966
|
*
|
|
1028
967
|
* @internal */
|
|
1029
968
|
function listenForMarkFocus(scope, onFocus, onBlur) {
|
|
@@ -1040,8 +979,7 @@ function listenForMarkFocus(scope, onFocus, onBlur) {
|
|
|
1040
979
|
};
|
|
1041
980
|
const focusIn = forward(onFocus);
|
|
1042
981
|
const focusOut = forward(onBlur);
|
|
1043
|
-
// Outside the zone: every focus change
|
|
1044
|
-
// write signals, which schedule the render they need.
|
|
982
|
+
// Outside the zone: every focus change reaches every series.
|
|
1045
983
|
zone.runOutsideAngular(() => {
|
|
1046
984
|
document.addEventListener('focusin', focusIn);
|
|
1047
985
|
document.addEventListener('focusout', focusOut);
|
|
@@ -1072,9 +1010,7 @@ function trendOf(values, words) {
|
|
|
1072
1010
|
}
|
|
1073
1011
|
return words.trendFlat;
|
|
1074
1012
|
}
|
|
1075
|
-
/** Where the readings sit against each reference line, appended to the description.
|
|
1076
|
-
* reader cannot see is a line that does not exist for them, and its whole point is the
|
|
1077
|
-
* comparison, not its position. */
|
|
1013
|
+
/** Where the readings sit against each reference line, appended to the description. */
|
|
1078
1014
|
function describeThresholds(thresholds, points, format, words) {
|
|
1079
1015
|
const total = points.length;
|
|
1080
1016
|
return thresholds
|
|
@@ -1091,13 +1027,11 @@ function describeThresholds(thresholds, points, format, words) {
|
|
|
1091
1027
|
})
|
|
1092
1028
|
.join('');
|
|
1093
1029
|
}
|
|
1094
|
-
/** The sentence a screen reader gets as the chart's accessible name. Generated
|
|
1095
|
-
* required
|
|
1096
|
-
* lies.
|
|
1030
|
+
/** The sentence a screen reader gets as the chart's accessible name. Generated, not required: a
|
|
1031
|
+
* required one is left at the component's default and lies.
|
|
1097
1032
|
*
|
|
1098
|
-
* The
|
|
1099
|
-
*
|
|
1100
|
-
* levels of chart description, and the encoding is the one thing a screen-reader user cannot use.
|
|
1033
|
+
* The order is the contract: what the chart is and its scale, the trend, the extremes, then where
|
|
1034
|
+
* the numbers are.
|
|
1101
1035
|
*
|
|
1102
1036
|
* @internal */
|
|
1103
1037
|
function describeSeries(words, label, points, format = formatValue, tableFollows = true, thresholds = []) {
|
|
@@ -1117,29 +1051,22 @@ function describeSeries(words, label, points, format = formatValue, tableFollows
|
|
|
1117
1051
|
}
|
|
1118
1052
|
|
|
1119
1053
|
/**
|
|
1120
|
-
* @fileoverview How many chips fit one line of a trigger
|
|
1121
|
-
* guessed.
|
|
1054
|
+
* @fileoverview How many chips fit one line of a trigger.
|
|
1122
1055
|
*
|
|
1123
1056
|
* INVARIANT: nothing here may measure something the cut itself changes, or the
|
|
1124
|
-
* measurement feeds back into its own input and
|
|
1125
|
-
*
|
|
1126
|
-
*
|
|
1127
|
-
*
|
|
1128
|
-
*
|
|
1129
|
-
*
|
|
1130
|
-
* The caller owes two things: chips carry `data-chip`, and they sit in a row of
|
|
1131
|
-
* their own that is a direct child of the trigger. `enabled` gates the whole thing
|
|
1132
|
-
* because measuring forces layout.
|
|
1057
|
+
* measurement feeds back into its own input and never settles (a hung page).
|
|
1058
|
+
* The budget comes off the trigger's PARENT content box, and the "+N more"
|
|
1059
|
+
* marker gets a fixed reserve rather than a measurement.
|
|
1060
|
+
*
|
|
1061
|
+
* Chips carry `data-chip` and sit in a row that is a direct child of the trigger.
|
|
1133
1062
|
*/
|
|
1134
1063
|
/**
|
|
1135
1064
|
* Null when the host cannot supply a budget: a detached node, an inline one with no content box,
|
|
1136
|
-
* or one whose own width DEPENDS on the trigger
|
|
1137
|
-
* input.
|
|
1065
|
+
* or one whose own width DEPENDS on the trigger.
|
|
1138
1066
|
*
|
|
1139
|
-
*
|
|
1140
|
-
* pixel value
|
|
1141
|
-
*
|
|
1142
|
-
* one sized by its content collapses — at the cost of a second forced layout.
|
|
1067
|
+
* The dependency is tested by pinning the trigger to zero and re-reading the host, because
|
|
1068
|
+
* `getComputedStyle().width` is a used pixel value and the `fit-content` a consumer wrote is not
|
|
1069
|
+
* readable back. Costs a second forced layout.
|
|
1143
1070
|
*/
|
|
1144
1071
|
function hostContentWidth(host, trigger) {
|
|
1145
1072
|
if (!host || host.clientWidth === 0) {
|
|
@@ -1159,11 +1086,9 @@ function hostContentWidth(host, trigger) {
|
|
|
1159
1086
|
}
|
|
1160
1087
|
return (before - parseFloat(styles.paddingLeft) - parseFloat(styles.paddingRight));
|
|
1161
1088
|
}
|
|
1162
|
-
/** Room held for "+N more"
|
|
1163
|
-
* 4.5em wide with three digits; 5em keeps a chip from being dropped for a pixel. */
|
|
1089
|
+
/** Room held for "+N more" (4.5em with three digits, rounded up). */
|
|
1164
1090
|
const MARKER_RESERVE_EM = 5;
|
|
1165
|
-
/**
|
|
1166
|
-
* what it does not use, so only its floor is owed; anything else owes its box. */
|
|
1091
|
+
/** A sibling that can grow gives back what it does not use, so only its floor is owed. */
|
|
1167
1092
|
function reservedWidth(element) {
|
|
1168
1093
|
const styles = getComputedStyle(element);
|
|
1169
1094
|
return parseFloat(styles.flexGrow) > 0
|
|
@@ -1172,18 +1097,15 @@ function reservedWidth(element) {
|
|
|
1172
1097
|
}
|
|
1173
1098
|
/** @internal */
|
|
1174
1099
|
function chipFit(count, chipRow, enabled,
|
|
1175
|
-
/** The whole selection
|
|
1100
|
+
/** The whole selection; `count` may cap it. */
|
|
1176
1101
|
selectionSize = count) {
|
|
1177
1102
|
const available = signal(0, ...(ngDevMode ? [{ debugName: "available" }] : /* istanbul ignore next */ []));
|
|
1178
1103
|
const gap = signal(0, ...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
|
|
1179
1104
|
const markerReserve = signal(0, ...(ngDevMode ? [{ debugName: "markerReserve" }] : /* istanbul ignore next */ []));
|
|
1180
1105
|
/** Widths of ALL chips, from the last render that held all of them. */
|
|
1181
1106
|
const chipWidths = signal([], ...(ngDevMode ? [{ debugName: "chipWidths" }] : /* istanbul ignore next */ []));
|
|
1182
|
-
/** `count` at that render, so a stale cache is never trusted. */
|
|
1183
1107
|
const measuredFor = signal(-1, ...(ngDevMode ? [{ debugName: "measuredFor" }] : /* istanbul ignore next */ []));
|
|
1184
|
-
/**
|
|
1185
|
-
* Each forces layout: without this guard a single docs page load measured 214
|
|
1186
|
-
* times across seven pickers. */
|
|
1108
|
+
/** A repeat of the last geometry is skipped: each measure forces layout. */
|
|
1187
1109
|
let lastWidth = -1;
|
|
1188
1110
|
let lastCount = -1;
|
|
1189
1111
|
const measure = (row) => {
|
|
@@ -1191,14 +1113,8 @@ selectionSize = count) {
|
|
|
1191
1113
|
if (!trigger) {
|
|
1192
1114
|
return;
|
|
1193
1115
|
}
|
|
1194
|
-
// A trigger
|
|
1195
|
-
//
|
|
1196
|
-
// feeds the result back into its own input. The parent's content box is the
|
|
1197
|
-
// space actually available and does not move when the chips do; for a `fill`
|
|
1198
|
-
// trigger the two are the same number.
|
|
1199
|
-
//
|
|
1200
|
-
// The fallback is that same feedback loop, so it is a last resort, not a default: it runs
|
|
1201
|
-
// only when the host cannot answer at all.
|
|
1116
|
+
// A `fit-content` trigger is sized by the chips this cut removes; the parent's
|
|
1117
|
+
// content box is not. The trigger-width fallback is that feedback loop.
|
|
1202
1118
|
const host = trigger.parentElement;
|
|
1203
1119
|
const budget = hostContentWidth(host, trigger) ?? trigger.clientWidth;
|
|
1204
1120
|
const width = budget;
|
|
@@ -1257,24 +1173,21 @@ selectionSize = count) {
|
|
|
1257
1173
|
return total;
|
|
1258
1174
|
}
|
|
1259
1175
|
const widths = chipWidths();
|
|
1260
|
-
// Until
|
|
1261
|
-
// is what gets measured, and the row clips it until the cut lands.
|
|
1176
|
+
// Until widths for THIS selection are in, render all: that render is measured.
|
|
1262
1177
|
if (measuredFor() !== total || available() <= 0) {
|
|
1263
1178
|
return total;
|
|
1264
1179
|
}
|
|
1265
1180
|
let used = 0;
|
|
1266
1181
|
for (let index = 0; index < widths.length; index++) {
|
|
1267
1182
|
const next = used + widths[index] + (index > 0 ? gap() : 0);
|
|
1268
|
-
// The marker
|
|
1269
|
-
//
|
|
1270
|
-
// really is the end of the selection, not the end of a capped slice.
|
|
1183
|
+
// The marker needs room only if something is hidden; a capped slice's last
|
|
1184
|
+
// chip is not the end of the selection.
|
|
1271
1185
|
const isLast = index === widths.length - 1 && selectionSize() <= widths.length;
|
|
1272
1186
|
const budget = isLast
|
|
1273
1187
|
? available()
|
|
1274
1188
|
: available() - markerReserve() - gap();
|
|
1275
1189
|
if (next > budget) {
|
|
1276
|
-
//
|
|
1277
|
-
// bug upstream, and 0 would render a bare "+N" with nothing to anchor it.
|
|
1190
|
+
// At least one chip: 0 would render a bare "+N".
|
|
1278
1191
|
return Math.max(1, index);
|
|
1279
1192
|
}
|
|
1280
1193
|
used = next;
|
|
@@ -1285,11 +1198,8 @@ selectionSize = count) {
|
|
|
1285
1198
|
|
|
1286
1199
|
/**
|
|
1287
1200
|
* Fills a selected chip's content in the trigger of `ds-multi-select` and
|
|
1288
|
-
* `ds-autocomplete
|
|
1289
|
-
*
|
|
1290
|
-
*
|
|
1291
|
-
* The chip is still a `ds-tag` owned by the library: its close button, its
|
|
1292
|
-
* accessible remove label and the measured overflow cap are not projected.
|
|
1201
|
+
* `ds-autocomplete`. The chip stays a library-owned `ds-tag`: its close button,
|
|
1202
|
+
* remove label and overflow cap are not projected.
|
|
1293
1203
|
*/
|
|
1294
1204
|
class DsChipTemplateDirective {
|
|
1295
1205
|
template = inject(TemplateRef);
|
|
@@ -1305,19 +1215,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
1305
1215
|
}] });
|
|
1306
1216
|
|
|
1307
1217
|
/**
|
|
1308
|
-
*
|
|
1309
|
-
*
|
|
1310
|
-
* Fields declare the input as `boolean | null` with a `null` default so "not set"
|
|
1311
|
-
* stays distinguishable from an explicit `true` — a signal input cannot report
|
|
1312
|
-
* whether it was bound. Precedence: the component input, then
|
|
1313
|
-
* `DS_CONFIG.field.reserveMessage`, then `false`.
|
|
1218
|
+
* Resolves a field's `reserveMessage`: the input, then `DS_CONFIG.field.reserveMessage`, then
|
|
1219
|
+
* `false`. The input is `boolean | null` because a signal input cannot report whether it was bound.
|
|
1314
1220
|
*
|
|
1315
|
-
* `appWideDefaultApplies` is read lazily and drops the middle step for a control that
|
|
1316
|
-
*
|
|
1317
|
-
* field column, so an app-wide field setting must not give it an empty row.
|
|
1221
|
+
* `appWideDefaultApplies` is read lazily and drops the middle step for a control that is not a
|
|
1222
|
+
* form row (`ds-button`).
|
|
1318
1223
|
*
|
|
1319
|
-
* Call from a field initializer (an injection context)
|
|
1320
|
-
* `protected readonly reserve = resolveReserveMessage(this.reserveMessage);`
|
|
1224
|
+
* Call from a field initializer (an injection context).
|
|
1321
1225
|
*/
|
|
1322
1226
|
function resolveReserveMessage(reserveMessage, appWideDefaultApplies = () => true) {
|
|
1323
1227
|
const config = inject(DS_CONFIG);
|
|
@@ -1329,15 +1233,12 @@ function resolveReserveMessage(reserveMessage, appWideDefaultApplies = () => tru
|
|
|
1329
1233
|
|
|
1330
1234
|
const NO_ERRORS = [];
|
|
1331
1235
|
/**
|
|
1332
|
-
* The one reserved `DsFieldError.kind`. An error carrying it is advisory: it shows
|
|
1333
|
-
*
|
|
1334
|
-
* model can raise a non-blocking remark — Angular's own `AbstractControl` has no
|
|
1335
|
-
* channel for one, only `errors` and the validity derived from it.
|
|
1236
|
+
* The one reserved `DsFieldError.kind`. An error carrying it is advisory: it shows in the
|
|
1237
|
+
* warning state and does NOT make the control invalid.
|
|
1336
1238
|
*/
|
|
1337
1239
|
const DS_FIELD_WARNING_KIND = 'warning';
|
|
1338
1240
|
/**
|
|
1339
|
-
* `errors` input transform. Accepts a bare string
|
|
1340
|
-
* has the text can pass it directly), a single error, or the array signal forms
|
|
1241
|
+
* `errors` input transform. Accepts a bare string, a single error, or the array signal forms
|
|
1341
1242
|
* assigns.
|
|
1342
1243
|
*/
|
|
1343
1244
|
function normalizeFieldErrors(value) {
|
|
@@ -1356,30 +1257,23 @@ function trimmedText(value) {
|
|
|
1356
1257
|
const EMPTY_MESSAGE = { text: '', state: 'default' };
|
|
1357
1258
|
const NO_CONTROL = { errors: NO_ERRORS, touched: false };
|
|
1358
1259
|
/**
|
|
1359
|
-
*
|
|
1260
|
+
* Resolves the one message a field shows, from every source that can supply one.
|
|
1360
1261
|
*
|
|
1361
|
-
* Precedence, highest first
|
|
1362
|
-
* `warnText` → `helperText`) and Material's subscript follows, so only ONE line
|
|
1363
|
-
* ever shows and the field's height does not depend on how many sources are
|
|
1364
|
-
* populated:
|
|
1262
|
+
* Precedence, highest first:
|
|
1365
1263
|
*
|
|
1366
|
-
* 1. `error`
|
|
1367
|
-
* 2. `errors`
|
|
1264
|
+
* 1. `error` - an explicit string. Shown immediately: the consumer decided.
|
|
1265
|
+
* 2. `errors` - validation errors. Shown once the user has interacted, so a
|
|
1368
1266
|
* `required` error does not greet an untouched form.
|
|
1369
|
-
* 3. `warning`
|
|
1370
|
-
* 4. `errors` whose kind is `DS_FIELD_WARNING_KIND`
|
|
1371
|
-
* 5. `success`
|
|
1372
|
-
* 6. `hint`
|
|
1267
|
+
* 3. `warning` - advisory, not blocking.
|
|
1268
|
+
* 4. `errors` whose kind is `DS_FIELD_WARNING_KIND` - the same, raised by the form model.
|
|
1269
|
+
* 5. `success` - confirmation.
|
|
1270
|
+
* 6. `hint` - helper text.
|
|
1373
1271
|
*
|
|
1374
|
-
*
|
|
1375
|
-
*
|
|
1376
|
-
* template-driven forms expose the same through `NgControl`, read here. A given
|
|
1377
|
-
* field instance is driven by exactly one of them, so they cannot disagree.
|
|
1272
|
+
* Signal forms binds `errors` and `touched` by input name (`FormUiControl`); reactive and
|
|
1273
|
+
* template-driven forms expose the same through `NgControl`, read here.
|
|
1378
1274
|
*
|
|
1379
|
-
* Every rung carries its OWN text
|
|
1380
|
-
*
|
|
1381
|
-
* control and sets `aria-invalid` for when the message lives elsewhere — a
|
|
1382
|
-
* form-level error summary, or one message for a whole field group.
|
|
1275
|
+
* Every rung carries its OWN text; `hint` is never recoloured into another state. `invalid` has
|
|
1276
|
+
* no text: it paints the control and sets `aria-invalid`.
|
|
1383
1277
|
*
|
|
1384
1278
|
* Call from a field initializer (an injection context).
|
|
1385
1279
|
* @internal
|
|
@@ -1394,10 +1288,6 @@ function resolveFieldMessage(sources) {
|
|
|
1394
1288
|
const interacted = computed(() => (sources.touched?.() ?? false) ||
|
|
1395
1289
|
(sources.touchedSelf?.() ?? false) ||
|
|
1396
1290
|
controlState().touched, ...(ngDevMode ? [{ debugName: "interacted" }] : /* istanbul ignore next */ []));
|
|
1397
|
-
// Both form systems land here, so one reserved kind serves both: signal forms
|
|
1398
|
-
// assigns its own ValidationError[] (which already carries `kind`), and
|
|
1399
|
-
// fromValidationErrors turns a reactive validator's `{ warning: 'text' }` KEY
|
|
1400
|
-
// into the same kind.
|
|
1401
1291
|
const blocking = computed(() => errors().filter((error) => error.kind !== DS_FIELD_WARNING_KIND), ...(ngDevMode ? [{ debugName: "blocking" }] : /* istanbul ignore next */ []));
|
|
1402
1292
|
const advisory = computed(() => errors().filter((error) => error.kind === DS_FIELD_WARNING_KIND), ...(ngDevMode ? [{ debugName: "advisory" }] : /* istanbul ignore next */ []));
|
|
1403
1293
|
const errorText = computed(() => {
|
|
@@ -1414,18 +1304,14 @@ function resolveFieldMessage(sources) {
|
|
|
1414
1304
|
}
|
|
1415
1305
|
return textFor(current, config.field?.errorMessages);
|
|
1416
1306
|
}, ...(ngDevMode ? [{ debugName: "advisoryText" }] : /* istanbul ignore next */ []));
|
|
1417
|
-
// Advisory errors are deliberately absent: a warning
|
|
1418
|
-
//
|
|
1419
|
-
//
|
|
1420
|
-
// `aria-invalid` on a NATIVELY disabled input still reports invalid=true and the node is not
|
|
1421
|
-
// ignored, so disabling does not make the attribute inert — the reader still hears "invalid" on
|
|
1422
|
-
// a control they cannot act on.
|
|
1307
|
+
// Advisory errors are deliberately absent: a warning never sets aria-invalid.
|
|
1308
|
+
// Disabled wins: `aria-invalid` on a NATIVELY disabled input still reports invalid in
|
|
1309
|
+
// Chrome's accessibility tree.
|
|
1423
1310
|
const invalid = computed(() => !(sources.disabled?.() ?? false) &&
|
|
1424
1311
|
(sources.invalid() ||
|
|
1425
1312
|
sources.error().length > 0 ||
|
|
1426
1313
|
(blocking().length > 0 && interacted())), ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
1427
|
-
//
|
|
1428
|
-
// text — a new one declared without that transform breaks this quietly.
|
|
1314
|
+
// Relies on message inputs trimming via `trimmedText`; one declared without it breaks this quietly.
|
|
1429
1315
|
const message = computed(() => {
|
|
1430
1316
|
const explicit = sources.error();
|
|
1431
1317
|
if (explicit) {
|
|
@@ -1462,21 +1348,16 @@ function resolveFieldMessage(sources) {
|
|
|
1462
1348
|
return { message, invalid, controlState: paintedState };
|
|
1463
1349
|
}
|
|
1464
1350
|
/**
|
|
1465
|
-
*
|
|
1466
|
-
*
|
|
1467
|
-
*
|
|
1468
|
-
*
|
|
1469
|
-
*
|
|
1470
|
-
* `events` (not `statusChanges`) is the subscription, because touching a control
|
|
1471
|
-
* does NOT emit a status change — it emits `TouchedChangeEvent`, and touched is
|
|
1472
|
-
* half of the decision to show an error at all.
|
|
1351
|
+
* `NgControl` cannot be injected in the constructor (`NG_VALUE_ACCESSOR` points at the field
|
|
1352
|
+
* itself: a DI cycle), so it is resolved after first render.
|
|
1353
|
+
*
|
|
1354
|
+
* `events`, not `statusChanges`: touching a control emits `TouchedChangeEvent`, not a status change.
|
|
1473
1355
|
*/
|
|
1474
1356
|
function watchNgControl() {
|
|
1475
1357
|
const injector = inject(Injector);
|
|
1476
1358
|
const destroyRef = inject(DestroyRef);
|
|
1477
|
-
// Submitting a form does not reach the child control's own `events`
|
|
1478
|
-
//
|
|
1479
|
-
// directly, as Angular Material's ErrorStateMatcher does.
|
|
1359
|
+
// Submitting a form does not reach the child control's own `events` (it goes onto the
|
|
1360
|
+
// ROOT form's stream), so the parent is read directly.
|
|
1480
1361
|
const parentForm = inject(NgForm, { optional: true });
|
|
1481
1362
|
const parentFormGroup = inject(FormGroupDirective, { optional: true });
|
|
1482
1363
|
const state = signal(NO_CONTROL, ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
@@ -1490,10 +1371,8 @@ function watchNgControl() {
|
|
|
1490
1371
|
errors: fromValidationErrors(control.errors),
|
|
1491
1372
|
touched: control.touched || submitted(),
|
|
1492
1373
|
});
|
|
1493
|
-
// Signal forms bridges an NgControl whose `control` has no `events` stream
|
|
1494
|
-
//
|
|
1495
|
-
// path the component's own inputs carry errors and touched, and a snapshot that
|
|
1496
|
-
// froze at first render would keep serving a stale error after the field went valid.
|
|
1374
|
+
// Signal forms bridges an NgControl whose `control` has no `events` stream. Staying at
|
|
1375
|
+
// NO_CONTROL is deliberate: the component's own inputs carry errors and touched there.
|
|
1497
1376
|
if (typeof control.events?.pipe !== 'function') {
|
|
1498
1377
|
return;
|
|
1499
1378
|
}
|
|
@@ -1505,11 +1384,9 @@ function watchNgControl() {
|
|
|
1505
1384
|
return state;
|
|
1506
1385
|
}
|
|
1507
1386
|
/**
|
|
1508
|
-
*
|
|
1509
|
-
*
|
|
1510
|
-
*
|
|
1511
|
-
* objects with no message (`{ minlength: { requiredLength, actualLength } }`) —
|
|
1512
|
-
* those resolve through `DS_CONFIG.field.errorMessages` instead.
|
|
1387
|
+
* A message is picked up from `{ myError: 'text' }` and `{ myError: { message: 'text' } }`.
|
|
1388
|
+
* Angular's built-ins carry detail objects with no message (`{ minlength: { requiredLength } }`);
|
|
1389
|
+
* those resolve through `DS_CONFIG.field.errorMessages`.
|
|
1513
1390
|
*/
|
|
1514
1391
|
function fromValidationErrors(errors) {
|
|
1515
1392
|
if (!errors) {
|
|
@@ -1540,36 +1417,25 @@ function textFor(errors, messages) {
|
|
|
1540
1417
|
}
|
|
1541
1418
|
|
|
1542
1419
|
/**
|
|
1543
|
-
* The inputs of anything that renders a `ds-field-message` line
|
|
1544
|
-
*
|
|
1545
|
-
* `invalid` and `touched`, which describe a form control's validation state and
|
|
1546
|
-
* mean nothing on a button.
|
|
1547
|
-
*
|
|
1548
|
-
* `@Directive()` is required, not decoration: Angular refuses to compile a base
|
|
1549
|
-
* class that declares inputs without it.
|
|
1420
|
+
* The inputs of anything that renders a `ds-field-message` line. Split from `DsFieldBase` so
|
|
1421
|
+
* `ds-button` can take it without `errors`, `invalid` and `touched`.
|
|
1550
1422
|
* @internal
|
|
1551
1423
|
*/
|
|
1552
1424
|
class DsMessageBase {
|
|
1553
1425
|
/** Helper text shown below the control. */
|
|
1554
1426
|
hint = input('', { ...(ngDevMode ? { debugName: "hint" } : /* istanbul ignore next */ {}), transform: trimmedText });
|
|
1555
|
-
/** Error text. Shown immediately
|
|
1556
|
-
* decided this is in error. Takes precedence over `errors`. */
|
|
1427
|
+
/** Error text. Shown immediately; takes precedence over `errors`. */
|
|
1557
1428
|
error = input('', { ...(ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {}), transform: trimmedText });
|
|
1558
1429
|
/** Advisory text, shown when there is no error. */
|
|
1559
1430
|
warning = input('', { ...(ngDevMode ? { debugName: "warning" } : /* istanbul ignore next */ {}), transform: trimmedText });
|
|
1560
|
-
/** Reserve the message-row height even when empty, so
|
|
1561
|
-
*
|
|
1562
|
-
* to is the subclass's call, in `reserveMessageResolved`: a field takes
|
|
1563
|
-
* `DS_CONFIG.field.reserveMessage`, a button does not. */
|
|
1431
|
+
/** Reserve the message-row height even when empty, so a hint/error does not shift the layout.
|
|
1432
|
+
* Unset falls back to `DS_CONFIG.field.reserveMessage` for a field, not for a button. */
|
|
1564
1433
|
reserveMessage = input(null, { ...(ngDevMode ? { debugName: "reserveMessage" } : /* istanbul ignore next */ {}), transform: (value) => (value == null ? null : booleanAttribute(value)) });
|
|
1565
1434
|
/** Glyph on the message line, overriding what the state resolves to. Unset
|
|
1566
1435
|
* follows `DS_CONFIG.field.stateIcons`; `false` removes the glyph here alone. */
|
|
1567
1436
|
messageIcon = input(null, ...(ngDevMode ? [{ debugName: "messageIcon" }] : /* istanbul ignore next */ []));
|
|
1568
1437
|
/** Whether an unset `reserveMessage` falls back to `DS_CONFIG.field.reserveMessage`.
|
|
1569
|
-
*
|
|
1570
|
-
* turns it off, because a button is not in that column and an app-wide field
|
|
1571
|
-
* setting would otherwise give every button an empty message row. Read lazily, so
|
|
1572
|
-
* a subclass initializer running after this one still decides it. */
|
|
1438
|
+
* Read lazily, so a subclass initializer running later still decides it. */
|
|
1573
1439
|
reserveFollowsFieldDefault = true;
|
|
1574
1440
|
reserveMessageResolved = resolveReserveMessage(this.reserveMessage, () => this.reserveFollowsFieldDefault);
|
|
1575
1441
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DsMessageBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -1580,29 +1446,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
1580
1446
|
}], propDecorators: { hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], warning: [{ type: i0.Input, args: [{ isSignal: true, alias: "warning", required: false }] }], reserveMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "reserveMessage", required: false }] }], messageIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "messageIcon", required: false }] }] } });
|
|
1581
1447
|
|
|
1582
1448
|
/**
|
|
1583
|
-
* The inputs every DS form field has, declared once.
|
|
1584
|
-
*
|
|
1585
|
-
* Only the UNIVERSAL ones belong here. `success`, `label`, `required` and
|
|
1586
|
-
* `optional` stay on the components: they exist on some fields and not others, so
|
|
1587
|
-
* lifting them would hand a checkbox a `success` or a slider a `label` it never
|
|
1588
|
-
* had — a silent public-API addition.
|
|
1589
|
-
*
|
|
1590
|
-
* The message half lives one level up in `DsMessageBase`, which anything with a
|
|
1591
|
-
* message line can take. What stays here is the validation state a form control
|
|
1592
|
-
* has and a plain control does not.
|
|
1449
|
+
* The inputs every DS form field has, declared once. Only UNIVERSAL inputs belong
|
|
1450
|
+
* here: lifting `success` or `label` would add them to controls that never had them.
|
|
1593
1451
|
* @internal
|
|
1594
1452
|
*/
|
|
1595
1453
|
class DsFieldBase extends DsMessageBase {
|
|
1596
|
-
/** Validation errors, shown once the user has interacted. Bound
|
|
1597
|
-
*
|
|
1598
|
-
* `NgControl` and need nothing here. Accepts a string, one error, or an array. */
|
|
1454
|
+
/** Validation errors, shown once the user has interacted. Bound by signal forms;
|
|
1455
|
+
* reactive and template-driven forms are read through `NgControl`. */
|
|
1599
1456
|
errors = input([], { ...(ngDevMode ? { debugName: "errors" } : /* istanbul ignore next */ {}), transform: normalizeFieldErrors });
|
|
1600
|
-
/** Paints the error state and sets `aria-invalid
|
|
1601
|
-
* — for when the text lives elsewhere, such as a form-level error summary or
|
|
1602
|
-
* one message covering a whole field group. Use `error` to show text. */
|
|
1457
|
+
/** Paints the error state and sets `aria-invalid` WITHOUT a message; use `error` to show text. */
|
|
1603
1458
|
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1604
|
-
/** Whether the user has interacted with the field. Bound by signal forms; gates
|
|
1605
|
-
* `errors`, so a `required` error does not greet an untouched form. */
|
|
1459
|
+
/** Whether the user has interacted with the field. Bound by signal forms; gates `errors`. */
|
|
1606
1460
|
touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1607
1461
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DsFieldBase, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1608
1462
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.22", type: DsFieldBase, isStandalone: true, inputs: { errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
|
|
@@ -1612,25 +1466,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
1612
1466
|
}], propDecorators: { errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }] } });
|
|
1613
1467
|
|
|
1614
1468
|
/**
|
|
1615
|
-
* Value
|
|
1616
|
-
*
|
|
1617
|
-
* focusable descendant" would land on minus. `tabindex="-1"` is excluded from
|
|
1618
|
-
* both passes so a roving-tabindex group (ds-radio-group) yields the radio that
|
|
1619
|
-
* is actually tabbable rather than the first one in the DOM. Portaled panels are
|
|
1620
|
-
* outside the host, so a closed picker cannot be focused by accident.
|
|
1469
|
+
* Value elements are searched FIRST: the number stepper renders its decrement button before its
|
|
1470
|
+
* input. `tabindex="-1"` is excluded so a roving-tabindex group yields the tabbable radio.
|
|
1621
1471
|
*/
|
|
1622
1472
|
const NOT_ROVED = ':not([tabindex="-1"]):not([disabled])';
|
|
1623
1473
|
const VALUE_ELEMENTS = `input:not([type="hidden"])${NOT_ROVED}, textarea${NOT_ROVED}`;
|
|
1624
1474
|
const TRIGGER_ELEMENTS = `button${NOT_ROVED}, [tabindex="0"]${NOT_ROVED}`;
|
|
1625
1475
|
/**
|
|
1626
|
-
* The `ControlValueAccessor` half of a DS value control, with no message API
|
|
1627
|
-
* attached. `DsControlValueAccessor` is this plus `DsFieldBase`; a control that
|
|
1628
|
-
* holds a value and renders no message row — `ds-search`, a toolbar filter rather
|
|
1629
|
-
* than a validated field — takes this directly and gets no message inputs with it.
|
|
1476
|
+
* The `ControlValueAccessor` half of a DS value control, with no message API (`ds-search`).
|
|
1630
1477
|
*
|
|
1631
|
-
* The model arrives as a THUNK
|
|
1632
|
-
*
|
|
1633
|
-
* runs. Every read defers to call time, which is also when the effect first runs.
|
|
1478
|
+
* The model arrives as a THUNK: `value` is abstract on a base class and a field initialiser on
|
|
1479
|
+
* a component, so it does not exist yet when this runs.
|
|
1634
1480
|
*
|
|
1635
1481
|
* Must be called from an injection context (it owns an `effect`).
|
|
1636
1482
|
* @internal
|
|
@@ -1640,15 +1486,12 @@ function valueControlBridge(model) {
|
|
|
1640
1486
|
const touchedSelf = signal(false, ...(ngDevMode ? [{ debugName: "touchedSelf" }] : /* istanbul ignore next */ []));
|
|
1641
1487
|
let onChange = () => { };
|
|
1642
1488
|
let onTouched = () => { };
|
|
1643
|
-
//
|
|
1644
|
-
// a form-driven write back as a user change (which would dirty the control or
|
|
1645
|
-
// loop), while still emitting every genuine model change.
|
|
1489
|
+
// Stops the effect echoing a form-driven write back as a user change.
|
|
1646
1490
|
let synced;
|
|
1647
1491
|
let hasSynced = false;
|
|
1648
1492
|
effect(() => {
|
|
1649
1493
|
const next = model()();
|
|
1650
1494
|
if (!hasSynced) {
|
|
1651
|
-
// Adopt the initial value once, silently — never emit on init.
|
|
1652
1495
|
hasSynced = true;
|
|
1653
1496
|
synced = next;
|
|
1654
1497
|
return;
|
|
@@ -1694,49 +1537,28 @@ function blurOwnControl(host) {
|
|
|
1694
1537
|
}
|
|
1695
1538
|
}
|
|
1696
1539
|
/**
|
|
1697
|
-
* Shared `ControlValueAccessor` for DS form controls whose value is a signal
|
|
1698
|
-
* `
|
|
1699
|
-
* `
|
|
1700
|
-
* touching the existing `[(value)]` signal API — both keep working.
|
|
1701
|
-
*
|
|
1702
|
-
* A subclass must expose the `value` model and OR `formDisabled()` into its
|
|
1703
|
-
* effective disabled state so `FormControl.disable()` actually reaches the
|
|
1704
|
-
* control; it should also call `markTouched()` from a blur handler.
|
|
1540
|
+
* Shared `ControlValueAccessor` for DS form controls whose value is a signal `model()`.
|
|
1541
|
+
* A subclass must OR `formDisabled()` into its effective disabled state so
|
|
1542
|
+
* `FormControl.disable()` reaches the control, and call `markTouched()` from a blur handler.
|
|
1705
1543
|
* @internal
|
|
1706
1544
|
*/
|
|
1707
1545
|
class DsControlValueAccessor extends DsFieldBase {
|
|
1708
|
-
/**
|
|
1709
|
-
* Hides the control. On the base so signal forms reaches every control at once.
|
|
1710
|
-
* Inline `display`, not the `hidden` attribute — each control sets its own
|
|
1711
|
-
* `:host` display, which the attribute's weaker UA rule would lose to.
|
|
1712
|
-
*/
|
|
1546
|
+
/** Hides the control. Inline `display`: the `hidden` attribute loses to each control's `:host` display. */
|
|
1713
1547
|
hidden = input(false, { ...(ngDevMode ? { debugName: "hidden" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1714
1548
|
hostElement = inject(ElementRef);
|
|
1715
|
-
/**
|
|
1716
|
-
* Signal forms calls this through `focusBoundControl()` — typically to reach
|
|
1717
|
-
* the first invalid field after a failed submit. Without it the default is to
|
|
1718
|
-
* focus the HOST, and a `<ds-*>` element is not focusable, so focus went
|
|
1719
|
-
* nowhere. A control with a more precise target overrides this.
|
|
1720
|
-
*/
|
|
1549
|
+
/** Signal forms calls this via `focusBoundControl()`; the default would focus the unfocusable HOST. */
|
|
1721
1550
|
focus(options) {
|
|
1722
1551
|
focusOwnControl(this.hostElement.nativeElement, options);
|
|
1723
1552
|
}
|
|
1724
|
-
/**
|
|
1725
|
-
* The counterpart of `focus()`: drops focus if it sits anywhere inside this
|
|
1726
|
-
* control - the input, a picker trigger, the OTP cell that has it - so no
|
|
1727
|
-
* subclass overrides it. A portaled panel is outside the host and is left alone.
|
|
1728
|
-
* For a host that navigates away after `clear()`, which keeps focus on purpose.
|
|
1729
|
-
*/
|
|
1553
|
+
/** Drops focus from anywhere inside this control; a portaled panel is left alone. */
|
|
1730
1554
|
blur() {
|
|
1731
1555
|
blurOwnControl(this.hostElement.nativeElement);
|
|
1732
1556
|
}
|
|
1733
1557
|
bridge = valueControlBridge(() => this.value);
|
|
1734
|
-
/** Driven by the forms API via `setDisabledState`. */
|
|
1735
1558
|
formDisabled = this.bridge.formDisabled;
|
|
1736
1559
|
// Separate from the control's `touched`, which only exists once `NgControl`
|
|
1737
|
-
// resolves
|
|
1560
|
+
// resolves: too late to gate the first blur.
|
|
1738
1561
|
touchedSelf = this.bridge.touchedSelf;
|
|
1739
|
-
/** Call from a blur handler so the control reports `ng-touched`. */
|
|
1740
1562
|
markTouched() {
|
|
1741
1563
|
this.bridge.markTouched();
|
|
1742
1564
|
}
|
|
@@ -1762,34 +1584,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
1762
1584
|
}]
|
|
1763
1585
|
}], propDecorators: { hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }] } });
|
|
1764
1586
|
/**
|
|
1765
|
-
* Shared `ControlValueAccessor` for DS boolean controls (checkbox, switch)
|
|
1766
|
-
*
|
|
1767
|
-
* with Angular forms in both directions without affecting the `[(checked)]`
|
|
1768
|
-
* signal API. Subclasses must OR `formDisabled()` into their effective disabled
|
|
1587
|
+
* Shared `ControlValueAccessor` for DS boolean controls (checkbox, switch) whose state lives
|
|
1588
|
+
* in a `checked` model. Subclasses must OR `formDisabled()` into their effective disabled
|
|
1769
1589
|
* state and call `markTouched()` from a blur handler.
|
|
1770
1590
|
* @internal
|
|
1771
1591
|
*/
|
|
1772
1592
|
class DsBooleanControlValueAccessor extends DsFieldBase {
|
|
1773
|
-
/** Hides the control
|
|
1593
|
+
/** Hides the control; see `DsControlValueAccessor.hidden`. */
|
|
1774
1594
|
hidden = input(false, { ...(ngDevMode ? { debugName: "hidden" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1775
1595
|
hostElement = inject(ElementRef);
|
|
1776
|
-
/**
|
|
1777
|
-
* Signal forms calls this through `focusBoundControl()` — typically to reach
|
|
1778
|
-
* the first invalid field after a failed submit. Without it the default is to
|
|
1779
|
-
* focus the HOST, and a `<ds-*>` element is not focusable, so focus went
|
|
1780
|
-
* nowhere. A control with a more precise target overrides this.
|
|
1781
|
-
*/
|
|
1596
|
+
/** See `DsControlValueAccessor.focus`. */
|
|
1782
1597
|
focus(options) {
|
|
1783
1598
|
focusOwnControl(this.hostElement.nativeElement, options);
|
|
1784
1599
|
}
|
|
1785
|
-
/**
|
|
1600
|
+
/** See `DsControlValueAccessor.blur`. */
|
|
1786
1601
|
blur() {
|
|
1787
1602
|
blurOwnControl(this.hostElement.nativeElement);
|
|
1788
1603
|
}
|
|
1789
|
-
/** Driven by the forms API via `setDisabledState`. */
|
|
1790
1604
|
formDisabled = signal(false, ...(ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []));
|
|
1791
|
-
// Separate from the control's `touched`, which only exists once `NgControl`
|
|
1792
|
-
// resolves — too late to gate the first blur.
|
|
1793
1605
|
touchedSelf = signal(false, ...(ngDevMode ? [{ debugName: "touchedSelf" }] : /* istanbul ignore next */ []));
|
|
1794
1606
|
onChange = () => { };
|
|
1795
1607
|
onTouched = () => { };
|
|
@@ -1811,7 +1623,6 @@ class DsBooleanControlValueAccessor extends DsFieldBase {
|
|
|
1811
1623
|
this.onChange(next);
|
|
1812
1624
|
});
|
|
1813
1625
|
}
|
|
1814
|
-
/** Call from a blur handler so the control reports `ng-touched`. */
|
|
1815
1626
|
markTouched() {
|
|
1816
1627
|
this.touchedSelf.set(true);
|
|
1817
1628
|
this.onTouched();
|
|
@@ -1846,7 +1657,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
1846
1657
|
* Context: `query` is the typed text the row would create.
|
|
1847
1658
|
*
|
|
1848
1659
|
* The row stays a `role="option"` the keyboard can reach, and picking it still
|
|
1849
|
-
* emits `create`
|
|
1660
|
+
* emits `create` - the template fills the row, it does not become the action.
|
|
1850
1661
|
*/
|
|
1851
1662
|
class DsCreateTemplateDirective {
|
|
1852
1663
|
template = inject(TemplateRef);
|
|
@@ -1861,8 +1672,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
1861
1672
|
}]
|
|
1862
1673
|
}] });
|
|
1863
1674
|
|
|
1864
|
-
//
|
|
1865
|
-
// number or an open accordion does not make it a different page.
|
|
1675
|
+
// Query is a subset match and fragment is ignored: sort order or page number is not another page.
|
|
1866
1676
|
const EXACT_PATH = {
|
|
1867
1677
|
paths: 'exact',
|
|
1868
1678
|
queryParams: 'subset',
|
|
@@ -1874,9 +1684,8 @@ const PREFIX_PATH = {
|
|
|
1874
1684
|
paths: 'subset',
|
|
1875
1685
|
};
|
|
1876
1686
|
/**
|
|
1877
|
-
* No destination is a `<button>`, never an `<a href="#">`: a `#` href
|
|
1878
|
-
*
|
|
1879
|
-
* template branches, because a shared one would need a wrapper that changes the control's box.
|
|
1687
|
+
* No destination is a `<button>`, never an `<a href="#">`: a `#` href rewrites the URL and
|
|
1688
|
+
* discards the scroll position.
|
|
1880
1689
|
*
|
|
1881
1690
|
* @internal
|
|
1882
1691
|
*/
|
|
@@ -1889,36 +1698,25 @@ function dsDestination(routerLink, href) {
|
|
|
1889
1698
|
});
|
|
1890
1699
|
}
|
|
1891
1700
|
/**
|
|
1892
|
-
* What a navigating control
|
|
1893
|
-
*
|
|
1894
|
-
*
|
|
1895
|
-
* `routerLinkActive` matches by PREFIX, so deriving `aria-current="page"` from it makes a
|
|
1896
|
-
* "back to the section" link claim to be the page the reader is already on. ARIA separates the
|
|
1897
|
-
* two: `page` is the page you are on, `true` is the current section or an ancestor of it. So an
|
|
1898
|
-
* exact match announces `page`, a prefix match announces `true`, and anything else stays silent —
|
|
1899
|
-
* which is correct for a button and for a sidenav item without a branch between them.
|
|
1701
|
+
* What a navigating control announces: an exact match is `page`, a prefix match is `true` (the
|
|
1702
|
+
* current section or an ancestor), anything else stays silent. `routerLinkActive` matches by
|
|
1703
|
+
* PREFIX, so deriving `page` from it makes a "back to the section" link claim to be the current page.
|
|
1900
1704
|
*
|
|
1901
1705
|
* Feed the result to `RouterLinkActive.ariaCurrentWhenActive`, never to `[attr.aria-current]`: the
|
|
1902
|
-
* directive removes that attribute
|
|
1903
|
-
*
|
|
1904
|
-
* `routerLinkActiveOptions` narrows the announcement with it, because the directive writes nothing
|
|
1905
|
-
* while it considers the link inactive.
|
|
1706
|
+
* directive removes that attribute in a microtask whenever its own input is unset, wiping a
|
|
1707
|
+
* template binding. A narrowed `routerLinkActiveOptions` therefore narrows the announcement too.
|
|
1906
1708
|
*
|
|
1907
|
-
* Must be called from an injection context. Outside a router it returns the override or
|
|
1908
|
-
*
|
|
1709
|
+
* Must be called from an injection context. Outside a router it returns the override or
|
|
1710
|
+
* `undefined`.
|
|
1909
1711
|
*
|
|
1910
1712
|
* @internal
|
|
1911
1713
|
*/
|
|
1912
1714
|
function dsAriaCurrent(routerLink, modifiers, override) {
|
|
1913
1715
|
const router = inject(Router, { optional: true });
|
|
1914
|
-
//
|
|
1915
|
-
// (`routerLink="."`, `['..', 'sibling']`) means something different from the root. Resolving it
|
|
1916
|
-
// here without the same base would make `.` land on `/` — a prefix of every page, so the item
|
|
1917
|
-
// that IS the current page would announce `true` instead of `page`.
|
|
1716
|
+
// Same base as `RouterLink`: otherwise `.` lands on `/`, a prefix of every page.
|
|
1918
1717
|
const route = inject(ActivatedRoute, { optional: true });
|
|
1919
1718
|
return computed(() => {
|
|
1920
|
-
// `null`
|
|
1921
|
-
// `undefined`, so the two meet here rather than at every call site.
|
|
1719
|
+
// `null` means "announce nothing"; the directive spells that `undefined`.
|
|
1922
1720
|
const explicit = override();
|
|
1923
1721
|
if (explicit !== undefined) {
|
|
1924
1722
|
return explicit ?? undefined;
|
|
@@ -1933,12 +1731,9 @@ function dsAriaCurrent(routerLink, modifiers, override) {
|
|
|
1933
1731
|
relativeTo: route ?? undefined,
|
|
1934
1732
|
...modifiers(),
|
|
1935
1733
|
});
|
|
1936
|
-
// `lastSuccessfulNavigation` is only the reactive trigger.
|
|
1937
|
-
//
|
|
1938
|
-
//
|
|
1939
|
-
// navigating — a docs page tracking the section under the reader, a wizard naming its step —
|
|
1940
|
-
// then keeps announcing the page it landed on. Deprecated in 21.1, and nothing public replaces
|
|
1941
|
-
// the live-url comparison.
|
|
1734
|
+
// `lastSuccessfulNavigation` is only the reactive trigger. `Router.isActive` (deprecated in
|
|
1735
|
+
// 21.1, no replacement) reads the LIVE url; the standalone `isActive()` uses the navigation's
|
|
1736
|
+
// `finalUrl` and goes stale when the path is rewritten without navigating.
|
|
1942
1737
|
router.lastSuccessfulNavigation();
|
|
1943
1738
|
return router.isActive(tree, EXACT_PATH)
|
|
1944
1739
|
? 'page'
|
|
@@ -1949,8 +1744,7 @@ function dsAriaCurrent(routerLink, modifiers, override) {
|
|
|
1949
1744
|
}
|
|
1950
1745
|
|
|
1951
1746
|
/**
|
|
1952
|
-
* Replaces a picker panel's "no matches" row
|
|
1953
|
-
* own language, a "clear the filter" button.
|
|
1747
|
+
* Replaces a picker panel's "no matches" row.
|
|
1954
1748
|
*
|
|
1955
1749
|
* Context: `query` is the text that matched nothing.
|
|
1956
1750
|
*
|
|
@@ -1970,15 +1764,85 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
1970
1764
|
}]
|
|
1971
1765
|
}] });
|
|
1972
1766
|
|
|
1767
|
+
const NO_HOVER_DELAY_INPUT = signal(null, ...(ngDevMode ? [{ debugName: "NO_HOVER_DELAY_INPUT" }] : /* istanbul ignore next */ []));
|
|
1768
|
+
// Lazy: a chart's own optional inputs are declared after the base that calls this, so they do not exist yet.
|
|
1769
|
+
function optional(input) {
|
|
1770
|
+
return computed(() => input()?.() ?? null);
|
|
1771
|
+
}
|
|
1772
|
+
/** Default hover delay, in milliseconds. @internal */
|
|
1773
|
+
const CHART_HOVER_DELAY_MS = 0;
|
|
1774
|
+
/** Default tooltip linger, in milliseconds; long enough to cross to the next mark. @internal */
|
|
1775
|
+
const CHART_TOOLTIP_LINGER_MS = 500;
|
|
1776
|
+
/** Resolves each input, then `DS_CONFIG.chart`, then the built-in; copy resolves input, then `DS_INTL.chart`.
|
|
1777
|
+
* Call from an injection context. @internal */
|
|
1778
|
+
function resolveChartDefaults(inputs) {
|
|
1779
|
+
const locale = injectDsLocale();
|
|
1780
|
+
const intl = inject(DS_INTL);
|
|
1781
|
+
return {
|
|
1782
|
+
locale,
|
|
1783
|
+
frame: resolveWithConfig(inputs.frame, (config) => config.chart?.frame, 'auto'),
|
|
1784
|
+
dataTable: resolveWithConfig(optional(() => inputs.dataTable), (config) => config.chart?.dataTable, 'none'),
|
|
1785
|
+
emptyText: computed(() => inputs.emptyText() ?? intl().chart.empty),
|
|
1786
|
+
errorText: computed(() => inputs.errorText() ?? intl().chart.error),
|
|
1787
|
+
valueFormat: resolveWithConfig(inputs.valueFormat, (config) => config.chart?.valueFormat, chartValueFormat(locale)),
|
|
1788
|
+
tooltipLingerMs: resolveWithConfig(optional(() => inputs.tooltipLingerMs), (config) => config.chart?.tooltipLingerMs, CHART_TOOLTIP_LINGER_MS),
|
|
1789
|
+
pinOnClick: resolveWithConfig(optional(() => inputs.pinOnClick), (config) => config.chart?.pinOnClick, true),
|
|
1790
|
+
hoverDelayMs: resolveWithConfig(NO_HOVER_DELAY_INPUT, (config) => config.chart?.hoverDelayMs, CHART_HOVER_DELAY_MS),
|
|
1791
|
+
tooltipSwatches: resolveWithConfig(optional(() => inputs.tooltipSwatches), (config) => config.chart?.tooltipSwatches, 'auto'),
|
|
1792
|
+
};
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
/** The inputs every chart has, declared once. Inputs only some charts have stay on those charts. @internal */
|
|
1796
|
+
class DsChartBase {
|
|
1797
|
+
/** `'auto'` draws the chart's own bordered, padded box; `'none'` leaves it bare, for a chart
|
|
1798
|
+
* inside a card. Unset falls back to `DS_CONFIG.chart.frame`, then `'auto'`. */
|
|
1799
|
+
frame = input(null, ...(ngDevMode ? [{ debugName: "frame" }] : /* istanbul ignore next */ []));
|
|
1800
|
+
/** Visible title above the plot, reused as the annex table's caption. */
|
|
1801
|
+
caption = input(null, ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
1802
|
+
/** Accessible name. Generated from the data when omitted. */
|
|
1803
|
+
summary = input(null, ...(ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []));
|
|
1804
|
+
/** Draws skeleton marks in place of the data, at the same count, so the chart does not resize. */
|
|
1805
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1806
|
+
/** Shows `errorText` in place of the plot. Separate from `loading` and from empty data. */
|
|
1807
|
+
error = input(false, { ...(ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1808
|
+
/** Shown when there is no data. Unset falls back to `DS_INTL.chart.empty`. */
|
|
1809
|
+
emptyText = input(null, ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
1810
|
+
/** The message the error state prints. Unset falls back to `DS_INTL.chart.error`. */
|
|
1811
|
+
errorText = input(null, ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
1812
|
+
/** Formats every printed value, including the annex table and generated description. Unset
|
|
1813
|
+
* falls back to `DS_CONFIG.chart.valueFormat`, then `DS_CONFIG.locale` / `LOCALE_ID`. */
|
|
1814
|
+
valueFormat = input(null, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
|
|
1815
|
+
/** Turns on the click affordance: pointer cursor and hover tint. The click output fires
|
|
1816
|
+
* whether or not this is set. */
|
|
1817
|
+
interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1818
|
+
/** Whether the tooltip draws a colour dot beside each reading. Unset falls back to
|
|
1819
|
+
* `DS_CONFIG.chart.tooltipSwatches`, then shows them for two to four readings. */
|
|
1820
|
+
tooltipSwatches = input(null, { ...(ngDevMode ? { debugName: "tooltipSwatches" } : /* istanbul ignore next */ {}), transform: (value) => value == null ? null : booleanAttribute(value) });
|
|
1821
|
+
/** How long the tooltip stays after the pointer leaves the mark, in milliseconds; zero closes
|
|
1822
|
+
* it at once. Unset falls back to `DS_CONFIG.chart.tooltipLingerMs`, then 500. */
|
|
1823
|
+
tooltipLingerMs = input(null, { ...(ngDevMode ? { debugName: "tooltipLingerMs" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
|
|
1824
|
+
/** Holds the clicked mark and its tooltip until a second click, Escape or a press outside.
|
|
1825
|
+
* Unset falls back to `DS_CONFIG.chart.pinOnClick`, then `true`. The click output fires either way. */
|
|
1826
|
+
pinOnClick = input(null, { ...(ngDevMode ? { debugName: "pinOnClick" } : /* istanbul ignore next */ {}), transform: (value) => (value == null ? null : booleanAttribute(value)) });
|
|
1827
|
+
defaults = resolveChartDefaults(this);
|
|
1828
|
+
intl = inject(DS_INTL);
|
|
1829
|
+
frameResolved = this.defaults.frame;
|
|
1830
|
+
emptyTextResolved = this.defaults.emptyText;
|
|
1831
|
+
errorTextResolved = this.defaults.errorText;
|
|
1832
|
+
valueFormatResolved = this.defaults.valueFormat;
|
|
1833
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DsChartBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1834
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.22", type: DsChartBase, isStandalone: true, inputs: { frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, tooltipSwatches: { classPropertyName: "tooltipSwatches", publicName: "tooltipSwatches", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
1835
|
+
}
|
|
1836
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: DsChartBase, decorators: [{
|
|
1837
|
+
type: Directive
|
|
1838
|
+
}], propDecorators: { frame: [{ type: i0.Input, args: [{ isSignal: true, alias: "frame", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], tooltipSwatches: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipSwatches", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }] } });
|
|
1839
|
+
|
|
1973
1840
|
/**
|
|
1974
|
-
* Focuses the field's inner `input`/`textarea` when the click lands on the
|
|
1975
|
-
*
|
|
1976
|
-
*
|
|
1977
|
-
*
|
|
1978
|
-
*
|
|
1979
|
-
* non-focusable chrome; clicks that land on the control, or on a nested
|
|
1980
|
-
* button/link/other input, are left untouched so caret placement, toggles and
|
|
1981
|
-
* projected controls keep working.
|
|
1841
|
+
* Focuses the field's inner `input`/`textarea` when the click lands on the frame chrome
|
|
1842
|
+
* (padding, an icon, an addon slot). Applied to a field's wrapper element.
|
|
1843
|
+
*
|
|
1844
|
+
* `preventDefault` on that mousedown stops focus bouncing off the chrome. Clicks on the
|
|
1845
|
+
* control or a nested button/link/input are left alone.
|
|
1982
1846
|
*/
|
|
1983
1847
|
class FieldClickFocusDirective {
|
|
1984
1848
|
host = inject(ElementRef).nativeElement;
|
|
@@ -2008,8 +1872,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
2008
1872
|
}] });
|
|
2009
1873
|
|
|
2010
1874
|
let nextId = 0;
|
|
2011
|
-
/** Process-wide counter for
|
|
2012
|
-
* Replaces the per-component `let nextId = 0` pattern.
|
|
1875
|
+
/** Process-wide counter for SSR-safe control ids (no DOM dependency).
|
|
2013
1876
|
* @internal
|
|
2014
1877
|
*/
|
|
2015
1878
|
function nextControlId(prefix) {
|
|
@@ -2017,15 +1880,13 @@ function nextControlId(prefix) {
|
|
|
2017
1880
|
}
|
|
2018
1881
|
|
|
2019
1882
|
/**
|
|
2020
|
-
* Fills an option group's heading
|
|
2021
|
-
* secondary line.
|
|
1883
|
+
* Fills an option group's heading.
|
|
2022
1884
|
*
|
|
2023
1885
|
* Context: `$implicit` and `group` are the group itself, `count` how many of its
|
|
2024
1886
|
* options survived the filter.
|
|
2025
1887
|
*
|
|
2026
|
-
* The heading element stays the library's
|
|
2027
|
-
*
|
|
2028
|
-
* its name.
|
|
1888
|
+
* The heading element stays the library's, keeping the id the group's `aria-labelledby`
|
|
1889
|
+
* points at.
|
|
2029
1890
|
*/
|
|
2030
1891
|
class DsGroupLabelTemplateDirective {
|
|
2031
1892
|
template = inject(TemplateRef);
|
|
@@ -2042,7 +1903,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
2042
1903
|
|
|
2043
1904
|
/**
|
|
2044
1905
|
* Fills an option row's LABEL AREA in `ds-select`, `ds-multi-select` and
|
|
2045
|
-
* `ds-autocomplete
|
|
1906
|
+
* `ds-autocomplete`.
|
|
2046
1907
|
*
|
|
2047
1908
|
* ```html
|
|
2048
1909
|
* <ds-multi-select [options]="assignees()">
|
|
@@ -2052,9 +1913,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
2052
1913
|
* </ds-multi-select>
|
|
2053
1914
|
* ```
|
|
2054
1915
|
*
|
|
2055
|
-
* The row
|
|
2056
|
-
*
|
|
2057
|
-
* template cannot take the listbox semantics with it.
|
|
1916
|
+
* The row stays library-owned: `role="option"`, `aria-selected`, the active-row class,
|
|
1917
|
+
* the checkbox and the check glyph are not projected.
|
|
2058
1918
|
*/
|
|
2059
1919
|
class DsOptionTemplateDirective {
|
|
2060
1920
|
template = inject(TemplateRef);
|
|
@@ -2069,8 +1929,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
2069
1929
|
}]
|
|
2070
1930
|
}] });
|
|
2071
1931
|
|
|
2072
|
-
/** The theme's role layer, forwarded onto every portaled pane
|
|
2073
|
-
* tokens the component names for itself. */
|
|
1932
|
+
/** The theme's role layer, forwarded onto every portaled pane. */
|
|
2074
1933
|
const ROLE_TOKENS = [
|
|
2075
1934
|
'--ds-radius-inner',
|
|
2076
1935
|
'--ds-radius-control',
|
|
@@ -2081,8 +1940,7 @@ const ROLE_TOKENS = [
|
|
|
2081
1940
|
'--ds-elevation-floating',
|
|
2082
1941
|
'--ds-elevation-modal',
|
|
2083
1942
|
];
|
|
2084
|
-
/** Public enter-motion tokens read by every `ds-overlay-pane
|
|
2085
|
-
* (styles/_overlay-motion.scss). */
|
|
1943
|
+
/** Public enter-motion tokens read by every `ds-overlay-pane`. */
|
|
2086
1944
|
const OVERLAY_MOTION_TOKENS = [
|
|
2087
1945
|
'--ds-overlay-enter-keyframes',
|
|
2088
1946
|
'--ds-overlay-enter-duration',
|
|
@@ -2090,8 +1948,7 @@ const OVERLAY_MOTION_TOKENS = [
|
|
|
2090
1948
|
'--ds-overlay-enter-offset',
|
|
2091
1949
|
'--ds-overlay-enter-scale',
|
|
2092
1950
|
];
|
|
2093
|
-
/** Styles the `ds-dropdown-panel` class every `dropdownOverlay()` pane carries
|
|
2094
|
-
* every connected picker gets it whether or not it names panel tokens of its own. */
|
|
1951
|
+
/** Styles the `ds-dropdown-panel` class every `dropdownOverlay()` pane carries. */
|
|
2095
1952
|
const DROPDOWN_PANEL_TOKENS = [
|
|
2096
1953
|
'--ds-dropdown-panel-radius',
|
|
2097
1954
|
'--ds-dropdown-panel-max-height',
|
|
@@ -2109,8 +1966,7 @@ const DROPDOWN_PANEL_TOKENS = [
|
|
|
2109
1966
|
];
|
|
2110
1967
|
const DROPDOWN_GAP = 4;
|
|
2111
1968
|
/**
|
|
2112
|
-
* One panel-class input as an array
|
|
2113
|
-
* string into its characters, which is a silent per-letter class list.
|
|
1969
|
+
* One panel-class input as an array; spreading the raw string would give a per-letter class list.
|
|
2114
1970
|
* @internal
|
|
2115
1971
|
*/
|
|
2116
1972
|
function panelClassesOf(panelClass) {
|
|
@@ -2119,9 +1975,7 @@ function panelClassesOf(panelClass) {
|
|
|
2119
1975
|
: panelClass;
|
|
2120
1976
|
}
|
|
2121
1977
|
/**
|
|
2122
|
-
* The geometry every DS dropdown shares. Width is
|
|
2123
|
-
* each caller has its own policy (the exact trigger width, or the trigger as a
|
|
2124
|
-
* floor).
|
|
1978
|
+
* The geometry every DS dropdown shares. Width is NOT set here: each caller has its own policy.
|
|
2125
1979
|
* @internal
|
|
2126
1980
|
*/
|
|
2127
1981
|
function dropdownOverlay(overlay, trigger, extraPanelClass = []) {
|
|
@@ -2149,10 +2003,7 @@ function dropdownOverlay(overlay, trigger, extraPanelClass = []) {
|
|
|
2149
2003
|
config: {
|
|
2150
2004
|
positionStrategy,
|
|
2151
2005
|
hasBackdrop: false,
|
|
2152
|
-
// The
|
|
2153
|
-
// node sits outside the host's DOM tree, so `:host ::ng-deep` cannot reach it.
|
|
2154
|
-
// The shared pair is never optional — a caller adds to it, so its own class
|
|
2155
|
-
// and a consumer's survive together and a rule can name one picker.
|
|
2006
|
+
// The panel skin is global CSS: `:host ::ng-deep` cannot reach a portaled node.
|
|
2156
2007
|
panelClass: [
|
|
2157
2008
|
'ds-dropdown-panel',
|
|
2158
2009
|
'ds-overlay-pane',
|
|
@@ -2162,18 +2013,13 @@ function dropdownOverlay(overlay, trigger, extraPanelClass = []) {
|
|
|
2162
2013
|
},
|
|
2163
2014
|
};
|
|
2164
2015
|
}
|
|
2165
|
-
//
|
|
2166
|
-
//
|
|
2167
|
-
// reliably delivered) all end here. Comfortably past --ds-motion-exit-duration.
|
|
2016
|
+
// Teardown fallback: a display:none pane, a removed animation or a 0s reduced-motion duration
|
|
2017
|
+
// (animationend is not reliably delivered) all end here. Past --ds-motion-exit-duration.
|
|
2168
2018
|
const LEAVE_TIMEOUT_MS = 400;
|
|
2169
2019
|
/**
|
|
2170
|
-
*
|
|
2171
|
-
* `'dismiss'`. A fade after a deliberate pick reads as the panel lagging behind a
|
|
2172
|
-
* decision already made; on a dismissal nothing was chosen, so the same fade reads
|
|
2173
|
-
* as the panel backing out.
|
|
2020
|
+
* Closes a DS overlay panel instantly on a `'select'`, with a short fade on a `'dismiss'`.
|
|
2174
2021
|
*
|
|
2175
|
-
* NOTE: teardown paths dispose directly
|
|
2176
|
-
* animate, and `ModalService` owns its own scrim-and-card leave.
|
|
2022
|
+
* NOTE: teardown paths dispose directly; `ModalService` owns its own leave.
|
|
2177
2023
|
* @internal
|
|
2178
2024
|
*/
|
|
2179
2025
|
function disposeWithLeave(overlayRef, cause = 'select') {
|
|
@@ -2195,8 +2041,7 @@ function disposeWithLeave(overlayRef, cause = 'select') {
|
|
|
2195
2041
|
pane.removeEventListener('animationend', onAnimationEnd);
|
|
2196
2042
|
overlayRef.dispose();
|
|
2197
2043
|
};
|
|
2198
|
-
// The pane's ROOT CHILD
|
|
2199
|
-
// itself), so the event arrives from a descendant and bubbles up to here.
|
|
2044
|
+
// The pane's ROOT CHILD animates (CDK owns transforms on the pane), so the event bubbles up.
|
|
2200
2045
|
const onAnimationEnd = (event) => {
|
|
2201
2046
|
if (event.animationName.endsWith('ds-overlay-out')) {
|
|
2202
2047
|
finish();
|
|
@@ -2207,12 +2052,9 @@ function disposeWithLeave(overlayRef, cause = 'select') {
|
|
|
2207
2052
|
pane.classList.add('ds-leaving');
|
|
2208
2053
|
}
|
|
2209
2054
|
/**
|
|
2210
|
-
*
|
|
2211
|
-
*
|
|
2212
|
-
*
|
|
2213
|
-
* down to it. Only non-empty values are set, so an unset token still falls
|
|
2214
|
-
* through to the panel's own `var(--ds-*, <default>)`. Call once per open, right
|
|
2215
|
-
* after `overlay.create()`.
|
|
2055
|
+
* Forwards a portaled panel's public `--ds-*` override tokens from the component host onto
|
|
2056
|
+
* the overlay pane (in `document.body`, outside `:host`). Only non-empty values are set, so an
|
|
2057
|
+
* unset token falls through to the panel's `var(--ds-*, <default>)`. Call once per open.
|
|
2216
2058
|
* @internal
|
|
2217
2059
|
*/
|
|
2218
2060
|
function forwardOverlayTokens(overlayRef, host, tokens) {
|
|
@@ -2224,17 +2066,9 @@ function forwardOverlayTokens(overlayRef, host, tokens) {
|
|
|
2224
2066
|
paneStyle.setProperty(token, value);
|
|
2225
2067
|
}
|
|
2226
2068
|
}
|
|
2227
|
-
// Roles resolve at :root
|
|
2228
|
-
//
|
|
2229
|
-
//
|
|
2230
|
-
// declares the role ITSELF, which is the case the pane cannot see.
|
|
2231
|
-
//
|
|
2232
|
-
// Compared against the PARENT, not against :root. Custom properties inherit, so a
|
|
2233
|
-
// shell that sets a role for its own chrome makes every component under it differ
|
|
2234
|
-
// from the root — each would pin the shell's value inline, where it outranks the
|
|
2235
|
-
// `.ds-overlay-pane` rule that is a consumer's only route to a portaled panel. An
|
|
2236
|
-
// ancestor's value reaches one panel through that component's own `--ds-*` hook,
|
|
2237
|
-
// which the loop above forwards with no such test.
|
|
2069
|
+
// Roles resolve at :root; pinning them unconditionally would freeze an open panel against a
|
|
2070
|
+
// theme switch. Forward only where the host declares the role ITSELF, compared against the
|
|
2071
|
+
// PARENT (custom properties inherit) so an inline pin never outranks `.ds-overlay-pane`.
|
|
2238
2072
|
const inheritedStyle = getComputedStyle(host.parentElement ?? host.ownerDocument.documentElement);
|
|
2239
2073
|
for (const token of ROLE_TOKENS) {
|
|
2240
2074
|
const value = hostStyle.getPropertyValue(token).trim();
|
|
@@ -2243,8 +2077,7 @@ function forwardOverlayTokens(overlayRef, host, tokens) {
|
|
|
2243
2077
|
}
|
|
2244
2078
|
}
|
|
2245
2079
|
}
|
|
2246
|
-
/**
|
|
2247
|
-
* edge pinned to the trigger, so `top` means the panel hangs BELOW the trigger.
|
|
2080
|
+
/** `overlayY` is the panel edge pinned to the trigger, so `top` means the panel hangs BELOW it.
|
|
2248
2081
|
* @internal
|
|
2249
2082
|
*/
|
|
2250
2083
|
function overlayPlacementOf(overlayY, overlayX) {
|
|
@@ -2260,13 +2093,11 @@ function overlayPlacementOf(overlayY, overlayX) {
|
|
|
2260
2093
|
return 'left';
|
|
2261
2094
|
}
|
|
2262
2095
|
/**
|
|
2263
|
-
*
|
|
2264
|
-
*
|
|
2265
|
-
*
|
|
2266
|
-
* with no strategy passed) the CSS default applies: entering from above.
|
|
2096
|
+
* Primes a `ds-overlay-pane` for its enter animation. Call right after `overlay.create()`:
|
|
2097
|
+
* CDK positions in `afterNextRender`, so the placement stamp lands before the first painted
|
|
2098
|
+
* frame. Until then (or with no strategy) the CSS default enters from above.
|
|
2267
2099
|
*
|
|
2268
|
-
*
|
|
2269
|
-
* strategy, which completes `positionChanges`.
|
|
2100
|
+
* No teardown needed: disposing the overlay completes `positionChanges`.
|
|
2270
2101
|
* @internal
|
|
2271
2102
|
*/
|
|
2272
2103
|
function prepareOverlayEnter(overlayRef, host, positionStrategy) {
|
|
@@ -2276,9 +2107,7 @@ function prepareOverlayEnter(overlayRef, host, positionStrategy) {
|
|
|
2276
2107
|
overlayRef.overlayElement.dataset['dsPlacement'] = overlayPlacementOf(connectionPair.overlayY, connectionPair.overlayX);
|
|
2277
2108
|
});
|
|
2278
2109
|
}
|
|
2279
|
-
/**
|
|
2280
|
-
* lands on its trigger — so the trigger stays interactive (caret, re-focus) while
|
|
2281
|
-
* open. Use with `hasBackdrop: false` so hover/cursor/pointer reach the live page.
|
|
2110
|
+
/** Closes a non-modal overlay on a pointer press outside it, EXCEPT on its trigger. Use with `hasBackdrop: false`.
|
|
2282
2111
|
* @internal
|
|
2283
2112
|
*/
|
|
2284
2113
|
function closeOnOutsidePointer(overlayRef, isInsideTrigger, close) {
|
|
@@ -2290,11 +2119,9 @@ function closeOnOutsidePointer(overlayRef, isInsideTrigger, close) {
|
|
|
2290
2119
|
close();
|
|
2291
2120
|
});
|
|
2292
2121
|
}
|
|
2293
|
-
/**
|
|
2294
|
-
*
|
|
2295
|
-
*
|
|
2296
|
-
* the document in the CAPTURE phase, which catches the non-bubbling `scroll`
|
|
2297
|
-
* event from ANY nested container. A scroll inside the panel itself is ignored.
|
|
2122
|
+
/** Closes a non-modal overlay when the page scrolls. CDK's scroll strategies miss a plain
|
|
2123
|
+
* `overflow:auto` container, so this listens on the document in the CAPTURE phase (`scroll`
|
|
2124
|
+
* does not bubble). A scroll inside the panel is ignored.
|
|
2298
2125
|
* @internal
|
|
2299
2126
|
*/
|
|
2300
2127
|
function closeOnScroll(overlayRef, close) {
|
|
@@ -2303,8 +2130,6 @@ function closeOnScroll(overlayRef, close) {
|
|
|
2303
2130
|
if (target && overlayRef.overlayElement.contains(target)) {
|
|
2304
2131
|
return;
|
|
2305
2132
|
}
|
|
2306
|
-
// A form control scrolling its own text (e.g. typing past the visible edge
|
|
2307
|
-
// of a host-side filter input) never moves the panel's anchor — ignore it.
|
|
2308
2133
|
if (target instanceof HTMLElement &&
|
|
2309
2134
|
(target.tagName === 'INPUT' ||
|
|
2310
2135
|
target.tagName === 'TEXTAREA' ||
|
|
@@ -2318,20 +2143,12 @@ function closeOnScroll(overlayRef, close) {
|
|
|
2318
2143
|
return () => doc.removeEventListener('scroll', onScroll, true);
|
|
2319
2144
|
}
|
|
2320
2145
|
/**
|
|
2321
|
-
*
|
|
2322
|
-
* skipping the write when a newer one has
|
|
2323
|
-
*
|
|
2324
|
-
* `disposeWithLeave` defers the dispose
|
|
2325
|
-
*
|
|
2326
|
-
*
|
|
2327
|
-
* component believing it was closed — no `aria-expanded`, and `close()` declining to run because
|
|
2328
|
-
* the ref it checks was already null, which is to say the panel could not be dismissed at all.
|
|
2329
|
-
* Measured in ds-date-picker, ds-color-picker, ds-time-picker and ds-popover; ds-select,
|
|
2330
|
-
* ds-autocomplete and ds-multi-select each carried the check by hand, and the four that did not
|
|
2331
|
-
* are why it lives here instead.
|
|
2332
|
-
*
|
|
2333
|
-
* A detachment of the CURRENT overlay always clears, whatever caused it — so a stray CDK detach
|
|
2334
|
-
* still releases a reopen guard that keys off the stored ref rather than wedging it.
|
|
2146
|
+
* Syncs a component's "which overlay is mine, and is it open" state when THIS overlay detaches,
|
|
2147
|
+
* skipping the write when a newer one has taken over.
|
|
2148
|
+
*
|
|
2149
|
+
* `disposeWithLeave` defers the dispose until the exit animation ends, so a dismiss followed
|
|
2150
|
+
* by a re-open delivers the OLD overlay's detachment while the NEW one is live. Clearing
|
|
2151
|
+
* unconditionally would leave that panel on screen with its component believing it closed.
|
|
2335
2152
|
* @internal
|
|
2336
2153
|
*/
|
|
2337
2154
|
function clearOnDetach(overlayRef, { current, clear, always, }) {
|
|
@@ -2343,11 +2160,8 @@ function clearOnDetach(overlayRef, { current, clear, always, }) {
|
|
|
2343
2160
|
clear();
|
|
2344
2161
|
});
|
|
2345
2162
|
}
|
|
2346
|
-
/** True when keyboard focus
|
|
2347
|
-
*
|
|
2348
|
-
* rather than strand focus on `<body>`. An outside-pointer close leaves focus on
|
|
2349
|
-
* the clicked element (mousedown moved it out of the pane first), so this
|
|
2350
|
-
* returns false there and focus is correctly left alone.
|
|
2163
|
+
/** True when keyboard focus sits inside the overlay pane. Read it BEFORE disposing, to decide
|
|
2164
|
+
* whether the close must refocus the trigger rather than strand focus on `<body>`.
|
|
2351
2165
|
* @internal
|
|
2352
2166
|
*/
|
|
2353
2167
|
function focusIsInside(overlayRef) {
|
|
@@ -2356,15 +2170,12 @@ function focusIsInside(overlayRef) {
|
|
|
2356
2170
|
}
|
|
2357
2171
|
|
|
2358
2172
|
/**
|
|
2359
|
-
* Fills a strip below a picker panel's option list
|
|
2360
|
-
* of your own, a count, a link, an apply button for a panel the user batches
|
|
2361
|
-
* choices in.
|
|
2173
|
+
* Fills a strip below a picker panel's option list.
|
|
2362
2174
|
*
|
|
2363
|
-
* Context: the same as the header slot
|
|
2175
|
+
* Context: the same as the header slot: `count`, `total`, `query`.
|
|
2364
2176
|
*
|
|
2365
|
-
* Like the header it sits OUTSIDE the `listbox` and does not scroll with the
|
|
2366
|
-
*
|
|
2367
|
-
* give it an accessible name.
|
|
2177
|
+
* Like the header it sits OUTSIDE the `listbox` and does not scroll with the options.
|
|
2178
|
+
* Anything focusable here is reached by Tab, so give it an accessible name.
|
|
2368
2179
|
*/
|
|
2369
2180
|
class DsPanelFooterTemplateDirective {
|
|
2370
2181
|
template = inject(TemplateRef);
|
|
@@ -2380,16 +2191,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
2380
2191
|
}] });
|
|
2381
2192
|
|
|
2382
2193
|
/**
|
|
2383
|
-
* Fills a strip above a picker panel's option list
|
|
2384
|
-
* "clear all" button, a hint, a link to a fuller search.
|
|
2194
|
+
* Fills a strip above a picker panel's option list.
|
|
2385
2195
|
*
|
|
2386
2196
|
* Context: `count` is how many options are visible after filtering, `total` how
|
|
2387
2197
|
* many were given, and `query` the text that narrowed them.
|
|
2388
2198
|
*
|
|
2389
|
-
* It sits OUTSIDE the `listbox`, so
|
|
2390
|
-
*
|
|
2391
|
-
* also stays put while the list scrolls under it — the panel clips and the list
|
|
2392
|
-
* is the scroller.
|
|
2199
|
+
* It sits OUTSIDE the `listbox`, so it is not counted as an option in a screen
|
|
2200
|
+
* reader's "N of M" position. It stays put while the list scrolls.
|
|
2393
2201
|
*/
|
|
2394
2202
|
class DsPanelHeaderTemplateDirective {
|
|
2395
2203
|
template = inject(TemplateRef);
|
|
@@ -2407,10 +2215,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
2407
2215
|
/**
|
|
2408
2216
|
* Announces how many options survived the filter.
|
|
2409
2217
|
*
|
|
2410
|
-
*
|
|
2411
|
-
*
|
|
2412
|
-
* readers reliably do not announce — there is no content CHANGE to fire on. The
|
|
2413
|
-
* node here is created once, empty, and only its text changes.
|
|
2218
|
+
* NOT a row inside the listbox (a live region there is an invalid child). The node is created
|
|
2219
|
+
* once, empty, and only its text changes: a region created with its text is not reliably announced.
|
|
2414
2220
|
* @internal
|
|
2415
2221
|
*/
|
|
2416
2222
|
function announceOptionCount(count, active) {
|
|
@@ -2419,8 +2225,7 @@ function announceOptionCount(count, active) {
|
|
|
2419
2225
|
const region = documentRef.createElement('div');
|
|
2420
2226
|
region.setAttribute('aria-live', 'polite');
|
|
2421
2227
|
region.setAttribute('aria-atomic', 'true');
|
|
2422
|
-
// Off-screen
|
|
2423
|
-
// accessibility tree and announce nothing at all.
|
|
2228
|
+
// Off-screen, not `display: none`, which would remove it from the accessibility tree.
|
|
2424
2229
|
region.style.cssText =
|
|
2425
2230
|
'position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;margin:-1px;padding:0';
|
|
2426
2231
|
documentRef.body.appendChild(region);
|
|
@@ -2435,11 +2240,9 @@ function announceOptionCount(count, active) {
|
|
|
2435
2240
|
}
|
|
2436
2241
|
|
|
2437
2242
|
/**
|
|
2438
|
-
* Replaces the CONTENTS of a picker's trigger
|
|
2439
|
-
*
|
|
2440
|
-
*
|
|
2441
|
-
* `aria-activedescendant` and the Enter/Space/ArrowDown/Escape handling cannot
|
|
2442
|
-
* be lost with it.
|
|
2243
|
+
* Replaces the CONTENTS of a picker's trigger (chips, value, placeholder) with your own
|
|
2244
|
+
* markup. The trigger ELEMENT stays library-owned: its ARIA attributes and
|
|
2245
|
+
* Enter/Space/ArrowDown/Escape handling are kept.
|
|
2443
2246
|
*
|
|
2444
2247
|
* ```html
|
|
2445
2248
|
* <ds-multi-select [options]="labels()" [(value)]="picked">
|
|
@@ -2452,8 +2255,7 @@ function announceOptionCount(count, active) {
|
|
|
2452
2255
|
* Context: `$implicit` and `selected` are the selected options, `count` their
|
|
2453
2256
|
* number, `open` whether the panel is showing, `disabled` the control's state.
|
|
2454
2257
|
*
|
|
2455
|
-
* A projected template WINS over `triggerDisplay
|
|
2456
|
-
* at all, so there is no "compact plus a template" combination to explain.
|
|
2258
|
+
* A projected template WINS over `triggerDisplay`, which is then not read at all.
|
|
2457
2259
|
*/
|
|
2458
2260
|
class DsPickerTriggerDirective {
|
|
2459
2261
|
template = inject(TemplateRef);
|
|
@@ -2469,10 +2271,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
2469
2271
|
}] });
|
|
2470
2272
|
|
|
2471
2273
|
/**
|
|
2472
|
-
* Dev-only guard for a component that DROPS whatever is projected into it
|
|
2473
|
-
*
|
|
2474
|
-
* content a component chooses to ignore. Put it on a probe around the
|
|
2475
|
-
* `<ng-content>`, gated on dev mode so production renders no extra node:
|
|
2274
|
+
* Dev-only guard for a component that DROPS whatever is projected into it: warns instead of
|
|
2275
|
+
* staying silent. Put it on a probe around the `<ng-content>`, gated on dev mode:
|
|
2476
2276
|
*
|
|
2477
2277
|
* ```html
|
|
2478
2278
|
* @if (devMode) {
|
|
@@ -2480,21 +2280,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
2480
2280
|
* }
|
|
2481
2281
|
* ```
|
|
2482
2282
|
*
|
|
2483
|
-
* It is NOT projection support: the probe
|
|
2484
|
-
*
|
|
2485
|
-
*
|
|
2486
|
-
* `ds-filter-bar` is the only host today.
|
|
2487
|
-
*
|
|
2488
|
-
* `reason` replaces the default `[label]` wording for a host that drops content
|
|
2489
|
-
* for a different reason — `ds-filter-bar` drops anything that carries neither of
|
|
2490
|
-
* its slot attributes.
|
|
2283
|
+
* It is NOT projection support: the probe only detects that content arrived, then hides it.
|
|
2284
|
+
* `reason` replaces the default `[label]` wording.
|
|
2491
2285
|
* @internal
|
|
2492
2286
|
*/
|
|
2493
2287
|
class ProjectionDroppedDirective {
|
|
2494
|
-
/** The host component's selector, named in the warning. */
|
|
2495
2288
|
dsProjectionDropped = input.required(...(ngDevMode ? [{ debugName: "dsProjectionDropped" }] : /* istanbul ignore next */ []));
|
|
2496
|
-
/** Overrides the `[label]` explanation
|
|
2497
|
-
* another reason. Ends up after "renders nothing — ". */
|
|
2289
|
+
/** Overrides the `[label]` explanation; appended after "Projected content renders nothing". */
|
|
2498
2290
|
reason = input('', ...(ngDevMode ? [{ debugName: "reason" }] : /* istanbul ignore next */ []));
|
|
2499
2291
|
probe = inject((ElementRef));
|
|
2500
2292
|
constructor() {
|
|
@@ -2523,14 +2315,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
2523
2315
|
/**
|
|
2524
2316
|
* Keeps the keyboard cursor's row visible inside a scrolling panel.
|
|
2525
2317
|
*
|
|
2526
|
-
* KEYBOARD ONLY
|
|
2527
|
-
*
|
|
2528
|
-
* a partially visible row up under the pointer while the user was reading with
|
|
2529
|
-
* the mouse.
|
|
2318
|
+
* KEYBOARD ONLY (`armed`): rows also set the active index on `mouseenter`, and reacting to
|
|
2319
|
+
* that would pull a partially visible row up under the pointer.
|
|
2530
2320
|
*
|
|
2531
|
-
* Rows are looked up by id
|
|
2532
|
-
* live in a portaled template — and the id is the one `aria-activedescendant`
|
|
2533
|
-
* already points at, so a failed lookup means that reference is broken too.
|
|
2321
|
+
* Rows are looked up by id, not `viewChildren`, because they live in a portaled template.
|
|
2534
2322
|
* @internal
|
|
2535
2323
|
*/
|
|
2536
2324
|
function scrollActiveOptionIntoView(activeDescendantId, enabled, armed) {
|
|
@@ -2560,12 +2348,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
2560
2348
|
}], propDecorators: { staticPreview: [{ type: i0.Input, args: [{ isSignal: true, alias: "staticPreview", required: false }] }] } });
|
|
2561
2349
|
|
|
2562
2350
|
/**
|
|
2563
|
-
*
|
|
2564
|
-
*
|
|
2565
|
-
* Typing "ba" on a closed control moves to the first option starting with "ba",
|
|
2566
|
-
* and keeps extending the buffer while the user keeps typing. The timeout is what
|
|
2567
|
-
* separates "ba" from two separate "b" and "a" presses; 500ms is the interval
|
|
2568
|
-
* every native control and APG example uses.
|
|
2351
|
+
* Jump-to-option-by-typing, as a native `<select>` does. 500ms is the native and APG
|
|
2352
|
+
* interval separating "ba" from two separate presses.
|
|
2569
2353
|
*/
|
|
2570
2354
|
const RESET_AFTER_MS = 500;
|
|
2571
2355
|
/** @internal */
|
|
@@ -2574,8 +2358,6 @@ function createTypeAhead() {
|
|
|
2574
2358
|
let last = 0;
|
|
2575
2359
|
return {
|
|
2576
2360
|
match(key, labels, from) {
|
|
2577
|
-
// A modifier combination and any named key ("Enter", "ArrowDown") are not
|
|
2578
|
-
// text; only a single printable character extends the buffer.
|
|
2579
2361
|
if (key.length !== 1 || !/\S/.test(key)) {
|
|
2580
2362
|
return -1;
|
|
2581
2363
|
}
|
|
@@ -2598,45 +2380,9 @@ function createTypeAhead() {
|
|
|
2598
2380
|
};
|
|
2599
2381
|
}
|
|
2600
2382
|
|
|
2601
|
-
const NO_DATA_TABLE = signal(null, ...(ngDevMode ? [{ debugName: "NO_DATA_TABLE" }] : /* istanbul ignore next */ []));
|
|
2602
|
-
const NO_LINGER = signal(null, ...(ngDevMode ? [{ debugName: "NO_LINGER" }] : /* istanbul ignore next */ []));
|
|
2603
|
-
const NO_PIN = signal(null, ...(ngDevMode ? [{ debugName: "NO_PIN" }] : /* istanbul ignore next */ []));
|
|
2604
|
-
const NO_DELAY = signal(null, ...(ngDevMode ? [{ debugName: "NO_DELAY" }] : /* istanbul ignore next */ []));
|
|
2605
|
-
const NO_SWATCHES = signal(null, ...(ngDevMode ? [{ debugName: "NO_SWATCHES" }] : /* istanbul ignore next */ []));
|
|
2606
|
-
/** How long a resting pointer waits before a chart answers it, when nothing sets it.
|
|
2607
|
-
*
|
|
2608
|
-
* @internal */
|
|
2609
|
-
const CHART_HOVER_DELAY_MS = 0;
|
|
2610
|
-
/** How long a tooltip outlives the pointer leaving its mark, when nothing sets it. Long enough
|
|
2611
|
-
* that the pointer crossing the gap to the next mark finds the same panel and it glides there,
|
|
2612
|
-
* where a shorter wait closes it and opens a new one.
|
|
2613
|
-
*
|
|
2614
|
-
* @internal */
|
|
2615
|
-
const CHART_TOOLTIP_LINGER_MS = 500;
|
|
2616
|
-
/** Each resolved input → `DS_CONFIG.chart` → the built-in; copy resolves input → `DS_INTL.chart`.
|
|
2617
|
-
* Call from an injection context.
|
|
2618
|
-
*
|
|
2619
|
-
* @internal */
|
|
2620
|
-
function resolveChartDefaults(inputs) {
|
|
2621
|
-
const locale = injectDsLocale();
|
|
2622
|
-
const intl = inject(DS_INTL);
|
|
2623
|
-
return {
|
|
2624
|
-
locale,
|
|
2625
|
-
frame: resolveWithConfig(inputs.frame, (config) => config.chart?.frame, 'auto'),
|
|
2626
|
-
dataTable: resolveWithConfig(inputs.dataTable ?? NO_DATA_TABLE, (config) => config.chart?.dataTable, 'none'),
|
|
2627
|
-
emptyText: computed(() => inputs.emptyText() ?? intl().chart.empty),
|
|
2628
|
-
errorText: computed(() => inputs.errorText() ?? intl().chart.error),
|
|
2629
|
-
valueFormat: resolveWithConfig(inputs.valueFormat, (config) => config.chart?.valueFormat, chartValueFormat(locale)),
|
|
2630
|
-
tooltipLingerMs: resolveWithConfig(inputs.tooltipLingerMs ?? NO_LINGER, (config) => config.chart?.tooltipLingerMs, CHART_TOOLTIP_LINGER_MS),
|
|
2631
|
-
pinOnClick: resolveWithConfig(inputs.pinOnClick ?? NO_PIN, (config) => config.chart?.pinOnClick, true),
|
|
2632
|
-
hoverDelayMs: resolveWithConfig(inputs.hoverDelayMs ?? NO_DELAY, (config) => config.chart?.hoverDelayMs, CHART_HOVER_DELAY_MS),
|
|
2633
|
-
tooltipSwatches: resolveWithConfig(inputs.tooltipSwatches ?? NO_SWATCHES, (config) => config.chart?.tooltipSwatches, 'auto'),
|
|
2634
|
-
};
|
|
2635
|
-
}
|
|
2636
|
-
|
|
2637
2383
|
/**
|
|
2638
2384
|
* Generated bundle index. Do not edit.
|
|
2639
2385
|
*/
|
|
2640
2386
|
|
|
2641
|
-
export { CHART_HEAT_COLORS, CHART_HOVER_DELAY_MS, CHART_RAMP_COLORS, CHART_RENDER_GATE_PASSED, CHART_SERIES_COLORS, CHART_TOOLTIP_LINGER_MS, DS_FIELD_WARNING_KIND, DsBooleanControlValueAccessor, DsChipTemplateDirective, DsControlValueAccessor, DsCreateTemplateDirective, DsEmptyTemplateDirective, DsFieldBase, DsGroupLabelTemplateDirective, DsMessageBase, DsOptionTemplateDirective, DsPanelFooterTemplateDirective, DsPanelHeaderTemplateDirective, DsPickerTriggerDirective, DsStaticPreview, FieldClickFocusDirective, ProjectionDroppedDirective, announceOptionCount, areaPath, bandPath, bandScale, chartColors, chartDwell, chartRenderGate, chartValueFormat, chipFit, clearOnDetach, closeOnOutsidePointer, closeOnScroll, createTypeAhead, decimationTarget, describeSeries, describeShare, disposeWithLeave, domainMinOf, dropdownOverlay, dsAriaCurrent, dsDestination, elementWidth, focusIsInside, focusMark, formatPercent, formatTick, formatValue, formatWholePercent, forwardOverlayTokens, labelInterval, largestRemainder, leaveMark, linePath, lineSegments, linearScale, listenForMarkFocus, lttbDecimate, markAt, markOf, minMaxDecimate, needsDecimating, nextControlId, nextRovingIndex, niceDomain, overlayPlacementOf, panelClassesOf, pointScale, polylinePoints, prepareOverlayEnter, resolveBrandValue, resolveChartDefaults, resolveFieldMessage, rotationWouldFit, roundStepAtLeast, rovingMarks, scrollActiveOptionIntoView, shareOfTotal, staggerDelay, tickStep, tickValues, trimmedText, valueControlBridge };
|
|
2387
|
+
export { CHART_HEAT_COLORS, CHART_HOVER_DELAY_MS, CHART_RAMP_COLORS, CHART_RENDER_GATE_PASSED, CHART_SERIES_COLORS, CHART_TOOLTIP_LINGER_MS, DS_FIELD_WARNING_KIND, DsBooleanControlValueAccessor, DsChartBase, DsChipTemplateDirective, DsControlValueAccessor, DsCreateTemplateDirective, DsEmptyTemplateDirective, DsFieldBase, DsGroupLabelTemplateDirective, DsMessageBase, DsOptionTemplateDirective, DsPanelFooterTemplateDirective, DsPanelHeaderTemplateDirective, DsPickerTriggerDirective, DsStaticPreview, FieldClickFocusDirective, ProjectionDroppedDirective, announceOptionCount, areaPath, bandPath, bandScale, chartColors, chartDwell, chartRenderGate, chartValueFormat, chipFit, clearOnDetach, closeOnOutsidePointer, closeOnScroll, createTypeAhead, decimationTarget, describeSeries, describeShare, disposeWithLeave, domainMinOf, dropdownOverlay, dsAriaCurrent, dsDestination, elementWidth, focusIsInside, focusMark, formatPercent, formatTick, formatValue, formatWholePercent, forwardOverlayTokens, labelInterval, largestRemainder, leaveMark, linePath, lineSegments, linearScale, listenForMarkFocus, lttbDecimate, markAt, markOf, minMaxDecimate, needsDecimating, nextControlId, nextRovingIndex, niceDomain, overlayPlacementOf, panelClassesOf, pointScale, polylinePoints, prepareOverlayEnter, resolveBrandValue, resolveChartDefaults, resolveFieldMessage, rotationWouldFit, roundStepAtLeast, rovingMarks, scrollActiveOptionIntoView, shareOfTotal, staggerDelay, tickStep, tickValues, trimmedText, valueControlBridge };
|
|
2642
2388
|
//# sourceMappingURL=ids-group-ltd-ids-design-system-components.mjs.map
|