@angular/cdk 21.0.0-next.5 → 21.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.
Files changed (165) hide show
  1. package/fesm2022/{a11y-module.mjs → _a11y-module-chunk.mjs} +6 -6
  2. package/fesm2022/_a11y-module-chunk.mjs.map +1 -0
  3. package/fesm2022/{activedescendant-key-manager.mjs → _activedescendant-key-manager-chunk.mjs} +2 -2
  4. package/fesm2022/_activedescendant-key-manager-chunk.mjs.map +1 -0
  5. package/fesm2022/{array.mjs → _array-chunk.mjs} +1 -1
  6. package/fesm2022/_array-chunk.mjs.map +1 -0
  7. package/fesm2022/{breakpoints-observer.mjs → _breakpoints-observer-chunk.mjs} +3 -3
  8. package/fesm2022/_breakpoints-observer-chunk.mjs.map +1 -0
  9. package/fesm2022/{css-pixel-value.mjs → _css-pixel-value-chunk.mjs} +1 -1
  10. package/fesm2022/_css-pixel-value-chunk.mjs.map +1 -0
  11. package/fesm2022/{data-source.mjs → _data-source-chunk.mjs} +1 -1
  12. package/fesm2022/_data-source-chunk.mjs.map +1 -0
  13. package/fesm2022/{directionality.mjs → _directionality-chunk.mjs} +1 -1
  14. package/fesm2022/_directionality-chunk.mjs.map +1 -0
  15. package/fesm2022/{dispose-view-repeater-strategy.mjs → _dispose-view-repeater-strategy-chunk.mjs} +2 -2
  16. package/fesm2022/_dispose-view-repeater-strategy-chunk.mjs.map +1 -0
  17. package/fesm2022/{element.mjs → _element-chunk.mjs} +1 -1
  18. package/fesm2022/_element-chunk.mjs.map +1 -0
  19. package/fesm2022/{fake-event-detection.mjs → _fake-event-detection-chunk.mjs} +1 -1
  20. package/fesm2022/_fake-event-detection-chunk.mjs.map +1 -0
  21. package/fesm2022/{focus-key-manager.mjs → _focus-key-manager-chunk.mjs} +2 -2
  22. package/fesm2022/_focus-key-manager-chunk.mjs.map +1 -0
  23. package/fesm2022/{focus-monitor.mjs → _focus-monitor-chunk.mjs} +7 -7
  24. package/fesm2022/_focus-monitor-chunk.mjs.map +1 -0
  25. package/fesm2022/{id-generator.mjs → _id-generator-chunk.mjs} +1 -1
  26. package/fesm2022/_id-generator-chunk.mjs.map +1 -0
  27. package/fesm2022/{keycodes2.mjs → _keycodes-chunk.mjs} +1 -1
  28. package/fesm2022/_keycodes-chunk.mjs.map +1 -0
  29. package/fesm2022/{list-key-manager.mjs → _list-key-manager-chunk.mjs} +3 -3
  30. package/fesm2022/_list-key-manager-chunk.mjs.map +1 -0
  31. package/fesm2022/{overlay-module.mjs → _overlay-module-chunk.mjs} +71 -28
  32. package/fesm2022/_overlay-module-chunk.mjs.map +1 -0
  33. package/fesm2022/{passive-listeners.mjs → _passive-listeners-chunk.mjs} +1 -1
  34. package/fesm2022/_passive-listeners-chunk.mjs.map +1 -0
  35. package/fesm2022/{platform2.mjs → _platform-chunk.mjs} +1 -1
  36. package/fesm2022/_platform-chunk.mjs.map +1 -0
  37. package/fesm2022/{recycle-view-repeater-strategy.mjs → _recycle-view-repeater-strategy-chunk.mjs} +2 -2
  38. package/fesm2022/_recycle-view-repeater-strategy-chunk.mjs.map +1 -0
  39. package/fesm2022/{scrolling2.mjs → _scrolling-chunk.mjs} +2 -2
  40. package/fesm2022/_scrolling-chunk.mjs.map +1 -0
  41. package/fesm2022/{selection-model.mjs → _selection-model-chunk.mjs} +1 -1
  42. package/fesm2022/_selection-model-chunk.mjs.map +1 -0
  43. package/fesm2022/{shadow-dom.mjs → _shadow-dom-chunk.mjs} +1 -1
  44. package/fesm2022/_shadow-dom-chunk.mjs.map +1 -0
  45. package/fesm2022/{style-loader.mjs → _style-loader-chunk.mjs} +1 -1
  46. package/fesm2022/_style-loader-chunk.mjs.map +1 -0
  47. package/fesm2022/{test-environment.mjs → _test-environment-chunk.mjs} +1 -1
  48. package/fesm2022/_test-environment-chunk.mjs.map +1 -0
  49. package/fesm2022/{tree-key-manager.mjs → _tree-key-manager-chunk.mjs} +3 -3
  50. package/fesm2022/_tree-key-manager-chunk.mjs.map +1 -0
  51. package/fesm2022/{typeahead.mjs → _typeahead-chunk.mjs} +2 -2
  52. package/fesm2022/_typeahead-chunk.mjs.map +1 -0
  53. package/fesm2022/{unique-selection-dispatcher.mjs → _unique-selection-dispatcher-chunk.mjs} +1 -1
  54. package/fesm2022/_unique-selection-dispatcher-chunk.mjs.map +1 -0
  55. package/fesm2022/a11y.mjs +20 -20
  56. package/fesm2022/accordion.mjs +2 -2
  57. package/fesm2022/bidi.mjs +2 -2
  58. package/fesm2022/cdk.mjs +1 -1
  59. package/fesm2022/cdk.mjs.map +1 -1
  60. package/fesm2022/{coercion/private.mjs → coercion-private.mjs} +1 -1
  61. package/fesm2022/coercion-private.mjs.map +1 -0
  62. package/fesm2022/coercion.mjs +3 -3
  63. package/fesm2022/collections.mjs +5 -5
  64. package/fesm2022/dialog.mjs +19 -19
  65. package/fesm2022/drag-drop.mjs +11 -11
  66. package/fesm2022/keycodes.mjs +1 -1
  67. package/fesm2022/layout.mjs +3 -3
  68. package/fesm2022/listbox.mjs +9 -9
  69. package/fesm2022/menu.mjs +21 -21
  70. package/fesm2022/{observers/private.mjs → observers-private.mjs} +1 -1
  71. package/fesm2022/observers-private.mjs.map +1 -0
  72. package/fesm2022/observers.mjs +1 -1
  73. package/fesm2022/overlay.mjs +15 -15
  74. package/fesm2022/platform.mjs +5 -5
  75. package/fesm2022/private.mjs +1 -1
  76. package/fesm2022/scrolling.mjs +7 -7
  77. package/fesm2022/scrolling.mjs.map +1 -1
  78. package/fesm2022/stepper.mjs +7 -7
  79. package/fesm2022/table.mjs +8 -8
  80. package/fesm2022/{testing/selenium-webdriver.mjs → testing-selenium-webdriver.mjs} +2 -2
  81. package/fesm2022/testing-selenium-webdriver.mjs.map +1 -0
  82. package/fesm2022/{testing/testbed.mjs → testing-testbed.mjs} +3 -3
  83. package/fesm2022/testing-testbed.mjs.map +1 -0
  84. package/fesm2022/text-field.mjs +3 -7
  85. package/fesm2022/text-field.mjs.map +1 -1
  86. package/fesm2022/tree.mjs +7 -7
  87. package/package.json +35 -34
  88. package/schematics/ng-add/index.js +1 -1
  89. package/{a11y-module.d.d.ts → types/_a11y-module-chunk.d.ts} +2 -2
  90. package/{activedescendant-key-manager.d.d.ts → types/_activedescendant-key-manager-chunk.d.ts} +1 -1
  91. package/{focus-key-manager.d.d.ts → types/_focus-key-manager-chunk.d.ts} +2 -2
  92. package/{overlay-module.d.d.ts → types/_overlay-module-chunk.d.ts} +40 -12
  93. package/{scrolling-module.d.d.ts → types/_scrolling-module-chunk.d.ts} +3 -3
  94. package/{a11y/index.d.ts → types/a11y.d.ts} +9 -9
  95. package/{accordion/index.d.ts → types/accordion.d.ts} +1 -1
  96. package/{bidi/index.d.ts → types/bidi.d.ts} +1 -1
  97. package/{coercion/index.d.ts → types/coercion.d.ts} +1 -1
  98. package/{collections/index.d.ts → types/collections.d.ts} +7 -7
  99. package/{dialog/index.d.ts → types/dialog.d.ts} +13 -13
  100. package/{drag-drop/index.d.ts → types/drag-drop.d.ts} +6 -6
  101. package/{listbox/index.d.ts → types/listbox.d.ts} +3 -3
  102. package/{menu/index.d.ts → types/menu.d.ts} +12 -12
  103. package/{observers/index.d.ts → types/observers.d.ts} +1 -1
  104. package/{overlay/index.d.ts → types/overlay.d.ts} +11 -11
  105. package/{platform/index.d.ts → types/platform.d.ts} +1 -1
  106. package/{portal/index.d.ts → types/portal.d.ts} +2 -2
  107. package/{private/index.d.ts → types/private.d.ts} +1 -1
  108. package/{scrolling/index.d.ts → types/scrolling.d.ts} +4 -4
  109. package/{stepper/index.d.ts → types/stepper.d.ts} +4 -4
  110. package/{table/index.d.ts → types/table.d.ts} +5 -5
  111. package/{testing/selenium-webdriver/index.d.ts → types/testing-selenium-webdriver.d.ts} +1 -1
  112. package/{testing/testbed/index.d.ts → types/testing-testbed.d.ts} +1 -1
  113. package/{testing/index.d.ts → types/testing.d.ts} +1 -1
  114. package/{text-field/index.d.ts → types/text-field.d.ts} +1 -3
  115. package/{tree/index.d.ts → types/tree.d.ts} +3 -3
  116. package/fesm2022/a11y-module.mjs.map +0 -1
  117. package/fesm2022/activedescendant-key-manager.mjs.map +0 -1
  118. package/fesm2022/array.mjs.map +0 -1
  119. package/fesm2022/breakpoints-observer.mjs.map +0 -1
  120. package/fesm2022/coercion/private.mjs.map +0 -1
  121. package/fesm2022/css-pixel-value.mjs.map +0 -1
  122. package/fesm2022/data-source.mjs.map +0 -1
  123. package/fesm2022/directionality.mjs.map +0 -1
  124. package/fesm2022/dispose-view-repeater-strategy.mjs.map +0 -1
  125. package/fesm2022/element.mjs.map +0 -1
  126. package/fesm2022/fake-event-detection.mjs.map +0 -1
  127. package/fesm2022/focus-key-manager.mjs.map +0 -1
  128. package/fesm2022/focus-monitor.mjs.map +0 -1
  129. package/fesm2022/id-generator.mjs.map +0 -1
  130. package/fesm2022/keycodes2.mjs.map +0 -1
  131. package/fesm2022/list-key-manager.mjs.map +0 -1
  132. package/fesm2022/observers/private.mjs.map +0 -1
  133. package/fesm2022/overlay-module.mjs.map +0 -1
  134. package/fesm2022/passive-listeners.mjs.map +0 -1
  135. package/fesm2022/platform2.mjs.map +0 -1
  136. package/fesm2022/recycle-view-repeater-strategy.mjs.map +0 -1
  137. package/fesm2022/scrolling2.mjs.map +0 -1
  138. package/fesm2022/selection-model.mjs.map +0 -1
  139. package/fesm2022/shadow-dom.mjs.map +0 -1
  140. package/fesm2022/style-loader.mjs.map +0 -1
  141. package/fesm2022/test-environment.mjs.map +0 -1
  142. package/fesm2022/testing/selenium-webdriver.mjs.map +0 -1
  143. package/fesm2022/testing/testbed.mjs.map +0 -1
  144. package/fesm2022/tree-key-manager.mjs.map +0 -1
  145. package/fesm2022/typeahead.mjs.map +0 -1
  146. package/fesm2022/unique-selection-dispatcher.mjs.map +0 -1
  147. /package/{bidi-module.d.d.ts → types/_bidi-module-chunk.d.ts} +0 -0
  148. /package/{data-source.d.d.ts → types/_data-source-chunk.d.ts} +0 -0
  149. /package/{focus-monitor.d.d.ts → types/_focus-monitor-chunk.d.ts} +0 -0
  150. /package/{harness-environment.d.d.ts → types/_harness-environment-chunk.d.ts} +0 -0
  151. /package/{list-key-manager.d.d.ts → types/_list-key-manager-chunk.d.ts} +0 -0
  152. /package/{number-property.d.d.ts → types/_number-property-chunk.d.ts} +0 -0
  153. /package/{platform.d.d.ts → types/_platform-chunk.d.ts} +0 -0
  154. /package/{portal-directives.d.d.ts → types/_portal-directives-chunk.d.ts} +0 -0
  155. /package/{selection-model.d.d.ts → types/_selection-model-chunk.d.ts} +0 -0
  156. /package/{style-loader.d.d.ts → types/_style-loader-chunk.d.ts} +0 -0
  157. /package/{tree-key-manager-strategy.d.d.ts → types/_tree-key-manager-strategy-chunk.d.ts} +0 -0
  158. /package/{unique-selection-dispatcher.d.d.ts → types/_unique-selection-dispatcher-chunk.d.ts} +0 -0
  159. /package/{view-repeater.d.d.ts → types/_view-repeater-chunk.d.ts} +0 -0
  160. /package/{index.d.ts → types/cdk.d.ts} +0 -0
  161. /package/{clipboard/index.d.ts → types/clipboard.d.ts} +0 -0
  162. /package/{coercion/private/index.d.ts → types/coercion-private.d.ts} +0 -0
  163. /package/{keycodes/index.d.ts → types/keycodes.d.ts} +0 -0
  164. /package/{layout/index.d.ts → types/layout.d.ts} +0 -0
  165. /package/{observers/private/index.d.ts → types/observers-private.d.ts} +0 -0
