@angular/aria 22.0.0-next.3 → 22.0.0-next.4

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 (49) hide show
  1. package/fesm2022/_click-event-manager-chunk.mjs +45 -0
  2. package/fesm2022/_click-event-manager-chunk.mjs.map +1 -0
  3. package/fesm2022/_combobox-chunk.mjs +3 -3
  4. package/fesm2022/_combobox-chunk.mjs.map +1 -1
  5. package/fesm2022/_combobox-listbox-chunk.mjs +17 -7
  6. package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -1
  7. package/fesm2022/_combobox-tree-chunk.mjs +10 -0
  8. package/fesm2022/_combobox-tree-chunk.mjs.map +1 -1
  9. package/fesm2022/_deferred-content-chunk.mjs +6 -6
  10. package/fesm2022/_menu-chunk.mjs +33 -12
  11. package/fesm2022/_menu-chunk.mjs.map +1 -1
  12. package/fesm2022/_tabs-chunk.mjs +15 -5
  13. package/fesm2022/_tabs-chunk.mjs.map +1 -1
  14. package/fesm2022/_toolbar-widget-group-chunk.mjs +13 -1
  15. package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
  16. package/fesm2022/_widget-chunk.mjs +5 -3
  17. package/fesm2022/_widget-chunk.mjs.map +1 -1
  18. package/fesm2022/accordion.mjs +12 -12
  19. package/fesm2022/aria.mjs +1 -1
  20. package/fesm2022/aria.mjs.map +1 -1
  21. package/fesm2022/combobox.mjs +15 -15
  22. package/fesm2022/grid.mjs +12 -12
  23. package/fesm2022/listbox.mjs +13 -20
  24. package/fesm2022/listbox.mjs.map +1 -1
  25. package/fesm2022/menu.mjs +18 -22
  26. package/fesm2022/menu.mjs.map +1 -1
  27. package/fesm2022/private.mjs +1 -0
  28. package/fesm2022/private.mjs.map +1 -1
  29. package/fesm2022/tabs.mjs +22 -30
  30. package/fesm2022/tabs.mjs.map +1 -1
  31. package/fesm2022/toolbar.mjs +12 -20
  32. package/fesm2022/toolbar.mjs.map +1 -1
  33. package/fesm2022/tree.mjs +12 -20
  34. package/fesm2022/tree.mjs.map +1 -1
  35. package/package.json +2 -2
  36. package/resources/code-examples.db +0 -0
  37. package/types/_click-event-manager-chunk.d.ts +27 -0
  38. package/types/_combobox-chunk.d.ts +1 -1
  39. package/types/_grid-chunk.d.ts +2 -2
  40. package/types/_listbox-chunk.d.ts +11 -4
  41. package/types/_menu-chunk.d.ts +13 -9
  42. package/types/_tabs-chunk.d.ts +11 -5
  43. package/types/_toolbar-chunk.d.ts +6 -1
  44. package/types/_tree-chunk.d.ts +6 -0
  45. package/types/listbox.d.ts +2 -4
  46. package/types/private.d.ts +2 -1
  47. package/types/tabs.d.ts +1 -4
  48. package/types/toolbar.d.ts +0 -3
  49. package/types/tree.d.ts +0 -3
