@ids-group-ltd/ids-design-system 0.13.4 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +258 -0
- package/components.md +24 -14
- package/docs/agent/INDEX.md +1 -1
- package/docs/agent/charts/column-series-component.md +1 -1
- package/docs/agent/charts/ds-chart.md +3 -1
- package/docs/agent/charts/ds-line-chart.md +1 -1
- package/docs/agent/charts/line-series-component.md +1 -1
- package/docs/agent/forms/ds-search.md +1 -1
- package/docs/agent/forms/ds-switch.md +4 -2
- package/docs/agent/forms/ds-textarea.md +1 -0
- package/docs/agent/navigation/ds-pagination.md +2 -2
- package/docs/agent/platform/ds-config.md +2 -1
- package/docs/agent/tables/ds-cell-template.md +1 -1
- package/docs/agent/tables/ds-table.md +4 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +26 -19
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs +13 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +27 -14
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +366 -81
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +8 -17
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +6 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +42 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +17 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +8 -17
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +27 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +4 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +23 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +20 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +30 -22
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +21 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +91 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +2 -3
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.12.2.json +4 -1
- package/migrations/0.13.3.json +32 -10
- package/migrations/0.13.4.json +1630 -132
- package/migrations/0.14.0.json +591 -0
- package/migrations/0.5.0.json +10 -4
- package/migrations/0.7.0.json +5 -2
- package/migrations/0.9.0.json +5 -2
- package/migrations/README.md +7 -2
- package/package.json +1 -1
- package/styles/_chart-frame.scss +4 -4
- package/styles/_chart-motion.scss +17 -10
- package/styles/_overlay-motion.scss +14 -6
- package/styles/_skeleton-shimmer.scss +4 -1
- package/styles/_tokens.scss +1 -1
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +3 -5
- package/types/ids-group-ltd-ids-design-system-components-chart-data-table.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +11 -3
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +125 -26
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +3 -5
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +4 -1
- package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +4 -0
- package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +15 -10
- package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +1 -4
- package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +7 -1
- package/types/ids-group-ltd-ids-design-system-components-search.d.ts +2 -0
- package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +1 -0
- package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +10 -1
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +35 -24
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +13 -0
- package/types/ids-group-ltd-ids-design-system-components.d.ts +46 -3
- package/types/ids-group-ltd-ids-design-system-core.d.ts +13 -4
- package/types/ids-group-ltd-ids-design-system.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { model, input, booleanAttribute, computed, forwardRef, ViewEncapsulation, Component } from '@angular/core';
|
|
2
|
+
import { model, input, booleanAttribute, output, computed, forwardRef, ViewEncapsulation, Component } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
4
|
import { DsBooleanControlValueAccessor, nextControlId, resolveFieldMessage } from '@ids-group-ltd/ids-design-system/components';
|
|
5
5
|
import { FieldMessageComponent } from '@ids-group-ltd/ids-design-system/components/field-message';
|
|
@@ -28,6 +28,14 @@ class SwitchComponent extends DsBooleanControlValueAccessor {
|
|
|
28
28
|
/** Accessible name for a control with no visible label — the row's `<label>` collapses when it
|
|
29
29
|
* is empty, leaving nothing to name it. Set beside a label it OVERRIDES the label, per ARIA. */
|
|
30
30
|
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
31
|
+
/**
|
|
32
|
+
* The switch never flips itself: a click or Space cancels the native toggle and
|
|
33
|
+
* `checkedRequested` carries the value the user asked for. It moves only when
|
|
34
|
+
* `checked` changes from outside, so a cancelled confirmation changes nothing.
|
|
35
|
+
*/
|
|
36
|
+
controlled = input(false, { ...(ngDevMode ? { debugName: "controlled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
37
|
+
/** The value the user asked for, emitted in place of a flip when `controlled`. Silent otherwise. */
|
|
38
|
+
checkedRequested = output();
|
|
31
39
|
isDisabled = computed(() => this.disabled() || this.formDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
32
40
|
uid = nextControlId('ds-switch');
|
|
33
41
|
controlId = computed(() => this.inputId() ?? this.uid, ...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
|
|
@@ -54,14 +62,21 @@ class SwitchComponent extends DsBooleanControlValueAccessor {
|
|
|
54
62
|
onCheckedChange(event) {
|
|
55
63
|
this.checked.set(event.target.checked);
|
|
56
64
|
}
|
|
65
|
+
onClick(event) {
|
|
66
|
+
if (!this.controlled()) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
this.checkedRequested.emit(!this.checked());
|
|
71
|
+
}
|
|
57
72
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SwitchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
58
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: SwitchComponent, isStandalone: true, selector: "ds-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, providers: [
|
|
73
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: SwitchComponent, isStandalone: true, selector: "ds-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, controlled: { classPropertyName: "controlled", publicName: "controlled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", checkedRequested: "checkedRequested" }, providers: [
|
|
59
74
|
{
|
|
60
75
|
provide: NG_VALUE_ACCESSOR,
|
|
61
76
|
useExisting: forwardRef(() => SwitchComponent),
|
|
62
77
|
multi: true,
|
|
63
78
|
},
|
|
64
|
-
], 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 (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: [":where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_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){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"] }] });
|
|
79
|
+
], 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: [":where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_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){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"] }] });
|
|
65
80
|
}
|
|
66
81
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
67
82
|
type: Component,
|
|
@@ -71,8 +86,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
71
86
|
useExisting: forwardRef(() => SwitchComponent),
|
|
72
87
|
multi: true,
|
|
73
88
|
},
|
|
74
|
-
], 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 (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: [":where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_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){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"] }]
|
|
75
|
-
}], 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 }] }] } });
|
|
89
|
+
], 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: [":where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}:host{--_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){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"] }]
|
|
90
|
+
}], 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"] }] } });
|
|
76
91
|
|
|
77
92
|
/**
|
|
78
93
|
* Generated bundle index. Do not edit.
|
|
@@ -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} 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 used by the native `<input>` and its `<label for>`. */\n readonly inputId = input<string | null>(null);\n /** Switch size — sm/md/lg.\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 /** Marks the field required — shows an asterisk and sets `aria-required`. */\n readonly required = input(false, { transform: booleanAttribute });\n /** Inline label rendered beside the track and wired via for/id. Omit to\n * bring your own <label>. */\n readonly label = input<string>('');\n /** Accessible name for a control with no visible label — the row's `<label>` collapses when it\n * is empty, leaving nothing to name it. Set beside a label it OVERRIDES the label, per ARIA. */\n readonly ariaLabel = input<string | null>(null);\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 /** Only name via aria-label when there is no visible `<label for>` to do it. */\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","<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 (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":";;;;;;;AAgCM,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;AAC7C;AACiE;AACxD,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;AACjE;AAC8B;AACrB,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AAClC;AACiG;AACxF,IAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;AAE5B,IAAA,UAAU,GAAG,QAAQ,CACtC,MAAM,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,YAAY,EAAE,iFAC7C;A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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,wtCAAA,EAAA,MAAA,EAAA,CAAA,yjIAAA,CAAA,EAAA;;;AE9BH;;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 used by the native `<input>` and its `<label for>`. */\n readonly inputId = input<string | null>(null);\n /** Switch size — sm/md/lg.\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 /** Marks the field required — shows an asterisk and sets `aria-required`. */\n readonly required = input(false, { transform: booleanAttribute });\n /** Inline label rendered beside the track and wired via for/id. Omit to\n * bring your own <label>. */\n readonly label = input<string>('');\n /** Accessible name for a control with no visible label — the row's `<label>` collapses when it\n * is empty, leaving nothing to name it. Set beside a label it OVERRIDES the label, per ARIA. */\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 /** Only name via aria-label when there is no visible `<label for>` to do it. */\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;;AAE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AAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,2vCAAA,EAAA,MAAA,EAAA,CAAA,yjIAAA,CAAA,EAAA;;;AE/BH;;AAEG;;;;"}
|
|
@@ -88,7 +88,7 @@ class TableColumnsPanelComponent {
|
|
|
88
88
|
[checked]="isVisible()(col)"
|
|
89
89
|
[disabled]="!col.hideable || isLocked()(col)"
|
|
90
90
|
(change)="toggled.emit(col)" />
|
|
91
|
-
{{ col.label }}
|
|
91
|
+
{{ col.label || col.screenReaderLabel }}
|
|
92
92
|
</label>
|
|
93
93
|
|
|
94
94
|
@if (rowExtras()) {
|
|
@@ -181,7 +181,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
181
181
|
[checked]="isVisible()(col)"
|
|
182
182
|
[disabled]="!col.hideable || isLocked()(col)"
|
|
183
183
|
(change)="toggled.emit(col)" />
|
|
184
|
-
{{ col.label }}
|
|
184
|
+
{{ col.label || col.screenReaderLabel }}
|
|
185
185
|
</label>
|
|
186
186
|
|
|
187
187
|
@if (rowExtras()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids-group-ltd-ids-design-system-components-table-columns.mjs","sources":["../../../src/lib/components/table-columns/table-columns-panel.component.ts","../../../src/lib/components/table-columns/table-columns-trigger.component.ts","../../../src/lib/components/table-columns/table-columns.directive.ts","../../../src/lib/components/table-columns/ids-group-ltd-ids-design-system-components-table-columns.ts"],"sourcesContent":["import {\n CdkDrag,\n CdkDragDrop,\n CdkDragHandle,\n CdkDropList,\n} from '@angular/cdk/drag-drop';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n TemplateRef,\n computed,\n input,\n model,\n output,\n viewChild,\n} from '@angular/core';\nimport { BottomSheetComponent } from '@ids-group-ltd/ids-design-system/components/bottom-sheet';\nimport { PopoverComponent } from '@ids-group-ltd/ids-design-system/components/popover';\nimport type { TableColumn } from '@ids-group-ltd/ids-design-system/components/table';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\n\n/**\n * The column panel: reorder, show and hide, and whatever else contributed a row control.\n *\n * It renders twice over one template — a popover on a fine pointer, a bottom sheet on a coarse\n * one — because a drag handle is unusable with a thumb. Which one is live is keyed on the POINTER\n * and not the viewport, matching the media query in the table's own stylesheet.\n *\n * `rowExtras` is how resize gets its width buttons in here without this component naming resize:\n * whoever owns width registers a template through the table's seam and it lands per row.\n *\n * @internal Not API — created by `DsTableColumns`, never written in a consumer's template.\n */\n@Component({\n selector: 'ds-table-columns-panel',\n standalone: true,\n styleUrl: './table-columns-panel.component.scss',\n imports: [\n BottomSheetComponent,\n CdkDrag,\n CdkDragHandle,\n CdkDropList,\n IconComponent,\n NgTemplateOutlet,\n PopoverComponent,\n ],\n template: `\n @if (coarsePointer()) {\n <ds-bottom-sheet title=\"Columns\" [(open)]=\"sheetOpen\">\n <ng-container [ngTemplateOutlet]=\"panel\" />\n </ds-bottom-sheet>\n } @else {\n <ds-popover\n #popover\n align=\"end\"\n panelRole=\"dialog\"\n panelLabel=\"Column visibility\">\n <ng-container [ngTemplateOutlet]=\"panel\" />\n </ds-popover>\n }\n\n <ng-template #panel>\n <div\n class=\"col-picker\"\n cdkDropList\n (cdkDropListDropped)=\"dropped.emit($event)\">\n @for (\n col of columns();\n track col.key;\n let first = $first;\n let last = $last\n ) {\n <div\n class=\"col-picker-row\"\n cdkDrag\n [cdkDragDisabled]=\"!reorderable()\">\n @if (reorderable()) {\n <span class=\"col-drag\" cdkDragHandle aria-hidden=\"true\">\n <ds-icon name=\"drag\" [size]=\"14\" />\n </span>\n }\n\n <label class=\"col-picker-option\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"isVisible()(col)\"\n [disabled]=\"!col.hideable || isLocked()(col)\"\n (change)=\"toggled.emit(col)\" />\n {{ col.label }}\n </label>\n\n @if (rowExtras()) {\n <ng-container\n [ngTemplateOutlet]=\"rowExtras()!\"\n [ngTemplateOutletContext]=\"{ $implicit: col }\" />\n }\n\n @if (reorderable()) {\n <span class=\"col-move\">\n <button\n type=\"button\"\n class=\"col-move-btn\"\n aria-label=\"Move up\"\n [disabled]=\"first\"\n (click)=\"moved.emit({ column: col, delta: -1 })\">\n <ds-icon name=\"chevronUp\" [size]=\"14\" />\n </button>\n\n <button\n type=\"button\"\n class=\"col-move-btn\"\n aria-label=\"Move down\"\n [disabled]=\"last\"\n (click)=\"moved.emit({ column: col, delta: 1 })\">\n <ds-icon name=\"chevronDown\" [size]=\"14\" />\n </button>\n </span>\n }\n </div>\n }\n\n <button type=\"button\" class=\"col-reset\" (click)=\"resetRequested.emit()\">\n Reset to default\n </button>\n </div>\n </ng-template>\n `,\n})\nexport class TableColumnsPanelComponent<T> {\n readonly columns = input.required<readonly TableColumn<T>[]>();\n readonly reorderable = input(false);\n readonly coarsePointer = input(false);\n readonly rowExtras = input<TemplateRef<{ $implicit: TableColumn<T> }> | null>(\n null,\n );\n // Passed as functions rather than precomputed flags: the panel renders one row per column and\n // would otherwise need a parallel array kept in step with `columns`.\n readonly isVisible = input.required<(column: TableColumn<T>) => boolean>();\n readonly isLocked = input.required<(column: TableColumn<T>) => boolean>();\n\n readonly sheetOpen = model(false);\n readonly toggled = output<TableColumn<T>>();\n readonly moved = output<{ column: TableColumn<T>; delta: -1 | 1 }>();\n readonly dropped = output<CdkDragDrop<unknown>>();\n readonly resetRequested = output<void>();\n\n private readonly popover = viewChild<PopoverComponent>('popover');\n\n readonly opened = computed(() =>\n this.coarsePointer()\n ? this.sheetOpen()\n : (this.popover()?.opened() ?? false),\n );\n\n toggle(trigger: HTMLElement): void {\n if (this.coarsePointer()) {\n this.sheetOpen.set(true);\n\n return;\n }\n this.popover()?.toggle(trigger);\n }\n}\n","import { Component, input, output } from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\n\n/**\n * The button in the table's utility header cell that opens the column panel.\n *\n * @internal Not API — created by `DsTableColumns` in the header-utility anchor.\n */\n@Component({\n selector: 'ds-table-columns-trigger',\n standalone: true,\n styleUrl: './table-columns-trigger.component.scss',\n imports: [IconComponent],\n template: `\n <button\n type=\"button\"\n class=\"col-picker-btn\"\n aria-haspopup=\"dialog\"\n aria-label=\"Choose columns\"\n [attr.aria-expanded]=\"opened()\"\n (click)=\"pressed.emit($event)\">\n <ds-icon name=\"grid\" [size]=\"14\" />\n </button>\n `,\n})\nexport class TableColumnsTriggerComponent {\n readonly opened = input(false);\n readonly pressed = output<Event>();\n}\n","import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';\nimport {\n type ComponentRef,\n DestroyRef,\n Directive,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport {\n DsTableLayout,\n type TableColumn,\n} from '@ids-group-ltd/ids-design-system/components/table';\nimport { TableColumnsPanelComponent } from './table-columns-panel.component';\nimport { TableColumnsTriggerComponent } from './table-columns-trigger.component';\n\n/**\n * Showing, hiding and reordering columns for `<ds-table>`, as a directive so a table that does\n * none of it never carries the panel — nor `@angular/cdk/drag-drop`, which comes with the drag\n * handle:\n *\n * ```html\n * <ds-table dsTableColumns [reorderableColumns]=\"true\" [columns]=\"cols\" [data]=\"rows\" />\n * ```\n *\n * Hiding needs no input: a column marked `hideable` becomes hideable the moment this directive is\n * present. `[(hiddenKeys)]` and `[(columnOrder)]` are two-way, so the layout can be driven from\n * the host, and both round-trip through `persistLayout` on the table.\n */\n@Directive({\n selector: '[dsTableColumns]',\n standalone: true,\n})\nexport class DsTableColumns<T extends object> {\n private readonly layout = inject<DsTableLayout<T>>(DsTableLayout);\n\n /** Adds the drag handle and the move buttons. Hiding works without it. */\n readonly reorderableColumns = input(false, { transform: booleanAttribute });\n\n /** Keys the reader has hidden. Unset falls back to the columns' own `hidden` flags. */\n readonly hiddenKeys = model<Set<string> | null>(null);\n\n /** Column keys in the reader's order. Unset keeps the declaration order. */\n readonly columnOrder = model<string[] | null>(null);\n\n private readonly coarsePointerState = signal(false);\n private readonly coarsePointer = this.coarsePointerState.asReadonly();\n\n private readonly effectiveHiddenKeys = computed<ReadonlySet<string>>(\n () => this.hiddenKeys() ?? new Set(this.hiddenByDeclaration()),\n );\n\n private readonly declaredColumns = computed<readonly TableColumn<T>[]>(() =>\n this.layout.view().declaredColumns(),\n );\n\n private hiddenByDeclaration(): readonly string[] {\n return this.declaredColumns()\n .filter((column) => column.hidden)\n .map((column) => column.key);\n }\n\n /** Declaration order with the reader's order applied first, then anything they never moved. */\n private readonly ordered = computed<readonly TableColumn<T>[]>(() => {\n const order = this.columnOrder();\n const columns = this.declaredColumns();\n if (!order) {\n return columns;\n }\n const byKey = new Map(columns.map((column) => [column.key, column]));\n const placed = new Set<string>();\n const out: TableColumn<T>[] = [];\n for (const key of order) {\n const column = byKey.get(key);\n if (column && !placed.has(key)) {\n out.push(column);\n placed.add(key);\n }\n }\n for (const column of columns) {\n if (!placed.has(column.key)) {\n out.push(column);\n }\n }\n\n return out;\n });\n\n private readonly visible = computed<readonly TableColumn<T>[]>(() =>\n this.ordered().filter(\n (column) => !this.effectiveHiddenKeys().has(column.key),\n ),\n );\n\n constructor() {\n this.layout.addColumnStage(() => this.visible());\n this.layout.requestUtilityColumn();\n this.layout.addPersistedSlice({\n key: 'order',\n read: () => this.columnOrder(),\n write: (value) => this.columnOrder.set(value as string[]),\n reset: () => this.columnOrder.set(null),\n });\n this.layout.addPersistedSlice({\n key: 'hidden',\n read: () => (this.hiddenKeys() ? [...this.hiddenKeys()!] : null),\n write: (value) => this.hiddenKeys.set(new Set(value as string[])),\n reset: () => this.hiddenKeys.set(null),\n });\n\n const trigger = this.layout.view().anchor('header-utility');\n const overlays = this.layout.view().anchor('overlays');\n let panel: ComponentRef<TableColumnsPanelComponent<T>> | null = null;\n let button: ComponentRef<TableColumnsTriggerComponent> | null = null;\n\n effect(() => {\n const host = overlays();\n if (!host || panel) {\n return;\n }\n panel = host.createComponent(TableColumnsPanelComponent<T>);\n panel.instance.toggled.subscribe((column) => this.toggleColumn(column));\n panel.instance.moved.subscribe(({ column, delta }) =>\n this.moveColumn(column, delta),\n );\n panel.instance.dropped.subscribe((event) => this.onDrop(event));\n panel.instance.resetRequested.subscribe(() =>\n this.layout.resetPersisted(),\n );\n });\n\n effect(() => {\n const host = trigger();\n if (!host || button) {\n return;\n }\n button = host.createComponent(TableColumnsTriggerComponent);\n button.instance.pressed.subscribe((event: Event) =>\n panel?.instance.toggle(event.currentTarget as HTMLElement),\n );\n });\n\n // Both are separate views, so the host's change detection does not reach them: every input\n // they read has to be written when it moves.\n effect(() => {\n panel?.setInput('columns', this.ordered());\n panel?.setInput('reorderable', this.reorderableColumns());\n panel?.setInput('coarsePointer', this.coarsePointer());\n panel?.setInput('rowExtras', this.layout.panelRowTemplate());\n panel?.setInput('isVisible', (column: TableColumn<T>) =>\n this.isVisible(column),\n );\n panel?.setInput('isLocked', (column: TableColumn<T>) =>\n this.isLocked(column),\n );\n button?.setInput('opened', panel?.instance.opened() ?? false);\n });\n\n if (typeof window !== 'undefined' && window.matchMedia) {\n const query = window.matchMedia('(hover: none) and (pointer: coarse)');\n const sync = (): void => this.coarsePointerState.set(query.matches);\n sync();\n query.addEventListener('change', sync);\n inject(DestroyRef).onDestroy(() =>\n query.removeEventListener('change', sync),\n );\n }\n\n inject(DestroyRef).onDestroy(() => {\n panel?.destroy();\n button?.destroy();\n });\n }\n\n private isVisible(column: TableColumn<T>): boolean {\n return !this.effectiveHiddenKeys().has(column.key);\n }\n\n /** The last visible column cannot be hidden — an all-hidden grid is useless. */\n private isLocked(column: TableColumn<T>): boolean {\n return this.isVisible(column) && this.visible().length === 1;\n }\n\n private toggleColumn(column: TableColumn<T>): void {\n if (!column.hideable || this.isLocked(column)) {\n return;\n }\n const next = new Set(this.effectiveHiddenKeys());\n if (next.has(column.key)) {\n next.delete(column.key);\n } else {\n next.add(column.key);\n }\n this.hiddenKeys.set(next);\n }\n\n private moveColumn(column: TableColumn<T>, delta: -1 | 1): void {\n const keys = this.ordered().map((each) => each.key);\n const from = keys.indexOf(column.key);\n const to = from + delta;\n if (from < 0 || to < 0 || to >= keys.length) {\n return;\n }\n moveItemInArray(keys, from, to);\n this.columnOrder.set(keys);\n }\n\n private onDrop(event: CdkDragDrop<unknown>): void {\n const keys = this.ordered().map((each) => each.key);\n moveItemInArray(keys, event.previousIndex, event.currentIndex);\n this.columnOrder.set(keys);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAqBA;;;;;;;;;;;AAWG;MAiGU,0BAA0B,CAAA;AAC5B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAA6B;AACrD,IAAA,WAAW,GAAG,KAAK,CAAC,KAAK,kFAAC;AAC1B,IAAA,aAAa,GAAG,KAAK,CAAC,KAAK,oFAAC;AAC5B,IAAA,SAAS,GAAG,KAAK,CACxB,IAAI,gFACL;;;AAGQ,IAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,+EAAuC;AACjE,IAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,8EAAuC;AAEhE,IAAA,SAAS,GAAG,KAAK,CAAC,KAAK,gFAAC;IACxB,OAAO,GAAG,MAAM,EAAkB;IAClC,KAAK,GAAG,MAAM,EAA6C;IAC3D,OAAO,GAAG,MAAM,EAAwB;IACxC,cAAc,GAAG,MAAM,EAAQ;AAEvB,IAAA,OAAO,GAAG,SAAS,CAAmB,SAAS,8EAAC;IAExD,MAAM,GAAG,QAAQ,CAAC,MACzB,IAAI,CAAC,aAAa;AAChB,UAAE,IAAI,CAAC,SAAS;AAChB,WAAG,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,KAAK,CAAC,6EACxC;AAED,IAAA,MAAM,CAAC,OAAoB,EAAA;AACzB,QAAA,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;AACxB,YAAA,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC;YAExB;QACF;QACA,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A,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,EAAA,kBAAA,EAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,UAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,WAAA,EAAA,mBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACpCD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ids-group-ltd-ids-design-system-components-table-columns.mjs","sources":["../../../src/lib/components/table-columns/table-columns-panel.component.ts","../../../src/lib/components/table-columns/table-columns-trigger.component.ts","../../../src/lib/components/table-columns/table-columns.directive.ts","../../../src/lib/components/table-columns/ids-group-ltd-ids-design-system-components-table-columns.ts"],"sourcesContent":["import {\n CdkDrag,\n CdkDragDrop,\n CdkDragHandle,\n CdkDropList,\n} from '@angular/cdk/drag-drop';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n TemplateRef,\n computed,\n input,\n model,\n output,\n viewChild,\n} from '@angular/core';\nimport { BottomSheetComponent } from '@ids-group-ltd/ids-design-system/components/bottom-sheet';\nimport { PopoverComponent } from '@ids-group-ltd/ids-design-system/components/popover';\nimport type { TableColumn } from '@ids-group-ltd/ids-design-system/components/table';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\n\n/**\n * The column panel: reorder, show and hide, and whatever else contributed a row control.\n *\n * It renders twice over one template — a popover on a fine pointer, a bottom sheet on a coarse\n * one — because a drag handle is unusable with a thumb. Which one is live is keyed on the POINTER\n * and not the viewport, matching the media query in the table's own stylesheet.\n *\n * `rowExtras` is how resize gets its width buttons in here without this component naming resize:\n * whoever owns width registers a template through the table's seam and it lands per row.\n *\n * @internal Not API — created by `DsTableColumns`, never written in a consumer's template.\n */\n@Component({\n selector: 'ds-table-columns-panel',\n standalone: true,\n styleUrl: './table-columns-panel.component.scss',\n imports: [\n BottomSheetComponent,\n CdkDrag,\n CdkDragHandle,\n CdkDropList,\n IconComponent,\n NgTemplateOutlet,\n PopoverComponent,\n ],\n template: `\n @if (coarsePointer()) {\n <ds-bottom-sheet title=\"Columns\" [(open)]=\"sheetOpen\">\n <ng-container [ngTemplateOutlet]=\"panel\" />\n </ds-bottom-sheet>\n } @else {\n <ds-popover\n #popover\n align=\"end\"\n panelRole=\"dialog\"\n panelLabel=\"Column visibility\">\n <ng-container [ngTemplateOutlet]=\"panel\" />\n </ds-popover>\n }\n\n <ng-template #panel>\n <div\n class=\"col-picker\"\n cdkDropList\n (cdkDropListDropped)=\"dropped.emit($event)\">\n @for (\n col of columns();\n track col.key;\n let first = $first;\n let last = $last\n ) {\n <div\n class=\"col-picker-row\"\n cdkDrag\n [cdkDragDisabled]=\"!reorderable()\">\n @if (reorderable()) {\n <span class=\"col-drag\" cdkDragHandle aria-hidden=\"true\">\n <ds-icon name=\"drag\" [size]=\"14\" />\n </span>\n }\n\n <label class=\"col-picker-option\">\n <input\n type=\"checkbox\"\n class=\"check\"\n [checked]=\"isVisible()(col)\"\n [disabled]=\"!col.hideable || isLocked()(col)\"\n (change)=\"toggled.emit(col)\" />\n {{ col.label || col.screenReaderLabel }}\n </label>\n\n @if (rowExtras()) {\n <ng-container\n [ngTemplateOutlet]=\"rowExtras()!\"\n [ngTemplateOutletContext]=\"{ $implicit: col }\" />\n }\n\n @if (reorderable()) {\n <span class=\"col-move\">\n <button\n type=\"button\"\n class=\"col-move-btn\"\n aria-label=\"Move up\"\n [disabled]=\"first\"\n (click)=\"moved.emit({ column: col, delta: -1 })\">\n <ds-icon name=\"chevronUp\" [size]=\"14\" />\n </button>\n\n <button\n type=\"button\"\n class=\"col-move-btn\"\n aria-label=\"Move down\"\n [disabled]=\"last\"\n (click)=\"moved.emit({ column: col, delta: 1 })\">\n <ds-icon name=\"chevronDown\" [size]=\"14\" />\n </button>\n </span>\n }\n </div>\n }\n\n <button type=\"button\" class=\"col-reset\" (click)=\"resetRequested.emit()\">\n Reset to default\n </button>\n </div>\n </ng-template>\n `,\n})\nexport class TableColumnsPanelComponent<T> {\n readonly columns = input.required<readonly TableColumn<T>[]>();\n readonly reorderable = input(false);\n readonly coarsePointer = input(false);\n readonly rowExtras = input<TemplateRef<{ $implicit: TableColumn<T> }> | null>(\n null,\n );\n // Passed as functions rather than precomputed flags: the panel renders one row per column and\n // would otherwise need a parallel array kept in step with `columns`.\n readonly isVisible = input.required<(column: TableColumn<T>) => boolean>();\n readonly isLocked = input.required<(column: TableColumn<T>) => boolean>();\n\n readonly sheetOpen = model(false);\n readonly toggled = output<TableColumn<T>>();\n readonly moved = output<{ column: TableColumn<T>; delta: -1 | 1 }>();\n readonly dropped = output<CdkDragDrop<unknown>>();\n readonly resetRequested = output<void>();\n\n private readonly popover = viewChild<PopoverComponent>('popover');\n\n readonly opened = computed(() =>\n this.coarsePointer()\n ? this.sheetOpen()\n : (this.popover()?.opened() ?? false),\n );\n\n toggle(trigger: HTMLElement): void {\n if (this.coarsePointer()) {\n this.sheetOpen.set(true);\n\n return;\n }\n this.popover()?.toggle(trigger);\n }\n}\n","import { Component, input, output } from '@angular/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\n\n/**\n * The button in the table's utility header cell that opens the column panel.\n *\n * @internal Not API — created by `DsTableColumns` in the header-utility anchor.\n */\n@Component({\n selector: 'ds-table-columns-trigger',\n standalone: true,\n styleUrl: './table-columns-trigger.component.scss',\n imports: [IconComponent],\n template: `\n <button\n type=\"button\"\n class=\"col-picker-btn\"\n aria-haspopup=\"dialog\"\n aria-label=\"Choose columns\"\n [attr.aria-expanded]=\"opened()\"\n (click)=\"pressed.emit($event)\">\n <ds-icon name=\"grid\" [size]=\"14\" />\n </button>\n `,\n})\nexport class TableColumnsTriggerComponent {\n readonly opened = input(false);\n readonly pressed = output<Event>();\n}\n","import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';\nimport {\n type ComponentRef,\n DestroyRef,\n Directive,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\nimport {\n DsTableLayout,\n type TableColumn,\n} from '@ids-group-ltd/ids-design-system/components/table';\nimport { TableColumnsPanelComponent } from './table-columns-panel.component';\nimport { TableColumnsTriggerComponent } from './table-columns-trigger.component';\n\n/**\n * Showing, hiding and reordering columns for `<ds-table>`, as a directive so a table that does\n * none of it never carries the panel — nor `@angular/cdk/drag-drop`, which comes with the drag\n * handle:\n *\n * ```html\n * <ds-table dsTableColumns [reorderableColumns]=\"true\" [columns]=\"cols\" [data]=\"rows\" />\n * ```\n *\n * Hiding needs no input: a column marked `hideable` becomes hideable the moment this directive is\n * present. `[(hiddenKeys)]` and `[(columnOrder)]` are two-way, so the layout can be driven from\n * the host, and both round-trip through `persistLayout` on the table.\n */\n@Directive({\n selector: '[dsTableColumns]',\n standalone: true,\n})\nexport class DsTableColumns<T extends object> {\n private readonly layout = inject<DsTableLayout<T>>(DsTableLayout);\n\n /** Adds the drag handle and the move buttons. Hiding works without it. */\n readonly reorderableColumns = input(false, { transform: booleanAttribute });\n\n /** Keys the reader has hidden. Unset falls back to the columns' own `hidden` flags. */\n readonly hiddenKeys = model<Set<string> | null>(null);\n\n /** Column keys in the reader's order. Unset keeps the declaration order. */\n readonly columnOrder = model<string[] | null>(null);\n\n private readonly coarsePointerState = signal(false);\n private readonly coarsePointer = this.coarsePointerState.asReadonly();\n\n private readonly effectiveHiddenKeys = computed<ReadonlySet<string>>(\n () => this.hiddenKeys() ?? new Set(this.hiddenByDeclaration()),\n );\n\n private readonly declaredColumns = computed<readonly TableColumn<T>[]>(() =>\n this.layout.view().declaredColumns(),\n );\n\n private hiddenByDeclaration(): readonly string[] {\n return this.declaredColumns()\n .filter((column) => column.hidden)\n .map((column) => column.key);\n }\n\n /** Declaration order with the reader's order applied first, then anything they never moved. */\n private readonly ordered = computed<readonly TableColumn<T>[]>(() => {\n const order = this.columnOrder();\n const columns = this.declaredColumns();\n if (!order) {\n return columns;\n }\n const byKey = new Map(columns.map((column) => [column.key, column]));\n const placed = new Set<string>();\n const out: TableColumn<T>[] = [];\n for (const key of order) {\n const column = byKey.get(key);\n if (column && !placed.has(key)) {\n out.push(column);\n placed.add(key);\n }\n }\n for (const column of columns) {\n if (!placed.has(column.key)) {\n out.push(column);\n }\n }\n\n return out;\n });\n\n private readonly visible = computed<readonly TableColumn<T>[]>(() =>\n this.ordered().filter(\n (column) => !this.effectiveHiddenKeys().has(column.key),\n ),\n );\n\n constructor() {\n this.layout.addColumnStage(() => this.visible());\n this.layout.requestUtilityColumn();\n this.layout.addPersistedSlice({\n key: 'order',\n read: () => this.columnOrder(),\n write: (value) => this.columnOrder.set(value as string[]),\n reset: () => this.columnOrder.set(null),\n });\n this.layout.addPersistedSlice({\n key: 'hidden',\n read: () => (this.hiddenKeys() ? [...this.hiddenKeys()!] : null),\n write: (value) => this.hiddenKeys.set(new Set(value as string[])),\n reset: () => this.hiddenKeys.set(null),\n });\n\n const trigger = this.layout.view().anchor('header-utility');\n const overlays = this.layout.view().anchor('overlays');\n let panel: ComponentRef<TableColumnsPanelComponent<T>> | null = null;\n let button: ComponentRef<TableColumnsTriggerComponent> | null = null;\n\n effect(() => {\n const host = overlays();\n if (!host || panel) {\n return;\n }\n panel = host.createComponent(TableColumnsPanelComponent<T>);\n panel.instance.toggled.subscribe((column) => this.toggleColumn(column));\n panel.instance.moved.subscribe(({ column, delta }) =>\n this.moveColumn(column, delta),\n );\n panel.instance.dropped.subscribe((event) => this.onDrop(event));\n panel.instance.resetRequested.subscribe(() =>\n this.layout.resetPersisted(),\n );\n });\n\n effect(() => {\n const host = trigger();\n if (!host || button) {\n return;\n }\n button = host.createComponent(TableColumnsTriggerComponent);\n button.instance.pressed.subscribe((event: Event) =>\n panel?.instance.toggle(event.currentTarget as HTMLElement),\n );\n });\n\n // Both are separate views, so the host's change detection does not reach them: every input\n // they read has to be written when it moves.\n effect(() => {\n panel?.setInput('columns', this.ordered());\n panel?.setInput('reorderable', this.reorderableColumns());\n panel?.setInput('coarsePointer', this.coarsePointer());\n panel?.setInput('rowExtras', this.layout.panelRowTemplate());\n panel?.setInput('isVisible', (column: TableColumn<T>) =>\n this.isVisible(column),\n );\n panel?.setInput('isLocked', (column: TableColumn<T>) =>\n this.isLocked(column),\n );\n button?.setInput('opened', panel?.instance.opened() ?? false);\n });\n\n if (typeof window !== 'undefined' && window.matchMedia) {\n const query = window.matchMedia('(hover: none) and (pointer: coarse)');\n const sync = (): void => this.coarsePointerState.set(query.matches);\n sync();\n query.addEventListener('change', sync);\n inject(DestroyRef).onDestroy(() =>\n query.removeEventListener('change', sync),\n );\n }\n\n inject(DestroyRef).onDestroy(() => {\n panel?.destroy();\n button?.destroy();\n });\n }\n\n private isVisible(column: TableColumn<T>): boolean {\n return !this.effectiveHiddenKeys().has(column.key);\n }\n\n /** The last visible column cannot be hidden — an all-hidden grid is useless. */\n private isLocked(column: TableColumn<T>): boolean {\n return this.isVisible(column) && this.visible().length === 1;\n }\n\n private toggleColumn(column: TableColumn<T>): void {\n if (!column.hideable || this.isLocked(column)) {\n return;\n }\n const next = new Set(this.effectiveHiddenKeys());\n if (next.has(column.key)) {\n next.delete(column.key);\n } else {\n next.add(column.key);\n }\n this.hiddenKeys.set(next);\n }\n\n private moveColumn(column: TableColumn<T>, delta: -1 | 1): void {\n const keys = this.ordered().map((each) => each.key);\n const from = keys.indexOf(column.key);\n const to = from + delta;\n if (from < 0 || to < 0 || to >= keys.length) {\n return;\n }\n moveItemInArray(keys, from, to);\n this.columnOrder.set(keys);\n }\n\n private onDrop(event: CdkDragDrop<unknown>): void {\n const keys = this.ordered().map((each) => each.key);\n moveItemInArray(keys, event.previousIndex, event.currentIndex);\n this.columnOrder.set(keys);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAqBA;;;;;;;;;;;AAWG;MAiGU,0BAA0B,CAAA;AAC5B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAA6B;AACrD,IAAA,WAAW,GAAG,KAAK,CAAC,KAAK,kFAAC;AAC1B,IAAA,aAAa,GAAG,KAAK,CAAC,KAAK,oFAAC;AAC5B,IAAA,SAAS,GAAG,KAAK,CACxB,IAAI,gFACL;;;AAGQ,IAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,+EAAuC;AACjE,IAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,8EAAuC;AAEhE,IAAA,SAAS,GAAG,KAAK,CAAC,KAAK,gFAAC;IACxB,OAAO,GAAG,MAAM,EAAkB;IAClC,KAAK,GAAG,MAAM,EAA6C;IAC3D,OAAO,GAAG,MAAM,EAAwB;IACxC,cAAc,GAAG,MAAM,EAAQ;AAEvB,IAAA,OAAO,GAAG,SAAS,CAAmB,SAAS,8EAAC;IAExD,MAAM,GAAG,QAAQ,CAAC,MACzB,IAAI,CAAC,aAAa;AAChB,UAAE,IAAI,CAAC,SAAS;AAChB,WAAG,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI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