@angular/aria 21.0.0-next.9 → 21.0.0-rc.1

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 (49) hide show
  1. package/_adev_assets/aria-accordion.json +373 -0
  2. package/_adev_assets/aria-combobox.json +383 -0
  3. package/_adev_assets/aria-grid.json +647 -0
  4. package/_adev_assets/aria-listbox.json +511 -0
  5. package/_adev_assets/aria-menu.json +852 -0
  6. package/_adev_assets/aria-tabs.json +987 -0
  7. package/_adev_assets/aria-toolbar.json +696 -0
  8. package/_adev_assets/aria-tree.json +1071 -0
  9. package/fesm2022/_widget-chunk.mjs +949 -0
  10. package/fesm2022/_widget-chunk.mjs.map +1 -0
  11. package/fesm2022/accordion.mjs +372 -174
  12. package/fesm2022/accordion.mjs.map +1 -1
  13. package/fesm2022/aria.mjs +1 -2
  14. package/fesm2022/aria.mjs.map +1 -1
  15. package/fesm2022/combobox.mjs +308 -116
  16. package/fesm2022/combobox.mjs.map +1 -1
  17. package/fesm2022/grid.mjs +566 -0
  18. package/fesm2022/grid.mjs.map +1 -0
  19. package/fesm2022/listbox.mjs +384 -184
  20. package/fesm2022/listbox.mjs.map +1 -1
  21. package/fesm2022/menu.mjs +591 -0
  22. package/fesm2022/menu.mjs.map +1 -0
  23. package/fesm2022/private.mjs +2338 -0
  24. package/fesm2022/private.mjs.map +1 -0
  25. package/fesm2022/tabs.mjs +484 -276
  26. package/fesm2022/tabs.mjs.map +1 -1
  27. package/fesm2022/toolbar.mjs +366 -200
  28. package/fesm2022/toolbar.mjs.map +1 -1
  29. package/fesm2022/tree.mjs +515 -267
  30. package/fesm2022/tree.mjs.map +1 -1
  31. package/package.json +12 -12
  32. package/types/_grid-chunk.d.ts +608 -0
  33. package/types/accordion.d.ts +8 -8
  34. package/types/combobox.d.ts +20 -7
  35. package/types/grid.d.ts +120 -0
  36. package/types/listbox.d.ts +9 -7
  37. package/types/menu.d.ts +170 -0
  38. package/types/{ui-patterns.d.ts → private.d.ts} +555 -433
  39. package/types/tabs.d.ts +8 -8
  40. package/types/toolbar.d.ts +31 -28
  41. package/types/tree.d.ts +11 -9
  42. package/fesm2022/deferred-content.mjs +0 -60
  43. package/fesm2022/deferred-content.mjs.map +0 -1
  44. package/fesm2022/radio-group.mjs +0 -197
  45. package/fesm2022/radio-group.mjs.map +0 -1
  46. package/fesm2022/ui-patterns.mjs +0 -2504
  47. package/fesm2022/ui-patterns.mjs.map +0 -1
  48. package/types/deferred-content.d.ts +0 -38
  49. package/types/radio-group.d.ts +0 -82
package/fesm2022/tabs.mjs CHANGED
@@ -1,299 +1,507 @@
1
- import * as i1 from '@angular/aria/deferred-content';
2
- import { DeferredContentAware, DeferredContent } from '@angular/aria/deferred-content';
3
1
  import { _IdGenerator } from '@angular/cdk/a11y';
4
2
  import { Directionality } from '@angular/cdk/bidi';
5
3
  import * as i0 from '@angular/core';
6
4
  import { signal, computed, Directive, inject, ElementRef, linkedSignal, input, booleanAttribute, model, afterRenderEffect } from '@angular/core';
7
- import { TabListPattern, TabPattern, TabPanelPattern } from '@angular/aria/ui-patterns';
5
+ import * as i1 from '@angular/aria/private';
6
+ import { TabListPattern, TabPattern, DeferredContentAware, TabPanelPattern, DeferredContent } from '@angular/aria/private';
8
7
 
9
- /**
10
- * Sort directives by their document order.
11
- */
12
8
  function sortDirectives(a, b) {
13
- return (a.element().compareDocumentPosition(b.element()) & Node.DOCUMENT_POSITION_PRECEDING) > 0
14
- ? 1
15
- : -1;
9
+ return (a.element().compareDocumentPosition(b.element()) & Node.DOCUMENT_POSITION_PRECEDING) > 0 ? 1 : -1;
16
10
  }
