@angular/aria 22.0.0-next.6 → 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 (105) hide show
  1. package/fesm2022/_accordion-chunk.mjs +1 -1
  2. package/fesm2022/_accordion-chunk.mjs.map +1 -1
  3. package/fesm2022/_click-event-manager-chunk.mjs +1 -1
  4. package/fesm2022/_click-event-manager-chunk.mjs.map +1 -1
  5. package/fesm2022/{_signal-like-chunk.mjs → _collection-chunk.mjs} +51 -3
  6. package/fesm2022/_collection-chunk.mjs.map +1 -0
  7. package/fesm2022/_deferred-content-chunk.mjs +16 -14
  8. package/fesm2022/_deferred-content-chunk.mjs.map +1 -1
  9. package/fesm2022/_expansion-chunk.mjs.map +1 -1
  10. package/fesm2022/_list-chunk.mjs +4 -1
  11. package/fesm2022/_list-chunk.mjs.map +1 -1
  12. package/fesm2022/_list-navigation-chunk.mjs +4 -2
  13. package/fesm2022/_list-navigation-chunk.mjs.map +1 -1
  14. package/fesm2022/_list-typeahead-chunk.mjs +1 -1
  15. package/fesm2022/_list-typeahead-chunk.mjs.map +1 -1
  16. package/fesm2022/_menu-chunk.mjs +1 -1
  17. package/fesm2022/_menu-chunk.mjs.map +1 -1
  18. package/fesm2022/{_combobox-listbox-chunk.mjs → _option-chunk.mjs} +6 -50
  19. package/fesm2022/_option-chunk.mjs.map +1 -0
  20. package/fesm2022/_tabs-chunk.mjs +22 -47
  21. package/fesm2022/_tabs-chunk.mjs.map +1 -1
  22. package/fesm2022/_toolbar-widget-group-chunk.mjs +1 -1
  23. package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
  24. package/fesm2022/_transforms-chunk.mjs +8 -0
  25. package/fesm2022/_transforms-chunk.mjs.map +1 -0
  26. package/fesm2022/{_combobox-tree-chunk.mjs → _tree-chunk.mjs} +3 -48
  27. package/fesm2022/_tree-chunk.mjs.map +1 -0
  28. package/fesm2022/_widget-chunk.mjs +84 -21
  29. package/fesm2022/_widget-chunk.mjs.map +1 -1
  30. package/fesm2022/accordion-testing.mjs.map +1 -1
  31. package/fesm2022/accordion.mjs +32 -57
  32. package/fesm2022/accordion.mjs.map +1 -1
  33. package/fesm2022/aria.mjs +1 -1
  34. package/fesm2022/aria.mjs.map +1 -1
  35. package/fesm2022/combobox-testing.mjs +79 -0
  36. package/fesm2022/combobox-testing.mjs.map +1 -0
  37. package/fesm2022/combobox.mjs +287 -296
  38. package/fesm2022/combobox.mjs.map +1 -1
  39. package/fesm2022/grid-testing.mjs +80 -0
  40. package/fesm2022/grid-testing.mjs.map +1 -0
  41. package/fesm2022/grid.mjs +113 -86
  42. package/fesm2022/grid.mjs.map +1 -1
  43. package/fesm2022/listbox-testing.mjs +4 -0
  44. package/fesm2022/listbox-testing.mjs.map +1 -1
  45. package/fesm2022/listbox.mjs +231 -225
  46. package/fesm2022/listbox.mjs.map +1 -1
  47. package/fesm2022/menu-testing.mjs +11 -0
  48. package/fesm2022/menu-testing.mjs.map +1 -1
  49. package/fesm2022/menu.mjs +66 -84
  50. package/fesm2022/menu.mjs.map +1 -1
  51. package/fesm2022/private.mjs +166 -9
  52. package/fesm2022/private.mjs.map +1 -1
  53. package/fesm2022/tabs-testing.mjs.map +1 -1
  54. package/fesm2022/tabs.mjs +241 -222
  55. package/fesm2022/tabs.mjs.map +1 -1
  56. package/fesm2022/toolbar-testing.mjs +5 -1
  57. package/fesm2022/toolbar-testing.mjs.map +1 -1
  58. package/fesm2022/toolbar.mjs +23 -33
  59. package/fesm2022/toolbar.mjs.map +1 -1
  60. package/fesm2022/tree-testing.mjs +12 -0
  61. package/fesm2022/tree-testing.mjs.map +1 -1
  62. package/fesm2022/tree.mjs +160 -156
  63. package/fesm2022/tree.mjs.map +1 -1
  64. package/package.json +10 -2
  65. package/types/_accordion-chunk.d.ts +2 -2
  66. package/types/_collection-chunk.d.ts +42 -0
  67. package/types/_expansion-chunk.d.ts +1 -1
  68. package/types/_grid-chunk.d.ts +23 -9
  69. package/types/_keyboard-event-manager-chunk.d.ts +1 -1
  70. package/types/_list-chunk.d.ts +1 -1
  71. package/types/_list-navigation-chunk.d.ts +1 -1
  72. package/types/_listbox-chunk.d.ts +1 -1
  73. package/types/_menu-chunk.d.ts +1 -1
  74. package/types/_tabs-chunk.d.ts +8 -43
  75. package/types/_toolbar-chunk.d.ts +1 -1
  76. package/types/_tree-chunk.d.ts +1 -1
  77. package/types/accordion.d.ts +7 -13
  78. package/types/combobox-testing.d.ts +63 -0
  79. package/types/combobox.d.ts +96 -192
  80. package/types/grid-testing.d.ts +83 -0
  81. package/types/grid.d.ts +102 -90
  82. package/types/listbox-testing.d.ts +25 -0
  83. package/types/listbox.d.ts +60 -63
  84. package/types/menu-testing.d.ts +6 -0
  85. package/types/menu.d.ts +24 -17
  86. package/types/private.d.ts +115 -133
  87. package/types/tabs.d.ts +26 -24
  88. package/types/toolbar-testing.d.ts +4 -0
  89. package/types/toolbar.d.ts +5 -6
  90. package/types/tree-testing.d.ts +8 -0
  91. package/types/tree.d.ts +11 -15
  92. package/fesm2022/_combobox-chunk.mjs +0 -429
  93. package/fesm2022/_combobox-chunk.mjs.map +0 -1
  94. package/fesm2022/_combobox-listbox-chunk.mjs.map +0 -1
  95. package/fesm2022/_combobox-tree-chunk.mjs.map +0 -1
  96. package/fesm2022/_element-chunk.mjs +0 -6
  97. package/fesm2022/_element-chunk.mjs.map +0 -1
  98. package/fesm2022/_pointer-event-manager-chunk.mjs +0 -54
  99. package/fesm2022/_pointer-event-manager-chunk.mjs.map +0 -1
  100. package/fesm2022/_signal-like-chunk.mjs.map +0 -1
  101. package/resources/code-examples.db +0 -0
  102. package/types/_combobox-chunk.d.ts +0 -194
  103. package/types/_element-chunk.d.ts +0 -10
  104. package/types/_pointer-event-manager-chunk.d.ts +0 -34
  105. package/types/_signal-like-chunk.d.ts +0 -14
