@ids-group-ltd/ids-design-system 0.12.2 → 0.13.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 +751 -6
- package/components.md +87 -2
- package/docs/agent/INDEX.md +11 -1
- package/docs/agent/charts/chart-colour-which-palette-a-chart-takes.md +9 -0
- package/docs/agent/charts/chart-frame-the-box-a-chart-draws-around-itself.md +12 -0
- package/docs/agent/charts/ds-bar-chart.md +15 -0
- package/docs/agent/charts/ds-column-chart.md +14 -0
- package/docs/agent/charts/ds-donut-chart.md +17 -0
- package/docs/agent/charts/ds-funnel-chart.md +16 -0
- package/docs/agent/charts/ds-line-chart.md +15 -0
- package/docs/agent/forms/ds-button.md +6 -2
- package/docs/agent/forms/ds-number-stepper.md +1 -0
- package/docs/agent/navigation/ds-sidenav-item.md +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +16 -14
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +161 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +20 -21
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +107 -40
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +43 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +197 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +10 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +3 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +173 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +9 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +299 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +69 -17
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +366 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +12 -16
- 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 +631 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +3 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +3 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +14 -22
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +9 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +18 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +4 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +10 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +30 -71
- 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 +3 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +3 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +31 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +409 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +17 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +3 -0
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +10 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.12.3.json +83 -0
- package/migrations/0.13.0.json +530 -0
- package/package.json +57 -1
- package/styles/_chart-data-table.scss +95 -0
- package/styles/_chart-frame.scss +53 -0
- package/styles/_chart-interactive.scss +40 -0
- package/styles/_chart-motion.scss +45 -0
- package/styles/_control-line.scss +45 -0
- package/styles/_field-state.scss +14 -15
- package/styles/_focus.scss +31 -60
- package/styles/_tokens-charts.scss +149 -39
- package/styles/_tokens.scss +35 -31
- package/themes/dark/_theme.scss +37 -29
- package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +11 -9
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +104 -0
- package/types/ids-group-ltd-ids-design-system-components-breadcrumbs.d.ts +8 -17
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +60 -30
- package/types/ids-group-ltd-ids-design-system-components-chart-legend.d.ts +34 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +78 -0
- package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +105 -0
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +4 -1
- package/types/ids-group-ltd-ids-design-system-components-donut-chart.d.ts +113 -0
- package/types/ids-group-ltd-ids-design-system-components-field-group.d.ts +52 -11
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +109 -0
- package/types/ids-group-ltd-ids-design-system-components-input.d.ts +5 -7
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +241 -0
- package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +10 -10
- package/types/ids-group-ltd-ids-design-system-components-select.d.ts +5 -2
- package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +16 -4
- package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +6 -1
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +13 -28
- package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +11 -1
- package/types/ids-group-ltd-ids-design-system-components.d.ts +163 -3
- package/types/ids-group-ltd-ids-design-system-core.d.ts +12 -1
- package/types/ids-group-ltd-ids-design-system.d.ts +9 -2
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, numberAttribute, booleanAttribute, output, contentChild, signal, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { formatValue, staggerDelay, nextRovingIndex, focusMark, chartColors, formatPercent, describeSeries } from '@ids-group-ltd/ids-design-system/components';
|
|
4
|
+
import { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';
|
|
5
|
+
import { chartActiveMark, ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
|
|
6
|
+
|
|
7
|
+
/** Largest finite value, or `explicitMax` when it is a usable track length. A
|
|
8
|
+
* non-finite datum is skipped rather than compared: one `Infinity` row would
|
|
9
|
+
* otherwise become the track length and flatten every other row to nothing. */
|
|
10
|
+
function resolveMax(explicitMax, values) {
|
|
11
|
+
if (explicitMax !== null && Number.isFinite(explicitMax) && explicitMax > 0) {
|
|
12
|
+
return explicitMax;
|
|
13
|
+
}
|
|
14
|
+
const finite = values.filter((value) => Number.isFinite(value));
|
|
15
|
+
return finite.length ? Math.max(...finite) : 0;
|
|
16
|
+
}
|
|
17
|
+
/** Track share for one row, in percent. Has no upper bound: an explicit `max`
|
|
18
|
+
* below the data is the caller's statement, and `.track` clips the overflow. */
|
|
19
|
+
function widthPercent(value, max) {
|
|
20
|
+
// Math.max(NaN, 0) is NaN, so the lower clamp cannot stand in for this test —
|
|
21
|
+
// and the result is written into a style attribute, where `width: NaN%` is
|
|
22
|
+
// dropped silently.
|
|
23
|
+
if (!Number.isFinite(value) || !Number.isFinite(max) || max <= 0) {
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
return Math.max((value / max) * 100, 0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const defaultValueFormat = (value) => formatValue(value);
|
|
30
|
+
class BarChartComponent {
|
|
31
|
+
/** One row per bar, drawn in the order given. */
|
|
32
|
+
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
33
|
+
/** Track length is relative to this. Null uses the largest value, so the
|
|
34
|
+
* longest row always fills its track. */
|
|
35
|
+
max = input(null, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
|
|
36
|
+
/** Printed above the plot as the chart's visible title, and reused as the annex table's
|
|
37
|
+
* caption. */
|
|
38
|
+
caption = input(null, ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
39
|
+
/** Accessible name. Generated from the data when omitted. */
|
|
40
|
+
summary = input(null, ...(ngDevMode ? [{ debugName: "summary" }] : /* istanbul ignore next */ []));
|
|
41
|
+
/** The label-and-value table under the plot: `'toggle'` puts it behind a disclosure,
|
|
42
|
+
* `'visible'` opens it, `'none'` renders none. It is the non-visual route to the numbers, so
|
|
43
|
+
* `'none'` belongs only where the same data is already in a table on the page. */
|
|
44
|
+
dataTable = input('toggle', ...(ngDevMode ? [{ debugName: "dataTable" }] : /* istanbul ignore next */ []));
|
|
45
|
+
/** Prints each row's share of `max` beside its value. */
|
|
46
|
+
showPercent = input(true, { ...(ngDevMode ? { debugName: "showPercent" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
47
|
+
/** Draws skeleton marks in place of the data, at the same count, so the chart does not resize
|
|
48
|
+
* when the data lands. */
|
|
49
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
50
|
+
/** Shown in place of the plot when `data` is empty. */
|
|
51
|
+
emptyText = input('No data', ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
52
|
+
/** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,
|
|
53
|
+
* because "the request failed" and "there is nothing to show" read the same to a reader and
|
|
54
|
+
* mean opposite things. */
|
|
55
|
+
error = input(false, { ...(ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
56
|
+
/** The message the error state prints. */
|
|
57
|
+
errorText = input('Could not load the data', ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
58
|
+
/** Formats every value the chart prints, the annex table and the generated description
|
|
59
|
+
* included. Defaults to the browser's locale grouping with a K/M/B suffix past four digits. */
|
|
60
|
+
valueFormat = input(defaultValueFormat, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
|
|
61
|
+
/** Turns on the click affordance — the pointer cursor and any hover tint.
|
|
62
|
+
* The click output fires whether or not this is set, so a consumer that
|
|
63
|
+
* binds the output and forgets the flag still receives every click. */
|
|
64
|
+
interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
65
|
+
/** The row that was clicked, or activated with Enter or Space. Fires whether or not
|
|
66
|
+
* `interactive` is set. */
|
|
67
|
+
rowClicked = output();
|
|
68
|
+
/** Milliseconds between one mark's entrance and the next. `0`, the default, is no stagger at
|
|
69
|
+
* all; `40` is the documented non-zero step. The total is capped, so a long series does not
|
|
70
|
+
* crawl in. */
|
|
71
|
+
staggerMs = input(0, { ...(ngDevMode ? { debugName: "staggerMs" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
72
|
+
markStagger(index) {
|
|
73
|
+
return `${staggerDelay(index, this.staggerMs())}ms`;
|
|
74
|
+
}
|
|
75
|
+
/** Whether a hovered or focused row opens a tooltip. `'axis'` is not offered — a bar
|
|
76
|
+
* chart's marks ARE its categories, so an axis tooltip would repeat the item one. */
|
|
77
|
+
tooltip = input('item', ...(ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []));
|
|
78
|
+
tooltipTemplate = contentChild('dsChartTooltip', ...(ngDevMode ? [{ debugName: "tooltipTemplate" }] : /* istanbul ignore next */ []));
|
|
79
|
+
activeMark = chartActiveMark();
|
|
80
|
+
/** One tab stop per chart, not one per mark: WCAG 2.1.1's Understanding is explicit that not
|
|
81
|
+
* every mouse-operable control has to be separately focusable, and that is what keeps a
|
|
82
|
+
* twenty-five mark chart from being twenty-five stops in the page's tab order. */
|
|
83
|
+
rovingIndex = signal(0, ...(ngDevMode ? [{ debugName: "rovingIndex" }] : /* istanbul ignore next */ []));
|
|
84
|
+
tabStopIndex = computed(() => Math.min(this.rovingIndex(), Math.max(0, this.rows().length - 1)), ...(ngDevMode ? [{ debugName: "tabStopIndex" }] : /* istanbul ignore next */ []));
|
|
85
|
+
onMarkFocus(index, event) {
|
|
86
|
+
this.rovingIndex.set(index);
|
|
87
|
+
this.activeMark.enter(index, event);
|
|
88
|
+
}
|
|
89
|
+
onMarkNavigation(event, index) {
|
|
90
|
+
const next = nextRovingIndex(event.key, index, this.rows().length);
|
|
91
|
+
if (next === null) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
event.preventDefault();
|
|
95
|
+
this.rovingIndex.set(next);
|
|
96
|
+
focusMark(event.currentTarget.closest('.rows'), next);
|
|
97
|
+
}
|
|
98
|
+
tooltipContext = computed(() => {
|
|
99
|
+
const entry = this.rows()[this.activeMark.index()];
|
|
100
|
+
if (this.tooltip() === 'none' || !entry) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
category: '',
|
|
105
|
+
entries: [
|
|
106
|
+
{
|
|
107
|
+
label: entry.row.label,
|
|
108
|
+
value: entry.row.value,
|
|
109
|
+
formatted: entry.formattedValue,
|
|
110
|
+
color: entry.color,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
}, ...(ngDevMode ? [{ debugName: "tooltipContext" }] : /* istanbul ignore next */ []));
|
|
115
|
+
resolvedMax = computed(() => resolveMax(this.max(), this.data().map((row) => row.value)), ...(ngDevMode ? [{ debugName: "resolvedMax" }] : /* istanbul ignore next */ []));
|
|
116
|
+
rows = computed(() => {
|
|
117
|
+
const max = this.resolvedMax();
|
|
118
|
+
const format = this.valueFormat();
|
|
119
|
+
return this.data().map((row, index) => ({
|
|
120
|
+
key: row.id ?? String(index),
|
|
121
|
+
row,
|
|
122
|
+
widthPercent: widthPercent(row.value, max),
|
|
123
|
+
formattedValue: format(row.value),
|
|
124
|
+
formattedPercent: row.percent !== undefined
|
|
125
|
+
? formatPercent(row.percent, 100)
|
|
126
|
+
: formatPercent(row.value, max),
|
|
127
|
+
color: row.color ?? chartColors.seriesDefault,
|
|
128
|
+
}));
|
|
129
|
+
}, ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
130
|
+
accessibleName = computed(() => this.summary() ??
|
|
131
|
+
describeSeries(this.caption() ?? 'Chart', this.data().map((row) => ({ label: row.label, value: row.value })), this.valueFormat(), this.dataTable() !== 'none'), ...(ngDevMode ? [{ debugName: "accessibleName" }] : /* istanbul ignore next */ []));
|
|
132
|
+
entryLabel(entry) {
|
|
133
|
+
return `${entry.row.label}, ${entry.formattedValue}`;
|
|
134
|
+
}
|
|
135
|
+
onRowKey(row, event) {
|
|
136
|
+
// Only the row's own key opens the row: a key pressed on a control inside it belongs to that
|
|
137
|
+
// control.
|
|
138
|
+
if (!this.interactive() || event.target !== event.currentTarget) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
this.rowClicked.emit(row);
|
|
143
|
+
}
|
|
144
|
+
isEmpty = computed(() => this.data().length === 0, ...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
145
|
+
/** Placeholder bars while loading. Follows the real row count so the chart does not resize
|
|
146
|
+
* when the data lands; falls back to three when `data` is still empty. */
|
|
147
|
+
skeletonRows = computed(() => Array.from({ length: Math.max(this.data().length, 3) }), ...(ngDevMode ? [{ debugName: "skeletonRows" }] : /* istanbul ignore next */ []));
|
|
148
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: BarChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
149
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: BarChartComponent, isStandalone: true, selector: "ds-bar-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, dataTable: { classPropertyName: "dataTable", publicName: "dataTable", isSignal: true, isRequired: false, transformFunction: null }, showPercent: { classPropertyName: "showPercent", publicName: "showPercent", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rowClicked: "rowClicked" }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["dsChartTooltip"], descendants: true, isSignal: true }], ngImport: i0, template: "<figure class=\"bar-chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorText() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_bar-chart-track-height)\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyText() }}\n </p>\n } @else {\n <div\n class=\"rows\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n @for (entry of rows(); track entry.key; let index = $index) {\n <div\n class=\"row\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"rowClicked.emit(entry.row)\"\n (keydown.enter)=\"onRowKey(entry.row, $event)\"\n (keydown.space)=\"onRowKey(entry.row, $event)\">\n <span class=\"label\">\n {{ entry.row.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formattedValue }}\n </span>\n\n @if (showPercent()) {\n <span class=\"percent\">\n {{ entry.formattedPercent }}\n </span>\n }\n\n <span class=\"track\">\n <span\n class=\"fill\"\n [style.width.%]=\"entry.widthPercent\"\n [style.background]=\"entry.color\">\n </span>\n </span>\n </div>\n }\n </div>\n\n @if (dataTable() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTable() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of rows(); track entry.key) {\n <tr>\n <td>\n {{ entry.row.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@keyframes ds-chart-mark-enter{0%{opacity:0;transform:scale(.94)}}@keyframes ds-chart-mark-exit{to{opacity:0;transform:scale(.94)}}.row{transform-box:fill-box;transform-origin:center}.row.mark-enter{animation:ds-chart-mark-enter 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}.row.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.bar-chart{--_bar-chart-track-color: var(--ds-bar-chart-track-color, var(--ds-chart-grid-line-color));--_bar-chart-track-height: var(--ds-bar-chart-track-height, 12px);--_bar-chart-row-gap: var(--ds-bar-chart-row-gap, var(--space-5));--_bar-chart-label-gap: var(--ds-bar-chart-label-gap, var(--space-1));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.rows .row{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.rows .row.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.rows:has(.row.interactive:hover) .row.interactive:not(:hover),.rows:has(.row.interactive:focus-visible) .row.interactive:not(:focus-visible){opacity:var(--ds-chart-dim-opacity)}.rows .row.interactive{cursor:pointer}.rows,.skeleton{display:grid;row-gap:var(--_bar-chart-row-gap)}.row{display:grid;grid-template-columns:1fr auto auto;gap:var(--_bar-chart-label-gap) var(--space-2);align-items:baseline}.empty{margin:0;color:var(--text-secondary)}.label{color:var(--text-secondary)}.value{font-weight:700}.percent{color:var(--text-tertiary);font-size:var(--font-size-xs)}.track{grid-column:1/-1;block-size:var(--_bar-chart-track-height);border-radius:calc(var(--_bar-chart-track-height) / 2);background:var(--_bar-chart-track-color);overflow:hidden}.fill{display:block;block-size:100%;border-radius:inherit;transition:inline-size var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.empty.is-error{color:var(--error)}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
150
|
+
}
|
|
151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: BarChartComponent, decorators: [{
|
|
152
|
+
type: Component,
|
|
153
|
+
args: [{ selector: 'ds-bar-chart', standalone: true, imports: [SkeletonComponent, ChartTooltipDirective], encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<figure class=\"bar-chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorText() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_bar-chart-track-height)\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyText() }}\n </p>\n } @else {\n <div\n class=\"rows\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n @for (entry of rows(); track entry.key; let index = $index) {\n <div\n class=\"row\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"rowClicked.emit(entry.row)\"\n (keydown.enter)=\"onRowKey(entry.row, $event)\"\n (keydown.space)=\"onRowKey(entry.row, $event)\">\n <span class=\"label\">\n {{ entry.row.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formattedValue }}\n </span>\n\n @if (showPercent()) {\n <span class=\"percent\">\n {{ entry.formattedPercent }}\n </span>\n }\n\n <span class=\"track\">\n <span\n class=\"fill\"\n [style.width.%]=\"entry.widthPercent\"\n [style.background]=\"entry.color\">\n </span>\n </span>\n </div>\n }\n </div>\n\n @if (dataTable() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTable() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of rows(); track entry.key) {\n <tr>\n <td>\n {{ entry.row.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@keyframes ds-chart-mark-enter{0%{opacity:0;transform:scale(.94)}}@keyframes ds-chart-mark-exit{to{opacity:0;transform:scale(.94)}}.row{transform-box:fill-box;transform-origin:center}.row.mark-enter{animation:ds-chart-mark-enter 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}.row.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.bar-chart{--_bar-chart-track-color: var(--ds-bar-chart-track-color, var(--ds-chart-grid-line-color));--_bar-chart-track-height: var(--ds-bar-chart-track-height, 12px);--_bar-chart-row-gap: var(--ds-bar-chart-row-gap, var(--space-5));--_bar-chart-label-gap: var(--ds-bar-chart-label-gap, var(--space-1));margin:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.rows .row{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing)}.rows .row.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.rows:has(.row.interactive:hover) .row.interactive:not(:hover),.rows:has(.row.interactive:focus-visible) .row.interactive:not(:focus-visible){opacity:var(--ds-chart-dim-opacity)}.rows .row.interactive{cursor:pointer}.rows,.skeleton{display:grid;row-gap:var(--_bar-chart-row-gap)}.row{display:grid;grid-template-columns:1fr auto auto;gap:var(--_bar-chart-label-gap) var(--space-2);align-items:baseline}.empty{margin:0;color:var(--text-secondary)}.label{color:var(--text-secondary)}.value{font-weight:700}.percent{color:var(--text-tertiary);font-size:var(--font-size-xs)}.track{grid-column:1/-1;block-size:var(--_bar-chart-track-height);border-radius:calc(var(--_bar-chart-track-height) / 2);background:var(--_bar-chart-track-color);overflow:hidden}.fill{display:block;block-size:100%;border-radius:inherit;transition:inline-size var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.empty.is-error{color:var(--error)}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}\n"] }]
|
|
154
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], dataTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTable", required: false }] }], showPercent: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPercent", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], rowClicked: [{ type: i0.Output, args: ["rowClicked"] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipTemplate: [{ type: i0.ContentChild, args: ['dsChartTooltip', { isSignal: true }] }] } });
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Generated bundle index. Do not edit.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
export { BarChartComponent };
|
|
161
|
+
//# sourceMappingURL=ids-group-ltd-ids-design-system-components-bar-chart.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-bar-chart.mjs","sources":["../../../src/lib/components/bar-chart/bar-chart.math.ts","../../../src/lib/components/bar-chart/bar-chart.component.ts","../../../src/lib/components/bar-chart/bar-chart.component.html","../../../src/lib/components/bar-chart/ids-group-ltd-ids-design-system-components-bar-chart.ts"],"sourcesContent":["/** Largest finite value, or `explicitMax` when it is a usable track length. A\n * non-finite datum is skipped rather than compared: one `Infinity` row would\n * otherwise become the track length and flatten every other row to nothing. */\nexport function resolveMax(\n explicitMax: number | null,\n values: readonly number[],\n): number {\n if (explicitMax !== null && Number.isFinite(explicitMax) && explicitMax > 0) {\n return explicitMax;\n }\n const finite = values.filter((value) => Number.isFinite(value));\n\n return finite.length ? Math.max(...finite) : 0;\n}\n\n/** Track share for one row, in percent. Has no upper bound: an explicit `max`\n * below the data is the caller's statement, and `.track` clips the overflow. */\nexport function widthPercent(value: number, max: number): number {\n // Math.max(NaN, 0) is NaN, so the lower clamp cannot stand in for this test —\n // and the result is written into a style attribute, where `width: NaN%` is\n // dropped silently.\n if (!Number.isFinite(value) || !Number.isFinite(max) || max <= 0) {\n return 0;\n }\n\n return Math.max((value / max) * 100, 0);\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n contentChild,\n input,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport {\n chartColors,\n describeSeries,\n formatPercent,\n focusMark,\n formatValue,\n nextRovingIndex,\n staggerDelay,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport { resolveMax, widthPercent } from './bar-chart.math';\nimport type { BarChartRow } from './bar-chart.types';\n\nconst defaultValueFormat = (value: number) => formatValue(value);\n\n@Component({\n selector: 'ds-bar-chart',\n standalone: true,\n imports: [SkeletonComponent, ChartTooltipDirective],\n templateUrl: './bar-chart.component.html',\n styleUrl: './bar-chart.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BarChartComponent {\n /** One row per bar, drawn in the order given. */\n readonly data = input.required<readonly BarChartRow[]>();\n\n /** Track length is relative to this. Null uses the largest value, so the\n * longest row always fills its track. */\n readonly max = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n\n /** Printed above the plot as the chart's visible title, and reused as the annex table's\n * caption. */\n readonly caption = input<string | null>(null);\n\n /** Accessible name. Generated from the data when omitted. */\n readonly summary = input<string | null>(null);\n\n /** The label-and-value table under the plot: `'toggle'` puts it behind a disclosure,\n * `'visible'` opens it, `'none'` renders none. It is the non-visual route to the numbers, so\n * `'none'` belongs only where the same data is already in a table on the page. */\n readonly dataTable = input<'toggle' | 'visible' | 'none'>('toggle');\n /** Prints each row's share of `max` beside its value. */\n readonly showPercent = input(true, { transform: booleanAttribute });\n /** Draws skeleton marks in place of the data, at the same count, so the chart does not resize\n * when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n /** Shown in place of the plot when `data` is empty. */\n readonly emptyText = input<string>('No data');\n\n /** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,\n * because \"the request failed\" and \"there is nothing to show\" read the same to a reader and\n * mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** The message the error state prints. */\n readonly errorText = input<string>('Could not load the data');\n /** Formats every value the chart prints, the annex table and the generated description\n * included. Defaults to the browser's locale grouping with a K/M/B suffix past four digits. */\n readonly valueFormat = input<(value: number) => string>(defaultValueFormat);\n\n /** Turns on the click affordance — the pointer cursor and any hover tint.\n * The click output fires whether or not this is set, so a consumer that\n * binds the output and forgets the flag still receives every click. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** The row that was clicked, or activated with Enter or Space. Fires whether or not\n * `interactive` is set. */\n readonly rowClicked = output<BarChartRow>();\n\n /** Milliseconds between one mark's entrance and the next. `0`, the default, is no stagger at\n * all; `40` is the documented non-zero step. The total is capped, so a long series does not\n * crawl in. */\n readonly staggerMs = input(0, { transform: numberAttribute });\n\n protected markStagger(index: number): string {\n return `${staggerDelay(index, this.staggerMs())}ms`;\n }\n\n /** Whether a hovered or focused row opens a tooltip. `'axis'` is not offered — a bar\n * chart's marks ARE its categories, so an axis tooltip would repeat the item one. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n protected readonly tooltipTemplate =\n contentChild<TemplateRef<{ $implicit: ChartTooltipContext }>>(\n 'dsChartTooltip',\n );\n\n protected readonly activeMark = chartActiveMark();\n /** One tab stop per chart, not one per mark: WCAG 2.1.1's Understanding is explicit that not\n * every mouse-operable control has to be separately focusable, and that is what keeps a\n * twenty-five mark chart from being twenty-five stops in the page's tab order. */\n protected readonly rovingIndex = signal(0);\n\n protected readonly tabStopIndex = computed(() =>\n Math.min(this.rovingIndex(), Math.max(0, this.rows().length - 1)),\n );\n\n protected onMarkFocus(index: number, event: FocusEvent): void {\n this.rovingIndex.set(index);\n this.activeMark.enter(index, event);\n }\n\n protected onMarkNavigation(event: KeyboardEvent, index: number): void {\n const next = nextRovingIndex(event.key, index, this.rows().length);\n if (next === null) {\n return;\n }\n event.preventDefault();\n this.rovingIndex.set(next);\n focusMark((event.currentTarget as Element).closest('.rows'), next);\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const entry = this.rows()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !entry) {\n return null;\n }\n\n return {\n category: '',\n entries: [\n {\n label: entry.row.label,\n value: entry.row.value,\n formatted: entry.formattedValue,\n color: entry.color,\n },\n ],\n };\n },\n );\n\n protected readonly resolvedMax = computed(() =>\n resolveMax(\n this.max(),\n this.data().map((row) => row.value),\n ),\n );\n\n protected readonly rows = computed(() => {\n const max = this.resolvedMax();\n const format = this.valueFormat();\n\n return this.data().map((row, index) => ({\n key: row.id ?? String(index),\n row,\n widthPercent: widthPercent(row.value, max),\n formattedValue: format(row.value),\n formattedPercent:\n row.percent !== undefined\n ? formatPercent(row.percent, 100)\n : formatPercent(row.value, max),\n color: row.color ?? chartColors.seriesDefault,\n }));\n });\n\n protected readonly accessibleName = computed(\n () =>\n this.summary() ??\n describeSeries(\n this.caption() ?? 'Chart',\n this.data().map((row) => ({ label: row.label, value: row.value })),\n this.valueFormat(),\n this.dataTable() !== 'none',\n ),\n );\n\n protected entryLabel(entry: { row: BarChartRow; formattedValue: string }) {\n return `${entry.row.label}, ${entry.formattedValue}`;\n }\n\n protected onRowKey(row: BarChartRow, event: Event): void {\n // Only the row's own key opens the row: a key pressed on a control inside it belongs to that\n // control.\n if (!this.interactive() || event.target !== event.currentTarget) {\n return;\n }\n event.preventDefault();\n this.rowClicked.emit(row);\n }\n\n protected readonly isEmpty = computed(() => this.data().length === 0);\n\n /** Placeholder bars while loading. Follows the real row count so the chart does not resize\n * when the data lands; falls back to three when `data` is still empty. */\n protected readonly skeletonRows = computed(() =>\n Array.from({ length: Math.max(this.data().length, 3) }),\n );\n}\n","<figure class=\"bar-chart\">\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorText() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholder of skeletonRows(); track $index) {\n <ds-skeleton height=\"var(--_bar-chart-track-height)\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyText() }}\n </p>\n } @else {\n <div\n class=\"rows\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n @for (entry of rows(); track entry.key; let index = $index) {\n <div\n class=\"row\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"rowClicked.emit(entry.row)\"\n (keydown.enter)=\"onRowKey(entry.row, $event)\"\n (keydown.space)=\"onRowKey(entry.row, $event)\">\n <span class=\"label\">\n {{ entry.row.label }}\n </span>\n\n <span class=\"value\">\n {{ entry.formattedValue }}\n </span>\n\n @if (showPercent()) {\n <span class=\"percent\">\n {{ entry.formattedPercent }}\n </span>\n }\n\n <span class=\"track\">\n <span\n class=\"fill\"\n [style.width.%]=\"entry.widthPercent\"\n [style.background]=\"entry.color\">\n </span>\n </span>\n </div>\n }\n </div>\n\n @if (dataTable() !== 'none') {\n <details\n class=\"data-table\"\n [open]=\"dataTable() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of rows(); track entry.key) {\n <tr>\n <td>\n {{ entry.row.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;AAEgF;AAC1E,SAAU,UAAU,CACxB,WAA0B,EAC1B,MAAyB,EAAA;AAEzB,IAAA,IAAI,WAAW,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,WAAW,GAAG,CAAC,EAAE;AAC3E,QAAA,OAAO,WAAW;IACpB;AACA,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAE/D,IAAA,OAAO,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC;AAChD;AAEA;AACiF;AAC3E,SAAU,YAAY,CAAC,KAAa,EAAE,GAAW,EAAA;;;;IAIrD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE;AAChE,QAAA,OAAO,CAAC;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A,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,OAAA,EAAA,CAAA,EAAA,YAAA,EAAA,iBAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC7C9B,23GA4HA,EAAA,MAAA,EAAA,CAAA,k6HAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDrFY,iBAAiB,yGAAE,qBAAqB,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,gBAAA,EAAA,sBAAA,EAAA,wBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAMvC,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAT7B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,cAAc,EAAA,UAAA,EACZ,IAAI,EAAA,OAAA,EACP,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,EAAA,aAAA,EAGpC,iBAAiB,CAAC,QAAQ,EAAA,eAAA,EACxB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,23GAAA,EAAA,MAAA,EAAA,CAAA,k6HAAA,CAAA,EAAA;k8CAkE3C,gBAAgB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE7GtB;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { signal, Injectable, inject, input, numberAttribute, output, computed, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
-
import { DS_CONFIG } from '@ids-group-ltd/ids-design-system/core';
|
|
3
|
+
import { DS_CONFIG, devWarn } from '@ids-group-ltd/ids-design-system/core';
|
|
4
4
|
import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -37,32 +37,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
37
37
|
class BreadcrumbsComponent {
|
|
38
38
|
cfg = inject(DS_CONFIG);
|
|
39
39
|
svc = inject(BreadcrumbsService);
|
|
40
|
-
/**
|
|
41
|
-
* When omitted, the component reads from `BreadcrumbsService.items`.
|
|
42
|
-
* Pass an explicit array to opt out of the service (per-page override).
|
|
43
|
-
*/
|
|
40
|
+
/** Omitted, the component reads `BreadcrumbsService.items`; an explicit array opts out. */
|
|
44
41
|
items = input(null, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
45
42
|
/** Icon between crumbs; falls back to `DS_CONFIG.breadcrumbs.separator`, then `chevronRight`. */
|
|
46
43
|
separator = input(null, ...(ngDevMode ? [{ debugName: "separator" }] : /* istanbul ignore next */ []));
|
|
47
44
|
/** Whether crumbs render as links; falls back to `DS_CONFIG.breadcrumbs.clickable`, then `true`. */
|
|
48
45
|
clickable = input(null, ...(ngDevMode ? [{ debugName: "clickable" }] : /* istanbul ignore next */ []));
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* Worth setting on any trail that can get deep: the row is `nowrap` with
|
|
54
|
-
* `overflow: hidden`, so without a cap an overlong trail is clipped from the
|
|
55
|
-
* END, which is the current page — the one crumb the reader needs most.
|
|
56
|
-
*/
|
|
46
|
+
/** Caps how many crumbs render, collapsing the middle — the first and the LAST always survive.
|
|
47
|
+
* Worth setting on any deep trail: the row is `nowrap` with `overflow: hidden`, so uncapped it
|
|
48
|
+
* is clipped from the END, which is the current page. */
|
|
57
49
|
maxItems = input(null, { ...(ngDevMode ? { debugName: "maxItems" } : /* istanbul ignore next */ {}), transform: (raw) => (raw == null ? null : numberAttribute(raw)) });
|
|
58
50
|
/** Fires when a clickable crumb with `href` is activated; default navigation is always prevented. */
|
|
59
51
|
navigate = output();
|
|
60
52
|
allItems = computed(() => this.items() ?? this.svc.items(), ...(ngDevMode ? [{ debugName: "allItems" }] : /* istanbul ignore next */ []));
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
* than a link to nowhere; its label is the count, which tells the reader how
|
|
64
|
-
* much is hidden instead of just that something is.
|
|
65
|
-
*/
|
|
53
|
+
// The collapsed crumb carries no `href`, so it is inert rather than a link to nowhere, and its
|
|
54
|
+
// label is the count rather than an ellipsis alone.
|
|
66
55
|
resolvedItems = computed(() => {
|
|
67
56
|
const items = this.allItems();
|
|
68
57
|
const max = this.maxItems();
|
|
@@ -76,6 +65,16 @@ class BreadcrumbsComponent {
|
|
|
76
65
|
}, ...(ngDevMode ? [{ debugName: "resolvedItems" }] : /* istanbul ignore next */ []));
|
|
77
66
|
effectiveSeparator = computed(() => this.separator() ?? this.cfg.breadcrumbs?.separator ?? 'chevronRight', ...(ngDevMode ? [{ debugName: "effectiveSeparator" }] : /* istanbul ignore next */ []));
|
|
78
67
|
effectiveClickable = computed(() => this.clickable() ?? this.cfg.breadcrumbs?.clickable ?? true, ...(ngDevMode ? [{ debugName: "effectiveClickable" }] : /* istanbul ignore next */ []));
|
|
68
|
+
constructor() {
|
|
69
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
70
|
+
devWarn(() => {
|
|
71
|
+
const nameless = this.resolvedItems().find((item) => item.icon && !item.label && !item.ariaLabel);
|
|
72
|
+
return nameless
|
|
73
|
+
? `[ds-breadcrumbs] the crumb with icon="${nameless.icon}" has no label and no ariaLabel, so it renders as a link with no accessible name. Give it an ariaLabel — the icon id is not a word for the user.`
|
|
74
|
+
: null;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
79
78
|
onNav(event, item) {
|
|
80
79
|
if (!item.href || !this.effectiveClickable()) {
|
|
81
80
|
event.preventDefault();
|
|
@@ -85,12 +84,12 @@ class BreadcrumbsComponent {
|
|
|
85
84
|
this.navigate.emit(item);
|
|
86
85
|
}
|
|
87
86
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: BreadcrumbsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
88
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: BreadcrumbsComponent, isStandalone: true, selector: "ds-breadcrumbs", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, maxItems: { classPropertyName: "maxItems", publicName: "maxItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { navigate: "navigate" }, ngImport: i0, template: "<nav\n class=\"breadcrumbs\"\n aria-label=\"Breadcrumb\"\n [class.is-static]=\"!effectiveClickable()\">\n @for (item of resolvedItems(); track $index; let last = $last) {\n @if (\n item.href &&\n !last &&\n effectiveClickable()\n ) {\n <a\n [href]=\"item.href\"\n (click)=\"onNav($event, item)\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </a>\n } @else {\n <span\n [class.current]=\"last\"\n [attr.aria-current]=\"last ? 'page' : null\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </span>\n }\n\n @if (!last) {\n <span\n class=\"sep\"\n aria-hidden=\"true\">\n <ds-icon\n [name]=\"effectiveSeparator()\"\n [size]=\"12\" />\n </span>\n }\n }\n</nav>\n", styles: ["
|
|
87
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: BreadcrumbsComponent, isStandalone: true, selector: "ds-breadcrumbs", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, maxItems: { classPropertyName: "maxItems", publicName: "maxItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { navigate: "navigate" }, ngImport: i0, template: "<nav\n class=\"breadcrumbs\"\n aria-label=\"Breadcrumb\"\n [class.is-static]=\"!effectiveClickable()\">\n @for (item of resolvedItems(); track $index; let last = $last) {\n @if (\n item.href &&\n !last &&\n effectiveClickable()\n ) {\n <a\n [href]=\"item.href\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n (click)=\"onNav($event, item)\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </a>\n } @else {\n <span\n [class.current]=\"last\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n [attr.aria-current]=\"last ? 'page' : null\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </span>\n }\n\n @if (!last) {\n <span\n class=\"sep\"\n aria-hidden=\"true\">\n <ds-icon\n [name]=\"effectiveSeparator()\"\n [size]=\"12\" />\n </span>\n }\n }\n</nav>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_breadcrumbs-label-color: var(--ds-breadcrumbs-label-color, var(--text-tertiary));--_breadcrumbs-label-color-hover: var(--ds-breadcrumbs-label-color-hover, var(--accent));--_breadcrumbs-separator-icon-color: var(--ds-breadcrumbs-separator-icon-color, var(--icon-muted));--_breadcrumbs-current-label-color: var(--ds-breadcrumbs-current-label-color, var(--text-primary));display:inline-flex;min-width:0;max-width:100%}.breadcrumbs{display:inline-flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_breadcrumbs-label-color);min-width:0;max-width:100%;flex-wrap:nowrap;overflow:hidden;--focus-ring-offset: calc(-1 * var(--focus-ring-width))}.breadcrumbs a,.breadcrumbs .current{display:inline-flex;align-items:center;gap:var(--space-1)}.breadcrumbs a{color:var(--_breadcrumbs-label-color);text-decoration:none;cursor:pointer;transition:color var(--duration-fast) var(--ease-standard)}.breadcrumbs a:hover{color:var(--_breadcrumbs-label-color-hover);text-decoration:underline;text-underline-offset:var(--breadcrumbs-link-uloff)}.breadcrumbs a:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--radius-sm)}.breadcrumbs.is-static a,.breadcrumbs.is-static .current{cursor:default}.breadcrumbs .sep{color:var(--_breadcrumbs-separator-icon-color);display:inline-flex;align-items:center}.breadcrumbs .current{color:var(--_breadcrumbs-current-label-color);font-weight:var(--font-weight-bold)}.breadcrumbs .label{overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap;max-width:16ch}.breadcrumbs .current .label{max-width:32ch}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
89
88
|
}
|
|
90
89
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: BreadcrumbsComponent, decorators: [{
|
|
91
90
|
type: Component,
|
|
92
|
-
args: [{ selector: 'ds-breadcrumbs', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<nav\n class=\"breadcrumbs\"\n aria-label=\"Breadcrumb\"\n [class.is-static]=\"!effectiveClickable()\">\n @for (item of resolvedItems(); track $index; let last = $last) {\n @if (\n item.href &&\n !last &&\n effectiveClickable()\n ) {\n <a\n [href]=\"item.href\"\n (click)=\"onNav($event, item)\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </a>\n } @else {\n <span\n [class.current]=\"last\"\n [attr.aria-current]=\"last ? 'page' : null\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </span>\n }\n\n @if (!last) {\n <span\n class=\"sep\"\n aria-hidden=\"true\">\n <ds-icon\n [name]=\"effectiveSeparator()\"\n [size]=\"12\" />\n </span>\n }\n }\n</nav>\n", styles: ["
|
|
93
|
-
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], separator: [{ type: i0.Input, args: [{ isSignal: true, alias: "separator", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], maxItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxItems", required: false }] }], navigate: [{ type: i0.Output, args: ["navigate"] }] } });
|
|
91
|
+
args: [{ selector: 'ds-breadcrumbs', standalone: true, imports: [IconComponent], encapsulation: ViewEncapsulation.Emulated, template: "<nav\n class=\"breadcrumbs\"\n aria-label=\"Breadcrumb\"\n [class.is-static]=\"!effectiveClickable()\">\n @for (item of resolvedItems(); track $index; let last = $last) {\n @if (\n item.href &&\n !last &&\n effectiveClickable()\n ) {\n <a\n [href]=\"item.href\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n (click)=\"onNav($event, item)\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </a>\n } @else {\n <span\n [class.current]=\"last\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n [attr.aria-current]=\"last ? 'page' : null\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </span>\n }\n\n @if (!last) {\n <span\n class=\"sep\"\n aria-hidden=\"true\">\n <ds-icon\n [name]=\"effectiveSeparator()\"\n [size]=\"12\" />\n </span>\n }\n }\n</nav>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_breadcrumbs-label-color: var(--ds-breadcrumbs-label-color, var(--text-tertiary));--_breadcrumbs-label-color-hover: var(--ds-breadcrumbs-label-color-hover, var(--accent));--_breadcrumbs-separator-icon-color: var(--ds-breadcrumbs-separator-icon-color, var(--icon-muted));--_breadcrumbs-current-label-color: var(--ds-breadcrumbs-current-label-color, var(--text-primary));display:inline-flex;min-width:0;max-width:100%}.breadcrumbs{display:inline-flex;align-items:center;gap:var(--space-2);font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-flat) var(--font-sans);color:var(--_breadcrumbs-label-color);min-width:0;max-width:100%;flex-wrap:nowrap;overflow:hidden;--focus-ring-offset: calc(-1 * var(--focus-ring-width))}.breadcrumbs a,.breadcrumbs .current{display:inline-flex;align-items:center;gap:var(--space-1)}.breadcrumbs a{color:var(--_breadcrumbs-label-color);text-decoration:none;cursor:pointer;transition:color var(--duration-fast) var(--ease-standard)}.breadcrumbs a:hover{color:var(--_breadcrumbs-label-color-hover);text-decoration:underline;text-underline-offset:var(--breadcrumbs-link-uloff)}.breadcrumbs a:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard);border-radius:var(--radius-sm)}.breadcrumbs.is-static a,.breadcrumbs.is-static .current{cursor:default}.breadcrumbs .sep{color:var(--_breadcrumbs-separator-icon-color);display:inline-flex;align-items:center}.breadcrumbs .current{color:var(--_breadcrumbs-current-label-color);font-weight:var(--font-weight-bold)}.breadcrumbs .label{overflow:clip;overflow-clip-margin:var(--space-1);text-overflow:ellipsis;white-space:nowrap;max-width:16ch}.breadcrumbs .current .label{max-width:32ch}\n"] }]
|
|
92
|
+
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], separator: [{ type: i0.Input, args: [{ isSignal: true, alias: "separator", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], maxItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxItems", required: false }] }], navigate: [{ type: i0.Output, args: ["navigate"] }] } });
|
|
94
93
|
|
|
95
94
|
/**
|
|
96
95
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-breadcrumbs.mjs","sources":["../../../src/lib/components/breadcrumbs/breadcrumbs.service.ts","../../../src/lib/components/breadcrumbs/breadcrumbs.component.ts","../../../src/lib/components/breadcrumbs/breadcrumbs.component.html","../../../src/lib/components/breadcrumbs/ids-group-ltd-ids-design-system-components-breadcrumbs.ts"],"sourcesContent":["import { Injectable, type Signal, signal } from '@angular/core';\nimport type { BreadcrumbItem } from './breadcrumbs.types';\n\n/**\n * Library-level breadcrumb state. Apps push items either programmatically\n * (page constructor / effect) or via a router-data driver (see app docs).\n * `<ds-breadcrumbs>` reads from here when no `[items]` input is provided.\n */\n@Injectable({ providedIn: 'root' })\nexport class BreadcrumbsService {\n private readonly _items = signal<BreadcrumbItem[]>([]);\n readonly items: Signal<BreadcrumbItem[]> = this._items.asReadonly();\n\n set(items: BreadcrumbItem[]): void {\n this._items.set(items);\n }\n\n push(item: BreadcrumbItem): void {\n this._items.update((arr) => [...arr, item]);\n }\n\n pop(): void {\n this._items.update((arr) => arr.slice(0, -1));\n }\n\n replaceLast(item: BreadcrumbItem): void {\n this._items.update((arr) =>\n arr.length ? [...arr.slice(0, -1), item] : [item],\n );\n }\n\n clear(): void {\n this._items.set([]);\n }\n}\n","import {\n Component,\n ViewEncapsulation,\n computed,\n inject,\n input,\n numberAttribute,\n output,\n} from '@angular/core';\nimport { DS_CONFIG } from '@ids-group-ltd/ids-design-system/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport { BreadcrumbsService } from './breadcrumbs.service';\nimport type { BreadcrumbItem } from './breadcrumbs.types';\n\n@Component({\n selector: 'ds-breadcrumbs',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './breadcrumbs.component.html',\n styleUrl: './breadcrumbs.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class BreadcrumbsComponent {\n private readonly cfg = inject(DS_CONFIG);\n private readonly svc = inject(BreadcrumbsService);\n\n /**\n * When omitted, the component reads from `BreadcrumbsService.items`.\n * Pass an explicit array to opt out of the service (per-page override).\n */\n readonly items = input<BreadcrumbItem[] | null>(null);\n /** Icon between crumbs; falls back to `DS_CONFIG.breadcrumbs.separator`, then `chevronRight`. */\n readonly separator = input<IconName | null>(null);\n /** Whether crumbs render as links; falls back to `DS_CONFIG.breadcrumbs.clickable`, then `true`. */\n readonly clickable = input<boolean | null>(null);\n /**\n * Caps how many crumbs render, collapsing the middle into an ellipsis — the\n * first and the LAST always survive. Null (default) renders every crumb.\n *\n * Worth setting on any trail that can get deep: the row is `nowrap` with\n * `overflow: hidden`, so without a cap an overlong trail is clipped from the\n * END, which is the current page — the one crumb the reader needs most.\n */\n readonly maxItems = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n /** Fires when a clickable crumb with `href` is activated; default navigation is always prevented. */\n readonly navigate = output<BreadcrumbItem>();\n\n private readonly allItems = computed<BreadcrumbItem[]>(\n () => this.items() ?? this.svc.items(),\n );\n\n /**\n * What renders. The collapsed crumb carries no `href`, so it is inert rather\n * than a link to nowhere; its label is the count, which tells the reader how\n * much is hidden instead of just that something is.\n */\n protected readonly resolvedItems = computed<BreadcrumbItem[]>(() => {\n const items = this.allItems();\n const max = this.maxItems();\n if (!max || max < 2 || items.length <= max) {\n return items;\n }\n // max - 2, not max - 1: the collapsed crumb occupies one of the slots too,\n // so counting only the first would render one crumb more than asked for.\n const tail = items.slice(items.length - (max - 2));\n\n return [items[0], { label: `… ${items.length - max + 1} more` }, ...tail];\n });\n protected readonly effectiveSeparator = computed<IconName>(\n () => this.separator() ?? this.cfg.breadcrumbs?.separator ?? 'chevronRight',\n );\n protected readonly effectiveClickable = computed<boolean>(\n () => this.clickable() ?? this.cfg.breadcrumbs?.clickable ?? true,\n );\n\n protected onNav(event: Event, item: BreadcrumbItem): void {\n if (!item.href || !this.effectiveClickable()) {\n event.preventDefault();\n\n return;\n }\n event.preventDefault();\n this.navigate.emit(item);\n }\n}\n","<nav\n class=\"breadcrumbs\"\n aria-label=\"Breadcrumb\"\n [class.is-static]=\"!effectiveClickable()\">\n @for (item of resolvedItems(); track $index; let last = $last) {\n @if (\n item.href &&\n !last &&\n effectiveClickable()\n ) {\n <a\n [href]=\"item.href\"\n (click)=\"onNav($event, item)\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </a>\n } @else {\n <span\n [class.current]=\"last\"\n [attr.aria-current]=\"last ? 'page' : null\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </span>\n }\n\n @if (!last) {\n <span\n class=\"sep\"\n aria-hidden=\"true\">\n <ds-icon\n [name]=\"effectiveSeparator()\"\n [size]=\"12\" />\n </span>\n }\n }\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;;;;AAIG;MAEU,kBAAkB,CAAA;AACZ,IAAA,MAAM,GAAG,MAAM,CAAmB,EAAE,6EAAC;AAC7C,IAAA,KAAK,GAA6B,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;AAEnE,IAAA,GAAG,CAAC,KAAuB,EAAA;AACzB,QAAA,IAAI,CAAC,MAAM,CA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AA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECvBjC,urCAsDA,EAAA,MAAA,EAAA,CAAA,ypFAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDpCY,aAAa,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAKZ,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBARhC,SAAS;+BACE,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP,CAAC,aAAa,CAAC,EAAA,aAAA,EAGT,iBAAiB,CAAC,QAAQ,EAAA,QAAA,EAAA,urCAAA,EAAA,MAAA,EAAA,CAAA,ypFAAA,CAAA,EAAA;;;AErB3C;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-breadcrumbs.mjs","sources":["../../../src/lib/components/breadcrumbs/breadcrumbs.service.ts","../../../src/lib/components/breadcrumbs/breadcrumbs.component.ts","../../../src/lib/components/breadcrumbs/breadcrumbs.component.html","../../../src/lib/components/breadcrumbs/ids-group-ltd-ids-design-system-components-breadcrumbs.ts"],"sourcesContent":["import { Injectable, type Signal, signal } from '@angular/core';\nimport type { BreadcrumbItem } from './breadcrumbs.types';\n\n/**\n * Library-level breadcrumb state. Apps push items either programmatically\n * (page constructor / effect) or via a router-data driver (see app docs).\n * `<ds-breadcrumbs>` reads from here when no `[items]` input is provided.\n */\n@Injectable({ providedIn: 'root' })\nexport class BreadcrumbsService {\n private readonly _items = signal<BreadcrumbItem[]>([]);\n readonly items: Signal<BreadcrumbItem[]> = this._items.asReadonly();\n\n set(items: BreadcrumbItem[]): void {\n this._items.set(items);\n }\n\n push(item: BreadcrumbItem): void {\n this._items.update((arr) => [...arr, item]);\n }\n\n pop(): void {\n this._items.update((arr) => arr.slice(0, -1));\n }\n\n replaceLast(item: BreadcrumbItem): void {\n this._items.update((arr) =>\n arr.length ? [...arr.slice(0, -1), item] : [item],\n );\n }\n\n clear(): void {\n this._items.set([]);\n }\n}\n","import {\n Component,\n ViewEncapsulation,\n computed,\n inject,\n input,\n numberAttribute,\n output,\n} from '@angular/core';\nimport { DS_CONFIG, devWarn } from '@ids-group-ltd/ids-design-system/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport { BreadcrumbsService } from './breadcrumbs.service';\nimport type { BreadcrumbItem } from './breadcrumbs.types';\n\n@Component({\n selector: 'ds-breadcrumbs',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './breadcrumbs.component.html',\n styleUrl: './breadcrumbs.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n})\nexport class BreadcrumbsComponent {\n private readonly cfg = inject(DS_CONFIG);\n private readonly svc = inject(BreadcrumbsService);\n\n /** Omitted, the component reads `BreadcrumbsService.items`; an explicit array opts out. */\n readonly items = input<BreadcrumbItem[] | null>(null);\n /** Icon between crumbs; falls back to `DS_CONFIG.breadcrumbs.separator`, then `chevronRight`. */\n readonly separator = input<IconName | null>(null);\n /** Whether crumbs render as links; falls back to `DS_CONFIG.breadcrumbs.clickable`, then `true`. */\n readonly clickable = input<boolean | null>(null);\n /** Caps how many crumbs render, collapsing the middle — the first and the LAST always survive.\n * Worth setting on any deep trail: the row is `nowrap` with `overflow: hidden`, so uncapped it\n * is clipped from the END, which is the current page. */\n readonly maxItems = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n /** Fires when a clickable crumb with `href` is activated; default navigation is always prevented. */\n readonly navigate = output<BreadcrumbItem>();\n\n private readonly allItems = computed<BreadcrumbItem[]>(\n () => this.items() ?? this.svc.items(),\n );\n\n // The collapsed crumb carries no `href`, so it is inert rather than a link to nowhere, and its\n // label is the count rather than an ellipsis alone.\n protected readonly resolvedItems = computed<BreadcrumbItem[]>(() => {\n const items = this.allItems();\n const max = this.maxItems();\n if (!max || max < 2 || items.length <= max) {\n return items;\n }\n // max - 2, not max - 1: the collapsed crumb occupies one of the slots too,\n // so counting only the first would render one crumb more than asked for.\n const tail = items.slice(items.length - (max - 2));\n\n return [items[0], { label: `… ${items.length - max + 1} more` }, ...tail];\n });\n protected readonly effectiveSeparator = computed<IconName>(\n () => this.separator() ?? this.cfg.breadcrumbs?.separator ?? 'chevronRight',\n );\n protected readonly effectiveClickable = computed<boolean>(\n () => this.clickable() ?? this.cfg.breadcrumbs?.clickable ?? true,\n );\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n devWarn(() => {\n const nameless = this.resolvedItems().find(\n (item) => item.icon && !item.label && !item.ariaLabel,\n );\n\n return nameless\n ? `[ds-breadcrumbs] the crumb with icon=\"${nameless.icon}\" has no label and no ariaLabel, so it renders as a link with no accessible name. Give it an ariaLabel — the icon id is not a word for the user.`\n : null;\n });\n }\n }\n\n protected onNav(event: Event, item: BreadcrumbItem): void {\n if (!item.href || !this.effectiveClickable()) {\n event.preventDefault();\n\n return;\n }\n event.preventDefault();\n this.navigate.emit(item);\n }\n}\n","<nav\n class=\"breadcrumbs\"\n aria-label=\"Breadcrumb\"\n [class.is-static]=\"!effectiveClickable()\">\n @for (item of resolvedItems(); track $index; let last = $last) {\n @if (\n item.href &&\n !last &&\n effectiveClickable()\n ) {\n <a\n [href]=\"item.href\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n (click)=\"onNav($event, item)\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </a>\n } @else {\n <span\n [class.current]=\"last\"\n [attr.aria-label]=\"item.label ? null : (item.ariaLabel ?? null)\"\n [attr.aria-current]=\"last ? 'page' : null\">\n @if (item.icon) {\n <ds-icon\n [name]=\"item.icon\"\n [size]=\"14\" />\n }\n\n @if (item.label) {\n <span class=\"label\">\n {{ item.label }}\n </span>\n }\n </span>\n }\n\n @if (!last) {\n <span\n class=\"sep\"\n aria-hidden=\"true\">\n <ds-icon\n [name]=\"effectiveSeparator()\"\n [size]=\"12\" />\n </span>\n }\n }\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;;;;AAIG;MAEU,kBAAkB,CAAA;AACZ,IAAA,MAAM,GAAG,MAAM,CAAmB,EAAE,6EAAC;AAC7C,IAAA,KAAK,GAA6B,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;AAEnE,IAAA,GAAG,CAAC,KAAuB,EAAA;AACzB,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;IACxB;AAEA,IAAA,IAAI,CAAC,IAAoB,EAAA;AACvB,QAAA,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,CAAC;IAC7C;IAEA,GAAG,GAAA;QACD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/C;AAEA,IAAA,WAAW,CAAC,IAAoB,EAAA;AAC9B,QAAA,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KACrB,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAClD;IACH;IAEA,KAAK,GAAA;AACH,QAAA,IAAI,C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