@shival99/z-ui 2.1.32 → 2.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs +130 -6
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-table.mjs +10515 -0
- package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs +507 -0
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs +237 -0
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-i18n.mjs +2 -0
- package/fesm2022/shival99-z-ui-i18n.mjs.map +1 -1
- package/package.json +1 -1
- package/types/shival99-z-ui-components-z-drawer.d.ts +17 -1
- package/types/shival99-z-ui-components-z-table.d.ts +1926 -0
- package/types/shival99-z-ui-components-z-tabs.d.ts +92 -0
- package/types/shival99-z-ui-components-z-timeline.d.ts +71 -0
|
@@ -3,10 +3,11 @@ import * as i1 from '@angular/cdk/portal';
|
|
|
3
3
|
import { BasePortalOutlet, CdkPortalOutlet, TemplatePortal, PortalModule, ComponentPortal } from '@angular/cdk/portal';
|
|
4
4
|
import { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { inject, TemplateRef, Directive, InjectionToken, output, input, model, contentChild, viewChild, PLATFORM_ID, ElementRef, ViewContainerRef, ChangeDetectorRef, DestroyRef, signal, computed, effect, ChangeDetectionStrategy, Component, EventEmitter, Inject, Injector, Injectable } from '@angular/core';
|
|
6
|
+
import { inject, TemplateRef, Directive, InjectionToken, output, input, model, booleanAttribute, contentChild, viewChild, PLATFORM_ID, ElementRef, ViewContainerRef, ChangeDetectorRef, DestroyRef, signal, computed, effect, ChangeDetectionStrategy, Component, EventEmitter, Inject, Injector, Injectable } from '@angular/core';
|
|
7
7
|
import { TranslatePipe } from '@ngx-translate/core';
|
|
8
|
+
import { ZIconComponent } from '@shival99/z-ui/components/z-icon';
|
|
8
9
|
import { ZSkeletonComponent } from '@shival99/z-ui/components/z-skeleton';
|
|
9
|
-
import { ZTranslateService, ZOverlayContainerService, ZOverlayZIndexService } from '@shival99/z-ui/services';
|
|
10
|
+
import { ZTranslateService, ZOverlayContainerService, ZOverlayZIndexService, ZIndexDbService } from '@shival99/z-ui/services';
|
|
10
11
|
import { zDetectBrowser, zMergeClasses } from '@shival99/z-ui/utils';
|
|
11
12
|
import { cva } from 'class-variance-authority';
|
|
12
13
|
import { __decorate, __param, __metadata } from 'tslib';
|
|
@@ -51,6 +52,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
51
52
|
}]
|
|
52
53
|
}] });
|
|
53
54
|
|
|
55
|
+
const Z_DRAWER_RESIZE_MIN_SIZE = 240;
|
|
56
|
+
const Z_DRAWER_RESIZE_VIEWPORT_PADDING = 32;
|
|
57
|
+
const Z_DRAWER_RESIZE_KEY_PREFIX = 'z-drawer-resize';
|
|
58
|
+
|
|
54
59
|
const Z_DRAWER_DATA = new InjectionToken('Z_DRAWER_DATA');
|
|
55
60
|
const Z_DRAWER_ANIMATION_DURATION = 250;
|
|
56
61
|
var ZDrawerTriggerAction;
|
|
@@ -137,6 +142,8 @@ class ZDrawerOptions {
|
|
|
137
142
|
zContentLoading;
|
|
138
143
|
/** Number of skeleton rows to show when content is loading (default: 5 for left/right, 3 for top/bottom) */
|
|
139
144
|
zSkeletonRows;
|
|
145
|
+
/** Whether the drawer can be resized from its outer edge */
|
|
146
|
+
zExpand;
|
|
140
147
|
}
|
|
141
148
|
|
|
142
149
|
const getOverlayType = () => {
|
|
@@ -199,6 +206,7 @@ class ZDrawerComponent extends BasePortalOutlet {
|
|
|
199
206
|
zShape = input('rounded', ...(ngDevMode ? [{ debugName: "zShape" }] : []));
|
|
200
207
|
zContentLoading = input(false, ...(ngDevMode ? [{ debugName: "zContentLoading" }] : []));
|
|
201
208
|
zSkeletonRows = input(null, ...(ngDevMode ? [{ debugName: "zSkeletonRows" }] : []));
|
|
209
|
+
zExpand = input(false, { ...(ngDevMode ? { debugName: "zExpand" } : {}), transform: booleanAttribute });
|
|
202
210
|
customHeader = contentChild(ZDrawerHeaderDirective, ...(ngDevMode ? [{ debugName: "customHeader" }] : []));
|
|
203
211
|
customContent = contentChild(ZDrawerContentDirective, ...(ngDevMode ? [{ debugName: "customContent" }] : []));
|
|
204
212
|
customFooter = contentChild(ZDrawerFooterDirective, ...(ngDevMode ? [{ debugName: "customFooter" }] : []));
|
|
@@ -216,11 +224,15 @@ class ZDrawerComponent extends BasePortalOutlet {
|
|
|
216
224
|
_zTranslate = inject(ZTranslateService);
|
|
217
225
|
_overlayContainerService = inject(ZOverlayContainerService);
|
|
218
226
|
_zIndexService = inject(ZOverlayZIndexService);
|
|
227
|
+
_indexDb = inject(ZIndexDbService, { optional: true });
|
|
219
228
|
_templateOverlayRef = null;
|
|
220
229
|
_originalParent = null;
|
|
221
230
|
_originalNextSibling = null;
|
|
222
231
|
_backdropSubscription = null;
|
|
223
232
|
_closeTimeout = null;
|
|
233
|
+
_resizeCleanup = null;
|
|
234
|
+
_resizeStorageKey = null;
|
|
235
|
+
isResizing = signal(false, ...(ngDevMode ? [{ debugName: "isResizing" }] : []));
|
|
224
236
|
isLeaving = signal(false, ...(ngDevMode ? [{ debugName: "isLeaving" }] : []));
|
|
225
237
|
hasScrollableContent = signal(false, ...(ngDevMode ? [{ debugName: "hasScrollableContent" }] : []));
|
|
226
238
|
isScrolledFromTop = signal(false, ...(ngDevMode ? [{ debugName: "isScrolledFromTop" }] : []));
|
|
@@ -230,7 +242,12 @@ class ZDrawerComponent extends BasePortalOutlet {
|
|
|
230
242
|
shouldRenderContent = computed(() => this.zVisible() || this.isLeaving(), ...(ngDevMode ? [{ debugName: "shouldRenderContent" }] : []));
|
|
231
243
|
isStringContent = computed(() => typeof this.config.zContent === 'string', ...(ngDevMode ? [{ debugName: "isStringContent" }] : []));
|
|
232
244
|
_lastScrollHeight = 0;
|
|
245
|
+
_resizedWidth = signal(null, ...(ngDevMode ? [{ debugName: "_resizedWidth" }] : []));
|
|
246
|
+
_resizedHeight = signal(null, ...(ngDevMode ? [{ debugName: "_resizedHeight" }] : []));
|
|
233
247
|
ngAfterViewChecked() {
|
|
248
|
+
if (this.isServiceMode() && this._resizeStorageKey === null) {
|
|
249
|
+
void this._restoreResize();
|
|
250
|
+
}
|
|
234
251
|
this._checkScrollState();
|
|
235
252
|
}
|
|
236
253
|
_checkScrollState() {
|
|
@@ -308,6 +325,11 @@ class ZDrawerComponent extends BasePortalOutlet {
|
|
|
308
325
|
}
|
|
309
326
|
return this.zPlacement();
|
|
310
327
|
}, ...(ngDevMode ? [{ debugName: "effectivePlacement" }] : []));
|
|
328
|
+
effectiveExpand = computed(() => this.isServiceMode() ? (this.config.zExpand ?? false) : this.zExpand(), ...(ngDevMode ? [{ debugName: "effectiveExpand" }] : []));
|
|
329
|
+
resizeIcon = computed(() => {
|
|
330
|
+
const placement = this.effectivePlacement();
|
|
331
|
+
return placement === 'left' || placement === 'right' ? 'lucideGripVertical' : 'lucideGripHorizontal';
|
|
332
|
+
}, ...(ngDevMode ? [{ debugName: "resizeIcon" }] : []));
|
|
311
333
|
effectiveShadow = computed(() => {
|
|
312
334
|
if (this.isServiceMode()) {
|
|
313
335
|
return this.config.zShadow ?? false;
|
|
@@ -325,6 +347,10 @@ class ZDrawerComponent extends BasePortalOutlet {
|
|
|
325
347
|
if (placement === 'top' || placement === 'bottom') {
|
|
326
348
|
return null;
|
|
327
349
|
}
|
|
350
|
+
const resized = this._resizedWidth();
|
|
351
|
+
if (resized) {
|
|
352
|
+
return resized;
|
|
353
|
+
}
|
|
328
354
|
if (this.isServiceMode()) {
|
|
329
355
|
return this.zWidth() || this.config.zWidth || null;
|
|
330
356
|
}
|
|
@@ -335,6 +361,10 @@ class ZDrawerComponent extends BasePortalOutlet {
|
|
|
335
361
|
if (placement === 'left' || placement === 'right') {
|
|
336
362
|
return null;
|
|
337
363
|
}
|
|
364
|
+
const resized = this._resizedHeight();
|
|
365
|
+
if (resized) {
|
|
366
|
+
return resized;
|
|
367
|
+
}
|
|
338
368
|
if (this.isServiceMode()) {
|
|
339
369
|
return this.zHeight() || this.config.zHeight || null;
|
|
340
370
|
}
|
|
@@ -363,6 +393,9 @@ class ZDrawerComponent extends BasePortalOutlet {
|
|
|
363
393
|
this._zTranslate.currentLang();
|
|
364
394
|
this._cdr.markForCheck();
|
|
365
395
|
});
|
|
396
|
+
if (isPlatformBrowser(this._platformId) && this.isServiceMode()) {
|
|
397
|
+
void this._restoreResize();
|
|
398
|
+
}
|
|
366
399
|
effect(() => {
|
|
367
400
|
const scrollbar = this.mainContentRef();
|
|
368
401
|
if (scrollbar) {
|
|
@@ -382,8 +415,63 @@ class ZDrawerComponent extends BasePortalOutlet {
|
|
|
382
415
|
}
|
|
383
416
|
ngOnDestroy() {
|
|
384
417
|
this._clearCloseTimeout();
|
|
418
|
+
this._resizeCleanup?.();
|
|
385
419
|
this._disposeTemplateOverlay();
|
|
386
420
|
}
|
|
421
|
+
startResize(event) {
|
|
422
|
+
if (!this.effectiveExpand() || event.button !== 0) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
event.preventDefault();
|
|
426
|
+
this.isResizing.set(true);
|
|
427
|
+
const host = this._host.nativeElement;
|
|
428
|
+
const placement = this.effectivePlacement();
|
|
429
|
+
const horizontal = placement === 'left' || placement === 'right';
|
|
430
|
+
const startCoordinate = horizontal ? event.clientX : event.clientY;
|
|
431
|
+
const startSize = horizontal ? host.getBoundingClientRect().width : host.getBoundingClientRect().height;
|
|
432
|
+
const direction = placement === 'left' || placement === 'top' ? 1 : -1;
|
|
433
|
+
const onMove = (moveEvent) => {
|
|
434
|
+
const delta = (horizontal ? moveEvent.clientX : moveEvent.clientY) - startCoordinate;
|
|
435
|
+
const maxSize = (horizontal ? window.innerWidth : window.innerHeight) - Z_DRAWER_RESIZE_VIEWPORT_PADDING;
|
|
436
|
+
const size = Math.min(maxSize, Math.max(Z_DRAWER_RESIZE_MIN_SIZE, startSize + delta * direction));
|
|
437
|
+
const value = `${Math.round(size)}px`;
|
|
438
|
+
if (horizontal) {
|
|
439
|
+
this._resizedWidth.set(value);
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
this._resizedHeight.set(value);
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
const onUp = () => {
|
|
446
|
+
this._resizeCleanup?.();
|
|
447
|
+
this._resizeCleanup = null;
|
|
448
|
+
this.isResizing.set(false);
|
|
449
|
+
void this._persistResize();
|
|
450
|
+
};
|
|
451
|
+
window.addEventListener('pointermove', onMove);
|
|
452
|
+
window.addEventListener('pointerup', onUp, { once: true });
|
|
453
|
+
this._resizeCleanup = () => {
|
|
454
|
+
window.removeEventListener('pointermove', onMove);
|
|
455
|
+
window.removeEventListener('pointerup', onUp);
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
onHostPointerDown(event) {
|
|
459
|
+
if (!this.effectiveExpand() || event.button !== 0) {
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
const rect = this._host.nativeElement.getBoundingClientRect();
|
|
463
|
+
const placement = this.effectivePlacement();
|
|
464
|
+
const distance = placement === 'left'
|
|
465
|
+
? rect.right - event.clientX
|
|
466
|
+
: placement === 'right'
|
|
467
|
+
? event.clientX - rect.left
|
|
468
|
+
: placement === 'top'
|
|
469
|
+
? rect.bottom - event.clientY
|
|
470
|
+
: event.clientY - rect.top;
|
|
471
|
+
if (distance <= 16) {
|
|
472
|
+
this.startResize(event);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
387
475
|
isDestroyed() {
|
|
388
476
|
return this._destroyRef.destroyed;
|
|
389
477
|
}
|
|
@@ -460,6 +548,7 @@ class ZDrawerComponent extends BasePortalOutlet {
|
|
|
460
548
|
if (!this._templateOverlayRef) {
|
|
461
549
|
return;
|
|
462
550
|
}
|
|
551
|
+
void this._restoreResize();
|
|
463
552
|
this._zIndexService.applyToOverlay(this._templateOverlayRef);
|
|
464
553
|
const hostElement = this._host.nativeElement;
|
|
465
554
|
this._originalParent = hostElement.parentElement;
|
|
@@ -473,6 +562,39 @@ class ZDrawerComponent extends BasePortalOutlet {
|
|
|
473
562
|
this.onBackdropClick();
|
|
474
563
|
});
|
|
475
564
|
}
|
|
565
|
+
_getResizeKey() {
|
|
566
|
+
const title = this.effectiveTitle();
|
|
567
|
+
const titleKey = typeof title === 'string' && title.trim() ? title.trim() : 'default';
|
|
568
|
+
return `${Z_DRAWER_RESIZE_KEY_PREFIX}:${this.effectivePlacement()}:${titleKey}`;
|
|
569
|
+
}
|
|
570
|
+
async _restoreResize() {
|
|
571
|
+
if (!this._indexDb) {
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
const key = this._getResizeKey();
|
|
575
|
+
if (key === this._resizeStorageKey) {
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
this._resizeStorageKey = key;
|
|
579
|
+
const saved = await this._indexDb.get(key);
|
|
580
|
+
if (saved?.width) {
|
|
581
|
+
this._resizedWidth.set(saved.width);
|
|
582
|
+
}
|
|
583
|
+
if (saved?.height) {
|
|
584
|
+
this._resizedHeight.set(saved.height);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
async _persistResize() {
|
|
588
|
+
if (!this._indexDb) {
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
const width = this._resizedWidth();
|
|
592
|
+
const height = this._resizedHeight();
|
|
593
|
+
if (!width && !height) {
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
await this._indexDb.set(this._getResizeKey(), { width, height }).catch(() => undefined);
|
|
597
|
+
}
|
|
476
598
|
_closeWithAnimation() {
|
|
477
599
|
if (this.isLeaving()) {
|
|
478
600
|
return;
|
|
@@ -524,9 +646,9 @@ class ZDrawerComponent extends BasePortalOutlet {
|
|
|
524
646
|
}
|
|
525
647
|
}
|
|
526
648
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
527
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZDrawerComponent, isStandalone: true, selector: "z-drawer", 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 }, zHeight: { classPropertyName: "zHeight", publicName: "zHeight", isSignal: true, isRequired: false, transformFunction: null }, zPlacement: { classPropertyName: "zPlacement", publicName: "zPlacement", 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 }, zDisableShadow: { classPropertyName: "zDisableShadow", publicName: "zDisableShadow", isSignal: true, isRequired: false, transformFunction: null }, zHeaderBorder: { classPropertyName: "zHeaderBorder", publicName: "zHeaderBorder", isSignal: true, isRequired: false, transformFunction: null }, zFooterBorder: { classPropertyName: "zFooterBorder", publicName: "zFooterBorder", isSignal: true, isRequired: false, transformFunction: null }, zHideFooter: { classPropertyName: "zHideFooter", publicName: "zHideFooter", isSignal: true, isRequired: false, transformFunction: null }, zHideHeader: { classPropertyName: "zHideHeader", publicName: "zHideHeader", 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 }, zOverlay: { classPropertyName: "zOverlay", publicName: "zOverlay", isSignal: true, isRequired: false, transformFunction: null }, zShadow: { classPropertyName: "zShadow", publicName: "zShadow", isSignal: true, isRequired: false, transformFunction: null }, zShape: { classPropertyName: "zShape", publicName: "zShape", 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 } }, outputs: { zOnOk: "zOnOk", zOnCancel: "zOnCancel", zAfterClose: "zAfterClose", zScrollbar: "zScrollbar", zVisible: "zVisibleChange" }, host: { properties: { "class": "hostClasses()", "style.width": "effectiveWidth()", "style.height": "effectiveHeight()", "attr.data-placement": "effectivePlacement()" } }, providers: [TranslatePipe], queries: [{ propertyName: "customHeader", first: true, predicate: ZDrawerHeaderDirective, descendants: true, isSignal: true }, { propertyName: "customContent", first: true, predicate: ZDrawerContentDirective, descendants: true, isSignal: true }, { propertyName: "customFooter", first: true, predicate: ZDrawerFooterDirective, 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: ["zDrawer"], 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 @defer (when !effectiveContentLoading()) {\n @if (customHeader(); as headerDir) {\n <header\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\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\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\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-drawer-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-drawer-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-drawer-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-drawer-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-drawer-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\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-drawer-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n class=\"-mt-1 -mr-2 shrink-0\"\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-drawer-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main [class]=\"bodyClasses()\">\n @if (customContent(); as contentDir) {\n <ng-container *ngTemplateOutlet=\"contentDir.templateRef\" />\n } @else {\n <ng-content />\n }\n </main>\n </ng-scrollbar>\n\n @if (customFooter(); as footerDir) {\n <footer\n [class.z-drawer-footer-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-footer-border]=\"effectiveFooterBorder()\">\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\n [class.z-drawer-footer-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-footer-border]=\"effectiveFooterBorder()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n data-testid=\"z-drawer-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 data-testid=\"z-drawer-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 } @placeholder {\n <div class=\"flex flex-1 flex-col gap-4 p-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n}\n\n<!-- Service mode content -->\n@if (isServiceMode()) {\n @defer (when !effectiveContentLoading()) {\n @if (!effectiveHideHeader()) {\n @if (effectiveTitle()) {\n <header\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\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-drawer-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-drawer-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-drawer-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-drawer-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-drawer-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\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-drawer-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-drawer-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main [class]=\"bodyClasses()\">\n <ng-template cdkPortalOutlet />\n\n @if (isStringContent()) {\n <div data-testid=\"z-drawer-content\" [innerHTML]=\"$any(config.zContent) | zSafeHtml\"></div>\n }\n </main>\n </ng-scrollbar>\n\n @if (!effectiveHideFooter()) {\n <footer\n [class.z-drawer-footer-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-footer-border]=\"effectiveFooterBorder()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n data-testid=\"z-drawer-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 data-testid=\"z-drawer-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 } @placeholder {\n <div class=\"flex flex-1 flex-col gap-4 p-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n}\n", styles: [":host.z-drawer-service-mode[data-placement=left],:host.z-drawer-template-mode[data-placement=left]{--z-enter-translate-x: -100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=left].drawer-leave,:host.z-drawer-template-mode[data-placement=left].drawer-leave{--z-exit-translate-x: -100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=right],:host.z-drawer-template-mode[data-placement=right]{--z-enter-translate-x: 100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=right].drawer-leave,:host.z-drawer-template-mode[data-placement=right].drawer-leave{--z-exit-translate-x: 100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=top],:host.z-drawer-template-mode[data-placement=top]{--z-enter-translate-y: -100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=top].drawer-leave,:host.z-drawer-template-mode[data-placement=top].drawer-leave{--z-exit-translate-y: -100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=bottom],:host.z-drawer-template-mode[data-placement=bottom]{--z-enter-translate-y: 100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=bottom].drawer-leave,:host.z-drawer-template-mode[data-placement=bottom].drawer-leave{--z-exit-translate-y: 100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-template-host{display:contents}::ng-deep .z-drawer-backdrop-dark{background-color:#0009}::ng-deep .z-drawer-backdrop-blur{background-color:#0000000d;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.z-drawer-header-shadow{box-shadow:0 2px 8px -2px #0000001a;z-index:50}.z-drawer-footer-shadow{box-shadow:0 -2px 8px -2px #0000001a;z-index:50}.z-drawer-header-border{border-bottom:1px solid var(--border)}.z-drawer-footer-border{border-top:1px solid var(--border)}:host header{padding-top:1rem;padding-bottom:1rem}:host footer{padding-top:1rem;padding-bottom:1rem}:host main{overscroll-behavior:contain}:host header,:host footer{transition:box-shadow .2s ease-out}.z-drawer-scrollbar{--scrollbar-padding: .125rem}\n"], dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "component", type: ZSkeletonComponent, selector: "z-skeleton", inputs: ["class", "zType", "zSize", "zWidth", "zHeight", "zRows", "zGap", "zAnimated", "zRadius"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [NgTemplateOutlet, import('@shival99/z-ui/components/z-button').then(m => m.ZButtonComponent), import('@shival99/z-ui/components/z-icon').then(m => m.ZIconComponent), import('@shival99/z-ui/components/z-tooltip').then(m => m.ZTooltipDirective), import('ngx-scrollbar').then(m => m.NgScrollbar), import('@angular/cdk/scrolling').then(m => m.CdkScrollable), import('@shival99/z-ui/pipes').then(m => m.ZContentTypePipe), import('@shival99/z-ui/pipes').then(m => m.ZSafeHtmlPipe), TranslatePipe], () => [i1.CdkPortalOutlet, NgTemplateOutlet, import('@shival99/z-ui/components/z-button').then(m => m.ZButtonComponent), import('@shival99/z-ui/components/z-icon').then(m => m.ZIconComponent), import('@shival99/z-ui/components/z-tooltip').then(m => m.ZTooltipDirective), import('ngx-scrollbar').then(m => m.NgScrollbar), import('@angular/cdk/scrolling').then(m => m.CdkScrollable), import('@shival99/z-ui/pipes').then(m => m.ZContentTypePipe), import('@shival99/z-ui/pipes').then(m => m.ZSafeHtmlPipe), TranslatePipe]] });
|
|
649
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZDrawerComponent, isStandalone: true, selector: "z-drawer", 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 }, zHeight: { classPropertyName: "zHeight", publicName: "zHeight", isSignal: true, isRequired: false, transformFunction: null }, zPlacement: { classPropertyName: "zPlacement", publicName: "zPlacement", 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 }, zDisableShadow: { classPropertyName: "zDisableShadow", publicName: "zDisableShadow", isSignal: true, isRequired: false, transformFunction: null }, zHeaderBorder: { classPropertyName: "zHeaderBorder", publicName: "zHeaderBorder", isSignal: true, isRequired: false, transformFunction: null }, zFooterBorder: { classPropertyName: "zFooterBorder", publicName: "zFooterBorder", isSignal: true, isRequired: false, transformFunction: null }, zHideFooter: { classPropertyName: "zHideFooter", publicName: "zHideFooter", isSignal: true, isRequired: false, transformFunction: null }, zHideHeader: { classPropertyName: "zHideHeader", publicName: "zHideHeader", 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 }, zOverlay: { classPropertyName: "zOverlay", publicName: "zOverlay", isSignal: true, isRequired: false, transformFunction: null }, zShadow: { classPropertyName: "zShadow", publicName: "zShadow", isSignal: true, isRequired: false, transformFunction: null }, zShape: { classPropertyName: "zShape", publicName: "zShape", 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 }, zExpand: { classPropertyName: "zExpand", publicName: "zExpand", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zOnOk: "zOnOk", zOnCancel: "zOnCancel", zAfterClose: "zAfterClose", zScrollbar: "zScrollbar", zVisible: "zVisibleChange" }, host: { listeners: { "pointerdown": "onHostPointerDown($event)" }, properties: { "class": "hostClasses()", "style.width": "effectiveWidth()", "style.height": "effectiveHeight()", "attr.data-placement": "effectivePlacement()", "class.z-drawer-resizing": "isResizing()" } }, providers: [TranslatePipe], queries: [{ propertyName: "customHeader", first: true, predicate: ZDrawerHeaderDirective, descendants: true, isSignal: true }, { propertyName: "customContent", first: true, predicate: ZDrawerContentDirective, descendants: true, isSignal: true }, { propertyName: "customFooter", first: true, predicate: ZDrawerFooterDirective, 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: ["zDrawer"], 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 @defer (when !effectiveContentLoading()) {\n @if (customHeader(); as headerDir) {\n <header\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\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\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\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-drawer-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-drawer-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-drawer-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-drawer-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-drawer-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\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-drawer-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n class=\"-mt-1 -mr-2 shrink-0\"\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-drawer-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main [class]=\"bodyClasses()\">\n @if (customContent(); as contentDir) {\n <ng-container *ngTemplateOutlet=\"contentDir.templateRef\" />\n } @else {\n <ng-content />\n }\n </main>\n </ng-scrollbar>\n\n @if (customFooter(); as footerDir) {\n <footer\n [class.z-drawer-footer-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-footer-border]=\"effectiveFooterBorder()\">\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\n [class.z-drawer-footer-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-footer-border]=\"effectiveFooterBorder()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n data-testid=\"z-drawer-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 data-testid=\"z-drawer-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 } @placeholder {\n <div class=\"flex flex-1 flex-col gap-4 p-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n}\n\n@if (effectiveExpand()) {\n <button\n type=\"button\"\n class=\"z-drawer-resize-handle\"\n [attr.data-placement]=\"effectivePlacement()\"\n [attr.aria-label]=\"'i18n_z_ui_drawer_resize' | translate\"\n (pointerdown)=\"$event.stopPropagation(); startResize($event)\">\n <z-icon [zType]=\"$any(resizeIcon())\" zSize=\"14\" />\n </button>\n}\n\n<!-- Service mode content -->\n@if (isServiceMode()) {\n @defer (when !effectiveContentLoading()) {\n @if (!effectiveHideHeader()) {\n @if (effectiveTitle()) {\n <header\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\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-drawer-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-drawer-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-drawer-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-drawer-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-drawer-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\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-drawer-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-drawer-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main [class]=\"bodyClasses()\">\n <ng-template cdkPortalOutlet />\n\n @if (isStringContent()) {\n <div data-testid=\"z-drawer-content\" [innerHTML]=\"$any(config.zContent) | zSafeHtml\"></div>\n }\n </main>\n </ng-scrollbar>\n\n @if (!effectiveHideFooter()) {\n <footer\n [class.z-drawer-footer-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-footer-border]=\"effectiveFooterBorder()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n data-testid=\"z-drawer-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 data-testid=\"z-drawer-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 } @placeholder {\n <div class=\"flex flex-1 flex-col gap-4 p-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n}\n", styles: [":host.z-drawer-service-mode[data-placement=left],:host.z-drawer-template-mode[data-placement=left]{--z-enter-translate-x: -100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=left].drawer-leave,:host.z-drawer-template-mode[data-placement=left].drawer-leave{--z-exit-translate-x: -100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=right],:host.z-drawer-template-mode[data-placement=right]{--z-enter-translate-x: 100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=right].drawer-leave,:host.z-drawer-template-mode[data-placement=right].drawer-leave{--z-exit-translate-x: 100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=top],:host.z-drawer-template-mode[data-placement=top]{--z-enter-translate-y: -100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=top].drawer-leave,:host.z-drawer-template-mode[data-placement=top].drawer-leave{--z-exit-translate-y: -100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=bottom],:host.z-drawer-template-mode[data-placement=bottom]{--z-enter-translate-y: 100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=bottom].drawer-leave,:host.z-drawer-template-mode[data-placement=bottom].drawer-leave{--z-exit-translate-y: 100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-template-host{display:contents}::ng-deep .z-drawer-backdrop-dark{background-color:#0009}::ng-deep .z-drawer-backdrop-blur{background-color:#0000000d;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.z-drawer-header-shadow{box-shadow:0 2px 8px -2px #0000001a;z-index:50}.z-drawer-footer-shadow{box-shadow:0 -2px 8px -2px #0000001a;z-index:50}.z-drawer-header-border{border-bottom:1px solid var(--border)}.z-drawer-footer-border{border-top:1px solid var(--border)}:host header{padding-top:1rem;padding-bottom:1rem}:host footer{padding-top:1rem;padding-bottom:1rem}:host main{overscroll-behavior:contain}:host header,:host footer{transition:box-shadow .2s ease-out}.z-drawer-scrollbar{--scrollbar-padding: .125rem}.z-drawer-resize-handle{position:absolute;z-index:60;display:flex;align-items:center;justify-content:center;width:10px;height:100%;padding:0;color:var(--muted-foreground);cursor:col-resize;opacity:0;border:0;background:transparent;pointer-events:auto;transition:opacity .15s ease,border-color .15s ease}.z-drawer-resize-handle:after{position:absolute;content:\"\";background:var(--primary);opacity:0;transition:opacity .15s ease}.z-drawer-resize-handle>z-icon{position:absolute;z-index:1;opacity:0;transition:opacity .15s ease}.z-drawer-resize-handle:hover,.z-drawer-resize-handle:focus-visible{opacity:1;color:var(--primary);outline:none}.z-drawer-resize-handle:hover:after,.z-drawer-resize-handle:focus-visible:after{opacity:1}.z-drawer-resize-handle:hover>z-icon,.z-drawer-resize-handle:focus-visible>z-icon{opacity:1}.z-drawer-resize-handle[data-placement=left]{right:-7px;top:0;bottom:0;width:10px;cursor:col-resize}.z-drawer-resize-handle[data-placement=right]{left:-7px;top:0;bottom:0;width:16px;cursor:col-resize}.z-drawer-resize-handle[data-placement=top]{bottom:-7px;left:0;right:0;width:auto;height:16px;cursor:row-resize}.z-drawer-resize-handle[data-placement=bottom]{top:-7px;left:0;right:0;width:auto;height:16px;cursor:row-resize}.z-drawer-resize-handle[data-placement=left]:after,.z-drawer-resize-handle[data-placement=right]:after{top:50%;left:50%;width:2px;height:100px;transform:translate(-50%,-50%)}.z-drawer-resize-handle[data-placement=top]:after,.z-drawer-resize-handle[data-placement=bottom]:after{top:50%;left:50%;width:100px;height:2px;transform:translate(-50%,-50%)}.z-drawer-resize-handle[data-placement=left]>z-icon,.z-drawer-resize-handle[data-placement=right]>z-icon{top:50%;left:50%;transform:translate(-50%,-50%)}.z-drawer-resize-handle[data-placement=top]>z-icon,.z-drawer-resize-handle[data-placement=bottom]>z-icon{top:50%;left:50%;transform:translate(-50%,-50%)}:host.z-drawer-resizing .z-drawer-resize-handle{opacity:1;color:var(--primary)}:host.z-drawer-resizing .z-drawer-resize-handle:after,:host.z-drawer-resizing .z-drawer-resize-handle>z-icon{opacity:1}:host.z-drawer-service-mode,:host.z-drawer-template-mode{overflow:visible}\n"], dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "component", type: ZSkeletonComponent, selector: "z-skeleton", inputs: ["class", "zType", "zSize", "zWidth", "zHeight", "zRows", "zGap", "zAnimated", "zRadius"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [NgTemplateOutlet, import('@shival99/z-ui/components/z-button').then(m => m.ZButtonComponent), ZIconComponent, import('@shival99/z-ui/components/z-tooltip').then(m => m.ZTooltipDirective), import('ngx-scrollbar').then(m => m.NgScrollbar), import('@angular/cdk/scrolling').then(m => m.CdkScrollable), import('@shival99/z-ui/pipes').then(m => m.ZContentTypePipe), import('@shival99/z-ui/pipes').then(m => m.ZSafeHtmlPipe), TranslatePipe], () => [i1.CdkPortalOutlet, NgTemplateOutlet, import('@shival99/z-ui/components/z-button').then(m => m.ZButtonComponent), ZIconComponent, import('@shival99/z-ui/components/z-tooltip').then(m => m.ZTooltipDirective), import('ngx-scrollbar').then(m => m.NgScrollbar), import('@angular/cdk/scrolling').then(m => m.CdkScrollable), import('@shival99/z-ui/pipes').then(m => m.ZContentTypePipe), import('@shival99/z-ui/pipes').then(m => m.ZSafeHtmlPipe), TranslatePipe]] });
|
|
528
650
|
}
|
|
529
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.0.9", ngImport: i0, type: ZDrawerComponent, resolveDeferredDeps: () => [import('@shival99/z-ui/components/z-button').then(m => m.ZButtonComponent), import('@shival99/z-ui/components/z-
|
|
651
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.0.9", ngImport: i0, type: ZDrawerComponent, resolveDeferredDeps: () => [import('@shival99/z-ui/components/z-button').then(m => m.ZButtonComponent), import('@shival99/z-ui/components/z-tooltip').then(m => m.ZTooltipDirective), import('ngx-scrollbar').then(m => m.NgScrollbar), import('@angular/cdk/scrolling').then(m => m.CdkScrollable), import('@shival99/z-ui/pipes').then(m => m.ZContentTypePipe), import('@shival99/z-ui/pipes').then(m => m.ZSafeHtmlPipe)], resolveMetadata: (ZButtonComponent, ZTooltipDirective, NgScrollbar, CdkScrollable, ZContentTypePipe, ZSafeHtmlPipe) => ({ decorators: [{
|
|
530
652
|
type: Component,
|
|
531
653
|
args: [{ selector: 'z-drawer', imports: [
|
|
532
654
|
PortalModule,
|
|
@@ -545,8 +667,10 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.0.9", ng
|
|
|
545
667
|
'[style.width]': 'effectiveWidth()',
|
|
546
668
|
'[style.height]': 'effectiveHeight()',
|
|
547
669
|
'[attr.data-placement]': 'effectivePlacement()',
|
|
548
|
-
}, exportAs: 'zDrawer', 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 @defer (when !effectiveContentLoading()) {\n @if (customHeader(); as headerDir) {\n <header\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\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\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\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-drawer-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-drawer-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-drawer-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-drawer-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-drawer-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\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-drawer-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n class=\"-mt-1 -mr-2 shrink-0\"\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-drawer-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main [class]=\"bodyClasses()\">\n @if (customContent(); as contentDir) {\n <ng-container *ngTemplateOutlet=\"contentDir.templateRef\" />\n } @else {\n <ng-content />\n }\n </main>\n </ng-scrollbar>\n\n @if (customFooter(); as footerDir) {\n <footer\n [class.z-drawer-footer-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-footer-border]=\"effectiveFooterBorder()\">\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\n [class.z-drawer-footer-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-footer-border]=\"effectiveFooterBorder()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n data-testid=\"z-drawer-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 data-testid=\"z-drawer-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 } @placeholder {\n <div class=\"flex flex-1 flex-col gap-4 p-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n}\n\n<!-- Service mode content -->\n@if (isServiceMode()) {\n @defer (when !effectiveContentLoading()) {\n @if (!effectiveHideHeader()) {\n @if (effectiveTitle()) {\n <header\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\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-drawer-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-drawer-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-drawer-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-drawer-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-drawer-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\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-drawer-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-drawer-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main [class]=\"bodyClasses()\">\n <ng-template cdkPortalOutlet />\n\n @if (isStringContent()) {\n <div data-testid=\"z-drawer-content\" [innerHTML]=\"$any(config.zContent) | zSafeHtml\"></div>\n }\n </main>\n </ng-scrollbar>\n\n @if (!effectiveHideFooter()) {\n <footer\n [class.z-drawer-footer-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-footer-border]=\"effectiveFooterBorder()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n data-testid=\"z-drawer-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 data-testid=\"z-drawer-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 } @placeholder {\n <div class=\"flex flex-1 flex-col gap-4 p-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n}\n", styles: [":host.z-drawer-service-mode[data-placement=left],:host.z-drawer-template-mode[data-placement=left]{--z-enter-translate-x: -100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=left].drawer-leave,:host.z-drawer-template-mode[data-placement=left].drawer-leave{--z-exit-translate-x: -100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=right],:host.z-drawer-template-mode[data-placement=right]{--z-enter-translate-x: 100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=right].drawer-leave,:host.z-drawer-template-mode[data-placement=right].drawer-leave{--z-exit-translate-x: 100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=top],:host.z-drawer-template-mode[data-placement=top]{--z-enter-translate-y: -100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=top].drawer-leave,:host.z-drawer-template-mode[data-placement=top].drawer-leave{--z-exit-translate-y: -100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=bottom],:host.z-drawer-template-mode[data-placement=bottom]{--z-enter-translate-y: 100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=bottom].drawer-leave,:host.z-drawer-template-mode[data-placement=bottom].drawer-leave{--z-exit-translate-y: 100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-template-host{display:contents}::ng-deep .z-drawer-backdrop-dark{background-color:#0009}::ng-deep .z-drawer-backdrop-blur{background-color:#0000000d;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.z-drawer-header-shadow{box-shadow:0 2px 8px -2px #0000001a;z-index:50}.z-drawer-footer-shadow{box-shadow:0 -2px 8px -2px #0000001a;z-index:50}.z-drawer-header-border{border-bottom:1px solid var(--border)}.z-drawer-footer-border{border-top:1px solid var(--border)}:host header{padding-top:1rem;padding-bottom:1rem}:host footer{padding-top:1rem;padding-bottom:1rem}:host main{overscroll-behavior:contain}:host header,:host footer{transition:box-shadow .2s ease-out}.z-drawer-scrollbar{--scrollbar-padding: .125rem}\n"] }]
|
|
549
|
-
|
|
670
|
+
'(pointerdown)': 'onHostPointerDown($event)',
|
|
671
|
+
'[class.z-drawer-resizing]': 'isResizing()',
|
|
672
|
+
}, exportAs: 'zDrawer', 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 @defer (when !effectiveContentLoading()) {\n @if (customHeader(); as headerDir) {\n <header\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\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\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\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-drawer-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-drawer-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-drawer-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-drawer-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-drawer-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\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-drawer-close-header-button\"\n z-button\n zType=\"subtle\"\n zSize=\"xs\"\n class=\"-mt-1 -mr-2 shrink-0\"\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-drawer-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main [class]=\"bodyClasses()\">\n @if (customContent(); as contentDir) {\n <ng-container *ngTemplateOutlet=\"contentDir.templateRef\" />\n } @else {\n <ng-content />\n }\n </main>\n </ng-scrollbar>\n\n @if (customFooter(); as footerDir) {\n <footer\n [class.z-drawer-footer-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-footer-border]=\"effectiveFooterBorder()\">\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\n [class.z-drawer-footer-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-footer-border]=\"effectiveFooterBorder()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n data-testid=\"z-drawer-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 data-testid=\"z-drawer-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 } @placeholder {\n <div class=\"flex flex-1 flex-col gap-4 p-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n}\n\n@if (effectiveExpand()) {\n <button\n type=\"button\"\n class=\"z-drawer-resize-handle\"\n [attr.data-placement]=\"effectivePlacement()\"\n [attr.aria-label]=\"'i18n_z_ui_drawer_resize' | translate\"\n (pointerdown)=\"$event.stopPropagation(); startResize($event)\">\n <z-icon [zType]=\"$any(resizeIcon())\" zSize=\"14\" />\n </button>\n}\n\n<!-- Service mode content -->\n@if (isServiceMode()) {\n @defer (when !effectiveContentLoading()) {\n @if (!effectiveHideHeader()) {\n @if (effectiveTitle()) {\n <header\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\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-drawer-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-drawer-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-drawer-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-drawer-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-drawer-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\n [class.z-drawer-header-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-header-border]=\"effectiveHeaderBorder()\">\n <div class=\"flex justify-end px-4\">\n <button\n type=\"button\"\n data-testid=\"z-drawer-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-drawer-scrollbar flex-1\"\n #mainContent\n track=\"vertical\"\n cdkScrollable\n (scroll)=\"onContentScroll($event)\">\n <main [class]=\"bodyClasses()\">\n <ng-template cdkPortalOutlet />\n\n @if (isStringContent()) {\n <div data-testid=\"z-drawer-content\" [innerHTML]=\"$any(config.zContent) | zSafeHtml\"></div>\n }\n </main>\n </ng-scrollbar>\n\n @if (!effectiveHideFooter()) {\n <footer\n [class.z-drawer-footer-shadow]=\"shouldShowShadow()\"\n [class.z-drawer-footer-border]=\"effectiveFooterBorder()\">\n <div class=\"flex flex-row justify-end gap-2 px-4\">\n @if (effectiveCancelText() !== null) {\n <button\n type=\"button\"\n data-testid=\"z-drawer-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 data-testid=\"z-drawer-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 } @placeholder {\n <div class=\"flex flex-1 flex-col gap-4 p-4\">\n <z-skeleton class=\"h-full\" [zRows]=\"effectiveSkeletonRows()\" />\n </div>\n }\n}\n", styles: [":host.z-drawer-service-mode[data-placement=left],:host.z-drawer-template-mode[data-placement=left]{--z-enter-translate-x: -100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=left].drawer-leave,:host.z-drawer-template-mode[data-placement=left].drawer-leave{--z-exit-translate-x: -100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=right],:host.z-drawer-template-mode[data-placement=right]{--z-enter-translate-x: 100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=right].drawer-leave,:host.z-drawer-template-mode[data-placement=right].drawer-leave{--z-exit-translate-x: 100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=top],:host.z-drawer-template-mode[data-placement=top]{--z-enter-translate-y: -100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=top].drawer-leave,:host.z-drawer-template-mode[data-placement=top].drawer-leave{--z-exit-translate-y: -100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=bottom],:host.z-drawer-template-mode[data-placement=bottom]{--z-enter-translate-y: 100%;animation:z-enter .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-service-mode[data-placement=bottom].drawer-leave,:host.z-drawer-template-mode[data-placement=bottom].drawer-leave{--z-exit-translate-y: 100%;animation:z-exit .25s cubic-bezier(.16,1,.3,1) forwards}:host.z-drawer-template-host{display:contents}::ng-deep .z-drawer-backdrop-dark{background-color:#0009}::ng-deep .z-drawer-backdrop-blur{background-color:#0000000d;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.z-drawer-header-shadow{box-shadow:0 2px 8px -2px #0000001a;z-index:50}.z-drawer-footer-shadow{box-shadow:0 -2px 8px -2px #0000001a;z-index:50}.z-drawer-header-border{border-bottom:1px solid var(--border)}.z-drawer-footer-border{border-top:1px solid var(--border)}:host header{padding-top:1rem;padding-bottom:1rem}:host footer{padding-top:1rem;padding-bottom:1rem}:host main{overscroll-behavior:contain}:host header,:host footer{transition:box-shadow .2s ease-out}.z-drawer-scrollbar{--scrollbar-padding: .125rem}.z-drawer-resize-handle{position:absolute;z-index:60;display:flex;align-items:center;justify-content:center;width:10px;height:100%;padding:0;color:var(--muted-foreground);cursor:col-resize;opacity:0;border:0;background:transparent;pointer-events:auto;transition:opacity .15s ease,border-color .15s ease}.z-drawer-resize-handle:after{position:absolute;content:\"\";background:var(--primary);opacity:0;transition:opacity .15s ease}.z-drawer-resize-handle>z-icon{position:absolute;z-index:1;opacity:0;transition:opacity .15s ease}.z-drawer-resize-handle:hover,.z-drawer-resize-handle:focus-visible{opacity:1;color:var(--primary);outline:none}.z-drawer-resize-handle:hover:after,.z-drawer-resize-handle:focus-visible:after{opacity:1}.z-drawer-resize-handle:hover>z-icon,.z-drawer-resize-handle:focus-visible>z-icon{opacity:1}.z-drawer-resize-handle[data-placement=left]{right:-7px;top:0;bottom:0;width:10px;cursor:col-resize}.z-drawer-resize-handle[data-placement=right]{left:-7px;top:0;bottom:0;width:16px;cursor:col-resize}.z-drawer-resize-handle[data-placement=top]{bottom:-7px;left:0;right:0;width:auto;height:16px;cursor:row-resize}.z-drawer-resize-handle[data-placement=bottom]{top:-7px;left:0;right:0;width:auto;height:16px;cursor:row-resize}.z-drawer-resize-handle[data-placement=left]:after,.z-drawer-resize-handle[data-placement=right]:after{top:50%;left:50%;width:2px;height:100px;transform:translate(-50%,-50%)}.z-drawer-resize-handle[data-placement=top]:after,.z-drawer-resize-handle[data-placement=bottom]:after{top:50%;left:50%;width:100px;height:2px;transform:translate(-50%,-50%)}.z-drawer-resize-handle[data-placement=left]>z-icon,.z-drawer-resize-handle[data-placement=right]>z-icon{top:50%;left:50%;transform:translate(-50%,-50%)}.z-drawer-resize-handle[data-placement=top]>z-icon,.z-drawer-resize-handle[data-placement=bottom]>z-icon{top:50%;left:50%;transform:translate(-50%,-50%)}:host.z-drawer-resizing .z-drawer-resize-handle{opacity:1;color:var(--primary)}:host.z-drawer-resizing .z-drawer-resize-handle:after,:host.z-drawer-resizing .z-drawer-resize-handle>z-icon{opacity:1}:host.z-drawer-service-mode,:host.z-drawer-template-mode{overflow:visible}\n"] }]
|
|
673
|
+
}], ctorParameters: () => [], propDecorators: { zOnOk: [{ type: i0.Output, args: ["zOnOk"] }], zOnCancel: [{ type: i0.Output, args: ["zOnCancel"] }], 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 }] }], zHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "zHeight", required: false }] }], zPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "zPlacement", required: false }] }], zClosable: [{ type: i0.Input, args: [{ isSignal: true, alias: "zClosable", required: false }] }], zMaskClosable: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMaskClosable", required: false }] }], zDisableShadow: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDisableShadow", required: false }] }], zHeaderBorder: [{ type: i0.Input, args: [{ isSignal: true, alias: "zHeaderBorder", required: false }] }], zFooterBorder: [{ type: i0.Input, args: [{ isSignal: true, alias: "zFooterBorder", required: false }] }], zHideFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "zHideFooter", required: false }] }], zHideHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "zHideHeader", 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 }] }], zOverlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOverlay", required: false }] }], zShadow: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShadow", required: false }] }], zShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShape", required: false }] }], zContentLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "zContentLoading", required: false }] }], zSkeletonRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSkeletonRows", required: false }] }], zExpand: [{ type: i0.Input, args: [{ isSignal: true, alias: "zExpand", required: false }] }], customHeader: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ZDrawerHeaderDirective), { isSignal: true }] }], customContent: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ZDrawerContentDirective), { isSignal: true }] }], customFooter: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ZDrawerFooterDirective), { 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 }] }] } }) });
|
|
550
674
|
|
|
551
675
|
let ZDrawerRef = class ZDrawerRef {
|
|
552
676
|
_overlayRef;
|