@angular/cdk-experimental 20.0.0-next.7 → 20.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/combobox/index.d.ts +1 -0
- package/fesm2022/cdk-experimental.mjs +1 -1
- package/fesm2022/cdk-experimental.mjs.map +1 -1
- package/fesm2022/column-resize.mjs +1 -2
- package/fesm2022/column-resize.mjs.map +1 -1
- package/fesm2022/combobox.mjs +4 -4
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/deferred-content.mjs.map +1 -1
- package/fesm2022/{list-focus-DtTH4bDx.mjs → list-focus-CSTLIgwc.mjs} +111 -87
- package/fesm2022/list-focus-CSTLIgwc.mjs.map +1 -0
- package/fesm2022/listbox.mjs +2 -2
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/{option-Bgpacz3g.mjs → option-D1-Zcobx.mjs} +98 -79
- package/fesm2022/option-D1-Zcobx.mjs.map +1 -0
- package/fesm2022/polyfill-DRXnWbMt.mjs.map +1 -1
- package/fesm2022/popover-edit.mjs +1 -2
- package/fesm2022/popover-edit.mjs.map +1 -1
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/selection.mjs.map +1 -1
- package/fesm2022/table-scroll-container.mjs +1 -2
- package/fesm2022/table-scroll-container.mjs.map +1 -1
- package/fesm2022/{tabs-cBelBNjZ.mjs → tabs-C0pLghH2.mjs} +5 -10
- package/fesm2022/tabs-C0pLghH2.mjs.map +1 -0
- package/fesm2022/tabs.mjs +2 -2
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/ui-patterns.mjs +3 -3
- package/fesm2022/ui-patterns.mjs.map +1 -1
- package/{list-focus.d-1SGksIi8.d.ts → list-navigation.d-cy63EByU.d.ts} +88 -79
- package/listbox/index.d.ts +2 -2
- package/{listbox.d-C-LFh0S9.d.ts → listbox.d-DJqDR_H3.d.ts} +39 -19
- package/package.json +2 -2
- package/tabs/index.d.ts +2 -2
- package/{tabs.d-BIIDt2Rf.d.ts → tabs.d-CWu2orP4.d.ts} +1 -1
- package/ui-patterns/index.d.ts +3 -3
- package/fesm2022/list-focus-DtTH4bDx.mjs.map +0 -1
- package/fesm2022/option-Bgpacz3g.mjs.map +0 -1
- package/fesm2022/tabs-cBelBNjZ.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyboardEventManager, ModifierKey, PointerEventManager,
|
|
1
|
+
import { KeyboardEventManager, ModifierKey, PointerEventManager, ListFocus, ListSelection, ListNavigation } from './list-focus-CSTLIgwc.mjs';
|
|
2
2
|
import { computed, signal } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
/** Controls typeahead for a list of items. */
|
|
@@ -6,8 +6,8 @@ class ListTypeahead {
|
|
|
6
6
|
inputs;
|
|
7
7
|
/** A reference to the timeout for resetting the typeahead search. */
|
|
8
8
|
timeout;
|
|
9
|
-
/** The
|
|
10
|
-
|
|
9
|
+
/** The focus controller of the parent list. */
|
|
10
|
+
focusManager;
|
|
11
11
|
/** Whether the user is actively typing a typeahead search query. */
|
|
12
12
|
isTyping = computed(() => this._query().length > 0);
|
|
13
13
|
/** Keeps track of the characters that typeahead search is being called with. */
|
|
@@ -16,43 +16,44 @@ class ListTypeahead {
|
|
|
16
16
|
_startIndex = signal(undefined);
|
|
17
17
|
constructor(inputs) {
|
|
18
18
|
this.inputs = inputs;
|
|
19
|
-
this.
|
|
19
|
+
this.focusManager = inputs.focusManager;
|
|
20
20
|
}
|
|
21
21
|
/** Performs a typeahead search, appending the given character to the search string. */
|
|
22
22
|
search(char) {
|
|
23
23
|
if (char.length !== 1) {
|
|
24
|
-
return;
|
|
24
|
+
return false;
|
|
25
25
|
}
|
|
26
26
|
if (!this.isTyping() && char === ' ') {
|
|
27
|
-
return;
|
|
27
|
+
return false;
|
|
28
28
|
}
|
|
29
29
|
if (this._startIndex() === undefined) {
|
|
30
|
-
this._startIndex.set(this.
|
|
30
|
+
this._startIndex.set(this.focusManager.inputs.activeIndex());
|
|
31
31
|
}
|
|
32
32
|
clearTimeout(this.timeout);
|
|
33
33
|
this._query.update(q => q + char.toLowerCase());
|
|
34
34
|
const item = this._getItem();
|
|
35
35
|
if (item) {
|
|
36
|
-
this.
|
|
36
|
+
this.focusManager.focus(item);
|
|
37
37
|
}
|
|
38
38
|
this.timeout = setTimeout(() => {
|
|
39
39
|
this._query.set('');
|
|
40
40
|
this._startIndex.set(undefined);
|
|
41
41
|
}, this.inputs.typeaheadDelay() * 1000);
|
|
42
|
+
return true;
|
|
42
43
|
}
|
|
43
44
|
/**
|
|
44
45
|
* Returns the first item whose search term matches the
|
|
45
46
|
* current query starting from the the current anchor index.
|
|
46
47
|
*/
|
|
47
48
|
_getItem() {
|
|
48
|
-
let items = this.
|
|
49
|
+
let items = this.focusManager.inputs.items();
|
|
49
50
|
const after = items.slice(this._startIndex() + 1);
|
|
50
51
|
const before = items.slice(0, this._startIndex());
|
|
51
|
-
items =
|
|
52
|
-
items.push(this.
|
|
52
|
+
items = after.concat(before);
|
|
53
|
+
items.push(this.inputs.items()[this._startIndex()]);
|
|
53
54
|
const focusableItems = [];
|
|
54
55
|
for (const item of items) {
|
|
55
|
-
if (this.
|
|
56
|
+
if (this.focusManager.isFocusable(item)) {
|
|
56
57
|
focusableItems.push(item);
|
|
57
58
|
}
|
|
58
59
|
}
|
|
@@ -74,7 +75,7 @@ class ListboxPattern {
|
|
|
74
75
|
/** Whether the list is vertically or horizontally oriented. */
|
|
75
76
|
orientation;
|
|
76
77
|
/** Whether the listbox is disabled. */
|
|
77
|
-
disabled;
|
|
78
|
+
disabled = computed(() => this.focusManager.isListDisabled());
|
|
78
79
|
/** Whether the listbox is readonly. */
|
|
79
80
|
readonly;
|
|
80
81
|
/** The tabindex of the listbox. */
|
|
@@ -87,6 +88,8 @@ class ListboxPattern {
|
|
|
87
88
|
setsize = computed(() => this.navigation.inputs.items().length);
|
|
88
89
|
/** Whether the listbox selection follows focus. */
|
|
89
90
|
followFocus = computed(() => this.inputs.selectionMode() === 'follow');
|
|
91
|
+
/** Whether the listbox should wrap. Used to disable wrapping while range selecting. */
|
|
92
|
+
wrap = signal(true);
|
|
90
93
|
/** The key used to navigate to the previous item in the list. */
|
|
91
94
|
prevKey = computed(() => {
|
|
92
95
|
if (this.inputs.orientation() === 'vertical') {
|
|
@@ -105,6 +108,19 @@ class ListboxPattern {
|
|
|
105
108
|
dynamicSpaceKey = computed(() => (this.typeahead.isTyping() ? '' : ' '));
|
|
106
109
|
/** The regexp used to decide if a key should trigger typeahead. */
|
|
107
110
|
typeaheadRegexp = /^.$/; // TODO: Ignore spaces?
|
|
111
|
+
/**
|
|
112
|
+
* The uncommitted index for selecting a range of options.
|
|
113
|
+
*
|
|
114
|
+
* NOTE: This is subtly distinct from the "rangeStartIndex" in the ListSelection behavior.
|
|
115
|
+
* The anchorIndex does not necessarily represent the start of a range, but represents the most
|
|
116
|
+
* recent index where the user showed intent to begin a range selection. Usually, this is wherever
|
|
117
|
+
* the user most recently pressed the "Shift" key, but if the user presses shift + space to select
|
|
118
|
+
* from the anchor, the user is not intending to start a new range from this index.
|
|
119
|
+
*
|
|
120
|
+
* In other words, "rangeStartIndex" is only set when a user commits to starting a range selection
|
|
121
|
+
* while "anchorIndex" is set whenever a user indicates they may be starting a range selection.
|
|
122
|
+
*/
|
|
123
|
+
anchorIndex = signal(0);
|
|
108
124
|
/** The keydown event manager for the listbox. */
|
|
109
125
|
keydown = computed(() => {
|
|
110
126
|
const manager = new KeyboardEventManager();
|
|
@@ -134,30 +150,36 @@ class ListboxPattern {
|
|
|
134
150
|
}
|
|
135
151
|
if (this.inputs.multi()) {
|
|
136
152
|
manager
|
|
137
|
-
.on(ModifierKey.
|
|
138
|
-
.on(ModifierKey.Shift, this.prevKey, () => this.prev({
|
|
139
|
-
.on(ModifierKey.Shift, this.nextKey, () => this.next({
|
|
140
|
-
.on([ModifierKey.Ctrl, ModifierKey.Meta], '
|
|
141
|
-
.on([ModifierKey.Ctrl | ModifierKey.Shift, ModifierKey.Meta | ModifierKey.Shift], '
|
|
142
|
-
.on(
|
|
143
|
-
.on(ModifierKey.Shift, this.dynamicSpaceKey, () => this._updateSelection({
|
|
153
|
+
.on(ModifierKey.Any, 'Shift', () => this.anchorIndex.set(this.inputs.activeIndex()))
|
|
154
|
+
.on(ModifierKey.Shift, this.prevKey, () => this.prev({ selectRange: true }))
|
|
155
|
+
.on(ModifierKey.Shift, this.nextKey, () => this.next({ selectRange: true }))
|
|
156
|
+
.on([ModifierKey.Ctrl | ModifierKey.Shift, ModifierKey.Meta | ModifierKey.Shift], 'Home', () => this.first({ selectRange: true, anchor: false }))
|
|
157
|
+
.on([ModifierKey.Ctrl | ModifierKey.Shift, ModifierKey.Meta | ModifierKey.Shift], 'End', () => this.last({ selectRange: true, anchor: false }))
|
|
158
|
+
.on(ModifierKey.Shift, 'Enter', () => this._updateSelection({ selectRange: true, anchor: false }))
|
|
159
|
+
.on(ModifierKey.Shift, this.dynamicSpaceKey, () => this._updateSelection({ selectRange: true, anchor: false }));
|
|
144
160
|
}
|
|
145
161
|
if (!this.followFocus() && this.inputs.multi()) {
|
|
146
|
-
manager
|
|
147
|
-
|
|
162
|
+
manager
|
|
163
|
+
.on(this.dynamicSpaceKey, () => this.selection.toggle())
|
|
164
|
+
.on('Enter', () => this.selection.toggle())
|
|
165
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], 'A', () => this.selection.toggleAll());
|
|
148
166
|
}
|
|
149
167
|
if (!this.followFocus() && !this.inputs.multi()) {
|
|
150
|
-
manager.on(this.dynamicSpaceKey, () => this.
|
|
151
|
-
manager.on('Enter', () => this.
|
|
168
|
+
manager.on(this.dynamicSpaceKey, () => this.selection.toggleOne());
|
|
169
|
+
manager.on('Enter', () => this.selection.toggleOne());
|
|
152
170
|
}
|
|
153
171
|
if (this.inputs.multi() && this.followFocus()) {
|
|
154
172
|
manager
|
|
155
173
|
.on([ModifierKey.Ctrl, ModifierKey.Meta], this.prevKey, () => this.prev())
|
|
156
174
|
.on([ModifierKey.Ctrl, ModifierKey.Meta], this.nextKey, () => this.next())
|
|
157
|
-
.on([ModifierKey.Ctrl, ModifierKey.Meta], ' ', () => this.
|
|
158
|
-
.on([ModifierKey.Ctrl, ModifierKey.Meta], 'Enter', () => this.
|
|
159
|
-
.on([ModifierKey.Ctrl, ModifierKey.Meta], 'Home', () => this.first())
|
|
160
|
-
.on([ModifierKey.Ctrl, ModifierKey.Meta], 'End', () => this.last())
|
|
175
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], ' ', () => this.selection.toggle())
|
|
176
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], 'Enter', () => this.selection.toggle())
|
|
177
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], 'Home', () => this.first())
|
|
178
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], 'End', () => this.last())
|
|
179
|
+
.on([ModifierKey.Ctrl, ModifierKey.Meta], 'A', () => {
|
|
180
|
+
this.selection.toggleAll();
|
|
181
|
+
this.selection.select(); // Ensure the currect option remains selected.
|
|
182
|
+
});
|
|
161
183
|
}
|
|
162
184
|
return manager;
|
|
163
185
|
});
|
|
@@ -167,6 +189,9 @@ class ListboxPattern {
|
|
|
167
189
|
if (this.readonly()) {
|
|
168
190
|
return manager.on(e => this.goto(e));
|
|
169
191
|
}
|
|
192
|
+
if (this.multi()) {
|
|
193
|
+
manager.on(ModifierKey.Shift, e => this.goto(e, { selectRange: true }));
|
|
194
|
+
}
|
|
170
195
|
if (!this.multi() && this.followFocus()) {
|
|
171
196
|
return manager.on(e => this.goto(e, { selectOne: true }));
|
|
172
197
|
}
|
|
@@ -176,26 +201,26 @@ class ListboxPattern {
|
|
|
176
201
|
if (this.multi() && this.followFocus()) {
|
|
177
202
|
return manager
|
|
178
203
|
.on(e => this.goto(e, { selectOne: true }))
|
|
179
|
-
.on(ModifierKey.Ctrl, e => this.goto(e, { toggle: true }))
|
|
180
|
-
.on(ModifierKey.Shift, e => this.goto(e, { toggleFromAnchor: true }));
|
|
204
|
+
.on(ModifierKey.Ctrl, e => this.goto(e, { toggle: true }));
|
|
181
205
|
}
|
|
182
206
|
if (this.multi() && !this.followFocus()) {
|
|
183
|
-
return manager
|
|
184
|
-
.on(e => this.goto(e, { toggle: true }))
|
|
185
|
-
.on(ModifierKey.Shift, e => this.goto(e, { toggleFromAnchor: true }));
|
|
207
|
+
return manager.on(e => this.goto(e, { toggle: true }));
|
|
186
208
|
}
|
|
187
209
|
return manager;
|
|
188
210
|
});
|
|
189
211
|
constructor(inputs) {
|
|
190
212
|
this.inputs = inputs;
|
|
191
|
-
this.disabled = inputs.disabled;
|
|
192
213
|
this.readonly = inputs.readonly;
|
|
193
214
|
this.orientation = inputs.orientation;
|
|
194
215
|
this.multi = inputs.multi;
|
|
195
|
-
this.
|
|
196
|
-
this.selection = new ListSelection({ ...inputs,
|
|
197
|
-
this.typeahead = new ListTypeahead({ ...inputs,
|
|
198
|
-
this.
|
|
216
|
+
this.focusManager = new ListFocus(inputs);
|
|
217
|
+
this.selection = new ListSelection({ ...inputs, focusManager: this.focusManager });
|
|
218
|
+
this.typeahead = new ListTypeahead({ ...inputs, focusManager: this.focusManager });
|
|
219
|
+
this.navigation = new ListNavigation({
|
|
220
|
+
...inputs,
|
|
221
|
+
focusManager: this.focusManager,
|
|
222
|
+
wrap: computed(() => this.wrap() && this.inputs.wrap()),
|
|
223
|
+
});
|
|
199
224
|
}
|
|
200
225
|
/** Handles keydown events for the listbox. */
|
|
201
226
|
onKeydown(event) {
|
|
@@ -210,75 +235,69 @@ class ListboxPattern {
|
|
|
210
235
|
}
|
|
211
236
|
/** Navigates to the first option in the listbox. */
|
|
212
237
|
first(opts) {
|
|
213
|
-
this.navigation.first();
|
|
214
|
-
this.focusManager.focus();
|
|
215
|
-
this._updateSelection(opts);
|
|
238
|
+
this._navigate(opts, () => this.navigation.first());
|
|
216
239
|
}
|
|
217
240
|
/** Navigates to the last option in the listbox. */
|
|
218
241
|
last(opts) {
|
|
219
|
-
this.navigation.last();
|
|
220
|
-
this.focusManager.focus();
|
|
221
|
-
this._updateSelection(opts);
|
|
242
|
+
this._navigate(opts, () => this.navigation.last());
|
|
222
243
|
}
|
|
223
244
|
/** Navigates to the next option in the listbox. */
|
|
224
245
|
next(opts) {
|
|
225
|
-
this.navigation.next();
|
|
226
|
-
this.focusManager.focus();
|
|
227
|
-
this._updateSelection(opts);
|
|
246
|
+
this._navigate(opts, () => this.navigation.next());
|
|
228
247
|
}
|
|
229
248
|
/** Navigates to the previous option in the listbox. */
|
|
230
249
|
prev(opts) {
|
|
231
|
-
this.navigation.prev();
|
|
232
|
-
this.focusManager.focus();
|
|
233
|
-
this._updateSelection(opts);
|
|
250
|
+
this._navigate(opts, () => this.navigation.prev());
|
|
234
251
|
}
|
|
235
252
|
/** Navigates to the given item in the listbox. */
|
|
236
253
|
goto(event, opts) {
|
|
237
254
|
const item = this._getItem(event);
|
|
238
|
-
|
|
239
|
-
this.navigation.goto(item);
|
|
240
|
-
this.focusManager.focus();
|
|
241
|
-
this._updateSelection(opts);
|
|
242
|
-
}
|
|
255
|
+
this._navigate(opts, () => this.navigation.goto(item));
|
|
243
256
|
}
|
|
244
257
|
/** Handles typeahead search navigation for the listbox. */
|
|
245
258
|
search(char, opts) {
|
|
246
|
-
this.typeahead.search(char);
|
|
247
|
-
this.focusManager.focus();
|
|
248
|
-
this._updateSelection(opts);
|
|
259
|
+
this._navigate(opts, () => this.typeahead.search(char));
|
|
249
260
|
}
|
|
250
|
-
/**
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
261
|
+
/**
|
|
262
|
+
* Safely performs a navigation operation.
|
|
263
|
+
*
|
|
264
|
+
* Handles conditionally disabling wrapping for when a navigation
|
|
265
|
+
* operation is occurring while the user is selecting a range of options.
|
|
266
|
+
*
|
|
267
|
+
* Handles boilerplate calling of focus & selection operations. Also ensures these
|
|
268
|
+
* additional operations are only called if the navigation operation moved focus to a new option.
|
|
269
|
+
*/
|
|
270
|
+
_navigate(opts = {}, operation) {
|
|
271
|
+
if (opts?.selectRange) {
|
|
272
|
+
this.wrap.set(false);
|
|
273
|
+
this.selection.rangeStartIndex.set(this.anchorIndex());
|
|
254
274
|
}
|
|
255
|
-
|
|
256
|
-
|
|
275
|
+
const moved = operation();
|
|
276
|
+
if (moved) {
|
|
277
|
+
this._updateSelection(opts);
|
|
257
278
|
}
|
|
258
|
-
|
|
259
|
-
|
|
279
|
+
this.wrap.set(true);
|
|
280
|
+
}
|
|
281
|
+
/** Handles updating selection for the listbox. */
|
|
282
|
+
_updateSelection(opts = { anchor: true }) {
|
|
283
|
+
if (opts.toggle) {
|
|
284
|
+
this.selection.toggle();
|
|
260
285
|
}
|
|
261
|
-
if (opts
|
|
286
|
+
if (opts.selectOne) {
|
|
262
287
|
this.selection.selectOne();
|
|
263
288
|
}
|
|
264
|
-
if (opts
|
|
265
|
-
this.selection.
|
|
266
|
-
}
|
|
267
|
-
if (opts?.selectFromAnchor) {
|
|
268
|
-
this.selection.selectFromPrevSelectedItem();
|
|
269
|
-
}
|
|
270
|
-
if (opts?.selectFromActive) {
|
|
271
|
-
this.selection.selectFromActive();
|
|
289
|
+
if (opts.selectRange) {
|
|
290
|
+
this.selection.selectRange();
|
|
272
291
|
}
|
|
273
|
-
if (opts
|
|
274
|
-
this.selection.
|
|
292
|
+
if (!opts.anchor) {
|
|
293
|
+
this.anchorIndex.set(this.selection.rangeStartIndex());
|
|
275
294
|
}
|
|
276
295
|
}
|
|
277
296
|
_getItem(e) {
|
|
278
297
|
if (!(e.target instanceof HTMLElement)) {
|
|
279
298
|
return;
|
|
280
299
|
}
|
|
281
|
-
const element = e.target.closest('[role="option"]');
|
|
300
|
+
const element = e.target.closest('[role="option"]');
|
|
282
301
|
return this.inputs.items().find(i => i.element() === element);
|
|
283
302
|
}
|
|
284
303
|
}
|
|
@@ -316,4 +335,4 @@ class OptionPattern {
|
|
|
316
335
|
}
|
|
317
336
|
|
|
318
337
|
export { ListboxPattern, OptionPattern };
|
|
319
|
-
//# sourceMappingURL=option-
|
|
338
|
+
//# sourceMappingURL=option-D1-Zcobx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"option-D1-Zcobx.mjs","sources":["../../../../../k8-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/list-typeahead/list-typeahead.ts","../../../../../k8-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/listbox/listbox.ts","../../../../../k8-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/listbox/option.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 {computed, signal} from '@angular/core';\nimport {SignalLike} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\n\n/**\n * Represents an item in a collection, such as a listbox option, than can be navigated to by\n * typeahead.\n */\nexport interface ListTypeaheadItem extends ListFocusItem {\n /** The text used by the typeahead search. */\n searchTerm: SignalLike<string>;\n}\n\n/**\n * Represents the required inputs for a collection that contains items that can be navigated to by\n * typeahead.\n */\nexport interface ListTypeaheadInputs<T extends ListTypeaheadItem> extends ListFocusInputs<T> {\n /** The amount of time before the typeahead search is reset. */\n typeaheadDelay: SignalLike<number>;\n}\n\n/** Controls typeahead for a list of items. */\nexport class ListTypeahead<T extends ListTypeaheadItem> {\n /** A reference to the timeout for resetting the typeahead search. */\n timeout?: ReturnType<typeof setTimeout> | undefined;\n\n /** The focus controller of the parent list. */\n focusManager: ListFocus<T>;\n\n /** Whether the user is actively typing a typeahead search query. */\n isTyping = computed(() => this._query().length > 0);\n\n /** Keeps track of the characters that typeahead search is being called with. */\n private _query = signal('');\n\n /** The index where that the typeahead search was initiated from. */\n private _startIndex = signal<number | undefined>(undefined);\n\n constructor(readonly inputs: ListTypeaheadInputs<T> & {focusManager: ListFocus<T>}) {\n this.focusManager = inputs.focusManager;\n }\n\n /** Performs a typeahead search, appending the given character to the search string. */\n search(char: string): boolean {\n if (char.length !== 1) {\n return false;\n }\n\n if (!this.isTyping() && char === ' ') {\n return false;\n }\n\n if (this._startIndex() === undefined) {\n this._startIndex.set(this.focusManager.inputs.activeIndex());\n }\n\n clearTimeout(this.timeout);\n this._query.update(q => q + char.toLowerCase());\n const item = this._getItem();\n\n if (item) {\n this.focusManager.focus(item);\n }\n\n this.timeout = setTimeout(() => {\n this._query.set('');\n this._startIndex.set(undefined);\n }, this.inputs.typeaheadDelay() * 1000);\n\n return true;\n }\n\n /**\n * Returns the first item whose search term matches the\n * current query starting from the the current anchor index.\n */\n private _getItem() {\n let items = this.focusManager.inputs.items();\n const after = items.slice(this._startIndex()! + 1);\n const before = items.slice(0, this._startIndex()!);\n items = after.concat(before);\n items.push(this.inputs.items()[this._startIndex()!]);\n\n const focusableItems = [];\n for (const item of items) {\n if (this.focusManager.isFocusable(item)) {\n focusableItems.push(item);\n }\n }\n\n return focusableItems.find(i => i.searchTerm().toLowerCase().startsWith(this._query()));\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 {ModifierKey as Modifier} from '../behaviors/event-manager/event-manager';\nimport {KeyboardEventManager} from '../behaviors/event-manager/keyboard-event-manager';\nimport {PointerEventManager} from '../behaviors/event-manager/pointer-event-manager';\nimport {OptionPattern} from './option';\nimport {ListSelection, ListSelectionInputs} from '../behaviors/list-selection/list-selection';\nimport {ListTypeahead, ListTypeaheadInputs} from '../behaviors/list-typeahead/list-typeahead';\nimport {ListNavigation, ListNavigationInputs} from '../behaviors/list-navigation/list-navigation';\nimport {ListFocus, ListFocusInputs} from '../behaviors/list-focus/list-focus';\nimport {computed, signal} from '@angular/core';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\n\n/** The selection operations that the listbox can perform. */\ninterface SelectOptions {\n toggle?: boolean;\n selectOne?: boolean;\n selectRange?: boolean;\n anchor?: boolean;\n}\n\n/** Represents the required inputs for a listbox. */\nexport type ListboxInputs<V> = ListNavigationInputs<OptionPattern<V>> &\n ListSelectionInputs<OptionPattern<V>, V> &\n ListTypeaheadInputs<OptionPattern<V>> &\n ListFocusInputs<OptionPattern<V>> & {\n readonly: SignalLike<boolean>;\n };\n\n/** Controls the state of a listbox. */\nexport class ListboxPattern<V> {\n /** Controls navigation for the listbox. */\n navigation: ListNavigation<OptionPattern<V>>;\n\n /** Controls selection for the listbox. */\n selection: ListSelection<OptionPattern<V>, V>;\n\n /** Controls typeahead for the listbox. */\n typeahead: ListTypeahead<OptionPattern<V>>;\n\n /** Controls focus for the listbox. */\n focusManager: ListFocus<OptionPattern<V>>;\n\n /** Whether the list is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the listbox is disabled. */\n disabled = computed(() => this.focusManager.isListDisabled());\n\n /** Whether the listbox is readonly. */\n readonly: SignalLike<boolean>;\n\n /** The tabindex of the listbox. */\n tabindex = computed(() => this.focusManager.getListTabindex());\n\n /** The id of the current active item. */\n activedescendant = computed(() => this.focusManager.getActiveDescendant());\n\n /** Whether multiple items in the list can be selected at once. */\n multi: SignalLike<boolean>;\n\n /** The number of items in the listbox. */\n setsize = computed(() => this.navigation.inputs.items().length);\n\n /** Whether the listbox selection follows focus. */\n followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** Whether the listbox should wrap. Used to disable wrapping while range selecting. */\n wrap = signal(true);\n\n /** The key used to navigate to the previous item in the list. */\n prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next item in the list. */\n nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** Represents the space key. Does nothing when the user is actively using typeahead. */\n dynamicSpaceKey = computed(() => (this.typeahead.isTyping() ? '' : ' '));\n\n /** The regexp used to decide if a key should trigger typeahead. */\n typeaheadRegexp = /^.$/; // TODO: Ignore spaces?\n\n /**\n * The uncommitted index for selecting a range of options.\n *\n * NOTE: This is subtly distinct from the \"rangeStartIndex\" in the ListSelection behavior.\n * The anchorIndex does not necessarily represent the start of a range, but represents the most\n * recent index where the user showed intent to begin a range selection. Usually, this is wherever\n * the user most recently pressed the \"Shift\" key, but if the user presses shift + space to select\n * from the anchor, the user is not intending to start a new range from this index.\n *\n * In other words, \"rangeStartIndex\" is only set when a user commits to starting a range selection\n * while \"anchorIndex\" is set whenever a user indicates they may be starting a range selection.\n */\n anchorIndex = signal(0);\n\n /** The keydown event manager for the listbox. */\n keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n if (this.readonly()) {\n return manager\n .on(this.prevKey, () => this.prev())\n .on(this.nextKey, () => this.next())\n .on('Home', () => this.first())\n .on('End', () => this.last())\n .on(this.typeaheadRegexp, e => this.search(e.key));\n }\n\n if (!this.followFocus()) {\n manager\n .on(this.prevKey, () => this.prev())\n .on(this.nextKey, () => this.next())\n .on('Home', () => this.first())\n .on('End', () => this.last())\n .on(this.typeaheadRegexp, e => this.search(e.key));\n }\n\n if (this.followFocus()) {\n manager\n .on(this.prevKey, () => this.prev({selectOne: true}))\n .on(this.nextKey, () => this.next({selectOne: true}))\n .on('Home', () => this.first({selectOne: true}))\n .on('End', () => this.last({selectOne: true}))\n .on(this.typeaheadRegexp, e => this.search(e.key, {selectOne: true}));\n }\n\n if (this.inputs.multi()) {\n manager\n .on(Modifier.Any, 'Shift', () => this.anchorIndex.set(this.inputs.activeIndex()))\n .on(Modifier.Shift, this.prevKey, () => this.prev({selectRange: true}))\n .on(Modifier.Shift, this.nextKey, () => this.next({selectRange: true}))\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () =>\n this.first({selectRange: true, anchor: false}),\n )\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () =>\n this.last({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, 'Enter', () =>\n this._updateSelection({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, this.dynamicSpaceKey, () =>\n this._updateSelection({selectRange: true, anchor: false}),\n );\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager\n .on(this.dynamicSpaceKey, () => this.selection.toggle())\n .on('Enter', () => this.selection.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => this.selection.toggleAll());\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => this.selection.toggleOne());\n manager.on('Enter', () => this.selection.toggleOne());\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => this.prev())\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => this.next())\n .on([Modifier.Ctrl, Modifier.Meta], ' ', () => this.selection.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => this.selection.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Home', () => this.first())\n .on([Modifier.Ctrl, Modifier.Meta], 'End', () => this.last())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => {\n this.selection.toggleAll();\n this.selection.select(); // Ensure the currect option remains selected.\n });\n }\n\n return manager;\n });\n\n /** The pointerdown event manager for the listbox. */\n pointerdown = computed(() => {\n const manager = new PointerEventManager();\n\n if (this.readonly()) {\n return manager.on(e => this.goto(e));\n }\n\n if (this.multi()) {\n manager.on(Modifier.Shift, e => this.goto(e, {selectRange: true}));\n }\n\n if (!this.multi() && this.followFocus()) {\n return manager.on(e => this.goto(e, {selectOne: true}));\n }\n\n if (!this.multi() && !this.followFocus()) {\n return manager.on(e => this.goto(e, {toggle: true}));\n }\n\n if (this.multi() && this.followFocus()) {\n return manager\n .on(e => this.goto(e, {selectOne: true}))\n .on(Modifier.Ctrl, e => this.goto(e, {toggle: true}));\n }\n\n if (this.multi() && !this.followFocus()) {\n return manager.on(e => this.goto(e, {toggle: true}));\n }\n\n return manager;\n });\n\n constructor(readonly inputs: ListboxInputs<V>) {\n this.readonly = inputs.readonly;\n this.orientation = inputs.orientation;\n this.multi = inputs.multi;\n\n this.focusManager = new ListFocus(inputs);\n this.selection = new ListSelection({...inputs, focusManager: this.focusManager});\n this.typeahead = new ListTypeahead({...inputs, focusManager: this.focusManager});\n this.navigation = new ListNavigation({\n ...inputs,\n focusManager: this.focusManager,\n wrap: computed(() => this.wrap() && this.inputs.wrap()),\n });\n }\n\n /** Handles keydown events for the listbox. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n onPointerdown(event: PointerEvent) {\n if (!this.disabled()) {\n this.pointerdown().handle(event);\n }\n }\n\n /** Navigates to the first option in the listbox. */\n first(opts?: SelectOptions) {\n this._navigate(opts, () => this.navigation.first());\n }\n\n /** Navigates to the last option in the listbox. */\n last(opts?: SelectOptions) {\n this._navigate(opts, () => this.navigation.last());\n }\n\n /** Navigates to the next option in the listbox. */\n next(opts?: SelectOptions) {\n this._navigate(opts, () => this.navigation.next());\n }\n\n /** Navigates to the previous option in the listbox. */\n prev(opts?: SelectOptions) {\n this._navigate(opts, () => this.navigation.prev());\n }\n\n /** Navigates to the given item in the listbox. */\n goto(event: PointerEvent, opts?: SelectOptions) {\n const item = this._getItem(event);\n this._navigate(opts, () => this.navigation.goto(item));\n }\n\n /** Handles typeahead search navigation for the listbox. */\n search(char: string, opts?: SelectOptions) {\n this._navigate(opts, () => this.typeahead.search(char));\n }\n\n /**\n * Safely performs a navigation operation.\n *\n * Handles conditionally disabling wrapping for when a navigation\n * operation is occurring while the user is selecting a range of options.\n *\n * Handles boilerplate calling of focus & selection operations. Also ensures these\n * additional operations are only called if the navigation operation moved focus to a new option.\n */\n private _navigate(opts: SelectOptions = {}, operation: () => boolean) {\n if (opts?.selectRange) {\n this.wrap.set(false);\n this.selection.rangeStartIndex.set(this.anchorIndex());\n }\n\n const moved = operation();\n\n if (moved) {\n this._updateSelection(opts);\n }\n\n this.wrap.set(true);\n }\n\n /** Handles updating selection for the listbox. */\n private _updateSelection(opts: SelectOptions = {anchor: true}) {\n if (opts.toggle) {\n this.selection.toggle();\n }\n if (opts.selectOne) {\n this.selection.selectOne();\n }\n if (opts.selectRange) {\n this.selection.selectRange();\n }\n if (!opts.anchor) {\n this.anchorIndex.set(this.selection.rangeStartIndex());\n }\n }\n\n private _getItem(e: PointerEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n\n const element = e.target.closest('[role=\"option\"]');\n return this.inputs.items().find(i => i.element() === element);\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 {computed} from '@angular/core';\nimport {ListSelection, ListSelectionItem} from '../behaviors/list-selection/list-selection';\nimport {ListTypeaheadItem} from '../behaviors/list-typeahead/list-typeahead';\nimport {ListNavigation, ListNavigationItem} from '../behaviors/list-navigation/list-navigation';\nimport {ListFocus, ListFocusItem} from '../behaviors/list-focus/list-focus';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\n\n/**\n * Represents the properties exposed by a listbox that need to be accessed by an option.\n * This exists to avoid circular dependency errors between the listbox and option.\n */\ninterface ListboxPattern<V> {\n focusManager: ListFocus<OptionPattern<V>>;\n selection: ListSelection<OptionPattern<V>, V>;\n navigation: ListNavigation<OptionPattern<V>>;\n}\n\n/** Represents the required inputs for an option in a listbox. */\nexport interface OptionInputs<V>\n extends ListNavigationItem,\n ListSelectionItem<V>,\n ListTypeaheadItem,\n ListFocusItem {\n listbox: SignalLike<ListboxPattern<V> | undefined>;\n}\n\n/** Represents an option in a listbox. */\nexport class OptionPattern<V> {\n /** A unique identifier for the option. */\n id: SignalLike<string>;\n\n /** The value of the option. */\n value: SignalLike<V>;\n\n /** The position of the option in the list. */\n index = computed(\n () =>\n this.listbox()\n ?.navigation.inputs.items()\n .findIndex(i => i.id() === this.id()) ?? -1,\n );\n\n /** Whether the option is selected. */\n selected = computed(() => this.listbox()?.selection.inputs.value().includes(this.value()));\n\n /** Whether the option is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The text used by the typeahead search. */\n searchTerm: SignalLike<string>;\n\n /** A reference to the parent listbox. */\n listbox: SignalLike<ListboxPattern<V> | undefined>;\n\n /** The tabindex of the option. */\n tabindex = computed(() => this.listbox()?.focusManager.getItemTabindex(this));\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement>;\n\n constructor(args: OptionInputs<V>) {\n this.id = args.id;\n this.value = args.value;\n this.listbox = args.listbox;\n this.element = args.element;\n this.disabled = args.disabled;\n this.searchTerm = args.searchTerm;\n }\n}\n"],"names":["Modifier"],"mappings":";;;AA8BA;MACa,aAAa,CAAA;AAgBH,IAAA,MAAA;;AAdrB,IAAA,OAAO;;AAGP,IAAA,YAAY;;AAGZ,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;;AAG3C,IAAA,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;;AAGnB,IAAA,WAAW,GAAG,MAAM,CAAqB,SAAS,CAAC;AAE3D,IAAA,WAAA,CAAqB,MAA6D,EAAA;QAA7D,IAAM,CAAA,MAAA,GAAN,MAAM;AACzB,QAAA,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY;;;AAIzC,IAAA,MAAM,CAAC,IAAY,EAAA;AACjB,QAAA,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;AACrB,YAAA,OAAO,KAAK;;QAGd,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,KAAK,GAAG,EAAE;AACpC,YAAA,OAAO,KA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C7B,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU;;AAEpC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polyfill-DRXnWbMt.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"polyfill-DRXnWbMt.mjs","sources":["../../../../../k8-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/popover-edit/polyfill.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\n/** closest implementation that is able to start from non-Element Nodes. */\nexport function closest(\n element: EventTarget | Element | null | undefined,\n selector: string,\n): Element | null {\n if (!(element instanceof Node)) {\n return null;\n }\n\n let curr: Node | null = element;\n while (curr != null && !(curr instanceof Element)) {\n curr = curr.parentNode;\n }\n\n return curr?.closest(selector) ?? null;\n}\n"],"names":[],"mappings":"AAQA;AACgB,SAAA,OAAO,CACrB,OAAiD,EACjD,QAAgB,EAAA;AAEhB,IAAA,IAAI,EAAE,OAAO,YAAY,IAAI,CAAC,EAAE;AAC9B,QAAA,OAAO,IAAI;;IAGb,IAAI,IAAI,GAAgB,OAAO;IAC/B,OAAO,IAAI,IAAI,IAAI,IAAI,EAAE,IAAI,YAAY,OAAO,CAAC,EAAE;AACjD,QAAA,IAAI,GAAG,IAAI,CAAC,UAAU;;IAGxB,OAAO,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI;AACxC;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { closest } from './polyfill-DRXnWbMt.mjs';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, NgZone, Injectable, Injector, afterNextRender, ElementRef, EventEmitter, Directive, Input, Renderer2, ViewContainerRef, TemplateRef, NgModule } from '@angular/core';
|
|
3
|
+
import { inject, NgZone, Injectable, Injector, afterNextRender, ElementRef, EventEmitter, Directive, Input, DOCUMENT, Renderer2, ViewContainerRef, TemplateRef, NgModule } from '@angular/core';
|
|
4
4
|
import { Subject, pipe, combineLatest, Observable, merge } from 'rxjs';
|
|
5
5
|
import { distinctUntilChanged, startWith, shareReplay, filter, map, auditTime, audit, debounceTime, skip, takeUntil, mapTo, throttleTime, share, withLatestFrom } from 'rxjs/operators';
|
|
6
6
|
import { ControlContainer } from '@angular/forms';
|
|
@@ -10,7 +10,6 @@ import { Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
|
10
10
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
11
11
|
import { FocusTrapFactory, InteractivityChecker, FocusTrap } from '@angular/cdk/a11y';
|
|
12
12
|
import { ScrollDispatcher, ViewportRuler } from '@angular/cdk/scrolling';
|
|
13
|
-
import { DOCUMENT } from '@angular/common';
|
|
14
13
|
|
|
15
14
|
/** Selector for finding table cells. */
|
|
16
15
|
const CELL_SELECTOR = '.cdk-cell, .mat-cell, td';
|