@shival99/z-ui 2.6.8 → 2.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs +1211 -0
  2. package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs.map +1 -0
  3. package/fesm2022/shival99-z-ui-components-z-drawer.mjs +991 -0
  4. package/fesm2022/shival99-z-ui-components-z-drawer.mjs.map +1 -0
  5. package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs +99 -0
  6. package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs.map +1 -0
  7. package/fesm2022/shival99-z-ui-components-z-editor.mjs +16 -6
  8. package/fesm2022/shival99-z-ui-components-z-editor.mjs.map +1 -1
  9. package/fesm2022/shival99-z-ui-components-z-filter.mjs +962 -0
  10. package/fesm2022/shival99-z-ui-components-z-filter.mjs.map +1 -0
  11. package/fesm2022/shival99-z-ui-components-z-gallery.mjs +2 -2
  12. package/fesm2022/shival99-z-ui-components-z-gallery.mjs.map +1 -1
  13. package/fesm2022/shival99-z-ui-components-z-number-ticker.mjs +352 -0
  14. package/fesm2022/shival99-z-ui-components-z-number-ticker.mjs.map +1 -0
  15. package/fesm2022/shival99-z-ui-components-z-pagination.mjs +179 -0
  16. package/fesm2022/shival99-z-ui-components-z-pagination.mjs.map +1 -0
  17. package/fesm2022/shival99-z-ui-components-z-qrcode.mjs +429 -0
  18. package/fesm2022/shival99-z-ui-components-z-qrcode.mjs.map +1 -0
  19. package/fesm2022/shival99-z-ui-components-z-radio.mjs +183 -0
  20. package/fesm2022/shival99-z-ui-components-z-radio.mjs.map +1 -0
  21. package/fesm2022/shival99-z-ui-components-z-scrollarea.mjs +137 -0
  22. package/fesm2022/shival99-z-ui-components-z-scrollarea.mjs.map +1 -0
  23. package/fesm2022/shival99-z-ui-components-z-show-more.mjs +138 -0
  24. package/fesm2022/shival99-z-ui-components-z-show-more.mjs.map +1 -0
  25. package/fesm2022/shival99-z-ui-components-z-skeleton-auto.mjs +80 -0
  26. package/fesm2022/shival99-z-ui-components-z-skeleton-auto.mjs.map +1 -0
  27. package/fesm2022/shival99-z-ui-components-z-steps.mjs +420 -0
  28. package/fesm2022/shival99-z-ui-components-z-steps.mjs.map +1 -0
  29. package/fesm2022/shival99-z-ui-components-z-table.mjs +11424 -0
  30. package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -0
  31. package/fesm2022/shival99-z-ui-components-z-tabs.mjs +1102 -0
  32. package/fesm2022/shival99-z-ui-components-z-tabs.mjs.map +1 -0
  33. package/fesm2022/shival99-z-ui-components-z-tags.mjs +364 -0
  34. package/fesm2022/shival99-z-ui-components-z-tags.mjs.map +1 -0
  35. package/fesm2022/shival99-z-ui-components-z-timeline.mjs +254 -0
  36. package/fesm2022/shival99-z-ui-components-z-timeline.mjs.map +1 -0
  37. package/fesm2022/shival99-z-ui-services-excel.mjs +672 -0
  38. package/fesm2022/shival99-z-ui-services-excel.mjs.map +1 -0
  39. package/package.json +1 -1
  40. package/types/shival99-z-ui-components-z-autocomplete.d.ts +301 -0
  41. package/types/shival99-z-ui-components-z-drawer.d.ts +298 -0
  42. package/types/shival99-z-ui-components-z-dropdown-menu.d.ts +52 -0
  43. package/types/shival99-z-ui-components-z-editor.d.ts +3 -3
  44. package/types/shival99-z-ui-components-z-filter.d.ts +285 -0
  45. package/types/shival99-z-ui-components-z-modal.d.ts +1 -1
  46. package/types/shival99-z-ui-components-z-number-ticker.d.ts +110 -0
  47. package/types/shival99-z-ui-components-z-pagination.d.ts +55 -0
  48. package/types/shival99-z-ui-components-z-qrcode.d.ts +79 -0
  49. package/types/shival99-z-ui-components-z-radio.d.ts +69 -0
  50. package/types/shival99-z-ui-components-z-scrollarea.d.ts +48 -0
  51. package/types/shival99-z-ui-components-z-show-more.d.ts +36 -0
  52. package/types/shival99-z-ui-components-z-skeleton-auto.d.ts +35 -0
  53. package/types/shival99-z-ui-components-z-steps.d.ts +106 -0
  54. package/types/shival99-z-ui-components-z-table.d.ts +2386 -0
  55. package/types/shival99-z-ui-components-z-tabs.d.ts +196 -0
  56. package/types/shival99-z-ui-components-z-tags.d.ts +127 -0
  57. package/types/shival99-z-ui-components-z-timeline.d.ts +71 -0
  58. package/types/shival99-z-ui-services-excel.d.ts +36 -0
