@angular/aria 21.0.0 → 21.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, contentChild, input, booleanAttribute, computed, signal, afterRenderEffect, Directive, model, untracked } from '@angular/core';
2
+ import { inject, ElementRef, contentChild, forwardRef, input, booleanAttribute, computed, signal, afterRenderEffect, Directive, model, untracked } from '@angular/core';
3
3
  import * as i1 from '@angular/aria/private';
4
4
  import { DeferredContentAware, ComboboxPattern, ComboboxDialogPattern, DeferredContent } from '@angular/aria/private';
5
5
  import { Directionality } from '@angular/cdk/bidi';
@@ -15,7 +15,7 @@ class Combobox {
15
15
  _deferredContentAware = inject(DeferredContentAware, {
16
16
  optional: true
17
17
  });
18
- popup = contentChild(ComboboxPopup, ...(ngDevMode ? [{
18
+ popup = contentChild(forwardRef(() => ComboboxPopup), ...(ngDevMode ? [{
19
19
  debugName: "popup"
20
20
  }] : []));
21
21
  filterMode = input('manual', ...(ngDevMode ? [{
@@ -80,7 +80,7 @@ class Combobox {
80
80
  }
81
81
  static ɵfac = i0.ɵɵngDeclareFactory({
82
82
  minVersion: "12.0.0",
83
- version: "20.2.0-next.2",
83
+ version: "21.0.0",
84
84
  ngImport: i0,
85
85
  type: Combobox,
86
86
  deps: [],
@@ -88,7 +88,7 @@ class Combobox {
88
88
  });
89
89
  static ɵdir = i0.ɵɵngDeclareDirective({
90
90
  minVersion: "17.2.0",
91
- version: "20.2.0-next.2",
91
+ version: "21.0.0",
92
92
  type: Combobox,
93
93
  isStandalone: true,
94
94
  selector: "[ngCombobox]",
@@ -144,7 +144,7 @@ class Combobox {
144
144
  queries: [{
145
145
  propertyName: "popup",
146
146
  first: true,
147
- predicate: ComboboxPopup,
147
+ predicate: i0.forwardRef(() => ComboboxPopup),
148
148
  descendants: true,
149
149
  isSignal: true
150
150
  }],
@@ -158,7 +158,7 @@ class Combobox {
158
158
  }
159
159
  i0.ɵɵngDeclareClassMetadata({
160
160
  minVersion: "12.0.0",
161
- version: "20.2.0-next.2",
161
+ version: "21.0.0",
162
162
  ngImport: i0,
163
163
  type: Combobox,
164
164
  decorators: [{
@@ -180,7 +180,55 @@ i0.ɵɵngDeclareClassMetadata({
180
180
  }
181
181
  }]
182
182
  }],
183
- ctorParameters: () => []
183
+ ctorParameters: () => [],
184
+ propDecorators: {
185
+ popup: [{
186
+ type: i0.ContentChild,
187
+ args: [forwardRef(() => ComboboxPopup), {
188
+ isSignal: true
189
+ }]
190
+ }],
191
+ filterMode: [{
192
+ type: i0.Input,
193
+ args: [{
194
+ isSignal: true,
195
+ alias: "filterMode",
196
+ required: false
197
+ }]
198
+ }],
199
+ disabled: [{
200
+ type: i0.Input,
201
+ args: [{
202
+ isSignal: true,
203
+ alias: "disabled",
204
+ required: false
205
+ }]
206
+ }],
207
+ readonly: [{
208
+ type: i0.Input,
209
+ args: [{
210
+ isSignal: true,
211
+ alias: "readonly",
212
+ required: false
213
+ }]
214
+ }],
215
+ firstMatch: [{
216
+ type: i0.Input,
217
+ args: [{
218
+ isSignal: true,
219
+ alias: "firstMatch",
220
+ required: false
221
+ }]
222
+ }],
223
+ alwaysExpanded: [{
224
+ type: i0.Input,
225
+ args: [{
226
+ isSignal: true,
227
+ alias: "alwaysExpanded",
228
+ required: false
229
+ }]
230
+ }]
231
+ }
184
232
  });
185
233
  class ComboboxInput {
186
234
  _elementRef = inject(ElementRef);
@@ -204,7 +252,7 @@ class ComboboxInput {
204
252
  }
205
253
  static ɵfac = i0.ɵɵngDeclareFactory({
206
254
  minVersion: "12.0.0",
207
- version: "20.2.0-next.2",
255
+ version: "21.0.0",
208
256
  ngImport: i0,
209
257
  type: ComboboxInput,
210
258
  deps: [],
@@ -212,7 +260,7 @@ class ComboboxInput {
212
260
  });
213
261
  static ɵdir = i0.ɵɵngDeclareDirective({
214
262
  minVersion: "17.1.0",
215
- version: "20.2.0-next.2",
263
+ version: "21.0.0",
216
264
  type: ComboboxInput,
217
265
  isStandalone: true,
218
266
  selector: "input[ngComboboxInput]",
@@ -249,7 +297,7 @@ class ComboboxInput {
249
297
  }
250
298
  i0.ɵɵngDeclareClassMetadata({
251
299
  minVersion: "12.0.0",
252
- version: "20.2.0-next.2",
300
+ version: "21.0.0",
253
301
  ngImport: i0,
254
302
  type: ComboboxInput,
255
303
  decorators: [{
@@ -270,12 +318,25 @@ i0.ɵɵngDeclareClassMetadata({
270
318
  }
271
319
  }]
272
320
  }],
273
- ctorParameters: () => []
321
+ ctorParameters: () => [],
322
+ propDecorators: {
323
+ value: [{
324
+ type: i0.Input,
325
+ args: [{
326
+ isSignal: true,
327
+ alias: "value",
328
+ required: false
329
+ }]
330
+ }, {
331
+ type: i0.Output,
332
+ args: ["valueChange"]
333
+ }]
334
+ }
274
335
  });
275
336
  class ComboboxPopupContainer {
276
337
  static ɵfac = i0.ɵɵngDeclareFactory({
277
338
  minVersion: "12.0.0",
278
- version: "20.2.0-next.2",
339
+ version: "21.0.0",
279
340
  ngImport: i0,
280
341
  type: ComboboxPopupContainer,
281
342
  deps: [],
@@ -283,7 +344,7 @@ class ComboboxPopupContainer {
283
344
  });
284
345
  static ɵdir = i0.ɵɵngDeclareDirective({
285
346
  minVersion: "14.0.0",
286
- version: "20.2.0-next.2",
347
+ version: "21.0.0",
287
348
  type: ComboboxPopupContainer,
288
349
  isStandalone: true,
289
350
  selector: "ng-template[ngComboboxPopupContainer]",
@@ -296,7 +357,7 @@ class ComboboxPopupContainer {
296
357
  }
297
358
  i0.ɵɵngDeclareClassMetadata({
298
359
  minVersion: "12.0.0",
299
- version: "20.2.0-next.2",
360
+ version: "21.0.0",
300
361
  ngImport: i0,
301
362
  type: ComboboxPopupContainer,
302
363
  decorators: [{
@@ -317,7 +378,7 @@ class ComboboxPopup {
317
378
  }] : []));
318
379
  static ɵfac = i0.ɵɵngDeclareFactory({
319
380
  minVersion: "12.0.0",
320
- version: "20.2.0-next.2",
381
+ version: "21.0.0",
321
382
  ngImport: i0,
322
383
  type: ComboboxPopup,
323
384
  deps: [],
@@ -325,7 +386,7 @@ class ComboboxPopup {
325
386
  });
326
387
  static ɵdir = i0.ɵɵngDeclareDirective({
327
388
  minVersion: "14.0.0",
328
- version: "20.2.0-next.2",
389
+ version: "21.0.0",
329
390
  type: ComboboxPopup,
330
391
  isStandalone: true,
331
392
  selector: "[ngComboboxPopup]",
@@ -335,7 +396,7 @@ class ComboboxPopup {
335
396
  }
336
397
  i0.ɵɵngDeclareClassMetadata({
337
398
  minVersion: "12.0.0",
338
- version: "20.2.0-next.2",
399
+ version: "21.0.0",
339
400
  ngImport: i0,
340
401
  type: ComboboxPopup,
341
402
  decorators: [{
@@ -374,7 +435,7 @@ class ComboboxDialog {
374
435
  }
375
436
  static ɵfac = i0.ɵɵngDeclareFactory({
376
437
  minVersion: "12.0.0",
377
- version: "20.2.0-next.2",
438
+ version: "21.0.0",
378
439
  ngImport: i0,
379
440
  type: ComboboxDialog,
380
441
  deps: [],
@@ -382,7 +443,7 @@ class ComboboxDialog {
382
443
  });
383
444
  static ɵdir = i0.ɵɵngDeclareDirective({
384
445
  minVersion: "14.0.0",
385
- version: "20.2.0-next.2",
446
+ version: "21.0.0",
386
447
  type: ComboboxDialog,
387
448
  isStandalone: true,
388
449
  selector: "dialog[ngComboboxDialog]",
@@ -404,7 +465,7 @@ class ComboboxDialog {
404
465
  }
405
466
  i0.ɵɵngDeclareClassMetadata({
406
467
  minVersion: "12.0.0",
407
- version: "20.2.0-next.2",
468
+ version: "21.0.0",
408
469
  ngImport: i0,
409
470
  type: ComboboxDialog,
410
471
  decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/aria/combobox/combobox.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 contentChild,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n signal,\n untracked,\n WritableSignal,\n} from '@angular/core';\nimport {\n DeferredContent,\n DeferredContentAware,\n ComboboxPattern,\n ComboboxListboxControls,\n ComboboxTreeControls,\n ComboboxDialogPattern,\n} from '@angular/aria/private';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {toSignal} from '@angular/core/rxjs-interop';\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@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})\nexport class Combobox<V> {\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n private readonly _directionality = inject(Directionality);\n\n /** A signal wrapper for directionality. */\n protected textDirection = toSignal(this._directionality.change, {\n initialValue: this._directionality.value,\n });\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 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/**\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@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 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/**\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@Directive({\n selector: 'ng-template[ngComboboxPopupContainer]',\n exportAs: 'ngComboboxPopupContainer',\n hostDirectives: [DeferredContent],\n})\nexport class ComboboxPopupContainer {}\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@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/**\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@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 _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"],"names":["Combobox","_directionality","inject","Directionality","textDirection","toSignal","change","initialValue","value","_elementRef","ElementRef","element","nativeElement","_deferredContentAware","DeferredContentAware","optional","popup","contentChild","ComboboxPopup","filterMode","input","disabled","transform","booleanAttribute","readonly","firstMatch","undefined","expanded","computed","alwaysExpanded","_pattern","inputElement","inputs","inputEl","ComboboxPattern","inputValue","signal","containerEl","popupControls","_controls","constructor","afterRenderEffect","set","contentVisible","isFocused","open","selected","close","deps","target","i0","ɵɵFactoryTarget","Directive","ɵdir","ɵɵngDeclareDirective","minVersion","version","type","descendants","isSignal","exportAs","hostDirectives","directive","i1","ngImport","decorators","args","selector","host","ComboboxInput","combobox","model","controls","ComboboxDialogPattern","items","untracked","onFilter","isStandalone","classPropertyName","publicName","isRequired","transformFunction","outputs","attributes","properties","ComboboxPopupContainer","DeferredContent","ComboboxDialog","_popup","id","showModal"],"mappings":";;;;;;;MAiFaA,QAAQ,CAAA;AAEFC,EAAAA,eAAe,GAAGC,MAAM,CAACC,cAAc,CAAC;EAG/CC,aAAa,GAAGC,QAAQ,CAAC,IAAI,CAACJ,eAAe,CAACK,MAAM,EAAE;AAC9DC,IAAAA,YAAY,EAAE,IAAI,CAACN,eAAe,CAACO;AACpC,GAAA,CAAC;AAGeC,EAAAA,WAAW,GAAGP,MAAM,CAACQ,UAAU,CAAC;AAGxCC,EAAAA,OAAO,GAAG,IAAI,CAACF,WAAW,CAACG,aAA4B;AAG/CC,EAAAA,qBAAqB,GAAGX,MAAM,CAACY,oBAAoB,EAAE;AAACC,IAAAA,QAAQ,EAAE;AAAK,GAAA,CAAC;EAG9EC,KAAK,GAAGC,YAAY,CAAmBC,aAAa;;WAAC;EAQ9DC,UAAU,GAAGC,KAAK,CAAyC,QAAQ;;WAAC;EAG3DC,QAAQ,GAAGD,KAAK,CAAC,KAAK;;AAAGE,IAAAA,SAAS,EAAEC;GAAgB,CAAA,GAAA,CAA5B;AAACD,IAAAA,SAAS,EAAEC;GAAiB,GAAC;EAGtDC,QAAQ,GAAGJ,KAAK,CAAC,KAAK;;AAAGE,IAAAA,SAAS,EAAEC;GAAgB,CAAA,GAAA,CAA5B;AAACD,IAAAA,SAAS,EAAEC;GAAiB,GAAC;EAGtDE,UAAU,GAAGL,KAAK,CAAgBM,SAAS;;WAAC;EAG5CC,QAAQ,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACC,cAAc,EAAE,IAAI,IAAI,CAACC,QAAQ,CAACH,QAAQ,EAAE;;WAAC;EAM5EE,cAAc,GAAGT,KAAK,CAAC,KAAK;;AAAGE,IAAAA,SAAS,EAAEC;GAAgB,CAAA,GAAA,CAA5B;AAACD,IAAAA,SAAS,EAAEC;GAAiB,GAAC;AAG5DQ,EAAAA,YA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tCdrE;AAAa,KAAA,CAAA;AAAA8C,IAAAA,QAAA,EAAAd;AAAA,GAAA,CAAA;;;;;;QAsCbqC,cAAc;AAAAtB,EAAAA,UAAA,EAAA,CAAA;UAV1Bb,SAAS;AAACc,IAAAA,IAAA,EAAA,CAAA;AACTC,MAAAA,QAAQ,EAAE,0BAA0B;AACpCP,MAAAA,QAAQ,EAAE,kBAAkB;AAC5BQ,MAAAA,IAAI,EAAE;AACJ,QAAA,kBAAkB,EAAE,8BAA8B;AAClD,QAAA,WAAW,EAAE,4BAA4B;AACzC,QAAA,SAAS,EAAE;OACZ;MACDP,cAAc,EAAE,CAAC3C,aAAa;KAC/B;;;;;;;"}
1
+ {"version":3,"file":"combobox.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/aria/combobox/combobox.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 contentChild,\n Directive,\n ElementRef,\n forwardRef,\n inject,\n input,\n model,\n signal,\n untracked,\n WritableSignal,\n} from '@angular/core';\nimport {\n DeferredContent,\n DeferredContentAware,\n ComboboxPattern,\n ComboboxListboxControls,\n ComboboxTreeControls,\n ComboboxDialogPattern,\n} from '@angular/aria/private';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {toSignal} from '@angular/core/rxjs-interop';\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@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})\nexport class Combobox<V> {\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n private readonly _directionality = inject(Directionality);\n\n /** A signal wrapper for directionality. */\n protected textDirection = toSignal(this._directionality.change, {\n initialValue: this._directionality.value,\n });\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>>(\n // We need a `forwardRef` here, because the popup class is declared further down\n // in the same file. When the reference is written to Angular's metadata this can\n // cause an attempt to access the class before it's defined.\n forwardRef(() => ComboboxPopup),\n );\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 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/**\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@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 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/**\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@Directive({\n selector: 'ng-template[ngComboboxPopupContainer]',\n exportAs: 'ngComboboxPopupContainer',\n hostDirectives: [DeferredContent],\n})\nexport class ComboboxPopupContainer {}\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@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/**\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@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 _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"],"names":["Combobox","_directionality","inject","Directionality","textDirection","toSignal","change","initialValue","value","_elementRef","ElementRef","element","nativeElement","_deferredContentAware","DeferredContentAware","optional","popup","contentChild","forwardRef","ComboboxPopup","filterMode","input","disabled","transform","booleanAttribute","readonly","firstMatch","undefined","expanded","computed","alwaysExpanded","_pattern","inputElement","inputs","inputEl","ComboboxPattern","inputValue","signal","containerEl","popupControls","_controls","constructor","afterRenderEffect","set","contentVisible","isFocused","open","selected","close","deps","target","i0","ɵɵFactoryTarget","Directive","ɵdir","ɵɵngDeclareDirective","minVersion","version","type","descendants","isSignal","exportAs","hostDirectives","directive","i1","ngImport","decorators","args","selector","host","Input","alias","required","ComboboxInput","combobox","model","controls","ComboboxDialogPattern","items","untracked","onFilter","isStandalone","classPropertyName","publicName","isRequired","transformFunction","outputs","attributes","properties","ComboboxPopupContainer","DeferredContent","ComboboxDialog","_popup","id","showModal"],"mappings":";;;;;;;MAkFaA,QAAQ,CAAA;AAEFC,EAAAA,eAAe,GAAGC,MAAM,CAACC,cAAc,CAAC;EAG/CC,aAAa,GAAGC,QAAQ,CAAC,IAAI,CAACJ,eAAe,CAACK,MAAM,EAAE;AAC9DC,IAAAA,YAAY,EAAE,IAAI,CAACN,eAAe,CAACO;AACpC,GAAA,CAAC;AAGeC,EAAAA,WAAW,GAAGP,MAAM,CAACQ,UAAU,CAAC;AAGxCC,EAAAA,OAAO,GAAG,IAAI,CAACF,WAAW,CAACG,aAA4B;AAG/CC,EAAAA,qBAAqB,GAAGX,MAAM,CAACY,oBAAo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