@angular/cdk-experimental 21.0.0-next.4 → 21.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.
Files changed (89) hide show
  1. package/fesm2022/{accordion2.mjs → _accordion-chunk.mjs} +4 -3
  2. package/fesm2022/_accordion-chunk.mjs.map +1 -0
  3. package/fesm2022/_combobox-chunk.mjs +278 -0
  4. package/fesm2022/_combobox-chunk.mjs.map +1 -0
  5. package/fesm2022/{option.mjs → _combobox-listbox-chunk.mjs} +55 -8
  6. package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -0
  7. package/fesm2022/_combobox-tree-chunk.mjs +398 -0
  8. package/fesm2022/_combobox-tree-chunk.mjs.map +1 -0
  9. package/fesm2022/{expansion.mjs → _expansion-chunk.mjs} +2 -2
  10. package/fesm2022/_expansion-chunk.mjs.map +1 -0
  11. package/fesm2022/{list.mjs → _list-chunk.mjs} +9 -5
  12. package/fesm2022/_list-chunk.mjs.map +1 -0
  13. package/fesm2022/_list-navigation-chunk.mjs +131 -0
  14. package/fesm2022/_list-navigation-chunk.mjs.map +1 -0
  15. package/fesm2022/{list-navigation.mjs → _pointer-event-manager-chunk.mjs} +2 -118
  16. package/fesm2022/_pointer-event-manager-chunk.mjs.map +1 -0
  17. package/fesm2022/{polyfill.mjs → _polyfill-chunk.mjs} +1 -1
  18. package/fesm2022/_polyfill-chunk.mjs.map +1 -0
  19. package/fesm2022/{tabs2.mjs → _tabs-chunk.mjs} +4 -4
  20. package/fesm2022/_tabs-chunk.mjs.map +1 -0
  21. package/fesm2022/_toolbar-chunk.mjs +273 -0
  22. package/fesm2022/_toolbar-chunk.mjs.map +1 -0
  23. package/fesm2022/_toolbar-radio-group-chunk.mjs +222 -0
  24. package/fesm2022/_toolbar-radio-group-chunk.mjs.map +1 -0
  25. package/fesm2022/accordion.mjs +4 -3
  26. package/fesm2022/accordion.mjs.map +1 -1
  27. package/fesm2022/cdk-experimental.mjs +1 -1
  28. package/fesm2022/cdk-experimental.mjs.map +1 -1
  29. package/fesm2022/column-resize.mjs +1 -1
  30. package/fesm2022/combobox.mjs +99 -308
  31. package/fesm2022/combobox.mjs.map +1 -1
  32. package/fesm2022/deferred-content.mjs +6 -7
  33. package/fesm2022/deferred-content.mjs.map +1 -1
  34. package/fesm2022/listbox.mjs +53 -12
  35. package/fesm2022/listbox.mjs.map +1 -1
  36. package/fesm2022/popover-edit.mjs +1 -1
  37. package/fesm2022/radio-group.mjs +42 -47
  38. package/fesm2022/radio-group.mjs.map +1 -1
  39. package/fesm2022/tabs.mjs +5 -4
  40. package/fesm2022/tabs.mjs.map +1 -1
  41. package/fesm2022/toolbar.mjs +69 -19
  42. package/fesm2022/toolbar.mjs.map +1 -1
  43. package/fesm2022/tree.mjs +57 -344
  44. package/fesm2022/tree.mjs.map +1 -1
  45. package/fesm2022/ui-patterns.mjs +11 -8
  46. package/fesm2022/ui-patterns.mjs.map +1 -1
  47. package/package.json +18 -18
  48. package/{accordion.d.d.ts → types/_accordion-chunk.d.ts} +3 -2
  49. package/types/_combobox-chunk.d.ts +138 -0
  50. package/{expansion.d.d.ts → types/_expansion-chunk.d.ts} +2 -2
  51. package/{list.d.d.ts → types/_list-chunk.d.ts} +4 -2
  52. package/{pointer-event-manager.d.d.ts → types/_list-navigation-chunk.d.ts} +7 -96
  53. package/{listbox.d.d.ts → types/_listbox-chunk.d.ts} +8 -4
  54. package/types/_pointer-event-manager-chunk.d.ts +98 -0
  55. package/types/_radio-group-chunk.d.ts +92 -0
  56. package/{tabs.d.d.ts → types/_tabs-chunk.d.ts} +4 -3
  57. package/types/_toolbar-chunk.d.ts +150 -0
  58. package/types/_tree-chunk.d.ts +139 -0
  59. package/{accordion/index.d.ts → types/accordion.d.ts} +4 -3
  60. package/types/combobox.d.ts +54 -0
  61. package/{deferred-content/index.d.ts → types/deferred-content.d.ts} +3 -3
  62. package/{listbox/index.d.ts → types/listbox.d.ts} +15 -5
  63. package/{radio-group/index.d.ts → types/radio-group.d.ts} +21 -23
  64. package/{tabs/index.d.ts → types/tabs.d.ts} +5 -4
  65. package/types/toolbar.d.ts +115 -0
  66. package/{tree/index.d.ts → types/tree.d.ts} +17 -137
  67. package/types/ui-patterns.d.ts +157 -0
  68. package/combobox/index.d.ts +0 -94
  69. package/fesm2022/accordion2.mjs.map +0 -1
  70. package/fesm2022/expansion.mjs.map +0 -1
  71. package/fesm2022/list-navigation.mjs.map +0 -1
  72. package/fesm2022/list.mjs.map +0 -1
  73. package/fesm2022/option.mjs.map +0 -1
  74. package/fesm2022/polyfill.mjs.map +0 -1
  75. package/fesm2022/radio-group2.mjs +0 -143
  76. package/fesm2022/radio-group2.mjs.map +0 -1
  77. package/fesm2022/tabs2.mjs.map +0 -1
  78. package/fesm2022/toolbar2.mjs +0 -224
  79. package/fesm2022/toolbar2.mjs.map +0 -1
  80. package/radio-group.d.d.ts +0 -80
  81. package/toolbar/index.d.ts +0 -91
  82. package/toolbar.d.d.ts +0 -136
  83. package/ui-patterns/index.d.ts +0 -9
  84. /package/{index.d.ts → types/cdk-experimental.d.ts} +0 -0
  85. /package/{column-resize/index.d.ts → types/column-resize.d.ts} +0 -0
  86. /package/{popover-edit/index.d.ts → types/popover-edit.d.ts} +0 -0
  87. /package/{scrolling/index.d.ts → types/scrolling.d.ts} +0 -0
  88. /package/{selection/index.d.ts → types/selection.d.ts} +0 -0
  89. /package/{table-scroll-container/index.d.ts → types/table-scroll-container.d.ts} +0 -0
@@ -1,6 +1,7 @@
1
1
  import { computed } from '@angular/core';
2
- import { ListExpansion, ExpansionControl } from './expansion.mjs';
3
- import { ListFocus, ListNavigation, KeyboardEventManager, PointerEventManager } from './list-navigation.mjs';
2
+ import { ListExpansion, ExpansionControl } from './_expansion-chunk.mjs';
3
+ import { ListFocus, ListNavigation } from './_list-navigation-chunk.mjs';
4
+ import { KeyboardEventManager, PointerEventManager } from './_pointer-event-manager-chunk.mjs';
4
5
 
