@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
|
@@ -4,7 +4,6 @@ import { inject, TemplateRef, Directive, Pipe, Injector, DestroyRef, viewChild,
|
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { NgControl, NgModel, PristineChangeEvent, TouchedChangeEvent, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
|
-
import { injectVirtualizer } from '@shival99/angular-virtual';
|
|
8
7
|
import { ZButtonComponent } from '@shival99/z-ui/components/z-button';
|
|
9
8
|
import { ZEmptyComponent } from '@shival99/z-ui/components/z-empty';
|
|
10
9
|
import { ZIconComponent } from '@shival99/z-ui/components/z-icon';
|
|
@@ -14,15 +13,16 @@ import { ZTooltipDirective } from '@shival99/z-ui/components/z-tooltip';
|
|
|
14
13
|
import { ZHighlightPipe, ZSafeHtmlPipe } from '@shival99/z-ui/pipes';
|
|
15
14
|
import { ZTranslateService } from '@shival99/z-ui/services';
|
|
16
15
|
import { zRemoveVietnamese, zMergeClasses, zTransform, zUuid, zResolveAsyncSelectedOptions, zMergeAsyncOptions, zCreateEvent, zIsMobileViewport, Z_ASYNC_OPTIONS_DEFAULT_PAGE_SIZE, zToAsyncOptionsObservable, zResolveAsyncOptionsHasMore } from '@shival99/z-ui/utils';
|
|
16
|
+
import { injectVirtualizer } from '@tanstack/angular-virtual';
|
|
17
17
|
import { Subject, debounceTime, merge, filter, finalize, isObservable, takeUntil, catchError, of, firstValueFrom } from 'rxjs';
|
|
18
18
|
import { cva } from 'class-variance-authority';
|
|
19
19
|
|
|
20
20
|
class ZSelectOptionDirective {
|
|
21
21
|
templateRef = inject((TemplateRef));
|
|
22
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
23
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
22
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZSelectOptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
23
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.2", type: ZSelectOptionDirective, isStandalone: true, selector: "[z-select-option], [zSelectOption]", ngImport: i0 });
|
|
24
24
|
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZSelectOptionDirective, decorators: [{
|
|
26
26
|
type: Directive,
|
|
27
27
|
args: [{
|
|
28
28
|
selector: '[z-select-option], [zSelectOption]',
|
|
@@ -32,10 +32,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
32
32
|
|
|
33
33
|
class ZSelectSelectedDirective {
|
|
34
34
|
templateRef = inject((TemplateRef));
|
|
35
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
36
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
35
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZSelectSelectedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
36
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.2", type: ZSelectSelectedDirective, isStandalone: true, selector: "[z-select-selected], [zSelectSelected]", ngImport: i0 });
|
|
37
37
|
}
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZSelectSelectedDirective, decorators: [{
|
|
39
39
|
type: Directive,
|
|
40
40
|
args: [{
|
|
41
41
|
selector: '[z-select-selected], [zSelectSelected]',
|
|
@@ -152,10 +152,10 @@ class ZIsSelectedPipe {
|
|
|
152
152
|
}
|
|
153
153
|
return zIsSelectValueEqual(value, option.value, zKey);
|
|
154
154
|
}
|
|
155
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
156
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
155
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZIsSelectedPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
156
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.2", ngImport: i0, type: ZIsSelectedPipe, isStandalone: true, name: "zIsSelected" });
|
|
157
157
|
}
|
|
158
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZIsSelectedPipe, decorators: [{
|
|
159
159
|
type: Pipe,
|
|
160
160
|
args: [{
|
|
161
161
|
name: 'zIsSelected',
|
|
@@ -232,10 +232,10 @@ class ZOptionClassesPipe {
|
|
|
232
232
|
disabled: isDisabled ?? false,
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
236
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
235
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZOptionClassesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
236
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.2", ngImport: i0, type: ZOptionClassesPipe, isStandalone: true, name: "zOptionClasses" });
|
|
237
237
|
}
|
|
238
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
238
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZOptionClassesPipe, decorators: [{
|
|
239
239
|
type: Pipe,
|
|
240
240
|
args: [{
|
|
241
241
|
name: 'zOptionClasses',
|
|
@@ -253,10 +253,10 @@ class ZTagClassesPipe {
|
|
|
253
253
|
}
|
|
254
254
|
return zMergeClasses(baseClasses, 'bg-muted text-foreground border-border');
|
|
255
255
|
}
|
|
256
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
257
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
256
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZTagClassesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
257
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.2", ngImport: i0, type: ZTagClassesPipe, isStandalone: true, name: "zTagClasses" });
|
|
258
258
|
}
|
|
259
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
259
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZTagClassesPipe, decorators: [{
|
|
260
260
|
type: Pipe,
|
|
261
261
|
args: [{
|
|
262
262
|
name: 'zTagClasses',
|
|
@@ -269,82 +269,134 @@ class ZSelectComponent {
|
|
|
269
269
|
_injector = inject(Injector);
|
|
270
270
|
_destroyRef = inject(DestroyRef);
|
|
271
271
|
_zTranslate = inject(ZTranslateService);
|
|
272
|
-
triggerRef = viewChild('triggerEl',
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
272
|
+
triggerRef = viewChild('triggerEl', /* @ts-ignore */
|
|
273
|
+
...(ngDevMode ? [{ debugName: "triggerRef" }] : /* istanbul ignore next */ []));
|
|
274
|
+
searchInputRef = viewChild('dropdownSearchInput', /* @ts-ignore */
|
|
275
|
+
...(ngDevMode ? [{ debugName: "searchInputRef" }] : /* istanbul ignore next */ []));
|
|
276
|
+
dropdownTpl = viewChild('dropdownTpl', /* @ts-ignore */
|
|
277
|
+
...(ngDevMode ? [{ debugName: "dropdownTpl" }] : /* istanbul ignore next */ []));
|
|
278
|
+
optionsContainerRef = viewChild('optionsContainer', /* @ts-ignore */
|
|
279
|
+
...(ngDevMode ? [{ debugName: "optionsContainerRef" }] : /* istanbul ignore next */ []));
|
|
280
|
+
virtualScrollRef = viewChild('virtualScrollElement', /* @ts-ignore */
|
|
281
|
+
...(ngDevMode ? [{ debugName: "virtualScrollRef" }] : /* istanbul ignore next */ []));
|
|
282
|
+
loadMoreSentinelRef = viewChild('loadMoreSentinel', /* @ts-ignore */
|
|
283
|
+
...(ngDevMode ? [{ debugName: "loadMoreSentinelRef" }] : /* istanbul ignore next */ []));
|
|
284
|
+
virtualOptionElements = viewChildren('virtualOptionEl', /* @ts-ignore */
|
|
285
|
+
...(ngDevMode ? [{ debugName: "virtualOptionElements" }] : /* istanbul ignore next */ []));
|
|
286
|
+
customSelectedDirective = contentChild((ZSelectSelectedDirective), /* @ts-ignore */
|
|
287
|
+
...(ngDevMode ? [{ debugName: "customSelectedDirective" }] : /* istanbul ignore next */ []));
|
|
288
|
+
customOptionDirective = contentChild((ZSelectOptionDirective), /* @ts-ignore */
|
|
289
|
+
...(ngDevMode ? [{ debugName: "customOptionDirective" }] : /* istanbul ignore next */ []));
|
|
281
290
|
zOnSearch = output();
|
|
282
291
|
zOnLoadMore = output();
|
|
283
292
|
zOnBlur = output();
|
|
284
293
|
zOnFocus = output();
|
|
285
294
|
zControl = output();
|
|
286
295
|
zEvent = output();
|
|
287
|
-
class = input('',
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
296
|
+
class = input('', /* @ts-ignore */
|
|
297
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
298
|
+
zClassSelect = input('', /* @ts-ignore */
|
|
299
|
+
...(ngDevMode ? [{ debugName: "zClassSelect" }] : /* istanbul ignore next */ []));
|
|
300
|
+
zMode = input('single', /* @ts-ignore */
|
|
301
|
+
...(ngDevMode ? [{ debugName: "zMode" }] : /* istanbul ignore next */ []));
|
|
302
|
+
zSize = input('default', /* @ts-ignore */
|
|
303
|
+
...(ngDevMode ? [{ debugName: "zSize" }] : /* istanbul ignore next */ []));
|
|
304
|
+
zLabel = input('', /* @ts-ignore */
|
|
305
|
+
...(ngDevMode ? [{ debugName: "zLabel" }] : /* istanbul ignore next */ []));
|
|
306
|
+
zLabelClass = input('', /* @ts-ignore */
|
|
307
|
+
...(ngDevMode ? [{ debugName: "zLabelClass" }] : /* istanbul ignore next */ []));
|
|
308
|
+
zPlaceholder = input('', /* @ts-ignore */
|
|
309
|
+
...(ngDevMode ? [{ debugName: "zPlaceholder" }] : /* istanbul ignore next */ []));
|
|
310
|
+
zRequired = input(false, { ...(ngDevMode ? { debugName: "zRequired" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
311
|
+
zDisabled = input(false, { ...(ngDevMode ? { debugName: "zDisabled" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
312
|
+
zReadonly = input(false, { ...(ngDevMode ? { debugName: "zReadonly" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
313
|
+
zLoading = input(false, { ...(ngDevMode ? { debugName: "zLoading" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
314
|
+
zLoadingOutline = input(false, { ...(ngDevMode ? { debugName: "zLoadingOutline" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
315
|
+
zPrefix = input('', /* @ts-ignore */
|
|
316
|
+
...(ngDevMode ? [{ debugName: "zPrefix" }] : /* istanbul ignore next */ []));
|
|
317
|
+
zAllowClear = input(false, { ...(ngDevMode ? { debugName: "zAllowClear" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
318
|
+
zShowCheck = input(true, { ...(ngDevMode ? { debugName: "zShowCheck" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
319
|
+
zWrap = input(true, { ...(ngDevMode ? { debugName: "zWrap" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
320
|
+
zShowSearch = input(true, { ...(ngDevMode ? { debugName: "zShowSearch" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
321
|
+
zPlaceholderSearch = input('', /* @ts-ignore */
|
|
322
|
+
...(ngDevMode ? [{ debugName: "zPlaceholderSearch" }] : /* istanbul ignore next */ []));
|
|
323
|
+
zDebounce = input(300, /* @ts-ignore */
|
|
324
|
+
...(ngDevMode ? [{ debugName: "zDebounce" }] : /* istanbul ignore next */ []));
|
|
325
|
+
zNotFoundText = input('', /* @ts-ignore */
|
|
326
|
+
...(ngDevMode ? [{ debugName: "zNotFoundText" }] : /* istanbul ignore next */ []));
|
|
327
|
+
zEmptyText = input('', /* @ts-ignore */
|
|
328
|
+
...(ngDevMode ? [{ debugName: "zEmptyText" }] : /* istanbul ignore next */ []));
|
|
329
|
+
zEmptyIcon = input('lucideInbox', /* @ts-ignore */
|
|
330
|
+
...(ngDevMode ? [{ debugName: "zEmptyIcon" }] : /* istanbul ignore next */ []));
|
|
331
|
+
zMaxTagCount = input(3, /* @ts-ignore */
|
|
332
|
+
...(ngDevMode ? [{ debugName: "zMaxTagCount" }] : /* istanbul ignore next */ []));
|
|
333
|
+
zDropdownMaxHeight = input(256, /* @ts-ignore */
|
|
334
|
+
...(ngDevMode ? [{ debugName: "zDropdownMaxHeight" }] : /* istanbul ignore next */ []));
|
|
335
|
+
zOptionHeight = input(32, /* @ts-ignore */
|
|
336
|
+
...(ngDevMode ? [{ debugName: "zOptionHeight" }] : /* istanbul ignore next */ []));
|
|
337
|
+
zVirtualScroll = input(false, { ...(ngDevMode ? { debugName: "zVirtualScroll" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
338
|
+
zDynamicSize = input(false, { ...(ngDevMode ? { debugName: "zDynamicSize" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
339
|
+
zShowAction = input(false, { ...(ngDevMode ? { debugName: "zShowAction" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
340
|
+
zOptions = input([], /* @ts-ignore */
|
|
341
|
+
...(ngDevMode ? [{ debugName: "zOptions" }] : /* istanbul ignore next */ []));
|
|
342
|
+
zConfig = input({}, /* @ts-ignore */
|
|
343
|
+
...(ngDevMode ? [{ debugName: "zConfig" }] : /* istanbul ignore next */ []));
|
|
344
|
+
zTranslateLabels = input(true, { ...(ngDevMode ? { debugName: "zTranslateLabels" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
345
|
+
zKey = input('', /* @ts-ignore */
|
|
346
|
+
...(ngDevMode ? [{ debugName: "zKey" }] : /* istanbul ignore next */ []));
|
|
347
|
+
zSearchServer = input(false, { ...(ngDevMode ? { debugName: "zSearchServer" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
348
|
+
zLoadingMore = input(false, { ...(ngDevMode ? { debugName: "zLoadingMore" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
349
|
+
zEnableLoadMore = input(false, { ...(ngDevMode ? { debugName: "zEnableLoadMore" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
350
|
+
zScrollDistance = input(2, /* @ts-ignore */
|
|
351
|
+
...(ngDevMode ? [{ debugName: "zScrollDistance" }] : /* istanbul ignore next */ []));
|
|
352
|
+
zMaxVisible = input(null, /* @ts-ignore */
|
|
353
|
+
...(ngDevMode ? [{ debugName: "zMaxVisible" }] : /* istanbul ignore next */ []));
|
|
354
|
+
zScrollClose = input(false, { ...(ngDevMode ? { debugName: "zScrollClose" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
355
|
+
zSticky = input(false, { ...(ngDevMode ? { debugName: "zSticky" } : /* istanbul ignore next */ {}), transform: zTransform });
|
|
356
|
+
zPosition = input('bottom', /* @ts-ignore */
|
|
357
|
+
...(ngDevMode ? [{ debugName: "zPosition" }] : /* istanbul ignore next */ []));
|
|
358
|
+
zSelectedTemplate = input(null, /* @ts-ignore */
|
|
359
|
+
...(ngDevMode ? [{ debugName: "zSelectedTemplate" }] : /* istanbul ignore next */ []));
|
|
360
|
+
zOptionTemplate = input(null, /* @ts-ignore */
|
|
361
|
+
...(ngDevMode ? [{ debugName: "zOptionTemplate" }] : /* istanbul ignore next */ []));
|
|
362
|
+
zActionTemplate = input(null, /* @ts-ignore */
|
|
363
|
+
...(ngDevMode ? [{ debugName: "zActionTemplate" }] : /* istanbul ignore next */ []));
|
|
364
|
+
zAsyncValidators = input([], /* @ts-ignore */
|
|
365
|
+
...(ngDevMode ? [{ debugName: "zAsyncValidators" }] : /* istanbul ignore next */ []));
|
|
366
|
+
zAsyncDebounce = input(300, /* @ts-ignore */
|
|
367
|
+
...(ngDevMode ? [{ debugName: "zAsyncDebounce" }] : /* istanbul ignore next */ []));
|
|
368
|
+
zAsyncValidateOn = input('change', /* @ts-ignore */
|
|
369
|
+
...(ngDevMode ? [{ debugName: "zAsyncValidateOn" }] : /* istanbul ignore next */ []));
|
|
370
|
+
zValidators = input([], /* @ts-ignore */
|
|
371
|
+
...(ngDevMode ? [{ debugName: "zValidators" }] : /* istanbul ignore next */ []));
|
|
372
|
+
_value = signal(null, /* @ts-ignore */
|
|
373
|
+
...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
|
|
374
|
+
_disabled = signal(false, /* @ts-ignore */
|
|
375
|
+
...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
376
|
+
_formControl = signal(null, /* @ts-ignore */
|
|
377
|
+
...(ngDevMode ? [{ debugName: "_formControl" }] : /* istanbul ignore next */ []));
|
|
378
|
+
_formStateVersion = signal(0, /* @ts-ignore */
|
|
379
|
+
...(ngDevMode ? [{ debugName: "_formStateVersion" }] : /* istanbul ignore next */ []));
|
|
380
|
+
_popoverControl = signal(null, /* @ts-ignore */
|
|
381
|
+
...(ngDevMode ? [{ debugName: "_popoverControl" }] : /* istanbul ignore next */ []));
|
|
382
|
+
_allKnownOptions = signal([], /* @ts-ignore */
|
|
383
|
+
...(ngDevMode ? [{ debugName: "_allKnownOptions" }] : /* istanbul ignore next */ []));
|
|
384
|
+
_asyncErrors = signal(new Map(), /* @ts-ignore */
|
|
385
|
+
...(ngDevMode ? [{ debugName: "_asyncErrors" }] : /* istanbul ignore next */ []));
|
|
386
|
+
_customError = signal(null, /* @ts-ignore */
|
|
387
|
+
...(ngDevMode ? [{ debugName: "_customError" }] : /* istanbul ignore next */ []));
|
|
388
|
+
_asyncOptions = signal([], /* @ts-ignore */
|
|
389
|
+
...(ngDevMode ? [{ debugName: "_asyncOptions" }] : /* istanbul ignore next */ []));
|
|
390
|
+
_asyncKeyword = signal('', /* @ts-ignore */
|
|
391
|
+
...(ngDevMode ? [{ debugName: "_asyncKeyword" }] : /* istanbul ignore next */ []));
|
|
392
|
+
_asyncPage = signal(1, /* @ts-ignore */
|
|
393
|
+
...(ngDevMode ? [{ debugName: "_asyncPage" }] : /* istanbul ignore next */ []));
|
|
394
|
+
_asyncHasMore = signal(false, /* @ts-ignore */
|
|
395
|
+
...(ngDevMode ? [{ debugName: "_asyncHasMore" }] : /* istanbul ignore next */ []));
|
|
396
|
+
_asyncLoading = signal(false, /* @ts-ignore */
|
|
397
|
+
...(ngDevMode ? [{ debugName: "_asyncLoading" }] : /* istanbul ignore next */ []));
|
|
398
|
+
_asyncLoadingMore = signal(false, /* @ts-ignore */
|
|
399
|
+
...(ngDevMode ? [{ debugName: "_asyncLoadingMore" }] : /* istanbul ignore next */ []));
|
|
348
400
|
uiState = signal({
|
|
349
401
|
isOpen: false,
|
|
350
402
|
hasScrollShadow: false,
|
|
@@ -352,23 +404,34 @@ class ZSelectComponent {
|
|
|
352
404
|
isValidating: false,
|
|
353
405
|
touched: false,
|
|
354
406
|
dirty: false,
|
|
355
|
-
},
|
|
407
|
+
}, /* @ts-ignore */
|
|
408
|
+
...(ngDevMode ? [{ debugName: "uiState" }] : /* istanbul ignore next */ []));
|
|
356
409
|
selectId = zUuid('z-select');
|
|
357
410
|
dropdownId = `${this.selectId}-dropdown`;
|
|
358
|
-
searchText = signal('',
|
|
359
|
-
|
|
411
|
+
searchText = signal('', /* @ts-ignore */
|
|
412
|
+
...(ngDevMode ? [{ debugName: "searchText" }] : /* istanbul ignore next */ []));
|
|
413
|
+
dropdownWidth = signal(0, /* @ts-ignore */
|
|
414
|
+
...(ngDevMode ? [{ debugName: "dropdownWidth" }] : /* istanbul ignore next */ []));
|
|
360
415
|
currentValue = this._value.asReadonly();
|
|
361
416
|
config = computed(() => ({
|
|
362
417
|
...Z_SELECT_DEFAULT_CONFIG,
|
|
363
418
|
...this.zConfig(),
|
|
364
|
-
}),
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
419
|
+
}), /* @ts-ignore */
|
|
420
|
+
...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
|
|
421
|
+
hasAsyncOptions = computed(() => !!this.config().async?.load, /* @ts-ignore */
|
|
422
|
+
...(ngDevMode ? [{ debugName: "hasAsyncOptions" }] : /* istanbul ignore next */ []));
|
|
423
|
+
sourceOptions = computed(() => (this.hasAsyncOptions() ? this._asyncOptions() : this.zOptions()), /* @ts-ignore */
|
|
424
|
+
...(ngDevMode ? [{ debugName: "sourceOptions" }] : /* istanbul ignore next */ []));
|
|
425
|
+
asyncSelectedOptions = computed(() => zResolveAsyncSelectedOptions(this.config().async), /* @ts-ignore */
|
|
426
|
+
...(ngDevMode ? [{ debugName: "asyncSelectedOptions" }] : /* istanbul ignore next */ []));
|
|
427
|
+
isLoading = computed(() => this.zLoading() || this._asyncLoading(), /* @ts-ignore */
|
|
428
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
429
|
+
isLoadingMore = computed(() => this.zLoadingMore() || this._asyncLoadingMore(), /* @ts-ignore */
|
|
430
|
+
...(ngDevMode ? [{ debugName: "isLoadingMore" }] : /* istanbul ignore next */ []));
|
|
431
|
+
canLoadMore = computed(() => this.hasAsyncOptions() ? this._asyncHasMore() : this.zEnableLoadMore(), /* @ts-ignore */
|
|
432
|
+
...(ngDevMode ? [{ debugName: "canLoadMore" }] : /* istanbul ignore next */ []));
|
|
433
|
+
effectiveDebounceTime = computed(() => this.zConfig().debounceTime ?? this.zDebounce(), /* @ts-ignore */
|
|
434
|
+
...(ngDevMode ? [{ debugName: "effectiveDebounceTime" }] : /* istanbul ignore next */ []));
|
|
372
435
|
virtualizer = injectVirtualizer(() => ({
|
|
373
436
|
scrollElement: this.virtualScrollRef(),
|
|
374
437
|
count: this.filteredOptions().length,
|
|
@@ -376,6 +439,7 @@ class ZSelectComponent {
|
|
|
376
439
|
measureElement: (element) => element.getBoundingClientRect().height,
|
|
377
440
|
gap: 3,
|
|
378
441
|
overscan: 5,
|
|
442
|
+
useApplicationRefTick: false,
|
|
379
443
|
}));
|
|
380
444
|
_measureVirtualItems = effect(() => {
|
|
381
445
|
if (!this.zDynamicSize()) {
|
|
@@ -385,38 +449,49 @@ class ZSelectComponent {
|
|
|
385
449
|
for (const el of elements) {
|
|
386
450
|
this.virtualizer.measureElement(el.nativeElement);
|
|
387
451
|
}
|
|
388
|
-
},
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
452
|
+
}, /* @ts-ignore */
|
|
453
|
+
...(ngDevMode ? [{ debugName: "_measureVirtualItems" }] : /* istanbul ignore next */ []));
|
|
454
|
+
isDisabled = computed(() => this._disabled() || this.zDisabled(), /* @ts-ignore */
|
|
455
|
+
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
456
|
+
isReadonly = computed(() => this.zReadonly(), /* @ts-ignore */
|
|
457
|
+
...(ngDevMode ? [{ debugName: "isReadonly" }] : /* istanbul ignore next */ []));
|
|
458
|
+
isInteractionDisabled = computed(() => this.isDisabled() || this.isReadonly() || this.zLoading(), /* @ts-ignore */
|
|
459
|
+
...(ngDevMode ? [{ debugName: "isInteractionDisabled" }] : /* istanbul ignore next */ []));
|
|
392
460
|
effectivePlaceholder = computed(() => {
|
|
393
461
|
this._zTranslate.currentLang();
|
|
394
462
|
return this.zPlaceholder() || this._zTranslate.instant('i18n_z_ui_select_placeholder');
|
|
395
|
-
},
|
|
463
|
+
}, /* @ts-ignore */
|
|
464
|
+
...(ngDevMode ? [{ debugName: "effectivePlaceholder" }] : /* istanbul ignore next */ []));
|
|
396
465
|
effectivePlaceholderSearch = computed(() => {
|
|
397
466
|
this._zTranslate.currentLang();
|
|
398
467
|
return this.zPlaceholderSearch() || this._zTranslate.instant('i18n_z_ui_select_search');
|
|
399
|
-
},
|
|
468
|
+
}, /* @ts-ignore */
|
|
469
|
+
...(ngDevMode ? [{ debugName: "effectivePlaceholderSearch" }] : /* istanbul ignore next */ []));
|
|
400
470
|
effectiveNotFoundText = computed(() => {
|
|
401
471
|
this._zTranslate.currentLang();
|
|
402
472
|
return this.zNotFoundText() || this._zTranslate.instant('i18n_z_ui_select_no_results');
|
|
403
|
-
},
|
|
473
|
+
}, /* @ts-ignore */
|
|
474
|
+
...(ngDevMode ? [{ debugName: "effectiveNotFoundText" }] : /* istanbul ignore next */ []));
|
|
404
475
|
effectiveEmptyText = computed(() => {
|
|
405
476
|
this._zTranslate.currentLang();
|
|
406
477
|
return this.zEmptyText() || this._zTranslate.instant('i18n_z_ui_select_no_options');
|
|
407
|
-
},
|
|
478
|
+
}, /* @ts-ignore */
|
|
479
|
+
...(ngDevMode ? [{ debugName: "effectiveEmptyText" }] : /* istanbul ignore next */ []));
|
|
408
480
|
effectiveSelectAllText = computed(() => {
|
|
409
481
|
this._zTranslate.currentLang();
|
|
410
482
|
return this._zTranslate.instant('i18n_z_ui_select_select_all');
|
|
411
|
-
},
|
|
483
|
+
}, /* @ts-ignore */
|
|
484
|
+
...(ngDevMode ? [{ debugName: "effectiveSelectAllText" }] : /* istanbul ignore next */ []));
|
|
412
485
|
effectiveClearAllText = computed(() => {
|
|
413
486
|
this._zTranslate.currentLang();
|
|
414
487
|
return this._zTranslate.instant('i18n_z_ui_select_clear_all');
|
|
415
|
-
},
|
|
488
|
+
}, /* @ts-ignore */
|
|
489
|
+
...(ngDevMode ? [{ debugName: "effectiveClearAllText" }] : /* istanbul ignore next */ []));
|
|
416
490
|
effectiveRequiredErrorText = computed(() => {
|
|
417
491
|
this._zTranslate.currentLang();
|
|
418
492
|
return this._zTranslate.instant('i18n_z_ui_select_required');
|
|
419
|
-
},
|
|
493
|
+
}, /* @ts-ignore */
|
|
494
|
+
...(ngDevMode ? [{ debugName: "effectiveRequiredErrorText" }] : /* istanbul ignore next */ []));
|
|
420
495
|
translatedOptions = computed(() => {
|
|
421
496
|
this._zTranslate.currentLang();
|
|
422
497
|
const options = this.sourceOptions();
|
|
@@ -427,7 +502,8 @@ class ZSelectComponent {
|
|
|
427
502
|
...opt,
|
|
428
503
|
label: this._zTranslate.instant(opt.label),
|
|
429
504
|
}));
|
|
430
|
-
},
|
|
505
|
+
}, /* @ts-ignore */
|
|
506
|
+
...(ngDevMode ? [{ debugName: "translatedOptions" }] : /* istanbul ignore next */ []));
|
|
431
507
|
translatedAsyncSelectedOptions = computed(() => {
|
|
432
508
|
this._zTranslate.currentLang();
|
|
433
509
|
const options = this.asyncSelectedOptions();
|
|
@@ -438,32 +514,38 @@ class ZSelectComponent {
|
|
|
438
514
|
...opt,
|
|
439
515
|
label: this._zTranslate.instant(opt.label),
|
|
440
516
|
}));
|
|
441
|
-
},
|
|
517
|
+
}, /* @ts-ignore */
|
|
518
|
+
...(ngDevMode ? [{ debugName: "translatedAsyncSelectedOptions" }] : /* istanbul ignore next */ []));
|
|
442
519
|
isMultipleMode = computed(() => {
|
|
443
520
|
const mode = this.zMode();
|
|
444
521
|
return mode === 'multiple' || mode === 'tags';
|
|
445
|
-
},
|
|
446
|
-
|
|
522
|
+
}, /* @ts-ignore */
|
|
523
|
+
...(ngDevMode ? [{ debugName: "isMultipleMode" }] : /* istanbul ignore next */ []));
|
|
524
|
+
isTagsMode = computed(() => this.zMode() === 'tags', /* @ts-ignore */
|
|
525
|
+
...(ngDevMode ? [{ debugName: "isTagsMode" }] : /* istanbul ignore next */ []));
|
|
447
526
|
effectiveSelectedTemplate = computed(() => {
|
|
448
527
|
const directive = this.customSelectedDirective();
|
|
449
528
|
if (directive) {
|
|
450
529
|
return directive.templateRef;
|
|
451
530
|
}
|
|
452
531
|
return this.zSelectedTemplate();
|
|
453
|
-
},
|
|
532
|
+
}, /* @ts-ignore */
|
|
533
|
+
...(ngDevMode ? [{ debugName: "effectiveSelectedTemplate" }] : /* istanbul ignore next */ []));
|
|
454
534
|
effectiveOptionTemplate = computed(() => {
|
|
455
535
|
const directive = this.customOptionDirective();
|
|
456
536
|
if (directive) {
|
|
457
537
|
return directive.templateRef;
|
|
458
538
|
}
|
|
459
539
|
return this.zOptionTemplate();
|
|
460
|
-
},
|
|
540
|
+
}, /* @ts-ignore */
|
|
541
|
+
...(ngDevMode ? [{ debugName: "effectiveOptionTemplate" }] : /* istanbul ignore next */ []));
|
|
461
542
|
knownOptions = computed(() => {
|
|
462
543
|
if (this.zSearchServer() || this.hasAsyncOptions()) {
|
|
463
544
|
return zMergeAsyncOptions(this._allKnownOptions(), this.translatedAsyncSelectedOptions(), this.config().async?.dedupeBy);
|
|
464
545
|
}
|
|
465
546
|
return this.translatedOptions();
|
|
466
|
-
},
|
|
547
|
+
}, /* @ts-ignore */
|
|
548
|
+
...(ngDevMode ? [{ debugName: "knownOptions" }] : /* istanbul ignore next */ []));
|
|
467
549
|
shouldUseVirtualScroll = computed(() => {
|
|
468
550
|
if (this.zVirtualScroll()) {
|
|
469
551
|
return true;
|
|
@@ -476,7 +558,8 @@ class ZSelectComponent {
|
|
|
476
558
|
return false;
|
|
477
559
|
}
|
|
478
560
|
return this.sourceOptions().length > 50;
|
|
479
|
-
},
|
|
561
|
+
}, /* @ts-ignore */
|
|
562
|
+
...(ngDevMode ? [{ debugName: "shouldUseVirtualScroll" }] : /* istanbul ignore next */ []));
|
|
480
563
|
selectedOption = computed(() => {
|
|
481
564
|
this._zTranslate.currentLang();
|
|
482
565
|
if (this.isMultipleMode()) {
|
|
@@ -488,7 +571,8 @@ class ZSelectComponent {
|
|
|
488
571
|
}
|
|
489
572
|
const options = this.knownOptions();
|
|
490
573
|
return this._findOptionByValue(options, value) ?? null;
|
|
491
|
-
},
|
|
574
|
+
}, /* @ts-ignore */
|
|
575
|
+
...(ngDevMode ? [{ debugName: "selectedOption" }] : /* istanbul ignore next */ []));
|
|
492
576
|
selectedOptions = computed(() => {
|
|
493
577
|
this._zTranslate.currentLang();
|
|
494
578
|
if (!this.isMultipleMode()) {
|
|
@@ -502,7 +586,8 @@ class ZSelectComponent {
|
|
|
502
586
|
return value
|
|
503
587
|
.map(v => this._findOptionByValue(options, v))
|
|
504
588
|
.filter((opt) => opt !== undefined);
|
|
505
|
-
},
|
|
589
|
+
}, /* @ts-ignore */
|
|
590
|
+
...(ngDevMode ? [{ debugName: "selectedOptions" }] : /* istanbul ignore next */ []));
|
|
506
591
|
selected = computed(() => {
|
|
507
592
|
if (this.isMultipleMode()) {
|
|
508
593
|
return this.selectedOptions();
|
|
@@ -512,23 +597,27 @@ class ZSelectComponent {
|
|
|
512
597
|
return [];
|
|
513
598
|
}
|
|
514
599
|
return [option];
|
|
515
|
-
},
|
|
600
|
+
}, /* @ts-ignore */
|
|
601
|
+
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
516
602
|
displayedTags = computed(() => {
|
|
517
603
|
const selected = this.selectedOptions();
|
|
518
604
|
const max = this.zMaxTagCount();
|
|
519
605
|
return selected.slice(0, max);
|
|
520
|
-
},
|
|
606
|
+
}, /* @ts-ignore */
|
|
607
|
+
...(ngDevMode ? [{ debugName: "displayedTags" }] : /* istanbul ignore next */ []));
|
|
521
608
|
remainingCount = computed(() => {
|
|
522
609
|
const selected = this.selectedOptions();
|
|
523
610
|
const max = this.zMaxTagCount();
|
|
524
611
|
return Math.max(0, selected.length - max);
|
|
525
|
-
},
|
|
612
|
+
}, /* @ts-ignore */
|
|
613
|
+
...(ngDevMode ? [{ debugName: "remainingCount" }] : /* istanbul ignore next */ []));
|
|
526
614
|
hasValue = computed(() => {
|
|
527
615
|
if (this.isMultipleMode()) {
|
|
528
616
|
return this.selectedOptions().length > 0;
|
|
529
617
|
}
|
|
530
618
|
return this.selectedOption() !== null;
|
|
531
|
-
},
|
|
619
|
+
}, /* @ts-ignore */
|
|
620
|
+
...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
532
621
|
isAllSelected = computed(() => {
|
|
533
622
|
if (!this.isMultipleMode()) {
|
|
534
623
|
return false;
|
|
@@ -544,19 +633,22 @@ class ZSelectComponent {
|
|
|
544
633
|
return false;
|
|
545
634
|
}
|
|
546
635
|
return enabledValues.every(value => selectedValues.some(selectedValue => this._isValueEqual(selectedValue, value)));
|
|
547
|
-
},
|
|
636
|
+
}, /* @ts-ignore */
|
|
637
|
+
...(ngDevMode ? [{ debugName: "isAllSelected" }] : /* istanbul ignore next */ []));
|
|
548
638
|
filteredOptions = computed(() => {
|
|
549
639
|
if (this.zSearchServer() || this.hasAsyncOptions()) {
|
|
550
640
|
return this.translatedOptions();
|
|
551
641
|
}
|
|
552
642
|
return filterOptions(this.translatedOptions(), this.searchText());
|
|
553
|
-
},
|
|
643
|
+
}, /* @ts-ignore */
|
|
644
|
+
...(ngDevMode ? [{ debugName: "filteredOptions" }] : /* istanbul ignore next */ []));
|
|
554
645
|
isEmptyData = computed(() => {
|
|
555
646
|
if ((this.zSearchServer() || this.hasAsyncOptions()) && this.searchText().trim()) {
|
|
556
647
|
return false;
|
|
557
648
|
}
|
|
558
649
|
return this.translatedOptions().length === 0;
|
|
559
|
-
},
|
|
650
|
+
}, /* @ts-ignore */
|
|
651
|
+
...(ngDevMode ? [{ debugName: "isEmptyData" }] : /* istanbul ignore next */ []));
|
|
560
652
|
isNoSearchResults = computed(() => {
|
|
561
653
|
if ((this.zSearchServer() || this.hasAsyncOptions()) && this.searchText().trim()) {
|
|
562
654
|
return this.translatedOptions().length === 0;
|
|
@@ -565,14 +657,16 @@ class ZSelectComponent {
|
|
|
565
657
|
const hasOptions = this.translatedOptions().length > 0;
|
|
566
658
|
const hasSearch = this.searchText().trim() !== '';
|
|
567
659
|
return noFiltered && hasOptions && hasSearch;
|
|
568
|
-
},
|
|
660
|
+
}, /* @ts-ignore */
|
|
661
|
+
...(ngDevMode ? [{ debugName: "isNoSearchResults" }] : /* istanbul ignore next */ []));
|
|
569
662
|
optionsMaxHeight = computed(() => {
|
|
570
663
|
const total = this.zDropdownMaxHeight();
|
|
571
664
|
const searchHeight = this.zShowSearch() ? 44 : 0;
|
|
572
665
|
const hasActionBar = this.zShowAction() && (!!this.zActionTemplate() || this.isMultipleMode());
|
|
573
666
|
const actionHeight = hasActionBar ? 40 : 0;
|
|
574
667
|
return total - searchHeight - actionHeight;
|
|
575
|
-
},
|
|
668
|
+
}, /* @ts-ignore */
|
|
669
|
+
...(ngDevMode ? [{ debugName: "optionsMaxHeight" }] : /* istanbul ignore next */ []));
|
|
576
670
|
currentStatus = computed(() => {
|
|
577
671
|
if (this.isDisabled()) {
|
|
578
672
|
return 'disabled';
|
|
@@ -587,7 +681,8 @@ class ZSelectComponent {
|
|
|
587
681
|
return 'error';
|
|
588
682
|
}
|
|
589
683
|
return 'default';
|
|
590
|
-
},
|
|
684
|
+
}, /* @ts-ignore */
|
|
685
|
+
...(ngDevMode ? [{ debugName: "currentStatus" }] : /* istanbul ignore next */ []));
|
|
591
686
|
_shouldShowValidation = computed(() => {
|
|
592
687
|
const control = this._formControl();
|
|
593
688
|
this._formStateVersion();
|
|
@@ -599,7 +694,8 @@ class ZSelectComponent {
|
|
|
599
694
|
return control.dirty;
|
|
600
695
|
}
|
|
601
696
|
return this.uiState().dirty || this.uiState().touched;
|
|
602
|
-
},
|
|
697
|
+
}, /* @ts-ignore */
|
|
698
|
+
...(ngDevMode ? [{ debugName: "_shouldShowValidation" }] : /* istanbul ignore next */ []));
|
|
603
699
|
hasError = computed(() => {
|
|
604
700
|
// Check custom error first (from setErrorMessage)
|
|
605
701
|
if (this._customError()) {
|
|
@@ -619,7 +715,8 @@ class ZSelectComponent {
|
|
|
619
715
|
return false;
|
|
620
716
|
}
|
|
621
717
|
return control.invalid && this._shouldShowValidation();
|
|
622
|
-
},
|
|
718
|
+
}, /* @ts-ignore */
|
|
719
|
+
...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
623
720
|
errorMessage = computed(() => {
|
|
624
721
|
// Check custom error first (from setErrorMessage)
|
|
625
722
|
const customError = this._customError();
|
|
@@ -649,7 +746,8 @@ class ZSelectComponent {
|
|
|
649
746
|
return this.effectiveRequiredErrorText();
|
|
650
747
|
}
|
|
651
748
|
return '';
|
|
652
|
-
},
|
|
749
|
+
}, /* @ts-ignore */
|
|
750
|
+
...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
653
751
|
selectClasses = computed(() => zMergeClasses(zSelectVariants({
|
|
654
752
|
zSize: this.zSize(),
|
|
655
753
|
zStatus: this.currentStatus(),
|
|
@@ -660,8 +758,10 @@ class ZSelectComponent {
|
|
|
660
758
|
'h-8': this.zSize() === 'sm',
|
|
661
759
|
'h-9': this.zSize() === 'default',
|
|
662
760
|
'h-10': this.zSize() === 'lg',
|
|
663
|
-
}, this.class()),
|
|
664
|
-
|
|
761
|
+
}, this.class()), /* @ts-ignore */
|
|
762
|
+
...(ngDevMode ? [{ debugName: "selectClasses" }] : /* istanbul ignore next */ []));
|
|
763
|
+
dropdownClasses = computed(() => zMergeClasses('text-primary mt-0 shrink-0', this.zClassSelect()), /* @ts-ignore */
|
|
764
|
+
...(ngDevMode ? [{ debugName: "dropdownClasses" }] : /* istanbul ignore next */ []));
|
|
665
765
|
_searchSubject = new Subject();
|
|
666
766
|
_asyncCancelSubject = new Subject();
|
|
667
767
|
_asyncValidationSubject = new Subject();
|
|
@@ -673,7 +773,8 @@ class ZSelectComponent {
|
|
|
673
773
|
_onChange = () => void 0;
|
|
674
774
|
_onTouched = () => void 0;
|
|
675
775
|
_ngControl = null;
|
|
676
|
-
_isNgModel = signal(false,
|
|
776
|
+
_isNgModel = signal(false, /* @ts-ignore */
|
|
777
|
+
...(ngDevMode ? [{ debugName: "_isNgModel" }] : /* istanbul ignore next */ []));
|
|
677
778
|
constructor() {
|
|
678
779
|
effect(onCleanup => {
|
|
679
780
|
const triggerEl = this.triggerRef()?.nativeElement;
|
|
@@ -1407,16 +1508,16 @@ class ZSelectComponent {
|
|
|
1407
1508
|
this._asyncValidationSubject.next(value);
|
|
1408
1509
|
}
|
|
1409
1510
|
}
|
|
1410
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1411
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1511
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1512
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: ZSelectComponent, isStandalone: true, selector: "z-select", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, zClassSelect: { classPropertyName: "zClassSelect", publicName: "zClassSelect", isSignal: true, isRequired: false, transformFunction: null }, zMode: { classPropertyName: "zMode", publicName: "zMode", isSignal: true, isRequired: false, transformFunction: null }, zSize: { classPropertyName: "zSize", publicName: "zSize", isSignal: true, isRequired: false, transformFunction: null }, zLabel: { classPropertyName: "zLabel", publicName: "zLabel", isSignal: true, isRequired: false, transformFunction: null }, zLabelClass: { classPropertyName: "zLabelClass", publicName: "zLabelClass", isSignal: true, isRequired: false, transformFunction: null }, zPlaceholder: { classPropertyName: "zPlaceholder", publicName: "zPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, zRequired: { classPropertyName: "zRequired", publicName: "zRequired", isSignal: true, isRequired: false, transformFunction: null }, zDisabled: { classPropertyName: "zDisabled", publicName: "zDisabled", isSignal: true, isRequired: false, transformFunction: null }, zReadonly: { classPropertyName: "zReadonly", publicName: "zReadonly", isSignal: true, isRequired: false, transformFunction: null }, zLoading: { classPropertyName: "zLoading", publicName: "zLoading", isSignal: true, isRequired: false, transformFunction: null }, zLoadingOutline: { classPropertyName: "zLoadingOutline", publicName: "zLoadingOutline", isSignal: true, isRequired: false, transformFunction: null }, zPrefix: { classPropertyName: "zPrefix", publicName: "zPrefix", isSignal: true, isRequired: false, transformFunction: null }, zAllowClear: { classPropertyName: "zAllowClear", publicName: "zAllowClear", isSignal: true, isRequired: false, transformFunction: null }, zShowCheck: { classPropertyName: "zShowCheck", publicName: "zShowCheck", isSignal: true, isRequired: false, transformFunction: null }, zWrap: { classPropertyName: "zWrap", publicName: "zWrap", isSignal: true, isRequired: false, transformFunction: null }, zShowSearch: { classPropertyName: "zShowSearch", publicName: "zShowSearch", isSignal: true, isRequired: false, transformFunction: null }, zPlaceholderSearch: { classPropertyName: "zPlaceholderSearch", publicName: "zPlaceholderSearch", isSignal: true, isRequired: false, transformFunction: null }, zDebounce: { classPropertyName: "zDebounce", publicName: "zDebounce", isSignal: true, isRequired: false, transformFunction: null }, zNotFoundText: { classPropertyName: "zNotFoundText", publicName: "zNotFoundText", isSignal: true, isRequired: false, transformFunction: null }, zEmptyText: { classPropertyName: "zEmptyText", publicName: "zEmptyText", isSignal: true, isRequired: false, transformFunction: null }, zEmptyIcon: { classPropertyName: "zEmptyIcon", publicName: "zEmptyIcon", isSignal: true, isRequired: false, transformFunction: null }, zMaxTagCount: { classPropertyName: "zMaxTagCount", publicName: "zMaxTagCount", isSignal: true, isRequired: false, transformFunction: null }, zDropdownMaxHeight: { classPropertyName: "zDropdownMaxHeight", publicName: "zDropdownMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, zOptionHeight: { classPropertyName: "zOptionHeight", publicName: "zOptionHeight", isSignal: true, isRequired: false, transformFunction: null }, zVirtualScroll: { classPropertyName: "zVirtualScroll", publicName: "zVirtualScroll", isSignal: true, isRequired: false, transformFunction: null }, zDynamicSize: { classPropertyName: "zDynamicSize", publicName: "zDynamicSize", isSignal: true, isRequired: false, transformFunction: null }, zShowAction: { classPropertyName: "zShowAction", publicName: "zShowAction", isSignal: true, isRequired: false, transformFunction: null }, zOptions: { classPropertyName: "zOptions", publicName: "zOptions", isSignal: true, isRequired: false, transformFunction: null }, zConfig: { classPropertyName: "zConfig", publicName: "zConfig", isSignal: true, isRequired: false, transformFunction: null }, zTranslateLabels: { classPropertyName: "zTranslateLabels", publicName: "zTranslateLabels", isSignal: true, isRequired: false, transformFunction: null }, zKey: { classPropertyName: "zKey", publicName: "zKey", isSignal: true, isRequired: false, transformFunction: null }, zSearchServer: { classPropertyName: "zSearchServer", publicName: "zSearchServer", isSignal: true, isRequired: false, transformFunction: null }, zLoadingMore: { classPropertyName: "zLoadingMore", publicName: "zLoadingMore", isSignal: true, isRequired: false, transformFunction: null }, zEnableLoadMore: { classPropertyName: "zEnableLoadMore", publicName: "zEnableLoadMore", isSignal: true, isRequired: false, transformFunction: null }, zScrollDistance: { classPropertyName: "zScrollDistance", publicName: "zScrollDistance", isSignal: true, isRequired: false, transformFunction: null }, zMaxVisible: { classPropertyName: "zMaxVisible", publicName: "zMaxVisible", isSignal: true, isRequired: false, transformFunction: null }, zScrollClose: { classPropertyName: "zScrollClose", publicName: "zScrollClose", isSignal: true, isRequired: false, transformFunction: null }, zSticky: { classPropertyName: "zSticky", publicName: "zSticky", isSignal: true, isRequired: false, transformFunction: null }, zPosition: { classPropertyName: "zPosition", publicName: "zPosition", isSignal: true, isRequired: false, transformFunction: null }, zSelectedTemplate: { classPropertyName: "zSelectedTemplate", publicName: "zSelectedTemplate", isSignal: true, isRequired: false, transformFunction: null }, zOptionTemplate: { classPropertyName: "zOptionTemplate", publicName: "zOptionTemplate", isSignal: true, isRequired: false, transformFunction: null }, zActionTemplate: { classPropertyName: "zActionTemplate", publicName: "zActionTemplate", isSignal: true, isRequired: false, transformFunction: null }, zAsyncValidators: { classPropertyName: "zAsyncValidators", publicName: "zAsyncValidators", isSignal: true, isRequired: false, transformFunction: null }, zAsyncDebounce: { classPropertyName: "zAsyncDebounce", publicName: "zAsyncDebounce", isSignal: true, isRequired: false, transformFunction: null }, zAsyncValidateOn: { classPropertyName: "zAsyncValidateOn", publicName: "zAsyncValidateOn", isSignal: true, isRequired: false, transformFunction: null }, zValidators: { classPropertyName: "zValidators", publicName: "zValidators", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { zOnSearch: "zOnSearch", zOnLoadMore: "zOnLoadMore", zOnBlur: "zOnBlur", zOnFocus: "zOnFocus", zControl: "zControl", zEvent: "zEvent" }, providers: [
|
|
1412
1513
|
{
|
|
1413
1514
|
provide: NG_VALUE_ACCESSOR,
|
|
1414
1515
|
useExisting: forwardRef(() => ZSelectComponent),
|
|
1415
1516
|
multi: true,
|
|
1416
1517
|
},
|
|
1417
|
-
], 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 }, { propertyName: "virtualOptionElements", predicate: ["virtualOptionEl"], descendants: true, isSignal: true }], exportAs: ["zSelect"], ngImport: i0, template: "<div class=\"z-select-wrapper relative flex w-full flex-col gap-2\">\n @if (zLabel()) {\n <label [for]=\"selectId\" class=\"text-xs leading-none font-medium\" [class]=\"zLabelClass()\">\n {{ zLabel() }}\n @if (zRequired()) {\n <span class=\"text-destructive! ml-0.5\">*</span>\n }\n </label>\n }\n\n <div class=\"relative\">\n <div\n #triggerEl\n [id]=\"selectId\"\n z-popover\n [zPopoverContent]=\"dropdownTpl\"\n [zOffset]=\"6\"\n [zDisabled]=\"isInteractionDisabled()\"\n [zScrollClose]=\"zScrollClose()\"\n [zSticky]=\"zSticky()\"\n [zKeyboardSafe]=\"zShowSearch()\"\n zPopoverWidth=\"trigger\"\n zTrigger=\"click\"\n [zPosition]=\"zPosition()\"\n zClass=\"border-0 shadow-none p-0\"\n (zControl)=\"onPopoverControl($event)\"\n (zShow)=\"onPopoverShow()\"\n (zHideStart)=\"onPopoverHideStart()\"\n (zHide)=\"onPopoverHideEnd()\"\n class=\"z-select-trigger cursor-pointer\"\n [class]=\"selectClasses()\"\n [class.z-select-open]=\"uiState().isOpen\"\n (mousedown)=\"onTriggerMousedown()\"\n (keydown)=\"onTriggerKeydown($event)\"\n tabindex=\"0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"uiState().isOpen\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-controls]=\"dropdownId\">\n @if (zPrefix()) {\n <z-icon [zType]=\"zPrefix() || 'lucideChevronDown'\" zSize=\"18\" class=\"text-muted-foreground shrink-0\" />\n }\n\n <div\n class=\"z-select-tags-wrapper flex min-w-0 flex-1 items-center gap-1\"\n [class.flex-wrap]=\"zWrap()\"\n [class.overflow-hidden]=\"!zWrap()\">\n @if (isMultipleMode()) {\n @if (selectedOptions().length === 0) {\n <span class=\"text-muted-foreground min-w-0 flex-1 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 [zTooltipDisabled]=\"uiState().isOpen\"\n zTooltipPosition=\"top\"\n [zTooltipHideDelay]=\"0\"\n [zTooltipOffset]=\"6\"\n [zTriggerElement]=\"tagEl\">\n {{ opt.label }}\n </span>\n }\n @if (zAllowClear() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"-mr-0.5 flex size-3.5 shrink-0 items-center justify-center rounded-sm transition-colors hover:bg-black/10\"\n (click)=\"removeOption($event, opt)\"\n tabindex=\"-1\">\n <z-icon zType=\"lucideX\" zSize=\"10\" />\n </button>\n }\n </span>\n }\n @if (remainingCount() > 0) {\n <span\n class=\"z-select-remaining text-muted-foreground bg-muted rounded-sm px-1.5 py-0.5 text-xs font-medium\">\n +{{ remainingCount() }}\n </span>\n }\n }\n } @else {\n @if (selectedOption()) {\n @if (effectiveSelectedTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"effectiveSelectedTemplate()!; context: { $implicit: selectedOption() }\" />\n } @else {\n <span\n class=\"truncate\"\n z-tooltip\n [zContent]=\"selectedOption()!.label\"\n [zTooltipDisabled]=\"uiState().isOpen\"\n zTooltipPosition=\"top\"\n [zTooltipHideDelay]=\"0\"\n [zTooltipOffset]=\"10\">\n {{ selectedOption()!.label }}\n </span>\n }\n } @else {\n <span class=\"text-muted-foreground min-w-0 flex-1 truncate whitespace-nowrap\">\n {{ effectivePlaceholder() }}\n </span>\n }\n }\n </div>\n\n @if (isLoading() || isLoadingMore()) {\n <z-icon zType=\"lucideLoaderCircle\" zSize=\"18\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n @if (!isLoading() && zAllowClear() && hasValue() && !isDisabled() && !isReadonly()) {\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:text-foreground flex shrink-0 items-center justify-center transition-colors\"\n (click)=\"clearAll($event)\"\n tabindex=\"-1\">\n <z-icon zType=\"lucideX\" zSize=\"18\" />\n </button>\n }\n\n @if (uiState().isValidating) {\n <z-icon zType=\"lucideLoader2\" zSize=\"18\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n <z-icon\n zType=\"lucideChevronDown\"\n zSize=\"18\"\n class=\"text-muted-foreground shrink-0 transition-transform duration-200\"\n [class.rotate-180]=\"uiState().isOpen\" />\n </div>\n\n @if (hasError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 pt-2 text-xs duration-200\">\n {{ errorMessage() }}\n </p>\n }\n </div>\n\n <ng-template #dropdownTpl let-close=\"close\">\n <div\n [id]=\"dropdownId\"\n class=\"z-select-dropdown bg-popover border-border rounded-sm border shadow-[var(--z-popover-shadow)]\"\n [style.width.px]=\"dropdownWidth()\"\n [style.min-width.px]=\"dropdownWidth()\">\n @if (zShowSearch()) {\n <div class=\"border-border flex items-center border-b px-3\">\n <z-icon zType=\"lucideSearch\" zSize=\"18\" class=\"text-muted-foreground/50 mr-2 shrink-0\" />\n <input\n #dropdownSearchInput\n type=\"text\"\n class=\"placeholder:text-muted-foreground text-foreground flex h-10 w-full min-w-0 overflow-hidden bg-transparent py-3 text-sm text-ellipsis whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50\"\n [placeholder]=\"effectivePlaceholderSearch()\"\n [ngModel]=\"searchText()\"\n (ngModelChange)=\"onSearchChange($event)\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\" />\n </div>\n }\n\n @if (isLoading()) {\n <div class=\"flex items-center justify-center\" [style.height.px]=\"optionsMaxHeight()\">\n <z-loading [zLoading]=\"true\" zSize=\"default\" />\n </div>\n } @else {\n @if (filteredOptions().length > 0) {\n @if (shouldUseVirtualScroll()) {\n <div\n #virtualScrollElement\n class=\"z-select-options z-select-virtual-scroll overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.height.px]=\"optionsMaxHeight()\">\n <div class=\"z-select-virtual-inner relative\" [style.height.px]=\"virtualizer.getTotalSize()\">\n @for (virtualItem of virtualizer.getVirtualItems(); track virtualItem.index) {\n @let opt = filteredOptions()[virtualItem.index];\n <div\n #virtualOptionEl\n #optionEl\n [class]=\"\n 'z-select-option absolute right-0 left-0 min-w-0 ' +\n (opt\n | zIsSelected: currentValue() : isMultipleMode() : zKey()\n | zOptionClasses: opt.disabled : !!effectiveOptionTemplate())\n \"\n [attr.data-index]=\"virtualItem.index\"\n [style.display]=\"effectiveOptionTemplate() ? 'block' : null\"\n [style.height.px]=\"zDynamicSize() ? null : zOptionHeight()\"\n [style.minHeight.px]=\"zDynamicSize() ? zOptionHeight() : null\"\n [style.overflow]=\"effectiveOptionTemplate() ? 'visible' : null\"\n [style.transform]=\"'translateY(' + virtualItem.start + 'px)'\"\n (click)=\"selectOption(opt, close)\">\n @if (effectiveOptionTemplate()) {\n @let selected = opt | zIsSelected: currentValue() : isMultipleMode() : zKey();\n <div class=\"flex min-w-0 items-start gap-2\">\n <div class=\"min-w-0 flex-1\">\n <ng-container\n *ngTemplateOutlet=\"\n effectiveOptionTemplate()!;\n context: {\n $implicit: opt,\n selected: selected,\n }\n \" />\n </div>\n @if (zShowCheck() && selected) {\n <z-icon zType=\"lucideCheck\" zSize=\"16\" [zStrokeWidth]=\"4\" [class]=\"dropdownClasses()\" />\n }\n </div>\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 @if (zShowCheck() && (opt | zIsSelected: currentValue() : isMultipleMode() : zKey())) {\n <z-icon zType=\"lucideCheck\" zSize=\"16\" [zStrokeWidth]=\"4\" [class]=\"dropdownClasses()\" />\n }\n }\n </div>\n }\n </div>\n @if (isLoadingMore()) {\n <div\n class=\"bg-popover/80 absolute right-0 bottom-0 left-0 flex items-center justify-center py-2\"\n [style.transform]=\"'translateY(' + virtualizer.getTotalSize() + 'px)'\">\n <z-loading zSize=\"xs\" [zLoading]=\"true\" />\n </div>\n }\n </div>\n } @else {\n <div\n #optionsContainer\n class=\"z-select-options flex flex-col gap-0.75 overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.maxHeight.px]=\"optionsMaxHeight()\">\n @for (opt of filteredOptions(); track opt.value) {\n <div\n #optionEl2\n [class]=\"\n 'z-select-option relative min-w-0 ' +\n (opt\n | zIsSelected: currentValue() : isMultipleMode() : zKey()\n | zOptionClasses: opt.disabled : !!effectiveOptionTemplate())\n \"\n [style.display]=\"effectiveOptionTemplate() ? 'block' : null\"\n [style.minHeight.px]=\"effectiveOptionTemplate() ? null : zOptionHeight()\"\n [style.overflow]=\"effectiveOptionTemplate() ? 'visible' : null\"\n (click)=\"selectOption(opt, close)\">\n @if (effectiveOptionTemplate()) {\n @let selected = opt | zIsSelected: currentValue() : isMultipleMode() : zKey();\n <div class=\"flex min-w-0 items-start gap-2\">\n <div class=\"min-w-0 flex-1\">\n <ng-container\n *ngTemplateOutlet=\"\n effectiveOptionTemplate()!;\n context: {\n $implicit: opt,\n selected: selected,\n }\n \" />\n </div>\n @if (zShowCheck() && selected) {\n <z-icon zType=\"lucideCheck\" zSize=\"18\" [zStrokeWidth]=\"4\" [class]=\"dropdownClasses()\" />\n }\n </div>\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 @if (zShowCheck() && (opt | zIsSelected: currentValue() : isMultipleMode() : zKey())) {\n <z-icon zType=\"lucideCheck\" zSize=\"18\" [zStrokeWidth]=\"4\" [class]=\"dropdownClasses()\" />\n }\n }\n </div>\n }\n @if (canLoadMore()) {\n <div #loadMoreSentinel class=\"h-px w-full shrink-0\"></div>\n }\n </div>\n }\n } @else {\n <div class=\"flex items-center justify-center p-1\" [style.height.px]=\"optionsMaxHeight()\">\n @if (isEmptyData()) {\n <z-empty [zIcon]=\"zEmptyIcon()\" zSize=\"sm\" [zMessage]=\"effectiveEmptyText()\" />\n } @else {\n <z-empty zIcon=\"lucideSearchX\" zSize=\"sm\" [zMessage]=\"effectiveNotFoundText()\" />\n }\n </div>\n }\n\n @if (isLoadingMore()) {\n <div class=\"z-select-loading-more border-border/50 flex items-center justify-center border-t py-1.5\">\n <z-loading zSize=\"xs\" [zLoading]=\"true\" />\n </div>\n }\n }\n\n @if (zShowAction() && (zActionTemplate() || isMultipleMode())) {\n <div class=\"border-border flex items-center gap-2 border-t px-2 py-1.5\">\n @if (zActionTemplate()) {\n <ng-container *ngTemplateOutlet=\"zActionTemplate()!\" />\n } @else {\n <z-button\n zSize=\"xs\"\n [zType]=\"isAllSelected() ? 'ghost-error' : 'ghost-info'\"\n class=\"min-w-0 flex-1\"\n (click)=\"toggleSelectAllAction()\"\n [zWave]=\"false\">\n <z-icon [zType]=\"isAllSelected() ? 'lucideX' : 'lucideCheckCheck'\" zSize=\"18\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ isAllSelected() ? effectiveClearAllText() : effectiveSelectAllText() }}</span>\n </z-button>\n }\n </div>\n }\n </div>\n </ng-template>\n</div>\n", styles: [".z-select-trigger{-webkit-user-select:none;user-select:none}.z-select-trigger:focus{outline:none}.z-select-trigger *{cursor:inherit}.z-select-tag{-webkit-user-select:none;user-select:none;animation:z-select-tag-enter .2s cubic-bezier(.4,0,.2,1)}@keyframes z-select-tag-enter{0%{opacity:0;transform:scale(.8) translateY(.25rem)}to{opacity:1;transform:scale(1) translateY(0)}}.z-select-remaining{animation:z-select-remaining-enter .25s cubic-bezier(.4,0,.2,1)}@keyframes z-select-remaining-enter{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}.z-select-dropdown input{text-overflow:ellipsis;overflow:hidden}.z-select-options{overflow-x:hidden!important}.z-select-virtual-scroll .z-select-virtual-inner{width:100%}.z-select-loading-more{animation:z-select-loading-enter .2s ease-out}@keyframes z-select-loading-enter{0%{opacity:0;transform:translateY(-.25rem)}to{opacity:1;transform:translateY(0)}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { 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: 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", "zAnimatedTypeIcon", "zAnimateIcon", "zAnimationTriggerIcon", "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", "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: 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 });
|
|
1518
|
+
], 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 }, { propertyName: "virtualOptionElements", predicate: ["virtualOptionEl"], descendants: true, isSignal: true }], exportAs: ["zSelect"], ngImport: i0, template: "<div class=\"z-select-wrapper relative flex w-full flex-col gap-2\">\n @if (zLabel()) {\n <label [for]=\"selectId\" class=\"text-xs leading-none font-medium\" [class]=\"zLabelClass()\">\n {{ zLabel() }}\n @if (zRequired()) {\n <span class=\"text-destructive! ml-0.5\">*</span>\n }\n </label>\n }\n\n <div class=\"relative\">\n <div\n #triggerEl\n [id]=\"selectId\"\n z-popover\n [zPopoverContent]=\"dropdownTpl\"\n [zOffset]=\"6\"\n [zDisabled]=\"isInteractionDisabled()\"\n [zScrollClose]=\"zScrollClose()\"\n [zSticky]=\"zSticky()\"\n [zKeyboardSafe]=\"zShowSearch()\"\n zPopoverWidth=\"trigger\"\n zTrigger=\"click\"\n [zPosition]=\"zPosition()\"\n zClass=\"border-0 shadow-none p-0\"\n (zControl)=\"onPopoverControl($event)\"\n (zShow)=\"onPopoverShow()\"\n (zHideStart)=\"onPopoverHideStart()\"\n (zHide)=\"onPopoverHideEnd()\"\n class=\"z-select-trigger cursor-pointer\"\n [class]=\"selectClasses()\"\n [class.z-select-open]=\"uiState().isOpen\"\n (mousedown)=\"onTriggerMousedown()\"\n (keydown)=\"onTriggerKeydown($event)\"\n tabindex=\"0\"\n role=\"combobox\"\n [attr.aria-expanded]=\"uiState().isOpen\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-controls]=\"dropdownId\">\n @if (zPrefix()) {\n <z-icon [zType]=\"zPrefix() || 'lucideChevronDown'\" zSize=\"18\" class=\"text-muted-foreground shrink-0\" />\n }\n\n <div\n class=\"z-select-tags-wrapper flex min-w-0 flex-1 items-center gap-1\"\n [class.flex-wrap]=\"zWrap()\"\n [class.overflow-hidden]=\"!zWrap()\">\n @if (isMultipleMode()) {\n @if (selectedOptions().length === 0) {\n <span class=\"text-muted-foreground min-w-0 flex-1 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 [zTooltipDisabled]=\"uiState().isOpen\"\n zTooltipPosition=\"top\"\n [zTooltipHideDelay]=\"0\"\n [zTooltipOffset]=\"6\"\n [zTriggerElement]=\"tagEl\">\n {{ opt.label }}\n </span>\n }\n @if (zAllowClear() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"-mr-0.5 flex size-3.5 shrink-0 items-center justify-center rounded-sm transition-colors hover:bg-black/10\"\n (click)=\"removeOption($event, opt)\"\n tabindex=\"-1\">\n <z-icon zType=\"lucideX\" zSize=\"10\" />\n </button>\n }\n </span>\n }\n @if (remainingCount() > 0) {\n <span\n class=\"z-select-remaining text-muted-foreground bg-muted rounded-sm px-1.5 py-0.5 text-xs font-medium\">\n +{{ remainingCount() }}\n </span>\n }\n }\n } @else {\n @if (selectedOption()) {\n @if (effectiveSelectedTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"effectiveSelectedTemplate()!; context: { $implicit: selectedOption() }\" />\n } @else {\n <span\n class=\"truncate\"\n z-tooltip\n [zContent]=\"selectedOption()!.label\"\n [zTooltipDisabled]=\"uiState().isOpen\"\n zTooltipPosition=\"top\"\n [zTooltipHideDelay]=\"0\"\n [zTooltipOffset]=\"10\">\n {{ selectedOption()!.label }}\n </span>\n }\n } @else {\n <span class=\"text-muted-foreground min-w-0 flex-1 truncate whitespace-nowrap\">\n {{ effectivePlaceholder() }}\n </span>\n }\n }\n </div>\n\n @if (isLoading() || isLoadingMore()) {\n <z-icon zType=\"lucideLoaderCircle\" zSize=\"18\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n @if (!isLoading() && zAllowClear() && hasValue() && !isDisabled() && !isReadonly()) {\n <button\n type=\"button\"\n class=\"text-muted-foreground hover:text-foreground flex shrink-0 items-center justify-center transition-colors\"\n (click)=\"clearAll($event)\"\n tabindex=\"-1\">\n <z-icon zType=\"lucideX\" zSize=\"18\" />\n </button>\n }\n\n @if (uiState().isValidating) {\n <z-icon zType=\"lucideLoader2\" zSize=\"18\" class=\"text-muted-foreground shrink-0 animate-spin\" />\n }\n\n <z-icon\n zType=\"lucideChevronDown\"\n zSize=\"18\"\n class=\"text-muted-foreground shrink-0 transition-transform duration-200\"\n [class.rotate-180]=\"uiState().isOpen\" />\n </div>\n\n @if (hasError()) {\n <p class=\"text-destructive animate-in fade-in slide-in-from-top-1 m-0 pt-2 text-xs duration-200\">\n {{ errorMessage() }}\n </p>\n }\n </div>\n\n <ng-template #dropdownTpl let-close=\"close\">\n <div\n [id]=\"dropdownId\"\n class=\"z-select-dropdown bg-popover border-border rounded-sm border shadow-[var(--z-popover-shadow)]\"\n [style.width.px]=\"dropdownWidth()\"\n [style.min-width.px]=\"dropdownWidth()\">\n @if (zShowSearch()) {\n <div class=\"border-border flex items-center border-b px-3\">\n <z-icon zType=\"lucideSearch\" zSize=\"18\" class=\"text-muted-foreground/50 mr-2 shrink-0\" />\n <input\n #dropdownSearchInput\n type=\"text\"\n class=\"placeholder:text-muted-foreground text-foreground flex h-10 w-full min-w-0 overflow-hidden bg-transparent py-3 text-sm text-ellipsis whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50\"\n [placeholder]=\"effectivePlaceholderSearch()\"\n [ngModel]=\"searchText()\"\n (ngModelChange)=\"onSearchChange($event)\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\" />\n </div>\n }\n\n @if (isLoading()) {\n <div class=\"flex items-center justify-center\" [style.height.px]=\"optionsMaxHeight()\">\n <z-loading [zLoading]=\"true\" zSize=\"default\" />\n </div>\n } @else {\n @if (filteredOptions().length > 0) {\n @if (shouldUseVirtualScroll()) {\n <div\n #virtualScrollElement\n class=\"z-select-options z-select-virtual-scroll overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.height.px]=\"optionsMaxHeight()\">\n <div class=\"z-select-virtual-inner relative\" [style.height.px]=\"virtualizer.getTotalSize()\">\n @for (virtualItem of virtualizer.getVirtualItems(); track virtualItem.index) {\n @let opt = filteredOptions()[virtualItem.index];\n <div\n #virtualOptionEl\n #optionEl\n [class]=\"\n 'z-select-option absolute right-0 left-0 min-w-0 ' +\n (opt\n | zIsSelected: currentValue() : isMultipleMode() : zKey()\n | zOptionClasses: opt.disabled : !!effectiveOptionTemplate())\n \"\n [attr.data-index]=\"virtualItem.index\"\n [style.display]=\"effectiveOptionTemplate() ? 'block' : null\"\n [style.height.px]=\"zDynamicSize() ? null : zOptionHeight()\"\n [style.minHeight.px]=\"zDynamicSize() ? zOptionHeight() : null\"\n [style.overflow]=\"effectiveOptionTemplate() ? 'visible' : null\"\n [style.transform]=\"'translateY(' + virtualItem.start + 'px)'\"\n (click)=\"selectOption(opt, close)\">\n @if (effectiveOptionTemplate()) {\n @let selected = opt | zIsSelected: currentValue() : isMultipleMode() : zKey();\n <div class=\"flex min-w-0 items-start gap-2\">\n <div class=\"min-w-0 flex-1\">\n <ng-container\n *ngTemplateOutlet=\"\n effectiveOptionTemplate()!;\n context: {\n $implicit: opt,\n selected: selected,\n }\n \" />\n </div>\n @if (zShowCheck() && selected) {\n <z-icon zType=\"lucideCheck\" zSize=\"16\" [zStrokeWidth]=\"4\" [class]=\"dropdownClasses()\" />\n }\n </div>\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 @if (zShowCheck() && (opt | zIsSelected: currentValue() : isMultipleMode() : zKey())) {\n <z-icon zType=\"lucideCheck\" zSize=\"16\" [zStrokeWidth]=\"4\" [class]=\"dropdownClasses()\" />\n }\n }\n </div>\n }\n </div>\n @if (isLoadingMore()) {\n <div\n class=\"bg-popover/80 absolute right-0 bottom-0 left-0 flex items-center justify-center py-2\"\n [style.transform]=\"'translateY(' + virtualizer.getTotalSize() + 'px)'\">\n <z-loading zSize=\"xs\" [zLoading]=\"true\" />\n </div>\n }\n </div>\n } @else {\n <div\n #optionsContainer\n class=\"z-select-options flex flex-col gap-0.75 overflow-x-hidden overflow-y-auto overscroll-y-contain p-1\"\n [style.maxHeight.px]=\"optionsMaxHeight()\">\n @for (opt of filteredOptions(); track opt.value) {\n <div\n #optionEl2\n [class]=\"\n 'z-select-option relative min-w-0 ' +\n (opt\n | zIsSelected: currentValue() : isMultipleMode() : zKey()\n | zOptionClasses: opt.disabled : !!effectiveOptionTemplate())\n \"\n [style.display]=\"effectiveOptionTemplate() ? 'block' : null\"\n [style.minHeight.px]=\"effectiveOptionTemplate() ? null : zOptionHeight()\"\n [style.overflow]=\"effectiveOptionTemplate() ? 'visible' : null\"\n (click)=\"selectOption(opt, close)\">\n @if (effectiveOptionTemplate()) {\n @let selected = opt | zIsSelected: currentValue() : isMultipleMode() : zKey();\n <div class=\"flex min-w-0 items-start gap-2\">\n <div class=\"min-w-0 flex-1\">\n <ng-container\n *ngTemplateOutlet=\"\n effectiveOptionTemplate()!;\n context: {\n $implicit: opt,\n selected: selected,\n }\n \" />\n </div>\n @if (zShowCheck() && selected) {\n <z-icon zType=\"lucideCheck\" zSize=\"18\" [zStrokeWidth]=\"4\" [class]=\"dropdownClasses()\" />\n }\n </div>\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 @if (zShowCheck() && (opt | zIsSelected: currentValue() : isMultipleMode() : zKey())) {\n <z-icon zType=\"lucideCheck\" zSize=\"18\" [zStrokeWidth]=\"4\" [class]=\"dropdownClasses()\" />\n }\n }\n </div>\n }\n @if (canLoadMore()) {\n <div #loadMoreSentinel class=\"h-px w-full shrink-0\"></div>\n }\n </div>\n }\n } @else {\n <div class=\"flex items-center justify-center p-1\" [style.height.px]=\"optionsMaxHeight()\">\n @if (isEmptyData()) {\n <z-empty [zIcon]=\"zEmptyIcon()\" zSize=\"sm\" [zMessage]=\"effectiveEmptyText()\" />\n } @else {\n <z-empty zIcon=\"lucideSearchX\" zSize=\"sm\" [zMessage]=\"effectiveNotFoundText()\" />\n }\n </div>\n }\n\n @if (isLoadingMore()) {\n <div class=\"z-select-loading-more border-border/50 flex items-center justify-center border-t py-1.5\">\n <z-loading zSize=\"xs\" [zLoading]=\"true\" />\n </div>\n }\n }\n\n @if (zShowAction() && (zActionTemplate() || isMultipleMode())) {\n <div class=\"border-border flex items-center gap-2 border-t px-2 py-1.5\">\n @if (zActionTemplate()) {\n <ng-container *ngTemplateOutlet=\"zActionTemplate()!\" />\n } @else {\n <z-button\n zSize=\"xs\"\n [zType]=\"isAllSelected() ? 'ghost-error' : 'ghost-info'\"\n class=\"min-w-0 flex-1\"\n (click)=\"toggleSelectAllAction()\"\n [zWave]=\"false\">\n <z-icon [zType]=\"isAllSelected() ? 'lucideX' : 'lucideCheckCheck'\" zSize=\"18\" class=\"shrink-0\" />\n <span class=\"truncate\">{{ isAllSelected() ? effectiveClearAllText() : effectiveSelectAllText() }}</span>\n </z-button>\n }\n </div>\n }\n </div>\n </ng-template>\n</div>\n", styles: [".z-select-trigger{-webkit-user-select:none;user-select:none}.z-select-trigger:focus{outline:none}.z-select-trigger *{cursor:inherit}.z-select-tag{-webkit-user-select:none;user-select:none;animation:z-select-tag-enter .2s cubic-bezier(.4,0,.2,1)}@keyframes z-select-tag-enter{0%{opacity:0;transform:scale(.8) translateY(.25rem)}to{opacity:1;transform:scale(1) translateY(0)}}.z-select-remaining{animation:z-select-remaining-enter .25s cubic-bezier(.4,0,.2,1)}@keyframes z-select-remaining-enter{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}.z-select-dropdown input{text-overflow:ellipsis;overflow:hidden}.z-select-options{overflow-x:hidden!important}.z-select-virtual-scroll .z-select-virtual-inner{width:100%}.z-select-loading-more{animation:z-select-loading-enter .2s ease-out}@keyframes z-select-loading-enter{0%{opacity:0;transform:translateY(-.25rem)}to{opacity:1;transform:translateY(0)}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[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: "component", type: ZIconComponent, selector: "z-icon, [z-icon]", inputs: ["class", "zType", "zAnimatedType", "zAnimate", "zAnimationTrigger", "zSize", "zStrokeWidth", "zSvg"] }, { 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: 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", "zAnimatedTypeIcon", "zAnimateIcon", "zAnimationTriggerIcon", "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", "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: 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 });
|
|
1418
1519
|
}
|
|
1419
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1520
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ZSelectComponent, decorators: [{
|
|
1420
1521
|
type: Component,
|
|
1421
1522
|
args: [{ selector: 'z-select', imports: [
|
|
1422
1523
|
FormsModule,
|