@tekus/design-system 5.29.0 → 5.29.2

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.
@@ -11,8 +11,8 @@ class BreadCrumpsComponent {
11
11
  this.router = inject(Router);
12
12
  /** Optional manual items. If provided, route listening is ignored. */
13
13
  this.items = input(null, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
14
- /** Size of the breadcrumbs title. Can be 'small' (24px) or 'large' (32px). Default is 'small'. */
15
- this.size = input('small', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
14
+ /** Size of the breadcrumbs title. Can be 'small' (24px) or 'large' (32px). Default is 'large'. */
15
+ this.size = input('large', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
16
16
  /** If true, only the current (last) item will be displayed. */
17
17
  this.onlyCurrent = input(false, ...(ngDevMode ? [{ debugName: "onlyCurrent" }] : /* istanbul ignore next */ []));
18
18
  /** Signal that updates on every successful navigation */
@@ -50,11 +50,11 @@ class BreadCrumpsComponent {
50
50
  }
51
51
  }
52
52
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: BreadCrumpsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
53
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: BreadCrumpsComponent, isStandalone: true, selector: "tk-bread-crumps", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, onlyCurrent: { classPropertyName: "onlyCurrent", publicName: "onlyCurrent", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<nav class=\"tk-breadcrumps\" [class]=\"'tk-breadcrumps--size-' + size()\">\n <ul class=\"tk-breadcrumps__list\">\n @for (item of (onlyCurrent() ? [routeItems()[routeItems().length - 1]] : routeItems()); track $index; let last = $last) {\n @if (item) {\n <li class=\"tk-breadcrumps__item\">\n @if (!last && item.url) {\n <a [routerLink]=\"item.url\" class=\"tk-breadcrumps__link\">\n {{ item.label }}\n </a>\n } @else {\n <span [class.tk-breadcrumps__current]=\"last\">\n {{ item.label }}\n </span>\n }\n\n @if (!last) {\n <span class=\"tk-breadcrumps__separator\">/</span>\n }\n </li>\n }\n }\n </ul>\n</nav>\n", styles: [":host{display:block;min-width:0;flex:1;overflow:hidden}.tk-breadcrumps{display:flex;align-items:center;width:100%}.tk-breadcrumps__list{display:flex;flex-wrap:nowrap;list-style:none;padding:0;margin:0;gap:0;font-family:var(--tk-font-family, \"Poppins\", sans-serif);font-size:var(--tk-font-size-paragraph-s, .875rem);width:100%;overflow:hidden}.tk-breadcrumps__item{display:flex;align-items:center;color:var(--tk-color-text-subtle, #5d5d5e);flex-shrink:3;min-width:1.5rem}.tk-breadcrumps__item:last-child{flex-shrink:1;min-width:3rem}.tk-breadcrumps__link{color:inherit;text-decoration:none;transition:color .2s ease}.tk-breadcrumps__link:hover{color:var(--tk-color-primary-default, #16006f);text-decoration:underline}.tk-breadcrumps__link,.tk-breadcrumps span:not(.tk-breadcrumps__separator){white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;min-width:0}.tk-breadcrumps__separator{margin:0 .25rem;color:var(--tk-color-text-muted, #8a8a8b);-webkit-user-select:none;user-select:none;flex-shrink:0}.tk-breadcrumps__current{color:var(--tk-color-text-default, #191a1b);font-weight:var(--tk-font-weight-600, 600)}.tk-breadcrumps--size-small .tk-breadcrumps__list{font-size:24px}.tk-breadcrumps--size-large .tk-breadcrumps__list{font-size:var(--tk-font-size-headers-l, 2rem)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] }); }
53
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: BreadCrumpsComponent, isStandalone: true, selector: "tk-bread-crumps", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, onlyCurrent: { classPropertyName: "onlyCurrent", publicName: "onlyCurrent", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<nav class=\"tk-breadcrumps\" [class.tk-breadcrumps--size-small]=\"size() === 'small'\" [class.tk-breadcrumps--size-large]=\"size() === 'large'\">\n <ul class=\"tk-breadcrumps__list\">\n @for (item of (onlyCurrent() ? [routeItems()[routeItems().length - 1]] : routeItems()); track $index; let last = $last) {\n @if (item) {\n <li class=\"tk-breadcrumps__item\">\n @if (!last && item.url) {\n <a [routerLink]=\"item.url\" class=\"tk-breadcrumps__link\">\n {{ item.label }}\n </a>\n } @else {\n <span [class.tk-breadcrumps__current]=\"last\">\n {{ item.label }}\n </span>\n }\n\n @if (!last) {\n <span class=\"tk-breadcrumps__separator\">/</span>\n }\n </li>\n }\n }\n </ul>\n</nav>\n", styles: [":host{display:block;min-width:0;flex:1;overflow:hidden}.tk-breadcrumps{display:flex;align-items:center;width:100%}.tk-breadcrumps__list{display:flex;flex-wrap:nowrap;list-style:none;padding:0;margin:0;gap:0;font-family:var(--tk-font-family, \"Poppins\", sans-serif);font-size:var(--tk-font-size-paragraph-s, .875rem);width:100%;overflow:hidden}.tk-breadcrumps__item{display:flex;align-items:center;color:var(--tk-color-text-subtle, #5d5d5e);flex-shrink:3;min-width:1.5rem}.tk-breadcrumps__item:last-child{flex-shrink:1;min-width:3rem}.tk-breadcrumps__link{color:inherit;font-size:inherit;text-decoration:none;transition:color .2s ease}.tk-breadcrumps__link:hover{color:var(--tk-color-primary-default, #16006f);text-decoration:underline}.tk-breadcrumps__link,.tk-breadcrumps span:not(.tk-breadcrumps__separator){white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;min-width:0;font-size:inherit}.tk-breadcrumps__separator{margin:0 .25rem;color:var(--tk-color-text-muted, #8a8a8b);-webkit-user-select:none;user-select:none;flex-shrink:0}.tk-breadcrumps__current{color:var(--tk-color-text-default, #191a1b);font-weight:var(--tk-font-weight-600, 600);font-size:inherit}.tk-breadcrumps--size-small .tk-breadcrumps__list{font-size:24px}.tk-breadcrumps--size-large .tk-breadcrumps__list{font-size:var(--tk-font-size-headers-l, 2rem)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] }); }
54
54
  }
55
55
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: BreadCrumpsComponent, decorators: [{
56
56
  type: Component,
57
- args: [{ selector: 'tk-bread-crumps', standalone: true, imports: [CommonModule, RouterModule], template: "<nav class=\"tk-breadcrumps\" [class]=\"'tk-breadcrumps--size-' + size()\">\n <ul class=\"tk-breadcrumps__list\">\n @for (item of (onlyCurrent() ? [routeItems()[routeItems().length - 1]] : routeItems()); track $index; let last = $last) {\n @if (item) {\n <li class=\"tk-breadcrumps__item\">\n @if (!last && item.url) {\n <a [routerLink]=\"item.url\" class=\"tk-breadcrumps__link\">\n {{ item.label }}\n </a>\n } @else {\n <span [class.tk-breadcrumps__current]=\"last\">\n {{ item.label }}\n </span>\n }\n\n @if (!last) {\n <span class=\"tk-breadcrumps__separator\">/</span>\n }\n </li>\n }\n }\n </ul>\n</nav>\n", styles: [":host{display:block;min-width:0;flex:1;overflow:hidden}.tk-breadcrumps{display:flex;align-items:center;width:100%}.tk-breadcrumps__list{display:flex;flex-wrap:nowrap;list-style:none;padding:0;margin:0;gap:0;font-family:var(--tk-font-family, \"Poppins\", sans-serif);font-size:var(--tk-font-size-paragraph-s, .875rem);width:100%;overflow:hidden}.tk-breadcrumps__item{display:flex;align-items:center;color:var(--tk-color-text-subtle, #5d5d5e);flex-shrink:3;min-width:1.5rem}.tk-breadcrumps__item:last-child{flex-shrink:1;min-width:3rem}.tk-breadcrumps__link{color:inherit;text-decoration:none;transition:color .2s ease}.tk-breadcrumps__link:hover{color:var(--tk-color-primary-default, #16006f);text-decoration:underline}.tk-breadcrumps__link,.tk-breadcrumps span:not(.tk-breadcrumps__separator){white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;min-width:0}.tk-breadcrumps__separator{margin:0 .25rem;color:var(--tk-color-text-muted, #8a8a8b);-webkit-user-select:none;user-select:none;flex-shrink:0}.tk-breadcrumps__current{color:var(--tk-color-text-default, #191a1b);font-weight:var(--tk-font-weight-600, 600)}.tk-breadcrumps--size-small .tk-breadcrumps__list{font-size:24px}.tk-breadcrumps--size-large .tk-breadcrumps__list{font-size:var(--tk-font-size-headers-l, 2rem)}\n"] }]
57
+ args: [{ selector: 'tk-bread-crumps', standalone: true, imports: [CommonModule, RouterModule], template: "<nav class=\"tk-breadcrumps\" [class.tk-breadcrumps--size-small]=\"size() === 'small'\" [class.tk-breadcrumps--size-large]=\"size() === 'large'\">\n <ul class=\"tk-breadcrumps__list\">\n @for (item of (onlyCurrent() ? [routeItems()[routeItems().length - 1]] : routeItems()); track $index; let last = $last) {\n @if (item) {\n <li class=\"tk-breadcrumps__item\">\n @if (!last && item.url) {\n <a [routerLink]=\"item.url\" class=\"tk-breadcrumps__link\">\n {{ item.label }}\n </a>\n } @else {\n <span [class.tk-breadcrumps__current]=\"last\">\n {{ item.label }}\n </span>\n }\n\n @if (!last) {\n <span class=\"tk-breadcrumps__separator\">/</span>\n }\n </li>\n }\n }\n </ul>\n</nav>\n", styles: [":host{display:block;min-width:0;flex:1;overflow:hidden}.tk-breadcrumps{display:flex;align-items:center;width:100%}.tk-breadcrumps__list{display:flex;flex-wrap:nowrap;list-style:none;padding:0;margin:0;gap:0;font-family:var(--tk-font-family, \"Poppins\", sans-serif);font-size:var(--tk-font-size-paragraph-s, .875rem);width:100%;overflow:hidden}.tk-breadcrumps__item{display:flex;align-items:center;color:var(--tk-color-text-subtle, #5d5d5e);flex-shrink:3;min-width:1.5rem}.tk-breadcrumps__item:last-child{flex-shrink:1;min-width:3rem}.tk-breadcrumps__link{color:inherit;font-size:inherit;text-decoration:none;transition:color .2s ease}.tk-breadcrumps__link:hover{color:var(--tk-color-primary-default, #16006f);text-decoration:underline}.tk-breadcrumps__link,.tk-breadcrumps span:not(.tk-breadcrumps__separator){white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;min-width:0;font-size:inherit}.tk-breadcrumps__separator{margin:0 .25rem;color:var(--tk-color-text-muted, #8a8a8b);-webkit-user-select:none;user-select:none;flex-shrink:0}.tk-breadcrumps__current{color:var(--tk-color-text-default, #191a1b);font-weight:var(--tk-font-weight-600, 600);font-size:inherit}.tk-breadcrumps--size-small .tk-breadcrumps__list{font-size:24px}.tk-breadcrumps--size-large .tk-breadcrumps__list{font-size:var(--tk-font-size-headers-l, 2rem)}\n"] }]
58
58
  }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], onlyCurrent: [{ type: i0.Input, args: [{ isSignal: true, alias: "onlyCurrent", required: false }] }] } });
59
59
 
60
60
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"tekus-design-system-components-bread-crumps.mjs","sources":["../../../projects/design-system/components/bread-crumps/src/bread-crumps.component.ts","../../../projects/design-system/components/bread-crumps/src/bread-crumps.component.html","../../../projects/design-system/components/bread-crumps/tekus-design-system-components-bread-crumps.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, computed, inject, input } from '@angular/core';\nimport { ActivatedRouteSnapshot, NavigationEnd, Router, RouterModule, UrlSegment } from '@angular/router';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { filter, map, startWith } from 'rxjs/operators';\nimport { BreadCrumpItem } from './bread-crumps.types';\n\n@Component({\n selector: 'tk-bread-crumps',\n standalone: true,\n imports: [CommonModule, RouterModule],\n templateUrl: './bread-crumps.component.html',\n styleUrl: './bread-crumps.component.scss',\n})\nexport class BreadCrumpsComponent {\n private readonly router = inject(Router);\n\n /** Optional manual items. If provided, route listening is ignored. */\n items = input<BreadCrumpItem[] | null>(null);\n\n /** Size of the breadcrumbs title. Can be 'small' (24px) or 'large' (32px). Default is 'small'. */\n size = input<'small' | 'large'>('small');\n\n /** If true, only the current (last) item will be displayed. */\n onlyCurrent = input<boolean>(false);\n\n /** Signal that updates on every successful navigation */\n private readonly navigationEnd = toSignal(\n this.router.events.pipe(\n filter((event) => event instanceof NavigationEnd),\n startWith(null),\n map(() => this.router.routerState.snapshot.root)\n )\n );\n\n /** Computed list of breadcrumbs derived from the current route state */\n routeItems = computed(() => {\n const manualItems = this.items();\n if (manualItems) return manualItems;\n\n const root = this.navigationEnd();\n if (!root) return [];\n\n const breadcrumbs: BreadCrumpItem[] = [];\n this.buildBreadcrumbs(root, '', breadcrumbs);\n return breadcrumbs;\n });\n\n private buildBreadcrumbs(\n route: ActivatedRouteSnapshot,\n url: string = '',\n breadcrumbs: BreadCrumpItem[] = []\n ): void {\n const children: ActivatedRouteSnapshot[] = route.children;\n\n if (children.length === 0) {\n return;\n }\n\n for (const child of children) {\n const routeURL: string = child.url\n .map((segment: UrlSegment) => segment.path)\n .join('/');\n if (routeURL !== '') {\n url += `/${routeURL}`;\n }\n\n const label = child.data['breadcrumb'];\n if (label) {\n breadcrumbs.push({ label, url });\n }\n\n this.buildBreadcrumbs(child, url, breadcrumbs);\n }\n }\n}\n","<nav class=\"tk-breadcrumps\" [class]=\"'tk-breadcrumps--size-' + size()\">\n <ul class=\"tk-breadcrumps__list\">\n @for (item of (onlyCurrent() ? [routeItems()[routeItems().length - 1]] : routeItems()); track $index; let last = $last) {\n @if (item) {\n <li class=\"tk-breadcrumps__item\">\n @if (!last && item.url) {\n <a [routerLink]=\"item.url\" class=\"tk-breadcrumps__link\">\n {{ item.label }}\n </a>\n } @else {\n <span [class.tk-breadcrumps__current]=\"last\">\n {{ item.label }}\n </span>\n }\n\n @if (!last) {\n <span class=\"tk-breadcrumps__separator\">/</span>\n }\n </li>\n }\n }\n </ul>\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAca,oBAAoB,CAAA;AAPjC,IAAA,WAAA,GAAA;AAQmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;AAGxC,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAA0B,IAAI,4EAAC;;AAG5C,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAoB,OAAO,2EAAC;;AAGxC,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAU,KAAK,kFAAC;;QAGlB,IAAA,CAAA,aAAa,GAAG,QAAQ,CACvC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CACrB,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,YAAY,aAAa,CAAC,EACjD,SAAS,CAAC,IAAI,CAAC,EACf,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CACjD,CACF;;AAGD,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;AACzB,YAAA,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,EAAE;AAChC,YAAA,IAAI,WAAW;AAAE,gBAAA,OAAO,WAAW;AAEnC,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE;AACjC,YAAA,IAAI,CAAC,IAAI;AAAE,gBAAA,OAAO,EAAE;YAEpB,MAAM,WAAW,GAAqB,EAAE;YACxC,IAAI,CAAC,gBAAgB,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AAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECdjC,mwBAuBA,EAAA,MAAA,EAAA,CAAA,+wCAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDbY,YAAY,8BAAE,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAIzB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAPhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,cACf,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAE,YAAY,CAAC,EAAA,QAAA,EAAA,mwBAAA,EAAA,MAAA,EAAA,CAAA,+wCAAA,CAAA,EAAA;;;AEVvC;;AAEG;;;;"}
1
+ {"version":3,"file":"tekus-design-system-components-bread-crumps.mjs","sources":["../../../projects/design-system/components/bread-crumps/src/bread-crumps.component.ts","../../../projects/design-system/components/bread-crumps/src/bread-crumps.component.html","../../../projects/design-system/components/bread-crumps/tekus-design-system-components-bread-crumps.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, computed, inject, input } from '@angular/core';\nimport { ActivatedRouteSnapshot, NavigationEnd, Router, RouterModule, UrlSegment } from '@angular/router';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { filter, map, startWith } from 'rxjs/operators';\nimport { BreadCrumpItem } from './bread-crumps.types';\n\n@Component({\n selector: 'tk-bread-crumps',\n standalone: true,\n imports: [CommonModule, RouterModule],\n templateUrl: './bread-crumps.component.html',\n styleUrl: './bread-crumps.component.scss',\n})\nexport class BreadCrumpsComponent {\n private readonly router = inject(Router);\n\n /** Optional manual items. If provided, route listening is ignored. */\n items = input<BreadCrumpItem[] | null>(null);\n\n /** Size of the breadcrumbs title. Can be 'small' (24px) or 'large' (32px). Default is 'large'. */\n size = input<'small' | 'large'>('large');\n\n /** If true, only the current (last) item will be displayed. */\n onlyCurrent = input<boolean>(false);\n\n /** Signal that updates on every successful navigation */\n private readonly navigationEnd = toSignal(\n this.router.events.pipe(\n filter((event) => event instanceof NavigationEnd),\n startWith(null),\n map(() => this.router.routerState.snapshot.root)\n )\n );\n\n /** Computed list of breadcrumbs derived from the current route state */\n routeItems = computed(() => {\n const manualItems = this.items();\n if (manualItems) return manualItems;\n\n const root = this.navigationEnd();\n if (!root) return [];\n\n const breadcrumbs: BreadCrumpItem[] = [];\n this.buildBreadcrumbs(root, '', breadcrumbs);\n return breadcrumbs;\n });\n\n private buildBreadcrumbs(\n route: ActivatedRouteSnapshot,\n url: string = '',\n breadcrumbs: BreadCrumpItem[] = []\n ): void {\n const children: ActivatedRouteSnapshot[] = route.children;\n\n if (children.length === 0) {\n return;\n }\n\n for (const child of children) {\n const routeURL: string = child.url\n .map((segment: UrlSegment) => segment.path)\n .join('/');\n if (routeURL !== '') {\n url += `/${routeURL}`;\n }\n\n const label = child.data['breadcrumb'];\n if (label) {\n breadcrumbs.push({ label, url });\n }\n\n this.buildBreadcrumbs(child, url, breadcrumbs);\n }\n }\n}\n","<nav class=\"tk-breadcrumps\" [class.tk-breadcrumps--size-small]=\"size() === 'small'\" [class.tk-breadcrumps--size-large]=\"size() === 'large'\">\n <ul class=\"tk-breadcrumps__list\">\n @for (item of (onlyCurrent() ? [routeItems()[routeItems().length - 1]] : routeItems()); track $index; let last = $last) {\n @if (item) {\n <li class=\"tk-breadcrumps__item\">\n @if (!last && item.url) {\n <a [routerLink]=\"item.url\" class=\"tk-breadcrumps__link\">\n {{ item.label }}\n </a>\n } @else {\n <span [class.tk-breadcrumps__current]=\"last\">\n {{ item.label }}\n </span>\n }\n\n @if (!last) {\n <span class=\"tk-breadcrumps__separator\">/</span>\n }\n </li>\n }\n }\n </ul>\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAca,oBAAoB,CAAA;AAPjC,IAAA,WAAA,GAAA;AAQmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;AAGxC,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAA0B,IAAI,4EAAC;;AAG5C,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAoB,OAAO,2EAAC;;AAGxC,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAU,KAAK,kFAAC;;QAGlB,IAAA,CAAA,aAAa,GAAG,QAAQ,CACvC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CACrB,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,YAAY,aAAa,CAAC,EACjD,SAAS,CAAC,IAAI,CAAC,EACf,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CACjD,CACF;;AAGD,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;AACzB,YAAA,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,EAAE;AAChC,YAAA,IAAI,WAAW;AA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,CAAA,q0CAAA,CAAA,EAAA;;;AEVvC;;AAEG;;;;"}
@@ -235,11 +235,11 @@ class DrawerComponent {
235
235
  this.returnValueOnClose = null;
236
236
  }
237
237
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
238
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: DrawerComponent, isStandalone: true, selector: "tk-drawer", inputs: { dialogRef: { classPropertyName: "dialogRef", publicName: "dialogRef", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, headerAction: { classPropertyName: "headerAction", publicName: "headerAction", isSignal: true, isRequired: false, transformFunction: null }, tag: { classPropertyName: "tag", publicName: "tag", isSignal: true, isRequired: false, transformFunction: null }, subtle: { classPropertyName: "subtle", publicName: "subtle", isSignal: true, isRequired: false, transformFunction: null }, hasTabs: { classPropertyName: "hasTabs", publicName: "hasTabs", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, interceptor: { classPropertyName: "interceptor", publicName: "interceptor", isSignal: true, isRequired: false, transformFunction: null }, isOpened: { classPropertyName: "isOpened", publicName: "isOpened", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpened: "isOpenedChange", closed: "closed" }, viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<p-drawer\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissible]=\"dismissible()\"\n [closeOnEscape]=\"true\"\n position=\"right\"\n [style]=\"drawerStyle()\"\n [styleClass]=\"'tk-drawer'\"\n [class.tk-drawer--has-scroll]=\"hasScroll\"\n [class.tk-drawer--has-tabs]=\"hasTabs()\">\n @if (title() || hasHeaderAction()) {\n <ng-template pTemplate=\"header\">\n <div class=\"tk-drawer__header\">\n <div class=\"tk-drawer__title-container\">\n <h2 class=\"tk-drawer__title\" [title]=\"title()\">{{ title() }}</h2>\n @if (tag() || subtle()) {\n <div class=\"tk-drawer__subtitle\">\n @if (tag()) {\n <tk-tag [value]=\"tag()!\" severity=\"secondary\" />\n }\n @if (subtle()) {\n <span class=\"tk-drawer__subtle\">{{ subtle() }}</span>\n }\n </div>\n }\n </div>\n @if (hasHeaderAction()) {\n <div class=\"tk-drawer__actions\">\n <tk-button\n [label]=\"headerAction()!.label\"\n [severity]=\"headerAction()!.severity\"\n [variant]=\"headerAction()!.variant\"\n (clicked)=\"\n handleHeaderAction(\n headerAction()!.action,\n headerAction()!.returnValue\n )\n \" />\n </div>\n }\n </div>\n </ng-template>\n }\n\n <section class=\"tk-drawer__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n</p-drawer>\n", styles: [":host ::ng-deep .tk-drawer{max-height:100vh;display:flex;flex-direction:column}:host ::ng-deep .tk-drawer__content{flex:1;overflow-y:auto;padding:var(--tk-spacing-padding-m, 1.5rem)}:host ::ng-deep .tk-drawer--has-tabs .p-drawer-content{padding:var(--tk-spacing-padding-none);overflow-y:hidden}:host ::ng-deep .tk-drawer--has-tabs .tk-drawer__content{padding:var(--tk-spacing-padding-none);overflow-y:hidden}:host ::ng-deep .tk-drawer--has-tabs .p-tabpanels,:host ::ng-deep .tk-drawer--has-tabs .p-tabpanel{padding:var(--tk-spacing-padding-none)}:host ::ng-deep .p-drawer-content{overflow-y:auto;display:flex;flex-direction:column;flex:1}:host ::ng-deep .p-drawer-close-button{color:var(--tk-color-base-surface-500, #8a8a8b);border-radius:50%}:host ::ng-deep .p-drawer-close-button:hover{background:var(--tk-color-base-surface-100, #f0f0f0)!important;color:var(--tk-color-base-surface-500, #8a8a8b)}.tk-drawer--has-scroll .p-drawer-header{border-bottom:1px solid var(--tk-color-base-surface-200, #e2e8f0);box-shadow:0 2px 4px #00000005}.tk-drawer__header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:var(--tk-spacing-base-100, 1rem);flex-shrink:0;width:calc(100% - var(--tk-spacing-base-250, 2.5rem))}.tk-drawer__title-container{display:flex;flex-direction:column;flex:1;min-width:0}.tk-drawer__title{margin:0;font-size:var(--tk-font-size-headers-s, 1.125rem);font-weight:var(--tk-font-weight-600, 600);color:var(--tk-color-text-default, #212121);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.tk-drawer__subtitle{display:flex;flex-direction:row;align-items:center;gap:var(--tk-spacing-base-50, .5rem)}.tk-drawer__subtle{font-size:var(--tk-font-size-body-xs, .75rem);color:var(--tk-color-base-surface-500, #8a8a8b);font-weight:var(--tk-font-weight-400, 400)}.tk-drawer__actions{display:flex;flex-direction:row;align-items:center;gap:var(--tk-spacing-base-50, .5rem);flex-shrink:0;padding-right:var(--tk-spacing-padding-xs, .25rem)}\n"], dependencies: [{ kind: "ngmodule", type: DrawerModule }, { kind: "component", type: i1.Drawer, selector: "p-drawer", inputs: ["appendTo", "motionOptions", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "closeButtonProps", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen", "header", "maskStyle", "closable"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: ButtonComponent, selector: "tk-button", inputs: ["label", "disabled", "type", "severity", "variant", "link", "icon", "iconPosition", "tooltipText", "size"], outputs: ["clicked"] }, { kind: "component", type: TagComponent, selector: "tk-tag", inputs: ["value", "severity", "truncationLimit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
238
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: DrawerComponent, isStandalone: true, selector: "tk-drawer", inputs: { dialogRef: { classPropertyName: "dialogRef", publicName: "dialogRef", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, headerAction: { classPropertyName: "headerAction", publicName: "headerAction", isSignal: true, isRequired: false, transformFunction: null }, tag: { classPropertyName: "tag", publicName: "tag", isSignal: true, isRequired: false, transformFunction: null }, subtle: { classPropertyName: "subtle", publicName: "subtle", isSignal: true, isRequired: false, transformFunction: null }, hasTabs: { classPropertyName: "hasTabs", publicName: "hasTabs", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, interceptor: { classPropertyName: "interceptor", publicName: "interceptor", isSignal: true, isRequired: false, transformFunction: null }, isOpened: { classPropertyName: "isOpened", publicName: "isOpened", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpened: "isOpenedChange", closed: "closed" }, viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<p-drawer\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissible]=\"dismissible()\"\n [closeOnEscape]=\"true\"\n position=\"right\"\n [style]=\"drawerStyle()\"\n [styleClass]=\"'tk-drawer'\"\n [class.tk-drawer--has-scroll]=\"hasScroll\"\n [class.tk-drawer--has-tabs]=\"hasTabs()\">\n @if (title() || hasHeaderAction()) {\n <ng-template pTemplate=\"header\">\n <div class=\"tk-drawer__header\">\n <div class=\"tk-drawer__title-container\">\n <h2 class=\"tk-drawer__title\" [title]=\"title()\">{{ title() }}</h2>\n @if (tag() || subtle()) {\n <div class=\"tk-drawer__subtitle\">\n @if (tag()) {\n <tk-tag [value]=\"tag()!\" severity=\"secondary\" />\n }\n @if (subtle()) {\n <span class=\"tk-drawer__subtle\">{{ subtle() }}</span>\n }\n </div>\n }\n </div>\n @if (hasHeaderAction()) {\n <div class=\"tk-drawer__actions\">\n <tk-button\n [label]=\"headerAction()!.label\"\n [severity]=\"headerAction()!.severity\"\n [variant]=\"headerAction()!.variant\"\n (clicked)=\"\n handleHeaderAction(\n headerAction()!.action,\n headerAction()!.returnValue\n )\n \" />\n </div>\n }\n </div>\n </ng-template>\n }\n\n <section class=\"tk-drawer__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n</p-drawer>\n", styles: [":host ::ng-deep .tk-drawer{max-height:100vh;display:flex;flex-direction:column}:host ::ng-deep .tk-drawer__content{flex:1;overflow-y:auto;padding:var(--tk-spacing-padding-m, 1.5rem)}:host ::ng-deep .tk-drawer--has-tabs .p-drawer-content{padding:var(--tk-spacing-padding-none);overflow-y:hidden}:host ::ng-deep .tk-drawer--has-tabs .tk-drawer__content{padding:var(--tk-spacing-padding-none);overflow-y:hidden;display:flex;flex-direction:column}:host ::ng-deep .tk-drawer--has-tabs .tk-drawer__content>*{display:flex;flex-direction:column;flex:1;overflow:hidden}:host ::ng-deep .tk-drawer--has-tabs .tk-drawer__content>*>*{display:flex;flex-direction:column;flex:1;overflow:hidden}:host ::ng-deep .tk-drawer--has-tabs tk-tabs,:host ::ng-deep .tk-drawer--has-tabs p-tabs,:host ::ng-deep .tk-drawer--has-tabs .tk-tabs{display:flex;flex-direction:column;flex:1;overflow:hidden}:host ::ng-deep .tk-drawer--has-tabs .p-tabpanels{padding:var(--tk-spacing-padding-none);display:flex;flex-direction:column;flex:1;overflow:hidden}:host ::ng-deep .tk-drawer--has-tabs .p-tabpanel{padding:var(--tk-spacing-padding-none);overflow-y:auto;flex:1}:host ::ng-deep .p-drawer-content{overflow-y:auto;display:flex;flex-direction:column;flex:1}:host ::ng-deep .p-drawer-close-button{color:var(--tk-color-base-surface-500, #8a8a8b);border-radius:50%}:host ::ng-deep .p-drawer-close-button:hover{background:var(--tk-color-base-surface-100, #f0f0f0)!important;color:var(--tk-color-base-surface-500, #8a8a8b)}.tk-drawer--has-scroll .p-drawer-header{border-bottom:1px solid var(--tk-color-base-surface-200, #e2e8f0);box-shadow:0 2px 4px #00000005}.tk-drawer__header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:var(--tk-spacing-base-100, 1rem);flex-shrink:0;width:calc(100% - var(--tk-spacing-base-250, 2.5rem))}.tk-drawer__title-container{display:flex;flex-direction:column;flex:1;min-width:0}.tk-drawer__title{margin:0;font-size:var(--tk-font-size-headers-s, 1.125rem);font-weight:var(--tk-font-weight-600, 600);color:var(--tk-color-text-default, #212121);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.tk-drawer__subtitle{display:flex;flex-direction:row;align-items:center;gap:var(--tk-spacing-base-50, .5rem)}.tk-drawer__subtle{font-size:var(--tk-font-size-body-xs, .75rem);color:var(--tk-color-base-surface-500, #8a8a8b);font-weight:var(--tk-font-weight-400, 400)}.tk-drawer__actions{display:flex;flex-direction:row;align-items:center;gap:var(--tk-spacing-base-50, .5rem);flex-shrink:0;padding-right:var(--tk-spacing-padding-xs, .25rem)}\n"], dependencies: [{ kind: "ngmodule", type: DrawerModule }, { kind: "component", type: i1.Drawer, selector: "p-drawer", inputs: ["appendTo", "motionOptions", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "closeButtonProps", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen", "header", "maskStyle", "closable"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: ButtonComponent, selector: "tk-button", inputs: ["label", "disabled", "type", "severity", "variant", "link", "icon", "iconPosition", "tooltipText", "size"], outputs: ["clicked"] }, { kind: "component", type: TagComponent, selector: "tk-tag", inputs: ["value", "severity", "truncationLimit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
239
239
  }
240
240
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: DrawerComponent, decorators: [{
241
241
  type: Component,
242
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'tk-drawer', imports: [DrawerModule, ButtonComponent, TagComponent], template: "<p-drawer\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissible]=\"dismissible()\"\n [closeOnEscape]=\"true\"\n position=\"right\"\n [style]=\"drawerStyle()\"\n [styleClass]=\"'tk-drawer'\"\n [class.tk-drawer--has-scroll]=\"hasScroll\"\n [class.tk-drawer--has-tabs]=\"hasTabs()\">\n @if (title() || hasHeaderAction()) {\n <ng-template pTemplate=\"header\">\n <div class=\"tk-drawer__header\">\n <div class=\"tk-drawer__title-container\">\n <h2 class=\"tk-drawer__title\" [title]=\"title()\">{{ title() }}</h2>\n @if (tag() || subtle()) {\n <div class=\"tk-drawer__subtitle\">\n @if (tag()) {\n <tk-tag [value]=\"tag()!\" severity=\"secondary\" />\n }\n @if (subtle()) {\n <span class=\"tk-drawer__subtle\">{{ subtle() }}</span>\n }\n </div>\n }\n </div>\n @if (hasHeaderAction()) {\n <div class=\"tk-drawer__actions\">\n <tk-button\n [label]=\"headerAction()!.label\"\n [severity]=\"headerAction()!.severity\"\n [variant]=\"headerAction()!.variant\"\n (clicked)=\"\n handleHeaderAction(\n headerAction()!.action,\n headerAction()!.returnValue\n )\n \" />\n </div>\n }\n </div>\n </ng-template>\n }\n\n <section class=\"tk-drawer__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n</p-drawer>\n", styles: [":host ::ng-deep .tk-drawer{max-height:100vh;display:flex;flex-direction:column}:host ::ng-deep .tk-drawer__content{flex:1;overflow-y:auto;padding:var(--tk-spacing-padding-m, 1.5rem)}:host ::ng-deep .tk-drawer--has-tabs .p-drawer-content{padding:var(--tk-spacing-padding-none);overflow-y:hidden}:host ::ng-deep .tk-drawer--has-tabs .tk-drawer__content{padding:var(--tk-spacing-padding-none);overflow-y:hidden}:host ::ng-deep .tk-drawer--has-tabs .p-tabpanels,:host ::ng-deep .tk-drawer--has-tabs .p-tabpanel{padding:var(--tk-spacing-padding-none)}:host ::ng-deep .p-drawer-content{overflow-y:auto;display:flex;flex-direction:column;flex:1}:host ::ng-deep .p-drawer-close-button{color:var(--tk-color-base-surface-500, #8a8a8b);border-radius:50%}:host ::ng-deep .p-drawer-close-button:hover{background:var(--tk-color-base-surface-100, #f0f0f0)!important;color:var(--tk-color-base-surface-500, #8a8a8b)}.tk-drawer--has-scroll .p-drawer-header{border-bottom:1px solid var(--tk-color-base-surface-200, #e2e8f0);box-shadow:0 2px 4px #00000005}.tk-drawer__header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:var(--tk-spacing-base-100, 1rem);flex-shrink:0;width:calc(100% - var(--tk-spacing-base-250, 2.5rem))}.tk-drawer__title-container{display:flex;flex-direction:column;flex:1;min-width:0}.tk-drawer__title{margin:0;font-size:var(--tk-font-size-headers-s, 1.125rem);font-weight:var(--tk-font-weight-600, 600);color:var(--tk-color-text-default, #212121);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.tk-drawer__subtitle{display:flex;flex-direction:row;align-items:center;gap:var(--tk-spacing-base-50, .5rem)}.tk-drawer__subtle{font-size:var(--tk-font-size-body-xs, .75rem);color:var(--tk-color-base-surface-500, #8a8a8b);font-weight:var(--tk-font-weight-400, 400)}.tk-drawer__actions{display:flex;flex-direction:row;align-items:center;gap:var(--tk-spacing-base-50, .5rem);flex-shrink:0;padding-right:var(--tk-spacing-padding-xs, .25rem)}\n"] }]
242
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'tk-drawer', imports: [DrawerModule, ButtonComponent, TagComponent], template: "<p-drawer\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissible]=\"dismissible()\"\n [closeOnEscape]=\"true\"\n position=\"right\"\n [style]=\"drawerStyle()\"\n [styleClass]=\"'tk-drawer'\"\n [class.tk-drawer--has-scroll]=\"hasScroll\"\n [class.tk-drawer--has-tabs]=\"hasTabs()\">\n @if (title() || hasHeaderAction()) {\n <ng-template pTemplate=\"header\">\n <div class=\"tk-drawer__header\">\n <div class=\"tk-drawer__title-container\">\n <h2 class=\"tk-drawer__title\" [title]=\"title()\">{{ title() }}</h2>\n @if (tag() || subtle()) {\n <div class=\"tk-drawer__subtitle\">\n @if (tag()) {\n <tk-tag [value]=\"tag()!\" severity=\"secondary\" />\n }\n @if (subtle()) {\n <span class=\"tk-drawer__subtle\">{{ subtle() }}</span>\n }\n </div>\n }\n </div>\n @if (hasHeaderAction()) {\n <div class=\"tk-drawer__actions\">\n <tk-button\n [label]=\"headerAction()!.label\"\n [severity]=\"headerAction()!.severity\"\n [variant]=\"headerAction()!.variant\"\n (clicked)=\"\n handleHeaderAction(\n headerAction()!.action,\n headerAction()!.returnValue\n )\n \" />\n </div>\n }\n </div>\n </ng-template>\n }\n\n <section class=\"tk-drawer__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n</p-drawer>\n", styles: [":host ::ng-deep .tk-drawer{max-height:100vh;display:flex;flex-direction:column}:host ::ng-deep .tk-drawer__content{flex:1;overflow-y:auto;padding:var(--tk-spacing-padding-m, 1.5rem)}:host ::ng-deep .tk-drawer--has-tabs .p-drawer-content{padding:var(--tk-spacing-padding-none);overflow-y:hidden}:host ::ng-deep .tk-drawer--has-tabs .tk-drawer__content{padding:var(--tk-spacing-padding-none);overflow-y:hidden;display:flex;flex-direction:column}:host ::ng-deep .tk-drawer--has-tabs .tk-drawer__content>*{display:flex;flex-direction:column;flex:1;overflow:hidden}:host ::ng-deep .tk-drawer--has-tabs .tk-drawer__content>*>*{display:flex;flex-direction:column;flex:1;overflow:hidden}:host ::ng-deep .tk-drawer--has-tabs tk-tabs,:host ::ng-deep .tk-drawer--has-tabs p-tabs,:host ::ng-deep .tk-drawer--has-tabs .tk-tabs{display:flex;flex-direction:column;flex:1;overflow:hidden}:host ::ng-deep .tk-drawer--has-tabs .p-tabpanels{padding:var(--tk-spacing-padding-none);display:flex;flex-direction:column;flex:1;overflow:hidden}:host ::ng-deep .tk-drawer--has-tabs .p-tabpanel{padding:var(--tk-spacing-padding-none);overflow-y:auto;flex:1}:host ::ng-deep .p-drawer-content{overflow-y:auto;display:flex;flex-direction:column;flex:1}:host ::ng-deep .p-drawer-close-button{color:var(--tk-color-base-surface-500, #8a8a8b);border-radius:50%}:host ::ng-deep .p-drawer-close-button:hover{background:var(--tk-color-base-surface-100, #f0f0f0)!important;color:var(--tk-color-base-surface-500, #8a8a8b)}.tk-drawer--has-scroll .p-drawer-header{border-bottom:1px solid var(--tk-color-base-surface-200, #e2e8f0);box-shadow:0 2px 4px #00000005}.tk-drawer__header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:var(--tk-spacing-base-100, 1rem);flex-shrink:0;width:calc(100% - var(--tk-spacing-base-250, 2.5rem))}.tk-drawer__title-container{display:flex;flex-direction:column;flex:1;min-width:0}.tk-drawer__title{margin:0;font-size:var(--tk-font-size-headers-s, 1.125rem);font-weight:var(--tk-font-weight-600, 600);color:var(--tk-color-text-default, #212121);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.tk-drawer__subtitle{display:flex;flex-direction:row;align-items:center;gap:var(--tk-spacing-base-50, .5rem)}.tk-drawer__subtle{font-size:var(--tk-font-size-body-xs, .75rem);color:var(--tk-color-base-surface-500, #8a8a8b);font-weight:var(--tk-font-weight-400, 400)}.tk-drawer__actions{display:flex;flex-direction:row;align-items:center;gap:var(--tk-spacing-base-50, .5rem);flex-shrink:0;padding-right:var(--tk-spacing-padding-xs, .25rem)}\n"] }]
243
243
  }], ctorParameters: () => [], propDecorators: { contentHost: [{ type: i0.ViewChild, args: ['contentHost', { ...{
244
244
  read: ViewContainerRef,
245
245
  }, isSignal: true }] }], dialogRef: [{ type: i0.Input, args: [{ isSignal: true, alias: "dialogRef", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], headerAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerAction", required: false }] }], tag: [{ type: i0.Input, args: [{ isSignal: true, alias: "tag", required: false }] }], subtle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtle", required: false }] }], hasTabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasTabs", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], interceptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "interceptor", required: false }] }], isOpened: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpened", required: false }] }, { type: i0.Output, args: ["isOpenedChange"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"tekus-design-system-components-drawer.mjs","sources":["../../../projects/design-system/components/drawer/src/drawer.component.ts","../../../projects/design-system/components/drawer/src/drawer.component.html","../../../projects/design-system/components/drawer/src/services/drawer.service.ts","../../../projects/design-system/components/drawer/tekus-design-system-components-drawer.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n model,\n output,\n Type,\n ElementRef,\n ViewContainerRef,\n viewChild,\n ComponentRef,\n effect,\n untracked,\n OnDestroy,\n afterEveryRender,\n inject,\n Injector,\n} from '@angular/core';\nimport { ButtonComponent } from '@tekus/design-system/components/button';\nimport { TagComponent } from '@tekus/design-system/components/tag';\nimport { DrawerModule } from 'primeng/drawer';\nimport { DrawerHeaderAction, DrawerSizeType } from './drawer.types';\nimport {\n TkCanClose,\n TkCloseInterceptor,\n TkDialogRef,\n} from '@tekus/design-system/core/types';\n\n/**\n * @component DrawerComponent\n * @description\n * A programmatically controlled drawer overlay used for displaying dynamic content,\n * titles, and header actions. The drawer is opened through a service with a configuration object,\n * similar to tk-modal.\n *\n * This component supports:\n * - Required title with ellipsis for long text.\n * - Optional header action button + close button.\n * - Content as string or component.\n * - Position: always right.\n * - Sizes: small (500px), large (1024px).\n * - Closable and dismissible mask behavior.\n *\n * @usage\n * ### Open a drawer from TypeScript using the drawer service\n * ```ts\n * this.drawerService.open({\n * title: 'Drawer name',\n * content: 'Content text drawer example',\n * headerAction: {\n * label: 'Action',\n * severity: 'primary',\n * action: () => console.log('Action clicked'),\n * returnValue: true,\n * },\n * size: 'small',\n * }).subscribe((result) => {\n * console.log('Drawer closed with value:', result);\n * });\n * ```\n * Modernized for Angular 19 with 100% synchronous Signal-based closing interception.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'tk-drawer',\n imports: [DrawerModule, ButtonComponent, TagComponent],\n templateUrl: './drawer.component.html',\n styleUrl: './drawer.component.scss',\n})\nexport class DrawerComponent<T = unknown> implements OnDestroy {\n private readonly elementRef = inject(ElementRef);\n private readonly injector = inject(Injector);\n\n private readonly contentHost = viewChild('contentHost', {\n read: ViewContainerRef,\n });\n private componentRef?: ComponentRef<T>;\n\n /** The dialog ref associated with this drawer */\n dialogRef = input<TkDialogRef<DrawerComponent<T>, unknown> | null>(null);\n\n /** The required title displayed at the top left of the drawer header */\n title = input.required<string>();\n\n /** The main content of the drawer. Can be a string or a Component Type. */\n content = input<string | Type<T> | null>(null);\n\n /** Optional header action button (displayed before close button) */\n headerAction = input<DrawerHeaderAction | null>(null);\n\n /** Optional tag displayed below the title */\n tag = input<string | null>(null);\n\n /** Optional subtle text displayed next to the tag */\n subtle = input<string | null>(null);\n\n /** Whether the content includes tabs (affects scroll behavior) */\n hasTabs = input<boolean>(false);\n\n /** Drawer size: 'small' (500px), 'large' (1024px) */\n size = input<DrawerSizeType>('small');\n\n /** Whether the drawer can be closed by the user via close button */\n closable = input<boolean>(true);\n\n /** Whether clicking the mask closes the drawer */\n dismissible = input<boolean>(true);\n\n /** Optional data to be passed as inputs to the dynamic component. */\n data = input<Partial<T>>({});\n\n /** Optional interceptor called before the drawer closes. */\n interceptor = input<TkCloseInterceptor | undefined>(undefined);\n\n isContentString = computed(() => typeof this.content() === 'string');\n hasHeaderAction = computed(() => this.headerAction() != null);\n\n /** Computed: drawer width (responsive) and max-width based on `size`. Always right position. */\n drawerStyle = computed(() => {\n const sz = this.size();\n const maxWidth = sz === 'large' ? '1024px' : '500px';\n return {\n width: 'calc(100vw - 1rem)',\n maxWidth,\n };\n });\n\n /** Visibility flag. Use model for two-way binding when using drawer in template. */\n isOpened = model<boolean>(false);\n\n /** Whether the drawer content has a scrollbar */\n hasScroll = false;\n\n /** Emits when the drawer closes, passing the return value from header action or null */\n readonly closed = output<unknown>();\n private alreadyEmitted = false;\n private returnValueOnClose: unknown = null;\n\n constructor() {\n /**\n * @summary Orchestrates the reactive dynamic lifecycle.\n */\n effect(() => {\n const opened = this.isOpened();\n const host = this.contentHost();\n this.dialogRef();\n\n untracked(() => {\n if (opened && host) {\n this.attachDynamicContent();\n } else if (!opened) {\n this.detachDynamicContent();\n }\n });\n });\n\n effect(() => {\n const currentData = this.data();\n untracked(() => this.syncDynamicInputs(currentData));\n });\n\n afterEveryRender(() => {\n this.checkScroll();\n });\n }\n\n ngOnDestroy(): void {\n this.detachDynamicContent();\n }\n\n private attachDynamicContent(): void {\n const type = this.content();\n const host = this.contentHost();\n\n if (!type || typeof type === 'string' || !host) return;\n this.detachDynamicContent();\n\n const customInjector = Injector.create({\n providers: [{ provide: TkDialogRef, useValue: this.dialogRef() }],\n parent: this.injector,\n });\n\n this.componentRef = host.createComponent(type, {\n injector: customInjector,\n });\n this.syncDynamicInputs(this.data());\n }\n\n private syncDynamicInputs(data: Partial<T>): void {\n if (!this.componentRef) return;\n Object.entries(data).forEach(([key, value]) => {\n this.componentRef?.setInput(key, value);\n });\n }\n\n private detachDynamicContent(): void {\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = undefined;\n }\n }\n\n /**\n * Checks if the drawer content has a scrollbar and updates `hasScroll` state.\n */\n checkScroll(): void {\n const contentEl =\n this.elementRef.nativeElement.querySelector('.p-drawer-content');\n if (contentEl) {\n if (this.hasTabs()) {\n this.hasScroll = false;\n return;\n }\n this.hasScroll = contentEl.scrollHeight > contentEl.clientHeight;\n }\n }\n\n private wasOpened = false;\n \n /** Opens the drawer */\n open(): void {\n this.isOpened.set(true);\n this.resetClosureState();\n }\n\n /** Marks the drawer as shown to enable closure emission guards */\n handleShow(): void {\n this.wasOpened = true;\n }\n\n /**\n * @summary Main entry point for closure requests.\n * @returns true if closure was executed.\n */\n tryClose(returnValue: unknown = null): boolean {\n if (this.canExecuteClosure()) {\n this.executeClosure(returnValue, arguments.length > 0);\n return true;\n } else {\n const instance = this.componentRef?.instance as TkCanClose | undefined;\n instance?.onBlockedClose?.();\n return false;\n }\n }\n\n private canExecuteClosure(): boolean {\n const instance = this.componentRef?.instance as TkCanClose | undefined;\n const canClose = instance?.canClose ? instance.canClose() : true;\n if (!canClose) return false;\n\n const configInterceptor = this.interceptor();\n if (configInterceptor && !configInterceptor()) return false;\n\n return true;\n }\n\n private executeClosure(returnValue: unknown, hasReturnValue: boolean): void {\n if (hasReturnValue) {\n this.alreadyEmitted = true;\n this.returnValueOnClose = returnValue;\n }\n this.isOpened.set(false);\n this.handleClose();\n }\n\n /** Handles external visibility changes (from p-drawer close button or mask) */\n onVisibleChange(visible: boolean): void {\n if (!visible) {\n const closed = this.tryClose();\n\n if (!closed) {\n this.isOpened.set(true);\n }\n }\n }\n\n /** Closes the drawer and emits onClose */\n handleClose(): void {\n if (this.isOpened()) {\n return;\n }\n const valueToEmit = this.alreadyEmitted ? this.returnValueOnClose : null;\n this.closed.emit(valueToEmit);\n this.resetClosureState();\n }\n\n /** Forcefully closes the drawer without checks */\n close(): void {\n this.tryClose();\n }\n\n /**\n * Handles header action button click.\n */\n handleHeaderAction(\n action: (() => void) | undefined,\n returnValue: unknown\n ): void {\n if (action) action();\n this.tryClose(returnValue);\n }\n\n private resetClosureState(): void {\n this.alreadyEmitted = false;\n this.returnValueOnClose = null;\n }\n}\n","<p-drawer\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissible]=\"dismissible()\"\n [closeOnEscape]=\"true\"\n position=\"right\"\n [style]=\"drawerStyle()\"\n [styleClass]=\"'tk-drawer'\"\n [class.tk-drawer--has-scroll]=\"hasScroll\"\n [class.tk-drawer--has-tabs]=\"hasTabs()\">\n @if (title() || hasHeaderAction()) {\n <ng-template pTemplate=\"header\">\n <div class=\"tk-drawer__header\">\n <div class=\"tk-drawer__title-container\">\n <h2 class=\"tk-drawer__title\" [title]=\"title()\">{{ title() }}</h2>\n @if (tag() || subtle()) {\n <div class=\"tk-drawer__subtitle\">\n @if (tag()) {\n <tk-tag [value]=\"tag()!\" severity=\"secondary\" />\n }\n @if (subtle()) {\n <span class=\"tk-drawer__subtle\">{{ subtle() }}</span>\n }\n </div>\n }\n </div>\n @if (hasHeaderAction()) {\n <div class=\"tk-drawer__actions\">\n <tk-button\n [label]=\"headerAction()!.label\"\n [severity]=\"headerAction()!.severity\"\n [variant]=\"headerAction()!.variant\"\n (clicked)=\"\n handleHeaderAction(\n headerAction()!.action,\n headerAction()!.returnValue\n )\n \" />\n </div>\n }\n </div>\n </ng-template>\n }\n\n <section class=\"tk-drawer__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n</p-drawer>\n","import {\n Injectable,\n ApplicationRef,\n ComponentRef,\n createComponent,\n EmbeddedViewRef,\n inject,\n} from '@angular/core';\nimport { DrawerComponent } from '../drawer.component';\nimport { DrawerConfig } from '../drawer.types';\nimport { TkDialogRef } from '@tekus/design-system/core/types';\n\n@Injectable({ providedIn: 'root' })\nexport class DrawerService {\n private readonly appRef = inject(ApplicationRef);\n\n private dialogRef: TkDialogRef<DrawerComponent<unknown>> | null = null;\n\n get drawerRefForTesting(): ComponentRef<DrawerComponent<unknown>> | null {\n return (\n (this.dialogRef?.componentRef as ComponentRef<\n DrawerComponent<unknown>\n >) || null\n );\n }\n set drawerRefForTesting(ref: ComponentRef<DrawerComponent<unknown>> | null) {\n this.dialogRef = ref ? new TkDialogRef(ref) : null;\n }\n\n open<T = unknown, R = unknown>(\n config: DrawerConfig\n ): TkDialogRef<DrawerComponent<T>, R> {\n if (this.dialogRef) {\n // Clear the previous one without triggering a real \"null\" result\n this.dialogRef.emitClose();\n this.dialogRef.componentRef.destroy();\n this.dialogRef = null;\n }\n\n const componentRef = createComponent(DrawerComponent, {\n environmentInjector: this.appRef.injector,\n }) as ComponentRef<DrawerComponent<T>>;\n\n this.appRef.attachView(componentRef.hostView);\n\n const domElem = (componentRef.hostView as EmbeddedViewRef<unknown>)\n .rootNodes[0] as HTMLElement;\n document.body.appendChild(domElem);\n\n componentRef.setInput('title', config.title);\n componentRef.setInput('tag', config.tag ?? null);\n componentRef.setInput('subtle', config.subtle ?? null);\n componentRef.setInput('hasTabs', config.hasTabs ?? false);\n componentRef.setInput('content', config.content ?? null);\n componentRef.setInput('headerAction', config.headerAction ?? null);\n componentRef.setInput('size', config.size ?? 'small');\n componentRef.setInput('closable', config.closable ?? true);\n componentRef.setInput('dismissible', config.dismissible ?? true);\n componentRef.setInput('data', config.data ?? {});\n componentRef.setInput('interceptor', config.interceptor ?? undefined);\n\n const dialogRef = new TkDialogRef<DrawerComponent<T>, R>(componentRef);\n componentRef.setInput('dialogRef', dialogRef);\n this.dialogRef = dialogRef as unknown as TkDialogRef<\n DrawerComponent<unknown>\n >;\n\n componentRef.instance.closed.subscribe((value: unknown) => {\n dialogRef.emitClose(value as R);\n\n this.appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n if (this.dialogRef === (dialogRef as unknown)) {\n this.dialogRef = null;\n }\n });\n\n componentRef.instance.open();\n\n return dialogRef;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;MAQU,eAAe,CAAA;AAqE1B,IAAA,WAAA,GAAA;AApEiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAE3B,IAAA,CAAA,WAAW,GAAG,SAAS,CAAC,aAAa,mFACpD,IAAI,EAAE,gBAAgB,EAAA,CACtB;;AAIF,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAkD,IAAI,gFAAC;;AAGxE,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,Q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,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cADA,MAAM,EAAA,CAAA,CAAA;;2FACnB,aAAa,EAAA,UAAA,EAAA,CAAA;kBADzB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACZlC;;AAEG;;;;"}
1
+ {"version":3,"file":"tekus-design-system-components-drawer.mjs","sources":["../../../projects/design-system/components/drawer/src/drawer.component.ts","../../../projects/design-system/components/drawer/src/drawer.component.html","../../../projects/design-system/components/drawer/src/services/drawer.service.ts","../../../projects/design-system/components/drawer/tekus-design-system-components-drawer.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n model,\n output,\n Type,\n ElementRef,\n ViewContainerRef,\n viewChild,\n ComponentRef,\n effect,\n untracked,\n OnDestroy,\n afterEveryRender,\n inject,\n Injector,\n} from '@angular/core';\nimport { ButtonComponent } from '@tekus/design-system/components/button';\nimport { TagComponent } from '@tekus/design-system/components/tag';\nimport { DrawerModule } from 'primeng/drawer';\nimport { DrawerHeaderAction, DrawerSizeType } from './drawer.types';\nimport {\n TkCanClose,\n TkCloseInterceptor,\n TkDialogRef,\n} from '@tekus/design-system/core/types';\n\n/**\n * @component DrawerComponent\n * @description\n * A programmatically controlled drawer overlay used for displaying dynamic content,\n * titles, and header actions. The drawer is opened through a service with a configuration object,\n * similar to tk-modal.\n *\n * This component supports:\n * - Required title with ellipsis for long text.\n * - Optional header action button + close button.\n * - Content as string or component.\n * - Position: always right.\n * - Sizes: small (500px), large (1024px).\n * - Closable and dismissible mask behavior.\n *\n * @usage\n * ### Open a drawer from TypeScript using the drawer service\n * ```ts\n * this.drawerService.open({\n * title: 'Drawer name',\n * content: 'Content text drawer example',\n * headerAction: {\n * label: 'Action',\n * severity: 'primary',\n * action: () => console.log('Action clicked'),\n * returnValue: true,\n * },\n * size: 'small',\n * }).subscribe((result) => {\n * console.log('Drawer closed with value:', result);\n * });\n * ```\n * Modernized for Angular 19 with 100% synchronous Signal-based closing interception.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'tk-drawer',\n imports: [DrawerModule, ButtonComponent, TagComponent],\n templateUrl: './drawer.component.html',\n styleUrl: './drawer.component.scss',\n})\nexport class DrawerComponent<T = unknown> implements OnDestroy {\n private readonly elementRef = inject(ElementRef);\n private readonly injector = inject(Injector);\n\n private readonly contentHost = viewChild('contentHost', {\n read: ViewContainerRef,\n });\n private componentRef?: ComponentRef<T>;\n\n /** The dialog ref associated with this drawer */\n dialogRef = input<TkDialogRef<DrawerComponent<T>, unknown> | null>(null);\n\n /** The required title displayed at the top left of the drawer header */\n title = input.required<string>();\n\n /** The main content of the drawer. Can be a string or a Component Type. */\n content = input<string | Type<T> | null>(null);\n\n /** Optional header action button (displayed before close button) */\n headerAction = input<DrawerHeaderAction | null>(null);\n\n /** Optional tag displayed below the title */\n tag = input<string | null>(null);\n\n /** Optional subtle text displayed next to the tag */\n subtle = input<string | null>(null);\n\n /** Whether the content includes tabs (affects scroll behavior) */\n hasTabs = input<boolean>(false);\n\n /** Drawer size: 'small' (500px), 'large' (1024px) */\n size = input<DrawerSizeType>('small');\n\n /** Whether the drawer can be closed by the user via close button */\n closable = input<boolean>(true);\n\n /** Whether clicking the mask closes the drawer */\n dismissible = input<boolean>(true);\n\n /** Optional data to be passed as inputs to the dynamic component. */\n data = input<Partial<T>>({});\n\n /** Optional interceptor called before the drawer closes. */\n interceptor = input<TkCloseInterceptor | undefined>(undefined);\n\n isContentString = computed(() => typeof this.content() === 'string');\n hasHeaderAction = computed(() => this.headerAction() != null);\n\n /** Computed: drawer width (responsive) and max-width based on `size`. Always right position. */\n drawerStyle = computed(() => {\n const sz = this.size();\n const maxWidth = sz === 'large' ? '1024px' : '500px';\n return {\n width: 'calc(100vw - 1rem)',\n maxWidth,\n };\n });\n\n /** Visibility flag. Use model for two-way binding when using drawer in template. */\n isOpened = model<boolean>(false);\n\n /** Whether the drawer content has a scrollbar */\n hasScroll = false;\n\n /** Emits when the drawer closes, passing the return value from header action or null */\n readonly closed = output<unknown>();\n private alreadyEmitted = false;\n private returnValueOnClose: unknown = null;\n\n constructor() {\n /**\n * @summary Orchestrates the reactive dynamic lifecycle.\n */\n effect(() => {\n const opened = this.isOpened();\n const host = this.contentHost();\n this.dialogRef();\n\n untracked(() => {\n if (opened && host) {\n this.attachDynamicContent();\n } else if (!opened) {\n this.detachDynamicContent();\n }\n });\n });\n\n effect(() => {\n const currentData = this.data();\n untracked(() => this.syncDynamicInputs(currentData));\n });\n\n afterEveryRender(() => {\n this.checkScroll();\n });\n }\n\n ngOnDestroy(): void {\n this.detachDynamicContent();\n }\n\n private attachDynamicContent(): void {\n const type = this.content();\n const host = this.contentHost();\n\n if (!type || typeof type === 'string' || !host) return;\n this.detachDynamicContent();\n\n const customInjector = Injector.create({\n providers: [{ provide: TkDialogRef, useValue: this.dialogRef() }],\n parent: this.injector,\n });\n\n this.componentRef = host.createComponent(type, {\n injector: customInjector,\n });\n this.syncDynamicInputs(this.data());\n }\n\n private syncDynamicInputs(data: Partial<T>): void {\n if (!this.componentRef) return;\n Object.entries(data).forEach(([key, value]) => {\n this.componentRef?.setInput(key, value);\n });\n }\n\n private detachDynamicContent(): void {\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = undefined;\n }\n }\n\n /**\n * Checks if the drawer content has a scrollbar and updates `hasScroll` state.\n */\n checkScroll(): void {\n const contentEl =\n this.elementRef.nativeElement.querySelector('.p-drawer-content');\n if (contentEl) {\n if (this.hasTabs()) {\n this.hasScroll = false;\n return;\n }\n this.hasScroll = contentEl.scrollHeight > contentEl.clientHeight;\n }\n }\n\n private wasOpened = false;\n \n /** Opens the drawer */\n open(): void {\n this.isOpened.set(true);\n this.resetClosureState();\n }\n\n /** Marks the drawer as shown to enable closure emission guards */\n handleShow(): void {\n this.wasOpened = true;\n }\n\n /**\n * @summary Main entry point for closure requests.\n * @returns true if closure was executed.\n */\n tryClose(returnValue: unknown = null): boolean {\n if (this.canExecuteClosure()) {\n this.executeClosure(returnValue, arguments.length > 0);\n return true;\n } else {\n const instance = this.componentRef?.instance as TkCanClose | undefined;\n instance?.onBlockedClose?.();\n return false;\n }\n }\n\n private canExecuteClosure(): boolean {\n const instance = this.componentRef?.instance as TkCanClose | undefined;\n const canClose = instance?.canClose ? instance.canClose() : true;\n if (!canClose) return false;\n\n const configInterceptor = this.interceptor();\n if (configInterceptor && !configInterceptor()) return false;\n\n return true;\n }\n\n private executeClosure(returnValue: unknown, hasReturnValue: boolean): void {\n if (hasReturnValue) {\n this.alreadyEmitted = true;\n this.returnValueOnClose = returnValue;\n }\n this.isOpened.set(false);\n this.handleClose();\n }\n\n /** Handles external visibility changes (from p-drawer close button or mask) */\n onVisibleChange(visible: boolean): void {\n if (!visible) {\n const closed = this.tryClose();\n\n if (!closed) {\n this.isOpened.set(true);\n }\n }\n }\n\n /** Closes the drawer and emits onClose */\n handleClose(): void {\n if (this.isOpened()) {\n return;\n }\n const valueToEmit = this.alreadyEmitted ? this.returnValueOnClose : null;\n this.closed.emit(valueToEmit);\n this.resetClosureState();\n }\n\n /** Forcefully closes the drawer without checks */\n close(): void {\n this.tryClose();\n }\n\n /**\n * Handles header action button click.\n */\n handleHeaderAction(\n action: (() => void) | undefined,\n returnValue: unknown\n ): void {\n if (action) action();\n this.tryClose(returnValue);\n }\n\n private resetClosureState(): void {\n this.alreadyEmitted = false;\n this.returnValueOnClose = null;\n }\n}\n","<p-drawer\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissible]=\"dismissible()\"\n [closeOnEscape]=\"true\"\n position=\"right\"\n [style]=\"drawerStyle()\"\n [styleClass]=\"'tk-drawer'\"\n [class.tk-drawer--has-scroll]=\"hasScroll\"\n [class.tk-drawer--has-tabs]=\"hasTabs()\">\n @if (title() || hasHeaderAction()) {\n <ng-template pTemplate=\"header\">\n <div class=\"tk-drawer__header\">\n <div class=\"tk-drawer__title-container\">\n <h2 class=\"tk-drawer__title\" [title]=\"title()\">{{ title() }}</h2>\n @if (tag() || subtle()) {\n <div class=\"tk-drawer__subtitle\">\n @if (tag()) {\n <tk-tag [value]=\"tag()!\" severity=\"secondary\" />\n }\n @if (subtle()) {\n <span class=\"tk-drawer__subtle\">{{ subtle() }}</span>\n }\n </div>\n }\n </div>\n @if (hasHeaderAction()) {\n <div class=\"tk-drawer__actions\">\n <tk-button\n [label]=\"headerAction()!.label\"\n [severity]=\"headerAction()!.severity\"\n [variant]=\"headerAction()!.variant\"\n (clicked)=\"\n handleHeaderAction(\n headerAction()!.action,\n headerAction()!.returnValue\n )\n \" />\n </div>\n }\n </div>\n </ng-template>\n }\n\n <section class=\"tk-drawer__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n</p-drawer>\n","import {\n Injectable,\n ApplicationRef,\n ComponentRef,\n createComponent,\n EmbeddedViewRef,\n inject,\n} from '@angular/core';\nimport { DrawerComponent } from '../drawer.component';\nimport { DrawerConfig } from '../drawer.types';\nimport { TkDialogRef } from '@tekus/design-system/core/types';\n\n@Injectable({ providedIn: 'root' })\nexport class DrawerService {\n private readonly appRef = inject(ApplicationRef);\n\n private dialogRef: TkDialogRef<DrawerComponent<unknown>> | null = null;\n\n get drawerRefForTesting(): ComponentRef<DrawerComponent<unknown>> | null {\n return (\n (this.dialogRef?.componentRef as ComponentRef<\n DrawerComponent<unknown>\n >) || null\n );\n }\n set drawerRefForTesting(ref: ComponentRef<DrawerComponent<unknown>> | null) {\n this.dialogRef = ref ? new TkDialogRef(ref) : null;\n }\n\n open<T = unknown, R = unknown>(\n config: DrawerConfig\n ): TkDialogRef<DrawerComponent<T>, R> {\n if (this.dialogRef) {\n // Clear the previous one without triggering a real \"null\" result\n this.dialogRef.emitClose();\n this.dialogRef.componentRef.destroy();\n this.dialogRef = null;\n }\n\n const componentRef = createComponent(DrawerComponent, {\n environmentInjector: this.appRef.injector,\n }) as ComponentRef<DrawerComponent<T>>;\n\n this.appRef.attachView(componentRef.hostView);\n\n const domElem = (componentRef.hostView as EmbeddedViewRef<unknown>)\n .rootNodes[0] as HTMLElement;\n document.body.appendChild(domElem);\n\n componentRef.setInput('title', config.title);\n componentRef.setInput('tag', config.tag ?? null);\n componentRef.setInput('subtle', config.subtle ?? null);\n componentRef.setInput('hasTabs', config.hasTabs ?? false);\n componentRef.setInput('content', config.content ?? null);\n componentRef.setInput('headerAction', config.headerAction ?? null);\n componentRef.setInput('size', config.size ?? 'small');\n componentRef.setInput('closable', config.closable ?? true);\n componentRef.setInput('dismissible', config.dismissible ?? true);\n componentRef.setInput('data', config.data ?? {});\n componentRef.setInput('interceptor', config.interceptor ?? undefined);\n\n const dialogRef = new TkDialogRef<DrawerComponent<T>, R>(componentRef);\n componentRef.setInput('dialogRef', dialogRef);\n this.dialogRef = dialogRef as unknown as TkDialogRef<\n DrawerComponent<unknown>\n >;\n\n componentRef.instance.closed.subscribe((value: unknown) => {\n dialogRef.emitClose(value as R);\n\n this.appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n if (this.dialogRef === (dialogRef as unknown)) {\n this.dialogRef = null;\n }\n });\n\n componentRef.instance.open();\n\n return dialogRef;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;MAQU,eAAe,CAAA;AAqE1B,IAAA,WAAA,GAAA;AApEiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAE3B,IAAA,CAAA,WAAW,GAAG,SAAS,CAAC,aAAa,mFACpD,IAAI,EAAE,gBAAgB,EAAA,CACtB;;AAIF,QAAA,IAAA,CAAA,SAAS,GAAG,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CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cADA,MAAM,EAAA,CAAA,CAAA;;2FACnB,aAAa,EAAA,UAAA,EAAA,CAAA;kBADzB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACZlC;;AAEG;;;;"}
@@ -1,9 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, Injector, viewChild, ViewContainerRef, input, computed, model, output, effect, untracked, afterEveryRender, ChangeDetectionStrategy, Component, ApplicationRef, createComponent, Injectable } from '@angular/core';
2
+ import { inject, ElementRef, Injector, viewChild, ViewContainerRef, input, model, computed, output, effect, untracked, afterEveryRender, ChangeDetectionStrategy, Component, ApplicationRef, createComponent, Injectable } from '@angular/core';
3
3
  import { ButtonComponent } from '@tekus/design-system/components/button';
4
4
  import * as i1 from 'primeng/dialog';
5
5
  import { DialogModule } from 'primeng/dialog';
6
6
  import { TkDialogRef } from '@tekus/design-system/core/types';
7
+ import { isObservable } from 'rxjs';
8
+ import { take } from 'rxjs/operators';
7
9
  import * as i2 from 'primeng/api';
8
10
 
9
11
  /**
@@ -27,7 +29,7 @@ class ModalComponent {
27
29
  /** The main content of the modal. Can be a string or a Component Type. */
28
30
  this.content = input(null, ...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
29
31
  /** Array of footer buttons with label, callback, and return value */
30
- this.footerButtons = input([], ...(ngDevMode ? [{ debugName: "footerButtons" }] : /* istanbul ignore next */ []));
32
+ this.footerButtons = model([], ...(ngDevMode ? [{ debugName: "footerButtons" }] : /* istanbul ignore next */ []));
31
33
  /** Modal size: 'small', 'large', 'medium' or 'full' */
32
34
  this.size = input('small', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
33
35
  /** Whether the modal can be closed by the user via close button */
@@ -155,32 +157,60 @@ class ModalComponent {
155
157
  }
156
158
  /**
157
159
  * @summary Main entry point for closure requests.
158
- * Evaluation is 100% synchronous based on current Signal state.
160
+ * Supports synchronous and asynchronous (Promise/Observable) evaluations.
159
161
  * @param returnValue (Optional) Value to emit on close.
160
162
  */
161
163
  tryClose(returnValue = null) {
162
- if (this.canExecuteClosure()) {
163
- this.executeClosure(returnValue, arguments.length > 0);
164
+ const hasReturnValue = arguments.length > 0;
165
+ const instance = this.componentRef?.instance;
166
+ const canCloseFn = instance?.canClose ? instance.canClose() : true;
167
+ this.evaluateCanClose(canCloseFn, (canCloseInstance) => {
168
+ if (!canCloseInstance) {
169
+ instance?.onBlockedClose?.();
170
+ return;
171
+ }
172
+ const configInterceptor = this.interceptor();
173
+ if (configInterceptor) {
174
+ const interceptorResult = configInterceptor();
175
+ this.evaluateCanClose(interceptorResult, (canCloseInterceptor) => {
176
+ if (canCloseInterceptor) {
177
+ this.executeClosure(returnValue, hasReturnValue);
178
+ }
179
+ else {
180
+ instance?.onBlockedClose?.();
181
+ }
182
+ });
183
+ }
184
+ else {
185
+ this.executeClosure(returnValue, hasReturnValue);
186
+ }
187
+ });
188
+ }
189
+ /**
190
+ * Evaluates a boolean, Promise or Observable to check if closing is allowed.
191
+ */
192
+ evaluateCanClose(result, callback) {
193
+ if (isObservable(result)) {
194
+ result.pipe(take(1)).subscribe({
195
+ next: (res) => callback(res),
196
+ error: () => callback(false),
197
+ });
198
+ }
199
+ else if (result instanceof Promise) {
200
+ result.then((res) => callback(res), () => callback(false));
164
201
  }
165
202
  else {
166
- const instance = this.componentRef?.instance;
167
- instance?.onBlockedClose?.();
203
+ callback(result);
168
204
  }
169
205
  }
170
206
  /**
171
- * @summary Synchronous evaluator of hierarchical guards.
172
- * @returns true if closure is allowed.
173
- * @private
207
+ * Resolves a static or functional property of a button.
174
208
  */
175
- canExecuteClosure() {
176
- const instance = this.componentRef?.instance;
177
- const canClose = instance?.canClose ? instance.canClose() : true;
178
- if (!canClose)
179
- return false;
180
- const configInterceptor = this.interceptor();
181
- if (configInterceptor && !configInterceptor())
182
- return false;
183
- return true;
209
+ resolveProperty(prop) {
210
+ if (typeof prop === 'function') {
211
+ return prop();
212
+ }
213
+ return prop;
184
214
  }
185
215
  /**
186
216
  * @summary Unified logic to execute the final closure state change.
@@ -217,16 +247,19 @@ class ModalComponent {
217
247
  /**
218
248
  * @summary Handles actions triggered by footer buttons.
219
249
  */
220
- handleAction(action, returnValue) {
250
+ handleAction(action, returnValue, preventClose = false) {
221
251
  if (action)
222
252
  action();
223
- this.tryClose(returnValue);
253
+ if (!preventClose) {
254
+ this.tryClose(returnValue);
255
+ }
224
256
  }
225
257
  /**
226
- * @summary Safely closes the modal forcefully without checks.
258
+ * @summary Safely closes the modal, optionally passing a return value.
259
+ * @param returnValue Value to emit when closing.
227
260
  */
228
- close() {
229
- this.tryClose();
261
+ close(returnValue = null) {
262
+ this.tryClose(returnValue);
230
263
  }
231
264
  /**
232
265
  * @private
@@ -237,14 +270,14 @@ class ModalComponent {
237
270
  this.returnValueOnClose = null;
238
271
  }
239
272
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
240
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: ModalComponent, isStandalone: true, selector: "tk-modal", inputs: { dialogRef: { classPropertyName: "dialogRef", publicName: "dialogRef", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, footerButtons: { classPropertyName: "footerButtons", publicName: "footerButtons", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, closeOnOutsideClick: { classPropertyName: "closeOnOutsideClick", publicName: "closeOnOutsideClick", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, interceptor: { classPropertyName: "interceptor", publicName: "interceptor", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, isOpened: { classPropertyName: "isOpened", publicName: "isOpened", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpened: "isOpenedChange", closed: "closed" }, viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<p-dialog\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissableMask]=\"closeOnOutsideClick()\"\n [draggable]=\"false\"\n [focusOnShow]=\"false\"\n [header]=\"title()\"\n [style]=\"{\n 'max-width': modalMaxWidth(),\n width: 'calc(100% - var(--tk-spacing-base-200))',\n }\"\n (onHide)=\"handleClose()\"\n (onShow)=\"checkScroll()\"\n class=\"tk-modal\">\n @if (title()) {\n <ng-template pTemplate=\"header\">\n <span class=\"p-dialog-title\">{{ title() }}</span>\n </ng-template>\n }\n <section class=\"tk-modal__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n\n @if (hasFooter()) {\n <ng-template pTemplate=\"footer\">\n <section\n class=\"tk-modal__footer\"\n [class.tk-modal__footer--with-content]=\"hasScroll\">\n @for (btn of footerButtons()!; track $index) {\n <tk-button\n [label]=\"btn.label\"\n [severity]=\"btn.severity\"\n [variant]=\"btn.variant\"\n (clicked)=\"handleAction(btn.action, btn.returnValue)\"\n (keydown.enter)=\"handleAction(btn.action, btn.returnValue)\"\n (keydown.space)=\"handleAction(btn.action, btn.returnValue)\" />\n }\n </section>\n </ng-template>\n }\n</p-dialog>\n", styles: [":host ::ng-deep .p-dialog{max-height:90vh;display:flex;flex-direction:column}:host ::ng-deep .p-dialog-content{overflow-y:auto}:host ::ng-deep .p-dialog-title{color:var(--tk-color-text-default, #212121)}:host ::ng-deep .p-dialog-close-button{color:var(--tk-surface-500, #8a8a8b)}:host ::ng-deep .p-dialog-close-button:hover{background:var(--tk-color-base-surface-100, #f0f0f0)!important;color:var(--tk-surface-500, #8a8a8b)}.tk-modal__content{padding-bottom:var(--tk-spacing-padding-l, 1.25rem);color:var(--tk-surface-1000, #000000)}.tk-modal__footer{display:flex;flex-direction:row;justify-content:end;align-items:center;gap:var(--tk-spacing-base-50, .5rem)}.tk-modal__footer--with-content{padding-right:var(--tk-spacing-padding-l, 1.25rem)}\n"], dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i1.Dialog, selector: "p-dialog", inputs: ["hostName", "header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "maskMotionOptions", "motionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: ButtonComponent, selector: "tk-button", inputs: ["label", "disabled", "type", "severity", "variant", "link", "icon", "iconPosition", "tooltipText", "size"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
273
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: ModalComponent, isStandalone: true, selector: "tk-modal", inputs: { dialogRef: { classPropertyName: "dialogRef", publicName: "dialogRef", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, footerButtons: { classPropertyName: "footerButtons", publicName: "footerButtons", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, closeOnOutsideClick: { classPropertyName: "closeOnOutsideClick", publicName: "closeOnOutsideClick", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, interceptor: { classPropertyName: "interceptor", publicName: "interceptor", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, isOpened: { classPropertyName: "isOpened", publicName: "isOpened", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { footerButtons: "footerButtonsChange", isOpened: "isOpenedChange", closed: "closed" }, viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<p-dialog\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissableMask]=\"closeOnOutsideClick()\"\n [draggable]=\"false\"\n [focusOnShow]=\"false\"\n [header]=\"title()\"\n [style]=\"{\n 'max-width': modalMaxWidth(),\n width: 'calc(100% - var(--tk-spacing-base-200))',\n }\"\n (onHide)=\"handleClose()\"\n (onShow)=\"checkScroll()\"\n [styleClass]=\"hasFooter() ? 'tk-modal--has-footer' : 'tk-modal--no-footer'\"\n class=\"tk-modal\">\n @if (title()) {\n <ng-template pTemplate=\"header\">\n <span class=\"p-dialog-title\">{{ title() }}</span>\n </ng-template>\n }\n <section class=\"tk-modal__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n\n <ng-template pTemplate=\"footer\">\n @if (hasFooter()) {\n <section\n class=\"tk-modal__footer\"\n [class.tk-modal__footer--with-content]=\"hasScroll\">\n @for (btn of footerButtons()!; track $index) {\n <tk-button\n [label]=\"resolveProperty(btn.label)!\"\n [severity]=\"btn.severity\"\n [variant]=\"btn.variant\"\n [disabled]=\"resolveProperty(btn.disabled) ?? false\"\n (clicked)=\"handleAction(btn.action, btn.returnValue, btn.preventClose)\"\n (keydown.enter)=\"handleAction(btn.action, btn.returnValue, btn.preventClose)\"\n (keydown.space)=\"handleAction(btn.action, btn.returnValue, btn.preventClose)\" />\n }\n </section>\n }\n </ng-template>\n</p-dialog>\n", styles: [":host ::ng-deep .p-dialog{max-height:90vh;display:flex;flex-direction:column}:host ::ng-deep .p-dialog.tk-modal--no-footer .p-dialog-footer{display:none!important}:host ::ng-deep .p-dialog-content{overflow-y:auto}:host ::ng-deep .p-dialog-content .modal-container{max-height:none!important}:host ::ng-deep .p-dialog-content .modal-container .modal-header,:host ::ng-deep .p-dialog-content .modal-container>div:last-child{display:none!important}:host ::ng-deep .p-dialog-content .modal-container .overflow-auto{overflow:visible!important;max-height:none!important;margin:0!important}:host ::ng-deep .p-dialog-content .modal-container .ark-modal-body{max-height:none!important;padding-bottom:0!important}:host ::ng-deep .p-dialog-title{color:var(--tk-color-text-default, #212121)}:host ::ng-deep .p-dialog-close-button{color:var(--tk-surface-500, #8a8a8b)}:host ::ng-deep .p-dialog-close-button:hover{background:var(--tk-color-base-surface-100, #f0f0f0)!important;color:var(--tk-surface-500, #8a8a8b)}.tk-modal__content{padding-bottom:var(--tk-spacing-padding-l, 1.25rem);color:var(--tk-surface-1000, #000000)}.tk-modal__footer{display:flex;flex-direction:row;justify-content:end;align-items:center;gap:var(--tk-spacing-base-50, .5rem);padding-top:var(--tk-spacing-padding-m, 1rem)}.tk-modal__footer--with-content{padding-right:var(--tk-spacing-padding-l, 1.25rem)}\n"], dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i1.Dialog, selector: "p-dialog", inputs: ["hostName", "header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "maskMotionOptions", "motionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: ButtonComponent, selector: "tk-button", inputs: ["label", "disabled", "type", "severity", "variant", "link", "icon", "iconPosition", "tooltipText", "size"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
241
274
  }
242
275
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: ModalComponent, decorators: [{
243
276
  type: Component,
244
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'tk-modal', imports: [DialogModule, ButtonComponent], template: "<p-dialog\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissableMask]=\"closeOnOutsideClick()\"\n [draggable]=\"false\"\n [focusOnShow]=\"false\"\n [header]=\"title()\"\n [style]=\"{\n 'max-width': modalMaxWidth(),\n width: 'calc(100% - var(--tk-spacing-base-200))',\n }\"\n (onHide)=\"handleClose()\"\n (onShow)=\"checkScroll()\"\n class=\"tk-modal\">\n @if (title()) {\n <ng-template pTemplate=\"header\">\n <span class=\"p-dialog-title\">{{ title() }}</span>\n </ng-template>\n }\n <section class=\"tk-modal__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n\n @if (hasFooter()) {\n <ng-template pTemplate=\"footer\">\n <section\n class=\"tk-modal__footer\"\n [class.tk-modal__footer--with-content]=\"hasScroll\">\n @for (btn of footerButtons()!; track $index) {\n <tk-button\n [label]=\"btn.label\"\n [severity]=\"btn.severity\"\n [variant]=\"btn.variant\"\n (clicked)=\"handleAction(btn.action, btn.returnValue)\"\n (keydown.enter)=\"handleAction(btn.action, btn.returnValue)\"\n (keydown.space)=\"handleAction(btn.action, btn.returnValue)\" />\n }\n </section>\n </ng-template>\n }\n</p-dialog>\n", styles: [":host ::ng-deep .p-dialog{max-height:90vh;display:flex;flex-direction:column}:host ::ng-deep .p-dialog-content{overflow-y:auto}:host ::ng-deep .p-dialog-title{color:var(--tk-color-text-default, #212121)}:host ::ng-deep .p-dialog-close-button{color:var(--tk-surface-500, #8a8a8b)}:host ::ng-deep .p-dialog-close-button:hover{background:var(--tk-color-base-surface-100, #f0f0f0)!important;color:var(--tk-surface-500, #8a8a8b)}.tk-modal__content{padding-bottom:var(--tk-spacing-padding-l, 1.25rem);color:var(--tk-surface-1000, #000000)}.tk-modal__footer{display:flex;flex-direction:row;justify-content:end;align-items:center;gap:var(--tk-spacing-base-50, .5rem)}.tk-modal__footer--with-content{padding-right:var(--tk-spacing-padding-l, 1.25rem)}\n"] }]
277
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'tk-modal', imports: [DialogModule, ButtonComponent], template: "<p-dialog\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissableMask]=\"closeOnOutsideClick()\"\n [draggable]=\"false\"\n [focusOnShow]=\"false\"\n [header]=\"title()\"\n [style]=\"{\n 'max-width': modalMaxWidth(),\n width: 'calc(100% - var(--tk-spacing-base-200))',\n }\"\n (onHide)=\"handleClose()\"\n (onShow)=\"checkScroll()\"\n [styleClass]=\"hasFooter() ? 'tk-modal--has-footer' : 'tk-modal--no-footer'\"\n class=\"tk-modal\">\n @if (title()) {\n <ng-template pTemplate=\"header\">\n <span class=\"p-dialog-title\">{{ title() }}</span>\n </ng-template>\n }\n <section class=\"tk-modal__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n\n <ng-template pTemplate=\"footer\">\n @if (hasFooter()) {\n <section\n class=\"tk-modal__footer\"\n [class.tk-modal__footer--with-content]=\"hasScroll\">\n @for (btn of footerButtons()!; track $index) {\n <tk-button\n [label]=\"resolveProperty(btn.label)!\"\n [severity]=\"btn.severity\"\n [variant]=\"btn.variant\"\n [disabled]=\"resolveProperty(btn.disabled) ?? false\"\n (clicked)=\"handleAction(btn.action, btn.returnValue, btn.preventClose)\"\n (keydown.enter)=\"handleAction(btn.action, btn.returnValue, btn.preventClose)\"\n (keydown.space)=\"handleAction(btn.action, btn.returnValue, btn.preventClose)\" />\n }\n </section>\n }\n </ng-template>\n</p-dialog>\n", styles: [":host ::ng-deep .p-dialog{max-height:90vh;display:flex;flex-direction:column}:host ::ng-deep .p-dialog.tk-modal--no-footer .p-dialog-footer{display:none!important}:host ::ng-deep .p-dialog-content{overflow-y:auto}:host ::ng-deep .p-dialog-content .modal-container{max-height:none!important}:host ::ng-deep .p-dialog-content .modal-container .modal-header,:host ::ng-deep .p-dialog-content .modal-container>div:last-child{display:none!important}:host ::ng-deep .p-dialog-content .modal-container .overflow-auto{overflow:visible!important;max-height:none!important;margin:0!important}:host ::ng-deep .p-dialog-content .modal-container .ark-modal-body{max-height:none!important;padding-bottom:0!important}:host ::ng-deep .p-dialog-title{color:var(--tk-color-text-default, #212121)}:host ::ng-deep .p-dialog-close-button{color:var(--tk-surface-500, #8a8a8b)}:host ::ng-deep .p-dialog-close-button:hover{background:var(--tk-color-base-surface-100, #f0f0f0)!important;color:var(--tk-surface-500, #8a8a8b)}.tk-modal__content{padding-bottom:var(--tk-spacing-padding-l, 1.25rem);color:var(--tk-surface-1000, #000000)}.tk-modal__footer{display:flex;flex-direction:row;justify-content:end;align-items:center;gap:var(--tk-spacing-base-50, .5rem);padding-top:var(--tk-spacing-padding-m, 1rem)}.tk-modal__footer--with-content{padding-right:var(--tk-spacing-padding-l, 1.25rem)}\n"] }]
245
278
  }], ctorParameters: () => [], propDecorators: { contentHost: [{ type: i0.ViewChild, args: ['contentHost', { ...{
246
279
  read: ViewContainerRef,
247
- }, isSignal: true }] }], dialogRef: [{ type: i0.Input, args: [{ isSignal: true, alias: "dialogRef", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], footerButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButtons", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], closeOnOutsideClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnOutsideClick", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], interceptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "interceptor", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], isOpened: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpened", required: false }] }, { type: i0.Output, args: ["isOpenedChange"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
280
+ }, isSignal: true }] }], dialogRef: [{ type: i0.Input, args: [{ isSignal: true, alias: "dialogRef", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], footerButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButtons", required: false }] }, { type: i0.Output, args: ["footerButtonsChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], closeOnOutsideClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnOutsideClick", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], interceptor: [{ type: i0.Input, args: [{ isSignal: true, alias: "interceptor", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], isOpened: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpened", required: false }] }, { type: i0.Output, args: ["isOpenedChange"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
248
281
 
249
282
  /**
250
283
  * @service ModalService
@@ -1 +1 @@
1
- {"version":3,"file":"tekus-design-system-components-modal.mjs","sources":["../../../projects/design-system/components/modal/src/modal.component.ts","../../../projects/design-system/components/modal/src/modal.component.html","../../../projects/design-system/components/modal/src/services/modal.service.ts","../../../projects/design-system/components/modal/tekus-design-system-components-modal.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n output,\n Type,\n ElementRef,\n model,\n viewChild,\n ViewContainerRef,\n ComponentRef,\n effect,\n OnDestroy,\n untracked,\n afterEveryRender,\n inject,\n Injector,\n} from '@angular/core';\nimport { ButtonComponent } from '@tekus/design-system/components/button';\nimport { DialogModule } from 'primeng/dialog';\nimport { ModalFooterButton, ModalSizeType } from './modal.types';\nimport {\n TkCanClose,\n TkCloseInterceptor,\n TkDialogRef,\n} from '@tekus/design-system/core/types';\n\n/**\n * @component ModalComponent\n * @description\n * A programmatically controlled modal dialog used for displaying dynamic content.\n * Modernized for Angular 19 with 100% synchronous Signal-based closing interception.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'tk-modal',\n imports: [DialogModule, ButtonComponent],\n templateUrl: './modal.component.html',\n styleUrl: './modal.component.scss',\n})\nexport class ModalComponent<T = unknown> implements OnDestroy {\n private readonly elementRef = inject(ElementRef);\n private readonly injector = inject(Injector);\n\n private readonly contentHost = viewChild('contentHost', {\n read: ViewContainerRef,\n });\n private componentRef?: ComponentRef<T>;\n\n /** The dialog ref associated with this modal */\n dialogRef = input<TkDialogRef<ModalComponent<T>, unknown> | null>(null);\n\n /** The title displayed at the top of the modal */\n title = input<string>('');\n\n /** The main content of the modal. Can be a string or a Component Type. */\n content = input<string | Type<T> | null>(null);\n\n /** Array of footer buttons with label, callback, and return value */\n footerButtons = input<ModalFooterButton[]>([]);\n\n /** Modal size: 'small', 'large', 'medium' or 'full' */\n size = input<ModalSizeType>('small');\n\n /** Whether the modal can be closed by the user via close button */\n closable = input<boolean>(true);\n\n /** Whether clicking outside the modal mask closes the modal */\n closeOnOutsideClick = input<boolean>(false);\n\n /**\n * Optional data to be passed as inputs to the dynamic component.\n */\n data = input<Partial<T>>({});\n\n /**\n * Optional interceptor called before the modal closes.\n * MUST be synchronous. Returns true to allow closing.\n */\n interceptor = input<TkCloseInterceptor | undefined>(undefined);\n\n /** Computed: whether the content is a simple string */\n isContentString = computed(() => typeof this.content() === 'string');\n\n /** Computed: whether the modal has footer buttons to display */\n hasFooter = computed(() => (this.footerButtons() ?? []).length > 0);\n\n /** Whether the modal should be responsive on mobile screens */\n responsive = input<boolean>(true);\n\n /** Visibility flag as Model Signal (allows two-way binding) */\n isOpened = model<boolean>(false);\n\n /** Whether the modal content has a scrollbar */\n hasScroll = false;\n\n // --- Internals ---\n /** Emits when the modal closes, passing the return value from footer buttons or null */\n readonly closed = output<unknown>();\n private alreadyEmitted = false;\n private returnValueOnClose: unknown = null;\n\n constructor() {\n /**\n * @summary Orchestrates the reactive dynamic lifecycle.\n */\n\n effect(() => {\n const opened = this.isOpened();\n const host = this.contentHost();\n this.dialogRef(); // Track it to re-run if it's set later\n\n untracked(() => {\n if (opened && host) {\n this.attachDynamicContent();\n } else if (!opened) {\n this.detachDynamicContent();\n }\n });\n });\n\n effect(() => {\n const currentData = this.data();\n untracked(() => this.syncDynamicInputs(currentData));\n });\n\n afterEveryRender(() => {\n this.checkScroll();\n });\n }\n\n /** Computed: calculates modal max-width based on `size` */\n modalMaxWidth = computed(() => {\n switch (this.size()) {\n case 'large':\n return '67.5rem';\n case 'medium':\n return '35rem';\n case 'full':\n return '98vw';\n default:\n return '25rem';\n }\n });\n\n ngOnDestroy(): void {\n this.detachDynamicContent();\n }\n\n /**\n * @summary Orchestrates dynamic rendering and destruction based on visibility.\n * @private\n */\n private attachDynamicContent(): void {\n const type = this.content();\n const host = this.contentHost();\n\n if (!type || typeof type === 'string' || !host) return;\n this.detachDynamicContent();\n\n const customInjector = Injector.create({\n providers: [{ provide: TkDialogRef, useValue: this.dialogRef() }],\n parent: this.injector,\n });\n\n this.componentRef = host.createComponent(type, {\n injector: customInjector,\n });\n this.syncDynamicInputs(this.data());\n }\n\n /**\n * @summary Synchronizes incoming data record with the dynamic instance @Inputs.\n * @private\n */\n private syncDynamicInputs(data: Partial<T>): void {\n if (!this.componentRef) return;\n Object.entries(data).forEach(([key, value]) => {\n this.componentRef?.setInput(key, value);\n });\n }\n\n /**\n * @summary Safely destroys the dynamic component and clears references.\n * @private\n */\n private detachDynamicContent(): void {\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = undefined;\n }\n }\n\n /**\n * Checks if the modal content has a scrollbar and updates `hasScroll` state.\n */\n checkScroll(): void {\n const contentEl =\n this.elementRef.nativeElement.querySelector('.p-dialog-content');\n if (contentEl) {\n this.hasScroll = contentEl.scrollHeight > contentEl.clientHeight;\n }\n }\n\n private wasOpened = false;\n\n /**\n * Opens the modal dialog.\n */\n open(): void {\n this.wasOpened = true;\n this.isOpened.set(true);\n this.resetClosureState();\n }\n\n /**\n * @summary Main entry point for closure requests.\n * Evaluation is 100% synchronous based on current Signal state.\n * @param returnValue (Optional) Value to emit on close.\n */\n tryClose(returnValue: unknown = null): void {\n if (this.canExecuteClosure()) {\n this.executeClosure(returnValue, arguments.length > 0);\n } else {\n const instance = this.componentRef?.instance as TkCanClose | undefined;\n instance?.onBlockedClose?.();\n }\n }\n\n /**\n * @summary Synchronous evaluator of hierarchical guards.\n * @returns true if closure is allowed.\n * @private\n */\n private canExecuteClosure(): boolean {\n const instance = this.componentRef?.instance as TkCanClose | undefined;\n const canClose = instance?.canClose ? instance.canClose() : true;\n if (!canClose) return false;\n\n const configInterceptor = this.interceptor();\n if (configInterceptor && !configInterceptor()) return false;\n\n return true;\n }\n\n /**\n * @summary Unified logic to execute the final closure state change.\n * @private\n */\n private executeClosure(returnValue: unknown, hasReturnValue: boolean): void {\n if (hasReturnValue) {\n this.alreadyEmitted = true;\n this.returnValueOnClose = returnValue;\n }\n this.isOpened.set(false);\n }\n\n /**\n * @summary Handles external visibility changes (from p-dialog 'X' or Escape).\n * Ensures the reactive guard is respected before allowing closure.\n */\n onVisibleChange(visible: boolean): void {\n if (!visible) {\n this.tryClose();\n }\n }\n\n /**\n * Handles the close event from the underlying dialog component.\n */\n handleClose(): void {\n if (!this.wasOpened || this.isOpened()) {\n return;\n }\n const valueToEmit = this.alreadyEmitted ? this.returnValueOnClose : null;\n this.closed.emit(valueToEmit);\n this.resetClosureState();\n this.wasOpened = false;\n }\n\n /**\n * @summary Handles actions triggered by footer buttons.\n */\n handleAction(action: (() => void) | undefined, returnValue: unknown): void {\n if (action) action();\n this.tryClose(returnValue);\n }\n\n /**\n * @summary Safely closes the modal forcefully without checks.\n */\n close(): void {\n this.tryClose();\n }\n\n /**\n * @private\n * Encapsulates state cleanup to avoid repetitive assignments\n */\n private resetClosureState(): void {\n this.alreadyEmitted = false;\n this.returnValueOnClose = null;\n }\n}\n","<p-dialog\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissableMask]=\"closeOnOutsideClick()\"\n [draggable]=\"false\"\n [focusOnShow]=\"false\"\n [header]=\"title()\"\n [style]=\"{\n 'max-width': modalMaxWidth(),\n width: 'calc(100% - var(--tk-spacing-base-200))',\n }\"\n (onHide)=\"handleClose()\"\n (onShow)=\"checkScroll()\"\n class=\"tk-modal\">\n @if (title()) {\n <ng-template pTemplate=\"header\">\n <span class=\"p-dialog-title\">{{ title() }}</span>\n </ng-template>\n }\n <section class=\"tk-modal__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n\n @if (hasFooter()) {\n <ng-template pTemplate=\"footer\">\n <section\n class=\"tk-modal__footer\"\n [class.tk-modal__footer--with-content]=\"hasScroll\">\n @for (btn of footerButtons()!; track $index) {\n <tk-button\n [label]=\"btn.label\"\n [severity]=\"btn.severity\"\n [variant]=\"btn.variant\"\n (clicked)=\"handleAction(btn.action, btn.returnValue)\"\n (keydown.enter)=\"handleAction(btn.action, btn.returnValue)\"\n (keydown.space)=\"handleAction(btn.action, btn.returnValue)\" />\n }\n </section>\n </ng-template>\n }\n</p-dialog>\n","import { Injectable, ApplicationRef, ComponentRef, createComponent, EmbeddedViewRef, inject } from '@angular/core';\nimport { ModalComponent } from '../modal.component';\nimport { ModalConfig } from '../modal.types';\nimport { TkDialogRef } from '@tekus/design-system/core/types';\n\n/**\n * @service ModalService\n * @description\n * Service responsible for programmatically opening and managing modal dialogs.\n * It handles component creation, attachment to the document body, and cleanup.\n */\n@Injectable({ providedIn: 'root' })\nexport class ModalService {\n private readonly appRef = inject(ApplicationRef);\n\n /** Reference to the currently open modal dialog ref */\n private dialogRef: TkDialogRef<ModalComponent> | null = null;\n\n /** Internal getter for testing purposes */\n get modalRefForTesting(): ComponentRef<ModalComponent> | null {\n return this.dialogRef?.componentRef || null;\n }\n /** Internal setter for testing purposes */\n set modalRefForTesting(ref: ComponentRef<ModalComponent> | null) {\n this.dialogRef = ref ? new TkDialogRef(ref) : null;\n }\n\n /**\n * Opens a modal dialog with the provided configuration.\n * Only one modal can be open at a time.\n * @param config Configuration object for the modal (title, content, buttons, etc.)\n * @returns A TkDialogRef for the opened modal.\n */\n open<T = unknown, R = unknown>(config: ModalConfig): TkDialogRef<ModalComponent<T>, R> {\n if (this.dialogRef) {\n return this.dialogRef as unknown as TkDialogRef<ModalComponent<T>, R>;\n }\n\n const componentRef = createComponent(ModalComponent, {\n environmentInjector: this.appRef.injector,\n }) as ComponentRef<ModalComponent<T>>;\n\n this.appRef.attachView(componentRef.hostView);\n\n const domElem = (componentRef.hostView as EmbeddedViewRef<unknown>).rootNodes[0] as HTMLElement;\n document.body.appendChild(domElem);\n\n const dialogRef = new TkDialogRef<ModalComponent<T>, R>(componentRef);\n this.dialogRef = dialogRef as unknown as TkDialogRef<ModalComponent>;\n\n componentRef.setInput('title', config.title);\n componentRef.setInput('content', config.content);\n componentRef.setInput('footerButtons', config.footerButtons || []);\n componentRef.setInput('size', config.size || 'small');\n componentRef.setInput('closable', config.closable ?? true);\n componentRef.setInput('closeOnOutsideClick', config.closeOnOutsideClick ?? false);\n componentRef.setInput('interceptor', config.interceptor);\n componentRef.setInput('data', config.data || {});\n componentRef.setInput('dialogRef', dialogRef);\n\n componentRef.instance.closed.subscribe((value: unknown) => {\n dialogRef.emitClose(value as R);\n this.appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n this.dialogRef = null;\n });\n\n componentRef.instance.open();\n\n return dialogRef;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AA4BA;;;;;AAKG;MAQU,cAAc,CAAA;AA8DzB,IAAA,WAAA,GAAA;AACE;;AAEG;A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IAAI,CAAC,SAAS,GAAG,IAAI;AACvB,QAAA,CAAC,CAAC;AAEF,QAAA,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE;AAE5B,QAAA,OAAO,SAAS;IAClB;8GA1DW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAZ,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cADC,MAAM,EAAA,CAAA,CAAA;;2FACnB,YAAY,EAAA,UAAA,EAAA,CAAA;kBADxB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACXlC;;AAEG;;;;"}
1
+ {"version":3,"file":"tekus-design-system-components-modal.mjs","sources":["../../../projects/design-system/components/modal/src/modal.component.ts","../../../projects/design-system/components/modal/src/modal.component.html","../../../projects/design-system/components/modal/src/services/modal.service.ts","../../../projects/design-system/components/modal/tekus-design-system-components-modal.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n output,\n Type,\n ElementRef,\n model,\n viewChild,\n ViewContainerRef,\n ComponentRef,\n effect,\n OnDestroy,\n untracked,\n afterEveryRender,\n inject,\n Injector,\n} from '@angular/core';\nimport { ButtonComponent } from '@tekus/design-system/components/button';\nimport { DialogModule } from 'primeng/dialog';\nimport { ModalFooterButton, ModalSizeType } from './modal.types';\nimport {\n TkCanClose,\n TkCloseInterceptor,\n TkDialogRef,\n} from '@tekus/design-system/core/types';\nimport { Observable, isObservable } from 'rxjs';\nimport { take } from 'rxjs/operators';\n\n/**\n * @component ModalComponent\n * @description\n * A programmatically controlled modal dialog used for displaying dynamic content.\n * Modernized for Angular 19 with 100% synchronous Signal-based closing interception.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'tk-modal',\n imports: [DialogModule, ButtonComponent],\n templateUrl: './modal.component.html',\n styleUrl: './modal.component.scss',\n})\nexport class ModalComponent<T = unknown> implements OnDestroy {\n private readonly elementRef = inject(ElementRef);\n private readonly injector = inject(Injector);\n\n private readonly contentHost = viewChild('contentHost', {\n read: ViewContainerRef,\n });\n private componentRef?: ComponentRef<T>;\n\n /** The dialog ref associated with this modal */\n dialogRef = input<TkDialogRef<ModalComponent<T>, unknown> | null>(null);\n\n /** The title displayed at the top of the modal */\n title = input<string>('');\n\n /** The main content of the modal. Can be a string or a Component Type. */\n content = input<string | Type<T> | null>(null);\n\n /** Array of footer buttons with label, callback, and return value */\n footerButtons = model<ModalFooterButton[]>([]);\n\n /** Modal size: 'small', 'large', 'medium' or 'full' */\n size = input<ModalSizeType>('small');\n\n /** Whether the modal can be closed by the user via close button */\n closable = input<boolean>(true);\n\n /** Whether clicking outside the modal mask closes the modal */\n closeOnOutsideClick = input<boolean>(false);\n\n /**\n * Optional data to be passed as inputs to the dynamic component.\n */\n data = input<Partial<T>>({});\n\n /**\n * Optional interceptor called before the modal closes.\n * MUST be synchronous. Returns true to allow closing.\n */\n interceptor = input<TkCloseInterceptor | undefined>(undefined);\n\n /** Computed: whether the content is a simple string */\n isContentString = computed(() => typeof this.content() === 'string');\n\n /** Computed: whether the modal has footer buttons to display */\n hasFooter = computed(() => (this.footerButtons() ?? []).length > 0);\n\n /** Whether the modal should be responsive on mobile screens */\n responsive = input<boolean>(true);\n\n /** Visibility flag as Model Signal (allows two-way binding) */\n isOpened = model<boolean>(false);\n\n /** Whether the modal content has a scrollbar */\n hasScroll = false;\n\n // --- Internals ---\n /** Emits when the modal closes, passing the return value from footer buttons or null */\n readonly closed = output<unknown>();\n private alreadyEmitted = false;\n private returnValueOnClose: unknown = null;\n\n constructor() {\n /**\n * @summary Orchestrates the reactive dynamic lifecycle.\n */\n\n effect(() => {\n const opened = this.isOpened();\n const host = this.contentHost();\n this.dialogRef(); // Track it to re-run if it's set later\n\n untracked(() => {\n if (opened && host) {\n this.attachDynamicContent();\n } else if (!opened) {\n this.detachDynamicContent();\n }\n });\n });\n\n effect(() => {\n const currentData = this.data();\n untracked(() => this.syncDynamicInputs(currentData));\n });\n\n afterEveryRender(() => {\n this.checkScroll();\n });\n }\n\n /** Computed: calculates modal max-width based on `size` */\n modalMaxWidth = computed(() => {\n switch (this.size()) {\n case 'large':\n return '67.5rem';\n case 'medium':\n return '35rem';\n case 'full':\n return '98vw';\n default:\n return '25rem';\n }\n });\n\n ngOnDestroy(): void {\n this.detachDynamicContent();\n }\n\n /**\n * @summary Orchestrates dynamic rendering and destruction based on visibility.\n * @private\n */\n private attachDynamicContent(): void {\n const type = this.content();\n const host = this.contentHost();\n\n if (!type || typeof type === 'string' || !host) return;\n this.detachDynamicContent();\n\n const customInjector = Injector.create({\n providers: [{ provide: TkDialogRef, useValue: this.dialogRef() }],\n parent: this.injector,\n });\n\n this.componentRef = host.createComponent(type, {\n injector: customInjector,\n });\n this.syncDynamicInputs(this.data());\n }\n\n /**\n * @summary Synchronizes incoming data record with the dynamic instance @Inputs.\n * @private\n */\n private syncDynamicInputs(data: Partial<T>): void {\n if (!this.componentRef) return;\n Object.entries(data).forEach(([key, value]) => {\n this.componentRef?.setInput(key, value);\n });\n }\n\n /**\n * @summary Safely destroys the dynamic component and clears references.\n * @private\n */\n private detachDynamicContent(): void {\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = undefined;\n }\n }\n\n /**\n * Checks if the modal content has a scrollbar and updates `hasScroll` state.\n */\n checkScroll(): void {\n const contentEl =\n this.elementRef.nativeElement.querySelector('.p-dialog-content');\n if (contentEl) {\n this.hasScroll = contentEl.scrollHeight > contentEl.clientHeight;\n }\n }\n\n private wasOpened = false;\n\n /**\n * Opens the modal dialog.\n */\n open(): void {\n this.wasOpened = true;\n this.isOpened.set(true);\n this.resetClosureState();\n }\n\n /**\n * @summary Main entry point for closure requests.\n * Supports synchronous and asynchronous (Promise/Observable) evaluations.\n * @param returnValue (Optional) Value to emit on close.\n */\n tryClose(returnValue: unknown = null): void {\n const hasReturnValue = arguments.length > 0;\n const instance = this.componentRef?.instance as TkCanClose | undefined;\n const canCloseFn = instance?.canClose ? instance.canClose() : true;\n\n this.evaluateCanClose(canCloseFn, (canCloseInstance) => {\n if (!canCloseInstance) {\n instance?.onBlockedClose?.();\n return;\n }\n\n const configInterceptor = this.interceptor();\n if (configInterceptor) {\n const interceptorResult = configInterceptor();\n this.evaluateCanClose(interceptorResult, (canCloseInterceptor) => {\n if (canCloseInterceptor) {\n this.executeClosure(returnValue, hasReturnValue);\n } else {\n instance?.onBlockedClose?.();\n }\n });\n } else {\n this.executeClosure(returnValue, hasReturnValue);\n }\n });\n }\n\n /**\n * Evaluates a boolean, Promise or Observable to check if closing is allowed.\n */\n private evaluateCanClose(\n result: boolean | Promise<boolean> | Observable<boolean>,\n callback: (canClose: boolean) => void\n ): void {\n if (isObservable(result)) {\n result.pipe(take(1)).subscribe({\n next: (res) => callback(res),\n error: () => callback(false),\n });\n } else if (result instanceof Promise) {\n result.then(\n (res) => callback(res),\n () => callback(false)\n );\n } else {\n callback(result);\n }\n }\n\n /**\n * Resolves a static or functional property of a button.\n */\n resolveProperty<R>(prop: R | (() => R) | undefined): R | undefined {\n if (typeof prop === 'function') {\n return (prop as () => R)();\n }\n return prop;\n }\n\n /**\n * @summary Unified logic to execute the final closure state change.\n * @private\n */\n private executeClosure(returnValue: unknown, hasReturnValue: boolean): void {\n if (hasReturnValue) {\n this.alreadyEmitted = true;\n this.returnValueOnClose = returnValue;\n }\n this.isOpened.set(false);\n }\n\n /**\n * @summary Handles external visibility changes (from p-dialog 'X' or Escape).\n * Ensures the reactive guard is respected before allowing closure.\n */\n onVisibleChange(visible: boolean): void {\n if (!visible) {\n this.tryClose();\n }\n }\n\n /**\n * Handles the close event from the underlying dialog component.\n */\n handleClose(): void {\n if (!this.wasOpened || this.isOpened()) {\n return;\n }\n const valueToEmit = this.alreadyEmitted ? this.returnValueOnClose : null;\n this.closed.emit(valueToEmit);\n this.resetClosureState();\n this.wasOpened = false;\n }\n\n /**\n * @summary Handles actions triggered by footer buttons.\n */\n handleAction(\n action: (() => void) | undefined,\n returnValue: unknown,\n preventClose = false\n ): void {\n if (action) action();\n if (!preventClose) {\n this.tryClose(returnValue);\n }\n }\n\n /**\n * @summary Safely closes the modal, optionally passing a return value.\n * @param returnValue Value to emit when closing.\n */\n close(returnValue: unknown = null): void {\n this.tryClose(returnValue);\n }\n\n /**\n * @private\n * Encapsulates state cleanup to avoid repetitive assignments\n */\n private resetClosureState(): void {\n this.alreadyEmitted = false;\n this.returnValueOnClose = null;\n }\n}\n","<p-dialog\n [modal]=\"true\"\n [visible]=\"isOpened()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [closable]=\"closable()\"\n [dismissableMask]=\"closeOnOutsideClick()\"\n [draggable]=\"false\"\n [focusOnShow]=\"false\"\n [header]=\"title()\"\n [style]=\"{\n 'max-width': modalMaxWidth(),\n width: 'calc(100% - var(--tk-spacing-base-200))',\n }\"\n (onHide)=\"handleClose()\"\n (onShow)=\"checkScroll()\"\n [styleClass]=\"hasFooter() ? 'tk-modal--has-footer' : 'tk-modal--no-footer'\"\n class=\"tk-modal\">\n @if (title()) {\n <ng-template pTemplate=\"header\">\n <span class=\"p-dialog-title\">{{ title() }}</span>\n </ng-template>\n }\n <section class=\"tk-modal__content\">\n @if (content()) {\n @if (isContentString()) {\n <p [innerHTML]=\"content()\"></p>\n } @else {\n <ng-template #contentHost></ng-template>\n }\n }\n </section>\n\n <ng-template pTemplate=\"footer\">\n @if (hasFooter()) {\n <section\n class=\"tk-modal__footer\"\n [class.tk-modal__footer--with-content]=\"hasScroll\">\n @for (btn of footerButtons()!; track $index) {\n <tk-button\n [label]=\"resolveProperty(btn.label)!\"\n [severity]=\"btn.severity\"\n [variant]=\"btn.variant\"\n [disabled]=\"resolveProperty(btn.disabled) ?? false\"\n (clicked)=\"handleAction(btn.action, btn.returnValue, btn.preventClose)\"\n (keydown.enter)=\"handleAction(btn.action, btn.returnValue, btn.preventClose)\"\n (keydown.space)=\"handleAction(btn.action, btn.returnValue, btn.preventClose)\" />\n }\n </section>\n }\n </ng-template>\n</p-dialog>\n","import { Injectable, ApplicationRef, ComponentRef, createComponent, EmbeddedViewRef, inject } from '@angular/core';\nimport { ModalComponent } from '../modal.component';\nimport { ModalConfig } from '../modal.types';\nimport { TkDialogRef } from '@tekus/design-system/core/types';\n\n/**\n * @service ModalService\n * @description\n * Service responsible for programmatically opening and managing modal dialogs.\n * It handles component creation, attachment to the document body, and cleanup.\n */\n@Injectable({ providedIn: 'root' })\nexport class ModalService {\n private readonly appRef = inject(ApplicationRef);\n\n /** Reference to the currently open modal dialog ref */\n private dialogRef: TkDialogRef<ModalComponent> | null = null;\n\n /** Internal getter for testing purposes */\n get modalRefForTesting(): ComponentRef<ModalComponent> | null {\n return this.dialogRef?.componentRef || null;\n }\n /** Internal setter for testing purposes */\n set modalRefForTesting(ref: ComponentRef<ModalComponent> | null) {\n this.dialogRef = ref ? new TkDialogRef(ref) : null;\n }\n\n /**\n * Opens a modal dialog with the provided configuration.\n * Only one modal can be open at a time.\n * @param config Configuration object for the modal (title, content, buttons, etc.)\n * @returns A TkDialogRef for the opened modal.\n */\n open<T = unknown, R = unknown>(config: ModalConfig): TkDialogRef<ModalComponent<T>, R> {\n if (this.dialogRef) {\n return this.dialogRef as unknown as TkDialogRef<ModalComponent<T>, R>;\n }\n\n const componentRef = createComponent(ModalComponent, {\n environmentInjector: this.appRef.injector,\n }) as ComponentRef<ModalComponent<T>>;\n\n this.appRef.attachView(componentRef.hostView);\n\n const domElem = (componentRef.hostView as EmbeddedViewRef<unknown>).rootNodes[0] as HTMLElement;\n document.body.appendChild(domElem);\n\n const dialogRef = new TkDialogRef<ModalComponent<T>, R>(componentRef);\n this.dialogRef = dialogRef as unknown as TkDialogRef<ModalComponent>;\n\n componentRef.setInput('title', config.title);\n componentRef.setInput('content', config.content);\n componentRef.setInput('footerButtons', config.footerButtons || []);\n componentRef.setInput('size', config.size || 'small');\n componentRef.setInput('closable', config.closable ?? true);\n componentRef.setInput('closeOnOutsideClick', config.closeOnOutsideClick ?? false);\n componentRef.setInput('interceptor', config.interceptor);\n componentRef.setInput('data', config.data || {});\n componentRef.setInput('dialogRef', dialogRef);\n\n componentRef.instance.closed.subscribe((value: unknown) => {\n dialogRef.emitClose(value as R);\n this.appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n this.dialogRef = null;\n });\n\n componentRef.instance.open();\n\n return dialogRef;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AA8BA;;;;;AAKG;MAQU,cAAc,CAAA;AA8DzB,IAAA,WAAA,GAAA;AACE;;AAEG;AAhEY,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAE3B,IAAA,CAAA,WAAW,GAAG,SAAS,CAAC,aAAa,mFACpD,IAAI,EAAE,gBAAgB,EAAA,CACtB;;AAIF,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAiD,IAAI,gFAAC;;AAGvE,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;;AAGzB,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAA0B,IAAI,8EAAC;;AAG9C,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAsB,EAAE,oFAAC;;AAG9C,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAgB,OAAO,2EAAC;;AAGpC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,IAAI,+EAAC;;AAG/B,QAAA,IAAA,CAAA,mBAAmB,GAAG,KAAK,CAAU,KAAK,0FAAC;AAE3C;;AAEG;AACH,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAA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,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;AAChD,QAAA,YAAY,CAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC;QAE7C,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAc,KAAI;AACxD,YAAA,SAAS,CAAC,SAAS,CAAC,KAAU,CAAC;YAC/B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC;YAC7C,YAAY,CAAC,OAAO,EAAE;AACtB,YAAA,IAAI,CAAC,SAAS,GAAG,IAAI;AACvB,QAAA,CAAC,CAAC;AAEF,QAAA,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE;AAE5B,QAAA,OAAO,SAAS;IAClB;8GA1DW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAZ,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cADC,MAAM,EAAA,CAAA,CAAA;;2FACnB,YAAY,EAAA,UAAA,EAAA,CAAA;kBADxB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACXlC;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tekus/design-system",
3
3
  "description": "Tekus design system library",
4
- "version": "5.29.0",
4
+ "version": "5.29.2",
5
5
  "license": "UNLICENSED",
6
6
  "peerDependencies": {
7
7
  "@angular/core": "^21.0.0",
@@ -9,7 +9,7 @@ declare class BreadCrumpsComponent {
9
9
  private readonly router;
10
10
  /** Optional manual items. If provided, route listening is ignored. */
11
11
  items: _angular_core.InputSignal<BreadCrumpItem[] | null>;
12
- /** Size of the breadcrumbs title. Can be 'small' (24px) or 'large' (32px). Default is 'small'. */
12
+ /** Size of the breadcrumbs title. Can be 'small' (24px) or 'large' (32px). Default is 'large'. */
13
13
  size: _angular_core.InputSignal<"small" | "large">;
14
14
  /** If true, only the current (last) item will be displayed. */
15
15
  onlyCurrent: _angular_core.InputSignal<boolean>;
@@ -6,7 +6,7 @@ import { TkCloseInterceptor, TkDialogRef } from '@tekus/design-system/core/types
6
6
  type ModalSizeType = 'small' | 'large' | 'medium' | 'full';
7
7
  type SeverityType = 'primary' | 'secondary' | 'danger';
8
8
  interface ModalFooterButton {
9
- label: string;
9
+ label: string | (() => string);
10
10
  severity: SeverityType;
11
11
  /** Optional callback function executed when the button is clicked */
12
12
  action?: () => void;
@@ -14,6 +14,10 @@ interface ModalFooterButton {
14
14
  returnValue?: unknown;
15
15
  /** Optional button variant */
16
16
  variant?: Variant;
17
+ /** Optional disabled state (boolean or evaluation function) */
18
+ disabled?: boolean | (() => boolean);
19
+ /** Optional flag to prevent auto-closing of the modal when the button is clicked */
20
+ preventClose?: boolean;
17
21
  }
18
22
  interface ModalConfig<T = unknown> {
19
23
  /** The title displayed at the top of the modal */
@@ -58,7 +62,7 @@ declare class ModalComponent<T = unknown> implements OnDestroy {
58
62
  /** The main content of the modal. Can be a string or a Component Type. */
59
63
  content: _angular_core.InputSignal<string | Type<T> | null>;
60
64
  /** Array of footer buttons with label, callback, and return value */
61
- footerButtons: _angular_core.InputSignal<ModalFooterButton[]>;
65
+ footerButtons: _angular_core.ModelSignal<ModalFooterButton[]>;
62
66
  /** Modal size: 'small', 'large', 'medium' or 'full' */
63
67
  size: _angular_core.InputSignal<ModalSizeType>;
64
68
  /** Whether the modal can be closed by the user via close button */
@@ -118,16 +122,18 @@ declare class ModalComponent<T = unknown> implements OnDestroy {
118
122
  open(): void;
119
123
  /**
120
124
  * @summary Main entry point for closure requests.
121
- * Evaluation is 100% synchronous based on current Signal state.
125
+ * Supports synchronous and asynchronous (Promise/Observable) evaluations.
122
126
  * @param returnValue (Optional) Value to emit on close.
123
127
  */
124
128
  tryClose(returnValue?: unknown): void;
125
129
  /**
126
- * @summary Synchronous evaluator of hierarchical guards.
127
- * @returns true if closure is allowed.
128
- * @private
130
+ * Evaluates a boolean, Promise or Observable to check if closing is allowed.
131
+ */
132
+ private evaluateCanClose;
133
+ /**
134
+ * Resolves a static or functional property of a button.
129
135
  */
130
- private canExecuteClosure;
136
+ resolveProperty<R>(prop: R | (() => R) | undefined): R | undefined;
131
137
  /**
132
138
  * @summary Unified logic to execute the final closure state change.
133
139
  * @private
@@ -145,18 +151,19 @@ declare class ModalComponent<T = unknown> implements OnDestroy {
145
151
  /**
146
152
  * @summary Handles actions triggered by footer buttons.
147
153
  */
148
- handleAction(action: (() => void) | undefined, returnValue: unknown): void;
154
+ handleAction(action: (() => void) | undefined, returnValue: unknown, preventClose?: boolean): void;
149
155
  /**
150
- * @summary Safely closes the modal forcefully without checks.
156
+ * @summary Safely closes the modal, optionally passing a return value.
157
+ * @param returnValue Value to emit when closing.
151
158
  */
152
- close(): void;
159
+ close(returnValue?: unknown): void;
153
160
  /**
154
161
  * @private
155
162
  * Encapsulates state cleanup to avoid repetitive assignments
156
163
  */
157
164
  private resetClosureState;
158
165
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ModalComponent<any>, never>;
159
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ModalComponent<any>, "tk-modal", never, { "dialogRef": { "alias": "dialogRef"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "footerButtons": { "alias": "footerButtons"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; "closeOnOutsideClick": { "alias": "closeOnOutsideClick"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "interceptor": { "alias": "interceptor"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "isOpened": { "alias": "isOpened"; "required": false; "isSignal": true; }; }, { "isOpened": "isOpenedChange"; "closed": "closed"; }, never, never, true, never>;
166
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ModalComponent<any>, "tk-modal", never, { "dialogRef": { "alias": "dialogRef"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "footerButtons": { "alias": "footerButtons"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; "closeOnOutsideClick": { "alias": "closeOnOutsideClick"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "interceptor": { "alias": "interceptor"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "isOpened": { "alias": "isOpened"; "required": false; "isSignal": true; }; }, { "footerButtons": "footerButtonsChange"; "isOpened": "isOpenedChange"; "closed": "closed"; }, never, never, true, never>;
160
167
  }
161
168
 
162
169
  /**
@@ -2,7 +2,7 @@ import { ValidatorFn } from '@angular/forms';
2
2
  import * as _angular_core from '@angular/core';
3
3
  import { ComponentRef } from '@angular/core';
4
4
  import { Preset } from '@primeuix/themes/types';
5
- import { PartialObserver, Subscription, Subject } from 'rxjs';
5
+ import { Observable, PartialObserver, Subscription, Subject } from 'rxjs';
6
6
 
7
7
  interface Option {
8
8
  ViewValue: string;
@@ -167,7 +167,7 @@ interface TkCanClose {
167
167
  * Function or Signal indicating if the component can be closed.
168
168
  * When returning false, the overlay will prevent closure.
169
169
  */
170
- canClose?: () => boolean;
170
+ canClose?: () => boolean | Promise<boolean> | Observable<boolean>;
171
171
  /**
172
172
  * Optional hook called when a user attempt to close the overlay is blocked
173
173
  * by the canClose() returning false.
@@ -176,9 +176,8 @@ interface TkCanClose {
176
176
  }
177
177
  /**
178
178
  * Type definition for the overlay closing interceptor.
179
- * It must be a synchronous function returning the "allowed" state.
180
179
  */
181
- type TkCloseInterceptor = () => boolean;
180
+ type TkCloseInterceptor = () => boolean | Promise<boolean> | Observable<boolean>;
182
181
 
183
182
  /**
184
183
  * Reference to a dialog/drawer opened via a service.
@@ -2,7 +2,7 @@ import { ValidatorFn } from '@angular/forms';
2
2
  import * as _angular_core from '@angular/core';
3
3
  import { ComponentRef } from '@angular/core';
4
4
  import { Preset } from '@primeuix/themes/types';
5
- import { PartialObserver, Subscription, Subject } from 'rxjs';
5
+ import { Observable, PartialObserver, Subscription, Subject } from 'rxjs';
6
6
 
7
7
  interface Option {
8
8
  ViewValue: string;
@@ -167,7 +167,7 @@ interface TkCanClose {
167
167
  * Function or Signal indicating if the component can be closed.
168
168
  * When returning false, the overlay will prevent closure.
169
169
  */
170
- canClose?: () => boolean;
170
+ canClose?: () => boolean | Promise<boolean> | Observable<boolean>;
171
171
  /**
172
172
  * Optional hook called when a user attempt to close the overlay is blocked
173
173
  * by the canClose() returning false.
@@ -176,9 +176,8 @@ interface TkCanClose {
176
176
  }
177
177
  /**
178
178
  * Type definition for the overlay closing interceptor.
179
- * It must be a synchronous function returning the "allowed" state.
180
179
  */
181
- type TkCloseInterceptor = () => boolean;
180
+ type TkCloseInterceptor = () => boolean | Promise<boolean> | Observable<boolean>;
182
181
 
183
182
  /**
184
183
  * Reference to a dialog/drawer opened via a service.