@angular/aria 21.1.0-next.1 → 21.1.0-next.2
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/_combobox-chunk.mjs +425 -0
- package/fesm2022/_combobox-chunk.mjs.map +1 -0
- package/fesm2022/_combobox-listbox-chunk.mjs +522 -0
- package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -0
- package/fesm2022/_combobox-popup-chunk.mjs +46 -0
- package/fesm2022/_combobox-popup-chunk.mjs.map +1 -0
- package/fesm2022/_list-navigation-chunk.mjs +116 -0
- package/fesm2022/_list-navigation-chunk.mjs.map +1 -0
- package/fesm2022/_pointer-event-manager-chunk.mjs +134 -0
- package/fesm2022/_pointer-event-manager-chunk.mjs.map +1 -0
- package/fesm2022/_widget-chunk.mjs +4 -246
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion.mjs +64 -51
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox.mjs +120 -144
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid.mjs +285 -261
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox.mjs +205 -193
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +301 -283
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +13 -938
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs.mjs +209 -195
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +59 -47
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree.mjs +43 -41
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -2
- package/types/_combobox-chunk.d.ts +98 -0
- package/types/_combobox-chunk.d2.ts +193 -0
- package/types/_grid-chunk.d.ts +3 -210
- package/types/_list-chunk.d.ts +212 -0
- package/types/_list-navigation-chunk.d.ts +212 -0
- package/types/_listbox-chunk.d.ts +106 -0
- package/types/accordion.d.ts +52 -49
- package/types/combobox.d.ts +25 -111
- package/types/grid.d.ts +37 -32
- package/types/listbox.d.ts +8 -5
- package/types/menu.d.ts +113 -113
- package/types/private.d.ts +10 -498
- package/types/tabs.d.ts +89 -84
- package/types/toolbar.d.ts +69 -66
- package/types/tree.d.ts +106 -103
- package/_adev_assets/aria-accordion.json +0 -743
- package/_adev_assets/aria-combobox.json +0 -603
- package/_adev_assets/aria-grid.json +0 -893
- package/_adev_assets/aria-listbox.json +0 -540
- package/_adev_assets/aria-menu.json +0 -1049
- package/_adev_assets/aria-tabs.json +0 -880
- package/_adev_assets/aria-toolbar.json +0 -545
- package/_adev_assets/aria-tree.json +0 -853
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import { signal, computed } from '@angular/core';
|
|
2
|
+
import { PointerEventManager, KeyboardEventManager } from './_pointer-event-manager-chunk.mjs';
|
|
3
|
+
|
|
4
|
+
class ComboboxPattern {
|
|
5
|
+
inputs;
|
|
6
|
+
expanded = signal(false);
|
|
7
|
+
disabled = () => this.inputs.disabled();
|
|
8
|
+
activeDescendant = computed(() => {
|
|
9
|
+
const popupControls = this.inputs.popupControls();
|
|
10
|
+
if (popupControls instanceof ComboboxDialogPattern) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return popupControls?.activeId() ?? null;
|
|
14
|
+
});
|
|
15
|
+
highlightedItem = signal(undefined);
|
|
16
|
+
isDeleting = false;
|
|
17
|
+
isFocused = signal(false);
|
|
18
|
+
hasBeenFocused = signal(false);
|
|
19
|
+
expandKey = computed(() => this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight');
|
|
20
|
+
collapseKey = computed(() => this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft');
|
|
21
|
+
popupId = computed(() => this.inputs.popupControls()?.id() || null);
|
|
22
|
+
autocomplete = computed(() => this.inputs.filterMode() === 'highlight' ? 'both' : 'list');
|
|
23
|
+
hasPopup = computed(() => this.inputs.popupControls()?.role() || null);
|
|
24
|
+
readonly = computed(() => this.inputs.readonly() || this.inputs.disabled() || null);
|
|
25
|
+
listControls = () => {
|
|
26
|
+
const popupControls = this.inputs.popupControls();
|
|
27
|
+
if (popupControls instanceof ComboboxDialogPattern) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return popupControls;
|
|
31
|
+
};
|
|
32
|
+
treeControls = () => {
|
|
33
|
+
const popupControls = this.inputs.popupControls();
|
|
34
|
+
if (popupControls?.role() === 'tree') {
|
|
35
|
+
return popupControls;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
};
|
|
39
|
+
keydown = computed(() => {
|
|
40
|
+
const manager = new KeyboardEventManager();
|
|
41
|
+
const popupControls = this.inputs.popupControls();
|
|
42
|
+
if (!popupControls) {
|
|
43
|
+
return manager;
|
|
44
|
+
}
|
|
45
|
+
if (popupControls instanceof ComboboxDialogPattern) {
|
|
46
|
+
if (!this.expanded()) {
|
|
47
|
+
manager.on('ArrowUp', () => this.open()).on('ArrowDown', () => this.open());
|
|
48
|
+
if (this.readonly()) {
|
|
49
|
+
manager.on('Enter', () => this.open()).on(' ', () => this.open());
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return manager;
|
|
53
|
+
}
|
|
54
|
+
if (!this.inputs.alwaysExpanded()) {
|
|
55
|
+
manager.on('Escape', () => this.close({
|
|
56
|
+
reset: !this.readonly()
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
if (!this.expanded()) {
|
|
60
|
+
manager.on('ArrowDown', () => this.open({
|
|
61
|
+
first: true
|
|
62
|
+
})).on('ArrowUp', () => this.open({
|
|
63
|
+
last: true
|
|
64
|
+
}));
|
|
65
|
+
if (this.readonly()) {
|
|
66
|
+
manager.on('Enter', () => this.open({
|
|
67
|
+
selected: true
|
|
68
|
+
})).on(' ', () => this.open({
|
|
69
|
+
selected: true
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
return manager;
|
|
73
|
+
}
|
|
74
|
+
manager.on('ArrowDown', () => this.next()).on('ArrowUp', () => this.prev()).on('Home', () => this.first()).on('End', () => this.last());
|
|
75
|
+
if (this.readonly()) {
|
|
76
|
+
manager.on(' ', () => this.select({
|
|
77
|
+
commit: true,
|
|
78
|
+
close: !popupControls.multi()
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
if (popupControls.role() === 'listbox') {
|
|
82
|
+
manager.on('Enter', () => {
|
|
83
|
+
this.select({
|
|
84
|
+
commit: true,
|
|
85
|
+
close: !popupControls.multi()
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const treeControls = this.treeControls();
|
|
90
|
+
if (treeControls?.isItemSelectable()) {
|
|
91
|
+
manager.on('Enter', () => this.select({
|
|
92
|
+
commit: true,
|
|
93
|
+
close: true
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
if (treeControls?.isItemExpandable()) {
|
|
97
|
+
manager.on(this.expandKey(), () => this.expandItem()).on(this.collapseKey(), () => this.collapseItem());
|
|
98
|
+
if (!treeControls.isItemSelectable()) {
|
|
99
|
+
manager.on('Enter', () => this.expandItem());
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (treeControls?.isItemCollapsible()) {
|
|
103
|
+
manager.on(this.collapseKey(), () => this.collapseItem());
|
|
104
|
+
}
|
|
105
|
+
return manager;
|
|
106
|
+
});
|
|
107
|
+
click = computed(() => new PointerEventManager().on(e => {
|
|
108
|
+
if (e.target === this.inputs.inputEl()) {
|
|
109
|
+
if (this.readonly()) {
|
|
110
|
+
this.expanded() ? this.close() : this.open({
|
|
111
|
+
selected: true
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const controls = this.inputs.popupControls();
|
|
116
|
+
if (controls instanceof ComboboxDialogPattern) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const item = controls?.getItem(e);
|
|
120
|
+
if (item) {
|
|
121
|
+
if (controls?.role() === 'tree') {
|
|
122
|
+
const treeControls = controls;
|
|
123
|
+
if (treeControls.isItemExpandable(item) && !treeControls.isItemSelectable(item)) {
|
|
124
|
+
treeControls.toggleExpansion(item);
|
|
125
|
+
this.inputs.inputEl()?.focus();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
this.select({
|
|
130
|
+
item,
|
|
131
|
+
commit: true,
|
|
132
|
+
close: !controls?.multi()
|
|
133
|
+
});
|
|
134
|
+
this.inputs.inputEl()?.focus();
|
|
135
|
+
}
|
|
136
|
+
}));
|
|
137
|
+
constructor(inputs) {
|
|
138
|
+
this.inputs = inputs;
|
|
139
|
+
}
|
|
140
|
+
onKeydown(event) {
|
|
141
|
+
if (!this.inputs.disabled()) {
|
|
142
|
+
this.keydown().handle(event);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
onClick(event) {
|
|
146
|
+
if (!this.inputs.disabled()) {
|
|
147
|
+
this.click().handle(event);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
onInput(event) {
|
|
151
|
+
if (this.inputs.disabled() || this.inputs.readonly()) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const inputEl = this.inputs.inputEl();
|
|
155
|
+
if (!inputEl) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const popupControls = this.inputs.popupControls();
|
|
159
|
+
if (popupControls instanceof ComboboxDialogPattern) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this.open();
|
|
163
|
+
this.inputs.inputValue?.set(inputEl.value);
|
|
164
|
+
this.isDeleting = event instanceof InputEvent && !!event.inputType.match(/^delete/);
|
|
165
|
+
if (this.inputs.filterMode() === 'highlight' && !this.isDeleting) {
|
|
166
|
+
this.highlight();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
onFocusIn() {
|
|
170
|
+
if (this.inputs.alwaysExpanded() && !this.hasBeenFocused()) {
|
|
171
|
+
const firstSelectedItem = this.listControls()?.getSelectedItems()[0];
|
|
172
|
+
firstSelectedItem ? this.listControls()?.focus(firstSelectedItem) : this.first();
|
|
173
|
+
}
|
|
174
|
+
this.isFocused.set(true);
|
|
175
|
+
this.hasBeenFocused.set(true);
|
|
176
|
+
}
|
|
177
|
+
onFocusOut(event) {
|
|
178
|
+
if (this.inputs.disabled()) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const popupControls = this.inputs.popupControls();
|
|
182
|
+
if (popupControls instanceof ComboboxDialogPattern) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (!(event.relatedTarget instanceof HTMLElement) || !this.inputs.containerEl()?.contains(event.relatedTarget)) {
|
|
186
|
+
this.isFocused.set(false);
|
|
187
|
+
if (!this.expanded()) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (this.readonly()) {
|
|
191
|
+
this.close();
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (this.inputs.filterMode() !== 'manual') {
|
|
195
|
+
this.commit();
|
|
196
|
+
} else {
|
|
197
|
+
const item = popupControls?.items().find(i => i.searchTerm() === this.inputs.inputEl()?.value);
|
|
198
|
+
if (item) {
|
|
199
|
+
this.select({
|
|
200
|
+
item
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
this.close();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
firstMatch = computed(() => {
|
|
208
|
+
if (this.listControls()?.role() === 'listbox') {
|
|
209
|
+
return this.listControls()?.items()[0];
|
|
210
|
+
}
|
|
211
|
+
return this.listControls()?.items().find(i => i.value() === this.inputs.firstMatch());
|
|
212
|
+
});
|
|
213
|
+
onFilter() {
|
|
214
|
+
if (this.readonly()) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
const popupControls = this.inputs.popupControls();
|
|
218
|
+
if (popupControls instanceof ComboboxDialogPattern) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const isInitialRender = !this.inputs.inputValue?.().length && !this.isDeleting;
|
|
222
|
+
if (isInitialRender) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (!this.isFocused()) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (this.inputs.popupControls()?.role() === 'tree') {
|
|
229
|
+
const treeControls = this.inputs.popupControls();
|
|
230
|
+
this.inputs.inputValue?.().length ? treeControls.expandAll() : treeControls.collapseAll();
|
|
231
|
+
}
|
|
232
|
+
const item = this.firstMatch();
|
|
233
|
+
if (!item) {
|
|
234
|
+
popupControls?.clearSelection();
|
|
235
|
+
popupControls?.unfocus();
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
popupControls?.focus(item);
|
|
239
|
+
if (this.inputs.filterMode() !== 'manual') {
|
|
240
|
+
this.select({
|
|
241
|
+
item
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
if (this.inputs.filterMode() === 'highlight' && !this.isDeleting) {
|
|
245
|
+
this.highlight();
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
highlight() {
|
|
249
|
+
const inputEl = this.inputs.inputEl();
|
|
250
|
+
const selectedItems = this.listControls()?.getSelectedItems();
|
|
251
|
+
const item = selectedItems?.[0];
|
|
252
|
+
if (!inputEl || !item) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const isHighlightable = item.searchTerm().toLowerCase().startsWith(this.inputs.inputValue().toLowerCase());
|
|
256
|
+
if (isHighlightable) {
|
|
257
|
+
inputEl.value = this.inputs.inputValue() + item.searchTerm().slice(this.inputs.inputValue().length);
|
|
258
|
+
inputEl.setSelectionRange(this.inputs.inputValue().length, item.searchTerm().length);
|
|
259
|
+
this.highlightedItem.set(item);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
close(opts) {
|
|
263
|
+
const popupControls = this.inputs.popupControls();
|
|
264
|
+
if (this.inputs.alwaysExpanded()) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
if (popupControls instanceof ComboboxDialogPattern) {
|
|
268
|
+
this.expanded.set(false);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
if (this.readonly()) {
|
|
272
|
+
this.expanded.set(false);
|
|
273
|
+
popupControls?.unfocus();
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (!opts?.reset) {
|
|
277
|
+
if (this.inputs.filterMode() === 'manual') {
|
|
278
|
+
if (!this.listControls()?.items().some(i => i.searchTerm() === this.inputs.inputEl()?.value)) {
|
|
279
|
+
this.listControls()?.clearSelection();
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
this.expanded.set(false);
|
|
283
|
+
popupControls?.unfocus();
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (!this.expanded()) {
|
|
287
|
+
this.inputs.inputValue?.set('');
|
|
288
|
+
popupControls?.clearSelection();
|
|
289
|
+
const inputEl = this.inputs.inputEl();
|
|
290
|
+
if (inputEl) {
|
|
291
|
+
inputEl.value = '';
|
|
292
|
+
}
|
|
293
|
+
} else if (this.expanded()) {
|
|
294
|
+
this.expanded.set(false);
|
|
295
|
+
const selectedItem = popupControls?.getSelectedItems()?.[0];
|
|
296
|
+
if (selectedItem?.searchTerm() !== this.inputs.inputValue()) {
|
|
297
|
+
popupControls?.clearSelection();
|
|
298
|
+
}
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
this.close();
|
|
302
|
+
if (!this.readonly()) {
|
|
303
|
+
popupControls?.clearSelection();
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
open(nav) {
|
|
307
|
+
this.expanded.set(true);
|
|
308
|
+
const popupControls = this.inputs.popupControls();
|
|
309
|
+
if (popupControls instanceof ComboboxDialogPattern) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
const inputEl = this.inputs.inputEl();
|
|
313
|
+
if (inputEl && this.inputs.filterMode() === 'highlight') {
|
|
314
|
+
const isHighlighting = inputEl.selectionStart !== inputEl.value.length;
|
|
315
|
+
this.inputs.inputValue?.set(inputEl.value.slice(0, inputEl.selectionStart || 0));
|
|
316
|
+
if (!isHighlighting) {
|
|
317
|
+
this.highlightedItem.set(undefined);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
if (nav?.first) {
|
|
321
|
+
this.first();
|
|
322
|
+
}
|
|
323
|
+
if (nav?.last) {
|
|
324
|
+
this.last();
|
|
325
|
+
}
|
|
326
|
+
if (nav?.selected) {
|
|
327
|
+
const selectedItem = popupControls?.items().find(i => popupControls?.getSelectedItems().includes(i));
|
|
328
|
+
if (selectedItem) {
|
|
329
|
+
popupControls?.focus(selectedItem);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
next() {
|
|
334
|
+
this._navigate(() => this.listControls()?.next());
|
|
335
|
+
}
|
|
336
|
+
prev() {
|
|
337
|
+
this._navigate(() => this.listControls()?.prev());
|
|
338
|
+
}
|
|
339
|
+
first() {
|
|
340
|
+
this._navigate(() => this.listControls()?.first());
|
|
341
|
+
}
|
|
342
|
+
last() {
|
|
343
|
+
this._navigate(() => this.listControls()?.last());
|
|
344
|
+
}
|
|
345
|
+
collapseItem() {
|
|
346
|
+
const controls = this.inputs.popupControls();
|
|
347
|
+
this._navigate(() => controls?.collapseItem());
|
|
348
|
+
}
|
|
349
|
+
expandItem() {
|
|
350
|
+
const controls = this.inputs.popupControls();
|
|
351
|
+
this._navigate(() => controls?.expandItem());
|
|
352
|
+
}
|
|
353
|
+
select(opts = {}) {
|
|
354
|
+
const controls = this.listControls();
|
|
355
|
+
const item = opts.item ?? controls?.getActiveItem();
|
|
356
|
+
if (item?.disabled()) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
if (opts.item) {
|
|
360
|
+
controls?.focus(opts.item, {
|
|
361
|
+
focusElement: false
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
controls?.multi() ? controls.toggle(opts.item) : controls?.select(opts.item);
|
|
365
|
+
if (opts.commit) {
|
|
366
|
+
this.commit();
|
|
367
|
+
}
|
|
368
|
+
if (opts.close) {
|
|
369
|
+
this.close();
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
commit() {
|
|
373
|
+
const inputEl = this.inputs.inputEl();
|
|
374
|
+
const selectedItems = this.listControls()?.getSelectedItems();
|
|
375
|
+
if (!inputEl) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
inputEl.value = selectedItems?.map(i => i.searchTerm()).join(', ') || '';
|
|
379
|
+
this.inputs.inputValue?.set(inputEl.value);
|
|
380
|
+
if (this.inputs.filterMode() === 'highlight' && !this.readonly()) {
|
|
381
|
+
const length = inputEl.value.length;
|
|
382
|
+
inputEl.setSelectionRange(length, length);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
_navigate(operation) {
|
|
386
|
+
operation();
|
|
387
|
+
if (this.inputs.filterMode() !== 'manual') {
|
|
388
|
+
this.select();
|
|
389
|
+
}
|
|
390
|
+
if (this.inputs.filterMode() === 'highlight') {
|
|
391
|
+
const selectedItem = this.listControls()?.getSelectedItems()[0];
|
|
392
|
+
if (!selectedItem) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
if (selectedItem === this.highlightedItem()) {
|
|
396
|
+
this.highlight();
|
|
397
|
+
} else {
|
|
398
|
+
const inputEl = this.inputs.inputEl();
|
|
399
|
+
inputEl.value = selectedItem?.searchTerm();
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
class ComboboxDialogPattern {
|
|
405
|
+
inputs;
|
|
406
|
+
id = () => this.inputs.id();
|
|
407
|
+
role = () => 'dialog';
|
|
408
|
+
keydown = computed(() => {
|
|
409
|
+
return new KeyboardEventManager().on('Escape', () => this.inputs.combobox.close());
|
|
410
|
+
});
|
|
411
|
+
constructor(inputs) {
|
|
412
|
+
this.inputs = inputs;
|
|
413
|
+
}
|
|
414
|
+
onKeydown(event) {
|
|
415
|
+
this.keydown().handle(event);
|
|
416
|
+
}
|
|
417
|
+
onClick(event) {
|
|
418
|
+
if (event.target === this.inputs.element()) {
|
|
419
|
+
this.inputs.combobox.close();
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export { ComboboxDialogPattern, ComboboxPattern };
|
|
425
|
+
//# sourceMappingURL=_combobox-chunk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_combobox-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/combobox/combobox.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 {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {computed, signal} from '@angular/core';\nimport {SignalLike, WritableSignalLike} from '../behaviors/signal-like/signal-like';\nimport {ListItem} from '../behaviors/list/list';\n\n/** Represents the required inputs for a combobox. */\nexport interface ComboboxInputs<T extends ListItem<V>, V> {\n /** The controls for the popup associated with the combobox. */\n popupControls: SignalLike<\n ComboboxListboxControls<T, V> | ComboboxTreeControls<T, V> | ComboboxDialogPattern | undefined\n >;\n\n /** The HTML input element that serves as the combobox input. */\n inputEl: SignalLike<HTMLInputElement | undefined>;\n\n /** The HTML element that serves as the combobox container. */\n containerEl: SignalLike<HTMLElement | undefined>;\n\n /** The filtering mode for the combobox. */\n filterMode: SignalLike<'manual' | 'auto-select' | 'highlight'>;\n\n /** The current value of the combobox. */\n inputValue?: WritableSignalLike<string>;\n\n /** The value of the first matching item in the popup. */\n firstMatch: SignalLike<V | undefined>;\n\n /** Whether the combobox is disabled. */\n disabled: SignalLike<boolean>;\n\n /** Whether the combobox is read-only. */\n readonly: SignalLike<boolean>;\n\n /** Whether the combobox is in a right-to-left context. */\n textDirection: SignalLike<'rtl' | 'ltr'>;\n\n /** Whether the combobox is always expanded. */\n alwaysExpanded: SignalLike<boolean>;\n}\n\n/** An interface that allows combobox popups to expose the necessary controls for the combobox. */\nexport interface ComboboxListboxControls<T extends ListItem<V>, V> {\n /** A unique identifier for the popup. */\n id: () => string;\n\n /** The ARIA role for the popup. */\n role: SignalLike<'listbox' | 'tree' | 'grid'>;\n\n // TODO(wagnermaciel): Add validation that ensures only readonly comboboxes can have multi-select popups.\n\n /** Whether multiple items in the popup can be selected at once. */\n multi: SignalLike<boolean>;\n\n /** The ID of the active item in the popup. */\n activeId: SignalLike<string | undefined>;\n\n /** The list of items in the popup. */\n items: SignalLike<T[]>;\n\n /** Navigates to the given item in the popup. */\n focus: (item: T, opts?: {focusElement?: boolean}) => void;\n\n /** Navigates to the next item in the popup. */\n next: () => void;\n\n /** Navigates to the previous item in the popup. */\n prev: () => void;\n\n /** Navigates to the first item in the popup. */\n first: () => void;\n\n /** Navigates to the last item in the popup. */\n last: () => void;\n\n /** Selects the current item in the popup. */\n select: (item?: T) => void;\n\n /** Toggles the selection state of the given item in the popup. */\n toggle: (item?: T) => void;\n\n /** Clears the selection state of the popup. */\n clearSelection: () => void;\n\n /** Removes focus from any item in the popup. */\n unfocus: () => void;\n\n /** Returns the item corresponding to the given event. */\n getItem: (e: PointerEvent) => T | undefined;\n\n /** Returns the currently active (focused) item in the popup. */\n getActiveItem: () => T | undefined;\n\n /** Returns the currently selected items in the popup. */\n getSelectedItems: () => T[];\n\n /** Sets the value of the combobox based on the selected item. */\n setValue: (value: V | undefined) => void; // For re-setting the value if the popup was destroyed.\n}\n\nexport interface ComboboxTreeControls<T extends ListItem<V>, V> extends ComboboxListboxControls<\n T,\n V\n> {\n /** Whether the currently active item in the popup is collapsible. */\n isItemCollapsible: () => boolean;\n\n /** Expands the currently active item in the popup. */\n expandItem: () => void;\n\n /** Collapses the currently active item in the popup. */\n collapseItem: () => void;\n\n /** Checks if the currently active item in the popup is expandable. */\n isItemExpandable: (item?: T) => boolean;\n\n /** Expands all nodes in the tree. */\n expandAll: () => void;\n\n /** Collapses all nodes in the tree. */\n collapseAll: () => void;\n\n /** Toggles the expansion state of the currently active item in the popup. */\n toggleExpansion: (item?: T) => void;\n\n /** Whether the current active item is selectable. */\n isItemSelectable: (item?: T) => boolean;\n}\n\n/** Controls the state of a combobox. */\nexport class ComboboxPattern<T extends ListItem<V>, V> {\n /** Whether the combobox is expanded. */\n expanded = signal(false);\n\n /** Whether the combobox is disabled. */\n disabled = () => this.inputs.disabled();\n\n /** The ID of the active item in the combobox. */\n activeDescendant = computed(() => {\n const popupControls = this.inputs.popupControls();\n if (popupControls instanceof ComboboxDialogPattern) {\n return null;\n }\n\n return popupControls?.activeId() ?? null;\n });\n\n /** The currently highlighted item in the combobox. */\n highlightedItem = signal<T | undefined>(undefined);\n\n /** Whether the most recent input event was a deletion. */\n isDeleting = false;\n\n /** Whether the combobox is focused. */\n isFocused = signal(false);\n\n /** Whether the combobox has ever been focused. */\n hasBeenFocused = signal(false);\n\n /** The key used to navigate to the previous item in the list. */\n expandKey = computed(() => (this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight'));\n\n /** The key used to navigate to the next item in the list. */\n collapseKey = computed(() =>\n this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft',\n );\n\n /** The ID of the popup associated with the combobox. */\n popupId = computed(() => this.inputs.popupControls()?.id() || null);\n\n /** The autocomplete behavior of the combobox. */\n autocomplete = computed(() => (this.inputs.filterMode() === 'highlight' ? 'both' : 'list'));\n\n /** The ARIA role of the popup associated with the combobox. */\n hasPopup = computed(() => this.inputs.popupControls()?.role() || null);\n\n /** Whether the combobox is read-only. */\n readonly = computed(() => this.inputs.readonly() || this.inputs.disabled() || null);\n\n /** Returns the listbox controls for the combobox. */\n listControls = () => {\n const popupControls = this.inputs.popupControls();\n\n if (popupControls instanceof ComboboxDialogPattern) {\n return null;\n }\n\n return popupControls;\n };\n\n /** Returns the tree controls for the combobox. */\n treeControls = () => {\n const popupControls = this.inputs.popupControls();\n\n if (popupControls?.role() === 'tree') {\n return popupControls as ComboboxTreeControls<T, V>;\n }\n\n return null;\n };\n\n /** The keydown event manager for the combobox. */\n keydown = computed(() => {\n const manager = new KeyboardEventManager();\n const popupControls = this.inputs.popupControls();\n\n if (!popupControls) {\n return manager;\n }\n\n if (popupControls instanceof ComboboxDialogPattern) {\n if (!this.expanded()) {\n manager.on('ArrowUp', () => this.open()).on('ArrowDown', () => this.open());\n\n if (this.readonly()) {\n manager.on('Enter', () => this.open()).on(' ', () => this.open());\n }\n }\n\n return manager;\n }\n\n if (!this.inputs.alwaysExpanded()) {\n manager.on('Escape', () => this.close({reset: !this.readonly()}));\n }\n\n if (!this.expanded()) {\n manager\n .on('ArrowDown', () => this.open({first: true}))\n .on('ArrowUp', () => this.open({last: true}));\n\n if (this.readonly()) {\n manager\n .on('Enter', () => this.open({selected: true}))\n .on(' ', () => this.open({selected: true}));\n }\n\n return manager;\n }\n\n manager\n .on('ArrowDown', () => this.next())\n .on('ArrowUp', () => this.prev())\n .on('Home', () => this.first())\n .on('End', () => this.last());\n\n if (this.readonly()) {\n manager.on(' ', () => this.select({commit: true, close: !popupControls.multi()}));\n }\n\n if (popupControls.role() === 'listbox') {\n manager.on('Enter', () => {\n this.select({commit: true, close: !popupControls.multi()});\n });\n }\n\n const treeControls = this.treeControls();\n\n if (treeControls?.isItemSelectable()) {\n manager.on('Enter', () => this.select({commit: true, close: true}));\n }\n\n if (treeControls?.isItemExpandable()) {\n manager\n .on(this.expandKey(), () => this.expandItem())\n .on(this.collapseKey(), () => this.collapseItem());\n\n if (!treeControls.isItemSelectable()) {\n manager.on('Enter', () => this.expandItem());\n }\n }\n\n if (treeControls?.isItemCollapsible()) {\n manager.on(this.collapseKey(), () => this.collapseItem());\n }\n\n return manager;\n });\n\n /** The click event manager for the combobox. */\n click = computed(() =>\n new PointerEventManager().on(e => {\n if (e.target === this.inputs.inputEl()) {\n if (this.readonly()) {\n this.expanded() ? this.close() : this.open({selected: true});\n }\n }\n\n const controls = this.inputs.popupControls();\n\n if (controls instanceof ComboboxDialogPattern) {\n return;\n }\n\n const item = controls?.getItem(e);\n\n if (item) {\n if (controls?.role() === 'tree') {\n const treeControls = controls as ComboboxTreeControls<T, V>;\n\n if (treeControls.isItemExpandable(item) && !treeControls.isItemSelectable(item)) {\n treeControls.toggleExpansion(item);\n this.inputs.inputEl()?.focus();\n return;\n }\n }\n\n this.select({item, commit: true, close: !controls?.multi()});\n this.inputs.inputEl()?.focus(); // Return focus to the input after selecting.\n }\n }),\n );\n\n constructor(readonly inputs: ComboboxInputs<T, V>) {}\n\n /** Handles keydown events for the combobox. */\n onKeydown(event: KeyboardEvent) {\n if (!this.inputs.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n /** Handles click events for the combobox. */\n onClick(event: MouseEvent) {\n if (!this.inputs.disabled()) {\n this.click().handle(event as PointerEvent);\n }\n }\n\n /** Handles input events for the combobox. */\n onInput(event: Event) {\n if (this.inputs.disabled() || this.inputs.readonly()) {\n return;\n }\n\n const inputEl = this.inputs.inputEl();\n\n if (!inputEl) {\n return;\n }\n\n const popupControls = this.inputs.popupControls();\n\n if (popupControls instanceof ComboboxDialogPattern) {\n return;\n }\n\n this.open();\n this.inputs.inputValue?.set(inputEl.value);\n this.isDeleting = event instanceof InputEvent && !!event.inputType.match(/^delete/);\n\n if (this.inputs.filterMode() === 'highlight' && !this.isDeleting) {\n this.highlight();\n }\n }\n\n /** Handles focus in events for the combobox. */\n onFocusIn() {\n if (this.inputs.alwaysExpanded() && !this.hasBeenFocused()) {\n const firstSelectedItem = this.listControls()?.getSelectedItems()[0];\n firstSelectedItem ? this.listControls()?.focus(firstSelectedItem) : this.first();\n }\n\n this.isFocused.set(true);\n this.hasBeenFocused.set(true);\n }\n\n /** Handles focus out events for the combobox. */\n onFocusOut(event: FocusEvent) {\n if (this.inputs.disabled()) {\n return;\n }\n\n const popupControls = this.inputs.popupControls();\n\n if (popupControls instanceof ComboboxDialogPattern) {\n return;\n }\n\n if (\n !(event.relatedTarget instanceof HTMLElement) ||\n !this.inputs.containerEl()?.contains(event.relatedTarget)\n ) {\n this.isFocused.set(false);\n\n if (!this.expanded()) {\n return;\n }\n\n if (this.readonly()) {\n this.close();\n return;\n }\n\n if (this.inputs.filterMode() !== 'manual') {\n this.commit();\n } else {\n const item = popupControls\n ?.items()\n .find(i => i.searchTerm() === this.inputs.inputEl()?.value);\n\n if (item) {\n this.select({item});\n }\n }\n\n this.close();\n }\n }\n\n /** The first matching item in the combobox. */\n firstMatch = computed(() => {\n // TODO(wagnermaciel): Consider whether we should not provide this default behavior for the\n // listbox. Instead, we may want to allow users to have no match so that typing does not focus\n // any option.\n if (this.listControls()?.role() === 'listbox') {\n return this.listControls()?.items()[0];\n }\n\n return this.listControls()\n ?.items()\n .find(i => i.value() === this.inputs.firstMatch());\n });\n\n /** Handles filtering logic for the combobox. */\n onFilter() {\n if (this.readonly()) {\n return;\n }\n\n const popupControls = this.inputs.popupControls();\n\n if (popupControls instanceof ComboboxDialogPattern) {\n return;\n }\n\n // TODO(wagnermaciel)\n // When the user first interacts with the combobox, the popup will lazily render for the first\n // time. This is a simple way to detect this and avoid auto-focus & selection logic, but this\n // should probably be moved to the component layer instead.\n const isInitialRender = !this.inputs.inputValue?.().length && !this.isDeleting;\n\n if (isInitialRender) {\n return;\n }\n\n // Avoid refocusing the input if a filter event occurs after focus has left the combobox.\n if (!this.isFocused()) {\n return;\n }\n\n if (this.inputs.popupControls()?.role() === 'tree') {\n const treeControls = this.inputs.popupControls() as ComboboxTreeControls<T, V>;\n this.inputs.inputValue?.().length ? treeControls.expandAll() : treeControls.collapseAll();\n }\n\n const item = this.firstMatch();\n\n if (!item) {\n popupControls?.clearSelection();\n popupControls?.unfocus();\n return;\n }\n\n popupControls?.focus(item);\n\n if (this.inputs.filterMode() !== 'manual') {\n this.select({item});\n }\n\n if (this.inputs.filterMode() === 'highlight' && !this.isDeleting) {\n this.highlight();\n }\n }\n\n /** Highlights the currently selected item in the combobox. */\n highlight() {\n const inputEl = this.inputs.inputEl();\n const selectedItems = this.listControls()?.getSelectedItems();\n const item = selectedItems?.[0];\n\n if (!inputEl || !item) {\n return;\n }\n\n const isHighlightable = item\n .searchTerm()\n .toLowerCase()\n .startsWith(this.inputs.inputValue!().toLowerCase());\n\n if (isHighlightable) {\n inputEl.value =\n this.inputs.inputValue!() + item.searchTerm().slice(this.inputs.inputValue!().length);\n inputEl.setSelectionRange(this.inputs.inputValue!().length, item.searchTerm().length);\n this.highlightedItem.set(item);\n }\n }\n\n /** Closes the combobox. */\n close(opts?: {reset: boolean}) {\n const popupControls = this.inputs.popupControls();\n\n if (this.inputs.alwaysExpanded()) {\n return;\n }\n\n if (popupControls instanceof ComboboxDialogPattern) {\n this.expanded.set(false);\n return;\n }\n\n if (this.readonly()) {\n this.expanded.set(false);\n popupControls?.unfocus();\n return;\n }\n\n if (!opts?.reset) {\n if (this.inputs.filterMode() === 'manual') {\n if (\n !this.listControls()\n ?.items()\n .some(i => i.searchTerm() === this.inputs.inputEl()?.value)\n ) {\n this.listControls()?.clearSelection();\n }\n }\n\n this.expanded.set(false);\n popupControls?.unfocus();\n return;\n }\n\n if (!this.expanded()) {\n this.inputs.inputValue?.set('');\n popupControls?.clearSelection();\n\n const inputEl = this.inputs.inputEl();\n\n if (inputEl) {\n inputEl.value = '';\n }\n } else if (this.expanded()) {\n this.expanded.set(false);\n const selectedItem = popupControls?.getSelectedItems()?.[0];\n\n if (selectedItem?.searchTerm() !== this.inputs.inputValue!()) {\n popupControls?.clearSelection();\n }\n\n return;\n }\n\n this.close();\n\n if (!this.readonly()) {\n popupControls?.clearSelection();\n }\n }\n\n /** Opens the combobox. */\n open(nav?: {first?: boolean; last?: boolean; selected?: boolean}) {\n this.expanded.set(true);\n const popupControls = this.inputs.popupControls();\n\n if (popupControls instanceof ComboboxDialogPattern) {\n return;\n }\n\n const inputEl = this.inputs.inputEl();\n\n if (inputEl && this.inputs.filterMode() === 'highlight') {\n const isHighlighting = inputEl.selectionStart !== inputEl.value.length;\n this.inputs.inputValue?.set(inputEl.value.slice(0, inputEl.selectionStart || 0));\n if (!isHighlighting) {\n this.highlightedItem.set(undefined);\n }\n }\n\n if (nav?.first) {\n this.first();\n }\n if (nav?.last) {\n this.last();\n }\n if (nav?.selected) {\n const selectedItem = popupControls\n ?.items()\n .find(i => popupControls?.getSelectedItems().includes(i));\n\n if (selectedItem) {\n popupControls?.focus(selectedItem);\n }\n }\n }\n\n /** Navigates to the next focusable item in the combobox popup. */\n next() {\n this._navigate(() => this.listControls()?.next());\n }\n\n /** Navigates to the previous focusable item in the combobox popup. */\n prev() {\n this._navigate(() => this.listControls()?.prev());\n }\n\n /** Navigates to the first focusable item in the combobox popup. */\n first() {\n this._navigate(() => this.listControls()?.first());\n }\n\n /** Navigates to the last focusable item in the combobox popup. */\n last() {\n this._navigate(() => this.listControls()?.last());\n }\n\n /** Collapses the currently focused item in the combobox. */\n collapseItem() {\n const controls = this.inputs.popupControls() as ComboboxTreeControls<T, V>;\n this._navigate(() => controls?.collapseItem());\n }\n\n /** Expands the currently focused item in the combobox. */\n expandItem() {\n const controls = this.inputs.popupControls() as ComboboxTreeControls<T, V>;\n this._navigate(() => controls?.expandItem());\n }\n\n /** Selects an item in the combobox popup. */\n select(opts: {item?: T; commit?: boolean; close?: boolean} = {}) {\n const controls = this.listControls();\n\n const item = opts.item ?? controls?.getActiveItem();\n\n if (item?.disabled()) {\n return;\n }\n\n if (opts.item) {\n controls?.focus(opts.item, {focusElement: false});\n }\n\n controls?.multi() ? controls.toggle(opts.item) : controls?.select(opts.item);\n\n if (opts.commit) {\n this.commit();\n }\n if (opts.close) {\n this.close();\n }\n }\n\n /** Updates the value of the input based on the currently selected item. */\n commit() {\n const inputEl = this.inputs.inputEl();\n const selectedItems = this.listControls()?.getSelectedItems();\n\n if (!inputEl) {\n return;\n }\n\n inputEl.value = selectedItems?.map(i => i.searchTerm()).join(', ') || '';\n this.inputs.inputValue?.set(inputEl.value);\n\n if (this.inputs.filterMode() === 'highlight' && !this.readonly()) {\n const length = inputEl.value.length;\n inputEl.setSelectionRange(length, length);\n }\n }\n\n /** Navigates and handles additional actions based on filter mode. */\n private _navigate(operation: () => void) {\n operation();\n\n if (this.inputs.filterMode() !== 'manual') {\n this.select();\n }\n\n if (this.inputs.filterMode() === 'highlight') {\n // This is to handle when the user navigates back to the originally highlighted item.\n // E.g. User types \"Al\", highlights \"Alice\", then navigates down and back up to \"Alice\".\n const selectedItem = this.listControls()?.getSelectedItems()[0];\n\n if (!selectedItem) {\n return;\n }\n\n if (selectedItem === this.highlightedItem()) {\n this.highlight();\n } else {\n const inputEl = this.inputs.inputEl()!;\n inputEl.value = selectedItem?.searchTerm()!;\n }\n }\n }\n}\n\nexport class ComboboxDialogPattern {\n id = () => this.inputs.id();\n\n role = () => 'dialog' as const;\n\n keydown = computed(() => {\n return new KeyboardEventManager().on('Escape', () => this.inputs.combobox.close());\n });\n\n constructor(\n readonly inputs: {\n combobox: ComboboxPattern<any, any>;\n element: SignalLike<HTMLDialogElement>;\n id: SignalLike<string>;\n },\n ) {}\n\n onKeydown(event: KeyboardEvent) {\n this.keydown().handle(event);\n }\n\n onClick(event: MouseEvent) {\n // The \"click\" event fires on the dialog when the user clicks outside of the dialog content.\n if (event.target === this.inputs.element()) {\n this.inputs.combobox.close();\n }\n }\n}\n"],"names":["ComboboxPattern","inputs","expanded","signal","disabled","activeDescendant","computed","popupControls","ComboboxDialogPattern","activeId","highlightedItem","undefined","isDeleting","isFocused","hasBeenFocused","expandKey","textDirection","collapseKey","popupId","id","autocomplete","filterMode","hasPopup","role","readonly","listControls","treeControls","keydown","manager","KeyboardEventManager","on","open","alwaysExpanded","close","reset","first","last","selected","next","prev","select","commit","multi","isItemSelectable","isItemExpandable","expandItem","collapseItem","isItemCollapsible","click","PointerEventManager","e","target","inputEl","controls","item","getItem","toggleExpansion","focus","constructor","onKeydown","event","handle","onClick","onInput","inputValue","set","value","InputEvent","inputType","match","highlight","onFocusIn","firstSelectedItem","getSelectedItems","onFocusOut","relatedTarget","HTMLElement","containerEl","contains","items","find","i","searchTerm","firstMatch","onFilter","isInitialRender","length","expandAll","collapseAll","clearSelection","unfocus","selectedItems","isHighlightable","toLowerCase","startsWith","slice","setSelectionRange","opts","some","selectedItem","nav","isHighlighting","selectionStart","includes","_navigate","getActiveItem","focusElement","toggle","map","join","operation","combobox","element"],"mappings":";;;MAyIaA,eAAe,CAAA;EAuLLC,MAAA;AArLrBC,EAAAA,QAAQ,GAAGC,MAAM,CAAC,KAAK,CAAC;EAGxBC,QAAQ,GAAGA,MAAM,IAAI,CAACH,MAAM,CAACG,QAAQ,EAAE;EAGvCC,gBAAgB,GAAGC,QAAQ,CAAC,MAAK;IAC/B,MAAMC,aAAa,GAAG,IAAI,CAACN,MAAM,CAACM,aAAa,EAAE;IACjD,IAAIA,aAAa,YAAYC,qBAAqB,EAAE;AAClD,MAAA,OAAO,IAAI;AACb;AAEA,IAAA,OAAOD,aAAa,EAAEE,QAAQ,EAAE,IAAI,IAAI;AAC1C,GAAC,CAAC;AAGFC,EAAAA,eAAe,GAAGP,MAAM,CAAgBQ,SAAS,CAAC;AAGlDC,EAAAA,UAAU,GAAG,KAAK;AAGlBC,EAAAA,SAAS,GAAGV,MAAM,CAAC,KAAK,CAAC;AAGzBW,EAAAA,cAAc,GAAGX,MAAM,CAAC,KAAK,CAAC;AAG9BY,EAAAA,SAAS,GAAGT,QAAQ,CAAC,MAAO,IAAI,CAACL,MAAM,CAACe,aAAa,EAAE,KAAK,KAAK,GAAG,WAAW,GAAG,YAAa,CAAC;AAGhGC,EAAAA,WAAW,GAAGX,QAAQ,CAAC,MACrB,IAAI,CAACL,MAAM,CAACe,aAAa,EAAE,KAAK,KAAK,GAAG,YAAY,GAAG,WAAW,CACnE;AAGDE,EAAAA,OAAO,GAAGZ,QAAQ,CAAC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