@angular/aria 22.0.0-next.6 → 22.0.0-next.8
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/_accordion-chunk.mjs +1 -1
- package/fesm2022/_accordion-chunk.mjs.map +1 -1
- package/fesm2022/_click-event-manager-chunk.mjs +1 -1
- package/fesm2022/_click-event-manager-chunk.mjs.map +1 -1
- package/fesm2022/{_signal-like-chunk.mjs → _collection-chunk.mjs} +51 -3
- package/fesm2022/_collection-chunk.mjs.map +1 -0
- package/fesm2022/_deferred-content-chunk.mjs +16 -14
- package/fesm2022/_deferred-content-chunk.mjs.map +1 -1
- package/fesm2022/_expansion-chunk.mjs.map +1 -1
- package/fesm2022/_list-chunk.mjs +4 -1
- package/fesm2022/_list-chunk.mjs.map +1 -1
- package/fesm2022/_list-navigation-chunk.mjs +4 -2
- package/fesm2022/_list-navigation-chunk.mjs.map +1 -1
- package/fesm2022/_list-typeahead-chunk.mjs +1 -1
- package/fesm2022/_list-typeahead-chunk.mjs.map +1 -1
- package/fesm2022/_menu-chunk.mjs +1 -1
- package/fesm2022/_menu-chunk.mjs.map +1 -1
- package/fesm2022/{_combobox-listbox-chunk.mjs → _option-chunk.mjs} +6 -50
- package/fesm2022/_option-chunk.mjs.map +1 -0
- package/fesm2022/_tabs-chunk.mjs +22 -47
- package/fesm2022/_tabs-chunk.mjs.map +1 -1
- package/fesm2022/_toolbar-widget-group-chunk.mjs +1 -1
- package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
- package/fesm2022/_transforms-chunk.mjs +8 -0
- package/fesm2022/_transforms-chunk.mjs.map +1 -0
- package/fesm2022/{_combobox-tree-chunk.mjs → _tree-chunk.mjs} +3 -48
- package/fesm2022/_tree-chunk.mjs.map +1 -0
- package/fesm2022/_widget-chunk.mjs +84 -21
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion-testing.mjs.map +1 -1
- package/fesm2022/accordion.mjs +32 -57
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox-testing.mjs +79 -0
- package/fesm2022/combobox-testing.mjs.map +1 -0
- package/fesm2022/combobox.mjs +287 -296
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid-testing.mjs +80 -0
- package/fesm2022/grid-testing.mjs.map +1 -0
- package/fesm2022/grid.mjs +113 -86
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox-testing.mjs +4 -0
- package/fesm2022/listbox-testing.mjs.map +1 -1
- package/fesm2022/listbox.mjs +231 -225
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs +11 -0
- package/fesm2022/menu-testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +66 -84
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +166 -9
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs-testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +241 -222
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs +5 -1
- package/fesm2022/toolbar-testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +23 -33
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs +12 -0
- package/fesm2022/tree-testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +160 -156
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +10 -2
- package/types/_accordion-chunk.d.ts +2 -2
- package/types/_collection-chunk.d.ts +42 -0
- package/types/_expansion-chunk.d.ts +1 -1
- package/types/_grid-chunk.d.ts +23 -9
- package/types/_keyboard-event-manager-chunk.d.ts +1 -1
- package/types/_list-chunk.d.ts +1 -1
- package/types/_list-navigation-chunk.d.ts +1 -1
- package/types/_listbox-chunk.d.ts +1 -1
- package/types/_menu-chunk.d.ts +1 -1
- package/types/_tabs-chunk.d.ts +8 -43
- package/types/_toolbar-chunk.d.ts +1 -1
- package/types/_tree-chunk.d.ts +1 -1
- package/types/accordion.d.ts +7 -13
- package/types/combobox-testing.d.ts +63 -0
- package/types/combobox.d.ts +96 -192
- package/types/grid-testing.d.ts +83 -0
- package/types/grid.d.ts +102 -90
- package/types/listbox-testing.d.ts +25 -0
- package/types/listbox.d.ts +60 -63
- package/types/menu-testing.d.ts +6 -0
- package/types/menu.d.ts +24 -17
- package/types/private.d.ts +115 -133
- package/types/tabs.d.ts +26 -24
- package/types/toolbar-testing.d.ts +4 -0
- package/types/toolbar.d.ts +5 -6
- package/types/tree-testing.d.ts +8 -0
- package/types/tree.d.ts +11 -15
- package/fesm2022/_combobox-chunk.mjs +0 -429
- package/fesm2022/_combobox-chunk.mjs.map +0 -1
- package/fesm2022/_combobox-listbox-chunk.mjs.map +0 -1
- package/fesm2022/_combobox-tree-chunk.mjs.map +0 -1
- package/fesm2022/_element-chunk.mjs +0 -6
- package/fesm2022/_element-chunk.mjs.map +0 -1
- package/fesm2022/_pointer-event-manager-chunk.mjs +0 -54
- package/fesm2022/_pointer-event-manager-chunk.mjs.map +0 -1
- package/fesm2022/_signal-like-chunk.mjs.map +0 -1
- package/resources/code-examples.db +0 -0
- package/types/_combobox-chunk.d.ts +0 -194
- package/types/_element-chunk.d.ts +0 -10
- package/types/_pointer-event-manager-chunk.d.ts +0 -34
- package/types/_signal-like-chunk.d.ts +0 -14
package/fesm2022/listbox.mjs
CHANGED
|
@@ -1,195 +1,26 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, ElementRef,
|
|
2
|
+
import { InjectionToken, input, inject, ElementRef, booleanAttribute, model, computed, signal, afterNextRender, afterRenderEffect, untracked, Directive } from '@angular/core';
|
|
3
3
|
import { Directionality } from '@angular/cdk/bidi';
|
|
4
4
|
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import './_signal-like-chunk.mjs';
|
|
9
|
-
import '@angular/core/primitives/signals';
|
|
5
|
+
import { ListboxPattern, OptionPattern } from './_option-chunk.mjs';
|
|
6
|
+
import { SortedCollection } from './_collection-chunk.mjs';
|
|
7
|
+
import { tabIndexTransform } from './_transforms-chunk.mjs';
|
|
10
8
|
import './_list-chunk.mjs';
|
|
11
9
|
import './_list-navigation-chunk.mjs';
|
|
12
10
|
import './_list-typeahead-chunk.mjs';
|
|
13
11
|
import './_click-event-manager-chunk.mjs';
|
|
14
|
-
import '
|
|
15
|
-
import './_combobox-chunk.mjs';
|
|
16
|
-
import './_pointer-event-manager-chunk.mjs';
|
|
12
|
+
import '@angular/core/primitives/signals';
|
|
17
13
|
|
|
18
14
|
const LISTBOX = new InjectionToken('LISTBOX');
|
|
19
15
|
|
|
20
|
-
class Option {
|
|
21
|
-
element = inject(ElementRef).nativeElement;
|
|
22
|
-
active = computed(() => this._pattern.active(), ...(ngDevMode ? [{
|
|
23
|
-
debugName: "active"
|
|
24
|
-
}] : []));
|
|
25
|
-
_listbox = inject(LISTBOX);
|
|
26
|
-
id = input(inject(_IdGenerator).getId('ng-option-', true), ...(ngDevMode ? [{
|
|
27
|
-
debugName: "id"
|
|
28
|
-
}] : []));
|
|
29
|
-
searchTerm = computed(() => this.label() ?? this.element.textContent, ...(ngDevMode ? [{
|
|
30
|
-
debugName: "searchTerm"
|
|
31
|
-
}] : []));
|
|
32
|
-
_listboxPattern = computed(() => this._listbox._pattern, ...(ngDevMode ? [{
|
|
33
|
-
debugName: "_listboxPattern"
|
|
34
|
-
}] : []));
|
|
35
|
-
value = input.required(...(ngDevMode ? [{
|
|
36
|
-
debugName: "value"
|
|
37
|
-
}] : []));
|
|
38
|
-
disabled = input(false, {
|
|
39
|
-
...(ngDevMode ? {
|
|
40
|
-
debugName: "disabled"
|
|
41
|
-
} : {}),
|
|
42
|
-
transform: booleanAttribute
|
|
43
|
-
});
|
|
44
|
-
label = input(...(ngDevMode ? [undefined, {
|
|
45
|
-
debugName: "label"
|
|
46
|
-
}] : []));
|
|
47
|
-
selected = computed(() => this._pattern.selected(), ...(ngDevMode ? [{
|
|
48
|
-
debugName: "selected"
|
|
49
|
-
}] : []));
|
|
50
|
-
_pattern = new OptionPattern({
|
|
51
|
-
...this,
|
|
52
|
-
id: this.id,
|
|
53
|
-
value: this.value,
|
|
54
|
-
listbox: this._listboxPattern,
|
|
55
|
-
element: () => this.element,
|
|
56
|
-
searchTerm: () => this.searchTerm() ?? ''
|
|
57
|
-
});
|
|
58
|
-
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
59
|
-
minVersion: "12.0.0",
|
|
60
|
-
version: "22.0.0-next.6",
|
|
61
|
-
ngImport: i0,
|
|
62
|
-
type: Option,
|
|
63
|
-
deps: [],
|
|
64
|
-
target: i0.ɵɵFactoryTarget.Directive
|
|
65
|
-
});
|
|
66
|
-
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
67
|
-
minVersion: "17.1.0",
|
|
68
|
-
version: "22.0.0-next.6",
|
|
69
|
-
type: Option,
|
|
70
|
-
isStandalone: true,
|
|
71
|
-
selector: "[ngOption]",
|
|
72
|
-
inputs: {
|
|
73
|
-
id: {
|
|
74
|
-
classPropertyName: "id",
|
|
75
|
-
publicName: "id",
|
|
76
|
-
isSignal: true,
|
|
77
|
-
isRequired: false,
|
|
78
|
-
transformFunction: null
|
|
79
|
-
},
|
|
80
|
-
value: {
|
|
81
|
-
classPropertyName: "value",
|
|
82
|
-
publicName: "value",
|
|
83
|
-
isSignal: true,
|
|
84
|
-
isRequired: true,
|
|
85
|
-
transformFunction: null
|
|
86
|
-
},
|
|
87
|
-
disabled: {
|
|
88
|
-
classPropertyName: "disabled",
|
|
89
|
-
publicName: "disabled",
|
|
90
|
-
isSignal: true,
|
|
91
|
-
isRequired: false,
|
|
92
|
-
transformFunction: null
|
|
93
|
-
},
|
|
94
|
-
label: {
|
|
95
|
-
classPropertyName: "label",
|
|
96
|
-
publicName: "label",
|
|
97
|
-
isSignal: true,
|
|
98
|
-
isRequired: false,
|
|
99
|
-
transformFunction: null
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
host: {
|
|
103
|
-
attributes: {
|
|
104
|
-
"role": "option"
|
|
105
|
-
},
|
|
106
|
-
properties: {
|
|
107
|
-
"attr.data-active": "active()",
|
|
108
|
-
"attr.id": "_pattern.id()",
|
|
109
|
-
"attr.tabindex": "_pattern.tabIndex()",
|
|
110
|
-
"attr.aria-selected": "_pattern.selected()",
|
|
111
|
-
"attr.aria-disabled": "_pattern.disabled()"
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
exportAs: ["ngOption"],
|
|
115
|
-
ngImport: i0
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
119
|
-
minVersion: "12.0.0",
|
|
120
|
-
version: "22.0.0-next.6",
|
|
121
|
-
ngImport: i0,
|
|
122
|
-
type: Option,
|
|
123
|
-
decorators: [{
|
|
124
|
-
type: Directive,
|
|
125
|
-
args: [{
|
|
126
|
-
selector: '[ngOption]',
|
|
127
|
-
exportAs: 'ngOption',
|
|
128
|
-
host: {
|
|
129
|
-
'role': 'option',
|
|
130
|
-
'[attr.data-active]': 'active()',
|
|
131
|
-
'[attr.id]': '_pattern.id()',
|
|
132
|
-
'[attr.tabindex]': '_pattern.tabIndex()',
|
|
133
|
-
'[attr.aria-selected]': '_pattern.selected()',
|
|
134
|
-
'[attr.aria-disabled]': '_pattern.disabled()'
|
|
135
|
-
}
|
|
136
|
-
}]
|
|
137
|
-
}],
|
|
138
|
-
propDecorators: {
|
|
139
|
-
id: [{
|
|
140
|
-
type: i0.Input,
|
|
141
|
-
args: [{
|
|
142
|
-
isSignal: true,
|
|
143
|
-
alias: "id",
|
|
144
|
-
required: false
|
|
145
|
-
}]
|
|
146
|
-
}],
|
|
147
|
-
value: [{
|
|
148
|
-
type: i0.Input,
|
|
149
|
-
args: [{
|
|
150
|
-
isSignal: true,
|
|
151
|
-
alias: "value",
|
|
152
|
-
required: true
|
|
153
|
-
}]
|
|
154
|
-
}],
|
|
155
|
-
disabled: [{
|
|
156
|
-
type: i0.Input,
|
|
157
|
-
args: [{
|
|
158
|
-
isSignal: true,
|
|
159
|
-
alias: "disabled",
|
|
160
|
-
required: false
|
|
161
|
-
}]
|
|
162
|
-
}],
|
|
163
|
-
label: [{
|
|
164
|
-
type: i0.Input,
|
|
165
|
-
args: [{
|
|
166
|
-
isSignal: true,
|
|
167
|
-
alias: "label",
|
|
168
|
-
required: false
|
|
169
|
-
}]
|
|
170
|
-
}]
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
|
|
174
16
|
class Listbox {
|
|
175
17
|
id = input(inject(_IdGenerator).getId('ng-listbox-', true), ...(ngDevMode ? [{
|
|
176
18
|
debugName: "id"
|
|
177
19
|
}] : []));
|
|
178
|
-
_popup = inject(ComboboxPopup, {
|
|
179
|
-
optional: true
|
|
180
|
-
});
|
|
181
20
|
_elementRef = inject(ElementRef);
|
|
182
21
|
element = this._elementRef.nativeElement;
|
|
183
|
-
|
|
184
|
-
...(ngDevMode ? {
|
|
185
|
-
debugName: "_options"
|
|
186
|
-
} : {}),
|
|
187
|
-
descendants: true
|
|
188
|
-
});
|
|
22
|
+
_collection = new SortedCollection();
|
|
189
23
|
textDirection = inject(Directionality).valueSignal.asReadonly();
|
|
190
|
-
items = computed(() => this._options().map(option => option._pattern), ...(ngDevMode ? [{
|
|
191
|
-
debugName: "items"
|
|
192
|
-
}] : []));
|
|
193
24
|
orientation = input('vertical', ...(ngDevMode ? [{
|
|
194
25
|
debugName: "orientation"
|
|
195
26
|
}] : []));
|
|
@@ -232,50 +63,72 @@ class Listbox {
|
|
|
232
63
|
} : {}),
|
|
233
64
|
transform: booleanAttribute
|
|
234
65
|
});
|
|
66
|
+
tabIndex = input(undefined, {
|
|
67
|
+
...(ngDevMode ? {
|
|
68
|
+
debugName: "tabIndex"
|
|
69
|
+
} : {}),
|
|
70
|
+
alias: 'tabindex',
|
|
71
|
+
transform: tabIndexTransform
|
|
72
|
+
});
|
|
235
73
|
value = model([], ...(ngDevMode ? [{
|
|
236
74
|
debugName: "value"
|
|
237
75
|
}] : []));
|
|
238
76
|
_pattern;
|
|
77
|
+
activeDescendant;
|
|
239
78
|
constructor() {
|
|
79
|
+
const orderedItemPatterns = computed(() => this._collection.orderedItems().map(option => option._pattern), ...(ngDevMode ? [{
|
|
80
|
+
debugName: "orderedItemPatterns"
|
|
81
|
+
}] : []));
|
|
240
82
|
const inputs = {
|
|
241
83
|
...this,
|
|
242
84
|
id: this.id,
|
|
243
|
-
items:
|
|
85
|
+
items: orderedItemPatterns,
|
|
244
86
|
activeItem: signal(undefined),
|
|
245
87
|
textDirection: this.textDirection,
|
|
246
|
-
element: () => this._elementRef.nativeElement
|
|
247
|
-
combobox: () => this._popup?.combobox?._pattern
|
|
88
|
+
element: () => this._elementRef.nativeElement
|
|
248
89
|
};
|
|
249
|
-
this._pattern =
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
90
|
+
this._pattern = new ListboxPattern(inputs);
|
|
91
|
+
this.activeDescendant = computed(() => this._pattern.activeDescendant(), ...(ngDevMode ? [{
|
|
92
|
+
debugName: "activeDescendant"
|
|
93
|
+
}] : []));
|
|
94
|
+
afterNextRender(() => {
|
|
95
|
+
this._collection.startObserving(this.element);
|
|
96
|
+
});
|
|
97
|
+
afterRenderEffect({
|
|
98
|
+
read: () => {
|
|
99
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
100
|
+
const violations = this._pattern.validate();
|
|
101
|
+
for (const violation of violations) {
|
|
102
|
+
console.error(violation);
|
|
103
|
+
}
|
|
258
104
|
}
|
|
259
105
|
}
|
|
260
106
|
});
|
|
261
|
-
afterRenderEffect(
|
|
262
|
-
this._pattern.setDefaultStateEffect()
|
|
107
|
+
afterRenderEffect({
|
|
108
|
+
write: () => this._pattern.setDefaultStateEffect()
|
|
263
109
|
});
|
|
264
|
-
afterRenderEffect(
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
110
|
+
afterRenderEffect({
|
|
111
|
+
write: () => {
|
|
112
|
+
const items = inputs.items();
|
|
113
|
+
const activeItem = untracked(() => inputs.activeItem());
|
|
114
|
+
if (!items.some(i => i === activeItem) && activeItem) {
|
|
115
|
+
this._pattern.listBehavior.unfocus();
|
|
116
|
+
}
|
|
269
117
|
}
|
|
270
118
|
});
|
|
271
|
-
afterRenderEffect(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
119
|
+
afterRenderEffect({
|
|
120
|
+
write: () => {
|
|
121
|
+
const items = inputs.items();
|
|
122
|
+
const value = untracked(() => this.value());
|
|
123
|
+
if (items && value.some(v => !items.some(i => i.value() === v))) {
|
|
124
|
+
this.value.set(value.filter(v => items.some(i => i.value() === v)));
|
|
125
|
+
}
|
|
276
126
|
}
|
|
277
127
|
});
|
|
278
128
|
}
|
|
129
|
+
ngOnDestroy() {
|
|
130
|
+
this._collection.stopObserving();
|
|
131
|
+
}
|
|
279
132
|
scrollActiveItemIntoView(options = {
|
|
280
133
|
block: 'nearest'
|
|
281
134
|
}) {
|
|
@@ -286,15 +139,15 @@ class Listbox {
|
|
|
286
139
|
}
|
|
287
140
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
288
141
|
minVersion: "12.0.0",
|
|
289
|
-
version: "22.0.0-next.
|
|
142
|
+
version: "22.0.0-next.10",
|
|
290
143
|
ngImport: i0,
|
|
291
144
|
type: Listbox,
|
|
292
145
|
deps: [],
|
|
293
146
|
target: i0.ɵɵFactoryTarget.Directive
|
|
294
147
|
});
|
|
295
148
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
296
|
-
minVersion: "17.
|
|
297
|
-
version: "22.0.0-next.
|
|
149
|
+
minVersion: "17.1.0",
|
|
150
|
+
version: "22.0.0-next.10",
|
|
298
151
|
type: Listbox,
|
|
299
152
|
isStandalone: true,
|
|
300
153
|
selector: "[ngListbox]",
|
|
@@ -369,6 +222,13 @@ class Listbox {
|
|
|
369
222
|
isRequired: false,
|
|
370
223
|
transformFunction: null
|
|
371
224
|
},
|
|
225
|
+
tabIndex: {
|
|
226
|
+
classPropertyName: "tabIndex",
|
|
227
|
+
publicName: "tabindex",
|
|
228
|
+
isSignal: true,
|
|
229
|
+
isRequired: false,
|
|
230
|
+
transformFunction: null
|
|
231
|
+
},
|
|
372
232
|
value: {
|
|
373
233
|
classPropertyName: "value",
|
|
374
234
|
publicName: "value",
|
|
@@ -391,7 +251,7 @@ class Listbox {
|
|
|
391
251
|
},
|
|
392
252
|
properties: {
|
|
393
253
|
"attr.id": "id()",
|
|
394
|
-
"attr.tabindex": "_pattern.tabIndex()",
|
|
254
|
+
"attr.tabindex": "tabIndex() !== undefined ? tabIndex() : _pattern.tabIndex()",
|
|
395
255
|
"attr.aria-readonly": "_pattern.readonly()",
|
|
396
256
|
"attr.aria-disabled": "_pattern.disabled()",
|
|
397
257
|
"attr.aria-orientation": "_pattern.orientation()",
|
|
@@ -403,22 +263,13 @@ class Listbox {
|
|
|
403
263
|
provide: LISTBOX,
|
|
404
264
|
useExisting: Listbox
|
|
405
265
|
}],
|
|
406
|
-
queries: [{
|
|
407
|
-
propertyName: "_options",
|
|
408
|
-
predicate: Option,
|
|
409
|
-
descendants: true,
|
|
410
|
-
isSignal: true
|
|
411
|
-
}],
|
|
412
266
|
exportAs: ["ngListbox"],
|
|
413
|
-
hostDirectives: [{
|
|
414
|
-
directive: ComboboxPopup
|
|
415
|
-
}],
|
|
416
267
|
ngImport: i0
|
|
417
268
|
});
|
|
418
269
|
}
|
|
419
270
|
i0.ɵɵngDeclareClassMetadata({
|
|
420
271
|
minVersion: "12.0.0",
|
|
421
|
-
version: "22.0.0-next.
|
|
272
|
+
version: "22.0.0-next.10",
|
|
422
273
|
ngImport: i0,
|
|
423
274
|
type: Listbox,
|
|
424
275
|
decorators: [{
|
|
@@ -429,7 +280,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
429
280
|
host: {
|
|
430
281
|
'role': 'listbox',
|
|
431
282
|
'[attr.id]': 'id()',
|
|
432
|
-
'[attr.tabindex]': '_pattern.tabIndex()',
|
|
283
|
+
'[attr.tabindex]': 'tabIndex() !== undefined ? tabIndex() : _pattern.tabIndex()',
|
|
433
284
|
'[attr.aria-readonly]': '_pattern.readonly()',
|
|
434
285
|
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
435
286
|
'[attr.aria-orientation]': '_pattern.orientation()',
|
|
@@ -439,7 +290,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
439
290
|
'(click)': '_pattern.onClick($event)',
|
|
440
291
|
'(focusin)': '_pattern.onFocusIn()'
|
|
441
292
|
},
|
|
442
|
-
hostDirectives: [ComboboxPopup],
|
|
443
293
|
providers: [{
|
|
444
294
|
provide: LISTBOX,
|
|
445
295
|
useExisting: Listbox
|
|
@@ -456,15 +306,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
456
306
|
required: false
|
|
457
307
|
}]
|
|
458
308
|
}],
|
|
459
|
-
_options: [{
|
|
460
|
-
type: i0.ContentChildren,
|
|
461
|
-
args: [i0.forwardRef(() => Option), {
|
|
462
|
-
...{
|
|
463
|
-
descendants: true
|
|
464
|
-
},
|
|
465
|
-
isSignal: true
|
|
466
|
-
}]
|
|
467
|
-
}],
|
|
468
309
|
orientation: [{
|
|
469
310
|
type: i0.Input,
|
|
470
311
|
args: [{
|
|
@@ -537,6 +378,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
537
378
|
required: false
|
|
538
379
|
}]
|
|
539
380
|
}],
|
|
381
|
+
tabIndex: [{
|
|
382
|
+
type: i0.Input,
|
|
383
|
+
args: [{
|
|
384
|
+
isSignal: true,
|
|
385
|
+
alias: "tabindex",
|
|
386
|
+
required: false
|
|
387
|
+
}]
|
|
388
|
+
}],
|
|
540
389
|
value: [{
|
|
541
390
|
type: i0.Input,
|
|
542
391
|
args: [{
|
|
@@ -551,5 +400,162 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
551
400
|
}
|
|
552
401
|
});
|
|
553
402
|
|
|
554
|
-
|
|
403
|
+
class Option {
|
|
404
|
+
element = inject(ElementRef).nativeElement;
|
|
405
|
+
active = computed(() => this._pattern.active(), ...(ngDevMode ? [{
|
|
406
|
+
debugName: "active"
|
|
407
|
+
}] : []));
|
|
408
|
+
_listbox = inject(LISTBOX);
|
|
409
|
+
id = input(inject(_IdGenerator).getId('ng-option-', true), ...(ngDevMode ? [{
|
|
410
|
+
debugName: "id"
|
|
411
|
+
}] : []));
|
|
412
|
+
_listboxPattern = computed(() => this._listbox._pattern, ...(ngDevMode ? [{
|
|
413
|
+
debugName: "_listboxPattern"
|
|
414
|
+
}] : []));
|
|
415
|
+
value = input.required(...(ngDevMode ? [{
|
|
416
|
+
debugName: "value"
|
|
417
|
+
}] : []));
|
|
418
|
+
disabled = input(false, {
|
|
419
|
+
...(ngDevMode ? {
|
|
420
|
+
debugName: "disabled"
|
|
421
|
+
} : {}),
|
|
422
|
+
transform: booleanAttribute
|
|
423
|
+
});
|
|
424
|
+
label = input(...(ngDevMode ? [undefined, {
|
|
425
|
+
debugName: "label"
|
|
426
|
+
}] : []));
|
|
427
|
+
selected = computed(() => this._pattern.selected(), ...(ngDevMode ? [{
|
|
428
|
+
debugName: "selected"
|
|
429
|
+
}] : []));
|
|
430
|
+
_pattern = new OptionPattern({
|
|
431
|
+
...this,
|
|
432
|
+
id: this.id,
|
|
433
|
+
value: this.value,
|
|
434
|
+
listbox: this._listboxPattern,
|
|
435
|
+
element: () => this.element,
|
|
436
|
+
searchTerm: () => this.label() ?? ''
|
|
437
|
+
});
|
|
438
|
+
ngOnInit() {
|
|
439
|
+
this._listbox._collection.register(this);
|
|
440
|
+
}
|
|
441
|
+
ngOnDestroy() {
|
|
442
|
+
this._listbox._collection.unregister(this);
|
|
443
|
+
}
|
|
444
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
445
|
+
minVersion: "12.0.0",
|
|
446
|
+
version: "22.0.0-next.10",
|
|
447
|
+
ngImport: i0,
|
|
448
|
+
type: Option,
|
|
449
|
+
deps: [],
|
|
450
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
451
|
+
});
|
|
452
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
453
|
+
minVersion: "17.1.0",
|
|
454
|
+
version: "22.0.0-next.10",
|
|
455
|
+
type: Option,
|
|
456
|
+
isStandalone: true,
|
|
457
|
+
selector: "[ngOption]",
|
|
458
|
+
inputs: {
|
|
459
|
+
id: {
|
|
460
|
+
classPropertyName: "id",
|
|
461
|
+
publicName: "id",
|
|
462
|
+
isSignal: true,
|
|
463
|
+
isRequired: false,
|
|
464
|
+
transformFunction: null
|
|
465
|
+
},
|
|
466
|
+
value: {
|
|
467
|
+
classPropertyName: "value",
|
|
468
|
+
publicName: "value",
|
|
469
|
+
isSignal: true,
|
|
470
|
+
isRequired: true,
|
|
471
|
+
transformFunction: null
|
|
472
|
+
},
|
|
473
|
+
disabled: {
|
|
474
|
+
classPropertyName: "disabled",
|
|
475
|
+
publicName: "disabled",
|
|
476
|
+
isSignal: true,
|
|
477
|
+
isRequired: false,
|
|
478
|
+
transformFunction: null
|
|
479
|
+
},
|
|
480
|
+
label: {
|
|
481
|
+
classPropertyName: "label",
|
|
482
|
+
publicName: "label",
|
|
483
|
+
isSignal: true,
|
|
484
|
+
isRequired: false,
|
|
485
|
+
transformFunction: null
|
|
486
|
+
}
|
|
487
|
+
},
|
|
488
|
+
host: {
|
|
489
|
+
attributes: {
|
|
490
|
+
"role": "option"
|
|
491
|
+
},
|
|
492
|
+
properties: {
|
|
493
|
+
"attr.data-active": "active()",
|
|
494
|
+
"attr.id": "_pattern.id()",
|
|
495
|
+
"attr.tabindex": "_pattern.tabIndex()",
|
|
496
|
+
"attr.aria-selected": "_pattern.selected()",
|
|
497
|
+
"attr.aria-disabled": "_pattern.disabled()"
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
exportAs: ["ngOption"],
|
|
501
|
+
ngImport: i0
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
505
|
+
minVersion: "12.0.0",
|
|
506
|
+
version: "22.0.0-next.10",
|
|
507
|
+
ngImport: i0,
|
|
508
|
+
type: Option,
|
|
509
|
+
decorators: [{
|
|
510
|
+
type: Directive,
|
|
511
|
+
args: [{
|
|
512
|
+
selector: '[ngOption]',
|
|
513
|
+
exportAs: 'ngOption',
|
|
514
|
+
host: {
|
|
515
|
+
'role': 'option',
|
|
516
|
+
'[attr.data-active]': 'active()',
|
|
517
|
+
'[attr.id]': '_pattern.id()',
|
|
518
|
+
'[attr.tabindex]': '_pattern.tabIndex()',
|
|
519
|
+
'[attr.aria-selected]': '_pattern.selected()',
|
|
520
|
+
'[attr.aria-disabled]': '_pattern.disabled()'
|
|
521
|
+
}
|
|
522
|
+
}]
|
|
523
|
+
}],
|
|
524
|
+
propDecorators: {
|
|
525
|
+
id: [{
|
|
526
|
+
type: i0.Input,
|
|
527
|
+
args: [{
|
|
528
|
+
isSignal: true,
|
|
529
|
+
alias: "id",
|
|
530
|
+
required: false
|
|
531
|
+
}]
|
|
532
|
+
}],
|
|
533
|
+
value: [{
|
|
534
|
+
type: i0.Input,
|
|
535
|
+
args: [{
|
|
536
|
+
isSignal: true,
|
|
537
|
+
alias: "value",
|
|
538
|
+
required: true
|
|
539
|
+
}]
|
|
540
|
+
}],
|
|
541
|
+
disabled: [{
|
|
542
|
+
type: i0.Input,
|
|
543
|
+
args: [{
|
|
544
|
+
isSignal: true,
|
|
545
|
+
alias: "disabled",
|
|
546
|
+
required: false
|
|
547
|
+
}]
|
|
548
|
+
}],
|
|
549
|
+
label: [{
|
|
550
|
+
type: i0.Input,
|
|
551
|
+
args: [{
|
|
552
|
+
isSignal: true,
|
|
553
|
+
alias: "label",
|
|
554
|
+
required: false
|
|
555
|
+
}]
|
|
556
|
+
}]
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
|
|
560
|
+
export { Listbox, Option };
|
|
555
561
|
//# sourceMappingURL=listbox.mjs.map
|