@angular/aria 21.1.0-next.0 → 21.1.0-next.2

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 (56) hide show
  1. package/fesm2022/_combobox-chunk.mjs +425 -0
  2. package/fesm2022/_combobox-chunk.mjs.map +1 -0
  3. package/fesm2022/_combobox-listbox-chunk.mjs +522 -0
  4. package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -0
  5. package/fesm2022/_combobox-popup-chunk.mjs +46 -0
  6. package/fesm2022/_combobox-popup-chunk.mjs.map +1 -0
  7. package/fesm2022/_list-navigation-chunk.mjs +116 -0
  8. package/fesm2022/_list-navigation-chunk.mjs.map +1 -0
  9. package/fesm2022/_pointer-event-manager-chunk.mjs +134 -0
  10. package/fesm2022/_pointer-event-manager-chunk.mjs.map +1 -0
  11. package/fesm2022/_widget-chunk.mjs +4 -246
  12. package/fesm2022/_widget-chunk.mjs.map +1 -1
  13. package/fesm2022/accordion.mjs +64 -51
  14. package/fesm2022/accordion.mjs.map +1 -1
  15. package/fesm2022/aria.mjs +1 -1
  16. package/fesm2022/aria.mjs.map +1 -1
  17. package/fesm2022/combobox.mjs +120 -144
  18. package/fesm2022/combobox.mjs.map +1 -1
  19. package/fesm2022/grid.mjs +285 -261
  20. package/fesm2022/grid.mjs.map +1 -1
  21. package/fesm2022/listbox.mjs +205 -193
  22. package/fesm2022/listbox.mjs.map +1 -1
  23. package/fesm2022/menu.mjs +301 -283
  24. package/fesm2022/menu.mjs.map +1 -1
  25. package/fesm2022/private.mjs +15 -938
  26. package/fesm2022/private.mjs.map +1 -1
  27. package/fesm2022/tabs.mjs +209 -195
  28. package/fesm2022/tabs.mjs.map +1 -1
  29. package/fesm2022/toolbar.mjs +59 -47
  30. package/fesm2022/toolbar.mjs.map +1 -1
  31. package/fesm2022/tree.mjs +43 -41
  32. package/fesm2022/tree.mjs.map +1 -1
  33. package/package.json +2 -2
  34. package/types/_combobox-chunk.d.ts +98 -0
  35. package/types/_combobox-chunk.d2.ts +193 -0
  36. package/types/_grid-chunk.d.ts +3 -210
  37. package/types/_list-chunk.d.ts +212 -0
  38. package/types/_list-navigation-chunk.d.ts +212 -0
  39. package/types/_listbox-chunk.d.ts +106 -0
  40. package/types/accordion.d.ts +52 -49
  41. package/types/combobox.d.ts +25 -111
  42. package/types/grid.d.ts +37 -32
  43. package/types/listbox.d.ts +8 -5
  44. package/types/menu.d.ts +113 -113
  45. package/types/private.d.ts +12 -498
  46. package/types/tabs.d.ts +89 -84
  47. package/types/toolbar.d.ts +69 -66
  48. package/types/tree.d.ts +106 -103
  49. package/_adev_assets/aria-accordion.json +0 -743
  50. package/_adev_assets/aria-combobox.json +0 -607
  51. package/_adev_assets/aria-grid.json +0 -901
  52. package/_adev_assets/aria-listbox.json +0 -544
  53. package/_adev_assets/aria-menu.json +0 -1049
  54. package/_adev_assets/aria-tabs.json +0 -880
  55. package/_adev_assets/aria-toolbar.json +0 -545
  56. package/_adev_assets/aria-tree.json +0 -861
package/fesm2022/tree.mjs CHANGED
@@ -4,12 +4,12 @@ import { _IdGenerator } from '@angular/cdk/a11y';
4
4
  import { Directionality } from '@angular/cdk/bidi';
5
5
  import * as i1 from '@angular/aria/private';
6
6
  import { ComboboxTreePattern, TreePattern, DeferredContentAware, TreeItemPattern, DeferredContent } from '@angular/aria/private';
7
- import { ComboboxPopup } from './combobox.mjs';
8
- import '@angular/core/rxjs-interop';
7
+ import { ComboboxPopup } from './_combobox-popup-chunk.mjs';
9
8
 
10
9
  function sortDirectives(a, b) {
11
10
  return (a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_PRECEDING) > 0 ? 1 : -1;
12
11
  }
12
+
13
13
  class Tree {
14
14
  _elementRef = inject(ElementRef);
15
15
  element = this._elementRef.nativeElement;
@@ -25,36 +25,36 @@ class Tree {
25
25
  orientation = input('vertical', ...(ngDevMode ? [{
26
26
  debugName: "orientation"
27
27
  }] : []));
28
- multi = input(false, ...(ngDevMode ? [{
29
- debugName: "multi",
30
- transform: booleanAttribute
31
- }] : [{
28
+ multi = input(false, {
29
+ ...(ngDevMode ? {
30
+ debugName: "multi"
31
+ } : {}),
32
32
  transform: booleanAttribute
33
- }]));
34
- disabled = input(false, ...(ngDevMode ? [{
35
- debugName: "disabled",
36
- transform: booleanAttribute
37
- }] : [{
33
+ });
34
+ disabled = input(false, {
35
+ ...(ngDevMode ? {
36
+ debugName: "disabled"
37
+ } : {}),
38
38
  transform: booleanAttribute
39
- }]));
39
+ });
40
40
  selectionMode = input('explicit', ...(ngDevMode ? [{
41
41
  debugName: "selectionMode"
42
42
  }] : []));
43
43
  focusMode = input('roving', ...(ngDevMode ? [{
44
44
  debugName: "focusMode"
45
45
  }] : []));
46
- wrap = input(true, ...(ngDevMode ? [{
47
- debugName: "wrap",
48
- transform: booleanAttribute
49
- }] : [{
46
+ wrap = input(true, {
47
+ ...(ngDevMode ? {
48
+ debugName: "wrap"
49
+ } : {}),
50
50
  transform: booleanAttribute
51
- }]));
52
- softDisabled = input(true, ...(ngDevMode ? [{
53
- debugName: "softDisabled",
54
- transform: booleanAttribute
55
- }] : [{
51
+ });
52
+ softDisabled = input(true, {
53
+ ...(ngDevMode ? {
54
+ debugName: "softDisabled"
55
+ } : {}),
56
56
  transform: booleanAttribute
57
- }]));
57
+ });
58
58
  typeaheadDelay = input(500, ...(ngDevMode ? [{
59
59
  debugName: "typeaheadDelay"
60
60
  }] : []));
@@ -62,12 +62,12 @@ class Tree {
62
62
  debugName: "values"
63
63
  }] : []));
