@arsedizioni/ars-utils 22.6.86 → 22.6.88
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/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +3158 -3344
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +7616 -4772
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.date.mjs +321 -702
- package/fesm2022/arsedizioni-ars-utils-core.date.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs +445 -590
- package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.mjs +1735 -2370
- package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.validators.mjs +1280 -1470
- package/fesm2022/arsedizioni-ars-utils-core.validators.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs +1097 -1528
- package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs +198 -294
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs +115 -117
- package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs +1607 -613
- package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs +840 -367
- package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs +1634 -651
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs +1255 -792
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs +1410 -357
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs +2401 -944
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.files.mjs +1553 -741
- package/fesm2022/arsedizioni-ars-utils-ui.files.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs +901 -430
- package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.help.mjs +737 -530
- package/fesm2022/arsedizioni-ars-utils-ui.help.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.mjs +6638 -1755
- package/fesm2022/arsedizioni-ars-utils-ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs +1479 -1207
- package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs +1003 -270
- package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs +497 -278
- package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs +48 -52
- package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs +464 -704
- package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs +724 -657
- package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils.mjs +3 -19
- package/fesm2022/arsedizioni-ars-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/types/arsedizioni-ars-utils-clipper.common.d.ts +1151 -1163
- package/types/arsedizioni-ars-utils-clipper.ui.d.ts +1588 -1426
- package/types/arsedizioni-ars-utils-core.d.ts +1169 -1172
- package/types/arsedizioni-ars-utils-core.date.d.ts +204 -208
- package/types/arsedizioni-ars-utils-core.markdown.d.ts +128 -126
- package/types/arsedizioni-ars-utils-core.validators.d.ts +270 -236
- package/types/arsedizioni-ars-utils-evolution.common.d.ts +1054 -1067
- package/types/arsedizioni-ars-utils-support.common.d.ts +225 -234
- package/types/arsedizioni-ars-utils-ui.controls.d.ts +440 -278
- package/types/arsedizioni-ars-utils-ui.controls.date.d.ts +24 -28
- package/types/arsedizioni-ars-utils-ui.controls.tree.d.ts +172 -136
- package/types/arsedizioni-ars-utils-ui.d.ts +2035 -821
- package/types/arsedizioni-ars-utils-ui.dialogs.auth.d.ts +327 -322
- package/types/arsedizioni-ars-utils-ui.dialogs.d.ts +343 -347
- package/types/arsedizioni-ars-utils-ui.dialogs.prompt.d.ts +167 -167
- package/types/arsedizioni-ars-utils-ui.dialogs.select.d.ts +373 -367
- package/types/arsedizioni-ars-utils-ui.files.d.ts +335 -283
- package/types/arsedizioni-ars-utils-ui.filters.d.ts +232 -160
- package/types/arsedizioni-ars-utils-ui.help.d.ts +204 -211
- package/types/arsedizioni-ars-utils-ui.navigation.d.ts +811 -646
- package/types/arsedizioni-ars-utils-ui.notifications.d.ts +74 -78
- package/types/arsedizioni-ars-utils-ui.oauth.d.ts +102 -62
- package/types/arsedizioni-ars-utils-ui.paginator.d.ts +19 -22
- package/types/arsedizioni-ars-utils-ui.shell.d.ts +376 -382
- package/types/arsedizioni-ars-utils-ui.tinymce.d.ts +244 -231
- package/types/arsedizioni-ars-utils.d.ts +1 -3
|
@@ -1,41 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { Validated } from
|
|
5
|
-
|
|
1
|
+
import { AbstractControl, ValidationErrors, Validator } from "@angular/forms";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { LogicFn, PathKind, SchemaPath, SchemaPathRules } from "@angular/forms/signals";
|
|
4
|
+
import { Validated } from "@arsedizioni/ars-utils/core";
|
|
6
5
|
/**
|
|
7
6
|
* Directive that delegates validation to an externally provided validator function.
|
|
8
7
|
* Bind `[validator]="myFn"` where `myFn` is `(c: AbstractControl) => ValidationErrors | null`.
|
|
9
8
|
*/
|
|
10
|
-
declare class ValidatorDirective implements Validator {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
export declare class ValidatorDirective implements Validator {
|
|
10
|
+
/** The custom validator function to apply. */
|
|
11
|
+
readonly validator: import("@angular/core").InputSignal<(control: AbstractControl) => ValidationErrors | null>;
|
|
12
|
+
/**
|
|
13
|
+
* Invokes the provided validator function against the given control.
|
|
14
|
+
* Returns `null` (valid) when no function is bound.
|
|
15
|
+
* @param control - The form control to validate.
|
|
16
|
+
*/
|
|
17
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValidatorDirective, never>;
|
|
19
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ValidatorDirective, "[validator]", never, {
|
|
20
|
+
"validator": {
|
|
21
|
+
"alias": "validator";
|
|
22
|
+
"required": false;
|
|
23
|
+
"isSignal": true;
|
|
24
|
+
};
|
|
25
|
+
}, {}, never, never, true, never>;
|
|
21
26
|
}
|
|
22
|
-
|
|
23
27
|
/**
|
|
24
28
|
* Directive that validates a control using the host object's `isValid()` method
|
|
25
29
|
* or a boolean expression passed via `[validIf]`.
|
|
26
30
|
*/
|
|
27
|
-
declare class ValidIfDirective implements Validator {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
export declare class ValidIfDirective implements Validator {
|
|
32
|
+
/** When `true`, the control is considered valid regardless of the bound value. */
|
|
33
|
+
readonly validIf: import("@angular/core").InputSignal<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Validates the control value against a boolean flag or the value's own `isValid()` method.
|
|
36
|
+
* @param control - The form control to validate.
|
|
37
|
+
*/
|
|
38
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValidIfDirective, never>;
|
|
40
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ValidIfDirective, "[validIf]", never, {
|
|
41
|
+
"validIf": {
|
|
42
|
+
"alias": "validIf";
|
|
43
|
+
"required": false;
|
|
44
|
+
"isSignal": true;
|
|
45
|
+
};
|
|
46
|
+
}, {}, never, never, true, never>;
|
|
37
47
|
}
|
|
38
|
-
|
|
39
48
|
/**
|
|
40
49
|
* Directive that validates that the host control's value equals the value of another control.
|
|
41
50
|
* Bind `[equals]="otherControl"`.
|
|
@@ -49,25 +58,30 @@ declare class ValidIfDirective implements Validator {
|
|
|
49
58
|
* Angular's `onValidatorChange` instead would re-emit valueChanges, so a
|
|
50
59
|
* reciprocal setup (A [equals]=B and B [equals]=A) would overflow the stack.
|
|
51
60
|
*/
|
|
52
|
-
declare class EqualsValidatorDirective implements Validator {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
export declare class EqualsValidatorDirective implements Validator {
|
|
62
|
+
/** The control whose value must match the host control's value. */
|
|
63
|
+
readonly equals: import("@angular/core").InputSignal<AbstractControl<any, any, any>>;
|
|
64
|
+
/** The host control, captured on the first validate() call. */
|
|
65
|
+
private hostControl?;
|
|
66
|
+
/** Subscription to the other control's valueChanges. */
|
|
67
|
+
private subscription?;
|
|
68
|
+
constructor();
|
|
69
|
+
/**
|
|
70
|
+
* Validates that the host control value equals the bound control's value.
|
|
71
|
+
* Returns `null` (valid) when no control is bound.
|
|
72
|
+
* @param control - The form control to validate.
|
|
73
|
+
* @returns `null` when valid, `{ equals: ... }` otherwise.
|
|
74
|
+
*/
|
|
75
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
76
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EqualsValidatorDirective, never>;
|
|
77
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<EqualsValidatorDirective, "[equals]", never, {
|
|
78
|
+
"equals": {
|
|
79
|
+
"alias": "equals";
|
|
80
|
+
"required": false;
|
|
81
|
+
"isSignal": true;
|
|
82
|
+
};
|
|
83
|
+
}, {}, never, never, true, never>;
|
|
69
84
|
}
|
|
70
|
-
|
|
71
85
|
/**
|
|
72
86
|
* Directive that validates that the host control's value is different from another control's value.
|
|
73
87
|
* Bind `[notEqual]="otherControl"`.
|
|
@@ -81,177 +95,201 @@ declare class EqualsValidatorDirective implements Validator {
|
|
|
81
95
|
* WITH events, so a reciprocal setup (A [notEqual]=B and B [notEqual]=A) would
|
|
82
96
|
* ping-pong valueChanges between the two controls and overflow the stack.
|
|
83
97
|
*/
|
|
84
|
-
declare class NotEqualValidatorDirective implements Validator {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
export declare class NotEqualValidatorDirective implements Validator {
|
|
99
|
+
/** The control whose value must differ from the host control's value. */
|
|
100
|
+
readonly notEqual: import("@angular/core").InputSignal<AbstractControl<any, any, any>>;
|
|
101
|
+
/** The host control, captured on the first validate() call. */
|
|
102
|
+
private hostControl?;
|
|
103
|
+
/** Subscription to the other control's valueChanges. */
|
|
104
|
+
private subscription?;
|
|
105
|
+
constructor();
|
|
106
|
+
/**
|
|
107
|
+
* Validates that the host control value is not equal to the bound control's value.
|
|
108
|
+
* Also clears the `notequal` error on the other control when the host becomes valid.
|
|
109
|
+
* Returns `null` (valid) when no control is bound.
|
|
110
|
+
* @param control - The form control to validate.
|
|
111
|
+
* @returns `null` when valid, `{ notequal: true }` otherwise.
|
|
112
|
+
*/
|
|
113
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
114
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NotEqualValidatorDirective, never>;
|
|
115
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NotEqualValidatorDirective, "[notEqual]", never, {
|
|
116
|
+
"notEqual": {
|
|
117
|
+
"alias": "notEqual";
|
|
118
|
+
"required": false;
|
|
119
|
+
"isSignal": true;
|
|
120
|
+
};
|
|
121
|
+
}, {}, never, never, true, never>;
|
|
102
122
|
}
|
|
103
|
-
|
|
104
123
|
/**
|
|
105
124
|
* Directive that validates a semicolon-separated list of email addresses.
|
|
106
125
|
* Apply `emails` to a text input containing one or more addresses separated by `;`.
|
|
107
126
|
*/
|
|
108
|
-
declare class EmailsValidatorDirective implements Validator {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
127
|
+
export declare class EmailsValidatorDirective implements Validator {
|
|
128
|
+
/**
|
|
129
|
+
* Validates each address in a semicolon-separated email list.
|
|
130
|
+
* Returns `null` when the control is empty.
|
|
131
|
+
* @param control - The form control to validate.
|
|
132
|
+
*/
|
|
133
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
134
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EmailsValidatorDirective, never>;
|
|
135
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<EmailsValidatorDirective, "[emails]", never, {}, {}, never, never, true, never>;
|
|
117
136
|
}
|
|
118
|
-
|
|
119
137
|
/**
|
|
120
138
|
* Directive that validates a control value as a GUID / UUID string.
|
|
121
139
|
* Apply `guid` to a text input that expects a valid UUID.
|
|
122
140
|
*/
|
|
123
|
-
declare class GuidValidatorDirective implements Validator {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
141
|
+
export declare class GuidValidatorDirective implements Validator {
|
|
142
|
+
/**
|
|
143
|
+
* Validates that the control value is a well-formed GUID / UUID.
|
|
144
|
+
* Returns `null` when the control is empty.
|
|
145
|
+
* @param control - The form control to validate.
|
|
146
|
+
*/
|
|
147
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
148
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GuidValidatorDirective, never>;
|
|
149
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GuidValidatorDirective, "[guid]", never, {}, {}, never, never, true, never>;
|
|
132
150
|
}
|
|
133
|
-
|
|
134
151
|
/**
|
|
135
152
|
* Directive that validates a control value as a parseable SQL-compatible date string.
|
|
136
153
|
* Apply `sqlDate` to a text input that expects a date after year 1750.
|
|
137
154
|
*/
|
|
138
|
-
declare class SqlDateValidatorDirective implements Validator {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
155
|
+
export declare class SqlDateValidatorDirective implements Validator {
|
|
156
|
+
/**
|
|
157
|
+
* Validates that the control value can be parsed as a date after 1750.
|
|
158
|
+
* Returns `null` when the control is empty.
|
|
159
|
+
* @param control - The form control to validate.
|
|
160
|
+
*/
|
|
161
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
162
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SqlDateValidatorDirective, never>;
|
|
163
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SqlDateValidatorDirective, "[sqlDate]", never, {}, {}, never, never, true, never>;
|
|
147
164
|
}
|
|
148
|
-
|
|
149
165
|
/**
|
|
150
166
|
* Directive that validates that a control value is not a future date.
|
|
151
167
|
* Apply `notFuture` to a text input that expects a date on or before today.
|
|
152
168
|
*/
|
|
153
|
-
declare class NotFutureValidatorDirective implements Validator {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
169
|
+
export declare class NotFutureValidatorDirective implements Validator {
|
|
170
|
+
/**
|
|
171
|
+
* Validates that the control value represents a date that is not in the future.
|
|
172
|
+
* Returns `null` when the control is empty.
|
|
173
|
+
* @param control - The form control to validate.
|
|
174
|
+
*/
|
|
175
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
176
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NotFutureValidatorDirective, never>;
|
|
177
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NotFutureValidatorDirective, "[notFuture]", never, {}, {}, never, never, true, never>;
|
|
162
178
|
}
|
|
163
|
-
|
|
164
179
|
/**
|
|
165
180
|
* Directive that validates a control value as a well-formed URL.
|
|
166
181
|
* Apply `url` to a text input that expects a URL.
|
|
167
182
|
*/
|
|
168
|
-
declare class UrlValidatorDirective implements Validator {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
183
|
+
export declare class UrlValidatorDirective implements Validator {
|
|
184
|
+
/**
|
|
185
|
+
* Validates that the control value is a well-formed URL.
|
|
186
|
+
* Returns `null` (valid) when the control is empty.
|
|
187
|
+
* @param control - The form control to validate.
|
|
188
|
+
*/
|
|
189
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
190
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UrlValidatorDirective, never>;
|
|
191
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<UrlValidatorDirective, "[url]", never, {}, {}, never, never, true, never>;
|
|
177
192
|
}
|
|
178
|
-
|
|
179
193
|
/**
|
|
180
194
|
* Directive that validates a file size against configurable minimum and maximum bounds.
|
|
181
195
|
* Bind `[fileSize]` together with `[size]="fileSizeInMb"`, `[maxSizeMb]`, and `[minSizeMb]`.
|
|
182
196
|
*/
|
|
183
|
-
declare class FileSizeValidatorDirective implements Validator {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
197
|
+
export declare class FileSizeValidatorDirective implements Validator {
|
|
198
|
+
/** Maximum allowed file size in megabytes. Defaults to 5. */
|
|
199
|
+
readonly maxSizeMb: import("@angular/core").InputSignal<number>;
|
|
200
|
+
/** Minimum required file size in megabytes. Defaults to 0. */
|
|
201
|
+
readonly minSizeMb: import("@angular/core").InputSignal<number>;
|
|
202
|
+
/** The actual file size in megabytes to validate against the bounds. */
|
|
203
|
+
readonly size: import("@angular/core").InputSignal<number>;
|
|
204
|
+
/**
|
|
205
|
+
* Validates that the bound file size falls within the configured min/max range.
|
|
206
|
+
* Returns `null` when no control value is present.
|
|
207
|
+
* @param control - The form control to validate.
|
|
208
|
+
*/
|
|
209
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
210
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileSizeValidatorDirective, never>;
|
|
211
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FileSizeValidatorDirective, "[fileSize]", never, {
|
|
212
|
+
"maxSizeMb": {
|
|
213
|
+
"alias": "maxSizeMb";
|
|
214
|
+
"required": false;
|
|
215
|
+
"isSignal": true;
|
|
216
|
+
};
|
|
217
|
+
"minSizeMb": {
|
|
218
|
+
"alias": "minSizeMb";
|
|
219
|
+
"required": false;
|
|
220
|
+
"isSignal": true;
|
|
221
|
+
};
|
|
222
|
+
"size": {
|
|
223
|
+
"alias": "size";
|
|
224
|
+
"required": false;
|
|
225
|
+
"isSignal": true;
|
|
226
|
+
};
|
|
227
|
+
}, {}, never, never, true, never>;
|
|
198
228
|
}
|
|
199
|
-
|
|
200
229
|
/**
|
|
201
230
|
* Directive that validates that a control value does not exceed a maximum word count.
|
|
202
231
|
* Bind `[maxTerms]="10"` to allow at most 10 whitespace-separated terms.
|
|
203
232
|
*/
|
|
204
|
-
declare class MaxTermsValidatorDirective implements Validator {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
233
|
+
export declare class MaxTermsValidatorDirective implements Validator {
|
|
234
|
+
/** The maximum number of whitespace-separated terms allowed. */
|
|
235
|
+
readonly maxTerms: import("@angular/core").InputSignal<number>;
|
|
236
|
+
/**
|
|
237
|
+
* Validates that the control value contains no more than the configured number of terms.
|
|
238
|
+
* Returns `null` when the control is empty.
|
|
239
|
+
* @param control - The form control to validate.
|
|
240
|
+
*/
|
|
241
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
242
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MaxTermsValidatorDirective, never>;
|
|
243
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MaxTermsValidatorDirective, "[maxTerms]", never, {
|
|
244
|
+
"maxTerms": {
|
|
245
|
+
"alias": "maxTerms";
|
|
246
|
+
"required": false;
|
|
247
|
+
"isSignal": true;
|
|
248
|
+
};
|
|
249
|
+
}, {}, never, never, true, never>;
|
|
215
250
|
}
|
|
216
|
-
|
|
217
251
|
/**
|
|
218
252
|
* Directive that validates a control value as a sufficiently strong password.
|
|
219
253
|
* Apply `password` to a password input.
|
|
220
254
|
*/
|
|
221
|
-
declare class PasswordValidatorDirective implements Validator {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
255
|
+
export declare class PasswordValidatorDirective implements Validator {
|
|
256
|
+
/**
|
|
257
|
+
* Validates that the control value meets the minimum password-strength requirements.
|
|
258
|
+
* @param control - The form control to validate.
|
|
259
|
+
*/
|
|
260
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
261
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PasswordValidatorDirective, never>;
|
|
262
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<PasswordValidatorDirective, "[password]", never, {}, {}, never, never, true, never>;
|
|
229
263
|
}
|
|
230
|
-
|
|
231
264
|
/**
|
|
232
265
|
* Directive that validates a time string against optional allowed time slot ranges.
|
|
233
266
|
* Bind `[time]` and optionally `[slots]="'08:00-12:00|14:00-18:00'"` (pipe-separated ranges).
|
|
234
267
|
*/
|
|
235
|
-
declare class TimeValidatorDirective implements Validator {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
268
|
+
export declare class TimeValidatorDirective implements Validator {
|
|
269
|
+
/** Optional pipe-separated list of allowed time ranges, e.g. `"08:00-12:00|14:00-18:00"`. */
|
|
270
|
+
readonly slots: import("@angular/core").InputSignal<string>;
|
|
271
|
+
/**
|
|
272
|
+
* Parses a `"HH:MM"` time string into a comparable integer (e.g. `"09:30"` -> `930`).
|
|
273
|
+
* Returns `-1` when the string is not a valid time.
|
|
274
|
+
* @param value - The time string to parse.
|
|
275
|
+
*/
|
|
276
|
+
private getTime;
|
|
277
|
+
/**
|
|
278
|
+
* Validates that the control value is a valid time string and, when slots are configured,
|
|
279
|
+
* that it falls within at least one of the allowed ranges.
|
|
280
|
+
* Returns `null` when the control is empty.
|
|
281
|
+
* @param control - The form control to validate.
|
|
282
|
+
*/
|
|
283
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
284
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TimeValidatorDirective, never>;
|
|
285
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TimeValidatorDirective, "[time]", never, {
|
|
286
|
+
"slots": {
|
|
287
|
+
"alias": "slots";
|
|
288
|
+
"required": false;
|
|
289
|
+
"isSignal": true;
|
|
290
|
+
};
|
|
291
|
+
}, {}, never, never, true, never>;
|
|
253
292
|
}
|
|
254
|
-
|
|
255
293
|
/**
|
|
256
294
|
* Directive that validates that a control value is not blank: neither a whitespace-only string
|
|
257
295
|
* nor an empty array. Apply `notEmpty` to a text input where non-blank content is required, or
|
|
@@ -260,37 +298,36 @@ declare class TimeValidatorDirective implements Validator {
|
|
|
260
298
|
* A value that is simply absent passes: saying "obbligatorio" is the job of `required`, which is
|
|
261
299
|
* declared next to this one when both rules belong on the same control.
|
|
262
300
|
*/
|
|
263
|
-
declare class NotEmptyValidatorDirective implements Validator {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
301
|
+
export declare class NotEmptyValidatorDirective implements Validator {
|
|
302
|
+
/**
|
|
303
|
+
* Validates that the control value carries content.
|
|
304
|
+
* Returns `null` when the control is absent or holds a type this rule says nothing about.
|
|
305
|
+
* @param control - The form control to validate.
|
|
306
|
+
* @returns `{ notEmpty: true }` when the value is a blank string or an empty array, `null` otherwise.
|
|
307
|
+
*/
|
|
308
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
309
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NotEmptyValidatorDirective, never>;
|
|
310
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NotEmptyValidatorDirective, "[notEmpty]", never, {}, {}, never, never, true, never>;
|
|
273
311
|
}
|
|
274
|
-
|
|
275
312
|
/**
|
|
276
313
|
* Options shared by the ARS signal-form validators.
|
|
277
314
|
*
|
|
278
315
|
* Mirrors the `config` argument of the Angular built-ins (`required`, `email`, ...) but carries
|
|
279
316
|
* only what these validators need: the message shown to the user in place of the default one.
|
|
280
317
|
*/
|
|
281
|
-
interface ArsValidatorConfig<TValue = string, TPathKind extends PathKind = PathKind.Root> {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
318
|
+
export interface ArsValidatorConfig<TValue = string, TPathKind extends PathKind = PathKind.Root> {
|
|
319
|
+
/** Message attached to the error, in place of the default Italian text. */
|
|
320
|
+
message?: string;
|
|
321
|
+
/**
|
|
322
|
+
* Applies the rule only while this returns `true`, exactly like the `when` of `required()`
|
|
323
|
+
* and of the other Angular built-ins.
|
|
324
|
+
*
|
|
325
|
+
* It exists because these validators are meant to be paired with `required()` on the same
|
|
326
|
+
* field, and a field that is only required in one mode of a dialog must only be validated in
|
|
327
|
+
* that mode: without this, a leftover value would keep a form invalid in a mode where the
|
|
328
|
+
* field is not even shown.
|
|
329
|
+
*/
|
|
330
|
+
when?: NoInfer<LogicFn<TValue, boolean, TPathKind>>;
|
|
294
331
|
}
|
|
295
332
|
/**
|
|
296
333
|
* Default texts of the rules declared here, in one place so that the validators and the fallback
|
|
@@ -306,8 +343,8 @@ interface ArsValidatorConfig<TValue = string, TPathKind extends PathKind = PathK
|
|
|
306
343
|
* What it does catch is the 01/01/0001 or 01/01/0020 that a mistyped year produces, which SQL
|
|
307
344
|
* Server would reject with an error nobody can read.
|
|
308
345
|
*/
|
|
309
|
-
declare const MIN_VALID_YEAR = 1750;
|
|
310
|
-
declare const ARS_VALIDATOR_MESSAGES: Record<string, string>;
|
|
346
|
+
export declare const MIN_VALID_YEAR = 1750;
|
|
347
|
+
export declare const ARS_VALIDATOR_MESSAGES: Record<string, string>;
|
|
311
348
|
/**
|
|
312
349
|
* Requires the value to be a well-formed GUID / UUID.
|
|
313
350
|
*
|
|
@@ -321,7 +358,7 @@ declare const ARS_VALIDATOR_MESSAGES: Record<string, string>;
|
|
|
321
358
|
* @example
|
|
322
359
|
* const f = form(this.model, p => { required(p.serial); guid(p.serial); });
|
|
323
360
|
*/
|
|
324
|
-
declare function guid<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
361
|
+
export declare function guid<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
325
362
|
/**
|
|
326
363
|
* Requires the value to be a password strong enough for {@link SystemUtils.calculatePasswordStrength}.
|
|
327
364
|
*
|
|
@@ -332,7 +369,7 @@ declare function guid<TPathKind extends PathKind = PathKind.Root>(path: SchemaPa
|
|
|
332
369
|
* @param config - Optional message override.
|
|
333
370
|
* @returns void
|
|
334
371
|
*/
|
|
335
|
-
declare function password<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
372
|
+
export declare function password<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
336
373
|
/**
|
|
337
374
|
* Requires the value not to be made of whitespace alone, and a collection not to be empty.
|
|
338
375
|
*
|
|
@@ -357,7 +394,7 @@ declare function password<TPathKind extends PathKind = PathKind.Root>(path: Sche
|
|
|
357
394
|
* @example
|
|
358
395
|
* const f = form(this.model, p => { notEmpty(p.tags); }); // at least one tag
|
|
359
396
|
*/
|
|
360
|
-
declare function notEmpty<TValue extends string | readonly unknown[] | undefined, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
397
|
+
export declare function notEmpty<TValue extends string | readonly unknown[] | undefined, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
361
398
|
/**
|
|
362
399
|
* Requires the value to differ from the value of another field of the same form.
|
|
363
400
|
*
|
|
@@ -371,7 +408,7 @@ declare function notEmpty<TValue extends string | readonly unknown[] | undefined
|
|
|
371
408
|
* @param config - Optional message override and `when` condition.
|
|
372
409
|
* @returns void
|
|
373
410
|
*/
|
|
374
|
-
declare function notEqual<TValue, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, other: SchemaPath<TValue, SchemaPathRules.Supported>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
411
|
+
export declare function notEqual<TValue, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, other: SchemaPath<TValue, SchemaPathRules.Supported>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
375
412
|
/**
|
|
376
413
|
* Requires the value to be a real date, as {@link SystemUtils.parseDate} understands one.
|
|
377
414
|
*
|
|
@@ -392,7 +429,7 @@ declare function notEqual<TValue, TPathKind extends PathKind = PathKind.Root>(pa
|
|
|
392
429
|
* @example
|
|
393
430
|
* const f = form(this.model, p => { required(p.expiry); date(p.expiry); });
|
|
394
431
|
*/
|
|
395
|
-
declare function date<TValue extends string | Date | null | undefined, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
432
|
+
export declare function date<TValue extends string | Date | null | undefined, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
396
433
|
/**
|
|
397
434
|
* Requires the two ends of a date range to be real dates and to be in order.
|
|
398
435
|
*
|
|
@@ -413,7 +450,7 @@ declare function date<TValue extends string | Date | null | undefined, TPathKind
|
|
|
413
450
|
* @example
|
|
414
451
|
* const f = form(this.model, p => { dateRange(p.sentFrom, p.sentTo); });
|
|
415
452
|
*/
|
|
416
|
-
declare function dateRange<TValue extends string | Date | null | undefined, TPathKind extends PathKind = PathKind.Root>(from: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, to: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
453
|
+
export declare function dateRange<TValue extends string | Date | null | undefined, TPathKind extends PathKind = PathKind.Root>(from: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, to: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
417
454
|
/**
|
|
418
455
|
* Requires the value to be a date that is not in the future.
|
|
419
456
|
*
|
|
@@ -431,7 +468,7 @@ declare function dateRange<TValue extends string | Date | null | undefined, TPat
|
|
|
431
468
|
* @example
|
|
432
469
|
* const f = form(this.model, p => { required(p.executionDate); notFuture(p.executionDate); });
|
|
433
470
|
*/
|
|
434
|
-
declare function notFuture<TValue extends string | Date | null | undefined, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
471
|
+
export declare function notFuture<TValue extends string | Date | null | undefined, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
435
472
|
/**
|
|
436
473
|
* Requires the value to be a date that is not in the past.
|
|
437
474
|
*
|
|
@@ -450,7 +487,7 @@ declare function notFuture<TValue extends string | Date | null | undefined, TPat
|
|
|
450
487
|
* @example
|
|
451
488
|
* const f = form(this.model, p => { required(p.scadenza); notPast(p.scadenza); });
|
|
452
489
|
*/
|
|
453
|
-
declare function notPast<TValue extends string | Date | null | undefined, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
490
|
+
export declare function notPast<TValue extends string | Date | null | undefined, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
454
491
|
/**
|
|
455
492
|
* Requires the value to be a well-formed URL. An empty value passes, as everywhere else here.
|
|
456
493
|
*
|
|
@@ -460,7 +497,7 @@ declare function notPast<TValue extends string | Date | null | undefined, TPathK
|
|
|
460
497
|
* @param config - Optional message override and `when` condition.
|
|
461
498
|
* @returns void
|
|
462
499
|
*/
|
|
463
|
-
declare function url<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
500
|
+
export declare function url<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
464
501
|
/**
|
|
465
502
|
* Requires the value to hold no more than `max` whitespace-separated terms.
|
|
466
503
|
*
|
|
@@ -472,7 +509,7 @@ declare function url<TPathKind extends PathKind = PathKind.Root>(path: SchemaPat
|
|
|
472
509
|
* @param config - Optional message override and `when` condition.
|
|
473
510
|
* @returns void
|
|
474
511
|
*/
|
|
475
|
-
declare function maxTerms<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, max: number | (() => number), config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
512
|
+
export declare function maxTerms<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, max: number | (() => number), config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
476
513
|
/**
|
|
477
514
|
* Requires the size of the picked file to fall within the allowed range.
|
|
478
515
|
*
|
|
@@ -488,7 +525,7 @@ declare function maxTerms<TPathKind extends PathKind = PathKind.Root>(path: Sche
|
|
|
488
525
|
* @param config - Optional message override and `when` condition.
|
|
489
526
|
* @returns void
|
|
490
527
|
*/
|
|
491
|
-
declare function fileSize<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, sizeMb: () => number | undefined, maxSizeMb?: number | (() => number), minSizeMb?: number | (() => number), config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
528
|
+
export declare function fileSize<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, sizeMb: () => number | undefined, maxSizeMb?: number | (() => number), minSizeMb?: number | (() => number), config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
492
529
|
/**
|
|
493
530
|
* Requires the value to declare itself valid.
|
|
494
531
|
*
|
|
@@ -502,7 +539,7 @@ declare function fileSize<TPathKind extends PathKind = PathKind.Root>(path: Sche
|
|
|
502
539
|
* @param config - Optional message override and `when` condition.
|
|
503
540
|
* @returns void
|
|
504
541
|
*/
|
|
505
|
-
declare function validIf<TValue extends Partial<Validated>, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, flag?: boolean | (() => boolean), config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
542
|
+
export declare function validIf<TValue extends Partial<Validated>, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, flag?: boolean | (() => boolean), config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
506
543
|
/**
|
|
507
544
|
* Requires the value to be a semicolon-separated list of valid e-mail addresses.
|
|
508
545
|
*
|
|
@@ -514,7 +551,7 @@ declare function validIf<TValue extends Partial<Validated>, TPathKind extends Pa
|
|
|
514
551
|
* @param config - Optional message override and `when` condition.
|
|
515
552
|
* @returns void
|
|
516
553
|
*/
|
|
517
|
-
declare function emails<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
554
|
+
export declare function emails<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
518
555
|
/**
|
|
519
556
|
* Requires the value to be a `"HH:MM"` time and, when slots are given, to fall inside one of them.
|
|
520
557
|
*
|
|
@@ -526,7 +563,7 @@ declare function emails<TPathKind extends PathKind = PathKind.Root>(path: Schema
|
|
|
526
563
|
* @param config - Optional message override and `when` condition.
|
|
527
564
|
* @returns void
|
|
528
565
|
*/
|
|
529
|
-
declare function time<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, slots?: () => string | undefined, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
566
|
+
export declare function time<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, slots?: () => string | undefined, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
530
567
|
/**
|
|
531
568
|
* Requires the value to equal the value of another field of the same form.
|
|
532
569
|
*
|
|
@@ -539,7 +576,7 @@ declare function time<TPathKind extends PathKind = PathKind.Root>(path: SchemaPa
|
|
|
539
576
|
* @param config - Optional message override and `when` condition.
|
|
540
577
|
* @returns void
|
|
541
578
|
*/
|
|
542
|
-
declare function equals<TValue, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, other: SchemaPath<TValue, SchemaPathRules.Supported>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
579
|
+
export declare function equals<TValue, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, other: SchemaPath<TValue, SchemaPathRules.Supported>, config?: ArsValidatorConfig<TValue, TPathKind>): void;
|
|
543
580
|
/**
|
|
544
581
|
* Requires the value to be either empty or a complete six-digit one-time code.
|
|
545
582
|
*
|
|
@@ -550,7 +587,7 @@ declare function equals<TValue, TPathKind extends PathKind = PathKind.Root>(path
|
|
|
550
587
|
* @param config - Optional message override and `when` condition.
|
|
551
588
|
* @returns void
|
|
552
589
|
*/
|
|
553
|
-
declare function otp<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
590
|
+
export declare function otp<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
554
591
|
/**
|
|
555
592
|
* Requires the value to be a valid Italian VAT number (partita IVA).
|
|
556
593
|
*
|
|
@@ -568,7 +605,7 @@ declare function otp<TPathKind extends PathKind = PathKind.Root>(path: SchemaPat
|
|
|
568
605
|
* @example
|
|
569
606
|
* const f = form(this.model, p => { required(p.partitaIva); italianVat(p.partitaIva); });
|
|
570
607
|
*/
|
|
571
|
-
declare function italianVat<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
608
|
+
export declare function italianVat<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
572
609
|
/**
|
|
573
610
|
* Requires the value to be a valid Italian fiscal code (codice fiscale).
|
|
574
611
|
*
|
|
@@ -590,26 +627,23 @@ declare function italianVat<TPathKind extends PathKind = PathKind.Root>(path: Sc
|
|
|
590
627
|
* @example
|
|
591
628
|
* const f = form(this.model, p => { required(p.codiceFiscale); italianFiscalCode(p.codiceFiscale); });
|
|
592
629
|
*/
|
|
593
|
-
declare function italianFiscalCode<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
630
|
+
export declare function italianFiscalCode<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
594
631
|
/** Helpers around signal forms that are not validators themselves. */
|
|
595
|
-
declare class SignalsUtils {
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
export { ARS_VALIDATOR_MESSAGES, EmailsValidatorDirective, EqualsValidatorDirective, FileSizeValidatorDirective, GuidValidatorDirective, MIN_VALID_YEAR, MaxTermsValidatorDirective, NotEmptyValidatorDirective, NotEqualValidatorDirective, NotFutureValidatorDirective, PasswordValidatorDirective, SignalsUtils, SqlDateValidatorDirective, TimeValidatorDirective, UrlValidatorDirective, ValidIfDirective, ValidatorDirective, date, dateRange, emails, equals, fileSize, guid, italianFiscalCode, italianVat, maxTerms, notEmpty, notEqual, notFuture, notPast, otp, password, time, url, validIf };
|
|
615
|
-
export type { ArsValidatorConfig };
|
|
632
|
+
export declare class SignalsUtils {
|
|
633
|
+
/**
|
|
634
|
+
* Builds the error text for a signal-forms field.
|
|
635
|
+
*
|
|
636
|
+
* Deliberately dumb: the wording lives in the schema, next to the rule that produces it
|
|
637
|
+
* (`required(p.x, { message: ... })`), so a field says what is wrong with it in one place
|
|
638
|
+
* instead of here in a switch that has to guess from the error kind. The map below is only
|
|
639
|
+
* the safety net for the rules declared without a message — the Angular built-ins, plus
|
|
640
|
+
* {@link ARS_VALIDATOR_MESSAGES} for the ones declared in this file.
|
|
641
|
+
* @param errors - The errors currently on the field, from `f.x().errors()`.
|
|
642
|
+
* @param message - Optional override applied to every error of the field.
|
|
643
|
+
* @returns The first relevant error text, or `undefined` when the field has no errors.
|
|
644
|
+
*/
|
|
645
|
+
static getFieldErrorMessage(errors: readonly {
|
|
646
|
+
kind: string;
|
|
647
|
+
message?: string;
|
|
648
|
+
}[], message?: string): string | undefined;
|
|
649
|
+
}
|