@angular/cdk-experimental 20.0.0-next.5 → 20.0.0-next.6

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.
@@ -3,7 +3,7 @@ import { inject, contentChildren, computed, input, booleanAttribute, model, Dire
3
3
  import { Directionality } from '@angular/cdk/bidi';
4
4
  import { toSignal } from '@angular/core/rxjs-interop';
5
5
  import { _IdGenerator } from '@angular/cdk/a11y';
6
- import { L as ListboxPattern, O as OptionPattern } from './option-a8c77cfa.mjs';
6
+ import { L as ListboxPattern, O as OptionPattern } from './option-7fdc6400.mjs';
7
7
 
8
8
  /**
9
9
  * A listbox container.
@@ -33,7 +33,7 @@ class CdkListbox {
33
33
  /** Whether the list is vertically or horizontally oriented. */
34
34
  orientation = input('vertical');
35
35
  /** Whether multiple items in the list can be selected at once. */
36
- multiselectable = input(false, { transform: booleanAttribute });
36
+ multi = input(false, { transform: booleanAttribute });
37
37
  /** Whether focus should wrap when navigating. */
38
38
  wrap = input(true, { transform: booleanAttribute });
39
39
  /** Whether disabled items in the list should be skipped when navigating. */
@@ -46,6 +46,8 @@ class CdkListbox {
46
46
  typeaheadDelay = input(0.5); // Picked arbitrarily.
47
47
  /** Whether the listbox is disabled. */
48
48
  disabled = input(false, { transform: booleanAttribute });
49
+ /** Whether the listbox is readonly. */
50
+ readonly = input(false, { transform: booleanAttribute });
49
51
  /** The values of the current selected items. */
50
52
  value = model([]);
51
53
  /** The current index that has been navigated to. */
@@ -56,10 +58,10 @@ class CdkListbox {
56
58
  items: this.items,
57
59
  textDirection: this.textDirection,
58
60
  });
59
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: CdkListbox, deps: [], target: i0.ɵɵFactoryTarget.Directive });
60
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.0.0-next.4", type: CdkListbox, isStandalone: true, selector: "[cdkListbox]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, multiselectable: { classPropertyName: "multiselectable", publicName: "multiselectable", isSignal: true, isRequired: false, transformFunction: null }, wrap: { classPropertyName: "wrap", publicName: "wrap", isSignal: true, isRequired: false, transformFunction: null }, skipDisabled: { classPropertyName: "skipDisabled", publicName: "skipDisabled", isSignal: true, isRequired: false, transformFunction: null }, focusMode: { classPropertyName: "focusMode", publicName: "focusMode", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, typeaheadDelay: { classPropertyName: "typeaheadDelay", publicName: "typeaheadDelay", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", activeIndex: "activeIndexChange" }, host: { attributes: { "role": "listbox" }, listeners: { "keydown": "pattern.onKeydown($event)", "pointerdown": "pattern.onPointerdown($event)" }, properties: { "attr.tabindex": "pattern.tabindex()", "attr.aria-disabled": "pattern.disabled()", "attr.aria-orientation": "pattern.orientation()", "attr.aria-multiselectable": "pattern.multiselectable()", "attr.aria-activedescendant": "pattern.activedescendant()" }, classAttribute: "cdk-listbox" }, queries: [{ propertyName: "_cdkOptions", predicate: CdkOption, descendants: true, isSignal: true }], exportAs: ["cdkListbox"], ngImport: i0 });
61
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkListbox, deps: [], target: i0.ɵɵFactoryTarget.Directive });
62
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.0.0-next.5", type: CdkListbox, isStandalone: true, selector: "[cdkListbox]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, multi: { classPropertyName: "multi", publicName: "multi", isSignal: true, isRequired: false, transformFunction: null }, wrap: { classPropertyName: "wrap", publicName: "wrap", isSignal: true, isRequired: false, transformFunction: null }, skipDisabled: { classPropertyName: "skipDisabled", publicName: "skipDisabled", isSignal: true, isRequired: false, transformFunction: null }, focusMode: { classPropertyName: "focusMode", publicName: "focusMode", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, typeaheadDelay: { classPropertyName: "typeaheadDelay", publicName: "typeaheadDelay", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, activeIndex: { classPropertyName: "activeIndex", publicName: "activeIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", activeIndex: "activeIndexChange" }, host: { attributes: { "role": "listbox" }, listeners: { "keydown": "pattern.onKeydown($event)", "pointerdown": "pattern.onPointerdown($event)" }, properties: { "attr.tabindex": "pattern.tabindex()", "attr.aria-readonly": "pattern.readonly()", "attr.aria-disabled": "pattern.disabled()", "attr.aria-orientation": "pattern.orientation()", "attr.aria-multiselectable": "pattern.multi()", "attr.aria-activedescendant": "pattern.activedescendant()" }, classAttribute: "cdk-listbox" }, queries: [{ propertyName: "_cdkOptions", predicate: CdkOption, descendants: true, isSignal: true }], exportAs: ["cdkListbox"], ngImport: i0 });
61
63
  }
62
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: CdkListbox, decorators: [{
64
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkListbox, decorators: [{
63
65
  type: Directive,
64
66
  args: [{
65
67
  selector: '[cdkListbox]',
@@ -68,9 +70,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4",
68
70
  'role': 'listbox',
69
71
  'class': 'cdk-listbox',
70
72
  '[attr.tabindex]': 'pattern.tabindex()',
73
+ '[attr.aria-readonly]': 'pattern.readonly()',
71
74
  '[attr.aria-disabled]': 'pattern.disabled()',
72
75
  '[attr.aria-orientation]': 'pattern.orientation()',
73
- '[attr.aria-multiselectable]': 'pattern.multiselectable()',
76
+ '[attr.aria-multiselectable]': 'pattern.multi()',
74
77
  '[attr.aria-activedescendant]': 'pattern.activedescendant()',
75
78
  '(keydown)': 'pattern.onKeydown($event)',
76
79
  '(pointerdown)': 'pattern.onPointerdown($event)',
@@ -110,10 +113,10 @@ class CdkOption {
110
113
  element: this.element,
111
114
  searchTerm: this.searchTerm,
112
115
  });
113
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: CdkOption, deps: [], target: i0.ɵɵFactoryTarget.Directive });
114
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.0-next.4", type: CdkOption, isStandalone: true, selector: "[cdkOption]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "option" }, properties: { "attr.tabindex": "pattern.tabindex()", "attr.aria-selected": "pattern.selected()", "attr.aria-disabled": "pattern.disabled()" }, classAttribute: "cdk-option" }, exportAs: ["cdkOption"], ngImport: i0 });
116
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkOption, deps: [], target: i0.ɵɵFactoryTarget.Directive });
117
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.0-next.5", type: CdkOption, isStandalone: true, selector: "[cdkOption]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "option" }, properties: { "attr.tabindex": "pattern.tabindex()", "attr.aria-selected": "pattern.selected()", "attr.aria-disabled": "pattern.disabled()" }, classAttribute: "cdk-option" }, exportAs: ["cdkOption"], ngImport: i0 });
115
118
  }
