@shival99/z-ui 2.0.49 → 2.0.51

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.
@@ -78,7 +78,8 @@ interface ZAutocompleteControl<T = unknown> {
78
78
  close: () => void;
79
79
  setValue: (value: string) => void;
80
80
  value: Signal<string>;
81
- selectedOption: Signal<ZAutocompleteOption<T> | null>;
81
+ /** Signal with selected options. Autocomplete returns an empty or one-item array. */
82
+ selected: Signal<ZAutocompleteOption<T>[]>;
82
83
  /**
83
84
  * @deprecated Use individual event outputs (zOnFocus, zOnBlur, etc.) instead.
84
85
  * Will be removed in a future version.
@@ -180,6 +181,7 @@ declare class ZAutocompleteComponent<T = unknown> implements OnInit, ControlValu
180
181
  private readonly _measureVirtualItems;
181
182
  protected readonly config: _angular_core.Signal<ZAutocompleteConfig<T>>;
182
183
  protected readonly hasAsyncOptions: _angular_core.Signal<boolean>;
184
+ protected readonly asyncSelectedOptions: _angular_core.Signal<ZAutocompleteOption<T>[]>;
183
185
  protected readonly sourceOptions: _angular_core.Signal<ZAutocompleteOption<T>[]>;
184
186
  protected readonly isLoading: _angular_core.Signal<boolean>;
185
187
  protected readonly isLoadingMore: _angular_core.Signal<boolean>;
@@ -194,6 +196,7 @@ declare class ZAutocompleteComponent<T = unknown> implements OnInit, ControlValu
194
196
  protected readonly effectiveDebounceTime: _angular_core.Signal<number>;
195
197
  protected readonly effectiveOptionTemplate: _angular_core.Signal<TemplateRef<any> | null>;
196
198
  protected readonly hasCustomOptionTemplate: _angular_core.Signal<boolean>;
199
+ protected readonly selected: _angular_core.Signal<ZAutocompleteOption<T>[]>;
197
200
  protected readonly highlightQuery: _angular_core.Signal<string>;
198
201
  /**
199
202
  * Local-mode loading state after debounce to avoid quick flicker.
@@ -140,6 +140,9 @@ interface ZGalleryPreviewOptions {
140
140
  type ZGalleryPreviewItemOptions = Omit<ZGalleryPreviewOptions, 'file' | 'files'>;
141
141
 
142
142
  declare class ZGalleryComponent implements AfterViewInit {
143
+ private readonly _destroyRef;
144
+ private readonly _previewService;
145
+ private _previewRef;
143
146
  readonly zFiles: _angular_core.InputSignal<ZGalleryFile[]>;
144
147
  readonly zMode: _angular_core.ModelSignal<ZGalleryMode>;
145
148
  readonly zSize: _angular_core.InputSignal<ZGallerySize>;
@@ -174,7 +177,6 @@ declare class ZGalleryComponent implements AfterViewInit {
174
177
  readonly zSelectionChange: _angular_core.OutputEmitterRef<ZGallerySelectionChange>;
175
178
  readonly zOnAction: _angular_core.OutputEmitterRef<ZGalleryActionEvent>;
176
179
  protected readonly modeIndex: _angular_core.WritableSignal<number | null>;
177
- protected readonly previewFile: _angular_core.WritableSignal<ZGalleryFile | null>;
178
180
  protected readonly searchInputQuery: _angular_core.WritableSignal<string>;
179
181
  protected readonly searchQuery: _angular_core.WritableSignal<string>;
180
182
  protected readonly skeletonItems: _angular_core.Signal<number[]>;
@@ -198,8 +200,8 @@ declare class ZGalleryComponent implements AfterViewInit {
198
200
  protected onPreview(file: ZGalleryFile): void;
199
201
  protected onRemove(file: ZGalleryFile): void;
200
202
  protected closePreview(): void;
201
- protected onNavigatePreview(file: ZGalleryFile): void;
202
203
  protected onRemoveFromPreview(file: ZGalleryFile): void;
204
+ private _openPreview;
203
205
  protected isFileSelected(file: ZGalleryFile): boolean;
204
206
  protected toggleSelection(file: ZGalleryFile): void;
205
207
  protected selectAll(): void;
@@ -251,7 +251,7 @@ declare class ZModalComponent<T, U> extends BasePortalOutlet implements OnDestro
251
251
  protected readonly effectiveOkText: _angular_core.Signal<string | null | undefined>;
252
252
  protected readonly effectiveCancelText: _angular_core.Signal<string | null | undefined>;
253
253
  protected readonly effectiveOkDestructive: _angular_core.Signal<boolean | undefined>;
254
- protected readonly effectiveTypeOk: _angular_core.Signal<"info" | "warning" | "error" | "link" | "default" | "primary" | "secondary" | "destructive" | "destructive-heartbeat" | "success" | "outline" | "outline-primary" | "outline-secondary" | "outline-success" | "outline-info" | "outline-warning" | "outline-error" | "outline-destructive" | "outline-shimmer" | "outline-success-secondary" | "outline-info-secondary" | "outline-warning-secondary" | "outline-error-secondary" | "outline-destructive-secondary" | "outline-primary-secondary" | "outline-primary-soft" | "outline-success-soft" | "outline-info-soft" | "outline-warning-soft" | "outline-error-soft" | "outline-destructive-soft" | "outline-primary-soft-border" | "outline-success-soft-border" | "outline-info-soft-border" | "outline-warning-soft-border" | "outline-error-soft-border" | "outline-destructive-soft-border" | "ghost" | "ghost-primary" | "ghost-success" | "ghost-info" | "ghost-warning" | "ghost-error" | "ghost-destructive" | "subtle" | "subtle-primary" | "subtle-success" | "subtle-info" | "subtle-warning" | "subtle-destructive" | "subtle-outline" | "subtle-primary-outline" | "subtle-success-outline" | "subtle-info-outline" | "subtle-warning-outline" | "subtle-destructive-outline" | null | undefined>;
254
+ protected readonly effectiveTypeOk: _angular_core.Signal<"info" | "warning" | "error" | "default" | "primary" | "secondary" | "destructive" | "destructive-heartbeat" | "success" | "outline" | "outline-primary" | "outline-secondary" | "outline-success" | "outline-info" | "outline-warning" | "outline-error" | "outline-destructive" | "outline-shimmer" | "outline-success-secondary" | "outline-info-secondary" | "outline-warning-secondary" | "outline-error-secondary" | "outline-destructive-secondary" | "outline-primary-secondary" | "outline-primary-soft" | "outline-success-soft" | "outline-info-soft" | "outline-warning-soft" | "outline-error-soft" | "outline-destructive-soft" | "outline-primary-soft-border" | "outline-success-soft-border" | "outline-info-soft-border" | "outline-warning-soft-border" | "outline-error-soft-border" | "outline-destructive-soft-border" | "ghost" | "ghost-primary" | "ghost-success" | "ghost-info" | "ghost-warning" | "ghost-error" | "ghost-destructive" | "subtle" | "subtle-primary" | "subtle-success" | "subtle-info" | "subtle-warning" | "subtle-destructive" | "subtle-outline" | "subtle-primary-outline" | "subtle-success-outline" | "subtle-info-outline" | "subtle-warning-outline" | "subtle-destructive-outline" | "link" | null | undefined>;
255
255
  protected readonly effectiveOkDisabled: _angular_core.Signal<boolean | undefined>;
256
256
  protected readonly effectiveLoading: _angular_core.Signal<boolean>;
257
257
  protected readonly effectiveContentLoading: _angular_core.Signal<boolean>;
@@ -45,10 +45,8 @@ interface ZSelectControl<T = unknown> {
45
45
  isOpen: Signal<boolean>;
46
46
  /** Signal with current value */
47
47
  value: Signal<T | T[] | null>;
48
- /** Signal with currently selected option (single mode) */
49
- selectedOption: Signal<ZSelectOption<T> | null>;
50
- /** Signal with all selected options (multiple/tags mode) */
51
- selectedOptions: Signal<ZSelectOption<T>[]>;
48
+ /** Signal with selected options. Single mode returns an empty or one-item array. */
49
+ selected: Signal<ZSelectOption<T>[]>;
52
50
  /** Signal with current error message */
53
51
  errorMessage: Signal<string>;
54
52
  }
