@sdcorejs/angular 21.2.3 → 21.2.5

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 (28) hide show
  1. package/README.md +11 -9
  2. package/fesm2022/sdcorejs-angular-components-card.mjs +174 -0
  3. package/fesm2022/sdcorejs-angular-components-card.mjs.map +1 -0
  4. package/fesm2022/sdcorejs-angular-components-modal.mjs +16 -3
  5. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  6. package/fesm2022/sdcorejs-angular-components-quick-action.mjs +5 -3
  7. package/fesm2022/sdcorejs-angular-components-quick-action.mjs.map +1 -1
  8. package/fesm2022/sdcorejs-angular-components-table.mjs +1450 -920
  9. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  10. package/fesm2022/sdcorejs-angular-components-tree.mjs +1 -1
  11. package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
  12. package/fesm2022/sdcorejs-angular-components.mjs +1 -0
  13. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  14. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +2 -2
  15. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  16. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +57 -7
  17. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  18. package/fesm2022/sdcorejs-angular-i18n.mjs +85 -0
  19. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  20. package/fesm2022/sdcorejs-angular-services-api.mjs +5 -0
  21. package/fesm2022/sdcorejs-angular-services-api.mjs.map +1 -1
  22. package/package.json +7 -3
  23. package/types/sdcorejs-angular-components-card.d.ts +58 -0
  24. package/types/sdcorejs-angular-components-modal.d.ts +1 -0
  25. package/types/sdcorejs-angular-components-quick-action.d.ts +6 -4
  26. package/types/sdcorejs-angular-components-table.d.ts +295 -233
  27. package/types/sdcorejs-angular-components.d.ts +1 -0
  28. package/types/sdcorejs-angular-i18n.d.ts +17 -0
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @sdcorejs/angular
2
2
 
