@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":"combobox.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/combobox/combobox-tokens.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/combobox/combobox-popup.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/combobox/combobox.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/combobox/combobox-dialog.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/combobox/combobox-input.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/combobox/combobox-popup-container.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 {Combobox} from './combobox';\n\n/** Token used to provide the combobox to child components. */\nexport const COMBOBOX = new InjectionToken<Combobox<unknown>>('COMBOBOX');\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 {Directive, inject, signal} from '@angular/core';\nimport {ComboboxListboxControls, ComboboxTreeControls, ComboboxDialogPattern} from '../private';\nimport type {Combobox} from './combobox';\nimport {COMBOBOX} from './combobox-tokens';\n\n/**\n * Identifies an element as a popup for an `ngCombobox`.\n *\n * This directive acts as a bridge, allowing the `ngCombobox` to discover and interact\n * with the underlying control (e.g., `ngListbox`, `ngTree`, or `ngComboboxDialog`) that\n * manages the options. It's primarily used as a host directive and is responsible for\n * exposing the popup's control pattern to the parent combobox.\n *\n * @developerPreview 21.0\n *\n * @see [Combobox](guide/aria/combobox)\n * @see [Select](guide/aria/select)\n * @see [Multiselect](guide/aria/multiselect)\n * @see [Autocomplete](guide/aria/autocomplete)\n */\n@Directive({\n selector: '[ngComboboxPopup]',\n exportAs: 'ngComboboxPopup',\n})\nexport class ComboboxPopup<V> {\n /** The combobox that the popup belongs to. */\n readonly combobox = inject<Combobox<V>>(COMBOBOX, {optional: true});\n\n /** The popup controls exposed to the combobox. */\n readonly _controls = signal<\n | ComboboxListboxControls<any, V>\n | ComboboxTreeControls<any, V>\n | ComboboxDialogPattern\n | undefined\n >(undefined);\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 contentChild,\n Directive,\n ElementRef,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport {DeferredContentAware, ComboboxPattern} from '../private';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {COMBOBOX} from './combobox-tokens';\nimport {ComboboxPopup} from './combobox-popup';\n\n/**\n * The container element that wraps a combobox input and popup, and orchestrates its behavior.\n *\n * The `ngCombobox` directive is the main entry point for creating a combobox and customizing its\n * behavior. It coordinates the interactions between the `ngComboboxInput` and the popup, which\n * is defined by a `ng-template` with the `ngComboboxPopupContainer` directive. If using the\n * `CdkOverlay`, the `cdkConnectedOverlay` directive takes the place of `ngComboboxPopupContainer`.\n *\n * ```html\n * <div ngCombobox filterMode=\"highlight\">\n * <input\n * ngComboboxInput\n * placeholder=\"Search for a state...\"\n * [(value)]=\"searchString\"\n * />\n *\n * <ng-template ngComboboxPopupContainer>\n * <div ngListbox [(value)]=\"selectedValue\">\n * @for (option of filteredOptions(); track option) {\n * <div ngOption [value]=\"option\" [label]=\"option\">\n * <span>{{option}}</span>\n * </div>\n * }\n * </div>\n * </ng-template>\n * </div>\n * ```\n *\n * @developerPreview 21.0\n *\n * @see [Combobox](guide/aria/combobox)\n * @see [Select](guide/aria/select)\n * @see [Multiselect](guide/aria/multiselect)\n * @see [Autocomplete](guide/aria/autocomplete)\n */\n@Directive({\n selector: '[ngCombobox]',\n exportAs: 'ngCombobox',\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n host: {\n '[attr.data-expanded]': 'expanded()',\n '(input)': '_pattern.onInput($event)',\n '(keydown)': '_pattern.onKeydown($event)',\n '(click)': '_pattern.onClick($event)',\n '(focusin)': '_pattern.onFocusIn()',\n '(focusout)': '_pattern.onFocusOut($event)',\n },\n providers: [{provide: COMBOBOX, useExisting: Combobox}],\n})\nexport class Combobox<V> {\n /** A signal wrapper for directionality. */\n protected readonly textDirection = inject(Directionality).valueSignal.asReadonly();\n\n /** The element that the combobox is attached to. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the combobox element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The DeferredContentAware host directive. */\n private readonly _deferredContentAware = inject(DeferredContentAware, {optional: true});\n\n /** The combobox popup. */\n readonly popup = contentChild<ComboboxPopup<V>>(ComboboxPopup);\n\n /**\n * The filter mode for the combobox.\n * - `manual`: The consumer is responsible for filtering the options.\n * - `auto-select`: The combobox automatically selects the first matching option.\n * - `highlight`: The combobox highlights matching text in the options without changing selection.\n */\n readonly filterMode = input<'manual' | 'auto-select' | 'highlight'>('manual');\n\n /** Whether the combobox is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the combobox is read-only. */\n readonly readonly = input(false, {transform: booleanAttribute});\n\n /** The value of the first matching item in the popup. */\n readonly firstMatch = input<V | undefined>(undefined);\n\n /** Whether the combobox is expanded. */\n readonly expanded = computed(() => this.alwaysExpanded() || this._pattern.expanded());\n\n // TODO: Maybe make expanded a signal that can be passed in?\n // Or an \"always expanded\" option?\n\n /** Whether the combobox popup should always be expanded, regardless of user interaction. */\n readonly alwaysExpanded = input(false, {transform: booleanAttribute});\n\n /** Input element connected to the combobox, if any. */\n readonly inputElement = computed(() => this._pattern.inputs.inputEl());\n\n /** The combobox ui pattern. */\n readonly _pattern = new ComboboxPattern<any, V>({\n ...this,\n textDirection: this.textDirection,\n disabled: this.disabled,\n readonly: this.readonly,\n inputValue: signal(''),\n inputEl: signal(undefined),\n containerEl: () => this._elementRef.nativeElement,\n popupControls: () => this.popup()?._controls(),\n });\n\n constructor() {\n afterRenderEffect(() => {\n if (this.alwaysExpanded()) {\n this._pattern.expanded.set(true);\n }\n });\n\n afterRenderEffect(() => {\n if (\n !this._deferredContentAware?.contentVisible() &&\n (this._pattern.isFocused() || this.alwaysExpanded())\n ) {\n this._deferredContentAware?.contentVisible.set(true);\n }\n });\n }\n\n /** Opens the combobox to the selected item. */\n open() {\n this._pattern.open({selected: true});\n }\n\n /** Closes the combobox. */\n close() {\n this._pattern.close();\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 {afterRenderEffect, Directive, ElementRef, inject} from '@angular/core';\nimport {ComboboxDialogPattern} from '../private';\nimport {Combobox} from './combobox';\nimport {ComboboxPopup} from './combobox-popup';\n\n/**\n * Integrates a native `<dialog>` element with the combobox, allowing for\n * a modal or non-modal popup experience. It handles the opening and closing of the dialog\n * based on the combobox's expanded state.\n *\n * ```html\n * <ng-template ngComboboxPopupContainer>\n * <dialog ngComboboxDialog class=\"example-dialog\">\n * <!-- ... dialog content ... -->\n * </dialog>\n * </ng-template>\n * ```\n *\n * @developerPreview 21.0\n *\n * @see [Combobox](guide/aria/combobox)\n * @see [Select](guide/aria/select)\n * @see [Multiselect](guide/aria/multiselect)\n * @see [Autocomplete](guide/aria/autocomplete)\n */\n@Directive({\n selector: 'dialog[ngComboboxDialog]',\n exportAs: 'ngComboboxDialog',\n host: {\n '[attr.data-open]': 'combobox._pattern.expanded()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(click)': '_pattern.onClick($event)',\n },\n hostDirectives: [ComboboxPopup],\n})\nexport class ComboboxDialog {\n /** The dialog element. */\n private readonly _elementRef = inject(ElementRef<HTMLDialogElement>);\n\n /** A reference to the dialog element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The combobox that the dialog belongs to. */\n readonly combobox = inject(Combobox);\n\n /** A reference to the parent combobox popup, if one exists. */\n private readonly _popup = inject<ComboboxPopup<unknown>>(ComboboxPopup, {\n optional: true,\n });\n\n readonly _pattern: ComboboxDialogPattern;\n\n constructor() {\n this._pattern = new ComboboxDialogPattern({\n id: () => '',\n element: () => this._elementRef.nativeElement,\n combobox: this.combobox._pattern,\n });\n\n if (this._popup) {\n this._popup._controls.set(this._pattern);\n }\n\n afterRenderEffect(() => {\n if (this._elementRef) {\n this.combobox._pattern.expanded()\n ? this._elementRef.nativeElement.showModal()\n : this._elementRef.nativeElement.close();\n }\n });\n }\n\n close() {\n this._popup?.combobox?._pattern.close();\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 Directive,\n ElementRef,\n inject,\n model,\n untracked,\n WritableSignal,\n} from '@angular/core';\nimport {ComboboxDialogPattern} from '../private';\nimport {Combobox} from './combobox';\n\n/**\n * An input that is part of a combobox. It is responsible for displaying the\n * current value and handling user input for filtering and selection.\n *\n * This directive should be applied to an `<input>` element within an `ngCombobox`\n * container. It automatically handles keyboard interactions, such as opening the\n * popup and navigating through the options.\n *\n * ```html\n * <input\n * ngComboboxInput\n * placeholder=\"Search...\"\n * [(value)]=\"searchString\"\n * />\n * ```\n *\n * @developerPreview 21.0\n *\n * @see [Combobox](guide/aria/combobox)\n * @see [Select](guide/aria/select)\n * @see [Multiselect](guide/aria/multiselect)\n * @see [Autocomplete](guide/aria/autocomplete)\n */\n@Directive({\n selector: 'input[ngComboboxInput]',\n exportAs: 'ngComboboxInput',\n host: {\n 'role': 'combobox',\n '[value]': 'value()',\n '[attr.aria-disabled]': 'combobox._pattern.disabled()',\n '[attr.aria-expanded]': 'combobox._pattern.expanded()',\n '[attr.aria-activedescendant]': 'combobox._pattern.activeDescendant()',\n '[attr.aria-controls]': 'combobox._pattern.popupId()',\n '[attr.aria-haspopup]': 'combobox._pattern.hasPopup()',\n '[attr.aria-autocomplete]': 'combobox._pattern.autocomplete()',\n '[attr.readonly]': 'combobox._pattern.readonly()',\n },\n})\nexport class ComboboxInput {\n /** The element that the combobox is attached to. */\n private readonly _elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef);\n\n /** A reference to the input element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The combobox that the input belongs to. */\n readonly combobox = inject(Combobox);\n\n /** The value of the input. */\n readonly value = model<string>('');\n\n constructor() {\n (this.combobox._pattern.inputs.inputEl as WritableSignal<HTMLInputElement>).set(\n this._elementRef.nativeElement,\n );\n this.combobox._pattern.inputs.inputValue = this.value;\n\n const controls = this.combobox.popup()?._controls();\n if (controls instanceof ComboboxDialogPattern) {\n return;\n }\n\n /** Focuses & selects the first item in the combobox if the user changes the input value. */\n afterRenderEffect(() => {\n this.value();\n controls?.items();\n untracked(() => this.combobox._pattern.onFilter());\n });\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Directive} from '@angular/core';\nimport {DeferredContent} from '../private';\n\n/**\n * A structural directive that marks the `ng-template` to be used as the popup\n * for a combobox. This content is conditionally rendered.\n *\n * The content of the popup can be a `ngListbox`, `ngTree`, or `role=\"dialog\"`, allowing for\n * flexible and complex combobox implementations. The consumer is responsible for\n * implementing the filtering logic based on the `ngComboboxInput`'s value.\n *\n * ```html\n * <ng-template ngComboboxPopupContainer>\n * <div ngListbox [(value)]=\"selectedValue\">\n * <!-- ... options ... -->\n * </div>\n * </ng-template>\n * ```\n *\n * When using CdkOverlay, this directive can be replaced by `cdkConnectedOverlay`.\n *\n * ```html\n * <ng-template\n * [cdkConnectedOverlay]=\"{origin: inputElement, usePopover: 'inline' matchWidth: true}\"\n * [cdkConnectedOverlayOpen]=\"combobox.expanded()\">\n * <div ngListbox [(value)]=\"selectedValue\">\n * <!-- ... options ... -->\n * </div>\n * </ng-template>\n * ```\n *\n * @developerPreview 21.0\n *\n * @see [Combobox](guide/aria/combobox)\n * @see [Select](guide/aria/select)\n * @see [Multiselect](guide/aria/multiselect)\n * @see [Autocomplete](guide/aria/autocomplete)\n */\n@Directive({\n selector: 'ng-template[ngComboboxPopupContainer]',\n exportAs: 'ngComboboxPopupContainer',\n hostDirectives: [DeferredContent],\n})\nexport class ComboboxPopupContainer {}\n"],"names":["COMBOBOX","InjectionToken","ComboboxPopup","combobox","inject","optional","_controls","signal","undefined","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","exportAs","ngImport","decorators","args","Combobox","textDirection","Directionality","valueSignal","asReadonly","_elementRef","ElementRef","element","nativeElement","_deferredContentAware","DeferredContentAware","popup","contentChild","filterMode","input","disabled","transform","booleanAttribute","readonly","firstMatch","expanded","computed","alwaysExpanded","_pattern","inputElement","inputs","inputEl","ComboboxPattern","inputValue","containerEl","popupControls","constructor","afterRenderEffect","set","contentVisible","isFocused","open","selected","close","ɵdir","ɵɵngDeclareDirective","minVersion","version","type","classPropertyName","publicName","isSignal","isRequired","transformFunction","host","listeners","properties","providers","provide","useExisting","descendants","hostDirectives","directive","i1","Input","alias","required","ComboboxDialog","_popup","ComboboxDialogPattern","id","showModal","ComboboxInput","value","model","controls","items","untracked","onFilter","outputs","attributes","ComboboxPopupContainer","DeferredContent"],"mappings":";;;;;;;;;AAYO,MAAMA,QAAQ,GAAG,IAAIC,cAAc,CAAoB,UAAU,CAAC;;MCoB5DC,aAAa,CAAA;AAEfC,EAAAA,QAAQ,GAAGC,MAAM,CAAcJ,QAAQ,EAAE;AAACK,IAAAA,QAAQ,EAAE;AAAI,GAAC,CAAC;EAG1DC,SAAS,GAAGC,MAAM,CAKzBC,SAAS;;WAAC;;;;;UAVDN,aAAa;AAAAO,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;UAAbX,aAAa;AAAAY,IAAAA,YAAA,EAAA,IAAA;AAAAC,IAAAA,QAAA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AA,EAAAN;AAAA,GAAA,CAAA;;;;;;QAAtBqF,sBAAsB;AAAA9E,EAAAA,UAAA,EAAA,CAAA;UALlCL,SAAS;AAACM,IAAAA,IAAA,EAAA,CAAA;AACTJ,MAAAA,QAAQ,EAAE,uCAAuC;AACjDC,MAAAA,QAAQ,EAAE,0BAA0B;MACpC4D,cAAc,EAAE,CAACqB,eAAe;KACjC;;;;;;"}
1
+ {"version":3,"file":"combobox.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/combobox/combobox.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/combobox/combobox-tokens.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/combobox/combobox-popup.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/combobox/combobox-widget.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n OnInit,\n signal,\n Renderer2,\n} from '@angular/core';\nimport {DeferredContentAware, ComboboxPattern, tabIndexTransform} from '@angular/aria/private';\nimport type {ComboboxPopup} from './combobox-popup';\n\n/**\n * The container element that wraps a combobox input and popup, and orchestrates its behavior.\n *\n * The `ngCombobox` directive is the main entry point for creating a combobox and customizing its\n * behavior. It coordinates the interactions between the input and the popup.\n *\n * ```html\n * <div ngCombobox [(expanded)]=\"expanded\">\n * <input ngComboboxInput />\n *\n * <ng-template ngComboboxPopup>\n * <div ngComboboxWidget>\n * <!-- ... options ... -->\n * </div>\n * </ng-template>\n * </div>\n * ```\n */\n@Directive({\n selector: '[ngCombobox]',\n exportAs: 'ngCombobox',\n host: {\n 'role': 'combobox',\n '[attr.aria-autocomplete]': '_pattern.autocomplete()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-expanded]': '_pattern.isExpanded()',\n '[attr.aria-activedescendant]': '_pattern.activeDescendant()',\n '[attr.aria-controls]': '_pattern.popupId()',\n '[attr.aria-haspopup]': '_pattern.popupType()',\n '[attr.tabindex]':\n 'disabled() && !softDisabled() ? -1 : (tabIndex() !== undefined ? tabIndex() : 0)',\n '[attr.disabled]': 'disabled() && !softDisabled() ? \"\" : null',\n '[attr.readonly]': 'disabled() && _pattern.isEditable() ? \"\" : null',\n '(keydown)': '_pattern.onKeydown($event)',\n '(focusin)': '_pattern.onFocusin()',\n '(focusout)': '_pattern.onFocusout($event)',\n '(click)': '_pattern.onClick($event)',\n '(input)': '_pattern.onInput($event)',\n },\n})\nexport class Combobox extends DeferredContentAware implements OnInit {\n private readonly _renderer = inject(Renderer2);\n\n /** The element that the combobox is attached to. */\n private readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** A reference to the input element. */\n readonly element = this._elementRef.nativeElement;\n\n /** The popup associated with the combobox. */\n readonly _popup = signal<ComboboxPopup | undefined>(undefined);\n\n /** Whether the combobox is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the combobox is soft disabled (remains focusable). */\n readonly softDisabled = input(true, {transform: booleanAttribute});\n\n /** Whether the combobox should always remain expanded. */\n readonly alwaysExpanded = input(false, {transform: booleanAttribute});\n\n /** The tabindex of the combobox. */\n readonly tabIndex = input(undefined, {\n alias: 'tabindex',\n transform: tabIndexTransform,\n });\n\n /** Whether the combobox is expanded. */\n readonly expanded = model<boolean>(false);\n\n /** The value of the combobox input. */\n readonly value = model<string>('');\n\n /** An inline suggestion to be displayed in the input. */\n readonly inlineSuggestion = input<string | undefined>(undefined);\n\n /** The combobox ui pattern. */\n readonly _pattern = new ComboboxPattern({\n ...this,\n element: () => this.element,\n expandable: () => true,\n popup: computed(() => this._popup()?._pattern),\n });\n\n constructor() {\n super();\n\n afterRenderEffect(() => this._pattern.keyboardEventRelayEffect());\n afterRenderEffect(() => this._pattern.closePopupOnBlurEffect());\n afterRenderEffect(() => {\n this.contentVisible.set(this._pattern.isExpanded());\n });\n\n if (this._pattern.isEditable()) {\n afterRenderEffect(() => {\n this._renderer.setProperty(this.element, 'value', this.value());\n });\n afterRenderEffect(() => {\n this._pattern.highlightEffect();\n });\n }\n }\n\n ngOnInit() {\n if (this.alwaysExpanded()) {\n this.expanded.set(true);\n }\n }\n\n /** Registers a popup with the combobox. */\n _registerPopup(popup: ComboboxPopup) {\n this._popup.set(popup);\n }\n\n /** Unregisters the popup from the combobox. */\n _unregisterPopup() {\n this._popup.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 {InjectionToken} from '@angular/core';\nimport type {ComboboxPopup} from './combobox-popup';\n\n/** Token used to expose the combobox popup. */\nexport const COMBOBOX_POPUP = new InjectionToken<ComboboxPopup>('COMBOBOX_POPUP');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed, Directive, inject, input, OnDestroy, OnInit, signal} from '@angular/core';\nimport {DeferredContent, ComboboxPopupPattern} from '@angular/aria/private';\nimport type {Combobox} from './combobox';\nimport type {ComboboxWidget} from './combobox-widget';\nimport {COMBOBOX_POPUP} from './combobox-tokens';\n\n/**\n * A structural directive that marks the `ng-template` to be used as the popup\n * for a combobox. This content is conditionally rendered.\n *\n * The content of the popup can be any element with the `ngComboboxWidget` directive.\n *\n * ```html\n * <ng-template ngComboboxPopup>\n * <div ngComboboxWidget>\n * <!-- ... options ... -->\n * </div>\n * </ng-template>\n * ```\n */\n@Directive({\n selector: 'ng-template[ngComboboxPopup]',\n exportAs: 'ngComboboxPopup',\n hostDirectives: [DeferredContent],\n providers: [{provide: COMBOBOX_POPUP, useExisting: ComboboxPopup}],\n})\nexport class ComboboxPopup implements OnInit, OnDestroy {\n private readonly _deferredContent = inject(DeferredContent);\n\n /** The combobox that the popup belongs to. */\n readonly combobox = input.required<Combobox>();\n\n /** The widget contained within the popup. */\n readonly _widget = signal<ComboboxWidget | undefined>(undefined);\n\n /** The element that serves as the control target for the popup. */\n readonly controlTarget = computed(() => this._widget()?.element);\n\n /** The ID of the popup. */\n readonly popupId = computed(() => this._widget()?.popupId());\n\n /** The ID of the active descendant in the popup. */\n readonly activeDescendant = computed(() => this._widget()?.activeDescendant());\n\n /** The type of the popup (e.g., listbox, tree, grid, dialog). */\n readonly popupType = input<'listbox' | 'tree' | 'grid' | 'dialog'>('listbox');\n\n /** The popup pattern. */\n readonly _pattern = new ComboboxPopupPattern({\n ...this,\n });\n\n ngOnInit() {\n this.combobox()._registerPopup(this);\n this._deferredContent.deferredContentAware.set(this.combobox());\n }\n\n ngOnDestroy() {\n this.combobox()._unregisterPopup();\n }\n\n /** Registers a widget with the popup. */\n _registerWidget(widget: ComboboxWidget) {\n this._widget.set(widget);\n }\n\n /** Unregisters the widget from the popup. */\n _unregisterWidget() {\n this._widget.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 {Directive, ElementRef, inject, input, OnDestroy, OnInit, signal} from '@angular/core';\nimport {COMBOBOX_POPUP} from './combobox-tokens';\n\n/**\n * Identifies an element as a widget within a combobox popup.\n *\n * This directive should be applied to the element that contains the options or content\n * of the popup. It handles the communication of ID and active descendant information\n * to the combobox.\n */\n@Directive({\n selector: '[ngComboboxWidget]',\n exportAs: 'ngComboboxWidget',\n host: {\n '(focusin)': 'onFocusin()',\n '(focusout)': 'onFocusout($event)',\n },\n})\nexport class ComboboxWidget implements OnInit, OnDestroy {\n /** The element that the popup widget is attached to. */\n private readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly _popup = inject(COMBOBOX_POPUP);\n\n /** A reference to the popup widget element. */\n readonly element = this._elementRef.nativeElement;\n\n /** The ID of the popup widget. */\n readonly popupId = signal<string | undefined>(undefined);\n\n /** The ID of the active descendant in the widget. */\n readonly activeDescendant = input<string | undefined>(undefined);\n\n private _observer: MutationObserver | undefined;\n\n constructor() {\n const el = this.element;\n this._observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (mutation.attributeName === 'id') {\n this.popupId.set(el.id);\n }\n }\n });\n\n this._observer.observe(el, {\n attributes: true,\n attributeFilter: ['id'],\n });\n }\n\n ngOnInit() {\n this.popupId.set(this.element.id);\n this._popup._registerWidget(this);\n }\n\n ngOnDestroy(): void {\n this._observer?.disconnect();\n this._popup._unregisterWidget();\n }\n\n /** Handles focus in events for the widget. */\n onFocusin() {\n this._popup._pattern.onFocusin();\n }\n\n /** Handles focus out events for the widget. */\n onFocusout(event: FocusEvent) {\n this._popup._pattern.onFocusout(event);\n }\n}\n"],"names":["Combobox","DeferredContentAware","_renderer","inject","Renderer2","_elementRef","ElementRef","element","nativeElement","_popup","signal","undefined","disabled","input","transform","booleanAttribute","softDisabled","alwaysExpanded","tabIndex","ngDevMode","debugName","alias","tabIndexTransform","expanded","model","value","inlineSuggestion","_pattern","ComboboxPattern","expandable","popup","computed","constructor","afterRenderEffect","keyboardEventRelayEffect","closePopupOnBlurEffect","contentVisible","set","isExpanded","isEditable","setProperty","highlightEffect","ngOnInit","_registerPopup","_unregisterPopup","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","host","attributes","listeners","properties","exportAs","usesInheritance","ngImport","decorators","args","COMBOBOX_POPUP","InjectionToken","ComboboxPopup","_deferredContent","DeferredContent","combobox","required","_widget","controlTarget","popupId","activeDescendant","popupType","ComboboxPopupPattern","deferredContentAware","ngOnDestroy","_registerWidget","widget","_unregisterWidget","providers","provide","useExisting","hostDirectives","directive","i1","ComboboxWidget","_observer","el","MutationObserver","mutations","mutation","attribut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,MAAAA,SAAA,EAAA;AAAA,QAAA,SAAA,EAAA,aAAA;AAAA,QAAA,UAAA,EAAA;AAAA;KAAA;IAAAE,QAAA,EAAA,CAAA,kBAAA,CAAA;AAAAE,IAAAA,QAAA,EAAAlB;AAAA,GAAA,CAAA;;;;;;QAAd6C,cAAc;AAAA1B,EAAAA,UAAA,EAAA,CAAA;UAR1BjB,SAAS;AAACkB,IAAAA,IAAA,EAAA,CAAA;AACThB,MAAAA,QAAQ,EAAE,oBAAoB;AAC9BY,MAAAA,QAAQ,EAAE,kBAAkB;AAC5BJ,MAAAA,IAAI,EAAE;AACJ,QAAA,WAAW,EAAE,aAAa;AAC1B,QAAA,YAAY,EAAE;AACf;KACF;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,80 @@
1
+ import { ContentContainerComponentHarness, HarnessPredicate, ComponentHarness, parallel } from '@angular/cdk/testing';
2
+
3
+ class GridCellHarness extends ContentContainerComponentHarness {
4
+ static hostSelector = '[ngGridCell]';
5
+ static with(options = {}) {
6
+ return new HarnessPredicate(GridCellHarness, options).addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text)).addOption('selected', options.selected, async (harness, selected) => (await harness.isSelected()) === selected).addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);
7
+ }
8
+ async isSelected() {
9
+ const host = await this.host();
10
+ return (await host.getAttribute('aria-selected')) === 'true';
11
+ }
12
+ async isDisabled() {
13
+ const host = await this.host();
14
+ return (await host.getAttribute('aria-disabled')) === 'true';
15
+ }
16
+ async getText() {
17
+ const host = await this.host();
18
+ return host.text();
19
+ }
20
+ async click() {
21
+ const host = await this.host();
22
+ return host.click();
23
+ }
24
+ async focus() {
25
+ const host = await this.host();
26
+ return host.focus();
27
+ }
28
+ async blur() {
29
+ const host = await this.host();
30
+ return host.blur();
31
+ }
32
+ async isActive() {
33
+ const host = await this.host();
34
+ return (await host.getAttribute('data-active')) === 'true';
35
+ }
36
+ async isFocused() {
37
+ const host = await this.host();
38
+ return host.isFocused();
39
+ }
40
+ }
41
+ class GridRowHarness extends ComponentHarness {
42
+ static hostSelector = '[ngGridRow]';
43
+ static with(options = {}) {
44
+ return new HarnessPredicate(GridRowHarness, options);
45
+ }
46
+ async getCells(filters = {}) {
47
+ return this.locatorForAll(GridCellHarness.with(filters))();
48
+ }
49
+ async getCellTextByIndex(filters = {}) {
50
+ const cells = await this.getCells(filters);
51
+ return parallel(() => cells.map(cell => cell.getText()));
52
+ }
53
+ }
54
+ class GridHarness extends ComponentHarness {
55
+ static hostSelector = '[ngGrid]';
56
+ static with(options = {}) {
57
+ return new HarnessPredicate(GridHarness, options).addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);
58
+ }
59
+ async isDisabled() {
60
+ const host = await this.host();
61
+ return (await host.getAttribute('aria-disabled')) === 'true';
62
+ }
63
+ async isMultiSelectable() {
64
+ const host = await this.host();
65
+ return (await host.getAttribute('aria-multiselectable')) === 'true';
66
+ }
67
+ async getRows(filters = {}) {
68
+ return this.locatorForAll(GridRowHarness.with(filters))();
69
+ }
70
+ async getCells(filters = {}) {
71
+ return this.locatorForAll(GridCellHarness.with(filters))();
72
+ }
73
+ async getCellTextByIndex() {
74
+ const rows = await this.getRows();
75
+ return parallel(() => rows.map(row => row.getCellTextByIndex()));
76
+ }
77
+ }
78
+
79
+ export { GridCellHarness, GridHarness, GridRowHarness };
80
+ //# sourceMappingURL=grid-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/grid/testing/grid-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 {\n ComponentHarness,\n ContentContainerComponentHarness,\n HarnessPredicate,\n parallel,\n} from '@angular/cdk/testing';\nimport {\n GridHarnessFilters,\n GridRowHarnessFilters,\n GridCellHarnessFilters,\n} from './grid-harness-filters';\n\n/** Harness for interacting with a standard ngGridCell in tests. */\nexport class GridCellHarness extends ContentContainerComponentHarness {\n static hostSelector = '[ngGridCell]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a grid cell with specific attributes.\n * @param options Options for filtering which cell instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: GridCellHarnessFilters = {}): HarnessPredicate<GridCellHarness> {\n return new HarnessPredicate(GridCellHarness, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getText(), text),\n )\n .addOption(\n 'selected',\n options.selected,\n async (harness, selected) => (await harness.isSelected()) === selected,\n )\n .addOption(\n 'disabled',\n options.disabled,\n async (harness, disabled) => (await harness.isDisabled()) === disabled,\n );\n }\n\n /** Whether the cell is selected. */\n async isSelected(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-selected')) === 'true';\n }\n\n /** Whether the cell is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-disabled')) === 'true';\n }\n\n /** Gets the text content of the cell. */\n async getText(): Promise<string> {\n const host = await this.host();\n return host.text();\n }\n\n /** Clicks the cell. */\n async click(): Promise<void> {\n const host = await this.host();\n return host.click();\n }\n\n /** Focuses the cell. */\n async focus(): Promise<void> {\n const host = await this.host();\n return host.focus();\n }\n\n /** Blurs the cell. */\n async blur(): Promise<void> {\n const host = await this.host();\n return host.blur();\n }\n\n /** Whether the cell is active. */\n async isActive(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('data-active')) === 'true';\n }\n\n /** Whether the cell is focused. */\n async isFocused(): Promise<boolean> {\n const host = await this.host();\n return host.isFocused();\n }\n}\n\n/** Harness for interacting with a standard ngGridRow in tests. */\nexport class GridRowHarness extends ComponentHarness {\n static hostSelector = '[ngGridRow]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a grid row with specific attributes.\n * @param options Options for filtering which row instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: GridRowHarnessFilters = {}): HarnessPredicate<GridRowHarness> {\n return new HarnessPredicate(GridRowHarness, options);\n }\n\n /** Gets all cells in the row. */\n async getCells(filters: GridCellHarnessFilters = {}): Promise<GridCellHarness[]> {\n return this.locatorForAll(GridCellHarness.with(filters))();\n }\n\n /** Gets the text of the cells in the row. */\n async getCellTextByIndex(filters: GridCellHarnessFilters = {}): Promise<string[]> {\n const cells = await this.getCells(filters);\n return parallel(() => cells.map(cell => cell.getText()));\n }\n}\n\n/** Harness for interacting with a standard ngGrid in tests. */\nexport class GridHarness extends ComponentHarness {\n static hostSelector = '[ngGrid]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a grid with specific attributes.\n * @param options Options for filtering which grid instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: GridHarnessFilters = {}): HarnessPredicate<GridHarness> {\n return new HarnessPredicate(GridHarness, options).addOption(\n 'disabled',\n options.disabled,\n async (harness, disabled) => (await harness.isDisabled()) === disabled,\n );\n }\n\n /** Whether the grid 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 grid is multi-selectable. */\n async isMultiSelectable(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-multiselectable')) === 'true';\n }\n\n /** Gets all rows in the grid. */\n async getRows(filters: GridRowHarnessFilters = {}): Promise<GridRowHarness[]> {\n return this.locatorForAll(GridRowHarness.with(filters))();\n }\n\n /** Gets all cells in the grid. */\n async getCells(filters: GridCellHarnessFilters = {}): Promise<GridCellHarness[]> {\n return this.locatorForAll(GridCellHarness.with(filters))();\n }\n\n /** Gets the text inside the entire grid organized by rows. */\n async getCellTextByIndex(): Promise<string[][]> {\n const rows = await this.getRows();\n return parallel(() => rows.map(row => row.getCellTextByIndex()));\n }\n}\n"],"names":["GridCellHarness","ContentContainerComponentHarness","hostSelector","with","options","HarnessPredicate","addOption","text","harness","stringMatches","getText","selected","isSelected","disabled","isDisabled","host","getAttribute","click","focus","blur","isActive","isFocused","GridRowHarness","ComponentHarness","getCells","filters","locatorForAll","getCellTextByIndex","cells","parallel","map","cell","GridHarness","isMultiSelectable","getRows","rows","row"],"mappings":";;AAqBM,MAAOA,eAAgB,SAAQC,gCAAgC,CAAA;EACnE,OAAOC,YAAY,GAAG,cAAc;AAOpC,EAAA,OAAOC,IAAIA,CAACC,OAAA,GAAkC,EAAE,EAAA;AAC9C,IAAA,OAAO,IAAIC,gBAAgB,CAACL,eAAe,EAAEI,OAAO,CAAA,CACjDE,SAAS,CAAC,MAAM,EAAEF,OAAO,CAACG,IAAI,EAAE,CAACC,OAAO,EAAED,IAAI,KAC7CF,gBAAgB,CAACI,aAAa,CAACD,OAAO,CAACE,OAAO,EAAE,EAAEH,IAAI,CAAC,CAAA,CAExDD,SAAS,CACR,UAAU,EACVF,OAAO,CAACO,QAAQ,EAChB,OAAOH,OAAO,EAAEG,QAAQ,KAAK,CAAC,MAAMH,OAAO,CAACI,UAAU,EAAE,MAAMD,QAAQ,CAAA,CAEvEL,SAAS,CACR,UAAU,EACVF,OAAO,CAACS,QAAQ,EAChB,OAAOL,OAAO,EAAEK,QAAQ,KAAK,CAAC,MAAML,OAAO,CAACM,UAAU,EAAE,MAAMD,QAAQ,CACvE;AACL,EAAA;EAGA,MAAMD,UAAUA,GAAA;AACd,IAAA,MAAMG,IAAI,GAAG,MAAM,IAAI,CAACA,IAAI,EAAE;IAC9B,OAAO,CAAC,MAAMA,IAAI,CAACC,YAAY,CAAC,eAAe,CAAC,MAAM,MAAM;AAC9D,EAAA;EAGA,MAAMF,UAAUA,GAAA;AACd,IAAA,MAAMC,IAAI,GAAG,MAAM,IAAI,CAACA,IAAI,EAAE;IAC9B,OAAO,CAAC,MAAMA,IAAI,CAACC,YAAY,CAAC,eAAe,CAAC,MAAM,MAAM;AAC9D,EAAA;EAGA,MAAMN,OAAOA,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O,IAAI,CAACC,aAAa,CAAC1B,eAAe,CAACG,IAAI,CAACsB,OAAO,CAAC,CAAC,EAAE;AAC5D,EAAA;EAGA,MAAME,kBAAkBA,GAAA;AACtB,IAAA,MAAMQ,IAAI,GAAG,MAAM,IAAI,CAACD,OAAO,EAAE;AACjC,IAAA,OAAOL,QAAQ,CAAC,MAAMM,IAAI,CAACL,GAAG,CAACM,GAAG,IAAIA,GAAG,CAACT,kBAAkB,EAAE,CAAC,CAAC;AAClE,EAAA;;;;;"}
package/fesm2022/grid.mjs CHANGED
@@ -1,25 +1,22 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, ElementRef, contentChildren, computed, input, booleanAttribute, afterRenderEffect, Directive, output, Renderer2, contentChild, model } from '@angular/core';
2
+ import { InjectionToken, inject, ElementRef, computed, input, booleanAttribute, afterRenderEffect, afterNextRender, Directive, output, Renderer2, contentChild, model } from '@angular/core';
3
3
  import { Directionality } from '@angular/cdk/bidi';
