@shival99/z-ui 2.2.6 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/assets/css/base.css +4 -0
  2. package/assets/css/overlay.css +82 -0
  3. package/assets/css/tailwind.css +1 -0
  4. package/fesm2022/shival99-z-ui-components-z-button-group.mjs +15 -13
  5. package/fesm2022/shival99-z-ui-components-z-button-group.mjs.map +1 -1
  6. package/fesm2022/shival99-z-ui-components-z-button.mjs +2 -2
  7. package/fesm2022/shival99-z-ui-components-z-button.mjs.map +1 -1
  8. package/fesm2022/shival99-z-ui-components-z-calendar.mjs +23 -17
  9. package/fesm2022/shival99-z-ui-components-z-calendar.mjs.map +1 -1
  10. package/fesm2022/shival99-z-ui-components-z-command.mjs +10 -24
  11. package/fesm2022/shival99-z-ui-components-z-command.mjs.map +1 -1
  12. package/fesm2022/shival99-z-ui-components-z-drawer.mjs +42 -60
  13. package/fesm2022/shival99-z-ui-components-z-drawer.mjs.map +1 -1
  14. package/fesm2022/shival99-z-ui-components-z-gallery.mjs +6 -8
  15. package/fesm2022/shival99-z-ui-components-z-gallery.mjs.map +1 -1
  16. package/fesm2022/shival99-z-ui-components-z-icon.mjs +147 -3
  17. package/fesm2022/shival99-z-ui-components-z-icon.mjs.map +1 -1
  18. package/fesm2022/shival99-z-ui-components-z-marquee.mjs +19 -4
  19. package/fesm2022/shival99-z-ui-components-z-marquee.mjs.map +1 -1
  20. package/fesm2022/shival99-z-ui-components-z-menu.mjs +2 -2
  21. package/fesm2022/shival99-z-ui-components-z-menu.mjs.map +1 -1
  22. package/fesm2022/shival99-z-ui-components-z-modal.mjs +45 -62
  23. package/fesm2022/shival99-z-ui-components-z-modal.mjs.map +1 -1
  24. package/fesm2022/shival99-z-ui-components-z-overlay.mjs +363 -0
  25. package/fesm2022/shival99-z-ui-components-z-overlay.mjs.map +1 -0
  26. package/fesm2022/shival99-z-ui-components-z-popover.mjs +94 -378
  27. package/fesm2022/shival99-z-ui-components-z-popover.mjs.map +1 -1
  28. package/fesm2022/shival99-z-ui-components-z-skeleton.mjs +14 -3
  29. package/fesm2022/shival99-z-ui-components-z-skeleton.mjs.map +1 -1
  30. package/fesm2022/shival99-z-ui-components-z-table.mjs +42 -16
  31. package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -1
  32. package/fesm2022/shival99-z-ui-components-z-tabs.mjs +85 -7
  33. package/fesm2022/shival99-z-ui-components-z-tabs.mjs.map +1 -1
  34. package/fesm2022/shival99-z-ui-components-z-toast.mjs +32 -25
  35. package/fesm2022/shival99-z-ui-components-z-toast.mjs.map +1 -1
  36. package/fesm2022/shival99-z-ui-components-z-tooltip.mjs +52 -222
  37. package/fesm2022/shival99-z-ui-components-z-tooltip.mjs.map +1 -1
  38. package/fesm2022/shival99-z-ui-services.mjs +42 -25
  39. package/fesm2022/shival99-z-ui-services.mjs.map +1 -1
  40. package/package.json +9 -1
  41. package/types/shival99-z-ui-components-z-button-group.d.ts +12 -11
  42. package/types/shival99-z-ui-components-z-button.d.ts +2 -1
  43. package/types/shival99-z-ui-components-z-command.d.ts +2 -4
  44. package/types/shival99-z-ui-components-z-drawer.d.ts +11 -13
  45. package/types/shival99-z-ui-components-z-gallery.d.ts +7 -7
  46. package/types/shival99-z-ui-components-z-icon.d.ts +22 -2
  47. package/types/shival99-z-ui-components-z-marquee.d.ts +7 -1
  48. package/types/shival99-z-ui-components-z-modal.d.ts +52 -52
  49. package/types/shival99-z-ui-components-z-overlay.d.ts +145 -0
  50. package/types/shival99-z-ui-components-z-popover.d.ts +6 -14
  51. package/types/shival99-z-ui-components-z-qrcode.d.ts +1 -1
  52. package/types/shival99-z-ui-components-z-skeleton.d.ts +2 -0
  53. package/types/shival99-z-ui-components-z-table.d.ts +6 -2
  54. package/types/shival99-z-ui-components-z-tabs.d.ts +13 -3
  55. package/types/shival99-z-ui-components-z-toast.d.ts +7 -1
  56. package/types/shival99-z-ui-components-z-tooltip.d.ts +9 -7
  57. package/types/shival99-z-ui-services.d.ts +52 -31
