@ids-group-ltd/ids-design-system 0.12.2 → 0.12.3

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +148 -0
  2. package/components.md +3 -1
  3. package/docs/agent/forms/ds-button.md +3 -1
  4. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +2 -2
  5. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
  6. package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +20 -21
  7. package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
  8. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +57 -40
  9. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
  10. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +9 -4
  11. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
  12. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +2 -2
  13. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
  14. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +2 -2
  15. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
  16. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +2 -2
  17. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
  18. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +2 -2
  19. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
  20. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +2 -2
  21. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
  22. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -2
  23. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
  24. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +1 -1
  25. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
  26. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +2 -2
  27. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
  28. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +2 -2
  29. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
  30. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +12 -12
  31. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
  32. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +2 -2
  33. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
  34. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +2 -2
  35. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
  36. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +2 -2
  37. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
  38. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +9 -4
  39. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
  40. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +1 -1
  41. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -1
  42. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +2 -2
  43. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
  44. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +2 -2
  45. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
  46. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +2 -2
  47. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
  48. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +2 -2
  49. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
  50. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +17 -1
  51. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
  52. package/migrations/0.12.3.json +83 -0
  53. package/package.json +1 -1
  54. package/styles/_control-line.scss +45 -0
  55. package/styles/_field-state.scss +14 -15
  56. package/styles/_focus.scss +31 -60
  57. package/styles/_tokens.scss +22 -31
  58. package/types/ids-group-ltd-ids-design-system-components-breadcrumbs.d.ts +8 -17
  59. package/types/ids-group-ltd-ids-design-system-components-button.d.ts +26 -29
  60. package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +6 -1
  61. package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +10 -10
  62. package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +6 -1
  63. package/types/ids-group-ltd-ids-design-system-components.d.ts +12 -2