@@ -187,12 +185,15 @@ declare class ZSelectComponent<T = unknown> implements OnInit, ControlValueAcces
187
185
  }>;
188
186
  protected readonly selectId: string;
189
187
  protected readonly dropdownId: string;
188
+ protected readonly actualPosition: _angular_core.WritableSignal<ZPopoverPosition>;
189
+ protected readonly isPositionTop: _angular_core.Signal<boolean>;
190
190
  protected readonly searchText: _angular_core.WritableSignal<string>;
191
191
  protected readonly dropdownWidth: _angular_core.WritableSignal<number>;
192
192
  protected readonly currentValue: _angular_core.Signal<T | T[] | null>;
193
193
  protected readonly config: _angular_core.Signal<ZSelectConfig<T>>;
194
194
  protected readonly hasAsyncOptions: _angular_core.Signal<boolean>;
195
195
  protected readonly sourceOptions: _angular_core.Signal<ZSelectOption<T>[]>;
196
+ protected readonly asyncSelectedOptions: _angular_core.Signal<ZSelectOption<T>[]>;
196
197
  protected readonly isLoading: _angular_core.Signal<boolean>;
197
198
  protected readonly isLoadingMore: _angular_core.Signal<boolean>;
198
199
  protected readonly canLoadMore: _angular_core.Signal<boolean>;
