@vsn-ux/ngx-gaia 0.11.18 → 0.12.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/docs/checkbox.md +2 -1
- package/docs/data-select.md +1 -1
- package/docs/form-field.md +37 -0
- package/docs/input.md +1 -1
- package/docs/radio.md +2 -1
- package/docs/select.md +1 -1
- package/docs/switch.md +2 -1
- package/docs/text-area.md +1 -1
- package/fesm2022/vsn-ux-ngx-gaia.mjs +482 -463
- package/fesm2022/vsn-ux-ngx-gaia.mjs.map +1 -1
- package/package.json +4 -4
- package/types/vsn-ux-ngx-gaia.d.ts +24 -21
package/docs/checkbox.md
CHANGED
|
@@ -18,7 +18,8 @@ Checkbox component for boolean selections.
|
|
|
18
18
|
- `aria-label: string | null` - ARIA label (default: null)
|
|
19
19
|
- `aria-labelledby: string | null` - ARIA labelledby (default: null)
|
|
20
20
|
- `aria-describedby: string | null` - ARIA describedby (default: null)
|
|
21
|
-
- `
|
|
21
|
+
- `inError: boolean | null` - Manually overrides the error state. When omitted, derived from the form control (e.g. NgControl or signal forms) (default: null)
|
|
22
|
+
- `aria-invalid: boolean | null` - Manually overrides the invalid ARIA state. When omitted, derived from inError (default: null)
|
|
22
23
|
- `aria-errormessage: string | null` - ARIA error message ID (default: null)
|
|
23
24
|
|
|
24
25
|
### Outputs:
|
package/docs/data-select.md
CHANGED
|
@@ -23,7 +23,7 @@ Data select component that automatically generates options from an items array.
|
|
|
23
23
|
- `placeholder: string` - Placeholder text (default: '')
|
|
24
24
|
- `multiple: boolean` - Enable multi-select mode (default: false)
|
|
25
25
|
- `disabled: boolean` - Disabled state (default: false)
|
|
26
|
-
- `
|
|
26
|
+
- `inError: boolean | null` - Manually overrides the error state. When omitted, derived from the form control (e.g. NgControl or signal forms) (default: null)
|
|
27
27
|
- `compareFn: (o1: any, o2: any) => boolean` - Comparison function for object values (default: (a, b) => a === b)
|
|
28
28
|
- `searchable: boolean` - Enable search/filter functionality (default: false)
|
|
29
29
|
- `customFilter: boolean` - Disable built-in filtering for custom implementation (default: false)
|
package/docs/form-field.md
CHANGED
|
@@ -67,6 +67,25 @@ Standalone directive for connecting form controls to form field labels. Import `
|
|
|
67
67
|
|
|
68
68
|
- `provideGaFormErrors(config: GaFormErrorsConfig)` - Configure global error message templates. These messages are displayed when a validation error exists on the control (either from validators or `gaFormControlErrors`) and no specific `gaError` template is provided. This provider does not add errors to controls; it only defines how existing errors are displayed.
|
|
69
69
|
|
|
70
|
+
## Signal Forms Support
|
|
71
|
+
|
|
72
|
+
The form field works with Angular Signal Forms (`[formField]` directive). Use `gaFormControl` alongside `[formField]`:
|
|
73
|
+
|
|
74
|
+
```html
|
|
75
|
+
<ga-form-field>
|
|
76
|
+
<ga-label>Email</ga-label>
|
|
77
|
+
<input gaFormControl gaInput [formField]="myForm.email" />
|
|
78
|
+
</ga-form-field>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Signal forms validators with a `message` option are automatically displayed without needing `gaError` templates or global errors.
|
|
82
|
+
|
|
83
|
+
### Error Message Priority
|
|
84
|
+
|
|
85
|
+
1. `gaError` template (local)
|
|
86
|
+
2. Signal forms validator `message`
|
|
87
|
+
3. `provideGaFormErrors()` (global)
|
|
88
|
+
|
|
70
89
|
## Examples
|
|
71
90
|
|
|
72
91
|
Complete form field
|
|
@@ -142,3 +161,21 @@ Global error override behavior
|
|
|
142
161
|
<!-- The 'minlength' error will use the global message if configured -->
|
|
143
162
|
</ga-form-field>
|
|
144
163
|
```
|
|
164
|
+
|
|
165
|
+
Signal forms with automatic error messages
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
model = signal({ email: '' });
|
|
169
|
+
emailForm = form(this.model, (schemaPath) => {
|
|
170
|
+
required(schemaPath.email, { message: 'Email is required.' });
|
|
171
|
+
minLength(schemaPath.email, 5, { message: 'At least 5 characters.' });
|
|
172
|
+
});
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
```html
|
|
176
|
+
<ga-form-field>
|
|
177
|
+
<ga-label>Email</ga-label>
|
|
178
|
+
<input gaFormControl gaInput [formField]="emailForm.email" />
|
|
179
|
+
<!-- No gaError templates needed — messages from validators are used automatically -->
|
|
180
|
+
</ga-form-field>
|
|
181
|
+
```
|
package/docs/input.md
CHANGED
|
@@ -14,7 +14,7 @@ Export: `gaInput`
|
|
|
14
14
|
|
|
15
15
|
- `id: string` - Element ID (default: auto-generated)
|
|
16
16
|
- `disabled: boolean` - Disabled state
|
|
17
|
-
- `
|
|
17
|
+
- `inError: boolean` - Manually overrides the error state. When omitted, derived from the form control (e.g. NgControl or signal forms)
|
|
18
18
|
|
|
19
19
|
### Methods
|
|
20
20
|
|
package/docs/radio.md
CHANGED
|
@@ -32,7 +32,8 @@ Individual radio button component.
|
|
|
32
32
|
- `aria-label: string | null` - Accessibility label
|
|
33
33
|
- `aria-labelledby: string | null` - ID of labelling element
|
|
34
34
|
- `aria-describedby: string | null` - ID of describing element
|
|
35
|
-
- `
|
|
35
|
+
- `inError: boolean | null` - Manually overrides the error state. When omitted, derived from the form control (e.g. NgControl or signal forms) (default: null)
|
|
36
|
+
- `aria-invalid: boolean | null` - Overrides the error state, takes precedence over `inError` (default: null)
|
|
36
37
|
- `aria-errormessage: string | null` - ID of error message element
|
|
37
38
|
|
|
38
39
|
### Outputs
|
package/docs/select.md
CHANGED
|
@@ -13,7 +13,7 @@ Select component with dropdown functionality.
|
|
|
13
13
|
- `value: any` - Selected value (single/multiple)
|
|
14
14
|
- `placeholder: string` - Placeholder text
|
|
15
15
|
- `disabled: boolean` - Disabled state (default: false)
|
|
16
|
-
- `
|
|
16
|
+
- `inError: boolean` - Manually overrides the error state. When omitted, derived from the form control (e.g. NgControl or signal forms) (default: null)
|
|
17
17
|
- `multiple: boolean` - Enable multiple selection (default: false)
|
|
18
18
|
- `searchable: boolean` - Enable search functionality (default: false)
|
|
19
19
|
- `searchInputLabel: string | null` - Label for search input (default: null)
|
package/docs/switch.md
CHANGED
|
@@ -17,7 +17,8 @@ Switch component for boolean toggle controls.
|
|
|
17
17
|
- `aria-labelledby: string | null` - ID of labelling element (default: null)
|
|
18
18
|
- `aria-describedby: string | null` - ID of describing element (default: null)
|
|
19
19
|
- `aria-errormessage: string | null` - ID of error message element (default: null)
|
|
20
|
-
- `aria-invalid:
|
|
20
|
+
- `aria-invalid: boolean | null` - Manually marks the control as invalid (default: null)
|
|
21
|
+
- `inError: boolean | null` - Manually overrides the error state. When omitted, derived from the form control (e.g. NgControl or signal forms) (default: null)
|
|
21
22
|
|
|
22
23
|
### Outputs
|
|
23
24
|
|
package/docs/text-area.md
CHANGED
|
@@ -12,7 +12,7 @@ Applies Gaia styling to textarea elements with automatic form field integration.
|
|
|
12
12
|
|
|
13
13
|
- `id: string` - Custom ID for the textarea (default: auto-generated)
|
|
14
14
|
- `disabled: boolean` - Whether the textarea is disabled (default: false)
|
|
15
|
-
- `
|
|
15
|
+
- `inError: boolean` - Manually overrides the error state. When omitted, derived from the form control (e.g. NgControl or signal forms)
|
|
16
16
|
|
|
17
17
|
## Examples
|
|
18
18
|
|