@cdevhub/ngx-tw 0.2.1 → 0.4.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/README.md +264 -49
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs +11 -7
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-alert.mjs +43 -29
- package/fesm2022/cdevhub-ngx-tw-alert.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-aspect-ratio.mjs +103 -0
- package/fesm2022/cdevhub-ngx-tw-aspect-ratio.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs +56 -31
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-badge.mjs +61 -35
- package/fesm2022/cdevhub-ngx-tw-badge.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs +154 -93
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-button.mjs +24 -15
- package/fesm2022/cdevhub-ngx-tw-button.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs +3 -3
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs +408 -215
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-card.mjs +33 -24
- package/fesm2022/cdevhub-ngx-tw-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs +144 -79
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs +99 -47
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs +34 -20
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs +46 -29
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs +195 -110
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs +140 -73
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-core.mjs +16 -11
- package/fesm2022/cdevhub-ngx-tw-core.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs +393 -149
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs +305 -150
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs +56 -43
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs +51 -33
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs +905 -0
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs +49 -26
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs +133 -74
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-icon-lucide.mjs +2 -2
- package/fesm2022/cdevhub-ngx-tw-icon-lucide.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-icon.mjs +28 -17
- package/fesm2022/cdevhub-ngx-tw-icon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-input.mjs +37 -21
- package/fesm2022/cdevhub-ngx-tw-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-item.mjs +33 -24
- package/fesm2022/cdevhub-ngx-tw-item.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-menu.mjs +63 -48
- package/fesm2022/cdevhub-ngx-tw-menu.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs +622 -0
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs +137 -71
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-popover.mjs +101 -46
- package/fesm2022/cdevhub-ngx-tw-popover.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs +57 -30
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-radio.mjs +108 -57
- package/fesm2022/cdevhub-ngx-tw-radio.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs +46 -26
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-select.mjs +217 -122
- package/fesm2022/cdevhub-ngx-tw-select.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-separator.mjs +21 -12
- package/fesm2022/cdevhub-ngx-tw-separator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs +58 -44
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-skeleton.mjs +25 -14
- package/fesm2022/cdevhub-ngx-tw-skeleton.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-slider.mjs +155 -79
- package/fesm2022/cdevhub-ngx-tw-slider.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-sort.mjs +44 -25
- package/fesm2022/cdevhub-ngx-tw-sort.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-spinner.mjs +29 -16
- package/fesm2022/cdevhub-ngx-tw-spinner.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-split.mjs +72 -42
- package/fesm2022/cdevhub-ngx-tw-split.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stat.mjs +107 -64
- package/fesm2022/cdevhub-ngx-tw-stat.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs +113 -47
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-switch.mjs +61 -32
- package/fesm2022/cdevhub-ngx-tw-switch.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs +88 -42
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-table.mjs +266 -118
- package/fesm2022/cdevhub-ngx-tw-table.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs +101 -51
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs +798 -0
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs +11 -7
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-theme.mjs +22 -14
- package/fesm2022/cdevhub-ngx-tw-theme.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs +243 -95
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs +149 -82
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-toast.mjs +89 -55
- package/fesm2022/cdevhub-ngx-tw-toast.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs +50 -28
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs +1129 -0
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-tree.mjs +554 -0
- package/fesm2022/cdevhub-ngx-tw-tree.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw.mjs +7 -0
- package/fesm2022/cdevhub-ngx-tw.mjs.map +1 -1
- package/index.json +1 -0
- package/package.json +45 -20
- package/theme/index.css +10 -2
- package/types/cdevhub-ngx-tw-aspect-ratio.d.ts +40 -0
- package/types/cdevhub-ngx-tw-calendar.d.ts +39 -8
- package/types/cdevhub-ngx-tw-command-palette.d.ts +7 -0
- package/types/cdevhub-ngx-tw-date-picker.d.ts +36 -10
- package/types/cdevhub-ngx-tw-file-upload.d.ts +250 -0
- package/types/cdevhub-ngx-tw-form-field.d.ts +22 -3
- package/types/cdevhub-ngx-tw-icon-lucide.d.ts +21 -3
- package/types/cdevhub-ngx-tw-number-input.d.ts +130 -0
- package/types/cdevhub-ngx-tw-popover.d.ts +8 -0
- package/types/cdevhub-ngx-tw-stepper.d.ts +30 -2
- package/types/cdevhub-ngx-tw-tab-nav.d.ts +8 -0
- package/types/cdevhub-ngx-tw-table.d.ts +30 -1
- package/types/cdevhub-ngx-tw-tabs.d.ts +8 -0
- package/types/cdevhub-ngx-tw-tags-input.d.ts +217 -0
- package/types/cdevhub-ngx-tw-time-picker.d.ts +31 -6
- package/types/cdevhub-ngx-tw-transfer.d.ts +330 -0
- package/types/cdevhub-ngx-tw-tree.d.ts +189 -0
- package/types/cdevhub-ngx-tw.d.ts +7 -0
|
@@ -10,7 +10,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
|
10
10
|
import { Subscription, merge } from 'rxjs';
|
|
11
11
|
import { tv } from 'tailwind-variants';
|
|
12
12
|
import { TW_ERROR_STATE_MATCHER, buildSelectLikePositions, resolveSelectScrollStrategy, consumeOverlayEscape } from '@cdevhub/ngx-tw/core';
|
|
13
|
-
import {
|
|
13
|
+
import { TW_FORM_FIELD, TW_FORM_FIELD_CONTROL } from '@cdevhub/ngx-tw/form-field';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Internal overlay panel for `tw-select`. Renders the header/search/listbox/empty/footer
|
|
@@ -21,76 +21,106 @@ class SelectOverlayComponent {
|
|
|
21
21
|
elementRef = inject((ElementRef));
|
|
22
22
|
// ── Config signals set by the parent component ──
|
|
23
23
|
/** @internal */
|
|
24
|
-
size = signal('md',
|
|
24
|
+
size = signal('md', /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
25
26
|
/** @internal */
|
|
26
|
-
color = signal('primary',
|
|
27
|
+
color = signal('primary', /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
27
29
|
/** @internal */
|
|
28
|
-
multiple = signal(false,
|
|
30
|
+
multiple = signal(false, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
29
32
|
/** @internal */
|
|
30
|
-
searchable = signal(false,
|
|
33
|
+
searchable = signal(false, /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
|
|
31
35
|
/** @internal */
|
|
32
|
-
panelMaxHeight = signal(256,
|
|
36
|
+
panelMaxHeight = signal(256, /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "panelMaxHeight" }] : /* istanbul ignore next */ []));
|
|
33
38
|
/** @internal */
|
|
34
|
-
emptyMessage = signal('No results',
|
|
39
|
+
emptyMessage = signal('No results', /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []));
|
|
35
41
|
/** @internal */
|
|
36
|
-
search = signal('',
|
|
42
|
+
search = signal('', /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []));
|
|
37
44
|
/** @internal */
|
|
38
|
-
activeIndex = signal(-1,
|
|
45
|
+
activeIndex = signal(-1, /* @ts-ignore */
|
|
46
|
+
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
39
47
|
/** @internal */
|
|
40
|
-
renderedRows = signal([],
|
|
48
|
+
renderedRows = signal([], /* @ts-ignore */
|
|
49
|
+
...(ngDevMode ? [{ debugName: "renderedRows" }] : /* istanbul ignore next */ []));
|
|
41
50
|
/** @internal */
|
|
42
|
-
visibleOptions = signal([],
|
|
51
|
+
visibleOptions = signal([], /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "visibleOptions" }] : /* istanbul ignore next */ []));
|
|
43
53
|
/** @internal */
|
|
44
|
-
optionTemplate = signal(undefined,
|
|
54
|
+
optionTemplate = signal(undefined, /* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [{ debugName: "optionTemplate" }] : /* istanbul ignore next */ []));
|
|
45
56
|
/** @internal */
|
|
46
|
-
emptyTemplate = signal(undefined,
|
|
57
|
+
emptyTemplate = signal(undefined, /* @ts-ignore */
|
|
58
|
+
...(ngDevMode ? [{ debugName: "emptyTemplate" }] : /* istanbul ignore next */ []));
|
|
47
59
|
/** @internal */
|
|
48
|
-
headerTemplate = signal(undefined,
|
|
60
|
+
headerTemplate = signal(undefined, /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []));
|
|
49
62
|
/** @internal */
|
|
50
|
-
footerTemplate = signal(undefined,
|
|
63
|
+
footerTemplate = signal(undefined, /* @ts-ignore */
|
|
64
|
+
...(ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []));
|
|
51
65
|
/** @internal */
|
|
52
|
-
optionLabelFn = signal(() => '',
|
|
66
|
+
optionLabelFn = signal(() => '', /* @ts-ignore */
|
|
67
|
+
...(ngDevMode ? [{ debugName: "optionLabelFn" }] : /* istanbul ignore next */ []));
|
|
53
68
|
/** @internal */
|
|
54
|
-
selectedChecker = signal(() => false,
|
|
69
|
+
selectedChecker = signal(() => false, /* @ts-ignore */
|
|
70
|
+
...(ngDevMode ? [{ debugName: "selectedChecker" }] : /* istanbul ignore next */ []));
|
|
55
71
|
/** @internal */
|
|
56
|
-
computeOptionClass = signal(() => '',
|
|
72
|
+
computeOptionClass = signal(() => '', /* @ts-ignore */
|
|
73
|
+
...(ngDevMode ? [{ debugName: "computeOptionClass" }] : /* istanbul ignore next */ []));
|
|
57
74
|
/** @internal */
|
|
58
|
-
checkmarkColorClass = signal('',
|
|
75
|
+
checkmarkColorClass = signal('', /* @ts-ignore */
|
|
76
|
+
...(ngDevMode ? [{ debugName: "checkmarkColorClass" }] : /* istanbul ignore next */ []));
|
|
59
77
|
/** @internal */
|
|
60
|
-
panelClassValue = signal('',
|
|
78
|
+
panelClassValue = signal('', /* @ts-ignore */
|
|
79
|
+
...(ngDevMode ? [{ debugName: "panelClassValue" }] : /* istanbul ignore next */ []));
|
|
61
80
|
/** @internal */
|
|
62
|
-
listboxId = signal('',
|
|
81
|
+
listboxId = signal('', /* @ts-ignore */
|
|
82
|
+
...(ngDevMode ? [{ debugName: "listboxId" }] : /* istanbul ignore next */ []));
|
|
63
83
|
/** @internal */
|
|
64
|
-
searchInputId = signal('',
|
|
84
|
+
searchInputId = signal('', /* @ts-ignore */
|
|
85
|
+
...(ngDevMode ? [{ debugName: "searchInputId" }] : /* istanbul ignore next */ []));
|
|
65
86
|
/** @internal */
|
|
66
|
-
optionIdFn = signal((i) => `option-${i}`,
|
|
87
|
+
optionIdFn = signal((i) => `option-${i}`, /* @ts-ignore */
|
|
88
|
+
...(ngDevMode ? [{ debugName: "optionIdFn" }] : /* istanbul ignore next */ []));
|
|
67
89
|
/** @internal */
|
|
68
|
-
leaving = signal(false,
|
|
90
|
+
leaving = signal(false, /* @ts-ignore */
|
|
91
|
+
...(ngDevMode ? [{ debugName: "leaving" }] : /* istanbul ignore next */ []));
|
|
69
92
|
// ── Callbacks set by the parent component ──
|
|
70
93
|
/** @internal */
|
|
71
|
-
onSearchInput = signal(() => { },
|
|
94
|
+
onSearchInput = signal(() => { }, /* @ts-ignore */
|
|
95
|
+
...(ngDevMode ? [{ debugName: "onSearchInput" }] : /* istanbul ignore next */ []));
|
|
72
96
|
/** @internal */
|
|
73
|
-
onOptionSelect = signal(() => { },
|
|
97
|
+
onOptionSelect = signal(() => { }, /* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [{ debugName: "onOptionSelect" }] : /* istanbul ignore next */ []));
|
|
74
99
|
/** @internal */
|
|
75
|
-
onOptionActivate = signal(() => { },
|
|
100
|
+
onOptionActivate = signal(() => { }, /* @ts-ignore */
|
|
101
|
+
...(ngDevMode ? [{ debugName: "onOptionActivate" }] : /* istanbul ignore next */ []));
|
|
76
102
|
/** @internal */
|
|
77
|
-
onPanelKeydown = signal(() => { },
|
|
103
|
+
onPanelKeydown = signal(() => { }, /* @ts-ignore */
|
|
104
|
+
...(ngDevMode ? [{ debugName: "onPanelKeydown" }] : /* istanbul ignore next */ []));
|
|
78
105
|
// ── View refs ──
|
|
79
|
-
searchInputRef = viewChild('searchInput',
|
|
106
|
+
searchInputRef = viewChild('searchInput', /* @ts-ignore */
|
|
107
|
+
...(ngDevMode ? [{ debugName: "searchInputRef" }] : /* istanbul ignore next */ []));
|
|
80
108
|
// ── Computed classes ──
|
|
81
109
|
/** @internal */
|
|
82
110
|
panelClasses = computed(() => {
|
|
83
111
|
const base = 'block w-full bg-surface-overlay border border-border rounded-lg shadow-md overflow-hidden flex flex-col';
|
|
84
112
|
const custom = this.panelClassValue();
|
|
85
113
|
return custom ? `${base} ${custom}` : base;
|
|
86
|
-
},
|
|
114
|
+
}, /* @ts-ignore */
|
|
115
|
+
...(ngDevMode ? [{ debugName: "panelClasses" }] : /* istanbul ignore next */ []));
|
|
87
116
|
/** @internal */
|
|
88
117
|
checkmarkClasses = computed(() => {
|
|
89
118
|
// xs/sm densities use `size-3.5` (14px) for the checkmark — the half-step
|
|
90
119
|
// is the only icon size that aligns with the surrounding text-xs metric.
|
|
91
120
|
const size = this.size() === 'xs' || this.size() === 'sm' ? 'size-3.5' : 'size-4';
|
|
92
121
|
return `${size} shrink-0 ml-auto ${this.checkmarkColorClass()}`;
|
|
93
|
-
},
|
|
122
|
+
}, /* @ts-ignore */
|
|
123
|
+
...(ngDevMode ? [{ debugName: "checkmarkClasses" }] : /* istanbul ignore next */ []));
|
|
94
124
|
// ── Template helpers ──
|
|
95
125
|
/** @internal */
|
|
96
126
|
isOptionDisabled(visibleIndex) {
|
|
@@ -149,8 +179,8 @@ class SelectOverlayComponent {
|
|
|
149
179
|
getElement() {
|
|
150
180
|
return this.elementRef.nativeElement;
|
|
151
181
|
}
|
|
152
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
153
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
182
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
183
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: SelectOverlayComponent, isStandalone: true, selector: "tw-select-overlay", host: { properties: { "class": "panelClasses()", "animate.enter": "\"scale-in\"", "animate.leave": "\"scale-out\"" } }, viewQueries: [{ propertyName: "searchInputRef", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
154
184
|
@if (headerTemplate(); as tpl) {
|
|
155
185
|
<div class="border-b border-border p-2">
|
|
156
186
|
<ng-container *ngTemplateOutlet="tpl.templateRef" />
|
|
@@ -255,7 +285,7 @@ class SelectOverlayComponent {
|
|
|
255
285
|
}
|
|
256
286
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
257
287
|
}
|
|
258
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectOverlayComponent, decorators: [{
|
|
259
289
|
type: Component,
|
|
260
290
|
args: [{
|
|
261
291
|
selector: 'tw-select-overlay',
|
|
@@ -473,10 +503,10 @@ class SelectOptionTemplateDirective {
|
|
|
473
503
|
static ngTemplateContextGuard(_dir, _ctx) {
|
|
474
504
|
return true;
|
|
475
505
|
}
|
|
476
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
477
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
506
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectOptionTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
507
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: SelectOptionTemplateDirective, isStandalone: true, selector: "[twSelectOption]", ngImport: i0 });
|
|
478
508
|
}
|
|
479
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
509
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectOptionTemplateDirective, decorators: [{
|
|
480
510
|
type: Directive,
|
|
481
511
|
args: [{ selector: '[twSelectOption]' }]
|
|
482
512
|
}] });
|
|
@@ -488,10 +518,10 @@ class SelectTriggerTemplateDirective {
|
|
|
488
518
|
static ngTemplateContextGuard(_dir, _ctx) {
|
|
489
519
|
return true;
|
|
490
520
|
}
|
|
491
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
492
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
521
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectTriggerTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
522
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: SelectTriggerTemplateDirective, isStandalone: true, selector: "[twSelectTrigger]", ngImport: i0 });
|
|
493
523
|
}
|
|
494
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
524
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectTriggerTemplateDirective, decorators: [{
|
|
495
525
|
type: Directive,
|
|
496
526
|
args: [{ selector: '[twSelectTrigger]' }]
|
|
497
527
|
}] });
|
|
@@ -503,10 +533,10 @@ class SelectEmptyTemplateDirective {
|
|
|
503
533
|
static ngTemplateContextGuard(_dir, _ctx) {
|
|
504
534
|
return true;
|
|
505
535
|
}
|
|
506
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
507
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
536
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectEmptyTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
537
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: SelectEmptyTemplateDirective, isStandalone: true, selector: "[twSelectEmpty]", ngImport: i0 });
|
|
508
538
|
}
|
|
509
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
539
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectEmptyTemplateDirective, decorators: [{
|
|
510
540
|
type: Directive,
|
|
511
541
|
args: [{ selector: '[twSelectEmpty]' }]
|
|
512
542
|
}] });
|
|
@@ -514,10 +544,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
514
544
|
class SelectHeaderTemplateDirective {
|
|
515
545
|
/** @internal */
|
|
516
546
|
templateRef = inject((TemplateRef));
|
|
517
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
518
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
547
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectHeaderTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
548
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: SelectHeaderTemplateDirective, isStandalone: true, selector: "[twSelectHeader]", ngImport: i0 });
|
|
519
549
|
}
|
|
520
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
550
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectHeaderTemplateDirective, decorators: [{
|
|
521
551
|
type: Directive,
|
|
522
552
|
args: [{ selector: '[twSelectHeader]' }]
|
|
523
553
|
}] });
|
|
@@ -525,10 +555,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
525
555
|
class SelectFooterTemplateDirective {
|
|
526
556
|
/** @internal */
|
|
527
557
|
templateRef = inject((TemplateRef));
|
|
528
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
529
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
558
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectFooterTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
559
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: SelectFooterTemplateDirective, isStandalone: true, selector: "[twSelectFooter]", ngImport: i0 });
|
|
530
560
|
}
|
|
531
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
561
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectFooterTemplateDirective, decorators: [{
|
|
532
562
|
type: Directive,
|
|
533
563
|
args: [{ selector: '[twSelectFooter]' }]
|
|
534
564
|
}] });
|
|
@@ -558,50 +588,69 @@ function defaultOptionGroup(o) {
|
|
|
558
588
|
*/
|
|
559
589
|
class SelectComponent {
|
|
560
590
|
/** Array of options to render in the panel. Accepts either `TwSelectOption<T>` objects or arbitrary records read via the accessor inputs. Defaults to an empty array. */
|
|
561
|
-
options = input([],
|
|
591
|
+
options = input([], /* @ts-ignore */
|
|
592
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
562
593
|
/** Accessor returning the visible label for an option. Override when passing arbitrary objects. */
|
|
563
|
-
optionLabel = input(defaultOptionLabel,
|
|
594
|
+
optionLabel = input(defaultOptionLabel, /* @ts-ignore */
|
|
595
|
+
...(ngDevMode ? [{ debugName: "optionLabel" }] : /* istanbul ignore next */ []));
|
|
564
596
|
/** Accessor returning the value for an option. The result is what `value` / `valueChange` emit. */
|
|
565
|
-
optionValue = input(defaultOptionValue,
|
|
597
|
+
optionValue = input(defaultOptionValue, /* @ts-ignore */
|
|
598
|
+
...(ngDevMode ? [{ debugName: "optionValue" }] : /* istanbul ignore next */ []));
|
|
566
599
|
/** Accessor returning the disabled state for an option. Defaults to reading `.disabled`. */
|
|
567
|
-
optionDisabled = input(defaultOptionDisabled,
|
|
600
|
+
optionDisabled = input(defaultOptionDisabled, /* @ts-ignore */
|
|
601
|
+
...(ngDevMode ? [{ debugName: "optionDisabled" }] : /* istanbul ignore next */ []));
|
|
568
602
|
/** Accessor returning the group name for an option. Options sharing a group render under a labelled `role="group"` region. */
|
|
569
|
-
optionGroup = input(defaultOptionGroup,
|
|
603
|
+
optionGroup = input(defaultOptionGroup, /* @ts-ignore */
|
|
604
|
+
...(ngDevMode ? [{ debugName: "optionGroup" }] : /* istanbul ignore next */ []));
|
|
570
605
|
/** When true, enables multi-selection. The `value` model becomes a `T[]` and the panel renders checkable options. Defaults to `false`. */
|
|
571
|
-
multiple = input(false,
|
|
606
|
+
multiple = input(false, /* @ts-ignore */
|
|
607
|
+
...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
572
608
|
/** When true, renders a search input at the top of the panel that filters options using `filterPredicate`. Defaults to `false`. */
|
|
573
|
-
searchable = input(false,
|
|
609
|
+
searchable = input(false, /* @ts-ignore */
|
|
610
|
+
...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
|
|
574
611
|
/** Custom filter function for the search input. Defaults to a case-insensitive substring match on the option label. */
|
|
575
612
|
filterPredicate = input((option, search) => {
|
|
576
613
|
const label = this.optionLabel()(option);
|
|
577
614
|
return label.toLowerCase().includes(search.toLowerCase());
|
|
578
|
-
},
|
|
615
|
+
}, /* @ts-ignore */
|
|
616
|
+
...(ngDevMode ? [{ debugName: "filterPredicate" }] : /* istanbul ignore next */ []));
|
|
579
617
|
/** Placeholder text shown in the trigger when no value is selected. */
|
|
580
|
-
placeholder = input(undefined,
|
|
618
|
+
placeholder = input(undefined, /* @ts-ignore */
|
|
619
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
581
620
|
/** When true, the trigger cannot be activated and the panel cannot open. Defaults to `false`. */
|
|
582
621
|
disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {}), alias: 'disabled' });
|
|
583
622
|
/** When true, exposes `aria-required="true"` on the trigger. Defaults to `false`. */
|
|
584
623
|
requiredInput = input(false, { ...(ngDevMode ? { debugName: "requiredInput" } : /* istanbul ignore next */ {}), alias: 'required' });
|
|
585
624
|
/** Controls trigger padding, font size, and panel option density. Defaults to `'md'`. */
|
|
586
|
-
size = input('md',
|
|
625
|
+
size = input('md', /* @ts-ignore */
|
|
626
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
587
627
|
/** Semantic color for focused trigger border, active-option background, and checkmarks. Defaults to `'primary'`. */
|
|
588
|
-
color = input('primary',
|
|
628
|
+
color = input('primary', /* @ts-ignore */
|
|
629
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
589
630
|
/** Visual style of the trigger. When inside a `tw-form-field` and left unset, auto-resolves to `'naked'`. Otherwise defaults to `'default'`. */
|
|
590
|
-
variant = input(undefined,
|
|
631
|
+
variant = input(undefined, /* @ts-ignore */
|
|
632
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
591
633
|
/** Overlay panel width. `'trigger'` matches the trigger's measured width; `'auto'` lets content decide; a number is applied as pixels; a string is passed through as a CSS length. Defaults to `'trigger'`. */
|
|
592
|
-
panelWidth = input('trigger',
|
|
634
|
+
panelWidth = input('trigger', /* @ts-ignore */
|
|
635
|
+
...(ngDevMode ? [{ debugName: "panelWidth" }] : /* istanbul ignore next */ []));
|
|
593
636
|
/** Extra class(es) applied to the overlay panel element. */
|
|
594
|
-
panelClass = input('',
|
|
637
|
+
panelClass = input('', /* @ts-ignore */
|
|
638
|
+
...(ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []));
|
|
595
639
|
/** Maximum height of the listbox scroll region in pixels. Defaults to `256`. */
|
|
596
|
-
panelMaxHeight = input(256,
|
|
640
|
+
panelMaxHeight = input(256, /* @ts-ignore */
|
|
641
|
+
...(ngDevMode ? [{ debugName: "panelMaxHeight" }] : /* istanbul ignore next */ []));
|
|
597
642
|
/** Whether the panel closes after a selection is made. When unset, resolves to `true` for single-select and `false` for multi-select. */
|
|
598
|
-
closeOnSelect = input(undefined,
|
|
643
|
+
closeOnSelect = input(undefined, /* @ts-ignore */
|
|
644
|
+
...(ngDevMode ? [{ debugName: "closeOnSelect" }] : /* istanbul ignore next */ []));
|
|
599
645
|
/** CDK scroll strategy for the overlay. Defaults to `'reposition'`. */
|
|
600
|
-
scrollStrategy = input('reposition',
|
|
646
|
+
scrollStrategy = input('reposition', /* @ts-ignore */
|
|
647
|
+
...(ngDevMode ? [{ debugName: "scrollStrategy" }] : /* istanbul ignore next */ []));
|
|
601
648
|
/** Pixel distance between trigger and panel. Defaults to `4`. */
|
|
602
|
-
offset = input(4,
|
|
649
|
+
offset = input(4, /* @ts-ignore */
|
|
650
|
+
...(ngDevMode ? [{ debugName: "offset" }] : /* istanbul ignore next */ []));
|
|
603
651
|
/** Fallback message rendered when the filter yields no options and no `*twSelectEmpty` template is provided. */
|
|
604
|
-
emptyMessage = input('No results',
|
|
652
|
+
emptyMessage = input('No results', /* @ts-ignore */
|
|
653
|
+
...(ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []));
|
|
605
654
|
/** Accessible name for the combobox trigger. */
|
|
606
655
|
ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
607
656
|
/** ID of an external element that labels the combobox. */
|
|
@@ -609,14 +658,18 @@ class SelectComponent {
|
|
|
609
658
|
/** ID of an external element that describes the combobox. */
|
|
610
659
|
ariaDescribedby = input(undefined, { ...(ngDevMode ? { debugName: "ariaDescribedby" } : /* istanbul ignore next */ {}), alias: 'aria-describedby' });
|
|
611
660
|
/** Per-instance override of the {@link ErrorStateMatcher}. When omitted, the select uses the `TW_ERROR_STATE_MATCHER` token's value. */
|
|
612
|
-
errorStateMatcher = input(undefined,
|
|
661
|
+
errorStateMatcher = input(undefined, /* @ts-ignore */
|
|
662
|
+
...(ngDevMode ? [{ debugName: "errorStateMatcher" }] : /* istanbul ignore next */ []));
|
|
613
663
|
/** Equality comparator for option values. Defaults to `Object.is`. */
|
|
614
|
-
compareWith = input(Object.is,
|
|
664
|
+
compareWith = input(Object.is, /* @ts-ignore */
|
|
665
|
+
...(ngDevMode ? [{ debugName: "compareWith" }] : /* istanbul ignore next */ []));
|
|
615
666
|
// ── Models (two-way) ──
|
|
616
667
|
/** Two-way bound selected value(s). Single-select: `T | null`. Multi-select: `T[]`. */
|
|
617
|
-
value = model(null,
|
|
668
|
+
value = model(null, /* @ts-ignore */
|
|
669
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
618
670
|
/** Two-way bound open state of the panel. */
|
|
619
|
-
open = model(false,
|
|
671
|
+
open = model(false, /* @ts-ignore */
|
|
672
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
620
673
|
// ── Outputs ──
|
|
621
674
|
/** Fires when the panel's visibility finishes changing. */
|
|
622
675
|
openedChange = output();
|
|
@@ -626,15 +679,20 @@ class SelectComponent {
|
|
|
626
679
|
searchChange = output();
|
|
627
680
|
// ── Content queries ──
|
|
628
681
|
/** @internal */
|
|
629
|
-
triggerTemplateChild = contentChild(SelectTriggerTemplateDirective,
|
|
682
|
+
triggerTemplateChild = contentChild(SelectTriggerTemplateDirective, /* @ts-ignore */
|
|
683
|
+
...(ngDevMode ? [{ debugName: "triggerTemplateChild" }] : /* istanbul ignore next */ []));
|
|
630
684
|
/** @internal */
|
|
631
|
-
optionTemplateChild = contentChild(SelectOptionTemplateDirective,
|
|
685
|
+
optionTemplateChild = contentChild(SelectOptionTemplateDirective, /* @ts-ignore */
|
|
686
|
+
...(ngDevMode ? [{ debugName: "optionTemplateChild" }] : /* istanbul ignore next */ []));
|
|
632
687
|
/** @internal */
|
|
633
|
-
emptyTemplateChild = contentChild(SelectEmptyTemplateDirective,
|
|
688
|
+
emptyTemplateChild = contentChild(SelectEmptyTemplateDirective, /* @ts-ignore */
|
|
689
|
+
...(ngDevMode ? [{ debugName: "emptyTemplateChild" }] : /* istanbul ignore next */ []));
|
|
634
690
|
/** @internal */
|
|
635
|
-
headerTemplateChild = contentChild(SelectHeaderTemplateDirective,
|
|
691
|
+
headerTemplateChild = contentChild(SelectHeaderTemplateDirective, /* @ts-ignore */
|
|
692
|
+
...(ngDevMode ? [{ debugName: "headerTemplateChild" }] : /* istanbul ignore next */ []));
|
|
636
693
|
/** @internal */
|
|
637
|
-
footerTemplateChild = contentChild(SelectFooterTemplateDirective,
|
|
694
|
+
footerTemplateChild = contentChild(SelectFooterTemplateDirective, /* @ts-ignore */
|
|
695
|
+
...(ngDevMode ? [{ debugName: "footerTemplateChild" }] : /* istanbul ignore next */ []));
|
|
638
696
|
// ── Injected deps ──
|
|
639
697
|
overlayService = inject(Overlay);
|
|
640
698
|
elementRef = inject((ElementRef));
|
|
@@ -644,7 +702,7 @@ class SelectComponent {
|
|
|
644
702
|
focusMonitor = inject(FocusMonitor);
|
|
645
703
|
liveAnnouncer = inject(LiveAnnouncer);
|
|
646
704
|
platform = inject(Platform);
|
|
647
|
-
formField = inject(
|
|
705
|
+
formField = inject(TW_FORM_FIELD, { optional: true });
|
|
648
706
|
ngControl = inject(NgControl, { optional: true, self: true });
|
|
649
707
|
parentForm = inject(NgForm, { optional: true });
|
|
650
708
|
parentFormGroup = inject(FormGroupDirective, { optional: true });
|
|
@@ -661,23 +719,34 @@ class SelectComponent {
|
|
|
661
719
|
optionId = (index) => `${this.hostId}-option-${index}`;
|
|
662
720
|
// ── Internal state signals ──
|
|
663
721
|
/** @internal */
|
|
664
|
-
internalValue = linkedSignal(() => this.value(),
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
/** @internal */
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
722
|
+
internalValue = linkedSignal(() => this.value(), /* @ts-ignore */
|
|
723
|
+
...(ngDevMode ? [{ debugName: "internalValue" }] : /* istanbul ignore next */ []));
|
|
724
|
+
/** @internal */
|
|
725
|
+
search = signal('', /* @ts-ignore */
|
|
726
|
+
...(ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []));
|
|
727
|
+
/** @internal */
|
|
728
|
+
activeIndex = signal(-1, /* @ts-ignore */
|
|
729
|
+
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
730
|
+
/** @internal */
|
|
731
|
+
focusedSignal = signal(false, /* @ts-ignore */
|
|
732
|
+
...(ngDevMode ? [{ debugName: "focusedSignal" }] : /* istanbul ignore next */ []));
|
|
733
|
+
cvaDisabled = signal(false, /* @ts-ignore */
|
|
734
|
+
...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
735
|
+
_ngControlRev = signal(0, /* @ts-ignore */
|
|
736
|
+
...(ngDevMode ? [{ debugName: "_ngControlRev" }] : /* istanbul ignore next */ []));
|
|
737
|
+
_formSubmitRev = signal(0, /* @ts-ignore */
|
|
738
|
+
...(ngDevMode ? [{ debugName: "_formSubmitRev" }] : /* istanbul ignore next */ []));
|
|
739
|
+
describedByIdsSignal = signal([], /* @ts-ignore */
|
|
740
|
+
...(ngDevMode ? [{ debugName: "describedByIdsSignal" }] : /* istanbul ignore next */ []));
|
|
741
|
+
labelledByIdsSignal = signal([], /* @ts-ignore */
|
|
742
|
+
...(ngDevMode ? [{ debugName: "labelledByIdsSignal" }] : /* istanbul ignore next */ []));
|
|
743
|
+
closingSignal = signal(false, /* @ts-ignore */
|
|
744
|
+
...(ngDevMode ? [{ debugName: "closingSignal" }] : /* istanbul ignore next */ []));
|
|
677
745
|
onChange = () => { };
|
|
678
746
|
onTouched = () => { };
|
|
679
747
|
overlayRef = null;
|
|
680
|
-
overlayInstanceSignal = signal(null,
|
|
748
|
+
overlayInstanceSignal = signal(null, /* @ts-ignore */
|
|
749
|
+
...(ngDevMode ? [{ debugName: "overlayInstanceSignal" }] : /* istanbul ignore next */ []));
|
|
681
750
|
perOpenSubs = null;
|
|
682
751
|
closeTimer = null;
|
|
683
752
|
resizeObserver = null;
|
|
@@ -686,16 +755,19 @@ class SelectComponent {
|
|
|
686
755
|
}
|
|
687
756
|
// ── Derived state ──
|
|
688
757
|
/** @internal */
|
|
689
|
-
isDisabled = computed(() => this.disabledInput() || this.cvaDisabled(),
|
|
758
|
+
isDisabled = computed(() => this.disabledInput() || this.cvaDisabled(), /* @ts-ignore */
|
|
759
|
+
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
690
760
|
/** @internal Effective variant — auto-naked when wrapped in tw-form-field. */
|
|
691
|
-
resolvedVariant = computed(() => this.variant() ?? (this.formField ? 'naked' : 'default'),
|
|
761
|
+
resolvedVariant = computed(() => this.variant() ?? (this.formField ? 'naked' : 'default'), /* @ts-ignore */
|
|
762
|
+
...(ngDevMode ? [{ debugName: "resolvedVariant" }] : /* istanbul ignore next */ []));
|
|
692
763
|
/** @internal */
|
|
693
764
|
isEmpty = computed(() => {
|
|
694
765
|
const v = this.internalValue();
|
|
695
766
|
if (this.multiple())
|
|
696
767
|
return !Array.isArray(v) || v.length === 0;
|
|
697
768
|
return v === null || v === undefined;
|
|
698
|
-
},
|
|
769
|
+
}, /* @ts-ignore */
|
|
770
|
+
...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
699
771
|
/** @internal Visible (filtered) options with resolved view data. */
|
|
700
772
|
visibleOptions = computed(() => {
|
|
701
773
|
const opts = this.options();
|
|
@@ -713,7 +785,8 @@ class SelectComponent {
|
|
|
713
785
|
disabled: disabledFn(option),
|
|
714
786
|
group: groupFn(option),
|
|
715
787
|
}));
|
|
716
|
-
},
|
|
788
|
+
}, /* @ts-ignore */
|
|
789
|
+
...(ngDevMode ? [{ debugName: "visibleOptions" }] : /* istanbul ignore next */ []));
|
|
717
790
|
/** @internal Rows rendered in the panel (group labels + options). */
|
|
718
791
|
renderedRows = computed(() => {
|
|
719
792
|
const visible = this.visibleOptions();
|
|
@@ -729,7 +802,8 @@ class SelectComponent {
|
|
|
729
802
|
rows.push({ kind: 'option', option: v.option, index, group: v.group });
|
|
730
803
|
});
|
|
731
804
|
return rows;
|
|
732
|
-
},
|
|
805
|
+
}, /* @ts-ignore */
|
|
806
|
+
...(ngDevMode ? [{ debugName: "renderedRows" }] : /* istanbul ignore next */ []));
|
|
733
807
|
/** @internal Resolved option objects that match the current value. */
|
|
734
808
|
selectedOptions = computed(() => {
|
|
735
809
|
const v = this.internalValue();
|
|
@@ -743,7 +817,8 @@ class SelectComponent {
|
|
|
743
817
|
return opts.filter((o) => arr.some((x) => cmp(valueFn(o), x)));
|
|
744
818
|
}
|
|
745
819
|
return opts.filter((o) => cmp(valueFn(o), v));
|
|
746
|
-
},
|
|
820
|
+
}, /* @ts-ignore */
|
|
821
|
+
...(ngDevMode ? [{ debugName: "selectedOptions" }] : /* istanbul ignore next */ []));
|
|
747
822
|
/** @internal */
|
|
748
823
|
defaultTriggerText = computed(() => {
|
|
749
824
|
const opts = this.selectedOptions();
|
|
@@ -751,9 +826,11 @@ class SelectComponent {
|
|
|
751
826
|
if (opts.length === 0)
|
|
752
827
|
return '';
|
|
753
828
|
return opts.map((o) => labelFn(o)).join(', ');
|
|
754
|
-
},
|
|
829
|
+
}, /* @ts-ignore */
|
|
830
|
+
...(ngDevMode ? [{ debugName: "defaultTriggerText" }] : /* istanbul ignore next */ []));
|
|
755
831
|
/** @internal */
|
|
756
|
-
showClearButton = computed(() => !this.isDisabled() && !this.isEmpty(),
|
|
832
|
+
showClearButton = computed(() => !this.isDisabled() && !this.isEmpty(), /* @ts-ignore */
|
|
833
|
+
...(ngDevMode ? [{ debugName: "showClearButton" }] : /* istanbul ignore next */ []));
|
|
757
834
|
/** @internal */
|
|
758
835
|
activeDescendantId = computed(() => {
|
|
759
836
|
if (!this.open())
|
|
@@ -762,7 +839,8 @@ class SelectComponent {
|
|
|
762
839
|
if (idx < 0 || idx >= this.visibleOptions().length)
|
|
763
840
|
return null;
|
|
764
841
|
return this.optionId(idx);
|
|
765
|
-
},
|
|
842
|
+
}, /* @ts-ignore */
|
|
843
|
+
...(ngDevMode ? [{ debugName: "activeDescendantId" }] : /* istanbul ignore next */ []));
|
|
766
844
|
/** @internal */
|
|
767
845
|
describedBy = computed(() => {
|
|
768
846
|
const extra = this.describedByIdsSignal();
|
|
@@ -771,7 +849,8 @@ class SelectComponent {
|
|
|
771
849
|
if (user)
|
|
772
850
|
merged.push(...user.split(/\s+/).filter(Boolean));
|
|
773
851
|
return merged.length ? merged.join(' ') : '';
|
|
774
|
-
},
|
|
852
|
+
}, /* @ts-ignore */
|
|
853
|
+
...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
775
854
|
/** @internal Merged `aria-labelledby`: form-field-pushed label ids + consumer-supplied `aria-labelledby`. */
|
|
776
855
|
labelledBy = computed(() => {
|
|
777
856
|
const extra = this.labelledByIdsSignal();
|
|
@@ -780,14 +859,16 @@ class SelectComponent {
|
|
|
780
859
|
if (user)
|
|
781
860
|
merged.push(...user.split(/\s+/).filter(Boolean));
|
|
782
861
|
return merged.length ? merged.join(' ') : '';
|
|
783
|
-
},
|
|
862
|
+
}, /* @ts-ignore */
|
|
863
|
+
...(ngDevMode ? [{ debugName: "labelledBy" }] : /* istanbul ignore next */ []));
|
|
784
864
|
/** @internal Resolved close-on-select behaviour. */
|
|
785
865
|
resolvedCloseOnSelect = computed(() => {
|
|
786
866
|
const explicit = this.closeOnSelect();
|
|
787
867
|
if (explicit !== undefined)
|
|
788
868
|
return explicit;
|
|
789
869
|
return !this.multiple();
|
|
790
|
-
},
|
|
870
|
+
}, /* @ts-ignore */
|
|
871
|
+
...(ngDevMode ? [{ debugName: "resolvedCloseOnSelect" }] : /* istanbul ignore next */ []));
|
|
791
872
|
// ── tv() output ──
|
|
792
873
|
variantResult = computed(() => selectVariants({
|
|
793
874
|
size: this.size(),
|
|
@@ -796,19 +877,26 @@ class SelectComponent {
|
|
|
796
877
|
disabled: this.isDisabled(),
|
|
797
878
|
focused: this.focusedSignal(),
|
|
798
879
|
color: this.color(),
|
|
799
|
-
}),
|
|
880
|
+
}), /* @ts-ignore */
|
|
881
|
+
...(ngDevMode ? [{ debugName: "variantResult" }] : /* istanbul ignore next */ []));
|
|
800
882
|
/** @internal */
|
|
801
|
-
rootClasses = computed(() => this.variantResult().root(),
|
|
883
|
+
rootClasses = computed(() => this.variantResult().root(), /* @ts-ignore */
|
|
884
|
+
...(ngDevMode ? [{ debugName: "rootClasses" }] : /* istanbul ignore next */ []));
|
|
802
885
|
/** @internal */
|
|
803
|
-
triggerClasses = computed(() => this.variantResult().trigger(),
|
|
886
|
+
triggerClasses = computed(() => this.variantResult().trigger(), /* @ts-ignore */
|
|
887
|
+
...(ngDevMode ? [{ debugName: "triggerClasses" }] : /* istanbul ignore next */ []));
|
|
804
888
|
/** @internal */
|
|
805
|
-
valueTextClasses = computed(() => this.variantResult().valueText(),
|
|
889
|
+
valueTextClasses = computed(() => this.variantResult().valueText(), /* @ts-ignore */
|
|
890
|
+
...(ngDevMode ? [{ debugName: "valueTextClasses" }] : /* istanbul ignore next */ []));
|
|
806
891
|
/** @internal */
|
|
807
|
-
placeholderTextClasses = computed(() => this.variantResult().placeholderText(),
|
|
892
|
+
placeholderTextClasses = computed(() => this.variantResult().placeholderText(), /* @ts-ignore */
|
|
893
|
+
...(ngDevMode ? [{ debugName: "placeholderTextClasses" }] : /* istanbul ignore next */ []));
|
|
808
894
|
/** @internal */
|
|
809
|
-
chevronClasses = computed(() => this.variantResult().chevron(),
|
|
895
|
+
chevronClasses = computed(() => this.variantResult().chevron(), /* @ts-ignore */
|
|
896
|
+
...(ngDevMode ? [{ debugName: "chevronClasses" }] : /* istanbul ignore next */ []));
|
|
810
897
|
/** @internal */
|
|
811
|
-
clearButtonClasses = computed(() => this.variantResult().clearButton(),
|
|
898
|
+
clearButtonClasses = computed(() => this.variantResult().clearButton(), /* @ts-ignore */
|
|
899
|
+
...(ngDevMode ? [{ debugName: "clearButtonClasses" }] : /* istanbul ignore next */ []));
|
|
812
900
|
/** @internal */
|
|
813
901
|
optionSizeClass = computed(() => {
|
|
814
902
|
switch (this.size()) {
|
|
@@ -823,9 +911,11 @@ class SelectComponent {
|
|
|
823
911
|
case 'xl':
|
|
824
912
|
return 'px-4 py-3 text-base';
|
|
825
913
|
}
|
|
826
|
-
},
|
|
914
|
+
}, /* @ts-ignore */
|
|
915
|
+
...(ngDevMode ? [{ debugName: "optionSizeClass" }] : /* istanbul ignore next */ []));
|
|
827
916
|
/** @internal */
|
|
828
|
-
checkmarkColorClass = computed(() => OPTION_CHECKMARK_COLOR[this.color()],
|
|
917
|
+
checkmarkColorClass = computed(() => OPTION_CHECKMARK_COLOR[this.color()], /* @ts-ignore */
|
|
918
|
+
...(ngDevMode ? [{ debugName: "checkmarkColorClass" }] : /* istanbul ignore next */ []));
|
|
829
919
|
/** @internal Class string applied to each option row. */
|
|
830
920
|
computeOptionClass = (selected, active, disabled) => {
|
|
831
921
|
const sizeClass = this.optionSizeClass();
|
|
@@ -848,7 +938,8 @@ class SelectComponent {
|
|
|
848
938
|
};
|
|
849
939
|
// ── FormFieldControl impl (readonly signals) ──
|
|
850
940
|
/** @internal */
|
|
851
|
-
id = computed(() => this.hostId,
|
|
941
|
+
id = computed(() => this.hostId, /* @ts-ignore */
|
|
942
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
852
943
|
/** @internal */
|
|
853
944
|
focused = this.focusedSignal.asReadonly();
|
|
854
945
|
/** @internal */
|
|
@@ -856,7 +947,8 @@ class SelectComponent {
|
|
|
856
947
|
/** @internal */
|
|
857
948
|
disabled = this.isDisabled;
|
|
858
949
|
/** @internal */
|
|
859
|
-
required = computed(() => this.requiredInput(),
|
|
950
|
+
required = computed(() => this.requiredInput(), /* @ts-ignore */
|
|
951
|
+
...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
860
952
|
/** @internal Error-state per the configured `ErrorStateMatcher`. Reads the bound `NgControl.invalid` through the matcher. */
|
|
861
953
|
errorState = computed(() => {
|
|
862
954
|
this._ngControlRev();
|
|
@@ -865,13 +957,16 @@ class SelectComponent {
|
|
|
865
957
|
const form = this.parentFormGroup ??
|
|
866
958
|
this.parentForm;
|
|
867
959
|
return matcher.isErrorState(this.ngControl?.control ?? null, form);
|
|
868
|
-
},
|
|
960
|
+
}, /* @ts-ignore */
|
|
961
|
+
...(ngDevMode ? [{ debugName: "errorState" }] : /* istanbul ignore next */ []));
|
|
869
962
|
/** @internal */
|
|
870
963
|
controlType = 'select';
|
|
871
964
|
/** @internal */
|
|
872
|
-
userAriaDescribedBy = computed(() => this.ariaDescribedby(),
|
|
965
|
+
userAriaDescribedBy = computed(() => this.ariaDescribedby(), /* @ts-ignore */
|
|
966
|
+
...(ngDevMode ? [{ debugName: "userAriaDescribedBy" }] : /* istanbul ignore next */ []));
|
|
873
967
|
/** @internal */
|
|
874
|
-
userAriaLabelledby = computed(() => this.ariaLabelledby(),
|
|
968
|
+
userAriaLabelledby = computed(() => this.ariaLabelledby(), /* @ts-ignore */
|
|
969
|
+
...(ngDevMode ? [{ debugName: "userAriaLabelledby" }] : /* istanbul ignore next */ []));
|
|
875
970
|
/** @internal Public read-only view of the current value for FormFieldControl. */
|
|
876
971
|
// Overriding `value` typing from the model by using an explicit computed that matches the abstract signature.
|
|
877
972
|
// (The model `value` property is a WritableSignal<T | readonly T[] | null>; FormFieldControl needs a Signal<T | readonly T[] | null>.
|
|
@@ -965,7 +1060,7 @@ class SelectComponent {
|
|
|
965
1060
|
return;
|
|
966
1061
|
const hasLabel = !!this.ariaLabel() ||
|
|
967
1062
|
!!this.ariaLabelledby() ||
|
|
968
|
-
!!this.formField?.
|
|
1063
|
+
!!this.formField?.hasLabel() ||
|
|
969
1064
|
!!this.triggerTemplateChild();
|
|
970
1065
|
if (!hasLabel) {
|
|
971
1066
|
console.warn('[tw-select] The select has no accessible name. Set aria-label, aria-labelledby, wrap in <tw-form-field> with a <label twLabel>, or project a *twSelectTrigger template.');
|
|
@@ -1555,8 +1650,8 @@ class SelectComponent {
|
|
|
1555
1650
|
.subscribe(() => this._formSubmitRev.update((n) => n + 1));
|
|
1556
1651
|
}
|
|
1557
1652
|
}
|
|
1558
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1559
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1653
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1654
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: SelectComponent, isStandalone: true, selector: "tw-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null }, optionGroup: { classPropertyName: "optionGroup", publicName: "optionGroup", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, filterPredicate: { classPropertyName: "filterPredicate", publicName: "filterPredicate", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, requiredInput: { classPropertyName: "requiredInput", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, panelMaxHeight: { classPropertyName: "panelMaxHeight", publicName: "panelMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, scrollStrategy: { classPropertyName: "scrollStrategy", publicName: "scrollStrategy", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", open: "openChange", openedChange: "openedChange", selectionChange: "selectionChange", searchChange: "searchChange" }, host: { properties: { "class": "rootClasses()" } }, providers: [
|
|
1560
1655
|
{
|
|
1561
1656
|
provide: TW_FORM_FIELD_CONTROL,
|
|
1562
1657
|
useExisting: forwardRef(() => SelectComponent),
|
|
@@ -1634,7 +1729,7 @@ class SelectComponent {
|
|
|
1634
1729
|
</span>
|
|
1635
1730
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1636
1731
|
}
|
|
1637
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1732
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SelectComponent, decorators: [{
|
|
1638
1733
|
type: Component,
|
|
1639
1734
|
args: [{
|
|
1640
1735
|
selector: 'tw-select',
|