@tekus/design-system 5.22.1 → 5.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/tekus-design-system-components-autocomplete.mjs +24 -17
- package/fesm2022/tekus-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-badge.mjs +3 -3
- package/fesm2022/tekus-design-system-components-badge.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-button.mjs +48 -31
- package/fesm2022/tekus-design-system-components-button.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-checkbox.mjs +13 -16
- package/fesm2022/tekus-design-system-components-checkbox.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-date-picker.mjs +117 -21
- package/fesm2022/tekus-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-drawer.mjs +7 -7
- package/fesm2022/tekus-design-system-components-drawer.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-fallback-view.mjs +18 -38
- package/fesm2022/tekus-design-system-components-fallback-view.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-icon.mjs +11 -17
- package/fesm2022/tekus-design-system-components-icon.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-input-number.mjs +15 -14
- package/fesm2022/tekus-design-system-components-input-number.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-input-text.mjs +19 -21
- package/fesm2022/tekus-design-system-components-input-text.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-modal.mjs +9 -8
- package/fesm2022/tekus-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-multiselect.mjs +3 -3
- package/fesm2022/tekus-design-system-components-multiselect.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-pagination.mjs +3 -3
- package/fesm2022/tekus-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-panel.mjs +21 -30
- package/fesm2022/tekus-design-system-components-panel.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-radio-button.mjs +14 -16
- package/fesm2022/tekus-design-system-components-radio-button.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-select.mjs +13 -11
- package/fesm2022/tekus-design-system-components-select.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-table.mjs +27 -23
- package/fesm2022/tekus-design-system-components-table.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-tabs.mjs +3 -3
- package/fesm2022/tekus-design-system-components-tabs.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-tag.mjs +3 -3
- package/fesm2022/tekus-design-system-components-tag.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-textarea.mjs +15 -14
- package/fesm2022/tekus-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-toolbar.mjs +3 -3
- package/fesm2022/tekus-design-system-components-toolbar.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-tooltip.mjs +3 -3
- package/fesm2022/tekus-design-system-components-tooltip.mjs.map +1 -1
- package/fesm2022/tekus-design-system-components-topbar.mjs +3 -3
- package/fesm2022/tekus-design-system-components-topbar.mjs.map +1 -1
- package/fesm2022/tekus-design-system-core-types.mjs +5 -0
- package/fesm2022/tekus-design-system-core-types.mjs.map +1 -1
- package/fesm2022/tekus-design-system-core.mjs +5 -0
- package/fesm2022/tekus-design-system-core.mjs.map +1 -1
- package/fesm2022/tekus-design-system-directives-gird-item.mjs +19 -24
- package/fesm2022/tekus-design-system-directives-gird-item.mjs.map +1 -1
- package/package.json +1 -1
- package/types/tekus-design-system-components-autocomplete.d.ts +10 -2
- package/types/tekus-design-system-components-button.d.ts +15 -19
- package/types/tekus-design-system-components-checkbox.d.ts +3 -8
- package/types/tekus-design-system-components-date-picker.d.ts +63 -5
- package/types/tekus-design-system-components-drawer.d.ts +3 -3
- package/types/tekus-design-system-components-fallback-view.d.ts +17 -18
- package/types/tekus-design-system-components-icon.d.ts +7 -16
- package/types/tekus-design-system-components-input-number.d.ts +3 -4
- package/types/tekus-design-system-components-input-text.d.ts +4 -10
- package/types/tekus-design-system-components-modal.d.ts +3 -3
- package/types/tekus-design-system-components-panel.d.ts +10 -18
- package/types/tekus-design-system-components-radio-button.d.ts +3 -7
- package/types/tekus-design-system-components-select.d.ts +14 -1
- package/types/tekus-design-system-components-table.d.ts +5 -5
- package/types/tekus-design-system-components-textarea.d.ts +3 -4
- package/types/tekus-design-system-directives-gird-item.d.ts +5 -5
|
@@ -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 { Component, computed, input, model, EventEmitter, Type, ElementRef, ViewContainerRef, viewChild, ComponentRef, effect, untracked, OnDestroy, afterEveryRender, inject } from '@angular/core';\nimport { ButtonComponent } from '@tekus/design-system/components/button';\nimport { DrawerModule } from 'primeng/drawer';\nimport { DrawerHeaderAction, DrawerSizeType } from './drawer.types';\nimport {\n TkCanClose,\n TkCloseInterceptor,\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 selector: 'tk-drawer',\n standalone: true,\n imports: [DrawerModule, ButtonComponent],\n templateUrl: './drawer.component.html',\n styleUrls: ['./drawer.component.scss'],\n})\nexport class DrawerComponent<T = unknown> implements OnDestroy {\n private readonly elementRef = inject(ElementRef);\n\n private readonly contentHost = viewChild('contentHost', {\n read: ViewContainerRef,\n });\n private componentRef?: ComponentRef<T>;\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 /** 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 onClose = new EventEmitter<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\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 this.componentRef = host.createComponent(type);\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 this.hasScroll = contentEl.scrollHeight > contentEl.clientHeight;\n }\n }\n\n /** Opens the drawer */\n open(): void {\n this.isOpened.set(true);\n this.resetClosureState();\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 }\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.onClose.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 (onHide)=\"handleClose()\">\n <ng-template pTemplate=\"header\">\n <div class=\"tk-drawer__header\">\n <h2 class=\"tk-drawer__title\" [title]=\"title()\">{{ title() }}</h2>\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 <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 { Injectable, ApplicationRef, ComponentRef, createComponent, EmbeddedViewRef, inject } from '@angular/core';\nimport { DrawerComponent } from '../drawer.component';\nimport { Observable, Subject } from 'rxjs';\nimport { DrawerConfig } from '../drawer.types';\n\n@Injectable({ providedIn: 'root' })\nexport class DrawerService {\n private readonly appRef = inject(ApplicationRef);\n\n private drawerRef: ComponentRef<DrawerComponent<unknown>> | null = null;\n\n get _drawerRefForTesting(): ComponentRef<DrawerComponent<unknown>> | null {\n return this.drawerRef;\n }\n set _drawerRefForTesting(ref: ComponentRef<DrawerComponent<unknown>> | null) {\n this.drawerRef = ref;\n }\n\n open(config: DrawerConfig): Observable<unknown> {\n if (this.drawerRef) {\n this.drawerRef.instance.close();\n this.appRef.detachView(this.drawerRef.hostView);\n this.drawerRef.destroy();\n this.drawerRef = null;\n }\n\n const componentRef = createComponent(DrawerComponent, {\n environmentInjector: this.appRef.injector,\n });\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('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 close$ = new Subject<unknown>();\n\n componentRef.instance.onClose.subscribe(value => {\n close$.next(value);\n close$.complete();\n\n this.appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n if (this.drawerRef === (componentRef as unknown)) {\n this.drawerRef = null;\n }\n });\n\n componentRef.instance.open();\n this.drawerRef = componentRef as unknown as ComponentRef<\n DrawerComponent<unknown>\n >;\n\n return close$.asObservable();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;MAQU,eAAe,CAAA;AAwD1B,IAAA,WAAA,GAAA;AAvDiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA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AAI,IAAI,CAAC,SAAS,KAAM,YAAwB,EAAE;AAChD,gBAAA,IAAI,CAAC,SAAS,GAAG,IAAI;YACvB;AACF,QAAA,CAAC,CAAC;AAEF,QAAA,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE;AAC5B,QAAA,IAAI,CAAC,SAAS,GAAG,YAEhB;AAED,QAAA,OAAO,MAAM,CAAC,YAAY,EAAE;IAC9B;8GA1DW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAb,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,aAAa,cADA,MAAM,EAAA,CAAA,CAAA;;2FACnB,aAAa,EAAA,UAAA,EAAA,CAAA;kBADzB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACLlC;;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 { ChangeDetectionStrategy, Component, computed, input, model, output, Type, ElementRef, ViewContainerRef, viewChild, ComponentRef, effect, untracked, OnDestroy, afterEveryRender, inject } from '@angular/core';\nimport { ButtonComponent } from '@tekus/design-system/components/button';\nimport { DrawerModule } from 'primeng/drawer';\nimport { DrawerHeaderAction, DrawerSizeType } from './drawer.types';\nimport {\n TkCanClose,\n TkCloseInterceptor,\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],\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\n private readonly contentHost = viewChild('contentHost', {\n read: ViewContainerRef,\n });\n private componentRef?: ComponentRef<T>;\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 /** 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\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 this.componentRef = host.createComponent(type);\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 this.hasScroll = contentEl.scrollHeight > contentEl.clientHeight;\n }\n }\n\n /** Opens the drawer */\n open(): void {\n this.isOpened.set(true);\n this.resetClosureState();\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 }\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 (onHide)=\"handleClose()\">\n <ng-template pTemplate=\"header\">\n <div class=\"tk-drawer__header\">\n <h2 class=\"tk-drawer__title\" [title]=\"title()\">{{ title() }}</h2>\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 <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 { Injectable, ApplicationRef, ComponentRef, createComponent, EmbeddedViewRef, inject } from '@angular/core';\nimport { DrawerComponent } from '../drawer.component';\nimport { Observable, Subject } from 'rxjs';\nimport { DrawerConfig } from '../drawer.types';\n\n@Injectable({ providedIn: 'root' })\nexport class DrawerService {\n private readonly appRef = inject(ApplicationRef);\n\n private drawerRef: ComponentRef<DrawerComponent<unknown>> | null = null;\n\n get _drawerRefForTesting(): ComponentRef<DrawerComponent<unknown>> | null {\n return this.drawerRef;\n }\n set _drawerRefForTesting(ref: ComponentRef<DrawerComponent<unknown>> | null) {\n this.drawerRef = ref;\n }\n\n open(config: DrawerConfig): Observable<unknown> {\n if (this.drawerRef) {\n this.drawerRef.instance.close();\n this.appRef.detachView(this.drawerRef.hostView);\n this.drawerRef.destroy();\n this.drawerRef = null;\n }\n\n const componentRef = createComponent(DrawerComponent, {\n environmentInjector: this.appRef.injector,\n });\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('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 close$ = new Subject<unknown>();\n\n componentRef.instance.closed.subscribe(value => {\n close$.next(value);\n close$.complete();\n\n this.appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n if (this.drawerRef === (componentRef as unknown)) {\n this.drawerRef = null;\n }\n });\n\n componentRef.instance.open();\n this.drawerRef = componentRef as unknown as ComponentRef<\n DrawerComponent<unknown>\n >;\n\n return close$.asObservable();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;MAQU,eAAe,CAAA;AAwD1B,IAAA,WAAA,GAAA;AAvDiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAE/B,IAAA,CAAA,WAAW,GAAG,SAAS,CAAC,aAAa,mFACpD,IAAI,EAAE,gBAAgB,EAAA,CACtB;;AAIF,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAU;;AAGhC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAA0B,IAAI,8EAAC;;AAG9C,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAA4B,IAAI,mFAAC;;AAGrD,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAiB,OAAO,2EAAC;;AAGrC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,IAAI,+EAAC;;AAG/B,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAU,IAAI,kFAAC;;AAGlC,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAa,EAAE,2EAAC;;AAG5B,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAiC,SAAS,kFAAC;AAE9D,QAAA,IAAA,CAAA,eAAe,GAAG,QAAQ,CAAC,MAAM,OAAO,IAAI,CAAC,OAAO,EAAE,KAAK,QAAQ,sFAAC;AACpE,QAAA,IAAA,CAAA,eAAe,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,EAAE,IAAI,IAAI,sFAAC;;AAG7D,QAAA,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ular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, output, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
3
|
import { ButtonComponent } from '@tekus/design-system/components/button';
|
|
4
4
|
import { CardModule } from 'primeng/card';
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ import { CardModule } from 'primeng/card';
|
|
|
7
7
|
* @component FallbackViewComponent
|
|
8
8
|
* @description
|
|
9
9
|
* A reusable component for displaying fallback or empty states such as
|
|
10
|
-
*
|
|
10
|
+
* "no results found", "error loading data", or "content not available".
|
|
11
11
|
* It provides a consistent structure with support for an image, title,
|
|
12
12
|
* message, and optional action buttons.
|
|
13
13
|
*
|
|
@@ -70,9 +70,9 @@ class FallbackViewComponent {
|
|
|
70
70
|
* - `'content'`: Standard size.
|
|
71
71
|
* - `'section'`: A more compact version.
|
|
72
72
|
*
|
|
73
|
-
* @default `'
|
|
73
|
+
* @default `'content'`
|
|
74
74
|
*/
|
|
75
|
-
this.type = 'content';
|
|
75
|
+
this.type = input('content', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
76
76
|
/**
|
|
77
77
|
* @property {string} imageSrc
|
|
78
78
|
* @description
|
|
@@ -80,12 +80,12 @@ class FallbackViewComponent {
|
|
|
80
80
|
*
|
|
81
81
|
* @default `''`
|
|
82
82
|
*/
|
|
83
|
-
this.imageSrc = '';
|
|
83
|
+
this.imageSrc = input('', ...(ngDevMode ? [{ debugName: "imageSrc" }] : /* istanbul ignore next */ []));
|
|
84
84
|
/**
|
|
85
85
|
* @property {string} illustrationAlt
|
|
86
86
|
* Descriptive alternative text for the image. Improves accessibility.
|
|
87
87
|
*/
|
|
88
|
-
this.illustrationAlt = '';
|
|
88
|
+
this.illustrationAlt = input('', ...(ngDevMode ? [{ debugName: "illustrationAlt" }] : /* istanbul ignore next */ []));
|
|
89
89
|
/**
|
|
90
90
|
* @property {string} title
|
|
91
91
|
* @description
|
|
@@ -93,7 +93,7 @@ class FallbackViewComponent {
|
|
|
93
93
|
*
|
|
94
94
|
* @default `''`
|
|
95
95
|
*/
|
|
96
|
-
this.title = '';
|
|
96
|
+
this.title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
97
97
|
/**
|
|
98
98
|
* @property {string} message
|
|
99
99
|
* @description
|
|
@@ -101,7 +101,7 @@ class FallbackViewComponent {
|
|
|
101
101
|
*
|
|
102
102
|
* @default `''`
|
|
103
103
|
*/
|
|
104
|
-
this.message = '';
|
|
104
|
+
this.message = input('', ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
105
105
|
/**
|
|
106
106
|
* @property {string} buttonLabel
|
|
107
107
|
* @description
|
|
@@ -109,7 +109,7 @@ class FallbackViewComponent {
|
|
|
109
109
|
*
|
|
110
110
|
* @default `''`
|
|
111
111
|
*/
|
|
112
|
-
this.buttonLabel = '';
|
|
112
|
+
this.buttonLabel = input('', ...(ngDevMode ? [{ debugName: "buttonLabel" }] : /* istanbul ignore next */ []));
|
|
113
113
|
/**
|
|
114
114
|
* @property {string} linkLabel
|
|
115
115
|
* @description
|
|
@@ -118,7 +118,7 @@ class FallbackViewComponent {
|
|
|
118
118
|
*
|
|
119
119
|
* @default `''`
|
|
120
120
|
*/
|
|
121
|
-
this.linkLabel = '';
|
|
121
|
+
this.linkLabel = input('', ...(ngDevMode ? [{ debugName: "linkLabel" }] : /* istanbul ignore next */ []));
|
|
122
122
|
/**
|
|
123
123
|
* @property {boolean} buttonDisabled
|
|
124
124
|
* @description
|
|
@@ -127,26 +127,26 @@ class FallbackViewComponent {
|
|
|
127
127
|
*
|
|
128
128
|
* @default false
|
|
129
129
|
*/
|
|
130
|
-
this.buttonDisabled = false;
|
|
130
|
+
this.buttonDisabled = input(false, ...(ngDevMode ? [{ debugName: "buttonDisabled" }] : /* istanbul ignore next */ []));
|
|
131
131
|
/**
|
|
132
132
|
* @event buttonAction
|
|
133
133
|
* @description
|
|
134
134
|
* Emits when the main action button is clicked. Listen to this event
|
|
135
135
|
* to handle the primary call-to-action.
|
|
136
136
|
*/
|
|
137
|
-
this.buttonAction =
|
|
137
|
+
this.buttonAction = output();
|
|
138
138
|
/**
|
|
139
139
|
* @event linkAction
|
|
140
140
|
* @description
|
|
141
141
|
* Emits when the link-styled button is clicked. Use for secondary
|
|
142
142
|
* or alternative actions.
|
|
143
143
|
*/
|
|
144
|
-
this.linkAction =
|
|
144
|
+
this.linkAction = output();
|
|
145
145
|
}
|
|
146
146
|
/**
|
|
147
|
-
* @method
|
|
147
|
+
* @method onButtonActionClick
|
|
148
148
|
* @description
|
|
149
|
-
* Internal handler that emits the `
|
|
149
|
+
* Internal handler that emits the `buttonAction` event when the
|
|
150
150
|
* main button is clicked.
|
|
151
151
|
*/
|
|
152
152
|
onButtonActionClick() {
|
|
@@ -162,32 +162,12 @@ class FallbackViewComponent {
|
|
|
162
162
|
this.linkAction.emit();
|
|
163
163
|
}
|
|
164
164
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: FallbackViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
165
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: FallbackViewComponent, isStandalone: true, selector: "tk-fallback-view", inputs: { type: "type", imageSrc: "imageSrc", illustrationAlt: "illustrationAlt", title: "title", message: "message", buttonLabel: "buttonLabel", linkLabel: "linkLabel", buttonDisabled: "buttonDisabled" }, outputs: { buttonAction: "buttonAction", linkAction: "linkAction" }, ngImport: i0, template: "<div\n class=\"tk-fallback-view\"\n [class.tk-fallback-view--section]=\"type === 'section'\">\n <ng-content select=\"[image]\"></ng-content>\n @if (imageSrc) {\n <img\n [src]=\"imageSrc\"\n [alt]=\"illustrationAlt || 'fallback illustration'\"\n class=\"tk-fallback-view__image\" />\n }\n\n <ng-content select=\"[title]\"></ng-content>\n @if (title && type === 'content') {\n <h2 class=\"tk-fallback-view__title\">{{ title }}</h2>\n }\n\n <ng-content select=\"[message]\"></ng-content>\n @if (message) {\n <p class=\"tk-fallback-view__message\" [innerHTML]=\"message\"></p>\n }\n\n <ng-content select=\"[actions]\"></ng-content>\n @if (type === 'content' && (buttonLabel || linkLabel)) {\n <div class=\"tk-fallback-view__actions\">\n @if (buttonLabel) {\n <tk-button\n [label]=\"buttonLabel\"\n severity=\"primary\"\n [disabled]=\"buttonDisabled\"\n (clicked)=\"onButtonActionClick()\" />\n } @if (linkLabel) {\n <tk-button\n [label]=\"linkLabel\"\n [link]=\"true\"\n (clicked)=\"onLinkActionClick()\" />\n }\n </div>\n }\n</div>\n", styles: [":host{display:block;width:100%}.tk-fallback-view{display:flex;flex-direction:column;align-items:center;text-align:center;gap:var(--tk-spacing-gap-m, 1rem);padding:var(--tk-spacing-paddingY-xl, 1.5rem) var(--tk-spacing-paddingY-m, 1rem);margin:0 auto}.tk-fallback-view__image,.tk-fallback-view>[image]{max-width:18.75rem;max-height:18.75rem;width:auto;height:auto;object-fit:contain;margin-bottom:var(--tk-spacing-base-150, 1.5rem)}.tk-fallback-view__title,.tk-fallback-view>[title]{font-size:var(--tk-font-size-base-150, 1.5rem);font-weight:var(--tk-font-weight-bold, 700);margin:0;max-width:31.25rem;color:var(--tk-color-base-surface-950, #191a1b)}.tk-fallback-view__message,.tk-fallback-view>[message]{font-size:var(--tk-font-size-base-100, 1rem);font-weight:var(--tk-font-weight-regular, 400);margin:0;max-width:31.25rem;color:var(--tk-color-base-surface-950, #191a1b)}.tk-fallback-view__actions,.tk-fallback-view>[actions]{display:flex;flex-direction:column;align-items:center;gap:var(--tk-spacing-75, .75rem)}.tk-fallback-view--section{flex-direction:row;justify-content:center;align-items:center;text-align:left;gap:var(--tk-spacing-gap-m, 1rem);width:100%;min-height:3.75rem;padding:var(--tk-spacing-paddingY-xl, 1.5rem) var(--tk-spacing-paddingY-m, 1rem);background-color:var(--tk-color-base-surface-0, #ffffff);color:var(--tk-color-base-surface-950, #191a1b)}.tk-fallback-view--section .tk-fallback-view__image,.tk-fallback-view--section>[image]{width:3.75rem;height:3.75rem;max-width:3.75rem;max-height:3.75rem;margin-bottom:0;object-fit:contain}.tk-fallback-view--section .tk-fallback-view__message,.tk-fallback-view--section>[message]{font-size:var(--tk-font-size-base-100, 1rem);font-weight:var(--tk-font-weight-regular, 400)}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "tk-button", inputs: ["label", "disabled", "type", "severity", "variant", "link", "icon", "tooltipText"], outputs: ["clicked"] }, { kind: "ngmodule", type: CardModule }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
165
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: FallbackViewComponent, isStandalone: true, selector: "tk-fallback-view", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, imageSrc: { classPropertyName: "imageSrc", publicName: "imageSrc", isSignal: true, isRequired: false, transformFunction: null }, illustrationAlt: { classPropertyName: "illustrationAlt", publicName: "illustrationAlt", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, buttonLabel: { classPropertyName: "buttonLabel", publicName: "buttonLabel", isSignal: true, isRequired: false, transformFunction: null }, linkLabel: { classPropertyName: "linkLabel", publicName: "linkLabel", isSignal: true, isRequired: false, transformFunction: null }, buttonDisabled: { classPropertyName: "buttonDisabled", publicName: "buttonDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { buttonAction: "buttonAction", linkAction: "linkAction" }, ngImport: i0, template: "<div\n class=\"tk-fallback-view\"\n [class.tk-fallback-view--section]=\"type() === 'section'\">\n <ng-content select=\"[image]\"></ng-content>\n @if (imageSrc()) {\n <img\n [src]=\"imageSrc()\"\n [alt]=\"illustrationAlt() || 'fallback illustration'\"\n class=\"tk-fallback-view__image\" />\n }\n\n <ng-content select=\"[title]\"></ng-content>\n @if (title() && type() === 'content') {\n <h2 class=\"tk-fallback-view__title\">{{ title() }}</h2>\n }\n\n <ng-content select=\"[message]\"></ng-content>\n @if (message()) {\n <p class=\"tk-fallback-view__message\" [innerHTML]=\"message()\"></p>\n }\n\n <ng-content select=\"[actions]\"></ng-content>\n @if (type() === 'content' && (buttonLabel() || linkLabel())) {\n <div class=\"tk-fallback-view__actions\">\n @if (buttonLabel()) {\n <tk-button\n [label]=\"buttonLabel()\"\n severity=\"primary\"\n [disabled]=\"buttonDisabled()\"\n (clicked)=\"onButtonActionClick()\" />\n } @if (linkLabel()) {\n <tk-button\n [label]=\"linkLabel()\"\n [link]=\"true\"\n (clicked)=\"onLinkActionClick()\" />\n }\n </div>\n }\n</div>\n", styles: [":host{display:block;width:100%}.tk-fallback-view{display:flex;flex-direction:column;align-items:center;text-align:center;gap:var(--tk-spacing-gap-m, 1rem);padding:var(--tk-spacing-paddingY-xl, 1.5rem) var(--tk-spacing-paddingY-m, 1rem);margin:0 auto}.tk-fallback-view__image,.tk-fallback-view>[image]{max-width:18.75rem;max-height:18.75rem;width:auto;height:auto;object-fit:contain;margin-bottom:var(--tk-spacing-base-150, 1.5rem)}.tk-fallback-view__title,.tk-fallback-view>[title]{font-size:var(--tk-font-size-base-150, 1.5rem);font-weight:var(--tk-font-weight-bold, 700);margin:0;max-width:31.25rem;color:var(--tk-color-base-surface-950, #191a1b)}.tk-fallback-view__message,.tk-fallback-view>[message]{font-size:var(--tk-font-size-base-100, 1rem);font-weight:var(--tk-font-weight-regular, 400);margin:0;max-width:31.25rem;color:var(--tk-color-base-surface-950, #191a1b)}.tk-fallback-view__actions,.tk-fallback-view>[actions]{display:flex;flex-direction:column;align-items:center;gap:var(--tk-spacing-75, .75rem)}.tk-fallback-view--section{flex-direction:row;justify-content:center;align-items:center;text-align:left;gap:var(--tk-spacing-gap-m, 1rem);width:100%;min-height:3.75rem;padding:var(--tk-spacing-paddingY-xl, 1.5rem) var(--tk-spacing-paddingY-m, 1rem);background-color:var(--tk-color-base-surface-0, #ffffff);color:var(--tk-color-base-surface-950, #191a1b)}.tk-fallback-view--section .tk-fallback-view__image,.tk-fallback-view--section>[image]{width:3.75rem;height:3.75rem;max-width:3.75rem;max-height:3.75rem;margin-bottom:0;object-fit:contain}.tk-fallback-view--section .tk-fallback-view__message,.tk-fallback-view--section>[message]{font-size:var(--tk-font-size-base-100, 1rem);font-weight:var(--tk-font-weight-regular, 400)}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "tk-button", inputs: ["label", "disabled", "type", "severity", "variant", "link", "icon", "tooltipText"], outputs: ["clicked"] }, { kind: "ngmodule", type: CardModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
166
166
|
}
|
|
167
167
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: FallbackViewComponent, decorators: [{
|
|
168
168
|
type: Component,
|
|
169
|
-
args: [{ selector: 'tk-fallback-view',
|
|
170
|
-
}], propDecorators: { type: [{
|
|
171
|
-
type: Input
|
|
172
|
-
}], imageSrc: [{
|
|
173
|
-
type: Input
|
|
174
|
-
}], illustrationAlt: [{
|
|
175
|
-
type: Input
|
|
176
|
-
}], title: [{
|
|
177
|
-
type: Input
|
|
178
|
-
}], message: [{
|
|
179
|
-
type: Input
|
|
180
|
-
}], buttonLabel: [{
|
|
181
|
-
type: Input
|
|
182
|
-
}], linkLabel: [{
|
|
183
|
-
type: Input
|
|
184
|
-
}], buttonDisabled: [{
|
|
185
|
-
type: Input
|
|
186
|
-
}], buttonAction: [{
|
|
187
|
-
type: Output
|
|
188
|
-
}], linkAction: [{
|
|
189
|
-
type: Output
|
|
190
|
-
}] } });
|
|
169
|
+
args: [{ selector: 'tk-fallback-view', imports: [ButtonComponent, CardModule], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"tk-fallback-view\"\n [class.tk-fallback-view--section]=\"type() === 'section'\">\n <ng-content select=\"[image]\"></ng-content>\n @if (imageSrc()) {\n <img\n [src]=\"imageSrc()\"\n [alt]=\"illustrationAlt() || 'fallback illustration'\"\n class=\"tk-fallback-view__image\" />\n }\n\n <ng-content select=\"[title]\"></ng-content>\n @if (title() && type() === 'content') {\n <h2 class=\"tk-fallback-view__title\">{{ title() }}</h2>\n }\n\n <ng-content select=\"[message]\"></ng-content>\n @if (message()) {\n <p class=\"tk-fallback-view__message\" [innerHTML]=\"message()\"></p>\n }\n\n <ng-content select=\"[actions]\"></ng-content>\n @if (type() === 'content' && (buttonLabel() || linkLabel())) {\n <div class=\"tk-fallback-view__actions\">\n @if (buttonLabel()) {\n <tk-button\n [label]=\"buttonLabel()\"\n severity=\"primary\"\n [disabled]=\"buttonDisabled()\"\n (clicked)=\"onButtonActionClick()\" />\n } @if (linkLabel()) {\n <tk-button\n [label]=\"linkLabel()\"\n [link]=\"true\"\n (clicked)=\"onLinkActionClick()\" />\n }\n </div>\n }\n</div>\n", styles: [":host{display:block;width:100%}.tk-fallback-view{display:flex;flex-direction:column;align-items:center;text-align:center;gap:var(--tk-spacing-gap-m, 1rem);padding:var(--tk-spacing-paddingY-xl, 1.5rem) var(--tk-spacing-paddingY-m, 1rem);margin:0 auto}.tk-fallback-view__image,.tk-fallback-view>[image]{max-width:18.75rem;max-height:18.75rem;width:auto;height:auto;object-fit:contain;margin-bottom:var(--tk-spacing-base-150, 1.5rem)}.tk-fallback-view__title,.tk-fallback-view>[title]{font-size:var(--tk-font-size-base-150, 1.5rem);font-weight:var(--tk-font-weight-bold, 700);margin:0;max-width:31.25rem;color:var(--tk-color-base-surface-950, #191a1b)}.tk-fallback-view__message,.tk-fallback-view>[message]{font-size:var(--tk-font-size-base-100, 1rem);font-weight:var(--tk-font-weight-regular, 400);margin:0;max-width:31.25rem;color:var(--tk-color-base-surface-950, #191a1b)}.tk-fallback-view__actions,.tk-fallback-view>[actions]{display:flex;flex-direction:column;align-items:center;gap:var(--tk-spacing-75, .75rem)}.tk-fallback-view--section{flex-direction:row;justify-content:center;align-items:center;text-align:left;gap:var(--tk-spacing-gap-m, 1rem);width:100%;min-height:3.75rem;padding:var(--tk-spacing-paddingY-xl, 1.5rem) var(--tk-spacing-paddingY-m, 1rem);background-color:var(--tk-color-base-surface-0, #ffffff);color:var(--tk-color-base-surface-950, #191a1b)}.tk-fallback-view--section .tk-fallback-view__image,.tk-fallback-view--section>[image]{width:3.75rem;height:3.75rem;max-width:3.75rem;max-height:3.75rem;margin-bottom:0;object-fit:contain}.tk-fallback-view--section .tk-fallback-view__message,.tk-fallback-view--section>[message]{font-size:var(--tk-font-size-base-100, 1rem);font-weight:var(--tk-font-weight-regular, 400)}\n"] }]
|
|
170
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], imageSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageSrc", required: false }] }], illustrationAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "illustrationAlt", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], buttonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonLabel", required: false }] }], linkLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "linkLabel", required: false }] }], buttonDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonDisabled", required: false }] }], buttonAction: [{ type: i0.Output, args: ["buttonAction"] }], linkAction: [{ type: i0.Output, args: ["linkAction"] }] } });
|
|
191
171
|
|
|
192
172
|
/**
|
|
193
173
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tekus-design-system-components-fallback-view.mjs","sources":["../../../projects/design-system/components/fallback-view/src/fallback-view.component.ts","../../../projects/design-system/components/fallback-view/src/fallback-view.component.html","../../../projects/design-system/components/fallback-view/tekus-design-system-components-fallback-view.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"file":"tekus-design-system-components-fallback-view.mjs","sources":["../../../projects/design-system/components/fallback-view/src/fallback-view.component.ts","../../../projects/design-system/components/fallback-view/src/fallback-view.component.html","../../../projects/design-system/components/fallback-view/tekus-design-system-components-fallback-view.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n input,\n output,\n} from '@angular/core';\n\nimport { ButtonComponent } from '@tekus/design-system/components/button';\nimport { CardModule } from 'primeng/card';\n\nexport type FallbackViewType = 'content' | 'section';\n\n/**\n * @component FallbackViewComponent\n * @description\n * A reusable component for displaying fallback or empty states such as\n * \"no results found\", \"error loading data\", or \"content not available\".\n * It provides a consistent structure with support for an image, title,\n * message, and optional action buttons.\n *\n * The component can be used in two ways:\n * 1. **Via Inputs:** Pass data directly through component inputs (`imageSrc`, `title`, `message`, etc.).\n * 2. **Via Content Projection (`ng-content`):** Use your own HTML structure for full customization.\n *\n * @usage\n * ### Basic Usage (via Inputs)\n * ```html\n * <tk-fallback-view\n * imageSrc=\"assets/img/empty-state.svg\"\n * title=\"No Items Found\"\n * message=\"There are currently no items to display. Try adding one.\"\n * buttonLabel=\"Add New Item\"\n * linkLabel=\"Learn More\"\n * (buttonAction)=\"handleAddNewItem()\"\n * (linkAction)=\"handleLearnMore()\">\n * </tk-fallback-view>\n * ```\n *\n * ### Compact Variant (Section type)\n * ```html\n * <tk-fallback-view\n * [type]=\"'section'\"\n * imageSrc=\"assets/img/check.svg\"\n * message=\"Saved successfully\">\n * </tk-fallback-view>\n * ```\n *\n * ### Advanced Usage (via ng-content)\n * ```html\n * <tk-fallback-view [type]=\"'content'\">\n * <img image src=\"assets/img/empty-state.svg\" alt=\"Tekus logo\">\n * <h2 title>Custom Title</h2>\n * <p message>\n * This is a <b>custom message</b> with <strong>HTML content</strong>.\n * </p>\n * <div actions>\n * <tk-button\n * label=\"Primary Action\"\n * severity=\"primary\"\n * (click)=\"onPrimaryAction()\">\n * </tk-button>\n * <tk-button\n * label=\"Secondary Action\"\n * [link]=\"true\"\n * (click)=\"onSecondaryAction()\">\n * </tk-button>\n * </div>\n * </tk-fallback-view>\n * ```\n */\n\n@Component({\n selector: 'tk-fallback-view',\n imports: [ButtonComponent, CardModule],\n templateUrl: './fallback-view.component.html',\n styleUrl: './fallback-view.component.scss',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FallbackViewComponent {\n /**\n * @property {FallbackViewType} type\n * @description\n * Controls the overall type and spacing of the component.\n * - `'content'`: Standard size.\n * - `'section'`: A more compact version.\n *\n * @default `'content'`\n */\n type = input<FallbackViewType>('content');\n\n /**\n * @property {string} imageSrc\n * @description\n * The URL for the illustrative image to be displayed at the top.\n *\n * @default `''`\n */\n imageSrc = input<string>('');\n\n /**\n * @property {string} illustrationAlt\n * Descriptive alternative text for the image. Improves accessibility.\n */\n illustrationAlt = input<string>('');\n\n /**\n * @property {string} title\n * @description\n * The main title or heading of the fallback view.\n *\n * @default `''`\n */\n title = input<string>('');\n\n /**\n * @property {string} message\n * @description\n * The descriptive text or message displayed below the title.\n *\n * @default `''`\n */\n message = input<string>('');\n\n /**\n * @property {string} buttonLabel\n * @description\n * Text for the primary action button. If left empty, the button is not rendered.\n *\n * @default `''`\n */\n buttonLabel = input<string>('');\n\n /**\n * @property {string} linkLabel\n * @description\n * Text for the secondary action, which is styled as a link.\n * If left empty, the link is not rendered.\n *\n * @default `''`\n */\n linkLabel = input<string>('');\n\n /**\n * @property {boolean} buttonDisabled\n * @description\n * Controls whether the primary action button is disabled.\n * When true, the button is visually disabled and cannot be clicked.\n *\n * @default false\n */\n buttonDisabled = input<boolean>(false);\n\n /**\n * @event buttonAction\n * @description\n * Emits when the main action button is clicked. Listen to this event\n * to handle the primary call-to-action.\n */\n buttonAction = output<void>();\n\n /**\n * @event linkAction\n * @description\n * Emits when the link-styled button is clicked. Use for secondary\n * or alternative actions.\n */\n linkAction = output<void>();\n\n /**\n * @method onButtonActionClick\n * @description\n * Internal handler that emits the `buttonAction` event when the\n * main button is clicked.\n */\n onButtonActionClick(): void {\n this.buttonAction.emit();\n }\n\n /**\n * @method onLinkActionClick\n * @description\n * Internal handler that emits the `linkAction` event when the\n * link button is clicked.\n */\n onLinkActionClick(): void {\n this.linkAction.emit();\n }\n}\n","<div\n class=\"tk-fallback-view\"\n [class.tk-fallback-view--section]=\"type() === 'section'\">\n <ng-content select=\"[image]\"></ng-content>\n @if (imageSrc()) {\n <img\n [src]=\"imageSrc()\"\n [alt]=\"illustrationAlt() || 'fallback illustration'\"\n class=\"tk-fallback-view__image\" />\n }\n\n <ng-content select=\"[title]\"></ng-content>\n @if (title() && type() === 'content') {\n <h2 class=\"tk-fallback-view__title\">{{ title() }}</h2>\n }\n\n <ng-content select=\"[message]\"></ng-content>\n @if (message()) {\n <p class=\"tk-fallback-view__message\" [innerHTML]=\"message()\"></p>\n }\n\n <ng-content select=\"[actions]\"></ng-content>\n @if (type() === 'content' && (buttonLabel() || linkLabel())) {\n <div class=\"tk-fallback-view__actions\">\n @if (buttonLabel()) {\n <tk-button\n [label]=\"buttonLabel()\"\n severity=\"primary\"\n [disabled]=\"buttonDisabled()\"\n (clicked)=\"onButtonActionClick()\" />\n } @if (linkLabel()) {\n <tk-button\n [label]=\"linkLabel()\"\n [link]=\"true\"\n (clicked)=\"onLinkActionClick()\" />\n }\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDG;MAUU,qBAAqB,CAAA;AARlC,IAAA,WAAA,GAAA;AASE;;;;;;;;AAQG;AACH,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAmB,SAAS,2EAAC;AAEzC;;;;;;AAMG;AACH,QAAA,IAAA,CAAA,QAAQ,G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A,CAAA,+sDAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDmCY,eAAe,wKAAE,UAAU,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAM1B,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBARjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,OAAA,EACnB,CAAC,eAAe,EAAE,UAAU,CAAC,EAAA,aAAA,EAGvB,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,wnCAAA,EAAA,MAAA,EAAA,CAAA,+sDAAA,CAAA,EAAA;;;AE9EjD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, signal, inject, computed, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
4
4
|
import * as i1 from '@fortawesome/angular-fontawesome';
|
|
5
5
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
@@ -1092,25 +1092,25 @@ class IconComponent {
|
|
|
1092
1092
|
* This is a required field.
|
|
1093
1093
|
* It should match one of the icons in the *IconCatalog*.
|
|
1094
1094
|
*/
|
|
1095
|
-
this.icon =
|
|
1095
|
+
this.icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
1096
1096
|
/**
|
|
1097
1097
|
* The style of the icon to display.
|
|
1098
1098
|
* This is an optional field.
|
|
1099
1099
|
* It defaults to 'regular'.
|
|
1100
1100
|
*/
|
|
1101
|
-
this.styleIcon =
|
|
1101
|
+
this.styleIcon = input('regular', ...(ngDevMode ? [{ debugName: "styleIcon" }] : /* istanbul ignore next */ []));
|
|
1102
1102
|
/**
|
|
1103
1103
|
* The color of the icon to display.
|
|
1104
1104
|
*/
|
|
1105
|
-
this.color =
|
|
1105
|
+
this.color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : /* istanbul ignore next */ []));
|
|
1106
1106
|
/**
|
|
1107
1107
|
* The size of the icon to display.
|
|
1108
1108
|
*/
|
|
1109
|
-
this.size =
|
|
1109
|
+
this.size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1110
1110
|
/**
|
|
1111
1111
|
* Whether the icon is disabled.
|
|
1112
1112
|
*/
|
|
1113
|
-
this.disabled =
|
|
1113
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1114
1114
|
/**
|
|
1115
1115
|
* The definition of the icon to display for Font Awesome.
|
|
1116
1116
|
*/
|
|
@@ -1132,19 +1132,13 @@ class IconComponent {
|
|
|
1132
1132
|
return null;
|
|
1133
1133
|
return size;
|
|
1134
1134
|
}, ...(ngDevMode ? [{ debugName: "sizeProp" }] : /* istanbul ignore next */ []));
|
|
1135
|
-
|
|
1135
|
+
effect(() => {
|
|
1136
1136
|
const icon = this.icon();
|
|
1137
1137
|
this.styleIcon();
|
|
1138
1138
|
if (icon) {
|
|
1139
1139
|
this.getIcon();
|
|
1140
1140
|
}
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
/**
|
|
1144
|
-
* Destroy icon effect
|
|
1145
|
-
*/
|
|
1146
|
-
ngOnDestroy() {
|
|
1147
|
-
this.iconEffect?.destroy();
|
|
1141
|
+
});
|
|
1148
1142
|
}
|
|
1149
1143
|
/**
|
|
1150
1144
|
* Gets the icon to display.
|
|
@@ -1215,14 +1209,14 @@ class IconComponent {
|
|
|
1215
1209
|
});
|
|
1216
1210
|
}
|
|
1217
1211
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1218
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: IconComponent, isStandalone: true, selector: "tk-icon", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, styleIcon: { classPropertyName: "styleIcon", publicName: "styleIcon", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } },
|
|
1212
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: IconComponent, isStandalone: true, selector: "tk-icon", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, styleIcon: { classPropertyName: "styleIcon", publicName: "styleIcon", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div>\n @if(iconDefinition()){\n\n <fa-icon\n class=\"svg-icon svg-icon__fa\"\n [icon]=\"iconDefinition() ?? ''\"\n [attr.color]=\"color()\"\n [size]=\"sizeProp() ?? '1x'\"\n [attr.disabled]=\"disabled()\"\n ></fa-icon>\n\n } @else if(svgContent()){\n\n <div\n class=\"svg-icon svg-icon__cu\"\n [innerHTML]=\"svgContent()\"\n [style]=\"{\n '--color': color(),\n '--size': size()\n }\"\n [attr.disabled]=\"disabled()\"\n [attr.size]=\"size()\"\n [attr.color]=\"color()\"></div>\n\n }\n</div>\n", styles: [".svg-icon{display:inline-block;width:fit-content}.svg-icon[color=primary]{color:var(--tk-color-primary-500)}.svg-icon[color=secondary]{color:var(--tk-color-secondary-500)}.svg-icon[color=danger]{color:var(--tk-color-danger-500)}.svg-icon[color=warning]{color:var(--tk-color-warning-700)}.svg-icon[color=info]{color:var(--tk-color-info-500)}.svg-icon[color=light]{color:var(--tk-color-full-white)}.svg-icon[disabled=true],.svg-icon[data-disabled=true]{color:var(--tk-color-neutral-500)!important}.svg-icon__cu[size=\"2xs\"],.svg-icon__cu[data-size=\"2xs\"]{font-size:.625em}.svg-icon__cu[size=xs],.svg-icon__cu[data-size=xs]{font-size:.75em}.svg-icon__cu[size=sm],.svg-icon__cu[data-size=sm]{font-size:.875em}.svg-icon__cu[size=lg],.svg-icon__cu[data-size=lg]{font-size:1.25em}.svg-icon__cu[size=xl],.svg-icon__cu[data-size=xl]{font-size:1.5em}.svg-icon__cu[size=\"2xl\"],.svg-icon__cu[data-size=\"2xl\"]{font-size:2em}.svg-icon__cu[size=\"1x\"],.svg-icon__cu[data-size=\"1x\"]{font-size:1em}.svg-icon__cu[size=\"2x\"],.svg-icon__cu[data-size=\"2x\"]{font-size:2em}.svg-icon__cu[size=\"3x\"],.svg-icon__cu[data-size=\"3x\"]{font-size:3em}.svg-icon__cu[size=\"4x\"],.svg-icon__cu[data-size=\"4x\"]{font-size:4em}.svg-icon__cu[size=\"5x\"],.svg-icon__cu[data-size=\"5x\"]{font-size:5em}svg{width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i1.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1219
1213
|
}
|
|
1220
1214
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImport: i0, type: IconComponent, decorators: [{
|
|
1221
1215
|
type: Component,
|
|
1222
|
-
args: [{ selector: 'tk-icon',
|
|
1216
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'tk-icon', imports: [
|
|
1223
1217
|
FontAwesomeModule
|
|
1224
1218
|
], template: "<div>\n @if(iconDefinition()){\n\n <fa-icon\n class=\"svg-icon svg-icon__fa\"\n [icon]=\"iconDefinition() ?? ''\"\n [attr.color]=\"color()\"\n [size]=\"sizeProp() ?? '1x'\"\n [attr.disabled]=\"disabled()\"\n ></fa-icon>\n\n } @else if(svgContent()){\n\n <div\n class=\"svg-icon svg-icon__cu\"\n [innerHTML]=\"svgContent()\"\n [style]=\"{\n '--color': color(),\n '--size': size()\n }\"\n [attr.disabled]=\"disabled()\"\n [attr.size]=\"size()\"\n [attr.color]=\"color()\"></div>\n\n }\n</div>\n", styles: [".svg-icon{display:inline-block;width:fit-content}.svg-icon[color=primary]{color:var(--tk-color-primary-500)}.svg-icon[color=secondary]{color:var(--tk-color-secondary-500)}.svg-icon[color=danger]{color:var(--tk-color-danger-500)}.svg-icon[color=warning]{color:var(--tk-color-warning-700)}.svg-icon[color=info]{color:var(--tk-color-info-500)}.svg-icon[color=light]{color:var(--tk-color-full-white)}.svg-icon[disabled=true],.svg-icon[data-disabled=true]{color:var(--tk-color-neutral-500)!important}.svg-icon__cu[size=\"2xs\"],.svg-icon__cu[data-size=\"2xs\"]{font-size:.625em}.svg-icon__cu[size=xs],.svg-icon__cu[data-size=xs]{font-size:.75em}.svg-icon__cu[size=sm],.svg-icon__cu[data-size=sm]{font-size:.875em}.svg-icon__cu[size=lg],.svg-icon__cu[data-size=lg]{font-size:1.25em}.svg-icon__cu[size=xl],.svg-icon__cu[data-size=xl]{font-size:1.5em}.svg-icon__cu[size=\"2xl\"],.svg-icon__cu[data-size=\"2xl\"]{font-size:2em}.svg-icon__cu[size=\"1x\"],.svg-icon__cu[data-size=\"1x\"]{font-size:1em}.svg-icon__cu[size=\"2x\"],.svg-icon__cu[data-size=\"2x\"]{font-size:2em}.svg-icon__cu[size=\"3x\"],.svg-icon__cu[data-size=\"3x\"]{font-size:3em}.svg-icon__cu[size=\"4x\"],.svg-icon__cu[data-size=\"4x\"]{font-size:4em}.svg-icon__cu[size=\"5x\"],.svg-icon__cu[data-size=\"5x\"]{font-size:5em}svg{width:100%;height:100%}\n"] }]
|
|
1225
|
-
}], ctorParameters: () => [], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }
|
|
1219
|
+
}], ctorParameters: () => [], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], styleIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleIcon", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
1226
1220
|
|
|
1227
1221
|
const tkAdsIcon = `<svg
|
|
1228
1222
|
width="1em"
|