@@ -1 +1 @@
1
- {"version":3,"file":"ids-group-ltd-ids-design-system-components-stat.mjs","sources":["../../../src/lib/components/stat/stat.component.ts","../../../src/lib/components/stat/stat.component.html","../../../src/lib/components/stat/ids-group-ltd-ids-design-system-components-stat.ts"],"sourcesContent":["import { Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { devWarn } from '@ids-group-ltd/ids-design-system/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\n\n@Component({\n selector: 'ds-stat',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './stat.component.html',\n styleUrl: './stat.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[class.error]': \"variant() === 'error'\",\n '[class.size-sm]': \"size() === 'sm'\",\n '[class.size-lg]': \"size() === 'lg'\",\n },\n})\nexport class StatComponent {\n constructor() {\n // `unit` concatenates onto the INPUT value, so a projected value silently\n // drops it — and \"kg\" quietly missing from a tile is the kind of thing that\n // reads as fine until someone checks the number against the source.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n devWarn(() =>\n this.unit() && !this.value()\n ? `[ds-stat] unit=\"${this.unit()}\" is set but there is no \\`value\\` input — a projected [dsStatValue] owns the whole line, so the unit is not rendered. Put it inside the projected content, or drop the input.`\n : null,\n );\n }\n }\n\n /** Metric name shown above the value. */\n readonly label = input.required<string>();\n /** Headline metric; `unit` is appended directly after it.\n *\n * Optional because the value can be PROJECTED instead — `[dsStatValue]`\n * takes a badge, a status dot, anything a tile needs where a number would go.\n * The input is the fallback, the same shape `[delta]` already has.\n *\n * Namespaced, unlike `[delta]`: twenty components in this library have a\n * `value` input, so a bare `value` attribute used to slot one of them in\n * would also set that input to the empty string.\n *\n * Takes `null` so `[value]=\"count | number\"` typechecks: Angular's own\n * `number`/`date`/`percent` pipes are typed `string | null`, and without the null the\n * idiomatic form fails `strictTemplates` and pushes consumers to `toLocaleString()` in\n * the template — which hardcodes a locale instead of reading LOCALE_ID. Renders as\n * nothing, like the empty default. */\n readonly value = input<string | number | null>('');\n /** Change amount; sign drives the up/down arrow and color. */\n readonly delta = input<number | null>(null);\n /** Suffix appended after the delta's magnitude, e.g. \"vs last month\". */\n readonly deltaLabel = input<string>('');\n /** Overrides the automatic up/down coloring of the delta. */\n readonly deltaTone = input<'neutral' | 'secondary' | null>(null);\n /** Secondary text shown below the value when there's no `delta`. */\n readonly caption = input<string>('');\n /** Suffix appended directly after `value`, e.g. \"%\". */\n readonly unit = input<string>('');\n /** `error` applies the error color treatment. */\n readonly variant = input<'default' | 'error'>('default');\n /** Controls the stat's overall type scale. */\n readonly size = input<'sm' | 'md' | 'lg'>('md');\n\n protected readonly deltaClasses = computed(() => {\n const delta = this.delta();\n if (delta === null) {\n return '';\n }\n const tone = this.deltaTone();\n if (tone) {\n return `delta ${tone}`;\n }\n if (delta > 0) {\n return 'delta up';\n }\n if (delta < 0) {\n return 'delta down';\n }\n\n return 'delta';\n });\n\n protected readonly deltaIcon = computed<'arrowUp' | 'arrowDown' | null>(\n () => {\n const delta = this.delta();\n if (delta === null || delta === 0) {\n return null;\n }\n\n return delta > 0 ? 'arrowUp' : 'arrowDown';\n },\n );\n\n protected readonly deltaText = computed(() => {\n const delta = this.delta();\n if (delta === null) {\n return '';\n }\n const magnitude = Math.abs(delta);\n const suffix = this.deltaLabel() ? ` ${this.deltaLabel()}` : '';\n\n return `${magnitude}${suffix}`;\n });\n}\n","<div class=\"stat\">\n <div class=\"label\">\n {{ label() }}\n </div>\n\n <div class=\"value\">\n <ng-content select=\"[dsStatValue]\">{{ value() }}{{ unit() }}</ng-content>\n </div>\n\n @if (delta() !== null) {\n <div [class]=\"deltaClasses()\">\n @if (deltaIcon(); as icon) {\n <ds-icon\n [name]=\"icon\"\n [size]=\"12\">\n </ds-icon>\n }\n\n <ng-content select=\"[delta]\">{{ deltaText() }}</ng-content>\n </div>\n } @else if (caption()) {\n <div class=\"caption\">\n {{ caption() }}\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAiBa,aAAa,CAAA;AACxB,IAAA,WAAA,GAAA;;;;AAIE,QAAA,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,EAAE;AACjD,YAAA,OAAO,CAAC,MACN,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK;AACxB,kBAAE,CAAA,gBAAA,EAAmB,IAAI,CAAC,IAAI,EAAE,CAAA,8KAAA;kBAC9B,IAAI,CACT;QACH;IACF;;AAGS,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAU;AACzC;;;;;;;;;;;;;;AAcuC;AAC9B,IAAA,KAAK,GAAG,KAAK,CAAyB,EAAE,4EAAC;;AAEzC,IAAA,KAAK,GAAG,KAAK,CAAgB,IAAI,4EAAC;;AAElC,IAAA,UAAU,GAAG,KAAK,CAAS,EAAE,iFAAC;;AAE9B,IAAA,SAAS,GAAG,K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AA,CAAA,EAAA;;;AEfH;;AAEG;;;;"}
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-stat.mjs","sources":["../../../src/lib/components/stat/stat.component.ts","../../../src/lib/components/stat/stat.component.html","../../../src/lib/components/stat/ids-group-ltd-ids-design-system-components-stat.ts"],"sourcesContent":["import { Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { devWarn } from '@ids-group-ltd/ids-design-system/core';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\n\n@Component({\n selector: 'ds-stat',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './stat.component.html',\n styleUrl: './stat.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n '[class.error]': \"variant() === 'error'\",\n '[class.size-sm]': \"size() === 'sm'\",\n '[class.size-lg]': \"size() === 'lg'\",\n },\n})\nexport class StatComponent {\n constructor() {\n // `unit` concatenates onto the INPUT value, so a projected value silently\n // drops it — and \"kg\" quietly missing from a tile is the kind of thing that\n // reads as fine until someone checks the number against the source.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n devWarn(() =>\n this.unit() && !this.value()\n ? `[ds-stat] unit=\"${this.unit()}\" is set but there is no \\`value\\` input — a projected [dsStatValue] owns the whole line, so the unit is not rendered. Put it inside the projected content, or drop the input.`\n : null,\n );\n }\n }\n\n /** Metric name shown above the value. */\n readonly label = input.required<string>();\n /** Headline metric; `unit` is appended directly after it.\n *\n * Optional because the value can be PROJECTED instead — `[dsStatValue]`\n * takes a badge, a status dot, anything a tile needs where a number would go.\n * The input is the fallback, the same shape `[delta]` already has.\n *\n * Namespaced, unlike `[delta]`: twenty components in this library have a\n * `value` input, so a bare `value` attribute used to slot one of them in\n * would also set that input to the empty string.\n *\n * Takes `null` so `[value]=\"count | number\"` typechecks: Angular's own\n * `number`/`date`/`percent` pipes are typed `string | null`, and without the null the\n * idiomatic form fails `strictTemplates` and pushes consumers to `toLocaleString()` in\n * the template — which hardcodes a locale instead of reading LOCALE_ID. Renders as\n * nothing, like the empty default. */\n readonly value = input<string | number | null>('');\n /** Change amount; sign drives the up/down arrow and color. */\n readonly delta = input<number | null>(null);\n /** Suffix appended after the delta's magnitude, e.g. \"vs last month\". */\n readonly deltaLabel = input<string>('');\n /** Overrides the automatic up/down coloring of the delta. */\n readonly deltaTone = input<'neutral' | 'secondary' | null>(null);\n /** Secondary text shown below the value when there's no `delta`. */\n readonly caption = input<string>('');\n /** Suffix appended directly after `value`, e.g. \"%\". */\n readonly unit = input<string>('');\n /** `error` applies the error color treatment. */\n readonly variant = input<'default' | 'error'>('default');\n /** Controls the stat's overall type scale. */\n readonly size = input<'sm' | 'md' | 'lg'>('md');\n\n protected readonly deltaClasses = computed(() => {\n const delta = this.delta();\n if (delta === null) {\n return '';\n }\n const tone = this.deltaTone();\n if (tone) {\n return `delta ${tone}`;\n }\n if (delta > 0) {\n return 'delta up';\n }\n if (delta < 0) {\n return 'delta down';\n }\n\n return 'delta';\n });\n\n protected readonly deltaIcon = computed<'arrowUp' | 'arrowDown' | null>(\n () => {\n const delta = this.delta();\n if (delta === null || delta === 0) {\n return null;\n }\n\n return delta > 0 ? 'arrowUp' : 'arrowDown';\n },\n );\n\n protected readonly deltaText = computed(() => {\n const delta = this.delta();\n if (delta === null) {\n return '';\n }\n const magnitude = Math.abs(delta);\n const suffix = this.deltaLabel() ? ` ${this.deltaLabel()}` : '';\n\n return `${magnitude}${suffix}`;\n });\n}\n","<div class=\"stat\">\n <div class=\"label\">\n {{ label() }}\n </div>\n\n <div class=\"value\">\n <ng-content select=\"[dsStatValue]\">{{ value() }}{{ unit() }}</ng-content>\n </div>\n\n @if (delta() !== null) {\n <div [class]=\"deltaClasses()\">\n @if (deltaIcon(); as icon) {\n <ds-icon\n [name]=\"icon\"\n [size]=\"12\">\n </ds-icon>\n }\n\n <ng-content select=\"[delta]\">{{ deltaText() }}</ng-content>\n </div>\n } @else if (caption()) {\n <div class=\"caption\">\n {{ caption() }}\n </div>\n }\n</div>\n","/**\n * Generated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ECjB1B,4kBA0BA,EAAA,MAAA,EAAA,CAAA,4wEAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDnBY,aAAa,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAUZ,aAAa,EAAA,UAAA,EAAA,CAAA;kBAbzB,SAAS;+BACE,SAAS,EAAA,UAAA,EACP,IAAI,EAAA,OAAA,EACP,CAAC,aAAa,CAAC,EAAA,aAAA,EAGT,iBAAiB,CAAC,QAAQ,EAAA,IAAA,EACnC;AACJ,wBAAA,eAAe,EAAE,uBAAuB;AACxC,wBAAA,iBAAiB,EAAE,iBAAiB;AACpC,wBAAA,iBAAiB,EAAE,iBAAiB;AACrC,qBAAA,EAAA,QAAA,EAAA,4kBAAA,EAAA,MAAA,EAAA,CAAA,4wEAAA,CAAA,EAAA;;;AEfH;;AAEG;;;;"}
@@ -25,6 +25,9 @@ class SwitchComponent extends DsBooleanControlValueAccessor {
25
25
  /** Inline label rendered beside the track and wired via for/id. Omit to
26
26
  * bring your own <label>. */
27
27
  label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
28
+ /** Accessible name for a control with no visible label — the row's `<label>` collapses when it
29
+ * is empty, leaving nothing to name it. Set beside a label it OVERRIDES the label, per ARIA. */
30
+ ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
28
31
  isDisabled = computed(() => this.disabled() || this.formDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
29
32
  uid = nextControlId('ds-switch');
30
33
  controlId = computed(() => this.inputId() ?? this.uid, ...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
@@ -39,6 +42,8 @@ class SwitchComponent extends DsBooleanControlValueAccessor {
39
42
  touched: this.touched,
40
43
  });
41
44
  message = this.fieldMessage.message;
45
+ /** Only name via aria-label when there is no visible `<label for>` to do it. */
46
+ resolvedAriaLabel = computed(() => this.label() ? null : this.ariaLabel() || null, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
42
47
  invalidResolved = this.fieldMessage.invalid;
43
48
  switchClasses = computed(() => {
44
49
  const variant = this.variant();
@@ -49,13 +54,13 @@ class SwitchComponent extends DsBooleanControlValueAccessor {
49
54
  this.checked.set(event.target.checked);
50
55
  }
51
56
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SwitchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
52
- 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 } }, outputs: { checked: "checkedChange" }, providers: [
57
+ 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: [
53
58
  {
54
59
  provide: NG_VALUE_ACCESSOR,
55
60
  useExisting: forwardRef(() => SwitchComponent),
56
61
  multi: true,
57
62
  },
58
- ], 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-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: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"] }] });
63
+ ], 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"] }] });
59
64
  }
60
65
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: SwitchComponent, decorators: [{
61
66
  type: Component,
@@ -65,8 +70,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
65
70
  useExisting: forwardRef(() => SwitchComponent),
66
71
  multi: true,
67
72
  },
68
- ], 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-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: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"] }]
69
- }], 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 }] }] } });
73
+ ], 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"] }]
74
+ }], 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 }] }] } });
70
75
 