@@ -209,6 +210,7 @@ declare class ZSelectComponent<T = unknown> implements OnInit, ControlValueAcces
209
210
  protected readonly effectiveClearAllText: _angular_core.Signal<string>;
210
211
  protected readonly effectiveRequiredErrorText: _angular_core.Signal<string>;
211
212
  protected readonly translatedOptions: _angular_core.Signal<ZSelectOption<T>[]>;
213
+ protected readonly translatedAsyncSelectedOptions: _angular_core.Signal<ZSelectOption<T>[]>;
212
214
  protected readonly isMultipleMode: _angular_core.Signal<boolean>;
213
215
  protected readonly isTagsMode: _angular_core.Signal<boolean>;
214
216
  protected readonly effectiveSelectedTemplate: _angular_core.Signal<TemplateRef<any> | null>;
@@ -217,6 +219,7 @@ declare class ZSelectComponent<T = unknown> implements OnInit, ControlValueAcces
217
219
  protected readonly shouldUseVirtualScroll: _angular_core.Signal<boolean>;
218
220
  protected readonly selectedOption: _angular_core.Signal<ZSelectOption<T> | null>;
219
221
  protected readonly selectedOptions: _angular_core.Signal<ZSelectOption<T>[]>;
222
+ protected readonly selected: _angular_core.Signal<ZSelectOption<T>[]>;
220
223
  protected readonly displayedTags: _angular_core.Signal<ZSelectOption<T>[]>;
221
224
  protected readonly remainingCount: _angular_core.Signal<number>;
222
225
  protected readonly hasValue: _angular_core.Signal<boolean>;
@@ -266,6 +269,7 @@ declare class ZSelectComponent<T = unknown> implements OnInit, ControlValueAcces
266
269
  protected onPopoverShow(): void;
267
270
  protected onPopoverHideStart(): void;
268
271
  protected onPopoverHideEnd(): void;
272
+ protected onPositionChange(position: ZPopoverPosition): void;
269
273
  protected onSearchChange(value: string): void;
270
274
  protected checkScrollShadow(): void;
271
275
  protected selectOption(option: ZSelectOption<T>, closeFn?: () => void): void;
@@ -275,6 +279,9 @@ declare class ZSelectComponent<T = unknown> implements OnInit, ControlValueAcces
275
279
  protected removeAll(): void;
276
280
  protected toggleSelectAllAction(): void;
277
281
  protected trackByValue: (_index: number, option: ZSelectOption<T>) => unknown;
282
+ private _findOptionByValue;
283
+ private _getOptionKey;
284
+ private _isValueEqual;
278
285
  private _emitControl;
279
286
  private _loadAsyncOptionsOnFocus;
280
287
  private _loadAsyncOptions;
@@ -297,7 +304,7 @@ declare class ZSelectComponent<T = unknown> implements OnInit, ControlValueAcces
297
304
  }
298
305
 
299
306
  declare class ZIsSelectedPipe implements PipeTransform {
300
- transform<T>(option: ZSelectOption<T>, value: T | T[] | null, isMultipleMode: boolean): boolean;
307
+ transform<T>(option: ZSelectOption<T>, value: T | T[] | null, isMultipleMode: boolean, zKey?: string): boolean;
301
308
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ZIsSelectedPipe, never>;
302
309
  static ɵpipe: _angular_core.ɵɵPipeDeclaration<ZIsSelectedPipe, "zIsSelected", true>;
303
310
  }