@@ -1,8 +1,8 @@
1
1
  import { signal, QueryList, isSignal, effect } from '@angular/core';
2
2
  import { Subscription, Subject } from 'rxjs';
3
- import { Typeahead } from './typeahead.mjs';
3
+ import { Typeahead } from './_typeahead-chunk.mjs';
4
4
  import { hasModifierKey } from './keycodes.mjs';
5
- import { PAGE_DOWN, PAGE_UP, END, HOME, LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW, TAB } from './keycodes2.mjs';
5
+ import { PAGE_DOWN, PAGE_UP, END, HOME, LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW, TAB } from './_keycodes-chunk.mjs';
6
6
 
7
7
  /**
8
8
  * This class manages keyboard events for selectable lists. If you pass it a query list
@@ -357,4 +357,4 @@ class ListKeyManager {
357
357
  }
358
358
 
359
359
  export { ListKeyManager };
360
- //# sourceMappingURL=list-key-manager.mjs.map
360
+ //# sourceMappingURL=_list-key-manager-chunk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_list-key-manager-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk/a11y/key-manager/list-key-manager.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n DOWN_ARROW,\n END,\n HOME,\n LEFT_ARROW,\n PAGE_DOWN,\n PAGE_UP,\n RIGHT_ARROW,\n TAB,\n UP_ARROW,\n hasModifierKey,\n} from '../../keycodes';\nimport {EffectRef, Injector, QueryList, Signal, effect, isSignal, signal} from '@angular/core';\nimport {Subject, Subscription} from 'rxjs';\nimport {Typeahead} from './typeahead';\n\n/** This interface is for items that can be passed to a ListKeyManager. */\nexport interface ListKeyManagerOption {\n /** Whether the option is disabled. */\n disabled?: boolean;\n\n /** Gets the label for this option. */\n getLabel?(): string;\n}\n\n/** Modifier keys handled by the ListKeyManager. */\nexport type ListKeyManagerModifierKey = 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey';\n\n/**\n * This class manages keyboard events for selectable lists. If you pass it a query list\n * of items, it will set the active item correctly when arrow events occur.\n */\nexport class ListKeyManager<T extends ListKeyManagerOption> {\n private _activeItemIndex = signal(-1);\n private _activeItem = signal<T | null>(null);\n private _wrap = false;\n private _typeaheadSubscription = Subscription.EMPTY;\n private _itemChangesSubscription?: Subscription;\n private _vertical = true;\n private _horizontal: 'ltr' | 'rtl' | null;\n private _allowedModifierKeys: ListKeyManagerModifierKey[] = [];\n private _homeAndEnd = false;\n private _pageUpAndDown = {enabled: false, delta: 10};\n private _effectRef: EffectRef | undefined;\n private _typeahead?: Typeahead<T>;\n\n /**\n * Predicate function that can be used to check whether an item should be skipped\n * by the key manager. By default, disabled items are skipped.\n */\n private _skipPredicateFn = (item: T) => item.disabled;\n\n constructor(items: QueryList<T> | T[] | readonly T[]);\n constructor(items: Signal<T[]> | Signal<readonly T[]>, injector: Injector);\n constructor(\n private _items: QueryList<T> | T[] | readonly T[] | Signal<T[]> | Signal<readonly T[]>,\n injector?: Injector,\n ) {\n // We allow for the items to be an array because, in some cases, the consumer may\n // not have access to a QueryList of the items they want to manage (e.g. when the\n // items aren't being collected via `ViewChildren` or `ContentChildren`).\n if (_items instanceof QueryList) {\n this._itemChangesSubscription = _items.changes.subscribe((newItems: QueryList<T>) =>\n this._itemsChanged(newItems.toArray()),\n );\n } else if (isSignal(_items)) {\n if (!injector && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw new Error('ListKeyManager constructed with a signal must receive an injector');\n }\n\n this._effectRef = effect(() => this._itemsChanged(_items()), {injector});\n }\n }\n\n /**\n * Stream that emits any time the TAB key is pressed, so components can react\n * when focus is shifted off of the list.\n */\n readonly tabOut = new Subject<void>();\n\n /** Stream that emits whenever the active item of the list manager changes. */\n readonly change = new Subject<number>();\n\n /**\n * Sets the predicate function that determines which items should be skipped by the\n * list key manager.\n * @param predicate Function that determines whether the given item should be skipped.\n */\n skipPredicate(predicate: (item: T) => boolean): this {\n this._skipPredicateFn = predicate;\n return this;\n }\n\n /**\n * Configures wrapping mode, which determines whether the active item will wrap to\n * the other end of list when there are no more items in the given direction.\n * @param shouldWrap Whether the list should wrap when reaching the end.\n */\n withWrap(shouldWrap = true): this {\n this._wrap = shouldWrap;\n return this;\n }\n\n /**\n * Configures whether the key manager should be able to move the selection vertically.\n * @param enabled Whether vertical selection should be enabled.\n */\n withVerticalOrientation(enabled: boolean = true): this {\n this._vertical = enabled;\n return this;\n }\n\n /**\n * Configures the key manager to move the selection horizontally.\n * Passing in `null` will disable horizontal movement.\n * @param direction Direction in which the selection can be moved.\n */\n withHorizontalOrientation(direction: 'ltr' | 'rtl' | null): this {\n this._horizontal = direction;\n return this;\n }\n\n /**\n * Modifier keys which are allowed to be held down and whose default actions will be prevented\n * as the user is pressing the arrow keys. Defaults to not allowing any modifier keys.\n */\n withAllowedModifierKeys(keys: ListKeyManagerModifierKey[]): this {\n this._allowedModifierKeys = keys;\n return this;\n }\n\n /**\n * Turns on typeahead mode which allows users to set the active item by typing.\n * @param debounceInterval Time to wait after the last keystroke before setting the active item.\n */\n withTypeAhead(debounceInterval: number = 200): this {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const items = this._getItemsArray();\n if (items.length > 0 && items.some(item => typeof item.getLabel !== 'function')) {\n throw Error('ListKeyManager items in typeahead mode must implement the `getLabel` method.');\n }\n }\n\n this._typeaheadSubscription.unsubscribe();\n\n const items = this._getItemsArray();\n this._typeahead = new Typeahead(items, {\n debounceInterval: typeof debounceInterval === 'number' ? debounceInterval : undefined,\n skipPredicate: item => this._skipPredicateFn(item),\n });\n\n this._typeaheadSubscription = this._typeahead.selectedItem.subscribe(item => {\n this.setActiveItem(item);\n });\n\n return this;\n }\n\n /** Cancels the current typeahead sequence. */\n cancelTypeahead(): this {\n this._typeahead?.reset();\n return this;\n }\n\n /**\n * Configures the key manager to activate the first and last items\n * respectively when the Home or End key is pressed.\n * @param enabled Whether pressing the Home or End key activates the first/last item.\n */\n withHomeAndEnd(enabled: boolean = true): this {\n this._homeAndEnd = enabled;\n return this;\n }\n\n /**\n * Configures the key manager to activate every 10th, configured or first/last element in up/down direction\n * respectively when the Page-Up or Page-Down key is pressed.\n * @param enabled Whether pressing the Page-Up or Page-Down key activates the first/last item.\n * @param delta Whether pressing the Home or End key activates the first/last item.\n */\n withPageUpDown(enabled: boolean = true, delta: number = 10): this {\n this._pageUpAndDown = {enabled, delta};\n return this;\n }\n\n /**\n * Sets the active item to the item at the index specified.\n * @param index The index of the item to be set as active.\n */\n setActiveItem(index: number): void;\n\n /**\n * Sets the active item to the specified item.\n * @param item The item to be set as active.\n */\n setActiveItem(item: T): void;\n\n /**\n * Sets the active item to the specified item.\n * @param item The item to be set as active.\n */\n setActiveItem(item: T | number): void;\n\n setActiveItem(item: any): void {\n const previousActiveItem = this._activeItem();\n\n this.updateActiveItem(item);\n\n if (this._activeItem() !== previousActiveItem) {\n this.change.next(this._activeItemIndex());\n }\n }\n\n /**\n * Sets the active item depending on the key event passed in.\n * @param event Keyboard event to be used for determining which element should be active.\n */\n onKeydown(event: KeyboardEvent): void {\n const keyCode = event.keyCode;\n const modifiers: ListKeyManagerModifierKey[] = ['altKey', 'ctrlKey', 'metaKey', 'shiftKey'];\n const isModifierAllowed = modifiers.every(modifier => {\n return !event[modifier] || this._allowedModifierKeys.indexOf(modifier) > -1;\n });\n\n switch (keyCode) {\n case TAB:\n this.tabOut.next();\n return;\n\n case DOWN_ARROW:\n if (this._vertical && isModifierAllowed) {\n this.setNextItemActive();\n break;\n } else {\n return;\n }\n\n case UP_ARROW:\n if (this._vertical && isModifierAllowed) {\n this.setPreviousItemActive();\n break;\n } else {\n return;\n }\n\n case RIGHT_ARROW:\n if (this._horizontal && isModifierAllowed) {\n this._horizontal === 'rtl' ? this.setPreviousItemActive() : this.setNextItemActive();\n break;\n } else {\n return;\n }\n\n case LEFT_ARROW:\n if (this._horizontal && isModifierAllowed) {\n this._horizontal === 'rtl' ? this.setNextItemActive() : this.setPreviousItemActive();\n break;\n } else {\n return;\n }\n\n case HOME:\n if (this._homeAndEnd && isModifierAllowed) {\n this.setFirstItemActive();\n break;\n } else {\n return;\n }\n\n case END:\n if (this._homeAndEnd && isModifierAllowed) {\n this.setLastItemActive();\n break;\n } else {\n return;\n }\n\n case PAGE_UP:\n if (this._pageUpAndDown.enabled && isModifierAllowed) {\n const targetIndex = this._activeItemIndex() - this._pageUpAndDown.delta;\n this._setActiveItemByIndex(targetIndex > 0 ? targetIndex : 0, 1);\n break;\n } else {\n return;\n }\n\n case PAGE_DOWN:\n if (this._pageUpAndDown.enabled && isModifierAllowed) {\n const targetIndex = this._activeItemIndex() + this._pageUpAndDown.delta;\n const itemsLength = this._getItemsArray().length;\n this._setActiveItemByIndex(targetIndex < itemsLength ? targetIndex : itemsLength - 1, -1);\n break;\n } else {\n return;\n }\n\n default:\n if (isModifierAllowed || hasModifierKey(event, 'shiftKey')) {\n this._typeahead?.handleKey(event);\n }\n\n // Note that we return here, in order to avoid preventing\n // the default action of non-navigational keys.\n return;\n }\n\n this._typeahead?.reset();\n event.preventDefault();\n }\n\n /** Index of the currently active item. */\n get activeItemIndex(): number | null {\n return this._activeItemIndex();\n }\n\n /** The active item. */\n get activeItem(): T | null {\n return this._activeItem();\n }\n\n /** Gets whether the user is currently typing into the manager using the typeahead feature. */\n isTyping(): boolean {\n return !!this._typeahead && this._typeahead.isTyping();\n }\n\n /** Sets the active item to the first enabled item in the list. */\n setFirstItemActive(): void {\n this._setActiveItemByIndex(0, 1);\n }\n\n /** Sets the active item to the last enabled item in the list. */\n setLastItemActive(): void {\n this._setActiveItemByIndex(this._getItemsArray().length - 1, -1);\n }\n\n /** Sets the active item to the next enabled item in the list. */\n setNextItemActive(): void {\n this._activeItemIndex() < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1);\n }\n\n /** Sets the active item to a previous enabled item in the list. */\n setPreviousItemActive(): void {\n this._activeItemIndex() < 0 && this._wrap\n ? this.setLastItemActive()\n : this._setActiveItemByDelta(-1);\n }\n\n /**\n * Allows setting the active without any other effects.\n * @param index Index of the item to be set as active.\n */\n updateActiveItem(index: number): void;\n\n /**\n * Allows setting the active item without any other effects.\n * @param item Item to be set as active.\n */\n updateActiveItem(item: T): void;\n\n updateActiveItem(item: any): void {\n const itemArray = this._getItemsArray();\n const index = typeof item === 'number' ? item : itemArray.indexOf(item);\n const activeItem = itemArray[index];\n\n // Explicitly check for `null` and `undefined` because other falsy values are valid.\n this._activeItem.set(activeItem == null ? null : activeItem);\n this._activeItemIndex.set(index);\n this._typeahead?.setCurrentSelectedItemIndex(index);\n }\n\n /** Cleans up the key manager. */\n destroy() {\n this._typeaheadSubscription.unsubscribe();\n this._itemChangesSubscription?.unsubscribe();\n this._effectRef?.destroy();\n this._typeahead?.destroy();\n this.tabOut.complete();\n this.change.complete();\n }\n\n /**\n * This method sets the active item, given a list of items and the delta between the\n * currently active item and the new active item. It will calculate differently\n * depending on whether wrap mode is turned on.\n */\n private _setActiveItemByDelta(delta: -1 | 1): void {\n this._wrap ? this._setActiveInWrapMode(delta) : this._setActiveInDefaultMode(delta);\n }\n\n /**\n * Sets the active item properly given \"wrap\" mode. In other words, it will continue to move\n * down the list until it finds an item that is not disabled, and it will wrap if it\n * encounters either end of the list.\n */\n private _setActiveInWrapMode(delta: -1 | 1): void {\n const items = this._getItemsArray();\n\n for (let i = 1; i <= items.length; i++) {\n const index = (this._activeItemIndex() + delta * i + items.length) % items.length;\n const item = items[index];\n\n if (!this._skipPredicateFn(item)) {\n this.setActiveItem(index);\n return;\n }\n }\n }\n\n /**\n * Sets the active item properly given the default mode. In other words, it will\n * continue to move down the list until it finds an item that is not disabled. If\n * it encounters either end of the list, it will stop and not wrap.\n */\n private _setActiveInDefaultMode(delta: -1 | 1): void {\n this._setActiveItemByIndex(this._activeItemIndex() + delta, delta);\n }\n\n /**\n * Sets the active item to the first enabled item starting at the index specified. If the\n * item is disabled, it will move in the fallbackDelta direction until it either\n * finds an enabled item or encounters the end of the list.\n */\n private _setActiveItemByIndex(index: number, fallbackDelta: -1 | 1): void {\n const items = this._getItemsArray();\n\n if (!items[index]) {\n return;\n }\n\n while (this._skipPredicateFn(items[index])) {\n index += fallbackDelta;\n\n if (!items[index]) {\n return;\n }\n }\n\n this.setActiveItem(index);\n }\n\n /** Returns the items as an array. */\n private _getItemsArray(): T[] | readonly T[] {\n if (isSignal(this._items)) {\n return this._items();\n }\n\n return this._items instanceof QueryList ? this._items.toArray() : this._items;\n }\n\n /** Callback for when the items have changed. */\n private _itemsChanged(newItems: T[] | readonly T[]) {\n this._typeahead?.setItems(newItems);\n const activeItem = this._activeItem();\n if (activeItem) {\n const newIndex = newItems.indexOf(activeItem);\n\n if (newIndex > -1 && newIndex !== this._activeItemIndex()) {\n this._activeItemIndex.set(newIndex);\n this._typeahead?.setCurrentSelectedItemIndex(newIndex);\n }\n }\n }\n}\n"],"names":[],"mappings":";;;;;;AAoCA;;;AAGG;MACU,cAAc,CAAA;AAuBf,IAAA,MAAA;AAtBF,IAAA,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,4DAAC;AAC7B,IAAA,WAAW,GAAG,MAAM,CAAW,IAAI,uDAAC;IACpC,KAAK,GAAG,KAAK;AACb,IAAA,sBAAsB,GAAG,YAAY,CAAC,KAAK;AAC3C,IAAA,wBAAwB;IACxB,SAAS,GAAG,IAAI;AAChB,IAAA,WAAW;IACX,oBAAoB,GAAgC,EAAE;IACtD,WAAW,GAAG,KAAK;IACnB,cAAc,GAAG,EAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAC;AAC5C,IAAA,UAAU;AACV,IAAA,UAAU;AAElB;;;AAGG;IACK,gBAAgB,GAAG,CAAC,IAAO,KAAK,IAAI,CAAC,QAAQ;IAIrD,WACU,CAAA,MAA8E,EACtF,QAAmB,EAAA;QADX,IAAM,CAAA,MAAA,GAAN,MAAM;;;;AAMd,QAAA,IAAI,MAAM,YAAY,SAAS,EAAE;YAC/B,IAAI,CAAC,wBAAwB,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAsB,KAC9E,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CACvC;;AACI,aAAA,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC3B,YAAA,IAAI,CAAC,QAAQ,KAAK,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,EAAE;AAChE,gBAAA,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC;;YAGtF,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,a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K,CAAC,EAAE;YACjB;;QAGF,OAAO,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;YAC1C,KAAK,IAAI,aAAa;AAEtB,YAAA,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;gBACjB;;;AAIJ,QAAA,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;;;IAInB,cAAc,GAAA;AACpB,QAAA,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;AACzB,YAAA,OAAO,IAAI,CAAC,MAAM,EAAE;;QAGtB,OAAO,IAAI,CAAC,MAAM,YAAY,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM;;;AAIvE,IAAA,aAAa,CAAC,QAA4B,EAAA;AAChD,QAAA,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC;AACnC,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE;QACrC,IAAI,UAAU,EAAE;YACd,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC;AAE7C,YAAA,IAAI,QAAQ,GAAG,CAAC,CAAC,IAAI,QAAQ,KAAK,IAAI,CAAC,gBAAgB,EAAE,EAAE;AACzD,gBAAA,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC;AACnC,gBAAA,IAAI,CAAC,UAAU,EAAE,2BAA2B,CAAC,QAAQ,CAAC;;;;AAI7D;;;;"}
@@ -1,20 +1,20 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { DOCUMENT, NgZone, inject, Injector, Injectable, RendererFactory2, Component, ChangeDetectionStrategy, ViewEncapsulation, afterNextRender, ElementRef, ApplicationRef, Renderer2, ANIMATION_MODULE_TYPE, EnvironmentInjector, InjectionToken, Directive, EventEmitter, TemplateRef, ViewContainerRef, booleanAttribute, Input, Output, NgModule } from '@angular/core';
3
3
  import { Location } from '@angular/common';
4
- import { Platform } from './platform2.mjs';
5
- import { _getEventTarget } from './shadow-dom.mjs';
6
- import { _isTestEnvironment } from './test-environment.mjs';
7
- import { _CdkPrivateStyleLoader } from './style-loader.mjs';
4
+ import { Platform } from './_platform-chunk.mjs';
5
+ import { _getEventTarget } from './_shadow-dom-chunk.mjs';
6
+ import { _isTestEnvironment } from './_test-environment-chunk.mjs';
7
+ import { _CdkPrivateStyleLoader } from './_style-loader-chunk.mjs';
8
8
  import { Subject, Subscription } from 'rxjs';
9
- import { coerceCssPixelValue } from './css-pixel-value.mjs';
10
- import { coerceArray } from './array.mjs';
9
+ import { coerceCssPixelValue } from './_css-pixel-value-chunk.mjs';
10
+ import { coerceArray } from './_array-chunk.mjs';
11
11
  import { ViewportRuler, ScrollDispatcher, ScrollingModule } from './scrolling.mjs';
12
12
  import { DomPortalOutlet, TemplatePortal, PortalModule } from './portal.mjs';
13
- import { supportsScrollBehavior } from './scrolling2.mjs';
13
+ import { supportsScrollBehavior } from './_scrolling-chunk.mjs';
14
14
  import { filter, takeWhile } from 'rxjs/operators';
15
- import { _IdGenerator } from './id-generator.mjs';
16
- import { Directionality } from './directionality.mjs';
17
- import { ESCAPE } from './keycodes2.mjs';
15
+ import { _IdGenerator } from './_id-generator-chunk.mjs';
16
+ import { Directionality } from './_directionality-chunk.mjs';
17
+ import { ESCAPE } from './_keycodes-chunk.mjs';
18
18
  import { hasModifierKey } from './keycodes.mjs';
19
19
  import { BidiModule } from './bidi.mjs';
20
20
 
@@ -1291,7 +1291,7 @@ class FlexibleConnectedPositionStrategy {
1291
1291
  _viewportRect;
1292
1292
  /** Cached container dimensions */
1293
1293
  _containerRect;
1294
- /** Amount of space that must be maintained between the overlay and the edge of the viewport. */
1294
+ /** Amount of space that must be maintained between the overlay and the right edge of the viewport. */
1295
1295
  _viewportMargin = 0;
1296
1296
  /** The Scrollable containers used to check scrollable view properties on position change. */
1297
1297
  _scrollables = [];
@@ -1554,8 +1554,9 @@ class FlexibleConnectedPositionStrategy {
1554
1554
  return this;
1555
1555
  }
1556
1556
  /**
1557
- * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
1558
- * @param margin Required margin between the overlay and the viewport edge in pixels.
1557
+ * Sets a minimum distance the overlay may be positioned from the bottom edge of the viewport.
1558
+ * @param margin Required margin between the overlay and the viewport.
1559
+ * It can be a number to be applied to all directions, or an object to supply different values for each direction.
1559
1560
  */
1560
1561
  withViewportMargin(margin) {
1561
1562
  this._viewportMargin = margin;
@@ -1782,13 +1783,17 @@ class FlexibleConnectedPositionStrategy {
1782
1783
  pushX = overflowLeft || -overflowRight;
1783
1784
  }
1784
1785
  else {
1785
- pushX = start.x < this._viewportMargin ? viewport.left - scrollPosition.left - start.x : 0;
1786
+ pushX =
1787
+ start.x < this._getViewportMarginStart()
1788
+ ? viewport.left - scrollPosition.left - start.x
1789
+ : 0;
1786
1790
  }
1787
1791
  if (overlay.height <= viewport.height) {
1788
1792
  pushY = overflowTop || -overflowBottom;
1789
1793
  }
1790
1794
  else {
1791
- pushY = start.y < this._viewportMargin ? viewport.top - scrollPosition.top - start.y : 0;
1795
+ pushY =
1796
+ start.y < this._getViewportMarginTop() ? viewport.top - scrollPosition.top - start.y : 0;
1792
1797
  }
1793
1798
  this._previousPushAmount = { x: pushX, y: pushY };
1794
1799
  return {
@@ -1861,14 +1866,15 @@ class FlexibleConnectedPositionStrategy {
1861
1866
  if (position.overlayY === 'top') {
1862
1867
  // Overlay is opening "downward" and thus is bound by the bottom viewport edge.
1863
1868
  top = origin.y;
1864
- height = viewport.height - top + this._viewportMargin;
1869
+ height = viewport.height - top + this._getViewportMarginBottom();
1865
1870
  }
1866
1871
  else if (position.overlayY === 'bottom') {
1867
1872
  // Overlay is opening "upward" and thus is bound by the top viewport edge. We need to add
1868
1873
  // the viewport margin back in, because the viewport rect is narrowed down to remove the
1869
1874
  // margin, whereas the `origin` position is calculated based on its `DOMRect`.
1870
- bottom = viewport.height - origin.y + this._viewportMargin * 2;
1871
- height = viewport.height - bottom + this._viewportMargin;
1875
+ bottom =
1876
+ viewport.height - origin.y + this._getViewportMarginTop() + this._getViewportMarginBottom();
1877
+ height = viewport.height - bottom + this._getViewportMarginTop();
1872
1878
  }
1873
1879
  else {
1874
1880
  // If neither top nor bottom, it means that the overlay is vertically centered on the
@@ -1889,12 +1895,13 @@ class FlexibleConnectedPositionStrategy {
1889
1895
  const isBoundedByLeftViewportEdge = (position.overlayX === 'end' && !isRtl) || (position.overlayX === 'start' && isRtl);
1890
1896
  let width, left, right;
1891
1897
  if (isBoundedByLeftViewportEdge) {
1892
- right = viewport.width - origin.x + this._viewportMargin * 2;
1893
- width = origin.x - this._viewportMargin;
1898
+ right =
1899
+ viewport.width - origin.x + this._getViewportMarginStart() + this._getViewportMarginEnd();
1900
+ width = origin.x - this._getViewportMarginStart();
1894
1901
  }
1895
1902
  else if (isBoundedByRightViewportEdge) {
1896
1903
  left = origin.x;
1897
- width = viewport.right - origin.x;
1904
+ width = viewport.right - origin.x - this._getViewportMarginEnd();
1898
1905
  }
1899
1906
  else {
1900
1907
  // If neither start nor end, it means that the overlay is horizontally centered on the
@@ -2131,12 +2138,12 @@ class FlexibleConnectedPositionStrategy {
2131
2138
  const height = this._document.documentElement.clientHeight;
2132
2139
  const scrollPosition = this._viewportRuler.getViewportScrollPosition();
2133
2140
  return {
2134
- top: scrollPosition.top + this._viewportMargin,
2135
- left: scrollPosition.left + this._viewportMargin,
2136
- right: scrollPosition.left + width - this._viewportMargin,
2137
- bottom: scrollPosition.top + height - this._viewportMargin,
2138
- width: width - 2 * this._viewportMargin,
2139
- height: height - 2 * this._viewportMargin,
2141
+ top: scrollPosition.top + this._getViewportMarginTop(),
2142
+ left: scrollPosition.left + this._getViewportMarginStart(),
2143
+ right: scrollPosition.left + width - this._getViewportMarginEnd(),
2144
+ bottom: scrollPosition.top + height - this._getViewportMarginBottom(),
2145
+ width: width - this._getViewportMarginStart() - this._getViewportMarginEnd(),
2146
+ height: height - this._getViewportMarginTop() - this._getViewportMarginBottom(),
2140
2147
  };
2141
2148
  }
2142
2149
  /** Whether the we're dealing with an RTL context */
@@ -2192,6 +2199,42 @@ class FlexibleConnectedPositionStrategy {
2192
2199
  this._appliedPanelClasses = [];
2193
2200
  }
2194
2201
  }
2202
+ /**
2203
+ * Returns either the _viewportMargin directly (if it is a number) or its 'start' value.
2204
+ * @private
2205
+ */
2206
+ _getViewportMarginStart() {
2207
+ if (typeof this._viewportMargin === 'number')
2208
+ return this._viewportMargin;
2209
+ return this._viewportMargin?.start ?? 0;
2210
+ }
2211
+ /**
2212
+ * Returns either the _viewportMargin directly (if it is a number) or its 'end' value.
2213
+ * @private
2214
+ */
2215
+ _getViewportMarginEnd() {
2216
+ if (typeof this._viewportMargin === 'number')
2217
+ return this._viewportMargin;
2218
+ return this._viewportMargin?.end ?? 0;
2219
+ }
2220
+ /**
2221
+ * Returns either the _viewportMargin directly (if it is a number) or its 'top' value.
2222
+ * @private
2223
+ */
2224
+ _getViewportMarginTop() {
2225
+ if (typeof this._viewportMargin === 'number')
2226
+ return this._viewportMargin;
2227
+ return this._viewportMargin?.top ?? 0;
2228
+ }
2229
+ /**
2230
+ * Returns either the _viewportMargin directly (if it is a number) or its 'bottom' value.
2231
+ * @private
2232
+ */
2233
+ _getViewportMarginBottom() {
2234
+ if (typeof this._viewportMargin === 'number')
2235
+ return this._viewportMargin;
2236
+ return this._viewportMargin?.bottom ?? 0;
2237
+ }
2195
2238
  /** Returns the DOMRect of the current origin. */
2196
2239
  _getOriginRect() {
2197
2240
  const origin = this._origin;
@@ -3041,4 +3084,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2",
3041
3084
  }] });
3042
3085
 
3043
3086
  export { BlockScrollStrategy, CdkConnectedOverlay, CdkOverlayOrigin, CloseScrollStrategy, ConnectedOverlayPositionChange, ConnectionPositionPair, FlexibleConnectedPositionStrategy, GlobalPositionStrategy, NoopScrollStrategy, Overlay, OverlayConfig, OverlayContainer, OverlayKeyboardDispatcher, OverlayModule, OverlayOutsideClickDispatcher, OverlayPositionBuilder, OverlayRef, RepositionScrollStrategy, STANDARD_DROPDOWN_ADJACENT_POSITIONS, STANDARD_DROPDOWN_BELOW_POSITIONS, ScrollStrategyOptions, ScrollingVisibility, createBlockScrollStrategy, createCloseScrollStrategy, createFlexibleConnectedPositionStrategy, createGlobalPositionStrategy, createNoopScrollStrategy, createOverlayRef, createRepositionScrollStrategy, validateHorizontalPosition, validateVerticalPosition };
3044
- //# sourceMappingURL=overlay-module.mjs.map
3087
+ //# sourceMappingURL=_overlay-module-chunk.mjs.map