17
- /**
18
- * A Tabs container.
19
- *
20
- * Represents a set of layered sections of content. The Tabs is a container meant to be used with
21
- * TabList, Tab, and TabPanel as follows:
22
- *
23
- * ```html
24
- * <div ngTabs>
25
- * <ul ngTabList>
26
- * <li ngTab value="tab1">Tab 1</li>
27
- * <li ngTab value="tab2">Tab 2</li>
28
- * <li ngTab value="tab3">Tab 3</li>
29
- * </ul>
30
- *
31
- * <div ngTabPanel value="tab1">
32
- * <ng-template ngTabContent>Tab content 1</ng-template>
33
- * </div>
34
- * <div ngTabPanel value="tab2">
35
- * <ng-template ngTabContent>Tab content 2</ng-template>
36
- * </div>
37
- * <div ngTabPanel value="tab3">
38
- * <ng-template ngTabContent>Tab content 3</ng-template>
39
- * </div>
40
- * ```
41
- */
42
11
  class Tabs {
43
- /** The TabList nested inside of the container. */
44
- _tablist = signal(undefined, ...(ngDevMode ? [{ debugName: "_tablist" }] : []));
45
- /** The TabPanels nested inside of the container. */
46
- _unorderedPanels = signal(new Set(), ...(ngDevMode ? [{ debugName: "_unorderedPanels" }] : []));
47
- /** The Tab UIPattern of the child Tabs. */
48
- tabs = computed(() => this._tablist()?.tabs(), ...(ngDevMode ? [{ debugName: "tabs" }] : []));
49
- /** The TabPanel UIPattern of the child TabPanels. */
50
- unorderedTabpanels = computed(() => [...this._unorderedPanels()].map(tabpanel => tabpanel.pattern), ...(ngDevMode ? [{ debugName: "unorderedTabpanels" }] : []));
51
- register(child) {
52
- if (child instanceof TabList) {
53
- this._tablist.set(child);
54
- }
55
- if (child instanceof TabPanel) {
56
- this._unorderedPanels().add(child);
57
- this._unorderedPanels.set(new Set(this._unorderedPanels()));
58
- }
12
+ _tablist = signal(undefined, ...(ngDevMode ? [{
13
+ debugName: "_tablist"
14
+ }] : []));
15
+ _unorderedPanels = signal(new Set(), ...(ngDevMode ? [{
16
+ debugName: "_unorderedPanels"
17
+ }] : []));
18
+ tabs = computed(() => this._tablist()?.tabs(), ...(ngDevMode ? [{
19
+ debugName: "tabs"
20
+ }] : []));
21
+ unorderedTabpanels = computed(() => [...this._unorderedPanels()].map(tabpanel => tabpanel._pattern), ...(ngDevMode ? [{
22
+ debugName: "unorderedTabpanels"
23
+ }] : []));
24
+ register(child) {
25
+ if (child instanceof TabList) {
26
+ this._tablist.set(child);
59
27
  }
60
- deregister(child) {
61
- if (child instanceof TabList) {
62
- this._tablist.set(undefined);
63
- }
64
- if (child instanceof TabPanel) {
65
- this._unorderedPanels().delete(child);
66
- this._unorderedPanels.set(new Set(this._unorderedPanels()));
67
- }
28
+ if (child instanceof TabPanel) {
29
+ this._unorderedPanels().add(child);
30
+ this._unorderedPanels.set(new Set(this._unorderedPanels()));
68
31
  }
69
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: Tabs, deps: [], target: i0.ɵɵFactoryTarget.Directive });
70
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: Tabs, isStandalone: true, selector: "[ngTabs]", host: { classAttribute: "ng-tabs" }, exportAs: ["ngTabs"], ngImport: i0 });
32
+ }
33
+ deregister(child) {
34
+ if (child instanceof TabList) {
35
+ this._tablist.set(undefined);
36
+ }
37
+ if (child instanceof TabPanel) {
38
+ this._unorderedPanels().delete(child);
39
+ this._unorderedPanels.set(new Set(this._unorderedPanels()));
40
+ }
41
+ }
42
+ static ɵfac = i0.ɵɵngDeclareFactory({
43
+ minVersion: "12.0.0",
44
+ version: "20.2.0-next.2",
45
+ ngImport: i0,
46
+ type: Tabs,
47
+ deps: [],
48
+ target: i0.ɵɵFactoryTarget.Directive
49
+ });
50
+ static ɵdir = i0.ɵɵngDeclareDirective({
51
+ minVersion: "14.0.0",
52
+ version: "20.2.0-next.2",
53
+ type: Tabs,
54
+ isStandalone: true,
55
+ selector: "[ngTabs]",
56
+ host: {
57
+ classAttribute: "ng-tabs"
58
+ },
59
+ exportAs: ["ngTabs"],
60
+ ngImport: i0
61
+ });
71
62
  }
