@shival99/z-ui 1.4.2 → 1.4.3
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.
- package/fesm2022/shival99-z-ui-components-z-accordion.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-accordion.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-breadcrumb.mjs +3 -3
- package/fesm2022/shival99-z-ui-components-z-breadcrumb.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-button.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-button.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs +31 -18
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-card.mjs +5 -5
- package/fesm2022/shival99-z-ui-components-z-card.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-checkbox.mjs +16 -10
- package/fesm2022/shival99-z-ui-components-z-checkbox.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-code.mjs +7 -7
- package/fesm2022/shival99-z-ui-components-z-code.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs +4 -4
- package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-editor.mjs +4 -4
- package/fesm2022/shival99-z-ui-components-z-editor.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-filter.mjs +8 -8
- package/fesm2022/shival99-z-ui-components-z-filter.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-input.mjs +192 -182
- package/fesm2022/shival99-z-ui-components-z-input.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-menu.mjs +5 -5
- package/fesm2022/shival99-z-ui-components-z-menu.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs +5 -5
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-popover.mjs +12 -12
- package/fesm2022/shival99-z-ui-components-z-popover.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-radio.mjs +4 -4
- package/fesm2022/shival99-z-ui-components-z-radio.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-select.mjs +179 -168
- package/fesm2022/shival99-z-ui-components-z-select.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-skeleton.mjs +2 -2
- package/fesm2022/shival99-z-ui-components-z-skeleton.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-steps.mjs +5 -5
- package/fesm2022/shival99-z-ui-components-z-steps.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-switch.mjs +4 -4
- package/fesm2022/shival99-z-ui-components-z-switch.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-table.mjs +343 -36
- package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-tags.mjs +12 -11
- package/fesm2022/shival99-z-ui-components-z-tags.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs +0 -2
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-toast.mjs +3 -3
- package/fesm2022/shival99-z-ui-components-z-toast.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-upload.mjs +12 -12
- package/fesm2022/shival99-z-ui-components-z-upload.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-services.mjs +9 -9
- package/fesm2022/shival99-z-ui-services.mjs.map +1 -1
- package/package.json +1 -1
- package/types/shival99-z-ui-components-z-accordion.d.ts +1 -1
- package/types/shival99-z-ui-components-z-breadcrumb.d.ts +1 -1
- package/types/shival99-z-ui-components-z-button.d.ts +1 -1
- package/types/shival99-z-ui-components-z-calendar.d.ts +22 -8
- package/types/shival99-z-ui-components-z-card.d.ts +3 -3
- package/types/shival99-z-ui-components-z-checkbox.d.ts +8 -5
- package/types/shival99-z-ui-components-z-code.d.ts +5 -5
- package/types/shival99-z-ui-components-z-dropdown-menu.d.ts +2 -2
- package/types/shival99-z-ui-components-z-editor.d.ts +4 -4
- package/types/shival99-z-ui-components-z-filter.d.ts +8 -8
- package/types/shival99-z-ui-components-z-input.d.ts +47 -35
- package/types/shival99-z-ui-components-z-menu.d.ts +3 -3
- package/types/shival99-z-ui-components-z-modal.d.ts +1 -1
- package/types/shival99-z-ui-components-z-pagination.d.ts +3 -3
- package/types/shival99-z-ui-components-z-popover.d.ts +10 -10
- package/types/shival99-z-ui-components-z-radio.d.ts +2 -2
- package/types/shival99-z-ui-components-z-select.d.ts +59 -46
- package/types/shival99-z-ui-components-z-skeleton.d.ts +1 -1
- package/types/shival99-z-ui-components-z-steps.d.ts +3 -3
- package/types/shival99-z-ui-components-z-switch.d.ts +2 -2
- package/types/shival99-z-ui-components-z-table.d.ts +77 -9
- package/types/shival99-z-ui-components-z-tags.d.ts +4 -2
- package/types/shival99-z-ui-components-z-timeline.d.ts +6 -6
- package/types/shival99-z-ui-components-z-toast.d.ts +2 -2
- package/types/shival99-z-ui-components-z-upload.d.ts +13 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgClass, NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, TemplateRef, Directive, Pipe,
|
|
3
|
+
import { inject, TemplateRef, Directive, Pipe, Injector, DestroyRef, viewChild, contentChild, output, input, signal, computed, effect, forwardRef, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { NgControl, PristineChangeEvent, TouchedChangeEvent, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
@@ -241,6 +241,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
241
241
|
}] });
|
|
242
242
|
|
|
243
243
|
class ZSelectComponent {
|
|
244
|
+
_injector = inject(Injector);
|
|
245
|
+
_destroyRef = inject(DestroyRef);
|
|
246
|
+
_zTranslate = inject(ZTranslateService);
|
|
247
|
+
triggerRef = viewChild('triggerEl', ...(ngDevMode ? [{ debugName: "triggerRef" }] : []));
|
|
248
|
+
searchInputRef = viewChild('dropdownSearchInput', ...(ngDevMode ? [{ debugName: "searchInputRef" }] : []));
|
|
249
|
+
dropdownTpl = viewChild('dropdownTpl', ...(ngDevMode ? [{ debugName: "dropdownTpl" }] : []));
|
|
250
|
+
optionsContainerRef = viewChild('optionsContainer', ...(ngDevMode ? [{ debugName: "optionsContainerRef" }] : []));
|
|
251
|
+
virtualScrollRef = viewChild('virtualScrollElement', ...(ngDevMode ? [{ debugName: "virtualScrollRef" }] : []));
|
|
252
|
+
loadMoreSentinelRef = viewChild('loadMoreSentinel', ...(ngDevMode ? [{ debugName: "loadMoreSentinelRef" }] : []));
|
|
253
|
+
customSelectedDirective = contentChild((ZSelectSelectedDirective), ...(ngDevMode ? [{ debugName: "customSelectedDirective" }] : []));
|
|
254
|
+
customOptionDirective = contentChild((ZSelectOptionDirective), ...(ngDevMode ? [{ debugName: "customOptionDirective" }] : []));
|
|
244
255
|
zOnSearch = output();
|
|
245
256
|
zOnLoadMore = output();
|
|
246
257
|
zControl = output();
|
|
@@ -280,54 +291,36 @@ class ZSelectComponent {
|
|
|
280
291
|
zSelectedTemplate = input(null, ...(ngDevMode ? [{ debugName: "zSelectedTemplate" }] : []));
|
|
281
292
|
zOptionTemplate = input(null, ...(ngDevMode ? [{ debugName: "zOptionTemplate" }] : []));
|
|
282
293
|
zActionTemplate = input(null, ...(ngDevMode ? [{ debugName: "zActionTemplate" }] : []));
|
|
283
|
-
customSelectedDirective = contentChild((ZSelectSelectedDirective), ...(ngDevMode ? [{ debugName: "customSelectedDirective" }] : []));
|
|
284
|
-
customOptionDirective = contentChild((ZSelectOptionDirective), ...(ngDevMode ? [{ debugName: "customOptionDirective" }] : []));
|
|
285
294
|
zAsyncValidators = input([], ...(ngDevMode ? [{ debugName: "zAsyncValidators" }] : []));
|
|
286
295
|
zAsyncDebounce = input(300, ...(ngDevMode ? [{ debugName: "zAsyncDebounce" }] : []));
|
|
287
296
|
zAsyncValidateOn = input('change', ...(ngDevMode ? [{ debugName: "zAsyncValidateOn" }] : []));
|
|
288
297
|
zValidators = input([], ...(ngDevMode ? [{ debugName: "zValidators" }] : []));
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
298
|
+
_value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : []));
|
|
299
|
+
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
300
|
+
_touched = signal(false, ...(ngDevMode ? [{ debugName: "_touched" }] : []));
|
|
301
|
+
_dirty = signal(false, ...(ngDevMode ? [{ debugName: "_dirty" }] : []));
|
|
302
|
+
_formControl = signal(null, ...(ngDevMode ? [{ debugName: "_formControl" }] : []));
|
|
303
|
+
_formStateVersion = signal(0, ...(ngDevMode ? [{ debugName: "_formStateVersion" }] : []));
|
|
304
|
+
_popoverControl = signal(null, ...(ngDevMode ? [{ debugName: "_popoverControl" }] : []));
|
|
305
|
+
_allKnownOptions = signal([], ...(ngDevMode ? [{ debugName: "_allKnownOptions" }] : []));
|
|
306
|
+
_asyncErrors = signal(new Map(), ...(ngDevMode ? [{ debugName: "_asyncErrors" }] : []));
|
|
307
|
+
uiState = signal({
|
|
308
|
+
isOpen: false,
|
|
309
|
+
hasScrollShadow: false,
|
|
310
|
+
isFocused: false,
|
|
311
|
+
isValidating: false,
|
|
312
|
+
}, ...(ngDevMode ? [{ debugName: "uiState" }] : []));
|
|
295
313
|
selectId = zUuid('z-select');
|
|
296
314
|
dropdownId = `${this.selectId}-dropdown`;
|
|
297
|
-
isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
298
315
|
searchText = signal('', ...(ngDevMode ? [{ debugName: "searchText" }] : []));
|
|
299
316
|
dropdownWidth = signal(0, ...(ngDevMode ? [{ debugName: "dropdownWidth" }] : []));
|
|
300
|
-
|
|
301
|
-
_popoverControl = signal(null, ...(ngDevMode ? [{ debugName: "_popoverControl" }] : []));
|
|
302
|
-
_searchSubject = new Subject();
|
|
303
|
-
_loadMoreObserver = null;
|
|
304
|
-
_allKnownOptions = signal([], ...(ngDevMode ? [{ debugName: "_allKnownOptions" }] : []));
|
|
305
|
-
_virtualScrollListener = null;
|
|
306
|
-
_optionGap = 3;
|
|
317
|
+
currentValue = this._value.asReadonly();
|
|
307
318
|
virtualizer = injectVirtualizer(() => ({
|
|
308
319
|
scrollElement: this.virtualScrollRef(),
|
|
309
320
|
count: this.filteredOptions().length,
|
|
310
|
-
estimateSize: () => this.zOptionHeight() +
|
|
321
|
+
estimateSize: () => this.zOptionHeight() + 3,
|
|
311
322
|
overscan: 5,
|
|
312
323
|
}));
|
|
313
|
-
_value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : []));
|
|
314
|
-
currentValue = this._value.asReadonly();
|
|
315
|
-
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
316
|
-
_touched = signal(false, ...(ngDevMode ? [{ debugName: "_touched" }] : []));
|
|
317
|
-
_dirty = signal(false, ...(ngDevMode ? [{ debugName: "_dirty" }] : []));
|
|
318
|
-
_formControl = signal(null, ...(ngDevMode ? [{ debugName: "_formControl" }] : []));
|
|
319
|
-
_formStateVersion = signal(0, ...(ngDevMode ? [{ debugName: "_formStateVersion" }] : []));
|
|
320
|
-
_injector = inject(Injector);
|
|
321
|
-
_destroyRef = inject(DestroyRef);
|
|
322
|
-
_zTranslate = inject(ZTranslateService);
|
|
323
|
-
_onChange = () => void 0;
|
|
324
|
-
_onTouched = () => void 0;
|
|
325
|
-
_ngControl = null;
|
|
326
|
-
isValidating = signal(false, ...(ngDevMode ? [{ debugName: "isValidating" }] : []));
|
|
327
|
-
_asyncErrors = signal(new Map(), ...(ngDevMode ? [{ debugName: "_asyncErrors" }] : []));
|
|
328
|
-
_asyncCancelSubject = new Subject();
|
|
329
|
-
_asyncValidationSubject = new Subject();
|
|
330
|
-
_asyncValidationAbortController = null;
|
|
331
324
|
isDisabled = computed(() => this._disabled() || this.zDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
332
325
|
isReadonly = computed(() => this.zReadonly(), ...(ngDevMode ? [{ debugName: "isReadonly" }] : []));
|
|
333
326
|
isInteractionDisabled = computed(() => this.isDisabled() || this.isReadonly() || this.zLoading(), ...(ngDevMode ? [{ debugName: "isInteractionDisabled" }] : []));
|
|
@@ -479,7 +472,7 @@ class ZSelectComponent {
|
|
|
479
472
|
if (this.isReadonly()) {
|
|
480
473
|
return 'readonly';
|
|
481
474
|
}
|
|
482
|
-
if (this.
|
|
475
|
+
if (this.uiState().isOpen) {
|
|
483
476
|
return 'open';
|
|
484
477
|
}
|
|
485
478
|
if (this.hasError()) {
|
|
@@ -548,6 +541,24 @@ class ZSelectComponent {
|
|
|
548
541
|
'h-9': this.zSize() === 'default',
|
|
549
542
|
'h-10': this.zSize() === 'lg',
|
|
550
543
|
}, this.class()), ...(ngDevMode ? [{ debugName: "selectClasses" }] : []));
|
|
544
|
+
state = computed(() => ({
|
|
545
|
+
focused: this.uiState().isFocused,
|
|
546
|
+
touched: this._touched(),
|
|
547
|
+
blurred: !this.uiState().isFocused,
|
|
548
|
+
dirty: this._dirty(),
|
|
549
|
+
disabled: this.isDisabled(),
|
|
550
|
+
readonly: this.isReadonly(),
|
|
551
|
+
open: this.uiState().isOpen,
|
|
552
|
+
}), ...(ngDevMode ? [{ debugName: "state" }] : []));
|
|
553
|
+
_searchSubject = new Subject();
|
|
554
|
+
_asyncCancelSubject = new Subject();
|
|
555
|
+
_asyncValidationSubject = new Subject();
|
|
556
|
+
_loadMoreObserver = null;
|
|
557
|
+
_virtualScrollListener = null;
|
|
558
|
+
_asyncValidationAbortController = null;
|
|
559
|
+
_onChange = () => void 0;
|
|
560
|
+
_onTouched = () => void 0;
|
|
561
|
+
_ngControl = null;
|
|
551
562
|
constructor() {
|
|
552
563
|
effect(() => {
|
|
553
564
|
if (!this.zSearchServer()) {
|
|
@@ -562,7 +573,7 @@ class ZSelectComponent {
|
|
|
562
573
|
}
|
|
563
574
|
});
|
|
564
575
|
effect(() => {
|
|
565
|
-
const isOpen = this.
|
|
576
|
+
const { isOpen } = this.uiState();
|
|
566
577
|
const useVirtual = this.shouldUseVirtualScroll();
|
|
567
578
|
if (!isOpen) {
|
|
568
579
|
return;
|
|
@@ -579,7 +590,7 @@ class ZSelectComponent {
|
|
|
579
590
|
return;
|
|
580
591
|
}
|
|
581
592
|
const isScrollable = el.scrollHeight > el.clientHeight;
|
|
582
|
-
this.
|
|
593
|
+
this.uiState.update(s => ({ ...s, hasScrollShadow: isScrollable }));
|
|
583
594
|
};
|
|
584
595
|
requestAnimationFrame(() => {
|
|
585
596
|
requestAnimationFrame(() => {
|
|
@@ -599,7 +610,7 @@ class ZSelectComponent {
|
|
|
599
610
|
});
|
|
600
611
|
effect(() => {
|
|
601
612
|
const sentinel = this.loadMoreSentinelRef();
|
|
602
|
-
const isOpen = this.
|
|
613
|
+
const { isOpen } = this.uiState();
|
|
603
614
|
const optionsCount = this.filteredOptions().length;
|
|
604
615
|
if (!sentinel || !isOpen || optionsCount === 0) {
|
|
605
616
|
this._cleanupLoadMoreObserver();
|
|
@@ -608,7 +619,7 @@ class ZSelectComponent {
|
|
|
608
619
|
this._setupLoadMoreObserver();
|
|
609
620
|
});
|
|
610
621
|
effect(() => {
|
|
611
|
-
const isOpen = this.
|
|
622
|
+
const { isOpen } = this.uiState();
|
|
612
623
|
const useVirtual = this.shouldUseVirtualScroll();
|
|
613
624
|
const optionsCount = this.filteredOptions().length;
|
|
614
625
|
if (!isOpen || !useVirtual || optionsCount === 0) {
|
|
@@ -692,6 +703,52 @@ class ZSelectComponent {
|
|
|
692
703
|
setDisabledState(isDisabled) {
|
|
693
704
|
this._disabled.set(isDisabled);
|
|
694
705
|
}
|
|
706
|
+
reset() {
|
|
707
|
+
if (this.isMultipleMode()) {
|
|
708
|
+
this._value.set([]);
|
|
709
|
+
this._onChange([]);
|
|
710
|
+
}
|
|
711
|
+
if (!this.isMultipleMode()) {
|
|
712
|
+
this._value.set(null);
|
|
713
|
+
this._onChange(null);
|
|
714
|
+
}
|
|
715
|
+
this._touched.set(false);
|
|
716
|
+
this._dirty.set(false);
|
|
717
|
+
this.searchText.set('');
|
|
718
|
+
if (!this._ngControl?.control) {
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
this._ngControl.control.markAsPristine();
|
|
722
|
+
this._ngControl.control.markAsUntouched();
|
|
723
|
+
}
|
|
724
|
+
focus() {
|
|
725
|
+
this.triggerRef()?.nativeElement.focus();
|
|
726
|
+
}
|
|
727
|
+
blur() {
|
|
728
|
+
this.triggerRef()?.nativeElement.blur();
|
|
729
|
+
}
|
|
730
|
+
markAsTouched() {
|
|
731
|
+
this._touched.set(true);
|
|
732
|
+
this._onTouched();
|
|
733
|
+
}
|
|
734
|
+
markAsUntouched() {
|
|
735
|
+
this._touched.set(false);
|
|
736
|
+
}
|
|
737
|
+
markAsDirty() {
|
|
738
|
+
this._dirty.set(true);
|
|
739
|
+
}
|
|
740
|
+
markAsPristine() {
|
|
741
|
+
this._dirty.set(false);
|
|
742
|
+
}
|
|
743
|
+
validate() {
|
|
744
|
+
this._touched.set(true);
|
|
745
|
+
this._dirty.set(true);
|
|
746
|
+
this._onTouched();
|
|
747
|
+
if (this._ngControl?.control) {
|
|
748
|
+
this._ngControl.control.markAsDirty();
|
|
749
|
+
this._ngControl.control.markAsTouched();
|
|
750
|
+
}
|
|
751
|
+
}
|
|
695
752
|
onTriggerKeydown(event) {
|
|
696
753
|
if (this.isInteractionDisabled()) {
|
|
697
754
|
return;
|
|
@@ -701,7 +758,7 @@ class ZSelectComponent {
|
|
|
701
758
|
this.toggleDropdown();
|
|
702
759
|
return;
|
|
703
760
|
}
|
|
704
|
-
if (event.key === 'Escape' && this.
|
|
761
|
+
if (event.key === 'Escape' && this.uiState().isOpen) {
|
|
705
762
|
this._popoverControl()?.close();
|
|
706
763
|
}
|
|
707
764
|
}
|
|
@@ -719,7 +776,7 @@ class ZSelectComponent {
|
|
|
719
776
|
this._popoverControl.set(control);
|
|
720
777
|
}
|
|
721
778
|
onPopoverShow() {
|
|
722
|
-
this.
|
|
779
|
+
this.uiState.update(s => ({ ...s, isOpen: true, isFocused: true }));
|
|
723
780
|
this.searchText.set('');
|
|
724
781
|
this.zOnSearch.emit('');
|
|
725
782
|
if (this.zShowSearch()) {
|
|
@@ -729,8 +786,7 @@ class ZSelectComponent {
|
|
|
729
786
|
}
|
|
730
787
|
}
|
|
731
788
|
onPopoverHideStart() {
|
|
732
|
-
this.
|
|
733
|
-
this.hasScrollShadow.set(false);
|
|
789
|
+
this.uiState.update(s => ({ ...s, isOpen: false, isFocused: false, hasScrollShadow: false }));
|
|
734
790
|
this._cleanupVirtualScrollListener();
|
|
735
791
|
if (this._dirty()) {
|
|
736
792
|
this._touched.set(true);
|
|
@@ -755,73 +811,11 @@ class ZSelectComponent {
|
|
|
755
811
|
checkScrollShadow() {
|
|
756
812
|
const container = this.optionsContainerRef()?.nativeElement;
|
|
757
813
|
if (!container) {
|
|
758
|
-
this.
|
|
814
|
+
this.uiState.update(s => ({ ...s, hasScrollShadow: false }));
|
|
759
815
|
return;
|
|
760
816
|
}
|
|
761
817
|
const isScrollable = container.scrollHeight > container.clientHeight;
|
|
762
|
-
this.
|
|
763
|
-
}
|
|
764
|
-
_setupLoadMoreObserver() {
|
|
765
|
-
this._cleanupLoadMoreObserver();
|
|
766
|
-
const sentinel = this.loadMoreSentinelRef()?.nativeElement;
|
|
767
|
-
const container = this.optionsContainerRef()?.nativeElement;
|
|
768
|
-
if (!sentinel || !container) {
|
|
769
|
-
return;
|
|
770
|
-
}
|
|
771
|
-
this._loadMoreObserver = new IntersectionObserver(entries => {
|
|
772
|
-
const entry = entries[0];
|
|
773
|
-
if (entry?.isIntersecting && !this.zLoadingMore()) {
|
|
774
|
-
const currentCount = this.filteredOptions().length;
|
|
775
|
-
this.zOnLoadMore.emit({
|
|
776
|
-
currentCount,
|
|
777
|
-
scrollTop: container.scrollTop,
|
|
778
|
-
});
|
|
779
|
-
}
|
|
780
|
-
}, {
|
|
781
|
-
root: container,
|
|
782
|
-
rootMargin: '100px',
|
|
783
|
-
threshold: 0,
|
|
784
|
-
});
|
|
785
|
-
this._loadMoreObserver.observe(sentinel);
|
|
786
|
-
}
|
|
787
|
-
_cleanupLoadMoreObserver() {
|
|
788
|
-
if (this._loadMoreObserver) {
|
|
789
|
-
this._loadMoreObserver.disconnect();
|
|
790
|
-
this._loadMoreObserver = null;
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
_setupVirtualScrollLoadMore() {
|
|
794
|
-
this._cleanupVirtualScrollListener();
|
|
795
|
-
const scrollElement = this.virtualScrollRef()?.nativeElement;
|
|
796
|
-
if (!scrollElement) {
|
|
797
|
-
return;
|
|
798
|
-
}
|
|
799
|
-
const handleScroll = () => {
|
|
800
|
-
if (this.zLoadingMore()) {
|
|
801
|
-
return;
|
|
802
|
-
}
|
|
803
|
-
const { scrollTop, scrollHeight, clientHeight } = scrollElement;
|
|
804
|
-
const scrollDistance = this.zScrollDistance();
|
|
805
|
-
const threshold = clientHeight * scrollDistance;
|
|
806
|
-
const distanceFromBottom = scrollHeight - scrollTop - clientHeight;
|
|
807
|
-
if (distanceFromBottom <= threshold) {
|
|
808
|
-
const currentCount = this.filteredOptions().length;
|
|
809
|
-
this.zOnLoadMore.emit({
|
|
810
|
-
currentCount,
|
|
811
|
-
scrollTop,
|
|
812
|
-
});
|
|
813
|
-
}
|
|
814
|
-
};
|
|
815
|
-
scrollElement.addEventListener('scroll', handleScroll);
|
|
816
|
-
this._virtualScrollListener = () => {
|
|
817
|
-
scrollElement.removeEventListener('scroll', handleScroll);
|
|
818
|
-
};
|
|
819
|
-
}
|
|
820
|
-
_cleanupVirtualScrollListener() {
|
|
821
|
-
if (this._virtualScrollListener) {
|
|
822
|
-
this._virtualScrollListener();
|
|
823
|
-
this._virtualScrollListener = null;
|
|
824
|
-
}
|
|
818
|
+
this.uiState.update(s => ({ ...s, hasScrollShadow: isScrollable }));
|
|
825
819
|
}
|
|
826
820
|
selectOption(option, closeFn) {
|
|
827
821
|
if (option.disabled) {
|
|
@@ -886,52 +880,13 @@ class ZSelectComponent {
|
|
|
886
880
|
this._dirty.set(true);
|
|
887
881
|
this._onChange([]);
|
|
888
882
|
}
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
}
|
|
894
|
-
if (!this.isMultipleMode()) {
|
|
895
|
-
this._value.set(null);
|
|
896
|
-
this._onChange(null);
|
|
897
|
-
}
|
|
898
|
-
this._touched.set(false);
|
|
899
|
-
this._dirty.set(false);
|
|
900
|
-
this.searchText.set('');
|
|
901
|
-
if (!this._ngControl?.control) {
|
|
902
|
-
return;
|
|
903
|
-
}
|
|
904
|
-
this._ngControl.control.markAsPristine();
|
|
905
|
-
this._ngControl.control.markAsUntouched();
|
|
906
|
-
}
|
|
907
|
-
focus() {
|
|
908
|
-
this.triggerRef()?.nativeElement.focus();
|
|
909
|
-
}
|
|
910
|
-
blur() {
|
|
911
|
-
this.triggerRef()?.nativeElement.blur();
|
|
912
|
-
}
|
|
913
|
-
markAsTouched() {
|
|
914
|
-
this._touched.set(true);
|
|
915
|
-
this._onTouched();
|
|
916
|
-
}
|
|
917
|
-
markAsUntouched() {
|
|
918
|
-
this._touched.set(false);
|
|
919
|
-
}
|
|
920
|
-
markAsDirty() {
|
|
921
|
-
this._dirty.set(true);
|
|
922
|
-
}
|
|
923
|
-
markAsPristine() {
|
|
924
|
-
this._dirty.set(false);
|
|
925
|
-
}
|
|
926
|
-
validate() {
|
|
927
|
-
this._touched.set(true);
|
|
928
|
-
this._dirty.set(true);
|
|
929
|
-
this._onTouched();
|
|
930
|
-
if (this._ngControl?.control) {
|
|
931
|
-
this._ngControl.control.markAsDirty();
|
|
932
|
-
this._ngControl.control.markAsTouched();
|
|
883
|
+
trackByValue = (_index, option) => {
|
|
884
|
+
const key = this.zKey();
|
|
885
|
+
if (key && key in option) {
|
|
886
|
+
return option[key];
|
|
933
887
|
}
|
|
934
|
-
|
|
888
|
+
return option.value;
|
|
889
|
+
};
|
|
935
890
|
_emitControl() {
|
|
936
891
|
this.zControl.emit({
|
|
937
892
|
validate: () => this.validate(),
|
|
@@ -943,21 +898,77 @@ class ZSelectComponent {
|
|
|
943
898
|
markAsDirty: () => this.markAsDirty(),
|
|
944
899
|
markAsPristine: () => this.markAsPristine(),
|
|
945
900
|
hasError: this.hasError,
|
|
946
|
-
isValidating: this.isValidating,
|
|
947
|
-
isOpen: this.
|
|
901
|
+
isValidating: computed(() => this.uiState().isValidating),
|
|
902
|
+
isOpen: computed(() => this.uiState().isOpen),
|
|
948
903
|
value: this._value.asReadonly(),
|
|
949
904
|
selectedOption: this.selectedOption,
|
|
950
905
|
selectedOptions: this.selectedOptions,
|
|
951
906
|
errorMessage: this.errorMessage,
|
|
907
|
+
state: this.state,
|
|
952
908
|
});
|
|
953
909
|
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
910
|
+
_setupLoadMoreObserver() {
|
|
911
|
+
this._cleanupLoadMoreObserver();
|
|
912
|
+
const sentinel = this.loadMoreSentinelRef()?.nativeElement;
|
|
913
|
+
const container = this.optionsContainerRef()?.nativeElement;
|
|
914
|
+
if (!sentinel || !container) {
|
|
915
|
+
return;
|
|
958
916
|
}
|
|
959
|
-
|
|
960
|
-
|
|
917
|
+
this._loadMoreObserver = new IntersectionObserver(entries => {
|
|
918
|
+
const entry = entries[0];
|
|
919
|
+
if (entry?.isIntersecting && !this.zLoadingMore()) {
|
|
920
|
+
const currentCount = this.filteredOptions().length;
|
|
921
|
+
this.zOnLoadMore.emit({
|
|
922
|
+
currentCount,
|
|
923
|
+
scrollTop: container.scrollTop,
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
}, {
|
|
927
|
+
root: container,
|
|
928
|
+
rootMargin: '100px',
|
|
929
|
+
threshold: 0,
|
|
930
|
+
});
|
|
931
|
+
this._loadMoreObserver.observe(sentinel);
|
|
932
|
+
}
|
|
933
|
+
_cleanupLoadMoreObserver() {
|
|
934
|
+
if (this._loadMoreObserver) {
|
|
935
|
+
this._loadMoreObserver.disconnect();
|
|
936
|
+
this._loadMoreObserver = null;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
_setupVirtualScrollLoadMore() {
|
|
940
|
+
this._cleanupVirtualScrollListener();
|
|
941
|
+
const scrollElement = this.virtualScrollRef()?.nativeElement;
|
|
942
|
+
if (!scrollElement) {
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
945
|
+
const handleScroll = () => {
|
|
946
|
+
if (this.zLoadingMore()) {
|
|
947
|
+
return;
|
|
948
|
+
}
|
|
949
|
+
const { scrollTop, scrollHeight, clientHeight } = scrollElement;
|
|
950
|
+
const scrollDistance = this.zScrollDistance();
|
|
951
|
+
const threshold = clientHeight * scrollDistance;
|
|
952
|
+
const distanceFromBottom = scrollHeight - scrollTop - clientHeight;
|
|
953
|
+
if (distanceFromBottom <= threshold) {
|
|
954
|
+
const currentCount = this.filteredOptions().length;
|
|
955
|
+
this.zOnLoadMore.emit({
|
|
956
|
+
currentCount,
|
|
957
|
+
scrollTop,
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
scrollElement.addEventListener('scroll', handleScroll);
|
|
962
|
+
this._virtualScrollListener = () => {
|
|
963
|
+
scrollElement.removeEventListener('scroll', handleScroll);
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
_cleanupVirtualScrollListener() {
|
|
967
|
+
if (this._virtualScrollListener) {
|
|
968
|
+
this._virtualScrollListener();
|
|
969
|
+
this._virtualScrollListener = null;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
961
972
|
_getValidationErrors() {
|
|
962
973
|
const validators = this.zValidators();
|
|
963
974
|
const errors = [];
|
|
@@ -983,13 +994,13 @@ class ZSelectComponent {
|
|
|
983
994
|
}
|
|
984
995
|
if (value === null || value === undefined) {
|
|
985
996
|
this._asyncErrors.set(new Map());
|
|
986
|
-
this.
|
|
997
|
+
this.uiState.update(s => ({ ...s, isValidating: false }));
|
|
987
998
|
return;
|
|
988
999
|
}
|
|
989
1000
|
this._cancelAsyncValidation();
|
|
990
1001
|
this._asyncValidationAbortController = new AbortController();
|
|
991
1002
|
const { signal } = this._asyncValidationAbortController;
|
|
992
|
-
this.
|
|
1003
|
+
this.uiState.update(s => ({ ...s, isValidating: true }));
|
|
993
1004
|
const errors = new Map();
|
|
994
1005
|
try {
|
|
995
1006
|
const validationPromises = asyncValidators.map(async (validator) => {
|
|
@@ -1041,7 +1052,7 @@ class ZSelectComponent {
|
|
|
1041
1052
|
}
|
|
1042
1053
|
finally {
|
|
1043
1054
|
if (!signal.aborted) {
|
|
1044
|
-
this.
|
|
1055
|
+
this.uiState.update(s => ({ ...s, isValidating: false }));
|
|
1045
1056
|
}
|
|
1046
1057
|
}
|
|
1047
1058
|
}
|
|
@@ -1064,7 +1075,7 @@ class ZSelectComponent {
|
|
|
1064
1075
|
useExisting: forwardRef(() => ZSelectComponent),
|
|
1065
1076
|
multi: true,
|
|
1066
1077
|
},
|
|
1067
|
-
], 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\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=\"bottom\"\n zClass=\"border-0 shadow-none bg-transparent 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]=\"isOpen()\"\n (mousedown)=\"onTriggerMousedown()\"\n (keydown)=\"onTriggerKeydown($event)\"\n tabindex=\"0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-controls]=\"dropdownId\">\n @if (zPrefix()) {\n <z-icon [zType]=\"zPrefix() || 'lucideChevronDown'\" zSize=\"16\" 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-[3px] 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 class=\"z-select-remaining text-muted-foreground bg-muted rounded 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 *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=\"14\" 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=\"14\" />\n </button>\n }\n\n @if (isValidating()) {\n <z-icon zType=\"lucideLoader2\" zSize=\"14\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n <z-icon\n zType=\"lucideChevronDown\"\n zSize=\"16\"\n class=\"text-muted-foreground shrink-0 transition-transform duration-200\"\n [class.rotate-180]=\"isOpen()\" />\n </div>\n\n @if (showError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 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-[6px] border shadow-lg\"\n [style.width.px]=\"dropdownWidth()\">\n @if (zShowSearch()) {\n <div class=\"border-border flex items-center border-b px-3\">\n <z-icon zType=\"lucideSearch\" zSize=\"16\" 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 flex-col items-center justify-center py-8\">\n <z-loading [zLoading]=\"true\" zSize=\"default\" />\n </div>\n } @else {\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=\"14\" 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=\"14\" 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\n @if (filteredOptions().length === 0) {\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 }\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() && 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 zSize=\"xs\" zType=\"ghost-info\" class=\"min-w-0 flex-1\" (click)=\"selectAll()\" [zWave]=\"false\">\n <z-icon zType=\"lucideCheckCheck\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ effectiveSelectAllText() }}</span>\n </z-button>\n <z-button zSize=\"xs\" zType=\"ghost-error\" class=\"min-w-0 flex-1\" (click)=\"removeAll()\" [zWave]=\"false\">\n <z-icon zType=\"lucideX\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ effectiveClearAllText() }}</span>\n </z-button>\n }\n </div>\n }\n </div>\n</ng-template>\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(4px)}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{animation:z-select-dropdown-enter .15s ease-out;contain:layout style;will-change:transform,opacity}.z-select-dropdown input{text-overflow:ellipsis;overflow:hidden}@keyframes z-select-dropdown-enter{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.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(-4px)}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"], 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 });
|
|
1078
|
+
], 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\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=\"bottom\"\n zClass=\"border-0 shadow-none bg-transparent 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=\"16\" 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-[3px] 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 class=\"z-select-remaining text-muted-foreground bg-muted rounded 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 *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=\"14\" 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=\"14\" />\n </button>\n }\n\n @if (uiState().isValidating) {\n <z-icon zType=\"lucideLoader2\" zSize=\"14\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n <z-icon\n zType=\"lucideChevronDown\"\n zSize=\"16\"\n class=\"text-muted-foreground shrink-0 transition-transform duration-200\"\n [class.rotate-180]=\"uiState().isOpen\" />\n </div>\n\n @if (showError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 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-[6px] border shadow-lg\"\n [style.width.px]=\"dropdownWidth()\">\n @if (zShowSearch()) {\n <div class=\"border-border flex items-center border-b px-3\">\n <z-icon zType=\"lucideSearch\" zSize=\"16\" 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 flex-col items-center justify-center py-8\">\n <z-loading [zLoading]=\"true\" zSize=\"default\" />\n </div>\n } @else {\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=\"14\" 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=\"14\" 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\n @if (filteredOptions().length === 0) {\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 }\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() && 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 zSize=\"xs\" zType=\"ghost-info\" class=\"min-w-0 flex-1\" (click)=\"selectAll()\" [zWave]=\"false\">\n <z-icon zType=\"lucideCheckCheck\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ effectiveSelectAllText() }}</span>\n </z-button>\n <z-button zSize=\"xs\" zType=\"ghost-error\" class=\"min-w-0 flex-1\" (click)=\"removeAll()\" [zWave]=\"false\">\n <z-icon zType=\"lucideX\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ effectiveClearAllText() }}</span>\n </z-button>\n }\n </div>\n }\n </div>\n</ng-template>\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(4px)}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{animation:z-select-dropdown-enter .15s ease-out;contain:layout style;will-change:transform,opacity}.z-select-dropdown input{text-overflow:ellipsis;overflow:hidden}@keyframes z-select-dropdown-enter{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.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(-4px)}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"], 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 });
|
|
1068
1079
|
}
|
|
1069
1080
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ZSelectComponent, decorators: [{
|
|
1070
1081
|
type: Component,
|
|
@@ -1089,8 +1100,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1089
1100
|
useExisting: forwardRef(() => ZSelectComponent),
|
|
1090
1101
|
multi: true,
|
|
1091
1102
|
},
|
|
1092
|
-
], 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\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=\"bottom\"\n zClass=\"border-0 shadow-none bg-transparent 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]=\"isOpen()\"\n (mousedown)=\"onTriggerMousedown()\"\n (keydown)=\"onTriggerKeydown($event)\"\n tabindex=\"0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-controls]=\"dropdownId\">\n @if (zPrefix()) {\n <z-icon [zType]=\"zPrefix() || 'lucideChevronDown'\" zSize=\"16\" 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-[3px] 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 class=\"z-select-remaining text-muted-foreground bg-muted rounded 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 *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=\"14\" 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=\"14\" />\n </button>\n }\n\n @if (isValidating()) {\n <z-icon zType=\"lucideLoader2\" zSize=\"14\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n <z-icon\n zType=\"lucideChevronDown\"\n zSize=\"16\"\n class=\"text-muted-foreground shrink-0 transition-transform duration-200\"\n [class.rotate-180]=\"isOpen()\" />\n </div>\n\n @if (showError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 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-[6px] border shadow-lg\"\n [style.width.px]=\"dropdownWidth()\">\n @if (zShowSearch()) {\n <div class=\"border-border flex items-center border-b px-3\">\n <z-icon zType=\"lucideSearch\" zSize=\"16\" 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 flex-col items-center justify-center py-8\">\n <z-loading [zLoading]=\"true\" zSize=\"default\" />\n </div>\n } @else {\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=\"14\" 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=\"14\" 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\n @if (filteredOptions().length === 0) {\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 }\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() && 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 zSize=\"xs\" zType=\"ghost-info\" class=\"min-w-0 flex-1\" (click)=\"selectAll()\" [zWave]=\"false\">\n <z-icon zType=\"lucideCheckCheck\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ effectiveSelectAllText() }}</span>\n </z-button>\n <z-button zSize=\"xs\" zType=\"ghost-error\" class=\"min-w-0 flex-1\" (click)=\"removeAll()\" [zWave]=\"false\">\n <z-icon zType=\"lucideX\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ effectiveClearAllText() }}</span>\n </z-button>\n }\n </div>\n }\n </div>\n</ng-template>\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(4px)}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{animation:z-select-dropdown-enter .15s ease-out;contain:layout style;will-change:transform,opacity}.z-select-dropdown input{text-overflow:ellipsis;overflow:hidden}@keyframes z-select-dropdown-enter{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.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(-4px)}to{opacity:1;transform:translateY(0)}}\n"] }]
|
|
1093
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
1103
|
+
], 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\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=\"bottom\"\n zClass=\"border-0 shadow-none bg-transparent 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=\"16\" 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-[3px] 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 class=\"z-select-remaining text-muted-foreground bg-muted rounded 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 *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=\"14\" 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=\"14\" />\n </button>\n }\n\n @if (uiState().isValidating) {\n <z-icon zType=\"lucideLoader2\" zSize=\"14\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n <z-icon\n zType=\"lucideChevronDown\"\n zSize=\"16\"\n class=\"text-muted-foreground shrink-0 transition-transform duration-200\"\n [class.rotate-180]=\"uiState().isOpen\" />\n </div>\n\n @if (showError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 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-[6px] border shadow-lg\"\n [style.width.px]=\"dropdownWidth()\">\n @if (zShowSearch()) {\n <div class=\"border-border flex items-center border-b px-3\">\n <z-icon zType=\"lucideSearch\" zSize=\"16\" 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 flex-col items-center justify-center py-8\">\n <z-loading [zLoading]=\"true\" zSize=\"default\" />\n </div>\n } @else {\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=\"14\" 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=\"14\" 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\n @if (filteredOptions().length === 0) {\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 }\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() && 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 zSize=\"xs\" zType=\"ghost-info\" class=\"min-w-0 flex-1\" (click)=\"selectAll()\" [zWave]=\"false\">\n <z-icon zType=\"lucideCheckCheck\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ effectiveSelectAllText() }}</span>\n </z-button>\n <z-button zSize=\"xs\" zType=\"ghost-error\" class=\"min-w-0 flex-1\" (click)=\"removeAll()\" [zWave]=\"false\">\n <z-icon zType=\"lucideX\" zSize=\"14\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ effectiveClearAllText() }}</span>\n </z-button>\n }\n </div>\n }\n </div>\n</ng-template>\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(4px)}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{animation:z-select-dropdown-enter .15s ease-out;contain:layout style;will-change:transform,opacity}.z-select-dropdown input{text-overflow:ellipsis;overflow:hidden}@keyframes z-select-dropdown-enter{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.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(-4px)}to{opacity:1;transform:translateY(0)}}\n"] }]
|
|
1104
|
+
}], 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"] }], zControl: [{ type: i0.Output, args: ["zControl"] }], 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 }] }], 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 }] }] } });
|
|
1094
1105
|
|
|
1095
1106
|
/**
|
|
1096
1107
|
* Generated bundle index. Do not edit.
|