@angular/aria 21.0.3 → 21.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_adev_assets/aria-accordion.json +743 -0
- package/_adev_assets/aria-combobox.json +603 -0
- package/_adev_assets/aria-grid.json +893 -0
- package/_adev_assets/aria-listbox.json +540 -0
- package/_adev_assets/aria-menu.json +1049 -0
- package/_adev_assets/aria-tabs.json +880 -0
- package/_adev_assets/aria-toolbar.json +545 -0
- package/_adev_assets/aria-tree.json +853 -0
- package/fesm2022/_widget-chunk.mjs +246 -4
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion.mjs +4 -17
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox.mjs +120 -96
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid.mjs +201 -225
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox.mjs +161 -173
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +238 -256
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +932 -7
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs.mjs +168 -182
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +3 -15
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree.mjs +2 -4
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +3 -3
- package/types/_grid-chunk.d.ts +210 -3
- package/types/accordion.d.ts +49 -52
- package/types/combobox.d.ts +111 -25
- package/types/grid.d.ts +32 -37
- package/types/listbox.d.ts +5 -8
- package/types/menu.d.ts +113 -113
- package/types/private.d.ts +498 -10
- package/types/tabs.d.ts +84 -89
- package/types/toolbar.d.ts +66 -69
- package/types/tree.d.ts +103 -106
- package/fesm2022/_combobox-chunk.mjs +0 -425
- package/fesm2022/_combobox-chunk.mjs.map +0 -1
- package/fesm2022/_combobox-listbox-chunk.mjs +0 -522
- package/fesm2022/_combobox-listbox-chunk.mjs.map +0 -1
- package/fesm2022/_combobox-popup-chunk.mjs +0 -46
- package/fesm2022/_combobox-popup-chunk.mjs.map +0 -1
- package/fesm2022/_list-navigation-chunk.mjs +0 -116
- package/fesm2022/_list-navigation-chunk.mjs.map +0 -1
- package/fesm2022/_pointer-event-manager-chunk.mjs +0 -134
- package/fesm2022/_pointer-event-manager-chunk.mjs.map +0 -1
- package/types/_combobox-chunk.d.ts +0 -98
- package/types/_combobox-chunk.d2.ts +0 -193
- package/types/_list-chunk.d.ts +0 -212
- package/types/_list-navigation-chunk.d.ts +0 -212
- package/types/_listbox-chunk.d.ts +0 -106
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, signal, Directive } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
const COMBOBOX = new InjectionToken('COMBOBOX');
|
|
5
|
-
|
|
6
|
-
class ComboboxPopup {
|
|
7
|
-
combobox = inject(COMBOBOX, {
|
|
8
|
-
optional: true
|
|
9
|
-
});
|
|
10
|
-
_controls = signal(undefined, ...(ngDevMode ? [{
|
|
11
|
-
debugName: "_controls"
|
|
12
|
-
}] : []));
|
|
13
|
-
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
14
|
-
minVersion: "12.0.0",
|
|
15
|
-
version: "21.0.0",
|
|
16
|
-
ngImport: i0,
|
|
17
|
-
type: ComboboxPopup,
|
|
18
|
-
deps: [],
|
|
19
|
-
target: i0.ɵɵFactoryTarget.Directive
|
|
20
|
-
});
|
|
21
|
-
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
22
|
-
minVersion: "14.0.0",
|
|
23
|
-
version: "21.0.0",
|
|
24
|
-
type: ComboboxPopup,
|
|
25
|
-
isStandalone: true,
|
|
26
|
-
selector: "[ngComboboxPopup]",
|
|
27
|
-
exportAs: ["ngComboboxPopup"],
|
|
28
|
-
ngImport: i0
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
32
|
-
minVersion: "12.0.0",
|
|
33
|
-
version: "21.0.0",
|
|
34
|
-
ngImport: i0,
|
|
35
|
-
type: ComboboxPopup,
|
|
36
|
-
decorators: [{
|
|
37
|
-
type: Directive,
|
|
38
|
-
args: [{
|
|
39
|
-
selector: '[ngComboboxPopup]',
|
|
40
|
-
exportAs: 'ngComboboxPopup'
|
|
41
|
-
}]
|
|
42
|
-
}]
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
export { COMBOBOX, ComboboxPopup };
|
|
46
|
-
//# sourceMappingURL=_combobox-popup-chunk.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_combobox-popup-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/combobox/combobox-tokens.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/combobox/combobox-popup.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InjectionToken} from '@angular/core';\nimport type {Combobox} from './combobox';\n\n/** Token used to provide the combobox to child components. */\nexport const COMBOBOX = new InjectionToken<Combobox<unknown>>('COMBOBOX');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Directive, inject, signal} from '@angular/core';\nimport {\n ComboboxListboxControls,\n ComboboxTreeControls,\n ComboboxDialogPattern,\n} from '@angular/aria/private';\nimport type {Combobox} from './combobox';\nimport {COMBOBOX} from './combobox-tokens';\n\n/**\n * Identifies an element as a popup for an `ngCombobox`.\n *\n * This directive acts as a bridge, allowing the `ngCombobox` to discover and interact\n * with the underlying control (e.g., `ngListbox`, `ngTree`, or `ngComboboxDialog`) that\n * manages the options. It's primarily used as a host directive and is responsible for\n * exposing the popup's control pattern to the parent combobox.\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngComboboxPopup]',\n exportAs: 'ngComboboxPopup',\n})\nexport class ComboboxPopup<V> {\n /** The combobox that the popup belongs to. */\n readonly combobox = inject<Combobox<V>>(COMBOBOX, {optional: true});\n\n /** The popup controls exposed to the combobox. */\n readonly _controls = signal<\n | ComboboxListboxControls<any, V>\n | ComboboxTreeControls<any, V>\n | ComboboxDialogPattern\n | undefined\n >(undefined);\n}\n"],"names":["COMBOBOX","InjectionToken","ComboboxPopup","combobox","inject","optional","_controls","signal","undefined","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","exportAs","ngImport","decorators","args"],"mappings":";;;MAYaA,QAAQ,GAAG,IAAIC,cAAc,CAAoB,UAAU;;MCmB3DC,aAAa,CAAA;AAEfC,EAAAA,QAAQ,GAAGC,MAAM,CAAcJ,QAAQ,EAAE;AAACK,IAAAA,QAAQ,EAAE;AAAK,GAAA,CAAC;EAG1DC,SAAS,GAAGC,MAAM,CAKzBC,SAAS;;WAAC;;;;;UAVDN,aAAa;AAAAO,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;UAAbX,aAAa;AAAAY,IAAAA,YAAA,EAAA,IAAA;AAAAC,IAAAA,QAAA,EAAA,mBAAA;IAAAC,QAAA,EAAA,CAAA,iBAAA,CAAA;AAAAC,IAAAA,QAAA,EAAAN;AAAA,GAAA,CAAA;;;;;;QAAbT,aAAa;AAAAgB,EAAAA,UAAA,EAAA,CAAA;UAJzBL,SAAS;AAACM,IAAAA,IAAA,EAAA,CAAA;AACTJ,MAAAA,QAAQ,EAAE,mBAAmB;AAC7BC,MAAAA,QAAQ,EAAE;KACX;;;;;;"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { signal, computed } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
class ListFocus {
|
|
4
|
-
inputs;
|
|
5
|
-
prevActiveItem = signal(undefined);
|
|
6
|
-
prevActiveIndex = computed(() => {
|
|
7
|
-
return this.prevActiveItem() ? this.inputs.items().indexOf(this.prevActiveItem()) : -1;
|
|
8
|
-
});
|
|
9
|
-
activeIndex = computed(() => {
|
|
10
|
-
return this.inputs.activeItem() ? this.inputs.items().indexOf(this.inputs.activeItem()) : -1;
|
|
11
|
-
});
|
|
12
|
-
constructor(inputs) {
|
|
13
|
-
this.inputs = inputs;
|
|
14
|
-
}
|
|
15
|
-
isListDisabled() {
|
|
16
|
-
return this.inputs.disabled() || this.inputs.items().every(i => i.disabled());
|
|
17
|
-
}
|
|
18
|
-
getActiveDescendant() {
|
|
19
|
-
if (this.isListDisabled()) {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
if (this.inputs.focusMode() === 'roving') {
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
return this.inputs.activeItem()?.id() ?? undefined;
|
|
26
|
-
}
|
|
27
|
-
getListTabIndex() {
|
|
28
|
-
if (this.isListDisabled()) {
|
|
29
|
-
return 0;
|
|
30
|
-
}
|
|
31
|
-
return this.inputs.focusMode() === 'activedescendant' ? 0 : -1;
|
|
32
|
-
}
|
|
33
|
-
getItemTabIndex(item) {
|
|
34
|
-
if (this.isListDisabled()) {
|
|
35
|
-
return -1;
|
|
36
|
-
}
|
|
37
|
-
if (this.inputs.focusMode() === 'activedescendant') {
|
|
38
|
-
return -1;
|
|
39
|
-
}
|
|
40
|
-
return this.inputs.activeItem() === item ? 0 : -1;
|
|
41
|
-
}
|
|
42
|
-
focus(item, opts) {
|
|
43
|
-
if (this.isListDisabled() || !this.isFocusable(item)) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
this.prevActiveItem.set(this.inputs.activeItem());
|
|
47
|
-
this.inputs.activeItem.set(item);
|
|
48
|
-
if (opts?.focusElement || opts?.focusElement === undefined) {
|
|
49
|
-
this.inputs.focusMode() === 'roving' ? item.element()?.focus() : this.inputs.element()?.focus();
|
|
50
|
-
}
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
isFocusable(item) {
|
|
54
|
-
return !item.disabled() || this.inputs.softDisabled();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
class ListNavigation {
|
|
59
|
-
inputs;
|
|
60
|
-
constructor(inputs) {
|
|
61
|
-
this.inputs = inputs;
|
|
62
|
-
}
|
|
63
|
-
goto(item, opts) {
|
|
64
|
-
return item ? this.inputs.focusManager.focus(item, opts) : false;
|
|
65
|
-
}
|
|
66
|
-
next(opts) {
|
|
67
|
-
return this._advance(1, opts);
|
|
68
|
-
}
|
|
69
|
-
peekNext() {
|
|
70
|
-
return this._peek(1);
|
|
71
|
-
}
|
|
72
|
-
prev(opts) {
|
|
73
|
-
return this._advance(-1, opts);
|
|
74
|
-
}
|
|
75
|
-
peekPrev() {
|
|
76
|
-
return this._peek(-1);
|
|
77
|
-
}
|
|
78
|
-
first(opts) {
|
|
79
|
-
const item = this.peekFirst();
|
|
80
|
-
return item ? this.goto(item, opts) : false;
|
|
81
|
-
}
|
|
82
|
-
last(opts) {
|
|
83
|
-
const item = this.peekLast();
|
|
84
|
-
return item ? this.goto(item, opts) : false;
|
|
85
|
-
}
|
|
86
|
-
peekFirst(items = this.inputs.items()) {
|
|
87
|
-
return items.find(i => this.inputs.focusManager.isFocusable(i));
|
|
88
|
-
}
|
|
89
|
-
peekLast(items = this.inputs.items()) {
|
|
90
|
-
for (let i = items.length - 1; i >= 0; i--) {
|
|
91
|
-
if (this.inputs.focusManager.isFocusable(items[i])) {
|
|
92
|
-
return items[i];
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
_advance(delta, opts) {
|
|
98
|
-
const item = this._peek(delta);
|
|
99
|
-
return item ? this.goto(item, opts) : false;
|
|
100
|
-
}
|
|
101
|
-
_peek(delta) {
|
|
102
|
-
const items = this.inputs.items();
|
|
103
|
-
const itemCount = items.length;
|
|
104
|
-
const startIndex = this.inputs.focusManager.activeIndex();
|
|
105
|
-
const step = i => this.inputs.wrap() ? (i + delta + itemCount) % itemCount : i + delta;
|
|
106
|
-
for (let i = step(startIndex); i !== startIndex && i < itemCount && i >= 0; i = step(i)) {
|
|
107
|
-
if (this.inputs.focusManager.isFocusable(items[i])) {
|
|
108
|
-
return items[i];
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export { ListFocus, ListNavigation };
|
|
116
|
-
//# sourceMappingURL=_list-navigation-chunk.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_list-navigation-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-focus/list-focus.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-navigation/list-navigation.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, WritableSignalLike} from '../signal-like/signal-like';\n\n/** Represents an item in a collection, such as a listbox option, than may receive focus. */\nexport interface ListFocusItem {\n /** A unique identifier for the item. */\n id: SignalLike<string>;\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement | undefined>;\n\n /** Whether an item is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The index of the item in the list. */\n index: SignalLike<number>;\n}\n\n/** Represents the required inputs for a collection that contains focusable items. */\nexport interface ListFocusInputs<T extends ListFocusItem> {\n /** The focus strategy used by the list. */\n focusMode: SignalLike<'roving' | 'activedescendant'>;\n\n /** Whether the list is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The items in the list. */\n items: SignalLike<T[]>;\n\n /** The active item. */\n activeItem: WritableSignalLike<T | undefined>;\n\n /** Whether disabled items in the list should be focusable. */\n softDisabled: SignalLike<boolean>;\n\n element: SignalLike<HTMLElement | undefined>;\n}\n\n/** Controls focus for a list of items. */\nexport class ListFocus<T extends ListFocusItem> {\n /** The last item that was active. */\n prevActiveItem = signal<T | undefined>(undefined);\n\n /** The index of the last item that was active. */\n prevActiveIndex = computed(() => {\n return this.prevActiveItem() ? this.inputs.items().indexOf(this.prevActiveItem()!) : -1;\n });\n\n /** The current active index in the list. */\n activeIndex = computed(() => {\n return this.inputs.activeItem() ? this.inputs.items().indexOf(this.inputs.activeItem()!) : -1;\n });\n\n constructor(readonly inputs: ListFocusInputs<T>) {}\n\n /** Whether the list is in a disabled state. */\n isListDisabled(): boolean {\n return this.inputs.disabled() || this.inputs.items().every(i => i.disabled());\n }\n\n /** The id of the current active item. */\n getActiveDescendant(): string | undefined {\n if (this.isListDisabled()) {\n return undefined;\n }\n if (this.inputs.focusMode() === 'roving') {\n return undefined;\n }\n return this.inputs.activeItem()?.id() ?? undefined;\n }\n\n /** The tab index for the list. */\n getListTabIndex(): -1 | 0 {\n if (this.isListDisabled()) {\n return 0;\n }\n return this.inputs.focusMode() === 'activedescendant' ? 0 : -1;\n }\n\n /** Returns the tab index for the given item. */\n getItemTabIndex(item: T): -1 | 0 {\n if (this.isListDisabled()) {\n return -1;\n }\n if (this.inputs.focusMode() === 'activedescendant') {\n return -1;\n }\n return this.inputs.activeItem() === item ? 0 : -1;\n }\n\n /** Moves focus to the given item if it is focusable. */\n focus(item: T, opts?: {focusElement?: boolean}): boolean {\n if (this.isListDisabled() || !this.isFocusable(item)) {\n return false;\n }\n\n this.prevActiveItem.set(this.inputs.activeItem());\n this.inputs.activeItem.set(item);\n\n if (opts?.focusElement || opts?.focusElement === undefined) {\n this.inputs.focusMode() === 'roving'\n ? item.element()?.focus()\n : this.inputs.element()?.focus();\n }\n\n return true;\n }\n\n /** Returns true if the given item can be navigated to. */\n isFocusable(item: T): boolean {\n return !item.disabled() || this.inputs.softDisabled();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SignalLike} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\n\n/** Represents an item in a collection, such as a listbox option, than can be navigated to. */\nexport interface ListNavigationItem extends ListFocusItem {}\n\n/** Represents the required inputs for a collection that has navigable items. */\nexport interface ListNavigationInputs<T extends ListNavigationItem> extends ListFocusInputs<T> {\n /** Whether focus should wrap when navigating. */\n wrap: SignalLike<boolean>;\n\n /** Whether the list is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** The direction that text is read based on the users locale. */\n textDirection: SignalLike<'rtl' | 'ltr'>;\n}\n\n/** Controls navigation for a list of items. */\nexport class ListNavigation<T extends ListNavigationItem> {\n constructor(readonly inputs: ListNavigationInputs<T> & {focusManager: ListFocus<T>}) {}\n\n /** Navigates to the given item. */\n goto(item?: T, opts?: {focusElement?: boolean}): boolean {\n return item ? this.inputs.focusManager.focus(item, opts) : false;\n }\n\n /** Navigates to the next item in the list. */\n next(opts?: {focusElement?: boolean}): boolean {\n return this._advance(1, opts);\n }\n\n /** Peeks the next item in the list. */\n peekNext(): T | undefined {\n return this._peek(1);\n }\n\n /** Navigates to the previous item in the list. */\n prev(opts?: {focusElement?: boolean}): boolean {\n return this._advance(-1, opts);\n }\n\n /** Peeks the previous item in the list. */\n peekPrev(): T | undefined {\n return this._peek(-1);\n }\n\n /** Navigates to the first item in the list. */\n first(opts?: {focusElement?: boolean}): boolean {\n const item = this.peekFirst();\n return item ? this.goto(item, opts) : false;\n }\n\n /** Navigates to the last item in the list. */\n last(opts?: {focusElement?: boolean}): boolean {\n const item = this.peekLast();\n return item ? this.goto(item, opts) : false;\n }\n\n /** Gets the first focusable item from the given list of items. */\n peekFirst(items: T[] = this.inputs.items()): T | undefined {\n return items.find(i => this.inputs.focusManager.isFocusable(i));\n }\n\n /** Gets the last focusable item from the given list of items. */\n peekLast(items: T[] = this.inputs.items()): T | undefined {\n for (let i = items.length - 1; i >= 0; i--) {\n if (this.inputs.focusManager.isFocusable(items[i])) {\n return items[i];\n }\n }\n return;\n }\n\n /** Advances to the next or previous focusable item in the list based on the given delta. */\n private _advance(delta: 1 | -1, opts?: {focusElement?: boolean}): boolean {\n const item = this._peek(delta);\n return item ? this.goto(item, opts) : false;\n }\n\n /** Peeks the next or previous focusable item in the list based on the given delta. */\n private _peek(delta: 1 | -1): T | undefined {\n const items = this.inputs.items();\n const itemCount = items.length;\n const startIndex = this.inputs.focusManager.activeIndex();\n const step = (i: number) =>\n this.inputs.wrap() ? (i + delta + itemCount) % itemCount : i + delta;\n\n // If wrapping is enabled, this loop ultimately terminates when `i` gets back to `startIndex`\n // in the case that all options are disabled. If wrapping is disabled, the loop terminates\n // when the index goes out of bounds.\n for (let i = step(startIndex); i !== startIndex && i < itemCount && i >= 0; i = step(i)) {\n if (this.inputs.focusManager.isFocusable(items[i])) {\n return items[i];\n }\n }\n\n return;\n }\n}\n"],"names":["ListFocus","inputs","prevActiveItem","signal","undefined","prevActiveIndex","computed","items","indexOf","activeIndex","activeItem","constructor","isListDisabled","disabled","every","i","getActiveDescendant","focusMode","id","getListTabIndex","getItemTabIndex","item","focus","opts","isFocusable","set","focusElement","element","softDisabled","ListNavigation","goto","focusManager","next","_advance","peekNext","_peek","prev","peekPrev","first","peekFirst","last","peekLast","find","length","delta","itemCount","startIndex","step","wrap"],"mappings":";;MA+CaA,SAAS,CAAA;EAcCC,MAAA;AAZrBC,EAAAA,cAAc,GAAGC,MAAM,CAAgBC,SAAS,CAAC;EAGjDC,eAAe,GAAGC,QAAQ,CAAC,MAAK;IAC9B,OAAO,IAAI,CAACJ,cAAc,EAAE,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
|
1
|
-
var Modifier;
|
|
2
|
-
(function (Modifier) {
|
|
3
|
-
Modifier[Modifier["None"] = 0] = "None";
|
|
4
|
-
Modifier[Modifier["Ctrl"] = 1] = "Ctrl";
|
|
5
|
-
Modifier[Modifier["Shift"] = 2] = "Shift";
|
|
6
|
-
Modifier[Modifier["Alt"] = 4] = "Alt";
|
|
7
|
-
Modifier[Modifier["Meta"] = 8] = "Meta";
|
|
8
|
-
Modifier["Any"] = "Any";
|
|
9
|
-
})(Modifier || (Modifier = {}));
|
|
10
|
-
class EventManager {
|
|
11
|
-
configs = [];
|
|
12
|
-
handle(event) {
|
|
13
|
-
for (const config of this.configs) {
|
|
14
|
-
if (config.matcher(event)) {
|
|
15
|
-
config.handler(event);
|
|
16
|
-
if (config.preventDefault) {
|
|
17
|
-
event.preventDefault();
|
|
18
|
-
}
|
|
19
|
-
if (config.stopPropagation) {
|
|
20
|
-
event.stopPropagation();
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function getModifiers(event) {
|
|
27
|
-
return (+event.ctrlKey && Modifier.Ctrl) | (+event.shiftKey && Modifier.Shift) | (+event.altKey && Modifier.Alt) | (+event.metaKey && Modifier.Meta);
|
|
28
|
-
}
|
|
29
|
-
function hasModifiers(event, modifiers) {
|
|
30
|
-
const eventModifiers = getModifiers(event);
|
|
31
|
-
const modifiersList = Array.isArray(modifiers) ? modifiers : [modifiers];
|
|
32
|
-
if (modifiersList.includes(Modifier.Any)) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
return modifiersList.some(modifiers => eventModifiers === modifiers);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
class KeyboardEventManager extends EventManager {
|
|
39
|
-
options = {
|
|
40
|
-
preventDefault: true,
|
|
41
|
-
stopPropagation: true
|
|
42
|
-
};
|
|
43
|
-
on(...args) {
|
|
44
|
-
const {
|
|
45
|
-
modifiers,
|
|
46
|
-
key,
|
|
47
|
-
handler,
|
|
48
|
-
options
|
|
49
|
-
} = this._normalizeInputs(...args);
|
|
50
|
-
this.configs.push({
|
|
51
|
-
handler: handler,
|
|
52
|
-
matcher: event => this._isMatch(event, key, modifiers),
|
|
53
|
-
...this.options,
|
|
54
|
-
...options
|
|
55
|
-
});
|
|
56
|
-
return this;
|
|
57
|
-
}
|
|
58
|
-
_normalizeInputs(...args) {
|
|
59
|
-
const withModifiers = Array.isArray(args[0]) || args[0] in Modifier;
|
|
60
|
-
const modifiers = withModifiers ? args[0] : Modifier.None;
|
|
61
|
-
const key = withModifiers ? args[1] : args[0];
|
|
62
|
-
const handler = withModifiers ? args[2] : args[1];
|
|
63
|
-
const options = withModifiers ? args[3] : args[2];
|
|
64
|
-
return {
|
|
65
|
-
key: key,
|
|
66
|
-
handler: handler,
|
|
67
|
-
modifiers: modifiers,
|
|
68
|
-
options: options ?? {}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
_isMatch(event, key, modifiers) {
|
|
72
|
-
if (!hasModifiers(event, modifiers)) {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
if (key instanceof RegExp) {
|
|
76
|
-
return key.test(event.key);
|
|
77
|
-
}
|
|
78
|
-
const keyStr = typeof key === 'string' ? key : key();
|
|
79
|
-
return keyStr.toLowerCase() === event.key.toLowerCase();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
var MouseButton;
|
|
84
|
-
(function (MouseButton) {
|
|
85
|
-
MouseButton[MouseButton["Main"] = 0] = "Main";
|
|
86
|
-
MouseButton[MouseButton["Auxiliary"] = 1] = "Auxiliary";
|
|
87
|
-
MouseButton[MouseButton["Secondary"] = 2] = "Secondary";
|
|
88
|
-
})(MouseButton || (MouseButton = {}));
|
|
89
|
-
class PointerEventManager extends EventManager {
|
|
90
|
-
options = {
|
|
91
|
-
preventDefault: false,
|
|
92
|
-
stopPropagation: false
|
|
93
|
-
};
|
|
94
|
-
on(...args) {
|
|
95
|
-
const {
|
|
96
|
-
button,
|
|
97
|
-
handler,
|
|
98
|
-
modifiers
|
|
99
|
-
} = this._normalizeInputs(...args);
|
|
100
|
-
this.configs.push({
|
|
101
|
-
handler,
|
|
102
|
-
matcher: event => this._isMatch(event, button, modifiers),
|
|
103
|
-
...this.options
|
|
104
|
-
});
|
|
105
|
-
return this;
|
|
106
|
-
}
|
|
107
|
-
_normalizeInputs(...args) {
|
|
108
|
-
if (args.length === 3) {
|
|
109
|
-
return {
|
|
110
|
-
button: args[0],
|
|
111
|
-
modifiers: args[1],
|
|
112
|
-
handler: args[2]
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
if (args.length === 2) {
|
|
116
|
-
return {
|
|
117
|
-
button: MouseButton.Main,
|
|
118
|
-
modifiers: args[0],
|
|
119
|
-
handler: args[1]
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
return {
|
|
123
|
-
button: MouseButton.Main,
|
|
124
|
-
modifiers: Modifier.None,
|
|
125
|
-
handler: args[0]
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
_isMatch(event, button, modifiers) {
|
|
129
|
-
return button === (event.button ?? 0) && hasModifiers(event, modifiers);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export { KeyboardEventManager, Modifier, PointerEventManager };
|
|
134
|
-
//# sourceMappingURL=_pointer-event-manager-chunk.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_pointer-event-manager-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/event-manager/event-manager.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/event-manager/keyboard-event-manager.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/event-manager/pointer-event-manager.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * An event that supports modifier keys.\n *\n * Matches the native KeyboardEvent, MouseEvent, and TouchEvent.\n */\nexport interface EventWithModifiers extends Event {\n ctrlKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n metaKey: boolean;\n}\n\n/**\n * Options that are applicable to all event handlers.\n *\n * This library has not yet had a need for stopPropagationImmediate.\n */\nexport interface EventHandlerOptions {\n stopPropagation: boolean;\n preventDefault: boolean;\n}\n\n/** A basic event handler. */\nexport type EventHandler<T extends Event> = (event: T) => void;\n\n/** A function that determines whether an event is to be handled. */\nexport type EventMatcher<T extends Event> = (event: T) => boolean;\n\n/** A config that specifies how to handle a particular event. */\nexport interface EventHandlerConfig<T extends Event> extends EventHandlerOptions {\n matcher: EventMatcher<T>;\n handler: EventHandler<T>;\n}\n\n/** Bit flag representation of the possible modifier keys that can be present on an event. */\nexport enum Modifier {\n None = 0,\n Ctrl = 0b1,\n Shift = 0b10,\n Alt = 0b100,\n Meta = 0b1000,\n Any = 'Any',\n}\n\nexport type ModifierInputs = Modifier | Modifier[];\n\n/**\n * Abstract base class for all event managers.\n *\n * Event managers are designed to normalize how event handlers are authored and create a safety net\n * for common event handling gotchas like remembering to call preventDefault or stopPropagation.\n */\nexport abstract class EventManager<T extends Event> {\n protected configs: EventHandlerConfig<T>[] = [];\n abstract options: EventHandlerOptions;\n\n /** Runs the handlers that match with the given event. */\n handle(event: T): void {\n for (const config of this.configs) {\n if (config.matcher(event)) {\n config.handler(event);\n\n if (config.preventDefault) {\n event.preventDefault();\n }\n\n if (config.stopPropagation) {\n event.stopPropagation();\n }\n }\n }\n }\n\n /** Configures the event manager to handle specific events. (See subclasses for more). */\n abstract on(...args: [...unknown[]]): this;\n}\n\n/** Gets bit flag representation of the modifier keys present on the given event. */\nexport function getModifiers(event: EventWithModifiers): number {\n return (\n (+event.ctrlKey && Modifier.Ctrl) |\n (+event.shiftKey && Modifier.Shift) |\n (+event.altKey && Modifier.Alt) |\n (+event.metaKey && Modifier.Meta)\n );\n}\n\n/**\n * Checks if the given event has modifiers that are an exact match for any of the given modifier\n * flag combinations.\n */\nexport function hasModifiers(event: EventWithModifiers, modifiers: ModifierInputs): boolean {\n const eventModifiers = getModifiers(event);\n const modifiersList = Array.isArray(modifiers) ? modifiers : [modifiers];\n\n if (modifiersList.includes(Modifier.Any)) {\n return true;\n }\n\n return modifiersList.some(modifiers => eventModifiers === modifiers);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SignalLike} from '../signal-like/signal-like';\nimport {\n EventHandler,\n EventHandlerOptions,\n EventManager,\n hasModifiers,\n ModifierInputs,\n Modifier,\n} from './event-manager';\n\n/**\n * Used to represent a keycode.\n *\n * This is used to match whether an events keycode should be handled. The ability to match using a\n * string, SignalLike, or Regexp gives us more flexibility when authoring event handlers.\n */\ntype KeyCode = string | SignalLike<string> | RegExp;\n\n/**\n * An event manager that is specialized for handling keyboard events. By default this manager stops\n * propagation and prevents default on all events it handles.\n */\nexport class KeyboardEventManager<T extends KeyboardEvent> extends EventManager<T> {\n options: EventHandlerOptions = {\n preventDefault: true,\n stopPropagation: true,\n };\n\n /** Configures this event manager to handle events with a specific key and no modifiers. */\n on(key: KeyCode, handler: EventHandler<T>, options?: Partial<EventHandlerOptions>): this;\n\n /** Configures this event manager to handle events with a specific modifer and key combination. */\n on(\n modifiers: ModifierInputs,\n key: KeyCode,\n handler: EventHandler<T>,\n options?: Partial<EventHandlerOptions>,\n ): this;\n\n on(...args: any[]) {\n const {modifiers, key, handler, options} = this._normalizeInputs(...args);\n\n this.configs.push({\n handler: handler,\n matcher: event => this._isMatch(event, key, modifiers),\n ...this.options,\n ...options,\n });\n\n return this;\n }\n\n private _normalizeInputs(...args: any[]) {\n const withModifiers = Array.isArray(args[0]) || args[0] in Modifier;\n const modifiers = withModifiers ? args[0] : Modifier.None;\n const key = withModifiers ? args[1] : args[0];\n const handler = withModifiers ? args[2] : args[1];\n const options = withModifiers ? args[3] : args[2];\n\n return {\n key: key as KeyCode,\n handler: handler as EventHandler<T>,\n modifiers: modifiers as ModifierInputs,\n options: (options ?? {}) as Partial<EventHandlerOptions>,\n };\n }\n\n private _isMatch(event: T, key: KeyCode, modifiers: ModifierInputs) {\n if (!hasModifiers(event, modifiers)) {\n return false;\n }\n\n if (key instanceof RegExp) {\n return key.test(event.key);\n }\n\n const keyStr = typeof key === 'string' ? key : key();\n return keyStr.toLowerCase() === event.key.toLowerCase();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n EventHandler,\n EventHandlerOptions,\n EventManager,\n hasModifiers,\n ModifierInputs,\n Modifier,\n} from './event-manager';\n\n/**\n * The different mouse buttons that may appear on a pointer event.\n */\nexport enum MouseButton {\n Main = 0,\n Auxiliary = 1,\n Secondary = 2,\n}\n\n/** An event manager that is specialized for handling pointer events. */\nexport class PointerEventManager<T extends PointerEvent> extends EventManager<T> {\n options: EventHandlerOptions = {\n preventDefault: false,\n stopPropagation: false,\n };\n\n /**\n * Configures this event manager to handle events with a specific modifer and mouse button\n * combination.\n */\n on(button: MouseButton, modifiers: ModifierInputs, handler: EventHandler<T>): this;\n\n /**\n * Configures this event manager to handle events with a specific mouse button and no modifiers.\n */\n on(modifiers: ModifierInputs, handler: EventHandler<T>): this;\n\n /**\n * Configures this event manager to handle events with the main mouse button and no modifiers.\n *\n * @param handler The handler function\n * @param options Options for whether to stop propagation or prevent default.\n */\n on(handler: EventHandler<T>): this;\n\n on(...args: any[]) {\n const {button, handler, modifiers} = this._normalizeInputs(...args);\n\n this.configs.push({\n handler,\n matcher: event => this._isMatch(event, button, modifiers),\n ...this.options,\n });\n return this;\n }\n\n private _normalizeInputs(...args: any[]) {\n if (args.length === 3) {\n return {\n button: args[0] as MouseButton,\n modifiers: args[1] as ModifierInputs,\n handler: args[2] as EventHandler<T>,\n };\n }\n\n if (args.length === 2) {\n return {\n button: MouseButton.Main,\n modifiers: args[0] as ModifierInputs,\n handler: args[1] as EventHandler<T>,\n };\n }\n\n return {\n button: MouseButton.Main,\n modifiers: Modifier.None,\n handler: args[0] as EventHandler<T>,\n };\n }\n\n _isMatch(event: PointerEvent, button: MouseButton, modifiers: ModifierInputs) {\n return button === (event.button ?? 0) && hasModifiers(event, modifiers);\n }\n}\n"],"names":["Modifier","EventManager","configs","handle","event","config","matcher","handler","preventDefault","stopPropagation","getModifiers","ctrlKey","Ctrl","shiftKey","Shift","altKey","Alt","metaKey","Meta","hasModifiers","modifiers","eventModifiers","modifiersList","Array","isArray","includes","Any","some","KeyboardEventManager","options","on","args","key","_normalizeInputs","push","_isMatch","withModifiers","None","RegExp","test","keyStr","toLowerCase","MouseButton","PointerEventManager","button","length","Main"],"mappings":"IA2CYA;AAAZ,CAAA,UAAYA,QAAQ,EAAA;EAClBA,QAAA,CAAAA,QAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;EACRA,QAAA,CAAAA,QAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAU;EACVA,QAAA,CAAAA,QAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAY;EACZA,QAAA,CAAAA,QAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,GAAA,KAAW;EACXA,QAAA,CAAAA,QAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAa;AACbA,EAAAA,QAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACb,CAAC,EAPWA,QAAQ,KAARA,QAAQ,GAOnB,EAAA,CAAA,CAAA;MAUqBC,YAAY,CAAA;AACtBC,EAAAA,OAAO,GAA4B,EAAE;EAI/CC,MAAMA,CAACC,KAAQ,EAAA;AACb,IAAA,KAAK,M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AACS;AACT,KAAA,CAAC;AACF,IAAA,OAAO,IAAI;AACb;EAEQI,gBAAgBA,CAAC,GAAGF,IAAW,EAAA;AACrC,IAAA,IAAIA,IAAI,CAACc,MAAM,KAAK,CAAC,EAAE;MACrB,OAAO;AACLD,QAAAA,MAAM,EAAEb,IAAI,CAAC,CAAC,CAAgB;AAC9BX,QAAAA,SAAS,EAAEW,IAAI,CAAC,CAAC,CAAmB;QACpCxB,OAAO,EAAEwB,IAAI,CAAC,CAAC;OAChB;AACH;AAEA,IAAA,IAAIA,IAAI,CAACc,MAAM,KAAK,CAAC,EAAE;MACrB,OAAO;QACLD,MAAM,EAAEF,WAAW,CAACI,IAAI;AACxB1B,QAAAA,SAAS,EAAEW,IAAI,CAAC,CAAC,CAAmB;QACpCxB,OAAO,EAAEwB,IAAI,CAAC,CAAC;OAChB;AACH;IAEA,OAAO;MACLa,MAAM,EAAEF,WAAW,CAACI,IAAI;MACxB1B,SAAS,EAAEpB,QAAQ,CAACqC,IAAI;MACxB9B,OAAO,EAAEwB,IAAI,CAAC,CAAC;KAChB;AACH;AAEAI,EAAAA,QAAQA,CAAC/B,KAAmB,EAAEwC,MAAmB,EAAExB,SAAyB,EAAA;AAC1E,IAAA,OAAOwB,MAAM,MAAMxC,KAAK,CAACwC,MAAM,IAAI,CAAC,CAAC,IAAIzB,YAAY,CAACf,KAAK,EAAEgB,SAAS,CAAC;AACzE;AACD;;;;"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import * as _angular_core from '@angular/core';
|
|
2
|
-
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
3
|
-
import * as i1 from '@angular/aria/private';
|
|
4
|
-
import { ComboboxListboxControls, ComboboxTreeControls, ComboboxDialogPattern, ComboboxPattern } from '@angular/aria/private';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Identifies an element as a popup for an `ngCombobox`.
|
|
8
|
-
*
|
|
9
|
-
* This directive acts as a bridge, allowing the `ngCombobox` to discover and interact
|
|
10
|
-
* with the underlying control (e.g., `ngListbox`, `ngTree`, or `ngComboboxDialog`) that
|
|
11
|
-
* manages the options. It's primarily used as a host directive and is responsible for
|
|
12
|
-
* exposing the popup's control pattern to the parent combobox.
|
|
13
|
-
*
|
|
14
|
-
* @developerPreview 21.0
|
|
15
|
-
*/
|
|
16
|
-
declare class ComboboxPopup<V> {
|
|
17
|
-
/** The combobox that the popup belongs to. */
|
|
18
|
-
readonly combobox: Combobox<V> | null;
|
|
19
|
-
/** The popup controls exposed to the combobox. */
|
|
20
|
-
readonly _controls: _angular_core.WritableSignal<ComboboxListboxControls<any, V> | ComboboxTreeControls<any, V> | ComboboxDialogPattern | undefined>;
|
|
21
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ComboboxPopup<any>, never>;
|
|
22
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxPopup<any>, "[ngComboboxPopup]", ["ngComboboxPopup"], {}, {}, never, never, true, never>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* The container element that wraps a combobox input and popup, and orchestrates its behavior.
|
|
27
|
-
*
|
|
28
|
-
* The `ngCombobox` directive is the main entry point for creating a combobox and customizing its
|
|
29
|
-
* behavior. It coordinates the interactions between the `ngComboboxInput` and the popup, which
|
|
30
|
-
* is defined by a `ng-template` with the `ngComboboxPopupContainer` directive. If using the
|
|
31
|
-
* `CdkOverlay`, the `cdkConnectedOverlay` directive takes the place of `ngComboboxPopupContainer`.
|
|
32
|
-
*
|
|
33
|
-
* ```html
|
|
34
|
-
* <div ngCombobox filterMode="highlight">
|
|
35
|
-
* <input
|
|
36
|
-
* ngComboboxInput
|
|
37
|
-
* placeholder="Search for a state..."
|
|
38
|
-
* [(value)]="searchString"
|
|
39
|
-
* />
|
|
40
|
-
*
|
|
41
|
-
* <ng-template ngComboboxPopupContainer>
|
|
42
|
-
* <div ngListbox [(value)]="selectedValue">
|
|
43
|
-
* @for (option of filteredOptions(); track option) {
|
|
44
|
-
* <div ngOption [value]="option" [label]="option">
|
|
45
|
-
* <span>{{option}}</span>
|
|
46
|
-
* </div>
|
|
47
|
-
* }
|
|
48
|
-
* </div>
|
|
49
|
-
* </ng-template>
|
|
50
|
-
* </div>
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* @developerPreview 21.0
|
|
54
|
-
*/
|
|
55
|
-
declare class Combobox<V> {
|
|
56
|
-
/** The directionality (LTR / RTL) context for the application (or a subtree of it). */
|
|
57
|
-
private readonly _directionality;
|
|
58
|
-
/** A signal wrapper for directionality. */
|
|
59
|
-
protected textDirection: _angular_core.Signal<_angular_cdk_bidi.Direction>;
|
|
60
|
-
/** The element that the combobox is attached to. */
|
|
61
|
-
private readonly _elementRef;
|
|
62
|
-
/** A reference to the combobox element. */
|
|
63
|
-
readonly element: HTMLElement;
|
|
64
|
-
/** The DeferredContentAware host directive. */
|
|
65
|
-
private readonly _deferredContentAware;
|
|
66
|
-
/** The combobox popup. */
|
|
67
|
-
readonly popup: _angular_core.Signal<ComboboxPopup<V> | undefined>;
|
|
68
|
-
/**
|
|
69
|
-
* The filter mode for the combobox.
|
|
70
|
-
* - `manual`: The consumer is responsible for filtering the options.
|
|
71
|
-
* - `auto-select`: The combobox automatically selects the first matching option.
|
|
72
|
-
* - `highlight`: The combobox highlights matching text in the options without changing selection.
|
|
73
|
-
*/
|
|
74
|
-
filterMode: _angular_core.InputSignal<"manual" | "auto-select" | "highlight">;
|
|
75
|
-
/** Whether the combobox is disabled. */
|
|
76
|
-
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
77
|
-
/** Whether the combobox is read-only. */
|
|
78
|
-
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
79
|
-
/** The value of the first matching item in the popup. */
|
|
80
|
-
readonly firstMatch: _angular_core.InputSignal<V | undefined>;
|
|
81
|
-
/** Whether the combobox is expanded. */
|
|
82
|
-
readonly expanded: _angular_core.Signal<boolean>;
|
|
83
|
-
/** Whether the combobox popup should always be expanded, regardless of user interaction. */
|
|
84
|
-
readonly alwaysExpanded: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
85
|
-
/** Input element connected to the combobox, if any. */
|
|
86
|
-
readonly inputElement: _angular_core.Signal<HTMLInputElement | undefined>;
|
|
87
|
-
/** The combobox ui pattern. */
|
|
88
|
-
readonly _pattern: ComboboxPattern<any, V>;
|
|
89
|
-
constructor();
|
|
90
|
-
/** Opens the combobox to the selected item. */
|
|
91
|
-
open(): void;
|
|
92
|
-
/** Closes the combobox. */
|
|
93
|
-
close(): void;
|
|
94
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<Combobox<any>, never>;
|
|
95
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Combobox<any>, "[ngCombobox]", ["ngCombobox"], { "filterMode": { "alias": "filterMode"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "firstMatch": { "alias": "firstMatch"; "required": false; "isSignal": true; }; "alwaysExpanded": { "alias": "alwaysExpanded"; "required": false; "isSignal": true; }; }, {}, ["popup"], never, true, [{ directive: typeof i1.DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export { Combobox, ComboboxPopup };
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { SignalLike, WritableSignalLike, KeyboardEventManager, PointerEventManager } from './_list-navigation-chunk.js';
|
|
3
|
-
import { ListItem } from './_list-chunk.js';
|
|
4
|
-
|
|
5
|
-
/** Represents the required inputs for a combobox. */
|
|
6
|
-
interface ComboboxInputs<T extends ListItem<V>, V> {
|
|
7
|
-
/** The controls for the popup associated with the combobox. */
|
|
8
|
-
popupControls: SignalLike<ComboboxListboxControls<T, V> | ComboboxTreeControls<T, V> | ComboboxDialogPattern | undefined>;
|
|
9
|
-
/** The HTML input element that serves as the combobox input. */
|
|
10
|
-
inputEl: SignalLike<HTMLInputElement | undefined>;
|
|
11
|
-
/** The HTML element that serves as the combobox container. */
|
|
12
|
-
containerEl: SignalLike<HTMLElement | undefined>;
|
|
13
|
-
/** The filtering mode for the combobox. */
|
|
14
|
-
filterMode: SignalLike<'manual' | 'auto-select' | 'highlight'>;
|
|
15
|
-
/** The current value of the combobox. */
|
|
16
|
-
inputValue?: WritableSignalLike<string>;
|
|
17
|
-
/** The value of the first matching item in the popup. */
|
|
18
|
-
firstMatch: SignalLike<V | undefined>;
|
|
19
|
-
/** Whether the combobox is disabled. */
|
|
20
|
-
disabled: SignalLike<boolean>;
|
|
21
|
-
/** Whether the combobox is read-only. */
|
|
22
|
-
readonly: SignalLike<boolean>;
|
|
23
|
-
/** Whether the combobox is in a right-to-left context. */
|
|
24
|
-
textDirection: SignalLike<'rtl' | 'ltr'>;
|
|
25
|
-
/** Whether the combobox is always expanded. */
|
|
26
|
-
alwaysExpanded: SignalLike<boolean>;
|
|
27
|
-
}
|
|
28
|
-
/** An interface that allows combobox popups to expose the necessary controls for the combobox. */
|
|
29
|
-
interface ComboboxListboxControls<T extends ListItem<V>, V> {
|
|
30
|
-
/** A unique identifier for the popup. */
|
|
31
|
-
id: () => string;
|
|
32
|
-
/** The ARIA role for the popup. */
|
|
33
|
-
role: SignalLike<'listbox' | 'tree' | 'grid'>;
|
|
34
|
-
/** Whether multiple items in the popup can be selected at once. */
|
|
35
|
-
multi: SignalLike<boolean>;
|
|
36
|
-
/** The ID of the active item in the popup. */
|
|
37
|
-
activeId: SignalLike<string | undefined>;
|
|
38
|
-
/** The list of items in the popup. */
|
|
39
|
-
items: SignalLike<T[]>;
|
|
40
|
-
/** Navigates to the given item in the popup. */
|
|
41
|
-
focus: (item: T, opts?: {
|
|
42
|
-
focusElement?: boolean;
|
|
43
|
-
}) => void;
|
|
44
|
-
/** Navigates to the next item in the popup. */
|
|
45
|
-
next: () => void;
|
|
46
|
-
/** Navigates to the previous item in the popup. */
|
|
47
|
-
prev: () => void;
|
|
48
|
-
/** Navigates to the first item in the popup. */
|
|
49
|
-
first: () => void;
|
|
50
|
-
/** Navigates to the last item in the popup. */
|
|
51
|
-
last: () => void;
|
|
52
|
-
/** Selects the current item in the popup. */
|
|
53
|
-
select: (item?: T) => void;
|
|
54
|
-
/** Toggles the selection state of the given item in the popup. */
|
|
55
|
-
toggle: (item?: T) => void;
|
|
56
|
-
/** Clears the selection state of the popup. */
|
|
57
|
-
clearSelection: () => void;
|
|
58
|
-
/** Removes focus from any item in the popup. */
|
|
59
|
-
unfocus: () => void;
|
|
60
|
-
/** Returns the item corresponding to the given event. */
|
|
61
|
-
getItem: (e: PointerEvent) => T | undefined;
|
|
62
|
-
/** Returns the currently active (focused) item in the popup. */
|
|
63
|
-
getActiveItem: () => T | undefined;
|
|
64
|
-
/** Returns the currently selected items in the popup. */
|
|
65
|
-
getSelectedItems: () => T[];
|
|
66
|
-
/** Sets the value of the combobox based on the selected item. */
|
|
67
|
-
setValue: (value: V | undefined) => void;
|
|
68
|
-
}
|
|
69
|
-
interface ComboboxTreeControls<T extends ListItem<V>, V> extends ComboboxListboxControls<T, V> {
|
|
70
|
-
/** Whether the currently active item in the popup is collapsible. */
|
|
71
|
-
isItemCollapsible: () => boolean;
|
|
72
|
-
/** Expands the currently active item in the popup. */
|
|
73
|
-
expandItem: () => void;
|
|
74
|
-
/** Collapses the currently active item in the popup. */
|
|
75
|
-
collapseItem: () => void;
|
|
76
|
-
/** Checks if the currently active item in the popup is expandable. */
|
|
77
|
-
isItemExpandable: (item?: T) => boolean;
|
|
78
|
-
/** Expands all nodes in the tree. */
|
|
79
|
-
expandAll: () => void;
|
|
80
|
-
/** Collapses all nodes in the tree. */
|
|
81
|
-
collapseAll: () => void;
|
|
82
|
-
/** Toggles the expansion state of the currently active item in the popup. */
|
|
83
|
-
toggleExpansion: (item?: T) => void;
|
|
84
|
-
/** Whether the current active item is selectable. */
|
|
85
|
-
isItemSelectable: (item?: T) => boolean;
|
|
86
|
-
}
|
|
87
|
-
/** Controls the state of a combobox. */
|
|
88
|
-
declare class ComboboxPattern<T extends ListItem<V>, V> {
|
|
89
|
-
readonly inputs: ComboboxInputs<T, V>;
|
|
90
|
-
/** Whether the combobox is expanded. */
|
|
91
|
-
expanded: _angular_core.WritableSignal<boolean>;
|
|
92
|
-
/** Whether the combobox is disabled. */
|
|
93
|
-
disabled: () => boolean;
|
|
94
|
-
/** The ID of the active item in the combobox. */
|
|
95
|
-
activeDescendant: _angular_core.Signal<string | null>;
|
|
96
|
-
/** The currently highlighted item in the combobox. */
|
|
97
|
-
highlightedItem: _angular_core.WritableSignal<T | undefined>;
|
|
98
|
-
/** Whether the most recent input event was a deletion. */
|
|
99
|
-
isDeleting: boolean;
|
|
100
|
-
/** Whether the combobox is focused. */
|
|
101
|
-
isFocused: _angular_core.WritableSignal<boolean>;
|
|
102
|
-
/** Whether the combobox has ever been focused. */
|
|
103
|
-
hasBeenFocused: _angular_core.WritableSignal<boolean>;
|
|
104
|
-
/** The key used to navigate to the previous item in the list. */
|
|
105
|
-
expandKey: _angular_core.Signal<"ArrowLeft" | "ArrowRight">;
|
|
106
|
-
/** The key used to navigate to the next item in the list. */
|
|
107
|
-
collapseKey: _angular_core.Signal<"ArrowLeft" | "ArrowRight">;
|
|
108
|
-
/** The ID of the popup associated with the combobox. */
|
|
109
|
-
popupId: _angular_core.Signal<string | null>;
|
|
110
|
-
/** The autocomplete behavior of the combobox. */
|
|
111
|
-
autocomplete: _angular_core.Signal<"both" | "list">;
|
|
112
|
-
/** The ARIA role of the popup associated with the combobox. */
|
|
113
|
-
hasPopup: _angular_core.Signal<"listbox" | "tree" | "grid" | "dialog" | null>;
|
|
114
|
-
/** Whether the combobox is read-only. */
|
|
115
|
-
readonly: _angular_core.Signal<true | null>;
|
|
116
|
-
/** Returns the listbox controls for the combobox. */
|
|
117
|
-
listControls: () => ComboboxListboxControls<T, V> | null | undefined;
|
|
118
|
-
/** Returns the tree controls for the combobox. */
|
|
119
|
-
treeControls: () => ComboboxTreeControls<T, V> | null;
|
|
120
|
-
/** The keydown event manager for the combobox. */
|
|
121
|
-
keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
|
|
122
|
-
/** The click event manager for the combobox. */
|
|
123
|
-
click: _angular_core.Signal<PointerEventManager<PointerEvent>>;
|
|
124
|
-
constructor(inputs: ComboboxInputs<T, V>);
|
|
125
|
-
/** Handles keydown events for the combobox. */
|
|
126
|
-
onKeydown(event: KeyboardEvent): void;
|
|
127
|
-
/** Handles click events for the combobox. */
|
|
128
|
-
onClick(event: MouseEvent): void;
|
|
129
|
-
/** Handles input events for the combobox. */
|
|
130
|
-
onInput(event: Event): void;
|
|
131
|
-
/** Handles focus in events for the combobox. */
|
|
132
|
-
onFocusIn(): void;
|
|
133
|
-
/** Handles focus out events for the combobox. */
|
|
134
|
-
onFocusOut(event: FocusEvent): void;
|
|
135
|
-
/** The first matching item in the combobox. */
|
|
136
|
-
firstMatch: _angular_core.Signal<T | undefined>;
|
|
137
|
-
/** Handles filtering logic for the combobox. */
|
|
138
|
-
onFilter(): void;
|
|
139
|
-
/** Highlights the currently selected item in the combobox. */
|
|
140
|
-
highlight(): void;
|
|
141
|
-
/** Closes the combobox. */
|
|
142
|
-
close(opts?: {
|
|
143
|
-
reset: boolean;
|
|
144
|
-
}): void;
|
|
145
|
-
/** Opens the combobox. */
|
|
146
|
-
open(nav?: {
|
|
147
|
-
first?: boolean;
|
|
148
|
-
last?: boolean;
|
|
149
|
-
selected?: boolean;
|
|
150
|
-
}): void;
|
|
151
|
-
/** Navigates to the next focusable item in the combobox popup. */
|
|
152
|
-
next(): void;
|
|
153
|
-
/** Navigates to the previous focusable item in the combobox popup. */
|
|
154
|
-
prev(): void;
|
|
155
|
-
/** Navigates to the first focusable item in the combobox popup. */
|
|
156
|
-
first(): void;
|
|
157
|
-
/** Navigates to the last focusable item in the combobox popup. */
|
|
158
|
-
last(): void;
|
|
159
|
-
/** Collapses the currently focused item in the combobox. */
|
|
160
|
-
collapseItem(): void;
|
|
161
|
-
/** Expands the currently focused item in the combobox. */
|
|
162
|
-
expandItem(): void;
|
|
163
|
-
/** Selects an item in the combobox popup. */
|
|
164
|
-
select(opts?: {
|
|
165
|
-
item?: T;
|
|
166
|
-
commit?: boolean;
|
|
167
|
-
close?: boolean;
|
|
168
|
-
}): void;
|
|
169
|
-
/** Updates the value of the input based on the currently selected item. */
|
|
170
|
-
commit(): void;
|
|
171
|
-
/** Navigates and handles additional actions based on filter mode. */
|
|
172
|
-
private _navigate;
|
|
173
|
-
}
|
|
174
|
-
declare class ComboboxDialogPattern {
|
|
175
|
-
readonly inputs: {
|
|
176
|
-
combobox: ComboboxPattern<any, any>;
|
|
177
|
-
element: SignalLike<HTMLDialogElement>;
|
|
178
|
-
id: SignalLike<string>;
|
|
179
|
-
};
|
|
180
|
-
id: () => string;
|
|
181
|
-
role: () => "dialog";
|
|
182
|
-
keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
|
|
183
|
-
constructor(inputs: {
|
|
184
|
-
combobox: ComboboxPattern<any, any>;
|
|
185
|
-
element: SignalLike<HTMLDialogElement>;
|
|
186
|
-
id: SignalLike<string>;
|
|
187
|
-
});
|
|
188
|
-
onKeydown(event: KeyboardEvent): void;
|
|
189
|
-
onClick(event: MouseEvent): void;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export { ComboboxDialogPattern, ComboboxPattern };
|
|
193
|
-
export type { ComboboxInputs, ComboboxListboxControls, ComboboxTreeControls };
|