3
- Angular Material-based UI building blocks for data-heavy business applications. The package combines standalone components, consistent form controls, workflow primitives, application services, theming, and localization for Angular 19, 20, and 21.
3
+ Angular Material-based UI building blocks for data-heavy business applications. The package combines standalone components, consistent form controls, workflow primitives, application services, theming, and localization for Angular 19, 20, 21, and 22.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@sdcorejs/angular.svg)](https://www.npmjs.com/package/@sdcorejs/angular)
6
6
  [![monthly npm downloads](https://img.shields.io/npm/dm/@sdcorejs/angular.svg)](https://www.npmjs.com/package/@sdcorejs/angular)
7
- [![Angular 19, 20, and 21](https://img.shields.io/badge/Angular-19%20%7C%2020%20%7C%2021-DD0031?logo=angular&logoColor=white)](#compatibility)
7
+ [![Angular 19, 20, 21, and 22](https://img.shields.io/badge/Angular-19%20%7C%2020%20%7C%2021%20%7C%2022-DD0031?logo=angular&logoColor=white)](#compatibility)
8
8
  [![MIT license](https://img.shields.io/github/license/sdcorejs/sdcorejs-angular.svg)](https://github.com/sdcorejs/sdcorejs-angular/blob/main/LICENSE)
9
9
 
10
10
  [Showcase](https://sdcorejs.github.io/sdcorejs-angular/) · [Quick start](#quick-start) · [API manifest](https://sdcorejs.github.io/sdcorejs-angular/docs/latest/index.json) · [Source](https://github.com/sdcorejs/sdcorejs-angular) · [Changelog](https://github.com/sdcorejs/sdcorejs-angular/blob/main/CHANGELOG.md) · [Issues](https://github.com/sdcorejs/sdcorejs-angular/issues)
@@ -18,18 +18,20 @@ Install the package major that matches your Angular application.
18
18
  | 19.x | `@sdcorejs/angular@^19` | `npm install @sdcorejs/angular@^19 @angular/material@^19 @angular/material-date-fns-adapter@^19` |
19
19
  | 20.x | `@sdcorejs/angular@^20` | `npm install @sdcorejs/angular@^20 @angular/material@^20 @angular/material-date-fns-adapter@^20` |
20
20
  | 21.x | `@sdcorejs/angular@^21` | `npm install @sdcorejs/angular@^21 @angular/material@^21 @angular/material-date-fns-adapter@^21` |
21
+ | 22.x | `@sdcorejs/angular@^22` | `npm install @sdcorejs/angular@^22 @angular/material@^22 @angular/material-date-fns-adapter@^22` |
21
22
 
22
- The package manifests accept Angular 19–21 peers, while releases provide an Angular-aligned package line for each major. The first version number is reserved for Angular compatibility, so read the [changelog](https://github.com/sdcorejs/sdcorejs-angular/blob/main/CHANGELOG.md) for explicitly labeled breaking changes before upgrading.
23
+ The Angular 19–21 packages share one peer range, while the Angular 22 package accepts Angular 22 peers only. The first version number is reserved for Angular compatibility, so read the [changelog](https://github.com/sdcorejs/sdcorejs-angular/blob/main/CHANGELOG.md) for explicitly labeled breaking changes before upgrading. Angular 22 begins at `@sdcorejs/angular@22.2.5`; no earlier Angular 22 package version is implied.
23
24
 
24
25
  ### Peer dependencies
25
26
 
26
27
  The package declares these peers. A standard Angular CLI application already provides all of them except `@angular/material` and `@angular/material-date-fns-adapter`, which is why only those two appear in the install commands above.
27
28
 
28
- | Peer | Range |
29
- | --- | --- |
30
- | `@angular/animations` · `@angular/cdk` · `@angular/common` · `@angular/core` · `@angular/forms` · `@angular/platform-browser` · `@angular/router` | `^19.0.0 \|\| ^20.0.0 \|\| ^21.0.0` |
31
- | `@angular/material` · `@angular/material-date-fns-adapter` | `^19.0.0 \|\| ^20.0.0 \|\| ^21.0.0` |
32
- | `rxjs` | `^7.8.0` |
29
+ | Package line | Peer | Range |
30
+ | --- | --- | --- |
31
+ | `@sdcorejs/angular@^19`, `@sdcorejs/angular@^20`, `@sdcorejs/angular@^21` | `@angular/animations` · `@angular/cdk` · `@angular/common` · `@angular/core` · `@angular/forms` · `@angular/platform-browser` · `@angular/router` | `^19.0.0 \|\| ^20.0.0 \|\| ^21.0.0` |
32
+ | `@sdcorejs/angular@^19`, `@sdcorejs/angular@^20`, `@sdcorejs/angular@^21` | `@angular/material` · `@angular/material-date-fns-adapter` | `^19.0.0 \|\| ^20.0.0 \|\| ^21.0.0` |
33
+ | `@sdcorejs/angular@^22` | All Angular/CDK/Material peers listed above | `^22.0.0` |
34
+ | All maintained lines | `rxjs` | `^7.8.0` |
33
35
 
34
36
  ## Installation and setup
35
37
 
@@ -190,7 +192,7 @@ export const appConfig: ApplicationConfig = {
190
192
 
191
193
  ## Versioning
192
194
 
193
- - Use `@sdcorejs/angular@^19`, `@^20`, or `@^21` to match the application's Angular major.
195
+ - Use `@sdcorejs/angular@^19`, `@sdcorejs/angular@^20`, `@sdcorejs/angular@^21`, or `@sdcorejs/angular@^22` to match the application's Angular major.
194
196
  - Maintained package lines are released from the same feature surface with required Angular-major adaptations.
195
197
  - Consumer-breaking changes and migration notes are recorded in the [changelog](https://github.com/sdcorejs/sdcorejs-angular/blob/main/CHANGELOG.md).
196
198
  - Version-pinned reference docs remain available under `https://sdcorejs.github.io/sdcorejs-angular/docs/<package-version>/`.
@@ -0,0 +1,174 @@
1
+ import * as i0 from '@angular/core';
2
+ import { model, input, booleanAttribute, output, computed, ChangeDetectionStrategy, Component, inject, ElementRef, signal } from '@angular/core';
3
+ import { Subject, Subscription } from 'rxjs';
4
+ import { throttleTime, filter } from 'rxjs/operators';
5
+
6
+ const SD_CARD_DEFAULT_COLOR = 'primary';
7
+
8
+ /** Owns single or multiple selection state for descendant `SdCard` instances. */
9
+ class SdCardGroup {
10
+ /** Selected value, selected values, or `null` when there is no selection. */
11
+ model = model(null, ...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
12
+ /** Whether more than one card can be selected. Bare attributes coerce to `true`. */
13
+ multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
14
+ /** Whether every descendant card is effectively disabled. */
15
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
16
+ /** Stable suffix used by the Core UI inspector and end-to-end selectors. */
17
+ autoId = input(undefined, ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
18
+ /** Default semantic color inherited by descendant cards. */
19
+ color = input(SD_CARD_DEFAULT_COLOR, { ...(ngDevMode ? { debugName: "color" } : /* istanbul ignore next */ {}), transform: value => value || SD_CARD_DEFAULT_COLOR });
20
+ /** Equality used for both selection lookup and immutable removal. */
21
+ compareWith = input(Object.is, ...(ngDevMode ? [{ debugName: "compareWith" }] : /* istanbul ignore next */ []));
22
+ /** Emits only after an accepted user activation changes `model`. */
23
+ sdChange = output();
24
+ resolvedAutoId = computed(() => (this.autoId() ? `components-card-group-${this.autoId()}` : undefined), ...(ngDevMode ? [{ debugName: "resolvedAutoId" }] : /* istanbul ignore next */ []));
25
+ /** Returns whether `value` is selected under the current mode and comparator. */
26
+ isSelected(value) {
27
+ const currentModel = this.model();
28
+ const compareWith = this.compareWith();
29
+ if (this.multiple()) {
30
+ return Array.isArray(currentModel) && currentModel.some(modelValue => compareWith(modelValue, value));
31
+ }
32
+ return currentModel !== null && !Array.isArray(currentModel) && compareWith(currentModel, value);
33
+ }
34
+ /** Applies one accepted card activation and emits the resulting model when it changes. */
35
+ toggle(value) {
36
+ if (this.disabled())
37
+ return;
38
+ const currentModel = this.model();
39
+ const compareWith = this.compareWith();
40
+ let nextModel;
41
+ if (this.multiple()) {
42
+ // why: malformed external values stay untouched until interaction; the next user action
43
+ // normalizes them without introducing an extra, synthetic change event.
44
+ const currentValues = Array.isArray(currentModel) ? currentModel : [];
45
+ const isAlreadySelected = currentValues.some(modelValue => compareWith(modelValue, value));
46
+ nextModel = isAlreadySelected ? currentValues.filter(modelValue => !compareWith(modelValue, value)) : [...currentValues, value];
47
+ }
48
+ else {
49
+ const isAlreadySelected = currentModel !== null && !Array.isArray(currentModel) && compareWith(currentModel, value);
50
+ nextModel = isAlreadySelected ? null : value;
51
+ }
52
+ if (Object.is(currentModel, nextModel))
53
+ return;
54
+ this.model.set(nextModel);
55
+ this.sdChange.emit(nextModel);
56
+ }
57
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdCardGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
58
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: SdCardGroup, isStandalone: true, selector: "sd-card-group", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange", sdChange: "sdChange" }, host: { attributes: { "role": "group" }, properties: { "class.sd-disabled": "disabled()", "attr.aria-disabled": "disabled() ? \"true\" : \"false\"", "attr.data-autoid": "resolvedAutoId()", "attr.data-disabled": "disabled() ? \"true\" : \"false\"" } }, ngImport: i0, template: "<ng-content />\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
59
+ }
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdCardGroup, decorators: [{
61
+ type: Component,
62
+ args: [{ selector: 'sd-card-group', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
63
+ role: 'group',
64
+ '[class.sd-disabled]': 'disabled()',
65
+ '[attr.aria-disabled]': 'disabled() ? "true" : "false"',
66
+ '[attr.data-autoid]': 'resolvedAutoId()',
67
+ '[attr.data-disabled]': 'disabled() ? "true" : "false"',
68
+ }, template: "<ng-content />\n" }]
69
+ }], propDecorators: { model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], compareWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareWith", required: false }] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }] } });
70
+
71
+ /** Selectable card shell that projects arbitrary consumer content and can also operate standalone. */
72
+ class SdCard {
73
+ #elementRef = inject(ElementRef);
74
+ // why: Angular DI erases generic parameters; the card value supplies the matching
75
+ // compile-time type while the runtime token must remain the concrete nearest group.
76
+ #group = inject(SdCardGroup, { optional: true });
77
+ #standaloneSelected = signal(false, ...(ngDevMode ? [{ debugName: "#standaloneSelected" }] : /* istanbul ignore next */ []));
78
+ #clickSubject = new Subject();
79
+ #subscription = new Subscription();
80
+ /** Required non-null value used by the nearest group selection model. */
81
+ value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
82
+ /** Whether this card is disabled independently of its group. */
83
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
84
+ /** Stable suffix used by the Core UI inspector and end-to-end selectors. */
85
+ autoId = input(undefined, ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
86
+ /** Optional semantic color override; otherwise the nearest group or Core UI default is used. */
87
+ color = input(undefined, { ...(ngDevMode ? { debugName: "color" } : /* istanbul ignore next */ {}), transform: value => value || undefined });
88
+ /** Emits the accepted native `Event` after selection state has been updated. */
89
+ click = output();
90
+ /** Read-only reactive selection state; grouped cards derive it exclusively from the group model. */
91
+ selected = computed(() => (this.#group ? this.#group.isSelected(this.value()) : this.#standaloneSelected()), ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
92
+ effectiveDisabled = computed(() => this.disabled() || (this.#group?.disabled() ?? false), ...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
93
+ effectiveColor = computed(() => this.color() ?? this.#group?.color() ?? SD_CARD_DEFAULT_COLOR, ...(ngDevMode ? [{ debugName: "effectiveColor" }] : /* istanbul ignore next */ []));
94
+ resolvedAutoId = computed(() => (this.autoId() ? `components-card-${this.autoId()}` : undefined), ...(ngDevMode ? [{ debugName: "resolvedAutoId" }] : /* istanbul ignore next */ []));
95
+ #captureClickListener = (event) => {
96
+ if (!this.effectiveDisabled())
97
+ return;
98
+ event.preventDefault();
99
+ event.stopPropagation();
100
+ event.stopImmediatePropagation();
101
+ };
102
+ #bubbleClickListener = (event) => {
103
+ // why: the host has a custom output named `click`; stopImmediatePropagation prevents Angular
104
+ // consumers from receiving this native event as well as the explicit output.
105
+ event.stopPropagation();
106
+ event.stopImmediatePropagation();
107
+ if (this.effectiveDisabled())
108
+ return;
109
+ this.#clickSubject.next(event);
110
+ };
111
+ constructor() {
112
+ const element = this.#elementRef.nativeElement;
113
+ element.addEventListener('click', this.#captureClickListener, { capture: true });
114
+ element.addEventListener('click', this.#bubbleClickListener);
115
+ }
116
+ ngOnInit() {
117
+ this.#subscription.add(this.#clickSubject
118
+ .pipe(throttleTime(300, undefined, { leading: true, trailing: false }), filter(() => !this.effectiveDisabled()))
119
+ .subscribe(event => {
120
+ // why: consumers must observe the new selected/model state from their click handler,
121
+ // and grouped cards must deliver sdChange before the card click output.
122
+ if (this.#group) {
123
+ this.#group.toggle(this.value());
124
+ }
125
+ else {
126
+ this.#standaloneSelected.update(selected => !selected);
127
+ }
128
+ this.click.emit(event);
129
+ }));
130
+ }
131
+ onKeydown(event) {
132
+ if (this.effectiveDisabled() || (event.key !== 'Enter' && event.key !== ' '))
133
+ return;
134
+ event.preventDefault();
135
+ event.stopPropagation();
136
+ this.#elementRef.nativeElement.click();
137
+ }
138
+ ngOnDestroy() {
139
+ const element = this.#elementRef.nativeElement;
140
+ element.removeEventListener('click', this.#captureClickListener, { capture: true });
141
+ element.removeEventListener('click', this.#bubbleClickListener);
142
+ this.#subscription.unsubscribe();
143
+ }
144
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
145
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: SdCard, isStandalone: true, selector: "sd-card", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { click: "click" }, host: { attributes: { "role": "button" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.tabindex": "effectiveDisabled() ? -1 : 0", "attr.aria-pressed": "selected() ? \"true\" : \"false\"", "attr.aria-disabled": "effectiveDisabled() ? \"true\" : \"false\"", "attr.data-autoid": "resolvedAutoId()", "attr.data-selected": "selected() ? \"true\" : \"false\"", "attr.data-disabled": "effectiveDisabled() ? \"true\" : \"false\"", "class.sd-selected": "selected()", "class.sd-disabled": "effectiveDisabled()", "class.sd-c-primary": "effectiveColor() === \"primary\"", "class.sd-c-secondary": "effectiveColor() === \"secondary\"", "class.sd-c-info": "effectiveColor() === \"info\"", "class.sd-c-success": "effectiveColor() === \"success\"", "class.sd-c-warning": "effectiveColor() === \"warning\"", "class.sd-c-error": "effectiveColor() === \"error\"" } }, exportAs: ["sdCard"], ngImport: i0, template: "<ng-content />\n", styles: [".text-primary{color:var(--sd-primary)!important}.bg-primary{background:var(--sd-primary)!important}.border-primary{border-color:var(--sd-primary)!important}.text-primary-light{color:var(--sd-primary-light)!important}.bg-primary-light{background:var(--sd-primary-light)!important}.border-primary-light{border-color:var(--sd-primary-light)!important}.text-primary-dark{color:var(--sd-primary-dark)!important}.bg-primary-dark{background:var(--sd-primary-dark)!important}.border-primary-dark{border-color:var(--sd-primary-dark)!important}.text-primary-contrast{color:var(--sd-primary-contrast)!important}.bg-primary-contrast{background:var(--sd-primary-contrast)!important}.border-primary-contrast{border-color:var(--sd-primary-contrast)!important}.text-secondary{color:var(--sd-secondary)!important}.bg-secondary{background:var(--sd-secondary)!important}.border-secondary{border-color:var(--sd-secondary)!important}.text-secondary-light{color:var(--sd-secondary-light)!important}.bg-secondary-light{background:var(--sd-secondary-light)!important}.border-secondary-light{border-color:var(--sd-secondary-light)!important}.text-secondary-dark{color:var(--sd-secondary-dark)!important}.bg-secondary-dark{background:var(--sd-secondary-dark)!important}.border-secondary-dark{border-color:var(--sd-secondary-dark)!important}.text-secondary-contrast{color:var(--sd-secondary-contrast)!important}.bg-secondary-contrast{background:var(--sd-secondary-contrast)!important}.border-secondary-contrast{border-color:var(--sd-secondary-contrast)!important}.text-info{color:var(--sd-info)!important}.bg-info{background:var(--sd-info)!important}.border-info{border-color:var(--sd-info)!important}.text-info-light{color:var(--sd-info-light)!important}.bg-info-light{background:var(--sd-info-light)!important}.border-info-light{border-color:var(--sd-info-light)!important}.text-info-dark{color:var(--sd-info-dark)!important}.bg-info-dark{background:var(--sd-info-dark)!important}.border-info-dark{border-color:var(--sd-info-dark)!important}.text-info-contrast{color:var(--sd-info-contrast)!important}.bg-info-contrast{background:var(--sd-info-contrast)!important}.border-info-contrast{border-color:var(--sd-info-contrast)!important}.text-success{color:var(--sd-success)!important}.bg-success{background:var(--sd-success)!important}.border-success{border-color:var(--sd-success)!important}.text-success-light{color:var(--sd-success-light)!important}.bg-success-light{background:var(--sd-success-light)!important}.border-success-light{border-color:var(--sd-success-light)!important}.text-success-dark{color:var(--sd-success-dark)!important}.bg-success-dark{background:var(--sd-success-dark)!important}.border-success-dark{border-color:var(--sd-success-dark)!important}.text-success-contrast{color:var(--sd-success-contrast)!important}.bg-success-contrast{background:var(--sd-success-contrast)!important}.border-success-contrast{border-color:var(--sd-success-contrast)!important}.text-warning{color:var(--sd-warning)!important}.bg-warning{background:var(--sd-warning)!important}.border-warning{border-color:var(--sd-warning)!important}.text-warning-light{color:var(--sd-warning-light)!important}.bg-warning-light{background:var(--sd-warning-light)!important}.border-warning-light{border-color:var(--sd-warning-light)!important}.text-warning-dark{color:var(--sd-warning-dark)!important}.bg-warning-dark{background:var(--sd-warning-dark)!important}.border-warning-dark{border-color:var(--sd-warning-dark)!important}.text-warning-contrast{color:var(--sd-warning-contrast)!important}.bg-warning-contrast{background:var(--sd-warning-contrast)!important}.border-warning-contrast{border-color:var(--sd-warning-contrast)!important}.text-error{color:var(--sd-error)!important}.bg-error{background:var(--sd-error)!important}.border-error{border-color:var(--sd-error)!important}.text-error-light{color:var(--sd-error-light)!important}.bg-error-light{background:var(--sd-error-light)!important}.border-error-light{border-color:var(--sd-error-light)!important}.text-error-dark{color:var(--sd-error-dark)!important}.bg-error-dark{background:var(--sd-error-dark)!important}.border-error-dark{border-color:var(--sd-error-dark)!important}.text-error-contrast{color:var(--sd-error-contrast)!important}.bg-error-contrast{background:var(--sd-error-contrast)!important}.border-error-contrast{border-color:var(--sd-error-contrast)!important}.text-surface{color:var(--sd-surface)!important}.bg-surface{background:var(--sd-surface)!important}.border-surface{border-color:var(--sd-surface)!important}.text-surface-muted{color:var(--sd-surface-muted)!important}.bg-surface-muted{background:var(--sd-surface-muted)!important}.border-surface-muted{border-color:var(--sd-surface-muted)!important}.text-text{color:var(--sd-text)!important}.bg-text{background:var(--sd-text)!important}.border-text{border-color:var(--sd-text)!important}.text-text-secondary{color:var(--sd-text-secondary)!important}.bg-text-secondary{background:var(--sd-text-secondary)!important}.border-text-secondary{border-color:var(--sd-text-secondary)!important}.text-text-muted{color:var(--sd-text-muted)!important}.bg-text-muted{background:var(--sd-text-muted)!important}.border-text-muted{border-color:var(--sd-text-muted)!important}.text-border{color:var(--sd-border)!important}.bg-border{background:var(--sd-border)!important}.border-border{border-color:var(--sd-border)!important}.text-border-strong{color:var(--sd-border-strong)!important}.bg-border-strong{background:var(--sd-border-strong)!important}.border-border-strong{border-color:var(--sd-border-strong)!important}.text-disabled-bg{color:var(--sd-disabled-bg)!important}.bg-disabled-bg{background:var(--sd-disabled-bg)!important}.border-disabled-bg{border-color:var(--sd-disabled-bg)!important}.text-disabled-text{color:var(--sd-disabled-text)!important}.bg-disabled-text{background:var(--sd-disabled-text)!important}.border-disabled-text{border-color:var(--sd-disabled-text)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.border-white{border-color:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.border-black{border-color:#000!important}.text-secondary{color:var(--sd-text-secondary)!important}.text-muted{color:var(--sd-text-muted)!important}.text-body{color:var(--sd-text)!important}.bg-muted{background:var(--sd-surface-muted)!important}:host{--sd-card-accent: var(--sd-primary);--sd-card-accent-light: var(--sd-primary-light);--sd-card-accent-dark: var(--sd-primary-dark);display:block;box-sizing:border-box;border:1px solid var(--sd-border);border-radius:8px;padding:16px;background:var(--sd-surface);color:var(--sd-text);cursor:pointer;outline:none;transition:background-color .12s ease,border-color .12s ease,box-shadow .12s ease,transform 80ms ease;-webkit-user-select:none;user-select:none}:host(.sd-c-primary){--sd-card-accent: var(--sd-primary);--sd-card-accent-light: var(--sd-primary-light);--sd-card-accent-dark: var(--sd-primary-dark)}:host(.sd-c-secondary){--sd-card-accent: var(--sd-secondary);--sd-card-accent-light: var(--sd-secondary-light);--sd-card-accent-dark: var(--sd-secondary-dark)}:host(.sd-c-info){--sd-card-accent: var(--sd-info);--sd-card-accent-light: var(--sd-info-light);--sd-card-accent-dark: var(--sd-info-dark)}:host(.sd-c-success){--sd-card-accent: var(--sd-success);--sd-card-accent-light: var(--sd-success-light);--sd-card-accent-dark: var(--sd-success-dark)}:host(.sd-c-warning){--sd-card-accent: var(--sd-warning);--sd-card-accent-light: var(--sd-warning-light);--sd-card-accent-dark: var(--sd-warning-dark)}:host(.sd-c-error){--sd-card-accent: var(--sd-error);--sd-card-accent-light: var(--sd-error-light);--sd-card-accent-dark: var(--sd-error-dark)}:host(:not(.sd-disabled):hover){border-color:color-mix(in srgb,var(--sd-card-accent) 45%,var(--sd-border));background:color-mix(in srgb,var(--sd-card-accent-light) 35%,var(--sd-surface))}:host(:not(.sd-disabled):active){border-color:var(--sd-card-accent-dark);background:color-mix(in srgb,var(--sd-card-accent-light) 55%,var(--sd-surface));transform:translateY(1px)}:host(.sd-selected){border-color:var(--sd-card-accent);background:var(--sd-card-accent-light);box-shadow:inset 0 0 0 1px var(--sd-card-accent)}:host(.sd-selected:not(.sd-disabled):hover){border-color:var(--sd-card-accent-dark);background:color-mix(in srgb,var(--sd-card-accent) 14%,var(--sd-card-accent-light))}:host(:focus-visible){border-color:var(--sd-card-accent);box-shadow:0 0 0 2px var(--sd-surface),0 0 0 4px var(--sd-card-accent)}:host(.sd-disabled){border-color:var(--sd-border);background:var(--sd-disabled-bg);color:var(--sd-disabled-text);cursor:not-allowed}:host(.sd-selected.sd-disabled){border-color:color-mix(in srgb,var(--sd-card-accent) 45%,var(--sd-border));background:color-mix(in srgb,var(--sd-card-accent-light) 45%,var(--sd-disabled-bg));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-card-accent) 35%,transparent)}@media(prefers-reduced-motion:reduce){:host{transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
146
+ }
147
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdCard, decorators: [{
148
+ type: Component,
149
+ args: [{ selector: 'sd-card', exportAs: 'sdCard', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
150
+ role: 'button',
151
+ '[attr.tabindex]': 'effectiveDisabled() ? -1 : 0',
152
+ '[attr.aria-pressed]': 'selected() ? "true" : "false"',
153
+ '[attr.aria-disabled]': 'effectiveDisabled() ? "true" : "false"',
154
+ '[attr.data-autoid]': 'resolvedAutoId()',
155
+ '[attr.data-selected]': 'selected() ? "true" : "false"',
156
+ '[attr.data-disabled]': 'effectiveDisabled() ? "true" : "false"',
157
+ '[class.sd-selected]': 'selected()',
158
+ '[class.sd-disabled]': 'effectiveDisabled()',
159
+ '[class.sd-c-primary]': 'effectiveColor() === "primary"',
160
+ '[class.sd-c-secondary]': 'effectiveColor() === "secondary"',
161
+ '[class.sd-c-info]': 'effectiveColor() === "info"',
162
+ '[class.sd-c-success]': 'effectiveColor() === "success"',
163
+ '[class.sd-c-warning]': 'effectiveColor() === "warning"',
164
+ '[class.sd-c-error]': 'effectiveColor() === "error"',
165
+ '(keydown)': 'onKeydown($event)',
166
+ }, template: "<ng-content />\n", styles: [".text-primary{color:var(--sd-primary)!important}.bg-primary{background:var(--sd-primary)!important}.border-primary{border-color:var(--sd-primary)!important}.text-primary-light{color:var(--sd-primary-light)!important}.bg-primary-light{background:var(--sd-primary-light)!important}.border-primary-light{border-color:var(--sd-primary-light)!important}.text-primary-dark{color:var(--sd-primary-dark)!important}.bg-primary-dark{background:var(--sd-primary-dark)!important}.border-primary-dark{border-color:var(--sd-primary-dark)!important}.text-primary-contrast{color:var(--sd-primary-contrast)!important}.bg-primary-contrast{background:var(--sd-primary-contrast)!important}.border-primary-contrast{border-color:var(--sd-primary-contrast)!important}.text-secondary{color:var(--sd-secondary)!important}.bg-secondary{background:var(--sd-secondary)!important}.border-secondary{border-color:var(--sd-secondary)!important}.text-secondary-light{color:var(--sd-secondary-light)!important}.bg-secondary-light{background:var(--sd-secondary-light)!important}.border-secondary-light{border-color:var(--sd-secondary-light)!important}.text-secondary-dark{color:var(--sd-secondary-dark)!important}.bg-secondary-dark{background:var(--sd-secondary-dark)!important}.border-secondary-dark{border-color:var(--sd-secondary-dark)!important}.text-secondary-contrast{color:var(--sd-secondary-contrast)!important}.bg-secondary-contrast{background:var(--sd-secondary-contrast)!important}.border-secondary-contrast{border-color:var(--sd-secondary-contrast)!important}.text-info{color:var(--sd-info)!important}.bg-info{background:var(--sd-info)!important}.border-info{border-color:var(--sd-info)!important}.text-info-light{color:var(--sd-info-light)!important}.bg-info-light{background:var(--sd-info-light)!important}.border-info-light{border-color:var(--sd-info-light)!important}.text-info-dark{color:var(--sd-info-dark)!important}.bg-info-dark{background:var(--sd-info-dark)!important}.border-info-dark{border-color:var(--sd-info-dark)!important}.text-info-contrast{color:var(--sd-info-contrast)!important}.bg-info-contrast{background:var(--sd-info-contrast)!important}.border-info-contrast{border-color:var(--sd-info-contrast)!important}.text-success{color:var(--sd-success)!important}.bg-success{background:var(--sd-success)!important}.border-success{border-color:var(--sd-success)!important}.text-success-light{color:var(--sd-success-light)!important}.bg-success-light{background:var(--sd-success-light)!important}.border-success-light{border-color:var(--sd-success-light)!important}.text-success-dark{color:var(--sd-success-dark)!important}.bg-success-dark{background:var(--sd-success-dark)!important}.border-success-dark{border-color:var(--sd-success-dark)!important}.text-success-contrast{color:var(--sd-success-contrast)!important}.bg-success-contrast{background:var(--sd-success-contrast)!important}.border-success-contrast{border-color:var(--sd-success-contrast)!important}.text-warning{color:var(--sd-warning)!important}.bg-warning{background:var(--sd-warning)!important}.border-warning{border-color:var(--sd-warning)!important}.text-warning-light{color:var(--sd-warning-light)!important}.bg-warning-light{background:var(--sd-warning-light)!important}.border-warning-light{border-color:var(--sd-warning-light)!important}.text-warning-dark{color:var(--sd-warning-dark)!important}.bg-warning-dark{background:var(--sd-warning-dark)!important}.border-warning-dark{border-color:var(--sd-warning-dark)!important}.text-warning-contrast{color:var(--sd-warning-contrast)!important}.bg-warning-contrast{background:var(--sd-warning-contrast)!important}.border-warning-contrast{border-color:var(--sd-warning-contrast)!important}.text-error{color:var(--sd-error)!important}.bg-error{background:var(--sd-error)!important}.border-error{border-color:var(--sd-error)!important}.text-error-light{color:var(--sd-error-light)!important}.bg-error-light{background:var(--sd-error-light)!important}.border-error-light{border-color:var(--sd-error-light)!important}.text-error-dark{color:var(--sd-error-dark)!important}.bg-error-dark{background:var(--sd-error-dark)!important}.border-error-dark{border-color:var(--sd-error-dark)!important}.text-error-contrast{color:var(--sd-error-contrast)!important}.bg-error-contrast{background:var(--sd-error-contrast)!important}.border-error-contrast{border-color:var(--sd-error-contrast)!important}.text-surface{color:var(--sd-surface)!important}.bg-surface{background:var(--sd-surface)!important}.border-surface{border-color:var(--sd-surface)!important}.text-surface-muted{color:var(--sd-surface-muted)!important}.bg-surface-muted{background:var(--sd-surface-muted)!important}.border-surface-muted{border-color:var(--sd-surface-muted)!important}.text-text{color:var(--sd-text)!important}.bg-text{background:var(--sd-text)!important}.border-text{border-color:var(--sd-text)!important}.text-text-secondary{color:var(--sd-text-secondary)!important}.bg-text-secondary{background:var(--sd-text-secondary)!important}.border-text-secondary{border-color:var(--sd-text-secondary)!important}.text-text-muted{color:var(--sd-text-muted)!important}.bg-text-muted{background:var(--sd-text-muted)!important}.border-text-muted{border-color:var(--sd-text-muted)!important}.text-border{color:var(--sd-border)!important}.bg-border{background:var(--sd-border)!important}.border-border{border-color:var(--sd-border)!important}.text-border-strong{color:var(--sd-border-strong)!important}.bg-border-strong{background:var(--sd-border-strong)!important}.border-border-strong{border-color:var(--sd-border-strong)!important}.text-disabled-bg{color:var(--sd-disabled-bg)!important}.bg-disabled-bg{background:var(--sd-disabled-bg)!important}.border-disabled-bg{border-color:var(--sd-disabled-bg)!important}.text-disabled-text{color:var(--sd-disabled-text)!important}.bg-disabled-text{background:var(--sd-disabled-text)!important}.border-disabled-text{border-color:var(--sd-disabled-text)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.border-white{border-color:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.border-black{border-color:#000!important}.text-secondary{color:var(--sd-text-secondary)!important}.text-muted{color:var(--sd-text-muted)!important}.text-body{color:var(--sd-text)!important}.bg-muted{background:var(--sd-surface-muted)!important}:host{--sd-card-accent: var(--sd-primary);--sd-card-accent-light: var(--sd-primary-light);--sd-card-accent-dark: var(--sd-primary-dark);display:block;box-sizing:border-box;border:1px solid var(--sd-border);border-radius:8px;padding:16px;background:var(--sd-surface);color:var(--sd-text);cursor:pointer;outline:none;transition:background-color .12s ease,border-color .12s ease,box-shadow .12s ease,transform 80ms ease;-webkit-user-select:none;user-select:none}:host(.sd-c-primary){--sd-card-accent: var(--sd-primary);--sd-card-accent-light: var(--sd-primary-light);--sd-card-accent-dark: var(--sd-primary-dark)}:host(.sd-c-secondary){--sd-card-accent: var(--sd-secondary);--sd-card-accent-light: var(--sd-secondary-light);--sd-card-accent-dark: var(--sd-secondary-dark)}:host(.sd-c-info){--sd-card-accent: var(--sd-info);--sd-card-accent-light: var(--sd-info-light);--sd-card-accent-dark: var(--sd-info-dark)}:host(.sd-c-success){--sd-card-accent: var(--sd-success);--sd-card-accent-light: var(--sd-success-light);--sd-card-accent-dark: var(--sd-success-dark)}:host(.sd-c-warning){--sd-card-accent: var(--sd-warning);--sd-card-accent-light: var(--sd-warning-light);--sd-card-accent-dark: var(--sd-warning-dark)}:host(.sd-c-error){--sd-card-accent: var(--sd-error);--sd-card-accent-light: var(--sd-error-light);--sd-card-accent-dark: var(--sd-error-dark)}:host(:not(.sd-disabled):hover){border-color:color-mix(in srgb,var(--sd-card-accent) 45%,var(--sd-border));background:color-mix(in srgb,var(--sd-card-accent-light) 35%,var(--sd-surface))}:host(:not(.sd-disabled):active){border-color:var(--sd-card-accent-dark);background:color-mix(in srgb,var(--sd-card-accent-light) 55%,var(--sd-surface));transform:translateY(1px)}:host(.sd-selected){border-color:var(--sd-card-accent);background:var(--sd-card-accent-light);box-shadow:inset 0 0 0 1px var(--sd-card-accent)}:host(.sd-selected:not(.sd-disabled):hover){border-color:var(--sd-card-accent-dark);background:color-mix(in srgb,var(--sd-card-accent) 14%,var(--sd-card-accent-light))}:host(:focus-visible){border-color:var(--sd-card-accent);box-shadow:0 0 0 2px var(--sd-surface),0 0 0 4px var(--sd-card-accent)}:host(.sd-disabled){border-color:var(--sd-border);background:var(--sd-disabled-bg);color:var(--sd-disabled-text);cursor:not-allowed}:host(.sd-selected.sd-disabled){border-color:color-mix(in srgb,var(--sd-card-accent) 45%,var(--sd-border));background:color-mix(in srgb,var(--sd-card-accent-light) 45%,var(--sd-disabled-bg));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-card-accent) 35%,transparent)}@media(prefers-reduced-motion:reduce){:host{transition:none}}\n"] }]
167
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], click: [{ type: i0.Output, args: ["click"] }] } });
168
+
169
+ /**
170
+ * Generated bundle index. Do not edit.
171
+ */
172
+
173
+ export { SdCard, SdCardGroup };
174
+ //# sourceMappingURL=sdcorejs-angular-components-card.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdcorejs-angular-components-card.mjs","sources":["../../../projects/sdcorejs-angular/components/card/src/card.constants.ts","../../../projects/sdcorejs-angular/components/card/src/card-group.component.ts","../../../projects/sdcorejs-angular/components/card/src/card-group.component.html","../../../projects/sdcorejs-angular/components/card/src/card.component.ts","../../../projects/sdcorejs-angular/components/card/src/card.component.html","../../../projects/sdcorejs-angular/components/card/sdcorejs-angular-components-card.ts"],"sourcesContent":["import type { Color as SdColor } from '@sdcorejs/utils/models';\n\nexport const SD_CARD_DEFAULT_COLOR: SdColor = 'primary';\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, input, model, output } from '@angular/core';\nimport type { Color as SdColor } from '@sdcorejs/utils/models';\nimport { SD_CARD_DEFAULT_COLOR } from './card.constants';\n\n/** Compares a model item with a card value for selection. */\nexport type SdCardCompareWith<T> = (modelValue: T, cardValue: T) => boolean;\n\n/** Owns single or multiple selection state for descendant `SdCard` instances. */\n@Component({\n selector: 'sd-card-group',\n standalone: true,\n templateUrl: './card-group.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n role: 'group',\n '[class.sd-disabled]': 'disabled()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : \"false\"',\n '[attr.data-autoid]': 'resolvedAutoId()',\n '[attr.data-disabled]': 'disabled() ? \"true\" : \"false\"',\n },\n})\nexport class SdCardGroup<T = unknown> {\n /** Selected value, selected values, or `null` when there is no selection. */\n readonly model = model<T | T[] | null>(null);\n /** Whether more than one card can be selected. Bare attributes coerce to `true`. */\n readonly multiple = input(false, { transform: booleanAttribute });\n /** Whether every descendant card is effectively disabled. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Stable suffix used by the Core UI inspector and end-to-end selectors. */\n readonly autoId = input<string | null | undefined>(undefined);\n /** Default semantic color inherited by descendant cards. */\n readonly color = input<SdColor, SdColor | null | undefined>(SD_CARD_DEFAULT_COLOR, {\n transform: value => value || SD_CARD_DEFAULT_COLOR,\n });\n /** Equality used for both selection lookup and immutable removal. */\n readonly compareWith = input<SdCardCompareWith<T>>(Object.is);\n /** Emits only after an accepted user activation changes `model`. */\n readonly sdChange = output<T | T[] | null>();\n protected readonly resolvedAutoId = computed(() => (this.autoId() ? `components-card-group-${this.autoId()}` : undefined));\n\n /** Returns whether `value` is selected under the current mode and comparator. */\n isSelected(value: T): boolean {\n const currentModel = this.model();\n const compareWith = this.compareWith();\n\n if (this.multiple()) {\n return Array.isArray(currentModel) && currentModel.some(modelValue => compareWith(modelValue, value));\n }\n\n return currentModel !== null && !Array.isArray(currentModel) && compareWith(currentModel, value);\n }\n\n /** Applies one accepted card activation and emits the resulting model when it changes. */\n toggle(value: T): void {\n if (this.disabled()) return;\n\n const currentModel = this.model();\n const compareWith = this.compareWith();\n let nextModel: T | T[] | null;\n\n if (this.multiple()) {\n // why: malformed external values stay untouched until interaction; the next user action\n // normalizes them without introducing an extra, synthetic change event.\n const currentValues = Array.isArray(currentModel) ? currentModel : [];\n const isAlreadySelected = currentValues.some(modelValue => compareWith(modelValue, value));\n nextModel = isAlreadySelected ? currentValues.filter(modelValue => !compareWith(modelValue, value)) : [...currentValues, value];\n } else {\n const isAlreadySelected = currentModel !== null && !Array.isArray(currentModel) && compareWith(currentModel, value);\n nextModel = isAlreadySelected ? null : value;\n }\n\n if (Object.is(currentModel, nextModel)) return;\n\n this.model.set(nextModel);\n this.sdChange.emit(nextModel);\n }\n}\n","<ng-content />\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n OnDestroy,\n OnInit,\n Signal,\n booleanAttribute,\n computed,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport type { Color as SdColor } from '@sdcorejs/utils/models';\nimport { Subject, Subscription } from 'rxjs';\nimport { filter, throttleTime } from 'rxjs/operators';\nimport { SdCardGroup } from './card-group.component';\nimport { SD_CARD_DEFAULT_COLOR } from './card.constants';\n\n@Component({\n selector: 'sd-card',\n exportAs: 'sdCard',\n standalone: true,\n templateUrl: './card.component.html',\n styleUrl: './card.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n role: 'button',\n '[attr.tabindex]': 'effectiveDisabled() ? -1 : 0',\n '[attr.aria-pressed]': 'selected() ? \"true\" : \"false\"',\n '[attr.aria-disabled]': 'effectiveDisabled() ? \"true\" : \"false\"',\n '[attr.data-autoid]': 'resolvedAutoId()',\n '[attr.data-selected]': 'selected() ? \"true\" : \"false\"',\n '[attr.data-disabled]': 'effectiveDisabled() ? \"true\" : \"false\"',\n '[class.sd-selected]': 'selected()',\n '[class.sd-disabled]': 'effectiveDisabled()',\n '[class.sd-c-primary]': 'effectiveColor() === \"primary\"',\n '[class.sd-c-secondary]': 'effectiveColor() === \"secondary\"',\n '[class.sd-c-info]': 'effectiveColor() === \"info\"',\n '[class.sd-c-success]': 'effectiveColor() === \"success\"',\n '[class.sd-c-warning]': 'effectiveColor() === \"warning\"',\n '[class.sd-c-error]': 'effectiveColor() === \"error\"',\n '(keydown)': 'onKeydown($event)',\n },\n})\n/** Selectable card shell that projects arbitrary consumer content and can also operate standalone. */\nexport class SdCard<T = unknown> implements OnInit, OnDestroy {\n readonly #elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n // why: Angular DI erases generic parameters; the card value supplies the matching\n // compile-time type while the runtime token must remain the concrete nearest group.\n readonly #group = inject(SdCardGroup, { optional: true }) as SdCardGroup<NonNullable<T>> | null;\n readonly #standaloneSelected = signal(false);\n readonly #clickSubject = new Subject<Event>();\n readonly #subscription = new Subscription();\n\n /** Required non-null value used by the nearest group selection model. */\n readonly value = input.required<NonNullable<T>>();\n /** Whether this card is disabled independently of its group. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Stable suffix used by the Core UI inspector and end-to-end selectors. */\n readonly autoId = input<string | null | undefined>(undefined);\n /** Optional semantic color override; otherwise the nearest group or Core UI default is used. */\n readonly color = input<SdColor | undefined, SdColor | null | undefined>(undefined, {\n transform: value => value || undefined,\n });\n /** Emits the accepted native `Event` after selection state has been updated. */\n readonly click = output<Event>();\n /** Read-only reactive selection state; grouped cards derive it exclusively from the group model. */\n readonly selected: Signal<boolean> = computed(() => (this.#group ? this.#group.isSelected(this.value()) : this.#standaloneSelected()));\n protected readonly effectiveDisabled = computed(() => this.disabled() || (this.#group?.disabled() ?? false));\n protected readonly effectiveColor = computed(() => this.color() ?? this.#group?.color() ?? SD_CARD_DEFAULT_COLOR);\n protected readonly resolvedAutoId = computed(() => (this.autoId() ? `components-card-${this.autoId()}` : undefined));\n\n readonly #captureClickListener = (event: Event): void => {\n if (!this.effectiveDisabled()) return;\n\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n };\n\n readonly #bubbleClickListener = (event: Event): void => {\n // why: the host has a custom output named `click`; stopImmediatePropagation prevents Angular\n // consumers from receiving this native event as well as the explicit output.\n event.stopPropagation();\n event.stopImmediatePropagation();\n if (this.effectiveDisabled()) return;\n this.#clickSubject.next(event);\n };\n\n constructor() {\n const element = this.#elementRef.nativeElement;\n element.addEventListener('click', this.#captureClickListener, { capture: true });\n element.addEventListener('click', this.#bubbleClickListener);\n }\n\n ngOnInit(): void {\n this.#subscription.add(\n this.#clickSubject\n .pipe(\n throttleTime(300, undefined, { leading: true, trailing: false }),\n filter(() => !this.effectiveDisabled())\n )\n .subscribe(event => {\n // why: consumers must observe the new selected/model state from their click handler,\n // and grouped cards must deliver sdChange before the card click output.\n if (this.#group) {\n this.#group.toggle(this.value());\n } else {\n this.#standaloneSelected.update(selected => !selected);\n }\n\n this.click.emit(event);\n })\n );\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.effectiveDisabled() || (event.key !== 'Enter' && event.key !== ' ')) return;\n\n event.preventDefault();\n event.stopPropagation();\n this.#elementRef.nativeElement.click();\n }\n\n ngOnDestroy(): void {\n const element = this.#elementRef.nativeElement;\n element.removeEventListener('click', this.#captureClickListener, { capture: true });\n element.removeEventListener('click', this.#bubbleClickListener);\n this.#subscription.unsubscribe();\n }\n}\n","<ng-content />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAEO,MAAM,qBAAqB,GAAY,SAAS;;ACKvD;MAca,WAAW,CAAA;;AAEb,IAAA,KAAK,GAAG,KAAK,CAAiB,IAAI,4EAAC;;IAEnC,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAExD,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAExD,IAAA,MAAM,GAAG,KAAK,CAA4B,SAAS,6EAAC;;AAEpD,IAAA,KAAK,GAAG,KAAK,CAAsC,qBAAqB,6EAC/E,SAAS,EAAE,KAAK,IAAI,KAAK,IAAI,qBAAqB,GAClD;;AAEO,IAAA,WAAW,GAAG,KAAK,CAAuB,MAAM,CAAC,EAAE,kFAAC;;IAEpD,QAAQ,GAAG,MAAM,EAAkB;IACzB,cAAc,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG,CAAA,sBAAA,EAAyB,IAAI,CAAC,MAAM,EAAE,CAAA,CAAE,GA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d,wBAAA,iBAAiB,EAAE,8BAA8B;AACjD,wBAAA,qBAAqB,EAAE,+BAA+B;AACtD,wBAAA,sBAAsB,EAAE,wCAAwC;AAChE,wBAAA,oBAAoB,EAAE,kBAAkB;AACxC,wBAAA,sBAAsB,EAAE,+BAA+B;AACvD,wBAAA,sBAAsB,EAAE,wCAAwC;AAChE,wBAAA,qBAAqB,EAAE,YAAY;AACnC,wBAAA,qBAAqB,EAAE,qBAAqB;AAC5C,wBAAA,sBAAsB,EAAE,gCAAgC;AACxD,wBAAA,wBAAwB,EAAE,kCAAkC;AAC5D,wBAAA,mBAAmB,EAAE,6BAA6B;AAClD,wBAAA,sBAAsB,EAAE,gCAAgC;AACxD,wBAAA,sBAAsB,EAAE,gCAAgC;AACxD,wBAAA,oBAAoB,EAAE,8BAA8B;AACpD,wBAAA,WAAW,EAAE,mBAAmB;AACjC,qBAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,2zRAAA,CAAA,EAAA;;;AE5CH;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { CommonModule } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { signal, viewChild, input, computed, booleanAttribute, output, inject, DestroyRef, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
+ import { signal, viewChild, input, computed, booleanAttribute, output, inject, DestroyRef, effect, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
4
4
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
5
  import { MatBottomSheet, MatBottomSheetModule } from '@angular/material/bottom-sheet';
6
6
  import { MatButtonModule } from '@angular/material/button';
@@ -9,8 +9,10 @@ import { MatDividerModule } from '@angular/material/divider';
9
9
  import { BrowserUtilities } from '@sdcorejs/utils/fns';
10
10
  import { SdIcon } from '@sdcorejs/angular/modules/icon';
11
11
 
12
+ let nextModalTitleId = 0;
12
13
  class SdModal {
13
14
  static index = signal(0, ...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
15
+ titleId = `sd-modal-title-${nextModalTitleId++}`;
14
16
  templateRef = viewChild.required('templateRef');
15
17
  modal = viewChild('modal', ...(ngDevMode ? [{ debugName: "modal" }] : /* istanbul ignore next */ []));
16
18
  // autoId prefix `modal-`. Lưu ý: footer/body buttons render qua <ng-content> nên consumer phải
@@ -43,6 +45,15 @@ class SdModal {
43
45
  #destroyRef = inject(DestroyRef);
44
46
  constructor() {
45
47
  this.#isMobile = BrowserUtilities.isMobile();
48
+ // BottomSheetConfig has no ariaLabelledBy; bind its real container to the live heading.
49
+ effect(() => {
50
+ const title = this.title();
51
+ const container = this.modal()?.nativeElement?.closest('[role="dialog"]');
52
+ if (title)
53
+ container?.setAttribute('aria-labelledby', this.titleId);
54
+ else
55
+ container?.removeAttribute('aria-labelledby');
56
+ });
46
57
  }
47
58
  // why: PHẢI là ngOnDestroy, KHÔNG phải #destroyRef.onDestroy. Angular chạy executeOnDestroys
48
59
  // (ngOnDestroy) TRƯỚC processCleanups (mọi callback DestroyRef.onDestroy). `sdClosed = output()`
@@ -97,6 +108,7 @@ class SdModal {
97
108
  if ((!this.view() && this.#isMobile) || this.view() === 'bottom-sheet') {
98
109
  this.#bottomSheetRef = this.#bottomSheet.open(this.templateRef(), {
99
110
  panelClass: this.#resolvePanelClass('sd-modal-bottom-sheet-panel'),
111
+ ariaLabel: this.title() || undefined,
100
112
  disableClose: this.disableBackdropClose() || !!this.beforeClose(),
101
113
  });
102
114
  this.#bindGuardedDismiss(this.#bottomSheetRef);
@@ -107,6 +119,7 @@ class SdModal {
107
119
  width: this.#resolvedWidth,
108
120
  maxWidth: this.#resolvedWidth,
109
121
  panelClass: this.#resolvePanelClass('sd-modal-panel'),
122
+ ariaLabelledBy: this.title() ? this.titleId : undefined,
110
123
  disableClose: this.disableBackdropClose() || !!this.beforeClose(),
111
124
  });
112
125
  this.#bindGuardedDismiss(this.#dialogRef);
@@ -187,11 +200,11 @@ class SdModal {
187
200
  return classes;
188
201
  }
189
202
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdModal, deps: [], target: i0.ɵɵFactoryTarget.Component });
190
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdModal, isStandalone: true, selector: "sd-modal", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, modalClass: { classPropertyName: "modalClass", publicName: "modalClass", isSignal: true, isRequired: false, transformFunction: null }, lazyLoadContent: { classPropertyName: "lazyLoadContent", publicName: "lazyLoadContent", isSignal: true, isRequired: false, transformFunction: null }, hideClose: { classPropertyName: "hideClose", publicName: "hideClose", isSignal: true, isRequired: false, transformFunction: null }, disableBackdropClose: { classPropertyName: "disableBackdropClose", publicName: "disableBackdropClose", isSignal: true, isRequired: false, transformFunction: null }, beforeClose: { classPropertyName: "beforeClose", publicName: "beforeClose", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdClosed: "sdClosed", sdCloseError: "sdCloseError" }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }, { propertyName: "modal", first: true, predicate: ["modal"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #templateRef>\n <div\n class=\"sd-modal-root\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-opened]=\"dataOpened()\">\n @if (!lazyLoadContent() || alreadyOpened()) {\n @if (title()) {\n <div class=\"sd-modal-header\">\n <div class=\"sd-modal-header-left\">\n <ng-content select=\"[sdHeaderLeft]\">\n <div class=\"sd-modal-title T18M\">{{ title() }}</div>\n </ng-content>\n </div>\n <div class=\"sd-modal-header-right\">\n <ng-content select=\"[sdHeaderRight]\"></ng-content>\n @if (!hideClose()) {\n <button\n type=\"button\"\n class=\"sd-modal-close-btn\"\n aria-label=\"Close\"\n (click)=\"close()\"\n [attr.data-autoId]=\"closeButtonAutoId()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"sd-modal-body\">\n <ng-content></ng-content>\n </div>\n <div class=\"sd-modal-footer\" #footer>\n <div class=\"sd-modal-footer-left\"><ng-content select=\"[sdFooterLeft]\"></ng-content></div>\n <div class=\"sd-modal-footer-right\"><ng-content select=\"[sdFooterRight]\"></ng-content></div>\n </div>\n }\n </div>\n</ng-template>\n", styles: [".sd-modal-root button:focus{outline:none!important}.sd-modal-root button:focus-visible{outline:2px solid var(--sd-primary, #005cbb)!important;outline-offset:2px}.sd-modal-panel,.sd-modal-bottom-sheet-panel{--sd-modal-radius: var(--sd-overlay-radius, 24px);--sd-modal-bottom-sheet-radius: var(--sd-overlay-bottom-sheet-radius, 28px);--sd-modal-surface: var(--sd-surface, #fff);--sd-modal-border: var(--sd-border, #dde0e5);--sd-modal-shadow: 0 6px 18px rgba(15, 23, 42, .18), 0 1px 3px rgba(15, 23, 42, .12)}.sd-modal-panel .mat-mdc-dialog-container{--mdc-dialog-container-shape: var(--sd-modal-radius);--mat-dialog-container-shape: var(--sd-modal-radius)}.sd-modal-panel .mat-mdc-dialog-surface,.sd-modal-panel .mdc-dialog__surface,.sd-modal-panel .mat-dialog-container{padding:0!important;border-radius:var(--sd-modal-radius)!important;background:var(--sd-modal-surface);max-height:calc(100vh - 32px);overflow:hidden;box-shadow:var(--sd-modal-shadow)}.sd-modal-panel .mat-dialog-container .mat-dialog-content,.sd-modal-panel .mat-dialog-container .mat-mdc-dialog-content,.sd-modal-panel .mat-mdc-dialog-container .mat-dialog-content,.sd-modal-panel .mat-mdc-dialog-container .mat-mdc-dialog-content{max-height:80vh}.sd-modal-panel .mat-dialog-container .mat-dialog-actions,.sd-modal-panel .mat-dialog-container .mat-mdc-dialog-actions,.sd-modal-panel .mat-mdc-dialog-container .mat-dialog-actions,.sd-modal-panel .mat-mdc-dialog-container .mat-mdc-dialog-actions{min-height:auto;margin-bottom:0;padding:0}.sd-modal-root{display:flex;width:100%;max-height:inherit;flex-direction:column;background:var(--sd-modal-surface, var(--sd-surface, #fff));border-radius:inherit;overflow:hidden}.sd-modal-header{min-height:64px;padding:16px;display:flex;align-items:center;gap:16px}.sd-modal-header-left{display:flex;align-items:center;flex:1 1 auto;min-width:0}.sd-modal-header-right{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:0 0 auto}.sd-modal-title{min-width:0}.sd-modal-body{flex:1 1 auto;min-height:0;width:100%;max-height:80vh;overflow:auto;padding:0}.sd-modal-close-btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;box-sizing:border-box;width:32px;height:32px;margin-left:8px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--sd-text-secondary);line-height:0;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color 80ms ease,color 80ms ease}.sd-modal-close-btn:hover{background:var(--sd-surface-muted);color:var(--sd-text)}.sd-modal-close-btn:active{background:var(--sd-border)}.sd-modal-close-btn:focus{outline:none!important}.sd-modal-close-btn:focus-visible{outline:2px solid var(--sd-primary)!important;outline-offset:2px}.sd-modal-close-btn sd-icon{display:block;width:20px;height:20px;font-size:20px;line-height:20px}.sd-modal-bottom-sheet-panel.mat-bottom-sheet-container,.sd-modal-bottom-sheet-panel.mat-mdc-bottom-sheet-container,.sd-modal-bottom-sheet-panel .mat-bottom-sheet-container,.sd-modal-bottom-sheet-panel .mat-mdc-bottom-sheet-container{padding:0;min-width:100vw;box-sizing:border-box;outline:0;max-height:min(80vh,100vh - 16px);overflow:hidden;border-radius:var(--sd-modal-bottom-sheet-radius) var(--sd-modal-bottom-sheet-radius) 0 0!important;background:var(--sd-modal-surface);box-shadow:var(--sd-modal-shadow);display:flex;flex-direction:column}.sd-modal-footer{min-height:56px;padding:16px;border-top:1px solid var(--sd-modal-border);display:flex;align-items:center;justify-content:space-between;gap:16px}.sd-modal-footer-left,.sd-modal-footer-right{display:flex;align-items:center;gap:8px;min-width:0}.sd-modal-footer-left{flex:1 1 auto}.sd-modal-footer-right{flex:0 0 auto;margin-left:auto;justify-content:flex-end}.sd-modal-footer-left:empty,.sd-modal-footer-right:empty{display:none}.sd-modal-footer:has(.sd-modal-footer-left:empty):has(.sd-modal-footer-right:empty){display:none}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatBottomSheetModule }, { kind: "ngmodule", type: MatDialogModule }, { kind: "ngmodule", type: MatDividerModule }, { kind: "ngmodule", type: MatButtonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
203
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdModal, isStandalone: true, selector: "sd-modal", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, modalClass: { classPropertyName: "modalClass", publicName: "modalClass", isSignal: true, isRequired: false, transformFunction: null }, lazyLoadContent: { classPropertyName: "lazyLoadContent", publicName: "lazyLoadContent", isSignal: true, isRequired: false, transformFunction: null }, hideClose: { classPropertyName: "hideClose", publicName: "hideClose", isSignal: true, isRequired: false, transformFunction: null }, disableBackdropClose: { classPropertyName: "disableBackdropClose", publicName: "disableBackdropClose", isSignal: true, isRequired: false, transformFunction: null }, beforeClose: { classPropertyName: "beforeClose", publicName: "beforeClose", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdClosed: "sdClosed", sdCloseError: "sdCloseError" }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }, { propertyName: "modal", first: true, predicate: ["modal"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #templateRef>\n @let _title = title();\n <div #modal class=\"sd-modal-root\" [attr.data-autoId]=\"autoId()\" [attr.data-opened]=\"dataOpened()\">\n @if (!lazyLoadContent() || alreadyOpened()) {\n @if (_title) {\n <div class=\"sd-modal-header\">\n <div class=\"sd-modal-header-left\" [id]=\"titleId\">\n <ng-content select=\"[sdHeaderLeft]\">\n <div class=\"sd-modal-title T18M\">{{ _title }}</div>\n </ng-content>\n </div>\n <div class=\"sd-modal-header-right\">\n <ng-content select=\"[sdHeaderRight]\"></ng-content>\n @if (!hideClose()) {\n <button\n type=\"button\"\n class=\"sd-modal-close-btn\"\n aria-label=\"Close\"\n (click)=\"close()\"\n [attr.data-autoId]=\"closeButtonAutoId()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"sd-modal-body\">\n <ng-content></ng-content>\n </div>\n <div class=\"sd-modal-footer\" #footer>\n <div class=\"sd-modal-footer-left\"><ng-content select=\"[sdFooterLeft]\"></ng-content></div>\n <div class=\"sd-modal-footer-right\"><ng-content select=\"[sdFooterRight]\"></ng-content></div>\n </div>\n }\n </div>\n</ng-template>\n", styles: [".sd-modal-root button:focus{outline:none!important}.sd-modal-root button:focus-visible{outline:2px solid var(--sd-primary, #005cbb)!important;outline-offset:2px}.sd-modal-panel,.sd-modal-bottom-sheet-panel{--sd-modal-radius: var(--sd-overlay-radius, 24px);--sd-modal-bottom-sheet-radius: var(--sd-overlay-bottom-sheet-radius, 28px);--sd-modal-surface: var(--sd-surface, #fff);--sd-modal-border: var(--sd-border, #dde0e5);--sd-modal-shadow: 0 6px 18px rgba(15, 23, 42, .18), 0 1px 3px rgba(15, 23, 42, .12)}.sd-modal-panel .mat-mdc-dialog-container{--mdc-dialog-container-shape: var(--sd-modal-radius);--mat-dialog-container-shape: var(--sd-modal-radius)}.sd-modal-panel .mat-mdc-dialog-surface,.sd-modal-panel .mdc-dialog__surface,.sd-modal-panel .mat-dialog-container{padding:0!important;border-radius:var(--sd-modal-radius)!important;background:var(--sd-modal-surface);max-height:calc(100vh - 32px);overflow:hidden;box-shadow:var(--sd-modal-shadow)}.sd-modal-panel .mat-dialog-container .mat-dialog-content,.sd-modal-panel .mat-dialog-container .mat-mdc-dialog-content,.sd-modal-panel .mat-mdc-dialog-container .mat-dialog-content,.sd-modal-panel .mat-mdc-dialog-container .mat-mdc-dialog-content{max-height:80vh}.sd-modal-panel .mat-dialog-container .mat-dialog-actions,.sd-modal-panel .mat-dialog-container .mat-mdc-dialog-actions,.sd-modal-panel .mat-mdc-dialog-container .mat-dialog-actions,.sd-modal-panel .mat-mdc-dialog-container .mat-mdc-dialog-actions{min-height:auto;margin-bottom:0;padding:0}.sd-modal-root{display:flex;width:100%;max-height:inherit;flex-direction:column;background:var(--sd-modal-surface, var(--sd-surface, #fff));border-radius:inherit;overflow:hidden}.sd-modal-header{min-height:64px;padding:16px;display:flex;align-items:center;gap:16px}.sd-modal-header-left{display:flex;align-items:center;flex:1 1 auto;min-width:0}.sd-modal-header-right{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:0 0 auto}.sd-modal-title{min-width:0}.sd-modal-body{flex:1 1 auto;min-height:0;width:100%;max-height:80vh;overflow:auto;padding:0}.sd-modal-close-btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;box-sizing:border-box;width:32px;height:32px;margin-left:8px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--sd-text-secondary);line-height:0;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color 80ms ease,color 80ms ease}.sd-modal-close-btn:hover{background:var(--sd-surface-muted);color:var(--sd-text)}.sd-modal-close-btn:active{background:var(--sd-border)}.sd-modal-close-btn:focus{outline:none!important}.sd-modal-close-btn:focus-visible{outline:2px solid var(--sd-primary)!important;outline-offset:2px}.sd-modal-close-btn sd-icon{display:block;width:20px;height:20px;font-size:20px;line-height:20px}.sd-modal-bottom-sheet-panel.mat-bottom-sheet-container,.sd-modal-bottom-sheet-panel.mat-mdc-bottom-sheet-container,.sd-modal-bottom-sheet-panel .mat-bottom-sheet-container,.sd-modal-bottom-sheet-panel .mat-mdc-bottom-sheet-container{padding:0;min-width:100vw;box-sizing:border-box;outline:0;max-height:min(80vh,100vh - 16px);overflow:hidden;border-radius:var(--sd-modal-bottom-sheet-radius) var(--sd-modal-bottom-sheet-radius) 0 0!important;background:var(--sd-modal-surface);box-shadow:var(--sd-modal-shadow);display:flex;flex-direction:column}.sd-modal-footer{min-height:56px;padding:16px;border-top:1px solid var(--sd-modal-border);display:flex;align-items:center;justify-content:space-between;gap:16px}.sd-modal-footer-left,.sd-modal-footer-right{display:flex;align-items:center;gap:8px;min-width:0}.sd-modal-footer-left{flex:1 1 auto}.sd-modal-footer-right{flex:0 0 auto;margin-left:auto;justify-content:flex-end}.sd-modal-footer-left:empty,.sd-modal-footer-right:empty{display:none}.sd-modal-footer:has(.sd-modal-footer-left:empty):has(.sd-modal-footer-right:empty){display:none}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatBottomSheetModule }, { kind: "ngmodule", type: MatDialogModule }, { kind: "ngmodule", type: MatDividerModule }, { kind: "ngmodule", type: MatButtonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
191
204
  }
192
205
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdModal, decorators: [{
193
206
  type: Component,
194
- args: [{ selector: 'sd-modal', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [SdIcon, CommonModule, MatBottomSheetModule, MatDialogModule, MatDividerModule, MatButtonModule], template: "<ng-template #templateRef>\n <div\n class=\"sd-modal-root\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-opened]=\"dataOpened()\">\n @if (!lazyLoadContent() || alreadyOpened()) {\n @if (title()) {\n <div class=\"sd-modal-header\">\n <div class=\"sd-modal-header-left\">\n <ng-content select=\"[sdHeaderLeft]\">\n <div class=\"sd-modal-title T18M\">{{ title() }}</div>\n </ng-content>\n </div>\n <div class=\"sd-modal-header-right\">\n <ng-content select=\"[sdHeaderRight]\"></ng-content>\n @if (!hideClose()) {\n <button\n type=\"button\"\n class=\"sd-modal-close-btn\"\n aria-label=\"Close\"\n (click)=\"close()\"\n [attr.data-autoId]=\"closeButtonAutoId()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"sd-modal-body\">\n <ng-content></ng-content>\n </div>\n <div class=\"sd-modal-footer\" #footer>\n <div class=\"sd-modal-footer-left\"><ng-content select=\"[sdFooterLeft]\"></ng-content></div>\n <div class=\"sd-modal-footer-right\"><ng-content select=\"[sdFooterRight]\"></ng-content></div>\n </div>\n }\n </div>\n</ng-template>\n", styles: [".sd-modal-root button:focus{outline:none!important}.sd-modal-root button:focus-visible{outline:2px solid var(--sd-primary, #005cbb)!important;outline-offset:2px}.sd-modal-panel,.sd-modal-bottom-sheet-panel{--sd-modal-radius: var(--sd-overlay-radius, 24px);--sd-modal-bottom-sheet-radius: var(--sd-overlay-bottom-sheet-radius, 28px);--sd-modal-surface: var(--sd-surface, #fff);--sd-modal-border: var(--sd-border, #dde0e5);--sd-modal-shadow: 0 6px 18px rgba(15, 23, 42, .18), 0 1px 3px rgba(15, 23, 42, .12)}.sd-modal-panel .mat-mdc-dialog-container{--mdc-dialog-container-shape: var(--sd-modal-radius);--mat-dialog-container-shape: var(--sd-modal-radius)}.sd-modal-panel .mat-mdc-dialog-surface,.sd-modal-panel .mdc-dialog__surface,.sd-modal-panel .mat-dialog-container{padding:0!important;border-radius:var(--sd-modal-radius)!important;background:var(--sd-modal-surface);max-height:calc(100vh - 32px);overflow:hidden;box-shadow:var(--sd-modal-shadow)}.sd-modal-panel .mat-dialog-container .mat-dialog-content,.sd-modal-panel .mat-dialog-container .mat-mdc-dialog-content,.sd-modal-panel .mat-mdc-dialog-container .mat-dialog-content,.sd-modal-panel .mat-mdc-dialog-container .mat-mdc-dialog-content{max-height:80vh}.sd-modal-panel .mat-dialog-container .mat-dialog-actions,.sd-modal-panel .mat-dialog-container .mat-mdc-dialog-actions,.sd-modal-panel .mat-mdc-dialog-container .mat-dialog-actions,.sd-modal-panel .mat-mdc-dialog-container .mat-mdc-dialog-actions{min-height:auto;margin-bottom:0;padding:0}.sd-modal-root{display:flex;width:100%;max-height:inherit;flex-direction:column;background:var(--sd-modal-surface, var(--sd-surface, #fff));border-radius:inherit;overflow:hidden}.sd-modal-header{min-height:64px;padding:16px;display:flex;align-items:center;gap:16px}.sd-modal-header-left{display:flex;align-items:center;flex:1 1 auto;min-width:0}.sd-modal-header-right{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:0 0 auto}.sd-modal-title{min-width:0}.sd-modal-body{flex:1 1 auto;min-height:0;width:100%;max-height:80vh;overflow:auto;padding:0}.sd-modal-close-btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;box-sizing:border-box;width:32px;height:32px;margin-left:8px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--sd-text-secondary);line-height:0;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color 80ms ease,color 80ms ease}.sd-modal-close-btn:hover{background:var(--sd-surface-muted);color:var(--sd-text)}.sd-modal-close-btn:active{background:var(--sd-border)}.sd-modal-close-btn:focus{outline:none!important}.sd-modal-close-btn:focus-visible{outline:2px solid var(--sd-primary)!important;outline-offset:2px}.sd-modal-close-btn sd-icon{display:block;width:20px;height:20px;font-size:20px;line-height:20px}.sd-modal-bottom-sheet-panel.mat-bottom-sheet-container,.sd-modal-bottom-sheet-panel.mat-mdc-bottom-sheet-container,.sd-modal-bottom-sheet-panel .mat-bottom-sheet-container,.sd-modal-bottom-sheet-panel .mat-mdc-bottom-sheet-container{padding:0;min-width:100vw;box-sizing:border-box;outline:0;max-height:min(80vh,100vh - 16px);overflow:hidden;border-radius:var(--sd-modal-bottom-sheet-radius) var(--sd-modal-bottom-sheet-radius) 0 0!important;background:var(--sd-modal-surface);box-shadow:var(--sd-modal-shadow);display:flex;flex-direction:column}.sd-modal-footer{min-height:56px;padding:16px;border-top:1px solid var(--sd-modal-border);display:flex;align-items:center;justify-content:space-between;gap:16px}.sd-modal-footer-left,.sd-modal-footer-right{display:flex;align-items:center;gap:8px;min-width:0}.sd-modal-footer-left{flex:1 1 auto}.sd-modal-footer-right{flex:0 0 auto;margin-left:auto;justify-content:flex-end}.sd-modal-footer-left:empty,.sd-modal-footer-right:empty{display:none}.sd-modal-footer:has(.sd-modal-footer-left:empty):has(.sd-modal-footer-right:empty){display:none}\n"] }]
207
+ args: [{ selector: 'sd-modal', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [SdIcon, CommonModule, MatBottomSheetModule, MatDialogModule, MatDividerModule, MatButtonModule], template: "<ng-template #templateRef>\n @let _title = title();\n <div #modal class=\"sd-modal-root\" [attr.data-autoId]=\"autoId()\" [attr.data-opened]=\"dataOpened()\">\n @if (!lazyLoadContent() || alreadyOpened()) {\n @if (_title) {\n <div class=\"sd-modal-header\">\n <div class=\"sd-modal-header-left\" [id]=\"titleId\">\n <ng-content select=\"[sdHeaderLeft]\">\n <div class=\"sd-modal-title T18M\">{{ _title }}</div>\n </ng-content>\n </div>\n <div class=\"sd-modal-header-right\">\n <ng-content select=\"[sdHeaderRight]\"></ng-content>\n @if (!hideClose()) {\n <button\n type=\"button\"\n class=\"sd-modal-close-btn\"\n aria-label=\"Close\"\n (click)=\"close()\"\n [attr.data-autoId]=\"closeButtonAutoId()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"sd-modal-body\">\n <ng-content></ng-content>\n </div>\n <div class=\"sd-modal-footer\" #footer>\n <div class=\"sd-modal-footer-left\"><ng-content select=\"[sdFooterLeft]\"></ng-content></div>\n <div class=\"sd-modal-footer-right\"><ng-content select=\"[sdFooterRight]\"></ng-content></div>\n </div>\n }\n </div>\n</ng-template>\n", styles: [".sd-modal-root button:focus{outline:none!important}.sd-modal-root button:focus-visible{outline:2px solid var(--sd-primary, #005cbb)!important;outline-offset:2px}.sd-modal-panel,.sd-modal-bottom-sheet-panel{--sd-modal-radius: var(--sd-overlay-radius, 24px);--sd-modal-bottom-sheet-radius: var(--sd-overlay-bottom-sheet-radius, 28px);--sd-modal-surface: var(--sd-surface, #fff);--sd-modal-border: var(--sd-border, #dde0e5);--sd-modal-shadow: 0 6px 18px rgba(15, 23, 42, .18), 0 1px 3px rgba(15, 23, 42, .12)}.sd-modal-panel .mat-mdc-dialog-container{--mdc-dialog-container-shape: var(--sd-modal-radius);--mat-dialog-container-shape: var(--sd-modal-radius)}.sd-modal-panel .mat-mdc-dialog-surface,.sd-modal-panel .mdc-dialog__surface,.sd-modal-panel .mat-dialog-container{padding:0!important;border-radius:var(--sd-modal-radius)!important;background:var(--sd-modal-surface);max-height:calc(100vh - 32px);overflow:hidden;box-shadow:var(--sd-modal-shadow)}.sd-modal-panel .mat-dialog-container .mat-dialog-content,.sd-modal-panel .mat-dialog-container .mat-mdc-dialog-content,.sd-modal-panel .mat-mdc-dialog-container .mat-dialog-content,.sd-modal-panel .mat-mdc-dialog-container .mat-mdc-dialog-content{max-height:80vh}.sd-modal-panel .mat-dialog-container .mat-dialog-actions,.sd-modal-panel .mat-dialog-container .mat-mdc-dialog-actions,.sd-modal-panel .mat-mdc-dialog-container .mat-dialog-actions,.sd-modal-panel .mat-mdc-dialog-container .mat-mdc-dialog-actions{min-height:auto;margin-bottom:0;padding:0}.sd-modal-root{display:flex;width:100%;max-height:inherit;flex-direction:column;background:var(--sd-modal-surface, var(--sd-surface, #fff));border-radius:inherit;overflow:hidden}.sd-modal-header{min-height:64px;padding:16px;display:flex;align-items:center;gap:16px}.sd-modal-header-left{display:flex;align-items:center;flex:1 1 auto;min-width:0}.sd-modal-header-right{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:0 0 auto}.sd-modal-title{min-width:0}.sd-modal-body{flex:1 1 auto;min-height:0;width:100%;max-height:80vh;overflow:auto;padding:0}.sd-modal-close-btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;box-sizing:border-box;width:32px;height:32px;margin-left:8px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--sd-text-secondary);line-height:0;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color 80ms ease,color 80ms ease}.sd-modal-close-btn:hover{background:var(--sd-surface-muted);color:var(--sd-text)}.sd-modal-close-btn:active{background:var(--sd-border)}.sd-modal-close-btn:focus{outline:none!important}.sd-modal-close-btn:focus-visible{outline:2px solid var(--sd-primary)!important;outline-offset:2px}.sd-modal-close-btn sd-icon{display:block;width:20px;height:20px;font-size:20px;line-height:20px}.sd-modal-bottom-sheet-panel.mat-bottom-sheet-container,.sd-modal-bottom-sheet-panel.mat-mdc-bottom-sheet-container,.sd-modal-bottom-sheet-panel .mat-bottom-sheet-container,.sd-modal-bottom-sheet-panel .mat-mdc-bottom-sheet-container{padding:0;min-width:100vw;box-sizing:border-box;outline:0;max-height:min(80vh,100vh - 16px);overflow:hidden;border-radius:var(--sd-modal-bottom-sheet-radius) var(--sd-modal-bottom-sheet-radius) 0 0!important;background:var(--sd-modal-surface);box-shadow:var(--sd-modal-shadow);display:flex;flex-direction:column}.sd-modal-footer{min-height:56px;padding:16px;border-top:1px solid var(--sd-modal-border);display:flex;align-items:center;justify-content:space-between;gap:16px}.sd-modal-footer-left,.sd-modal-footer-right{display:flex;align-items:center;gap:8px;min-width:0}.sd-modal-footer-left{flex:1 1 auto}.sd-modal-footer-right{flex:0 0 auto;margin-left:auto;justify-content:flex-end}.sd-modal-footer-left:empty,.sd-modal-footer-right:empty{display:none}.sd-modal-footer:has(.sd-modal-footer-left:empty):has(.sd-modal-footer-right:empty){display:none}\n"] }]
195
208
  }], ctorParameters: () => [], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], modal: [{ type: i0.ViewChild, args: ['modal', { isSignal: true }] }], autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], modalClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalClass", required: false }] }], lazyLoadContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyLoadContent", required: false }] }], hideClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideClose", required: false }] }], disableBackdropClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableBackdropClose", required: false }] }], beforeClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "beforeClose", required: false }] }], sdClosed: [{ type: i0.Output, args: ["sdClosed"] }], sdCloseError: [{ type: i0.Output, args: ["sdCloseError"] }] } });
196
209
 
197
210
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sdcorejs-angular-components-modal.mjs","sources":["../../../projects/sdcorejs-angular/components/modal/src/modal.component.ts","../../../projects/sdcorejs-angular/components/modal/src/modal.component.html","../../../projects/sdcorejs-angular/components/modal/sdcorejs-angular-components-modal.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n OnDestroy,\n TemplateRef,\n booleanAttribute,\n computed,\n inject,\n input,\n output,\n signal,\n ViewEncapsulation,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MatBottomSheet, MatBottomSheetModule, MatBottomSheetRef } from '@angular/material/bottom-sheet';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDialog, MatDialogModule, MatDialogRef } from '@angular/material/dialog';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { BrowserUtilities } from '@sdcorejs/utils/fns';\nimport { Color, Size } from '@sdcorejs/utils/models';\nimport { SdIcon } from '@sdcorejs/angular/modules/icon';\nimport { Observable } from 'rxjs';\n\nexport type SdModalBeforeClose = () => boolean | Promise<boolean>;\n\ninterface SdModalDismissRef {\n backdropClick?: () => Observable<MouseEvent>;\n keydownEvents?: () => Observable<KeyboardEvent>;\n}\n\n@Component({\n selector: 'sd-modal',\n templateUrl: './modal.component.html',\n styleUrl: './modal.component.scss',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [SdIcon, CommonModule, MatBottomSheetModule, MatDialogModule, MatDividerModule, MatButtonModule],\n})\nexport class SdModal implements OnDestroy {\n static index = signal(0);\n\n templateRef = viewChild.required<TemplateRef<any>>('templateRef');\n modal = viewChild<ElementRef>('modal');\n\n // autoId prefix `modal-`. Lưu ý: footer/body buttons render qua <ng-content> nên consumer phải\n // tự đặt [attr.data-autoId] cho các nút đó. Component chỉ tự bind autoId cho NÚT ĐÓNG (X icon).\n readonly autoIdInput = input<string | undefined | null>(undefined, { alias: 'autoId' });\n readonly autoId = computed(() => (this.autoIdInput() ? `components-modal-${this.autoIdInput()}` : undefined));\n readonly closeButtonAutoId = computed(() => (this.autoId() ? `${this.autoId()}-close` : undefined));\n readonly dataOpened = computed(() => (this.isOpened() ? 'true' : 'false'));\n\n title = input<string, string | null | undefined>('', { transform: v => v ?? '' });\n color = input<Color, Color | null | undefined>('primary', { transform: v => v ?? 'primary' });\n width = input<Size | string, Size | string | null | undefined>('md', { transform: v => v ?? 'md' });\n height = input<string, string | null | undefined>('auto', { transform: v => v ?? 'auto' });\n view = input<'dialog' | 'bottom-sheet' | undefined, 'dialog' | 'bottom-sheet' | null | undefined>(undefined, {\n transform: v => v ?? undefined,\n });\n modalClass = input<string | string[] | Record<string, boolean>, string | string[] | Record<string, boolean> | null | undefined>('', {\n transform: v => v ?? '',\n });\n lazyLoadContent = input(true, { transform: booleanAttribute });\n hideClose = input<boolean, boolean | ''>(false, { transform: booleanAttribute });\n disableBackdropClose = input<boolean, boolean | ''>(true, { transform: booleanAttribute }); // default to true to keep backward compatibility\n beforeClose = input<SdModalBeforeClose | undefined>(undefined);\n\n sdClosed = output<void>();\n sdCloseError = output<unknown>();\n\n isOpened = signal(false);\n alreadyOpened = signal(false);\n\n #isMobile = false;\n #resolvedWidth = 'md';\n #bottomSheetRef!: MatBottomSheetRef<any>;\n #dialogRef!: MatDialogRef<any>;\n #closeRequest?: Promise<boolean>;\n\n #dialog = inject(MatDialog);\n #bottomSheet = inject(MatBottomSheet);\n #destroyRef = inject(DestroyRef);\n\n constructor() {\n this.#isMobile = BrowserUtilities.isMobile();\n }\n\n // why: PHẢI là ngOnDestroy, KHÔNG phải #destroyRef.onDestroy. Angular chạy executeOnDestroys\n // (ngOnDestroy) TRƯỚC processCleanups (mọi callback DestroyRef.onDestroy). `sdClosed = output()`\n // tự đăng ký một DestroyRef.onDestroy trong constructor của OutputEmitterRef ngay lúc khởi tạo\n // field — tức TRƯỚC hook nào đăng ký trong constructor của component. Đăng ký ở constructor thì\n // tới lượt mình chạy, emitter đã `destroyed = true` và `emit()` chỉ log cảnh báo rồi thoát.\n ngOnDestroy(): void {\n // why: overlay của MatDialog/MatBottomSheet sống trong CDK overlay container ở <body>,\n // KHÔNG nằm trong view của <sd-modal>. Host bị destroy (điều hướng route, @if tắt nhánh…)\n // mà không close ref thì overlay + backdrop ở lại mồ côi, che và chặn click cả trang.\n // Dùng forceClose (không qua beforeClose) vì đã destroy thì không thể huỷ việc đóng.\n //\n // Emit TRƯỚC khi forceClose: afterClosed()/afterDismissed() bắn BẤT ĐỒNG BỘ, mà subscription\n // của chúng dùng takeUntilDestroyed(#destroyRef) nên đã bị gỡ trước khi tới lượt. Không emit\n // ở đây thì destroy một modal đang mở sẽ đóng overlay mà KHÔNG bao giờ báo (sdClosed).\n this.#markClosed();\n this.forceClose();\n }\n\n // why: idempotent — chốt trên isOpened(). Đường destroy emit trước, nếu sau đó\n // afterClosed()/afterDismissed() vẫn kịp bắn thì lần thứ hai là no-op, không double-emit.\n #markClosed = (): void => {\n if (!this.isOpened()) return;\n this.isOpened.set(false);\n this.#closeRequest = undefined;\n this.sdClosed.emit();\n };\n\n #resolveWidth(): string {\n const w = this.width() || '80vw';\n if (this.#isMobile) return w;\n switch (w) {\n case 'lg':\n return '80vw';\n case 'md':\n return '60vw';\n case 'sm':\n return '40vw';\n case 'sx':\n return '20vw';\n default:\n return w;\n }\n }\n\n open = (): void => {\n if (this.isOpened()) {\n return;\n }\n this.alreadyOpened.set(true);\n this.isOpened.set(true);\n this.#resolvedWidth = this.#resolveWidth();\n\n if ((!this.view() && this.#isMobile) || this.view() === 'bottom-sheet') {\n this.#bottomSheetRef = this.#bottomSheet.open(this.templateRef(), {\n panelClass: this.#resolvePanelClass('sd-modal-bottom-sheet-panel'),\n disableClose: this.disableBackdropClose() || !!this.beforeClose(),\n });\n this.#bindGuardedDismiss(this.#bottomSheetRef);\n this.#bottomSheetRef.afterDismissed().pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(this.#markClosed);\n } else {\n this.#dialogRef = this.#dialog.open(this.templateRef(), {\n width: this.#resolvedWidth,\n maxWidth: this.#resolvedWidth,\n panelClass: this.#resolvePanelClass('sd-modal-panel'),\n disableClose: this.disableBackdropClose() || !!this.beforeClose(),\n });\n this.#bindGuardedDismiss(this.#dialogRef);\n this.#dialogRef.afterClosed().pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(this.#markClosed);\n }\n };\n\n close = (): void => {\n if (this.beforeClose()) {\n void this.requestClose();\n return;\n }\n this.forceClose();\n };\n\n requestClose = (): Promise<boolean> => {\n const guard = this.beforeClose();\n if (!guard) {\n this.forceClose();\n return Promise.resolve(true);\n }\n if (this.#closeRequest) return this.#closeRequest;\n\n const request = Promise.resolve()\n .then(() => guard())\n .then(canClose => {\n if (!canClose) return false;\n this.forceClose();\n return true;\n })\n .catch((error: unknown) => {\n this.sdCloseError.emit(error);\n return false;\n });\n\n this.#closeRequest = request;\n void request.finally(() => {\n if (this.#closeRequest === request) this.#closeRequest = undefined;\n });\n return request;\n };\n\n forceClose = (): void => {\n this.#bottomSheetRef?.dismiss();\n this.#dialogRef?.close();\n };\n\n #bindGuardedDismiss(ref: MatDialogRef<any> | MatBottomSheetRef<any>): void {\n if (!this.beforeClose() || this.disableBackdropClose()) return;\n\n const dismissRef = ref as SdModalDismissRef;\n dismissRef\n .backdropClick?.()\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(() => this.close());\n dismissRef\n .keydownEvents?.()\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe((event: KeyboardEvent) => {\n if (event.key === 'Escape') this.close();\n });\n }\n\n #resolvePanelClass(baseClass: string): string[] {\n const customClass = this.modalClass();\n const classes = [baseClass];\n\n if (typeof customClass === 'string') {\n classes.push(...customClass.split(/\\s+/).filter(Boolean));\n return classes;\n }\n\n if (Array.isArray(customClass)) {\n classes.push(...customClass.filter(Boolean));\n return classes;\n }\n\n if (customClass && typeof customClass === 'object') {\n Object.entries(customClass).forEach(([className, enabled]) => {\n if (enabled) classes.push(className);\n });\n }\n\n return classes;\n }\n}\n","<ng-template #templateRef>\n <div\n class=\"sd-modal-root\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-opened]=\"dataOpened()\">\n @if (!lazyLoadContent() || alreadyOpened()) {\n @if (title()) {\n <div class=\"sd-modal-header\">\n <div class=\"sd-modal-header-left\">\n <ng-content select=\"[sdHeaderLeft]\">\n <div class=\"sd-modal-title T18M\">{{ title() }}</div>\n </ng-content>\n </div>\n <div class=\"sd-modal-header-right\">\n <ng-content select=\"[sdHeaderRight]\"></ng-content>\n @if (!hideClose()) {\n <button\n type=\"button\"\n class=\"sd-modal-close-btn\"\n aria-label=\"Close\"\n (click)=\"close()\"\n [attr.data-autoId]=\"closeButtonAutoId()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"sd-modal-body\">\n <ng-content></ng-content>\n </div>\n <div class=\"sd-modal-footer\" #footer>\n <div class=\"sd-modal-footer-left\"><ng-content select=\"[sdFooterLeft]\"></ng-content></div>\n <div class=\"sd-modal-footer-right\"><ng-content select=\"[sdFooterRight]\"></ng-content></div>\n </div>\n }\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MA2Ca,OAAO,CAAA;AAClB,IAAA,OAAO,KAAK,GAAG,MAAM,CAAC,CAAC,4EAAC;AAExB,IAAA,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAmB,aAAa,CAAC;AACjE,IAAA,KAAK,GAAG,SAAS,CAAa,OAAO,4EAAC;;;IAI7B,WAAW,GAAG,KAAK,CAA4B,SAAS,mFAAI,KAAK,EAAE,QAAQ,EAAA,CAAG;IAC9E,MAAM,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,CAAA,iBAAA,EAAoB,IAAI,CAAC,WA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EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE/CvC;;AAEG;;;;"}
1
+ {"version":3,"file":"sdcorejs-angular-components-modal.mjs","sources":["../../../projects/sdcorejs-angular/components/modal/src/modal.component.ts","../../../projects/sdcorejs-angular/components/modal/src/modal.component.html","../../../projects/sdcorejs-angular/components/modal/sdcorejs-angular-components-modal.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n OnDestroy,\n TemplateRef,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n ViewEncapsulation,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MatBottomSheet, MatBottomSheetModule, MatBottomSheetRef } from '@angular/material/bottom-sheet';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDialog, MatDialogModule, MatDialogRef } from '@angular/material/dialog';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { BrowserUtilities } from '@sdcorejs/utils/fns';\nimport { Color, Size } from '@sdcorejs/utils/models';\nimport { SdIcon } from '@sdcorejs/angular/modules/icon';\nimport { Observable } from 'rxjs';\n\nlet nextModalTitleId = 0;\n\nexport type SdModalBeforeClose = () => boolean | Promise<boolean>;\n\ninterface SdModalDismissRef {\n backdropClick?: () => Observable<MouseEvent>;\n keydownEvents?: () => Observable<KeyboardEvent>;\n}\n\n@Component({\n selector: 'sd-modal',\n templateUrl: './modal.component.html',\n styleUrl: './modal.component.scss',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [SdIcon, CommonModule, MatBottomSheetModule, MatDialogModule, MatDividerModule, MatButtonModule],\n})\nexport class SdModal implements OnDestroy {\n static index = signal(0);\n protected readonly titleId = `sd-modal-title-${nextModalTitleId++}`;\n\n templateRef = viewChild.required<TemplateRef<any>>('templateRef');\n modal = viewChild<ElementRef>('modal');\n\n // autoId prefix `modal-`. Lưu ý: footer/body buttons render qua <ng-content> nên consumer phải\n // tự đặt [attr.data-autoId] cho các nút đó. Component chỉ tự bind autoId cho NÚT ĐÓNG (X icon).\n readonly autoIdInput = input<string | undefined | null>(undefined, { alias: 'autoId' });\n readonly autoId = computed(() => (this.autoIdInput() ? `components-modal-${this.autoIdInput()}` : undefined));\n readonly closeButtonAutoId = computed(() => (this.autoId() ? `${this.autoId()}-close` : undefined));\n readonly dataOpened = computed(() => (this.isOpened() ? 'true' : 'false'));\n\n title = input<string, string | null | undefined>('', { transform: v => v ?? '' });\n color = input<Color, Color | null | undefined>('primary', { transform: v => v ?? 'primary' });\n width = input<Size | string, Size | string | null | undefined>('md', { transform: v => v ?? 'md' });\n height = input<string, string | null | undefined>('auto', { transform: v => v ?? 'auto' });\n view = input<'dialog' | 'bottom-sheet' | undefined, 'dialog' | 'bottom-sheet' | null | undefined>(undefined, {\n transform: v => v ?? undefined,\n });\n modalClass = input<string | string[] | Record<string, boolean>, string | string[] | Record<string, boolean> | null | undefined>('', {\n transform: v => v ?? '',\n });\n lazyLoadContent = input(true, { transform: booleanAttribute });\n hideClose = input<boolean, boolean | ''>(false, { transform: booleanAttribute });\n disableBackdropClose = input<boolean, boolean | ''>(true, { transform: booleanAttribute }); // default to true to keep backward compatibility\n beforeClose = input<SdModalBeforeClose | undefined>(undefined);\n\n sdClosed = output<void>();\n sdCloseError = output<unknown>();\n\n isOpened = signal(false);\n alreadyOpened = signal(false);\n\n #isMobile = false;\n #resolvedWidth = 'md';\n #bottomSheetRef!: MatBottomSheetRef<any>;\n #dialogRef!: MatDialogRef<any>;\n #closeRequest?: Promise<boolean>;\n\n #dialog = inject(MatDialog);\n #bottomSheet = inject(MatBottomSheet);\n #destroyRef = inject(DestroyRef);\n\n constructor() {\n this.#isMobile = BrowserUtilities.isMobile();\n // BottomSheetConfig has no ariaLabelledBy; bind its real container to the live heading.\n effect(() => {\n const title = this.title();\n const container = (this.modal()?.nativeElement as HTMLElement | undefined)?.closest('[role=\"dialog\"]');\n if (title) container?.setAttribute('aria-labelledby', this.titleId);\n else container?.removeAttribute('aria-labelledby');\n });\n }\n\n // why: PHẢI là ngOnDestroy, KHÔNG phải #destroyRef.onDestroy. Angular chạy executeOnDestroys\n // (ngOnDestroy) TRƯỚC processCleanups (mọi callback DestroyRef.onDestroy). `sdClosed = output()`\n // tự đăng ký một DestroyRef.onDestroy trong constructor của OutputEmitterRef ngay lúc khởi tạo\n // field — tức TRƯỚC hook nào đăng ký trong constructor của component. Đăng ký ở constructor thì\n // tới lượt mình chạy, emitter đã `destroyed = true` và `emit()` chỉ log cảnh báo rồi thoát.\n ngOnDestroy(): void {\n // why: overlay của MatDialog/MatBottomSheet sống trong CDK overlay container ở <body>,\n // KHÔNG nằm trong view của <sd-modal>. Host bị destroy (điều hướng route, @if tắt nhánh…)\n // mà không close ref thì overlay + backdrop ở lại mồ côi, che và chặn click cả trang.\n // Dùng forceClose (không qua beforeClose) vì đã destroy thì không thể huỷ việc đóng.\n //\n // Emit TRƯỚC khi forceClose: afterClosed()/afterDismissed() bắn BẤT ĐỒNG BỘ, mà subscription\n // của chúng dùng takeUntilDestroyed(#destroyRef) nên đã bị gỡ trước khi tới lượt. Không emit\n // ở đây thì destroy một modal đang mở sẽ đóng overlay mà KHÔNG bao giờ báo (sdClosed).\n this.#markClosed();\n this.forceClose();\n }\n\n // why: idempotent — chốt trên isOpened(). Đường destroy emit trước, nếu sau đó\n // afterClosed()/afterDismissed() vẫn kịp bắn thì lần thứ hai là no-op, không double-emit.\n #markClosed = (): void => {\n if (!this.isOpened()) return;\n this.isOpened.set(false);\n this.#closeRequest = undefined;\n this.sdClosed.emit();\n };\n\n #resolveWidth(): string {\n const w = this.width() || '80vw';\n if (this.#isMobile) return w;\n switch (w) {\n case 'lg':\n return '80vw';\n case 'md':\n return '60vw';\n case 'sm':\n return '40vw';\n case 'sx':\n return '20vw';\n default:\n return w;\n }\n }\n\n open = (): void => {\n if (this.isOpened()) {\n return;\n }\n this.alreadyOpened.set(true);\n this.isOpened.set(true);\n this.#resolvedWidth = this.#resolveWidth();\n\n if ((!this.view() && this.#isMobile) || this.view() === 'bottom-sheet') {\n this.#bottomSheetRef = this.#bottomSheet.open(this.templateRef(), {\n panelClass: this.#resolvePanelClass('sd-modal-bottom-sheet-panel'),\n ariaLabel: this.title() || undefined,\n disableClose: this.disableBackdropClose() || !!this.beforeClose(),\n });\n this.#bindGuardedDismiss(this.#bottomSheetRef);\n this.#bottomSheetRef.afterDismissed().pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(this.#markClosed);\n } else {\n this.#dialogRef = this.#dialog.open(this.templateRef(), {\n width: this.#resolvedWidth,\n maxWidth: this.#resolvedWidth,\n panelClass: this.#resolvePanelClass('sd-modal-panel'),\n ariaLabelledBy: this.title() ? this.titleId : undefined,\n disableClose: this.disableBackdropClose() || !!this.beforeClose(),\n });\n this.#bindGuardedDismiss(this.#dialogRef);\n this.#dialogRef.afterClosed().pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(this.#markClosed);\n }\n };\n\n close = (): void => {\n if (this.beforeClose()) {\n void this.requestClose();\n return;\n }\n this.forceClose();\n };\n\n requestClose = (): Promise<boolean> => {\n const guard = this.beforeClose();\n if (!guard) {\n this.forceClose();\n return Promise.resolve(true);\n }\n if (this.#closeRequest) return this.#closeRequest;\n\n const request = Promise.resolve()\n .then(() => guard())\n .then(canClose => {\n if (!canClose) return false;\n this.forceClose();\n return true;\n })\n .catch((error: unknown) => {\n this.sdCloseError.emit(error);\n return false;\n });\n\n this.#closeRequest = request;\n void request.finally(() => {\n if (this.#closeRequest === request) this.#closeRequest = undefined;\n });\n return request;\n };\n\n forceClose = (): void => {\n this.#bottomSheetRef?.dismiss();\n this.#dialogRef?.close();\n };\n\n #bindGuardedDismiss(ref: MatDialogRef<any> | MatBottomSheetRef<any>): void {\n if (!this.beforeClose() || this.disableBackdropClose()) return;\n\n const dismissRef = ref as SdModalDismissRef;\n dismissRef\n .backdropClick?.()\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(() => this.close());\n dismissRef\n .keydownEvents?.()\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe((event: KeyboardEvent) => {\n if (event.key === 'Escape') this.close();\n });\n }\n\n #resolvePanelClass(baseClass: string): string[] {\n const customClass = this.modalClass();\n const classes = [baseClass];\n\n if (typeof customClass === 'string') {\n classes.push(...customClass.split(/\\s+/).filter(Boolean));\n return classes;\n }\n\n if (Array.isArray(customClass)) {\n classes.push(...customClass.filter(Boolean));\n return classes;\n }\n\n if (customClass && typeof customClass === 'object') {\n Object.entries(customClass).forEach(([className, enabled]) => {\n if (enabled) classes.push(className);\n });\n }\n\n return classes;\n }\n}\n","<ng-template #templateRef>\n @let _title = title();\n <div #modal class=\"sd-modal-root\" [attr.data-autoId]=\"autoId()\" [attr.data-opened]=\"dataOpened()\">\n @if (!lazyLoadContent() || alreadyOpened()) {\n @if (_title) {\n <div class=\"sd-modal-header\">\n <div class=\"sd-modal-header-left\" [id]=\"titleId\">\n <ng-content select=\"[sdHeaderLeft]\">\n <div class=\"sd-modal-title T18M\">{{ _title }}</div>\n </ng-content>\n </div>\n <div class=\"sd-modal-header-right\">\n <ng-content select=\"[sdHeaderRight]\"></ng-content>\n @if (!hideClose()) {\n <button\n type=\"button\"\n class=\"sd-modal-close-btn\"\n aria-label=\"Close\"\n (click)=\"close()\"\n [attr.data-autoId]=\"closeButtonAutoId()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"sd-modal-body\">\n <ng-content></ng-content>\n </div>\n <div class=\"sd-modal-footer\" #footer>\n <div class=\"sd-modal-footer-left\"><ng-content select=\"[sdFooterLeft]\"></ng-content></div>\n <div class=\"sd-modal-footer-right\"><ng-content select=\"[sdFooterRight]\"></ng-content></div>\n </div>\n }\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AA4BA,IAAI,gBAAgB,GAAG,CAAC;MAkBX,OAAO,CAAA;AAClB,IAAA,OAAO,KAAK,GAAG,MAAM,CAAC,CAAC,4EAAC;AACL,IAAA,OAAO,GAAG,CAAA,eAAA,EAAkB,gBAAgB,EAAE,EAAE;AAEnE,IAAA,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAmB,aAAa,CAAC;AACjE,IAAA,KAAK,GAAG,SAAS,CAAa,OAAO,4EAAC;;;IAI7B,WAAW,GAAG,KAAK,CAA4B,SAAS,mFAAI,KAAK,EAAE,QAAQ,EAAA,CAAG;IAC9E,MAAM,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,CAAA,iBAAA,EAAoB,IAAI,CAAC,WAAW,EAAE,CAAA,CAAE,GAAG,SAAS,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;IACpG,iBAAiB,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG,CAAA,EAAG,IAAI,CAAC,MAAM,EAAE,CAAA,MAAA,CAAQ,GAAG,SAAS,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,mBAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;IAC1F,UAAU,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,QAAQ,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;AAE1E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,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEnDvC;;AAEG;;;;"}
@@ -6,13 +6,15 @@ class SdQuickAction {
6
6
  * Toggle visibility of the floating toolbar. Bare attribute = true.
7
7
  */
8
8
  opened = input(false, { ...(ngDevMode ? { debugName: "opened" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
9
+ /** Keep the toolbar in its owner's layout (for a sticky table footer or a drawer). */
10
+ contained = input(false, { ...(ngDevMode ? { debugName: "contained" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
9
11
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQuickAction, deps: [], target: i0.ɵɵFactoryTarget.Component });
10
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: SdQuickAction, isStandalone: true, selector: "sd-quick-action", inputs: { opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"c-quick-action d-flex align-items-center\" [class.active]=\"opened()\">\n <div class=\"c-quick-action-message T14R\">\n <ng-content select=\"[sdMessage]\"></ng-content>\n </div>\n <div class=\"c-quick-action-action\">\n <ng-content select=\"[sdAction]\"></ng-content>\n </div>\n</div>\n", styles: [".c-quick-action{box-shadow:0 .4px .8px #0000001a,0 3px 6px #0003;border-radius:8px;position:fixed;width:max-content;max-width:min(90vw,720px);background-color:#fff;bottom:90px;left:0;right:0;margin:auto;visibility:hidden;opacity:0;pointer-events:none;transition:transform .2s ease-in-out,opacity .2s ease-in-out,visibility .2s ease-in-out;transform:translate3d(0,100%,0);z-index:99;gap:16px}.c-quick-action.active{transform:translateZ(0);opacity:1;visibility:visible;pointer-events:all}.c-quick-action-message{flex:1 1 auto;min-width:0}.c-quick-action-action{flex:0 0 auto;display:flex;align-items:center}.c-quick-action:has(.c-quick-action-action:empty){gap:0;padding-right:16px}.c-quick-action-action:empty{display:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
12
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: SdQuickAction, isStandalone: true, selector: "sd-quick-action", inputs: { opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null }, contained: { classPropertyName: "contained", publicName: "contained", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"c-quick-action d-flex align-items-center\" [class.active]=\"opened()\" [class.contained]=\"contained()\">\n <div class=\"c-quick-action-message T14R\">\n <ng-content select=\"[sdMessage]\"></ng-content>\n </div>\n <div class=\"c-quick-action-action\">\n <ng-content select=\"[sdAction]\"></ng-content>\n </div>\n</div>\n", styles: [".c-quick-action{box-shadow:0 .4px .8px #0000001a,0 3px 6px #0003;border-radius:8px;position:fixed;width:max-content;max-width:min(90vw,720px);background-color:#fff;bottom:90px;left:0;right:0;margin:auto;visibility:hidden;opacity:0;pointer-events:none;transition:transform .2s ease-in-out,opacity .2s ease-in-out,visibility .2s ease-in-out;transform:translate3d(0,100%,0);z-index:99;gap:16px}.c-quick-action.active{transform:translateZ(0);opacity:1;visibility:visible;pointer-events:all}.c-quick-action.contained{position:relative;inset:auto;width:100%;max-width:100%;flex-wrap:wrap;box-sizing:border-box;background:var(--sd-surface, #fff);color:var(--sd-text);transform:none;gap:8px;padding:8px}.c-quick-action.contained .c-quick-action-action{flex:1 1 100%;min-width:0}.c-quick-action-message{flex:1 1 auto;min-width:0}.c-quick-action-action{flex:0 0 auto;display:flex;align-items:center}.c-quick-action:has(.c-quick-action-action:empty){gap:0;padding-right:16px}.c-quick-action-action:empty{display:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
11
13
  }
12
14
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdQuickAction, decorators: [{
13
15
  type: Component,
14
- args: [{ selector: 'sd-quick-action', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"c-quick-action d-flex align-items-center\" [class.active]=\"opened()\">\n <div class=\"c-quick-action-message T14R\">\n <ng-content select=\"[sdMessage]\"></ng-content>\n </div>\n <div class=\"c-quick-action-action\">\n <ng-content select=\"[sdAction]\"></ng-content>\n </div>\n</div>\n", styles: [".c-quick-action{box-shadow:0 .4px .8px #0000001a,0 3px 6px #0003;border-radius:8px;position:fixed;width:max-content;max-width:min(90vw,720px);background-color:#fff;bottom:90px;left:0;right:0;margin:auto;visibility:hidden;opacity:0;pointer-events:none;transition:transform .2s ease-in-out,opacity .2s ease-in-out,visibility .2s ease-in-out;transform:translate3d(0,100%,0);z-index:99;gap:16px}.c-quick-action.active{transform:translateZ(0);opacity:1;visibility:visible;pointer-events:all}.c-quick-action-message{flex:1 1 auto;min-width:0}.c-quick-action-action{flex:0 0 auto;display:flex;align-items:center}.c-quick-action:has(.c-quick-action-action:empty){gap:0;padding-right:16px}.c-quick-action-action:empty{display:none}\n"] }]
15
- }], propDecorators: { opened: [{ type: i0.Input, args: [{ isSignal: true, alias: "opened", required: false }] }] } });
16
+ args: [{ selector: 'sd-quick-action', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"c-quick-action d-flex align-items-center\" [class.active]=\"opened()\" [class.contained]=\"contained()\">\n <div class=\"c-quick-action-message T14R\">\n <ng-content select=\"[sdMessage]\"></ng-content>\n </div>\n <div class=\"c-quick-action-action\">\n <ng-content select=\"[sdAction]\"></ng-content>\n </div>\n</div>\n", styles: [".c-quick-action{box-shadow:0 .4px .8px #0000001a,0 3px 6px #0003;border-radius:8px;position:fixed;width:max-content;max-width:min(90vw,720px);background-color:#fff;bottom:90px;left:0;right:0;margin:auto;visibility:hidden;opacity:0;pointer-events:none;transition:transform .2s ease-in-out,opacity .2s ease-in-out,visibility .2s ease-in-out;transform:translate3d(0,100%,0);z-index:99;gap:16px}.c-quick-action.active{transform:translateZ(0);opacity:1;visibility:visible;pointer-events:all}.c-quick-action.contained{position:relative;inset:auto;width:100%;max-width:100%;flex-wrap:wrap;box-sizing:border-box;background:var(--sd-surface, #fff);color:var(--sd-text);transform:none;gap:8px;padding:8px}.c-quick-action.contained .c-quick-action-action{flex:1 1 100%;min-width:0}.c-quick-action-message{flex:1 1 auto;min-width:0}.c-quick-action-action{flex:0 0 auto;display:flex;align-items:center}.c-quick-action:has(.c-quick-action-action:empty){gap:0;padding-right:16px}.c-quick-action-action:empty{display:none}\n"] }]
17
+ }], propDecorators: { opened: [{ type: i0.Input, args: [{ isSignal: true, alias: "opened", required: false }] }], contained: [{ type: i0.Input, args: [{ isSignal: true, alias: "contained", required: false }] }] } });
16
18
 
17
19
  /**
18
20
  * Generated bundle index. Do not edit.