@angular/aria 21.1.0-next.1 → 21.1.0-next.3

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 (81) hide show
  1. package/fesm2022/_accordion-chunk.mjs +108 -0
  2. package/fesm2022/_accordion-chunk.mjs.map +1 -0
  3. package/fesm2022/_combobox-chunk.mjs +425 -0
  4. package/fesm2022/_combobox-chunk.mjs.map +1 -0
  5. package/fesm2022/_combobox-listbox-chunk.mjs +240 -0
  6. package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -0
  7. package/fesm2022/_combobox-tree-chunk.mjs +331 -0
  8. package/fesm2022/_combobox-tree-chunk.mjs.map +1 -0
  9. package/fesm2022/_deferred-content-chunk.mjs +124 -0
  10. package/fesm2022/_deferred-content-chunk.mjs.map +1 -0
  11. package/fesm2022/_expansion-chunk.mjs +41 -0
  12. package/fesm2022/_expansion-chunk.mjs.map +1 -0
  13. package/fesm2022/_list-chunk.mjs +287 -0
  14. package/fesm2022/_list-chunk.mjs.map +1 -0
  15. package/fesm2022/_list-navigation-chunk.mjs +116 -0
  16. package/fesm2022/_list-navigation-chunk.mjs.map +1 -0
  17. package/fesm2022/_menu-chunk.mjs +515 -0
  18. package/fesm2022/_menu-chunk.mjs.map +1 -0
  19. package/fesm2022/_pointer-event-manager-chunk.mjs +54 -0
  20. package/fesm2022/_pointer-event-manager-chunk.mjs.map +1 -0
  21. package/fesm2022/_signal-like-chunk.mjs +118 -0
  22. package/fesm2022/_signal-like-chunk.mjs.map +1 -0
  23. package/fesm2022/_tabs-chunk.mjs +159 -0
  24. package/fesm2022/_tabs-chunk.mjs.map +1 -0
  25. package/fesm2022/_toolbar-widget-group-chunk.mjs +148 -0
  26. package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -0
  27. package/fesm2022/_widget-chunk.mjs +5 -246
  28. package/fesm2022/_widget-chunk.mjs.map +1 -1
  29. package/fesm2022/accordion.mjs +73 -55
  30. package/fesm2022/accordion.mjs.map +1 -1
  31. package/fesm2022/aria.mjs +1 -1
  32. package/fesm2022/aria.mjs.map +1 -1
  33. package/fesm2022/combobox.mjs +166 -153
  34. package/fesm2022/combobox.mjs.map +1 -1
  35. package/fesm2022/grid.mjs +287 -261
  36. package/fesm2022/grid.mjs.map +1 -1
  37. package/fesm2022/listbox.mjs +211 -197
  38. package/fesm2022/listbox.mjs.map +1 -1
  39. package/fesm2022/menu.mjs +308 -286
  40. package/fesm2022/menu.mjs.map +1 -1
  41. package/fesm2022/private.mjs +15 -2329
  42. package/fesm2022/private.mjs.map +1 -1
  43. package/fesm2022/tabs.mjs +221 -199
  44. package/fesm2022/tabs.mjs.map +1 -1
  45. package/fesm2022/toolbar.mjs +64 -48
  46. package/fesm2022/toolbar.mjs.map +1 -1
  47. package/fesm2022/tree.mjs +54 -44
  48. package/fesm2022/tree.mjs.map +1 -1
  49. package/package.json +2 -2
  50. package/types/_accordion-chunk.d.ts +100 -0
  51. package/types/_combobox-chunk.d.ts +194 -0
  52. package/types/_deferred-content-chunk.d.ts +42 -0
  53. package/types/_expansion-chunk.d.ts +40 -0
  54. package/types/_grid-chunk.d.ts +43 -250
  55. package/types/_keyboard-event-manager-chunk.d.ts +68 -0
  56. package/types/_list-chunk.d.ts +211 -0
  57. package/types/_list-navigation-chunk.d.ts +119 -0
  58. package/types/_listbox-chunk.d.ts +107 -0
  59. package/types/_menu-chunk.d.ts +267 -0
  60. package/types/_pointer-event-manager-chunk.d.ts +34 -0
  61. package/types/_tabs-chunk.d.ts +153 -0
  62. package/types/_toolbar-chunk.d.ts +124 -0
  63. package/types/_tree-chunk.d.ts +185 -0
  64. package/types/accordion.d.ts +65 -54
  65. package/types/aria.d.ts +1 -1
  66. package/types/combobox.d.ts +86 -56
  67. package/types/grid.d.ts +47 -32
  68. package/types/listbox.d.ts +22 -7
  69. package/types/menu.d.ts +135 -117
  70. package/types/private.d.ts +28 -1376
  71. package/types/tabs.d.ts +109 -88
  72. package/types/toolbar.d.ts +77 -66
  73. package/types/tree.d.ts +118 -104
  74. package/_adev_assets/aria-accordion.json +0 -743
  75. package/_adev_assets/aria-combobox.json +0 -603
  76. package/_adev_assets/aria-grid.json +0 -893
  77. package/_adev_assets/aria-listbox.json +0 -540
  78. package/_adev_assets/aria-menu.json +0 -1049
  79. package/_adev_assets/aria-tabs.json +0 -880
  80. package/_adev_assets/aria-toolbar.json +0 -545
  81. package/_adev_assets/aria-tree.json +0 -853
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_combobox-tree-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/tree/tree.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/tree/combobox-tree.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 {SignalLike, computed, WritableSignalLike} from '../behaviors/signal-like/signal-like';\nimport {List, ListInputs, ListItem} from '../behaviors/list/list';\nimport {ExpansionItem, ListExpansion} from '../behaviors/expansion/expansion';\nimport {KeyboardEventManager, PointerEventManager, Modifier} from '../behaviors/event-manager';\n\n/** Represents the required inputs for a tree item. */\nexport interface TreeItemInputs<V>\n extends Omit<ListItem<V>, 'index'>, Omit<ExpansionItem, 'expandable'> {\n /** The parent item. */\n parent: SignalLike<TreeItemPattern<V> | TreePattern<V>>;\n\n /** Whether this item has children. Children can be lazily loaded. */\n hasChildren: SignalLike<boolean>;\n\n /** The children items. */\n children: SignalLike<TreeItemPattern<V>[]>;\n\n /** The tree pattern this item belongs to. */\n tree: SignalLike<TreePattern<V>>;\n}\n\n/**\n * Represents an item in a Tree.\n */\nexport class TreeItemPattern<V> implements ListItem<V>, ExpansionItem {\n /** A unique identifier for this item. */\n readonly id: SignalLike<string> = () => this.inputs.id();\n\n /** The value of this item. */\n readonly value: SignalLike<V> = () => this.inputs.value();\n\n /** A reference to the item element. */\n readonly element: SignalLike<HTMLElement> = () => this.inputs.element()!;\n\n /** Whether the item is disabled. */\n readonly disabled: SignalLike<boolean> = () => this.inputs.disabled();\n\n /** The text used by the typeahead search. */\n readonly searchTerm: SignalLike<string> = () => this.inputs.searchTerm();\n\n /** The tree pattern this item belongs to. */\n readonly tree: SignalLike<TreePattern<V>> = () => this.inputs.tree();\n\n /** The parent item. */\n readonly parent: SignalLike<TreeItemPattern<V> | TreePattern<V>> = () => this.inputs.parent();\n\n /** The children items. */\n readonly children: SignalLike<TreeItemPattern<V>[]> = () => this.inputs.children();\n\n /** The position of this item among its siblings. */\n readonly index = computed(() => this.tree().visibleItems().indexOf(this));\n\n /** Controls expansion for child items. */\n readonly expansionBehavior: ListExpansion;\n\n /** Whether the item is expandable. It's expandable if children item exist. */\n readonly expandable: SignalLike<boolean> = () => this.inputs.hasChildren();\n\n /** Whether the item is selectable. */\n readonly selectable: SignalLike<boolean> = () => this.inputs.selectable();\n\n /** Whether the item is expanded. */\n readonly expanded: WritableSignalLike<boolean>;\n\n /** The level of the current item in a tree. */\n readonly level: SignalLike<number> = computed(() => this.parent().level() + 1);\n\n /** Whether this item is visible. */\n readonly visible: SignalLike<boolean> = computed(\n () => this.parent().expanded() && this.parent().visible(),\n );\n\n /** The number of items under the same parent at the same level. */\n readonly setsize = computed(() => this.parent().children().length);\n\n /** The position of this item among its siblings (1-based). */\n readonly posinset = computed(() => this.parent().children().indexOf(this) + 1);\n\n /** Whether the item is active. */\n readonly active = computed(() => this.tree().activeItem() === this);\n\n /** The tab index of the item. */\n readonly tabIndex = computed(() => this.tree().listBehavior.getItemTabindex(this));\n\n /** Whether the item is selected. */\n readonly selected: SignalLike<boolean | undefined> = computed(() => {\n if (this.tree().nav()) {\n return undefined;\n }\n if (!this.selectable()) {\n return undefined;\n }\n return this.tree().values().includes(this.value());\n });\n\n /** The current type of this item. */\n readonly current: SignalLike<string | undefined> = computed(() => {\n if (!this.tree().nav()) {\n return undefined;\n }\n if (!this.selectable()) {\n return undefined;\n }\n return this.tree().values().includes(this.value()) ? this.tree().currentType() : undefined;\n });\n\n constructor(readonly inputs: TreeItemInputs<V>) {\n this.expanded = inputs.expanded;\n this.expansionBehavior = new ListExpansion({\n ...inputs,\n multiExpandable: () => true,\n items: this.children,\n disabled: computed(() => this.tree()?.disabled() ?? false),\n });\n }\n}\n\n/** The selection operations that the tree 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 tree. */\nexport interface TreeInputs<V> extends Omit<ListInputs<TreeItemPattern<V>, V>, 'items'> {\n /** A unique identifier for the tree. */\n id: SignalLike<string>;\n\n /** All items in the tree, in document order (DFS-like, a flattened list). */\n allItems: SignalLike<TreeItemPattern<V>[]>;\n\n /** Whether the tree is in navigation mode. */\n nav: SignalLike<boolean>;\n\n /** The aria-current type. */\n currentType: SignalLike<'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'>;\n}\n\n/** Controls the state and interactions of a tree view. */\nexport class TreePattern<V> implements TreeInputs<V> {\n /** The list behavior for the tree. */\n readonly listBehavior: List<TreeItemPattern<V>, V>;\n\n /** Controls expansion for direct children of the tree root (top-level items). */\n readonly expansionBehavior: ListExpansion;\n\n /** The root level is 0. */\n readonly level = () => 0;\n\n /** The root is always expanded. */\n readonly expanded = () => true;\n\n /** The root is always visible. */\n readonly visible = () => true;\n\n /** The tab index of the tree. */\n readonly tabIndex: SignalLike<-1 | 0> = computed(() => this.listBehavior.tabIndex());\n\n /** The id of the current active item. */\n readonly activeDescendant = computed(() => this.listBehavior.activeDescendant());\n\n /** The direct children of the root (top-level tree items). */\n readonly children = computed(() =>\n this.inputs.allItems().filter(item => item.level() === this.level() + 1),\n );\n\n /** All currently visible tree items. An item is visible if their parent is expanded. */\n readonly visibleItems = computed(() => this.inputs.allItems().filter(item => item.visible()));\n\n /** Whether the tree selection follows focus. */\n readonly followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** Whether the tree direction is RTL. */\n readonly isRtl = computed(() => this.inputs.textDirection() === 'rtl');\n\n /** The key for navigating to the previous item. */\n readonly prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.isRtl() ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key for navigating to the next item. */\n readonly nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.isRtl() ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The key for collapsing an item or moving to its parent. */\n readonly collapseKey = computed(() => {\n if (this.inputs.orientation() === 'horizontal') {\n return 'ArrowUp';\n }\n return this.isRtl() ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key for expanding an item or moving to its first child. */\n readonly expandKey = computed(() => {\n if (this.inputs.orientation() === 'horizontal') {\n return 'ArrowDown';\n }\n return this.isRtl() ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** Represents the space key. Does nothing when the user is actively using typeahead. */\n readonly dynamicSpaceKey = computed(() => (this.listBehavior.isTyping() ? '' : ' '));\n\n /** Regular expression to match characters for typeahead. */\n readonly typeaheadRegexp = /^.$/;\n\n /** The keydown event manager for the tree. */\n readonly keydown = computed(() => {\n const manager = new KeyboardEventManager();\n const list = this.listBehavior;\n\n manager\n .on(this.prevKey, () => list.prev({selectOne: this.followFocus()}))\n .on(this.nextKey, () => list.next({selectOne: this.followFocus()}))\n .on('Home', () => list.first({selectOne: this.followFocus()}))\n .on('End', () => list.last({selectOne: this.followFocus()}))\n .on(this.typeaheadRegexp, e => list.search(e.key, {selectOne: this.followFocus()}))\n .on(this.expandKey, () => this.expand({selectOne: this.followFocus()}))\n .on(this.collapseKey, () => this.collapse({selectOne: this.followFocus()}))\n .on(Modifier.Shift, '*', () => this.expandSiblings());\n\n if (this.inputs.multi()) {\n manager\n // TODO: Tracking the anchor by index can break if the\n // tree is expanded or collapsed causing the index to change.\n .on(Modifier.Any, 'Shift', () => list.anchor(this.listBehavior.activeIndex()))\n .on(Modifier.Shift, this.prevKey, () => list.prev({selectRange: true}))\n .on(Modifier.Shift, this.nextKey, () => list.next({selectRange: true}))\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () =>\n list.first({selectRange: true, anchor: false}),\n )\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () =>\n list.last({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, 'Enter', () => list.updateSelection({selectRange: true, anchor: false}))\n .on(Modifier.Shift, this.dynamicSpaceKey, () =>\n list.updateSelection({selectRange: true, anchor: false}),\n );\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager\n .on(this.dynamicSpaceKey, () => list.toggle())\n .on('Enter', () => list.toggle(), {preventDefault: !this.nav()})\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => list.toggleAll());\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => list.selectOne());\n manager.on('Enter', () => list.selectOne(), {preventDefault: !this.nav()});\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => list.prev())\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => list.next())\n .on([Modifier.Ctrl, Modifier.Meta], this.expandKey, () => this.expand())\n .on([Modifier.Ctrl, Modifier.Meta], this.collapseKey, () => this.collapse())\n .on([Modifier.Ctrl, Modifier.Meta], ' ', () => list.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => list.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Home', () => list.first())\n .on([Modifier.Ctrl, Modifier.Meta], 'End', () => list.last())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => {\n list.toggleAll();\n list.select(); // Ensure the currect item remains selected.\n });\n }\n\n return manager;\n });\n\n /** The pointerdown event manager for the tree. */\n pointerdown = computed(() => {\n const manager = new PointerEventManager();\n\n if (this.multi()) {\n manager.on(Modifier.Shift, e => this.goto(e, {selectRange: true}));\n }\n\n if (!this.multi()) {\n return manager.on(e => this.goto(e, {selectOne: 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 /** A unique identifier for the tree. */\n readonly id: SignalLike<string> = () => this.inputs.id();\n\n /** The host native element. */\n readonly element: SignalLike<HTMLElement> = () => this.inputs.element()!;\n\n /** Whether the tree is in navigation mode. */\n readonly nav: SignalLike<boolean> = () => this.inputs.nav();\n\n /** The aria-current type. */\n readonly currentType: SignalLike<\n 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'\n > = () => this.inputs.currentType();\n\n /** All items in the tree, in document order (DFS-like, a flattened list). */\n readonly allItems: SignalLike<TreeItemPattern<V>[]> = () => this.inputs.allItems();\n\n /** The focus strategy used by the tree. */\n readonly focusMode: SignalLike<'roving' | 'activedescendant'> = () => this.inputs.focusMode();\n\n /** Whether the tree is disabled. */\n readonly disabled: SignalLike<boolean> = () => this.inputs.disabled();\n\n /** The currently active item in the tree. */\n readonly activeItem: WritableSignalLike<TreeItemPattern<V> | undefined>;\n\n /** Whether disabled items should be focusable. */\n readonly softDisabled: SignalLike<boolean> = () => this.inputs.softDisabled();\n\n /** Whether the focus should wrap when navigating past the first or last item. */\n readonly wrap: SignalLike<boolean> = () => this.inputs.wrap();\n\n /** The orientation of the tree. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'> = () => this.inputs.orientation();\n\n /** The text direction of the tree. */\n readonly textDirection: SignalLike<'ltr' | 'rtl'> = () => this.textDirection();\n\n /** Whether multiple items can be selected at the same time. */\n readonly multi: SignalLike<boolean> = computed(() => (this.nav() ? false : this.inputs.multi()));\n\n /** The selection mode of the tree. */\n readonly selectionMode: SignalLike<'follow' | 'explicit'> = () => this.inputs.selectionMode();\n\n /** The delay in milliseconds to wait before clearing the typeahead buffer. */\n readonly typeaheadDelay: SignalLike<number> = () => this.inputs.typeaheadDelay();\n\n /** The current selected items of the tree. */\n readonly values: WritableSignalLike<V[]>;\n\n constructor(readonly inputs: TreeInputs<V>) {\n this.activeItem = inputs.activeItem;\n this.values = inputs.values;\n\n this.listBehavior = new List({\n ...inputs,\n items: this.visibleItems,\n multi: this.multi,\n });\n\n this.expansionBehavior = new ListExpansion({\n multiExpandable: () => true,\n items: this.children,\n disabled: this.disabled,\n });\n }\n\n /**\n * Sets the tree to it's default initial state.\n *\n * Sets the active index of the tree to the first focusable selected tree item if one exists.\n * Otherwise, sets focus to the first focusable tree item.\n */\n setDefaultState() {\n let firstItem: TreeItemPattern<V> | undefined;\n\n for (const item of this.allItems()) {\n if (!item.visible()) continue;\n if (!this.listBehavior.isFocusable(item)) continue;\n\n if (firstItem === undefined) {\n firstItem = item;\n }\n\n if (item.selected()) {\n this.activeItem.set(item);\n return;\n }\n }\n\n if (firstItem !== undefined) {\n this.activeItem.set(firstItem);\n }\n }\n\n /** Handles keydown events on the tree. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n /** Handles pointerdown events on the tree. */\n onPointerdown(event: PointerEvent) {\n if (!this.disabled()) {\n this.pointerdown().handle(event);\n }\n }\n\n /** Navigates to the given tree item in the tree. */\n goto(e: PointerEvent, opts?: SelectOptions) {\n const item = this._getItem(e);\n if (!item) return;\n\n this.listBehavior.goto(item, opts);\n this.toggleExpansion(item);\n }\n\n /** Toggles to expand or collapse a tree item. */\n toggleExpansion(item?: TreeItemPattern<V>) {\n item ??= this.activeItem();\n if (!item || !this.listBehavior.isFocusable(item)) return;\n\n if (!item.expandable()) return;\n if (item.expanded()) {\n this.collapse();\n } else {\n this.expansionBehavior.open(item);\n }\n }\n\n /** Expands a tree item. */\n expand(opts?: SelectOptions) {\n const item = this.activeItem();\n if (!item || !this.listBehavior.isFocusable(item)) return;\n\n if (item.expandable() && !item.expanded()) {\n this.expansionBehavior.open(item);\n } else if (\n item.expanded() &&\n item.children().some(item => this.listBehavior.isFocusable(item))\n ) {\n this.listBehavior.next(opts);\n }\n }\n\n /** Expands all sibling tree items including itself. */\n expandSiblings(item?: TreeItemPattern<V>) {\n item ??= this.activeItem();\n const siblings = item?.parent()?.children();\n siblings?.forEach(item => this.expansionBehavior.open(item));\n }\n\n /** Collapses a tree item. */\n collapse(opts?: SelectOptions) {\n const item = this.activeItem();\n if (!item || !this.listBehavior.isFocusable(item)) return;\n\n if (item.expandable() && item.expanded()) {\n this.expansionBehavior.close(item);\n } else if (item.parent() && item.parent() !== this) {\n const parentItem = item.parent();\n if (parentItem instanceof TreeItemPattern && this.listBehavior.isFocusable(parentItem)) {\n this.listBehavior.goto(parentItem, opts);\n }\n }\n }\n\n /** Retrieves the TreeItemPattern associated with a DOM event, if any. */\n protected _getItem(event: Event): TreeItemPattern<V> | undefined {\n if (!(event.target instanceof HTMLElement)) {\n return;\n }\n const element = event.target.closest('[role=\"treeitem\"]');\n return this.inputs.allItems().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 {TreeInputs, TreePattern, TreeItemPattern} from './tree';\nimport {computed, SignalLike} from '../behaviors/signal-like/signal-like';\nimport {ComboboxPattern, ComboboxTreeControls} from '../combobox/combobox';\n\nexport type ComboboxTreeInputs<V> = TreeInputs<V> & {\n /** The combobox controlling the tree. */\n combobox: SignalLike<ComboboxPattern<TreeItemPattern<V>, V> | undefined>;\n};\n\nexport class ComboboxTreePattern<V>\n extends TreePattern<V>\n implements ComboboxTreeControls<TreeItemPattern<V>, V>\n{\n /** Whether the currently focused item is collapsible. */\n isItemCollapsible = () => this.inputs.activeItem()?.parent() instanceof TreeItemPattern;\n\n /** The ARIA role for the tree. */\n role = () => 'tree' as const;\n\n /* The id of the active (focused) item in the tree. */\n activeId = computed(() => this.listBehavior.activeDescendant());\n\n /** Returns the currently active (focused) item in the tree. */\n getActiveItem = () => this.inputs.activeItem();\n\n /** The list of items in the tree. */\n items = computed(() => this.inputs.allItems());\n\n /** The tab index for the tree. Always -1 because the combobox handles focus. */\n override tabIndex: SignalLike<-1 | 0> = () => -1;\n\n constructor(override readonly inputs: ComboboxTreeInputs<V>) {\n if (inputs.combobox()) {\n inputs.multi = () => false;\n inputs.focusMode = () => 'activedescendant';\n inputs.element = inputs.combobox()!.inputs.inputEl;\n }\n\n super(inputs);\n }\n\n /** Noop. The combobox handles keydown events. */\n override onKeydown(_: KeyboardEvent): void {}\n\n /** Noop. The combobox handles pointerdown events. */\n override onPointerdown(_: PointerEvent): void {}\n\n /** Noop. The combobox controls the open state. */\n override setDefaultState(): void {}\n\n /** Navigates to the specified item in the tree. */\n focus = (item: TreeItemPattern<V>) => this.listBehavior.goto(item);\n\n /** Navigates to the next focusable item in the tree. */\n next = () => this.listBehavior.next();\n\n /** Navigates to the previous focusable item in the tree. */\n prev = () => this.listBehavior.prev();\n\n /** Navigates to the last focusable item in the tree. */\n last = () => this.listBehavior.last();\n\n /** Navigates to the first focusable item in the tree. */\n first = () => this.listBehavior.first();\n\n /** Unfocuses the currently focused item in the tree. */\n unfocus = () => this.listBehavior.unfocus();\n\n // TODO: handle non-selectable parent nodes.\n /** Selects the specified item in the tree or the current active item if not provided. */\n select = (item?: TreeItemPattern<V>) => this.listBehavior.select(item);\n\n /** Toggles the selection state of the given item in the tree or the current active item if not provided. */\n toggle = (item?: TreeItemPattern<V>) => this.listBehavior.toggle(item);\n\n /** Clears the selection in the tree. */\n clearSelection = () => this.listBehavior.deselectAll();\n\n /** Retrieves the TreeItemPattern associated with a pointer event. */\n getItem = (e: PointerEvent) => this._getItem(e);\n\n /** Retrieves the currently selected items in the tree */\n getSelectedItems = () => this.inputs.allItems().filter(item => item.selected());\n\n /** Sets the value of the combobox tree. */\n setValue = (value: V | undefined) => this.inputs.values.set(value ? [value] : []);\n\n /** Expands the currently focused item if it is expandable. */\n expandItem = () => this.expand();\n\n /** Collapses the currently focused item if it is expandable. */\n collapseItem = () => this.collapse();\n\n /** Whether the specified item or the currently active item is expandable. */\n isItemExpandable(item: TreeItemPattern<V> | undefined = this.inputs.activeItem()) {\n return item ? item.expandable() : false;\n }\n\n /** Expands all of the tree items. */\n expandAll = () => this.items().forEach(item => this.expansionBehavior.open(item));\n\n /** Collapses all of the tree items. */\n collapseAll = () => this.items().forEach(item => item.expansionBehavior.close(item));\n\n /** Whether the currently active item is selectable. */\n isItemSelectable = (item: TreeItemPattern<V> | undefined = this.inputs.activeItem()) => {\n return item ? item.selectable() : false;\n };\n}\n"],"names":["TreeItemPattern","inputs","id","value","element","disabled","searchTerm","tree","parent","children","index","computed","visibleItems","indexOf","expansionBehavior","expandable","hasChildren","selectable","expanded","level","visible","setsize","length","posinset","active","activeItem","tabIndex","listBehavior","getItemTabindex","selected","nav","undefined","values","includes","current","currentType","constructor","ListExpansion","multiExpandable","items","TreePattern","activeDescendant","allItems","filter","item","followFocus","selectionMode","isRtl","textDirection","prevKey","orientation","nextKey","collapseKey","expandKey","dynamicSpaceKey","isTyping","typeaheadRegexp","keydown","manager","KeyboardEventManager","list","on","prev","selectOne","next","first","last","e","search","key","expand","collapse","Modifier","Shift","expandSiblings","multi","Any","anchor","activeIndex","selectRange","Ctrl","Meta","updateSelection","toggle","preventDefault","toggleAll","select","pointerdown","PointerEventManager","goto","focusMode","softDisabled","wrap","typeaheadDelay","List","setDefaultState","firstItem","isFocusable","set","onKeydown","event","handle","onPointerdown","opts","_getItem","toggleExpansion","open","some","siblings","forEach","close","parentItem","target","HTMLElement","closest","find","i","ComboboxTreePattern","isItemCollapsible","role","activeId","getActiveItem","combobox","inputEl","_","focus","unfocus","clearSelection","deselectAll","getItem","getSelectedItems","setValue","expandItem","collapseItem","isItemExpandable","expandAll","coll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EAAE,CAACsE,OAAO,CAACjE,IAAI,IAAI,IAAI,CAAC9B,iBAAiB,CAAC4F,IAAI,CAAC9D,IAAI,CAAC,CAAC;EAGjF4F,WAAW,GAAGA,MAAM,IAAI,CAACjG,KAAK,EAAE,CAACsE,OAAO,CAACjE,IAAI,IAAIA,IAAI,CAAC9B,iBAAiB,CAACgG,KAAK,CAAClE,IAAI,CAAC,CAAC;EAGpF6F,gBAAgB,GAAGA,CAAC7F,IAAA,GAAuC,IAAI,CAAC3C,MAAM,CAACwB,UAAU,EAAE,KAAI;IACrF,OAAOmB,IAAI,GAAGA,IAAI,CAAC3B,UAAU,EAAE,GAAG,KAAK;GACxC;AACF;;;;"}
@@ -0,0 +1,124 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, model, Directive, inject, TemplateRef, ViewContainerRef, afterRenderEffect } from '@angular/core';
3
+
4
+ class DeferredContentAware {
5
+ contentVisible = signal(false, ...(ngDevMode ? [{
6
+ debugName: "contentVisible"
7
+ }] : []));
8
+ preserveContent = model(false, ...(ngDevMode ? [{
9
+ debugName: "preserveContent"
10
+ }] : []));
11
+ static ɵfac = i0.ɵɵngDeclareFactory({
12
+ minVersion: "12.0.0",
13
+ version: "21.0.3",
14
+ ngImport: i0,
15
+ type: DeferredContentAware,
16
+ deps: [],
17
+ target: i0.ɵɵFactoryTarget.Directive
18
+ });
19
+ static ɵdir = i0.ɵɵngDeclareDirective({
20
+ minVersion: "17.1.0",
21
+ version: "21.0.3",
22
+ type: DeferredContentAware,
23
+ isStandalone: true,
24
+ inputs: {
25
+ preserveContent: {
26
+ classPropertyName: "preserveContent",
27
+ publicName: "preserveContent",
28
+ isSignal: true,
29
+ isRequired: false,
30
+ transformFunction: null
31
+ }
32
+ },
33
+ outputs: {
34
+ preserveContent: "preserveContentChange"
35
+ },
36
+ ngImport: i0
37
+ });
38
+ }
39
+ i0.ɵɵngDeclareClassMetadata({
40
+ minVersion: "12.0.0",
41
+ version: "21.0.3",
42
+ ngImport: i0,
43
+ type: DeferredContentAware,
44
+ decorators: [{
45
+ type: Directive
46
+ }],
47
+ propDecorators: {
48
+ preserveContent: [{
49
+ type: i0.Input,
50
+ args: [{
51
+ isSignal: true,
52
+ alias: "preserveContent",
53
+ required: false
54
+ }]
55
+ }, {
56
+ type: i0.Output,
57
+ args: ["preserveContentChange"]
58
+ }]
59
+ }
60
+ });
61
+ class DeferredContent {
62
+ _deferredContentAware = inject(DeferredContentAware, {
63
+ optional: true
64
+ });
65
+ _templateRef = inject(TemplateRef);
66
+ _viewContainerRef = inject(ViewContainerRef);
67
+ _currentViewRef = null;
68
+ _isRendered = false;
69
+ deferredContentAware = signal(this._deferredContentAware, ...(ngDevMode ? [{
70
+ debugName: "deferredContentAware"
71
+ }] : []));
72
+ constructor() {
73
+ afterRenderEffect(() => {
74
+ if (this.deferredContentAware()?.contentVisible()) {
75
+ if (!this._isRendered) {
76
+ this._destroyContent();
77
+ this._currentViewRef = this._viewContainerRef.createEmbeddedView(this._templateRef);
78
+ this._isRendered = true;
79
+ }
80
+ } else if (!this.deferredContentAware()?.preserveContent()) {
81
+ this._destroyContent();
82
+ this._isRendered = false;
83
+ }
84
+ });
85
+ }
86
+ ngOnDestroy() {
87
+ this._destroyContent();
88
+ }
89
+ _destroyContent() {
90
+ const ref = this._currentViewRef;
91
+ if (ref && !ref.destroyed) {
92
+ ref.destroy();
93
+ this._currentViewRef = null;
94
+ }
95
+ }
96
+ static ɵfac = i0.ɵɵngDeclareFactory({
97
+ minVersion: "12.0.0",
98
+ version: "21.0.3",
99
+ ngImport: i0,
100
+ type: DeferredContent,
101
+ deps: [],
102
+ target: i0.ɵɵFactoryTarget.Directive
103
+ });
104
+ static ɵdir = i0.ɵɵngDeclareDirective({
105
+ minVersion: "14.0.0",
106
+ version: "21.0.3",
107
+ type: DeferredContent,
108
+ isStandalone: true,
109
+ ngImport: i0
110
+ });
111
+ }
112
+ i0.ɵɵngDeclareClassMetadata({
113
+ minVersion: "12.0.0",
114
+ version: "21.0.3",
115
+ ngImport: i0,
116
+ type: DeferredContent,
117
+ decorators: [{
118
+ type: Directive
119
+ }],
120
+ ctorParameters: () => []
121
+ });
122
+
123
+ export { DeferredContent, DeferredContentAware };
124
+ //# sourceMappingURL=_deferred-content-chunk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_deferred-content-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/deferred-content/deferred-content.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n afterRenderEffect,\n Directive,\n inject,\n TemplateRef,\n signal,\n ViewContainerRef,\n model,\n EmbeddedViewRef,\n OnDestroy,\n} from '@angular/core';\n\n/**\n * A container directive controls the visibility of its content.\n */\n@Directive()\nexport class DeferredContentAware {\n readonly contentVisible = signal(false);\n readonly preserveContent = model(false);\n}\n\n/**\n * DeferredContent loads/unloads the content based on the visibility.\n * The visibilty signal is sent from a parent directive implements\n * DeferredContentAware.\n *\n * Use this directive as a host directive. For example:\n *\n * ```ts\n * @Directive({\n * selector: 'ng-template[AccordionContent]',\n * hostDirectives: [DeferredContent],\n * })\n * class AccordionContent {}\n * ```\n */\n@Directive()\nexport class DeferredContent implements OnDestroy {\n private readonly _deferredContentAware = inject(DeferredContentAware, {optional: true});\n private readonly _templateRef = inject(TemplateRef);\n private readonly _viewContainerRef = inject(ViewContainerRef);\n private _currentViewRef: EmbeddedViewRef<unknown> | null = null;\n private _isRendered = false;\n\n readonly deferredContentAware = signal(this._deferredContentAware);\n\n constructor() {\n afterRenderEffect(() => {\n if (this.deferredContentAware()?.contentVisible()) {\n if (!this._isRendered) {\n this._destroyContent();\n this._currentViewRef = this._viewContainerRef.createEmbeddedView(this._templateRef);\n this._isRendered = true;\n }\n } else if (!this.deferredContentAware()?.preserveContent()) {\n this._destroyContent();\n this._isRendered = false;\n }\n });\n }\n\n ngOnDestroy(): void {\n this._destroyContent();\n }\n\n private _destroyContent() {\n const ref = this._currentViewRef;\n\n if (ref && !ref.destroyed) {\n ref.destroy();\n this._currentViewRef = null;\n }\n }\n}\n"],"names":["DeferredContentAware","contentVisible","signal","preserveContent","model","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","ngImport","decorators","DeferredContent","_deferredContentAware","inject","optional","_templateRef","TemplateRef","_viewContainerRef","ViewContainerRef","_currentViewRef","_isRendered","deferredContentAware","constructor","afterRenderEffect","_destroyContent","createEmbeddedView","ngOnDestroy","ref","destroyed","destroy"],"mappings":";;;MAwBaA,oBAAoB,CAAA;EACtBC,cAAc,GAAGC,MAAM,CAAC,KAAK;;WAAC;EAC9BC,eAAe,GAAGC,KAAK,CAAC,KAAK;;WAAC;;;;;UAF5BJ,oBAAoB;AAAAK,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;UAApBT,oBAAoB;AAAAU,IAAAA,YAAA,EAAA,IAAA;AAAAC,IAAAA,MAAA,EAAA;AAAAR,MAAAA,eAAA,EAAA;AAAAS,QAAAA,iBAAA,EAAA,iBAAA;AAAAC,QAAAA,UAAA,EAAA,iBAAA;AAAAC,QAAAA,QAAA,EAAA,IAAA;AAAAC,QAAAA,UAAA,EAAA,KAAA;AAAAC,QAAAA,iBAAA,EAAA;AAAA;KAAA;AAAAC,IAAAA,OAAA,EAAA;AAAAd,MAAAA,eAAA,EAAA;KAAA;AAAAe,IAAAA,QAAA,EAAAX;AAAA,GAAA,CAAA;;;;;;QAApBP,oBAAoB;AAAAmB,EAAAA,UAAA,EAAA,CAAA;UADhCV;;;;;;;;;;;;;;;;MAsBYW,eAAe,CAAA;AACTC,EAAAA,qBAAqB,GAAGC,MAAM,CAACtB,oBAAoB,EAAE;AAACuB,IAAAA,QAAQ,EAAE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AAA,EAAA,IAAA;AAAAQ,IAAAA,QAAA,EAAAX;AAAA,GAAA,CAAA;;;;;;QAAfa,eAAe;AAAAD,EAAAA,UAAA,EAAA,CAAA;UAD3BV;;;;;;;"}
@@ -0,0 +1,41 @@
1
+ class ListExpansion {
2
+ inputs;
3
+ constructor(inputs) {
4
+ this.inputs = inputs;
5
+ }
6
+ open(item) {
7
+ if (!this.isExpandable(item)) return false;
8
+ if (item.expanded()) return false;
9
+ if (!this.inputs.multiExpandable()) {
10
+ this.closeAll();
11
+ }
12
+ item.expanded.set(true);
13
+ return true;
14
+ }
15
+ close(item) {
16
+ if (!this.isExpandable(item)) return false;
17
+ item.expanded.set(false);
18
+ return true;
19
+ }
20
+ toggle(item) {
21
+ return item.expanded() ? this.close(item) : this.open(item);
22
+ }
23
+ openAll() {
24
+ if (this.inputs.multiExpandable()) {
25
+ for (const item of this.inputs.items()) {
26
+ this.open(item);
27
+ }
28
+ }
29
+ }
30
+ closeAll() {
31
+ for (const item of this.inputs.items()) {
32
+ this.close(item);
33
+ }
34
+ }
35
+ isExpandable(item) {
36
+ return !this.inputs.disabled() && !item.disabled() && item.expandable();
37
+ }
38
+ }
39
+
40
+ export { ListExpansion };
41
+ //# sourceMappingURL=_expansion-chunk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_expansion-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/expansion/expansion.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 */\nimport {SignalLike, WritableSignalLike} from '../signal-like/signal-like';\n\n/** Represents an item that can be expanded or collapsed. */\nexport interface ExpansionItem {\n /** Whether the item is expandable. */\n expandable: SignalLike<boolean>;\n\n /** Whether the item is expanded. */\n expanded: WritableSignalLike<boolean>;\n\n /** Whether the expansion is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for an expansion behavior. */\nexport interface ListExpansionInputs {\n /** Whether multiple items can be expanded at once. */\n multiExpandable: SignalLike<boolean>;\n\n /** An array of expansion items. */\n items: SignalLike<ExpansionItem[]>;\n\n /** Whether all expansions are disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Manages the expansion state of a list of items. */\nexport class ListExpansion {\n constructor(readonly inputs: ListExpansionInputs) {}\n\n /** Opens the specified item. */\n open(item: ExpansionItem): boolean {\n if (!this.isExpandable(item)) return false;\n if (item.expanded()) return false;\n if (!this.inputs.multiExpandable()) {\n this.closeAll();\n }\n item.expanded.set(true);\n return true;\n }\n\n /** Closes the specified item. */\n close(item: ExpansionItem): boolean {\n if (!this.isExpandable(item)) return false;\n\n item.expanded.set(false);\n return true;\n }\n\n /** Toggles the expansion state of the specified item. */\n toggle(item: ExpansionItem): boolean {\n return item.expanded() ? this.close(item) : this.open(item);\n }\n\n /** Opens all focusable items in the list. */\n openAll(): void {\n if (this.inputs.multiExpandable()) {\n for (const item of this.inputs.items()) {\n this.open(item);\n }\n }\n }\n\n /** Closes all focusable items in the list. */\n closeAll(): void {\n for (const item of this.inputs.items()) {\n this.close(item);\n }\n }\n\n /** Checks whether the specified item is expandable / collapsible. */\n isExpandable(item: ExpansionItem) {\n return !this.inputs.disabled() && !item.disabled() && item.expandable();\n }\n}\n"],"names":["ListExpansion","inputs","constructor","open","item","isExpandable","expanded","multiExpandable","closeAll","set","close","toggle","openAll","items","disabled","expandable"],"mappings":"MAkCaA,aAAa,CAAA;EACHC,MAAA;EAArBC,WAAAA,CAAqBD,MAA2B,EAAA;IAA3B,IAAM,CAAAA,MAAA,GAANA,MAAM;AAAwB;EAGnDE,IAAIA,CAACC,IAAmB,EAAA;IACtB,IAAI,CAAC,IAAI,CAACC,YAAY,CAACD,IAAI,CAAC,EAAE,OAAO,KAAK;AAC1C,IAAA,IAAIA,IAAI,CAACE,QAAQ,EAAE,EAAE,OAAO,KAAK;IACjC,IAAI,CAAC,IAAI,CAACL,MAAM,CAACM,eAAe,EAAE,EAAE;MAClC,IAAI,CAACC,QAAQ,EAAE;AACjB;AACAJ,IAAAA,IAAI,CAACE,QAAQ,CAACG,GAAG,CAAC,IAAI,CAAC;AACvB,IAAA,OAAO,IAAI;AACb;EAGAC,KAAKA,CAACN,IAAmB,EAAA;IACvB,IAAI,CAAC,IAAI,CAACC,YAAY,CAACD,IAAI,CAAC,EAAE,OAAO,KAAK;AAE1CA,IAAAA,IAAI,CAACE,QAAQ,CAACG,GAAG,CAAC,KAAK,CAAC;AACxB,IAAA,OAAO,IAAI;AACb;EAGAE,MAAMA,CAACP,IAAmB,EAAA;AACxB,IAAA,OAAOA,IAAI,CAACE,QAAQ,EAAE,GAAG,IAAI,CAACI,KAAK,CAACN,IAAI,CAAC,GAAG,IAAI,CAACD,IAAI,CAACC,IAAI,CAAC;AAC7D;AAGAQ,EAAAA,OAAOA,GAAA;AACL,IAAA,IAAI,IAAI,CAACX,MAAM,CAACM,eAAe,EAAE,EAAE;MACjC,KAAK,MAAMH,IAAI,IAAI,IAAI,CAACH,MAAM,CAACY,KAAK,EAAE,EAAE;AACtC,QAAA,IAAI,CAACV,IAAI,CAACC,IAAI,CAAC;AACjB;AACF;AACF;AAGAI,EAAAA,QAAQA,GAAA;IACN,KAAK,MAAMJ,IAAI,IAAI,IAAI,CAACH,MAAM,CAACY,KAAK,EAAE,EAAE;AACtC,MAAA,IAAI,CAACH,KAAK,CAACN,IAAI,CAAC;AAClB;AACF;EAGAC,YAAYA,CAACD,IAAmB,EAAA;IAC9B,OAAO,CAAC,IAAI,CAACH,MAAM,CAACa,QAAQ,EAAE,IAAI,CAACV,IAAI,CAACU,QAAQ,EAAE,IAAIV,IAAI,CAACW,UAAU,EAAE;AACzE;AACD;;;;"}
@@ -0,0 +1,287 @@
1
+ import { signal, computed } from './_signal-like-chunk.mjs';
2
+ import { ListFocus, ListNavigation } from './_list-navigation-chunk.mjs';
3
+
4
+ class ListSelection {
5
+ inputs;
6
+ rangeStartIndex = signal(0);
7
+ rangeEndIndex = signal(0);
8
+ selectedItems = computed(() => this.inputs.items().filter(item => this.inputs.values().includes(item.value())));
9
+ constructor(inputs) {
10
+ this.inputs = inputs;
11
+ }
12
+ select(item, opts = {
13
+ anchor: true
14
+ }) {
15
+ item = item ?? this.inputs.focusManager.inputs.activeItem();
16
+ if (!item || item.disabled() || !item.selectable() || this.inputs.values().includes(item.value())) {
17
+ return;
18
+ }
19
+ if (!this.inputs.multi()) {
20
+ this.deselectAll();
21
+ }
22
+ const index = this.inputs.items().findIndex(i => i === item);
23
+ if (opts.anchor) {
24
+ this.beginRangeSelection(index);
25
+ }
26
+ this.inputs.values.update(values => values.concat(item.value()));
27
+ }
28
+ deselect(item) {
29
+ item = item ?? this.inputs.focusManager.inputs.activeItem();
30
+ if (item && !item.disabled() && item.selectable()) {
31
+ this.inputs.values.update(values => values.filter(value => value !== item.value()));
32
+ }
33
+ }
34
+ toggle(item) {
35
+ item = item ?? this.inputs.focusManager.inputs.activeItem();
36
+ if (item) {
37
+ this.inputs.values().includes(item.value()) ? this.deselect(item) : this.select(item);
38
+ }
39
+ }
40
+ toggleOne() {
41
+ const item = this.inputs.focusManager.inputs.activeItem();
42
+ if (item) {
43
+ this.inputs.values().includes(item.value()) ? this.deselect() : this.selectOne();
44
+ }
45
+ }
46
+ selectAll() {
47
+ if (!this.inputs.multi()) {
48
+ return;
49
+ }
50
+ for (const item of this.inputs.items()) {
51
+ this.select(item, {
52
+ anchor: false
53
+ });
54
+ }
55
+ this.beginRangeSelection();
56
+ }
57
+ deselectAll() {
58
+ for (const value of this.inputs.values()) {
59
+ const item = this.inputs.items().find(i => i.value() === value);
60
+ item ? this.deselect(item) : this.inputs.values.update(values => values.filter(v => v !== value));
61
+ }
62
+ }
63
+ toggleAll() {
64
+ const selectableValues = this.inputs.items().filter(i => !i.disabled() && i.selectable()).map(i => i.value());
65
+ selectableValues.every(i => this.inputs.values().includes(i)) ? this.deselectAll() : this.selectAll();
66
+ }
67
+ selectOne() {
68
+ const item = this.inputs.focusManager.inputs.activeItem();
69
+ if (item && (item.disabled() || !item.selectable())) {
70
+ return;
71
+ }
72
+ this.deselectAll();
73
+ if (this.inputs.values().length > 0 && !this.inputs.multi()) {
74
+ return;
75
+ }
76
+ this.select();
77
+ }
78
+ selectRange(opts = {
79
+ anchor: true
80
+ }) {
81
+ const isStartOfRange = this.inputs.focusManager.prevActiveIndex() === this.rangeStartIndex();
82
+ if (isStartOfRange && opts.anchor) {
83
+ this.beginRangeSelection(this.inputs.focusManager.prevActiveIndex());
84
+ }
85
+ const itemsInRange = this._getItemsFromIndex(this.rangeStartIndex());
86
+ const itemsOutOfRange = this._getItemsFromIndex(this.rangeEndIndex()).filter(i => !itemsInRange.includes(i));
87
+ for (const item of itemsOutOfRange) {
88
+ this.deselect(item);
89
+ }
90
+ for (const item of itemsInRange) {
91
+ this.select(item, {
92
+ anchor: false
93
+ });
94
+ }
95
+ if (itemsInRange.length) {
96
+ const item = itemsInRange.pop();
97
+ const index = this.inputs.items().findIndex(i => i === item);
98
+ this.rangeEndIndex.set(index);
99
+ }
100
+ }
101
+ beginRangeSelection(index = this.inputs.focusManager.activeIndex()) {
102
+ this.rangeStartIndex.set(index);
103
+ this.rangeEndIndex.set(index);
104
+ }
105
+ _getItemsFromIndex(index) {
106
+ if (index === -1) {
107
+ return [];
108
+ }
109
+ const upper = Math.max(this.inputs.focusManager.activeIndex(), index);
110
+ const lower = Math.min(this.inputs.focusManager.activeIndex(), index);
111
+ const items = [];
112
+ for (let i = lower; i <= upper; i++) {
113
+ items.push(this.inputs.items()[i]);
114
+ }
115
+ if (this.inputs.focusManager.activeIndex() < index) {
116
+ return items.reverse();
117
+ }
118
+ return items;
119
+ }
120
+ }
121
+
122
+ class ListTypeahead {
123
+ inputs;
124
+ timeout;
125
+ focusManager;
126
+ isTyping = computed(() => this._query().length > 0);
127
+ _query = signal('');
128
+ _startIndex = signal(undefined);
129
+ constructor(inputs) {
130
+ this.inputs = inputs;
131
+ this.focusManager = inputs.focusManager;
132
+ }
133
+ search(char) {
134
+ if (char.length !== 1) {
135
+ return false;
136
+ }
137
+ if (!this.isTyping() && char === ' ') {
138
+ return false;
139
+ }
140
+ if (this._startIndex() === undefined) {
141
+ this._startIndex.set(this.focusManager.activeIndex());
142
+ }
143
+ clearTimeout(this.timeout);
144
+ this._query.update(q => q + char.toLowerCase());
145
+ const item = this._getItem();
146
+ if (item) {
147
+ this.focusManager.focus(item);
148
+ }
149
+ this.timeout = setTimeout(() => {
150
+ this._query.set('');
151
+ this._startIndex.set(undefined);
152
+ }, this.inputs.typeaheadDelay());
153
+ return true;
154
+ }
155
+ _getItem() {
156
+ let items = this.focusManager.inputs.items();
157
+ const after = items.slice(this._startIndex() + 1);
158
+ const before = items.slice(0, this._startIndex());
159
+ items = after.concat(before);
160
+ items.push(this.inputs.items()[this._startIndex()]);
161
+ const focusableItems = [];
162
+ for (const item of items) {
163
+ if (this.focusManager.isFocusable(item)) {
164
+ focusableItems.push(item);
165
+ }
166
+ }
167
+ return focusableItems.find(i => i.searchTerm().toLowerCase().startsWith(this._query()));
168
+ }
169
+ }
170
+
171
+ class List {
172
+ inputs;
173
+ navigationBehavior;
174
+ selectionBehavior;
175
+ typeaheadBehavior;
176
+ focusBehavior;
177
+ disabled = computed(() => this.focusBehavior.isListDisabled());
178
+ activeDescendant = computed(() => this.focusBehavior.getActiveDescendant());
179
+ tabIndex = computed(() => this.focusBehavior.getListTabIndex());
180
+ activeIndex = computed(() => this.focusBehavior.activeIndex());
181
+ _anchorIndex = signal(0);
182
+ _wrap = signal(true);
183
+ constructor(inputs) {
184
+ this.inputs = inputs;
185
+ this.focusBehavior = new ListFocus(inputs);
186
+ this.selectionBehavior = new ListSelection({
187
+ ...inputs,
188
+ focusManager: this.focusBehavior
189
+ });
190
+ this.typeaheadBehavior = new ListTypeahead({
191
+ ...inputs,
192
+ focusManager: this.focusBehavior
193
+ });
194
+ this.navigationBehavior = new ListNavigation({
195
+ ...inputs,
196
+ focusManager: this.focusBehavior,
197
+ wrap: computed(() => this._wrap() && this.inputs.wrap())
198
+ });
199
+ }
200
+ getItemTabindex(item) {
201
+ return this.focusBehavior.getItemTabIndex(item);
202
+ }
203
+ first(opts) {
204
+ this._navigate(opts, () => this.navigationBehavior.first(opts));
205
+ }
206
+ last(opts) {
207
+ this._navigate(opts, () => this.navigationBehavior.last(opts));
208
+ }
209
+ next(opts) {
210
+ this._navigate(opts, () => this.navigationBehavior.next(opts));
211
+ }
212
+ prev(opts) {
213
+ this._navigate(opts, () => this.navigationBehavior.prev(opts));
214
+ }
215
+ goto(item, opts) {
216
+ this._navigate(opts, () => this.navigationBehavior.goto(item, opts));
217
+ }
218
+ unfocus() {
219
+ this.inputs.activeItem.set(undefined);
220
+ }
221
+ anchor(index) {
222
+ this._anchorIndex.set(index);
223
+ }
224
+ search(char, opts) {
225
+ this._navigate(opts, () => this.typeaheadBehavior.search(char));
226
+ }
227
+ isTyping() {
228
+ return this.typeaheadBehavior.isTyping();
229
+ }
230
+ select(item) {
231
+ this.selectionBehavior.select(item);
232
+ }
233
+ selectOne() {
234
+ this.selectionBehavior.selectOne();
235
+ }
236
+ deselect(item) {
237
+ this.selectionBehavior.deselect(item);
238
+ }
239
+ deselectAll() {
240
+ this.selectionBehavior.deselectAll();
241
+ }
242
+ toggle(item) {
243
+ this.selectionBehavior.toggle(item);
244
+ }
245
+ toggleOne() {
246
+ this.selectionBehavior.toggleOne();
247
+ }
248
+ toggleAll() {
249
+ this.selectionBehavior.toggleAll();
250
+ }
251
+ isFocusable(item) {
252
+ return this.focusBehavior.isFocusable(item);
253
+ }
254
+ updateSelection(opts = {
255
+ anchor: true
256
+ }) {
257
+ if (opts.toggle) {
258
+ this.selectionBehavior.toggle();
259
+ }
260
+ if (opts.select) {
261
+ this.selectionBehavior.select();
262
+ }
263
+ if (opts.selectOne) {
264
+ this.selectionBehavior.selectOne();
265
+ }
266
+ if (opts.selectRange) {
267
+ this.selectionBehavior.selectRange();
268
+ }
269
+ if (!opts.anchor) {
270
+ this.anchor(this.selectionBehavior.rangeStartIndex());
271
+ }
272
+ }
273
+ _navigate(opts = {}, operation) {
274
+ if (opts?.selectRange) {
275
+ this._wrap.set(false);
276
+ this.selectionBehavior.rangeStartIndex.set(this._anchorIndex());
277
+ }
278
+ const moved = operation();
279
+ if (moved) {
280
+ this.updateSelection(opts);
281
+ }
282
+ this._wrap.set(true);
283
+ }
284
+ }
285
+
286
+ export { List };
287
+ //# sourceMappingURL=_list-chunk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_list-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-selection/list-selection.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-typeahead/list-typeahead.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list/list.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, SignalLike, WritableSignalLike} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\n\n/** Represents an item in a collection, such as a listbox option, that can be selected. */\nexport interface ListSelectionItem<V> extends ListFocusItem {\n /** The value of the item. */\n value: SignalLike<V>;\n\n /** Whether the item is selectable. */\n selectable: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for a collection that contains selectable items. */\nexport interface ListSelectionInputs<T extends ListSelectionItem<V>, V> extends ListFocusInputs<T> {\n /** Whether multiple items in the list can be selected at once. */\n multi: SignalLike<boolean>;\n\n /** The current value of the list selection. */\n values: WritableSignalLike<V[]>;\n\n /** The selection strategy used by the list. */\n selectionMode: SignalLike<'follow' | 'explicit'>;\n}\n\n/** Controls selection for a list of items. */\nexport class ListSelection<T extends ListSelectionItem<V>, V> {\n /** The start index to use for range selection. */\n rangeStartIndex = signal<number>(0);\n\n /** The end index to use for range selection. */\n rangeEndIndex = signal<number>(0);\n\n /** The currently selected items. */\n selectedItems = computed(() =>\n this.inputs.items().filter(item => this.inputs.values().includes(item.value())),\n );\n\n constructor(readonly inputs: ListSelectionInputs<T, V> & {focusManager: ListFocus<T>}) {}\n\n /** Selects the item at the current active index. */\n select(item?: ListSelectionItem<V>, opts = {anchor: true}) {\n item = item ?? (this.inputs.focusManager.inputs.activeItem() as ListSelectionItem<V>);\n\n if (\n !item ||\n item.disabled() ||\n !item.selectable() ||\n this.inputs.values().includes(item.value())\n ) {\n return;\n }\n\n if (!this.inputs.multi()) {\n this.deselectAll();\n }\n\n const index = this.inputs.items().findIndex(i => i === item);\n if (opts.anchor) {\n this.beginRangeSelection(index);\n }\n this.inputs.values.update(values => values.concat(item.value()));\n }\n\n /** Deselects the item at the current active index. */\n deselect(item?: ListSelectionItem<V>) {\n item = item ?? this.inputs.focusManager.inputs.activeItem();\n\n if (item && !item.disabled() && item.selectable()) {\n this.inputs.values.update(values => values.filter(value => value !== item.value()));\n }\n }\n\n /** Toggles the item at the current active index. */\n toggle(item?: ListSelectionItem<V>) {\n item = item ?? this.inputs.focusManager.inputs.activeItem();\n if (item) {\n this.inputs.values().includes(item.value()) ? this.deselect(item) : this.select(item);\n }\n }\n\n /** Toggles only the item at the current active index. */\n toggleOne() {\n const item = this.inputs.focusManager.inputs.activeItem();\n if (item) {\n this.inputs.values().includes(item.value()) ? this.deselect() : this.selectOne();\n }\n }\n\n /** Selects all items in the list. */\n selectAll() {\n if (!this.inputs.multi()) {\n return; // Should we log a warning?\n }\n\n for (const item of this.inputs.items()) {\n this.select(item, {anchor: false});\n }\n\n this.beginRangeSelection();\n }\n\n /** Deselects all items in the list. */\n deselectAll() {\n // If an item is not in the list, it forcefully gets deselected.\n // This actually creates a bug for the following edge case:\n //\n // Setup: An item is not in the list (maybe it's lazily loaded), and it is disabled & selected.\n // Expected: If deselectAll() is called, it should NOT get deselected (because it is disabled).\n // Actual: Calling deselectAll() will still deselect the item.\n //\n // Why? Because we can't check if the item is disabled if it's not in the list.\n //\n // Alternatively, we could NOT deselect items that are not in the list, but this has the\n // inverse (and more common) effect of keeping enabled items selected when they aren't in the\n // list.\n\n for (const value of this.inputs.values()) {\n const item = this.inputs.items().find(i => i.value() === value);\n\n item\n ? this.deselect(item)\n : this.inputs.values.update(values => values.filter(v => v !== value));\n }\n }\n\n /**\n * Selects all items in the list or deselects all\n * items in the list if all items are already selected.\n */\n toggleAll() {\n const selectableValues = this.inputs\n .items()\n .filter(i => !i.disabled() && i.selectable())\n .map(i => i.value());\n\n selectableValues.every(i => this.inputs.values().includes(i))\n ? this.deselectAll()\n : this.selectAll();\n }\n\n /** Sets the selection to only the current active item. */\n selectOne() {\n const item = this.inputs.focusManager.inputs.activeItem();\n if (item && (item.disabled() || !item.selectable())) {\n return;\n }\n\n this.deselectAll();\n\n if (this.inputs.values().length > 0 && !this.inputs.multi()) {\n return;\n }\n\n this.select();\n }\n\n /**\n * Selects all items in the list up to the anchor item.\n *\n * Deselects all items that were previously within the\n * selected range that are now outside of the selected range\n */\n selectRange(opts = {anchor: true}) {\n const isStartOfRange = this.inputs.focusManager.prevActiveIndex() === this.rangeStartIndex();\n\n if (isStartOfRange && opts.anchor) {\n this.beginRangeSelection(this.inputs.focusManager.prevActiveIndex());\n }\n\n const itemsInRange = this._getItemsFromIndex(this.rangeStartIndex());\n const itemsOutOfRange = this._getItemsFromIndex(this.rangeEndIndex()).filter(\n i => !itemsInRange.includes(i),\n );\n\n for (const item of itemsOutOfRange) {\n this.deselect(item);\n }\n\n for (const item of itemsInRange) {\n this.select(item, {anchor: false});\n }\n\n if (itemsInRange.length) {\n const item = itemsInRange.pop();\n const index = this.inputs.items().findIndex(i => i === item);\n this.rangeEndIndex.set(index);\n }\n }\n\n /** Marks the given index as the start of a range selection. */\n beginRangeSelection(index: number = this.inputs.focusManager.activeIndex()) {\n this.rangeStartIndex.set(index);\n this.rangeEndIndex.set(index);\n }\n\n /** Returns the items in the list starting from the given index. */\n private _getItemsFromIndex(index: number) {\n if (index === -1) {\n return [];\n }\n\n const upper = Math.max(this.inputs.focusManager.activeIndex(), index);\n const lower = Math.min(this.inputs.focusManager.activeIndex(), index);\n\n const items = [];\n for (let i = lower; i <= upper; i++) {\n items.push(this.inputs.items()[i]);\n }\n\n if (this.inputs.focusManager.activeIndex() < index) {\n return items.reverse();\n }\n\n return items;\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, signal, 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.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());\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 {computed, signal} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\nimport {\n ListNavigation,\n ListNavigationInputs,\n ListNavigationItem,\n} from '../list-navigation/list-navigation';\nimport {\n ListSelection,\n ListSelectionInputs,\n ListSelectionItem,\n} from '../list-selection/list-selection';\nimport {\n ListTypeahead,\n ListTypeaheadInputs,\n ListTypeaheadItem,\n} from '../list-typeahead/list-typeahead';\n\n/** The operations that the list can perform after navigation. */\ninterface NavOptions {\n toggle?: boolean;\n select?: boolean;\n selectOne?: boolean;\n selectRange?: boolean;\n anchor?: boolean;\n focusElement?: boolean;\n}\n\n/** Represents an item in the list. */\nexport type ListItem<V> = ListTypeaheadItem &\n ListNavigationItem &\n ListSelectionItem<V> &\n ListFocusItem;\n\n/** The necessary inputs for the list behavior. */\nexport type ListInputs<T extends ListItem<V>, V> = ListFocusInputs<T> &\n ListNavigationInputs<T> &\n ListSelectionInputs<T, V> &\n ListTypeaheadInputs<T>;\n\n/** Controls the state of a list. */\nexport class List<T extends ListItem<V>, V> {\n /** Controls navigation for the list. */\n navigationBehavior: ListNavigation<T>;\n\n /** Controls selection for the list. */\n selectionBehavior: ListSelection<T, V>;\n\n /** Controls typeahead for the list. */\n typeaheadBehavior: ListTypeahead<T>;\n\n /** Controls focus for the list. */\n focusBehavior: ListFocus<T>;\n\n /** Whether the list is disabled. */\n disabled = computed(() => this.focusBehavior.isListDisabled());\n\n /** The id of the current active item. */\n activeDescendant = computed(() => this.focusBehavior.getActiveDescendant());\n\n /** The tab index of the list. */\n tabIndex = computed(() => this.focusBehavior.getListTabIndex());\n\n /** The index of the currently active item in the list. */\n activeIndex = computed(() => this.focusBehavior.activeIndex());\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 private _anchorIndex = signal(0);\n\n /** Whether the list should wrap. Used to disable wrapping while range selecting. */\n private _wrap = signal(true);\n\n constructor(readonly inputs: ListInputs<T, V>) {\n this.focusBehavior = new ListFocus(inputs);\n this.selectionBehavior = new ListSelection({...inputs, focusManager: this.focusBehavior});\n this.typeaheadBehavior = new ListTypeahead({...inputs, focusManager: this.focusBehavior});\n this.navigationBehavior = new ListNavigation({\n ...inputs,\n focusManager: this.focusBehavior,\n wrap: computed(() => this._wrap() && this.inputs.wrap()),\n });\n }\n\n /** Returns the tab index for the given item. */\n getItemTabindex(item: T) {\n return this.focusBehavior.getItemTabIndex(item);\n }\n\n /** Navigates to the first option in the list. */\n first(opts?: NavOptions) {\n this._navigate(opts, () => this.navigationBehavior.first(opts));\n }\n\n /** Navigates to the last option in the list. */\n last(opts?: NavOptions) {\n this._navigate(opts, () => this.navigationBehavior.last(opts));\n }\n\n /** Navigates to the next option in the list. */\n next(opts?: NavOptions) {\n this._navigate(opts, () => this.navigationBehavior.next(opts));\n }\n\n /** Navigates to the previous option in the list. */\n prev(opts?: NavOptions) {\n this._navigate(opts, () => this.navigationBehavior.prev(opts));\n }\n\n /** Navigates to the given item in the list. */\n goto(item: T, opts?: NavOptions) {\n this._navigate(opts, () => this.navigationBehavior.goto(item, opts));\n }\n\n /** Removes focus from the list. */\n unfocus() {\n this.inputs.activeItem.set(undefined);\n }\n\n /** Marks the given index as the potential start of a range selection. */\n anchor(index: number) {\n this._anchorIndex.set(index);\n }\n\n /** Handles typeahead search navigation for the list. */\n search(char: string, opts?: NavOptions) {\n this._navigate(opts, () => this.typeaheadBehavior.search(char));\n }\n\n /** Checks if the list is currently typing for typeahead search. */\n isTyping() {\n return this.typeaheadBehavior.isTyping();\n }\n\n /** Selects the currently active item in the list. */\n select(item?: T) {\n this.selectionBehavior.select(item);\n }\n\n /** Sets the selection to only the current active item. */\n selectOne() {\n this.selectionBehavior.selectOne();\n }\n\n /** Deselects the currently active item in the list. */\n deselect(item?: T) {\n this.selectionBehavior.deselect(item);\n }\n\n /** Deselects all items in the list. */\n deselectAll() {\n this.selectionBehavior.deselectAll();\n }\n\n /** Toggles the currently active item in the list. */\n toggle(item?: T) {\n this.selectionBehavior.toggle(item);\n }\n\n /** Toggles the currently active item in the list, deselecting all other items. */\n toggleOne() {\n this.selectionBehavior.toggleOne();\n }\n\n /** Toggles the selection of all items in the list. */\n toggleAll() {\n this.selectionBehavior.toggleAll();\n }\n\n /** Checks if the given item is able to receive focus. */\n isFocusable(item: T) {\n return this.focusBehavior.isFocusable(item);\n }\n\n /** Handles updating selection for the list. */\n updateSelection(opts: NavOptions = {anchor: true}) {\n if (opts.toggle) {\n this.selectionBehavior.toggle();\n }\n if (opts.select) {\n this.selectionBehavior.select();\n }\n if (opts.selectOne) {\n this.selectionBehavior.selectOne();\n }\n if (opts.selectRange) {\n this.selectionBehavior.selectRange();\n }\n if (!opts.anchor) {\n this.anchor(this.selectionBehavior.rangeStartIndex());\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: NavOptions = {}, operation: () => boolean) {\n if (opts?.selectRange) {\n this._wrap.set(false);\n this.selectionBehavior.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"],"names":["ListSelection","inputs","rangeStartIndex","signal","rangeEndIndex","selectedItems","computed","items","filter","item","values","includes","value","constructor","select","opts","anchor","focusManager","activeItem","disabled","selectable","multi","deselectAll","index","findIndex","i","beginRangeSelection","update","concat","deselect","toggle","toggleOne","selectOne","selectAll","find","v","toggleAll","selectableValues","map","every","length","selectRange","isStartOfRange","prevActiveIndex","itemsInRange","_getItemsFromIndex","itemsOutOfRange","pop","set","activeIndex","upper","Math","max","lower","min","push","reverse","ListTypeahead","timeout","isTyping","_query","_startIndex","undefined","search","char","clearTimeout","q","toLowerCase","_getItem","focus","setTimeout","typeaheadDelay","after","slice","before","focusableItems","isFocusable","searchTerm","startsWith","List","navigationBehavior","selectionBehavior","typeaheadBehavior","focusBehavior","isListDisabled","activeDescendant","getActiveDescendant","tabIndex","getListTabIndex","_anchorIndex","_wrap","ListFocus","ListNavigation","wrap","getItemTabindex","getItemTabIndex","first","_navigate","last","next","prev","goto","unfocus","updateSelection","operation","moved"],"mappings":";;;MAiCaA,aAAa,CAAA;EAYHC,MAAA;AAVrBC,EAAAA,eAAe,GAAGC,MAAM,CAAS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