@angular/aria 22.0.0-next.8 → 22.0.0-rc.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 (54) hide show
  1. package/fesm2022/_accordion-chunk.mjs +11 -1
  2. package/fesm2022/_accordion-chunk.mjs.map +1 -1
  3. package/fesm2022/_click-event-manager-chunk.mjs +1 -1
  4. package/fesm2022/_deferred-content-chunk.mjs +6 -6
  5. package/fesm2022/_list-chunk.mjs +1 -1
  6. package/fesm2022/_list-navigation-chunk.mjs +1 -1
  7. package/fesm2022/_list-typeahead-chunk.mjs +1 -1
  8. package/fesm2022/_menu-chunk.mjs +27 -4
  9. package/fesm2022/_menu-chunk.mjs.map +1 -1
  10. package/fesm2022/_option-chunk.mjs +11 -1
  11. package/fesm2022/_option-chunk.mjs.map +1 -1
  12. package/fesm2022/_tabs-chunk.mjs +1 -1
  13. package/fesm2022/_toolbar-widget-group-chunk.mjs +10 -1
  14. package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
  15. package/fesm2022/_tree-chunk.mjs +6 -1
  16. package/fesm2022/_tree-chunk.mjs.map +1 -1
  17. package/fesm2022/{_collection-chunk.mjs → _violations-chunk.mjs} +11 -2
  18. package/fesm2022/_violations-chunk.mjs.map +1 -0
  19. package/fesm2022/_widget-chunk.mjs +11 -1
  20. package/fesm2022/_widget-chunk.mjs.map +1 -1
  21. package/fesm2022/accordion.mjs +102 -48
  22. package/fesm2022/accordion.mjs.map +1 -1
  23. package/fesm2022/aria.mjs +1 -1
  24. package/fesm2022/aria.mjs.map +1 -1
  25. package/fesm2022/combobox.mjs +9 -9
  26. package/fesm2022/combobox.mjs.map +1 -1
  27. package/fesm2022/grid.mjs +20 -13
  28. package/fesm2022/grid.mjs.map +1 -1
  29. package/fesm2022/listbox.mjs +15 -17
  30. package/fesm2022/listbox.mjs.map +1 -1
  31. package/fesm2022/menu.mjs +79 -24
  32. package/fesm2022/menu.mjs.map +1 -1
  33. package/fesm2022/private.mjs +2 -2
  34. package/fesm2022/tabs.mjs +117 -54
  35. package/fesm2022/tabs.mjs.map +1 -1
  36. package/fesm2022/toolbar.mjs +31 -10
  37. package/fesm2022/toolbar.mjs.map +1 -1
  38. package/fesm2022/tree.mjs +18 -20
  39. package/fesm2022/tree.mjs.map +1 -1
  40. package/package.json +2 -2
  41. package/types/_accordion-chunk.d.ts +2 -0
  42. package/types/_grid-chunk.d.ts +2 -0
  43. package/types/_menu-chunk.d.ts +9 -1
  44. package/types/_toolbar-chunk.d.ts +2 -0
  45. package/types/accordion.d.ts +3 -5
  46. package/types/combobox.d.ts +26 -10
  47. package/types/grid.d.ts +0 -8
  48. package/types/listbox.d.ts +0 -4
  49. package/types/menu.d.ts +6 -12
  50. package/types/private.d.ts +4 -1
  51. package/types/tabs.d.ts +3 -11
  52. package/types/toolbar.d.ts +1 -6
  53. package/types/tree.d.ts +0 -6
  54. package/fesm2022/_collection-chunk.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"_option-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/listbox/listbox.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/listbox/option.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 {OptionPattern} from './option';\nimport {KeyboardEventManager, Modifier, ClickEventManager} from '../behaviors/event-manager';\nimport {computed, signal, SignalLike} from '../behaviors/signal-like/signal-like';\nimport {List, ListInputs} from '../behaviors/list/list';\n\n/** Represents the required inputs for a listbox. */\nexport type ListboxInputs<V> = ListInputs<OptionPattern<V>, V> & {\n /** A unique identifier for the listbox. */\n id: SignalLike<string>;\n\n /** Whether the listbox is readonly. */\n readonly: SignalLike<boolean>;\n};\n\n/** Controls the state of a listbox. */\nexport class ListboxPattern<V> {\n readonly listBehavior: List<OptionPattern<V>, V>;\n\n /** Whether the listbox has been interacted with. */\n readonly hasBeenInteracted = signal(false);\n\n /** Whether the list is vertically or horizontally oriented. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the listbox is disabled. */\n readonly disabled = computed(() => this.listBehavior.disabled());\n\n /** Whether the listbox is readonly. */\n readonly readonly: SignalLike<boolean>;\n\n /** The tab index of the listbox. */\n readonly tabIndex: SignalLike<-1 | 0> = computed(() => this.listBehavior.tabIndex());\n\n /** The id of the current active item. */\n readonly activeDescendant = computed(() => this.listBehavior.activeDescendant());\n\n /** Whether multiple items in the list can be selected at once. */\n multi: SignalLike<boolean>;\n\n /** The number of items in the listbox. */\n readonly setsize = computed(() => this.inputs.items().length);\n\n /** Whether the listbox selection follows focus. */\n readonly followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** Whether the listbox should wrap. Used to disable wrapping while range selecting. */\n readonly wrap = signal(true);\n\n /** The key used to navigate to the previous item in the list. */\n readonly prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next item in the list. */\n readonly nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** Represents the space key. Does nothing when the user is actively using typeahead. */\n readonly dynamicSpaceKey = computed(() => (this.listBehavior.isTyping() ? '' : ' '));\n\n /** The regexp used to decide if a key should trigger typeahead. */\n readonly typeaheadRegexp = /^.$/;\n\n /** The keydown event manager for the listbox. */\n readonly keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n if (this.readonly()) {\n return manager\n .on(this.prevKey, () => this.listBehavior.prev(), {ignoreRepeat: false})\n .on(this.nextKey, () => this.listBehavior.next(), {ignoreRepeat: false})\n .on('Home', () => this.listBehavior.first())\n .on('End', () => this.listBehavior.last())\n .on(this.typeaheadRegexp, e => this.listBehavior.search(e.key));\n }\n\n if (!this.followFocus()) {\n manager\n .on(this.prevKey, () => this.listBehavior.prev(), {ignoreRepeat: false})\n .on(this.nextKey, () => this.listBehavior.next(), {ignoreRepeat: false})\n .on('Home', () => this.listBehavior.first())\n .on('End', () => this.listBehavior.last())\n .on(this.typeaheadRegexp, e => this.listBehavior.search(e.key));\n }\n\n if (this.followFocus()) {\n manager\n .on(this.prevKey, () => this.listBehavior.prev({selectOne: true}), {ignoreRepeat: false})\n .on(this.nextKey, () => this.listBehavior.next({selectOne: true}), {ignoreRepeat: false})\n .on('Home', () => this.listBehavior.first({selectOne: true}))\n .on('End', () => this.listBehavior.last({selectOne: true}))\n .on(this.typeaheadRegexp, e => this.listBehavior.search(e.key, {selectOne: true}));\n }\n\n if (this.inputs.multi()) {\n manager\n .on(Modifier.Any, 'Shift', () => this.listBehavior.anchor(this.listBehavior.activeIndex()))\n .on(Modifier.Shift, this.prevKey, () => this.listBehavior.prev({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on(Modifier.Shift, this.nextKey, () => this.listBehavior.next({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () =>\n this.listBehavior.first({selectRange: true, anchor: false}),\n )\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () =>\n this.listBehavior.last({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, 'Enter', () =>\n this.listBehavior.updateSelection({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, this.dynamicSpaceKey, () =>\n this.listBehavior.updateSelection({selectRange: true, anchor: false}),\n );\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager\n .on(this.dynamicSpaceKey, () => this.listBehavior.toggle())\n .on('Enter', () => this.listBehavior.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => this.listBehavior.toggleAll());\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => this.listBehavior.toggleOne());\n manager.on('Enter', () => this.listBehavior.toggleOne());\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => this.listBehavior.prev(), {\n ignoreRepeat: false,\n })\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => this.listBehavior.next(), {\n ignoreRepeat: false,\n })\n .on([Modifier.Ctrl, Modifier.Meta], ' ', () => this.listBehavior.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => this.listBehavior.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Home', () => this.listBehavior.first())\n .on([Modifier.Ctrl, Modifier.Meta], 'End', () => this.listBehavior.last())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => {\n this.listBehavior.toggleAll();\n this.listBehavior.select(); // Ensure the currect option remains selected.\n });\n }\n\n return manager;\n });\n\n /** The click event manager for the listbox. */\n readonly clickManager = computed(() => {\n const manager = new ClickEventManager<PointerEvent>();\n\n if (this.readonly()) {\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!));\n }\n\n if (this.multi()) {\n manager.on(Modifier.Shift, e =>\n this.listBehavior.goto(this._getItem(e)!, {selectRange: true}),\n );\n }\n\n if (!this.multi() && this.followFocus()) {\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!, {selectOne: true}));\n }\n\n if (!this.multi() && !this.followFocus()) {\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!, {toggle: true}));\n }\n\n if (this.multi() && this.followFocus()) {\n return manager\n .on(e => this.listBehavior.goto(this._getItem(e)!, {selectOne: true}))\n .on(Modifier.Ctrl, e => this.listBehavior.goto(this._getItem(e)!, {toggle: true}));\n }\n\n if (this.multi() && !this.followFocus()) {\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!, {toggle: true}));\n }\n\n return manager;\n });\n\n constructor(readonly inputs: ListboxInputs<V>) {\n this.readonly = inputs.readonly;\n this.orientation = inputs.orientation;\n this.multi = inputs.multi;\n this.listBehavior = new List(inputs);\n }\n\n /** Returns a set of violations */\n validate(): string[] {\n const violations: string[] = [];\n\n if (!this.inputs.multi() && this.inputs.value().length > 1) {\n violations.push(\n `A single-select listbox should not have multiple selected options. Selected options: ${this.inputs.value().join(', ')}`,\n );\n }\n\n return violations;\n }\n\n /** Handles keydown events for the listbox. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.hasBeenInteracted.set(true);\n this.keydown().handle(event);\n }\n }\n\n onClick(event: PointerEvent) {\n if (!this.disabled()) {\n this.hasBeenInteracted.set(true);\n this.clickManager().handle(event);\n }\n }\n\n onFocusIn() {\n this.hasBeenInteracted.set(true);\n }\n\n /**\n * Sets the listbox to it's default initial state.\n *\n * Sets the active index of the listbox to the first focusable selected\n * item if one exists. Otherwise, sets focus to the first focusable item.\n *\n * This method should be called once the listbox and it's options are properly initialized,\n * meaning the ListboxPattern and OptionPatterns should have references to each other before this\n * is called.\n */\n setDefaultState() {\n let firstItem: OptionPattern<V> | null = null;\n\n for (const item of this.inputs.items()) {\n if (this.listBehavior.isFocusable(item)) {\n if (!firstItem) {\n firstItem = item;\n }\n if (item.selected()) {\n this.inputs.activeItem.set(item);\n return;\n }\n }\n }\n\n if (firstItem) {\n this.inputs.activeItem.set(firstItem);\n if (this.followFocus()) {\n this.listBehavior.select();\n }\n }\n }\n\n /**\n * Sets the default active state of the listbox before receiving interaction for the first time.\n */\n setDefaultStateEffect(): void {\n if (this.hasBeenInteracted()) return;\n\n this.setDefaultState();\n }\n\n protected _getItem(e: PointerEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n\n const element = e.target.closest('[role=\"option\"]');\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 {computed, SignalLike} from '../behaviors/signal-like/signal-like';\nimport {List, ListInputs, ListItem} from '../behaviors/list/list';\n\n/**\n * Represents the properties exposed by a listbox that need to be accessed by an option.\n * This exists to avoid circular dependency errors between the listbox and option.\n */\ninterface ListboxPattern<V> {\n inputs: ListInputs<OptionPattern<V>, V>;\n listBehavior: List<OptionPattern<V>, V>;\n}\n\n/** Represents the required inputs for an option in a listbox. */\nexport interface OptionInputs<V> extends Omit<ListItem<V>, 'index' | 'selectable'> {\n listbox: SignalLike<ListboxPattern<V> | undefined>;\n}\n\n/** Represents an option in a listbox. */\nexport class OptionPattern<V> {\n /** A unique identifier for the option. */\n readonly id: SignalLike<string>;\n\n /** The value of the option. */\n readonly value: SignalLike<V>;\n\n /** The position of the option in the list. */\n readonly index = computed(() => this.listbox()?.inputs.items().indexOf(this) ?? -1);\n\n /** Whether the option is active. */\n readonly active = computed(() => this.listbox()?.inputs.activeItem() === this);\n\n /** Whether the option is selected. */\n readonly selected = computed(() => this.listbox()?.inputs.value().includes(this.value()));\n\n /** Whether the option is selectable. */\n readonly selectable = () => true;\n\n /** Whether the option is disabled. */\n readonly disabled: SignalLike<boolean>;\n\n /** The text used by the typeahead search. */\n readonly searchTerm: SignalLike<string>;\n\n /** A reference to the parent listbox. */\n readonly listbox: SignalLike<ListboxPattern<V> | undefined>;\n\n /** The tab index of the option. */\n readonly tabIndex = computed(() => this.listbox()?.listBehavior.getItemTabindex(this));\n\n /** The html element that should receive focus. */\n readonly element: SignalLike<HTMLElement | undefined>;\n\n constructor(args: OptionInputs<V>) {\n this.id = args.id;\n this.value = args.value;\n this.listbox = args.listbox;\n this.element = args.element;\n this.disabled = args.disabled;\n this.searchTerm = args.searchTerm;\n }\n}\n"],"names":["ListboxPattern","inputs","listBehavior","hasBeenInteracted","signal","orientation","disabled","computed","readonly","tabIndex","activeDescendant","multi","setsize","items","length","followFocus","selectionMode","wrap","prevKey","textDirection","nextKey","dynamicSpaceKey","isTyping","typeaheadRegexp","keydown","manager","KeyboardEventManager","on","prev","ignoreRepeat","next","first","last","e","search","key","selectOne","Modifier","Any","anchor","activeIndex","Shift","selectRange","Ctrl","Meta","updateSelection","toggle","toggleAll","toggleOne","select","clickManager","ClickEventManager","goto","_getItem","constructor","List","validate","violations","value","push","join","onKeydown","event","set","handle","onClick","onFocusIn","setDefaultState","firstItem","item","isFocusable","selected","activeItem","setDefaultStateEffect","target","HTMLElement","element","closest","find","i","OptionPattern","id","index","listbox","indexOf","active","includes","selectable","searchTerm","getItemTabindex","args"],"mappings":";;;;MAuBaA,cAAc,CAAA;EAiLJC,MAAA;EAhLZC,YAAY;AAGZC,EAAAA,iBAAiB,GAAGC,MAAM,CAAC,KAAK,CAAC;EAGjCC,WAAW;EAGXC,QAAQ,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACL,YAAY,CAACI,QAAQ,EAAE,CAAC;EAGvDE,QAAQ;EAGRC,QAAQ,GAAuBF,QAAQ,CAAC,MAAM,IAAI,CAACL,YAAY,CAACO,QAAQ,EAAE,CAAC;EAG3EC,gBAAgB,GAAGH,QAAQ,CAAC,MAAM,IAAI,CAACL,YAAY,CAACQ,gBAAgB,EAAE,CAAC;EAGhFC,KAAK;AAGIC,EAAAA,OAAO,GAAGL,QAAQ,CAAC,MAAM,IAAI,CAACN,MAAM,CAACY,KAAK,EAAE,CAACC,MAAM,CAAC;AAGpDC,EAAAA,WAAW,GAAGR,QAAQ,CAAC,MAAM,IAAI,CAACN,MAAM,CAACe,aAAa,EAAE,KAAK,QAAQ,CAAC;AAGtEC,EAAAA,IAAI,GAAGb,MAAM,CAAC,IAAI,CAAC;EAGnBc,OAAO,GAAGX,QAAQ,CAAC,MAAK;IAC/B,IAAI,IAAI,CAACN,MAAM,CAACI,WAAW,EAAE,KAAK,UAAU,EAAE;AAC5C,MAAA,OAAO,SAAS;AAClB,IAAA;AACA,IAAA,OAAO,IAAI,CAACJ,MAAM,CAACkB,aAAa,EAAE,KAAK,KAAK,GAAG,YAAY,GAAG,WAA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M,GAAG9E,QAAQ,CAAC,MAAM,IAAI,CAAC4E,OAAO,EAAE,EAAElF,MAAM,CAACuE,UAAU,EAAE,KAAK,IAAI,CAAC;EAGrED,QAAQ,GAAGhE,QAAQ,CAAC,MAAM,IAAI,CAAC4E,OAAO,EAAE,EAAElF,MAAM,CAACyD,KAAK,EAAE,CAAC4B,QAAQ,CAAC,IAAI,CAAC5B,KAAK,EAAE,CAAC,CAAC;EAGhF6B,UAAU,GAAGA,MAAM,IAAI;EAGvBjF,QAAQ;EAGRkF,UAAU;EAGVL,OAAO;AAGP1E,EAAAA,QAAQ,GAAGF,QAAQ,CAAC,MAAM,IAAI,CAAC4E,OAAO,EAAE,EAAEjF,YAAY,CAACuF,eAAe,CAAC,IAAI,CAAC,CAAC;EAG7Eb,OAAO;EAEhBtB,WAAAA,CAAYoC,IAAqB,EAAA;AAC/B,IAAA,IAAI,CAACT,EAAE,GAAGS,IAAI,CAACT,EAAE;AACjB,IAAA,IAAI,CAACvB,KAAK,GAAGgC,IAAI,CAAChC,KAAK;AACvB,IAAA,IAAI,CAACyB,OAAO,GAAGO,IAAI,CAACP,OAAO;AAC3B,IAAA,IAAI,CAACP,OAAO,GAAGc,IAAI,CAACd,OAAO;AAC3B,IAAA,IAAI,CAACtE,QAAQ,GAAGoF,IAAI,CAACpF,QAAQ;AAC7B,IAAA,IAAI,CAACkF,UAAU,GAAGE,IAAI,CAACF,UAAU;AACnC,EAAA;AACD;;;;"}
