@angular/cdk-experimental 20.0.0-next.7 → 20.0.0-next.9

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.
Files changed (39) hide show
  1. package/column-resize/index.d.ts +39 -5
  2. package/combobox/index.d.ts +2 -2
  3. package/fesm2022/cdk-experimental.mjs +1 -1
  4. package/fesm2022/cdk-experimental.mjs.map +1 -1
  5. package/fesm2022/column-resize.mjs +77 -10
  6. package/fesm2022/column-resize.mjs.map +1 -1
  7. package/fesm2022/combobox.mjs +9 -12
  8. package/fesm2022/combobox.mjs.map +1 -1
  9. package/fesm2022/deferred-content.mjs +1 -1
  10. package/fesm2022/{list-focus-DtTH4bDx.mjs → list-focus-Di7m_z_6.mjs} +112 -88
  11. package/fesm2022/list-focus-Di7m_z_6.mjs.map +1 -0
  12. package/fesm2022/listbox.mjs +29 -9
  13. package/fesm2022/listbox.mjs.map +1 -1
  14. package/fesm2022/{option-Bgpacz3g.mjs → option-f_gNslw8.mjs} +127 -79
  15. package/fesm2022/option-f_gNslw8.mjs.map +1 -0
  16. package/fesm2022/{polyfill-DRXnWbMt.mjs → polyfill-CXksG4af.mjs} +2 -2
  17. package/fesm2022/{polyfill-DRXnWbMt.mjs.map → polyfill-CXksG4af.mjs.map} +1 -1
  18. package/fesm2022/popover-edit.mjs +13 -11
  19. package/fesm2022/popover-edit.mjs.map +1 -1
  20. package/fesm2022/scrolling.mjs +1 -1
  21. package/fesm2022/selection.mjs +2 -2
  22. package/fesm2022/table-scroll-container.mjs +1 -2
  23. package/fesm2022/table-scroll-container.mjs.map +1 -1
  24. package/fesm2022/{tabs-cBelBNjZ.mjs → tabs-BunANY1M.mjs} +17 -31
  25. package/fesm2022/tabs-BunANY1M.mjs.map +1 -0
  26. package/fesm2022/tabs.mjs +5 -4
  27. package/fesm2022/tabs.mjs.map +1 -1
  28. package/fesm2022/ui-patterns.mjs +3 -3
  29. package/{list-focus.d-1SGksIi8.d.ts → list-navigation.d-DfOSxsSp.d.ts} +90 -81
  30. package/listbox/index.d.ts +15 -6
  31. package/{listbox.d-C-LFh0S9.d.ts → listbox.d-QWPLmxRe.d.ts} +54 -21
  32. package/package.json +2 -2
  33. package/popover-edit/index.d.ts +2 -2
  34. package/tabs/index.d.ts +2 -2
  35. package/{tabs.d-BIIDt2Rf.d.ts → tabs.d-BAo141mw.d.ts} +6 -3
  36. package/ui-patterns/index.d.ts +3 -3
  37. package/fesm2022/list-focus-DtTH4bDx.mjs.map +0 -1
  38. package/fesm2022/option-Bgpacz3g.mjs.map +0 -1
  39. package/fesm2022/tabs-cBelBNjZ.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { KeyboardEventManager, ModifierKey, PointerEventManager, ListNavigation, ListSelection, ListFocus } from './list-focus-DtTH4bDx.mjs';
