@angular/aria 22.0.0-next.6 → 22.0.0-next.7
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.map +1 -1
- package/fesm2022/_click-event-manager-chunk.mjs.map +1 -1
- package/fesm2022/_combobox-chunk.mjs +51 -2
- package/fesm2022/_combobox-chunk.mjs.map +1 -1
- package/fesm2022/_combobox-listbox-chunk.mjs +3 -0
- package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -1
- package/fesm2022/_combobox-tree-chunk.mjs.map +1 -1
- package/fesm2022/_deferred-content-chunk.mjs +16 -14
- package/fesm2022/_deferred-content-chunk.mjs.map +1 -1
- package/fesm2022/_element-chunk.mjs.map +1 -1
- package/fesm2022/_expansion-chunk.mjs.map +1 -1
- package/fesm2022/_list-chunk.mjs.map +1 -1
- package/fesm2022/_list-navigation-chunk.mjs +3 -1
- package/fesm2022/_list-navigation-chunk.mjs.map +1 -1
- package/fesm2022/_list-typeahead-chunk.mjs.map +1 -1
- package/fesm2022/_menu-chunk.mjs.map +1 -1
- package/fesm2022/_signal-like-chunk.mjs +0 -1
- package/fesm2022/_signal-like-chunk.mjs.map +1 -1
- package/fesm2022/_tabs-chunk.mjs +22 -47
- package/fesm2022/_tabs-chunk.mjs.map +1 -1
- package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
- package/fesm2022/_widget-chunk.mjs +55 -13
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion-testing.mjs.map +1 -1
- package/fesm2022/accordion.mjs +16 -14
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox.mjs +59 -34
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid-testing.mjs +72 -0
- package/fesm2022/grid-testing.mjs.map +1 -0
- package/fesm2022/grid.mjs +83 -37
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox-testing.mjs.map +1 -1
- package/fesm2022/listbox.mjs +58 -31
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +41 -35
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +156 -5
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/simple-combobox.mjs +443 -0
- package/fesm2022/simple-combobox.mjs.map +1 -0
- package/fesm2022/tabs-testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +243 -218
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +11 -11
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +65 -33
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +10 -2
- package/types/_combobox-chunk.d.ts +32 -2
- package/types/_grid-chunk.d.ts +16 -8
- package/types/_tabs-chunk.d.ts +7 -42
- package/types/combobox.d.ts +4 -3
- package/types/grid-testing.d.ts +79 -0
- package/types/grid.d.ts +14 -6
- package/types/listbox.d.ts +8 -6
- package/types/menu.d.ts +7 -4
- package/types/private.d.ts +106 -10
- package/types/simple-combobox.d.ts +124 -0
- package/types/tabs.d.ts +79 -74
- package/types/tree.d.ts +5 -2
- package/fesm2022/_pointer-event-manager-chunk.mjs +0 -54
- package/fesm2022/_pointer-event-manager-chunk.mjs.map +0 -1
- package/resources/code-examples.db +0 -0
- package/types/_pointer-event-manager-chunk.d.ts +0 -34
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Renderer2, ElementRef, signal, input, booleanAttribute, model, computed, afterRenderEffect, Directive, InjectionToken } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/aria/private';
|
|
4
|
+
import { DeferredContentAware, SimpleComboboxPattern, DeferredContent, SimpleComboboxPopupPattern } from '@angular/aria/private';
|
|
5
|
+
export { DeferredContent as ɵɵDeferredContent, DeferredContentAware as ɵɵDeferredContentAware } from './_deferred-content-chunk.mjs';
|
|
6
|
+
|
|
7
|
+
class Combobox extends DeferredContentAware {
|
|
8
|
+
_renderer = inject(Renderer2);
|
|
9
|
+
_elementRef = inject(ElementRef);
|
|
10
|
+
element = this._elementRef.nativeElement;
|
|
11
|
+
_popup = signal(undefined, ...(ngDevMode ? [{
|
|
12
|
+
debugName: "_popup"
|
|
13
|
+
}] : []));
|
|
14
|
+
disabled = input(false, {
|
|
15
|
+
...(ngDevMode ? {
|
|
16
|
+
debugName: "disabled"
|
|
17
|
+
} : {}),
|
|
18
|
+
transform: booleanAttribute
|
|
19
|
+
});
|
|
20
|
+
alwaysExpanded = input(false, {
|
|
21
|
+
...(ngDevMode ? {
|
|
22
|
+
debugName: "alwaysExpanded"
|
|
23
|
+
} : {}),
|
|
24
|
+
transform: booleanAttribute
|
|
25
|
+
});
|
|
26
|
+
expanded = model(false, ...(ngDevMode ? [{
|
|
27
|
+
debugName: "expanded"
|
|
28
|
+
}] : []));
|
|
29
|
+
value = model('', ...(ngDevMode ? [{
|
|
30
|
+
debugName: "value"
|
|
31
|
+
}] : []));
|
|
32
|
+
inlineSuggestion = input(undefined, ...(ngDevMode ? [{
|
|
33
|
+
debugName: "inlineSuggestion"
|
|
34
|
+
}] : []));
|
|
35
|
+
_pattern = new SimpleComboboxPattern({
|
|
36
|
+
...this,
|
|
37
|
+
element: () => this.element,
|
|
38
|
+
expandable: () => true,
|
|
39
|
+
popup: computed(() => this._popup()?._pattern)
|
|
40
|
+
});
|
|
41
|
+
constructor() {
|
|
42
|
+
super();
|
|
43
|
+
afterRenderEffect(() => this._pattern.keyboardEventRelayEffect());
|
|
44
|
+
afterRenderEffect(() => this._pattern.closePopupOnBlurEffect());
|
|
45
|
+
afterRenderEffect(() => {
|
|
46
|
+
this.contentVisible.set(this._pattern.isExpanded());
|
|
47
|
+
});
|
|
48
|
+
if (this._pattern.isEditable()) {
|
|
49
|
+
afterRenderEffect(() => {
|
|
50
|
+
this._renderer.setProperty(this.element, 'value', this.value());
|
|
51
|
+
});
|
|
52
|
+
afterRenderEffect(() => {
|
|
53
|
+
this._pattern.highlightEffect();
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
ngOnInit() {
|
|
58
|
+
if (this.alwaysExpanded()) {
|
|
59
|
+
this.expanded.set(true);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
_registerPopup(popup) {
|
|
63
|
+
this._popup.set(popup);
|
|
64
|
+
}
|
|
65
|
+
_unregisterPopup() {
|
|
66
|
+
this._popup.set(undefined);
|
|
67
|
+
}
|
|
68
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
69
|
+
minVersion: "12.0.0",
|
|
70
|
+
version: "22.0.0-next.9",
|
|
71
|
+
ngImport: i0,
|
|
72
|
+
type: Combobox,
|
|
73
|
+
deps: [],
|
|
74
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
75
|
+
});
|
|
76
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
77
|
+
minVersion: "17.1.0",
|
|
78
|
+
version: "22.0.0-next.9",
|
|
79
|
+
type: Combobox,
|
|
80
|
+
isStandalone: true,
|
|
81
|
+
selector: "[ngCombobox]",
|
|
82
|
+
inputs: {
|
|
83
|
+
disabled: {
|
|
84
|
+
classPropertyName: "disabled",
|
|
85
|
+
publicName: "disabled",
|
|
86
|
+
isSignal: true,
|
|
87
|
+
isRequired: false,
|
|
88
|
+
transformFunction: null
|
|
89
|
+
},
|
|
90
|
+
alwaysExpanded: {
|
|
91
|
+
classPropertyName: "alwaysExpanded",
|
|
92
|
+
publicName: "alwaysExpanded",
|
|
93
|
+
isSignal: true,
|
|
94
|
+
isRequired: false,
|
|
95
|
+
transformFunction: null
|
|
96
|
+
},
|
|
97
|
+
expanded: {
|
|
98
|
+
classPropertyName: "expanded",
|
|
99
|
+
publicName: "expanded",
|
|
100
|
+
isSignal: true,
|
|
101
|
+
isRequired: false,
|
|
102
|
+
transformFunction: null
|
|
103
|
+
},
|
|
104
|
+
value: {
|
|
105
|
+
classPropertyName: "value",
|
|
106
|
+
publicName: "value",
|
|
107
|
+
isSignal: true,
|
|
108
|
+
isRequired: false,
|
|
109
|
+
transformFunction: null
|
|
110
|
+
},
|
|
111
|
+
inlineSuggestion: {
|
|
112
|
+
classPropertyName: "inlineSuggestion",
|
|
113
|
+
publicName: "inlineSuggestion",
|
|
114
|
+
isSignal: true,
|
|
115
|
+
isRequired: false,
|
|
116
|
+
transformFunction: null
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
outputs: {
|
|
120
|
+
expanded: "expandedChange",
|
|
121
|
+
value: "valueChange"
|
|
122
|
+
},
|
|
123
|
+
host: {
|
|
124
|
+
attributes: {
|
|
125
|
+
"role": "combobox"
|
|
126
|
+
},
|
|
127
|
+
listeners: {
|
|
128
|
+
"keydown": "_pattern.onKeydown($event)",
|
|
129
|
+
"focusin": "_pattern.onFocusin()",
|
|
130
|
+
"focusout": "_pattern.onFocusout($event)",
|
|
131
|
+
"click": "_pattern.onClick($event)",
|
|
132
|
+
"input": "_pattern.onInput($event)"
|
|
133
|
+
},
|
|
134
|
+
properties: {
|
|
135
|
+
"attr.aria-autocomplete": "_pattern.autocomplete()",
|
|
136
|
+
"attr.aria-disabled": "_pattern.disabled()",
|
|
137
|
+
"attr.aria-expanded": "_pattern.isExpanded()",
|
|
138
|
+
"attr.aria-activedescendant": "_pattern.activeDescendant()",
|
|
139
|
+
"attr.aria-controls": "_pattern.popupId()",
|
|
140
|
+
"attr.aria-haspopup": "_pattern.popupType()"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
exportAs: ["ngCombobox"],
|
|
144
|
+
usesInheritance: true,
|
|
145
|
+
ngImport: i0
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
149
|
+
minVersion: "12.0.0",
|
|
150
|
+
version: "22.0.0-next.9",
|
|
151
|
+
ngImport: i0,
|
|
152
|
+
type: Combobox,
|
|
153
|
+
decorators: [{
|
|
154
|
+
type: Directive,
|
|
155
|
+
args: [{
|
|
156
|
+
selector: '[ngCombobox]',
|
|
157
|
+
exportAs: 'ngCombobox',
|
|
158
|
+
host: {
|
|
159
|
+
'role': 'combobox',
|
|
160
|
+
'[attr.aria-autocomplete]': '_pattern.autocomplete()',
|
|
161
|
+
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
162
|
+
'[attr.aria-expanded]': '_pattern.isExpanded()',
|
|
163
|
+
'[attr.aria-activedescendant]': '_pattern.activeDescendant()',
|
|
164
|
+
'[attr.aria-controls]': '_pattern.popupId()',
|
|
165
|
+
'[attr.aria-haspopup]': '_pattern.popupType()',
|
|
166
|
+
'(keydown)': '_pattern.onKeydown($event)',
|
|
167
|
+
'(focusin)': '_pattern.onFocusin()',
|
|
168
|
+
'(focusout)': '_pattern.onFocusout($event)',
|
|
169
|
+
'(click)': '_pattern.onClick($event)',
|
|
170
|
+
'(input)': '_pattern.onInput($event)'
|
|
171
|
+
}
|
|
172
|
+
}]
|
|
173
|
+
}],
|
|
174
|
+
ctorParameters: () => [],
|
|
175
|
+
propDecorators: {
|
|
176
|
+
disabled: [{
|
|
177
|
+
type: i0.Input,
|
|
178
|
+
args: [{
|
|
179
|
+
isSignal: true,
|
|
180
|
+
alias: "disabled",
|
|
181
|
+
required: false
|
|
182
|
+
}]
|
|
183
|
+
}],
|
|
184
|
+
alwaysExpanded: [{
|
|
185
|
+
type: i0.Input,
|
|
186
|
+
args: [{
|
|
187
|
+
isSignal: true,
|
|
188
|
+
alias: "alwaysExpanded",
|
|
189
|
+
required: false
|
|
190
|
+
}]
|
|
191
|
+
}],
|
|
192
|
+
expanded: [{
|
|
193
|
+
type: i0.Input,
|
|
194
|
+
args: [{
|
|
195
|
+
isSignal: true,
|
|
196
|
+
alias: "expanded",
|
|
197
|
+
required: false
|
|
198
|
+
}]
|
|
199
|
+
}, {
|
|
200
|
+
type: i0.Output,
|
|
201
|
+
args: ["expandedChange"]
|
|
202
|
+
}],
|
|
203
|
+
value: [{
|
|
204
|
+
type: i0.Input,
|
|
205
|
+
args: [{
|
|
206
|
+
isSignal: true,
|
|
207
|
+
alias: "value",
|
|
208
|
+
required: false
|
|
209
|
+
}]
|
|
210
|
+
}, {
|
|
211
|
+
type: i0.Output,
|
|
212
|
+
args: ["valueChange"]
|
|
213
|
+
}],
|
|
214
|
+
inlineSuggestion: [{
|
|
215
|
+
type: i0.Input,
|
|
216
|
+
args: [{
|
|
217
|
+
isSignal: true,
|
|
218
|
+
alias: "inlineSuggestion",
|
|
219
|
+
required: false
|
|
220
|
+
}]
|
|
221
|
+
}]
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
const SIMPLE_COMBOBOX_POPUP = new InjectionToken('SIMPLE_COMBOBOX_POPUP');
|
|
226
|
+
|
|
227
|
+
class ComboboxPopup {
|
|
228
|
+
_deferredContent = inject(DeferredContent);
|
|
229
|
+
combobox = input.required(...(ngDevMode ? [{
|
|
230
|
+
debugName: "combobox"
|
|
231
|
+
}] : []));
|
|
232
|
+
_widget = signal(undefined, ...(ngDevMode ? [{
|
|
233
|
+
debugName: "_widget"
|
|
234
|
+
}] : []));
|
|
235
|
+
controlTarget = computed(() => this._widget()?.element, ...(ngDevMode ? [{
|
|
236
|
+
debugName: "controlTarget"
|
|
237
|
+
}] : []));
|
|
238
|
+
popupId = computed(() => this._widget()?.popupId(), ...(ngDevMode ? [{
|
|
239
|
+
debugName: "popupId"
|
|
240
|
+
}] : []));
|
|
241
|
+
activeDescendant = computed(() => this._widget()?.activeDescendant(), ...(ngDevMode ? [{
|
|
242
|
+
debugName: "activeDescendant"
|
|
243
|
+
}] : []));
|
|
244
|
+
popupType = input('listbox', ...(ngDevMode ? [{
|
|
245
|
+
debugName: "popupType"
|
|
246
|
+
}] : []));
|
|
247
|
+
_pattern = new SimpleComboboxPopupPattern({
|
|
248
|
+
...this
|
|
249
|
+
});
|
|
250
|
+
ngOnInit() {
|
|
251
|
+
this.combobox()._registerPopup(this);
|
|
252
|
+
this._deferredContent.deferredContentAware.set(this.combobox());
|
|
253
|
+
}
|
|
254
|
+
ngOnDestroy() {
|
|
255
|
+
this.combobox()._unregisterPopup();
|
|
256
|
+
}
|
|
257
|
+
_registerWidget(widget) {
|
|
258
|
+
this._widget.set(widget);
|
|
259
|
+
}
|
|
260
|
+
_unregisterWidget() {
|
|
261
|
+
this._widget.set(undefined);
|
|
262
|
+
}
|
|
263
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
264
|
+
minVersion: "12.0.0",
|
|
265
|
+
version: "22.0.0-next.9",
|
|
266
|
+
ngImport: i0,
|
|
267
|
+
type: ComboboxPopup,
|
|
268
|
+
deps: [],
|
|
269
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
270
|
+
});
|
|
271
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
272
|
+
minVersion: "17.1.0",
|
|
273
|
+
version: "22.0.0-next.9",
|
|
274
|
+
type: ComboboxPopup,
|
|
275
|
+
isStandalone: true,
|
|
276
|
+
selector: "ng-template[ngComboboxPopup]",
|
|
277
|
+
inputs: {
|
|
278
|
+
combobox: {
|
|
279
|
+
classPropertyName: "combobox",
|
|
280
|
+
publicName: "combobox",
|
|
281
|
+
isSignal: true,
|
|
282
|
+
isRequired: true,
|
|
283
|
+
transformFunction: null
|
|
284
|
+
},
|
|
285
|
+
popupType: {
|
|
286
|
+
classPropertyName: "popupType",
|
|
287
|
+
publicName: "popupType",
|
|
288
|
+
isSignal: true,
|
|
289
|
+
isRequired: false,
|
|
290
|
+
transformFunction: null
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
providers: [{
|
|
294
|
+
provide: SIMPLE_COMBOBOX_POPUP,
|
|
295
|
+
useExisting: ComboboxPopup
|
|
296
|
+
}],
|
|
297
|
+
exportAs: ["ngComboboxPopup"],
|
|
298
|
+
hostDirectives: [{
|
|
299
|
+
directive: i1.DeferredContent
|
|
300
|
+
}],
|
|
301
|
+
ngImport: i0
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
305
|
+
minVersion: "12.0.0",
|
|
306
|
+
version: "22.0.0-next.9",
|
|
307
|
+
ngImport: i0,
|
|
308
|
+
type: ComboboxPopup,
|
|
309
|
+
decorators: [{
|
|
310
|
+
type: Directive,
|
|
311
|
+
args: [{
|
|
312
|
+
selector: 'ng-template[ngComboboxPopup]',
|
|
313
|
+
exportAs: 'ngComboboxPopup',
|
|
314
|
+
hostDirectives: [DeferredContent],
|
|
315
|
+
providers: [{
|
|
316
|
+
provide: SIMPLE_COMBOBOX_POPUP,
|
|
317
|
+
useExisting: ComboboxPopup
|
|
318
|
+
}]
|
|
319
|
+
}]
|
|
320
|
+
}],
|
|
321
|
+
propDecorators: {
|
|
322
|
+
combobox: [{
|
|
323
|
+
type: i0.Input,
|
|
324
|
+
args: [{
|
|
325
|
+
isSignal: true,
|
|
326
|
+
alias: "combobox",
|
|
327
|
+
required: true
|
|
328
|
+
}]
|
|
329
|
+
}],
|
|
330
|
+
popupType: [{
|
|
331
|
+
type: i0.Input,
|
|
332
|
+
args: [{
|
|
333
|
+
isSignal: true,
|
|
334
|
+
alias: "popupType",
|
|
335
|
+
required: false
|
|
336
|
+
}]
|
|
337
|
+
}]
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
class ComboboxWidget {
|
|
342
|
+
_elementRef = inject(ElementRef);
|
|
343
|
+
_popup = inject(SIMPLE_COMBOBOX_POPUP);
|
|
344
|
+
element = this._elementRef.nativeElement;
|
|
345
|
+
popupId = signal(undefined, ...(ngDevMode ? [{
|
|
346
|
+
debugName: "popupId"
|
|
347
|
+
}] : []));
|
|
348
|
+
activeDescendant = input(undefined, ...(ngDevMode ? [{
|
|
349
|
+
debugName: "activeDescendant"
|
|
350
|
+
}] : []));
|
|
351
|
+
_observer;
|
|
352
|
+
constructor() {
|
|
353
|
+
const el = this.element;
|
|
354
|
+
this._observer = new MutationObserver(mutations => {
|
|
355
|
+
for (const mutation of mutations) {
|
|
356
|
+
if (mutation.attributeName === 'id') {
|
|
357
|
+
this.popupId.set(el.id);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
this._observer.observe(el, {
|
|
362
|
+
attributes: true,
|
|
363
|
+
attributeFilter: ['id']
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
ngOnInit() {
|
|
367
|
+
this.popupId.set(this.element.id);
|
|
368
|
+
this._popup._registerWidget(this);
|
|
369
|
+
}
|
|
370
|
+
ngOnDestroy() {
|
|
371
|
+
this._observer?.disconnect();
|
|
372
|
+
this._popup._unregisterWidget();
|
|
373
|
+
}
|
|
374
|
+
onFocusin() {
|
|
375
|
+
this._popup._pattern.onFocusin();
|
|
376
|
+
}
|
|
377
|
+
onFocusout(event) {
|
|
378
|
+
this._popup._pattern.onFocusout(event);
|
|
379
|
+
}
|
|
380
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
381
|
+
minVersion: "12.0.0",
|
|
382
|
+
version: "22.0.0-next.9",
|
|
383
|
+
ngImport: i0,
|
|
384
|
+
type: ComboboxWidget,
|
|
385
|
+
deps: [],
|
|
386
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
387
|
+
});
|
|
388
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
389
|
+
minVersion: "17.1.0",
|
|
390
|
+
version: "22.0.0-next.9",
|
|
391
|
+
type: ComboboxWidget,
|
|
392
|
+
isStandalone: true,
|
|
393
|
+
selector: "[ngComboboxWidget]",
|
|
394
|
+
inputs: {
|
|
395
|
+
activeDescendant: {
|
|
396
|
+
classPropertyName: "activeDescendant",
|
|
397
|
+
publicName: "activeDescendant",
|
|
398
|
+
isSignal: true,
|
|
399
|
+
isRequired: false,
|
|
400
|
+
transformFunction: null
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
host: {
|
|
404
|
+
listeners: {
|
|
405
|
+
"focusin": "onFocusin()",
|
|
406
|
+
"focusout": "onFocusout($event)"
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
exportAs: ["ngComboboxWidget"],
|
|
410
|
+
ngImport: i0
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
414
|
+
minVersion: "12.0.0",
|
|
415
|
+
version: "22.0.0-next.9",
|
|
416
|
+
ngImport: i0,
|
|
417
|
+
type: ComboboxWidget,
|
|
418
|
+
decorators: [{
|
|
419
|
+
type: Directive,
|
|
420
|
+
args: [{
|
|
421
|
+
selector: '[ngComboboxWidget]',
|
|
422
|
+
exportAs: 'ngComboboxWidget',
|
|
423
|
+
host: {
|
|
424
|
+
'(focusin)': 'onFocusin()',
|
|
425
|
+
'(focusout)': 'onFocusout($event)'
|
|
426
|
+
}
|
|
427
|
+
}]
|
|
428
|
+
}],
|
|
429
|
+
ctorParameters: () => [],
|
|
430
|
+
propDecorators: {
|
|
431
|
+
activeDescendant: [{
|
|
432
|
+
type: i0.Input,
|
|
433
|
+
args: [{
|
|
434
|
+
isSignal: true,
|
|
435
|
+
alias: "activeDescendant",
|
|
436
|
+
required: false
|
|
437
|
+
}]
|
|
438
|
+
}]
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
export { Combobox, ComboboxPopup, ComboboxWidget };
|
|
443
|
+
//# sourceMappingURL=simple-combobox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple-combobox.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/simple-combobox/simple-combobox.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/simple-combobox/simple-combobox-tokens.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/simple-combobox/simple-combobox-popup.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/simple-combobox/simple-combobox-widget.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n OnInit,\n signal,\n Renderer2,\n} from '@angular/core';\nimport {DeferredContentAware, SimpleComboboxPattern} from '@angular/aria/private';\nimport type {ComboboxPopup} from './simple-combobox-popup';\n\n/**\n * The container element that wraps a combobox input and popup, and orchestrates its behavior.\n *\n * The `ngCombobox` directive is the main entry point for creating a combobox and customizing its\n * behavior. It coordinates the interactions between the input and the popup.\n *\n * ```html\n * <div ngCombobox [(expanded)]=\"expanded\">\n * <input ngComboboxInput />\n *\n * <ng-template ngComboboxPopup>\n * <div ngComboboxWidget>\n * <!-- ... options ... -->\n * </div>\n * </ng-template>\n * </div>\n * ```\n */\n@Directive({\n selector: '[ngCombobox]',\n exportAs: 'ngCombobox',\n host: {\n 'role': 'combobox',\n '[attr.aria-autocomplete]': '_pattern.autocomplete()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-expanded]': '_pattern.isExpanded()',\n '[attr.aria-activedescendant]': '_pattern.activeDescendant()',\n '[attr.aria-controls]': '_pattern.popupId()',\n '[attr.aria-haspopup]': '_pattern.popupType()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(focusin)': '_pattern.onFocusin()',\n '(focusout)': '_pattern.onFocusout($event)',\n '(click)': '_pattern.onClick($event)',\n '(input)': '_pattern.onInput($event)',\n },\n})\nexport class Combobox extends DeferredContentAware implements OnInit {\n private readonly _renderer = inject(Renderer2);\n\n /** The element that the combobox is attached to. */\n private readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** A reference to the input element. */\n readonly element = this._elementRef.nativeElement;\n\n /** The popup associated with the combobox. */\n readonly _popup = signal<ComboboxPopup | undefined>(undefined);\n\n /** Whether the combobox is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the combobox should always remain expanded. */\n readonly alwaysExpanded = input(false, {transform: booleanAttribute});\n\n /** Whether the combobox is expanded. */\n readonly expanded = model<boolean>(false);\n\n /** The value of the combobox input. */\n readonly value = model<string>('');\n\n /** An inline suggestion to be displayed in the input. */\n readonly inlineSuggestion = input<string | undefined>(undefined);\n\n /** The combobox ui pattern. */\n readonly _pattern = new SimpleComboboxPattern({\n ...this,\n element: () => this.element,\n expandable: () => true,\n popup: computed(() => this._popup()?._pattern),\n });\n\n constructor() {\n super();\n\n afterRenderEffect(() => this._pattern.keyboardEventRelayEffect());\n afterRenderEffect(() => this._pattern.closePopupOnBlurEffect());\n afterRenderEffect(() => {\n this.contentVisible.set(this._pattern.isExpanded());\n });\n\n if (this._pattern.isEditable()) {\n afterRenderEffect(() => {\n this._renderer.setProperty(this.element, 'value', this.value());\n });\n afterRenderEffect(() => {\n this._pattern.highlightEffect();\n });\n }\n }\n\n ngOnInit() {\n if (this.alwaysExpanded()) {\n this.expanded.set(true);\n }\n }\n\n /** Registers a popup with the combobox. */\n _registerPopup(popup: ComboboxPopup) {\n this._popup.set(popup);\n }\n\n /** Unregisters the popup from the combobox. */\n _unregisterPopup() {\n this._popup.set(undefined);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InjectionToken} from '@angular/core';\nimport type {ComboboxPopup} from './simple-combobox-popup';\n\n/** Token used to expose the combobox popup. */\nexport const SIMPLE_COMBOBOX_POPUP = new InjectionToken<ComboboxPopup>('SIMPLE_COMBOBOX_POPUP');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed, Directive, inject, input, OnDestroy, OnInit, signal} from '@angular/core';\nimport {DeferredContent, SimpleComboboxPopupPattern} from '@angular/aria/private';\nimport type {Combobox} from './simple-combobox';\nimport type {ComboboxWidget} from './simple-combobox-widget';\nimport {SIMPLE_COMBOBOX_POPUP} from './simple-combobox-tokens';\n\n/**\n * A structural directive that marks the `ng-template` to be used as the popup\n * for a combobox. This content is conditionally rendered.\n *\n * The content of the popup can be any element with the `ngComboboxWidget` directive.\n *\n * ```html\n * <ng-template ngComboboxPopup>\n * <div ngComboboxWidget>\n * <!-- ... options ... -->\n * </div>\n * </ng-template>\n * ```\n */\n@Directive({\n selector: 'ng-template[ngComboboxPopup]',\n exportAs: 'ngComboboxPopup',\n hostDirectives: [DeferredContent],\n providers: [{provide: SIMPLE_COMBOBOX_POPUP, useExisting: ComboboxPopup}],\n})\nexport class ComboboxPopup implements OnInit, OnDestroy {\n private readonly _deferredContent = inject(DeferredContent);\n\n /** The combobox that the popup belongs to. */\n readonly combobox = input.required<Combobox>();\n\n /** The widget contained within the popup. */\n readonly _widget = signal<ComboboxWidget | undefined>(undefined);\n\n /** The element that serves as the control target for the popup. */\n readonly controlTarget = computed(() => this._widget()?.element);\n\n /** The ID of the popup. */\n readonly popupId = computed(() => this._widget()?.popupId());\n\n /** The ID of the active descendant in the popup. */\n readonly activeDescendant = computed(() => this._widget()?.activeDescendant());\n\n /** The type of the popup (e.g., listbox, tree, grid, dialog). */\n readonly popupType = input<'listbox' | 'tree' | 'grid' | 'dialog'>('listbox');\n\n /** The popup pattern. */\n readonly _pattern = new SimpleComboboxPopupPattern({\n ...this,\n });\n\n ngOnInit() {\n this.combobox()._registerPopup(this);\n this._deferredContent.deferredContentAware.set(this.combobox());\n }\n\n ngOnDestroy() {\n this.combobox()._unregisterPopup();\n }\n\n /** Registers a widget with the popup. */\n _registerWidget(widget: ComboboxWidget) {\n this._widget.set(widget);\n }\n\n /** Unregisters the widget from the popup. */\n _unregisterWidget() {\n this._widget.set(undefined);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Directive, ElementRef, inject, input, OnDestroy, OnInit, signal} from '@angular/core';\nimport {SIMPLE_COMBOBOX_POPUP} from './simple-combobox-tokens';\n\n/**\n * Identifies an element as a widget within a combobox popup.\n *\n * This directive should be applied to the element that contains the options or content\n * of the popup. It handles the communication of ID and active descendant information\n * to the combobox.\n */\n@Directive({\n selector: '[ngComboboxWidget]',\n exportAs: 'ngComboboxWidget',\n host: {\n '(focusin)': 'onFocusin()',\n '(focusout)': 'onFocusout($event)',\n },\n})\nexport class ComboboxWidget implements OnInit, OnDestroy {\n /** The element that the popup widget is attached to. */\n private readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly _popup = inject(SIMPLE_COMBOBOX_POPUP);\n\n /** A reference to the popup widget element. */\n readonly element = this._elementRef.nativeElement;\n\n /** The ID of the popup widget. */\n readonly popupId = signal<string | undefined>(undefined);\n\n /** The ID of the active descendant in the widget. */\n readonly activeDescendant = input<string | undefined>(undefined);\n\n private _observer: MutationObserver | undefined;\n\n constructor() {\n const el = this.element;\n this._observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (mutation.attributeName === 'id') {\n this.popupId.set(el.id);\n }\n }\n });\n\n this._observer.observe(el, {\n attributes: true,\n attributeFilter: ['id'],\n });\n }\n\n ngOnInit() {\n this.popupId.set(this.element.id);\n this._popup._registerWidget(this);\n }\n\n ngOnDestroy(): void {\n this._observer?.disconnect();\n this._popup._unregisterWidget();\n }\n\n /** Handles focus in events for the widget. */\n onFocusin() {\n this._popup._pattern.onFocusin();\n }\n\n /** Handles focus out events for the widget. */\n onFocusout(event: FocusEvent) {\n this._popup._pattern.onFocusout(event);\n }\n}\n"],"names":["Combobox","DeferredContentAware","_renderer","inject","Renderer2","_elementRef","ElementRef","element","nativeElement","_popup","signal","undefined","disabled","input","transform","booleanAttribute","alwaysExpanded","expanded","model","value","inlineSuggestion","_pattern","SimpleComboboxPattern","expandable","popup","computed","constructor","afterRenderEffect","keyboardEventRelayEffect","closePopupOnBlurEffect","contentVisible","set","isExpanded","isEditable","setProperty","highlightEffect","ngOnInit","_registerPopup","_unregisterPopup","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","host","attributes","listeners","properties","exportAs","usesInheritance","ngImport","decorators","args","SIMPLE_COMBOBOX_POPUP","InjectionToken","ComboboxPopup","_deferredContent","DeferredContent","combobox","required","_widget","controlTarget","popupId","activeDescendant","popupType","SimpleComboboxPopupPattern","deferredContentAware","ngOnDestroy","_registerWidget","widget","_unregisterWidget","providers","provide","useExisting","hostDirectives","directive","i1","ComboboxWidget","_observer","el","MutationObserver","mutations","mutation","attributeName","id","observe","attributeFilter","disconnect","onFocusin","onFocusout","event"],"mappings":";;;;;;AA4DM,MAAOA,QAAS,SAAQC,oBAAoB,CAAA;AAC/BC,EAAAA,SAAS,GAAGC,MAAM,CAACC,SAAS,CAAC;AAG7BC,EAAAA,WAAW,GAAGF,MAAM,CAA0BG,UAAU,CAAC;AAGjEC,EAAAA,OAAO,GAAG,IAAI,CAACF,WAAW,CAACG,aAAa;EAGxCC,MAAM,GAAGC,MAAM,CAA4BC,SAAS;;WAAC;AAGrDC,EAAAA,QAAQ,GAAGC,KAAK,CAAC,KAAK;;;;AAAGC,IAAAA,SAAS,EAAEC;AAAgB,GAAA,CAAE;AAGtDC,EAAAA,cAAc,GAAGH,KAAK,CAAC,KAAK;;;;AAAGC,IAAAA,SAAS,EAAEC;AAAgB,GAAA,CAAE;EAG5DE,QAAQ,GAAGC,KAAK,CAAU,KAAK;;WAAC;EAGhCC,KAAK,GAAGD,KAAK,CAAS,EAAE;;WAAC;EAGzBE,gBAAgB,GAAGP,KAAK,CAAqBF,SAAS;;WAAC;EAGvDU,QAAQ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AI,EAAE;AACJ,QAAA,WAAW,EAAE,aAAa;AAC1B,QAAA,YAAY,EAAE;AACf;KACF;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-testing.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"tabs-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/tabs/testing/tabs-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n ComponentHarness,\n ContentContainerComponentHarness,\n HarnessLoader,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {TabsHarnessFilters, TabHarnessFilters} from './tabs-harness-filters';\n\n/** Harness for interacting with an Aria tab in tests. */\nexport class TabHarness extends ContentContainerComponentHarness {\n static hostSelector = '[ngTab]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `TabHarness`\n * that meets certain criteria.\n * @param options Options for filtering which tab instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabHarnessFilters = {}): HarnessPredicate<TabHarness> {\n return new HarnessPredicate(TabHarness, options)\n .addOption('title', options.title, (harness, title) =>\n HarnessPredicate.stringMatches(harness.getTitle(), title),\n )\n .addOption(\n 'selected',\n options.selected,\n async (harness, selected) => (await harness.isSelected()) === selected,\n )\n .addOption(\n 'disabled',\n options.disabled,\n async (harness, disabled) => (await harness.isDisabled()) === disabled,\n );\n }\n\n /** Gets the tab's title text. */\n async getTitle(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Clicks the tab to select it. */\n async select(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Gets whether the tab is selected. */\n async isSelected(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-selected')) === 'true';\n }\n\n /** Gets whether the tab is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-disabled')) === 'true';\n }\n\n /** Gets whether the tab is active. */\n async isActive(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('data-active')) === 'true';\n }\n\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n const host = await this.host();\n const controlsId = await host.getAttribute('aria-controls');\n const documentRoot = await this.documentRootLocatorFactory().rootHarnessLoader();\n return await documentRoot.getChildLoader(`[ngTabPanel][id=\"${controlsId}\"]`);\n }\n}\n\n/** Harness for interacting with an Aria tabs container in tests. */\nexport class TabsHarness extends ComponentHarness {\n static hostSelector = '[ngTabs]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `TabsHarness`\n * that meets certain criteria.\n * @param options Options for filtering which tabs instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabsHarnessFilters = {}): HarnessPredicate<TabsHarness> {\n return new HarnessPredicate(TabsHarness, options);\n }\n\n /** Gets all tabs inside the tabs container. */\n async getTabs(filters: TabHarnessFilters = {}): Promise<TabHarness[]> {\n return await this.locatorForAll(TabHarness.with(filters))();\n }\n\n /** Gets the currently selected tab. */\n async getSelectedTab(): Promise<TabHarness | null> {\n const tabs = await this.getTabs({selected: true});\n return tabs.length > 0 ? tabs[0] : null;\n }\n\n /** Selects a tab matching the given filters. */\n async selectTab(filters: TabHarnessFilters = {}): Promise<void> {\n const tabs = await this.getTabs(filters);\n if (tabs.length === 0) {\n throw new Error(`Could not find tab matching filters: ${JSON.stringify(filters)}`);\n }\n await tabs[0].select();\n }\n}\n"],"names":["TabHarness","ContentContainerComponentHarness","hostSelector","with","options","HarnessPredicate","addOption","title","harness","stringMatches","getTitle","selected","isSelected","disabled","isDisabled","host","text","select","click","getAttribute","isActive","getRootHarnessLoader","controlsId","documentRoot","documentRootLocatorFactory","rootHarnessLoader","getChildLoader","TabsHarness","ComponentHarness","getTabs","filters","locatorForAll","getSelectedTab","tabs","length","selectTab","Error","JSON","stringify"],"mappings":";;AAiBM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