@ids-group-ltd/ids-design-system 0.13.4 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +258 -0
- package/components.md +24 -14
- package/docs/agent/INDEX.md +1 -1
- package/docs/agent/charts/column-series-component.md +1 -1
- package/docs/agent/charts/ds-chart.md +3 -1
- package/docs/agent/charts/ds-line-chart.md +1 -1
- package/docs/agent/charts/line-series-component.md +1 -1
- package/docs/agent/forms/ds-search.md +1 -1
- package/docs/agent/forms/ds-switch.md +4 -2
- package/docs/agent/forms/ds-textarea.md +1 -0
- package/docs/agent/navigation/ds-pagination.md +2 -2
- package/docs/agent/platform/ds-config.md +2 -1
- package/docs/agent/tables/ds-cell-template.md +1 -1
- package/docs/agent/tables/ds-table.md +4 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +26 -19
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs +13 -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 +2 -2
- 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 +27 -14
- 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 +366 -81
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +4 -4
- 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 +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +8 -17
- 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 +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +2 -2
- 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 +6 -5
- 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 +42 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +17 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +8 -17
- 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 +27 -5
- 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 +4 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +23 -4
- 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 +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +20 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +2 -2
- 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.mjs +30 -22
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +21 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +1 -1
- 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 +91 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +2 -3
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.12.2.json +4 -1
- package/migrations/0.13.3.json +32 -10
- package/migrations/0.13.4.json +1630 -132
- package/migrations/0.14.0.json +591 -0
- package/migrations/0.5.0.json +10 -4
- package/migrations/0.7.0.json +5 -2
- package/migrations/0.9.0.json +5 -2
- package/migrations/README.md +7 -2
- package/package.json +1 -1
- package/styles/_chart-frame.scss +4 -4
- package/styles/_chart-motion.scss +17 -10
- package/styles/_overlay-motion.scss +14 -6
- package/styles/_skeleton-shimmer.scss +4 -1
- package/styles/_tokens.scss +1 -1
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +3 -5
- package/types/ids-group-ltd-ids-design-system-components-chart-data-table.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +11 -3
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +125 -26
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +3 -5
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +4 -1
- package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +4 -0
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +15 -10
- package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +1 -4
- package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +7 -1
- package/types/ids-group-ltd-ids-design-system-components-search.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +1 -0
- package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +10 -1
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +35 -24
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +13 -0
- package/types/ids-group-ltd-ids-design-system-components.d.ts +46 -3
- package/types/ids-group-ltd-ids-design-system-core.d.ts +13 -4
- package/types/ids-group-ltd-ids-design-system.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-chart-data-table.mjs","sources":["../../../src/lib/components/chart-data-table/chart-data-table.component.ts","../../../src/lib/components/chart-data-table/chart-data-table.component.html","../../../src/lib/components/chart-data-table/ids-group-ltd-ids-design-system-components-chart-data-table.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n input,\n output,\n} from '@angular/core';\n\n/** Cells arrive formatted: how a value reads is the chart's decision, not the table's. */\nexport interface ChartDataRow {\n readonly key: string;\n readonly cells: readonly string[];\n /** A part of the row above rather than a row of its own - one bar's segment, one stage's drop.\n * Drawn indented and quieter, so the nesting survives without a second table. */\n readonly nested?: boolean;\n}\n\n/**\n * The annex table under a chart: the non-visual route to the numbers, and the only one a reader\n * with no pointer has.\n */\n@Component({\n selector: 'ds-chart-data-table',\n standalone: true,\n templateUrl: './chart-data-table.component.html',\n styleUrl: './chart-data-table.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ChartDataTableComponent {\n readonly columns = input<readonly string[]>([]);\n readonly rows = input<readonly ChartDataRow[]>([]);\n\n readonly caption = input<string | null>(null);\n\n readonly open = input(false, { transform: booleanAttribute });\n\n /** Renders each row's first cell as a `<th scope=\"row\">`, for a matrix whose rows are named\n * rather than numbered. */\n readonly rowHeader = input(false, { transform: booleanAttribute });\n\n /** Fires with the disclosure's state, so a chart with thousands of readings can build its rows\n * only while they are on screen. */\n readonly toggled = output<boolean>();\n}\n","<details\n #disclosure\n class=\"data-table\"\n [open]=\"open()\"\n (toggle)=\"
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-chart-data-table.mjs","sources":["../../../src/lib/components/chart-data-table/chart-data-table.component.ts","../../../src/lib/components/chart-data-table/chart-data-table.component.html","../../../src/lib/components/chart-data-table/ids-group-ltd-ids-design-system-components-chart-data-table.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n output,\n signal,\n} from '@angular/core';\n\n/** Cells arrive formatted: how a value reads is the chart's decision, not the table's. */\nexport interface ChartDataRow {\n readonly key: string;\n readonly cells: readonly string[];\n /** A part of the row above rather than a row of its own - one bar's segment, one stage's drop.\n * Drawn indented and quieter, so the nesting survives without a second table. */\n readonly nested?: boolean;\n}\n\n/**\n * The annex table under a chart: the non-visual route to the numbers, and the only one a reader\n * with no pointer has.\n */\n@Component({\n selector: 'ds-chart-data-table',\n standalone: true,\n templateUrl: './chart-data-table.component.html',\n styleUrl: './chart-data-table.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ChartDataTableComponent {\n readonly columns = input<readonly string[]>([]);\n readonly rows = input<readonly ChartDataRow[]>([]);\n\n readonly caption = input<string | null>(null);\n\n readonly open = input(false, { transform: booleanAttribute });\n\n /** Renders each row's first cell as a `<th scope=\"row\">`, for a matrix whose rows are named\n * rather than numbered. */\n readonly rowHeader = input(false, { transform: booleanAttribute });\n\n /** Fires with the disclosure's state, so a chart with thousands of readings can build its rows\n * only while they are on screen. */\n readonly toggled = output<boolean>();\n\n // The table is built the first time the disclosure opens and kept after that: a closed\n // `<details>` skips layout but not the DOM, and most readers never open it.\n private readonly openedOnce = signal(false);\n protected readonly built = computed(() => this.open() || this.openedOnce());\n\n protected onToggle(open: boolean): void {\n if (open) {\n this.openedOnce.set(true);\n }\n this.toggled.emit(open);\n }\n}\n","<details\n #disclosure\n class=\"data-table\"\n [open]=\"open()\"\n (toggle)=\"onToggle(disclosure.open)\">\n <summary>\n Data table\n </summary>\n\n @if (built()) {\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n @for (column of columns(); track column) {\n <th scope=\"col\">\n {{ column }}\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (row of rows(); track row.key) {\n <tr [class.is-nested]=\"row.nested\">\n @for (cell of row.cells; track $index) {\n @if (rowHeader() && $first) {\n <th scope=\"row\">\n {{ cell }}\n </th>\n } @else {\n <td>\n {{ cell }}\n </td>\n }\n }\n </tr>\n }\n </tbody>\n </table>\n }\n</details>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAoBA;;;AAGG;MASU,uBAAuB,CAAA;AACzB,IAAA,OAAO,GAAG,KAAK,CAAoB,EAAE,8EAAC;AACtC,IAAA,IAAI,GAAG,KAAK,CAA0B,EAAE,2EAAC;AAEzC,IAAA,OAAO,GAAG,KAAK,CAAgB,IAAI,8EAAC;IAEpC,IAAI,GAAG,KAAK,CAAC,KAAK,4EAAI,SAAS,EAAE,gBAAgB,EAAA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ngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartLegendComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartLegendComponent, isStandalone: true, selector: "ds-chart-legend", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, toggleable: { classPropertyName: "toggleable", publicName: "toggleable", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, highlighted: { classPropertyName: "highlighted", publicName: "highlighted", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { hidden: "hiddenChange", highlighted: "highlightedChange" }, ngImport: i0, template: "<ul class=\"legend\">\n @if (toggleable() && mode() === 'isolate') {\n <li class=\"legend-item\">\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === 'all'\"\n (change)=\"showAll()\"\n (focus)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n All\n </span>\n </label>\n </li>\n }\n\n @for (item of items(); track item.id) {\n <li\n class=\"legend-item\"\n [class.is-hidden]=\"isHidden(item.id)\"\n (pointerenter)=\"highlighted.set(item.id)\"\n (pointerleave)=\"highlighted.set(null)\">\n @if (toggleable() && mode() === 'isolate') {\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n animate.enter=\"mark-enter\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === item.id\"\n [style.--ds-checkbox-selected-bg-color]=\"item.color\"\n [style.--ds-checkbox-selected-border-color]=\"item.color\"\n (change)=\"isolate(item.id)\"\n (focus)=\"highlighted.set(item.id)\"\n (blur)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n </label>\n } @else if (toggleable()) {\n <label class=\"legend-toggle\">\n <input\n type=\"checkbox\"\n class=\"legend-check\"\n animate.enter=\"mark-enter\"\n [checked]=\"!isHidden(item.id)\"\n [style.--ds-checkbox-selected-bg-color]=\"item.color\"\n [style.--ds-checkbox-selected-border-color]=\"item.color\"\n (change)=\"toggle(item.id)\"\n (focus)=\"highlighted.set(item.id)\"\n (blur)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n </label>\n } @else {\n <span\n class=\"legend-swatch\"\n animate.enter=\"mark-enter\"\n aria-hidden=\"true\"\n [style.background]=\"item.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n }\n </li>\n }\n\n @if (toggleable() && mode() === 'isolate') {\n <li class=\"legend-item\">\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === 'none'\"\n (change)=\"hideAll()\"\n (focus)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n None\n </span>\n </label>\n </li>\n }\n</ul>\n", styles: ["@charset \"UTF-8\";@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.legend-swatch.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.legend-swatch.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.legend-check.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.legend-check.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.legend-radio.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.legend-radio.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{--_chart-legend-swatch-size: var(--ds-chart-legend-swatch-size, var(--space-2-5));display:block}.legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin:var(--space-3) 0 0;padding:0;list-style:none}.legend-item{display:inline-flex;gap:var(--space-2);align-items:center;color:var(--text-secondary);font-size:var(--font-size-xs)}.legend-toggle{display:inline-flex;gap:var(--space-2);align-items:center;cursor:pointer}.legend-check{appearance:none;width:var(--_checkbox-glyph, var(--check-size));height:var(--_checkbox-glyph, var(--check-size));border:var(--check-bw) solid var(--_checkbox-border-color, var(--ds-checkbox-border-color, var(--border-strong)));background:var(--_checkbox-bg-color, var(--ds-checkbox-bg-color, var(--surface-default)));cursor:pointer;display:inline-grid;place-items:center;vertical-align:middle;flex-shrink:0;margin:0;border-radius:var(--_checkbox-radius, var(--ds-checkbox-radius, var(--ds-radius-inner)));transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.legend-check:hover:not(:disabled){border-color:var(--_checkbox-hover-border-color, var(--ds-checkbox-hover-border-color, var(--accent)))}.legend-check:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.legend-check:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);cursor:not-allowed}.legend-check{color:var(--icon-on-primary)}.legend-check:after{content:\"\";--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.legend-check:after{background-color:CanvasText}}.legend-check:after{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.legend-check:checked{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-check:checked:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.legend-check:indeterminate{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-check:indeterminate:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing);width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);-webkit-mask:none;mask:none}.legend-radio{appearance:none;width:var(--_checkbox-glyph, var(--check-size));height:var(--_checkbox-glyph, var(--check-size));border:var(--check-bw) solid var(--_checkbox-border-color, var(--ds-checkbox-border-color, var(--border-strong)));background:var(--_checkbox-bg-color, var(--ds-checkbox-bg-color, var(--surface-default)));cursor:pointer;display:inline-grid;place-items:center;vertical-align:middle;flex-shrink:0;margin:0;border-radius:var(--_checkbox-radius, var(--ds-checkbox-radius, var(--ds-radius-inner)));transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.legend-radio:hover:not(:disabled){border-color:var(--_checkbox-hover-border-color, var(--ds-checkbox-hover-border-color, var(--accent)))}.legend-radio:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.legend-radio:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);cursor:not-allowed}.legend-radio{color:var(--icon-on-primary)}.legend-radio:after{content:\"\";--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.legend-radio:after{background-color:CanvasText}}.legend-radio:after{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.legend-radio:checked{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-radio:checked:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.legend-radio:indeterminate{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-radio:indeterminate:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing);width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);-webkit-mask:none;mask:none}.legend-radio{border-radius:var(--radius-pill)}.legend-swatch{flex:none;inline-size:var(--_chart-legend-swatch-size);block-size:var(--_chart-legend-swatch-size);border-radius:var(--radius-pill)}.legend-label{transition:color var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.legend-item.is-hidden .legend-label{color:var(--text-disabled)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
73
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartLegendComponent, isStandalone: true, selector: "ds-chart-legend", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, toggleable: { classPropertyName: "toggleable", publicName: "toggleable", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, highlighted: { classPropertyName: "highlighted", publicName: "highlighted", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { hidden: "hiddenChange", highlighted: "highlightedChange" }, ngImport: i0, template: "<ul class=\"legend\">\n @if (toggleable() && mode() === 'isolate') {\n <li class=\"legend-item\">\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === 'all'\"\n (change)=\"showAll()\"\n (focus)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n All\n </span>\n </label>\n </li>\n }\n\n @for (item of items(); track item.id) {\n <li\n class=\"legend-item\"\n [class.is-hidden]=\"isHidden(item.id)\"\n (pointerenter)=\"highlighted.set(item.id)\"\n (pointerleave)=\"highlighted.set(null)\">\n @if (toggleable() && mode() === 'isolate') {\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === item.id\"\n [style.--ds-checkbox-selected-bg-color]=\"item.color\"\n [style.--ds-checkbox-selected-border-color]=\"item.color\"\n (change)=\"isolate(item.id)\"\n (focus)=\"highlighted.set(item.id)\"\n (blur)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n </label>\n } @else if (toggleable()) {\n <label class=\"legend-toggle\">\n <input\n type=\"checkbox\"\n class=\"legend-check\"\n [checked]=\"!isHidden(item.id)\"\n [style.--ds-checkbox-selected-bg-color]=\"item.color\"\n [style.--ds-checkbox-selected-border-color]=\"item.color\"\n (change)=\"toggle(item.id)\"\n (focus)=\"highlighted.set(item.id)\"\n (blur)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n </label>\n } @else {\n <span\n class=\"legend-swatch\"\n aria-hidden=\"true\"\n [style.background]=\"item.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n }\n </li>\n }\n\n @if (toggleable() && mode() === 'isolate') {\n <li class=\"legend-item\">\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === 'none'\"\n (change)=\"hideAll()\"\n (focus)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n None\n </span>\n </label>\n </li>\n }\n</ul>\n", styles: ["@charset \"UTF-8\";@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.legend-swatch{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.legend-swatch.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.legend-check{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.legend-check.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.legend-radio{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.legend-radio.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{--_chart-legend-swatch-size: var(--ds-chart-legend-swatch-size, var(--space-2-5));display:block}.legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin:var(--space-3) 0 0;padding:0;list-style:none}.legend-item{display:inline-flex;gap:var(--space-2);align-items:center;color:var(--text-secondary);font-size:var(--font-size-xs)}.legend-toggle{display:inline-flex;gap:var(--space-2);align-items:center;cursor:pointer}.legend-check{appearance:none;width:var(--_checkbox-glyph, var(--check-size));height:var(--_checkbox-glyph, var(--check-size));border:var(--check-bw) solid var(--_checkbox-border-color, var(--ds-checkbox-border-color, var(--border-strong)));background:var(--_checkbox-bg-color, var(--ds-checkbox-bg-color, var(--surface-default)));cursor:pointer;display:inline-grid;place-items:center;vertical-align:middle;flex-shrink:0;margin:0;border-radius:var(--_checkbox-radius, var(--ds-checkbox-radius, var(--ds-radius-inner)));transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.legend-check:hover:not(:disabled){border-color:var(--_checkbox-hover-border-color, var(--ds-checkbox-hover-border-color, var(--accent)))}.legend-check:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.legend-check:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);cursor:not-allowed}.legend-check{color:var(--icon-on-primary)}.legend-check:after{content:\"\";--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.legend-check:after{background-color:CanvasText}}.legend-check:after{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.legend-check:checked{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-check:checked:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.legend-check:indeterminate{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-check:indeterminate:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing);width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);-webkit-mask:none;mask:none}.legend-radio{appearance:none;width:var(--_checkbox-glyph, var(--check-size));height:var(--_checkbox-glyph, var(--check-size));border:var(--check-bw) solid var(--_checkbox-border-color, var(--ds-checkbox-border-color, var(--border-strong)));background:var(--_checkbox-bg-color, var(--ds-checkbox-bg-color, var(--surface-default)));cursor:pointer;display:inline-grid;place-items:center;vertical-align:middle;flex-shrink:0;margin:0;border-radius:var(--_checkbox-radius, var(--ds-checkbox-radius, var(--ds-radius-inner)));transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.legend-radio:hover:not(:disabled){border-color:var(--_checkbox-hover-border-color, var(--ds-checkbox-hover-border-color, var(--accent)))}.legend-radio:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.legend-radio:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);cursor:not-allowed}.legend-radio{color:var(--icon-on-primary)}.legend-radio:after{content:\"\";--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.legend-radio:after{background-color:CanvasText}}.legend-radio:after{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.legend-radio:checked{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-radio:checked:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.legend-radio:indeterminate{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-radio:indeterminate:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing);width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);-webkit-mask:none;mask:none}.legend-radio{border-radius:var(--radius-pill)}.legend-swatch{flex:none;inline-size:var(--_chart-legend-swatch-size);block-size:var(--_chart-legend-swatch-size);border-radius:var(--radius-pill)}.legend-label{transition:color var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.legend-item.is-hidden .legend-label{color:var(--text-disabled)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
74
74
|
}
|
|
75
75
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartLegendComponent, decorators: [{
|
|
76
76
|
type: Component,
|
|
77
|
-
args: [{ selector: 'ds-chart-legend', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ul class=\"legend\">\n @if (toggleable() && mode() === 'isolate') {\n <li class=\"legend-item\">\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === 'all'\"\n (change)=\"showAll()\"\n (focus)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n All\n </span>\n </label>\n </li>\n }\n\n @for (item of items(); track item.id) {\n <li\n class=\"legend-item\"\n [class.is-hidden]=\"isHidden(item.id)\"\n (pointerenter)=\"highlighted.set(item.id)\"\n (pointerleave)=\"highlighted.set(null)\">\n @if (toggleable() && mode() === 'isolate') {\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n animate.enter=\"mark-enter\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === item.id\"\n [style.--ds-checkbox-selected-bg-color]=\"item.color\"\n [style.--ds-checkbox-selected-border-color]=\"item.color\"\n (change)=\"isolate(item.id)\"\n (focus)=\"highlighted.set(item.id)\"\n (blur)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n </label>\n } @else if (toggleable()) {\n <label class=\"legend-toggle\">\n <input\n type=\"checkbox\"\n class=\"legend-check\"\n animate.enter=\"mark-enter\"\n [checked]=\"!isHidden(item.id)\"\n [style.--ds-checkbox-selected-bg-color]=\"item.color\"\n [style.--ds-checkbox-selected-border-color]=\"item.color\"\n (change)=\"toggle(item.id)\"\n (focus)=\"highlighted.set(item.id)\"\n (blur)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n </label>\n } @else {\n <span\n class=\"legend-swatch\"\n animate.enter=\"mark-enter\"\n aria-hidden=\"true\"\n [style.background]=\"item.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n }\n </li>\n }\n\n @if (toggleable() && mode() === 'isolate') {\n <li class=\"legend-item\">\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === 'none'\"\n (change)=\"hideAll()\"\n (focus)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n None\n </span>\n </label>\n </li>\n }\n</ul>\n", styles: ["@charset \"UTF-8\";@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.legend-swatch.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.legend-swatch.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.legend-check.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.legend-check.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.legend-radio.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.legend-radio.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{--_chart-legend-swatch-size: var(--ds-chart-legend-swatch-size, var(--space-2-5));display:block}.legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin:var(--space-3) 0 0;padding:0;list-style:none}.legend-item{display:inline-flex;gap:var(--space-2);align-items:center;color:var(--text-secondary);font-size:var(--font-size-xs)}.legend-toggle{display:inline-flex;gap:var(--space-2);align-items:center;cursor:pointer}.legend-check{appearance:none;width:var(--_checkbox-glyph, var(--check-size));height:var(--_checkbox-glyph, var(--check-size));border:var(--check-bw) solid var(--_checkbox-border-color, var(--ds-checkbox-border-color, var(--border-strong)));background:var(--_checkbox-bg-color, var(--ds-checkbox-bg-color, var(--surface-default)));cursor:pointer;display:inline-grid;place-items:center;vertical-align:middle;flex-shrink:0;margin:0;border-radius:var(--_checkbox-radius, var(--ds-checkbox-radius, var(--ds-radius-inner)));transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.legend-check:hover:not(:disabled){border-color:var(--_checkbox-hover-border-color, var(--ds-checkbox-hover-border-color, var(--accent)))}.legend-check:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.legend-check:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);cursor:not-allowed}.legend-check{color:var(--icon-on-primary)}.legend-check:after{content:\"\";--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.legend-check:after{background-color:CanvasText}}.legend-check:after{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.legend-check:checked{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-check:checked:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.legend-check:indeterminate{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-check:indeterminate:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing);width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);-webkit-mask:none;mask:none}.legend-radio{appearance:none;width:var(--_checkbox-glyph, var(--check-size));height:var(--_checkbox-glyph, var(--check-size));border:var(--check-bw) solid var(--_checkbox-border-color, var(--ds-checkbox-border-color, var(--border-strong)));background:var(--_checkbox-bg-color, var(--ds-checkbox-bg-color, var(--surface-default)));cursor:pointer;display:inline-grid;place-items:center;vertical-align:middle;flex-shrink:0;margin:0;border-radius:var(--_checkbox-radius, var(--ds-checkbox-radius, var(--ds-radius-inner)));transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.legend-radio:hover:not(:disabled){border-color:var(--_checkbox-hover-border-color, var(--ds-checkbox-hover-border-color, var(--accent)))}.legend-radio:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.legend-radio:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);cursor:not-allowed}.legend-radio{color:var(--icon-on-primary)}.legend-radio:after{content:\"\";--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.legend-radio:after{background-color:CanvasText}}.legend-radio:after{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.legend-radio:checked{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-radio:checked:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.legend-radio:indeterminate{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-radio:indeterminate:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing);width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);-webkit-mask:none;mask:none}.legend-radio{border-radius:var(--radius-pill)}.legend-swatch{flex:none;inline-size:var(--_chart-legend-swatch-size);block-size:var(--_chart-legend-swatch-size);border-radius:var(--radius-pill)}.legend-label{transition:color var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.legend-item.is-hidden .legend-label{color:var(--text-disabled)}\n"] }]
|
|
77
|
+
args: [{ selector: 'ds-chart-legend', standalone: true, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ul class=\"legend\">\n @if (toggleable() && mode() === 'isolate') {\n <li class=\"legend-item\">\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === 'all'\"\n (change)=\"showAll()\"\n (focus)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n All\n </span>\n </label>\n </li>\n }\n\n @for (item of items(); track item.id) {\n <li\n class=\"legend-item\"\n [class.is-hidden]=\"isHidden(item.id)\"\n (pointerenter)=\"highlighted.set(item.id)\"\n (pointerleave)=\"highlighted.set(null)\">\n @if (toggleable() && mode() === 'isolate') {\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === item.id\"\n [style.--ds-checkbox-selected-bg-color]=\"item.color\"\n [style.--ds-checkbox-selected-border-color]=\"item.color\"\n (change)=\"isolate(item.id)\"\n (focus)=\"highlighted.set(item.id)\"\n (blur)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n </label>\n } @else if (toggleable()) {\n <label class=\"legend-toggle\">\n <input\n type=\"checkbox\"\n class=\"legend-check\"\n [checked]=\"!isHidden(item.id)\"\n [style.--ds-checkbox-selected-bg-color]=\"item.color\"\n [style.--ds-checkbox-selected-border-color]=\"item.color\"\n (change)=\"toggle(item.id)\"\n (focus)=\"highlighted.set(item.id)\"\n (blur)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n </label>\n } @else {\n <span\n class=\"legend-swatch\"\n aria-hidden=\"true\"\n [style.background]=\"item.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n }\n </li>\n }\n\n @if (toggleable() && mode() === 'isolate') {\n <li class=\"legend-item\">\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === 'none'\"\n (change)=\"hideAll()\"\n (focus)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n None\n </span>\n </label>\n </li>\n }\n</ul>\n", styles: ["@charset \"UTF-8\";@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.legend-swatch{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.legend-swatch.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.legend-check{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.legend-check.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.legend-radio{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.legend-radio.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{--_chart-legend-swatch-size: var(--ds-chart-legend-swatch-size, var(--space-2-5));display:block}.legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin:var(--space-3) 0 0;padding:0;list-style:none}.legend-item{display:inline-flex;gap:var(--space-2);align-items:center;color:var(--text-secondary);font-size:var(--font-size-xs)}.legend-toggle{display:inline-flex;gap:var(--space-2);align-items:center;cursor:pointer}.legend-check{appearance:none;width:var(--_checkbox-glyph, var(--check-size));height:var(--_checkbox-glyph, var(--check-size));border:var(--check-bw) solid var(--_checkbox-border-color, var(--ds-checkbox-border-color, var(--border-strong)));background:var(--_checkbox-bg-color, var(--ds-checkbox-bg-color, var(--surface-default)));cursor:pointer;display:inline-grid;place-items:center;vertical-align:middle;flex-shrink:0;margin:0;border-radius:var(--_checkbox-radius, var(--ds-checkbox-radius, var(--ds-radius-inner)));transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.legend-check:hover:not(:disabled){border-color:var(--_checkbox-hover-border-color, var(--ds-checkbox-hover-border-color, var(--accent)))}.legend-check:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.legend-check:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);cursor:not-allowed}.legend-check{color:var(--icon-on-primary)}.legend-check:after{content:\"\";--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.legend-check:after{background-color:CanvasText}}.legend-check:after{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.legend-check:checked{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-check:checked:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.legend-check:indeterminate{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-check:indeterminate:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing);width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);-webkit-mask:none;mask:none}.legend-radio{appearance:none;width:var(--_checkbox-glyph, var(--check-size));height:var(--_checkbox-glyph, var(--check-size));border:var(--check-bw) solid var(--_checkbox-border-color, var(--ds-checkbox-border-color, var(--border-strong)));background:var(--_checkbox-bg-color, var(--ds-checkbox-bg-color, var(--surface-default)));cursor:pointer;display:inline-grid;place-items:center;vertical-align:middle;flex-shrink:0;margin:0;border-radius:var(--_checkbox-radius, var(--ds-checkbox-radius, var(--ds-radius-inner)));transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard)}.legend-radio:hover:not(:disabled){border-color:var(--_checkbox-hover-border-color, var(--ds-checkbox-hover-border-color, var(--accent)))}.legend-radio:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.legend-radio:disabled{background:var(--surface-disabled);border-color:var(--border-disabled);cursor:not-allowed}.legend-radio{color:var(--icon-on-primary)}.legend-radio:after{content:\"\";--_check-mark-enter-duration: var(--ds-check-mark-enter-duration, var(--ds-motion-check-enter-duration));--_check-mark-enter-easing: var(--ds-check-mark-enter-easing, var(--ds-motion-check-enter-easing));--_check-mark-exit-duration: var(--ds-check-mark-exit-duration, var(--ds-motion-check-exit-duration));--_check-mark-exit-easing: var(--ds-check-mark-exit-easing, var(--ds-motion-check-exit-easing));width:var(--check-tick-size);height:var(--check-tick-size);transform:scale(.6);opacity:0;transform-origin:center;transition:transform var(--_check-mark-exit-duration) var(--_check-mark-exit-easing),opacity var(--_check-mark-exit-duration) var(--_check-mark-exit-easing);background-color:currentcolor}@media(forced-colors:active){.legend-radio:after{background-color:CanvasText}}.legend-radio:after{-webkit-mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat;mask:url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M2 6.5l2.5 2.5L10 3.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>\") center/contain no-repeat}.legend-radio:checked{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-radio:checked:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing)}.legend-radio:indeterminate{background:var(--_checkbox-selected-bg-color, var(--ds-checkbox-selected-bg-color, var(--accent)));border-color:var(--_checkbox-selected-border-color, var(--ds-checkbox-selected-border-color, var(--accent)))}.legend-radio:indeterminate:after{transform:scale(1);opacity:1;transition:transform var(--_check-mark-enter-duration) var(--_check-mark-enter-easing),opacity var(--_check-mark-enter-duration) var(--_check-mark-enter-easing);width:var(--check-indet-w);height:var(--check-indet-h);border-radius:var(--ds-radius-inner);-webkit-mask:none;mask:none}.legend-radio{border-radius:var(--radius-pill)}.legend-swatch{flex:none;inline-size:var(--_chart-legend-swatch-size);block-size:var(--_chart-legend-swatch-size);border-radius:var(--radius-pill)}.legend-label{transition:color var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.legend-item.is-hidden .legend-label{color:var(--text-disabled)}\n"] }]
|
|
78
78
|
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }, { type: i0.Output, args: ["hiddenChange"] }], toggleable: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleable", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], highlighted: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlighted", required: false }] }, { type: i0.Output, args: ["highlightedChange"] }] } });
|
|
79
79
|
|
|
80
80
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-chart-legend.mjs","sources":["../../../src/lib/components/chart-legend/chart-legend.component.ts","../../../src/lib/components/chart-legend/chart-legend.component.html","../../../src/lib/components/chart-legend/ids-group-ltd-ids-design-system-components-chart-legend.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ViewEncapsulation,\n booleanAttribute,\n input,\n model,\n} from '@angular/core';\nimport { nextControlId } from '@ids-group-ltd/ids-design-system/components';\nimport type { ChartLegendItem } from './chart-legend.types';\n\n/**\n * The key beside a chart, and — when `toggleable` — the control that hides a series.\n *\n * Ordinary DOM, never inside the `<svg>`: an item is a real `<input type=\"checkbox\">`, which is\n * what makes the toggle keyboard-operable and correctly announced without inventing a role.\n *\n * @internal\n */\n@Component({\n selector: 'ds-chart-legend',\n standalone: true,\n templateUrl: './chart-legend.component.html',\n styleUrl: './chart-legend.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ChartLegendComponent {\n readonly items = input.required<readonly ChartLegendItem[]>();\n\n /** Ids of the hidden items. Two-way, so a page can drive it from a URL parameter and so\n * cross-chart filtering later is this same mechanism. */\n readonly hidden = model<readonly string[]>([]);\n\n /** Offers the control. Off leaves the legend a plain key. */\n readonly toggleable = input(false, { transform: booleanAttribute });\n\n /** What a control does. `'isolate'` shows one series and hides the rest, which is the question a\n * reader of a crowded chart actually asks — \"show me only this\" takes one action instead of one\n * per series. `'toggle'` hides one and leaves the rest, for taking a dominant series out so the\n * others can be read at a usable scale.\n *\n * The two are different controls, not two styles of one: isolate is a single choice among many,\n * so it renders as a radio group with an \"All\" option, and toggle renders as checkboxes. That is\n * what gives each the keyboard and screen-reader behaviour it should have. */\n readonly mode = input<'toggle' | 'isolate'>('isolate');\n\n /** The item under the pointer or holding focus, which is what the chart dims from. */\n readonly highlighted = model<string | null>(null);\n\n protected isHidden(id: string): boolean {\n return this.hidden().includes(id);\n }\n\n protected toggle(id: string): void {\n const hidden = this.hidden();\n\n this.hidden.set(\n hidden.includes(id)\n ? hidden.filter((entry) => entry !== id)\n : [...hidden, id],\n );\n }\n\n /** Radio groups are scoped by NAME across the whole document, so a shared name would make every\n * legend on a page one group: choosing a series in one chart would clear the choice in all the\n * others, and only the last one rendered would show a selection at all. */\n protected readonly groupName = nextControlId('ds-chart-legend');\n\n /** Which radio is on: an item's id, or the two ends of the range. Always one of them, so the\n * group is never a set of empty circles with nothing chosen — a radio group with no selection\n * reads as broken, and the reader cannot tell \"everything\" from \"not decided yet\".\n *\n * A partial set left over from `'toggle'` — some hidden, more than one visible — is not a state\n * isolate can express, so it settles on `'all'` and the next choice makes it true. */\n protected readonly isolated = computed(() => {\n const items = this.items();\n const visible = items.filter((item) => !this.isHidden(item.id));\n if (visible.length === 0 && items.length > 0) {\n return 'none';\n }\n if (visible.length === 1) {\n return visible[0].id;\n }\n\n return 'all';\n });\n\n protected isolate(id: string): void {\n this.hidden.set(\n this.items()\n .filter((item) => item.id !== id)\n .map((item) => item.id),\n );\n }\n\n protected showAll(): void {\n this.hidden.set([]);\n }\n\n protected hideAll(): void {\n this.hidden.set(this.items().map((item) => item.id));\n }\n}\n","<ul class=\"legend\">\n @if (toggleable() && mode() === 'isolate') {\n <li class=\"legend-item\">\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === 'all'\"\n (change)=\"showAll()\"\n (focus)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n All\n </span>\n </label>\n </li>\n }\n\n @for (item of items(); track item.id) {\n <li\n class=\"legend-item\"\n [class.is-hidden]=\"isHidden(item.id)\"\n (pointerenter)=\"highlighted.set(item.id)\"\n (pointerleave)=\"highlighted.set(null)\">\n @if (toggleable() && mode() === 'isolate') {\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-chart-legend.mjs","sources":["../../../src/lib/components/chart-legend/chart-legend.component.ts","../../../src/lib/components/chart-legend/chart-legend.component.html","../../../src/lib/components/chart-legend/ids-group-ltd-ids-design-system-components-chart-legend.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ViewEncapsulation,\n booleanAttribute,\n input,\n model,\n} from '@angular/core';\nimport { nextControlId } from '@ids-group-ltd/ids-design-system/components';\nimport type { ChartLegendItem } from './chart-legend.types';\n\n/**\n * The key beside a chart, and — when `toggleable` — the control that hides a series.\n *\n * Ordinary DOM, never inside the `<svg>`: an item is a real `<input type=\"checkbox\">`, which is\n * what makes the toggle keyboard-operable and correctly announced without inventing a role.\n *\n * @internal\n */\n@Component({\n selector: 'ds-chart-legend',\n standalone: true,\n templateUrl: './chart-legend.component.html',\n styleUrl: './chart-legend.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ChartLegendComponent {\n readonly items = input.required<readonly ChartLegendItem[]>();\n\n /** Ids of the hidden items. Two-way, so a page can drive it from a URL parameter and so\n * cross-chart filtering later is this same mechanism. */\n readonly hidden = model<readonly string[]>([]);\n\n /** Offers the control. Off leaves the legend a plain key. */\n readonly toggleable = input(false, { transform: booleanAttribute });\n\n /** What a control does. `'isolate'` shows one series and hides the rest, which is the question a\n * reader of a crowded chart actually asks — \"show me only this\" takes one action instead of one\n * per series. `'toggle'` hides one and leaves the rest, for taking a dominant series out so the\n * others can be read at a usable scale.\n *\n * The two are different controls, not two styles of one: isolate is a single choice among many,\n * so it renders as a radio group with an \"All\" option, and toggle renders as checkboxes. That is\n * what gives each the keyboard and screen-reader behaviour it should have. */\n readonly mode = input<'toggle' | 'isolate'>('isolate');\n\n /** The item under the pointer or holding focus, which is what the chart dims from. */\n readonly highlighted = model<string | null>(null);\n\n protected isHidden(id: string): boolean {\n return this.hidden().includes(id);\n }\n\n protected toggle(id: string): void {\n const hidden = this.hidden();\n\n this.hidden.set(\n hidden.includes(id)\n ? hidden.filter((entry) => entry !== id)\n : [...hidden, id],\n );\n }\n\n /** Radio groups are scoped by NAME across the whole document, so a shared name would make every\n * legend on a page one group: choosing a series in one chart would clear the choice in all the\n * others, and only the last one rendered would show a selection at all. */\n protected readonly groupName = nextControlId('ds-chart-legend');\n\n /** Which radio is on: an item's id, or the two ends of the range. Always one of them, so the\n * group is never a set of empty circles with nothing chosen — a radio group with no selection\n * reads as broken, and the reader cannot tell \"everything\" from \"not decided yet\".\n *\n * A partial set left over from `'toggle'` — some hidden, more than one visible — is not a state\n * isolate can express, so it settles on `'all'` and the next choice makes it true. */\n protected readonly isolated = computed(() => {\n const items = this.items();\n const visible = items.filter((item) => !this.isHidden(item.id));\n if (visible.length === 0 && items.length > 0) {\n return 'none';\n }\n if (visible.length === 1) {\n return visible[0].id;\n }\n\n return 'all';\n });\n\n protected isolate(id: string): void {\n this.hidden.set(\n this.items()\n .filter((item) => item.id !== id)\n .map((item) => item.id),\n );\n }\n\n protected showAll(): void {\n this.hidden.set([]);\n }\n\n protected hideAll(): void {\n this.hidden.set(this.items().map((item) => item.id));\n }\n}\n","<ul class=\"legend\">\n @if (toggleable() && mode() === 'isolate') {\n <li class=\"legend-item\">\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === 'all'\"\n (change)=\"showAll()\"\n (focus)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n All\n </span>\n </label>\n </li>\n }\n\n @for (item of items(); track item.id) {\n <li\n class=\"legend-item\"\n [class.is-hidden]=\"isHidden(item.id)\"\n (pointerenter)=\"highlighted.set(item.id)\"\n (pointerleave)=\"highlighted.set(null)\">\n @if (toggleable() && mode() === 'isolate') {\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === item.id\"\n [style.--ds-checkbox-selected-bg-color]=\"item.color\"\n [style.--ds-checkbox-selected-border-color]=\"item.color\"\n (change)=\"isolate(item.id)\"\n (focus)=\"highlighted.set(item.id)\"\n (blur)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n </label>\n } @else if (toggleable()) {\n <label class=\"legend-toggle\">\n <input\n type=\"checkbox\"\n class=\"legend-check\"\n [checked]=\"!isHidden(item.id)\"\n [style.--ds-checkbox-selected-bg-color]=\"item.color\"\n [style.--ds-checkbox-selected-border-color]=\"item.color\"\n (change)=\"toggle(item.id)\"\n (focus)=\"highlighted.set(item.id)\"\n (blur)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n </label>\n } @else {\n <span\n class=\"legend-swatch\"\n aria-hidden=\"true\"\n [style.background]=\"item.color\">\n </span>\n\n <span class=\"legend-label\">\n {{ item.label }}\n </span>\n }\n </li>\n }\n\n @if (toggleable() && mode() === 'isolate') {\n <li class=\"legend-item\">\n <label class=\"legend-toggle\">\n <input\n type=\"radio\"\n class=\"legend-radio\"\n [attr.name]=\"groupName\"\n [checked]=\"isolated() === 'none'\"\n (change)=\"hideAll()\"\n (focus)=\"highlighted.set(null)\" />\n\n <span class=\"legend-label\">\n None\n </span>\n </label>\n </li>\n }\n</ul>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAYA;;;;;;;AAOG;MASU,oBAAoB,CAAA;AACtB,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAA8B;AAE7D;AAC0D;AACjD,IAAA,MAAM,GAAG,KAAK,CAAoB,EAAE,6EAAC;;IAGrC,UAAU,GAAG,KAAK,CAAC,KAAK,kFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAEnE;;;;;;;AAO+E;AACtE,IAAA,IAAI,GAAG,KAAK,CAAuB,SAAS,2EAAC;;AAG7C,IAAA,WAAW,GAAG,KAAK,CAAgB,IAAI,kFAAC;AAEvC,IAAA,QAAQ,CAAC,EAAU,EAAA;QAC3B,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;IACnC;AAEU,IAAA,MAAM,CAAC,EAAU,EAAA;AACzB,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;QAE5B,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,MAAM,CAAC,QAAQ,CAAC,EAAE;AAChB,cAAE,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,EAAE;cACrC,CAAC,GAAG,MAAM,EAAE,EAAE,CAAC,CACpB;IACH;AAEA;;AAE4E;AACzD,IAAA,SAAS,GAAG,aAAa,CAAC,iBAAiB,CAAC;AAE/D;;;;;AAKuF;AACpE,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAK;AAC1C,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;QAC1B,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC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EAGD,iBAAiB,CAAC,QAAQ,EAAA,eAAA,EACxB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,mqFAAA,EAAA,MAAA,EAAA,CAAA,u3RAAA,CAAA,EAAA;;;AE1BjD;;AAEG;;;;"}
|
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, ChangeDetectionStrategy, ViewEncapsulation, Component, inject, ViewContainerRef, effect, DestroyRef, Directive, signal } from '@angular/core';
|
|
3
3
|
import { Overlay } from '@angular/cdk/overlay';
|
|
4
4
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
5
|
-
import { closeOnScroll } from '@ids-group-ltd/ids-design-system/components';
|
|
5
|
+
import { closeOnScroll, disposeWithLeave } from '@ids-group-ltd/ids-design-system/components';
|
|
6
6
|
import { NgTemplateOutlet } from '@angular/common';
|
|
7
7
|
|
|
8
8
|
class ChartTooltipPanelComponent {
|
|
@@ -11,7 +11,7 @@ class ChartTooltipPanelComponent {
|
|
|
11
11
|
/** The chart's projected `#dsChartTooltip` template. Null renders the built-in rows. */
|
|
12
12
|
template = input(null, ...(ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []));
|
|
13
13
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartTooltipPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartTooltipPanelComponent, isStandalone: true, selector: "ds-chart-tooltip-panel", inputs: { context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" } }, ngImport: i0, template: "@if (template(); as projected) {\n <ng-container\n [ngTemplateOutlet]=\"projected\"\n [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n} @else {\n @if (context().category) {\n <p class=\"category\">\n {{ context().category }}\n </p>\n }\n\n <ul class=\"entries\">\n @for (entry of context().entries; track
|
|
14
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ChartTooltipPanelComponent, isStandalone: true, selector: "ds-chart-tooltip-panel", inputs: { context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" } }, ngImport: i0, template: "@if (template(); as projected) {\n <ng-container\n [ngTemplateOutlet]=\"projected\"\n [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n} @else {\n @if (context().category) {\n <p class=\"category\">\n {{ context().category }}\n </p>\n }\n\n <ul class=\"entries\">\n @for (entry of context().entries; track $index) {\n <li class=\"entry\">\n <span\n class=\"swatch\"\n [class.hatched]=\"entry.hatched\"\n [style.background-color]=\"entry.color\">\n </span>\n\n <span class=\"label\">\n {{ entry.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formatted }}\n </span>\n\n @if (entry.detail) {\n <span class=\"detail\">\n {{ entry.detail }}\n </span>\n }\n </li>\n }\n </ul>\n}\n", styles: [":host{--_chart-tooltip-bg-color: var(--ds-chart-tooltip-bg-color);--_chart-tooltip-text-color: var(--ds-chart-tooltip-text-color);--_chart-tooltip-border-color: var(--ds-chart-tooltip-border-color);display:block;background:var(--_chart-tooltip-bg-color);color:var(--_chart-tooltip-text-color);border:var(--border-width-default) solid var(--_chart-tooltip-border-color);border-radius:var(--ds-radius-control);box-shadow:var(--ds-elevation-overlay);padding:var(--space-2) var(--space-2-5);max-width:var(--tooltip-maxw);max-height:calc(100dvh - 2 * var(--space-3));overflow-y:auto;z-index:var(--layer-tooltip);font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);pointer-events:none}.category{margin:0 0 var(--space-1-5);font-weight:var(--font-weight-medium)}.entries{display:grid;gap:var(--space-1);margin:0;padding:0;list-style:none}.entry{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:var(--space-2)}.detail{grid-column:2/-1;margin-block-start:calc(var(--space-1) * -1);color:var(--_chart-tooltip-text-color);opacity:.7;font-size:var(--font-size-2xs)}.swatch{inline-size:var(--space-3);block-size:var(--space-3);border-radius:var(--radius-pill);box-shadow:0 0 0 var(--_chart-tooltip-swatch-ring, 1.5px) var(--_chart-tooltip-swatch-ring-color, var(--surface-default))}.swatch.hatched{background-image:linear-gradient(45deg,transparent 38%,var(--surface-default) 38%,var(--surface-default) 62%,transparent 62%)}.value{font-variant-numeric:tabular-nums;font-weight:var(--font-weight-medium)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
15
15
|
}
|
|
16
16
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartTooltipPanelComponent, decorators: [{
|
|
17
17
|
type: Component,
|
|
@@ -20,10 +20,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
20
20
|
// carries the same label and value in its `aria-label`, so exposing the panel
|
|
21
21
|
// makes a screen reader read each reading twice.
|
|
22
22
|
'aria-hidden': 'true',
|
|
23
|
-
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (template(); as projected) {\n <ng-container\n [ngTemplateOutlet]=\"projected\"\n [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n} @else {\n @if (context().category) {\n <p class=\"category\">\n {{ context().category }}\n </p>\n }\n\n <ul class=\"entries\">\n @for (entry of context().entries; track
|
|
23
|
+
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (template(); as projected) {\n <ng-container\n [ngTemplateOutlet]=\"projected\"\n [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n} @else {\n @if (context().category) {\n <p class=\"category\">\n {{ context().category }}\n </p>\n }\n\n <ul class=\"entries\">\n @for (entry of context().entries; track $index) {\n <li class=\"entry\">\n <span\n class=\"swatch\"\n [class.hatched]=\"entry.hatched\"\n [style.background-color]=\"entry.color\">\n </span>\n\n <span class=\"label\">\n {{ entry.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formatted }}\n </span>\n\n @if (entry.detail) {\n <span class=\"detail\">\n {{ entry.detail }}\n </span>\n }\n </li>\n }\n </ul>\n}\n", styles: [":host{--_chart-tooltip-bg-color: var(--ds-chart-tooltip-bg-color);--_chart-tooltip-text-color: var(--ds-chart-tooltip-text-color);--_chart-tooltip-border-color: var(--ds-chart-tooltip-border-color);display:block;background:var(--_chart-tooltip-bg-color);color:var(--_chart-tooltip-text-color);border:var(--border-width-default) solid var(--_chart-tooltip-border-color);border-radius:var(--ds-radius-control);box-shadow:var(--ds-elevation-overlay);padding:var(--space-2) var(--space-2-5);max-width:var(--tooltip-maxw);max-height:calc(100dvh - 2 * var(--space-3));overflow-y:auto;z-index:var(--layer-tooltip);font:var(--font-weight-regular) var(--font-size-xs)/var(--line-height-base) var(--font-sans);pointer-events:none}.category{margin:0 0 var(--space-1-5);font-weight:var(--font-weight-medium)}.entries{display:grid;gap:var(--space-1);margin:0;padding:0;list-style:none}.entry{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:var(--space-2)}.detail{grid-column:2/-1;margin-block-start:calc(var(--space-1) * -1);color:var(--_chart-tooltip-text-color);opacity:.7;font-size:var(--font-size-2xs)}.swatch{inline-size:var(--space-3);block-size:var(--space-3);border-radius:var(--radius-pill);box-shadow:0 0 0 var(--_chart-tooltip-swatch-ring, 1.5px) var(--_chart-tooltip-swatch-ring-color, var(--surface-default))}.swatch.hatched{background-image:linear-gradient(45deg,transparent 38%,var(--surface-default) 38%,var(--surface-default) 62%,transparent 62%)}.value{font-variant-numeric:tabular-nums;font-weight:var(--font-weight-medium)}\n"] }]
|
|
24
24
|
}], propDecorators: { context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: true }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }] } });
|
|
25
25
|
|
|
26
|
-
const POINTER_GAP_PX =
|
|
26
|
+
const POINTER_GAP_PX = 10;
|
|
27
27
|
// A fingertip covers roughly 40 CSS px, so a touch-opened panel has to clear the tap
|
|
28
28
|
// point by more than a pointer-opened one does.
|
|
29
29
|
const TOUCH_GAP_PX = 48;
|
|
@@ -91,6 +91,9 @@ class ChartTooltipDirective {
|
|
|
91
91
|
/** Opens the panel BELOW the mark first. A chart sets it while a mark is held, so the panel
|
|
92
92
|
* leaves the plot's top edge — and the Unpin control that lives there — alone. */
|
|
93
93
|
dsChartTooltipPreferBelow = input(false, ...(ngDevMode ? [{ debugName: "dsChartTooltipPreferBelow" }] : /* istanbul ignore next */ []));
|
|
94
|
+
/** A held panel takes the pointer again, so its text can be selected. While it merely follows
|
|
95
|
+
* the pointer the pane stays inert, or the mark it covers never sees the pointer at all. */
|
|
96
|
+
dsChartTooltipPinned = input(false, ...(ngDevMode ? [{ debugName: "dsChartTooltipPinned" }] : /* istanbul ignore next */ []));
|
|
94
97
|
overlayRef = null;
|
|
95
98
|
panelRef = null;
|
|
96
99
|
detachScrollReposition = null;
|
|
@@ -127,6 +130,7 @@ class ChartTooltipDirective {
|
|
|
127
130
|
else {
|
|
128
131
|
this.overlayRef.updatePositionStrategy(this.strategyFor(origin));
|
|
129
132
|
}
|
|
133
|
+
this.overlayRef.overlayElement.classList.toggle('is-pinned', this.dsChartTooltipPinned());
|
|
130
134
|
this.panelRef?.setInput('context', context);
|
|
131
135
|
this.panelRef?.setInput('template', this.dsChartTooltipTemplate());
|
|
132
136
|
}
|
|
@@ -163,12 +167,15 @@ class ChartTooltipDirective {
|
|
|
163
167
|
this.detachEscape = null;
|
|
164
168
|
this.detachScrollReposition?.();
|
|
165
169
|
this.detachScrollReposition = null;
|
|
166
|
-
|
|
170
|
+
// A dismissal, never a selection: the panel closes when the reader leaves the plot, and the
|
|
171
|
+
// family's answer to that is a fade. Moving between marks repositions this overlay rather than
|
|
172
|
+
// closing it, so nothing here can lag behind the pointer.
|
|
173
|
+
disposeWithLeave(this.overlayRef, 'dismiss');
|
|
167
174
|
this.overlayRef = null;
|
|
168
175
|
this.panelRef = null;
|
|
169
176
|
}
|
|
170
177
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
171
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.22", type: ChartTooltipDirective, isStandalone: true, selector: "[dsChartTooltip]", inputs: { dsChartTooltip: { classPropertyName: "dsChartTooltip", publicName: "dsChartTooltip", isSignal: true, isRequired: false, transformFunction: null }, dsChartTooltipOrigin: { classPropertyName: "dsChartTooltipOrigin", publicName: "dsChartTooltipOrigin", isSignal: true, isRequired: false, transformFunction: null }, dsChartTooltipTemplate: { classPropertyName: "dsChartTooltipTemplate", publicName: "dsChartTooltipTemplate", isSignal: true, isRequired: false, transformFunction: null }, dsChartTooltipExtraGap: { classPropertyName: "dsChartTooltipExtraGap", publicName: "dsChartTooltipExtraGap", isSignal: true, isRequired: false, transformFunction: null }, dsChartTooltipPreferBelow: { classPropertyName: "dsChartTooltipPreferBelow", publicName: "dsChartTooltipPreferBelow", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
178
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.22", type: ChartTooltipDirective, isStandalone: true, selector: "[dsChartTooltip]", inputs: { dsChartTooltip: { classPropertyName: "dsChartTooltip", publicName: "dsChartTooltip", isSignal: true, isRequired: false, transformFunction: null }, dsChartTooltipOrigin: { classPropertyName: "dsChartTooltipOrigin", publicName: "dsChartTooltipOrigin", isSignal: true, isRequired: false, transformFunction: null }, dsChartTooltipTemplate: { classPropertyName: "dsChartTooltipTemplate", publicName: "dsChartTooltipTemplate", isSignal: true, isRequired: false, transformFunction: null }, dsChartTooltipExtraGap: { classPropertyName: "dsChartTooltipExtraGap", publicName: "dsChartTooltipExtraGap", isSignal: true, isRequired: false, transformFunction: null }, dsChartTooltipPreferBelow: { classPropertyName: "dsChartTooltipPreferBelow", publicName: "dsChartTooltipPreferBelow", isSignal: true, isRequired: false, transformFunction: null }, dsChartTooltipPinned: { classPropertyName: "dsChartTooltipPinned", publicName: "dsChartTooltipPinned", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
172
179
|
}
|
|
173
180
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ChartTooltipDirective, decorators: [{
|
|
174
181
|
type: Directive,
|
|
@@ -176,7 +183,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
176
183
|
selector: '[dsChartTooltip]',
|
|
177
184
|
standalone: true,
|
|
178
185
|
}]
|
|
179
|
-
}], ctorParameters: () => [], propDecorators: { dsChartTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltip", required: false }] }], dsChartTooltipOrigin: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltipOrigin", required: false }] }], dsChartTooltipTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltipTemplate", required: false }] }], dsChartTooltipExtraGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltipExtraGap", required: false }] }], dsChartTooltipPreferBelow: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltipPreferBelow", required: false }] }] } });
|
|
186
|
+
}], ctorParameters: () => [], propDecorators: { dsChartTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltip", required: false }] }], dsChartTooltipOrigin: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltipOrigin", required: false }] }], dsChartTooltipTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltipTemplate", required: false }] }], dsChartTooltipExtraGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltipExtraGap", required: false }] }], dsChartTooltipPreferBelow: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltipPreferBelow", required: false }] }], dsChartTooltipPinned: [{ type: i0.Input, args: [{ isSignal: true, alias: "dsChartTooltipPinned", required: false }] }] } });
|
|
180
187
|
function coarsePointer() {
|
|
181
188
|
return (typeof window !== 'undefined' &&
|
|
182
189
|
window.matchMedia('(pointer: coarse)').matches);
|
|
@@ -219,12 +226,17 @@ function chartActiveMark(lingerMs = () => 0) {
|
|
|
219
226
|
// the full plot height, so anchoring to it opens the panel at the top of the chart rather than
|
|
220
227
|
// over the column it is about. A selector is resolved INSIDE the box; a legend item's mark is not
|
|
221
228
|
// inside it, so that caller passes the element.
|
|
222
|
-
const aim = (at, event, anchor) => {
|
|
223
|
-
const target =
|
|
229
|
+
const aim = (at, event, anchor, mark = event.currentTarget) => {
|
|
230
|
+
const target = mark;
|
|
224
231
|
if (target instanceof Element) {
|
|
225
232
|
host = target;
|
|
226
233
|
const mark = typeof anchor === 'string' ? target.querySelector(anchor) : anchor;
|
|
227
|
-
|
|
234
|
+
// A mark drawn from a zero value is degenerate in one axis - a column loses its height, a
|
|
235
|
+
// bar its width - and an overlay anchored to it lands at that edge rather than near the
|
|
236
|
+
// reading. Both dimensions have to be real. The hover target always is.
|
|
237
|
+
const box = mark?.getBoundingClientRect();
|
|
238
|
+
const aimable = box && box.width > 0 && box.height > 0;
|
|
239
|
+
origin.set(aimable ? (mark ?? target) : target);
|
|
228
240
|
}
|
|
229
241
|
index.set(at);
|
|
230
242
|
};
|
|
@@ -300,6 +312,7 @@ function chartActiveMark(lingerMs = () => 0) {
|
|
|
300
312
|
inject(DestroyRef).onDestroy(() => {
|
|
301
313
|
cancelPendingClear();
|
|
302
314
|
document.removeEventListener('pointerdown', release, true);
|
|
315
|
+
document.removeEventListener('keydown', releaseOnEscape, true);
|
|
303
316
|
document.removeEventListener('pointerover', trackPointer, true);
|
|
304
317
|
});
|
|
305
318
|
}
|
|
@@ -307,14 +320,14 @@ function chartActiveMark(lingerMs = () => 0) {
|
|
|
307
320
|
index: index.asReadonly(),
|
|
308
321
|
origin: origin.asReadonly(),
|
|
309
322
|
pinned: pinned.asReadonly(),
|
|
310
|
-
enter(at, event, anchor) {
|
|
323
|
+
enter(at, event, anchor, mark) {
|
|
311
324
|
// A pin HOLDS. Without this the next mark the pointer crossed took the active slot straight
|
|
312
325
|
// back, so pinning appeared to work and then followed the pointer anyway — the one thing a
|
|
313
326
|
// pin exists not to do. It is released by Escape, or by a press outside the pinned mark.
|
|
314
327
|
if (pinned()) {
|
|
315
328
|
return;
|
|
316
329
|
}
|
|
317
|
-
aim(at, event, anchor);
|
|
330
|
+
aim(at, event, anchor, mark);
|
|
318
331
|
cancelPendingClear();
|
|
319
332
|
if (typeof document !== 'undefined') {
|
|
320
333
|
document.addEventListener('pointerover', trackPointer, true);
|
|
@@ -343,7 +356,7 @@ function chartActiveMark(lingerMs = () => 0) {
|
|
|
343
356
|
clear();
|
|
344
357
|
}
|
|
345
358
|
},
|
|
346
|
-
pin(at, event, anchor) {
|
|
359
|
+
pin(at, event, anchor, mark) {
|
|
347
360
|
if (typeof document === 'undefined') {
|
|
348
361
|
return;
|
|
349
362
|
}
|
|
@@ -356,7 +369,7 @@ function chartActiveMark(lingerMs = () => 0) {
|
|
|
356
369
|
}
|
|
357
370
|
// Re-aiming while already pinned keeps `pinned` true throughout, so nothing that renders on
|
|
358
371
|
// it — the Unpin control, the held mark's styling — unmounts between the two marks.
|
|
359
|
-
aim(at, event, anchor);
|
|
372
|
+
aim(at, event, anchor, mark);
|
|
360
373
|
if (!pinned()) {
|
|
361
374
|
hold();
|
|
362
375
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-chart-tooltip.mjs","sources":["../../../src/lib/components/chart-tooltip/chart-tooltip-panel.component.ts","../../../src/lib/components/chart-tooltip/chart-tooltip-panel.component.html","../../../src/lib/components/chart-tooltip/chart-tooltip.directive.ts","../../../src/lib/components/chart-tooltip/chart-active-mark.ts","../../../src/lib/components/chart-tooltip/ids-group-ltd-ids-design-system-components-chart-tooltip.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n input,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport type { ChartTooltipContext } from './chart-tooltip.types';\n\n@Component({\n selector: 'ds-chart-tooltip-panel',\n standalone: true,\n imports: [NgTemplateOutlet],\n templateUrl: './chart-tooltip-panel.component.html',\n styleUrl: './chart-tooltip-panel.component.scss',\n host: {\n // Hidden from assistive technology on purpose: every interactive mark already\n // carries the same label and value in its `aria-label`, so exposing the panel\n // makes a screen reader read each reading twice.\n 'aria-hidden': 'true',\n },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ChartTooltipPanelComponent {\n /** The category and the readings the panel prints. */\n readonly context = input.required<ChartTooltipContext>();\n /** The chart's projected `#dsChartTooltip` template. Null renders the built-in rows. */\n readonly template = input<TemplateRef<{\n $implicit: ChartTooltipContext;\n }> | null>(null);\n}\n","@if (template(); as projected) {\n <ng-container\n [ngTemplateOutlet]=\"projected\"\n [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n} @else {\n @if (context().category) {\n <p class=\"category\">\n {{ context().category }}\n </p>\n }\n\n <ul class=\"entries\">\n @for (entry of context().entries; track entry.label) {\n <li class=\"entry\">\n <span\n class=\"swatch\"\n [style.background]=\"entry.color\">\n </span>\n\n <span class=\"label\">\n {{ entry.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formatted }}\n </span>\n\n @if (entry.detail) {\n <span class=\"detail\">\n {{ entry.detail }}\n </span>\n }\n </li>\n }\n </ul>\n}\n","import {\n ComponentRef,\n DestroyRef,\n Directive,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n input,\n} from '@angular/core';\nimport {\n ConnectedPosition,\n Overlay,\n OverlayRef,\n type FlexibleConnectedPositionStrategyOrigin,\n} from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { closeOnScroll } from '@ids-group-ltd/ids-design-system/components';\nimport { ChartTooltipPanelComponent } from './chart-tooltip-panel.component';\nimport type {\n ChartTooltipContext,\n ChartTooltipOrigin,\n} from './chart-tooltip.types';\n\nconst POINTER_GAP_PX = 6;\n// A fingertip covers roughly 40 CSS px, so a touch-opened panel has to clear the tap\n// point by more than a pointer-opened one does.\nconst TOUCH_GAP_PX = 48;\n\n// Keeps the panel off the screen edge, and matches the `--space-3` the panel reserves in its own\n// `max-height`. The two have to agree: CDK pushes against this margin, and a panel allowed to grow\n// past what the margin leaves is one push cannot fit.\nconst VIEWPORT_MARGIN_PX = 12;\n\n// Four fallbacks are what make the panel flip out of a small dashboard card rather than be\n// clipped by it. Above first, except while a mark is HELD: the Unpin control sits at the plot's\n// top edge, and a panel that opens upward from a mark in the upper half lands on top of it. The\n// panel is portaled to the body, so no z-index can lift the control over it — an app layout that\n// isolates its own stacking context traps the chart's chrome below the overlay whatever number it\n// carries.\nfunction positionsFor(gap: number, preferBelow: boolean): ConnectedPosition[] {\n const above: ConnectedPosition = {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -gap,\n };\n const below: ConnectedPosition = {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: gap,\n };\n\n return [\n ...(preferBelow ? [below, above] : [above, below]),\n {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: gap,\n },\n {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -gap,\n },\n ];\n}\n\n/**\n * The chart tooltip, driven entirely by the context a chart hands it: non-null opens the\n * panel, null closes it. Pointer and keyboard therefore share one path — a chart that\n * sets the context on `focus` gets the panel with no pointer involved.\n *\n * @internal\n */\n@Directive({\n selector: '[dsChartTooltip]',\n standalone: true,\n})\nexport class ChartTooltipDirective {\n private readonly overlay = inject(Overlay);\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n readonly dsChartTooltip = input<ChartTooltipContext | null>(null);\n readonly dsChartTooltipOrigin = input<ChartTooltipOrigin | null>(null);\n readonly dsChartTooltipTemplate = input<TemplateRef<{\n $implicit: ChartTooltipContext;\n }> | null>(null);\n\n /** Extra clearance between the mark and the panel, on top of the pointer default. A chart that\n * prints something ABOVE its mark — a column with its value on top — needs the panel to clear\n * that text as well as the mark, or the two overlap. Ignored for touch, where the gap is already\n * sized for a fingertip. */\n readonly dsChartTooltipExtraGap = input(0);\n /** Opens the panel BELOW the mark first. A chart sets it while a mark is held, so the panel\n * leaves the plot's top edge — and the Unpin control that lives there — alone. */\n readonly dsChartTooltipPreferBelow = input(false);\n\n private overlayRef: OverlayRef | null = null;\n private panelRef: ComponentRef<ChartTooltipPanelComponent> | null = null;\n private detachScrollReposition: (() => void) | null = null;\n private detachEscape: (() => void) | null = null;\n\n constructor() {\n effect(() => {\n const context = this.dsChartTooltip();\n const origin = this.dsChartTooltipOrigin();\n if (!context?.entries.length || !origin) {\n this.close();\n\n return;\n }\n this.open(context, origin);\n });\n inject(DestroyRef).onDestroy(() => this.close());\n }\n\n private open(context: ChartTooltipContext, origin: ChartTooltipOrigin): void {\n // Reposition rather than re-create while the pointer moves between marks: a fresh\n // OverlayRef per mark restarts the enter transition on every band it crosses.\n if (!this.overlayRef) {\n this.overlayRef = this.overlay.create({\n positionStrategy: this.strategyFor(origin),\n panelClass: ['ds-overlay-pane', 'ds-chart-tooltip-pane'],\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n });\n this.panelRef = this.overlayRef.attach(\n new ComponentPortal(ChartTooltipPanelComponent, this.viewContainerRef),\n );\n // CDK's reposition strategy watches `window` and registered `cdkScrollable`s only, so it\n // misses an app's own `overflow: auto` container. Moved rather than closed: a PINNED mark\n // stops answering pointer moves, so a close here would be permanent, leaving the pin glyph\n // and the Unpin control standing over a reading that is gone.\n this.detachScrollReposition = closeOnScroll(this.overlayRef, () =>\n this.overlayRef?.updatePosition(),\n );\n this.detachEscape = this.closeOnEscape();\n } else {\n this.overlayRef.updatePositionStrategy(this.strategyFor(origin));\n }\n this.panelRef?.setInput('context', context);\n this.panelRef?.setInput('template', this.dsChartTooltipTemplate());\n }\n\n private strategyFor(origin: ChartTooltipOrigin) {\n const gap = coarsePointer()\n ? TOUCH_GAP_PX\n : POINTER_GAP_PX + this.dsChartTooltipExtraGap();\n\n return this.overlay\n .position()\n .flexibleConnectedTo(origin as FlexibleConnectedPositionStrategyOrigin)\n .withFlexibleDimensions(false)\n .withPush(true)\n .withViewportMargin(VIEWPORT_MARGIN_PX)\n .withPositions(positionsFor(gap, this.dsChartTooltipPreferBelow()));\n }\n\n // WCAG 1.4.13 wants the panel dismissable WITHOUT moving the pointer or the focus, which rules\n // out \"move off the mark\". Nothing re-opens it afterwards: the effect re-runs on a CHANGE to the\n // context or the origin, and neither changes while the pointer rests where it already is — so the\n // reader keeps the screen they cleared until they visit another mark.\n private closeOnEscape(): () => void {\n if (typeof document === 'undefined') {\n return () => undefined;\n }\n const onKeydown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n this.close();\n }\n };\n document.addEventListener('keydown', onKeydown, true);\n\n return () => document.removeEventListener('keydown', onKeydown, true);\n }\n\n private close(): void {\n this.detachEscape?.();\n this.detachEscape = null;\n this.detachScrollReposition?.();\n this.detachScrollReposition = null;\n this.overlayRef?.dispose();\n this.overlayRef = null;\n this.panelRef = null;\n }\n}\n\nfunction coarsePointer(): boolean {\n return (\n typeof window !== 'undefined' &&\n window.matchMedia('(pointer: coarse)').matches\n );\n}\n","import { DestroyRef, Signal, inject, signal } from '@angular/core';\n\n/** @internal */\nexport interface ChartActiveMark {\n /** Index of the mark under the pointer or holding focus; `-1` when none is. */\n readonly index: Signal<number>;\n /** The mark's own element, which is what the tooltip anchors to. */\n readonly origin: Signal<Element | null>;\n /** Whether the active mark is held rather than followed — a tap, or a click under `pinOnClick`. */\n readonly pinned: Signal<boolean>;\n enter(index: number, event: Event, anchor?: string | Element | null): void;\n /** Moves the active index with no pointer behind it - a keyboard, or a mark handing over which\n * category it took focus on. Leaves the anchor alone: the caller that has no event has no\n * element to aim at either. A pin holds against this too. */\n setIndex(index: number): void;\n leave(): void;\n /** Holds the mark that was activated, for any pointer type. Activating the mark that is already\n * pinned releases it, so one gesture both sets and clears. */\n pin(index: number, event: Event, anchor?: string | Element | null): void;\n /** Lets go of a held mark, for a control that offers the way out in as many words. */\n release(): void;\n}\n\n/**\n * The pointer-and-focus target the tooltip reads, for a chart whose marks are elements.\n * Pointer and keyboard write the same pair, so a chart wires `pointerenter` and `focus` to\n * `enter` and gets one code path rather than two.\n *\n * A TAP LATCHES. A touch fires `pointerleave` the moment the finger lifts, so without this the\n * panel would flash and vanish; latched, it stays until the next tap lands outside the mark. Call\n * from an injection context — the release listener is torn down with the component.\n *\n * @internal\n */\nexport function chartActiveMark(\n lingerMs: () => number = () => 0,\n): ChartActiveMark {\n const index = signal(-1);\n const origin = signal<Element | null>(null);\n // One flag for two ways of arriving at the same state: a tap, which has no hover to hold the\n // panel open, and a deliberate click under `pinOnClick`. Both release the same way.\n const pinned = signal(false);\n let pendingClear: ReturnType<typeof setTimeout> | null = null;\n // The element that OWNS the handlers, which is not always the tooltip anchor: a column anchors\n // its panel to the bar while the whole cell answers the pointer. A press is \"outside\" only when\n // it misses this, or a click on the cell beside the bar would release the pin and immediately\n // re-take it, leaving the pin looking stuck.\n let host: Element | null = null;\n\n const clear = (): void => {\n pinned.set(false);\n host = null;\n cancelPendingClear();\n index.set(-1);\n origin.set(null);\n document.removeEventListener('pointerdown', release, true);\n document.removeEventListener('keydown', releaseOnEscape, true);\n document.removeEventListener('pointerover', trackPointer, true);\n };\n\n // The tooltip anchors to the MARK, not to the box that catches the pointer: a column's cell is\n // the full plot height, so anchoring to it opens the panel at the top of the chart rather than\n // over the column it is about. A selector is resolved INSIDE the box; a legend item's mark is not\n // inside it, so that caller passes the element.\n const aim = (\n at: number,\n event: Event,\n anchor?: string | Element | null,\n ): void => {\n const target = event.currentTarget;\n if (target instanceof Element) {\n host = target;\n const mark =\n typeof anchor === 'string' ? target.querySelector(anchor) : anchor;\n origin.set(mark ?? target);\n }\n index.set(at);\n };\n\n const hold = (): void => {\n pinned.set(true);\n cancelPendingClear();\n document.addEventListener('pointerdown', release, true);\n document.addEventListener('keydown', releaseOnEscape, true);\n };\n\n // Escape releases the mark as well as the panel. Without this the panel would go and the dimming\n // it caused would stay, leaving the chart in a state with nothing on screen explaining it.\n const releaseOnEscape = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n clear();\n }\n };\n\n const cancelPendingClear = (): void => {\n if (pendingClear !== null) {\n clearTimeout(pendingClear);\n pendingClear = null;\n }\n };\n\n const scheduleClear = (): void => {\n cancelPendingClear();\n pendingClear = setTimeout(\n () => {\n pendingClear = null;\n index.set(-1);\n origin.set(null);\n document.removeEventListener('pointerover', trackPointer, true);\n },\n Math.max(lingerMs(), 0),\n );\n };\n\n // One listener answers both halves of \"is the pointer on the panel\": `pointerover` fires on every\n // element the pointer crosses, so arriving on the panel cancels the clear and leaving it for\n // anything that is not the mark schedules a new one. Without the second half a panel the pointer\n // once touched would never close, because the mark's own `pointerleave` has already fired.\n const trackPointer = (event: PointerEvent): void => {\n if (!(event.target instanceof Element)) {\n return;\n }\n if (pinned() || event.target.closest('.ds-chart-tooltip-pane')) {\n cancelPendingClear();\n\n return;\n }\n // Against the HOST, not the anchor: a legend item and the arc its panel points at are disjoint\n // elements, so testing the anchor would clear the panel the moment the pointer moved inside the\n // legend item that opened it.\n if (!host || !host.contains(event.target)) {\n scheduleClear();\n }\n };\n\n // The chart the aimed mark belongs to. Every chart puts its plot in one `<figure>`, so this is\n // what tells \"pressed another mark of the same chart\" apart from \"pressed away\".\n const chartOf = (element: Element | null): Element | null =>\n element ? element.closest('figure') : null;\n\n const release = (event: PointerEvent): void => {\n if (!(event.target instanceof Element)) {\n clear();\n\n return;\n }\n if (host && host.contains(event.target)) {\n return;\n }\n // Hopping the pin from one mark to the next must not pass through \"nothing is pinned\". This\n // handler runs on `pointerdown`, the re-aim on the `click` after it, so clearing here would\n // unmount the Unpin control and the pinned styling for a frame and mount them again — a\n // flicker on every hop. The press is a re-aim when it lands on another mark of the same chart.\n const pressedMark = event.target.closest('[data-mark-index]');\n if (pressedMark && chartOf(pressedMark) === chartOf(host)) {\n return;\n }\n clear();\n };\n\n if (typeof document !== 'undefined') {\n inject(DestroyRef).onDestroy(() => {\n cancelPendingClear();\n document.removeEventListener('pointerdown', release, true);\n document.removeEventListener('pointerover', trackPointer, true);\n });\n }\n\n return {\n index: index.asReadonly(),\n origin: origin.asReadonly(),\n pinned: pinned.asReadonly(),\n enter(at, event, anchor) {\n // A pin HOLDS. Without this the next mark the pointer crossed took the active slot straight\n // back, so pinning appeared to work and then followed the pointer anyway — the one thing a\n // pin exists not to do. It is released by Escape, or by a press outside the pinned mark.\n if (pinned()) {\n return;\n }\n aim(at, event, anchor);\n cancelPendingClear();\n if (typeof document !== 'undefined') {\n document.addEventListener('pointerover', trackPointer, true);\n }\n if (\n typeof document !== 'undefined' &&\n event instanceof PointerEvent &&\n event.pointerType === 'touch'\n ) {\n hold();\n }\n },\n setIndex(at) {\n if (pinned()) {\n return;\n }\n cancelPendingClear();\n index.set(at);\n },\n leave() {\n if (pinned()) {\n return;\n }\n scheduleClear();\n },\n release() {\n if (typeof document !== 'undefined') {\n clear();\n }\n },\n pin(at, event, anchor) {\n if (typeof document === 'undefined') {\n return;\n }\n // The same gesture that set the pin clears it. A press on a DIFFERENT mark has already gone\n // through `release` by the time the click lands, so this only ever sees a fresh mark or the\n // pinned one.\n if (pinned() && index() === at) {\n clear();\n\n return;\n }\n // Re-aiming while already pinned keeps `pinned` true throughout, so nothing that renders on\n // it — the Unpin control, the held mark's styling — unmounts between the two marks.\n aim(at, event, anchor);\n if (!pinned()) {\n hold();\n }\n },\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAyBa,0BAA0B,CAAA;;AAE5B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAAuB;;AAE/C,IAAA,QAAQ,GAAG,KAAK,CAEd,IAAI,+EAAC;wGANL,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECzBvC,kzBAoCA,EAAA,MAAA,EAAA,CAAA,8wCAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDvBY,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,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AC7B;AACA,gBAAA,IAAI,EAAE;YACR;QACF,CAAC;AACD,QAAA,QAAQ,CAAC,EAAE,EAAA;YACT,IAAI,MAAM,EAAE,EAAE;gBACZ;YACF;AACA,YAAA,kBAAkB,EAAE;AACpB,YAAA,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACf,CAAC;QACD,KAAK,GAAA;YACH,IAAI,MAAM,EAAE,EAAE;gBACZ;YACF;AACA,YAAA,aAAa,EAAE;QACjB,CAAC;QACD,OAAO,GAAA;AACL,YAAA,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;AACnC,gBAAA,KAAK,EAAE;YACT;QACF,CAAC;AACD,QAAA,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAA;AACnB,YAAA,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;gBACnC;YACF;;;;YAIA,IAAI,MAAM,EAAE,IAAI,KAAK,EAAE,KAAK,EAAE,EAAE;AAC9B,gBAAA,KAAK,EAAE;gBAEP;YACF;;;AAGA,YAAA,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC;AACtB,YAAA,IAAI,CAAC,MAAM,EAAE,EAAE;AACb,gBAAA,IAAI,EAAE;YACR;QACF,CAAC;KACF;AACH;;ACtOA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-chart-tooltip.mjs","sources":["../../../src/lib/components/chart-tooltip/chart-tooltip-panel.component.ts","../../../src/lib/components/chart-tooltip/chart-tooltip-panel.component.html","../../../src/lib/components/chart-tooltip/chart-tooltip.directive.ts","../../../src/lib/components/chart-tooltip/chart-active-mark.ts","../../../src/lib/components/chart-tooltip/ids-group-ltd-ids-design-system-components-chart-tooltip.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n input,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport type { ChartTooltipContext } from './chart-tooltip.types';\n\n@Component({\n selector: 'ds-chart-tooltip-panel',\n standalone: true,\n imports: [NgTemplateOutlet],\n templateUrl: './chart-tooltip-panel.component.html',\n styleUrl: './chart-tooltip-panel.component.scss',\n host: {\n // Hidden from assistive technology on purpose: every interactive mark already\n // carries the same label and value in its `aria-label`, so exposing the panel\n // makes a screen reader read each reading twice.\n 'aria-hidden': 'true',\n },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ChartTooltipPanelComponent {\n /** The category and the readings the panel prints. */\n readonly context = input.required<ChartTooltipContext>();\n /** The chart's projected `#dsChartTooltip` template. Null renders the built-in rows. */\n readonly template = input<TemplateRef<{\n $implicit: ChartTooltipContext;\n }> | null>(null);\n}\n","@if (template(); as projected) {\n <ng-container\n [ngTemplateOutlet]=\"projected\"\n [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n} @else {\n @if (context().category) {\n <p class=\"category\">\n {{ context().category }}\n </p>\n }\n\n <ul class=\"entries\">\n @for (entry of context().entries; track $index) {\n <li class=\"entry\">\n <span\n class=\"swatch\"\n [class.hatched]=\"entry.hatched\"\n [style.background-color]=\"entry.color\">\n </span>\n\n <span class=\"label\">\n {{ entry.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formatted }}\n </span>\n\n @if (entry.detail) {\n <span class=\"detail\">\n {{ entry.detail }}\n </span>\n }\n </li>\n }\n </ul>\n}\n","import {\n ComponentRef,\n DestroyRef,\n Directive,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n input,\n} from '@angular/core';\nimport {\n ConnectedPosition,\n Overlay,\n OverlayRef,\n type FlexibleConnectedPositionStrategyOrigin,\n} from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n closeOnScroll,\n disposeWithLeave,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { ChartTooltipPanelComponent } from './chart-tooltip-panel.component';\nimport type {\n ChartTooltipContext,\n ChartTooltipOrigin,\n} from './chart-tooltip.types';\n\nconst POINTER_GAP_PX = 10;\n// A fingertip covers roughly 40 CSS px, so a touch-opened panel has to clear the tap\n// point by more than a pointer-opened one does.\nconst TOUCH_GAP_PX = 48;\n\n// Keeps the panel off the screen edge, and matches the `--space-3` the panel reserves in its own\n// `max-height`. The two have to agree: CDK pushes against this margin, and a panel allowed to grow\n// past what the margin leaves is one push cannot fit.\nconst VIEWPORT_MARGIN_PX = 12;\n\n// Four fallbacks are what make the panel flip out of a small dashboard card rather than be\n// clipped by it. Above first, except while a mark is HELD: the Unpin control sits at the plot's\n// top edge, and a panel that opens upward from a mark in the upper half lands on top of it. The\n// panel is portaled to the body, so no z-index can lift the control over it — an app layout that\n// isolates its own stacking context traps the chart's chrome below the overlay whatever number it\n// carries.\nfunction positionsFor(gap: number, preferBelow: boolean): ConnectedPosition[] {\n const above: ConnectedPosition = {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -gap,\n };\n const below: ConnectedPosition = {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: gap,\n };\n\n return [\n ...(preferBelow ? [below, above] : [above, below]),\n {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: gap,\n },\n {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -gap,\n },\n ];\n}\n\n/**\n * The chart tooltip, driven entirely by the context a chart hands it: non-null opens the\n * panel, null closes it. Pointer and keyboard therefore share one path — a chart that\n * sets the context on `focus` gets the panel with no pointer involved.\n *\n * @internal\n */\n@Directive({\n selector: '[dsChartTooltip]',\n standalone: true,\n})\nexport class ChartTooltipDirective {\n private readonly overlay = inject(Overlay);\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n readonly dsChartTooltip = input<ChartTooltipContext | null>(null);\n readonly dsChartTooltipOrigin = input<ChartTooltipOrigin | null>(null);\n readonly dsChartTooltipTemplate = input<TemplateRef<{\n $implicit: ChartTooltipContext;\n }> | null>(null);\n\n /** Extra clearance between the mark and the panel, on top of the pointer default. A chart that\n * prints something ABOVE its mark — a column with its value on top — needs the panel to clear\n * that text as well as the mark, or the two overlap. Ignored for touch, where the gap is already\n * sized for a fingertip. */\n readonly dsChartTooltipExtraGap = input(0);\n /** Opens the panel BELOW the mark first. A chart sets it while a mark is held, so the panel\n * leaves the plot's top edge — and the Unpin control that lives there — alone. */\n readonly dsChartTooltipPreferBelow = input(false);\n\n /** A held panel takes the pointer again, so its text can be selected. While it merely follows\n * the pointer the pane stays inert, or the mark it covers never sees the pointer at all. */\n readonly dsChartTooltipPinned = input(false);\n\n private overlayRef: OverlayRef | null = null;\n private panelRef: ComponentRef<ChartTooltipPanelComponent> | null = null;\n private detachScrollReposition: (() => void) | null = null;\n private detachEscape: (() => void) | null = null;\n\n constructor() {\n effect(() => {\n const context = this.dsChartTooltip();\n const origin = this.dsChartTooltipOrigin();\n if (!context?.entries.length || !origin) {\n this.close();\n\n return;\n }\n this.open(context, origin);\n });\n inject(DestroyRef).onDestroy(() => this.close());\n }\n\n private open(context: ChartTooltipContext, origin: ChartTooltipOrigin): void {\n // Reposition rather than re-create while the pointer moves between marks: a fresh\n // OverlayRef per mark restarts the enter transition on every band it crosses.\n if (!this.overlayRef) {\n this.overlayRef = this.overlay.create({\n positionStrategy: this.strategyFor(origin),\n panelClass: ['ds-overlay-pane', 'ds-chart-tooltip-pane'],\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n });\n this.panelRef = this.overlayRef.attach(\n new ComponentPortal(ChartTooltipPanelComponent, this.viewContainerRef),\n );\n // CDK's reposition strategy watches `window` and registered `cdkScrollable`s only, so it\n // misses an app's own `overflow: auto` container. Moved rather than closed: a PINNED mark\n // stops answering pointer moves, so a close here would be permanent, leaving the pin glyph\n // and the Unpin control standing over a reading that is gone.\n this.detachScrollReposition = closeOnScroll(this.overlayRef, () =>\n this.overlayRef?.updatePosition(),\n );\n this.detachEscape = this.closeOnEscape();\n } else {\n this.overlayRef.updatePositionStrategy(this.strategyFor(origin));\n }\n this.overlayRef.overlayElement.classList.toggle(\n 'is-pinned',\n this.dsChartTooltipPinned(),\n );\n this.panelRef?.setInput('context', context);\n this.panelRef?.setInput('template', this.dsChartTooltipTemplate());\n }\n\n private strategyFor(origin: ChartTooltipOrigin) {\n const gap = coarsePointer()\n ? TOUCH_GAP_PX\n : POINTER_GAP_PX + this.dsChartTooltipExtraGap();\n\n return this.overlay\n .position()\n .flexibleConnectedTo(origin as FlexibleConnectedPositionStrategyOrigin)\n .withFlexibleDimensions(false)\n .withPush(true)\n .withViewportMargin(VIEWPORT_MARGIN_PX)\n .withPositions(positionsFor(gap, this.dsChartTooltipPreferBelow()));\n }\n\n // WCAG 1.4.13 wants the panel dismissable WITHOUT moving the pointer or the focus, which rules\n // out \"move off the mark\". Nothing re-opens it afterwards: the effect re-runs on a CHANGE to the\n // context or the origin, and neither changes while the pointer rests where it already is — so the\n // reader keeps the screen they cleared until they visit another mark.\n private closeOnEscape(): () => void {\n if (typeof document === 'undefined') {\n return () => undefined;\n }\n const onKeydown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n this.close();\n }\n };\n document.addEventListener('keydown', onKeydown, true);\n\n return () => document.removeEventListener('keydown', onKeydown, true);\n }\n\n private close(): void {\n this.detachEscape?.();\n this.detachEscape = null;\n this.detachScrollReposition?.();\n this.detachScrollReposition = null;\n // A dismissal, never a selection: the panel closes when the reader leaves the plot, and the\n // family's answer to that is a fade. Moving between marks repositions this overlay rather than\n // closing it, so nothing here can lag behind the pointer.\n disposeWithLeave(this.overlayRef, 'dismiss');\n this.overlayRef = null;\n this.panelRef = null;\n }\n}\n\nfunction coarsePointer(): boolean {\n return (\n typeof window !== 'undefined' &&\n window.matchMedia('(pointer: coarse)').matches\n );\n}\n","import { DestroyRef, Signal, inject, signal } from '@angular/core';\n\n/** @internal */\nexport interface ChartActiveMark {\n /** Index of the mark under the pointer or holding focus; `-1` when none is. */\n readonly index: Signal<number>;\n /** The mark's own element, which is what the tooltip anchors to. */\n readonly origin: Signal<Element | null>;\n /** Whether the active mark is held rather than followed — a tap, or a click under `pinOnClick`. */\n readonly pinned: Signal<boolean>;\n /** `mark` is the hovered element, for a listener delegated to the marks' parent; it defaults to\n * the event's `currentTarget`. */\n enter(\n index: number,\n event: Event,\n anchor?: string | Element | null,\n mark?: Element,\n ): void;\n /** Moves the active index with no pointer behind it - a keyboard, or a mark handing over which\n * category it took focus on. Leaves the anchor alone: the caller that has no event has no\n * element to aim at either. A pin holds against this too. */\n setIndex(index: number): void;\n leave(): void;\n /** Holds the mark that was activated, for any pointer type. Activating the mark that is already\n * pinned releases it, so one gesture both sets and clears. */\n pin(\n index: number,\n event: Event,\n anchor?: string | Element | null,\n mark?: Element,\n ): void;\n /** Lets go of a held mark, for a control that offers the way out in as many words. */\n release(): void;\n}\n\n/**\n * The pointer-and-focus target the tooltip reads, for a chart whose marks are elements.\n * Pointer and keyboard write the same pair, so a chart wires `pointerenter` and `focus` to\n * `enter` and gets one code path rather than two.\n *\n * A TAP LATCHES. A touch fires `pointerleave` the moment the finger lifts, so without this the\n * panel would flash and vanish; latched, it stays until the next tap lands outside the mark. Call\n * from an injection context — the release listener is torn down with the component.\n *\n * @internal\n */\nexport function chartActiveMark(\n lingerMs: () => number = () => 0,\n): ChartActiveMark {\n const index = signal(-1);\n const origin = signal<Element | null>(null);\n // One flag for two ways of arriving at the same state: a tap, which has no hover to hold the\n // panel open, and a deliberate click under `pinOnClick`. Both release the same way.\n const pinned = signal(false);\n let pendingClear: ReturnType<typeof setTimeout> | null = null;\n // The element that OWNS the handlers, which is not always the tooltip anchor: a column anchors\n // its panel to the bar while the whole cell answers the pointer. A press is \"outside\" only when\n // it misses this, or a click on the cell beside the bar would release the pin and immediately\n // re-take it, leaving the pin looking stuck.\n let host: Element | null = null;\n\n const clear = (): void => {\n pinned.set(false);\n host = null;\n cancelPendingClear();\n index.set(-1);\n origin.set(null);\n document.removeEventListener('pointerdown', release, true);\n document.removeEventListener('keydown', releaseOnEscape, true);\n document.removeEventListener('pointerover', trackPointer, true);\n };\n\n // The tooltip anchors to the MARK, not to the box that catches the pointer: a column's cell is\n // the full plot height, so anchoring to it opens the panel at the top of the chart rather than\n // over the column it is about. A selector is resolved INSIDE the box; a legend item's mark is not\n // inside it, so that caller passes the element.\n const aim = (\n at: number,\n event: Event,\n anchor?: string | Element | null,\n mark: EventTarget | null = event.currentTarget,\n ): void => {\n const target = mark;\n if (target instanceof Element) {\n host = target;\n const mark =\n typeof anchor === 'string' ? target.querySelector(anchor) : anchor;\n // A mark drawn from a zero value is degenerate in one axis - a column loses its height, a\n // bar its width - and an overlay anchored to it lands at that edge rather than near the\n // reading. Both dimensions have to be real. The hover target always is.\n const box = mark?.getBoundingClientRect();\n const aimable = box && box.width > 0 && box.height > 0;\n origin.set(aimable ? (mark ?? target) : target);\n }\n index.set(at);\n };\n\n const hold = (): void => {\n pinned.set(true);\n cancelPendingClear();\n document.addEventListener('pointerdown', release, true);\n document.addEventListener('keydown', releaseOnEscape, true);\n };\n\n // Escape releases the mark as well as the panel. Without this the panel would go and the dimming\n // it caused would stay, leaving the chart in a state with nothing on screen explaining it.\n const releaseOnEscape = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n clear();\n }\n };\n\n const cancelPendingClear = (): void => {\n if (pendingClear !== null) {\n clearTimeout(pendingClear);\n pendingClear = null;\n }\n };\n\n const scheduleClear = (): void => {\n cancelPendingClear();\n pendingClear = setTimeout(\n () => {\n pendingClear = null;\n index.set(-1);\n origin.set(null);\n document.removeEventListener('pointerover', trackPointer, true);\n },\n Math.max(lingerMs(), 0),\n );\n };\n\n // One listener answers both halves of \"is the pointer on the panel\": `pointerover` fires on every\n // element the pointer crosses, so arriving on the panel cancels the clear and leaving it for\n // anything that is not the mark schedules a new one. Without the second half a panel the pointer\n // once touched would never close, because the mark's own `pointerleave` has already fired.\n const trackPointer = (event: PointerEvent): void => {\n if (!(event.target instanceof Element)) {\n return;\n }\n if (pinned() || event.target.closest('.ds-chart-tooltip-pane')) {\n cancelPendingClear();\n\n return;\n }\n // Against the HOST, not the anchor: a legend item and the arc its panel points at are disjoint\n // elements, so testing the anchor would clear the panel the moment the pointer moved inside the\n // legend item that opened it.\n if (!host || !host.contains(event.target)) {\n scheduleClear();\n }\n };\n\n // The chart the aimed mark belongs to. Every chart puts its plot in one `<figure>`, so this is\n // what tells \"pressed another mark of the same chart\" apart from \"pressed away\".\n const chartOf = (element: Element | null): Element | null =>\n element ? element.closest('figure') : null;\n\n const release = (event: PointerEvent): void => {\n if (!(event.target instanceof Element)) {\n clear();\n\n return;\n }\n if (host && host.contains(event.target)) {\n return;\n }\n // Hopping the pin from one mark to the next must not pass through \"nothing is pinned\". This\n // handler runs on `pointerdown`, the re-aim on the `click` after it, so clearing here would\n // unmount the Unpin control and the pinned styling for a frame and mount them again — a\n // flicker on every hop. The press is a re-aim when it lands on another mark of the same chart.\n const pressedMark = event.target.closest('[data-mark-index]');\n if (pressedMark && chartOf(pressedMark) === chartOf(host)) {\n return;\n }\n clear();\n };\n\n if (typeof document !== 'undefined') {\n inject(DestroyRef).onDestroy(() => {\n cancelPendingClear();\n document.removeEventListener('pointerdown', release, true);\n document.removeEventListener('keydown', releaseOnEscape, true);\n document.removeEventListener('pointerover', trackPointer, true);\n });\n }\n\n return {\n index: index.asReadonly(),\n origin: origin.asReadonly(),\n pinned: pinned.asReadonly(),\n enter(at, event, anchor, mark) {\n // A pin HOLDS. Without this the next mark the pointer crossed took the active slot straight\n // back, so pinning appeared to work and then followed the pointer anyway — the one thing a\n // pin exists not to do. It is released by Escape, or by a press outside the pinned mark.\n if (pinned()) {\n return;\n }\n aim(at, event, anchor, mark);\n cancelPendingClear();\n if (typeof document !== 'undefined') {\n document.addEventListener('pointerover', trackPointer, true);\n }\n if (\n typeof document !== 'undefined' &&\n event instanceof PointerEvent &&\n event.pointerType === 'touch'\n ) {\n hold();\n }\n },\n setIndex(at) {\n if (pinned()) {\n return;\n }\n cancelPendingClear();\n index.set(at);\n },\n leave() {\n if (pinned()) {\n return;\n }\n scheduleClear();\n },\n release() {\n if (typeof document !== 'undefined') {\n clear();\n }\n },\n pin(at, event, anchor, mark) {\n if (typeof document === 'undefined') {\n return;\n }\n // The same gesture that set the pin clears it. A press on a DIFFERENT mark has already gone\n // through `release` by the time the click lands, so this only ever sees a fresh mark or the\n // pinned one.\n if (pinned() && index() === at) {\n clear();\n\n return;\n }\n // Re-aiming while already pinned keeps `pinned` true throughout, so nothing that renders on\n // it — the Unpin control, the held mark's styling — unmounts between the two marks.\n aim(at, event, anchor, mark);\n if (!pinned()) {\n hold();\n }\n },\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAyBa,0BAA0B,CAAA;;AAE5B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAAuB;;AAE/C,IAAA,QAAQ,GAAG,KAAK,CAEd,IAAI,+EAAC;wGANL,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECzBvC,g2BAqCA,EAAA,MAAA,EAAA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