@angular/cdk-experimental 20.2.0-next.2 → 20.2.0-rc.0
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.
- package/accordion/index.d.ts +3 -3
- package/{accordion.d-CC6dGMlv.d.ts → accordion.d.d.ts} +7 -5
- package/{expansion.d-Zkcf-XJU.d.ts → expansion.d.d.ts} +3 -3
- package/fesm2022/accordion.mjs +17 -17
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/{accordion-D9JoxtzT.mjs → accordion2.mjs} +8 -6
- package/fesm2022/accordion2.mjs.map +1 -0
- package/fesm2022/cdk-experimental.mjs +1 -1
- package/fesm2022/cdk-experimental.mjs.map +1 -1
- package/fesm2022/column-resize.mjs +54 -54
- package/fesm2022/column-resize.mjs.map +1 -1
- package/fesm2022/combobox.mjs +10 -10
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/deferred-content.mjs +6 -6
- package/fesm2022/deferred-content.mjs.map +1 -1
- package/fesm2022/{expansion-C9iQLHOG.mjs → expansion.mjs} +2 -2
- package/fesm2022/expansion.mjs.map +1 -0
- package/fesm2022/{list-focus-Czul8jzR.mjs → list-navigation.mjs} +67 -62
- package/fesm2022/list-navigation.mjs.map +1 -0
- package/fesm2022/list.mjs +355 -0
- package/fesm2022/list.mjs.map +1 -0
- package/fesm2022/listbox.mjs +10 -11
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/option.mjs +231 -0
- package/fesm2022/option.mjs.map +1 -0
- package/fesm2022/{polyfill-CXksG4af.mjs → polyfill.mjs} +2 -2
- package/fesm2022/polyfill.mjs.map +1 -0
- package/fesm2022/popover-edit.mjs +44 -44
- package/fesm2022/popover-edit.mjs.map +1 -1
- package/fesm2022/radio-group.mjs +44 -11
- package/fesm2022/radio-group.mjs.map +1 -1
- package/fesm2022/radio-group2.mjs +143 -0
- package/fesm2022/radio-group2.mjs.map +1 -0
- package/fesm2022/scrolling.mjs +7 -7
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/selection.mjs +19 -19
- package/fesm2022/selection.mjs.map +1 -1
- package/fesm2022/table-scroll-container.mjs +7 -7
- package/fesm2022/table-scroll-container.mjs.map +1 -1
- package/fesm2022/tabs.mjs +20 -20
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/{tabs-hMdwtXv2.mjs → tabs2.mjs} +34 -70
- package/fesm2022/tabs2.mjs.map +1 -0
- package/fesm2022/toolbar.mjs +168 -0
- package/fesm2022/toolbar.mjs.map +1 -0
- package/fesm2022/toolbar2.mjs +224 -0
- package/fesm2022/toolbar2.mjs.map +1 -0
- package/fesm2022/tree.mjs +140 -219
- package/fesm2022/tree.mjs.map +1 -1
- package/fesm2022/ui-patterns.mjs +8 -8
- package/fesm2022/ui-patterns.mjs.map +1 -1
- package/list.d.d.ts +207 -0
- package/listbox/index.d.ts +3 -4
- package/{listbox.d-Ckp1is82.d.ts → listbox.d.d.ts} +9 -62
- package/package.json +6 -2
- package/{pointer-event-manager.d-BqSm9Jh5.d.ts → pointer-event-manager.d.d.ts} +12 -8
- package/radio-group/index.d.ts +15 -7
- package/radio-group.d.d.ts +80 -0
- package/tabs/index.d.ts +4 -4
- package/{tabs.d-Db8oTrMB.d.ts → tabs.d.d.ts} +15 -30
- package/toolbar/index.d.ts +89 -0
- package/toolbar.d.d.ts +136 -0
- package/tree/index.d.ts +28 -63
- package/ui-patterns/index.d.ts +8 -8
- package/fesm2022/accordion-D9JoxtzT.mjs.map +0 -1
- package/fesm2022/expansion-C9iQLHOG.mjs.map +0 -1
- package/fesm2022/list-focus-Czul8jzR.mjs.map +0 -1
- package/fesm2022/list-selection-C41ApAbt.mjs +0 -136
- package/fesm2022/list-selection-C41ApAbt.mjs.map +0 -1
- package/fesm2022/list-typeahead-DIIbNJrP.mjs +0 -64
- package/fesm2022/list-typeahead-DIIbNJrP.mjs.map +0 -1
- package/fesm2022/option-CgeKz9_Q.mjs +0 -321
- package/fesm2022/option-CgeKz9_Q.mjs.map +0 -1
- package/fesm2022/polyfill-CXksG4af.mjs.map +0 -1
- package/fesm2022/radio-button-92xc4w-A.mjs +0 -203
- package/fesm2022/radio-button-92xc4w-A.mjs.map +0 -1
- package/fesm2022/tabs-hMdwtXv2.mjs.map +0 -1
- package/list-selection.d-fbAPr_N_.d.ts +0 -69
- package/list-typeahead.d-ljh3nJ9y.d.ts +0 -48
- package/radio-group.d-CFC0aKQM.d.ts +0 -114
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { computed, signal } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
/** Controls typeahead for a list of items. */
|
|
4
|
-
class ListTypeahead {
|
|
5
|
-
inputs;
|
|
6
|
-
/** A reference to the timeout for resetting the typeahead search. */
|
|
7
|
-
timeout;
|
|
8
|
-
/** The focus controller of the parent list. */
|
|
9
|
-
focusManager;
|
|
10
|
-
/** Whether the user is actively typing a typeahead search query. */
|
|
11
|
-
isTyping = computed(() => this._query().length > 0);
|
|
12
|
-
/** Keeps track of the characters that typeahead search is being called with. */
|
|
13
|
-
_query = signal('');
|
|
14
|
-
/** The index where that the typeahead search was initiated from. */
|
|
15
|
-
_startIndex = signal(undefined);
|
|
16
|
-
constructor(inputs) {
|
|
17
|
-
this.inputs = inputs;
|
|
18
|
-
this.focusManager = inputs.focusManager;
|
|
19
|
-
}
|
|
20
|
-
/** Performs a typeahead search, appending the given character to the search string. */
|
|
21
|
-
search(char) {
|
|
22
|
-
if (char.length !== 1) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
if (!this.isTyping() && char === ' ') {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
if (this._startIndex() === undefined) {
|
|
29
|
-
this._startIndex.set(this.focusManager.inputs.activeIndex());
|
|
30
|
-
}
|
|
31
|
-
clearTimeout(this.timeout);
|
|
32
|
-
this._query.update(q => q + char.toLowerCase());
|
|
33
|
-
const item = this._getItem();
|
|
34
|
-
if (item) {
|
|
35
|
-
this.focusManager.focus(item);
|
|
36
|
-
}
|
|
37
|
-
this.timeout = setTimeout(() => {
|
|
38
|
-
this._query.set('');
|
|
39
|
-
this._startIndex.set(undefined);
|
|
40
|
-
}, this.inputs.typeaheadDelay() * 1000);
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Returns the first item whose search term matches the
|
|
45
|
-
* current query starting from the the current anchor index.
|
|
46
|
-
*/
|
|
47
|
-
_getItem() {
|
|
48
|
-
let items = this.focusManager.inputs.items();
|
|
49
|
-
const after = items.slice(this._startIndex() + 1);
|
|
50
|
-
const before = items.slice(0, this._startIndex());
|
|
51
|
-
items = after.concat(before);
|
|
52
|
-
items.push(this.inputs.items()[this._startIndex()]);
|
|
53
|
-
const focusableItems = [];
|
|
54
|
-
for (const item of items) {
|
|
55
|
-
if (this.focusManager.isFocusable(item)) {
|
|
56
|
-
focusableItems.push(item);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return focusableItems.find(i => i.searchTerm().toLowerCase().startsWith(this._query()));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { ListTypeahead as L };
|
|
64
|
-
//# sourceMappingURL=list-typeahead-DIIbNJrP.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-typeahead-DIIbNJrP.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/list-typeahead/list-typeahead.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, signal} from '@angular/core';\nimport {SignalLike} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\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 ListFocusItem {\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<T extends ListTypeaheadItem> extends ListFocusInputs<T> {\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 focus controller of the parent list. */\n focusManager: ListFocus<T>;\n\n /** Whether the user is actively typing a typeahead search query. */\n isTyping = computed(() => this._query().length > 0);\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<T> & {focusManager: ListFocus<T>}) {\n this.focusManager = inputs.focusManager;\n }\n\n /** Performs a typeahead search, appending the given character to the search string. */\n search(char: string): boolean {\n if (char.length !== 1) {\n return false;\n }\n\n if (!this.isTyping() && char === ' ') {\n return false;\n }\n\n if (this._startIndex() === undefined) {\n this._startIndex.set(this.focusManager.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.focusManager.focus(item);\n }\n\n this.timeout = setTimeout(() => {\n this._query.set('');\n this._startIndex.set(undefined);\n }, this.inputs.typeaheadDelay() * 1000);\n\n return true;\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.focusManager.inputs.items();\n const after = items.slice(this._startIndex()! + 1);\n const before = items.slice(0, this._startIndex()!);\n items = after.concat(before);\n items.push(this.inputs.items()[this._startIndex()!]);\n\n const focusableItems = [];\n for (const item of items) {\n if (this.focusManager.isFocusable(item)) {\n focusableItems.push(item);\n }\n }\n\n return focusableItems.find(i => i.searchTerm().toLower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G,CAAC,EAAE,CAAC;AACnB,YAAA,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC;SAChC,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC;AAEvC,QAAA,OAAO,IAAI;;AAGb;;;AAGG;IACK,QAAQ,GAAA;QACd,IAAI,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE;AAC5C,QAAA,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAG,GAAG,CAAC,CAAC;AAClD,QAAA,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,EAAG,CAAC;AAClD,QAAA,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;AAC5B,QAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,WAAW,EAAG,CAAC,CAAC;QAEpD,MAAM,cAAc,GAAG,EAAE;AACzB,QAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;AACvC,gBAAA,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC;;;QAI7B,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;;AAE1F;;;;"}
|
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import { L as ListSelection } from './list-selection-C41ApAbt.mjs';
|
|
2
|
-
import { L as ListTypeahead } from './list-typeahead-DIIbNJrP.mjs';
|
|
3
|
-
import { M as Modifier, L as ListFocus, a as ListNavigation, K as KeyboardEventManager, P as PointerEventManager } from './list-focus-Czul8jzR.mjs';
|
|
4
|
-
import { computed, signal } from '@angular/core';
|
|
5
|
-
|
|
6
|
-
/** Controls the state of a listbox. */
|
|
7
|
-
class ListboxPattern {
|
|
8
|
-
inputs;
|
|
9
|
-
/** Controls navigation for the listbox. */
|
|
10
|
-
navigation;
|
|
11
|
-
/** Controls selection for the listbox. */
|
|
12
|
-
selection;
|
|
13
|
-
/** Controls typeahead for the listbox. */
|
|
14
|
-
typeahead;
|
|
15
|
-
/** Controls focus for the listbox. */
|
|
16
|
-
focusManager;
|
|
17
|
-
/** Whether the list is vertically or horizontally oriented. */
|
|
18
|
-
orientation;
|
|
19
|
-
/** Whether the listbox is disabled. */
|
|
20
|
-
disabled = computed(() => this.focusManager.isListDisabled());
|
|
21
|
-
/** Whether the listbox is readonly. */
|
|
22
|
-
readonly;
|
|
23
|
-
/** The tabindex of the listbox. */
|
|
24
|
-
tabindex = computed(() => this.focusManager.getListTabindex());
|
|
25
|
-
/** The id of the current active item. */
|
|
26
|
-
activedescendant = computed(() => this.focusManager.getActiveDescendant());
|
|
27
|
-
/** Whether multiple items in the list can be selected at once. */
|
|
28
|
-
multi;
|
|
29
|
-
/** The number of items in the listbox. */
|
|
30
|
-
setsize = computed(() => this.navigation.inputs.items().length);
|
|
31
|
-
/** Whether the listbox selection follows focus. */
|
|
32
|
-
followFocus = computed(() => this.inputs.selectionMode() === 'follow');
|
|
33
|
-
/** Whether the listbox should wrap. Used to disable wrapping while range selecting. */
|
|
34
|
-
wrap = signal(true);
|
|
35
|
-
/** The key used to navigate to the previous item in the list. */
|
|
36
|
-
prevKey = computed(() => {
|
|
37
|
-
if (this.inputs.orientation() === 'vertical') {
|
|
38
|
-
return 'ArrowUp';
|
|
39
|
-
}
|
|
40
|
-
return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
|
|
41
|
-
});
|
|
42
|
-
/** The key used to navigate to the next item in the list. */
|
|
43
|
-
nextKey = computed(() => {
|
|
44
|
-
if (this.inputs.orientation() === 'vertical') {
|
|
45
|
-
return 'ArrowDown';
|
|
46
|
-
}
|
|
47
|
-
return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
|
|
48
|
-
});
|
|
49
|
-
/** Represents the space key. Does nothing when the user is actively using typeahead. */
|
|
50
|
-
dynamicSpaceKey = computed(() => (this.typeahead.isTyping() ? '' : ' '));
|
|
51
|
-
/** The regexp used to decide if a key should trigger typeahead. */
|
|
52
|
-
typeaheadRegexp = /^.$/; // TODO: Ignore spaces?
|
|
53
|
-
/**
|
|
54
|
-
* The uncommitted index for selecting a range of options.
|
|
55
|
-
*
|
|
56
|
-
* NOTE: This is subtly distinct from the "rangeStartIndex" in the ListSelection behavior.
|
|
57
|
-
* The anchorIndex does not necessarily represent the start of a range, but represents the most
|
|
58
|
-
* recent index where the user showed intent to begin a range selection. Usually, this is wherever
|
|
59
|
-
* the user most recently pressed the "Shift" key, but if the user presses shift + space to select
|
|
60
|
-
* from the anchor, the user is not intending to start a new range from this index.
|
|
61
|
-
*
|
|
62
|
-
* In other words, "rangeStartIndex" is only set when a user commits to starting a range selection
|
|
63
|
-
* while "anchorIndex" is set whenever a user indicates they may be starting a range selection.
|
|
64
|
-
*/
|
|
65
|
-
anchorIndex = signal(0);
|
|
66
|
-
/** The keydown event manager for the listbox. */
|
|
67
|
-
keydown = computed(() => {
|
|
68
|
-
const manager = new KeyboardEventManager();
|
|
69
|
-
if (this.readonly()) {
|
|
70
|
-
return manager
|
|
71
|
-
.on(this.prevKey, () => this.prev())
|
|
72
|
-
.on(this.nextKey, () => this.next())
|
|
73
|
-
.on('Home', () => this.first())
|
|
74
|
-
.on('End', () => this.last())
|
|
75
|
-
.on(this.typeaheadRegexp, e => this.search(e.key));
|
|
76
|
-
}
|
|
77
|
-
if (!this.followFocus()) {
|
|
78
|
-
manager
|
|
79
|
-
.on(this.prevKey, () => this.prev())
|
|
80
|
-
.on(this.nextKey, () => this.next())
|
|
81
|
-
.on('Home', () => this.first())
|
|
82
|
-
.on('End', () => this.last())
|
|
83
|
-
.on(this.typeaheadRegexp, e => this.search(e.key));
|
|
84
|
-
}
|
|
85
|
-
if (this.followFocus()) {
|
|
86
|
-
manager
|
|
87
|
-
.on(this.prevKey, () => this.prev({ selectOne: true }))
|
|
88
|
-
.on(this.nextKey, () => this.next({ selectOne: true }))
|
|
89
|
-
.on('Home', () => this.first({ selectOne: true }))
|
|
90
|
-
.on('End', () => this.last({ selectOne: true }))
|
|
91
|
-
.on(this.typeaheadRegexp, e => this.search(e.key, { selectOne: true }));
|
|
92
|
-
}
|
|
93
|
-
if (this.inputs.multi()) {
|
|
94
|
-
manager
|
|
95
|
-
.on(Modifier.Any, 'Shift', () => this.anchorIndex.set(this.inputs.activeIndex()))
|
|
96
|
-
.on(Modifier.Shift, this.prevKey, () => this.prev({ selectRange: true }))
|
|
97
|
-
.on(Modifier.Shift, this.nextKey, () => this.next({ selectRange: true }))
|
|
98
|
-
.on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () => this.first({ selectRange: true, anchor: false }))
|
|
99
|
-
.on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () => this.last({ selectRange: true, anchor: false }))
|
|
100
|
-
.on(Modifier.Shift, 'Enter', () => this._updateSelection({ selectRange: true, anchor: false }))
|
|
101
|
-
.on(Modifier.Shift, this.dynamicSpaceKey, () => this._updateSelection({ selectRange: true, anchor: false }));
|
|
102
|
-
}
|
|
103
|
-
if (!this.followFocus() && this.inputs.multi()) {
|
|
104
|
-
manager
|
|
105
|
-
.on(this.dynamicSpaceKey, () => this.selection.toggle())
|
|
106
|
-
.on('Enter', () => this.selection.toggle())
|
|
107
|
-
.on([Modifier.Ctrl, Modifier.Meta], 'A', () => this.selection.toggleAll());
|
|
108
|
-
}
|
|
109
|
-
if (!this.followFocus() && !this.inputs.multi()) {
|
|
110
|
-
manager.on(this.dynamicSpaceKey, () => this.selection.toggleOne());
|
|
111
|
-
manager.on('Enter', () => this.selection.toggleOne());
|
|
112
|
-
}
|
|
113
|
-
if (this.inputs.multi() && this.followFocus()) {
|
|
114
|
-
manager
|
|
115
|
-
.on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => this.prev())
|
|
116
|
-
.on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => this.next())
|
|
117
|
-
.on([Modifier.Ctrl, Modifier.Meta], ' ', () => this.selection.toggle())
|
|
118
|
-
.on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => this.selection.toggle())
|
|
119
|
-
.on([Modifier.Ctrl, Modifier.Meta], 'Home', () => this.first())
|
|
120
|
-
.on([Modifier.Ctrl, Modifier.Meta], 'End', () => this.last())
|
|
121
|
-
.on([Modifier.Ctrl, Modifier.Meta], 'A', () => {
|
|
122
|
-
this.selection.toggleAll();
|
|
123
|
-
this.selection.select(); // Ensure the currect option remains selected.
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
return manager;
|
|
127
|
-
});
|
|
128
|
-
/** The pointerdown event manager for the listbox. */
|
|
129
|
-
pointerdown = computed(() => {
|
|
130
|
-
const manager = new PointerEventManager();
|
|
131
|
-
if (this.readonly()) {
|
|
132
|
-
return manager.on(e => this.goto(e));
|
|
133
|
-
}
|
|
134
|
-
if (this.multi()) {
|
|
135
|
-
manager.on(Modifier.Shift, e => this.goto(e, { selectRange: true }));
|
|
136
|
-
}
|
|
137
|
-
if (!this.multi() && this.followFocus()) {
|
|
138
|
-
return manager.on(e => this.goto(e, { selectOne: true }));
|
|
139
|
-
}
|
|
140
|
-
if (!this.multi() && !this.followFocus()) {
|
|
141
|
-
return manager.on(e => this.goto(e, { toggle: true }));
|
|
142
|
-
}
|
|
143
|
-
if (this.multi() && this.followFocus()) {
|
|
144
|
-
return manager
|
|
145
|
-
.on(e => this.goto(e, { selectOne: true }))
|
|
146
|
-
.on(Modifier.Ctrl, e => this.goto(e, { toggle: true }));
|
|
147
|
-
}
|
|
148
|
-
if (this.multi() && !this.followFocus()) {
|
|
149
|
-
return manager.on(e => this.goto(e, { toggle: true }));
|
|
150
|
-
}
|
|
151
|
-
return manager;
|
|
152
|
-
});
|
|
153
|
-
constructor(inputs) {
|
|
154
|
-
this.inputs = inputs;
|
|
155
|
-
this.readonly = inputs.readonly;
|
|
156
|
-
this.orientation = inputs.orientation;
|
|
157
|
-
this.multi = inputs.multi;
|
|
158
|
-
this.focusManager = new ListFocus(inputs);
|
|
159
|
-
this.selection = new ListSelection({ ...inputs, focusManager: this.focusManager });
|
|
160
|
-
this.typeahead = new ListTypeahead({ ...inputs, focusManager: this.focusManager });
|
|
161
|
-
this.navigation = new ListNavigation({
|
|
162
|
-
...inputs,
|
|
163
|
-
focusManager: this.focusManager,
|
|
164
|
-
wrap: computed(() => this.wrap() && this.inputs.wrap()),
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
/** Returns a set of violations */
|
|
168
|
-
validate() {
|
|
169
|
-
const violations = [];
|
|
170
|
-
if (!this.inputs.multi() && this.inputs.value().length > 1) {
|
|
171
|
-
violations.push(`A single-select listbox should not have multiple selected options. Selected options: ${this.inputs.value().join(', ')}`);
|
|
172
|
-
}
|
|
173
|
-
if (this.inputs.items.length &&
|
|
174
|
-
(this.inputs.activeIndex() < 0 || this.inputs.activeIndex() >= this.inputs.items().length)) {
|
|
175
|
-
violations.push(`The active index is out of bounds. Number of options: ${this.inputs.items().length} Active index: ${this.inputs.activeIndex()}.`);
|
|
176
|
-
}
|
|
177
|
-
return violations;
|
|
178
|
-
}
|
|
179
|
-
/** Handles keydown events for the listbox. */
|
|
180
|
-
onKeydown(event) {
|
|
181
|
-
if (!this.disabled()) {
|
|
182
|
-
this.keydown().handle(event);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
onPointerdown(event) {
|
|
186
|
-
if (!this.disabled()) {
|
|
187
|
-
this.pointerdown().handle(event);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
/** Navigates to the first option in the listbox. */
|
|
191
|
-
first(opts) {
|
|
192
|
-
this._navigate(opts, () => this.navigation.first());
|
|
193
|
-
}
|
|
194
|
-
/** Navigates to the last option in the listbox. */
|
|
195
|
-
last(opts) {
|
|
196
|
-
this._navigate(opts, () => this.navigation.last());
|
|
197
|
-
}
|
|
198
|
-
/** Navigates to the next option in the listbox. */
|
|
199
|
-
next(opts) {
|
|
200
|
-
this._navigate(opts, () => this.navigation.next());
|
|
201
|
-
}
|
|
202
|
-
/** Navigates to the previous option in the listbox. */
|
|
203
|
-
prev(opts) {
|
|
204
|
-
this._navigate(opts, () => this.navigation.prev());
|
|
205
|
-
}
|
|
206
|
-
/** Navigates to the given item in the listbox. */
|
|
207
|
-
goto(event, opts) {
|
|
208
|
-
const item = this._getItem(event);
|
|
209
|
-
this._navigate(opts, () => this.navigation.goto(item));
|
|
210
|
-
}
|
|
211
|
-
/** Handles typeahead search navigation for the listbox. */
|
|
212
|
-
search(char, opts) {
|
|
213
|
-
this._navigate(opts, () => this.typeahead.search(char));
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Sets the listbox to it's default initial state.
|
|
217
|
-
*
|
|
218
|
-
* Sets the active index of the listbox to the first focusable selected
|
|
219
|
-
* item if one exists. Otherwise, sets focus to the first focusable item.
|
|
220
|
-
*
|
|
221
|
-
* This method should be called once the listbox and it's options are properly initialized,
|
|
222
|
-
* meaning the ListboxPattern and OptionPatterns should have references to each other before this
|
|
223
|
-
* is called.
|
|
224
|
-
*/
|
|
225
|
-
setDefaultState() {
|
|
226
|
-
let firstItem = null;
|
|
227
|
-
for (const item of this.inputs.items()) {
|
|
228
|
-
if (this.focusManager.isFocusable(item)) {
|
|
229
|
-
if (!firstItem) {
|
|
230
|
-
firstItem = item;
|
|
231
|
-
}
|
|
232
|
-
if (item.selected()) {
|
|
233
|
-
this.inputs.activeIndex.set(item.index());
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
if (firstItem) {
|
|
239
|
-
this.inputs.activeIndex.set(firstItem.index());
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Safely performs a navigation operation.
|
|
244
|
-
*
|
|
245
|
-
* Handles conditionally disabling wrapping for when a navigation
|
|
246
|
-
* operation is occurring while the user is selecting a range of options.
|
|
247
|
-
*
|
|
248
|
-
* Handles boilerplate calling of focus & selection operations. Also ensures these
|
|
249
|
-
* additional operations are only called if the navigation operation moved focus to a new option.
|
|
250
|
-
*/
|
|
251
|
-
_navigate(opts = {}, operation) {
|
|
252
|
-
if (opts?.selectRange) {
|
|
253
|
-
this.wrap.set(false);
|
|
254
|
-
this.selection.rangeStartIndex.set(this.anchorIndex());
|
|
255
|
-
}
|
|
256
|
-
const moved = operation();
|
|
257
|
-
if (moved) {
|
|
258
|
-
this._updateSelection(opts);
|
|
259
|
-
}
|
|
260
|
-
this.wrap.set(true);
|
|
261
|
-
}
|
|
262
|
-
/** Handles updating selection for the listbox. */
|
|
263
|
-
_updateSelection(opts = { anchor: true }) {
|
|
264
|
-
if (opts.toggle) {
|
|
265
|
-
this.selection.toggle();
|
|
266
|
-
}
|
|
267
|
-
if (opts.selectOne) {
|
|
268
|
-
this.selection.selectOne();
|
|
269
|
-
}
|
|
270
|
-
if (opts.selectRange) {
|
|
271
|
-
this.selection.selectRange();
|
|
272
|
-
}
|
|
273
|
-
if (!opts.anchor) {
|
|
274
|
-
this.anchorIndex.set(this.selection.rangeStartIndex());
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
_getItem(e) {
|
|
278
|
-
if (!(e.target instanceof HTMLElement)) {
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
const element = e.target.closest('[role="option"]');
|
|
282
|
-
return this.inputs.items().find(i => i.element() === element);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/** Represents an option in a listbox. */
|
|
287
|
-
class OptionPattern {
|
|
288
|
-
/** A unique identifier for the option. */
|
|
289
|
-
id;
|
|
290
|
-
/** The value of the option. */
|
|
291
|
-
value;
|
|
292
|
-
/** The position of the option in the list. */
|
|
293
|
-
index = computed(() => this.listbox()
|
|
294
|
-
?.navigation.inputs.items()
|
|
295
|
-
.findIndex(i => i.id() === this.id()) ?? -1);
|
|
296
|
-
/** Whether the option is active. */
|
|
297
|
-
active = computed(() => this.listbox()?.focusManager.activeItem() === this);
|
|
298
|
-
/** Whether the option is selected. */
|
|
299
|
-
selected = computed(() => this.listbox()?.selection.inputs.value().includes(this.value()));
|
|
300
|
-
/** Whether the option is disabled. */
|
|
301
|
-
disabled;
|
|
302
|
-
/** The text used by the typeahead search. */
|
|
303
|
-
searchTerm;
|
|
304
|
-
/** A reference to the parent listbox. */
|
|
305
|
-
listbox;
|
|
306
|
-
/** The tabindex of the option. */
|
|
307
|
-
tabindex = computed(() => this.listbox()?.focusManager.getItemTabindex(this));
|
|
308
|
-
/** The html element that should receive focus. */
|
|
309
|
-
element;
|
|
310
|
-
constructor(args) {
|
|
311
|
-
this.id = args.id;
|
|
312
|
-
this.value = args.value;
|
|
313
|
-
this.listbox = args.listbox;
|
|
314
|
-
this.element = args.element;
|
|
315
|
-
this.disabled = args.disabled;
|
|
316
|
-
this.searchTerm = args.searchTerm;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
export { ListboxPattern as L, OptionPattern as O };
|
|
321
|
-
//# sourceMappingURL=option-CgeKz9_Q.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"option-CgeKz9_Q.mjs","sources":["../../../../../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\nimport {OptionPattern} from './option';\nimport {KeyboardEventManager, PointerEventManager, Modifier} from '../behaviors/event-manager';\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, signal} from '@angular/core';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\n\n/** The selection operations that the listbox can perform. */\ninterface SelectOptions {\n toggle?: boolean;\n selectOne?: boolean;\n selectRange?: boolean;\n anchor?: 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<OptionPattern<V>> &\n ListFocusInputs<OptionPattern<V>> & {\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 = computed(() => this.focusManager.isListDisabled());\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 /** 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.typeahead.isTyping() ? '' : ' '));\n\n /** The regexp used to decide if a key should trigger typeahead. */\n typeaheadRegexp = /^.$/; // TODO: Ignore spaces?\n\n /**\n * The uncommitted index for selecting a range of options.\n *\n * NOTE: This is subtly distinct from the \"rangeStartIndex\" in the ListSelection behavior.\n * The anchorIndex does not necessarily represent the start of a range, but represents the most\n * recent index where the user showed intent to begin a range selection. Usually, this is wherever\n * the user most recently pressed the \"Shift\" key, but if the user presses shift + space to select\n * from the anchor, the user is not intending to start a new range from this index.\n *\n * In other words, \"rangeStartIndex\" is only set when a user commits to starting a range selection\n * while \"anchorIndex\" is set whenever a user indicates they may be starting a range selection.\n */\n anchorIndex = signal(0);\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.Any, 'Shift', () => this.anchorIndex.set(this.inputs.activeIndex()))\n .on(Modifier.Shift, this.prevKey, () => this.prev({selectRange: true}))\n .on(Modifier.Shift, this.nextKey, () => this.next({selectRange: true}))\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'Home', () =>\n this.first({selectRange: true, anchor: false}),\n )\n .on([Modifier.Ctrl | Modifier.Shift, Modifier.Meta | Modifier.Shift], 'End', () =>\n this.last({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, 'Enter', () =>\n this._updateSelection({selectRange: true, anchor: false}),\n )\n .on(Modifier.Shift, this.dynamicSpaceKey, () =>\n this._updateSelection({selectRange: true, anchor: false}),\n );\n }\n\n if (!this.followFocus() && this.inputs.multi()) {\n manager\n .on(this.dynamicSpaceKey, () => this.selection.toggle())\n .on('Enter', () => this.selection.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => this.selection.toggleAll());\n }\n\n if (!this.followFocus() && !this.inputs.multi()) {\n manager.on(this.dynamicSpaceKey, () => this.selection.toggleOne());\n manager.on('Enter', () => this.selection.toggleOne());\n }\n\n if (this.inputs.multi() && this.followFocus()) {\n manager\n .on([Modifier.Ctrl, Modifier.Meta], this.prevKey, () => this.prev())\n .on([Modifier.Ctrl, Modifier.Meta], this.nextKey, () => this.next())\n .on([Modifier.Ctrl, Modifier.Meta], ' ', () => this.selection.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Enter', () => this.selection.toggle())\n .on([Modifier.Ctrl, Modifier.Meta], 'Home', () => this.first())\n .on([Modifier.Ctrl, Modifier.Meta], 'End', () => this.last())\n .on([Modifier.Ctrl, Modifier.Meta], 'A', () => {\n this.selection.toggleAll();\n this.selection.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.goto(e));\n }\n\n if (this.multi()) {\n manager.on(Modifier.Shift, e => this.goto(e, {selectRange: true}));\n }\n\n if (!this.multi() && this.followFocus()) {\n return manager.on(e => this.goto(e, {selectOne: true}));\n }\n\n if (!this.multi() && !this.followFocus()) {\n return manager.on(e => this.goto(e, {toggle: true}));\n }\n\n if (this.multi() && this.followFocus()) {\n return manager\n .on(e => this.goto(e, {selectOne: true}))\n .on(Modifier.Ctrl, e => this.goto(e, {toggle: true}));\n }\n\n if (this.multi() && !this.followFocus()) {\n return manager.on(e => this.goto(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\n this.focusManager = new ListFocus(inputs);\n this.selection = new ListSelection({...inputs, focusManager: this.focusManager});\n this.typeahead = new ListTypeahead({...inputs, focusManager: this.focusManager});\n this.navigation = new ListNavigation({\n ...inputs,\n focusManager: this.focusManager,\n wrap: computed(() => this.wrap() && this.inputs.wrap()),\n });\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 if (\n this.inputs.items.length &&\n (this.inputs.activeIndex() < 0 || this.inputs.activeIndex() >= this.inputs.items().length)\n ) {\n violations.push(\n `The active index is out of bounds. Number of options: ${this.inputs.items().length} Active index: ${this.inputs.activeIndex()}.`,\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 /** Navigates to the first option in the listbox. */\n first(opts?: SelectOptions) {\n this._navigate(opts, () => this.navigation.first());\n }\n\n /** Navigates to the last option in the listbox. */\n last(opts?: SelectOptions) {\n this._navigate(opts, () => this.navigation.last());\n }\n\n /** Navigates to the next option in the listbox. */\n next(opts?: SelectOptions) {\n this._navigate(opts, () => this.navigation.next());\n }\n\n /** Navigates to the previous option in the listbox. */\n prev(opts?: SelectOptions) {\n this._navigate(opts, () => this.navigation.prev());\n }\n\n /** Navigates to the given item in the listbox. */\n goto(event: PointerEvent, opts?: SelectOptions) {\n const item = this._getItem(event);\n this._navigate(opts, () => this.navigation.goto(item));\n }\n\n /** Handles typeahead search navigation for the listbox. */\n search(char: string, opts?: SelectOptions) {\n this._navigate(opts, () => this.typeahead.search(char));\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.focusManager.isFocusable(item)) {\n if (!firstItem) {\n firstItem = item;\n }\n if (item.selected()) {\n this.inputs.activeIndex.set(item.index());\n return;\n }\n }\n }\n\n if (firstItem) {\n this.inputs.activeIndex.set(firstItem.index());\n }\n }\n\n /**\n * Safely performs a navigation operation.\n *\n * Handles conditionally disabling wrapping for when a navigation\n * operation is occurring while the user is selecting a range of options.\n *\n * Handles boilerplate calling of focus & selection operations. Also ensures these\n * additional operations are only called if the navigation operation moved focus to a new option.\n */\n private _navigate(opts: SelectOptions = {}, operation: () => boolean) {\n if (opts?.selectRange) {\n this.wrap.set(false);\n this.selection.rangeStartIndex.set(this.anchorIndex());\n }\n\n const moved = operation();\n\n if (moved) {\n this._updateSelection(opts);\n }\n\n this.wrap.set(true);\n }\n\n /** Handles updating selection for the listbox. */\n private _updateSelection(opts: SelectOptions = {anchor: true}) {\n if (opts.toggle) {\n this.selection.toggle();\n }\n if (opts.selectOne) {\n this.selection.selectOne();\n }\n if (opts.selectRange) {\n this.selection.selectRange();\n }\n if (!opts.anchor) {\n this.anchorIndex.set(this.selection.rangeStartIndex());\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\"]');\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 active. */\n active = computed(() => this.listbox()?.focusManager.activeItem() === this);\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":[],"mappings":";;;;;AAiCA;MACa,cAAc,CAAA;AA4LJ,IAAA,MAAA;;AA1LrB,IAAA,UAAU;;AAGV,IAAA,SAAS;;AAGT,IAAA,SAAS;;AAGT,IAAA,YAAY;;AAGZ,IAAA,WAAW;;AAGX,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,CAAC;;AAG7D,IAAA,QAAQ;;AAGR,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;;AAG9D,IAAA,gBAAgB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC;;AAG1E,IAAA,KAAK;;AAGL,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;;AAG/D,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,IAA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,IAAqB,EAAA;AAC/B,QAAA,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE;AACjB,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK;AACvB,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO;AAC3B,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO;AAC3B,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ;AAC7B,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU;;AAEpC;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"polyfill-CXksG4af.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;;IAGb,IAAI,IAAI,GAAgB,OAAO;IAC/B,OAAO,IAAI,IAAI,IAAI,IAAI,EAAE,IAAI,YAAY,OAAO,CAAC,EAAE;AACjD,QAAA,IAAI,GAAG,IAAI,CAAC,UAAU;;IAGxB,OAAO,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI;AACxC;;;;"}
|