@ids-group-ltd/ids-design-system 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +330 -4
- package/components.md +81 -43
- package/design-system.md +2 -0
- package/docs/agent/INDEX.md +2 -1
- package/docs/agent/charts/column-series-component.md +1 -1
- package/docs/agent/charts/ds-bar-chart.md +2 -1
- package/docs/agent/charts/ds-chart.md +1 -1
- package/docs/agent/charts/ds-config.md +3 -1
- package/docs/agent/charts/ds-line-chart.md +3 -3
- package/docs/agent/charts/ds-pie-chart.md +4 -3
- package/docs/agent/feedback/ds-alert.md +1 -0
- package/docs/agent/feedback/ds-badge.md +1 -1
- package/docs/agent/feedback/ds-banner.md +1 -0
- package/docs/agent/feedback/ds-skeleton.md +2 -2
- package/docs/agent/feedback/ds-tag.md +1 -1
- package/docs/agent/forms/ds-autocomplete.md +2 -2
- package/docs/agent/forms/ds-button.md +1 -1
- package/docs/agent/forms/ds-color-picker.md +1 -1
- package/docs/agent/forms/ds-date-picker.md +2 -2
- package/docs/agent/forms/ds-filter-bar.md +1 -1
- package/docs/agent/forms/ds-icon-button.md +1 -1
- package/docs/agent/forms/ds-input.md +1 -1
- package/docs/agent/forms/ds-multi-select.md +2 -2
- package/docs/agent/forms/ds-otp-input.md +1 -1
- package/docs/agent/forms/ds-search.md +2 -2
- package/docs/agent/forms/ds-split-button.md +1 -1
- package/docs/agent/forms/ds-textarea.md +1 -1
- package/docs/agent/foundations/tokens.md +1 -1
- package/docs/agent/navigation/ds-app-layout.md +2 -2
- package/docs/agent/navigation/ds-auth-layout.md +4 -4
- package/docs/agent/navigation/ds-page-header.md +1 -1
- package/docs/agent/platform/ds-config.md +2 -3
- package/docs/agent/platform/ds-intl.md +33 -0
- package/docs/agent/surfaces/ds-accordion.md +2 -2
- package/docs/agent/tables/ds-table.md +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +9 -5
- 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 +21 -10
- 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 +9 -5
- 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 +8 -8
- 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 +13 -8
- 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 +5 -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 +5 -10
- 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 +12 -8
- 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 +21 -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 +35 -18
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +7 -6
- 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 +4 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs +5 -3
- 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 +5 -3
- 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 +22 -29
- 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 +91 -67
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +9 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +20 -16
- 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 +16 -9
- 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 +4 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +7 -4
- 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 +12 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +13 -7
- 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 +36 -29
- 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 +13 -9
- 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 +3 -3
- 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 +5 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +23 -20
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +26 -13
- 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 +15 -10
- 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 -4
- 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 +13 -7
- 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-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 +7 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs +12 -11
- 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 +51 -16
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +17 -10
- 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 +9 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +4 -3
- 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 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +5 -3
- 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 +20 -6
- 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 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs +5 -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 +9 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +6 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +16 -13
- 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 +9 -6
- 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.mjs +19 -18
- 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 +5 -3
- 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 +9 -5
- 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 +5 -4
- 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 +12 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +8 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +5 -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 +14 -15
- 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 +271 -73
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +359 -3
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.10.0.json +1 -1
- package/migrations/0.10.1.json +1 -1
- package/migrations/0.14.0.json +28 -4
- package/migrations/0.14.1.json +856 -0
- package/package.json +1 -1
- package/schematics/check-overrides/index.cjs +56 -0
- package/schematics/check-overrides/scan.cjs +74 -0
- package/schematics/check-overrides/schema.json +19 -0
- package/schematics/check-overrides/surface.json +2304 -0
- package/schematics/collection.json +5 -0
- package/styles/_chart-interactive.scss +33 -0
- package/styles/_field-box.scss +12 -0
- package/styles/_overlay-motion.scss +6 -4
- package/styles/_tokens-charts.scss +1 -1
- package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +11 -2
- package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +4 -0
- package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +5 -2
- package/types/ids-group-ltd-ids-design-system-components-auth-layout.d.ts +5 -5
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +7 -4
- package/types/ids-group-ltd-ids-design-system-components-avatar-group.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-avatar.d.ts +5 -3
- package/types/ids-group-ltd-ids-design-system-components-badge.d.ts +6 -2
- package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +4 -0
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +18 -10
- package/types/ids-group-ltd-ids-design-system-components-breadcrumbs.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +2 -2
- package/types/ids-group-ltd-ids-design-system-components-chart-data-table.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +1 -4
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +38 -18
- package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +6 -2
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +9 -8
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +9 -3
- package/types/ids-group-ltd-ids-design-system-components-description-list.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-filter-bar.d.ts +9 -4
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +11 -9
- package/types/ids-group-ltd-ids-design-system-components-heatmap-chart.d.ts +7 -5
- package/types/ids-group-ltd-ids-design-system-components-input.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +13 -10
- package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +11 -6
- package/types/ids-group-ltd-ids-design-system-components-number-stepper.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-otp-input.d.ts +6 -2
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-password-rules.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +24 -10
- package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +8 -5
- package/types/ids-group-ltd-ids-design-system-components-search.d.ts +7 -3
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +3 -2
- package/types/ids-group-ltd-ids-design-system-components-sidenav-footer.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +5 -1
- package/types/ids-group-ltd-ids-design-system-components-slider.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-spinner.d.ts +6 -4
- package/types/ids-group-ltd-ids-design-system-components-split-button.d.ts +5 -2
- package/types/ids-group-ltd-ids-design-system-components-stepper.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-table-export.d.ts +1 -0
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +10 -5
- package/types/ids-group-ltd-ids-design-system-components-tabs.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-tag.d.ts +6 -2
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-w3w.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-waterfall-chart.d.ts +7 -5
- package/types/ids-group-ltd-ids-design-system-components.d.ts +44 -21
- package/types/ids-group-ltd-ids-design-system-core.d.ts +408 -11
- package/types/ids-group-ltd-ids-design-system.d.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-bar-chart.mjs","sources":["../../../src/lib/components/bar-chart/bar-chart.math.ts","../../../src/lib/components/bar-chart/bar-chart.component.ts","../../../src/lib/components/bar-chart/bar-chart.component.html","../../../src/lib/components/bar-chart/ids-group-ltd-ids-design-system-components-bar-chart.ts"],"sourcesContent":["import type { BarChartValue } from './bar-chart.types';\n\n/** Where a row's bar starts and ends on the value axis.\n *\n * A plain number spans from zero, negative included - a reading below zero hangs from the\n * baseline rather than reaching up to it. A pair is normalised, because a bar of negative width\n * draws nothing at all and a reader who wrote the ends backwards meant the same band. A\n * non-finite end collapses the whole extent, so one bad reading draws no bar rather than a bar of\n * unknown length.\n *\n * @internal */\nexport function barExtent(value: BarChartValue): { low: number; high: number } {\n if (typeof value === 'number') {\n return Number.isFinite(value)\n ? { low: Math.min(0, value), high: Math.max(0, value) }\n : { low: 0, high: 0 };\n }\n const [first, second] = value;\n\n return Number.isFinite(first) && Number.isFinite(second)\n ? { low: Math.min(first, second), high: Math.max(first, second) }\n : { low: 0, high: 0 };\n}\n\n/** Largest finite value, or `explicitMax` when it is a usable track length. A\n * non-finite datum is skipped rather than compared: one `Infinity` row would\n * otherwise become the track length and flatten every other row to nothing. */\nexport function resolveMax(\n explicitMax: number | null,\n values: readonly number[],\n): number {\n if (explicitMax !== null && Number.isFinite(explicitMax) && explicitMax > 0) {\n return explicitMax;\n }\n const finite = values.filter((value) => Number.isFinite(value));\n\n return finite.length ? Math.max(...finite) : 0;\n}\n\n/** Track share for one row, in percent. Has no upper bound: an explicit `max`\n * below the data is the caller's statement, and `.track` clips the overflow. */\nexport function widthPercent(value: number, max: number): number {\n // Math.max(NaN, 0) is NaN, so the lower clamp cannot stand in for this test —\n // and the result is written into a style attribute, where `width: NaN%` is\n // dropped silently.\n if (!Number.isFinite(value) || !Number.isFinite(max) || max <= 0) {\n return 0;\n }\n\n return Math.max((value / max) * 100, 0);\n}\n\n/** Each segment's share of the row's track, in percent. Sized against the segments' OWN sum, never\n * the row's `value`: when the two disagree the row is a distribution that does not add up, and a\n * gap left where the difference is would draw that error as an unlabelled category.\n *\n * A set with no positive finite total has no shares to give, and returns none. */\nexport function segmentWidths(values: readonly number[]): number[] {\n const total = values\n .filter((value) => Number.isFinite(value) && value > 0)\n .reduce((sum, value) => sum + value, 0);\n if (total <= 0) {\n return [];\n }\n\n return values.map((value) =>\n Number.isFinite(value) && value > 0 ? (value / total) * 100 : 0,\n );\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n contentChild,\n input,\n numberAttribute,\n output,\n} from '@angular/core';\nimport {\n CHART_SERIES_COLORS,\n chartColors,\n describeSeries,\n formatPercent,\n describeShare,\n shareOfTotal,\n rovingMarks,\n leaveMark,\n staggerDelay,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport type {\n ChartDataTable,\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport {\n barExtent,\n resolveMax,\n segmentWidths,\n widthPercent,\n} from './bar-chart.math';\nimport type { BarChartRow, BarChartSegment } from './bar-chart.types';\nimport { ChartDataTableComponent } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport type { ChartDataRow } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport { resolveChartDefaults } from '@ids-group-ltd/ids-design-system/components';\n\n/** A row's parts, ready to draw: a width, a colour and a formatted value each. Segments are\n * CATEGORIES, so they take the categorical palette in order — unlike the rows, which are one\n * series and share one colour. */\nfunction segmentsOf(\n row: BarChartRow,\n format: (value: number) => string,\n): readonly {\n key: string;\n segment: BarChartSegment;\n widthPercent: number;\n formattedValue: string;\n color: string;\n}[] {\n const parts = row.segments ?? [];\n const widths = segmentWidths(parts.map((part) => part.value));\n\n return widths.length\n ? parts.map((segment, index) => ({\n key: segment.id ?? String(index),\n segment,\n widthPercent: widths[index],\n formattedValue: format(segment.value),\n color:\n segment.color ??\n CHART_SERIES_COLORS[index % CHART_SERIES_COLORS.length],\n }))\n : [];\n}\n\n@Component({\n selector: 'ds-bar-chart',\n standalone: true,\n imports: [\n SkeletonComponent,\n ChartTooltipDirective,\n IconComponent,\n ChartDataTableComponent,\n ],\n templateUrl: './bar-chart.component.html',\n styleUrl: './bar-chart.component.scss',\n host: { '[class.framed]': \"frameResolved() === 'auto'\" },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BarChartComponent {\n protected readonly leaveMark = leaveMark;\n\n /** One row per bar, drawn in the order given. */\n readonly data = input.required<readonly BarChartRow[]>();\n\n /** Track length is relative to this. Null uses the largest value, so the\n * longest row always fills its track. */\n readonly max = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n\n /** Whether the chart draws its own bordered, padded box. `'auto'`, the default, draws it;\n * `'none'` leaves the chart bare, for one placed inside a card the page has already drawn.\n * Unset falls back to `DS_CONFIG.chart.frame`, then `'auto'` — whether charts live inside cards\n * is one decision per app rather than per plot. */\n readonly frame = input<ChartFrame | null>(null);\n\n /** How long the tooltip stays after the pointer leaves the mark, in milliseconds. Zero, the\n * default, takes it away at once: a panel that outlives the pointer sits over the plot the\n * reader has moved on to.\n *\n * Raise it only for a panel a reader has to REACH — one carrying a link, a figure, or anything\n * selectable — which is WCAG 1.4.13's hoverable clause. The panel is portaled to the body, so\n * crossing the gap to it at an ordinary pointer speed needs about 140. Unset falls back to\n * `DS_CONFIG.chart.tooltipLingerMs`, then 0. */\n readonly tooltipLingerMs = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n /** Printed above the plot as the chart's visible title, and reused as the annex table's\n * caption. */\n readonly caption = input<string | null>(null);\n\n /** Accessible name. Generated from the data when omitted. */\n readonly summary = input<string | null>(null);\n\n /** The label-and-value table under the plot: `'toggle'` puts it behind a disclosure,\n * `'visible'` opens it, `'none'` renders none. It is the non-visual route to the numbers, so\n * `'none'` belongs only where the same data is already in a table on the page.\n * Unset falls back to `DS_CONFIG.chart.dataTable`, then `'none'`. */\n readonly dataTable = input<ChartDataTable | null>(null);\n /** Declares that the marks are parts of one whole, which is what makes a share of their total a\n * real quantity. Off by default: a chart of visitors per stage or revenue per month sums to a\n * number nobody can point at, and \"18.6% of total\" against it is arithmetic dressed as a fact.\n * On, each mark's share appears on the tooltip's second line and in the data table. */\n readonly partOfWhole = input(false, { transform: booleanAttribute });\n\n /** Prints each row's share of `max` beside its value. */\n readonly showPercent = input(true, { transform: booleanAttribute });\n /** Draws skeleton marks in place of the data, at the same count, so the chart does not resize\n * when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n /** Shown in place of the plot when `data` is empty. Unset falls back to\n * `DS_CONFIG.chart.emptyText`, then `'No data'`. */\n readonly emptyText = input<string | null>(null);\n\n /** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,\n * because \"the request failed\" and \"there is nothing to show\" read the same to a reader and\n * mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** The message the error state prints. Unset falls back to `DS_CONFIG.chart.errorText`, then\n * `'Could not load the data'`. */\n readonly errorText = input<string | null>(null);\n /** Formats every value the chart prints, the annex table and the generated description\n * included. Unset falls back to `DS_CONFIG.chart.valueFormat`, then the browser's locale\n * grouping with a K/M/B suffix past four digits. */\n readonly valueFormat = input<ChartValueFormat | null>(null);\n\n private readonly defaults = resolveChartDefaults(this);\n readonly frameResolved = this.defaults.frame;\n readonly dataTableResolved = this.defaults.dataTable;\n readonly emptyTextResolved = this.defaults.emptyText;\n readonly errorTextResolved = this.defaults.errorText;\n readonly valueFormatResolved = this.defaults.valueFormat;\n\n /** Turns on the click affordance — the pointer cursor and any hover tint.\n * The click output fires whether or not this is set, so a consumer that\n * binds the output and forgets the flag still receives every click. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** The row that was clicked, or activated with Enter or Space. Fires whether or not\n * `interactive` is set. */\n readonly rowClicked = output<BarChartRow>();\n\n /** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a press\n * outside releases it. Off by default: a click is already the drill-down hook, and a mark left\n * lit after the pointer has gone needs a reader who knows why it is lit. `rowClicked` fires\n * either way — pinning is a state, not a handler. */\n readonly pinOnClick = input(false, { transform: booleanAttribute });\n\n /** Dims every OTHER mark while one is hovered or focused, so the reader's eye is held on the\n * one under the pointer. Off by default: the dimming costs the separation BETWEEN the dimmed\n * marks — measured 2026-09-13, the worst pair of three dimmed series falls from dE 14.8 at full\n * opacity to 2.1 at `--ds-chart-dim-opacity`'s default 0.3 — so it buys loudness for one mark\n * and pays for it with the rest of the chart. */\n readonly dimOthers = input(false, { transform: booleanAttribute });\n\n /** Milliseconds between one mark's entrance and the next. `0`, the default, is no stagger at\n * all; `40` is the documented non-zero step. The total is capped, so a long series does not\n * crawl in. */\n readonly staggerMs = input(0, { transform: numberAttribute });\n\n protected markStagger(index: number): string {\n return `${staggerDelay(index, this.staggerMs())}ms`;\n }\n\n /** Whether a hovered or focused row opens a tooltip. `'axis'` is not offered — a bar\n * chart's marks ARE its categories, so an axis tooltip would repeat the item one. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n protected readonly tooltipTemplate =\n contentChild<TemplateRef<{ $implicit: ChartTooltipContext }>>(\n 'dsChartTooltip',\n );\n\n private readonly tooltipLingerResolved = this.defaults.tooltipLingerMs;\n\n protected readonly activeMark = chartActiveMark(() =>\n this.tooltipLingerResolved(),\n );\n\n protected onMarkClick(\n payload: BarChartRow,\n index: number,\n event: Event,\n ): void {\n this.rowClicked.emit(payload);\n if (this.pinOnClick()) {\n this.activeMark.pin(index, event, '.fill');\n }\n }\n protected readonly roving = rovingMarks(() => this.rows().length);\n\n protected onMarkFocus(index: number, event: FocusEvent): void {\n this.roving.focus(index);\n this.activeMark.enter(index, event, '.fill');\n }\n\n protected onMarkNavigation(event: KeyboardEvent, index: number): void {\n this.roving.navigate(\n event,\n index,\n (event.currentTarget as Element).closest('.rows'),\n );\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const entry = this.rows()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !entry) {\n return null;\n }\n\n // A segmented bar draws several readings the row label cannot name, so the row heads the\n // panel and each segment gets its own line. Repeating the label the pointer is already on\n // would tell the reader nothing.\n if (entry.segments.length) {\n const values = entry.segments.map((part) => part.segment.value);\n\n return {\n category: entry.row.label,\n entries: entry.segments.map((part, partIndex) => ({\n label: part.segment.label,\n value: part.segment.value,\n formatted: part.formattedValue,\n color: part.color,\n detail: describeShare(values, partIndex),\n })),\n };\n }\n\n return {\n category: '',\n entries: [\n {\n label: entry.row.label,\n value: barExtent(entry.row.value).high,\n formatted: entry.formattedValue,\n color: entry.color,\n detail: this.partOfWhole()\n ? describeShare(\n this.data().map((row) => {\n const extent = barExtent(row.value);\n\n return extent.high - extent.low;\n }),\n this.activeMark.index(),\n )\n : undefined,\n },\n ],\n };\n },\n );\n\n /** The track has to hold the far end of every bar, the target tick and the outermost band -\n * a goal above every reading is the one the chart is read for, and an axis derived from the\n * bars alone would draw it off the end. */\n protected readonly resolvedMax = computed(() =>\n resolveMax(\n this.max(),\n this.data().flatMap((row) => [\n barExtent(row.value).high,\n row.target ?? 0,\n ...(row.ranges ?? []),\n ]),\n ),\n );\n\n protected readonly dataTableColumns = computed<readonly string[]>(() =>\n this.partOfWhole()\n ? ['Label', 'Value', 'Share of total']\n : ['Label', 'Value'],\n );\n\n /** A row's segments follow it as nested rows: one table reads in one pass, and a segment is\n * read against the bar it belongs to rather than against the other bars. */\n protected readonly dataTableRows = computed<readonly ChartDataRow[]>(() =>\n this.rows().flatMap((entry) => [\n {\n key: `bar:${entry.key}`,\n cells: this.partOfWhole()\n ? [\n [entry.row.label, entry.row.detail].filter(Boolean).join(' - '),\n entry.formattedValue,\n entry.share,\n ]\n : [\n [entry.row.label, entry.row.detail].filter(Boolean).join(' - '),\n entry.formattedValue,\n ],\n },\n ...entry.segments.map((part) => ({\n // Both keys fall back to a positional index in their OWN scope, and flattening puts\n // them in one list - a bar and its first segment would otherwise both be \"0\".\n key: `bar:${entry.key}/${part.key}`,\n nested: true,\n cells: this.partOfWhole()\n ? [part.segment.label, part.formattedValue, '']\n : [part.segment.label, part.formattedValue],\n })),\n ]),\n );\n\n protected readonly rows = computed(() => {\n const max = this.resolvedMax();\n const format = this.valueFormatResolved();\n // The bar's LENGTH is what a share is a share of, and on a floating bar that is the span\n // between its ends rather than either end on its own.\n const values = this.data().map((row) => {\n const extent = barExtent(row.value);\n\n return extent.high - extent.low;\n });\n\n return this.data().map((row, index) => {\n const extent = barExtent(row.value);\n const span = extent.high - extent.low;\n const isRange = typeof row.value !== 'number';\n\n return {\n key: row.id ?? String(index),\n row,\n offsetPercent: widthPercent(extent.low, max),\n widthPercent: widthPercent(span, max),\n formattedValue: isRange\n ? `${format(extent.low, 'tooltip')} - ${format(extent.high, 'tooltip')}`\n : format(extent.high, 'tooltip'),\n targetPercent:\n row.target === undefined ? null : widthPercent(row.target, max),\n formattedTarget:\n row.target === undefined ? '' : format(row.target, 'tooltip'),\n bands: (row.ranges ?? []).map((bound, bandIndex, all) => ({\n key: `${row.id ?? index}-band-${bandIndex}`,\n widthPercent: widthPercent(bound, max),\n // Rising opacity rather than rising hue: the bands are one backdrop read as an order,\n // and a second palette behind the bars would compete with the bars themselves.\n opacity: (bandIndex + 1) / (all.length + 1),\n })),\n formattedPercent:\n row.percent !== undefined\n ? formatPercent(row.percent, 100)\n : formatPercent(span, max),\n share: this.partOfWhole() ? shareOfTotal(values, index) : '',\n segments: segmentsOf(row, (value) => format(value, 'tooltip')),\n color: row.color ?? chartColors.seriesDefault,\n };\n });\n });\n\n protected readonly accessibleName = computed(\n () =>\n this.summary() ??\n describeSeries(\n this.caption() ?? 'Chart',\n this.data().map((row) => ({\n label: row.label,\n value: barExtent(row.value).high - barExtent(row.value).low,\n })),\n (value) => this.valueFormatResolved()(value, 'tooltip'),\n this.dataTableResolved() !== 'none',\n ),\n );\n\n protected entryLabel(entry: { row: BarChartRow; formattedValue: string }) {\n return `${entry.row.label}, ${entry.formattedValue}`;\n }\n\n protected onRowKey(row: BarChartRow, event: Event): void {\n // Only the row's own key opens the row: a key pressed on a control inside it belongs to that\n // control.\n if (!this.interactive() || event.target !== event.currentTarget) {\n return;\n }\n event.preventDefault();\n this.rowClicked.emit(row);\n }\n\n protected readonly isEmpty = computed(() => this.data().length === 0);\n\n /** Placeholder bars while loading. Follows the real row count so the chart does not resize\n * when the data lands; falls back to three when `data` is still empty. */\n protected readonly skeletonRows = computed(() =>\n Array.from({ length: Math.max(this.data().length, 3) }),\n );\n}\n","<figure class=\"bar-chart\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_bar-chart-track-height)\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"rows\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"activeMark.pinned()\"\n [dsChartTooltipPinned]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n @for (entry of rows(); track entry.key; let index = $index) {\n <div\n class=\"row\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === roving.tabStop() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (animate.leave)=\"leaveMark($event)\"\n (pointerenter)=\"activeMark.enter(index, $event, '.fill')\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(entry.row, index, $event)\"\n (keydown.enter)=\"onRowKey(entry.row, $event)\"\n (keydown.space)=\"onRowKey(entry.row, $event)\">\n <span class=\"label\">\n {{ entry.row.label }}\n\n @if (entry.row.detail) {\n <span class=\"detail\">\n {{ entry.row.detail }}\n </span>\n }\n </span>\n\n <span class=\"value\">\n {{ entry.formattedValue }}\n </span>\n\n @if (showPercent()) {\n <span class=\"percent\">\n {{ entry.formattedPercent }}\n </span>\n }\n\n <span class=\"track\">\n @for (band of entry.bands; track band.key) {\n <span\n class=\"band\"\n [style.width.%]=\"band.widthPercent\"\n [style.opacity]=\"band.opacity\">\n </span>\n }\n\n @if (entry.targetPercent !== null) {\n <span\n class=\"target\"\n role=\"img\"\n [style.inset-inline-start.%]=\"entry.targetPercent\"\n [attr.aria-label]=\"'Target ' + entry.formattedTarget\">\n </span>\n }\n\n <span\n class=\"fill\"\n [style.margin-inline-start.%]=\"entry.offsetPercent\"\n [style.width.%]=\"entry.widthPercent\"\n [style.background]=\"entry.segments.length ? null : entry.color\">\n @for (part of entry.segments; track part.key) {\n <span\n class=\"segment\"\n [style.width.%]=\"part.widthPercent\"\n [style.background]=\"part.color\">\n </span>\n }\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <ds-icon\n class=\"pin-marker\"\n name=\"pin\"\n [size]=\"14\" />\n }\n </span>\n </span>\n </div>\n }\n </div>\n\n @if (dataTableResolved() !== 'none') {\n <ds-chart-data-table\n [columns]=\"dataTableColumns()\"\n [rows]=\"dataTableRows()\"\n [caption]=\"caption()\"\n [open]=\"dataTableResolved() === 'visible'\" />\n }\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEA;;;;;;;;AAQgB;AACV,SAAU,SAAS,CAAC,KAAoB,EAAA;AAC5C,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK;cACxB,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC;cACnD,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;IACzB;AACA,IAAA,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,KAAK;AAE7B,IAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAA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A,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAQd,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAf7B,SAAS;+BACE,cAAc,EAAA,UAAA,EACZ,IAAI,EAAA,OAAA,EACP;wBACP,iBAAiB;wBACjB,qBAAqB;wBACrB,aAAa;wBACb,uBAAuB;AACxB,qBAAA,EAAA,IAAA,EAGK,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,EAAA,aAAA,EACzC,iBAAiB,CAAC,QAAQ,EAAA,eAAA,EACxB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,g8IAAA,EAAA,MAAA,EAAA,CAAA,05PAAA,CAAA,EAAA;s7DAmH3C,gBAAgB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE9MtB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-bar-chart.mjs","sources":["../../../src/lib/components/bar-chart/bar-chart.math.ts","../../../src/lib/components/bar-chart/bar-chart.component.ts","../../../src/lib/components/bar-chart/bar-chart.component.html","../../../src/lib/components/bar-chart/ids-group-ltd-ids-design-system-components-bar-chart.ts"],"sourcesContent":["import type { BarChartValue } from './bar-chart.types';\n\n/** Where a row's bar starts and ends on the value axis.\n *\n * A plain number spans from zero, negative included - a reading below zero hangs from the\n * baseline rather than reaching up to it. A pair is normalised, because a bar of negative width\n * draws nothing at all and a reader who wrote the ends backwards meant the same band. A\n * non-finite end collapses the whole extent, so one bad reading draws no bar rather than a bar of\n * unknown length.\n *\n * @internal */\nexport function barExtent(value: BarChartValue): { low: number; high: number } {\n if (typeof value === 'number') {\n return Number.isFinite(value)\n ? { low: Math.min(0, value), high: Math.max(0, value) }\n : { low: 0, high: 0 };\n }\n const [first, second] = value;\n\n return Number.isFinite(first) && Number.isFinite(second)\n ? { low: Math.min(first, second), high: Math.max(first, second) }\n : { low: 0, high: 0 };\n}\n\n/** Largest finite value, or `explicitMax` when it is a usable track length. A\n * non-finite datum is skipped rather than compared: one `Infinity` row would\n * otherwise become the track length and flatten every other row to nothing. */\nexport function resolveMax(\n explicitMax: number | null,\n values: readonly number[],\n): number {\n if (explicitMax !== null && Number.isFinite(explicitMax) && explicitMax > 0) {\n return explicitMax;\n }\n const finite = values.filter((value) => Number.isFinite(value));\n\n return finite.length ? Math.max(...finite) : 0;\n}\n\n/** Track share for one row, in percent. Has no upper bound: an explicit `max`\n * below the data is the caller's statement, and `.track` clips the overflow. */\nexport function widthPercent(value: number, max: number): number {\n // Math.max(NaN, 0) is NaN, so the lower clamp cannot stand in for this test —\n // and the result is written into a style attribute, where `width: NaN%` is\n // dropped silently.\n if (!Number.isFinite(value) || !Number.isFinite(max) || max <= 0) {\n return 0;\n }\n\n return Math.max((value / max) * 100, 0);\n}\n\n/** Each segment's share of the row's track, in percent. Sized against the segments' OWN sum, never\n * the row's `value`: when the two disagree the row is a distribution that does not add up, and a\n * gap left where the difference is would draw that error as an unlabelled category.\n *\n * A set with no positive finite total has no shares to give, and returns none. */\nexport function segmentWidths(values: readonly number[]): number[] {\n const total = values\n .filter((value) => Number.isFinite(value) && value > 0)\n .reduce((sum, value) => sum + value, 0);\n if (total <= 0) {\n return [];\n }\n\n return values.map((value) =>\n Number.isFinite(value) && value > 0 ? (value / total) * 100 : 0,\n );\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n numberAttribute,\n output,\n} from '@angular/core';\nimport {\n CHART_SERIES_COLORS,\n chartColors,\n describeSeries,\n formatPercent,\n describeShare,\n shareOfTotal,\n rovingMarks,\n leaveMark,\n staggerDelay,\n chartRenderGate,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { DS_INTL } from '@ids-group-ltd/ids-design-system/core';\nimport type {\n ChartDataTable,\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport {\n barExtent,\n resolveMax,\n segmentWidths,\n widthPercent,\n} from './bar-chart.math';\nimport type { BarChartRow, BarChartSegment } from './bar-chart.types';\nimport { ChartDataTableComponent } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport type { ChartDataRow } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport { resolveChartDefaults } from '@ids-group-ltd/ids-design-system/components';\n\n/** A row's parts, ready to draw: a width, a colour and a formatted value each. Segments are\n * CATEGORIES, so they take the categorical palette in order — unlike the rows, which are one\n * series and share one colour. */\nfunction segmentsOf(\n row: BarChartRow,\n format: (value: number) => string,\n): readonly {\n key: string;\n segment: BarChartSegment;\n widthPercent: number;\n formattedValue: string;\n color: string;\n}[] {\n const parts = row.segments ?? [];\n const widths = segmentWidths(parts.map((part) => part.value));\n\n return widths.length\n ? parts.map((segment, index) => ({\n key: segment.id ?? String(index),\n segment,\n widthPercent: widths[index],\n formattedValue: format(segment.value),\n color:\n segment.color ??\n CHART_SERIES_COLORS[index % CHART_SERIES_COLORS.length],\n }))\n : [];\n}\n\n@Component({\n selector: 'ds-bar-chart',\n standalone: true,\n imports: [\n SkeletonComponent,\n ChartTooltipDirective,\n IconComponent,\n ChartDataTableComponent,\n ],\n templateUrl: './bar-chart.component.html',\n styleUrl: './bar-chart.component.scss',\n host: { '[class.framed]': \"frameResolved() === 'auto'\" },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BarChartComponent {\n protected readonly renderReady = chartRenderGate();\n\n protected readonly leaveMark = leaveMark;\n\n /** One row per bar, drawn in the order given. */\n readonly data = input.required<readonly BarChartRow[]>();\n\n /** Track length is relative to this. Null uses the largest value, so the\n * longest row always fills its track. */\n readonly max = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n\n /** Whether the chart draws its own bordered, padded box. `'auto'`, the default, draws it;\n * `'none'` leaves the chart bare, for one placed inside a card the page has already drawn.\n * Unset falls back to `DS_CONFIG.chart.frame`, then `'auto'` — whether charts live inside cards\n * is one decision per app rather than per plot. */\n readonly frame = input<ChartFrame | null>(null);\n\n /** How long the tooltip stays after the pointer leaves the mark, in milliseconds. Zero, the\n * default, takes it away at once: a panel that outlives the pointer sits over the plot the\n * reader has moved on to.\n *\n * Raise it only for a panel a reader has to REACH — one carrying a link, a figure, or anything\n * selectable — which is WCAG 1.4.13's hoverable clause. The panel is portaled to the body, so\n * crossing the gap to it at an ordinary pointer speed needs about 140. Unset falls back to\n * `DS_CONFIG.chart.tooltipLingerMs`, then 0. */\n readonly tooltipLingerMs = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n /** Printed above the plot as the chart's visible title, and reused as the annex table's\n * caption. */\n readonly caption = input<string | null>(null);\n\n /** Accessible name. Generated from the data when omitted. */\n readonly summary = input<string | null>(null);\n\n /** The label-and-value table under the plot: `'toggle'` puts it behind a disclosure,\n * `'visible'` opens it, `'none'` renders none. It is the non-visual route to the numbers, so\n * `'none'` belongs only where the same data is already in a table on the page.\n * Unset falls back to `DS_CONFIG.chart.dataTable`, then `'none'`. */\n readonly dataTable = input<ChartDataTable | null>(null);\n /** Declares that the marks are parts of one whole, which is what makes a share of their total a\n * real quantity. Off by default: a chart of visitors per stage or revenue per month sums to a\n * number nobody can point at, and \"18.6% of total\" against it is arithmetic dressed as a fact.\n * On, each mark's share appears on the tooltip's second line and in the data table. */\n readonly partOfWhole = input(false, { transform: booleanAttribute });\n\n /** Prints each row's share of `max` beside its value. */\n readonly showPercent = input(true, { transform: booleanAttribute });\n /** Draws skeleton marks in place of the data, at the same count, so the chart does not resize\n * when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n /** Shown in place of the plot when `data` is empty. Unset falls back to\n * `DS_INTL.chart.empty`. */\n readonly emptyText = input<string | null>(null);\n\n /** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,\n * because \"the request failed\" and \"there is nothing to show\" read the same to a reader and\n * mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** The message the error state prints. Unset falls back to `DS_INTL.chart.error`. */\n readonly errorText = input<string | null>(null);\n /** Formats every value the chart prints, the annex table and the generated description\n * included. Unset falls back to `DS_CONFIG.chart.valueFormat`, then `DS_CONFIG.locale` /\n * `LOCALE_ID`. */\n readonly valueFormat = input<ChartValueFormat | null>(null);\n\n private readonly defaults = resolveChartDefaults(this);\n protected readonly intl = inject(DS_INTL);\n readonly frameResolved = this.defaults.frame;\n readonly dataTableResolved = this.defaults.dataTable;\n readonly emptyTextResolved = this.defaults.emptyText;\n readonly errorTextResolved = this.defaults.errorText;\n readonly valueFormatResolved = this.defaults.valueFormat;\n\n /** Turns on the click affordance — the pointer cursor and any hover tint.\n * The click output fires whether or not this is set, so a consumer that\n * binds the output and forgets the flag still receives every click. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** The row that was clicked, or activated with Enter or Space. Fires whether or not\n * `interactive` is set. */\n readonly rowClicked = output<BarChartRow>();\n\n /** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a press\n * outside releases it. Off by default: a click is already the drill-down hook, and a mark left\n * lit after the pointer has gone needs a reader who knows why it is lit. `rowClicked` fires\n * either way — pinning is a state, not a handler. */\n readonly pinOnClick = input(false, { transform: booleanAttribute });\n\n /** Dims every OTHER mark while one is hovered or focused, so the reader's eye is held on the\n * one under the pointer. Off by default: the dimming costs the separation BETWEEN the dimmed\n * marks — measured 2026-09-13, the worst pair of three dimmed series falls from dE 14.8 at full\n * opacity to 2.1 at `--ds-chart-dim-opacity`'s default 0.3 — so it buys loudness for one mark\n * and pays for it with the rest of the chart. */\n readonly dimOthers = input(false, { transform: booleanAttribute });\n\n /** The segment to single out, by its `id` - or by its position as a string where it has none.\n * Every other segment in every row fades, the same answer `highlighted` gives on a series\n * mark. Independent of `dimOthers`, which governs what a pointer does. A row without segments\n * is unaffected. */\n readonly highlighted = input<string | null>(null);\n\n protected isSegmentDimmed(key: string): boolean {\n const highlighted = this.highlighted();\n\n return highlighted !== null && highlighted !== key;\n }\n\n /** Milliseconds between one mark's entrance and the next. `0`, the default, is no stagger at\n * all; `40` is the documented non-zero step. The total is capped, so a long series does not\n * crawl in. */\n readonly staggerMs = input(0, { transform: numberAttribute });\n\n protected markStagger(index: number): string {\n return `${staggerDelay(index, this.staggerMs())}ms`;\n }\n\n /** Whether a hovered or focused row opens a tooltip. `'axis'` is not offered — a bar\n * chart's marks ARE its categories, so an axis tooltip would repeat the item one. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n protected readonly tooltipTemplate =\n contentChild<TemplateRef<{ $implicit: ChartTooltipContext }>>(\n 'dsChartTooltip',\n );\n\n private readonly tooltipLingerResolved = this.defaults.tooltipLingerMs;\n\n protected readonly activeMark = chartActiveMark(() =>\n this.tooltipLingerResolved(),\n );\n\n protected onMarkClick(\n payload: BarChartRow,\n index: number,\n event: Event,\n ): void {\n this.rowClicked.emit(payload);\n if (this.pinOnClick()) {\n this.activeMark.pin(index, event, '.fill');\n }\n }\n protected readonly roving = rovingMarks(() => this.rows().length);\n\n protected onMarkFocus(index: number, event: FocusEvent): void {\n this.roving.focus(index);\n this.activeMark.enter(index, event, '.fill');\n }\n\n protected onMarkNavigation(event: KeyboardEvent, index: number): void {\n this.roving.navigate(\n event,\n index,\n (event.currentTarget as Element).closest('.rows'),\n );\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const entry = this.rows()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !entry) {\n return null;\n }\n\n // A segmented bar draws several readings the row label cannot name, so the row heads the\n // panel and each segment gets its own line. Repeating the label the pointer is already on\n // would tell the reader nothing.\n if (entry.segments.length) {\n const values = entry.segments.map((part) => part.segment.value);\n\n return {\n category: entry.row.label,\n entries: entry.segments.map((part, partIndex) => ({\n label: part.segment.label,\n value: part.segment.value,\n formatted: part.formattedValue,\n color: part.color,\n detail: describeShare(\n values,\n partIndex,\n this.defaults.locale,\n (share) => this.intl().chart.shareOfTotal(share),\n ),\n })),\n };\n }\n\n return {\n category: '',\n entries: [\n {\n label: entry.row.label,\n value: barExtent(entry.row.value).high,\n formatted: entry.formattedValue,\n color: entry.color,\n detail: this.partOfWhole()\n ? describeShare(\n this.data().map((row) => {\n const extent = barExtent(row.value);\n\n return extent.high - extent.low;\n }),\n this.activeMark.index(),\n this.defaults.locale,\n (share) => this.intl().chart.shareOfTotal(share),\n )\n : undefined,\n },\n ],\n };\n },\n );\n\n /** The track has to hold the far end of every bar, the target tick and the outermost band -\n * a goal above every reading is the one the chart is read for, and an axis derived from the\n * bars alone would draw it off the end. */\n protected readonly resolvedMax = computed(() =>\n resolveMax(\n this.max(),\n this.data().flatMap((row) => [\n barExtent(row.value).high,\n row.target ?? 0,\n ...(row.ranges ?? []),\n ]),\n ),\n );\n\n protected readonly dataTableColumns = computed<readonly string[]>(() =>\n this.partOfWhole()\n ? [\n this.intl().chart.labelColumn,\n this.intl().chart.valueColumn,\n this.intl().chart.shareColumn,\n ]\n : [this.intl().chart.labelColumn, this.intl().chart.valueColumn],\n );\n\n /** A row's segments follow it as nested rows: one table reads in one pass, and a segment is\n * read against the bar it belongs to rather than against the other bars. */\n protected readonly dataTableRows = computed<readonly ChartDataRow[]>(() =>\n this.rows().flatMap((entry) => [\n {\n key: `bar:${entry.key}`,\n cells: this.partOfWhole()\n ? [\n [entry.row.label, entry.row.detail].filter(Boolean).join(' - '),\n entry.formattedValue,\n entry.share,\n ]\n : [\n [entry.row.label, entry.row.detail].filter(Boolean).join(' - '),\n entry.formattedValue,\n ],\n },\n ...entry.segments.map((part) => ({\n // Both keys fall back to a positional index in their OWN scope, and flattening puts\n // them in one list - a bar and its first segment would otherwise both be \"0\".\n key: `bar:${entry.key}/${part.key}`,\n nested: true,\n cells: this.partOfWhole()\n ? [part.segment.label, part.formattedValue, '']\n : [part.segment.label, part.formattedValue],\n })),\n ]),\n );\n\n protected readonly rows = computed(() => {\n const max = this.resolvedMax();\n const format = this.valueFormatResolved();\n // The bar's LENGTH is what a share is a share of, and on a floating bar that is the span\n // between its ends rather than either end on its own.\n const values = this.data().map((row) => {\n const extent = barExtent(row.value);\n\n return extent.high - extent.low;\n });\n\n return this.data().map((row, index) => {\n const extent = barExtent(row.value);\n const span = extent.high - extent.low;\n const isRange = typeof row.value !== 'number';\n\n return {\n key: row.id ?? String(index),\n row,\n offsetPercent: widthPercent(extent.low, max),\n widthPercent: widthPercent(span, max),\n formattedValue: isRange\n ? `${format(extent.low, 'tooltip')} - ${format(extent.high, 'tooltip')}`\n : format(extent.high, 'tooltip'),\n targetPercent:\n row.target === undefined ? null : widthPercent(row.target, max),\n formattedTarget:\n row.target === undefined ? '' : format(row.target, 'tooltip'),\n bands: (row.ranges ?? []).map((bound, bandIndex, all) => ({\n key: `${row.id ?? index}-band-${bandIndex}`,\n widthPercent: widthPercent(bound, max),\n // Rising opacity rather than rising hue: the bands are one backdrop read as an order,\n // and a second palette behind the bars would compete with the bars themselves.\n opacity: (bandIndex + 1) / (all.length + 1),\n })),\n formattedPercent:\n row.percent !== undefined\n ? formatPercent(row.percent, 100, this.defaults.locale)\n : formatPercent(span, max, this.defaults.locale),\n share: this.partOfWhole()\n ? shareOfTotal(values, index, this.defaults.locale)\n : '',\n segments: segmentsOf(row, (value) => format(value, 'tooltip')),\n color: row.color ?? chartColors.seriesDefault,\n };\n });\n });\n\n protected readonly accessibleName = computed(\n () =>\n this.summary() ??\n describeSeries(\n this.intl().chart,\n this.caption() ?? this.intl().chart.title,\n this.data().map((row) => ({\n label: row.label,\n value: barExtent(row.value).high - barExtent(row.value).low,\n })),\n (value) => this.valueFormatResolved()(value, 'tooltip'),\n this.dataTableResolved() !== 'none',\n ),\n );\n\n protected entryLabel(entry: { row: BarChartRow; formattedValue: string }) {\n return `${entry.row.label}, ${entry.formattedValue}`;\n }\n\n protected onRowKey(row: BarChartRow, event: Event): void {\n // Only the row's own key opens the row: a key pressed on a control inside it belongs to that\n // control.\n if (!this.interactive() || event.target !== event.currentTarget) {\n return;\n }\n event.preventDefault();\n this.rowClicked.emit(row);\n }\n\n protected readonly isEmpty = computed(() => this.data().length === 0);\n\n /** Placeholder bars while loading. Follows the real row count so the chart does not resize\n * when the data lands; falls back to three when `data` is still empty. */\n protected readonly skeletonRows = computed(() =>\n Array.from({ length: Math.max(this.data().length, 3) }),\n );\n}\n","<figure class=\"bar-chart\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n {{ intl().chart.unpin }}\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading() || !renderReady()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_bar-chart-track-height)\" [shimmer]=\"loading()\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"rows\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPinned]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n @for (entry of rows(); track entry.key; let index = $index) {\n <div\n class=\"row\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === roving.tabStop() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (animate.leave)=\"leaveMark($event)\"\n (pointerenter)=\"activeMark.enter(index, $event, '.fill')\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(entry.row, index, $event)\"\n (keydown.enter)=\"onRowKey(entry.row, $event)\"\n (keydown.space)=\"onRowKey(entry.row, $event)\">\n <span class=\"label\">\n {{ entry.row.label }}\n\n @if (entry.row.detail) {\n <span class=\"detail\">\n {{ entry.row.detail }}\n </span>\n }\n </span>\n\n <span class=\"value\">\n {{ entry.formattedValue }}\n </span>\n\n @if (showPercent()) {\n <span class=\"percent\">\n {{ entry.formattedPercent }}\n </span>\n }\n\n <span class=\"track\">\n @for (band of entry.bands; track band.key) {\n <span\n class=\"band\"\n [style.width.%]=\"band.widthPercent\"\n [style.opacity]=\"band.opacity\">\n </span>\n }\n\n @if (entry.targetPercent !== null) {\n <span\n class=\"target\"\n role=\"img\"\n [style.inset-inline-start.%]=\"entry.targetPercent\"\n [attr.aria-label]=\"intl().chart.target(entry.formattedTarget)\">\n </span>\n }\n\n <span\n class=\"fill\"\n [style.margin-inline-start.%]=\"entry.offsetPercent\"\n [style.width.%]=\"entry.widthPercent\"\n [style.background]=\"entry.segments.length ? null : entry.color\">\n @for (part of entry.segments; track part.key) {\n <span\n class=\"segment\"\n [class.is-dimmed]=\"isSegmentDimmed(part.key)\"\n [style.width.%]=\"part.widthPercent\"\n [style.background]=\"part.color\">\n </span>\n }\n\n @if (activeMark.pinned() && activeMark.index() === index) {\n <ds-icon\n class=\"pin-marker\"\n name=\"pin\"\n [size]=\"14\" />\n }\n </span>\n </span>\n </div>\n }\n </div>\n\n @if (dataTableResolved() !== 'none') {\n <ds-chart-data-table\n [columns]=\"dataTableColumns()\"\n [rows]=\"dataTableRows()\"\n [caption]=\"caption()\"\n [open]=\"dataTableResolved() === 'visible'\" />\n }\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAEA;;;;;;;;AAQgB;AACV,SAAU,SAAS,CAAC,KAAoB,EAAA;AAC5C,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK;cACxB,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC;cACnD,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;IACzB;AACA,IAAA,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,KAAK;AAE7B,IAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM;UACnD,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;UAC7D,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;AACzB;AAEA;;AAEgF;AAC1E,SAAU,UAAU,CACxB,WAA0B,EAC1B,MAAyB,EAAA;AAEzB,IAAA,IAAI,WAAW,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,WAAW,GAAG,CAAC,EAAE;AAC3E,QAAA,OAAO,WAAW;I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AAA;4hEAiI3C,gBAAgB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE/NtB;;AAEG;;;;"}
|
|
@@ -54,8 +54,8 @@ class BottomSheetComponent {
|
|
|
54
54
|
closeFallbackTimer = null;
|
|
55
55
|
constructor() {
|
|
56
56
|
// open → DOM lifecycle. Opening renders immediately; closing keeps the
|
|
57
|
-
// sheet mounted and flips `closing` so the leave animation can play
|
|
58
|
-
// teardown
|
|
57
|
+
// sheet mounted and flips `closing` so the leave animation can play
|
|
58
|
+
// (teardown in onLeaveEnd, or the timer below).
|
|
59
59
|
effect(() => {
|
|
60
60
|
const isOpen = this.open();
|
|
61
61
|
if (isOpen) {
|
|
@@ -69,8 +69,9 @@ class BottomSheetComponent {
|
|
|
69
69
|
}
|
|
70
70
|
else if (this.wasOpen) {
|
|
71
71
|
this.closing.set(true);
|
|
72
|
-
// Chrome freezes CSS animations on a
|
|
73
|
-
//
|
|
72
|
+
// Two cases never deliver animationend: Chrome freezes CSS animations on a
|
|
73
|
+
// backgrounded tab, and a 0s reduced-motion leave finishes before a listener
|
|
74
|
+
// hears it. This timer is the teardown guarantee, not belt-and-braces.
|
|
74
75
|
clearTimeout(this.closeFallbackTimer ?? undefined);
|
|
75
76
|
this.closeFallbackTimer = setTimeout(() => this.finishClose(), 300);
|
|
76
77
|
}
|
|
@@ -189,11 +190,11 @@ class BottomSheetComponent {
|
|
|
189
190
|
this.activeSnapIndex.set(nearestIndex);
|
|
190
191
|
}
|
|
191
192
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: BottomSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
192
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: BottomSheetComponent, isStandalone: true, selector: "ds-bottom-sheet", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, snapPoints: { classPropertyName: "snapPoints", publicName: "snapPoints", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", closed: "closed" }, host: { properties: { "attr.title": "null" } }, viewQueries: [{ propertyName: "sheetRef", first: true, predicate: ["sheet"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (rendered()) {\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- backdrop; keyboard dismissal is (keydown.escape) on this element, a backdrop isn't a tabbable control -->\n <div\n class=\"sheet-overlay\"\n [class.closing]=\"closing()\"\n (pointerdown)=\"backdropPress.down($event)\"\n (pointerup)=\"onBackdropRelease($event)\"\n (keydown.escape)=\"onEscape()\">\n <div\n #sheet\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n class=\"sheet\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n [class.dragging]=\"dragOffset() !== null\"\n [class.closing]=\"closing()\"\n [class.snapping]=\"snapPoints().length > 0 && dragOffset() === null\"\n [style.transform]=\"\n dragOffset() ? 'translateY(' + dragOffset() + 'px)' : null\n \"\n [style.height]=\"snapHeight()\"\n [style.maxHeight]=\"snapHeight() ? snapHeight() : null\"\n (animationend)=\"onLeaveEnd($event)\">\n <div\n class=\"grab\"\n (pointerdown)=\"onGrabStart($event)\"\n (pointermove)=\"onGrabMove($event)\"\n (pointerup)=\"onGrabEnd()\"\n (pointercancel)=\"onGrabEnd()\">\n <div class=\"sheet-handle\"></div>\n </div>\n\n @if (title()) {\n <h3\n class=\"sheet-title\"\n [id]=\"titleId\">\n {{ title() }}\n </h3>\n }\n\n <div class=\"sheet-body\">\n <ng-content />\n </div>\n\n <div class=\"sheet-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n </div>\n}\n", styles: [":host{--_bottom-sheet-max-width: var(--ds-bottom-sheet-max-width, 480px);--_bottom-sheet-max-height: var(--ds-bottom-sheet-max-height, 80%);--_bottom-sheet-radius: var(--ds-bottom-sheet-radius, var(--ds-radius-panel));--_bottom-sheet-bg-color: var(--ds-bottom-sheet-bg-color, var(--surface-default));--_bottom-sheet-scrim-color: var(--ds-bottom-sheet-scrim-color, var(--surface-scrim));--_bottom-sheet-title-text-color: var(--ds-bottom-sheet-title-text-color, var(--text-primary));--_bottom-sheet-enter-keyframes: var(--ds-bottom-sheet-enter-keyframes, ds-slide-edge-in);--_bottom-sheet-leave-keyframes: var(--ds-bottom-sheet-leave-keyframes, ds-slide-edge-out);--_bottom-sheet-enter-duration: var(--ds-bottom-sheet-enter-duration, var(--ds-motion-enter-surface-duration));--_bottom-sheet-enter-easing: var(--ds-bottom-sheet-enter-easing, var(--ds-motion-enter-surface-easing));--_bottom-sheet-leave-duration: var(--ds-bottom-sheet-leave-duration, var(--ds-motion-exit-large-duration));--_bottom-sheet-leave-easing: var(--ds-bottom-sheet-leave-easing, var(--ds-motion-exit-large-easing));--_bottom-sheet-scrim-enter-duration: var(--ds-bottom-sheet-enter-duration, var(--ds-motion-enter-panel-duration));--_bottom-sheet-scrim-leave-duration: var(--ds-bottom-sheet-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-bottom-sheet-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_bottom-sheet-enter-duration: 0ms;--_bottom-sheet-leave-duration: 0ms;--_bottom-sheet-scrim-enter-duration: 0ms;--_bottom-sheet-scrim-leave-duration: 0ms}}.sheet-overlay{position:fixed;inset:0;z-index:var(--layer-modal);background:var(--_bottom-sheet-scrim-color);display:flex;flex-direction:column;justify-content:flex-end;overflow:clip;animation-name:ds-fade-in;animation-duration:var(--_bottom-sheet-scrim-enter-duration);animation-timing-function:var(--_bottom-sheet-enter-easing)}.sheet-overlay.closing{animation-name:ds-fade-out;animation-duration:var(--_bottom-sheet-scrim-leave-duration);animation-timing-function:var(--_bottom-sheet-leave-easing);animation-fill-mode:forwards}.sheet{--_ds-enter-y: 100%;position:relative;width:min(100%,var(--_bottom-sheet-max-width));margin-inline:auto;background:var(--_bottom-sheet-bg-color);border-radius:var(--_bottom-sheet-radius) var(--_bottom-sheet-radius) 0 0;padding:0 var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom,0px));animation-name:var(--_bottom-sheet-enter-keyframes);animation-duration:var(--_bottom-sheet-enter-duration);animation-timing-function:var(--_bottom-sheet-enter-easing);max-height:var(--_bottom-sheet-max-height);display:flex;flex-direction:column;transition:transform var(--duration-base) var(--ease-decelerate)}.sheet.dragging{transition:none}.sheet.snapping{transition:transform var(--duration-base) var(--ease-decelerate),height var(--duration-base) var(--ease-decelerate)}@media(prefers-reduced-motion:reduce){.sheet.snapping{transition:none}}.sheet.closing{animation-name:var(--_bottom-sheet-leave-keyframes);animation-duration:var(--_bottom-sheet-leave-duration);animation-timing-function:var(--_bottom-sheet-leave-easing);animation-fill-mode:forwards}.grab{padding:var(--space-3) 0;margin:0 calc(var(--space-4) * -1);cursor:grab;touch-action:none}.sheet-handle{width:var(--bottom-sheet-handle-w);height:var(--bottom-sheet-handle-h);background:var(--border-strong);border-radius:var(--radius-pill);margin:0 auto}.sheet-title{font:var(--font-weight-semibold) var(--font-size-l)/var(--line-height-snug) var(--font-sans);color:var(--_bottom-sheet-title-text-color);margin:0 0 var(--space-3)}.sheet-body{display:flex;flex-direction:column;gap:var(--space-2);overflow-y:auto;min-height:0;padding:var(--space-1);margin:calc(var(--space-1) * -1)}.sheet-actions{display:flex;flex-direction:column;gap:var(--space-2)}.sheet-actions:not(:empty){margin-top:var(--space-3)}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
193
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: BottomSheetComponent, isStandalone: true, selector: "ds-bottom-sheet", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, snapPoints: { classPropertyName: "snapPoints", publicName: "snapPoints", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", closed: "closed" }, host: { properties: { "attr.title": "null" } }, viewQueries: [{ propertyName: "sheetRef", first: true, predicate: ["sheet"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (rendered()) {\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- backdrop; keyboard dismissal is (keydown.escape) on this element, a backdrop isn't a tabbable control -->\n <div\n class=\"sheet-overlay\"\n [class.closing]=\"closing()\"\n (pointerdown)=\"backdropPress.down($event)\"\n (pointerup)=\"onBackdropRelease($event)\"\n (keydown.escape)=\"onEscape()\">\n <div\n #sheet\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n class=\"sheet\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n [class.dragging]=\"dragOffset() !== null\"\n [class.closing]=\"closing()\"\n [class.snapping]=\"snapPoints().length > 0 && dragOffset() === null\"\n [style.transform]=\"\n dragOffset() ? 'translateY(' + dragOffset() + 'px)' : null\n \"\n [style.height]=\"snapHeight()\"\n [style.maxHeight]=\"snapHeight() ? snapHeight() : null\"\n (animationend)=\"onLeaveEnd($event)\">\n <div\n class=\"grab\"\n (pointerdown)=\"onGrabStart($event)\"\n (pointermove)=\"onGrabMove($event)\"\n (pointerup)=\"onGrabEnd()\"\n (pointercancel)=\"onGrabEnd()\">\n <div class=\"sheet-handle\"></div>\n </div>\n\n @if (title()) {\n <h3\n class=\"sheet-title\"\n [id]=\"titleId\">\n {{ title() }}\n </h3>\n }\n\n <div class=\"sheet-body\">\n <ng-content />\n </div>\n\n <div class=\"sheet-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n </div>\n}\n", styles: [":host{--_bottom-sheet-max-width: var(--ds-bottom-sheet-max-width, 480px);--_bottom-sheet-max-height: var(--ds-bottom-sheet-max-height, 80%);--_bottom-sheet-radius: var(--ds-bottom-sheet-radius, var(--ds-radius-panel));--_bottom-sheet-bg-color: var(--ds-bottom-sheet-bg-color, var(--surface-default));--_bottom-sheet-scrim-color: var(--ds-bottom-sheet-scrim-color, var(--surface-scrim));--_bottom-sheet-title-text-color: var(--ds-bottom-sheet-title-text-color, var(--text-primary));--_bottom-sheet-enter-keyframes: var(--ds-bottom-sheet-enter-keyframes, ds-slide-edge-in);--_bottom-sheet-leave-keyframes: var(--ds-bottom-sheet-leave-keyframes, ds-slide-edge-out);--_bottom-sheet-enter-duration: var(--ds-bottom-sheet-enter-duration, var(--ds-motion-enter-surface-duration));--_bottom-sheet-enter-easing: var(--ds-bottom-sheet-enter-easing, var(--ds-motion-enter-surface-easing));--_bottom-sheet-leave-duration: var(--ds-bottom-sheet-leave-duration, var(--ds-motion-exit-large-duration));--_bottom-sheet-leave-easing: var(--ds-bottom-sheet-leave-easing, var(--ds-motion-exit-large-easing));--_bottom-sheet-scrim-enter-duration: var(--ds-bottom-sheet-enter-duration, var(--ds-motion-enter-panel-duration));--_bottom-sheet-scrim-leave-duration: var(--ds-bottom-sheet-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-bottom-sheet-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_bottom-sheet-enter-duration: 0ms;--_bottom-sheet-leave-duration: 0ms;--_bottom-sheet-scrim-enter-duration: 0ms;--_bottom-sheet-scrim-leave-duration: 0ms}}.sheet-overlay{position:fixed;inset:0;z-index:var(--layer-modal);background:var(--_bottom-sheet-scrim-color);display:flex;flex-direction:column;justify-content:flex-end;overflow:clip;animation-name:ds-fade-in;animation-duration:var(--_bottom-sheet-scrim-enter-duration);animation-timing-function:var(--_bottom-sheet-enter-easing)}.sheet-overlay.closing{animation-name:ds-fade-out;animation-duration:var(--_bottom-sheet-scrim-leave-duration);animation-timing-function:var(--_bottom-sheet-leave-easing);animation-fill-mode:forwards;pointer-events:none}.sheet{--_ds-enter-y: 100%;position:relative;width:min(100%,var(--_bottom-sheet-max-width));margin-inline:auto;background:var(--_bottom-sheet-bg-color);border-radius:var(--_bottom-sheet-radius) var(--_bottom-sheet-radius) 0 0;padding:0 var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom,0px));animation-name:var(--_bottom-sheet-enter-keyframes);animation-duration:var(--_bottom-sheet-enter-duration);animation-timing-function:var(--_bottom-sheet-enter-easing);max-height:var(--_bottom-sheet-max-height);display:flex;flex-direction:column;transition:transform var(--duration-base) var(--ease-decelerate)}.sheet.dragging{transition:none}.sheet.snapping{transition:transform var(--duration-base) var(--ease-decelerate),height var(--duration-base) var(--ease-decelerate)}@media(prefers-reduced-motion:reduce){.sheet.snapping{transition:none}}.sheet.closing{animation-name:var(--_bottom-sheet-leave-keyframes);animation-duration:var(--_bottom-sheet-leave-duration);animation-timing-function:var(--_bottom-sheet-leave-easing);animation-fill-mode:forwards}.grab{padding:var(--space-3) 0;margin:0 calc(var(--space-4) * -1);cursor:grab;touch-action:none}.sheet-handle{width:var(--bottom-sheet-handle-w);height:var(--bottom-sheet-handle-h);background:var(--border-strong);border-radius:var(--radius-pill);margin:0 auto}.sheet-title{font:var(--font-weight-semibold) var(--font-size-l)/var(--line-height-snug) var(--font-sans);color:var(--_bottom-sheet-title-text-color);margin:0 0 var(--space-3)}.sheet-body{display:flex;flex-direction:column;gap:var(--space-2);overflow-y:auto;min-height:0;padding:var(--space-1);margin:calc(var(--space-1) * -1)}.sheet-actions{display:flex;flex-direction:column;gap:var(--space-2)}.sheet-actions:not(:empty){margin-top:var(--space-3)}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
193
194
|
}
|
|
194
195
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: BottomSheetComponent, decorators: [{
|
|
195
196
|
type: Component,
|
|
196
|
-
args: [{ selector: 'ds-bottom-sheet', standalone: true, imports: [A11yModule], host: { '[attr.title]': 'null' }, encapsulation: ViewEncapsulation.Emulated, template: "@if (rendered()) {\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- backdrop; keyboard dismissal is (keydown.escape) on this element, a backdrop isn't a tabbable control -->\n <div\n class=\"sheet-overlay\"\n [class.closing]=\"closing()\"\n (pointerdown)=\"backdropPress.down($event)\"\n (pointerup)=\"onBackdropRelease($event)\"\n (keydown.escape)=\"onEscape()\">\n <div\n #sheet\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n class=\"sheet\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n [class.dragging]=\"dragOffset() !== null\"\n [class.closing]=\"closing()\"\n [class.snapping]=\"snapPoints().length > 0 && dragOffset() === null\"\n [style.transform]=\"\n dragOffset() ? 'translateY(' + dragOffset() + 'px)' : null\n \"\n [style.height]=\"snapHeight()\"\n [style.maxHeight]=\"snapHeight() ? snapHeight() : null\"\n (animationend)=\"onLeaveEnd($event)\">\n <div\n class=\"grab\"\n (pointerdown)=\"onGrabStart($event)\"\n (pointermove)=\"onGrabMove($event)\"\n (pointerup)=\"onGrabEnd()\"\n (pointercancel)=\"onGrabEnd()\">\n <div class=\"sheet-handle\"></div>\n </div>\n\n @if (title()) {\n <h3\n class=\"sheet-title\"\n [id]=\"titleId\">\n {{ title() }}\n </h3>\n }\n\n <div class=\"sheet-body\">\n <ng-content />\n </div>\n\n <div class=\"sheet-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n </div>\n}\n", styles: [":host{--_bottom-sheet-max-width: var(--ds-bottom-sheet-max-width, 480px);--_bottom-sheet-max-height: var(--ds-bottom-sheet-max-height, 80%);--_bottom-sheet-radius: var(--ds-bottom-sheet-radius, var(--ds-radius-panel));--_bottom-sheet-bg-color: var(--ds-bottom-sheet-bg-color, var(--surface-default));--_bottom-sheet-scrim-color: var(--ds-bottom-sheet-scrim-color, var(--surface-scrim));--_bottom-sheet-title-text-color: var(--ds-bottom-sheet-title-text-color, var(--text-primary));--_bottom-sheet-enter-keyframes: var(--ds-bottom-sheet-enter-keyframes, ds-slide-edge-in);--_bottom-sheet-leave-keyframes: var(--ds-bottom-sheet-leave-keyframes, ds-slide-edge-out);--_bottom-sheet-enter-duration: var(--ds-bottom-sheet-enter-duration, var(--ds-motion-enter-surface-duration));--_bottom-sheet-enter-easing: var(--ds-bottom-sheet-enter-easing, var(--ds-motion-enter-surface-easing));--_bottom-sheet-leave-duration: var(--ds-bottom-sheet-leave-duration, var(--ds-motion-exit-large-duration));--_bottom-sheet-leave-easing: var(--ds-bottom-sheet-leave-easing, var(--ds-motion-exit-large-easing));--_bottom-sheet-scrim-enter-duration: var(--ds-bottom-sheet-enter-duration, var(--ds-motion-enter-panel-duration));--_bottom-sheet-scrim-leave-duration: var(--ds-bottom-sheet-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-bottom-sheet-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_bottom-sheet-enter-duration: 0ms;--_bottom-sheet-leave-duration: 0ms;--_bottom-sheet-scrim-enter-duration: 0ms;--_bottom-sheet-scrim-leave-duration: 0ms}}.sheet-overlay{position:fixed;inset:0;z-index:var(--layer-modal);background:var(--_bottom-sheet-scrim-color);display:flex;flex-direction:column;justify-content:flex-end;overflow:clip;animation-name:ds-fade-in;animation-duration:var(--_bottom-sheet-scrim-enter-duration);animation-timing-function:var(--_bottom-sheet-enter-easing)}.sheet-overlay.closing{animation-name:ds-fade-out;animation-duration:var(--_bottom-sheet-scrim-leave-duration);animation-timing-function:var(--_bottom-sheet-leave-easing);animation-fill-mode:forwards}.sheet{--_ds-enter-y: 100%;position:relative;width:min(100%,var(--_bottom-sheet-max-width));margin-inline:auto;background:var(--_bottom-sheet-bg-color);border-radius:var(--_bottom-sheet-radius) var(--_bottom-sheet-radius) 0 0;padding:0 var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom,0px));animation-name:var(--_bottom-sheet-enter-keyframes);animation-duration:var(--_bottom-sheet-enter-duration);animation-timing-function:var(--_bottom-sheet-enter-easing);max-height:var(--_bottom-sheet-max-height);display:flex;flex-direction:column;transition:transform var(--duration-base) var(--ease-decelerate)}.sheet.dragging{transition:none}.sheet.snapping{transition:transform var(--duration-base) var(--ease-decelerate),height var(--duration-base) var(--ease-decelerate)}@media(prefers-reduced-motion:reduce){.sheet.snapping{transition:none}}.sheet.closing{animation-name:var(--_bottom-sheet-leave-keyframes);animation-duration:var(--_bottom-sheet-leave-duration);animation-timing-function:var(--_bottom-sheet-leave-easing);animation-fill-mode:forwards}.grab{padding:var(--space-3) 0;margin:0 calc(var(--space-4) * -1);cursor:grab;touch-action:none}.sheet-handle{width:var(--bottom-sheet-handle-w);height:var(--bottom-sheet-handle-h);background:var(--border-strong);border-radius:var(--radius-pill);margin:0 auto}.sheet-title{font:var(--font-weight-semibold) var(--font-size-l)/var(--line-height-snug) var(--font-sans);color:var(--_bottom-sheet-title-text-color);margin:0 0 var(--space-3)}.sheet-body{display:flex;flex-direction:column;gap:var(--space-2);overflow-y:auto;min-height:0;padding:var(--space-1);margin:calc(var(--space-1) * -1)}.sheet-actions{display:flex;flex-direction:column;gap:var(--space-2)}.sheet-actions:not(:empty){margin-top:var(--space-3)}\n"] }]
|
|
197
|
+
args: [{ selector: 'ds-bottom-sheet', standalone: true, imports: [A11yModule], host: { '[attr.title]': 'null' }, encapsulation: ViewEncapsulation.Emulated, template: "@if (rendered()) {\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- backdrop; keyboard dismissal is (keydown.escape) on this element, a backdrop isn't a tabbable control -->\n <div\n class=\"sheet-overlay\"\n [class.closing]=\"closing()\"\n (pointerdown)=\"backdropPress.down($event)\"\n (pointerup)=\"onBackdropRelease($event)\"\n (keydown.escape)=\"onEscape()\">\n <div\n #sheet\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n class=\"sheet\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n [class.dragging]=\"dragOffset() !== null\"\n [class.closing]=\"closing()\"\n [class.snapping]=\"snapPoints().length > 0 && dragOffset() === null\"\n [style.transform]=\"\n dragOffset() ? 'translateY(' + dragOffset() + 'px)' : null\n \"\n [style.height]=\"snapHeight()\"\n [style.maxHeight]=\"snapHeight() ? snapHeight() : null\"\n (animationend)=\"onLeaveEnd($event)\">\n <div\n class=\"grab\"\n (pointerdown)=\"onGrabStart($event)\"\n (pointermove)=\"onGrabMove($event)\"\n (pointerup)=\"onGrabEnd()\"\n (pointercancel)=\"onGrabEnd()\">\n <div class=\"sheet-handle\"></div>\n </div>\n\n @if (title()) {\n <h3\n class=\"sheet-title\"\n [id]=\"titleId\">\n {{ title() }}\n </h3>\n }\n\n <div class=\"sheet-body\">\n <ng-content />\n </div>\n\n <div class=\"sheet-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n </div>\n}\n", styles: [":host{--_bottom-sheet-max-width: var(--ds-bottom-sheet-max-width, 480px);--_bottom-sheet-max-height: var(--ds-bottom-sheet-max-height, 80%);--_bottom-sheet-radius: var(--ds-bottom-sheet-radius, var(--ds-radius-panel));--_bottom-sheet-bg-color: var(--ds-bottom-sheet-bg-color, var(--surface-default));--_bottom-sheet-scrim-color: var(--ds-bottom-sheet-scrim-color, var(--surface-scrim));--_bottom-sheet-title-text-color: var(--ds-bottom-sheet-title-text-color, var(--text-primary));--_bottom-sheet-enter-keyframes: var(--ds-bottom-sheet-enter-keyframes, ds-slide-edge-in);--_bottom-sheet-leave-keyframes: var(--ds-bottom-sheet-leave-keyframes, ds-slide-edge-out);--_bottom-sheet-enter-duration: var(--ds-bottom-sheet-enter-duration, var(--ds-motion-enter-surface-duration));--_bottom-sheet-enter-easing: var(--ds-bottom-sheet-enter-easing, var(--ds-motion-enter-surface-easing));--_bottom-sheet-leave-duration: var(--ds-bottom-sheet-leave-duration, var(--ds-motion-exit-large-duration));--_bottom-sheet-leave-easing: var(--ds-bottom-sheet-leave-easing, var(--ds-motion-exit-large-easing));--_bottom-sheet-scrim-enter-duration: var(--ds-bottom-sheet-enter-duration, var(--ds-motion-enter-panel-duration));--_bottom-sheet-scrim-leave-duration: var(--ds-bottom-sheet-leave-duration, var(--ds-motion-exit-duration));--_ds-enter-scale: var(--ds-bottom-sheet-enter-scale, .96);display:contents}@media(prefers-reduced-motion:reduce){:host{--_bottom-sheet-enter-duration: 0ms;--_bottom-sheet-leave-duration: 0ms;--_bottom-sheet-scrim-enter-duration: 0ms;--_bottom-sheet-scrim-leave-duration: 0ms}}.sheet-overlay{position:fixed;inset:0;z-index:var(--layer-modal);background:var(--_bottom-sheet-scrim-color);display:flex;flex-direction:column;justify-content:flex-end;overflow:clip;animation-name:ds-fade-in;animation-duration:var(--_bottom-sheet-scrim-enter-duration);animation-timing-function:var(--_bottom-sheet-enter-easing)}.sheet-overlay.closing{animation-name:ds-fade-out;animation-duration:var(--_bottom-sheet-scrim-leave-duration);animation-timing-function:var(--_bottom-sheet-leave-easing);animation-fill-mode:forwards;pointer-events:none}.sheet{--_ds-enter-y: 100%;position:relative;width:min(100%,var(--_bottom-sheet-max-width));margin-inline:auto;background:var(--_bottom-sheet-bg-color);border-radius:var(--_bottom-sheet-radius) var(--_bottom-sheet-radius) 0 0;padding:0 var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom,0px));animation-name:var(--_bottom-sheet-enter-keyframes);animation-duration:var(--_bottom-sheet-enter-duration);animation-timing-function:var(--_bottom-sheet-enter-easing);max-height:var(--_bottom-sheet-max-height);display:flex;flex-direction:column;transition:transform var(--duration-base) var(--ease-decelerate)}.sheet.dragging{transition:none}.sheet.snapping{transition:transform var(--duration-base) var(--ease-decelerate),height var(--duration-base) var(--ease-decelerate)}@media(prefers-reduced-motion:reduce){.sheet.snapping{transition:none}}.sheet.closing{animation-name:var(--_bottom-sheet-leave-keyframes);animation-duration:var(--_bottom-sheet-leave-duration);animation-timing-function:var(--_bottom-sheet-leave-easing);animation-fill-mode:forwards}.grab{padding:var(--space-3) 0;margin:0 calc(var(--space-4) * -1);cursor:grab;touch-action:none}.sheet-handle{width:var(--bottom-sheet-handle-w);height:var(--bottom-sheet-handle-h);background:var(--border-strong);border-radius:var(--radius-pill);margin:0 auto}.sheet-title{font:var(--font-weight-semibold) var(--font-size-l)/var(--line-height-snug) var(--font-sans);color:var(--_bottom-sheet-title-text-color);margin:0 0 var(--space-3)}.sheet-body{display:flex;flex-direction:column;gap:var(--space-2);overflow-y:auto;min-height:0;padding:var(--space-1);margin:calc(var(--space-1) * -1)}.sheet-actions{display:flex;flex-direction:column;gap:var(--space-2)}.sheet-actions:not(:empty){margin-top:var(--space-3)}\n"] }]
|
|
197
198
|
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], closed: [{ type: i0.Output, args: ["closed"] }], snapPoints: [{ type: i0.Input, args: [{ isSignal: true, alias: "snapPoints", required: false }] }], sheetRef: [{ type: i0.ViewChild, args: ['sheet', { isSignal: true }] }] } });
|
|
198
199
|
|
|
199
200
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-bottom-sheet.mjs","sources":["../../../src/lib/components/bottom-sheet/bottom-sheet.component.ts","../../../src/lib/components/bottom-sheet/bottom-sheet.component.html","../../../src/lib/components/bottom-sheet/ids-group-ltd-ids-design-system-components-bottom-sheet.ts"],"sourcesContent":["import {\n Component,\n DOCUMENT,\n ElementRef,\n type OnDestroy,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { BodyScrollLockService } from '@ids-group-ltd/ids-design-system/overlay';\nimport { backdropDismiss } from '@ids-group-ltd/ids-design-system/core';\n\nlet nextId = 0;\n\n/** Bottom-anchored sheet — the mobile sibling of ds-drawer. Closes on scrim\n * tap, Escape, or a downward drag on the grab strip. While open it locks\n * body scroll. On wide viewports the panel is capped by\n * --ds-bottom-sheet-max-width and centred; prefer ds-modal / ds-drawer for\n * desktop-first layouts. position: fixed resolves against the nearest\n * ancestor containing block, so framed hosts contain the sheet. */\n@Component({\n selector: 'ds-bottom-sheet',\n standalone: true,\n imports: [A11yModule],\n templateUrl: './bottom-sheet.component.html',\n styleUrl: './bottom-sheet.component.scss',\n // A static `title=\"…\"` feeding the input below ALSO stays in the DOM as the global attribute,\n // which makes the host a native browser tooltip over everything inside it.\n host: { '[attr.title]': 'null' },\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class BottomSheetComponent implements OnDestroy {\n /** Open state, two-way bound. */\n readonly open = model<boolean>(false);\n /** Sheet title, shown in the header and used for `aria-labelledby`. */\n readonly title = input.required<string>();\n /** Fires once the close (leave) animation finishes. */\n readonly closed = output<void>();\n\n protected readonly titleId = `ds-bottom-sheet-title-${++nextId}`;\n /**\n * Snap-point heights as fractions of viewport height (0–1), ascending.\n * e.g. [0.4, 0.9]. When provided the sheet opens at the first snap point;\n * dragging snaps to the nearest point; dragging below the lowest closes.\n * When empty (default) the original single-height behavior is preserved.\n */\n readonly snapPoints = input<readonly number[]>([]);\n\n private readonly doc = inject(DOCUMENT);\n private readonly scrollLock = inject(BodyScrollLockService);\n private readonly sheetRef = viewChild<ElementRef<HTMLElement>>('sheet');\n\n protected readonly dragOffset = signal<number | null>(null);\n /** Sheet is in the DOM (kept true through the leave animation). */\n protected readonly rendered = signal(false);\n /** Playing the slide-down + scrim-fade leave animation. */\n protected readonly closing = signal(false);\n /** Index of the currently active snap point (only used when snapPoints is non-empty). */\n protected readonly activeSnapIndex = signal(0);\n\n /** CSS height string derived from the active snap point, or null when snapPoints is empty. */\n protected readonly snapHeight = computed(() => {\n const points = this.snapPoints();\n if (points.length === 0) {\n return null;\n }\n const index = Math.min(this.activeSnapIndex(), points.length - 1);\n\n return `${points[index] * 100}vh`;\n });\n\n private dragStartY = 0;\n private lastMoveY = 0;\n private lastMoveTime = 0;\n private velocity = 0;\n private wasOpen = false;\n private closeFallbackTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n // open → DOM lifecycle. Opening renders immediately; closing keeps the\n // sheet mounted and flips `closing` so the leave animation can play —\n // teardown happens in onLeaveEnd() once animationend fires.\n effect(() => {\n const isOpen = this.open();\n if (isOpen) {\n this.closing.set(false);\n this.rendered.set(true);\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = null;\n if (this.snapPoints().length > 0) {\n this.activeSnapIndex.set(0);\n }\n } else if (this.wasOpen) {\n this.closing.set(true);\n // Chrome freezes CSS animations on a backgrounded tab, so animationend\n // may never fire — this synthetic fallback guarantees teardown anyway.\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = setTimeout(() => this.finishClose(), 300);\n }\n this.wasOpen = isOpen;\n });\n\n // Ref-counted body-scroll lock, shared with modal/drawer so stacked\n // overlays don't unlock each other. The cleanup fires on the rendered→false\n // transition and on destroy, keeping lock/unlock paired.\n effect((onCleanup) => {\n if (!this.rendered()) {\n return;\n }\n this.scrollLock.lock();\n onCleanup(() => this.scrollLock.unlock());\n });\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = null;\n }\n\n protected close(): void {\n this.dragOffset.set(null);\n this.open.set(false);\n }\n\n protected onLeaveEnd(event: AnimationEvent): void {\n // The animated element is the one with the handler, so its OWN animationend is\n // the signal; anything bubbling from inside is not. This replaces matching the\n // keyframes NAME, which is what made the exit un-overridable.\n if (event.target !== event.currentTarget) {\n return;\n }\n this.finishClose();\n }\n\n private finishClose(): void {\n if (!this.closing()) {\n return;\n }\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = null;\n this.closing.set(false);\n this.rendered.set(false);\n this.closed.emit();\n }\n\n protected onEscape(): void {\n if (this.open()) {\n this.close();\n }\n }\n\n protected readonly backdropPress = backdropDismiss();\n\n protected onBackdropRelease(event: PointerEvent): void {\n if (this.backdropPress.shouldDismiss(event)) {\n this.close();\n }\n }\n\n protected onGrabStart(event: PointerEvent): void {\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n this.dragStartY = event.clientY;\n this.lastMoveY = event.clientY;\n this.lastMoveTime = event.timeStamp;\n this.velocity = 0;\n this.dragOffset.set(0);\n }\n\n protected onGrabMove(event: PointerEvent): void {\n if (this.dragOffset() === null) {\n return;\n }\n const deltaTime = event.timeStamp - this.lastMoveTime;\n if (deltaTime > 0) {\n this.velocity = (event.clientY - this.lastMoveY) / deltaTime;\n }\n this.lastMoveY = event.clientY;\n this.lastMoveTime = event.timeStamp;\n this.dragOffset.set(Math.max(0, event.clientY - this.dragStartY));\n }\n\n protected onGrabEnd(): void {\n const offset = this.dragOffset();\n if (offset === null) {\n return;\n }\n\n const points = this.snapPoints();\n\n if (points.length === 0) {\n // Original single-height behavior.\n const sheetHeight = this.sheetRef()?.nativeElement.offsetHeight ?? 0;\n const pastThreshold = sheetHeight > 0 && offset > sheetHeight * 0.3;\n const flicked = this.velocity > 0.5;\n if (pastThreshold || flicked) {\n this.close();\n } else {\n this.dragOffset.set(null);\n }\n\n return;\n }\n\n // Snap-point behavior: determine which snap point to land on.\n const viewportHeight =\n this.doc.defaultView?.innerHeight ?? window.innerHeight;\n const currentIndex = this.activeSnapIndex();\n const currentHeightPx = points[currentIndex] * viewportHeight;\n // Positive offset = dragged downward.\n const targetHeightPx = currentHeightPx - offset;\n const flicked = this.velocity > 0.5;\n\n if (flicked || targetHeightPx < points[0] * viewportHeight * 0.7) {\n // Dragged below lowest snap point or flicked down → close.\n this.close();\n\n return;\n }\n\n let nearestIndex = 0;\n let smallestDelta = Infinity;\n for (let pointIndex = 0; pointIndex < points.length; pointIndex++) {\n const delta = Math.abs(\n points[pointIndex] * viewportHeight - targetHeightPx,\n );\n if (delta < smallestDelta) {\n smallestDelta = delta;\n nearestIndex = pointIndex;\n }\n }\n\n this.dragOffset.set(null);\n this.activeSnapIndex.set(nearestIndex);\n }\n}\n","@if (rendered()) {\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- backdrop; keyboard dismissal is (keydown.escape) on this element, a backdrop isn't a tabbable control -->\n <div\n class=\"sheet-overlay\"\n [class.closing]=\"closing()\"\n (pointerdown)=\"backdropPress.down($event)\"\n (pointerup)=\"onBackdropRelease($event)\"\n (keydown.escape)=\"onEscape()\">\n <div\n #sheet\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n class=\"sheet\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n [class.dragging]=\"dragOffset() !== null\"\n [class.closing]=\"closing()\"\n [class.snapping]=\"snapPoints().length > 0 && dragOffset() === null\"\n [style.transform]=\"\n dragOffset() ? 'translateY(' + dragOffset() + 'px)' : null\n \"\n [style.height]=\"snapHeight()\"\n [style.maxHeight]=\"snapHeight() ? snapHeight() : null\"\n (animationend)=\"onLeaveEnd($event)\">\n <div\n class=\"grab\"\n (pointerdown)=\"onGrabStart($event)\"\n (pointermove)=\"onGrabMove($event)\"\n (pointerup)=\"onGrabEnd()\"\n (pointercancel)=\"onGrabEnd()\">\n <div class=\"sheet-handle\"></div>\n </div>\n\n @if (title()) {\n <h3\n class=\"sheet-title\"\n [id]=\"titleId\">\n {{ title() }}\n </h3>\n }\n\n <div class=\"sheet-body\">\n <ng-content />\n </div>\n\n <div class=\"sheet-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],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A,QAAA,EAAA,iBAAiB,EAAA,UAAA,EACf,IAAI,EAAA,OAAA,EACP,CAAC,UAAU,CAAC,EAAA,IAAA,EAKf,EAAE,cAAc,EAAE,MAAM,EAAE,EAAA,aAAA,EACjB,iBAAiB,CAAC,QAAQ,EAAA,QAAA,EAAA,6nDAAA,EAAA,MAAA,EAAA,CAAA,qzHAAA,CAAA,EAAA;idAqBsB,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEzDxE;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-bottom-sheet.mjs","sources":["../../../src/lib/components/bottom-sheet/bottom-sheet.component.ts","../../../src/lib/components/bottom-sheet/bottom-sheet.component.html","../../../src/lib/components/bottom-sheet/ids-group-ltd-ids-design-system-components-bottom-sheet.ts"],"sourcesContent":["import {\n Component,\n DOCUMENT,\n ElementRef,\n type OnDestroy,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { BodyScrollLockService } from '@ids-group-ltd/ids-design-system/overlay';\nimport { backdropDismiss } from '@ids-group-ltd/ids-design-system/core';\n\nlet nextId = 0;\n\n/** Bottom-anchored sheet — the mobile sibling of ds-drawer. Closes on scrim\n * tap, Escape, or a downward drag on the grab strip. While open it locks\n * body scroll. On wide viewports the panel is capped by\n * --ds-bottom-sheet-max-width and centred; prefer ds-modal / ds-drawer for\n * desktop-first layouts. position: fixed resolves against the nearest\n * ancestor containing block, so framed hosts contain the sheet. */\n@Component({\n selector: 'ds-bottom-sheet',\n standalone: true,\n imports: [A11yModule],\n templateUrl: './bottom-sheet.component.html',\n styleUrl: './bottom-sheet.component.scss',\n // A static `title=\"…\"` feeding the input below ALSO stays in the DOM as the global attribute,\n // which makes the host a native browser tooltip over everything inside it.\n host: { '[attr.title]': 'null' },\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class BottomSheetComponent implements OnDestroy {\n /** Open state, two-way bound. */\n readonly open = model<boolean>(false);\n /** Sheet title, shown in the header and used for `aria-labelledby`. */\n readonly title = input.required<string>();\n /** Fires once the close (leave) animation finishes. */\n readonly closed = output<void>();\n\n protected readonly titleId = `ds-bottom-sheet-title-${++nextId}`;\n /**\n * Snap-point heights as fractions of viewport height (0–1), ascending.\n * e.g. [0.4, 0.9]. When provided the sheet opens at the first snap point;\n * dragging snaps to the nearest point; dragging below the lowest closes.\n * When empty (default) the original single-height behavior is preserved.\n */\n readonly snapPoints = input<readonly number[]>([]);\n\n private readonly doc = inject(DOCUMENT);\n private readonly scrollLock = inject(BodyScrollLockService);\n private readonly sheetRef = viewChild<ElementRef<HTMLElement>>('sheet');\n\n protected readonly dragOffset = signal<number | null>(null);\n /** Sheet is in the DOM (kept true through the leave animation). */\n protected readonly rendered = signal(false);\n /** Playing the slide-down + scrim-fade leave animation. */\n protected readonly closing = signal(false);\n /** Index of the currently active snap point (only used when snapPoints is non-empty). */\n protected readonly activeSnapIndex = signal(0);\n\n /** CSS height string derived from the active snap point, or null when snapPoints is empty. */\n protected readonly snapHeight = computed(() => {\n const points = this.snapPoints();\n if (points.length === 0) {\n return null;\n }\n const index = Math.min(this.activeSnapIndex(), points.length - 1);\n\n return `${points[index] * 100}vh`;\n });\n\n private dragStartY = 0;\n private lastMoveY = 0;\n private lastMoveTime = 0;\n private velocity = 0;\n private wasOpen = false;\n private closeFallbackTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor() {\n // open → DOM lifecycle. Opening renders immediately; closing keeps the\n // sheet mounted and flips `closing` so the leave animation can play\n // (teardown in onLeaveEnd, or the timer below).\n effect(() => {\n const isOpen = this.open();\n if (isOpen) {\n this.closing.set(false);\n this.rendered.set(true);\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = null;\n if (this.snapPoints().length > 0) {\n this.activeSnapIndex.set(0);\n }\n } else if (this.wasOpen) {\n this.closing.set(true);\n // Two cases never deliver animationend: Chrome freezes CSS animations on a\n // backgrounded tab, and a 0s reduced-motion leave finishes before a listener\n // hears it. This timer is the teardown guarantee, not belt-and-braces.\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = setTimeout(() => this.finishClose(), 300);\n }\n this.wasOpen = isOpen;\n });\n\n // Ref-counted body-scroll lock, shared with modal/drawer so stacked\n // overlays don't unlock each other. The cleanup fires on the rendered→false\n // transition and on destroy, keeping lock/unlock paired.\n effect((onCleanup) => {\n if (!this.rendered()) {\n return;\n }\n this.scrollLock.lock();\n onCleanup(() => this.scrollLock.unlock());\n });\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = null;\n }\n\n protected close(): void {\n this.dragOffset.set(null);\n this.open.set(false);\n }\n\n protected onLeaveEnd(event: AnimationEvent): void {\n // The animated element is the one with the handler, so its OWN animationend is\n // the signal; anything bubbling from inside is not. This replaces matching the\n // keyframes NAME, which is what made the exit un-overridable.\n if (event.target !== event.currentTarget) {\n return;\n }\n this.finishClose();\n }\n\n private finishClose(): void {\n if (!this.closing()) {\n return;\n }\n clearTimeout(this.closeFallbackTimer ?? undefined);\n this.closeFallbackTimer = null;\n this.closing.set(false);\n this.rendered.set(false);\n this.closed.emit();\n }\n\n protected onEscape(): void {\n if (this.open()) {\n this.close();\n }\n }\n\n protected readonly backdropPress = backdropDismiss();\n\n protected onBackdropRelease(event: PointerEvent): void {\n if (this.backdropPress.shouldDismiss(event)) {\n this.close();\n }\n }\n\n protected onGrabStart(event: PointerEvent): void {\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n this.dragStartY = event.clientY;\n this.lastMoveY = event.clientY;\n this.lastMoveTime = event.timeStamp;\n this.velocity = 0;\n this.dragOffset.set(0);\n }\n\n protected onGrabMove(event: PointerEvent): void {\n if (this.dragOffset() === null) {\n return;\n }\n const deltaTime = event.timeStamp - this.lastMoveTime;\n if (deltaTime > 0) {\n this.velocity = (event.clientY - this.lastMoveY) / deltaTime;\n }\n this.lastMoveY = event.clientY;\n this.lastMoveTime = event.timeStamp;\n this.dragOffset.set(Math.max(0, event.clientY - this.dragStartY));\n }\n\n protected onGrabEnd(): void {\n const offset = this.dragOffset();\n if (offset === null) {\n return;\n }\n\n const points = this.snapPoints();\n\n if (points.length === 0) {\n // Original single-height behavior.\n const sheetHeight = this.sheetRef()?.nativeElement.offsetHeight ?? 0;\n const pastThreshold = sheetHeight > 0 && offset > sheetHeight * 0.3;\n const flicked = this.velocity > 0.5;\n if (pastThreshold || flicked) {\n this.close();\n } else {\n this.dragOffset.set(null);\n }\n\n return;\n }\n\n // Snap-point behavior: determine which snap point to land on.\n const viewportHeight =\n this.doc.defaultView?.innerHeight ?? window.innerHeight;\n const currentIndex = this.activeSnapIndex();\n const currentHeightPx = points[currentIndex] * viewportHeight;\n // Positive offset = dragged downward.\n const targetHeightPx = currentHeightPx - offset;\n const flicked = this.velocity > 0.5;\n\n if (flicked || targetHeightPx < points[0] * viewportHeight * 0.7) {\n // Dragged below lowest snap point or flicked down → close.\n this.close();\n\n return;\n }\n\n let nearestIndex = 0;\n let smallestDelta = Infinity;\n for (let pointIndex = 0; pointIndex < points.length; pointIndex++) {\n const delta = Math.abs(\n points[pointIndex] * viewportHeight - targetHeightPx,\n );\n if (delta < smallestDelta) {\n smallestDelta = delta;\n nearestIndex = pointIndex;\n }\n }\n\n this.dragOffset.set(null);\n this.activeSnapIndex.set(nearestIndex);\n }\n}\n","@if (rendered()) {\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- backdrop; keyboard dismissal is (keydown.escape) on this element, a backdrop isn't a tabbable control -->\n <div\n class=\"sheet-overlay\"\n [class.closing]=\"closing()\"\n (pointerdown)=\"backdropPress.down($event)\"\n (pointerup)=\"onBackdropRelease($event)\"\n (keydown.escape)=\"onEscape()\">\n <div\n #sheet\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n class=\"sheet\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n [class.dragging]=\"dragOffset() !== null\"\n [class.closing]=\"closing()\"\n [class.snapping]=\"snapPoints().length > 0 && dragOffset() === null\"\n [style.transform]=\"\n dragOffset() ? 'translateY(' + dragOffset() + 'px)' : null\n \"\n [style.height]=\"snapHeight()\"\n [style.maxHeight]=\"snapHeight() ? snapHeight() : null\"\n (animationend)=\"onLeaveEnd($event)\">\n <div\n class=\"grab\"\n (pointerdown)=\"onGrabStart($event)\"\n (pointermove)=\"onGrabMove($event)\"\n (pointerup)=\"onGrabEnd()\"\n (pointercancel)=\"onGrabEnd()\">\n <div class=\"sheet-handle\"></div>\n </div>\n\n @if (title()) {\n <h3\n class=\"sheet-title\"\n [id]=\"titleId\">\n {{ title() }}\n </h3>\n }\n\n <div class=\"sheet-body\">\n <ng-content />\n </div>\n\n <div class=\"sheet-actions\">\n <ng-content select=\"[actions]\" />\n </div>\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAmBA,IAAI,MAAM,GAAG,CAAC;AAEd;;;;;AAKmE;MAYtD,oBAAoB,CAAA;;AAEtB,IAAA,IAAI,GAAG,KAAK,CAAU,KAAK,2EAAC;;AAE5B,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAU;;IAEhC,MAAM,GAAG,MAAM,EAAQ;AAEb,IAAA,OAAO,GAAG,CAAA,sBAAA,EAAyB,EAAE,MAAM,EAAE;AAChE;;;;;AAKG;AACM,IAAA,UAAU,GAAG,KAAK,CAAoB,EAAE,iFAAC;AAEjC,IAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;AACtB,IAAA,UAAU,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAC1C,IAAA,QAAQ,GAAG,SAAS,CAA0B,OAAO,+EAAC;AAEpD,IAAA,UAAU,GAAG,MAAM,CAAgB,IAAI,iFA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UAAA,EAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,UAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,OAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECtCjC,6nDAoDA,EAAA,MAAA,EAAA,CAAA,y0HAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDtBY,UAAU,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,cAAA,EAAA,yBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAQT,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAXhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,UAAA,EACf,IAAI,EAAA,OAAA,EACP,CAAC,UAAU,CAAC,EAAA,IAAA,EAKf,EAAE,cAAc,EAAE,MAAM,EAAE,EAAA,aAAA,EACjB,iBAAiB,CAAC,QAAQ,EAAA,QAAA,EAAA,6nDAAA,EAAA,MAAA,EAAA,CAAA,y0HAAA,CAAA,EAAA;idAqBsB,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEzDxE;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { signal, Injectable, inject, input, numberAttribute, output, computed, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
-
import { DS_CONFIG, devWarn } from '@ids-group-ltd/ids-design-system/core';
|
|
3
|
+
import { DS_CONFIG, DS_INTL, devWarn } from '@ids-group-ltd/ids-design-system/core';
|
|
4
4
|
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -37,6 +37,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
37
37
|
class BreadcrumbsComponent {
|
|
38
38
|
cfg = inject(DS_CONFIG);
|
|
39
39
|
svc = inject(BreadcrumbsService);
|
|
40
|
+
intl = inject(DS_INTL);
|
|
40
41
|
/** Omitted, the component reads `BreadcrumbsService.items`; an explicit array opts out. */
|
|
41
42
|
items = input(null, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
42
43
|
/** Icon between crumbs; falls back to `DS_CONFIG.breadcrumbs.separator`, then `chevronRight`. */
|
|
@@ -84,11 +85,11 @@ class BreadcrumbsComponent {
|
|
|
84
85
|
this.navigate.emit(item);
|
|
85
86
|
}
|
|
86
87
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: BreadcrumbsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
87
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: BreadcrumbsComponent, isStandalone: true, selector: "ds-breadcrumbs", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, maxItems: { classPropertyName: "maxItems", publicName: "maxItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { navigate: "navigate" }, ngImport: i0, template: "<nav\n class=\"breadcrumbs\"\n aria-label=\"
|
|
88
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: BreadcrumbsComponent, isStandalone: true, selector: "ds-breadcrumbs", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, maxItems: { classPropertyName: "maxItems", publicName: "maxItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { navigate: "navigate" }, ngImport: i0, template: "<nav\n class=\"breadcrumbs\"\n [attr.aria-label]=\"intl().breadcrumbs.label\"\n [class.is-static]=\"!effectiveClickable()\">\n @for (item of resolvedItems(); track $index; let last = $last) {\n @if (\n item.href &&\n !last &&\n effectiveClickable()\n ) {\n <a\n [href]=\"item.href\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n (click)=\"onNav($event, item)\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </a>\n } @else {\n <span\n [class.current]=\"last\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n [attr.aria-current]=\"last ? 'page' : null\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </span>\n }\n\n @if (!last) {\n <span\n class=\"sep\"\n aria-hidden=\"true\">\n <ds-icon\n [name]=\"effectiveSeparator()\"\n [size]=\"12\" />\n </span>\n }\n }\n</nav>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_breadcrumbs-label-color: var(--ds-breadcrumbs-label-color, var(--text-tertiary));--_breadcrumbs-label-color-hover: var(--ds-breadcrumbs-label-color-hover, var(--accent));--_breadcrumbs-separator-icon-color: var(--ds-breadcrumbs-separator-icon-color, var(--icon-muted));--_breadcrumbs-current-label-color: var(--ds-breadcrumbs-current-label-color, var(--text-primary));display:inline-flex;min-width:0;max-width:100%}.breadcrumbs{display:inline-flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_breadcrumbs-label-color);min-width:0;max-width:100%;flex-wrap:nowrap;overflow:hidden;--focus-ring-offset: calc(-1 * var(--focus-ring-width))}.breadcrumbs a,.breadcrumbs .current{display:inline-flex;align-items:center;gap:var(--space-1)}.breadcrumbs a{color:var(--_breadcrumbs-label-color);text-decoration:none;cursor:pointer;transition:color var(--duration-fast) var(--ease-standard)}.breadcrumbs a:hover{color:var(--_breadcrumbs-label-color-hover);text-decoration:underline;text-underline-offset:var(--breadcrumbs-link-uloff)}.breadcrumbs a:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--radius-sm)}.breadcrumbs.is-static a,.breadcrumbs.is-static .current{cursor:default}.breadcrumbs .sep{color:var(--_breadcrumbs-separator-icon-color);display:inline-flex;align-items:center}.breadcrumbs .current{color:var(--_breadcrumbs-current-label-color);font-weight:var(--font-weight-bold)}.breadcrumbs .label{overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap;max-width:16ch}.breadcrumbs .current .label{max-width:32ch}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
88
89
|
}
|
|
89
90
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: BreadcrumbsComponent, decorators: [{
|
|
90
91
|
type: Component,
|
|
91
|
-
args: [{ selector: 'ds-breadcrumbs', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<nav\n class=\"breadcrumbs\"\n aria-label=\"
|
|
92
|
+
args: [{ selector: 'ds-breadcrumbs', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<nav\n class=\"breadcrumbs\"\n [attr.aria-label]=\"intl().breadcrumbs.label\"\n [class.is-static]=\"!effectiveClickable()\">\n @for (item of resolvedItems(); track $index; let last = $last) {\n @if (\n item.href &&\n !last &&\n effectiveClickable()\n ) {\n <a\n [href]=\"item.href\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n (click)=\"onNav($event, item)\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </a>\n } @else {\n <span\n [class.current]=\"last\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n [attr.aria-current]=\"last ? 'page' : null\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </span>\n }\n\n @if (!last) {\n <span\n class=\"sep\"\n aria-hidden=\"true\">\n <ds-icon\n [name]=\"effectiveSeparator()\"\n [size]=\"12\" />\n </span>\n }\n }\n</nav>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_breadcrumbs-label-color: var(--ds-breadcrumbs-label-color, var(--text-tertiary));--_breadcrumbs-label-color-hover: var(--ds-breadcrumbs-label-color-hover, var(--accent));--_breadcrumbs-separator-icon-color: var(--ds-breadcrumbs-separator-icon-color, var(--icon-muted));--_breadcrumbs-current-label-color: var(--ds-breadcrumbs-current-label-color, var(--text-primary));display:inline-flex;min-width:0;max-width:100%}.breadcrumbs{display:inline-flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_breadcrumbs-label-color);min-width:0;max-width:100%;flex-wrap:nowrap;overflow:hidden;--focus-ring-offset: calc(-1 * var(--focus-ring-width))}.breadcrumbs a,.breadcrumbs .current{display:inline-flex;align-items:center;gap:var(--space-1)}.breadcrumbs a{color:var(--_breadcrumbs-label-color);text-decoration:none;cursor:pointer;transition:color var(--duration-fast) var(--ease-standard)}.breadcrumbs a:hover{color:var(--_breadcrumbs-label-color-hover);text-decoration:underline;text-underline-offset:var(--breadcrumbs-link-uloff)}.breadcrumbs a:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--radius-sm)}.breadcrumbs.is-static a,.breadcrumbs.is-static .current{cursor:default}.breadcrumbs .sep{color:var(--_breadcrumbs-separator-icon-color);display:inline-flex;align-items:center}.breadcrumbs .current{color:var(--_breadcrumbs-current-label-color);font-weight:var(--font-weight-bold)}.breadcrumbs .label{overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap;max-width:16ch}.breadcrumbs .current .label{max-width:32ch}\n"] }]
|
|
92
93
|
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], separator: [{ type: i0.Input, args: [{ isSignal: true, alias: "separator", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], maxItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxItems", required: false }] }], navigate: [{ type: i0.Output, args: ["navigate"] }] } });
|
|
93
94
|
|
|
94
95
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-breadcrumbs.mjs","sources":["../../../src/lib/components/breadcrumbs/breadcrumbs.service.ts","../../../src/lib/components/breadcrumbs/breadcrumbs.component.ts","../../../src/lib/components/breadcrumbs/breadcrumbs.component.html","../../../src/lib/components/breadcrumbs/ids-group-ltd-ids-design-system-components-breadcrumbs.ts"],"sourcesContent":["import { Injectable, type Signal, signal } from '@angular/core';\nimport type { BreadcrumbItem } from './breadcrumbs.types';\n\n/**\n * Library-level breadcrumb state. Apps push items either programmatically\n * (page constructor / effect) or via a router-data driver (see app docs).\n * `<ds-breadcrumbs>` reads from here when no `[items]` input is provided.\n */\n@Injectable({ providedIn: 'root' })\nexport class BreadcrumbsService {\n private readonly _items = signal<BreadcrumbItem[]>([]);\n readonly items: Signal<BreadcrumbItem[]> = this._items.asReadonly();\n\n set(items: BreadcrumbItem[]): void {\n this._items.set(items);\n }\n\n push(item: BreadcrumbItem): void {\n this._items.update((arr) => [...arr, item]);\n }\n\n pop(): void {\n this._items.update((arr) => arr.slice(0, -1));\n }\n\n replaceLast(item: BreadcrumbItem): void {\n this._items.update((arr) =>\n arr.length ? [...arr.slice(0, -1), item] : [item],\n );\n }\n\n clear(): void {\n this._items.set([]);\n }\n}\n","import {\n Component,\n ViewEncapsulation,\n computed,\n inject,\n input,\n numberAttribute,\n output,\n} from '@angular/core';\nimport { DS_CONFIG, devWarn } from '@ids-group-ltd/ids-design-system/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport { BreadcrumbsService } from './breadcrumbs.service';\nimport type { BreadcrumbItem } from './breadcrumbs.types';\n\n@Component({\n selector: 'ds-breadcrumbs',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './breadcrumbs.component.html',\n styleUrl: './breadcrumbs.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class BreadcrumbsComponent {\n private readonly cfg = inject(DS_CONFIG);\n private readonly svc = inject(BreadcrumbsService);\n\n /** Omitted, the component reads `BreadcrumbsService.items`; an explicit array opts out. */\n readonly items = input<BreadcrumbItem[] | null>(null);\n /** Icon between crumbs; falls back to `DS_CONFIG.breadcrumbs.separator`, then `chevronRight`. */\n readonly separator = input<IconName | null>(null);\n /** Whether crumbs render as links; falls back to `DS_CONFIG.breadcrumbs.clickable`, then `true`. */\n readonly clickable = input<boolean | null>(null);\n /** Caps how many crumbs render, collapsing the middle — the first and the LAST always survive.\n * Worth setting on any deep trail: the row is `nowrap` with `overflow: hidden`, so uncapped it\n * is clipped from the END, which is the current page. */\n readonly maxItems = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n /** Fires when a clickable crumb with `href` is activated; default navigation is always prevented. */\n readonly navigate = output<BreadcrumbItem>();\n\n private readonly allItems = computed<BreadcrumbItem[]>(\n () => this.items() ?? this.svc.items(),\n );\n\n // The collapsed crumb carries no `href`, so it is inert rather than a link to nowhere, and its\n // label is the count rather than an ellipsis alone.\n protected readonly resolvedItems = computed<BreadcrumbItem[]>(() => {\n const items = this.allItems();\n const max = this.maxItems();\n if (!max || max < 2 || items.length <= max) {\n return items;\n }\n // max - 2, not max - 1: the collapsed crumb occupies one of the slots too,\n // so counting only the first would render one crumb more than asked for.\n const tail = items.slice(items.length - (max - 2));\n\n return [items[0], { label: `… ${items.length - max + 1} more` }, ...tail];\n });\n protected readonly effectiveSeparator = computed<IconName>(\n () => this.separator() ?? this.cfg.breadcrumbs?.separator ?? 'chevronRight',\n );\n protected readonly effectiveClickable = computed<boolean>(\n () => this.clickable() ?? this.cfg.breadcrumbs?.clickable ?? true,\n );\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n devWarn(() => {\n const nameless = this.resolvedItems().find(\n (item) => item.icon && !item.label && !item.ariaLabel,\n );\n\n return nameless\n ? `[ds-breadcrumbs] the crumb with icon=\"${nameless.icon}\" has no label and no ariaLabel, so it renders as a link with no accessible name. Give it an ariaLabel — the icon id is not a word for the user.`\n : null;\n });\n }\n }\n\n protected onNav(event: Event, item: BreadcrumbItem): void {\n if (!item.href || !this.effectiveClickable()) {\n event.preventDefault();\n\n return;\n }\n event.preventDefault();\n this.navigate.emit(item);\n }\n}\n","<nav\n class=\"breadcrumbs\"\n aria-label=\"Breadcrumb\"\n [class.is-static]=\"!effectiveClickable()\">\n @for (item of resolvedItems(); track $index; let last = $last) {\n @if (\n item.href &&\n !last &&\n effectiveClickable()\n ) {\n <a\n [href]=\"item.href\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n (click)=\"onNav($event, item)\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </a>\n } @else {\n <span\n [class.current]=\"last\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n [attr.aria-current]=\"last ? 'page' : null\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </span>\n }\n\n @if (!last) {\n <span\n class=\"sep\"\n aria-hidden=\"true\">\n <ds-icon\n [name]=\"effectiveSeparator()\"\n [size]=\"12\" />\n </span>\n }\n }\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;;;;AAIG;MAEU,kBAAkB,CAAA;AACZ,IAAA,MAAM,GAAG,MAAM,CAAmB,EAAE,6EAAC;AAC7C,IAAA,KAAK,GAA6B,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;AAEnE,IAAA,GAAG,CAAC,KAAuB,EAAA;AACzB,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;IACxB;AAEA,IAAA,IAAI,CAAC,IAAoB,EAAA;AACvB,QAAA,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,CAAC;IAC7C;IAEA,GAAG,GAAA;QACD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/C;AAEA,IAAA,WAAW,CAAC,IAAoB,EAAA;AAC9B,QAAA,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KACrB,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAClD;IACH;IAEA,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACrB;wGAxBW,kBAAkB,EAAA,I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A,WAAA,EAAA,IAAA,EDtCY,aAAa,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAKZ,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBARhC,SAAS;+BACE,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP,CAAC,aAAa,CAAC,EAAA,aAAA,EAGT,iBAAiB,CAAC,QAAQ,EAAA,QAAA,EAAA,+0CAAA,EAAA,MAAA,EAAA,CAAA,4qFAAA,CAAA,EAAA;;;AErB3C;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-breadcrumbs.mjs","sources":["../../../src/lib/components/breadcrumbs/breadcrumbs.service.ts","../../../src/lib/components/breadcrumbs/breadcrumbs.component.ts","../../../src/lib/components/breadcrumbs/breadcrumbs.component.html","../../../src/lib/components/breadcrumbs/ids-group-ltd-ids-design-system-components-breadcrumbs.ts"],"sourcesContent":["import { Injectable, type Signal, signal } from '@angular/core';\nimport type { BreadcrumbItem } from './breadcrumbs.types';\n\n/**\n * Library-level breadcrumb state. Apps push items either programmatically\n * (page constructor / effect) or via a router-data driver (see app docs).\n * `<ds-breadcrumbs>` reads from here when no `[items]` input is provided.\n */\n@Injectable({ providedIn: 'root' })\nexport class BreadcrumbsService {\n private readonly _items = signal<BreadcrumbItem[]>([]);\n readonly items: Signal<BreadcrumbItem[]> = this._items.asReadonly();\n\n set(items: BreadcrumbItem[]): void {\n this._items.set(items);\n }\n\n push(item: BreadcrumbItem): void {\n this._items.update((arr) => [...arr, item]);\n }\n\n pop(): void {\n this._items.update((arr) => arr.slice(0, -1));\n }\n\n replaceLast(item: BreadcrumbItem): void {\n this._items.update((arr) =>\n arr.length ? [...arr.slice(0, -1), item] : [item],\n );\n }\n\n clear(): void {\n this._items.set([]);\n }\n}\n","import {\n Component,\n ViewEncapsulation,\n computed,\n inject,\n input,\n numberAttribute,\n output,\n} from '@angular/core';\nimport {\n DS_CONFIG,\n DS_INTL,\n devWarn,\n} from '@ids-group-ltd/ids-design-system/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport { BreadcrumbsService } from './breadcrumbs.service';\nimport type { BreadcrumbItem } from './breadcrumbs.types';\n\n@Component({\n selector: 'ds-breadcrumbs',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './breadcrumbs.component.html',\n styleUrl: './breadcrumbs.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class BreadcrumbsComponent {\n private readonly cfg = inject(DS_CONFIG);\n private readonly svc = inject(BreadcrumbsService);\n protected readonly intl = inject(DS_INTL);\n\n /** Omitted, the component reads `BreadcrumbsService.items`; an explicit array opts out. */\n readonly items = input<BreadcrumbItem[] | null>(null);\n /** Icon between crumbs; falls back to `DS_CONFIG.breadcrumbs.separator`, then `chevronRight`. */\n readonly separator = input<IconName | null>(null);\n /** Whether crumbs render as links; falls back to `DS_CONFIG.breadcrumbs.clickable`, then `true`. */\n readonly clickable = input<boolean | null>(null);\n /** Caps how many crumbs render, collapsing the middle — the first and the LAST always survive.\n * Worth setting on any deep trail: the row is `nowrap` with `overflow: hidden`, so uncapped it\n * is clipped from the END, which is the current page. */\n readonly maxItems = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n /** Fires when a clickable crumb with `href` is activated; default navigation is always prevented. */\n readonly navigate = output<BreadcrumbItem>();\n\n private readonly allItems = computed<BreadcrumbItem[]>(\n () => this.items() ?? this.svc.items(),\n );\n\n // The collapsed crumb carries no `href`, so it is inert rather than a link to nowhere, and its\n // label is the count rather than an ellipsis alone.\n protected readonly resolvedItems = computed<BreadcrumbItem[]>(() => {\n const items = this.allItems();\n const max = this.maxItems();\n if (!max || max < 2 || items.length <= max) {\n return items;\n }\n // max - 2, not max - 1: the collapsed crumb occupies one of the slots too,\n // so counting only the first would render one crumb more than asked for.\n const tail = items.slice(items.length - (max - 2));\n\n return [items[0], { label: `… ${items.length - max + 1} more` }, ...tail];\n });\n protected readonly effectiveSeparator = computed<IconName>(\n () => this.separator() ?? this.cfg.breadcrumbs?.separator ?? 'chevronRight',\n );\n protected readonly effectiveClickable = computed<boolean>(\n () => this.clickable() ?? this.cfg.breadcrumbs?.clickable ?? true,\n );\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n devWarn(() => {\n const nameless = this.resolvedItems().find(\n (item) => item.icon && !item.label && !item.ariaLabel,\n );\n\n return nameless\n ? `[ds-breadcrumbs] the crumb with icon=\"${nameless.icon}\" has no label and no ariaLabel, so it renders as a link with no accessible name. Give it an ariaLabel — the icon id is not a word for the user.`\n : null;\n });\n }\n }\n\n protected onNav(event: Event, item: BreadcrumbItem): void {\n if (!item.href || !this.effectiveClickable()) {\n event.preventDefault();\n\n return;\n }\n event.preventDefault();\n this.navigate.emit(item);\n }\n}\n","<nav\n class=\"breadcrumbs\"\n [attr.aria-label]=\"intl().breadcrumbs.label\"\n [class.is-static]=\"!effectiveClickable()\">\n @for (item of resolvedItems(); track $index; let last = $last) {\n @if (\n item.href &&\n !last &&\n effectiveClickable()\n ) {\n <a\n [href]=\"item.href\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n (click)=\"onNav($event, item)\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </a>\n } @else {\n <span\n [class.current]=\"last\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n [attr.aria-current]=\"last ? 'page' : null\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </span>\n }\n\n @if (!last) {\n <span\n class=\"sep\"\n aria-hidden=\"true\">\n <ds-icon\n [name]=\"effectiveSeparator()\"\n [size]=\"12\" />\n </span>\n }\n }\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;;;;AAIG;MAEU,kBAAkB,CAAA;AACZ,IAAA,MAAM,GAAG,MAAM,CAAmB,EAAE,6EAAC;AAC7C,IAAA,KAAK,GAA6B,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;AAEnE,IAAA,GAAG,CAAC,KAAuB,EAAA;AACzB,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;IACxB;AAEA,IAAA,IAAI,CAAC,IAAoB,EAAA;AACvB,QAAA,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,CAAC;IAC7C;IAEA,GAAG,GAAA;QACD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/C;AAEA,IAAA,WAAW,CAAC,IAAoB,EAAA;AAC9B,QAAA,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KACrB,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAClD;IACH;IAEA,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACrB;wGAxBW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,E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