72
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: Tabs, decorators: [{
73
- type: Directive,
74
- args: [{
75
- selector: '[ngTabs]',
76
- exportAs: 'ngTabs',
77
- host: {
78
- 'class': 'ng-tabs',
79
- },
80
- }]
81
- }] });
82
- /**
83
- * A TabList container.
84
- *
85
- * Controls a list of Tab(s).
86
- */
63
+ i0.ɵɵngDeclareClassMetadata({
64
+ minVersion: "12.0.0",
65
+ version: "20.2.0-next.2",
66
+ ngImport: i0,
67
+ type: Tabs,
68
+ decorators: [{
69
+ type: Directive,
70
+ args: [{
71
+ selector: '[ngTabs]',
72
+ exportAs: 'ngTabs',
73
+ host: {
74
+ 'class': 'ng-tabs'
75
+ }
76
+ }]
77
+ }]
78
+ });
87
79
  class TabList {
88
- /** A reference to the tab list element. */
89
- _elementRef = inject(ElementRef);
90
- /** The parent Tabs. */
91
- _tabs = inject(Tabs);
92
- /** The Tabs nested inside of the TabList. */
93
- _unorderedTabs = signal(new Set(), ...(ngDevMode ? [{ debugName: "_unorderedTabs" }] : []));
94
- /** The internal tab selection state. */
95
- _selection = linkedSignal(() => this.selectedTab() ? [this.selectedTab()] : []);
96
- /** Text direction. */
97
- textDirection = inject(Directionality).valueSignal;
98
- /** The Tab UIPatterns of the child Tabs. */
99
- tabs = computed(() => [...this._unorderedTabs()].sort(sortDirectives).map(tab => tab.pattern), ...(ngDevMode ? [{ debugName: "tabs" }] : []));
100
- /** Whether the tablist is vertically or horizontally oriented. */
101
- orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
102
- /** Whether focus should wrap when navigating. */
103
- wrap = input(true, ...(ngDevMode ? [{ debugName: "wrap", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
104
- /** Whether disabled items in the list should be skipped when navigating. */
105
- skipDisabled = input(true, ...(ngDevMode ? [{ debugName: "skipDisabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
106
- /** The focus strategy used by the tablist. */
107
- focusMode = input('roving', ...(ngDevMode ? [{ debugName: "focusMode" }] : []));
108
- /** The selection strategy used by the tablist. */
109
- selectionMode = input('follow', ...(ngDevMode ? [{ debugName: "selectionMode" }] : []));
110
- /** Whether the tablist is disabled. */
111
- disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
112
- /** The current selected tab. */
113
- selectedTab = model(...(ngDevMode ? [undefined, { debugName: "selectedTab" }] : []));
114
- /** The TabList UIPattern. */
115
- pattern = new TabListPattern({
116
- ...this,
117
- items: this.tabs,
118
- value: this._selection,
119
- activeItem: signal(undefined),
120
- element: () => this._elementRef.nativeElement,
80
+ _elementRef = inject(ElementRef);
81
+ _tabs = inject(Tabs);
82
+ _unorderedTabs = signal(new Set(), ...(ngDevMode ? [{
83
+ debugName: "_unorderedTabs"
84
+ }] : []));
85
+ _selection = linkedSignal(() => this.selectedTab() ? [this.selectedTab()] : []);
86
+ textDirection = inject(Directionality).valueSignal;
87
+ tabs = computed(() => [...this._unorderedTabs()].sort(sortDirectives).map(tab => tab._pattern), ...(ngDevMode ? [{
88
+ debugName: "tabs"
89
+ }] : []));
90
+ orientation = input('horizontal', ...(ngDevMode ? [{
91
+ debugName: "orientation"
92
+ }] : []));
93
+ wrap = input(true, ...(ngDevMode ? [{
94
+ debugName: "wrap",
95
+ transform: booleanAttribute
96
+ }] : [{
97
+ transform: booleanAttribute
98
+ }]));
99
+ softDisabled = input(true, ...(ngDevMode ? [{
100
+ debugName: "softDisabled",
101
+ transform: booleanAttribute
102
+ }] : [{
103
+ transform: booleanAttribute
104
+ }]));
105
+ focusMode = input('roving', ...(ngDevMode ? [{
106
+ debugName: "focusMode"
107
+ }] : []));
108
+ selectionMode = input('follow', ...(ngDevMode ? [{
109
+ debugName: "selectionMode"
110
+ }] : []));
111
+ disabled = input(false, ...(ngDevMode ? [{
112
+ debugName: "disabled",
113
+ transform: booleanAttribute
114
+ }] : [{
115
+ transform: booleanAttribute
116
+ }]));
117
+ selectedTab = model(...(ngDevMode ? [undefined, {
118
+ debugName: "selectedTab"
119
+ }] : []));
120
+ _pattern = new TabListPattern({
121
+ ...this,
122
+ items: this.tabs,
123
+ value: this._selection,
124
+ activeItem: signal(undefined),
125
+ element: () => this._elementRef.nativeElement
126
+ });
127
+ _hasFocused = signal(false, ...(ngDevMode ? [{
128
+ debugName: "_hasFocused"
129
+ }] : []));
130
+ constructor() {
131
+ afterRenderEffect(() => this.selectedTab.set(this._selection()[0]));
132
+ afterRenderEffect(() => {
133
+ if (!this._hasFocused()) {
134
+ this._pattern.setDefaultState();
135
+ }
121
136
  });
122
- /** Whether the tree has received focus yet. */
123
- _hasFocused = signal(false, ...(ngDevMode ? [{ debugName: "_hasFocused" }] : []));
124
- constructor() {
125
- afterRenderEffect(() => this.selectedTab.set(this._selection()[0]));
126
- afterRenderEffect(() => {
127
- if (!this._hasFocused()) {
128
- this.pattern.setDefaultState();
129
- }
130
- });
131
- }
132
- onFocus() {
133
- this._hasFocused.set(true);
134
- }
135
- ngOnInit() {
136
- this._tabs.register(this);
137
- }
138
- ngOnDestroy() {
139
- this._tabs.deregister(this);
140
- }
141
- register(child) {
142
- this._unorderedTabs().add(child);
143
- this._unorderedTabs.set(new Set(this._unorderedTabs()));
144
- }
145
- deregister(child) {
146
- this._unorderedTabs().delete(child);
147
- this._unorderedTabs.set(new Set(this._unorderedTabs()));
148
- }
149
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: TabList, deps: [], target: i0.ɵɵFactoryTarget.Directive });
150
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.0-next.2", type: TabList, isStandalone: true, selector: "[ngTabList]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, wrap: { classPropertyName: "wrap", publicName: "wrap", isSignal: true, isRequired: false, transformFunction: null }, skipDisabled: { classPropertyName: "skipDisabled", publicName: "skipDisabled", isSignal: true, isRequired: false, transformFunction: null }, focusMode: { classPropertyName: "focusMode", publicName: "focusMode", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, selectedTab: { classPropertyName: "selectedTab", publicName: "selectedTab", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedTab: "selectedTabChange" }, host: { attributes: { "role": "tablist" }, listeners: { "keydown": "pattern.onKeydown($event)", "pointerdown": "pattern.onPointerdown($event)", "focusin": "onFocus()" }, properties: { "attr.tabindex": "pattern.tabindex()", "attr.aria-disabled": "pattern.disabled()", "attr.aria-orientation": "pattern.orientation()", "attr.aria-activedescendant": "pattern.activedescendant()" }, classAttribute: "ng-tablist" }, exportAs: ["ngTabList"], ngImport: i0 });
137
+ }
138
+ onFocus() {
139
+ this._hasFocused.set(true);
140
+ }
141
+ ngOnInit() {
142
+ this._tabs.register(this);
143
+ }
144
+ ngOnDestroy() {
145
+ this._tabs.deregister(this);
146
+ }
147
+ register(child) {
148
+ this._unorderedTabs().add(child);
149
+ this._unorderedTabs.set(new Set(this._unorderedTabs()));
150
+ }
151
+ deregister(child) {
152
+ this._unorderedTabs().delete(child);
153
+ this._unorderedTabs.set(new Set(this._unorderedTabs()));
154
+ }
155
+ static ɵfac = i0.ɵɵngDeclareFactory({
156
+ minVersion: "12.0.0",
157
+ version: "20.2.0-next.2",
158
+ ngImport: i0,
159
+ type: TabList,
160
+ deps: [],
161
+ target: i0.ɵɵFactoryTarget.Directive
162
+ });
163
+ static ɵdir = i0.ɵɵngDeclareDirective({
164
+ minVersion: "17.1.0",
165
+ version: "20.2.0-next.2",
166
+ type: TabList,
167
+ isStandalone: true,
168
+ selector: "[ngTabList]",
169
+ inputs: {
170
+ orientation: {
171
+ classPropertyName: "orientation",
172
+ publicName: "orientation",
173
+ isSignal: true,
174
+ isRequired: false,
175
+ transformFunction: null
176
+ },
177
+ wrap: {
178
+ classPropertyName: "wrap",
179
+ publicName: "wrap",
180
+ isSignal: true,
181
+ isRequired: false,
182
+ transformFunction: null
183
+ },
184
+ softDisabled: {
185
+ classPropertyName: "softDisabled",
186
+ publicName: "softDisabled",
187
+ isSignal: true,
188
+ isRequired: false,
189
+ transformFunction: null
190
+ },
191
+ focusMode: {
192
+ classPropertyName: "focusMode",
193
+ publicName: "focusMode",
194
+ isSignal: true,
195
+ isRequired: false,
196
+ transformFunction: null
197
+ },
198
+ selectionMode: {
199
+ classPropertyName: "selectionMode",
200
+ publicName: "selectionMode",
201
+ isSignal: true,
202
+ isRequired: false,
203
+ transformFunction: null
204
+ },
205
+ disabled: {
206
+ classPropertyName: "disabled",
207
+ publicName: "disabled",
208
+ isSignal: true,
209
+ isRequired: false,
210
+ transformFunction: null
211
+ },
212
+ selectedTab: {
213
+ classPropertyName: "selectedTab",
214
+ publicName: "selectedTab",
215
+ isSignal: true,
216
+ isRequired: false,
217
+ transformFunction: null
218
+ }
219
+ },
220
+ outputs: {
221
+ selectedTab: "selectedTabChange"
222
+ },
223
+ host: {
224
+ attributes: {
225
+ "role": "tablist"
226
+ },
227
+ listeners: {
228
+ "keydown": "_pattern.onKeydown($event)",
229
+ "pointerdown": "_pattern.onPointerdown($event)",
230
+ "focusin": "onFocus()"
231
+ },
232
+ properties: {
233
+ "attr.tabindex": "_pattern.tabIndex()",
234
+ "attr.aria-disabled": "_pattern.disabled()",
235
+ "attr.aria-orientation": "_pattern.orientation()",
236
+ "attr.aria-activedescendant": "_pattern.activeDescendant()"
237
+ },
238
+ classAttribute: "ng-tablist"
239
+ },
240
+ exportAs: ["ngTabList"],
241
+ ngImport: i0
242
+ });
151
243
  }
152
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: TabList, decorators: [{
153
- type: Directive,
154
- args: [{
155
- selector: '[ngTabList]',
156
- exportAs: 'ngTabList',
157
- host: {
158
- 'role': 'tablist',
159
- 'class': 'ng-tablist',
160
- '[attr.tabindex]': 'pattern.tabindex()',
161
- '[attr.aria-disabled]': 'pattern.disabled()',
162
- '[attr.aria-orientation]': 'pattern.orientation()',
163
- '[attr.aria-activedescendant]': 'pattern.activedescendant()',
164
- '(keydown)': 'pattern.onKeydown($event)',
165
- '(pointerdown)': 'pattern.onPointerdown($event)',
166
- '(focusin)': 'onFocus()',
167
- },
168
- }]
169
- }], ctorParameters: () => [] });
170
- /** A selectable tab in a TabList. */
244
+ i0.ɵɵngDeclareClassMetadata({
245
+ minVersion: "12.0.0",
246
+ version: "20.2.0-next.2",
247
+ ngImport: i0,
248
+ type: TabList,
249
+ decorators: [{
250
+ type: Directive,
251
+ args: [{
252
+ selector: '[ngTabList]',
253
+ exportAs: 'ngTabList',
254
+ host: {
255
+ 'role': 'tablist',
256
+ 'class': 'ng-tablist',
257
+ '[attr.tabindex]': '_pattern.tabIndex()',
258
+ '[attr.aria-disabled]': '_pattern.disabled()',
259
+ '[attr.aria-orientation]': '_pattern.orientation()',
260
+ '[attr.aria-activedescendant]': '_pattern.activeDescendant()',
261
+ '(keydown)': '_pattern.onKeydown($event)',
262
+ '(pointerdown)': '_pattern.onPointerdown($event)',
263
+ '(focusin)': 'onFocus()'
264
+ }
265
+ }]
266
+ }],
267
+ ctorParameters: () => []
268
+ });
171
269
  class Tab {
172
- /** A reference to the tab element. */
173
- _elementRef = inject(ElementRef);
174
- /** The parent Tabs. */
175
- _tabs = inject(Tabs);
176
- /** The parent TabList. */
177
- _tabList = inject(TabList);
178
- /** A global unique identifier for the tab. */
179
- _id = inject(_IdGenerator).getId('ng-tab-');
180
- /** The host native element. */
181
- element = computed(() => this._elementRef.nativeElement, ...(ngDevMode ? [{ debugName: "element" }] : []));
182
- /** The parent TabList UIPattern. */
183
- tablist = computed(() => this._tabList.pattern, ...(ngDevMode ? [{ debugName: "tablist" }] : []));
184
- /** The TabPanel UIPattern associated with the tab */
185
- tabpanel = computed(() => this._tabs.unorderedTabpanels().find(tabpanel => tabpanel.value() === this.value()), ...(ngDevMode ? [{ debugName: "tabpanel" }] : []));
186
- /** Whether a tab is disabled. */
187
- disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
188
- /** A local unique identifier for the tab. */
189
- value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
190
- /** The Tab UIPattern. */
191
- pattern = new TabPattern({
192
- ...this,
193
- id: () => this._id,
194
- tablist: this.tablist,
195
- tabpanel: this.tabpanel,
196
- value: this.value,
197
- });
198
- ngOnInit() {
199
- this._tabList.register(this);
200
- }
201
- ngOnDestroy() {
202
- this._tabList.deregister(this);
203
- }
204
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: Tab, deps: [], target: i0.ɵɵFactoryTarget.Directive });
205
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.0-next.2", type: Tab, isStandalone: true, selector: "[ngTab]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "tab" }, properties: { "attr.data-active": "pattern.active()", "attr.id": "pattern.id()", "attr.tabindex": "pattern.tabindex()", "attr.aria-selected": "pattern.selected()", "attr.aria-disabled": "pattern.disabled()", "attr.aria-controls": "pattern.controls()" }, classAttribute: "ng-tab" }, exportAs: ["ngTab"], ngImport: i0 });
270
+ _elementRef = inject(ElementRef);
271
+ _tabs = inject(Tabs);
272
+ _tabList = inject(TabList);
273
+ _id = inject(_IdGenerator).getId('ng-tab-');
274
+ element = computed(() => this._elementRef.nativeElement, ...(ngDevMode ? [{
275
+ debugName: "element"
276
+ }] : []));
277
+ tablist = computed(() => this._tabList._pattern, ...(ngDevMode ? [{
278
+ debugName: "tablist"
279
+ }] : []));
280
+ tabpanel = computed(() => this._tabs.unorderedTabpanels().find(tabpanel => tabpanel.value() === this.value()), ...(ngDevMode ? [{
281
+ debugName: "tabpanel"
282
+ }] : []));
283
+ disabled = input(false, ...(ngDevMode ? [{
284
+ debugName: "disabled",
285
+ transform: booleanAttribute
286
+ }] : [{
287
+ transform: booleanAttribute
288
+ }]));
289
+ value = input.required(...(ngDevMode ? [{
290
+ debugName: "value"
291
+ }] : []));
292
+ _pattern = new TabPattern({
293
+ ...this,
294
+ id: () => this._id,
295
+ tablist: this.tablist,
296
+ tabpanel: this.tabpanel,
297
+ value: this.value
298
+ });
299
+ ngOnInit() {
300
+ this._tabList.register(this);
301
+ }
302
+ ngOnDestroy() {
303
+ this._tabList.deregister(this);
304
+ }
305
+ static ɵfac = i0.ɵɵngDeclareFactory({
306
+ minVersion: "12.0.0",
307
+ version: "20.2.0-next.2",
308
+ ngImport: i0,
309
+ type: Tab,
310
+ deps: [],
311
+ target: i0.ɵɵFactoryTarget.Directive
312
+ });
313
+ static ɵdir = i0.ɵɵngDeclareDirective({
314
+ minVersion: "17.1.0",
315
+ version: "20.2.0-next.2",
316
+ type: Tab,
317
+ isStandalone: true,
318
+ selector: "[ngTab]",
319
+ inputs: {
320
+ disabled: {
321
+ classPropertyName: "disabled",
322
+ publicName: "disabled",
323
+ isSignal: true,
324
+ isRequired: false,
325
+ transformFunction: null
326
+ },
327
+ value: {
328
+ classPropertyName: "value",
329
+ publicName: "value",
330
+ isSignal: true,
331
+ isRequired: true,
332
+ transformFunction: null
333
+ }
334
+ },
335
+ host: {
336
+ attributes: {
337
+ "role": "tab"
338
+ },
339
+ properties: {
340
+ "attr.data-active": "_pattern.active()",
341
+ "attr.id": "_pattern.id()",
342
+ "attr.tabindex": "_pattern.tabIndex()",
343
+ "attr.aria-selected": "_pattern.selected()",
344
+ "attr.aria-disabled": "_pattern.disabled()",
345
+ "attr.aria-controls": "_pattern.controls()"
346
+ },
347
+ classAttribute: "ng-tab"
348
+ },
349
+ exportAs: ["ngTab"],
350
+ ngImport: i0
351
+ });
206
352
  }
