@angular/aria 21.2.0-next.1 → 21.2.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.
- package/fesm2022/_combobox-tree-chunk.mjs +7 -0
- package/fesm2022/_combobox-tree-chunk.mjs.map +1 -1
- package/fesm2022/_menu-chunk.mjs +2 -2
- package/fesm2022/_menu-chunk.mjs.map +1 -1
- package/fesm2022/_toolbar-widget-group-chunk.mjs +0 -4
- package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
- package/fesm2022/_widget-chunk.mjs +10 -8
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/grid.mjs +23 -17
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/menu.mjs +12 -10
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +0 -8
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree.mjs +8 -0
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/code-examples.db +0 -0
- package/types/_grid-chunk.d.ts +2 -0
- package/types/_menu-chunk.d.ts +2 -2
- package/types/_toolbar-chunk.d.ts +0 -2
- package/types/_tree-chunk.d.ts +4 -0
- package/types/grid.d.ts +3 -3
- package/types/menu.d.ts +14 -13
|
@@ -391,6 +391,13 @@ class TreePattern {
|
|
|
391
391
|
multiExpandable: () => true
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
|
+
validate() {
|
|
395
|
+
const violations = [];
|
|
396
|
+
if (!this.inputs.multi() && this.inputs.values().length > 1) {
|
|
397
|
+
violations.push(`A single-select tree should not have multiple selected options. Selected options: ${this.inputs.values().join(', ')}`);
|
|
398
|
+
}
|
|
399
|
+
return violations;
|
|
400
|
+
}
|
|
394
401
|
setDefaultState() {
|
|
395
402
|
let firstItem;
|
|
396
403
|
for (const item of this.inputs.items()) {
|
|
@@ -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().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 }\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\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()}))\n .on(this.nextKey, () => tree.next({selectOne: this.followFocus()}))\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 .on(Modifier.Shift, this.nextKey, () => tree.next({selectRange: true}))\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())\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => tree.next())\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 values: WritableSignalLike<V[]>;\n\n constructor(readonly inputs: TreeInputs<V>) {\n this.activeItem = inputs.activeItem;\n this.values = inputs.values;\n\n this.treeBehavior = new Tree<TreeItemPattern<V>, V>({\n ...inputs,\n multi: this.multi,\n multiExpandable: () => true,\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.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.values.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","values","includes","current","currentType","TreePattern","followFocus","selectionMode","isRtl","textDirection","prevKey","orientation","nextKey","collapseKey","expandKey","dynamicSpaceKey","typeaheadRegexp","keydown","manager","KeyboardEventManager","on","e","key","Modifier","Shift","_expandOrFirstChild","_collapseOrParent","multi","Any","Ctrl","Meta","preventDefault","pointerdown","PointerEventManager","focusMode","softDisabled","typeaheadDelay","multiExpandable","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;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,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
|
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().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 }\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()}))\n .on(this.nextKey, () => tree.next({selectOne: this.followFocus()}))\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 .on(Modifier.Shift, this.nextKey, () => tree.next({selectRange: true}))\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())\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => tree.next())\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 values: WritableSignalLike<V[]>;\n\n constructor(readonly inputs: TreeInputs<V>) {\n this.activeItem = inputs.activeItem;\n this.values = inputs.values;\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.values().length > 1) {\n violations.push(\n `A single-select tree should not have multiple selected options. Selected options: ${this.inputs.values().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.values.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","values","includes","current","currentType","TreePattern","followFocus","selectionMode","isRtl","textDirection","prevKey","orientation","nextKey","collapseKey","expandKey","dynamicSpaceKey","typeaheadRegexp","keydown","manager","KeyboardEventManager","on","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;AACD;MAGYC,IAAI,CAAA;EAkCMC,MAAA;EAhCrBC,kBAAkB;EAGlBC,iBAAiB;EAGjB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AAAA,UAAU,GAAGA,MAAM,IAAI,CAACzC,mBAAmB,EAAE;AAG7C0C,EAAAA,YAAY,GAAGA,MAAM,IAAI,CAACzC,iBAAiB,EAAE;EAG7C0C,gBAAgBA,CAACtK,IAAuC,GAAA,IAAI,CAACG,MAAM,CAACiC,UAAU,EAAE,EAAA;IAC9E,OAAOpC,IAAI,GAAGA,IAAI,CAACuF,UAAU,EAAE,GAAG,KAAK;AACzC;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;GACxC;AACF;;;;"}
|
package/fesm2022/_menu-chunk.mjs
CHANGED
|
@@ -203,13 +203,13 @@ class MenuPattern {
|
|
|
203
203
|
}
|
|
204
204
|
if (!item.submenu() && isMenuBar) {
|
|
205
205
|
root.close();
|
|
206
|
-
root?.inputs.
|
|
206
|
+
root?.inputs.itemSelected?.(item.value());
|
|
207
207
|
}
|
|
208
208
|
if (!item.submenu() && isMenu) {
|
|
209
209
|
root.inputs.activeItem()?.close({
|
|
210
210
|
refocus: true
|
|
211
211
|
});
|
|
212
|
-
root?.inputs.
|
|
212
|
+
root?.inputs.itemSelected?.(item.value());
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_menu-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/menu/menu.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 {KeyboardEventManager} from '../behaviors/event-manager';\nimport {computed, signal, SignalLike} from '../behaviors/signal-like/signal-like';\nimport {List, ListInputs, ListItem} from '../behaviors/list/list';\n\n/** The inputs for the MenuBarPattern class. */\nexport interface MenuBarInputs<V> extends ListInputs<MenuItemPattern<V>, V> {\n /** The menu items contained in the menu. */\n items: SignalLike<MenuItemPattern<V>[]>;\n\n /** Callback function triggered when a menu item is selected. */\n onSelect?: (value: V) => void;\n\n /** The text direction of the menu bar. */\n textDirection: SignalLike<'ltr' | 'rtl'>;\n}\n\n/** The inputs for the MenuPattern class. */\nexport interface MenuInputs<V> extends Omit<ListInputs<MenuItemPattern<V>, V>, 'values'> {\n /** The unique ID of the menu. */\n id: SignalLike<string>;\n\n /** The menu items contained in the menu. */\n items: SignalLike<MenuItemPattern<V>[]>;\n\n /** A reference to the parent menu or menu trigger. */\n parent: SignalLike<MenuTriggerPattern<V> | MenuItemPattern<V> | undefined>;\n\n /** Callback function triggered when a menu item is selected. */\n onSelect?: (value: V) => void;\n\n /** The text direction of the menu bar. */\n textDirection: SignalLike<'ltr' | 'rtl'>;\n\n /** The delay in milliseconds before expanding sub-menus on hover. */\n expansionDelay: SignalLike<number>;\n}\n\n/** The inputs for the MenuTriggerPattern class. */\nexport interface MenuTriggerInputs<V> {\n /** A reference to the menu trigger element. */\n element: SignalLike<HTMLElement | undefined>;\n\n /** A reference to the menu associated with the trigger. */\n menu: SignalLike<MenuPattern<V> | undefined>;\n\n /** The text direction of the menu bar. */\n textDirection: SignalLike<'ltr' | 'rtl'>;\n\n /** Whether the menu trigger is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** The inputs for the MenuItemPattern class. */\nexport interface MenuItemInputs<V> extends Omit<ListItem<V>, 'index' | 'selectable'> {\n /** A reference to the parent menu or menu trigger. */\n parent: SignalLike<MenuPattern<V> | MenuBarPattern<V> | undefined>;\n\n /** A reference to the submenu associated with the menu item. */\n submenu: SignalLike<MenuPattern<V> | undefined>;\n}\n\n/** The menu ui pattern class. */\nexport class MenuPattern<V> {\n /** The unique ID of the menu. */\n id: SignalLike<string>;\n\n /** The role of the menu. */\n role = () => 'menu';\n\n /** Whether the menu is disabled. */\n disabled = () => this.inputs.disabled();\n\n /** Whether the menu is visible. */\n visible = computed(() => (this.inputs.parent() ? !!this.inputs.parent()?.expanded() : true));\n\n /** Controls list behavior for the menu items. */\n listBehavior: List<MenuItemPattern<V>, V>;\n\n /** Whether the menu or any of its child elements are currently focused. */\n isFocused = signal(false);\n\n /** Whether the menu has received focus. */\n hasBeenFocused = signal(false);\n\n /** Whether the menu trigger has been hovered. */\n hasBeenHovered = signal(false);\n\n /** Timeout used to open sub-menus on hover. */\n _openTimeout: any;\n\n /** Timeout used to close sub-menus on hover out. */\n _closeTimeout: any;\n\n /** The tab index of the menu. */\n tabIndex = () => this.listBehavior.tabIndex();\n\n /** Whether the menu should be focused on mouse over. */\n shouldFocus = computed(() => {\n const root = this.root();\n\n if (root instanceof MenuTriggerPattern) {\n return true;\n }\n\n if (root instanceof MenuBarPattern || root instanceof MenuPattern) {\n return root.isFocused();\n }\n\n return false;\n });\n\n /** The key used to expand sub-menus. */\n private _expandKey = computed(() => {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The key used to collapse sub-menus. */\n private _collapseKey = computed(() => {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** Represents the space key. Does nothing when the user is actively using typeahead. */\n dynamicSpaceKey = computed(() => (this.listBehavior.isTyping() ? '' : ' '));\n\n /** The regexp used to decide if a key should trigger typeahead. */\n typeaheadRegexp = /^.$/;\n\n /** The root of the menu. */\n root: SignalLike<MenuTriggerPattern<V> | MenuBarPattern<V> | MenuPattern<V> | undefined> =\n computed(() => {\n const parent = this.inputs.parent();\n\n if (!parent) {\n return this;\n }\n\n if (parent instanceof MenuTriggerPattern) {\n return parent;\n }\n\n const grandparent = parent.inputs.parent();\n\n if (grandparent instanceof MenuBarPattern) {\n return grandparent;\n }\n\n return grandparent?.root();\n });\n\n /** Handles keyboard events for the menu. */\n keydownManager = computed(() => {\n return new KeyboardEventManager()\n .on('ArrowDown', () => this.next())\n .on('ArrowUp', () => this.prev())\n .on('Home', () => this.first())\n .on('End', () => this.last())\n .on('Enter', () => this.trigger())\n .on('Escape', () => this.closeAll())\n .on(this._expandKey, () => this.expand())\n .on(this._collapseKey, () => this.collapse())\n .on(this.dynamicSpaceKey, () => this.trigger())\n .on(this.typeaheadRegexp, e => this.listBehavior.search(e.key));\n });\n\n constructor(readonly inputs: MenuInputs<V>) {\n this.id = inputs.id;\n this.listBehavior = new List<MenuItemPattern<V>, V>({\n ...inputs,\n values: signal([]),\n });\n }\n\n /** Sets the default state for the menu. */\n setDefaultState() {\n if (!this.inputs.parent()) {\n this.listBehavior.goto(this.inputs.items()[0], {focusElement: false});\n }\n }\n\n /** Handles keyboard events for the menu. */\n onKeydown(event: KeyboardEvent) {\n this.keydownManager().handle(event);\n }\n\n /** Handles mouseover events for the menu. */\n onMouseOver(event: MouseEvent) {\n if (!this.visible()) {\n return;\n }\n\n this.hasBeenHovered.set(true);\n const item = this.inputs.items().find(i => i.element()?.contains(event.target as Node));\n\n if (!item) {\n return;\n }\n\n const parent = this.inputs.parent();\n const activeItem = this?.inputs.activeItem();\n\n if (parent instanceof MenuItemPattern) {\n const grandparent = parent.inputs.parent();\n if (grandparent instanceof MenuPattern) {\n grandparent._clearTimeouts();\n grandparent.listBehavior.goto(parent, {focusElement: false});\n }\n }\n\n if (activeItem && activeItem !== item) {\n this._closeItem(activeItem);\n }\n\n if (item.expanded()) {\n this._clearCloseTimeout();\n }\n\n this._openItem(item);\n this.listBehavior.goto(item, {focusElement: this.shouldFocus()});\n }\n\n /** Closes the specified menu item after a delay. */\n private _closeItem(item: MenuItemPattern<V>) {\n this._clearOpenTimeout();\n\n if (!this._closeTimeout) {\n this._closeTimeout = setTimeout(() => {\n item.close();\n this._closeTimeout = undefined;\n }, this.inputs.expansionDelay());\n }\n }\n\n /** Opens the specified menu item after a delay. */\n private _openItem(item: MenuItemPattern<V>) {\n this._clearOpenTimeout();\n\n this._openTimeout = setTimeout(() => {\n item.open();\n this._openTimeout = undefined;\n }, this.inputs.expansionDelay());\n }\n\n /** Handles mouseout events for the menu. */\n onMouseOut(event: MouseEvent) {\n this._clearOpenTimeout();\n\n if (this.isFocused()) {\n return;\n }\n\n const root = this.root();\n const parent = this.inputs.parent();\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (!root || !parent || parent instanceof MenuTriggerPattern) {\n return;\n }\n\n const grandparent = parent.inputs.parent();\n\n if (!grandparent || grandparent instanceof MenuBarPattern) {\n return;\n }\n\n if (!grandparent.inputs.element()?.contains(relatedTarget)) {\n parent.close();\n }\n }\n\n /** Handles click events for the menu. */\n onClick(event: MouseEvent) {\n const relatedTarget = event.target as Node | null;\n const item = this.inputs.items().find(i => i.element()?.contains(relatedTarget));\n\n if (item) {\n item.open();\n this.listBehavior.goto(item);\n this.submit(item);\n }\n }\n\n /** Handles focusin events for the menu. */\n onFocusIn() {\n this.isFocused.set(true);\n this.hasBeenFocused.set(true);\n }\n\n /** Handles the focusout event for the menu. */\n onFocusOut(event: FocusEvent) {\n const parent = this.inputs.parent();\n const parentEl = parent?.inputs.element();\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (!relatedTarget) {\n this.isFocused.set(false);\n this.inputs.parent()?.close({refocus: true});\n }\n\n if (parent instanceof MenuItemPattern) {\n const grandparent = parent.inputs.parent();\n const siblings = grandparent?.inputs.items().filter(i => i !== parent);\n const item = siblings?.find(i => i.element()?.contains(relatedTarget));\n\n if (item) {\n return;\n }\n }\n\n if (\n this.visible() &&\n !parentEl?.contains(relatedTarget) &&\n !this.inputs.element()?.contains(relatedTarget)\n ) {\n this.isFocused.set(false);\n this.inputs.parent()?.close();\n }\n }\n\n /** Focuses the previous menu item. */\n prev() {\n this.inputs.activeItem()?.close();\n this.listBehavior.prev();\n }\n\n /** Focuses the next menu item. */\n next() {\n this.inputs.activeItem()?.close();\n this.listBehavior.next();\n }\n\n /** Focuses the first menu item. */\n first() {\n this.inputs.activeItem()?.close();\n this.listBehavior.first();\n }\n\n /** Focuses the last menu item. */\n last() {\n this.inputs.activeItem()?.close();\n this.listBehavior.last();\n }\n\n /** Triggers the active menu item. */\n trigger() {\n this.inputs.activeItem()?.hasPopup()\n ? this.inputs.activeItem()?.open({first: true})\n : this.submit();\n }\n\n /** Submits the menu. */\n submit(item = this.inputs.activeItem()) {\n const root = this.root();\n\n if (item && !item.disabled()) {\n const isMenu = root instanceof MenuPattern;\n const isMenuBar = root instanceof MenuBarPattern;\n const isMenuTrigger = root instanceof MenuTriggerPattern;\n\n if (!item.submenu() && isMenuTrigger) {\n root.close({refocus: true});\n }\n\n if (!item.submenu() && isMenuBar) {\n root.close();\n root?.inputs.onSelect?.(item.value());\n }\n\n if (!item.submenu() && isMenu) {\n root.inputs.activeItem()?.close({refocus: true});\n root?.inputs.onSelect?.(item.value());\n }\n }\n }\n\n /** Collapses the current menu or focuses the previous item in the menubar. */\n collapse() {\n const root = this.root();\n const parent = this.inputs.parent();\n\n if (parent instanceof MenuItemPattern && !(parent.inputs.parent() instanceof MenuBarPattern)) {\n parent.close({refocus: true});\n } else if (root instanceof MenuBarPattern) {\n root.prev();\n }\n }\n\n /** Expands the current menu or focuses the next item in the menubar. */\n expand() {\n const root = this.root();\n const activeItem = this.inputs.activeItem();\n\n if (activeItem?.submenu()) {\n activeItem.open({first: true});\n } else if (root instanceof MenuBarPattern) {\n root.next();\n }\n }\n\n /** Closes the menu. */\n close() {\n this.inputs.parent()?.close();\n }\n\n /** Closes the menu and all parent menus. */\n closeAll() {\n const root = this.root();\n\n if (root instanceof MenuTriggerPattern) {\n root.close({refocus: true});\n }\n\n if (root instanceof MenuBarPattern) {\n root.close();\n }\n\n if (root instanceof MenuPattern) {\n root.inputs.activeItem()?.close({refocus: true});\n }\n }\n\n /** Clears any open or close timeouts for sub-menus. */\n _clearTimeouts() {\n this._clearOpenTimeout();\n this._clearCloseTimeout();\n }\n\n /** Clears the open timeout. */\n _clearOpenTimeout() {\n if (this._openTimeout) {\n clearTimeout(this._openTimeout);\n this._openTimeout = undefined;\n }\n }\n\n /** Clears the close timeout. */\n _clearCloseTimeout() {\n if (this._closeTimeout) {\n clearTimeout(this._closeTimeout);\n this._closeTimeout = undefined;\n }\n }\n}\n\n/** The menubar ui pattern class. */\nexport class MenuBarPattern<V> {\n /** Controls list behavior for the menu items. */\n listBehavior: List<MenuItemPattern<V>, V>;\n\n /** The tab index of the menu. */\n tabIndex = () => this.listBehavior.tabIndex();\n\n /** The key used to navigate to the next item. */\n private _nextKey = computed(() => {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The key used to navigate to the previous item. */\n private _previousKey = computed(() => {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** Represents the space key. Does nothing when the user is actively using typeahead. */\n dynamicSpaceKey = computed(() => (this.listBehavior.isTyping() ? '' : ' '));\n\n /** The regexp used to decide if a key should trigger typeahead. */\n typeaheadRegexp = /^.$/;\n\n /** Whether the menubar or any of its children are currently focused. */\n isFocused = signal(false);\n\n /** Whether the menubar has been focused. */\n hasBeenFocused = signal(false);\n\n /** Whether the menubar is disabled. */\n disabled = () => this.inputs.disabled();\n\n /** Handles keyboard events for the menu. */\n keydownManager = computed(() => {\n return new KeyboardEventManager()\n .on(this._nextKey, () => this.next())\n .on(this._previousKey, () => this.prev())\n .on('End', () => this.listBehavior.last())\n .on('Home', () => this.listBehavior.first())\n .on('Enter', () => this.inputs.activeItem()?.open({first: true}))\n .on('ArrowUp', () => this.inputs.activeItem()?.open({last: true}))\n .on('ArrowDown', () => this.inputs.activeItem()?.open({first: true}))\n .on(this.dynamicSpaceKey, () => this.inputs.activeItem()?.open({first: true}))\n .on(this.typeaheadRegexp, e => this.listBehavior.search(e.key));\n });\n\n constructor(readonly inputs: MenuBarInputs<V>) {\n this.listBehavior = new List<MenuItemPattern<V>, V>(inputs);\n }\n\n /** Sets the default state for the menubar. */\n setDefaultState() {\n this.inputs.activeItem.set(this.inputs.items()[0]);\n }\n\n /** Handles keyboard events for the menu. */\n onKeydown(event: KeyboardEvent) {\n this.keydownManager().handle(event);\n }\n\n /** Handles click events for the menu bar. */\n onClick(event: MouseEvent) {\n const item = this.inputs.items().find(i => i.element()?.contains(event.target as Node));\n\n if (!item) {\n return;\n }\n\n this.goto(item);\n item.expanded() ? item.close() : item.open();\n }\n\n /** Handles mouseover events for the menu bar. */\n onMouseOver(event: MouseEvent) {\n const item = this.inputs.items().find(i => i.element()?.contains(event.target as Node));\n\n if (item) {\n this.goto(item, {focusElement: this.isFocused()});\n }\n }\n\n /** Handles focusin events for the menu bar. */\n onFocusIn() {\n this.isFocused.set(true);\n this.hasBeenFocused.set(true);\n }\n\n /** Handles focusout events for the menu bar. */\n onFocusOut(event: FocusEvent) {\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (!this.inputs.element()?.contains(relatedTarget)) {\n this.isFocused.set(false);\n this.close();\n }\n }\n\n /** Goes to and optionally focuses the specified menu item. */\n goto(item: MenuItemPattern<V>, opts?: {focusElement?: boolean}) {\n const prevItem = this.inputs.activeItem();\n this.listBehavior.goto(item, opts);\n\n if (prevItem?.expanded()) {\n prevItem?.close();\n this.inputs.activeItem()?.open();\n }\n\n if (item === prevItem) {\n if (item.expanded() && item.submenu()?.inputs.activeItem()) {\n item.submenu()?.inputs.activeItem()?.close();\n item.submenu()?.listBehavior.unfocus();\n }\n }\n }\n\n /** Focuses the next menu item. */\n next() {\n const prevItem = this.inputs.activeItem();\n this.listBehavior.next();\n\n if (prevItem?.expanded()) {\n prevItem?.close();\n this.inputs.activeItem()?.open({first: true});\n }\n }\n\n /** Focuses the previous menu item. */\n prev() {\n const prevItem = this.inputs.activeItem();\n this.listBehavior.prev();\n\n if (prevItem?.expanded()) {\n prevItem?.close();\n this.inputs.activeItem()?.open({first: true});\n }\n }\n\n /** Closes the menubar and refocuses the root menu bar item. */\n close() {\n this.inputs.activeItem()?.close({refocus: this.isFocused()});\n }\n}\n\n/** The menu trigger ui pattern class. */\nexport class MenuTriggerPattern<V> {\n /** Whether the menu is expanded. */\n expanded = signal(false);\n\n /** Whether the menu trigger has received focus. */\n hasBeenFocused = signal(false);\n\n /** The role of the menu trigger. */\n role = () => 'button';\n\n /** Whether the menu trigger has a popup. */\n hasPopup = () => true;\n\n /** The menu associated with the trigger. */\n menu: SignalLike<MenuPattern<V> | undefined>;\n\n /** The tab index of the menu trigger. */\n tabIndex = computed(() => (this.expanded() && this.menu()?.inputs.activeItem() ? -1 : 0));\n\n /** Whether the menu trigger is disabled. */\n disabled = () => this.inputs.disabled();\n\n /** Handles keyboard events for the menu trigger. */\n keydownManager = computed(() => {\n return new KeyboardEventManager()\n .on(' ', () => this.open({first: true}))\n .on('Enter', () => this.open({first: true}))\n .on('ArrowDown', () => this.open({first: true}))\n .on('ArrowUp', () => this.open({last: true}))\n .on('Escape', () => this.close({refocus: true}));\n });\n\n constructor(readonly inputs: MenuTriggerInputs<V>) {\n this.menu = this.inputs.menu;\n }\n\n /** Handles keyboard events for the menu trigger. */\n onKeydown(event: KeyboardEvent) {\n if (!this.inputs.disabled()) {\n this.keydownManager().handle(event);\n }\n }\n\n /** Handles click events for the menu trigger. */\n onClick() {\n if (!this.inputs.disabled()) {\n this.expanded() ? this.close() : this.open({first: true});\n }\n }\n\n /** Handles focusin events for the menu trigger. */\n onFocusIn() {\n this.hasBeenFocused.set(true);\n }\n\n /** Handles focusout events for the menu trigger. */\n onFocusOut(event: FocusEvent) {\n const element = this.inputs.element();\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (\n this.expanded() &&\n !element?.contains(relatedTarget) &&\n !this.inputs.menu()?.inputs.element()?.contains(relatedTarget)\n ) {\n this.close();\n }\n }\n\n /** Opens the menu. */\n open(opts?: {first?: boolean; last?: boolean}) {\n this.expanded.set(true);\n\n if (opts?.first) {\n this.inputs.menu()?.first();\n } else if (opts?.last) {\n this.inputs.menu()?.last();\n }\n }\n\n /** Closes the menu. */\n close(opts: {refocus?: boolean} = {}) {\n this.expanded.set(false);\n this.menu()?.listBehavior.unfocus();\n\n if (opts.refocus) {\n this.inputs.element()?.focus();\n }\n\n let menuitems = this.inputs.menu()?.inputs.items() ?? [];\n\n while (menuitems.length) {\n const menuitem = menuitems.pop();\n menuitem?._expanded.set(false);\n menuitem?.inputs.parent()?.listBehavior.unfocus();\n menuitems = menuitems.concat(menuitem?.submenu()?.inputs.items() ?? []);\n }\n }\n}\n\n/** The menu item ui pattern class. */\nexport class MenuItemPattern<V> implements ListItem<V> {\n /** The value of the menu item. */\n value: SignalLike<V>;\n\n /** The unique ID of the menu item. */\n id: SignalLike<string>;\n\n /** Whether the menu item is disabled. */\n disabled = () => this.inputs.parent()?.disabled() || this.inputs.disabled();\n\n /** The search term for the menu item. */\n searchTerm: SignalLike<string>;\n\n /** The element of the menu item. */\n element: SignalLike<HTMLElement | undefined>;\n\n /** Whether the menu item is active. */\n active = computed(() => this.inputs.parent()?.inputs.activeItem() === this);\n\n /** Whether the menu item has received focus. */\n hasBeenFocused = signal(false);\n\n /** The tab index of the menu item. */\n tabIndex = computed(() => {\n if (this.submenu() && this.submenu()?.inputs.activeItem()) {\n return -1;\n }\n return this.inputs.parent()?.listBehavior.getItemTabindex(this) ?? -1;\n });\n\n /** The position of the menu item in the menu. */\n index = computed(() => this.inputs.parent()?.inputs.items().indexOf(this) ?? -1);\n\n /** Whether the menu item is expanded. */\n expanded = computed(() => (this.submenu() ? this._expanded() : null));\n\n /** Whether the menu item is expanded. */\n _expanded = signal(false);\n\n /** The ID of the menu that the menu item controls. */\n controls = signal<string | undefined>(undefined);\n\n /** The role of the menu item. */\n role = () => 'menuitem';\n\n /** Whether the menu item has a popup. */\n hasPopup = computed(() => !!this.submenu());\n\n /** The submenu associated with the menu item. */\n submenu: SignalLike<MenuPattern<V> | undefined>;\n\n /** Whether the menu item is selectable. */\n selectable: SignalLike<boolean>;\n\n constructor(readonly inputs: MenuItemInputs<V>) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.element = inputs.element;\n this.submenu = this.inputs.submenu;\n this.searchTerm = inputs.searchTerm;\n this.selectable = computed(() => !this.submenu());\n }\n\n /** Opens the submenu. */\n open(opts?: {first?: boolean; last?: boolean}) {\n if (this.disabled()) {\n return;\n }\n\n this._expanded.set(true);\n\n if (opts?.first) {\n this.submenu()?.first();\n }\n if (opts?.last) {\n this.submenu()?.last();\n }\n }\n\n /** Closes the submenu. */\n close(opts: {refocus?: boolean} = {}) {\n this._expanded.set(false);\n\n if (opts.refocus) {\n this.inputs.parent()?.listBehavior.goto(this);\n }\n\n let menuitems = this.inputs.submenu()?.inputs.items() ?? [];\n\n while (menuitems.length) {\n const menuitem = menuitems.pop();\n menuitem?._expanded.set(false);\n menuitem?.inputs.parent()?.listBehavior.unfocus();\n menuitems = menuitems.concat(menuitem?.submenu()?.inputs.items() ?? []);\n\n const parent = menuitem?.inputs.parent();\n\n if (parent instanceof MenuPattern) {\n parent._clearTimeouts();\n }\n }\n }\n\n /** Handles focusin events for the menu item. */\n onFocusIn() {\n this.hasBeenFocused.set(true);\n }\n}\n"],"names":["MenuPattern","inputs","id","role","disabled","visible","computed","parent","expanded","listBehavior","isFocused","signal","hasBeenFocused","hasBeenHovered","_openTimeout","_closeTimeout","tabIndex","shouldFocus","root","MenuTriggerPattern","MenuBarPattern","_expandKey","textDirection","_collapseKey","dynamicSpaceKey","isTyping","typeaheadRegexp","grandparent","keydownManager","KeyboardEventManager","on","next","prev","first","last","trigger","closeAll","expand","collapse","e","search","key","constructor","List","values","setDefaultState","goto","items","focusElement","onKeydown","event","handle","onMouseOver","set","item","find","i","element","contains","target","activeItem","MenuItemPattern","_clearTimeouts","_closeItem","_clearCloseTimeout","_openItem","_clearOpenTimeout","setTimeout","close","undefined","expansionDelay","open","onMouseOut","relatedTarget","onClick","submit","onFocusIn","onFocusOut","parentEl","refocus","siblings","filter","hasPopup","isMenu","isMenuBar","isMenuTrigger","submenu","onSelect","value","clearTimeout","_nextKey","_previousKey","opts","prevItem","unfocus","menu","focus","menuitems","length","menuitem","pop","_expanded","concat","searchTerm","active","getItemTabindex","index","indexOf","controls","selectable"],"mappings":";;;MAsEaA,WAAW,CAAA;EAsGDC,MAAA;EApGrBC,EAAE;EAGFC,IAAI,GAAGA,MAAM,MAAM;EAGnBC,QAAQ,GAAGA,MAAM,IAAI,CAACH,MAAM,CAACG,QAAQ,EAAE;EAGvCC,OAAO,GAAGC,QAAQ,CAAC,MAAO,IAAI,CAACL,MAAM,CAACM,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,CAACN,MAAM,CAACM,MAAM,EAAE,EAAEC,QAAQ,EAAE,GAAG,IAAK,CAAC;EAG5FC,YAAY;AAGZC,EAAAA,SAAS,GAAGC,MAAM,CAAC,KAAK,CAAC;AAGzBC,EAAAA,cAAc,GAAGD,MAAM,CAAC,KAAK,CAAC;AAG9BE,EAAAA,cAAc,GAAGF,MAAM,CAAC,KAAK,CAAC;EAG9BG,YAAY;EAGZC,aAAa;EAGbC,QAAQ,GAAGA,MAAM,IAAI,CAACP,YAAY,CAACO,QAAQ,EAAE;EAG7CC,WAAW,GAAGX,QAAQ,CAAC,MAAK;AAC1B,IAAA,MAAMY,IAAI,GAAG,IAAI,CAACA,IAAI,EAAE;IAExB,IAAIA,IAAI,YAAYC,kBAAkB,EAAE;AACtC,MAAA,OAAO,IAAI;AACb;AAEA,IAAA,IAAID,IAAI,YAAYE,cAAc,IAAIF,IAAI,YAAYlB,WAAW,EAAE;AACjE,MAAA,OAAOkB,IAAI,CAACR,SAAS,EAAE;AACzB;AAEA,IAAA,OAAO,KAAK;AACd,GAAC,CAAC;EAGMW,UAAU,GAAGf,QAAQ,CAAC,MAAK;AACjC,IAAA,OAAO,IAAI,CAACL,MAAM,CAACqB,aAAa,EAAE,KAAK,KAAK,GAAG,WAAW,GAAG,YAAY;AAC3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AAC,KAAK,CAAC;IAEzB,IAAIuC,IAAI,CAACb,OAAO,EAAE;AAChB,MAAA,IAAI,CAAC9E,MAAM,CAACM,MAAM,EAAE,EAAEE,YAAY,CAACqC,IAAI,CAAC,IAAI,CAAC;AAC/C;AAEA,IAAA,IAAImD,SAAS,GAAG,IAAI,CAAChG,MAAM,CAACqF,OAAO,EAAE,EAAErF,MAAM,CAAC8C,KAAK,EAAE,IAAI,EAAE;IAE3D,OAAOkD,SAAS,CAACC,MAAM,EAAE;AACvB,MAAA,MAAMC,QAAQ,GAAGF,SAAS,CAACG,GAAG,EAAE;AAChCD,MAAAA,QAAQ,EAAEE,SAAS,CAAChD,GAAG,CAAC,KAAK,CAAC;MAC9B8C,QAAQ,EAAElG,MAAM,CAACM,MAAM,EAAE,EAAEE,YAAY,CAACqF,OAAO,EAAE;AACjDG,MAAAA,SAAS,GAAGA,SAAS,CAACK,MAAM,CAACH,QAAQ,EAAEb,OAAO,EAAE,EAAErF,MAAM,CAAC8C,KAAK,EAAE,IAAI,EAAE,CAAC;MAEvE,MAAMxC,MAAM,GAAG4F,QAAQ,EAAElG,MAAM,CAACM,MAAM,EAAE;MAExC,IAAIA,MAAM,YAAYP,WAAW,EAAE;QACjCO,MAAM,CAACuD,cAAc,EAAE;AACzB;AACF;AACF;AAGAc,EAAAA,SAASA,GAAA;AACP,IAAA,IAAI,CAAChE,cAAc,CAACyC,GAAG,CAAC,IAAI,CAAC;AAC/B;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"_menu-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/menu/menu.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 {KeyboardEventManager} from '../behaviors/event-manager';\nimport {computed, signal, SignalLike} from '../behaviors/signal-like/signal-like';\nimport {List, ListInputs, ListItem} from '../behaviors/list/list';\n\n/** The inputs for the MenuBarPattern class. */\nexport interface MenuBarInputs<V> extends ListInputs<MenuItemPattern<V>, V> {\n /** The menu items contained in the menu. */\n items: SignalLike<MenuItemPattern<V>[]>;\n\n /** Callback function triggered when a menu item is selected. */\n itemSelected?: (value: V) => void;\n\n /** The text direction of the menu bar. */\n textDirection: SignalLike<'ltr' | 'rtl'>;\n}\n\n/** The inputs for the MenuPattern class. */\nexport interface MenuInputs<V> extends Omit<ListInputs<MenuItemPattern<V>, V>, 'values'> {\n /** The unique ID of the menu. */\n id: SignalLike<string>;\n\n /** The menu items contained in the menu. */\n items: SignalLike<MenuItemPattern<V>[]>;\n\n /** A reference to the parent menu or menu trigger. */\n parent: SignalLike<MenuTriggerPattern<V> | MenuItemPattern<V> | undefined>;\n\n /** Callback function triggered when a menu item is selected. */\n itemSelected?: (value: V) => void;\n\n /** The text direction of the menu bar. */\n textDirection: SignalLike<'ltr' | 'rtl'>;\n\n /** The delay in milliseconds before expanding sub-menus on hover. */\n expansionDelay: SignalLike<number>;\n}\n\n/** The inputs for the MenuTriggerPattern class. */\nexport interface MenuTriggerInputs<V> {\n /** A reference to the menu trigger element. */\n element: SignalLike<HTMLElement | undefined>;\n\n /** A reference to the menu associated with the trigger. */\n menu: SignalLike<MenuPattern<V> | undefined>;\n\n /** The text direction of the menu bar. */\n textDirection: SignalLike<'ltr' | 'rtl'>;\n\n /** Whether the menu trigger is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** The inputs for the MenuItemPattern class. */\nexport interface MenuItemInputs<V> extends Omit<ListItem<V>, 'index' | 'selectable'> {\n /** A reference to the parent menu or menu trigger. */\n parent: SignalLike<MenuPattern<V> | MenuBarPattern<V> | undefined>;\n\n /** A reference to the submenu associated with the menu item. */\n submenu: SignalLike<MenuPattern<V> | undefined>;\n}\n\n/** The menu ui pattern class. */\nexport class MenuPattern<V> {\n /** The unique ID of the menu. */\n id: SignalLike<string>;\n\n /** The role of the menu. */\n role = () => 'menu';\n\n /** Whether the menu is disabled. */\n disabled = () => this.inputs.disabled();\n\n /** Whether the menu is visible. */\n visible = computed(() => (this.inputs.parent() ? !!this.inputs.parent()?.expanded() : true));\n\n /** Controls list behavior for the menu items. */\n listBehavior: List<MenuItemPattern<V>, V>;\n\n /** Whether the menu or any of its child elements are currently focused. */\n isFocused = signal(false);\n\n /** Whether the menu has received focus. */\n hasBeenFocused = signal(false);\n\n /** Whether the menu trigger has been hovered. */\n hasBeenHovered = signal(false);\n\n /** Timeout used to open sub-menus on hover. */\n _openTimeout: any;\n\n /** Timeout used to close sub-menus on hover out. */\n _closeTimeout: any;\n\n /** The tab index of the menu. */\n tabIndex = () => this.listBehavior.tabIndex();\n\n /** Whether the menu should be focused on mouse over. */\n shouldFocus = computed(() => {\n const root = this.root();\n\n if (root instanceof MenuTriggerPattern) {\n return true;\n }\n\n if (root instanceof MenuBarPattern || root instanceof MenuPattern) {\n return root.isFocused();\n }\n\n return false;\n });\n\n /** The key used to expand sub-menus. */\n private _expandKey = computed(() => {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The key used to collapse sub-menus. */\n private _collapseKey = computed(() => {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** Represents the space key. Does nothing when the user is actively using typeahead. */\n dynamicSpaceKey = computed(() => (this.listBehavior.isTyping() ? '' : ' '));\n\n /** The regexp used to decide if a key should trigger typeahead. */\n typeaheadRegexp = /^.$/;\n\n /** The root of the menu. */\n root: SignalLike<MenuTriggerPattern<V> | MenuBarPattern<V> | MenuPattern<V> | undefined> =\n computed(() => {\n const parent = this.inputs.parent();\n\n if (!parent) {\n return this;\n }\n\n if (parent instanceof MenuTriggerPattern) {\n return parent;\n }\n\n const grandparent = parent.inputs.parent();\n\n if (grandparent instanceof MenuBarPattern) {\n return grandparent;\n }\n\n return grandparent?.root();\n });\n\n /** Handles keyboard events for the menu. */\n keydownManager = computed(() => {\n return new KeyboardEventManager()\n .on('ArrowDown', () => this.next())\n .on('ArrowUp', () => this.prev())\n .on('Home', () => this.first())\n .on('End', () => this.last())\n .on('Enter', () => this.trigger())\n .on('Escape', () => this.closeAll())\n .on(this._expandKey, () => this.expand())\n .on(this._collapseKey, () => this.collapse())\n .on(this.dynamicSpaceKey, () => this.trigger())\n .on(this.typeaheadRegexp, e => this.listBehavior.search(e.key));\n });\n\n constructor(readonly inputs: MenuInputs<V>) {\n this.id = inputs.id;\n this.listBehavior = new List<MenuItemPattern<V>, V>({\n ...inputs,\n values: signal([]),\n });\n }\n\n /** Sets the default state for the menu. */\n setDefaultState() {\n if (!this.inputs.parent()) {\n this.listBehavior.goto(this.inputs.items()[0], {focusElement: false});\n }\n }\n\n /** Handles keyboard events for the menu. */\n onKeydown(event: KeyboardEvent) {\n this.keydownManager().handle(event);\n }\n\n /** Handles mouseover events for the menu. */\n onMouseOver(event: MouseEvent) {\n if (!this.visible()) {\n return;\n }\n\n this.hasBeenHovered.set(true);\n const item = this.inputs.items().find(i => i.element()?.contains(event.target as Node));\n\n if (!item) {\n return;\n }\n\n const parent = this.inputs.parent();\n const activeItem = this?.inputs.activeItem();\n\n if (parent instanceof MenuItemPattern) {\n const grandparent = parent.inputs.parent();\n if (grandparent instanceof MenuPattern) {\n grandparent._clearTimeouts();\n grandparent.listBehavior.goto(parent, {focusElement: false});\n }\n }\n\n if (activeItem && activeItem !== item) {\n this._closeItem(activeItem);\n }\n\n if (item.expanded()) {\n this._clearCloseTimeout();\n }\n\n this._openItem(item);\n this.listBehavior.goto(item, {focusElement: this.shouldFocus()});\n }\n\n /** Closes the specified menu item after a delay. */\n private _closeItem(item: MenuItemPattern<V>) {\n this._clearOpenTimeout();\n\n if (!this._closeTimeout) {\n this._closeTimeout = setTimeout(() => {\n item.close();\n this._closeTimeout = undefined;\n }, this.inputs.expansionDelay());\n }\n }\n\n /** Opens the specified menu item after a delay. */\n private _openItem(item: MenuItemPattern<V>) {\n this._clearOpenTimeout();\n\n this._openTimeout = setTimeout(() => {\n item.open();\n this._openTimeout = undefined;\n }, this.inputs.expansionDelay());\n }\n\n /** Handles mouseout events for the menu. */\n onMouseOut(event: MouseEvent) {\n this._clearOpenTimeout();\n\n if (this.isFocused()) {\n return;\n }\n\n const root = this.root();\n const parent = this.inputs.parent();\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (!root || !parent || parent instanceof MenuTriggerPattern) {\n return;\n }\n\n const grandparent = parent.inputs.parent();\n\n if (!grandparent || grandparent instanceof MenuBarPattern) {\n return;\n }\n\n if (!grandparent.inputs.element()?.contains(relatedTarget)) {\n parent.close();\n }\n }\n\n /** Handles click events for the menu. */\n onClick(event: MouseEvent) {\n const relatedTarget = event.target as Node | null;\n const item = this.inputs.items().find(i => i.element()?.contains(relatedTarget));\n\n if (item) {\n item.open();\n this.listBehavior.goto(item);\n this.submit(item);\n }\n }\n\n /** Handles focusin events for the menu. */\n onFocusIn() {\n this.isFocused.set(true);\n this.hasBeenFocused.set(true);\n }\n\n /** Handles the focusout event for the menu. */\n onFocusOut(event: FocusEvent) {\n const parent = this.inputs.parent();\n const parentEl = parent?.inputs.element();\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (!relatedTarget) {\n this.isFocused.set(false);\n this.inputs.parent()?.close({refocus: true});\n }\n\n if (parent instanceof MenuItemPattern) {\n const grandparent = parent.inputs.parent();\n const siblings = grandparent?.inputs.items().filter(i => i !== parent);\n const item = siblings?.find(i => i.element()?.contains(relatedTarget));\n\n if (item) {\n return;\n }\n }\n\n if (\n this.visible() &&\n !parentEl?.contains(relatedTarget) &&\n !this.inputs.element()?.contains(relatedTarget)\n ) {\n this.isFocused.set(false);\n this.inputs.parent()?.close();\n }\n }\n\n /** Focuses the previous menu item. */\n prev() {\n this.inputs.activeItem()?.close();\n this.listBehavior.prev();\n }\n\n /** Focuses the next menu item. */\n next() {\n this.inputs.activeItem()?.close();\n this.listBehavior.next();\n }\n\n /** Focuses the first menu item. */\n first() {\n this.inputs.activeItem()?.close();\n this.listBehavior.first();\n }\n\n /** Focuses the last menu item. */\n last() {\n this.inputs.activeItem()?.close();\n this.listBehavior.last();\n }\n\n /** Triggers the active menu item. */\n trigger() {\n this.inputs.activeItem()?.hasPopup()\n ? this.inputs.activeItem()?.open({first: true})\n : this.submit();\n }\n\n /** Submits the menu. */\n submit(item = this.inputs.activeItem()) {\n const root = this.root();\n\n if (item && !item.disabled()) {\n const isMenu = root instanceof MenuPattern;\n const isMenuBar = root instanceof MenuBarPattern;\n const isMenuTrigger = root instanceof MenuTriggerPattern;\n\n if (!item.submenu() && isMenuTrigger) {\n root.close({refocus: true});\n }\n\n if (!item.submenu() && isMenuBar) {\n root.close();\n root?.inputs.itemSelected?.(item.value());\n }\n\n if (!item.submenu() && isMenu) {\n root.inputs.activeItem()?.close({refocus: true});\n root?.inputs.itemSelected?.(item.value());\n }\n }\n }\n\n /** Collapses the current menu or focuses the previous item in the menubar. */\n collapse() {\n const root = this.root();\n const parent = this.inputs.parent();\n\n if (parent instanceof MenuItemPattern && !(parent.inputs.parent() instanceof MenuBarPattern)) {\n parent.close({refocus: true});\n } else if (root instanceof MenuBarPattern) {\n root.prev();\n }\n }\n\n /** Expands the current menu or focuses the next item in the menubar. */\n expand() {\n const root = this.root();\n const activeItem = this.inputs.activeItem();\n\n if (activeItem?.submenu()) {\n activeItem.open({first: true});\n } else if (root instanceof MenuBarPattern) {\n root.next();\n }\n }\n\n /** Closes the menu. */\n close() {\n this.inputs.parent()?.close();\n }\n\n /** Closes the menu and all parent menus. */\n closeAll() {\n const root = this.root();\n\n if (root instanceof MenuTriggerPattern) {\n root.close({refocus: true});\n }\n\n if (root instanceof MenuBarPattern) {\n root.close();\n }\n\n if (root instanceof MenuPattern) {\n root.inputs.activeItem()?.close({refocus: true});\n }\n }\n\n /** Clears any open or close timeouts for sub-menus. */\n _clearTimeouts() {\n this._clearOpenTimeout();\n this._clearCloseTimeout();\n }\n\n /** Clears the open timeout. */\n _clearOpenTimeout() {\n if (this._openTimeout) {\n clearTimeout(this._openTimeout);\n this._openTimeout = undefined;\n }\n }\n\n /** Clears the close timeout. */\n _clearCloseTimeout() {\n if (this._closeTimeout) {\n clearTimeout(this._closeTimeout);\n this._closeTimeout = undefined;\n }\n }\n}\n\n/** The menubar ui pattern class. */\nexport class MenuBarPattern<V> {\n /** Controls list behavior for the menu items. */\n listBehavior: List<MenuItemPattern<V>, V>;\n\n /** The tab index of the menu. */\n tabIndex = () => this.listBehavior.tabIndex();\n\n /** The key used to navigate to the next item. */\n private _nextKey = computed(() => {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The key used to navigate to the previous item. */\n private _previousKey = computed(() => {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** Represents the space key. Does nothing when the user is actively using typeahead. */\n dynamicSpaceKey = computed(() => (this.listBehavior.isTyping() ? '' : ' '));\n\n /** The regexp used to decide if a key should trigger typeahead. */\n typeaheadRegexp = /^.$/;\n\n /** Whether the menubar or any of its children are currently focused. */\n isFocused = signal(false);\n\n /** Whether the menubar has been focused. */\n hasBeenFocused = signal(false);\n\n /** Whether the menubar is disabled. */\n disabled = () => this.inputs.disabled();\n\n /** Handles keyboard events for the menu. */\n keydownManager = computed(() => {\n return new KeyboardEventManager()\n .on(this._nextKey, () => this.next())\n .on(this._previousKey, () => this.prev())\n .on('End', () => this.listBehavior.last())\n .on('Home', () => this.listBehavior.first())\n .on('Enter', () => this.inputs.activeItem()?.open({first: true}))\n .on('ArrowUp', () => this.inputs.activeItem()?.open({last: true}))\n .on('ArrowDown', () => this.inputs.activeItem()?.open({first: true}))\n .on(this.dynamicSpaceKey, () => this.inputs.activeItem()?.open({first: true}))\n .on(this.typeaheadRegexp, e => this.listBehavior.search(e.key));\n });\n\n constructor(readonly inputs: MenuBarInputs<V>) {\n this.listBehavior = new List<MenuItemPattern<V>, V>(inputs);\n }\n\n /** Sets the default state for the menubar. */\n setDefaultState() {\n this.inputs.activeItem.set(this.inputs.items()[0]);\n }\n\n /** Handles keyboard events for the menu. */\n onKeydown(event: KeyboardEvent) {\n this.keydownManager().handle(event);\n }\n\n /** Handles click events for the menu bar. */\n onClick(event: MouseEvent) {\n const item = this.inputs.items().find(i => i.element()?.contains(event.target as Node));\n\n if (!item) {\n return;\n }\n\n this.goto(item);\n item.expanded() ? item.close() : item.open();\n }\n\n /** Handles mouseover events for the menu bar. */\n onMouseOver(event: MouseEvent) {\n const item = this.inputs.items().find(i => i.element()?.contains(event.target as Node));\n\n if (item) {\n this.goto(item, {focusElement: this.isFocused()});\n }\n }\n\n /** Handles focusin events for the menu bar. */\n onFocusIn() {\n this.isFocused.set(true);\n this.hasBeenFocused.set(true);\n }\n\n /** Handles focusout events for the menu bar. */\n onFocusOut(event: FocusEvent) {\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (!this.inputs.element()?.contains(relatedTarget)) {\n this.isFocused.set(false);\n this.close();\n }\n }\n\n /** Goes to and optionally focuses the specified menu item. */\n goto(item: MenuItemPattern<V>, opts?: {focusElement?: boolean}) {\n const prevItem = this.inputs.activeItem();\n this.listBehavior.goto(item, opts);\n\n if (prevItem?.expanded()) {\n prevItem?.close();\n this.inputs.activeItem()?.open();\n }\n\n if (item === prevItem) {\n if (item.expanded() && item.submenu()?.inputs.activeItem()) {\n item.submenu()?.inputs.activeItem()?.close();\n item.submenu()?.listBehavior.unfocus();\n }\n }\n }\n\n /** Focuses the next menu item. */\n next() {\n const prevItem = this.inputs.activeItem();\n this.listBehavior.next();\n\n if (prevItem?.expanded()) {\n prevItem?.close();\n this.inputs.activeItem()?.open({first: true});\n }\n }\n\n /** Focuses the previous menu item. */\n prev() {\n const prevItem = this.inputs.activeItem();\n this.listBehavior.prev();\n\n if (prevItem?.expanded()) {\n prevItem?.close();\n this.inputs.activeItem()?.open({first: true});\n }\n }\n\n /** Closes the menubar and refocuses the root menu bar item. */\n close() {\n this.inputs.activeItem()?.close({refocus: this.isFocused()});\n }\n}\n\n/** The menu trigger ui pattern class. */\nexport class MenuTriggerPattern<V> {\n /** Whether the menu is expanded. */\n expanded = signal(false);\n\n /** Whether the menu trigger has received focus. */\n hasBeenFocused = signal(false);\n\n /** The role of the menu trigger. */\n role = () => 'button';\n\n /** Whether the menu trigger has a popup. */\n hasPopup = () => true;\n\n /** The menu associated with the trigger. */\n menu: SignalLike<MenuPattern<V> | undefined>;\n\n /** The tab index of the menu trigger. */\n tabIndex = computed(() => (this.expanded() && this.menu()?.inputs.activeItem() ? -1 : 0));\n\n /** Whether the menu trigger is disabled. */\n disabled = () => this.inputs.disabled();\n\n /** Handles keyboard events for the menu trigger. */\n keydownManager = computed(() => {\n return new KeyboardEventManager()\n .on(' ', () => this.open({first: true}))\n .on('Enter', () => this.open({first: true}))\n .on('ArrowDown', () => this.open({first: true}))\n .on('ArrowUp', () => this.open({last: true}))\n .on('Escape', () => this.close({refocus: true}));\n });\n\n constructor(readonly inputs: MenuTriggerInputs<V>) {\n this.menu = this.inputs.menu;\n }\n\n /** Handles keyboard events for the menu trigger. */\n onKeydown(event: KeyboardEvent) {\n if (!this.inputs.disabled()) {\n this.keydownManager().handle(event);\n }\n }\n\n /** Handles click events for the menu trigger. */\n onClick() {\n if (!this.inputs.disabled()) {\n this.expanded() ? this.close() : this.open({first: true});\n }\n }\n\n /** Handles focusin events for the menu trigger. */\n onFocusIn() {\n this.hasBeenFocused.set(true);\n }\n\n /** Handles focusout events for the menu trigger. */\n onFocusOut(event: FocusEvent) {\n const element = this.inputs.element();\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (\n this.expanded() &&\n !element?.contains(relatedTarget) &&\n !this.inputs.menu()?.inputs.element()?.contains(relatedTarget)\n ) {\n this.close();\n }\n }\n\n /** Opens the menu. */\n open(opts?: {first?: boolean; last?: boolean}) {\n this.expanded.set(true);\n\n if (opts?.first) {\n this.inputs.menu()?.first();\n } else if (opts?.last) {\n this.inputs.menu()?.last();\n }\n }\n\n /** Closes the menu. */\n close(opts: {refocus?: boolean} = {}) {\n this.expanded.set(false);\n this.menu()?.listBehavior.unfocus();\n\n if (opts.refocus) {\n this.inputs.element()?.focus();\n }\n\n let menuitems = this.inputs.menu()?.inputs.items() ?? [];\n\n while (menuitems.length) {\n const menuitem = menuitems.pop();\n menuitem?._expanded.set(false);\n menuitem?.inputs.parent()?.listBehavior.unfocus();\n menuitems = menuitems.concat(menuitem?.submenu()?.inputs.items() ?? []);\n }\n }\n}\n\n/** The menu item ui pattern class. */\nexport class MenuItemPattern<V> implements ListItem<V> {\n /** The value of the menu item. */\n value: SignalLike<V>;\n\n /** The unique ID of the menu item. */\n id: SignalLike<string>;\n\n /** Whether the menu item is disabled. */\n disabled = () => this.inputs.parent()?.disabled() || this.inputs.disabled();\n\n /** The search term for the menu item. */\n searchTerm: SignalLike<string>;\n\n /** The element of the menu item. */\n element: SignalLike<HTMLElement | undefined>;\n\n /** Whether the menu item is active. */\n active = computed(() => this.inputs.parent()?.inputs.activeItem() === this);\n\n /** Whether the menu item has received focus. */\n hasBeenFocused = signal(false);\n\n /** The tab index of the menu item. */\n tabIndex = computed(() => {\n if (this.submenu() && this.submenu()?.inputs.activeItem()) {\n return -1;\n }\n return this.inputs.parent()?.listBehavior.getItemTabindex(this) ?? -1;\n });\n\n /** The position of the menu item in the menu. */\n index = computed(() => this.inputs.parent()?.inputs.items().indexOf(this) ?? -1);\n\n /** Whether the menu item is expanded. */\n expanded = computed(() => (this.submenu() ? this._expanded() : null));\n\n /** Whether the menu item is expanded. */\n _expanded = signal(false);\n\n /** The ID of the menu that the menu item controls. */\n controls = signal<string | undefined>(undefined);\n\n /** The role of the menu item. */\n role = () => 'menuitem';\n\n /** Whether the menu item has a popup. */\n hasPopup = computed(() => !!this.submenu());\n\n /** The submenu associated with the menu item. */\n submenu: SignalLike<MenuPattern<V> | undefined>;\n\n /** Whether the menu item is selectable. */\n selectable: SignalLike<boolean>;\n\n constructor(readonly inputs: MenuItemInputs<V>) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.element = inputs.element;\n this.submenu = this.inputs.submenu;\n this.searchTerm = inputs.searchTerm;\n this.selectable = computed(() => !this.submenu());\n }\n\n /** Opens the submenu. */\n open(opts?: {first?: boolean; last?: boolean}) {\n if (this.disabled()) {\n return;\n }\n\n this._expanded.set(true);\n\n if (opts?.first) {\n this.submenu()?.first();\n }\n if (opts?.last) {\n this.submenu()?.last();\n }\n }\n\n /** Closes the submenu. */\n close(opts: {refocus?: boolean} = {}) {\n this._expanded.set(false);\n\n if (opts.refocus) {\n this.inputs.parent()?.listBehavior.goto(this);\n }\n\n let menuitems = this.inputs.submenu()?.inputs.items() ?? [];\n\n while (menuitems.length) {\n const menuitem = menuitems.pop();\n menuitem?._expanded.set(false);\n menuitem?.inputs.parent()?.listBehavior.unfocus();\n menuitems = menuitems.concat(menuitem?.submenu()?.inputs.items() ?? []);\n\n const parent = menuitem?.inputs.parent();\n\n if (parent instanceof MenuPattern) {\n parent._clearTimeouts();\n }\n }\n }\n\n /** Handles focusin events for the menu item. */\n onFocusIn() {\n this.hasBeenFocused.set(true);\n }\n}\n"],"names":["MenuPattern","inputs","id","role","disabled","visible","computed","parent","expanded","listBehavior","isFocused","signal","hasBeenFocused","hasBeenHovered","_openTimeout","_closeTimeout","tabIndex","shouldFocus","root","MenuTriggerPattern","MenuBarPattern","_expandKey","textDirection","_collapseKey","dynamicSpaceKey","isTyping","typeaheadRegexp","grandparent","keydownManager","KeyboardEventManager","on","next","prev","first","last","trigger","closeAll","expand","collapse","e","search","key","constructor","List","values","setDefaultState","goto","items","focusElement","onKeydown","event","handle","onMouseOver","set","item","find","i","element","contains","target","activeItem","MenuItemPattern","_clearTimeouts","_closeItem","_clearCloseTimeout","_openItem","_clearOpenTimeout","setTimeout","close","undefined","expansionDelay","open","onMouseOut","relatedTarget","onClick","submit","onFocusIn","onFocusOut","parentEl","refocus","siblings","filter","hasPopup","isMenu","isMenuBar","isMenuTrigger","submenu","itemSelected","value","clearTimeout","_nextKey","_previousKey","opts","prevItem","unfocus","menu","focus","menuitems","length","menuitem","pop","_expanded","concat","searchTerm","active","getItemTabindex","index","indexOf","controls","selectable"],"mappings":";;;MAsEaA,WAAW,CAAA;EAsGDC,MAAA;EApGrBC,EAAE;EAGFC,IAAI,GAAGA,MAAM,MAAM;EAGnBC,QAAQ,GAAGA,MAAM,IAAI,CAACH,MAAM,CAACG,QAAQ,EAAE;EAGvCC,OAAO,GAAGC,QAAQ,CAAC,MAAO,IAAI,CAACL,MAAM,CAACM,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,CAACN,MAAM,CAACM,MAAM,EAAE,EAAEC,QAAQ,EAAE,GAAG,IAAK,CAAC;EAG5FC,YAAY;AAGZC,EAAAA,SAAS,GAAGC,MAAM,CAAC,KAAK,CAAC;AAGzBC,EAAAA,cAAc,GAAGD,MAAM,CAAC,KAAK,CAAC;AAG9BE,EAAAA,cAAc,GAAGF,MAAM,CAAC,KAAK,CAAC;EAG9BG,YAAY;EAGZC,aAAa;EAGbC,QAAQ,GAAGA,MAAM,IAAI,CAACP,YAAY,CAACO,QAAQ,EAAE;EAG7CC,WAAW,GAAGX,QAAQ,CAAC,MAAK;AAC1B,IAAA,MAAMY,IAAI,GAAG,IAAI,CAACA,IAAI,EAAE;IAExB,IAAIA,IAAI,YAAYC,kBAAkB,EAAE;AACtC,MAAA,OAAO,IAAI;AACb;AAEA,IAAA,IAAID,IAAI,YAAYE,cAAc,IAAIF,IAAI,YAAYlB,WAAW,EAAE;AACjE,MAAA,OAAOkB,IAAI,CAACR,SAAS,EAAE;AACzB;AAEA,IAAA,OAAO,KAAK;AACd,GAAC,CAAC;EAGMW,UAAU,GAAGf,QAAQ,CAAC,MAAK;AACjC,IAAA,OAAO,IAAI,CAACL,MAAM,CAACqB,aAAa,EAAE,KAAK,KAAK,GAAG,WAAW,GAAG,YAAY;AAC3E,GAAC,CAAC;EAGMC,YAAY,GAAGjB,QAAQ,CAAC,MAAK;AACnC,IAAA,OAAO,IAAI,CAACL,MA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