@angular/cdk-experimental 20.0.0-next.1 → 20.0.0-next.10
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 +39 -4
- package/combobox/index.d.ts +3 -2
- 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 +134 -61
- package/fesm2022/column-resize.mjs.map +1 -1
- package/fesm2022/combobox.mjs +19 -22
- 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-Di7m_z_6.mjs +382 -0
- package/fesm2022/list-focus-Di7m_z_6.mjs.map +1 -0
- package/fesm2022/listbox.mjs +42 -17
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/option-f_gNslw8.mjs +367 -0
- package/fesm2022/option-f_gNslw8.mjs.map +1 -0
- package/fesm2022/{polyfill-ae40ec6f.mjs → polyfill-CXksG4af.mjs} +1 -1
- package/fesm2022/polyfill-CXksG4af.mjs.map +1 -0
- package/fesm2022/popover-edit.mjs +92 -65
- package/fesm2022/popover-edit.mjs.map +1 -1
- 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 +8 -9
- package/fesm2022/table-scroll-container.mjs.map +1 -1
- package/fesm2022/tabs-BunANY1M.mjs +176 -0
- package/fesm2022/tabs-BunANY1M.mjs.map +1 -0
- package/fesm2022/tabs.mjs +225 -0
- package/fesm2022/tabs.mjs.map +1 -0
- package/fesm2022/ui-patterns.mjs +14 -1
- package/fesm2022/ui-patterns.mjs.map +1 -1
- package/list-navigation.d-DfOSxsSp.d.ts +247 -0
- package/listbox/index.d.ts +30 -17
- package/listbox.d-QWPLmxRe.d.ts +193 -0
- package/package.json +13 -2
- package/popover-edit/index.d.ts +6 -4
- package/selection/index.d.ts +2 -1
- package/tabs/index.d.ts +128 -0
- package/tabs.d-BAo141mw.d.ts +110 -0
- package/ui-patterns/index.d.ts +3 -1
- package/fesm2022/option-d2bb1041.mjs +0 -607
- package/fesm2022/option-d2bb1041.mjs.map +0 -1
- package/fesm2022/polyfill-ae40ec6f.mjs.map +0 -1
- package/listbox.d-8e28229b.d.ts +0 -376
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
type SignalLike<T> = () => T;
|
|
4
|
+
interface WritableSignalLike<T> extends SignalLike<T> {
|
|
5
|
+
set(value: T): void;
|
|
6
|
+
update(updateFn: (value: T) => T): void;
|
|
7
|
+
}
|
|
8
|
+
/** Converts a getter setter style signal to a WritableSignalLike. */
|
|
9
|
+
declare function convertGetterSetterToWritableSignalLike<T>(getter: () => T, setter: (v: T) => void): WritableSignalLike<T>;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Options that are applicable to all event handlers.
|
|
13
|
+
*
|
|
14
|
+
* This library has not yet had a need for stopPropagationImmediate.
|
|
15
|
+
*/
|
|
16
|
+
interface EventHandlerOptions {
|
|
17
|
+
stopPropagation: boolean;
|
|
18
|
+
preventDefault: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** A basic event handler. */
|
|
21
|
+
type EventHandler<T extends Event> = (event: T) => void;
|
|
22
|
+
/** A function that determines whether an event is to be handled. */
|
|
23
|
+
type EventMatcher<T extends Event> = (event: T) => boolean;
|
|
24
|
+
/** A config that specifies how to handle a particular event. */
|
|
25
|
+
interface EventHandlerConfig<T extends Event> extends EventHandlerOptions {
|
|
26
|
+
matcher: EventMatcher<T>;
|
|
27
|
+
handler: EventHandler<T>;
|
|
28
|
+
}
|
|
29
|
+
/** Bit flag representation of the possible modifier keys that can be present on an event. */
|
|
30
|
+
declare enum ModifierKey {
|
|
31
|
+
None = 0,
|
|
32
|
+
Ctrl = 1,
|
|
33
|
+
Shift = 2,
|
|
34
|
+
Alt = 4,
|
|
35
|
+
Meta = 8,
|
|
36
|
+
Any = "Any"
|
|
37
|
+
}
|
|
38
|
+
type ModifierInputs = ModifierKey | ModifierKey[];
|
|
39
|
+
/**
|
|
40
|
+
* Abstract base class for all event managers.
|
|
41
|
+
*
|
|
42
|
+
* Event managers are designed to normalize how event handlers are authored and create a safety net
|
|
43
|
+
* for common event handling gotchas like remembering to call preventDefault or stopPropagation.
|
|
44
|
+
*/
|
|
45
|
+
declare abstract class EventManager<T extends Event> {
|
|
46
|
+
protected configs: EventHandlerConfig<T>[];
|
|
47
|
+
abstract options: EventHandlerOptions;
|
|
48
|
+
/** Runs the handlers that match with the given event. */
|
|
49
|
+
handle(event: T): void;
|
|
50
|
+
/** Configures the event manager to handle specific events. (See subclasses for more). */
|
|
51
|
+
abstract on(...args: [...unknown[]]): this;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Used to represent a keycode.
|
|
56
|
+
*
|
|
57
|
+
* This is used to match whether an events keycode should be handled. The ability to match using a
|
|
58
|
+
* string, SignalLike, or Regexp gives us more flexibility when authoring event handlers.
|
|
59
|
+
*/
|
|
60
|
+
type KeyCode = string | SignalLike<string> | RegExp;
|
|
61
|
+
/**
|
|
62
|
+
* An event manager that is specialized for handling keyboard events. By default this manager stops
|
|
63
|
+
* propagation and prevents default on all events it handles.
|
|
64
|
+
*/
|
|
65
|
+
declare class KeyboardEventManager<T extends KeyboardEvent> extends EventManager<T> {
|
|
66
|
+
options: EventHandlerOptions;
|
|
67
|
+
/** Configures this event manager to handle events with a specific key and no modifiers. */
|
|
68
|
+
on(key: KeyCode, handler: EventHandler<T>): this;
|
|
69
|
+
/** Configures this event manager to handle events with a specific modifer and key combination. */
|
|
70
|
+
on(modifiers: ModifierInputs, key: KeyCode, handler: EventHandler<T>): this;
|
|
71
|
+
private _normalizeInputs;
|
|
72
|
+
private _isMatch;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The different mouse buttons that may appear on a pointer event.
|
|
77
|
+
*/
|
|
78
|
+
declare enum MouseButton {
|
|
79
|
+
Main = 0,
|
|
80
|
+
Auxiliary = 1,
|
|
81
|
+
Secondary = 2
|
|
82
|
+
}
|
|
83
|
+
/** An event manager that is specialized for handling pointer events. */
|
|
84
|
+
declare class PointerEventManager<T extends PointerEvent> extends EventManager<T> {
|
|
85
|
+
options: EventHandlerOptions;
|
|
86
|
+
/**
|
|
87
|
+
* Configures this event manager to handle events with a specific modifer and mouse button
|
|
88
|
+
* combination.
|
|
89
|
+
*/
|
|
90
|
+
on(button: MouseButton, modifiers: ModifierInputs, handler: EventHandler<T>): this;
|
|
91
|
+
/**
|
|
92
|
+
* Configures this event manager to handle events with a specific mouse button and no modifiers.
|
|
93
|
+
*/
|
|
94
|
+
on(modifiers: ModifierInputs, handler: EventHandler<T>): this;
|
|
95
|
+
/**
|
|
96
|
+
* Configures this event manager to handle events with the main mouse button and no modifiers.
|
|
97
|
+
*
|
|
98
|
+
* @param handler The handler function
|
|
99
|
+
* @param options Options for whether to stop propagation or prevent default.
|
|
100
|
+
*/
|
|
101
|
+
on(handler: EventHandler<T>): this;
|
|
102
|
+
private _normalizeInputs;
|
|
103
|
+
_isMatch(event: PointerEvent, button: MouseButton, modifiers: ModifierInputs): boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Represents an item in a collection, such as a listbox option, than may receive focus. */
|
|
107
|
+
interface ListFocusItem {
|
|
108
|
+
/** A unique identifier for the item. */
|
|
109
|
+
id: SignalLike<string>;
|
|
110
|
+
/** The html element that should receive focus. */
|
|
111
|
+
element: SignalLike<HTMLElement>;
|
|
112
|
+
/** Whether an item is disabled. */
|
|
113
|
+
disabled: SignalLike<boolean>;
|
|
114
|
+
}
|
|
115
|
+
/** Represents the required inputs for a collection that contains focusable items. */
|
|
116
|
+
interface ListFocusInputs<T extends ListFocusItem> {
|
|
117
|
+
/** The focus strategy used by the list. */
|
|
118
|
+
focusMode: SignalLike<'roving' | 'activedescendant'>;
|
|
119
|
+
/** Whether the list is disabled. */
|
|
120
|
+
disabled: SignalLike<boolean>;
|
|
121
|
+
/** The items in the list. */
|
|
122
|
+
items: SignalLike<T[]>;
|
|
123
|
+
/** The index of the current active item. */
|
|
124
|
+
activeIndex: WritableSignalLike<number>;
|
|
125
|
+
/** Whether disabled items in the list should be skipped when navigating. */
|
|
126
|
+
skipDisabled: SignalLike<boolean>;
|
|
127
|
+
}
|
|
128
|
+
/** Controls focus for a list of items. */
|
|
129
|
+
declare class ListFocus<T extends ListFocusItem> {
|
|
130
|
+
readonly inputs: ListFocusInputs<T>;
|
|
131
|
+
/** The last index that was active. */
|
|
132
|
+
prevActiveIndex: i0.WritableSignal<number>;
|
|
133
|
+
/** The current active item. */
|
|
134
|
+
activeItem: i0.Signal<T>;
|
|
135
|
+
constructor(inputs: ListFocusInputs<T>);
|
|
136
|
+
/** Whether the list is in a disabled state. */
|
|
137
|
+
isListDisabled(): boolean;
|
|
138
|
+
/** The id of the current active item. */
|
|
139
|
+
getActiveDescendant(): string | undefined;
|
|
140
|
+
/** The tabindex for the list. */
|
|
141
|
+
getListTabindex(): -1 | 0;
|
|
142
|
+
/** Returns the tabindex for the given item. */
|
|
143
|
+
getItemTabindex(item: T): -1 | 0;
|
|
144
|
+
/** Moves focus to the given item if it is focusable. */
|
|
145
|
+
focus(item: T): boolean;
|
|
146
|
+
/** Returns true if the given item can be navigated to. */
|
|
147
|
+
isFocusable(item: T): boolean;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Represents an item in a collection, such as a listbox option, than can be selected. */
|
|
151
|
+
interface ListSelectionItem<V> extends ListFocusItem {
|
|
152
|
+
/** The value of the item. */
|
|
153
|
+
value: SignalLike<V>;
|
|
154
|
+
}
|
|
155
|
+
/** Represents the required inputs for a collection that contains selectable items. */
|
|
156
|
+
interface ListSelectionInputs<T extends ListSelectionItem<V>, V> extends ListFocusInputs<T> {
|
|
157
|
+
/** Whether multiple items in the list can be selected at once. */
|
|
158
|
+
multi: SignalLike<boolean>;
|
|
159
|
+
/** The current value of the list selection. */
|
|
160
|
+
value: WritableSignalLike<V[]>;
|
|
161
|
+
/** The selection strategy used by the list. */
|
|
162
|
+
selectionMode: SignalLike<'follow' | 'explicit'>;
|
|
163
|
+
}
|
|
164
|
+
/** Controls selection for a list of items. */
|
|
165
|
+
declare class ListSelection<T extends ListSelectionItem<V>, V> {
|
|
166
|
+
readonly inputs: ListSelectionInputs<T, V> & {
|
|
167
|
+
focusManager: ListFocus<T>;
|
|
168
|
+
};
|
|
169
|
+
/** The start index to use for range selection. */
|
|
170
|
+
rangeStartIndex: i0.WritableSignal<number>;
|
|
171
|
+
/** The end index to use for range selection. */
|
|
172
|
+
rangeEndIndex: i0.WritableSignal<number>;
|
|
173
|
+
constructor(inputs: ListSelectionInputs<T, V> & {
|
|
174
|
+
focusManager: ListFocus<T>;
|
|
175
|
+
});
|
|
176
|
+
/** Selects the item at the current active index. */
|
|
177
|
+
select(item?: ListSelectionItem<V>, opts?: {
|
|
178
|
+
anchor: boolean;
|
|
179
|
+
}): void;
|
|
180
|
+
/** Deselects the item at the current active index. */
|
|
181
|
+
deselect(item?: T): void;
|
|
182
|
+
/** Toggles the item at the current active index. */
|
|
183
|
+
toggle(): void;
|
|
184
|
+
/** Toggles only the item at the current active index. */
|
|
185
|
+
toggleOne(): void;
|
|
186
|
+
/** Selects all items in the list. */
|
|
187
|
+
selectAll(): void;
|
|
188
|
+
/** Deselects all items in the list. */
|
|
189
|
+
deselectAll(): void;
|
|
190
|
+
/**
|
|
191
|
+
* Selects all items in the list or deselects all
|
|
192
|
+
* items in the list if all items are already selected.
|
|
193
|
+
*/
|
|
194
|
+
toggleAll(): void;
|
|
195
|
+
/** Sets the selection to only the current active item. */
|
|
196
|
+
selectOne(): void;
|
|
197
|
+
/**
|
|
198
|
+
* Selects all items in the list up to the anchor item.
|
|
199
|
+
*
|
|
200
|
+
* Deselects all items that were previously within the
|
|
201
|
+
* selected range that are now outside of the selected range
|
|
202
|
+
*/
|
|
203
|
+
selectRange(opts?: {
|
|
204
|
+
anchor: boolean;
|
|
205
|
+
}): void;
|
|
206
|
+
/** Marks the given index as the start of a range selection. */
|
|
207
|
+
beginRangeSelection(index?: number): void;
|
|
208
|
+
/** Returns the items in the list starting from the given index. */
|
|
209
|
+
private _getItemsFromIndex;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/** Represents an item in a collection, such as a listbox option, than can be navigated to. */
|
|
213
|
+
interface ListNavigationItem extends ListFocusItem {
|
|
214
|
+
}
|
|
215
|
+
/** Represents the required inputs for a collection that has navigable items. */
|
|
216
|
+
interface ListNavigationInputs<T extends ListNavigationItem> extends ListFocusInputs<T> {
|
|
217
|
+
/** Whether focus should wrap when navigating. */
|
|
218
|
+
wrap: SignalLike<boolean>;
|
|
219
|
+
/** Whether the list is vertically or horizontally oriented. */
|
|
220
|
+
orientation: SignalLike<'vertical' | 'horizontal'>;
|
|
221
|
+
/** The direction that text is read based on the users locale. */
|
|
222
|
+
textDirection: SignalLike<'rtl' | 'ltr'>;
|
|
223
|
+
}
|
|
224
|
+
/** Controls navigation for a list of items. */
|
|
225
|
+
declare class ListNavigation<T extends ListNavigationItem> {
|
|
226
|
+
readonly inputs: ListNavigationInputs<T> & {
|
|
227
|
+
focusManager: ListFocus<T>;
|
|
228
|
+
};
|
|
229
|
+
constructor(inputs: ListNavigationInputs<T> & {
|
|
230
|
+
focusManager: ListFocus<T>;
|
|
231
|
+
});
|
|
232
|
+
/** Navigates to the given item. */
|
|
233
|
+
goto(item?: T): boolean;
|
|
234
|
+
/** Navigates to the next item in the list. */
|
|
235
|
+
next(): boolean;
|
|
236
|
+
/** Navigates to the previous item in the list. */
|
|
237
|
+
prev(): boolean;
|
|
238
|
+
/** Navigates to the first item in the list. */
|
|
239
|
+
first(): boolean;
|
|
240
|
+
/** Navigates to the last item in the list. */
|
|
241
|
+
last(): boolean;
|
|
242
|
+
/** Advances to the next or previous focusable item in the list based on the given delta. */
|
|
243
|
+
private _advance;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export { KeyboardEventManager as K, PointerEventManager as P, convertGetterSetterToWritableSignalLike as c, ListNavigation as g, ListSelection as h, ListFocus as i };
|
|
247
|
+
export type { ListNavigationItem as L, SignalLike as S, WritableSignalLike as W, ListSelectionItem as a, ListFocusItem as b, ListNavigationInputs as d, ListSelectionInputs as e, ListFocusInputs as f };
|
package/listbox/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
+
import { AfterViewInit } from '@angular/core';
|
|
2
3
|
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
3
|
-
import {
|
|
4
|
+
import { b as OptionPattern, a as ListboxPattern } from '../listbox.d-QWPLmxRe.js';
|
|
5
|
+
import '../list-navigation.d-DfOSxsSp.js';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* A listbox container.
|
|
@@ -10,13 +12,13 @@ import { O as OptionPattern, L as ListboxPattern } from '../listbox.d-8e28229b.j
|
|
|
10
12
|
*
|
|
11
13
|
* ```html
|
|
12
14
|
* <ul cdkListbox>
|
|
13
|
-
* <li cdkOption>Item 1</li>
|
|
14
|
-
* <li cdkOption>Item 2</li>
|
|
15
|
-
* <li cdkOption>Item 3</li>
|
|
15
|
+
* <li [value]="1" cdkOption>Item 1</li>
|
|
16
|
+
* <li [value]="2" cdkOption>Item 2</li>
|
|
17
|
+
* <li [value]="3" cdkOption>Item 3</li>
|
|
16
18
|
* </ul>
|
|
17
19
|
* ```
|
|
18
20
|
*/
|
|
19
|
-
declare class CdkListbox {
|
|
21
|
+
declare class CdkListbox<V> implements AfterViewInit {
|
|
20
22
|
/** The directionality (LTR / RTL) context for the application (or a subtree of it). */
|
|
21
23
|
private readonly _directionality;
|
|
22
24
|
/** The CdkOptions nested inside of the CdkListbox. */
|
|
@@ -24,11 +26,11 @@ declare class CdkListbox {
|
|
|
24
26
|
/** A signal wrapper for directionality. */
|
|
25
27
|
protected textDirection: i0.Signal<_angular_cdk_bidi.Direction>;
|
|
26
28
|
/** The Option UIPatterns of the child CdkOptions. */
|
|
27
|
-
protected items: i0.Signal<OptionPattern[]>;
|
|
29
|
+
protected items: i0.Signal<OptionPattern<any>[]>;
|
|
28
30
|
/** Whether the list is vertically or horizontally oriented. */
|
|
29
31
|
orientation: i0.InputSignal<"vertical" | "horizontal">;
|
|
30
32
|
/** Whether multiple items in the list can be selected at once. */
|
|
31
|
-
|
|
33
|
+
multi: i0.InputSignalWithTransform<boolean, unknown>;
|
|
32
34
|
/** Whether focus should wrap when navigating. */
|
|
33
35
|
wrap: i0.InputSignalWithTransform<boolean, unknown>;
|
|
34
36
|
/** Whether disabled items in the list should be skipped when navigating. */
|
|
@@ -41,17 +43,26 @@ declare class CdkListbox {
|
|
|
41
43
|
typeaheadDelay: i0.InputSignal<number>;
|
|
42
44
|
/** Whether the listbox is disabled. */
|
|
43
45
|
disabled: i0.InputSignalWithTransform<boolean, unknown>;
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
+
/** Whether the listbox is readonly. */
|
|
47
|
+
readonly: i0.InputSignalWithTransform<boolean, unknown>;
|
|
48
|
+
/** The values of the current selected items. */
|
|
49
|
+
value: i0.ModelSignal<V[]>;
|
|
46
50
|
/** The current index that has been navigated to. */
|
|
47
51
|
activeIndex: i0.ModelSignal<number>;
|
|
48
52
|
/** The Listbox UIPattern. */
|
|
49
|
-
pattern: ListboxPattern
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
pattern: ListboxPattern<V>;
|
|
54
|
+
/** Whether the listbox has received focus yet. */
|
|
55
|
+
private _hasFocused;
|
|
56
|
+
/** Whether the options in the listbox have been initialized. */
|
|
57
|
+
private _isViewInitialized;
|
|
58
|
+
constructor();
|
|
59
|
+
ngAfterViewInit(): void;
|
|
60
|
+
onFocus(): void;
|
|
61
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkListbox<any>, never>;
|
|
62
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkListbox<any>, "[cdkListbox]", ["cdkListbox"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "multi": { "alias": "multi"; "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; }; "typeaheadDelay": { "alias": "typeaheadDelay"; "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; }; "activeIndex": { "alias": "activeIndex"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "activeIndex": "activeIndexChange"; }, ["_cdkOptions"], never, true, never>;
|
|
52
63
|
}
|
|
53
64
|
/** A selectable option in a CdkListbox. */
|
|
54
|
-
declare class CdkOption {
|
|
65
|
+
declare class CdkOption<V> {
|
|
55
66
|
/** A reference to the option element. */
|
|
56
67
|
private readonly _elementRef;
|
|
57
68
|
/** The parent CdkListbox. */
|
|
@@ -60,10 +71,12 @@ declare class CdkOption {
|
|
|
60
71
|
private readonly _generatedId;
|
|
61
72
|
/** A unique identifier for the option. */
|
|
62
73
|
protected id: i0.Signal<string>;
|
|
74
|
+
/** The value of the option. */
|
|
75
|
+
protected value: i0.InputSignal<V>;
|
|
63
76
|
/** The text used by the typeahead search. */
|
|
64
77
|
protected searchTerm: i0.Signal<any>;
|
|
65
78
|
/** The parent Listbox UIPattern. */
|
|
66
|
-
protected listbox: i0.Signal<ListboxPattern
|
|
79
|
+
protected listbox: i0.Signal<ListboxPattern<any>>;
|
|
67
80
|
/** A reference to the option element to be focused on navigation. */
|
|
68
81
|
protected element: i0.Signal<any>;
|
|
69
82
|
/** Whether an item is disabled. */
|
|
@@ -71,9 +84,9 @@ declare class CdkOption {
|
|
|
71
84
|
/** The text used by the typeahead search. */
|
|
72
85
|
label: i0.InputSignal<string | undefined>;
|
|
73
86
|
/** The Option UIPattern. */
|
|
74
|
-
pattern: OptionPattern
|
|
75
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CdkOption
|
|
76
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkOption
|
|
87
|
+
pattern: OptionPattern<V>;
|
|
88
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CdkOption<any>, never>;
|
|
89
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkOption<any>, "[cdkOption]", ["cdkOption"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
77
90
|
}
|
|
78
91
|
|
|
79
92
|
export { CdkListbox, CdkOption };
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { b as ListFocusItem, S as SignalLike, f as ListFocusInputs, i as ListFocus, L as ListNavigationItem, a as ListSelectionItem, h as ListSelection, g as ListNavigation, d as ListNavigationInputs, e as ListSelectionInputs, K as KeyboardEventManager, P as PointerEventManager } from './list-navigation.d-DfOSxsSp.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 active. */
|
|
69
|
+
active: i0.Signal<boolean>;
|
|
70
|
+
/** Whether the option is selected. */
|
|
71
|
+
selected: i0.Signal<boolean | undefined>;
|
|
72
|
+
/** Whether the option is disabled. */
|
|
73
|
+
disabled: SignalLike<boolean>;
|
|
74
|
+
/** The text used by the typeahead search. */
|
|
75
|
+
searchTerm: SignalLike<string>;
|
|
76
|
+
/** A reference to the parent listbox. */
|
|
77
|
+
listbox: SignalLike<ListboxPattern$1<V> | undefined>;
|
|
78
|
+
/** The tabindex of the option. */
|
|
79
|
+
tabindex: i0.Signal<0 | -1 | undefined>;
|
|
80
|
+
/** The html element that should receive focus. */
|
|
81
|
+
element: SignalLike<HTMLElement>;
|
|
82
|
+
constructor(args: OptionInputs<V>);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** The selection operations that the listbox can perform. */
|
|
86
|
+
interface SelectOptions {
|
|
87
|
+
toggle?: boolean;
|
|
88
|
+
selectOne?: boolean;
|
|
89
|
+
selectRange?: boolean;
|
|
90
|
+
anchor?: boolean;
|
|
91
|
+
}
|
|
92
|
+
/** Represents the required inputs for a listbox. */
|
|
93
|
+
type ListboxInputs<V> = ListNavigationInputs<OptionPattern<V>> & ListSelectionInputs<OptionPattern<V>, V> & ListTypeaheadInputs<OptionPattern<V>> & ListFocusInputs<OptionPattern<V>> & {
|
|
94
|
+
readonly: SignalLike<boolean>;
|
|
95
|
+
};
|
|
96
|
+
/** Controls the state of a listbox. */
|
|
97
|
+
declare class ListboxPattern<V> {
|
|
98
|
+
readonly inputs: ListboxInputs<V>;
|
|
99
|
+
/** Controls navigation for the listbox. */
|
|
100
|
+
navigation: ListNavigation<OptionPattern<V>>;
|
|
101
|
+
/** Controls selection for the listbox. */
|
|
102
|
+
selection: ListSelection<OptionPattern<V>, V>;
|
|
103
|
+
/** Controls typeahead for the listbox. */
|
|
104
|
+
typeahead: ListTypeahead<OptionPattern<V>>;
|
|
105
|
+
/** Controls focus for the listbox. */
|
|
106
|
+
focusManager: ListFocus<OptionPattern<V>>;
|
|
107
|
+
/** Whether the list is vertically or horizontally oriented. */
|
|
108
|
+
orientation: SignalLike<'vertical' | 'horizontal'>;
|
|
109
|
+
/** Whether the listbox is disabled. */
|
|
110
|
+
disabled: i0.Signal<boolean>;
|
|
111
|
+
/** Whether the listbox is readonly. */
|
|
112
|
+
readonly: SignalLike<boolean>;
|
|
113
|
+
/** The tabindex of the listbox. */
|
|
114
|
+
tabindex: i0.Signal<0 | -1>;
|
|
115
|
+
/** The id of the current active item. */
|
|
116
|
+
activedescendant: i0.Signal<string | undefined>;
|
|
117
|
+
/** Whether multiple items in the list can be selected at once. */
|
|
118
|
+
multi: SignalLike<boolean>;
|
|
119
|
+
/** The number of items in the listbox. */
|
|
120
|
+
setsize: i0.Signal<number>;
|
|
121
|
+
/** Whether the listbox selection follows focus. */
|
|
122
|
+
followFocus: i0.Signal<boolean>;
|
|
123
|
+
/** Whether the listbox should wrap. Used to disable wrapping while range selecting. */
|
|
124
|
+
wrap: i0.WritableSignal<boolean>;
|
|
125
|
+
/** The key used to navigate to the previous item in the list. */
|
|
126
|
+
prevKey: i0.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
|
|
127
|
+
/** The key used to navigate to the next item in the list. */
|
|
128
|
+
nextKey: i0.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
|
|
129
|
+
/** Represents the space key. Does nothing when the user is actively using typeahead. */
|
|
130
|
+
dynamicSpaceKey: i0.Signal<"" | " ">;
|
|
131
|
+
/** The regexp used to decide if a key should trigger typeahead. */
|
|
132
|
+
typeaheadRegexp: RegExp;
|
|
133
|
+
/**
|
|
134
|
+
* The uncommitted index for selecting a range of options.
|
|
135
|
+
*
|
|
136
|
+
* NOTE: This is subtly distinct from the "rangeStartIndex" in the ListSelection behavior.
|
|
137
|
+
* The anchorIndex does not necessarily represent the start of a range, but represents the most
|
|
138
|
+
* recent index where the user showed intent to begin a range selection. Usually, this is wherever
|
|
139
|
+
* the user most recently pressed the "Shift" key, but if the user presses shift + space to select
|
|
140
|
+
* from the anchor, the user is not intending to start a new range from this index.
|
|
141
|
+
*
|
|
142
|
+
* In other words, "rangeStartIndex" is only set when a user commits to starting a range selection
|
|
143
|
+
* while "anchorIndex" is set whenever a user indicates they may be starting a range selection.
|
|
144
|
+
*/
|
|
145
|
+
anchorIndex: i0.WritableSignal<number>;
|
|
146
|
+
/** The keydown event manager for the listbox. */
|
|
147
|
+
keydown: i0.Signal<KeyboardEventManager<KeyboardEvent>>;
|
|
148
|
+
/** The pointerdown event manager for the listbox. */
|
|
149
|
+
pointerdown: i0.Signal<PointerEventManager<PointerEvent>>;
|
|
150
|
+
constructor(inputs: ListboxInputs<V>);
|
|
151
|
+
/** Handles keydown events for the listbox. */
|
|
152
|
+
onKeydown(event: KeyboardEvent): void;
|
|
153
|
+
onPointerdown(event: PointerEvent): void;
|
|
154
|
+
/** Navigates to the first option in the listbox. */
|
|
155
|
+
first(opts?: SelectOptions): void;
|
|
156
|
+
/** Navigates to the last option in the listbox. */
|
|
157
|
+
last(opts?: SelectOptions): void;
|
|
158
|
+
/** Navigates to the next option in the listbox. */
|
|
159
|
+
next(opts?: SelectOptions): void;
|
|
160
|
+
/** Navigates to the previous option in the listbox. */
|
|
161
|
+
prev(opts?: SelectOptions): void;
|
|
162
|
+
/** Navigates to the given item in the listbox. */
|
|
163
|
+
goto(event: PointerEvent, opts?: SelectOptions): void;
|
|
164
|
+
/** Handles typeahead search navigation for the listbox. */
|
|
165
|
+
search(char: string, opts?: SelectOptions): void;
|
|
166
|
+
/**
|
|
167
|
+
* Sets the listbox to it's default initial state.
|
|
168
|
+
*
|
|
169
|
+
* Sets the active index of the listbox to the first focusable selected
|
|
170
|
+
* item if one exists. Otherwise, sets focus to the first focusable item.
|
|
171
|
+
*
|
|
172
|
+
* This method should be called once the listbox and it's options are properly initialized,
|
|
173
|
+
* meaning the ListboxPattern and OptionPatterns should have references to each other before this
|
|
174
|
+
* is called.
|
|
175
|
+
*/
|
|
176
|
+
setDefaultState(): void;
|
|
177
|
+
/**
|
|
178
|
+
* Safely performs a navigation operation.
|
|
179
|
+
*
|
|
180
|
+
* Handles conditionally disabling wrapping for when a navigation
|
|
181
|
+
* operation is occurring while the user is selecting a range of options.
|
|
182
|
+
*
|
|
183
|
+
* Handles boilerplate calling of focus & selection operations. Also ensures these
|
|
184
|
+
* additional operations are only called if the navigation operation moved focus to a new option.
|
|
185
|
+
*/
|
|
186
|
+
private _navigate;
|
|
187
|
+
/** Handles updating selection for the listbox. */
|
|
188
|
+
private _updateSelection;
|
|
189
|
+
private _getItem;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export { ListboxPattern as a, OptionPattern as b };
|
|
193
|
+
export type { ListboxInputs as L, OptionInputs as O };
|
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.10",
|
|
4
4
|
"description": "Experimental components for Angular CDK",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,9 +12,12 @@
|
|
|
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.10",
|
|
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
|
+
"devDependencies": {
|
|
19
|
+
"@angular/cdk": "workspace:*"
|
|
20
|
+
},
|
|
18
21
|
"dependencies": {
|
|
19
22
|
"tslib": "^2.3.0"
|
|
20
23
|
},
|
|
@@ -49,6 +52,10 @@
|
|
|
49
52
|
"types": "./combobox/index.d.ts",
|
|
50
53
|
"default": "./fesm2022/combobox.mjs"
|
|
51
54
|
},
|
|
55
|
+
"./deferred-content": {
|
|
56
|
+
"types": "./deferred-content/index.d.ts",
|
|
57
|
+
"default": "./fesm2022/deferred-content.mjs"
|
|
58
|
+
},
|
|
52
59
|
"./listbox": {
|
|
53
60
|
"types": "./listbox/index.d.ts",
|
|
54
61
|
"default": "./fesm2022/listbox.mjs"
|
|
@@ -69,6 +76,10 @@
|
|
|
69
76
|
"types": "./table-scroll-container/index.d.ts",
|
|
70
77
|
"default": "./fesm2022/table-scroll-container.mjs"
|
|
71
78
|
},
|
|
79
|
+
"./tabs": {
|
|
80
|
+
"types": "./tabs/index.d.ts",
|
|
81
|
+
"default": "./fesm2022/tabs.mjs"
|
|
82
|
+
},
|
|
72
83
|
"./ui-patterns": {
|
|
73
84
|
"types": "./ui-patterns/index.d.ts",
|
|
74
85
|
"default": "./fesm2022/ui-patterns.mjs"
|
package/popover-edit/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
import { OnDestroy, OnInit, ElementRef, EventEmitter, NgZone, AfterViewInit, ViewContainerRef, TemplateRef, EmbeddedViewRef } from '@angular/core';
|
|
4
4
|
import { Directionality } from '@angular/cdk/bidi';
|
|
5
5
|
import * as i1 from '@angular/cdk/overlay';
|
|
6
|
-
import {
|
|
6
|
+
import { OverlayRef } from '@angular/cdk/overlay';
|
|
7
7
|
import { FocusTrapFactory, FocusTrap, InteractivityChecker } from '@angular/cdk/a11y';
|
|
8
8
|
import { ScrollDispatcher, ViewportRuler } from '@angular/cdk/scrolling';
|
|
9
9
|
|
|
@@ -260,7 +260,6 @@ declare class EditServices {
|
|
|
260
260
|
readonly focusDispatcher: FocusDispatcher;
|
|
261
261
|
readonly focusTrapFactory: FocusTrapFactory;
|
|
262
262
|
readonly ngZone: NgZone;
|
|
263
|
-
readonly overlay: Overlay;
|
|
264
263
|
readonly scrollDispatcher: ScrollDispatcher;
|
|
265
264
|
readonly viewportRuler: ViewportRuler;
|
|
266
265
|
static ɵfac: i0.ɵɵFactoryDeclaration<EditServices, never>;
|
|
@@ -317,7 +316,8 @@ declare class CdkEditable implements AfterViewInit, OnDestroy {
|
|
|
317
316
|
protected readonly ngZone: NgZone;
|
|
318
317
|
private readonly _renderer;
|
|
319
318
|
protected readonly destroyed: Subject<void>;
|
|
320
|
-
private
|
|
319
|
+
private _rowsRendered;
|
|
320
|
+
private _rowMutationObserver;
|
|
321
321
|
constructor();
|
|
322
322
|
ngAfterViewInit(): void;
|
|
323
323
|
ngOnDestroy(): void;
|
|
@@ -335,6 +335,7 @@ declare class CdkPopoverEdit<C> implements AfterViewInit, OnDestroy {
|
|
|
335
335
|
protected readonly services: EditServices;
|
|
336
336
|
protected readonly elementRef: ElementRef<any>;
|
|
337
337
|
protected readonly viewContainerRef: ViewContainerRef;
|
|
338
|
+
private _injector;
|
|
338
339
|
/** The edit lens template shown over the cell on edit. */
|
|
339
340
|
template: TemplateRef<any> | null;
|
|
340
341
|
/**
|
|
@@ -445,4 +446,5 @@ declare const CELL_SELECTOR = ".cdk-cell, .mat-cell, td";
|
|
|
445
446
|
/** closest implementation that is able to start from non-Element Nodes. */
|
|
446
447
|
declare function closest(element: EventTarget | Element | null | undefined, selector: string): Element | null;
|
|
447
448
|
|
|
448
|
-
export { CdkEditClose, CdkEditControl, CdkEditOpen, CdkEditRevert, CdkEditable, CdkPopoverEdit,
|
|
449
|
+
export { CdkEditClose, CdkEditControl, CdkEditOpen, CdkEditRevert, CdkEditable, CdkPopoverEdit, CdkPopoverEditModule, CdkPopoverEditTabOut, CdkRowHoverContent, EditEventDispatcher, EditRef, FocusDispatcher, FormValueContainer, HoverContentState, CELL_SELECTOR as _CELL_SELECTOR, closest as _closest };
|
|
450
|
+
export type { CdkPopoverEditColspan, Entry, PopoverEditClickOutBehavior };
|
package/selection/index.d.ts
CHANGED
|
@@ -225,4 +225,5 @@ declare class CdkSelectionModule {
|
|
|
225
225
|
static ɵinj: i0.ɵɵInjectorDeclaration<CdkSelectionModule>;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
export { CdkRowSelection, CdkSelectAll, CdkSelection, CdkSelectionColumn, CdkSelectionModule, CdkSelectionToggle,
|
|
228
|
+
export { CdkRowSelection, CdkSelectAll, CdkSelection, CdkSelectionColumn, CdkSelectionModule, CdkSelectionToggle, SelectionSet };
|
|
229
|
+
export type { SelectableWithIndex, SelectionChange };
|