@@ -1 +1 @@
1
- {"version":3,"file":"_combobox-tree-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/tree/tree.ts","../../../../../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 {computed, signal, SignalLike} from '../signal-like/signal-like';\nimport {ExpansionItem, ListExpansion, ListExpansionInputs} from '../expansion/expansion';\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';\nimport {NavOptions} from '../list/list';\n\n/** Represents an item in the tree. */\nexport interface TreeItem<V, T extends TreeItem<V, T>>\n extends\n ListTypeaheadItem,\n ListNavigationItem,\n ListSelectionItem<V>,\n ListFocusItem,\n ExpansionItem {\n /** The children of this item. */\n children: SignalLike<T[] | undefined>;\n\n /** The parent of this item. */\n parent: SignalLike<T | undefined>;\n\n /** Whether this item is visible. */\n visible: SignalLike<boolean>;\n}\n\n/** The necessary inputs for the tree behavior. */\nexport type TreeInputs<T extends TreeItem<V, T>, V> = ListFocusInputs<T> &\n ListNavigationInputs<T> &\n ListSelectionInputs<T, V> &\n ListTypeaheadInputs<T> &\n ListExpansionInputs;\n\n/** Controls focus for a tree, ensuring that only visible items are focusable. */\nclass TreeListFocus<T extends TreeItem<V, T>, V> extends ListFocus<T> {\n override isFocusable(item: T): boolean {\n return super.isFocusable(item) && item.visible();\n }\n}\n\n/** Controls the state of a tree. */\nexport class Tree<T extends TreeItem<V, T>, V> {\n /** Controls navigation for the tree. */\n navigationBehavior: ListNavigation<T>;\n\n /** Controls selection for the tree. */\n selectionBehavior: ListSelection<T, V>;\n\n /** Controls typeahead for the tree. */\n typeaheadBehavior: ListTypeahead<T>;\n\n /** Controls focus for the tree. */\n focusBehavior: ListFocus<T>;\n\n /** Controls expansion for the tree. */\n expansionBehavior: ListExpansion;\n\n /** Whether the tree 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 tree. */\n tabIndex = computed(() => this.focusBehavior.getListTabIndex());\n\n /** The index of the currently active item in the tree (within the flattened list). */\n activeIndex = computed(() => this.focusBehavior.activeIndex());\n\n /** The uncommitted index for selecting a range of options. */\n private _anchorIndex = signal(0);\n\n /** Whether the list should wrap. */\n private _wrap = signal(true);\n\n constructor(readonly inputs: TreeInputs<T, V>) {\n this.focusBehavior = new TreeListFocus<T, V>(inputs);\n this.selectionBehavior = new ListSelection<T, V>({...inputs, focusManager: this.focusBehavior});\n this.typeaheadBehavior = new ListTypeahead<T>({...inputs, focusManager: this.focusBehavior});\n this.expansionBehavior = new ListExpansion(inputs);\n this.navigationBehavior = new ListNavigation<T>({\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 tree. */\n first(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.first(opts));\n }\n\n /** Navigates to the last option in the tree. */\n last(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.last(opts));\n }\n\n /** Navigates to the next option in the tree. */\n next(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.next(opts));\n }\n\n /** Navigates to the previous option in the tree. */\n prev(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.prev(opts));\n }\n\n /** Navigates to the first child of the current active item. */\n firstChild(opts?: NavOptions<T>) {\n this._navigate(opts, () => {\n const item = this.inputs.activeItem();\n const items = item?.children?.() ?? [];\n return this.navigationBehavior.first({items, ...opts});\n });\n }\n\n /** Navigates to the last child of the current active item. */\n lastChild(opts?: NavOptions<T>) {\n this._navigate(opts, () => {\n const item = this.inputs.activeItem();\n const items = item?.children?.() ?? [];\n return this.navigationBehavior.last({items, ...opts});\n });\n }\n\n /** Navigates to the next sibling of the current active item. */\n nextSibling(opts?: NavOptions<T>) {\n this._navigate(opts, () => {\n const item = this.inputs.activeItem();\n const items = item?.parent?.()?.children?.() ?? [];\n return this.navigationBehavior.next({items, ...opts});\n });\n }\n\n /** Navigates to the previous sibling of the current active item. */\n prevSibling(opts?: NavOptions<T>) {\n this._navigate(opts, () => {\n const item = this.inputs.activeItem();\n const items = item?.parent?.()?.children?.() ?? [];\n return this.navigationBehavior.prev({items, ...opts});\n });\n }\n\n /** Navigates to the parent of the current active item. */\n parent(opts?: NavOptions<T>) {\n this._navigate(opts, () =>\n this.navigationBehavior.goto(this.inputs.activeItem()?.parent?.(), opts),\n );\n }\n\n /** Navigates to the given item in the tree. */\n goto(item: T, opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.goto(item, opts));\n }\n\n /** Removes focus from the tree. */\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 tree. */\n search(char: string, opts?: NavOptions<T>) {\n this._navigate(opts, () => this.typeaheadBehavior.search(char));\n }\n\n /** Checks if the tree is currently typing for typeahead search. */\n isTyping() {\n return this.typeaheadBehavior.isTyping();\n }\n\n /** Selects the currently active item in the tree. */\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 tree. */\n deselect(item?: T) {\n this.selectionBehavior.deselect(item);\n }\n\n /** Deselects all items in the tree. */\n deselectAll() {\n this.selectionBehavior.deselectAll();\n }\n\n /** Toggles the currently active item in the tree. */\n toggle(item?: T) {\n this.selectionBehavior.toggle(item);\n }\n\n /** Toggles the currently active item in the tree, deselecting all other items. */\n toggleOne() {\n this.selectionBehavior.toggleOne();\n }\n\n /** Toggles the selection of all items in the tree. */\n toggleAll() {\n this.selectionBehavior.toggleAll();\n }\n\n /** Toggles the expansion of the given item. */\n toggleExpansion(item?: T) {\n item ??= this.inputs.activeItem();\n if (!item || !this.isFocusable(item)) return;\n\n if (this.isExpandable(item)) {\n this.expansionBehavior.toggle(item);\n }\n }\n\n /** Expands the given item. */\n expand(item: T) {\n if (this.isExpandable(item)) {\n this.expansionBehavior.open(item);\n }\n }\n\n /** Collapses the given item. */\n collapse(item: T) {\n this.expansionBehavior.close(item);\n }\n\n /** Expands all sibling items of the given item (or active item). */\n expandSiblings(item?: T) {\n item ??= this.inputs.activeItem();\n if (!item) return;\n\n const parent = item.parent?.();\n // TODO: This assumes that items without a parent are root items.\n const siblings = parent ? parent.children?.() : this.inputs.items().filter(i => !i.parent?.());\n siblings?.forEach(s => this.expand(s));\n }\n\n /** Expands all items in the tree. */\n expandAll() {\n this.expansionBehavior.openAll();\n }\n\n /** Collapses all items in the tree. */\n collapseAll() {\n this.expansionBehavior.closeAll();\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 /** Checks if the given item is expandable. */\n isExpandable(item: T) {\n return this.expansionBehavior.isExpandable(item);\n }\n\n /** Handles updating selection for the tree. */\n updateSelection(opts: NavOptions<T> = {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 private _navigate(opts: NavOptions<T> = {}, 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","/**\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 {Tree, TreeItem, TreeInputs as TreeBehaviorInputs} from '../behaviors/tree/tree';\nimport {KeyboardEventManager, PointerEventManager, Modifier} from '../behaviors/event-manager';\n\n/** Represents the required inputs for a tree item. */\nexport interface TreeItemInputs<V> extends Omit<\n TreeItem<V, TreeItemPattern<V>>,\n 'index' | 'parent' | 'visible' | 'expandable'\n> {\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 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 TreeItem<V, TreeItemPattern<V>> {\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> | undefined> = computed(() => {\n const parent = this.inputs.parent();\n return parent instanceof TreeItemPattern ? parent : undefined;\n });\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().inputs.items().indexOf(this));\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.inputs.parent().level() + 1);\n\n /** Whether this item is visible. */\n readonly visible: SignalLike<boolean> = computed(\n () => this.inputs.parent().expanded() && this.inputs.parent().visible(),\n );\n\n /** The number of items under the same parent at the same level. */\n readonly setsize = computed(() => this.inputs.parent().children().length);\n\n /** The position of this item among its siblings (1-based). */\n readonly posinset = computed(() => this.inputs.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().treeBehavior.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().value().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().value().includes(this.value()) ? this.tree().currentType() : undefined;\n });\n\n constructor(readonly inputs: TreeItemInputs<V>) {\n this.expanded = inputs.expanded;\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<\n TreeBehaviorInputs<TreeItemPattern<V>, V>,\n 'multiExpandable'\n> {\n /** A unique identifier for the tree. */\n id: SignalLike<string>;\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 /** The text direction of the tree. */\n textDirection: SignalLike<'ltr' | 'rtl'>;\n}\n\n/** Controls the state and interactions of a tree view. */\nexport class TreePattern<V> implements TreeInputs<V> {\n /** The tree behavior for the tree. */\n readonly treeBehavior: Tree<TreeItemPattern<V>, V>;\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.treeBehavior.tabIndex());\n\n /** The id of the current active item. */\n readonly activeDescendant = computed(() => this.treeBehavior.activeDescendant());\n\n /** The direct children of the root (top-level tree items). */\n readonly children = computed(() =>\n this.inputs.items().filter(item => item.level() === this.level() + 1),\n );\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.treeBehavior.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 tree = this.treeBehavior;\n\n manager\n .on(this.prevKey, () => tree.prev({selectOne: this.followFocus()}), {ignoreRepeat: false})\n .on(this.nextKey, () => tree.next({selectOne: this.followFocus()}), {ignoreRepeat: false})\n .on('Home', () => tree.first({selectOne: this.followFocus()}))\n .on('End', () => tree.last({selectOne: this.followFocus()}))\n .on(this.typeaheadRegexp, e => tree.search(e.key, {selectOne: this.followFocus()}))\n .on(Modifier.Shift, '*', () => tree.expandSiblings())\n .on(this.expandKey, () => this._expandOrFirstChild({selectOne: this.followFocus()}))\n .on(this.collapseKey, () => this._collapseOrParent({selectOne: this.followFocus()}));\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', () => tree.anchor(this.treeBehavior.activeIndex()))\n .on(Modifier.Shift, this.prevKey, () => tree.prev({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on(Modifier.Shift, this.nextKey, () => tree.next({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () =>\n tree.first({selectRange: true, anchor: false}),\n )\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () =>\n tree.last({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, 'Enter', () => tree.updateSelection({selectRange: true, anchor: false}))\n .on(Modifier.Shift, this.dynamicSpaceKey, () =>\n tree.updateSelection({selectRange: true, anchor: false}),\n );\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager\n .on(this.dynamicSpaceKey, () => tree.toggle())\n .on('Enter', () => tree.toggle(), {preventDefault: !this.nav()})\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => tree.toggleAll());\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => tree.selectOne());\n manager.on('Enter', () => tree.selectOne(), {preventDefault: !this.nav()});\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => tree.prev(), {ignoreRepeat: false})\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => tree.next(), {ignoreRepeat: false})\n .on([Modifier.Ctrl, Modifier.Meta], this.expandKey, () => this._expandOrFirstChild())\n .on([Modifier.Ctrl, Modifier.Meta], this.collapseKey, () => this._collapseOrParent())\n .on([Modifier.Ctrl, Modifier.Meta], ' ', () => tree.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => tree.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Home', () => tree.first())\n .on([Modifier.Ctrl, Modifier.Meta], 'End', () => tree.last())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => {\n tree.toggleAll();\n tree.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 items: SignalLike<TreeItemPattern<V>[]> = () => this.inputs.items();\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 value: WritableSignalLike<V[]>;\n\n constructor(readonly inputs: TreeInputs<V>) {\n this.activeItem = inputs.activeItem;\n this.value = inputs.value;\n\n this.treeBehavior = new Tree<TreeItemPattern<V>, V>({\n ...inputs,\n multi: this.multi,\n multiExpandable: () => true,\n });\n }\n\n /** Returns a set of violations */\n validate(): string[] {\n const violations: string[] = [];\n\n if (!this.inputs.multi() && this.inputs.value().length > 1) {\n violations.push(\n `A single-select tree should not have multiple selected options. Selected options: ${this.inputs.value().join(', ')}`,\n );\n }\n\n return violations;\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.inputs.items()) {\n if (!item.visible()) continue;\n if (!this.treeBehavior.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.treeBehavior.goto(item, opts);\n this.treeBehavior.toggleExpansion(item);\n }\n\n /** Expands the active item if possible, otherwise navigates to the first child. */\n _expandOrFirstChild(opts?: SelectOptions) {\n const item = this.treeBehavior.inputs.activeItem();\n if (item && this.treeBehavior.isExpandable(item) && !item.expanded()) {\n this.treeBehavior.expand(item);\n } else {\n this.treeBehavior.firstChild(opts);\n }\n }\n\n /** Collapses the active item if possible, otherwise navigates to the parent. */\n _collapseOrParent(opts?: SelectOptions) {\n const item = this.treeBehavior.inputs.activeItem();\n if (item && this.treeBehavior.isExpandable(item) && item.expanded()) {\n this.treeBehavior.collapse(item);\n } else {\n this.treeBehavior.parent(opts);\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.items().find(i => i.element() === element);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {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 /** Toggles to expand or collapse a tree item. */\n toggleExpansion = (item?: TreeItemPattern<V>) => this.treeBehavior.toggleExpansion(item);\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.treeBehavior.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 override items = computed(() => this.inputs.items());\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.treeBehavior.goto(item);\n\n /** Navigates to the next focusable item in the tree. */\n next = () => this.treeBehavior.next();\n\n /** Navigates to the previous focusable item in the tree. */\n prev = () => this.treeBehavior.prev();\n\n /** Navigates to the last focusable item in the tree. */\n last = () => this.treeBehavior.last();\n\n /** Navigates to the first focusable item in the tree. */\n first = () => this.treeBehavior.first();\n\n /** Unfocuses the currently focused item in the tree. */\n unfocus = () => this.treeBehavior.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.treeBehavior.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.treeBehavior.toggle(item);\n\n /** Clears the selection in the tree. */\n clearSelection = () => this.treeBehavior.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.items().filter(item => item.selected());\n\n /** Sets the value of the combobox tree. */\n setValue = (value: V | undefined) => this.inputs.value.set(value ? [value] : []);\n\n /** Expands the currently focused item if it is expandable, or navigates to the first child. */\n expandItem = () => this._expandOrFirstChild();\n\n /** Collapses the currently focused item if it is expandable, or navigates to the parent. */\n collapseItem = () => this._collapseOrParent();\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.treeBehavior.expandAll();\n\n /** Collapses all of the tree items. */\n collapseAll = () => this.treeBehavior.collapseAll();\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":["TreeListFocus","ListFocus","isFocusable","item","visible","Tree","inputs","navigationBehavior","selectionBehavior","typeaheadBehavior","focusBehavior","expansionBehavior","disabled","computed","isListDisabled","activeDescendant","getActiveDescendant","tabIndex","getListTabIndex","activeIndex","_anchorIndex","signal","_wrap","constructor","ListSelection","focusManager","ListTypeahead","ListExpansion","ListNavigation","wrap","getItemTabindex","getItemTabIndex","first","opts","_navigate","last","next","prev","firstChild","activeItem","items","children","lastChild","nextSibling","parent","prevSibling","goto","unfocus","set","undefined","anchor","index","search","char","isTyping","select","selectOne","deselect","deselectAll","toggle","toggleOne","toggleAll","toggleExpansion","isExpandable","expand","open","collapse","close","expandSiblings","siblings","filter","i","forEach","s","expandAll","openAll","collapseAll","closeAll","updateSelection","selectRange","rangeStartIndex","operation","moved","TreeItemPattern","id","value","element","searchTerm","tree","indexOf","expandable","hasChildren","selectable","expanded","level","setsize","length","posinset","active","treeBehavior","selected","nav","includes","current","currentType","TreePattern","followFocus","selectionMode","isRtl","textDirection","prevKey","orientation","nextKey","collapseKey","expandKey","dynamicSpaceKey","typeaheadRegexp","keydown","manager","KeyboardEventManager","on","ignoreRepeat","e","key","Modifier","Shift","_expandOrFirstChild","_collapseOrParent","multi","Any","Ctrl","Meta","preventDefault","pointerdown","PointerEventManager","focusMode","softDisabled","typeaheadDelay","multiExpandable","validate","violations","push","join","setDefaultState","firstItem","onKeydown","event","handle","onPointerdown","_getItem","target","HTMLElement","closest","find","ComboboxTreePattern","isItemCollapsible","role","activeId","getActiveItem","combobox","inputEl","_","focus","clearSelection","getItem","getSelectedItems","setValue","expandItem","collapseItem","isItemExpandable","isItemSelectable"],"mappings":";;;;;;AAsDA,MAAMA,aAA2C,SAAQC,SAAY,CAAA;EAC1DC,WAAWA,CAACC,IAAO,EAAA;IAC1B,OAAO,KAAK,CAACD,WAAW,CAACC,IAAI,CAAC,IAAIA,IAAI,CAACC,OAAO,EAAE;AAClD,EAAA;AACD;MAGYC,IAAI,CAAA;EAkCMC,MAAA;EAhCrBC,kBAAkB;EAGlBC,iBAAiB;EAGjBC,iBAAiB;EAGjBC,aAAa;EAGbC,iBAAiB;EAGjBC,QAAQ,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACH,aAAa,CAACI,cAAc,EAAE,CAAC;EAG9DC,gBAAgB,GAAGF,QAAQ,CAAC,MAAM,IAAI,CAACH,aAAa,CAACM,mBAAmB,EAAE,CAAC;EAG3EC,QAAQ,GAAGJ,QAAQ,CAAC,MAAM,IAAI,CAACH,aAAa,CAACQ,eAAe,EAAE,CAAC;EAG/DC,WAAW,GAAGN,QAAQ,CAAC,MAAM,IAAI,CAACH,aAAa,CAACS,WAAW,EAAE,CAAC;AAGtDC,EAAAA,YAAY,GAAGC,MAAM,CAAC,CAAC,CAAC;AAGxBC,EAAAA,KAAK,GAAGD,MAAM,CAAC,IAAI,CAAC;EAE5BE,WAAAA,CAAqBjB,MAAwB,EAAA;IAAxB,IAAA,CAAAA,MAAM,GAANA,MAAM;AACzB,IAAA,IAAI,CAACI,aAAa,GAAG,IAAIV,aAAa,CAAOM,MAAM,CAAC;AACpD,IAAA,IA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AQ,EAAE,CAAC;AAG5EkE,EAAAA,QAAQ,GAAIjF,KAAoB,IAAK,IAAI,CAAC/E,MAAM,CAAC+E,KAAK,CAACrC,GAAG,CAACqC,KAAK,GAAG,CAACA,KAAK,CAAC,GAAG,EAAE,CAAC;AAGhFkF,EAAAA,UAAU,GAAGA,MAAM,IAAI,CAACzC,mBAAmB,EAAE;AAG7C0C,EAAAA,YAAY,GAAGA,MAAM,IAAI,CAACzC,iBAAiB,EAAE;EAG7C0C,gBAAgBA,CAACtK,IAAA,GAAuC,IAAI,CAACG,MAAM,CAACiC,UAAU,EAAE,EAAA;IAC9E,OAAOpC,IAAI,GAAGA,IAAI,CAACuF,UAAU,EAAE,GAAG,KAAK;AACzC,EAAA;EAGAhB,SAAS,GAAGA,MAAM,IAAI,CAACyB,YAAY,CAACzB,SAAS,EAAE;EAG/CE,WAAW,GAAGA,MAAM,IAAI,CAACuB,YAAY,CAACvB,WAAW,EAAE;EAGnD8F,gBAAgB,GAAGA,CAACvK,IAAA,GAAuC,IAAI,CAACG,MAAM,CAACiC,UAAU,EAAE,KAAI;IACrF,OAAOpC,IAAI,GAAGA,IAAI,CAACyF,UAAU,EAAE,GAAG,KAAK;EACzC,CAAC;AACF;;;;"}
1
+ {"version":3,"file":"_combobox-tree-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/tree/tree.ts","../../../../../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 {computed, signal, SignalLike} from '../signal-like/signal-like';\nimport {ExpansionItem, ListExpansion, ListExpansionInputs} from '../expansion/expansion';\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';\nimport {NavOptions} from '../list/list';\n\n/** Represents an item in the tree. */\nexport interface TreeItem<V, T extends TreeItem<V, T>>\n extends\n ListTypeaheadItem,\n ListNavigationItem,\n ListSelectionItem<V>,\n ListFocusItem,\n ExpansionItem {\n /** The children of this item. */\n children: SignalLike<T[] | undefined>;\n\n /** The parent of this item. */\n parent: SignalLike<T | undefined>;\n\n /** Whether this item is visible. */\n visible: SignalLike<boolean>;\n}\n\n/** The necessary inputs for the tree behavior. */\nexport type TreeInputs<T extends TreeItem<V, T>, V> = ListFocusInputs<T> &\n ListNavigationInputs<T> &\n ListSelectionInputs<T, V> &\n ListTypeaheadInputs<T> &\n ListExpansionInputs;\n\n/** Controls focus for a tree, ensuring that only visible items are focusable. */\nclass TreeListFocus<T extends TreeItem<V, T>, V> extends ListFocus<T> {\n override isFocusable(item: T): boolean {\n return super.isFocusable(item) && item.visible();\n }\n}\n\n/** Controls the state of a tree. */\nexport class Tree<T extends TreeItem<V, T>, V> {\n /** Controls navigation for the tree. */\n navigationBehavior: ListNavigation<T>;\n\n /** Controls selection for the tree. */\n selectionBehavior: ListSelection<T, V>;\n\n /** Controls typeahead for the tree. */\n typeaheadBehavior: ListTypeahead<T>;\n\n /** Controls focus for the tree. */\n focusBehavior: ListFocus<T>;\n\n /** Controls expansion for the tree. */\n expansionBehavior: ListExpansion;\n\n /** Whether the tree 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 tree. */\n tabIndex = computed(() => this.focusBehavior.getListTabIndex());\n\n /** The index of the currently active item in the tree (within the flattened list). */\n activeIndex = computed(() => this.focusBehavior.activeIndex());\n\n /** The uncommitted index for selecting a range of options. */\n private _anchorIndex = signal(0);\n\n /** Whether the list should wrap. */\n private _wrap = signal(true);\n\n constructor(readonly inputs: TreeInputs<T, V>) {\n this.focusBehavior = new TreeListFocus<T, V>(inputs);\n this.selectionBehavior = new ListSelection<T, V>({...inputs, focusManager: this.focusBehavior});\n this.typeaheadBehavior = new ListTypeahead<T>({...inputs, focusManager: this.focusBehavior});\n this.expansionBehavior = new ListExpansion(inputs);\n this.navigationBehavior = new ListNavigation<T>({\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 tree. */\n first(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.first(opts));\n }\n\n /** Navigates to the last option in the tree. */\n last(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.last(opts));\n }\n\n /** Navigates to the next option in the tree. */\n next(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.next(opts));\n }\n\n /** Navigates to the previous option in the tree. */\n prev(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.prev(opts));\n }\n\n /** Navigates to the first child of the current active item. */\n firstChild(opts?: NavOptions<T>) {\n this._navigate(opts, () => {\n const item = this.inputs.activeItem();\n const items = item?.children?.() ?? [];\n return this.navigationBehavior.first({items, ...opts});\n });\n }\n\n /** Navigates to the last child of the current active item. */\n lastChild(opts?: NavOptions<T>) {\n this._navigate(opts, () => {\n const item = this.inputs.activeItem();\n const items = item?.children?.() ?? [];\n return this.navigationBehavior.last({items, ...opts});\n });\n }\n\n /** Navigates to the next sibling of the current active item. */\n nextSibling(opts?: NavOptions<T>) {\n this._navigate(opts, () => {\n const item = this.inputs.activeItem();\n const items = item?.parent?.()?.children?.() ?? [];\n return this.navigationBehavior.next({items, ...opts});\n });\n }\n\n /** Navigates to the previous sibling of the current active item. */\n prevSibling(opts?: NavOptions<T>) {\n this._navigate(opts, () => {\n const item = this.inputs.activeItem();\n const items = item?.parent?.()?.children?.() ?? [];\n return this.navigationBehavior.prev({items, ...opts});\n });\n }\n\n /** Navigates to the parent of the current active item. */\n parent(opts?: NavOptions<T>) {\n this._navigate(opts, () =>\n this.navigationBehavior.goto(this.inputs.activeItem()?.parent?.(), opts),\n );\n }\n\n /** Navigates to the given item in the tree. */\n goto(item: T, opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.goto(item, opts));\n }\n\n /** Removes focus from the tree. */\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 tree. */\n search(char: string, opts?: NavOptions<T>) {\n this._navigate(opts, () => this.typeaheadBehavior.search(char));\n }\n\n /** Checks if the tree is currently typing for typeahead search. */\n isTyping() {\n return this.typeaheadBehavior.isTyping();\n }\n\n /** Selects the currently active item in the tree. */\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 tree. */\n deselect(item?: T) {\n this.selectionBehavior.deselect(item);\n }\n\n /** Deselects all items in the tree. */\n deselectAll() {\n this.selectionBehavior.deselectAll();\n }\n\n /** Toggles the currently active item in the tree. */\n toggle(item?: T) {\n this.selectionBehavior.toggle(item);\n }\n\n /** Toggles the currently active item in the tree, deselecting all other items. */\n toggleOne() {\n this.selectionBehavior.toggleOne();\n }\n\n /** Toggles the selection of all items in the tree. */\n toggleAll() {\n this.selectionBehavior.toggleAll();\n }\n\n /** Toggles the expansion of the given item. */\n toggleExpansion(item?: T) {\n item ??= this.inputs.activeItem();\n if (!item || !this.isFocusable(item)) return;\n\n if (this.isExpandable(item)) {\n this.expansionBehavior.toggle(item);\n }\n }\n\n /** Expands the given item. */\n expand(item: T) {\n if (this.isExpandable(item)) {\n this.expansionBehavior.open(item);\n }\n }\n\n /** Collapses the given item. */\n collapse(item: T) {\n this.expansionBehavior.close(item);\n }\n\n /** Expands all sibling items of the given item (or active item). */\n expandSiblings(item?: T) {\n item ??= this.inputs.activeItem();\n if (!item) return;\n\n const parent = item.parent?.();\n // TODO: This assumes that items without a parent are root items.\n const siblings = parent ? parent.children?.() : this.inputs.items().filter(i => !i.parent?.());\n siblings?.forEach(s => this.expand(s));\n }\n\n /** Expands all items in the tree. */\n expandAll() {\n this.expansionBehavior.openAll();\n }\n\n /** Collapses all items in the tree. */\n collapseAll() {\n this.expansionBehavior.closeAll();\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 /** Checks if the given item is expandable. */\n isExpandable(item: T) {\n return this.expansionBehavior.isExpandable(item);\n }\n\n /** Handles updating selection for the tree. */\n updateSelection(opts: NavOptions<T> = {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 private _navigate(opts: NavOptions<T> = {}, 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","/**\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 SignalLike,\n computed,\n WritableSignalLike,\n signal,\n} from '../behaviors/signal-like/signal-like';\nimport {Tree, TreeItem, TreeInputs as TreeBehaviorInputs} from '../behaviors/tree/tree';\nimport {KeyboardEventManager, PointerEventManager, Modifier} from '../behaviors/event-manager';\n\n/** Represents the required inputs for a tree item. */\nexport interface TreeItemInputs<V> extends Omit<\n TreeItem<V, TreeItemPattern<V>>,\n 'index' | 'parent' | 'visible' | 'expandable'\n> {\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 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 TreeItem<V, TreeItemPattern<V>> {\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> | undefined> = computed(() => {\n const parent = this.inputs.parent();\n return parent instanceof TreeItemPattern ? parent : undefined;\n });\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().inputs.items().indexOf(this));\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.inputs.parent().level() + 1);\n\n /** Whether this item is visible. */\n readonly visible: SignalLike<boolean> = computed(\n () => this.inputs.parent().expanded() && this.inputs.parent().visible(),\n );\n\n /** The number of items under the same parent at the same level. */\n readonly setsize = computed(() => this.inputs.parent().children().length);\n\n /** The position of this item among its siblings (1-based). */\n readonly posinset = computed(() => this.inputs.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().treeBehavior.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().value().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().value().includes(this.value()) ? this.tree().currentType() : undefined;\n });\n\n constructor(readonly inputs: TreeItemInputs<V>) {\n this.expanded = inputs.expanded;\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<\n TreeBehaviorInputs<TreeItemPattern<V>, V>,\n 'multiExpandable'\n> {\n /** A unique identifier for the tree. */\n id: SignalLike<string>;\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 /** The text direction of the tree. */\n textDirection: SignalLike<'ltr' | 'rtl'>;\n}\n\n/** Controls the state and interactions of a tree view. */\nexport class TreePattern<V> implements TreeInputs<V> {\n /** The tree behavior for the tree. */\n readonly treeBehavior: Tree<TreeItemPattern<V>, V>;\n\n /** Whether the tree has been interacted with. */\n readonly hasBeenInteracted = signal(false);\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.treeBehavior.tabIndex());\n\n /** The id of the current active item. */\n readonly activeDescendant = computed(() => this.treeBehavior.activeDescendant());\n\n /** The direct children of the root (top-level tree items). */\n readonly children = computed(() =>\n this.inputs.items().filter(item => item.level() === this.level() + 1),\n );\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.treeBehavior.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 tree = this.treeBehavior;\n\n manager\n .on(this.prevKey, () => tree.prev({selectOne: this.followFocus()}), {ignoreRepeat: false})\n .on(this.nextKey, () => tree.next({selectOne: this.followFocus()}), {ignoreRepeat: false})\n .on('Home', () => tree.first({selectOne: this.followFocus()}))\n .on('End', () => tree.last({selectOne: this.followFocus()}))\n .on(this.typeaheadRegexp, e => tree.search(e.key, {selectOne: this.followFocus()}))\n .on(Modifier.Shift, '*', () => tree.expandSiblings())\n .on(this.expandKey, () => this._expandOrFirstChild({selectOne: this.followFocus()}))\n .on(this.collapseKey, () => this._collapseOrParent({selectOne: this.followFocus()}));\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', () => tree.anchor(this.treeBehavior.activeIndex()))\n .on(Modifier.Shift, this.prevKey, () => tree.prev({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on(Modifier.Shift, this.nextKey, () => tree.next({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () =>\n tree.first({selectRange: true, anchor: false}),\n )\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () =>\n tree.last({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, 'Enter', () => tree.updateSelection({selectRange: true, anchor: false}))\n .on(Modifier.Shift, this.dynamicSpaceKey, () =>\n tree.updateSelection({selectRange: true, anchor: false}),\n );\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager\n .on(this.dynamicSpaceKey, () => tree.toggle())\n .on('Enter', () => tree.toggle(), {preventDefault: !this.nav()})\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => tree.toggleAll());\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => tree.selectOne());\n manager.on('Enter', () => tree.selectOne(), {preventDefault: !this.nav()});\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => tree.prev(), {ignoreRepeat: false})\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => tree.next(), {ignoreRepeat: false})\n .on([Modifier.Ctrl, Modifier.Meta], this.expandKey, () => this._expandOrFirstChild())\n .on([Modifier.Ctrl, Modifier.Meta], this.collapseKey, () => this._collapseOrParent())\n .on([Modifier.Ctrl, Modifier.Meta], ' ', () => tree.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => tree.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Home', () => tree.first())\n .on([Modifier.Ctrl, Modifier.Meta], 'End', () => tree.last())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => {\n tree.toggleAll();\n tree.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 items: SignalLike<TreeItemPattern<V>[]> = () => this.inputs.items();\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 value: WritableSignalLike<V[]>;\n\n constructor(readonly inputs: TreeInputs<V>) {\n this.activeItem = inputs.activeItem;\n this.value = inputs.value;\n\n this.treeBehavior = new Tree<TreeItemPattern<V>, V>({\n ...inputs,\n multi: this.multi,\n multiExpandable: () => true,\n });\n }\n\n /** Returns a set of violations */\n validate(): string[] {\n const violations: string[] = [];\n\n if (!this.inputs.multi() && this.inputs.value().length > 1) {\n violations.push(\n `A single-select tree should not have multiple selected options. Selected options: ${this.inputs.value().join(', ')}`,\n );\n }\n\n return violations;\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.inputs.items()) {\n if (!item.visible()) continue;\n if (!this.treeBehavior.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 /** Sets the default active state of the tree before receiving interaction for the first time. */\n setDefaultStateEffect(): void {\n if (this.hasBeenInteracted()) return;\n\n this.setDefaultState();\n }\n\n /** Handles keydown events on the tree. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.hasBeenInteracted.set(true);\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.hasBeenInteracted.set(true);\n this.pointerdown().handle(event);\n }\n }\n\n /** Handles focusin events on the tree. */\n onFocusIn() {\n this.hasBeenInteracted.set(true);\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.treeBehavior.goto(item, opts);\n this.treeBehavior.toggleExpansion(item);\n }\n\n /** Expands the active item if possible, otherwise navigates to the first child. */\n _expandOrFirstChild(opts?: SelectOptions) {\n const item = this.treeBehavior.inputs.activeItem();\n if (item && this.treeBehavior.isExpandable(item) && !item.expanded()) {\n this.treeBehavior.expand(item);\n } else {\n this.treeBehavior.firstChild(opts);\n }\n }\n\n /** Collapses the active item if possible, otherwise navigates to the parent. */\n _collapseOrParent(opts?: SelectOptions) {\n const item = this.treeBehavior.inputs.activeItem();\n if (item && this.treeBehavior.isExpandable(item) && item.expanded()) {\n this.treeBehavior.collapse(item);\n } else {\n this.treeBehavior.parent(opts);\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.items().find(i => i.element() === element);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {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 /** Toggles to expand or collapse a tree item. */\n toggleExpansion = (item?: TreeItemPattern<V>) => this.treeBehavior.toggleExpansion(item);\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.treeBehavior.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 override items = computed(() => this.inputs.items());\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.treeBehavior.goto(item);\n\n /** Navigates to the next focusable item in the tree. */\n next = () => this.treeBehavior.next();\n\n /** Navigates to the previous focusable item in the tree. */\n prev = () => this.treeBehavior.prev();\n\n /** Navigates to the last focusable item in the tree. */\n last = () => this.treeBehavior.last();\n\n /** Navigates to the first focusable item in the tree. */\n first = () => this.treeBehavior.first();\n\n /** Unfocuses the currently focused item in the tree. */\n unfocus = () => this.treeBehavior.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.treeBehavior.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.treeBehavior.toggle(item);\n\n /** Clears the selection in the tree. */\n clearSelection = () => this.treeBehavior.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.items().filter(item => item.selected());\n\n /** Sets the value of the combobox tree. */\n setValue = (value: V | undefined) => this.inputs.value.set(value ? [value] : []);\n\n /** Expands the currently focused item if it is expandable, or navigates to the first child. */\n expandItem = () => this._expandOrFirstChild();\n\n /** Collapses the currently focused item if it is expandable, or navigates to the parent. */\n collapseItem = () => this._collapseOrParent();\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.treeBehavior.expandAll();\n\n /** Collapses all of the tree items. */\n collapseAll = () => this.treeBehavior.collapseAll();\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":["TreeListFocus","ListFocus","isFocusable","item","visible","Tree","inputs","navigationBehavior","selectionBehavior","typeaheadBehavior","focusBehavior","expansionBehavior","disabled","computed","isListDisabled","activeDescendant","getActiveDescendant","tabIndex","getListTabIndex","activeIndex","_anchorIndex","signal","_wrap","constructor","ListSelection","focusManager","ListTypeahead","ListExpansion","ListNavigation","wrap","getItemTabindex","getItemTabIndex","first","opts","_navigate","last","next","prev","firstChild","activeItem","items","children","lastChild","nextSibling","parent","prevSibling","goto","unfocus","set","undefined","anchor","index","search","char","isTyping","select","selectOne","deselect","deselectAll","toggle","toggleOne","toggleAll","toggleExpansion","isExpandable","expand","open","collapse","close","expandSiblings","siblings","filter","i","forEach","s","expandAll","openAll","collapseAll","closeAll","updateSelection","selectRange","rangeStartIndex","operation","moved","TreeItemPattern","id","value","element","searchTerm","tree","indexOf","expandable","hasChildren","selectable","expanded","level","setsize","length","posinset","active","treeBehavior","selected","nav","includes","current","currentType","TreePattern","hasBeenInteracted","followFocus","selectionMode","isRtl","textDirection","prevKey","orientation","nextKey","collapseKey","expandKey","dynamicSpaceKey","typeaheadRegexp","keydown","manager","KeyboardEventManager","on","ignoreRepeat","e","key","Modifier","Shift","_expandOrFirstChild","_collapseOrParent","multi","Any","Ctrl","Meta","preventDefault","pointerdown","PointerEventManager","focusMode","softDisabled","typeaheadDelay","multiExpandable","validate","violations","push","join","setDefaultState","firstItem","setDefaultStateEffect","onKeydown","event","handle","onPointerdown","onFocusIn","_getItem","target","HTMLElement","closest","find","ComboboxTreePattern","isItemCollapsible","role","activeId","getActiveItem","combobox","inputEl","_","focus","clearSelection","getItem","getSelectedItems","setValue","expandItem","collapseItem","isItemExpandable","isItemSelectable"],"mappings":";;;;;;AAsDA,MAAMA,aAA2C,SAAQC,SAAY,CAAA;EAC1DC,WAAWA,CAACC,IAAO,EAAA;IAC1B,OAAO,KAAK,CAACD,WAAW,CAACC,IAAI,CAAC,IAAIA,IAAI,CAACC,OAAO,EAAE;AAClD,EAAA;AACD;MAGYC,IAAI,CAAA;EAkCMC,MAAA;EAhCrBC,kBAAkB;EAGlBC,iBAAiB;EAGjBC,iBAAiB;EAGjBC,aAAa;EAGbC,iBAAiB;EAGjBC,QAAQ,G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mBAAmB,EAAE;AAG7C4C,EAAAA,YAAY,GAAGA,MAAM,IAAI,CAAC3C,iBAAiB,EAAE;EAG7C4C,gBAAgBA,CAACzK,IAAA,GAAuC,IAAI,CAACG,MAAM,CAACiC,UAAU,EAAE,EAAA;IAC9E,OAAOpC,IAAI,GAAGA,IAAI,CAACuF,UAAU,EAAE,GAAG,KAAK;AACzC,EAAA;EAGAhB,SAAS,GAAGA,MAAM,IAAI,CAACyB,YAAY,CAACzB,SAAS,EAAE;EAG/CE,WAAW,GAAGA,MAAM,IAAI,CAACuB,YAAY,CAACvB,WAAW,EAAE;EAGnDiG,gBAAgB,GAAGA,CAAC1K,IAAA,GAAuC,IAAI,CAACG,MAAM,CAACiC,UAAU,EAAE,KAAI;IACrF,OAAOpC,IAAI,GAAGA,IAAI,CAACyF,UAAU,EAAE,GAAG,KAAK;EACzC,CAAC;AACF;;;;"}
@@ -10,7 +10,7 @@ class DeferredContentAware {
10
10
  }] : []));