207
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: Tab, decorators: [{
208
- type: Directive,
209
- args: [{
210
- selector: '[ngTab]',
211
- exportAs: 'ngTab',
212
- host: {
213
- 'role': 'tab',
214
- 'class': 'ng-tab',
215
- '[attr.data-active]': 'pattern.active()',
216
- '[attr.id]': 'pattern.id()',
217
- '[attr.tabindex]': 'pattern.tabindex()',
218
- '[attr.aria-selected]': 'pattern.selected()',
219
- '[attr.aria-disabled]': 'pattern.disabled()',
220
- '[attr.aria-controls]': 'pattern.controls()',
221
- },
222
- }]
223
- }] });
224
- /**
225
- * A TabPanel container for the resources of layered content associated with a tab.
226
- *
227
- * If a tabpanel is hidden due to its corresponding tab is not activated, the `inert` attribute
228
- * will be applied to the tabpanel element to remove it from the accessibility tree and stop
229
- * all the keyboard and pointer interactions. Note that this does not visually hide the tabpenl
230
- * and a proper styling is required.
231
- */
353
+ i0.ɵɵngDeclareClassMetadata({
354
+ minVersion: "12.0.0",
355
+ version: "20.2.0-next.2",
356
+ ngImport: i0,
357
+ type: Tab,
358
+ decorators: [{
359
+ type: Directive,
360
+ args: [{
361
+ selector: '[ngTab]',
362
+ exportAs: 'ngTab',
363
+ host: {
364
+ 'role': 'tab',
365
+ 'class': 'ng-tab',
366
+ '[attr.data-active]': '_pattern.active()',
367
+ '[attr.id]': '_pattern.id()',
368
+ '[attr.tabindex]': '_pattern.tabIndex()',
369
+ '[attr.aria-selected]': '_pattern.selected()',
370
+ '[attr.aria-disabled]': '_pattern.disabled()',
371
+ '[attr.aria-controls]': '_pattern.controls()'
372
+ }
373
+ }]
374
+ }]
375
+ });
232
376
  class TabPanel {
233
- /** The DeferredContentAware host directive. */
234
- _deferredContentAware = inject(DeferredContentAware);
235
- /** The parent Tabs. */
236
- _Tabs = inject(Tabs);
237
- /** A global unique identifier for the tab. */
238
- _id = inject(_IdGenerator).getId('ng-tabpanel-');
239
- /** The Tab UIPattern associated with the tabpanel */
240
- tab = computed(() => this._Tabs.tabs()?.find(tab => tab.value() === this.value()), ...(ngDevMode ? [{ debugName: "tab" }] : []));
241
- /** A local unique identifier for the tabpanel. */
242
- value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
243
- /** The TabPanel UIPattern. */
244
- pattern = new TabPanelPattern({
245
- ...this,
246
- id: () => this._id,
247
- tab: this.tab,
248
- });
249
- constructor() {
250
- afterRenderEffect(() => this._deferredContentAware.contentVisible.set(!this.pattern.hidden()));
251
- }
252
- ngOnInit() {
253
- this._Tabs.register(this);
254
- }
255
- ngOnDestroy() {
256
- this._Tabs.deregister(this);
257
- }
258
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: TabPanel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
259
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.0-next.2", type: TabPanel, isStandalone: true, selector: "[ngTabPanel]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "tabpanel" }, properties: { "attr.id": "pattern.id()", "attr.tabindex": "pattern.tabindex()", "attr.inert": "pattern.hidden() ? true : null", "attr.aria-labelledby": "pattern.labelledBy()" }, classAttribute: "ng-tabpanel" }, exportAs: ["ngTabPanel"], hostDirectives: [{ directive: i1.DeferredContentAware, inputs: ["preserveContent", "preserveContent"] }], ngImport: i0 });
377
+ _deferredContentAware = inject(DeferredContentAware);
378
+ _Tabs = inject(Tabs);
379
+ _id = inject(_IdGenerator).getId('ng-tabpanel-', true);
380
+ tab = computed(() => this._Tabs.tabs()?.find(tab => tab.value() === this.value()), ...(ngDevMode ? [{
381
+ debugName: "tab"
382
+ }] : []));
383
+ value = input.required(...(ngDevMode ? [{
384
+ debugName: "value"
385
+ }] : []));
386
+ _pattern = new TabPanelPattern({
387
+ ...this,
388
+ id: () => this._id,
389
+ tab: this.tab
390
+ });
391
+ constructor() {
392
+ afterRenderEffect(() => this._deferredContentAware.contentVisible.set(!this._pattern.hidden()));
393
+ }
394
+ ngOnInit() {
395
+ this._Tabs.register(this);
396
+ }
397
+ ngOnDestroy() {
398
+ this._Tabs.deregister(this);
399
+ }
400
+ static ɵfac = i0.ɵɵngDeclareFactory({
401
+ minVersion: "12.0.0",
402
+ version: "20.2.0-next.2",
403
+ ngImport: i0,
404
+ type: TabPanel,
405
+ deps: [],
406
+ target: i0.ɵɵFactoryTarget.Directive
407
+ });
408
+ static ɵdir = i0.ɵɵngDeclareDirective({
409
+ minVersion: "17.1.0",
410
+ version: "20.2.0-next.2",
411
+ type: TabPanel,
412
+ isStandalone: true,
413
+ selector: "[ngTabPanel]",
414
+ inputs: {
415
+ value: {
416
+ classPropertyName: "value",
417
+ publicName: "value",
418
+ isSignal: true,
419
+ isRequired: true,
420
+ transformFunction: null
421
+ }
422
+ },
423
+ host: {
424
+ attributes: {
425
+ "role": "tabpanel"
426
+ },
427
+ properties: {
428
+ "attr.id": "_pattern.id()",
429
+ "attr.tabindex": "_pattern.tabIndex()",
430
+ "attr.inert": "_pattern.hidden() ? true : null",
431
+ "attr.aria-labelledby": "_pattern.labelledBy()"
432
+ },
433
+ classAttribute: "ng-tabpanel"
434
+ },
435
+ exportAs: ["ngTabPanel"],
436
+ hostDirectives: [{
437
+ directive: i1.DeferredContentAware,
438
+ inputs: ["preserveContent", "preserveContent"]
439
+ }],
440
+ ngImport: i0
441
+ });
260
442
  }
