@radix-ng/primitives 1.0.5 → 1.0.7
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/aspect-ratio/README.md +1 -1
- package/fesm2022/radix-ng-primitives-accordion.mjs +40 -27
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +34 -34
- package/fesm2022/radix-ng-primitives-arrow.mjs +3 -3
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +11 -35
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-autocomplete.mjs +175 -125
- package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +92 -35
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-button.mjs +11 -7
- package/fesm2022/radix-ng-primitives-button.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-calendar.mjs +140 -90
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +63 -46
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +37 -25
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-combobox.mjs +278 -177
- package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-composite.mjs +50 -33
- package/fesm2022/radix-ng-primitives-composite.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-config.mjs +7 -5
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +48 -22
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +44 -28
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-cropper.mjs +73 -45
- package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +70 -40
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +93 -67
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-direction-provider.mjs +5 -4
- package/fesm2022/radix-ng-primitives-direction-provider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +20 -16
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +107 -81
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-editable.mjs +53 -39
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +76 -50
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-fieldset.mjs +8 -7
- package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs +77 -40
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-focus-guards.mjs +3 -3
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +7 -5
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-form.mjs +26 -17
- package/fesm2022/radix-ng-primitives-form.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-input.mjs +41 -22
- package/fesm2022/radix-ng-primitives-input.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-label.mjs +11 -8
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +274 -154
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +35 -17
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-meter.mjs +41 -30
- package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +220 -183
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +93 -61
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-pagination.mjs +48 -38
- package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +150 -107
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +79 -47
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-portal.mjs +20 -13
- package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +3 -3
- package/fesm2022/radix-ng-primitives-preview-card.mjs +119 -74
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +73 -46
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +58 -40
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +57 -41
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +595 -102
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +11 -15
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +101 -64
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +53 -39
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +25 -20
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +76 -51
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +72 -41
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toast.mjs +75 -56
- package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +39 -23
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +36 -36
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +52 -31
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +118 -63
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +31 -20
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/package.json +2 -2
- package/types/radix-ng-primitives-accordion.d.ts +1 -0
- package/types/radix-ng-primitives-aspect-ratio.d.ts +10 -23
- package/types/radix-ng-primitives-autocomplete.d.ts +3 -1
- package/types/radix-ng-primitives-avatar.d.ts +51 -25
- package/types/radix-ng-primitives-checkbox.d.ts +26 -98
- package/types/radix-ng-primitives-combobox.d.ts +28 -9
- package/types/radix-ng-primitives-context-menu.d.ts +2 -0
- package/types/radix-ng-primitives-dialog.d.ts +6 -3
- package/types/radix-ng-primitives-field.d.ts +33 -207
- package/types/radix-ng-primitives-floating-focus-manager.d.ts +11 -0
- package/types/radix-ng-primitives-form.d.ts +24 -33
- package/types/radix-ng-primitives-label.d.ts +3 -2
- package/types/radix-ng-primitives-menu.d.ts +47 -15
- package/types/radix-ng-primitives-menubar.d.ts +6 -1
- package/types/radix-ng-primitives-navigation-menu.d.ts +8 -6
- package/types/radix-ng-primitives-number-field.d.ts +1 -1
- package/types/radix-ng-primitives-popover.d.ts +12 -4
- package/types/radix-ng-primitives-preview-card.d.ts +18 -5
- package/types/radix-ng-primitives-progress.d.ts +59 -121
- package/types/radix-ng-primitives-radio.d.ts +0 -1
- package/types/radix-ng-primitives-select.d.ts +186 -391
- package/types/radix-ng-primitives-separator.d.ts +0 -7
- package/types/radix-ng-primitives-toggle-group.d.ts +7 -3
- package/types/radix-ng-primitives-toggle.d.ts +8 -8
- package/types/radix-ng-primitives-toolbar.d.ts +2 -0
- package/types/radix-ng-primitives-tooltip.d.ts +17 -3
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, booleanAttribute, signal, computed, inject, ElementRef, DestroyRef, Directive, effect, afterNextRender } from '@angular/core';
|
|
3
|
-
import { createContext, rdxCheckLabelElement } from '@radix-ng/primitives/core';
|
|
3
|
+
import { createContext, injectId, rdxCheckLabelElement } from '@radix-ng/primitives/core';
|
|
4
4
|
import { injectFormRootContext } from '@radix-ng/primitives/form';
|
|
5
5
|
|
|
6
|
-
let fieldId = 0;
|
|
7
6
|
const attr$4 = (value) => (value ? '' : undefined);
|
|
8
7
|
const addId = (ids, id) => (ids.includes(id) ? ids : [...ids, id]);
|
|
9
8
|
const removeId = (ids, id) => ids.filter((item) => item !== id);
|
|
@@ -92,42 +91,57 @@ class RdxFieldRoot {
|
|
|
92
91
|
*
|
|
93
92
|
* @group Props
|
|
94
93
|
*/
|
|
95
|
-
this.filled = input(
|
|
94
|
+
this.filled = input(/* @ts-ignore */
|
|
95
|
+
...(ngDevMode ? [undefined, { debugName: "filled" }] : /* istanbul ignore next */ []));
|
|
96
96
|
/**
|
|
97
97
|
* Overrides whether the control is focused.
|
|
98
98
|
*
|
|
99
99
|
* @group Props
|
|
100
100
|
*/
|
|
101
|
-
this.focused = input(
|
|
101
|
+
this.focused = input(/* @ts-ignore */
|
|
102
|
+
...(ngDevMode ? [undefined, { debugName: "focused" }] : /* istanbul ignore next */ []));
|
|
102
103
|
/**
|
|
103
104
|
* Identifies the field to an enclosing Form for external (server) error matching. Fields without a
|
|
104
105
|
* `name` never match external errors.
|
|
105
106
|
*
|
|
106
107
|
* @group Props
|
|
107
108
|
*/
|
|
108
|
-
this.name = input(
|
|
109
|
+
this.name = input(/* @ts-ignore */
|
|
110
|
+
...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
|
|
109
111
|
/** The enclosing Form, if any. All Form-related behavior is a no-op when this is `null`. */
|
|
110
112
|
this.formContext = injectFormRootContext(true);
|
|
111
|
-
this.controlId = signal(
|
|
112
|
-
|
|
113
|
-
this.
|
|
114
|
-
|
|
115
|
-
this.
|
|
116
|
-
|
|
117
|
-
this.
|
|
113
|
+
this.controlId = signal(injectId('rdx-field-control-'), /* @ts-ignore */
|
|
114
|
+
...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
|
|
115
|
+
this.descriptionIds = signal([], /* @ts-ignore */
|
|
116
|
+
...(ngDevMode ? [{ debugName: "descriptionIds" }] : /* istanbul ignore next */ []));
|
|
117
|
+
this.errorIds = signal([], /* @ts-ignore */
|
|
118
|
+
...(ngDevMode ? [{ debugName: "errorIds" }] : /* istanbul ignore next */ []));
|
|
119
|
+
this.focusedValue = signal(false, /* @ts-ignore */
|
|
120
|
+
...(ngDevMode ? [{ debugName: "focusedValue" }] : /* istanbul ignore next */ []));
|
|
121
|
+
this.filledValue = signal(false, /* @ts-ignore */
|
|
122
|
+
...(ngDevMode ? [{ debugName: "filledValue" }] : /* istanbul ignore next */ []));
|
|
123
|
+
this.dirtyValue = signal(false, /* @ts-ignore */
|
|
124
|
+
...(ngDevMode ? [{ debugName: "dirtyValue" }] : /* istanbul ignore next */ []));
|
|
125
|
+
this.touchedValue = signal(false, /* @ts-ignore */
|
|
126
|
+
...(ngDevMode ? [{ debugName: "touchedValue" }] : /* istanbul ignore next */ []));
|
|
118
127
|
/** External state owner registered through the context; `null` when Field self-computes. */
|
|
119
|
-
this.stateProvider = signal(null,
|
|
128
|
+
this.stateProvider = signal(null, /* @ts-ignore */
|
|
129
|
+
...(ngDevMode ? [{ debugName: "stateProvider" }] : /* istanbul ignore next */ []));
|
|
120
130
|
/** Whether an external adapter currently owns field state. */
|
|
121
|
-
this.hasStateProvider = computed(() => this.stateProvider() !== null,
|
|
131
|
+
this.hasStateProvider = computed(() => this.stateProvider() !== null, /* @ts-ignore */
|
|
132
|
+
...(ngDevMode ? [{ debugName: "hasStateProvider" }] : /* istanbul ignore next */ []));
|
|
122
133
|
/** Error content from a registered state provider (e.g. a Signal Forms adapter). */
|
|
123
|
-
this.providerErrors = computed(() => this.stateProvider()?.errors?.() ?? [],
|
|
134
|
+
this.providerErrors = computed(() => this.stateProvider()?.errors?.() ?? [], /* @ts-ignore */
|
|
135
|
+
...(ngDevMode ? [{ debugName: "providerErrors" }] : /* istanbul ignore next */ []));
|
|
124
136
|
/** External messages from the enclosing Form matched by this field's `name`. */
|
|
125
|
-
this.externalErrors = computed(() => this.formContext?.errorsFor(this.name()) ?? [],
|
|
137
|
+
this.externalErrors = computed(() => this.formContext?.errorsFor(this.name()) ?? [], /* @ts-ignore */
|
|
138
|
+
...(ngDevMode ? [{ debugName: "externalErrors" }] : /* istanbul ignore next */ []));
|
|
126
139
|
/** Provider messages first (`message ?? kind`), then the Form's external messages. */
|
|
127
140
|
this.messages = computed(() => [
|
|
128
141
|
...this.providerErrors().map((error) => error.message ?? error.kind),
|
|
129
142
|
...this.externalErrors()
|
|
130
|
-
],
|
|
143
|
+
], /* @ts-ignore */
|
|
144
|
+
...(ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []));
|
|
131
145
|
// External errors (provider content or Form server errors) force invalid regardless of the input or
|
|
132
146
|
// a provider's `invalid` accessor — a server error must show even when client-side validity passes.
|
|
133
147
|
this.invalidState = computed(() => {
|
|
@@ -135,13 +149,20 @@ class RdxFieldRoot {
|
|
|
135
149
|
return true;
|
|
136
150
|
}
|
|
137
151
|
return this.resolve('invalid', () => this.invalid());
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
this.
|
|
141
|
-
|
|
142
|
-
this.
|
|
143
|
-
|
|
144
|
-
this.
|
|
152
|
+
}, /* @ts-ignore */
|
|
153
|
+
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
154
|
+
this.disabledState = computed(() => this.resolve('disabled', () => this.disabled()), /* @ts-ignore */
|
|
155
|
+
...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
|
|
156
|
+
this.requiredState = computed(() => this.resolve('required', () => this.required()), /* @ts-ignore */
|
|
157
|
+
...(ngDevMode ? [{ debugName: "requiredState" }] : /* istanbul ignore next */ []));
|
|
158
|
+
this.dirtyState = computed(() => this.resolve('dirty', () => this.dirty() || this.dirtyValue()), /* @ts-ignore */
|
|
159
|
+
...(ngDevMode ? [{ debugName: "dirtyState" }] : /* istanbul ignore next */ []));
|
|
160
|
+
this.touchedState = computed(() => this.resolve('touched', () => this.touched() || this.touchedValue()), /* @ts-ignore */
|
|
161
|
+
...(ngDevMode ? [{ debugName: "touchedState" }] : /* istanbul ignore next */ []));
|
|
162
|
+
this.filledState = computed(() => this.resolve('filled', () => this.filled() ?? this.filledValue()), /* @ts-ignore */
|
|
163
|
+
...(ngDevMode ? [{ debugName: "filledState" }] : /* istanbul ignore next */ []));
|
|
164
|
+
this.focusedState = computed(() => this.resolve('focused', () => this.focused() ?? this.focusedValue()), /* @ts-ignore */
|
|
165
|
+
...(ngDevMode ? [{ debugName: "focusedState" }] : /* istanbul ignore next */ []));
|
|
145
166
|
this.dataAttr = attr$4;
|
|
146
167
|
this.host = inject(ElementRef).nativeElement;
|
|
147
168
|
// Register with an enclosing Form (if any) for aggregate state, submit guard, and reset; a
|
|
@@ -202,10 +223,10 @@ class RdxFieldRoot {
|
|
|
202
223
|
const accessor = this.stateProvider()?.[key];
|
|
203
224
|
return accessor ? accessor() : fallback();
|
|
204
225
|
}
|
|
205
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
206
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
226
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
227
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxFieldRoot, isStandalone: true, selector: "[rdxFieldRoot]", inputs: { invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, dirty: { classPropertyName: "dirty", publicName: "dirty", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, filled: { classPropertyName: "filled", publicName: "filled", isSignal: true, isRequired: false, transformFunction: null }, focused: { classPropertyName: "focused", publicName: "focused", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "notifyEdited()", "change": "notifyEdited()" }, properties: { "attr.data-invalid": "dataAttr(invalidState())", "attr.data-valid": "dataAttr(!invalidState())", "attr.data-disabled": "dataAttr(disabledState())", "attr.data-required": "dataAttr(requiredState())", "attr.data-dirty": "dataAttr(dirtyState())", "attr.data-touched": "dataAttr(touchedState())", "attr.data-filled": "dataAttr(filledState())", "attr.data-focused": "dataAttr(focusedState())" } }, providers: [provideFieldRootContext(fieldRootContext)], exportAs: ["rdxFieldRoot"], ngImport: i0 }); }
|
|
207
228
|
}
|
|
208
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
229
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldRoot, decorators: [{
|
|
209
230
|
type: Directive,
|
|
210
231
|
args: [{
|
|
211
232
|
selector: '[rdxFieldRoot]',
|
|
@@ -229,7 +250,6 @@ function injectFieldRoot() {
|
|
|
229
250
|
return inject(RdxFieldRoot);
|
|
230
251
|
}
|
|
231
252
|
|
|
232
|
-
let controlId = 0;
|
|
233
253
|
const attr$3 = (value) => (value ? '' : undefined);
|
|
234
254
|
/**
|
|
235
255
|
* Connects a form control to the field label, description, error, and state.
|
|
@@ -246,14 +266,16 @@ class RdxFieldControl {
|
|
|
246
266
|
*
|
|
247
267
|
* @group Props
|
|
248
268
|
*/
|
|
249
|
-
this.id = input(
|
|
269
|
+
this.id = input(injectId('rdx-field-control-'), /* @ts-ignore */
|
|
270
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
250
271
|
this.describedBy = computed(() => {
|
|
251
272
|
const ids = [
|
|
252
273
|
...this.rootContext.descriptionIds(),
|
|
253
274
|
...(this.rootContext.invalidState() ? this.rootContext.errorIds() : [])
|
|
254
275
|
];
|
|
255
276
|
return ids.length ? ids.join(' ') : undefined;
|
|
256
|
-
},
|
|
277
|
+
}, /* @ts-ignore */
|
|
278
|
+
...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
257
279
|
this.dataAttr = attr$3;
|
|
258
280
|
effect(() => {
|
|
259
281
|
this.rootContext.setControlId(this.id());
|
|
@@ -282,10 +304,10 @@ class RdxFieldControl {
|
|
|
282
304
|
const element = this.elementRef.nativeElement;
|
|
283
305
|
return element.value ?? '';
|
|
284
306
|
}
|
|
285
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
286
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
307
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldControl, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
308
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxFieldControl, isStandalone: true, selector: "[rdxFieldControl]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focus": "onFocus()", "blur": "onBlur()", "input": "syncFilled()", "change": "syncFilled()" }, properties: { "attr.id": "id()", "attr.aria-describedby": "describedBy()", "attr.aria-invalid": "rootContext.invalidState() ? \"true\" : undefined", "attr.aria-required": "!isNativeFormControl() && rootContext.requiredState() ? \"true\" : undefined", "attr.aria-disabled": "!isNativeFormControl() && rootContext.disabledState() ? \"true\" : undefined", "attr.disabled": "isNativeFormControl() && rootContext.disabledState() ? \"\" : undefined", "attr.required": "isNativeFormControl() && rootContext.requiredState() ? \"\" : undefined", "attr.data-invalid": "dataAttr(rootContext.invalidState())", "attr.data-valid": "dataAttr(!rootContext.invalidState())", "attr.data-disabled": "dataAttr(rootContext.disabledState())", "attr.data-required": "dataAttr(rootContext.requiredState())", "attr.data-dirty": "dataAttr(rootContext.dirtyState())", "attr.data-touched": "dataAttr(rootContext.touchedState())", "attr.data-filled": "dataAttr(rootContext.filledState())", "attr.data-focused": "dataAttr(rootContext.focusedState())" } }, exportAs: ["rdxFieldControl"], ngImport: i0 }); }
|
|
287
309
|
}
|
|
288
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
310
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldControl, decorators: [{
|
|
289
311
|
type: Directive,
|
|
290
312
|
args: [{
|
|
291
313
|
selector: '[rdxFieldControl]',
|
|
@@ -294,14 +316,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
294
316
|
'[attr.id]': 'id()',
|
|
295
317
|
'[attr.aria-describedby]': 'describedBy()',
|
|
296
318
|
'[attr.aria-invalid]': 'rootContext.invalidState() ? "true" : undefined',
|
|
297
|
-
|
|
298
|
-
|
|
319
|
+
// On a native control the native `required`/`disabled` attributes already convey the state, so
|
|
320
|
+
// `aria-required`/`aria-disabled` are only emitted on non-native (custom) controls.
|
|
321
|
+
'[attr.aria-required]': '!isNativeFormControl() && rootContext.requiredState() ? "true" : undefined',
|
|
322
|
+
'[attr.aria-disabled]': '!isNativeFormControl() && rootContext.disabledState() ? "true" : undefined',
|
|
299
323
|
'[attr.disabled]': 'isNativeFormControl() && rootContext.disabledState() ? "" : undefined',
|
|
300
324
|
'[attr.required]': 'isNativeFormControl() && rootContext.requiredState() ? "" : undefined',
|
|
301
325
|
'[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',
|
|
302
326
|
'[attr.data-valid]': 'dataAttr(!rootContext.invalidState())',
|
|
303
327
|
'[attr.data-disabled]': 'dataAttr(rootContext.disabledState())',
|
|
304
328
|
'[attr.data-required]': 'dataAttr(rootContext.requiredState())',
|
|
329
|
+
'[attr.data-dirty]': 'dataAttr(rootContext.dirtyState())',
|
|
330
|
+
'[attr.data-touched]': 'dataAttr(rootContext.touchedState())',
|
|
305
331
|
'[attr.data-filled]': 'dataAttr(rootContext.filledState())',
|
|
306
332
|
'[attr.data-focused]': 'dataAttr(rootContext.focusedState())',
|
|
307
333
|
'(focus)': 'onFocus()',
|
|
@@ -312,7 +338,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
312
338
|
}]
|
|
313
339
|
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
314
340
|
|
|
315
|
-
let descriptionId = 0;
|
|
316
341
|
const attr$2 = (value) => (value ? '' : undefined);
|
|
317
342
|
/**
|
|
318
343
|
* Describes the field control.
|
|
@@ -327,7 +352,8 @@ class RdxFieldDescription {
|
|
|
327
352
|
*
|
|
328
353
|
* @group Props
|
|
329
354
|
*/
|
|
330
|
-
this.id = input(
|
|
355
|
+
this.id = input(injectId('rdx-field-description-'), /* @ts-ignore */
|
|
356
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
331
357
|
this.dataAttr = attr$2;
|
|
332
358
|
effect((onCleanup) => {
|
|
333
359
|
const id = this.id();
|
|
@@ -335,10 +361,10 @@ class RdxFieldDescription {
|
|
|
335
361
|
onCleanup(() => this.rootContext.removeDescriptionId(id));
|
|
336
362
|
});
|
|
337
363
|
}
|
|
338
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
339
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
364
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
365
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxFieldDescription, isStandalone: true, selector: "[rdxFieldDescription]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id()", "attr.data-invalid": "dataAttr(rootContext.invalidState())", "attr.data-disabled": "dataAttr(rootContext.disabledState())" } }, exportAs: ["rdxFieldDescription"], ngImport: i0 }); }
|
|
340
366
|
}
|
|
341
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldDescription, decorators: [{
|
|
342
368
|
type: Directive,
|
|
343
369
|
args: [{
|
|
344
370
|
selector: '[rdxFieldDescription]',
|
|
@@ -351,7 +377,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
351
377
|
}]
|
|
352
378
|
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
353
379
|
|
|
354
|
-
let errorId = 0;
|
|
355
380
|
const attr$1 = (value) => (value ? '' : undefined);
|
|
356
381
|
/**
|
|
357
382
|
* Describes an invalid field control.
|
|
@@ -366,7 +391,8 @@ class RdxFieldError {
|
|
|
366
391
|
*
|
|
367
392
|
* @group Props
|
|
368
393
|
*/
|
|
369
|
-
this.id = input(
|
|
394
|
+
this.id = input(injectId('rdx-field-error-'), /* @ts-ignore */
|
|
395
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
370
396
|
/**
|
|
371
397
|
* The field's external messages (state provider's, then enclosing Form's), `[]` when none. Render
|
|
372
398
|
* them explicitly via the `exportAs` reference — the directive never injects text content itself:
|
|
@@ -380,10 +406,10 @@ class RdxFieldError {
|
|
|
380
406
|
onCleanup(() => this.rootContext.removeErrorId(id));
|
|
381
407
|
});
|
|
382
408
|
}
|
|
383
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
384
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
409
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldError, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
410
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxFieldError, isStandalone: true, selector: "[rdxFieldError]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id()", "attr.hidden": "rootContext.invalidState() ? undefined : \"\"", "attr.aria-live": "\"polite\"", "attr.data-invalid": "dataAttr(rootContext.invalidState())", "attr.data-disabled": "dataAttr(rootContext.disabledState())" } }, exportAs: ["rdxFieldError"], ngImport: i0 }); }
|
|
385
411
|
}
|
|
386
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
412
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldError, decorators: [{
|
|
387
413
|
type: Directive,
|
|
388
414
|
args: [{
|
|
389
415
|
selector: '[rdxFieldError]',
|
|
@@ -398,7 +424,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
398
424
|
}]
|
|
399
425
|
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
400
426
|
|
|
401
|
-
let labelId = 0;
|
|
402
427
|
const attr = (value) => (value ? '' : undefined);
|
|
403
428
|
/**
|
|
404
429
|
* Labels the field control.
|
|
@@ -413,15 +438,16 @@ class RdxFieldLabel {
|
|
|
413
438
|
*
|
|
414
439
|
* @group Props
|
|
415
440
|
*/
|
|
416
|
-
this.id = input(
|
|
441
|
+
this.id = input(injectId('rdx-field-label-'), /* @ts-ignore */
|
|
442
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
417
443
|
this.htmlFor = () => this.rootContext.controlId();
|
|
418
444
|
this.dataAttr = attr;
|
|
419
445
|
rdxCheckLabelElement('rdxFieldLabel', 'field/unassociated-label', 'components/field');
|
|
420
446
|
}
|
|
421
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
422
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
447
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
448
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxFieldLabel, isStandalone: true, selector: "[rdxFieldLabel]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id()", "attr.for": "htmlFor()", "attr.data-invalid": "dataAttr(rootContext.invalidState())", "attr.data-disabled": "dataAttr(rootContext.disabledState())", "attr.data-required": "dataAttr(rootContext.requiredState())" } }, exportAs: ["rdxFieldLabel"], ngImport: i0 }); }
|
|
423
449
|
}
|
|
424
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
450
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldLabel, decorators: [{
|
|
425
451
|
type: Directive,
|
|
426
452
|
args: [{
|
|
427
453
|
selector: '[rdxFieldLabel]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-field.mjs","sources":["../../../packages/primitives/field/src/field-root.ts","../../../packages/primitives/field/src/field-control.ts","../../../packages/primitives/field/src/field-description.ts","../../../packages/primitives/field/src/field-error.ts","../../../packages/primitives/field/src/field-label.ts","../../../packages/primitives/field/radix-ng-primitives-field.ts"],"sourcesContent":["import { booleanAttribute, computed, DestroyRef, Directive, ElementRef, inject, input, signal } from '@angular/core';\nimport { BooleanInput, createContext, RdxValidationError } from '@radix-ng/primitives/core';\nimport { injectFormRootContext, RdxFormFieldRegistration } from '@radix-ng/primitives/form';\n\nlet fieldId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * External owner of field state. An adapter (e.g. a future Signal Forms\n * `[rdxSignalField]` directive, or a Reactive Forms bridge) registers one via\n * `setStateProvider` so Field reads authoritative form state instead of\n * self-computing it from the DOM. Each member is an optional signal-like\n * accessor; only the states the adapter owns need to be provided — the rest\n * fall back to the root's inputs / DOM heuristic. Keeping these as plain\n * `() => boolean` accessors keeps Field framework-agnostic (no dependency on\n * `@angular/forms/signals`).\n *\n * See ADR 0004 and `signal-forms-readiness.md` (prep #4).\n */\nexport interface RdxFieldState {\n invalid?: () => boolean;\n disabled?: () => boolean;\n required?: () => boolean;\n dirty?: () => boolean;\n touched?: () => boolean;\n filled?: () => boolean;\n focused?: () => boolean;\n /**\n * Optional source of error *content* (not just the invalid boolean). When provided and non-empty\n * it forces `invalidState` true, and its messages (`message ?? kind` per error) surface through\n * `RdxFieldError.messages()` ahead of any enclosing Form's external messages. Uses `core`'s\n * framework-free shim type so the seam stays free of `@angular/forms/signals` (ADR 0004 amendment).\n */\n errors?: () => RdxValidationError[];\n}\n\nconst addId = (ids: string[], id: string) => (ids.includes(id) ? ids : [...ids, id]);\nconst removeId = (ids: string[], id: string) => ids.filter((item) => item !== id);\n\nconst fieldRootContext = () => {\n const root = injectFieldRoot();\n\n return {\n controlId: root.controlId,\n name: root.name,\n descriptionIds: root.descriptionIds,\n errorIds: root.errorIds,\n /** Combined external messages (state provider's, then enclosing Form's), for `RdxFieldError`. */\n messages: root.messages,\n /** Notify an enclosing Form that this field's control was edited (composite-control opt-in). */\n notifyEdited: () => root.notifyEdited(),\n invalidState: root.invalidState,\n disabledState: root.disabledState,\n requiredState: root.requiredState,\n dirtyState: root.dirtyState,\n touchedState: root.touchedState,\n filledState: root.filledState,\n focusedState: root.focusedState,\n setControlId: (id: string) => root.controlId.set(id),\n addDescriptionId: (id: string) => root.descriptionIds.update((ids) => addId(ids, id)),\n removeDescriptionId: (id: string) => root.descriptionIds.update((ids) => removeId(ids, id)),\n addErrorId: (id: string) => root.errorIds.update((ids) => addId(ids, id)),\n removeErrorId: (id: string) => root.errorIds.update((ids) => removeId(ids, id)),\n setFocused: (value: boolean) => root.focusedValue.set(value),\n setFilled: (value: boolean) => root.filledValue.set(value),\n setDirty: (value: boolean) => root.dirtyValue.set(value),\n setTouched: (value: boolean) => root.touchedValue.set(value),\n /**\n * Register (or clear with `null`) an external owner of field state.\n * While a provider is registered, any state it exposes takes precedence\n * over the root inputs and the DOM-derived values. Returns the previous\n * provider so adapters can restore it on teardown.\n */\n setStateProvider: (provider: RdxFieldState | null) => root.setStateProvider(provider),\n hasStateProvider: root.hasStateProvider\n };\n};\n\nexport type RdxFieldRootContext = ReturnType<typeof fieldRootContext>;\n\nexport const [injectFieldRootContext, provideFieldRootContext] = createContext<RdxFieldRootContext>(\n 'RdxFieldRoot',\n 'components/field'\n);\n\n/**\n * Groups a form control with its label, description, error message, and field state.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldRoot]',\n exportAs: 'rdxFieldRoot',\n providers: [provideFieldRootContext(fieldRootContext)],\n host: {\n '[attr.data-invalid]': 'dataAttr(invalidState())',\n '[attr.data-valid]': 'dataAttr(!invalidState())',\n '[attr.data-disabled]': 'dataAttr(disabledState())',\n '[attr.data-required]': 'dataAttr(requiredState())',\n '[attr.data-dirty]': 'dataAttr(dirtyState())',\n '[attr.data-touched]': 'dataAttr(touchedState())',\n '[attr.data-filled]': 'dataAttr(filledState())',\n '[attr.data-focused]': 'dataAttr(focusedState())',\n '(input)': 'notifyEdited()',\n '(change)': 'notifyEdited()'\n }\n})\nexport class RdxFieldRoot {\n /**\n * Whether the field is invalid.\n *\n * @group Props\n * @defaultValue false\n */\n readonly invalid = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field is disabled.\n *\n * @group Props\n * @defaultValue false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field is required.\n *\n * @group Props\n * @defaultValue false\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field value has changed from its initial value.\n *\n * @group Props\n * @defaultValue false\n */\n readonly dirty = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field has been blurred after receiving focus.\n *\n * @group Props\n * @defaultValue false\n */\n readonly touched = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Overrides whether the control has a non-empty value.\n *\n * @group Props\n */\n readonly filled = input<boolean>();\n\n /**\n * Overrides whether the control is focused.\n *\n * @group Props\n */\n readonly focused = input<boolean>();\n\n /**\n * Identifies the field to an enclosing Form for external (server) error matching. Fields without a\n * `name` never match external errors.\n *\n * @group Props\n */\n readonly name = input<string>();\n\n /** The enclosing Form, if any. All Form-related behavior is a no-op when this is `null`. */\n private readonly formContext = injectFormRootContext(true);\n\n readonly controlId = signal(`rdx-field-control-${fieldId++}`);\n readonly descriptionIds = signal<string[]>([]);\n readonly errorIds = signal<string[]>([]);\n\n readonly focusedValue = signal(false);\n readonly filledValue = signal(false);\n readonly dirtyValue = signal(false);\n readonly touchedValue = signal(false);\n\n /** External state owner registered through the context; `null` when Field self-computes. */\n private readonly stateProvider = signal<RdxFieldState | null>(null);\n\n /** Whether an external adapter currently owns field state. */\n readonly hasStateProvider = computed(() => this.stateProvider() !== null);\n\n /** Error content from a registered state provider (e.g. a Signal Forms adapter). */\n private readonly providerErrors = computed(() => this.stateProvider()?.errors?.() ?? []);\n\n /** External messages from the enclosing Form matched by this field's `name`. */\n readonly externalErrors = computed(() => this.formContext?.errorsFor(this.name()) ?? []);\n\n /** Provider messages first (`message ?? kind`), then the Form's external messages. */\n readonly messages = computed(() => [\n ...this.providerErrors().map((error) => error.message ?? error.kind),\n ...this.externalErrors()\n ]);\n\n // External errors (provider content or Form server errors) force invalid regardless of the input or\n // a provider's `invalid` accessor — a server error must show even when client-side validity passes.\n readonly invalidState = computed(() => {\n if (this.externalErrors().length > 0 || this.providerErrors().length > 0) {\n return true;\n }\n return this.resolve('invalid', () => this.invalid());\n });\n readonly disabledState = computed(() => this.resolve('disabled', () => this.disabled()));\n readonly requiredState = computed(() => this.resolve('required', () => this.required()));\n readonly dirtyState = computed(() => this.resolve('dirty', () => this.dirty() || this.dirtyValue()));\n readonly touchedState = computed(() => this.resolve('touched', () => this.touched() || this.touchedValue()));\n readonly filledState = computed(() => this.resolve('filled', () => this.filled() ?? this.filledValue()));\n readonly focusedState = computed(() => this.resolve('focused', () => this.focused() ?? this.focusedValue()));\n\n protected readonly dataAttr = attr;\n\n constructor() {\n // Register with an enclosing Form (if any) for aggregate state, submit guard, and reset; a\n // standalone field never enters this branch and behaves exactly as before.\n const formContext = this.formContext;\n if (formContext) {\n const registration: RdxFormFieldRegistration = {\n name: () => this.name(),\n invalid: () => this.invalidState(),\n dirty: () => this.dirtyState(),\n touched: () => this.touchedState(),\n focus: () => this.focusControl(),\n resetState: () => this.resetState()\n };\n const unregister = formContext.register(registration);\n inject(DestroyRef).onDestroy(unregister);\n }\n }\n\n /** Notify the enclosing Form (if any) that this field's control was edited (clear-on-edit). */\n notifyEdited(): void {\n this.formContext?.notifyEdited(this.name());\n }\n\n /** Reset interaction state on native form reset: touched/dirty/focused → false, filled re-synced. */\n resetState(): void {\n this.touchedValue.set(false);\n this.dirtyValue.set(false);\n this.focusedValue.set(false);\n const control = this.controlElement();\n const value = control?.value ?? '';\n this.filledValue.set(value != null && value !== '');\n }\n\n /** Focus the field's control (used by the Form's first-invalid-focus on blocked submit). */\n private focusControl(): void {\n this.controlElement()?.focus();\n }\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /**\n * The field's control element, found by `controlId` but scoped to this field's own subtree — a\n * duplicate or consumer-reused id elsewhere on the page can't steal focus/reset. The control\n * registers its id through `setControlId`, so this matches the same element the labels point at.\n */\n private controlElement(): HTMLInputElement | null {\n return this.host.querySelector<HTMLInputElement>(`[id=\"${this.controlId()}\"]`);\n }\n\n /**\n * Register an external owner of field state, returning the previous one.\n * @ignore\n */\n setStateProvider(provider: RdxFieldState | null): RdxFieldState | null {\n const previous = this.stateProvider();\n this.stateProvider.set(provider);\n return previous;\n }\n\n /**\n * Prefer the registered provider's value for `key` when it exposes one,\n * otherwise fall back to the root inputs / DOM-derived signals.\n */\n private resolve(key: Exclude<keyof RdxFieldState, 'errors'>, fallback: () => boolean): boolean {\n const accessor = this.stateProvider()?.[key];\n return accessor ? accessor() : fallback();\n }\n}\n\nfunction injectFieldRoot(): RdxFieldRoot {\n return inject(RdxFieldRoot);\n}\n","import { afterNextRender, computed, Directive, effect, ElementRef, inject, input } from '@angular/core';\nimport { injectFieldRootContext } from './field-root';\n\nlet controlId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Connects a form control to the field label, description, error, and state.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldControl]',\n exportAs: 'rdxFieldControl',\n host: {\n '[attr.id]': 'id()',\n '[attr.aria-describedby]': 'describedBy()',\n '[attr.aria-invalid]': 'rootContext.invalidState() ? \"true\" : undefined',\n '[attr.aria-required]': 'rootContext.requiredState() ? \"true\" : undefined',\n '[attr.aria-disabled]': 'rootContext.disabledState() ? \"true\" : undefined',\n '[attr.disabled]': 'isNativeFormControl() && rootContext.disabledState() ? \"\" : undefined',\n '[attr.required]': 'isNativeFormControl() && rootContext.requiredState() ? \"\" : undefined',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-valid]': 'dataAttr(!rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())',\n '[attr.data-required]': 'dataAttr(rootContext.requiredState())',\n '[attr.data-filled]': 'dataAttr(rootContext.filledState())',\n '[attr.data-focused]': 'dataAttr(rootContext.focusedState())',\n '(focus)': 'onFocus()',\n '(blur)': 'onBlur()',\n '(input)': 'syncFilled()',\n '(change)': 'syncFilled()'\n }\n})\nexport class RdxFieldControl {\n protected readonly rootContext = injectFieldRootContext();\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private initialValue = '';\n\n /**\n * Control id. Labels and descriptions use this value for accessible relationships.\n *\n * @group Props\n */\n readonly id = input(`rdx-field-control-${controlId++}`);\n\n protected readonly describedBy = computed(() => {\n const ids = [\n ...this.rootContext.descriptionIds(),\n ...(this.rootContext.invalidState() ? this.rootContext.errorIds() : [])\n ];\n\n return ids.length ? ids.join(' ') : undefined;\n });\n\n constructor() {\n effect(() => {\n this.rootContext.setControlId(this.id());\n });\n\n afterNextRender(() => {\n this.initialValue = this.currentValue();\n this.syncFilled();\n });\n }\n\n onFocus(): void {\n this.rootContext.setFocused(true);\n }\n\n onBlur(): void {\n this.rootContext.setFocused(false);\n this.rootContext.setTouched(true);\n }\n\n syncFilled(): void {\n const value = this.currentValue();\n\n this.rootContext.setFilled(Array.isArray(value) ? value.length > 0 : value != null && value !== '');\n this.rootContext.setDirty(value !== this.initialValue);\n }\n\n protected isNativeFormControl(): boolean {\n return ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(this.elementRef.nativeElement.tagName);\n }\n\n protected readonly dataAttr = attr;\n\n private currentValue(): string {\n const element = this.elementRef.nativeElement as HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;\n return element.value ?? '';\n }\n}\n","import { Directive, effect, input } from '@angular/core';\nimport { injectFieldRootContext } from './field-root';\n\nlet descriptionId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Describes the field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldDescription]',\n exportAs: 'rdxFieldDescription',\n host: {\n '[attr.id]': 'id()',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'\n }\n})\nexport class RdxFieldDescription {\n protected readonly rootContext = injectFieldRootContext();\n\n /**\n * Description id.\n *\n * @group Props\n */\n readonly id = input(`rdx-field-description-${descriptionId++}`);\n\n constructor() {\n effect((onCleanup) => {\n const id = this.id();\n this.rootContext.addDescriptionId(id);\n onCleanup(() => this.rootContext.removeDescriptionId(id));\n });\n }\n\n protected readonly dataAttr = attr;\n}\n","import { Directive, effect, input } from '@angular/core';\nimport { injectFieldRootContext } from './field-root';\n\nlet errorId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Describes an invalid field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldError]',\n exportAs: 'rdxFieldError',\n host: {\n '[attr.id]': 'id()',\n '[attr.hidden]': 'rootContext.invalidState() ? undefined : \"\"',\n '[attr.aria-live]': '\"polite\"',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'\n }\n})\nexport class RdxFieldError {\n protected readonly rootContext = injectFieldRootContext();\n\n /**\n * Error message id.\n *\n * @group Props\n */\n readonly id = input(`rdx-field-error-${errorId++}`);\n\n /**\n * The field's external messages (state provider's, then enclosing Form's), `[]` when none. Render\n * them explicitly via the `exportAs` reference — the directive never injects text content itself:\n * `<p rdxFieldError #err=\"rdxFieldError\">{{ err.messages().join(' ') }}</p>`.\n */\n readonly messages = this.rootContext.messages;\n\n constructor() {\n effect((onCleanup) => {\n const id = this.id();\n this.rootContext.addErrorId(id);\n onCleanup(() => this.rootContext.removeErrorId(id));\n });\n }\n\n protected readonly dataAttr = attr;\n}\n","import { Directive, input } from '@angular/core';\nimport { rdxCheckLabelElement } from '@radix-ng/primitives/core';\nimport { injectFieldRootContext } from './field-root';\n\nlet labelId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Labels the field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldLabel]',\n exportAs: 'rdxFieldLabel',\n host: {\n '[attr.id]': 'id()',\n '[attr.for]': 'htmlFor()',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())',\n '[attr.data-required]': 'dataAttr(rootContext.requiredState())'\n }\n})\nexport class RdxFieldLabel {\n protected readonly rootContext = injectFieldRootContext();\n\n /**\n * Label id.\n *\n * @group Props\n */\n readonly id = input(`rdx-field-label-${labelId++}`);\n\n readonly htmlFor = () => this.rootContext.controlId();\n\n constructor() {\n rdxCheckLabelElement('rdxFieldLabel', 'field/unassociated-label', 'components/field');\n }\n\n protected readonly dataAttr = attr;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["attr"],"mappings":";;;;;AAIA,IAAI,OAAO,GAAG,CAAC;AAEf,MAAMA,MAAI,GAAG,CAAC,KAAc,MAAM,KAAK,GAAG,EAAE,GAAG,SAAS,CAAC;AA+BzD,MAAM,KAAK,GAAG,CAAC,GAAa,EAAE,EAAU,MAAM,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,CAAC;AACpF,MAAM,QAAQ,GAAG,CAAC,GAAa,EAAE,EAAU,KAAK,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,EAAE,CAAC;AAEjF,MAAM,gBAAgB,GAAG,MAAK;AAC1B,IAAA,MAAM,IAAI,GAAG,eAAe,EAAE;IAE9B,OAAO;QACH,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ;;QAEvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;;AAEvB,QAAA,YAAY,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE;QACvC,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;AAC/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,EAAA,uCAAA,EAAA,oBAAA,EAAA,uCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAXzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,IAAI,EAAE;AACF,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,YAAY,EAAE,WAAW;AACzB,wBAAA,qBAAqB,EAAE,sCAAsC;AAC7D,wBAAA,sBAAsB,EAAE,uCAAuC;AAC/D,wBAAA,sBAAsB,EAAE;AAC3B;AACJ,iBAAA;;;ACvBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-field.mjs","sources":["../../../packages/primitives/field/src/field-root.ts","../../../packages/primitives/field/src/field-control.ts","../../../packages/primitives/field/src/field-description.ts","../../../packages/primitives/field/src/field-error.ts","../../../packages/primitives/field/src/field-label.ts","../../../packages/primitives/field/radix-ng-primitives-field.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n signal,\n Signal\n} from '@angular/core';\nimport { BooleanInput, createContext, injectId, RdxValidationError } from '@radix-ng/primitives/core';\nimport { injectFormRootContext, RdxFormFieldRegistration } from '@radix-ng/primitives/form';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * External owner of field state. An adapter (e.g. a future Signal Forms\n * `[rdxSignalField]` directive, or a Reactive Forms bridge) registers one via\n * `setStateProvider` so Field reads authoritative form state instead of\n * self-computing it from the DOM. Each member is an optional signal-like\n * accessor; only the states the adapter owns need to be provided — the rest\n * fall back to the root's inputs / DOM heuristic. Keeping these as plain\n * `() => boolean` accessors keeps Field framework-agnostic (no dependency on\n * `@angular/forms/signals`).\n *\n * See ADR 0004 and `signal-forms-readiness.md` (prep #4).\n */\nexport interface RdxFieldState {\n invalid?: () => boolean;\n disabled?: () => boolean;\n required?: () => boolean;\n dirty?: () => boolean;\n touched?: () => boolean;\n filled?: () => boolean;\n focused?: () => boolean;\n /**\n * Optional source of error *content* (not just the invalid boolean). When provided and non-empty\n * it forces `invalidState` true, and its messages (`message ?? kind` per error) surface through\n * `RdxFieldError.messages()` ahead of any enclosing Form's external messages. Uses `core`'s\n * framework-free shim type so the seam stays free of `@angular/forms/signals` (ADR 0004 amendment).\n */\n errors?: () => RdxValidationError[];\n}\n\nconst addId = (ids: string[], id: string) => (ids.includes(id) ? ids : [...ids, id]);\nconst removeId = (ids: string[], id: string) => ids.filter((item) => item !== id);\n\nexport interface RdxFieldRootContext {\n controlId: Signal<string>;\n name: Signal<string | undefined>;\n descriptionIds: Signal<string[]>;\n errorIds: Signal<string[]>;\n messages: Signal<string[]>;\n notifyEdited: () => void;\n invalidState: Signal<boolean>;\n disabledState: Signal<boolean>;\n requiredState: Signal<boolean>;\n dirtyState: Signal<boolean>;\n touchedState: Signal<boolean>;\n filledState: Signal<boolean>;\n focusedState: Signal<boolean>;\n setControlId: (id: string) => void;\n addDescriptionId: (id: string) => void;\n removeDescriptionId: (id: string) => void;\n addErrorId: (id: string) => void;\n removeErrorId: (id: string) => void;\n setFocused: (value: boolean) => void;\n setFilled: (value: boolean) => void;\n setDirty: (value: boolean) => void;\n setTouched: (value: boolean) => void;\n setStateProvider: (provider: RdxFieldState | null) => RdxFieldState | null;\n hasStateProvider: Signal<boolean>;\n}\n\nconst fieldRootContext = (): RdxFieldRootContext => {\n const root = injectFieldRoot();\n\n return {\n controlId: root.controlId,\n name: root.name,\n descriptionIds: root.descriptionIds,\n errorIds: root.errorIds,\n /** Combined external messages (state provider's, then enclosing Form's), for `RdxFieldError`. */\n messages: root.messages,\n /** Notify an enclosing Form that this field's control was edited (composite-control opt-in). */\n notifyEdited: () => root.notifyEdited(),\n invalidState: root.invalidState,\n disabledState: root.disabledState,\n requiredState: root.requiredState,\n dirtyState: root.dirtyState,\n touchedState: root.touchedState,\n filledState: root.filledState,\n focusedState: root.focusedState,\n setControlId: (id: string) => root.controlId.set(id),\n addDescriptionId: (id: string) => root.descriptionIds.update((ids) => addId(ids, id)),\n removeDescriptionId: (id: string) => root.descriptionIds.update((ids) => removeId(ids, id)),\n addErrorId: (id: string) => root.errorIds.update((ids) => addId(ids, id)),\n removeErrorId: (id: string) => root.errorIds.update((ids) => removeId(ids, id)),\n setFocused: (value: boolean) => root.focusedValue.set(value),\n setFilled: (value: boolean) => root.filledValue.set(value),\n setDirty: (value: boolean) => root.dirtyValue.set(value),\n setTouched: (value: boolean) => root.touchedValue.set(value),\n /**\n * Register (or clear with `null`) an external owner of field state.\n * While a provider is registered, any state it exposes takes precedence\n * over the root inputs and the DOM-derived values. Returns the previous\n * provider so adapters can restore it on teardown.\n */\n setStateProvider: (provider: RdxFieldState | null) => root.setStateProvider(provider),\n hasStateProvider: root.hasStateProvider\n };\n};\n\nexport const [injectFieldRootContext, provideFieldRootContext] = createContext<RdxFieldRootContext>(\n 'RdxFieldRoot',\n 'components/field'\n);\n\n/**\n * Groups a form control with its label, description, error message, and field state.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldRoot]',\n exportAs: 'rdxFieldRoot',\n providers: [provideFieldRootContext(fieldRootContext)],\n host: {\n '[attr.data-invalid]': 'dataAttr(invalidState())',\n '[attr.data-valid]': 'dataAttr(!invalidState())',\n '[attr.data-disabled]': 'dataAttr(disabledState())',\n '[attr.data-required]': 'dataAttr(requiredState())',\n '[attr.data-dirty]': 'dataAttr(dirtyState())',\n '[attr.data-touched]': 'dataAttr(touchedState())',\n '[attr.data-filled]': 'dataAttr(filledState())',\n '[attr.data-focused]': 'dataAttr(focusedState())',\n '(input)': 'notifyEdited()',\n '(change)': 'notifyEdited()'\n }\n})\nexport class RdxFieldRoot {\n /**\n * Whether the field is invalid.\n *\n * @group Props\n * @defaultValue false\n */\n readonly invalid = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field is disabled.\n *\n * @group Props\n * @defaultValue false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field is required.\n *\n * @group Props\n * @defaultValue false\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field value has changed from its initial value.\n *\n * @group Props\n * @defaultValue false\n */\n readonly dirty = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field has been blurred after receiving focus.\n *\n * @group Props\n * @defaultValue false\n */\n readonly touched = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Overrides whether the control has a non-empty value.\n *\n * @group Props\n */\n readonly filled = input<boolean>();\n\n /**\n * Overrides whether the control is focused.\n *\n * @group Props\n */\n readonly focused = input<boolean>();\n\n /**\n * Identifies the field to an enclosing Form for external (server) error matching. Fields without a\n * `name` never match external errors.\n *\n * @group Props\n */\n readonly name = input<string>();\n\n /** The enclosing Form, if any. All Form-related behavior is a no-op when this is `null`. */\n private readonly formContext = injectFormRootContext(true);\n\n readonly controlId = signal(injectId('rdx-field-control-'));\n readonly descriptionIds = signal<string[]>([]);\n readonly errorIds = signal<string[]>([]);\n\n readonly focusedValue = signal(false);\n readonly filledValue = signal(false);\n readonly dirtyValue = signal(false);\n readonly touchedValue = signal(false);\n\n /** External state owner registered through the context; `null` when Field self-computes. */\n private readonly stateProvider = signal<RdxFieldState | null>(null);\n\n /** Whether an external adapter currently owns field state. */\n readonly hasStateProvider = computed(() => this.stateProvider() !== null);\n\n /** Error content from a registered state provider (e.g. a Signal Forms adapter). */\n private readonly providerErrors = computed(() => this.stateProvider()?.errors?.() ?? []);\n\n /** External messages from the enclosing Form matched by this field's `name`. */\n readonly externalErrors = computed(() => this.formContext?.errorsFor(this.name()) ?? []);\n\n /** Provider messages first (`message ?? kind`), then the Form's external messages. */\n readonly messages = computed(() => [\n ...this.providerErrors().map((error) => error.message ?? error.kind),\n ...this.externalErrors()\n ]);\n\n // External errors (provider content or Form server errors) force invalid regardless of the input or\n // a provider's `invalid` accessor — a server error must show even when client-side validity passes.\n readonly invalidState = computed(() => {\n if (this.externalErrors().length > 0 || this.providerErrors().length > 0) {\n return true;\n }\n return this.resolve('invalid', () => this.invalid());\n });\n readonly disabledState = computed(() => this.resolve('disabled', () => this.disabled()));\n readonly requiredState = computed(() => this.resolve('required', () => this.required()));\n readonly dirtyState = computed(() => this.resolve('dirty', () => this.dirty() || this.dirtyValue()));\n readonly touchedState = computed(() => this.resolve('touched', () => this.touched() || this.touchedValue()));\n readonly filledState = computed(() => this.resolve('filled', () => this.filled() ?? this.filledValue()));\n readonly focusedState = computed(() => this.resolve('focused', () => this.focused() ?? this.focusedValue()));\n\n protected readonly dataAttr = attr;\n\n constructor() {\n // Register with an enclosing Form (if any) for aggregate state, submit guard, and reset; a\n // standalone field never enters this branch and behaves exactly as before.\n const formContext = this.formContext;\n if (formContext) {\n const registration: RdxFormFieldRegistration = {\n name: () => this.name(),\n invalid: () => this.invalidState(),\n dirty: () => this.dirtyState(),\n touched: () => this.touchedState(),\n focus: () => this.focusControl(),\n resetState: () => this.resetState()\n };\n const unregister = formContext.register(registration);\n inject(DestroyRef).onDestroy(unregister);\n }\n }\n\n /** Notify the enclosing Form (if any) that this field's control was edited (clear-on-edit). */\n notifyEdited(): void {\n this.formContext?.notifyEdited(this.name());\n }\n\n /** Reset interaction state on native form reset: touched/dirty/focused → false, filled re-synced. */\n resetState(): void {\n this.touchedValue.set(false);\n this.dirtyValue.set(false);\n this.focusedValue.set(false);\n const control = this.controlElement();\n const value = control?.value ?? '';\n this.filledValue.set(value != null && value !== '');\n }\n\n /** Focus the field's control (used by the Form's first-invalid-focus on blocked submit). */\n private focusControl(): void {\n this.controlElement()?.focus();\n }\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /**\n * The field's control element, found by `controlId` but scoped to this field's own subtree — a\n * duplicate or consumer-reused id elsewhere on the page can't steal focus/reset. The control\n * registers its id through `setControlId`, so this matches the same element the labels point at.\n */\n private controlElement(): HTMLInputElement | null {\n return this.host.querySelector<HTMLInputElement>(`[id=\"${this.controlId()}\"]`);\n }\n\n /**\n * Register an external owner of field state, returning the previous one.\n * @ignore\n */\n setStateProvider(provider: RdxFieldState | null): RdxFieldState | null {\n const previous = this.stateProvider();\n this.stateProvider.set(provider);\n return previous;\n }\n\n /**\n * Prefer the registered provider's value for `key` when it exposes one,\n * otherwise fall back to the root inputs / DOM-derived signals.\n */\n private resolve(key: Exclude<keyof RdxFieldState, 'errors'>, fallback: () => boolean): boolean {\n const accessor = this.stateProvider()?.[key];\n return accessor ? accessor() : fallback();\n }\n}\n\nfunction injectFieldRoot(): RdxFieldRoot {\n return inject(RdxFieldRoot);\n}\n","import { afterNextRender, computed, Directive, effect, ElementRef, inject, input } from '@angular/core';\nimport { injectId } from '@radix-ng/primitives/core';\nimport { injectFieldRootContext } from './field-root';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Connects a form control to the field label, description, error, and state.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldControl]',\n exportAs: 'rdxFieldControl',\n host: {\n '[attr.id]': 'id()',\n '[attr.aria-describedby]': 'describedBy()',\n '[attr.aria-invalid]': 'rootContext.invalidState() ? \"true\" : undefined',\n // On a native control the native `required`/`disabled` attributes already convey the state, so\n // `aria-required`/`aria-disabled` are only emitted on non-native (custom) controls.\n '[attr.aria-required]': '!isNativeFormControl() && rootContext.requiredState() ? \"true\" : undefined',\n '[attr.aria-disabled]': '!isNativeFormControl() && rootContext.disabledState() ? \"true\" : undefined',\n '[attr.disabled]': 'isNativeFormControl() && rootContext.disabledState() ? \"\" : undefined',\n '[attr.required]': 'isNativeFormControl() && rootContext.requiredState() ? \"\" : undefined',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-valid]': 'dataAttr(!rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())',\n '[attr.data-required]': 'dataAttr(rootContext.requiredState())',\n '[attr.data-dirty]': 'dataAttr(rootContext.dirtyState())',\n '[attr.data-touched]': 'dataAttr(rootContext.touchedState())',\n '[attr.data-filled]': 'dataAttr(rootContext.filledState())',\n '[attr.data-focused]': 'dataAttr(rootContext.focusedState())',\n '(focus)': 'onFocus()',\n '(blur)': 'onBlur()',\n '(input)': 'syncFilled()',\n '(change)': 'syncFilled()'\n }\n})\nexport class RdxFieldControl {\n protected readonly rootContext = injectFieldRootContext();\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private initialValue = '';\n\n /**\n * Control id. Labels and descriptions use this value for accessible relationships.\n *\n * @group Props\n */\n readonly id = input(injectId('rdx-field-control-'));\n\n protected readonly describedBy = computed(() => {\n const ids = [\n ...this.rootContext.descriptionIds(),\n ...(this.rootContext.invalidState() ? this.rootContext.errorIds() : [])\n ];\n\n return ids.length ? ids.join(' ') : undefined;\n });\n\n constructor() {\n effect(() => {\n this.rootContext.setControlId(this.id());\n });\n\n afterNextRender(() => {\n this.initialValue = this.currentValue();\n this.syncFilled();\n });\n }\n\n onFocus(): void {\n this.rootContext.setFocused(true);\n }\n\n onBlur(): void {\n this.rootContext.setFocused(false);\n this.rootContext.setTouched(true);\n }\n\n syncFilled(): void {\n const value = this.currentValue();\n\n this.rootContext.setFilled(Array.isArray(value) ? value.length > 0 : value != null && value !== '');\n this.rootContext.setDirty(value !== this.initialValue);\n }\n\n protected isNativeFormControl(): boolean {\n return ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(this.elementRef.nativeElement.tagName);\n }\n\n protected readonly dataAttr = attr;\n\n private currentValue(): string {\n const element = this.elementRef.nativeElement as HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;\n return element.value ?? '';\n }\n}\n","import { Directive, effect, input } from '@angular/core';\nimport { injectId } from '@radix-ng/primitives/core';\nimport { injectFieldRootContext } from './field-root';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Describes the field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldDescription]',\n exportAs: 'rdxFieldDescription',\n host: {\n '[attr.id]': 'id()',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'\n }\n})\nexport class RdxFieldDescription {\n protected readonly rootContext = injectFieldRootContext();\n\n /**\n * Description id.\n *\n * @group Props\n */\n readonly id = input(injectId('rdx-field-description-'));\n\n constructor() {\n effect((onCleanup) => {\n const id = this.id();\n this.rootContext.addDescriptionId(id);\n onCleanup(() => this.rootContext.removeDescriptionId(id));\n });\n }\n\n protected readonly dataAttr = attr;\n}\n","import { Directive, effect, input } from '@angular/core';\nimport { injectId } from '@radix-ng/primitives/core';\nimport { injectFieldRootContext } from './field-root';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Describes an invalid field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldError]',\n exportAs: 'rdxFieldError',\n host: {\n '[attr.id]': 'id()',\n '[attr.hidden]': 'rootContext.invalidState() ? undefined : \"\"',\n '[attr.aria-live]': '\"polite\"',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'\n }\n})\nexport class RdxFieldError {\n protected readonly rootContext = injectFieldRootContext();\n\n /**\n * Error message id.\n *\n * @group Props\n */\n readonly id = input(injectId('rdx-field-error-'));\n\n /**\n * The field's external messages (state provider's, then enclosing Form's), `[]` when none. Render\n * them explicitly via the `exportAs` reference — the directive never injects text content itself:\n * `<p rdxFieldError #err=\"rdxFieldError\">{{ err.messages().join(' ') }}</p>`.\n */\n readonly messages = this.rootContext.messages;\n\n constructor() {\n effect((onCleanup) => {\n const id = this.id();\n this.rootContext.addErrorId(id);\n onCleanup(() => this.rootContext.removeErrorId(id));\n });\n }\n\n protected readonly dataAttr = attr;\n}\n","import { Directive, input } from '@angular/core';\nimport { injectId, rdxCheckLabelElement } from '@radix-ng/primitives/core';\nimport { injectFieldRootContext } from './field-root';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Labels the field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldLabel]',\n exportAs: 'rdxFieldLabel',\n host: {\n '[attr.id]': 'id()',\n '[attr.for]': 'htmlFor()',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())',\n '[attr.data-required]': 'dataAttr(rootContext.requiredState())'\n }\n})\nexport class RdxFieldLabel {\n protected readonly rootContext = injectFieldRootContext();\n\n /**\n * Label id.\n *\n * @group Props\n */\n readonly id = input(injectId('rdx-field-label-'));\n\n readonly htmlFor = () => this.rootContext.controlId();\n\n constructor() {\n rdxCheckLabelElement('rdxFieldLabel', 'field/unassociated-label', 'components/field');\n }\n\n protected readonly dataAttr = attr;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["attr"],"mappings":";;;;;AAcA,MAAMA,MAAI,GAAG,CAAC,KAAc,MAAM,KAAK,GAAG,EAAE,GAAG,SAAS,CAAC;AA+BzD,MAAM,KAAK,GAAG,CAAC,GAAa,EAAE,EAAU,MAAM,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,CAAC;AACpF,MAAM,QAAQ,GAAG,CAAC,GAAa,EAAE,EAAU,KAAK,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,EAAE,CAAC;AA6BjF,MAAM,gBAAgB,GAAG,MAA0B;AAC/C,IAAA,MAAM,IAAI,GAAG,eAAe,EAAE;IAE9B,OAAO;QACH,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC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|
|
24
24
|
* @defaultValue false
|
|
25
25
|
*/
|
|
26
26
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
27
|
-
this.disabledState = computed(() => this.disabled(),
|
|
27
|
+
this.disabledState = computed(() => this.disabled(), /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
|
|
28
29
|
this.dataAttr = attr$1;
|
|
29
30
|
}
|
|
30
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
31
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldsetRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
32
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxFieldsetRoot, isStandalone: true, selector: "fieldset[rdxFieldsetRoot]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.disabled": "disabledState() ? \"\" : undefined", "attr.data-disabled": "dataAttr(disabledState())" } }, providers: [provideFieldsetRootContext(fieldsetRootContext)], exportAs: ["rdxFieldsetRoot"], ngImport: i0 }); }
|
|
32
33
|
}
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldsetRoot, decorators: [{
|
|
34
35
|
type: Directive,
|
|
35
36
|
args: [{
|
|
36
37
|
selector: 'fieldset[rdxFieldsetRoot]',
|
|
@@ -57,10 +58,10 @@ class RdxFieldsetLegend {
|
|
|
57
58
|
this.rootContext = injectFieldsetRootContext();
|
|
58
59
|
this.dataAttr = attr;
|
|
59
60
|
}
|
|
60
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
61
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
61
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldsetLegend, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
62
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxFieldsetLegend, isStandalone: true, selector: "legend[rdxFieldsetLegend]", host: { properties: { "attr.data-disabled": "dataAttr(rootContext.disabledState())" } }, exportAs: ["rdxFieldsetLegend"], ngImport: i0 }); }
|
|
62
63
|
}
|
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxFieldsetLegend, decorators: [{
|
|
64
65
|
type: Directive,
|
|
65
66
|
args: [{
|
|
66
67
|
selector: 'legend[rdxFieldsetLegend]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-fieldset.mjs","sources":["../../../packages/primitives/fieldset/src/fieldset-root.ts","../../../packages/primitives/fieldset/src/fieldset-legend.ts","../../../packages/primitives/fieldset/radix-ng-primitives-fieldset.ts"],"sourcesContent":["import { booleanAttribute, computed, Directive, inject, input } from '@angular/core';\nimport { BooleanInput, createContext } from '@radix-ng/primitives/core';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\nconst fieldsetRootContext = () => {\n const root = injectFieldsetRoot();\n\n return {\n disabledState: root.disabledState\n };\n};\n\nexport type RdxFieldsetRootContext = ReturnType<typeof fieldsetRootContext>;\n\nexport const [injectFieldsetRootContext, provideFieldsetRootContext] = createContext<RdxFieldsetRootContext>(\n 'RdxFieldsetRoot',\n 'components/fieldset'\n);\n\n/**\n * Groups related form controls and disables them as a set.\n *\n * @group Components\n */\n@Directive({\n selector: 'fieldset[rdxFieldsetRoot]',\n exportAs: 'rdxFieldsetRoot',\n providers: [provideFieldsetRootContext(fieldsetRootContext)],\n host: {\n '[attr.disabled]': 'disabledState() ? \"\" : undefined',\n '[attr.data-disabled]': 'dataAttr(disabledState())'\n }\n})\nexport class RdxFieldsetRoot {\n /**\n * Whether all controls in the fieldset are disabled.\n *\n * @group Props\n * @defaultValue false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly disabledState = computed(() => this.disabled());\n\n protected readonly dataAttr = attr;\n}\n\nfunction injectFieldsetRoot(): RdxFieldsetRoot {\n return inject(RdxFieldsetRoot);\n}\n","import { Directive } from '@angular/core';\nimport { injectFieldsetRootContext } from './fieldset-root';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Labels the fieldset.\n *\n * @group Components\n */\n@Directive({\n selector: 'legend[rdxFieldsetLegend]',\n exportAs: 'rdxFieldsetLegend',\n host: {\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'\n }\n})\nexport class RdxFieldsetLegend {\n protected readonly rootContext = injectFieldsetRootContext();\n protected readonly dataAttr = attr;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["attr"],"mappings":";;;;AAGA,MAAMA,MAAI,GAAG,CAAC,KAAc,MAAM,KAAK,GAAG,EAAE,GAAG,SAAS,CAAC;AAEzD,MAAM,mBAAmB,GAAG,MAAK;AAC7B,IAAA,MAAM,IAAI,GAAG,kBAAkB,EAAE;IAEjC,OAAO;QACH,aAAa,EAAE,IAAI,CAAC;KACvB;AACL,CAAC;AAIM,MAAM,CAAC,yBAAyB,EAAE,0BAA0B,CAAC,GAAG,aAAa,CAChF,iBAAiB,EACjB,qBAAqB;AAGzB;;;;AAIG;MAUU,eAAe,CAAA;AAT5B,IAAA,WAAA,GAAA;AAUI;;;;;AAKG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;QAE/E,IAAA,CAAA,aAAa,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-fieldset.mjs","sources":["../../../packages/primitives/fieldset/src/fieldset-root.ts","../../../packages/primitives/fieldset/src/fieldset-legend.ts","../../../packages/primitives/fieldset/radix-ng-primitives-fieldset.ts"],"sourcesContent":["import { booleanAttribute, computed, Directive, inject, input } from '@angular/core';\nimport { BooleanInput, createContext } from '@radix-ng/primitives/core';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\nconst fieldsetRootContext = () => {\n const root = injectFieldsetRoot();\n\n return {\n disabledState: root.disabledState\n };\n};\n\nexport type RdxFieldsetRootContext = ReturnType<typeof fieldsetRootContext>;\n\nexport const [injectFieldsetRootContext, provideFieldsetRootContext] = createContext<RdxFieldsetRootContext>(\n 'RdxFieldsetRoot',\n 'components/fieldset'\n);\n\n/**\n * Groups related form controls and disables them as a set.\n *\n * @group Components\n */\n@Directive({\n selector: 'fieldset[rdxFieldsetRoot]',\n exportAs: 'rdxFieldsetRoot',\n providers: [provideFieldsetRootContext(fieldsetRootContext)],\n host: {\n '[attr.disabled]': 'disabledState() ? \"\" : undefined',\n '[attr.data-disabled]': 'dataAttr(disabledState())'\n }\n})\nexport class RdxFieldsetRoot {\n /**\n * Whether all controls in the fieldset are disabled.\n *\n * @group Props\n * @defaultValue false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly disabledState = computed(() => this.disabled());\n\n protected readonly dataAttr = attr;\n}\n\nfunction injectFieldsetRoot(): RdxFieldsetRoot {\n return inject(RdxFieldsetRoot);\n}\n","import { Directive } from '@angular/core';\nimport { injectFieldsetRootContext } from './fieldset-root';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Labels the fieldset.\n *\n * @group Components\n */\n@Directive({\n selector: 'legend[rdxFieldsetLegend]',\n exportAs: 'rdxFieldsetLegend',\n host: {\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'\n }\n})\nexport class RdxFieldsetLegend {\n protected readonly rootContext = injectFieldsetRootContext();\n protected readonly dataAttr = attr;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["attr"],"mappings":";;;;AAGA,MAAMA,MAAI,GAAG,CAAC,KAAc,MAAM,KAAK,GAAG,EAAE,GAAG,SAAS,CAAC;AAEzD,MAAM,mBAAmB,GAAG,MAAK;AAC7B,IAAA,MAAM,IAAI,GAAG,kBAAkB,EAAE;IAEjC,OAAO;QACH,aAAa,EAAE,IAAI,CAAC;KACvB;AACL,CAAC;AAIM,MAAM,CAAC,yBAAyB,EAAE,0BAA0B,CAAC,GAAG,aAAa,CAChF,iBAAiB,EACjB,qBAAqB;AAGzB;;;;AAIG;MAUU,eAAe,CAAA;AAT5B,IAAA,WAAA,GAAA;AAUI;;;;;AAKG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;QAE/E,IAAA,CAAA,aAAa,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE;0FAAC;QAErC,IAAA,CAAA,QAAQ,GAAGA,MAAI;AACrC,IAAA;8GAZY,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,yVANb,CAAC,0BAA0B,CAAC,mBAAmB,CAAC,CAAC,EAAA,QAAA,EAAA,CAAA,iBAAA,CAA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