@angular/aria 22.0.0-next.7 → 22.0.0-next.8

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 (93) hide show
  1. package/fesm2022/_accordion-chunk.mjs +1 -1
  2. package/fesm2022/_click-event-manager-chunk.mjs +1 -1
  3. package/fesm2022/{_signal-like-chunk.mjs → _collection-chunk.mjs} +51 -2
  4. package/fesm2022/_collection-chunk.mjs.map +1 -0
  5. package/fesm2022/_deferred-content-chunk.mjs +6 -6
  6. package/fesm2022/_list-chunk.mjs +4 -1
  7. package/fesm2022/_list-chunk.mjs.map +1 -1
  8. package/fesm2022/_list-navigation-chunk.mjs +1 -1
  9. package/fesm2022/_list-typeahead-chunk.mjs +1 -1
  10. package/fesm2022/_menu-chunk.mjs +1 -1
  11. package/fesm2022/{_combobox-listbox-chunk.mjs → _option-chunk.mjs} +3 -50
  12. package/fesm2022/_option-chunk.mjs.map +1 -0
  13. package/fesm2022/_tabs-chunk.mjs +1 -1
  14. package/fesm2022/_toolbar-widget-group-chunk.mjs +1 -1
  15. package/fesm2022/_transforms-chunk.mjs +8 -0
  16. package/fesm2022/_transforms-chunk.mjs.map +1 -0
  17. package/fesm2022/{_combobox-tree-chunk.mjs → _tree-chunk.mjs} +3 -48
  18. package/fesm2022/_tree-chunk.mjs.map +1 -0
  19. package/fesm2022/_widget-chunk.mjs +36 -15
  20. package/fesm2022/_widget-chunk.mjs.map +1 -1
  21. package/fesm2022/accordion.mjs +28 -55
  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-testing.mjs +79 -0
  26. package/fesm2022/combobox-testing.mjs.map +1 -0
  27. package/fesm2022/combobox.mjs +273 -307
  28. package/fesm2022/combobox.mjs.map +1 -1
  29. package/fesm2022/grid-testing.mjs +8 -0
  30. package/fesm2022/grid-testing.mjs.map +1 -1
  31. package/fesm2022/grid.mjs +68 -87
  32. package/fesm2022/grid.mjs.map +1 -1
  33. package/fesm2022/listbox-testing.mjs +4 -0
  34. package/fesm2022/listbox-testing.mjs.map +1 -1
  35. package/fesm2022/listbox.mjs +184 -205
  36. package/fesm2022/listbox.mjs.map +1 -1
  37. package/fesm2022/menu-testing.mjs +11 -0
  38. package/fesm2022/menu-testing.mjs.map +1 -1
  39. package/fesm2022/menu.mjs +42 -66
  40. package/fesm2022/menu.mjs.map +1 -1
  41. package/fesm2022/private.mjs +19 -13
  42. package/fesm2022/private.mjs.map +1 -1
  43. package/fesm2022/tabs.mjs +78 -84
  44. package/fesm2022/tabs.mjs.map +1 -1
  45. package/fesm2022/toolbar-testing.mjs +5 -1
  46. package/fesm2022/toolbar-testing.mjs.map +1 -1
  47. package/fesm2022/toolbar.mjs +21 -31
  48. package/fesm2022/toolbar.mjs.map +1 -1
  49. package/fesm2022/tree-testing.mjs +12 -0
  50. package/fesm2022/tree-testing.mjs.map +1 -1
  51. package/fesm2022/tree.mjs +118 -146
  52. package/fesm2022/tree.mjs.map +1 -1
  53. package/package.json +6 -6
  54. package/types/_accordion-chunk.d.ts +2 -2
  55. package/types/_collection-chunk.d.ts +42 -0
  56. package/types/_expansion-chunk.d.ts +1 -1
  57. package/types/_grid-chunk.d.ts +9 -3
  58. package/types/_keyboard-event-manager-chunk.d.ts +1 -1
  59. package/types/_list-chunk.d.ts +1 -1
  60. package/types/_list-navigation-chunk.d.ts +1 -1
  61. package/types/_listbox-chunk.d.ts +1 -1
  62. package/types/_menu-chunk.d.ts +1 -1
  63. package/types/_tabs-chunk.d.ts +1 -1
  64. package/types/_toolbar-chunk.d.ts +1 -1
  65. package/types/_tree-chunk.d.ts +1 -1
  66. package/types/accordion.d.ts +7 -13
  67. package/types/combobox-testing.d.ts +63 -0
  68. package/types/combobox.d.ts +96 -193
  69. package/types/grid-testing.d.ts +4 -0
  70. package/types/grid.d.ts +101 -97
  71. package/types/listbox-testing.d.ts +25 -0
  72. package/types/listbox.d.ts +55 -60
  73. package/types/menu-testing.d.ts +6 -0
  74. package/types/menu.d.ts +17 -13
  75. package/types/private.d.ts +24 -138
  76. package/types/tabs.d.ts +69 -72
  77. package/types/toolbar-testing.d.ts +4 -0
  78. package/types/toolbar.d.ts +5 -6
  79. package/types/tree-testing.d.ts +8 -0
  80. package/types/tree.d.ts +7 -14
  81. package/fesm2022/_combobox-chunk.mjs +0 -478
  82. package/fesm2022/_combobox-chunk.mjs.map +0 -1
  83. package/fesm2022/_combobox-listbox-chunk.mjs.map +0 -1
  84. package/fesm2022/_combobox-tree-chunk.mjs.map +0 -1
  85. package/fesm2022/_element-chunk.mjs +0 -6
  86. package/fesm2022/_element-chunk.mjs.map +0 -1
  87. package/fesm2022/_signal-like-chunk.mjs.map +0 -1
  88. package/fesm2022/simple-combobox.mjs +0 -443
  89. package/fesm2022/simple-combobox.mjs.map +0 -1
  90. package/types/_combobox-chunk.d.ts +0 -224
  91. package/types/_element-chunk.d.ts +0 -10
  92. package/types/_signal-like-chunk.d.ts +0 -14
  93. package/types/simple-combobox.d.ts +0 -124
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/toolbar/testing/toolbar-widget-harness.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/toolbar/testing/toolbar-widget-group-harness.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/toolbar/testing/toolbar-harness.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 {ContentContainerComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {ToolbarWidgetHarnessFilters} from './toolbar-harness-filters';\n\n/** Harness for interacting with an Aria toolbar widget in tests. */\nexport class ToolbarWidgetHarness extends ContentContainerComponentHarness<string> {\n static hostSelector = '[ngToolbarWidget]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `ToolbarWidgetHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ToolbarWidgetHarnessFilters = {}): HarnessPredicate<ToolbarWidgetHarness> {\n return new HarnessPredicate(ToolbarWidgetHarness, options)\n .addOption('text', options.text, (harness, pattern) =>\n HarnessPredicate.stringMatches(harness.getText(), pattern),\n )\n .addOption(\n 'active',\n options.active,\n async (harness, active) => (await harness.isActive()) === active,\n );\n }\n\n /** Gets the widget's text. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Clicks the widget. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Gets whether the widget is active. */\n async isActive(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('data-active')) === 'true';\n }\n\n /** Gets whether the widget is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-disabled')) === '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 {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {\n ToolbarWidgetHarnessFilters,\n ToolbarWidgetGroupHarnessFilters,\n} from './toolbar-harness-filters';\nimport {ToolbarWidgetHarness} from './toolbar-widget-harness';\n\n/** Harness for interacting with an Aria toolbar widget group in tests. */\nexport class ToolbarWidgetGroupHarness extends ComponentHarness {\n static hostSelector = '[ngToolbarWidgetGroup]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `ToolbarWidgetGroupHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(\n options: ToolbarWidgetGroupHarnessFilters = {},\n ): HarnessPredicate<ToolbarWidgetGroupHarness> {\n return new HarnessPredicate(ToolbarWidgetGroupHarness, options);\n }\n\n /** Gets all widgets in the group. */\n async getWidgets(filters: ToolbarWidgetHarnessFilters = {}): Promise<ToolbarWidgetHarness[]> {\n return await this.locatorForAll(ToolbarWidgetHarness.with(filters))();\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 {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {\n ToolbarHarnessFilters,\n ToolbarWidgetHarnessFilters,\n ToolbarWidgetGroupHarnessFilters,\n} from './toolbar-harness-filters';\nimport {ToolbarWidgetHarness} from './toolbar-widget-harness';\nimport {ToolbarWidgetGroupHarness} from './toolbar-widget-group-harness';\n\n/** Harness for interacting with an Aria toolbar in tests. */\nexport class ToolbarHarness extends ComponentHarness {\n static hostSelector = '[ngToolbar]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `ToolbarHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ToolbarHarnessFilters = {}): HarnessPredicate<ToolbarHarness> {\n return new HarnessPredicate(ToolbarHarness, options);\n }\n\n /** Gets all widgets in the toolbar. */\n async getWidgets(filters: ToolbarWidgetHarnessFilters = {}): Promise<ToolbarWidgetHarness[]> {\n return await this.locatorForAll(ToolbarWidgetHarness.with(filters))();\n }\n\n /** Gets all widget groups in the toolbar. */\n async getWidgetGroups(\n filters: ToolbarWidgetGroupHarnessFilters = {},\n ): Promise<ToolbarWidgetGroupHarness[]> {\n return await this.locatorForAll(ToolbarWidgetGroupHarness.with(filters))();\n }\n\n /** Gets whether the toolbar is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-disabled')) === 'true';\n }\n\n /** Gets the orientation of the toolbar. */\n async getOrientation(): Promise<'vertical' | 'horizontal'> {\n const host = await this.host();\n return (await host.getAttribute('aria-orientation')) as 'vertical' | 'horizontal';\n }\n}\n"],"names":["ToolbarWidgetHarness","ContentContainerComponentHarness","hostSelector","with","options","HarnessPredicate","addOption","text","harness","pattern","stringMatches","getText","active","isActive","host","click","getAttribute","isDisabled","ToolbarWidgetGroupHarness","ComponentHarness","getWidgets","filters","locatorForAll","ToolbarHarness","getWidgetGroups","getOrientation"],"mappings":";;AAYM,MAAOA,oBAAqB,SAAQC,gCAAwC,CAAA;EAChF,OAAOC,YAAY,GAAG,mBAAmB;AAQzC,EAAA,OAAOC,IAAIA,CAACC,OAAA,GAAuC,EAAE,EAAA;IACnD,OAAO,IAAIC,gBAAgB,CAACL,oBAAoB,EAAEI,OAAO,CAAA,CACtDE,SAAS,CAAC,MAAM,EAAEF,OAAO,CAACG,IAAI,EAAE,CAACC,OAAO,EAAEC,OAAO,KAChDJ,gBAAgB,CAACK,aAAa,CAACF,OAAO,CAACG,OAAO,EAAE,EAAEF,OAAO,CAAC,CAAA,CAE3DH,SAAS,CACR,QAAQ,EACRF,OAAO,CAACQ,MAAM,EACd,OAAOJ,OAAO,EAAEI,MAAM,KAAK,CAAC,MAAMJ,OAAO,CAACK,QAAQ,EAAE,MAAMD,MAAM,CACjE;AACL,EAAA;EAGA,MAAMD,OAAOA,GAAA;IACX,OAAO,CAAC,MAAM,IAAI,CAACG,IAAI,EAAE,EAAEP,IAAI,EAAE;AACnC,EAAA;EAGA,MAAMQ,KAAKA,GAAA;IACT,OAAO,CAAC,MAAM,IAAI,CAACD,IAAI,EAAE,EAAEC,KAAK,EAAE;AACpC,EAAA;EAGA,MAAMF,QAAQA,GAAA;AACZ,IAAA,MAAMC,IAAI,GAAG,MAAM,IAAI,CAACA,IAAI,EAAE;IAC9B,OAAO,CAAC,MAAMA,IAAI,CAACE,YAAY,CAAC,aAAa,CAAC,MAAM,MAAM;AAC5D,EAAA;EAGA,MAAMC,UAAUA,GAAA;AACd,IAAA,MAAMH,IAAI,GAAG,MAAM,IAAI,CAACA,IAAI,EAAE;IAC9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AAcA,GAAA;AAClB,IAAA,MAAMX,IAAI,GAAG,MAAM,IAAI,CAACA,IAAI,EAAE;AAC9B,IAAA,OAAQ,MAAMA,IAAI,CAACE,YAAY,CAAC,kBAAkB,CAAC;AACrD,EAAA;;;;;"}
1
+ {"version":3,"file":"toolbar-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/toolbar/testing/toolbar-widget-harness.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/toolbar/testing/toolbar-widget-group-harness.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/toolbar/testing/toolbar-harness.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 {ContentContainerComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {ToolbarWidgetHarnessFilters} from './toolbar-harness-filters';\n\n/** Harness for interacting with an Aria toolbar widget in tests. */\nexport class ToolbarWidgetHarness extends ContentContainerComponentHarness<string> {\n static hostSelector = '[ngToolbarWidget]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `ToolbarWidgetHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ToolbarWidgetHarnessFilters = {}): HarnessPredicate<ToolbarWidgetHarness> {\n return new HarnessPredicate(ToolbarWidgetHarness, options)\n .addOption('text', options.text, (harness, pattern) =>\n HarnessPredicate.stringMatches(harness.getText(), pattern),\n )\n .addOption(\n 'active',\n options.active,\n async (harness, active) => (await harness.isActive()) === active,\n )\n .addOption(\n 'selected',\n options.selected,\n async (harness, selected) => (await harness.isSelected()) === selected,\n );\n }\n\n /** Gets the widget's text. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Clicks the widget. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Gets whether the widget is active. */\n async isActive(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('data-active')) === 'true';\n }\n\n /** Gets whether the widget is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-disabled')) === 'true';\n }\n\n /** Gets whether the widget is selected. */\n async isSelected(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-pressed')) === '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 {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {\n ToolbarWidgetHarnessFilters,\n ToolbarWidgetGroupHarnessFilters,\n} from './toolbar-harness-filters';\nimport {ToolbarWidgetHarness} from './toolbar-widget-harness';\n\n/** Harness for interacting with an Aria toolbar widget group in tests. */\nexport class ToolbarWidgetGroupHarness extends ComponentHarness {\n static hostSelector = '[ngToolbarWidgetGroup]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `ToolbarWidgetGroupHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(\n options: ToolbarWidgetGroupHarnessFilters = {},\n ): HarnessPredicate<ToolbarWidgetGroupHarness> {\n return new HarnessPredicate(ToolbarWidgetGroupHarness, options);\n }\n\n /** Gets all widgets in the group. */\n async getWidgets(filters: ToolbarWidgetHarnessFilters = {}): Promise<ToolbarWidgetHarness[]> {\n return await this.locatorForAll(ToolbarWidgetHarness.with(filters))();\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 {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {\n ToolbarHarnessFilters,\n ToolbarWidgetHarnessFilters,\n ToolbarWidgetGroupHarnessFilters,\n} from './toolbar-harness-filters';\nimport {ToolbarWidgetHarness} from './toolbar-widget-harness';\nimport {ToolbarWidgetGroupHarness} from './toolbar-widget-group-harness';\n\n/** Harness for interacting with an Aria toolbar in tests. */\nexport class ToolbarHarness extends ComponentHarness {\n static hostSelector = '[ngToolbar]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `ToolbarHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ToolbarHarnessFilters = {}): HarnessPredicate<ToolbarHarness> {\n return new HarnessPredicate(ToolbarHarness, options);\n }\n\n /** Gets all widgets in the toolbar. */\n async getWidgets(filters: ToolbarWidgetHarnessFilters = {}): Promise<ToolbarWidgetHarness[]> {\n return await this.locatorForAll(ToolbarWidgetHarness.with(filters))();\n }\n\n /** Gets all widget groups in the toolbar. */\n async getWidgetGroups(\n filters: ToolbarWidgetGroupHarnessFilters = {},\n ): Promise<ToolbarWidgetGroupHarness[]> {\n return await this.locatorForAll(ToolbarWidgetGroupHarness.with(filters))();\n }\n\n /** Gets whether the toolbar is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-disabled')) === 'true';\n }\n\n /** Gets the orientation of the toolbar. */\n async getOrientation(): Promise<'vertical' | 'horizontal'> {\n const host = await this.host();\n return (await host.getAttribute('aria-orientation')) as 'vertical' | 'horizontal';\n }\n}\n"],"names":["ToolbarWidgetHarness","ContentContainerComponentHarness","hostSelector","with","options","HarnessPredicate","addOption","text","harness","pattern","stringMatches","getText","active","isActive","selected","isSelected","host","click","getAttribute","isDisabled","ToolbarWidgetGroupHarness","ComponentHarness","getWidgets","filters","locatorForAll","ToolbarHarness","getWidgetGroups","getOrientation"],"mappings":";;AAYM,MAAOA,oBAAqB,SAAQC,gCAAwC,CAAA;EAChF,OAAOC,YAAY,GAAG,mBAAmB;AAQzC,EAAA,OAAOC,IAAIA,CAACC,OAAA,GAAuC,EAAE,EAA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AAG,MAAM,IAAI,CAACA,IAAI,EAAE;AAC9B,IAAA,OAAQ,MAAMA,IAAI,CAACE,YAAY,CAAC,kBAAkB,CAAC;AACrD,EAAA;;;;;"}
@@ -1,23 +1,20 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, signal, computed, input, booleanAttribute, model, afterRenderEffect, Directive, InjectionToken, contentChildren } from '@angular/core';
2
+ import { inject, ElementRef, computed, input, booleanAttribute, model, signal, afterRenderEffect, afterNextRender, Directive, InjectionToken, contentChildren } from '@angular/core';
3
3
  import { Directionality } from '@angular/cdk/bidi';
4
4
  import { ToolbarPattern, ToolbarWidgetPattern, ToolbarWidgetGroupPattern } from './_toolbar-widget-group-chunk.mjs';
5
- import { sortDirectives } from './_element-chunk.mjs';
5
+ import { SortedCollection } from './_collection-chunk.mjs';
6
6
  import { _IdGenerator } from '@angular/cdk/a11y';
7
- import './_signal-like-chunk.mjs';
8
- import '@angular/core/primitives/signals';
9
7
  import './_list-chunk.mjs';
10
8
  import './_list-navigation-chunk.mjs';
11
9
  import './_list-typeahead-chunk.mjs';
10
+ import '@angular/core/primitives/signals';
12
11
 
13
12
  class Toolbar {
14
13
  _elementRef = inject(ElementRef);
15
14
  element = this._elementRef.nativeElement;
16
- _widgets = signal(new Set(), ...(ngDevMode ? [{
17
- debugName: "_widgets"
18
- }] : []));
15
+ _collection = new SortedCollection();
19
16
  textDirection = inject(Directionality).valueSignal;
20
- _itemPatterns = computed(() => [...this._widgets()].sort(sortDirectives).map(widget => widget._pattern), ...(ngDevMode ? [{
17
+ _itemPatterns = computed(() => this._collection.orderedItems().map(widget => widget._pattern), ...(ngDevMode ? [{
21
18
  debugName: "_itemPatterns"
22
19
  }] : []));
23
20
  orientation = input('horizontal', ...(ngDevMode ? [{
@@ -57,26 +54,19 @@ class Toolbar {
57
54
  afterRenderEffect({
58
55
  write: () => this._pattern.setDefaultStateEffect()
59
56
  });
57
+ afterNextRender(() => {
58
+ this._collection.startObserving(this.element);
59
+ });
60
60
  }
61
- _register(widget) {
62
- const widgets = this._widgets();
63
- if (!widgets.has(widget)) {
64
- widgets.add(widget);
65
- this._widgets.set(new Set(widgets));
66
- }
67
- }
68
- _unregister(widget) {
69
- const widgets = this._widgets();
70
- if (widgets.delete(widget)) {
71
- this._widgets.set(new Set(widgets));
72
- }
61
+ ngOnDestroy() {
62
+ this._collection.stopObserving();
73
63
  }
74
64
  _getItem(element) {
75
65
  return this._itemPatterns().find(item => item.element()?.contains(element));
76
66
  }
77
67
  static ɵfac = i0.ɵɵngDeclareFactory({
78
68
  minVersion: "12.0.0",
79
- version: "22.0.0-next.9",
69
+ version: "22.0.0-next.10",
80
70
  ngImport: i0,
81
71
  type: Toolbar,
82
72
  deps: [],
@@ -84,7 +74,7 @@ class Toolbar {
84
74
  });
85
75
  static ɵdir = i0.ɵɵngDeclareDirective({
86
76
  minVersion: "17.1.0",
87
- version: "22.0.0-next.9",
77
+ version: "22.0.0-next.10",
88
78
  type: Toolbar,
89
79
  isStandalone: true,
90
80
  selector: "[ngToolbar]",
@@ -150,7 +140,7 @@ class Toolbar {
150
140
  }
151
141
  i0.ɵɵngDeclareClassMetadata({
152
142
  minVersion: "12.0.0",
153
- version: "22.0.0-next.9",
143
+ version: "22.0.0-next.10",
154
144
  ngImport: i0,
155
145
  type: Toolbar,
156
146
  decorators: [{
@@ -259,14 +249,14 @@ class ToolbarWidget {
259
249
  element: () => this.element
260
250
  });
261
251
  ngOnInit() {
262
- this._toolbar._register(this);
252
+ this._toolbar._collection.register(this);
263
253
  }
264
254
  ngOnDestroy() {
265
- this._toolbar._unregister(this);
255
+ this._toolbar._collection.unregister(this);
266
256
  }
267
257
  static ɵfac = i0.ɵɵngDeclareFactory({
268
258
  minVersion: "12.0.0",
269
- version: "22.0.0-next.9",
259
+ version: "22.0.0-next.10",
270
260
  ngImport: i0,
271
261
  type: ToolbarWidget,
272
262
  deps: [],
@@ -274,7 +264,7 @@ class ToolbarWidget {
274
264
  });
275
265
  static ɵdir = i0.ɵɵngDeclareDirective({
276
266
  minVersion: "17.1.0",
277
- version: "22.0.0-next.9",
267
+ version: "22.0.0-next.10",
278
268
  type: ToolbarWidget,
279
269
  isStandalone: true,
280
270
  selector: "[ngToolbarWidget]",
@@ -320,7 +310,7 @@ class ToolbarWidget {
320
310
  }
321
311
  i0.ɵɵngDeclareClassMetadata({
322
312
  minVersion: "12.0.0",
323
- version: "22.0.0-next.9",
313
+ version: "22.0.0-next.10",
324
314
  ngImport: i0,
325
315
  type: ToolbarWidget,
326
316
  decorators: [{
@@ -402,7 +392,7 @@ class ToolbarWidgetGroup {
402
392
  });
403
393
  static ɵfac = i0.ɵɵngDeclareFactory({
404
394
  minVersion: "12.0.0",
405
- version: "22.0.0-next.9",
395
+ version: "22.0.0-next.10",
406
396
  ngImport: i0,
407
397
  type: ToolbarWidgetGroup,
408
398
  deps: [],
@@ -410,7 +400,7 @@ class ToolbarWidgetGroup {
410
400
  });
411
401
  static ɵdir = i0.ɵɵngDeclareDirective({
412
402
  minVersion: "17.2.0",
413
- version: "22.0.0-next.9",
403
+ version: "22.0.0-next.10",
414
404
  type: ToolbarWidgetGroup,
415
405
  isStandalone: true,
416
406
  selector: "[ngToolbarWidgetGroup]",
@@ -446,7 +436,7 @@ class ToolbarWidgetGroup {
446
436
  }
447
437
  i0.ɵɵngDeclareClassMetadata({
448
438
  minVersion: "12.0.0",
449
- version: "22.0.0-next.9",
439
+ version: "22.0.0-next.10",
450
440
  ngImport: i0,
451
441
  type: ToolbarWidgetGroup,
452
442
  decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/toolbar/toolbar.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/toolbar/toolbar-tokens.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/toolbar/toolbar-widget.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/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 {\n afterRenderEffect,\n Directive,\n ElementRef,\n inject,\n computed,\n input,\n booleanAttribute,\n signal,\n model,\n} from '@angular/core';\nimport {ToolbarPattern, ToolbarWidgetPattern, sortDirectives} from '../private';\nimport {Directionality} from '@angular/cdk/bidi';\nimport type {ToolbarWidget} from './toolbar-widget';\n\n/**\n * A toolbar widget container for a group of interactive widgets, such as\n * buttons or radio groups. It provides a single point of reference for keyboard navigation\n * and focus management. It supports various orientations and disabled states.\n *\n * ```html\n * <div ngToolbar orientation=\"horizontal\" [wrap]=\"true\">\n * <button ngToolbarWidget value=\"save\">Save</button>\n * <button ngToolbarWidget value=\"print\">Print</button>\n *\n * <div ngToolbarWidgetGroup [(value)]=\"selectedAlignment\">\n * <button ngToolbarWidget value=\"left\">Left</button>\n * <button ngToolbarWidget value=\"center\">Center</button>\n * <button ngToolbarWidget value=\"right\">Right</button>\n * </div>\n * </div>\n * ```\n *\n * @developerPreview 21.0\n *\n * @see [Toolbar](guide/aria/toolbar)\n */\n@Directive({\n selector: '[ngToolbar]',\n exportAs: 'ngToolbar',\n host: {\n 'role': 'toolbar',\n '[attr.tabindex]': '_pattern.tabIndex()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-orientation]': '_pattern.orientation()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(click)': '_pattern.onClick($event)',\n '(pointerdown)': '_pattern.onPointerdown($event)',\n '(focusin)': '_pattern.onFocusIn()',\n },\n})\nexport class Toolbar<V> {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The TabList nested inside of the container. */\n private readonly _widgets = signal(new Set<ToolbarWidget<V>>());\n\n /** Text direction. */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** Sorted UIPatterns of the child widgets */\n readonly _itemPatterns = computed<ToolbarWidgetPattern<V>[]>(() =>\n [...this._widgets()].sort(sortDirectives).map(widget => widget._pattern),\n );\n\n /** Whether the toolbar is vertically or horizontally oriented. */\n readonly orientation = input<'vertical' | 'horizontal'>('horizontal');\n\n /**\n * Whether to allow disabled items to receive focus. When `true`, disabled items are\n * focusable but not interactive. When `false`, disabled items are skipped during navigation.\n */\n readonly softDisabled = input(true, {transform: booleanAttribute});\n\n /** Whether the toolbar is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether focus should wrap when navigating. */\n readonly wrap = input(true, {transform: booleanAttribute});\n\n /** The values of the selected widgets within the toolbar. */\n readonly value = model<V[]>([]);\n\n /** The toolbar UIPattern. */\n readonly _pattern: ToolbarPattern<V> = new ToolbarPattern<V>({\n ...this,\n items: this._itemPatterns,\n activeItem: signal(undefined),\n textDirection: this.textDirection,\n element: () => this._elementRef.nativeElement,\n getItem: e => this._getItem(e),\n value: this.value,\n });\n\n constructor() {\n afterRenderEffect({write: () => this._pattern.setDefaultStateEffect()});\n }\n\n _register(widget: ToolbarWidget<V>) {\n const widgets = this._widgets();\n if (!widgets.has(widget)) {\n widgets.add(widget);\n this._widgets.set(new Set(widgets));\n }\n }\n\n _unregister(widget: ToolbarWidget<V>) {\n const widgets = this._widgets();\n if (widgets.delete(widget)) {\n this._widgets.set(new Set(widgets));\n }\n }\n\n /** Finds the toolbar item associated with a given element. */\n private _getItem(element: Element) {\n return this._itemPatterns().find(item => item.element()?.contains(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 {InjectionToken} from '@angular/core';\nimport type {ToolbarWidgetGroup} from './toolbar-widget-group';\n\n/** Token used to provide the `ToolbarWidgetGroup` directive. */\nexport const TOOLBAR_WIDGET_GROUP = new InjectionToken<ToolbarWidgetGroup<unknown>>(\n 'TOOLBAR_WIDGET_GROUP',\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 Directive,\n ElementRef,\n inject,\n computed,\n input,\n booleanAttribute,\n OnInit,\n OnDestroy,\n} from '@angular/core';\nimport {\n ToolbarWidgetPattern,\n ToolbarWidgetGroupPattern,\n SignalLike,\n ToolbarPattern,\n} from '../private';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Toolbar} from './toolbar';\nimport {TOOLBAR_WIDGET_GROUP} from './toolbar-tokens';\nimport type {ToolbarWidgetGroup} from './toolbar-widget-group';\n\n/**\n * A widget within a toolbar.\n *\n * The `ngToolbarWidget` directive should be applied to any native HTML element that acts\n * as an interactive widget within an `ngToolbar` or `ngToolbarWidgetGroup`. It enables\n * keyboard navigation and selection within the toolbar.\n *\n * ```html\n * <button ngToolbarWidget value=\"action-id\" [disabled]=\"isDisabled\">\n * Perform Action\n * </button>\n * ```\n *\n * @developerPreview 21.0\n *\n * @see [Toolbar](guide/aria/toolbar)\n */\n@Directive({\n selector: '[ngToolbarWidget]',\n exportAs: 'ngToolbarWidget',\n host: {\n // Ensure the attribute is applied even when used as a host directive.\n 'ngToolbarWidget': '',\n '[attr.data-active]': 'active()',\n '[attr.tabindex]': '_pattern.tabIndex()',\n '[attr.inert]': 'hardDisabled() ? true : null',\n '[attr.disabled]': 'hardDisabled() ? true : null',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[id]': '_pattern.id()',\n },\n})\nexport class ToolbarWidget<V> implements OnInit, OnDestroy {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The parent Toolbar. */\n private readonly _toolbar = inject<Toolbar<V>>(Toolbar);\n\n /** A unique identifier for the widget. */\n readonly id = input(inject(_IdGenerator).getId('ng-toolbar-widget-', true));\n\n /** The parent Toolbar UIPattern. */\n readonly _toolbarPattern = computed<ToolbarPattern<V>>(() => this._toolbar._pattern);\n\n /** Whether the widget is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the widget is 'hard' disabled, which is different from `aria-disabled`. A hard disabled widget cannot receive focus. */\n readonly hardDisabled = computed(() => this._pattern.disabled() && !this._toolbar.softDisabled());\n\n /** The optional ToolbarWidgetGroup this widget belongs to. */\n readonly _group = inject<ToolbarWidgetGroup<V>>(TOOLBAR_WIDGET_GROUP, {optional: true});\n\n /** The value associated with the widget. */\n readonly value = input.required<V>();\n\n /** Whether the widget is currently active (focused). */\n readonly active = computed(() => this._pattern.active());\n\n /** Whether the widget is selected (only relevant in a selection group). */\n readonly selected = () => this._pattern.selected();\n\n private readonly _groupPattern: SignalLike<\n ToolbarWidgetGroupPattern<ToolbarWidgetPattern<V>, V> | undefined\n > = () => this._group?._pattern;\n\n /** The ToolbarWidget UIPattern. */\n readonly _pattern = new ToolbarWidgetPattern<V>({\n ...this,\n group: this._groupPattern,\n toolbar: this._toolbarPattern,\n id: this.id,\n value: this.value,\n element: () => this.element,\n });\n\n ngOnInit() {\n this._toolbar._register(this);\n }\n\n ngOnDestroy() {\n this._toolbar._unregister(this);\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 Directive,\n ElementRef,\n inject,\n computed,\n input,\n booleanAttribute,\n contentChildren,\n} from '@angular/core';\nimport {ToolbarWidgetPattern, ToolbarWidgetGroupPattern} from '../private';\nimport {Toolbar} from './toolbar';\nimport {ToolbarWidget} from './toolbar-widget';\nimport {TOOLBAR_WIDGET_GROUP} from './toolbar-tokens';\n\n/**\n * A directive that groups toolbar widgets, used for more complex widgets like radio groups\n * that have their own internal navigation.\n *\n * @developerPreview 21.0\n *\n * @see [Toolbar](guide/aria/toolbar)\n */\n@Directive({\n selector: '[ngToolbarWidgetGroup]',\n exportAs: 'ngToolbarWidgetGroup',\n providers: [{provide: TOOLBAR_WIDGET_GROUP, useExisting: ToolbarWidgetGroup}],\n})\nexport class ToolbarWidgetGroup<V> {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The parent Toolbar. */\n private readonly _toolbar = inject<Toolbar<V>>(Toolbar, {optional: true});\n\n /** The list of child widgets within the group. */\n private readonly _widgets = contentChildren(ToolbarWidget, {descendants: true});\n\n /** The parent Toolbar UIPattern. */\n private readonly _toolbarPattern = computed(() => this._toolbar?._pattern);\n\n /** Whether the widget group is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** The list of toolbar items within the group. */\n private readonly _itemPatterns = () => this._widgets().map(w => w._pattern);\n\n /** Whether the group allows multiple widgets to be selected. */\n readonly multi = input(false, {transform: booleanAttribute});\n\n /** The ToolbarWidgetGroup UIPattern. */\n readonly _pattern = new ToolbarWidgetGroupPattern<ToolbarWidgetPattern<V>, V>({\n ...this,\n items: this._itemPatterns,\n toolbar: this._toolbarPattern,\n });\n}\n"],"names":["Toolbar","_elementRef","inject","ElementRef","element","nativeElement","_widgets","signal","Set","textDirection","Directionality","valueSignal","_itemPatterns","computed","sort","sortDirectives","map","widget","_pattern","orientation","input","softDisabled","transform","booleanAttribute","disabled","wrap","value","model","ToolbarPattern","items","activeItem","undefined","getItem","e","_getItem","constructor","afterRenderEffect","write","setDefaultStateEffect","_register","widgets","has","add","set","_unregister","delete","find","item","contains","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","host","attributes","listeners","properties","exportAs","ngImport","decorators","args","TOOLBAR_WIDGET_GROUP","InjectionToken","ToolbarWidget","_toolbar","id","_IdGenerator","getId","_toolbarPattern","hardDisabled","_group","optional","required","active","selected","_groupPattern","ToolbarWidgetPattern","group","toolbar","ngOnInit","ngOnDestroy","ToolbarWidgetGroup","contentChildren","descendants","w","multi","ToolbarWidgetGroupPattern","ɵdir","ɵɵngDeclareDirective","minVersion","version","type","providers","provide","useExisting","propDecorators","ContentChildren","forwardRef","Input","alias"],"mappings":";;;;;;;;;;;;MA2DaA,OAAO,CAAA;AAEDC,EAAAA,WAAW,GAAGC,MAAM,CAACC,UAAU,CAAC;AAGxCC,EAAAA,OAAO,GAAG,IAAI,CAACH,WAAW,CAACI,aAA4B;EAG/CC,QAAQ,GAAGC,MAAM,CAAC,IAAIC,GAAG,EAAoB;;WAAC;AAGtDC,EAAAA,aAAa,GAAGP,MAAM,CAACQ,cAAc,CAAC,CAACC,WAAW;AAGlDC,EAAAA,aAAa,GAAGC,QAAQ,CAA4B,MAC3D,CAAC,GAAG,IAAI,CAACP,QAAQ,EAAE,CAAC,CAACQ,IAAI,CAACC,cAAc,CAAC,CAACC,GAAG,CAACC,MAAM,IAAIA,MAAM,CAACC,QAAQ,CAAC;;WACzE;EAGQC,WAAW,GAAGC,KAAK,CAA4B,YAAY;;WAAC;AAM5DC,EAAAA,YAAY,GAAGD,KAAK,CAAC,IAAI;;;;AAAGE,IAAAA,SAAS,EAAEC;AAAgB,GAAA,CAAE;AAGzDC,EAAAA,QAAQ,GAAGJ,KAAK,CAAC,KAAK;;;;AAAGE,IAAAA,SAAS,EAAEC;AAAgB,GAAA,CAAE;AAGtDE,EAAAA,IAAI,GAAGL,KAAK,CAAC,IAAI;;;;AAAGE,IAAAA,SAAS,EAAEC;AAAgB,GAAA,CAAE;EAGjDG,KAAK,GAAGC,KAAK,CAAM,EAAE;;WAAC;EAGtBT,QAAQ,GAAsB,IAAIU,cAAc,CAAI;AAC3D,IAAA,GAAG,IAAI;IACPC,KAAK,EAAE,IAAI,CAACjB,aAAa;AACzBkB,IAAAA,UAAU,EAAEvB,MAAM,CAACwB,SAAS,CAAC;IAC7BtB,aAAa,EAAE,IAAI,CAACA,aAAa;A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;;;;;;QAX9CwC,kBAAkB;AAAAtB,EAAAA,UAAA,EAAA,CAAA;UAL9BhB,SAAS;AAACiB,IAAAA,IAAA,EAAA,CAAA;AACTf,MAAAA,QAAQ,EAAE,wBAAwB;AAClCY,MAAAA,QAAQ,EAAE,sBAAsB;AAChCmC,MAAAA,SAAS,EAAE,CAAC;AAACC,QAAAA,OAAO,EAAEhC,oBAAoB;AAAEiC,QAAAA,WAAW,EAAAb;OAAqB;KAC7E;AAY6C,GAAA,CAAA;AAAAc,EAAAA,cAAA,EAAA;AAAAnG,IAAAA,QAAA,EAAA,CAAA;MAAA+F,IAAA,EAAAlD,EAAA,CAAAuD,eAAA;MAAApC,IAAA,EAAA,CAAAnB,EAAA,CAAAwD,UAAA,CAAA,MAAAlC,aAAa,CAAA,EAAA;QAAA,GAAE;AAACoB,UAAAA,WAAW,EAAE;SAAK;AAAAlC,QAAAA,QAAA,EAAA;OAAA;AAAA,KAAA,CAAA;AAAAnC,IAAAA,QAAA,EAAA,CAAA;MAAA6E,IAAA,EAAAlD,EAAA,CAAAyD,KAAA;AAAAtC,MAAAA,IAAA,EAAA,CAAA;AAAAX,QAAAA,QAAA,EAAA,IAAA;AAAAkD,QAAAA,KAAA,EAAA,UAAA;AAAA3B,QAAAA,QAAA,EAAA;OAAA;AAAA,KAAA,CAAA;AAAAa,IAAAA,KAAA,EAAA,CAAA;MAAAM,IAAA,EAAAlD,EAAA,CAAAyD,KAAA;AAAAtC,MAAAA,IAAA,EAAA,CAAA;AAAAX,QAAAA,QAAA,EAAA,IAAA;AAAAkD,QAAAA,KAAA,EAAA,OAAA;AAAA3B,QAAAA,QAAA,EAAA;OAAA;KAAA;AAAA;AAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"toolbar.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/toolbar/toolbar.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/toolbar/toolbar-tokens.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/toolbar/toolbar-widget.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/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 {\n afterNextRender,\n afterRenderEffect,\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n OnDestroy,\n signal,\n} from '@angular/core';\nimport {ToolbarPattern, ToolbarWidgetPattern, SortedCollection} from '../private';\nimport {Directionality} from '@angular/cdk/bidi';\nimport type {ToolbarWidget} from './toolbar-widget';\n\n/**\n * A toolbar widget container for a group of interactive widgets, such as\n * buttons or radio groups. It provides a single point of reference for keyboard navigation\n * and focus management. It supports various orientations and disabled states.\n *\n * ```html\n * <div ngToolbar orientation=\"horizontal\" [wrap]=\"true\">\n * <button ngToolbarWidget value=\"save\">Save</button>\n * <button ngToolbarWidget value=\"print\">Print</button>\n *\n * <div ngToolbarWidgetGroup [(value)]=\"selectedAlignment\">\n * <button ngToolbarWidget value=\"left\">Left</button>\n * <button ngToolbarWidget value=\"center\">Center</button>\n * <button ngToolbarWidget value=\"right\">Right</button>\n * </div>\n * </div>\n * ```\n *\n * @developerPreview 21.0\n *\n * @see [Toolbar](guide/aria/toolbar)\n */\n@Directive({\n selector: '[ngToolbar]',\n exportAs: 'ngToolbar',\n host: {\n 'role': 'toolbar',\n '[attr.tabindex]': '_pattern.tabIndex()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-orientation]': '_pattern.orientation()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(click)': '_pattern.onClick($event)',\n '(pointerdown)': '_pattern.onPointerdown($event)',\n '(focusin)': '_pattern.onFocusIn()',\n },\n})\nexport class Toolbar<V> implements OnDestroy {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The collection of widgets in the toolbar. */\n readonly _collection = new SortedCollection<ToolbarWidget<V>>();\n\n /** Text direction. */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** Sorted UIPatterns of the child widgets */\n readonly _itemPatterns = computed<ToolbarWidgetPattern<V>[]>(() =>\n this._collection.orderedItems().map(widget => widget._pattern),\n );\n\n /** Whether the toolbar is vertically or horizontally oriented. */\n readonly orientation = input<'vertical' | 'horizontal'>('horizontal');\n\n /**\n * Whether to allow disabled items to receive focus. When `true`, disabled items are\n * focusable but not interactive. When `false`, disabled items are skipped during navigation.\n */\n readonly softDisabled = input(true, {transform: booleanAttribute});\n\n /** Whether the toolbar is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether focus should wrap when navigating. */\n readonly wrap = input(true, {transform: booleanAttribute});\n\n /** The values of the selected widgets within the toolbar. */\n readonly value = model<V[]>([]);\n\n /** The toolbar UIPattern. */\n readonly _pattern: ToolbarPattern<V> = new ToolbarPattern<V>({\n ...this,\n items: this._itemPatterns,\n activeItem: signal(undefined),\n textDirection: this.textDirection,\n element: () => this._elementRef.nativeElement,\n getItem: e => this._getItem(e),\n value: this.value,\n });\n\n constructor() {\n afterRenderEffect({write: () => this._pattern.setDefaultStateEffect()});\n\n afterNextRender(() => {\n this._collection.startObserving(this.element);\n });\n }\n\n ngOnDestroy() {\n this._collection.stopObserving();\n }\n\n /** Finds the toolbar item associated with a given element. */\n private _getItem(element: Element) {\n return this._itemPatterns().find(item => item.element()?.contains(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 {InjectionToken} from '@angular/core';\nimport type {ToolbarWidgetGroup} from './toolbar-widget-group';\n\n/** Token used to provide the `ToolbarWidgetGroup` directive. */\nexport const TOOLBAR_WIDGET_GROUP = new InjectionToken<ToolbarWidgetGroup<unknown>>(\n 'TOOLBAR_WIDGET_GROUP',\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 Directive,\n ElementRef,\n inject,\n computed,\n input,\n booleanAttribute,\n OnInit,\n OnDestroy,\n} from '@angular/core';\nimport {\n ToolbarWidgetPattern,\n ToolbarWidgetGroupPattern,\n SignalLike,\n ToolbarPattern,\n} from '../private';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Toolbar} from './toolbar';\nimport {TOOLBAR_WIDGET_GROUP} from './toolbar-tokens';\nimport type {ToolbarWidgetGroup} from './toolbar-widget-group';\n\n/**\n * A widget within a toolbar.\n *\n * The `ngToolbarWidget` directive should be applied to any native HTML element that acts\n * as an interactive widget within an `ngToolbar` or `ngToolbarWidgetGroup`. It enables\n * keyboard navigation and selection within the toolbar.\n *\n * ```html\n * <button ngToolbarWidget value=\"action-id\" [disabled]=\"isDisabled\">\n * Perform Action\n * </button>\n * ```\n *\n * @developerPreview 21.0\n *\n * @see [Toolbar](guide/aria/toolbar)\n */\n@Directive({\n selector: '[ngToolbarWidget]',\n exportAs: 'ngToolbarWidget',\n host: {\n // Ensure the attribute is applied even when used as a host directive.\n 'ngToolbarWidget': '',\n '[attr.data-active]': 'active()',\n '[attr.tabindex]': '_pattern.tabIndex()',\n '[attr.inert]': 'hardDisabled() ? true : null',\n '[attr.disabled]': 'hardDisabled() ? true : null',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[id]': '_pattern.id()',\n },\n})\nexport class ToolbarWidget<V> implements OnInit, OnDestroy {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The parent Toolbar. */\n private readonly _toolbar = inject<Toolbar<V>>(Toolbar);\n\n /** A unique identifier for the widget. */\n readonly id = input(inject(_IdGenerator).getId('ng-toolbar-widget-', true));\n\n /** The parent Toolbar UIPattern. */\n readonly _toolbarPattern = computed<ToolbarPattern<V>>(() => this._toolbar._pattern);\n\n /** Whether the widget is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the widget is 'hard' disabled, which is different from `aria-disabled`. A hard disabled widget cannot receive focus. */\n readonly hardDisabled = computed(() => this._pattern.disabled() && !this._toolbar.softDisabled());\n\n /** The optional ToolbarWidgetGroup this widget belongs to. */\n readonly _group = inject<ToolbarWidgetGroup<V>>(TOOLBAR_WIDGET_GROUP, {optional: true});\n\n /** The value associated with the widget. */\n readonly value = input.required<V>();\n\n /** Whether the widget is currently active (focused). */\n readonly active = computed(() => this._pattern.active());\n\n /** Whether the widget is selected (only relevant in a selection group). */\n readonly selected = () => this._pattern.selected();\n\n private readonly _groupPattern: SignalLike<\n ToolbarWidgetGroupPattern<ToolbarWidgetPattern<V>, V> | undefined\n > = () => this._group?._pattern;\n\n /** The ToolbarWidget UIPattern. */\n readonly _pattern = new ToolbarWidgetPattern<V>({\n ...this,\n group: this._groupPattern,\n toolbar: this._toolbarPattern,\n id: this.id,\n value: this.value,\n element: () => this.element,\n });\n\n ngOnInit() {\n this._toolbar._collection.register(this);\n }\n\n ngOnDestroy() {\n this._toolbar._collection.unregister(this);\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 Directive,\n ElementRef,\n inject,\n computed,\n input,\n booleanAttribute,\n contentChildren,\n} from '@angular/core';\nimport {ToolbarWidgetPattern, ToolbarWidgetGroupPattern} from '../private';\nimport {Toolbar} from './toolbar';\nimport {ToolbarWidget} from './toolbar-widget';\nimport {TOOLBAR_WIDGET_GROUP} from './toolbar-tokens';\n\n/**\n * A directive that groups toolbar widgets, used for more complex widgets like radio groups\n * that have their own internal navigation.\n *\n * @developerPreview 21.0\n *\n * @see [Toolbar](guide/aria/toolbar)\n */\n@Directive({\n selector: '[ngToolbarWidgetGroup]',\n exportAs: 'ngToolbarWidgetGroup',\n providers: [{provide: TOOLBAR_WIDGET_GROUP, useExisting: ToolbarWidgetGroup}],\n})\nexport class ToolbarWidgetGroup<V> {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The parent Toolbar. */\n private readonly _toolbar = inject<Toolbar<V>>(Toolbar, {optional: true});\n\n /** The list of child widgets within the group. */\n private readonly _widgets = contentChildren(ToolbarWidget, {descendants: true});\n\n /** The parent Toolbar UIPattern. */\n private readonly _toolbarPattern = computed(() => this._toolbar?._pattern);\n\n /** Whether the widget group is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** The list of toolbar items within the group. */\n private readonly _itemPatterns = () => this._widgets().map(w => w._pattern);\n\n /** Whether the group allows multiple widgets to be selected. */\n readonly multi = input(false, {transform: booleanAttribute});\n\n /** The ToolbarWidgetGroup UIPattern. */\n readonly _pattern = new ToolbarWidgetGroupPattern<ToolbarWidgetPattern<V>, V>({\n ...this,\n items: this._itemPatterns,\n toolbar: this._toolbarPattern,\n });\n}\n"],"names":["Toolbar","_elementRef","inject","ElementRef","element","nativeElement","_collection","SortedCollection","textDirection","Directionality","valueSignal","_itemPatterns","computed","orderedItems","map","widget","_pattern","orientation","input","softDisabled","transform","booleanAttribute","disabled","wrap","value","model","ToolbarPattern","items","activeItem","signal","undefined","getItem","e","_getItem","constructor","afterRenderEffect","write","setDefaultStateEffect","afterNextRender","startObserving","ngOnDestroy","stopObserving","find","item","contains","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","host","attributes","listeners","properties","exportAs","ngImport","decorators","args","TOOLBAR_WIDGET_GROUP","InjectionToken","ToolbarWidget","_toolbar","id","_IdGenerator","getId","_toolbarPattern","hardDisabled","_group","optional","required","active","selected","_groupPattern","ToolbarWidgetPattern","group","toolbar","ngOnInit","register","unregister","ToolbarWidgetGroup","_widgets","contentChildren","descendants","w","multi","ToolbarWidgetGroupPattern","ɵdir","ɵɵngDeclareDirective","minVersion","version","type","providers","provide","useExisting","propDecorators","ContentChildren","forwardRef","Input","alias"],"mappings":";;;;;;;;;;;MA6DaA,OAAO,CAAA;AAEDC,EAAAA,WAAW,GAAGC,MAAM,CAACC,UAAU,CAAC;AAGxCC,EAAAA,OAAO,GAAG,IAAI,CAACH,WAAW,CAACI,aAA4B;AAGvDC,EAAAA,WAAW,GAAG,IAAIC,gBAAgB,EAAoB;AAGtDC,EAAAA,aAAa,GAAGN,MAAM,CAACO,cAAc,CAAC,CAACC,WAAW;EAGlDC,aAAa,GAAGC,QAAQ,CAA4B,MAC3D,IAAI,CAACN,WAAW,CAACO,YAAY,EAAE,CAACC,GAAG,CAACC,MAAM,IAAIA,MAAM,CAACC,QAAQ,CAAC;;WAC/D;EAGQC,WAAW,GAAGC,KAAK,CAA4B,YAAY;;WAAC;AAM5DC,EAAAA,YAAY,GAAGD,KAAK,CAAC,IAAI;;;;AAAGE,IAAAA,SAAS,EAAEC;AAAgB,GAAA,CAAE;AAGzDC,EAAAA,QAAQ,GAAGJ,KAAK,CAAC,KAAK;;;;AAAGE,IAAAA,SAAS,EAAEC;AAAgB,GAAA,CAAE;AAGtDE,EAAAA,IAAI,GAAGL,KAAK,CAAC,IAAI;;;;AAAGE,IAAAA,SAAS,EAAEC;AAAgB,GAAA,CAAE;EAGjDG,KAAK,GAAGC,KAAK,CAAM,EAAE;;WAAC;EAGtBT,QAAQ,GAAsB,IAAIU,cAAc,CAAI;AAC3D,IAAA,GAAG,IAAI;IACPC,KAAK,EAAE,IAAI,CAAChB,aAAa;AACzBiB,IAAAA,UAAU,EAAEC,MAAM,CAACC,SAAS,CAAC;IAC7BtB,aAAa,EAAE,IAAI,CAACA,aAAa;AACjCJ,IAAAA,OAAO,EAAEA,MAAM,IAAI,CAACH,WA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A,CAAAyD,eAAA;MAAAtC,IAAA,EAAA,CAAAnB,EAAA,CAAA0D,UAAA,CAAA,MAAApC,aAAa,CAAA,EAAA;QAAA,GAAE;AAACsB,UAAAA,WAAW,EAAE;SAAK;AAAApC,QAAAA,QAAA,EAAA;OAAA;AAAA,KAAA,CAAA;AAAAjC,IAAAA,QAAA,EAAA,CAAA;MAAA6E,IAAA,EAAApD,EAAA,CAAA2D,KAAA;AAAAxC,MAAAA,IAAA,EAAA,CAAA;AAAAX,QAAAA,QAAA,EAAA,IAAA;AAAAoD,QAAAA,KAAA,EAAA,UAAA;AAAA7B,QAAAA,QAAA,EAAA;OAAA;AAAA,KAAA,CAAA;AAAAe,IAAAA,KAAA,EAAA,CAAA;MAAAM,IAAA,EAAApD,EAAA,CAAA2D,KAAA;AAAAxC,MAAAA,IAAA,EAAA,CAAA;AAAAX,QAAAA,QAAA,EAAA,IAAA;AAAAoD,QAAAA,KAAA,EAAA,OAAA;AAAA7B,QAAAA,QAAA,EAAA;OAAA;KAAA;AAAA;AAAA,CAAA,CAAA;;;;"}
@@ -26,6 +26,18 @@ class TreeItemHarness extends ContentContainerComponentHarness {
26
26
  async click() {
27
27
  return (await this.host()).click();
28
28
  }
29
+ async focus() {
30
+ return (await this.host()).focus();
31
+ }
32
+ async blur() {
33
+ return (await this.host()).blur();
34
+ }
35
+ async isActive() {
36
+ return (await this._getHostAttribute('data-active')) === 'true';
37
+ }
38
+ async isFocused() {
39
+ return (await this.host()).isFocused();
40
+ }
29
41
  async _getHostAttribute(attributeName) {
30
42
  return (await this.host()).getAttribute(attributeName);
31
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tree-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/tree/testing/item-harness.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/tree/testing/tree-harness.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 {ContentContainerComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {TreeItemHarnessFilters} from './tree-harness-filters';\n\n/** Harness for interacting with an Aria tree item. */\nexport class TreeItemHarness extends ContentContainerComponentHarness<string> {\n static hostSelector = '[ngTreeItem]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a tree item with specific attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TreeItemHarnessFilters = {}): HarnessPredicate<TreeItemHarness> {\n return new HarnessPredicate(TreeItemHarness, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getText(), text),\n )\n .addOption(\n 'disabled',\n options.disabled,\n async (harness, disabled) => (await harness.isDisabled()) === disabled,\n )\n .addOption(\n 'expanded',\n options.expanded,\n async (harness, expanded) => (await harness.isExpanded()) === expanded,\n )\n .addOption(\n 'selected',\n options.selected,\n async (harness, selected) => (await harness.isSelected()) === selected,\n )\n .addOption(\n 'level',\n options.level,\n async (harness, level) => (await harness.getLevel()) === level,\n );\n }\n\n /** Whether the tree item is expanded. */\n async isExpanded(): Promise<boolean> {\n return (await this._getHostAttribute('aria-expanded')) === 'true';\n }\n\n /** Whether the tree item is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this._getHostAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the tree item is selected. */\n async isSelected(): Promise<boolean> {\n return (await this._getHostAttribute('aria-selected')) === 'true';\n }\n\n /** Gets the level of the tree item. Note that this gets the aria-level and is 1 indexed. */\n async getLevel(): Promise<number> {\n const level = (await this._getHostAttribute('aria-level')) ?? '1';\n return parseInt(level);\n }\n\n /** Gets the tree item's text. */\n async getText(): Promise<string> {\n return (await this.host()).text({exclude: '[ngTreeItem], [ngTreeItemGroup]'});\n }\n\n /** Clicks the tree item. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n private async _getHostAttribute(attributeName: string): Promise<string | null> {\n return (await this.host()).getAttribute(attributeName);\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 {ComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {TreeItemHarness} from './item-harness';\nimport {TreeHarnessFilters, TreeItemHarnessFilters} from './tree-harness-filters';\n\nexport interface TextTree {\n text?: string;\n children?: TextTree[];\n}\n\n/** Harness for interacting with an Aria tree in tests. */\nexport class TreeHarness extends ComponentHarness {\n static hostSelector = '[ngTree]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a tree with specific attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TreeHarnessFilters = {}): HarnessPredicate<TreeHarness> {\n return new HarnessPredicate(TreeHarness, options);\n }\n\n /** Gets all of the items in the tree. */\n async getItems(filter: TreeItemHarnessFilters = {}): Promise<TreeItemHarness[]> {\n return this.locatorForAll(TreeItemHarness.with(filter))();\n }\n\n /**\n * Gets an object representation for the visible tree structure\n * If an item is under an unexpanded item it will not be included.\n */\n async getTreeStructure(): Promise<TextTree> {\n const items = await this.getItems();\n const itemInformation = await parallel(() =>\n items.map(item => parallel(() => [item.getLevel(), item.getText(), item.isExpanded()])),\n );\n return this._getTreeStructure(itemInformation, 1, true);\n }\n\n /**\n * Recursively collect the structured text of the tree items.\n * @param items A list of tree items\n * @param level The level of items that are being accounted for during this iteration\n * @param parentExpanded Whether the parent of the first item in param items is expanded\n */\n private _getTreeStructure(\n items: [number, string, boolean][],\n level: number,\n parentExpanded: boolean,\n ): TextTree {\n const result: TextTree = {};\n for (let i = 0; i < items.length; i++) {\n const [itemLevel, text, expanded] = items[i];\n const nextItemLevel = items[i + 1]?.[0] ?? -1;\n\n // Return the accumulated value for the current level once we reach a shallower level item\n if (itemLevel < level) {\n return result;\n }\n // Skip deeper level items during this iteration, they will be picked up in a later iteration\n if (itemLevel > level) {\n continue;\n }\n // Only add to representation if it is visible (parent is expanded)\n if (parentExpanded) {\n // Collect the data under this item according to the following rules:\n // 1. If the next item in the list is a sibling of the current item add it to the child list\n // 2. If the next item is a child of the current item, get the sub-tree structure for the\n // child and add it under this item\n // 3. If the next item has a shallower level, we've reached the end of the child items for\n // the current parent.\n if (nextItemLevel === level) {\n this._addChildToItem(result, {text});\n } else if (nextItemLevel > level) {\n let children = this._getTreeStructure(\n items.slice(i + 1),\n nextItemLevel,\n expanded,\n )?.children;\n let child = children ? {text, children} : {text};\n this._addChildToItem(result, child);\n } else {\n this._addChildToItem(result, {text});\n return result;\n }\n }\n }\n return result;\n }\n\n private _addChildToItem(result: TextTree, child: TextTree) {\n result.children ? result.children.push(child) : (result.children = [child]);\n }\n}\n"],"names":["TreeItemHarness","ContentContainerComponentHarness","hostSelector","with","options","HarnessPredicate","addOption","text","harness","stringMatches","getText","disabled","isDisabled","expanded","isExpanded","selected","isSelected","level","getLevel","_getHostAttribute","parseInt","host","exclude","click","attributeName","getAttribute","TreeHarness","ComponentHarness","getItems","filter","locatorForAll","getTreeStructure","items","itemInformation","parallel","map","item","_getTreeStructure","parentExpanded","result","i","length","itemLevel","nextItemLevel","_addChildToItem","children","slice","child","push"],"mappings":";;AAYM,MAAOA,eAAgB,SAAQC,gCAAwC,CAAA;EAC3E,OAAOC,YAAY,GAAG,cAAc;AAOpC,EAAA,OAAOC,IAAIA,CAACC,OAAA,GAAkC,EAAE,EAAA;AAC9C,IAAA,OAAO,IAAIC,gBAAgB,CAACL,eAAe,EAAEI,OAAO,CAAA,CACjDE,SAAS,CAAC,MAAM,EAAEF,OAAO,CAACG,IAAI,EAAE,CAACC,OAAO,EAAED,IAAI,KAC7CF,gBAAgB,CAACI,aAAa,CAACD,OAAO,CAACE,OAAO,EAAE,EAAEH,IAAI,CAAC,CAAA,CAExDD,SAAS,CACR,UAAU,EACVF,OAAO,CAACO,QAAQ,EAChB,OAAOH,OAAO,EA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C7E,EAAA;;;;;"}
1
+ {"version":3,"file":"tree-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/tree/testing/item-harness.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/tree/testing/tree-harness.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 {ContentContainerComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {TreeItemHarnessFilters} from './tree-harness-filters';\n\n/** Harness for interacting with an Aria tree item. */\nexport class TreeItemHarness extends ContentContainerComponentHarness<string> {\n static hostSelector = '[ngTreeItem]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a tree item with specific attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TreeItemHarnessFilters = {}): HarnessPredicate<TreeItemHarness> {\n return new HarnessPredicate(TreeItemHarness, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getText(), text),\n )\n .addOption(\n 'disabled',\n options.disabled,\n async (harness, disabled) => (await harness.isDisabled()) === disabled,\n )\n .addOption(\n 'expanded',\n options.expanded,\n async (harness, expanded) => (await harness.isExpanded()) === expanded,\n )\n .addOption(\n 'selected',\n options.selected,\n async (harness, selected) => (await harness.isSelected()) === selected,\n )\n .addOption(\n 'level',\n options.level,\n async (harness, level) => (await harness.getLevel()) === level,\n );\n }\n\n /** Whether the tree item is expanded. */\n async isExpanded(): Promise<boolean> {\n return (await this._getHostAttribute('aria-expanded')) === 'true';\n }\n\n /** Whether the tree item is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this._getHostAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the tree item is selected. */\n async isSelected(): Promise<boolean> {\n return (await this._getHostAttribute('aria-selected')) === 'true';\n }\n\n /** Gets the level of the tree item. Note that this gets the aria-level and is 1 indexed. */\n async getLevel(): Promise<number> {\n const level = (await this._getHostAttribute('aria-level')) ?? '1';\n return parseInt(level);\n }\n\n /** Gets the tree item's text. */\n async getText(): Promise<string> {\n return (await this.host()).text({exclude: '[ngTreeItem], [ngTreeItemGroup]'});\n }\n\n /** Clicks the tree item. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Focuses the tree item. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the tree item. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the tree item is active. */\n async isActive(): Promise<boolean> {\n return (await this._getHostAttribute('data-active')) === 'true';\n }\n\n /** Whether the tree item has focus. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n private async _getHostAttribute(attributeName: string): Promise<string | null> {\n return (await this.host()).getAttribute(attributeName);\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 {ComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {TreeItemHarness} from './item-harness';\nimport {TreeHarnessFilters, TreeItemHarnessFilters} from './tree-harness-filters';\n\nexport interface TextTree {\n text?: string;\n children?: TextTree[];\n}\n\n/** Harness for interacting with an Aria tree in tests. */\nexport class TreeHarness extends ComponentHarness {\n static hostSelector = '[ngTree]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a tree with specific attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TreeHarnessFilters = {}): HarnessPredicate<TreeHarness> {\n return new HarnessPredicate(TreeHarness, options);\n }\n\n /** Gets all of the items in the tree. */\n async getItems(filter: TreeItemHarnessFilters = {}): Promise<TreeItemHarness[]> {\n return this.locatorForAll(TreeItemHarness.with(filter))();\n }\n\n /**\n * Gets an object representation for the visible tree structure\n * If an item is under an unexpanded item it will not be included.\n */\n async getTreeStructure(): Promise<TextTree> {\n const items = await this.getItems();\n const itemInformation = await parallel(() =>\n items.map(item => parallel(() => [item.getLevel(), item.getText(), item.isExpanded()])),\n );\n return this._getTreeStructure(itemInformation, 1, true);\n }\n\n /**\n * Recursively collect the structured text of the tree items.\n * @param items A list of tree items\n * @param level The level of items that are being accounted for during this iteration\n * @param parentExpanded Whether the parent of the first item in param items is expanded\n */\n private _getTreeStructure(\n items: [number, string, boolean][],\n level: number,\n parentExpanded: boolean,\n ): TextTree {\n const result: TextTree = {};\n for (let i = 0; i < items.length; i++) {\n const [itemLevel, text, expanded] = items[i];\n const nextItemLevel = items[i + 1]?.[0] ?? -1;\n\n // Return the accumulated value for the current level once we reach a shallower level item\n if (itemLevel < level) {\n return result;\n }\n // Skip deeper level items during this iteration, they will be picked up in a later iteration\n if (itemLevel > level) {\n continue;\n }\n // Only add to representation if it is visible (parent is expanded)\n if (parentExpanded) {\n // Collect the data under this item according to the following rules:\n // 1. If the next item in the list is a sibling of the current item add it to the child list\n // 2. If the next item is a child of the current item, get the sub-tree structure for the\n // child and add it under this item\n // 3. If the next item has a shallower level, we've reached the end of the child items for\n // the current parent.\n if (nextItemLevel === level) {\n this._addChildToItem(result, {text});\n } else if (nextItemLevel > level) {\n let children = this._getTreeStructure(\n items.slice(i + 1),\n nextItemLevel,\n expanded,\n )?.children;\n let child = children ? {text, children} : {text};\n this._addChildToItem(result, child);\n } else {\n this._addChildToItem(result, {text});\n return result;\n }\n }\n }\n return result;\n }\n\n private _addChildToItem(result: TextTree, child: TextTree) {\n result.children ? result.children.push(child) : (result.children = [child]);\n }\n}\n"],"names":["TreeItemHarness","ContentContainerComponentHarness","hostSelector","with","options","HarnessPredicate","addOption","text","harness","stringMatches","getText","disabled","isDisabled","expanded","isExpanded","selected","isSelected","level","getLevel","_getHostAttribute","parseInt","host","exclude","click","focus","blur","isActive","isFocused","attributeName","getAttribute","TreeHarness","ComponentHarness","getItems","filter","locatorForAll","getTreeStructure","items","itemInformation","parallel","map","item","_getTreeStructure","parentExpanded","result","i","length","itemLevel","nextItemLevel","_addChildToItem","children","slice","child","push"],"mappings":";;AAYM,MAAOA,eAAgB,SAAQC,gCAAwC,CAAA;EAC3E,OAAOC,YAAY,GAAG,cAAc;AAOpC,EAAA,OAAOC,IAAIA,CAACC,OAAA,GAAkC,EAAE,EAAA;AAC9C,IAAA,OAAO,IAAIC,gBAAgB,CAACL,eAAe,EAAEI,OAAO,CAAA,CACjDE,SAAS,CAAC,MAAM,EAAEF,OAAO,CAACG,IAAI,EAAE,CAACC,OAAO,EAAED,IAAI,KAC7CF,gBAAgB,CAACI,aAAa,CAACD,OAAO,CAACE,OAAO,EAAE,EAAEH,IAAI,CAAC,CAAA,CAExDD,SAAS,CACR,UAAU,EACVF,OAAO,CAACO,QAAQ,EAChB,OAAOH,OAAO,EAAEG,QAAQ,KAAK,CAAC,MAAMH,OAAO,CAACI,UAAU,EAAE,MAAMD,QAAQ,CAAA,CAEvEL,SAAS,CACR,UAAU,EACVF,OAAO,CAACS,QAAQ,EAChB,OAAOL,OAAO,EAAEK,QAAQ,KAAK,CAAC,MAAML,OAAO,CAACM,UAAU,EAAE,MAAMD,QAAQ,CAAA,CAEvEP,SAAS,CACR,UAAU,EACVF,OAAO,CAACW,QAAQ,EAChB,OAAOP,OAAO,EAAEO,QAAQ,KAAK,CAAC,MAAMP,OAAO,CAACQ,UAAU,EAAE,MAAMD,QAAQ,CAAA,CAEvET,SAAS,CACR,OAAO,EACPF,OAAO,CAACa,KAAK,EACb,OAAOT,OAAO,EAAES,KAAK,KAAK,CAAC,MAAMT,OAAO,CAACU,QAAQ,EAAE,MAAMD,KAAK,CAC/D;AACL,EAAA;EAGA,MAAMH,UAAUA,GAAA;IACd,OAAO,CAAC,MAAM,IAAI,CAACK,iBAAiB,CAAC,eAAe,CAAC,MAAM,MAAM;AACnE,EAAA;EAGA,MAAMP,UAAUA,GAAA;IACd,OAAO,CAAC,MAAM,IAAI,CAACO,iBAAiB,CAAC,eAAe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