5
6
  const focusMode = () => 'roving';
6
7
  /** A pattern controls the nested Accordions. */
@@ -149,4 +150,4 @@ class AccordionPanelPattern {
149
150
  }
150
151
 
151
152
  export { AccordionGroupPattern, AccordionPanelPattern, AccordionTriggerPattern };
152
- //# sourceMappingURL=accordion2.mjs.map
153
+ //# sourceMappingURL=_accordion-chunk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_accordion-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/accordion/accordion.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 {computed} from '@angular/core';\nimport {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {\n ExpansionItem,\n ExpansionControl,\n ListExpansion,\n ListExpansionInputs,\n} from '../behaviors/expansion/expansion';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../behaviors/list-focus/list-focus';\nimport {\n ListNavigation,\n ListNavigationInputs,\n ListNavigationItem,\n} from '../behaviors/list-navigation/list-navigation';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\n\n/** Inputs of the AccordionGroupPattern. */\nexport type AccordionGroupInputs = Omit<\n ListNavigationInputs<AccordionTriggerPattern> &\n ListFocusInputs<AccordionTriggerPattern> &\n Omit<ListExpansionInputs, 'items'>,\n 'focusMode'\n>;\n\nconst focusMode = () => 'roving' as const;\n\nexport interface AccordionGroupPattern extends AccordionGroupInputs {}\n/** A pattern controls the nested Accordions. */\nexport class AccordionGroupPattern {\n /** Controls navigation for the group. */\n navigation: ListNavigation<AccordionTriggerPattern>;\n\n /** Controls focus for the group. */\n focusManager: ListFocus<AccordionTriggerPattern>;\n\n /** Controls expansion for the group. */\n expansionManager: ListExpansion;\n\n constructor(readonly inputs: AccordionGroupInputs) {\n this.wrap = inputs.wrap;\n this.orientation = inputs.orientation;\n this.textDirection = inputs.textDirection;\n this.activeItem = inputs.activeItem;\n this.disabled = inputs.disabled;\n this.multiExpandable = inputs.multiExpandable;\n this.items = inputs.items;\n this.expandedIds = inputs.expandedIds;\n this.skipDisabled = inputs.skipDisabled;\n this.focusManager = new ListFocus({\n ...inputs,\n focusMode,\n });\n this.navigation = new ListNavigation({\n ...inputs,\n focusMode,\n focusManager: this.focusManager,\n });\n this.expansionManager = new ListExpansion({\n ...inputs,\n });\n }\n}\n\n/** Inputs for the AccordionTriggerPattern. */\nexport type AccordionTriggerInputs = Omit<ListNavigationItem & ListFocusItem, 'index'> &\n Omit<ExpansionItem, 'expansionId' | 'expandable'> & {\n /** A local unique identifier for the trigger. */\n value: SignalLike<string>;\n\n /** The parent accordion group that controls this trigger. */\n accordionGroup: SignalLike<AccordionGroupPattern>;\n\n /** The accordion panel controlled by this trigger. */\n accordionPanel: SignalLike<AccordionPanelPattern | undefined>;\n };\n\nexport interface AccordionTriggerPattern extends AccordionTriggerInputs {}\n/** A pattern controls the expansion state of an accordion. */\nexport class AccordionTriggerPattern {\n /** Whether this tab has expandable content. */\n expandable: SignalLike<boolean>;\n\n /** The unique identifier used by the expansion behavior. */\n expansionId: SignalLike<string>;\n\n /** Whether an accordion is expanded. */\n expanded: SignalLike<boolean>;\n\n /** Controls the expansion state for the trigger. */\n expansionControl: ExpansionControl;\n\n /** Whether the trigger is active. */\n active = computed(() => this.inputs.accordionGroup().activeItem() === this);\n\n /** Id of the accordion panel controlled by the trigger. */\n controls = computed(() => this.inputs.accordionPanel()?.id());\n\n /** The tabindex of the trigger. */\n tabindex = computed(() => (this.inputs.accordionGroup().focusManager.isFocusable(this) ? 0 : -1));\n\n /** Whether the trigger is disabled. Disabling an accordion group disables all the triggers. */\n disabled = computed(() => this.inputs.disabled() || this.inputs.accordionGroup().disabled());\n\n /** The index of the trigger within its accordion group. */\n index = computed(() => this.inputs.accordionGroup().items().indexOf(this));\n\n constructor(readonly inputs: AccordionTriggerInputs) {\n this.id = inputs.id;\n this.element = inputs.element;\n this.value = inputs.value;\n this.accordionGroup = inputs.accordionGroup;\n this.accordionPanel = inputs.accordionPanel;\n this.expansionControl = new ExpansionControl({\n ...inputs,\n expansionId: inputs.value,\n expandable: () => true,\n expansionManager: inputs.accordionGroup().expansionManager,\n });\n this.expandable = this.expansionControl.isExpandable;\n this.expansionId = this.expansionControl.expansionId;\n this.expanded = this.expansionControl.isExpanded;\n }\n\n /** The key used to navigate to the previous accordion trigger. */\n prevKey = computed(() => {\n if (this.inputs.accordionGroup().orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.accordionGroup().textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next accordion trigger. */\n nextKey = computed(() => {\n if (this.inputs.accordionGroup().orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.accordionGroup().textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The keydown event manager for the accordion trigger. */\n keydown = computed(() => {\n return new KeyboardEventManager()\n .on(this.prevKey, () => this.accordionGroup().navigation.prev())\n .on(this.nextKey, () => this.accordionGroup().navigation.next())\n .on('Home', () => this.accordionGroup().navigation.first())\n .on('End', () => this.accordionGroup().navigation.last())\n .on(' ', () => this.expansionControl.toggle())\n .on('Enter', () => this.expansionControl.toggle());\n });\n\n /** The pointerdown event manager for the accordion trigger. */\n pointerdown = computed(() => {\n return new PointerEventManager().on(e => {\n const item = this._getItem(e);\n\n if (item) {\n this.accordionGroup().navigation.goto(item);\n this.expansionControl.toggle();\n }\n });\n });\n\n /** Handles keydown events on the trigger, delegating to the group if not disabled. */\n onKeydown(event: KeyboardEvent): void {\n this.keydown().handle(event);\n }\n\n /** Handles pointerdown events on the trigger, delegating to the group if not disabled. */\n onPointerdown(event: PointerEvent): void {\n this.pointerdown().handle(event);\n }\n\n /** Handles focus events on the trigger. This ensures the tabbing changes the active index. */\n onFocus(event: FocusEvent): void {\n const item = this._getItem(event);\n\n if (item && this.inputs.accordionGroup().focusManager.isFocusable(item)) {\n this.accordionGroup().focusManager.focus(item);\n }\n }\n\n private _getItem(e: Event) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n\n const element = e.target.closest('[role=\"button\"]');\n return this.accordionGroup()\n .items()\n .find(i => i.element() === element);\n }\n}\n\n/** Represents the required inputs for the AccordionPanelPattern. */\nexport interface AccordionPanelInputs {\n /** A global unique identifier for the panel. */\n id: SignalLike<string>;\n\n /** A local unique identifier for the panel, matching its trigger's value. */\n value: SignalLike<string>;\n\n /** The parent accordion trigger that controls this panel. */\n accordionTrigger: SignalLike<AccordionTriggerPattern | undefined>;\n}\n\nexport interface AccordionPanelPattern extends AccordionPanelInputs {}\n/** Represents an accordion panel. */\nexport class AccordionPanelPattern {\n /** Whether the accordion panel is hidden. True if the associated trigger is not expanded. */\n hidden: SignalLike<boolean>;\n\n constructor(readonly inputs: AccordionPanelInputs) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.accordionTrigger = inputs.accordionTrigger;\n this.hidden = computed(() => inputs.accordionTrigger()?.expanded() === false);\n }\n}\n"],"names":[],"mappings":";;;;;AAgCA,MAAM,SAAS,GAAG,MAAM,QAAiB;AAGzC;MACa,qBAAqB,CAAA;AAUX,IAAA,MAAA;;AARrB,IAAA,UAAU;;AAGV,IAAA,YAAY;;AAGZ,IAAA,gBAAgB;AAEhB,IAAA,WAAA,CAAqB,MAA4B,EAAA;QAA5B,IAAM,CAAA,MAAA,GAAN,MAAM;AACzB,QAAA,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI;AACvB,QAAA,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW;AACrC,QAAA,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa;AACzC,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU;AACnC,QAAA,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ;AAC/B,QAAA,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe;AAC7C,QAAA,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;;;;"}
@@ -0,0 +1,278 @@
1
+ import { signal, computed } from '@angular/core';
2
+ import { KeyboardEventManager, PointerEventManager } from './_pointer-event-manager-chunk.mjs';
3
+
4
+ /** Controls the state of a combobox. */
5
+ class ComboboxPattern {
6
+ inputs;
7
+ /** Whether the combobox is expanded. */
8
+ expanded = signal(false);
9
+ /** The ID of the active item in the combobox. */
10
+ activedescendant = computed(() => this.inputs.popupControls()?.activeId() ?? null);
11
+ /** The currently highlighted item in the combobox. */
12
+ highlightedItem = signal(undefined);
13
+ /** Whether the most recent input event was a deletion. */
14
+ isDeleting = false;
15
+ /** Whether the combobox is focused. */
16
+ isFocused = signal(false);
17
+ /** The key used to navigate to the previous item in the list. */
18
+ expandKey = computed(() => 'ArrowRight'); // TODO: RTL support.
19
+ /** The key used to navigate to the next item in the list. */
20
+ collapseKey = computed(() => 'ArrowLeft'); // TODO: RTL support.
21
+ /** The ID of the popup associated with the combobox. */
22
+ popupId = computed(() => this.inputs.popupControls()?.id() || null);
23
+ /** The autocomplete behavior of the combobox. */
24
+ autocomplete = computed(() => (this.inputs.filterMode() === 'highlight' ? 'both' : 'list'));
25
+ /** The ARIA role of the popup associated with the combobox. */
26
+ hasPopup = computed(() => this.inputs.popupControls()?.role() || null);
27
+ /** The keydown event manager for the combobox. */
28
+ keydown = computed(() => {
29
+ if (!this.expanded()) {
30
+ return new KeyboardEventManager()
31
+ .on('ArrowDown', () => this.open({ first: true }))
32
+ .on('ArrowUp', () => this.open({ last: true }));
33
+ }
34
+ const popupControls = this.inputs.popupControls();
35
+ if (!popupControls) {
36
+ return new KeyboardEventManager();
37
+ }
38
+ const manager = new KeyboardEventManager()
39
+ .on('ArrowDown', () => this.next())
40
+ .on('ArrowUp', () => this.prev())
41
+ .on('Home', () => this.first())
42
+ .on('End', () => this.last())
43
+ .on('Escape', () => {
44
+ // TODO(wagnermaciel): We may want to fold this logic into the close() method.
45
+ if (this.inputs.filterMode() === 'highlight' && popupControls.activeId()) {
46
+ popupControls.unfocus();
47
+ popupControls.clearSelection();
48
+ const inputEl = this.inputs.inputEl();
49
+ if (inputEl) {
50
+ inputEl.value = this.inputs.inputValue();
51
+ }
52
+ }
53
+ else {
54
+ this.close();
55
+ this.inputs.popupControls()?.clearSelection();
56
+ }
57
+ }) // TODO: When filter mode is 'highlight', escape should revert to the last committed value.
58
+ .on('Enter', () => this.select({ commit: true, close: true }));
59
+ if (popupControls.role() === 'tree') {
60
+ const treeControls = popupControls;
61
+ if (treeControls.isItemExpandable() || treeControls.isItemCollapsible()) {
62
+ manager.on(this.collapseKey(), () => this.collapseItem());
63
+ }
64
+ if (treeControls.isItemExpandable()) {
65
+ manager.on(this.expandKey(), () => this.expandItem());
66
+ }
67
+ }
68
+ return manager;
69
+ });
70
+ /** The pointerup event manager for the combobox. */
71
+ pointerup = computed(() => new PointerEventManager().on(e => {
72
+ const item = this.inputs.popupControls()?.getItem(e);
73
+ if (item) {
74
+ this.select({ item, commit: true, close: true });
75
+ this.inputs.inputEl()?.focus(); // Return focus to the input after selecting.
76
+ }
77
+ if (e.target === this.inputs.inputEl()) {
78
+ this.open();
79
+ }
80
+ }));
81
+ constructor(inputs) {
82
+ this.inputs = inputs;
83
+ }
84
+ /** Handles keydown events for the combobox. */
85
+ onKeydown(event) {
86
+ this.keydown().handle(event);
87
+ }
88
+ /** Handles pointerup events for the combobox. */
89
+ onPointerup(event) {
90
+ this.pointerup().handle(event);
91
+ }
92
+ /** Handles input events for the combobox. */
93
+ onInput(event) {
94
+ const inputEl = this.inputs.inputEl();
95
+ if (!inputEl) {
96
+ return;
97
+ }
98
+ this.open();
99
+ this.inputs.inputValue?.set(inputEl.value);
100
+ this.isDeleting = event instanceof InputEvent && !!event.inputType.match(/^delete/);
101
+ if (this.inputs.filterMode() === 'manual') {
102
+ const searchTerm = this.inputs.popupControls()?.getSelectedItem()?.searchTerm();
103
+ if (searchTerm && this.inputs.inputValue() !== searchTerm) {
104
+ this.inputs.popupControls()?.clearSelection();
105
+ }
106
+ }
107
+ }
108
+ onFocusIn() {
109
+ this.isFocused.set(true);
110
+ }
111
+ /** Handles focus out events for the combobox. */
112
+ onFocusOut(event) {
113
+ if (!(event.relatedTarget instanceof HTMLElement) ||
114
+ !this.inputs.containerEl()?.contains(event.relatedTarget)) {
115
+ this.isFocused.set(false);
116
+ if (this.inputs.filterMode() !== 'manual') {
117
+ this.commit();
118
+ }
119
+ else {
120
+ const item = this.inputs
121
+ .popupControls()
122
+ ?.items()
123
+ .find(i => i.searchTerm() === this.inputs.inputEl()?.value);
124
+ if (item) {
125
+ this.select({ item });
126
+ }
127
+ }
128
+ this.close();
129
+ }
130
+ }
131
+ firstMatch = computed(() => {
132
+ // TODO(wagnermaciel): Consider whether we should not provide this default behavior for the
133
+ // listbox. Instead, we may want to allow users to have no match so that typing does not focus
134
+ // any option.
135
+ if (this.inputs.popupControls()?.role() === 'listbox') {
136
+ return this.inputs.popupControls()?.items()[0];
137
+ }
138
+ return this.inputs
139
+ .popupControls()
140
+ ?.items()
141
+ .find(i => i.value() === this.inputs.firstMatch());
142
+ });
143
+ onFilter() {
144
+ // TODO(wagnermaciel)
145
+ // When the user first interacts with the combobox, the popup will lazily render for the first
146
+ // time. This is a simple way to detect this and avoid auto-focus & selection logic, but this
147
+ // should probably be moved to the component layer instead.
148
+ const isInitialRender = !this.inputs.inputValue?.().length && !this.isDeleting;
149
+ if (isInitialRender) {
150
+ return;
151
+ }
152
+ // Avoid refocusing the input if a filter event occurs after focus has left the combobox.
153
+ if (!this.isFocused()) {
154
+ return;
155
+ }
156
+ if (this.inputs.popupControls()?.role() === 'tree') {
157
+ const treeControls = this.inputs.popupControls();
158
+ this.inputs.inputValue?.().length ? treeControls.expandAll() : treeControls.collapseAll();
159
+ }
160
+ const item = this.firstMatch();
161
+ if (!item) {
162
+ this.inputs.popupControls()?.clearSelection();
163
+ this.inputs.popupControls()?.unfocus();
164
+ return;
165
+ }
166
+ this.inputs.popupControls()?.focus(item);
167
+ if (this.inputs.filterMode() !== 'manual') {
168
+ this.select({ item });
169
+ }
170
+ if (this.inputs.filterMode() === 'highlight' && !this.isDeleting) {
171
+ this.highlight();
172
+ }
173
+ }
174
+ highlight() {
175
+ const inputEl = this.inputs.inputEl();
176
+ const item = this.inputs.popupControls()?.getSelectedItem();
177
+ if (!inputEl || !item) {
178
+ return;
179
+ }
180
+ const isHighlightable = item
181
+ .searchTerm()
182
+ .toLowerCase()
183
+ .startsWith(this.inputs.inputValue().toLowerCase());
184
+ if (isHighlightable) {
185
+ inputEl.value =
186
+ this.inputs.inputValue() + item.searchTerm().slice(this.inputs.inputValue().length);
187
+ inputEl.setSelectionRange(this.inputs.inputValue().length, item.searchTerm().length);
188
+ this.highlightedItem.set(item);
189
+ }
190
+ }
191
+ /** Closes the combobox. */
192
+ close() {
193
+ this.expanded.set(false);
194
+ this.inputs.popupControls()?.unfocus();
195
+ }
196
+ /** Opens the combobox. */
197
+ open(nav) {
198
+ this.expanded.set(true);
199
+ if (nav?.first) {
200
+ this.first();
201
+ }
202
+ if (nav?.last) {
203
+ this.last();
204
+ }
205
+ }
206
+ /** Navigates to the next focusable item in the combobox popup. */
207
+ next() {
208
+ this._navigate(() => this.inputs.popupControls()?.next());
209
+ }
210
+ /** Navigates to the previous focusable item in the combobox popup. */
211
+ prev() {
212
+ this._navigate(() => this.inputs.popupControls()?.prev());
213
+ }
214
+ /** Navigates to the first focusable item in the combobox popup. */
215
+ first() {
216
+ this._navigate(() => this.inputs.popupControls()?.first());
217
+ }
218
+ /** Navigates to the last focusable item in the combobox popup. */
219
+ last() {
220
+ this._navigate(() => this.inputs.popupControls()?.last());
221
+ }
222
+ collapseItem() {
223
+ const controls = this.inputs.popupControls();
224
+ this._navigate(() => controls?.collapseItem());
225
+ }
226
+ expandItem() {
227
+ const controls = this.inputs.popupControls();
228
+ this._navigate(() => controls?.expandItem());
229
+ }
230
+ /** Selects an item in the combobox popup. */
231
+ select(opts = {}) {
232
+ this.inputs.popupControls()?.select(opts.item);
233
+ if (opts.commit) {
234
+ this.commit();
235
+ }
236
+ if (opts.close) {
237
+ this.close();
238
+ }
239
+ }
240
+ /** Updates the value of the input based on the currently selected item. */
241
+ commit() {
242
+ const inputEl = this.inputs.inputEl();
243
+ const item = this.inputs.popupControls()?.getSelectedItem();
244
+ if (inputEl && item) {
245
+ inputEl.value = item.searchTerm();
246
+ this.inputs.inputValue?.set(item.searchTerm());
247
+ if (this.inputs.filterMode() === 'highlight') {
248
+ const length = inputEl.value.length;
249
+ inputEl.setSelectionRange(length, length);
250
+ }
251
+ }
252
+ }
253
+ /** Navigates and handles additional actions based on filter mode. */
254
+ _navigate(operation) {
255
+ operation();
256
+ if (this.inputs.filterMode() !== 'manual') {
257
+ this.select();
258
+ }
259
+ if (this.inputs.filterMode() === 'highlight') {
260
+ // This is to handle when the user navigates back to the originally highlighted item.
261
+ // E.g. User types "Al", highlights "Alice", then navigates down and back up to "Alice".
262
+ const selectedItem = this.inputs.popupControls()?.getSelectedItem();
263
+ if (!selectedItem) {
264
+ return;
265
+ }
266
+ if (selectedItem === this.highlightedItem()) {
267
+ this.highlight();
268
+ }
269
+ else {
270
+ const inputEl = this.inputs.inputEl();
271
+ inputEl.value = selectedItem?.searchTerm();
272
+ }
273
+ }
274
+ }
275
+ }
276
+
277
+ export { ComboboxPattern };
278
+ //# sourceMappingURL=_combobox-chunk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_combobox-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/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 {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {computed, signal} from '@angular/core';\nimport {SignalLike, WritableSignalLike} from '../behaviors/signal-like/signal-like';\nimport {ListItem} from '../behaviors/list/list';\n\n/** Represents the required inputs for a combobox. */\nexport interface ComboboxInputs<T extends ListItem<V>, V> {\n /** The controls for the popup associated with the combobox. */\n popupControls: SignalLike<ComboboxListboxControls<T, V> | ComboboxTreeControls<T, V> | undefined>;\n\n /** The HTML input element that serves as the combobox input. */\n inputEl: SignalLike<HTMLInputElement | undefined>;\n\n /** The HTML element that serves as the combobox container. */\n containerEl: SignalLike<HTMLElement | undefined>;\n\n /** The filtering mode for the combobox. */\n filterMode: SignalLike<'manual' | 'auto-select' | 'highlight'>;\n\n /** The current value of the combobox. */\n inputValue?: WritableSignalLike<string>;\n\n /** The value of the first matching item in the popup. */\n firstMatch: SignalLike<V | undefined>;\n}\n\n/** An interface that allows combobox popups to expose the necessary controls for the combobox. */\nexport interface ComboboxListboxControls<T extends ListItem<V>, V> {\n /** A unique identifier for the popup. */\n id: () => string;\n\n /** The ARIA role for the popup. */\n role: SignalLike<'listbox' | 'tree' | 'grid'>;\n\n /** The ID of the active item in the popup. */\n activeId: SignalLike<string | undefined>;\n\n /** The list of items in the popup. */\n items: SignalLike<T[]>;\n\n /** Navigates to the given item in the popup. */\n focus: (item: T) => void;\n\n /** Navigates to the next item in the popup. */\n next: () => void;\n\n /** Navigates to the previous item in the popup. */\n prev: () => void;\n\n /** Navigates to the first item in the popup. */\n first: () => void;\n\n /** Navigates to the last item in the popup. */\n last: () => void;\n\n /** Selects the current item in the popup. */\n select: (item?: T) => void;\n\n /** Clears the selection state of the popup. */\n clearSelection: () => void;\n\n /** Removes focus from any item in the popup. */\n unfocus: () => void;\n\n /** Returns the item corresponding to the given event. */\n getItem: (e: PointerEvent) => T | undefined;\n\n /** Returns the currently selected item in the popup. */\n getSelectedItem: () => T | undefined;\n\n /** Sets the value of the combobox based on the selected item. */\n setValue: (value: V | undefined) => void; // For re-setting the value if the popup was destroyed.\n}\n\nexport interface ComboboxTreeControls<T extends ListItem<V>, V>\n extends ComboboxListboxControls<T, V> {\n /** Whether the currently active item in the popup is collapsible. */\n isItemCollapsible: () => boolean;\n\n /** Expands the currently active item in the popup. */\n expandItem: () => void;\n\n /** Collapses the currently active item in the popup. */\n collapseItem: () => void;\n\n /** Checks if the currently active item in the popup is expandable. */\n isItemExpandable: () => boolean;\n\n /** Expands all nodes in the tree. */\n expandAll: () => void;\n\n /** Collapses all nodes in the tree. */\n collapseAll: () => void;\n}\n\n/** Controls the state of a combobox. */\nexport class ComboboxPattern<T extends ListItem<V>, V> {\n /** Whether the combobox is expanded. */\n expanded = signal(false);\n\n /** The ID of the active item in the combobox. */\n activedescendant = computed(() => this.inputs.popupControls()?.activeId() ?? null);\n\n /** The currently highlighted item in the combobox. */\n highlightedItem = signal<T | undefined>(undefined);\n\n /** Whether the most recent input event was a deletion. */\n isDeleting = false;\n\n /** Whether the combobox is focused. */\n isFocused = signal(false);\n\n /** The key used to navigate to the previous item in the list. */\n expandKey = computed(() => 'ArrowRight'); // TODO: RTL support.\n\n /** The key used to navigate to the next item in the list. */\n collapseKey = computed(() => 'ArrowLeft'); // TODO: RTL support.\n\n /** The ID of the popup associated with the combobox. */\n popupId = computed(() => this.inputs.popupControls()?.id() || null);\n\n /** The autocomplete behavior of the combobox. */\n autocomplete = computed(() => (this.inputs.filterMode() === 'highlight' ? 'both' : 'list'));\n\n /** The ARIA role of the popup associated with the combobox. */\n hasPopup = computed(() => this.inputs.popupControls()?.role() || null);\n\n /** The keydown event manager for the combobox. */\n keydown = computed(() => {\n if (!this.expanded()) {\n return new KeyboardEventManager()\n .on('ArrowDown', () => this.open({first: true}))\n .on('ArrowUp', () => this.open({last: true}));\n }\n\n const popupControls = this.inputs.popupControls();\n\n if (!popupControls) {\n return new KeyboardEventManager();\n }\n\n const manager = new KeyboardEventManager()\n .on('ArrowDown', () => this.next())\n .on('ArrowUp', () => this.prev())\n .on('Home', () => this.first())\n .on('End', () => this.last())\n .on('Escape', () => {\n // TODO(wagnermaciel): We may want to fold this logic into the close() method.\n if (this.inputs.filterMode() === 'highlight' && popupControls.activeId()) {\n popupControls.unfocus();\n popupControls.clearSelection();\n\n const inputEl = this.inputs.inputEl();\n if (inputEl) {\n inputEl.value = this.inputs.inputValue!();\n }\n } else {\n this.close();\n this.inputs.popupControls()?.clearSelection();\n }\n }) // TODO: When filter mode is 'highlight', escape should revert to the last committed value.\n .on('Enter', () => this.select({commit: true, close: true}));\n\n if (popupControls.role() === 'tree') {\n const treeControls = popupControls as ComboboxTreeControls<T, V>;\n\n if (treeControls.isItemExpandable() || treeControls.isItemCollapsible()) {\n manager.on(this.collapseKey(), () => this.collapseItem());\n }\n\n if (treeControls.isItemExpandable()) {\n manager.on(this.expandKey(), () => this.expandItem());\n }\n }\n\n return manager;\n });\n\n /** The pointerup event manager for the combobox. */\n pointerup = computed(() =>\n new PointerEventManager().on(e => {\n const item = this.inputs.popupControls()?.getItem(e);\n\n if (item) {\n this.select({item, commit: true, close: true});\n this.inputs.inputEl()?.focus(); // Return focus to the input after selecting.\n }\n\n if (e.target === this.inputs.inputEl()) {\n this.open();\n }\n }),\n );\n\n constructor(readonly inputs: ComboboxInputs<T, V>) {}\n\n /** Handles keydown events for the combobox. */\n onKeydown(event: KeyboardEvent) {\n this.keydown().handle(event);\n }\n\n /** Handles pointerup events for the combobox. */\n onPointerup(event: PointerEvent) {\n this.pointerup().handle(event);\n }\n\n /** Handles input events for the combobox. */\n onInput(event: Event) {\n const inputEl = this.inputs.inputEl();\n\n if (!inputEl) {\n return;\n }\n\n this.open();\n this.inputs.inputValue?.set(inputEl.value);\n this.isDeleting = event instanceof InputEvent && !!event.inputType.match(/^delete/);\n\n if (this.inputs.filterMode() === 'manual') {\n const searchTerm = this.inputs.popupControls()?.getSelectedItem()?.searchTerm();\n\n if (searchTerm && this.inputs.inputValue!() !== searchTerm) {\n this.inputs.popupControls()?.clearSelection();\n }\n }\n }\n\n onFocusIn() {\n this.isFocused.set(true);\n }\n\n /** Handles focus out events for the combobox. */\n onFocusOut(event: FocusEvent) {\n if (\n !(event.relatedTarget instanceof HTMLElement) ||\n !this.inputs.containerEl()?.contains(event.relatedTarget)\n ) {\n this.isFocused.set(false);\n if (this.inputs.filterMode() !== 'manual') {\n this.commit();\n } else {\n const item = this.inputs\n .popupControls()\n ?.items()\n .find(i => i.searchTerm() === this.inputs.inputEl()?.value);\n\n if (item) {\n this.select({item});\n }\n }\n\n this.close();\n }\n }\n\n firstMatch = computed(() => {\n // TODO(wagnermaciel): Consider whether we should not provide this default behavior for the\n // listbox. Instead, we may want to allow users to have no match so that typing does not focus\n // any option.\n if (this.inputs.popupControls()?.role() === 'listbox') {\n return this.inputs.popupControls()?.items()[0];\n }\n\n return this.inputs\n .popupControls()\n ?.items()\n .find(i => i.value() === this.inputs.firstMatch());\n });\n\n onFilter() {\n // TODO(wagnermaciel)\n // When the user first interacts with the combobox, the popup will lazily render for the first\n // time. This is a simple way to detect this and avoid auto-focus & selection logic, but this\n // should probably be moved to the component layer instead.\n const isInitialRender = !this.inputs.inputValue?.().length && !this.isDeleting;\n\n if (isInitialRender) {\n return;\n }\n\n // Avoid refocusing the input if a filter event occurs after focus has left the combobox.\n if (!this.isFocused()) {\n return;\n }\n\n if (this.inputs.popupControls()?.role() === 'tree') {\n const treeControls = this.inputs.popupControls() as ComboboxTreeControls<T, V>;\n this.inputs.inputValue?.().length ? treeControls.expandAll() : treeControls.collapseAll();\n }\n\n const item = this.firstMatch();\n\n if (!item) {\n this.inputs.popupControls()?.clearSelection();\n this.inputs.popupControls()?.unfocus();\n return;\n }\n\n this.inputs.popupControls()?.focus(item);\n\n if (this.inputs.filterMode() !== 'manual') {\n this.select({item});\n }\n\n if (this.inputs.filterMode() === 'highlight' && !this.isDeleting) {\n this.highlight();\n }\n }\n\n highlight() {\n const inputEl = this.inputs.inputEl();\n const item = this.inputs.popupControls()?.getSelectedItem();\n\n if (!inputEl || !item) {\n return;\n }\n\n const isHighlightable = item\n .searchTerm()\n .toLowerCase()\n .startsWith(this.inputs.inputValue!().toLowerCase());\n\n if (isHighlightable) {\n inputEl.value =\n this.inputs.inputValue!() + item.searchTerm().slice(this.inputs.inputValue!().length);\n inputEl.setSelectionRange(this.inputs.inputValue!().length, item.searchTerm().length);\n this.highlightedItem.set(item);\n }\n }\n\n /** Closes the combobox. */\n close() {\n this.expanded.set(false);\n this.inputs.popupControls()?.unfocus();\n }\n\n /** Opens the combobox. */\n open(nav?: {first?: boolean; last?: boolean}) {\n this.expanded.set(true);\n\n if (nav?.first) {\n this.first();\n }\n if (nav?.last) {\n this.last();\n }\n }\n\n /** Navigates to the next focusable item in the combobox popup. */\n next() {\n this._navigate(() => this.inputs.popupControls()?.next());\n }\n\n /** Navigates to the previous focusable item in the combobox popup. */\n prev() {\n this._navigate(() => this.inputs.popupControls()?.prev());\n }\n\n /** Navigates to the first focusable item in the combobox popup. */\n first() {\n this._navigate(() => this.inputs.popupControls()?.first());\n }\n\n /** Navigates to the last focusable item in the combobox popup. */\n last() {\n this._navigate(() => this.inputs.popupControls()?.last());\n }\n\n collapseItem() {\n const controls = this.inputs.popupControls() as ComboboxTreeControls<T, V>;\n this._navigate(() => controls?.collapseItem());\n }\n\n expandItem() {\n const controls = this.inputs.popupControls() as ComboboxTreeControls<T, V>;\n this._navigate(() => controls?.expandItem());\n }\n\n /** Selects an item in the combobox popup. */\n select(opts: {item?: T; commit?: boolean; close?: boolean} = {}) {\n this.inputs.popupControls()?.select(opts.item);\n\n if (opts.commit) {\n this.commit();\n }\n if (opts.close) {\n this.close();\n }\n }\n\n /** Updates the value of the input based on the currently selected item. */\n commit() {\n const inputEl = this.inputs.inputEl();\n const item = this.inputs.popupControls()?.getSelectedItem();\n\n if (inputEl && item) {\n inputEl.value = item.searchTerm();\n this.inputs.inputValue?.set(item.searchTerm());\n\n if (this.inputs.filterMode() === 'highlight') {\n const length = inputEl.value.length;\n inputEl.setSelectionRange(length, length);\n }\n }\n }\n\n /** Navigates and handles additional actions based on filter mode. */\n private _navigate(operation: () => void) {\n operation();\n\n if (this.inputs.filterMode() !== 'manual') {\n this.select();\n }\n\n if (this.inputs.filterMode() === 'highlight') {\n // This is to handle when the user navigates back to the originally highlighted item.\n // E.g. User types \"Al\", highlights \"Alice\", then navigates down and back up to \"Alice\".\n const selectedItem = this.inputs.popupControls()?.getSelectedItem();\n\n if (!selectedItem) {\n return;\n }\n\n if (selectedItem === this.highlightedItem()) {\n this.highlight();\n } else {\n const inputEl = this.inputs.inputEl()!;\n inputEl.value = selectedItem?.searchTerm()!;\n }\n }\n }\n}\n"],"names":[],"mappings":";;;AAuGA;MACa,eAAe,CAAA;AAkGL,IAAA,MAAA;;AAhGrB,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC;;AAGxB,IAAA,gBAAgB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC;;AAGlF,IAAA,eAAe,GAAG,MAAM,CAAgB,SAAS,CAAC;;IAGlD,UAAU,GAAG,KAAK;;AAGlB,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC;;IAGzB,SAAS,GAAG,QAAQ,CAAC,MAAM,YAAY,CAAC,CAAC;;IAGzC,WAAW,GAAG,QAAQ,CAAC,MAAM,WAAW,CAAC,CAAC;;AAG1C,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC;;IAGnE,YAAY,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;;AAG3F,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC;;AAGtE,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACtB,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;YACpB,OAAO,IAAI,oBAAoB;AAC5B,iBAAA,EAAE,CAAC,W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L,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAG;AACtC,gBAAA,OAAO,CAAC,KAAK,GAAG,YAAY,EAAE,UAAU,EAAG;;;;AAIlD;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { computed, signal } from '@angular/core';
2
- import { List } from './list.mjs';
3
- import { Modifier, KeyboardEventManager, PointerEventManager } from './list-navigation.mjs';
2
+ import { List } from './_list-chunk.mjs';
3
+ import { Modifier, KeyboardEventManager, PointerEventManager } from './_pointer-event-manager-chunk.mjs';
4
4
 
