@angular/aria 22.0.0-next.0 → 22.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/fesm2022/_accordion-chunk.mjs +24 -18
  2. package/fesm2022/_accordion-chunk.mjs.map +1 -1
  3. package/fesm2022/_combobox-chunk.mjs.map +1 -1
  4. package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -1
  5. package/fesm2022/_combobox-tree-chunk.mjs.map +1 -1
  6. package/fesm2022/_deferred-content-chunk.mjs.map +1 -1
  7. package/fesm2022/_expansion-chunk.mjs.map +1 -1
  8. package/fesm2022/_list-chunk.mjs.map +1 -1
  9. package/fesm2022/_list-navigation-chunk.mjs.map +1 -1
  10. package/fesm2022/_list-typeahead-chunk.mjs.map +1 -1
  11. package/fesm2022/_menu-chunk.mjs.map +1 -1
  12. package/fesm2022/_pointer-event-manager-chunk.mjs.map +1 -1
  13. package/fesm2022/_signal-like-chunk.mjs.map +1 -1
  14. package/fesm2022/_tabs-chunk.mjs.map +1 -1
  15. package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
  16. package/fesm2022/_widget-chunk.mjs.map +1 -1
  17. package/fesm2022/accordion.mjs +44 -111
  18. package/fesm2022/accordion.mjs.map +1 -1
  19. package/fesm2022/aria.mjs +1 -1
  20. package/fesm2022/aria.mjs.map +1 -1
  21. package/fesm2022/combobox.mjs.map +1 -1
  22. package/fesm2022/grid.mjs.map +1 -1
  23. package/fesm2022/listbox.mjs.map +1 -1
  24. package/fesm2022/menu.mjs.map +1 -1
  25. package/fesm2022/private.mjs +1 -1
  26. package/fesm2022/tabs.mjs.map +1 -1
  27. package/fesm2022/toolbar.mjs.map +1 -1
  28. package/fesm2022/tree.mjs.map +1 -1
  29. package/package.json +2 -2
  30. package/resources/code-examples.db +0 -0
  31. package/types/_accordion-chunk.d.ts +11 -31
  32. package/types/_list-navigation-chunk.d.ts +0 -2
  33. package/types/accordion.d.ts +31 -35
  34. package/types/private.d.ts +1 -1
