@angular/cdk-experimental 20.0.2 → 20.1.0-next.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 +86 -0
- package/accordion.d-B3UVyhWI.d.ts +87 -0
- package/expansion.d-DSLPa1yp.d.ts +74 -0
- package/fesm2022/accordion-CyyDY39y.mjs +152 -0
- package/fesm2022/accordion-CyyDY39y.mjs.map +1 -0
- package/fesm2022/accordion.mjs +184 -0
- package/fesm2022/accordion.mjs.map +1 -0
- package/fesm2022/cdk-experimental.mjs +1 -1
- package/fesm2022/cdk-experimental.mjs.map +1 -1
- package/fesm2022/expansion-DykBzWrb.mjs +93 -0
- package/fesm2022/expansion-DykBzWrb.mjs.map +1 -0
- package/fesm2022/{list-focus-Di7m_z_6.mjs → list-focus-BXQdAA3i.mjs} +2 -126
- package/fesm2022/list-focus-BXQdAA3i.mjs.map +1 -0
- package/fesm2022/list-selection-BLV4Yy7T.mjs +130 -0
- package/fesm2022/list-selection-BLV4Yy7T.mjs.map +1 -0
- package/fesm2022/listbox.mjs +18 -14
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/{option-f_gNslw8.mjs → option-r2ojgVMH.mjs} +15 -2
- package/fesm2022/option-r2ojgVMH.mjs.map +1 -0
- package/fesm2022/radio-s5uO_tmJ.mjs +203 -0
- package/fesm2022/radio-s5uO_tmJ.mjs.map +1 -0
- package/fesm2022/radio.mjs +169 -0
- package/fesm2022/radio.mjs.map +1 -0
- package/fesm2022/{tabs-DFP3Xs4J.mjs → tabs-BN3wsMdD.mjs} +46 -80
- package/fesm2022/tabs-BN3wsMdD.mjs.map +1 -0
- package/fesm2022/tabs.mjs +4 -2
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/ui-patterns.mjs +7 -3
- package/fesm2022/ui-patterns.mjs.map +1 -1
- package/{list-navigation.d-DfOSxsSp.d.ts → list-navigation.d-Br99p_2O.d.ts} +2 -64
- package/list-selection.d-BQWRFJI-.d.ts +69 -0
- package/listbox/index.d.ts +5 -10
- package/{listbox.d-QWPLmxRe.d.ts → listbox.d-C8oz9si7.d.ts} +4 -1
- package/package.json +11 -3
- package/radio/index.d.ts +77 -0
- package/radio-group.d-C3xIREax.d.ts +114 -0
- package/tabs/index.d.ts +4 -2
- package/{tabs.d-DooGD7Uk.d.ts → tabs.d-D0UIRVMM.d.ts} +17 -61
- package/ui-patterns/index.d.ts +7 -3
- package/fesm2022/list-focus-Di7m_z_6.mjs.map +0 -1
- package/fesm2022/option-f_gNslw8.mjs.map +0 -1
- package/fesm2022/tabs-DFP3Xs4J.mjs.map +0 -1
|
@@ -1,45 +1,7 @@
|
|
|
1
1
|
import { computed } from '@angular/core';
|
|
2
|
-
import { K as KeyboardEventManager, P as PointerEventManager, L as ListFocus,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* An Expansion control.
|
|
6
|
-
*
|
|
7
|
-
* Use Expansion behavior if a pattern has a collapsible view that has two elements rely on the
|
|
8
|
-
* states from each other. For example
|
|
9
|
-
*
|
|
10
|
-
* ```html
|
|
11
|
-
* <button aria-controls="remote-content" aria-expanded="false">Toggle Content</button>
|
|
12
|
-
*
|
|
13
|
-
* ...
|
|
14
|
-
*
|
|
15
|
-
* <div id="remote-content" aria-hidden="true">
|
|
16
|
-
* Collapsible content
|
|
17
|
-
* </div>
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
class ExpansionControl {
|
|
21
|
-
inputs;
|
|
22
|
-
/** Whether an Expansion is visible. */
|
|
23
|
-
visible;
|
|
24
|
-
/** The controllerd Expansion panel Id. */
|
|
25
|
-
controls = computed(() => this.inputs.expansionPanel()?.id());
|
|
26
|
-
constructor(inputs) {
|
|
27
|
-
this.inputs = inputs;
|
|
28
|
-
this.visible = inputs.visible;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/** A Expansion panel. */
|
|
32
|
-
class ExpansionPanel {
|
|
33
|
-
inputs;
|
|
34
|
-
/** A unique identifier for the panel. */
|
|
35
|
-
id;
|
|
36
|
-
/** Whether the panel is hidden. */
|
|
37
|
-
hidden = computed(() => !this.inputs.expansionControl()?.visible());
|
|
38
|
-
constructor(inputs) {
|
|
39
|
-
this.inputs = inputs;
|
|
40
|
-
this.id = inputs.id;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
2
|
+
import { K as KeyboardEventManager, P as PointerEventManager, L as ListFocus, a as ListNavigation } from './list-focus-BXQdAA3i.mjs';
|
|
3
|
+
import { L as ListSelection } from './list-selection-BLV4Yy7T.mjs';
|
|
4
|
+
import { E as ExpansionControl, L as ListExpansion } from './expansion-DykBzWrb.mjs';
|
|
43
5
|
|
|
44
6
|
/** A tab in a tablist. */
|
|
45
7
|
class TabPattern {
|
|
@@ -52,45 +14,50 @@ class TabPattern {
|
|
|
52
14
|
disabled;
|
|
53
15
|
/** The html element that should receive focus. */
|
|
54
16
|
element;
|
|
55
|
-
/**
|
|
56
|
-
|
|
17
|
+
/** Whether this tab has expandable content. */
|
|
18
|
+
expandable;
|
|
19
|
+
/** The unique identifier used by the expansion behavior. */
|
|
20
|
+
expansionId;
|
|
21
|
+
/** Whether the tab is expanded. */
|
|
22
|
+
expanded;
|
|
57
23
|
/** Whether the tab is active. */
|
|
58
24
|
active = computed(() => this.inputs.tablist().focusManager.activeItem() === this);
|
|
59
25
|
/** Whether the tab is selected. */
|
|
60
26
|
selected = computed(() => !!this.inputs.tablist().selection.inputs.value().includes(this.value()));
|
|
61
|
-
/** A tabpanel Id controlled by the tab. */
|
|
62
|
-
controls = computed(() => this.expansionControl.controls());
|
|
63
27
|
/** The tabindex of the tab. */
|
|
64
28
|
tabindex = computed(() => this.inputs.tablist().focusManager.getItemTabindex(this));
|
|
29
|
+
/** The id of the tabpanel associated with the tab. */
|
|
30
|
+
controls = computed(() => this.inputs.tabpanel()?.id());
|
|
65
31
|
constructor(inputs) {
|
|
66
32
|
this.inputs = inputs;
|
|
67
33
|
this.id = inputs.id;
|
|
68
34
|
this.value = inputs.value;
|
|
69
35
|
this.disabled = inputs.disabled;
|
|
70
36
|
this.element = inputs.element;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
37
|
+
const expansionControl = new ExpansionControl({
|
|
38
|
+
...inputs,
|
|
39
|
+
expansionId: inputs.value,
|
|
40
|
+
expandable: () => true,
|
|
41
|
+
expansionManager: inputs.tablist().expansionManager,
|
|
74
42
|
});
|
|
43
|
+
this.expansionId = expansionControl.expansionId;
|
|
44
|
+
this.expandable = expansionControl.isExpandable;
|
|
45
|
+
this.expanded = expansionControl.isExpanded;
|
|
75
46
|
}
|
|
76
47
|
}
|
|
77
48
|
/** A tabpanel associated with a tab. */
|
|
78
49
|
class TabPanelPattern {
|
|
50
|
+
inputs;
|
|
79
51
|
/** A global unique identifier for the tabpanel. */
|
|
80
52
|
id;
|
|
81
53
|
/** A local unique identifier for the tabpanel. */
|
|
82
54
|
value;
|
|
83
|
-
/** Represents the expansion state for the tabpanel. */
|
|
84
|
-
expansionPanel;
|
|
85
55
|
/** Whether the tabpanel is hidden. */
|
|
86
|
-
hidden = computed(() => this.
|
|
56
|
+
hidden = computed(() => this.inputs.tab()?.expanded() === false);
|
|
87
57
|
constructor(inputs) {
|
|
58
|
+
this.inputs = inputs;
|
|
88
59
|
this.id = inputs.id;
|
|
89
60
|
this.value = inputs.value;
|
|
90
|
-
this.expansionPanel = new ExpansionPanel({
|
|
91
|
-
id: inputs.id,
|
|
92
|
-
expansionControl: computed(() => inputs.tab()?.expansionControl),
|
|
93
|
-
});
|
|
94
61
|
}
|
|
95
62
|
}
|
|
96
63
|
/** Controls the state of a tablist. */
|
|
@@ -102,6 +69,8 @@ class TabListPattern {
|
|
|
102
69
|
selection;
|
|
103
70
|
/** Controls focus for the tablist. */
|
|
104
71
|
focusManager;
|
|
72
|
+
/** Controls expansion for the tablist. */
|
|
73
|
+
expansionManager;
|
|
105
74
|
/** Whether the tablist is vertically or horizontally oriented. */
|
|
106
75
|
orientation;
|
|
107
76
|
/** Whether the tablist is disabled. */
|
|
@@ -128,18 +97,17 @@ class TabListPattern {
|
|
|
128
97
|
});
|
|
129
98
|
/** The keydown event manager for the tablist. */
|
|
130
99
|
keydown = computed(() => {
|
|
131
|
-
|
|
132
|
-
.on(this.prevKey, () => this.prev({
|
|
133
|
-
.on(this.nextKey, () => this.next({
|
|
134
|
-
.on('Home', () => this.first({
|
|
135
|
-
.on('End', () => this.last({
|
|
136
|
-
.on(' ', () => this.
|
|
137
|
-
.on('Enter', () => this.
|
|
138
|
-
return manager;
|
|
100
|
+
return new KeyboardEventManager()
|
|
101
|
+
.on(this.prevKey, () => this.prev({ select: this.followFocus() }))
|
|
102
|
+
.on(this.nextKey, () => this.next({ select: this.followFocus() }))
|
|
103
|
+
.on('Home', () => this.first({ select: this.followFocus() }))
|
|
104
|
+
.on('End', () => this.last({ select: this.followFocus() }))
|
|
105
|
+
.on(' ', () => this._select({ select: true }))
|
|
106
|
+
.on('Enter', () => this._select({ select: true }));
|
|
139
107
|
});
|
|
140
108
|
/** The pointerdown event manager for the tablist. */
|
|
141
109
|
pointerdown = computed(() => {
|
|
142
|
-
return new PointerEventManager().on(e => this.goto(e, {
|
|
110
|
+
return new PointerEventManager().on(e => this.goto(e, { select: true }));
|
|
143
111
|
});
|
|
144
112
|
constructor(inputs) {
|
|
145
113
|
this.inputs = inputs;
|
|
@@ -152,6 +120,12 @@ class TabListPattern {
|
|
|
152
120
|
multi: () => false,
|
|
153
121
|
focusManager: this.focusManager,
|
|
154
122
|
});
|
|
123
|
+
this.expansionManager = new ListExpansion({
|
|
124
|
+
...inputs,
|
|
125
|
+
multiExpandable: () => false,
|
|
126
|
+
expandedIds: this.inputs.value,
|
|
127
|
+
focusManager: this.focusManager,
|
|
128
|
+
});
|
|
155
129
|
}
|
|
156
130
|
/** Handles keydown events for the tablist. */
|
|
157
131
|
onKeydown(event) {
|
|
@@ -168,44 +142,36 @@ class TabListPattern {
|
|
|
168
142
|
/** Navigates to the first option in the tablist. */
|
|
169
143
|
first(opts) {
|
|
170
144
|
this.navigation.first();
|
|
171
|
-
this.
|
|
145
|
+
this._select(opts);
|
|
172
146
|
}
|
|
173
147
|
/** Navigates to the last option in the tablist. */
|
|
174
148
|
last(opts) {
|
|
175
149
|
this.navigation.last();
|
|
176
|
-
this.
|
|
150
|
+
this._select(opts);
|
|
177
151
|
}
|
|
178
152
|
/** Navigates to the next option in the tablist. */
|
|
179
153
|
next(opts) {
|
|
180
154
|
this.navigation.next();
|
|
181
|
-
this.
|
|
155
|
+
this._select(opts);
|
|
182
156
|
}
|
|
183
157
|
/** Navigates to the previous option in the tablist. */
|
|
184
158
|
prev(opts) {
|
|
185
159
|
this.navigation.prev();
|
|
186
|
-
this.
|
|
160
|
+
this._select(opts);
|
|
187
161
|
}
|
|
188
162
|
/** Navigates to the given item in the tablist. */
|
|
189
163
|
goto(event, opts) {
|
|
190
164
|
const item = this._getItem(event);
|
|
191
165
|
if (item) {
|
|
192
166
|
this.navigation.goto(item);
|
|
193
|
-
this.
|
|
167
|
+
this._select(opts);
|
|
194
168
|
}
|
|
195
169
|
}
|
|
196
170
|
/** Handles updating selection for the tablist. */
|
|
197
|
-
|
|
171
|
+
_select(opts) {
|
|
198
172
|
if (opts?.select) {
|
|
199
|
-
this.selection.select();
|
|
200
|
-
}
|
|
201
|
-
if (opts?.toggle) {
|
|
202
|
-
this.selection.toggle();
|
|
203
|
-
}
|
|
204
|
-
if (opts?.toggleOne) {
|
|
205
|
-
this.selection.toggleOne();
|
|
206
|
-
}
|
|
207
|
-
if (opts?.selectOne) {
|
|
208
173
|
this.selection.selectOne();
|
|
174
|
+
this.expansionManager.open();
|
|
209
175
|
}
|
|
210
176
|
}
|
|
211
177
|
_getItem(e) {
|
|
@@ -218,4 +184,4 @@ class TabListPattern {
|
|
|
218
184
|
}
|
|
219
185
|
|
|
220
186
|
export { TabListPattern as T, TabPattern as a, TabPanelPattern as b };
|
|
221
|
-
//# sourceMappingURL=tabs-
|
|
187
|
+
//# sourceMappingURL=tabs-BN3wsMdD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs-BN3wsMdD.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/tabs/tabs.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computed} from '@angular/core';\nimport {KeyboardEventManager} from '../behaviors/event-manager/keyboard-event-manager';\nimport {PointerEventManager} from '../behaviors/event-manager/pointer-event-manager';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../behaviors/list-focus/list-focus';\nimport {\n ListNavigation,\n ListNavigationInputs,\n ListNavigationItem,\n} from '../behaviors/list-navigation/list-navigation';\nimport {\n ListSelection,\n ListSelectionInputs,\n ListSelectionItem,\n} from '../behaviors/list-selection/list-selection';\nimport {\n ExpansionItem,\n ExpansionControl,\n ListExpansionInputs,\n ListExpansion,\n} from '../behaviors/expansion/expansion';\nimport {SignalLike} from '../behaviors/signal-like/signal-like';\n\n/** The required inputs to tabs. */\nexport interface TabInputs\n extends ListNavigationItem,\n ListSelectionItem<string>,\n ListFocusItem,\n Omit<ExpansionItem, 'expansionId' | 'expandable'> {\n /** The parent tablist that controls the tab. */\n tablist: SignalLike<TabListPattern>;\n\n /** The remote tabpanel controlled by the tab. */\n tabpanel: SignalLike<TabPanelPattern | undefined>;\n}\n\n/** A tab in a tablist. */\nexport class TabPattern {\n /** A global unique identifier for the tab. */\n id: SignalLike<string>;\n\n /** A local unique identifier for the tab. */\n value: SignalLike<string>;\n\n /** Whether the tab is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement>;\n\n /** Whether this tab has expandable content. */\n expandable: SignalLike<boolean>;\n\n /** The unique identifier used by the expansion behavior. */\n expansionId: SignalLike<string>;\n\n /** Whether the tab is expanded. */\n expanded: SignalLike<boolean>;\n\n /** Whether the tab is active. */\n active = computed(() => this.inputs.tablist().focusManager.activeItem() === this);\n\n /** Whether the tab is selected. */\n selected = computed(\n () => !!this.inputs.tablist().selection.inputs.value().includes(this.value()),\n );\n\n /** The tabindex of the tab. */\n tabindex = computed(() => this.inputs.tablist().focusManager.getItemTabindex(this));\n\n /** The id of the tabpanel associated with the tab. */\n controls = computed(() => this.inputs.tabpanel()?.id());\n\n constructor(readonly inputs: TabInputs) {\n this.id = inputs.id;\n this.value = inputs.value;\n this.disabled = inputs.disabled;\n this.element = inputs.element;\n const expansionControl = new ExpansionControl({\n ...inputs,\n expansionId: inputs.value,\n expandable: () => true,\n expansionManager: inputs.tablist().expansionManager,\n });\n this.expansionId = expansionControl.expansionId;\n this.expandable = expansionControl.isExpandable;\n this.expanded = expansionControl.isExpanded;\n }\n}\n\n/** The required inputs for the tabpanel. */\nexport interface TabPanelInputs {\n id: SignalLike<string>;\n tab: SignalLike<TabPattern | undefined>;\n value: SignalLike<string>;\n}\n\n/** A tabpanel associated with a tab. */\nexport class TabPanelPattern {\n /** A global unique identifier for the tabpanel. */\n id: SignalLike<string>;\n\n /** A local unique identifier for the tabpanel. */\n value: SignalLike<string>;\n\n /** Whether the tabpanel is hidden. */\n hidden = computed(() => this.inputs.tab()?.expanded() === false);\n\n constructor(readonly inputs: TabPanelInputs) {\n this.id = inputs.id;\n this.value = inputs.value;\n }\n}\n\n/** The selection operations that the tablist can perform. */\ninterface SelectOptions {\n select?: boolean;\n}\n\n/** The required inputs for the tablist. */\nexport type TabListInputs = ListNavigationInputs<TabPattern> &\n Omit<ListSelectionInputs<TabPattern, string>, 'multi'> &\n ListFocusInputs<TabPattern> &\n Omit<ListExpansionInputs<TabPattern>, 'multiExpandable' | 'expandedIds'> & {\n disabled: SignalLike<boolean>;\n };\n\n/** Controls the state of a tablist. */\nexport class TabListPattern {\n /** Controls navigation for the tablist. */\n navigation: ListNavigation<TabPattern>;\n\n /** Controls selection for the tablist. */\n selection: ListSelection<TabPattern, string>;\n\n /** Controls focus for the tablist. */\n focusManager: ListFocus<TabPattern>;\n\n /** Controls expansion for the tablist. */\n expansionManager: ListExpansion<TabPattern>;\n\n /** Whether the tablist is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** Whether the tablist is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The tabindex of the tablist. */\n tabindex = computed(() => this.focusManager.getListTabindex());\n\n /** The id of the current active tab. */\n activedescendant = computed(() => this.focusManager.getActiveDescendant());\n\n /** Whether selection should follow focus. */\n followFocus = computed(() => this.inputs.selectionMode() === 'follow');\n\n /** The key used to navigate to the previous tab in the tablist. */\n prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next item in the list. */\n nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The keydown event manager for the tablist. */\n keydown = computed(() => {\n return new KeyboardEventManager()\n .on(this.prevKey, () => this.prev({select: this.followFocus()}))\n .on(this.nextKey, () => this.next({select: this.followFocus()}))\n .on('Home', () => this.first({select: this.followFocus()}))\n .on('End', () => this.last({select: this.followFocus()}))\n .on(' ', () => this._select({select: true}))\n .on('Enter', () => this._select({select: true}));\n });\n\n /** The pointerdown event manager for the tablist. */\n pointerdown = computed(() => {\n return new PointerEventManager().on(e => this.goto(e, {select: true}));\n });\n\n constructor(readonly inputs: TabListInputs) {\n this.disabled = inputs.disabled;\n this.orientation = inputs.orientation;\n\n this.focusManager = new ListFocus(inputs);\n this.navigation = new ListNavigation({...inputs, focusManager: this.focusManager});\n\n this.selection = new ListSelection({\n ...inputs,\n multi: () => false,\n focusManager: this.focusManager,\n });\n\n this.expansionManager = new ListExpansion({\n ...inputs,\n multiExpandable: () => false,\n expandedIds: this.inputs.value,\n focusManager: this.focusManager,\n });\n }\n\n /** Handles keydown events for the tablist. */\n onKeydown(event: KeyboardEvent) {\n if (!this.disabled()) {\n this.keydown().handle(event);\n }\n }\n\n /** The pointerdown event manager for the tablist. */\n onPointerdown(event: PointerEvent) {\n if (!this.disabled()) {\n this.pointerdown().handle(event);\n }\n }\n\n /** Navigates to the first option in the tablist. */\n first(opts?: SelectOptions) {\n this.navigation.first();\n this._select(opts);\n }\n\n /** Navigates to the last option in the tablist. */\n last(opts?: SelectOptions) {\n this.navigation.last();\n this._select(opts);\n }\n\n /** Navigates to the next option in the tablist. */\n next(opts?: SelectOptions) {\n this.navigation.next();\n this._select(opts);\n }\n\n /** Navigates to the previous option in the tablist. */\n prev(opts?: SelectOptions) {\n this.navigation.prev();\n this._select(opts);\n }\n\n /** Navigates to the given item in the tablist. */\n goto(event: PointerEvent, opts?: SelectOptions) {\n const item = this._getItem(event);\n\n if (item) {\n this.navigation.goto(item);\n this._select(opts);\n }\n }\n\n /** Handles updating selection for the tablist. */\n private _select(opts?: SelectOptions) {\n if (opts?.select) {\n this.selection.selectOne();\n this.expansionManager.open();\n }\n }\n\n private _getItem(e: PointerEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n\n const element = e.target.closest('[role=\"tab\"]');\n return this.inputs.items().find(i => i.element() === element);\n }\n}\n"],"names":[],"mappings":";;;;;AA2CA;MACa,UAAU,CAAA;AAoCA,IAAA,MAAA;;AAlCrB,IAAA,EAAE;;AAGF,IAAA,KAAK;;AAGL,IAAA,QAAQ;;AAGR,IAAA,OAAO;;AAGP,IAAA,UAAU;;AAGV,IAAA,WAAW;;AAGX,IAAA,QAAQ;;IAGR,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,KAAK,IAAI,CAAC;;AAGjF,IAAA,QAAQ,GAAG,QAAQ,CACjB,MA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,IAAA,IAAI,CAAC,IAAoB,EAAA;AACvB,QAAA,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;AACtB,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;;;IAIpB,IAAI,CAAC,KAAmB,EAAE,IAAoB,EAAA;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAEjC,IAAI,IAAI,EAAE;AACR,YAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;AAC1B,YAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;;;;AAKd,IAAA,OAAO,CAAC,IAAoB,EAAA;AAClC,QAAA,IAAI,IAAI,EAAE,MAAM,EAAE;AAChB,YAAA,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;AAC1B,YAAA,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE;;;AAIxB,IAAA,QAAQ,CAAC,CAAe,EAAA;QAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,YAAY,WAAW,CAAC,EAAE;YACtC;;QAGF,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,KAAK,OAAO,CAAC;;AAEhE;;;;"}
|
package/fesm2022/tabs.mjs
CHANGED
|
@@ -5,8 +5,10 @@ import { Directionality } from '@angular/cdk/bidi';
|
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
6
|
import { contentChild, contentChildren, computed, Directive, inject, linkedSignal, input, booleanAttribute, model, effect, ElementRef } from '@angular/core';
|
|
7
7
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
8
|
-
import { T as TabListPattern, a as TabPattern, b as TabPanelPattern } from './tabs-
|
|
9
|
-
import './list-focus-
|
|
8
|
+
import { T as TabListPattern, a as TabPattern, b as TabPanelPattern } from './tabs-BN3wsMdD.mjs';
|
|
9
|
+
import './list-focus-BXQdAA3i.mjs';
|
|
10
|
+
import './list-selection-BLV4Yy7T.mjs';
|
|
11
|
+
import './expansion-DykBzWrb.mjs';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* A Tabs container.
|
package/fesm2022/tabs.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/tabs/tabs.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {DeferredContent, DeferredContentAware} from '@angular/cdk-experimental/deferred-content';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n booleanAttribute,\n computed,\n contentChild,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n linkedSignal,\n} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {TabListPattern, TabPanelPattern, TabPattern} from '../ui-patterns';\n\n/**\n * A Tabs container.\n *\n * Represents a set of layered sections of content. The CdkTabs is a container meant to be used with\n * CdkTabList, CdkTab, and CdkTabPanel as follows:\n *\n * ```html\n * <div cdkTabs>\n * <ul cdkTabList>\n * <li cdkTab value=\"tab1\">Tab 1</li>\n * <li cdkTab value=\"tab2\">Tab 2</li>\n * <li cdkTab value=\"tab3\">Tab 3</li>\n * </ul>\n *\n * <div cdkTabPanel value=\"tab1\">\n * <ng-template cdkTabContent>Tab content 1</ng-template>\n * </div>\n * <div cdkTabPanel value=\"tab2\">\n * <ng-template cdkTabContent>Tab content 2</ng-template>\n * </div>\n * <div cdkTabPanel value=\"tab3\">\n * <ng-template cdkTabContent>Tab content 3</ng-template>\n * </div>\n * ```\n */\n@Directive({\n selector: '[cdkTabs]',\n exportAs: 'cdkTabs',\n host: {\n 'class': 'cdk-tabs',\n },\n})\nexport class CdkTabs {\n /** The CdkTabList nested inside of the container. */\n private readonly _cdkTabList = contentChild(CdkTabList);\n\n /** The CdkTabPanels nested inside of the container. */\n private readonly _cdkTabPanels = contentChildren(CdkTabPanel);\n\n /** The Tab UIPattern of the child Tabs. */\n tabs = computed(() => this._cdkTabList()?.tabs());\n\n /** The TabPanel UIPattern of the child TabPanels. */\n tabpanels = computed(() => this._cdkTabPanels().map(tabpanel => tabpanel.pattern));\n}\n\n/**\n * A TabList container.\n *\n * Controls a list of CdkTab(s).\n */\n@Directive({\n selector: '[cdkTabList]',\n exportAs: 'cdkTabList',\n host: {\n 'role': 'tablist',\n 'class': 'cdk-tablist',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.aria-orientation]': 'pattern.orientation()',\n '[attr.aria-activedescendant]': 'pattern.activedescendant()',\n '(keydown)': 'pattern.onKeydown($event)',\n '(pointerdown)': 'pattern.onPointerdown($event)',\n },\n})\nexport class CdkTabList {\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n private readonly _directionality = inject(Directionality);\n\n /** The CdkTabs nested inside of the CdkTabList. */\n private readonly _cdkTabs = contentChildren(CdkTab);\n\n /** The internal tab selection state. */\n private readonly _selection = linkedSignal(() => (this.tab() ? [this.tab()!] : []));\n\n /** A signal wrapper for directionality. */\n protected textDirection = toSignal(this._directionality.change, {\n initialValue: this._directionality.value,\n });\n\n /** The Tab UIPatterns of the child Tabs. */\n tabs = computed(() => this._cdkTabs().map(tab => tab.pattern));\n\n /** Whether the tablist is vertically or horizontally oriented. */\n orientation = input<'vertical' | 'horizontal'>('horizontal');\n\n /** Whether focus should wrap when navigating. */\n wrap = input(true, {transform: booleanAttribute});\n\n /** Whether disabled items in the list should be skipped when navigating. */\n skipDisabled = input(true, {transform: booleanAttribute});\n\n /** The focus strategy used by the tablist. */\n focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** The selection strategy used by the tablist. */\n selectionMode = input<'follow' | 'explicit'>('follow');\n\n /** Whether the tablist is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** The current index that has been navigated to. */\n activeIndex = model<number>(0);\n\n // TODO(ok7sai): Provides a default state when there is no pre-select tab.\n /** The current selected tab. */\n tab = model<string | undefined>();\n\n /** The TabList UIPattern. */\n pattern: TabListPattern = new TabListPattern({\n ...this,\n items: this.tabs,\n textDirection: this.textDirection,\n value: this._selection,\n });\n\n constructor() {\n effect(() => this.tab.set(this._selection()[0]));\n }\n}\n\n/** A selectable tab in a TabList. */\n@Directive({\n selector: '[cdkTab]',\n exportAs: 'cdkTab',\n host: {\n 'role': 'tab',\n 'class': 'cdk-tab',\n '[class.cdk-active]': 'pattern.active()',\n '[attr.id]': 'pattern.id()',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-selected]': 'pattern.selected()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.aria-controls]': 'pattern.controls()',\n },\n})\nexport class CdkTab {\n /** A reference to the tab element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The parent CdkTabs. */\n private readonly _cdkTabs = inject(CdkTabs);\n\n /** The parent CdkTabList. */\n private readonly _cdkTabList = inject(CdkTabList);\n\n /** A global unique identifier for the tab. */\n private readonly _id = inject(_IdGenerator).getId('cdk-tab-');\n\n /** The parent TabList UIPattern. */\n protected tablist = computed(() => this._cdkTabList.pattern);\n\n /** The TabPanel UIPattern associated with the tab */\n protected tabpanel = computed(() =>\n this._cdkTabs.tabpanels().find(tabpanel => tabpanel.value() === this.value()),\n );\n\n /** Whether a tab is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** A local unique identifier for the tab. */\n value = input.required<string>();\n\n /** The Tab UIPattern. */\n pattern: TabPattern = new TabPattern({\n ...this,\n id: () => this._id,\n element: () => this._elementRef.nativeElement,\n tablist: this.tablist,\n tabpanel: this.tabpanel,\n value: this.value,\n });\n}\n\n/**\n * A TabPanel container for the resources of layered content associated with a tab.\n *\n * If a tabpanel is hidden due to its corresponding tab is not activated, the `inert` attribute\n * will be applied to the tabpanel element to remove it from the accessibility tree and stop\n * all the keyboard and pointer interactions. Note that this does not visually hide the tabpenl\n * and a proper styling is required.\n */\n@Directive({\n selector: '[cdkTabPanel]',\n exportAs: 'cdkTabPanel',\n host: {\n 'role': 'tabpanel',\n 'tabindex': '0',\n 'class': 'cdk-tabpanel',\n '[attr.id]': 'pattern.id()',\n '[attr.inert]': 'pattern.hidden() ? true : null',\n },\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n})\nexport class CdkTabPanel {\n /** The DeferredContentAware host directive. */\n private readonly _deferredContentAware = inject(DeferredContentAware);\n\n /** The parent CdkTabs. */\n private readonly _cdkTabs = inject(CdkTabs);\n\n /** A global unique identifier for the tab. */\n private readonly _id = inject(_IdGenerator).getId('cdk-tabpanel-');\n\n /** The Tab UIPattern associated with the tabpanel */\n protected tab = computed(() => this._cdkTabs.tabs()?.find(tab => tab.value() === this.value()));\n\n /** A local unique identifier for the tabpanel. */\n value = input.required<string>();\n\n /** The TabPanel UIPattern. */\n pattern: TabPanelPattern = new TabPanelPattern({\n ...this,\n id: () => this._id,\n tab: this.tab,\n });\n\n constructor() {\n effect(() => this._deferredContentAware.contentVisible.set(!this.pattern.hidden()));\n }\n}\n\n/**\n * A TabContent container for the lazy-loaded content.\n */\n@Directive({\n selector: 'ng-template[cdkTabContent]',\n exportAs: 'cdTabContent',\n hostDirectives: [DeferredContent],\n})\nexport class CdkTabContent {}\n"],"names":[],"mappings":";;;;;;;;;;AA2BA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;MAQU,OAAO,CAAA;;AAED,IAAA,WAAW,GAAG,YAAY,CAAC,UAAU,CAAC;;AAGtC,IAAA,aAAa,GAAG,eAAe,CAAC,WAAW,CAAC;;AAG7D,IAAA,IAAI,GAAG,QAAQ,CAAC,MAAM,IAAI,CA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A,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,4BAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,eAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,4BAA4B;AACtC,oBAAA,QAAQ,EAAE,cAAc;oBACxB,cAAc,EAAE,CAAC,eAAe,CAAC;AAClC,iBAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"tabs.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/tabs/tabs.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {DeferredContent, DeferredContentAware} from '@angular/cdk-experimental/deferred-content';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n booleanAttribute,\n computed,\n contentChild,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n linkedSignal,\n} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {TabListPattern, TabPanelPattern, TabPattern} from '../ui-patterns';\n\n/**\n * A Tabs container.\n *\n * Represents a set of layered sections of content. The CdkTabs is a container meant to be used with\n * CdkTabList, CdkTab, and CdkTabPanel as follows:\n *\n * ```html\n * <div cdkTabs>\n * <ul cdkTabList>\n * <li cdkTab value=\"tab1\">Tab 1</li>\n * <li cdkTab value=\"tab2\">Tab 2</li>\n * <li cdkTab value=\"tab3\">Tab 3</li>\n * </ul>\n *\n * <div cdkTabPanel value=\"tab1\">\n * <ng-template cdkTabContent>Tab content 1</ng-template>\n * </div>\n * <div cdkTabPanel value=\"tab2\">\n * <ng-template cdkTabContent>Tab content 2</ng-template>\n * </div>\n * <div cdkTabPanel value=\"tab3\">\n * <ng-template cdkTabContent>Tab content 3</ng-template>\n * </div>\n * ```\n */\n@Directive({\n selector: '[cdkTabs]',\n exportAs: 'cdkTabs',\n host: {\n 'class': 'cdk-tabs',\n },\n})\nexport class CdkTabs {\n /** The CdkTabList nested inside of the container. */\n private readonly _cdkTabList = contentChild(CdkTabList);\n\n /** The CdkTabPanels nested inside of the container. */\n private readonly _cdkTabPanels = contentChildren(CdkTabPanel);\n\n /** The Tab UIPattern of the child Tabs. */\n tabs = computed(() => this._cdkTabList()?.tabs());\n\n /** The TabPanel UIPattern of the child TabPanels. */\n tabpanels = computed(() => this._cdkTabPanels().map(tabpanel => tabpanel.pattern));\n}\n\n/**\n * A TabList container.\n *\n * Controls a list of CdkTab(s).\n */\n@Directive({\n selector: '[cdkTabList]',\n exportAs: 'cdkTabList',\n host: {\n 'role': 'tablist',\n 'class': 'cdk-tablist',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.aria-orientation]': 'pattern.orientation()',\n '[attr.aria-activedescendant]': 'pattern.activedescendant()',\n '(keydown)': 'pattern.onKeydown($event)',\n '(pointerdown)': 'pattern.onPointerdown($event)',\n },\n})\nexport class CdkTabList {\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n private readonly _directionality = inject(Directionality);\n\n /** The CdkTabs nested inside of the CdkTabList. */\n private readonly _cdkTabs = contentChildren(CdkTab);\n\n /** The internal tab selection state. */\n private readonly _selection = linkedSignal(() => (this.tab() ? [this.tab()!] : []));\n\n /** A signal wrapper for directionality. */\n protected textDirection = toSignal(this._directionality.change, {\n initialValue: this._directionality.value,\n });\n\n /** The Tab UIPatterns of the child Tabs. */\n tabs = computed(() => this._cdkTabs().map(tab => tab.pattern));\n\n /** Whether the tablist is vertically or horizontally oriented. */\n orientation = input<'vertical' | 'horizontal'>('horizontal');\n\n /** Whether focus should wrap when navigating. */\n wrap = input(true, {transform: booleanAttribute});\n\n /** Whether disabled items in the list should be skipped when navigating. */\n skipDisabled = input(true, {transform: booleanAttribute});\n\n /** The focus strategy used by the tablist. */\n focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** The selection strategy used by the tablist. */\n selectionMode = input<'follow' | 'explicit'>('follow');\n\n /** Whether the tablist is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** The current index that has been navigated to. */\n activeIndex = model<number>(0);\n\n // TODO(ok7sai): Provides a default state when there is no pre-select tab.\n /** The current selected tab. */\n tab = model<string | undefined>();\n\n /** The TabList UIPattern. */\n pattern: TabListPattern = new TabListPattern({\n ...this,\n items: this.tabs,\n textDirection: this.textDirection,\n value: this._selection,\n });\n\n constructor() {\n effect(() => this.tab.set(this._selection()[0]));\n }\n}\n\n/** A selectable tab in a TabList. */\n@Directive({\n selector: '[cdkTab]',\n exportAs: 'cdkTab',\n host: {\n 'role': 'tab',\n 'class': 'cdk-tab',\n '[class.cdk-active]': 'pattern.active()',\n '[attr.id]': 'pattern.id()',\n '[attr.tabindex]': 'pattern.tabindex()',\n '[attr.aria-selected]': 'pattern.selected()',\n '[attr.aria-disabled]': 'pattern.disabled()',\n '[attr.aria-controls]': 'pattern.controls()',\n },\n})\nexport class CdkTab {\n /** A reference to the tab element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The parent CdkTabs. */\n private readonly _cdkTabs = inject(CdkTabs);\n\n /** The parent CdkTabList. */\n private readonly _cdkTabList = inject(CdkTabList);\n\n /** A global unique identifier for the tab. */\n private readonly _id = inject(_IdGenerator).getId('cdk-tab-');\n\n /** The parent TabList UIPattern. */\n protected tablist = computed(() => this._cdkTabList.pattern);\n\n /** The TabPanel UIPattern associated with the tab */\n protected tabpanel = computed(() =>\n this._cdkTabs.tabpanels().find(tabpanel => tabpanel.value() === this.value()),\n );\n\n /** Whether a tab is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** A local unique identifier for the tab. */\n value = input.required<string>();\n\n /** The Tab UIPattern. */\n pattern: TabPattern = new TabPattern({\n ...this,\n id: () => this._id,\n element: () => this._elementRef.nativeElement,\n tablist: this.tablist,\n tabpanel: this.tabpanel,\n value: this.value,\n });\n}\n\n/**\n * A TabPanel container for the resources of layered content associated with a tab.\n *\n * If a tabpanel is hidden due to its corresponding tab is not activated, the `inert` attribute\n * will be applied to the tabpanel element to remove it from the accessibility tree and stop\n * all the keyboard and pointer interactions. Note that this does not visually hide the tabpenl\n * and a proper styling is required.\n */\n@Directive({\n selector: '[cdkTabPanel]',\n exportAs: 'cdkTabPanel',\n host: {\n 'role': 'tabpanel',\n 'tabindex': '0',\n 'class': 'cdk-tabpanel',\n '[attr.id]': 'pattern.id()',\n '[attr.inert]': 'pattern.hidden() ? true : null',\n },\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n})\nexport class CdkTabPanel {\n /** The DeferredContentAware host directive. */\n private readonly _deferredContentAware = inject(DeferredContentAware);\n\n /** The parent CdkTabs. */\n private readonly _cdkTabs = inject(CdkTabs);\n\n /** A global unique identifier for the tab. */\n private readonly _id = inject(_IdGenerator).getId('cdk-tabpanel-');\n\n /** The Tab UIPattern associated with the tabpanel */\n protected tab = computed(() => this._cdkTabs.tabs()?.find(tab => tab.value() === this.value()));\n\n /** A local unique identifier for the tabpanel. */\n value = input.required<string>();\n\n /** The TabPanel UIPattern. */\n pattern: TabPanelPattern = new TabPanelPattern({\n ...this,\n id: () => this._id,\n tab: this.tab,\n });\n\n constructor() {\n effect(() => this._deferredContentAware.contentVisible.set(!this.pattern.hidden()));\n }\n}\n\n/**\n * A TabContent container for the lazy-loaded content.\n */\n@Directive({\n selector: 'ng-template[cdkTabContent]',\n exportAs: 'cdTabContent',\n hostDirectives: [DeferredContent],\n})\nexport class Cd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AAC3B,wBAAA,cAAc,EAAE,gCAAgC;AACjD,qBAAA;AACD,oBAAA,cAAc,EAAE;AACd,wBAAA;AACE,4BAAA,SAAS,EAAE,oBAAoB;4BAC/B,MAAM,EAAE,CAAC,iBAAiB,CAAC;AAC5B,yBAAA;AACF,qBAAA;AACF,iBAAA;;AA6BD;;AAEG;MAMU,aAAa,CAAA;uGAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,4BAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,eAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,4BAA4B;AACtC,oBAAA,QAAQ,EAAE,cAAc;oBACxB,cAAc,EAAE,CAAC,eAAe,CAAC;AAClC,iBAAA;;;;;"}
|
package/fesm2022/ui-patterns.mjs
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export { L as ListboxPattern, O as OptionPattern } from './option-
|
|
2
|
-
export {
|
|
3
|
-
|
|
1
|
+
export { L as ListboxPattern, O as OptionPattern } from './option-r2ojgVMH.mjs';
|
|
2
|
+
export { a as RadioButtonPattern, R as RadioGroupPattern } from './radio-s5uO_tmJ.mjs';
|
|
3
|
+
export { T as TabListPattern, b as TabPanelPattern, a as TabPattern } from './tabs-BN3wsMdD.mjs';
|
|
4
|
+
export { b as AccordionGroupPattern, A as AccordionPanelPattern, a as AccordionTriggerPattern } from './accordion-CyyDY39y.mjs';
|
|
5
|
+
import './list-focus-BXQdAA3i.mjs';
|
|
4
6
|
import '@angular/core';
|
|
7
|
+
import './list-selection-BLV4Yy7T.mjs';
|
|
8
|
+
import './expansion-DykBzWrb.mjs';
|
|
5
9
|
|
|
6
10
|
/** Converts a getter setter style signal to a WritableSignalLike. */
|
|
7
11
|
function convertGetterSetterToWritableSignalLike(getter, setter) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-patterns.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/signal-like/signal-like.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport type SignalLike<T> = () => T;\n\nexport interface WritableSignalLike<T> extends SignalLike<T> {\n set(value: T): void;\n update(updateFn: (value: T) => T): void;\n}\n\n/** Converts a getter setter style signal to a WritableSignalLike. */\nexport function convertGetterSetterToWritableSignalLike<T>(\n getter: () => T,\n setter: (v: T) => void,\n): WritableSignalLike<T> {\n // tslint:disable-next-line:ban Have to use `Object.assign` to preserve the getter function.\n return Object.assign(getter, {\n set: setter,\n update: (updateCallback: (v: T) => T) => setter(updateCallback(getter())),\n });\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ui-patterns.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk-experimental/ui-patterns/behaviors/signal-like/signal-like.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport type SignalLike<T> = () => T;\n\nexport interface WritableSignalLike<T> extends SignalLike<T> {\n set(value: T): void;\n update(updateFn: (value: T) => T): void;\n}\n\n/** Converts a getter setter style signal to a WritableSignalLike. */\nexport function convertGetterSetterToWritableSignalLike<T>(\n getter: () => T,\n setter: (v: T) => void,\n): WritableSignalLike<T> {\n // tslint:disable-next-line:ban Have to use `Object.assign` to preserve the getter function.\n return Object.assign(getter, {\n set: setter,\n update: (updateCallback: (v: T) => T) => setter(updateCallback(getter())),\n });\n}\n"],"names":[],"mappings":";;;;;;;;;AAeA;AACgB,SAAA,uCAAuC,CACrD,MAAe,EACf,MAAsB,EAAA;;AAGtB,IAAA,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;AAC3B,QAAA,GAAG,EAAE,MAAM;AACX,QAAA,MAAM,EAAE,CAAC,cAA2B,KAAK,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC;AAC1E,KAAA,CAAC;AACJ;;;;"}
|
|
@@ -147,68 +147,6 @@ declare class ListFocus<T extends ListFocusItem> {
|
|
|
147
147
|
isFocusable(item: T): boolean;
|
|
148
148
|
}
|
|
149
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
150
|
/** Represents an item in a collection, such as a listbox option, than can be navigated to. */
|
|
213
151
|
interface ListNavigationItem extends ListFocusItem {
|
|
214
152
|
}
|
|
@@ -243,5 +181,5 @@ declare class ListNavigation<T extends ListNavigationItem> {
|
|
|
243
181
|
private _advance;
|
|
244
182
|
}
|
|
245
183
|
|
|
246
|
-
export { KeyboardEventManager as K, PointerEventManager as P,
|
|
247
|
-
export type {
|
|
184
|
+
export { KeyboardEventManager as K, PointerEventManager as P, ListNavigation as b, convertGetterSetterToWritableSignalLike as c, ListFocus as d };
|
|
185
|
+
export type { ListNavigationInputs as L, SignalLike as S, WritableSignalLike as W, ListFocusInputs as a, ListNavigationItem as e, ListFocusItem as f };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { f as ListFocusItem, S as SignalLike, a as ListFocusInputs, W as WritableSignalLike, d as ListFocus } from './list-navigation.d-Br99p_2O.js';
|
|
3
|
+
|
|
4
|
+
/** Represents an item in a collection, such as a listbox option, than can be selected. */
|
|
5
|
+
interface ListSelectionItem<V> extends ListFocusItem {
|
|
6
|
+
/** The value of the item. */
|
|
7
|
+
value: SignalLike<V>;
|
|
8
|
+
}
|
|
9
|
+
/** Represents the required inputs for a collection that contains selectable items. */
|
|
10
|
+
interface ListSelectionInputs<T extends ListSelectionItem<V>, V> extends ListFocusInputs<T> {
|
|
11
|
+
/** Whether multiple items in the list can be selected at once. */
|
|
12
|
+
multi: SignalLike<boolean>;
|
|
13
|
+
/** The current value of the list selection. */
|
|
14
|
+
value: WritableSignalLike<V[]>;
|
|
15
|
+
/** The selection strategy used by the list. */
|
|
16
|
+
selectionMode: SignalLike<'follow' | 'explicit'>;
|
|
17
|
+
}
|
|
18
|
+
/** Controls selection for a list of items. */
|
|
19
|
+
declare class ListSelection<T extends ListSelectionItem<V>, V> {
|
|
20
|
+
readonly inputs: ListSelectionInputs<T, V> & {
|
|
21
|
+
focusManager: ListFocus<T>;
|
|
22
|
+
};
|
|
23
|
+
/** The start index to use for range selection. */
|
|
24
|
+
rangeStartIndex: i0.WritableSignal<number>;
|
|
25
|
+
/** The end index to use for range selection. */
|
|
26
|
+
rangeEndIndex: i0.WritableSignal<number>;
|
|
27
|
+
/** The currently selected items. */
|
|
28
|
+
selectedItems: i0.Signal<T[]>;
|
|
29
|
+
constructor(inputs: ListSelectionInputs<T, V> & {
|
|
30
|
+
focusManager: ListFocus<T>;
|
|
31
|
+
});
|
|
32
|
+
/** Selects the item at the current active index. */
|
|
33
|
+
select(item?: ListSelectionItem<V>, opts?: {
|
|
34
|
+
anchor: boolean;
|
|
35
|
+
}): void;
|
|
36
|
+
/** Deselects the item at the current active index. */
|
|
37
|
+
deselect(item?: T): void;
|
|
38
|
+
/** Toggles the item at the current active index. */
|
|
39
|
+
toggle(): void;
|
|
40
|
+
/** Toggles only the item at the current active index. */
|
|
41
|
+
toggleOne(): void;
|
|
42
|
+
/** Selects all items in the list. */
|
|
43
|
+
selectAll(): void;
|
|
44
|
+
/** Deselects all items in the list. */
|
|
45
|
+
deselectAll(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Selects all items in the list or deselects all
|
|
48
|
+
* items in the list if all items are already selected.
|
|
49
|
+
*/
|
|
50
|
+
toggleAll(): void;
|
|
51
|
+
/** Sets the selection to only the current active item. */
|
|
52
|
+
selectOne(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Selects all items in the list up to the anchor item.
|
|
55
|
+
*
|
|
56
|
+
* Deselects all items that were previously within the
|
|
57
|
+
* selected range that are now outside of the selected range
|
|
58
|
+
*/
|
|
59
|
+
selectRange(opts?: {
|
|
60
|
+
anchor: boolean;
|
|
61
|
+
}): void;
|
|
62
|
+
/** Marks the given index as the start of a range selection. */
|
|
63
|
+
beginRangeSelection(index?: number): void;
|
|
64
|
+
/** Returns the items in the list starting from the given index. */
|
|
65
|
+
private _getItemsFromIndex;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { ListSelection as b };
|
|
69
|
+
export type { ListSelectionItem as L, ListSelectionInputs as a };
|
package/listbox/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { AfterViewInit } from '@angular/core';
|
|
3
2
|
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
4
|
-
import { b as OptionPattern, a as ListboxPattern } from '../listbox.d-
|
|
5
|
-
import '../list-navigation.d-
|
|
3
|
+
import { b as OptionPattern, a as ListboxPattern } from '../listbox.d-C8oz9si7.js';
|
|
4
|
+
import '../list-navigation.d-Br99p_2O.js';
|
|
5
|
+
import '../list-selection.d-BQWRFJI-.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* A listbox container.
|
|
@@ -18,7 +18,7 @@ import '../list-navigation.d-DfOSxsSp.js';
|
|
|
18
18
|
* </ul>
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
declare class CdkListbox<V>
|
|
21
|
+
declare class CdkListbox<V> {
|
|
22
22
|
/** The directionality (LTR / RTL) context for the application (or a subtree of it). */
|
|
23
23
|
private readonly _directionality;
|
|
24
24
|
/** The CdkOptions nested inside of the CdkListbox. */
|
|
@@ -47,19 +47,14 @@ declare class CdkListbox<V> implements AfterViewInit {
|
|
|
47
47
|
readonly: i0.InputSignalWithTransform<boolean, unknown>;
|
|
48
48
|
/** The values of the current selected items. */
|
|
49
49
|
value: i0.ModelSignal<V[]>;
|
|
50
|
-
/** The current index that has been navigated to. */
|
|
51
|
-
activeIndex: i0.ModelSignal<number>;
|
|
52
50
|
/** The Listbox UIPattern. */
|
|
53
51
|
pattern: ListboxPattern<V>;
|
|
54
52
|
/** Whether the listbox has received focus yet. */
|
|
55
53
|
private _hasFocused;
|
|
56
|
-
/** Whether the options in the listbox have been initialized. */
|
|
57
|
-
private _isViewInitialized;
|
|
58
54
|
constructor();
|
|
59
|
-
ngAfterViewInit(): void;
|
|
60
55
|
onFocus(): void;
|
|
61
56
|
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; };
|
|
57
|
+
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; }; }, { "value": "valueChange"; }, ["_cdkOptions"], never, true, never>;
|
|
63
58
|
}
|
|
64
59
|
/** A selectable option in a CdkListbox. */
|
|
65
60
|
declare class CdkOption<V> {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { f as ListFocusItem, S as SignalLike, a as ListFocusInputs, d as ListFocus, e as ListNavigationItem, b as ListNavigation, L as ListNavigationInputs, K as KeyboardEventManager, P as PointerEventManager } from './list-navigation.d-Br99p_2O.js';
|
|
3
|
+
import { L as ListSelectionItem, b as ListSelection, a as ListSelectionInputs } from './list-selection.d-BQWRFJI-.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Represents an item in a collection, such as a listbox option, than can be navigated to by
|
|
@@ -148,6 +149,8 @@ declare class ListboxPattern<V> {
|
|
|
148
149
|
/** The pointerdown event manager for the listbox. */
|
|
149
150
|
pointerdown: i0.Signal<PointerEventManager<PointerEvent>>;
|
|
150
151
|
constructor(inputs: ListboxInputs<V>);
|
|
152
|
+
/** Returns a set of violations */
|
|
153
|
+
validate(): string[];
|
|
151
154
|
/** Handles keydown events for the listbox. */
|
|
152
155
|
onKeydown(event: KeyboardEvent): void;
|
|
153
156
|
onPointerdown(event: PointerEvent): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cdk-experimental",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.1.0-next.0",
|
|
4
4
|
"description": "Experimental components for Angular CDK",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/angular/components#readme",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@angular/cdk": "20.0.
|
|
16
|
-
"@angular/core": "^20.0.0 || ^21.0.0"
|
|
15
|
+
"@angular/cdk": "20.1.0-next.0",
|
|
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": {
|
|
19
19
|
"@angular/cdk": "workspace:*"
|
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
"types": "./index.d.ts",
|
|
45
45
|
"default": "./fesm2022/cdk-experimental.mjs"
|
|
46
46
|
},
|
|
47
|
+
"./accordion": {
|
|
48
|
+
"types": "./accordion/index.d.ts",
|
|
49
|
+
"default": "./fesm2022/accordion.mjs"
|
|
50
|
+
},
|
|
47
51
|
"./column-resize": {
|
|
48
52
|
"types": "./column-resize/index.d.ts",
|
|
49
53
|
"default": "./fesm2022/column-resize.mjs"
|
|
@@ -64,6 +68,10 @@
|
|
|
64
68
|
"types": "./popover-edit/index.d.ts",
|
|
65
69
|
"default": "./fesm2022/popover-edit.mjs"
|
|
66
70
|
},
|
|
71
|
+
"./radio": {
|
|
72
|
+
"types": "./radio/index.d.ts",
|
|
73
|
+
"default": "./fesm2022/radio.mjs"
|
|
74
|
+
},
|
|
67
75
|
"./scrolling": {
|
|
68
76
|
"types": "./scrolling/index.d.ts",
|
|
69
77
|
"default": "./fesm2022/scrolling.mjs"
|