116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: CdkOption, decorators: [{
119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.5", ngImport: i0, type: CdkOption, decorators: [{
117
120
  type: Directive,
118
121
  args: [{
119
122
  selector: '[cdkOption]',
@@ -1 +1 @@
1
- {"version":3,"file":"listbox.mjs","sources":["../../../../../k8-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/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 {\n booleanAttribute,\n computed,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n} from '@angular/core';\nimport {ListboxPattern, OptionPattern} from '../ui-patterns';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {_IdGenerator} from '@angular/cdk/a11y';\n\n/**\n * A listbox container.\n *\n * Listboxes are used to display a list of items for a user to select from. The CdkListbox is meant\n * to be used in conjunction with CdkOption as follows:\n *\n * ```html\n * <ul cdkListbox>\n * <li cdkOption>Item 1</li>\n * <li cdkOption>Item 2</li>\n * <li cdkOption>Item 3</li>\n * </ul>\n * ```\n */\n@Directive({\n selector: '[cdkListbox]',\n exportAs: 'cdkListbox',\n host: {\n 'role': 'listbox',\n 'class': 'cdk-listbox',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.aria-orientation]': 'pattern.orientation()',\n '[attr.aria-multiselectable]': 'pattern.multiselectable()',\n '[attr.aria-activedescendant]': 'pattern.activedescendant()',\n '(keydown)': 'pattern.onKeydown($event)',\n '(pointerdown)': 'pattern.onPointerdown($event)',\n },\n})\nexport class CdkListbox<V> {\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n private readonly _directionality = inject(Directionality);\n\n /** The CdkOptions nested inside of the CdkListbox. */\n private readonly _cdkOptions = contentChildren(CdkOption, {descendants: true});\n\n /** A signal wrapper for directionality. */\n protected textDirection = toSignal(this._directionality.change, {\n initialValue: this._directionality.value,\n });\n\n /** The Option UIPatterns of the child CdkOptions. */\n protected items = computed(() => this._cdkOptions().map(option => option.pattern));\n\n /** Whether the list is vertically or horizontally oriented. */\n orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /** Whether multiple items in the list can be selected at once. */\n multiselectable = input(false, {transform: booleanAttribute});\n\n /** Whether focus should wrap when navigating. */\n wrap = input(true, {transform: booleanAttribute});\n\n /** Whether disabled items in the list should be skipped when navigating. */\n skipDisabled = input(true, {transform: booleanAttribute});\n\n /** The focus strategy used by the list. */\n focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** The selection strategy used by the list. */\n selectionMode = input<'follow' | 'explicit'>('follow');\n\n /** The amount of time before the typeahead search is reset. */\n typeaheadDelay = input<number>(0.5); // Picked arbitrarily.\n\n /** Whether the listbox is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** The values of the current selected items. */\n value = model<V[]>([]);\n\n /** The current index that has been navigated to. */\n activeIndex = model<number>(0);\n\n /** The Listbox UIPattern. */\n pattern: ListboxPattern<V> = new ListboxPattern<V>({\n ...this,\n items: this.items,\n textDirection: this.textDirection,\n });\n}\n\n/** A selectable option in a CdkListbox. */\n@Directive({\n selector: '[cdkOption]',\n exportAs: 'cdkOption',\n host: {\n 'role': 'option',\n 'class': 'cdk-option',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-selected]': 'pattern.selected()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n },\n})\nexport class CdkOption<V> {\n /** A reference to the option element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The parent CdkListbox. */\n private readonly _cdkListbox = inject(CdkListbox);\n\n /** A unique identifier for the option. */\n private readonly _generatedId = inject(_IdGenerator).getId('cdk-option-');\n\n // TODO(wagnermaciel): https://github.com/angular/components/pull/30495#discussion_r1972601144.\n /** A unique identifier for the option. */\n protected id = computed(() => this._generatedId);\n\n protected value = input.required<V>();\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 searchTerm = computed(() => this.label() ?? this.element().textContent);\n\n /** The parent Listbox UIPattern. */\n protected listbox = computed(() => this._cdkListbox.pattern);\n\n /** A reference to the option element to be focused on navigation. */\n protected element = computed(() => this._elementRef.nativeElement);\n\n /** Whether an item is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** The text used by the typeahead search. */\n label = input<string>();\n\n /** The Option UIPattern. */\n pattern = new OptionPattern<V>({\n ...this,\n id: this.id,\n value: this.value,\n listbox: this.listbox,\n element: this.element,\n searchTerm: this.searchTerm,\n });\n}\n"],"names":[],"mappings":";;;;;;;AAuBA;;;;;;;;;;;;;AAaG;MAgBU,UAAU,CAAA;;AAEJ,IAAA,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;;IAGxC,WAAW,GAAG,eAAe,CAAC,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC,CAAA;;IAGpE,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;A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EAAA,QAAA,EAAA,EAAA,UAAA,EAAA,EAAA,eAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,EAAA,cAAA,EAAA,YAAA,EAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;kGAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBAXrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,IAAI,EAAE;AACJ,wBAAA,MAAM,EAAE,QAAQ;AAChB,wBAAA,OAAO,EAAE,YAAY;AACrB,wBAAA,iBAAiB,EAAE,oBAAoB;AACvC,wBAAA,sBAAsB,EAAE,oBAAoB;AAC5C,wBAAA,sBAAsB,EAAE,oBAAoB;AAC7C,qBAAA;AACF,iBAAA,CAAA;;;;;"}
1
+ {"version":3,"file":"listbox.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/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 {\n booleanAttribute,\n computed,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n} from '@angular/core';\nimport {ListboxPattern, OptionPattern} from '../ui-patterns';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {_IdGenerator} from '@angular/cdk/a11y';\n\n/**\n * A listbox container.\n *\n * Listboxes are used to display a list of items for a user to select from. The CdkListbox is meant\n * to be used in conjunction with CdkOption as follows:\n *\n * ```html\n * <ul cdkListbox>\n * <li cdkOption>Item 1</li>\n * <li cdkOption>Item 2</li>\n * <li cdkOption>Item 3</li>\n * </ul>\n * ```\n */\n@Directive({\n selector: '[cdkListbox]',\n exportAs: 'cdkListbox',\n host: {\n 'role': 'listbox',\n 'class': 'cdk-listbox',\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 '(pointerdown)': 'pattern.onPointerdown($event)',\n },\n})\nexport class CdkListbox<V> {\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n private readonly _directionality = inject(Directionality);\n\n /** The CdkOptions nested inside of the CdkListbox. */\n private readonly _cdkOptions = contentChildren(CdkOption, {descendants: true});\n\n /** A signal wrapper for directionality. */\n protected textDirection = toSignal(this._directionality.change, {\n initialValue: this._directionality.value,\n });\n\n /** The Option UIPatterns of the child CdkOptions. */\n protected items = computed(() => this._cdkOptions().map(option => option.pattern));\n\n /** Whether the list is vertically or horizontally oriented. */\n orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /** Whether multiple items in the list can be selected at once. */\n multi = input(false, {transform: booleanAttribute});\n\n /** Whether focus should wrap when navigating. */\n wrap = input(true, {transform: booleanAttribute});\n\n /** Whether disabled items in the list should be skipped when navigating. */\n skipDisabled = input(true, {transform: booleanAttribute});\n\n /** The focus strategy used by the list. */\n focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** The selection strategy used by the list. */\n selectionMode = input<'follow' | 'explicit'>('follow');\n\n /** The amount of time before the typeahead search is reset. */\n typeaheadDelay = input<number>(0.5); // Picked arbitrarily.\n\n /** Whether the listbox is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the listbox is readonly. */\n readonly = input(false, {transform: booleanAttribute});\n\n /** The values of the current selected items. */\n value = model<V[]>([]);\n\n /** The current index that has been navigated to. */\n activeIndex = model<number>(0);\n\n /** The Listbox UIPattern. */\n pattern: ListboxPattern<V> = new ListboxPattern<V>({\n ...this,\n items: this.items,\n textDirection: this.textDirection,\n });\n}\n\n/** A selectable option in a CdkListbox. */\n@Directive({\n selector: '[cdkOption]',\n exportAs: 'cdkOption',\n host: {\n 'role': 'option',\n 'class': 'cdk-option',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-selected]': 'pattern.selected()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n },\n})\nexport class CdkOption<V> {\n /** A reference to the option element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The parent CdkListbox. */\n private readonly _cdkListbox = inject(CdkListbox);\n\n /** A unique identifier for the option. */\n private readonly _generatedId = inject(_IdGenerator).getId('cdk-option-');\n\n // TODO(wagnermaciel): https://github.com/angular/components/pull/30495#discussion_r1972601144.\n /** A unique identifier for the option. */\n protected id = computed(() => this._generatedId);\n\n protected value = input.required<V>();\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 searchTerm = computed(() => this.label() ?? this.element().textContent);\n\n /** The parent Listbox UIPattern. */\n protected listbox = computed(() => this._cdkListbox.pattern);\n\n /** A reference to the option element to be focused on navigation. */\n protected element = computed(() => this._elementRef.nativeElement);\n\n /** Whether an item is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** The text used by the typeahead search. */\n label = input<string>();\n\n /** The Option UIPattern. */\n pattern = new OptionPattern<V>({\n ...this,\n id: this.id,\n value: this.value,\n listbox: this.listbox,\n element: this.element,\n searchTerm: this.searchTerm,\n });\n}\n"],"names":[],"mappings":";;;;;;;AAuBA;;;;;;;;;;;;;AAaG;MAiBU,UAAU,CAAA;;AAEJ,IAAA,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;;IAGxC,WAAW,GAAG,eAAe,CAAC,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC,CAAA;;IAGpE,aAAa,GAAG,Q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BAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,UAAA,EAAA,EAAA,eAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA,EAAA,cAAA,EAAA,YAAA,EAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;kGAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBAXrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,IAAI,EAAE;AACJ,wBAAA,MAAM,EAAE,QAAQ;AAChB,wBAAA,OAAO,EAAE,YAAY;AACrB,wBAAA,iBAAiB,EAAE,oBAAoB;AACvC,wBAAA,sBAAsB,EAAE,oBAAoB;AAC5C,wBAAA,sBAAsB,EAAE,oBAAoB;AAC7C,qBAAA;AACF,iBAAA,CAAA;;;;;"}
@@ -156,7 +156,7 @@ class ListSelection {
156
156
  if (item.disabled() || this.inputs.value().includes(item.value())) {
157
157
  return;
158
158
  }
159
- if (!this.inputs.multiselectable()) {
159
+ if (!this.inputs.multi()) {
160
160
  this.deselectAll();
161
161
  }
162
162
  // TODO: Need to discuss when to drop this.
@@ -182,7 +182,7 @@ class ListSelection {
182
182
  }
183
183
  /** Selects all items in the list. */
184
184
  selectAll() {
185
- if (!this.inputs.multiselectable()) {
185
+ if (!this.inputs.multi()) {
186
186
  return; // Should we log a warning?
187
187
  }
188
188
  for (const item of this.inputs.items()) {
@@ -401,12 +401,14 @@ class ListboxPattern {
401
401
  orientation;
402
402
  /** Whether the listbox is disabled. */
403
403
  disabled;
404
+ /** Whether the listbox is readonly. */
405
+ readonly;
404
406
  /** The tabindex of the listbox. */
405
407
  tabindex = computed(() => this.focusManager.getListTabindex());
406
408
  /** The id of the current active item. */
407
409
  activedescendant = computed(() => this.focusManager.getActiveDescendant());
408
410
  /** Whether multiple items in the list can be selected at once. */
409
- multiselectable;
411
+ multi;
410
412
  /** The number of items in the listbox. */
411
413
  setsize = computed(() => this.navigation.inputs.items().length);
412
414
  /** Whether the listbox selection follows focus. */
@@ -430,6 +432,14 @@ class ListboxPattern {
430
432
  /** The keydown event manager for the listbox. */
431
433
  keydown = computed(() => {
432
434
  const manager = new KeyboardEventManager();
435
+ if (this.readonly()) {
436
+ return manager
437
+ .on(this.prevKey, () => this.prev())
438
+ .on(this.nextKey, () => this.next())
439
+ .on('Home', () => this.first())
440
+ .on('End', () => this.last())
441
+ .on(this.typeaheadRegexp, e => this.search(e.key));
442
+ }
433
443
  if (!this.followFocus()) {
434
444
  manager
435
445
  .on(this.prevKey, () => this.prev())
@@ -446,7 +456,7 @@ class ListboxPattern {
446
456
  .on('End', () => this.last({ selectOne: true }))
447
457
  .on(this.typeaheadRegexp, e => this.search(e.key, { selectOne: true }));
448
458
  }
449
- if (this.inputs.multiselectable()) {
459
+ if (this.inputs.multi()) {
450
460
  manager
451
461
  .on(ModifierKey.Shift, ' ', () => this._updateSelection({ selectFromAnchor: true }))
452
462
  .on(ModifierKey.Shift, 'Enter', () => this._updateSelection({ selectFromAnchor: true }))
@@ -456,18 +466,20 @@ class ListboxPattern {
456
466
  .on(ModifierKey.Ctrl | ModifierKey.Shift, 'End', () => this.last({ selectFromActive: true }))
457
467
  .on(ModifierKey.Ctrl, 'A', () => this._updateSelection({ selectAll: true }));
458
468
  }
459
- if (!this.followFocus() && this.inputs.multiselectable()) {
469
+ if (!this.followFocus() && this.inputs.multi()) {
460
470
  manager.on(' ', () => this._updateSelection({ toggle: true }));
461
471
  manager.on('Enter', () => this._updateSelection({ toggle: true }));
462
472
  }
463
- if (!this.followFocus() && !this.inputs.multiselectable()) {
473
+ if (!this.followFocus() && !this.inputs.multi()) {
464
474
  manager.on(' ', () => this._updateSelection({ toggleOne: true }));
465
475
  manager.on('Enter', () => this._updateSelection({ toggleOne: true }));
466
476
  }
467
- if (this.inputs.multiselectable() && this.followFocus()) {
477
+ if (this.inputs.multi() && this.followFocus()) {
468
478
  manager
469
479
  .on(ModifierKey.Ctrl, this.prevKey, () => this.prev())
470
480
  .on(ModifierKey.Ctrl, this.nextKey, () => this.next())
481
+ .on(ModifierKey.Ctrl, ' ', () => this._updateSelection({ toggle: true }))
482
+ .on(ModifierKey.Ctrl, 'Enter', () => this._updateSelection({ toggle: true }))
471
483
  .on(ModifierKey.Ctrl, 'Home', () => this.first()) // TODO: Not in spec but prob should be.
472
484
  .on(ModifierKey.Ctrl, 'End', () => this.last()); // TODO: Not in spec but prob should be.
473
485
  }
@@ -476,21 +488,22 @@ class ListboxPattern {
476
488
  /** The pointerdown event manager for the listbox. */
477
489
  pointerdown = computed(() => {
478
490
  const manager = new PointerEventManager();
479
- if (this.inputs.multiselectable()) {
480
- manager
491
+ if (this.readonly()) {
492
+ return manager.on(e => this.goto(e));
493
+ }
494
+ if (this.inputs.multi()) {
495
+ return manager
481
496
  .on(e => this.goto(e, { toggle: true }))
482
497
  .on(ModifierKey.Shift, e => this.goto(e, { selectFromActive: true }));
483
498
  }
484
- else {
485
- manager.on(e => this.goto(e, { toggleOne: true }));
486
- }
487
- return manager;
499
+ return manager.on(e => this.goto(e, { toggleOne: true }));
488
500
  });
489
501
  constructor(inputs) {
490
502
  this.inputs = inputs;
491
503
  this.disabled = inputs.disabled;
504
+ this.readonly = inputs.readonly;
492
505
  this.orientation = inputs.orientation;
493
- this.multiselectable = inputs.multiselectable;
506
+ this.multi = inputs.multi;
494
507
  this.navigation = new ListNavigation(inputs);
495
508
  this.selection = new ListSelection({ ...inputs, navigation: this.navigation });
496
509
  this.typeahead = new ListTypeahead({ ...inputs, navigation: this.navigation });
@@ -612,4 +625,4 @@ class OptionPattern {
612
625
  }
613
626
 
614
627
  export { ListboxPattern as L, OptionPattern as O };
615
- //# sourceMappingURL=option-a8c77cfa.mjs.map
628
+ //# sourceMappingURL=option-7fdc6400.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"option-7fdc6400.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/event-manager/event-manager.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/event-manager/keyboard-event-manager.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/event-manager/pointer-event-manager.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/list-selection/list-selection.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/list-typeahead/list-typeahead.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/list-navigation/list-navigation.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/list-focus/list-focus.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/listbox/listbox.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/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\n/**\n * An event that supports modifier keys.\n *\n * Matches the native KeyboardEvent, MouseEvent, and TouchEvent.\n */\nexport interface EventWithModifiers extends Event {\n ctrlKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n metaKey: boolean;\n}\n\n/**\n * Options that are applicable to all event handlers.\n *\n * This library has not yet had a need for stopPropagationImmediate.\n */\nexport interface EventHandlerOptions {\n stopPropagation: boolean;\n preventDefault: boolean;\n}\n\n/** A basic event handler. */\nexport type EventHandler<T extends Event> = (event: T) => void;\n\n/** A function that determines whether an event is to be handled. */\nexport type EventMatcher<T extends Event> = (event: T) => boolean;\n\n/** A config that specifies how to handle a particular event. */\nexport interface EventHandlerConfig<T extends Event> extends EventHandlerOptions {\n matcher: EventMatcher<T>;\n handler: EventHandler<T>;\n}\n\n/** Bit flag representation of the possible modifier keys that can be present on an event. */\nexport enum ModifierKey {\n None = 0,\n Ctrl = 0b1,\n Shift = 0b10,\n Alt = 0b100,\n Meta = 0b1000,\n}\n\nexport type ModifierInputs = ModifierKey | ModifierKey[];\n\n/**\n * Abstract base class for all event managers.\n *\n * Event managers are designed to normalize how event handlers are authored and create a safety net\n * for common event handling gotchas like remembering to call preventDefault or stopPropagation.\n */\nexport abstract class EventManager<T extends Event> {\n protected configs: EventHandlerConfig<T>[] = [];\n abstract options: EventHandlerOptions;\n\n /** Runs the handlers that match with the given event. */\n handle(event: T): void {\n for (const config of this.configs) {\n if (config.matcher(event)) {\n config.handler(event);\n\n if (config.preventDefault) {\n event.preventDefault();\n }\n\n if (config.stopPropagation) {\n event.stopPropagation();\n }\n }\n }\n }\n\n /** Configures the event manager to handle specific events. (See subclasses for more). */\n abstract on(...args: [...unknown[]]): this;\n}\n\n/** Gets bit flag representation of the modifier keys present on the given event. */\nexport function getModifiers(event: EventWithModifiers): number {\n return (\n (+event.ctrlKey && ModifierKey.Ctrl) |\n (+event.shiftKey && ModifierKey.Shift) |\n (+event.altKey && ModifierKey.Alt) |\n (+event.metaKey && ModifierKey.Meta)\n );\n}\n\n/**\n * Checks if the given event has modifiers that are an exact match for any of the given modifier\n * flag combinations.\n */\nexport function hasModifiers(event: EventWithModifiers, modifiers: ModifierInputs): boolean {\n const eventModifiers = getModifiers(event);\n const modifiersList = Array.isArray(modifiers) ? modifiers : [modifiers];\n return modifiersList.some(modifiers => eventModifiers === modifiers);\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 {SignalLike} from '../signal-like/signal-like';\nimport {\n EventHandler,\n EventHandlerOptions,\n EventManager,\n hasModifiers,\n ModifierInputs,\n ModifierKey,\n} from './event-manager';\n\n/**\n * Used to represent a keycode.\n *\n * This is used to match whether an events keycode should be handled. The ability to match using a\n * string, SignalLike, or Regexp gives us more flexibility when authoring event handlers.\n */\ntype KeyCode = string | SignalLike<string> | RegExp;\n\n/**\n * An event manager that is specialized for handling keyboard events. By default this manager stops\n * propagation and prevents default on all events it handles.\n */\nexport class KeyboardEventManager<T extends KeyboardEvent> extends EventManager<T> {\n options: EventHandlerOptions = {\n preventDefault: true,\n stopPropagation: true,\n };\n\n /** Configures this event manager to handle events with a specific key and no modifiers. */\n on(key: KeyCode, handler: EventHandler<T>): this;\n\n /** Configures this event manager to handle events with a specific modifer and key combination. */\n on(modifiers: ModifierInputs, key: KeyCode, handler: EventHandler<T>): this;\n\n on(...args: any[]) {\n const {modifiers, key, handler} = this._normalizeInputs(...args);\n\n this.configs.push({\n handler: handler,\n matcher: event => this._isMatch(event, key, modifiers),\n ...this.options,\n });\n\n return this;\n }\n\n private _normalizeInputs(...args: any[]) {\n const key = args.length === 3 ? args[1] : args[0];\n const handler = args.length === 3 ? args[2] : args[1];\n const modifiers = args.length === 3 ? args[0] : ModifierKey.None;\n\n return {\n key: key as KeyCode,\n handler: handler as EventHandler<T>,\n modifiers: modifiers as ModifierInputs,\n };\n }\n\n private _isMatch(event: T, key: KeyCode, modifiers: ModifierInputs) {\n if (!hasModifiers(event, modifiers)) {\n return false;\n }\n\n if (key instanceof RegExp) {\n return key.test(event.key);\n }\n\n const keyStr = typeof key === 'string' ? key : key();\n return keyStr.toLowerCase() === event.key.toLowerCase();\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 EventHandler,\n EventHandlerOptions,\n EventManager,\n hasModifiers,\n ModifierInputs,\n ModifierKey,\n} from './event-manager';\n\n/**\n * The different mouse buttons that may appear on a pointer event.\n */\nexport enum MouseButton {\n Main = 0,\n Auxiliary = 1,\n Secondary = 2,\n}\n\n/** An event manager that is specialized for handling pointer events. */\nexport class PointerEventManager<T extends PointerEvent> extends EventManager<T> {\n options: EventHandlerOptions = {\n preventDefault: false,\n stopPropagation: false,\n };\n\n /**\n * Configures this event manager to handle events with a specific modifer and mouse button\n * combination.\n */\n on(button: MouseButton, modifiers: ModifierInputs, handler: EventHandler<T>): this;\n\n /**\n * Configures this event manager to handle events with a specific mouse button and no modifiers.\n */\n on(modifiers: ModifierInputs, handler: EventHandler<T>): this;\n\n /**\n * Configures this event manager to handle events with the main mouse button and no modifiers.\n *\n * @param handler The handler function\n * @param options Options for whether to stop propagation or prevent default.\n */\n on(handler: EventHandler<T>): this;\n\n on(...args: any[]) {\n const {button, handler, modifiers} = this._normalizeInputs(...args);\n\n this.configs.push({\n handler,\n matcher: event => this._isMatch(event, button, modifiers),\n ...this.options,\n });\n return this;\n }\n\n private _normalizeInputs(...args: any[]) {\n if (args.length === 3) {\n return {\n button: args[0] as MouseButton,\n modifiers: args[1] as ModifierInputs,\n handler: args[2] as EventHandler<T>,\n };\n }\n\n if (typeof args[0] === 'number' && typeof args[1] === 'function') {\n return {\n button: MouseButton.Main,\n modifiers: args[0] as ModifierInputs,\n handler: args[1] as EventHandler<T>,\n };\n }\n\n return {\n button: MouseButton.Main,\n modifiers: ModifierKey.None,\n handler: args[0] as EventHandler<T>,\n };\n }\n\n _isMatch(event: PointerEvent, button: MouseButton, modifiers: ModifierInputs) {\n return button === (event.button ?? 0) && hasModifiers(event, modifiers);\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 {signal} from '@angular/core';\nimport {SignalLike, WritableSignalLike} from '../signal-like/signal-like';\nimport {ListNavigation, ListNavigationItem} from '../list-navigation/list-navigation';\n\n/** Represents an item in a collection, such as a listbox option, than can be selected. */\nexport interface ListSelectionItem<V> extends ListNavigationItem {\n /** The value of the item. */\n value: SignalLike<V>;\n\n /** Whether an item is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for a collection that contains selectable items. */\nexport interface ListSelectionInputs<T extends ListSelectionItem<V>, V> {\n /** The items in the list. */\n items: SignalLike<T[]>;\n\n /** Whether multiple items in the list can be selected at once. */\n multi: SignalLike<boolean>;\n\n /** The current value of the list selection. */\n value: WritableSignalLike<V[]>;\n\n /** The selection strategy used by the list. */\n selectionMode: SignalLike<'follow' | 'explicit'>;\n}\n\n/** Controls selection for a list of items. */\nexport class ListSelection<T extends ListSelectionItem<V>, V> {\n /** The value of the most recently selected item. */\n previousValue = signal<V | undefined>(undefined);\n\n /** The navigation controller of the parent list. */\n navigation: ListNavigation<T>;\n\n constructor(readonly inputs: ListSelectionInputs<T, V> & {navigation: ListNavigation<T>}) {\n this.navigation = inputs.navigation;\n }\n\n /** Selects the item at the current active index. */\n select(item?: T) {\n item = item ?? this.inputs.items()[this.inputs.navigation.inputs.activeIndex()];\n\n if (item.disabled() || this.inputs.value().includes(item.value())) {\n return;\n }\n\n if (!this.inputs.multi()) {\n this.deselectAll();\n }\n\n // TODO: Need to discuss when to drop this.\n this._anchor();\n this.inputs.value.update(values => values.concat(item.value()));\n }\n\n /** Deselects the item at the current active index. */\n deselect(item?: T) {\n item = item ?? this.inputs.items()[this.inputs.navigation.inputs.activeIndex()];\n\n if (!item.disabled()) {\n this.inputs.value.update(values => values.filter(value => value !== item.value()));\n }\n }\n\n /** Toggles the item at the current active index. */\n toggle() {\n const item = this.inputs.items()[this.inputs.navigation.inputs.activeIndex()];\n this.inputs.value().includes(item.value()) ? this.deselect() : this.select();\n }\n\n /** Toggles only the item at the current active index. */\n toggleOne() {\n const item = this.inputs.items()[this.inputs.navigation.inputs.activeIndex()];\n this.inputs.value().includes(item.value()) ? this.deselect() : this.selectOne();\n }\n\n /** Selects all items in the list. */\n selectAll() {\n if (!this.inputs.multi()) {\n return; // Should we log a warning?\n }\n\n for (const item of this.inputs.items()) {\n this.select(item);\n }\n\n this._anchor();\n }\n\n /** Deselects all items in the list. */\n deselectAll() {\n for (const item of this.inputs.items()) {\n this.deselect(item);\n }\n }\n\n /** Selects the items in the list starting at the last selected item. */\n selectFromPrevSelectedItem() {\n const previousValue = this.inputs.items().findIndex(i => this.previousValue() === i.value());\n this._selectFromIndex(previousValue);\n }\n\n /** Selects the items in the list starting at the last active item. */\n selectFromActive() {\n this._selectFromIndex(this.inputs.navigation.prevActiveIndex());\n }\n\n /** Selects the items in the list starting at the given index. */\n private _selectFromIndex(index: number) {\n if (index === -1) {\n return;\n }\n\n const upper = Math.max(this.inputs.navigation.inputs.activeIndex(), index);\n const lower = Math.min(this.inputs.navigation.inputs.activeIndex(), index);\n\n for (let i = lower; i <= upper; i++) {\n this.select(this.inputs.items()[i]);\n }\n }\n\n /** Sets the selection to only the current active item. */\n selectOne() {\n this.deselectAll();\n this.select();\n }\n\n /** Sets the anchor to the current active index. */\n private _anchor() {\n const item = this.inputs.items()[this.inputs.navigation.inputs.activeIndex()];\n this.previousValue.set(item.value());\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 {signal} from '@angular/core';\nimport {SignalLike} from '../signal-like/signal-like';\nimport {ListNavigationItem, ListNavigation} from '../list-navigation/list-navigation';\n\n/**\n * Represents an item in a collection, such as a listbox option, than can be navigated to by\n * typeahead.\n */\nexport interface ListTypeaheadItem extends ListNavigationItem {\n /** The text used by the typeahead search. */\n searchTerm: SignalLike<string>;\n}\n\n/**\n * Represents the required inputs for a collection that contains items that can be navigated to by\n * typeahead.\n */\nexport interface ListTypeaheadInputs {\n /** The amount of time before the typeahead search is reset. */\n typeaheadDelay: SignalLike<number>;\n}\n\n/** Controls typeahead for a list of items. */\nexport class ListTypeahead<T extends ListTypeaheadItem> {\n /** A reference to the timeout for resetting the typeahead search. */\n timeout?: ReturnType<typeof setTimeout> | undefined;\n\n /** The navigation controller of the parent list. */\n navigation: ListNavigation<T>;\n\n /** Keeps track of the characters that typeahead search is being called with. */\n private _query = signal('');\n\n /** The index where that the typeahead search was initiated from. */\n private _startIndex = signal<number | undefined>(undefined);\n\n constructor(readonly inputs: ListTypeaheadInputs & {navigation: ListNavigation<T>}) {\n this.navigation = inputs.navigation;\n }\n\n /** Performs a typeahead search, appending the given character to the search string. */\n search(char: string) {\n if (char.length !== 1) {\n return;\n }\n\n if (this._startIndex() === undefined) {\n this._startIndex.set(this.navigation.inputs.activeIndex());\n }\n\n clearTimeout(this.timeout);\n this._query.update(q => q + char.toLowerCase());\n const item = this._getItem();\n\n if (item) {\n this.navigation.goto(item);\n }\n\n this.timeout = setTimeout(() => {\n this._query.set('');\n this._startIndex.set(undefined);\n }, this.inputs.typeaheadDelay() * 1000);\n }\n\n /**\n * Returns the first item whose search term matches the\n * current query starting from the the current anchor index.\n */\n private _getItem() {\n let items = this.navigation.inputs.items();\n const after = items.slice(this._startIndex()! + 1);\n const before = items.slice(0, this._startIndex()!);\n items = this.navigation.inputs.wrap() ? after.concat(before) : after; // TODO: Always wrap?\n items.push(this.navigation.inputs.items()[this._startIndex()!]);\n\n const focusableItems = [];\n for (const item of items) {\n if (this.navigation.isFocusable(item)) {\n focusableItems.push(item);\n }\n }\n\n return focusableItems.find(i => i.searchTerm().toLowerCase().startsWith(this._query()));\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 {signal} from '@angular/core';\nimport {SignalLike, WritableSignalLike} from '../signal-like/signal-like';\n\n/** Represents an item in a collection, such as a listbox option, than can be navigated to. */\nexport interface ListNavigationItem {\n /** Whether an item is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for a collection that has navigable items. */\nexport interface ListNavigationInputs<T extends ListNavigationItem> {\n /** Whether focus should wrap when navigating. */\n wrap: SignalLike<boolean>;\n\n /** The items in the list. */\n items: SignalLike<T[]>;\n\n /** Whether disabled items in the list should be skipped when navigating. */\n skipDisabled: SignalLike<boolean>;\n\n /** The current index that has been navigated to. */\n activeIndex: WritableSignalLike<number>;\n\n /** Whether the list is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** The direction that text is read based on the users locale. */\n textDirection: SignalLike<'rtl' | 'ltr'>;\n}\n\n/** Controls navigation for a list of items. */\nexport class ListNavigation<T extends ListNavigationItem> {\n /** The last index that was active. */\n prevActiveIndex = signal(0);\n\n constructor(readonly inputs: ListNavigationInputs<T>) {}\n\n /** Navigates to the given item. */\n goto(item: T) {\n if (this.isFocusable(item)) {\n this.prevActiveIndex.set(this.inputs.activeIndex());\n const index = this.inputs.items().indexOf(item);\n this.inputs.activeIndex.set(index);\n }\n }\n\n /** Navigates to the next item in the list. */\n next() {\n this._advance(1);\n }\n\n /** Navigates to the previous item in the list. */\n prev() {\n this._advance(-1);\n }\n\n /** Navigates to the first item in the list. */\n first() {\n const item = this.inputs.items().find(i => this.isFocusable(i));\n\n if (item) {\n this.goto(item);\n }\n }\n\n /** Navigates to the last item in the list. */\n last() {\n const items = this.inputs.items();\n for (let i = items.length - 1; i >= 0; i--) {\n if (this.isFocusable(items[i])) {\n this.goto(items[i]);\n return;\n }\n }\n }\n\n /** Returns true if the given item can be navigated to. */\n isFocusable(item: T): boolean {\n return !item.disabled() || !this.inputs.skipDisabled();\n }\n\n /** Advances to the next or previous focusable item in the list based on the given delta. */\n private _advance(delta: 1 | -1) {\n const items = this.inputs.items();\n const itemCount = items.length;\n const startIndex = this.inputs.activeIndex();\n const step = (i: number) =>\n this.inputs.wrap() ? (i + delta + itemCount) % itemCount : i + delta;\n\n // If wrapping is enabled, this loop ultimately terminates when `i` gets back to `startIndex`\n // in the case that all options are disabled. If wrapping is disabled, the loop terminates\n // when the index goes out of bounds.\n for (let i = step(startIndex); i !== startIndex && i < itemCount && i >= 0; i = step(i)) {\n if (this.isFocusable(items[i])) {\n this.goto(items[i]);\n return;\n }\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 {SignalLike} from '../signal-like/signal-like';\nimport {ListNavigation, ListNavigationItem} from '../list-navigation/list-navigation';\n\n/** Represents an item in a collection, such as a listbox option, than may receive focus. */\nexport interface ListFocusItem extends ListNavigationItem {\n /** A unique identifier for the item. */\n id: SignalLike<string>;\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement>;\n}\n\n/** Represents the required inputs for a collection that contains focusable items. */\nexport interface ListFocusInputs<T extends ListFocusItem> {\n /** The focus strategy used by the list. */\n focusMode: SignalLike<'roving' | 'activedescendant'>;\n}\n\n/** Controls focus for a list of items. */\nexport class ListFocus<T extends ListFocusItem> {\n /** The navigation controller of the parent list. */\n navigation: ListNavigation<ListFocusItem>;\n\n constructor(readonly inputs: ListFocusInputs<T> & {navigation: ListNavigation<T>}) {\n this.navigation = inputs.navigation;\n }\n\n /** The id of the current active item. */\n getActiveDescendant(): string | undefined {\n if (this.inputs.focusMode() === 'roving') {\n return undefined;\n }\n if (this.navigation.inputs.items().length) {\n return this.navigation.inputs.items()[this.navigation.inputs.activeIndex()].id();\n }\n return undefined;\n }\n\n /** The tabindex for the list. */\n getListTabindex(): -1 | 0 {\n return this.inputs.focusMode() === 'activedescendant' ? 0 : -1;\n }\n\n /** Returns the tabindex for the given item. */\n getItemTabindex(item: T): -1 | 0 {\n if (this.inputs.focusMode() === 'activedescendant') {\n return -1;\n }\n const index = this.navigation.inputs.items().indexOf(item);\n return this.navigation.inputs.activeIndex() === index ? 0 : -1;\n }\n\n /** Focuses the current active item. */\n focus() {\n if (this.inputs.focusMode() === 'activedescendant') {\n return;\n }\n\n const item = this.navigation.inputs.items()[this.navigation.inputs.activeIndex()];\n item.element().focus();\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 {ModifierKey as Modifier} from '../behaviors/event-manager/event-manager';\nimport {KeyboardEventManager} from '../behaviors/event-manager/keyboard-event-manager';\nimport {PointerEventManager} from '../behaviors/event-manager/pointer-event-manager';\nimport {OptionPattern} from './option';\nimport {ListSelection, ListSelectionInputs} from '../behaviors/list-selection/list-selection';\nimport {ListTypeahead, ListTypeaheadInputs} from '../behaviors/list-typeahead/list-typeahead';\nimport {ListNavigation, ListNavigationInputs} from '../behaviors/list-navigation/list-navigation';\nimport {ListFocus, ListFocusInputs} from '../behaviors/list-focus/list-focus';\nimport {computed} from '@angular/core';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\n\n/** The selection operations that the listbox can perform. */\ninterface SelectOptions {\n select?: boolean;\n toggle?: boolean;\n toggleOne?: boolean;\n selectOne?: boolean;\n selectAll?: boolean;\n selectFromAnchor?: boolean;\n selectFromActive?: boolean;\n}\n\n/** Represents the required inputs for a listbox. */\nexport type ListboxInputs<V> = ListNavigationInputs<OptionPattern<V>> &\n ListSelectionInputs<OptionPattern<V>, V> &\n ListTypeaheadInputs &\n ListFocusInputs<OptionPattern<V>> & {\n disabled: SignalLike<boolean>;\n readonly: SignalLike<boolean>;\n };\n\n/** Controls the state of a listbox. */\nexport class ListboxPattern<V> {\n /** Controls navigation for the listbox. */\n navigation: ListNavigation<OptionPattern<V>>;\n\n /** Controls selection for the listbox. */\n selection: ListSelection<OptionPattern<V>, V>;\n\n /** Controls typeahead for the listbox. */\n typeahead: ListTypeahead<OptionPattern<V>>;\n\n /** Controls focus for the listbox. */\n focusManager: ListFocus<OptionPattern<V>>;\n\n /** Whether the list is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the listbox is disabled. */\n disabled: SignalLike<boolean>;\n\n /** Whether the listbox is readonly. */\n readonly: SignalLike<boolean>;\n\n /** The tabindex of the listbox. */\n tabindex = computed(() => this.focusManager.getListTabindex());\n\n /** The id of the current active item. */\n activedescendant = computed(() => this.focusManager.getActiveDescendant());\n\n /** Whether multiple items in the list can be selected at once. */\n multi: SignalLike<boolean>;\n\n /** The number of items in the listbox. */\n setsize = computed(() => this.navigation.inputs.items().length);\n\n /** Whether the listbox selection follows focus. */\n followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** The key used to navigate to the previous item in the list. */\n prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next item in the list. */\n nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The regexp used to decide if a key should trigger typeahead. */\n typeaheadRegexp = /^.$/; // TODO: Ignore spaces?\n\n /** The keydown event manager for the listbox. */\n keydown = computed(() => {\n const manager = new KeyboardEventManager();\n\n if (this.readonly()) {\n return manager\n .on(this.prevKey, () => this.prev())\n .on(this.nextKey, () => this.next())\n .on('Home', () => this.first())\n .on('End', () => this.last())\n .on(this.typeaheadRegexp, e => this.search(e.key));\n }\n\n if (!this.followFocus()) {\n manager\n .on(this.prevKey, () => this.prev())\n .on(this.nextKey, () => this.next())\n .on('Home', () => this.first())\n .on('End', () => this.last())\n .on(this.typeaheadRegexp, e => this.search(e.key));\n }\n\n if (this.followFocus()) {\n manager\n .on(this.prevKey, () => this.prev({selectOne: true}))\n .on(this.nextKey, () => this.next({selectOne: true}))\n .on('Home', () => this.first({selectOne: true}))\n .on('End', () => this.last({selectOne: true}))\n .on(this.typeaheadRegexp, e => this.search(e.key, {selectOne: true}));\n }\n\n if (this.inputs.multi()) {\n manager\n .on(Modifier.Shift, ' ', () => this._updateSelection({selectFromAnchor: true}))\n .on(Modifier.Shift, 'Enter', () => this._updateSelection({selectFromAnchor: true}))\n .on(Modifier.Shift, this.prevKey, () => this.prev({toggle: true}))\n .on(Modifier.Shift, this.nextKey, () => this.next({toggle: true}))\n .on(Modifier.Ctrl | Modifier.Shift, 'Home', () => this.first({selectFromActive: true}))\n .on(Modifier.Ctrl | Modifier.Shift, 'End', () => this.last({selectFromActive: true}))\n .on(Modifier.Ctrl, 'A', () => this._updateSelection({selectAll: true}));\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager.on(' ', () => this._updateSelection({toggle: true}));\n manager.on('Enter', () => this._updateSelection({toggle: true}));\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(' ', () => this._updateSelection({toggleOne: true}));\n manager.on('Enter', () => this._updateSelection({toggleOne: true}));\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on(Modifier.Ctrl, this.prevKey, () => this.prev())\n .on(Modifier.Ctrl, this.nextKey, () => this.next())\n .on(Modifier.Ctrl, ' ', () => this._updateSelection({toggle: true}))\n .on(Modifier.Ctrl, 'Enter', () => this._updateSelection({toggle: true}))\n .on(Modifier.Ctrl, 'Home', () => this.first()) // TODO: Not in spec but prob should be.\n .on(Modifier.Ctrl, 'End', () => this.last()); // TODO: Not in spec but prob should be.\n }\n\n return manager;\n });\n\n /** The pointerdown event manager for the listbox. */\n pointerdown = computed(() => {\n const manager = new PointerEventManager();\n\n if (this.readonly()) {\n return manager.on(e => this.goto(e));\n }\n\n if (this.inputs.multi()) {\n return manager\n .on(e => this.goto(e, {toggle: true}))\n .on(Modifier.Shift, e => this.goto(e, {selectFromActive: true}));\n }\n\n return manager.on(e => this.goto(e, {toggleOne: true}));\n });\n\n constructor(readonly inputs: ListboxInputs<V>) {\n this.disabled = inputs.disabled;\n this.readonly = inputs.readonly;\n this.orientation = inputs.orientation;\n this.multi = inputs.multi;\n\n this.navigation = new ListNavigation(inputs);\n this.selection = new ListSelection({...inputs, navigation: this.navigation});\n this.typeahead = new ListTypeahead({...inputs, navigation: this.navigation});\n this.focusManager = new ListFocus({...inputs, navigation: this.navigation});\n }\n\n /** Handles keydown events for the listbox. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n onPointerdown(event: PointerEvent) {\n if (!this.disabled()) {\n this.pointerdown().handle(event);\n }\n }\n\n /** Navigates to the first option in the listbox. */\n first(opts?: SelectOptions) {\n this.navigation.first();\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Navigates to the last option in the listbox. */\n last(opts?: SelectOptions) {\n this.navigation.last();\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Navigates to the next option in the listbox. */\n next(opts?: SelectOptions) {\n this.navigation.next();\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Navigates to the previous option in the listbox. */\n prev(opts?: SelectOptions) {\n this.navigation.prev();\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Navigates to the given item in the listbox. */\n goto(event: PointerEvent, opts?: SelectOptions) {\n const item = this._getItem(event);\n\n if (item) {\n this.navigation.goto(item);\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n }\n\n /** Handles typeahead search navigation for the listbox. */\n search(char: string, opts?: SelectOptions) {\n this.typeahead.search(char);\n this.focusManager.focus();\n this._updateSelection(opts);\n }\n\n /** Handles updating selection for the listbox. */\n private _updateSelection(opts?: SelectOptions) {\n if (opts?.select) {\n this.selection.select();\n }\n if (opts?.toggle) {\n this.selection.toggle();\n }\n if (opts?.toggleOne) {\n this.selection.toggleOne();\n }\n if (opts?.selectOne) {\n this.selection.selectOne();\n }\n if (opts?.selectAll) {\n this.selection.selectAll();\n }\n if (opts?.selectFromAnchor) {\n this.selection.selectFromPrevSelectedItem();\n }\n if (opts?.selectFromActive) {\n this.selection.selectFromActive();\n }\n }\n\n private _getItem(e: PointerEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n\n const element = e.target.closest('[role=\"option\"]'); // TODO: Use a different identifier.\n return this.inputs.items().find(i => i.element() === element);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed} from '@angular/core';\nimport {ListSelection, ListSelectionItem} from '../behaviors/list-selection/list-selection';\nimport {ListTypeaheadItem} from '../behaviors/list-typeahead/list-typeahead';\nimport {ListNavigation, ListNavigationItem} from '../behaviors/list-navigation/list-navigation';\nimport {ListFocus, ListFocusItem} from '../behaviors/list-focus/list-focus';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\n\n/**\n * Represents the properties exposed by a listbox that need to be accessed by an option.\n * This exists to avoid circular dependency errors between the listbox and option.\n */\ninterface ListboxPattern<V> {\n focusManager: ListFocus<OptionPattern<V>>;\n selection: ListSelection<OptionPattern<V>, V>;\n navigation: ListNavigation<OptionPattern<V>>;\n}\n\n/** Represents the required inputs for an option in a listbox. */\nexport interface OptionInputs<V>\n extends ListNavigationItem,\n ListSelectionItem<V>,\n ListTypeaheadItem,\n ListFocusItem {\n listbox: SignalLike<ListboxPattern<V> | undefined>;\n}\n\n/** Represents an option in a listbox. */\nexport class OptionPattern<V> {\n /** A unique identifier for the option. */\n id: SignalLike<string>;\n\n /** The value of the option. */\n value: SignalLike<V>;\n\n /** The position of the option in the list. */\n index = computed(\n () =>\n this.listbox()\n ?.navigation.inputs.items()\n .findIndex(i => i.id() === this.id()) ?? -1,\n );\n\n /** Whether the option is selected. */\n selected = computed(() => this.listbox()?.selection.inputs.value().includes(this.value()));\n\n /** Whether the option is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The text used by the typeahead search. */\n searchTerm: SignalLike<string>;\n\n /** A reference to the parent listbox. */\n listbox: SignalLike<ListboxPattern<V> | undefined>;\n\n /** The tabindex of the option. */\n tabindex = computed(() => this.listbox()?.focusManager.getItemTabindex(this));\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement>;\n\n constructor(args: OptionInputs<V>) {\n this.id = args.id;\n this.value = args.value;\n this.listbox = args.listbox;\n this.element = args.element;\n this.disabled = args.disabled;\n this.searchTerm = args.searchTerm;\n }\n}\n"],"names":["Modifier"],"mappings":";;AA0CA;AACA,IAAY,WAMX,CAAA;AAND,CAAA,UAAY,WAAW,EAAA;AACrB,IAAA,WAAA,CAAA,WAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;AACR,IAAA,WAAA,CAAA,WAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAU,CAAA;AACV,IAAA,WAAA,CAAA,WAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAY,CAAA;AACZ,IAAA,WAAA,CAAA,WAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,GAAA,KAAW,CAAA;AACX,IAAA,WAAA,CAAA,WAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EANW,WAAW,KAAX,WAAW,GAMtB,EAAA,CAAA,CAAA,CAAA;AAID;;;;;AAKG;MACmB,YAAY,CAAA;IACtB,OAAO,GAA4B,EAAE,CAAA;;AAI/C,IAAA,MAAM,CAAC,KAAQ,EAAA;AACb,QAAA,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE;AACjC,YAAA,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACzB,gBAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAErB,gBAAA,IAAI,MAAM,CAAC,cAAc,EAAE;oBACzB,KAAK,CAAC,cAAc,EAAE,CAAA;iBACxB;AAEA,gBAAA,IAAI,MAAM,CAAC,eAAe,EAAE;oBAC1B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IAAI,CAAC,OAAO,CAAA;AAC3B,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;AAC3B,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;AAC7B,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;KACnC;AACD;;;;"}
@@ -11,4 +11,4 @@ function closest(element, selector) {
11
11
  }
12
12
 
13
13
  export { closest as c };
14
- //# sourceMappingURL=polyfill-c4e47556.mjs.map
14
+ //# sourceMappingURL=polyfill-e71d02cf.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyfill-e71d02cf.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/popover-edit/polyfill.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\n/** closest implementation that is able to start from non-Element Nodes. */\nexport function closest(\n element: EventTarget | Element | null | undefined,\n selector: string,\n): Element | null {\n if (!(element instanceof Node)) {\n return null;\n }\n\n let curr: Node | null = element;\n while (curr != null && !(curr instanceof Element)) {\n curr = curr.parentNode;\n }\n\n return curr?.closest(selector) ?? null;\n}\n"],"names":[],"mappings":"AAQA;AACgB,SAAA,OAAO,CACrB,OAAiD,EACjD,QAAgB,EAAA;AAEhB,IAAA,IAAI,EAAE,OAAO,YAAY,IAAI,CAAC,EAAE;AAC9B,QAAA,OAAO,IAAI,CAAA;KACb;IAEA,IAAI,IAAI,GAAgB,OAAO,CAAA;IAC/B,OAAO,IAAI,IAAI,IAAI,IAAI,EAAE,IAAI,YAAY,OAAO,CAAC,EAAE;AACjD,QAAA,IAAI,GAAG,IAAI,CAAC,UAAU,CAAA;KACxB;IAEA,OAAO,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAA;AACxC;;;;"}