@shival99/z-ui 2.1.32 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/shival99-z-ui-components-z-accordion.mjs +41 -25
- package/fesm2022/shival99-z-ui-components-z-accordion.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs +176 -97
- package/fesm2022/shival99-z-ui-components-z-autocomplete.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-avatar.mjs +71 -40
- package/fesm2022/shival99-z-ui-components-z-avatar.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-breadcrumb.mjs +26 -15
- package/fesm2022/shival99-z-ui-components-z-breadcrumb.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-button-group.mjs +33 -21
- package/fesm2022/shival99-z-ui-components-z-button-group.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-button.mjs +32 -19
- package/fesm2022/shival99-z-ui-components-z-button.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs +289 -172
- package/fesm2022/shival99-z-ui-components-z-calendar.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-card.mjs +34 -24
- package/fesm2022/shival99-z-ui-components-z-card.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-chat.mjs +85 -47
- package/fesm2022/shival99-z-ui-components-z-chat.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-checkbox.mjs +56 -31
- package/fesm2022/shival99-z-ui-components-z-checkbox.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-code.mjs +29 -16
- package/fesm2022/shival99-z-ui-components-z-code.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-command.mjs +34 -19
- package/fesm2022/shival99-z-ui-components-z-command.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs +310 -88
- package/fesm2022/shival99-z-ui-components-z-drawer.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs +32 -18
- package/fesm2022/shival99-z-ui-components-z-dropdown-menu.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-editor.mjs +118 -62
- package/fesm2022/shival99-z-ui-components-z-editor.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-empty.mjs +31 -17
- package/fesm2022/shival99-z-ui-components-z-empty.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-filter.mjs +81 -54
- package/fesm2022/shival99-z-ui-components-z-filter.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs +240 -132
- package/fesm2022/shival99-z-ui-components-z-gallery.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-icon.mjs +39 -21
- package/fesm2022/shival99-z-ui-components-z-icon.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-input.mjs +173 -95
- package/fesm2022/shival99-z-ui-components-z-input.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-kanban.mjs +88 -47
- package/fesm2022/shival99-z-ui-components-z-kanban.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-loading.mjs +31 -19
- package/fesm2022/shival99-z-ui-components-z-loading.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-marquee.mjs +42 -23
- package/fesm2022/shival99-z-ui-components-z-marquee.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-media-player.mjs +87 -45
- package/fesm2022/shival99-z-ui-components-z-media-player.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-menu.mjs +126 -67
- package/fesm2022/shival99-z-ui-components-z-menu.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-metric-card.mjs +42 -23
- package/fesm2022/shival99-z-ui-components-z-metric-card.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-modal.mjs +144 -80
- package/fesm2022/shival99-z-ui-components-z-modal.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs +45 -24
- package/fesm2022/shival99-z-ui-components-z-pagination.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-popover.mjs +90 -57
- package/fesm2022/shival99-z-ui-components-z-popover.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-qrcode.mjs +51 -29
- package/fesm2022/shival99-z-ui-components-z-qrcode.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-radio.mjs +36 -20
- package/fesm2022/shival99-z-ui-components-z-radio.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-scrollarea.mjs +27 -15
- package/fesm2022/shival99-z-ui-components-z-scrollarea.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-select.mjs +239 -138
- package/fesm2022/shival99-z-ui-components-z-select.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-show-more.mjs +38 -21
- package/fesm2022/shival99-z-ui-components-z-show-more.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-skeleton-auto.mjs +42 -23
- package/fesm2022/shival99-z-ui-components-z-skeleton-auto.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-skeleton.mjs +35 -19
- package/fesm2022/shival99-z-ui-components-z-skeleton.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-steps.mjs +55 -31
- package/fesm2022/shival99-z-ui-components-z-steps.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-switch.mjs +60 -33
- package/fesm2022/shival99-z-ui-components-z-switch.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-table.mjs +10875 -0
- package/fesm2022/shival99-z-ui-components-z-table.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs +534 -0
- package/fesm2022/shival99-z-ui-components-z-tabs.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-tags.mjs +72 -46
- package/fesm2022/shival99-z-ui-components-z-tags.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs +254 -0
- package/fesm2022/shival99-z-ui-components-z-timeline.mjs.map +1 -0
- package/fesm2022/shival99-z-ui-components-z-toast.mjs +53 -31
- package/fesm2022/shival99-z-ui-components-z-toast.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-tooltip.mjs +133 -56
- package/fesm2022/shival99-z-ui-components-z-tooltip.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-components-z-upload.mjs +63 -36
- package/fesm2022/shival99-z-ui-components-z-upload.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-i18n.mjs +2 -0
- package/fesm2022/shival99-z-ui-i18n.mjs.map +1 -1
- package/fesm2022/shival99-z-ui-pipes.mjs +18 -18
- package/fesm2022/shival99-z-ui-services.mjs +35 -31
- package/fesm2022/shival99-z-ui-services.mjs.map +1 -1
- package/package.json +16 -16
- package/types/shival99-z-ui-components-z-autocomplete.d.ts +2 -2
- package/types/shival99-z-ui-components-z-card.d.ts +1 -2
- package/types/shival99-z-ui-components-z-drawer.d.ts +20 -2
- package/types/shival99-z-ui-components-z-gallery.d.ts +1 -2
- package/types/shival99-z-ui-components-z-select.d.ts +2 -2
- package/types/shival99-z-ui-components-z-table.d.ts +2293 -0
- package/types/shival99-z-ui-components-z-tabs.d.ts +92 -0
- package/types/shival99-z-ui-components-z-timeline.d.ts +71 -0
|
@@ -3,7 +3,6 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
import { inject, TemplateRef, Directive, Injector, DestroyRef, viewChild, viewChildren, contentChild, input, output, signal, effect, computed, untracked, forwardRef, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { NgControl, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
|
-
import { injectVirtualizer } from '@shival99/angular-virtual';
|
|
7
6
|
import { ZEmptyComponent } from '@shival99/z-ui/components/z-empty';
|
|
8
7
|
import { ZIconComponent } from '@shival99/z-ui/components/z-icon';
|
|
9
8
|
import { ZLoadingComponent } from '@shival99/z-ui/components/z-loading';
|
|
@@ -11,15 +10,16 @@ import { ZPopoverDirective } from '@shival99/z-ui/components/z-popover';
|
|
|
11
10
|
import { ZTooltipDirective } from '@shival99/z-ui/components/z-tooltip';
|
|
12
11
|
import { ZHighlightPipe, ZSafeHtmlPipe } from '@shival99/z-ui/pipes';
|
|
13
12
|
import { zTransform, zUuid, zResolveAsyncSelectedOptions, zMergeAsyncOptions, zRemoveVietnamese, zMergeClasses, zCreateEvent, Z_ASYNC_OPTIONS_DEFAULT_PAGE_SIZE, zToAsyncOptionsObservable, zResolveAsyncOptionsHasMore } from '@shival99/z-ui/utils';
|
|
13
|
+
import { injectVirtualizer } from '@tanstack/angular-virtual';
|
|
14
14
|
import { Subject, debounceTime, distinctUntilChanged, finalize } from 'rxjs';
|
|
15
15
|
import { cva } from 'class-variance-authority';
|
|
16
16
|
|
|
17
17
|
class ZAutocompleteOptionDirective {
|
|
18
18
|
templateRef = inject((TemplateRef));
|
|
19
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
20
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZAutocompleteOptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
20
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.2", type: ZAutocompleteOptionDirective, isStandalone: true, selector: "[z-autocomplete-option], [zAutocompleteOption]", ngImport: i0 });
|
|
21
21
|
}
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZAutocompleteOptionDirective, decorators: [{
|
|
23
23
|
type: Directive,
|
|
24
24
|
args: [{
|
|
25
25
|
selector: '[z-autocomplete-option], [zAutocompleteOption]',
|
|
@@ -92,49 +92,79 @@ class ZAutocompleteComponent {
|
|
|
92
92
|
_injector = inject(Injector);
|
|
93
93
|
_destroyRef = inject(DestroyRef);
|
|
94
94
|
_query$ = new Subject();
|
|
95
|
-
triggerRef = viewChild('triggerEl',
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
95
|
+
triggerRef = viewChild('triggerEl', /* @ts-ignore */
|
|
96
|
+
...(ngDevMode ? [{ debugName: "triggerRef" }] : /* istanbul ignore next */ []));
|
|
97
|
+
inputRef = viewChild('inputEl', /* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []));
|
|
99
|
+
dropdownTpl = viewChild('dropdownTpl', /* @ts-ignore */
|
|
100
|
+
...(ngDevMode ? [{ debugName: "dropdownTpl" }] : /* istanbul ignore next */ []));
|
|
101
|
+
virtualScrollRef = viewChild('virtualScrollElement', /* @ts-ignore */
|
|
102
|
+
...(ngDevMode ? [{ debugName: "virtualScrollRef" }] : /* istanbul ignore next */ []));
|
|
103
|
+
optionsContainerRef = viewChild('optionsContainer', /* @ts-ignore */
|
|
104
|
+
...(ngDevMode ? [{ debugName: "optionsContainerRef" }] : /* istanbul ignore next */ []));
|
|
105
|
+
loadMoreSentinelRef = viewChild('loadMoreSentinel', /* @ts-ignore */
|
|
106
|
+
...(ngDevMode ? [{ debugName: "loadMoreSentinelRef" }] : /* istanbul ignore next */ []));
|
|
107
|
+
virtualOptionElements = viewChildren('virtualOptionEl', /* @ts-ignore */
|
|
108
|
+
...(ngDevMode ? [{ debugName: "virtualOptionElements" }] : /* istanbul ignore next */ []));
|
|
109
|
+
customOptionDirective = contentChild((ZAutocompleteOptionDirective), /* @ts-ignore */
|
|
110
|
+
...(ngDevMode ? [{ debugName: "customOptionDirective" }] : /* istanbul ignore next */ []));
|
|
111
|
+
class = input('', /* @ts-ignore */
|
|
112
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
113
|
+
zOptions = input([], /* @ts-ignore */
|
|
114
|
+
...(ngDevMode ? [{ debugName: "zOptions" }] : /* istanbul ignore next */ []));
|
|
115
|
+
zConfig = input({}, /* @ts-ignore */
|
|
116
|
+
...(ngDevMode ? [{ debugName: "zConfig" }] : /* istanbul ignore next */ []));
|
|
117
|
+
zSize = input('default', /* @ts-ignore */
|
|
118
|
+
...(ngDevMode ? [{ debugName: "zSize" }] : /* istanbul ignore next */ []));
|
|
119
|
+
zType = input('default', /* @ts-ignore */
|
|
120
|
+
...(ngDevMode ? [{ debugName: "zType" }] : /* istanbul ignore next */ []));
|
|
121
|
+
zLabel = input('', /* @ts-ignore */
|
|
122
|
+
...(ngDevMode ? [{ debugName: "zLabel" }] : /* istanbul ignore next */ []));
|
|
123
|
+
zLabelClass = input('', /* @ts-ignore */
|
|
124
|
+
...(ngDevMode ? [{ debugName: "zLabelClass" }] : /* istanbul ignore next */ []));
|
|
125
|
+
zPlaceholder = input('', /* @ts-ignore */
|
|
126
|
+
...(ngDevMode ? [{ debugName: "zPlaceholder" }] : /* istanbul ignore next */ []));
|
|
127
|
+
zDisabled = input(false, { ...(ngDevMode ? { debugName: "zDisabled" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
128
|
+
zReadonly = input(false, { ...(ngDevMode ? { debugName: "zReadonly" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
129
|
+
zLoading = input(false, { ...(ngDevMode ? { debugName: "zLoading" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
130
|
+
zLoadingOutline = input(false, { ...(ngDevMode ? { debugName: "zLoadingOutline" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
131
|
+
zRequired = input(false, { ...(ngDevMode ? { debugName: "zRequired" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
132
|
+
zPrefix = input('', /* @ts-ignore */
|
|
133
|
+
...(ngDevMode ? [{ debugName: "zPrefix" }] : /* istanbul ignore next */ []));
|
|
134
|
+
zSuffix = input('', /* @ts-ignore */
|
|
135
|
+
...(ngDevMode ? [{ debugName: "zSuffix" }] : /* istanbul ignore next */ []));
|
|
136
|
+
zAllowClear = input(true, { ...(ngDevMode ? { debugName: "zAllowClear" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
137
|
+
zVirtualScroll = input(false, { ...(ngDevMode ? { debugName: "zVirtualScroll" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
138
|
+
zDynamicSize = input(true, { ...(ngDevMode ? { debugName: "zDynamicSize" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
139
|
+
zOptionHeight = input(36, /* @ts-ignore */
|
|
140
|
+
...(ngDevMode ? [{ debugName: "zOptionHeight" }] : /* istanbul ignore next */ []));
|
|
141
|
+
zDropdownMaxHeight = input(null, /* @ts-ignore */
|
|
142
|
+
...(ngDevMode ? [{ debugName: "zDropdownMaxHeight" }] : /* istanbul ignore next */ []));
|
|
123
143
|
/** @deprecated Dùng zDropdownMaxHeight để đồng nhất với z-select. */
|
|
124
|
-
zHeightExpand = input(null,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
144
|
+
zHeightExpand = input(null, /* @ts-ignore */
|
|
145
|
+
...(ngDevMode ? [{ debugName: "zHeightExpand" }] : /* istanbul ignore next */ []));
|
|
146
|
+
zMaxVisible = input(null, /* @ts-ignore */
|
|
147
|
+
...(ngDevMode ? [{ debugName: "zMaxVisible" }] : /* istanbul ignore next */ []));
|
|
148
|
+
zResetOnSelect = input(true, { ...(ngDevMode ? { debugName: "zResetOnSelect" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
149
|
+
zEmptyText = input('', /* @ts-ignore */
|
|
150
|
+
...(ngDevMode ? [{ debugName: "zEmptyText" }] : /* istanbul ignore next */ []));
|
|
151
|
+
zEmptyIcon = input('lucideSearchX', /* @ts-ignore */
|
|
152
|
+
...(ngDevMode ? [{ debugName: "zEmptyIcon" }] : /* istanbul ignore next */ []));
|
|
153
|
+
zNoDataText = input('', /* @ts-ignore */
|
|
154
|
+
...(ngDevMode ? [{ debugName: "zNoDataText" }] : /* istanbul ignore next */ []));
|
|
155
|
+
zNoDataIcon = input('lucidePackageOpen', /* @ts-ignore */
|
|
156
|
+
...(ngDevMode ? [{ debugName: "zNoDataIcon" }] : /* istanbul ignore next */ []));
|
|
157
|
+
zAllowCustomValue = input(false, { ...(ngDevMode ? { debugName: "zAllowCustomValue" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
158
|
+
zDebounceTime = input(200, /* @ts-ignore */
|
|
159
|
+
...(ngDevMode ? [{ debugName: "zDebounceTime" }] : /* istanbul ignore next */ []));
|
|
160
|
+
zLoadingMore = input(false, { ...(ngDevMode ? { debugName: "zLoadingMore" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
161
|
+
zEnableLoadMore = input(false, { ...(ngDevMode ? { debugName: "zEnableLoadMore" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
162
|
+
zScrollDistance = input(2, /* @ts-ignore */
|
|
163
|
+
...(ngDevMode ? [{ debugName: "zScrollDistance" }] : /* istanbul ignore next */ []));
|
|
164
|
+
zKey = input('', /* @ts-ignore */
|
|
165
|
+
...(ngDevMode ? [{ debugName: "zKey" }] : /* istanbul ignore next */ []));
|
|
166
|
+
zOptionTemplate = input(null, /* @ts-ignore */
|
|
167
|
+
...(ngDevMode ? [{ debugName: "zOptionTemplate" }] : /* istanbul ignore next */ []));
|
|
138
168
|
zOnSearch = output();
|
|
139
169
|
zOnLoadMore = output();
|
|
140
170
|
zOnSelect = output();
|
|
@@ -145,32 +175,51 @@ class ZAutocompleteComponent {
|
|
|
145
175
|
zOnFocus = output();
|
|
146
176
|
zControl = output();
|
|
147
177
|
zEvent = output();
|
|
148
|
-
_value = signal('',
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
178
|
+
_value = signal('', /* @ts-ignore */
|
|
179
|
+
...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
|
|
180
|
+
_disabled = signal(false, /* @ts-ignore */
|
|
181
|
+
...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
182
|
+
_formControl = signal(null, /* @ts-ignore */
|
|
183
|
+
...(ngDevMode ? [{ debugName: "_formControl" }] : /* istanbul ignore next */ []));
|
|
184
|
+
_popoverControl = signal(null, /* @ts-ignore */
|
|
185
|
+
...(ngDevMode ? [{ debugName: "_popoverControl" }] : /* istanbul ignore next */ []));
|
|
186
|
+
_selectedOption = signal(null, /* @ts-ignore */
|
|
187
|
+
...(ngDevMode ? [{ debugName: "_selectedOption" }] : /* istanbul ignore next */ []));
|
|
188
|
+
_asyncOptions = signal([], /* @ts-ignore */
|
|
189
|
+
...(ngDevMode ? [{ debugName: "_asyncOptions" }] : /* istanbul ignore next */ []));
|
|
190
|
+
_asyncKeyword = signal('', /* @ts-ignore */
|
|
191
|
+
...(ngDevMode ? [{ debugName: "_asyncKeyword" }] : /* istanbul ignore next */ []));
|
|
192
|
+
_asyncPage = signal(1, /* @ts-ignore */
|
|
193
|
+
...(ngDevMode ? [{ debugName: "_asyncPage" }] : /* istanbul ignore next */ []));
|
|
194
|
+
_asyncHasMore = signal(false, /* @ts-ignore */
|
|
195
|
+
...(ngDevMode ? [{ debugName: "_asyncHasMore" }] : /* istanbul ignore next */ []));
|
|
196
|
+
_asyncLoading = signal(false, /* @ts-ignore */
|
|
197
|
+
...(ngDevMode ? [{ debugName: "_asyncLoading" }] : /* istanbul ignore next */ []));
|
|
198
|
+
_asyncLoadingMore = signal(false, /* @ts-ignore */
|
|
199
|
+
...(ngDevMode ? [{ debugName: "_asyncLoadingMore" }] : /* istanbul ignore next */ []));
|
|
159
200
|
uiState = signal({
|
|
160
201
|
isOpen: false,
|
|
161
202
|
isFocused: false,
|
|
162
203
|
touched: false,
|
|
163
204
|
dirty: false,
|
|
164
|
-
},
|
|
165
|
-
|
|
205
|
+
}, /* @ts-ignore */
|
|
206
|
+
...(ngDevMode ? [{ debugName: "uiState" }] : /* istanbul ignore next */ []));
|
|
207
|
+
actualPosition = signal('bottom', /* @ts-ignore */
|
|
208
|
+
...(ngDevMode ? [{ debugName: "actualPosition" }] : /* istanbul ignore next */ []));
|
|
166
209
|
autocompleteId = zUuid('z-autocomplete');
|
|
167
210
|
dropdownId = `${this.autocompleteId}-dropdown`;
|
|
168
|
-
inputValue = signal('',
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
211
|
+
inputValue = signal('', /* @ts-ignore */
|
|
212
|
+
...(ngDevMode ? [{ debugName: "inputValue" }] : /* istanbul ignore next */ []));
|
|
213
|
+
debouncedQuery = signal('', /* @ts-ignore */
|
|
214
|
+
...(ngDevMode ? [{ debugName: "debouncedQuery" }] : /* istanbul ignore next */ []));
|
|
215
|
+
searchQuery = signal('', /* @ts-ignore */
|
|
216
|
+
...(ngDevMode ? [{ debugName: "searchQuery" }] : /* istanbul ignore next */ []));
|
|
217
|
+
activeIndex = signal(-1, /* @ts-ignore */
|
|
218
|
+
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
219
|
+
dropdownWidth = signal(0, /* @ts-ignore */
|
|
220
|
+
...(ngDevMode ? [{ debugName: "dropdownWidth" }] : /* istanbul ignore next */ []));
|
|
221
|
+
_pendingSearch = signal(false, /* @ts-ignore */
|
|
222
|
+
...(ngDevMode ? [{ debugName: "_pendingSearch" }] : /* istanbul ignore next */ []));
|
|
174
223
|
_localLoadingTimeout = null;
|
|
175
224
|
_loadMoreObserver = null;
|
|
176
225
|
_virtualScrollListener = null;
|
|
@@ -186,6 +235,7 @@ class ZAutocompleteComponent {
|
|
|
186
235
|
estimateSize: () => this.effectiveOptionHeight(),
|
|
187
236
|
measureElement: (element) => element.getBoundingClientRect().height,
|
|
188
237
|
overscan: 5,
|
|
238
|
+
useApplicationRefTick: false,
|
|
189
239
|
}));
|
|
190
240
|
_measureVirtualItems = effect(() => {
|
|
191
241
|
if (!this.zDynamicSize()) {
|
|
@@ -195,46 +245,66 @@ class ZAutocompleteComponent {
|
|
|
195
245
|
for (const el of elements) {
|
|
196
246
|
this.virtualizer.measureElement(el.nativeElement);
|
|
197
247
|
}
|
|
198
|
-
},
|
|
248
|
+
}, /* @ts-ignore */
|
|
249
|
+
...(ngDevMode ? [{ debugName: "_measureVirtualItems" }] : /* istanbul ignore next */ []));
|
|
199
250
|
config = computed(() => ({
|
|
200
251
|
...Z_AUTOCOMPLETE_DEFAULT_CONFIG,
|
|
201
252
|
...this.zConfig(),
|
|
202
|
-
}),
|
|
203
|
-
|
|
204
|
-
|
|
253
|
+
}), /* @ts-ignore */
|
|
254
|
+
...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
|
|
255
|
+
hasAsyncOptions = computed(() => !!this.config().async?.load, /* @ts-ignore */
|
|
256
|
+
...(ngDevMode ? [{ debugName: "hasAsyncOptions" }] : /* istanbul ignore next */ []));
|
|
257
|
+
asyncSelectedOptions = computed(() => zResolveAsyncSelectedOptions(this.config().async), /* @ts-ignore */
|
|
258
|
+
...(ngDevMode ? [{ debugName: "asyncSelectedOptions" }] : /* istanbul ignore next */ []));
|
|
205
259
|
sourceOptions = computed(() => {
|
|
206
260
|
if (!this.hasAsyncOptions()) {
|
|
207
261
|
return this.zOptions();
|
|
208
262
|
}
|
|
209
263
|
return zMergeAsyncOptions(this._asyncOptions(), this.asyncSelectedOptions(), this.config().async?.dedupeBy);
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
264
|
+
}, /* @ts-ignore */
|
|
265
|
+
...(ngDevMode ? [{ debugName: "sourceOptions" }] : /* istanbul ignore next */ []));
|
|
266
|
+
isLoading = computed(() => this.zLoading() || this._asyncLoading(), /* @ts-ignore */
|
|
267
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
268
|
+
isLoadingMore = computed(() => this.zLoadingMore() || this._asyncLoadingMore(), /* @ts-ignore */
|
|
269
|
+
...(ngDevMode ? [{ debugName: "isLoadingMore" }] : /* istanbul ignore next */ []));
|
|
270
|
+
canLoadMore = computed(() => this.hasAsyncOptions() ? this._asyncHasMore() : this.zEnableLoadMore(), /* @ts-ignore */
|
|
271
|
+
...(ngDevMode ? [{ debugName: "canLoadMore" }] : /* istanbul ignore next */ []));
|
|
272
|
+
isDisabled = computed(() => this._disabled() || this.zDisabled(), /* @ts-ignore */
|
|
273
|
+
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
274
|
+
isReadonly = computed(() => this.zReadonly(), /* @ts-ignore */
|
|
275
|
+
...(ngDevMode ? [{ debugName: "isReadonly" }] : /* istanbul ignore next */ []));
|
|
276
|
+
isInteractionDisabled = computed(() => this.isDisabled() || this.isReadonly() || this.zLoading(), /* @ts-ignore */
|
|
277
|
+
...(ngDevMode ? [{ debugName: "isInteractionDisabled" }] : /* istanbul ignore next */ []));
|
|
278
|
+
effectiveOptionHeight = computed(() => this.zOptionHeight() || this.config().optionHeight, /* @ts-ignore */
|
|
279
|
+
...(ngDevMode ? [{ debugName: "effectiveOptionHeight" }] : /* istanbul ignore next */ []));
|
|
280
|
+
effectiveHeightExpand = computed(() => this.zDropdownMaxHeight() ?? this.zHeightExpand() ?? this.config().dropdownMaxHeight, /* @ts-ignore */
|
|
281
|
+
...(ngDevMode ? [{ debugName: "effectiveHeightExpand" }] : /* istanbul ignore next */ []));
|
|
282
|
+
effectiveEmptyText = computed(() => this.zEmptyText() || this.config().emptyMessage, /* @ts-ignore */
|
|
283
|
+
...(ngDevMode ? [{ debugName: "effectiveEmptyText" }] : /* istanbul ignore next */ []));
|
|
284
|
+
effectiveNoDataText = computed(() => this.zNoDataText() || this.config().noDataMessage, /* @ts-ignore */
|
|
285
|
+
...(ngDevMode ? [{ debugName: "effectiveNoDataText" }] : /* istanbul ignore next */ []));
|
|
286
|
+
effectiveDebounceTime = computed(() => this.zConfig().debounceTime ?? this.zDebounceTime(), /* @ts-ignore */
|
|
287
|
+
...(ngDevMode ? [{ debugName: "effectiveDebounceTime" }] : /* istanbul ignore next */ []));
|
|
222
288
|
effectiveOptionTemplate = computed(() => {
|
|
223
289
|
const directive = this.customOptionDirective();
|
|
224
290
|
if (directive) {
|
|
225
291
|
return directive.templateRef;
|
|
226
292
|
}
|
|
227
293
|
return this.zOptionTemplate();
|
|
228
|
-
},
|
|
229
|
-
|
|
294
|
+
}, /* @ts-ignore */
|
|
295
|
+
...(ngDevMode ? [{ debugName: "effectiveOptionTemplate" }] : /* istanbul ignore next */ []));
|
|
296
|
+
hasCustomOptionTemplate = computed(() => this.effectiveOptionTemplate() !== null, /* @ts-ignore */
|
|
297
|
+
...(ngDevMode ? [{ debugName: "hasCustomOptionTemplate" }] : /* istanbul ignore next */ []));
|
|
230
298
|
selected = computed(() => {
|
|
231
299
|
const option = this._selectedOption();
|
|
232
300
|
if (!option) {
|
|
233
301
|
return [];
|
|
234
302
|
}
|
|
235
303
|
return [option];
|
|
236
|
-
},
|
|
237
|
-
|
|
304
|
+
}, /* @ts-ignore */
|
|
305
|
+
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
306
|
+
highlightQuery = computed(() => this.zType() === 'address_bar' ? this.searchQuery() : this.debouncedQuery(), /* @ts-ignore */
|
|
307
|
+
...(ngDevMode ? [{ debugName: "highlightQuery" }] : /* istanbul ignore next */ []));
|
|
238
308
|
/**
|
|
239
309
|
* Local-mode loading state after debounce to avoid quick flicker.
|
|
240
310
|
* Server mode relies only on zLoading from parent.
|
|
@@ -245,11 +315,13 @@ class ZAutocompleteComponent {
|
|
|
245
315
|
}
|
|
246
316
|
const hasInput = this.inputValue().trim() !== '';
|
|
247
317
|
return hasInput && this._pendingSearch();
|
|
248
|
-
},
|
|
318
|
+
}, /* @ts-ignore */
|
|
319
|
+
...(ngDevMode ? [{ debugName: "isLoadingState" }] : /* istanbul ignore next */ []));
|
|
249
320
|
isPositionTop = computed(() => {
|
|
250
321
|
const pos = this.actualPosition();
|
|
251
322
|
return pos.startsWith('top');
|
|
252
|
-
},
|
|
323
|
+
}, /* @ts-ignore */
|
|
324
|
+
...(ngDevMode ? [{ debugName: "isPositionTop" }] : /* istanbul ignore next */ []));
|
|
253
325
|
shouldUseVirtualScroll = computed(() => {
|
|
254
326
|
if (this.zVirtualScroll()) {
|
|
255
327
|
return true;
|
|
@@ -265,7 +337,8 @@ class ZAutocompleteComponent {
|
|
|
265
337
|
return true;
|
|
266
338
|
}
|
|
267
339
|
return this.sourceOptions().length > 50;
|
|
268
|
-
},
|
|
340
|
+
}, /* @ts-ignore */
|
|
341
|
+
...(ngDevMode ? [{ debugName: "shouldUseVirtualScroll" }] : /* istanbul ignore next */ []));
|
|
269
342
|
filteredOptions = computed(() => {
|
|
270
343
|
const options = this.sourceOptions();
|
|
271
344
|
const cfg = this.config();
|
|
@@ -301,16 +374,19 @@ class ZAutocompleteComponent {
|
|
|
301
374
|
return [{ label: query.trim(), value: query.trim() }];
|
|
302
375
|
}
|
|
303
376
|
return filtered;
|
|
304
|
-
},
|
|
377
|
+
}, /* @ts-ignore */
|
|
378
|
+
...(ngDevMode ? [{ debugName: "filteredOptions" }] : /* istanbul ignore next */ []));
|
|
305
379
|
optionViews = computed(() => this.filteredOptions().map((option, index) => ({
|
|
306
380
|
option,
|
|
307
381
|
index,
|
|
308
382
|
trackKey: `${String(this._getOptionKey(option))}::${index}`,
|
|
309
|
-
})),
|
|
383
|
+
})), /* @ts-ignore */
|
|
384
|
+
...(ngDevMode ? [{ debugName: "optionViews" }] : /* istanbul ignore next */ []));
|
|
310
385
|
hasValue = computed(() => {
|
|
311
386
|
const value = this.inputValue();
|
|
312
387
|
return value !== null && value !== undefined && value.trim() !== '';
|
|
313
|
-
},
|
|
388
|
+
}, /* @ts-ignore */
|
|
389
|
+
...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
314
390
|
currentStatus = computed(() => {
|
|
315
391
|
if (this.isDisabled()) {
|
|
316
392
|
return 'disabled';
|
|
@@ -322,11 +398,13 @@ class ZAutocompleteComponent {
|
|
|
322
398
|
return 'open';
|
|
323
399
|
}
|
|
324
400
|
return 'default';
|
|
325
|
-
},
|
|
401
|
+
}, /* @ts-ignore */
|
|
402
|
+
...(ngDevMode ? [{ debugName: "currentStatus" }] : /* istanbul ignore next */ []));
|
|
326
403
|
inputClasses = computed(() => zMergeClasses(zAutocompleteInputVariants({
|
|
327
404
|
zSize: this.zSize(),
|
|
328
405
|
zStatus: this.currentStatus(),
|
|
329
|
-
}), this.zLoading() && this.zLoadingOutline() ? 'z-loading-outline-active !ring-ring/50 !ring-[3px]' : '', this.class()),
|
|
406
|
+
}), this.zLoading() && this.zLoadingOutline() ? 'z-loading-outline-active !ring-ring/50 !ring-[3px]' : '', this.class()), /* @ts-ignore */
|
|
407
|
+
...(ngDevMode ? [{ debugName: "inputClasses" }] : /* istanbul ignore next */ []));
|
|
330
408
|
state = computed(() => ({
|
|
331
409
|
focused: this.uiState().isFocused,
|
|
332
410
|
touched: this.uiState().touched,
|
|
@@ -334,7 +412,8 @@ class ZAutocompleteComponent {
|
|
|
334
412
|
disabled: this.isDisabled(),
|
|
335
413
|
readonly: this.isReadonly(),
|
|
336
414
|
open: this.uiState().isOpen,
|
|
337
|
-
}),
|
|
415
|
+
}), /* @ts-ignore */
|
|
416
|
+
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
338
417
|
_onChange = () => void 0;
|
|
339
418
|
_onTouched = () => void 0;
|
|
340
419
|
_ngControl = null;
|
|
@@ -1042,8 +1121,8 @@ class ZAutocompleteComponent {
|
|
|
1042
1121
|
}
|
|
1043
1122
|
return option.value;
|
|
1044
1123
|
}
|
|
1045
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1046
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1124
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1125
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: ZAutocompleteComponent, isStandalone: true, selector: "z-autocomplete", inputs: { class: { classPropertyName: "class", publicName: "class", 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 }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zType: { classPropertyName: "zType", publicName: "zType", 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 }, 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 }, zLoadingOutline: { classPropertyName: "zLoadingOutline", publicName: "zLoadingOutline", isSignal: true, isRequired: false, transformFunction: null }, zRequired: { classPropertyName: "zRequired", publicName: "zRequired", isSignal: true, isRequired: false, transformFunction: null }, zPrefix: { classPropertyName: "zPrefix", publicName: "zPrefix", isSignal: true, isRequired: false, transformFunction: null }, zSuffix: { classPropertyName: "zSuffix", publicName: "zSuffix", isSignal: true, isRequired: false, transformFunction: null }, zAllowClear: { classPropertyName: "zAllowClear", publicName: "zAllowClear", isSignal: true, isRequired: false, transformFunction: null }, zVirtualScroll: { classPropertyName: "zVirtualScroll", publicName: "zVirtualScroll", isSignal: true, isRequired: false, transformFunction: null }, zDynamicSize: { classPropertyName: "zDynamicSize", publicName: "zDynamicSize", isSignal: true, isRequired: false, transformFunction: null }, zOptionHeight: { classPropertyName: "zOptionHeight", publicName: "zOptionHeight", isSignal: true, isRequired: false, transformFunction: null }, zDropdownMaxHeight: { classPropertyName: "zDropdownMaxHeight", publicName: "zDropdownMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, zHeightExpand: { classPropertyName: "zHeightExpand", publicName: "zHeightExpand", isSignal: true, isRequired: false, transformFunction: null }, zMaxVisible: { classPropertyName: "zMaxVisible", publicName: "zMaxVisible", isSignal: true, isRequired: false, transformFunction: null }, zResetOnSelect: { classPropertyName: "zResetOnSelect", publicName: "zResetOnSelect", 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 }, zNoDataText: { classPropertyName: "zNoDataText", publicName: "zNoDataText", isSignal: true, isRequired: false, transformFunction: null }, zNoDataIcon: { classPropertyName: "zNoDataIcon", publicName: "zNoDataIcon", isSignal: true, isRequired: false, transformFunction: null }, zAllowCustomValue: { classPropertyName: "zAllowCustomValue", publicName: "zAllowCustomValue", isSignal: true, isRequired: false, transformFunction: null }, zDebounceTime: { classPropertyName: "zDebounceTime", publicName: "zDebounceTime", 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 }, zKey: { classPropertyName: "zKey", publicName: "zKey", isSignal: true, isRequired: false, transformFunction: null }, zOptionTemplate: { classPropertyName: "zOptionTemplate", publicName: "zOptionTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zOnSearch: "zOnSearch", zOnLoadMore: "zOnLoadMore", zOnSelect: "zOnSelect", zOnEnter: "zOnEnter", zOnCommit: "zOnCommit", zValueChange: "zValueChange", zOnBlur: "zOnBlur", zOnFocus: "zOnFocus", zControl: "zControl", zEvent: "zEvent" }, providers: [
|
|
1047
1126
|
{
|
|
1048
1127
|
provide: NG_VALUE_ACCESSOR,
|
|
1049
1128
|
useExisting: forwardRef(() => ZAutocompleteComponent),
|
|
@@ -1051,7 +1130,7 @@ class ZAutocompleteComponent {
|
|
|
1051
1130
|
},
|
|
1052
1131
|
], queries: [{ propertyName: "customOptionDirective", first: true, predicate: (ZAutocompleteOptionDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerEl"], descendants: true, isSignal: true }, { propertyName: "inputRef", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }, { propertyName: "dropdownTpl", first: true, predicate: ["dropdownTpl"], descendants: true, isSignal: true }, { propertyName: "virtualScrollRef", first: true, predicate: ["virtualScrollElement"], descendants: true, isSignal: true }, { propertyName: "optionsContainerRef", first: true, predicate: ["optionsContainer"], descendants: true, isSignal: true }, { propertyName: "loadMoreSentinelRef", first: true, predicate: ["loadMoreSentinel"], descendants: true, isSignal: true }, { propertyName: "virtualOptionElements", predicate: ["virtualOptionEl"], descendants: true, isSignal: true }], exportAs: ["zAutocomplete"], ngImport: i0, template: "<div class=\"z-autocomplete-wrapper relative flex w-full flex-col gap-2\">\n @if (zLabel()) {\n <label [for]=\"autocompleteId\" 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 z-popover\n [zPopoverContent]=\"dropdownTpl\"\n [zOffset]=\"0\"\n [zDisabled]=\"isInteractionDisabled()\"\n zPopoverWidth=\"trigger\"\n zPopoverTrigger=\"manual\"\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 (zPositionChange)=\"onPositionChange($event)\"\n class=\"z-autocomplete-trigger\"\n [class]=\"inputClasses()\"\n z-tooltip\n [zContent]=\"inputValue()\"\n zTooltipTrigger=\"hover\"\n zTooltipPosition=\"top\"\n [zTooltipDisabled]=\"uiState().isFocused || uiState().isOpen || !hasValue()\"\n [zTriggerElement]=\"inputEl\"\n [class.z-autocomplete-open]=\"uiState().isOpen\"\n [class.z-autocomplete-open-top]=\"uiState().isOpen && isPositionTop()\"\n [class.z-autocomplete-open-bottom]=\"uiState().isOpen && !isPositionTop()\"\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() || 'lucideSearch'\" zSize=\"16\" class=\"text-muted-foreground shrink-0\" />\n }\n\n <input\n #inputEl\n [id]=\"autocompleteId\"\n type=\"text\"\n class=\"z-autocomplete-input placeholder:text-muted-foreground min-w-0 flex-1 overflow-hidden bg-transparent text-ellipsis whitespace-nowrap outline-none\"\n [class.text-sm]=\"zSize() === 'sm' || zSize() === 'default'\"\n [placeholder]=\"zPlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"isReadonly()\"\n [value]=\"inputValue()\"\n (mousedown)=\"isReadonly() && $event.preventDefault()\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (click)=\"onInputClick()\"\n (keydown)=\"onKeydown($event)\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\" />\n\n @if (isLoading() || isLoadingState() || isLoadingMore()) {\n <z-icon zType=\"lucideLoaderCircle\" zSize=\"16\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n } @else {\n @if (zAllowClear() && hasValue() && !isDisabled() && !isReadonly()) {\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:text-foreground flex shrink-0 cursor-pointer items-center justify-center transition-colors\"\n (mousedown)=\"clearInput($event)\"\n tabindex=\"-1\">\n <z-icon zType=\"lucideX\" zSize=\"18\" class=\"cursor-pointer!\" />\n </button>\n }\n\n @if (zSuffix()) {\n <z-icon [zType]=\"zSuffix() || 'lucideSearch'\" zSize=\"16\" class=\"text-muted-foreground shrink-0\" />\n }\n }\n </div>\n</div>\n\n<ng-template #dropdownTpl let-close=\"close\">\n <div\n [id]=\"dropdownId\"\n class=\"z-autocomplete-dropdown bg-popover border-ring overflow-hidden border shadow-[var(--z-popover-shadow)]\"\n [class.z-autocomplete-dropdown-bottom]=\"!isPositionTop()\"\n [class.rounded-b-sm]=\"!isPositionTop()\"\n [class.rounded-t-sm]=\"isPositionTop()\"\n [class.border-t-0]=\"!isPositionTop()\"\n [class.border-b-0]=\"isPositionTop()\"\n [style.width.px]=\"dropdownWidth()\"\n role=\"listbox\"\n (mousedown)=\"$event.preventDefault()\">\n @if (isLoading() || isLoadingState()) {\n <div\n class=\"z-autocomplete-content-state flex flex-col items-center justify-center\"\n [style.minHeight.px]=\"effectiveHeightExpand()\">\n <z-loading [zLoading]=\"true\" zSize=\"default\" />\n </div>\n } @else {\n @if (filteredOptions().length === 0) {\n <!-- Empty State -->\n <div\n class=\"z-autocomplete-content-state flex flex-col items-center justify-center p-1\"\n [style.minHeight.px]=\"effectiveHeightExpand()\">\n @if (inputValue().trim() !== '') {\n <!-- Searched but no results -->\n <z-empty [zIcon]=\"zEmptyIcon()\" zSize=\"sm\" [zMessage]=\"effectiveEmptyText()\" />\n } @else {\n <!-- No data initially -->\n <z-empty [zIcon]=\"zNoDataIcon()\" zSize=\"sm\" [zMessage]=\"effectiveNoDataText()\" />\n }\n </div>\n } @else if (shouldUseVirtualScroll()) {\n <!-- Virtual Scroll Mode -->\n <div\n #virtualScrollElement\n class=\"z-autocomplete-content-state z-autocomplete-options z-autocomplete-virtual-scroll relative overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.height.px]=\"effectiveHeightExpand()\">\n <div class=\"z-autocomplete-virtual-inner relative\" [style.height.px]=\"virtualizer.getTotalSize()\">\n @for (virtualItem of virtualizer.getVirtualItems(); track virtualItem.index) {\n @let opt = filteredOptions()[virtualItem.index];\n @let isActive = activeIndex() === virtualItem.index;\n <div\n #virtualOptionEl\n class=\"z-autocomplete-option absolute right-0 left-0 min-w-0\"\n [ngClass]=\"getOptionClasses(opt, virtualItem.index)\"\n [attr.data-index]=\"virtualItem.index\"\n [style.display]=\"hasCustomOptionTemplate() ? 'block' : null\"\n [style.height.px]=\"zDynamicSize() ? null : effectiveOptionHeight()\"\n [style.minHeight.px]=\"zDynamicSize() ? effectiveOptionHeight() : null\"\n [style.overflow]=\"hasCustomOptionTemplate() ? 'visible' : null\"\n [style.transform]=\"'translateY(' + virtualItem.start + 'px)'\"\n [attr.aria-selected]=\"isActive\"\n role=\"option\"\n (mouseenter)=\"activeIndex.set(virtualItem.index)\"\n (click)=\"selectOption(opt)\">\n @if (effectiveOptionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"effectiveOptionTemplate()!; context: { $implicit: opt, active: isActive }\" />\n } @else {\n @if (opt.icon) {\n <z-icon [zType]=\"opt.icon\" zSize=\"16\" class=\"shrink-0\" />\n }\n <div class=\"min-w-0 flex-1\">\n <span\n class=\"block min-w-0 truncate\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"5\"\n [zArrow]=\"false\"\n [zTriggerElement]=\"virtualOptionEl\"\n [innerHTML]=\"\n config().highlightMatch ? (opt.label | zHighlight: highlightQuery() | zSafeHtml) : opt.label\n \"></span>\n @if (opt.description) {\n <span class=\"text-muted-foreground block min-w-0 truncate text-xs\">{{ opt.description }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n } @else {\n <!-- Normal Scroll Mode -->\n <div\n #optionsContainer\n class=\"z-autocomplete-content-state z-autocomplete-options flex flex-col gap-0.75 overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.minHeight.px]=\"effectiveHeightExpand()\"\n [style.maxHeight.px]=\"effectiveHeightExpand()\">\n @for (item of optionViews(); track item.trackKey) {\n @let opt = item.option;\n @let i = item.index;\n @let isActive = activeIndex() === i;\n <div\n #optionEl2\n class=\"z-autocomplete-option relative min-w-0\"\n [ngClass]=\"getOptionClasses(opt, i)\"\n [style.display]=\"hasCustomOptionTemplate() ? 'block' : null\"\n [style.minHeight.px]=\"hasCustomOptionTemplate() ? null : effectiveOptionHeight()\"\n [style.overflow]=\"hasCustomOptionTemplate() ? 'visible' : null\"\n [attr.aria-selected]=\"isActive\"\n role=\"option\"\n (mouseenter)=\"activeIndex.set(i)\"\n (click)=\"selectOption(opt)\">\n @if (effectiveOptionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"effectiveOptionTemplate()!; context: { $implicit: opt, active: isActive }\" />\n } @else {\n @if (opt.icon) {\n <z-icon [zType]=\"opt.icon\" zSize=\"16\" class=\"shrink-0\" />\n }\n <div class=\"min-w-0 flex-1\">\n <span\n class=\"block min-w-0 truncate\"\n z-tooltip\n [zContent]=\"opt.label\"\n zPosition=\"top\"\n [zHideDelay]=\"0\"\n [zOffset]=\"5\"\n [zArrow]=\"false\"\n [zTriggerElement]=\"optionEl2\"\n [innerHTML]=\"\n config().highlightMatch ? (opt.label | zHighlight: highlightQuery() | zSafeHtml) : opt.label\n \"></span>\n @if (opt.description) {\n <span class=\"text-muted-foreground block min-w-0 truncate text-xs\">{{ opt.description }}</span>\n }\n </div>\n }\n </div>\n }\n @if (canLoadMore()) {\n <div #loadMoreSentinel class=\"h-px w-full shrink-0\"></div>\n }\n </div>\n }\n\n @if (isLoadingMore()) {\n <div class=\"z-autocomplete-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 </div>\n</ng-template>\n", styles: [".z-autocomplete-wrapper{width:100%}.z-autocomplete-trigger{-webkit-user-select:none;user-select:none}.z-autocomplete-trigger:focus-within{outline:none}.z-autocomplete-trigger *{cursor:inherit}.z-autocomplete-input{text-overflow:ellipsis;overflow:hidden}.z-autocomplete-input::placeholder{color:hsl(var(--muted-foreground))}.z-autocomplete-input:disabled{cursor:not-allowed}.z-autocomplete-open-bottom{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.z-autocomplete-open-top{border-top-left-radius:0!important;border-top-right-radius:0!important}.z-autocomplete-dropdown{animation:z-autocomplete-dropdown-from-top .15s ease-out}.z-autocomplete-dropdown-bottom{animation:z-autocomplete-dropdown-from-bottom .15s ease-out}@keyframes z-autocomplete-dropdown-from-top{0%{opacity:0;transform:translateY(-.5rem)}to{opacity:1;transform:translateY(0)}}@keyframes z-autocomplete-dropdown-from-bottom{0%{opacity:0;transform:translateY(.5rem)}to{opacity:1;transform:translateY(0)}}.z-autocomplete-separator{display:none}.z-autocomplete-options{overflow-x:hidden!important}.z-autocomplete-scrollbar{--scrollbar-padding: 0;--scrollbar-track-color: transparent;--scrollbar-thumb-color: hsl(var(--muted-foreground) / .3);--scrollbar-thumb-hover-color: hsl(var(--muted-foreground) / .5);--scrollbar-size: 6px}.z-autocomplete-virtual-scroll .z-autocomplete-virtual-inner{width:100%}.z-autocomplete-content-state{animation:z-autocomplete-content-fade-in .15s ease-out}@keyframes z-autocomplete-content-fade-in{0%{opacity:0}to{opacity:1}}.z-autocomplete-option mark{background:transparent;color:hsl(var(--primary));font-weight:600}.z-autocomplete-option{transition:background-color .1s ease,color .1s ease}.z-autocomplete-options:not(.z-autocomplete-virtual-scroll) .z-autocomplete-option{animation:z-autocomplete-option-enter .12s ease-out;animation-fill-mode:both}@keyframes z-autocomplete-option-enter{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { kind: "component", type: ZLoadingComponent, selector: "z-loading", inputs: ["class", "zSpinner", "zSize", "zColor", "zText", "zOverlay", "zOverlayType", "zFullscreen", "zLoading"] }, { kind: "directive", type: ZPopoverDirective, selector: "[z-popover]", inputs: ["zPopoverContent", "zPosition", "zTrigger", "zPopoverTrigger", "zClass", "zShowDelay", "zHideDelay", "zDisabled", "zOffset", "zPopoverWidth", "zTriggerRef", "zManualClose", "zOutsideClickClose", "zScrollClose", "zSticky", "zShowArrow", "zKeyboardSafe"], outputs: ["zShow", "zHide", "zHideStart", "zControl", "zPositionChange", "zOutsideClick"], exportAs: ["zPopover"] }, { kind: "directive", type: ZTooltipDirective, selector: "[z-tooltip], [zTooltip]", inputs: ["zContent", "zPosition", "zTooltipPosition", "zTrigger", "zTooltipTrigger", "zTooltipType", "zTooltipSize", "zClass", "zTooltipClass", "zShowDelay", "zTooltipShowDelay", "zHideDelay", "zTooltipHideDelay", "zArrow", "zTooltipArrow", "zDisabled", "zTooltipDisabled", "zOffset", "zTooltipOffset", "zAutoDetect", "zTriggerElement", "zAlwaysShow", "zMaxWidth"], outputs: ["zShow", "zHide"], exportAs: ["zTooltip"] }, { kind: "component", type: ZEmptyComponent, selector: "z-empty", inputs: ["class", "zType", "zIcon", "zIconSize", "zSize", "zMessage", "zDescription"] }, { kind: "pipe", type: ZHighlightPipe, name: "zHighlight" }, { kind: "pipe", type: ZSafeHtmlPipe, name: "zSafeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1053
1132
|
}
|
|
1054
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZAutocompleteComponent, decorators: [{
|
|
1055
1134
|
type: Component,
|
|
1056
1135
|
args: [{ selector: 'z-autocomplete', imports: [
|
|
1057
1136
|
FormsModule,
|