@angular/cdk-experimental 20.0.0-next.0 → 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.
Files changed (45) hide show
  1. package/column-resize/index.d.ts +276 -289
  2. package/combobox/index.d.ts +15 -39
  3. package/deferred-content/index.d.ts +37 -0
  4. package/fesm2022/cdk-experimental.mjs +1 -1
  5. package/fesm2022/cdk-experimental.mjs.map +1 -1
  6. package/fesm2022/column-resize.mjs +139 -70
  7. package/fesm2022/column-resize.mjs.map +1 -1
  8. package/fesm2022/combobox.mjs +19 -26
  9. package/fesm2022/combobox.mjs.map +1 -1
  10. package/fesm2022/deferred-content.mjs +60 -0
  11. package/fesm2022/deferred-content.mjs.map +1 -0
  12. package/fesm2022/list-focus-Di7m_z_6.mjs +382 -0
  13. package/fesm2022/list-focus-Di7m_z_6.mjs.map +1 -0
  14. package/fesm2022/listbox.mjs +42 -21
  15. package/fesm2022/listbox.mjs.map +1 -1
  16. package/fesm2022/option-f_gNslw8.mjs +367 -0
  17. package/fesm2022/option-f_gNslw8.mjs.map +1 -0
  18. package/fesm2022/polyfill-CXksG4af.mjs +14 -0
  19. package/fesm2022/polyfill-CXksG4af.mjs.map +1 -0
  20. package/fesm2022/popover-edit.mjs +92 -81
  21. package/fesm2022/popover-edit.mjs.map +1 -1
  22. package/fesm2022/scrolling.mjs +7 -11
  23. package/fesm2022/scrolling.mjs.map +1 -1
  24. package/fesm2022/selection.mjs +19 -27
  25. package/fesm2022/selection.mjs.map +1 -1
  26. package/fesm2022/table-scroll-container.mjs +8 -13
  27. package/fesm2022/table-scroll-container.mjs.map +1 -1
  28. package/fesm2022/tabs-BunANY1M.mjs +176 -0
  29. package/fesm2022/tabs-BunANY1M.mjs.map +1 -0
  30. package/fesm2022/tabs.mjs +225 -0
  31. package/fesm2022/tabs.mjs.map +1 -0
  32. package/fesm2022/ui-patterns.mjs +12 -603
  33. package/fesm2022/ui-patterns.mjs.map +1 -1
  34. package/index.d.ts +2 -2
  35. package/list-navigation.d-DfOSxsSp.d.ts +247 -0
  36. package/listbox/index.d.ts +46 -39
  37. package/listbox.d-QWPLmxRe.d.ts +193 -0
  38. package/package.json +13 -2
  39. package/popover-edit/index.d.ts +269 -315
  40. package/scrolling/index.d.ts +34 -47
  41. package/selection/index.d.ts +119 -161
  42. package/table-scroll-container/index.d.ts +6 -14
  43. package/tabs/index.d.ts +128 -0
  44. package/tabs.d-BAo141mw.d.ts +110 -0
  45. package/ui-patterns/index.d.ts +4 -391
@@ -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.0",
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.0",
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"