@@ -0,0 +1,991 @@
1
+ import { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, TemplateRef, Directive, InjectionToken, output, input, model, booleanAttribute, contentChild, signal, viewChild, ViewContainerRef, PLATFORM_ID, ElementRef, ChangeDetectorRef, DestroyRef, computed, effect, ChangeDetectionStrategy, Component, EventEmitter, Inject, Injector, Injectable } from '@angular/core';
4
+ import { TranslatePipe } from '@ngx-translate/core';
5
+ import { ZIconComponent } from '@shival99/z-ui/components/z-icon';
6
+ import { ZOverlayService } from '@shival99/z-ui/components/z-overlay';
7
+ import { ZSkeletonComponent } from '@shival99/z-ui/components/z-skeleton';
8
+ import { ZTranslateService, ZOverlayContainerService, ZOverlayZIndexService, ZIndexDbService } from '@shival99/z-ui/services';
9
+ import { zDetectBrowser, zMergeClasses } from '@shival99/z-ui/utils';
10
+ import { cva } from 'class-variance-authority';
11
+ import { __decorate, __param, __metadata } from 'tslib';
12
+ import { Subject, takeUntil, fromEvent, filter } from 'rxjs';
13
+
14
+ class ZDrawerContentDirective {
15
+ templateRef = inject((TemplateRef));
16
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZDrawerContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
17
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: ZDrawerContentDirective, isStandalone: true, selector: "[z-drawer-content], [zDrawerContent]", ngImport: i0 });
18
+ }
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZDrawerContentDirective, decorators: [{
20
+ type: Directive,
21
+ args: [{
22
+ selector: '[z-drawer-content], [zDrawerContent]',
23
+ standalone: true,
24
+ }]
25
+ }] });
26
+
27
+ class ZDrawerFooterDirective {
28
+ templateRef = inject((TemplateRef));
29
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZDrawerFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
30
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: ZDrawerFooterDirective, isStandalone: true, selector: "[z-drawer-footer], [zDrawerFooter]", ngImport: i0 });
31
+ }
32
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZDrawerFooterDirective, decorators: [{
33
+ type: Directive,
34
+ args: [{
35
+ selector: '[z-drawer-footer], [zDrawerFooter]',
36
+ standalone: true,
37
+ }]
38
+ }] });
39
+
40
+ class ZDrawerHeaderDirective {
41
+ templateRef = inject((TemplateRef));
42
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZDrawerHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
43
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: ZDrawerHeaderDirective, isStandalone: true, selector: "[z-drawer-header], [zDrawerHeader]", ngImport: i0 });
44
+ }
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZDrawerHeaderDirective, decorators: [{
46
+ type: Directive,
47
+ args: [{
48
+ selector: '[z-drawer-header], [zDrawerHeader]',
49
+ standalone: true,
50
+ }]
51
+ }] });
52
+
53
+ /* eslint-disable @typescript-eslint/no-explicit-any */
54
+ const Z_DRAWER_DATA = new InjectionToken('Z_DRAWER_DATA');
55
+ const Z_DRAWER_ANIMATION_DURATION = 450;
56
+ const Z_DRAWER_RESIZE_MIN_SIZE = 240;
57
+ const Z_DRAWER_RESIZE_VIEWPORT_PADDING = 32;
58
+ const Z_DRAWER_RESIZE_KEY_PREFIX = 'z-drawer-resize';
59
+ var ZDrawerTriggerAction;
60
+ (function (ZDrawerTriggerAction) {
61
+ ZDrawerTriggerAction["CANCEL"] = "cancel";
62
+ ZDrawerTriggerAction["OK"] = "ok";
63
+ })(ZDrawerTriggerAction || (ZDrawerTriggerAction = {}));
64
+
65
+ /**
66
+ * Configuration options for z-drawer component.
67
+ *
68
+ * @template T - The type of the content component
69
+ * @template U - The type of the data passed to the drawer
70
+ */
71
+ class ZDrawerOptions {
72
+ /** Icon for the cancel button */
73
+ zCancelIcon;
74
+ /** Text for the cancel button. Set to null to hide the button */
75
+ zCancelText;
76
+ /** Whether the drawer is closable (shows close button) */
77
+ zClosable;
78
+ /** Drawer content - can be a component, template, or string */
79
+ zContent;
80
+ /** Custom CSS classes for the drawer */
81
+ class;
82
+ /** Custom CSS classes for the drawer body */
83
+ zBodyClass;
84
+ /** Data to be passed to the content component via Z_DRAWER_DATA token */
85
+ zData;
86
+ /**
87
+ * Observable for deferred data loading before showing drawer content.
88
+ * Drawer will show a loading spinner until the Observable completes.
89
+ * The resolved data will be available via Z_DRAWER_DATA.
90
+ */
91
+ zDefer;
92
+ /** Description text shown below the title */
93
+ zDescription;
94
+ /** Whether to disable the header and footer shadows */
95
+ zDisableShadow;
96
+ /** Whether to show a border below the header */
97
+ zHeaderBorder;
98
+ /** Whether to show a border above the footer */
99
+ zFooterBorder;
100
+ /** Whether to hide the default footer */
101
+ zHideFooter;
102
+ /** Whether to hide the default header */
103
+ zHideHeader;
104
+ /**
105
+ * WritableSignal to control loading state of the OK button.
106
+ * Use this when submitting forms or calling APIs.
107
+ */
108
+ zLoading;
109
+ /** Whether clicking mask closes the drawer */
110
+ zMaskClosable;
111
+ /** Whether OK button has destructive (red) style */
112
+ zOkDestructive;
113
+ /** Whether OK button is disabled */
114
+ zOkDisabled;
115
+ /** Overlay style: 'dark' (black overlay) or 'blur' (backdrop blur) */
116
+ zOverlay;
117
+ /** Icon for the OK button */
118
+ zOkIcon;
119
+ /** Text for the OK button. Set to null to hide the button */
120
+ zOkText;
121
+ /** Callback or EventEmitter when cancel is clicked */
122
+ zOnCancel = () => { };
123
+ /** Callback or EventEmitter when OK is clicked */
124
+ zOnOk = () => { };
125
+ /** Drawer title - supports string, HTML string, or TemplateRef */
126
+ zTitle;
127
+ /** ViewContainerRef for the drawer portal */
128
+ zViewContainerRef;
129
+ /** Drawer width for left/right placement (e.g., '400px', '80%') */
130
+ zWidth;
131
+ /** Drawer height for top/bottom placement (e.g., '400px', '50%') */
132
+ zHeight;
133
+ /** Placement of the drawer: 'left', 'right', 'top', 'bottom' */
134
+ zPlacement;
135
+ /** Force shadow on header/footer regardless of scroll state */
136
+ zShadow;
137
+ /** Shape of the drawer: 'rounded' (with border-radius) or 'square' (no border-radius) */
138
+ zShape;
139
+ /** WritableSignal to control content loading state (shows skeleton when true) */
140
+ zContentLoading;
141
+ /** Number of skeleton rows to show when content is loading (default: 5 for left/right, 3 for top/bottom) */
142
+ zSkeletonRows;
143
+ /** Whether the drawer can be resized from its outer edge */
144
+ zExpand;
145
+ /** Scroll ownership: the drawer viewport by default, or an inner content viewport */
146
+ zScrollMode;
147
+ }
148
+
149
+ const getOverlayType = () => {
150
+ const browser = zDetectBrowser();
151
+ return browser.name === 'Chrome' ? 'dark' : 'blur';
152
+ };
153
+
154
+ const zDrawerVariants = cva(['fixed z-50 flex flex-col bg-background overflow-hidden'].join(' '), {
155
+ variants: {
156
+ placement: {
157
+ left: 'left-0 top-0 h-full max-w-[90vw] dark:border-r shadow-[3px_0_10px_rgba(0,0,0,0.08)]',
158
+ right: 'right-0 top-0 h-full max-w-[90vw] dark:border-l shadow-[-3px_0_10px_rgba(0,0,0,0.08)]',
159
+ top: 'top-0 left-0 w-full max-h-[90vh] dark:border-b shadow-[0_3px_10px_rgba(0,0,0,0.08)]',
160
+ bottom: 'bottom-0 left-0 w-full max-h-[90vh] dark:border-t shadow-[0_-3px_10px_rgba(0,0,0,0.08)]',
161
+ },
162
+ shape: {
163
+ rounded: '',
164
+ square: '',
165
+ },
166
+ },
167
+ compoundVariants: [
168
+ { placement: 'left', shape: 'rounded', class: 'rounded-r-lg' },
169
+ { placement: 'right', shape: 'rounded', class: 'rounded-l-lg' },
170
+ { placement: 'top', shape: 'rounded', class: 'rounded-b-lg' },
171
+ { placement: 'bottom', shape: 'rounded', class: 'rounded-t-lg' },
172
+ ],
173
+ defaultVariants: {
174
+ placement: 'right',
175
+ shape: 'rounded',
176
+ },
177
+ });
178
+
179
+ class ZDrawerComponent {
180
+ zOnOk = output();
181
+ zOnCancel = output();
182
+ zAfterClose = output();
183
+ zScrollbar = output();
184
+ class = input('', /* @ts-ignore */
185
+ ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
186
+ zBodyClass = input('', /* @ts-ignore */
187
+ ...(ngDevMode ? [{ debugName: "zBodyClass" }] : /* istanbul ignore next */ []));
188
+ zVisible = model(false, /* @ts-ignore */
189
+ ...(ngDevMode ? [{ debugName: "zVisible" }] : /* istanbul ignore next */ []));
190
+ zTitle = input(/* @ts-ignore */
191
+ ...(ngDevMode ? [undefined, { debugName: "zTitle" }] : /* istanbul ignore next */ []));
192
+ zDescription = input(/* @ts-ignore */
193
+ ...(ngDevMode ? [undefined, { debugName: "zDescription" }] : /* istanbul ignore next */ []));
194
+ zWidth = input('400px', /* @ts-ignore */
195
+ ...(ngDevMode ? [{ debugName: "zWidth" }] : /* istanbul ignore next */ []));
196
+ zHeight = input('400px', /* @ts-ignore */
197
+ ...(ngDevMode ? [{ debugName: "zHeight" }] : /* istanbul ignore next */ []));
198
+ zPlacement = input('right', /* @ts-ignore */
199
+ ...(ngDevMode ? [{ debugName: "zPlacement" }] : /* istanbul ignore next */ []));
200
+ zClosable = input(true, /* @ts-ignore */
201
+ ...(ngDevMode ? [{ debugName: "zClosable" }] : /* istanbul ignore next */ []));
202
+ zMaskClosable = input(true, /* @ts-ignore */
203
+ ...(ngDevMode ? [{ debugName: "zMaskClosable" }] : /* istanbul ignore next */ []));
204
+ zDisableShadow = input(false, /* @ts-ignore */
205
+ ...(ngDevMode ? [{ debugName: "zDisableShadow" }] : /* istanbul ignore next */ []));
206
+ zHeaderBorder = input(false, /* @ts-ignore */
207
+ ...(ngDevMode ? [{ debugName: "zHeaderBorder" }] : /* istanbul ignore next */ []));
208
+ zFooterBorder = input(false, /* @ts-ignore */
209
+ ...(ngDevMode ? [{ debugName: "zFooterBorder" }] : /* istanbul ignore next */ []));
210
+ zHideFooter = input(false, /* @ts-ignore */
211
+ ...(ngDevMode ? [{ debugName: "zHideFooter" }] : /* istanbul ignore next */ []));
212
+ zHideHeader = input(false, /* @ts-ignore */
213
+ ...(ngDevMode ? [{ debugName: "zHideHeader" }] : /* istanbul ignore next */ []));
214
+ zOkText = input(null, /* @ts-ignore */
215
+ ...(ngDevMode ? [{ debugName: "zOkText" }] : /* istanbul ignore next */ []));
216
+ zCancelText = input(null, /* @ts-ignore */
217
+ ...(ngDevMode ? [{ debugName: "zCancelText" }] : /* istanbul ignore next */ []));
218
+ zOkDestructive = input(false, /* @ts-ignore */
219
+ ...(ngDevMode ? [{ debugName: "zOkDestructive" }] : /* istanbul ignore next */ []));
220
+ zOkDisabled = input(false, /* @ts-ignore */
221
+ ...(ngDevMode ? [{ debugName: "zOkDisabled" }] : /* istanbul ignore next */ []));
222
+ zLoading = input(false, /* @ts-ignore */
223
+ ...(ngDevMode ? [{ debugName: "zLoading" }] : /* istanbul ignore next */ []));
224
+ zOverlay = input(getOverlayType(), /* @ts-ignore */
225
+ ...(ngDevMode ? [{ debugName: "zOverlay" }] : /* istanbul ignore next */ []));
226
+ zShadow = input(false, /* @ts-ignore */
227
+ ...(ngDevMode ? [{ debugName: "zShadow" }] : /* istanbul ignore next */ []));
228
+ zShape = input('rounded', /* @ts-ignore */
229
+ ...(ngDevMode ? [{ debugName: "zShape" }] : /* istanbul ignore next */ []));
230
+ zContentLoading = input(false, /* @ts-ignore */
231
+ ...(ngDevMode ? [{ debugName: "zContentLoading" }] : /* istanbul ignore next */ []));
232
+ zSkeletonRows = input(null, /* @ts-ignore */
233
+ ...(ngDevMode ? [{ debugName: "zSkeletonRows" }] : /* istanbul ignore next */ []));
234
+ zExpand = input(false, { ...(ngDevMode ? { debugName: "zExpand" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
235
+ zScrollMode = input('drawer', /* @ts-ignore */
236
+ ...(ngDevMode ? [{ debugName: "zScrollMode" }] : /* istanbul ignore next */ []));
237
+ customHeader = contentChild(ZDrawerHeaderDirective, /* @ts-ignore */
238
+ ...(ngDevMode ? [{ debugName: "customHeader" }] : /* istanbul ignore next */ []));
239
+ customContent = contentChild(ZDrawerContentDirective, /* @ts-ignore */
240
+ ...(ngDevMode ? [{ debugName: "customContent" }] : /* istanbul ignore next */ []));
241
+ customFooter = contentChild(ZDrawerFooterDirective, /* @ts-ignore */
242
+ ...(ngDevMode ? [{ debugName: "customFooter" }] : /* istanbul ignore next */ []));
243
+ _drawerRef = signal(undefined, /* @ts-ignore */
244
+ ...(ngDevMode ? [{ debugName: "_drawerRef" }] : /* istanbul ignore next */ []));
245
+ get drawerRef() {
246
+ return this._drawerRef();
247
+ }
248
+ set drawerRef(value) {
249
+ this._drawerRef.set(value);
250
+ }
251
+ contentOutlet = viewChild('contentOutlet', { ...(ngDevMode ? { debugName: "contentOutlet" } : /* istanbul ignore next */ {}), read: ViewContainerRef });
252
+ mainContentRef = viewChild('mainContent', /* @ts-ignore */
253
+ ...(ngDevMode ? [{ debugName: "mainContentRef" }] : /* istanbul ignore next */ []));
254
+ /**
255
+ * Content requested before `#contentOutlet` exists.
256
+ * `@defer` renders the outlet after its dependencies load, so the first open can arrive early.
257
+ */
258
+ _pendingContent = null;
259
+ config = inject((ZDrawerOptions), { optional: true }) || new ZDrawerOptions();
260
+ _platformId = inject(PLATFORM_ID);
261
+ _host = inject((ElementRef));
262
+ _overlayService = inject(ZOverlayService);
263
+ _cdr = inject(ChangeDetectorRef);
264
+ _destroyRef = inject(DestroyRef);
265
+ _zTranslate = inject(ZTranslateService);
266
+ _overlayContainerService = inject(ZOverlayContainerService);
267
+ _zIndexService = inject(ZOverlayZIndexService);
268
+ _indexDb = inject(ZIndexDbService, { optional: true });
269
+ _templateOverlayRef = null;
270
+ _originalParent = null;
271
+ _originalNextSibling = null;
272
+ _backdropSubscription = null;
273
+ _closeTimeout = null;
274
+ _resizeCleanup = null;
275
+ _resizeStorageKey = null;
276
+ isResizing = signal(false, /* @ts-ignore */
277
+ ...(ngDevMode ? [{ debugName: "isResizing" }] : /* istanbul ignore next */ []));
278
+ isLeaving = signal(false, /* @ts-ignore */
279
+ ...(ngDevMode ? [{ debugName: "isLeaving" }] : /* istanbul ignore next */ []));
280
+ hasScrollableContent = signal(false, /* @ts-ignore */
281
+ ...(ngDevMode ? [{ debugName: "hasScrollableContent" }] : /* istanbul ignore next */ []));
282
+ isScrolledFromTop = signal(false, /* @ts-ignore */
283
+ ...(ngDevMode ? [{ debugName: "isScrolledFromTop" }] : /* istanbul ignore next */ []));
284
+ isScrolledToBottom = signal(false, /* @ts-ignore */
285
+ ...(ngDevMode ? [{ debugName: "isScrolledToBottom" }] : /* istanbul ignore next */ []));
286
+ isServiceMode = computed(() => !!this._drawerRef(), /* @ts-ignore */
287
+ ...(ngDevMode ? [{ debugName: "isServiceMode" }] : /* istanbul ignore next */ []));
288
+ isTemplateMode = computed(() => !this.isServiceMode(), /* @ts-ignore */
289
+ ...(ngDevMode ? [{ debugName: "isTemplateMode" }] : /* istanbul ignore next */ []));
290
+ shouldRenderContent = computed(() => this.zVisible() || this.isLeaving(), /* @ts-ignore */
291
+ ...(ngDevMode ? [{ debugName: "shouldRenderContent" }] : /* istanbul ignore next */ []));
292
+ isStringContent = computed(() => typeof this.config.zContent === 'string', /* @ts-ignore */
293
+ ...(ngDevMode ? [{ debugName: "isStringContent" }] : /* istanbul ignore next */ []));
294
+ _lastScrollHeight = 0;
295
+ _resizedWidth = signal(null, /* @ts-ignore */
296
+ ...(ngDevMode ? [{ debugName: "_resizedWidth" }] : /* istanbul ignore next */ []));
297
+ _resizedHeight = signal(null, /* @ts-ignore */
298
+ ...(ngDevMode ? [{ debugName: "_resizedHeight" }] : /* istanbul ignore next */ []));
299
+ ngAfterViewChecked() {
300
+ if (this.isServiceMode() && this._resizeStorageKey === null) {
301
+ void this._restoreResize();
302
+ }
303
+ this._checkScrollState();
304
+ }
305
+ _checkScrollState() {
306
+ const scrollbar = this.mainContentRef();
307
+ if (!scrollbar) {
308
+ return;
309
+ }
310
+ const viewport = scrollbar.nativeElement.querySelector('.ng-scroll-viewport');
311
+ if (!viewport) {
312
+ return;
313
+ }
314
+ if (viewport.scrollHeight === this._lastScrollHeight) {
315
+ return;
316
+ }
317
+ this._lastScrollHeight = viewport.scrollHeight;
318
+ const hasVerticalScroll = viewport.scrollHeight > viewport.clientHeight;
319
+ this.hasScrollableContent.set(hasVerticalScroll);
320
+ }
321
+ onContentScroll(event) {
322
+ const target = event.target;
323
+ if (!target) {
324
+ return;
325
+ }
326
+ const { scrollTop } = target;
327
+ const { scrollHeight } = target;
328
+ const { clientHeight } = target;
329
+ this.isScrolledFromTop.set(scrollTop > 0);
330
+ this.isScrolledToBottom.set(scrollTop + clientHeight >= scrollHeight - 1);
331
+ }
332
+ effectiveTitle = computed(() => {
333
+ this._zTranslate.currentLang();
334
+ return this.isServiceMode() ? this.config.zTitle : this.zTitle();
335
+ }, /* @ts-ignore */
336
+ ...(ngDevMode ? [{ debugName: "effectiveTitle" }] : /* istanbul ignore next */ []));
337
+ effectiveDescription = computed(() => this.isServiceMode() ? this.config.zDescription : this.zDescription(), /* @ts-ignore */
338
+ ...(ngDevMode ? [{ debugName: "effectiveDescription" }] : /* istanbul ignore next */ []));
339
+ hasEffectiveDescription = computed(() => !!this.effectiveDescription(), /* @ts-ignore */
340
+ ...(ngDevMode ? [{ debugName: "hasEffectiveDescription" }] : /* istanbul ignore next */ []));
341
+ headerContentClasses = computed(() => zMergeClasses('flex w-full justify-between overflow-hidden px-4', this.hasEffectiveDescription() ? 'items-start' : 'items-center'), /* @ts-ignore */
342
+ ...(ngDevMode ? [{ debugName: "headerContentClasses" }] : /* istanbul ignore next */ []));
343
+ effectiveBodyClass = computed(() => this.isServiceMode() ? this.config.zBodyClass : this.zBodyClass(), /* @ts-ignore */
344
+ ...(ngDevMode ? [{ debugName: "effectiveBodyClass" }] : /* istanbul ignore next */ []));
345
+ bodyClasses = computed(() => {
346
+ const hideHeader = this.effectiveHideHeader();
347
+ const hideFooter = this.effectiveHideFooter();
348
+ const bodySpacingClass = hideHeader && hideFooter ? 'py-0' : hideHeader ? 'pt-0' : hideFooter ? 'pb-0' : '';
349
+ return zMergeClasses('flex min-h-0 flex-col gap-4 px-4 py-4', this.effectiveBodyClass(), bodySpacingClass);
350
+ }, /* @ts-ignore */
351
+ ...(ngDevMode ? [{ debugName: "bodyClasses" }] : /* istanbul ignore next */ []));
352
+ effectiveClosable = computed(() => this.isServiceMode() ? (this.config.zClosable ?? true) : this.zClosable(), /* @ts-ignore */
353
+ ...(ngDevMode ? [{ debugName: "effectiveClosable" }] : /* istanbul ignore next */ []));
354
+ effectiveDisableShadow = computed(() => this.isServiceMode() ? (this.config.zDisableShadow ?? false) : this.zDisableShadow(), /* @ts-ignore */
355
+ ...(ngDevMode ? [{ debugName: "effectiveDisableShadow" }] : /* istanbul ignore next */ []));
356
+ shouldShowShadow = computed(() => !this.effectiveDisableShadow(), /* @ts-ignore */
357
+ ...(ngDevMode ? [{ debugName: "shouldShowShadow" }] : /* istanbul ignore next */ []));
358
+ effectiveHeaderBorder = computed(() => this.isServiceMode() ? (this.config.zHeaderBorder ?? false) : this.zHeaderBorder(), /* @ts-ignore */
359
+ ...(ngDevMode ? [{ debugName: "effectiveHeaderBorder" }] : /* istanbul ignore next */ []));
360
+ effectiveFooterBorder = computed(() => this.isServiceMode() ? (this.config.zFooterBorder ?? false) : this.zFooterBorder(), /* @ts-ignore */
361
+ ...(ngDevMode ? [{ debugName: "effectiveFooterBorder" }] : /* istanbul ignore next */ []));
362
+ effectiveHideFooter = computed(() => this.isServiceMode() ? this.config.zHideFooter : this.zHideFooter(), /* @ts-ignore */
363
+ ...(ngDevMode ? [{ debugName: "effectiveHideFooter" }] : /* istanbul ignore next */ []));
364
+ effectiveHideHeader = computed(() => this.isServiceMode() ? (this.config.zHideHeader ?? false) : this.zHideHeader(), /* @ts-ignore */
365
+ ...(ngDevMode ? [{ debugName: "effectiveHideHeader" }] : /* istanbul ignore next */ []));
366
+ effectiveOkText = computed(() => (this.isServiceMode() ? this.config.zOkText : this.zOkText()), /* @ts-ignore */
367
+ ...(ngDevMode ? [{ debugName: "effectiveOkText" }] : /* istanbul ignore next */ []));
368
+ effectiveCancelText = computed(() => this.isServiceMode() ? this.config.zCancelText : this.zCancelText(), /* @ts-ignore */
369
+ ...(ngDevMode ? [{ debugName: "effectiveCancelText" }] : /* istanbul ignore next */ []));
370
+ effectiveOkDestructive = computed(() => this.isServiceMode() ? this.config.zOkDestructive : this.zOkDestructive(), /* @ts-ignore */
371
+ ...(ngDevMode ? [{ debugName: "effectiveOkDestructive" }] : /* istanbul ignore next */ []));
372
+ effectiveOkDisabled = computed(() => this.isServiceMode() ? this.config.zOkDisabled : this.zOkDisabled(), /* @ts-ignore */
373
+ ...(ngDevMode ? [{ debugName: "effectiveOkDisabled" }] : /* istanbul ignore next */ []));
374
+ effectiveLoading = computed(() => {
375
+ if (this.isServiceMode()) {
376
+ return this.drawerRef?.loading() || (this.config.zLoading?.() ?? false);
377
+ }
378
+ return this.zLoading();
379
+ }, /* @ts-ignore */
380
+ ...(ngDevMode ? [{ debugName: "effectiveLoading" }] : /* istanbul ignore next */ []));
381
+ effectiveContentLoading = computed(() => {
382
+ if (this.isServiceMode()) {
383
+ return this.config.zContentLoading?.() ?? false;
384
+ }
385
+ return this.zContentLoading();
386
+ }, /* @ts-ignore */
387
+ ...(ngDevMode ? [{ debugName: "effectiveContentLoading" }] : /* istanbul ignore next */ []));
388
+ effectiveSkeletonRows = computed(() => {
389
+ if (this.isServiceMode() && this.config.zSkeletonRows != null) {
390
+ return this.config.zSkeletonRows;
391
+ }
392
+ if (this.zSkeletonRows() != null) {
393
+ return this.zSkeletonRows();
394
+ }
395
+ const placement = this.effectivePlacement();
396
+ return placement === 'left' || placement === 'right' ? 6 : 3;
397
+ }, /* @ts-ignore */
398
+ ...(ngDevMode ? [{ debugName: "effectiveSkeletonRows" }] : /* istanbul ignore next */ []));
399
+ effectivePlacement = computed(() => {
400
+ if (this.isServiceMode()) {
401
+ return this.config.zPlacement ?? 'right';
402
+ }
403
+ return this.zPlacement();
404
+ }, /* @ts-ignore */
405
+ ...(ngDevMode ? [{ debugName: "effectivePlacement" }] : /* istanbul ignore next */ []));
406
+ effectiveExpand = computed(() => this.isServiceMode() ? (this.config.zExpand ?? false) : this.zExpand(), /* @ts-ignore */
407
+ ...(ngDevMode ? [{ debugName: "effectiveExpand" }] : /* istanbul ignore next */ []));
408
+ effectiveScrollMode = computed(() => this.isServiceMode() ? (this.config.zScrollMode ?? 'drawer') : this.zScrollMode(), /* @ts-ignore */
409
+ ...(ngDevMode ? [{ debugName: "effectiveScrollMode" }] : /* istanbul ignore next */ []));
410
+ isInnerScrollMode = computed(() => this.effectiveScrollMode() === 'inner', /* @ts-ignore */
411
+ ...(ngDevMode ? [{ debugName: "isInnerScrollMode" }] : /* istanbul ignore next */ []));
412
+ resizeIcon = computed(() => {
413
+ const placement = this.effectivePlacement();
414
+ return placement === 'left' || placement === 'right' ? 'lucideGripVertical' : 'lucideGripHorizontal';
415
+ }, /* @ts-ignore */
416
+ ...(ngDevMode ? [{ debugName: "resizeIcon" }] : /* istanbul ignore next */ []));
417
+ effectiveShadow = computed(() => {
418
+ if (this.isServiceMode()) {
419
+ return this.config.zShadow ?? false;
420
+ }
421
+ return this.zShadow();
422
+ }, /* @ts-ignore */
423
+ ...(ngDevMode ? [{ debugName: "effectiveShadow" }] : /* istanbul ignore next */ []));
424
+ effectiveShape = computed(() => {
425
+ if (this.isServiceMode()) {
426
+ return this.config.zShape ?? 'rounded';
427
+ }
428
+ return this.zShape();
429
+ }, /* @ts-ignore */
430
+ ...(ngDevMode ? [{ debugName: "effectiveShape" }] : /* istanbul ignore next */ []));
431
+ effectiveWidth = computed(() => {
432
+ const placement = this.effectivePlacement();
433
+ if (placement === 'top' || placement === 'bottom') {
434
+ return null;
435
+ }
436
+ const resized = this._resizedWidth();
437
+ if (resized) {
438
+ return resized;
439
+ }
440
+ if (this.isServiceMode()) {
441
+ return this.zWidth() || this.config.zWidth || null;
442
+ }
443
+ return this.shouldRenderContent() ? this.zWidth() : null;
444
+ }, /* @ts-ignore */
445
+ ...(ngDevMode ? [{ debugName: "effectiveWidth" }] : /* istanbul ignore next */ []));
446
+ effectiveHeight = computed(() => {
447
+ const placement = this.effectivePlacement();
448
+ if (placement === 'left' || placement === 'right') {
449
+ return null;
450
+ }
451
+ const resized = this._resizedHeight();
452
+ if (resized) {
453
+ return resized;
454
+ }
455
+ if (this.isServiceMode()) {
456
+ return this.zHeight() || this.config.zHeight || null;
457
+ }
458
+ return this.shouldRenderContent() ? this.zHeight() : null;
459
+ }, /* @ts-ignore */
460
+ ...(ngDevMode ? [{ debugName: "effectiveHeight" }] : /* istanbul ignore next */ []));
461
+ isDeferLoading = computed(() => {
462
+ if (!this.isServiceMode()) {
463
+ return false;
464
+ }
465
+ return !!this.config.zDefer && !this.contentOutlet()?.length;
466
+ }, /* @ts-ignore */
467
+ ...(ngDevMode ? [{ debugName: "isDeferLoading" }] : /* istanbul ignore next */ []));
468
+ classes = computed(() => zMergeClasses(zDrawerVariants({ placement: this.effectivePlacement(), shape: this.effectiveShape() }), this.isServiceMode() ? this.config.class : this.class()), /* @ts-ignore */
469
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
470
+ hostClasses = computed(() => {
471
+ const baseClasses = this.classes();
472
+ const scrollModeClass = this.isInnerScrollMode() ? 'z-drawer-inner-scroll-mode' : '';
473
+ if (this.isServiceMode()) {
474
+ return zMergeClasses(`${baseClasses} z-drawer-service-mode`, scrollModeClass);
475
+ }
476
+ if (this.shouldRenderContent()) {
477
+ return zMergeClasses(`${baseClasses} z-drawer-template-mode`, scrollModeClass);
478
+ }
479
+ return zMergeClasses('z-drawer-template-host', scrollModeClass);
480
+ }, /* @ts-ignore */
481
+ ...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
482
+ constructor() {
483
+ effect(() => {
484
+ this._zTranslate.currentLang();
485
+ this._cdr.markForCheck();
486
+ });
487
+ // The signal query reruns when `@defer` creates the outlet.
488
+ effect(() => {
489
+ this._attachPendingContent(this.contentOutlet());
490
+ });
491
+ if (isPlatformBrowser(this._platformId) && this.isServiceMode()) {
492
+ void this._restoreResize();
493
+ }
494
+ effect(() => {
495
+ const scrollbar = this.mainContentRef();
496
+ if (scrollbar) {
497
+ this.zScrollbar.emit(scrollbar);
498
+ }
499
+ });
500
+ effect(() => {
501
+ const visible = this.zVisible();
502
+ if (visible && this.isTemplateMode() && !this._templateOverlayRef) {
503
+ this._openTemplateOverlay();
504
+ return;
505
+ }
506
+ if (!visible && this.isTemplateMode() && this._templateOverlayRef && !this.isLeaving()) {
507
+ this._closeWithAnimation();
508
+ }
509
+ });
510
+ }
511
+ ngOnDestroy() {
512
+ this._clearCloseTimeout();
513
+ this._resizeCleanup?.();
514
+ this._disposeTemplateOverlay();
515
+ }
516
+ startResize(event) {
517
+ if (!this.effectiveExpand() || event.button !== 0) {
518
+ return;
519
+ }
520
+ event.preventDefault();
521
+ this.isResizing.set(true);
522
+ const host = this._host.nativeElement;
523
+ const placement = this.effectivePlacement();
524
+ const horizontal = placement === 'left' || placement === 'right';
525
+ const startCoordinate = horizontal ? event.clientX : event.clientY;
526
+ const startSize = horizontal ? host.getBoundingClientRect().width : host.getBoundingClientRect().height;
527
+ const direction = placement === 'left' || placement === 'top' ? 1 : -1;
528
+ const onMove = (moveEvent) => {
529
+ const delta = (horizontal ? moveEvent.clientX : moveEvent.clientY) - startCoordinate;
530
+ const maxSize = (horizontal ? window.innerWidth : window.innerHeight) - Z_DRAWER_RESIZE_VIEWPORT_PADDING;
531
+ const size = Math.min(maxSize, Math.max(Z_DRAWER_RESIZE_MIN_SIZE, startSize + delta * direction));
532
+ const value = `${Math.round(size)}px`;
533
+ if (horizontal) {
534
+ this._resizedWidth.set(value);
535
+ }
536
+ else {
537
+ this._resizedHeight.set(value);
538
+ }
539
+ };
540
+ const onUp = () => {
541
+ this._resizeCleanup?.();
542
+ this._resizeCleanup = null;
543
+ this.isResizing.set(false);
544
+ void this._persistResize();
545
+ };
546
+ window.addEventListener('pointermove', onMove);
547
+ window.addEventListener('pointerup', onUp, { once: true });
548
+ this._resizeCleanup = () => {
549
+ window.removeEventListener('pointermove', onMove);
550
+ window.removeEventListener('pointerup', onUp);
551
+ };
552
+ }
553
+ onHostPointerDown(event) {
554
+ if (!this.effectiveExpand() || event.button !== 0) {
555
+ return;
556
+ }
557
+ const rect = this._host.nativeElement.getBoundingClientRect();
558
+ const placement = this.effectivePlacement();
559
+ const distance = placement === 'left'
560
+ ? rect.right - event.clientX
561
+ : placement === 'right'
562
+ ? event.clientX - rect.left
563
+ : placement === 'top'
564
+ ? rect.bottom - event.clientY
565
+ : event.clientY - rect.top;
566
+ if (distance <= 16) {
567
+ this.startResize(event);
568
+ }
569
+ }
570
+ isDestroyed() {
571
+ return this._destroyRef.destroyed;
572
+ }
573
+ getNativeElement() {
574
+ return this._host.nativeElement;
575
+ }
576
+ attachComponentPortal(component, injector) {
577
+ this._cdr.detectChanges();
578
+ const outlet = this.contentOutlet();
579
+ if (outlet && outlet.length > 0) {
580
+ throw new Error('Attempting to attach drawer content after content is already attached');
581
+ }
582
+ if (!outlet) {
583
+ this._pendingContent = { kind: 'component', component: component, injector };
584
+ return undefined;
585
+ }
586
+ return outlet.createComponent(component, { injector });
587
+ }
588
+ attachTemplatePortal(templateRef, context) {
589
+ const outlet = this.contentOutlet();
590
+ if (outlet && outlet.length > 0) {
591
+ throw new Error('Attempting to attach drawer content after content is already attached');
592
+ }
593
+ if (!outlet) {
594
+ this._pendingContent = { kind: 'template', templateRef: templateRef, context };
595
+ return undefined;
596
+ }
597
+ return outlet.createEmbeddedView(templateRef, context);
598
+ }
599
+ /**
600
+ * Attach pending content when the outlet exists and update `drawerRef.componentInstance`.
601
+ */
602
+ _attachPendingContent(outlet) {
603
+ const pending = this._pendingContent;
604
+ if (!outlet || !pending || outlet.length > 0) {
605
+ return;
606
+ }
607
+ this._pendingContent = null;
608
+ if (pending.kind === 'component') {
609
+ const contentRef = outlet.createComponent(pending.component, { injector: pending.injector });
610
+ const { drawerRef } = this;
611
+ if (drawerRef) {
612
+ drawerRef.componentInstance = contentRef.instance;
613
+ }
614
+ contentRef.changeDetectorRef.detectChanges();
615
+ return;
616
+ }
617
+ outlet.createEmbeddedView(pending.templateRef, pending.context).detectChanges();
618
+ }
619
+ onOkClick() {
620
+ if (this.effectiveLoading()) {
621
+ return;
622
+ }
623
+ this.zOnOk.emit();
624
+ }
625
+ onCloseClick() {
626
+ if (this.effectiveLoading()) {
627
+ return;
628
+ }
629
+ this.zOnCancel.emit();
630
+ if (this.isTemplateMode()) {
631
+ this._closeWithAnimation();
632
+ }
633
+ }
634
+ onBackdropClick() {
635
+ if (this.zMaskClosable() && !this.effectiveLoading()) {
636
+ this.zOnCancel.emit();
637
+ this._closeWithAnimation();
638
+ }
639
+ }
640
+ open() {
641
+ this.isLeaving.set(false);
642
+ this.zVisible.set(true);
643
+ }
644
+ close() {
645
+ this._closeWithAnimation();
646
+ }
647
+ _createOverlay() {
648
+ if (!isPlatformBrowser(this._platformId)) {
649
+ return null;
650
+ }
651
+ const overlayType = this.zOverlay();
652
+ const backdropClass = overlayType === 'blur' ? 'z-drawer-backdrop-blur' : 'z-drawer-backdrop-dark';
653
+ return this._overlayService.createGlobal({
654
+ hasBackdrop: true,
655
+ backdropClass,
656
+ panelClass: 'z-drawer-overlay-pane',
657
+ scrollLock: true,
658
+ });
659
+ }
660
+ _openTemplateOverlay() {
661
+ if (this._templateOverlayRef) {
662
+ return;
663
+ }
664
+ this._templateOverlayRef = this._createOverlay();
665
+ if (!this._templateOverlayRef) {
666
+ return;
667
+ }
668
+ void this._restoreResize();
669
+ this._zIndexService.applyToOverlay(this._templateOverlayRef);
670
+ const hostElement = this._host.nativeElement;
671
+ this._originalParent = hostElement.parentElement;
672
+ this._originalNextSibling = hostElement.nextSibling;
673
+ this._templateOverlayRef.overlayElement.appendChild(hostElement);
674
+ this._backdropSubscription = this._templateOverlayRef.backdropClick().subscribe(() => {
675
+ this.onBackdropClick();
676
+ });
677
+ }
678
+ _getResizeKey() {
679
+ const title = this.effectiveTitle();
680
+ const titleKey = typeof title === 'string' && title.trim() ? title.trim() : 'default';
681
+ return `${Z_DRAWER_RESIZE_KEY_PREFIX}:${this.effectivePlacement()}:${titleKey}`;
682
+ }
683
+ async _restoreResize() {
684
+ if (!this._indexDb) {
685
+ return;
686
+ }
687
+ const key = this._getResizeKey();
688
+ if (key === this._resizeStorageKey) {
689
+ return;
690
+ }
691
+ this._resizeStorageKey = key;
692
+ const saved = await this._indexDb.get(key);
693
+ if (saved?.width) {
694
+ this._resizedWidth.set(saved.width);
695
+ }
696
+ if (saved?.height) {
697
+ this._resizedHeight.set(saved.height);
698
+ }
699
+ }
700
+ async _persistResize() {
701
+ if (!this._indexDb) {
702
+ return;
703
+ }
704
+ const width = this._resizedWidth();
705
+ const height = this._resizedHeight();
706
+ if (!width && !height) {
707
+ return;
708
+ }
709
+ await this._indexDb.set(this._getResizeKey(), { width, height }).catch(() => undefined);
710
+ }
711
+ _closeWithAnimation() {
712
+ if (this.isLeaving()) {
713
+ return;
714
+ }
715
+ this._overlayContainerService.notifyClosing();
716
+ this.isLeaving.set(true);
717
+ this.zVisible.set(false);
718
+ const hostElement = this._host.nativeElement;
719
+ const { backdropElement } = this._templateOverlayRef ?? {};
720
+ if (backdropElement) {
721
+ backdropElement.classList.add('z-backdrop-leaving');
722
+ }
723
+ hostElement.classList.add('drawer-leave');
724
+ this._clearCloseTimeout();
725
+ this._closeTimeout = setTimeout(() => {
726
+ if (this._destroyRef.destroyed) {
727
+ return;
728
+ }
729
+ this.isLeaving.set(false);
730
+ this._disposeTemplateOverlay();
731
+ this.zAfterClose.emit();
732
+ }, Z_DRAWER_ANIMATION_DURATION);
733
+ }
734
+ _clearCloseTimeout() {
735
+ if (!this._closeTimeout) {
736
+ return;
737
+ }
738
+ clearTimeout(this._closeTimeout);
739
+ this._closeTimeout = null;
740
+ }
741
+ _disposeTemplateOverlay() {
742
+ const hostElement = this._host.nativeElement;
743
+ if (this._originalParent && this._originalNextSibling) {
744
+ this._originalParent.insertBefore(hostElement, this._originalNextSibling);
745
+ }
746
+ if (this._originalParent && !this._originalNextSibling) {
747
+ this._originalParent.appendChild(hostElement);
748
+ }
749
+ hostElement.classList.remove('drawer-leave');
750
+ if (this._templateOverlayRef) {
751
+ this._templateOverlayRef.dispose();
752
+ this._templateOverlayRef = null;
753
+ }
754
+ this._originalParent = null;
755
+ this._originalNextSibling = null;
756
+ if (this._backdropSubscription) {
757
+ this._backdropSubscription.unsubscribe();
758
+ this._backdropSubscription = null;
759
+ }
760
+ }
761
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
762
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", 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 }, zScrollMode: { classPropertyName: "zScrollMode", publicName: "zScrollMode", 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: "contentOutlet", first: true, predicate: ["contentOutlet"], descendants: true, read: ViewContainerRef, isSignal: true }, { propertyName: "mainContentRef", first: true, predicate: ["mainContent"], descendants: true, isSignal: true }], exportAs: ["zDrawer"], ngImport: i0, template: "<!-- 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 #contentOutlet />\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: ["@charset \"UTF-8\";:host.z-drawer-service-mode,:host.z-drawer-template-mode{pointer-events:auto}:host.z-drawer-service-mode[data-placement=left],:host.z-drawer-template-mode[data-placement=left]{--z-enter-translate-x: -100%;animation:z-enter .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,1) forwards}:host.z-drawer-template-host{display:contents}::ng-deep .z-drawer-backdrop-dark{background-color:#0009;animation:z-backdrop-enter .45s cubic-bezier(.32,.72,0,1) forwards}::ng-deep .z-drawer-backdrop-blur{background-color:#0000000d;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:z-backdrop-enter .45s cubic-bezier(.32,.72,0,1) forwards}::ng-deep .z-drawer-backdrop-dark.z-backdrop-leaving,::ng-deep .z-drawer-backdrop-blur.z-backdrop-leaving{animation:z-backdrop-exit .45s cubic-bezier(.32,.72,0,1) forwards}.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-container-offset: 0px;--scrollbar-track-offset: 0px}:host.z-drawer-inner-scroll-mode .z-drawer-scrollbar{height:100%;min-height:0;flex:1 1 0%;overflow:hidden auto}:host.z-drawer-inner-scroll-mode main{box-sizing:border-box;display:flex;min-height:100%;flex:1 1 0%;flex-direction:column}:host.z-drawer-inner-scroll-mode ::ng-deep .z-drawer-scrollbar .ng-scroll-content{display:flex;min-height:100%;flex-direction:column}.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: "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, /* @ts-ignore */
763
+ import('@shival99/z-ui/components/z-button').then(m => m.ZButtonComponent), ZIconComponent, /* @ts-ignore */
764
+ import('@shival99/z-ui/components/z-tooltip').then(m => m.ZTooltipDirective), /* @ts-ignore */
765
+ import('ngx-scrollbar').then(m => m.NgScrollbar), /* @ts-ignore */
766
+ import('@angular/cdk/scrolling').then(m => m.CdkScrollable), /* @ts-ignore */
767
+ import('@shival99/z-ui/pipes').then(m => m.ZContentTypePipe), /* @ts-ignore */
768
+ import('@shival99/z-ui/pipes').then(m => m.ZSafeHtmlPipe), TranslatePipe], () => [NgTemplateOutlet, /* @ts-ignore */
769
+ import('@shival99/z-ui/components/z-button').then(m => m.ZButtonComponent), ZIconComponent, /* @ts-ignore */
770
+ import('@shival99/z-ui/components/z-tooltip').then(m => m.ZTooltipDirective), /* @ts-ignore */
771
+ import('ngx-scrollbar').then(m => m.NgScrollbar), /* @ts-ignore */
772
+ import('@angular/cdk/scrolling').then(m => m.CdkScrollable), /* @ts-ignore */
773
+ import('@shival99/z-ui/pipes').then(m => m.ZContentTypePipe), /* @ts-ignore */
774
+ import('@shival99/z-ui/pipes').then(m => m.ZSafeHtmlPipe), TranslatePipe]] });
775
+ }
776
+ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "22.1.6", ngImport: i0, type: ZDrawerComponent, resolveDeferredDeps: () => [/* @ts-ignore */
777
+ import('@shival99/z-ui/components/z-button').then(m => m.ZButtonComponent), /* @ts-ignore */
778
+ import('@shival99/z-ui/components/z-tooltip').then(m => m.ZTooltipDirective), /* @ts-ignore */
779
+ import('ngx-scrollbar').then(m => m.NgScrollbar), /* @ts-ignore */
780
+ import('@angular/cdk/scrolling').then(m => m.CdkScrollable), /* @ts-ignore */
781
+ import('@shival99/z-ui/pipes').then(m => m.ZContentTypePipe), /* @ts-ignore */
782
+ import('@shival99/z-ui/pipes').then(m => m.ZSafeHtmlPipe)], resolveMetadata: (ZButtonComponent, ZTooltipDirective, NgScrollbar, CdkScrollable, ZContentTypePipe, ZSafeHtmlPipe) => ({ decorators: [{
783
+ type: Component,
784
+ args: [{ selector: 'z-drawer', imports: [
785
+ NgTemplateOutlet,
786
+ ZButtonComponent,
787
+ ZIconComponent,
788
+ ZContentTypePipe,
789
+ ZTooltipDirective,
790
+ ZSkeletonComponent,
791
+ NgScrollbar,
792
+ ZSafeHtmlPipe,
793
+ TranslatePipe,
794
+ CdkScrollable,
795
+ ], standalone: true, providers: [TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
796
+ '[class]': 'hostClasses()',
797
+ '[style.width]': 'effectiveWidth()',
798
+ '[style.height]': 'effectiveHeight()',
799
+ '[attr.data-placement]': 'effectivePlacement()',
800
+ '(pointerdown)': 'onHostPointerDown($event)',
801
+ '[class.z-drawer-resizing]': 'isResizing()',
802
+ }, exportAs: 'zDrawer', template: "<!-- 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 #contentOutlet />\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: ["@charset \"UTF-8\";:host.z-drawer-service-mode,:host.z-drawer-template-mode{pointer-events:auto}:host.z-drawer-service-mode[data-placement=left],:host.z-drawer-template-mode[data-placement=left]{--z-enter-translate-x: -100%;animation:z-enter .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,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 .45s cubic-bezier(.32,.72,0,1) forwards}:host.z-drawer-template-host{display:contents}::ng-deep .z-drawer-backdrop-dark{background-color:#0009;animation:z-backdrop-enter .45s cubic-bezier(.32,.72,0,1) forwards}::ng-deep .z-drawer-backdrop-blur{background-color:#0000000d;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:z-backdrop-enter .45s cubic-bezier(.32,.72,0,1) forwards}::ng-deep .z-drawer-backdrop-dark.z-backdrop-leaving,::ng-deep .z-drawer-backdrop-blur.z-backdrop-leaving{animation:z-backdrop-exit .45s cubic-bezier(.32,.72,0,1) forwards}.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-container-offset: 0px;--scrollbar-track-offset: 0px}:host.z-drawer-inner-scroll-mode .z-drawer-scrollbar{height:100%;min-height:0;flex:1 1 0%;overflow:hidden auto}:host.z-drawer-inner-scroll-mode main{box-sizing:border-box;display:flex;min-height:100%;flex:1 1 0%;flex-direction:column}:host.z-drawer-inner-scroll-mode ::ng-deep .z-drawer-scrollbar .ng-scroll-content{display:flex;min-height:100%;flex-direction:column}.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"] }]
803
+ }], 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 }] }], zScrollMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "zScrollMode", 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 }] }], contentOutlet: [{ type: i0.ViewChild, args: ['contentOutlet', { ...{ read: ViewContainerRef }, isSignal: true }] }], mainContentRef: [{ type: i0.ViewChild, args: ['mainContent', { isSignal: true }] }] } }) });
804
+
805
+ let ZDrawerRef = class ZDrawerRef {
806
+ _overlayRef;
807
+ _config;
808
+ _containerInstance;
809
+ _platformId;
810
+ _destroy$ = new Subject();
811
+ _isClosing = false;
812
+ _result;
813
+ componentInstance = null;
814
+ loading = signal(false, /* @ts-ignore */
815
+ ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
816
+ zAfterClose = new EventEmitter();
817
+ constructor(_overlayRef, _config, _containerInstance, _platformId) {
818
+ this._overlayRef = _overlayRef;
819
+ this._config = _config;
820
+ this._containerInstance = _containerInstance;
821
+ this._platformId = _platformId;
822
+ this._containerInstance.zOnCancel.subscribe(() => this._trigger(ZDrawerTriggerAction.CANCEL));
823
+ this._containerInstance.zOnOk.subscribe(() => this._trigger(ZDrawerTriggerAction.OK));
824
+ if ((this._config.zMaskClosable ?? true) && isPlatformBrowser(this._platformId)) {
825
+ this._overlayRef
826
+ .backdropClick()
827
+ .pipe(takeUntil(this._destroy$))
828
+ .subscribe(() => {
829
+ if (!this.loading()) {
830
+ this._trigger(ZDrawerTriggerAction.CANCEL);
831
+ }
832
+ });
833
+ }
834
+ if (isPlatformBrowser(this._platformId)) {
835
+ fromEvent(document, 'keydown')
836
+ .pipe(filter(event => event.key === 'Escape'), takeUntil(this._destroy$))
837
+ .subscribe(() => {
838
+ // Chỉ overlay trên cùng phản hồi Escape — drawer bên dưới modal không đóng theo.
839
+ if (!this.loading() && this._overlayRef.isTopmost()) {
840
+ this._trigger(ZDrawerTriggerAction.CANCEL);
841
+ }
842
+ });
843
+ }
844
+ }
845
+ setLoading(value) {
846
+ this.loading.set(value);
847
+ }
848
+ close(result) {
849
+ if (this._isClosing) {
850
+ return;
851
+ }
852
+ this._isClosing = true;
853
+ this._result = result;
854
+ this._overlayRef?.markClosing();
855
+ if (isPlatformBrowser(this._platformId)) {
856
+ const hostElement = this._containerInstance.getNativeElement();
857
+ hostElement.classList.add('drawer-leave');
858
+ const { backdropElement } = this._overlayRef;
859
+ if (backdropElement) {
860
+ backdropElement.classList.add('z-backdrop-leaving');
861
+ }
862
+ }
863
+ setTimeout(() => {
864
+ if (!this._containerInstance.isDestroyed()) {
865
+ this._containerInstance.zAfterClose.emit();
866
+ }
867
+ this.zAfterClose.emit(this._result);
868
+ this._overlayRef?.dispose();
869
+ if (!this._destroy$.closed) {
870
+ this._destroy$.next();
871
+ this._destroy$.complete();
872
+ }
873
+ }, Z_DRAWER_ANIMATION_DURATION);
874
+ }
875
+ _trigger(action) {
876
+ if (this.loading()) {
877
+ return;
878
+ }
879
+ const trigger = {
880
+ ok: this._config.zOnOk,
881
+ cancel: this._config.zOnCancel,
882
+ }[action];
883
+ if (trigger instanceof EventEmitter) {
884
+ trigger.emit(this._getContentComponent());
885
+ return;
886
+ }
887
+ if (typeof trigger === 'function') {
888
+ const result = trigger(this._getContentComponent(), this);
889
+ this._closeWithResult(result);
890
+ return;
891
+ }
892
+ this.close();
893
+ }
894
+ _getContentComponent() {
895
+ return this.componentInstance;
896
+ }
897
+ _closeWithResult(result) {
898
+ if (result !== false) {
899
+ this.close(result);
900
+ }
901
+ }
902
+ };
903
+ ZDrawerRef = __decorate([
904
+ __param(3, Inject(PLATFORM_ID)),
905
+ __metadata("design:paramtypes", [Function, ZDrawerOptions,
906
+ ZDrawerComponent, Object])
907
+ ], ZDrawerRef);
908
+
909
+ class ZDrawerService {
910
+ _overlayService = inject(ZOverlayService);
911
+ _injector = inject(Injector);
912
+ _platformId = inject(PLATFORM_ID);
913
+ _zIndexService = inject(ZOverlayZIndexService);
914
+ create(config) {
915
+ return this._open(config.zContent, config);
916
+ }
917
+ _open(componentOrTemplateRef, config) {
918
+ const overlayRef = this._createOverlay(config);
919
+ if (!overlayRef) {
920
+ return new ZDrawerRef(undefined, config, undefined, this._platformId);
921
+ }
922
+ const drawerContainer = this._attachDrawerContainer(overlayRef, config);
923
+ const drawerRef = this._attachDrawerContent(componentOrTemplateRef, drawerContainer, overlayRef, config);
924
+ return drawerRef;
925
+ }
926
+ _createOverlay(config) {
927
+ if (!isPlatformBrowser(this._platformId)) {
928
+ return undefined;
929
+ }
930
+ const overlayType = config.zOverlay ?? getOverlayType();
931
+ const backdropClass = overlayType === 'blur' ? 'z-drawer-backdrop-blur' : 'z-drawer-backdrop-dark';
932
+ const overlayRef = this._overlayService.createGlobal({
933
+ hasBackdrop: true,
934
+ backdropClass,
935
+ scrollLock: true,
936
+ });
937
+ this._zIndexService.applyToOverlay(overlayRef);
938
+ return overlayRef;
939
+ }
940
+ _attachDrawerContainer(overlayRef, config) {
941
+ const injector = Injector.create({
942
+ parent: this._injector,
943
+ providers: [{ provide: ZDrawerOptions, useValue: config }],
944
+ });
945
+ const containerRef = overlayRef.attach(ZDrawerComponent, {
946
+ injector,
947
+ viewContainerRef: config.zViewContainerRef,
948
+ });
949
+ return containerRef.instance;
950
+ }
951
+ _attachDrawerContent(componentOrTemplateRef, drawerContainer, overlayRef, config) {
952
+ const drawerRef = new ZDrawerRef(overlayRef, config, drawerContainer, this._platformId);
953
+ drawerContainer.drawerRef = drawerRef;
954
+ if (componentOrTemplateRef instanceof TemplateRef) {
955
+ drawerContainer.attachTemplatePortal(componentOrTemplateRef, { drawerRef });
956
+ return drawerRef;
957
+ }
958
+ if (typeof componentOrTemplateRef !== 'string') {
959
+ const injector = this._createInjector(drawerRef, config);
960
+ const contentRef = drawerContainer.attachComponentPortal(componentOrTemplateRef, injector);
961
+ if (contentRef) {
962
+ drawerRef.componentInstance = contentRef.instance;
963
+ }
964
+ }
965
+ return drawerRef;
966
+ }
967
+ _createInjector(drawerRef, config) {
968
+ return Injector.create({
969
+ parent: this._injector,
970
+ providers: [
971
+ { provide: ZDrawerRef, useValue: drawerRef },
972
+ { provide: Z_DRAWER_DATA, useValue: config.zData },
973
+ ],
974
+ });
975
+ }
976
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZDrawerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
977
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZDrawerService, providedIn: 'root' });
978
+ }
979
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ZDrawerService, decorators: [{
980
+ type: Injectable,
981
+ args: [{
982
+ providedIn: 'root',
983
+ }]
984
+ }] });
985
+
986
+ /**
987
+ * Generated bundle index. Do not edit.
988
+ */
989
+
990
+ export { ZDrawerComponent, ZDrawerContentDirective, ZDrawerFooterDirective, ZDrawerHeaderDirective, ZDrawerOptions, ZDrawerRef, ZDrawerService, Z_DRAWER_DATA, zDrawerVariants };
991
+ //# sourceMappingURL=shival99-z-ui-components-z-drawer.mjs.map