@@ -1 +1 @@
1
- {"version":3,"file":"listbox.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/listbox/tokens.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/listbox/option.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/listbox/listbox.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 {InjectionToken} from '@angular/core';\nimport type {Listbox} from './listbox';\n\nexport const LISTBOX = new InjectionToken<Listbox<any>>('LISTBOX');\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 {booleanAttribute, computed, Directive, ElementRef, inject, input} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {OptionPattern} from '../private';\nimport {LISTBOX} from './tokens';\n\n/**\n * A selectable option in an `ngListbox`.\n *\n * This directive should be applied to an element (e.g., `<li>`, `<div>`) within an\n * `ngListbox`. The `value` input is used to identify the option, and the `label` input provides\n * the accessible name for the option.\n *\n * ```html\n * <li ngOption value=\"item-id\" label=\"Item Name\">\n * Item Name\n * </li>\n * ```\n *\n * @developerPreview 21.0\n *\n * @see [Listbox](guide/aria/listbox)\n * @see [Autocomplete](guide/aria/autocomplete)\n * @see [Select](guide/aria/select)\n * @see [Multiselect](guide/aria/multiselect)\n */\n@Directive({\n selector: '[ngOption]',\n exportAs: 'ngOption',\n host: {\n 'role': 'option',\n '[attr.data-active]': 'active()',\n '[attr.id]': '_pattern.id()',\n '[attr.tabindex]': '_pattern.tabIndex()',\n '[attr.aria-selected]': '_pattern.selected()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n },\n})\nexport class Option<V> {\n /** A reference to the host element. */\n readonly element = inject(ElementRef).nativeElement as HTMLElement;\n\n /** Whether the option is currently active (focused). */\n readonly active = computed(() => this._pattern.active());\n\n /** The parent Listbox. */\n private readonly _listbox = inject(LISTBOX);\n\n /** A unique identifier for the option. */\n readonly id = input(inject(_IdGenerator).getId('ng-option-', true));\n\n // TODO(wagnermaciel): See if we want to change how we handle this since textContent is not\n // reactive. See https://github.com/angular/components/pull/30495#discussion_r1961260216.\n /** The text used by the typeahead search. */\n protected readonly searchTerm = computed(() => this.label() ?? this.element.textContent);\n\n /** The parent Listbox UIPattern. */\n private readonly _listboxPattern = computed(() => this._listbox._pattern);\n\n /** The value of the option. */\n readonly value = input.required<V>();\n\n /** Whether an item is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** The text used by the typeahead search. */\n readonly label = input<string>();\n\n /** Whether the option is selected. */\n readonly selected = computed(() => this._pattern.selected());\n\n /** The Option UIPattern. */\n readonly _pattern = new OptionPattern<V>({\n ...this,\n id: this.id,\n value: this.value,\n listbox: this._listboxPattern,\n element: () => this.element,\n searchTerm: () => this.searchTerm() ?? '',\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 afterRenderEffect,\n booleanAttribute,\n computed,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n signal,\n untracked,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {ComboboxListboxPattern, ListboxPattern, OptionPattern} from '../private';\nimport {ComboboxPopup} from '../combobox';\nimport {Option} from './option';\nimport {LISTBOX} from './tokens';\n\n/**\n * Represents a container used to display a list of items for a user to select from.\n *\n * The `ngListbox` is meant to be used in conjunction with `ngOption` directives to create a\n * selectable list. It supports single and multiple selection modes, as well as various focus and\n * orientation strategies.\n *\n * ```html\n * <ul ngListbox [(value)]=\"selectedItems\" [multi]=\"true\" orientation=\"vertical\">\n * @for (item of items; track item.id) {\n * <li ngOption [value]=\"item.id\" [label]=\"item.name\" [disabled]=\"item.disabled\">\n * {{item.name}}\n * </li>\n * }\n * </ul>\n * ```\n *\n * @developerPreview 21.0\n *\n * @see [Listbox](guide/aria/listbox)\n * @see [Autocomplete](guide/aria/autocomplete)\n * @see [Select](guide/aria/select)\n * @see [Multiselect](guide/aria/multiselect)\n */\n@Directive({\n selector: '[ngListbox]',\n exportAs: 'ngListbox',\n host: {\n 'role': 'listbox',\n '[attr.id]': 'id()',\n '[attr.tabindex]': '_pattern.tabIndex()',\n '[attr.aria-readonly]': '_pattern.readonly()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-orientation]': '_pattern.orientation()',\n '[attr.aria-multiselectable]': '_pattern.multi()',\n '[attr.aria-activedescendant]': '_pattern.activeDescendant()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(click)': '_pattern.onClick($event)',\n '(focusin)': '_pattern.onFocusIn()',\n },\n hostDirectives: [ComboboxPopup],\n providers: [{provide: LISTBOX, useExisting: Listbox}],\n})\nexport class Listbox<V> {\n /** A unique identifier for the listbox. */\n readonly id = input(inject(_IdGenerator).getId('ng-listbox-', true));\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 /** 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 Options nested inside of the Listbox. */\n private readonly _options = contentChildren(Option, {descendants: true});\n\n /** A signal wrapper for directionality. */\n protected readonly textDirection = inject(Directionality).valueSignal.asReadonly();\n\n /** The Option UIPatterns of the child Options. */\n protected readonly items = computed<OptionPattern<V>[]>(() =>\n this._options().map(option => option._pattern),\n );\n\n /** Whether the list is vertically or horizontally oriented. */\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /** Whether multiple items in the list can be selected at once. */\n readonly multi = input(false, {transform: booleanAttribute});\n\n /** Whether focus should wrap when navigating. */\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 /**\n * The focus strategy used by the list.\n * - `roving`: Focus is moved to the active item using `tabindex`.\n * - `activedescendant`: Focus remains on the listbox container, and `aria-activedescendant` is used to indicate the active item.\n */\n readonly focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /**\n * The selection strategy used by the list.\n * - `follow`: The focused item is automatically selected.\n * - `explicit`: Items are selected explicitly by the user (e.g., via click or spacebar).\n */\n readonly selectionMode = input<'follow' | 'explicit'>('follow');\n\n /** The amount of time before the typeahead search is reset. */\n readonly typeaheadDelay = input<number>(500); // Picked arbitrarily.\n\n /** Whether the listbox is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the listbox is readonly. */\n readonly readonly = input(false, {transform: booleanAttribute});\n\n /** The values of the currently selected items. */\n readonly value = model<V[]>([]);\n\n /** The Listbox UIPattern. */\n readonly _pattern: ListboxPattern<V>;\n\n constructor() {\n const inputs = {\n ...this,\n id: this.id,\n items: this.items,\n activeItem: signal(undefined),\n textDirection: this.textDirection,\n element: () => this._elementRef.nativeElement,\n combobox: () => this._popup?.combobox?._pattern,\n };\n\n this._pattern = this._popup?.combobox\n ? new ComboboxListboxPattern<V>(inputs)\n : new ListboxPattern<V>(inputs);\n\n if (this._popup) {\n this._popup._controls.set(this._pattern as ComboboxListboxPattern<V>);\n }\n\n afterRenderEffect(() => {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const violations = this._pattern.validate();\n for (const violation of violations) {\n console.error(violation);\n }\n }\n });\n\n afterRenderEffect(() => {\n this._pattern.setDefaultStateEffect();\n });\n\n // Ensure that if the active item is removed from\n // the list, the listbox updates it's focus state.\n afterRenderEffect(() => {\n const items = inputs.items();\n const activeItem = untracked(() => inputs.activeItem());\n\n if (!items.some(i => i === activeItem) && activeItem) {\n this._pattern.listBehavior.unfocus();\n }\n });\n\n // Ensure that the value is always in sync with the available options.\n afterRenderEffect(() => {\n const items = inputs.items();\n const value = untracked(() => this.value());\n\n if (items && value.some(v => !items.some(i => i.value() === v))) {\n this.value.set(value.filter(v => items.some(i => i.value() === v)));\n }\n });\n }\n\n scrollActiveItemIntoView(options: ScrollIntoViewOptions = {block: 'nearest'}) {\n this._pattern.inputs.activeItem()?.element()?.scrollIntoView(options);\n }\n\n /** Navigates to the first item in the listbox. */\n gotoFirst() {\n this._pattern.listBehavior.first();\n }\n}\n"],"names":["LISTBOX","InjectionToken","Option","element","inject","ElementRef","nativeElement","active","computed","_pattern","_listbox","id","input","_IdGenerator","getId","searchTerm","label","textContent","_listboxPattern","value","required","disabled","transform","booleanAttribute","selected","OptionPattern","listbox","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","host","attributes","properties","exportAs","ngImport","decorators","args","Listbox","_popup","ComboboxPopup","optional","_elementRef","_options","contentChildren","descendants","textDirection","Directionality","valueSignal","asReadonly","items","map","option","orientation","multi","wrap","softDisabled","focusMode","selectionMode","typeaheadDelay","ngDevMode","debugName","readonly","model","constructor","activeItem","signal","undefined","combobox","ComboboxListboxPattern","ListboxPattern","_controls","set","afterRenderEffect","violations","validate","violation","console","error","setDefaultStateEffect","untracked","some","i","listBehavior","unfocus","v","filter","scrollActiveItemIntoView","options","block","scrollIntoView","gotoFirst","first","ɵdir","ɵɵngDeclareDirective","minVersion","version","type","outputs","listeners","providers","provide","useExisting","hostDirectives","directive","i1","ctorParameters","propDecorators","Input","alias","ContentChildren","forwardRef","Output"],"mappings":";;;;;;;;;;;;;;;;;AAWO,MAAMA,OAAO,GAAG,IAAIC,cAAc,CAAe,SAAS,CAAC;;MCkCrDC,MAAM,CAAA;AAERC,EAAAA,OAAO,GAAGC,MAAM,CAACC,UAAU,CAAC,CAACC,aAA4B;AAGzDC,EAAAA,MAAM,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACC,QAAQ,CAACF,MAAM,EAAE;;WAAC;AAGvCG,EAAAA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AA,IAAA;AAAAiF,QAAAA,KAAA,EAAA,OAAA;AAAAlG,QAAAA,QAAA,EAAA;OAAA;AAAA,KAAA,EAAA;MAAAsF,IAAA,EAAA7E,EAAA,CAAA4F,MAAA;MAAA3E,IAAA,EAAA,CAAA,aAAA;KAAA;AAAA;AAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"listbox.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/listbox/tokens.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/listbox/listbox.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/listbox/option.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InjectionToken} from '@angular/core';\nimport type {Listbox} from './listbox';\n\nexport const LISTBOX = new InjectionToken<Listbox<any>>('LISTBOX');\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 afterRenderEffect,\n afterNextRender,\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n OnDestroy,\n signal,\n Signal,\n untracked,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {ListboxPattern, SortedCollection, tabIndexTransform} from '../private';\nimport {Option} from './option';\nimport {LISTBOX} from './tokens';\n\n/**\n * Represents a container used to display a list of items for a user to select from.\n *\n * The `ngListbox` is meant to be used in conjunction with `ngOption` directives to create a\n * selectable list. It supports single and multiple selection modes, as well as various focus and\n * orientation strategies.\n *\n * ```html\n * <ul ngListbox [(value)]=\"selectedItems\" [multi]=\"true\" orientation=\"vertical\">\n * @for (item of items; track item.id) {\n * <li ngOption [value]=\"item.id\" [label]=\"item.name\" [disabled]=\"item.disabled\">\n * {{item.name}}\n * </li>\n * }\n * </ul>\n * ```\n *\n * @developerPreview 21.0\n *\n * @see [Listbox](guide/aria/listbox)\n * @see [Autocomplete](guide/aria/autocomplete)\n * @see [Select](guide/aria/select)\n * @see [Multiselect](guide/aria/multiselect)\n */\n@Directive({\n selector: '[ngListbox]',\n exportAs: 'ngListbox',\n host: {\n 'role': 'listbox',\n '[attr.id]': 'id()',\n '[attr.tabindex]': 'tabIndex() !== undefined ? tabIndex() : _pattern.tabIndex()',\n '[attr.aria-readonly]': '_pattern.readonly()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-orientation]': '_pattern.orientation()',\n '[attr.aria-multiselectable]': '_pattern.multi()',\n '[attr.aria-activedescendant]': '_pattern.activeDescendant()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(click)': '_pattern.onClick($event)',\n '(focusin)': '_pattern.onFocusIn()',\n },\n providers: [{provide: LISTBOX, useExisting: Listbox}],\n})\nexport class Listbox<V> implements OnDestroy {\n /** A unique identifier for the listbox. */\n readonly id = input(inject(_IdGenerator).getId('ng-listbox-', true));\n\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 Options. */\n readonly _collection = new SortedCollection<Option<V>>();\n\n /** A signal wrapper for directionality. */\n protected readonly textDirection = inject(Directionality).valueSignal.asReadonly();\n\n /** Whether the list is vertically or horizontally oriented. */\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /** Whether multiple items in the list can be selected at once. */\n readonly multi = input(false, {transform: booleanAttribute});\n\n /** Whether focus should wrap when navigating. */\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 /**\n * The focus strategy used by the list.\n * - `roving`: Focus is moved to the active item using `tabindex`.\n * - `activedescendant`: Focus remains on the listbox container, and `aria-activedescendant` is used to indicate the active item.\n */\n readonly focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /**\n * The selection strategy used by the list.\n * - `follow`: The focused item is automatically selected.\n * - `explicit`: Items are selected explicitly by the user (e.g., via click or spacebar).\n */\n readonly selectionMode = input<'follow' | 'explicit'>('follow');\n\n /** The amount of time before the typeahead search is reset. */\n readonly typeaheadDelay = input<number>(500); // Picked arbitrarily.\n\n /** Whether the listbox is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the listbox is readonly. */\n readonly readonly = input(false, {transform: booleanAttribute});\n\n /** The tabindex of the listbox. */\n readonly tabIndex = input(undefined, {\n alias: 'tabindex',\n transform: tabIndexTransform,\n });\n\n /** The values of the currently selected items. */\n readonly value = model<V[]>([]);\n\n /** The Listbox UIPattern. */\n readonly _pattern: ListboxPattern<V>;\n\n /** The ID of the active descendant in the listbox. */\n readonly activeDescendant: Signal<string | undefined>;\n\n constructor() {\n // Map directives to their patterns for the ListboxPattern\n const orderedItemPatterns = computed(() =>\n this._collection.orderedItems().map(option => option._pattern),\n );\n\n const inputs = {\n ...this,\n id: this.id,\n items: orderedItemPatterns,\n activeItem: signal(undefined),\n textDirection: this.textDirection,\n element: () => this._elementRef.nativeElement,\n };\n\n this._pattern = new ListboxPattern<V>(inputs);\n\n this.activeDescendant = computed(() => this._pattern.activeDescendant());\n\n afterNextRender(() => {\n this._collection.startObserving(this.element);\n });\n\n // Check for any violationns after the DOM has been updated.\n afterRenderEffect({\n read: () => {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const violations = this._pattern.validate();\n for (const violation of violations) {\n console.error(violation);\n }\n }\n },\n });\n\n afterRenderEffect({write: () => this._pattern.setDefaultStateEffect()});\n\n // Ensure that if the active item is removed from\n // the list, the listbox updates it's focus state.\n afterRenderEffect({\n write: () => {\n const items = inputs.items();\n const activeItem = untracked(() => inputs.activeItem());\n\n if (!items.some(i => i === activeItem) && activeItem) {\n this._pattern.listBehavior.unfocus();\n }\n },\n });\n\n // Ensure that the value is always in sync with the available options.\n // This needs to be after the render for the value to always be available.\n afterRenderEffect({\n write: () => {\n const items = inputs.items();\n const value = untracked(() => this.value());\n\n if (items && value.some(v => !items.some(i => i.value() === v))) {\n this.value.set(value.filter(v => items.some(i => i.value() === v)));\n }\n },\n });\n }\n\n ngOnDestroy() {\n this._collection.stopObserving();\n }\n\n scrollActiveItemIntoView(options: ScrollIntoViewOptions = {block: 'nearest'}) {\n this._pattern.inputs.activeItem()?.element()?.scrollIntoView(options);\n }\n\n /** Navigates to the first item in the listbox. */\n gotoFirst() {\n this._pattern.listBehavior.first();\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 booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n OnInit,\n OnDestroy,\n} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {OptionPattern} from '../private';\nimport {LISTBOX} from './tokens';\n\n/**\n * A selectable option in an `ngListbox`.\n *\n * This directive should be applied to an element (e.g., `<li>`, `<div>`) within an\n * `ngListbox`. The `value` input is used to identify the option, and the `label` input provides\n * the accessible name for the option.\n *\n * ```html\n * <li ngOption value=\"item-id\" label=\"Item Name\">\n * Item Name\n * </li>\n * ```\n *\n * @developerPreview 21.0\n *\n * @see [Listbox](guide/aria/listbox)\n * @see [Autocomplete](guide/aria/autocomplete)\n * @see [Select](guide/aria/select)\n * @see [Multiselect](guide/aria/multiselect)\n */\n@Directive({\n selector: '[ngOption]',\n exportAs: 'ngOption',\n host: {\n 'role': 'option',\n '[attr.data-active]': 'active()',\n '[attr.id]': '_pattern.id()',\n '[attr.tabindex]': '_pattern.tabIndex()',\n '[attr.aria-selected]': '_pattern.selected()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n },\n})\nexport class Option<V> implements OnInit, OnDestroy {\n /** A reference to the host element. */\n readonly element = inject(ElementRef).nativeElement as HTMLElement;\n\n /** Whether the option is currently active (focused). */\n readonly active = computed(() => this._pattern.active());\n\n /** The parent Listbox. */\n private readonly _listbox = inject(LISTBOX);\n\n /** A unique identifier for the option. */\n readonly id = input(inject(_IdGenerator).getId('ng-option-', true));\n\n /** The parent Listbox UIPattern. */\n private readonly _listboxPattern = computed(() => this._listbox._pattern);\n\n /** The value of the option. */\n readonly value = input.required<V>();\n\n /** Whether an item is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** The text used by the typeahead search. */\n readonly label = input<string>();\n\n /** Whether the option is selected. */\n readonly selected = computed(() => this._pattern.selected());\n\n /** The Option UIPattern. */\n readonly _pattern = new OptionPattern<V>({\n ...this,\n id: this.id,\n value: this.value,\n listbox: this._listboxPattern,\n element: () => this.element,\n searchTerm: () => this.label() ?? '',\n });\n\n ngOnInit() {\n this._listbox._collection.register(this);\n }\n\n ngOnDestroy() {\n this._listbox._collection.unregister(this);\n }\n}\n"],"names":["LISTBOX","InjectionToken","Listbox","id","input","inject","_IdGenerator","getId","_elementRef","ElementRef","element","nativeElement","_collection","SortedCollection","textDirection","Directionality","valueSignal","asReadonly","orientation","multi","transform","booleanAttribute","wrap","softDisabled","focusMode","selectionMode","typeaheadDelay","ngDevMode","debugName","disabled","readonly","tabIndex","undefined","alias","tabIndexTransform","value","model","_pattern","activeDescendant","constructor","orderedItemPatterns","computed","orderedItems","map","option","inputs","items","activeItem","signal","ListboxPattern","afterNextRender","startObserving","afterRenderEffect","read","violations","validate","violation","console","error","write","setDefaultStateEffect","untracked","some","i","listBehavior","unfocus","v","set","filter","ngOnDestroy","stopObserving","scrollActiveItemIntoView","options","block","scrollIntoView","gotoFirst","first","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","host","attributes","listeners","properties","providers","provide","useExisting","exportAs","ngImport","decorators","args","Option","active","_listbox","_listboxPattern","required","label","selected","OptionPattern","listbox","searchTerm","ngOnInit","register","unregister"],"mappings":";;;;;;;;;;;;;AAWO,MAAMA,OAAO,GAAG,IAAIC,cAAc,CAAe,SAAS,CAAC;;MC4DrDC,OAAO,CAAA;AAETC,EAAAA,EAAE,GAAGC,KAAK,CAACC,MAAM,CAACC,YAAY,CAAC,CAACC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC;;WAAC;AAGnDC,EAAAA,WAAW,GAAGH,MAAM,CAACI,UAAU,CAAC;AAGxCC,EAAAA,OAAO,GAAG,IAAI,CAACF,WAAW,CAACG,aAA4B;AAGvDC,EAAAA,WAAW,GAAG,IAAIC,gBAAgB,EAAa;EAGrCC,aAAa,GAAGT,MAAM,CAACU,cAAc,CAAC,CAACC,WAAW,CAACC,UAAU,EAAE;EAGzEC,WAAW,GAAGd,KAAK,CAA4B,UAAU;;WAAC;AAG1De,EAAAA,KAAK,GAAGf,KAAK,CAAC,KAAK;;;;AAAGgB,IAAAA,SAAS,EAAEC;AAAgB,GAAA,CAAE;AAGnDC,EAAAA,IAAI,GAAGlB,KAAK,CAAC,IAAI;;;;AAAGgB,IAAAA,SAAS,EAAEC;AAAgB,GAAA,CAAE;AAMjDE,EAAAA,YAAY,GAAGnB,KAAK,CAAC,IAAI;;;;AAAGgB,IAAAA,SAAS,EAAEC;AAAgB,GAAA,CAAE;EAOzDG,SAAS,GAAGpB,KAAK,CAAgC,QAAQ;;WAAC;EAO1DqB,aAAa,GAAGrB,KAAK,CAAwB,QAAQ;;WAAC;EAGtDsB,cAAc,GAAGtB,KAAK,CAAS,GAAG,EAAC,IAAAuB,SAAA,GAAA,CAAA;AAAAC,IAAAA,SAAA,EAAA;AAAA,GAAA,CAAA,GAAA,EAAA,CAAA,CAAA;AAGnCC,EAAAA,QAAQ,GAAGzB,KAAK,CAAC,KAAK;;;;AAAGgB,IAAAA,SAAS,EAAEC;AAAgB,GAAA,CAAE;AAGtDS,EAAAA,QAAQ,GAA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AE,YAAY;AACtBc,MAAAA,QAAQ,EAAE,UAAU;AACpBP,MAAAA,IAAI,EAAE;AACJ,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,oBAAoB,EAAE,UAAU;AAChC,QAAA,WAAW,EAAE,eAAe;AAC5B,QAAA,iBAAiB,EAAE,qBAAqB;AACxC,QAAA,sBAAsB,EAAE,qBAAqB;AAC7C,QAAA,sBAAsB,EAAE;AACzB;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -28,6 +28,13 @@ class MenuItemHarness extends ComponentHarness {
28
28
  }
