@angular/aria 21.0.0-rc.0 → 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.
- package/_adev_assets/aria-accordion.json +14 -14
- package/_adev_assets/aria-combobox.json +10 -10
- package/_adev_assets/aria-grid.json +81 -12
- package/_adev_assets/aria-listbox.json +3 -3
- package/_adev_assets/aria-menu.json +174 -74
- package/_adev_assets/aria-tabs.json +22 -22
- package/_adev_assets/aria-toolbar.json +99 -120
- package/_adev_assets/aria-tree.json +20 -16
- package/fesm2022/_widget-chunk.mjs +266 -144
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion.mjs +12 -13
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox.mjs +9 -7
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid.mjs +61 -12
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox.mjs +14 -15
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +117 -61
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +390 -399
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs.mjs +16 -17
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +79 -44
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree.mjs +22 -19
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -10
- package/types/_grid-chunk.d.ts +115 -53
- package/types/accordion.d.ts +4 -4
- package/types/combobox.d.ts +2 -2
- package/types/grid.d.ts +12 -3
- package/types/listbox.d.ts +3 -4
- package/types/menu.d.ts +33 -21
- package/types/private.d.ts +263 -341
- package/types/tabs.d.ts +4 -4
- package/types/toolbar.d.ts +29 -26
- package/types/tree.d.ts +5 -6
- package/_adev_assets/aria-radio-group.json +0 -389
- package/fesm2022/deferred-content.mjs +0 -99
- package/fesm2022/deferred-content.mjs.map +0 -1
- package/fesm2022/radio-group.mjs +0 -338
- package/fesm2022/radio-group.mjs.map +0 -1
- package/types/deferred-content.d.ts +0 -38
- package/types/radio-group.d.ts +0 -84
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deferred-content.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/aria/deferred-content/deferred-content.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 {\n afterRenderEffect,\n Directive,\n inject,\n TemplateRef,\n signal,\n ViewContainerRef,\n model,\n} from '@angular/core';\n\n/**\n * A container directive controls the visibility of its content.\n */\n@Directive()\nexport class DeferredContentAware {\n readonly contentVisible = signal(false);\n readonly preserveContent = model(false);\n}\n\n/**\n * DeferredContent loads/unloads the content based on the visibility.\n * The visibilty signal is sent from a parent directive implements\n * DeferredContentAware.\n *\n * Use this directive as a host directive. For example:\n *\n * ```ts\n * @Directive({\n * selector: 'ng-template[AccordionContent]',\n * hostDirectives: [DeferredContent],\n * })\n * class AccordionContent {}\n * ```\n */\n@Directive()\nexport class DeferredContent {\n private readonly _deferredContentAware = inject(DeferredContentAware, {optional: true});\n private readonly _templateRef = inject(TemplateRef);\n private readonly _viewContainerRef = inject(ViewContainerRef);\n private _isRendered = false;\n\n readonly deferredContentAware = signal(this._deferredContentAware);\n\n constructor() {\n afterRenderEffect(() => {\n if (this.deferredContentAware()?.contentVisible()) {\n if (this._isRendered) return;\n this._viewContainerRef.clear();\n this._viewContainerRef.createEmbeddedView(this._templateRef);\n this._isRendered = true;\n } else if (!this.deferredContentAware()?.preserveContent()) {\n this._viewContainerRef.clear();\n this._isRendered = false;\n }\n });\n }\n}\n"],"names":["contentVisible","signal","ngDevMode","debugName","deferredContentAware","_isRendered","_viewContainerRef","clear","createEmbeddedView","_templateRef"],"mappings":";;;;EAuBWA,cAAA,GAAAC,MAAA,CAAA,KAAA,EAAA,IAAAC,SAAA,GAAA,CAAA;IAAAC,SAAA,EAAA;AAAA,GAAA,CAAA,GAAA,EAAA,CAAA,CAAA;;;AAIX,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA+BM,CAAA,MAAA;MAAW,IAAAC,IAAAA,CAAAA,oBAA8B,IAAAJ,cAAmB,EAAA,EAAA;QACrD,IAAA,IAAA,CAAkBK,WAAA,EACvB;QACF,IAAA,CAAAC,iBAAA,CAAAC,KAAA,EAAA;AAEJ,QAAA,IAAA,CAAAD,iBAAA,CAAAE,kBAAA,CAAA,IAAA,CAAAC,YAAA,CAAA;;;8BArBQ,CAAAF,KAAA,EAAA;AAAA,QAAA,IAAA,CAAAF,WAAA,GAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/fesm2022/radio-group.mjs
DELETED
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, computed, contentChildren, input, booleanAttribute, model, signal, afterRenderEffect, Directive, linkedSignal } from '@angular/core';
|
|
3
|
-
import { ToolbarRadioGroupPattern, RadioGroupPattern, RadioButtonPattern } from '@angular/aria/private';
|
|
4
|
-
import { Directionality } from '@angular/cdk/bidi';
|
|
5
|
-
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
6
|
-
import * as i1 from '@angular/aria/toolbar';
|
|
7
|
-
import { ToolbarWidgetGroup } from '@angular/aria/toolbar';
|
|
8
|
-
|
|
9
|
-
function mapSignal(originalSignal, operations) {
|
|
10
|
-
const mappedSignal = linkedSignal(() => operations.transform(originalSignal()));
|
|
11
|
-
const updateMappedSignal = mappedSignal.update;
|
|
12
|
-
const setMappedSignal = mappedSignal.set;
|
|
13
|
-
mappedSignal.set = newValue => {
|
|
14
|
-
setMappedSignal(newValue);
|
|
15
|
-
originalSignal.set(operations.reverse(newValue));
|
|
16
|
-
};
|
|
17
|
-
mappedSignal.update = updateFn => {
|
|
18
|
-
updateMappedSignal(oldValue => updateFn(oldValue));
|
|
19
|
-
originalSignal.update(oldValue => operations.reverse(updateFn(operations.transform(oldValue))));
|
|
20
|
-
};
|
|
21
|
-
return mappedSignal;
|
|
22
|
-
}
|
|
23
|
-
class RadioGroup {
|
|
24
|
-
_elementRef = inject(ElementRef);
|
|
25
|
-
_toolbarWidgetGroup = inject(ToolbarWidgetGroup);
|
|
26
|
-
_hasToolbar = computed(() => !!this._toolbarWidgetGroup.toolbar(), ...(ngDevMode ? [{
|
|
27
|
-
debugName: "_hasToolbar"
|
|
28
|
-
}] : []));
|
|
29
|
-
_radioButtons = contentChildren(RadioButton, ...(ngDevMode ? [{
|
|
30
|
-
debugName: "_radioButtons",
|
|
31
|
-
descendants: true
|
|
32
|
-
}] : [{
|
|
33
|
-
descendants: true
|
|
34
|
-
}]));
|
|
35
|
-
textDirection = inject(Directionality).valueSignal;
|
|
36
|
-
items = computed(() => this._radioButtons().map(radio => radio._pattern), ...(ngDevMode ? [{
|
|
37
|
-
debugName: "items"
|
|
38
|
-
}] : []));
|
|
39
|
-
orientation = input('vertical', ...(ngDevMode ? [{
|
|
40
|
-
debugName: "orientation"
|
|
41
|
-
}] : []));
|
|
42
|
-
skipDisabled = input(true, ...(ngDevMode ? [{
|
|
43
|
-
debugName: "skipDisabled",
|
|
44
|
-
transform: booleanAttribute
|
|
45
|
-
}] : [{
|
|
46
|
-
transform: booleanAttribute
|
|
47
|
-
}]));
|
|
48
|
-
focusMode = input('roving', ...(ngDevMode ? [{
|
|
49
|
-
debugName: "focusMode"
|
|
50
|
-
}] : []));
|
|
51
|
-
disabled = input(false, ...(ngDevMode ? [{
|
|
52
|
-
debugName: "disabled",
|
|
53
|
-
transform: booleanAttribute
|
|
54
|
-
}] : [{
|
|
55
|
-
transform: booleanAttribute
|
|
56
|
-
}]));
|
|
57
|
-
readonly = input(false, ...(ngDevMode ? [{
|
|
58
|
-
debugName: "readonly",
|
|
59
|
-
transform: booleanAttribute
|
|
60
|
-
}] : [{
|
|
61
|
-
transform: booleanAttribute
|
|
62
|
-
}]));
|
|
63
|
-
value = model(null, ...(ngDevMode ? [{
|
|
64
|
-
debugName: "value"
|
|
65
|
-
}] : []));
|
|
66
|
-
_value = mapSignal(this.value, {
|
|
67
|
-
transform: value => value !== null ? [value] : [],
|
|
68
|
-
reverse: values => values.length === 0 ? null : values[0]
|
|
69
|
-
});
|
|
70
|
-
_pattern;
|
|
71
|
-
_hasFocused = signal(false, ...(ngDevMode ? [{
|
|
72
|
-
debugName: "_hasFocused"
|
|
73
|
-
}] : []));
|
|
74
|
-
constructor() {
|
|
75
|
-
const inputs = {
|
|
76
|
-
...this,
|
|
77
|
-
items: this.items,
|
|
78
|
-
value: this._value,
|
|
79
|
-
activeItem: signal(undefined),
|
|
80
|
-
textDirection: this.textDirection,
|
|
81
|
-
element: () => this._elementRef.nativeElement,
|
|
82
|
-
getItem: e => {
|
|
83
|
-
if (!(e.target instanceof HTMLElement)) {
|
|
84
|
-
return undefined;
|
|
85
|
-
}
|
|
86
|
-
const element = e.target.closest('[role="radio"]');
|
|
87
|
-
return this.items().find(i => i.element() === element);
|
|
88
|
-
},
|
|
89
|
-
toolbar: this._toolbarWidgetGroup.toolbar
|
|
90
|
-
};
|
|
91
|
-
this._pattern = this._hasToolbar() ? new ToolbarRadioGroupPattern(inputs) : new RadioGroupPattern(inputs);
|
|
92
|
-
if (this._hasToolbar()) {
|
|
93
|
-
this._toolbarWidgetGroup.controls.set(this._pattern);
|
|
94
|
-
}
|
|
95
|
-
afterRenderEffect(() => {
|
|
96
|
-
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
97
|
-
const violations = this._pattern.validate();
|
|
98
|
-
for (const violation of violations) {
|
|
99
|
-
console.error(violation);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
afterRenderEffect(() => {
|
|
104
|
-
if (!this._hasFocused() && !this._hasToolbar()) {
|
|
105
|
-
this._pattern.setDefaultState();
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
onFocus() {
|
|
110
|
-
this._hasFocused.set(true);
|
|
111
|
-
}
|
|
112
|
-
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
113
|
-
minVersion: "12.0.0",
|
|
114
|
-
version: "20.2.0-next.2",
|
|
115
|
-
ngImport: i0,
|
|
116
|
-
type: RadioGroup,
|
|
117
|
-
deps: [],
|
|
118
|
-
target: i0.ɵɵFactoryTarget.Directive
|
|
119
|
-
});
|
|
120
|
-
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
121
|
-
minVersion: "17.2.0",
|
|
122
|
-
version: "20.2.0-next.2",
|
|
123
|
-
type: RadioGroup,
|
|
124
|
-
isStandalone: true,
|
|
125
|
-
selector: "[ngRadioGroup]",
|
|
126
|
-
inputs: {
|
|
127
|
-
orientation: {
|
|
128
|
-
classPropertyName: "orientation",
|
|
129
|
-
publicName: "orientation",
|
|
130
|
-
isSignal: true,
|
|
131
|
-
isRequired: false,
|
|
132
|
-
transformFunction: null
|
|
133
|
-
},
|
|
134
|
-
skipDisabled: {
|
|
135
|
-
classPropertyName: "skipDisabled",
|
|
136
|
-
publicName: "skipDisabled",
|
|
137
|
-
isSignal: true,
|
|
138
|
-
isRequired: false,
|
|
139
|
-
transformFunction: null
|
|
140
|
-
},
|
|
141
|
-
focusMode: {
|
|
142
|
-
classPropertyName: "focusMode",
|
|
143
|
-
publicName: "focusMode",
|
|
144
|
-
isSignal: true,
|
|
145
|
-
isRequired: false,
|
|
146
|
-
transformFunction: null
|
|
147
|
-
},
|
|
148
|
-
disabled: {
|
|
149
|
-
classPropertyName: "disabled",
|
|
150
|
-
publicName: "disabled",
|
|
151
|
-
isSignal: true,
|
|
152
|
-
isRequired: false,
|
|
153
|
-
transformFunction: null
|
|
154
|
-
},
|
|
155
|
-
readonly: {
|
|
156
|
-
classPropertyName: "readonly",
|
|
157
|
-
publicName: "readonly",
|
|
158
|
-
isSignal: true,
|
|
159
|
-
isRequired: false,
|
|
160
|
-
transformFunction: null
|
|
161
|
-
},
|
|
162
|
-
value: {
|
|
163
|
-
classPropertyName: "value",
|
|
164
|
-
publicName: "value",
|
|
165
|
-
isSignal: true,
|
|
166
|
-
isRequired: false,
|
|
167
|
-
transformFunction: null
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
outputs: {
|
|
171
|
-
value: "valueChange"
|
|
172
|
-
},
|
|
173
|
-
host: {
|
|
174
|
-
attributes: {
|
|
175
|
-
"role": "radiogroup"
|
|
176
|
-
},
|
|
177
|
-
listeners: {
|
|
178
|
-
"keydown": "_pattern.onKeydown($event)",
|
|
179
|
-
"pointerdown": "_pattern.onPointerdown($event)",
|
|
180
|
-
"focusin": "onFocus()"
|
|
181
|
-
},
|
|
182
|
-
properties: {
|
|
183
|
-
"attr.tabindex": "_pattern.tabindex()",
|
|
184
|
-
"attr.aria-readonly": "_pattern.readonly()",
|
|
185
|
-
"attr.aria-disabled": "_pattern.disabled()",
|
|
186
|
-
"attr.aria-orientation": "_pattern.orientation()",
|
|
187
|
-
"attr.aria-activedescendant": "_pattern.activedescendant()"
|
|
188
|
-
},
|
|
189
|
-
classAttribute: "ng-radio-group"
|
|
190
|
-
},
|
|
191
|
-
queries: [{
|
|
192
|
-
propertyName: "_radioButtons",
|
|
193
|
-
predicate: RadioButton,
|
|
194
|
-
descendants: true,
|
|
195
|
-
isSignal: true
|
|
196
|
-
}],
|
|
197
|
-
exportAs: ["ngRadioGroup"],
|
|
198
|
-
hostDirectives: [{
|
|
199
|
-
directive: i1.ToolbarWidgetGroup,
|
|
200
|
-
inputs: ["disabled", "disabled"]
|
|
201
|
-
}],
|
|
202
|
-
ngImport: i0
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
206
|
-
minVersion: "12.0.0",
|
|
207
|
-
version: "20.2.0-next.2",
|
|
208
|
-
ngImport: i0,
|
|
209
|
-
type: RadioGroup,
|
|
210
|
-
decorators: [{
|
|
211
|
-
type: Directive,
|
|
212
|
-
args: [{
|
|
213
|
-
selector: '[ngRadioGroup]',
|
|
214
|
-
exportAs: 'ngRadioGroup',
|
|
215
|
-
host: {
|
|
216
|
-
'role': 'radiogroup',
|
|
217
|
-
'class': 'ng-radio-group',
|
|
218
|
-
'[attr.tabindex]': '_pattern.tabindex()',
|
|
219
|
-
'[attr.aria-readonly]': '_pattern.readonly()',
|
|
220
|
-
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
221
|
-
'[attr.aria-orientation]': '_pattern.orientation()',
|
|
222
|
-
'[attr.aria-activedescendant]': '_pattern.activedescendant()',
|
|
223
|
-
'(keydown)': '_pattern.onKeydown($event)',
|
|
224
|
-
'(pointerdown)': '_pattern.onPointerdown($event)',
|
|
225
|
-
'(focusin)': 'onFocus()'
|
|
226
|
-
},
|
|
227
|
-
hostDirectives: [{
|
|
228
|
-
directive: ToolbarWidgetGroup,
|
|
229
|
-
inputs: ['disabled']
|
|
230
|
-
}]
|
|
231
|
-
}]
|
|
232
|
-
}],
|
|
233
|
-
ctorParameters: () => []
|
|
234
|
-
});
|
|
235
|
-
class RadioButton {
|
|
236
|
-
_elementRef = inject(ElementRef);
|
|
237
|
-
_radioGroup = inject(RadioGroup);
|
|
238
|
-
_generatedId = inject(_IdGenerator).getId('ng-radio-button-');
|
|
239
|
-
id = computed(() => this._generatedId, ...(ngDevMode ? [{
|
|
240
|
-
debugName: "id"
|
|
241
|
-
}] : []));
|
|
242
|
-
value = input.required(...(ngDevMode ? [{
|
|
243
|
-
debugName: "value"
|
|
244
|
-
}] : []));
|
|
245
|
-
group = computed(() => this._radioGroup._pattern, ...(ngDevMode ? [{
|
|
246
|
-
debugName: "group"
|
|
247
|
-
}] : []));
|
|
248
|
-
element = computed(() => this._elementRef.nativeElement, ...(ngDevMode ? [{
|
|
249
|
-
debugName: "element"
|
|
250
|
-
}] : []));
|
|
251
|
-
disabled = input(false, ...(ngDevMode ? [{
|
|
252
|
-
debugName: "disabled",
|
|
253
|
-
transform: booleanAttribute
|
|
254
|
-
}] : [{
|
|
255
|
-
transform: booleanAttribute
|
|
256
|
-
}]));
|
|
257
|
-
selected = computed(() => this._pattern.selected(), ...(ngDevMode ? [{
|
|
258
|
-
debugName: "selected"
|
|
259
|
-
}] : []));
|
|
260
|
-
_pattern = new RadioButtonPattern({
|
|
261
|
-
...this,
|
|
262
|
-
id: this.id,
|
|
263
|
-
value: this.value,
|
|
264
|
-
group: this.group,
|
|
265
|
-
element: this.element
|
|
266
|
-
});
|
|
267
|
-
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
268
|
-
minVersion: "12.0.0",
|
|
269
|
-
version: "20.2.0-next.2",
|
|
270
|
-
ngImport: i0,
|
|
271
|
-
type: RadioButton,
|
|
272
|
-
deps: [],
|
|
273
|
-
target: i0.ɵɵFactoryTarget.Directive
|
|
274
|
-
});
|
|
275
|
-
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
276
|
-
minVersion: "17.1.0",
|
|
277
|
-
version: "20.2.0-next.2",
|
|
278
|
-
type: RadioButton,
|
|
279
|
-
isStandalone: true,
|
|
280
|
-
selector: "[ngRadioButton]",
|
|
281
|
-
inputs: {
|
|
282
|
-
value: {
|
|
283
|
-
classPropertyName: "value",
|
|
284
|
-
publicName: "value",
|
|
285
|
-
isSignal: true,
|
|
286
|
-
isRequired: true,
|
|
287
|
-
transformFunction: null
|
|
288
|
-
},
|
|
289
|
-
disabled: {
|
|
290
|
-
classPropertyName: "disabled",
|
|
291
|
-
publicName: "disabled",
|
|
292
|
-
isSignal: true,
|
|
293
|
-
isRequired: false,
|
|
294
|
-
transformFunction: null
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
host: {
|
|
298
|
-
attributes: {
|
|
299
|
-
"role": "radio"
|
|
300
|
-
},
|
|
301
|
-
properties: {
|
|
302
|
-
"attr.data-active": "_pattern.active()",
|
|
303
|
-
"attr.tabindex": "_pattern.tabindex()",
|
|
304
|
-
"attr.aria-checked": "_pattern.selected()",
|
|
305
|
-
"attr.aria-disabled": "_pattern.disabled()",
|
|
306
|
-
"id": "_pattern.id()"
|
|
307
|
-
},
|
|
308
|
-
classAttribute: "ng-radio-button"
|
|
309
|
-
},
|
|
310
|
-
exportAs: ["ngRadioButton"],
|
|
311
|
-
ngImport: i0
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
315
|
-
minVersion: "12.0.0",
|
|
316
|
-
version: "20.2.0-next.2",
|
|
317
|
-
ngImport: i0,
|
|
318
|
-
type: RadioButton,
|
|
319
|
-
decorators: [{
|
|
320
|
-
type: Directive,
|
|
321
|
-
args: [{
|
|
322
|
-
selector: '[ngRadioButton]',
|
|
323
|
-
exportAs: 'ngRadioButton',
|
|
324
|
-
host: {
|
|
325
|
-
'role': 'radio',
|
|
326
|
-
'class': 'ng-radio-button',
|
|
327
|
-
'[attr.data-active]': '_pattern.active()',
|
|
328
|
-
'[attr.tabindex]': '_pattern.tabindex()',
|
|
329
|
-
'[attr.aria-checked]': '_pattern.selected()',
|
|
330
|
-
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
331
|
-
'[id]': '_pattern.id()'
|
|
332
|
-
}
|
|
333
|
-
}]
|
|
334
|
-
}]
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
export { RadioButton, RadioGroup };
|
|
338
|
-
//# sourceMappingURL=radio-group.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/aria/radio-group/radio-group.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 {\n afterRenderEffect,\n booleanAttribute,\n computed,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n linkedSignal,\n model,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport {\n RadioButtonPattern,\n RadioGroupInputs,\n RadioGroupPattern,\n ToolbarRadioGroupInputs,\n ToolbarRadioGroupPattern,\n} from '@angular/aria/private';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {ToolbarWidgetGroup} from '@angular/aria/toolbar';\n\n// TODO: Move mapSignal to it's own file so it can be reused across components.\n\n/**\n * Creates a new writable signal (signal V) whose value is connected to the given original\n * writable signal (signal T) such that updating signal V updates signal T and vice-versa.\n *\n * This function establishes a two-way synchronization between the source signal and the new mapped\n * signal. When the source signal changes, the mapped signal updates by applying the `transform`\n * function. When the mapped signal is explicitly set or updated, the change is propagated back to\n * the source signal by applying the `reverse` function.\n */\nexport function mapSignal<T, V>(\n originalSignal: WritableSignal<T>,\n operations: {\n transform: (value: T) => V;\n reverse: (value: V) => T;\n },\n) {\n const mappedSignal = linkedSignal(() => operations.transform(originalSignal()));\n const updateMappedSignal = mappedSignal.update;\n const setMappedSignal = mappedSignal.set;\n\n mappedSignal.set = (newValue: V) => {\n setMappedSignal(newValue);\n originalSignal.set(operations.reverse(newValue));\n };\n\n mappedSignal.update = (updateFn: (value: V) => V) => {\n updateMappedSignal(oldValue => updateFn(oldValue));\n originalSignal.update(oldValue => operations.reverse(updateFn(operations.transform(oldValue))));\n };\n\n return mappedSignal;\n}\n\n/**\n * A radio button group container.\n *\n * Radio groups are used to group multiple radio buttons or radio group labels so they function as\n * a single form control. The RadioGroup is meant to be used in conjunction with RadioButton\n * as follows:\n *\n * ```html\n * <div ngRadioGroup>\n * <div ngRadioButton value=\"1\">Option 1</div>\n * <div ngRadioButton value=\"2\">Option 2</div>\n * <div ngRadioButton value=\"3\">Option 3</div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[ngRadioGroup]',\n exportAs: 'ngRadioGroup',\n host: {\n 'role': 'radiogroup',\n 'class': 'ng-radio-group',\n '[attr.tabindex]': '_pattern.tabindex()',\n '[attr.aria-readonly]': '_pattern.readonly()',\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 '(focusin)': 'onFocus()',\n },\n hostDirectives: [\n {\n directive: ToolbarWidgetGroup,\n inputs: ['disabled'],\n },\n ],\n})\nexport class RadioGroup<V> {\n /** A reference to the radio group element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the ToolbarWidgetGroup, if the radio group is in a toolbar. */\n private readonly _toolbarWidgetGroup = inject(ToolbarWidgetGroup);\n\n /** Whether the radio group is inside of a Toolbar. */\n private readonly _hasToolbar = computed(() => !!this._toolbarWidgetGroup.toolbar());\n\n /** The RadioButtons nested inside of the RadioGroup. */\n private readonly _radioButtons = contentChildren(RadioButton, {descendants: true});\n\n /** A signal wrapper for directionality. */\n protected textDirection = inject(Directionality).valueSignal;\n\n /** The RadioButton UIPatterns of the child RadioButtons. */\n protected items = computed(() => this._radioButtons().map(radio => radio._pattern));\n\n /** Whether the radio group is vertically or horizontally oriented. */\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /** Whether disabled items in the group should be skipped when navigating. */\n readonly skipDisabled = input(true, {transform: booleanAttribute});\n\n /** The focus strategy used by the radio group. */\n readonly focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /** Whether the radio group is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the radio group is readonly. */\n readonly readonly = input(false, {transform: booleanAttribute});\n\n /** The value of the currently selected radio button. */\n readonly value = model<V | null>(null);\n\n /** The internal selection state for the radio group. */\n private readonly _value = mapSignal<V | null, V[]>(this.value, {\n transform: value => (value !== null ? [value] : []),\n reverse: values => (values.length === 0 ? null : values[0]),\n });\n\n /** The RadioGroup UIPattern. */\n readonly _pattern: RadioGroupPattern<V>;\n\n /** Whether the radio group has received focus yet. */\n private _hasFocused = signal(false);\n\n constructor() {\n const inputs: RadioGroupInputs<V> | ToolbarRadioGroupInputs<V> = {\n ...this,\n items: this.items,\n value: this._value,\n activeItem: signal(undefined),\n textDirection: this.textDirection,\n element: () => this._elementRef.nativeElement,\n getItem: e => {\n if (!(e.target instanceof HTMLElement)) {\n return undefined;\n }\n const element = e.target.closest('[role=\"radio\"]');\n return this.items().find(i => i.element() === element);\n },\n toolbar: this._toolbarWidgetGroup.toolbar,\n };\n\n this._pattern = this._hasToolbar()\n ? new ToolbarRadioGroupPattern<V>(inputs as ToolbarRadioGroupInputs<V>)\n : new RadioGroupPattern<V>(inputs as RadioGroupInputs<V>);\n\n if (this._hasToolbar()) {\n this._toolbarWidgetGroup.controls.set(this._pattern as ToolbarRadioGroupPattern<V>);\n }\n\n afterRenderEffect(() => {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const violations = this._pattern.validate();\n for (const violation of violations) {\n console.error(violation);\n }\n }\n });\n\n afterRenderEffect(() => {\n if (!this._hasFocused() && !this._hasToolbar()) {\n this._pattern.setDefaultState();\n }\n });\n }\n\n onFocus() {\n this._hasFocused.set(true);\n }\n}\n\n/** A selectable radio button in a RadioGroup. */\n@Directive({\n selector: '[ngRadioButton]',\n exportAs: 'ngRadioButton',\n host: {\n 'role': 'radio',\n 'class': 'ng-radio-button',\n '[attr.data-active]': '_pattern.active()',\n '[attr.tabindex]': '_pattern.tabindex()',\n '[attr.aria-checked]': '_pattern.selected()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[id]': '_pattern.id()',\n },\n})\nexport class RadioButton<V> {\n /** A reference to the radio button element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The parent RadioGroup. */\n private readonly _radioGroup = inject(RadioGroup);\n\n /** A unique identifier for the radio button. */\n private readonly _generatedId = inject(_IdGenerator).getId('ng-radio-button-');\n\n /** A unique identifier for the radio button. */\n readonly id = computed(() => this._generatedId);\n\n /** The value associated with the radio button. */\n readonly value = input.required<V>();\n\n /** The parent RadioGroup UIPattern. */\n readonly group = computed(() => this._radioGroup._pattern);\n\n /** A reference to the radio button element to be focused on navigation. */\n element = computed(() => this._elementRef.nativeElement);\n\n /** Whether the radio button is disabled. */\n disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the radio button is selected. */\n readonly selected = computed(() => this._pattern.selected());\n\n /** The RadioButton UIPattern. */\n readonly _pattern = new RadioButtonPattern<V>({\n ...this,\n id: this.id,\n value: this.value,\n group: this.group,\n element: this.element,\n });\n}\n"],"names":["update","updateFn","updateMappedSignal","oldValue","operations","reverse","transform","mappedSignal","_hasToolbar","computed","_toolbarWidgetGroup","toolbar","ngDevMode","debugName","_radioButtons","contentChildren","RadioButton","descendants","items","map","radio","_pattern","orientation","input","skipDisabled","booleanAttribute","focusMode","readonly","value","model","_value","mapSignal","values","length","signal","constructor","inputs","activeItem","undefined","textDirection","getItem","e","target","HTMLElement","element","find","i","ToolbarRadioGroupPattern","RadioGroupPattern","controls","set","violations","validate","violation","_hasFocused","setDefaultState","onFocus","i0","ɵɵngDeclareFactory","minVersion","version","ngImport","type","RadioGroup","deps","ɵɵFactoryTarget","Directive","ɵɵngDeclareDirective","isStandalone","selector","classPropertyName","publicName","isSignal","isRequired","transformFunction","disabled","outputs","host","attributes","listeners","properties","classAttribute","queries","propertyName","predicate","exportAs","hostDirectives","directive","i1","ToolbarWidgetGroup","ctorParameters","inject"],"mappings":";;;;;;;;;;;;;;;;cAgHwD,CAAAA,MAAA,GAAAC,QAAA,IAAA;AACrCC,IAAAA,kBAAA,CAAAC,QAAuB,IAAAF,QAAgC,CAAAE,QAAA,CAAA,CAAA;kBAEhB,CAAAH,MAAA,CAAAG,QAAA,IAAAC,UAAA,CAAAC,OAAA,CAAAJ,QAAA,CAAAG,UAAA,CAAAE,SAAA,CAAAH,QAAA,CAAA,CAAA,CAAA,CAAA;;SAI9CI;;;;;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AAC,UAAA,EAAA;AAAA,QAAA,eAAA,EAAA,qBAAA;AAAA,QAAA,oBAAA,EAAA,qBAAA;AAAA,QAAA,oBAAA,EAAA,qBAAA;AAAA,QAAA,uBAAA,EAAA,wBAAA;AAAA,QAAA,4BAAA,EAAA;AAAA,OAAA;MAAAC,cAAA,EAAA;AAAA,KAAA;IAAAC,OAAA,EAAA,CAAA;MAAAC,YAAA,EAAA,eAAA;AAAAC,MAAAA,SAAA,EAAApE,WAAA;MAAAC,WAAA,EAAA,IAAA;MAAAuD,QAAA,EAAA;AAAA,KAAA,CAAA;IAAAa,QAAA,EAAA,CAAA,cAAA,CAAA;IAAAC,cAAA,EAAA,CAAA;MAAAC,SAAA,EAAAC,EAAA,CAAAC,kBAAA;MAAArD,MAAA,EAAA,CAAA,UAAA,EAAA,UAAA;AAAA,KAAA,CAAA;AAAAyB,IAAAA,QAAA,EAAAJ;AAAA,GAAA,CAAA;;;;;;;;;;;;;;;;;8BAvDqB,EAAA,qBAAA;QAClB,yBAAY,EAAA,wBAAA;;mBAEZ,EAAY,4BAAA;uBACL,EAAM,gCAAA;;;;AAKX8B,QAAAA,SAAA,EAAAE,kBAAoB;gBACrB,CAAA,UAAA;AACD,OAAA;;;AAIA,EAAA,cAAA,EAAAC,MAAE;AAAI,CAAA,CAAA;;;AAQNC,EAAAA,WAAAA,GAAAA,MAAA,CAAA5B,UAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as _angular_core from '@angular/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A container directive controls the visibility of its content.
|
|
5
|
-
*/
|
|
6
|
-
declare class DeferredContentAware {
|
|
7
|
-
readonly contentVisible: _angular_core.WritableSignal<boolean>;
|
|
8
|
-
readonly preserveContent: _angular_core.ModelSignal<boolean>;
|
|
9
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DeferredContentAware, never>;
|
|
10
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DeferredContentAware, never, never, { "preserveContent": { "alias": "preserveContent"; "required": false; "isSignal": true; }; }, { "preserveContent": "preserveContentChange"; }, never, never, true, never>;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* DeferredContent loads/unloads the content based on the visibility.
|
|
14
|
-
* The visibilty signal is sent from a parent directive implements
|
|
15
|
-
* DeferredContentAware.
|
|
16
|
-
*
|
|
17
|
-
* Use this directive as a host directive. For example:
|
|
18
|
-
*
|
|
19
|
-
* ```ts
|
|
20
|
-
* @Directive({
|
|
21
|
-
* selector: 'ng-template[AccordionContent]',
|
|
22
|
-
* hostDirectives: [DeferredContent],
|
|
23
|
-
* })
|
|
24
|
-
* class AccordionContent {}
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
declare class DeferredContent {
|
|
28
|
-
private readonly _deferredContentAware;
|
|
29
|
-
private readonly _templateRef;
|
|
30
|
-
private readonly _viewContainerRef;
|
|
31
|
-
private _isRendered;
|
|
32
|
-
readonly deferredContentAware: _angular_core.WritableSignal<DeferredContentAware | null>;
|
|
33
|
-
constructor();
|
|
34
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DeferredContent, never>;
|
|
35
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DeferredContent, never, never, {}, {}, never, never, true, never>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export { DeferredContent, DeferredContentAware };
|
package/types/radio-group.d.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { WritableSignal } from '@angular/core';
|
|
3
|
-
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
4
|
-
import { RadioButtonPattern, RadioGroupPattern } from '@angular/aria/private';
|
|
5
|
-
import * as i1 from '@angular/aria/toolbar';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A radio button group container.
|
|
9
|
-
*
|
|
10
|
-
* Radio groups are used to group multiple radio buttons or radio group labels so they function as
|
|
11
|
-
* a single form control. The RadioGroup is meant to be used in conjunction with RadioButton
|
|
12
|
-
* as follows:
|
|
13
|
-
*
|
|
14
|
-
* ```html
|
|
15
|
-
* <div ngRadioGroup>
|
|
16
|
-
* <div ngRadioButton value="1">Option 1</div>
|
|
17
|
-
* <div ngRadioButton value="2">Option 2</div>
|
|
18
|
-
* <div ngRadioButton value="3">Option 3</div>
|
|
19
|
-
* </div>
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
declare class RadioGroup<V> {
|
|
23
|
-
/** A reference to the radio group element. */
|
|
24
|
-
private readonly _elementRef;
|
|
25
|
-
/** A reference to the ToolbarWidgetGroup, if the radio group is in a toolbar. */
|
|
26
|
-
private readonly _toolbarWidgetGroup;
|
|
27
|
-
/** Whether the radio group is inside of a Toolbar. */
|
|
28
|
-
private readonly _hasToolbar;
|
|
29
|
-
/** The RadioButtons nested inside of the RadioGroup. */
|
|
30
|
-
private readonly _radioButtons;
|
|
31
|
-
/** A signal wrapper for directionality. */
|
|
32
|
-
protected textDirection: WritableSignal<_angular_cdk_bidi.Direction>;
|
|
33
|
-
/** The RadioButton UIPatterns of the child RadioButtons. */
|
|
34
|
-
protected items: _angular_core.Signal<RadioButtonPattern<any>[]>;
|
|
35
|
-
/** Whether the radio group is vertically or horizontally oriented. */
|
|
36
|
-
readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal">;
|
|
37
|
-
/** Whether disabled items in the group should be skipped when navigating. */
|
|
38
|
-
readonly skipDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
39
|
-
/** The focus strategy used by the radio group. */
|
|
40
|
-
readonly focusMode: _angular_core.InputSignal<"roving" | "activedescendant">;
|
|
41
|
-
/** Whether the radio group is disabled. */
|
|
42
|
-
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
43
|
-
/** Whether the radio group is readonly. */
|
|
44
|
-
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
45
|
-
/** The value of the currently selected radio button. */
|
|
46
|
-
readonly value: _angular_core.ModelSignal<V | null>;
|
|
47
|
-
/** The internal selection state for the radio group. */
|
|
48
|
-
private readonly _value;
|
|
49
|
-
/** The RadioGroup UIPattern. */
|
|
50
|
-
readonly _pattern: RadioGroupPattern<V>;
|
|
51
|
-
/** Whether the radio group has received focus yet. */
|
|
52
|
-
private _hasFocused;
|
|
53
|
-
constructor();
|
|
54
|
-
onFocus(): void;
|
|
55
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RadioGroup<any>, never>;
|
|
56
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RadioGroup<any>, "[ngRadioGroup]", ["ngRadioGroup"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "focusMode": { "alias": "focusMode"; "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"; }, ["_radioButtons"], never, true, [{ directive: typeof i1.ToolbarWidgetGroup; inputs: { "disabled": "disabled"; }; outputs: {}; }]>;
|
|
57
|
-
}
|
|
58
|
-
/** A selectable radio button in a RadioGroup. */
|
|
59
|
-
declare class RadioButton<V> {
|
|
60
|
-
/** A reference to the radio button element. */
|
|
61
|
-
private readonly _elementRef;
|
|
62
|
-
/** The parent RadioGroup. */
|
|
63
|
-
private readonly _radioGroup;
|
|
64
|
-
/** A unique identifier for the radio button. */
|
|
65
|
-
private readonly _generatedId;
|
|
66
|
-
/** A unique identifier for the radio button. */
|
|
67
|
-
readonly id: _angular_core.Signal<string>;
|
|
68
|
-
/** The value associated with the radio button. */
|
|
69
|
-
readonly value: _angular_core.InputSignal<V>;
|
|
70
|
-
/** The parent RadioGroup UIPattern. */
|
|
71
|
-
readonly group: _angular_core.Signal<RadioGroupPattern<any>>;
|
|
72
|
-
/** A reference to the radio button element to be focused on navigation. */
|
|
73
|
-
element: _angular_core.Signal<any>;
|
|
74
|
-
/** Whether the radio button is disabled. */
|
|
75
|
-
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
76
|
-
/** Whether the radio button is selected. */
|
|
77
|
-
readonly selected: _angular_core.Signal<boolean>;
|
|
78
|
-
/** The RadioButton UIPattern. */
|
|
79
|
-
readonly _pattern: RadioButtonPattern<V>;
|
|
80
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RadioButton<any>, never>;
|
|
81
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RadioButton<any>, "[ngRadioButton]", ["ngRadioButton"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export { RadioButton, RadioGroup };
|