1
+ {"version":3,"file":"_option-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/listbox/listbox.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/listbox/option.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 {OptionPattern} from './option';\nimport {KeyboardEventManager, Modifier, ClickEventManager} from '../behaviors/event-manager';\nimport {computed, signal, SignalLike} from '../behaviors/signal-like/signal-like';\nimport {List, ListInputs} from '../behaviors/list/list';\n\n/** Represents the required inputs for a listbox. */\nexport type ListboxInputs<V> = ListInputs<OptionPattern<V>, V> & {\n /** A unique identifier for the listbox. */\n id: SignalLike<string>;\n\n /** Whether the listbox is readonly. */\n readonly: SignalLike<boolean>;\n};\n\n/** Controls the state of a listbox. */\nexport class ListboxPattern<V> {\n readonly listBehavior: List<OptionPattern<V>, V>;\n\n /** Whether the listbox has been interacted with. */\n readonly hasBeenInteracted = signal(false);\n\n /** Whether the list is vertically or horizontally oriented. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the listbox is disabled. */\n readonly disabled = computed(() => this.listBehavior.disabled());\n\n /** Whether the listbox is readonly. */\n readonly readonly: SignalLike<boolean>;\n\n /** The tab index of the listbox. */\n readonly tabIndex: SignalLike<-1 | 0> = computed(() => this.listBehavior.tabIndex());\n\n /** The id of the current active item. */\n readonly activeDescendant = computed(() => this.listBehavior.activeDescendant());\n\n /** Whether multiple items in the list can be selected at once. */\n multi: SignalLike<boolean>;\n\n /** The number of items in the listbox. */\n readonly setsize = computed(() => this.inputs.items().length);\n\n /** Whether the listbox selection follows focus. */\n readonly followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** Whether the listbox should wrap. Used to disable wrapping while range selecting. */\n readonly wrap = signal(true);\n\n /** The key used to navigate to the previous item in the list. */\n readonly prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next item in the list. */\n readonly nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** Represents the space key. Does nothing when the user is actively using typeahead. */\n readonly dynamicSpaceKey = computed(() => (this.listBehavior.isTyping() ? '' : ' '));\n\n /** The regexp used to decide if a key should trigger typeahead. */\n readonly typeaheadRegexp = /^.$/;\n\n /** The keydown event manager for the listbox. */\n readonly keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n if (this.readonly()) {\n return manager\n .on(this.prevKey, () => this.listBehavior.prev(), {ignoreRepeat: false})\n .on(this.nextKey, () => this.listBehavior.next(), {ignoreRepeat: false})\n .on('Home', () => this.listBehavior.first())\n .on('End', () => this.listBehavior.last())\n .on(this.typeaheadRegexp, e => this.listBehavior.search(e.key));\n }\n\n if (!this.followFocus()) {\n manager\n .on(this.prevKey, () => this.listBehavior.prev(), {ignoreRepeat: false})\n .on(this.nextKey, () => this.listBehavior.next(), {ignoreRepeat: false})\n .on('Home', () => this.listBehavior.first())\n .on('End', () => this.listBehavior.last())\n .on(this.typeaheadRegexp, e => this.listBehavior.search(e.key));\n }\n\n if (this.followFocus()) {\n manager\n .on(this.prevKey, () => this.listBehavior.prev({selectOne: true}), {ignoreRepeat: false})\n .on(this.nextKey, () => this.listBehavior.next({selectOne: true}), {ignoreRepeat: false})\n .on('Home', () => this.listBehavior.first({selectOne: true}))\n .on('End', () => this.listBehavior.last({selectOne: true}))\n .on(this.typeaheadRegexp, e => this.listBehavior.search(e.key, {selectOne: true}));\n }\n\n if (this.inputs.multi()) {\n manager\n .on(Modifier.Any, 'Shift', () => this.listBehavior.anchor(this.listBehavior.activeIndex()))\n .on(Modifier.Shift, this.prevKey, () => this.listBehavior.prev({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on(Modifier.Shift, this.nextKey, () => this.listBehavior.next({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () =>\n this.listBehavior.first({selectRange: true, anchor: false}),\n )\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () =>\n this.listBehavior.last({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, 'Enter', () =>\n this.listBehavior.updateSelection({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, this.dynamicSpaceKey, () =>\n this.listBehavior.updateSelection({selectRange: true, anchor: false}),\n );\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager\n .on(this.dynamicSpaceKey, () => this.listBehavior.toggle())\n .on('Enter', () => this.listBehavior.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => this.listBehavior.toggleAll());\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => this.listBehavior.toggleOne());\n manager.on('Enter', () => this.listBehavior.toggleOne());\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => this.listBehavior.prev(), {\n ignoreRepeat: false,\n })\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => this.listBehavior.next(), {\n ignoreRepeat: false,\n })\n .on([Modifier.Ctrl, Modifier.Meta], ' ', () => this.listBehavior.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => this.listBehavior.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Home', () => this.listBehavior.first())\n .on([Modifier.Ctrl, Modifier.Meta], 'End', () => this.listBehavior.last())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => {\n this.listBehavior.toggleAll();\n this.listBehavior.select(); // Ensure the currect option remains selected.\n });\n }\n\n return manager;\n });\n\n /** The click event manager for the listbox. */\n readonly clickManager = computed(() => {\n const manager = new ClickEventManager<PointerEvent>();\n\n if (this.readonly()) {\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!));\n }\n\n if (this.multi()) {\n manager.on(Modifier.Shift, e =>\n this.listBehavior.goto(this._getItem(e)!, {selectRange: true}),\n );\n }\n\n if (!this.multi() && this.followFocus()) {\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!, {selectOne: true}));\n }\n\n if (!this.multi() && !this.followFocus()) {\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!, {toggle: true}));\n }\n\n if (this.multi() && this.followFocus()) {\n return manager\n .on(e => this.listBehavior.goto(this._getItem(e)!, {selectOne: true}))\n .on(Modifier.Ctrl, e => this.listBehavior.goto(this._getItem(e)!, {toggle: true}));\n }\n\n if (this.multi() && !this.followFocus()) {\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!, {toggle: true}));\n }\n\n return manager;\n });\n\n constructor(readonly inputs: ListboxInputs<V>) {\n this.readonly = inputs.readonly;\n this.orientation = inputs.orientation;\n this.multi = inputs.multi;\n this.listBehavior = new List(inputs);\n }\n\n /** Returns a set of violations */\n validate(): string[] {\n const violations: string[] = [];\n\n if (!this.inputs.multi() && this.inputs.value().length > 1) {\n violations.push(\n `A single-select listbox should not have multiple selected options. Selected options: ${this.inputs.value().join(', ')}`,\n );\n }\n\n const values = this.inputs.items().map(o => o.value());\n const duplicates = values.filter((val, idx) => values.indexOf(val) !== idx);\n if (duplicates.length > 0) {\n violations.push(`Duplicate option value '${duplicates[0]}' detected inside ngListbox.`);\n }\n\n const ids = this.inputs.items().map(o => o.id());\n const duplicateIds = ids.filter((id, idx) => ids.indexOf(id) !== idx);\n if (duplicateIds.length > 0) {\n violations.push(`Duplicate option ID '${duplicateIds[0]}' detected inside ngListbox.`);\n }\n\n return violations;\n }\n\n /** Handles keydown events for the listbox. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.hasBeenInteracted.set(true);\n this.keydown().handle(event);\n }\n }\n\n onClick(event: PointerEvent) {\n if (!this.disabled()) {\n this.hasBeenInteracted.set(true);\n this.clickManager().handle(event);\n }\n }\n\n onFocusIn() {\n this.hasBeenInteracted.set(true);\n }\n\n /**\n * Sets the listbox to it's default initial state.\n *\n * Sets the active index of the listbox to the first focusable selected\n * item if one exists. Otherwise, sets focus to the first focusable item.\n *\n * This method should be called once the listbox and it's options are properly initialized,\n * meaning the ListboxPattern and OptionPatterns should have references to each other before this\n * is called.\n */\n setDefaultState() {\n let firstItem: OptionPattern<V> | null = null;\n\n for (const item of this.inputs.items()) {\n if (this.listBehavior.isFocusable(item)) {\n if (!firstItem) {\n firstItem = item;\n }\n if (item.selected()) {\n this.inputs.activeItem.set(item);\n return;\n }\n }\n }\n\n if (firstItem) {\n this.inputs.activeItem.set(firstItem);\n if (this.followFocus()) {\n this.listBehavior.select();\n }\n }\n }\n\n /**\n * Sets the default active state of the listbox before receiving interaction for the first time.\n */\n setDefaultStateEffect(): void {\n if (this.hasBeenInteracted()) return;\n\n this.setDefaultState();\n }\n\n protected _getItem(e: PointerEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n\n const element = e.target.closest('[role=\"option\"]');\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 {computed, SignalLike} from '../behaviors/signal-like/signal-like';\nimport {List, ListInputs, ListItem} from '../behaviors/list/list';\n\n/**\n * Represents the properties exposed by a listbox that need to be accessed by an option.\n * This exists to avoid circular dependency errors between the listbox and option.\n */\ninterface ListboxPattern<V> {\n inputs: ListInputs<OptionPattern<V>, V>;\n listBehavior: List<OptionPattern<V>, V>;\n}\n\n/** Represents the required inputs for an option in a listbox. */\nexport interface OptionInputs<V> extends Omit<ListItem<V>, 'index' | 'selectable'> {\n listbox: SignalLike<ListboxPattern<V> | undefined>;\n}\n\n/** Represents an option in a listbox. */\nexport class OptionPattern<V> {\n /** A unique identifier for the option. */\n readonly id: SignalLike<string>;\n\n /** The value of the option. */\n readonly value: SignalLike<V>;\n\n /** The position of the option in the list. */\n readonly index = computed(() => this.listbox()?.inputs.items().indexOf(this) ?? -1);\n\n /** Whether the option is active. */\n readonly active = computed(() => this.listbox()?.inputs.activeItem() === this);\n\n /** Whether the option is selected. */\n readonly selected = computed(() => this.listbox()?.inputs.value().includes(this.value()));\n\n /** Whether the option is selectable. */\n readonly selectable = () => true;\n\n /** Whether the option is disabled. */\n readonly disabled: SignalLike<boolean>;\n\n /** The text used by the typeahead search. */\n readonly searchTerm: SignalLike<string>;\n\n /** A reference to the parent listbox. */\n readonly listbox: SignalLike<ListboxPattern<V> | undefined>;\n\n /** The tab index of the option. */\n readonly tabIndex = computed(() => this.listbox()?.listBehavior.getItemTabindex(this));\n\n /** The html element that should receive focus. */\n readonly element: SignalLike<HTMLElement | undefined>;\n\n constructor(args: OptionInputs<V>) {\n this.id = args.id;\n this.value = args.value;\n this.listbox = args.listbox;\n this.element = args.element;\n this.disabled = args.disabled;\n this.searchTerm = args.searchTerm;\n }\n}\n"],"names":["ListboxPattern","inputs","listBehavior","hasBeenInteracted","signal","orientation","disabled","computed","readonly","tabIndex","activeDescendant","multi","setsize","items","length","followFocus","selectionMode","wrap","prevKey","textDirection","nextKey","dynamicSpaceKey","isTyping","typeaheadRegexp","keydown","manager","KeyboardEventManager","on","prev","ignoreRepeat","next","first","last","e","search","key","selectOne","Modifier","Any","anchor","activeIndex","Shift","selectRange","Ctrl","Meta","updateSelection","toggle","toggleAll","toggleOne","select","clickManager","ClickEventManager","goto","_getItem","constructor","List","validate","violations","value","push","join","values","map","o","duplicates","filter","val","idx","indexOf","ids","id","duplicateIds","onKeydown","event","set","handle","onClick","onFocusIn","setDefaultState","firstItem","item","isFocusable","selected","activeItem","setDefaultStateEffect","target","HTMLElement","element","closest","find","i","OptionPattern","index","listbox","active","includes","selectable","searchTerm","getItemTabindex","args"],"mappings":";;;;MAuBaA,cAAc,CAAA;EAiLJC,MAAA;EAhLZC,YAAY;AAGZC,EAAAA,iBAAiB,GAAGC,MAAM,CAAC,KAAK,CAAC;EAGjCC,WAAW;EAGXC,QAAQ,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACL,YAAY,CAACI,QAAQ,EAAE,CAAC;EAGvDE,QAAQ;EAGRC,QAAQ,GAAuBF,QAAQ,CAAC,MAAM,IAAI,CAACL,YAAY,CAACO,QAAQ,EAA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-chunk.mjs';
2
- import { signal, computed, linkedSignal, KeyboardEventManager } from './_collection-chunk.mjs';
2
+ import { signal, computed, linkedSignal, KeyboardEventManager } from './_violations-chunk.mjs';
3
3
  import { ListFocus, ListNavigation } from './_list-navigation-chunk.mjs';