29
29
  return null;
30
30
  }
31
+ async isFocused() {
32
+ return (await this.host()).isFocused();
33
+ }
34
+ async hasSubmenu() {
35
+ const host = await this.host();
36
+ return (await host.getAttribute('aria-haspopup')) === 'true' || !!(await host.getAttribute('aria-controls'));
37
+ }
31
38
  }
32
39
  class MenuHarness extends ComponentHarness {
33
40
  static hostSelector = '[ngMenu], [ngMenuBar]';
@@ -50,6 +57,10 @@ class MenuHarness extends ComponentHarness {
50
57
  }
51
58
  return (await host.getAttribute('data-visible')) === 'true';
52
59
  }
60
+ async isMenuBar() {
61
+ const host = await this.host();
62
+ return host.matchesSelector('[ngMenuBar]');
63
+ }
53
64
  async open() {
54
65
  if (!(await this.isOpen())) {
55
66
  const trigger = await this._getTrigger();
@@ -1 +1 @@
1
- {"version":3,"file":"menu-testing.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/menu/testing/menu-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 {ComponentHarness, HarnessPredicate, TestElement} from '@angular/cdk/testing';\nimport {MenuHarnessFilters, MenuItemHarnessFilters} from './menu-harness-filters';\n\n/** Harness for interacting with a standard ngMenuItem in tests. */\nexport class MenuItemHarness extends ComponentHarness {\n static hostSelector = '[ngMenuItem]';\n\n static with(options: MenuItemHarnessFilters = {}): HarnessPredicate<MenuItemHarness> {\n return new HarnessPredicate(MenuItemHarness, 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 }\n\n /** Gets the text content of the menu item. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Whether the menu item is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the menu item is expanded (contains an open submenu). */\n async isExpanded(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-expanded')) === 'true';\n }\n\n /** Clicks the menu item to trigger its action or toggle its submenu. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Resolves the nested submenu panel associated with this menu item, if any exists. */\n async getSubmenu(): Promise<MenuHarness | null> {\n const controlsId = await (await this.host()).getAttribute('aria-controls');\n if (controlsId) {\n return this.documentRootLocatorFactory().locatorFor(\n MenuHarness.with({selector: `#${controlsId}`}),\n )();\n }\n return null;\n }\n}\n\n/** Harness for interacting with a standard ngMenu or ngMenuBar in tests. */\nexport class MenuHarness extends ComponentHarness {\n static hostSelector = '[ngMenu], [ngMenuBar]';\n\n static with(options: MenuHarnessFilters = {}): HarnessPredicate<MenuHarness> {\n return new HarnessPredicate(MenuHarness, options).addOption(\n 'triggerText',\n options.triggerText,\n async (harness, text) => {\n const trigger = await harness._getTrigger();\n if (!trigger) return false;\n return HarnessPredicate.stringMatches(await trigger.text(), text);\n },\n );\n }\n\n /** Resolves the trigger associated with this menu container via aria-controls inversion. */\n async _getTrigger(): Promise<TestElement | null> {\n const id = await (await this.host()).getAttribute('id');\n if (!id) return null;\n return this.documentRootLocatorFactory().locatorForOptional(`[aria-controls=\"${id}\"]`)();\n }\n\n /** Checks whether the menu container is visible. */\n async isOpen(): Promise<boolean> {\n const host = await this.host();\n // Menu bars are always visible persistently.\n if (await host.matchesSelector('[ngMenuBar]')) {\n return true;\n }\n return (await host.getAttribute('data-visible')) === 'true';\n }\n\n /** Opens the menu if it is currently closed. */\n async open(): Promise<void> {\n if (!(await this.isOpen())) {\n const trigger = await this._getTrigger();\n if (trigger) {\n await trigger.click();\n }\n }\n }\n\n /** Closes the menu if it is currently open. */\n async close(): Promise<void> {\n if (await this.isOpen()) {\n const trigger = await this._getTrigger();\n if (trigger) {\n await trigger.click();\n }\n }\n }\n\n /** Queries all menu items inside this menu container. */\n async getItems(filters: MenuItemHarnessFilters = {}): Promise<MenuItemHarness[]> {\n return this.locatorForAll(MenuItemHarness.with(filters))();\n }\n}\n"],"names":["MenuItemHarness","ComponentHarness","hostSelector","with","options","HarnessPredicate","addOption","text","harness","stringMatches","getText","disabled","isDisabled","expanded","isExpanded","host","getAttribute","click","getSubmenu","controlsId","documentRootLocatorFactory","locatorFor","MenuHarness","selector","triggerText","trigger","_getTrigger","id","locatorForOptional","isOpen","matchesSelector","open","close","getItems","filters","locatorForAll"],"mappings":";;AAYM,MAAOA,eAAgB,SAAQC,gBAAgB,CAAA;EACnD,OAAOC,YAAY,GAAG,cAAc;AAEpC,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,MAA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,EAAA;EAGA,MAAMe,KAAKA,GAAA;AACT,IAAA,IAAI,MAAM,IAAI,CAACH,MAAM,EAAE,EAAE;AACvB,MAAA,MAAMJ,OAAO,GAAG,MAAM,IAAI,CAACC,WAAW,EAAE;AACxC,MAAA,IAAID,OAAO,EAAE;AACX,QAAA,MAAMA,OAAO,CAACR,KAAK,EAAE;AACvB,MAAA;AACF,IAAA;AACF,EAAA;AAGA,EAAA,MAAMgB,QAAQA,CAACC,OAAA,GAAkC,EAAE,EAAA;AACjD,IAAA,OAAO,IAAI,CAACC,aAAa,CAACnC,eAAe,CAACG,IAAI,CAAC+B,OAAO,CAAC,CAAC,EAAE;AAC5D,EAAA;;;;;"}
1
+ {"version":3,"file":"menu-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/menu/testing/menu-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 {ComponentHarness, HarnessPredicate, TestElement} from '@angular/cdk/testing';\nimport {MenuHarnessFilters, MenuItemHarnessFilters} from './menu-harness-filters';\n\n/** Harness for interacting with a standard ngMenuItem in tests. */\nexport class MenuItemHarness extends ComponentHarness {\n static hostSelector = '[ngMenuItem]';\n\n static with(options: MenuItemHarnessFilters = {}): HarnessPredicate<MenuItemHarness> {\n return new HarnessPredicate(MenuItemHarness, 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 }\n\n /** Gets the text content of the menu item. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Whether the menu item is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the menu item is expanded (contains an open submenu). */\n async isExpanded(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-expanded')) === 'true';\n }\n\n /** Clicks the menu item to trigger its action or toggle its submenu. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Resolves the nested submenu panel associated with this menu item, if any exists. */\n async getSubmenu(): Promise<MenuHarness | null> {\n const controlsId = await (await this.host()).getAttribute('aria-controls');\n if (controlsId) {\n return this.documentRootLocatorFactory().locatorFor(\n MenuHarness.with({selector: `#${controlsId}`}),\n )();\n }\n return null;\n }\n\n /** Whether the menu item has focus. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** Whether the menu item acts as a submenu trigger. */\n async hasSubmenu(): Promise<boolean> {\n const host = await this.host();\n return (\n (await host.getAttribute('aria-haspopup')) === 'true' ||\n !!(await host.getAttribute('aria-controls'))\n );\n }\n}\n\n/** Harness for interacting with a standard ngMenu or ngMenuBar in tests. */\nexport class MenuHarness extends ComponentHarness {\n static hostSelector = '[ngMenu], [ngMenuBar]';\n\n static with(options: MenuHarnessFilters = {}): HarnessPredicate<MenuHarness> {\n return new HarnessPredicate(MenuHarness, options).addOption(\n 'triggerText',\n options.triggerText,\n async (harness, text) => {\n const trigger = await harness._getTrigger();\n if (!trigger) return false;\n return HarnessPredicate.stringMatches(await trigger.text(), text);\n },\n );\n }\n\n /** Resolves the trigger associated with this menu container via aria-controls inversion. */\n async _getTrigger(): Promise<TestElement | null> {\n const id = await (await this.host()).getAttribute('id');\n if (!id) return null;\n return this.documentRootLocatorFactory().locatorForOptional(`[aria-controls=\"${id}\"]`)();\n }\n\n /** Checks whether the menu container is visible. */\n async isOpen(): Promise<boolean> {\n const host = await this.host();\n // Menu bars are always visible persistently.\n if (await host.matchesSelector('[ngMenuBar]')) {\n return true;\n }\n return (await host.getAttribute('data-visible')) === 'true';\n }\n\n /** Whether the menu is a menu bar. */\n async isMenuBar(): Promise<boolean> {\n const host = await this.host();\n return host.matchesSelector('[ngMenuBar]');\n }\n\n /** Opens the menu if it is currently closed. */\n async open(): Promise<void> {\n if (!(await this.isOpen())) {\n const trigger = await this._getTrigger();\n if (trigger) {\n await trigger.click();\n }\n }\n }\n\n /** Closes the menu if it is currently open. */\n async close(): Promise<void> {\n if (await this.isOpen()) {\n const trigger = await this._getTrigger();\n if (trigger) {\n await trigger.click();\n }\n }\n }\n\n /** Queries all menu items inside this menu container. */\n async getItems(filters: MenuItemHarnessFilters = {}): Promise<MenuItemHarness[]> {\n return this.locatorForAll(MenuItemHarness.with(filters))();\n }\n}\n"],"names":["MenuItemHarness","ComponentHarness","hostSelector","with","options","HarnessPredicate","addOption","text","harness","stringMatches","getText","disabled","isDisabled","expanded","isExpanded","host","getAttribute","click","getSubmenu","controlsId","documentRootLocatorFactory","locatorFor","MenuHarness","selector","isFocused","hasSubmenu","triggerText","trigger","_getTrigger","id","locatorForOptional","isOpen","matchesSelector","isMenuBar","open","close","getItems","filters","locatorForAll"],"mappings":";;AAYM,MAAOA,eAAgB,SAAQC,gBAAgB,CAAA;EACnD,OAAOC,YAAY,GAAG,cAAc;AAEpC,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,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A;EAGA,MAAMiB,SAASA,GAAA;AACb,IAAA,MAAMlB,IAAI,GAAG,MAAM,IAAI,CAACA,IAAI,EAAE;AAC9B,IAAA,OAAOA,IAAI,CAACiB,eAAe,CAAC,aAAa,CAAC;AAC5C,EAAA;EAGA,MAAME,IAAIA,GAAA;IACR,IAAI,EAAE,MAAM,IAAI,CAACH,MAAM,EAAE,CAAC,EAAE;AAC1B,MAAA,MAAMJ,OAAO,GAAG,MAAM,IAAI,CAACC,WAAW,EAAE;AACxC,MAAA,IAAID,OAAO,EAAE;AACX,QAAA,MAAMA,OAAO,CAACV,KAAK,EAAE;AACvB,MAAA;AACF,IAAA;AACF,EAAA;EAGA,MAAMkB,KAAKA,GAAA;AACT,IAAA,IAAI,MAAM,IAAI,CAACJ,MAAM,EAAE,EAAE;AACvB,MAAA,MAAMJ,OAAO,GAAG,MAAM,IAAI,CAACC,WAAW,EAAE;AACxC,MAAA,IAAID,OAAO,EAAE;AACX,QAAA,MAAMA,OAAO,CAACV,KAAK,EAAE;AACvB,MAAA;AACF,IAAA;AACF,EAAA;AAGA,EAAA,MAAMmB,QAAQA,CAACC,OAAA,GAAkC,EAAE,EAAA;AACjD,IAAA,OAAO,IAAI,CAACC,aAAa,CAACtC,eAAe,CAACG,IAAI,CAACkC,OAAO,CAAC,CAAC,EAAE;AAC5D,EAAA;;;;;"}
package/fesm2022/menu.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, input, computed, booleanAttribute, effect, Directive, InjectionToken, model, contentChildren, signal, output, afterRenderEffect, untracked } from '@angular/core';
2
+ import { inject, ElementRef, input, computed, booleanAttribute, effect, Directive, InjectionToken, model, output, signal, afterRenderEffect, afterNextRender, untracked } from '@angular/core';
3
3
  import { _IdGenerator } from '@angular/cdk/a11y';
