@ids-group-ltd/ids-design-system 0.14.6-beta.0 → 0.14.7
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 +236 -4
- package/components.md +25 -22
- package/design-system.md +1 -1
- package/docs/agent/charts/ds-bar-chart.md +1 -0
- package/docs/agent/charts/ds-column-chart.md +1 -0
- package/docs/agent/charts/ds-line-chart.md +1 -1
- package/docs/agent/forms/ds-autocomplete.md +1 -1
- package/docs/agent/forms/ds-button.md +2 -2
- package/docs/agent/forms/ds-input.md +1 -1
- package/docs/agent/forms/ds-multi-select.md +1 -1
- package/docs/agent/forms/ds-select.md +1 -1
- package/docs/agent/forms/ds-textarea.md +1 -1
- package/docs/agent/forms/filter-item-directive.md +1 -1
- package/docs/agent/forms/the-picker-family-ds-select-ds-multi-select-ds-autocomplete.md +1 -1
- package/docs/agent/foundations/global-helper-classes.md +2 -2
- package/docs/agent/foundations/grid.md +8 -8
- package/docs/agent/overlays/ds-drawer.md +1 -1
- package/docs/agent/overlays/ds-modal-card.md +1 -1
- package/docs/agent/overlays/ds-modal.md +1 -1
- package/docs/agent/platform/toast-service.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-alert.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +10 -8
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs +16 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +18 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +4 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-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 +170 -4
- 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 +327 -24
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +3 -3
- 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 +2 -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 +16 -13
- 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-description-list.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +15 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +5 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +1 -1
- 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 +4 -3
- 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 +4 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +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-layout.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +22 -19
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +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-menu.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +65 -13
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +2 -3
- 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 +9 -11
- 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 +2 -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-page-header.mjs +3 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +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-pie-chart.mjs +98 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +4 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +2 -2
- 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 +2 -2
- 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 +7 -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 +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-sparkline.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-sparkline.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +2 -2
- 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 +4 -4
- 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 +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +7 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +16 -3
- 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 +2 -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 +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +16 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +4 -2
- 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 +31 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +128 -9
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +17 -6
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs +5 -2
- package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.14.6.json +176 -0
- package/migrations/0.14.7.json +140 -0
- package/migrations/0.4.0.json +3 -1
- package/package.json +1 -1
- package/schematics/check-overrides/surface.json +34 -25
- package/styles/_chart-frame.scss +1 -50
- package/styles/_field-state.scss +13 -1
- package/styles/_focus.scss +45 -33
- package/styles/_link.scss +12 -0
- package/styles/_press.scss +1 -1
- package/styles/_tokens-charts.scss +1 -1
- package/styles/_tokens.scss +2 -0
- package/styles/ds.scss +2 -0
- package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +4 -2
- package/types/ids-group-ltd-ids-design-system-components-avatar-group.d.ts +4 -2
- package/types/ids-group-ltd-ids-design-system-components-button.d.ts +2 -1
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +65 -4
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +54 -6
- package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +2 -3
- package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +2 -1
- package/types/ids-group-ltd-ids-design-system-components-filter-bar.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +4 -4
- package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +21 -4
- package/types/ids-group-ltd-ids-design-system-components-page-header.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +21 -2
- package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-tabs.d.ts +1 -1
- package/types/ids-group-ltd-ids-design-system-components-tag.d.ts +2 -1
- package/types/ids-group-ltd-ids-design-system-components.d.ts +12 -2
- package/types/ids-group-ltd-ids-design-system-core.d.ts +35 -3
- package/types/ids-group-ltd-ids-design-system-icons.d.ts +3 -1
- package/types/ids-group-ltd-ids-design-system-theme.d.ts +4 -2
- package/types/ids-group-ltd-ids-design-system.d.ts +2 -2
- package/migrations/0.14.6-beta.0.json +0 -9
|
@@ -140,7 +140,7 @@ class SparklineComponent {
|
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SparklineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
143
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: SparklineComponent, isStandalone: true, selector: "ds-sparkline", inputs: { area: { classPropertyName: "area", publicName: "area", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focus": "onFocus()", "blur": "clearActive()", "keydown": "onKeydown($event)" }, properties: { "attr.role": "label() ? 'img' : null", "attr.aria-label": "label()", "attr.aria-hidden": "label() ? null : 'true'", "attr.tabindex": "focusable() ? 0 : null" } }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, isSignal: true }], ngImport: i0, template: "<svg\n #canvas\n class=\"sparkline\"\n aria-hidden=\"true\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"clearActive()\">\n <svg\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\">\n @if (area()) {\n <path\n class=\"area\"\n [attr.d]=\"geometry().areaPath\" />\n }\n\n <path\n class=\"line\"\n [attr.d]=\"geometry().path\" />\n </svg>\n\n @if (shownPoint(); as point) {\n <circle\n class=\"dot\"\n [attr.cx]=\"point.x + '%'\"\n [attr.cy]=\"point.y + '%'\" />\n }\n</svg>\n", styles: [":
|
|
143
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: SparklineComponent, isStandalone: true, selector: "ds-sparkline", inputs: { area: { classPropertyName: "area", publicName: "area", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focus": "onFocus()", "blur": "clearActive()", "keydown": "onKeydown($event)" }, properties: { "attr.role": "label() ? 'img' : null", "attr.aria-label": "label()", "attr.aria-hidden": "label() ? null : 'true'", "attr.tabindex": "focusable() ? 0 : null" } }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, isSignal: true }], ngImport: i0, template: "<svg\n #canvas\n class=\"sparkline\"\n aria-hidden=\"true\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"clearActive()\">\n <svg\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\">\n @if (area()) {\n <path\n class=\"area\"\n [attr.d]=\"geometry().areaPath\" />\n }\n\n <path\n class=\"line\"\n [attr.d]=\"geometry().path\" />\n </svg>\n\n @if (shownPoint(); as point) {\n <circle\n class=\"dot\"\n [attr.cx]=\"point.x + '%'\"\n [attr.cy]=\"point.y + '%'\" />\n }\n</svg>\n", styles: [":host{--_sparkline-width: var(--ds-sparkline-width, 80px);--_sparkline-height: var(--ds-sparkline-height, 24px);--_sparkline-line-color: var(--ds-sparkline-line-color, var(--ds-chart-series-1-color));--_sparkline-line-width: var(--ds-sparkline-line-width, 1.5px);--_sparkline-dot-radius: var(--ds-sparkline-dot-radius, 2.5px);--_sparkline-area-color: var(--ds-sparkline-area-color, var(--_sparkline-line-color));--_sparkline-area-opacity: var(--ds-sparkline-area-opacity, var(--ds-chart-area-opacity));display:inline-block;inline-size:var(--_sparkline-width);block-size:var(--_sparkline-height);vertical-align:middle}:host(: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)}.sparkline{display:block;inline-size:100%;block-size:100%;overflow:visible}.area{fill:var(--_sparkline-area-color);fill-opacity:var(--_sparkline-area-opacity)}.line{fill:none;stroke:var(--_sparkline-line-color);stroke-width:var(--_sparkline-line-width);stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}.dot{r:var(--_sparkline-dot-radius);fill:var(--_sparkline-line-color)}@media(forced-colors:active){.line{stroke:CanvasText}.dot{fill:CanvasText}}\n"], dependencies: [{ kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate", "dsChartTooltipExtraGap", "dsChartTooltipPinned", "dsChartTooltipSwatches"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
144
144
|
}
|
|
145
145
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SparklineComponent, decorators: [{
|
|
146
146
|
type: Component,
|
|
@@ -152,7 +152,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
152
152
|
'(focus)': 'onFocus()',
|
|
153
153
|
'(blur)': 'clearActive()',
|
|
154
154
|
'(keydown)': 'onKeydown($event)',
|
|
155
|
-
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg\n #canvas\n class=\"sparkline\"\n aria-hidden=\"true\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"clearActive()\">\n <svg\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\">\n @if (area()) {\n <path\n class=\"area\"\n [attr.d]=\"geometry().areaPath\" />\n }\n\n <path\n class=\"line\"\n [attr.d]=\"geometry().path\" />\n </svg>\n\n @if (shownPoint(); as point) {\n <circle\n class=\"dot\"\n [attr.cx]=\"point.x + '%'\"\n [attr.cy]=\"point.y + '%'\" />\n }\n</svg>\n", styles: [":
|
|
155
|
+
}, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg\n #canvas\n class=\"sparkline\"\n aria-hidden=\"true\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"clearActive()\">\n <svg\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\">\n @if (area()) {\n <path\n class=\"area\"\n [attr.d]=\"geometry().areaPath\" />\n }\n\n <path\n class=\"line\"\n [attr.d]=\"geometry().path\" />\n </svg>\n\n @if (shownPoint(); as point) {\n <circle\n class=\"dot\"\n [attr.cx]=\"point.x + '%'\"\n [attr.cy]=\"point.y + '%'\" />\n }\n</svg>\n", styles: [":host{--_sparkline-width: var(--ds-sparkline-width, 80px);--_sparkline-height: var(--ds-sparkline-height, 24px);--_sparkline-line-color: var(--ds-sparkline-line-color, var(--ds-chart-series-1-color));--_sparkline-line-width: var(--ds-sparkline-line-width, 1.5px);--_sparkline-dot-radius: var(--ds-sparkline-dot-radius, 2.5px);--_sparkline-area-color: var(--ds-sparkline-area-color, var(--_sparkline-line-color));--_sparkline-area-opacity: var(--ds-sparkline-area-opacity, var(--ds-chart-area-opacity));display:inline-block;inline-size:var(--_sparkline-width);block-size:var(--_sparkline-height);vertical-align:middle}:host(: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)}.sparkline{display:block;inline-size:100%;block-size:100%;overflow:visible}.area{fill:var(--_sparkline-area-color);fill-opacity:var(--_sparkline-area-opacity)}.line{fill:none;stroke:var(--_sparkline-line-color);stroke-width:var(--_sparkline-line-width);stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}.dot{r:var(--_sparkline-dot-radius);fill:var(--_sparkline-line-color)}@media(forced-colors:active){.line{stroke:CanvasText}.dot{fill:CanvasText}}\n"] }]
|
|
156
156
|
}], propDecorators: { area: [{ type: i0.Input, args: [{ isSignal: true, alias: "area", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], categories: [{ type: i0.Input, args: [{ isSignal: true, alias: "categories", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], scale: [{ type: i0.Input, args: [{ isSignal: true, alias: "scale", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], canvas: [{ type: i0.ViewChild, args: ['canvas', { isSignal: true }] }] } });
|
|
157
157
|
|
|
158
158
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-sparkline.mjs","sources":["../../../src/lib/components/sparkline/sparkline.math.ts","../../../src/lib/components/sparkline/sparkline.component.ts","../../../src/lib/components/sparkline/sparkline.component.html","../../../src/lib/components/sparkline/ids-group-ltd-ids-design-system-components-sparkline.ts"],"sourcesContent":["import type { SparklineScale } from './sparkline.types';\n\nexport interface SparklinePoint {\n readonly index: number;\n readonly x: number;\n readonly y: number;\n}\n\nexport interface SparklineGeometry {\n readonly path: string;\n /** Each unbroken run of the line closed down to the baseline: zero on the `'zero'` scale, the\n * foot of the box on `'data'`. */\n readonly areaPath: string;\n readonly points: readonly SparklinePoint[];\n}\n\n/** Positions in percent of the box, x across the readings and y down from the top of the scale.\n * A flat series on the `'data'` scale draws through the middle. A `null` breaks the line. */\nexport function sparklineGeometry(\n data: readonly (number | null)[],\n scale: SparklineScale,\n): SparklineGeometry {\n const finite = data.filter(\n (value): value is number => value !== null && Number.isFinite(value),\n );\n if (finite.length === 0) {\n return { path: '', areaPath: '', points: [] };\n }\n const floor = scale === 'zero' ? Math.min(0, ...finite) : Math.min(...finite);\n const ceiling =\n scale === 'zero' ? Math.max(0, ...finite) : Math.max(...finite);\n const span = ceiling - floor;\n const lastIndex = data.length - 1;\n const baseline = scale === 'zero' && span > 0 ? (ceiling / span) * 100 : 100;\n const points: SparklinePoint[] = [];\n const runs: SparklinePoint[][] = [];\n let path = '';\n let penDown = false;\n data.forEach((value, index) => {\n if (value === null || !Number.isFinite(value)) {\n penDown = false;\n\n return;\n }\n const x = lastIndex === 0 ? 50 : (index / lastIndex) * 100;\n const y = span === 0 ? 50 : ((ceiling - value) / span) * 100;\n const point = { index, x, y };\n points.push(point);\n if (penDown) {\n runs[runs.length - 1].push(point);\n } else {\n runs.push([point]);\n }\n path += `${penDown ? 'L' : 'M'}${x} ${y}`;\n penDown = true;\n });\n const areaPath = runs\n .map(\n (run) =>\n `M${run[0].x} ${baseline}` +\n run.map((point) => `L${point.x} ${point.y}`).join('') +\n `L${run[run.length - 1].x} ${baseline}Z`,\n )\n .join('');\n\n return { path, areaPath, points };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n LOCALE_ID,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartTooltipContext,\n ChartTooltipOrigin,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport { sparklineGeometry } from './sparkline.math';\nimport type { SparklinePoint } from './sparkline.math';\nimport type { SparklineScale } from './sparkline.types';\n\n/** A word-sized trend line: no axes, legend or frame, a dot on the last reading, and a tooltip.\n * Sized by `--ds-sparkline-width` and `--ds-sparkline-height`. */\n@Component({\n selector: 'ds-sparkline',\n standalone: true,\n imports: [ChartTooltipDirective],\n templateUrl: './sparkline.component.html',\n styleUrl: './sparkline.component.scss',\n host: {\n '[attr.role]': \"label() ? 'img' : null\",\n '[attr.aria-label]': 'label()',\n '[attr.aria-hidden]': \"label() ? null : 'true'\",\n '[attr.tabindex]': 'focusable() ? 0 : null',\n '(focus)': 'onFocus()',\n '(blur)': 'clearActive()',\n '(keydown)': 'onKeydown($event)',\n },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SparklineComponent {\n /** Fills the band under the line down to the baseline. The colour is\n * `--ds-sparkline-area-color`, the line's own by default, at `--ds-sparkline-area-opacity`. */\n readonly area = input(false, { transform: booleanAttribute });\n\n /** One reading per step, oldest first. `null` breaks the line. */\n readonly data = input<readonly (number | null)[]>([]);\n\n /** What each reading is, for the tooltip. Left out, the tooltip prints the value alone. */\n readonly categories = input<readonly string[]>([]);\n\n /** Accessible name, and the series name in the tooltip. Left out, the sparkline is decorative\n * and hidden from assistive technology. */\n readonly label = input<string | null>(null);\n\n readonly scale = input<SparklineScale>('data');\n\n /** Shows the reading under the pointer, and under the keyboard where `label` makes the sparkline\n * focusable: focus opens the last reading; arrows, Home and End move. */\n readonly tooltip = input(true, { transform: booleanAttribute });\n\n /** Formats the value the tooltip prints. Unset, the locale's plain number format. */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n private readonly locale = inject(LOCALE_ID);\n\n private readonly canvas =\n viewChild.required<ElementRef<SVGSVGElement>>('canvas');\n\n protected readonly focusable = computed(\n () => this.tooltip() && this.label() !== null,\n );\n\n protected readonly geometry = computed(() =>\n sparklineGeometry(this.data(), this.scale()),\n );\n\n protected readonly activePoint = signal<SparklinePoint | null>(null);\n\n protected readonly shownPoint = computed(\n () => this.activePoint() ?? this.geometry().points.at(-1) ?? null,\n );\n\n protected readonly tooltipOrigin = signal<ChartTooltipOrigin | null>(null);\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const point = this.activePoint();\n const value = point ? this.data()[point.index] : null;\n if (!point || value == null || !this.tooltip()) {\n return null;\n }\n const format =\n this.valueFormat() ??\n ((reading: number) => reading.toLocaleString(this.locale));\n\n return {\n category: this.categories()[point.index] ?? '',\n entries: [\n {\n label: this.label() ?? '',\n value,\n formatted: format(value),\n color:\n 'var(--ds-sparkline-line-color, var(--ds-chart-series-1-color))',\n },\n ],\n };\n },\n );\n\n protected onPointerMove(event: PointerEvent): void {\n const points = this.geometry().points;\n if (!this.tooltip() || points.length === 0) {\n return;\n }\n const box = this.canvas().nativeElement.getBoundingClientRect();\n const across = ((event.clientX - box.left) / box.width) * 100;\n this.activate(\n points.reduce((best, point) =>\n Math.abs(point.x - across) < Math.abs(best.x - across) ? point : best,\n ),\n );\n }\n\n protected onFocus(): void {\n const last = this.geometry().points.at(-1);\n if (this.focusable() && last) {\n this.activate(last);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const points = this.geometry().points;\n const current = this.activePoint();\n if (!this.focusable() || !current) {\n return;\n }\n const position = points.indexOf(current);\n const target = {\n ArrowLeft: position - 1,\n ArrowRight: position + 1,\n Home: 0,\n End: points.length - 1,\n }[event.key];\n if (target === undefined) {\n return;\n }\n event.preventDefault();\n this.activate(points[Math.min(Math.max(target, 0), points.length - 1)]);\n }\n\n protected clearActive(): void {\n this.activePoint.set(null);\n this.tooltipOrigin.set(null);\n }\n\n private activate(point: SparklinePoint): void {\n if (point === this.activePoint()) {\n return;\n }\n const box = this.canvas().nativeElement.getBoundingClientRect();\n this.activePoint.set(point);\n this.tooltipOrigin.set({\n x: box.left + (point.x / 100) * box.width,\n y: box.top + (point.y / 100) * box.height,\n });\n }\n}\n","<svg\n #canvas\n class=\"sparkline\"\n aria-hidden=\"true\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"clearActive()\">\n <svg\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\">\n @if (area()) {\n <path\n class=\"area\"\n [attr.d]=\"geometry().areaPath\" />\n }\n\n <path\n class=\"line\"\n [attr.d]=\"geometry().path\" />\n </svg>\n\n @if (shownPoint(); as point) {\n <circle\n class=\"dot\"\n [attr.cx]=\"point.x + '%'\"\n [attr.cy]=\"point.y + '%'\" />\n }\n</svg>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAgBA;AAC8F;AACxF,SAAU,iBAAiB,CAC/B,IAAgC,EAChC,KAAqB,EAAA;IAErB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CACxB,CAAC,KAAK,KAAsB,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CACrE;AACD,IAAA,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;AACvB,QAAA,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IAC/C;IACA,MAAM,KAAK,GAAG,KAAK,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IAC7E,MAAM,OAAO,GACX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ACtB,wBAAA,QAAQ,EAAE,eAAe;AACzB,wBAAA,WAAW,EAAE,mBAAmB;AACjC,qBAAA,EAAA,aAAA,EACc,iBAAiB,CAAC,QAAQ,EAAA,eAAA,EACxB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,itBAAA,EAAA,MAAA,EAAA,CAAA,4oEAAA,CAAA,EAAA;gtBA6BC,QAAQ,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AErE1D;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-sparkline.mjs","sources":["../../../src/lib/components/sparkline/sparkline.math.ts","../../../src/lib/components/sparkline/sparkline.component.ts","../../../src/lib/components/sparkline/sparkline.component.html","../../../src/lib/components/sparkline/ids-group-ltd-ids-design-system-components-sparkline.ts"],"sourcesContent":["import type { SparklineScale } from './sparkline.types';\n\nexport interface SparklinePoint {\n readonly index: number;\n readonly x: number;\n readonly y: number;\n}\n\nexport interface SparklineGeometry {\n readonly path: string;\n /** Each unbroken run of the line closed down to the baseline: zero on the `'zero'` scale, the\n * foot of the box on `'data'`. */\n readonly areaPath: string;\n readonly points: readonly SparklinePoint[];\n}\n\n/** Positions in percent of the box, x across the readings and y down from the top of the scale.\n * A flat series on the `'data'` scale draws through the middle. A `null` breaks the line. */\nexport function sparklineGeometry(\n data: readonly (number | null)[],\n scale: SparklineScale,\n): SparklineGeometry {\n const finite = data.filter(\n (value): value is number => value !== null && Number.isFinite(value),\n );\n if (finite.length === 0) {\n return { path: '', areaPath: '', points: [] };\n }\n const floor = scale === 'zero' ? Math.min(0, ...finite) : Math.min(...finite);\n const ceiling =\n scale === 'zero' ? Math.max(0, ...finite) : Math.max(...finite);\n const span = ceiling - floor;\n const lastIndex = data.length - 1;\n const baseline = scale === 'zero' && span > 0 ? (ceiling / span) * 100 : 100;\n const points: SparklinePoint[] = [];\n const runs: SparklinePoint[][] = [];\n let path = '';\n let penDown = false;\n data.forEach((value, index) => {\n if (value === null || !Number.isFinite(value)) {\n penDown = false;\n\n return;\n }\n const x = lastIndex === 0 ? 50 : (index / lastIndex) * 100;\n const y = span === 0 ? 50 : ((ceiling - value) / span) * 100;\n const point = { index, x, y };\n points.push(point);\n if (penDown) {\n runs[runs.length - 1].push(point);\n } else {\n runs.push([point]);\n }\n path += `${penDown ? 'L' : 'M'}${x} ${y}`;\n penDown = true;\n });\n const areaPath = runs\n .map(\n (run) =>\n `M${run[0].x} ${baseline}` +\n run.map((point) => `L${point.x} ${point.y}`).join('') +\n `L${run[run.length - 1].x} ${baseline}Z`,\n )\n .join('');\n\n return { path, areaPath, points };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n LOCALE_ID,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartTooltipContext,\n ChartTooltipOrigin,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport { sparklineGeometry } from './sparkline.math';\nimport type { SparklinePoint } from './sparkline.math';\nimport type { SparklineScale } from './sparkline.types';\n\n/** A word-sized trend line: no axes, legend or frame, a dot on the last reading, and a tooltip.\n * Sized by `--ds-sparkline-width` and `--ds-sparkline-height`. */\n@Component({\n selector: 'ds-sparkline',\n standalone: true,\n imports: [ChartTooltipDirective],\n templateUrl: './sparkline.component.html',\n styleUrl: './sparkline.component.scss',\n host: {\n '[attr.role]': \"label() ? 'img' : null\",\n '[attr.aria-label]': 'label()',\n '[attr.aria-hidden]': \"label() ? null : 'true'\",\n '[attr.tabindex]': 'focusable() ? 0 : null',\n '(focus)': 'onFocus()',\n '(blur)': 'clearActive()',\n '(keydown)': 'onKeydown($event)',\n },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SparklineComponent {\n /** Fills the band under the line down to the baseline. The colour is\n * `--ds-sparkline-area-color`, the line's own by default, at `--ds-sparkline-area-opacity`. */\n readonly area = input(false, { transform: booleanAttribute });\n\n /** One reading per step, oldest first. `null` breaks the line. */\n readonly data = input<readonly (number | null)[]>([]);\n\n /** What each reading is, for the tooltip. Left out, the tooltip prints the value alone. */\n readonly categories = input<readonly string[]>([]);\n\n /** Accessible name, and the series name in the tooltip. Left out, the sparkline is decorative\n * and hidden from assistive technology. */\n readonly label = input<string | null>(null);\n\n readonly scale = input<SparklineScale>('data');\n\n /** Shows the reading under the pointer, and under the keyboard where `label` makes the sparkline\n * focusable: focus opens the last reading; arrows, Home and End move. */\n readonly tooltip = input(true, { transform: booleanAttribute });\n\n /** Formats the value the tooltip prints. Unset, the locale's plain number format. */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n private readonly locale = inject(LOCALE_ID);\n\n private readonly canvas =\n viewChild.required<ElementRef<SVGSVGElement>>('canvas');\n\n protected readonly focusable = computed(\n () => this.tooltip() && this.label() !== null,\n );\n\n protected readonly geometry = computed(() =>\n sparklineGeometry(this.data(), this.scale()),\n );\n\n protected readonly activePoint = signal<SparklinePoint | null>(null);\n\n protected readonly shownPoint = computed(\n () => this.activePoint() ?? this.geometry().points.at(-1) ?? null,\n );\n\n protected readonly tooltipOrigin = signal<ChartTooltipOrigin | null>(null);\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const point = this.activePoint();\n const value = point ? this.data()[point.index] : null;\n if (!point || value == null || !this.tooltip()) {\n return null;\n }\n const format =\n this.valueFormat() ??\n ((reading: number) => reading.toLocaleString(this.locale));\n\n return {\n category: this.categories()[point.index] ?? '',\n entries: [\n {\n label: this.label() ?? '',\n value,\n formatted: format(value),\n color:\n 'var(--ds-sparkline-line-color, var(--ds-chart-series-1-color))',\n },\n ],\n };\n },\n );\n\n protected onPointerMove(event: PointerEvent): void {\n const points = this.geometry().points;\n if (!this.tooltip() || points.length === 0) {\n return;\n }\n const box = this.canvas().nativeElement.getBoundingClientRect();\n const across = ((event.clientX - box.left) / box.width) * 100;\n this.activate(\n points.reduce((best, point) =>\n Math.abs(point.x - across) < Math.abs(best.x - across) ? point : best,\n ),\n );\n }\n\n protected onFocus(): void {\n const last = this.geometry().points.at(-1);\n if (this.focusable() && last) {\n this.activate(last);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const points = this.geometry().points;\n const current = this.activePoint();\n if (!this.focusable() || !current) {\n return;\n }\n const position = points.indexOf(current);\n const target = {\n ArrowLeft: position - 1,\n ArrowRight: position + 1,\n Home: 0,\n End: points.length - 1,\n }[event.key];\n if (target === undefined) {\n return;\n }\n event.preventDefault();\n this.activate(points[Math.min(Math.max(target, 0), points.length - 1)]);\n }\n\n protected clearActive(): void {\n this.activePoint.set(null);\n this.tooltipOrigin.set(null);\n }\n\n private activate(point: SparklinePoint): void {\n if (point === this.activePoint()) {\n return;\n }\n const box = this.canvas().nativeElement.getBoundingClientRect();\n this.activePoint.set(point);\n this.tooltipOrigin.set({\n x: box.left + (point.x / 100) * box.width,\n y: box.top + (point.y / 100) * box.height,\n });\n }\n}\n","<svg\n #canvas\n class=\"sparkline\"\n aria-hidden=\"true\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipOrigin]=\"tooltipOrigin()\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerleave)=\"clearActive()\">\n <svg\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\">\n @if (area()) {\n <path\n class=\"area\"\n [attr.d]=\"geometry().areaPath\" />\n }\n\n <path\n class=\"line\"\n [attr.d]=\"geometry().path\" />\n </svg>\n\n @if (shownPoint(); as point) {\n <circle\n class=\"dot\"\n [attr.cx]=\"point.x + '%'\"\n [attr.cy]=\"point.y + '%'\" />\n }\n</svg>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAgBA;AAC8F;AACxF,SAAU,iB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AAA,EAAA,sBAAA,EAAA,wBAAA,EAAA,wBAAA,EAAA,sBAAA,EAAA,wBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAepB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAlB9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,cAAc,cACZ,IAAI,EAAA,OAAA,EACP,CAAC,qBAAqB,CAAC,EAAA,IAAA,EAG1B;AACJ,wBAAA,aAAa,EAAE,wBAAwB;AACvC,wBAAA,mBAAmB,EAAE,SAAS;AAC9B,wBAAA,oBAAoB,EAAE,yBAAyB;AAC/C,wBAAA,iBAAiB,EAAE,wBAAwB;AAC3C,wBAAA,SAAS,EAAE,WAAW;AACtB,wBAAA,QAAQ,EAAE,eAAe;AACzB,wBAAA,WAAW,EAAE,mBAAmB;AACjC,qBAAA,EAAA,aAAA,EACc,iBAAiB,CAAC,QAAQ,EAAA,eAAA,EACxB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,itBAAA,EAAA,MAAA,EAAA,CAAA,wwCAAA,CAAA,EAAA;gtBA6BC,QAAQ,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AErE1D;;AAEG;;;;"}
|
|
@@ -47,14 +47,14 @@ class SplitButtonComponent {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SplitButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
50
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: SplitButtonComponent, isStandalone: true, selector: "ds-split-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, menuItems: { classPropertyName: "menuItems", publicName: "menuItems", isSignal: true, isRequired: false, transformFunction: null }, menuLabel: { classPropertyName: "menuLabel", publicName: "menuLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressed", itemSelected: "itemSelected" }, host: { properties: { "class.primary": "variant() === 'primary'", "class.outline": "variant() === 'outline'" } }, ngImport: i0, template: "<button\n type=\"button\"\n class=\"main\"\n [disabled]=\"disabled()\"\n (click)=\"pressed.emit($event)\">\n @if (icon(); as name) {\n <ds-icon\n [name]=\"name\"\n [size]=\"18\" />\n }\n\n @if (label()) {\n <span class=\"label\">\n {{ label() }}\n </span>\n }\n\n <ng-content></ng-content>\n</button>\n\n<button\n #trigger\n type=\"button\"\n class=\"toggle\"\n aria-haspopup=\"menu\"\n [class.open]=\"pop.opened()\"\n [attr.aria-expanded]=\"pop.opened()\"\n [attr.aria-label]=\"menuLabelResolved()\"\n [disabled]=\"disabled() || !menuItems().length\"\n (click)=\"pop.toggle(trigger)\"\n (keydown)=\"onTriggerKeydown($event, pop, trigger)\">\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"18\" />\n</button>\n\n<ds-popover\n #pop\n align=\"end\"\n panelRole=\"presentation\">\n <ds-menu>\n @for (item of menuItems(); track item) {\n <ds-menu-item\n [icon]=\"item.icon ?? null\"\n [disabled]=\"item.disabled ?? false\"\n [error]=\"item.error ?? false\"\n (pressed)=\"onItemSelect(item)\">\n {{ item.label }}\n </ds-menu-item>\n }\n </ds-menu>\n</ds-popover>\n", styles: [":
|
|
50
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: SplitButtonComponent, isStandalone: true, selector: "ds-split-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, menuItems: { classPropertyName: "menuItems", publicName: "menuItems", isSignal: true, isRequired: false, transformFunction: null }, menuLabel: { classPropertyName: "menuLabel", publicName: "menuLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressed", itemSelected: "itemSelected" }, host: { properties: { "class.primary": "variant() === 'primary'", "class.outline": "variant() === 'outline'" } }, ngImport: i0, template: "<button\n type=\"button\"\n class=\"main\"\n [disabled]=\"disabled()\"\n (click)=\"pressed.emit($event)\">\n @if (icon(); as name) {\n <ds-icon\n [name]=\"name\"\n [size]=\"18\" />\n }\n\n @if (label()) {\n <span class=\"label\">\n {{ label() }}\n </span>\n }\n\n <ng-content></ng-content>\n</button>\n\n<button\n #trigger\n type=\"button\"\n class=\"toggle\"\n aria-haspopup=\"menu\"\n [class.open]=\"pop.opened()\"\n [attr.aria-expanded]=\"pop.opened()\"\n [attr.aria-label]=\"menuLabelResolved()\"\n [disabled]=\"disabled() || !menuItems().length\"\n (click)=\"pop.toggle(trigger)\"\n (keydown)=\"onTriggerKeydown($event, pop, trigger)\">\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"18\" />\n</button>\n\n<ds-popover\n #pop\n align=\"end\"\n panelRole=\"presentation\">\n <ds-menu>\n @for (item of menuItems(); track item) {\n <ds-menu-item\n [icon]=\"item.icon ?? null\"\n [disabled]=\"item.disabled ?? false\"\n [error]=\"item.error ?? false\"\n (pressed)=\"onItemSelect(item)\">\n {{ item.label }}\n </ds-menu-item>\n }\n </ds-menu>\n</ds-popover>\n", styles: [":host{display:inline-flex;--_split-button-bg-color: var(--ds-split-button-bg-color, var(--accent));--_split-button-text-color: var(--ds-split-button-text-color, var(--accent-on));--_split-button-bg-color-hover: var(--ds-split-button-bg-color-hover, var(--accent-hover));--_split-button-divider-color: var(--ds-split-button-divider-color, var(--btn-split-divider));--_split-button-outline-bg-color: var(--ds-split-button-outline-bg-color, transparent);--_split-button-outline-border-color: var(--ds-split-button-outline-border-color, var(--border-default));--_split-button-bg-color-active: var(--ds-split-button-bg-color-active, color-mix(in srgb, var(--_split-button-bg-color) 76%, black));--_split-button-outline-bg-color-active: var(--ds-split-button-outline-bg-color-active, var(--surface-muted));--_split-button-press-scale: var(--ds-split-button-press-scale, .98);--_split-button-pressed-shadow: var(--ds-split-button-pressed-shadow, none)}.main,.toggle{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);--_field-height: var(--ds-field-height, var(--field-h-md));height:var(--_field-height);border:var(--border-width-default) solid transparent;background:transparent;font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);cursor:pointer;position:relative;transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard),transform var(--duration-instant) var(--ease-standard)}.main:active:not(:disabled),.toggle:active:not(:disabled){box-shadow:var(--_split-button-pressed-shadow);transform:scale(var(--_split-button-press-scale))}.main:focus-visible,.toggle: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);z-index:var(--btn-group-focus-z)}.main:disabled,.toggle:disabled{background:var(--surface-muted);border-color:var(--border-divider);color:var(--text-disabled);cursor:not-allowed}.main{padding:0 var(--space-4);border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md);transform-origin:right center}.toggle{padding:0 var(--space-2);margin-left:var(--btn-group-overlap);border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md);transform-origin:left center}.chevron{transition:transform var(--duration-fast) var(--ease-standard)}.toggle.open .chevron{transform:rotate(180deg)}:host(.primary) .main:not(:disabled),:host(.primary) .toggle:not(:disabled){background:var(--_split-button-bg-color);color:var(--_split-button-text-color)}:host(.primary) .main:not(:disabled):hover,:host(.primary) .toggle:not(:disabled):hover{background:var(--_split-button-bg-color-hover)}:host(.primary) .main:not(:disabled):active,:host(.primary) .toggle:not(:disabled):active{background:var(--_split-button-bg-color-active)}:host(.primary) .toggle:not(:disabled){border-left:var(--border-width-default) solid var(--_split-button-divider-color)}:host(.outline) .main:not(:disabled),:host(.outline) .toggle:not(:disabled){background:var(--_split-button-outline-bg-color);border-color:var(--_split-button-outline-border-color);color:var(--text-primary)}:host(.outline) .main:not(:disabled):hover,:host(.outline) .toggle:not(:disabled):hover{background:var(--surface-secondary)}:host(.outline) .main:not(:disabled):active,:host(.outline) .toggle:not(:disabled):active{background:var(--_split-button-outline-bg-color-active)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: MenuComponent, selector: "ds-menu" }, { kind: "component", type: MenuItemComponent, selector: "ds-menu-item", inputs: ["icon", "disabled", "error", "quiet", "description", "submenu"], outputs: ["pressed"] }, { kind: "component", type: PopoverComponent, selector: "ds-popover", inputs: ["align", "placement", "arrow", "panelRole", "panelLabel"] }] });
|
|
51
51
|
}
|
|
52
52
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SplitButtonComponent, decorators: [{
|
|
53
53
|
type: Component,
|
|
54
54
|
args: [{ selector: 'ds-split-button', standalone: true, imports: [IconComponent, MenuComponent, MenuItemComponent, PopoverComponent], encapsulation: ViewEncapsulation.Emulated, host: {
|
|
55
55
|
'[class.primary]': "variant() === 'primary'",
|
|
56
56
|
'[class.outline]': "variant() === 'outline'",
|
|
57
|
-
}, template: "<button\n type=\"button\"\n class=\"main\"\n [disabled]=\"disabled()\"\n (click)=\"pressed.emit($event)\">\n @if (icon(); as name) {\n <ds-icon\n [name]=\"name\"\n [size]=\"18\" />\n }\n\n @if (label()) {\n <span class=\"label\">\n {{ label() }}\n </span>\n }\n\n <ng-content></ng-content>\n</button>\n\n<button\n #trigger\n type=\"button\"\n class=\"toggle\"\n aria-haspopup=\"menu\"\n [class.open]=\"pop.opened()\"\n [attr.aria-expanded]=\"pop.opened()\"\n [attr.aria-label]=\"menuLabelResolved()\"\n [disabled]=\"disabled() || !menuItems().length\"\n (click)=\"pop.toggle(trigger)\"\n (keydown)=\"onTriggerKeydown($event, pop, trigger)\">\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"18\" />\n</button>\n\n<ds-popover\n #pop\n align=\"end\"\n panelRole=\"presentation\">\n <ds-menu>\n @for (item of menuItems(); track item) {\n <ds-menu-item\n [icon]=\"item.icon ?? null\"\n [disabled]=\"item.disabled ?? false\"\n [error]=\"item.error ?? false\"\n (pressed)=\"onItemSelect(item)\">\n {{ item.label }}\n </ds-menu-item>\n }\n </ds-menu>\n</ds-popover>\n", styles: [":
|
|
57
|
+
}, template: "<button\n type=\"button\"\n class=\"main\"\n [disabled]=\"disabled()\"\n (click)=\"pressed.emit($event)\">\n @if (icon(); as name) {\n <ds-icon\n [name]=\"name\"\n [size]=\"18\" />\n }\n\n @if (label()) {\n <span class=\"label\">\n {{ label() }}\n </span>\n }\n\n <ng-content></ng-content>\n</button>\n\n<button\n #trigger\n type=\"button\"\n class=\"toggle\"\n aria-haspopup=\"menu\"\n [class.open]=\"pop.opened()\"\n [attr.aria-expanded]=\"pop.opened()\"\n [attr.aria-label]=\"menuLabelResolved()\"\n [disabled]=\"disabled() || !menuItems().length\"\n (click)=\"pop.toggle(trigger)\"\n (keydown)=\"onTriggerKeydown($event, pop, trigger)\">\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"18\" />\n</button>\n\n<ds-popover\n #pop\n align=\"end\"\n panelRole=\"presentation\">\n <ds-menu>\n @for (item of menuItems(); track item) {\n <ds-menu-item\n [icon]=\"item.icon ?? null\"\n [disabled]=\"item.disabled ?? false\"\n [error]=\"item.error ?? false\"\n (pressed)=\"onItemSelect(item)\">\n {{ item.label }}\n </ds-menu-item>\n }\n </ds-menu>\n</ds-popover>\n", styles: [":host{display:inline-flex;--_split-button-bg-color: var(--ds-split-button-bg-color, var(--accent));--_split-button-text-color: var(--ds-split-button-text-color, var(--accent-on));--_split-button-bg-color-hover: var(--ds-split-button-bg-color-hover, var(--accent-hover));--_split-button-divider-color: var(--ds-split-button-divider-color, var(--btn-split-divider));--_split-button-outline-bg-color: var(--ds-split-button-outline-bg-color, transparent);--_split-button-outline-border-color: var(--ds-split-button-outline-border-color, var(--border-default));--_split-button-bg-color-active: var(--ds-split-button-bg-color-active, color-mix(in srgb, var(--_split-button-bg-color) 76%, black));--_split-button-outline-bg-color-active: var(--ds-split-button-outline-bg-color-active, var(--surface-muted));--_split-button-press-scale: var(--ds-split-button-press-scale, .98);--_split-button-pressed-shadow: var(--ds-split-button-pressed-shadow, none)}.main,.toggle{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);--_field-height: var(--ds-field-height, var(--field-h-md));height:var(--_field-height);border:var(--border-width-default) solid transparent;background:transparent;font:var(--font-weight-semibold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);cursor:pointer;position:relative;transition:background-color var(--duration-fast) var(--ease-standard),border-color var(--duration-fast) var(--ease-standard),transform var(--duration-instant) var(--ease-standard)}.main:active:not(:disabled),.toggle:active:not(:disabled){box-shadow:var(--_split-button-pressed-shadow);transform:scale(var(--_split-button-press-scale))}.main:focus-visible,.toggle: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);z-index:var(--btn-group-focus-z)}.main:disabled,.toggle:disabled{background:var(--surface-muted);border-color:var(--border-divider);color:var(--text-disabled);cursor:not-allowed}.main{padding:0 var(--space-4);border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md);transform-origin:right center}.toggle{padding:0 var(--space-2);margin-left:var(--btn-group-overlap);border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md);transform-origin:left center}.chevron{transition:transform var(--duration-fast) var(--ease-standard)}.toggle.open .chevron{transform:rotate(180deg)}:host(.primary) .main:not(:disabled),:host(.primary) .toggle:not(:disabled){background:var(--_split-button-bg-color);color:var(--_split-button-text-color)}:host(.primary) .main:not(:disabled):hover,:host(.primary) .toggle:not(:disabled):hover{background:var(--_split-button-bg-color-hover)}:host(.primary) .main:not(:disabled):active,:host(.primary) .toggle:not(:disabled):active{background:var(--_split-button-bg-color-active)}:host(.primary) .toggle:not(:disabled){border-left:var(--border-width-default) solid var(--_split-button-divider-color)}:host(.outline) .main:not(:disabled),:host(.outline) .toggle:not(:disabled){background:var(--_split-button-outline-bg-color);border-color:var(--_split-button-outline-border-color);color:var(--text-primary)}:host(.outline) .main:not(:disabled):hover,:host(.outline) .toggle:not(:disabled):hover{background:var(--surface-secondary)}:host(.outline) .main:not(:disabled):active,:host(.outline) .toggle:not(:disabled):active{background:var(--_split-button-outline-bg-color-active)}\n"] }]
|
|
58
58
|
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], menuItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuItems", required: false }] }], menuLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuLabel", required: false }] }], pressed: [{ type: i0.Output, args: ["pressed"] }], itemSelected: [{ type: i0.Output, args: ["itemSelected"] }] } });
|
|
59
59
|
|
|
60
60
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-split-button.mjs","sources":["../../../src/lib/components/split-button/split-button.component.ts","../../../src/lib/components/split-button/split-button.component.html","../../../src/lib/components/split-button/ids-group-ltd-ids-design-system-components-split-button.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { DS_INTL, devWarn } from '@ids-group-ltd/ids-design-system/core';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport { MenuComponent } from '@ids-group-ltd/ids-design-system/components/menu';\nimport { MenuItemComponent } from '@ids-group-ltd/ids-design-system/components/menu';\nimport { PopoverComponent } from '@ids-group-ltd/ids-design-system/components/popover';\nimport type { SplitButtonItem, SplitButtonVariant } from './split-button.types';\n\n@Component({\n selector: 'ds-split-button',\n standalone: true,\n imports: [IconComponent, MenuComponent, MenuItemComponent, PopoverComponent],\n templateUrl: './split-button.component.html',\n styleUrl: './split-button.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[class.primary]': \"variant() === 'primary'\",\n '[class.outline]': \"variant() === 'outline'\",\n },\n})\nexport class SplitButtonComponent {\n private readonly intl = inject(DS_INTL);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n devWarn(() =>\n this.menuItems().length\n ? null\n : '[ds-split-button] has no `menuItems`, so the chevron is disabled — a chevron that opens' +\n ' nothing reads as a broken control. Pass the items, or use `ds-button` for a single' +\n ' action.',\n );\n }\n }\n\n /** Label text on the main button. */\n readonly label = input<string>('');\n /** Visual style - primary (solid) or outline. */\n readonly variant = input<SplitButtonVariant>('primary');\n /** Icon before the label on the main button. */\n readonly icon = input<IconName | null>(null);\n /** Disables the main button and the dropdown trigger. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Items listed in the dropdown menu. Empty disables the chevron. */\n readonly menuItems = input<readonly SplitButtonItem[]>([]);\n /** Accessible name of the dropdown trigger. Unset falls back to `DS_INTL.splitButton.menuLabel`. */\n readonly menuLabel = input<string | null>(null);\n protected readonly menuLabelResolved = computed(\n () => this.menuLabel() ?? this.intl().splitButton.menuLabel,\n );\n /** Fires on a click of the main button, not the dropdown trigger. */\n readonly pressed = output<MouseEvent>();\n /** Fires for a menu item only; the main button emits `pressed`. */\n readonly itemSelected = output<SplitButtonItem>();\n\n protected onItemSelect(item: SplitButtonItem): void {\n if (item.disabled) {\n return;\n }\n // ds-menu-item closes the popover itself via the injected DsOverlayCloseRef.\n this.itemSelected.emit(item);\n }\n\n protected onTriggerKeydown(\n event: KeyboardEvent,\n popover: PopoverComponent,\n trigger: HTMLElement,\n ): void {\n if (event.key === 'ArrowDown' && !popover.opened()) {\n event.preventDefault();\n popover.toggle(trigger);\n }\n }\n}\n","<button\n type=\"button\"\n class=\"main\"\n [disabled]=\"disabled()\"\n (click)=\"pressed.emit($event)\">\n @if (icon(); as name) {\n <ds-icon\n [name]=\"name\"\n [size]=\"18\" />\n }\n\n @if (label()) {\n <span class=\"label\">\n {{ label() }}\n </span>\n }\n\n <ng-content></ng-content>\n</button>\n\n<button\n #trigger\n type=\"button\"\n class=\"toggle\"\n aria-haspopup=\"menu\"\n [class.open]=\"pop.opened()\"\n [attr.aria-expanded]=\"pop.opened()\"\n [attr.aria-label]=\"menuLabelResolved()\"\n [disabled]=\"disabled() || !menuItems().length\"\n (click)=\"pop.toggle(trigger)\"\n (keydown)=\"onTriggerKeydown($event, pop, trigger)\">\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"18\" />\n</button>\n\n<ds-popover\n #pop\n align=\"end\"\n panelRole=\"presentation\">\n <ds-menu>\n @for (item of menuItems(); track item) {\n <ds-menu-item\n [icon]=\"item.icon ?? null\"\n [disabled]=\"item.disabled ?? false\"\n [error]=\"item.error ?? false\"\n (pressed)=\"onItemSelect(item)\">\n {{ item.label }}\n </ds-menu-item>\n }\n </ds-menu>\n</ds-popover>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA6Ba,oBAAoB,CAAA;AACd,IAAA,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;AAE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A,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-split-button.mjs","sources":["../../../src/lib/components/split-button/split-button.component.ts","../../../src/lib/components/split-button/split-button.component.html","../../../src/lib/components/split-button/ids-group-ltd-ids-design-system-components-split-button.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { DS_INTL, devWarn } from '@ids-group-ltd/ids-design-system/core';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport { MenuComponent } from '@ids-group-ltd/ids-design-system/components/menu';\nimport { MenuItemComponent } from '@ids-group-ltd/ids-design-system/components/menu';\nimport { PopoverComponent } from '@ids-group-ltd/ids-design-system/components/popover';\nimport type { SplitButtonItem, SplitButtonVariant } from './split-button.types';\n\n@Component({\n selector: 'ds-split-button',\n standalone: true,\n imports: [IconComponent, MenuComponent, MenuItemComponent, PopoverComponent],\n templateUrl: './split-button.component.html',\n styleUrl: './split-button.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[class.primary]': \"variant() === 'primary'\",\n '[class.outline]': \"variant() === 'outline'\",\n },\n})\nexport class SplitButtonComponent {\n private readonly intl = inject(DS_INTL);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n devWarn(() =>\n this.menuItems().length\n ? null\n : '[ds-split-button] has no `menuItems`, so the chevron is disabled — a chevron that opens' +\n ' nothing reads as a broken control. Pass the items, or use `ds-button` for a single' +\n ' action.',\n );\n }\n }\n\n /** Label text on the main button. */\n readonly label = input<string>('');\n /** Visual style - primary (solid) or outline. */\n readonly variant = input<SplitButtonVariant>('primary');\n /** Icon before the label on the main button. */\n readonly icon = input<IconName | null>(null);\n /** Disables the main button and the dropdown trigger. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Items listed in the dropdown menu. Empty disables the chevron. */\n readonly menuItems = input<readonly SplitButtonItem[]>([]);\n /** Accessible name of the dropdown trigger. Unset falls back to `DS_INTL.splitButton.menuLabel`. */\n readonly menuLabel = input<string | null>(null);\n protected readonly menuLabelResolved = computed(\n () => this.menuLabel() ?? this.intl().splitButton.menuLabel,\n );\n /** Fires on a click of the main button, not the dropdown trigger. */\n readonly pressed = output<MouseEvent>();\n /** Fires for a menu item only; the main button emits `pressed`. */\n readonly itemSelected = output<SplitButtonItem>();\n\n protected onItemSelect(item: SplitButtonItem): void {\n if (item.disabled) {\n return;\n }\n // ds-menu-item closes the popover itself via the injected DsOverlayCloseRef.\n this.itemSelected.emit(item);\n }\n\n protected onTriggerKeydown(\n event: KeyboardEvent,\n popover: PopoverComponent,\n trigger: HTMLElement,\n ): void {\n if (event.key === 'ArrowDown' && !popover.opened()) {\n event.preventDefault();\n popover.toggle(trigger);\n }\n }\n}\n","<button\n type=\"button\"\n class=\"main\"\n [disabled]=\"disabled()\"\n (click)=\"pressed.emit($event)\">\n @if (icon(); as name) {\n <ds-icon\n [name]=\"name\"\n [size]=\"18\" />\n }\n\n @if (label()) {\n <span class=\"label\">\n {{ label() }}\n </span>\n }\n\n <ng-content></ng-content>\n</button>\n\n<button\n #trigger\n type=\"button\"\n class=\"toggle\"\n aria-haspopup=\"menu\"\n [class.open]=\"pop.opened()\"\n [attr.aria-expanded]=\"pop.opened()\"\n [attr.aria-label]=\"menuLabelResolved()\"\n [disabled]=\"disabled() || !menuItems().length\"\n (click)=\"pop.toggle(trigger)\"\n (keydown)=\"onTriggerKeydown($event, pop, trigger)\">\n <ds-icon\n class=\"chevron\"\n name=\"chevronDown\"\n [size]=\"18\" />\n</button>\n\n<ds-popover\n #pop\n align=\"end\"\n panelRole=\"presentation\">\n <ds-menu>\n @for (item of menuItems(); track item) {\n <ds-menu-item\n [icon]=\"item.icon ?? null\"\n [disabled]=\"item.disabled ?? false\"\n [error]=\"item.error ?? false\"\n (pressed)=\"onItemSelect(item)\">\n {{ item.label }}\n </ds-menu-item>\n }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static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: StepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
59
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: StepperComponent, isStandalone: true, selector: "ds-stepper", inputs: { steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, current: { classPropertyName: "current", publicName: "current", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, errorSteps: { classPropertyName: "errorSteps", publicName: "errorSteps", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stepClicked: "stepClicked" }, host: { attributes: { "role": "list" }, properties: { "attr.aria-label": "intl().stepper.label", "class.labels-inline": "labelPosition() === 'inline'", "class.is-vertical": "orientation() === 'vertical'" } }, ngImport: i0, template: "@for (label of steps(); track $index; let i = $index, last = $last) {\n <span\n role=\"listitem\"\n class=\"step\"\n [class.is-current]=\"i === current()\"\n [attr.aria-current]=\"i === current() ? 'step' : null\">\n @if (clickable()) {\n <button\n type=\"button\"\n
|
|
59
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: StepperComponent, isStandalone: true, selector: "ds-stepper", inputs: { steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, current: { classPropertyName: "current", publicName: "current", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, errorSteps: { classPropertyName: "errorSteps", publicName: "errorSteps", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stepClicked: "stepClicked" }, host: { attributes: { "role": "list" }, properties: { "attr.aria-label": "intl().stepper.label", "class.labels-inline": "labelPosition() === 'inline'", "class.is-vertical": "orientation() === 'vertical'" } }, ngImport: i0, template: "@for (label of steps(); track $index; let i = $index, last = $last) {\n <span\n role=\"listitem\"\n class=\"step\"\n [class.is-current]=\"i === current()\"\n [attr.aria-current]=\"i === current() ? 'step' : null\">\n @if (clickable()) {\n <button\n type=\"button\"\n [class]=\"nodeClass(i)\"\n [attr.aria-label]=\"intl().stepper.step(i + 1, label, stepState(i))\"\n (click)=\"onStepClick(i)\">\n @if (stepState(i) === 'completed') {\n <ds-icon\n name=\"check\"\n [size]=\"14\" />\n } @else if (stepState(i) === 'error') {\n <ds-icon\n name=\"error\"\n [size]=\"14\" />\n } @else {\n {{ i + 1 }}\n }\n </button>\n } @else {\n <span\n aria-hidden=\"true\"\n [class]=\"nodeClass(i)\">\n @if (stepState(i) === 'completed') {\n <ds-icon\n name=\"check\"\n [size]=\"14\" />\n } @else if (stepState(i) === 'error') {\n <ds-icon\n name=\"error\"\n [size]=\"14\" />\n } @else {\n {{ i + 1 }}\n }\n </span>\n }\n\n <span\n aria-hidden=\"true\"\n class=\"step-label\">\n {{ label }}\n </span>\n\n @if (!last) {\n <span\n aria-hidden=\"true\"\n [class]=\"connectorClass(i)\">\n </span>\n }\n\n @if (!clickable()) {\n <span class=\"visually-hidden\">\n {{ intl().stepper.step(i + 1, label, stepState(i)) }}\n </span>\n }\n </span>\n}\n", styles: [":host{display:flex;align-items:flex-start;--_stepper-label-color: var(--ds-stepper-label-color, var(--text-tertiary));--_stepper-label-color-current: var(--ds-stepper-label-color-current, var(--text-primary));--_stepper-label-font-size: var(--ds-stepper-label-font-size, var(--font-size-xs));--_stepper-node-bg-color: var(--ds-stepper-node-bg-color, var(--surface-default));--_stepper-node-active-bg-color: var(--ds-stepper-node-active-bg-color, var(--accent));--_stepper-node-active-text-color: var(--ds-stepper-node-active-text-color, var(--accent-on));--_stepper-node-done-text-color: var(--ds-stepper-node-done-text-color, var(--accent));--_stepper-connector-color: var(--ds-stepper-connector-color, var(--border-divider));--_stepper-connector-done-color: var(--ds-stepper-connector-done-color, var(--accent))}:host .visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host .step{position:relative;flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;text-align:center}:host .node{position:relative;z-index:1;width:var(--stepper-node-size);height:var(--stepper-node-size);border-radius:var(--radius-pill);display:grid;place-items:center;border:var(--border-width-default) solid var(--border-strong);background:var(--_stepper-node-bg-color);color:var(--text-tertiary);font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);transition:background-color var(--duration-base) var(--ease-standard),border-color var(--duration-base) var(--ease-standard),color var(--duration-base) var(--ease-standard)}:host .node.done{background:var(--accent-subtitle);border-color:var(--accent);color:var(--_stepper-node-done-text-color)}:host .node.active{background:var(--_stepper-node-active-bg-color);border-color:var(--accent);color:var(--_stepper-node-active-text-color)}:host .node.error{background:var(--error-subtitle);border-color:var(--error);color:var(--error)}:host button.node{padding:0;appearance:none;cursor:pointer}:host button.node: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)}:host .connector{position:absolute;z-index:0;top:calc((var(--stepper-node-size) - var(--stepper-bar-h)) / 2);left:50%;width:100%;height:var(--stepper-bar-h);background:var(--_stepper-connector-color);transition:background-color var(--duration-base) var(--ease-standard)}:host .connector.done{background:var(--_stepper-connector-done-color)}:host .step-label{max-width:14ch;margin-top:var(--space-2);font-size:var(--_stepper-label-font-size);font-weight:var(--font-weight-medium);line-height:var(--line-height-snug);color:var(--_stepper-label-color);overflow-wrap:anywhere;transition:color var(--duration-base) var(--ease-standard)}:host .step.is-current .step-label{font-weight:var(--font-weight-bold);color:var(--_stepper-label-color-current)}:host(.labels-inline){display:inline-flex;align-items:center;gap:var(--space-2)}:host(.labels-inline) .step{flex:0 0 auto;flex-direction:row;gap:var(--space-2)}:host(.labels-inline) .step-label{max-width:none;margin-top:0;white-space:nowrap}:host(.labels-inline) .connector{position:static;flex:0 0 auto;width:var(--stepper-bar-w)}:host(.is-vertical){flex-direction:column;align-items:stretch}:host(.is-vertical) .step{flex:0 0 auto;flex-direction:row;align-items:flex-start;text-align:left;gap:var(--space-3);padding-bottom:var(--space-4)}:host(.is-vertical) .step:last-child{padding-bottom:0}:host(.is-vertical) .step-label{max-width:none;margin-top:0;align-self:center}:host(.is-vertical) .connector{position:absolute;top:var(--stepper-node-size);left:calc((var(--stepper-node-size) - var(--stepper-bar-h)) / 2);width:var(--stepper-bar-h);height:calc(100% - var(--stepper-node-size))}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }] });
|
|
60
60
|
}
|
|
61
61
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: StepperComponent, decorators: [{
|
|
62
62
|
type: Component,
|
|
@@ -65,7 +65,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
65
65
|
'[attr.aria-label]': 'intl().stepper.label',
|
|
66
66
|
'[class.labels-inline]': "labelPosition() === 'inline'",
|
|
67
67
|
'[class.is-vertical]': "orientation() === 'vertical'",
|
|
68
|
-
}, template: "@for (label of steps(); track $index; let i = $index, last = $last) {\n <span\n role=\"listitem\"\n class=\"step\"\n [class.is-current]=\"i === current()\"\n [attr.aria-current]=\"i === current() ? 'step' : null\">\n @if (clickable()) {\n <button\n type=\"button\"\n
|
|
68
|
+
}, template: "@for (label of steps(); track $index; let i = $index, last = $last) {\n <span\n role=\"listitem\"\n class=\"step\"\n [class.is-current]=\"i === current()\"\n [attr.aria-current]=\"i === current() ? 'step' : null\">\n @if (clickable()) {\n <button\n type=\"button\"\n [class]=\"nodeClass(i)\"\n [attr.aria-label]=\"intl().stepper.step(i + 1, label, stepState(i))\"\n (click)=\"onStepClick(i)\">\n @if (stepState(i) === 'completed') {\n <ds-icon\n name=\"check\"\n [size]=\"14\" />\n } @else if (stepState(i) === 'error') {\n <ds-icon\n name=\"error\"\n [size]=\"14\" />\n } @else {\n {{ i + 1 }}\n }\n </button>\n } @else {\n <span\n aria-hidden=\"true\"\n [class]=\"nodeClass(i)\">\n @if (stepState(i) === 'completed') {\n <ds-icon\n name=\"check\"\n [size]=\"14\" />\n } @else if (stepState(i) === 'error') {\n <ds-icon\n name=\"error\"\n [size]=\"14\" />\n } @else {\n {{ i + 1 }}\n }\n </span>\n }\n\n <span\n aria-hidden=\"true\"\n class=\"step-label\">\n {{ label }}\n </span>\n\n @if (!last) {\n <span\n aria-hidden=\"true\"\n [class]=\"connectorClass(i)\">\n </span>\n }\n\n @if (!clickable()) {\n <span class=\"visually-hidden\">\n {{ intl().stepper.step(i + 1, label, stepState(i)) }}\n </span>\n }\n </span>\n}\n", styles: [":host{display:flex;align-items:flex-start;--_stepper-label-color: var(--ds-stepper-label-color, var(--text-tertiary));--_stepper-label-color-current: var(--ds-stepper-label-color-current, var(--text-primary));--_stepper-label-font-size: var(--ds-stepper-label-font-size, var(--font-size-xs));--_stepper-node-bg-color: var(--ds-stepper-node-bg-color, var(--surface-default));--_stepper-node-active-bg-color: var(--ds-stepper-node-active-bg-color, var(--accent));--_stepper-node-active-text-color: var(--ds-stepper-node-active-text-color, var(--accent-on));--_stepper-node-done-text-color: var(--ds-stepper-node-done-text-color, var(--accent));--_stepper-connector-color: var(--ds-stepper-connector-color, var(--border-divider));--_stepper-connector-done-color: var(--ds-stepper-connector-done-color, var(--accent))}:host .visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:host .step{position:relative;flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;text-align:center}:host .node{position:relative;z-index:1;width:var(--stepper-node-size);height:var(--stepper-node-size);border-radius:var(--radius-pill);display:grid;place-items:center;border:var(--border-width-default) solid var(--border-strong);background:var(--_stepper-node-bg-color);color:var(--text-tertiary);font:var(--font-weight-bold) var(--font-size-xs)/var(--line-height-flat) var(--font-sans);transition:background-color var(--duration-base) var(--ease-standard),border-color var(--duration-base) var(--ease-standard),color var(--duration-base) var(--ease-standard)}:host .node.done{background:var(--accent-subtitle);border-color:var(--accent);color:var(--_stepper-node-done-text-color)}:host .node.active{background:var(--_stepper-node-active-bg-color);border-color:var(--accent);color:var(--_stepper-node-active-text-color)}:host .node.error{background:var(--error-subtitle);border-color:var(--error);color:var(--error)}:host button.node{padding:0;appearance:none;cursor:pointer}:host button.node: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)}:host .connector{position:absolute;z-index:0;top:calc((var(--stepper-node-size) - var(--stepper-bar-h)) / 2);left:50%;width:100%;height:var(--stepper-bar-h);background:var(--_stepper-connector-color);transition:background-color var(--duration-base) var(--ease-standard)}:host .connector.done{background:var(--_stepper-connector-done-color)}:host .step-label{max-width:14ch;margin-top:var(--space-2);font-size:var(--_stepper-label-font-size);font-weight:var(--font-weight-medium);line-height:var(--line-height-snug);color:var(--_stepper-label-color);overflow-wrap:anywhere;transition:color var(--duration-base) var(--ease-standard)}:host .step.is-current .step-label{font-weight:var(--font-weight-bold);color:var(--_stepper-label-color-current)}:host(.labels-inline){display:inline-flex;align-items:center;gap:var(--space-2)}:host(.labels-inline) .step{flex:0 0 auto;flex-direction:row;gap:var(--space-2)}:host(.labels-inline) .step-label{max-width:none;margin-top:0;white-space:nowrap}:host(.labels-inline) .connector{position:static;flex:0 0 auto;width:var(--stepper-bar-w)}:host(.is-vertical){flex-direction:column;align-items:stretch}:host(.is-vertical) .step{flex:0 0 auto;flex-direction:row;align-items:flex-start;text-align:left;gap:var(--space-3);padding-bottom:var(--space-4)}:host(.is-vertical) .step:last-child{padding-bottom:0}:host(.is-vertical) .step-label{max-width:none;margin-top:0;align-self:center}:host(.is-vertical) .connector{position:absolute;top:var(--stepper-node-size);left:calc((var(--stepper-node-size) - var(--stepper-bar-h)) / 2);width:var(--stepper-bar-h);height:calc(100% - var(--stepper-node-size))}\n"] }]
|
|
69
69
|
}], propDecorators: { steps: [{ type: i0.Input, args: [{ isSignal: true, alias: "steps", required: false }] }], current: [{ type: i0.Input, args: [{ isSignal: true, alias: "current", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], errorSteps: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorSteps", required: false }] }], stepClicked: [{ type: i0.Output, args: ["stepClicked"] }] } });
|
|
70
70
|
|
|
71
71
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-stepper.mjs","sources":["../../../src/lib/components/stepper/stepper.component.ts","../../../src/lib/components/stepper/stepper.component.html","../../../src/lib/components/stepper/ids-group-ltd-ids-design-system-components-stepper.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { DS_INTL } from '@ids-group-ltd/ids-design-system/core';\n\n/** Where the step caption sits: beneath its node (`bottom`) or beside it (`inline`, compact row). */\nexport type StepperLabelPosition = 'bottom' | 'inline';\n\nexport type StepperOrientation = 'horizontal' | 'vertical';\n\n@Component({\n selector: 'ds-stepper',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './stepper.component.html',\n styleUrl: './stepper.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n role: 'list',\n '[attr.aria-label]': 'intl().stepper.label',\n '[class.labels-inline]': \"labelPosition() === 'inline'\",\n '[class.is-vertical]': \"orientation() === 'vertical'\",\n },\n})\nexport class StepperComponent {\n protected readonly intl = inject(DS_INTL);\n\n /** Step labels in order; one node per entry. */\n readonly steps = input<readonly string[]>([]);\n /** Zero-based index of the active step; earlier steps render as completed. */\n readonly current = input<number>(0);\n /** Where the step caption sits relative to its node. */\n readonly labelPosition = input<StepperLabelPosition>('bottom');\n /** Layout axis of the stepper. */\n readonly orientation = input<StepperOrientation>('horizontal');\n /** Renders each step node as a button that emits its index. */\n readonly clickable = input(false, { transform: booleanAttribute });\n /** Zero-based indices of steps in an error state. Error wins over completed/current/upcoming. */\n readonly errorSteps = input<readonly number[]>([]);\n\n /** Fires with a step's index when activated; only when `clickable`. */\n readonly stepClicked = output<number>();\n\n protected stepState(\n index: number,\n ): 'error' | 'completed' | 'current' | 'upcoming' {\n if (this.errorSteps().includes(index)) {\n return 'error';\n }\n const currentStep = this.current();\n if (index < currentStep) {\n return 'completed';\n }\n if (index === currentStep) {\n return 'current';\n }\n\n return 'upcoming';\n }\n\n protected nodeClass(index: number): string {\n const state = this.stepState(index);\n if (state === 'error') {\n return 'node error';\n }\n if (state === 'completed') {\n return 'node done';\n }\n if (state === 'current') {\n return 'node active';\n }\n\n return 'node';\n }\n\n protected connectorClass(index: number): string {\n return index < this.current() && !this.errorSteps().includes(index)\n ? 'connector done'\n : 'connector';\n }\n\n protected onStepClick(index: number): void {\n if (this.clickable()) {\n this.stepClicked.emit(index);\n }\n }\n}\n","@for (label of steps(); track $index; let i = $index, last = $last) {\n <span\n role=\"listitem\"\n class=\"step\"\n [class.is-current]=\"i === current()\"\n [attr.aria-current]=\"i === current() ? 'step' : null\">\n @if (clickable()) {\n <button\n type=\"button\"\n
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-stepper.mjs","sources":["../../../src/lib/components/stepper/stepper.component.ts","../../../src/lib/components/stepper/stepper.component.html","../../../src/lib/components/stepper/ids-group-ltd-ids-design-system-components-stepper.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { DS_INTL } from '@ids-group-ltd/ids-design-system/core';\n\n/** Where the step caption sits: beneath its node (`bottom`) or beside it (`inline`, compact row). */\nexport type StepperLabelPosition = 'bottom' | 'inline';\n\nexport type StepperOrientation = 'horizontal' | 'vertical';\n\n@Component({\n selector: 'ds-stepper',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './stepper.component.html',\n styleUrl: './stepper.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n role: 'list',\n '[attr.aria-label]': 'intl().stepper.label',\n '[class.labels-inline]': \"labelPosition() === 'inline'\",\n '[class.is-vertical]': \"orientation() === 'vertical'\",\n },\n})\nexport class StepperComponent {\n protected readonly intl = inject(DS_INTL);\n\n /** Step labels in order; one node per entry. */\n readonly steps = input<readonly string[]>([]);\n /** Zero-based index of the active step; earlier steps render as completed. */\n readonly current = input<number>(0);\n /** Where the step caption sits relative to its node. */\n readonly labelPosition = input<StepperLabelPosition>('bottom');\n /** Layout axis of the stepper. */\n readonly orientation = input<StepperOrientation>('horizontal');\n /** Renders each step node as a button that emits its index. */\n readonly clickable = input(false, { transform: booleanAttribute });\n /** Zero-based indices of steps in an error state. Error wins over completed/current/upcoming. */\n readonly errorSteps = input<readonly number[]>([]);\n\n /** Fires with a step's index when activated; only when `clickable`. */\n readonly stepClicked = output<number>();\n\n protected stepState(\n index: number,\n ): 'error' | 'completed' | 'current' | 'upcoming' {\n if (this.errorSteps().includes(index)) {\n return 'error';\n }\n const currentStep = this.current();\n if (index < currentStep) {\n return 'completed';\n }\n if (index === currentStep) {\n return 'current';\n }\n\n return 'upcoming';\n }\n\n protected nodeClass(index: number): string {\n const state = this.stepState(index);\n if (state === 'error') {\n return 'node error';\n }\n if (state === 'completed') {\n return 'node done';\n }\n if (state === 'current') {\n return 'node active';\n }\n\n return 'node';\n }\n\n protected connectorClass(index: number): string {\n return index < this.current() && !this.errorSteps().includes(index)\n ? 'connector done'\n : 'connector';\n }\n\n protected onStepClick(index: number): void {\n if (this.clickable()) {\n this.stepClicked.emit(index);\n }\n }\n}\n","@for (label of steps(); track $index; let i = $index, last = $last) {\n <span\n role=\"listitem\"\n class=\"step\"\n [class.is-current]=\"i === current()\"\n [attr.aria-current]=\"i === current() ? 'step' : null\">\n @if (clickable()) {\n <button\n type=\"button\"\n [class]=\"nodeClass(i)\"\n [attr.aria-label]=\"intl().stepper.step(i + 1, label, stepState(i))\"\n (click)=\"onStepClick(i)\">\n @if (stepState(i) === 'completed') {\n <ds-icon\n name=\"check\"\n [size]=\"14\" />\n } @else if (stepState(i) === 'error') {\n <ds-icon\n name=\"error\"\n [size]=\"14\" />\n } @else {\n {{ i + 1 }}\n }\n </button>\n } @else {\n <span\n aria-hidden=\"true\"\n [class]=\"nodeClass(i)\">\n @if (stepState(i) === 'completed') {\n <ds-icon\n name=\"check\"\n [size]=\"14\" />\n } @else if (stepState(i) === 'error') {\n <ds-icon\n name=\"error\"\n [size]=\"14\" />\n } @else {\n {{ i + 1 }}\n }\n </span>\n }\n\n <span\n aria-hidden=\"true\"\n class=\"step-label\">\n {{ label }}\n </span>\n\n @if (!last) {\n <span\n aria-hidden=\"true\"\n [class]=\"connectorClass(i)\">\n </span>\n }\n\n @if (!clickable()) {\n <span class=\"visually-hidden\">\n {{ intl().stepper.step(i + 1, label, stepState(i)) }}\n </span>\n }\n </span>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MA8Ba,gBAAgB,CAAA;AACR,IAAA,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;;AAGhC,IAAA,KAAK,GAAG,KAAK,CAAoB,EAAE,4EAAC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A,EAAA,aAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,MAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,sBAAA,EAAA,qBAAA,EAAA,8BAAA,EAAA,mBAAA,EAAA,8BAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC9B7B,6iDA8DA,EAAA,MAAA,EAAA,CAAA,8zHAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,ED3CY,aAAa,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAWZ,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAd5B,SAAS;+BACE,YAAY,EAAA,UAAA,EACV,IAAI,EAAA,OAAA,EACP,CAAC,aAAa,CAAC,EAAA,aAAA,EAGT,iBAAiB,CAAC,QAAQ,EAAA,IAAA,EACnC;AACJ,wBAAA,IAAI,EAAE,MAAM;AACZ,wBAAA,mBAAmB,EAAE,sBAAsB;AAC3C,wBAAA,uBAAuB,EAAE,8BAA8B;AACvD,wBAAA,qBAAqB,EAAE,8BAA8B;AACtD,qBAAA,EAAA,QAAA,EAAA,6iDAAA,EAAA,MAAA,EAAA,CAAA,8zHAAA,CAAA,EAAA;;;AE5BH;;AAEG;;;;"}
|
|
@@ -72,7 +72,7 @@ class SwitchComponent extends DsBooleanControlValueAccessor {
|
|
|
72
72
|
useExisting: forwardRef(() => SwitchComponent),
|
|
73
73
|
multi: true,
|
|
74
74
|
},
|
|
75
|
-
], usesInheritance: true, ngImport: i0, template: "<div [class]=\"fieldClass()\">\n <span\n class=\"control-line\"\n [class.is-disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n [class]=\"switchClasses()\"\n [checked]=\"checked()\"\n [attr.aria-checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n (click)=\"onClick($event)\"\n (change)=\"onCheckedChange($event)\"\n (blur)=\"markTouched()\" />\n\n <label\n class=\"control-text\"\n [attr.for]=\"controlId()\">\n @if (label()) {\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n }\n } @else {\n <ng-content></ng-content>\n }\n </label>\n </span>\n\n <ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n</div>\n", styles: [":
|
|
75
|
+
], usesInheritance: true, ngImport: i0, template: "<div [class]=\"fieldClass()\">\n <span\n class=\"control-line\"\n [class.is-disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n [class]=\"switchClasses()\"\n [checked]=\"checked()\"\n [attr.aria-checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n (click)=\"onClick($event)\"\n (change)=\"onCheckedChange($event)\"\n (blur)=\"markTouched()\" />\n\n <label\n class=\"control-text\"\n [attr.for]=\"controlId()\">\n @if (label()) {\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n }\n } @else {\n <ng-content></ng-content>\n }\n </label>\n </span>\n\n <ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n</div>\n", styles: [":host{--_switch-track-w: var(--switch-track-w);--_switch-track-h: var(--switch-track-h);--_switch-thumb-size: var(--switch-thumb-size);--_switch-thumb-pad: var(--switch-thumb-pad);--_switch-label-fs: var(--font-size-s);--_switch-track-on-bg-color: var(--ds-switch-track-on-bg-color, var(--accent));--_switch-track-off-bg-color: var(--ds-switch-track-off-bg-color, var(--border-strong));--_switch-thumb-bg-color: var(--ds-switch-thumb-bg-color, var(--surface-default));display:inline-flex}.switch-field{display:inline-flex;flex-direction:column;align-items:flex-start;gap:var(--field-label-gap)}.switch-field.size-sm{--_switch-track-w: 26px;--_switch-track-h: 14px;--_switch-thumb-size: 10px;--_switch-thumb-pad: var(--switch-thumb-pad);--_switch-label-fs: var(--font-size-xs)}.switch-field.size-lg{--_switch-track-w: 48px;--_switch-track-h: 26px;--_switch-thumb-size: 22px;--_switch-thumb-pad: var(--switch-thumb-pad);--_switch-label-fs: var(--font-size-m)}.control-line:has(: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)}@media not (forced-colors:active){.control-line .switch:where(:focus-visible){outline:none}}.control-line{border-radius:var(--focus-ring-radius)}.control-line:has(.control-text:empty){--focus-ring-offset: var(--space-1-5)}.control-line{display:inline-flex;align-items:center}.control-line .control-text{padding-inline-start:var(--space-2);padding-block:var(--space-1);margin-block:calc(var(--space-1) * -1);font:var(--font-weight-regular) var(--ds-switch-label-font-size, var(--_switch-label-fs))/var(--line-height-base) var(--font-sans);color:var(--ds-switch-label-color, var(--text-primary));cursor:pointer;-webkit-user-select:none;user-select:none}.control-line .control-text:empty{display:none}.control-line .control-text .req{color:var(--error);font-weight:var(--font-weight-semibold);margin-inline-start:var(--space-1)}.control-line.is-disabled .control-text{color:var(--text-disabled);cursor:not-allowed}.switch{appearance:none;width:var(--_switch-track-w);height:var(--_switch-track-h);background:var(--_switch-track-off-bg-color);border-radius:var(--radius-pill);position:relative;cursor:pointer;flex-shrink:0;margin:0;transition:background-color var(--duration-base) var(--ease-standard)}.switch:after{content:\"\";position:absolute;top:var(--_switch-thumb-pad);left:var(--_switch-thumb-pad);width:var(--_switch-thumb-size);height:var(--_switch-thumb-size);background:var(--_switch-thumb-bg-color);border-radius:var(--radius-pill);box-shadow:var(--shadow-1);transition:transform var(--duration-base) var(--ease-standard),box-shadow var(--duration-base) var(--ease-standard)}.switch:checked{background:var(--_switch-track-on-bg-color)}.switch:checked:after{transform:translate(calc(var(--_switch-track-w) - var(--_switch-thumb-size) - 2 * var(--_switch-thumb-pad)))}.switch:active:not(:disabled,[disabled],.is-disabled,.disabled,[aria-disabled=true]){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.switch:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.switch.success:checked{background:var(--success)}.switch.error:checked{background:var(--error)}\n"], dependencies: [{ kind: "component", type: FieldMessageComponent, selector: "ds-field-message", inputs: ["text", "state", "messageId", "icon", "reserve"] }] });
|
|
76
76
|
}
|
|
77
77
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
78
78
|
type: Component,
|
|
@@ -82,7 +82,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
82
82
|
useExisting: forwardRef(() => SwitchComponent),
|
|
83
83
|
multi: true,
|
|
84
84
|
},
|
|
85
|
-
], template: "<div [class]=\"fieldClass()\">\n <span\n class=\"control-line\"\n [class.is-disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n [class]=\"switchClasses()\"\n [checked]=\"checked()\"\n [attr.aria-checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n (click)=\"onClick($event)\"\n (change)=\"onCheckedChange($event)\"\n (blur)=\"markTouched()\" />\n\n <label\n class=\"control-text\"\n [attr.for]=\"controlId()\">\n @if (label()) {\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n }\n } @else {\n <ng-content></ng-content>\n }\n </label>\n </span>\n\n <ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n</div>\n", styles: [":
|
|
85
|
+
], template: "<div [class]=\"fieldClass()\">\n <span\n class=\"control-line\"\n [class.is-disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n [class]=\"switchClasses()\"\n [checked]=\"checked()\"\n [attr.aria-checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n (click)=\"onClick($event)\"\n (change)=\"onCheckedChange($event)\"\n (blur)=\"markTouched()\" />\n\n <label\n class=\"control-text\"\n [attr.for]=\"controlId()\">\n @if (label()) {\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n }\n } @else {\n <ng-content></ng-content>\n }\n </label>\n </span>\n\n <ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n</div>\n", styles: [":host{--_switch-track-w: var(--switch-track-w);--_switch-track-h: var(--switch-track-h);--_switch-thumb-size: var(--switch-thumb-size);--_switch-thumb-pad: var(--switch-thumb-pad);--_switch-label-fs: var(--font-size-s);--_switch-track-on-bg-color: var(--ds-switch-track-on-bg-color, var(--accent));--_switch-track-off-bg-color: var(--ds-switch-track-off-bg-color, var(--border-strong));--_switch-thumb-bg-color: var(--ds-switch-thumb-bg-color, var(--surface-default));display:inline-flex}.switch-field{display:inline-flex;flex-direction:column;align-items:flex-start;gap:var(--field-label-gap)}.switch-field.size-sm{--_switch-track-w: 26px;--_switch-track-h: 14px;--_switch-thumb-size: 10px;--_switch-thumb-pad: var(--switch-thumb-pad);--_switch-label-fs: var(--font-size-xs)}.switch-field.size-lg{--_switch-track-w: 48px;--_switch-track-h: 26px;--_switch-thumb-size: 22px;--_switch-thumb-pad: var(--switch-thumb-pad);--_switch-label-fs: var(--font-size-m)}.control-line:has(: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)}@media not (forced-colors:active){.control-line .switch:where(:focus-visible){outline:none}}.control-line{border-radius:var(--focus-ring-radius)}.control-line:has(.control-text:empty){--focus-ring-offset: var(--space-1-5)}.control-line{display:inline-flex;align-items:center}.control-line .control-text{padding-inline-start:var(--space-2);padding-block:var(--space-1);margin-block:calc(var(--space-1) * -1);font:var(--font-weight-regular) var(--ds-switch-label-font-size, var(--_switch-label-fs))/var(--line-height-base) var(--font-sans);color:var(--ds-switch-label-color, var(--text-primary));cursor:pointer;-webkit-user-select:none;user-select:none}.control-line .control-text:empty{display:none}.control-line .control-text .req{color:var(--error);font-weight:var(--font-weight-semibold);margin-inline-start:var(--space-1)}.control-line.is-disabled .control-text{color:var(--text-disabled);cursor:not-allowed}.switch{appearance:none;width:var(--_switch-track-w);height:var(--_switch-track-h);background:var(--_switch-track-off-bg-color);border-radius:var(--radius-pill);position:relative;cursor:pointer;flex-shrink:0;margin:0;transition:background-color var(--duration-base) var(--ease-standard)}.switch:after{content:\"\";position:absolute;top:var(--_switch-thumb-pad);left:var(--_switch-thumb-pad);width:var(--_switch-thumb-size);height:var(--_switch-thumb-size);background:var(--_switch-thumb-bg-color);border-radius:var(--radius-pill);box-shadow:var(--shadow-1);transition:transform var(--duration-base) var(--ease-standard),box-shadow var(--duration-base) var(--ease-standard)}.switch:checked{background:var(--_switch-track-on-bg-color)}.switch:checked:after{transform:translate(calc(var(--_switch-track-w) - var(--_switch-thumb-size) - 2 * var(--_switch-thumb-pad)))}.switch:active:not(:disabled,[disabled],.is-disabled,.disabled,[aria-disabled=true]){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.switch:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.switch.success:checked{background:var(--success)}.switch.error:checked{background:var(--error)}\n"] }]
|
|
86
86
|
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], controlled: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlled", required: false }] }], checkedRequested: [{ type: i0.Output, args: ["checkedRequested"] }] } });
|
|
87
87
|
|
|
88
88
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-switch.mjs","sources":["../../../src/lib/components/switch/switch.component.ts","../../../src/lib/components/switch/switch.component.html","../../../src/lib/components/switch/ids-group-ltd-ids-design-system-components-switch.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n model,\n output,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { DsBooleanControlValueAccessor } from '@ids-group-ltd/ids-design-system/components';\nimport { FieldMessageComponent } from '@ids-group-ltd/ids-design-system/components/field-message';\nimport { resolveFieldMessage } from '@ids-group-ltd/ids-design-system/components';\nimport { nextControlId } from '@ids-group-ltd/ids-design-system/components';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\nimport { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';\n\n@Component({\n selector: 'ds-switch',\n standalone: true,\n imports: [FieldMessageComponent],\n templateUrl: './switch.component.html',\n styleUrl: './switch.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SwitchComponent),\n multi: true,\n },\n ],\n})\nexport class SwitchComponent extends DsBooleanControlValueAccessor {\n /** On/off state, two-way bound. */\n readonly checked = model<boolean>(false);\n /** Disables the switch and blocks all interaction. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Native `name` attribute. */\n readonly name = input<string | null>(null);\n /** Track colour when checked. */\n readonly variant = input<'default' | 'success' | 'error'>('default');\n /** Overrides the generated id of the native `<input>` and its `<label for>`. */\n readonly inputId = input<string | null>(null);\n /** Unset falls back to `DS_CONFIG.control.size`, then `'md'`. */\n readonly size = input<DsSize | null>(null);\n readonly sizeResolved = resolveWithConfig(\n this.size,\n (config) => config.control?.size,\n 'md' as DsSize,\n );\n /** Shows an asterisk and sets `aria-required`. */\n readonly required = input(false, { transform: booleanAttribute });\n /** Label beside the track, wired via for/id. Omit to bring your own <label>. */\n readonly label = input<string>('');\n /** Accessible name for a control with no visible label; overrides `label` when both are set. */\n readonly ariaLabel = input<string | null>(null);\n /**\n * The switch never flips itself: a click or Space cancels the native toggle and\n * `checkedRequested` carries the value the user asked for. It moves only when\n * `checked` changes from outside, so a cancelled confirmation changes nothing.\n */\n readonly controlled = input(false, { transform: booleanAttribute });\n /** The value the user asked for, emitted in place of a flip when `controlled`. Silent otherwise. */\n readonly checkedRequested = output<boolean>();\n\n protected readonly isDisabled = computed(\n () => this.disabled() || this.formDisabled(),\n );\n\n protected readonly uid = nextControlId('ds-switch');\n protected readonly controlId = computed(() => this.inputId() ?? this.uid);\n protected readonly hintId = computed(() =>\n this.message().text ? `${this.uid}-hint` : null,\n );\n private readonly fieldMessage = resolveFieldMessage({\n disabled: () => this.isDisabled(),\n hint: this.hint,\n warning: this.warning,\n error: this.error,\n errors: this.errors,\n invalid: this.invalid,\n touchedSelf: this.touchedSelf,\n touched: this.touched,\n });\n protected readonly message = this.fieldMessage.message;\n protected readonly resolvedAriaLabel = computed(() =>\n this.label() ? null : this.ariaLabel() || null,\n );\n protected readonly invalidResolved = this.fieldMessage.invalid;\n\n protected readonly switchClasses = computed(() => {\n const variant = this.variant();\n\n return variant === 'default' ? 'switch' : `switch ${variant}`;\n });\n\n protected readonly fieldClass = computed(\n () => `switch-field size-${this.sizeResolved()}`,\n );\n\n protected onCheckedChange(event: Event): void {\n this.checked.set((event.target as HTMLInputElement).checked);\n }\n\n protected onClick(event: MouseEvent): void {\n if (!this.controlled()) {\n return;\n }\n event.preventDefault();\n this.checkedRequested.emit(!this.checked());\n }\n}\n","<div [class]=\"fieldClass()\">\n <span\n class=\"control-line\"\n [class.is-disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n [class]=\"switchClasses()\"\n [checked]=\"checked()\"\n [attr.aria-checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n (click)=\"onClick($event)\"\n (change)=\"onCheckedChange($event)\"\n (blur)=\"markTouched()\" />\n\n <label\n class=\"control-text\"\n [attr.for]=\"controlId()\">\n @if (label()) {\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n }\n } @else {\n <ng-content></ng-content>\n }\n </label>\n </span>\n\n <ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAiCM,MAAO,eAAgB,SAAQ,6BAA6B,CAAA;;AAEvD,IAAA,OAAO,GAAG,KAAK,CAAU,KAAK,8EAAC;;IAE/B,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAExD,IAAA,IAAI,GAAG,KAAK,CAAgB,IAAI,2EAAC;;AAEjC,IAAA,OAAO,GAAG,KAAK,CAAkC,SAAS,8EAAC;;AAE3D,IAAA,OAAO,GAAG,KAAK,CAAgB,IAAI,8EAAC;;AAEpC,IAAA,IAAI,GAAG,KAAK,CAAgB,IAAI,2EAAC;IACjC,YAAY,GAAG,iBAAiB,CACvC,IAAI,CAAC,IAAI,EACT,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO,EAAE,IAAI,EAChC,IAAc,CACf;;IAEQ,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAExD,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;;AAEzB,IAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;AAC/C;;;;AAIG;IACM,UAAU,GAAG,KAAK,CAAC,KAAK,kFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAE1D,gBAAgB,GAAG,MAAM,EAAW;AAE1B,IAAA,UAAU,GAAG,QAAQ,CACtC,M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,gBAAA,WAAW,EAAE,UAAU,CAAC,MAAM,eAAe,CAAC;AAC9C,gBAAA,KAAK,EAAE,IAAI;AACZ,aAAA;SACF,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC/BH,2vCA8CA,inIDzBY,qBAAqB,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,WAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAYpB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAf3B,SAAS;+BACE,WAAW,EAAA,UAAA,EACT,IAAI,EAAA,OAAA,EACP,CAAC,qBAAqB,CAAC,EAAA,aAAA,EAGjB,iBAAiB,CAAC,QAAQ,EAAA,SAAA,EAC9B;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC;AAC9C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,2vCAAA,EAAA,MAAA,EAAA,CAAA,yjIAAA,CAAA,EAAA;;;AE/BH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-switch.mjs","sources":["../../../src/lib/components/switch/switch.component.ts","../../../src/lib/components/switch/switch.component.html","../../../src/lib/components/switch/ids-group-ltd-ids-design-system-components-switch.ts"],"sourcesContent":["import {\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n model,\n output,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { DsBooleanControlValueAccessor } from '@ids-group-ltd/ids-design-system/components';\nimport { FieldMessageComponent } from '@ids-group-ltd/ids-design-system/components/field-message';\nimport { resolveFieldMessage } from '@ids-group-ltd/ids-design-system/components';\nimport { nextControlId } from '@ids-group-ltd/ids-design-system/components';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\nimport { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';\n\n@Component({\n selector: 'ds-switch',\n standalone: true,\n imports: [FieldMessageComponent],\n templateUrl: './switch.component.html',\n styleUrl: './switch.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SwitchComponent),\n multi: true,\n },\n ],\n})\nexport class SwitchComponent extends DsBooleanControlValueAccessor {\n /** On/off state, two-way bound. */\n readonly checked = model<boolean>(false);\n /** Disables the switch and blocks all interaction. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Native `name` attribute. */\n readonly name = input<string | null>(null);\n /** Track colour when checked. */\n readonly variant = input<'default' | 'success' | 'error'>('default');\n /** Overrides the generated id of the native `<input>` and its `<label for>`. */\n readonly inputId = input<string | null>(null);\n /** Unset falls back to `DS_CONFIG.control.size`, then `'md'`. */\n readonly size = input<DsSize | null>(null);\n readonly sizeResolved = resolveWithConfig(\n this.size,\n (config) => config.control?.size,\n 'md' as DsSize,\n );\n /** Shows an asterisk and sets `aria-required`. */\n readonly required = input(false, { transform: booleanAttribute });\n /** Label beside the track, wired via for/id. Omit to bring your own <label>. */\n readonly label = input<string>('');\n /** Accessible name for a control with no visible label; overrides `label` when both are set. */\n readonly ariaLabel = input<string | null>(null);\n /**\n * The switch never flips itself: a click or Space cancels the native toggle and\n * `checkedRequested` carries the value the user asked for. It moves only when\n * `checked` changes from outside, so a cancelled confirmation changes nothing.\n */\n readonly controlled = input(false, { transform: booleanAttribute });\n /** The value the user asked for, emitted in place of a flip when `controlled`. Silent otherwise. */\n readonly checkedRequested = output<boolean>();\n\n protected readonly isDisabled = computed(\n () => this.disabled() || this.formDisabled(),\n );\n\n protected readonly uid = nextControlId('ds-switch');\n protected readonly controlId = computed(() => this.inputId() ?? this.uid);\n protected readonly hintId = computed(() =>\n this.message().text ? `${this.uid}-hint` : null,\n );\n private readonly fieldMessage = resolveFieldMessage({\n disabled: () => this.isDisabled(),\n hint: this.hint,\n warning: this.warning,\n error: this.error,\n errors: this.errors,\n invalid: this.invalid,\n touchedSelf: this.touchedSelf,\n touched: this.touched,\n });\n protected readonly message = this.fieldMessage.message;\n protected readonly resolvedAriaLabel = computed(() =>\n this.label() ? null : this.ariaLabel() || null,\n );\n protected readonly invalidResolved = this.fieldMessage.invalid;\n\n protected readonly switchClasses = computed(() => {\n const variant = this.variant();\n\n return variant === 'default' ? 'switch' : `switch ${variant}`;\n });\n\n protected readonly fieldClass = computed(\n () => `switch-field size-${this.sizeResolved()}`,\n );\n\n protected onCheckedChange(event: Event): void {\n this.checked.set((event.target as HTMLInputElement).checked);\n }\n\n protected onClick(event: MouseEvent): void {\n if (!this.controlled()) {\n return;\n }\n event.preventDefault();\n this.checkedRequested.emit(!this.checked());\n }\n}\n","<div [class]=\"fieldClass()\">\n <span\n class=\"control-line\"\n [class.is-disabled]=\"isDisabled()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n [class]=\"switchClasses()\"\n [checked]=\"checked()\"\n [attr.aria-checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.id]=\"controlId()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-invalid]=\"invalidResolved() ? 'true' : null\"\n [attr.aria-describedby]=\"hintId()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n (click)=\"onClick($event)\"\n (change)=\"onCheckedChange($event)\"\n (blur)=\"markTouched()\" />\n\n <label\n class=\"control-text\"\n [attr.for]=\"controlId()\">\n @if (label()) {\n {{ label() }}\n @if (required()) {\n <span\n class=\"req\"\n aria-hidden=\"true\">\n *\n </span>\n }\n } @else {\n <ng-content></ng-content>\n }\n </label>\n </span>\n\n <ds-field-message\n [icon]=\"messageIcon()\"\n [text]=\"message().text\"\n [state]=\"message().state\"\n [messageId]=\"hintId()\"\n [reserve]=\"reserveMessageResolved()\" />\n</div>\n","/**\n * Generated b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