@@ -0,0 +1,145 @@
1
+ import { AutoUpdateOptions, Placement } from '@floating-ui/dom';
2
+ import * as i0 from '@angular/core';
3
+ import { ApplicationRef, EnvironmentInjector, Type, Injector, ViewContainerRef, ComponentRef, TemplateRef, EmbeddedViewRef } from '@angular/core';
4
+ import { Observable } from 'rxjs';
5
+
6
+ type ZOverlaySide = 'top' | 'bottom' | 'left' | 'right';
7
+ type ZOverlayPlacement = 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'left-top' | 'left-bottom' | 'right' | 'right-top' | 'right-bottom';
8
+ interface ZFloatingPlacementConfig {
9
+ reference: Element;
10
+ floating: HTMLElement;
11
+ placement: ZOverlayPlacement;
12
+ fallbackPlacements: ZOverlayPlacement[];
13
+ offset: number;
14
+ viewportPadding?: number;
15
+ push?: boolean;
16
+ flexibleDimensions?: boolean;
17
+ }
18
+ interface ZFloatingPlacementResult {
19
+ x: number;
20
+ y: number;
21
+ placement: ZOverlayPlacement;
22
+ }
23
+ interface ZFloatingArrowOffsetConfig {
24
+ triggerRect: DOMRectReadOnly;
25
+ overlayRect: DOMRectReadOnly;
26
+ placement: ZOverlayPlacement;
27
+ edgePadding?: number;
28
+ }
29
+ interface ZOverlaySizeConfig {
30
+ width?: string | number;
31
+ minWidth?: string | number;
32
+ maxWidth?: string | number;
33
+ height?: string | number;
34
+ minHeight?: string | number;
35
+ maxHeight?: string | number;
36
+ }
37
+ interface ZOverlayGlobalConfig {
38
+ hasBackdrop: boolean;
39
+ backdropClass?: string;
40
+ panelClass?: string;
41
+ scrollLock?: boolean;
42
+ size?: ZOverlaySizeConfig;
43
+ }
44
+ interface ZOverlayAnchoredConfig {
45
+ panelClass?: string;
46
+ }
47
+
48
+ declare function computeZOverlayPlacement(config: ZFloatingPlacementConfig): Promise<ZFloatingPlacementResult>;
49
+ /** Bọc lại `autoUpdate` của Floating UI — thay cho `scrollStrategies.reposition()` của CDK. */
50
+ declare function startZOverlayAutoUpdate(reference: Element, floating: HTMLElement, onUpdate: () => void, options?: Partial<AutoUpdateOptions>): () => void;
51
+ /**
52
+ * Tính độ lệch mũi tên so với tâm overlay, kẹp trong biên overlay.
53
+ * Y hệt logic `_calculateArrowOffset` cũ của tooltip/popover — chỉ tách ra dùng chung.
54
+ */
55
+ declare function computeZOverlayArrowOffset(config: ZFloatingArrowOffsetConfig): number;
56
+
57
+ declare const Z_OVERLAY_DEFAULT_VIEWPORT_PADDING = 8;
58
+ declare const Z_OVERLAY_DEFAULT_ARROW_EDGE_PADDING = 12;
59
+ declare const Z_OVERLAY_CONTAINER_CLASS = "z-overlay-container";
60
+ declare const Z_OVERLAY_HOST_CLASS = "z-overlay-host";
61
+ /** Z-UI position name -> Floating UI placement (12 vị trí khớp 1:1). */
62
+ declare const Z_OVERLAY_PLACEMENT_MAP: Record<ZOverlayPlacement, Placement>;
63
+ declare const Z_OVERLAY_PLACEMENT_REVERSE_MAP: Record<Placement, ZOverlayPlacement>;
64
+ /**
65
+ * Thứ tự fallback khi vị trí chính không đủ chỗ (không gồm vị trí chính — flip() tự thử trước).
66
+ * Dùng chung cho tooltip lẫn popover, hai nơi này vốn có bảng y hệt nhau.
67
+ */
68
+ declare const Z_OVERLAY_FALLBACK_ORDER: Record<ZOverlayPlacement, ZOverlayPlacement[]>;
69
+ /** Thứ tự ưu tiên khi vị trí chính còn đủ chỗ (tooltip dùng để giữ đúng cạnh, không nhảy sang cạnh đối diện). */
70
+ declare const Z_OVERLAY_PREFERRED_SIDE_ORDER: Record<ZOverlayPlacement, ZOverlayPlacement[]>;
71
+
72
+ /**
73
+ * Thay cho `OverlayRef` của CDK. `overlayElement` là pane được Floating UI định vị
74
+ * (overlay neo theo trigger) hoặc chính `hostElement` (overlay toàn màn hình — modal/drawer).
75
+ */
76
+ declare class ZOverlayRef {
77
+ readonly hostElement: HTMLElement;
78
+ readonly overlayElement: HTMLElement;
79
+ readonly backdropElement: HTMLElement | null;
80
+ private readonly _appRef;
81
+ private readonly _envInjector;
82
+ private readonly _onDispose?;
83
+ private _componentRef;
84
+ private _embeddedViewRef;
85
+ constructor(hostElement: HTMLElement, overlayElement: HTMLElement, backdropElement: HTMLElement | null, _appRef: ApplicationRef, _envInjector: EnvironmentInjector, _onDispose?: (() => void) | undefined);
86
+ hasAttached(): boolean;
87
+ /**
88
+ * `viewContainerRef`, khi được truyền, cho component tạo ra thừa hưởng injector/vị trí trong
89
+ * cây view của chính VCR đó (giữ đúng ngữ nghĩa `ZModalOptions.zViewContainerRef` công khai) —
90
+ * dù vậy DOM node vẫn luôn được chuyển vào `overlayElement`, y hệt `DomPortalOutlet` của CDK cũ.
91
+ */
92
+ attach<T>(component: Type<T>, options?: {
93
+ injector?: Injector;
94
+ viewContainerRef?: ViewContainerRef;
95
+ }): ComponentRef<T>;
96
+ /** Gắn một `TemplateRef` (thay `TemplatePortal`) — chỉ dùng cho overlay tự do (z-dynamic.service). */
97
+ attachTemplate<C>(templateRef: TemplateRef<C>, viewContainerRef: ViewContainerRef, context: C): EmbeddedViewRef<C>;
98
+ updateSize(size: ZOverlaySizeConfig): void;
99
+ backdropClick(): Observable<MouseEvent>;
100
+ outsidePointerEvents(): Observable<PointerEvent>;
101
+ dispose(): void;
102
+ }
103
+
104
+ /**
105
+ * Tạo overlay host `[popover=manual]` (top layer, thay cho `.cdk-overlay-pane`) và trả về `ZOverlayRef`.
106
+ *
107
+ * - `createAnchored`: overlay neo theo trigger (tooltip/popover) — có thêm `.z-overlay-pane` để
108
+ * Floating UI định vị bằng `left`/`top` (không dùng `transform`, vì các class `z-animate-*`
109
+ * trong `animations.css` đã chiếm `transform` cho hiệu ứng enter/exit).
110
+ * - `createGlobal`: overlay toàn màn hình (modal/drawer) — component gắn vào tự định vị bằng
111
+ * `zModalVariants`/`zDrawerVariants` (đã là `fixed` + toạ độ cố định), nên không cần pane riêng.
112
+ */
113
+ declare class ZOverlayService {
114
+ private readonly _appRef;
115
+ private readonly _envInjector;
116
+ private readonly _document;
117
+ private readonly _scrollLock;
118
+ private _container;
119
+ createAnchored(config?: ZOverlayAnchoredConfig): ZOverlayRef;
120
+ createGlobal(config: ZOverlayGlobalConfig): ZOverlayRef;
121
+ private _createHost;
122
+ private _showHost;
123
+ private _getContainer;
124
+ static ɵfac: i0.ɵɵFactoryDeclaration<ZOverlayService, never>;
125
+ static ɵprov: i0.ɵɵInjectableDeclaration<ZOverlayService>;
126
+ }
127
+
128
+ /**
129
+ * Khoá scroll trang khi overlay toàn màn hình (modal/drawer) mở — thay cho
130
+ * `scrollStrategies.block()` của CDK. Đếm tham chiếu để modal-trong-modal không mở khoá sớm.
131
+ * Dùng `top`/`left` âm theo vị trí scroll hiện tại (giống thuật toán `BlockScrollStrategy` của CDK)
132
+ * để không giật layout và giữ nguyên vị trí scroll khi mở khoá lại.
133
+ */
134
+ declare class ZScrollLockService {
135
+ private readonly _document;
136
+ private _lockCount;
137
+ private _scrollPosition;
138
+ lock(): void;
139
+ unlock(): void;
140
+ static ɵfac: i0.ɵɵFactoryDeclaration<ZScrollLockService, never>;
141
+ static ɵprov: i0.ɵɵInjectableDeclaration<ZScrollLockService>;
142
+ }
143
+
144
+ export { ZOverlayRef, ZOverlayService, ZScrollLockService, Z_OVERLAY_CONTAINER_CLASS, Z_OVERLAY_DEFAULT_ARROW_EDGE_PADDING, Z_OVERLAY_DEFAULT_VIEWPORT_PADDING, Z_OVERLAY_FALLBACK_ORDER, Z_OVERLAY_HOST_CLASS, Z_OVERLAY_PLACEMENT_MAP, Z_OVERLAY_PLACEMENT_REVERSE_MAP, Z_OVERLAY_PREFERRED_SIDE_ORDER, computeZOverlayArrowOffset, computeZOverlayPlacement, startZOverlayAutoUpdate };
145
+ export type { ZFloatingArrowOffsetConfig, ZFloatingPlacementConfig, ZFloatingPlacementResult, ZOverlayAnchoredConfig, ZOverlayGlobalConfig, ZOverlayPlacement, ZOverlaySide, ZOverlaySizeConfig };
@@ -23,8 +23,7 @@ interface ZPopoverControl {
23
23
 
24
24
  declare class ZPopoverComponent implements OnInit, OnDestroy {
25
25
  private static readonly _openPopovers;
26
- private readonly _overlay;
27
- private readonly _overlayPositionBuilder;
26
+ private readonly _overlayService;
28
27
  private readonly _renderer;
29
28
  private readonly _destroyRef;
30
29
  private readonly _platformId;
@@ -54,7 +53,7 @@ declare class ZPopoverComponent implements OnInit, OnDestroy {
54
53
  private _componentRef;
55
54
  private _delaySubject;
56
55
  private _listenerCleanups;
57
- private _positionSubscription;
56
+ private _autoUpdateCleanup;
58
57
  private _scrollSubscription;
59
58
  private _viewportResizeSubscription;
60
59
  private _resizeObserver;
@@ -74,7 +73,6 @@ declare class ZPopoverComponent implements OnInit, OnDestroy {
74
73
  isOpen(): boolean;
75
74
  updatePosition(): void;
76
75
  private _createOverlay;
77
- private _createScrollStrategy;
78
76
  private _disposeOverlay;
79
77
  private _setupDelayMechanism;
80
78
  private _setupTriggers;
@@ -85,19 +83,17 @@ declare class ZPopoverComponent implements OnInit, OnDestroy {
85
83
  private _showPopover;
86
84
  private _isNestedPopoverTarget;
87
85
  private _setupResizeObserver;
88
- private _updatePositionAfterContentSettles;
89
86
  private _schedulePositionUpdate;
90
87
  private _scheduleSettledPositionUpdate;
91
88
  private _cancelScheduledPositionUpdate;
92
89
  private _updatePositionNow;
90
+ private _applyPosition;
93
91
  private _markViewportSettling;
94
92
  private _shouldDeferForMobileKeyboard;
95
93
  private _shouldSkipMobileKeyboardUpdate;
96
94
  private _isMobileOverlayTextInputFocused;
97
95
  private _clearViewportResizeTimeout;
98
- private _applyMobilePopoverPosition;
99
96
  private _isTriggerVisibleInViewport;
100
- private _setOverlayPaneStyles;
101
97
  private _setupPopoverHover;
102
98
  private _hidePopover;
103
99
  private _clearHideTimeout;
@@ -132,8 +128,7 @@ declare class ZPopoverDirective implements OnInit, OnDestroy {
132
128
  readonly zPositionChange: _angular_core.OutputEmitterRef<ZPopoverPosition>;
133
129
  readonly zOutsideClick: _angular_core.OutputEmitterRef<MouseEvent>;
134
130
  private readonly _trigger;
135
- private readonly _overlay;
136
- private readonly _overlayPositionBuilder;
131
+ private readonly _overlayService;
137
132
  private readonly _elementRef;
138
133
  private readonly _renderer;
139
134
  private readonly _destroyRef;
@@ -145,7 +140,7 @@ declare class ZPopoverDirective implements OnInit, OnDestroy {
145
140
  private _componentRef;
146
141
  private _delaySubject;
147
142
  private _listenerCleanups;
148
- private _positionSubscription;
143
+ private _autoUpdateCleanup;
149
144
  private _scrollSubscription;
150
145
  private _viewportResizeSubscription;
151
146
  private _resizeObserver;
@@ -166,7 +161,6 @@ declare class ZPopoverDirective implements OnInit, OnDestroy {
166
161
  isOpen(): boolean;
167
162
  updatePosition(): void;
168
163
  private _createOverlay;
169
- private _createScrollStrategy;
170
164
  private _getWidthConfig;
171
165
  private _getTriggerElement;
172
166
  private _disposeOverlay;
@@ -179,19 +173,17 @@ declare class ZPopoverDirective implements OnInit, OnDestroy {
179
173
  private _showPopover;
180
174
  private _isNestedPopoverTarget;
181
175
  private _setupResizeObserver;
182
- private _updatePositionAfterContentSettles;
183
176
  private _schedulePositionUpdate;
184
177
  private _scheduleSettledPositionUpdate;
185
178
  private _cancelScheduledPositionUpdate;
186
179
  private _updatePositionNow;
180
+ private _applyPosition;
187
181
  private _markViewportSettling;
188
182
  private _shouldDeferForMobileKeyboard;
189
183
  private _shouldSkipMobileKeyboardUpdate;
190
184
  private _isMobileOverlayTextInputFocused;
191
185
  private _clearViewportResizeTimeout;
192
- private _applyMobilePopoverPosition;
193
186
  private _isTriggerVisibleInViewport;
194
- private _setOverlayPaneStyles;
195
187
  private _setupPopoverHover;
196
188
  private _hidePopover;
197
189
  private _clearHideTimeout;
@@ -17,7 +17,7 @@ declare class ZQrCodeComponent {
17
17
  readonly zLogo: _angular_core.InputSignal<string>;
18
18
  readonly zLogoSize: _angular_core.InputSignal<number>;
19
19
  readonly zLogoBgColor: _angular_core.InputSignal<string>;
20
- readonly zLogoBgShape: _angular_core.InputSignal<"square" | "circle" | "none">;
20
+ readonly zLogoBgShape: _angular_core.InputSignal<"circle" | "square" | "none">;
21
21
  readonly zLogoPadding: _angular_core.InputSignal<number>;
22
22
  readonly zFgColor: _angular_core.InputSignal<string>;
23
23
  readonly zBgColor: _angular_core.InputSignal<string>;
@@ -25,6 +25,8 @@ declare class ZSkeletonComponent implements AfterViewInit {
25
25
  private readonly _calculatedRows;
26
26
  ngAfterViewInit(): void;
27
27
  protected readonly containerClass: _angular_core.Signal<string>;
28
+ protected readonly hostDisplay: _angular_core.Signal<"inline-block" | "block">;
29
+ protected readonly hostWidth: _angular_core.Signal<string | undefined>;
28
30
  protected readonly hostHeight: _angular_core.Signal<string | undefined>;
29
31
  protected readonly skeletonClasses: _angular_core.Signal<string>;
30
32
  protected readonly circleStyles: _angular_core.Signal<{
@@ -6,7 +6,6 @@ import { ZInputAlign, ZInputSize } from '@shival99/z-ui/components/z-input';
6
6
  import * as _angular_core from '@angular/core';
7
7
  import { TemplateRef, Type, AfterViewInit, ElementRef, OnInit } from '@angular/core';
8
8
  import { CdkDragDrop } from '@angular/cdk/drag-drop';
9
- import { ConnectedPosition } from '@angular/cdk/overlay';
10
9
  import { ZPopoverPosition, ZPopoverTrigger, ZPopoverControl, ZPopoverDirective } from '@shival99/z-ui/components/z-popover';
11
10
  import { ClassValue } from 'clsx';
12
11
  import { NgScrollbar } from 'ngx-scrollbar';
@@ -1120,6 +1119,8 @@ declare class ZTableComponent<T> implements AfterViewInit {
1120
1119
  private readonly _document;
1121
1120
  private readonly _zExcel;
1122
1121
  private readonly _zTranslate;
1122
+ private readonly _overlayService;
1123
+ private readonly _viewContainerRef;
1123
1124
  /** Prevents recursive scroll sync between thead/tbody/tfoot */
1124
1125
  private readonly _isSyncingScroll;
1125
1126
  private _lastSyncedScrollLeft;
@@ -1134,6 +1135,7 @@ declare class ZTableComponent<T> implements AfterViewInit {
1134
1135
  private _filterEmitDebounceTimeout;
1135
1136
  /** Keeps the bulk bar mounted long enough for its exit animation */
1136
1137
  private _bulkBarTimer;
1138
+ private _bulkBarOverlayRef;
1137
1139
  private _contentRowMenuOutsideTimer;
1138
1140
  private _contentRowMenuOutsideCleanup;
1139
1141
  private _cellInteractionOutsideCleanup;
@@ -1242,6 +1244,7 @@ declare class ZTableComponent<T> implements AfterViewInit {
1242
1244
  protected readonly bulkBarConfig: _angular_core.WritableSignal<ZTableBulkActionOptions<T> | null>;
1243
1245
  protected readonly bulkBarContext: _angular_core.WritableSignal<ZTableBulkActionContext<T> | null>;
1244
1246
  protected readonly bulkBarItems: _angular_core.WritableSignal<ZTableBulkActionRenderItem<T>[]>;
1247
+ protected readonly bulkBarTemplateRef: _angular_core.Signal<TemplateRef<unknown> | undefined>;
1245
1248
  /** True when table body is scrolled away from left edge (shows left pin shadow) */
1246
1249
  protected readonly hasScrollLeft: _angular_core.WritableSignal<boolean>;
1247
1250
  /** True when table has right-pinned columns and body isn't scrolled to the end */
@@ -1854,7 +1857,6 @@ declare class ZTableComponent<T> implements AfterViewInit {
1854
1857
  protected readonly bulkActionConfig: _angular_core.Signal<ZTableBulkActionOptions<T> | null>;
1855
1858
  protected readonly bulkActionItems: _angular_core.Signal<ZTableBulkActionRenderItem<T>[]>;
1856
1859
  protected readonly showBulkBar: _angular_core.Signal<boolean>;
1857
- protected readonly bulkBarPositions: ConnectedPosition[];
1858
1860
  private readonly _bulkBarExitDuration;
1859
1861
  /** Stable identity key per virtual index (row/group id, not array index) — prevents height jitter on fast scroll. */
1860
1862
  private readonly _virtualItemKeys;
@@ -1922,6 +1924,8 @@ declare class ZTableComponent<T> implements AfterViewInit {
1922
1924
  private _getExcelColumnHeader;
1923
1925
  private _getExcelColumnHeaderAlign;
1924
1926
  private _clearBulkBarTimer;
1927
+ private _openBulkBarOverlay;
1928
+ private _disposeBulkBarOverlay;
1925
1929
  private _clearContentRowMenuOutsideListener;
1926
1930
  /**
1927
1931
  * Wraps state mutations with a debounced processing indicator.
@@ -13,11 +13,11 @@ declare class ZTabPanelDirective {
13
13
  }
14
14
 
15
15
  declare const zTabsVariants: (props?: ({
16
- zType?: "line" | "soft" | "segment" | "segment-solid" | "folder" | "folder-soft" | "folder-solid" | "underline" | "underlined" | "badge" | "sharp" | "sharp-line" | "sharp-line-filled" | "vertical-sharp" | "code-line" | null | undefined;
16
+ zType?: "line" | "soft" | "segment" | "segment-solid" | "pill-solid" | "pill-blur" | "folder" | "folder-soft" | "folder-solid" | "underline" | "underlined" | "badge" | "sharp" | "sharp-line" | "sharp-line-filled" | "vertical-sharp" | "code-line" | null | undefined;
17
17
  zOrientation?: "horizontal" | "vertical" | null | undefined;
18
18
  } & class_variance_authority_types.ClassProp) | undefined) => string;
19
19
  declare const zTabItemVariants: (props?: ({
20
- zType?: "line" | "soft" | "segment" | "segment-solid" | "folder" | "folder-soft" | "folder-solid" | "underline" | "underlined" | "badge" | "sharp" | "sharp-line" | "sharp-line-filled" | "vertical-sharp" | "code-line" | null | undefined;
20
+ zType?: "line" | "soft" | "segment" | "segment-solid" | "pill-solid" | "pill-blur" | "folder" | "folder-soft" | "folder-solid" | "underline" | "underlined" | "badge" | "sharp" | "sharp-line" | "sharp-line-filled" | "vertical-sharp" | "code-line" | null | undefined;
21
21
  zSize?: "xs" | "sm" | "default" | "lg" | null | undefined;
22
22
  zOrientation?: "horizontal" | "vertical" | null | undefined;
23
23
  } & class_variance_authority_types.ClassProp) | undefined) => string;
@@ -30,7 +30,7 @@ interface ZTab {
30
30
  badge?: string | number;
31
31
  template?: TemplateRef<unknown>;
32
32
  }
33
- type ZTabsType = 'line' | 'soft' | 'segment' | 'segment-solid' | 'folder' | 'folder-soft' | 'folder-solid' | 'underline' | 'underlined' | 'badge' | 'sharp' | 'sharp-line' | 'sharp-line-filled' | 'vertical-sharp' | 'code-line';
33
+ type ZTabsType = 'line' | 'soft' | 'segment' | 'segment-solid' | 'pill-solid' | 'pill-blur' | 'folder' | 'folder-soft' | 'folder-solid' | 'underline' | 'underlined' | 'badge' | 'sharp' | 'sharp-line' | 'sharp-line-filled' | 'vertical-sharp' | 'code-line';
34
34
  type ZTabsSize = 'xs' | 'sm' | 'default' | 'lg';
35
35
  type ZTabsOrientation = 'horizontal' | 'vertical';
36
36
  type ZTabsContentFit = 'none' | 'screen';
@@ -60,6 +60,15 @@ declare class ZTabsComponent implements OnInit, AfterViewInit, OnDestroy {
60
60
  protected readonly loadedTabs: _angular_core.WritableSignal<Set<string>>;
61
61
  protected readonly canScrollLeft: _angular_core.WritableSignal<boolean>;
62
62
  protected readonly canScrollRight: _angular_core.WritableSignal<boolean>;
63
+ protected readonly bouncingTab: _angular_core.WritableSignal<string | null>;
64
+ protected readonly isGlideType: _angular_core.Signal<boolean>;
65
+ protected readonly glideStyle: _angular_core.WritableSignal<{
66
+ transform: string;
67
+ width: string;
68
+ height: string;
69
+ } | null>;
70
+ protected readonly glideReady: _angular_core.WritableSignal<boolean>;
71
+ protected readonly glideSquashing: _angular_core.WritableSignal<boolean>;
63
72
  protected readonly panelRenderStates: _angular_core.Signal<Map<string, boolean>>;
64
73
  private _resizeObserver?;
65
74
  private readonly _cacheInstanceId;
@@ -79,6 +88,7 @@ declare class ZTabsComponent implements OnInit, AfterViewInit, OnDestroy {
79
88
  protected scrollLeft(): void;
80
89
  protected scrollRight(): void;
81
90
  protected onTabsScroll(): void;
91
+ private _updateGlideIndicator;
82
92
  private _setupResizeObserver;
83
93
  private _restoreActiveTabFromCache;
84
94
  private _saveActiveTabToCache;
@@ -118,7 +118,7 @@ declare class ZToastCustomComponent {
118
118
  declare function provideZToast(config?: Partial<ZToasterConfig>): EnvironmentProviders;
119
119
 
120
120
  declare class ZToastService implements OnDestroy {
121
- private readonly _overlay;
121
+ private readonly _overlayService;
122
122
  private readonly _injector;
123
123
  private readonly _platformId;
124
124
  private readonly _document;
@@ -143,6 +143,12 @@ declare class ZToastService implements OnDestroy {
143
143
  ngOnDestroy(): void;
144
144
  private _ensureToasterAttached;
145
145
  private _moveToTop;
146
+ /**
147
+ * Theo dõi cả hai container overlay (`.cdk-overlay-container` — z-command/z-gallery-preview/
148
+ * z-dynamic.service vẫn dùng CDK, và `.z-overlay-container` — tooltip/popover/modal/drawer dùng
149
+ * engine mới) để bật toast lên top layer mỗi khi có overlay khác vừa mở, giữ đúng hành vi
150
+ * "toast luôn nổi trên cùng" bất kể overlay đó thuộc engine nào.
151
+ */
146
152
  private _setupOverlayObserver;
147
153
  private _disconnectObserver;
148
154
  private _attachToaster;
@@ -1,9 +1,11 @@
1
+ import * as _shival99_z_ui_components_z_overlay from '@shival99/z-ui/components/z-overlay';
2
+ import { ZOverlayPlacement } from '@shival99/z-ui/components/z-overlay';
1
3
  import * as _angular_core from '@angular/core';
2
4
  import { TemplateRef, OnInit, OnDestroy } from '@angular/core';
3
5
  import * as class_variance_authority_types from 'class-variance-authority/types';
4
6
  import { VariantProps } from 'class-variance-authority';
5
7
 
6
- type ZTooltipPosition = 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'left-top' | 'left-bottom' | 'right' | 'right-top' | 'right-bottom';
8
+ type ZTooltipPosition = ZOverlayPlacement;
7
9
 
8
10
  declare const zTooltipVariants: (props?: ({
9
11
  zType?: "default" | "dark" | "light" | "primary" | "success" | "warning" | "error" | "info" | null | undefined;
@@ -32,8 +34,8 @@ interface ZTooltipConfig {
32
34
 
33
35
  declare class ZTooltipDirective implements OnInit, OnDestroy {
34
36
  readonly zContent: _angular_core.InputSignal<ZTooltipContent>;
35
- readonly zPosition: _angular_core.InputSignal<ZTooltipPosition>;
36
- readonly zTooltipPosition: _angular_core.InputSignal<ZTooltipPosition | undefined>;
37
+ readonly zPosition: _angular_core.InputSignal<_shival99_z_ui_components_z_overlay.ZOverlayPlacement>;
38
+ readonly zTooltipPosition: _angular_core.InputSignal<_shival99_z_ui_components_z_overlay.ZOverlayPlacement | undefined>;
37
39
  readonly zTrigger: _angular_core.InputSignal<ZTooltipTrigger>;
38
40
  readonly zTooltipTrigger: _angular_core.InputSignal<ZTooltipTrigger | undefined>;
39
41
  readonly zType: _angular_core.InputSignal<"default" | "dark" | "light" | "primary" | "success" | "warning" | "error" | "info" | null | undefined>;
@@ -64,8 +66,7 @@ declare class ZTooltipDirective implements OnInit, OnDestroy {
64
66
  private readonly _offset;
65
67
  readonly zShow: _angular_core.OutputEmitterRef<void>;
66
68
  readonly zHide: _angular_core.OutputEmitterRef<void>;
67
- private readonly _overlay;
68
- private readonly _overlayPositionBuilder;
69
+ private readonly _overlayService;
69
70
  private readonly _elementRef;
70
71
  private readonly _renderer;
71
72
  private readonly _destroyRef;
@@ -75,7 +76,7 @@ declare class ZTooltipDirective implements OnInit, OnDestroy {
75
76
  private _componentRef;
76
77
  private _delaySubject;
77
78
  private _listenerCleanups;
78
- private _positionSubscription;
79
+ private _autoUpdateCleanup;
79
80
  private _hideTimeout;
80
81
  private readonly _isVisible;
81
82
  constructor();
@@ -87,13 +88,14 @@ declare class ZTooltipDirective implements OnInit, OnDestroy {
87
88
  private _isFormControlValueTruncated;
88
89
  hide(): void;
89
90
  toggle(): void;
90
- private _createOverlay;
91
+ private _getAnchorElement;
91
92
  private _disposeOverlay;
92
93
  private _setupDelayMechanism;
93
94
  private _setupTriggers;
94
95
  private _setupOutsideClick;
95
96
  private _delay;
96
97
  private _showTooltip;
98
+ private _applyPosition;
97
99
  private _setupTooltipHover;
98
100
  private _hideTooltip;
99
101
  private _clearHideTimeout;
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Type, TemplateRef, ViewContainerRef, EventEmitter, ComponentRef, Signal, InjectionToken } from '@angular/core';
3
- import { PositionStrategy, ScrollStrategy, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
3
+ import { ZOverlayRef } from '@shival99/z-ui/components/z-overlay';
4
4
  import { ZFormatNumExcelOptions } from '@shival99/z-ui/utils';
5
5
  import { HttpHeaders, HttpContext, HttpParams, HttpClient } from '@angular/common/http';
6
6
  import { Router } from '@angular/router';
@@ -56,7 +56,7 @@ interface ZDynamicTemplateContext<TData, TResult> {
56
56
  /** Data passed to `open`. */
57
57
  data: TData | undefined;
58
58
  }
59
- /** Options for opening a free-form CDK dynamic overlay. */
59
+ /** Options for opening a free-form global dynamic overlay. */
60
60
  interface ZDynamicOptions<TData = unknown> {
61
61
  /** Data injected into a component or exposed in a template context. */
62
62
  data?: TData;
@@ -65,29 +65,27 @@ interface ZDynamicOptions<TData = unknown> {
65
65
  /** Whether the overlay renders a backdrop. Defaults to `true`. */
66
66
  hasBackdrop?: boolean;
67
67
  /** CSS class or classes applied to the backdrop. */
68
- backdropClass?: string | string[];
69
- /** CSS class or classes applied to the overlay pane. */
70
- panelClass?: string | string[];
71
- /** Custom position strategy. Defaults to a global overlay strategy. */
72
- positionStrategy?: PositionStrategy;
73
- /** Custom scroll strategy. Defaults to the CDK block strategy. */
74
- scrollStrategy?: ScrollStrategy;
68
+ backdropClass?: string;
69
+ /** CSS class or classes applied to the overlay host. */
70
+ panelClass?: string;
71
+ /** Locks page scroll while the overlay is open. Defaults to `true`. */
72
+ scrollLock?: boolean;
75
73
  /** Close when the backdrop is clicked. Defaults to `true`. */
76
74
  closeOnBackdropClick?: boolean;
77
75
  /** Close when Escape is pressed. Defaults to `true`. */
78
76
  closeOnEscape?: boolean;
79
- /** Initial pane width passed to CDK. */
80
- width?: OverlayConfig['width'];
81
- /** Initial pane height passed to CDK. */
82
- height?: OverlayConfig['height'];
83
- /** Minimum pane width passed to CDK. */
84
- minWidth?: OverlayConfig['minWidth'];
85
- /** Maximum pane width passed to CDK. */
86
- maxWidth?: OverlayConfig['maxWidth'];
87
- /** Minimum pane height passed to CDK. */
88
- minHeight?: OverlayConfig['minHeight'];
89
- /** Maximum pane height passed to CDK. */
90
- maxHeight?: OverlayConfig['maxHeight'];
77
+ /** Initial pane width. */
78
+ width?: string | number;
79
+ /** Initial pane height. */
80
+ height?: string | number;
81
+ /** Minimum pane width. */
82
+ minWidth?: string | number;
83
+ /** Maximum pane width. */
84
+ maxWidth?: string | number;
85
+ /** Minimum pane height. */
86
+ minHeight?: string | number;
87
+ /** Maximum pane height. */
88
+ maxHeight?: string | number;
91
89
  }
92
90
  /** Result type emitted when a dynamic overlay closes. */
93
91
  type ZDynamicResult<TResult> = TResult | undefined;
@@ -108,7 +106,7 @@ declare class ZDynamicRef<T = unknown, TResult = unknown> {
108
106
  componentInstance: T | null;
109
107
  /** Emits the close result once, then completes. */
110
108
  readonly afterClose: EventEmitter<ZDynamicResult<TResult>>;
111
- constructor(_overlayRef: OverlayRef | undefined, _platformId: object);
109
+ constructor(_overlayRef: ZOverlayRef | undefined, _platformId: object);
112
110
  private _closeOnBackdropClick;
113
111
  private _closeOnEscape;
114
112
  /** Configures close triggers for the instance. */
@@ -117,7 +115,11 @@ declare class ZDynamicRef<T = unknown, TResult = unknown> {
117
115
  isClosed(): boolean;
118
116
  /** Closes the overlay and emits the optional result exactly once. */
119
117
  close(result?: TResult): void;
120
- /** Updates the overlay position using its configured strategy. */
118
+ /**
119
+ * @deprecated Không còn tác dụng — overlay tự do giờ luôn dùng vị trí toàn cục (global),
120
+ * tự canh giữa bằng CSS, không còn "chiến lược định vị" nào cần cập nhật lại. Giữ lại method
121
+ * rỗng để không phá vỡ code đang gọi nó.
122
+ */
121
123
  updatePosition(): void;
122
124
  /** Updates the overlay pane dimensions. */
123
125
  updateSize(width?: string, height?: string): void;
@@ -126,19 +128,19 @@ declare class ZDynamicRef<T = unknown, TResult = unknown> {
126
128
  }
127
129
 
128
130
  /**
129
- * Opens components and templates in a bare CDK overlay.
131
+ * Opens components and templates in a bare global overlay (no anchored positioning).
130
132
  *
131
- * @description The service supplies overlay lifecycle and positioning only. The
132
- * mounted content owns its complete layout, including close controls and styling.
133
+ * @description The service supplies overlay lifecycle only. The mounted content owns its
134
+ * complete layout, including close controls and styling.
133
135
  */
134
136
  declare class ZDynamicService {
135
- private readonly _overlay;
137
+ private readonly _overlayService;
136
138
  private readonly _injector;
137
139
  private readonly _platformId;
138
140
  private readonly _zIndexService;
139
141
  /** Alias for `open`, matching the create-style API used by modal and drawer services. */
140
142
  create<T, TData = unknown, TResult = unknown>(content: ZDynamicContent<T>, options?: ZDynamicOptions<TData>): ZDynamicRef<T, TResult>;
141
- /** Opens a component or template in a free-form CDK overlay. */
143
+ /** Opens a component or template in a free-form global overlay. */
142
144
  open<T, TData = unknown, TResult = unknown>(content: ZDynamicContent<T>, options?: ZDynamicOptions<TData>): ZDynamicRef<T, TResult>;
143
145
  private _createOverlay;
144
146
  private _isTemplate;
@@ -582,6 +584,16 @@ declare class ZOverlayContainerService {
582
584
  static ɵprov: i0.ɵɵInjectableDeclaration<ZOverlayContainerService>;
583
585
  }
584
586
 
587
+ /**
588
+ * Bề mặt tối thiểu mà dịch vụ này cần — khớp cấu trúc với cả CDK `OverlayRef`
589
+ * (z-command, z-gallery-preview, z-dynamic.service vẫn dùng CDK) lẫn `ZOverlayRef`
590
+ * mới (tooltip/popover/modal/drawer), không cần import type từ nơi nào trong hai bên.
591
+ */
592
+ interface ZOverlayZIndexTarget {
593
+ readonly hostElement: HTMLElement;
594
+ readonly backdropElement?: HTMLElement | null;
595
+ }
596
+
585
597
  /**
586
598
  * Global z-index counter for overlay components (z-modal, z-drawer, etc.).
587
599
  *
@@ -597,9 +609,18 @@ declare class ZOverlayZIndexService {
597
609
  * Kept for backward compatibility with existing overlay flow.
598
610
  */
599
611
  next(): number;
600
- applyToOverlay(overlayRef: OverlayRef): number;
601
- deferMoveToTop(overlayRef: OverlayRef): void;
602
- moveToTop(overlayRef: OverlayRef): void;
612
+ applyToOverlay(overlayRef: ZOverlayZIndexTarget): number;
613
+ /**
614
+ * @deprecated Thừa với overlay đã dùng native Popover API (`[popover]` + `showPopover()`):
615
+ * top layer đã tự xếp overlay hiện gần nhất lên trên cùng, hide+show lại chỉ là restack thủ
616
+ * công cho hành vi mà trình duyệt đã làm sẵn. CDK 22 cũng mặc định `usePopover: true` nên
617
+ * z-command/z-gallery-preview cũng đang gọi thừa. Chỉ còn có ý nghĩa làm fallback DOM-reorder
618
+ * (nhánh `else` trong `moveToTop`) cho trình duyệt KHÔNG hỗ trợ Popover API (Chrome <114,
619
+ * Firefox <125, Safari <17). Xoá khi dự án xác nhận không còn cần hỗ trợ nhóm trình duyệt đó.
620
+ */
621
+ deferMoveToTop(overlayRef: ZOverlayZIndexTarget): void;
622
+ /** @deprecated Xem ghi chú tại {@link deferMoveToTop}. */
623
+ moveToTop(overlayRef: ZOverlayZIndexTarget): void;
603
624
  static ɵfac: i0.ɵɵFactoryDeclaration<ZOverlayZIndexService, never>;
604
625
  static ɵprov: i0.ɵɵInjectableDeclaration<ZOverlayZIndexService>;
605
626
  }