4
4
  import { ClickEventManager } from './_click-event-manager-chunk.mjs';
5
5
 
@@ -1,4 +1,4 @@
1
- import { signal, computed, KeyboardEventManager } from './_collection-chunk.mjs';
1
+ import { signal, computed, KeyboardEventManager } from './_violations-chunk.mjs';
2
2
  import { List } from './_list-chunk.mjs';
3
3
 
4
4
  class ToolbarPattern {
@@ -101,6 +101,15 @@ class ToolbarPattern {
101
101
  typeaheadDelay: () => 0
102
102
  });
103
103
  }
104
+ validate() {
105
+ const violations = [];
106
+ const values = this.inputs.items().map(w => w.value());
107
+ const duplicates = values.filter((val, idx) => values.indexOf(val) !== idx);
108
+ if (duplicates.length > 0) {
109
+ violations.push(`Duplicate value '${duplicates[0]}' detected inside ngToolbar.`);
110
+ }
111
+ return violations;
112
+ }
104
113
  onKeydown(event) {
105
114
  if (this.disabled()) return;
106
115
  this.hasBeenInteracted.set(true);
@@ -1 +1 @@
1
- {"version":3,"file":"_toolbar-widget-group-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/toolbar/toolbar.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/toolbar/toolbar-widget.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/toolbar/toolbar-widget-group.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 '../behaviors/signal-like/signal-like';\nimport {KeyboardEventManager} from '../behaviors/event-manager';\nimport {List, ListInputs} from '../behaviors/list/list';\nimport {ToolbarWidgetPattern} from './toolbar-widget';\n\n/** Represents the required inputs for a toolbar. */\nexport type ToolbarInputs<V> = Omit<\n ListInputs<ToolbarWidgetPattern<V>, V>,\n 'multi' | 'typeaheadDelay' | 'selectionMode' | 'focusMode'\n> & {\n /** A function that returns the toolbar item associated with a given element. */\n getItem: (e: Element) => ToolbarWidgetPattern<V> | undefined;\n};\n\n/** Controls the state of a toolbar. */\nexport class ToolbarPattern<V> {\n /** The list behavior for the toolbar. */\n readonly listBehavior: List<ToolbarWidgetPattern<V>, V>;\n\n /** Whether the toolbar has been interacted with. */\n readonly hasBeenInteracted = signal(false);\n\n /** Whether the tablist is vertically or horizontally oriented. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether disabled items in the group should be focusable. */\n readonly softDisabled: SignalLike<boolean>;\n\n /** Whether the toolbar is disabled. */\n readonly disabled = computed(() => this.listBehavior.disabled());\n\n /** The tab index of the toolbar (if using activedescendant). */\n readonly tabIndex = computed(() => this.listBehavior.tabIndex());\n\n /** The id of the current active widget (if using activedescendant). */\n readonly activeDescendant = computed(() => this.listBehavior.activeDescendant());\n\n /** The currently active item in the toolbar. */\n readonly activeItem = () => this.listBehavior.inputs.activeItem();\n\n /** The key used to navigate to the previous widget. */\n private readonly _prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next widget. */\n private readonly _nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The alternate key used to navigate to the previous widget. */\n private readonly _altPrevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n }\n return 'ArrowUp';\n });\n\n /** The alternate key used to navigate to the next widget. */\n private readonly _altNextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n }\n return 'ArrowDown';\n });\n\n /** The keydown event manager for the toolbar. */\n private readonly _keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n return manager\n .on(this._nextKey, () => this.listBehavior.next(), {ignoreRepeat: false})\n .on(this._prevKey, () => this.listBehavior.prev(), {ignoreRepeat: false})\n .on(this._altNextKey, () => this._groupNext(), {ignoreRepeat: false})\n .on(this._altPrevKey, () => this._groupPrev(), {ignoreRepeat: false})\n .on(' ', () => this.select())\n .on('Enter', () => this.select())\n .on('Home', () => this.listBehavior.first())\n .on('End', () => this.listBehavior.last());\n });\n\n /** Navigates to the next widget in a widget group. */\n private _groupNext() {\n const currGroup = this.inputs.activeItem()?.group();\n const nextGroup = this.listBehavior.navigationBehavior.peekNext()?.group();\n\n if (!currGroup) {\n return;\n }\n\n if (currGroup !== nextGroup) {\n this.listBehavior.goto(\n this.listBehavior.navigationBehavior.peekFirst({\n items: currGroup.inputs.items(),\n })!,\n );\n\n return;\n }\n\n this.listBehavior.next();\n }\n\n /** Navigates to the previous widget in a widget group. */\n private _groupPrev() {\n const currGroup = this.inputs.activeItem()?.group();\n const nextGroup = this.listBehavior.navigationBehavior.peekPrev()?.group();\n\n if (!currGroup) {\n return;\n }\n\n if (currGroup !== nextGroup) {\n this.listBehavior.goto(\n this.listBehavior.navigationBehavior.peekLast({\n items: currGroup.inputs.items(),\n })!,\n );\n\n return;\n }\n\n this.listBehavior.prev();\n }\n\n /** Navigates to the widget targeted by a pointer event. */\n private _goto(e: MouseEvent) {\n const item = this.inputs.getItem(e.target as Element);\n\n if (item) {\n this.listBehavior.goto(item);\n this.select();\n }\n }\n\n select() {\n const group = this.inputs.activeItem()?.group();\n\n if (!group?.multi()) {\n group?.inputs.items().forEach(i => this.listBehavior.deselect(i));\n }\n\n this.listBehavior.toggle();\n }\n\n constructor(readonly inputs: ToolbarInputs<V>) {\n this.orientation = inputs.orientation;\n this.softDisabled = inputs.softDisabled;\n\n this.listBehavior = new List({\n ...inputs,\n multi: () => true,\n focusMode: () => 'roving',\n selectionMode: () => 'explicit',\n typeaheadDelay: () => 0, // Toolbar widgets do not support typeahead.\n });\n }\n\n /** Handles keydown events for the toolbar. */\n onKeydown(event: KeyboardEvent) {\n if (this.disabled()) return;\n this.hasBeenInteracted.set(true);\n this._keydown().handle(event);\n }\n\n onPointerdown(event: PointerEvent) {\n this.hasBeenInteracted.set(true);\n event.preventDefault();\n }\n\n onFocusIn() {\n this.hasBeenInteracted.set(true);\n }\n\n /** Handles click events for the toolbar. */\n onClick(event: MouseEvent) {\n if (this.disabled() || (event as PointerEvent).pointerType === '') return;\n this._goto(event);\n }\n\n /**\n * Sets the toolbar to its default initial state.\n *\n * Sets the active index to the selected widget if one exists and is focusable.\n * Otherwise, sets the active index to the first focusable widget.\n */\n setDefaultState() {\n const firstItem = this.listBehavior.navigationBehavior.peekFirst({\n items: this.inputs.items(),\n });\n\n if (firstItem) {\n this.inputs.activeItem.set(firstItem);\n }\n }\n\n /** Sets the default active state of the toolbar before receiving interaction for the first time. */\n setDefaultStateEffect(): void {\n if (this.hasBeenInteracted()) return;\n\n if (this.inputs.items().length > 0) {\n this.setDefaultState();\n }\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} from '../behaviors/signal-like/signal-like';\nimport {ListItem} from '../behaviors/list/list';\nimport type {ToolbarPattern} from './toolbar';\nimport {ToolbarWidgetGroupPattern} from './toolbar-widget-group';\n\n/** Represents the required inputs for a toolbar widget in a toolbar. */\nexport interface ToolbarWidgetInputs<V> extends Omit<\n ListItem<V>,\n 'searchTerm' | 'index' | 'selectable'\n> {\n /** A reference to the parent toolbar. */\n toolbar: SignalLike<ToolbarPattern<V>>;\n\n /** A reference to the parent widget group. */\n group: SignalLike<ToolbarWidgetGroupPattern<ToolbarWidgetPattern<V>, V> | undefined>;\n}\n\nexport class ToolbarWidgetPattern<V> implements ListItem<V> {\n /** A unique identifier for the widget. */\n readonly id = () => this.inputs.id();\n\n /** The html element that should receive focus. */\n readonly element = () => this.inputs.element();\n\n /** Whether the widget is disabled. */\n readonly disabled = () => this.inputs.disabled() || this.group()?.disabled() || false;\n\n /** A reference to the parent toolbar. */\n readonly group = () => this.inputs.group();\n\n /** A reference to the toolbar containing the widget. */\n readonly toolbar = () => this.inputs.toolbar();\n\n /** The tabindex of the widget. */\n readonly tabIndex = computed(() => this.toolbar().listBehavior.getItemTabindex(this));\n\n /** The text used by the typeahead search. */\n readonly searchTerm = () => ''; // Unused because toolbar does not support typeahead.\n\n /** The value associated with the widget. */\n readonly value = () => this.inputs.value();\n\n /** Whether the widget is selectable. */\n readonly selectable = () => true; // Unused because toolbar does not support selection.\n\n /** The position of the widget within the toolbar. */\n readonly index = computed(() => this.toolbar().inputs.items().indexOf(this) ?? -1);\n\n /** Whether the widget is selected (only relevant in a selection group). */\n readonly selected = computed(() =>\n this.toolbar().listBehavior.inputs.value().includes(this.value()),\n );\n\n /** Whether the widget is currently the active one (focused). */\n readonly active: SignalLike<boolean> = computed(() => this.toolbar().activeItem() === this);\n\n constructor(readonly inputs: ToolbarWidgetInputs<V>) {}\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 {ListItem} from '../behaviors/list/list';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport type {ToolbarPattern} from './toolbar';\n\n/** Represents the required inputs for a toolbar widget group. */\nexport interface ToolbarWidgetGroupInputs<T extends ListItem<V>, V> {\n /** A reference to the parent toolbar. */\n toolbar: SignalLike<ToolbarPattern<V> | undefined>;\n\n /** Whether the widget group is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The list of items within the widget group. */\n items: SignalLike<T[]>;\n\n /** Whether the group allows multiple widgets to be selected. */\n multi: SignalLike<boolean>;\n}\n\n/** A group of widgets within a toolbar that provides nested navigation. */\nexport class ToolbarWidgetGroupPattern<T extends ListItem<V>, V> {\n /** Whether the widget is disabled. */\n readonly disabled = () => this.inputs.disabled();\n\n /** A reference to the parent toolbar. */\n readonly toolbar = () => this.inputs.toolbar();\n\n /** Whether the group allows multiple widgets to be selected. */\n readonly multi = () => this.inputs.multi();\n\n readonly searchTerm = () => ''; // Unused because toolbar does not support typeahead.\n readonly value = () => '' as V; // Unused because toolbar does not support selection.\n readonly selectable = () => true; // Unused because toolbar does not support selection.\n readonly element = () => undefined; // Unused because toolbar does not focus the group element.\n\n constructor(readonly inputs: ToolbarWidgetGroupInputs<T, V>) {}\n}\n"],"names":["ToolbarPattern","inputs","listBehavior","hasBeenInteracted","signal","orientation","softDisabled","disabled","computed","tabIndex","activeDescendant","activeItem","_prevKey","textDirection","_nextKey","_altPrevKey","_altNextKey","_keydown","manager","KeyboardEventManager","on","next","ignoreRepeat","prev","_groupNext","_groupPrev","select","first","last","currGroup","group","nextGroup","navigationBehavior","peekNext","goto","peekFirst","items","peekPrev","peekLast","_goto","e","item","getItem","target","multi","forEach","i","deselect","toggle","constructor","List","focusMode","selectionMode","typeaheadDelay","onKeydown","event","set","handle","onPointerdown","preventDefault","onFocusIn","onClick","pointerType","setDefaultState","firstItem","setDefaultStateEffect","length","ToolbarWidgetPattern","id","element","toolbar","getItemTabindex","searchTerm","value","selectable","index","indexOf","selected","includes","active","ToolbarWidgetGroupPattern","undefined"],"mappings":";;;MAuBaA,cAAc,CAAA;EAwIJC,MAAA;EAtIZC,YAAY;AAGZC,EAAAA,iBAAiB,GAAGC,MAAM,CAAC,KAAK,CAAC;EAGjCC,WAAW;EAGXC,YAAY;EAGZC,QAAQ,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACN,YAAY,CAACK,QAAQ,EAAE,CAAC;EAGvDE,QAAQ,GAAGD,QAAQ,CAAC,MAAM,IAAI,CAACN,YAAY,CAACO,QAAQ,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k.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/toolbar/toolbar.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/toolbar/toolbar-widget.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/toolbar/toolbar-widget-group.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 '../behaviors/signal-like/signal-like';\nimport {KeyboardEventManager} from '../behaviors/event-manager';\nimport {List, ListInputs} from '../behaviors/list/list';\nimport {ToolbarWidgetPattern} from './toolbar-widget';\n\n/** Represents the required inputs for a toolbar. */\nexport type ToolbarInputs<V> = Omit<\n ListInputs<ToolbarWidgetPattern<V>, V>,\n 'multi' | 'typeaheadDelay' | 'selectionMode' | 'focusMode'\n> & {\n /** A function that returns the toolbar item associated with a given element. */\n getItem: (e: Element) => ToolbarWidgetPattern<V> | undefined;\n};\n\n/** Controls the state of a toolbar. */\nexport class ToolbarPattern<V> {\n /** The list behavior for the toolbar. */\n readonly listBehavior: List<ToolbarWidgetPattern<V>, V>;\n\n /** Whether the toolbar has been interacted with. */\n readonly hasBeenInteracted = signal(false);\n\n /** Whether the tablist is vertically or horizontally oriented. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether disabled items in the group should be focusable. */\n readonly softDisabled: SignalLike<boolean>;\n\n /** Whether the toolbar is disabled. */\n readonly disabled = computed(() => this.listBehavior.disabled());\n\n /** The tab index of the toolbar (if using activedescendant). */\n readonly tabIndex = computed(() => this.listBehavior.tabIndex());\n\n /** The id of the current active widget (if using activedescendant). */\n readonly activeDescendant = computed(() => this.listBehavior.activeDescendant());\n\n /** The currently active item in the toolbar. */\n readonly activeItem = () => this.listBehavior.inputs.activeItem();\n\n /** The key used to navigate to the previous widget. */\n private readonly _prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next widget. */\n private readonly _nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The alternate key used to navigate to the previous widget. */\n private readonly _altPrevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n }\n return 'ArrowUp';\n });\n\n /** The alternate key used to navigate to the next widget. */\n private readonly _altNextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n }\n return 'ArrowDown';\n });\n\n /** The keydown event manager for the toolbar. */\n private readonly _keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n return manager\n .on(this._nextKey, () => this.listBehavior.next(), {ignoreRepeat: false})\n .on(this._prevKey, () => this.listBehavior.prev(), {ignoreRepeat: false})\n .on(this._altNextKey, () => this._groupNext(), {ignoreRepeat: false})\n .on(this._altPrevKey, () => this._groupPrev(), {ignoreRepeat: false})\n .on(' ', () => this.select())\n .on('Enter', () => this.select())\n .on('Home', () => this.listBehavior.first())\n .on('End', () => this.listBehavior.last());\n });\n\n /** Navigates to the next widget in a widget group. */\n private _groupNext() {\n const currGroup = this.inputs.activeItem()?.group();\n const nextGroup = this.listBehavior.navigationBehavior.peekNext()?.group();\n\n if (!currGroup) {\n return;\n }\n\n if (currGroup !== nextGroup) {\n this.listBehavior.goto(\n this.listBehavior.navigationBehavior.peekFirst({\n items: currGroup.inputs.items(),\n })!,\n );\n\n return;\n }\n\n this.listBehavior.next();\n }\n\n /** Navigates to the previous widget in a widget group. */\n private _groupPrev() {\n const currGroup = this.inputs.activeItem()?.group();\n const nextGroup = this.listBehavior.navigationBehavior.peekPrev()?.group();\n\n if (!currGroup) {\n return;\n }\n\n if (currGroup !== nextGroup) {\n this.listBehavior.goto(\n this.listBehavior.navigationBehavior.peekLast({\n items: currGroup.inputs.items(),\n })!,\n );\n\n return;\n }\n\n this.listBehavior.prev();\n }\n\n /** Navigates to the widget targeted by a pointer event. */\n private _goto(e: MouseEvent) {\n const item = this.inputs.getItem(e.target as Element);\n\n if (item) {\n this.listBehavior.goto(item);\n this.select();\n }\n }\n\n select() {\n const group = this.inputs.activeItem()?.group();\n\n if (!group?.multi()) {\n group?.inputs.items().forEach(i => this.listBehavior.deselect(i));\n }\n\n this.listBehavior.toggle();\n }\n\n constructor(readonly inputs: ToolbarInputs<V>) {\n this.orientation = inputs.orientation;\n this.softDisabled = inputs.softDisabled;\n\n this.listBehavior = new List({\n ...inputs,\n multi: () => true,\n focusMode: () => 'roving',\n selectionMode: () => 'explicit',\n typeaheadDelay: () => 0, // Toolbar widgets do not support typeahead.\n });\n }\n\n /** Returns a set of violations */\n validate(): string[] {\n const violations: string[] = [];\n\n const values = this.inputs.items().map(w => w.value());\n const duplicates = values.filter((val, idx) => values.indexOf(val) !== idx);\n if (duplicates.length > 0) {\n violations.push(`Duplicate value '${duplicates[0]}' detected inside ngToolbar.`);\n }\n\n return violations;\n }\n\n /** Handles keydown events for the toolbar. */\n onKeydown(event: KeyboardEvent) {\n if (this.disabled()) return;\n this.hasBeenInteracted.set(true);\n this._keydown().handle(event);\n }\n\n onPointerdown(event: PointerEvent) {\n this.hasBeenInteracted.set(true);\n event.preventDefault();\n }\n\n onFocusIn() {\n this.hasBeenInteracted.set(true);\n }\n\n /** Handles click events for the toolbar. */\n onClick(event: MouseEvent) {\n if (this.disabled() || (event as PointerEvent).pointerType === '') return;\n this._goto(event);\n }\n\n /**\n * Sets the toolbar to its default initial state.\n *\n * Sets the active index to the selected widget if one exists and is focusable.\n * Otherwise, sets the active index to the first focusable widget.\n */\n setDefaultState() {\n const firstItem = this.listBehavior.navigationBehavior.peekFirst({\n items: this.inputs.items(),\n });\n\n if (firstItem) {\n this.inputs.activeItem.set(firstItem);\n }\n }\n\n /** Sets the default active state of the toolbar before receiving interaction for the first time. */\n setDefaultStateEffect(): void {\n if (this.hasBeenInteracted()) return;\n\n if (this.inputs.items().length > 0) {\n this.setDefaultState();\n }\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} from '../behaviors/signal-like/signal-like';\nimport {ListItem} from '../behaviors/list/list';\nimport type {ToolbarPattern} from './toolbar';\nimport {ToolbarWidgetGroupPattern} from './toolbar-widget-group';\n\n/** Represents the required inputs for a toolbar widget in a toolbar. */\nexport interface ToolbarWidgetInputs<V> extends Omit<\n ListItem<V>,\n 'searchTerm' | 'index' | 'selectable'\n> {\n /** A reference to the parent toolbar. */\n toolbar: SignalLike<ToolbarPattern<V>>;\n\n /** A reference to the parent widget group. */\n group: SignalLike<ToolbarWidgetGroupPattern<ToolbarWidgetPattern<V>, V> | undefined>;\n}\n\nexport class ToolbarWidgetPattern<V> implements ListItem<V> {\n /** A unique identifier for the widget. */\n readonly id = () => this.inputs.id();\n\n /** The html element that should receive focus. */\n readonly element = () => this.inputs.element();\n\n /** Whether the widget is disabled. */\n readonly disabled = () => this.inputs.disabled() || this.group()?.disabled() || false;\n\n /** A reference to the parent toolbar. */\n readonly group = () => this.inputs.group();\n\n /** A reference to the toolbar containing the widget. */\n readonly toolbar = () => this.inputs.toolbar();\n\n /** The tabindex of the widget. */\n readonly tabIndex = computed(() => this.toolbar().listBehavior.getItemTabindex(this));\n\n /** The text used by the typeahead search. */\n readonly searchTerm = () => ''; // Unused because toolbar does not support typeahead.\n\n /** The value associated with the widget. */\n readonly value = () => this.inputs.value();\n\n /** Whether the widget is selectable. */\n readonly selectable = () => true; // Unused because toolbar does not support selection.\n\n /** The position of the widget within the toolbar. */\n readonly index = computed(() => this.toolbar().inputs.items().indexOf(this) ?? -1);\n\n /** Whether the widget is selected (only relevant in a selection group). */\n readonly selected = computed(() =>\n this.toolbar().listBehavior.inputs.value().includes(this.value()),\n );\n\n /** Whether the widget is currently the active one (focused). */\n readonly active: SignalLike<boolean> = computed(() => this.toolbar().activeItem() === this);\n\n constructor(readonly inputs: ToolbarWidgetInputs<V>) {}\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 {ListItem} from '../behaviors/list/list';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport type {ToolbarPattern} from './toolbar';\n\n/** Represents the required inputs for a toolbar widget group. */\nexport interface ToolbarWidgetGroupInputs<T extends ListItem<V>, V> {\n /** A reference to the parent toolbar. */\n toolbar: SignalLike<ToolbarPattern<V> | undefined>;\n\n /** Whether the widget group is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The list of items within the widget group. */\n items: SignalLike<T[]>;\n\n /** Whether the group allows multiple widgets to be selected. */\n multi: SignalLike<boolean>;\n}\n\n/** A group of widgets within a toolbar that provides nested navigation. */\nexport class ToolbarWidgetGroupPattern<T extends ListItem<V>, V> {\n /** Whether the widget is disabled. */\n readonly disabled = () => this.inputs.disabled();\n\n /** A reference to the parent toolbar. */\n readonly toolbar = () => this.inputs.toolbar();\n\n /** Whether the group allows multiple widgets to be selected. */\n readonly multi = () => this.inputs.multi();\n\n readonly searchTerm = () => ''; // Unused because toolbar does not support typeahead.\n readonly value = () => '' as V; // Unused because toolbar does not support selection.\n readonly selectable = () => true; // Unused because toolbar does not support selection.\n readonly element = () => undefined; // Unused because toolbar does not focus the group element.\n\n constructor(readonly inputs: ToolbarWidgetGroupInputs<T, V>) {}\n}\n"],"names":["ToolbarPattern","inputs","listBehavior","hasBeenInteracted","signal","orientation","softDisabled","disabled","computed","tabIndex","activeDescendant","activeItem","_prevKey","textDirection","_nextKey","_altPrevKey","_altNextKey","_keydown","manager","KeyboardEventManager","on","next","ignoreRepeat","prev","_groupNext","_groupPrev","select","first","last","currGroup","group","nextGroup","navigationBehavior","peekNext","goto","peekFirst","items","peekPrev","peekLast","_goto","e","item","getItem","target","multi","forEach","i","deselect","toggle","constructor","List","focusMode","selectionMode","typeaheadDelay","validate","violations","values","map","w","value","duplicates","filter","val","idx","indexOf","length","push","onKeydown","event","set","handle","onPointerdown","preventDefault","onFocusIn","onClick","pointerType","setDefaultState","firstItem","setDefaultStateEffect","ToolbarWidgetPattern","id","element","toolbar","getItemTabindex","searchTerm","selectable","index","selected","includes","active","ToolbarWidgetGroupPattern","undefined"],"mappings":";;;MAuBaA,cAAc,CAAA;EAwIJC,MAAA;EAtIZC,YAAY;AAGZC,EAAAA,iBAAiB,GAAGC,MAAM,CAAC,KAAK,CAAC;EAGjCC,WAAW;EAGXC,YAAY;EAGZC,QAAQ,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACN,YAAY,CAACK,QAAQ,EAAE,CAAC;EAGvDE,QAAQ,GAAGD,QAAQ,CAAC,MAAM,IAAI,CAACN,YAAY,CAACO,QAAQ,EAAE,CAAC;EAGvDC,gBAAgB,GAAGF,QAAQ,CAAC,MAAM,IAAI,CAACN,YAAY,CAACQ,gBAAgB,EAAE,CAAC;EAGvEC,UAAU,GAAGA,MAAM,IAAI,CAACT,YAAY,CAACD,MAAM,CAACU,UAAU,EAAE;EAGhDC,QAAQ,GAAGJ,QAAQ,CAAC,MAAK;IACxC,IAAI,IAAI,CAACP,MAAM,CAACI,WAAW,EAAE,KAAK,UAAU,EAAE;AAC5C,MAAA,OAAO,SAAS;AAClB,IAAA;AACA,IAAA,OAAO,IAAI,CAACJ,MAAM,CAACY,aAAa,EAAE,KAAK,KAAK,GAAG,YAAY,GAAG,WAAW;AAC3E,EAAA,CAAC,CAAC;EAGeC,QAAQ,GAAGN,QAAQ,CAAC,MAAK;IACxC,IAAI,IAAI,CAACP,MAAM,CAACI,WAAW,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AAA;AAC/D;;;;"}
@@ -1,4 +1,4 @@
1
- import { computed, signal, KeyboardEventManager, Modifier } from './_collection-chunk.mjs';
1
+ import { computed, signal, KeyboardEventManager, Modifier } from './_violations-chunk.mjs';
2
2
  import { ListExpansion } from './_expansion-chunk.mjs';