4
4
  import { Directionality } from '@angular/cdk/bidi';
5
5
  import { MenuTriggerPattern, MenuItemPattern, MenuBarPattern, MenuPattern } from './_menu-chunk.mjs';
6
+ import { SortedCollection } from './_collection-chunk.mjs';
6
7
  import { DeferredContentAware, DeferredContent } from './_deferred-content-chunk.mjs';
7
- import './_signal-like-chunk.mjs';
8
- import '@angular/core/primitives/signals';
9
8
  import './_list-chunk.mjs';
10
9
  import './_list-navigation-chunk.mjs';
11
10
  import './_list-typeahead-chunk.mjs';
11
+ import '@angular/core/primitives/signals';
12
12
 
13
13
  class MenuTrigger {
14
14
  _elementRef = inject(ElementRef);
@@ -54,7 +54,7 @@ class MenuTrigger {
54
54
  }
55
55
  static ɵfac = i0.ɵɵngDeclareFactory({
56
56
  minVersion: "12.0.0",
57
- version: "22.0.0-next.6",
57
+ version: "22.0.0-next.10",
58
58
  ngImport: i0,
59
59
  type: MenuTrigger,
60
60
  deps: [],
@@ -62,7 +62,7 @@ class MenuTrigger {
62
62
  });
63
63
  static ɵdir = i0.ɵɵngDeclareDirective({
64
64
  minVersion: "17.1.0",
65
- version: "22.0.0-next.6",
65
+ version: "22.0.0-next.10",
66
66
  type: MenuTrigger,
67
67
  isStandalone: true,
68
68
  selector: "[ngMenuTrigger]",
@@ -111,7 +111,7 @@ class MenuTrigger {
111
111
  }
112
112
  i0.ɵɵngDeclareClassMetadata({
113
113
  minVersion: "12.0.0",
114
- version: "22.0.0-next.6",
114
+ version: "22.0.0-next.10",
115
115
  ngImport: i0,
116
116
  type: MenuTrigger,
117
117
  decorators: [{
@@ -206,6 +206,12 @@ class MenuItem {
206
206
  constructor() {
207
207
  effect(() => this.submenu()?.parent.set(this));
208
208
  }
209
+ ngOnInit() {
210
+ this.parent?._collection.register(this);
211
+ }
212
+ ngOnDestroy() {
213
+ this.parent?._collection.unregister(this);
214
+ }
209
215
  open() {
210
216
  this._pattern.open({
211
217
  first: true
@@ -216,7 +222,7 @@ class MenuItem {
216
222
  }
217
223
  static ɵfac = i0.ɵɵngDeclareFactory({
218
224
  minVersion: "12.0.0",
219
- version: "22.0.0-next.6",
225
+ version: "22.0.0-next.10",
220
226
  ngImport: i0,
221
227
  type: MenuItem,
222
228
  deps: [],
@@ -224,7 +230,7 @@ class MenuItem {
224
230
  });
225
231
  static ɵdir = i0.ɵɵngDeclareDirective({
226
232
  minVersion: "17.1.0",
227
- version: "22.0.0-next.6",
233
+ version: "22.0.0-next.10",
228
234
  type: MenuItem,
229
235
  isStandalone: true,
230
236
  selector: "[ngMenuItem]",
@@ -278,7 +284,6 @@ class MenuItem {
278
284
  properties: {
279
285
  "attr.tabindex": "_pattern.tabIndex()",
280
286
  "attr.data-active": "active()",
281
- "attr.aria-label": "value()",
282
287
  "attr.aria-haspopup": "hasPopup()",
283
288
  "attr.aria-expanded": "expanded()",
284
289
  "attr.aria-disabled": "_pattern.disabled()",
@@ -291,7 +296,7 @@ class MenuItem {
291
296
  }
292
297
  i0.ɵɵngDeclareClassMetadata({
293
298
  minVersion: "12.0.0",
294
- version: "22.0.0-next.6",
299
+ version: "22.0.0-next.10",
295
300
  ngImport: i0,
296
301
  type: MenuItem,
297
302
  decorators: [{
@@ -304,7 +309,6 @@ i0.ɵɵngDeclareClassMetadata({
304
309
  '(focusin)': '_pattern.onFocusIn()',
305
310
  '[attr.tabindex]': '_pattern.tabIndex()',
306
311
  '[attr.data-active]': 'active()',
307
- '[attr.aria-label]': 'value()',
308
312
  '[attr.aria-haspopup]': 'hasPopup()',
309
313
  '[attr.aria-expanded]': 'expanded()',
310
314
  '[attr.aria-disabled]': '_pattern.disabled()',
@@ -361,13 +365,8 @@ i0.ɵɵngDeclareClassMetadata({
361
365
  });
362
366
 
363
367
  class MenuBar {
364
- _allItems = contentChildren(MenuItem, {
365
- ...(ngDevMode ? {
366
- debugName: "_allItems"
367
- } : {}),
368
- descendants: true
369
- });
370
- _items = () => this._allItems().filter(i => i.parent === this);
368
+ _collection = new SortedCollection();
369
+ _items = () => this._collection.orderedItems().filter(i => i.parent === this);
371
370
  _elementRef = inject(ElementRef);
372
371
  element = this._elementRef.nativeElement;
373
372
  disabled = input(false, {
@@ -396,7 +395,7 @@ class MenuBar {
396
395
  debugName: "typeaheadDelay"
397
396
  }] : []));
398
397
  _pattern;
399
- _itemPatterns = signal([], ...(ngDevMode ? [{
398
+ _itemPatterns = computed(() => this._items().map(i => i._pattern), ...(ngDevMode ? [{
400
399
  debugName: "_itemPatterns"
401
400
  }] : []));
402
401
  itemSelected = output();
@@ -413,27 +412,30 @@ class MenuBar {
413
412
  activeItem: signal(undefined),
414
413
  element: computed(() => this._elementRef.nativeElement)
415
414
  });
416
- afterRenderEffect(() => {
417
- this._itemPatterns.set(this._items().map(i => i._pattern));
415
+ afterRenderEffect({
416
+ write: () => this._pattern.setDefaultStateEffect()
418
417
  });
419
- afterRenderEffect(() => {
420
- this._pattern.setDefaultStateEffect();
418
+ afterNextRender(() => {
419
+ this._collection.startObserving(this.element);
421
420
  });
422
421
  }
422
+ ngOnDestroy() {
423
+ this._collection.stopObserving();
424
+ }
423
425
  close() {
424
426
  this._pattern.close();
425
427
  }
426
428
  static ɵfac = i0.ɵɵngDeclareFactory({
427
429
  minVersion: "12.0.0",
428
- version: "22.0.0-next.6",
430
+ version: "22.0.0-next.10",
429
431
  ngImport: i0,
430
432
  type: MenuBar,
431
433
  deps: [],
432
434
  target: i0.ɵɵFactoryTarget.Directive
433
435
  });
434
436
  static ɵdir = i0.ɵɵngDeclareDirective({
435
- minVersion: "17.2.0",
436
- version: "22.0.0-next.6",
437
+ minVersion: "17.1.0",
438
+ version: "22.0.0-next.10",
437
439
  type: MenuBar,
438
440
  isStandalone: true,
439
441
  selector: "[ngMenuBar]",
@@ -499,19 +501,13 @@ class MenuBar {
499
501
  provide: MENU_COMPONENT,
500
502
  useExisting: MenuBar
501
503
  }],
502
- queries: [{
503
- propertyName: "_allItems",
504
- predicate: MenuItem,
505
- descendants: true,
506
- isSignal: true
507
- }],
508
504
  exportAs: ["ngMenuBar"],
509
505
  ngImport: i0
510
506
  });
511
507
  }
512
508
  i0.ɵɵngDeclareClassMetadata({
513
509
  minVersion: "12.0.0",
514
- version: "22.0.0-next.6",
510
+ version: "22.0.0-next.10",
515
511
  ngImport: i0,
516
512
  type: MenuBar,
517
513
  decorators: [{
@@ -538,15 +534,6 @@ i0.ɵɵngDeclareClassMetadata({
538
534
  }],
539
535
  ctorParameters: () => [],
540
536
  propDecorators: {
541
- _allItems: [{
542
- type: i0.ContentChildren,
543
- args: [i0.forwardRef(() => MenuItem), {
544
- ...{
545
- descendants: true
546
- },
547
- isSignal: true
548
- }]
549
- }],
550
537
  disabled: [{
551
538
  type: i0.Input,
552
539
  args: [{
@@ -601,13 +588,8 @@ class Menu {
601
588
  _deferredContentAware = inject(DeferredContentAware, {
602
589
  optional: true
603
590
  });
604
- _allItems = contentChildren(MenuItem, {
605
- ...(ngDevMode ? {
606
- debugName: "_allItems"
607
- } : {}),
608
- descendants: true
609
- });
610
- _items = computed(() => this._allItems().filter(i => i.parent === this), ...(ngDevMode ? [{
591
+ _collection = new SortedCollection();
592
+ _items = computed(() => this._collection.orderedItems().filter(i => i.parent === this), ...(ngDevMode ? [{
611
593
  debugName: "_items"
612
594
  }] : []));
613
595
  _elementRef = inject(ElementRef);
@@ -635,7 +617,12 @@ class Menu {
635
617
  debugName: "parent"
636
618
  }] : []));
637
619
  _pattern;
638
- _itemPatterns = () => this._items().map(i => i._pattern);
620
+ _itemPatterns = computed(() => {
621
+ this._pattern.visible();
622
+ return this._items().map(i => i._pattern);
623
+ }, ...(ngDevMode ? [{
624
+ debugName: "_itemPatterns"
625
+ }] : []));
639
626
  visible = computed(() => this._pattern.visible(), ...(ngDevMode ? [{
640
627
  debugName: "visible"
641
628
  }] : []));
@@ -660,38 +647,48 @@ class Menu {
660
647
  element: computed(() => this._elementRef.nativeElement),
661
648
  itemSelected: value => this.itemSelected.emit(value)
662
649
  });
663
- afterRenderEffect(() => {
664
- const parent = this.parent();
665
- if (parent instanceof MenuItem && parent.parent instanceof MenuBar) {
666
- this._deferredContentAware?.contentVisible.set(true);
667
- } else {
668
- this._deferredContentAware?.contentVisible.set(this._pattern.visible() || !!this.parent()?._pattern.hasBeenInteracted());
650
+ afterRenderEffect({
651
+ write: () => {
652
+ const parent = this.parent();
653
+ if (parent instanceof MenuItem && parent.parent instanceof MenuBar) {
654
+ this._deferredContentAware?.contentVisible.set(true);
655
+ } else {
656
+ this._deferredContentAware?.contentVisible.set(this._pattern.visible() || !!this.parent()?._pattern.hasBeenInteracted());
657
+ }
669
658
  }
670
659
  });
671
- afterRenderEffect(() => {
672
- if (this._pattern.visible()) {
673
- const activeItem = untracked(() => this._pattern.inputs.activeItem());
674
- this._pattern.listBehavior.goto(activeItem);
660
+ afterRenderEffect({
661
+ write: () => {
662
+ if (this.visible()) {
663
+ const activeItem = untracked(() => this._pattern.inputs.activeItem());
664
+ this._pattern.listBehavior.goto(activeItem);
665
+ }
675
666
  }
676
667
  });
677
- afterRenderEffect(() => {
678
- this._pattern.setDefaultStateEffect();
668
+ afterRenderEffect({
669
+ write: () => this._pattern.setDefaultStateEffect()
670
+ });
671
+ afterNextRender(() => {
672
+ this._collection.startObserving(this.element);
679
673
  });
680
674
  }
675
+ ngOnDestroy() {
676
+ this._collection.stopObserving();
677
+ }
681
678
  close() {
682
679
  this._pattern.close();
683
680
  }
684
681
  static ɵfac = i0.ɵɵngDeclareFactory({
685
682
  minVersion: "12.0.0",
686
- version: "22.0.0-next.6",
683
+ version: "22.0.0-next.10",
687
684
  ngImport: i0,
688
685
  type: Menu,
689
686
  deps: [],
690
687
  target: i0.ɵɵFactoryTarget.Directive
691
688
  });
692
689
  static ɵdir = i0.ɵɵngDeclareDirective({
693
- minVersion: "17.2.0",
694
- version: "22.0.0-next.6",
690
+ minVersion: "17.1.0",
691
+ version: "22.0.0-next.10",
695
692
  type: Menu,
696
693
  isStandalone: true,
697
694
  selector: "[ngMenu]",
@@ -758,12 +755,6 @@ class Menu {
758
755
  provide: MENU_COMPONENT,
759
756
  useExisting: Menu
760
757
  }],
761
- queries: [{
762
- propertyName: "_allItems",
763
- predicate: MenuItem,
764
- descendants: true,
765
- isSignal: true
766
- }],
767
758
  exportAs: ["ngMenu"],
768
759
  hostDirectives: [{
769
760
  directive: DeferredContentAware,
@@ -774,7 +765,7 @@ class Menu {
774
765
  }
775
766
  i0.ɵɵngDeclareClassMetadata({
776
767
  minVersion: "12.0.0",
777
- version: "22.0.0-next.6",
768
+ version: "22.0.0-next.10",
778
769
  ngImport: i0,
779
770
  type: Menu,
780
771
  decorators: [{
@@ -807,15 +798,6 @@ i0.ɵɵngDeclareClassMetadata({
807
798
  }],
808
799
  ctorParameters: () => [],
809
800
  propDecorators: {
810
- _allItems: [{
811
- type: i0.ContentChildren,
812
- args: [i0.forwardRef(() => MenuItem), {
813
- ...{
814
- descendants: true
815
- },
816
- isSignal: true
817
- }]
818
- }],
819
801
  id: [{
820
802
  type: i0.Input,
821
803
  args: [{
@@ -866,7 +848,7 @@ i0.ɵɵngDeclareClassMetadata({
866
848
  class MenuContent {
867
849
  static ɵfac = i0.ɵɵngDeclareFactory({
868
850
  minVersion: "12.0.0",
869
- version: "22.0.0-next.6",
851
+ version: "22.0.0-next.10",
870
852
  ngImport: i0,
871
853
  type: MenuContent,
872
854
  deps: [],
@@ -874,7 +856,7 @@ class MenuContent {
874
856
  });
875
857
  static ɵdir = i0.ɵɵngDeclareDirective({
876
858
  minVersion: "14.0.0",
877
- version: "22.0.0-next.6",
859
+ version: "22.0.0-next.10",
878
860
  type: MenuContent,
879
861
  isStandalone: true,
880
862
  selector: "ng-template[ngMenuContent]",
@@ -887,7 +869,7 @@ class MenuContent {
887
869
  }
888
870
  i0.ɵɵngDeclareClassMetadata({
889
871
  minVersion: "12.0.0",
890
- version: "22.0.0-next.6",
872
+ version: "22.0.0-next.10",
891
873
  ngImport: i0,
892
874
  type: MenuContent,
893
875
  decorators: [{