5
5
  /** Controls the state of a listbox. */
6
6
  class ListboxPattern {
@@ -142,10 +142,6 @@ class ListboxPattern {
142
142
  if (!this.inputs.multi() && this.inputs.value().length > 1) {
143
143
  violations.push(`A single-select listbox should not have multiple selected options. Selected options: ${this.inputs.value().join(', ')}`);
144
144
  }
145
- const activeItem = this.inputs.activeItem();
146
- if (activeItem && !this.inputs.items().includes(activeItem)) {
147
- violations.push(`The current active item does not exist in the list. Active item: ${activeItem.id()}.`);
148
- }
149
145
  return violations;
150
146
  }
151
147
  /** Handles keydown events for the listbox. */
@@ -227,5 +223,56 @@ class OptionPattern {
227
223
  }
228
224
  }
229
225
 
230
- export { ListboxPattern, OptionPattern };
231
- //# sourceMappingURL=option.mjs.map
226
+ class ComboboxListboxPattern extends ListboxPattern {
227
+ inputs;
228
+ /** A unique identifier for the popup. */
229
+ id = computed(() => this.inputs.id());
230
+ /** The ARIA role for the listbox. */
231
+ role = computed(() => 'listbox');
232
+ /** The id of the active (focused) item in the listbox. */
233
+ activeId = computed(() => this.listBehavior.activedescendant());
234
+ /** The list of options in the listbox. */
235
+ items = computed(() => this.inputs.items());
236
+ /** The tabindex for the listbox. Always -1 because the combobox handles focus. */
237
+ tabindex = () => -1;
238
+ constructor(inputs) {
239
+ if (inputs.combobox()) {
240
+ inputs.multi = () => false;
241
+ inputs.focusMode = () => 'activedescendant';
242
+ inputs.element = inputs.combobox().inputs.inputEl;
243
+ }
244
+ super(inputs);
245
+ this.inputs = inputs;
246
+ }
247
+ /** Noop. The combobox handles keydown events. */
248
+ onKeydown(_) { }
249
+ /** Noop. The combobox handles pointerdown events. */
250
+ onPointerdown(_) { }
251
+ /** Noop. The combobox controls the open state. */
252
+ setDefaultState() { }
253
+ /** Navigates to the specified item in the listbox. */
254
+ focus = (item) => this.listBehavior.goto(item);
255
+ /** Navigates to the next focusable item in the listbox. */
256
+ next = () => this.listBehavior.next();
257
+ /** Navigates to the previous focusable item in the listbox. */
258
+ prev = () => this.listBehavior.prev();
259
+ /** Navigates to the last focusable item in the listbox. */
260
+ last = () => this.listBehavior.last();
261
+ /** Navigates to the first focusable item in the listbox. */
262
+ first = () => this.listBehavior.first();
263
+ /** Unfocuses the currently focused item in the listbox. */
264
+ unfocus = () => this.listBehavior.unfocus();
265
+ /** Selects the specified item in the listbox. */
266
+ select = (item) => this.listBehavior.select(item);
267
+ /** Clears the selection in the listbox. */
268
+ clearSelection = () => this.listBehavior.deselectAll();
269
+ /** Retrieves the OptionPattern associated with a pointer event. */
270
+ getItem = (e) => this._getItem(e);
271
+ /** Retrieves the currently selected item in the listbox. */
272
+ getSelectedItem = () => this.inputs.items().find(i => i.selected());
273
+ /** Sets the value of the combobox listbox. */
274
+ setValue = (value) => this.inputs.value.set(value ? [value] : []);
275
+ }
276
+
277
+ export { ComboboxListboxPattern, ListboxPattern, OptionPattern };
278
+ //# sourceMappingURL=_combobox-listbox-chunk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_combobox-listbox-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/listbox/listbox.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/listbox/option.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk-experimental/ui-patterns/listbox/combobox-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 {OptionPattern} from './option';\nimport {KeyboardEventManager, PointerEventManager, Modifier} from '../behaviors/event-manager';\nimport {computed, signal} from '@angular/core';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {List, ListInputs} from '../behaviors/list/list';\n\n/** Represents the required inputs for a listbox. */\nexport type ListboxInputs<V> = ListInputs<OptionPattern<V>, V> & {\n /** A unique identifier for the listbox. */\n id: SignalLike<string>;\n\n /** Whether the listbox is readonly. */\n readonly: SignalLike<boolean>;\n};\n\n/** Controls the state of a listbox. */\nexport class ListboxPattern<V> {\n listBehavior: List<OptionPattern<V>, 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 = computed(() => this.listBehavior.disabled());\n\n /** Whether the listbox is readonly. */\n readonly: SignalLike<boolean>;\n\n /** The tabindex of the listbox. */\n tabindex: SignalLike<-1 | 0> = computed(() => this.listBehavior.tabindex());\n\n /** The id of the current active item. */\n activedescendant = computed(() => this.listBehavior.activedescendant());\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.inputs.items().length);\n\n /** Whether the listbox selection follows focus. */\n followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** Whether the listbox should wrap. Used to disable wrapping while range selecting. */\n wrap = signal(true);\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 /** Represents the space key. Does nothing when the user is actively using typeahead. */\n dynamicSpaceKey = computed(() => (this.listBehavior.isTyping() ? '' : ' '));\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.listBehavior.prev())\n .on(this.nextKey, () => this.listBehavior.next())\n .on('Home', () => this.listBehavior.first())\n .on('End', () => this.listBehavior.last())\n .on(this.typeaheadRegexp, e => this.listBehavior.search(e.key));\n }\n\n if (!this.followFocus()) {\n manager\n .on(this.prevKey, () => this.listBehavior.prev())\n .on(this.nextKey, () => this.listBehavior.next())\n .on('Home', () => this.listBehavior.first())\n .on('End', () => this.listBehavior.last())\n .on(this.typeaheadRegexp, e => this.listBehavior.search(e.key));\n }\n\n if (this.followFocus()) {\n manager\n .on(this.prevKey, () => this.listBehavior.prev({selectOne: true}))\n .on(this.nextKey, () => this.listBehavior.next({selectOne: true}))\n .on('Home', () => this.listBehavior.first({selectOne: true}))\n .on('End', () => this.listBehavior.last({selectOne: true}))\n .on(this.typeaheadRegexp, e => this.listBehavior.search(e.key, {selectOne: true}));\n }\n\n if (this.inputs.multi()) {\n manager\n .on(Modifier.Any, 'Shift', () => this.listBehavior.anchor(this.listBehavior.activeIndex()))\n .on(Modifier.Shift, this.prevKey, () => this.listBehavior.prev({selectRange: true}))\n .on(Modifier.Shift, this.nextKey, () => this.listBehavior.next({selectRange: true}))\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () =>\n this.listBehavior.first({selectRange: true, anchor: false}),\n )\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () =>\n this.listBehavior.last({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, 'Enter', () =>\n this.listBehavior.updateSelection({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, this.dynamicSpaceKey, () =>\n this.listBehavior.updateSelection({selectRange: true, anchor: false}),\n );\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager\n .on(this.dynamicSpaceKey, () => this.listBehavior.toggle())\n .on('Enter', () => this.listBehavior.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => this.listBehavior.toggleAll());\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => this.listBehavior.toggleOne());\n manager.on('Enter', () => this.listBehavior.toggleOne());\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => this.listBehavior.prev())\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => this.listBehavior.next())\n .on([Modifier.Ctrl, Modifier.Meta], ' ', () => this.listBehavior.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => this.listBehavior.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Home', () => this.listBehavior.first())\n .on([Modifier.Ctrl, Modifier.Meta], 'End', () => this.listBehavior.last())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => {\n this.listBehavior.toggleAll();\n this.listBehavior.select(); // Ensure the currect option remains selected.\n });\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.listBehavior.goto(this._getItem(e)!));\n }\n\n if (this.multi()) {\n manager.on(Modifier.Shift, e =>\n this.listBehavior.goto(this._getItem(e)!, {selectRange: true}),\n );\n }\n\n if (!this.multi() && this.followFocus()) {\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!, {selectOne: true}));\n }\n\n if (!this.multi() && !this.followFocus()) {\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!, {toggle: true}));\n }\n\n if (this.multi() && this.followFocus()) {\n return manager\n .on(e => this.listBehavior.goto(this._getItem(e)!, {selectOne: true}))\n .on(Modifier.Ctrl, e => this.listBehavior.goto(this._getItem(e)!, {toggle: true}));\n }\n\n if (this.multi() && !this.followFocus()) {\n return manager.on(e => this.listBehavior.goto(this._getItem(e)!, {toggle: true}));\n }\n\n return manager;\n });\n\n constructor(readonly inputs: ListboxInputs<V>) {\n this.readonly = inputs.readonly;\n this.orientation = inputs.orientation;\n this.multi = inputs.multi;\n this.listBehavior = new List(inputs);\n }\n\n /** Returns a set of violations */\n validate(): string[] {\n const violations: string[] = [];\n\n if (!this.inputs.multi() && this.inputs.value().length > 1) {\n violations.push(\n `A single-select listbox should not have multiple selected options. Selected options: ${this.inputs.value().join(', ')}`,\n );\n }\n\n return violations;\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 /**\n * Sets the listbox to it's default initial state.\n *\n * Sets the active index of the listbox to the first focusable selected\n * item if one exists. Otherwise, sets focus to the first focusable item.\n *\n * This method should be called once the listbox and it's options are properly initialized,\n * meaning the ListboxPattern and OptionPatterns should have references to each other before this\n * is called.\n */\n setDefaultState() {\n let firstItem: OptionPattern<V> | null = null;\n\n for (const item of this.inputs.items()) {\n if (this.listBehavior.isFocusable(item)) {\n if (!firstItem) {\n firstItem = item;\n }\n if (item.selected()) {\n this.inputs.activeItem.set(item);\n return;\n }\n }\n }\n\n if (firstItem) {\n this.inputs.activeItem.set(firstItem);\n }\n }\n\n protected _getItem(e: PointerEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n\n const element = e.target.closest('[role=\"option\"]');\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 {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {List, ListInputs, ListItem} from '../behaviors/list/list';\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 inputs: ListInputs<OptionPattern<V>, V>;\n listBehavior: List<OptionPattern<V>, V>;\n}\n\n/** Represents the required inputs for an option in a listbox. */\nexport interface OptionInputs<V> extends Omit<ListItem<V>, 'index'> {\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(() => this.listbox()?.inputs.items().indexOf(this) ?? -1);\n\n /** Whether the option is active. */\n active = computed(() => this.listbox()?.inputs.activeItem() === this);\n\n /** Whether the option is selected. */\n selected = computed(() => this.listbox()?.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()?.listBehavior.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","/**\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 {ListboxInputs, ListboxPattern} from './listbox';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\nimport {OptionPattern} from './option';\nimport {ComboboxPattern, ComboboxListboxControls} from '../combobox/combobox';\n\nexport type ComboboxListboxInputs<V> = ListboxInputs<V> & {\n /** The combobox controlling the listbox. */\n combobox: SignalLike<ComboboxPattern<OptionPattern<V>, V> | undefined>;\n};\n\nexport class ComboboxListboxPattern<V>\n extends ListboxPattern<V>\n implements ComboboxListboxControls<OptionPattern<V>, V>\n{\n /** A unique identifier for the popup. */\n id = computed(() => this.inputs.id());\n\n /** The ARIA role for the listbox. */\n role = computed(() => 'listbox' as const);\n\n /** The id of the active (focused) item in the listbox. */\n activeId = computed(() => this.listBehavior.activedescendant());\n\n /** The list of options in the listbox. */\n items: SignalLike<OptionPattern<V>[]> = computed(() => this.inputs.items());\n\n /** The tabindex for the listbox. Always -1 because the combobox handles focus. */\n override tabindex: SignalLike<-1 | 0> = () => -1;\n\n constructor(override readonly inputs: ComboboxListboxInputs<V>) {\n if (inputs.combobox()) {\n inputs.multi = () => false;\n inputs.focusMode = () => 'activedescendant';\n inputs.element = inputs.combobox()!.inputs.inputEl;\n }\n\n super(inputs);\n }\n\n /** Noop. The combobox handles keydown events. */\n override onKeydown(_: KeyboardEvent): void {}\n\n /** Noop. The combobox handles pointerdown events. */\n override onPointerdown(_: PointerEvent): void {}\n\n /** Noop. The combobox controls the open state. */\n override setDefaultState(): void {}\n\n /** Navigates to the specified item in the listbox. */\n focus = (item: OptionPattern<V>) => this.listBehavior.goto(item);\n\n /** Navigates to the next focusable item in the listbox. */\n next = () => this.listBehavior.next();\n\n /** Navigates to the previous focusable item in the listbox. */\n prev = () => this.listBehavior.prev();\n\n /** Navigates to the last focusable item in the listbox. */\n last = () => this.listBehavior.last();\n\n /** Navigates to the first focusable item in the listbox. */\n first = () => this.listBehavior.first();\n\n /** Unfocuses the currently focused item in the listbox. */\n unfocus = () => this.listBehavior.unfocus();\n\n /** Selects the specified item in the listbox. */\n select = (item?: OptionPattern<V>) => this.listBehavior.select(item);\n\n /** Clears the selection in the listbox. */\n clearSelection = () => this.listBehavior.deselectAll();\n\n /** Retrieves the OptionPattern associated with a pointer event. */\n getItem = (e: PointerEvent) => this._getItem(e);\n\n /** Retrieves the currently selected item in the listbox. */\n getSelectedItem = () => this.inputs.items().find(i => i.selected());\n\n /** Sets the value of the combobox listbox. */\n setValue = (value: V | undefined) => this.inputs.value.set(value ? [value] : []);\n}\n"],"names":[],"mappings":";;;;AAuBA;MACa,cAAc,CAAA;AAsKJ,IAAA,MAAA;AArKrB,IAAA,YAAY;;AAGZ,IAAA,WAAW;;AAGX,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;;AAGvD,IAAA,QAAQ;;AAGR,IAAA,QAAQ,GAAuB,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;;AAG3E,IAAA,gBAAgB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,CAAC;;AAGvE,IAAA,KAAK;;AAGL,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;;AAGpD,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,QAAQ,CAAC;;AAGtE,IAAA,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;;AAGnB,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;QACtB,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,UAAU,EAAE;AAC5C,YAAA,OAAO,SAAS;;AAElB,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,KAAK,GAAG,YAAY,GAAG,WAAW;AAC3E,KAAC,CAAC;;AAGF,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;QACtB,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,UAAU,EAAE;AAC5C,YAAA,OAAO,WAAW;;AAEpB,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,KAAK,GAAG,WA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