4
+ import { tabIndexTransform } from './_transforms-chunk.mjs';
4
5
  import { GridPattern, GridCellWidgetPattern, GridCellPattern, GridRowPattern } from './_widget-chunk.mjs';
6
+ import { SortedCollection } from './_collection-chunk.mjs';
5
7
  import { _IdGenerator } from '@angular/cdk/a11y';
6
- import './_signal-like-chunk.mjs';
8
+ import './_click-event-manager-chunk.mjs';
7
9
  import '@angular/core/primitives/signals';
8
- import './_pointer-event-manager-chunk.mjs';
9
10
 
10
11
  const GRID_CELL = new InjectionToken('GRID_CELL');
11
12
  const GRID_ROW = new InjectionToken('GRID_ROW');
13
+ const GRID = new InjectionToken('GRID');
12
14
 
13
15
  class Grid {
14
16
  _elementRef = inject(ElementRef);
15
17
  element = this._elementRef.nativeElement;
16
- _rows = contentChildren(GRID_ROW, {
17
- ...(ngDevMode ? {
18
- debugName: "_rows"
19
- } : {}),
20
- descendants: true
21
- });
22
- _rowPatterns = computed(() => this._rows().map(r => r._pattern), ...(ngDevMode ? [{
18
+ _collection = new SortedCollection();
19
+ _rowPatterns = computed(() => this._collection.orderedItems().map(r => r._pattern), ...(ngDevMode ? [{
23
20
  debugName: "_rowPatterns"
24
21
  }] : []));
25
22
  textDirection = inject(Directionality).valueSignal;
@@ -59,18 +56,49 @@ class Grid {
59
56
  selectionMode = input('follow', ...(ngDevMode ? [{
60
57
  debugName: "selectionMode"
61
58
  }] : []));
59
+ tabIndex = input(undefined, {
60
+ ...(ngDevMode ? {
61
+ debugName: "tabIndex"
62
+ } : {}),
63
+ alias: 'tabindex',
64
+ transform: tabIndexTransform
65
+ });
62
66
  _pattern = new GridPattern({
63
67
  ...this,
64
68
  rows: this._rowPatterns,
65
69
  getCell: e => this._getCell(e),
66
70
  element: () => this.element
67
71
  });
72
+ activeDescendant = computed(() => this._pattern.activeDescendant(), ...(ngDevMode ? [{
73
+ debugName: "activeDescendant"
74
+ }] : []));
68
75
  constructor() {
69
- afterRenderEffect(() => this._pattern.setDefaultStateEffect());
70
- afterRenderEffect(() => this._pattern.resetStateEffect());
71
- afterRenderEffect(() => this._pattern.resetFocusEffect());
72
- afterRenderEffect(() => this._pattern.restoreFocusEffect());
73
- afterRenderEffect(() => this._pattern.focusEffect());
76
+ afterRenderEffect({
77
+ write: () => this._pattern.setDefaultStateEffect()
78
+ });
79
+ afterRenderEffect({
80
+ write: () => this._pattern.resetStateEffect()
81
+ });
82
+ afterRenderEffect({
83
+ write: () => this._pattern.resetFocusEffect()
84
+ });
85
+ afterRenderEffect({
86
+ write: () => this._pattern.restoreFocusEffect()
87
+ });
88
+ afterRenderEffect({
89
+ write: () => this._pattern.focusEffect()
90
+ });
91
+ afterNextRender(() => {
92
+ this._collection.startObserving(this.element);
93
+ });
94
+ }
95
+ ngOnDestroy() {
96
+ this._collection.stopObserving();
97
+ }
98
+ scrollActiveCellIntoView(options = {
99
+ block: 'nearest'
100
+ }) {
101
+ this._pattern.activeCell()?.element().scrollIntoView(options);
74
102
  }
75
103
  _getCell(element) {
76
104
  let target = element;
@@ -88,15 +116,15 @@ class Grid {
88
116
  }
89
117
  static ɵfac = i0.ɵɵngDeclareFactory({
90
118
  minVersion: "12.0.0",
91
- version: "22.0.0-next.6",
119
+ version: "22.0.0-next.10",
92
120
  ngImport: i0,
93
121
  type: Grid,
94
122
  deps: [],
95
123
  target: i0.ɵɵFactoryTarget.Directive
96
124
  });
97
125
  static ɵdir = i0.ɵɵngDeclareDirective({
98
- minVersion: "17.2.0",
99
- version: "22.0.0-next.6",
126
+ minVersion: "17.1.0",
127
+ version: "22.0.0-next.10",
100
128
  type: Grid,
101
129
  isStandalone: true,
102
130
  selector: "[ngGrid]",
@@ -156,6 +184,13 @@ class Grid {
156
184
  isSignal: true,
157
185
  isRequired: false,
158
186
  transformFunction: null
187
+ },
188
+ tabIndex: {
189
+ classPropertyName: "tabIndex",
190
+ publicName: "tabindex",
191
+ isSignal: true,
192
+ isRequired: false,
193
+ transformFunction: null
159
194
  }
160
195
  },
161
196
  host: {
@@ -164,22 +199,20 @@ class Grid {
164
199
  },
165
200
  listeners: {
166
201
  "keydown": "_pattern.onKeydown($event)",
167
- "pointerdown": "_pattern.onPointerdown($event)",
202
+ "click": "_pattern.onClick($event)",
168
203
  "focusin": "_pattern.onFocusIn($event)",
169
204
  "focusout": "_pattern.onFocusOut($event)"
170
205
  },
171
206
  properties: {
172
- "tabindex": "_pattern.tabIndex()",
207
+ "tabindex": "tabIndex() !== undefined ? tabIndex() : _pattern.tabIndex()",
173
208
  "attr.aria-disabled": "_pattern.disabled()",
174
209
  "attr.aria-multiselectable": "_pattern.multiSelectable()",
175
210
  "attr.aria-activedescendant": "_pattern.activeDescendant()"
176
211
  }
177
212
  },
178
- queries: [{
179
- propertyName: "_rows",
180
- predicate: GRID_ROW,
181
- descendants: true,
182
- isSignal: true
213
+ providers: [{
214
+ provide: GRID,
215
+ useExisting: Grid
183
216
  }],
184
217
  exportAs: ["ngGrid"],
185
218
  ngImport: i0
@@ -187,7 +220,7 @@ class Grid {
187
220
  }
188
221
  i0.ɵɵngDeclareClassMetadata({
189
222
  minVersion: "12.0.0",
190
- version: "22.0.0-next.6",
223
+ version: "22.0.0-next.10",
191
224
  ngImport: i0,
192
225
  type: Grid,
193
226
  decorators: [{
@@ -197,28 +230,23 @@ i0.ɵɵngDeclareClassMetadata({
197
230
  exportAs: 'ngGrid',
198
231
  host: {
199
232
  'role': 'grid',
200
- '[tabindex]': '_pattern.tabIndex()',
233
+ '[tabindex]': 'tabIndex() !== undefined ? tabIndex() : _pattern.tabIndex()',
201
234
  '[attr.aria-disabled]': '_pattern.disabled()',
202
235
  '[attr.aria-multiselectable]': '_pattern.multiSelectable()',
203
236
  '[attr.aria-activedescendant]': '_pattern.activeDescendant()',
204
237
  '(keydown)': '_pattern.onKeydown($event)',
205
- '(pointerdown)': '_pattern.onPointerdown($event)',
238
+ '(click)': '_pattern.onClick($event)',
206
239
  '(focusin)': '_pattern.onFocusIn($event)',
207
240
  '(focusout)': '_pattern.onFocusOut($event)'
208
- }
241
+ },
242
+ providers: [{
243
+ provide: GRID,
244
+ useExisting: Grid
245
+ }]
209
246
  }]
210
247
  }],
211
248
  ctorParameters: () => [],
212
249
  propDecorators: {
213
- _rows: [{
214
- type: i0.ContentChildren,
215
- args: [i0.forwardRef(() => GRID_ROW), {
216
- ...{
217
- descendants: true
218
- },
219
- isSignal: true
220
- }]
221
- }],
222
250
  enableSelection: [{
223
251
  type: i0.Input,
224
252
  args: [{
@@ -282,6 +310,14 @@ i0.ɵɵngDeclareClassMetadata({
282
310
  alias: "selectionMode",
283
311
  required: false
284
312
  }]
313
+ }],
314
+ tabIndex: [{
315
+ type: i0.Input,
316
+ args: [{
317
+ isSignal: true,
318
+ alias: "tabindex",
319
+ required: false
320
+ }]
285
321
  }]
286
322
  }
287
323
  });
@@ -313,33 +349,25 @@ class GridCellWidget {
313
349
  tabindex = input(...(ngDevMode ? [undefined, {
314
350
  debugName: "tabindex"
315
351
  }] : []));
316
- _tabIndex = computed(() => this.tabindex() ?? (this.focusTarget() ? -1 : this._pattern.tabIndex()), ...(ngDevMode ? [{
352
+ _tabIndex = computed(() => this.tabindex() ?? this._pattern.tabIndex(), ...(ngDevMode ? [{
317
353
  debugName: "_tabIndex"
318
354
  }] : []));
319
355
  _pattern = new GridCellWidgetPattern({
320
356
  ...this,
321
357
  element: () => this.element,
322
358
  cell: () => this._cell._pattern,
323
- focusTarget: computed(() => {
324
- const target = this.focusTarget();
325
- return target instanceof ElementRef ? target.nativeElement : target;
326
- })
359
+ onActivate: e => this.activated.emit(e),
360
+ onDeactivate: e => this.deactivated.emit(e)
327
361
  });
328
362
  get isActivated() {
329
363
  return computed(() => this._pattern.isActivated());
330
364
  }
331
365
  constructor() {
332
- afterRenderEffect(() => {
333
- const activateEvent = this._pattern.lastActivateEvent();
334
- if (activateEvent) {
335
- this.activated.emit(activateEvent);
336
- }
366
+ afterRenderEffect({
367
+ write: () => this._pattern.activationEffect()
337
368
  });
338
- afterRenderEffect(() => {
339
- const deactivateEvent = this._pattern.lastDeactivateEvent();
340
- if (deactivateEvent) {
341
- this.deactivated.emit(deactivateEvent);
342
- }
369
+ afterRenderEffect({
370
+ write: () => this._pattern.deactivationEffect()
343
371
  });
344
372
  }
345
373
  activate() {
@@ -350,7 +378,7 @@ class GridCellWidget {
350
378
  }
351
379
  static ɵfac = i0.ɵɵngDeclareFactory({
352
380
  minVersion: "12.0.0",
353
- version: "22.0.0-next.6",
381
+ version: "22.0.0-next.10",
354
382
  ngImport: i0,
355
383
  type: GridCellWidget,
356
384
  deps: [],
@@ -358,7 +386,7 @@ class GridCellWidget {
358
386
  });
359
387
  static ɵdir = i0.ɵɵngDeclareDirective({
360
388
  minVersion: "17.1.0",
361
- version: "22.0.0-next.6",
389
+ version: "22.0.0-next.10",
362
390
  type: GridCellWidget,
363
391
  isStandalone: true,
364
392
  selector: "[ngGridCellWidget]",
@@ -417,7 +445,7 @@ class GridCellWidget {
417
445
  }
418
446
  i0.ɵɵngDeclareClassMetadata({
419
447
  minVersion: "12.0.0",
420
- version: "22.0.0-next.6",
448
+ version: "22.0.0-next.10",
421
449
  ngImport: i0,
422
450
  type: GridCellWidget,
423
451
  decorators: [{
@@ -573,6 +601,12 @@ class GridCell {
573
601
  }
574
602
  });
575
603
  }
604
+ ngOnInit() {
605
+ this._row._collection.register(this);
606
+ }
607
+ ngOnDestroy() {
608
+ this._row._collection.unregister(this);
609
+ }
576
610
  _toggleAttribute = (name, value) => {
577
611
  if (value == null) {
578
612
  this._renderer.removeAttribute(this.element, name);
@@ -594,7 +628,7 @@ class GridCell {
594
628
  }
595
629
  static ɵfac = i0.ɵɵngDeclareFactory({
596
630
  minVersion: "12.0.0",
597
- version: "22.0.0-next.6",
631
+ version: "22.0.0-next.10",
598
632
  ngImport: i0,
599
633
  type: GridCell,
600
634
  deps: [],
@@ -602,7 +636,7 @@ class GridCell {
602
636
  });
603
637
  static ɵdir = i0.ɵɵngDeclareDirective({
604
638
  minVersion: "17.2.0",
605
- version: "22.0.0-next.6",
639
+ version: "22.0.0-next.10",
606
640
  type: GridCell,
607
641
  isStandalone: true,
608
642
  selector: "[ngGridCell]",
@@ -698,7 +732,7 @@ class GridCell {
698
732
  }
699
733
  i0.ɵɵngDeclareClassMetadata({
700
734
  minVersion: "12.0.0",
701
- version: "22.0.0-next.6",
735
+ version: "22.0.0-next.10",
702
736
  ngImport: i0,
703
737
  type: GridCell,
704
738
  decorators: [{
@@ -812,16 +846,11 @@ i0.ɵɵngDeclareClassMetadata({
812
846
  class GridRow {
813
847
  _elementRef = inject(ElementRef);
814
848
  element = this._elementRef.nativeElement;
815
- _cells = contentChildren(GRID_CELL, {
816
- ...(ngDevMode ? {
817
- debugName: "_cells"
818
- } : {}),
819
- descendants: true
820
- });
821
- _cellPatterns = computed(() => this._cells().map(c => c._pattern), ...(ngDevMode ? [{
849
+ _collection = new SortedCollection();
850
+ _cellPatterns = computed(() => this._collection.orderedItems().map(c => c._pattern), ...(ngDevMode ? [{
822
851
  debugName: "_cellPatterns"
823
852
  }] : []));
824
- _grid = inject(Grid);
853
+ _grid = inject(GRID);
825
854
  _gridPattern = computed(() => this._grid._pattern, ...(ngDevMode ? [{
826
855
  debugName: "_gridPattern"
827
856
  }] : []));
@@ -833,17 +862,29 @@ class GridRow {
833
862
  cells: this._cellPatterns,
834
863
  grid: this._gridPattern
835
864
  });
865
+ constructor() {
866
+ afterNextRender(() => {
867
+ this._collection.startObserving(this.element);
868
+ });
869
+ }
870
+ ngOnInit() {
871
+ this._grid._collection.register(this);
872
+ }
873
+ ngOnDestroy() {
874
+ this._grid._collection.unregister(this);
875
+ this._collection.stopObserving();
876
+ }
836
877
  static ɵfac = i0.ɵɵngDeclareFactory({
837
878
  minVersion: "12.0.0",
838
- version: "22.0.0-next.6",
879
+ version: "22.0.0-next.10",
839
880
  ngImport: i0,
840
881
  type: GridRow,
841
882
  deps: [],
842
883
  target: i0.ɵɵFactoryTarget.Directive
843
884
  });
844
885
  static ɵdir = i0.ɵɵngDeclareDirective({
845
- minVersion: "17.2.0",
846
- version: "22.0.0-next.6",
886
+ minVersion: "17.1.0",
887
+ version: "22.0.0-next.10",
847
888
  type: GridRow,
848
889
  isStandalone: true,
849
890
  selector: "[ngGridRow]",
@@ -868,19 +909,13 @@ class GridRow {
868
909
  provide: GRID_ROW,
869
910
  useExisting: GridRow
870
911
  }],
871
- queries: [{
872
- propertyName: "_cells",
873
- predicate: GRID_CELL,
874
- descendants: true,
875
- isSignal: true
876
- }],
877
912
  exportAs: ["ngGridRow"],
878
913
  ngImport: i0
879
914
  });
880
915
  }
881
916
  i0.ɵɵngDeclareClassMetadata({
882
917
  minVersion: "12.0.0",
883
- version: "22.0.0-next.6",
918
+ version: "22.0.0-next.10",
884
919
  ngImport: i0,
885
920
  type: GridRow,
886
921
  decorators: [{
@@ -898,16 +933,8 @@ i0.ɵɵngDeclareClassMetadata({
898
933
  }]
899
934
  }]
900
935
  }],
936
+ ctorParameters: () => [],
901
937
  propDecorators: {
902
- _cells: [{
903
- type: i0.ContentChildren,
904
- args: [i0.forwardRef(() => GRID_CELL), {
905
- ...{
906
- descendants: true
907
- },
908
- isSignal: true
909
- }]
910
- }],
911
938
  rowIndex: [{
912
939
  type: i0.Input,
913
940
  args: [{