@shival99/z-ui 1.9.23 → 1.9.24

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.
@@ -13,8 +13,8 @@ import { ZPopoverDirective } from '@shival99/z-ui/components/z-popover';
13
13
  import { ZTooltipDirective } from '@shival99/z-ui/components/z-tooltip';
14
14
  import { ZHighlightPipe, ZSafeHtmlPipe } from '@shival99/z-ui/pipes';
15
15
  import { ZTranslateService } from '@shival99/z-ui/services';
16
- import { zRemoveVietnamese, zMergeClasses, zTransform, zUuid, zCreateEvent } from '@shival99/z-ui/utils';
17
- import { Subject, debounceTime, merge, filter, isObservable, takeUntil, catchError, of, firstValueFrom } from 'rxjs';
16
+ import { zRemoveVietnamese, zMergeClasses, zTransform, zUuid, zMergeAsyncOptions, zCreateEvent, Z_ASYNC_OPTIONS_DEFAULT_PAGE_SIZE, zToAsyncOptionsObservable, zResolveAsyncOptionsHasMore } from '@shival99/z-ui/utils';
17
+ import { Subject, debounceTime, merge, filter, finalize, isObservable, takeUntil, catchError, of, firstValueFrom } from 'rxjs';
18
18
  import { cva } from 'class-variance-authority';
19
19
 
20
20
  class ZSelectOptionDirective {
@@ -137,6 +137,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
137
137
  }]
138
138
  }] });
139
139
 