71
76
  /**
72
77
  * 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\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 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 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-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;AAEf,IAAA,UAAU,GAAG,QAAQ,CACtC,MAAM,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,YAAY,EAAE,iFAC7C;AAEkB,IAAA,GAAG,GAAG,aAAa,CAAC,WAAW,CAAC;AAChC,IAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,GAAG,gFAAC;IACtD,MAAM,GAAG,QAAQ,CAAC,MACnC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,GAAG,CAAA,EAAG,IAAI,CAAC,GAAG,CAAA,KAAA,CAAO,GAAG,IAAI,EAAA,IAAA,SAAA,GAAA,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YAAA;AACE,gBAAA,OAAO,EAAE,iBAAiB;AAC1B,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,EC9BH,uqCA4CA,4jIDxBY,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,uqCAAA,EAAA,MAAA,EAAA,CAAA,ogIAAA,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} 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 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,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AAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,OAAA,EAAA,eAAA,EAAA,EAAA,SAAA,EARf;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,iBAAiB;AAC1B,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,EC9BH,wtCA6CA,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,wtCAAA,EAAA,MAAA,EAAA,CAAA,yjIAAA,CAAA,EAAA;;;AE9BH;;AAEG;;;;"}
@@ -25,7 +25,7 @@ class TableExportButtonComponent {
25
25
  (pressed)="pressed.emit()">
26
26
  {{ busy() ? 'Preparing…' : 'Export CSV' }}
27
27
  </ds-button>
28
- `, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "ds-button", inputs: ["color", "variant", "size", "type", "disabled", "loading", "fullWidth", "ariaLabel", "icon", "trailingIcon", "ariaHasPopup", "ariaExpanded", "ariaControls", "disabledReason", "ariaDescribedBy"], outputs: ["pressed"] }], encapsulation: i0.ViewEncapsulation.None });
28
+ `, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "ds-button", inputs: ["color", "variant", "size", "routerLink", "href", "type", "disabled", "loading", "fullWidth", "ariaLabel", "icon", "trailingIcon", "ariaHasPopup", "ariaExpanded", "ariaControls", "disabledReason", "ariaDescribedBy"], outputs: ["pressed"] }], encapsulation: i0.ViewEncapsulation.None });
29
29
  }
30
30
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: TableExportButtonComponent, decorators: [{
31
31
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"ids-group-ltd-ids-design-system-components-table-export.mjs","sources":["../../../src/lib/components/table-export/table-export-button.component.ts","../../../src/lib/components/table-export/table-export.directive.ts","../../../src/lib/components/table-export/ids-group-ltd-ids-design-system-components-table-export.ts"],"sourcesContent":["import { Component, ViewEncapsulation, input, output } from '@angular/core';\nimport { ButtonComponent } from '@ids-group-ltd/ids-design-system/components/button';\n\n/**\n * The toolbar control `DsTableExport` renders for itself.\n *\n * It exists as a component rather than a `createComponent(ButtonComponent)` call with\n * `setInput` per binding, so the button's markup stays ordinary template code instead of a\n * hand-rolled imperative copy that drifts from `ds-button`'s own API.\n *\n * @internal Not API — created by the directive, never written in a consumer's template.\n */\n@Component({\n selector: 'ds-table-export-button',\n standalone: true,\n encapsulation: ViewEncapsulation.None,\n imports: [ButtonComponent],\n template: `\n <ds-button\n color=\"neutral\"\n variant=\"outline\"\n size=\"sm\"\n [disabled]=\"busy()\"\n (pressed)=\"pressed.emit()\">\n {{ busy() ? 'Preparing…' : 'Export CSV' }}\n </ds-button>\n `,\n})\nexport class TableExportButtonComponent {\n readonly busy = input(false);\n readonly pressed = output<void>();\n}\n","import {\n type ComponentRef,\n DestroyRef,\n Directive,\n booleanAttribute,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport {\n DsTableLayout,\n type TableColumn,\n} from '@ids-group-ltd/ids-design-system/components/table';\nimport { TableExportButtonComponent } from './table-export-button.component';\n\n/**\n * CSV export for `<ds-table>`, as a directive so a table that does not export never carries the\n * code. Put it on the table and the toolbar grows the button:\n *\n * ```html\n * <ds-table dsTableExport [columns]=\"cols\" [data]=\"rows\" />\n * ```\n *\n * On a server-paged table the table holds one page, so give it the whole set:\n *\n * ```html\n * <ds-table dsTableExport [exportFetcher]=\"fetchAll\" (exportFailed)=\"report($event)\" />\n * ```\n *\n * `table.runExport()` and `table.exporting()` keep working — they delegate to whichever export\n * directive is present, so a button of your own in `[toolbar]` or a page header still drives it.\n * Pass `[dsTableExport]=\"false\"` to keep the code and drop the built-in button.\n */\n@Directive({\n selector: '[dsTableExport]',\n standalone: true,\n})\nexport class DsTableExport<T extends object> {\n private readonly layout = inject<DsTableLayout<T>>(DsTableLayout);\n\n /** Renders the built-in toolbar button. `false` keeps the feature and hides the control, for a\n * table whose export is driven from somewhere else on the page. */\n readonly dsTableExport = input(true, { transform: booleanAttribute });\n\n readonly exportFilename = input<string>('table.csv');\n\n /** Fetches the rows to export. Without it the export serialises what the table holds, which on\n * a server-paged table is one page. */\n readonly exportFetcher = input<\n (() => Promise<readonly T[] | Blob | string>) | null\n >(null);\n\n /** Without it a rejected `exportFetcher` is silent. */\n readonly exportFailed = output<unknown>();\n\n private readonly busy = signal(false);\n readonly exporting = this.busy.asReadonly();\n\n private readonly announcement = signal('');\n\n constructor() {\n this.layout.setExport({\n run: () => this.runExport(),\n csv: (filename, rows) => this.exportCsv(filename, rows),\n exporting: this.exporting,\n });\n this.layout.addStatusFragment(this.announcement.asReadonly());\n\n const anchor = this.layout.view().anchor('toolbar');\n let created: ComponentRef<TableExportButtonComponent> | null = null;\n effect(() => {\n const host = anchor();\n const wanted = this.dsTableExport();\n if (!host || !wanted || created) {\n return;\n }\n created = host.createComponent(TableExportButtonComponent);\n created.setInput('busy', this.busy());\n created.instance.pressed.subscribe(() => void this.runExport());\n });\n // The button is a separate view, so it is not reached by the host's change detection: its\n // input has to be written when the state moves.\n effect(() => {\n created?.setInput('busy', this.busy());\n });\n inject(DestroyRef).onDestroy(() => created?.destroy());\n }\n\n /** Without `exportFetcher` this serialises only what the table holds, which on a server-paged\n * table is one page. */\n async runExport(): Promise<void> {\n const fetcher = this.exportFetcher();\n if (!fetcher) {\n this.exportCsv(this.exportFilename());\n\n return;\n }\n this.busy.set(true);\n this.announcement.set('Preparing export…');\n try {\n const result = await fetcher();\n if (typeof result === 'string' || result instanceof Blob) {\n this.downloadFile(result, this.exportFilename());\n } else {\n this.exportCsv(this.exportFilename(), result);\n }\n this.announcement.set('Export ready');\n } catch (error) {\n this.announcement.set('Export failed');\n this.exportFailed.emit(error);\n } finally {\n this.busy.set(false);\n }\n }\n\n /** Serialises the table's visible columns as a CSV download. Pass `rows` to serialise a set you\n * fetched yourself. */\n exportCsv(filename = 'table.csv', rows?: readonly T[]): void {\n if (typeof document === 'undefined') {\n return;\n }\n const view = this.layout.view();\n const columns = view.visibleColumns();\n const escapeCell = (value: string): string =>\n /[\",\\r\\n]/.test(value) ? `\"${value.replace(/\"/g, '\"\"')}\"` : value;\n const cells = (row: T): readonly string[] =>\n columns.map((column: TableColumn<T>) =>\n escapeCell(view.cellText(row, column)),\n );\n // Leading BOM so Excel reads UTF-8 (accented labels and values) correctly.\n const csv =\n '' +\n [\n columns.map((column: TableColumn<T>) => escapeCell(column.label)),\n ...(rows ?? view.sortedRows()).map(cells),\n ]\n .map((row) => row.join(','))\n .join('\\r\\n');\n this.downloadFile(\n new Blob([csv], { type: 'text/csv;charset=utf-8;' }),\n filename,\n );\n }\n\n /** Only a Blob gets its object URL revoked — a URL the caller supplied is theirs to manage. */\n private downloadFile(source: Blob | string, filename: string): void {\n if (typeof document === 'undefined') {\n return;\n }\n const url = source instanceof Blob ? URL.createObjectURL(source) : source;\n const link = document.createElement('a');\n link.href = url;\n link.download = filename;\n link.click();\n if (source instanceof Blob) {\n URL.revokeObjectURL(url);\n }\n }\n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,iBAAA,EAAA,eAAA,EAAA,UAAA,EAAA,eAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,YAAA,EAAA,cAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACtCD;;AAEG;;;;"}
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-table-export.mjs","sources":["../../../src/lib/components/table-export/table-export-button.component.ts","../../../src/lib/components/table-export/table-export.directive.ts","../../../src/lib/components/table-export/ids-group-ltd-ids-design-system-components-table-export.ts"],"sourcesContent":["import { Component, ViewEncapsulation, input, output } from '@angular/core';\nimport { ButtonComponent } from '@ids-group-ltd/ids-design-system/components/button';\n\n/**\n * The toolbar control `DsTableExport` renders for itself.\n *\n * It exists as a component rather than a `createComponent(ButtonComponent)` call with\n * `setInput` per binding, so the button's markup stays ordinary template code instead of a\n * hand-rolled imperative copy that drifts from `ds-button`'s own API.\n *\n * @internal Not API — created by the directive, never written in a consumer's template.\n */\n@Component({\n selector: 'ds-table-export-button',\n standalone: true,\n encapsulation: ViewEncapsulation.None,\n imports: [ButtonComponent],\n template: `\n <ds-button\n color=\"neutral\"\n variant=\"outline\"\n size=\"sm\"\n [disabled]=\"busy()\"\n (pressed)=\"pressed.emit()\">\n {{ busy() ? 'Preparing…' : 'Export CSV' }}\n </ds-button>\n `,\n})\nexport class TableExportButtonComponent {\n readonly busy = input(false);\n readonly pressed = output<void>();\n}\n","import {\n type ComponentRef,\n DestroyRef,\n Directive,\n booleanAttribute,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport {\n DsTableLayout,\n type TableColumn,\n} from '@ids-group-ltd/ids-design-system/components/table';\nimport { TableExportButtonComponent } from './table-export-button.component';\n\n/**\n * CSV export for `<ds-table>`, as a directive so a table that does not export never carries the\n * code. Put it on the table and the toolbar grows the button:\n *\n * ```html\n * <ds-table dsTableExport [columns]=\"cols\" [data]=\"rows\" />\n * ```\n *\n * On a server-paged table the table holds one page, so give it the whole set:\n *\n * ```html\n * <ds-table dsTableExport [exportFetcher]=\"fetchAll\" (exportFailed)=\"report($event)\" />\n * ```\n *\n * `table.runExport()` and `table.exporting()` keep working — they delegate to whichever export\n * directive is present, so a button of your own in `[toolbar]` or a page header still drives it.\n * Pass `[dsTableExport]=\"false\"` to keep the code and drop the built-in button.\n */\n@Directive({\n selector: '[dsTableExport]',\n standalone: true,\n})\nexport class DsTableExport<T extends object> {\n private readonly layout = inject<DsTableLayout<T>>(DsTableLayout);\n\n /** Renders the built-in toolbar button. `false` keeps the feature and hides the control, for a\n * table whose export is driven from somewhere else on the page. */\n readonly dsTableExport = input(true, { transform: booleanAttribute });\n\n readonly exportFilename = input<string>('table.csv');\n\n /** Fetches the rows to export. Without it the export serialises what the table holds, which on\n * a server-paged table is one page. */\n readonly exportFetcher = input<\n (() => Promise<readonly T[] | Blob | string>) | null\n >(null);\n\n /** Without it a rejected `exportFetcher` is silent. */\n readonly exportFailed = output<unknown>();\n\n private readonly busy = signal(false);\n readonly exporting = this.busy.asReadonly();\n\n private readonly announcement = signal('');\n\n constructor() {\n this.layout.setExport({\n run: () => this.runExport(),\n csv: (filename, rows) => this.exportCsv(filename, rows),\n exporting: this.exporting,\n });\n this.layout.addStatusFragment(this.announcement.asReadonly());\n\n const anchor = this.layout.view().anchor('toolbar');\n let created: ComponentRef<TableExportButtonComponent> | null = null;\n effect(() => {\n const host = anchor();\n const wanted = this.dsTableExport();\n if (!host || !wanted || created) {\n return;\n }\n created = host.createComponent(TableExportButtonComponent);\n created.setInput('busy', this.busy());\n created.instance.pressed.subscribe(() => void this.runExport());\n });\n // The button is a separate view, so it is not reached by the host's change detection: its\n // input has to be written when the state moves.\n effect(() => {\n created?.setInput('busy', this.busy());\n });\n inject(DestroyRef).onDestroy(() => created?.destroy());\n }\n\n /** Without `exportFetcher` this serialises only what the table holds, which on a server-paged\n * table is one page. */\n async runExport(): Promise<void> {\n const fetcher = this.exportFetcher();\n if (!fetcher) {\n this.exportCsv(this.exportFilename());\n\n return;\n }\n this.busy.set(true);\n this.announcement.set('Preparing export…');\n try {\n const result = await fetcher();\n if (typeof result === 'string' || result instanceof Blob) {\n this.downloadFile(result, this.exportFilename());\n } else {\n this.exportCsv(this.exportFilename(), result);\n }\n this.announcement.set('Export ready');\n } catch (error) {\n this.announcement.set('Export failed');\n this.exportFailed.emit(error);\n } finally {\n this.busy.set(false);\n }\n }\n\n /** Serialises the table's visible columns as a CSV download. Pass `rows` to serialise a set you\n * fetched yourself. */\n exportCsv(filename = 'table.csv', rows?: readonly T[]): void {\n if (typeof document === 'undefined') {\n return;\n }\n const view = this.layout.view();\n const columns = view.visibleColumns();\n const escapeCell = (value: string): string =>\n /[\",\\r\\n]/.test(value) ? `\"${value.replace(/\"/g, '\"\"')}\"` : value;\n const cells = (row: T): readonly string[] =>\n columns.map((column: TableColumn<T>) =>\n escapeCell(view.cellText(row, column)),\n );\n // Leading BOM so Excel reads UTF-8 (accented labels and values) correctly.\n const csv =\n '' +\n [\n columns.map((column: TableColumn<T>) => escapeCell(column.label)),\n ...(rows ?? view.sortedRows()).map(cells),\n ]\n .map((row) => row.join(','))\n .join('\\r\\n');\n this.downloadFile(\n new Blob([csv], { type: 'text/csv;charset=utf-8;' }),\n filename,\n );\n }\n\n /** Only a Blob gets its object URL revoked — a URL the caller supplied is theirs to manage. */\n private downloadFile(source: Blob | string, filename: string): void {\n if (typeof document === 'undefined') {\n return;\n }\n const url = source instanceof Blob ? URL.createObjectURL(source) : source;\n const link = document.createElement('a');\n link.href = url;\n link.download = filename;\n link.click();\n if (source instanceof Blob) {\n URL.revokeObjectURL(url);\n }\n }\n}\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