@radix-ng/primitives 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/index.d.ts +3 -3
- package/accordion/src/accordion-content.directive.d.ts +1 -1
- package/accordion/src/accordion-header.directive.d.ts +1 -1
- package/accordion/src/accordion-item.directive.d.ts +1 -1
- package/accordion/src/accordion-root.directive.d.ts +1 -1
- package/accordion/src/accordion-trigger.directive.d.ts +1 -1
- package/alert-dialog/index.d.ts +2 -2
- package/avatar/index.d.ts +2 -2
- package/avatar/src/avatar-fallback.directive.d.ts +3 -3
- package/avatar/src/avatar-image.directive.d.ts +6 -6
- package/avatar/src/avatar-root.directive.d.ts +4 -4
- package/checkbox/index.d.ts +1 -1
- package/collapsible/index.d.ts +1 -1
- package/collapsible/src/collapsible-content.directive.d.ts +1 -1
- package/collapsible/src/collapsible-root.directive.d.ts +1 -1
- package/collapsible/src/collapsible-trigger.directive.d.ts +1 -1
- package/dropdown-menu/index.d.ts +8 -3
- package/dropdown-menu/src/dropdown-menu-content.directive.d.ts +12 -2
- package/dropdown-menu/src/dropdown-menu-item-checkbox.directive.d.ts +6 -0
- package/dropdown-menu/src/dropdown-menu-item-indicator.directive.d.ts +7 -0
- package/dropdown-menu/src/dropdown-menu-item-radio-group.directive.d.ts +12 -0
- package/dropdown-menu/src/dropdown-menu-item-radio.directive.d.ts +19 -0
- package/dropdown-menu/src/dropdown-menu-item-selectable.d.ts +14 -0
- package/dropdown-menu/src/dropdown-menu-item.directive.d.ts +13 -4
- package/dropdown-menu/src/dropdown-menu-label.directive.d.ts +1 -1
- package/dropdown-menu/src/dropdown-menu-separator.directive.d.ts +2 -2
- package/dropdown-menu/src/dropdown-menu-trigger.directive.d.ts +31 -1
- package/esm2022/accordion/index.mjs +4 -4
- package/esm2022/accordion/src/accordion-content.directive.mjs +7 -9
- package/esm2022/accordion/src/accordion-header.directive.mjs +5 -5
- package/esm2022/accordion/src/accordion-item.directive.mjs +17 -9
- package/esm2022/accordion/src/accordion-root.directive.mjs +5 -5
- package/esm2022/accordion/src/accordion-trigger.directive.mjs +5 -5
- package/esm2022/alert-dialog/index.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog-cancel.directive.mjs +4 -4
- package/esm2022/alert-dialog/src/alert-dialog-content.directive.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog-root.directive.mjs +5 -4
- package/esm2022/alert-dialog/src/alert-dialog-title.directive.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog-trigger.directive.mjs +4 -4
- package/esm2022/alert-dialog/src/alert-dialog.service.mjs +6 -9
- package/esm2022/avatar/index.mjs +1 -1
- package/esm2022/avatar/src/avatar-fallback.directive.mjs +6 -6
- package/esm2022/avatar/src/avatar-image.directive.mjs +6 -6
- package/esm2022/avatar/src/avatar-root.directive.mjs +6 -6
- package/esm2022/checkbox/index.mjs +2 -2
- package/esm2022/checkbox/src/checkbox-button.directive.mjs +5 -5
- package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +4 -4
- package/esm2022/checkbox/src/checkbox-input.directive.mjs +5 -5
- package/esm2022/checkbox/src/checkbox.directive.mjs +4 -4
- package/esm2022/checkbox/src/checkbox.token.mjs +1 -1
- package/esm2022/collapsible/index.mjs +2 -2
- package/esm2022/collapsible/src/collapsible-content.directive.mjs +13 -7
- package/esm2022/collapsible/src/collapsible-root.directive.mjs +5 -5
- package/esm2022/collapsible/src/collapsible-trigger.directive.mjs +5 -5
- package/esm2022/dropdown-menu/index.mjs +9 -4
- package/esm2022/dropdown-menu/src/dropdown-menu-content.directive.mjs +36 -10
- package/esm2022/dropdown-menu/src/dropdown-menu-item-checkbox.directive.mjs +26 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-indicator.directive.mjs +22 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-radio-group.directive.mjs +37 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-radio.directive.mjs +60 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-selectable.mjs +40 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item.directive.mjs +45 -16
- package/esm2022/dropdown-menu/src/dropdown-menu-label.directive.mjs +5 -5
- package/esm2022/dropdown-menu/src/dropdown-menu-separator.directive.mjs +8 -8
- package/esm2022/dropdown-menu/src/dropdown-menu-trigger.directive.mjs +128 -12
- package/esm2022/label/index.mjs +2 -2
- package/esm2022/label/src/label.directive.mjs +54 -0
- package/esm2022/menu/index.mjs +7 -7
- 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 +8 -4
- package/esm2022/menu/src/menu-label.directive.mjs +3 -3
- package/esm2022/menu/src/menu-separator.directive.mjs +4 -4
- package/esm2022/menubar/index.mjs +7 -7
- package/esm2022/menubar/src/menubar-content.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-item-checkbox.directive.mjs +4 -4
- package/esm2022/menubar/src/menubar-item-indicator.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-item-radio.directive.mjs +4 -4
- package/esm2022/menubar/src/menubar-item.directive.mjs +4 -4
- 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 +4 -4
- package/esm2022/menubar/src/menubar-trigger.directive.mjs +4 -4
- package/esm2022/progress/src/progress-indicator.directive.mjs +19 -9
- package/esm2022/progress/src/progress-root.directive.mjs +63 -7
- package/esm2022/radio/src/radio-indicator.directive.mjs +4 -4
- package/esm2022/radio/src/radio-item.directive.mjs +4 -8
- package/esm2022/radio/src/radio-root.directive.mjs +5 -9
- package/esm2022/separator/src/separator.directive.mjs +3 -3
- package/esm2022/switch/index.mjs +29 -4
- package/esm2022/switch/src/switch-input.directive.mjs +6 -6
- package/esm2022/switch/src/switch-root.directive.mjs +7 -7
- package/esm2022/switch/src/switch-thumb.directive.mjs +6 -6
- package/esm2022/tabs/index.mjs +7 -7
- package/esm2022/tabs/src/tabs-content.directive.mjs +5 -5
- package/esm2022/tabs/src/tabs-context.service.mjs +3 -3
- package/esm2022/tabs/src/tabs-list.directive.mjs +5 -5
- package/esm2022/tabs/src/tabs-root.directive.mjs +5 -5
- package/esm2022/tabs/src/tabs-trigger.directive.mjs +5 -5
- package/esm2022/toggle/index.mjs +2 -2
- package/esm2022/toggle/src/toggle.directive.mjs +39 -0
- package/esm2022/toggle-group/src/toggle-group-button.directive.mjs +6 -14
- package/esm2022/toggle-group/src/toggle-group-button.token.mjs +1 -1
- package/esm2022/toggle-group/src/toggle-group-multi.directive.mjs +6 -32
- package/esm2022/toggle-group/src/toggle-group.directive.mjs +5 -25
- package/esm2022/toggle-group/src/toggle-group.token.mjs +1 -1
- package/fesm2022/radix-ng-primitives-accordion.mjs +73 -67
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +49 -51
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +15 -15
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +43 -43
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +20 -14
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +381 -46
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-label.mjs +17 -10
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +26 -22
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +31 -31
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +80 -14
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +10 -14
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +3 -3
- package/fesm2022/radix-ng-primitives-switch.mjs +53 -31
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +23 -23
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +14 -64
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +18 -28
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/label/index.d.ts +1 -1
- package/label/src/label.directive.d.ts +23 -0
- package/menu/index.d.ts +2 -2
- package/menubar/index.d.ts +2 -2
- package/package.json +1 -7
- package/progress/src/progress-indicator.directive.d.ts +12 -2
- package/progress/src/progress-root.directive.d.ts +38 -4
- package/radio/src/radio-item.directive.d.ts +1 -2
- package/radio/src/radio-root.directive.d.ts +1 -2
- package/switch/index.d.ts +11 -3
- package/switch/src/switch-input.directive.d.ts +1 -1
- package/switch/src/switch-root.directive.d.ts +1 -1
- package/switch/src/switch-thumb.directive.d.ts +1 -1
- package/tabs/index.d.ts +2 -2
- package/tabs/src/tabs-content.directive.d.ts +1 -1
- package/tabs/src/tabs-list.directive.d.ts +1 -1
- package/tabs/src/tabs-root.directive.d.ts +1 -1
- package/tabs/src/tabs-trigger.directive.d.ts +1 -1
- package/toggle/index.d.ts +2 -2
- package/toggle/src/toggle.directive.d.ts +30 -0
- package/toggle-group/src/toggle-group-button.directive.d.ts +1 -7
- package/toggle-group/src/toggle-group-multi.directive.d.ts +3 -13
- package/toggle-group/src/toggle-group.directive.d.ts +3 -9
- package/esm2022/label/src/label-root.directive.mjs +0 -47
- package/esm2022/roving-focus/index.mjs +0 -3
- package/esm2022/roving-focus/radix-ng-primitives-roving-focus.mjs +0 -5
- package/esm2022/roving-focus/src/roving-focus-group.directive.mjs +0 -109
- package/esm2022/roving-focus/src/roving-focus-item.directive.mjs +0 -86
- package/esm2022/toggle/src/toggle-root.directive.mjs +0 -49
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +0 -198
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +0 -1
- package/label/src/label-root.directive.d.ts +0 -14
- package/roving-focus/README.md +0 -1
- package/roving-focus/index.d.ts +0 -2
- package/roving-focus/src/roving-focus-group.directive.d.ts +0 -53
- package/roving-focus/src/roving-focus-item.directive.d.ts +0 -50
- package/toggle/src/toggle-root.directive.d.ts +0 -32
@@ -4,24 +4,60 @@ import { InjectionToken, inject, numberAttribute, Directive, Input } from '@angu
|
|
4
4
|
let idIterator = 0;
|
5
5
|
const MIN_PERCENT = 0;
|
6
6
|
const DEFAULT_MAX = 100;
|
7
|
+
const PROGRESS_NAME = 'Radix Progress';
|
7
8
|
const RdxProgressToken = new InjectionToken('RdxProgressDirective');
|
9
|
+
/**
|
10
|
+
* Injects the current instance of RdxProgressRootDirective.
|
11
|
+
* @returns The instance of RdxProgressRootDirective.
|
12
|
+
*/
|
8
13
|
function injectProgress() {
|
9
14
|
return inject(RdxProgressToken);
|
10
15
|
}
|
16
|
+
/**
|
17
|
+
* Directive to manage progress bar state and attributes.
|
18
|
+
*
|
19
|
+
* This directive provides a way to create a progress bar with customizable value and max attributes.
|
20
|
+
* It handles aria attributes for accessibility and provides different states like 'indeterminate', 'complete', and 'loading'.
|
21
|
+
*/
|
11
22
|
class RdxProgressRootDirective {
|
12
23
|
constructor() {
|
24
|
+
/**
|
25
|
+
* The unique ID for the progress bar.
|
26
|
+
* @default 'rdx-progress-bar-{idIterator}'
|
27
|
+
*/
|
13
28
|
this.id = `rdx-progress-bar-${idIterator++}`;
|
29
|
+
/**
|
30
|
+
* The current value of the progress bar.
|
31
|
+
* @default 0
|
32
|
+
*/
|
14
33
|
this.value = MIN_PERCENT;
|
15
34
|
/**
|
35
|
+
* The maximum value of the progress bar.
|
16
36
|
* @default 100
|
17
37
|
*/
|
18
38
|
this.max = DEFAULT_MAX;
|
39
|
+
/**
|
40
|
+
* Function to generate the value label.
|
41
|
+
*/
|
19
42
|
this.valueLabel = (value, max) => this.defaultGetValueLabel(value, max);
|
20
43
|
}
|
44
|
+
/**
|
45
|
+
* Lifecycle hook that is called when any data-bound property of a directive changes.
|
46
|
+
* @param changes - The changed properties.
|
47
|
+
* @ignore
|
48
|
+
*/
|
49
|
+
ngOnChanges(changes) {
|
50
|
+
if (changes['max'] && !this.isValidMaxNumber(this.max)) {
|
51
|
+
console.error(this.getInvalidMaxError(`${this.max}`, PROGRESS_NAME));
|
52
|
+
}
|
53
|
+
if (changes['value'] && this.value !== null && !this.isValidValueNumber(this.value, this.max)) {
|
54
|
+
console.error(this.getInvalidValueError(`${this.value}`, PROGRESS_NAME));
|
55
|
+
}
|
56
|
+
}
|
21
57
|
/**
|
22
58
|
* Get the state of the progress bar.
|
23
59
|
* @returns 'indeterminate' | 'loading' | 'complete'
|
24
|
-
* @
|
60
|
+
* @ignore
|
25
61
|
*/
|
26
62
|
get state() {
|
27
63
|
return this.getProgressState(this.value, this.max);
|
@@ -32,19 +68,39 @@ class RdxProgressRootDirective {
|
|
32
68
|
defaultGetValueLabel(value, max) {
|
33
69
|
return `${Math.round((value / max) * 100)}%`;
|
34
70
|
}
|
35
|
-
|
36
|
-
|
71
|
+
isValidMaxNumber(max) {
|
72
|
+
return this.isNumber(max) && !isNaN(max) && max > 0;
|
73
|
+
}
|
74
|
+
isNumber(value) {
|
75
|
+
return typeof value === 'number';
|
76
|
+
}
|
77
|
+
isValidValueNumber(value, max) {
|
78
|
+
return this.isNumber(value) && !isNaN(value) && value <= max && value >= 0;
|
79
|
+
}
|
80
|
+
getInvalidMaxError(propValue, componentName) {
|
81
|
+
return `Invalid prop \`max\` of value \`${propValue}\` supplied to \`${componentName}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${DEFAULT_MAX}\`.`;
|
82
|
+
}
|
83
|
+
getInvalidValueError(propValue, componentName) {
|
84
|
+
return `Invalid prop \`value\` of value \`${propValue}\` supplied to \`${componentName}\`. The \`value\` prop must be:
|
85
|
+
- a positive number
|
86
|
+
- less than the value passed to \`max\` (or ${DEFAULT_MAX} if no \`max\` prop is set)
|
87
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
88
|
+
|
89
|
+
Defaulting to \`null\`.`;
|
90
|
+
}
|
91
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxProgressRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
92
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.1.2", type: RdxProgressRootDirective, isStandalone: true, selector: "div[rdxProgressRoot]", inputs: { id: "id", value: ["rdxValue", "value", numberAttribute], max: ["rdxMax", "max", numberAttribute], valueLabel: ["rdxValueLabel", "valueLabel"] }, host: { attributes: { "role": "progressbar", "tabindex": "-1" }, properties: { "id": "id", "attr.aria-valuemax": "max", "attr.aria-valuemin": "0", "attr.aria-valuenow": "value", "attr.aria-valuetext": "valueLabel(value, max)", "attr.data-state": "state", "attr.data-value": "value", "attr.data-max": "max" } }, providers: [{ provide: RdxProgressToken, useExisting: RdxProgressRootDirective }], exportAs: ["ProgressRoot"], usesOnChanges: true, ngImport: i0 }); }
|
37
93
|
}
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.
|
94
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxProgressRootDirective, decorators: [{
|
39
95
|
type: Directive,
|
40
96
|
args: [{
|
41
|
-
selector: 'div[
|
97
|
+
selector: 'div[rdxProgressRoot]',
|
42
98
|
exportAs: 'ProgressRoot',
|
43
99
|
standalone: true,
|
44
100
|
providers: [{ provide: RdxProgressToken, useExisting: RdxProgressRootDirective }],
|
45
101
|
host: {
|
46
102
|
role: 'progressbar',
|
47
|
-
'[
|
103
|
+
'[id]': 'id',
|
48
104
|
'[attr.aria-valuemax]': 'max',
|
49
105
|
'[attr.aria-valuemin]': '0',
|
50
106
|
'[attr.aria-valuenow]': 'value',
|
@@ -70,23 +126,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImpor
|
|
70
126
|
args: ['rdxValueLabel']
|
71
127
|
}] } });
|
72
128
|
|
129
|
+
/**
|
130
|
+
* Directive to manage progress indicator state and attributes.
|
131
|
+
*
|
132
|
+
* This directive is used to display the progress indicator inside the progress bar.
|
133
|
+
* It inherits the state and value from the `RdxProgressRootDirective`.
|
134
|
+
*/
|
73
135
|
class RdxProgressIndicatorDirective {
|
74
136
|
constructor() {
|
75
|
-
|
137
|
+
/**
|
138
|
+
*
|
139
|
+
* This allows the directive to access the progress bar state and values.
|
140
|
+
*/
|
141
|
+
this.progress = injectProgress();
|
76
142
|
}
|
77
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.
|
78
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.
|
143
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxProgressIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
144
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.2", type: RdxProgressIndicatorDirective, isStandalone: true, selector: "div[rdxProgressIndicator]", host: { properties: { "attr.data-state": "progress.state", "attr.data-value": "progress.value", "attr.data-max": "progress.max" } }, exportAs: ["ProgressIndicator"], ngImport: i0 }); }
|
79
145
|
}
|
80
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxProgressIndicatorDirective, decorators: [{
|
81
147
|
type: Directive,
|
82
148
|
args: [{
|
83
|
-
selector: 'div[
|
149
|
+
selector: 'div[rdxProgressIndicator]',
|
84
150
|
exportAs: 'ProgressIndicator',
|
85
151
|
standalone: true,
|
86
152
|
host: {
|
87
|
-
'[attr.data-state]': '
|
88
|
-
'[attr.data-value]': '
|
89
|
-
'[attr.data-max]': '
|
153
|
+
'[attr.data-state]': 'progress.state',
|
154
|
+
'[attr.data-value]': 'progress.value',
|
155
|
+
'[attr.data-max]': 'progress.max'
|
90
156
|
}
|
91
157
|
}]
|
92
158
|
}] });
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-progress.mjs","sources":["../../../packages/primitives/progress/src/progress-root.directive.ts","../../../packages/primitives/progress/src/progress-indicator.directive.ts","../../../packages/primitives/progress/radix-ng-primitives-progress.ts"],"sourcesContent":["import { Directive, inject, InjectionToken, Input, numberAttribute } from '@angular/core';\n\nlet idIterator = 0;\n\nconst MIN_PERCENT = 0;\nconst DEFAULT_MAX = 100;\n\nconst RdxProgressToken = new InjectionToken<RdxProgressRootDirective>('RdxProgressDirective');\n\nexport function injectProgress(): RdxProgressRootDirective {\n return inject(RdxProgressToken);\n}\n\nexport type ProgressState = 'indeterminate' | 'loading' | 'complete';\n\nexport interface ProgressProps {\n value?: number | null | undefined;\n max?: number;\n getValueLabel?: string;\n}\n\n@Directive({\n selector: 'div[ProgressRoot]',\n exportAs: 'ProgressRoot',\n standalone: true,\n providers: [{ provide: RdxProgressToken, useExisting: RdxProgressRootDirective }],\n host: {\n role: 'progressbar',\n '[attr.id]': 'id',\n '[attr.aria-valuemax]': 'max',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuenow]': 'value',\n '[attr.aria-valuetext]': 'valueLabel(value, max)',\n '[attr.data-state]': 'state',\n '[attr.data-value]': 'value',\n '[attr.data-max]': 'max',\n // set tab index to -1 so screen readers will read the aria-label\n // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox\n tabindex: '-1'\n }\n})\nexport class RdxProgressRootDirective implements ProgressProps {\n @Input() id = `rdx-progress-bar-${idIterator++}`;\n\n @Input({ alias: 'rdxValue', transform: numberAttribute }) value = MIN_PERCENT;\n\n /**\n * @default 100\n */\n @Input({ alias: 'rdxMax', transform: numberAttribute }) max = DEFAULT_MAX;\n\n @Input('rdxValueLabel') valueLabel: (value: number, max: number) => string = (value, max) =>\n this.defaultGetValueLabel(value, max);\n\n /**\n * Get the state of the progress bar.\n * @returns 'indeterminate' | 'loading' | 'complete'\n * @internal\n */\n get state(): ProgressState {\n return this.getProgressState(this.value, this.max);\n }\n\n private getProgressState(value: number | undefined | null, maxValue: number): ProgressState {\n return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading';\n }\n\n private defaultGetValueLabel(value: number, max: number) {\n return `${Math.round((value / max) * 100)}%`;\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { injectProgress } from './progress-root.directive';\n\n@Directive({\n selector: 'div[ProgressIndicator]',\n exportAs: 'ProgressIndicator',\n standalone: true,\n host: {\n '[attr.data-state]': '_progress.state',\n '[attr.data-value]': '_progress.value',\n '[attr.data-max]': '_progress.max'\n }\n})\nexport class RdxProgressIndicatorDirective {\n readonly _progress = injectProgress();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,IAAI,UAAU,GAAG,CAAC,CAAC;AAEnB,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAA2B,sBAAsB,CAAC,CAAC;SAE9E,cAAc,GAAA;AAC1B,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACp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A;sBAAjC,KAAK;uBAAC,eAAe,CAAA;;;MCrCb,6BAA6B,CAAA;AAV1C,IAAA,WAAA,GAAA;QAWa,IAAS,CAAA,SAAA,GAAG,cAAc,EAAE,CAAC;AACzC,KAAA;8GAFY,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAA7B,6BAA6B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,eAAA,EAAA,eAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAA7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAVzC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,mBAAmB,EAAE,iBAAiB;AACtC,wBAAA,mBAAmB,EAAE,iBAAiB;AACtC,wBAAA,iBAAiB,EAAE,eAAe;AACrC,qBAAA;AACJ,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"radix-ng-primitives-progress.mjs","sources":["../../../packages/primitives/progress/src/progress-root.directive.ts","../../../packages/primitives/progress/src/progress-indicator.directive.ts","../../../packages/primitives/progress/radix-ng-primitives-progress.ts"],"sourcesContent":["import { Directive, inject, InjectionToken, Input, numberAttribute, OnChanges, SimpleChanges } from '@angular/core';\n\nlet idIterator = 0;\n\nconst MIN_PERCENT = 0;\nconst DEFAULT_MAX = 100;\nconst PROGRESS_NAME = 'Radix Progress';\n\nconst RdxProgressToken = new InjectionToken<RdxProgressRootDirective>('RdxProgressDirective');\n\n/**\n * Injects the current instance of RdxProgressRootDirective.\n * @returns The instance of RdxProgressRootDirective.\n */\nexport function injectProgress(): RdxProgressRootDirective {\n return inject(RdxProgressToken);\n}\n\nexport type ProgressState = 'indeterminate' | 'complete' | 'loading';\n\nexport interface ProgressProps {\n value?: number | null | undefined;\n max?: number;\n getValueLabel?: string;\n}\n\n/**\n * Directive to manage progress bar state and attributes.\n *\n * This directive provides a way to create a progress bar with customizable value and max attributes.\n * It handles aria attributes for accessibility and provides different states like 'indeterminate', 'complete', and 'loading'.\n */\n@Directive({\n selector: 'div[rdxProgressRoot]',\n exportAs: 'ProgressRoot',\n standalone: true,\n providers: [{ provide: RdxProgressToken, useExisting: RdxProgressRootDirective }],\n host: {\n role: 'progressbar',\n '[id]': 'id',\n '[attr.aria-valuemax]': 'max',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuenow]': 'value',\n '[attr.aria-valuetext]': 'valueLabel(value, max)',\n '[attr.data-state]': 'state',\n '[attr.data-value]': 'value',\n '[attr.data-max]': 'max',\n // set tab index to -1 so screen readers will read the aria-label\n // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox\n tabindex: '-1'\n }\n})\nexport class RdxProgressRootDirective implements ProgressProps, OnChanges {\n /**\n * The unique ID for the progress bar.\n * @default 'rdx-progress-bar-{idIterator}'\n */\n @Input() id = `rdx-progress-bar-${idIterator++}`;\n\n /**\n * The current value of the progress bar.\n * @default 0\n */\n @Input({ alias: 'rdxValue', transform: numberAttribute }) value = MIN_PERCENT;\n\n /**\n * The maximum value of the progress bar.\n * @default 100\n */\n @Input({ alias: 'rdxMax', transform: numberAttribute }) max = DEFAULT_MAX;\n\n /**\n * Function to generate the value label.\n */\n @Input('rdxValueLabel') valueLabel: (value: number, max: number) => string = (value, max) =>\n this.defaultGetValueLabel(value, max);\n\n /**\n * Lifecycle hook that is called when any data-bound property of a directive changes.\n * @param changes - The changed properties.\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges) {\n if (changes['max'] && !this.isValidMaxNumber(this.max)) {\n console.error(this.getInvalidMaxError(`${this.max}`, PROGRESS_NAME));\n }\n\n if (changes['value'] && this.value !== null && !this.isValidValueNumber(this.value, this.max)) {\n console.error(this.getInvalidValueError(`${this.value}`, PROGRESS_NAME));\n }\n }\n\n /**\n * Get the state of the progress bar.\n * @returns 'indeterminate' | 'loading' | 'complete'\n * @ignore\n */\n get state(): ProgressState {\n return this.getProgressState(this.value, this.max);\n }\n\n private getProgressState(value: number | undefined | null, maxValue: number): ProgressState {\n return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading';\n }\n\n private defaultGetValueLabel(value: number, max: number) {\n return `${Math.round((value / max) * 100)}%`;\n }\n\n private isValidMaxNumber(max: unknown): max is number {\n return this.isNumber(max) && !isNaN(max) && max > 0;\n }\n\n private isNumber(value: unknown): value is number {\n return typeof value === 'number';\n }\n\n private isValidValueNumber(value: unknown, max: number): value is number {\n return this.isNumber(value) && !isNaN(value) && value <= max && value >= 0;\n }\n\n private getInvalidMaxError(propValue: string, componentName: string): string {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`;\n }\n\n private getInvalidValueError(propValue: string, componentName: string): string {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` or \\`undefined\\` if the progress is indeterminate.\n\n Defaulting to \\`null\\`.`;\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectProgress } from './progress-root.directive';\n\n/**\n * Directive to manage progress indicator state and attributes.\n *\n * This directive is used to display the progress indicator inside the progress bar.\n * It inherits the state and value from the `RdxProgressRootDirective`.\n */\n@Directive({\n selector: 'div[rdxProgressIndicator]',\n exportAs: 'ProgressIndicator',\n standalone: true,\n host: {\n '[attr.data-state]': 'progress.state',\n '[attr.data-value]': 'progress.value',\n '[attr.data-max]': 'progress.max'\n }\n})\nexport class RdxProgressIndicatorDirective {\n /**\n *\n * This allows the directive to access the progress bar state and values.\n */\n protected readonly progress = injectProgress();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,IAAI,UAAU,GAAG,CAAC,CAAC;AAEnB,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAA2B,sBAAsB,CAAC,CAAC;AAE9F;;;AAGG;SACa,cAAc,GAAA;AAC1B,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACpC,CAAC;AAUD;;;;;AAKG;MAqBU,wBAAwB,CAAA;AApBrC,IAAA,WAAA,GAAA;AAqBI;;;AAGG;AACM,QAAA,IAAA,CAAA,EAAE,GAAG,CAAA,iBAAA,EAAoB,UAAU,EAAE,EAAE,CAAC;AAEjD;;;AAGG;QACuD,IAAK,CAAA,KAAA,GAAG,WAAW,CAAC;AAE9E;;;AAGG;QACqD,IAAG,CAAA,GAAA,GAAG,WAAW,CAAC;AAE1E;;AAEG;AACqB,QAAA,IAAA,CAAA,UAAU,GAA2C,CAAC,KAAK,EAAE,GAAG,KACpF,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AA0D7C,KAAA;AAxDG;;;;AAIG;AACH,IAAA,WAAW,CAAC,OAAsB,EAAA;AAC9B,QAAA,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AACpD,YAAA,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA,EAAG,IAAI,CAA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,eAAA,EAAA,cAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAA7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAVzC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,2BAA2B;AACrC,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,mBAAmB,EAAE,gBAAgB;AACrC,wBAAA,mBAAmB,EAAE,gBAAgB;AACrC,wBAAA,iBAAiB,EAAE,cAAc;AACpC,qBAAA;AACJ,iBAAA,CAAA;;;AClBD;;AAEG;;;;"}
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { InjectionToken, inject, EventEmitter, booleanAttribute, Directive, Input, Output } from '@angular/core';
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
4
|
-
import * as i1 from '@radix-ng/primitives/roving-focus';
|
5
|
-
import { RdxRovingFocusGroupDirective, RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';
|
6
4
|
|
7
5
|
const RdxRadioGroupToken = new InjectionToken('RdxRadioGroupToken');
|
8
6
|
function injectRadioGroup() {
|
@@ -66,13 +64,13 @@ class RdxRadioGroupDirective {
|
|
66
64
|
_onFocusout() {
|
67
65
|
this.onTouched?.();
|
68
66
|
}
|
69
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.
|
70
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.
|
67
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxRadioGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
68
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.1.2", type: RdxRadioGroupDirective, isStandalone: true, selector: "div[RadioRoot]", inputs: { value: "value", disabled: ["disabled", "disabled", booleanAttribute], dir: "dir" }, outputs: { onValueChange: "onValueChange" }, host: { attributes: { "role": "radiogroup" }, listeners: { "focusout": "_onFocusout()" }, properties: { "attr.aria-orientation": "_orientation", "attr.data-disabled": "disabled ? \"\" : null", "attr.dir": "dir" } }, providers: [
|
71
69
|
{ provide: RdxRadioGroupToken, useExisting: RdxRadioGroupDirective },
|
72
70
|
{ provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }
|
73
|
-
], exportAs: ["RadioRoot"],
|
71
|
+
], exportAs: ["RadioRoot"], ngImport: i0 }); }
|
74
72
|
}
|
75
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxRadioGroupDirective, decorators: [{
|
76
74
|
type: Directive,
|
77
75
|
args: [{
|
78
76
|
selector: 'div[RadioRoot]',
|
@@ -82,7 +80,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImpor
|
|
82
80
|
{ provide: RdxRadioGroupToken, useExisting: RdxRadioGroupDirective },
|
83
81
|
{ provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }
|
84
82
|
],
|
85
|
-
hostDirectives: [RdxRovingFocusGroupDirective],
|
86
83
|
host: {
|
87
84
|
role: 'radiogroup',
|
88
85
|
'[attr.aria-orientation]': '_orientation',
|
@@ -126,16 +123,15 @@ class RdxRadioItemDirective {
|
|
126
123
|
_onClick() {
|
127
124
|
this.radioGroup.select(this.value);
|
128
125
|
}
|
129
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.
|
130
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.
|
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 }); }
|
131
128
|
}
|
132
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxRadioItemDirective, decorators: [{
|
133
130
|
type: Directive,
|
134
131
|
args: [{
|
135
132
|
selector: '[RadioItem]',
|
136
133
|
exportAs: 'RadioItem',
|
137
134
|
standalone: true,
|
138
|
-
hostDirectives: [RdxRovingFocusItemDirective],
|
139
135
|
providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }],
|
140
136
|
host: {
|
141
137
|
type: 'button',
|
@@ -164,10 +160,10 @@ class RdxRadioIndicatorDirective {
|
|
164
160
|
this.radioGroup = injectRadioGroup();
|
165
161
|
this.radioItem = injectRadioItem();
|
166
162
|
}
|
167
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.
|
168
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.
|
163
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxRadioIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
164
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.2", type: RdxRadioIndicatorDirective, isStandalone: true, selector: "[RadioIndicator]", host: { properties: { "attr.data-state": "radioGroup.value === this.radioItem.value ? \"checked\" : \"unchecked\"", "attr.data-disabled": "radioItem.disabled ? \"\" : null" } }, exportAs: ["RadioIndicator"], ngImport: i0 }); }
|
169
165
|
}
|
170
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.
|
166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxRadioIndicatorDirective, decorators: [{
|
171
167
|
type: Directive,
|
172
168
|
args: [{
|
173
169
|
selector: '[RadioIndicator]',
|
@@ -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 {\n booleanAttribute,\n Directive,\n EventEmitter,\n inject,\n InjectionToken,\n Input,\n Output\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n// eslint-disable-next-line @nx/enforce-module-boundaries\nimport { RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\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 hostDirectives: [RdxRovingFocusGroupDirective],\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';\n\n// eslint-disable-next-line @nx/enforce-module-boundaries\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\n\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 hostDirectives: [RdxRovingFocusItemDirective],\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';\n\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":";;;;;;MAca,kBAAkB,GAAG,IAAI,cAAc,CAAyB,oBAAoB,EAAE;SAEnF,gBAAgB,GAAA;AAC5B,IAAA,OAAO,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACtC,CAAC;MA8BY,sBAAsB,CAAA;AAlBnC,IAAA,WAAA,GAAA;QAqB4C,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,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/B,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC;KAC1B;AAED;;;;AAIG;AACH,IAAA,UAAU,CAAC,KAAa,EAAA;AACpB,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;KACtB;AAED;;;;AAIG;AACH,IAAA,gBAAgB,CAAC,EAA2B,EAAA;AACxC,QAAA,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;KACtB;AAED,IAAA,iBAAiB,CAAC,EAAc,EAAA;AAC5B,QAAA,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;KACvB;AAED;;;;AAIG;AACH,IAAA,gBAAg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,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;;;ACbD;;AAEG;;;;"}
|
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,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;
|
10
10
|
}
|
11
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.
|
12
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.
|
11
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxSeparatorRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
12
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.1.2", type: RdxSeparatorRootDirective, isStandalone: true, selector: "div[SeparatorRoot]", inputs: { orientation: ["rdxOrientation", "orientation"], decorative: ["rdxDecorative", "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.
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxSeparatorRootDirective, decorators: [{
|
15
15
|
type: Directive,
|
16
16
|
args: [{
|
17
17
|
selector: 'div[SeparatorRoot]',
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { InjectionToken, inject, input, computed, booleanAttribute, model, EventEmitter, Directive, Output } from '@angular/core';
|
2
|
+
import { InjectionToken, inject, input, computed, booleanAttribute, model, EventEmitter, Directive, Output, NgModule } from '@angular/core';
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
4
4
|
|
5
5
|
const RdxSwitchToken = new InjectionToken('RdxSwitchToken');
|
@@ -61,17 +61,17 @@ 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.
|
65
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.
|
64
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxSwitchRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
65
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.1.2", 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
|
-
], exportAs: ["
|
68
|
+
], exportAs: ["rdxSwitchRoot"], ngImport: i0 }); }
|
69
69
|
}
|
70
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxSwitchRootDirective, decorators: [{
|
71
71
|
type: Directive,
|
72
72
|
args: [{
|
73
|
-
selector: 'button[
|
74
|
-
exportAs: '
|
73
|
+
selector: 'button[rdxSwitchRoot]',
|
74
|
+
exportAs: 'rdxSwitchRoot',
|
75
75
|
standalone: true,
|
76
76
|
providers: [
|
77
77
|
{ provide: RdxSwitchToken, useExisting: RdxSwitchRootDirective },
|
@@ -94,58 +94,80 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImpor
|
|
94
94
|
type: Output
|
95
95
|
}] } });
|
96
96
|
|
97
|
-
class
|
97
|
+
class RdxSwitchInputDirective {
|
98
98
|
constructor() {
|
99
99
|
this.switchRoot = injectSwitch();
|
100
100
|
}
|
101
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.
|
102
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.
|
101
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxSwitchInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
102
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.2", 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.
|
104
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxSwitchInputDirective, decorators: [{
|
105
105
|
type: Directive,
|
106
106
|
args: [{
|
107
|
-
selector: '
|
108
|
-
exportAs: '
|
107
|
+
selector: 'input[rdxSwitchInput]',
|
108
|
+
exportAs: 'rdxSwitchInput',
|
109
109
|
standalone: true,
|
110
110
|
host: {
|
111
|
+
type: 'checkbox',
|
112
|
+
tabindex: '-1',
|
113
|
+
'[attr.defaultChecked]': 'switchRoot.checked()',
|
114
|
+
'[attr.aria-checked]': 'switchRoot.checked()',
|
115
|
+
'[attr.aria-hidden]': 'true',
|
116
|
+
'[attr.aria-required]': 'switchRoot.required()',
|
117
|
+
'[attr.data-state]': 'switchRoot.checked() ? "checked" : "unchecked"',
|
111
118
|
'[attr.data-disabled]': 'switchRoot.disabledState() ? "true" : null',
|
112
|
-
'[attr.
|
119
|
+
'[attr.disabled]': 'switchRoot.disabledState() ? switchRoot.disabledState() : null',
|
120
|
+
'[attr.value]': 'switchRoot.checked() ? "on" : "off"',
|
121
|
+
style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;'
|
113
122
|
}
|
114
123
|
}]
|
115
124
|
}] });
|
116
125
|
|
117
|
-
class
|
126
|
+
class RdxSwitchThumbDirective {
|
118
127
|
constructor() {
|
119
128
|
this.switchRoot = injectSwitch();
|
120
129
|
}
|
121
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.
|
122
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.
|
130
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxSwitchThumbDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
131
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.2", 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 }); }
|
123
132
|
}
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxSwitchThumbDirective, decorators: [{
|
125
134
|
type: Directive,
|
126
135
|
args: [{
|
127
|
-
selector: '
|
128
|
-
exportAs: '
|
136
|
+
selector: 'span[rdxSwitchThumb]',
|
137
|
+
exportAs: 'rdxSwitchThumb',
|
129
138
|
standalone: true,
|
130
139
|
host: {
|
131
|
-
type: 'checkbox',
|
132
|
-
tabindex: '-1',
|
133
|
-
'[attr.defaultChecked]': 'switchRoot.checked()',
|
134
|
-
'[attr.aria-checked]': 'switchRoot.checked()',
|
135
|
-
'[attr.aria-hidden]': 'true',
|
136
|
-
'[attr.aria-required]': 'switchRoot.required()',
|
137
|
-
'[attr.data-state]': 'switchRoot.checked() ? "checked" : "unchecked"',
|
138
140
|
'[attr.data-disabled]': 'switchRoot.disabledState() ? "true" : null',
|
139
|
-
'[attr.
|
140
|
-
'[attr.value]': 'switchRoot.checked() ? "on" : "off"',
|
141
|
-
style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;'
|
141
|
+
'[attr.data-state]': 'switchRoot.checked() ? "checked" : "unchecked"'
|
142
142
|
}
|
143
143
|
}]
|
144
144
|
}] });
|
145
145
|
|
146
|
+
const switchImports = [
|
147
|
+
RdxSwitchRootDirective,
|
148
|
+
RdxSwitchInputDirective,
|
149
|
+
RdxSwitchThumbDirective
|
150
|
+
];
|
151
|
+
class RdxSwitchModule {
|
152
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxSwitchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
153
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.2", ngImport: i0, type: RdxSwitchModule, imports: [RdxSwitchRootDirective,
|
154
|
+
RdxSwitchInputDirective,
|
155
|
+
RdxSwitchThumbDirective], exports: [RdxSwitchRootDirective,
|
156
|
+
RdxSwitchInputDirective,
|
157
|
+
RdxSwitchThumbDirective] }); }
|
158
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxSwitchModule }); }
|
159
|
+
}
|
160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxSwitchModule, decorators: [{
|
161
|
+
type: NgModule,
|
162
|
+
args: [{
|
163
|
+
imports: [...switchImports],
|
164
|
+
exports: [...switchImports]
|
165
|
+
}]
|
166
|
+
}] });
|
167
|
+
|
146
168
|
/**
|
147
169
|
* Generated bundle index. Do not edit.
|
148
170
|
*/
|
149
171
|
|
150
|
-
export { RdxSwitchInputDirective, RdxSwitchRootDirective, RdxSwitchThumbDirective, RdxSwitchToken, injectSwitch };
|
172
|
+
export { RdxSwitchInputDirective, RdxSwitchModule, RdxSwitchRootDirective, RdxSwitchThumbDirective, RdxSwitchToken, injectSwitch };
|
151
173
|
//# sourceMappingURL=radix-ng-primitives-switch.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../../../packages/primitives/switch/src/switch-root.directive.ts","../../../packages/primitives/switch/src/switch-thumb.directive.ts","../../../packages/primitives/switch/src/switch-input.directive.ts","../../../packages/primitives/switch/radix-ng-primitives-switch.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n EventEmitter,\n inject,\n InjectionToken,\n input,\n InputSignalWithTransform,\n model,\n ModelSignal,\n Output\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport const RdxSwitchToken = new InjectionToken<RdxSwitchRootDirective>('RdxSwitchToken');\n\nexport function injectSwitch(): RdxSwitchRootDirective {\n return inject(RdxSwitchToken);\n}\n\nexport interface SwitchProps {\n checked?: ModelSignal<boolean>;\n defaultChecked?: boolean;\n required?: InputSignalWithTransform<boolean, BooleanInput>;\n onCheckedChange?: EventEmitter<boolean>;\n}\n\nlet idIterator = 0;\n\n@Directive({\n selector: 'button[SwitchRoot]',\n exportAs: 'SwitchRoot',\n standalone: true,\n providers: [\n { provide: RdxSwitchToken, useExisting: RdxSwitchRootDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxSwitchRootDirective, multi: true }\n ],\n host: {\n role: 'switch',\n type: 'button',\n '[id]': 'elementId()',\n '[attr.aria-checked]': 'checked()',\n '[attr.aria-required]': 'required',\n '[attr.data-state]': 'checked() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'disabledState() ? \"true\" : null',\n '[attr.disabled]': 'disabledState() ? disabledState() : null',\n\n '(focus)': '_onTouched?.()',\n '(click)': 'toggle()'\n }\n})\nexport class RdxSwitchRootDirective implements SwitchProps, ControlValueAccessor {\n readonly id = input<string>(`rdx-switch-${idIterator++}`);\n protected readonly elementId = computed(() => (this.id() ? this.id() : null));\n\n // When true, indicates that the user must check\n // the switch before the owning form can be submitted.\n readonly required = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n // The controlled state of the switch\n readonly checked = model<boolean>(false);\n\n // When true, prevents the user from interacting with the switch.\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n /*\n * @ignore\n */\n readonly disabledState = computed(() => this.disabled());\n\n @Output() onCheckedChange = new EventEmitter<boolean>();\n\n /**\n * The method to be called in order to update ngModel.\n */\n _onChange?: (checked: boolean) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n _onTouched?: () => void;\n\n /**\n * Registers a function to call when the checked state changes.\n * @param fn Function to call on change.\n */\n registerOnChange(fn: (checked: boolean) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a function to call when the component is touched.\n * @param fn Function to call on touch.\n */\n registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n /**\n * Writes a new value to the model.\n * @param checked The new checked value.\n */\n writeValue(checked: boolean): void {\n this.checked.set(checked);\n }\n\n /**\n * Toggles the checked state of the switch.\n * If the switch is disabled, the function returns early.\n */\n protected toggle(): void {\n if (this.disabledState()) {\n return;\n }\n\n this.checked.set(!this.checked());\n this._onChange?.(this.checked());\n\n this.onCheckedChange.emit(this.checked());\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { injectSwitch } from './switch-root.directive';\n\n@Directive({\n selector: 'span[SwitchThumb]',\n exportAs: 'SwitchThumb',\n standalone: true,\n host: {\n '[attr.data-disabled]': 'switchRoot.disabledState() ? \"true\" : null',\n '[attr.data-state]': 'switchRoot.checked() ? \"checked\" : \"unchecked\"'\n }\n})\nexport class RdxSwitchThumbDirective {\n protected readonly switchRoot = injectSwitch();\n}\n","import { Directive } from '@angular/core';\n\nimport { injectSwitch } from './switch-root.directive';\n\n@Directive({\n selector: 'input[SwitchInput]',\n exportAs: 'SwitchInput',\n standalone: true,\n host: {\n type: 'checkbox',\n tabindex: '-1',\n '[attr.defaultChecked]': 'switchRoot.checked()',\n '[attr.aria-checked]': 'switchRoot.checked()',\n '[attr.aria-hidden]': 'true',\n '[attr.aria-required]': 'switchRoot.required()',\n '[attr.data-state]': 'switchRoot.checked() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'switchRoot.disabledState() ? \"true\" : null',\n '[attr.disabled]': 'switchRoot.disabledState() ? switchRoot.disabledState() : null',\n '[attr.value]': 'switchRoot.checked() ? \"on\" : \"off\"',\n style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;'\n }\n})\nexport class RdxSwitchInputDirective {\n protected readonly switchRoot = injectSwitch();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAgBa,cAAc,GAAG,IAAI,cAAc,CAAyB,gBAAgB,EAAE;SAE3E,YAAY,GAAA;AACxB,IAAA,OAAO,MAAM,CAAC,cAAc,CAAC,CAAC;AAClC,CAAC;AASD,IAAI,UAAU,GAAG,CAAC,CAAC;MAwBN,sBAAsB,CAAA;AAtBnC,IAAA,WAAA,GAAA;QAuBa,IAAE,CAAA,EAAA,GAAG,KAAK,CAAS,CAAA,WAAA,EAAc,UAAU,EAAE,CAAA,CAAE,CAAC,CAAC;QACvC,IAAS,CAAA,SAAA,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;;;AAIrE,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACpD,YAAA,SAAS,EAAE,gBAAgB;AAC9B,SAAA,CAAC,CAAC;;AAGM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAU,KAAK,CAAC,CAAC;;AAGhC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACpD,YAAA,SAAS,EAAE,gBAAgB;AAC9B,SAAA,CAAC,CAAC;AAEH;;AAEG;QACM,IAAa,CAAA,aAAA,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;AAE/C,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,YAAY,EAAW,CAAC;AAkD3D,KAAA;AAtCG;;;AAGG;AACH,IAAA,gBAAgB,CAAC,EAA8B,EAAA;AAC3C,QAAA,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;KACvB;AAED;;;AAGG;AACH,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AACrE,wBAAA,sBAAsB,EAAE,4CAA4C;AACpE,wBAAA,iBAAiB,EAAE,gEAAgE;AACnF,wBAAA,cAAc,EAAE,qCAAqC;AACrD,wBAAA,KAAK,EAAE,iHAAiH;AAC3H,qBAAA;AACJ,iBAAA,CAAA;;;ACrBD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../../../packages/primitives/switch/src/switch-root.directive.ts","../../../packages/primitives/switch/src/switch-input.directive.ts","../../../packages/primitives/switch/src/switch-thumb.directive.ts","../../../packages/primitives/switch/index.ts","../../../packages/primitives/switch/radix-ng-primitives-switch.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n EventEmitter,\n inject,\n InjectionToken,\n input,\n InputSignalWithTransform,\n model,\n ModelSignal,\n Output\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport const RdxSwitchToken = new InjectionToken<RdxSwitchRootDirective>('RdxSwitchToken');\n\nexport function injectSwitch(): RdxSwitchRootDirective {\n return inject(RdxSwitchToken);\n}\n\nexport interface SwitchProps {\n checked?: ModelSignal<boolean>;\n defaultChecked?: boolean;\n required?: InputSignalWithTransform<boolean, BooleanInput>;\n onCheckedChange?: EventEmitter<boolean>;\n}\n\nlet idIterator = 0;\n\n@Directive({\n selector: 'button[rdxSwitchRoot]',\n exportAs: 'rdxSwitchRoot',\n standalone: true,\n providers: [\n { provide: RdxSwitchToken, useExisting: RdxSwitchRootDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxSwitchRootDirective, multi: true }\n ],\n host: {\n role: 'switch',\n type: 'button',\n '[id]': 'elementId()',\n '[attr.aria-checked]': 'checked()',\n '[attr.aria-required]': 'required',\n '[attr.data-state]': 'checked() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'disabledState() ? \"true\" : null',\n '[attr.disabled]': 'disabledState() ? disabledState() : null',\n\n '(focus)': '_onTouched?.()',\n '(click)': 'toggle()'\n }\n})\nexport class RdxSwitchRootDirective implements SwitchProps, ControlValueAccessor {\n readonly id = input<string>(`rdx-switch-${idIterator++}`);\n protected readonly elementId = computed(() => (this.id() ? this.id() : null));\n\n // When true, indicates that the user must check\n // the switch before the owning form can be submitted.\n readonly required = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n // The controlled state of the switch\n readonly checked = model<boolean>(false);\n\n // When true, prevents the user from interacting with the switch.\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute\n });\n\n /*\n * @ignore\n */\n readonly disabledState = computed(() => this.disabled());\n\n @Output() onCheckedChange = new EventEmitter<boolean>();\n\n /**\n * The method to be called in order to update ngModel.\n */\n _onChange?: (checked: boolean) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n _onTouched?: () => void;\n\n /**\n * Registers a function to call when the checked state changes.\n * @param fn Function to call on change.\n */\n registerOnChange(fn: (checked: boolean) => void): void {\n this._onChange = fn;\n }\n\n /**\n * Registers a function to call when the component is touched.\n * @param fn Function to call on touch.\n */\n registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n /**\n * Writes a new value to the model.\n * @param checked The new checked value.\n */\n writeValue(checked: boolean): void {\n this.checked.set(checked);\n }\n\n /**\n * Toggles the checked state of the switch.\n * If the switch is disabled, the function returns early.\n */\n protected toggle(): void {\n if (this.disabledState()) {\n return;\n }\n\n this.checked.set(!this.checked());\n this._onChange?.(this.checked());\n\n this.onCheckedChange.emit(this.checked());\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitch } from './switch-root.directive';\n\n@Directive({\n selector: 'input[rdxSwitchInput]',\n exportAs: 'rdxSwitchInput',\n standalone: true,\n host: {\n type: 'checkbox',\n tabindex: '-1',\n '[attr.defaultChecked]': 'switchRoot.checked()',\n '[attr.aria-checked]': 'switchRoot.checked()',\n '[attr.aria-hidden]': 'true',\n '[attr.aria-required]': 'switchRoot.required()',\n '[attr.data-state]': 'switchRoot.checked() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'switchRoot.disabledState() ? \"true\" : null',\n '[attr.disabled]': 'switchRoot.disabledState() ? switchRoot.disabledState() : null',\n '[attr.value]': 'switchRoot.checked() ? \"on\" : \"off\"',\n style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;'\n }\n})\nexport class RdxSwitchInputDirective {\n protected readonly switchRoot = injectSwitch();\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitch } from './switch-root.directive';\n\n@Directive({\n selector: 'span[rdxSwitchThumb]',\n exportAs: 'rdxSwitchThumb',\n standalone: true,\n host: {\n '[attr.data-disabled]': 'switchRoot.disabledState() ? \"true\" : null',\n '[attr.data-state]': 'switchRoot.checked() ? \"checked\" : \"unchecked\"'\n }\n})\nexport class RdxSwitchThumbDirective {\n protected readonly switchRoot = injectSwitch();\n}\n","import { NgModule } from '@angular/core';\nimport { RdxSwitchInputDirective } from './src/switch-input.directive';\nimport { RdxSwitchRootDirective } from './src/switch-root.directive';\nimport { RdxSwitchThumbDirective } from './src/switch-thumb.directive';\n\nexport * from './src/switch-input.directive';\nexport * from './src/switch-root.directive';\nexport * from './src/switch-thumb.directive';\n\nexport type { SwitchProps } from './src/switch-root.directive';\n\nconst switchImports = [\n RdxSwitchRootDirective,\n RdxSwitchInputDirective,\n RdxSwitchThumbDirective\n];\n\n@NgModule({\n imports: [...switchImports],\n exports: [...switchImports]\n})\nexport class RdxSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAgBa,cAAc,GAAG,IAAI,cAAc,CAAyB,gBAAgB,EAAE;SAE3E,YAAY,GAAA;AACxB,IAAA,OAAO,MAAM,CAAC,cAAc,CAAC,CAAC;AAClC,CAAC;AASD,IAAI,UAAU,GAAG,CAAC,CAAC;MAwBN,sBAAsB,CAAA;AAtBnC,IAAA,W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