140
+ const Z_SELECT_DEFAULT_CONFIG = {
141
+ minLength: 0,
142
+ debounceTime: 300,
143
+ };
140
144
  const TAG_COLORS = [
141
145
  {
142
146
  bg: 'bg-blue-100 dark:bg-blue-950',
@@ -283,6 +287,7 @@ class ZSelectComponent {
283
287
  zVirtualScroll = input(false, { ...(ngDevMode ? { debugName: "zVirtualScroll" } : {}), transform: zTransform });
284
288
  zShowAction = input(false, { ...(ngDevMode ? { debugName: "zShowAction" } : {}), transform: zTransform });
285
289
  zOptions = input([], ...(ngDevMode ? [{ debugName: "zOptions" }] : []));
290
+ zConfig = input({}, ...(ngDevMode ? [{ debugName: "zConfig" }] : []));
286
291
  zTranslateLabels = input(true, { ...(ngDevMode ? { debugName: "zTranslateLabels" } : {}), transform: zTransform });
287
292
  zKey = input('', ...(ngDevMode ? [{ debugName: "zKey" }] : []));
288
293
  zSearchServer = input(false, { ...(ngDevMode ? { debugName: "zSearchServer" } : {}), transform: zTransform });
@@ -307,6 +312,12 @@ class ZSelectComponent {
307
312
  _allKnownOptions = signal([], ...(ngDevMode ? [{ debugName: "_allKnownOptions" }] : []));
308
313
  _asyncErrors = signal(new Map(), ...(ngDevMode ? [{ debugName: "_asyncErrors" }] : []));
309
314
  _customError = signal(null, ...(ngDevMode ? [{ debugName: "_customError" }] : []));
315
+ _asyncOptions = signal([], ...(ngDevMode ? [{ debugName: "_asyncOptions" }] : []));
316
+ _asyncKeyword = signal('', ...(ngDevMode ? [{ debugName: "_asyncKeyword" }] : []));
317
+ _asyncPage = signal(1, ...(ngDevMode ? [{ debugName: "_asyncPage" }] : []));
318
+ _asyncHasMore = signal(false, ...(ngDevMode ? [{ debugName: "_asyncHasMore" }] : []));
319
+ _asyncLoading = signal(false, ...(ngDevMode ? [{ debugName: "_asyncLoading" }] : []));
320
+ _asyncLoadingMore = signal(false, ...(ngDevMode ? [{ debugName: "_asyncLoadingMore" }] : []));
310
321
  uiState = signal({
311
322
  isOpen: false,
312
323
  hasScrollShadow: false,
@@ -320,6 +331,16 @@ class ZSelectComponent {
320
331
  searchText = signal('', ...(ngDevMode ? [{ debugName: "searchText" }] : []));
321
332
  dropdownWidth = signal(0, ...(ngDevMode ? [{ debugName: "dropdownWidth" }] : []));
322
333
  currentValue = this._value.asReadonly();
334
+ config = computed(() => ({
335
+ ...Z_SELECT_DEFAULT_CONFIG,
336
+ ...this.zConfig(),
337
+ }), ...(ngDevMode ? [{ debugName: "config" }] : []));
338
+ hasAsyncOptions = computed(() => !!this.config().async?.load, ...(ngDevMode ? [{ debugName: "hasAsyncOptions" }] : []));
339
+ sourceOptions = computed(() => (this.hasAsyncOptions() ? this._asyncOptions() : this.zOptions()), ...(ngDevMode ? [{ debugName: "sourceOptions" }] : []));
340
+ isLoading = computed(() => this.zLoading() || this._asyncLoading(), ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
341
+ isLoadingMore = computed(() => this.zLoadingMore() || this._asyncLoadingMore(), ...(ngDevMode ? [{ debugName: "isLoadingMore" }] : []));
342
+ canLoadMore = computed(() => this.hasAsyncOptions() ? this._asyncHasMore() : this.zEnableLoadMore(), ...(ngDevMode ? [{ debugName: "canLoadMore" }] : []));
343
+ effectiveDebounceTime = computed(() => this.zConfig().debounceTime ?? this.zDebounce(), ...(ngDevMode ? [{ debugName: "effectiveDebounceTime" }] : []));
323
344
  virtualizer = injectVirtualizer(() => ({
324
345
  scrollElement: this.virtualScrollRef(),
325
346
  count: this.filteredOptions().length,
@@ -359,7 +380,7 @@ class ZSelectComponent {
359
380
  }, ...(ngDevMode ? [{ debugName: "effectiveRequiredErrorText" }] : []));
360
381
  translatedOptions = computed(() => {
361
382
  this._zTranslate.currentLang();
362
- const options = this.zOptions();
383
+ const options = this.sourceOptions();
363
384
  if (!this.zTranslateLabels()) {
364
385
  return options;
365
386
  }
@@ -387,18 +408,24 @@ class ZSelectComponent {
387
408
  }
388
409
  return this.zOptionTemplate();
389
410
  }, ...(ngDevMode ? [{ debugName: "effectiveOptionTemplate" }] : []));
411
+ knownOptions = computed(() => {
412
+ if (this.zSearchServer() || this.hasAsyncOptions()) {
413
+ return this._allKnownOptions();
414
+ }
415
+ return this.translatedOptions();
416
+ }, ...(ngDevMode ? [{ debugName: "knownOptions" }] : []));
390
417
  shouldUseVirtualScroll = computed(() => {
391
418
  if (this.zVirtualScroll()) {
392
419
  return true;
393
420
  }
394
421
  const maxVisible = this.zMaxVisible();
395
- if (maxVisible !== null && this.zOptions().length > maxVisible) {
422
+ if (maxVisible !== null && this.sourceOptions().length > maxVisible) {
396
423
  return true;
397
424
  }
398
- if (this.zEnableLoadMore()) {
425
+ if (this.canLoadMore()) {
399
426
  return false;
400
427
  }
401
- return this.zOptions().length > 50;
428
+ return this.sourceOptions().length > 50;
402
429
  }, ...(ngDevMode ? [{ debugName: "shouldUseVirtualScroll" }] : []));
403
430
  selectedOption = computed(() => {
404
431
  this._zTranslate.currentLang();
@@ -409,7 +436,7 @@ class ZSelectComponent {
409
436
  if (value === null || value === undefined) {
410
437
  return null;
411
438
  }
412
- const options = this.zSearchServer() ? this._allKnownOptions() : this.translatedOptions();
439
+ const options = this.knownOptions();
413
440
  return options.find(opt => opt.value === value) ?? null;
414
441
  }, ...(ngDevMode ? [{ debugName: "selectedOption" }] : []));
415
442
  selectedOptions = computed(() => {
@@ -421,7 +448,7 @@ class ZSelectComponent {
421
448
  if (!Array.isArray(value)) {
422
449
  return [];
423
450
  }
424
- const options = this.zSearchServer() ? this._allKnownOptions() : this.translatedOptions();
451
+ const options = this.knownOptions();
425
452
  return value
426
453
  .map(v => options.find(opt => opt.value === v))
427
454
  .filter((opt) => opt !== undefined);
@@ -446,7 +473,7 @@ class ZSelectComponent {
446
473
  if (!this.isMultipleMode()) {
447
474
  return false;
448
475
  }
449
- const enabledValues = this.zOptions()
476
+ const enabledValues = this.translatedOptions()
450
477
  .filter(option => !option.disabled)
451
478
  .map(option => option.value);
452
479
  if (enabledValues.length === 0) {
@@ -460,19 +487,19 @@ class ZSelectComponent {
460
487
  return enabledValues.every(value => selectedSet.has(value));
461
488
  }, ...(ngDevMode ? [{ debugName: "isAllSelected" }] : []));
462
489
  filteredOptions = computed(() => {
463
- if (this.zSearchServer()) {
490
+ if (this.zSearchServer() || this.hasAsyncOptions()) {
464
491
  return this.translatedOptions();
465
492
  }
466
493
  return filterOptions(this.translatedOptions(), this.searchText());
467
494
  }, ...(ngDevMode ? [{ debugName: "filteredOptions" }] : []));
468
495
  isEmptyData = computed(() => {
469
- if (this.zSearchServer() && this.searchText().trim()) {
496
+ if ((this.zSearchServer() || this.hasAsyncOptions()) && this.searchText().trim()) {
470
497
  return false;
471
498
  }
472
499
  return this.translatedOptions().length === 0;
473
500
  }, ...(ngDevMode ? [{ debugName: "isEmptyData" }] : []));
474
501
  isNoSearchResults = computed(() => {
475
- if (this.zSearchServer() && this.searchText().trim()) {
502
+ if ((this.zSearchServer() || this.hasAsyncOptions()) && this.searchText().trim()) {
476
503
  return this.translatedOptions().length === 0;
477
504
  }
478
505
  const noFiltered = this.filteredOptions().length === 0;
@@ -580,6 +607,8 @@ class ZSelectComponent {
580
607
  _asyncValidationSubject = new Subject();
581
608
  _loadMoreObserver = null;
582
609
  _virtualScrollListener = null;
610
+ _asyncLoadSubscription = null;
611
+ _asyncRequestId = 0;
583
612
  _asyncValidationAbortController = null;
584
613
  _onChange = () => void 0;
585
614
  _onTouched = () => void 0;
@@ -587,15 +616,14 @@ class ZSelectComponent {
587
616
  _isNgModel = signal(false, ...(ngDevMode ? [{ debugName: "_isNgModel" }] : []));
588
617
  constructor() {
589
618
  effect(() => {
590
- if (!this.zSearchServer()) {
619
+ if (!this.zSearchServer() && !this.hasAsyncOptions()) {
591
620
  return;
592
621
  }
593
- const newOpts = this.zOptions();
622
+ const newOpts = this.sourceOptions();
594
623
  const known = this._allKnownOptions();
595
- const knownValues = new Set(known.map(o => o.value));
596
- const toAdd = newOpts.filter(o => !knownValues.has(o.value));
597
- if (toAdd.length > 0) {
598
- this._allKnownOptions.set([...known, ...toAdd]);
624
+ const merged = zMergeAsyncOptions(known, newOpts, this.config().async?.dedupeBy);
625
+ if (merged.length > known.length) {
626
+ this._allKnownOptions.set(merged);
599
627
  }
600
628
  });
601
629
  effect(() => {
@@ -638,7 +666,7 @@ class ZSelectComponent {
638
666
  const sentinel = this.loadMoreSentinelRef();
639
667
  const { isOpen } = this.uiState();
640
668
  const optionsCount = this.filteredOptions().length;
641
- if (!sentinel || !isOpen || optionsCount === 0) {
669
+ if (!sentinel || !isOpen || optionsCount === 0 || !this.canLoadMore()) {
642
670
  this._cleanupLoadMoreObserver();
643
671
  return;
644
672
  }
@@ -660,9 +688,14 @@ class ZSelectComponent {
660
688
  });
661
689
  }
662
690
  ngOnInit() {
663
- this._searchSubject.pipe(debounceTime(this.zDebounce()), takeUntilDestroyed(this._destroyRef)).subscribe(value => {
691
+ this._searchSubject
692
+ .pipe(debounceTime(this.effectiveDebounceTime()), takeUntilDestroyed(this._destroyRef))
693
+ .subscribe(value => {
664
694
  this.searchText.set(value);
665
695
  this.zOnSearch.emit(value);
696
+ if (this.hasAsyncOptions()) {
697
+ this._loadAsyncOptions(value, false);
698
+ }
666
699
  });
667
700
  const asyncValidators = this.zAsyncValidators();
668
701
  if (asyncValidators.length > 0) {
@@ -803,6 +836,7 @@ class ZSelectComponent {
803
836
  this.uiState.update(s => ({ ...s, isOpen: true, isFocused: true }));
804
837
  this.searchText.set('');
805
838
  this.zOnSearch.emit('');
839
+ this._loadAsyncOptionsOnFocus();
806
840
  const triggerEl = this.triggerRef()?.nativeElement;
807
841
  if (triggerEl) {
808
842
  this.dropdownWidth.set(triggerEl.getBoundingClientRect().width);
@@ -832,7 +866,7 @@ class ZSelectComponent {
832
866
  triggerEl?.blur();
833
867
  }
834
868
  onPopoverHideEnd() {
835
- if (this.zSearchServer()) {
869
+ if (this.zSearchServer() || this.hasAsyncOptions()) {
836
870
  this.searchText.set('');
837
871
  }
838
872
  }
@@ -865,7 +899,7 @@ class ZSelectComponent {
865
899
  this.uiState.update(s => ({ ...s, dirty: true }));
866
900
  this._onChange(newValue);
867
901
  this._triggerAsyncValidation(newValue
868
- .map(v => this.zOptions().find(o => o.value === v))
902
+ .map(v => this.knownOptions().find(o => o.value === v))
869
903
  .filter((o) => o !== undefined));
870
904
  return;
871
905
  }
@@ -902,7 +936,7 @@ class ZSelectComponent {
902
936
  if (!this.isMultipleMode()) {
903
937
  return;
904
938
  }
905
- const enabledOptions = this.zOptions().filter(opt => !opt.disabled);
939
+ const enabledOptions = this.translatedOptions().filter(opt => !opt.disabled);
906
940
  const allValues = enabledOptions.map(opt => opt.value);
907
941
  this._value.set(allValues);
908
942
  this.uiState.update(s => ({ ...s, dirty: true }));
@@ -947,6 +981,132 @@ class ZSelectComponent {
947
981
  errorMessage: this.errorMessage,
948
982
  });
949
983
  }
984
+ _loadAsyncOptionsOnFocus() {
985
+ const asyncConfig = this.config().async;
986
+ if (!asyncConfig?.loadOnFocus) {
987
+ return;
988
+ }
989
+ if (this._asyncKeyword() === '' && this._asyncOptions().length > 0) {
990
+ return;
991
+ }
992
+ this._loadAsyncOptions('', false);
993
+ }
994
+ _loadAsyncOptions(keyword, append) {
995
+ const asyncConfig = this.config().async;
996
+ if (!asyncConfig) {
997
+ return;
998
+ }
999
+ const normalizedKeyword = keyword.trim();
1000
+ const pageSize = asyncConfig.pageSize ?? Z_ASYNC_OPTIONS_DEFAULT_PAGE_SIZE;
1001
+ const { minLength } = this.config();
1002
+ const canLoadEmptyOnFocus = asyncConfig.loadOnFocus && normalizedKeyword.length === 0;
1003
+ if (!append && normalizedKeyword.length < minLength && !canLoadEmptyOnFocus) {
1004
+ this._resetAsyncOptions();
1005
+ return;
1006
+ }
1007
+ if (append && (!this._asyncHasMore() || this._asyncLoading() || this._asyncLoadingMore())) {
1008
+ return;
1009
+ }
1010
+ const page = append ? this._asyncPage() + 1 : 1;
1011
+ const requestId = ++this._asyncRequestId;
1012
+ const scrollTopBeforeAppend = append ? this._getAsyncOptionsScrollTop() : null;
1013
+ if (!append) {
1014
+ this._asyncLoadSubscription?.unsubscribe();
1015
+ this._asyncKeyword.set(normalizedKeyword);
1016
+ this._asyncLoading.set(true);
1017
+ this._asyncHasMore.set(false);
1018
+ }
1019
+ else {
1020
+ this._asyncLoadingMore.set(true);
1021
+ }
1022
+ let result;
1023
+ try {
1024
+ result = asyncConfig.load({
1025
+ keyword: normalizedKeyword,
1026
+ page,
1027
+ pageSize,
1028
+ });
1029
+ }
1030
+ catch (error) {
1031
+ this._handleAsyncOptionsError(error, append);
1032
+ return;
1033
+ }
1034
+ this._asyncLoadSubscription = zToAsyncOptionsObservable(result)
1035
+ .pipe(finalize(() => {
1036
+ if (requestId !== this._asyncRequestId) {
1037
+ return;
1038
+ }
1039
+ this._asyncLoading.set(false);
1040
+ this._asyncLoadingMore.set(false);
1041
+ }), takeUntilDestroyed(this._destroyRef))
1042
+ .subscribe({
1043
+ next: response => {
1044
+ if (requestId !== this._asyncRequestId) {
1045
+ return;
1046
+ }
1047
+ const nextItems = response.items ?? [];
1048
+ const previousCount = this._asyncOptions().length;
1049
+ const mergedOptions = append
1050
+ ? zMergeAsyncOptions(this._asyncOptions(), nextItems, asyncConfig.dedupeBy)
1051
+ : zMergeAsyncOptions([], nextItems, asyncConfig.dedupeBy);
1052
+ const hasNewItems = mergedOptions.length > previousCount;
1053
+ if (append && !hasNewItems) {
1054
+ this._asyncHasMore.set(false);
1055
+ this._restoreAsyncOptionsScrollTop(scrollTopBeforeAppend);
1056
+ return;
1057
+ }
1058
+ this._asyncOptions.set(mergedOptions);
1059
+ this._asyncPage.set(page);
1060
+ this._asyncHasMore.set(append && !hasNewItems ? false : zResolveAsyncOptionsHasMore(response, pageSize, mergedOptions.length));
1061
+ this._restoreAsyncOptionsScrollTop(scrollTopBeforeAppend);
1062
+ },
1063
+ error: error => {
1064
+ if (requestId !== this._asyncRequestId) {
1065
+ return;
1066
+ }
1067
+ this._handleAsyncOptionsError(error, append);
1068
+ },
1069
+ });
1070
+ }
1071
+ _handleAsyncOptionsError(error, append) {
1072
+ console.error('ZSelect async options load failed:', error);
1073
+ if (!append) {
1074
+ this._asyncOptions.set([]);
1075
+ this._asyncPage.set(1);
1076
+ }
1077
+ this._asyncHasMore.set(false);
1078
+ this._asyncLoading.set(false);
1079
+ this._asyncLoadingMore.set(false);
1080
+ }
1081
+ _getAsyncOptionsScrollTop() {
1082
+ const scrollElement = this.shouldUseVirtualScroll()
1083
+ ? this.virtualScrollRef()?.nativeElement
1084
+ : this.optionsContainerRef()?.nativeElement;
1085
+ return scrollElement?.scrollTop ?? null;
1086
+ }
1087
+ _restoreAsyncOptionsScrollTop(scrollTop) {
1088
+ if (scrollTop === null) {
1089
+ return;
1090
+ }
1091
+ requestAnimationFrame(() => {
1092
+ const scrollElement = this.shouldUseVirtualScroll()
1093
+ ? this.virtualScrollRef()?.nativeElement
1094
+ : this.optionsContainerRef()?.nativeElement;
1095
+ if (scrollElement) {
1096
+ scrollElement.scrollTop = scrollTop;
1097
+ }
1098
+ });
1099
+ }
1100
+ _resetAsyncOptions() {
1101
+ this._asyncLoadSubscription?.unsubscribe();
1102
+ this._asyncRequestId++;
1103
+ this._asyncOptions.set([]);
1104
+ this._asyncKeyword.set('');
1105
+ this._asyncPage.set(1);
1106
+ this._asyncHasMore.set(false);
1107
+ this._asyncLoading.set(false);
1108
+ this._asyncLoadingMore.set(false);
1109
+ }
950
1110
  _setupLoadMoreObserver() {
951
1111
  this._cleanupLoadMoreObserver();
952
1112
  const sentinel = this.loadMoreSentinelRef()?.nativeElement;
@@ -956,12 +1116,8 @@ class ZSelectComponent {
956
1116
  }
957
1117
  this._loadMoreObserver = new IntersectionObserver(entries => {
958
1118
  const entry = entries[0];
959
- if (entry?.isIntersecting && !this.zLoadingMore()) {
960
- const currentCount = this.filteredOptions().length;
961
- this.zOnLoadMore.emit({
962
- currentCount,
963
- scrollTop: container.scrollTop,
964
- });
1119
+ if (entry?.isIntersecting && !this.isLoadingMore()) {
1120
+ this._handleLoadMore(container.scrollTop);
965
1121
  }
966
1122
  }, {
967
1123
  root: container,
@@ -983,7 +1139,7 @@ class ZSelectComponent {
983
1139
  return;
984
1140
  }
985
1141
  const handleScroll = () => {
986
- if (this.zLoadingMore()) {
1142
+ if (this.isLoadingMore()) {
987
1143
  return;
988
1144
  }
989
1145
  const { scrollTop, scrollHeight, clientHeight } = scrollElement;
@@ -991,11 +1147,7 @@ class ZSelectComponent {
991
1147
  const threshold = clientHeight * scrollDistance;
992
1148
  const distanceFromBottom = scrollHeight - scrollTop - clientHeight;
993
1149
  if (distanceFromBottom <= threshold) {
994
- const currentCount = this.filteredOptions().length;
995
- this.zOnLoadMore.emit({
996
- currentCount,
997
- scrollTop,
998
- });
1150
+ this._handleLoadMore(scrollTop);
999
1151
  }
1000
1152
  };
1001
1153
  scrollElement.addEventListener('scroll', handleScroll);
@@ -1009,6 +1161,19 @@ class ZSelectComponent {
1009
1161
  this._virtualScrollListener = null;
1010
1162
  }
1011
1163
  }
1164
+ _handleLoadMore(scrollTop) {
1165
+ if (this.hasAsyncOptions()) {
1166
+ if (!this.canLoadMore()) {
1167
+ return;
1168
+ }
1169
+ this._loadAsyncOptions(this._asyncKeyword(), true);
1170
+ return;
1171
+ }
1172
+ this.zOnLoadMore.emit({
1173
+ currentCount: this.filteredOptions().length,
1174
+ scrollTop,
1175
+ });
1176
+ }
1012
1177
  _getValidationErrors() {
1013
1178
  const validators = this.zValidators();
1014
1179
  const errors = [];
@@ -1109,13 +1274,13 @@ class ZSelectComponent {
1109
1274
  }
1110
1275
  }
1111
1276
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1112
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZSelectComponent, isStandalone: true, selector: "z-select", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zMode: { classPropertyName: "zMode", publicName: "zMode", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zLabel: { classPropertyName: "zLabel", publicName: "zLabel", isSignal: true, isRequired: false, transformFunction: null }, zLabelClass: { classPropertyName: "zLabelClass", publicName: "zLabelClass", isSignal: true, isRequired: false, transformFunction: null }, zPlaceholder: { classPropertyName: "zPlaceholder", publicName: "zPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, zRequired: { classPropertyName: "zRequired", publicName: "zRequired", isSignal: true, isRequired: false, transformFunction: null }, zDisabled: { classPropertyName: "zDisabled", publicName: "zDisabled", isSignal: true, isRequired: false, transformFunction: null }, zReadonly: { classPropertyName: "zReadonly", publicName: "zReadonly", isSignal: true, isRequired: false, transformFunction: null }, zLoading: { classPropertyName: "zLoading", publicName: "zLoading", isSignal: true, isRequired: false, transformFunction: null }, zPrefix: { classPropertyName: "zPrefix", publicName: "zPrefix", isSignal: true, isRequired: false, transformFunction: null }, zAllowClear: { classPropertyName: "zAllowClear", publicName: "zAllowClear", isSignal: true, isRequired: false, transformFunction: null }, zWrap: { classPropertyName: "zWrap", publicName: "zWrap", isSignal: true, isRequired: false, transformFunction: null }, zShowSearch: { classPropertyName: "zShowSearch", publicName: "zShowSearch", isSignal: true, isRequired: false, transformFunction: null }, zPlaceholderSearch: { classPropertyName: "zPlaceholderSearch", publicName: "zPlaceholderSearch", isSignal: true, isRequired: false, transformFunction: null }, zDebounce: { classPropertyName: "zDebounce", publicName: "zDebounce", isSignal: true, isRequired: false, transformFunction: null }, zNotFoundText: { classPropertyName: "zNotFoundText", publicName: "zNotFoundText", isSignal: true, isRequired: false, transformFunction: null }, zEmptyText: { classPropertyName: "zEmptyText", publicName: "zEmptyText", isSignal: true, isRequired: false, transformFunction: null }, zEmptyIcon: { classPropertyName: "zEmptyIcon", publicName: "zEmptyIcon", isSignal: true, isRequired: false, transformFunction: null }, zMaxTagCount: { classPropertyName: "zMaxTagCount", publicName: "zMaxTagCount", isSignal: true, isRequired: false, transformFunction: null }, zDropdownMaxHeight: { classPropertyName: "zDropdownMaxHeight", publicName: "zDropdownMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, zOptionHeight: { classPropertyName: "zOptionHeight", publicName: "zOptionHeight", isSignal: true, isRequired: false, transformFunction: null }, zVirtualScroll: { classPropertyName: "zVirtualScroll", publicName: "zVirtualScroll", isSignal: true, isRequired: false, transformFunction: null }, zShowAction: { classPropertyName: "zShowAction", publicName: "zShowAction", isSignal: true, isRequired: false, transformFunction: null }, zOptions: { classPropertyName: "zOptions", publicName: "zOptions", isSignal: true, isRequired: false, transformFunction: null }, zTranslateLabels: { classPropertyName: "zTranslateLabels", publicName: "zTranslateLabels", isSignal: true, isRequired: false, transformFunction: null }, zKey: { classPropertyName: "zKey", publicName: "zKey", isSignal: true, isRequired: false, transformFunction: null }, zSearchServer: { classPropertyName: "zSearchServer", publicName: "zSearchServer", isSignal: true, isRequired: false, transformFunction: null }, zLoadingMore: { classPropertyName: "zLoadingMore", publicName: "zLoadingMore", isSignal: true, isRequired: false, transformFunction: null }, zEnableLoadMore: { classPropertyName: "zEnableLoadMore", publicName: "zEnableLoadMore", isSignal: true, isRequired: false, transformFunction: null }, zScrollDistance: { classPropertyName: "zScrollDistance", publicName: "zScrollDistance", isSignal: true, isRequired: false, transformFunction: null }, zMaxVisible: { classPropertyName: "zMaxVisible", publicName: "zMaxVisible", isSignal: true, isRequired: false, transformFunction: null }, zScrollClose: { classPropertyName: "zScrollClose", publicName: "zScrollClose", isSignal: true, isRequired: false, transformFunction: null }, zPosition: { classPropertyName: "zPosition", publicName: "zPosition", isSignal: true, isRequired: false, transformFunction: null }, zSelectedTemplate: { classPropertyName: "zSelectedTemplate", publicName: "zSelectedTemplate", isSignal: true, isRequired: false, transformFunction: null }, zOptionTemplate: { classPropertyName: "zOptionTemplate", publicName: "zOptionTemplate", isSignal: true, isRequired: false, transformFunction: null }, zActionTemplate: { classPropertyName: "zActionTemplate", publicName: "zActionTemplate", isSignal: true, isRequired: false, transformFunction: null }, zAsyncValidators: { classPropertyName: "zAsyncValidators", publicName: "zAsyncValidators", isSignal: true, isRequired: false, transformFunction: null }, zAsyncDebounce: { classPropertyName: "zAsyncDebounce", publicName: "zAsyncDebounce", isSignal: true, isRequired: false, transformFunction: null }, zAsyncValidateOn: { classPropertyName: "zAsyncValidateOn", publicName: "zAsyncValidateOn", isSignal: true, isRequired: false, transformFunction: null }, zValidators: { classPropertyName: "zValidators", publicName: "zValidators", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zOnSearch: "zOnSearch", zOnLoadMore: "zOnLoadMore", zOnBlur: "zOnBlur", zOnFocus: "zOnFocus", zControl: "zControl", zEvent: "zEvent" }, providers: [
1277
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ZSelectComponent, isStandalone: true, selector: "z-select", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zMode: { classPropertyName: "zMode", publicName: "zMode", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zLabel: { classPropertyName: "zLabel", publicName: "zLabel", isSignal: true, isRequired: false, transformFunction: null }, zLabelClass: { classPropertyName: "zLabelClass", publicName: "zLabelClass", isSignal: true, isRequired: false, transformFunction: null }, zPlaceholder: { classPropertyName: "zPlaceholder", publicName: "zPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, zRequired: { classPropertyName: "zRequired", publicName: "zRequired", isSignal: true, isRequired: false, transformFunction: null }, zDisabled: { classPropertyName: "zDisabled", publicName: "zDisabled", isSignal: true, isRequired: false, transformFunction: null }, zReadonly: { classPropertyName: "zReadonly", publicName: "zReadonly", isSignal: true, isRequired: false, transformFunction: null }, zLoading: { classPropertyName: "zLoading", publicName: "zLoading", isSignal: true, isRequired: false, transformFunction: null }, zPrefix: { classPropertyName: "zPrefix", publicName: "zPrefix", isSignal: true, isRequired: false, transformFunction: null }, zAllowClear: { classPropertyName: "zAllowClear", publicName: "zAllowClear", isSignal: true, isRequired: false, transformFunction: null }, zWrap: { classPropertyName: "zWrap", publicName: "zWrap", isSignal: true, isRequired: false, transformFunction: null }, zShowSearch: { classPropertyName: "zShowSearch", publicName: "zShowSearch", isSignal: true, isRequired: false, transformFunction: null }, zPlaceholderSearch: { classPropertyName: "zPlaceholderSearch", publicName: "zPlaceholderSearch", isSignal: true, isRequired: false, transformFunction: null }, zDebounce: { classPropertyName: "zDebounce", publicName: "zDebounce", isSignal: true, isRequired: false, transformFunction: null }, zNotFoundText: { classPropertyName: "zNotFoundText", publicName: "zNotFoundText", isSignal: true, isRequired: false, transformFunction: null }, zEmptyText: { classPropertyName: "zEmptyText", publicName: "zEmptyText", isSignal: true, isRequired: false, transformFunction: null }, zEmptyIcon: { classPropertyName: "zEmptyIcon", publicName: "zEmptyIcon", isSignal: true, isRequired: false, transformFunction: null }, zMaxTagCount: { classPropertyName: "zMaxTagCount", publicName: "zMaxTagCount", isSignal: true, isRequired: false, transformFunction: null }, zDropdownMaxHeight: { classPropertyName: "zDropdownMaxHeight", publicName: "zDropdownMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, zOptionHeight: { classPropertyName: "zOptionHeight", publicName: "zOptionHeight", isSignal: true, isRequired: false, transformFunction: null }, zVirtualScroll: { classPropertyName: "zVirtualScroll", publicName: "zVirtualScroll", isSignal: true, isRequired: false, transformFunction: null }, zShowAction: { classPropertyName: "zShowAction", publicName: "zShowAction", isSignal: true, isRequired: false, transformFunction: null }, zOptions: { classPropertyName: "zOptions", publicName: "zOptions", isSignal: true, isRequired: false, transformFunction: null }, zConfig: { classPropertyName: "zConfig", publicName: "zConfig", isSignal: true, isRequired: false, transformFunction: null }, zTranslateLabels: { classPropertyName: "zTranslateLabels", publicName: "zTranslateLabels", isSignal: true, isRequired: false, transformFunction: null }, zKey: { classPropertyName: "zKey", publicName: "zKey", isSignal: true, isRequired: false, transformFunction: null }, zSearchServer: { classPropertyName: "zSearchServer", publicName: "zSearchServer", isSignal: true, isRequired: false, transformFunction: null }, zLoadingMore: { classPropertyName: "zLoadingMore", publicName: "zLoadingMore", isSignal: true, isRequired: false, transformFunction: null }, zEnableLoadMore: { classPropertyName: "zEnableLoadMore", publicName: "zEnableLoadMore", isSignal: true, isRequired: false, transformFunction: null }, zScrollDistance: { classPropertyName: "zScrollDistance", publicName: "zScrollDistance", isSignal: true, isRequired: false, transformFunction: null }, zMaxVisible: { classPropertyName: "zMaxVisible", publicName: "zMaxVisible", isSignal: true, isRequired: false, transformFunction: null }, zScrollClose: { classPropertyName: "zScrollClose", publicName: "zScrollClose", isSignal: true, isRequired: false, transformFunction: null }, zPosition: { classPropertyName: "zPosition", publicName: "zPosition", isSignal: true, isRequired: false, transformFunction: null }, zSelectedTemplate: { classPropertyName: "zSelectedTemplate", publicName: "zSelectedTemplate", isSignal: true, isRequired: false, transformFunction: null }, zOptionTemplate: { classPropertyName: "zOptionTemplate", publicName: "zOptionTemplate", isSignal: true, isRequired: false, transformFunction: null }, zActionTemplate: { classPropertyName: "zActionTemplate", publicName: "zActionTemplate", isSignal: true, isRequired: false, transformFunction: null }, zAsyncValidators: { classPropertyName: "zAsyncValidators", publicName: "zAsyncValidators", isSignal: true, isRequired: false, transformFunction: null }, zAsyncDebounce: { classPropertyName: "zAsyncDebounce", publicName: "zAsyncDebounce", isSignal: true, isRequired: false, transformFunction: null }, zAsyncValidateOn: { classPropertyName: "zAsyncValidateOn", publicName: "zAsyncValidateOn", isSignal: true, isRequired: false, transformFunction: null }, zValidators: { classPropertyName: "zValidators", publicName: "zValidators", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zOnSearch: "zOnSearch", zOnLoadMore: "zOnLoadMore", zOnBlur: "zOnBlur", zOnFocus: "zOnFocus", zControl: "zControl", zEvent: "zEvent" }, providers: [
1113
1278
  {
1114
1279
  provide: NG_VALUE_ACCESSOR,
1115
1280
  useExisting: forwardRef(() => ZSelectComponent),
1116
1281
  multi: true,
1117
1282
  },
1118
- ], queries: [{ propertyName: "customSelectedDirective", first: true, predicate: (ZSelectSelectedDirective), descendants: true, isSignal: true }, { propertyName: "customOptionDirective", first: true, predicate: (ZSelectOptionDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true, isSignal: true }, { propertyName: "searchInputRef", first: true, predicate: ["dropdownSearchInput"], descendants: true, isSignal: true }, { propertyName: "dropdownTpl", first: true, predicate: ["dropdownTpl"], descendants: true, isSignal: true }, { propertyName: "optionsContainerRef", first: true, predicate: ["optionsContainer"], descendants: true, isSignal: true }, { propertyName: "virtualScrollRef", first: true, predicate: ["virtualScrollElement"], descendants: true, isSignal: true }, { propertyName: "loadMoreSentinelRef", first: true, predicate: ["loadMoreSentinel"], descendants: true, isSignal: true }], exportAs: ["zSelect"], ngImport: i0, template: "<div class=\"z-select-wrapper relative flex w-full flex-col gap-2\">\n @if (zLabel()) {\n <label [for]=\"selectId\" class=\"text-xs leading-none font-medium\" [class]=\"zLabelClass()\">\n {{ zLabel() }}\n @if (zRequired()) {\n <span class=\"text-destructive! ml-0.5\">*</span>\n }\n </label>\n }\n\n <div class=\"relative\">\n <div\n #triggerEl\n [id]=\"selectId\"\n z-popover\n [zPopoverContent]=\"dropdownTpl\"\n [zOffset]=\"6\"\n [zDisabled]=\"isInteractionDisabled()\"\n [zScrollClose]=\"zScrollClose()\"\n zTrigger=\"click\"\n [zPosition]=\"zPosition()\"\n zClass=\"border-0 shadow-none p-0\"\n (zControl)=\"onPopoverControl($event)\"\n (zShow)=\"onPopoverShow()\"\n (zHideStart)=\"onPopoverHideStart()\"\n (zHide)=\"onPopoverHideEnd()\"\n class=\"z-select-trigger cursor-pointer\"\n [class]=\"selectClasses()\"\n [class.z-select-open]=\"uiState().isOpen\"\n (mousedown)=\"onTriggerMousedown()\"\n (keydown)=\"onTriggerKeydown($event)\"\n tabindex=\"0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"uiState().isOpen\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-controls]=\"dropdownId\">\n @if (zPrefix()) {\n <z-icon [zType]=\"zPrefix() || 'lucideChevronDown'\" zSize=\"18\" class=\"text-muted-foreground shrink-0\" />\n }\n\n <div\n class=\"z-select-tags-wrapper flex min-w-0 flex-1 items-center gap-1\"\n [class.flex-wrap]=\"zWrap()\"\n [class.overflow-hidden]=\"!zWrap()\">\n @if (isMultipleMode()) {\n @if (selectedOptions().length === 0) {\n <span class=\"text-muted-foreground truncate whitespace-nowrap\">\n {{ effectivePlaceholder() }}\n </span>\n } @else {\n @for (opt of displayedTags(); track opt.value) {\n <span\n #tagEl\n [class]=\"opt | zTagClasses: zSize() : isTagsMode()\"\n class=\"z-select-tag\"\n [class.min-w-0]=\"!zWrap()\"\n [class.shrink]=\"!zWrap()\">\n @if (effectiveSelectedTemplate()) {\n <ng-container *ngTemplateOutlet=\"effectiveSelectedTemplate()!; context: { $implicit: opt }\" />\n } @else {\n <span\n class=\"truncate\"\n [class.max-w-25]=\"zWrap()\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"6\"\n [zTriggerElement]=\"tagEl\">\n {{ opt.label }}\n </span>\n }\n @if (zAllowClear() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"-mr-0.5 flex size-3.5 shrink-0 items-center justify-center rounded-sm transition-colors hover:bg-black/10\"\n (click)=\"removeOption($event, opt)\"\n tabindex=\"-1\">\n <z-icon zType=\"lucideX\" zSize=\"10\" />\n </button>\n }\n </span>\n }\n @if (remainingCount() > 0) {\n <span\n class=\"z-select-remaining text-muted-foreground bg-muted rounded-sm px-1.5 py-0.5 text-xs font-medium\">\n +{{ remainingCount() }}\n </span>\n }\n }\n } @else {\n @if (selectedOption()) {\n @if (effectiveSelectedTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"effectiveSelectedTemplate()!; context: { $implicit: selectedOption() }\" />\n } @else {\n <span\n class=\"truncate\"\n z-tooltip\n [zContent]=\"selectedOption()!.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"10\">\n {{ selectedOption()!.label }}\n </span>\n }\n } @else {\n <span class=\"text-muted-foreground truncate whitespace-nowrap\">\n {{ effectivePlaceholder() }}\n </span>\n }\n }\n </div>\n\n @if (zLoading() || zLoadingMore()) {\n <z-icon zType=\"lucideLoaderCircle\" zSize=\"18\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n @if (!zLoading() && zAllowClear() && hasValue() && !isDisabled() && !isReadonly()) {\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:text-foreground flex shrink-0 items-center justify-center transition-colors\"\n (click)=\"clearAll($event)\"\n tabindex=\"-1\">\n <z-icon zType=\"lucideX\" zSize=\"18\" />\n </button>\n }\n\n @if (uiState().isValidating) {\n <z-icon zType=\"lucideLoader2\" zSize=\"18\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n <z-icon\n zType=\"lucideChevronDown\"\n zSize=\"18\"\n class=\"text-muted-foreground shrink-0 transition-transform duration-200\"\n [class.rotate-180]=\"uiState().isOpen\" />\n </div>\n\n @if (hasError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 pt-2 text-xs duration-200\">\n {{ errorMessage() }}\n </p>\n }\n </div>\n\n <ng-template #dropdownTpl let-close=\"close\">\n <div\n [id]=\"dropdownId\"\n class=\"z-select-dropdown bg-popover border-border rounded-sm border shadow-lg\"\n [style.width.px]=\"dropdownWidth()\"\n [style.min-width.px]=\"dropdownWidth()\">\n @if (zShowSearch()) {\n <div class=\"border-border flex items-center border-b px-3\">\n <z-icon zType=\"lucideSearch\" zSize=\"18\" class=\"text-muted-foreground/50 mr-2 shrink-0\" />\n <input\n #dropdownSearchInput\n type=\"text\"\n class=\"placeholder:text-muted-foreground text-foreground flex h-10 w-full bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50\"\n [placeholder]=\"effectivePlaceholderSearch()\"\n [ngModel]=\"searchText()\"\n (ngModelChange)=\"onSearchChange($event)\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\" />\n </div>\n }\n\n @if (zLoading()) {\n <div class=\"flex items-center justify-center\" [style.height.px]=\"optionsMaxHeight()\">\n <z-loading [zLoading]=\"true\" zSize=\"default\" />\n </div>\n } @else {\n @if (filteredOptions().length > 0) {\n @if (shouldUseVirtualScroll()) {\n <div\n #virtualScrollElement\n class=\"z-select-options z-select-virtual-scroll overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.height.px]=\"optionsMaxHeight()\">\n <div class=\"z-select-virtual-inner relative\" [style.height.px]=\"virtualizer.getTotalSize()\">\n @for (virtualItem of virtualizer.getVirtualItems(); track virtualItem.index) {\n @let opt = filteredOptions()[virtualItem.index];\n <div\n #optionEl\n class=\"z-select-option absolute right-0 left-0 min-w-0\"\n [ngClass]=\"opt | zIsSelected: currentValue() : isMultipleMode() | zOptionClasses: opt.disabled\"\n [style.height.px]=\"zOptionHeight()\"\n [style.transform]=\"'translateY(' + virtualItem.start + 'px)'\"\n (click)=\"selectOption(opt, close)\">\n @if (effectiveOptionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n effectiveOptionTemplate()!;\n context: { $implicit: opt, selected: opt | zIsSelected: currentValue() : isMultipleMode() }\n \" />\n } @else {\n <span\n class=\"min-w-0 flex-1 truncate\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"5\"\n [zArrow]=\"false\"\n [zTriggerElement]=\"optionEl\"\n [innerHTML]=\"opt.label | zHighlight: searchText() | zSafeHtml\"></span>\n }\n @if (opt | zIsSelected: currentValue() : isMultipleMode()) {\n <z-icon zType=\"lucideCheck\" zSize=\"16\" [zStrokeWidth]=\"4\" class=\"text-primary ml-auto shrink-0\" />\n }\n </div>\n }\n </div>\n @if (zLoadingMore()) {\n <div\n class=\"bg-popover/80 absolute right-0 bottom-0 left-0 flex items-center justify-center py-2\"\n [style.transform]=\"'translateY(' + virtualizer.getTotalSize() + 'px)'\">\n <z-loading zSize=\"xs\" [zLoading]=\"true\" />\n </div>\n }\n </div>\n } @else {\n <div\n #optionsContainer\n class=\"z-select-options flex flex-col gap-0.75 overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.maxHeight.px]=\"optionsMaxHeight()\">\n @for (opt of filteredOptions(); track opt.value) {\n <div\n #optionEl2\n class=\"z-select-option relative min-w-0\"\n [ngClass]=\"opt | zIsSelected: currentValue() : isMultipleMode() | zOptionClasses: opt.disabled\"\n [style.minHeight.px]=\"zOptionHeight()\"\n (click)=\"selectOption(opt, close)\">\n @if (effectiveOptionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n effectiveOptionTemplate()!;\n context: { $implicit: opt, selected: opt | zIsSelected: currentValue() : isMultipleMode() }\n \" />\n } @else {\n <span\n class=\"min-w-0 flex-1 truncate\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zArrow]=\"false\"\n [zOffset]=\"5\"\n [zHideDelay]=\"0\"\n [zTriggerElement]=\"optionEl2\"\n [innerHTML]=\"opt.label | zHighlight: searchText() | zSafeHtml\"></span>\n }\n @if (opt | zIsSelected: currentValue() : isMultipleMode()) {\n <z-icon zType=\"lucideCheck\" zSize=\"18\" [zStrokeWidth]=\"4\" class=\"text-primary ml-auto shrink-0\" />\n }\n </div>\n }\n @if (zEnableLoadMore()) {\n <div #loadMoreSentinel class=\"h-px w-full shrink-0\"></div>\n }\n </div>\n }\n } @else {\n <div class=\"flex items-center justify-center p-1\" [style.height.px]=\"optionsMaxHeight()\">\n @if (isEmptyData()) {\n <z-empty [zIcon]=\"zEmptyIcon()\" zSize=\"sm\" [zMessage]=\"effectiveEmptyText()\" />\n } @else {\n <z-empty zIcon=\"lucideSearchX\" zSize=\"sm\" [zMessage]=\"effectiveNotFoundText()\" />\n }\n </div>\n }\n\n @if (zLoadingMore()) {\n <div class=\"z-select-loading-more border-border/50 flex items-center justify-center border-t py-1.5\">\n <z-loading zSize=\"xs\" [zLoading]=\"true\" />\n </div>\n }\n }\n\n @if (zShowAction() && (zActionTemplate() || isMultipleMode())) {\n <div class=\"border-border flex items-center gap-2 border-t px-2 py-1.5\">\n @if (zActionTemplate()) {\n <ng-container *ngTemplateOutlet=\"zActionTemplate()!\" />\n } @else {\n <z-button\n zSize=\"xs\"\n [zType]=\"isAllSelected() ? 'ghost-error' : 'ghost-info'\"\n class=\"min-w-0 flex-1\"\n (click)=\"toggleSelectAllAction()\"\n [zWave]=\"false\">\n <z-icon [zType]=\"isAllSelected() ? 'lucideX' : 'lucideCheckCheck'\" zSize=\"18\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ isAllSelected() ? effectiveClearAllText() : effectiveSelectAllText() }}</span>\n </z-button>\n }\n </div>\n }\n </div>\n </ng-template>\n</div>\n", styles: [".z-select-trigger{-webkit-user-select:none;user-select:none}.z-select-trigger:focus{outline:none}.z-select-trigger *{cursor:inherit}.z-select-tag{-webkit-user-select:none;user-select:none;animation:z-select-tag-enter .2s cubic-bezier(.4,0,.2,1)}@keyframes z-select-tag-enter{0%{opacity:0;transform:scale(.8) translateY(.25rem)}to{opacity:1;transform:scale(1) translateY(0)}}.z-select-remaining{animation:z-select-remaining-enter .25s cubic-bezier(.4,0,.2,1)}@keyframes z-select-remaining-enter{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}.z-select-dropdown input{text-overflow:ellipsis;overflow:hidden}.z-select-options{overflow-x:hidden!important}.z-select-virtual-scroll .z-select-virtual-inner{width:100%}.z-select-loading-more{animation:z-select-loading-enter .2s ease-out}@keyframes z-select-loading-enter{0%{opacity:0;transform:translateY(-.25rem)}to{opacity:1;transform:translateY(0)}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "directive", type: ZPopoverDirective, selector: "[z-popover]", inputs: ["zPopoverContent", "zPosition", "zTrigger", "zClass", "zShowDelay", "zHideDelay", "zDisabled", "zOffset", "zPopoverWidth", "zManualClose", "zScrollClose", "zShowArrow"], outputs: ["zShow", "zHide", "zHideStart", "zControl", "zPositionChange"], exportAs: ["zPopover"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ZButtonComponent, selector: "z-button, button[z-button], a[z-button]", inputs: ["class", "zType", "zSize", "zShape", "zLabel", "zLoading", "zDisabled", "zTypeIcon", "zSizeIcon", "zStrokeWidthIcon", "zWave"], exportAs: ["zButton"] }, { kind: "component", type: ZEmptyComponent, selector: "z-empty", inputs: ["class", "zType", "zIcon", "zIconSize", "zSize", "zMessage", "zDescription"] }, { kind: "directive", type: ZTooltipDirective, selector: "[z-tooltip], [zTooltip]", inputs: ["zContent", "zPosition", "zTrigger", "zTooltipType", "zTooltipSize", "zClass", "zShowDelay", "zHideDelay", "zArrow", "zDisabled", "zOffset", "zAutoDetect", "zTriggerElement", "zAlwaysShow", "zMaxWidth"], outputs: ["zShow", "zHide"], exportAs: ["zTooltip"] }, { kind: "component", type: ZLoadingComponent, selector: "z-loading", inputs: ["class", "zSpinner", "zSize", "zColor", "zText", "zOverlay", "zOverlayType", "zFullscreen", "zLoading"] }, { kind: "pipe", type: ZIsSelectedPipe, name: "zIsSelected" }, { kind: "pipe", type: ZOptionClassesPipe, name: "zOptionClasses" }, { kind: "pipe", type: ZTagClassesPipe, name: "zTagClasses" }, { kind: "pipe", type: ZHighlightPipe, name: "zHighlight" }, { kind: "pipe", type: ZSafeHtmlPipe, name: "zSafeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1283
+ ], queries: [{ propertyName: "customSelectedDirective", first: true, predicate: (ZSelectSelectedDirective), descendants: true, isSignal: true }, { propertyName: "customOptionDirective", first: true, predicate: (ZSelectOptionDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true, isSignal: true }, { propertyName: "searchInputRef", first: true, predicate: ["dropdownSearchInput"], descendants: true, isSignal: true }, { propertyName: "dropdownTpl", first: true, predicate: ["dropdownTpl"], descendants: true, isSignal: true }, { propertyName: "optionsContainerRef", first: true, predicate: ["optionsContainer"], descendants: true, isSignal: true }, { propertyName: "virtualScrollRef", first: true, predicate: ["virtualScrollElement"], descendants: true, isSignal: true }, { propertyName: "loadMoreSentinelRef", first: true, predicate: ["loadMoreSentinel"], descendants: true, isSignal: true }], exportAs: ["zSelect"], ngImport: i0, template: "<div class=\"z-select-wrapper relative flex w-full flex-col gap-2\">\n @if (zLabel()) {\n <label [for]=\"selectId\" class=\"text-xs leading-none font-medium\" [class]=\"zLabelClass()\">\n {{ zLabel() }}\n @if (zRequired()) {\n <span class=\"text-destructive! ml-0.5\">*</span>\n }\n </label>\n }\n\n <div class=\"relative\">\n <div\n #triggerEl\n [id]=\"selectId\"\n z-popover\n [zPopoverContent]=\"dropdownTpl\"\n [zOffset]=\"6\"\n [zDisabled]=\"isInteractionDisabled()\"\n [zScrollClose]=\"zScrollClose()\"\n zTrigger=\"click\"\n [zPosition]=\"zPosition()\"\n zClass=\"border-0 shadow-none p-0\"\n (zControl)=\"onPopoverControl($event)\"\n (zShow)=\"onPopoverShow()\"\n (zHideStart)=\"onPopoverHideStart()\"\n (zHide)=\"onPopoverHideEnd()\"\n class=\"z-select-trigger cursor-pointer\"\n [class]=\"selectClasses()\"\n [class.z-select-open]=\"uiState().isOpen\"\n (mousedown)=\"onTriggerMousedown()\"\n (keydown)=\"onTriggerKeydown($event)\"\n tabindex=\"0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"uiState().isOpen\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-controls]=\"dropdownId\">\n @if (zPrefix()) {\n <z-icon [zType]=\"zPrefix() || 'lucideChevronDown'\" zSize=\"18\" class=\"text-muted-foreground shrink-0\" />\n }\n\n <div\n class=\"z-select-tags-wrapper flex min-w-0 flex-1 items-center gap-1\"\n [class.flex-wrap]=\"zWrap()\"\n [class.overflow-hidden]=\"!zWrap()\">\n @if (isMultipleMode()) {\n @if (selectedOptions().length === 0) {\n <span class=\"text-muted-foreground truncate whitespace-nowrap\">\n {{ effectivePlaceholder() }}\n </span>\n } @else {\n @for (opt of displayedTags(); track opt.value) {\n <span\n #tagEl\n [class]=\"opt | zTagClasses: zSize() : isTagsMode()\"\n class=\"z-select-tag\"\n [class.min-w-0]=\"!zWrap()\"\n [class.shrink]=\"!zWrap()\">\n @if (effectiveSelectedTemplate()) {\n <ng-container *ngTemplateOutlet=\"effectiveSelectedTemplate()!; context: { $implicit: opt }\" />\n } @else {\n <span\n class=\"truncate\"\n [class.max-w-25]=\"zWrap()\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"6\"\n [zTriggerElement]=\"tagEl\">\n {{ opt.label }}\n </span>\n }\n @if (zAllowClear() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"-mr-0.5 flex size-3.5 shrink-0 items-center justify-center rounded-sm transition-colors hover:bg-black/10\"\n (click)=\"removeOption($event, opt)\"\n tabindex=\"-1\">\n <z-icon zType=\"lucideX\" zSize=\"10\" />\n </button>\n }\n </span>\n }\n @if (remainingCount() > 0) {\n <span\n class=\"z-select-remaining text-muted-foreground bg-muted rounded-sm px-1.5 py-0.5 text-xs font-medium\">\n +{{ remainingCount() }}\n </span>\n }\n }\n } @else {\n @if (selectedOption()) {\n @if (effectiveSelectedTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"effectiveSelectedTemplate()!; context: { $implicit: selectedOption() }\" />\n } @else {\n <span\n class=\"truncate\"\n z-tooltip\n [zContent]=\"selectedOption()!.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"10\">\n {{ selectedOption()!.label }}\n </span>\n }\n } @else {\n <span class=\"text-muted-foreground truncate whitespace-nowrap\">\n {{ effectivePlaceholder() }}\n </span>\n }\n }\n </div>\n\n @if (isLoading() || isLoadingMore()) {\n <z-icon zType=\"lucideLoaderCircle\" zSize=\"18\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n @if (!isLoading() && zAllowClear() && hasValue() && !isDisabled() && !isReadonly()) {\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:text-foreground flex shrink-0 items-center justify-center transition-colors\"\n (click)=\"clearAll($event)\"\n tabindex=\"-1\">\n <z-icon zType=\"lucideX\" zSize=\"18\" />\n </button>\n }\n\n @if (uiState().isValidating) {\n <z-icon zType=\"lucideLoader2\" zSize=\"18\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n <z-icon\n zType=\"lucideChevronDown\"\n zSize=\"18\"\n class=\"text-muted-foreground shrink-0 transition-transform duration-200\"\n [class.rotate-180]=\"uiState().isOpen\" />\n </div>\n\n @if (hasError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 pt-2 text-xs duration-200\">\n {{ errorMessage() }}\n </p>\n }\n </div>\n\n <ng-template #dropdownTpl let-close=\"close\">\n <div\n [id]=\"dropdownId\"\n class=\"z-select-dropdown bg-popover border-border rounded-sm border shadow-lg\"\n [style.width.px]=\"dropdownWidth()\"\n [style.min-width.px]=\"dropdownWidth()\">\n @if (zShowSearch()) {\n <div class=\"border-border flex items-center border-b px-3\">\n <z-icon zType=\"lucideSearch\" zSize=\"18\" class=\"text-muted-foreground/50 mr-2 shrink-0\" />\n <input\n #dropdownSearchInput\n type=\"text\"\n class=\"placeholder:text-muted-foreground text-foreground flex h-10 w-full bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50\"\n [placeholder]=\"effectivePlaceholderSearch()\"\n [ngModel]=\"searchText()\"\n (ngModelChange)=\"onSearchChange($event)\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\" />\n </div>\n }\n\n @if (isLoading()) {\n <div class=\"flex items-center justify-center\" [style.height.px]=\"optionsMaxHeight()\">\n <z-loading [zLoading]=\"true\" zSize=\"default\" />\n </div>\n } @else {\n @if (filteredOptions().length > 0) {\n @if (shouldUseVirtualScroll()) {\n <div\n #virtualScrollElement\n class=\"z-select-options z-select-virtual-scroll overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.height.px]=\"optionsMaxHeight()\">\n <div class=\"z-select-virtual-inner relative\" [style.height.px]=\"virtualizer.getTotalSize()\">\n @for (virtualItem of virtualizer.getVirtualItems(); track virtualItem.index) {\n @let opt = filteredOptions()[virtualItem.index];\n <div\n #optionEl\n class=\"z-select-option absolute right-0 left-0 min-w-0\"\n [ngClass]=\"opt | zIsSelected: currentValue() : isMultipleMode() | zOptionClasses: opt.disabled\"\n [style.height.px]=\"zOptionHeight()\"\n [style.transform]=\"'translateY(' + virtualItem.start + 'px)'\"\n (click)=\"selectOption(opt, close)\">\n @if (effectiveOptionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n effectiveOptionTemplate()!;\n context: { $implicit: opt, selected: opt | zIsSelected: currentValue() : isMultipleMode() }\n \" />\n } @else {\n <span\n class=\"min-w-0 flex-1 truncate\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"5\"\n [zArrow]=\"false\"\n [zTriggerElement]=\"optionEl\"\n [innerHTML]=\"opt.label | zHighlight: searchText() | zSafeHtml\"></span>\n }\n @if (opt | zIsSelected: currentValue() : isMultipleMode()) {\n <z-icon zType=\"lucideCheck\" zSize=\"16\" [zStrokeWidth]=\"4\" class=\"text-primary ml-auto shrink-0\" />\n }\n </div>\n }\n </div>\n @if (isLoadingMore()) {\n <div\n class=\"bg-popover/80 absolute right-0 bottom-0 left-0 flex items-center justify-center py-2\"\n [style.transform]=\"'translateY(' + virtualizer.getTotalSize() + 'px)'\">\n <z-loading zSize=\"xs\" [zLoading]=\"true\" />\n </div>\n }\n </div>\n } @else {\n <div\n #optionsContainer\n class=\"z-select-options flex flex-col gap-0.75 overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.maxHeight.px]=\"optionsMaxHeight()\">\n @for (opt of filteredOptions(); track opt.value) {\n <div\n #optionEl2\n class=\"z-select-option relative min-w-0\"\n [ngClass]=\"opt | zIsSelected: currentValue() : isMultipleMode() | zOptionClasses: opt.disabled\"\n [style.minHeight.px]=\"zOptionHeight()\"\n (click)=\"selectOption(opt, close)\">\n @if (effectiveOptionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n effectiveOptionTemplate()!;\n context: { $implicit: opt, selected: opt | zIsSelected: currentValue() : isMultipleMode() }\n \" />\n } @else {\n <span\n class=\"min-w-0 flex-1 truncate\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zArrow]=\"false\"\n [zOffset]=\"5\"\n [zHideDelay]=\"0\"\n [zTriggerElement]=\"optionEl2\"\n [innerHTML]=\"opt.label | zHighlight: searchText() | zSafeHtml\"></span>\n }\n @if (opt | zIsSelected: currentValue() : isMultipleMode()) {\n <z-icon zType=\"lucideCheck\" zSize=\"18\" [zStrokeWidth]=\"4\" class=\"text-primary ml-auto shrink-0\" />\n }\n </div>\n }\n @if (canLoadMore()) {\n <div #loadMoreSentinel class=\"h-px w-full shrink-0\"></div>\n }\n </div>\n }\n } @else {\n <div class=\"flex items-center justify-center p-1\" [style.height.px]=\"optionsMaxHeight()\">\n @if (isEmptyData()) {\n <z-empty [zIcon]=\"zEmptyIcon()\" zSize=\"sm\" [zMessage]=\"effectiveEmptyText()\" />\n } @else {\n <z-empty zIcon=\"lucideSearchX\" zSize=\"sm\" [zMessage]=\"effectiveNotFoundText()\" />\n }\n </div>\n }\n\n @if (isLoadingMore()) {\n <div class=\"z-select-loading-more border-border/50 flex items-center justify-center border-t py-1.5\">\n <z-loading zSize=\"xs\" [zLoading]=\"true\" />\n </div>\n }\n }\n\n @if (zShowAction() && (zActionTemplate() || isMultipleMode())) {\n <div class=\"border-border flex items-center gap-2 border-t px-2 py-1.5\">\n @if (zActionTemplate()) {\n <ng-container *ngTemplateOutlet=\"zActionTemplate()!\" />\n } @else {\n <z-button\n zSize=\"xs\"\n [zType]=\"isAllSelected() ? 'ghost-error' : 'ghost-info'\"\n class=\"min-w-0 flex-1\"\n (click)=\"toggleSelectAllAction()\"\n [zWave]=\"false\">\n <z-icon [zType]=\"isAllSelected() ? 'lucideX' : 'lucideCheckCheck'\" zSize=\"18\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ isAllSelected() ? effectiveClearAllText() : effectiveSelectAllText() }}</span>\n </z-button>\n }\n </div>\n }\n </div>\n </ng-template>\n</div>\n", styles: [".z-select-trigger{-webkit-user-select:none;user-select:none}.z-select-trigger:focus{outline:none}.z-select-trigger *{cursor:inherit}.z-select-tag{-webkit-user-select:none;user-select:none;animation:z-select-tag-enter .2s cubic-bezier(.4,0,.2,1)}@keyframes z-select-tag-enter{0%{opacity:0;transform:scale(.8) translateY(.25rem)}to{opacity:1;transform:scale(1) translateY(0)}}.z-select-remaining{animation:z-select-remaining-enter .25s cubic-bezier(.4,0,.2,1)}@keyframes z-select-remaining-enter{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}.z-select-dropdown input{text-overflow:ellipsis;overflow:hidden}.z-select-options{overflow-x:hidden!important}.z-select-virtual-scroll .z-select-virtual-inner{width:100%}.z-select-loading-more{animation:z-select-loading-enter .2s ease-out}@keyframes z-select-loading-enter{0%{opacity:0;transform:translateY(-.25rem)}to{opacity:1;transform:translateY(0)}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "directive", type: ZPopoverDirective, selector: "[z-popover]", inputs: ["zPopoverContent", "zPosition", "zTrigger", "zClass", "zShowDelay", "zHideDelay", "zDisabled", "zOffset", "zPopoverWidth", "zManualClose", "zScrollClose", "zShowArrow"], outputs: ["zShow", "zHide", "zHideStart", "zControl", "zPositionChange"], exportAs: ["zPopover"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ZButtonComponent, selector: "z-button, button[z-button], a[z-button]", inputs: ["class", "zType", "zSize", "zShape", "zLabel", "zLoading", "zDisabled", "zTypeIcon", "zSizeIcon", "zStrokeWidthIcon", "zWave"], exportAs: ["zButton"] }, { kind: "component", type: ZEmptyComponent, selector: "z-empty", inputs: ["class", "zType", "zIcon", "zIconSize", "zSize", "zMessage", "zDescription"] }, { kind: "directive", type: ZTooltipDirective, selector: "[z-tooltip], [zTooltip]", inputs: ["zContent", "zPosition", "zTrigger", "zTooltipType", "zTooltipSize", "zClass", "zShowDelay", "zHideDelay", "zArrow", "zDisabled", "zOffset", "zAutoDetect", "zTriggerElement", "zAlwaysShow", "zMaxWidth"], outputs: ["zShow", "zHide"], exportAs: ["zTooltip"] }, { kind: "component", type: ZLoadingComponent, selector: "z-loading", inputs: ["class", "zSpinner", "zSize", "zColor", "zText", "zOverlay", "zOverlayType", "zFullscreen", "zLoading"] }, { kind: "pipe", type: ZIsSelectedPipe, name: "zIsSelected" }, { kind: "pipe", type: ZOptionClassesPipe, name: "zOptionClasses" }, { kind: "pipe", type: ZTagClassesPipe, name: "zTagClasses" }, { kind: "pipe", type: ZHighlightPipe, name: "zHighlight" }, { kind: "pipe", type: ZSafeHtmlPipe, name: "zSafeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1119
1284
  }
1120
1285
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ZSelectComponent, decorators: [{
1121
1286
  type: Component,
@@ -1140,12 +1305,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
1140
1305
  useExisting: forwardRef(() => ZSelectComponent),
1141
1306
  multi: true,
1142
1307
  },
1143
- ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'zSelect', template: "<div class=\"z-select-wrapper relative flex w-full flex-col gap-2\">\n @if (zLabel()) {\n <label [for]=\"selectId\" class=\"text-xs leading-none font-medium\" [class]=\"zLabelClass()\">\n {{ zLabel() }}\n @if (zRequired()) {\n <span class=\"text-destructive! ml-0.5\">*</span>\n }\n </label>\n }\n\n <div class=\"relative\">\n <div\n #triggerEl\n [id]=\"selectId\"\n z-popover\n [zPopoverContent]=\"dropdownTpl\"\n [zOffset]=\"6\"\n [zDisabled]=\"isInteractionDisabled()\"\n [zScrollClose]=\"zScrollClose()\"\n zTrigger=\"click\"\n [zPosition]=\"zPosition()\"\n zClass=\"border-0 shadow-none p-0\"\n (zControl)=\"onPopoverControl($event)\"\n (zShow)=\"onPopoverShow()\"\n (zHideStart)=\"onPopoverHideStart()\"\n (zHide)=\"onPopoverHideEnd()\"\n class=\"z-select-trigger cursor-pointer\"\n [class]=\"selectClasses()\"\n [class.z-select-open]=\"uiState().isOpen\"\n (mousedown)=\"onTriggerMousedown()\"\n (keydown)=\"onTriggerKeydown($event)\"\n tabindex=\"0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"uiState().isOpen\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-controls]=\"dropdownId\">\n @if (zPrefix()) {\n <z-icon [zType]=\"zPrefix() || 'lucideChevronDown'\" zSize=\"18\" class=\"text-muted-foreground shrink-0\" />\n }\n\n <div\n class=\"z-select-tags-wrapper flex min-w-0 flex-1 items-center gap-1\"\n [class.flex-wrap]=\"zWrap()\"\n [class.overflow-hidden]=\"!zWrap()\">\n @if (isMultipleMode()) {\n @if (selectedOptions().length === 0) {\n <span class=\"text-muted-foreground truncate whitespace-nowrap\">\n {{ effectivePlaceholder() }}\n </span>\n } @else {\n @for (opt of displayedTags(); track opt.value) {\n <span\n #tagEl\n [class]=\"opt | zTagClasses: zSize() : isTagsMode()\"\n class=\"z-select-tag\"\n [class.min-w-0]=\"!zWrap()\"\n [class.shrink]=\"!zWrap()\">\n @if (effectiveSelectedTemplate()) {\n <ng-container *ngTemplateOutlet=\"effectiveSelectedTemplate()!; context: { $implicit: opt }\" />\n } @else {\n <span\n class=\"truncate\"\n [class.max-w-25]=\"zWrap()\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"6\"\n [zTriggerElement]=\"tagEl\">\n {{ opt.label }}\n </span>\n }\n @if (zAllowClear() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"-mr-0.5 flex size-3.5 shrink-0 items-center justify-center rounded-sm transition-colors hover:bg-black/10\"\n (click)=\"removeOption($event, opt)\"\n tabindex=\"-1\">\n <z-icon zType=\"lucideX\" zSize=\"10\" />\n </button>\n }\n </span>\n }\n @if (remainingCount() > 0) {\n <span\n class=\"z-select-remaining text-muted-foreground bg-muted rounded-sm px-1.5 py-0.5 text-xs font-medium\">\n +{{ remainingCount() }}\n </span>\n }\n }\n } @else {\n @if (selectedOption()) {\n @if (effectiveSelectedTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"effectiveSelectedTemplate()!; context: { $implicit: selectedOption() }\" />\n } @else {\n <span\n class=\"truncate\"\n z-tooltip\n [zContent]=\"selectedOption()!.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"10\">\n {{ selectedOption()!.label }}\n </span>\n }\n } @else {\n <span class=\"text-muted-foreground truncate whitespace-nowrap\">\n {{ effectivePlaceholder() }}\n </span>\n }\n }\n </div>\n\n @if (zLoading() || zLoadingMore()) {\n <z-icon zType=\"lucideLoaderCircle\" zSize=\"18\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n @if (!zLoading() && zAllowClear() && hasValue() && !isDisabled() && !isReadonly()) {\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:text-foreground flex shrink-0 items-center justify-center transition-colors\"\n (click)=\"clearAll($event)\"\n tabindex=\"-1\">\n <z-icon zType=\"lucideX\" zSize=\"18\" />\n </button>\n }\n\n @if (uiState().isValidating) {\n <z-icon zType=\"lucideLoader2\" zSize=\"18\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n <z-icon\n zType=\"lucideChevronDown\"\n zSize=\"18\"\n class=\"text-muted-foreground shrink-0 transition-transform duration-200\"\n [class.rotate-180]=\"uiState().isOpen\" />\n </div>\n\n @if (hasError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 pt-2 text-xs duration-200\">\n {{ errorMessage() }}\n </p>\n }\n </div>\n\n <ng-template #dropdownTpl let-close=\"close\">\n <div\n [id]=\"dropdownId\"\n class=\"z-select-dropdown bg-popover border-border rounded-sm border shadow-lg\"\n [style.width.px]=\"dropdownWidth()\"\n [style.min-width.px]=\"dropdownWidth()\">\n @if (zShowSearch()) {\n <div class=\"border-border flex items-center border-b px-3\">\n <z-icon zType=\"lucideSearch\" zSize=\"18\" class=\"text-muted-foreground/50 mr-2 shrink-0\" />\n <input\n #dropdownSearchInput\n type=\"text\"\n class=\"placeholder:text-muted-foreground text-foreground flex h-10 w-full bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50\"\n [placeholder]=\"effectivePlaceholderSearch()\"\n [ngModel]=\"searchText()\"\n (ngModelChange)=\"onSearchChange($event)\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\" />\n </div>\n }\n\n @if (zLoading()) {\n <div class=\"flex items-center justify-center\" [style.height.px]=\"optionsMaxHeight()\">\n <z-loading [zLoading]=\"true\" zSize=\"default\" />\n </div>\n } @else {\n @if (filteredOptions().length > 0) {\n @if (shouldUseVirtualScroll()) {\n <div\n #virtualScrollElement\n class=\"z-select-options z-select-virtual-scroll overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.height.px]=\"optionsMaxHeight()\">\n <div class=\"z-select-virtual-inner relative\" [style.height.px]=\"virtualizer.getTotalSize()\">\n @for (virtualItem of virtualizer.getVirtualItems(); track virtualItem.index) {\n @let opt = filteredOptions()[virtualItem.index];\n <div\n #optionEl\n class=\"z-select-option absolute right-0 left-0 min-w-0\"\n [ngClass]=\"opt | zIsSelected: currentValue() : isMultipleMode() | zOptionClasses: opt.disabled\"\n [style.height.px]=\"zOptionHeight()\"\n [style.transform]=\"'translateY(' + virtualItem.start + 'px)'\"\n (click)=\"selectOption(opt, close)\">\n @if (effectiveOptionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n effectiveOptionTemplate()!;\n context: { $implicit: opt, selected: opt | zIsSelected: currentValue() : isMultipleMode() }\n \" />\n } @else {\n <span\n class=\"min-w-0 flex-1 truncate\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"5\"\n [zArrow]=\"false\"\n [zTriggerElement]=\"optionEl\"\n [innerHTML]=\"opt.label | zHighlight: searchText() | zSafeHtml\"></span>\n }\n @if (opt | zIsSelected: currentValue() : isMultipleMode()) {\n <z-icon zType=\"lucideCheck\" zSize=\"16\" [zStrokeWidth]=\"4\" class=\"text-primary ml-auto shrink-0\" />\n }\n </div>\n }\n </div>\n @if (zLoadingMore()) {\n <div\n class=\"bg-popover/80 absolute right-0 bottom-0 left-0 flex items-center justify-center py-2\"\n [style.transform]=\"'translateY(' + virtualizer.getTotalSize() + 'px)'\">\n <z-loading zSize=\"xs\" [zLoading]=\"true\" />\n </div>\n }\n </div>\n } @else {\n <div\n #optionsContainer\n class=\"z-select-options flex flex-col gap-0.75 overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.maxHeight.px]=\"optionsMaxHeight()\">\n @for (opt of filteredOptions(); track opt.value) {\n <div\n #optionEl2\n class=\"z-select-option relative min-w-0\"\n [ngClass]=\"opt | zIsSelected: currentValue() : isMultipleMode() | zOptionClasses: opt.disabled\"\n [style.minHeight.px]=\"zOptionHeight()\"\n (click)=\"selectOption(opt, close)\">\n @if (effectiveOptionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n effectiveOptionTemplate()!;\n context: { $implicit: opt, selected: opt | zIsSelected: currentValue() : isMultipleMode() }\n \" />\n } @else {\n <span\n class=\"min-w-0 flex-1 truncate\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zArrow]=\"false\"\n [zOffset]=\"5\"\n [zHideDelay]=\"0\"\n [zTriggerElement]=\"optionEl2\"\n [innerHTML]=\"opt.label | zHighlight: searchText() | zSafeHtml\"></span>\n }\n @if (opt | zIsSelected: currentValue() : isMultipleMode()) {\n <z-icon zType=\"lucideCheck\" zSize=\"18\" [zStrokeWidth]=\"4\" class=\"text-primary ml-auto shrink-0\" />\n }\n </div>\n }\n @if (zEnableLoadMore()) {\n <div #loadMoreSentinel class=\"h-px w-full shrink-0\"></div>\n }\n </div>\n }\n } @else {\n <div class=\"flex items-center justify-center p-1\" [style.height.px]=\"optionsMaxHeight()\">\n @if (isEmptyData()) {\n <z-empty [zIcon]=\"zEmptyIcon()\" zSize=\"sm\" [zMessage]=\"effectiveEmptyText()\" />\n } @else {\n <z-empty zIcon=\"lucideSearchX\" zSize=\"sm\" [zMessage]=\"effectiveNotFoundText()\" />\n }\n </div>\n }\n\n @if (zLoadingMore()) {\n <div class=\"z-select-loading-more border-border/50 flex items-center justify-center border-t py-1.5\">\n <z-loading zSize=\"xs\" [zLoading]=\"true\" />\n </div>\n }\n }\n\n @if (zShowAction() && (zActionTemplate() || isMultipleMode())) {\n <div class=\"border-border flex items-center gap-2 border-t px-2 py-1.5\">\n @if (zActionTemplate()) {\n <ng-container *ngTemplateOutlet=\"zActionTemplate()!\" />\n } @else {\n <z-button\n zSize=\"xs\"\n [zType]=\"isAllSelected() ? 'ghost-error' : 'ghost-info'\"\n class=\"min-w-0 flex-1\"\n (click)=\"toggleSelectAllAction()\"\n [zWave]=\"false\">\n <z-icon [zType]=\"isAllSelected() ? 'lucideX' : 'lucideCheckCheck'\" zSize=\"18\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ isAllSelected() ? effectiveClearAllText() : effectiveSelectAllText() }}</span>\n </z-button>\n }\n </div>\n }\n </div>\n </ng-template>\n</div>\n", styles: [".z-select-trigger{-webkit-user-select:none;user-select:none}.z-select-trigger:focus{outline:none}.z-select-trigger *{cursor:inherit}.z-select-tag{-webkit-user-select:none;user-select:none;animation:z-select-tag-enter .2s cubic-bezier(.4,0,.2,1)}@keyframes z-select-tag-enter{0%{opacity:0;transform:scale(.8) translateY(.25rem)}to{opacity:1;transform:scale(1) translateY(0)}}.z-select-remaining{animation:z-select-remaining-enter .25s cubic-bezier(.4,0,.2,1)}@keyframes z-select-remaining-enter{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}.z-select-dropdown input{text-overflow:ellipsis;overflow:hidden}.z-select-options{overflow-x:hidden!important}.z-select-virtual-scroll .z-select-virtual-inner{width:100%}.z-select-loading-more{animation:z-select-loading-enter .2s ease-out}@keyframes z-select-loading-enter{0%{opacity:0;transform:translateY(-.25rem)}to{opacity:1;transform:translateY(0)}}\n"] }]
1144
- }], ctorParameters: () => [], propDecorators: { triggerRef: [{ type: i0.ViewChild, args: ['triggerEl', { isSignal: true }] }], searchInputRef: [{ type: i0.ViewChild, args: ['dropdownSearchInput', { isSignal: true }] }], dropdownTpl: [{ type: i0.ViewChild, args: ['dropdownTpl', { isSignal: true }] }], optionsContainerRef: [{ type: i0.ViewChild, args: ['optionsContainer', { isSignal: true }] }], virtualScrollRef: [{ type: i0.ViewChild, args: ['virtualScrollElement', { isSignal: true }] }], loadMoreSentinelRef: [{ type: i0.ViewChild, args: ['loadMoreSentinel', { isSignal: true }] }], customSelectedDirective: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ZSelectSelectedDirective), { isSignal: true }] }], customOptionDirective: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ZSelectOptionDirective), { isSignal: true }] }], zOnSearch: [{ type: i0.Output, args: ["zOnSearch"] }], zOnLoadMore: [{ type: i0.Output, args: ["zOnLoadMore"] }], zOnBlur: [{ type: i0.Output, args: ["zOnBlur"] }], zOnFocus: [{ type: i0.Output, args: ["zOnFocus"] }], zControl: [{ type: i0.Output, args: ["zControl"] }], zEvent: [{ type: i0.Output, args: ["zEvent"] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMode", required: false }] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", required: false }] }], zLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLabel", required: false }] }], zLabelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLabelClass", required: false }] }], zPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "zPlaceholder", required: false }] }], zRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRequired", required: false }] }], zDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDisabled", required: false }] }], zReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "zReadonly", required: false }] }], zLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLoading", required: false }] }], zPrefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "zPrefix", required: false }] }], zAllowClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAllowClear", required: false }] }], zWrap: [{ type: i0.Input, args: [{ isSignal: true, alias: "zWrap", required: false }] }], zShowSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowSearch", required: false }] }], zPlaceholderSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "zPlaceholderSearch", required: false }] }], zDebounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDebounce", required: false }] }], zNotFoundText: [{ type: i0.Input, args: [{ isSignal: true, alias: "zNotFoundText", required: false }] }], zEmptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "zEmptyText", required: false }] }], zEmptyIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "zEmptyIcon", required: false }] }], zMaxTagCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMaxTagCount", required: false }] }], zDropdownMaxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDropdownMaxHeight", required: false }] }], zOptionHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOptionHeight", required: false }] }], zVirtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "zVirtualScroll", required: false }] }], zShowAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowAction", required: false }] }], zOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOptions", required: false }] }], zTranslateLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTranslateLabels", required: false }] }], zKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "zKey", required: false }] }], zSearchServer: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSearchServer", required: false }] }], zLoadingMore: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLoadingMore", required: false }] }], zEnableLoadMore: [{ type: i0.Input, args: [{ isSignal: true, alias: "zEnableLoadMore", required: false }] }], zScrollDistance: [{ type: i0.Input, args: [{ isSignal: true, alias: "zScrollDistance", required: false }] }], zMaxVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMaxVisible", required: false }] }], zScrollClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "zScrollClose", required: false }] }], zPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "zPosition", required: false }] }], zSelectedTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSelectedTemplate", required: false }] }], zOptionTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOptionTemplate", required: false }] }], zActionTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "zActionTemplate", required: false }] }], zAsyncValidators: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAsyncValidators", required: false }] }], zAsyncDebounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAsyncDebounce", required: false }] }], zAsyncValidateOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAsyncValidateOn", required: false }] }], zValidators: [{ type: i0.Input, args: [{ isSignal: true, alias: "zValidators", required: false }] }] } });
1308
+ ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'zSelect', template: "<div class=\"z-select-wrapper relative flex w-full flex-col gap-2\">\n @if (zLabel()) {\n <label [for]=\"selectId\" class=\"text-xs leading-none font-medium\" [class]=\"zLabelClass()\">\n {{ zLabel() }}\n @if (zRequired()) {\n <span class=\"text-destructive! ml-0.5\">*</span>\n }\n </label>\n }\n\n <div class=\"relative\">\n <div\n #triggerEl\n [id]=\"selectId\"\n z-popover\n [zPopoverContent]=\"dropdownTpl\"\n [zOffset]=\"6\"\n [zDisabled]=\"isInteractionDisabled()\"\n [zScrollClose]=\"zScrollClose()\"\n zTrigger=\"click\"\n [zPosition]=\"zPosition()\"\n zClass=\"border-0 shadow-none p-0\"\n (zControl)=\"onPopoverControl($event)\"\n (zShow)=\"onPopoverShow()\"\n (zHideStart)=\"onPopoverHideStart()\"\n (zHide)=\"onPopoverHideEnd()\"\n class=\"z-select-trigger cursor-pointer\"\n [class]=\"selectClasses()\"\n [class.z-select-open]=\"uiState().isOpen\"\n (mousedown)=\"onTriggerMousedown()\"\n (keydown)=\"onTriggerKeydown($event)\"\n tabindex=\"0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"uiState().isOpen\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-controls]=\"dropdownId\">\n @if (zPrefix()) {\n <z-icon [zType]=\"zPrefix() || 'lucideChevronDown'\" zSize=\"18\" class=\"text-muted-foreground shrink-0\" />\n }\n\n <div\n class=\"z-select-tags-wrapper flex min-w-0 flex-1 items-center gap-1\"\n [class.flex-wrap]=\"zWrap()\"\n [class.overflow-hidden]=\"!zWrap()\">\n @if (isMultipleMode()) {\n @if (selectedOptions().length === 0) {\n <span class=\"text-muted-foreground truncate whitespace-nowrap\">\n {{ effectivePlaceholder() }}\n </span>\n } @else {\n @for (opt of displayedTags(); track opt.value) {\n <span\n #tagEl\n [class]=\"opt | zTagClasses: zSize() : isTagsMode()\"\n class=\"z-select-tag\"\n [class.min-w-0]=\"!zWrap()\"\n [class.shrink]=\"!zWrap()\">\n @if (effectiveSelectedTemplate()) {\n <ng-container *ngTemplateOutlet=\"effectiveSelectedTemplate()!; context: { $implicit: opt }\" />\n } @else {\n <span\n class=\"truncate\"\n [class.max-w-25]=\"zWrap()\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"6\"\n [zTriggerElement]=\"tagEl\">\n {{ opt.label }}\n </span>\n }\n @if (zAllowClear() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"-mr-0.5 flex size-3.5 shrink-0 items-center justify-center rounded-sm transition-colors hover:bg-black/10\"\n (click)=\"removeOption($event, opt)\"\n tabindex=\"-1\">\n <z-icon zType=\"lucideX\" zSize=\"10\" />\n </button>\n }\n </span>\n }\n @if (remainingCount() > 0) {\n <span\n class=\"z-select-remaining text-muted-foreground bg-muted rounded-sm px-1.5 py-0.5 text-xs font-medium\">\n +{{ remainingCount() }}\n </span>\n }\n }\n } @else {\n @if (selectedOption()) {\n @if (effectiveSelectedTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"effectiveSelectedTemplate()!; context: { $implicit: selectedOption() }\" />\n } @else {\n <span\n class=\"truncate\"\n z-tooltip\n [zContent]=\"selectedOption()!.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"10\">\n {{ selectedOption()!.label }}\n </span>\n }\n } @else {\n <span class=\"text-muted-foreground truncate whitespace-nowrap\">\n {{ effectivePlaceholder() }}\n </span>\n }\n }\n </div>\n\n @if (isLoading() || isLoadingMore()) {\n <z-icon zType=\"lucideLoaderCircle\" zSize=\"18\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n @if (!isLoading() && zAllowClear() && hasValue() && !isDisabled() && !isReadonly()) {\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:text-foreground flex shrink-0 items-center justify-center transition-colors\"\n (click)=\"clearAll($event)\"\n tabindex=\"-1\">\n <z-icon zType=\"lucideX\" zSize=\"18\" />\n </button>\n }\n\n @if (uiState().isValidating) {\n <z-icon zType=\"lucideLoader2\" zSize=\"18\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n <z-icon\n zType=\"lucideChevronDown\"\n zSize=\"18\"\n class=\"text-muted-foreground shrink-0 transition-transform duration-200\"\n [class.rotate-180]=\"uiState().isOpen\" />\n </div>\n\n @if (hasError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 pt-2 text-xs duration-200\">\n {{ errorMessage() }}\n </p>\n }\n </div>\n\n <ng-template #dropdownTpl let-close=\"close\">\n <div\n [id]=\"dropdownId\"\n class=\"z-select-dropdown bg-popover border-border rounded-sm border shadow-lg\"\n [style.width.px]=\"dropdownWidth()\"\n [style.min-width.px]=\"dropdownWidth()\">\n @if (zShowSearch()) {\n <div class=\"border-border flex items-center border-b px-3\">\n <z-icon zType=\"lucideSearch\" zSize=\"18\" class=\"text-muted-foreground/50 mr-2 shrink-0\" />\n <input\n #dropdownSearchInput\n type=\"text\"\n class=\"placeholder:text-muted-foreground text-foreground flex h-10 w-full bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50\"\n [placeholder]=\"effectivePlaceholderSearch()\"\n [ngModel]=\"searchText()\"\n (ngModelChange)=\"onSearchChange($event)\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\" />\n </div>\n }\n\n @if (isLoading()) {\n <div class=\"flex items-center justify-center\" [style.height.px]=\"optionsMaxHeight()\">\n <z-loading [zLoading]=\"true\" zSize=\"default\" />\n </div>\n } @else {\n @if (filteredOptions().length > 0) {\n @if (shouldUseVirtualScroll()) {\n <div\n #virtualScrollElement\n class=\"z-select-options z-select-virtual-scroll overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.height.px]=\"optionsMaxHeight()\">\n <div class=\"z-select-virtual-inner relative\" [style.height.px]=\"virtualizer.getTotalSize()\">\n @for (virtualItem of virtualizer.getVirtualItems(); track virtualItem.index) {\n @let opt = filteredOptions()[virtualItem.index];\n <div\n #optionEl\n class=\"z-select-option absolute right-0 left-0 min-w-0\"\n [ngClass]=\"opt | zIsSelected: currentValue() : isMultipleMode() | zOptionClasses: opt.disabled\"\n [style.height.px]=\"zOptionHeight()\"\n [style.transform]=\"'translateY(' + virtualItem.start + 'px)'\"\n (click)=\"selectOption(opt, close)\">\n @if (effectiveOptionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n effectiveOptionTemplate()!;\n context: { $implicit: opt, selected: opt | zIsSelected: currentValue() : isMultipleMode() }\n \" />\n } @else {\n <span\n class=\"min-w-0 flex-1 truncate\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"5\"\n [zArrow]=\"false\"\n [zTriggerElement]=\"optionEl\"\n [innerHTML]=\"opt.label | zHighlight: searchText() | zSafeHtml\"></span>\n }\n @if (opt | zIsSelected: currentValue() : isMultipleMode()) {\n <z-icon zType=\"lucideCheck\" zSize=\"16\" [zStrokeWidth]=\"4\" class=\"text-primary ml-auto shrink-0\" />\n }\n </div>\n }\n </div>\n @if (isLoadingMore()) {\n <div\n class=\"bg-popover/80 absolute right-0 bottom-0 left-0 flex items-center justify-center py-2\"\n [style.transform]=\"'translateY(' + virtualizer.getTotalSize() + 'px)'\">\n <z-loading zSize=\"xs\" [zLoading]=\"true\" />\n </div>\n }\n </div>\n } @else {\n <div\n #optionsContainer\n class=\"z-select-options flex flex-col gap-0.75 overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.maxHeight.px]=\"optionsMaxHeight()\">\n @for (opt of filteredOptions(); track opt.value) {\n <div\n #optionEl2\n class=\"z-select-option relative min-w-0\"\n [ngClass]=\"opt | zIsSelected: currentValue() : isMultipleMode() | zOptionClasses: opt.disabled\"\n [style.minHeight.px]=\"zOptionHeight()\"\n (click)=\"selectOption(opt, close)\">\n @if (effectiveOptionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n effectiveOptionTemplate()!;\n context: { $implicit: opt, selected: opt | zIsSelected: currentValue() : isMultipleMode() }\n \" />\n } @else {\n <span\n class=\"min-w-0 flex-1 truncate\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zArrow]=\"false\"\n [zOffset]=\"5\"\n [zHideDelay]=\"0\"\n [zTriggerElement]=\"optionEl2\"\n [innerHTML]=\"opt.label | zHighlight: searchText() | zSafeHtml\"></span>\n }\n @if (opt | zIsSelected: currentValue() : isMultipleMode()) {\n <z-icon zType=\"lucideCheck\" zSize=\"18\" [zStrokeWidth]=\"4\" class=\"text-primary ml-auto shrink-0\" />\n }\n </div>\n }\n @if (canLoadMore()) {\n <div #loadMoreSentinel class=\"h-px w-full shrink-0\"></div>\n }\n </div>\n }\n } @else {\n <div class=\"flex items-center justify-center p-1\" [style.height.px]=\"optionsMaxHeight()\">\n @if (isEmptyData()) {\n <z-empty [zIcon]=\"zEmptyIcon()\" zSize=\"sm\" [zMessage]=\"effectiveEmptyText()\" />\n } @else {\n <z-empty zIcon=\"lucideSearchX\" zSize=\"sm\" [zMessage]=\"effectiveNotFoundText()\" />\n }\n </div>\n }\n\n @if (isLoadingMore()) {\n <div class=\"z-select-loading-more border-border/50 flex items-center justify-center border-t py-1.5\">\n <z-loading zSize=\"xs\" [zLoading]=\"true\" />\n </div>\n }\n }\n\n @if (zShowAction() && (zActionTemplate() || isMultipleMode())) {\n <div class=\"border-border flex items-center gap-2 border-t px-2 py-1.5\">\n @if (zActionTemplate()) {\n <ng-container *ngTemplateOutlet=\"zActionTemplate()!\" />\n } @else {\n <z-button\n zSize=\"xs\"\n [zType]=\"isAllSelected() ? 'ghost-error' : 'ghost-info'\"\n class=\"min-w-0 flex-1\"\n (click)=\"toggleSelectAllAction()\"\n [zWave]=\"false\">\n <z-icon [zType]=\"isAllSelected() ? 'lucideX' : 'lucideCheckCheck'\" zSize=\"18\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ isAllSelected() ? effectiveClearAllText() : effectiveSelectAllText() }}</span>\n </z-button>\n }\n </div>\n }\n </div>\n </ng-template>\n</div>\n", styles: [".z-select-trigger{-webkit-user-select:none;user-select:none}.z-select-trigger:focus{outline:none}.z-select-trigger *{cursor:inherit}.z-select-tag{-webkit-user-select:none;user-select:none;animation:z-select-tag-enter .2s cubic-bezier(.4,0,.2,1)}@keyframes z-select-tag-enter{0%{opacity:0;transform:scale(.8) translateY(.25rem)}to{opacity:1;transform:scale(1) translateY(0)}}.z-select-remaining{animation:z-select-remaining-enter .25s cubic-bezier(.4,0,.2,1)}@keyframes z-select-remaining-enter{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}.z-select-dropdown input{text-overflow:ellipsis;overflow:hidden}.z-select-options{overflow-x:hidden!important}.z-select-virtual-scroll .z-select-virtual-inner{width:100%}.z-select-loading-more{animation:z-select-loading-enter .2s ease-out}@keyframes z-select-loading-enter{0%{opacity:0;transform:translateY(-.25rem)}to{opacity:1;transform:translateY(0)}}\n"] }]
1309
+ }], ctorParameters: () => [], propDecorators: { triggerRef: [{ type: i0.ViewChild, args: ['triggerEl', { isSignal: true }] }], searchInputRef: [{ type: i0.ViewChild, args: ['dropdownSearchInput', { isSignal: true }] }], dropdownTpl: [{ type: i0.ViewChild, args: ['dropdownTpl', { isSignal: true }] }], optionsContainerRef: [{ type: i0.ViewChild, args: ['optionsContainer', { isSignal: true }] }], virtualScrollRef: [{ type: i0.ViewChild, args: ['virtualScrollElement', { isSignal: true }] }], loadMoreSentinelRef: [{ type: i0.ViewChild, args: ['loadMoreSentinel', { isSignal: true }] }], customSelectedDirective: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ZSelectSelectedDirective), { isSignal: true }] }], customOptionDirective: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ZSelectOptionDirective), { isSignal: true }] }], zOnSearch: [{ type: i0.Output, args: ["zOnSearch"] }], zOnLoadMore: [{ type: i0.Output, args: ["zOnLoadMore"] }], zOnBlur: [{ type: i0.Output, args: ["zOnBlur"] }], zOnFocus: [{ type: i0.Output, args: ["zOnFocus"] }], zControl: [{ type: i0.Output, args: ["zControl"] }], zEvent: [{ type: i0.Output, args: ["zEvent"] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], zMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMode", required: false }] }], zSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSize", required: false }] }], zLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLabel", required: false }] }], zLabelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLabelClass", required: false }] }], zPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "zPlaceholder", required: false }] }], zRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "zRequired", required: false }] }], zDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDisabled", required: false }] }], zReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "zReadonly", required: false }] }], zLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLoading", required: false }] }], zPrefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "zPrefix", required: false }] }], zAllowClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAllowClear", required: false }] }], zWrap: [{ type: i0.Input, args: [{ isSignal: true, alias: "zWrap", required: false }] }], zShowSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowSearch", required: false }] }], zPlaceholderSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "zPlaceholderSearch", required: false }] }], zDebounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDebounce", required: false }] }], zNotFoundText: [{ type: i0.Input, args: [{ isSignal: true, alias: "zNotFoundText", required: false }] }], zEmptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "zEmptyText", required: false }] }], zEmptyIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "zEmptyIcon", required: false }] }], zMaxTagCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMaxTagCount", required: false }] }], zDropdownMaxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "zDropdownMaxHeight", required: false }] }], zOptionHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOptionHeight", required: false }] }], zVirtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "zVirtualScroll", required: false }] }], zShowAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "zShowAction", required: false }] }], zOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOptions", required: false }] }], zConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "zConfig", required: false }] }], zTranslateLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "zTranslateLabels", required: false }] }], zKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "zKey", required: false }] }], zSearchServer: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSearchServer", required: false }] }], zLoadingMore: [{ type: i0.Input, args: [{ isSignal: true, alias: "zLoadingMore", required: false }] }], zEnableLoadMore: [{ type: i0.Input, args: [{ isSignal: true, alias: "zEnableLoadMore", required: false }] }], zScrollDistance: [{ type: i0.Input, args: [{ isSignal: true, alias: "zScrollDistance", required: false }] }], zMaxVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "zMaxVisible", required: false }] }], zScrollClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "zScrollClose", required: false }] }], zPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "zPosition", required: false }] }], zSelectedTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "zSelectedTemplate", required: false }] }], zOptionTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "zOptionTemplate", required: false }] }], zActionTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "zActionTemplate", required: false }] }], zAsyncValidators: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAsyncValidators", required: false }] }], zAsyncDebounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAsyncDebounce", required: false }] }], zAsyncValidateOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "zAsyncValidateOn", required: false }] }], zValidators: [{ type: i0.Input, args: [{ isSignal: true, alias: "zValidators", required: false }] }] } });
1145
1310
 
1146
1311
  /**
1147
1312
  * Generated bundle index. Do not edit.
1148
1313
  */
1149
1314
 
1150
- export { TAG_COLORS, ZIsSelectedPipe, ZOptionClassesPipe, ZSelectComponent, ZSelectOptionDirective, ZSelectSelectedDirective, ZTagClassesPipe, filterOptions, getTagColor, zSelectOptionVariants, zSelectTagVariants, zSelectVariants };
1315
+ export { TAG_COLORS, ZIsSelectedPipe, ZOptionClassesPipe, ZSelectComponent, ZSelectOptionDirective, ZSelectSelectedDirective, ZTagClassesPipe, Z_SELECT_DEFAULT_CONFIG, filterOptions, getTagColor, zSelectOptionVariants, zSelectTagVariants, zSelectVariants };
1151
1316
  //# sourceMappingURL=shival99-z-ui-components-z-select.mjs.map