1
+ import { M as ModifierKey, L as ListFocus, a as ListSelection, b as ListNavigation, K as KeyboardEventManager, P as PointerEventManager } from './list-focus-Di7m_z_6.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 navigation controller of the parent list. */
10
- navigation;
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.navigation = inputs.navigation;
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.navigation.inputs.activeIndex());
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.navigation.goto(item);
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.navigation.inputs.items();
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 = this.navigation.inputs.wrap() ? after.concat(before) : after; // TODO: Always wrap?
52
- items.push(this.navigation.inputs.items()[this._startIndex()]);
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.navigation.isFocusable(item)) {
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.Shift, 'Enter', () => this._updateSelection({ selectFromAnchor: true }))
138
- .on(ModifierKey.Shift, this.prevKey, () => this.prev({ toggle: true }))
139
- .on(ModifierKey.Shift, this.nextKey, () => this.next({ toggle: true }))
140
- .on([ModifierKey.Ctrl, ModifierKey.Meta], 'A', () => this._updateSelection({ selectAll: true }))
141
- .on([ModifierKey.Ctrl | ModifierKey.Shift, ModifierKey.Meta | ModifierKey.Shift], 'Home', () => this.first({ selectFromActive: true }))
142
- .on([ModifierKey.Ctrl | ModifierKey.Shift, ModifierKey.Meta | ModifierKey.Shift], 'End', () => this.last({ selectFromActive: true }))
143
- .on(ModifierKey.Shift, this.dynamicSpaceKey, () => this._updateSelection({ selectFromAnchor: true }));
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.on(this.dynamicSpaceKey, () => this._updateSelection({ toggle: true }));
147
- manager.on('Enter', () => this._updateSelection({ toggle: true }));
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._updateSelection({ toggleOne: true }));
151
- manager.on('Enter', () => this._updateSelection({ toggleOne: true }));
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._updateSelection({ toggle: true }))
158
- .on([ModifierKey.Ctrl, ModifierKey.Meta], 'Enter', () => this._updateSelection({ toggle: true }))
159
- .on([ModifierKey.Ctrl, ModifierKey.Meta], 'Home', () => this.first()) // TODO: Not in spec but prob should be.
160
- .on([ModifierKey.Ctrl, ModifierKey.Meta], 'End', () => this.last()); // TODO: Not in spec but prob should be.
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.navigation = new ListNavigation(inputs);
196
- this.selection = new ListSelection({ ...inputs, navigation: this.navigation });
197
- this.typeahead = new ListTypeahead({ ...inputs, navigation: this.navigation });
198
- this.focusManager = new ListFocus({ ...inputs, navigation: this.navigation });
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,96 @@ 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
- if (item) {
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
- /** Handles updating selection for the listbox. */
251
- _updateSelection(opts) {
252
- if (opts?.select) {
253
- this.selection.select();
261
+ /**
262
+ * Sets the listbox to it's default initial state.
263
+ *
264
+ * Sets the active index of the listbox to the first focusable selected
265
+ * item if one exists. Otherwise, sets focus to the first focusable item.
266
+ *
267
+ * This method should be called once the listbox and it's options are properly initialized,
268
+ * meaning the ListboxPattern and OptionPatterns should have references to each other before this
269
+ * is called.
270
+ */
271
+ setDefaultState() {
272
+ let firstItem = null;
273
+ for (const item of this.inputs.items()) {
274
+ if (this.focusManager.isFocusable(item)) {
275
+ if (!firstItem) {
276
+ firstItem = item;
277
+ }
278
+ if (item.selected()) {
279
+ this.inputs.activeIndex.set(item.index());
280
+ return;
281
+ }
282
+ }
254
283
  }
255
- if (opts?.toggle) {
256
- this.selection.toggle();
284
+ if (firstItem) {
285
+ this.inputs.activeIndex.set(firstItem.index());
257
286
  }
258
- if (opts?.toggleOne) {
259
- this.selection.toggleOne();
287
+ }
288
+ /**
289
+ * Safely performs a navigation operation.
290
+ *
291
+ * Handles conditionally disabling wrapping for when a navigation
292
+ * operation is occurring while the user is selecting a range of options.
293
+ *
294
+ * Handles boilerplate calling of focus & selection operations. Also ensures these
295
+ * additional operations are only called if the navigation operation moved focus to a new option.
296
+ */
297
+ _navigate(opts = {}, operation) {
298
+ if (opts?.selectRange) {
299
+ this.wrap.set(false);
300
+ this.selection.rangeStartIndex.set(this.anchorIndex());
260
301
  }
261
- if (opts?.selectOne) {
262
- this.selection.selectOne();
302
+ const moved = operation();
303
+ if (moved) {
304
+ this._updateSelection(opts);
263
305
  }
264
- if (opts?.selectAll) {
265
- this.selection.selectAll();
306
+ this.wrap.set(true);
307
+ }
308
+ /** Handles updating selection for the listbox. */
309
+ _updateSelection(opts = { anchor: true }) {
310
+ if (opts.toggle) {
311
+ this.selection.toggle();
266
312
  }
267
- if (opts?.selectFromAnchor) {
268
- this.selection.selectFromPrevSelectedItem();
313
+ if (opts.selectOne) {
314
+ this.selection.selectOne();
269
315
  }
270
- if (opts?.selectFromActive) {
271
- this.selection.selectFromActive();
316
+ if (opts.selectRange) {
317
+ this.selection.selectRange();
272
318
  }
273
- if (opts?.toggleFromAnchor) {
274
- this.selection.toggleFromPrevSelectedItem();
319
+ if (!opts.anchor) {
320
+ this.anchorIndex.set(this.selection.rangeStartIndex());
275
321
  }
276
322
  }
277
323
  _getItem(e) {
278
324
  if (!(e.target instanceof HTMLElement)) {
279
325
  return;
280
326
  }
281
- const element = e.target.closest('[role="option"]'); // TODO: Use a different identifier.
327
+ const element = e.target.closest('[role="option"]');
282
328
  return this.inputs.items().find(i => i.element() === element);
283
329
  }
284
330
  }
@@ -293,6 +339,8 @@ class OptionPattern {
293
339
  index = computed(() => this.listbox()
294
340
  ?.navigation.inputs.items()
295
341
  .findIndex(i => i.id() === this.id()) ?? -1);
342
+ /** Whether the option is active. */
343
+ active = computed(() => this.listbox()?.focusManager.activeItem() === this);
296
344
  /** Whether the option is selected. */
297
345
  selected = computed(() => this.listbox()?.selection.inputs.value().includes(this.value()));
298
346
  /** Whether the option is disabled. */
@@ -315,5 +363,5 @@ class OptionPattern {
315
363
  }
316
364
  }
317
365
 
318
- export { ListboxPattern, OptionPattern };
319
- //# sourceMappingURL=option-Bgpacz3g.mjs.map
366
+ export { ListboxPattern as L, OptionPattern as O };
367
+ //# sourceMappingURL=option-f_gNslw8.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"option-f_gNslw8.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/list-typeahead/list-typeahead.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/listbox/listbox.ts","../../../../../darwin_arm64-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 * Sets the listbox to it's default initial state.\n *\n * Sets the active index of the listbox to the first focusable selected\n * item if one exists. Otherwise, sets focus to the first focusable item.\n *\n * This method should be called once the listbox and it's options are properly initialized,\n * meaning the ListboxPattern and OptionPatterns should have references to each other before this\n * is called.\n */\n setDefaultState() {\n let firstItem: OptionPattern<V> | null = null;\n\n for (const item of this.inputs.items()) {\n if (this.focusManager.isFocusable(item)) {\n if (!firstItem) {\n firstItem = item;\n }\n if (item.selected()) {\n this.inputs.activeIndex.set(item.index());\n return;\n }\n }\n }\n\n if (firstItem) {\n this.inputs.activeIndex.set(firstItem.index());\n }\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 active. */\n active = computed(() => this.listbox()?.focusManager.activeItem() === this);\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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,EAAE,KAAK,IAAI,CAAC;;IAG3E,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;;AAG1F,IAAA,QAAQ;;AAGR,IAAA,UAAU;;AAGV,IAAA,OAAO;;AAGP,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;;AAG7E,IAAA,OAAO;AAEP,IAAA,WAAA,CAAY,IAAqB,EAAA;AAC/B,QAAA,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE;AACjB,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK;AACvB,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO;AAC3B,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO;AAC3B,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ;AAC7B,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU;;AAEpC;;;;"}
@@ -10,5 +10,5 @@ function closest(element, selector) {
10
10
  return curr?.closest(selector) ?? null;
11
11
  }
12
12
 
13
- export { closest };
14
- //# sourceMappingURL=polyfill-DRXnWbMt.mjs.map
13
+ export { closest as c };
14
+ //# sourceMappingURL=polyfill-CXksG4af.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"polyfill-DRXnWbMt.mjs","sources":["../../../../../darwin_arm64-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
+ {"version":3,"file":"polyfill-CXksG4af.mjs","sources":["../../../../../darwin_arm64-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,16 +1,15 @@
1
- import { closest } from './polyfill-DRXnWbMt.mjs';
1
+ import { c as closest } from './polyfill-CXksG4af.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';
7
7
  import { Directionality } from '@angular/cdk/bidi';
8
8
  import { RIGHT_ARROW, LEFT_ARROW, DOWN_ARROW, UP_ARROW, hasModifierKey } from '@angular/cdk/keycodes';
9
- import { Overlay, OverlayModule } from '@angular/cdk/overlay';
9
+ import { createOverlayRef, createRepositionScrollStrategy, createFlexibleConnectedPositionStrategy, 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';
@@ -24,6 +23,8 @@ const TABLE_SELECTOR = 'table, cdk-table, mat-table';
24
23
  const EDIT_PANE_CLASS = 'cdk-edit-pane';
25
24
  /** Selector for finding the edit lens pane. */
26
25
  const EDIT_PANE_SELECTOR = `.${EDIT_PANE_CLASS}, .mat-edit-pane`;
26
+ /** Selector for table rows that should be skipped when moving focus. */
27
+ const SKIP_ROW_FOCUS_SELECTOR = '.cdk-popover-edit-skip-focus, .mat-popover-edit-skip-focus';
27
28
 
28
29
  /** The delay applied to mouse events before hiding or showing hover content. */
29
30
  const MOUSE_EVENT_DELAY_MS = 40;
@@ -337,7 +338,10 @@ class FocusDispatcher {
337
338
  const rows = Array.from(closest(currentRow, TABLE_SELECTOR).querySelectorAll(ROW_SELECTOR));
338
339
  const currentRowIndex = rows.indexOf(currentRow);
339
340
  const currentIndexWithinRow = Array.from(currentRow.querySelectorAll(EDITABLE_CELL_SELECTOR)).indexOf(currentCell);
340
- const newRowIndex = currentRowIndex + offset;
341
+ let newRowIndex = currentRowIndex + offset;
342
+ while (rows[newRowIndex]?.matches(SKIP_ROW_FOCUS_SELECTOR)) {
343
+ newRowIndex = newRowIndex + (offset > 0 ? 1 : -1);
344
+ }
341
345
  if (rows[newRowIndex]) {
342
346
  const rowToFocus = Array.from(rows[newRowIndex].querySelectorAll(EDITABLE_CELL_SELECTOR));
343
347
  if (rowToFocus[currentIndexWithinRow]) {
@@ -581,7 +585,6 @@ class EditServices {
581
585
  focusDispatcher = inject(FocusDispatcher);
582
586
  focusTrapFactory = inject(FocusTrapFactory);
583
587
  ngZone = inject(NgZone);
584
- overlay = inject(Overlay);
585
588
  scrollDispatcher = inject(ScrollDispatcher);
586
589
  viewportRuler = inject(ViewportRuler);
587
590
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: EditServices, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -781,6 +784,7 @@ class CdkPopoverEdit {
781
784
  services = inject(EditServices);
782
785
  elementRef = inject(ElementRef);
783
786
  viewContainerRef = inject(ViewContainerRef);
787
+ _injector = inject(Injector);
784
788
  /** The edit lens template shown over the cell on edit. */
785
789
  template = null;
786
790
  /**
@@ -867,11 +871,11 @@ class CdkPopoverEdit {
867
871
  });
868
872
  }
869
873
  _createEditOverlay() {
870
- this.overlayRef = this.services.overlay.create({
874
+ this.overlayRef = createOverlayRef(this._injector, {
871
875
  disposeOnNavigation: true,
872
876
  panelClass: this.panelClass(),
873
877
  positionStrategy: this._getPositionStrategy(),
874
- scrollStrategy: this.services.overlay.scrollStrategies.reposition(),
878
+ scrollStrategy: createRepositionScrollStrategy(this._injector),
875
879
  direction: this.services.directionality,
876
880
  });
877
881
  this.initFocusTrap();
@@ -910,9 +914,7 @@ class CdkPopoverEdit {
910
914
  }
911
915
  _getPositionStrategy() {
912
916
  const cells = this._getOverlayCells();
913
- return this.services.overlay
914
- .position()
915
- .flexibleConnectedTo(cells[0])
917
+ return createFlexibleConnectedPositionStrategy(this._injector, cells[0])
916
918
  .withGrowAfterOpen()
917
919
  .withPush()
918
920
  .withViewportMargin(16)