@radix-ng/primitives 0.9.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/src/accordion-content.directive.d.ts +12 -60
- package/accordion/src/accordion-header.directive.d.ts +2 -18
- package/accordion/src/accordion-item.directive.d.ts +52 -26
- package/accordion/src/accordion-root.directive.d.ts +41 -20
- package/accordion/src/accordion-trigger.directive.d.ts +6 -22
- package/collapsible/src/collapsible-content.directive.d.ts +8 -2
- package/collapsible/src/collapsible-content.token.d.ts +3 -0
- package/collapsible/src/collapsible-root.directive.d.ts +7 -4
- package/compodoc/documentation.json +11395 -0
- package/dropdown-menu/src/dropdown-menu-content.directive.d.ts +6 -7
- package/dropdown-menu/src/dropdown-menu-trigger.directive.d.ts +7 -6
- package/esm2022/accordion/src/accordion-content.directive.mjs +21 -122
- package/esm2022/accordion/src/accordion-header.directive.mjs +10 -31
- package/esm2022/accordion/src/accordion-item.directive.mjs +144 -57
- package/esm2022/accordion/src/accordion-root.directive.mjs +101 -64
- package/esm2022/accordion/src/accordion-trigger.directive.mjs +22 -41
- package/esm2022/alert-dialog/src/alert-dialog-cancel.directive.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog-content.directive.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog-root.directive.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog-title.directive.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog-trigger.directive.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog.service.mjs +3 -3
- package/esm2022/avatar/src/avatar-fallback.directive.mjs +3 -3
- package/esm2022/avatar/src/avatar-image.directive.mjs +3 -3
- package/esm2022/avatar/src/avatar-root.directive.mjs +3 -3
- package/esm2022/checkbox/src/checkbox-button.directive.mjs +3 -3
- package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +3 -3
- package/esm2022/checkbox/src/checkbox-input.directive.mjs +3 -3
- package/esm2022/checkbox/src/checkbox.directive.mjs +3 -3
- package/esm2022/collapsible/src/collapsible-content.directive.mjs +20 -7
- package/esm2022/collapsible/src/collapsible-content.token.mjs +3 -0
- package/esm2022/collapsible/src/collapsible-root.directive.mjs +17 -13
- package/esm2022/collapsible/src/collapsible-trigger.directive.mjs +3 -3
- package/esm2022/dropdown-menu/src/dropdown-menu-content.directive.mjs +30 -16
- package/esm2022/dropdown-menu/src/dropdown-menu-item-checkbox.directive.mjs +3 -3
- package/esm2022/dropdown-menu/src/dropdown-menu-item-indicator.directive.mjs +3 -3
- package/esm2022/dropdown-menu/src/dropdown-menu-item-radio-group.directive.mjs +3 -3
- package/esm2022/dropdown-menu/src/dropdown-menu-item-radio.directive.mjs +3 -3
- package/esm2022/dropdown-menu/src/dropdown-menu-item-selectable.mjs +3 -3
- package/esm2022/dropdown-menu/src/dropdown-menu-item.directive.mjs +17 -13
- package/esm2022/dropdown-menu/src/dropdown-menu-label.directive.mjs +3 -3
- package/esm2022/dropdown-menu/src/dropdown-menu-separator.directive.mjs +3 -3
- package/esm2022/dropdown-menu/src/dropdown-menu-trigger.directive.mjs +34 -26
- package/esm2022/label/src/label.directive.mjs +10 -5
- package/esm2022/menu/index.mjs +4 -4
- package/esm2022/menu/src/menu-content.directive.mjs +3 -3
- package/esm2022/menu/src/menu-directive.mjs +3 -3
- package/esm2022/menu/src/menu-group.directive.mjs +3 -3
- package/esm2022/menu/src/menu-item.directive.mjs +3 -3
- package/esm2022/menu/src/menu-label.directive.mjs +3 -3
- package/esm2022/menu/src/menu-separator.directive.mjs +3 -3
- package/esm2022/menubar/index.mjs +4 -4
- package/esm2022/menubar/src/menubar-content.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-item-checkbox.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-item-indicator.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-item-radio.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-item.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-radio-group.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-root.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-separator.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-trigger.directive.mjs +3 -3
- package/esm2022/progress/src/progress-indicator.directive.mjs +3 -3
- package/esm2022/progress/src/progress-root.directive.mjs +3 -3
- package/esm2022/radio/src/radio-indicator.directive.mjs +10 -10
- package/esm2022/radio/src/radio-item.directive.mjs +29 -18
- package/esm2022/radio/src/radio-root.directive.mjs +110 -16
- package/esm2022/radio/src/radio-tokens.mjs +3 -0
- package/esm2022/separator/src/separator.directive.mjs +7 -8
- package/esm2022/switch/index.mjs +4 -4
- package/esm2022/switch/src/switch-input.directive.mjs +3 -3
- package/esm2022/switch/src/switch-root.directive.mjs +3 -3
- package/esm2022/switch/src/switch-thumb.directive.mjs +3 -3
- package/esm2022/tabs/index.mjs +4 -4
- package/esm2022/tabs/src/tabs-content.directive.mjs +3 -3
- package/esm2022/tabs/src/tabs-context.service.mjs +3 -3
- package/esm2022/tabs/src/tabs-list.directive.mjs +3 -3
- package/esm2022/tabs/src/tabs-root.directive.mjs +3 -3
- package/esm2022/tabs/src/tabs-trigger.directive.mjs +3 -3
- package/esm2022/toggle/src/toggle.directive.mjs +3 -3
- package/esm2022/toggle-group/src/toggle-group-button.directive.mjs +3 -3
- package/esm2022/toggle-group/src/toggle-group-multi.directive.mjs +3 -3
- package/esm2022/toggle-group/src/toggle-group.directive.mjs +3 -3
- package/fesm2022/radix-ng-primitives-accordion.mjs +305 -324
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +18 -18
- package/fesm2022/radix-ng-primitives-avatar.mjs +9 -9
- package/fesm2022/radix-ng-primitives-checkbox.mjs +12 -12
- package/fesm2022/radix-ng-primitives-collapsible.mjs +61 -44
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +97 -70
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-label.mjs +9 -4
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +22 -22
- package/fesm2022/radix-ng-primitives-menubar.mjs +31 -31
- package/fesm2022/radix-ng-primitives-progress.mjs +6 -6
- package/fesm2022/radix-ng-primitives-radio.mjs +182 -77
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +6 -7
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +13 -13
- package/fesm2022/radix-ng-primitives-tabs.mjs +19 -19
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +9 -9
- package/fesm2022/radix-ng-primitives-toggle.mjs +3 -3
- package/label/src/label.directive.d.ts +9 -3
- package/package.json +1 -1
- package/radio/src/radio-indicator.directive.d.ts +4 -2
- package/radio/src/radio-item.directive.d.ts +10 -5
- package/radio/src/radio-root.directive.d.ts +19 -18
- package/radio/src/radio-tokens.d.ts +12 -0
- package/separator/src/separator.directive.d.ts +1 -1
@@ -1,13 +1,82 @@
|
|
1
|
+
import { FocusKeyManager } from '@angular/cdk/a11y';
|
2
|
+
import { TAB, LEFT_ARROW, UP_ARROW, RIGHT_ARROW, DOWN_ARROW, SPACE, ENTER } from '@angular/cdk/keycodes';
|
1
3
|
import * as i0 from '@angular/core';
|
2
|
-
import { InjectionToken, inject,
|
4
|
+
import { InjectionToken, inject, ElementRef, booleanAttribute, Directive, Input, EventEmitter, ContentChildren, Output } from '@angular/core';
|
3
5
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
6
|
+
import { Subject, takeUntil } from 'rxjs';
|
4
7
|
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
+
const RDX_RADIO_GROUP = new InjectionToken('RdxRadioGroup');
|
9
|
+
|
10
|
+
const RdxRadioItemToken = new InjectionToken('RadioItemToken');
|
11
|
+
function injectRadioItem() {
|
12
|
+
return inject(RdxRadioItemToken);
|
8
13
|
}
|
14
|
+
// Increasing integer for generating unique ids for radio components.
|
15
|
+
let nextUniqueId = 0;
|
16
|
+
class RdxRadioItemDirective {
|
17
|
+
constructor() {
|
18
|
+
this.radioGroup = inject(RDX_RADIO_GROUP);
|
19
|
+
this.element = inject(ElementRef);
|
20
|
+
this.id = `rdx-radio-${++nextUniqueId}`;
|
21
|
+
this.disabled = false;
|
22
|
+
}
|
23
|
+
get tabIndex() {
|
24
|
+
return this.disabled ? -1 : this.radioGroup.value === this.value ? 0 : -1;
|
25
|
+
}
|
26
|
+
get checked() {
|
27
|
+
return this.radioGroup.value === this.value;
|
28
|
+
}
|
29
|
+
ngOnInit() {
|
30
|
+
if (this.radioGroup.defaultValue === this.value) {
|
31
|
+
this.radioGroup.select(this.value);
|
32
|
+
}
|
33
|
+
}
|
34
|
+
focus() {
|
35
|
+
this.element.nativeElement.focus();
|
36
|
+
}
|
37
|
+
_onClick() {
|
38
|
+
if (!this.disabled) {
|
39
|
+
this.radioGroup.select(this.value);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
_onBlur() {
|
43
|
+
this.radioGroup.onTouched?.();
|
44
|
+
}
|
45
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxRadioItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
46
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.1", type: RdxRadioItemDirective, isStandalone: true, selector: "[RadioItem]", inputs: { id: "id", value: "value", disabled: ["disabled", "disabled", booleanAttribute] }, host: { attributes: { "type": "button", "role": "radio" }, listeners: { "click": "_onClick()", "blur": "_onBlur()" }, properties: { "attr.id": "id", "attr.aria-checked": "checked", "attr.data-disabled": "disabled ? \"\" : null", "attr.data-state": "checked ? \"checked\" : \"unchecked\"", "attr.tabindex": "tabIndex" } }, providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }], exportAs: ["RadioItem"], ngImport: i0 }); }
|
47
|
+
}
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxRadioItemDirective, decorators: [{
|
49
|
+
type: Directive,
|
50
|
+
args: [{
|
51
|
+
selector: '[RadioItem]',
|
52
|
+
exportAs: 'RadioItem',
|
53
|
+
standalone: true,
|
54
|
+
providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }],
|
55
|
+
host: {
|
56
|
+
type: 'button',
|
57
|
+
role: 'radio',
|
58
|
+
'[attr.id]': 'id',
|
59
|
+
'[attr.aria-checked]': 'checked',
|
60
|
+
'[attr.data-disabled]': 'disabled ? "" : null',
|
61
|
+
'[attr.data-state]': 'checked ? "checked" : "unchecked"',
|
62
|
+
'[attr.tabindex]': 'tabIndex',
|
63
|
+
'(click)': '_onClick()',
|
64
|
+
'(blur)': '_onBlur()'
|
65
|
+
}
|
66
|
+
}]
|
67
|
+
}], propDecorators: { id: [{
|
68
|
+
type: Input
|
69
|
+
}], value: [{
|
70
|
+
type: Input,
|
71
|
+
args: [{ required: true }]
|
72
|
+
}], disabled: [{
|
73
|
+
type: Input,
|
74
|
+
args: [{ transform: booleanAttribute }]
|
75
|
+
}] } });
|
76
|
+
|
9
77
|
class RdxRadioGroupDirective {
|
10
78
|
constructor() {
|
79
|
+
this.destroy$ = new Subject();
|
11
80
|
this.disabled = false;
|
12
81
|
/**
|
13
82
|
* The orientation of the radio group only vertical.
|
@@ -21,6 +90,29 @@ class RdxRadioGroupDirective {
|
|
21
90
|
* Event handler called when the value changes.
|
22
91
|
*/
|
23
92
|
this.onValueChange = new EventEmitter();
|
93
|
+
/**
|
94
|
+
* The callback function to call when the value of the radio group changes.
|
95
|
+
*/
|
96
|
+
this.onChange = () => {
|
97
|
+
/* Empty */
|
98
|
+
};
|
99
|
+
/**
|
100
|
+
* The callback function to call when the radio group is touched.
|
101
|
+
*/
|
102
|
+
this.onTouched = () => {
|
103
|
+
/* Empty */
|
104
|
+
};
|
105
|
+
}
|
106
|
+
ngAfterContentInit() {
|
107
|
+
this.focusKeyManager = new FocusKeyManager(this.radioItems).withWrap().withVerticalOrientation();
|
108
|
+
this.radioItems.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
109
|
+
this.updateActiveItem();
|
110
|
+
});
|
111
|
+
this.updateActiveItem(false);
|
112
|
+
}
|
113
|
+
ngOnDestroy() {
|
114
|
+
this.destroy$.next();
|
115
|
+
this.destroy$.complete();
|
24
116
|
}
|
25
117
|
/**
|
26
118
|
* Select a radio item.
|
@@ -30,6 +122,8 @@ class RdxRadioGroupDirective {
|
|
30
122
|
this.value = value;
|
31
123
|
this.onValueChange.emit(value);
|
32
124
|
this.onChange?.(value);
|
125
|
+
this.updateActiveItem();
|
126
|
+
this.onTouched();
|
33
127
|
}
|
34
128
|
/**
|
35
129
|
* Update the value of the radio group.
|
@@ -38,6 +132,9 @@ class RdxRadioGroupDirective {
|
|
38
132
|
*/
|
39
133
|
writeValue(value) {
|
40
134
|
this.value = value;
|
135
|
+
if (this.radioItems) {
|
136
|
+
this.updateActiveItem(false);
|
137
|
+
}
|
41
138
|
}
|
42
139
|
/**
|
43
140
|
* Register a callback function to call when the value of the radio group changes.
|
@@ -61,116 +158,124 @@ class RdxRadioGroupDirective {
|
|
61
158
|
/**
|
62
159
|
* When focus leaves the radio group.
|
63
160
|
*/
|
64
|
-
|
65
|
-
|
161
|
+
_onFocusin(event) {
|
162
|
+
const target = event.target;
|
163
|
+
const radioItem = this.radioItems.find((item) => item.element.nativeElement === target);
|
164
|
+
if (radioItem) {
|
165
|
+
this.focusKeyManager.setActiveItem(radioItem);
|
166
|
+
}
|
167
|
+
}
|
168
|
+
_onKeydown(event) {
|
169
|
+
if (this.disabled)
|
170
|
+
return;
|
171
|
+
switch (event.keyCode) {
|
172
|
+
case ENTER:
|
173
|
+
case SPACE:
|
174
|
+
event.preventDefault();
|
175
|
+
this.selectFocusedItem();
|
176
|
+
break;
|
177
|
+
case DOWN_ARROW:
|
178
|
+
case RIGHT_ARROW:
|
179
|
+
event.preventDefault();
|
180
|
+
this.focusKeyManager.setNextItemActive();
|
181
|
+
this.selectFocusedItem();
|
182
|
+
break;
|
183
|
+
case UP_ARROW:
|
184
|
+
case LEFT_ARROW:
|
185
|
+
event.preventDefault();
|
186
|
+
this.focusKeyManager.setPreviousItemActive();
|
187
|
+
this.selectFocusedItem();
|
188
|
+
break;
|
189
|
+
case TAB:
|
190
|
+
this.tabNavigation(event);
|
191
|
+
break;
|
192
|
+
default:
|
193
|
+
this.focusKeyManager.onKeydown(event);
|
194
|
+
}
|
195
|
+
}
|
196
|
+
selectFocusedItem() {
|
197
|
+
const focusedItem = this.focusKeyManager.activeItem;
|
198
|
+
if (focusedItem) {
|
199
|
+
this.select(focusedItem.value);
|
200
|
+
}
|
201
|
+
}
|
202
|
+
updateActiveItem(setFocus = true) {
|
203
|
+
const activeItem = this.radioItems.find((item) => item.value === this.value);
|
204
|
+
if (activeItem) {
|
205
|
+
this.focusKeyManager.setActiveItem(activeItem);
|
206
|
+
}
|
207
|
+
else if (this.radioItems.length > 0 && setFocus) {
|
208
|
+
this.focusKeyManager.setFirstItemActive();
|
209
|
+
}
|
66
210
|
}
|
67
|
-
|
68
|
-
|
69
|
-
|
211
|
+
tabNavigation(event) {
|
212
|
+
event.preventDefault();
|
213
|
+
const checkedItem = this.radioItems.find((item) => item.checked);
|
214
|
+
if (checkedItem) {
|
215
|
+
checkedItem.focus();
|
216
|
+
}
|
217
|
+
else if (this.radioItems.first) {
|
218
|
+
this.radioItems.first.focus();
|
219
|
+
}
|
220
|
+
}
|
221
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxRadioGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
222
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.1", type: RdxRadioGroupDirective, isStandalone: true, selector: "div[RadioRoot]", inputs: { value: "value", disabled: ["disabled", "disabled", booleanAttribute], dir: "dir", defaultValue: "defaultValue" }, outputs: { onValueChange: "onValueChange" }, host: { attributes: { "role": "radiogroup" }, listeners: { "keydown": "_onKeydown($event)", "focusin": "_onFocusin($event)" }, properties: { "attr.aria-orientation": "_orientation", "attr.data-disabled": "disabled ? \"\" : null", "attr.tabindex": "-1", "attr.dir": "dir" } }, providers: [
|
223
|
+
{ provide: RDX_RADIO_GROUP, useExisting: RdxRadioGroupDirective },
|
70
224
|
{ provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }
|
71
|
-
], exportAs: ["RadioRoot"], ngImport: i0 }); }
|
225
|
+
], queries: [{ propertyName: "radioItems", predicate: RdxRadioItemDirective, descendants: true }], exportAs: ["RadioRoot"], ngImport: i0 }); }
|
72
226
|
}
|
73
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1
|
227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxRadioGroupDirective, decorators: [{
|
74
228
|
type: Directive,
|
75
229
|
args: [{
|
76
230
|
selector: 'div[RadioRoot]',
|
77
231
|
exportAs: 'RadioRoot',
|
78
232
|
standalone: true,
|
79
233
|
providers: [
|
80
|
-
{ provide:
|
234
|
+
{ provide: RDX_RADIO_GROUP, useExisting: RdxRadioGroupDirective },
|
81
235
|
{ provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }
|
82
236
|
],
|
83
237
|
host: {
|
84
238
|
role: 'radiogroup',
|
85
239
|
'[attr.aria-orientation]': '_orientation',
|
86
240
|
'[attr.data-disabled]': 'disabled ? "" : null',
|
241
|
+
'[attr.tabindex]': '-1',
|
87
242
|
'[attr.dir]': 'dir',
|
88
|
-
'(
|
243
|
+
'(keydown)': '_onKeydown($event)',
|
244
|
+
'(focusin)': '_onFocusin($event)'
|
89
245
|
}
|
90
246
|
}]
|
91
|
-
}], propDecorators: {
|
247
|
+
}], propDecorators: { radioItems: [{
|
248
|
+
type: ContentChildren,
|
249
|
+
args: [RdxRadioItemDirective, { descendants: true }]
|
250
|
+
}], value: [{
|
92
251
|
type: Input
|
93
252
|
}], disabled: [{
|
94
253
|
type: Input,
|
95
254
|
args: [{ transform: booleanAttribute }]
|
96
255
|
}], dir: [{
|
97
256
|
type: Input
|
257
|
+
}], defaultValue: [{
|
258
|
+
type: Input
|
98
259
|
}], onValueChange: [{
|
99
260
|
type: Output
|
100
261
|
}] } });
|
101
262
|
|
102
|
-
const RdxRadioItemToken = new InjectionToken('RadioItemToken');
|
103
|
-
function injectRadioItem() {
|
104
|
-
return inject(RdxRadioItemToken);
|
105
|
-
}
|
106
|
-
// Increasing integer for generating unique ids for radio components.
|
107
|
-
let nextUniqueId = 0;
|
108
|
-
class RdxRadioItemDirective {
|
109
|
-
constructor() {
|
110
|
-
this.radioGroup = injectRadioGroup();
|
111
|
-
this.id = `rdx-radio-${++nextUniqueId}`;
|
112
|
-
this.disabled = false;
|
113
|
-
}
|
114
|
-
_onKeydown(event) {
|
115
|
-
// According to WAI ARIA, radio groups don't activate items on enter keypress
|
116
|
-
if (event.key === 'Enter') {
|
117
|
-
event.preventDefault();
|
118
|
-
}
|
119
|
-
}
|
120
|
-
_onFocus() {
|
121
|
-
this.radioGroup.select(this.value);
|
122
|
-
}
|
123
|
-
_onClick() {
|
124
|
-
this.radioGroup.select(this.value);
|
125
|
-
}
|
126
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxRadioItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
127
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.1.2", type: RdxRadioItemDirective, isStandalone: true, selector: "[RadioItem]", inputs: { id: "id", value: "value", disabled: ["disabled", "disabled", booleanAttribute] }, host: { attributes: { "type": "button", "role": "radio" }, listeners: { "focus": "_onFocus()", "click": "_onClick()", "keydown": "_onKeydown($event)" }, properties: { "attr.id": "id", "attr.aria-checked": "radioGroup.value === value ? \"true\" : \"false\"", "attr.data-disabled": "disabled ? \"\" : null", "attr.data-state": "radioGroup.value === value ? \"checked\" : \"unchecked\"" } }, providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }], exportAs: ["RadioItem"], ngImport: i0 }); }
|
128
|
-
}
|
129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxRadioItemDirective, decorators: [{
|
130
|
-
type: Directive,
|
131
|
-
args: [{
|
132
|
-
selector: '[RadioItem]',
|
133
|
-
exportAs: 'RadioItem',
|
134
|
-
standalone: true,
|
135
|
-
providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }],
|
136
|
-
host: {
|
137
|
-
type: 'button',
|
138
|
-
role: 'radio',
|
139
|
-
'[attr.id]': 'id',
|
140
|
-
'[attr.aria-checked]': 'radioGroup.value === value ? "true" : "false"',
|
141
|
-
'[attr.data-disabled]': 'disabled ? "" : null',
|
142
|
-
'[attr.data-state]': 'radioGroup.value === value ? "checked" : "unchecked"',
|
143
|
-
'(focus)': '_onFocus()',
|
144
|
-
'(click)': '_onClick()',
|
145
|
-
'(keydown)': '_onKeydown($event)'
|
146
|
-
}
|
147
|
-
}]
|
148
|
-
}], propDecorators: { id: [{
|
149
|
-
type: Input
|
150
|
-
}], value: [{
|
151
|
-
type: Input,
|
152
|
-
args: [{ required: true }]
|
153
|
-
}], disabled: [{
|
154
|
-
type: Input,
|
155
|
-
args: [{ transform: booleanAttribute }]
|
156
|
-
}] } });
|
157
|
-
|
158
263
|
class RdxRadioIndicatorDirective {
|
159
264
|
constructor() {
|
160
|
-
this.radioGroup =
|
161
|
-
this.radioItem =
|
265
|
+
this.radioGroup = inject(RDX_RADIO_GROUP);
|
266
|
+
this.radioItem = inject(RdxRadioItemDirective);
|
162
267
|
}
|
163
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1
|
164
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1
|
268
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxRadioIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
269
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.1", type: RdxRadioIndicatorDirective, isStandalone: true, selector: "[RadioIndicator]", host: { properties: { "attr.data-state": "radioItem.checked ? \"checked\" : \"unchecked\"", "attr.data-disabled": "radioItem.disabled ? \"\" : null" } }, exportAs: ["RadioIndicator"], ngImport: i0 }); }
|
165
270
|
}
|
166
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1
|
271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxRadioIndicatorDirective, decorators: [{
|
167
272
|
type: Directive,
|
168
273
|
args: [{
|
169
274
|
selector: '[RadioIndicator]',
|
170
275
|
exportAs: 'RadioIndicator',
|
171
276
|
standalone: true,
|
172
277
|
host: {
|
173
|
-
'[attr.data-state]': '
|
278
|
+
'[attr.data-state]': 'radioItem.checked ? "checked" : "unchecked"',
|
174
279
|
'[attr.data-disabled]': 'radioItem.disabled ? "" : null'
|
175
280
|
}
|
176
281
|
}]
|
@@ -180,5 +285,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImpor
|
|
180
285
|
* Generated bundle index. Do not edit.
|
181
286
|
*/
|
182
287
|
|
183
|
-
export { RdxRadioGroupDirective,
|
288
|
+
export { RdxRadioGroupDirective, RdxRadioIndicatorDirective, RdxRadioItemDirective, RdxRadioItemToken, injectRadioItem };
|
184
289
|
//# sourceMappingURL=radix-ng-primitives-radio.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-radio.mjs","sources":["../../../packages/primitives/radio/src/radio-root.directive.ts","../../../packages/primitives/radio/src/radio-item.directive.ts","../../../packages/primitives/radio/src/radio-indicator.directive.ts","../../../packages/primitives/radio/radix-ng-primitives-radio.ts"],"sourcesContent":["import { booleanAttribute, Directive, EventEmitter, inject, InjectionToken, Input, Output } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport const RdxRadioGroupToken = new InjectionToken<RdxRadioGroupDirective>('RdxRadioGroupToken');\n\nexport function injectRadioGroup(): RdxRadioGroupDirective {\n return inject(RdxRadioGroupToken);\n}\n\ninterface RadioGroupProps {\n name?: string;\n disabled?: boolean;\n // TODO: dir?: string;\n // TODO: loop?: string;\n defaultValue?: string;\n value?: string;\n onValueChange?: EventEmitter<string>;\n}\n\n@Directive({\n selector: 'div[RadioRoot]',\n exportAs: 'RadioRoot',\n standalone: true,\n providers: [\n { provide: RdxRadioGroupToken, useExisting: RdxRadioGroupDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }\n ],\n host: {\n role: 'radiogroup',\n '[attr.aria-orientation]': '_orientation',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '[attr.dir]': 'dir',\n\n '(focusout)': '_onFocusout()'\n }\n})\nexport class RdxRadioGroupDirective implements RadioGroupProps, ControlValueAccessor {\n @Input() value?: string;\n\n @Input({ transform: booleanAttribute }) disabled = false;\n\n @Input() dir?: string;\n\n /**\n * The orientation of the radio group only vertical.\n * Horizontal radio buttons can sometimes be challenging to scan and localize.\n * The horizontal arrangement of radio buttons may also lead to difficulties in determining which\n * label corresponds to which button: whether the label is above or below the button.\n * @default 'vertical'\n */\n readonly _orientation = 'vertical';\n\n /**\n * Event handler called when the value changes.\n */\n @Output() readonly onValueChange = new EventEmitter<string>();\n\n /**\n * The callback function to call when the value of the radio group changes.\n * @internal\n */\n private onChange?: (value: string) => void;\n\n /**\n * The callback function to call when the radio group is touched.\n * @internal\n */\n private onTouched?: () => void;\n\n /**\n * Select a radio item.\n * @param value The value of the radio item to select.\n */\n select(value: string): void {\n this.value = value;\n this.onValueChange.emit(value);\n this.onChange?.(value);\n }\n\n /**\n * Update the value of the radio group.\n * @param value The new value of the radio group.\n * @internal\n */\n writeValue(value: string): void {\n this.value = value;\n }\n\n /**\n * Register a callback function to call when the value of the radio group changes.\n * @param fn The callback function to call when the value of the radio group changes.\n * @internal\n */\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the radio group.\n * @param isDisabled Whether the radio group is disabled.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n /**\n * When focus leaves the radio group.\n */\n _onFocusout(): void {\n this.onTouched?.();\n }\n}\n","import { booleanAttribute, Directive, inject, InjectionToken, Input } from '@angular/core';\nimport { injectRadioGroup } from './radio-root.directive';\n\nexport const RdxRadioItemToken = new InjectionToken<RdxRadioItemDirective>('RadioItemToken');\n\nexport function injectRadioItem(): RdxRadioItemDirective {\n return inject(RdxRadioItemToken);\n}\n\n// Increasing integer for generating unique ids for radio components.\nlet nextUniqueId = 0;\n\n@Directive({\n selector: '[RadioItem]',\n exportAs: 'RadioItem',\n standalone: true,\n providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }],\n host: {\n type: 'button',\n role: 'radio',\n '[attr.id]': 'id',\n '[attr.aria-checked]': 'radioGroup.value === value ? \"true\" : \"false\"',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '[attr.data-state]': 'radioGroup.value === value ? \"checked\" : \"unchecked\"',\n\n '(focus)': '_onFocus()',\n '(click)': '_onClick()',\n '(keydown)': '_onKeydown($event)'\n }\n})\nexport class RdxRadioItemDirective {\n protected readonly radioGroup = injectRadioGroup();\n\n @Input() id = `rdx-radio-${++nextUniqueId}`;\n\n @Input({ required: true }) value!: string;\n\n @Input({ transform: booleanAttribute }) disabled = false;\n\n _onKeydown(event: KeyboardEvent): void {\n // According to WAI ARIA, radio groups don't activate items on enter keypress\n if (event.key === 'Enter') {\n event.preventDefault();\n }\n }\n\n _onFocus(): void {\n this.radioGroup.select(this.value);\n }\n\n _onClick(): void {\n this.radioGroup.select(this.value);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectRadioItem } from './radio-item.directive';\nimport { injectRadioGroup } from './radio-root.directive';\n\n@Directive({\n selector: '[RadioIndicator]',\n exportAs: 'RadioIndicator',\n standalone: true,\n host: {\n '[attr.data-state]': 'radioGroup.value === this.radioItem.value ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'radioItem.disabled ? \"\" : null'\n }\n})\nexport class RdxRadioIndicatorDirective {\n protected readonly radioGroup = injectRadioGroup();\n\n protected readonly radioItem = injectRadioItem();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAGa,kBAAkB,GAAG,IAAI,cAAc,CAAyB,oBAAoB,EAAE;SAEnF,gBAAgB,GAAA;AAC5B,IAAA,OAAO,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACtC,CAAC;MA6BY,sBAAsB,CAAA;AAjBnC,IAAA,WAAA,GAAA;QAoB4C,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AAIzD;;;;;;AAMG;QACM,IAAY,CAAA,YAAA,GAAG,UAAU,CAAC;AAEnC;;AAEG;AACgB,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,YAAY,EAAU,CAAC;AA6DjE,KAAA;AA/CG;;;AAGG;AACH,IAAA,MAAM,CAAC,KAAa,EAAA;AAChB,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACnB,QAAA,IAAI,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EAAE,CAAC;AACpD,KAAA;8GAJY,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,yEAAA,EAAA,oBAAA,EAAA,kCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBATtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,mBAAmB,EAAE,qEAAqE;AAC1F,wBAAA,sBAAsB,EAAE,gCAAgC;AAC3D,qBAAA;AACJ,iBAAA,CAAA;;;ACZD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"radix-ng-primitives-radio.mjs","sources":["../../../packages/primitives/radio/src/radio-tokens.ts","../../../packages/primitives/radio/src/radio-item.directive.ts","../../../packages/primitives/radio/src/radio-root.directive.ts","../../../packages/primitives/radio/src/radio-indicator.directive.ts","../../../packages/primitives/radio/radix-ng-primitives-radio.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface RadioGroupProps {\n name?: string;\n disabled?: boolean;\n defaultValue?: string;\n value?: string;\n}\n\nexport interface RadioGroupDirective extends RadioGroupProps {\n select(value: string): void;\n\n onTouched(): void;\n}\n\nexport const RDX_RADIO_GROUP = new InjectionToken<RadioGroupDirective>('RdxRadioGroup');\n","import { FocusableOption } from '@angular/cdk/a11y';\nimport { booleanAttribute, Directive, ElementRef, inject, InjectionToken, Input, OnInit } from '@angular/core';\nimport { RDX_RADIO_GROUP } from './radio-tokens';\n\nexport const RdxRadioItemToken = new InjectionToken<RdxRadioItemDirective>('RadioItemToken');\n\nexport function injectRadioItem(): RdxRadioItemDirective {\n return inject(RdxRadioItemToken);\n}\n\n// Increasing integer for generating unique ids for radio components.\nlet nextUniqueId = 0;\n\n@Directive({\n selector: '[RadioItem]',\n exportAs: 'RadioItem',\n standalone: true,\n providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }],\n host: {\n type: 'button',\n role: 'radio',\n '[attr.id]': 'id',\n '[attr.aria-checked]': 'checked',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '[attr.data-state]': 'checked ? \"checked\" : \"unchecked\"',\n '[attr.tabindex]': 'tabIndex',\n '(click)': '_onClick()',\n '(blur)': '_onBlur()'\n }\n})\nexport class RdxRadioItemDirective implements FocusableOption, OnInit {\n private readonly radioGroup = inject(RDX_RADIO_GROUP);\n readonly element = inject(ElementRef);\n\n @Input() id = `rdx-radio-${++nextUniqueId}`;\n\n @Input({ required: true }) value!: string;\n\n @Input({ transform: booleanAttribute }) disabled = false;\n\n get tabIndex(): number {\n return this.disabled ? -1 : this.radioGroup.value === this.value ? 0 : -1;\n }\n\n get checked(): boolean {\n return this.radioGroup.value === this.value;\n }\n\n ngOnInit() {\n if (this.radioGroup.defaultValue === this.value) {\n this.radioGroup.select(this.value);\n }\n }\n\n focus(): void {\n this.element.nativeElement.focus();\n }\n\n _onClick(): void {\n if (!this.disabled) {\n this.radioGroup.select(this.value);\n }\n }\n\n _onBlur(): void {\n this.radioGroup.onTouched?.();\n }\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { DOWN_ARROW, ENTER, LEFT_ARROW, RIGHT_ARROW, SPACE, TAB, UP_ARROW } from '@angular/cdk/keycodes';\nimport {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n QueryList\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Subject, takeUntil } from 'rxjs';\nimport { RdxRadioItemDirective } from './radio-item.directive';\nimport { RadioGroupDirective, RadioGroupProps, RDX_RADIO_GROUP } from './radio-tokens';\n\n@Directive({\n selector: 'div[RadioRoot]',\n exportAs: 'RadioRoot',\n standalone: true,\n providers: [\n { provide: RDX_RADIO_GROUP, useExisting: RdxRadioGroupDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }\n ],\n host: {\n role: 'radiogroup',\n '[attr.aria-orientation]': '_orientation',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '[attr.tabindex]': '-1',\n '[attr.dir]': 'dir',\n '(keydown)': '_onKeydown($event)',\n '(focusin)': '_onFocusin($event)'\n }\n})\nexport class RdxRadioGroupDirective\n implements RadioGroupProps, RadioGroupDirective, ControlValueAccessor, AfterContentInit, OnDestroy\n{\n @ContentChildren(RdxRadioItemDirective, { descendants: true }) radioItems!: QueryList<RdxRadioItemDirective>;\n private focusKeyManager!: FocusKeyManager<RdxRadioItemDirective>;\n private destroy$ = new Subject<void>();\n\n name?: string | undefined;\n @Input() value?: string;\n\n @Input({ transform: booleanAttribute }) disabled = false;\n\n @Input() dir?: string;\n\n @Input() defaultValue?: string;\n\n /**\n * The orientation of the radio group only vertical.\n * Horizontal radio buttons can sometimes be challenging to scan and localize.\n * The horizontal arrangement of radio buttons may also lead to difficulties in determining which\n * label corresponds to which button: whether the label is above or below the button.\n * @default 'vertical'\n */\n readonly _orientation = 'vertical';\n\n /**\n * Event handler called when the value changes.\n */\n @Output() readonly onValueChange = new EventEmitter<string>();\n\n /**\n * The callback function to call when the value of the radio group changes.\n */\n private onChange: (value: string) => void = () => {\n /* Empty */\n };\n\n /**\n * The callback function to call when the radio group is touched.\n */\n onTouched: () => void = () => {\n /* Empty */\n };\n\n ngAfterContentInit() {\n this.focusKeyManager = new FocusKeyManager(this.radioItems).withWrap().withVerticalOrientation();\n\n this.radioItems.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.updateActiveItem();\n });\n\n this.updateActiveItem(false);\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /**\n * Select a radio item.\n * @param value The value of the radio item to select.\n */\n select(value: string): void {\n this.value = value;\n this.onValueChange.emit(value);\n this.onChange?.(value);\n this.updateActiveItem();\n this.onTouched();\n }\n\n /**\n * Update the value of the radio group.\n * @param value The new value of the radio group.\n * @internal\n */\n writeValue(value: string): void {\n this.value = value;\n if (this.radioItems) {\n this.updateActiveItem(false);\n }\n }\n\n /**\n * Register a callback function to call when the value of the radio group changes.\n * @param fn The callback function to call when the value of the radio group changes.\n * @internal\n */\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the radio group.\n * @param isDisabled Whether the radio group is disabled.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n /**\n * When focus leaves the radio group.\n */\n _onFocusin(event: FocusEvent): void {\n const target = event.target as HTMLElement;\n const radioItem = this.radioItems.find((item) => item.element.nativeElement === target);\n if (radioItem) {\n this.focusKeyManager.setActiveItem(radioItem);\n }\n }\n\n _onKeydown(event: KeyboardEvent): void {\n if (this.disabled) return;\n\n switch (event.keyCode) {\n case ENTER:\n case SPACE:\n event.preventDefault();\n this.selectFocusedItem();\n break;\n case DOWN_ARROW:\n case RIGHT_ARROW:\n event.preventDefault();\n this.focusKeyManager.setNextItemActive();\n this.selectFocusedItem();\n break;\n case UP_ARROW:\n case LEFT_ARROW:\n event.preventDefault();\n this.focusKeyManager.setPreviousItemActive();\n this.selectFocusedItem();\n break;\n case TAB:\n this.tabNavigation(event);\n break;\n default:\n this.focusKeyManager.onKeydown(event);\n }\n }\n\n private selectFocusedItem(): void {\n const focusedItem = this.focusKeyManager.activeItem;\n if (focusedItem) {\n this.select(focusedItem.value);\n }\n }\n\n private updateActiveItem(setFocus = true): void {\n const activeItem = this.radioItems.find((item) => item.value === this.value);\n if (activeItem) {\n this.focusKeyManager.setActiveItem(activeItem);\n } else if (this.radioItems.length > 0 && setFocus) {\n this.focusKeyManager.setFirstItemActive();\n }\n }\n\n private tabNavigation(event: KeyboardEvent): void {\n event.preventDefault();\n const checkedItem = this.radioItems.find((item) => item.checked);\n if (checkedItem) {\n checkedItem.focus();\n } else if (this.radioItems.first) {\n this.radioItems.first.focus();\n }\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { RdxRadioItemDirective } from './radio-item.directive';\nimport { RDX_RADIO_GROUP, RadioGroupDirective } from './radio-tokens';\n\n@Directive({\n selector: '[RadioIndicator]',\n exportAs: 'RadioIndicator',\n standalone: true,\n host: {\n '[attr.data-state]': 'radioItem.checked ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'radioItem.disabled ? \"\" : null'\n }\n})\nexport class RdxRadioIndicatorDirective {\n protected readonly radioGroup: RadioGroupDirective = inject(RDX_RADIO_GROUP);\n protected readonly radioItem: RdxRadioItemDirective = inject(RdxRadioItemDirective);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAeO,MAAM,eAAe,GAAG,IAAI,cAAc,CAAsB,eAAe,CAAC;;MCX1E,iBAAiB,GAAG,IAAI,cAAc,CAAwB,gBAAgB,EAAE;SAE7E,eAAe,GAAA;AAC3B,IAAA,OAAO,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACrC,CAAC;AAED;AACA,IAAI,YAAY,GAAG,CAAC,CAAC;MAmBR,qBAAqB,CAAA;AAjBlC,IAAA,WAAA,GAAA;AAkBqB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAC7C,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAE7B,QAAA,IAAA,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AAA,CAAA;sBAAX,KAAK;gBAEG,YAAY,EAAA,CAAA;sBAApB,KAAK;gBAca,aAAa,EAAA,CAAA;sBAA/B,MAAM;;;MCnDE,0BAA0B,CAAA;AATvC,IAAA,WAAA,GAAA;AAUuB,QAAA,IAAA,CAAA,UAAU,GAAwB,MAAM,CAAC,eAAe,CAAC,CAAC;AAC1D,QAAA,IAAA,CAAA,SAAS,GAA0B,MAAM,CAAC,qBAAqB,CAAC,CAAC;AACvF,KAAA;8GAHY,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,iDAAA,EAAA,oBAAA,EAAA,kCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBATtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,mBAAmB,EAAE,6CAA6C;AAClE,wBAAA,sBAAsB,EAAE,gCAAgC;AAC3D,qBAAA;AACJ,iBAAA,CAAA;;;ACZD;;AAEG;;;;"}
|
@@ -8,13 +8,13 @@ class RdxSeparatorRootDirective {
|
|
8
8
|
this.orientation = DEFAULT_ORIENTATION;
|
9
9
|
this.decorative = false;
|
10
10
|
}
|
11
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1
|
12
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.1
|
11
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSeparatorRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
12
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.1", type: RdxSeparatorRootDirective, isStandalone: true, selector: "div[rdxSeparatorRoot]", inputs: { orientation: "orientation", decorative: ["decorative", "decorative", booleanAttribute] }, host: { properties: { "attr.role": "decorative ? \"none\" : \"separator\"", "attr.aria-orientation": "!decorative && orientation === \"vertical\" ? \"vertical\" : null", "attr.data-orientation": "orientation" } }, ngImport: i0 }); }
|
13
13
|
}
|
14
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSeparatorRootDirective, decorators: [{
|
15
15
|
type: Directive,
|
16
16
|
args: [{
|
17
|
-
selector: 'div[
|
17
|
+
selector: 'div[rdxSeparatorRoot]',
|
18
18
|
standalone: true,
|
19
19
|
host: {
|
20
20
|
'[attr.role]': 'decorative ? "none" : "separator"',
|
@@ -24,11 +24,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImpor
|
|
24
24
|
}
|
25
25
|
}]
|
26
26
|
}], propDecorators: { orientation: [{
|
27
|
-
type: Input
|
28
|
-
args: ['rdxOrientation']
|
27
|
+
type: Input
|
29
28
|
}], decorative: [{
|
30
29
|
type: Input,
|
31
|
-
args: [{
|
30
|
+
args: [{ transform: booleanAttribute }]
|
32
31
|
}] } });
|
33
32
|
|
34
33
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-separator.mjs","sources":["../../../packages/primitives/separator/src/separator.directive.ts","../../../packages/primitives/separator/radix-ng-primitives-separator.ts"],"sourcesContent":["import { booleanAttribute, Directive, Input } from '@angular/core';\n\nconst DEFAULT_ORIENTATION = 'horizontal';\nconst ORIENTATIONS = ['horizontal', 'vertical'] as const;\n\nexport type Orientation = (typeof ORIENTATIONS)[number];\n\nexport interface SeparatorProps {\n /**\n * Either `vertical` or `horizontal`. Defaults to `horizontal`.\n */\n orientation?: Orientation;\n /**\n * Whether the component is purely decorative. When true, accessibility-related attributes\n * are updated so that the rendered element is removed from the accessibility tree.\n */\n decorative?: boolean;\n}\n\n@Directive({\n selector: 'div[
|
1
|
+
{"version":3,"file":"radix-ng-primitives-separator.mjs","sources":["../../../packages/primitives/separator/src/separator.directive.ts","../../../packages/primitives/separator/radix-ng-primitives-separator.ts"],"sourcesContent":["import { booleanAttribute, Directive, Input } from '@angular/core';\n\nconst DEFAULT_ORIENTATION = 'horizontal';\nconst ORIENTATIONS = ['horizontal', 'vertical'] as const;\n\nexport type Orientation = (typeof ORIENTATIONS)[number];\n\nexport interface SeparatorProps {\n /**\n * Either `vertical` or `horizontal`. Defaults to `horizontal`.\n */\n orientation?: Orientation;\n /**\n * Whether the component is purely decorative. When true, accessibility-related attributes\n * are updated so that the rendered element is removed from the accessibility tree.\n */\n decorative?: boolean;\n}\n\n@Directive({\n selector: 'div[rdxSeparatorRoot]',\n standalone: true,\n host: {\n '[attr.role]': 'decorative ? \"none\" : \"separator\"',\n // `aria-orientation` defaults to `horizontal` so we only need it if `orientation` is vertical\n '[attr.aria-orientation]': '!decorative && orientation === \"vertical\" ? \"vertical\" : null',\n '[attr.data-orientation]': 'orientation'\n }\n})\nexport class RdxSeparatorRootDirective implements SeparatorProps {\n @Input() orientation: Orientation = DEFAULT_ORIENTATION;\n\n @Input({ transform: booleanAttribute }) decorative = false;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,MAAM,mBAAmB,GAAG,YAAY,CAAC;AACzC,MAAM,YAAY,GAAG,CAAC,YAAY,EAAE,UAAU,CAAU,CAAC;MA0B5C,yBAAyB,CAAA;AAVtC,IAAA,WAAA,GAAA;QAWa,IAAW,CAAA,WAAA,GAAgB,mBAAmB,CAAC;QAEhB,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;AAC9D,KAAA;8GAJY,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAzB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,wIAGd,gBAAgB,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,uCAAA,EAAA,uBAAA,EAAA,mEAAA,EAAA,uBAAA,EAAA,aAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAH3B,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAVrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,aAAa,EAAE,mCAAmC;;AAElD,wBAAA,yBAAyB,EAAE,+DAA+D;AAC1F,wBAAA,yBAAyB,EAAE,aAAa;AAC3C,qBAAA;AACJ,iBAAA,CAAA;8BAEY,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBAEkC,UAAU,EAAA,CAAA;sBAAjD,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;;;AChC1C;;AAEG;;;;"}
|
@@ -61,13 +61,13 @@ class RdxSwitchRootDirective {
|
|
61
61
|
this._onChange?.(this.checked());
|
62
62
|
this.onCheckedChange.emit(this.checked());
|
63
63
|
}
|
64
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1
|
65
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.1
|
64
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSwitchRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
65
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.1", type: RdxSwitchRootDirective, isStandalone: true, selector: "button[rdxSwitchRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", onCheckedChange: "onCheckedChange" }, host: { attributes: { "role": "switch", "type": "button" }, listeners: { "focus": "_onTouched?.()", "click": "toggle()" }, properties: { "id": "elementId()", "attr.aria-checked": "checked()", "attr.aria-required": "required", "attr.data-state": "checked() ? \"checked\" : \"unchecked\"", "attr.data-disabled": "disabledState() ? \"true\" : null", "attr.disabled": "disabledState() ? disabledState() : null" } }, providers: [
|
66
66
|
{ provide: RdxSwitchToken, useExisting: RdxSwitchRootDirective },
|
67
67
|
{ provide: NG_VALUE_ACCESSOR, useExisting: RdxSwitchRootDirective, multi: true }
|
68
68
|
], exportAs: ["rdxSwitchRoot"], ngImport: i0 }); }
|
69
69
|
}
|
70
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSwitchRootDirective, decorators: [{
|
71
71
|
type: Directive,
|
72
72
|
args: [{
|
73
73
|
selector: 'button[rdxSwitchRoot]',
|
@@ -98,10 +98,10 @@ class RdxSwitchInputDirective {
|
|
98
98
|
constructor() {
|
99
99
|
this.switchRoot = injectSwitch();
|
100
100
|
}
|
101
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1
|
102
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1
|
101
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSwitchInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
102
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.1", type: RdxSwitchInputDirective, isStandalone: true, selector: "input[rdxSwitchInput]", host: { attributes: { "type": "checkbox", "tabindex": "-1" }, properties: { "attr.defaultChecked": "switchRoot.checked()", "attr.aria-checked": "switchRoot.checked()", "attr.aria-hidden": "true", "attr.aria-required": "switchRoot.required()", "attr.data-state": "switchRoot.checked() ? \"checked\" : \"unchecked\"", "attr.data-disabled": "switchRoot.disabledState() ? \"true\" : null", "attr.disabled": "switchRoot.disabledState() ? switchRoot.disabledState() : null", "attr.value": "switchRoot.checked() ? \"on\" : \"off\"" }, styleAttribute: "transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;" }, exportAs: ["rdxSwitchInput"], ngImport: i0 }); }
|
103
103
|
}
|
104
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1
|
104
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSwitchInputDirective, decorators: [{
|
105
105
|
type: Directive,
|
106
106
|
args: [{
|
107
107
|
selector: 'input[rdxSwitchInput]',
|
@@ -127,10 +127,10 @@ class RdxSwitchThumbDirective {
|
|
127
127
|
constructor() {
|
128
128
|
this.switchRoot = injectSwitch();
|
129
129
|
}
|
130
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1
|
131
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1
|
130
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSwitchThumbDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
131
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.1", type: RdxSwitchThumbDirective, isStandalone: true, selector: "span[rdxSwitchThumb]", host: { properties: { "attr.data-disabled": "switchRoot.disabledState() ? \"true\" : null", "attr.data-state": "switchRoot.checked() ? \"checked\" : \"unchecked\"" } }, exportAs: ["rdxSwitchThumb"], ngImport: i0 }); }
|
132
132
|
}
|
133
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSwitchThumbDirective, decorators: [{
|
134
134
|
type: Directive,
|
135
135
|
args: [{
|
136
136
|
selector: 'span[rdxSwitchThumb]',
|
@@ -149,15 +149,15 @@ const switchImports = [
|
|
149
149
|
RdxSwitchThumbDirective
|
150
150
|
];
|
151
151
|
class RdxSwitchModule {
|
152
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1
|
153
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1
|
152
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSwitchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
153
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.1", ngImport: i0, type: RdxSwitchModule, imports: [RdxSwitchRootDirective,
|
154
154
|
RdxSwitchInputDirective,
|
155
155
|
RdxSwitchThumbDirective], exports: [RdxSwitchRootDirective,
|
156
156
|
RdxSwitchInputDirective,
|
157
157
|
RdxSwitchThumbDirective] }); }
|
158
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1
|
158
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSwitchModule }); }
|
159
159
|
}
|
160
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1
|
160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSwitchModule, decorators: [{
|
161
161
|
type: NgModule,
|
162
162
|
args: [{
|
163
163
|
imports: [...switchImports],
|