@sdcorejs/angular 22.2.5 → 22.2.6

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 (58) hide show
  1. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +3 -3
  2. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
  3. package/fesm2022/sdcorejs-angular-components-button.mjs +2 -2
  4. package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
  5. package/fesm2022/sdcorejs-angular-components-data-state.mjs +4 -3
  6. package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
  7. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +14 -14
  8. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  9. package/fesm2022/sdcorejs-angular-components-import-excel.mjs +38 -6
  10. package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
  11. package/fesm2022/sdcorejs-angular-components-inform.mjs +4 -3
  12. package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
  13. package/fesm2022/sdcorejs-angular-components-modal.mjs +3 -3
  14. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  15. package/fesm2022/sdcorejs-angular-components-query-bar.mjs +3 -3
  16. package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
  17. package/fesm2022/sdcorejs-angular-components-query-builder.mjs +1 -1
  18. package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
  19. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +3 -2
  20. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  21. package/fesm2022/sdcorejs-angular-components-stepper.mjs +2 -2
  22. package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
  23. package/fesm2022/sdcorejs-angular-components-table.mjs +125 -37
  24. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  25. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +5 -3
  26. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  27. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +251 -60
  28. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  29. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +2 -2
  30. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  31. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +2 -2
  32. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  33. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +1 -1
  34. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
  35. package/fesm2022/sdcorejs-angular-forms-select.mjs +293 -68
  36. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  37. package/fesm2022/sdcorejs-angular-i18n.mjs +95 -0
  38. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  39. package/fesm2022/sdcorejs-angular-modules-layout.mjs +2 -2
  40. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  41. package/fesm2022/sdcorejs-angular-services-confirm.mjs +55 -9
  42. package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
  43. package/fesm2022/sdcorejs-angular-services-notify.mjs +2 -2
  44. package/fesm2022/sdcorejs-angular-services-notify.mjs.map +1 -1
  45. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs +88 -0
  46. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs.map +1 -0
  47. package/fesm2022/sdcorejs-angular-utilities.mjs +1 -0
  48. package/fesm2022/sdcorejs-angular-utilities.mjs.map +1 -1
  49. package/package.json +5 -1
  50. package/types/sdcorejs-angular-components-import-excel.d.ts +23 -1
  51. package/types/sdcorejs-angular-components-table.d.ts +10 -1
  52. package/types/sdcorejs-angular-components-upload-file.d.ts +2 -1
  53. package/types/sdcorejs-angular-forms-autocomplete.d.ts +13 -2
  54. package/types/sdcorejs-angular-forms-select.d.ts +11 -1
  55. package/types/sdcorejs-angular-i18n.d.ts +19 -0
  56. package/types/sdcorejs-angular-services-confirm.d.ts +12 -0
  57. package/types/sdcorejs-angular-utilities-read-state.d.ts +42 -0
  58. package/types/sdcorejs-angular-utilities.d.ts +1 -0
@@ -1,3 +1,4 @@
1
+ import { CdkTrapFocus } from '@angular/cdk/a11y';
1
2
  import * as i2 from '@angular/cdk/portal';
2
3
  import { CdkPortal, DomPortalOutlet, PortalModule } from '@angular/cdk/portal';
3
4
  import * as i1 from '@angular/common';