@@ -1263,7 +1263,7 @@ declare class ZTableFilterComponent<T> {
1263
1263
  protected readonly sortOptions: _angular_core.Signal<ZSelectOption<string>[]>;
1264
1264
  protected readonly draftFilters: _angular_core.WritableSignal<ZTableDraftFilterCondition[]>;
1265
1265
  protected readonly draftLegacyFilterValue: _angular_core.WritableSignal<unknown>;
1266
- protected readonly draftSortState: _angular_core.WritableSignal<false | "desc" | "asc">;
1266
+ protected readonly draftSortState: _angular_core.WritableSignal<false | "asc" | "desc">;
1267
1267
  protected readonly columnFilterValue: _angular_core.Signal<unknown>;
1268
1268
  protected readonly effectiveFilterValue: _angular_core.Signal<unknown>;
1269
1269
  protected readonly sortState: _angular_core.Signal<false | _tanstack_angular_table.SortDirection>;
@@ -1285,7 +1285,7 @@ declare class ZTableFilterComponent<T> {
1285
1285
  protected readonly filterBadgeCount: _angular_core.Signal<number>;
1286
1286
  protected readonly hasFilterValue: _angular_core.Signal<boolean>;
1287
1287
  protected readonly isActive: _angular_core.Signal<boolean>;
1288
- protected readonly draftSortValue: _angular_core.Signal<"none" | "desc" | "asc">;
1288
+ protected readonly draftSortValue: _angular_core.Signal<"asc" | "desc" | "none">;
1289
1289
  protected readonly rangeMinValue: _angular_core.Signal<any>;
1290
1290
  protected readonly rangeMaxValue: _angular_core.Signal<any>;
1291
1291
  protected readonly dateValue: _angular_core.Signal<Date | null>;
@@ -1353,7 +1353,7 @@ declare class ZTableActionsComponent<T = unknown> {
1353
1353
  readonly zConfig: _angular_core.InputSignal<ZTableActionColumnConfig<T>>;
1354
1354
  readonly zRow: _angular_core.InputSignal<T>;
1355
1355
  readonly zRowId: _angular_core.InputSignal<string>;
1356
- readonly zDropdownButtonSize: _angular_core.InputSignal<"sm" | "default" | "lg" | "xs" | "xl" | null | undefined>;
1356
+ readonly zDropdownButtonSize: _angular_core.InputSignal<"default" | "sm" | "lg" | "xs" | "xl" | null | undefined>;
1357
1357
  readonly zActionClick: _angular_core.OutputEmitterRef<ZTableActionClickEvent<T>>;
1358
1358
  protected readonly allActions: _angular_core.Signal<ZTableActionItem<T>[]>;
1359
1359
  protected readonly shouldShowAsButtons: _angular_core.Signal<boolean>;
@@ -492,7 +492,7 @@ declare class ZOverlayZIndexService {
492
492
  * Kept for backward compatibility with existing overlay flow.
493
493
  */
494
494
  next(): number;
495
- applyToOverlay(_overlayRef: OverlayRef): number;
495
+ applyToOverlay(overlayRef: OverlayRef): number;
496
496
  deferMoveToTop(overlayRef: OverlayRef): void;
497
497
  moveToTop(overlayRef: OverlayRef): void;
498
498
  static ɵfac: i0.ɵɵFactoryDeclaration<ZOverlayZIndexService, never>;
@@ -113,6 +113,8 @@ interface ZAsyncOptionsConfig<TOption> {
113
113
  pageSize?: number;
114
114
  /** Tự tải trang đầu khi dropdown mở/focus, kể cả keyword rỗng. */
115
115
  loadOnFocus?: boolean;
116
+ /** Các option đang được chọn cần giữ lại để hiển thị nhãn dù không nằm trong trang async hiện tại. */
117
+ selectedOptions?: TOption[] | (() => TOption[]);
116
118
  /** Khóa chống trùng khi append trang mới, ví dụ: option => option.value.code. */
117
119
  dedupeBy?: (option: TOption) => unknown;
118
120
  }
@@ -123,6 +125,8 @@ declare const Z_ASYNC_OPTIONS_DEFAULT_PAGE_SIZE = 20;
123
125
  declare function zToAsyncOptionsObservable<TOption>(result: ZAsyncOptionsLoadResult<TOption>): Observable<ZAsyncOptionsResult<TOption>>;
124
126
  /** Gộp option mới vào danh sách cũ và loại bỏ phần tử trùng theo dedupeBy/default key. */
125
127
  declare function zMergeAsyncOptions<TOption>(current: TOption[], next: TOption[], dedupeBy?: ZAsyncOptionsConfig<TOption>['dedupeBy']): TOption[];
128
+ /** Lấy option đang chọn từ config, hỗ trợ truyền mảng tĩnh hoặc signal/computed. */
129
+ declare function zResolveAsyncSelectedOptions<TOption>(config: ZAsyncOptionsConfig<TOption> | undefined): TOption[];
126
130
  /** Tính còn dữ liệu để load-more dựa trên hasMore, total hoặc độ dài page vừa trả về. */
127
131
  declare function zResolveAsyncOptionsHasMore<TOption>(result: ZAsyncOptionsResult<TOption>, pageSize: number, loadedCount: number): boolean;
128
132
  /** Lấy khóa ổn định cho option, hỗ trợ value là object và vẫn cho phép truyền dedupeBy riêng. */
@@ -213,5 +217,5 @@ interface ZFormDebugOptions {
213
217
  logLevel?: 'error' | 'warn' | 'log';
214
218
  }
215
219
 
216
- export { VIETNAMESE_MAP, Z_ASYNC_OPTIONS_DEFAULT_PAGE_SIZE, Z_DIVIDE_SCALE, Z_EMOJI_KEYWORDS, Z_EMOJI_SHEET, Z_EXCEL_NUMBER_FORMAT_MAP, Z_LOCALE_MAP, zCapitalCase, zCleanObject, zConvertColorToArgb, zCreateEvent, zDebugFormInvalid, zDecodeUnicode, zDetectBrowser, zFormatNum, zFormatNumExcel, zGetAsyncOptionKey, zMergeAsyncOptions, zMergeClasses, zMiniSearch, zMiniSearch$, zNoop, zNormalize, zRandomColor, zRegisterEchartsTheme, zRemoveVietnamese, zResolveAsyncOptionsHasMore, zToAsyncOptionsObservable, zTransform, zTreeBuild, zTreeFlatten, zUuid, zValidForm };
220
+ export { VIETNAMESE_MAP, Z_ASYNC_OPTIONS_DEFAULT_PAGE_SIZE, Z_DIVIDE_SCALE, Z_EMOJI_KEYWORDS, Z_EMOJI_SHEET, Z_EXCEL_NUMBER_FORMAT_MAP, Z_LOCALE_MAP, zCapitalCase, zCleanObject, zConvertColorToArgb, zCreateEvent, zDebugFormInvalid, zDecodeUnicode, zDetectBrowser, zFormatNum, zFormatNumExcel, zGetAsyncOptionKey, zMergeAsyncOptions, zMergeClasses, zMiniSearch, zMiniSearch$, zNoop, zNormalize, zRandomColor, zRegisterEchartsTheme, zRemoveVietnamese, zResolveAsyncOptionsHasMore, zResolveAsyncSelectedOptions, zToAsyncOptionsObservable, zTransform, zTreeBuild, zTreeFlatten, zUuid, zValidForm };
217
221
  export type { ZAsyncOptionsConfig, ZAsyncOptionsLoadFn, ZAsyncOptionsLoadResult, ZAsyncOptionsQuery, ZAsyncOptionsResult, ZBlurEventData, ZBrowserInfo, ZBrowserName, ZCapitalizeType, ZChangeEventData, ZClickEventData, ZCopyEventData, ZCutEventData, ZDblclickEventData, ZDeviceType, ZDragenterEventData, ZDragleaveEventData, ZDragoverEventData, ZDropEventData, ZEchartsThemeOptions, ZEmojiCategory, ZEmojiEntry, ZEmptyCheck, ZEvent, ZEventType, ZFocusEventData, ZFormDebugOptions, ZFormSubmitResult, ZFormatNumExcelOptions, ZFormatNumOptions, ZInputEventData, ZKeydownEventData, ZKeypressEventData, ZKeyupEventData, ZMousedownEventData, ZMouseenterEventData, ZMouseleaveEventData, ZMouseoutEventData, ZMouseoverEventData, ZMouseupEventData, ZNavigatorUABrandVersion, ZNavigatorUAData, ZNumberDivide, ZPasteEventData, ZTouchendEventData, ZTouchmoveEventData, ZTouchstartEventData };