3
3
  import { ListNavigation, ListFocus } from './_list-navigation-chunk.mjs';
4
4
  import { ListSelection, ListTypeahead } from './_list-typeahead-chunk.mjs';
@@ -409,6 +409,11 @@ class TreePattern {
409
409
  if (!this.inputs.multi() && this.inputs.value().length > 1) {
410
410
  violations.push(`A single-select tree should not have multiple selected options. Selected options: ${this.inputs.value().join(', ')}`);
411
411
  }
412
+ const values = this.inputs.items().map(t => t.value());
413
+ const duplicates = values.filter((val, idx) => values.indexOf(val) !== idx);
414
+ if (duplicates.length > 0) {
415
+ violations.push(`Duplicate tree item value '${duplicates[0]}' detected inside ngTree.`);
416
+ }
412
417
  return violations;
413
418
  }
414
419
  setDefaultState() {
@@ -1 +1 @@
1
- {"version":3,"file":"_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"],"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 readonly navigationBehavior: ListNavigation<T>;\n\n /** Controls selection for the tree. */\n readonly selectionBehavior: ListSelection<T, V>;\n\n /** Controls typeahead for the tree. */\n readonly typeaheadBehavior: ListTypeahead<T>;\n\n /** Controls focus for the tree. */\n readonly focusBehavior: ListFocus<T>;\n\n /** Controls expansion for the tree. */\n readonly expansionBehavior: ListExpansion;\n\n /** Whether the tree is disabled. */\n readonly disabled = computed(() => this.focusBehavior.isListDisabled());\n\n /** The id of the current active item. */\n readonly activeDescendant = computed(() => this.focusBehavior.getActiveDescendant());\n\n /** The tab index of the tree. */\n readonly tabIndex = computed(() => this.focusBehavior.getListTabIndex());\n\n /** The index of the currently active item in the tree (within the flattened list). */\n readonly activeIndex = computed(() => this.focusBehavior.activeIndex());\n\n /** The uncommitted index for selecting a range of options. */\n private readonly _anchorIndex = signal(0);\n\n /** Whether the list should wrap. */\n private readonly _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 // If the item has a parent, get all of the parent's children.\n // Otherwise, it is a root item, and get all other root items.\n const parent = item.parent?.();\n const siblings = parent ? parent.children?.() : this.inputs.items().filter(i => !i.parent?.());\n\n siblings?.forEach(s => this.expand(s));\n }\n\n /** Expands all items in the tree. */\n expandAll() {\n this.expansionBehavior.openAll();\n }\n\n /** Collapses all items in the tree. */\n collapseAll() {\n this.expansionBehavior.closeAll();\n }\n\n /** Checks if the given item is able to receive focus. */\n isFocusable(item: T) {\n return this.focusBehavior.isFocusable(item);\n }\n\n /** Checks if the given item is expandable. */\n isExpandable(item: T) {\n return this.expansionBehavior.isExpandable(item);\n }\n\n /** Handles updating selection for the tree. */\n updateSelection(opts: NavOptions<T> = {anchor: true}) {\n if (opts.toggle) {\n this.selectionBehavior.toggle();\n }\n if (opts.select) {\n this.selectionBehavior.select();\n }\n if (opts.selectOne) {\n this.selectionBehavior.selectOne();\n }\n if (opts.selectRange) {\n this.selectionBehavior.selectRange();\n }\n if (!opts.anchor) {\n this.anchor(this.selectionBehavior.rangeStartIndex());\n }\n }\n\n /**\n * Safely performs a navigation operation.\n */\n private _navigate(opts: NavOptions<T> = {}, operation: () => boolean) {\n if (opts?.selectRange) {\n this._wrap.set(false);\n this.selectionBehavior.rangeStartIndex.set(this._anchorIndex());\n }\n\n const moved = operation();\n\n if (moved) {\n this.updateSelection(opts);\n }\n\n this._wrap.set(true);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n SignalLike,\n computed,\n WritableSignalLike,\n signal,\n} from '../behaviors/signal-like/signal-like';\nimport {Tree, TreeItem, TreeInputs as TreeBehaviorInputs} from '../behaviors/tree/tree';\nimport {KeyboardEventManager, Modifier, ClickEventManager} from '../behaviors/event-manager';\n\n/** Represents the required inputs for a tree item. */\nexport interface TreeItemInputs<V> extends Omit<\n TreeItem<V, TreeItemPattern<V>>,\n 'index' | 'parent' | 'visible' | 'expandable'\n> {\n /** The parent item. */\n parent: SignalLike<TreeItemPattern<V> | TreePattern<V>>;\n\n /** Whether this item has children. Children can be lazily loaded. */\n hasChildren: SignalLike<boolean>;\n\n /** The tree pattern this item belongs to. */\n tree: SignalLike<TreePattern<V>>;\n}\n\n/**\n * Represents an item in a Tree.\n */\nexport class TreeItemPattern<V> implements TreeItem<V, TreeItemPattern<V>> {\n /** A unique identifier for this item. */\n readonly id: SignalLike<string> = () => this.inputs.id();\n\n /** The value of this item. */\n readonly value: SignalLike<V> = () => this.inputs.value();\n\n /** A reference to the item element. */\n readonly element: SignalLike<HTMLElement> = () => this.inputs.element()!;\n\n /** Whether the item is disabled. */\n readonly disabled: SignalLike<boolean> = () => this.inputs.disabled();\n\n /** The text used by the typeahead search. */\n readonly searchTerm: SignalLike<string> = () => this.inputs.searchTerm();\n\n /** The tree pattern this item belongs to. */\n readonly tree: SignalLike<TreePattern<V>> = () => this.inputs.tree();\n\n /** The parent item. */\n readonly parent: SignalLike<TreeItemPattern<V> | undefined> = computed(() => {\n const parent = this.inputs.parent();\n return parent instanceof TreeItemPattern ? parent : undefined;\n });\n\n /** The children items. */\n readonly children: SignalLike<TreeItemPattern<V>[]> = () => this.inputs.children() ?? [];\n\n /** The position of this item among its siblings. */\n readonly index = computed(() => this.tree().inputs.items().indexOf(this));\n\n /** Whether the item is expandable. It's expandable if children item exist. */\n readonly expandable: SignalLike<boolean> = () => this.inputs.hasChildren();\n\n /** Whether the item is selectable. */\n readonly selectable: SignalLike<boolean> = () => this.inputs.selectable();\n\n /** Whether the item is expanded. */\n readonly expanded: WritableSignalLike<boolean>;\n\n /** The level of the current item in a tree. */\n readonly level: SignalLike<number> = computed(() => this.inputs.parent().level() + 1);\n\n /** Whether this item is visible. */\n readonly visible: SignalLike<boolean> = computed(\n () => this.inputs.parent().expanded() && this.inputs.parent().visible(),\n );\n\n /** The number of items under the same parent at the same level. */\n readonly setsize = computed(() => this.inputs.parent().children().length);\n\n /** The position of this item among its siblings (1-based). */\n readonly posinset = computed(() => this.inputs.parent().children().indexOf(this) + 1);\n\n /** Whether the item is active. */\n readonly active = computed(() => this.tree().activeItem() === this);\n\n /** The tab index of the item. */\n readonly tabIndex = computed(() => this.tree().treeBehavior.getItemTabindex(this));\n\n /** Whether the item is selected. */\n readonly selected: SignalLike<boolean | undefined> = computed(() => {\n if (this.tree().nav()) {\n return undefined;\n }\n if (!this.selectable()) {\n return undefined;\n }\n return this.tree().value().includes(this.value());\n });\n\n /** The current type of this item. */\n readonly current: SignalLike<string | undefined> = computed(() => {\n if (!this.tree().nav()) {\n return undefined;\n }\n if (!this.selectable()) {\n return undefined;\n }\n return this.tree().value().includes(this.value()) ? this.tree().currentType() : undefined;\n });\n\n constructor(readonly inputs: TreeItemInputs<V>) {\n this.expanded = inputs.expanded;\n }\n}\n\n/** The selection operations that the tree can perform. */\ninterface SelectOptions {\n toggle?: boolean;\n selectOne?: boolean;\n selectRange?: boolean;\n anchor?: boolean;\n}\n\n/** Represents the required inputs for a tree. */\nexport interface TreeInputs<V> extends Omit<\n TreeBehaviorInputs<TreeItemPattern<V>, V>,\n 'multiExpandable'\n> {\n /** A unique identifier for the tree. */\n id: SignalLike<string>;\n\n /** Whether the tree is in navigation mode. */\n nav: SignalLike<boolean>;\n\n /** The aria-current type. */\n currentType: SignalLike<'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'>;\n\n /** The text direction of the tree. */\n textDirection: SignalLike<'ltr' | 'rtl'>;\n}\n\n/** Controls the state and interactions of a tree view. */\nexport class TreePattern<V> implements TreeInputs<V> {\n /** The tree behavior for the tree. */\n readonly treeBehavior: Tree<TreeItemPattern<V>, V>;\n\n /** Whether the tree has been interacted with. */\n readonly hasBeenInteracted = signal(false);\n\n /** The root level is 0. */\n readonly level = () => 0;\n\n /** The root is always expanded. */\n readonly expanded = () => true;\n\n /** The root is always visible. */\n readonly visible = () => true;\n\n /** The tab index of the tree. */\n readonly tabIndex: SignalLike<-1 | 0> = computed(() => this.treeBehavior.tabIndex());\n\n /** The id of the current active item. */\n readonly activeDescendant = computed(() => this.treeBehavior.activeDescendant());\n\n /** The direct children of the root (top-level tree items). */\n readonly children = computed(() =>\n this.inputs.items().filter(item => item.level() === this.level() + 1),\n );\n\n /** Whether the tree selection follows focus. */\n readonly followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** Whether the tree direction is RTL. */\n readonly isRtl = computed(() => this.inputs.textDirection() === 'rtl');\n\n /** The key for navigating to the previous item. */\n readonly prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.isRtl() ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key for navigating to the next item. */\n readonly nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.isRtl() ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The key for collapsing an item or moving to its parent. */\n readonly collapseKey = computed(() => {\n if (this.inputs.orientation() === 'horizontal') {\n return 'ArrowUp';\n }\n return this.isRtl() ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key for expanding an item or moving to its first child. */\n readonly expandKey = computed(() => {\n if (this.inputs.orientation() === 'horizontal') {\n return 'ArrowDown';\n }\n return this.isRtl() ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** Represents the space key. Does nothing when the user is actively using typeahead. */\n readonly dynamicSpaceKey = computed(() => (this.treeBehavior.isTyping() ? '' : ' '));\n\n /** Regular expression to match characters for typeahead. */\n readonly typeaheadRegexp = /^.$/;\n\n /** The keydown event manager for the tree. */\n readonly keydown = computed(() => {\n const manager = new KeyboardEventManager();\n const tree = this.treeBehavior;\n\n manager\n .on(this.prevKey, () => tree.prev({selectOne: this.followFocus()}), {ignoreRepeat: false})\n .on(this.nextKey, () => tree.next({selectOne: this.followFocus()}), {ignoreRepeat: false})\n .on('Home', () => tree.first({selectOne: this.followFocus()}))\n .on('End', () => tree.last({selectOne: this.followFocus()}))\n .on(this.typeaheadRegexp, e => tree.search(e.key, {selectOne: this.followFocus()}))\n .on(Modifier.Shift, '*', () => tree.expandSiblings())\n .on(this.expandKey, () => this._expandOrFirstChild({selectOne: this.followFocus()}))\n .on(this.collapseKey, () => this._collapseOrParent({selectOne: this.followFocus()}));\n\n if (this.inputs.multi()) {\n manager\n // TODO: Tracking the anchor by index can break if the\n // tree is expanded or collapsed causing the index to change.\n .on(Modifier.Any, 'Shift', () => tree.anchor(this.treeBehavior.activeIndex()))\n .on(Modifier.Shift, this.prevKey, () => tree.prev({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on(Modifier.Shift, this.nextKey, () => tree.next({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () =>\n tree.first({selectRange: true, anchor: false}),\n )\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () =>\n tree.last({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, 'Enter', () => tree.updateSelection({selectRange: true, anchor: false}))\n .on(Modifier.Shift, this.dynamicSpaceKey, () =>\n tree.updateSelection({selectRange: true, anchor: false}),\n );\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager\n .on(this.dynamicSpaceKey, () => tree.toggle())\n .on('Enter', () => tree.toggle(), {preventDefault: !this.nav()})\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => tree.toggleAll());\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => tree.selectOne());\n manager.on('Enter', () => tree.selectOne(), {preventDefault: !this.nav()});\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => tree.prev(), {ignoreRepeat: false})\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => tree.next(), {ignoreRepeat: false})\n .on([Modifier.Ctrl, Modifier.Meta], this.expandKey, () => this._expandOrFirstChild())\n .on([Modifier.Ctrl, Modifier.Meta], this.collapseKey, () => this._collapseOrParent())\n .on([Modifier.Ctrl, Modifier.Meta], ' ', () => tree.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => tree.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Home', () => tree.first())\n .on([Modifier.Ctrl, Modifier.Meta], 'End', () => tree.last())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => {\n tree.toggleAll();\n tree.select(); // Ensure the currect item remains selected.\n });\n }\n\n return manager;\n });\n\n /** The click event manager for the tree. */\n readonly clickManager = computed(() => {\n const manager = new ClickEventManager<PointerEvent>();\n\n if (this.multi()) {\n manager.on(Modifier.Shift, (e: PointerEvent) => this.goto(e, {selectRange: true}));\n }\n\n if (!this.multi()) {\n return manager.on((e: PointerEvent) => this.goto(e, {selectOne: true}));\n }\n\n if (this.multi() && this.followFocus()) {\n return manager\n .on((e: PointerEvent) => this.goto(e, {selectOne: true}))\n .on(Modifier.Ctrl, (e: PointerEvent) => this.goto(e, {toggle: true}));\n }\n\n if (this.multi() && !this.followFocus()) {\n return manager.on((e: PointerEvent) => this.goto(e, {toggle: true}));\n }\n\n return manager;\n });\n\n /** A unique identifier for the tree. */\n readonly id: SignalLike<string> = () => this.inputs.id();\n\n /** The host native element. */\n readonly element: SignalLike<HTMLElement> = () => this.inputs.element()!;\n\n /** Whether the tree is in navigation mode. */\n readonly nav: SignalLike<boolean> = () => this.inputs.nav();\n\n /** The aria-current type. */\n readonly currentType: SignalLike<\n 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'\n > = () => this.inputs.currentType();\n\n /** All items in the tree, in document order (DFS-like, a flattened list). */\n readonly items: SignalLike<TreeItemPattern<V>[]> = () => this.inputs.items();\n\n /** The focus strategy used by the tree. */\n readonly focusMode: SignalLike<'roving' | 'activedescendant'> = () => this.inputs.focusMode();\n\n /** Whether the tree is disabled. */\n readonly disabled: SignalLike<boolean> = () => this.inputs.disabled();\n\n /** The currently active item in the tree. */\n readonly activeItem: WritableSignalLike<TreeItemPattern<V> | undefined>;\n\n /** Whether disabled items should be focusable. */\n readonly softDisabled: SignalLike<boolean> = () => this.inputs.softDisabled();\n\n /** Whether the focus should wrap when navigating past the first or last item. */\n readonly wrap: SignalLike<boolean> = () => this.inputs.wrap();\n\n /** The orientation of the tree. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'> = () => this.inputs.orientation();\n\n /** The text direction of the tree. */\n readonly textDirection: SignalLike<'ltr' | 'rtl'> = () => this.textDirection();\n\n /** Whether multiple items can be selected at the same time. */\n readonly multi: SignalLike<boolean> = computed(() => (this.nav() ? false : this.inputs.multi()));\n\n /** The selection mode of the tree. */\n readonly selectionMode: SignalLike<'follow' | 'explicit'> = () => this.inputs.selectionMode();\n\n /** The delay in milliseconds to wait before clearing the typeahead buffer. */\n readonly typeaheadDelay: SignalLike<number> = () => this.inputs.typeaheadDelay();\n\n /** The current selected items of the tree. */\n readonly value: WritableSignalLike<V[]>;\n\n constructor(readonly inputs: TreeInputs<V>) {\n this.activeItem = inputs.activeItem;\n this.value = inputs.value;\n\n this.treeBehavior = new Tree<TreeItemPattern<V>, V>({\n ...inputs,\n multi: this.multi,\n multiExpandable: () => true,\n });\n }\n\n /** Returns a set of violations */\n validate(): string[] {\n const violations: string[] = [];\n\n if (!this.inputs.multi() && this.inputs.value().length > 1) {\n violations.push(\n `A single-select tree should not have multiple selected options. Selected options: ${this.inputs.value().join(', ')}`,\n );\n }\n\n return violations;\n }\n\n /**\n * Sets the tree to it's default initial state.\n *\n * Sets the active index of the tree to the first focusable selected tree item if one exists.\n * Otherwise, sets focus to the first focusable tree item.\n */\n setDefaultState() {\n let firstItem: TreeItemPattern<V> | undefined;\n\n for (const item of this.inputs.items()) {\n if (!item.visible()) continue;\n if (!this.treeBehavior.isFocusable(item)) continue;\n\n if (firstItem === undefined) {\n firstItem = item;\n }\n\n if (item.selected()) {\n this.activeItem.set(item);\n return;\n }\n }\n\n if (firstItem !== undefined) {\n this.activeItem.set(firstItem);\n }\n }\n\n /** Sets the default active state of the tree before receiving interaction for the first time. */\n setDefaultStateEffect(): void {\n if (this.hasBeenInteracted()) return;\n\n this.setDefaultState();\n }\n\n /** Handles keydown events on the tree. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.hasBeenInteracted.set(true);\n this.keydown().handle(event);\n }\n }\n\n /** Handles click events on the tree. */\n onClick(event: PointerEvent) {\n if (!this.disabled()) {\n this.hasBeenInteracted.set(true);\n this.clickManager().handle(event);\n }\n }\n\n /** Handles focusin events on the tree. */\n onFocusIn() {\n this.hasBeenInteracted.set(true);\n }\n\n /** Navigates to the given tree item in the tree. */\n goto(e: PointerEvent, opts?: SelectOptions) {\n const item = this._getItem(e);\n if (!item) return;\n\n this.treeBehavior.goto(item, opts);\n this.treeBehavior.toggleExpansion(item);\n }\n\n /** Expands the active item if possible, otherwise navigates to the first child. */\n _expandOrFirstChild(opts?: SelectOptions) {\n const item = this.treeBehavior.inputs.activeItem();\n if (item && this.treeBehavior.isExpandable(item) && !item.expanded()) {\n this.treeBehavior.expand(item);\n } else {\n this.treeBehavior.firstChild(opts);\n }\n }\n\n /** Collapses the active item if possible, otherwise navigates to the parent. */\n _collapseOrParent(opts?: SelectOptions) {\n const item = this.treeBehavior.inputs.activeItem();\n if (item && this.treeBehavior.isExpandable(item) && item.expanded()) {\n this.treeBehavior.collapse(item);\n } else {\n this.treeBehavior.parent(opts);\n }\n }\n\n /** Retrieves the TreeItemPattern associated with a DOM event, if any. */\n protected _getItem(event: Event): TreeItemPattern<V> | undefined {\n if (!(event.target instanceof HTMLElement)) {\n return;\n }\n const element = event.target.closest('[role=\"treeitem\"]');\n return this.inputs.items().find(i => i.element() === element);\n }\n}\n"],"names":["TreeListFocus","ListFocus","isFocusable","item","visible","Tree","inputs","navigationBehavior","selectionBehavior","typeaheadBehavior","focusBehavior","expansionBehavior","disabled","computed","isListDisabled","activeDescendant","getActiveDescendant","tabIndex","getListTabIndex","activeIndex","_anchorIndex","signal","_wrap","constructor","ListSelection","focusManager","ListTypeahead","ListExpansion","ListNavigation","wrap","getItemTabindex","getItemTabIndex","first","opts","_navigate","last","next","prev","firstChild","activeItem","items","children","lastChild","nextSibling","parent","prevSibling","goto","unfocus","set","undefined","anchor","index","search","char","isTyping","select","selectOne","deselect","deselectAll","toggle","toggleOne","toggleAll","toggleExpansion","isExpandable","expand","open","collapse","close","expandSiblings","siblings","filter","i","forEach","s","expandAll","openAll","collapseAll","closeAll","updateSelection","selectRange","rangeStartIndex","operation","moved","TreeItemPattern","id","value","element","searchTerm","tree","indexOf","expandable","hasChildren","selectable","expanded","level","setsize","length","posinset","active","treeBehavior","selected","nav","includes","current","currentType","TreePattern","hasBeenInteracted","followFocus","selectionMode","isRtl","textDirection","prevKey","orientation","nextKey","collapseKey","expandKey","dynamicSpaceKey","typeaheadRegexp","keydown","manager","KeyboardEventManager","on","ignoreRepeat","e","key","Modifier","Shift","_expandOrFirstChild","_collapseOrParent","multi","Any","Ctrl","Meta","preventDefault","clickManager","ClickEventManager","focusMode","softDisabled","typeaheadDelay","multiExpandable","validate","violations","push","join","setDefaultState","firstItem","setDefaultStateEffect","onKeydown","event","handle","onClick","onFocusIn","_getItem","target","HTMLElement","closest","find"],"mappings":";;;;;;AAsDA,MAAMA,aAA2C,SAAQC,SAAY,CAAA;EAC1DC,WAAWA,CAACC,IAAO,EAAA;IAC1B,OAAO,KAAK,CAACD,WAAW,CAACC,IAAI,CAAC,IAAIA,IAAI,CAACC,OAAO,EAAE;AAClD,EAAA;AACD;MAGYC,IAAI,CAAA;EAkCMC,MAAA;EAhCZC,kBAAkB;EAGlBC,iBAAiB;EAGjBC,iBAAiB;EAGjBC,aAAa;EAGbC,iBAAiB;EAGjBC,QAAQ,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACH,aAAa,CAACI,cAAc,EAAE,CAAC;EAG9DC,gBAAg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O,GAAG8D,KAAK,CAACK,MAAM,CAACE,OAAO,CAAC,mBAAmB,CAAC;AACzD,IAAA,OAAO,IAAI,CAACrJ,MAAM,CAACkC,KAAK,EAAE,CAACoH,IAAI,CAACrF,CAAC,IAAIA,CAAC,CAACe,OAAO,EAAE,KAAKA,OAAO,CAAC;AAC/D,EAAA;AACD;;;;"}
1
+ {"version":3,"file":"_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"],"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 readonly navigationBehavior: ListNavigation<T>;\n\n /** Controls selection for the tree. */\n readonly selectionBehavior: ListSelection<T, V>;\n\n /** Controls typeahead for the tree. */\n readonly typeaheadBehavior: ListTypeahead<T>;\n\n /** Controls focus for the tree. */\n readonly focusBehavior: ListFocus<T>;\n\n /** Controls expansion for the tree. */\n readonly expansionBehavior: ListExpansion;\n\n /** Whether the tree is disabled. */\n readonly disabled = computed(() => this.focusBehavior.isListDisabled());\n\n /** The id of the current active item. */\n readonly activeDescendant = computed(() => this.focusBehavior.getActiveDescendant());\n\n /** The tab index of the tree. */\n readonly tabIndex = computed(() => this.focusBehavior.getListTabIndex());\n\n /** The index of the currently active item in the tree (within the flattened list). */\n readonly activeIndex = computed(() => this.focusBehavior.activeIndex());\n\n /** The uncommitted index for selecting a range of options. */\n private readonly _anchorIndex = signal(0);\n\n /** Whether the list should wrap. */\n private readonly _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 // If the item has a parent, get all of the parent's children.\n // Otherwise, it is a root item, and get all other root items.\n const parent = item.parent?.();\n const siblings = parent ? parent.children?.() : this.inputs.items().filter(i => !i.parent?.());\n\n siblings?.forEach(s => this.expand(s));\n }\n\n /** Expands all items in the tree. */\n expandAll() {\n this.expansionBehavior.openAll();\n }\n\n /** Collapses all items in the tree. */\n collapseAll() {\n this.expansionBehavior.closeAll();\n }\n\n /** Checks if the given item is able to receive focus. */\n isFocusable(item: T) {\n return this.focusBehavior.isFocusable(item);\n }\n\n /** Checks if the given item is expandable. */\n isExpandable(item: T) {\n return this.expansionBehavior.isExpandable(item);\n }\n\n /** Handles updating selection for the tree. */\n updateSelection(opts: NavOptions<T> = {anchor: true}) {\n if (opts.toggle) {\n this.selectionBehavior.toggle();\n }\n if (opts.select) {\n this.selectionBehavior.select();\n }\n if (opts.selectOne) {\n this.selectionBehavior.selectOne();\n }\n if (opts.selectRange) {\n this.selectionBehavior.selectRange();\n }\n if (!opts.anchor) {\n this.anchor(this.selectionBehavior.rangeStartIndex());\n }\n }\n\n /**\n * Safely performs a navigation operation.\n */\n private _navigate(opts: NavOptions<T> = {}, operation: () => boolean) {\n if (opts?.selectRange) {\n this._wrap.set(false);\n this.selectionBehavior.rangeStartIndex.set(this._anchorIndex());\n }\n\n const moved = operation();\n\n if (moved) {\n this.updateSelection(opts);\n }\n\n this._wrap.set(true);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n SignalLike,\n computed,\n WritableSignalLike,\n signal,\n} from '../behaviors/signal-like/signal-like';\nimport {Tree, TreeItem, TreeInputs as TreeBehaviorInputs} from '../behaviors/tree/tree';\nimport {KeyboardEventManager, Modifier, ClickEventManager} from '../behaviors/event-manager';\n\n/** Represents the required inputs for a tree item. */\nexport interface TreeItemInputs<V> extends Omit<\n TreeItem<V, TreeItemPattern<V>>,\n 'index' | 'parent' | 'visible' | 'expandable'\n> {\n /** The parent item. */\n parent: SignalLike<TreeItemPattern<V> | TreePattern<V>>;\n\n /** Whether this item has children. Children can be lazily loaded. */\n hasChildren: SignalLike<boolean>;\n\n /** The tree pattern this item belongs to. */\n tree: SignalLike<TreePattern<V>>;\n}\n\n/**\n * Represents an item in a Tree.\n */\nexport class TreeItemPattern<V> implements TreeItem<V, TreeItemPattern<V>> {\n /** A unique identifier for this item. */\n readonly id: SignalLike<string> = () => this.inputs.id();\n\n /** The value of this item. */\n readonly value: SignalLike<V> = () => this.inputs.value();\n\n /** A reference to the item element. */\n readonly element: SignalLike<HTMLElement> = () => this.inputs.element()!;\n\n /** Whether the item is disabled. */\n readonly disabled: SignalLike<boolean> = () => this.inputs.disabled();\n\n /** The text used by the typeahead search. */\n readonly searchTerm: SignalLike<string> = () => this.inputs.searchTerm();\n\n /** The tree pattern this item belongs to. */\n readonly tree: SignalLike<TreePattern<V>> = () => this.inputs.tree();\n\n /** The parent item. */\n readonly parent: SignalLike<TreeItemPattern<V> | undefined> = computed(() => {\n const parent = this.inputs.parent();\n return parent instanceof TreeItemPattern ? parent : undefined;\n });\n\n /** The children items. */\n readonly children: SignalLike<TreeItemPattern<V>[]> = () => this.inputs.children() ?? [];\n\n /** The position of this item among its siblings. */\n readonly index = computed(() => this.tree().inputs.items().indexOf(this));\n\n /** Whether the item is expandable. It's expandable if children item exist. */\n readonly expandable: SignalLike<boolean> = () => this.inputs.hasChildren();\n\n /** Whether the item is selectable. */\n readonly selectable: SignalLike<boolean> = () => this.inputs.selectable();\n\n /** Whether the item is expanded. */\n readonly expanded: WritableSignalLike<boolean>;\n\n /** The level of the current item in a tree. */\n readonly level: SignalLike<number> = computed(() => this.inputs.parent().level() + 1);\n\n /** Whether this item is visible. */\n readonly visible: SignalLike<boolean> = computed(\n () => this.inputs.parent().expanded() && this.inputs.parent().visible(),\n );\n\n /** The number of items under the same parent at the same level. */\n readonly setsize = computed(() => this.inputs.parent().children().length);\n\n /** The position of this item among its siblings (1-based). */\n readonly posinset = computed(() => this.inputs.parent().children().indexOf(this) + 1);\n\n /** Whether the item is active. */\n readonly active = computed(() => this.tree().activeItem() === this);\n\n /** The tab index of the item. */\n readonly tabIndex = computed(() => this.tree().treeBehavior.getItemTabindex(this));\n\n /** Whether the item is selected. */\n readonly selected: SignalLike<boolean | undefined> = computed(() => {\n if (this.tree().nav()) {\n return undefined;\n }\n if (!this.selectable()) {\n return undefined;\n }\n return this.tree().value().includes(this.value());\n });\n\n /** The current type of this item. */\n readonly current: SignalLike<string | undefined> = computed(() => {\n if (!this.tree().nav()) {\n return undefined;\n }\n if (!this.selectable()) {\n return undefined;\n }\n return this.tree().value().includes(this.value()) ? this.tree().currentType() : undefined;\n });\n\n constructor(readonly inputs: TreeItemInputs<V>) {\n this.expanded = inputs.expanded;\n }\n}\n\n/** The selection operations that the tree can perform. */\ninterface SelectOptions {\n toggle?: boolean;\n selectOne?: boolean;\n selectRange?: boolean;\n anchor?: boolean;\n}\n\n/** Represents the required inputs for a tree. */\nexport interface TreeInputs<V> extends Omit<\n TreeBehaviorInputs<TreeItemPattern<V>, V>,\n 'multiExpandable'\n> {\n /** A unique identifier for the tree. */\n id: SignalLike<string>;\n\n /** Whether the tree is in navigation mode. */\n nav: SignalLike<boolean>;\n\n /** The aria-current type. */\n currentType: SignalLike<'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'>;\n\n /** The text direction of the tree. */\n textDirection: SignalLike<'ltr' | 'rtl'>;\n}\n\n/** Controls the state and interactions of a tree view. */\nexport class TreePattern<V> implements TreeInputs<V> {\n /** The tree behavior for the tree. */\n readonly treeBehavior: Tree<TreeItemPattern<V>, V>;\n\n /** Whether the tree has been interacted with. */\n readonly hasBeenInteracted = signal(false);\n\n /** The root level is 0. */\n readonly level = () => 0;\n\n /** The root is always expanded. */\n readonly expanded = () => true;\n\n /** The root is always visible. */\n readonly visible = () => true;\n\n /** The tab index of the tree. */\n readonly tabIndex: SignalLike<-1 | 0> = computed(() => this.treeBehavior.tabIndex());\n\n /** The id of the current active item. */\n readonly activeDescendant = computed(() => this.treeBehavior.activeDescendant());\n\n /** The direct children of the root (top-level tree items). */\n readonly children = computed(() =>\n this.inputs.items().filter(item => item.level() === this.level() + 1),\n );\n\n /** Whether the tree selection follows focus. */\n readonly followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** Whether the tree direction is RTL. */\n readonly isRtl = computed(() => this.inputs.textDirection() === 'rtl');\n\n /** The key for navigating to the previous item. */\n readonly prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.isRtl() ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key for navigating to the next item. */\n readonly nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.isRtl() ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The key for collapsing an item or moving to its parent. */\n readonly collapseKey = computed(() => {\n if (this.inputs.orientation() === 'horizontal') {\n return 'ArrowUp';\n }\n return this.isRtl() ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key for expanding an item or moving to its first child. */\n readonly expandKey = computed(() => {\n if (this.inputs.orientation() === 'horizontal') {\n return 'ArrowDown';\n }\n return this.isRtl() ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** Represents the space key. Does nothing when the user is actively using typeahead. */\n readonly dynamicSpaceKey = computed(() => (this.treeBehavior.isTyping() ? '' : ' '));\n\n /** Regular expression to match characters for typeahead. */\n readonly typeaheadRegexp = /^.$/;\n\n /** The keydown event manager for the tree. */\n readonly keydown = computed(() => {\n const manager = new KeyboardEventManager();\n const tree = this.treeBehavior;\n\n manager\n .on(this.prevKey, () => tree.prev({selectOne: this.followFocus()}), {ignoreRepeat: false})\n .on(this.nextKey, () => tree.next({selectOne: this.followFocus()}), {ignoreRepeat: false})\n .on('Home', () => tree.first({selectOne: this.followFocus()}))\n .on('End', () => tree.last({selectOne: this.followFocus()}))\n .on(this.typeaheadRegexp, e => tree.search(e.key, {selectOne: this.followFocus()}))\n .on(Modifier.Shift, '*', () => tree.expandSiblings())\n .on(this.expandKey, () => this._expandOrFirstChild({selectOne: this.followFocus()}))\n .on(this.collapseKey, () => this._collapseOrParent({selectOne: this.followFocus()}));\n\n if (this.inputs.multi()) {\n manager\n // TODO: Tracking the anchor by index can break if the\n // tree is expanded or collapsed causing the index to change.\n .on(Modifier.Any, 'Shift', () => tree.anchor(this.treeBehavior.activeIndex()))\n .on(Modifier.Shift, this.prevKey, () => tree.prev({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on(Modifier.Shift, this.nextKey, () => tree.next({selectRange: true}), {\n ignoreRepeat: false,\n })\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () =>\n tree.first({selectRange: true, anchor: false}),\n )\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () =>\n tree.last({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, 'Enter', () => tree.updateSelection({selectRange: true, anchor: false}))\n .on(Modifier.Shift, this.dynamicSpaceKey, () =>\n tree.updateSelection({selectRange: true, anchor: false}),\n );\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager\n .on(this.dynamicSpaceKey, () => tree.toggle())\n .on('Enter', () => tree.toggle(), {preventDefault: !this.nav()})\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => tree.toggleAll());\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => tree.selectOne());\n manager.on('Enter', () => tree.selectOne(), {preventDefault: !this.nav()});\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => tree.prev(), {ignoreRepeat: false})\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => tree.next(), {ignoreRepeat: false})\n .on([Modifier.Ctrl, Modifier.Meta], this.expandKey, () => this._expandOrFirstChild())\n .on([Modifier.Ctrl, Modifier.Meta], this.collapseKey, () => this._collapseOrParent())\n .on([Modifier.Ctrl, Modifier.Meta], ' ', () => tree.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => tree.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Home', () => tree.first())\n .on([Modifier.Ctrl, Modifier.Meta], 'End', () => tree.last())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => {\n tree.toggleAll();\n tree.select(); // Ensure the currect item remains selected.\n });\n }\n\n return manager;\n });\n\n /** The click event manager for the tree. */\n readonly clickManager = computed(() => {\n const manager = new ClickEventManager<PointerEvent>();\n\n if (this.multi()) {\n manager.on(Modifier.Shift, (e: PointerEvent) => this.goto(e, {selectRange: true}));\n }\n\n if (!this.multi()) {\n return manager.on((e: PointerEvent) => this.goto(e, {selectOne: true}));\n }\n\n if (this.multi() && this.followFocus()) {\n return manager\n .on((e: PointerEvent) => this.goto(e, {selectOne: true}))\n .on(Modifier.Ctrl, (e: PointerEvent) => this.goto(e, {toggle: true}));\n }\n\n if (this.multi() && !this.followFocus()) {\n return manager.on((e: PointerEvent) => this.goto(e, {toggle: true}));\n }\n\n return manager;\n });\n\n /** A unique identifier for the tree. */\n readonly id: SignalLike<string> = () => this.inputs.id();\n\n /** The host native element. */\n readonly element: SignalLike<HTMLElement> = () => this.inputs.element()!;\n\n /** Whether the tree is in navigation mode. */\n readonly nav: SignalLike<boolean> = () => this.inputs.nav();\n\n /** The aria-current type. */\n readonly currentType: SignalLike<\n 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'\n > = () => this.inputs.currentType();\n\n /** All items in the tree, in document order (DFS-like, a flattened list). */\n readonly items: SignalLike<TreeItemPattern<V>[]> = () => this.inputs.items();\n\n /** The focus strategy used by the tree. */\n readonly focusMode: SignalLike<'roving' | 'activedescendant'> = () => this.inputs.focusMode();\n\n /** Whether the tree is disabled. */\n readonly disabled: SignalLike<boolean> = () => this.inputs.disabled();\n\n /** The currently active item in the tree. */\n readonly activeItem: WritableSignalLike<TreeItemPattern<V> | undefined>;\n\n /** Whether disabled items should be focusable. */\n readonly softDisabled: SignalLike<boolean> = () => this.inputs.softDisabled();\n\n /** Whether the focus should wrap when navigating past the first or last item. */\n readonly wrap: SignalLike<boolean> = () => this.inputs.wrap();\n\n /** The orientation of the tree. */\n readonly orientation: SignalLike<'vertical' | 'horizontal'> = () => this.inputs.orientation();\n\n /** The text direction of the tree. */\n readonly textDirection: SignalLike<'ltr' | 'rtl'> = () => this.textDirection();\n\n /** Whether multiple items can be selected at the same time. */\n readonly multi: SignalLike<boolean> = computed(() => (this.nav() ? false : this.inputs.multi()));\n\n /** The selection mode of the tree. */\n readonly selectionMode: SignalLike<'follow' | 'explicit'> = () => this.inputs.selectionMode();\n\n /** The delay in milliseconds to wait before clearing the typeahead buffer. */\n readonly typeaheadDelay: SignalLike<number> = () => this.inputs.typeaheadDelay();\n\n /** The current selected items of the tree. */\n readonly value: WritableSignalLike<V[]>;\n\n constructor(readonly inputs: TreeInputs<V>) {\n this.activeItem = inputs.activeItem;\n this.value = inputs.value;\n\n this.treeBehavior = new Tree<TreeItemPattern<V>, V>({\n ...inputs,\n multi: this.multi,\n multiExpandable: () => true,\n });\n }\n\n /** Returns a set of violations */\n validate(): string[] {\n const violations: string[] = [];\n\n if (!this.inputs.multi() && this.inputs.value().length > 1) {\n violations.push(\n `A single-select tree should not have multiple selected options. Selected options: ${this.inputs.value().join(', ')}`,\n );\n }\n\n const values = this.inputs.items().map(t => t.value());\n const duplicates = values.filter((val, idx) => values.indexOf(val) !== idx);\n if (duplicates.length > 0) {\n violations.push(`Duplicate tree item value '${duplicates[0]}' detected inside ngTree.`);\n }\n\n return violations;\n }\n\n /**\n * Sets the tree to it's default initial state.\n *\n * Sets the active index of the tree to the first focusable selected tree item if one exists.\n * Otherwise, sets focus to the first focusable tree item.\n */\n setDefaultState() {\n let firstItem: TreeItemPattern<V> | undefined;\n\n for (const item of this.inputs.items()) {\n if (!item.visible()) continue;\n if (!this.treeBehavior.isFocusable(item)) continue;\n\n if (firstItem === undefined) {\n firstItem = item;\n }\n\n if (item.selected()) {\n this.activeItem.set(item);\n return;\n }\n }\n\n if (firstItem !== undefined) {\n this.activeItem.set(firstItem);\n }\n }\n\n /** Sets the default active state of the tree before receiving interaction for the first time. */\n setDefaultStateEffect(): void {\n if (this.hasBeenInteracted()) return;\n\n this.setDefaultState();\n }\n\n /** Handles keydown events on the tree. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.hasBeenInteracted.set(true);\n this.keydown().handle(event);\n }\n }\n\n /** Handles click events on the tree. */\n onClick(event: PointerEvent) {\n if (!this.disabled()) {\n this.hasBeenInteracted.set(true);\n this.clickManager().handle(event);\n }\n }\n\n /** Handles focusin events on the tree. */\n onFocusIn() {\n this.hasBeenInteracted.set(true);\n }\n\n /** Navigates to the given tree item in the tree. */\n goto(e: PointerEvent, opts?: SelectOptions) {\n const item = this._getItem(e);\n if (!item) return;\n\n this.treeBehavior.goto(item, opts);\n this.treeBehavior.toggleExpansion(item);\n }\n\n /** Expands the active item if possible, otherwise navigates to the first child. */\n _expandOrFirstChild(opts?: SelectOptions) {\n const item = this.treeBehavior.inputs.activeItem();\n if (item && this.treeBehavior.isExpandable(item) && !item.expanded()) {\n this.treeBehavior.expand(item);\n } else {\n this.treeBehavior.firstChild(opts);\n }\n }\n\n /** Collapses the active item if possible, otherwise navigates to the parent. */\n _collapseOrParent(opts?: SelectOptions) {\n const item = this.treeBehavior.inputs.activeItem();\n if (item && this.treeBehavior.isExpandable(item) && item.expanded()) {\n this.treeBehavior.collapse(item);\n } else {\n this.treeBehavior.parent(opts);\n }\n }\n\n /** Retrieves the TreeItemPattern associated with a DOM event, if any. */\n protected _getItem(event: Event): TreeItemPattern<V> | undefined {\n if (!(event.target instanceof HTMLElement)) {\n return;\n }\n const element = event.target.closest('[role=\"treeitem\"]');\n return this.inputs.items().find(i => i.element() === element);\n }\n}\n"],"names":["TreeListFocus","ListFocus","isFocusable","item","visible","Tree","inputs","navigationBehavior","selectionBehavior","typeaheadBehavior","focusBehavior","expansionBehavior","disabled","computed","isListDisabled","activeDescendant","getActiveDescendant","tabIndex","getListTabIndex","activeIndex","_anchorIndex","signal","_wrap","constructor","ListSelection","focusManager","ListTypeahead","ListExpansion","ListNavigation","wrap","getItemTabindex","getItemTabIndex","first","opts","_navigate","last","next","prev","firstChild","activeItem","items","children","lastChild","nextSibling","parent","prevSibling","goto","unfocus","set","undefined","anchor","index","search","char","isTyping","select","selectOne","deselect","deselectAll","toggle","toggleOne","toggleAll","toggleExpansion","isExpandable","expand","open","collapse","close","expandSiblings","siblings","filter","i","forEach","s","expandAll","openAll","collapseAll","closeAll","updateSelection","selectRange","rangeStartIndex","operation","moved","TreeItemPattern","id","value","element","searchTerm","tree","indexOf","expandable","hasChildren","selectable","expanded","level","setsize","length","posinset","active","treeBehavior","selected","nav","includes","current","currentType","TreePattern","hasBeenInteracted","followFocus","selectionMode","isRtl","textDirection","prevKey","orientation","nextKey","collapseKey","expandKey","dynamicSpaceKey","typeaheadRegexp","keydown","manager","KeyboardEventManager","on","ignoreRepeat","e","key","Modifier","Shift","_expandOrFirstChild","_collapseOrParent","multi","Any","Ctrl","Meta","preventDefault","clickManager","ClickEventManager","focusMode","softDisabled","typeaheadDelay","multiExpandable","validate","violations","push","join","values","map","t","duplicates","val","idx","setDefaultState","firstItem","setDefaultStateEffect","onKeydown","event","handle","onClick","onFocusIn","_getItem","target","HTMLElement","closest","find"],"mappings":";;;;;;AAsDA,MAAMA,aAA2C,SAAQC,SAAY,CAAA;EAC1DC,WAAWA,CAACC,IAAO,EAAA;IAC1B,OAAO,KAAK,CAACD,WAAW,CAACC,IAAI,CAAC,IAAIA,IAAI,CAACC,OAAO,EAAE;AAClD,EAAA;AACD;MAGYC,IAAI,CAAA;EAkCMC,MAAA;EAhCZC,kBAAkB;EAGlBC,iBAAiB;EAGjBC,iBAAiB;EAGjBC,aAAa;EAGbC,iBAAiB;EAGjBC,QAAQ,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACH,aAAa,CAACI,cAAc,EAAE,CAAC;EAG9DC,gBAAgB,GAAGF,QAAQ,CAAC,MAAM,IAAI,CAACH,aAAa,CAACM,mBAAmB,EAAE,CAAC;EAG3EC,QAAQ,GAAGJ,QAAQ,CAAC,MAAM,IAAI,CAACH,aAAa,CAACQ,eAAe,EAAE,CAAC;EAG/DC,WAAW,GAAGN,QAAQ,CAAC,MAAM,IAAI,CAACH,aAAa,CAACS,WAAW,E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A,MAAO;AACL,MAAA,IAAI,CAACgG,YAAY,CAACvD,MAAM,CAACX,IAAI,CAAC;AAChC,IAAA;AACF,EAAA;EAGU6H,QAAQA,CAACJ,KAAY,EAAA;AAC7B,IAAA,IAAI,EAAEA,KAAK,CAACK,MAAM,YAAYC,WAAW,CAAC,EAAE;AAC1C,MAAA;AACF,IAAA;IACA,MAAM1E,OAAO,GAAGoE,KAAK,CAACK,MAAM,CAACE,OAAO,CAAC,mBAAmB,CAAC;AACzD,IAAA,OAAO,IAAI,CAAC3J,MAAM,CAACkC,KAAK,EAAE,CAAC0H,IAAI,CAAC3F,CAAC,IAAIA,CAAC,CAACe,OAAO,EAAE,KAAKA,OAAO,CAAC;AAC/D,EAAA;AACD;;;;"}
@@ -166,5 +166,14 @@ class SortedCollection {
166
166
  }
167
167
  }
168
168
 
169
- export { EventManager, KeyboardEventManager, Modifier, SortedCollection, computed, convertGetterSetterToWritableSignalLike, hasModifiers, linkedSignal, signal, sortDirectives };
170
- //# sourceMappingURL=_collection-chunk.mjs.map
169
+ function reportViolations(violations, element) {
170
+ if (violations.length) {
171
+ console.warn('Violations found on element: %o:', element);
172
+ violations.forEach(violation => {
173
+ console.warn(violation);
174
+ });
175
+ }
176
+ }
177
+
178
+ export { EventManager, KeyboardEventManager, Modifier, SortedCollection, computed, convertGetterSetterToWritableSignalLike, hasModifiers, linkedSignal, reportViolations, signal, sortDirectives };
179
+ //# sourceMappingURL=_violations-chunk.mjs.map