@shival99/z-ui 2.0.50 → 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.
@@ -271,7 +274,7 @@ declare class ZAutocompleteComponent<T = unknown> implements OnInit, ControlValu
271
274
 
272
275
  declare const zAutocompleteInputVariants: (props?: ({
273
276
  zSize?: "sm" | "default" | "lg" | null | undefined;
274
- zStatus?: "default" | "disabled" | "readonly" | "open" | "error" | null | undefined;
277
+ zStatus?: "default" | "open" | "error" | "disabled" | "readonly" | null | undefined;
275
278
  } & class_variance_authority_types.ClassProp) | undefined) => string;
276
279
  type ZAutocompleteInputVariants = VariantProps<typeof zAutocompleteInputVariants>;
277
280
  declare const zAutocompleteOptionVariants: (props?: ({
@@ -429,16 +429,16 @@ declare class ZCalendarComponent implements OnInit, ControlValueAccessor {
429
429
 
430
430
  declare const zCalendarVariants: (props?: ({
431
431
  zSize?: "sm" | "default" | "lg" | null | undefined;
432
- zStatus?: "default" | "disabled" | "readonly" | "open" | "error" | null | undefined;
432
+ zStatus?: "default" | "disabled" | "open" | "error" | "readonly" | null | undefined;
433
433
  } & class_variance_authority_types.ClassProp) | undefined) => string;
434
434
  declare const zCalendarDayVariants: (props?: ({
435
- state?: "default" | "disabled" | "today" | "selected" | "inRange" | "rangeStart" | "rangeEnd" | "rangeSingle" | "otherMonth" | "hovered" | null | undefined;
435
+ state?: "default" | "today" | "selected" | "inRange" | "rangeStart" | "rangeEnd" | "rangeSingle" | "disabled" | "otherMonth" | "hovered" | null | undefined;
436
436
  } & class_variance_authority_types.ClassProp) | undefined) => string;
437
437
  declare const zCalendarMonthVariants: (props?: ({
438
- state?: "default" | "current" | "disabled" | "selected" | null | undefined;
438
+ state?: "default" | "selected" | "disabled" | "current" | null | undefined;
439
439
  } & class_variance_authority_types.ClassProp) | undefined) => string;
440
440
  declare const zCalendarYearVariants: (props?: ({
441
- state?: "default" | "current" | "disabled" | "selected" | null | undefined;
441
+ state?: "default" | "selected" | "disabled" | "current" | null | undefined;
442
442
  } & class_variance_authority_types.ClassProp) | undefined) => string;
443
443
 
444
444
  export { ZCalendarComponent, zCalendarDayVariants, zCalendarMonthVariants, zCalendarVariants, zCalendarYearVariants };
@@ -328,7 +328,7 @@ declare const Z_EDITOR_DEFAULT_TOOLBAR: readonly ZEditorToolbarItem[];
328
328
 
329
329
  declare const zEditorVariants: (props?: ({
330
330
  zSize?: "sm" | "default" | "lg" | null | undefined;
331
- zStatus?: "default" | "disabled" | "readonly" | "error" | null | undefined;
331
+ zStatus?: "default" | "error" | "disabled" | "readonly" | null | undefined;
332
332
  zPlaceholderMode?: "firstLine" | "everyLine" | null | undefined;
333
333
  } & class_variance_authority_types.ClassProp) | undefined) => string;
334
334
  type ZEditorVariants = VariantProps<typeof zEditorVariants>;
@@ -188,7 +188,7 @@ declare class ZGalleryComponent implements AfterViewInit {
188
188
  protected readonly headerControlHeight: _angular_core.Signal<"1.75rem" | "2rem" | "2.5rem" | "2.25rem">;
189
189
  protected readonly skeletonMediaHeight: _angular_core.Signal<"9rem" | "14rem" | "11rem">;
190
190
  protected readonly toggleIconSize: _angular_core.Signal<"14" | "16" | "20" | "18">;
191
- protected readonly searchInputSize: _angular_core.Signal<"default" | "sm" | "lg">;
191
+ protected readonly searchInputSize: _angular_core.Signal<"sm" | "default" | "lg">;
192
192
  protected readonly filteredFiles: _angular_core.Signal<ZGalleryFile[]>;
193
193
  protected readonly selectedIds: _angular_core.Signal<Set<string>>;
194
194
  protected readonly isAllSelected: _angular_core.Signal<boolean>;
@@ -382,16 +382,16 @@ declare const isPreviewable: (file: ZGalleryFile) => boolean;
382
382
  declare const isImage: (file: ZGalleryFile) => boolean;
383
383
 
384
384
  declare const zGalleryVariants: (props?: ({
385
- zSize?: "default" | "sm" | "lg" | null | undefined;
385
+ zSize?: "sm" | "default" | "lg" | null | undefined;
386
386
  } & class_variance_authority_types.ClassProp) | undefined) => string;
387
387
  type ZGalleryVariants = VariantProps<typeof zGalleryVariants>;
388
388
  declare const zGalleryItemVariants: (props?: ({
389
389
  zMode?: "grid" | "list" | null | undefined;
390
- zSize?: "default" | "sm" | "lg" | null | undefined;
390
+ zSize?: "sm" | "default" | "lg" | null | undefined;
391
391
  } & class_variance_authority_types.ClassProp) | undefined) => string;
392
392
  type ZGalleryItemVariants = VariantProps<typeof zGalleryItemVariants>;
393
393
  declare const zGalleryFileIconVariants: (props?: ({
394
- zSize?: "default" | "sm" | "lg" | null | undefined;
394
+ zSize?: "sm" | "default" | "lg" | null | undefined;
395
395
  zMode?: "grid" | "list" | null | undefined;
396
396
  } & class_variance_authority_types.ClassProp) | undefined) => string;
397
397
  type ZGalleryFileIconVariants = VariantProps<typeof zGalleryFileIconVariants>;
@@ -89,7 +89,7 @@ declare class ZPopoverDirective implements OnInit, OnDestroy {
89
89
  readonly zHideDelay: _angular_core.InputSignal<number>;
90
90
  readonly zDisabled: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
91
91
  readonly zOffset: _angular_core.InputSignal<number>;
92
- readonly zPopoverWidth: _angular_core.InputSignal<number | "auto" | "trigger">;
92
+ readonly zPopoverWidth: _angular_core.InputSignal<number | "trigger" | "auto">;
93
93
  readonly zTriggerRef: _angular_core.InputSignal<HTMLElement | ElementRef<HTMLElement> | null>;
94
94
  readonly zManualClose: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
95
95
  readonly zOutsideClickClose: _angular_core.InputSignalWithTransform<boolean, string | 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
  }
@@ -316,7 +323,7 @@ declare class ZTagClassesPipe implements PipeTransform {
316
323
 
317
324
  declare const zSelectVariants: (props?: ({
318
325
  zSize?: "sm" | "default" | "lg" | null | undefined;
319
- zStatus?: "default" | "disabled" | "readonly" | "open" | "error" | null | undefined;
326
+ zStatus?: "default" | "open" | "error" | "disabled" | "readonly" | null | undefined;
320
327
  } & class_variance_authority_types.ClassProp) | undefined) => string;
321
328
  declare const zSelectTagVariants: (props?: ({
322
329
  zSize?: "sm" | "default" | "lg" | null | undefined;
@@ -100,7 +100,7 @@ declare class ZUploadComponent implements OnInit, ControlValueAccessor {
100
100
  protected readonly hasError: _angular_core.Signal<boolean>;
101
101
  protected readonly showError: _angular_core.Signal<boolean>;
102
102
  protected readonly errorMessage: _angular_core.Signal<string>;
103
- protected readonly currentStatus: _angular_core.Signal<"default" | "disabled" | "readonly" | "error" | "active">;
103
+ protected readonly currentStatus: _angular_core.Signal<"default" | "error" | "disabled" | "readonly" | "active">;
104
104
  protected readonly dropzoneClasses: _angular_core.Signal<string>;
105
105
  protected readonly acceptTypes: _angular_core.Signal<string>;
106
106
  protected readonly formatFileSize: (bytes: number) => string;
@@ -141,11 +141,11 @@ declare class ZUploadComponent implements OnInit, ControlValueAccessor {
141
141
 
142
142
  declare const zUploadDropzoneVariants: (props?: ({
143
143
  zSize?: "sm" | "default" | "lg" | null | undefined;
144
- zStatus?: "default" | "disabled" | "readonly" | "error" | "active" | null | undefined;
144
+ zStatus?: "default" | "error" | "active" | "disabled" | "readonly" | null | undefined;
145
145
  } & class_variance_authority_types.ClassProp) | undefined) => string;
146
146
  type ZUploadDropzoneVariants = VariantProps<typeof zUploadDropzoneVariants>;
147
147
  declare const zUploadFileItemVariants: (props?: ({
148
- zStatus?: "error" | "pending" | "uploading" | "success" | null | undefined;
148
+ zStatus?: "pending" | "uploading" | "success" | "error" | null | undefined;
149
149
  } & class_variance_authority_types.ClassProp) | undefined) => string;
150
150
  type ZUploadFileItemVariants = VariantProps<typeof zUploadFileItemVariants>;
151
151
 
@@ -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 };