@@ -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 /** The text direction of the tree. */\n textDirection: SignalLike<'ltr' | 'rtl'>;\n}\n\n/** Controls the state and interactions of a tree view. */\nexport class TreePattern<V> implements TreeInputs<V> {\n /** The tree behavior for the tree. */\n readonly treeBehavior: Tree<TreeItemPattern<V>, V>;\n\n /** The root level is 0. */\n readonly level = () => 0;\n\n /** The root is always expanded. */\n readonly expanded = () => true;\n\n /** The root is always visible. */\n readonly visible = () => true;\n\n /** The tab index of the tree. */\n readonly tabIndex: SignalLike<-1 | 0> = computed(() => this.treeBehavior.tabIndex());\n\n /** The id of the current active item. */\n readonly activeDescendant = computed(() => this.treeBehavior.activeDescendant());\n\n /** The direct children of the root (top-level tree items). */\n readonly children = computed(() =>\n this.inputs.items().filter(item => item.level() === this.level() + 1),\n );\n\n /** Whether the tree selection follows focus. */\n readonly followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** Whether the tree direction is RTL. */\n readonly isRtl = computed(() => this.inputs.textDirection() === 'rtl');\n\n /** The key for navigating to the previous item. */\n readonly prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.isRtl() ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key for navigating to the next item. */\n readonly nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.isRtl() ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The key for collapsing an item or moving to its parent. */\n readonly collapseKey = computed(() => {\n if (this.inputs.orientation() === 'horizontal') {\n return 'ArrowUp';\n }\n return this.isRtl() ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key for expanding an item or moving to its first child. */\n readonly expandKey = computed(() => {\n if (this.inputs.orientation() === 'horizontal') {\n return 'ArrowDown';\n }\n return this.isRtl() ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** Represents the space key. Does nothing when the user is actively using typeahead. */\n readonly dynamicSpaceKey = computed(() => (this.treeBehavior.isTyping() ? '' : ' '));\n\n /** Regular expression to match characters for typeahead. */\n readonly typeaheadRegexp = /^.$/;\n\n /** The keydown event manager for the tree. */\n readonly keydown = computed(() => {\n const manager = new KeyboardEventManager();\n const tree = this.treeBehavior;\n\n manager\n .on(this.prevKey, () => tree.prev({selectOne: this.followFocus()}), {ignoreRepeat: false})\n .on(this.nextKey, () => tree.next({selectOne: this.followFocus()}), {ignoreRepeat: false})\n .on('Home', () => tree.first({selectOne: this.followFocus()}))\n .on('End', () => tree.last({selectOne: this.followFocus()}))\n .on(this.typeaheadRegexp, e => tree.search(e.key, {selectOne: this.followFocus()}))\n .on(Modifier.Shift, '*', () => tree.expandSiblings())\n .on(this.expandKey, () => this._expandOrFirstChild({selectOne: this.followFocus()}))\n .on(this.collapseKey, () => this._collapseOrParent({selectOne: this.followFocus()}));\n\n if (this.inputs.multi()) {\n manager\n // TODO: Tracking the anchor by index can break if the\n // tree is expanded or collapsed causing the index to change.\n .on(Modifier.Any, 'Shift', () => tree.anchor(this.treeBehavior.activeIndex()))\n .on(Modifier.Shift, this.prevKey, () => tree.prev({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on(Modifier.Shift, this.nextKey, () => tree.next({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () =>\n tree.first({selectRange: true, anchor: false}),\n )\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () =>\n tree.last({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, 'Enter', () => tree.updateSelection({selectRange: true, anchor: false}))\n .on(Modifier.Shift, this.dynamicSpaceKey, () =>\n tree.updateSelection({selectRange: true, anchor: false}),\n );\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager\n .on(this.dynamicSpaceKey, () => tree.toggle())\n .on('Enter', () => tree.toggle(), {preventDefault: !this.nav()})\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => tree.toggleAll());\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => tree.selectOne());\n manager.on('Enter', () => tree.selectOne(), {preventDefault: !this.nav()});\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => tree.prev(), {ignoreRepeat: false})\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => tree.next(), {ignoreRepeat: false})\n .on([Modifier.Ctrl, Modifier.Meta], this.expandKey, () => this._expandOrFirstChild())\n .on([Modifier.Ctrl, Modifier.Meta], this.collapseKey, () => this._collapseOrParent())\n .on([Modifier.Ctrl, Modifier.Meta], ' ', () => tree.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => tree.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Home', () => tree.first())\n .on([Modifier.Ctrl, Modifier.Meta], 'End', () => tree.last())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => {\n tree.toggleAll();\n tree.select(); // Ensure the currect item remains selected.\n });\n }\n\n return manager;\n });\n\n /** The pointerdown event manager for the tree. */\n pointerdown = computed(() => {\n const manager = new PointerEventManager();\n\n if (this.multi()) {\n manager.on(Modifier.Shift, e => this.goto(e, {selectRange: true}));\n }\n\n if (!this.multi()) {\n return manager.on(e => this.goto(e, {selectOne: true}));\n }\n\n if (this.multi() && this.followFocus()) {\n return manager\n .on(e => this.goto(e, {selectOne: true}))\n .on(Modifier.Ctrl, e => this.goto(e, {toggle: true}));\n }\n\n if (this.multi() && !this.followFocus()) {\n return manager.on(e => this.goto(e, {toggle: true}));\n }\n\n return manager;\n });\n\n /** A unique identifier for the tree. */\n readonly id: SignalLike<string> = () => this.inputs.id();\n\n /** The host native element. */\n readonly element: SignalLike<HTMLElement> = () => this.inputs.element()!;\n\n /** Whether the tree is in navigation mode. */\n readonly nav: SignalLike<boolean> = () => this.inputs.nav();\n\n /** The aria-current type. */\n readonly currentType: SignalLike<\n 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'\n > = () => this.inputs.currentType();\n\n /** All items in the tree, in document order (DFS-like, a flattened list). */\n readonly items: SignalLike<TreeItemPattern<V>[]> = () => this.inputs.items();\n\n /** The focus strategy used by the tree. */\n readonly focusMode: SignalLike<'roving' | 'activedescendant'> = () => this.inputs.focusMode();\n\n /** Whether the tree is disabled. */\n readonly disabled: SignalLike<boolean> = () => this.inputs.disabled();\n\n /** The currently active item in the tree. */\n readonly activeItem: WritableSignalLike<TreeItemPattern<V> | undefined>;\n\n /** Whether disabled items should be focusable. */\n readonly softDisabled: SignalLike<boolean> = () => this.inputs.softDisabled();\n\n /** Whether the focus should wrap when navigating past the first or last item. */\n readonly wrap: SignalLike<boolean> = () => this.inputs.wrap();\n\n /** The orientation of the tree. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'> = () => this.inputs.orientation();\n\n /** The text direction of the tree. */\n readonly textDirection: SignalLike<'ltr' | 'rtl'> = () => this.textDirection();\n\n /** Whether multiple items can be selected at the same time. */\n readonly multi: SignalLike<boolean> = computed(() => (this.nav() ? false : this.inputs.multi()));\n\n /** The selection mode of the tree. */\n readonly selectionMode: SignalLike<'follow' | 'explicit'> = () => this.inputs.selectionMode();\n\n /** The delay in milliseconds to wait before clearing the typeahead buffer. */\n readonly typeaheadDelay: SignalLike<number> = () => this.inputs.typeaheadDelay();\n\n /** The current selected items of the tree. */\n readonly 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","ignoreRepeat","e","key","Modifier","Shift","_expandOrFirstChild","_collapseOrParent","multi","Any","Ctrl","Meta","preventDefault","pointerdown","PointerEventManager","focusMode","softDisabled","typeaheadDelay","multiExpandable","validate","violations","push","join","setDefaultState","firstItem","onKeydown","event","handle","onPointerdown","_getItem","target","HTMLElement","closest","find","ComboboxTreePattern","isItemCollapsible","role","activeId","getActiveItem","combobox","inputEl","_","focus","clearSelection","getItem","getSelectedItems","setValue","expandItem","collapseItem","isItemExpandable","isItemSelectable"],"mappings":";;;;;;AAsDA,MAAMA,aAA2C,SAAQC,SAAY,CAAA;EAC1DC,WAAWA,CAACC,IAAO,EAAA;IAC1B,OAAO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zC,WAAW,EAAE;EAGtD2G,OAAO,GAAI1C,CAAe,IAAK,IAAI,CAAC2B,QAAQ,CAAC3B,CAAC,CAAC;EAG/C2C,gBAAgB,GAAGA,MAAM,IAAI,CAAChK,MAAM,CAACkC,KAAK,EAAE,CAAC8B,MAAM,CAACnE,IAAI,IAAIA,IAAI,CAACiG,QAAQ,EAAE,CAAC;AAG5EmE,EAAAA,QAAQ,GAAIlF,KAAoB,IAAK,IAAI,CAAC/E,MAAM,CAACgG,MAAM,CAACtD,GAAG,CAACqC,KAAK,GAAG,CAACA,KAAK,CAAC,GAAG,EAAE,CAAC;AAGjFmF,EAAAA,UAAU,GAAGA,MAAM,IAAI,CAACzC,mBAAmB,EAAE;AAG7C0C,EAAAA,YAAY,GAAGA,MAAM,IAAI,CAACzC,iBAAiB,EAAE;EAG7C0C,gBAAgBA,CAACvK,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;EAGnD+F,gBAAgB,GAAGA,CAACxK,IAAA,GAAuC,IAAI,CAACG,MAAM,CAACiC,UAAU,EAAE,KAAI;IACrF,OAAOpC,IAAI,GAAGA,IAAI,CAACyF,UAAU,EAAE,GAAG,KAAK;GACxC;AACF;;;;"}
1
+ {"version":3,"file":"_combobox-tree-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/tree/tree.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/tree/tree.ts","../../../../../k8-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()}), {ignoreRepeat: false})\n .on(this.nextKey, () => tree.next({selectOne: this.followFocus()}), {ignoreRepeat: false})\n .on('Home', () => tree.first({selectOne: this.followFocus()}))\n .on('End', () => tree.last({selectOne: this.followFocus()}))\n .on(this.typeaheadRegexp, e => tree.search(e.key, {selectOne: this.followFocus()}))\n .on(Modifier.Shift, '*', () => tree.expandSiblings())\n .on(this.expandKey, () => this._expandOrFirstChild({selectOne: this.followFocus()}))\n .on(this.collapseKey, () => this._collapseOrParent({selectOne: this.followFocus()}));\n\n if (this.inputs.multi()) {\n manager\n // TODO: Tracking the anchor by index can break if the\n // tree is expanded or collapsed causing the index to change.\n .on(Modifier.Any, 'Shift', () => tree.anchor(this.treeBehavior.activeIndex()))\n .on(Modifier.Shift, this.prevKey, () => tree.prev({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on(Modifier.Shift, this.nextKey, () => tree.next({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () =>\n tree.first({selectRange: true, anchor: false}),\n )\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () =>\n tree.last({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, 'Enter', () => tree.updateSelection({selectRange: true, anchor: false}))\n .on(Modifier.Shift, this.dynamicSpaceKey, () =>\n tree.updateSelection({selectRange: true, anchor: false}),\n );\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager\n .on(this.dynamicSpaceKey, () => tree.toggle())\n .on('Enter', () => tree.toggle(), {preventDefault: !this.nav()})\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => tree.toggleAll());\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => tree.selectOne());\n manager.on('Enter', () => tree.selectOne(), {preventDefault: !this.nav()});\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => tree.prev(), {ignoreRepeat: false})\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => tree.next(), {ignoreRepeat: false})\n .on([Modifier.Ctrl, Modifier.Meta], this.expandKey, () => this._expandOrFirstChild())\n .on([Modifier.Ctrl, Modifier.Meta], this.collapseKey, () => this._collapseOrParent())\n .on([Modifier.Ctrl, Modifier.Meta], ' ', () => tree.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => tree.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Home', () => tree.first())\n .on([Modifier.Ctrl, Modifier.Meta], 'End', () => tree.last())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => {\n tree.toggleAll();\n tree.select(); // Ensure the currect item remains selected.\n });\n }\n\n return manager;\n });\n\n /** The pointerdown event manager for the tree. */\n pointerdown = computed(() => {\n const manager = new PointerEventManager();\n\n if (this.multi()) {\n manager.on(Modifier.Shift, e => this.goto(e, {selectRange: true}));\n }\n\n if (!this.multi()) {\n return manager.on(e => this.goto(e, {selectOne: true}));\n }\n\n if (this.multi() && this.followFocus()) {\n return manager\n .on(e => this.goto(e, {selectOne: true}))\n .on(Modifier.Ctrl, e => this.goto(e, {toggle: true}));\n }\n\n if (this.multi() && !this.followFocus()) {\n return manager.on(e => this.goto(e, {toggle: true}));\n }\n\n return manager;\n });\n\n /** A unique identifier for the tree. */\n readonly id: SignalLike<string> = () => this.inputs.id();\n\n /** The host native element. */\n readonly element: SignalLike<HTMLElement> = () => this.inputs.element()!;\n\n /** Whether the tree is in navigation mode. */\n readonly nav: SignalLike<boolean> = () => this.inputs.nav();\n\n /** The aria-current type. */\n readonly currentType: SignalLike<\n 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'\n > = () => this.inputs.currentType();\n\n /** All items in the tree, in document order (DFS-like, a flattened list). */\n readonly items: SignalLike<TreeItemPattern<V>[]> = () => this.inputs.items();\n\n /** The focus strategy used by the tree. */\n readonly focusMode: SignalLike<'roving' | 'activedescendant'> = () => this.inputs.focusMode();\n\n /** Whether the tree is disabled. */\n readonly disabled: SignalLike<boolean> = () => this.inputs.disabled();\n\n /** The currently active item in the tree. */\n readonly activeItem: WritableSignalLike<TreeItemPattern<V> | undefined>;\n\n /** Whether disabled items should be focusable. */\n readonly softDisabled: SignalLike<boolean> = () => this.inputs.softDisabled();\n\n /** Whether the focus should wrap when navigating past the first or last item. */\n readonly wrap: SignalLike<boolean> = () => this.inputs.wrap();\n\n /** The orientation of the tree. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'> = () => this.inputs.orientation();\n\n /** The text direction of the tree. */\n readonly textDirection: SignalLike<'ltr' | 'rtl'> = () => this.textDirection();\n\n /** Whether multiple items can be selected at the same time. */\n readonly multi: SignalLike<boolean> = computed(() => (this.nav() ? false : this.inputs.multi()));\n\n /** The selection mode of the tree. */\n readonly selectionMode: SignalLike<'follow' | 'explicit'> = () => this.inputs.selectionMode();\n\n /** The delay in milliseconds to wait before clearing the typeahead buffer. */\n readonly typeaheadDelay: SignalLike<number> = () => this.inputs.typeaheadDelay();\n\n /** The current selected items of the tree. */\n readonly 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","ignoreRepeat","e","key","Modifier","Shift","_expandOrFirstChild","_collapseOrParent","multi","Any","Ctrl","Meta","preventDefault","pointerdown","PointerEventManager","focusMode","softDisabled","typeaheadDelay","multiExpandable","validate","violations","push","join","setDefaultState","firstItem","onKeydown","event","handle","onPointerdown","_getItem","target","HTMLElement","closest","find","ComboboxTreePattern","isItemCollapsible","role","activeId","getActiveItem","combobox","inputEl","_","focus","clearSelection","getItem","getSelectedItems","setValue","expandItem","collapseItem","isItemExpandable","isItemSelectable"],"mappings":";;;;;;AAsDA,MAAMA,aAA2C,SAAQC,SAAY,CAAA;EAC1DC,WAAWA,CAACC,IAAO,EAAA;IAC1B,OAAO,KAAK,CAACD,WAAW,CAACC,IAAI,CAAC,IAAIA,IAAI,CAACC,OAAO,EAAE;AAClD;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,CAAC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AAK,GAAG,CAACA,KAAK,CAAC,GAAG,EAAE,CAAC;AAGjFmF,EAAAA,UAAU,GAAGA,MAAM,IAAI,CAACzC,mBAAmB,EAAE;AAG7C0C,EAAAA,YAAY,GAAGA,MAAM,IAAI,CAACzC,iBAAiB,EAAE;EAG7C0C,gBAAgBA,CAACvK,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;EAGnD+F,gBAAgB,GAAGA,CAACxK,IAAA,GAAuC,IAAI,CAACG,MAAM,CAACiC,UAAU,EAAE,KAAI;IACrF,OAAOpC,IAAI,GAAGA,IAAI,CAACyF,UAAU,EAAE,GAAG,KAAK;GACxC;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"_deferred-content-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/deferred-content/deferred-content.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n afterRenderEffect,\n Directive,\n inject,\n TemplateRef,\n signal,\n ViewContainerRef,\n model,\n EmbeddedViewRef,\n OnDestroy,\n} from '@angular/core';\n\n/**\n * A container directive controls the visibility of its content.\n */\n@Directive()\nexport class DeferredContentAware {\n readonly contentVisible = signal(false);\n readonly preserveContent = model(false);\n}\n\n/**\n * DeferredContent loads/unloads the content based on the visibility.\n * The visibilty signal is sent from a parent directive implements\n * DeferredContentAware.\n *\n * Use this directive as a host directive. For example:\n *\n * ```ts\n * @Directive({\n * selector: 'ng-template[AccordionContent]',\n * hostDirectives: [DeferredContent],\n * })\n * class AccordionContent {}\n * ```\n */\n@Directive()\nexport class DeferredContent implements OnDestroy {\n private readonly _deferredContentAware = inject(DeferredContentAware, {optional: true});\n private readonly _templateRef = inject(TemplateRef);\n private readonly _viewContainerRef = inject(ViewContainerRef);\n private _currentViewRef: EmbeddedViewRef<unknown> | null = null;\n private _isRendered = false;\n\n readonly deferredContentAware = signal(this._deferredContentAware);\n\n constructor() {\n afterRenderEffect(() => {\n if (this.deferredContentAware()?.contentVisible()) {\n if (!this._isRendered) {\n this._destroyContent();\n this._currentViewRef = this._viewContainerRef.createEmbeddedView(this._templateRef);\n this._isRendered = true;\n }\n } else if (!this.deferredContentAware()?.preserveContent()) {\n this._destroyContent();\n this._isRendered = false;\n }\n });\n }\n\n ngOnDestroy(): void {\n this._destroyContent();\n }\n\n private _destroyContent() {\n const ref = this._currentViewRef;\n\n if (ref && !ref.destroyed) {\n ref.destroy();\n this._currentViewRef = null;\n }\n }\n}\n"],"names":["DeferredContentAware","contentVisible","signal","preserveContent","model","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","ngImport","decorators","DeferredContent","_deferredContentAware","inject","optional","_templateRef","TemplateRef","_viewContainerRef","ViewContainerRef","_currentViewRef","_isRendered","deferredContentAware","constructor","afterRenderEffect","_destroyContent","createEmbeddedView","ngOnDestroy","ref","destroyed","destroy"],"mappings":";;;MAwBaA,oBAAoB,CAAA;EACtBC,cAAc,GAAGC,MAAM,CAAC,KAAK;;WAAC;EAC9BC,eAAe,GAAGC,KAAK,CAAC,KAAK;;WAAC;;;;;UAF5BJ,oBAAoB;AAAAK,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;UAApBT,oBAAoB;AAAAU,IAAAA,YAAA,EAAA,IAAA;AAAAC,IAAAA,MAAA,EAAA;AAAAR,MAAAA,eAAA,EAAA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B;AACF,KAAC,CAAC;AACJ;AAEAM,EAAAA,WAAWA,GAAA;IACT,IAAI,CAACF,eAAe,EAAE;AACxB;AAEQA,EAAAA,eAAeA,GAAA;AACrB,IAAA,MAAMG,GAAG,GAAG,IAAI,CAACR,eAAe;AAEhC,IAAA,IAAIQ,GAAG,IAAI,CAACA,GAAG,CAACC,SAAS,EAAE;MACzBD,GAAG,CAACE,OAAO,EAAE;MACb,IAAI,CAACV,eAAe,GAAG,IAAI;AAC7B;AACF;;;;;UAnCWR,eAAe;AAAAf,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;UAAfW,eAAe;AAAAV,IAAAA,YAAA,EAAA,IAAA;AAAAQ,IAAAA,QAAA,EAAAX;AAAA,GAAA,CAAA;;;;;;QAAfa,eAAe;AAAAD,EAAAA,UAAA,EAAA,CAAA;UAD3BV;;;;;;;"}
1
+ {"version":3,"file":"_deferred-content-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/deferred-content/deferred-content.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n afterRenderEffect,\n Directive,\n inject,\n TemplateRef,\n signal,\n ViewContainerRef,\n model,\n EmbeddedViewRef,\n OnDestroy,\n} from '@angular/core';\n\n/**\n * A container directive controls the visibility of its content.\n */\n@Directive()\nexport class DeferredContentAware {\n readonly contentVisible = signal(false);\n readonly preserveContent = model(false);\n}\n\n/**\n * DeferredContent loads/unloads the content based on the visibility.\n * The visibilty signal is sent from a parent directive implements\n * DeferredContentAware.\n *\n * Use this directive as a host directive. For example:\n *\n * ```ts\n * @Directive({\n * selector: 'ng-template[AccordionContent]',\n * hostDirectives: [DeferredContent],\n * })\n * class AccordionContent {}\n * ```\n */\n@Directive()\nexport class DeferredContent implements OnDestroy {\n private readonly _deferredContentAware = inject(DeferredContentAware, {optional: true});\n private readonly _templateRef = inject(TemplateRef);\n private readonly _viewContainerRef = inject(ViewContainerRef);\n private _currentViewRef: EmbeddedViewRef<unknown> | null = null;\n private _isRendered = false;\n\n readonly deferredContentAware = signal(this._deferredContentAware);\n\n constructor() {\n afterRenderEffect(() => {\n if (this.deferredContentAware()?.contentVisible()) {\n if (!this._isRendered) {\n this._destroyContent();\n this._currentViewRef = this._viewContainerRef.createEmbeddedView(this._templateRef);\n this._isRendered = true;\n }\n } else if (!this.deferredContentAware()?.preserveContent()) {\n this._destroyContent();\n this._isRendered = false;\n }\n });\n }\n\n ngOnDestroy(): void {\n this._destroyContent();\n }\n\n private _destroyContent() {\n const ref = this._currentViewRef;\n\n if (ref && !ref.destroyed) {\n ref.destroy();\n this._currentViewRef = null;\n }\n }\n}\n"],"names":["DeferredContentAware","contentVisible","signal","preserveContent","model","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","ngImport","decorators","DeferredContent","_deferredContentAware","inject","optional","_templateRef","TemplateRef","_viewContainerRef","ViewContainerRef","_currentViewRef","_isRendered","deferredContentAware","constructor","afterRenderEffect","_destroyContent","createEmbeddedView","ngOnDestroy","ref","destroyed","destroy"],"mappings":";;;MAwBaA,oBAAoB,CAAA;EACtBC,cAAc,GAAGC,MAAM,CAAC,KAAK;;WAAC;EAC9BC,eAAe,GAAGC,KAAK,CAAC,KAAK;;WAAC;;;;;UAF5BJ,oBAAoB;AAAAK,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;UAApBT,oBAAoB;AAAAU,IAAAA,YAAA,EAAA,IAAA;AAAAC,IAAAA,MAAA,EAAA;AAAAR,MAAAA,eAAA,EAAA;AAAAS,QAAAA,iBAAA,EAAA,iBAAA;AAAAC,QAAAA,UAAA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T,IAAI,CAACF,eAAe,EAAE;AACxB;AAEQA,EAAAA,eAAeA,GAAA;AACrB,IAAA,MAAMG,GAAG,GAAG,IAAI,CAACR,eAAe;AAEhC,IAAA,IAAIQ,GAAG,IAAI,CAACA,GAAG,CAACC,SAAS,EAAE;MACzBD,GAAG,CAACE,OAAO,EAAE;MACb,IAAI,CAACV,eAAe,GAAG,IAAI;AAC7B;AACF;;;;;UAnCWR,eAAe;AAAAf,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;UAAfW,eAAe;AAAAV,IAAAA,YAAA,EAAA,IAAA;AAAAQ,IAAAA,QAAA,EAAAX;AAAA,GAAA,CAAA;;;;;;QAAfa,eAAe;AAAAD,EAAAA,UAAA,EAAA,CAAA;UAD3BV;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"_expansion-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/expansion/expansion.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {SignalLike, WritableSignalLike} from '../signal-like/signal-like';\n\n/** Represents an item that can be expanded or collapsed. */\nexport interface ExpansionItem {\n /** Whether the item is expandable. */\n expandable: SignalLike<boolean>;\n\n /** Whether the item is expanded. */\n expanded: WritableSignalLike<boolean>;\n\n /** Whether the expansion is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for an expansion behavior. */\nexport interface ListExpansionInputs {\n /** Whether multiple items can be expanded at once. */\n multiExpandable: SignalLike<boolean>;\n\n /** An array of expansion items. */\n items: SignalLike<ExpansionItem[]>;\n\n /** Whether all expansions are disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Manages the expansion state of a list of items. */\nexport class ListExpansion {\n constructor(readonly inputs: ListExpansionInputs) {}\n\n /** Opens the specified item. */\n open(item: ExpansionItem): boolean {\n if (!this.isExpandable(item)) return false;\n if (item.expanded()) return false;\n if (!this.inputs.multiExpandable()) {\n this.closeAll();\n }\n item.expanded.set(true);\n return true;\n }\n\n /** Closes the specified item. */\n close(item: ExpansionItem): boolean {\n if (!this.isExpandable(item)) return false;\n\n item.expanded.set(false);\n return true;\n }\n\n /** Toggles the expansion state of the specified item. */\n toggle(item: ExpansionItem): boolean {\n return item.expanded() ? this.close(item) : this.open(item);\n }\n\n /** Opens all focusable items in the list. */\n openAll(): void {\n if (this.inputs.multiExpandable()) {\n for (const item of this.inputs.items()) {\n this.open(item);\n }\n }\n }\n\n /** Closes all focusable items in the list. */\n closeAll(): void {\n for (const item of this.inputs.items()) {\n this.close(item);\n }\n }\n\n /** Checks whether the specified item is expandable / collapsible. */\n isExpandable(item: ExpansionItem) {\n return !this.inputs.disabled() && !item.disabled() && item.expandable();\n }\n}\n"],"names":["ListExpansion","inputs","constructor","open","item","isExpandable","expanded","multiExpandable","closeAll","set","close","toggle","openAll","items","disabled","expandable"],"mappings":"MAkCaA,aAAa,CAAA;EACHC,MAAA;EAArBC,WAAAA,CAAqBD,MAA2B,EAAA;IAA3B,IAAM,CAAAA,MAAA,GAANA,MAAM;AAAwB;EAGnDE,IAAIA,CAACC,IAAmB,EAAA;IACtB,IAAI,CAAC,IAAI,CAACC,YAAY,CAACD,IAAI,CAAC,EAAE,OAAO,KAAK;AAC1C,IAAA,IAAIA,IAAI,CAACE,QAAQ,EAAE,EAAE,OAAO,KAAK;IACjC,IAAI,CAAC,IAAI,CAACL,MAAM,CAACM,eAAe,EAAE,EAAE;MAClC,IAAI,CAACC,QAAQ,EAAE;AACjB;AACAJ,IAAAA,IAAI,CAACE,QAAQ,CAACG,GAAG,CAAC,IAAI,CAAC;AACvB,IAAA,OAAO,IAAI;AACb;EAGAC,KAAKA,CAACN,IAAmB,EAAA;IACvB,IAAI,CAAC,IAAI,CAACC,YAAY,CAACD,IAAI,CAAC,EAAE,OAAO,KAAK;AAE1CA,IAAAA,IAAI,CAACE,QAAQ,CAACG,GAAG,CAAC,KAAK,CAAC;AACxB,IAAA,OAAO,IAAI;AACb;EAGAE,MAAMA,CAACP,IAAmB,EAAA;AACxB,IAAA,OAAOA,IAAI,CAACE,QAAQ,EAAE,GAAG,IAAI,CAACI,KAAK,CAACN,IAAI,CAAC,GAAG,IAAI,CAACD,IAAI,CAACC,IAAI,CAAC;AAC7D;AAGAQ,EAAAA,OAAOA,GAAA;AACL,IAAA,IAAI,IAAI,CAACX,MAAM,CAACM,eAAe,EAAE,EAAE;MACjC,KAAK,MAAMH,IAAI,IAAI,IAAI,CAACH,MAAM,CAACY,KAAK,EAAE,EAAE;AACtC,QAAA,IAAI,CAACV,IAAI,CAACC,IAAI,CAAC;AACjB;AACF;AACF;AAGAI,EAAAA,QAAQA,GAAA;IACN,KAAK,MAAMJ,IAAI,IAAI,IAAI,CAACH,MAAM,CAACY,KAAK,EAAE,EAAE;AACtC,MAAA,IAAI,CAACH,KAAK,CAACN,IAAI,CAAC;AAClB;AACF;EAGAC,YAAYA,CAACD,IAAmB,EAAA;IAC9B,OAAO,CAAC,IAAI,CAACH,MAAM,CAACa,QAAQ,EAAE,IAAI,CAACV,IAAI,CAACU,QAAQ,EAAE,IAAIV,IAAI,CAACW,UAAU,EAAE;AACzE;AACD;;;;"}
1
+ {"version":3,"file":"_expansion-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/expansion/expansion.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {SignalLike, WritableSignalLike} from '../signal-like/signal-like';\n\n/** Represents an item that can be expanded or collapsed. */\nexport interface ExpansionItem {\n /** Whether the item is expandable. */\n expandable: SignalLike<boolean>;\n\n /** Whether the item is expanded. */\n expanded: WritableSignalLike<boolean>;\n\n /** Whether the expansion is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for an expansion behavior. */\nexport interface ListExpansionInputs {\n /** Whether multiple items can be expanded at once. */\n multiExpandable: SignalLike<boolean>;\n\n /** An array of expansion items. */\n items: SignalLike<ExpansionItem[]>;\n\n /** Whether all expansions are disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Manages the expansion state of a list of items. */\nexport class ListExpansion {\n constructor(readonly inputs: ListExpansionInputs) {}\n\n /** Opens the specified item. */\n open(item: ExpansionItem): boolean {\n if (!this.isExpandable(item)) return false;\n if (item.expanded()) return false;\n if (!this.inputs.multiExpandable()) {\n this.closeAll();\n }\n item.expanded.set(true);\n return true;\n }\n\n /** Closes the specified item. */\n close(item: ExpansionItem): boolean {\n if (!this.isExpandable(item)) return false;\n\n item.expanded.set(false);\n return true;\n }\n\n /** Toggles the expansion state of the specified item. */\n toggle(item: ExpansionItem): boolean {\n return item.expanded() ? this.close(item) : this.open(item);\n }\n\n /** Opens all focusable items in the list. */\n openAll(): void {\n if (this.inputs.multiExpandable()) {\n for (const item of this.inputs.items()) {\n this.open(item);\n }\n }\n }\n\n /** Closes all focusable items in the list. */\n closeAll(): void {\n for (const item of this.inputs.items()) {\n this.close(item);\n }\n }\n\n /** Checks whether the specified item is expandable / collapsible. */\n isExpandable(item: ExpansionItem) {\n return !this.inputs.disabled() && !item.disabled() && item.expandable();\n }\n}\n"],"names":["ListExpansion","inputs","constructor","open","item","isExpandable","expanded","multiExpandable","closeAll","set","close","toggle","openAll","items","disabled","expandable"],"mappings":"MAkCaA,aAAa,CAAA;EACHC,MAAA;EAArBC,WAAAA,CAAqBD,MAA2B,EAAA;IAA3B,IAAM,CAAAA,MAAA,GAANA,MAAM;AAAwB;EAGnDE,IAAIA,CAACC,IAAmB,EAAA;IACtB,IAAI,CAAC,IAAI,CAACC,YAAY,CAACD,IAAI,CAAC,EAAE,OAAO,KAAK;AAC1C,IAAA,IAAIA,IAAI,CAACE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a778d11ba/bin/src/aria/private/behaviors/list/list.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed, signal} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\nimport {\n ListNavigation,\n ListNavigationInputs,\n ListNavigationItem,\n} from '../list-navigation/list-navigation';\nimport {\n ListSelection,\n ListSelectionInputs,\n ListSelectionItem,\n} from '../list-selection/list-selection';\nimport {\n ListTypeahead,\n ListTypeaheadInputs,\n ListTypeaheadItem,\n} from '../list-typeahead/list-typeahead';\n\n/** The operations that the list can perform after navigation. */\nexport interface NavOptions<T = any> {\n toggle?: boolean;\n select?: boolean;\n selectOne?: boolean;\n selectRange?: boolean;\n anchor?: boolean;\n focusElement?: boolean;\n items?: T[];\n}\n\n/** Represents an item in the list. */\nexport type ListItem<V> = ListTypeaheadItem &\n ListNavigationItem &\n ListSelectionItem<V> &\n ListFocusItem;\n\n/** The necessary inputs for the list behavior. */\nexport type ListInputs<T extends ListItem<V>, V> = ListFocusInputs<T> &\n ListNavigationInputs<T> &\n ListSelectionInputs<T, V> &\n ListTypeaheadInputs<T>;\n\n/** Controls the state of a list. */\nexport class List<T extends ListItem<V>, V> {\n /** Controls navigation for the list. */\n navigationBehavior: ListNavigation<T>;\n\n /** Controls selection for the list. */\n selectionBehavior: ListSelection<T, V>;\n\n /** Controls typeahead for the list. */\n typeaheadBehavior: ListTypeahead<T>;\n\n /** Controls focus for the list. */\n focusBehavior: ListFocus<T>;\n\n /** Whether the list is disabled. */\n disabled = computed(() => this.focusBehavior.isListDisabled());\n\n /** The id of the current active item. */\n activeDescendant = computed(() => this.focusBehavior.getActiveDescendant());\n\n /** The tab index of the list. */\n tabIndex = computed(() => this.focusBehavior.getListTabIndex());\n\n /** The index of the currently active item in the list. */\n activeIndex = computed(() => this.focusBehavior.activeIndex());\n\n /**\n * The uncommitted index for selecting a range of options.\n *\n * NOTE: This is subtly distinct from the \"rangeStartIndex\" in the ListSelection behavior.\n * The anchorIndex does not necessarily represent the start of a range, but represents the most\n * recent index where the user showed intent to begin a range selection. Usually, this is wherever\n * the user most recently pressed the \"Shift\" key, but if the user presses shift + space to select\n * from the anchor, the user is not intending to start a new range from this index.\n *\n * In other words, \"rangeStartIndex\" is only set when a user commits to starting a range selection\n * while \"anchorIndex\" is set whenever a user indicates they may be starting a range selection.\n */\n private _anchorIndex = signal(0);\n\n /** Whether the list should wrap. Used to disable wrapping while range selecting. */\n private _wrap = signal(true);\n\n constructor(readonly inputs: ListInputs<T, V>) {\n this.focusBehavior = new ListFocus(inputs);\n this.selectionBehavior = new ListSelection({...inputs, focusManager: this.focusBehavior});\n this.typeaheadBehavior = new ListTypeahead({...inputs, focusManager: this.focusBehavior});\n this.navigationBehavior = new ListNavigation({\n ...inputs,\n focusManager: this.focusBehavior,\n wrap: computed(() => this._wrap() && this.inputs.wrap()),\n });\n }\n\n /** Returns the tab index for the given item. */\n getItemTabindex(item: T) {\n return this.focusBehavior.getItemTabIndex(item);\n }\n\n /** Navigates to the first option in the list. */\n first(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.first(opts));\n }\n\n /** Navigates to the last option in the list. */\n last(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.last(opts));\n }\n\n /** Navigates to the next option in the list. */\n next(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.next(opts));\n }\n\n /** Navigates to the previous option in the list. */\n prev(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.prev(opts));\n }\n\n /** Navigates to the given item in the list. */\n goto(item: T, opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.goto(item, opts));\n }\n\n /** Removes focus from the list. */\n unfocus() {\n this.inputs.activeItem.set(undefined);\n }\n\n /** Marks the given index as the potential start of a range selection. */\n anchor(index: number) {\n this._anchorIndex.set(index);\n }\n\n /** Handles typeahead search navigation for the list. */\n search(char: string, opts?: NavOptions) {\n this._navigate(opts, () => this.typeaheadBehavior.search(char));\n }\n\n /** Checks if the list is currently typing for typeahead search. */\n isTyping() {\n return this.typeaheadBehavior.isTyping();\n }\n\n /** Selects the currently active item in the list. */\n select(item?: T) {\n this.selectionBehavior.select(item);\n }\n\n /** Sets the selection to only the current active item. */\n selectOne() {\n this.selectionBehavior.selectOne();\n }\n\n /** Deselects the currently active item in the list. */\n deselect(item?: T) {\n this.selectionBehavior.deselect(item);\n }\n\n /** Deselects all items in the list. */\n deselectAll() {\n this.selectionBehavior.deselectAll();\n }\n\n /** Toggles the currently active item in the list. */\n toggle(item?: T) {\n this.selectionBehavior.toggle(item);\n }\n\n /** Toggles the currently active item in the list, deselecting all other items. */\n toggleOne() {\n this.selectionBehavior.toggleOne();\n }\n\n /** Toggles the selection of all items in the list. */\n toggleAll() {\n this.selectionBehavior.toggleAll();\n }\n\n /** Checks if the given item is able to receive focus. */\n isFocusable(item: T) {\n return this.focusBehavior.isFocusable(item);\n }\n\n /** Handles updating selection for the list. */\n updateSelection(opts: NavOptions = {anchor: true}) {\n if (opts.toggle) {\n this.selectionBehavior.toggle();\n }\n if (opts.select) {\n this.selectionBehavior.select();\n }\n if (opts.selectOne) {\n this.selectionBehavior.selectOne();\n }\n if (opts.selectRange) {\n this.selectionBehavior.selectRange();\n }\n if (!opts.anchor) {\n this.anchor(this.selectionBehavior.rangeStartIndex());\n }\n }\n\n /**\n * Safely performs a navigation operation.\n *\n * Handles conditionally disabling wrapping for when a navigation\n * operation is occurring while the user is selecting a range of options.\n *\n * Handles boilerplate calling of focus & selection operations. Also ensures these\n * additional operations are only called if the navigation operation moved focus to a new option.\n */\n private _navigate(opts: NavOptions = {}, operation: () => boolean) {\n if (opts?.selectRange) {\n this._wrap.set(false);\n this.selectionBehavior.rangeStartIndex.set(this._anchorIndex());\n }\n\n const moved = operation();\n\n if (moved) {\n this.updateSelection(opts);\n }\n\n this._wrap.set(true);\n }\n}\n"],"names":["List","inputs","navigationBehavior","selectionBehavior","typeaheadBehavior","focusBehavior","disabled","computed","isListDisabled","activeDescendant","getActiveDescendant","tabIndex","getListTabIndex","activeIndex","_anchorIndex","signal","_wrap","constructor","ListFocus","ListSelection","focusManager","ListTypeahead","ListNavigation","wrap","getItemTabindex","item","getItemTabIndex","first","opts","_navigate","last","next","prev","goto","unfocus","activeItem","set","undefined","anchor","index","search","char","isTyping","select","selectOne","deselect","deselectAll","toggle","toggleOne","toggleAll","isFocusable","updateSelection","selectRange","rangeStartIndex","operation","moved"],"mappings":";;;;MAkDaA,IAAI,CAAA;EA0CMC,MAAA;EAxCrBC,kBAAkB;EAGlBC,iBAAiB;EAGjBC,iBAAiB;EAGjBC,aAAa;EAGbC,QAAQ,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACG,cAAc,EAAE,CAAC;EAG9DC,gBAAgB,GAAGF,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACK,mBAAmB,EAAE,CAAC;EAG3EC,QAAQ,GAAGJ,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACO,eAAe,EAAE,CAAC;EAG/DC,WAAW,GAAGN,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACQ,WAAW,EAAE,CAAC;AActDC,EAAAA,YAAY,GAAGC,MAAM,CAAC,CAAC,CAAC;AAGxBC,EAAAA,KAAK,GAAGD,MAAM,CAAC,IAAI,CAAC;EAE5BE,WAAAA,CAAqBhB,MAAwB,EAAA;IAAxB,IAAM,CAAAA,MAAA,GAANA,MAAM;AACzB,IAAA,IAAI,CAACI,aAAa,GAAG,IAAIa,SAAS,CAACjB,MAAM,CAAC;AAC1C,IAAA,IAAI,CAACE,iBAAiB,GAAG,IAAIgB,aAAa,CAAC;AAAC,MAAA,GAAGlB,MAAM;MAAEmB,YAAY,EAAE,IAAI,CAACf;AAAa,KAAC,CAAC;AACzF,IAAA,IAAI,CAAC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ST-fdfa778d11ba/bin/src/aria/private/behaviors/list/list.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed, signal} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\nimport {\n ListNavigation,\n ListNavigationInputs,\n ListNavigationItem,\n} from '../list-navigation/list-navigation';\nimport {\n ListSelection,\n ListSelectionInputs,\n ListSelectionItem,\n} from '../list-selection/list-selection';\nimport {\n ListTypeahead,\n ListTypeaheadInputs,\n ListTypeaheadItem,\n} from '../list-typeahead/list-typeahead';\n\n/** The operations that the list can perform after navigation. */\nexport interface NavOptions<T = any> {\n toggle?: boolean;\n select?: boolean;\n selectOne?: boolean;\n selectRange?: boolean;\n anchor?: boolean;\n focusElement?: boolean;\n items?: T[];\n}\n\n/** Represents an item in the list. */\nexport type ListItem<V> = ListTypeaheadItem &\n ListNavigationItem &\n ListSelectionItem<V> &\n ListFocusItem;\n\n/** The necessary inputs for the list behavior. */\nexport type ListInputs<T extends ListItem<V>, V> = ListFocusInputs<T> &\n ListNavigationInputs<T> &\n ListSelectionInputs<T, V> &\n ListTypeaheadInputs<T>;\n\n/** Controls the state of a list. */\nexport class List<T extends ListItem<V>, V> {\n /** Controls navigation for the list. */\n navigationBehavior: ListNavigation<T>;\n\n /** Controls selection for the list. */\n selectionBehavior: ListSelection<T, V>;\n\n /** Controls typeahead for the list. */\n typeaheadBehavior: ListTypeahead<T>;\n\n /** Controls focus for the list. */\n focusBehavior: ListFocus<T>;\n\n /** Whether the list is disabled. */\n disabled = computed(() => this.focusBehavior.isListDisabled());\n\n /** The id of the current active item. */\n activeDescendant = computed(() => this.focusBehavior.getActiveDescendant());\n\n /** The tab index of the list. */\n tabIndex = computed(() => this.focusBehavior.getListTabIndex());\n\n /** The index of the currently active item in the list. */\n activeIndex = computed(() => this.focusBehavior.activeIndex());\n\n /**\n * The uncommitted index for selecting a range of options.\n *\n * NOTE: This is subtly distinct from the \"rangeStartIndex\" in the ListSelection behavior.\n * The anchorIndex does not necessarily represent the start of a range, but represents the most\n * recent index where the user showed intent to begin a range selection. Usually, this is wherever\n * the user most recently pressed the \"Shift\" key, but if the user presses shift + space to select\n * from the anchor, the user is not intending to start a new range from this index.\n *\n * In other words, \"rangeStartIndex\" is only set when a user commits to starting a range selection\n * while \"anchorIndex\" is set whenever a user indicates they may be starting a range selection.\n */\n private _anchorIndex = signal(0);\n\n /** Whether the list should wrap. Used to disable wrapping while range selecting. */\n private _wrap = signal(true);\n\n constructor(readonly inputs: ListInputs<T, V>) {\n this.focusBehavior = new ListFocus(inputs);\n this.selectionBehavior = new ListSelection({...inputs, focusManager: this.focusBehavior});\n this.typeaheadBehavior = new ListTypeahead({...inputs, focusManager: this.focusBehavior});\n this.navigationBehavior = new ListNavigation({\n ...inputs,\n focusManager: this.focusBehavior,\n wrap: computed(() => this._wrap() && this.inputs.wrap()),\n });\n }\n\n /** Returns the tab index for the given item. */\n getItemTabindex(item: T) {\n return this.focusBehavior.getItemTabIndex(item);\n }\n\n /** Navigates to the first option in the list. */\n first(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.first(opts));\n }\n\n /** Navigates to the last option in the list. */\n last(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.last(opts));\n }\n\n /** Navigates to the next option in the list. */\n next(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.next(opts));\n }\n\n /** Navigates to the previous option in the list. */\n prev(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.prev(opts));\n }\n\n /** Navigates to the given item in the list. */\n goto(item: T, opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.goto(item, opts));\n }\n\n /** Removes focus from the list. */\n unfocus() {\n this.inputs.activeItem.set(undefined);\n }\n\n /** Marks the given index as the potential start of a range selection. */\n anchor(index: number) {\n this._anchorIndex.set(index);\n }\n\n /** Handles typeahead search navigation for the list. */\n search(char: string, opts?: NavOptions) {\n this._navigate(opts, () => this.typeaheadBehavior.search(char));\n }\n\n /** Checks if the list is currently typing for typeahead search. */\n isTyping() {\n return this.typeaheadBehavior.isTyping();\n }\n\n /** Selects the currently active item in the list. */\n select(item?: T) {\n this.selectionBehavior.select(item);\n }\n\n /** Sets the selection to only the current active item. */\n selectOne() {\n this.selectionBehavior.selectOne();\n }\n\n /** Deselects the currently active item in the list. */\n deselect(item?: T) {\n this.selectionBehavior.deselect(item);\n }\n\n /** Deselects all items in the list. */\n deselectAll() {\n this.selectionBehavior.deselectAll();\n }\n\n /** Toggles the currently active item in the list. */\n toggle(item?: T) {\n this.selectionBehavior.toggle(item);\n }\n\n /** Toggles the currently active item in the list, deselecting all other items. */\n toggleOne() {\n this.selectionBehavior.toggleOne();\n }\n\n /** Toggles the selection of all items in the list. */\n toggleAll() {\n this.selectionBehavior.toggleAll();\n }\n\n /** Checks if the given item is able to receive focus. */\n isFocusable(item: T) {\n return this.focusBehavior.isFocusable(item);\n }\n\n /** Handles updating selection for the list. */\n updateSelection(opts: NavOptions = {anchor: true}) {\n if (opts.toggle) {\n this.selectionBehavior.toggle();\n }\n if (opts.select) {\n this.selectionBehavior.select();\n }\n if (opts.selectOne) {\n this.selectionBehavior.selectOne();\n }\n if (opts.selectRange) {\n this.selectionBehavior.selectRange();\n }\n if (!opts.anchor) {\n this.anchor(this.selectionBehavior.rangeStartIndex());\n }\n }\n\n /**\n * Safely performs a navigation operation.\n *\n * Handles conditionally disabling wrapping for when a navigation\n * operation is occurring while the user is selecting a range of options.\n *\n * Handles boilerplate calling of focus & selection operations. Also ensures these\n * additional operations are only called if the navigation operation moved focus to a new option.\n */\n private _navigate(opts: NavOptions = {}, operation: () => boolean) {\n if (opts?.selectRange) {\n this._wrap.set(false);\n this.selectionBehavior.rangeStartIndex.set(this._anchorIndex());\n }\n\n const moved = operation();\n\n if (moved) {\n this.updateSelection(opts);\n }\n\n this._wrap.set(true);\n }\n}\n"],"names":["List","inputs","navigationBehavior","selectionBehavior","typeaheadBehavior","focusBehavior","disabled","computed","isListDisabled","activeDescendant","getActiveDescendant","tabIndex","getListTabIndex","activeIndex","_anchorIndex","signal","_wrap","constructor","ListFocus","ListSelection","focusManager","ListTypeahead","ListNavigation","wrap","getItemTabindex","item","getItemTabIndex","first","opts","_navigate","last","next","prev","goto","unfocus","activeItem","set","undefined","anchor","index","search","char","isTyping","select","selectOne","deselect","deselectAll","toggle","toggleOne","toggleAll","isFocusable","updateSelection","selectRange","rangeStartIndex","operation","moved"],"mappings":";;;;MAkDaA,IAAI,CAAA;EA0CMC,MAAA;EAxCrBC,kBAAkB;EAGlBC,iBAAiB;EAGjBC,iBAAiB;EAGjBC,aAAa;EAGbC,QAAQ,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACG,cAAc,EAAE,CAAC;EAG9DC,gBAAgB,GAAGF,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACK,mBAAmB,EAAE,CAAC;EAG3EC,QAAQ,GAAGJ,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACO,eAAe,EAAE,CAAC;EAG/DC,WAAW,GAAGN,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACQ,WAAW,EAAE,CAAC;AActDC,EAAAA,YAAY,GAAGC,MAAM,CAAC,CAAC,CAAC;AAGxBC,EAAAA,KAAK,GAAGD,MAAM,CAAC,IAAI,CAAC;EAE5BE,WAAAA,CAAqBhB,MAAwB,EAAA;IAAxB,IAAM,CAAAA,MAAA,GAANA,MAAM;AACzB,IAAA,IAAI,CAACI,aAAa,GAAG,IAAIa,SAAS,CAACjB,MAAM,CAAC;AAC1C,IAAA,IAAI,CAACE,iBAAiB,GAAG,IAAIgB,aAAa,CAAC;AAAC,MAAA,GAAGlB,MAAM;MAAEmB,YAAY,EAAE,IAAI,CAACf;AAAa,KAAC,CAAC;AACzF,IAAA,IA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js","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-focus/list-focus.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-navigation/list-navigation.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed, signal, SignalLike, WritableSignalLike} from '../signal-like/signal-like';\n\n/** Represents an item in a collection, such as a listbox option, than may receive focus. */\nexport interface ListFocusItem {\n /** A unique identifier for the item. */\n id: SignalLike<string>;\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement | undefined>;\n\n /** Whether an item is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The index of the item in the list. */\n index: SignalLike<number>;\n}\n\n/** Represents the required inputs for a collection that contains focusable items. */\nexport interface ListFocusInputs<T extends ListFocusItem> {\n /** The focus strategy used by the list. */\n focusMode: SignalLike<'roving' | 'activedescendant'>;\n\n /** Whether the list is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The items in the list. */\n items: SignalLike<T[]>;\n\n /** The active item. */\n activeItem: WritableSignalLike<T | undefined>;\n\n /** Whether disabled items in the list should be focusable. */\n softDisabled: SignalLike<boolean>;\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement | undefined>;\n}\n\n/** Controls focus for a list of items. */\nexport class ListFocus<T extends ListFocusItem> {\n /** The last item that was active. */\n prevActiveItem = signal<T | undefined>(undefined);\n\n /** The index of the last item that was active. */\n prevActiveIndex = computed(() => {\n return this.prevActiveItem() ? this.inputs.items().indexOf(this.prevActiveItem()!) : -1;\n });\n\n /** The current active index in the list. */\n activeIndex = computed(() => {\n return this.inputs.activeItem() ? this.inputs.items().indexOf(this.inputs.activeItem()!) : -1;\n });\n\n constructor(readonly inputs: ListFocusInputs<T>) {}\n\n /** Whether the list is in a disabled state. */\n isListDisabled(): boolean {\n return this.inputs.disabled() || this.inputs.items().every(i => i.disabled());\n }\n\n /** The id of the current active item. */\n getActiveDescendant(): string | undefined {\n if (this.isListDisabled()) {\n return undefined;\n }\n if (this.inputs.focusMode() === 'roving') {\n return undefined;\n }\n return this.inputs.activeItem()?.id() ?? undefined;\n }\n\n /** The tab index for the list. */\n getListTabIndex(): -1 | 0 {\n if (this.isListDisabled()) {\n return 0;\n }\n return this.inputs.focusMode() === 'activedescendant' ? 0 : -1;\n }\n\n /** Returns the tab index for the given item. */\n getItemTabIndex(item: T): -1 | 0 {\n if (this.isListDisabled()) {\n return -1;\n }\n if (this.inputs.focusMode() === 'activedescendant') {\n return -1;\n }\n return this.inputs.activeItem() === item ? 0 : -1;\n }\n\n /** Moves focus to the given item if it is focusable. */\n focus(item: T, opts?: {focusElement?: boolean}): boolean {\n if (this.isListDisabled() || !this.isFocusable(item)) {\n return false;\n }\n\n this.prevActiveItem.set(this.inputs.activeItem());\n this.inputs.activeItem.set(item);\n\n if (opts?.focusElement || opts?.focusElement === undefined) {\n this.inputs.focusMode() === 'roving'\n ? item.element()?.focus()\n : this.inputs.element()?.focus();\n }\n\n return true;\n }\n\n /** Returns true if the given item can be navigated to. */\n isFocusable(item: T): boolean {\n return !item.disabled() || this.inputs.softDisabled();\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} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\n\n/** Represents an item in a collection, such as a listbox option, than can be navigated to. */\nexport interface ListNavigationItem extends ListFocusItem {}\n\n/** Represents the required inputs for a collection that has navigable items. */\nexport interface ListNavigationInputs<T extends ListNavigationItem> extends ListFocusInputs<T> {\n /** Whether focus should wrap when navigating. */\n wrap: SignalLike<boolean>;\n\n /** Whether the list is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** The direction that text is read based on the users locale. */\n textDirection: SignalLike<'rtl' | 'ltr'>;\n}\n\n/** Options for list navigation. */\nexport interface ListNavigationOpts<T> {\n /**\n * Whether to focus the item's element.\n * Defaults to true.\n */\n focusElement?: boolean;\n\n /**\n * The list of items to navigate through.\n * Defaults to the list of items from the inputs.\n */\n items?: T[];\n}\n\n/** Controls navigation for a list of items. */\nexport class ListNavigation<T extends ListNavigationItem> {\n constructor(readonly inputs: ListNavigationInputs<T> & {focusManager: ListFocus<T>}) {}\n\n /** Navigates to the given item. */\n goto(item?: T, opts?: ListNavigationOpts<T>): boolean {\n return item ? this.inputs.focusManager.focus(item, opts) : false;\n }\n\n /** Navigates to the next item in the list. */\n next(opts?: ListNavigationOpts<T>): boolean {\n return this._advance(1, opts);\n }\n\n /** Peeks the next item in the list. */\n peekNext(opts?: ListNavigationOpts<T>): T | undefined {\n return this._peek(1, opts);\n }\n\n /** Navigates to the previous item in the list. */\n prev(opts?: ListNavigationOpts<T>): boolean {\n return this._advance(-1, opts);\n }\n\n /** Peeks the previous item in the list. */\n peekPrev(opts?: ListNavigationOpts<T>): T | undefined {\n return this._peek(-1, opts);\n }\n\n /** Navigates to the first item in the list. */\n first(opts?: ListNavigationOpts<T>): boolean {\n const item = this.peekFirst(opts);\n return item ? this.goto(item, opts) : false;\n }\n\n /** Navigates to the last item in the list. */\n last(opts?: ListNavigationOpts<T>): boolean {\n const item = this.peekLast(opts);\n return item ? this.goto(item, opts) : false;\n }\n\n /** Gets the first focusable item from the given list of items. */\n peekFirst(opts?: ListNavigationOpts<T>): T | undefined {\n const items = opts?.items ?? this.inputs.items();\n return items.find(i => this.inputs.focusManager.isFocusable(i));\n }\n\n /** Gets the last focusable item from the given list of items. */\n peekLast(opts?: ListNavigationOpts<T>): T | undefined {\n const items = opts?.items ?? this.inputs.items();\n for (let i = items.length - 1; i >= 0; i--) {\n if (this.inputs.focusManager.isFocusable(items[i])) {\n return items[i];\n }\n }\n return;\n }\n\n /** Advances to the next or previous focusable item in the list based on the given delta. */\n private _advance(delta: 1 | -1, opts?: ListNavigationOpts<T>): boolean {\n const item = this._peek(delta, opts);\n return item ? this.goto(item, opts) : false;\n }\n\n /** Peeks the next or previous focusable item in the list based on the given delta. */\n private _peek(delta: 1 | -1, opts?: ListNavigationOpts<T>): T | undefined {\n const items = opts?.items ?? this.inputs.items();\n const itemCount = items.length;\n const activeItem = this.inputs.focusManager.inputs.activeItem();\n const startIndex =\n opts?.items && activeItem\n ? items.indexOf(activeItem)\n : this.inputs.focusManager.activeIndex();\n\n const step = (i: number) =>\n this.inputs.wrap() ? (i + delta + itemCount) % itemCount : i + delta;\n\n // If wrapping is enabled, this loop ultimately terminates when `i` gets back to `startIndex`\n // in the case that all options are disabled. If wrapping is disabled, the loop terminates\n // when the index goes out of bounds.\n for (let i = step(startIndex); i !== startIndex && i < itemCount && i >= 0; i = step(i)) {\n if (this.inputs.focusManager.isFocusable(items[i])) {\n return items[i];\n }\n }\n\n return;\n }\n}\n"],"names":["ListFocus","inputs","prevActiveItem","signal","undefined","prevActiveIndex","computed","items","indexOf","activeIndex","activeItem","constructor","isListDisabled","disabled","every","i","getActiveDescendant","focusMode","id","getListTabIndex","getItemTabIndex","item","focus","opts","isFocusable","set","focusElement","element","softDisabled","ListNavigation","goto","focusManager","next","_advance","peekNext","_peek","prev","peekPrev","first","peekFirst","last","peekLast","find","length","delta","itemCount","startIndex","step","wrap"],"mappings":";;MA+CaA,SAAS,CAAA;EAcCC,MAAA;AAZrBC,EAAAA,cAAc,GAAGC,MAAM,CAAgBC,SAAS,CAAC;EAGjDC,eAAe,GAAGC,QAAQ,CAAC,MAAK;IAC9B,OAAO,IAAI,CAACJ,cAAc,EAAE,GAAG,IAAI,CAACD,MAAM,CAACM,KAAK,EAAE,CAACC,OAAO,CAAC,IAAI,CAACN,cAAc,EAAG,CAAC,GAAG,CAAC,CAAC;AACzF,GAAC,CAAC;EAGFO,WAAW,GAAGH,QAAQ,CAAC,MAAK;AAC1B,IAAA,OAAO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AAChC,CAAC,CAAC,EAAE;AACvF,MAAA,IAAI,IAAI,CAACd,MAAM,CAAC8B,YAAY,CAACP,WAAW,CAACjB,KAAK,CAACQ,CAAC,CAAC,CAAC,EAAE;QAClD,OAAOR,KAAK,CAACQ,CAAC,CAAC;AACjB;AACF;AAEA,IAAA;AACF;AACD;;;;"}
1
+ {"version":3,"file":"_list-navigation-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-focus/list-focus.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-navigation/list-navigation.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed, signal, SignalLike, WritableSignalLike} from '../signal-like/signal-like';\n\n/** Represents an item in a collection, such as a listbox option, than may receive focus. */\nexport interface ListFocusItem {\n /** A unique identifier for the item. */\n id: SignalLike<string>;\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement | undefined>;\n\n /** Whether an item is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for a collection that contains focusable items. */\nexport interface ListFocusInputs<T extends ListFocusItem> {\n /** The focus strategy used by the list. */\n focusMode: SignalLike<'roving' | 'activedescendant'>;\n\n /** Whether the list is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The items in the list. */\n items: SignalLike<T[]>;\n\n /** The active item. */\n activeItem: WritableSignalLike<T | undefined>;\n\n /** Whether disabled items in the list should be focusable. */\n softDisabled: SignalLike<boolean>;\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement | undefined>;\n}\n\n/** Controls focus for a list of items. */\nexport class ListFocus<T extends ListFocusItem> {\n /** The last item that was active. */\n prevActiveItem = signal<T | undefined>(undefined);\n\n /** The index of the last item that was active. */\n prevActiveIndex = computed(() => {\n return this.prevActiveItem() ? this.inputs.items().indexOf(this.prevActiveItem()!) : -1;\n });\n\n /** The current active index in the list. */\n activeIndex = computed(() => {\n return this.inputs.activeItem() ? this.inputs.items().indexOf(this.inputs.activeItem()!) : -1;\n });\n\n constructor(readonly inputs: ListFocusInputs<T>) {}\n\n /** Whether the list is in a disabled state. */\n isListDisabled(): boolean {\n return this.inputs.disabled() || this.inputs.items().every(i => i.disabled());\n }\n\n /** The id of the current active item. */\n getActiveDescendant(): string | undefined {\n if (this.isListDisabled()) {\n return undefined;\n }\n if (this.inputs.focusMode() === 'roving') {\n return undefined;\n }\n return this.inputs.activeItem()?.id() ?? undefined;\n }\n\n /** The tab index for the list. */\n getListTabIndex(): -1 | 0 {\n if (this.isListDisabled()) {\n return 0;\n }\n return this.inputs.focusMode() === 'activedescendant' ? 0 : -1;\n }\n\n /** Returns the tab index for the given item. */\n getItemTabIndex(item: T): -1 | 0 {\n if (this.isListDisabled()) {\n return -1;\n }\n if (this.inputs.focusMode() === 'activedescendant') {\n return -1;\n }\n return this.inputs.activeItem() === item ? 0 : -1;\n }\n\n /** Moves focus to the given item if it is focusable. */\n focus(item: T, opts?: {focusElement?: boolean}): boolean {\n if (this.isListDisabled() || !this.isFocusable(item)) {\n return false;\n }\n\n this.prevActiveItem.set(this.inputs.activeItem());\n this.inputs.activeItem.set(item);\n\n if (opts?.focusElement || opts?.focusElement === undefined) {\n this.inputs.focusMode() === 'roving'\n ? item.element()?.focus()\n : this.inputs.element()?.focus();\n }\n\n return true;\n }\n\n /** Returns true if the given item can be navigated to. */\n isFocusable(item: T): boolean {\n return !item.disabled() || this.inputs.softDisabled();\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} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\n\n/** Represents an item in a collection, such as a listbox option, than can be navigated to. */\nexport interface ListNavigationItem extends ListFocusItem {}\n\n/** Represents the required inputs for a collection that has navigable items. */\nexport interface ListNavigationInputs<T extends ListNavigationItem> extends ListFocusInputs<T> {\n /** Whether focus should wrap when navigating. */\n wrap: SignalLike<boolean>;\n\n /** Whether the list is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** The direction that text is read based on the users locale. */\n textDirection: SignalLike<'rtl' | 'ltr'>;\n}\n\n/** Options for list navigation. */\nexport interface ListNavigationOpts<T> {\n /**\n * Whether to focus the item's element.\n * Defaults to true.\n */\n focusElement?: boolean;\n\n /**\n * The list of items to navigate through.\n * Defaults to the list of items from the inputs.\n */\n items?: T[];\n}\n\n/** Controls navigation for a list of items. */\nexport class ListNavigation<T extends ListNavigationItem> {\n constructor(readonly inputs: ListNavigationInputs<T> & {focusManager: ListFocus<T>}) {}\n\n /** Navigates to the given item. */\n goto(item?: T, opts?: ListNavigationOpts<T>): boolean {\n return item ? this.inputs.focusManager.focus(item, opts) : false;\n }\n\n /** Navigates to the next item in the list. */\n next(opts?: ListNavigationOpts<T>): boolean {\n return this._advance(1, opts);\n }\n\n /** Peeks the next item in the list. */\n peekNext(opts?: ListNavigationOpts<T>): T | undefined {\n return this._peek(1, opts);\n }\n\n /** Navigates to the previous item in the list. */\n prev(opts?: ListNavigationOpts<T>): boolean {\n return this._advance(-1, opts);\n }\n\n /** Peeks the previous item in the list. */\n peekPrev(opts?: ListNavigationOpts<T>): T | undefined {\n return this._peek(-1, opts);\n }\n\n /** Navigates to the first item in the list. */\n first(opts?: ListNavigationOpts<T>): boolean {\n const item = this.peekFirst(opts);\n return item ? this.goto(item, opts) : false;\n }\n\n /** Navigates to the last item in the list. */\n last(opts?: ListNavigationOpts<T>): boolean {\n const item = this.peekLast(opts);\n return item ? this.goto(item, opts) : false;\n }\n\n /** Gets the first focusable item from the given list of items. */\n peekFirst(opts?: ListNavigationOpts<T>): T | undefined {\n const items = opts?.items ?? this.inputs.items();\n return items.find(i => this.inputs.focusManager.isFocusable(i));\n }\n\n /** Gets the last focusable item from the given list of items. */\n peekLast(opts?: ListNavigationOpts<T>): T | undefined {\n const items = opts?.items ?? this.inputs.items();\n for (let i = items.length - 1; i >= 0; i--) {\n if (this.inputs.focusManager.isFocusable(items[i])) {\n return items[i];\n }\n }\n return;\n }\n\n /** Advances to the next or previous focusable item in the list based on the given delta. */\n private _advance(delta: 1 | -1, opts?: ListNavigationOpts<T>): boolean {\n const item = this._peek(delta, opts);\n return item ? this.goto(item, opts) : false;\n }\n\n /** Peeks the next or previous focusable item in the list based on the given delta. */\n private _peek(delta: 1 | -1, opts?: ListNavigationOpts<T>): T | undefined {\n const items = opts?.items ?? this.inputs.items();\n const itemCount = items.length;\n const activeItem = this.inputs.focusManager.inputs.activeItem();\n const startIndex =\n opts?.items && activeItem\n ? items.indexOf(activeItem)\n : this.inputs.focusManager.activeIndex();\n\n const step = (i: number) =>\n this.inputs.wrap() ? (i + delta + itemCount) % itemCount : i + delta;\n\n // If wrapping is enabled, this loop ultimately terminates when `i` gets back to `startIndex`\n // in the case that all options are disabled. If wrapping is disabled, the loop terminates\n // when the index goes out of bounds.\n for (let i = step(startIndex); i !== startIndex && i < itemCount && i >= 0; i = step(i)) {\n if (this.inputs.focusManager.isFocusable(items[i])) {\n return items[i];\n }\n }\n\n return;\n }\n}\n"],"names":["ListFocus","inputs","prevActiveItem","signal","undefined","prevActiveIndex","computed","items","indexOf","activeIndex","activeItem","constructor","isListDisabled","disabled","every","i","getActiveDescendant","focusMode","id","getListTabIndex","getItemTabIndex","item","focus","opts","isFocusable","set","focusElement","element","softDisabled","ListNavigation","goto","focusManager","next","_advance","peekNext","_peek","prev","peekPrev","first","peekFirst","last","peekLast","find","length","delta","itemCount","startIndex","step","wrap"],"mappings":";;MA4CaA,SAAS,CAAA;EAcCC,MAAA;AAZrBC,EAAAA,cAAc,GAAGC,MAAM,CAAgBC,SAAS,CAAC;EAGjDC,eAAe,GAAGC,QAAQ,CAAC,MAAK;IAC9B,OAAO,IAAI,CAACJ,cA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CAAC,GAAG6B,KAAK;IAKtE,KAAK,IAAI7B,CAAC,GAAGgC,IAAI,CAACD,UAAU,CAAC,EAAE/B,CAAC,KAAK+B,UAAU,IAAI/B,CAAC,GAAG8B,SAAS,IAAI9B,CAAC,IAAI,CAAC,EAAEA,CAAC,GAAGgC,IAAI,CAAChC,CAAC,CAAC,EAAE;AACvF,MAAA,IAAI,IAAI,CAACd,MAAM,CAAC8B,YAAY,CAACP,WAAW,CAACjB,KAAK,CAACQ,CAAC,CAAC,CAAC,EAAE;QAClD,OAAOR,KAAK,CAACQ,CAAC,CAAC;AACjB;AACF;AAEA,IAAA;AACF;AACD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"_list-typeahead-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-selection/list-selection.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-typeahead/list-typeahead.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed, signal, SignalLike, WritableSignalLike} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\n\n/** Represents an item in a collection, such as a listbox option, that can be selected. */\nexport interface ListSelectionItem<V> extends ListFocusItem {\n /** The value of the item. */\n value: SignalLike<V>;\n\n /** Whether the item is selectable. */\n selectable: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for a collection that contains selectable items. */\nexport interface ListSelectionInputs<T extends ListSelectionItem<V>, V> extends ListFocusInputs<T> {\n /** Whether multiple items in the list can be selected at once. */\n multi: SignalLike<boolean>;\n\n /** The current value of the list selection. */\n values: WritableSignalLike<V[]>;\n\n /** The selection strategy used by the list. */\n selectionMode: SignalLike<'follow' | 'explicit'>;\n}\n\n/** Controls selection for a list of items. */\nexport class ListSelection<T extends ListSelectionItem<V>, V> {\n /** The start index to use for range selection. */\n rangeStartIndex = signal<number>(0);\n\n /** The end index to use for range selection. */\n rangeEndIndex = signal<number>(0);\n\n /** The currently selected items. */\n selectedItems = computed(() =>\n this.inputs.items().filter(item => this.inputs.values().includes(item.value())),\n );\n\n constructor(readonly inputs: ListSelectionInputs<T, V> & {focusManager: ListFocus<T>}) {}\n\n /** Selects the item at the current active index. */\n select(item?: ListSelectionItem<V>, opts = {anchor: true}) {\n item = item ?? (this.inputs.focusManager.inputs.activeItem() as ListSelectionItem<V>);\n\n if (\n !item ||\n item.disabled() ||\n !item.selectable() ||\n !this.inputs.focusManager.isFocusable(item as T) ||\n this.inputs.values().includes(item.value())\n ) {\n return;\n }\n\n if (!this.inputs.multi()) {\n this.deselectAll();\n }\n\n const index = this.inputs.items().findIndex(i => i === item);\n if (opts.anchor) {\n this.beginRangeSelection(index);\n }\n this.inputs.values.update(values => values.concat(item.value()));\n }\n\n /** Deselects the item at the current active index. */\n deselect(item?: ListSelectionItem<V>) {\n item = item ?? this.inputs.focusManager.inputs.activeItem();\n\n if (item && !item.disabled() && item.selectable()) {\n this.inputs.values.update(values => values.filter(value => value !== item.value()));\n }\n }\n\n /** Toggles the item at the current active index. */\n toggle(item?: ListSelectionItem<V>) {\n item = item ?? this.inputs.focusManager.inputs.activeItem();\n if (item) {\n this.inputs.values().includes(item.value()) ? this.deselect(item) : this.select(item);\n }\n }\n\n /** Toggles only the item at the current active index. */\n toggleOne() {\n const item = this.inputs.focusManager.inputs.activeItem();\n if (item) {\n this.inputs.values().includes(item.value()) ? this.deselect() : this.selectOne();\n }\n }\n\n /** Selects all items in the list. */\n selectAll() {\n if (!this.inputs.multi()) {\n return; // Should we log a warning?\n }\n\n for (const item of this.inputs.items()) {\n this.select(item, {anchor: false});\n }\n\n this.beginRangeSelection();\n }\n\n /** Deselects all items in the list. */\n deselectAll() {\n // If an item is not in the list, it forcefully gets deselected.\n // This actually creates a bug for the following edge case:\n //\n // Setup: An item is not in the list (maybe it's lazily loaded), and it is disabled & selected.\n // Expected: If deselectAll() is called, it should NOT get deselected (because it is disabled).\n // Actual: Calling deselectAll() will still deselect the item.\n //\n // Why? Because we can't check if the item is disabled if it's not in the list.\n //\n // Alternatively, we could NOT deselect items that are not in the list, but this has the\n // inverse (and more common) effect of keeping enabled items selected when they aren't in the\n // list.\n\n for (const value of this.inputs.values()) {\n const item = this.inputs.items().find(i => i.value() === value);\n\n item\n ? this.deselect(item)\n : this.inputs.values.update(values => values.filter(v => v !== value));\n }\n }\n\n /**\n * Selects all items in the list or deselects all\n * items in the list if all items are already selected.\n */\n toggleAll() {\n const selectableValues = this.inputs\n .items()\n .filter(i => !i.disabled() && i.selectable() && this.inputs.focusManager.isFocusable(i))\n .map(i => i.value());\n\n selectableValues.every(i => this.inputs.values().includes(i))\n ? this.deselectAll()\n : this.selectAll();\n }\n\n /** Sets the selection to only the current active item. */\n selectOne() {\n const item = this.inputs.focusManager.inputs.activeItem();\n if (item && (item.disabled() || !item.selectable())) {\n return;\n }\n\n this.deselectAll();\n\n if (this.inputs.values().length > 0 && !this.inputs.multi()) {\n return;\n }\n\n this.select();\n }\n\n /**\n * Selects all items in the list up to the anchor item.\n *\n * Deselects all items that were previously within the\n * selected range that are now outside of the selected range\n */\n selectRange(opts = {anchor: true}) {\n const isStartOfRange = this.inputs.focusManager.prevActiveIndex() === this.rangeStartIndex();\n\n if (isStartOfRange && opts.anchor) {\n this.beginRangeSelection(this.inputs.focusManager.prevActiveIndex());\n }\n\n const itemsInRange = this._getItemsFromIndex(this.rangeStartIndex());\n const itemsOutOfRange = this._getItemsFromIndex(this.rangeEndIndex()).filter(\n i => !itemsInRange.includes(i),\n );\n\n for (const item of itemsOutOfRange) {\n this.deselect(item);\n }\n\n for (const item of itemsInRange) {\n this.select(item, {anchor: false});\n }\n\n if (itemsInRange.length) {\n const item = itemsInRange.pop();\n const index = this.inputs.items().findIndex(i => i === item);\n this.rangeEndIndex.set(index);\n }\n }\n\n /** Marks the given index as the start of a range selection. */\n beginRangeSelection(index: number = this.inputs.focusManager.activeIndex()) {\n this.rangeStartIndex.set(index);\n this.rangeEndIndex.set(index);\n }\n\n /** Returns the items in the list starting from the given index. */\n private _getItemsFromIndex(index: number) {\n if (index === -1) {\n return [];\n }\n\n const upper = Math.max(this.inputs.focusManager.activeIndex(), index);\n const lower = Math.min(this.inputs.focusManager.activeIndex(), index);\n\n const items = [];\n for (let i = lower; i <= upper; i++) {\n items.push(this.inputs.items()[i]);\n }\n\n if (this.inputs.focusManager.activeIndex() < index) {\n return items.reverse();\n }\n\n return items;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed, signal, SignalLike} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\n\n/**\n * Represents an item in a collection, such as a listbox option, than can be navigated to by\n * typeahead.\n */\nexport interface ListTypeaheadItem extends ListFocusItem {\n /** The text used by the typeahead search. */\n searchTerm: SignalLike<string>;\n}\n\n/**\n * Represents the required inputs for a collection that contains items that can be navigated to by\n * typeahead.\n */\nexport interface ListTypeaheadInputs<T extends ListTypeaheadItem> extends ListFocusInputs<T> {\n /** The amount of time before the typeahead search is reset. */\n typeaheadDelay: SignalLike<number>;\n}\n\n/** Controls typeahead for a list of items. */\nexport class ListTypeahead<T extends ListTypeaheadItem> {\n /** A reference to the timeout for resetting the typeahead search. */\n timeout?: ReturnType<typeof setTimeout> | undefined;\n\n /** The focus controller of the parent list. */\n focusManager: ListFocus<T>;\n\n /** Whether the user is actively typing a typeahead search query. */\n isTyping = computed(() => this._query().length > 0);\n\n /** Keeps track of the characters that typeahead search is being called with. */\n private _query = signal('');\n\n /** The index where that the typeahead search was initiated from. */\n private _startIndex = signal<number | undefined>(undefined);\n\n constructor(readonly inputs: ListTypeaheadInputs<T> & {focusManager: ListFocus<T>}) {\n this.focusManager = inputs.focusManager;\n }\n\n /** Performs a typeahead search, appending the given character to the search string. */\n search(char: string): boolean {\n if (char.length !== 1) {\n return false;\n }\n\n if (!this.isTyping() && char === ' ') {\n return false;\n }\n\n if (this._startIndex() === undefined) {\n this._startIndex.set(this.focusManager.activeIndex());\n }\n\n clearTimeout(this.timeout);\n this._query.update(q => q + char.toLowerCase());\n const item = this._getItem();\n\n if (item) {\n this.focusManager.focus(item);\n }\n\n this.timeout = setTimeout(() => {\n this._query.set('');\n this._startIndex.set(undefined);\n }, this.inputs.typeaheadDelay());\n\n return true;\n }\n\n /**\n * Returns the first item whose search term matches the\n * current query starting from the the current anchor index.\n */\n private _getItem() {\n const items = this.focusManager.inputs.items();\n const itemCount = items.length;\n const startIndex = this._startIndex()!;\n\n for (let i = 0; i < itemCount; i++) {\n const index = (startIndex + 1 + i) % itemCount;\n const item = items[index];\n\n if (\n this.focusManager.isFocusable(item) &&\n item.searchTerm().toLowerCase().startsWith(this._query())\n ) {\n return item;\n }\n }\n\n return undefined;\n }\n}\n"],"names":["ListSelection","inputs","rangeStartIndex","signal","rangeEndIndex","selectedItems","computed","items","filter","item","values","includes","value","constructor","select","opts","anchor","focusManager","activeItem","disabled","selectable","isFocusable","multi","deselectAll","index","findIndex","i","beginRangeSelection","update","concat","deselect","toggle","toggleOne","selectOne","selectAll","find","v","toggleAll","selectableValues","map","every","length","selectRange","isStartOfRange","prevActiveIndex","itemsInRange","_getItemsFromIndex","itemsOutOfRange","pop","set","activeIndex","upper","Math","max","lower","min","push","reverse","ListTypeahead","timeout","isTyping","_query","_startIndex","undefined","search","char","clearTimeout","q","toLowerCase","_getItem","focus","setTimeout","typeaheadDelay","itemCount","startIndex","searchTerm","startsWith"],"mappings":";;MAiCaA,aAAa,CAAA;EAYHC,MAAA;AAVrBC,EAAAA,eAAe,GAAGC,MAAM,CAAS,CAAC,CAAC;AAGnCC,EAAAA,aAAa,GAAGD,MAAM,CAAS,CAAC,CAAC;AAGjCE,EAAAA,aAAa,GAAG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,IAAI,CAAC;AAC/B;AAEA,IAAA,IAAI,CAACkD,OAAO,GAAGY,UAAU,CAAC,MAAK;AAC7B,MAAA,IAAI,CAACV,MAAM,CAACZ,GAAG,CAAC,EAAE,CAAC;AACnB,MAAA,IAAI,CAACa,WAAW,CAACb,GAAG,CAACc,SAAS,CAAC;KAChC,EAAE,IAAI,CAAC9D,MAAM,CAACuE,cAAc,EAAE,CAAC;AAEhC,IAAA,OAAO,IAAI;AACb;AAMQH,EAAAA,QAAQA,GAAA;IACd,MAAM9D,KAAK,GAAG,IAAI,CAACU,YAAY,CAAChB,MAAM,CAACM,KAAK,EAAE;AAC9C,IAAA,MAAMkE,SAAS,GAAGlE,KAAK,CAACkC,MAAM;AAC9B,IAAA,MAAMiC,UAAU,GAAG,IAAI,CAACZ,WAAW,EAAG;IAEtC,KAAK,IAAIpC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG+C,SAAS,EAAE/C,CAAC,EAAE,EAAE;MAClC,MAAMF,KAAK,GAAG,CAACkD,UAAU,GAAG,CAAC,GAAGhD,CAAC,IAAI+C,SAAS;AAC9C,MAAA,MAAMhE,IAAI,GAAGF,KAAK,CAACiB,KAAK,CAAC;MAEzB,IACE,IAAI,CAACP,YAAY,CAACI,WAAW,CAACZ,IAAI,CAAC,IACnCA,IAAI,CAACkE,UAAU,EAAE,CAACP,WAAW,EAAE,CAACQ,UAAU,CAAC,IAAI,CAACf,MAAM,EAAE,CAAC,EACzD;AACA,QAAA,OAAOpD,IAAI;AACb;AACF;AAEA,IAAA,OAAOsD,SAAS;AAClB;AACD;;;;"}
1
+ {"version":3,"file":"_list-typeahead-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-selection/list-selection.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-typeahead/list-typeahead.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed, signal, SignalLike, WritableSignalLike} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\n\n/** Represents an item in a collection, such as a listbox option, that can be selected. */\nexport interface ListSelectionItem<V> extends ListFocusItem {\n /** The value of the item. */\n value: SignalLike<V>;\n\n /** Whether the item is selectable. */\n selectable: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for a collection that contains selectable items. */\nexport interface ListSelectionInputs<T extends ListSelectionItem<V>, V> extends ListFocusInputs<T> {\n /** Whether multiple items in the list can be selected at once. */\n multi: SignalLike<boolean>;\n\n /** The current value of the list selection. */\n values: WritableSignalLike<V[]>;\n\n /** The selection strategy used by the list. */\n selectionMode: SignalLike<'follow' | 'explicit'>;\n}\n\n/** Controls selection for a list of items. */\nexport class ListSelection<T extends ListSelectionItem<V>, V> {\n /** The start index to use for range selection. */\n rangeStartIndex = signal<number>(0);\n\n /** The end index to use for range selection. */\n rangeEndIndex = signal<number>(0);\n\n /** The currently selected items. */\n selectedItems = computed(() =>\n this.inputs.items().filter(item => this.inputs.values().includes(item.value())),\n );\n\n constructor(readonly inputs: ListSelectionInputs<T, V> & {focusManager: ListFocus<T>}) {}\n\n /** Selects the item at the current active index. */\n select(item?: ListSelectionItem<V>, opts = {anchor: true}) {\n item = item ?? (this.inputs.focusManager.inputs.activeItem() as ListSelectionItem<V>);\n\n if (\n !item ||\n item.disabled() ||\n !item.selectable() ||\n !this.inputs.focusManager.isFocusable(item as T) ||\n this.inputs.values().includes(item.value())\n ) {\n return;\n }\n\n if (!this.inputs.multi()) {\n this.deselectAll();\n }\n\n const index = this.inputs.items().findIndex(i => i === item);\n if (opts.anchor) {\n this.beginRangeSelection(index);\n }\n this.inputs.values.update(values => values.concat(item.value()));\n }\n\n /** Deselects the item at the current active index. */\n deselect(item?: ListSelectionItem<V>) {\n item = item ?? this.inputs.focusManager.inputs.activeItem();\n\n if (item && !item.disabled() && item.selectable()) {\n this.inputs.values.update(values => values.filter(value => value !== item.value()));\n }\n }\n\n /** Toggles the item at the current active index. */\n toggle(item?: ListSelectionItem<V>) {\n item = item ?? this.inputs.focusManager.inputs.activeItem();\n if (item) {\n this.inputs.values().includes(item.value()) ? this.deselect(item) : this.select(item);\n }\n }\n\n /** Toggles only the item at the current active index. */\n toggleOne() {\n const item = this.inputs.focusManager.inputs.activeItem();\n if (item) {\n this.inputs.values().includes(item.value()) ? this.deselect() : this.selectOne();\n }\n }\n\n /** Selects all items in the list. */\n selectAll() {\n if (!this.inputs.multi()) {\n return; // Should we log a warning?\n }\n\n for (const item of this.inputs.items()) {\n this.select(item, {anchor: false});\n }\n\n this.beginRangeSelection();\n }\n\n /** Deselects all items in the list. */\n deselectAll() {\n // If an item is not in the list, it forcefully gets deselected.\n // This actually creates a bug for the following edge case:\n //\n // Setup: An item is not in the list (maybe it's lazily loaded), and it is disabled & selected.\n // Expected: If deselectAll() is called, it should NOT get deselected (because it is disabled).\n // Actual: Calling deselectAll() will still deselect the item.\n //\n // Why? Because we can't check if the item is disabled if it's not in the list.\n //\n // Alternatively, we could NOT deselect items that are not in the list, but this has the\n // inverse (and more common) effect of keeping enabled items selected when they aren't in the\n // list.\n\n for (const value of this.inputs.values()) {\n const item = this.inputs.items().find(i => i.value() === value);\n\n item\n ? this.deselect(item)\n : this.inputs.values.update(values => values.filter(v => v !== value));\n }\n }\n\n /**\n * Selects all items in the list or deselects all\n * items in the list if all items are already selected.\n */\n toggleAll() {\n const selectableValues = this.inputs\n .items()\n .filter(i => !i.disabled() && i.selectable() && this.inputs.focusManager.isFocusable(i))\n .map(i => i.value());\n\n selectableValues.every(i => this.inputs.values().includes(i))\n ? this.deselectAll()\n : this.selectAll();\n }\n\n /** Sets the selection to only the current active item. */\n selectOne() {\n const item = this.inputs.focusManager.inputs.activeItem();\n if (item && (item.disabled() || !item.selectable())) {\n return;\n }\n\n this.deselectAll();\n\n if (this.inputs.values().length > 0 && !this.inputs.multi()) {\n return;\n }\n\n this.select();\n }\n\n /**\n * Selects all items in the list up to the anchor item.\n *\n * Deselects all items that were previously within the\n * selected range that are now outside of the selected range\n */\n selectRange(opts = {anchor: true}) {\n const isStartOfRange = this.inputs.focusManager.prevActiveIndex() === this.rangeStartIndex();\n\n if (isStartOfRange && opts.anchor) {\n this.beginRangeSelection(this.inputs.focusManager.prevActiveIndex());\n }\n\n const itemsInRange = this._getItemsFromIndex(this.rangeStartIndex());\n const itemsOutOfRange = this._getItemsFromIndex(this.rangeEndIndex()).filter(\n i => !itemsInRange.includes(i),\n );\n\n for (const item of itemsOutOfRange) {\n this.deselect(item);\n }\n\n for (const item of itemsInRange) {\n this.select(item, {anchor: false});\n }\n\n if (itemsInRange.length) {\n const item = itemsInRange.pop();\n const index = this.inputs.items().findIndex(i => i === item);\n this.rangeEndIndex.set(index);\n }\n }\n\n /** Marks the given index as the start of a range selection. */\n beginRangeSelection(index: number = this.inputs.focusManager.activeIndex()) {\n this.rangeStartIndex.set(index);\n this.rangeEndIndex.set(index);\n }\n\n /** Returns the items in the list starting from the given index. */\n private _getItemsFromIndex(index: number) {\n if (index === -1) {\n return [];\n }\n\n const upper = Math.max(this.inputs.focusManager.activeIndex(), index);\n const lower = Math.min(this.inputs.focusManager.activeIndex(), index);\n\n const items = [];\n for (let i = lower; i <= upper; i++) {\n items.push(this.inputs.items()[i]);\n }\n\n if (this.inputs.focusManager.activeIndex() < index) {\n return items.reverse();\n }\n\n return items;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed, signal, SignalLike} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\n\n/**\n * Represents an item in a collection, such as a listbox option, than can be navigated to by\n * typeahead.\n */\nexport interface ListTypeaheadItem extends ListFocusItem {\n /** The text used by the typeahead search. */\n searchTerm: SignalLike<string>;\n}\n\n/**\n * Represents the required inputs for a collection that contains items that can be navigated to by\n * typeahead.\n */\nexport interface ListTypeaheadInputs<T extends ListTypeaheadItem> extends ListFocusInputs<T> {\n /** The amount of time before the typeahead search is reset. */\n typeaheadDelay: SignalLike<number>;\n}\n\n/** Controls typeahead for a list of items. */\nexport class ListTypeahead<T extends ListTypeaheadItem> {\n /** A reference to the timeout for resetting the typeahead search. */\n timeout?: ReturnType<typeof setTimeout> | undefined;\n\n /** The focus controller of the parent list. */\n focusManager: ListFocus<T>;\n\n /** Whether the user is actively typing a typeahead search query. */\n isTyping = computed(() => this._query().length > 0);\n\n /** Keeps track of the characters that typeahead search is being called with. */\n private _query = signal('');\n\n /** The index where that the typeahead search was initiated from. */\n private _startIndex = signal<number | undefined>(undefined);\n\n constructor(readonly inputs: ListTypeaheadInputs<T> & {focusManager: ListFocus<T>}) {\n this.focusManager = inputs.focusManager;\n }\n\n /** Performs a typeahead search, appending the given character to the search string. */\n search(char: string): boolean {\n if (char.length !== 1) {\n return false;\n }\n\n if (!this.isTyping() && char === ' ') {\n return false;\n }\n\n if (this._startIndex() === undefined) {\n this._startIndex.set(this.focusManager.activeIndex());\n }\n\n clearTimeout(this.timeout);\n this._query.update(q => q + char.toLowerCase());\n const item = this._getItem();\n\n if (item) {\n this.focusManager.focus(item);\n }\n\n this.timeout = setTimeout(() => {\n this._query.set('');\n this._startIndex.set(undefined);\n }, this.inputs.typeaheadDelay());\n\n return true;\n }\n\n /**\n * Returns the first item whose search term matches the\n * current query starting from the the current anchor index.\n */\n private _getItem() {\n const items = this.focusManager.inputs.items();\n const itemCount = items.length;\n const startIndex = this._startIndex()!;\n\n for (let i = 0; i < itemCount; i++) {\n const index = (startIndex + 1 + i) % itemCount;\n const item = items[index];\n\n if (\n this.focusManager.isFocusable(item) &&\n item.searchTerm().toLowerCase().startsWith(this._query())\n ) {\n return item;\n }\n }\n\n return undefined;\n }\n}\n"],"names":["ListSelection","inputs","rangeStartIndex","signal","rangeEndIndex","selectedItems","computed","items","filter","item","values","includes","value","constructor","select","opts","anchor","focusManager","activeItem","disabled","selectable","isFocusable","multi","deselectAll","index","findIndex","i","beginRangeSelection","update","concat","deselect","toggle","toggleOne","selectOne","selectAll","find","v","toggleAll","selectableValues","map","every","length","selectRange","isStartOfRange","prevActiveIndex","itemsInRange","_getItemsFromIndex","itemsOutOfRange","pop","set","activeIndex","upper","Math","max","lower","min","push","reverse","ListTypeahead","timeout","isTyping","_query","_startIndex","undefined","search","char","clearTimeout","q","toLowerCase","_getItem","focus","setTimeout","typeaheadDelay","itemCount","startIndex","searchTerm","startsWith"],"mappings":";;MAiCaA,aAAa,CAAA;EAYHC,MAAA;AAVrBC,EAAAA,eAAe,GAAGC,MAAM,CAAS,CAAC,CAAC;AAGnCC,EAAAA,aAAa,GAAGD,MAAM,CAAS,CAAC,CAAC;AAGjCE,EAAAA,aAAa,GAAGC,QAAQ,CAAC,MACvB,IAAI,CAACL,MAAM,CAACM,KAAK,EAAE,CAACC,MAAM,CAACC,IAAI,IAAI,IAAI,CAACR,MAAM,CAACS,MAAM,EAAE,CAACC,QAAQ,CAACF,IAAI,CAACG,KAAK,EAAE,CAAC,CAAC,CAChF;EAEDC,WAAAA,CAAqBZ,MAAgE,EAAA;IAAhE,IAAM,CAAAA,MAAA,GAANA,MAAM;AAA6D;AAGxFa,EAAAA,MAAMA,CAACL,IAA2B,EAAEM,IAAI,GAAG;AAACC,IAAAA,MAAM,EAAE;AAAK,GAAA,EAAA;AACvDP,IAAAA,IAAI,GAAGA,IAAI,IAAK,IAAI,CAACR,MAAM,CAACgB,YAAY,CAAChB,MAAM,CAACiB,UAAU,EAA2B;IAErF,IACE,CAACT,IAAI,IACLA,IAAI,CAACU,QAAQ,EAAE,IACf,CAACV,IAAI,CAACW,UAAU,EAAE,IAClB,CAAC,IAAI,CAACnB,MAAM,CAACgB,YAAY,CAACI,WAAW,CAACZ,IAAS,CAAC,IAChD,IAAI,CAACR,MAAM,CAACS,MAAM,EAA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