261
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: TabPanel, decorators: [{
262
- type: Directive,
263
- args: [{
264
- selector: '[ngTabPanel]',
265
- exportAs: 'ngTabPanel',
266
- host: {
267
- 'role': 'tabpanel',
268
- 'class': 'ng-tabpanel',
269
- '[attr.id]': 'pattern.id()',
270
- '[attr.tabindex]': 'pattern.tabindex()',
271
- '[attr.inert]': 'pattern.hidden() ? true : null',
272
- '[attr.aria-labelledby]': 'pattern.labelledBy()',
273
- },
274
- hostDirectives: [
275
- {
276
- directive: DeferredContentAware,
277
- inputs: ['preserveContent'],
278
- },
279
- ],
280
- }]
281
- }], ctorParameters: () => [] });
282
- /**
283
- * A TabContent container for the lazy-loaded content.
284
- */
443
+ i0.ɵɵngDeclareClassMetadata({
444
+ minVersion: "12.0.0",
445
+ version: "20.2.0-next.2",
446
+ ngImport: i0,
447
+ type: TabPanel,
448
+ decorators: [{
449
+ type: Directive,
450
+ args: [{
451
+ selector: '[ngTabPanel]',
452
+ exportAs: 'ngTabPanel',
453
+ host: {
454
+ 'role': 'tabpanel',
455
+ 'class': 'ng-tabpanel',
456
+ '[attr.id]': '_pattern.id()',
457
+ '[attr.tabindex]': '_pattern.tabIndex()',
458
+ '[attr.inert]': '_pattern.hidden() ? true : null',
459
+ '[attr.aria-labelledby]': '_pattern.labelledBy()'
460
+ },
461
+ hostDirectives: [{
462
+ directive: DeferredContentAware,
463
+ inputs: ['preserveContent']
464
+ }]
465
+ }]
466
+ }],
467
+ ctorParameters: () => []
468
+ });
285
469
  class TabContent {
286
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: TabContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
287
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: TabContent, isStandalone: true, selector: "ng-template[ngTabContent]", exportAs: ["ngTabContent"], hostDirectives: [{ directive: i1.DeferredContent }], ngImport: i0 });
470
+ static ɵfac = i0.ɵɵngDeclareFactory({
471
+ minVersion: "12.0.0",
472
+ version: "20.2.0-next.2",
473
+ ngImport: i0,
474
+ type: TabContent,
475
+ deps: [],
476
+ target: i0.ɵɵFactoryTarget.Directive
477
+ });
478
+ static ɵdir = i0.ɵɵngDeclareDirective({
479
+ minVersion: "14.0.0",
480
+ version: "20.2.0-next.2",
481
+ type: TabContent,
482
+ isStandalone: true,
483
+ selector: "ng-template[ngTabContent]",
484
+ exportAs: ["ngTabContent"],
485
+ hostDirectives: [{
486
+ directive: i1.DeferredContent
487
+ }],
488
+ ngImport: i0
489
+ });
288
490
  }
289
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: TabContent, decorators: [{
290
- type: Directive,
291
- args: [{
292
- selector: 'ng-template[ngTabContent]',
293
- exportAs: 'ngTabContent',
294
- hostDirectives: [DeferredContent],
295
- }]
296
- }] });
491
+ i0.ɵɵngDeclareClassMetadata({
492
+ minVersion: "12.0.0",
493
+ version: "20.2.0-next.2",
494
+ ngImport: i0,
495
+ type: TabContent,
496
+ decorators: [{
497
+ type: Directive,
498
+ args: [{
499
+ selector: 'ng-template[ngTabContent]',
500
+ exportAs: 'ngTabContent',
501
+ hostDirectives: [DeferredContent]
502
+ }]
503
+ }]
504
+ });
297
505
 
298
506
  export { Tab, TabContent, TabList, TabPanel, Tabs };
299
507
  //# sourceMappingURL=tabs.mjs.map