@angular/cdk-experimental 20.0.0-next.6 → 20.0.0-next.8
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/column-resize/index.d.ts +1 -1
- package/combobox/index.d.ts +2 -1
- package/deferred-content/index.d.ts +37 -0
- package/fesm2022/cdk-experimental.mjs +1 -1
- package/fesm2022/cdk-experimental.mjs.map +1 -1
- package/fesm2022/column-resize.mjs +2 -3
- package/fesm2022/column-resize.mjs.map +1 -1
- package/fesm2022/combobox.mjs +4 -4
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/deferred-content.mjs +60 -0
- package/fesm2022/deferred-content.mjs.map +1 -0
- package/fesm2022/list-focus-CSTLIgwc.mjs +382 -0
- package/fesm2022/list-focus-CSTLIgwc.mjs.map +1 -0
- package/fesm2022/listbox.mjs +3 -2
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/option-D1-Zcobx.mjs +338 -0
- package/fesm2022/option-D1-Zcobx.mjs.map +1 -0
- package/fesm2022/{polyfill-e71d02cf.mjs → polyfill-DRXnWbMt.mjs} +2 -2
- package/fesm2022/polyfill-DRXnWbMt.mjs.map +1 -0
- package/fesm2022/popover-edit.mjs +3 -5
- package/fesm2022/popover-edit.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +1 -1
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/selection.mjs +2 -2
- package/fesm2022/selection.mjs.map +1 -1
- package/fesm2022/table-scroll-container.mjs +1 -2
- package/fesm2022/table-scroll-container.mjs.map +1 -1
- package/fesm2022/tabs-C0pLghH2.mjs +185 -0
- package/fesm2022/tabs-C0pLghH2.mjs.map +1 -0
- package/fesm2022/tabs.mjs +224 -0
- package/fesm2022/tabs.mjs.map +1 -0
- package/fesm2022/ui-patterns.mjs +3 -1
- package/fesm2022/ui-patterns.mjs.map +1 -1
- package/list-navigation.d-cy63EByU.d.ts +247 -0
- package/listbox/index.d.ts +2 -1
- package/listbox.d-DJqDR_H3.d.ts +180 -0
- package/package.json +10 -2
- package/tabs/index.d.ts +128 -0
- package/tabs.d-CWu2orP4.d.ts +107 -0
- package/ui-patterns/index.d.ts +3 -1
- package/fesm2022/option-7fdc6400.mjs +0 -628
- package/fesm2022/option-7fdc6400.mjs.map +0 -1
- package/fesm2022/polyfill-e71d02cf.mjs.map +0 -1
- package/listbox.d-7a7652e3.d.ts +0 -384
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ListFocusItem, SignalLike, ListFocusInputs, ListFocus, ListSelection, ListNavigation, ListNavigationItem, ListSelectionItem, ListNavigationInputs, ListSelectionInputs, KeyboardEventManager, PointerEventManager } from './list-navigation.d-cy63EByU.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Represents an item in a collection, such as a listbox option, than can be navigated to by
|
|
6
|
+
* typeahead.
|
|
7
|
+
*/
|
|
8
|
+
interface ListTypeaheadItem extends ListFocusItem {
|
|
9
|
+
/** The text used by the typeahead search. */
|
|
10
|
+
searchTerm: SignalLike<string>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Represents the required inputs for a collection that contains items that can be navigated to by
|
|
14
|
+
* typeahead.
|
|
15
|
+
*/
|
|
16
|
+
interface ListTypeaheadInputs<T extends ListTypeaheadItem> extends ListFocusInputs<T> {
|
|
17
|
+
/** The amount of time before the typeahead search is reset. */
|
|
18
|
+
typeaheadDelay: SignalLike<number>;
|
|
19
|
+
}
|
|
20
|
+
/** Controls typeahead for a list of items. */
|
|
21
|
+
declare class ListTypeahead<T extends ListTypeaheadItem> {
|
|
22
|
+
readonly inputs: ListTypeaheadInputs<T> & {
|
|
23
|
+
focusManager: ListFocus<T>;
|
|
24
|
+
};
|
|
25
|
+
/** A reference to the timeout for resetting the typeahead search. */
|
|
26
|
+
timeout?: ReturnType<typeof setTimeout> | undefined;
|
|
27
|
+
/** The focus controller of the parent list. */
|
|
28
|
+
focusManager: ListFocus<T>;
|
|
29
|
+
/** Whether the user is actively typing a typeahead search query. */
|
|
30
|
+
isTyping: i0.Signal<boolean>;
|
|
31
|
+
/** Keeps track of the characters that typeahead search is being called with. */
|
|
32
|
+
private _query;
|
|
33
|
+
/** The index where that the typeahead search was initiated from. */
|
|
34
|
+
private _startIndex;
|
|
35
|
+
constructor(inputs: ListTypeaheadInputs<T> & {
|
|
36
|
+
focusManager: ListFocus<T>;
|
|
37
|
+
});
|
|
38
|
+
/** Performs a typeahead search, appending the given character to the search string. */
|
|
39
|
+
search(char: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the first item whose search term matches the
|
|
42
|
+
* current query starting from the the current anchor index.
|
|
43
|
+
*/
|
|
44
|
+
private _getItem;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Represents the properties exposed by a listbox that need to be accessed by an option.
|
|
49
|
+
* This exists to avoid circular dependency errors between the listbox and option.
|
|
50
|
+
*/
|
|
51
|
+
interface ListboxPattern$1<V> {
|
|
52
|
+
focusManager: ListFocus<OptionPattern<V>>;
|
|
53
|
+
selection: ListSelection<OptionPattern<V>, V>;
|
|
54
|
+
navigation: ListNavigation<OptionPattern<V>>;
|
|
55
|
+
}
|
|
56
|
+
/** Represents the required inputs for an option in a listbox. */
|
|
57
|
+
interface OptionInputs<V> extends ListNavigationItem, ListSelectionItem<V>, ListTypeaheadItem, ListFocusItem {
|
|
58
|
+
listbox: SignalLike<ListboxPattern$1<V> | undefined>;
|
|
59
|
+
}
|
|
60
|
+
/** Represents an option in a listbox. */
|
|
61
|
+
declare class OptionPattern<V> {
|
|
62
|
+
/** A unique identifier for the option. */
|
|
63
|
+
id: SignalLike<string>;
|
|
64
|
+
/** The value of the option. */
|
|
65
|
+
value: SignalLike<V>;
|
|
66
|
+
/** The position of the option in the list. */
|
|
67
|
+
index: i0.Signal<number>;
|
|
68
|
+
/** Whether the option is selected. */
|
|
69
|
+
selected: i0.Signal<boolean | undefined>;
|
|
70
|
+
/** Whether the option is disabled. */
|
|
71
|
+
disabled: SignalLike<boolean>;
|
|
72
|
+
/** The text used by the typeahead search. */
|
|
73
|
+
searchTerm: SignalLike<string>;
|
|
74
|
+
/** A reference to the parent listbox. */
|
|
75
|
+
listbox: SignalLike<ListboxPattern$1<V> | undefined>;
|
|
76
|
+
/** The tabindex of the option. */
|
|
77
|
+
tabindex: i0.Signal<0 | -1 | undefined>;
|
|
78
|
+
/** The html element that should receive focus. */
|
|
79
|
+
element: SignalLike<HTMLElement>;
|
|
80
|
+
constructor(args: OptionInputs<V>);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The selection operations that the listbox can perform. */
|
|
84
|
+
interface SelectOptions {
|
|
85
|
+
toggle?: boolean;
|
|
86
|
+
selectOne?: boolean;
|
|
87
|
+
selectRange?: boolean;
|
|
88
|
+
anchor?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/** Represents the required inputs for a listbox. */
|
|
91
|
+
type ListboxInputs<V> = ListNavigationInputs<OptionPattern<V>> & ListSelectionInputs<OptionPattern<V>, V> & ListTypeaheadInputs<OptionPattern<V>> & ListFocusInputs<OptionPattern<V>> & {
|
|
92
|
+
readonly: SignalLike<boolean>;
|
|
93
|
+
};
|
|
94
|
+
/** Controls the state of a listbox. */
|
|
95
|
+
declare class ListboxPattern<V> {
|
|
96
|
+
readonly inputs: ListboxInputs<V>;
|
|
97
|
+
/** Controls navigation for the listbox. */
|
|
98
|
+
navigation: ListNavigation<OptionPattern<V>>;
|
|
99
|
+
/** Controls selection for the listbox. */
|
|
100
|
+
selection: ListSelection<OptionPattern<V>, V>;
|
|
101
|
+
/** Controls typeahead for the listbox. */
|
|
102
|
+
typeahead: ListTypeahead<OptionPattern<V>>;
|
|
103
|
+
/** Controls focus for the listbox. */
|
|
104
|
+
focusManager: ListFocus<OptionPattern<V>>;
|
|
105
|
+
/** Whether the list is vertically or horizontally oriented. */
|
|
106
|
+
orientation: SignalLike<'vertical' | 'horizontal'>;
|
|
107
|
+
/** Whether the listbox is disabled. */
|
|
108
|
+
disabled: i0.Signal<boolean>;
|
|
109
|
+
/** Whether the listbox is readonly. */
|
|
110
|
+
readonly: SignalLike<boolean>;
|
|
111
|
+
/** The tabindex of the listbox. */
|
|
112
|
+
tabindex: i0.Signal<0 | -1>;
|
|
113
|
+
/** The id of the current active item. */
|
|
114
|
+
activedescendant: i0.Signal<string | undefined>;
|
|
115
|
+
/** Whether multiple items in the list can be selected at once. */
|
|
116
|
+
multi: SignalLike<boolean>;
|
|
117
|
+
/** The number of items in the listbox. */
|
|
118
|
+
setsize: i0.Signal<number>;
|
|
119
|
+
/** Whether the listbox selection follows focus. */
|
|
120
|
+
followFocus: i0.Signal<boolean>;
|
|
121
|
+
/** Whether the listbox should wrap. Used to disable wrapping while range selecting. */
|
|
122
|
+
wrap: i0.WritableSignal<boolean>;
|
|
123
|
+
/** The key used to navigate to the previous item in the list. */
|
|
124
|
+
prevKey: i0.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
|
|
125
|
+
/** The key used to navigate to the next item in the list. */
|
|
126
|
+
nextKey: i0.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
|
|
127
|
+
/** Represents the space key. Does nothing when the user is actively using typeahead. */
|
|
128
|
+
dynamicSpaceKey: i0.Signal<"" | " ">;
|
|
129
|
+
/** The regexp used to decide if a key should trigger typeahead. */
|
|
130
|
+
typeaheadRegexp: RegExp;
|
|
131
|
+
/**
|
|
132
|
+
* The uncommitted index for selecting a range of options.
|
|
133
|
+
*
|
|
134
|
+
* NOTE: This is subtly distinct from the "rangeStartIndex" in the ListSelection behavior.
|
|
135
|
+
* The anchorIndex does not necessarily represent the start of a range, but represents the most
|
|
136
|
+
* recent index where the user showed intent to begin a range selection. Usually, this is wherever
|
|
137
|
+
* the user most recently pressed the "Shift" key, but if the user presses shift + space to select
|
|
138
|
+
* from the anchor, the user is not intending to start a new range from this index.
|
|
139
|
+
*
|
|
140
|
+
* In other words, "rangeStartIndex" is only set when a user commits to starting a range selection
|
|
141
|
+
* while "anchorIndex" is set whenever a user indicates they may be starting a range selection.
|
|
142
|
+
*/
|
|
143
|
+
anchorIndex: i0.WritableSignal<number>;
|
|
144
|
+
/** The keydown event manager for the listbox. */
|
|
145
|
+
keydown: i0.Signal<KeyboardEventManager<KeyboardEvent>>;
|
|
146
|
+
/** The pointerdown event manager for the listbox. */
|
|
147
|
+
pointerdown: i0.Signal<PointerEventManager<PointerEvent>>;
|
|
148
|
+
constructor(inputs: ListboxInputs<V>);
|
|
149
|
+
/** Handles keydown events for the listbox. */
|
|
150
|
+
onKeydown(event: KeyboardEvent): void;
|
|
151
|
+
onPointerdown(event: PointerEvent): void;
|
|
152
|
+
/** Navigates to the first option in the listbox. */
|
|
153
|
+
first(opts?: SelectOptions): void;
|
|
154
|
+
/** Navigates to the last option in the listbox. */
|
|
155
|
+
last(opts?: SelectOptions): void;
|
|
156
|
+
/** Navigates to the next option in the listbox. */
|
|
157
|
+
next(opts?: SelectOptions): void;
|
|
158
|
+
/** Navigates to the previous option in the listbox. */
|
|
159
|
+
prev(opts?: SelectOptions): void;
|
|
160
|
+
/** Navigates to the given item in the listbox. */
|
|
161
|
+
goto(event: PointerEvent, opts?: SelectOptions): void;
|
|
162
|
+
/** Handles typeahead search navigation for the listbox. */
|
|
163
|
+
search(char: string, opts?: SelectOptions): void;
|
|
164
|
+
/**
|
|
165
|
+
* Safely performs a navigation operation.
|
|
166
|
+
*
|
|
167
|
+
* Handles conditionally disabling wrapping for when a navigation
|
|
168
|
+
* operation is occurring while the user is selecting a range of options.
|
|
169
|
+
*
|
|
170
|
+
* Handles boilerplate calling of focus & selection operations. Also ensures these
|
|
171
|
+
* additional operations are only called if the navigation operation moved focus to a new option.
|
|
172
|
+
*/
|
|
173
|
+
private _navigate;
|
|
174
|
+
/** Handles updating selection for the listbox. */
|
|
175
|
+
private _updateSelection;
|
|
176
|
+
private _getItem;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export { ListboxPattern, OptionPattern };
|
|
180
|
+
export type { ListboxInputs, OptionInputs };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cdk-experimental",
|
|
3
|
-
"version": "20.0.0-next.
|
|
3
|
+
"version": "20.0.0-next.8",
|
|
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.0.0-next.
|
|
15
|
+
"@angular/cdk": "20.0.0-next.8",
|
|
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": {
|
|
@@ -52,6 +52,10 @@
|
|
|
52
52
|
"types": "./combobox/index.d.ts",
|
|
53
53
|
"default": "./fesm2022/combobox.mjs"
|
|
54
54
|
},
|
|
55
|
+
"./deferred-content": {
|
|
56
|
+
"types": "./deferred-content/index.d.ts",
|
|
57
|
+
"default": "./fesm2022/deferred-content.mjs"
|
|
58
|
+
},
|
|
55
59
|
"./listbox": {
|
|
56
60
|
"types": "./listbox/index.d.ts",
|
|
57
61
|
"default": "./fesm2022/listbox.mjs"
|
|
@@ -72,6 +76,10 @@
|
|
|
72
76
|
"types": "./table-scroll-container/index.d.ts",
|
|
73
77
|
"default": "./fesm2022/table-scroll-container.mjs"
|
|
74
78
|
},
|
|
79
|
+
"./tabs": {
|
|
80
|
+
"types": "./tabs/index.d.ts",
|
|
81
|
+
"default": "./fesm2022/tabs.mjs"
|
|
82
|
+
},
|
|
75
83
|
"./ui-patterns": {
|
|
76
84
|
"types": "./ui-patterns/index.d.ts",
|
|
77
85
|
"default": "./fesm2022/ui-patterns.mjs"
|
package/tabs/index.d.ts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { TabPattern, TabPanelPattern, TabListPattern } from '../tabs.d-CWu2orP4.js';
|
|
4
|
+
import * as i1 from '@angular/cdk-experimental/deferred-content';
|
|
5
|
+
import '../list-navigation.d-cy63EByU.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A Tabs container.
|
|
9
|
+
*
|
|
10
|
+
* Represents a set of layered sections of content. The CdkTabs is a container meant to be used with
|
|
11
|
+
* CdkTabList, CdkTab, and CdkTabPanel as follows:
|
|
12
|
+
*
|
|
13
|
+
* ```html
|
|
14
|
+
* <div cdkTabs>
|
|
15
|
+
* <ul cdkTabList>
|
|
16
|
+
* <li cdkTab>Tab 1</li>
|
|
17
|
+
* <li cdkTab>Tab 2</li>
|
|
18
|
+
* <li cdkTab>Tab 3</li>
|
|
19
|
+
* </ul>
|
|
20
|
+
*
|
|
21
|
+
* <div cdkTabPanel>Tab content 1</div>
|
|
22
|
+
* <div cdkTabPanel>Tab content 2</div>
|
|
23
|
+
* <div cdkTabPanel>Tab content 3</div>
|
|
24
|
+
* </div>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare class CdkTabs {
|
|
28
|
+
/** The CdkTabList nested inside of the container. */
|
|
29
|
+
private readonly _cdkTabList;
|
|
30
|
+
/** The CdkTabPanels nested inside of the container. */
|
|
31
|
+
private readonly _cdkTabPanels;
|
|
32
|
+
/** The Tab UIPattern of the child Tabs. */
|
|
33
|
+
tabs: i0.Signal<TabPattern[] | undefined>;
|
|
34
|
+
/** The TabPanel UIPattern of the child TabPanels. */
|
|
35
|
+
tabpanels: i0.Signal<TabPanelPattern[]>;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkTabs, never>;
|
|
37
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTabs, "[cdkTabs]", ["cdkTabs"], {}, {}, ["_cdkTabList", "_cdkTabPanels"], never, true, never>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A TabList container.
|
|
41
|
+
*
|
|
42
|
+
* Controls a list of CdkTab(s).
|
|
43
|
+
*/
|
|
44
|
+
declare class CdkTabList {
|
|
45
|
+
/** The directionality (LTR / RTL) context for the application (or a subtree of it). */
|
|
46
|
+
private readonly _directionality;
|
|
47
|
+
/** The CdkTabs nested inside of the CdkTabList. */
|
|
48
|
+
private readonly _cdkTabs;
|
|
49
|
+
/** A signal wrapper for directionality. */
|
|
50
|
+
protected textDirection: i0.Signal<_angular_cdk_bidi.Direction>;
|
|
51
|
+
/** The Tab UIPatterns of the child Tabs. */
|
|
52
|
+
tabs: i0.Signal<TabPattern[]>;
|
|
53
|
+
/** Whether the tablist is vertically or horizontally oriented. */
|
|
54
|
+
orientation: i0.InputSignal<"vertical" | "horizontal">;
|
|
55
|
+
/** Whether focus should wrap when navigating. */
|
|
56
|
+
wrap: i0.InputSignalWithTransform<boolean, unknown>;
|
|
57
|
+
/** Whether disabled items in the list should be skipped when navigating. */
|
|
58
|
+
skipDisabled: i0.InputSignalWithTransform<boolean, unknown>;
|
|
59
|
+
/** The focus strategy used by the tablist. */
|
|
60
|
+
focusMode: i0.InputSignal<"roving" | "activedescendant">;
|
|
61
|
+
/** The selection strategy used by the tablist. */
|
|
62
|
+
selectionMode: i0.InputSignal<"follow" | "explicit">;
|
|
63
|
+
/** Whether the tablist is disabled. */
|
|
64
|
+
disabled: i0.InputSignalWithTransform<boolean, unknown>;
|
|
65
|
+
/** The current index that has been navigated to. */
|
|
66
|
+
activeIndex: i0.ModelSignal<number>;
|
|
67
|
+
/** The TabList UIPattern. */
|
|
68
|
+
pattern: TabListPattern;
|
|
69
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkTabList, never>;
|
|
70
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTabList, "[cdkTabList]", ["cdkTabList"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "focusMode": { "alias": "focusMode"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "activeIndex": { "alias": "activeIndex"; "required": false; "isSignal": true; }; }, { "activeIndex": "activeIndexChange"; }, ["_cdkTabs"], never, true, never>;
|
|
71
|
+
}
|
|
72
|
+
/** A selectable tab in a TabList. */
|
|
73
|
+
declare class CdkTab {
|
|
74
|
+
/** A reference to the tab element. */
|
|
75
|
+
private readonly _elementRef;
|
|
76
|
+
/** The parent CdkTabs. */
|
|
77
|
+
private readonly _cdkTabs;
|
|
78
|
+
/** The parent CdkTabList. */
|
|
79
|
+
private readonly _cdkTabList;
|
|
80
|
+
/** A global unique identifier for the tab. */
|
|
81
|
+
private readonly _id;
|
|
82
|
+
/** The parent TabList UIPattern. */
|
|
83
|
+
protected tablist: i0.Signal<TabListPattern>;
|
|
84
|
+
/** The TabPanel UIPattern associated with the tab */
|
|
85
|
+
protected tabpanel: i0.Signal<TabPanelPattern | undefined>;
|
|
86
|
+
/** Whether a tab is disabled. */
|
|
87
|
+
disabled: i0.InputSignalWithTransform<boolean, unknown>;
|
|
88
|
+
/** A local unique identifier for the tab. */
|
|
89
|
+
value: i0.InputSignal<string>;
|
|
90
|
+
/** The Tab UIPattern. */
|
|
91
|
+
pattern: TabPattern;
|
|
92
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkTab, never>;
|
|
93
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTab, "[cdkTab]", ["cdkTab"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* A TabPanel container for the resources of layered content associated with a tab.
|
|
97
|
+
*
|
|
98
|
+
* If a tabpanel is hidden due to its corresponding tab is not activated, the `inert` attribute
|
|
99
|
+
* will be applied to the tabpanel element to remove it from the accessibility tree and stop
|
|
100
|
+
* all the keyboard and pointer interactions. Note that this does not visually hide the tabpenl
|
|
101
|
+
* and a proper styling is required.
|
|
102
|
+
*/
|
|
103
|
+
declare class CdkTabPanel {
|
|
104
|
+
/** The DeferredContentAware host directive. */
|
|
105
|
+
private readonly _deferredContentAware;
|
|
106
|
+
/** The parent CdkTabs. */
|
|
107
|
+
private readonly _cdkTabs;
|
|
108
|
+
/** A global unique identifier for the tab. */
|
|
109
|
+
private readonly _id;
|
|
110
|
+
/** The Tab UIPattern associated with the tabpanel */
|
|
111
|
+
protected tab: i0.Signal<TabPattern | undefined>;
|
|
112
|
+
/** A local unique identifier for the tabpanel. */
|
|
113
|
+
value: i0.InputSignal<string>;
|
|
114
|
+
/** The TabPanel UIPattern. */
|
|
115
|
+
pattern: TabPanelPattern;
|
|
116
|
+
constructor();
|
|
117
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkTabPanel, never>;
|
|
118
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTabPanel, "[cdkTabPanel]", ["cdkTabPanel"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* A TabContent container for the lazy-loaded content.
|
|
122
|
+
*/
|
|
123
|
+
declare class CdkTabContent {
|
|
124
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkTabContent, never>;
|
|
125
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTabContent, "ng-template[cdkTabContent]", ["cdTabContent"], {}, {}, never, never, true, [{ directive: typeof i1.DeferredContent; inputs: {}; outputs: {}; }]>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export { CdkTab, CdkTabContent, CdkTabList, CdkTabPanel, CdkTabs };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { SignalLike, ListNavigationInputs, ListSelectionInputs, ListFocusInputs, ListNavigation, ListSelection, ListFocus, KeyboardEventManager, PointerEventManager, ListNavigationItem, ListSelectionItem, ListFocusItem } from './list-navigation.d-cy63EByU.js';
|
|
3
|
+
|
|
4
|
+
/** The required inputs to tabs. */
|
|
5
|
+
interface TabInputs extends ListNavigationItem, ListSelectionItem<string>, ListFocusItem {
|
|
6
|
+
tablist: SignalLike<TabListPattern>;
|
|
7
|
+
tabpanel: SignalLike<TabPanelPattern | undefined>;
|
|
8
|
+
}
|
|
9
|
+
/** A tab in a tablist. */
|
|
10
|
+
declare class TabPattern {
|
|
11
|
+
/** A global unique identifier for the tab. */
|
|
12
|
+
id: SignalLike<string>;
|
|
13
|
+
/** A local unique identifier for the tab. */
|
|
14
|
+
value: SignalLike<string>;
|
|
15
|
+
/** Whether the tab is selected. */
|
|
16
|
+
selected: i0.Signal<boolean>;
|
|
17
|
+
/** A Tabpanel Id controlled by the tab. */
|
|
18
|
+
controls: i0.Signal<string | undefined>;
|
|
19
|
+
/** Whether the tab is disabled. */
|
|
20
|
+
disabled: SignalLike<boolean>;
|
|
21
|
+
/** A reference to the parent tablist. */
|
|
22
|
+
tablist: SignalLike<TabListPattern>;
|
|
23
|
+
/** A reference to the corresponding tabpanel. */
|
|
24
|
+
tabpanel: SignalLike<TabPanelPattern | undefined>;
|
|
25
|
+
/** The tabindex of the tab. */
|
|
26
|
+
tabindex: i0.Signal<0 | -1>;
|
|
27
|
+
/** The html element that should receive focus. */
|
|
28
|
+
element: SignalLike<HTMLElement>;
|
|
29
|
+
constructor(inputs: TabInputs);
|
|
30
|
+
}
|
|
31
|
+
/** The selection operations that the tablist can perform. */
|
|
32
|
+
interface SelectOptions {
|
|
33
|
+
select?: boolean;
|
|
34
|
+
toggle?: boolean;
|
|
35
|
+
toggleOne?: boolean;
|
|
36
|
+
selectOne?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** The required inputs for the tablist. */
|
|
39
|
+
type TabListInputs = ListNavigationInputs<TabPattern> & Omit<ListSelectionInputs<TabPattern, string>, 'multi'> & ListFocusInputs<TabPattern> & {
|
|
40
|
+
disabled: SignalLike<boolean>;
|
|
41
|
+
};
|
|
42
|
+
/** The required inputs for the tabpanel. */
|
|
43
|
+
interface TabPanelInputs {
|
|
44
|
+
id: SignalLike<string>;
|
|
45
|
+
tab: SignalLike<TabPattern | undefined>;
|
|
46
|
+
value: SignalLike<string>;
|
|
47
|
+
}
|
|
48
|
+
/** A tabpanel associated with a tab. */
|
|
49
|
+
declare class TabPanelPattern {
|
|
50
|
+
/** A global unique identifier for the tabpanel. */
|
|
51
|
+
id: SignalLike<string>;
|
|
52
|
+
/** A local unique identifier for the tabpanel. */
|
|
53
|
+
value: SignalLike<string>;
|
|
54
|
+
/** A reference to the corresponding tab. */
|
|
55
|
+
tab: SignalLike<TabPattern | undefined>;
|
|
56
|
+
/** Whether the tabpanel is hidden. */
|
|
57
|
+
hidden: i0.Signal<boolean>;
|
|
58
|
+
constructor(inputs: TabPanelInputs);
|
|
59
|
+
}
|
|
60
|
+
/** Controls the state of a tablist. */
|
|
61
|
+
declare class TabListPattern {
|
|
62
|
+
readonly inputs: TabListInputs;
|
|
63
|
+
/** Controls navigation for the tablist. */
|
|
64
|
+
navigation: ListNavigation<TabPattern>;
|
|
65
|
+
/** Controls selection for the tablist. */
|
|
66
|
+
selection: ListSelection<TabPattern, string>;
|
|
67
|
+
/** Controls focus for the tablist. */
|
|
68
|
+
focusManager: ListFocus<TabPattern>;
|
|
69
|
+
/** Whether the tablist is vertically or horizontally oriented. */
|
|
70
|
+
orientation: SignalLike<'vertical' | 'horizontal'>;
|
|
71
|
+
/** Whether the tablist is disabled. */
|
|
72
|
+
disabled: SignalLike<boolean>;
|
|
73
|
+
/** The tabindex of the tablist. */
|
|
74
|
+
tabindex: i0.Signal<0 | -1>;
|
|
75
|
+
/** The id of the current active tab. */
|
|
76
|
+
activedescendant: i0.Signal<string | undefined>;
|
|
77
|
+
followFocus: i0.Signal<boolean>;
|
|
78
|
+
/** The key used to navigate to the previous tab in the tablist. */
|
|
79
|
+
prevKey: i0.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
|
|
80
|
+
/** The key used to navigate to the next item in the list. */
|
|
81
|
+
nextKey: i0.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
|
|
82
|
+
/** The keydown event manager for the tablist. */
|
|
83
|
+
keydown: i0.Signal<KeyboardEventManager<KeyboardEvent>>;
|
|
84
|
+
/** The pointerdown event manager for the tablist. */
|
|
85
|
+
pointerdown: i0.Signal<PointerEventManager<PointerEvent>>;
|
|
86
|
+
constructor(inputs: TabListInputs);
|
|
87
|
+
/** Handles keydown events for the tablist. */
|
|
88
|
+
onKeydown(event: KeyboardEvent): void;
|
|
89
|
+
/** The pointerdown event manager for the tablist. */
|
|
90
|
+
onPointerdown(event: PointerEvent): void;
|
|
91
|
+
/** Navigates to the first option in the tablist. */
|
|
92
|
+
first(opts?: SelectOptions): void;
|
|
93
|
+
/** Navigates to the last option in the tablist. */
|
|
94
|
+
last(opts?: SelectOptions): void;
|
|
95
|
+
/** Navigates to the next option in the tablist. */
|
|
96
|
+
next(opts?: SelectOptions): void;
|
|
97
|
+
/** Navigates to the previous option in the tablist. */
|
|
98
|
+
prev(opts?: SelectOptions): void;
|
|
99
|
+
/** Navigates to the given item in the tablist. */
|
|
100
|
+
goto(event: PointerEvent, opts?: SelectOptions): void;
|
|
101
|
+
/** Handles updating selection for the tablist. */
|
|
102
|
+
private _updateSelection;
|
|
103
|
+
private _getItem;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { TabListPattern, TabPanelPattern, TabPattern };
|
|
107
|
+
export type { TabInputs, TabListInputs, TabPanelInputs };
|
package/ui-patterns/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ListboxInputs, ListboxPattern, OptionInputs, OptionPattern } from '../listbox.d-DJqDR_H3.js';
|
|
2
|
+
export { SignalLike, WritableSignalLike, convertGetterSetterToWritableSignalLike } from '../list-navigation.d-cy63EByU.js';
|
|
3
|
+
export { TabInputs, TabListInputs, TabListPattern, TabPanelInputs, TabPanelPattern, TabPattern } from '../tabs.d-CWu2orP4.js';
|
|
2
4
|
import '@angular/core';
|