11
11
  static ɵfac = i0.ɵɵngDeclareFactory({
12
12
  minVersion: "12.0.0",
13
- version: "22.0.0-next.5",
13
+ version: "22.0.0-next.6",
14
14
  ngImport: i0,
15
15
  type: DeferredContentAware,
16
16
  deps: [],
@@ -18,7 +18,7 @@ class DeferredContentAware {
18
18
  });
19
19
  static ɵdir = i0.ɵɵngDeclareDirective({
20
20
  minVersion: "17.1.0",
21
- version: "22.0.0-next.5",
21
+ version: "22.0.0-next.6",
22
22
  type: DeferredContentAware,
23
23
  isStandalone: true,
24
24
  inputs: {
@@ -38,7 +38,7 @@ class DeferredContentAware {
38
38
  }
39
39
  i0.ɵɵngDeclareClassMetadata({
40
40
  minVersion: "12.0.0",
41
- version: "22.0.0-next.5",
41
+ version: "22.0.0-next.6",
42
42
  ngImport: i0,
43
43
  type: DeferredContentAware,
44
44
  decorators: [{
@@ -95,7 +95,7 @@ class DeferredContent {
95
95
  }
96
96
  static ɵfac = i0.ɵɵngDeclareFactory({
97
97
  minVersion: "12.0.0",
98
- version: "22.0.0-next.5",
98
+ version: "22.0.0-next.6",
99
99
  ngImport: i0,
100
100
  type: DeferredContent,
101
101
  deps: [],
@@ -103,7 +103,7 @@ class DeferredContent {
103
103
  });
104
104
  static ɵdir = i0.ɵɵngDeclareDirective({
105
105
  minVersion: "14.0.0",
106
- version: "22.0.0-next.5",
106
+ version: "22.0.0-next.6",
107
107
  type: DeferredContent,
108
108
  isStandalone: true,
109
109
  ngImport: i0
@@ -111,7 +111,7 @@ class DeferredContent {
111
111
  }
112
112
  i0.ɵɵngDeclareClassMetadata({
113
113
  minVersion: "12.0.0",
114
- version: "22.0.0-next.5",
114
+ version: "22.0.0-next.6",
115
115
  ngImport: i0,
116
116
  type: DeferredContent,
117
117
  decorators: [{
@@ -9,7 +9,7 @@ class MenuPattern {
9
9
  visible = computed(() => this.inputs.parent() ? !!this.inputs.parent()?.expanded() : true);
10
10
  listBehavior;
11
11
  isFocused = signal(false);
12
- hasBeenFocused = signal(false);
12
+ hasBeenInteracted = signal(false);
13
13
  hasBeenHovered = signal(false);
14
14
  _openTimeout;
15
15
  _closeTimeout;
@@ -63,12 +63,22 @@ class MenuPattern {
63
63
  }
64
64
  setDefaultState() {
65
65
  if (!this.inputs.parent()) {
66
- this.listBehavior.goto(this.inputs.items()[0], {
67
- focusElement: false
68
- });
66
+ const firstFocusable = this.listBehavior.navigationBehavior.peekFirst();
67
+ if (firstFocusable) {
68
+ this.listBehavior.goto(firstFocusable, {
69
+ focusElement: false
70
+ });
71
+ }
72
+ }
73
+ }
74
+ setDefaultStateEffect() {
75
+ if (this.hasBeenInteracted() || this.hasBeenHovered()) return;
76
+ if (this.inputs.items().length > 0) {
77
+ this.setDefaultState();
69
78
  }
70
79
  }
71
80
  onKeydown(event) {
81
+ this.hasBeenInteracted.set(true);
72
82
  this.keydownManager().handle(event);
73
83
  }
74
84
  onMouseOver(event) {
@@ -148,7 +158,7 @@ class MenuPattern {
148
158
  }
149
159
  onFocusIn() {
150
160
  this.isFocused.set(true);
151
- this.hasBeenFocused.set(true);
161
+ this.hasBeenInteracted.set(true);
152
162
  }
153
163
  onFocusOut(event) {
154
164
  const parent = this.inputs.parent();
@@ -285,7 +295,7 @@ class MenuBarPattern {
285
295
  dynamicSpaceKey = computed(() => this.listBehavior.isTyping() ? '' : ' ');
286
296
  typeaheadRegexp = /^.$/;
287
297
  isFocused = signal(false);
288
- hasBeenFocused = signal(false);
298
+ hasBeenInteracted = signal(false);
289
299
  disabled = () => this.inputs.disabled();
290
300
  keydownManager = computed(() => {
291
301
  return new KeyboardEventManager().on(this._nextKey, () => this.next(), {
@@ -307,9 +317,19 @@ class MenuBarPattern {
307
317
  this.listBehavior = new List(inputs);
308
318
  }
309
319
  setDefaultState() {
310
- this.inputs.activeItem.set(this.inputs.items()[0]);
320
+ const firstFocusable = this.listBehavior.navigationBehavior.peekFirst();
321
+ if (firstFocusable) {
322
+ this.inputs.activeItem.set(firstFocusable);
323
+ }
324
+ }
325
+ setDefaultStateEffect() {
326
+ if (this.hasBeenInteracted()) return;
327
+ if (this.inputs.items().length > 0) {
328
+ this.setDefaultState();
329
+ }
311
330
  }
312
331
  onKeydown(event) {
332
+ this.hasBeenInteracted.set(true);
313
333
  this.keydownManager().handle(event);
314
334
  }
315
335
  onClick(event) {
@@ -330,7 +350,7 @@ class MenuBarPattern {
330
350
  }
331
351
  onFocusIn() {
332
352
  this.isFocused.set(true);
333
- this.hasBeenFocused.set(true);
353
+ this.hasBeenInteracted.set(true);
334
354
  }
335
355
  onFocusOut(event) {
336
356
  const relatedTarget = event.relatedTarget;
@@ -382,7 +402,7 @@ class MenuBarPattern {
382
402
  class MenuTriggerPattern {
383
403
  inputs;
384
404
  expanded = signal(false);
385
- hasBeenFocused = signal(false);
405
+ hasBeenInteracted = signal(false);
386
406
  role = () => 'button';
387
407
  hasPopup = () => true;
388
408
  menu;
@@ -407,6 +427,7 @@ class MenuTriggerPattern {
407
427
  }
408
428
  onKeydown(event) {
409
429
  if (!this.inputs.disabled()) {
430
+ this.hasBeenInteracted.set(true);
410
431
  this.keydownManager().handle(event);
411
432
  }
412
433
  }
@@ -418,7 +439,7 @@ class MenuTriggerPattern {
418
439
  }
419
440
  }
420
441
  onFocusIn() {
421
- this.hasBeenFocused.set(true);
442
+ this.hasBeenInteracted.set(true);
422
443
  }
423
444
  onFocusOut(event) {
424
445
  const element = this.inputs.element();
@@ -458,7 +479,7 @@ class MenuItemPattern {
458
479
  searchTerm;
459
480
  element;
460
481
  active = computed(() => this.inputs.parent()?.inputs.activeItem() === this);
461
- hasBeenFocused = signal(false);
482
+ hasBeenInteracted = signal(false);
462
483
  tabIndex = computed(() => {
463
484
  if (this.submenu() && this.submenu()?.inputs.activeItem()) {
464
485
  return -1;
@@ -512,7 +533,7 @@ class MenuItemPattern {
512
533
  }
513
534
  }
514
535
  onFocusIn() {
515
- this.hasBeenFocused.set(true);
536
+ this.hasBeenInteracted.set(true);
516
537
  }
517
538
  }
518
539