@shival99/z-ui 2.0.6 → 2.0.8
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/assets/css/themes/hospital.css +9 -9
- package/fesm2022/shival99-z-ui-components-z-accordion.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-accordion.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-avatar.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-avatar.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-breadcrumb.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-breadcrumb.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-button.mjs +32 -9
- package/fesm2022/shival99-z-ui-components-z-button.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs +102 -27
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-card.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-card.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-chat.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-chat.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-checkbox.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-checkbox.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-code.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-code.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs +10 -3
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-editor.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-editor.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-empty.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-empty.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-filter.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-filter.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs +3 -3
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-icon.mjs +72 -5
- package/fesm2022/shival99-z-ui-components-z-icon.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-input.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-input.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-kanban.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-kanban.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-menu.mjs +16 -6
- package/fesm2022/shival99-z-ui-components-z-menu.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-metric-card.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-metric-card.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-modal.mjs +11 -3
- package/fesm2022/shival99-z-ui-components-z-modal.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-popover.mjs +77 -9
- package/fesm2022/shival99-z-ui-components-z-popover.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-select.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-select.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-steps.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-steps.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-switch.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-switch.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-table.mjs +1264 -421
- package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs +95 -5
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-tags.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-tags.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs +1 -1
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-upload.mjs +3 -2
- package/fesm2022/shival99-z-ui-components-z-upload.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-i18n.mjs +66 -8
- package/fesm2022/shival99-z-ui-i18n.mjs.map +1 -1
- package/package.json +7 -3
- package/types/shival99-z-ui-components-z-autocomplete.d.ts +1 -1
- package/types/shival99-z-ui-components-z-button.d.ts +7 -4
- package/types/shival99-z-ui-components-z-calendar.d.ts +8 -1
- package/types/shival99-z-ui-components-z-drawer.d.ts +8 -1
- package/types/shival99-z-ui-components-z-editor.d.ts +1 -1
- package/types/shival99-z-ui-components-z-icon.d.ts +27 -4
- package/types/shival99-z-ui-components-z-menu.d.ts +3 -1
- package/types/shival99-z-ui-components-z-modal.d.ts +10 -2
- package/types/shival99-z-ui-components-z-popover.d.ts +9 -2
- package/types/shival99-z-ui-components-z-select.d.ts +1 -1
- package/types/shival99-z-ui-components-z-table.d.ts +129 -53
- package/types/shival99-z-ui-components-z-tabs.d.ts +15 -7
- package/types/shival99-z-ui-components-z-upload.d.ts +4 -3
|
@@ -111,7 +111,7 @@ class ZMetricCardComponent {
|
|
|
111
111
|
this.zActionClick.emit(action);
|
|
112
112
|
}
|
|
113
113
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZMetricCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
114
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZMetricCardComponent, isStandalone: true, selector: "z-metric-card", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zTitle: { classPropertyName: "zTitle", publicName: "zTitle", isSignal: true, isRequired: false, transformFunction: null }, zValue: { classPropertyName: "zValue", publicName: "zValue", isSignal: true, isRequired: false, transformFunction: null }, zDescription: { classPropertyName: "zDescription", publicName: "zDescription", isSignal: true, isRequired: false, transformFunction: null }, zIcon: { classPropertyName: "zIcon", publicName: "zIcon", isSignal: true, isRequired: false, transformFunction: null }, zTrend: { classPropertyName: "zTrend", publicName: "zTrend", isSignal: true, isRequired: false, transformFunction: null }, zProgress: { classPropertyName: "zProgress", publicName: "zProgress", isSignal: true, isRequired: false, transformFunction: null }, zAction: { classPropertyName: "zAction", publicName: "zAction", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zVariant: { classPropertyName: "zVariant", publicName: "zVariant", isSignal: true, isRequired: false, transformFunction: null }, zDecor: { classPropertyName: "zDecor", publicName: "zDecor", isSignal: true, isRequired: false, transformFunction: null }, zLoading: { classPropertyName: "zLoading", publicName: "zLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zActionClick: "zActionClick" }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: "@if (zLoading()) {\n @if (zDecor() !== 'none') {\n <ng-container [ngTemplateOutlet]=\"metricDecor\" />\n }\n <div class=\"space-y-4\">\n <div class=\"flex items-center justify-between\">\n <div class=\"bg-muted h-9 w-9 animate-pulse rounded-md\"></div>\n <div class=\"bg-muted h-5 w-16 animate-pulse rounded-full\"></div>\n </div>\n <div class=\"space-y-2\">\n <div class=\"bg-muted h-4 w-24 animate-pulse rounded\"></div>\n <div class=\"bg-muted h-8 w-32 animate-pulse rounded\"></div>\n <div class=\"bg-muted h-3 w-40 animate-pulse rounded\"></div>\n </div>\n </div>\n} @else {\n @if (zDecor() !== 'none') {\n <ng-container [ngTemplateOutlet]=\"metricDecor\" />\n }\n\n <div class=\"relative z-10 flex items-start justify-between gap-4\">\n <div class=\"min-w-0 space-y-3\">\n @if (zIcon()) {\n <span [class]=\"iconClasses()\">\n <z-icon [zType]=\"zIcon()\" zSize=\"18\" />\n </span>\n }\n\n <div class=\"min-w-0\">\n @if (zTitle()) {\n <p class=\"text-muted-foreground overflow-hidden text-sm font-medium text-ellipsis whitespace-nowrap\">\n {{ zTitle() }}\n </p>\n }\n <p [class]=\"valueClasses()\">{{ zValue() }}</p>\n @if (zDescription()) {\n <p class=\"text-muted-foreground mt-1 overflow-hidden text-sm text-ellipsis whitespace-nowrap\">\n {{ zDescription() }}\n </p>\n }\n </div>\n </div>\n\n <div class=\"flex shrink-0 flex-col items-end gap-2\">\n @if (zTrend(); as trend) {\n <span [class]=\"trendClasses()\">\n <z-icon [zType]=\"trendIcon()\" zSize=\"12\" />\n <span>{{ trend.value }}</span>\n @if (trend.label) {\n <span>{{ trend.label }}</span>\n }\n </span>\n }\n\n @if (zAction(); as action) {\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:bg-muted hover:text-foreground inline-flex size-8 items-center justify-center rounded-md transition-colors\"\n [attr.aria-label]=\"action.label\"\n (click)=\"onActionClick()\">\n <z-icon [zType]=\"action.icon ?? 'lucideMoreHorizontal'\" zSize=\"16\" />\n </button>\n }\n </div>\n </div>\n\n @if (normalizedProgress() !== null) {\n <div class=\"bg-muted mt-4 h-1.5 overflow-hidden rounded-full\">\n <div\n class=\"bg-primary h-full rounded-full transition-[width] duration-300\"\n [style.width.%]=\"normalizedProgress()\"></div>\n </div>\n }\n\n <ng-content />\n}\n\n<ng-template #metricDecor>\n @switch (zDecor()) {\n @case ('bars') {\n <svg [class]=\"decorClasses()\" width=\"122\" height=\"98\" viewBox=\"0 0 122 98\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"54\" y=\"50\" width=\"10\" height=\"34\" rx=\"5\" fill=\"currentColor\" />\n <rect x=\"72\" y=\"30\" width=\"10\" height=\"54\" rx=\"5\" fill=\"currentColor\" />\n <rect x=\"90\" y=\"14\" width=\"10\" height=\"70\" rx=\"5\" fill=\"currentColor\" />\n <path d=\"M43 84H112\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n }\n @case ('dots') {\n <svg [class]=\"decorClasses()\" width=\"124\" height=\"96\" viewBox=\"0 0 124 96\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"66\" cy=\"22\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"88\" cy=\"22\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"110\" cy=\"22\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"55\" cy=\"44\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"77\" cy=\"44\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"99\" cy=\"44\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"66\" cy=\"66\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"88\" cy=\"66\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"110\" cy=\"66\" r=\"4\" fill=\"currentColor\" />\n </svg>\n }\n @case ('grid') {\n <svg [class]=\"decorClasses()\" width=\"116\" height=\"94\" viewBox=\"0 0 116 94\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M18 10H106V74H18V10Z\" stroke=\"currentColor\" stroke-width=\"1\" />\n <path d=\"M18 26H106M18 42H106M18 58H106M34 10V74M50 10V74M66 10V74M82 10V74M98 10V74\" stroke=\"currentColor\" />\n <circle cx=\"34\" cy=\"58\" r=\"3\" fill=\"currentColor\" />\n <circle cx=\"58\" cy=\"34\" r=\"3\" fill=\"currentColor\" />\n <circle cx=\"82\" cy=\"46\" r=\"3\" fill=\"currentColor\" />\n </svg>\n }\n @case ('rings') {\n <svg [class]=\"decorClasses()\" width=\"126\" height=\"96\" viewBox=\"0 0 126 96\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"96\" cy=\"28\" r=\"26\" stroke=\"currentColor\" stroke-width=\"8\" />\n <circle cx=\"96\" cy=\"28\" r=\"12\" stroke=\"currentColor\" stroke-width=\"4\" />\n <circle cx=\"64\" cy=\"58\" r=\"20\" stroke=\"currentColor\" stroke-width=\"6\" />\n <path d=\"M42 78C56 64 72 51 91 35\" stroke=\"currentColor\" stroke-width=\"4\" stroke-linecap=\"round\" />\n </svg>\n }\n @case ('spark') {\n <svg [class]=\"decorClasses()\" width=\"126\" height=\"96\" viewBox=\"0 0 126 96\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M35 70L50 53L63 61L77 34L90 42L108 18\"\n stroke=\"currentColor\"\n stroke-width=\"7\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n <path d=\"M36 82H112\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n <circle cx=\"108\" cy=\"18\" r=\"6\" fill=\"currentColor\" />\n </svg>\n }\n @default {\n <svg [class]=\"decorClasses()\" width=\"128\" height=\"96\" viewBox=\"0 0 128 96\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M21 70C34 49 47 39 62 42C82 46 85 20 107 18\"\n stroke=\"currentColor\"\n stroke-width=\"10\"\n stroke-linecap=\"round\" />\n <path\n d=\"M30 82C45 64 58 56 72 58C91 61 96 41 112 38\"\n stroke=\"currentColor\"\n stroke-width=\"5\"\n stroke-linecap=\"round\" />\n <circle cx=\"108\" cy=\"18\" r=\"7\" fill=\"currentColor\" />\n <circle cx=\"112\" cy=\"38\" r=\"4\" fill=\"currentColor\" />\n </svg>\n }\n }\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zSize", "zStrokeWidth", "zSvg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
114
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZMetricCardComponent, isStandalone: true, selector: "z-metric-card", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zTitle: { classPropertyName: "zTitle", publicName: "zTitle", isSignal: true, isRequired: false, transformFunction: null }, zValue: { classPropertyName: "zValue", publicName: "zValue", isSignal: true, isRequired: false, transformFunction: null }, zDescription: { classPropertyName: "zDescription", publicName: "zDescription", isSignal: true, isRequired: false, transformFunction: null }, zIcon: { classPropertyName: "zIcon", publicName: "zIcon", isSignal: true, isRequired: false, transformFunction: null }, zTrend: { classPropertyName: "zTrend", publicName: "zTrend", isSignal: true, isRequired: false, transformFunction: null }, zProgress: { classPropertyName: "zProgress", publicName: "zProgress", isSignal: true, isRequired: false, transformFunction: null }, zAction: { classPropertyName: "zAction", publicName: "zAction", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zVariant: { classPropertyName: "zVariant", publicName: "zVariant", isSignal: true, isRequired: false, transformFunction: null }, zDecor: { classPropertyName: "zDecor", publicName: "zDecor", isSignal: true, isRequired: false, transformFunction: null }, zLoading: { classPropertyName: "zLoading", publicName: "zLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zActionClick: "zActionClick" }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: "@if (zLoading()) {\n @if (zDecor() !== 'none') {\n <ng-container [ngTemplateOutlet]=\"metricDecor\" />\n }\n <div class=\"space-y-4\">\n <div class=\"flex items-center justify-between\">\n <div class=\"bg-muted h-9 w-9 animate-pulse rounded-md\"></div>\n <div class=\"bg-muted h-5 w-16 animate-pulse rounded-full\"></div>\n </div>\n <div class=\"space-y-2\">\n <div class=\"bg-muted h-4 w-24 animate-pulse rounded\"></div>\n <div class=\"bg-muted h-8 w-32 animate-pulse rounded\"></div>\n <div class=\"bg-muted h-3 w-40 animate-pulse rounded\"></div>\n </div>\n </div>\n} @else {\n @if (zDecor() !== 'none') {\n <ng-container [ngTemplateOutlet]=\"metricDecor\" />\n }\n\n <div class=\"relative z-10 flex items-start justify-between gap-4\">\n <div class=\"min-w-0 space-y-3\">\n @if (zIcon()) {\n <span [class]=\"iconClasses()\">\n <z-icon [zType]=\"zIcon()\" zSize=\"18\" />\n </span>\n }\n\n <div class=\"min-w-0\">\n @if (zTitle()) {\n <p class=\"text-muted-foreground overflow-hidden text-sm font-medium text-ellipsis whitespace-nowrap\">\n {{ zTitle() }}\n </p>\n }\n <p [class]=\"valueClasses()\">{{ zValue() }}</p>\n @if (zDescription()) {\n <p class=\"text-muted-foreground mt-1 overflow-hidden text-sm text-ellipsis whitespace-nowrap\">\n {{ zDescription() }}\n </p>\n }\n </div>\n </div>\n\n <div class=\"flex shrink-0 flex-col items-end gap-2\">\n @if (zTrend(); as trend) {\n <span [class]=\"trendClasses()\">\n <z-icon [zType]=\"trendIcon()\" zSize=\"12\" />\n <span>{{ trend.value }}</span>\n @if (trend.label) {\n <span>{{ trend.label }}</span>\n }\n </span>\n }\n\n @if (zAction(); as action) {\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:bg-muted hover:text-foreground inline-flex size-8 items-center justify-center rounded-md transition-colors\"\n [attr.aria-label]=\"action.label\"\n (click)=\"onActionClick()\">\n <z-icon [zType]=\"action.icon ?? 'lucideMoreHorizontal'\" zSize=\"16\" />\n </button>\n }\n </div>\n </div>\n\n @if (normalizedProgress() !== null) {\n <div class=\"bg-muted mt-4 h-1.5 overflow-hidden rounded-full\">\n <div\n class=\"bg-primary h-full rounded-full transition-[width] duration-300\"\n [style.width.%]=\"normalizedProgress()\"></div>\n </div>\n }\n\n <ng-content />\n}\n\n<ng-template #metricDecor>\n @switch (zDecor()) {\n @case ('bars') {\n <svg [class]=\"decorClasses()\" width=\"122\" height=\"98\" viewBox=\"0 0 122 98\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"54\" y=\"50\" width=\"10\" height=\"34\" rx=\"5\" fill=\"currentColor\" />\n <rect x=\"72\" y=\"30\" width=\"10\" height=\"54\" rx=\"5\" fill=\"currentColor\" />\n <rect x=\"90\" y=\"14\" width=\"10\" height=\"70\" rx=\"5\" fill=\"currentColor\" />\n <path d=\"M43 84H112\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n }\n @case ('dots') {\n <svg [class]=\"decorClasses()\" width=\"124\" height=\"96\" viewBox=\"0 0 124 96\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"66\" cy=\"22\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"88\" cy=\"22\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"110\" cy=\"22\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"55\" cy=\"44\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"77\" cy=\"44\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"99\" cy=\"44\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"66\" cy=\"66\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"88\" cy=\"66\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"110\" cy=\"66\" r=\"4\" fill=\"currentColor\" />\n </svg>\n }\n @case ('grid') {\n <svg [class]=\"decorClasses()\" width=\"116\" height=\"94\" viewBox=\"0 0 116 94\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M18 10H106V74H18V10Z\" stroke=\"currentColor\" stroke-width=\"1\" />\n <path d=\"M18 26H106M18 42H106M18 58H106M34 10V74M50 10V74M66 10V74M82 10V74M98 10V74\" stroke=\"currentColor\" />\n <circle cx=\"34\" cy=\"58\" r=\"3\" fill=\"currentColor\" />\n <circle cx=\"58\" cy=\"34\" r=\"3\" fill=\"currentColor\" />\n <circle cx=\"82\" cy=\"46\" r=\"3\" fill=\"currentColor\" />\n </svg>\n }\n @case ('rings') {\n <svg [class]=\"decorClasses()\" width=\"126\" height=\"96\" viewBox=\"0 0 126 96\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"96\" cy=\"28\" r=\"26\" stroke=\"currentColor\" stroke-width=\"8\" />\n <circle cx=\"96\" cy=\"28\" r=\"12\" stroke=\"currentColor\" stroke-width=\"4\" />\n <circle cx=\"64\" cy=\"58\" r=\"20\" stroke=\"currentColor\" stroke-width=\"6\" />\n <path d=\"M42 78C56 64 72 51 91 35\" stroke=\"currentColor\" stroke-width=\"4\" stroke-linecap=\"round\" />\n </svg>\n }\n @case ('spark') {\n <svg [class]=\"decorClasses()\" width=\"126\" height=\"96\" viewBox=\"0 0 126 96\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M35 70L50 53L63 61L77 34L90 42L108 18\"\n stroke=\"currentColor\"\n stroke-width=\"7\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n <path d=\"M36 82H112\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n <circle cx=\"108\" cy=\"18\" r=\"6\" fill=\"currentColor\" />\n </svg>\n }\n @default {\n <svg [class]=\"decorClasses()\" width=\"128\" height=\"96\" viewBox=\"0 0 128 96\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M21 70C34 49 47 39 62 42C82 46 85 20 107 18\"\n stroke=\"currentColor\"\n stroke-width=\"10\"\n stroke-linecap=\"round\" />\n <path\n d=\"M30 82C45 64 58 56 72 58C91 61 96 41 112 38\"\n stroke=\"currentColor\"\n stroke-width=\"5\"\n stroke-linecap=\"round\" />\n <circle cx=\"108\" cy=\"18\" r=\"7\" fill=\"currentColor\" />\n <circle cx=\"112\" cy=\"38\" r=\"4\" fill=\"currentColor\" />\n </svg>\n }\n }\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
115
115
|
}
|
|
116
116
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZMetricCardComponent, decorators: [{
|
|
117
117
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shival99-z-ui-components-z-metric-card.mjs","sources":["../../../../libs/core-ui/components/z-metric-card/z-metric-card.variants.ts","../../../../libs/core-ui/components/z-metric-card/z-metric-card.component.ts","../../../../libs/core-ui/components/z-metric-card/z-metric-card.component.html","../../../../libs/core-ui/components/z-metric-card/shival99-z-ui-components-z-metric-card.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const zMetricCardVariants = cva('relative overflow-hidden rounded-lg transition-colors', {\n variants: {\n zSize: {\n sm: 'p-4',\n default: 'p-5',\n lg: 'p-6',\n },\n zVariant: {\n default: 'bg-card text-card-foreground border border-border shadow-sm',\n bordered: 'bg-background text-foreground border border-border',\n soft: 'bg-muted/45 text-foreground border border-transparent',\n },\n },\n defaultVariants: {\n zSize: 'default',\n zVariant: 'default',\n },\n});\n\nexport const zMetricCardIconVariants = cva('inline-flex shrink-0 items-center justify-center rounded-md', {\n variants: {\n zSize: {\n sm: 'size-8',\n default: 'size-9',\n lg: 'size-10',\n },\n zVariant: {\n default: 'bg-primary/10 text-primary',\n bordered: 'bg-muted text-muted-foreground',\n soft: 'bg-background text-primary shadow-xs',\n },\n },\n defaultVariants: {\n zSize: 'default',\n zVariant: 'default',\n },\n});\n\nexport const zMetricCardValueVariants = cva('font-bold tracking-normal text-foreground', {\n variants: {\n zSize: {\n sm: 'text-xl',\n default: 'text-2xl',\n lg: 'text-3xl',\n },\n },\n defaultVariants: {\n zSize: 'default',\n },\n});\n\nexport const zMetricCardTrendVariants = cva(\n 'inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium',\n {\n variants: {\n zTrendDirection: {\n up: 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400',\n down: 'bg-destructive/10 text-destructive',\n neutral: 'bg-muted text-muted-foreground',\n },\n },\n defaultVariants: {\n zTrendDirection: 'neutral',\n },\n }\n);\n\nexport type ZMetricCardVariants = VariantProps<typeof zMetricCardVariants>;\nexport type ZMetricCardIconVariants = VariantProps<typeof zMetricCardIconVariants>;\nexport type ZMetricCardTrendVariants = VariantProps<typeof zMetricCardTrendVariants>;\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input, output, ViewEncapsulation } from '@angular/core';\nimport { ZIconComponent, type ZIcon } from '@shival99/z-ui/components/z-icon';\nimport { zMergeClasses, zTransform } from '@shival99/z-ui/utils';\nimport type { ClassValue } from 'clsx';\nimport type {\n ZMetricCardAction,\n ZMetricCardDecor,\n ZMetricCardSize,\n ZMetricCardTrend,\n ZMetricCardTrendDirection,\n ZMetricCardVariant,\n} from './z-metric-card.types';\nimport {\n zMetricCardIconVariants,\n zMetricCardTrendVariants,\n zMetricCardValueVariants,\n zMetricCardVariants,\n} from './z-metric-card.variants';\n\n@Component({\n selector: 'z-metric-card',\n imports: [NgTemplateOutlet, ZIconComponent],\n standalone: true,\n templateUrl: './z-metric-card.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'hostClasses()',\n },\n})\nexport class ZMetricCardComponent {\n public readonly zActionClick = output<ZMetricCardAction>();\n\n public readonly class = input<ClassValue>('');\n public readonly zTitle = input<string>('');\n public readonly zValue = input<string | number>('');\n public readonly zDescription = input<string>('');\n public readonly zIcon = input<ZIcon>();\n public readonly zTrend = input<ZMetricCardTrend>();\n public readonly zProgress = input<number>();\n public readonly zAction = input<ZMetricCardAction>();\n public readonly zSize = input<ZMetricCardSize>('default');\n public readonly zVariant = input<ZMetricCardVariant>('default');\n public readonly zDecor = input<ZMetricCardDecor>('wave');\n public readonly zLoading = input(false, { transform: zTransform });\n\n protected readonly hostClasses = computed(() =>\n zMergeClasses(zMetricCardVariants({ zSize: this.zSize(), zVariant: this.zVariant() }), this.class())\n );\n\n protected readonly iconClasses = computed(() =>\n zMetricCardIconVariants({ zSize: this.zSize(), zVariant: this.zVariant() })\n );\n\n protected readonly valueClasses = computed(() => zMetricCardValueVariants({ zSize: this.zSize() }));\n protected readonly decorClasses = computed(() =>\n zMergeClasses(\n 'pointer-events-none absolute right-0 top-0 text-primary/10 transition-opacity duration-200',\n this.zVariant() === 'bordered' ? 'text-muted-foreground/10' : '',\n this.zVariant() === 'soft' ? 'text-primary/15' : ''\n )\n );\n\n protected readonly trendDirection = computed<ZMetricCardTrendDirection>(() => this.zTrend()?.direction ?? 'neutral');\n protected readonly trendClasses = computed(() =>\n zMetricCardTrendVariants({ zTrendDirection: this.trendDirection() })\n );\n\n protected readonly trendIcon = computed<ZIcon>(() => {\n const direction = this.trendDirection();\n if (direction === 'up') {\n return 'lucideTrendingUp';\n }\n\n if (direction === 'down') {\n return 'lucideTrendingDown';\n }\n\n return 'lucideMinus';\n });\n\n protected readonly normalizedProgress = computed(() => {\n const progress = this.zProgress();\n if (progress === null || progress === undefined || Number.isNaN(progress)) {\n return null;\n }\n\n return Math.min(100, Math.max(0, progress));\n });\n\n protected onActionClick(): void {\n const action = this.zAction();\n if (!action) {\n return;\n }\n\n this.zActionClick.emit(action);\n }\n}\n","@if (zLoading()) {\n @if (zDecor() !== 'none') {\n <ng-container [ngTemplateOutlet]=\"metricDecor\" />\n }\n <div class=\"space-y-4\">\n <div class=\"flex items-center justify-between\">\n <div class=\"bg-muted h-9 w-9 animate-pulse rounded-md\"></div>\n <div class=\"bg-muted h-5 w-16 animate-pulse rounded-full\"></div>\n </div>\n <div class=\"space-y-2\">\n <div class=\"bg-muted h-4 w-24 animate-pulse rounded\"></div>\n <div class=\"bg-muted h-8 w-32 animate-pulse rounded\"></div>\n <div class=\"bg-muted h-3 w-40 animate-pulse rounded\"></div>\n </div>\n </div>\n} @else {\n @if (zDecor() !== 'none') {\n <ng-container [ngTemplateOutlet]=\"metricDecor\" />\n }\n\n <div class=\"relative z-10 flex items-start justify-between gap-4\">\n <div class=\"min-w-0 space-y-3\">\n @if (zIcon()) {\n <span [class]=\"iconClasses()\">\n <z-icon [zType]=\"zIcon()\" zSize=\"18\" />\n </span>\n }\n\n <div class=\"min-w-0\">\n @if (zTitle()) {\n <p class=\"text-muted-foreground overflow-hidden text-sm font-medium text-ellipsis whitespace-nowrap\">\n {{ zTitle() }}\n </p>\n }\n <p [class]=\"valueClasses()\">{{ zValue() }}</p>\n @if (zDescription()) {\n <p class=\"text-muted-foreground mt-1 overflow-hidden text-sm text-ellipsis whitespace-nowrap\">\n {{ zDescription() }}\n </p>\n }\n </div>\n </div>\n\n <div class=\"flex shrink-0 flex-col items-end gap-2\">\n @if (zTrend(); as trend) {\n <span [class]=\"trendClasses()\">\n <z-icon [zType]=\"trendIcon()\" zSize=\"12\" />\n <span>{{ trend.value }}</span>\n @if (trend.label) {\n <span>{{ trend.label }}</span>\n }\n </span>\n }\n\n @if (zAction(); as action) {\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:bg-muted hover:text-foreground inline-flex size-8 items-center justify-center rounded-md transition-colors\"\n [attr.aria-label]=\"action.label\"\n (click)=\"onActionClick()\">\n <z-icon [zType]=\"action.icon ?? 'lucideMoreHorizontal'\" zSize=\"16\" />\n </button>\n }\n </div>\n </div>\n\n @if (normalizedProgress() !== null) {\n <div class=\"bg-muted mt-4 h-1.5 overflow-hidden rounded-full\">\n <div\n class=\"bg-primary h-full rounded-full transition-[width] duration-300\"\n [style.width.%]=\"normalizedProgress()\"></div>\n </div>\n }\n\n <ng-content />\n}\n\n<ng-template #metricDecor>\n @switch (zDecor()) {\n @case ('bars') {\n <svg [class]=\"decorClasses()\" width=\"122\" height=\"98\" viewBox=\"0 0 122 98\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"54\" y=\"50\" width=\"10\" height=\"34\" rx=\"5\" fill=\"currentColor\" />\n <rect x=\"72\" y=\"30\" width=\"10\" height=\"54\" rx=\"5\" fill=\"currentColor\" />\n <rect x=\"90\" y=\"14\" width=\"10\" height=\"70\" rx=\"5\" fill=\"currentColor\" />\n <path d=\"M43 84H112\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n }\n @case ('dots') {\n <svg [class]=\"decorClasses()\" width=\"124\" height=\"96\" viewBox=\"0 0 124 96\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"66\" cy=\"22\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"88\" cy=\"22\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"110\" cy=\"22\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"55\" cy=\"44\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"77\" cy=\"44\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"99\" cy=\"44\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"66\" cy=\"66\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"88\" cy=\"66\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"110\" cy=\"66\" r=\"4\" fill=\"currentColor\" />\n </svg>\n }\n @case ('grid') {\n <svg [class]=\"decorClasses()\" width=\"116\" height=\"94\" viewBox=\"0 0 116 94\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M18 10H106V74H18V10Z\" stroke=\"currentColor\" stroke-width=\"1\" />\n <path d=\"M18 26H106M18 42H106M18 58H106M34 10V74M50 10V74M66 10V74M82 10V74M98 10V74\" stroke=\"currentColor\" />\n <circle cx=\"34\" cy=\"58\" r=\"3\" fill=\"currentColor\" />\n <circle cx=\"58\" cy=\"34\" r=\"3\" fill=\"currentColor\" />\n <circle cx=\"82\" cy=\"46\" r=\"3\" fill=\"currentColor\" />\n </svg>\n }\n @case ('rings') {\n <svg [class]=\"decorClasses()\" width=\"126\" height=\"96\" viewBox=\"0 0 126 96\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"96\" cy=\"28\" r=\"26\" stroke=\"currentColor\" stroke-width=\"8\" />\n <circle cx=\"96\" cy=\"28\" r=\"12\" stroke=\"currentColor\" stroke-width=\"4\" />\n <circle cx=\"64\" cy=\"58\" r=\"20\" stroke=\"currentColor\" stroke-width=\"6\" />\n <path d=\"M42 78C56 64 72 51 91 35\" stroke=\"currentColor\" stroke-width=\"4\" stroke-linecap=\"round\" />\n </svg>\n }\n @case ('spark') {\n <svg [class]=\"decorClasses()\" width=\"126\" height=\"96\" viewBox=\"0 0 126 96\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M35 70L50 53L63 61L77 34L90 42L108 18\"\n stroke=\"currentColor\"\n stroke-width=\"7\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n <path d=\"M36 82H112\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n <circle cx=\"108\" cy=\"18\" r=\"6\" fill=\"currentColor\" />\n </svg>\n }\n @default {\n <svg [class]=\"decorClasses()\" width=\"128\" height=\"96\" viewBox=\"0 0 128 96\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M21 70C34 49 47 39 62 42C82 46 85 20 107 18\"\n stroke=\"currentColor\"\n stroke-width=\"10\"\n stroke-linecap=\"round\" />\n <path\n d=\"M30 82C45 64 58 56 72 58C91 61 96 41 112 38\"\n stroke=\"currentColor\"\n stroke-width=\"5\"\n stroke-linecap=\"round\" />\n <circle cx=\"108\" cy=\"18\" r=\"7\" fill=\"currentColor\" />\n <circle cx=\"112\" cy=\"38\" r=\"4\" fill=\"currentColor\" />\n </svg>\n }\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEO,MA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components/z-metric-card/z-metric-card.component.ts","../../../../libs/core-ui/components/z-metric-card/z-metric-card.component.html","../../../../libs/core-ui/components/z-metric-card/shival99-z-ui-components-z-metric-card.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const zMetricCardVariants = cva('relative overflow-hidden rounded-lg transition-colors', {\n variants: {\n zSize: {\n sm: 'p-4',\n default: 'p-5',\n lg: 'p-6',\n },\n zVariant: {\n default: 'bg-card text-card-foreground border border-border shadow-sm',\n bordered: 'bg-background text-foreground border border-border',\n soft: 'bg-muted/45 text-foreground border border-transparent',\n },\n },\n defaultVariants: {\n zSize: 'default',\n zVariant: 'default',\n },\n});\n\nexport const zMetricCardIconVariants = cva('inline-flex shrink-0 items-center justify-center rounded-md', {\n variants: {\n zSize: {\n sm: 'size-8',\n default: 'size-9',\n lg: 'size-10',\n },\n zVariant: {\n default: 'bg-primary/10 text-primary',\n bordered: 'bg-muted text-muted-foreground',\n soft: 'bg-background text-primary shadow-xs',\n },\n },\n defaultVariants: {\n zSize: 'default',\n zVariant: 'default',\n },\n});\n\nexport const zMetricCardValueVariants = cva('font-bold tracking-normal text-foreground', {\n variants: {\n zSize: {\n sm: 'text-xl',\n default: 'text-2xl',\n lg: 'text-3xl',\n },\n },\n defaultVariants: {\n zSize: 'default',\n },\n});\n\nexport const zMetricCardTrendVariants = cva(\n 'inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium',\n {\n variants: {\n zTrendDirection: {\n up: 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400',\n down: 'bg-destructive/10 text-destructive',\n neutral: 'bg-muted text-muted-foreground',\n },\n },\n defaultVariants: {\n zTrendDirection: 'neutral',\n },\n }\n);\n\nexport type ZMetricCardVariants = VariantProps<typeof zMetricCardVariants>;\nexport type ZMetricCardIconVariants = VariantProps<typeof zMetricCardIconVariants>;\nexport type ZMetricCardTrendVariants = VariantProps<typeof zMetricCardTrendVariants>;\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input, output, ViewEncapsulation } from '@angular/core';\nimport { ZIconComponent, type ZIcon } from '@shival99/z-ui/components/z-icon';\nimport { zMergeClasses, zTransform } from '@shival99/z-ui/utils';\nimport type { ClassValue } from 'clsx';\nimport type {\n ZMetricCardAction,\n ZMetricCardDecor,\n ZMetricCardSize,\n ZMetricCardTrend,\n ZMetricCardTrendDirection,\n ZMetricCardVariant,\n} from './z-metric-card.types';\nimport {\n zMetricCardIconVariants,\n zMetricCardTrendVariants,\n zMetricCardValueVariants,\n zMetricCardVariants,\n} from './z-metric-card.variants';\n\n@Component({\n selector: 'z-metric-card',\n imports: [NgTemplateOutlet, ZIconComponent],\n standalone: true,\n templateUrl: './z-metric-card.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'hostClasses()',\n },\n})\nexport class ZMetricCardComponent {\n public readonly zActionClick = output<ZMetricCardAction>();\n\n public readonly class = input<ClassValue>('');\n public readonly zTitle = input<string>('');\n public readonly zValue = input<string | number>('');\n public readonly zDescription = input<string>('');\n public readonly zIcon = input<ZIcon>();\n public readonly zTrend = input<ZMetricCardTrend>();\n public readonly zProgress = input<number>();\n public readonly zAction = input<ZMetricCardAction>();\n public readonly zSize = input<ZMetricCardSize>('default');\n public readonly zVariant = input<ZMetricCardVariant>('default');\n public readonly zDecor = input<ZMetricCardDecor>('wave');\n public readonly zLoading = input(false, { transform: zTransform });\n\n protected readonly hostClasses = computed(() =>\n zMergeClasses(zMetricCardVariants({ zSize: this.zSize(), zVariant: this.zVariant() }), this.class())\n );\n\n protected readonly iconClasses = computed(() =>\n zMetricCardIconVariants({ zSize: this.zSize(), zVariant: this.zVariant() })\n );\n\n protected readonly valueClasses = computed(() => zMetricCardValueVariants({ zSize: this.zSize() }));\n protected readonly decorClasses = computed(() =>\n zMergeClasses(\n 'pointer-events-none absolute right-0 top-0 text-primary/10 transition-opacity duration-200',\n this.zVariant() === 'bordered' ? 'text-muted-foreground/10' : '',\n this.zVariant() === 'soft' ? 'text-primary/15' : ''\n )\n );\n\n protected readonly trendDirection = computed<ZMetricCardTrendDirection>(() => this.zTrend()?.direction ?? 'neutral');\n protected readonly trendClasses = computed(() =>\n zMetricCardTrendVariants({ zTrendDirection: this.trendDirection() })\n );\n\n protected readonly trendIcon = computed<ZIcon>(() => {\n const direction = this.trendDirection();\n if (direction === 'up') {\n return 'lucideTrendingUp';\n }\n\n if (direction === 'down') {\n return 'lucideTrendingDown';\n }\n\n return 'lucideMinus';\n });\n\n protected readonly normalizedProgress = computed(() => {\n const progress = this.zProgress();\n if (progress === null || progress === undefined || Number.isNaN(progress)) {\n return null;\n }\n\n return Math.min(100, Math.max(0, progress));\n });\n\n protected onActionClick(): void {\n const action = this.zAction();\n if (!action) {\n return;\n }\n\n this.zActionClick.emit(action);\n }\n}\n","@if (zLoading()) {\n @if (zDecor() !== 'none') {\n <ng-container [ngTemplateOutlet]=\"metricDecor\" />\n }\n <div class=\"space-y-4\">\n <div class=\"flex items-center justify-between\">\n <div class=\"bg-muted h-9 w-9 animate-pulse rounded-md\"></div>\n <div class=\"bg-muted h-5 w-16 animate-pulse rounded-full\"></div>\n </div>\n <div class=\"space-y-2\">\n <div class=\"bg-muted h-4 w-24 animate-pulse rounded\"></div>\n <div class=\"bg-muted h-8 w-32 animate-pulse rounded\"></div>\n <div class=\"bg-muted h-3 w-40 animate-pulse rounded\"></div>\n </div>\n </div>\n} @else {\n @if (zDecor() !== 'none') {\n <ng-container [ngTemplateOutlet]=\"metricDecor\" />\n }\n\n <div class=\"relative z-10 flex items-start justify-between gap-4\">\n <div class=\"min-w-0 space-y-3\">\n @if (zIcon()) {\n <span [class]=\"iconClasses()\">\n <z-icon [zType]=\"zIcon()\" zSize=\"18\" />\n </span>\n }\n\n <div class=\"min-w-0\">\n @if (zTitle()) {\n <p class=\"text-muted-foreground overflow-hidden text-sm font-medium text-ellipsis whitespace-nowrap\">\n {{ zTitle() }}\n </p>\n }\n <p [class]=\"valueClasses()\">{{ zValue() }}</p>\n @if (zDescription()) {\n <p class=\"text-muted-foreground mt-1 overflow-hidden text-sm text-ellipsis whitespace-nowrap\">\n {{ zDescription() }}\n </p>\n }\n </div>\n </div>\n\n <div class=\"flex shrink-0 flex-col items-end gap-2\">\n @if (zTrend(); as trend) {\n <span [class]=\"trendClasses()\">\n <z-icon [zType]=\"trendIcon()\" zSize=\"12\" />\n <span>{{ trend.value }}</span>\n @if (trend.label) {\n <span>{{ trend.label }}</span>\n }\n </span>\n }\n\n @if (zAction(); as action) {\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:bg-muted hover:text-foreground inline-flex size-8 items-center justify-center rounded-md transition-colors\"\n [attr.aria-label]=\"action.label\"\n (click)=\"onActionClick()\">\n <z-icon [zType]=\"action.icon ?? 'lucideMoreHorizontal'\" zSize=\"16\" />\n </button>\n }\n </div>\n </div>\n\n @if (normalizedProgress() !== null) {\n <div class=\"bg-muted mt-4 h-1.5 overflow-hidden rounded-full\">\n <div\n class=\"bg-primary h-full rounded-full transition-[width] duration-300\"\n [style.width.%]=\"normalizedProgress()\"></div>\n </div>\n }\n\n <ng-content />\n}\n\n<ng-template #metricDecor>\n @switch (zDecor()) {\n @case ('bars') {\n <svg [class]=\"decorClasses()\" width=\"122\" height=\"98\" viewBox=\"0 0 122 98\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"54\" y=\"50\" width=\"10\" height=\"34\" rx=\"5\" fill=\"currentColor\" />\n <rect x=\"72\" y=\"30\" width=\"10\" height=\"54\" rx=\"5\" fill=\"currentColor\" />\n <rect x=\"90\" y=\"14\" width=\"10\" height=\"70\" rx=\"5\" fill=\"currentColor\" />\n <path d=\"M43 84H112\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n }\n @case ('dots') {\n <svg [class]=\"decorClasses()\" width=\"124\" height=\"96\" viewBox=\"0 0 124 96\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"66\" cy=\"22\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"88\" cy=\"22\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"110\" cy=\"22\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"55\" cy=\"44\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"77\" cy=\"44\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"99\" cy=\"44\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"66\" cy=\"66\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"88\" cy=\"66\" r=\"4\" fill=\"currentColor\" />\n <circle cx=\"110\" cy=\"66\" r=\"4\" fill=\"currentColor\" />\n </svg>\n }\n @case ('grid') {\n <svg [class]=\"decorClasses()\" width=\"116\" height=\"94\" viewBox=\"0 0 116 94\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M18 10H106V74H18V10Z\" stroke=\"currentColor\" stroke-width=\"1\" />\n <path d=\"M18 26H106M18 42H106M18 58H106M34 10V74M50 10V74M66 10V74M82 10V74M98 10V74\" stroke=\"currentColor\" />\n <circle cx=\"34\" cy=\"58\" r=\"3\" fill=\"currentColor\" />\n <circle cx=\"58\" cy=\"34\" r=\"3\" fill=\"currentColor\" />\n <circle cx=\"82\" cy=\"46\" r=\"3\" fill=\"currentColor\" />\n </svg>\n }\n @case ('rings') {\n <svg [class]=\"decorClasses()\" width=\"126\" height=\"96\" viewBox=\"0 0 126 96\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"96\" cy=\"28\" r=\"26\" stroke=\"currentColor\" stroke-width=\"8\" />\n <circle cx=\"96\" cy=\"28\" r=\"12\" stroke=\"currentColor\" stroke-width=\"4\" />\n <circle cx=\"64\" cy=\"58\" r=\"20\" stroke=\"currentColor\" stroke-width=\"6\" />\n <path d=\"M42 78C56 64 72 51 91 35\" stroke=\"currentColor\" stroke-width=\"4\" stroke-linecap=\"round\" />\n </svg>\n }\n @case ('spark') {\n <svg [class]=\"decorClasses()\" width=\"126\" height=\"96\" viewBox=\"0 0 126 96\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M35 70L50 53L63 61L77 34L90 42L108 18\"\n stroke=\"currentColor\"\n stroke-width=\"7\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n <path d=\"M36 82H112\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n <circle cx=\"108\" cy=\"18\" r=\"6\" fill=\"currentColor\" />\n </svg>\n }\n @default {\n <svg [class]=\"decorClasses()\" width=\"128\" height=\"96\" viewBox=\"0 0 128 96\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M21 70C34 49 47 39 62 42C82 46 85 20 107 18\"\n stroke=\"currentColor\"\n stroke-width=\"10\"\n stroke-linecap=\"round\" />\n <path\n d=\"M30 82C45 64 58 56 72 58C91 61 96 41 112 38\"\n stroke=\"currentColor\"\n stroke-width=\"5\"\n stroke-linecap=\"round\" />\n <circle cx=\"108\" cy=\"18\" r=\"7\" fill=\"currentColor\" />\n <circle cx=\"112\" cy=\"38\" r=\"4\" fill=\"currentColor\" />\n </svg>\n }\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEO,MAAM,mBAAmB,GAAG,GAAG,CAAC,uDAAuD,EAAE;AAC9F,IAAA,QAAQ,EAAE;AACR,QAAA,KAAK,EAAE;AACL,YAAA,EAAE,EAAE,KAAK;AACT,YAAA,OAAO,EAAE,KAAK;AACd,YAAA,EAAE,EAAE,KAAK;AACV,SAAA;AACD,QAAA,QAAQ,EAAE;AACR,YAAA,OAAO,EAAE,6DAA6D;AACtE,YAAA,QAAQ,EAAE,oDAAoD;AAC9D,YAAA,IAAI,EAAE,uDAAuD;AAC9D,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,QAAQ,EAAE,SAAS;AACpB,KAAA;AACF,CAAA;AAEM,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A,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,ED7HY,gBAAgB,oJAAE,cAAc,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,OAAA,EAAA,eAAA,EAAA,UAAA,EAAA,mBAAA,EAAA,OAAA,EAAA,cAAA,EAAA,MAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAS/B,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAXhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,WAChB,CAAC,gBAAgB,EAAE,cAAc,CAAC,EAAA,UAAA,EAC/B,IAAI,EAAA,eAAA,EAEC,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,SAAS,EAAE,eAAe;AAC3B,qBAAA,EAAA,QAAA,EAAA,+wMAAA,EAAA;;;AE7BH;;AAEG;;;;"}
|
|
@@ -86,6 +86,8 @@ class ZModalOptions {
|
|
|
86
86
|
zContent;
|
|
87
87
|
/** Custom CSS classes for the modal */
|
|
88
88
|
class;
|
|
89
|
+
/** Custom CSS classes for the modal body */
|
|
90
|
+
zBodyClass;
|
|
89
91
|
/** Data to be passed to the content component via Z_MODAL_DATA token */
|
|
90
92
|
zData;
|
|
91
93
|
/**
|
|
@@ -214,6 +216,7 @@ class ZModalComponent extends BasePortalOutlet {
|
|
|
214
216
|
zAfterClose = output();
|
|
215
217
|
zScrollbar = output();
|
|
216
218
|
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : []));
|
|
219
|
+
zBodyClass = input('', ...(ngDevMode ? [{ debugName: "zBodyClass" }] : []));
|
|
217
220
|
zVisible = model(false, ...(ngDevMode ? [{ debugName: "zVisible" }] : []));
|
|
218
221
|
zTitle = input(...(ngDevMode ? [undefined, { debugName: "zTitle" }] : []));
|
|
219
222
|
zDescription = input(...(ngDevMode ? [undefined, { debugName: "zDescription" }] : []));
|
|
@@ -299,6 +302,11 @@ class ZModalComponent extends BasePortalOutlet {
|
|
|
299
302
|
}, ...(ngDevMode ? [{ debugName: "confirmIconColors" }] : []));
|
|
300
303
|
effectiveTitle = computed(() => (this.isServiceMode() ? this.config.zTitle : this.zTitle()), ...(ngDevMode ? [{ debugName: "effectiveTitle" }] : []));
|
|
301
304
|
effectiveDescription = computed(() => this.isServiceMode() ? this.config.zDescription : this.zDescription(), ...(ngDevMode ? [{ debugName: "effectiveDescription" }] : []));
|
|
305
|
+
hasEffectiveDescription = computed(() => !!this.effectiveDescription(), ...(ngDevMode ? [{ debugName: "hasEffectiveDescription" }] : []));
|
|
306
|
+
headerContentClasses = computed(() => zMergeClasses('flex w-full justify-between overflow-hidden px-4', this.hasEffectiveDescription() ? 'items-start' : 'items-center'), ...(ngDevMode ? [{ debugName: "headerContentClasses" }] : []));
|
|
307
|
+
effectiveBodyClass = computed(() => this.isServiceMode() ? this.config.zBodyClass : this.zBodyClass(), ...(ngDevMode ? [{ debugName: "effectiveBodyClass" }] : []));
|
|
308
|
+
templateBodyClasses = computed(() => zMergeClasses('relative flex min-h-[12.5rem] flex-col gap-4 px-4 py-4', this.effectiveBodyClass()), ...(ngDevMode ? [{ debugName: "templateBodyClasses" }] : []));
|
|
309
|
+
serviceBodyClasses = computed(() => zMergeClasses('flex min-h-0 flex-col gap-4 px-4 py-4', this.effectiveBodyClass()), ...(ngDevMode ? [{ debugName: "serviceBodyClasses" }] : []));
|
|
302
310
|
effectiveClosable = computed(() => this.isServiceMode() ? (this.config.zClosable ?? true) : this.zClosable(), ...(ngDevMode ? [{ debugName: "effectiveClosable" }] : []));
|
|
303
311
|
effectiveHideFooter = computed(() => this.isServiceMode() ? this.config.zHideFooter : this.zHideFooter(), ...(ngDevMode ? [{ debugName: "effectiveHideFooter" }] : []));
|
|
304
312
|
effectiveHideHeader = computed(() => this.isServiceMode() ? this.config.zHideHeader : this.zHideHeader(), ...(ngDevMode ? [{ debugName: "effectiveHideHeader" }] : []));
|
|
@@ -528,7 +536,7 @@ class ZModalComponent extends BasePortalOutlet {
|
|
|
528
536
|
}
|
|
529
537
|
}
|
|
530
538
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
531
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZModalComponent, isStandalone: true, selector: "z-modal", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zVisible: { classPropertyName: "zVisible", publicName: "zVisible", isSignal: true, isRequired: false, transformFunction: null }, zTitle: { classPropertyName: "zTitle", publicName: "zTitle", isSignal: true, isRequired: false, transformFunction: null }, zDescription: { classPropertyName: "zDescription", publicName: "zDescription", isSignal: true, isRequired: false, transformFunction: null }, zWidth: { classPropertyName: "zWidth", publicName: "zWidth", isSignal: true, isRequired: false, transformFunction: null }, zClosable: { classPropertyName: "zClosable", publicName: "zClosable", isSignal: true, isRequired: false, transformFunction: null }, zMaskClosable: { classPropertyName: "zMaskClosable", publicName: "zMaskClosable", isSignal: true, isRequired: false, transformFunction: null }, zHideHeader: { classPropertyName: "zHideHeader", publicName: "zHideHeader", isSignal: true, isRequired: false, transformFunction: null }, zHideFooter: { classPropertyName: "zHideFooter", publicName: "zHideFooter", isSignal: true, isRequired: false, transformFunction: null }, zOkText: { classPropertyName: "zOkText", publicName: "zOkText", isSignal: true, isRequired: false, transformFunction: null }, zCancelText: { classPropertyName: "zCancelText", publicName: "zCancelText", isSignal: true, isRequired: false, transformFunction: null }, zOkDestructive: { classPropertyName: "zOkDestructive", publicName: "zOkDestructive", isSignal: true, isRequired: false, transformFunction: null }, zOkDisabled: { classPropertyName: "zOkDisabled", publicName: "zOkDisabled", isSignal: true, isRequired: false, transformFunction: null }, zLoading: { classPropertyName: "zLoading", publicName: "zLoading", isSignal: true, isRequired: false, transformFunction: null }, zContentLoading: { classPropertyName: "zContentLoading", publicName: "zContentLoading", isSignal: true, isRequired: false, transformFunction: null }, zSkeletonRows: { classPropertyName: "zSkeletonRows", publicName: "zSkeletonRows", isSignal: true, isRequired: false, transformFunction: null }, zOverlay: { classPropertyName: "zOverlay", publicName: "zOverlay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zOk: "zOk", zCancel: "zCancel", zAfterClose: "zAfterClose", zScrollbar: "zScrollbar", zVisible: "zVisibleChange" }, host: { properties: { "class": "hostClasses()", "style.width": "effectiveWidth()" } }, providers: [TranslatePipe], queries: [{ propertyName: "customHeader", first: true, predicate: ZModalHeaderDirective, descendants: true, isSignal: true }, { propertyName: "customContent", first: true, predicate: ZModalContentDirective, descendants: true, isSignal: true }, { propertyName: "customFooter", first: true, predicate: ZModalFooterDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, isSignal: true }, { propertyName: "dummyTemplateRef", first: true, predicate: ["dummyTemplate"], descendants: true, isSignal: true }, { propertyName: "mainContentRef", first: true, predicate: ["mainContent"], descendants: true, isSignal: true }], exportAs: ["zModal"], usesInheritance: true, ngImport: i0, template: "<!-- Dummy template to trigger CDK backdrop creation -->\n<ng-template #dummyTemplate />\n\n<!-- Template mode content (rendered in host element, which is moved to overlay) -->\n@if (isTemplateMode() && shouldRenderContent()) {\n @if (customHeader(); as headerDir) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex items-start justify-between px-4\">\n <ng-container *ngTemplateOutlet=\"headerDir.templateRef\" />\n </div>\n </header>\n } @else if (!effectiveHideHeader()) {\n @if (effectiveTitle()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex w-full items-start justify-between overflow-hidden px-4\">\n <div class=\"min-w-0 flex-1 overflow-hidden pr-2\">\n @if (effectiveTitle(); as title) {\n @switch (title | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(title)\" />\n }\n @case ('html') {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"title\"\n [innerHTML]=\"$any(title) | zSafeHtml\"></h4>\n }\n @default {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"$any(title) | translate\">\n {{ $any(title) | translate }}\n </h4>\n }\n }\n }\n @if (effectiveDescription(); as description) {\n @switch (description | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(description)\" />\n }\n @case ('html') {\n <p\n data-testid=\"z-modal-description\"\n class=\"text-muted-foreground m-0 mt-1 text-sm\"\n [innerHTML]=\"$any(description) | zSafeHtml\"></p>\n }\n @default {\n <p data-testid=\"z-modal-description\" class=\"text-muted-foreground m-0 mt-1 text-sm\">\n {{ $any(description) | translate }}\n </p>\n }\n }\n }\n </div>\n @if (effectiveClosable()) {\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n }\n </div>\n </header>\n } @else if (effectiveClosable()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n </div>\n </header>\n }\n }\n\n <ng-scrollbar\n class=\"z-modal-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main class=\"relative flex min-h-[12.5rem] flex-col gap-4 px-4 py-4\">\n <div [class.invisible]=\"effectiveContentLoading()\" [class.pointer-events-none]=\"effectiveContentLoading()\">\n @if (customContent(); as contentDir) {\n <ng-container *ngTemplateOutlet=\"contentDir.templateRef\" />\n } @else {\n <ng-content />\n }\n </div>\n\n @if (effectiveContentLoading()) {\n <div class=\"absolute inset-4 flex flex-col\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n </main>\n </ng-scrollbar>\n\n @if (customFooter(); as footerDir) {\n <footer [class.z-modal-footer-shadow]=\"shouldShowShadow()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n <ng-container *ngTemplateOutlet=\"footerDir.templateRef\" />\n </div>\n </footer>\n } @else if (!effectiveHideFooter()) {\n <footer [class.z-modal-footer-shadow]=\"shouldShowShadow()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button type=\"button\" data-testid=\"z-modal-cancel-button\" z-button zType=\"outline\" (click)=\"onCloseClick()\">\n {{ effectiveCancelText() ?? ('i18n_z_ui_modal_cancel' | translate) }}\n </button>\n }\n\n @if (effectiveOkText() !== null) {\n <button\n type=\"button\"\n data-testid=\"z-modal-ok-button\"\n z-button\n [zType]=\"effectiveOkDestructive() ? 'destructive' : 'default'\"\n [disabled]=\"effectiveOkDisabled() || effectiveLoading()\"\n [zLoading]=\"effectiveLoading()\"\n (click)=\"onOkClick()\">\n {{ effectiveOkText() ?? ('i18n_z_ui_common_ok' | translate) }}\n </button>\n }\n </div>\n </footer>\n }\n}\n\n<!-- Service mode content -->\n@if (isServiceMode()) {\n <!-- Confirm Modal Layout (no skeleton) -->\n @if (isConfirmMode()) {\n <div class=\"flex flex-col items-center px-4 pt-2 pb-4 text-center\">\n @if (config.zConfirmIcon) {\n <div class=\"relative mb-4 flex size-20 items-center justify-center\">\n <div class=\"absolute inset-0 rounded-full\" [class]=\"confirmIconColors().ring\"></div>\n <div class=\"relative flex size-14 items-center justify-center rounded-full\" [class]=\"confirmIconColors().bg\">\n <z-icon [zType]=\"config.zConfirmIcon\" zSize=\"30\" [zStrokeWidth]=\"2.6\" [class]=\"confirmIconColors().icon\" />\n </div>\n </div>\n }\n\n <!-- Title centered -->\n @if (effectiveTitle(); as title) {\n @switch (title | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(title)\" />\n }\n @case ('html') {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 text-lg leading-snug font-semibold\"\n [innerHTML]=\"$any(title) | zSafeHtml\"></h4>\n }\n @default {\n <h4 data-testid=\"z-modal-title\" class=\"m-0 text-lg leading-snug font-semibold\">\n {{ $any(title) | translate }}\n </h4>\n }\n }\n }\n\n <!-- Description centered -->\n @if (config.zContent; as content) {\n <p\n data-testid=\"z-modal-description\"\n class=\"text-muted-foreground m-0 mt-2 text-sm\"\n [innerHTML]=\"$any(content) | translate | zSafeHtml\"></p>\n }\n </div>\n\n <!-- Footer centered -->\n @if (!effectiveHideFooter()) {\n <footer class=\"mt-4 flex flex-row justify-center gap-3 pb-2\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-cancel-button\"\n z-button\n zType=\"outline\"\n (click)=\"onCloseClick()\">\n {{ effectiveCancelText() ?? 'i18n_z_ui_modal_cancel' | translate }}\n </button>\n }\n\n @if (effectiveOkText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-ok-button\"\n z-button\n [zType]=\"effectiveTypeOk()\"\n [disabled]=\"effectiveOkDisabled() || effectiveLoading()\"\n [zLoading]=\"effectiveLoading()\"\n (click)=\"onOkClick()\">\n {{ effectiveOkText() ?? 'i18n_z_ui_common_ok' | translate }}\n </button>\n }\n </footer>\n }\n } @else {\n <!-- Normal Modal Layout -->\n @if (!effectiveContentLoading()) {\n @if (!effectiveHideHeader()) {\n @if (effectiveTitle()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex w-full items-start justify-between overflow-hidden px-4\">\n <div class=\"min-w-0 flex-1 overflow-hidden pr-2\">\n @if (effectiveTitle(); as title) {\n @switch (title | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(title)\" />\n }\n @case ('html') {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"title\"\n [innerHTML]=\"$any(title) | zSafeHtml\"></h4>\n }\n @default {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"$any(title) | translate\">\n {{ $any(title) | translate }}\n </h4>\n }\n }\n }\n </div>\n @if (effectiveClosable()) {\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n }\n </div>\n </header>\n } @else if (effectiveClosable()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n </div>\n </header>\n }\n }\n\n <ng-scrollbar\n class=\"z-modal-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main class=\"flex min-h-0 flex-col gap-4 px-4 py-4\">\n <ng-template cdkPortalOutlet />\n\n @if (isStringContent()) {\n <div data-testid=\"z-modal-content\" [innerHTML]=\"$any(config.zContent) | zSafeHtml\"></div>\n }\n </main>\n </ng-scrollbar>\n\n @if (!effectiveHideFooter()) {\n <footer [class.z-modal-footer-shadow]=\"shouldShowShadow()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-cancel-button\"\n z-button\n zType=\"outline\"\n (click)=\"onCloseClick()\">\n @if (config.zCancelIcon) {\n <z-icon [zType]=\"config.zCancelIcon\" />\n }\n {{ effectiveCancelText() ?? 'i18n_z_ui_modal_cancel' | translate }}\n </button>\n }\n\n @if (effectiveOkText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-ok-button\"\n z-button\n [zType]=\"effectiveOkDestructive() ? 'destructive' : 'default'\"\n [disabled]=\"effectiveOkDisabled() || effectiveLoading()\"\n [zLoading]=\"effectiveLoading()\"\n (click)=\"onOkClick()\">\n @if (config.zOkIcon && !effectiveLoading()) {\n <z-icon [zType]=\"config.zOkIcon\" />\n }\n {{ effectiveOkText() ?? 'i18n_z_ui_common_ok' | translate }}\n </button>\n }\n </div>\n </footer>\n }\n } @else {\n <div class=\"flex h-[12.5rem] flex-col gap-4 px-4 py-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n }\n}\n", styles: [":host.z-modal-service-mode,:host.z-modal-template-mode{--z-enter-opacity: 0;--z-enter-scale: .96;transform-origin:center center;animation:z-enter .18s cubic-bezier(.16,1,.3,1) forwards}:host.z-modal-service-mode.modal-leave,:host.z-modal-template-mode.modal-leave{--z-exit-opacity: 0;--z-exit-scale: .96;transform-origin:center center;animation:z-exit .15s cubic-bezier(.4,0,1,1) forwards}:host.z-modal-template-host{display:contents}::ng-deep .z-modal-backdrop-dark{background-color:#0009;animation:z-backdrop-enter .15s ease-out forwards}::ng-deep .z-modal-backdrop-blur{background-color:#0000000d;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:z-backdrop-enter .15s ease-out forwards}::ng-deep .z-modal-backdrop-dark.z-backdrop-leaving,::ng-deep .z-modal-backdrop-blur.z-backdrop-leaving{animation:z-backdrop-exit .12s ease-in forwards}.z-modal-header-shadow{padding-bottom:1rem;box-shadow:0 2px 8px -2px #0000001a}.z-modal-footer-shadow{padding-top:1rem;box-shadow:0 -2px 8px -2px #0000001a}:host main{overscroll-behavior:contain}:host header,:host footer{transition:box-shadow .2s ease-out,padding .2s ease-out}.z-modal-scrollbar{--scrollbar-padding: .125rem}\n"], dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ZButtonComponent, selector: "z-button, button[z-button], a[z-button]", inputs: ["class", "zType", "zSize", "zShape", "zLabel", "zLoading", "zDisabled", "zTypeIcon", "zSizeIcon", "zStrokeWidthIcon", "zWave"], exportAs: ["zButton"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "directive", type: ZTooltipDirective, selector: "[z-tooltip], [zTooltip]", inputs: ["zContent", "zPosition", "zTrigger", "zTooltipType", "zTooltipSize", "zClass", "zShowDelay", "zHideDelay", "zArrow", "zDisabled", "zOffset", "zAutoDetect", "zTriggerElement", "zAlwaysShow", "zMaxWidth"], outputs: ["zShow", "zHide"], exportAs: ["zTooltip"] }, { kind: "component", type: ZSkeletonComponent, selector: "z-skeleton", inputs: ["class", "zType", "zSize", "zWidth", "zHeight", "zRows", "zGap", "zAnimated", "zRadius"] }, { kind: "component", type: NgScrollbar, selector: "ng-scrollbar:not([externalViewport]), [ngScrollbar]", exportAs: ["ngScrollbar"] }, { kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "pipe", type: ZContentTypePipe, name: "zContentType" }, { kind: "pipe", type: ZSafeHtmlPipe, name: "zSafeHtml" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
539
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZModalComponent, isStandalone: true, selector: "z-modal", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zBodyClass: { classPropertyName: "zBodyClass", publicName: "zBodyClass", isSignal: true, isRequired: false, transformFunction: null }, zVisible: { classPropertyName: "zVisible", publicName: "zVisible", isSignal: true, isRequired: false, transformFunction: null }, zTitle: { classPropertyName: "zTitle", publicName: "zTitle", isSignal: true, isRequired: false, transformFunction: null }, zDescription: { classPropertyName: "zDescription", publicName: "zDescription", isSignal: true, isRequired: false, transformFunction: null }, zWidth: { classPropertyName: "zWidth", publicName: "zWidth", isSignal: true, isRequired: false, transformFunction: null }, zClosable: { classPropertyName: "zClosable", publicName: "zClosable", isSignal: true, isRequired: false, transformFunction: null }, zMaskClosable: { classPropertyName: "zMaskClosable", publicName: "zMaskClosable", isSignal: true, isRequired: false, transformFunction: null }, zHideHeader: { classPropertyName: "zHideHeader", publicName: "zHideHeader", isSignal: true, isRequired: false, transformFunction: null }, zHideFooter: { classPropertyName: "zHideFooter", publicName: "zHideFooter", isSignal: true, isRequired: false, transformFunction: null }, zOkText: { classPropertyName: "zOkText", publicName: "zOkText", isSignal: true, isRequired: false, transformFunction: null }, zCancelText: { classPropertyName: "zCancelText", publicName: "zCancelText", isSignal: true, isRequired: false, transformFunction: null }, zOkDestructive: { classPropertyName: "zOkDestructive", publicName: "zOkDestructive", isSignal: true, isRequired: false, transformFunction: null }, zOkDisabled: { classPropertyName: "zOkDisabled", publicName: "zOkDisabled", isSignal: true, isRequired: false, transformFunction: null }, zLoading: { classPropertyName: "zLoading", publicName: "zLoading", isSignal: true, isRequired: false, transformFunction: null }, zContentLoading: { classPropertyName: "zContentLoading", publicName: "zContentLoading", isSignal: true, isRequired: false, transformFunction: null }, zSkeletonRows: { classPropertyName: "zSkeletonRows", publicName: "zSkeletonRows", isSignal: true, isRequired: false, transformFunction: null }, zOverlay: { classPropertyName: "zOverlay", publicName: "zOverlay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zOk: "zOk", zCancel: "zCancel", zAfterClose: "zAfterClose", zScrollbar: "zScrollbar", zVisible: "zVisibleChange" }, host: { properties: { "class": "hostClasses()", "style.width": "effectiveWidth()" } }, providers: [TranslatePipe], queries: [{ propertyName: "customHeader", first: true, predicate: ZModalHeaderDirective, descendants: true, isSignal: true }, { propertyName: "customContent", first: true, predicate: ZModalContentDirective, descendants: true, isSignal: true }, { propertyName: "customFooter", first: true, predicate: ZModalFooterDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, isSignal: true }, { propertyName: "dummyTemplateRef", first: true, predicate: ["dummyTemplate"], descendants: true, isSignal: true }, { propertyName: "mainContentRef", first: true, predicate: ["mainContent"], descendants: true, isSignal: true }], exportAs: ["zModal"], usesInheritance: true, ngImport: i0, template: "<!-- Dummy template to trigger CDK backdrop creation -->\n<ng-template #dummyTemplate />\n\n<!-- Template mode content (rendered in host element, which is moved to overlay) -->\n@if (isTemplateMode() && shouldRenderContent()) {\n @if (customHeader(); as headerDir) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex items-start justify-between px-4\">\n <ng-container *ngTemplateOutlet=\"headerDir.templateRef\" />\n </div>\n </header>\n } @else if (!effectiveHideHeader()) {\n @if (effectiveTitle()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div [class]=\"headerContentClasses()\">\n <div class=\"min-w-0 flex-1 overflow-hidden pr-2\">\n @if (effectiveTitle(); as title) {\n @switch (title | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(title)\" />\n }\n @case ('html') {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"title\"\n [innerHTML]=\"$any(title) | zSafeHtml\"></h4>\n }\n @default {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"$any(title) | translate\">\n {{ $any(title) | translate }}\n </h4>\n }\n }\n }\n @if (effectiveDescription(); as description) {\n @switch (description | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(description)\" />\n }\n @case ('html') {\n <p\n data-testid=\"z-modal-description\"\n class=\"text-muted-foreground m-0 mt-1 text-sm\"\n [innerHTML]=\"$any(description) | zSafeHtml\"></p>\n }\n @default {\n <p data-testid=\"z-modal-description\" class=\"text-muted-foreground m-0 mt-1 text-sm\">\n {{ $any(description) | translate }}\n </p>\n }\n }\n }\n </div>\n @if (effectiveClosable()) {\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n }\n </div>\n </header>\n } @else if (effectiveClosable()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n </div>\n </header>\n }\n }\n\n <ng-scrollbar\n class=\"z-modal-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main [class]=\"templateBodyClasses()\">\n <div [class.invisible]=\"effectiveContentLoading()\" [class.pointer-events-none]=\"effectiveContentLoading()\">\n @if (customContent(); as contentDir) {\n <ng-container *ngTemplateOutlet=\"contentDir.templateRef\" />\n } @else {\n <ng-content />\n }\n </div>\n\n @if (effectiveContentLoading()) {\n <div class=\"absolute inset-4 flex flex-col\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n </main>\n </ng-scrollbar>\n\n @if (customFooter(); as footerDir) {\n <footer [class.z-modal-footer-shadow]=\"shouldShowShadow()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n <ng-container *ngTemplateOutlet=\"footerDir.templateRef\" />\n </div>\n </footer>\n } @else if (!effectiveHideFooter()) {\n <footer [class.z-modal-footer-shadow]=\"shouldShowShadow()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button type=\"button\" data-testid=\"z-modal-cancel-button\" z-button zType=\"outline\" (click)=\"onCloseClick()\">\n {{ effectiveCancelText() ?? ('i18n_z_ui_modal_cancel' | translate) }}\n </button>\n }\n\n @if (effectiveOkText() !== null) {\n <button\n type=\"button\"\n data-testid=\"z-modal-ok-button\"\n z-button\n [zType]=\"effectiveOkDestructive() ? 'destructive' : 'default'\"\n [disabled]=\"effectiveOkDisabled() || effectiveLoading()\"\n [zLoading]=\"effectiveLoading()\"\n (click)=\"onOkClick()\">\n {{ effectiveOkText() ?? ('i18n_z_ui_common_ok' | translate) }}\n </button>\n }\n </div>\n </footer>\n }\n}\n\n<!-- Service mode content -->\n@if (isServiceMode()) {\n <!-- Confirm Modal Layout (no skeleton) -->\n @if (isConfirmMode()) {\n <div class=\"flex flex-col items-center px-4 pt-2 pb-4 text-center\">\n @if (config.zConfirmIcon) {\n <div class=\"relative mb-4 flex size-20 items-center justify-center\">\n <div class=\"absolute inset-0 rounded-full\" [class]=\"confirmIconColors().ring\"></div>\n <div class=\"relative flex size-14 items-center justify-center rounded-full\" [class]=\"confirmIconColors().bg\">\n <z-icon [zType]=\"config.zConfirmIcon\" zSize=\"30\" [zStrokeWidth]=\"2.6\" [class]=\"confirmIconColors().icon\" />\n </div>\n </div>\n }\n\n <!-- Title centered -->\n @if (effectiveTitle(); as title) {\n @switch (title | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(title)\" />\n }\n @case ('html') {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 text-lg leading-snug font-semibold\"\n [innerHTML]=\"$any(title) | zSafeHtml\"></h4>\n }\n @default {\n <h4 data-testid=\"z-modal-title\" class=\"m-0 text-lg leading-snug font-semibold\">\n {{ $any(title) | translate }}\n </h4>\n }\n }\n }\n\n <!-- Description centered -->\n @if (config.zContent; as content) {\n <p\n data-testid=\"z-modal-description\"\n class=\"text-muted-foreground m-0 mt-2 text-sm\"\n [innerHTML]=\"$any(content) | translate | zSafeHtml\"></p>\n }\n </div>\n\n <!-- Footer centered -->\n @if (!effectiveHideFooter()) {\n <footer class=\"mt-4 flex flex-row justify-center gap-3 pb-2\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-cancel-button\"\n z-button\n zType=\"outline\"\n (click)=\"onCloseClick()\">\n {{ effectiveCancelText() ?? 'i18n_z_ui_modal_cancel' | translate }}\n </button>\n }\n\n @if (effectiveOkText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-ok-button\"\n z-button\n [zType]=\"effectiveTypeOk()\"\n [disabled]=\"effectiveOkDisabled() || effectiveLoading()\"\n [zLoading]=\"effectiveLoading()\"\n (click)=\"onOkClick()\">\n {{ effectiveOkText() ?? 'i18n_z_ui_common_ok' | translate }}\n </button>\n }\n </footer>\n }\n } @else {\n <!-- Normal Modal Layout -->\n @if (!effectiveContentLoading()) {\n @if (!effectiveHideHeader()) {\n @if (effectiveTitle()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div [class]=\"headerContentClasses()\">\n <div class=\"min-w-0 flex-1 overflow-hidden pr-2\">\n @if (effectiveTitle(); as title) {\n @switch (title | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(title)\" />\n }\n @case ('html') {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"title\"\n [innerHTML]=\"$any(title) | zSafeHtml\"></h4>\n }\n @default {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"$any(title) | translate\">\n {{ $any(title) | translate }}\n </h4>\n }\n }\n }\n </div>\n @if (effectiveClosable()) {\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n }\n </div>\n </header>\n } @else if (effectiveClosable()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n </div>\n </header>\n }\n }\n\n <ng-scrollbar\n class=\"z-modal-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main [class]=\"serviceBodyClasses()\">\n <ng-template cdkPortalOutlet />\n\n @if (isStringContent()) {\n <div data-testid=\"z-modal-content\" [innerHTML]=\"$any(config.zContent) | zSafeHtml\"></div>\n }\n </main>\n </ng-scrollbar>\n\n @if (!effectiveHideFooter()) {\n <footer [class.z-modal-footer-shadow]=\"shouldShowShadow()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-cancel-button\"\n z-button\n zType=\"outline\"\n (click)=\"onCloseClick()\">\n @if (config.zCancelIcon) {\n <z-icon [zType]=\"config.zCancelIcon\" />\n }\n {{ effectiveCancelText() ?? 'i18n_z_ui_modal_cancel' | translate }}\n </button>\n }\n\n @if (effectiveOkText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-ok-button\"\n z-button\n [zType]=\"effectiveOkDestructive() ? 'destructive' : 'default'\"\n [disabled]=\"effectiveOkDisabled() || effectiveLoading()\"\n [zLoading]=\"effectiveLoading()\"\n (click)=\"onOkClick()\">\n @if (config.zOkIcon && !effectiveLoading()) {\n <z-icon [zType]=\"config.zOkIcon\" />\n }\n {{ effectiveOkText() ?? 'i18n_z_ui_common_ok' | translate }}\n </button>\n }\n </div>\n </footer>\n }\n } @else {\n <div class=\"flex h-[12.5rem] flex-col gap-4 px-4 py-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n }\n}\n", styles: [":host.z-modal-service-mode,:host.z-modal-template-mode{--z-enter-opacity: 0;--z-enter-scale: .96;transform-origin:center center;animation:z-enter .18s cubic-bezier(.16,1,.3,1) forwards}:host.z-modal-service-mode.modal-leave,:host.z-modal-template-mode.modal-leave{--z-exit-opacity: 0;--z-exit-scale: .96;transform-origin:center center;animation:z-exit .15s cubic-bezier(.4,0,1,1) forwards}:host.z-modal-template-host{display:contents}::ng-deep .z-modal-backdrop-dark{background-color:#0009;animation:z-backdrop-enter .15s ease-out forwards}::ng-deep .z-modal-backdrop-blur{background-color:#0000000d;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:z-backdrop-enter .15s ease-out forwards}::ng-deep .z-modal-backdrop-dark.z-backdrop-leaving,::ng-deep .z-modal-backdrop-blur.z-backdrop-leaving{animation:z-backdrop-exit .12s ease-in forwards}.z-modal-header-shadow{padding-bottom:1rem;box-shadow:0 2px 8px -2px #0000001a}.z-modal-footer-shadow{padding-top:1rem;box-shadow:0 -2px 8px -2px #0000001a}:host main{overscroll-behavior:contain}:host header,:host footer{transition:box-shadow .2s ease-out,padding .2s ease-out}.z-modal-scrollbar{--scrollbar-padding: .125rem}\n"], dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ZButtonComponent, selector: "z-button, button[z-button], a[z-button]", inputs: ["class", "zType", "zSize", "zShape", "zLabel", "zLoading", "zDisabled", "zTypeIcon", "zAnimatedTypeIcon", "zAnimateIcon", "zAnimationTriggerIcon", "zSizeIcon", "zStrokeWidthIcon", "zWave"], exportAs: ["zButton"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "directive", type: ZTooltipDirective, selector: "[z-tooltip], [zTooltip]", inputs: ["zContent", "zPosition", "zTrigger", "zTooltipType", "zTooltipSize", "zClass", "zShowDelay", "zHideDelay", "zArrow", "zDisabled", "zOffset", "zAutoDetect", "zTriggerElement", "zAlwaysShow", "zMaxWidth"], outputs: ["zShow", "zHide"], exportAs: ["zTooltip"] }, { kind: "component", type: ZSkeletonComponent, selector: "z-skeleton", inputs: ["class", "zType", "zSize", "zWidth", "zHeight", "zRows", "zGap", "zAnimated", "zRadius"] }, { kind: "component", type: NgScrollbar, selector: "ng-scrollbar:not([externalViewport]), [ngScrollbar]", exportAs: ["ngScrollbar"] }, { kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "pipe", type: ZContentTypePipe, name: "zContentType" }, { kind: "pipe", type: ZSafeHtmlPipe, name: "zSafeHtml" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
532
540
|
}
|
|
533
541
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZModalComponent, decorators: [{
|
|
534
542
|
type: Component,
|
|
@@ -547,8 +555,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
547
555
|
], standalone: true, providers: [TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
548
556
|
'[class]': 'hostClasses()',
|
|
549
557
|
'[style.width]': 'effectiveWidth()',
|
|
550
|
-
}, exportAs: 'zModal', template: "<!-- Dummy template to trigger CDK backdrop creation -->\n<ng-template #dummyTemplate />\n\n<!-- Template mode content (rendered in host element, which is moved to overlay) -->\n@if (isTemplateMode() && shouldRenderContent()) {\n @if (customHeader(); as headerDir) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex items-start justify-between px-4\">\n <ng-container *ngTemplateOutlet=\"headerDir.templateRef\" />\n </div>\n </header>\n } @else if (!effectiveHideHeader()) {\n @if (effectiveTitle()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex w-full items-start justify-between overflow-hidden px-4\">\n <div class=\"min-w-0 flex-1 overflow-hidden pr-2\">\n @if (effectiveTitle(); as title) {\n @switch (title | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(title)\" />\n }\n @case ('html') {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"title\"\n [innerHTML]=\"$any(title) | zSafeHtml\"></h4>\n }\n @default {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"$any(title) | translate\">\n {{ $any(title) | translate }}\n </h4>\n }\n }\n }\n @if (effectiveDescription(); as description) {\n @switch (description | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(description)\" />\n }\n @case ('html') {\n <p\n data-testid=\"z-modal-description\"\n class=\"text-muted-foreground m-0 mt-1 text-sm\"\n [innerHTML]=\"$any(description) | zSafeHtml\"></p>\n }\n @default {\n <p data-testid=\"z-modal-description\" class=\"text-muted-foreground m-0 mt-1 text-sm\">\n {{ $any(description) | translate }}\n </p>\n }\n }\n }\n </div>\n @if (effectiveClosable()) {\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n }\n </div>\n </header>\n } @else if (effectiveClosable()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n </div>\n </header>\n }\n }\n\n <ng-scrollbar\n class=\"z-modal-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main class=\"relative flex min-h-[12.5rem] flex-col gap-4 px-4 py-4\">\n <div [class.invisible]=\"effectiveContentLoading()\" [class.pointer-events-none]=\"effectiveContentLoading()\">\n @if (customContent(); as contentDir) {\n <ng-container *ngTemplateOutlet=\"contentDir.templateRef\" />\n } @else {\n <ng-content />\n }\n </div>\n\n @if (effectiveContentLoading()) {\n <div class=\"absolute inset-4 flex flex-col\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n </main>\n </ng-scrollbar>\n\n @if (customFooter(); as footerDir) {\n <footer [class.z-modal-footer-shadow]=\"shouldShowShadow()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n <ng-container *ngTemplateOutlet=\"footerDir.templateRef\" />\n </div>\n </footer>\n } @else if (!effectiveHideFooter()) {\n <footer [class.z-modal-footer-shadow]=\"shouldShowShadow()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button type=\"button\" data-testid=\"z-modal-cancel-button\" z-button zType=\"outline\" (click)=\"onCloseClick()\">\n {{ effectiveCancelText() ?? ('i18n_z_ui_modal_cancel' | translate) }}\n </button>\n }\n\n @if (effectiveOkText() !== null) {\n <button\n type=\"button\"\n data-testid=\"z-modal-ok-button\"\n z-button\n [zType]=\"effectiveOkDestructive() ? 'destructive' : 'default'\"\n [disabled]=\"effectiveOkDisabled() || effectiveLoading()\"\n [zLoading]=\"effectiveLoading()\"\n (click)=\"onOkClick()\">\n {{ effectiveOkText() ?? ('i18n_z_ui_common_ok' | translate) }}\n </button>\n }\n </div>\n </footer>\n }\n}\n\n<!-- Service mode content -->\n@if (isServiceMode()) {\n <!-- Confirm Modal Layout (no skeleton) -->\n @if (isConfirmMode()) {\n <div class=\"flex flex-col items-center px-4 pt-2 pb-4 text-center\">\n @if (config.zConfirmIcon) {\n <div class=\"relative mb-4 flex size-20 items-center justify-center\">\n <div class=\"absolute inset-0 rounded-full\" [class]=\"confirmIconColors().ring\"></div>\n <div class=\"relative flex size-14 items-center justify-center rounded-full\" [class]=\"confirmIconColors().bg\">\n <z-icon [zType]=\"config.zConfirmIcon\" zSize=\"30\" [zStrokeWidth]=\"2.6\" [class]=\"confirmIconColors().icon\" />\n </div>\n </div>\n }\n\n <!-- Title centered -->\n @if (effectiveTitle(); as title) {\n @switch (title | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(title)\" />\n }\n @case ('html') {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 text-lg leading-snug font-semibold\"\n [innerHTML]=\"$any(title) | zSafeHtml\"></h4>\n }\n @default {\n <h4 data-testid=\"z-modal-title\" class=\"m-0 text-lg leading-snug font-semibold\">\n {{ $any(title) | translate }}\n </h4>\n }\n }\n }\n\n <!-- Description centered -->\n @if (config.zContent; as content) {\n <p\n data-testid=\"z-modal-description\"\n class=\"text-muted-foreground m-0 mt-2 text-sm\"\n [innerHTML]=\"$any(content) | translate | zSafeHtml\"></p>\n }\n </div>\n\n <!-- Footer centered -->\n @if (!effectiveHideFooter()) {\n <footer class=\"mt-4 flex flex-row justify-center gap-3 pb-2\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-cancel-button\"\n z-button\n zType=\"outline\"\n (click)=\"onCloseClick()\">\n {{ effectiveCancelText() ?? 'i18n_z_ui_modal_cancel' | translate }}\n </button>\n }\n\n @if (effectiveOkText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-ok-button\"\n z-button\n [zType]=\"effectiveTypeOk()\"\n [disabled]=\"effectiveOkDisabled() || effectiveLoading()\"\n [zLoading]=\"effectiveLoading()\"\n (click)=\"onOkClick()\">\n {{ effectiveOkText() ?? 'i18n_z_ui_common_ok' | translate }}\n </button>\n }\n </footer>\n }\n } @else {\n <!-- Normal Modal Layout -->\n @if (!effectiveContentLoading()) {\n @if (!effectiveHideHeader()) {\n @if (effectiveTitle()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex w-full items-start justify-between overflow-hidden px-4\">\n <div class=\"min-w-0 flex-1 overflow-hidden pr-2\">\n @if (effectiveTitle(); as title) {\n @switch (title | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(title)\" />\n }\n @case ('html') {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"title\"\n [innerHTML]=\"$any(title) | zSafeHtml\"></h4>\n }\n @default {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"$any(title) | translate\">\n {{ $any(title) | translate }}\n </h4>\n }\n }\n }\n </div>\n @if (effectiveClosable()) {\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n }\n </div>\n </header>\n } @else if (effectiveClosable()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n </div>\n </header>\n }\n }\n\n <ng-scrollbar\n class=\"z-modal-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main class=\"flex min-h-0 flex-col gap-4 px-4 py-4\">\n <ng-template cdkPortalOutlet />\n\n @if (isStringContent()) {\n <div data-testid=\"z-modal-content\" [innerHTML]=\"$any(config.zContent) | zSafeHtml\"></div>\n }\n </main>\n </ng-scrollbar>\n\n @if (!effectiveHideFooter()) {\n <footer [class.z-modal-footer-shadow]=\"shouldShowShadow()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-cancel-button\"\n z-button\n zType=\"outline\"\n (click)=\"onCloseClick()\">\n @if (config.zCancelIcon) {\n <z-icon [zType]=\"config.zCancelIcon\" />\n }\n {{ effectiveCancelText() ?? 'i18n_z_ui_modal_cancel' | translate }}\n </button>\n }\n\n @if (effectiveOkText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-ok-button\"\n z-button\n [zType]=\"effectiveOkDestructive() ? 'destructive' : 'default'\"\n [disabled]=\"effectiveOkDisabled() || effectiveLoading()\"\n [zLoading]=\"effectiveLoading()\"\n (click)=\"onOkClick()\">\n @if (config.zOkIcon && !effectiveLoading()) {\n <z-icon [zType]=\"config.zOkIcon\" />\n }\n {{ effectiveOkText() ?? 'i18n_z_ui_common_ok' | translate }}\n </button>\n }\n </div>\n </footer>\n }\n } @else {\n <div class=\"flex h-[12.5rem] flex-col gap-4 px-4 py-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n }\n}\n", styles: [":host.z-modal-service-mode,:host.z-modal-template-mode{--z-enter-opacity: 0;--z-enter-scale: .96;transform-origin:center center;animation:z-enter .18s cubic-bezier(.16,1,.3,1) forwards}:host.z-modal-service-mode.modal-leave,:host.z-modal-template-mode.modal-leave{--z-exit-opacity: 0;--z-exit-scale: .96;transform-origin:center center;animation:z-exit .15s cubic-bezier(.4,0,1,1) forwards}:host.z-modal-template-host{display:contents}::ng-deep .z-modal-backdrop-dark{background-color:#0009;animation:z-backdrop-enter .15s ease-out forwards}::ng-deep .z-modal-backdrop-blur{background-color:#0000000d;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:z-backdrop-enter .15s ease-out forwards}::ng-deep .z-modal-backdrop-dark.z-backdrop-leaving,::ng-deep .z-modal-backdrop-blur.z-backdrop-leaving{animation:z-backdrop-exit .12s ease-in forwards}.z-modal-header-shadow{padding-bottom:1rem;box-shadow:0 2px 8px -2px #0000001a}.z-modal-footer-shadow{padding-top:1rem;box-shadow:0 -2px 8px -2px #0000001a}:host main{overscroll-behavior:contain}:host header,:host footer{transition:box-shadow .2s ease-out,padding .2s ease-out}.z-modal-scrollbar{--scrollbar-padding: .125rem}\n"] }]
|
|
551
|
-
}], ctorParameters: () => [], propDecorators: { zOk: [{ type: i0.Output, args: ["zOk"] }], zCancel: [{ type: i0.Output, args: ["zCancel"] }], zAfterClose: [{ type: i0.Output, args: ["zAfterClose"] }], zScrollbar: [{ type: i0.Output, args: ["zScrollbar"] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "zVisible", required: false }] }, { type: i0.Output, args: ["zVisibleChange"] }], zTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTitle", required: false }] }], zDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDescription", required: false }] }], zWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "zWidth", required: false }] }], zClosable: [{ type: i0.Input, args: [{ isSignal: true, alias: "zClosable", required: false }] }], zMaskClosable: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMaskClosable", required: false }] }], zHideHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "zHideHeader", required: false }] }], zHideFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "zHideFooter", required: false }] }], zOkText: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOkText", required: false }] }], zCancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "zCancelText", required: false }] }], zOkDestructive: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOkDestructive", required: false }] }], zOkDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOkDisabled", required: false }] }], zLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLoading", required: false }] }], zContentLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "zContentLoading", required: false }] }], zSkeletonRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSkeletonRows", required: false }] }], zOverlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOverlay", required: false }] }], customHeader: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ZModalHeaderDirective), { isSignal: true }] }], customContent: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ZModalContentDirective), { isSignal: true }] }], customFooter: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ZModalFooterDirective), { isSignal: true }] }], portalOutlet: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkPortalOutlet), { isSignal: true }] }], dummyTemplateRef: [{ type: i0.ViewChild, args: ['dummyTemplate', { isSignal: true }] }], mainContentRef: [{ type: i0.ViewChild, args: ['mainContent', { isSignal: true }] }] } });
|
|
558
|
+
}, exportAs: 'zModal', template: "<!-- Dummy template to trigger CDK backdrop creation -->\n<ng-template #dummyTemplate />\n\n<!-- Template mode content (rendered in host element, which is moved to overlay) -->\n@if (isTemplateMode() && shouldRenderContent()) {\n @if (customHeader(); as headerDir) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex items-start justify-between px-4\">\n <ng-container *ngTemplateOutlet=\"headerDir.templateRef\" />\n </div>\n </header>\n } @else if (!effectiveHideHeader()) {\n @if (effectiveTitle()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div [class]=\"headerContentClasses()\">\n <div class=\"min-w-0 flex-1 overflow-hidden pr-2\">\n @if (effectiveTitle(); as title) {\n @switch (title | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(title)\" />\n }\n @case ('html') {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"title\"\n [innerHTML]=\"$any(title) | zSafeHtml\"></h4>\n }\n @default {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"$any(title) | translate\">\n {{ $any(title) | translate }}\n </h4>\n }\n }\n }\n @if (effectiveDescription(); as description) {\n @switch (description | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(description)\" />\n }\n @case ('html') {\n <p\n data-testid=\"z-modal-description\"\n class=\"text-muted-foreground m-0 mt-1 text-sm\"\n [innerHTML]=\"$any(description) | zSafeHtml\"></p>\n }\n @default {\n <p data-testid=\"z-modal-description\" class=\"text-muted-foreground m-0 mt-1 text-sm\">\n {{ $any(description) | translate }}\n </p>\n }\n }\n }\n </div>\n @if (effectiveClosable()) {\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n }\n </div>\n </header>\n } @else if (effectiveClosable()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n </div>\n </header>\n }\n }\n\n <ng-scrollbar\n class=\"z-modal-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main [class]=\"templateBodyClasses()\">\n <div [class.invisible]=\"effectiveContentLoading()\" [class.pointer-events-none]=\"effectiveContentLoading()\">\n @if (customContent(); as contentDir) {\n <ng-container *ngTemplateOutlet=\"contentDir.templateRef\" />\n } @else {\n <ng-content />\n }\n </div>\n\n @if (effectiveContentLoading()) {\n <div class=\"absolute inset-4 flex flex-col\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n </main>\n </ng-scrollbar>\n\n @if (customFooter(); as footerDir) {\n <footer [class.z-modal-footer-shadow]=\"shouldShowShadow()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n <ng-container *ngTemplateOutlet=\"footerDir.templateRef\" />\n </div>\n </footer>\n } @else if (!effectiveHideFooter()) {\n <footer [class.z-modal-footer-shadow]=\"shouldShowShadow()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button type=\"button\" data-testid=\"z-modal-cancel-button\" z-button zType=\"outline\" (click)=\"onCloseClick()\">\n {{ effectiveCancelText() ?? ('i18n_z_ui_modal_cancel' | translate) }}\n </button>\n }\n\n @if (effectiveOkText() !== null) {\n <button\n type=\"button\"\n data-testid=\"z-modal-ok-button\"\n z-button\n [zType]=\"effectiveOkDestructive() ? 'destructive' : 'default'\"\n [disabled]=\"effectiveOkDisabled() || effectiveLoading()\"\n [zLoading]=\"effectiveLoading()\"\n (click)=\"onOkClick()\">\n {{ effectiveOkText() ?? ('i18n_z_ui_common_ok' | translate) }}\n </button>\n }\n </div>\n </footer>\n }\n}\n\n<!-- Service mode content -->\n@if (isServiceMode()) {\n <!-- Confirm Modal Layout (no skeleton) -->\n @if (isConfirmMode()) {\n <div class=\"flex flex-col items-center px-4 pt-2 pb-4 text-center\">\n @if (config.zConfirmIcon) {\n <div class=\"relative mb-4 flex size-20 items-center justify-center\">\n <div class=\"absolute inset-0 rounded-full\" [class]=\"confirmIconColors().ring\"></div>\n <div class=\"relative flex size-14 items-center justify-center rounded-full\" [class]=\"confirmIconColors().bg\">\n <z-icon [zType]=\"config.zConfirmIcon\" zSize=\"30\" [zStrokeWidth]=\"2.6\" [class]=\"confirmIconColors().icon\" />\n </div>\n </div>\n }\n\n <!-- Title centered -->\n @if (effectiveTitle(); as title) {\n @switch (title | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(title)\" />\n }\n @case ('html') {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 text-lg leading-snug font-semibold\"\n [innerHTML]=\"$any(title) | zSafeHtml\"></h4>\n }\n @default {\n <h4 data-testid=\"z-modal-title\" class=\"m-0 text-lg leading-snug font-semibold\">\n {{ $any(title) | translate }}\n </h4>\n }\n }\n }\n\n <!-- Description centered -->\n @if (config.zContent; as content) {\n <p\n data-testid=\"z-modal-description\"\n class=\"text-muted-foreground m-0 mt-2 text-sm\"\n [innerHTML]=\"$any(content) | translate | zSafeHtml\"></p>\n }\n </div>\n\n <!-- Footer centered -->\n @if (!effectiveHideFooter()) {\n <footer class=\"mt-4 flex flex-row justify-center gap-3 pb-2\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-cancel-button\"\n z-button\n zType=\"outline\"\n (click)=\"onCloseClick()\">\n {{ effectiveCancelText() ?? 'i18n_z_ui_modal_cancel' | translate }}\n </button>\n }\n\n @if (effectiveOkText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-ok-button\"\n z-button\n [zType]=\"effectiveTypeOk()\"\n [disabled]=\"effectiveOkDisabled() || effectiveLoading()\"\n [zLoading]=\"effectiveLoading()\"\n (click)=\"onOkClick()\">\n {{ effectiveOkText() ?? 'i18n_z_ui_common_ok' | translate }}\n </button>\n }\n </footer>\n }\n } @else {\n <!-- Normal Modal Layout -->\n @if (!effectiveContentLoading()) {\n @if (!effectiveHideHeader()) {\n @if (effectiveTitle()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div [class]=\"headerContentClasses()\">\n <div class=\"min-w-0 flex-1 overflow-hidden pr-2\">\n @if (effectiveTitle(); as title) {\n @switch (title | zContentType) {\n @case ('template') {\n <ng-container *ngTemplateOutlet=\"$any(title)\" />\n }\n @case ('html') {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"title\"\n [innerHTML]=\"$any(title) | zSafeHtml\"></h4>\n }\n @default {\n <h4\n data-testid=\"z-modal-title\"\n class=\"m-0 truncate text-base leading-snug font-semibold\"\n z-tooltip\n [zContent]=\"$any(title) | translate\">\n {{ $any(title) | translate }}\n </h4>\n }\n }\n }\n </div>\n @if (effectiveClosable()) {\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n }\n </div>\n </header>\n } @else if (effectiveClosable()) {\n <header [class.z-modal-header-shadow]=\"shouldShowShadow()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-modal-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n [zWave]=\"false\"\n (click)=\"onCloseClick()\">\n <z-icon zType=\"lucideX\" />\n </button>\n </div>\n </header>\n }\n }\n\n <ng-scrollbar\n class=\"z-modal-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main [class]=\"serviceBodyClasses()\">\n <ng-template cdkPortalOutlet />\n\n @if (isStringContent()) {\n <div data-testid=\"z-modal-content\" [innerHTML]=\"$any(config.zContent) | zSafeHtml\"></div>\n }\n </main>\n </ng-scrollbar>\n\n @if (!effectiveHideFooter()) {\n <footer [class.z-modal-footer-shadow]=\"shouldShowShadow()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-cancel-button\"\n z-button\n zType=\"outline\"\n (click)=\"onCloseClick()\">\n @if (config.zCancelIcon) {\n <z-icon [zType]=\"config.zCancelIcon\" />\n }\n {{ effectiveCancelText() ?? 'i18n_z_ui_modal_cancel' | translate }}\n </button>\n }\n\n @if (effectiveOkText() !== null) {\n <button\n type=\"button\"\n class=\"min-w-28\"\n data-testid=\"z-modal-ok-button\"\n z-button\n [zType]=\"effectiveOkDestructive() ? 'destructive' : 'default'\"\n [disabled]=\"effectiveOkDisabled() || effectiveLoading()\"\n [zLoading]=\"effectiveLoading()\"\n (click)=\"onOkClick()\">\n @if (config.zOkIcon && !effectiveLoading()) {\n <z-icon [zType]=\"config.zOkIcon\" />\n }\n {{ effectiveOkText() ?? 'i18n_z_ui_common_ok' | translate }}\n </button>\n }\n </div>\n </footer>\n }\n } @else {\n <div class=\"flex h-[12.5rem] flex-col gap-4 px-4 py-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n }\n}\n", styles: [":host.z-modal-service-mode,:host.z-modal-template-mode{--z-enter-opacity: 0;--z-enter-scale: .96;transform-origin:center center;animation:z-enter .18s cubic-bezier(.16,1,.3,1) forwards}:host.z-modal-service-mode.modal-leave,:host.z-modal-template-mode.modal-leave{--z-exit-opacity: 0;--z-exit-scale: .96;transform-origin:center center;animation:z-exit .15s cubic-bezier(.4,0,1,1) forwards}:host.z-modal-template-host{display:contents}::ng-deep .z-modal-backdrop-dark{background-color:#0009;animation:z-backdrop-enter .15s ease-out forwards}::ng-deep .z-modal-backdrop-blur{background-color:#0000000d;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:z-backdrop-enter .15s ease-out forwards}::ng-deep .z-modal-backdrop-dark.z-backdrop-leaving,::ng-deep .z-modal-backdrop-blur.z-backdrop-leaving{animation:z-backdrop-exit .12s ease-in forwards}.z-modal-header-shadow{padding-bottom:1rem;box-shadow:0 2px 8px -2px #0000001a}.z-modal-footer-shadow{padding-top:1rem;box-shadow:0 -2px 8px -2px #0000001a}:host main{overscroll-behavior:contain}:host header,:host footer{transition:box-shadow .2s ease-out,padding .2s ease-out}.z-modal-scrollbar{--scrollbar-padding: .125rem}\n"] }]
|
|
559
|
+
}], ctorParameters: () => [], propDecorators: { zOk: [{ type: i0.Output, args: ["zOk"] }], zCancel: [{ type: i0.Output, args: ["zCancel"] }], zAfterClose: [{ type: i0.Output, args: ["zAfterClose"] }], zScrollbar: [{ type: i0.Output, args: ["zScrollbar"] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zBodyClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "zBodyClass", required: false }] }], zVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "zVisible", required: false }] }, { type: i0.Output, args: ["zVisibleChange"] }], zTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTitle", required: false }] }], zDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDescription", required: false }] }], zWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "zWidth", required: false }] }], zClosable: [{ type: i0.Input, args: [{ isSignal: true, alias: "zClosable", required: false }] }], zMaskClosable: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMaskClosable", required: false }] }], zHideHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "zHideHeader", required: false }] }], zHideFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "zHideFooter", required: false }] }], zOkText: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOkText", required: false }] }], zCancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "zCancelText", required: false }] }], zOkDestructive: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOkDestructive", required: false }] }], zOkDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOkDisabled", required: false }] }], zLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLoading", required: false }] }], zContentLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "zContentLoading", required: false }] }], zSkeletonRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSkeletonRows", required: false }] }], zOverlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOverlay", required: false }] }], customHeader: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ZModalHeaderDirective), { isSignal: true }] }], customContent: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ZModalContentDirective), { isSignal: true }] }], customFooter: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ZModalFooterDirective), { isSignal: true }] }], portalOutlet: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkPortalOutlet), { isSignal: true }] }], dummyTemplateRef: [{ type: i0.ViewChild, args: ['dummyTemplate', { isSignal: true }] }], mainContentRef: [{ type: i0.ViewChild, args: ['mainContent', { isSignal: true }] }] } });
|
|
552
560
|
|
|
553
561
|
let ZModalRef = class ZModalRef {
|
|
554
562
|
_overlayRef;
|