@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,19 +1,17 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { e as ListNavigationItem, f as ListFocusItem, S as SignalLike, d as ListFocus, b as ListNavigation, L as ListNavigationInputs, a as ListFocusInputs, K as KeyboardEventManager, P as PointerEventManager } from './pointer-event-manager.d-BqSm9Jh5.js';
|
|
2
|
+
import { SignalLike, KeyboardEventManager, PointerEventManager } from './pointer-event-manager.d.js';
|
|
3
|
+
import { ListItem, ListInputs, List } from './list.d.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Represents the properties exposed by a listbox that need to be accessed by an option.
|
|
8
7
|
* This exists to avoid circular dependency errors between the listbox and option.
|
|
9
8
|
*/
|
|
10
9
|
interface ListboxPattern$1<V> {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
navigation: ListNavigation<OptionPattern<V>>;
|
|
10
|
+
inputs: ListInputs<OptionPattern<V>, V>;
|
|
11
|
+
listBehavior: List<OptionPattern<V>, V>;
|
|
14
12
|
}
|
|
15
13
|
/** Represents the required inputs for an option in a listbox. */
|
|
16
|
-
interface OptionInputs<V> extends
|
|
14
|
+
interface OptionInputs<V> extends Omit<ListItem<V>, 'index'> {
|
|
17
15
|
listbox: SignalLike<ListboxPattern$1<V> | undefined>;
|
|
18
16
|
}
|
|
19
17
|
/** Represents an option in a listbox. */
|
|
@@ -41,28 +39,14 @@ declare class OptionPattern<V> {
|
|
|
41
39
|
constructor(args: OptionInputs<V>);
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
/** The selection operations that the listbox can perform. */
|
|
45
|
-
interface SelectOptions {
|
|
46
|
-
toggle?: boolean;
|
|
47
|
-
selectOne?: boolean;
|
|
48
|
-
selectRange?: boolean;
|
|
49
|
-
anchor?: boolean;
|
|
50
|
-
}
|
|
51
42
|
/** Represents the required inputs for a listbox. */
|
|
52
|
-
type ListboxInputs<V> =
|
|
43
|
+
type ListboxInputs<V> = ListInputs<OptionPattern<V>, V> & {
|
|
53
44
|
readonly: SignalLike<boolean>;
|
|
54
45
|
};
|
|
55
46
|
/** Controls the state of a listbox. */
|
|
56
47
|
declare class ListboxPattern<V> {
|
|
57
48
|
readonly inputs: ListboxInputs<V>;
|
|
58
|
-
|
|
59
|
-
navigation: ListNavigation<OptionPattern<V>>;
|
|
60
|
-
/** Controls selection for the listbox. */
|
|
61
|
-
selection: ListSelection<OptionPattern<V>, V>;
|
|
62
|
-
/** Controls typeahead for the listbox. */
|
|
63
|
-
typeahead: ListTypeahead<OptionPattern<V>>;
|
|
64
|
-
/** Controls focus for the listbox. */
|
|
65
|
-
focusManager: ListFocus<OptionPattern<V>>;
|
|
49
|
+
listBehavior: List<OptionPattern<V>, V>;
|
|
66
50
|
/** Whether the list is vertically or horizontally oriented. */
|
|
67
51
|
orientation: SignalLike<'vertical' | 'horizontal'>;
|
|
68
52
|
/** Whether the listbox is disabled. */
|
|
@@ -89,19 +73,6 @@ declare class ListboxPattern<V> {
|
|
|
89
73
|
dynamicSpaceKey: _angular_core.Signal<"" | " ">;
|
|
90
74
|
/** The regexp used to decide if a key should trigger typeahead. */
|
|
91
75
|
typeaheadRegexp: RegExp;
|
|
92
|
-
/**
|
|
93
|
-
* The uncommitted index for selecting a range of options.
|
|
94
|
-
*
|
|
95
|
-
* NOTE: This is subtly distinct from the "rangeStartIndex" in the ListSelection behavior.
|
|
96
|
-
* The anchorIndex does not necessarily represent the start of a range, but represents the most
|
|
97
|
-
* recent index where the user showed intent to begin a range selection. Usually, this is wherever
|
|
98
|
-
* the user most recently pressed the "Shift" key, but if the user presses shift + space to select
|
|
99
|
-
* from the anchor, the user is not intending to start a new range from this index.
|
|
100
|
-
*
|
|
101
|
-
* In other words, "rangeStartIndex" is only set when a user commits to starting a range selection
|
|
102
|
-
* while "anchorIndex" is set whenever a user indicates they may be starting a range selection.
|
|
103
|
-
*/
|
|
104
|
-
anchorIndex: _angular_core.WritableSignal<number>;
|
|
105
76
|
/** The keydown event manager for the listbox. */
|
|
106
77
|
keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
|
|
107
78
|
/** The pointerdown event manager for the listbox. */
|
|
@@ -112,18 +83,6 @@ declare class ListboxPattern<V> {
|
|
|
112
83
|
/** Handles keydown events for the listbox. */
|
|
113
84
|
onKeydown(event: KeyboardEvent): void;
|
|
114
85
|
onPointerdown(event: PointerEvent): void;
|
|
115
|
-
/** Navigates to the first option in the listbox. */
|
|
116
|
-
first(opts?: SelectOptions): void;
|
|
117
|
-
/** Navigates to the last option in the listbox. */
|
|
118
|
-
last(opts?: SelectOptions): void;
|
|
119
|
-
/** Navigates to the next option in the listbox. */
|
|
120
|
-
next(opts?: SelectOptions): void;
|
|
121
|
-
/** Navigates to the previous option in the listbox. */
|
|
122
|
-
prev(opts?: SelectOptions): void;
|
|
123
|
-
/** Navigates to the given item in the listbox. */
|
|
124
|
-
goto(event: PointerEvent, opts?: SelectOptions): void;
|
|
125
|
-
/** Handles typeahead search navigation for the listbox. */
|
|
126
|
-
search(char: string, opts?: SelectOptions): void;
|
|
127
86
|
/**
|
|
128
87
|
* Sets the listbox to it's default initial state.
|
|
129
88
|
*
|
|
@@ -135,20 +94,8 @@ declare class ListboxPattern<V> {
|
|
|
135
94
|
* is called.
|
|
136
95
|
*/
|
|
137
96
|
setDefaultState(): void;
|
|
138
|
-
/**
|
|
139
|
-
* Safely performs a navigation operation.
|
|
140
|
-
*
|
|
141
|
-
* Handles conditionally disabling wrapping for when a navigation
|
|
142
|
-
* operation is occurring while the user is selecting a range of options.
|
|
143
|
-
*
|
|
144
|
-
* Handles boilerplate calling of focus & selection operations. Also ensures these
|
|
145
|
-
* additional operations are only called if the navigation operation moved focus to a new option.
|
|
146
|
-
*/
|
|
147
|
-
private _navigate;
|
|
148
|
-
/** Handles updating selection for the listbox. */
|
|
149
|
-
private _updateSelection;
|
|
150
97
|
private _getItem;
|
|
151
98
|
}
|
|
152
99
|
|
|
153
|
-
export { ListboxPattern
|
|
154
|
-
export type { ListboxInputs
|
|
100
|
+
export { ListboxPattern, OptionPattern };
|
|
101
|
+
export type { ListboxInputs, OptionInputs };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cdk-experimental",
|
|
3
|
-
"version": "20.2.0-
|
|
3
|
+
"version": "20.2.0-rc.0",
|
|
4
4
|
"description": "Experimental components for Angular CDK",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/angular/components#readme",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@angular/cdk": "20.2.0-
|
|
15
|
+
"@angular/cdk": "20.2.0-rc.0",
|
|
16
16
|
"@angular/core": "^20.0.0-0 || ^20.1.0-0 || ^20.2.0-0 || ^20.3.0-0 || ^21.0.0-0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
@@ -88,6 +88,10 @@
|
|
|
88
88
|
"types": "./tabs/index.d.ts",
|
|
89
89
|
"default": "./fesm2022/tabs.mjs"
|
|
90
90
|
},
|
|
91
|
+
"./toolbar": {
|
|
92
|
+
"types": "./toolbar/index.d.ts",
|
|
93
|
+
"default": "./fesm2022/toolbar.mjs"
|
|
94
|
+
},
|
|
91
95
|
"./tree": {
|
|
92
96
|
"types": "./tree/index.d.ts",
|
|
93
97
|
"default": "./fesm2022/tree.mjs"
|
|
@@ -16,6 +16,8 @@ interface ListFocusItem {
|
|
|
16
16
|
element: SignalLike<HTMLElement>;
|
|
17
17
|
/** Whether an item is disabled. */
|
|
18
18
|
disabled: SignalLike<boolean>;
|
|
19
|
+
/** The index of the item in the list. */
|
|
20
|
+
index: SignalLike<number>;
|
|
19
21
|
}
|
|
20
22
|
/** Represents the required inputs for a collection that contains focusable items. */
|
|
21
23
|
interface ListFocusInputs<T extends ListFocusItem> {
|
|
@@ -25,18 +27,20 @@ interface ListFocusInputs<T extends ListFocusItem> {
|
|
|
25
27
|
disabled: SignalLike<boolean>;
|
|
26
28
|
/** The items in the list. */
|
|
27
29
|
items: SignalLike<T[]>;
|
|
28
|
-
/** The
|
|
29
|
-
|
|
30
|
+
/** The active item. */
|
|
31
|
+
activeItem: WritableSignalLike<T | undefined>;
|
|
30
32
|
/** Whether disabled items in the list should be skipped when navigating. */
|
|
31
33
|
skipDisabled: SignalLike<boolean>;
|
|
32
34
|
}
|
|
33
35
|
/** Controls focus for a list of items. */
|
|
34
36
|
declare class ListFocus<T extends ListFocusItem> {
|
|
35
37
|
readonly inputs: ListFocusInputs<T>;
|
|
36
|
-
/** The last
|
|
37
|
-
|
|
38
|
-
/** The
|
|
39
|
-
|
|
38
|
+
/** The last item that was active. */
|
|
39
|
+
prevActiveItem: _angular_core.WritableSignal<T | undefined>;
|
|
40
|
+
/** The index of the last item that was active. */
|
|
41
|
+
prevActiveIndex: _angular_core.Signal<number>;
|
|
42
|
+
/** The current active index in the list. */
|
|
43
|
+
activeIndex: _angular_core.Signal<number>;
|
|
40
44
|
constructor(inputs: ListFocusInputs<T>);
|
|
41
45
|
/** Whether the list is in a disabled state. */
|
|
42
46
|
isListDisabled(): boolean;
|
|
@@ -181,5 +185,5 @@ declare class PointerEventManager<T extends PointerEvent> extends EventManager<T
|
|
|
181
185
|
_isMatch(event: PointerEvent, button: MouseButton, modifiers: ModifierInputs): boolean;
|
|
182
186
|
}
|
|
183
187
|
|
|
184
|
-
export { KeyboardEventManager
|
|
185
|
-
export type {
|
|
188
|
+
export { KeyboardEventManager, ListFocus, ListNavigation, PointerEventManager, convertGetterSetterToWritableSignalLike };
|
|
189
|
+
export type { ListFocusInputs, ListFocusItem, ListNavigationInputs, ListNavigationItem, SignalLike, WritableSignalLike };
|
package/radio-group/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { WritableSignal } from '@angular/core';
|
|
2
|
+
import { WritableSignal, OnDestroy } from '@angular/core';
|
|
3
3
|
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
4
|
-
import {
|
|
5
|
-
import '../
|
|
6
|
-
import '../
|
|
4
|
+
import { RadioGroupPattern } from '../radio-group.d.js';
|
|
5
|
+
import { RadioButtonPattern } from '../toolbar.d.js';
|
|
6
|
+
import { CdkToolbar } from '../toolbar/index.js';
|
|
7
|
+
import '../pointer-event-manager.d.js';
|
|
8
|
+
import '../list.d.js';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* A radio button group container.
|
|
@@ -25,6 +27,10 @@ declare class CdkRadioGroup<V> {
|
|
|
25
27
|
private readonly _cdkRadioButtons;
|
|
26
28
|
/** A signal wrapper for directionality. */
|
|
27
29
|
protected textDirection: WritableSignal<_angular_cdk_bidi.Direction>;
|
|
30
|
+
/** A signal wrapper for toolbar. */
|
|
31
|
+
toolbar: CdkToolbar<any> | null;
|
|
32
|
+
/** Toolbar pattern if applicable */
|
|
33
|
+
private readonly _toolbarPattern;
|
|
28
34
|
/** The RadioButton UIPatterns of the child CdkRadioButtons. */
|
|
29
35
|
protected items: _angular_core.Signal<RadioButtonPattern<any>[]>;
|
|
30
36
|
/** Whether the radio group is vertically or horizontally oriented. */
|
|
@@ -47,11 +53,12 @@ declare class CdkRadioGroup<V> {
|
|
|
47
53
|
private _hasFocused;
|
|
48
54
|
constructor();
|
|
49
55
|
onFocus(): void;
|
|
56
|
+
toolbarButtonUnregister(radio: CdkRadioButton<V>): void;
|
|
50
57
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CdkRadioGroup<any>, never>;
|
|
51
58
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CdkRadioGroup<any>, "[cdkRadioGroup]", ["cdkRadioGroup"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "focusMode": { "alias": "focusMode"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, ["_cdkRadioButtons"], never, true, never>;
|
|
52
59
|
}
|
|
53
60
|
/** A selectable radio button in a CdkRadioGroup. */
|
|
54
|
-
declare class CdkRadioButton<V> {
|
|
61
|
+
declare class CdkRadioButton<V> implements OnDestroy {
|
|
55
62
|
/** A reference to the radio button element. */
|
|
56
63
|
private readonly _elementRef;
|
|
57
64
|
/** The parent CdkRadioGroup. */
|
|
@@ -61,15 +68,16 @@ declare class CdkRadioButton<V> {
|
|
|
61
68
|
/** A unique identifier for the radio button. */
|
|
62
69
|
protected id: _angular_core.Signal<string>;
|
|
63
70
|
/** The value associated with the radio button. */
|
|
64
|
-
|
|
71
|
+
readonly value: _angular_core.InputSignal<V>;
|
|
65
72
|
/** The parent RadioGroup UIPattern. */
|
|
66
73
|
protected group: _angular_core.Signal<RadioGroupPattern<any>>;
|
|
67
74
|
/** A reference to the radio button element to be focused on navigation. */
|
|
68
|
-
|
|
75
|
+
element: _angular_core.Signal<any>;
|
|
69
76
|
/** Whether the radio button is disabled. */
|
|
70
77
|
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
71
78
|
/** The RadioButton UIPattern. */
|
|
72
79
|
pattern: RadioButtonPattern<V>;
|
|
80
|
+
ngOnDestroy(): void;
|
|
73
81
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CdkRadioButton<any>, never>;
|
|
74
82
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CdkRadioButton<any>, "[cdkRadioButton]", ["cdkRadioButton"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
75
83
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { SignalLike, KeyboardEventManager, PointerEventManager } from './pointer-event-manager.d.js';
|
|
3
|
+
import { ListInputs, List } from './list.d.js';
|
|
4
|
+
import { RadioButtonPattern } from './toolbar.d.js';
|
|
5
|
+
|
|
6
|
+
/** Represents the required inputs for a radio group. */
|
|
7
|
+
type RadioGroupInputs<V> = Omit<ListInputs<RadioButtonPattern<V>, V>, 'multi' | 'selectionMode' | 'wrap' | 'typeaheadDelay'> & {
|
|
8
|
+
/** Whether the radio group is disabled. */
|
|
9
|
+
disabled: SignalLike<boolean>;
|
|
10
|
+
/** Whether the radio group is readonly. */
|
|
11
|
+
readonly: SignalLike<boolean>;
|
|
12
|
+
/** Parent toolbar of radio group */
|
|
13
|
+
toolbar: SignalLike<ToolbarLike<V> | undefined>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Represents the properties exposed by a toolbar widget that need to be accessed by a radio group.
|
|
17
|
+
* This exists to avoid circular dependency errors between the toolbar and radio button.
|
|
18
|
+
*/
|
|
19
|
+
type ToolbarWidgetLike = {
|
|
20
|
+
id: SignalLike<string>;
|
|
21
|
+
index: SignalLike<number>;
|
|
22
|
+
element: SignalLike<HTMLElement>;
|
|
23
|
+
disabled: SignalLike<boolean>;
|
|
24
|
+
searchTerm: SignalLike<any>;
|
|
25
|
+
value: SignalLike<any>;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Represents the properties exposed by a toolbar that need to be accessed by a radio group.
|
|
29
|
+
* This exists to avoid circular dependency errors between the toolbar and radio button.
|
|
30
|
+
*/
|
|
31
|
+
interface ToolbarLike<V> {
|
|
32
|
+
listBehavior: List<RadioButtonPattern<V> | ToolbarWidgetLike, V>;
|
|
33
|
+
orientation: SignalLike<'vertical' | 'horizontal'>;
|
|
34
|
+
disabled: SignalLike<boolean>;
|
|
35
|
+
}
|
|
36
|
+
/** Controls the state of a radio group. */
|
|
37
|
+
declare class RadioGroupPattern<V> {
|
|
38
|
+
readonly inputs: RadioGroupInputs<V>;
|
|
39
|
+
/** The list behavior for the radio group. */
|
|
40
|
+
readonly listBehavior: List<RadioButtonPattern<V> | ToolbarWidgetLike, V>;
|
|
41
|
+
/** Whether the radio group is vertically or horizontally oriented. */
|
|
42
|
+
orientation: SignalLike<'vertical' | 'horizontal'>;
|
|
43
|
+
/** Whether the radio group is disabled. */
|
|
44
|
+
disabled: _angular_core.Signal<boolean>;
|
|
45
|
+
/** The currently selected radio button. */
|
|
46
|
+
selectedItem: _angular_core.Signal<ToolbarWidgetLike | RadioButtonPattern<V>>;
|
|
47
|
+
/** Whether the radio group is readonly. */
|
|
48
|
+
readonly: _angular_core.Signal<boolean>;
|
|
49
|
+
/** The tabindex of the radio group. */
|
|
50
|
+
tabindex: _angular_core.Signal<0 | -1>;
|
|
51
|
+
/** The id of the current active radio button (if using activedescendant). */
|
|
52
|
+
activedescendant: _angular_core.Signal<string | undefined>;
|
|
53
|
+
/** The key used to navigate to the previous radio button. */
|
|
54
|
+
prevKey: _angular_core.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
|
|
55
|
+
/** The key used to navigate to the next radio button. */
|
|
56
|
+
nextKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
|
|
57
|
+
/** The keydown event manager for the radio group. */
|
|
58
|
+
keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
|
|
59
|
+
/** The pointerdown event manager for the radio group. */
|
|
60
|
+
pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
|
|
61
|
+
constructor(inputs: RadioGroupInputs<V>);
|
|
62
|
+
/** Handles keydown events for the radio group. */
|
|
63
|
+
onKeydown(event: KeyboardEvent): void;
|
|
64
|
+
/** Handles pointerdown events for the radio group. */
|
|
65
|
+
onPointerdown(event: PointerEvent): void;
|
|
66
|
+
/**
|
|
67
|
+
* Sets the radio group to its default initial state.
|
|
68
|
+
*
|
|
69
|
+
* Sets the active index to the selected radio button if one exists and is focusable.
|
|
70
|
+
* Otherwise, sets the active index to the first focusable radio button.
|
|
71
|
+
*/
|
|
72
|
+
setDefaultState(): void;
|
|
73
|
+
/** Validates the state of the radio group and returns a list of accessibility violations. */
|
|
74
|
+
validate(): string[];
|
|
75
|
+
/** Finds the RadioButtonPattern associated with a pointer event target. */
|
|
76
|
+
private _getItem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { RadioGroupPattern };
|
|
80
|
+
export type { RadioGroupInputs, ToolbarLike };
|
package/tabs/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { Signal, OnInit, OnDestroy } from '@angular/core';
|
|
3
3
|
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
4
|
-
import {
|
|
4
|
+
import { TabPattern, TabPanelPattern, TabListPattern } from '../tabs.d.js';
|
|
5
5
|
import * as i1 from '@angular/cdk-experimental/deferred-content';
|
|
6
|
-
import '../pointer-event-manager.d
|
|
7
|
-
import '../
|
|
8
|
-
import '../
|
|
6
|
+
import '../pointer-event-manager.d.js';
|
|
7
|
+
import '../expansion.d.js';
|
|
8
|
+
import '../list.d.js';
|
|
9
9
|
|
|
10
10
|
interface HasElement {
|
|
11
11
|
element: Signal<HTMLElement>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { SignalLike, KeyboardEventManager, PointerEventManager } from './pointer-event-manager.d.js';
|
|
3
|
+
import { ExpansionItem, ExpansionControl, ListExpansionInputs, ListExpansion } from './expansion.d.js';
|
|
4
|
+
import { ListItem, ListInputs, List } from './list.d.js';
|
|
5
5
|
|
|
6
6
|
/** Represents the required inputs for the label control. */
|
|
7
7
|
interface LabelControlInputs {
|
|
@@ -26,7 +26,7 @@ declare class LabelControl {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/** The required inputs to tabs. */
|
|
29
|
-
interface TabInputs extends
|
|
29
|
+
interface TabInputs extends Omit<ListItem<string>, 'searchTerm' | 'index'>, Omit<ExpansionItem, 'expansionId' | 'expandable'> {
|
|
30
30
|
/** The parent tablist that controls the tab. */
|
|
31
31
|
tablist: SignalLike<TabListPattern>;
|
|
32
32
|
/** The remote tabpanel controlled by the tab. */
|
|
@@ -39,12 +39,16 @@ declare class TabPattern {
|
|
|
39
39
|
readonly expansion: ExpansionControl;
|
|
40
40
|
/** A global unique identifier for the tab. */
|
|
41
41
|
readonly id: SignalLike<string>;
|
|
42
|
+
/** The index of the tab. */
|
|
43
|
+
readonly index: _angular_core.Signal<number>;
|
|
42
44
|
/** A local unique identifier for the tab. */
|
|
43
45
|
readonly value: SignalLike<string>;
|
|
44
46
|
/** Whether the tab is disabled. */
|
|
45
47
|
readonly disabled: SignalLike<boolean>;
|
|
46
48
|
/** The html element that should receive focus. */
|
|
47
49
|
readonly element: SignalLike<HTMLElement>;
|
|
50
|
+
/** The text used by the typeahead search. */
|
|
51
|
+
readonly searchTerm: () => string;
|
|
48
52
|
/** Whether this tab has expandable content. */
|
|
49
53
|
readonly expandable: _angular_core.Signal<boolean>;
|
|
50
54
|
/** The unique identifier used by the expansion behavior. */
|
|
@@ -79,26 +83,18 @@ declare class TabPanelPattern {
|
|
|
79
83
|
/** Whether the tabpanel is hidden. */
|
|
80
84
|
readonly hidden: _angular_core.Signal<boolean>;
|
|
81
85
|
/** The tabindex of this tabpanel. */
|
|
82
|
-
readonly tabindex: _angular_core.Signal
|
|
86
|
+
readonly tabindex: _angular_core.Signal<0 | -1>;
|
|
83
87
|
/** The aria-labelledby value for this tabpanel. */
|
|
84
88
|
readonly labelledBy: _angular_core.Signal<string | undefined>;
|
|
85
89
|
constructor(inputs: TabPanelInputs);
|
|
86
90
|
}
|
|
87
|
-
/** The selection operations that the tablist can perform. */
|
|
88
|
-
interface SelectOptions {
|
|
89
|
-
select?: boolean;
|
|
90
|
-
}
|
|
91
91
|
/** The required inputs for the tablist. */
|
|
92
|
-
type TabListInputs =
|
|
92
|
+
type TabListInputs = Omit<ListInputs<TabPattern, string>, 'multi' | 'typeaheadDelay'> & Omit<ListExpansionInputs, 'multiExpandable' | 'expandedIds' | 'items'>;
|
|
93
93
|
/** Controls the state of a tablist. */
|
|
94
94
|
declare class TabListPattern {
|
|
95
95
|
readonly inputs: TabListInputs;
|
|
96
|
-
/**
|
|
97
|
-
readonly
|
|
98
|
-
/** Controls selection for the tablist. */
|
|
99
|
-
readonly selection: ListSelection<TabPattern, string>;
|
|
100
|
-
/** Controls focus for the tablist. */
|
|
101
|
-
readonly focusManager: ListFocus<TabPattern>;
|
|
96
|
+
/** The list behavior for the tablist. */
|
|
97
|
+
readonly listBehavior: List<TabPattern, string>;
|
|
102
98
|
/** Controls expansion for the tablist. */
|
|
103
99
|
readonly expansionManager: ListExpansion;
|
|
104
100
|
/** Whether the tablist is vertically or horizontally oriented. */
|
|
@@ -133,20 +129,9 @@ declare class TabListPattern {
|
|
|
133
129
|
onKeydown(event: KeyboardEvent): void;
|
|
134
130
|
/** The pointerdown event manager for the tablist. */
|
|
135
131
|
onPointerdown(event: PointerEvent): void;
|
|
136
|
-
/**
|
|
137
|
-
first(opts?: SelectOptions): void;
|
|
138
|
-
/** Navigates to the last option in the tablist. */
|
|
139
|
-
last(opts?: SelectOptions): void;
|
|
140
|
-
/** Navigates to the next option in the tablist. */
|
|
141
|
-
next(opts?: SelectOptions): void;
|
|
142
|
-
/** Navigates to the previous option in the tablist. */
|
|
143
|
-
prev(opts?: SelectOptions): void;
|
|
144
|
-
/** Navigates to the given item in the tablist. */
|
|
145
|
-
goto(event: PointerEvent, opts?: SelectOptions): void;
|
|
146
|
-
/** Handles updating selection for the tablist. */
|
|
147
|
-
private _select;
|
|
132
|
+
/** Returns the tab item associated with the given pointer event. */
|
|
148
133
|
private _getItem;
|
|
149
134
|
}
|
|
150
135
|
|
|
151
|
-
export {
|
|
152
|
-
export type { TabInputs
|
|
136
|
+
export { TabListPattern, TabPanelPattern, TabPattern };
|
|
137
|
+
export type { TabInputs, TabListInputs, TabPanelInputs };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { Signal, OnInit, OnDestroy } from '@angular/core';
|
|
3
|
+
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
4
|
+
import { RadioButtonPattern, ToolbarWidgetPattern, ToolbarPattern } from '../toolbar.d.js';
|
|
5
|
+
import '../pointer-event-manager.d.js';
|
|
6
|
+
import '../list.d.js';
|
|
7
|
+
|
|
8
|
+
/** Interface for a radio button that can be used with a toolbar. Based on radio-button in ui-patterns */
|
|
9
|
+
interface CdkRadioButtonInterface<V> {
|
|
10
|
+
/** The HTML element associated with the radio button. */
|
|
11
|
+
element: Signal<HTMLElement>;
|
|
12
|
+
/** Whether the radio button is disabled. */
|
|
13
|
+
disabled: Signal<boolean>;
|
|
14
|
+
pattern: RadioButtonPattern<V>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A toolbar widget container.
|
|
18
|
+
*
|
|
19
|
+
* Widgets such as radio groups or buttons are nested within a toolbar to allow for a single
|
|
20
|
+
* place of reference for focus and navigation. The CdkToolbar is meant to be used in conjunction
|
|
21
|
+
* with CdkToolbarWidget and CdkRadioGroup as follows:
|
|
22
|
+
*
|
|
23
|
+
* ```html
|
|
24
|
+
* <div cdkToolbar>
|
|
25
|
+
* <button cdkToolbarWidget>Button</button>
|
|
26
|
+
* <div cdkRadioGroup>
|
|
27
|
+
* <label cdkRadioButton value="1">Option 1</label>
|
|
28
|
+
* <label cdkRadioButton value="2">Option 2</label>
|
|
29
|
+
* <label cdkRadioButton value="3">Option 3</label>
|
|
30
|
+
* </div>
|
|
31
|
+
* </div>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare class CdkToolbar<V> {
|
|
35
|
+
/** The CdkTabList nested inside of the container. */
|
|
36
|
+
private readonly _cdkWidgets;
|
|
37
|
+
/** A signal wrapper for directionality. */
|
|
38
|
+
textDirection: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>;
|
|
39
|
+
/** Sorted UIPatterns of the child widgets */
|
|
40
|
+
items: Signal<(RadioButtonPattern<V> | ToolbarWidgetPattern)[]>;
|
|
41
|
+
/** Whether the toolbar is vertically or horizontally oriented. */
|
|
42
|
+
orientation: _angular_core.InputSignal<"vertical" | "horizontal">;
|
|
43
|
+
/** Whether disabled items in the group should be skipped when navigating. */
|
|
44
|
+
skipDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
45
|
+
/** Whether the toolbar is disabled. */
|
|
46
|
+
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
47
|
+
/** Whether focus should wrap when navigating. */
|
|
48
|
+
readonly wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
49
|
+
/** The toolbar UIPattern. */
|
|
50
|
+
pattern: ToolbarPattern<V>;
|
|
51
|
+
/** Whether the toolbar has received focus yet. */
|
|
52
|
+
private _hasFocused;
|
|
53
|
+
onFocus(): void;
|
|
54
|
+
constructor();
|
|
55
|
+
register(widget: CdkRadioButtonInterface<V> | CdkToolbarWidget): void;
|
|
56
|
+
unregister(widget: CdkRadioButtonInterface<V> | CdkToolbarWidget): void;
|
|
57
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CdkToolbar<any>, never>;
|
|
58
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CdkToolbar<any>, "[cdkToolbar]", ["cdkToolbar"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A widget within a toolbar.
|
|
62
|
+
*
|
|
63
|
+
* A widget is anything that is within a toolbar. It should be applied to any native HTML element
|
|
64
|
+
* that has the purpose of acting as a widget navigatable within a toolbar.
|
|
65
|
+
*/
|
|
66
|
+
declare class CdkToolbarWidget implements OnInit, OnDestroy {
|
|
67
|
+
/** A reference to the widget element. */
|
|
68
|
+
private readonly _elementRef;
|
|
69
|
+
/** The parent CdkToolbar. */
|
|
70
|
+
private readonly _cdkToolbar;
|
|
71
|
+
/** A unique identifier for the widget. */
|
|
72
|
+
private readonly _generatedId;
|
|
73
|
+
/** A unique identifier for the widget. */
|
|
74
|
+
protected id: Signal<string>;
|
|
75
|
+
/** The parent Toolbar UIPattern. */
|
|
76
|
+
protected parentToolbar: Signal<ToolbarPattern<any>>;
|
|
77
|
+
/** A reference to the widget element to be focused on navigation. */
|
|
78
|
+
element: Signal<any>;
|
|
79
|
+
/** Whether the widget is disabled. */
|
|
80
|
+
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
81
|
+
readonly hardDisabled: Signal<boolean>;
|
|
82
|
+
pattern: ToolbarWidgetPattern;
|
|
83
|
+
ngOnInit(): void;
|
|
84
|
+
ngOnDestroy(): void;
|
|
85
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CdkToolbarWidget, never>;
|
|
86
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CdkToolbarWidget, "[cdkToolbarWidget]", ["cdkToolbarWidget"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { CdkToolbar, CdkToolbarWidget };
|