64
64
  textDirection = inject(Directionality).valueSignal;
65
- nav = input(false, ...(ngDevMode ? [{
66
- debugName: "nav",
67
- transform: booleanAttribute
68
- }] : [{
65
+ nav = input(false, {
66
+ ...(ngDevMode ? {
67
+ debugName: "nav"
68
+ } : {}),
69
69
  transform: booleanAttribute
70
- }]));
70
+ });
71
71
  currentType = input('page', ...(ngDevMode ? [{
72
72
  debugName: "currentType"
73
73
  }] : []));
@@ -127,7 +127,7 @@ class Tree {
127
127
  }
128
128
  static ɵfac = i0.ɵɵngDeclareFactory({
129
129
  minVersion: "12.0.0",
130
- version: "21.0.0",
130
+ version: "21.0.3",
131
131
  ngImport: i0,
132
132
  type: Tree,
133
133
  deps: [],
@@ -135,7 +135,7 @@ class Tree {
135
135
  });
136
136
  static ɵdir = i0.ɵɵngDeclareDirective({
137
137
  minVersion: "17.1.0",
138
- version: "21.0.0",
138
+ version: "21.0.3",
139
139
  type: Tree,
140
140
  isStandalone: true,
141
141
  selector: "[ngTree]",
@@ -255,7 +255,7 @@ class Tree {
255
255
  }
256
256
  i0.ɵɵngDeclareClassMetadata({
257
257
  minVersion: "12.0.0",
258
- version: "21.0.0",
258
+ version: "21.0.3",
259
259
  ngImport: i0,
260
260
  type: Tree,
261
261
  decorators: [{
@@ -381,6 +381,7 @@ i0.ɵɵngDeclareClassMetadata({
381
381
  }]
382
382
  }
383
383
  });
384
+
384
385
  class TreeItem extends DeferredContentAware {
385
386
  _elementRef = inject(ElementRef);
386
387
  element = this._elementRef.nativeElement;
@@ -396,12 +397,12 @@ class TreeItem extends DeferredContentAware {
396
397
  parent = input.required(...(ngDevMode ? [{
397
398
  debugName: "parent"
398
399
  }] : []));
399
- disabled = input(false, ...(ngDevMode ? [{
400
- debugName: "disabled",
400
+ disabled = input(false, {
401
+ ...(ngDevMode ? {
402
+ debugName: "disabled"
403
+ } : {}),
401
404
  transform: booleanAttribute
402
- }] : [{
403
- transform: booleanAttribute
404
- }]));
405
+ });
405
406
  selectable = input(true, ...(ngDevMode ? [{
406
407
  debugName: "selectable"
407
408
  }] : []));
@@ -485,7 +486,7 @@ class TreeItem extends DeferredContentAware {
485
486
  }
486
487
  static ɵfac = i0.ɵɵngDeclareFactory({
487
488
  minVersion: "12.0.0",
488
- version: "21.0.0",
489
+ version: "21.0.3",
489
490
  ngImport: i0,
490
491
  type: TreeItem,
491
492
  deps: [],
@@ -493,7 +494,7 @@ class TreeItem extends DeferredContentAware {
493
494
  });
494
495
  static ɵdir = i0.ɵɵngDeclareDirective({
495
496
  minVersion: "17.1.0",
496
- version: "21.0.0",
497
+ version: "21.0.3",
497
498
  type: TreeItem,
498
499
  isStandalone: true,
499
500
  selector: "[ngTreeItem]",
@@ -575,7 +576,7 @@ class TreeItem extends DeferredContentAware {
575
576
  }
576
577
  i0.ɵɵngDeclareClassMetadata({
577
578
  minVersion: "12.0.0",
578
- version: "21.0.0",
579
+ version: "21.0.3",
579
580
  ngImport: i0,
580
581
  type: TreeItem,
581
582
  decorators: [{
@@ -661,6 +662,7 @@ i0.ɵɵngDeclareClassMetadata({
661
662
  }]
662
663
  }
663
664
  });
665
+
664
666
  class TreeItemGroup {
665
667
  _elementRef = inject(ElementRef);
666
668
  element = this._elementRef.nativeElement;
@@ -691,7 +693,7 @@ class TreeItemGroup {
691
693
  }
692
694
  static ɵfac = i0.ɵɵngDeclareFactory({
693
695
  minVersion: "12.0.0",
694
- version: "21.0.0",
696
+ version: "21.0.3",
695
697
  ngImport: i0,
696
698
  type: TreeItemGroup,
697
699
  deps: [],
@@ -699,7 +701,7 @@ class TreeItemGroup {
699
701
  });
700
702
  static ɵdir = i0.ɵɵngDeclareDirective({
701
703
  minVersion: "17.1.0",
702
- version: "21.0.0",
704
+ version: "21.0.3",
703
705
  type: TreeItemGroup,
704
706
  isStandalone: true,
705
707
  selector: "ng-template[ngTreeItemGroup]",
@@ -721,7 +723,7 @@ class TreeItemGroup {
721
723
  }
722
724
  i0.ɵɵngDeclareClassMetadata({
723
725
  minVersion: "12.0.0",
724
- version: "21.0.0",
726
+ version: "21.0.3",
725
727
  ngImport: i0,
726
728
  type: TreeItemGroup,
727
729
  decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"tree.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/aria/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 {\n Directive,\n ElementRef,\n afterRenderEffect,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n signal,\n Signal,\n OnInit,\n OnDestroy,\n untracked,\n afterNextRender,\n} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n ComboboxTreePattern,\n TreeItemPattern,\n TreePattern,\n DeferredContent,\n DeferredContentAware,\n} from '@angular/aria/private';\nimport {ComboboxPopup} from '../combobox';\n\ninterface HasElement {\n element: HTMLElement;\n}\n\n/**\n * Sort directives by their document order.\n */\nfunction sortDirectives(a: HasElement, b: HasElement) {\n return (a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_PRECEDING) > 0\n ? 1\n : -1;\n}\n\n/**\n * A container that transforms nested lists into an accessible, ARIA-compliant tree structure.\n * It manages the overall state of the tree, including selection, expansion, and keyboard\n * navigation.\n *\n * ```html\n * <ul ngTree [(value)]=\"selectedItems\" [multi]=\"true\">\n * <ng-template\n * [ngTemplateOutlet]=\"treeNodes\"\n * [ngTemplateOutletContext]=\"{nodes: treeData, parent: tree}\"\n * />\n * </ul>\n *\n * <ng-template #treeNodes let-nodes=\"nodes\" let-parent=\"parent\">\n * @for (node of nodes; track node.name) {\n * <li ngTreeItem [parent]=\"parent\" [value]=\"node.name\" [label]=\"node.name\">\n * {{ node.name }}\n * @if (node.children) {\n * <ul role=\"group\">\n * <ng-template ngTreeItemGroup [ownedBy]=\"treeItem\" #group=\"ngTreeItemGroup\">\n * <ng-template\n * [ngTemplateOutlet]=\"treeNodes\"\n * [ngTemplateOutletContext]=\"{nodes: node.children, parent: group}\"\n * />\n * </ng-template>\n * </ul>\n * }\n * </li>\n * }\n * </ng-template>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngTree]',\n exportAs: 'ngTree',\n host: {\n 'role': 'tree',\n '[attr.id]': 'id()',\n '[attr.aria-orientation]': '_pattern.orientation()',\n '[attr.aria-multiselectable]': '_pattern.multi()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-activedescendant]': '_pattern.activeDescendant()',\n '[tabindex]': '_pattern.tabIndex()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(pointerdown)': '_pattern.onPointerdown($event)',\n '(focusin)': '_onFocus()',\n },\n hostDirectives: [ComboboxPopup],\n})\nexport class Tree<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 /** A reference to the parent combobox popup, if one exists. */\n private readonly _popup = inject<ComboboxPopup<V>>(ComboboxPopup, {\n optional: true,\n });\n\n /** All TreeItem instances within this tree. */\n private readonly _unorderedItems = signal(new Set<TreeItem<V>>());\n\n /** A unique identifier for the tree. */\n readonly id = input(inject(_IdGenerator).getId('ng-tree-', true));\n\n /** Orientation of the tree. */\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /** Whether multi-selection is allowed. */\n readonly multi = input(false, {transform: booleanAttribute});\n\n /** Whether the tree is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /**\n * The selection strategy used by the tree.\n * - `explicit`: Items are selected explicitly by the user (e.g., via click or spacebar).\n * - `follow`: The focused item is automatically selected.\n */\n readonly selectionMode = input<'explicit' | 'follow'>('explicit');\n\n /**\n * The focus strategy used by the tree.\n * - `roving`: Focus is moved to the active item using `tabindex`.\n * - `activedescendant`: Focus remains on the tree container, and `aria-activedescendant` is used to indicate the active item.\n */\n readonly focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** Whether navigation wraps. */\n readonly wrap = input(true, {transform: booleanAttribute});\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 /** The delay in seconds before the typeahead search is reset. */\n readonly typeaheadDelay = input(500);\n\n /** The values of the currently selected items. */\n readonly values = model<V[]>([]);\n\n /** Text direction. */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** Whether the tree is in navigation mode. */\n readonly nav = input(false, {transform: booleanAttribute});\n\n /**\n * The `aria-current` type. It can be used in navigation trees to indicate the currently active item.\n * See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-current for more details.\n */\n readonly currentType = input<'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'>(\n 'page',\n );\n\n /** The UI pattern for the tree. */\n readonly _pattern: TreePattern<V>;\n\n /** Whether the tree has received focus since it was rendered. */\n private _hasFocused = signal(false);\n\n constructor() {\n const inputs = {\n ...this,\n id: this.id,\n allItems: computed(() =>\n [...this._unorderedItems()].sort(sortDirectives).map(item => item._pattern),\n ),\n activeItem: signal<TreeItemPattern<V> | undefined>(undefined),\n combobox: () => this._popup?.combobox?._pattern,\n element: () => this.element,\n };\n\n this._pattern = this._popup?.combobox\n ? new ComboboxTreePattern<V>(inputs)\n : new TreePattern<V>(inputs);\n\n if (this._popup?.combobox) {\n this._popup?._controls?.set(this._pattern as ComboboxTreePattern<V>);\n }\n\n afterRenderEffect(() => {\n if (!this._hasFocused()) {\n this._pattern.setDefaultState();\n }\n });\n\n afterRenderEffect(() => {\n const items = inputs.allItems();\n const activeItem = untracked(() => inputs.activeItem());\n\n if (!items.some(i => i === activeItem) && activeItem) {\n this._pattern.listBehavior.unfocus();\n }\n });\n\n afterRenderEffect(() => {\n if (!(this._pattern instanceof ComboboxTreePattern)) return;\n\n const items = inputs.allItems();\n const values = untracked(() => this.values());\n\n if (items && values.some(v => !items.some(i => i.value() === v))) {\n this.values.set(values.filter(v => items.some(i => i.value() === v)));\n }\n });\n }\n\n _onFocus() {\n this._hasFocused.set(true);\n }\n\n _register(child: TreeItem<V>) {\n this._unorderedItems().add(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n\n _unregister(child: TreeItem<V>) {\n this._unorderedItems().delete(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n\n scrollActiveItemIntoView(options: ScrollIntoViewOptions = {block: 'nearest'}) {\n this._pattern.inputs.activeItem()?.element()?.scrollIntoView(options);\n }\n}\n\n/**\n * A selectable and expandable item in an `ngTree`.\n *\n * The `ngTreeItem` directive represents an individual node within an `ngTree`. It can be\n * selected, expanded (if it has children), and disabled. The `parent` input establishes\n * the hierarchical relationship within the tree.\n *\n * ```html\n * <li ngTreeItem [parent]=\"parentTreeOrGroup\" value=\"item-id\" label=\"Item Label\">\n * Item Label\n * </li>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngTreeItem]',\n exportAs: 'ngTreeItem',\n host: {\n '[attr.data-active]': 'active()',\n 'role': 'treeitem',\n '[id]': '_pattern.id()',\n '[attr.aria-expanded]': '_expanded()',\n '[attr.aria-selected]': 'selected()',\n '[attr.aria-current]': '_pattern.current()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-level]': 'level()',\n '[attr.aria-setsize]': '_pattern.setsize()',\n '[attr.aria-posinset]': '_pattern.posinset()',\n '[attr.tabindex]': '_pattern.tabIndex()',\n },\n})\nexport class TreeItem<V> extends DeferredContentAware implements OnInit, OnDestroy, HasElement {\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 owned tree item group. */\n private readonly _group = signal<TreeItemGroup<V> | undefined>(undefined);\n\n /** A unique identifier for the tree item. */\n readonly id = input(inject(_IdGenerator).getId('ng-tree-item-', true));\n\n /** The value of the tree item. */\n readonly value = input.required<V>();\n\n /** The parent tree root or tree item group. */\n readonly parent = input.required<Tree<V> | TreeItemGroup<V>>();\n\n /** Whether the tree item is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the tree item is selectable. */\n readonly selectable = input<boolean>(true);\n\n /** Whether the tree item is expanded. */\n readonly expanded = model<boolean>(false);\n\n /** Optional label for typeahead. Defaults to the element's textContent. */\n readonly label = input<string>();\n\n /** Search term for typeahead. */\n readonly searchTerm = computed(() => this.label() ?? this.element.textContent);\n\n /** The tree root. */\n readonly tree: Signal<Tree<V>> = computed(() => {\n if (this.parent() instanceof Tree) {\n return this.parent() as Tree<V>;\n }\n return (this.parent() as TreeItemGroup<V>).ownedBy().tree();\n });\n\n /** Whether the item is active. */\n readonly active = computed(() => this._pattern.active());\n\n /** The level of the current item in a tree. */\n readonly level = computed(() => this._pattern.level());\n\n /** Whether the item is selected. */\n readonly selected = computed(() => this._pattern.selected());\n\n /** Whether this item is visible due to all of its parents being expanded. */\n readonly visible = computed(() => this._pattern.visible());\n\n /** Whether the tree is expanded. Use this value for aria-expanded. */\n protected readonly _expanded: Signal<boolean | undefined> = computed(() =>\n this._pattern.expandable() ? this._pattern.expanded() : undefined,\n );\n\n /** The UI pattern for this item. */\n _pattern: TreeItemPattern<V>;\n\n constructor() {\n super();\n afterNextRender(() => {\n if (this.tree()._pattern instanceof ComboboxTreePattern) {\n this.preserveContent.set(true);\n }\n });\n // Connect the group's hidden state to the DeferredContentAware's visibility.\n afterRenderEffect(() => {\n this.tree()._pattern instanceof ComboboxTreePattern\n ? this.contentVisible.set(true)\n : this.contentVisible.set(this._pattern.expanded());\n });\n }\n\n ngOnInit() {\n this.parent()._register(this);\n this.tree()._register(this);\n\n const treePattern = computed(() => this.tree()._pattern);\n const parentPattern = computed(() => {\n if (this.parent() instanceof Tree) {\n return treePattern();\n }\n return (this.parent() as TreeItemGroup<V>).ownedBy()._pattern;\n });\n this._pattern = new TreeItemPattern<V>({\n ...this,\n tree: treePattern,\n parent: parentPattern,\n children: computed(() => this._group()?._childPatterns() ?? []),\n hasChildren: computed(() => !!this._group()),\n element: () => this.element,\n searchTerm: () => this.searchTerm() ?? '',\n });\n }\n\n ngOnDestroy() {\n this.parent()._unregister(this);\n this.tree()._unregister(this);\n }\n\n _register(group: TreeItemGroup<V>) {\n this._group.set(group);\n }\n\n _unregister() {\n this._group.set(undefined);\n }\n}\n\n/**\n * Group that contains children tree items.\n *\n * The `ngTreeItemGroup` structural directive should be applied to an `ng-template` that\n * wraps the child `ngTreeItem` elements. It is used to define a group of children for an\n * expandable `ngTreeItem`. The `ownedBy` input links the group to its parent `ngTreeItem`.\n *\n * ```html\n * <li ngTreeItem [value]=\"'parent-id'\">\n * Parent Item\n * <ul role=\"group\">\n * <ng-template ngTreeItemGroup [ownedBy]=\"parentTreeItemRef\">\n * <li ngTreeItem [value]=\"'child-id'\">Child Item</li>\n * </ng-template>\n * </ul>\n * </li>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: 'ng-template[ngTreeItemGroup]',\n exportAs: 'ngTreeItemGroup',\n hostDirectives: [DeferredContent],\n})\nexport class TreeItemGroup<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 DeferredContent host directive. */\n private readonly _deferredContent = inject(DeferredContent);\n\n /** All groupable items that are descendants of the group. */\n private readonly _unorderedItems = signal(new Set<TreeItem<V>>());\n\n /** Child items within this group. */\n readonly _childPatterns = computed<TreeItemPattern<V>[]>(() =>\n [...this._unorderedItems()].sort(sortDirectives).map(c => c._pattern),\n );\n\n /** Tree item that owns the group. */\n readonly ownedBy = input.required<TreeItem<V>>();\n\n ngOnInit() {\n this._deferredContent.deferredContentAware.set(this.ownedBy());\n this.ownedBy()._register(this);\n }\n\n ngOnDestroy() {\n this.ownedBy()._unregister();\n }\n\n _register(child: TreeItem<V>) {\n this._unorderedItems().add(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n\n _unregister(child: TreeItem<V>) {\n this._unorderedItems().delete(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n}\n"],"names":["sortDirectives","a","b","element","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","Tree","_elementRef","inject","ElementRef","nativeElement","_popup","ComboboxPopup","optional","_unorderedItems","signal","Set","id","input","_IdGenerator","getId","orientation","multi","transform","booleanAttribute","disabled","selectionMode","focusMode","wrap","softDisabled","typeaheadDelay","values","model","textDirection","Directionality","valueSignal","nav","currentType","_pattern","_hasFocused","constructor","inputs","allItems","computed","sort","map","item","activeItem","undefined","combobox","ComboboxTreePattern","TreePattern","_controls","set","afterRenderEffect","setDefaultState","items","untracked","some","i","listBehavior","unfocus","v","value","filter","_onFocus","_register","child","add","_unregister","delete","scrollActiveItemIntoView","options","block","scrollIntoView","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","host","attributes","listeners","properties","exportAs","hostDirectives","directive","i1","ngImport","decorators","args","TreeItem","DeferredContentAware","_group","required","parent","selectable","expanded","label","ngDevMode","debugName","searchTerm","textContent","tree","ownedBy","active","level","selected","visible","_expanded","expandable","afterNextRender","preserveContent","contentVisible","ngOnInit","treePattern","parentPattern","TreeItemPattern","children","_childPatterns","hasChildren","ngOnDestroy","group","usesInheritance","TreeItemGroup","_deferredContent","DeferredContent","c","deferredContentAware","i2"],"mappings":";;;;;;;;;AA0CA,SAASA,cAAcA,CAACC,CAAa,EAAEC,CAAa,EAAA;EAClD,OAAO,CAACD,CAAC,CAACE,OAAO,CAACC,uBAAuB,CAACF,CAAC,CAACC,OAAO,CAAC,GAAGE,IAAI,CAACC,2BAA2B,IAAI,CAAA,GACvF,CAAA,GACA,CAAC,CAAC;AACR;MAqDaC,IAAI,CAAA;AAEEC,EAAAA,WAAW,GAAGC,MAAM,CAACC,UAAU,CAAC;AAGxCP,EAAAA,OAAO,GAAG,IAAI,CAACK,WAAW,CAACG,aAA4B;AAG/CC,EAAAA,MAAM,GAAGH,MAAM,CAAmBI,aAAa,EAAE;AAChEC,IAAAA,QAAQ,EAAE;AACX,GAAA,CAAC;EAGeC,eAAe,GAAGC,MAAM,CAAC,IAAIC,GAAG,EAAe;;WAAC;AAGxDC,EAAAA,EAAE,GAAGC,KAAK,CAACV,M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IAAAA,cAAA,EAAA,CAAA;MAAAC,SAAA,EAAA2C,EAAA,CAAAH;AAAA,KAAA,CAAA;AAAAtC,IAAAA,QAAA,EAAAnB;AAAA,GAAA,CAAA;;;;;;QAAbuD,aAAa;AAAAnC,EAAAA,UAAA,EAAA,CAAA;UALzBlB,SAAS;AAACmB,IAAAA,IAAA,EAAA,CAAA;AACTjB,MAAAA,QAAQ,EAAE,8BAA8B;AACxCW,MAAAA,QAAQ,EAAE,iBAAiB;MAC3BC,cAAc,EAAE,CAACyC,eAAe;KACjC;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"tree.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/tree/utils.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/tree/tree.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/tree/tree-item.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/tree/tree-item-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\nexport interface HasElement {\n element: HTMLElement;\n}\n\n/**\n * Sort directives by their document order.\n */\nexport function sortDirectives(a: HasElement, b: HasElement) {\n return (a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_PRECEDING) > 0\n ? 1\n : -1;\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 afterRenderEffect,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n signal,\n untracked,\n} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {ComboboxTreePattern, TreeItemPattern, TreePattern} from '@angular/aria/private';\nimport {ComboboxPopup} from '../combobox';\nimport type {TreeItem} from './tree-item';\nimport {sortDirectives} from './utils';\n\n/**\n * A container that transforms nested lists into an accessible, ARIA-compliant tree structure.\n * It manages the overall state of the tree, including selection, expansion, and keyboard\n * navigation.\n *\n * ```html\n * <ul ngTree [(value)]=\"selectedItems\" [multi]=\"true\">\n * <ng-template\n * [ngTemplateOutlet]=\"treeNodes\"\n * [ngTemplateOutletContext]=\"{nodes: treeData, parent: tree}\"\n * />\n * </ul>\n *\n * <ng-template #treeNodes let-nodes=\"nodes\" let-parent=\"parent\">\n * @for (node of nodes; track node.name) {\n * <li ngTreeItem [parent]=\"parent\" [value]=\"node.name\" [label]=\"node.name\">\n * {{ node.name }}\n * @if (node.children) {\n * <ul role=\"group\">\n * <ng-template ngTreeItemGroup [ownedBy]=\"treeItem\" #group=\"ngTreeItemGroup\">\n * <ng-template\n * [ngTemplateOutlet]=\"treeNodes\"\n * [ngTemplateOutletContext]=\"{nodes: node.children, parent: group}\"\n * />\n * </ng-template>\n * </ul>\n * }\n * </li>\n * }\n * </ng-template>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngTree]',\n exportAs: 'ngTree',\n host: {\n 'role': 'tree',\n '[attr.id]': 'id()',\n '[attr.aria-orientation]': '_pattern.orientation()',\n '[attr.aria-multiselectable]': '_pattern.multi()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-activedescendant]': '_pattern.activeDescendant()',\n '[tabindex]': '_pattern.tabIndex()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(pointerdown)': '_pattern.onPointerdown($event)',\n '(focusin)': '_onFocus()',\n },\n hostDirectives: [ComboboxPopup],\n})\nexport class Tree<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 /** A reference to the parent combobox popup, if one exists. */\n private readonly _popup = inject<ComboboxPopup<V>>(ComboboxPopup, {\n optional: true,\n });\n\n /** All TreeItem instances within this tree. */\n private readonly _unorderedItems = signal(new Set<TreeItem<V>>());\n\n /** A unique identifier for the tree. */\n readonly id = input(inject(_IdGenerator).getId('ng-tree-', true));\n\n /** Orientation of the tree. */\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /** Whether multi-selection is allowed. */\n readonly multi = input(false, {transform: booleanAttribute});\n\n /** Whether the tree is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /**\n * The selection strategy used by the tree.\n * - `explicit`: Items are selected explicitly by the user (e.g., via click or spacebar).\n * - `follow`: The focused item is automatically selected.\n */\n readonly selectionMode = input<'explicit' | 'follow'>('explicit');\n\n /**\n * The focus strategy used by the tree.\n * - `roving`: Focus is moved to the active item using `tabindex`.\n * - `activedescendant`: Focus remains on the tree container, and `aria-activedescendant` is used to indicate the active item.\n */\n readonly focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** Whether navigation wraps. */\n readonly wrap = input(true, {transform: booleanAttribute});\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 /** The delay in seconds before the typeahead search is reset. */\n readonly typeaheadDelay = input(500);\n\n /** The values of the currently selected items. */\n readonly values = model<V[]>([]);\n\n /** Text direction. */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** Whether the tree is in navigation mode. */\n readonly nav = input(false, {transform: booleanAttribute});\n\n /**\n * The `aria-current` type. It can be used in navigation trees to indicate the currently active item.\n * See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-current for more details.\n */\n readonly currentType = input<'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'>(\n 'page',\n );\n\n /** The UI pattern for the tree. */\n readonly _pattern: TreePattern<V>;\n\n /** Whether the tree has received focus since it was rendered. */\n private _hasFocused = signal(false);\n\n constructor() {\n const inputs = {\n ...this,\n id: this.id,\n allItems: computed(() =>\n [...this._unorderedItems()].sort(sortDirectives).map(item => item._pattern),\n ),\n activeItem: signal<TreeItemPattern<V> | undefined>(undefined),\n combobox: () => this._popup?.combobox?._pattern,\n element: () => this.element,\n };\n\n this._pattern = this._popup?.combobox\n ? new ComboboxTreePattern<V>(inputs)\n : new TreePattern<V>(inputs);\n\n if (this._popup?.combobox) {\n this._popup?._controls?.set(this._pattern as ComboboxTreePattern<V>);\n }\n\n afterRenderEffect(() => {\n if (!this._hasFocused()) {\n this._pattern.setDefaultState();\n }\n });\n\n afterRenderEffect(() => {\n const items = inputs.allItems();\n const activeItem = untracked(() => inputs.activeItem());\n\n if (!items.some(i => i === activeItem) && activeItem) {\n this._pattern.listBehavior.unfocus();\n }\n });\n\n afterRenderEffect(() => {\n if (!(this._pattern instanceof ComboboxTreePattern)) return;\n\n const items = inputs.allItems();\n const values = untracked(() => this.values());\n\n if (items && values.some(v => !items.some(i => i.value() === v))) {\n this.values.set(values.filter(v => items.some(i => i.value() === v)));\n }\n });\n }\n\n _onFocus() {\n this._hasFocused.set(true);\n }\n\n _register(child: TreeItem<V>) {\n this._unorderedItems().add(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n\n _unregister(child: TreeItem<V>) {\n this._unorderedItems().delete(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n\n scrollActiveItemIntoView(options: ScrollIntoViewOptions = {block: 'nearest'}) {\n this._pattern.inputs.activeItem()?.element()?.scrollIntoView(options);\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 afterRenderEffect,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n signal,\n Signal,\n OnInit,\n OnDestroy,\n afterNextRender,\n} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {ComboboxTreePattern, TreeItemPattern, DeferredContentAware} from '@angular/aria/private';\nimport {Tree} from './tree';\nimport {TreeItemGroup} from './tree-item-group';\nimport {HasElement} from './utils';\n\n/**\n * A selectable and expandable item in an `ngTree`.\n *\n * The `ngTreeItem` directive represents an individual node within an `ngTree`. It can be\n * selected, expanded (if it has children), and disabled. The `parent` input establishes\n * the hierarchical relationship within the tree.\n *\n * ```html\n * <li ngTreeItem [parent]=\"parentTreeOrGroup\" value=\"item-id\" label=\"Item Label\">\n * Item Label\n * </li>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngTreeItem]',\n exportAs: 'ngTreeItem',\n host: {\n '[attr.data-active]': 'active()',\n 'role': 'treeitem',\n '[id]': '_pattern.id()',\n '[attr.aria-expanded]': '_expanded()',\n '[attr.aria-selected]': 'selected()',\n '[attr.aria-current]': '_pattern.current()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-level]': 'level()',\n '[attr.aria-setsize]': '_pattern.setsize()',\n '[attr.aria-posinset]': '_pattern.posinset()',\n '[attr.tabindex]': '_pattern.tabIndex()',\n },\n})\nexport class TreeItem<V> extends DeferredContentAware implements OnInit, OnDestroy, HasElement {\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 owned tree item group. */\n private readonly _group = signal<TreeItemGroup<V> | undefined>(undefined);\n\n /** A unique identifier for the tree item. */\n readonly id = input(inject(_IdGenerator).getId('ng-tree-item-', true));\n\n /** The value of the tree item. */\n readonly value = input.required<V>();\n\n /** The parent tree root or tree item group. */\n readonly parent = input.required<Tree<V> | TreeItemGroup<V>>();\n\n /** Whether the tree item is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the tree item is selectable. */\n readonly selectable = input<boolean>(true);\n\n /** Whether the tree item is expanded. */\n readonly expanded = model<boolean>(false);\n\n /** Optional label for typeahead. Defaults to the element's textContent. */\n readonly label = input<string>();\n\n /** Search term for typeahead. */\n readonly searchTerm = computed(() => this.label() ?? this.element.textContent);\n\n /** The tree root. */\n readonly tree: Signal<Tree<V>> = computed(() => {\n if (this.parent() instanceof Tree) {\n return this.parent() as Tree<V>;\n }\n return (this.parent() as TreeItemGroup<V>).ownedBy().tree();\n });\n\n /** Whether the item is active. */\n readonly active = computed(() => this._pattern.active());\n\n /** The level of the current item in a tree. */\n readonly level = computed(() => this._pattern.level());\n\n /** Whether the item is selected. */\n readonly selected = computed(() => this._pattern.selected());\n\n /** Whether this item is visible due to all of its parents being expanded. */\n readonly visible = computed(() => this._pattern.visible());\n\n /** Whether the tree is expanded. Use this value for aria-expanded. */\n protected readonly _expanded: Signal<boolean | undefined> = computed(() =>\n this._pattern.expandable() ? this._pattern.expanded() : undefined,\n );\n\n /** The UI pattern for this item. */\n _pattern: TreeItemPattern<V>;\n\n constructor() {\n super();\n afterNextRender(() => {\n if (this.tree()._pattern instanceof ComboboxTreePattern) {\n this.preserveContent.set(true);\n }\n });\n // Connect the group's hidden state to the DeferredContentAware's visibility.\n afterRenderEffect(() => {\n this.tree()._pattern instanceof ComboboxTreePattern\n ? this.contentVisible.set(true)\n : this.contentVisible.set(this._pattern.expanded());\n });\n }\n\n ngOnInit() {\n this.parent()._register(this);\n this.tree()._register(this);\n\n const treePattern = computed(() => this.tree()._pattern);\n const parentPattern = computed(() => {\n if (this.parent() instanceof Tree) {\n return treePattern();\n }\n return (this.parent() as TreeItemGroup<V>).ownedBy()._pattern;\n });\n this._pattern = new TreeItemPattern<V>({\n ...this,\n tree: treePattern,\n parent: parentPattern,\n children: computed(() => this._group()?._childPatterns() ?? []),\n hasChildren: computed(() => !!this._group()),\n element: () => this.element,\n searchTerm: () => this.searchTerm() ?? '',\n });\n }\n\n ngOnDestroy() {\n this.parent()._unregister(this);\n this.tree()._unregister(this);\n }\n\n _register(group: TreeItemGroup<V>) {\n this._group.set(group);\n }\n\n _unregister() {\n this._group.set(undefined);\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 computed,\n inject,\n input,\n signal,\n OnInit,\n OnDestroy,\n} from '@angular/core';\nimport {TreeItemPattern, DeferredContent} from '@angular/aria/private';\nimport type {TreeItem} from './tree-item';\nimport {sortDirectives} from './utils';\n\n/**\n * Group that contains children tree items.\n *\n * The `ngTreeItemGroup` structural directive should be applied to an `ng-template` that\n * wraps the child `ngTreeItem` elements. It is used to define a group of children for an\n * expandable `ngTreeItem`. The `ownedBy` input links the group to its parent `ngTreeItem`.\n *\n * ```html\n * <li ngTreeItem [value]=\"'parent-id'\">\n * Parent Item\n * <ul role=\"group\">\n * <ng-template ngTreeItemGroup [ownedBy]=\"parentTreeItemRef\">\n * <li ngTreeItem [value]=\"'child-id'\">Child Item</li>\n * </ng-template>\n * </ul>\n * </li>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: 'ng-template[ngTreeItemGroup]',\n exportAs: 'ngTreeItemGroup',\n hostDirectives: [DeferredContent],\n})\nexport class TreeItemGroup<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 DeferredContent host directive. */\n private readonly _deferredContent = inject(DeferredContent);\n\n /** All groupable items that are descendants of the group. */\n private readonly _unorderedItems = signal(new Set<TreeItem<V>>());\n\n /** Child items within this group. */\n readonly _childPatterns = computed<TreeItemPattern<V>[]>(() =>\n [...this._unorderedItems()].sort(sortDirectives).map(c => c._pattern),\n );\n\n /** Tree item that owns the group. */\n readonly ownedBy = input.required<TreeItem<V>>();\n\n ngOnInit() {\n this._deferredContent.deferredContentAware.set(this.ownedBy());\n this.ownedBy()._register(this);\n }\n\n ngOnDestroy() {\n this.ownedBy()._unregister();\n }\n\n _register(child: TreeItem<V>) {\n this._unorderedItems().add(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n\n _unregister(child: TreeItem<V>) {\n this._unorderedItems().delete(child);\n this._unorderedItems.set(new Set(this._unorderedItems()));\n }\n}\n"],"names":["sortDirectives","a","b","element","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","Tree","_elementRef","inject","ElementRef","nativeElement","_popup","ComboboxPopup","optional","_unorderedItems","signal","Set","id","input","_IdGenerator","getId","orientation","multi","transform","booleanAttribute","disabled","selectionMode","focusMode","wrap","softDisabled","typeaheadDelay","values","model","textDirection","Directionality","valueSignal","nav","currentType","_pattern","_hasFocused","constructor","inputs","allItems","computed","sort","map","item","activeItem","undefined","combobox","ComboboxTreePattern","TreePattern","_controls","set","afterRenderEffect","setDefaultState","items","untracked","some","i","listBehavior","unfocus","v","value","filter","_onFocus","_register","child","add","_unregister","delete","scrollActiveItemIntoView","options","block","scrollIntoView","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","host","attributes","listeners","properties","exportAs","hostDirectives","directive","i1","ngImport","decorators","args","TreeItem","DeferredContentAware","_group","required","parent","selectable","expanded","label","ngDevMode","debugName","searchTerm","textContent","tree","ownedBy","active","level","selected","visible","_expanded","expandable","afterNextRender","preserveContent","contentVisible","ngOnInit","treePattern","parentPattern","TreeItemPattern","children","_childPatterns","hasChildren","ngOnDestroy","group","usesInheritance","TreeItemGroup","_deferredContent","DeferredContent","c","deferredContentAware"],"mappings":";;;;;;;;AAegB,SAAAA,cAAcA,CAACC,CAAa,EAAEC,CAAa,EAAA;EACzD,OAAO,CAACD,CAAC,CAACE,OAAO,CAACC,uBAAuB,CAACF,CAAC,CAACC,OAAO,CAAC,GAAGE,IAAI,CAACC,2BAA2B,IAAI,CAAA,GACvF,CAAA,GACA,CAAC,CAAC;AACR;;MC2DaC,IAAI,CAAA;AAEEC,EAAAA,WAAW,GAAGC,MAAM,CAACC,UAAU,CAAC;AAGxCP,EAAAA,OAAO,GAAG,IAAI,CAACK,WAAW,CA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,EAAA,CAAA;MAAAC,SAAA,EAAAC,EAAA,CAAAuC;AAAA,KAAA,CAAA;AAAAtC,IAAAA,QAAA,EAAAnB;AAAA,GAAA,CAAA;;;;;;QAAbuD,aAAa;AAAAnC,EAAAA,UAAA,EAAA,CAAA;UALzBlB,SAAS;AAACmB,IAAAA,IAAA,EAAA,CAAA;AACTjB,MAAAA,QAAQ,EAAE,8BAA8B;AACxCW,MAAAA,QAAQ,EAAE,iBAAiB;MAC3BC,cAAc,EAAE,CAACyC,eAAe;KACjC;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/aria",
3
- "version": "21.1.0-next.0",
3
+ "version": "21.1.0-next.2",
4
4
  "description": "Angular Aria",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "homepage": "https://github.com/angular/components#readme",
14
14
  "peerDependencies": {
15
- "@angular/cdk": "21.1.0-next.0",
15
+ "@angular/cdk": "21.1.0-next.2",
16
16
  "@angular/core": "^21.0.0-0 || ^21.1.0-0 || ^21.2.0-0 || ^21.3.0-0 || ^22.0.0-0"
17
17
  },
18
18
  "devDependencies": {
@@ -0,0 +1,98 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import * as _angular_cdk_bidi from '@angular/cdk/bidi';
3
+ import * as i1 from '@angular/aria/private';
4
+ import { ComboboxListboxControls, ComboboxTreeControls, ComboboxDialogPattern, ComboboxPattern } from '@angular/aria/private';
5
+
6
+ /**
7
+ * Identifies an element as a popup for an `ngCombobox`.
8
+ *
9
+ * This directive acts as a bridge, allowing the `ngCombobox` to discover and interact
10
+ * with the underlying control (e.g., `ngListbox`, `ngTree`, or `ngComboboxDialog`) that
11
+ * manages the options. It's primarily used as a host directive and is responsible for
12
+ * exposing the popup's control pattern to the parent combobox.
13
+ *
14
+ * @developerPreview 21.0
15
+ */
16
+ declare class ComboboxPopup<V> {
17
+ /** The combobox that the popup belongs to. */
18
+ readonly combobox: Combobox<V> | null;
19
+ /** The popup controls exposed to the combobox. */
20
+ readonly _controls: _angular_core.WritableSignal<ComboboxListboxControls<any, V> | ComboboxTreeControls<any, V> | ComboboxDialogPattern | undefined>;
21
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ComboboxPopup<any>, never>;
22
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxPopup<any>, "[ngComboboxPopup]", ["ngComboboxPopup"], {}, {}, never, never, true, never>;
23
+ }
24
+
25
+ /**
26
+ * The container element that wraps a combobox input and popup, and orchestrates its behavior.
27
+ *
28
+ * The `ngCombobox` directive is the main entry point for creating a combobox and customizing its
29
+ * behavior. It coordinates the interactions between the `ngComboboxInput` and the popup, which
30
+ * is defined by a `ng-template` with the `ngComboboxPopupContainer` directive. If using the
31
+ * `CdkOverlay`, the `cdkConnectedOverlay` directive takes the place of `ngComboboxPopupContainer`.
32
+ *
33
+ * ```html
34
+ * <div ngCombobox filterMode="highlight">
35
+ * <input
36
+ * ngComboboxInput
37
+ * placeholder="Search for a state..."
38
+ * [(value)]="searchString"
39
+ * />
40
+ *
41
+ * <ng-template ngComboboxPopupContainer>
42
+ * <div ngListbox [(value)]="selectedValue">
43
+ * @for (option of filteredOptions(); track option) {
44
+ * <div ngOption [value]="option" [label]="option">
45
+ * <span>{{option}}</span>
46
+ * </div>
47
+ * }
48
+ * </div>
49
+ * </ng-template>
50
+ * </div>
51
+ * ```
52
+ *
53
+ * @developerPreview 21.0
54
+ */
55
+ declare class Combobox<V> {
56
+ /** The directionality (LTR / RTL) context for the application (or a subtree of it). */
57
+ private readonly _directionality;
58
+ /** A signal wrapper for directionality. */
59
+ protected textDirection: _angular_core.Signal<_angular_cdk_bidi.Direction>;
60
+ /** The element that the combobox is attached to. */
61
+ private readonly _elementRef;
62
+ /** A reference to the combobox element. */
63
+ readonly element: HTMLElement;
64
+ /** The DeferredContentAware host directive. */
65
+ private readonly _deferredContentAware;
66
+ /** The combobox popup. */
67
+ readonly popup: _angular_core.Signal<ComboboxPopup<V> | undefined>;
68
+ /**
69
+ * The filter mode for the combobox.
70
+ * - `manual`: The consumer is responsible for filtering the options.
71
+ * - `auto-select`: The combobox automatically selects the first matching option.
72
+ * - `highlight`: The combobox highlights matching text in the options without changing selection.
73
+ */
74
+ filterMode: _angular_core.InputSignal<"manual" | "auto-select" | "highlight">;
75
+ /** Whether the combobox is disabled. */
76
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
77
+ /** Whether the combobox is read-only. */
78
+ readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
79
+ /** The value of the first matching item in the popup. */
80
+ readonly firstMatch: _angular_core.InputSignal<V | undefined>;
81
+ /** Whether the combobox is expanded. */
82
+ readonly expanded: _angular_core.Signal<boolean>;
83
+ /** Whether the combobox popup should always be expanded, regardless of user interaction. */
84
+ readonly alwaysExpanded: _angular_core.InputSignalWithTransform<boolean, unknown>;
85
+ /** Input element connected to the combobox, if any. */
86
+ readonly inputElement: _angular_core.Signal<HTMLInputElement | undefined>;
87
+ /** The combobox ui pattern. */
88
+ readonly _pattern: ComboboxPattern<any, V>;
89
+ constructor();
90
+ /** Opens the combobox to the selected item. */
91
+ open(): void;
92
+ /** Closes the combobox. */
93
+ close(): void;
94
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Combobox<any>, never>;
95
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Combobox<any>, "[ngCombobox]", ["ngCombobox"], { "filterMode": { "alias": "filterMode"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "firstMatch": { "alias": "firstMatch"; "required": false; "isSignal": true; }; "alwaysExpanded": { "alias": "alwaysExpanded"; "required": false; "isSignal": true; }; }, {}, ["popup"], never, true, [{ directive: typeof i1.DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
96
+ }
97
+
98
+ export { Combobox, ComboboxPopup };