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