@@ -219,11 +220,11 @@ class SdSideDrawer {
219
220
  this.isHovered$ = merge(mouseEnter$, mouseLeave$).pipe(startWith(false), distinctUntilChanged(), takeUntil(this.#destroy$));
220
221
  }
221
222
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdSideDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component });
222
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdSideDrawer, isStandalone: true, selector: "sd-side-drawer", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", 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 }, drawerClass: { classPropertyName: "drawerClass", publicName: "drawerClass", isSignal: true, isRequired: false, transformFunction: null }, autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdClosed: "sdClosed", sdCloseError: "sdCloseError" }, viewQueries: [{ propertyName: "portal", first: true, predicate: CdkPortal, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template cdkPortal>\n @let _isOpened = isOpened();\n <div\n [id]=\"id\"\n class=\"sd-side-drawer\"\n [ngStyle]=\"{ width: width() }\"\n [ngClass]=\"drawerClass()\"\n [class.sd-side-drawer-active]=\"_isOpened\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-opened]=\"dataOpened()\"\n [attr.data-loading]=\"dataLoading()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"title() || null\"\n (keydown.escape)=\"disableBackdropClose() ? null : close()\"\n #drawerContainer>\n @if (_isOpened) {\n <ng-container>\n <div class=\"sd-side-drawer-header\">\n <div class=\"sd-side-drawer-header-left\">\n <ng-content select=\"[sdHeaderLeft]\">\n <div class=\"sd-side-drawer-title\">{{ title() }}</div>\n </ng-content>\n </div>\n <div class=\"sd-side-drawer-header-right\">\n <ng-content select=\"[sdHeaderRight]\"></ng-content>\n @if (!hideClose()) {\n <!-- why: aria-label=\"Close\" l\u00E0 chu\u1ED7i ti\u1EBFng Anh c\u1EE9ng trong m\u1ED9t th\u01B0 vi\u1EC7n \u0111\u00E3 c\u00F3 i18n. -->\n <button\n type=\"button\"\n class=\"sd-side-drawer-close-btn\"\n (click)=\"close()\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </div>\n </div>\n @if (_isOpened) {\n <div class=\"sd-side-drawer-body\">\n <div class=\"sd-side-drawer-content\">\n <ng-content></ng-content>\n </div>\n </div>\n }\n <div class=\"sd-side-drawer-footer\">\n <div class=\"sd-side-drawer-footer-left\"><ng-content select=\"[sdFooterLeft]\"></ng-content></div>\n <div class=\"sd-side-drawer-footer-right\"><ng-content select=\"[sdFooterRight]\"></ng-content></div>\n </div>\n </ng-container>\n }\n </div>\n <!-- why: backdrop l\u00E0 l\u1EDBp ph\u1EE7 b\u1EAFt click thu\u1EA7n trang tr\u00ED, kh\u00F4ng c\u00F3 n\u1ED9i dung \u2014 nh\u01B0ng aria-hidden\n kh\u00F4ng ph\u1EA3i l\u00E0 c\u00E1ch khai b\u00E1o \u0111\u00FAng cho n\u00F3. `role=\"presentation\"` m\u1EDBi l\u00E0 t\u00EDn hi\u1EC7u ch\u00EDnh x\u00E1c\n (ph\u1EA7n t\u1EED n\u00E0y kh\u00F4ng mang ng\u1EEF ngh\u0129a), v\u00E0 quan tr\u1ECDng h\u01A1n: tr\u01B0\u1EDBc \u0111\u00E2y \"\u0111\u00F3ng b\u1EB1ng c\u00E1ch click ra\n ngo\u00E0i\" KH\u00D4NG c\u00F3 t\u01B0\u01A1ng \u0111\u01B0\u01A1ng b\u00E0n ph\u00EDm n\u00E0o c\u1EA3. Escape \u0111\u01B0\u1EE3c th\u00EAm \u1EDF drawer container. -->\n @if (_isOpened) {\n <div\n role=\"presentation\"\n class=\"sd-side-drawer-backdrop\"\n (click)=\"disableBackdropClose() ? null : close()\"\n (wheel)=\"preventScroll($event)\"\n (touchmove)=\"preventScroll($event)\"></div>\n }\n</ng-template>\n", styles: [".sd-side-drawer{--sd-side-drawer-inset: 10px;--sd-side-drawer-radius: var(--sd-overlay-radius, 24px);--sd-side-drawer-surface: var(--sd-surface, #fff);--sd-side-drawer-border: var(--sd-border, #dde0e5);--sd-side-drawer-shadow: 0 6px 18px rgba(15, 23, 42, .18), 0 1px 3px rgba(15, 23, 42, .12);position:fixed;right:var(--sd-side-drawer-inset);top:var(--sd-side-drawer-inset);bottom:var(--sd-side-drawer-inset);max-width:calc(100vw - var(--sd-side-drawer-inset) - var(--sd-side-drawer-inset));background-color:var(--sd-side-drawer-surface);color:var(--sd-text);z-index:999;display:flex;flex-direction:column;opacity:0;visibility:hidden;transform:translate3d(calc(100% + var(--sd-side-drawer-inset)),0,0);transition:all .3s ease-in-out;pointer-events:none;overflow:hidden;border-radius:var(--sd-side-drawer-radius);box-shadow:var(--sd-side-drawer-shadow)}.sd-side-drawer-active{opacity:1;visibility:visible;pointer-events:all;transform:translateZ(0)}.sd-side-drawer-header{min-height:64px;padding:16px;display:flex;align-items:center;justify-content:space-between;gap:16px}.sd-side-drawer-header-left{display:flex;align-items:center;flex:1 1 auto;min-width:0}.sd-side-drawer-header-right{display:flex;align-items:center;gap:8px;flex:0 0 auto}.sd-side-drawer-title{font-size:20px;line-height:28px;font-weight:500;min-width:0}.sd-side-drawer-close-btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;box-sizing:border-box;width:32px;height:32px;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-side-drawer-close-btn:hover{background:var(--sd-surface-muted);color:var(--sd-text)}.sd-side-drawer-close-btn:active{background:var(--sd-border)}.sd-side-drawer-close-btn:focus{outline:none}.sd-side-drawer-close-btn:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-side-drawer-close-btn sd-icon{display:block;width:20px;height:20px;font-size:20px;line-height:20px}.sd-side-drawer-body{flex:1;position:relative}.sd-side-drawer-content{position:absolute;padding:0;inset:0;overflow:auto}.sd-side-drawer-footer{border-top:1px solid var(--sd-side-drawer-border);padding:16px;background-color:var(--sd-side-drawer-surface);display:flex;align-items:center;justify-content:space-between;gap:16px}.sd-side-drawer-footer-left,.sd-side-drawer-footer-right{display:flex;align-items:center;gap:8px;min-width:0}.sd-side-drawer-footer-left{flex:1 1 auto}.sd-side-drawer-footer-right{flex:0 0 auto;margin-left:auto;justify-content:flex-end}.sd-side-drawer-footer-left:empty,.sd-side-drawer-footer-right:empty{display:none}.sd-side-drawer-footer:has(.sd-side-drawer-footer-left:empty):has(.sd-side-drawer-footer-right:empty){display:none}.sd-side-drawer-backdrop{background-color:#0006;border:0;outline:none!important;position:fixed;inset:0;z-index:99;width:100%;height:100%;transition:all .3s ease-in-out}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i2.CdkPortal, selector: "[cdkPortal]", exportAs: ["cdkPortal"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
223
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdSideDrawer, isStandalone: true, selector: "sd-side-drawer", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", 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 }, drawerClass: { classPropertyName: "drawerClass", publicName: "drawerClass", isSignal: true, isRequired: false, transformFunction: null }, autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdClosed: "sdClosed", sdCloseError: "sdCloseError" }, viewQueries: [{ propertyName: "portal", first: true, predicate: CdkPortal, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template cdkPortal>\n @let _isOpened = isOpened();\n <div\n [id]=\"id\"\n class=\"sd-side-drawer\"\n [ngStyle]=\"{ width: width() }\"\n [ngClass]=\"drawerClass()\"\n [class.sd-side-drawer-active]=\"_isOpened\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-opened]=\"dataOpened()\"\n [attr.data-loading]=\"dataLoading()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"title() || null\"\n (keydown.escape)=\"$event.stopPropagation(); disableBackdropClose() ? null : close()\"\n #drawerContainer>\n @if (_isOpened) {\n <div class=\"sd-side-drawer-focus\" cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\n <div class=\"sd-side-drawer-header\">\n <div class=\"sd-side-drawer-header-left\">\n <ng-content select=\"[sdHeaderLeft]\">\n <div class=\"sd-side-drawer-title\">{{ title() }}</div>\n </ng-content>\n </div>\n <div class=\"sd-side-drawer-header-right\">\n <ng-content select=\"[sdHeaderRight]\"></ng-content>\n @if (!hideClose()) {\n <!-- why: aria-label=\"Close\" l\u00E0 chu\u1ED7i ti\u1EBFng Anh c\u1EE9ng trong m\u1ED9t th\u01B0 vi\u1EC7n \u0111\u00E3 c\u00F3 i18n. -->\n <button\n type=\"button\"\n class=\"sd-side-drawer-close-btn\"\n (click)=\"close()\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </div>\n </div>\n @if (_isOpened) {\n <div class=\"sd-side-drawer-body\">\n <div class=\"sd-side-drawer-content\">\n <ng-content></ng-content>\n </div>\n </div>\n }\n <div class=\"sd-side-drawer-footer\">\n <div class=\"sd-side-drawer-footer-left\"><ng-content select=\"[sdFooterLeft]\"></ng-content></div>\n <div class=\"sd-side-drawer-footer-right\"><ng-content select=\"[sdFooterRight]\"></ng-content></div>\n </div>\n </div>\n }\n </div>\n <!-- why: backdrop l\u00E0 l\u1EDBp ph\u1EE7 b\u1EAFt click thu\u1EA7n trang tr\u00ED, kh\u00F4ng c\u00F3 n\u1ED9i dung \u2014 nh\u01B0ng aria-hidden\n kh\u00F4ng ph\u1EA3i l\u00E0 c\u00E1ch khai b\u00E1o \u0111\u00FAng cho n\u00F3. `role=\"presentation\"` m\u1EDBi l\u00E0 t\u00EDn hi\u1EC7u ch\u00EDnh x\u00E1c\n (ph\u1EA7n t\u1EED n\u00E0y kh\u00F4ng mang ng\u1EEF ngh\u0129a), v\u00E0 quan tr\u1ECDng h\u01A1n: tr\u01B0\u1EDBc \u0111\u00E2y \"\u0111\u00F3ng b\u1EB1ng c\u00E1ch click ra\n ngo\u00E0i\" KH\u00D4NG c\u00F3 t\u01B0\u01A1ng \u0111\u01B0\u01A1ng b\u00E0n ph\u00EDm n\u00E0o c\u1EA3. Escape \u0111\u01B0\u1EE3c th\u00EAm \u1EDF drawer container. -->\n @if (_isOpened) {\n <div\n role=\"presentation\"\n class=\"sd-side-drawer-backdrop\"\n (click)=\"disableBackdropClose() ? null : close()\"\n (wheel)=\"preventScroll($event)\"\n (touchmove)=\"preventScroll($event)\"></div>\n }\n</ng-template>\n", styles: [".sd-side-drawer{--sd-side-drawer-inset: 10px;--sd-side-drawer-radius: var(--sd-overlay-radius, 8px);--sd-side-drawer-surface: var(--sd-surface, #fff);--sd-side-drawer-border: var(--sd-border, #dde0e5);--sd-side-drawer-shadow: 0 6px 18px rgba(15, 23, 42, .18), 0 1px 3px rgba(15, 23, 42, .12);position:fixed;right:var(--sd-side-drawer-inset);top:var(--sd-side-drawer-inset);bottom:var(--sd-side-drawer-inset);max-width:calc(100vw - var(--sd-side-drawer-inset) - var(--sd-side-drawer-inset));background-color:var(--sd-side-drawer-surface);color:var(--sd-text);z-index:999;display:flex;flex-direction:column;opacity:0;visibility:hidden;transform:translate3d(calc(100% + var(--sd-side-drawer-inset)),0,0);transition:transform .18s ease,opacity .18s ease,visibility 0s linear .18s;pointer-events:none;overflow:hidden;border-radius:var(--sd-side-drawer-radius);box-shadow:var(--sd-side-drawer-shadow)}.sd-side-drawer-active{transition-delay:0s;opacity:1;visibility:visible;pointer-events:all;transform:translateZ(0)}.sd-side-drawer-header{min-height:64px;padding:16px;display:flex;align-items:center;justify-content:space-between;gap:16px}.sd-side-drawer-header-left{display:flex;align-items:center;flex:1 1 auto;min-width:0}.sd-side-drawer-header-right{display:flex;align-items:center;gap:8px;flex:0 0 auto}.sd-side-drawer-title{font-size:20px;line-height:28px;font-weight:500;min-width:0}.sd-side-drawer-close-btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;box-sizing:border-box;width:32px;height:32px;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-side-drawer-close-btn:hover{background:var(--sd-surface-muted);color:var(--sd-text)}.sd-side-drawer-close-btn:active{background:var(--sd-border)}.sd-side-drawer-close-btn:focus{outline:none}.sd-side-drawer-close-btn:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-side-drawer-close-btn sd-icon{display:block;width:20px;height:20px;font-size:20px;line-height:20px}.sd-side-drawer-body{flex:1;position:relative}.sd-side-drawer-content{position:absolute;padding:0;inset:0;overflow:auto}.sd-side-drawer-footer{border-top:1px solid var(--sd-side-drawer-border);padding:16px;background-color:var(--sd-side-drawer-surface);display:flex;align-items:center;justify-content:space-between;gap:16px}.sd-side-drawer-footer-left,.sd-side-drawer-footer-right{display:flex;align-items:center;gap:8px;min-width:0}.sd-side-drawer-footer-left{flex:1 1 auto}.sd-side-drawer-footer-right{flex:0 0 auto;margin-left:auto;justify-content:flex-end}.sd-side-drawer-footer-left:empty,.sd-side-drawer-footer-right:empty{display:none}.sd-side-drawer-footer:has(.sd-side-drawer-footer-left:empty):has(.sd-side-drawer-footer-right:empty){display:none}.sd-side-drawer-backdrop{background-color:#0006;border:0;outline:none!important;position:fixed;inset:0;z-index:99;width:100%;height:100%;transition:all .3s ease-in-out}.sd-side-drawer-focus{display:flex;flex-direction:column;flex:1;min-height:0}.sd-side-drawer-title{font-size:18px;line-height:25px;font-weight:600;overflow-wrap:anywhere}.sd-side-drawer-header,.sd-side-drawer-footer{flex-shrink:0;padding:20px 24px}.sd-side-drawer-content{padding:0 24px 20px}@media(max-width:600px){.sd-side-drawer{--sd-side-drawer-inset: 8px}.sd-side-drawer-header{padding:16px;gap:8px}.sd-side-drawer-content{padding:0 16px 16px}.sd-side-drawer-footer{padding:12px 16px max(12px,env(safe-area-inset-bottom));flex-wrap:wrap;gap:8px}.sd-side-drawer-footer-left,.sd-side-drawer-footer-right{flex-wrap:wrap}.sd-side-drawer-close-btn{width:44px;height:44px}::ng-deep .sd-side-drawer-footer button{min-height:44px}}@media(prefers-reduced-motion:reduce){.sd-side-drawer,.sd-side-drawer-backdrop,.sd-side-drawer-close-btn{transition:none}}\n"], dependencies: [{ kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i2.CdkPortal, selector: "[cdkPortal]", exportAs: ["cdkPortal"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
223
224
  }
224
225
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdSideDrawer, decorators: [{
225
226
  type: Component,
226
- args: [{ selector: 'sd-side-drawer', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [SdIcon, CommonModule, PortalModule, SdTranslatePipe], template: "<ng-template cdkPortal>\n @let _isOpened = isOpened();\n <div\n [id]=\"id\"\n class=\"sd-side-drawer\"\n [ngStyle]=\"{ width: width() }\"\n [ngClass]=\"drawerClass()\"\n [class.sd-side-drawer-active]=\"_isOpened\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-opened]=\"dataOpened()\"\n [attr.data-loading]=\"dataLoading()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"title() || null\"\n (keydown.escape)=\"disableBackdropClose() ? null : close()\"\n #drawerContainer>\n @if (_isOpened) {\n <ng-container>\n <div class=\"sd-side-drawer-header\">\n <div class=\"sd-side-drawer-header-left\">\n <ng-content select=\"[sdHeaderLeft]\">\n <div class=\"sd-side-drawer-title\">{{ title() }}</div>\n </ng-content>\n </div>\n <div class=\"sd-side-drawer-header-right\">\n <ng-content select=\"[sdHeaderRight]\"></ng-content>\n @if (!hideClose()) {\n <!-- why: aria-label=\"Close\" l\u00E0 chu\u1ED7i ti\u1EBFng Anh c\u1EE9ng trong m\u1ED9t th\u01B0 vi\u1EC7n \u0111\u00E3 c\u00F3 i18n. -->\n <button\n type=\"button\"\n class=\"sd-side-drawer-close-btn\"\n (click)=\"close()\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </div>\n </div>\n @if (_isOpened) {\n <div class=\"sd-side-drawer-body\">\n <div class=\"sd-side-drawer-content\">\n <ng-content></ng-content>\n </div>\n </div>\n }\n <div class=\"sd-side-drawer-footer\">\n <div class=\"sd-side-drawer-footer-left\"><ng-content select=\"[sdFooterLeft]\"></ng-content></div>\n <div class=\"sd-side-drawer-footer-right\"><ng-content select=\"[sdFooterRight]\"></ng-content></div>\n </div>\n </ng-container>\n }\n </div>\n <!-- why: backdrop l\u00E0 l\u1EDBp ph\u1EE7 b\u1EAFt click thu\u1EA7n trang tr\u00ED, kh\u00F4ng c\u00F3 n\u1ED9i dung \u2014 nh\u01B0ng aria-hidden\n kh\u00F4ng ph\u1EA3i l\u00E0 c\u00E1ch khai b\u00E1o \u0111\u00FAng cho n\u00F3. `role=\"presentation\"` m\u1EDBi l\u00E0 t\u00EDn hi\u1EC7u ch\u00EDnh x\u00E1c\n (ph\u1EA7n t\u1EED n\u00E0y kh\u00F4ng mang ng\u1EEF ngh\u0129a), v\u00E0 quan tr\u1ECDng h\u01A1n: tr\u01B0\u1EDBc \u0111\u00E2y \"\u0111\u00F3ng b\u1EB1ng c\u00E1ch click ra\n ngo\u00E0i\" KH\u00D4NG c\u00F3 t\u01B0\u01A1ng \u0111\u01B0\u01A1ng b\u00E0n ph\u00EDm n\u00E0o c\u1EA3. Escape \u0111\u01B0\u1EE3c th\u00EAm \u1EDF drawer container. -->\n @if (_isOpened) {\n <div\n role=\"presentation\"\n class=\"sd-side-drawer-backdrop\"\n (click)=\"disableBackdropClose() ? null : close()\"\n (wheel)=\"preventScroll($event)\"\n (touchmove)=\"preventScroll($event)\"></div>\n }\n</ng-template>\n", styles: [".sd-side-drawer{--sd-side-drawer-inset: 10px;--sd-side-drawer-radius: var(--sd-overlay-radius, 24px);--sd-side-drawer-surface: var(--sd-surface, #fff);--sd-side-drawer-border: var(--sd-border, #dde0e5);--sd-side-drawer-shadow: 0 6px 18px rgba(15, 23, 42, .18), 0 1px 3px rgba(15, 23, 42, .12);position:fixed;right:var(--sd-side-drawer-inset);top:var(--sd-side-drawer-inset);bottom:var(--sd-side-drawer-inset);max-width:calc(100vw - var(--sd-side-drawer-inset) - var(--sd-side-drawer-inset));background-color:var(--sd-side-drawer-surface);color:var(--sd-text);z-index:999;display:flex;flex-direction:column;opacity:0;visibility:hidden;transform:translate3d(calc(100% + var(--sd-side-drawer-inset)),0,0);transition:all .3s ease-in-out;pointer-events:none;overflow:hidden;border-radius:var(--sd-side-drawer-radius);box-shadow:var(--sd-side-drawer-shadow)}.sd-side-drawer-active{opacity:1;visibility:visible;pointer-events:all;transform:translateZ(0)}.sd-side-drawer-header{min-height:64px;padding:16px;display:flex;align-items:center;justify-content:space-between;gap:16px}.sd-side-drawer-header-left{display:flex;align-items:center;flex:1 1 auto;min-width:0}.sd-side-drawer-header-right{display:flex;align-items:center;gap:8px;flex:0 0 auto}.sd-side-drawer-title{font-size:20px;line-height:28px;font-weight:500;min-width:0}.sd-side-drawer-close-btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;box-sizing:border-box;width:32px;height:32px;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-side-drawer-close-btn:hover{background:var(--sd-surface-muted);color:var(--sd-text)}.sd-side-drawer-close-btn:active{background:var(--sd-border)}.sd-side-drawer-close-btn:focus{outline:none}.sd-side-drawer-close-btn:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-side-drawer-close-btn sd-icon{display:block;width:20px;height:20px;font-size:20px;line-height:20px}.sd-side-drawer-body{flex:1;position:relative}.sd-side-drawer-content{position:absolute;padding:0;inset:0;overflow:auto}.sd-side-drawer-footer{border-top:1px solid var(--sd-side-drawer-border);padding:16px;background-color:var(--sd-side-drawer-surface);display:flex;align-items:center;justify-content:space-between;gap:16px}.sd-side-drawer-footer-left,.sd-side-drawer-footer-right{display:flex;align-items:center;gap:8px;min-width:0}.sd-side-drawer-footer-left{flex:1 1 auto}.sd-side-drawer-footer-right{flex:0 0 auto;margin-left:auto;justify-content:flex-end}.sd-side-drawer-footer-left:empty,.sd-side-drawer-footer-right:empty{display:none}.sd-side-drawer-footer:has(.sd-side-drawer-footer-left:empty):has(.sd-side-drawer-footer-right:empty){display:none}.sd-side-drawer-backdrop{background-color:#0006;border:0;outline:none!important;position:fixed;inset:0;z-index:99;width:100%;height:100%;transition:all .3s ease-in-out}\n"] }]
227
+ args: [{ selector: 'sd-side-drawer', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [CdkTrapFocus, SdIcon, CommonModule, PortalModule, SdTranslatePipe], template: "<ng-template cdkPortal>\n @let _isOpened = isOpened();\n <div\n [id]=\"id\"\n class=\"sd-side-drawer\"\n [ngStyle]=\"{ width: width() }\"\n [ngClass]=\"drawerClass()\"\n [class.sd-side-drawer-active]=\"_isOpened\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-opened]=\"dataOpened()\"\n [attr.data-loading]=\"dataLoading()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"title() || null\"\n (keydown.escape)=\"$event.stopPropagation(); disableBackdropClose() ? null : close()\"\n #drawerContainer>\n @if (_isOpened) {\n <div class=\"sd-side-drawer-focus\" cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\n <div class=\"sd-side-drawer-header\">\n <div class=\"sd-side-drawer-header-left\">\n <ng-content select=\"[sdHeaderLeft]\">\n <div class=\"sd-side-drawer-title\">{{ title() }}</div>\n </ng-content>\n </div>\n <div class=\"sd-side-drawer-header-right\">\n <ng-content select=\"[sdHeaderRight]\"></ng-content>\n @if (!hideClose()) {\n <!-- why: aria-label=\"Close\" l\u00E0 chu\u1ED7i ti\u1EBFng Anh c\u1EE9ng trong m\u1ED9t th\u01B0 vi\u1EC7n \u0111\u00E3 c\u00F3 i18n. -->\n <button\n type=\"button\"\n class=\"sd-side-drawer-close-btn\"\n (click)=\"close()\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </div>\n </div>\n @if (_isOpened) {\n <div class=\"sd-side-drawer-body\">\n <div class=\"sd-side-drawer-content\">\n <ng-content></ng-content>\n </div>\n </div>\n }\n <div class=\"sd-side-drawer-footer\">\n <div class=\"sd-side-drawer-footer-left\"><ng-content select=\"[sdFooterLeft]\"></ng-content></div>\n <div class=\"sd-side-drawer-footer-right\"><ng-content select=\"[sdFooterRight]\"></ng-content></div>\n </div>\n </div>\n }\n </div>\n <!-- why: backdrop l\u00E0 l\u1EDBp ph\u1EE7 b\u1EAFt click thu\u1EA7n trang tr\u00ED, kh\u00F4ng c\u00F3 n\u1ED9i dung \u2014 nh\u01B0ng aria-hidden\n kh\u00F4ng ph\u1EA3i l\u00E0 c\u00E1ch khai b\u00E1o \u0111\u00FAng cho n\u00F3. `role=\"presentation\"` m\u1EDBi l\u00E0 t\u00EDn hi\u1EC7u ch\u00EDnh x\u00E1c\n (ph\u1EA7n t\u1EED n\u00E0y kh\u00F4ng mang ng\u1EEF ngh\u0129a), v\u00E0 quan tr\u1ECDng h\u01A1n: tr\u01B0\u1EDBc \u0111\u00E2y \"\u0111\u00F3ng b\u1EB1ng c\u00E1ch click ra\n ngo\u00E0i\" KH\u00D4NG c\u00F3 t\u01B0\u01A1ng \u0111\u01B0\u01A1ng b\u00E0n ph\u00EDm n\u00E0o c\u1EA3. Escape \u0111\u01B0\u1EE3c th\u00EAm \u1EDF drawer container. -->\n @if (_isOpened) {\n <div\n role=\"presentation\"\n class=\"sd-side-drawer-backdrop\"\n (click)=\"disableBackdropClose() ? null : close()\"\n (wheel)=\"preventScroll($event)\"\n (touchmove)=\"preventScroll($event)\"></div>\n }\n</ng-template>\n", styles: [".sd-side-drawer{--sd-side-drawer-inset: 10px;--sd-side-drawer-radius: var(--sd-overlay-radius, 8px);--sd-side-drawer-surface: var(--sd-surface, #fff);--sd-side-drawer-border: var(--sd-border, #dde0e5);--sd-side-drawer-shadow: 0 6px 18px rgba(15, 23, 42, .18), 0 1px 3px rgba(15, 23, 42, .12);position:fixed;right:var(--sd-side-drawer-inset);top:var(--sd-side-drawer-inset);bottom:var(--sd-side-drawer-inset);max-width:calc(100vw - var(--sd-side-drawer-inset) - var(--sd-side-drawer-inset));background-color:var(--sd-side-drawer-surface);color:var(--sd-text);z-index:999;display:flex;flex-direction:column;opacity:0;visibility:hidden;transform:translate3d(calc(100% + var(--sd-side-drawer-inset)),0,0);transition:transform .18s ease,opacity .18s ease,visibility 0s linear .18s;pointer-events:none;overflow:hidden;border-radius:var(--sd-side-drawer-radius);box-shadow:var(--sd-side-drawer-shadow)}.sd-side-drawer-active{transition-delay:0s;opacity:1;visibility:visible;pointer-events:all;transform:translateZ(0)}.sd-side-drawer-header{min-height:64px;padding:16px;display:flex;align-items:center;justify-content:space-between;gap:16px}.sd-side-drawer-header-left{display:flex;align-items:center;flex:1 1 auto;min-width:0}.sd-side-drawer-header-right{display:flex;align-items:center;gap:8px;flex:0 0 auto}.sd-side-drawer-title{font-size:20px;line-height:28px;font-weight:500;min-width:0}.sd-side-drawer-close-btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;box-sizing:border-box;width:32px;height:32px;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-side-drawer-close-btn:hover{background:var(--sd-surface-muted);color:var(--sd-text)}.sd-side-drawer-close-btn:active{background:var(--sd-border)}.sd-side-drawer-close-btn:focus{outline:none}.sd-side-drawer-close-btn:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-side-drawer-close-btn sd-icon{display:block;width:20px;height:20px;font-size:20px;line-height:20px}.sd-side-drawer-body{flex:1;position:relative}.sd-side-drawer-content{position:absolute;padding:0;inset:0;overflow:auto}.sd-side-drawer-footer{border-top:1px solid var(--sd-side-drawer-border);padding:16px;background-color:var(--sd-side-drawer-surface);display:flex;align-items:center;justify-content:space-between;gap:16px}.sd-side-drawer-footer-left,.sd-side-drawer-footer-right{display:flex;align-items:center;gap:8px;min-width:0}.sd-side-drawer-footer-left{flex:1 1 auto}.sd-side-drawer-footer-right{flex:0 0 auto;margin-left:auto;justify-content:flex-end}.sd-side-drawer-footer-left:empty,.sd-side-drawer-footer-right:empty{display:none}.sd-side-drawer-footer:has(.sd-side-drawer-footer-left:empty):has(.sd-side-drawer-footer-right:empty){display:none}.sd-side-drawer-backdrop{background-color:#0006;border:0;outline:none!important;position:fixed;inset:0;z-index:99;width:100%;height:100%;transition:all .3s ease-in-out}.sd-side-drawer-focus{display:flex;flex-direction:column;flex:1;min-height:0}.sd-side-drawer-title{font-size:18px;line-height:25px;font-weight:600;overflow-wrap:anywhere}.sd-side-drawer-header,.sd-side-drawer-footer{flex-shrink:0;padding:20px 24px}.sd-side-drawer-content{padding:0 24px 20px}@media(max-width:600px){.sd-side-drawer{--sd-side-drawer-inset: 8px}.sd-side-drawer-header{padding:16px;gap:8px}.sd-side-drawer-content{padding:0 16px 16px}.sd-side-drawer-footer{padding:12px 16px max(12px,env(safe-area-inset-bottom));flex-wrap:wrap;gap:8px}.sd-side-drawer-footer-left,.sd-side-drawer-footer-right{flex-wrap:wrap}.sd-side-drawer-close-btn{width:44px;height:44px}::ng-deep .sd-side-drawer-footer button{min-height:44px}}@media(prefers-reduced-motion:reduce){.sd-side-drawer,.sd-side-drawer-backdrop,.sd-side-drawer-close-btn{transition:none}}\n"] }]
227
228
  }], ctorParameters: () => [], propDecorators: { portal: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkPortal), { isSignal: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", 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 }] }], drawerClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "drawerClass", required: false }] }], autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], sdClosed: [{ type: i0.Output, args: ["sdClosed"] }], sdCloseError: [{ type: i0.Output, args: ["sdCloseError"] }] } });
228
229
 
229
230
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sdcorejs-angular-components-side-drawer.mjs","sources":["../../../projects/sdcorejs-angular/components/side-drawer/src/body-scroll-lock.service.ts","../../../projects/sdcorejs-angular/components/side-drawer/src/side-drawer.component.ts","../../../projects/sdcorejs-angular/components/side-drawer/src/side-drawer.component.html","../../../projects/sdcorejs-angular/components/side-drawer/sdcorejs-angular-components-side-drawer.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { Injectable, inject } from '@angular/core';\n\n/**\n * Khoá scroll của `document.body` theo kiểu đếm tham chiếu (ref-count).\n *\n * why: mỗi drawer tự lưu/khôi phục `document.body.style.overflow` là KHÔNG stack-safe. Với hai\n * drawer chồng nhau: drawer ngoài lưu `''` rồi set `'hidden'`; drawer trong lưu `'hidden'` (giá trị\n * do drawer ngoài vừa ghi) rồi cũng set `'hidden'`. Đóng drawer ngoài trước → khôi phục `''` →\n * trang scroll lại được dù drawer trong vẫn mở; đóng drawer trong sau → khôi phục `'hidden'` →\n * trang KHOÁ SCROLL VĨNH VIỄN dù không còn drawer nào. Ref-count chỉ ghi DOM ở lần khoá đầu và\n * lần nhả cuối, nên thứ tự đóng không còn ảnh hưởng.\n */\ninterface SdBodyScrollLockState {\n count: number;\n previousOverflow: string | null;\n}\n\n/**\n * why: state nằm ở MODULE, khoá theo `Document`, KHÔNG nằm trong instance service.\n * `providedIn: 'root'` cho một instance mỗi *ứng dụng Angular*, không phải mỗi *document*. Hai app\n * bootstrap độc lập trên cùng một trang (micro-frontend, widget nhúng) sẽ có hai bộ đếm riêng, mỗi\n * bên chụp lại `overflow` mà bên kia vừa ghi — tái lập đúng bug khoá-scroll-vĩnh-viễn mà service\n * này sinh ra để sửa, chỉ dịch lên một tầng. Khoá theo `Document` thì mọi instance trong cùng\n * document dùng chung một bộ đếm, bất kể injector nào tạo ra chúng.\n */\nconst scrollLockStates = new WeakMap<Document, SdBodyScrollLockState>();\n\nconst stateFor = (doc: Document): SdBodyScrollLockState => {\n let state = scrollLockStates.get(doc);\n if (!state) {\n state = { count: 0, previousOverflow: null };\n scrollLockStates.set(doc, state);\n }\n return state;\n};\n\n@Injectable({ providedIn: 'root' })\nexport class SdBodyScrollLockService {\n readonly #document = inject(DOCUMENT);\n\n /** Số lượng khoá đang giữ trên document này — phục vụ chẩn đoán/test. */\n get count(): number {\n return stateFor(this.#document).count;\n }\n\n lock(): void {\n const state = stateFor(this.#document);\n const body = this.#document.body;\n if (!body) return;\n if (state.count === 0) {\n state.previousOverflow = body.style.overflow;\n body.style.overflow = 'hidden';\n }\n state.count++;\n }\n\n release(): void {\n const state = stateFor(this.#document);\n // Nhả nhiều hơn khoá (double close, destroy sau close) không được đẩy count xuống âm,\n // nếu không lần khoá kế tiếp sẽ không ghi DOM.\n if (state.count === 0) return;\n state.count--;\n if (state.count > 0) return;\n const body = this.#document.body;\n if (body) body.style.overflow = state.previousOverflow ?? '';\n state.previousOverflow = null;\n }\n}\n","import { CdkPortal, DomPortalOutlet, PortalModule } from '@angular/cdk/portal';\nimport { CommonModule } from '@angular/common';\nimport {\n ApplicationRef,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n EmbeddedViewRef,\n Injector,\n ViewContainerRef,\n afterNextRender,\n booleanAttribute,\n computed,\n inject,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { SdLoadingService } from '@sdcorejs/angular/services';\nimport { Utilities } from '@sdcorejs/utils/fns';\nimport { fromEvent, merge, Observable, Subject } from 'rxjs';\nimport { map, takeUntil, startWith, distinctUntilChanged } from 'rxjs/operators';\nimport { SdIcon } from '@sdcorejs/angular/modules/icon';\nimport { SdTranslatePipe } from '@sdcorejs/angular/i18n';\nimport { SdBodyScrollLockService } from './body-scroll-lock.service';\n\nexport type SdSideDrawerBeforeClose = () => boolean | Promise<boolean>;\n\n@Component({\n selector: 'sd-side-drawer',\n templateUrl: './side-drawer.component.html',\n styleUrl: './side-drawer.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [SdIcon, CommonModule, PortalModule, SdTranslatePipe],\n})\nexport class SdSideDrawer {\n id = `I${Utilities.generateUuid()}`;\n\n portal = viewChild.required(CdkPortal);\n\n title = input<string>('');\n width = input<string>('480px');\n hideClose = input<boolean, boolean | ''>(false, { transform: booleanAttribute });\n disableBackdropClose = input<boolean, boolean | ''>(false, { transform: booleanAttribute });\n beforeClose = input<SdSideDrawerBeforeClose | undefined>(undefined);\n\n // Custom CSS class added to the root side-drawer container\n drawerClass = input<any>('');\n\n readonly autoIdInput = input<string | undefined | null>(undefined, { alias: 'autoId' });\n readonly autoId = computed(() => (this.autoIdInput() ? `components-side-drawer-${this.autoIdInput()}` : undefined));\n\n sdClosed = output<void>();\n sdCloseError = output<unknown>();\n\n #embeddedViewRef!: EmbeddedViewRef<any>;\n\n readonly #isOpenedSignal = signal(false);\n readonly #isLoadingSignal = signal(false);\n readonly isOpened = this.#isOpenedSignal.asReadonly();\n readonly isLoading = this.#isLoadingSignal.asReadonly();\n readonly dataOpened = computed(() => (this.#isOpenedSignal() ? 'true' : 'false'));\n readonly dataLoading = computed(() => (this.#isLoadingSignal() ? 'true' : 'false'));\n\n isHovered$!: Observable<boolean>;\n #destroy$ = new Subject<void>();\n // Instance này có đang giữ 1 khoá scroll hay không — giữ cho lock/release luôn cân bằng\n // dù open()/close() bị gọi lặp.\n #holdsScrollLock = false;\n #closeRequest?: Promise<boolean>;\n\n #viewContainerRef = inject(ViewContainerRef);\n #ar = inject(ApplicationRef);\n #injector = inject(Injector);\n #ref = inject(ChangeDetectorRef);\n #loadingService = inject(SdLoadingService);\n #destroyRef = inject(DestroyRef);\n #scrollLock = inject(SdBodyScrollLockService);\n\n constructor() {\n // Thay thế ngAfterViewInit, tự động chạy nội dung này khi DOM sẵn sàng để render\n afterNextRender(() => {\n // 1. Gắn portal vào body và lưu lại EmbeddedViewRef\n const outlet = new DomPortalOutlet(document.body, this.#ar, this.#injector);\n this.#embeddedViewRef = outlet.attachTemplatePortal(this.portal());\n\n // 2. Setup sự kiện hover ngay sau khi DOM thật đã được in ra\n this.#setupHoverSubscription();\n });\n\n // Thay thế ngOnDestroy bằng logic destroy trực tiếp\n this.#destroyRef.onDestroy(() => {\n this.#destroy$.next();\n this.#destroy$.complete();\n\n if (this.#embeddedViewRef) {\n this.#embeddedViewRef.destroy();\n }\n\n // Destroy khi đang mở cũng phải nhả khoá, nếu không ref-count kẹt > 0 và trang khoá scroll mãi.\n this.#releaseScrollLock();\n });\n }\n\n open = () => {\n this.#ref.markForCheck();\n this.#isOpenedSignal.set(true);\n\n // Chặn scroll ở document body qua khoá ref-count dùng chung (stack-safe với drawer lồng nhau)\n this.#acquireScrollLock();\n };\n\n close = () => {\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 = () => {\n this.#ref.markForCheck();\n this.#isOpenedSignal.set(false);\n this.sdClosed.emit();\n this.stopLoading();\n\n // Khôi phục lại scroll ở document body (chỉ thật sự khôi phục khi drawer cuối cùng nhả khoá)\n this.#releaseScrollLock();\n };\n\n #acquireScrollLock(): void {\n if (this.#holdsScrollLock) return;\n this.#holdsScrollLock = true;\n this.#scrollLock.lock();\n }\n\n #releaseScrollLock(): void {\n if (!this.#holdsScrollLock) return;\n this.#holdsScrollLock = false;\n this.#scrollLock.release();\n }\n\n startLoading = () => {\n this.#isLoadingSignal.set(true);\n this.#loadingService.stop(`#${this.id}`);\n this.#loadingService.start(`#${this.id}`);\n };\n\n stopLoading = () => {\n this.#isLoadingSignal.set(false);\n this.#loadingService.stop(`#${this.id}`);\n };\n\n preventScroll = (event: Event) => {\n event.preventDefault();\n };\n\n #setupHoverSubscription(): void {\n if (!this.#embeddedViewRef) return;\n\n // 3. Lấy DOM element trực tiếp từ rootNodes của EmbeddedViewRef\n const rootNodes = this.#embeddedViewRef.rootNodes;\n const element = rootNodes.find(\n node => node.nodeType === Node.ELEMENT_NODE && (node as HTMLElement).classList?.contains('sd-side-drawer')\n );\n\n if (!element) {\n console.warn('SdSideDrawer: Cannot find sd-side-drawer element to attach hover event');\n return;\n }\n\n // 4. Gắn event listeners trực tiếp lên element thật\n const mouseEnter$ = fromEvent(element, 'mouseenter').pipe(map(() => true));\n const mouseLeave$ = fromEvent(element, 'mouseleave').pipe(map(() => false));\n\n this.isHovered$ = merge(mouseEnter$, mouseLeave$).pipe(startWith(false), distinctUntilChanged(), takeUntil(this.#destroy$));\n }\n}\n","<ng-template cdkPortal>\n @let _isOpened = isOpened();\n <div\n [id]=\"id\"\n class=\"sd-side-drawer\"\n [ngStyle]=\"{ width: width() }\"\n [ngClass]=\"drawerClass()\"\n [class.sd-side-drawer-active]=\"_isOpened\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-opened]=\"dataOpened()\"\n [attr.data-loading]=\"dataLoading()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"title() || null\"\n (keydown.escape)=\"disableBackdropClose() ? null : close()\"\n #drawerContainer>\n @if (_isOpened) {\n <ng-container>\n <div class=\"sd-side-drawer-header\">\n <div class=\"sd-side-drawer-header-left\">\n <ng-content select=\"[sdHeaderLeft]\">\n <div class=\"sd-side-drawer-title\">{{ title() }}</div>\n </ng-content>\n </div>\n <div class=\"sd-side-drawer-header-right\">\n <ng-content select=\"[sdHeaderRight]\"></ng-content>\n @if (!hideClose()) {\n <!-- why: aria-label=\"Close\" là chuỗi tiếng Anh cứng trong một thư viện đã có i18n. -->\n <button\n type=\"button\"\n class=\"sd-side-drawer-close-btn\"\n (click)=\"close()\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </div>\n </div>\n @if (_isOpened) {\n <div class=\"sd-side-drawer-body\">\n <div class=\"sd-side-drawer-content\">\n <ng-content></ng-content>\n </div>\n </div>\n }\n <div class=\"sd-side-drawer-footer\">\n <div class=\"sd-side-drawer-footer-left\"><ng-content select=\"[sdFooterLeft]\"></ng-content></div>\n <div class=\"sd-side-drawer-footer-right\"><ng-content select=\"[sdFooterRight]\"></ng-content></div>\n </div>\n </ng-container>\n }\n </div>\n <!-- why: backdrop là lớp phủ bắt click thuần trang trí, không có nội dung — nhưng aria-hidden\n không phải là cách khai báo đúng cho nó. `role=\"presentation\"` mới là tín hiệu chính xác\n (phần tử này không mang ngữ nghĩa), và quan trọng hơn: trước đây \"đóng bằng cách click ra\n ngoài\" KHÔNG có tương đương bàn phím nào cả. Escape được thêm ở drawer container. -->\n @if (_isOpened) {\n <div\n role=\"presentation\"\n class=\"sd-side-drawer-backdrop\"\n (click)=\"disableBackdropClose() ? null : close()\"\n (wheel)=\"preventScroll($event)\"\n (touchmove)=\"preventScroll($event)\"></div>\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAkBA;;;;;;;AAOG;AACH,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAAmC;AAEvE,MAAM,QAAQ,GAAG,CAAC,GAAa,KAA2B;IACxD,IAAI,KAAK,GAAG,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC;IACrC,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE;AAC5C,QAAA,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;IAClC;AACA,IAAA,OAAO,KAAK;AACd,CAAC;MAGY,uBAAuB,CAAA;AACzB,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;;AAGrC,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK;IACvC;IAEA,IAAI,GAAA;QACF,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AACtC,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAA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components/side-drawer/src/body-scroll-lock.service.ts","../../../projects/sdcorejs-angular/components/side-drawer/src/side-drawer.component.ts","../../../projects/sdcorejs-angular/components/side-drawer/src/side-drawer.component.html","../../../projects/sdcorejs-angular/components/side-drawer/sdcorejs-angular-components-side-drawer.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { Injectable, inject } from '@angular/core';\n\n/**\n * Khoá scroll của `document.body` theo kiểu đếm tham chiếu (ref-count).\n *\n * why: mỗi drawer tự lưu/khôi phục `document.body.style.overflow` là KHÔNG stack-safe. Với hai\n * drawer chồng nhau: drawer ngoài lưu `''` rồi set `'hidden'`; drawer trong lưu `'hidden'` (giá trị\n * do drawer ngoài vừa ghi) rồi cũng set `'hidden'`. Đóng drawer ngoài trước → khôi phục `''` →\n * trang scroll lại được dù drawer trong vẫn mở; đóng drawer trong sau → khôi phục `'hidden'` →\n * trang KHOÁ SCROLL VĨNH VIỄN dù không còn drawer nào. Ref-count chỉ ghi DOM ở lần khoá đầu và\n * lần nhả cuối, nên thứ tự đóng không còn ảnh hưởng.\n */\ninterface SdBodyScrollLockState {\n count: number;\n previousOverflow: string | null;\n}\n\n/**\n * why: state nằm ở MODULE, khoá theo `Document`, KHÔNG nằm trong instance service.\n * `providedIn: 'root'` cho một instance mỗi *ứng dụng Angular*, không phải mỗi *document*. Hai app\n * bootstrap độc lập trên cùng một trang (micro-frontend, widget nhúng) sẽ có hai bộ đếm riêng, mỗi\n * bên chụp lại `overflow` mà bên kia vừa ghi — tái lập đúng bug khoá-scroll-vĩnh-viễn mà service\n * này sinh ra để sửa, chỉ dịch lên một tầng. Khoá theo `Document` thì mọi instance trong cùng\n * document dùng chung một bộ đếm, bất kể injector nào tạo ra chúng.\n */\nconst scrollLockStates = new WeakMap<Document, SdBodyScrollLockState>();\n\nconst stateFor = (doc: Document): SdBodyScrollLockState => {\n let state = scrollLockStates.get(doc);\n if (!state) {\n state = { count: 0, previousOverflow: null };\n scrollLockStates.set(doc, state);\n }\n return state;\n};\n\n@Injectable({ providedIn: 'root' })\nexport class SdBodyScrollLockService {\n readonly #document = inject(DOCUMENT);\n\n /** Số lượng khoá đang giữ trên document này — phục vụ chẩn đoán/test. */\n get count(): number {\n return stateFor(this.#document).count;\n }\n\n lock(): void {\n const state = stateFor(this.#document);\n const body = this.#document.body;\n if (!body) return;\n if (state.count === 0) {\n state.previousOverflow = body.style.overflow;\n body.style.overflow = 'hidden';\n }\n state.count++;\n }\n\n release(): void {\n const state = stateFor(this.#document);\n // Nhả nhiều hơn khoá (double close, destroy sau close) không được đẩy count xuống âm,\n // nếu không lần khoá kế tiếp sẽ không ghi DOM.\n if (state.count === 0) return;\n state.count--;\n if (state.count > 0) return;\n const body = this.#document.body;\n if (body) body.style.overflow = state.previousOverflow ?? '';\n state.previousOverflow = null;\n }\n}\n","import { CdkTrapFocus } from '@angular/cdk/a11y';\nimport { CdkPortal, DomPortalOutlet, PortalModule } from '@angular/cdk/portal';\nimport { CommonModule } from '@angular/common';\nimport {\n ApplicationRef,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n EmbeddedViewRef,\n Injector,\n ViewContainerRef,\n afterNextRender,\n booleanAttribute,\n computed,\n inject,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { SdLoadingService } from '@sdcorejs/angular/services';\nimport { Utilities } from '@sdcorejs/utils/fns';\nimport { fromEvent, merge, Observable, Subject } from 'rxjs';\nimport { map, takeUntil, startWith, distinctUntilChanged } from 'rxjs/operators';\nimport { SdIcon } from '@sdcorejs/angular/modules/icon';\nimport { SdTranslatePipe } from '@sdcorejs/angular/i18n';\nimport { SdBodyScrollLockService } from './body-scroll-lock.service';\n\nexport type SdSideDrawerBeforeClose = () => boolean | Promise<boolean>;\n\n@Component({\n selector: 'sd-side-drawer',\n templateUrl: './side-drawer.component.html',\n styleUrl: './side-drawer.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [CdkTrapFocus, SdIcon, CommonModule, PortalModule, SdTranslatePipe],\n})\nexport class SdSideDrawer {\n id = `I${Utilities.generateUuid()}`;\n\n portal = viewChild.required(CdkPortal);\n\n title = input<string>('');\n width = input<string>('480px');\n hideClose = input<boolean, boolean | ''>(false, { transform: booleanAttribute });\n disableBackdropClose = input<boolean, boolean | ''>(false, { transform: booleanAttribute });\n beforeClose = input<SdSideDrawerBeforeClose | undefined>(undefined);\n\n // Custom CSS class added to the root side-drawer container\n drawerClass = input<any>('');\n\n readonly autoIdInput = input<string | undefined | null>(undefined, { alias: 'autoId' });\n readonly autoId = computed(() => (this.autoIdInput() ? `components-side-drawer-${this.autoIdInput()}` : undefined));\n\n sdClosed = output<void>();\n sdCloseError = output<unknown>();\n\n #embeddedViewRef!: EmbeddedViewRef<any>;\n\n readonly #isOpenedSignal = signal(false);\n readonly #isLoadingSignal = signal(false);\n readonly isOpened = this.#isOpenedSignal.asReadonly();\n readonly isLoading = this.#isLoadingSignal.asReadonly();\n readonly dataOpened = computed(() => (this.#isOpenedSignal() ? 'true' : 'false'));\n readonly dataLoading = computed(() => (this.#isLoadingSignal() ? 'true' : 'false'));\n\n isHovered$!: Observable<boolean>;\n #destroy$ = new Subject<void>();\n // Instance này có đang giữ 1 khoá scroll hay không — giữ cho lock/release luôn cân bằng\n // dù open()/close() bị gọi lặp.\n #holdsScrollLock = false;\n #closeRequest?: Promise<boolean>;\n\n #viewContainerRef = inject(ViewContainerRef);\n #ar = inject(ApplicationRef);\n #injector = inject(Injector);\n #ref = inject(ChangeDetectorRef);\n #loadingService = inject(SdLoadingService);\n #destroyRef = inject(DestroyRef);\n #scrollLock = inject(SdBodyScrollLockService);\n\n constructor() {\n // Thay thế ngAfterViewInit, tự động chạy nội dung này khi DOM sẵn sàng để render\n afterNextRender(() => {\n // 1. Gắn portal vào body và lưu lại EmbeddedViewRef\n const outlet = new DomPortalOutlet(document.body, this.#ar, this.#injector);\n this.#embeddedViewRef = outlet.attachTemplatePortal(this.portal());\n\n // 2. Setup sự kiện hover ngay sau khi DOM thật đã được in ra\n this.#setupHoverSubscription();\n });\n\n // Thay thế ngOnDestroy bằng logic destroy trực tiếp\n this.#destroyRef.onDestroy(() => {\n this.#destroy$.next();\n this.#destroy$.complete();\n\n if (this.#embeddedViewRef) {\n this.#embeddedViewRef.destroy();\n }\n\n // Destroy khi đang mở cũng phải nhả khoá, nếu không ref-count kẹt > 0 và trang khoá scroll mãi.\n this.#releaseScrollLock();\n });\n }\n\n open = () => {\n this.#ref.markForCheck();\n this.#isOpenedSignal.set(true);\n\n // Chặn scroll ở document body qua khoá ref-count dùng chung (stack-safe với drawer lồng nhau)\n this.#acquireScrollLock();\n };\n\n close = () => {\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 = () => {\n this.#ref.markForCheck();\n this.#isOpenedSignal.set(false);\n this.sdClosed.emit();\n this.stopLoading();\n\n // Khôi phục lại scroll ở document body (chỉ thật sự khôi phục khi drawer cuối cùng nhả khoá)\n this.#releaseScrollLock();\n };\n\n #acquireScrollLock(): void {\n if (this.#holdsScrollLock) return;\n this.#holdsScrollLock = true;\n this.#scrollLock.lock();\n }\n\n #releaseScrollLock(): void {\n if (!this.#holdsScrollLock) return;\n this.#holdsScrollLock = false;\n this.#scrollLock.release();\n }\n\n startLoading = () => {\n this.#isLoadingSignal.set(true);\n this.#loadingService.stop(`#${this.id}`);\n this.#loadingService.start(`#${this.id}`);\n };\n\n stopLoading = () => {\n this.#isLoadingSignal.set(false);\n this.#loadingService.stop(`#${this.id}`);\n };\n\n preventScroll = (event: Event) => {\n event.preventDefault();\n };\n\n #setupHoverSubscription(): void {\n if (!this.#embeddedViewRef) return;\n\n // 3. Lấy DOM element trực tiếp từ rootNodes của EmbeddedViewRef\n const rootNodes = this.#embeddedViewRef.rootNodes;\n const element = rootNodes.find(\n node => node.nodeType === Node.ELEMENT_NODE && (node as HTMLElement).classList?.contains('sd-side-drawer')\n );\n\n if (!element) {\n console.warn('SdSideDrawer: Cannot find sd-side-drawer element to attach hover event');\n return;\n }\n\n // 4. Gắn event listeners trực tiếp lên element thật\n const mouseEnter$ = fromEvent(element, 'mouseenter').pipe(map(() => true));\n const mouseLeave$ = fromEvent(element, 'mouseleave').pipe(map(() => false));\n\n this.isHovered$ = merge(mouseEnter$, mouseLeave$).pipe(startWith(false), distinctUntilChanged(), takeUntil(this.#destroy$));\n }\n}\n","<ng-template cdkPortal>\n @let _isOpened = isOpened();\n <div\n [id]=\"id\"\n class=\"sd-side-drawer\"\n [ngStyle]=\"{ width: width() }\"\n [ngClass]=\"drawerClass()\"\n [class.sd-side-drawer-active]=\"_isOpened\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-opened]=\"dataOpened()\"\n [attr.data-loading]=\"dataLoading()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"title() || null\"\n (keydown.escape)=\"$event.stopPropagation(); disableBackdropClose() ? null : close()\"\n #drawerContainer>\n @if (_isOpened) {\n <div class=\"sd-side-drawer-focus\" cdkTrapFocus [cdkTrapFocusAutoCapture]=\"true\">\n <div class=\"sd-side-drawer-header\">\n <div class=\"sd-side-drawer-header-left\">\n <ng-content select=\"[sdHeaderLeft]\">\n <div class=\"sd-side-drawer-title\">{{ title() }}</div>\n </ng-content>\n </div>\n <div class=\"sd-side-drawer-header-right\">\n <ng-content select=\"[sdHeaderRight]\"></ng-content>\n @if (!hideClose()) {\n <!-- why: aria-label=\"Close\" là chuỗi tiếng Anh cứng trong một thư viện đã có i18n. -->\n <button\n type=\"button\"\n class=\"sd-side-drawer-close-btn\"\n (click)=\"close()\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </div>\n </div>\n @if (_isOpened) {\n <div class=\"sd-side-drawer-body\">\n <div class=\"sd-side-drawer-content\">\n <ng-content></ng-content>\n </div>\n </div>\n }\n <div class=\"sd-side-drawer-footer\">\n <div class=\"sd-side-drawer-footer-left\"><ng-content select=\"[sdFooterLeft]\"></ng-content></div>\n <div class=\"sd-side-drawer-footer-right\"><ng-content select=\"[sdFooterRight]\"></ng-content></div>\n </div>\n </div>\n }\n </div>\n <!-- why: backdrop là lớp phủ bắt click thuần trang trí, không có nội dung — nhưng aria-hidden\n không phải là cách khai báo đúng cho nó. `role=\"presentation\"` mới là tín hiệu chính xác\n (phần tử này không mang ngữ nghĩa), và quan trọng hơn: trước đây \"đóng bằng cách click ra\n ngoài\" KHÔNG có tương đương bàn phím nào cả. Escape được thêm ở drawer container. -->\n @if (_isOpened) {\n <div\n role=\"presentation\"\n class=\"sd-side-drawer-backdrop\"\n (click)=\"disableBackdropClose() ? null : close()\"\n (wheel)=\"preventScroll($event)\"\n (touchmove)=\"preventScroll($event)\"></div>\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAkBA;;;;;;;AAOG;AACH,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAAmC;AAEvE,MAAM,QAAQ,GAAG,CAAC,GAAa,KAA2B;IACxD,IAAI,KAAK,GAAG,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC;IACrC,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE;AAC5C,QAAA,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;IAClC;AACA,IAAA,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AAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,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;;AE1CvC;;AAEG;;"}
@@ -122,11 +122,11 @@ class SdStepper {
122
122
  step?.selectChange.emit();
123
123
  }
124
124
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdStepper, deps: [], target: i0.ɵɵFactoryTarget.Component });
125
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdStepper, isStandalone: true, selector: "sd-stepper", inputs: { selectedIndex: { classPropertyName: "selectedIndex", publicName: "selectedIndex", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, headerPosition: { classPropertyName: "headerPosition", publicName: "headerPosition", isSignal: true, isRequired: false, transformFunction: null }, animationDuration: { classPropertyName: "animationDuration", publicName: "animationDuration", isSignal: true, isRequired: false, transformFunction: null }, disableRipple: { classPropertyName: "disableRipple", publicName: "disableRipple", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedIndex: "selectedIndexChange", selectionChange: "selectionChange" }, host: { properties: { "attr.data-autoId": "this.autoIdAttr", "style.--sd-stepper-active-color": "this.cssActive", "style.--sd-stepper-active-bg": "this.cssActiveBg", "style.--sd-stepper-completed-color": "this.cssCompleted", "style.--sd-stepper-line-active-color": "this.cssLine" } }, queries: [{ propertyName: "steps", predicate: SdStep, isSignal: true }], viewQueries: [{ propertyName: "matStepper", first: true, predicate: MatStepper, descendants: true, isSignal: true }], ngImport: i0, template: "<!-- why: `(selectionChange)` b\u00EAn d\u01B0\u1EDBi l\u00E0 output c\u1EE7a `MatStepper` (Angular Material), KH\u00D4NG ph\u1EA3i output c\u1EE7a\n `<sd-stepper>` \u2014 ph\u1EA3i gi\u1EEF nguy\u00EAn t\u00EAn. Output c\u00F4ng khai c\u1EE7a lib \u0111\u00E3 \u0111\u1ED5i th\u00E0nh `selectionChange`. -->\n<mat-stepper\n class=\"sd-stepper\"\n [(selectedIndex)]=\"selectedIndex\"\n [linear]=\"linear()\"\n [orientation]=\"orientation()\"\n [labelPosition]=\"labelPosition()\"\n [headerPosition]=\"headerPosition()\"\n [animationDuration]=\"animationDuration()\"\n [disableRipple]=\"disableRipple()\"\n (selectionChange)=\"onSelectionChange($event)\">\n @for (step of steps(); track step; let i = $index) {\n <mat-step\n [stepControl]=\"step.stepControl() ?? undefined!\"\n [optional]=\"step.optional()\"\n [editable]=\"step.editable()\"\n [state]=\"step.state() ?? ''\"\n [errorMessage]=\"step.errorMessage() ?? ''\">\n <ng-template matStepLabel>\n <span class=\"sd-step__label\">\n @if (step.icon(); as ic) {\n <sd-icon class=\"sd-step__icon\" [name]=\"ic\"></sd-icon>\n }\n <span class=\"sd-step__text\">{{ step.label() }}</span>\n </span>\n </ng-template>\n\n <ng-template matStepContent>\n <ng-container [ngTemplateOutlet]=\"step.bodyTpl()\"></ng-container>\n </ng-template>\n </mat-step>\n }\n</mat-stepper>\n", styles: [":host{display:block;--sd-stepper-active-color: var(--sd-primary, #005cbb);--sd-stepper-active-bg: var(--sd-primary, #005cbb);--sd-stepper-completed-color: var(--sd-primary, #005cbb);--sd-stepper-line-active-color: var(--sd-primary, #005cbb);--sd-stepper-error-color: var(--sd-error, #ba1a1a);--sd-stepper-pending-bg: var(--sd-disabled-bg, rgba(26, 27, 31, .08));--sd-stepper-pending-color: var(--sd-disabled-text, rgba(26, 27, 31, .6));--sd-stepper-text-color: var(--sd-text, #1a1b1f)}.sd-step__label{display:inline-flex;align-items:center;gap:4px}.sd-step__icon{font-size:18px;width:18px;height:18px;line-height:18px}.sd-step__text{white-space:nowrap}:host ::ng-deep .mat-step-icon{background-color:var(--sd-stepper-pending-bg);color:var(--sd-stepper-pending-color)}:host ::ng-deep .mat-step-icon-selected{background-color:var(--sd-stepper-active-bg)!important;color:#fff!important}:host ::ng-deep .mat-step-icon-state-done,:host ::ng-deep .mat-step-icon-state-edit{background-color:var(--sd-stepper-completed-color)!important;color:#fff!important}:host ::ng-deep .mat-step-icon-state-error{background-color:var(--sd-stepper-error-color)!important;color:#fff!important}:host ::ng-deep .mat-step-label.mat-step-label-active .mat-step-text-label{color:var(--sd-stepper-text-color);font-weight:500}:host ::ng-deep .mat-step-label-selected .mat-step-text-label{color:var(--sd-stepper-active-color);font-weight:600}:host ::ng-deep .mat-stepper-horizontal-line,:host ::ng-deep .mat-stepper-vertical-line:before{border-color:#0000001f}:host ::ng-deep .mat-step-header.cdk-program-focused,:host ::ng-deep .mat-step-header:hover{background-color:#00000005}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: MatStepperModule }, { kind: "component", type: i1.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i1.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i1.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["disableRipple", "color", "labelPosition", "headerPosition", "aria-label", "headerPrefix", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }, { kind: "directive", type: i1.MatStepContent, selector: "ng-template[matStepContent]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
125
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdStepper, isStandalone: true, selector: "sd-stepper", inputs: { selectedIndex: { classPropertyName: "selectedIndex", publicName: "selectedIndex", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, headerPosition: { classPropertyName: "headerPosition", publicName: "headerPosition", isSignal: true, isRequired: false, transformFunction: null }, animationDuration: { classPropertyName: "animationDuration", publicName: "animationDuration", isSignal: true, isRequired: false, transformFunction: null }, disableRipple: { classPropertyName: "disableRipple", publicName: "disableRipple", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedIndex: "selectedIndexChange", selectionChange: "selectionChange" }, host: { properties: { "attr.data-autoId": "this.autoIdAttr", "style.--sd-stepper-active-color": "this.cssActive", "style.--sd-stepper-active-bg": "this.cssActiveBg", "style.--sd-stepper-completed-color": "this.cssCompleted", "style.--sd-stepper-line-active-color": "this.cssLine" } }, queries: [{ propertyName: "steps", predicate: SdStep, isSignal: true }], viewQueries: [{ propertyName: "matStepper", first: true, predicate: MatStepper, descendants: true, isSignal: true }], ngImport: i0, template: "<!-- why: `(selectionChange)` b\u00EAn d\u01B0\u1EDBi l\u00E0 output c\u1EE7a `MatStepper` (Angular Material), KH\u00D4NG ph\u1EA3i output c\u1EE7a\n `<sd-stepper>` \u2014 ph\u1EA3i gi\u1EEF nguy\u00EAn t\u00EAn. Output c\u00F4ng khai c\u1EE7a lib \u0111\u00E3 \u0111\u1ED5i th\u00E0nh `selectionChange`. -->\n<mat-stepper\n class=\"sd-stepper\"\n [(selectedIndex)]=\"selectedIndex\"\n [linear]=\"linear()\"\n [orientation]=\"orientation()\"\n [labelPosition]=\"labelPosition()\"\n [headerPosition]=\"headerPosition()\"\n [animationDuration]=\"animationDuration()\"\n [disableRipple]=\"disableRipple()\"\n (selectionChange)=\"onSelectionChange($event)\">\n @for (step of steps(); track step; let i = $index) {\n <mat-step\n [stepControl]=\"step.stepControl() ?? undefined!\"\n [optional]=\"step.optional()\"\n [editable]=\"step.editable()\"\n [state]=\"step.state() ?? ''\"\n [errorMessage]=\"step.errorMessage() ?? ''\">\n <ng-template matStepLabel>\n <span class=\"sd-step__label\">\n <span class=\"sd-step__text\">{{ step.label() }}</span>\n </span>\n </ng-template>\n\n <ng-template matStepContent>\n <ng-container [ngTemplateOutlet]=\"step.bodyTpl()\"></ng-container>\n </ng-template>\n </mat-step>\n }\n <ng-template matStepperIcon=\"number\" let-index=\"index\">\n @if (steps()[index]?.icon(); as icon) {\n <sd-icon class=\"sd-step__icon\" [name]=\"icon\" size=\"18px\"></sd-icon>\n } @else {\n {{ index + 1 }}\n }\n </ng-template>\n <ng-template matStepperIcon=\"edit\"><sd-icon class=\"sd-step__icon\" name=\"check\" size=\"18px\"></sd-icon></ng-template>\n <ng-template matStepperIcon=\"done\"><sd-icon class=\"sd-step__icon\" name=\"check\" size=\"18px\"></sd-icon></ng-template>\n</mat-stepper>\n", styles: [":host{display:block;--sd-stepper-active-color: var(--sd-primary, #005cbb);--sd-stepper-active-bg: var(--sd-primary, #005cbb);--sd-stepper-completed-color: var(--sd-primary, #005cbb);--sd-stepper-line-active-color: var(--sd-primary, #005cbb);--sd-stepper-error-color: var(--sd-error, #ba1a1a);--sd-stepper-pending-bg: var(--sd-disabled-bg, rgba(26, 27, 31, .08));--sd-stepper-pending-color: var(--sd-disabled-text, rgba(26, 27, 31, .6));--sd-stepper-text-color: var(--sd-text, #1a1b1f)}.sd-step__label{display:inline-flex;align-items:center;gap:4px}.sd-step__icon{font-size:18px;width:18px;height:18px;line-height:18px}.sd-step__text{white-space:nowrap}:host ::ng-deep .mat-step-icon{background-color:var(--sd-stepper-pending-bg);color:var(--sd-stepper-pending-color)}:host ::ng-deep .mat-step-icon-selected{background-color:var(--sd-stepper-active-bg)!important;color:#fff!important}:host ::ng-deep .mat-step-icon-state-done,:host ::ng-deep .mat-step-icon-state-edit{background-color:var(--sd-stepper-completed-color)!important;color:#fff!important}:host ::ng-deep .mat-step-icon-state-error{background-color:var(--sd-stepper-error-color)!important;color:#fff!important}:host ::ng-deep .mat-step-label.mat-step-label-active .mat-step-text-label{color:var(--sd-stepper-text-color);font-weight:500}:host ::ng-deep .mat-step-label-selected .mat-step-text-label{color:var(--sd-stepper-active-color);font-weight:600}:host ::ng-deep .mat-stepper-horizontal-line,:host ::ng-deep .mat-stepper-vertical-line:before{border-color:#0000001f}:host ::ng-deep .mat-step-header.cdk-program-focused,:host ::ng-deep .mat-step-header:hover{background-color:#00000005}:host ::ng-deep .mat-step-icon{width:32px;height:32px;border-radius:8px}:host ::ng-deep .mat-step-icon-state-done,:host ::ng-deep .mat-step-icon-state-edit{background:color-mix(in srgb,var(--sd-stepper-completed-color) 12%,var(--sd-surface, #fff))!important;color:var(--sd-stepper-completed-color)!important}:host ::ng-deep .mat-step-icon-selected{background:var(--sd-stepper-active-bg)!important;color:#fff!important}:host ::ng-deep .mat-step-header{border-radius:8px}:host ::ng-deep .mat-step-header:focus-visible{outline:2px solid var(--sd-stepper-active-color);outline-offset:-2px}:host ::ng-deep .mat-step-label{min-width:0}:host ::ng-deep .mat-horizontal-content-container{padding-bottom:16px}:host ::ng-deep .mat-stepper-horizontal-line{min-width:16px}@media(max-width:600px){:host ::ng-deep .mat-horizontal-stepper-header-container{overflow-x:auto;scrollbar-width:thin}:host ::ng-deep .mat-horizontal-stepper-header{padding:12px;min-height:64px;flex-shrink:0}:host ::ng-deep .mat-horizontal-content-container{padding:0 12px 16px}:host ::ng-deep .mat-vertical-stepper-header{padding:16px 12px}:host ::ng-deep .mat-vertical-content-container{margin-left:28px}:host ::ng-deep .sd-step__text{white-space:normal;overflow-wrap:anywhere}:host ::ng-deep .mat-vertical-stepper-header .mat-step-label{white-space:normal}}@media(prefers-reduced-motion:reduce){:host ::ng-deep .mat-stepper-horizontal-line,:host ::ng-deep .mat-horizontal-content-container,:host ::ng-deep .mat-horizontal-stepper-content,:host ::ng-deep .mat-vertical-content-container{transition:none!important;animation:none!important}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: MatStepperModule }, { kind: "component", type: i1.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i1.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i1.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["disableRipple", "color", "labelPosition", "headerPosition", "aria-label", "headerPrefix", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }, { kind: "directive", type: i1.MatStepperIcon, selector: "ng-template[matStepperIcon]", inputs: ["matStepperIcon"] }, { kind: "directive", type: i1.MatStepContent, selector: "ng-template[matStepContent]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
126
126
  }
127
127
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdStepper, decorators: [{
128
128
  type: Component,
129
- args: [{ selector: 'sd-stepper', standalone: true, imports: [SdIcon, MatStepperModule, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- why: `(selectionChange)` b\u00EAn d\u01B0\u1EDBi l\u00E0 output c\u1EE7a `MatStepper` (Angular Material), KH\u00D4NG ph\u1EA3i output c\u1EE7a\n `<sd-stepper>` \u2014 ph\u1EA3i gi\u1EEF nguy\u00EAn t\u00EAn. Output c\u00F4ng khai c\u1EE7a lib \u0111\u00E3 \u0111\u1ED5i th\u00E0nh `selectionChange`. -->\n<mat-stepper\n class=\"sd-stepper\"\n [(selectedIndex)]=\"selectedIndex\"\n [linear]=\"linear()\"\n [orientation]=\"orientation()\"\n [labelPosition]=\"labelPosition()\"\n [headerPosition]=\"headerPosition()\"\n [animationDuration]=\"animationDuration()\"\n [disableRipple]=\"disableRipple()\"\n (selectionChange)=\"onSelectionChange($event)\">\n @for (step of steps(); track step; let i = $index) {\n <mat-step\n [stepControl]=\"step.stepControl() ?? undefined!\"\n [optional]=\"step.optional()\"\n [editable]=\"step.editable()\"\n [state]=\"step.state() ?? ''\"\n [errorMessage]=\"step.errorMessage() ?? ''\">\n <ng-template matStepLabel>\n <span class=\"sd-step__label\">\n @if (step.icon(); as ic) {\n <sd-icon class=\"sd-step__icon\" [name]=\"ic\"></sd-icon>\n }\n <span class=\"sd-step__text\">{{ step.label() }}</span>\n </span>\n </ng-template>\n\n <ng-template matStepContent>\n <ng-container [ngTemplateOutlet]=\"step.bodyTpl()\"></ng-container>\n </ng-template>\n </mat-step>\n }\n</mat-stepper>\n", styles: [":host{display:block;--sd-stepper-active-color: var(--sd-primary, #005cbb);--sd-stepper-active-bg: var(--sd-primary, #005cbb);--sd-stepper-completed-color: var(--sd-primary, #005cbb);--sd-stepper-line-active-color: var(--sd-primary, #005cbb);--sd-stepper-error-color: var(--sd-error, #ba1a1a);--sd-stepper-pending-bg: var(--sd-disabled-bg, rgba(26, 27, 31, .08));--sd-stepper-pending-color: var(--sd-disabled-text, rgba(26, 27, 31, .6));--sd-stepper-text-color: var(--sd-text, #1a1b1f)}.sd-step__label{display:inline-flex;align-items:center;gap:4px}.sd-step__icon{font-size:18px;width:18px;height:18px;line-height:18px}.sd-step__text{white-space:nowrap}:host ::ng-deep .mat-step-icon{background-color:var(--sd-stepper-pending-bg);color:var(--sd-stepper-pending-color)}:host ::ng-deep .mat-step-icon-selected{background-color:var(--sd-stepper-active-bg)!important;color:#fff!important}:host ::ng-deep .mat-step-icon-state-done,:host ::ng-deep .mat-step-icon-state-edit{background-color:var(--sd-stepper-completed-color)!important;color:#fff!important}:host ::ng-deep .mat-step-icon-state-error{background-color:var(--sd-stepper-error-color)!important;color:#fff!important}:host ::ng-deep .mat-step-label.mat-step-label-active .mat-step-text-label{color:var(--sd-stepper-text-color);font-weight:500}:host ::ng-deep .mat-step-label-selected .mat-step-text-label{color:var(--sd-stepper-active-color);font-weight:600}:host ::ng-deep .mat-stepper-horizontal-line,:host ::ng-deep .mat-stepper-vertical-line:before{border-color:#0000001f}:host ::ng-deep .mat-step-header.cdk-program-focused,:host ::ng-deep .mat-step-header:hover{background-color:#00000005}\n"] }]
129
+ args: [{ selector: 'sd-stepper', standalone: true, imports: [SdIcon, MatStepperModule, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- why: `(selectionChange)` b\u00EAn d\u01B0\u1EDBi l\u00E0 output c\u1EE7a `MatStepper` (Angular Material), KH\u00D4NG ph\u1EA3i output c\u1EE7a\n `<sd-stepper>` \u2014 ph\u1EA3i gi\u1EEF nguy\u00EAn t\u00EAn. Output c\u00F4ng khai c\u1EE7a lib \u0111\u00E3 \u0111\u1ED5i th\u00E0nh `selectionChange`. -->\n<mat-stepper\n class=\"sd-stepper\"\n [(selectedIndex)]=\"selectedIndex\"\n [linear]=\"linear()\"\n [orientation]=\"orientation()\"\n [labelPosition]=\"labelPosition()\"\n [headerPosition]=\"headerPosition()\"\n [animationDuration]=\"animationDuration()\"\n [disableRipple]=\"disableRipple()\"\n (selectionChange)=\"onSelectionChange($event)\">\n @for (step of steps(); track step; let i = $index) {\n <mat-step\n [stepControl]=\"step.stepControl() ?? undefined!\"\n [optional]=\"step.optional()\"\n [editable]=\"step.editable()\"\n [state]=\"step.state() ?? ''\"\n [errorMessage]=\"step.errorMessage() ?? ''\">\n <ng-template matStepLabel>\n <span class=\"sd-step__label\">\n <span class=\"sd-step__text\">{{ step.label() }}</span>\n </span>\n </ng-template>\n\n <ng-template matStepContent>\n <ng-container [ngTemplateOutlet]=\"step.bodyTpl()\"></ng-container>\n </ng-template>\n </mat-step>\n }\n <ng-template matStepperIcon=\"number\" let-index=\"index\">\n @if (steps()[index]?.icon(); as icon) {\n <sd-icon class=\"sd-step__icon\" [name]=\"icon\" size=\"18px\"></sd-icon>\n } @else {\n {{ index + 1 }}\n }\n </ng-template>\n <ng-template matStepperIcon=\"edit\"><sd-icon class=\"sd-step__icon\" name=\"check\" size=\"18px\"></sd-icon></ng-template>\n <ng-template matStepperIcon=\"done\"><sd-icon class=\"sd-step__icon\" name=\"check\" size=\"18px\"></sd-icon></ng-template>\n</mat-stepper>\n", styles: [":host{display:block;--sd-stepper-active-color: var(--sd-primary, #005cbb);--sd-stepper-active-bg: var(--sd-primary, #005cbb);--sd-stepper-completed-color: var(--sd-primary, #005cbb);--sd-stepper-line-active-color: var(--sd-primary, #005cbb);--sd-stepper-error-color: var(--sd-error, #ba1a1a);--sd-stepper-pending-bg: var(--sd-disabled-bg, rgba(26, 27, 31, .08));--sd-stepper-pending-color: var(--sd-disabled-text, rgba(26, 27, 31, .6));--sd-stepper-text-color: var(--sd-text, #1a1b1f)}.sd-step__label{display:inline-flex;align-items:center;gap:4px}.sd-step__icon{font-size:18px;width:18px;height:18px;line-height:18px}.sd-step__text{white-space:nowrap}:host ::ng-deep .mat-step-icon{background-color:var(--sd-stepper-pending-bg);color:var(--sd-stepper-pending-color)}:host ::ng-deep .mat-step-icon-selected{background-color:var(--sd-stepper-active-bg)!important;color:#fff!important}:host ::ng-deep .mat-step-icon-state-done,:host ::ng-deep .mat-step-icon-state-edit{background-color:var(--sd-stepper-completed-color)!important;color:#fff!important}:host ::ng-deep .mat-step-icon-state-error{background-color:var(--sd-stepper-error-color)!important;color:#fff!important}:host ::ng-deep .mat-step-label.mat-step-label-active .mat-step-text-label{color:var(--sd-stepper-text-color);font-weight:500}:host ::ng-deep .mat-step-label-selected .mat-step-text-label{color:var(--sd-stepper-active-color);font-weight:600}:host ::ng-deep .mat-stepper-horizontal-line,:host ::ng-deep .mat-stepper-vertical-line:before{border-color:#0000001f}:host ::ng-deep .mat-step-header.cdk-program-focused,:host ::ng-deep .mat-step-header:hover{background-color:#00000005}:host ::ng-deep .mat-step-icon{width:32px;height:32px;border-radius:8px}:host ::ng-deep .mat-step-icon-state-done,:host ::ng-deep .mat-step-icon-state-edit{background:color-mix(in srgb,var(--sd-stepper-completed-color) 12%,var(--sd-surface, #fff))!important;color:var(--sd-stepper-completed-color)!important}:host ::ng-deep .mat-step-icon-selected{background:var(--sd-stepper-active-bg)!important;color:#fff!important}:host ::ng-deep .mat-step-header{border-radius:8px}:host ::ng-deep .mat-step-header:focus-visible{outline:2px solid var(--sd-stepper-active-color);outline-offset:-2px}:host ::ng-deep .mat-step-label{min-width:0}:host ::ng-deep .mat-horizontal-content-container{padding-bottom:16px}:host ::ng-deep .mat-stepper-horizontal-line{min-width:16px}@media(max-width:600px){:host ::ng-deep .mat-horizontal-stepper-header-container{overflow-x:auto;scrollbar-width:thin}:host ::ng-deep .mat-horizontal-stepper-header{padding:12px;min-height:64px;flex-shrink:0}:host ::ng-deep .mat-horizontal-content-container{padding:0 12px 16px}:host ::ng-deep .mat-vertical-stepper-header{padding:16px 12px}:host ::ng-deep .mat-vertical-content-container{margin-left:28px}:host ::ng-deep .sd-step__text{white-space:normal;overflow-wrap:anywhere}:host ::ng-deep .mat-vertical-stepper-header .mat-step-label{white-space:normal}}@media(prefers-reduced-motion:reduce){:host ::ng-deep .mat-stepper-horizontal-line,:host ::ng-deep .mat-horizontal-content-container,:host ::ng-deep .mat-horizontal-stepper-content,:host ::ng-deep .mat-vertical-content-container{transition:none!important;animation:none!important}}\n"] }]
130
130
  }], ctorParameters: () => [], propDecorators: { steps: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdStep), { isSignal: true }] }], selectedIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIndex", required: false }] }, { type: i0.Output, args: ["selectedIndexChange"] }], linear: [{ type: i0.Input, args: [{ isSignal: true, alias: "linear", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], headerPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerPosition", required: false }] }], animationDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationDuration", required: false }] }], disableRipple: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableRipple", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], matStepper: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatStepper), { isSignal: true }] }], autoIdAttr: [{
131
131
  type: HostBinding,
132
132
  args: ['attr.data-autoId']
@@ -1 +1 @@
1
- {"version":3,"file":"sdcorejs-angular-components-stepper.mjs","sources":["../../../projects/sdcorejs-angular/components/stepper/src/step.component.ts","../../../projects/sdcorejs-angular/components/stepper/src/stepper.component.ts","../../../projects/sdcorejs-angular/components/stepper/src/stepper.component.html","../../../projects/sdcorejs-angular/components/stepper/sdcorejs-angular-components-stepper.ts"],"sourcesContent":["import { booleanAttribute, ChangeDetectionStrategy, Component, input, output, TemplateRef, viewChild } from '@angular/core';\nimport { AbstractControl } from '@angular/forms';\n\nexport type SdStepState = 'pending' | 'active' | 'completed' | 'error' | string;\n\n@Component({\n selector: 'sd-step',\n standalone: true,\n // why: identical pattern to <sd-tab> — capture projected content via #body\n // template ref so <sd-stepper> can render it inside mat-step's matStepContent\n // (lazy mount + animation-friendly).\n template: `<ng-template #body><ng-content></ng-content></ng-template>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SdStep {\n label = input.required<string>();\n // Optional Material icon name shown when the step is in 'pending' state\n // (overrides the default numbered indicator).\n icon = input<string | null | undefined>(undefined);\n // Set true to mark the step skippable in linear mode.\n optional = input(false, { transform: booleanAttribute });\n // When false, user cannot return to this step after it's been completed.\n editable = input(true, { transform: booleanAttribute });\n // Reactive form / control. When the stepper is linear, the user can only\n // proceed past this step once stepControl.valid is true.\n stepControl = input<AbstractControl | null | undefined>(undefined);\n // Override the auto-derived state (eg force 'error' from outside on async validation).\n state = input<SdStepState | undefined>(undefined);\n // Error message rendered next to the step header when state is 'error'.\n errorMessage = input<string | undefined>(undefined);\n\n // Emitted when this step transitions to selected.\n selectChange = output<void>();\n\n // Body template captured from projected <ng-content>.\n bodyTpl = viewChild.required<TemplateRef<unknown>>('body');\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n contentChildren,\n effect,\n HostBinding,\n input,\n model,\n output,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { StepperSelectionEvent } from '@angular/cdk/stepper';\nimport { MatStepperModule, MatStepper } from '@angular/material/stepper';\nimport { Color } from '@sdcorejs/utils/models';\nimport { SdStep } from './step.component';\nimport { SdIcon } from '@sdcorejs/angular/modules/icon';\n\n@Component({\n selector: 'sd-stepper',\n standalone: true,\n imports: [SdIcon, MatStepperModule, NgTemplateOutlet],\n templateUrl: './stepper.component.html',\n styleUrl: './stepper.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SdStepper {\n steps = contentChildren(SdStep);\n\n selectedIndex = model<number>(0);\n // why: enforce sequential gating — only valid steps unlock the next.\n linear = input(false, { transform: booleanAttribute });\n orientation = input<'horizontal' | 'vertical'>('horizontal');\n labelPosition = input<'end' | 'bottom'>('end');\n headerPosition = input<'top' | 'bottom'>('top');\n animationDuration = input<string>('500ms');\n disableRipple = input(false, { transform: booleanAttribute });\n // Drives the Core color CSS vars on indicators / connector / line.\n color = input<Color>('primary');\n autoId = input<string | undefined>(undefined);\n\n // Emits {previousIndex, selectedIndex, previousStep, selectedStep}.\n selectionChange = output<StepperSelectionEvent>();\n\n protected matStepper = viewChild(MatStepper);\n\n @HostBinding('attr.data-autoId') get autoIdAttr(): string | null {\n return this.autoId() ?? null;\n }\n\n // Core color CSS vars — same mechanism as <sd-tab-group>.\n @HostBinding('style.--sd-stepper-active-color') get cssActive(): string {\n return `var(--sd-${this.color()})`;\n }\n @HostBinding('style.--sd-stepper-active-bg') get cssActiveBg(): string {\n return `var(--sd-${this.color()})`;\n }\n @HostBinding('style.--sd-stepper-completed-color') get cssCompleted(): string {\n return `var(--sd-${this.color()})`;\n }\n @HostBinding('style.--sd-stepper-line-active-color') get cssLine(): string {\n return `var(--sd-${this.color()})`;\n }\n\n constructor() {\n // why: clamp selectedIndex when a step is removed past the active one.\n effect(() => {\n const len = this.steps().length;\n const cur = untracked(() => this.selectedIndex());\n if (len > 0 && cur >= len) {\n this.selectedIndex.set(Math.max(0, len - 1));\n }\n });\n }\n\n next(): void {\n this.matStepper()?.next();\n }\n\n previous(): void {\n this.matStepper()?.previous();\n }\n\n reset(): void {\n this.matStepper()?.reset();\n }\n\n goTo(index: number): void {\n const len = this.steps().length;\n if (len === 0) {\n this.selectedIndex.set(0);\n return;\n }\n this.selectedIndex.set(Math.max(0, Math.min(index, len - 1)));\n }\n\n protected onSelectionChange(ev: StepperSelectionEvent): void {\n this.selectionChange.emit(ev);\n // Forward to each step that just became selected so consumer can react.\n const step = this.steps()[ev.selectedIndex];\n step?.selectChange.emit();\n }\n}\n","<!-- why: `(selectionChange)` bên dưới là output của `MatStepper` (Angular Material), KHÔNG phải output của\n `<sd-stepper>` — phải giữ nguyên tên. Output công khai của lib đã đổi thành `selectionChange`. -->\n<mat-stepper\n class=\"sd-stepper\"\n [(selectedIndex)]=\"selectedIndex\"\n [linear]=\"linear()\"\n [orientation]=\"orientation()\"\n [labelPosition]=\"labelPosition()\"\n [headerPosition]=\"headerPosition()\"\n [animationDuration]=\"animationDuration()\"\n [disableRipple]=\"disableRipple()\"\n (selectionChange)=\"onSelectionChange($event)\">\n @for (step of steps(); track step; let i = $index) {\n <mat-step\n [stepControl]=\"step.stepControl() ?? undefined!\"\n [optional]=\"step.optional()\"\n [editable]=\"step.editable()\"\n [state]=\"step.state() ?? ''\"\n [errorMessage]=\"step.errorMessage() ?? ''\">\n <ng-template matStepLabel>\n <span class=\"sd-step__label\">\n @if (step.icon(); as ic) {\n <sd-icon class=\"sd-step__icon\" [name]=\"ic\"></sd-icon>\n }\n <span class=\"sd-step__text\">{{ step.label() }}</span>\n </span>\n </ng-template>\n\n <ng-template matStepContent>\n <ng-container [ngTemplateOutlet]=\"step.bodyTpl()\"></ng-container>\n </ng-template>\n </mat-step>\n }\n</mat-stepper>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAca,MAAM,CAAA;IACjB,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU;;;IAGhC,IAAI,GAAG,KAAK,CAA4B,SAAS;6EAAC;;IAElD,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAExD,QAAQ,GAAG,KAAK,CAAC,IAAI,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;;IAGvD,WAAW,GAAG,KAAK,CAAqC,SAAS;oFAAC;;IAElE,KAAK,GAAG,KAAK,CAA0B,SAAS;8EAAC;;IAEjD,YAAY,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AAA,EAAA,EAAA,CAAA,cAAA,EAAA,QAAA,EAAA,6BAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAKzC,SAAS,EAAA,UAAA,EAAA,CAAA;kBARrB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,EAAA,UAAA,EACV,IAAI,EAAA,OAAA,EACP,CAAC,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,EAAA,eAAA,EAGpC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,q6CAAA,EAAA,MAAA,EAAA,CAAA,onDAAA,CAAA,EAAA;AAGvB,SAAA,CAAA,EAAA,cAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,MAAM,omCAiBG,UAAU,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA;sBAE1C,WAAW;uBAAC,kBAAkB;;sBAK9B,WAAW;uBAAC,iCAAiC;;sBAG7C,WAAW;uBAAC,8BAA8B;;sBAG1C,WAAW;uBAAC,oCAAoC;;sBAGhD,WAAW;uBAAC,sCAAsC;;;AE9DrD;;AAEG;;"}
1
+ {"version":3,"file":"sdcorejs-angular-components-stepper.mjs","sources":["../../../projects/sdcorejs-angular/components/stepper/src/step.component.ts","../../../projects/sdcorejs-angular/components/stepper/src/stepper.component.ts","../../../projects/sdcorejs-angular/components/stepper/src/stepper.component.html","../../../projects/sdcorejs-angular/components/stepper/sdcorejs-angular-components-stepper.ts"],"sourcesContent":["import { booleanAttribute, ChangeDetectionStrategy, Component, input, output, TemplateRef, viewChild } from '@angular/core';\nimport { AbstractControl } from '@angular/forms';\n\nexport type SdStepState = 'pending' | 'active' | 'completed' | 'error' | string;\n\n@Component({\n selector: 'sd-step',\n standalone: true,\n // why: identical pattern to <sd-tab> — capture projected content via #body\n // template ref so <sd-stepper> can render it inside mat-step's matStepContent\n // (lazy mount + animation-friendly).\n template: `<ng-template #body><ng-content></ng-content></ng-template>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SdStep {\n label = input.required<string>();\n // Optional Material icon name shown when the step is in 'pending' state\n // (overrides the default numbered indicator).\n icon = input<string | null | undefined>(undefined);\n // Set true to mark the step skippable in linear mode.\n optional = input(false, { transform: booleanAttribute });\n // When false, user cannot return to this step after it's been completed.\n editable = input(true, { transform: booleanAttribute });\n // Reactive form / control. When the stepper is linear, the user can only\n // proceed past this step once stepControl.valid is true.\n stepControl = input<AbstractControl | null | undefined>(undefined);\n // Override the auto-derived state (eg force 'error' from outside on async validation).\n state = input<SdStepState | undefined>(undefined);\n // Error message rendered next to the step header when state is 'error'.\n errorMessage = input<string | undefined>(undefined);\n\n // Emitted when this step transitions to selected.\n selectChange = output<void>();\n\n // Body template captured from projected <ng-content>.\n bodyTpl = viewChild.required<TemplateRef<unknown>>('body');\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n contentChildren,\n effect,\n HostBinding,\n input,\n model,\n output,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { StepperSelectionEvent } from '@angular/cdk/stepper';\nimport { MatStepperModule, MatStepper } from '@angular/material/stepper';\nimport { Color } from '@sdcorejs/utils/models';\nimport { SdStep } from './step.component';\nimport { SdIcon } from '@sdcorejs/angular/modules/icon';\n\n@Component({\n selector: 'sd-stepper',\n standalone: true,\n imports: [SdIcon, MatStepperModule, NgTemplateOutlet],\n templateUrl: './stepper.component.html',\n styleUrl: './stepper.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SdStepper {\n steps = contentChildren(SdStep);\n\n selectedIndex = model<number>(0);\n // why: enforce sequential gating — only valid steps unlock the next.\n linear = input(false, { transform: booleanAttribute });\n orientation = input<'horizontal' | 'vertical'>('horizontal');\n labelPosition = input<'end' | 'bottom'>('end');\n headerPosition = input<'top' | 'bottom'>('top');\n animationDuration = input<string>('500ms');\n disableRipple = input(false, { transform: booleanAttribute });\n // Drives the Core color CSS vars on indicators / connector / line.\n color = input<Color>('primary');\n autoId = input<string | undefined>(undefined);\n\n // Emits {previousIndex, selectedIndex, previousStep, selectedStep}.\n selectionChange = output<StepperSelectionEvent>();\n\n protected matStepper = viewChild(MatStepper);\n\n @HostBinding('attr.data-autoId') get autoIdAttr(): string | null {\n return this.autoId() ?? null;\n }\n\n // Core color CSS vars — same mechanism as <sd-tab-group>.\n @HostBinding('style.--sd-stepper-active-color') get cssActive(): string {\n return `var(--sd-${this.color()})`;\n }\n @HostBinding('style.--sd-stepper-active-bg') get cssActiveBg(): string {\n return `var(--sd-${this.color()})`;\n }\n @HostBinding('style.--sd-stepper-completed-color') get cssCompleted(): string {\n return `var(--sd-${this.color()})`;\n }\n @HostBinding('style.--sd-stepper-line-active-color') get cssLine(): string {\n return `var(--sd-${this.color()})`;\n }\n\n constructor() {\n // why: clamp selectedIndex when a step is removed past the active one.\n effect(() => {\n const len = this.steps().length;\n const cur = untracked(() => this.selectedIndex());\n if (len > 0 && cur >= len) {\n this.selectedIndex.set(Math.max(0, len - 1));\n }\n });\n }\n\n next(): void {\n this.matStepper()?.next();\n }\n\n previous(): void {\n this.matStepper()?.previous();\n }\n\n reset(): void {\n this.matStepper()?.reset();\n }\n\n goTo(index: number): void {\n const len = this.steps().length;\n if (len === 0) {\n this.selectedIndex.set(0);\n return;\n }\n this.selectedIndex.set(Math.max(0, Math.min(index, len - 1)));\n }\n\n protected onSelectionChange(ev: StepperSelectionEvent): void {\n this.selectionChange.emit(ev);\n // Forward to each step that just became selected so consumer can react.\n const step = this.steps()[ev.selectedIndex];\n step?.selectChange.emit();\n }\n}\n","<!-- why: `(selectionChange)` bên dưới là output của `MatStepper` (Angular Material), KHÔNG phải output của\n `<sd-stepper>` — phải giữ nguyên tên. Output công khai của lib đã đổi thành `selectionChange`. -->\n<mat-stepper\n class=\"sd-stepper\"\n [(selectedIndex)]=\"selectedIndex\"\n [linear]=\"linear()\"\n [orientation]=\"orientation()\"\n [labelPosition]=\"labelPosition()\"\n [headerPosition]=\"headerPosition()\"\n [animationDuration]=\"animationDuration()\"\n [disableRipple]=\"disableRipple()\"\n (selectionChange)=\"onSelectionChange($event)\">\n @for (step of steps(); track step; let i = $index) {\n <mat-step\n [stepControl]=\"step.stepControl() ?? undefined!\"\n [optional]=\"step.optional()\"\n [editable]=\"step.editable()\"\n [state]=\"step.state() ?? ''\"\n [errorMessage]=\"step.errorMessage() ?? ''\">\n <ng-template matStepLabel>\n <span class=\"sd-step__label\">\n <span class=\"sd-step__text\">{{ step.label() }}</span>\n </span>\n </ng-template>\n\n <ng-template matStepContent>\n <ng-container [ngTemplateOutlet]=\"step.bodyTpl()\"></ng-container>\n </ng-template>\n </mat-step>\n }\n <ng-template matStepperIcon=\"number\" let-index=\"index\">\n @if (steps()[index]?.icon(); as icon) {\n <sd-icon class=\"sd-step__icon\" [name]=\"icon\" size=\"18px\"></sd-icon>\n } @else {\n {{ index + 1 }}\n }\n </ng-template>\n <ng-template matStepperIcon=\"edit\"><sd-icon class=\"sd-step__icon\" name=\"check\" size=\"18px\"></sd-icon></ng-template>\n <ng-template matStepperIcon=\"done\"><sd-icon class=\"sd-step__icon\" name=\"check\" size=\"18px\"></sd-icon></ng-template>\n</mat-stepper>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAca,MAAM,CAAA;IACjB,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU;;;IAG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