@arsedizioni/ars-utils 22.6.83 → 22.6.86
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.
|
@@ -888,20 +888,21 @@ function isValidItalianFiscalCode(value) {
|
|
|
888
888
|
* leave the map with a kind nobody produces.
|
|
889
889
|
*/
|
|
890
890
|
/**
|
|
891
|
-
* Earliest
|
|
891
|
+
* Earliest year {@link date} and {@link dateRange} accept: 1750.
|
|
892
892
|
*
|
|
893
|
-
*
|
|
894
|
-
*
|
|
895
|
-
*
|
|
896
|
-
*
|
|
893
|
+
* It is the floor of what the backend can store, and it is set that low on purpose: a birth date,
|
|
894
|
+
* the date of an old norm or the commissioning of an old machine are real data well before 1970.
|
|
895
|
+
* What it does catch is the 01/01/0001 or 01/01/0020 that a mistyped year produces, which SQL
|
|
896
|
+
* Server would reject with an error nobody can read.
|
|
897
897
|
*/
|
|
898
|
-
const MIN_VALID_YEAR =
|
|
898
|
+
const MIN_VALID_YEAR = 1750;
|
|
899
899
|
const ARS_VALIDATOR_MESSAGES = {
|
|
900
900
|
required: 'Obbligatorio',
|
|
901
901
|
guid: 'Ticket non riconosciuto',
|
|
902
902
|
password: 'Password non sufficientemente robusta',
|
|
903
903
|
notEmpty: 'Non può essere vuoto o contenere solo spazi.',
|
|
904
904
|
notEqual: 'Deve essere diverso dall\'altro valore',
|
|
905
|
+
// Emitted by `SqlDateValidatorDirective`, which a `[formField]` on a ControlValueAccessor still reads.
|
|
905
906
|
sqlDate: 'Data non valida',
|
|
906
907
|
date: 'Data non valida',
|
|
907
908
|
dateRange: 'Intervallo non valido',
|
|
@@ -1019,31 +1020,6 @@ function notEqual(path, other, config) {
|
|
|
1019
1020
|
return isValid ? null : { kind: 'notEqual', message: config?.message ?? ARS_VALIDATOR_MESSAGES['notEqual'] };
|
|
1020
1021
|
});
|
|
1021
1022
|
}
|
|
1022
|
-
/**
|
|
1023
|
-
* Requires the value to be a date the backend can store: parseable, and after 1750.
|
|
1024
|
-
*
|
|
1025
|
-
* The signal-form counterpart of `SqlDateValidatorDirective`. The year floor is not arbitrary —
|
|
1026
|
-
* it is what separates a real date from the 01/01/0001 that a mistyped year produces, which SQL
|
|
1027
|
-
* Server rejects with an error nobody can read.
|
|
1028
|
-
*
|
|
1029
|
-
* @param path - Path of the field to validate.
|
|
1030
|
-
* @param config - Optional message override and `when` condition.
|
|
1031
|
-
* @returns void
|
|
1032
|
-
*/
|
|
1033
|
-
function sqlDate(path, config) {
|
|
1034
|
-
validate(path, ctx => {
|
|
1035
|
-
if (config?.when && !config.when(ctx))
|
|
1036
|
-
return null;
|
|
1037
|
-
const input = ctx.value();
|
|
1038
|
-
if (!input || input.length === 0)
|
|
1039
|
-
return null;
|
|
1040
|
-
const parsed = SystemUtils.parseDate(input);
|
|
1041
|
-
const invalid = { kind: 'sqlDate', message: config?.message ?? ARS_VALIDATOR_MESSAGES['sqlDate'] };
|
|
1042
|
-
if (!parsed)
|
|
1043
|
-
return invalid;
|
|
1044
|
-
return endOfDay(parsed).getFullYear() > 1750 ? null : invalid;
|
|
1045
|
-
});
|
|
1046
|
-
}
|
|
1047
1023
|
/**
|
|
1048
1024
|
* Requires the value to be a real date, as {@link SystemUtils.parseDate} understands one.
|
|
1049
1025
|
*
|
|
@@ -1052,11 +1028,11 @@ function sqlDate(path, config) {
|
|
|
1052
1028
|
* `parseDate` handles the shapes this codebase produces (ISO, `dd/MM/yyyy`, `yyyy-MM-dd`, and the
|
|
1053
1029
|
* shorthand forms). Empty passes — saying "obbligatorio" is the job of `required()`.
|
|
1054
1030
|
*
|
|
1055
|
-
* A date earlier than {@link MIN_VALID_YEAR} (
|
|
1056
|
-
*
|
|
1031
|
+
* A date earlier than {@link MIN_VALID_YEAR} (1750) is rejected: it is what the backend can
|
|
1032
|
+
* store, so an earlier value is a mistyped year rather than data.
|
|
1057
1033
|
*
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1034
|
+
* It is also the signal-form counterpart of `SqlDateValidatorDirective`: one rule for every date,
|
|
1035
|
+
* whether it is typed or picked.
|
|
1060
1036
|
*
|
|
1061
1037
|
* @param path - Path of the field to validate.
|
|
1062
1038
|
* @param config - Optional message override and `when` condition.
|
|
@@ -1083,7 +1059,7 @@ function date(path, config) {
|
|
|
1083
1059
|
* Written for the two inputs of a `mat-date-range-input`, whose start and end live in two
|
|
1084
1060
|
* separate fields of the model. Each end is checked with the same rule as {@link date}, and the
|
|
1085
1061
|
* ordering is checked only when BOTH ends are filled in — a half-open range ("from today
|
|
1086
|
-
* onwards") is a legitimate filter, not an error. The
|
|
1062
|
+
* onwards") is a legitimate filter, not an error. The {@link MIN_VALID_YEAR} floor of {@link date}
|
|
1087
1063
|
* applies to both ends.
|
|
1088
1064
|
*
|
|
1089
1065
|
* The rule is bound to BOTH paths, so the error appears on whichever end the user is looking at
|
|
@@ -1140,16 +1116,22 @@ function dateRange(from, to, config) {
|
|
|
1140
1116
|
* comparison is made on the end of the day, so a date entered this morning does not become
|
|
1141
1117
|
* invalid because the clock says 09:00.
|
|
1142
1118
|
*
|
|
1119
|
+
* Like {@link notPast}, it accepts both the `Date` a Material datepicker writes into the model and
|
|
1120
|
+
* the text of a plain input. An empty value passes: saying "obbligatorio" is the job of
|
|
1121
|
+
* `required()`.
|
|
1122
|
+
*
|
|
1143
1123
|
* @param path - Path of the field to validate.
|
|
1144
1124
|
* @param config - Optional message override and `when` condition.
|
|
1145
1125
|
* @returns void
|
|
1126
|
+
* @example
|
|
1127
|
+
* const f = form(this.model, p => { required(p.executionDate); notFuture(p.executionDate); });
|
|
1146
1128
|
*/
|
|
1147
1129
|
function notFuture(path, config) {
|
|
1148
1130
|
validate(path, ctx => {
|
|
1149
1131
|
if (config?.when && !config.when(ctx))
|
|
1150
1132
|
return null;
|
|
1151
1133
|
const input = ctx.value();
|
|
1152
|
-
if (
|
|
1134
|
+
if (input === undefined || input === null || input === '')
|
|
1153
1135
|
return null;
|
|
1154
1136
|
const parsed = SystemUtils.parseDate(input);
|
|
1155
1137
|
const invalid = { kind: 'notFuture', message: config?.message ?? ARS_VALIDATOR_MESSAGES['notFuture'] };
|
|
@@ -1539,5 +1521,5 @@ class SignalsUtils {
|
|
|
1539
1521
|
* Generated bundle index. Do not edit.
|
|
1540
1522
|
*/
|
|
1541
1523
|
|
|
1542
|
-
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,
|
|
1524
|
+
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 };
|
|
1543
1525
|
//# sourceMappingURL=arsedizioni-ars-utils-core.validators.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arsedizioni-ars-utils-core.validators.mjs","sources":["../../../projects/ars-utils/core.validators/validatorDirective.ts","../../../projects/ars-utils/core.validators/validIfDirective.ts","../../../projects/ars-utils/core.validators/equalsValidatorDirective.ts","../../../projects/ars-utils/core.validators/notEqualValidatorDirective.ts","../../../projects/ars-utils/core.validators/emailsValidatorDirective.ts","../../../projects/ars-utils/core.validators/guidValidatorDirective.ts","../../../projects/ars-utils/core.validators/sqlDateValidatorDirective.ts","../../../projects/ars-utils/core.validators/notFutureValidatorDirective.ts","../../../projects/ars-utils/core.validators/urlValidatorDirective.ts","../../../projects/ars-utils/core.validators/fileSizeValidatorDirective.ts","../../../projects/ars-utils/core.validators/maxTermsValidatorDirective.ts","../../../projects/ars-utils/core.validators/passwordValidatorDirective.ts","../../../projects/ars-utils/core.validators/timeValidatorDirective.ts","../../../projects/ars-utils/core.validators/emptiness.ts","../../../projects/ars-utils/core.validators/notEmptyValidatorDirective.ts","../../../projects/ars-utils/core.validators/italian.ts","../../../projects/ars-utils/core.validators/signals.ts","../../../projects/ars-utils/core.validators/public_api.ts","../../../projects/ars-utils/core.validators/arsedizioni-ars-utils-core.validators.ts"],"sourcesContent":["import { Directive, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that delegates validation to an externally provided validator function.\r\n * Bind `[validator]=\"myFn\"` where `myFn` is `(c: AbstractControl) => ValidationErrors | null`.\r\n */\r\n@Directive({\r\n selector: '[validator]',\r\n providers: [{ provide: NG_VALIDATORS, useExisting: ValidatorDirective, multi: true }],\r\n standalone: true,\r\n})\r\nexport class ValidatorDirective implements Validator {\r\n\r\n /** The custom validator function to apply. */\r\n readonly validator = input<((control: AbstractControl) => ValidationErrors | null) | undefined>(undefined);\r\n\r\n /**\r\n * Invokes the provided validator function against the given control.\r\n * Returns `null` (valid) when no function is bound.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const fn = this.validator();\r\n return fn ? fn(control) : null;\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { Validated } from '@arsedizioni/ars-utils/core';\r\n\r\n/**\r\n * Directive that validates a control using the host object's `isValid()` method\r\n * or a boolean expression passed via `[validIf]`.\r\n */\r\n@Directive({\r\n selector: \"[validIf]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => ValidIfDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class ValidIfDirective implements Validator {\r\n\r\n /** When `true`, the control is considered valid regardless of the bound value. */\r\n readonly validIf = input<boolean>(false);\r\n\r\n /**\r\n * Validates the control value against a boolean flag or the value's own `isValid()` method.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n let isValid = false;\r\n const c = control.value ? (control.value as Validated) : null;\r\n if (!c) {\r\n isValid = this.validIf() === true;\r\n } else {\r\n try {\r\n isValid = c.isValid();\r\n } catch { }\r\n }\r\n return isValid ? null : { validIf: \"Non valido.\" };\r\n }\r\n}\r\n","import { DestroyRef, Directive, effect, forwardRef, inject, input } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { Subscription } from \"rxjs\";\n\n/**\n * Directive that validates that the host control's value equals the value of another control.\n * Bind `[equals]=\"otherControl\"`.\n *\n * The host control is re-validated whenever the OTHER control's value changes:\n * without this, typing a new password AFTER the confirmation field was filled\n * left the form incorrectly valid (the classic password/confirm bug).\n *\n * IMPORTANT (reciprocal-binding safety): the re-validation triggered from the\n * other control's `valueChanges` runs with `{ emitEvent: false }`. Calling\n * Angular's `onValidatorChange` instead would re-emit valueChanges, so a\n * reciprocal setup (A [equals]=B and B [equals]=A) would overflow the stack.\n */\n@Directive({\n selector: \"[equals]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => EqualsValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class EqualsValidatorDirective implements Validator {\n\n /** The control whose value must match the host control's value. */\n readonly equals = input<AbstractControl | undefined>(undefined);\n\n /** The host control, captured on the first validate() call. */\n private hostControl?: AbstractControl;\n\n /** Subscription to the other control's valueChanges. */\n private subscription?: Subscription;\n\n constructor() {\n // Re-subscribe whenever the [equals] binding points to a different control,\n // and re-validate the host on every change of the other control.\n effect(() => {\n const other = this.equals();\n this.subscription?.unsubscribe();\n this.subscription = other?.valueChanges.subscribe(() =>\n // emitEvent:false breaks the reciprocal valueChanges loop (see class doc).\n this.hostControl?.updateValueAndValidity({ emitEvent: false })\n );\n // Re-validate the host when the bound control itself is swapped.\n this.hostControl?.updateValueAndValidity({ emitEvent: false });\n });\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n }\n\n /**\n * Validates that the host control value equals the bound control's value.\n * Returns `null` (valid) when no control is bound.\n * @param control - The form control to validate.\n * @returns `null` when valid, `{ equals: ... }` otherwise.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n this.hostControl = control;\n const eq = this.equals();\n if (!eq) return null;\n return eq.value === control.value ? null : { equals: \"Non valido.\" };\n }\n}\n","import { DestroyRef, Directive, effect, forwardRef, inject, input } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { Subscription } from \"rxjs\";\n\n/**\n * Directive that validates that the host control's value is different from another control's value.\n * Bind `[notEqual]=\"otherControl\"`.\n *\n * The host control is re-validated whenever the OTHER control's value changes,\n * so editing either field keeps both error states consistent.\n *\n * IMPORTANT (reciprocal-binding safety): the re-validation triggered from the\n * other control's `valueChanges` is run with `{ emitEvent: false }`. Using\n * Angular's `onValidatorChange` here instead would call `host.updateValueAndValidity()`\n * WITH events, so a reciprocal setup (A [notEqual]=B and B [notEqual]=A) would\n * ping-pong valueChanges between the two controls and overflow the stack.\n */\n@Directive({\n selector: \"[notEqual]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => NotEqualValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class NotEqualValidatorDirective implements Validator {\n\n /** The control whose value must differ from the host control's value. */\n readonly notEqual = input<AbstractControl | undefined>(undefined);\n\n /** The host control, captured on the first validate() call. */\n private hostControl?: AbstractControl;\n\n /** Subscription to the other control's valueChanges. */\n private subscription?: Subscription;\n\n constructor() {\n effect(() => {\n const other = this.notEqual();\n this.subscription?.unsubscribe();\n this.subscription = other?.valueChanges.subscribe(() =>\n // Re-validate the host WITHOUT emitting valueChanges, otherwise a\n // reciprocal binding would loop forever (see class doc).\n this.hostControl?.updateValueAndValidity({ emitEvent: false })\n );\n // Re-validate the host when the bound control itself is swapped.\n this.hostControl?.updateValueAndValidity({ emitEvent: false });\n });\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n }\n\n /**\n * Validates that the host control value is not equal to the bound control's value.\n * Also clears the `notequal` error on the other control when the host becomes valid.\n * Returns `null` (valid) when no control is bound.\n * @param control - The form control to validate.\n * @returns `null` when valid, `{ notequal: true }` otherwise.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n this.hostControl = control;\n\n const notEqual = this.notEqual();\n if (!notEqual) return null;\n\n const isValid = (!notEqual.value && !control.value) || (notEqual.value !== control.value);\n const errors: ValidationErrors | null = isValid ? null : { notequal: true };\n\n if (errors) {\n control.markAsTouched();\n } else if (notEqual.hasError('notequal')) {\n const { notequal: _removed, ...rest } = notEqual.errors ?? {};\n // emitEvent:false on both: clearing the partner's error must not feed\n // back through valueChanges/statusChanges into this validator.\n notEqual.setErrors(Object.keys(rest).length > 0 ? rest : null, { emitEvent: false });\n notEqual.updateValueAndValidity({ onlySelf: true, emitEvent: false });\n notEqual.markAsTouched();\n notEqual.markAsDirty();\n }\n return errors;\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a semicolon-separated list of email addresses.\r\n * Apply `emails` to a text input containing one or more addresses separated by `;`.\r\n */\r\n@Directive({\r\n selector: \"[emails]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => EmailsValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class EmailsValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates each address in a semicolon-separated email list.\r\n * Returns `null` when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input || input.length === 0) return null;\r\n const parts = input.replaceAll(/\\r\\n/g, '').split(';');\r\n const isValid = parts.every(part => part.length === 0 || !!SystemUtils.parseEmail(part));\r\n return isValid ? null : { emails: \"Elenco non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a control value as a GUID / UUID string.\r\n * Apply `guid` to a text input that expects a valid UUID.\r\n */\r\n@Directive({\r\n selector: \"[guid]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => GuidValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class GuidValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value is a well-formed GUID / UUID.\r\n * Returns `null` when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input || input.length === 0) return null;\r\n return SystemUtils.parseUUID(input) ? null : { guid: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { endOfDay } from 'date-fns';\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\n\n/**\n * Directive that validates a control value as a parseable SQL-compatible date string.\n * Apply `sqlDate` to a text input that expects a date after year 1750.\n */\n@Directive({\n selector: \"[sqlDate]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SqlDateValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class SqlDateValidatorDirective implements Validator {\n\n /**\n * Validates that the control value can be parsed as a date after 1750.\n * Returns `null` when the control is empty.\n * @param control - The form control to validate.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n const input: string = control.value;\n if (!input || input.length === 0) return null;\n const parsed = SystemUtils.parseDate(input);\n if (!parsed) return { sqlDate: \"Non valido.\" };\n const d = endOfDay(parsed);\n return d.getFullYear() > 1750 ? null : { sqlDate: \"Non valido.\" };\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { endOfDay } from 'date-fns';\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\n\n/**\n * Directive that validates that a control value is not a future date.\n * Apply `notFuture` to a text input that expects a date on or before today.\n */\n@Directive({\n selector: \"[notFuture]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => NotFutureValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class NotFutureValidatorDirective implements Validator {\n\n /**\n * Validates that the control value represents a date that is not in the future.\n * Returns `null` when the control is empty.\n * @param control - The form control to validate.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n const input: string = control.value;\n if (!input || input.length === 0) return null;\n const parsed = SystemUtils.parseDate(input);\n if (!parsed) return { notFuture: \"Non valido.\" };\n const today = endOfDay(new Date());\n const d = endOfDay(parsed);\n return d <= today ? null : { notFuture: \"Non valido.\" };\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a control value as a well-formed URL.\r\n * Apply `url` to a text input that expects a URL.\r\n */\r\n@Directive({\r\n selector: \"[url]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => UrlValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class UrlValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value is a well-formed URL.\r\n * Returns `null` (valid) when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input || input.length === 0) return null;\r\n return SystemUtils.parseUrl(input) ? null : { url: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that validates a file size against configurable minimum and maximum bounds.\r\n * Bind `[fileSize]` together with `[size]=\"fileSizeInMb\"`, `[maxSizeMb]`, and `[minSizeMb]`.\r\n */\r\n@Directive({\r\n selector: \"[fileSize]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => FileSizeValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class FileSizeValidatorDirective implements Validator {\r\n\r\n /** Maximum allowed file size in megabytes. Defaults to 5. */\r\n readonly maxSizeMb = input<number>(5);\r\n\r\n /** Minimum required file size in megabytes. Defaults to 0. */\r\n readonly minSizeMb = input<number>(0);\r\n\r\n /** The actual file size in megabytes to validate against the bounds. */\r\n readonly size = input<number | undefined>(undefined);\r\n\r\n /**\r\n * Validates that the bound file size falls within the configured min/max range.\r\n * Returns `null` when no control value is present.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input = control.value;\r\n if (!input) return null;\r\n const s = this.size() ?? 0;\r\n const isValid = s <= this.maxSizeMb() && s >= this.minSizeMb();\r\n return isValid ? null : { fileSize: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that validates that a control value does not exceed a maximum word count.\r\n * Bind `[maxTerms]=\"10\"` to allow at most 10 whitespace-separated terms.\r\n */\r\n@Directive({\r\n selector: \"[maxTerms]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => MaxTermsValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class MaxTermsValidatorDirective implements Validator {\r\n\r\n /** The maximum number of whitespace-separated terms allowed. */\r\n readonly maxTerms = input<number>(0);\r\n\r\n /**\r\n * Validates that the control value contains no more than the configured number of terms.\r\n * Returns `null` when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input) return null;\r\n const terms = input.match(/\\S+/g)?.length ?? 0;\r\n return terms <= this.maxTerms() ? null : { maxTerms: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a control value as a sufficiently strong password.\r\n * Apply `password` to a password input.\r\n */\r\n@Directive({\r\n selector: \"[password]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => PasswordValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class PasswordValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value meets the minimum password-strength requirements.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value ?? '';\r\n const strength = SystemUtils.calculatePasswordStrength(input);\r\n return strength.isValid ? null : { password: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\n\n/**\n * Directive that validates a time string against optional allowed time slot ranges.\n * Bind `[time]` and optionally `[slots]=\"'08:00-12:00|14:00-18:00'\"` (pipe-separated ranges).\n */\n@Directive({\n selector: \"[time]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => TimeValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class TimeValidatorDirective implements Validator {\n\n /** Optional pipe-separated list of allowed time ranges, e.g. `\"08:00-12:00|14:00-18:00\"`. */\n readonly slots = input<string | undefined>(undefined);\n\n /**\n * Parses a `\"HH:MM\"` time string into a comparable integer (e.g. `\"09:30\"` -> `930`).\n * Returns `-1` when the string is not a valid time.\n * @param value - The time string to parse.\n */\n private getTime(value: string): number {\n const p = value.split(':');\n if (p.length !== 2) return -1;\n const hh = parseInt(p[0], 10);\n if (isNaN(hh) || hh < 0 || hh > 23) return -1;\n const mm = parseInt(p[1], 10);\n if (isNaN(mm) || mm < 0 || mm > 59) return -1;\n return hh * 100 + mm;\n }\n\n /**\n * Validates that the control value is a valid time string and, when slots are configured,\n * that it falls within at least one of the allowed ranges.\n * Returns `null` when the control is empty.\n * @param control - The form control to validate.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n const input: string = control.value;\n if (!input || input.length === 0) return null;\n\n const t = this.getTime(input);\n if (t === -1) return { time: \"Non valido.\" };\n\n const slotsValue = this.slots();\n if (slotsValue) {\n const isValid = slotsValue.split('|').some(s => {\n const t1 = this.getTime(s.substring(0, 5));\n const t2 = this.getTime(s.substring(6));\n return t1 !== -1 && t2 !== -1 && t1 <= t && t2 >= t;\n });\n return isValid ? null : { time: \"Non valido.\" };\n }\n\n return null;\n }\n}\n","/**\n * @file emptiness.ts\n *\n * The single definition of \"empty\" behind the `notEmpty` rule, in both its flavours: the\n * template-driven directive and the signal-form validator. It lives apart from either of them so\n * that the two faces of the same rule cannot drift, and it pulls in nothing — not\n * `@angular/forms`, not `@angular/core`.\n */\n\n/**\n * Tells whether a value is what the `notEmpty` rule rejects: a string made of whitespace alone,\n * or an array with no elements.\n *\n * An absent value and an empty string are deliberately NOT rejected: declaring a field mandatory\n * is the job of `required()`, and a blank field would otherwise raise two errors saying the same\n * thing. The empty array is the one exception, because there it IS the only shape emptiness can\n * take — a multi-select never holds `''`, and Angular's own `required()` does not see `[]` as\n * empty, so nothing else would catch it.\n *\n * @param value - The value to inspect.\n * @returns `true` when the value is a whitespace-only string or an empty array.\n */\nexport function isBlankValue(value: unknown): boolean {\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value !== 'string') return false;\n return value.length > 0 && value.trim().length === 0;\n}\n","import { Directive, forwardRef } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { isBlankValue } from \"./emptiness\";\n\n/**\n * Directive that validates that a control value is not blank: neither a whitespace-only string\n * nor an empty array. Apply `notEmpty` to a text input where non-blank content is required, or\n * to a multi-value control that must carry at least one entry.\n *\n * A value that is simply absent passes: saying \"obbligatorio\" is the job of `required`, which is\n * declared next to this one when both rules belong on the same control.\n */\n@Directive({\n selector: \"[notEmpty]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => NotEmptyValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class NotEmptyValidatorDirective implements Validator {\n\n /**\n * Validates that the control value carries content.\n * Returns `null` when the control is absent or holds a type this rule says nothing about.\n * @param control - The form control to validate.\n * @returns `{ notEmpty: true }` when the value is a blank string or an empty array, `null` otherwise.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n return isBlankValue(control?.value) ? { notEmpty: true } : null;\n }\n}\n","/**\n * @file italian.ts\n *\n * The two check algorithms behind the `italianVat` and `italianFiscalCode` rules, kept apart from\n * the validators that use them for the same reason `emptiness.ts` is: the rule must exist in one\n * place only, so that no second copy of it can drift. They pull in nothing — not `@angular/forms`,\n * not `@angular/core` — and they live here rather than in `SystemUtils` so that `core`, which sits\n * on the boot path of every application, does not carry code only a form needs.\n */\n\n/**\n * Digits an \"omocodia\" substitution replaces with a letter, in digit order: `0` becomes `L`, `1`\n * becomes `M`, and so on.\n *\n * The Agenzia delle Entrate applies it when two people would otherwise share the same fiscal code,\n * so a perfectly legitimate code can carry letters where the format expects numbers. Ignoring this\n * is the classic way a validator rejects a real person.\n */\nconst OMOCODIA_CHARS = 'LMNPQRSTUV';\n\n/** Letters usable as month of birth, one per month from January (`A`) to December (`T`). */\nconst MONTH_CHARS = 'ABCDEHLMPRST';\n\n/** Alphabet the control character of a fiscal code is drawn from. */\nconst CONTROL_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n/** Weight of each character sitting in an ODD position (1-based) of the first 15 of a fiscal code. */\nconst ODD_WEIGHTS: Readonly<Record<string, number>> = {\n '0': 1, '1': 0, '2': 5, '3': 7, '4': 9, '5': 13, '6': 15, '7': 17, '8': 19, '9': 21,\n A: 1, B: 0, C: 5, D: 7, E: 9, F: 13, G: 15, H: 17, I: 19, J: 21, K: 2, L: 4, M: 18,\n N: 20, O: 11, P: 3, Q: 6, R: 8, S: 12, T: 14, U: 16, V: 10, W: 22, X: 25, Y: 24, Z: 23,\n};\n\n/** Weight of each character sitting in an EVEN position (1-based) of the first 15 of a fiscal code. */\nconst EVEN_WEIGHTS: Readonly<Record<string, number>> = {\n '0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9,\n A: 0, B: 1, C: 2, D: 3, E: 4, F: 5, G: 6, H: 7, I: 8, J: 9, K: 10, L: 11, M: 12,\n N: 13, O: 14, P: 15, Q: 16, R: 17, S: 18, T: 19, U: 20, V: 21, W: 22, X: 23, Y: 24, Z: 25,\n};\n\n/**\n * Shape of a fiscal code of a natural person, omocodia included: every group that is normally\n * numeric also admits the ten letters that stand in for a digit.\n */\nconst FISCAL_CODE_REGEX =\n /^[A-Z]{6}[0-9LMNPQRSTUV]{2}[ABCDEHLMPRST][0-9LMNPQRSTUV]{2}[A-Z][0-9LMNPQRSTUV]{3}[A-Z]$/;\n\n/**\n * Strips what a user types around a code without changing the code itself: surrounding and inner\n * spaces, dots and dashes, and the letter case.\n *\n * Accepting a pasted `\"IT 123 456 789 01\"` is not indulgence — the value arrives from an invoice,\n * a registry export or a colleague's e-mail far more often than it is typed character by\n * character, and rejecting it teaches nothing to the person who pasted it.\n *\n * @param value - The raw value as the user entered it.\n * @returns The value in upper case with spaces, dots and dashes removed.\n */\nfunction normalize(value?: string): string {\n return (value ?? '').toUpperCase().replace(/[\\s.\\-/]/g, '');\n}\n\n/**\n * Turns the letters an omocodia substitution left behind back into the digits they stand for.\n *\n * @param value - A group of characters of a fiscal code that is numeric in the plain form.\n * @returns The same group with every substitution letter replaced by its digit.\n */\nfunction decodeOmocodia(value: string): string {\n let decoded = '';\n for (const char of value) {\n const index = OMOCODIA_CHARS.indexOf(char);\n decoded += index === -1 ? char : String(index);\n }\n return decoded;\n}\n\n/**\n * Tells whether a value is a valid Italian VAT number (partita IVA).\n *\n * Eleven digits, of which the last one is the check digit of the Luhn-like algorithm of\n * D.P.R. 633/72: the digits in even position (1-based) are doubled and folded back under ten, the\n * sum is completed to the next multiple of ten, and what is missing is the check digit. An\n * optional `IT` prefix is accepted, because that is how the number travels on invoices and in\n * VIES exports.\n *\n * The seven digits of the sequential number are required not to be all zeros, which is the one\n * combination the checksum happily accepts and the Agenzia delle Entrate never issues. The office\n * code (positions 8 to 10) is deliberately NOT checked against the list of the provinces: that\n * list grows, and a validator that rejects a number issued last month is worse than one that lets\n * a fabricated office code through.\n *\n * @param value - The value to check, with or without the `IT` prefix and any spacing.\n * @returns `true` when the value is a well-formed VAT number.\n */\nexport function isValidItalianVat(value?: string): boolean {\n const normalized = normalize(value);\n const digits = normalized.startsWith('IT') ? normalized.slice(2) : normalized;\n if (!/^\\d{11}$/.test(digits)) return false;\n if (digits.startsWith('0000000')) return false;\n\n let sum = 0;\n for (let i = 0; i < 10; i++) {\n let digit = digits.charCodeAt(i) - 48;\n // Positions are 1-based in the norm, so the doubled ones are those at an even index here.\n if (i % 2 === 1) {\n digit *= 2;\n if (digit > 9) digit -= 9;\n }\n sum += digit;\n }\n const check = (10 - (sum % 10)) % 10;\n return check === digits.charCodeAt(10) - 48;\n}\n\n/**\n * Tells whether a value is a valid Italian fiscal code (codice fiscale), in either of the two\n * shapes a form can receive.\n *\n * A natural person has the sixteen-character code of D.M. 23/12/1976: the shape is checked, the\n * month letter and the day of birth are checked (41 to 71 for a woman, which is the day plus\n * forty), and the sixteenth character is recomputed from the first fifteen and compared. Letters\n * left by an omocodia substitution are accepted and decoded before the date is judged, so a\n * legitimately altered code is not turned away.\n *\n * A company or a public body has no such code: its fiscal code IS its VAT number, eleven digits\n * checked by {@link isValidItalianVat}. Both are accepted here because a single \"codice fiscale\"\n * field in a registry form receives both, and asking the user which kind they are about to type is\n * a question the code can answer by itself.\n *\n * @param value - The value to check, in any case and with any spacing.\n * @returns `true` when the value is a well-formed fiscal code of either shape.\n */\nexport function isValidItalianFiscalCode(value?: string): boolean {\n const code = normalize(value);\n\n // A company or a public body: its fiscal code is the VAT number.\n if (/^\\d{11}$/.test(code)) return isValidItalianVat(code);\n\n if (code.length !== 16 || !FISCAL_CODE_REGEX.test(code)) return false;\n\n // The day carries the sex: 01-31 for a man, 41-71 for a woman (the day plus forty).\n const day = parseInt(decodeOmocodia(code.substring(9, 11)), 10);\n const isValidDay = (day >= 1 && day <= 31) || (day >= 41 && day <= 71);\n if (!isValidDay) return false;\n\n // The month letter is already constrained by the regex; this keeps the two in step if it changes.\n if (!MONTH_CHARS.includes(code[8])) return false;\n\n let sum = 0;\n for (let i = 0; i < 15; i++) {\n // Odd positions in the norm are the even indexes here. The character is weighted as it is\n // written, substitution letters included: the control character is computed on the altered\n // code, not on the original one.\n sum += i % 2 === 0 ? ODD_WEIGHTS[code[i]] : EVEN_WEIGHTS[code[i]];\n }\n return CONTROL_CHARS[sum % 26] === code[15];\n}\n","import { LogicFn, PathKind, SchemaPath, SchemaPathRules, validate } from '@angular/forms/signals';\nimport { SystemUtils, Validated } from '@arsedizioni/ars-utils/core';\nimport { endOfDay, startOfDay } from 'date-fns';\nimport { isBlankValue } from './emptiness';\nimport { isValidItalianFiscalCode, isValidItalianVat } from './italian';\n\n/**\n * Options shared by the ARS signal-form validators.\n *\n * Mirrors the `config` argument of the Angular built-ins (`required`, `email`, ...) but carries\n * only what these validators need: the message shown to the user in place of the default one.\n */\nexport interface ArsValidatorConfig<TValue = string, TPathKind extends PathKind = PathKind.Root> {\n /** Message attached to the error, in place of the default Italian text. */\n message?: string;\n /**\n * Applies the rule only while this returns `true`, exactly like the `when` of `required()`\n * and of the other Angular built-ins.\n *\n * It exists because these validators are meant to be paired with `required()` on the same\n * field, and a field that is only required in one mode of a dialog must only be validated in\n * that mode: without this, a leftover value would keep a form invalid in a mode where the\n * field is not even shown.\n */\n when?: NoInfer<LogicFn<TValue, boolean, TPathKind>>;\n}\n\n/**\n * Default texts of the rules declared here, in one place so that the validators and the fallback\n * map of `SignalsUtils.getFieldErrorMessage` cannot drift apart: a rule added below without a\n * message here would show \"Errore\", and one renamed here without touching the validator would\n * leave the map with a kind nobody produces.\n */\n/**\n * Earliest date {@link date} and {@link dateRange} accept: 1 January 1970.\n *\n * Everything this application stores — events, certificates, payments, communications — happened\n * after it, so an earlier value is always a typo (a two-digit year, a slipped keystroke) and never\n * real data. The floor is deliberately higher than the one of {@link sqlDate}, which only asks\n * what SQL Server can physically store.\n */\nexport const MIN_VALID_YEAR = 1970;\n\nexport const ARS_VALIDATOR_MESSAGES: Record<string, string> = {\n required: 'Obbligatorio',\n guid: 'Ticket non riconosciuto',\n password: 'Password non sufficientemente robusta',\n notEmpty: 'Non può essere vuoto o contenere solo spazi.',\n notEqual: 'Deve essere diverso dall\\'altro valore',\n sqlDate: 'Data non valida',\n date: 'Data non valida',\n dateRange: 'Intervallo non valido',\n notFuture: 'La data non può essere futura',\n notPast: 'La data non può essere passata',\n url: 'Indirizzo non valido',\n maxTerms: 'Troppe parole',\n fileSize: 'Dimensione del file non ammessa',\n validIf: 'Non valido',\n emails: 'Elenco non valido',\n time: 'Orario non valido',\n equals: 'I due valori non coincidono',\n otp: 'Codice non valido',\n italianVat: 'Partita IVA non valida',\n italianFiscalCode: 'Codice fiscale non valido',\n};\n\n/**\n * Requires the value to be a well-formed GUID / UUID.\n *\n * The signal-form counterpart of `GuidValidatorDirective`, sharing its rule down to the empty\n * case: an empty value is NOT an error here, because saying \"obbligatorio\" is the job of\n * `required()` and two errors on one empty field only ever read as noise.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override.\n * @returns void\n * @example\n * const f = form(this.model, p => { required(p.serial); guid(p.serial); });\n */\nexport function guid<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n return SystemUtils.parseUUID(input)\n ? null\n : { kind: 'guid', message: config?.message ?? ARS_VALIDATOR_MESSAGES['guid'] };\n });\n}\n\n/**\n * Requires the value to be a password strong enough for {@link SystemUtils.calculatePasswordStrength}.\n *\n * The signal-form counterpart of `PasswordValidatorDirective`. Unlike {@link guid} it does judge\n * the empty value, because an empty password IS a weak one and the directive behaved the same way.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override.\n * @returns void\n */\nexport function password<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const strength = SystemUtils.calculatePasswordStrength(ctx.value() ?? '');\n return strength.isValid\n ? null\n : { kind: 'password', message: config?.message ?? ARS_VALIDATOR_MESSAGES['password'] };\n });\n}\n\n/**\n * Requires the value not to be made of whitespace alone, and a collection not to be empty.\n *\n * The signal-form counterpart of `NotEmptyValidatorDirective`, sharing its predicate through\n * {@link isBlankValue}: a blank string and an empty array are errors, an absent value is not.\n * That last part is not an oversight — saying \"obbligatorio\" belongs to `required()`, and a field\n * that is merely blank would otherwise raise two errors that mean the same thing. Declare the two\n * together when a field must be both present and non-blank.\n *\n * Replaces the `pattern(p.x, /\\S/)` workaround: same rule, but the intent is in the name and the\n * error kind is `notEmpty` rather than `pattern`.\n *\n * On a multi-value field this rule is the ONLY one that sees an empty selection: Angular's\n * `required()` treats emptiness as `'' | false | null | undefined`, so an empty array walks past\n * it. Give it a message of its own there, because the default one talks about whitespace.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override.\n * @returns void\n * @example\n * const f = form(this.model, p => { required(p.city); notEmpty(p.city); });\n * @example\n * const f = form(this.model, p => { notEmpty(p.tags); }); // at least one tag\n */\nexport function notEmpty<TValue extends string | readonly unknown[] | undefined,\n TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n return isBlankValue(ctx.value())\n ? { kind: 'notEmpty', message: config?.message ?? ARS_VALIDATOR_MESSAGES['notEmpty'] }\n : null;\n });\n}\n\n/**\n * Requires the value to differ from the value of another field of the same form.\n *\n * The signal-form counterpart of `NotEqualValidatorDirective`, with its exact rule: two empty\n * values are considered different, so an untouched pair of fields does not start out in error.\n * Reactive on both fields — editing either one re-validates this one, which is what the\n * directive needed a `valueChanges` subscription (and a re-entrancy guard) to achieve.\n *\n * @param path - Path of the field to validate.\n * @param other - Path of the field whose value must differ.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function notEqual<TValue, TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n other: SchemaPath<TValue, SchemaPathRules.Supported>,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const mine = ctx.value();\n const theirs = ctx.valueOf(other);\n const isValid = (!theirs && !mine) || theirs !== mine;\n return isValid ? null : { kind: 'notEqual', message: config?.message ?? ARS_VALIDATOR_MESSAGES['notEqual'] };\n });\n}\n\n/**\n * Requires the value to be a date the backend can store: parseable, and after 1750.\n *\n * The signal-form counterpart of `SqlDateValidatorDirective`. The year floor is not arbitrary —\n * it is what separates a real date from the 01/01/0001 that a mistyped year produces, which SQL\n * Server rejects with an error nobody can read.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function sqlDate<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n const parsed = SystemUtils.parseDate(input);\n const invalid = { kind: 'sqlDate', message: config?.message ?? ARS_VALIDATOR_MESSAGES['sqlDate'] };\n if (!parsed) return invalid;\n return endOfDay(parsed).getFullYear() > 1750 ? null : invalid;\n });\n}\n\n/**\n * Requires the value to be a real date, as {@link SystemUtils.parseDate} understands one.\n *\n * This is the rule for anything a user picks or types as a date: it accepts both the `Date` a\n * Material datepicker or timepicker writes into the model and the text of a plain input, since\n * `parseDate` handles the shapes this codebase produces (ISO, `dd/MM/yyyy`, `yyyy-MM-dd`, and the\n * shorthand forms). Empty passes — saying \"obbligatorio\" is the job of `required()`.\n *\n * A date earlier than {@link MIN_VALID_YEAR} (1 January 1970) is rejected: nothing this\n * application stores predates it, so an earlier value is a typo rather than data.\n *\n * Distinct from {@link sqlDate} on purpose: that one is about what the DATABASE can store (the\n * 1750 floor), this one is about whether the value is a date at all. Pair them when both matter.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n * @example\n * const f = form(this.model, p => { required(p.expiry); date(p.expiry); });\n */\nexport function date<TValue extends string | Date | null | undefined,\n TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (input === undefined || input === null || input === '') return null;\n const parsed = SystemUtils.parseDate(input);\n return parsed && parsed.getFullYear() >= MIN_VALID_YEAR\n ? null\n : { kind: 'date', message: config?.message ?? ARS_VALIDATOR_MESSAGES['date'] };\n });\n}\n\n/**\n * Requires the two ends of a date range to be real dates and to be in order.\n *\n * Written for the two inputs of a `mat-date-range-input`, whose start and end live in two\n * separate fields of the model. Each end is checked with the same rule as {@link date}, and the\n * ordering is checked only when BOTH ends are filled in — a half-open range (\"from today\n * onwards\") is a legitimate filter, not an error. The 1 January 1970 floor of {@link date}\n * applies to both ends.\n *\n * The rule is bound to BOTH paths, so the error appears on whichever end the user is looking at\n * and a single `<mat-error>` under the range can read either one. Comparison is made on the end\n * of the day, so picking the same day for both ends is valid.\n *\n * @param from - Path of the field holding the start of the range.\n * @param to - Path of the field holding the end of the range.\n * @param config - Optional message override (used for the ordering error) and `when` condition.\n * @returns void\n * @example\n * const f = form(this.model, p => { dateRange(p.sentFrom, p.sentTo); });\n */\nexport function dateRange<TValue extends string | Date | null | undefined,\n TPathKind extends PathKind = PathKind.Root>(\n from: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n to: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n date(from, config);\n date(to, config);\n\n /**\n * Compares the two ends of the range once both of them are filled in.\n * @param startValue - Raw value of the start field.\n * @param endValue - Raw value of the end field.\n * @returns The ordering error, or `null` when the pair is acceptable.\n */\n const checkOrder = (startValue: TValue, endValue: TValue) => {\n const start = SystemUtils.parseDate(startValue ?? undefined);\n const end = SystemUtils.parseDate(endValue ?? undefined);\n // A half-open range is legitimate: nothing to compare until both ends are there. An end that\n // is not a valid date is already reported by the `date` rule bound above, so it is skipped\n // here rather than reported twice.\n if (!start || !end) return null;\n if (start.getFullYear() < MIN_VALID_YEAR || end.getFullYear() < MIN_VALID_YEAR) return null;\n return endOfDay(start) <= endOfDay(end)\n ? null\n : { kind: 'dateRange', message: config?.message ?? ARS_VALIDATOR_MESSAGES['dateRange'] };\n };\n\n // Reading the opposite end through `valueOf` keeps each rule reactive on the other field, so\n // filling in one end re-validates the other.\n validate(from, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n return checkOrder(ctx.value(), ctx.valueOf(to));\n });\n validate(to, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n return checkOrder(ctx.valueOf(from), ctx.value());\n });\n}\n\n/**\n * Requires the value to be a date that is not in the future.\n *\n * The signal-form counterpart of `NotFutureValidatorDirective`. Today counts as valid: the\n * comparison is made on the end of the day, so a date entered this morning does not become\n * invalid because the clock says 09:00.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function notFuture<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n const parsed = SystemUtils.parseDate(input);\n const invalid = { kind: 'notFuture', message: config?.message ?? ARS_VALIDATOR_MESSAGES['notFuture'] };\n if (!parsed) return invalid;\n return endOfDay(parsed) <= endOfDay(new Date()) ? null : invalid;\n });\n}\n\n/**\n * Requires the value to be a date that is not in the past.\n *\n * The mirror image of {@link notFuture}, for the fields that can only look forward: an expiry, a\n * deadline, the date of a course still to be held. Today counts as valid — the comparison is made\n * on the start of the day, so a date picked this afternoon for today does not become invalid\n * because the clock has moved on.\n *\n * Like {@link date}, and unlike the older {@link notFuture}, it accepts both the `Date` a Material\n * datepicker writes into the model and the text of a plain input. An empty value passes: saying\n * \"obbligatorio\" is the job of `required()`.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n * @example\n * const f = form(this.model, p => { required(p.scadenza); notPast(p.scadenza); });\n */\nexport function notPast<TValue extends string | Date | null | undefined,\n TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (input === undefined || input === null || input === '') return null;\n const parsed = SystemUtils.parseDate(input);\n const invalid = { kind: 'notPast', message: config?.message ?? ARS_VALIDATOR_MESSAGES['notPast'] };\n if (!parsed) return invalid;\n return startOfDay(parsed) >= startOfDay(new Date()) ? null : invalid;\n });\n}\n\n/**\n * Requires the value to be a well-formed URL. An empty value passes, as everywhere else here.\n *\n * The signal-form counterpart of `UrlValidatorDirective`.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function url<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n return SystemUtils.parseUrl(input)\n ? null\n : { kind: 'url', message: config?.message ?? ARS_VALIDATOR_MESSAGES['url'] };\n });\n}\n\n/**\n * Requires the value to hold no more than `max` whitespace-separated terms.\n *\n * The signal-form counterpart of `MaxTermsValidatorDirective`, used on the search boxes where\n * the backend refuses a query past a certain number of words.\n *\n * @param path - Path of the field to validate.\n * @param max - The maximum number of terms, as a number or a reactive function.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function maxTerms<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n max: number | (() => number),\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input) return null;\n const terms = input.match(/\\S+/g)?.length ?? 0;\n return terms <= (typeof max === 'function' ? max() : max)\n ? null\n : { kind: 'maxTerms', message: config?.message ?? ARS_VALIDATOR_MESSAGES['maxTerms'] };\n });\n}\n\n/**\n * Requires the size of the picked file to fall within the allowed range.\n *\n * The signal-form counterpart of `FileSizeValidatorDirective`, and it keeps its shape: the field\n * itself holds the file NAME, while the size arrives from outside — the control that picked the\n * file knows it, the form does not. An empty field passes, so \"no file\" is `required()`'s call\n * and not a size error.\n *\n * @param path - Path of the field holding the file name.\n * @param sizeMb - The size of the picked file in megabytes, as a reactive function.\n * @param maxSizeMb - The maximum allowed size in megabytes. Defaults to `5`.\n * @param minSizeMb - The minimum required size in megabytes. Defaults to `0`.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function fileSize<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n sizeMb: () => number | undefined,\n maxSizeMb: number | (() => number) = 5,\n minSizeMb: number | (() => number) = 0,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n if (!ctx.value()) return null;\n const size = sizeMb() ?? 0;\n const max = typeof maxSizeMb === 'function' ? maxSizeMb() : maxSizeMb;\n const min = typeof minSizeMb === 'function' ? minSizeMb() : minSizeMb;\n return size <= max && size >= min\n ? null\n : { kind: 'fileSize', message: config?.message ?? ARS_VALIDATOR_MESSAGES['fileSize'] };\n });\n}\n\n/**\n * Requires the value to declare itself valid.\n *\n * The signal-form counterpart of `ValidIfDirective`: when the field holds an object implementing\n * `Validated` the verdict is its own `isValid()`, and when the field is empty the verdict is the\n * `flag`. It is the escape hatch for the composite controls whose validity only they can judge.\n *\n * @param path - Path of the field to validate.\n * @param flag - Verdict used while the field is empty, as a boolean or a reactive function.\n * Defaults to `false`.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function validIf<TValue extends Partial<Validated>, TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n flag: boolean | (() => boolean) = false,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const value = ctx.value();\n let isValid: boolean;\n if (!value) {\n isValid = (typeof flag === 'function' ? flag() : flag) === true;\n } else {\n try {\n isValid = value.isValid?.() === true;\n } catch {\n isValid = false;\n }\n }\n return isValid ? null : { kind: 'validIf', message: config?.message ?? ARS_VALIDATOR_MESSAGES['validIf'] };\n });\n}\n\n/**\n * Requires the value to be a semicolon-separated list of valid e-mail addresses.\n *\n * The signal-form counterpart of `EmailsValidatorDirective`. An empty value passes, and so does\n * an empty entry between two semicolons: the list is typed by hand and a trailing `;` is not a\n * mistake worth an error.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function emails<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n const parts = input.replaceAll(/\\r\\n/g, '').split(';');\n const isValid = parts.every(part => part.length === 0 || !!SystemUtils.parseEmail(part));\n return isValid ? null : { kind: 'emails', message: config?.message ?? ARS_VALIDATOR_MESSAGES['emails'] };\n });\n}\n\n/**\n * Requires the value to be a `\"HH:MM\"` time and, when slots are given, to fall inside one of them.\n *\n * The signal-form counterpart of `TimeValidatorDirective`. An empty value passes.\n *\n * @param path - Path of the field to validate.\n * @param slots - Optional reactive function returning the pipe-separated allowed ranges\n * (e.g. `\"08:00-12:00|14:00-18:00\"`), or `undefined` for no restriction.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function time<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n slots?: () => string | undefined,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n /**\n * Turns `\"HH:MM\"` into a comparable integer (`\"09:30\"` -> `930`).\n * @param value - The time string to parse.\n * @returns The comparable integer, or `-1` when the string is not a valid time.\n */\n const getTime = (value: string): number => {\n const p = value.split(':');\n if (p.length !== 2) return -1;\n const hh = parseInt(p[0], 10);\n if (isNaN(hh) || hh < 0 || hh > 23) return -1;\n const mm = parseInt(p[1], 10);\n if (isNaN(mm) || mm < 0 || mm > 59) return -1;\n return hh * 100 + mm;\n };\n\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n const invalid = { kind: 'time', message: config?.message ?? ARS_VALIDATOR_MESSAGES['time'] };\n const t = getTime(input);\n if (t === -1) return invalid;\n const slotsValue = slots?.();\n if (slotsValue) {\n const inSlot = slotsValue.split('|').some(s => {\n const from = getTime(s.substring(0, 5));\n const to = getTime(s.substring(6));\n return from !== -1 && to !== -1 && from <= t && to >= t;\n });\n if (!inSlot) return invalid;\n }\n return null;\n });\n}\n\n/**\n * Requires the value to equal the value of another field of the same form.\n *\n * The signal-form counterpart of `EqualsValidatorDirective`. Reactive on both fields, which is\n * what the directive needed a `valueChanges` subscription to obtain: retyping the first password\n * re-validates the confirmation without anyone wiring the two together.\n *\n * @param path - Path of the field to validate.\n * @param other - Path of the field whose value must match.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function equals<TValue, TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n other: SchemaPath<TValue, SchemaPathRules.Supported>,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n return ctx.valueOf(other) === ctx.value()\n ? null\n : { kind: 'equals', message: config?.message ?? ARS_VALIDATOR_MESSAGES['equals'] };\n });\n}\n\n/**\n * Requires the value to be either empty or a complete six-digit one-time code.\n *\n * The schema-level counterpart of the validator inside `OtpInputComponent`: a partial code is an\n * error, an empty one is `required()`'s business.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function otp<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value() ?? '';\n if (input.length === 0) return null;\n return /^\\d{6}$/.test(input)\n ? null\n : { kind: 'otp', message: config?.message ?? ARS_VALIDATOR_MESSAGES['otp'] };\n });\n}\n\n/**\n * Requires the value to be a valid Italian VAT number (partita IVA).\n *\n * Eleven digits whose last one is the check digit of D.P.R. 633/72, so a mistyped or invented\n * number is caught here rather than by the backend that will refuse the invoice. An `IT` prefix\n * and the spacing of a pasted value are tolerated, because that is the shape the number arrives\n * in; what is stored is still whatever the user typed, since this rule only judges.\n *\n * An empty value passes, as everywhere else here: declaring the field mandatory is `required()`'s\n * job.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n * @example\n * const f = form(this.model, p => { required(p.partitaIva); italianVat(p.partitaIva); });\n */\nexport function italianVat<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n return isValidItalianVat(input)\n ? null\n : { kind: 'italianVat', message: config?.message ?? ARS_VALIDATOR_MESSAGES['italianVat'] };\n });\n}\n\n/**\n * Requires the value to be a valid Italian fiscal code (codice fiscale).\n *\n * Both shapes a registry form receives are accepted: the sixteen-character code of a natural\n * person, control character recomputed and compared, and the eleven digits of a company or a\n * public body, whose fiscal code IS its VAT number. Nothing has to tell the rule which one is\n * coming — the value says it by its own length.\n *\n * Codes altered by an \"omocodia\" substitution (digits replaced by letters when two people would\n * otherwise share a code) are accepted: they are issued by the Agenzia delle Entrate and rejecting\n * them is the classic way a form turns away a real person.\n *\n * An empty value passes. Pair with `required()` when the field is mandatory, and reach for\n * {@link italianVat} instead on a field that is specifically a VAT number.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n * @example\n * const f = form(this.model, p => { required(p.codiceFiscale); italianFiscalCode(p.codiceFiscale); });\n */\nexport function italianFiscalCode<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n return isValidItalianFiscalCode(input)\n ? null\n : {\n kind: 'italianFiscalCode',\n message: config?.message ?? ARS_VALIDATOR_MESSAGES['italianFiscalCode'],\n };\n });\n}\n\n/** Helpers around signal forms that are not validators themselves. */\nexport class SignalsUtils {\n\n /**\n * Builds the error text for a signal-forms field.\n *\n * Deliberately dumb: the wording lives in the schema, next to the rule that produces it\n * (`required(p.x, { message: ... })`), so a field says what is wrong with it in one place\n * instead of here in a switch that has to guess from the error kind. The map below is only\n * the safety net for the rules declared without a message — the Angular built-ins, plus\n * {@link ARS_VALIDATOR_MESSAGES} for the ones declared in this file.\n * @param errors - The errors currently on the field, from `f.x().errors()`.\n * @param message - Optional override applied to every error of the field.\n * @returns The first relevant error text, or `undefined` when the field has no errors.\n */\n public static getFieldErrorMessage(\n errors: readonly { kind: string; message?: string }[],\n message?: string\n ): string | undefined {\n if (!errors || errors.length === 0) return undefined;\n\n const fallback: Record<string, string> = {\n // Angular built-ins declared without a message of their own.\n min: 'Valore troppo basso',\n max: 'Valore troppo alto',\n minLength: 'Testo troppo corto',\n maxLength: 'Testo troppo lungo',\n pattern: 'Formato non valido',\n email: 'Indirizzo email non valido',\n minDate: 'Data troppo indietro',\n maxDate: 'Data troppo avanti',\n parse: 'Valore non valido',\n matDatepickerParse: 'Data non valida',\n matDatepickerMin: 'Data troppo indietro',\n matDatepickerMax: 'Data troppo avanti',\n matDatepickerFilter: 'Data non selezionabile',\n matStartDateInvalid: 'Intervallo non valido',\n matEndDateInvalid: 'Intervallo non valido',\n matTimepickerParse: 'Orario non valido',\n matTimepickerMin: 'Orario troppo presto',\n matTimepickerMax: 'Orario troppo tardi',\n // The rules of this file, from the single table above: adding a validator there is enough,\n // and this map can never fall behind it.\n ...ARS_VALIDATOR_MESSAGES,\n };\n\n\n message = message ?? errors[0].message ?? fallback[errors[0].kind] ?? '';\n return message.length > 0 ? message : 'Non valido';\n }\n}\n","/*\n * Public API Surface of @arsedizioni/ars-utils/core.validators\n *\n * Template-driven form validators. Kept OUT of `core` on purpose: every one of them pulls in\n * `@angular/forms` (53 KB), and `core` is on the boot path of every application through\n * `ThemeService`, `BroadcastService` and friends. Importing a validator now costs `@angular/forms`\n * only to the lazy chunk that actually uses one.\n */\nexport * from './validators';\n\n// Signal-form flavour of the same rules. Lives here and not in a separate entry point because\n// `@angular/forms/signals` depends on `@angular/forms` anyway, so the two never travel apart.\nexport * from './signals';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAQA;;;AAGG;MA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C,YAAA,GAAG,sBAAsB;SAC1B;QAGD,OAAO,GAAG,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE;AACxE,QAAA,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,OAAO,GAAG,YAAY;IACpD;AACD;;ACrtBD;;;;;;;AAOG;;ACPH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"arsedizioni-ars-utils-core.validators.mjs","sources":["../../../projects/ars-utils/core.validators/validatorDirective.ts","../../../projects/ars-utils/core.validators/validIfDirective.ts","../../../projects/ars-utils/core.validators/equalsValidatorDirective.ts","../../../projects/ars-utils/core.validators/notEqualValidatorDirective.ts","../../../projects/ars-utils/core.validators/emailsValidatorDirective.ts","../../../projects/ars-utils/core.validators/guidValidatorDirective.ts","../../../projects/ars-utils/core.validators/sqlDateValidatorDirective.ts","../../../projects/ars-utils/core.validators/notFutureValidatorDirective.ts","../../../projects/ars-utils/core.validators/urlValidatorDirective.ts","../../../projects/ars-utils/core.validators/fileSizeValidatorDirective.ts","../../../projects/ars-utils/core.validators/maxTermsValidatorDirective.ts","../../../projects/ars-utils/core.validators/passwordValidatorDirective.ts","../../../projects/ars-utils/core.validators/timeValidatorDirective.ts","../../../projects/ars-utils/core.validators/emptiness.ts","../../../projects/ars-utils/core.validators/notEmptyValidatorDirective.ts","../../../projects/ars-utils/core.validators/italian.ts","../../../projects/ars-utils/core.validators/signals.ts","../../../projects/ars-utils/core.validators/public_api.ts","../../../projects/ars-utils/core.validators/arsedizioni-ars-utils-core.validators.ts"],"sourcesContent":["import { Directive, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that delegates validation to an externally provided validator function.\r\n * Bind `[validator]=\"myFn\"` where `myFn` is `(c: AbstractControl) => ValidationErrors | null`.\r\n */\r\n@Directive({\r\n selector: '[validator]',\r\n providers: [{ provide: NG_VALIDATORS, useExisting: ValidatorDirective, multi: true }],\r\n standalone: true,\r\n})\r\nexport class ValidatorDirective implements Validator {\r\n\r\n /** The custom validator function to apply. */\r\n readonly validator = input<((control: AbstractControl) => ValidationErrors | null) | undefined>(undefined);\r\n\r\n /**\r\n * Invokes the provided validator function against the given control.\r\n * Returns `null` (valid) when no function is bound.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const fn = this.validator();\r\n return fn ? fn(control) : null;\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { Validated } from '@arsedizioni/ars-utils/core';\r\n\r\n/**\r\n * Directive that validates a control using the host object's `isValid()` method\r\n * or a boolean expression passed via `[validIf]`.\r\n */\r\n@Directive({\r\n selector: \"[validIf]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => ValidIfDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class ValidIfDirective implements Validator {\r\n\r\n /** When `true`, the control is considered valid regardless of the bound value. */\r\n readonly validIf = input<boolean>(false);\r\n\r\n /**\r\n * Validates the control value against a boolean flag or the value's own `isValid()` method.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n let isValid = false;\r\n const c = control.value ? (control.value as Validated) : null;\r\n if (!c) {\r\n isValid = this.validIf() === true;\r\n } else {\r\n try {\r\n isValid = c.isValid();\r\n } catch { }\r\n }\r\n return isValid ? null : { validIf: \"Non valido.\" };\r\n }\r\n}\r\n","import { DestroyRef, Directive, effect, forwardRef, inject, input } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { Subscription } from \"rxjs\";\n\n/**\n * Directive that validates that the host control's value equals the value of another control.\n * Bind `[equals]=\"otherControl\"`.\n *\n * The host control is re-validated whenever the OTHER control's value changes:\n * without this, typing a new password AFTER the confirmation field was filled\n * left the form incorrectly valid (the classic password/confirm bug).\n *\n * IMPORTANT (reciprocal-binding safety): the re-validation triggered from the\n * other control's `valueChanges` runs with `{ emitEvent: false }`. Calling\n * Angular's `onValidatorChange` instead would re-emit valueChanges, so a\n * reciprocal setup (A [equals]=B and B [equals]=A) would overflow the stack.\n */\n@Directive({\n selector: \"[equals]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => EqualsValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class EqualsValidatorDirective implements Validator {\n\n /** The control whose value must match the host control's value. */\n readonly equals = input<AbstractControl | undefined>(undefined);\n\n /** The host control, captured on the first validate() call. */\n private hostControl?: AbstractControl;\n\n /** Subscription to the other control's valueChanges. */\n private subscription?: Subscription;\n\n constructor() {\n // Re-subscribe whenever the [equals] binding points to a different control,\n // and re-validate the host on every change of the other control.\n effect(() => {\n const other = this.equals();\n this.subscription?.unsubscribe();\n this.subscription = other?.valueChanges.subscribe(() =>\n // emitEvent:false breaks the reciprocal valueChanges loop (see class doc).\n this.hostControl?.updateValueAndValidity({ emitEvent: false })\n );\n // Re-validate the host when the bound control itself is swapped.\n this.hostControl?.updateValueAndValidity({ emitEvent: false });\n });\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n }\n\n /**\n * Validates that the host control value equals the bound control's value.\n * Returns `null` (valid) when no control is bound.\n * @param control - The form control to validate.\n * @returns `null` when valid, `{ equals: ... }` otherwise.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n this.hostControl = control;\n const eq = this.equals();\n if (!eq) return null;\n return eq.value === control.value ? null : { equals: \"Non valido.\" };\n }\n}\n","import { DestroyRef, Directive, effect, forwardRef, inject, input } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { Subscription } from \"rxjs\";\n\n/**\n * Directive that validates that the host control's value is different from another control's value.\n * Bind `[notEqual]=\"otherControl\"`.\n *\n * The host control is re-validated whenever the OTHER control's value changes,\n * so editing either field keeps both error states consistent.\n *\n * IMPORTANT (reciprocal-binding safety): the re-validation triggered from the\n * other control's `valueChanges` is run with `{ emitEvent: false }`. Using\n * Angular's `onValidatorChange` here instead would call `host.updateValueAndValidity()`\n * WITH events, so a reciprocal setup (A [notEqual]=B and B [notEqual]=A) would\n * ping-pong valueChanges between the two controls and overflow the stack.\n */\n@Directive({\n selector: \"[notEqual]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => NotEqualValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class NotEqualValidatorDirective implements Validator {\n\n /** The control whose value must differ from the host control's value. */\n readonly notEqual = input<AbstractControl | undefined>(undefined);\n\n /** The host control, captured on the first validate() call. */\n private hostControl?: AbstractControl;\n\n /** Subscription to the other control's valueChanges. */\n private subscription?: Subscription;\n\n constructor() {\n effect(() => {\n const other = this.notEqual();\n this.subscription?.unsubscribe();\n this.subscription = other?.valueChanges.subscribe(() =>\n // Re-validate the host WITHOUT emitting valueChanges, otherwise a\n // reciprocal binding would loop forever (see class doc).\n this.hostControl?.updateValueAndValidity({ emitEvent: false })\n );\n // Re-validate the host when the bound control itself is swapped.\n this.hostControl?.updateValueAndValidity({ emitEvent: false });\n });\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n }\n\n /**\n * Validates that the host control value is not equal to the bound control's value.\n * Also clears the `notequal` error on the other control when the host becomes valid.\n * Returns `null` (valid) when no control is bound.\n * @param control - The form control to validate.\n * @returns `null` when valid, `{ notequal: true }` otherwise.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n this.hostControl = control;\n\n const notEqual = this.notEqual();\n if (!notEqual) return null;\n\n const isValid = (!notEqual.value && !control.value) || (notEqual.value !== control.value);\n const errors: ValidationErrors | null = isValid ? null : { notequal: true };\n\n if (errors) {\n control.markAsTouched();\n } else if (notEqual.hasError('notequal')) {\n const { notequal: _removed, ...rest } = notEqual.errors ?? {};\n // emitEvent:false on both: clearing the partner's error must not feed\n // back through valueChanges/statusChanges into this validator.\n notEqual.setErrors(Object.keys(rest).length > 0 ? rest : null, { emitEvent: false });\n notEqual.updateValueAndValidity({ onlySelf: true, emitEvent: false });\n notEqual.markAsTouched();\n notEqual.markAsDirty();\n }\n return errors;\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a semicolon-separated list of email addresses.\r\n * Apply `emails` to a text input containing one or more addresses separated by `;`.\r\n */\r\n@Directive({\r\n selector: \"[emails]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => EmailsValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class EmailsValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates each address in a semicolon-separated email list.\r\n * Returns `null` when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input || input.length === 0) return null;\r\n const parts = input.replaceAll(/\\r\\n/g, '').split(';');\r\n const isValid = parts.every(part => part.length === 0 || !!SystemUtils.parseEmail(part));\r\n return isValid ? null : { emails: \"Elenco non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a control value as a GUID / UUID string.\r\n * Apply `guid` to a text input that expects a valid UUID.\r\n */\r\n@Directive({\r\n selector: \"[guid]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => GuidValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class GuidValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value is a well-formed GUID / UUID.\r\n * Returns `null` when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input || input.length === 0) return null;\r\n return SystemUtils.parseUUID(input) ? null : { guid: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { endOfDay } from 'date-fns';\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\n\n/**\n * Directive that validates a control value as a parseable SQL-compatible date string.\n * Apply `sqlDate` to a text input that expects a date after year 1750.\n */\n@Directive({\n selector: \"[sqlDate]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SqlDateValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class SqlDateValidatorDirective implements Validator {\n\n /**\n * Validates that the control value can be parsed as a date after 1750.\n * Returns `null` when the control is empty.\n * @param control - The form control to validate.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n const input: string = control.value;\n if (!input || input.length === 0) return null;\n const parsed = SystemUtils.parseDate(input);\n if (!parsed) return { sqlDate: \"Non valido.\" };\n const d = endOfDay(parsed);\n return d.getFullYear() > 1750 ? null : { sqlDate: \"Non valido.\" };\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { endOfDay } from 'date-fns';\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\n\n/**\n * Directive that validates that a control value is not a future date.\n * Apply `notFuture` to a text input that expects a date on or before today.\n */\n@Directive({\n selector: \"[notFuture]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => NotFutureValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class NotFutureValidatorDirective implements Validator {\n\n /**\n * Validates that the control value represents a date that is not in the future.\n * Returns `null` when the control is empty.\n * @param control - The form control to validate.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n const input: string = control.value;\n if (!input || input.length === 0) return null;\n const parsed = SystemUtils.parseDate(input);\n if (!parsed) return { notFuture: \"Non valido.\" };\n const today = endOfDay(new Date());\n const d = endOfDay(parsed);\n return d <= today ? null : { notFuture: \"Non valido.\" };\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a control value as a well-formed URL.\r\n * Apply `url` to a text input that expects a URL.\r\n */\r\n@Directive({\r\n selector: \"[url]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => UrlValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class UrlValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value is a well-formed URL.\r\n * Returns `null` (valid) when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input || input.length === 0) return null;\r\n return SystemUtils.parseUrl(input) ? null : { url: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that validates a file size against configurable minimum and maximum bounds.\r\n * Bind `[fileSize]` together with `[size]=\"fileSizeInMb\"`, `[maxSizeMb]`, and `[minSizeMb]`.\r\n */\r\n@Directive({\r\n selector: \"[fileSize]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => FileSizeValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class FileSizeValidatorDirective implements Validator {\r\n\r\n /** Maximum allowed file size in megabytes. Defaults to 5. */\r\n readonly maxSizeMb = input<number>(5);\r\n\r\n /** Minimum required file size in megabytes. Defaults to 0. */\r\n readonly minSizeMb = input<number>(0);\r\n\r\n /** The actual file size in megabytes to validate against the bounds. */\r\n readonly size = input<number | undefined>(undefined);\r\n\r\n /**\r\n * Validates that the bound file size falls within the configured min/max range.\r\n * Returns `null` when no control value is present.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input = control.value;\r\n if (!input) return null;\r\n const s = this.size() ?? 0;\r\n const isValid = s <= this.maxSizeMb() && s >= this.minSizeMb();\r\n return isValid ? null : { fileSize: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that validates that a control value does not exceed a maximum word count.\r\n * Bind `[maxTerms]=\"10\"` to allow at most 10 whitespace-separated terms.\r\n */\r\n@Directive({\r\n selector: \"[maxTerms]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => MaxTermsValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class MaxTermsValidatorDirective implements Validator {\r\n\r\n /** The maximum number of whitespace-separated terms allowed. */\r\n readonly maxTerms = input<number>(0);\r\n\r\n /**\r\n * Validates that the control value contains no more than the configured number of terms.\r\n * Returns `null` when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input) return null;\r\n const terms = input.match(/\\S+/g)?.length ?? 0;\r\n return terms <= this.maxTerms() ? null : { maxTerms: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a control value as a sufficiently strong password.\r\n * Apply `password` to a password input.\r\n */\r\n@Directive({\r\n selector: \"[password]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => PasswordValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class PasswordValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value meets the minimum password-strength requirements.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value ?? '';\r\n const strength = SystemUtils.calculatePasswordStrength(input);\r\n return strength.isValid ? null : { password: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\n\n/**\n * Directive that validates a time string against optional allowed time slot ranges.\n * Bind `[time]` and optionally `[slots]=\"'08:00-12:00|14:00-18:00'\"` (pipe-separated ranges).\n */\n@Directive({\n selector: \"[time]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => TimeValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class TimeValidatorDirective implements Validator {\n\n /** Optional pipe-separated list of allowed time ranges, e.g. `\"08:00-12:00|14:00-18:00\"`. */\n readonly slots = input<string | undefined>(undefined);\n\n /**\n * Parses a `\"HH:MM\"` time string into a comparable integer (e.g. `\"09:30\"` -> `930`).\n * Returns `-1` when the string is not a valid time.\n * @param value - The time string to parse.\n */\n private getTime(value: string): number {\n const p = value.split(':');\n if (p.length !== 2) return -1;\n const hh = parseInt(p[0], 10);\n if (isNaN(hh) || hh < 0 || hh > 23) return -1;\n const mm = parseInt(p[1], 10);\n if (isNaN(mm) || mm < 0 || mm > 59) return -1;\n return hh * 100 + mm;\n }\n\n /**\n * Validates that the control value is a valid time string and, when slots are configured,\n * that it falls within at least one of the allowed ranges.\n * Returns `null` when the control is empty.\n * @param control - The form control to validate.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n const input: string = control.value;\n if (!input || input.length === 0) return null;\n\n const t = this.getTime(input);\n if (t === -1) return { time: \"Non valido.\" };\n\n const slotsValue = this.slots();\n if (slotsValue) {\n const isValid = slotsValue.split('|').some(s => {\n const t1 = this.getTime(s.substring(0, 5));\n const t2 = this.getTime(s.substring(6));\n return t1 !== -1 && t2 !== -1 && t1 <= t && t2 >= t;\n });\n return isValid ? null : { time: \"Non valido.\" };\n }\n\n return null;\n }\n}\n","/**\n * @file emptiness.ts\n *\n * The single definition of \"empty\" behind the `notEmpty` rule, in both its flavours: the\n * template-driven directive and the signal-form validator. It lives apart from either of them so\n * that the two faces of the same rule cannot drift, and it pulls in nothing — not\n * `@angular/forms`, not `@angular/core`.\n */\n\n/**\n * Tells whether a value is what the `notEmpty` rule rejects: a string made of whitespace alone,\n * or an array with no elements.\n *\n * An absent value and an empty string are deliberately NOT rejected: declaring a field mandatory\n * is the job of `required()`, and a blank field would otherwise raise two errors saying the same\n * thing. The empty array is the one exception, because there it IS the only shape emptiness can\n * take — a multi-select never holds `''`, and Angular's own `required()` does not see `[]` as\n * empty, so nothing else would catch it.\n *\n * @param value - The value to inspect.\n * @returns `true` when the value is a whitespace-only string or an empty array.\n */\nexport function isBlankValue(value: unknown): boolean {\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value !== 'string') return false;\n return value.length > 0 && value.trim().length === 0;\n}\n","import { Directive, forwardRef } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { isBlankValue } from \"./emptiness\";\n\n/**\n * Directive that validates that a control value is not blank: neither a whitespace-only string\n * nor an empty array. Apply `notEmpty` to a text input where non-blank content is required, or\n * to a multi-value control that must carry at least one entry.\n *\n * A value that is simply absent passes: saying \"obbligatorio\" is the job of `required`, which is\n * declared next to this one when both rules belong on the same control.\n */\n@Directive({\n selector: \"[notEmpty]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => NotEmptyValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class NotEmptyValidatorDirective implements Validator {\n\n /**\n * Validates that the control value carries content.\n * Returns `null` when the control is absent or holds a type this rule says nothing about.\n * @param control - The form control to validate.\n * @returns `{ notEmpty: true }` when the value is a blank string or an empty array, `null` otherwise.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n return isBlankValue(control?.value) ? { notEmpty: true } : null;\n }\n}\n","/**\n * @file italian.ts\n *\n * The two check algorithms behind the `italianVat` and `italianFiscalCode` rules, kept apart from\n * the validators that use them for the same reason `emptiness.ts` is: the rule must exist in one\n * place only, so that no second copy of it can drift. They pull in nothing — not `@angular/forms`,\n * not `@angular/core` — and they live here rather than in `SystemUtils` so that `core`, which sits\n * on the boot path of every application, does not carry code only a form needs.\n */\n\n/**\n * Digits an \"omocodia\" substitution replaces with a letter, in digit order: `0` becomes `L`, `1`\n * becomes `M`, and so on.\n *\n * The Agenzia delle Entrate applies it when two people would otherwise share the same fiscal code,\n * so a perfectly legitimate code can carry letters where the format expects numbers. Ignoring this\n * is the classic way a validator rejects a real person.\n */\nconst OMOCODIA_CHARS = 'LMNPQRSTUV';\n\n/** Letters usable as month of birth, one per month from January (`A`) to December (`T`). */\nconst MONTH_CHARS = 'ABCDEHLMPRST';\n\n/** Alphabet the control character of a fiscal code is drawn from. */\nconst CONTROL_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n/** Weight of each character sitting in an ODD position (1-based) of the first 15 of a fiscal code. */\nconst ODD_WEIGHTS: Readonly<Record<string, number>> = {\n '0': 1, '1': 0, '2': 5, '3': 7, '4': 9, '5': 13, '6': 15, '7': 17, '8': 19, '9': 21,\n A: 1, B: 0, C: 5, D: 7, E: 9, F: 13, G: 15, H: 17, I: 19, J: 21, K: 2, L: 4, M: 18,\n N: 20, O: 11, P: 3, Q: 6, R: 8, S: 12, T: 14, U: 16, V: 10, W: 22, X: 25, Y: 24, Z: 23,\n};\n\n/** Weight of each character sitting in an EVEN position (1-based) of the first 15 of a fiscal code. */\nconst EVEN_WEIGHTS: Readonly<Record<string, number>> = {\n '0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9,\n A: 0, B: 1, C: 2, D: 3, E: 4, F: 5, G: 6, H: 7, I: 8, J: 9, K: 10, L: 11, M: 12,\n N: 13, O: 14, P: 15, Q: 16, R: 17, S: 18, T: 19, U: 20, V: 21, W: 22, X: 23, Y: 24, Z: 25,\n};\n\n/**\n * Shape of a fiscal code of a natural person, omocodia included: every group that is normally\n * numeric also admits the ten letters that stand in for a digit.\n */\nconst FISCAL_CODE_REGEX =\n /^[A-Z]{6}[0-9LMNPQRSTUV]{2}[ABCDEHLMPRST][0-9LMNPQRSTUV]{2}[A-Z][0-9LMNPQRSTUV]{3}[A-Z]$/;\n\n/**\n * Strips what a user types around a code without changing the code itself: surrounding and inner\n * spaces, dots and dashes, and the letter case.\n *\n * Accepting a pasted `\"IT 123 456 789 01\"` is not indulgence — the value arrives from an invoice,\n * a registry export or a colleague's e-mail far more often than it is typed character by\n * character, and rejecting it teaches nothing to the person who pasted it.\n *\n * @param value - The raw value as the user entered it.\n * @returns The value in upper case with spaces, dots and dashes removed.\n */\nfunction normalize(value?: string): string {\n return (value ?? '').toUpperCase().replace(/[\\s.\\-/]/g, '');\n}\n\n/**\n * Turns the letters an omocodia substitution left behind back into the digits they stand for.\n *\n * @param value - A group of characters of a fiscal code that is numeric in the plain form.\n * @returns The same group with every substitution letter replaced by its digit.\n */\nfunction decodeOmocodia(value: string): string {\n let decoded = '';\n for (const char of value) {\n const index = OMOCODIA_CHARS.indexOf(char);\n decoded += index === -1 ? char : String(index);\n }\n return decoded;\n}\n\n/**\n * Tells whether a value is a valid Italian VAT number (partita IVA).\n *\n * Eleven digits, of which the last one is the check digit of the Luhn-like algorithm of\n * D.P.R. 633/72: the digits in even position (1-based) are doubled and folded back under ten, the\n * sum is completed to the next multiple of ten, and what is missing is the check digit. An\n * optional `IT` prefix is accepted, because that is how the number travels on invoices and in\n * VIES exports.\n *\n * The seven digits of the sequential number are required not to be all zeros, which is the one\n * combination the checksum happily accepts and the Agenzia delle Entrate never issues. The office\n * code (positions 8 to 10) is deliberately NOT checked against the list of the provinces: that\n * list grows, and a validator that rejects a number issued last month is worse than one that lets\n * a fabricated office code through.\n *\n * @param value - The value to check, with or without the `IT` prefix and any spacing.\n * @returns `true` when the value is a well-formed VAT number.\n */\nexport function isValidItalianVat(value?: string): boolean {\n const normalized = normalize(value);\n const digits = normalized.startsWith('IT') ? normalized.slice(2) : normalized;\n if (!/^\\d{11}$/.test(digits)) return false;\n if (digits.startsWith('0000000')) return false;\n\n let sum = 0;\n for (let i = 0; i < 10; i++) {\n let digit = digits.charCodeAt(i) - 48;\n // Positions are 1-based in the norm, so the doubled ones are those at an even index here.\n if (i % 2 === 1) {\n digit *= 2;\n if (digit > 9) digit -= 9;\n }\n sum += digit;\n }\n const check = (10 - (sum % 10)) % 10;\n return check === digits.charCodeAt(10) - 48;\n}\n\n/**\n * Tells whether a value is a valid Italian fiscal code (codice fiscale), in either of the two\n * shapes a form can receive.\n *\n * A natural person has the sixteen-character code of D.M. 23/12/1976: the shape is checked, the\n * month letter and the day of birth are checked (41 to 71 for a woman, which is the day plus\n * forty), and the sixteenth character is recomputed from the first fifteen and compared. Letters\n * left by an omocodia substitution are accepted and decoded before the date is judged, so a\n * legitimately altered code is not turned away.\n *\n * A company or a public body has no such code: its fiscal code IS its VAT number, eleven digits\n * checked by {@link isValidItalianVat}. Both are accepted here because a single \"codice fiscale\"\n * field in a registry form receives both, and asking the user which kind they are about to type is\n * a question the code can answer by itself.\n *\n * @param value - The value to check, in any case and with any spacing.\n * @returns `true` when the value is a well-formed fiscal code of either shape.\n */\nexport function isValidItalianFiscalCode(value?: string): boolean {\n const code = normalize(value);\n\n // A company or a public body: its fiscal code is the VAT number.\n if (/^\\d{11}$/.test(code)) return isValidItalianVat(code);\n\n if (code.length !== 16 || !FISCAL_CODE_REGEX.test(code)) return false;\n\n // The day carries the sex: 01-31 for a man, 41-71 for a woman (the day plus forty).\n const day = parseInt(decodeOmocodia(code.substring(9, 11)), 10);\n const isValidDay = (day >= 1 && day <= 31) || (day >= 41 && day <= 71);\n if (!isValidDay) return false;\n\n // The month letter is already constrained by the regex; this keeps the two in step if it changes.\n if (!MONTH_CHARS.includes(code[8])) return false;\n\n let sum = 0;\n for (let i = 0; i < 15; i++) {\n // Odd positions in the norm are the even indexes here. The character is weighted as it is\n // written, substitution letters included: the control character is computed on the altered\n // code, not on the original one.\n sum += i % 2 === 0 ? ODD_WEIGHTS[code[i]] : EVEN_WEIGHTS[code[i]];\n }\n return CONTROL_CHARS[sum % 26] === code[15];\n}\n","import { LogicFn, PathKind, SchemaPath, SchemaPathRules, validate } from '@angular/forms/signals';\nimport { SystemUtils, Validated } from '@arsedizioni/ars-utils/core';\nimport { endOfDay, startOfDay } from 'date-fns';\nimport { isBlankValue } from './emptiness';\nimport { isValidItalianFiscalCode, isValidItalianVat } from './italian';\n\n/**\n * Options shared by the ARS signal-form validators.\n *\n * Mirrors the `config` argument of the Angular built-ins (`required`, `email`, ...) but carries\n * only what these validators need: the message shown to the user in place of the default one.\n */\nexport interface ArsValidatorConfig<TValue = string, TPathKind extends PathKind = PathKind.Root> {\n /** Message attached to the error, in place of the default Italian text. */\n message?: string;\n /**\n * Applies the rule only while this returns `true`, exactly like the `when` of `required()`\n * and of the other Angular built-ins.\n *\n * It exists because these validators are meant to be paired with `required()` on the same\n * field, and a field that is only required in one mode of a dialog must only be validated in\n * that mode: without this, a leftover value would keep a form invalid in a mode where the\n * field is not even shown.\n */\n when?: NoInfer<LogicFn<TValue, boolean, TPathKind>>;\n}\n\n/**\n * Default texts of the rules declared here, in one place so that the validators and the fallback\n * map of `SignalsUtils.getFieldErrorMessage` cannot drift apart: a rule added below without a\n * message here would show \"Errore\", and one renamed here without touching the validator would\n * leave the map with a kind nobody produces.\n */\n/**\n * Earliest year {@link date} and {@link dateRange} accept: 1750.\n *\n * It is the floor of what the backend can store, and it is set that low on purpose: a birth date,\n * the date of an old norm or the commissioning of an old machine are real data well before 1970.\n * What it does catch is the 01/01/0001 or 01/01/0020 that a mistyped year produces, which SQL\n * Server would reject with an error nobody can read.\n */\nexport const MIN_VALID_YEAR = 1750;\n\nexport const ARS_VALIDATOR_MESSAGES: Record<string, string> = {\n required: 'Obbligatorio',\n guid: 'Ticket non riconosciuto',\n password: 'Password non sufficientemente robusta',\n notEmpty: 'Non può essere vuoto o contenere solo spazi.',\n notEqual: 'Deve essere diverso dall\\'altro valore',\n // Emitted by `SqlDateValidatorDirective`, which a `[formField]` on a ControlValueAccessor still reads.\n sqlDate: 'Data non valida',\n date: 'Data non valida',\n dateRange: 'Intervallo non valido',\n notFuture: 'La data non può essere futura',\n notPast: 'La data non può essere passata',\n url: 'Indirizzo non valido',\n maxTerms: 'Troppe parole',\n fileSize: 'Dimensione del file non ammessa',\n validIf: 'Non valido',\n emails: 'Elenco non valido',\n time: 'Orario non valido',\n equals: 'I due valori non coincidono',\n otp: 'Codice non valido',\n italianVat: 'Partita IVA non valida',\n italianFiscalCode: 'Codice fiscale non valido',\n};\n\n/**\n * Requires the value to be a well-formed GUID / UUID.\n *\n * The signal-form counterpart of `GuidValidatorDirective`, sharing its rule down to the empty\n * case: an empty value is NOT an error here, because saying \"obbligatorio\" is the job of\n * `required()` and two errors on one empty field only ever read as noise.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override.\n * @returns void\n * @example\n * const f = form(this.model, p => { required(p.serial); guid(p.serial); });\n */\nexport function guid<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n return SystemUtils.parseUUID(input)\n ? null\n : { kind: 'guid', message: config?.message ?? ARS_VALIDATOR_MESSAGES['guid'] };\n });\n}\n\n/**\n * Requires the value to be a password strong enough for {@link SystemUtils.calculatePasswordStrength}.\n *\n * The signal-form counterpart of `PasswordValidatorDirective`. Unlike {@link guid} it does judge\n * the empty value, because an empty password IS a weak one and the directive behaved the same way.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override.\n * @returns void\n */\nexport function password<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const strength = SystemUtils.calculatePasswordStrength(ctx.value() ?? '');\n return strength.isValid\n ? null\n : { kind: 'password', message: config?.message ?? ARS_VALIDATOR_MESSAGES['password'] };\n });\n}\n\n/**\n * Requires the value not to be made of whitespace alone, and a collection not to be empty.\n *\n * The signal-form counterpart of `NotEmptyValidatorDirective`, sharing its predicate through\n * {@link isBlankValue}: a blank string and an empty array are errors, an absent value is not.\n * That last part is not an oversight — saying \"obbligatorio\" belongs to `required()`, and a field\n * that is merely blank would otherwise raise two errors that mean the same thing. Declare the two\n * together when a field must be both present and non-blank.\n *\n * Replaces the `pattern(p.x, /\\S/)` workaround: same rule, but the intent is in the name and the\n * error kind is `notEmpty` rather than `pattern`.\n *\n * On a multi-value field this rule is the ONLY one that sees an empty selection: Angular's\n * `required()` treats emptiness as `'' | false | null | undefined`, so an empty array walks past\n * it. Give it a message of its own there, because the default one talks about whitespace.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override.\n * @returns void\n * @example\n * const f = form(this.model, p => { required(p.city); notEmpty(p.city); });\n * @example\n * const f = form(this.model, p => { notEmpty(p.tags); }); // at least one tag\n */\nexport function notEmpty<TValue extends string | readonly unknown[] | undefined,\n TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n return isBlankValue(ctx.value())\n ? { kind: 'notEmpty', message: config?.message ?? ARS_VALIDATOR_MESSAGES['notEmpty'] }\n : null;\n });\n}\n\n/**\n * Requires the value to differ from the value of another field of the same form.\n *\n * The signal-form counterpart of `NotEqualValidatorDirective`, with its exact rule: two empty\n * values are considered different, so an untouched pair of fields does not start out in error.\n * Reactive on both fields — editing either one re-validates this one, which is what the\n * directive needed a `valueChanges` subscription (and a re-entrancy guard) to achieve.\n *\n * @param path - Path of the field to validate.\n * @param other - Path of the field whose value must differ.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function notEqual<TValue, TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n other: SchemaPath<TValue, SchemaPathRules.Supported>,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const mine = ctx.value();\n const theirs = ctx.valueOf(other);\n const isValid = (!theirs && !mine) || theirs !== mine;\n return isValid ? null : { kind: 'notEqual', message: config?.message ?? ARS_VALIDATOR_MESSAGES['notEqual'] };\n });\n}\n\n/**\n * Requires the value to be a real date, as {@link SystemUtils.parseDate} understands one.\n *\n * This is the rule for anything a user picks or types as a date: it accepts both the `Date` a\n * Material datepicker or timepicker writes into the model and the text of a plain input, since\n * `parseDate` handles the shapes this codebase produces (ISO, `dd/MM/yyyy`, `yyyy-MM-dd`, and the\n * shorthand forms). Empty passes — saying \"obbligatorio\" is the job of `required()`.\n *\n * A date earlier than {@link MIN_VALID_YEAR} (1750) is rejected: it is what the backend can\n * store, so an earlier value is a mistyped year rather than data.\n *\n * It is also the signal-form counterpart of `SqlDateValidatorDirective`: one rule for every date,\n * whether it is typed or picked.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n * @example\n * const f = form(this.model, p => { required(p.expiry); date(p.expiry); });\n */\nexport function date<TValue extends string | Date | null | undefined,\n TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (input === undefined || input === null || input === '') return null;\n const parsed = SystemUtils.parseDate(input);\n return parsed && parsed.getFullYear() >= MIN_VALID_YEAR\n ? null\n : { kind: 'date', message: config?.message ?? ARS_VALIDATOR_MESSAGES['date'] };\n });\n}\n\n/**\n * Requires the two ends of a date range to be real dates and to be in order.\n *\n * Written for the two inputs of a `mat-date-range-input`, whose start and end live in two\n * separate fields of the model. Each end is checked with the same rule as {@link date}, and the\n * ordering is checked only when BOTH ends are filled in — a half-open range (\"from today\n * onwards\") is a legitimate filter, not an error. The {@link MIN_VALID_YEAR} floor of {@link date}\n * applies to both ends.\n *\n * The rule is bound to BOTH paths, so the error appears on whichever end the user is looking at\n * and a single `<mat-error>` under the range can read either one. Comparison is made on the end\n * of the day, so picking the same day for both ends is valid.\n *\n * @param from - Path of the field holding the start of the range.\n * @param to - Path of the field holding the end of the range.\n * @param config - Optional message override (used for the ordering error) and `when` condition.\n * @returns void\n * @example\n * const f = form(this.model, p => { dateRange(p.sentFrom, p.sentTo); });\n */\nexport function dateRange<TValue extends string | Date | null | undefined,\n TPathKind extends PathKind = PathKind.Root>(\n from: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n to: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n date(from, config);\n date(to, config);\n\n /**\n * Compares the two ends of the range once both of them are filled in.\n * @param startValue - Raw value of the start field.\n * @param endValue - Raw value of the end field.\n * @returns The ordering error, or `null` when the pair is acceptable.\n */\n const checkOrder = (startValue: TValue, endValue: TValue) => {\n const start = SystemUtils.parseDate(startValue ?? undefined);\n const end = SystemUtils.parseDate(endValue ?? undefined);\n // A half-open range is legitimate: nothing to compare until both ends are there. An end that\n // is not a valid date is already reported by the `date` rule bound above, so it is skipped\n // here rather than reported twice.\n if (!start || !end) return null;\n if (start.getFullYear() < MIN_VALID_YEAR || end.getFullYear() < MIN_VALID_YEAR) return null;\n return endOfDay(start) <= endOfDay(end)\n ? null\n : { kind: 'dateRange', message: config?.message ?? ARS_VALIDATOR_MESSAGES['dateRange'] };\n };\n\n // Reading the opposite end through `valueOf` keeps each rule reactive on the other field, so\n // filling in one end re-validates the other.\n validate(from, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n return checkOrder(ctx.value(), ctx.valueOf(to));\n });\n validate(to, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n return checkOrder(ctx.valueOf(from), ctx.value());\n });\n}\n\n/**\n * Requires the value to be a date that is not in the future.\n *\n * The signal-form counterpart of `NotFutureValidatorDirective`. Today counts as valid: the\n * comparison is made on the end of the day, so a date entered this morning does not become\n * invalid because the clock says 09:00.\n *\n * Like {@link notPast}, it accepts both the `Date` a Material datepicker writes into the model and\n * the text of a plain input. An empty value passes: saying \"obbligatorio\" is the job of\n * `required()`.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n * @example\n * const f = form(this.model, p => { required(p.executionDate); notFuture(p.executionDate); });\n */\nexport function notFuture<TValue extends string | Date | null | undefined,\n TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (input === undefined || input === null || input === '') return null;\n const parsed = SystemUtils.parseDate(input);\n const invalid = { kind: 'notFuture', message: config?.message ?? ARS_VALIDATOR_MESSAGES['notFuture'] };\n if (!parsed) return invalid;\n return endOfDay(parsed) <= endOfDay(new Date()) ? null : invalid;\n });\n}\n\n/**\n * Requires the value to be a date that is not in the past.\n *\n * The mirror image of {@link notFuture}, for the fields that can only look forward: an expiry, a\n * deadline, the date of a course still to be held. Today counts as valid — the comparison is made\n * on the start of the day, so a date picked this afternoon for today does not become invalid\n * because the clock has moved on.\n *\n * Like {@link date}, and unlike the older {@link notFuture}, it accepts both the `Date` a Material\n * datepicker writes into the model and the text of a plain input. An empty value passes: saying\n * \"obbligatorio\" is the job of `required()`.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n * @example\n * const f = form(this.model, p => { required(p.scadenza); notPast(p.scadenza); });\n */\nexport function notPast<TValue extends string | Date | null | undefined,\n TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (input === undefined || input === null || input === '') return null;\n const parsed = SystemUtils.parseDate(input);\n const invalid = { kind: 'notPast', message: config?.message ?? ARS_VALIDATOR_MESSAGES['notPast'] };\n if (!parsed) return invalid;\n return startOfDay(parsed) >= startOfDay(new Date()) ? null : invalid;\n });\n}\n\n/**\n * Requires the value to be a well-formed URL. An empty value passes, as everywhere else here.\n *\n * The signal-form counterpart of `UrlValidatorDirective`.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function url<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n return SystemUtils.parseUrl(input)\n ? null\n : { kind: 'url', message: config?.message ?? ARS_VALIDATOR_MESSAGES['url'] };\n });\n}\n\n/**\n * Requires the value to hold no more than `max` whitespace-separated terms.\n *\n * The signal-form counterpart of `MaxTermsValidatorDirective`, used on the search boxes where\n * the backend refuses a query past a certain number of words.\n *\n * @param path - Path of the field to validate.\n * @param max - The maximum number of terms, as a number or a reactive function.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function maxTerms<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n max: number | (() => number),\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input) return null;\n const terms = input.match(/\\S+/g)?.length ?? 0;\n return terms <= (typeof max === 'function' ? max() : max)\n ? null\n : { kind: 'maxTerms', message: config?.message ?? ARS_VALIDATOR_MESSAGES['maxTerms'] };\n });\n}\n\n/**\n * Requires the size of the picked file to fall within the allowed range.\n *\n * The signal-form counterpart of `FileSizeValidatorDirective`, and it keeps its shape: the field\n * itself holds the file NAME, while the size arrives from outside — the control that picked the\n * file knows it, the form does not. An empty field passes, so \"no file\" is `required()`'s call\n * and not a size error.\n *\n * @param path - Path of the field holding the file name.\n * @param sizeMb - The size of the picked file in megabytes, as a reactive function.\n * @param maxSizeMb - The maximum allowed size in megabytes. Defaults to `5`.\n * @param minSizeMb - The minimum required size in megabytes. Defaults to `0`.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function fileSize<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n sizeMb: () => number | undefined,\n maxSizeMb: number | (() => number) = 5,\n minSizeMb: number | (() => number) = 0,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n if (!ctx.value()) return null;\n const size = sizeMb() ?? 0;\n const max = typeof maxSizeMb === 'function' ? maxSizeMb() : maxSizeMb;\n const min = typeof minSizeMb === 'function' ? minSizeMb() : minSizeMb;\n return size <= max && size >= min\n ? null\n : { kind: 'fileSize', message: config?.message ?? ARS_VALIDATOR_MESSAGES['fileSize'] };\n });\n}\n\n/**\n * Requires the value to declare itself valid.\n *\n * The signal-form counterpart of `ValidIfDirective`: when the field holds an object implementing\n * `Validated` the verdict is its own `isValid()`, and when the field is empty the verdict is the\n * `flag`. It is the escape hatch for the composite controls whose validity only they can judge.\n *\n * @param path - Path of the field to validate.\n * @param flag - Verdict used while the field is empty, as a boolean or a reactive function.\n * Defaults to `false`.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function validIf<TValue extends Partial<Validated>, TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n flag: boolean | (() => boolean) = false,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const value = ctx.value();\n let isValid: boolean;\n if (!value) {\n isValid = (typeof flag === 'function' ? flag() : flag) === true;\n } else {\n try {\n isValid = value.isValid?.() === true;\n } catch {\n isValid = false;\n }\n }\n return isValid ? null : { kind: 'validIf', message: config?.message ?? ARS_VALIDATOR_MESSAGES['validIf'] };\n });\n}\n\n/**\n * Requires the value to be a semicolon-separated list of valid e-mail addresses.\n *\n * The signal-form counterpart of `EmailsValidatorDirective`. An empty value passes, and so does\n * an empty entry between two semicolons: the list is typed by hand and a trailing `;` is not a\n * mistake worth an error.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function emails<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n const parts = input.replaceAll(/\\r\\n/g, '').split(';');\n const isValid = parts.every(part => part.length === 0 || !!SystemUtils.parseEmail(part));\n return isValid ? null : { kind: 'emails', message: config?.message ?? ARS_VALIDATOR_MESSAGES['emails'] };\n });\n}\n\n/**\n * Requires the value to be a `\"HH:MM\"` time and, when slots are given, to fall inside one of them.\n *\n * The signal-form counterpart of `TimeValidatorDirective`. An empty value passes.\n *\n * @param path - Path of the field to validate.\n * @param slots - Optional reactive function returning the pipe-separated allowed ranges\n * (e.g. `\"08:00-12:00|14:00-18:00\"`), or `undefined` for no restriction.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function time<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n slots?: () => string | undefined,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n /**\n * Turns `\"HH:MM\"` into a comparable integer (`\"09:30\"` -> `930`).\n * @param value - The time string to parse.\n * @returns The comparable integer, or `-1` when the string is not a valid time.\n */\n const getTime = (value: string): number => {\n const p = value.split(':');\n if (p.length !== 2) return -1;\n const hh = parseInt(p[0], 10);\n if (isNaN(hh) || hh < 0 || hh > 23) return -1;\n const mm = parseInt(p[1], 10);\n if (isNaN(mm) || mm < 0 || mm > 59) return -1;\n return hh * 100 + mm;\n };\n\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n const invalid = { kind: 'time', message: config?.message ?? ARS_VALIDATOR_MESSAGES['time'] };\n const t = getTime(input);\n if (t === -1) return invalid;\n const slotsValue = slots?.();\n if (slotsValue) {\n const inSlot = slotsValue.split('|').some(s => {\n const from = getTime(s.substring(0, 5));\n const to = getTime(s.substring(6));\n return from !== -1 && to !== -1 && from <= t && to >= t;\n });\n if (!inSlot) return invalid;\n }\n return null;\n });\n}\n\n/**\n * Requires the value to equal the value of another field of the same form.\n *\n * The signal-form counterpart of `EqualsValidatorDirective`. Reactive on both fields, which is\n * what the directive needed a `valueChanges` subscription to obtain: retyping the first password\n * re-validates the confirmation without anyone wiring the two together.\n *\n * @param path - Path of the field to validate.\n * @param other - Path of the field whose value must match.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function equals<TValue, TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n other: SchemaPath<TValue, SchemaPathRules.Supported>,\n config?: ArsValidatorConfig<TValue, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n return ctx.valueOf(other) === ctx.value()\n ? null\n : { kind: 'equals', message: config?.message ?? ARS_VALIDATOR_MESSAGES['equals'] };\n });\n}\n\n/**\n * Requires the value to be either empty or a complete six-digit one-time code.\n *\n * The schema-level counterpart of the validator inside `OtpInputComponent`: a partial code is an\n * error, an empty one is `required()`'s business.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n */\nexport function otp<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value() ?? '';\n if (input.length === 0) return null;\n return /^\\d{6}$/.test(input)\n ? null\n : { kind: 'otp', message: config?.message ?? ARS_VALIDATOR_MESSAGES['otp'] };\n });\n}\n\n/**\n * Requires the value to be a valid Italian VAT number (partita IVA).\n *\n * Eleven digits whose last one is the check digit of D.P.R. 633/72, so a mistyped or invented\n * number is caught here rather than by the backend that will refuse the invoice. An `IT` prefix\n * and the spacing of a pasted value are tolerated, because that is the shape the number arrives\n * in; what is stored is still whatever the user typed, since this rule only judges.\n *\n * An empty value passes, as everywhere else here: declaring the field mandatory is `required()`'s\n * job.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n * @example\n * const f = form(this.model, p => { required(p.partitaIva); italianVat(p.partitaIva); });\n */\nexport function italianVat<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n return isValidItalianVat(input)\n ? null\n : { kind: 'italianVat', message: config?.message ?? ARS_VALIDATOR_MESSAGES['italianVat'] };\n });\n}\n\n/**\n * Requires the value to be a valid Italian fiscal code (codice fiscale).\n *\n * Both shapes a registry form receives are accepted: the sixteen-character code of a natural\n * person, control character recomputed and compared, and the eleven digits of a company or a\n * public body, whose fiscal code IS its VAT number. Nothing has to tell the rule which one is\n * coming — the value says it by its own length.\n *\n * Codes altered by an \"omocodia\" substitution (digits replaced by letters when two people would\n * otherwise share a code) are accepted: they are issued by the Agenzia delle Entrate and rejecting\n * them is the classic way a form turns away a real person.\n *\n * An empty value passes. Pair with `required()` when the field is mandatory, and reach for\n * {@link italianVat} instead on a field that is specifically a VAT number.\n *\n * @param path - Path of the field to validate.\n * @param config - Optional message override and `when` condition.\n * @returns void\n * @example\n * const f = form(this.model, p => { required(p.codiceFiscale); italianFiscalCode(p.codiceFiscale); });\n */\nexport function italianFiscalCode<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n config?: ArsValidatorConfig<string, TPathKind>\n): void {\n validate(path, ctx => {\n if (config?.when && !config.when(ctx)) return null;\n const input = ctx.value();\n if (!input || input.length === 0) return null;\n return isValidItalianFiscalCode(input)\n ? null\n : {\n kind: 'italianFiscalCode',\n message: config?.message ?? ARS_VALIDATOR_MESSAGES['italianFiscalCode'],\n };\n });\n}\n\n/** Helpers around signal forms that are not validators themselves. */\nexport class SignalsUtils {\n\n /**\n * Builds the error text for a signal-forms field.\n *\n * Deliberately dumb: the wording lives in the schema, next to the rule that produces it\n * (`required(p.x, { message: ... })`), so a field says what is wrong with it in one place\n * instead of here in a switch that has to guess from the error kind. The map below is only\n * the safety net for the rules declared without a message — the Angular built-ins, plus\n * {@link ARS_VALIDATOR_MESSAGES} for the ones declared in this file.\n * @param errors - The errors currently on the field, from `f.x().errors()`.\n * @param message - Optional override applied to every error of the field.\n * @returns The first relevant error text, or `undefined` when the field has no errors.\n */\n public static getFieldErrorMessage(\n errors: readonly { kind: string; message?: string }[],\n message?: string\n ): string | undefined {\n if (!errors || errors.length === 0) return undefined;\n\n const fallback: Record<string, string> = {\n // Angular built-ins declared without a message of their own.\n min: 'Valore troppo basso',\n max: 'Valore troppo alto',\n minLength: 'Testo troppo corto',\n maxLength: 'Testo troppo lungo',\n pattern: 'Formato non valido',\n email: 'Indirizzo email non valido',\n minDate: 'Data troppo indietro',\n maxDate: 'Data troppo avanti',\n parse: 'Valore non valido',\n matDatepickerParse: 'Data non valida',\n matDatepickerMin: 'Data troppo indietro',\n matDatepickerMax: 'Data troppo avanti',\n matDatepickerFilter: 'Data non selezionabile',\n matStartDateInvalid: 'Intervallo non valido',\n matEndDateInvalid: 'Intervallo non valido',\n matTimepickerParse: 'Orario non valido',\n matTimepickerMin: 'Orario troppo presto',\n matTimepickerMax: 'Orario troppo tardi',\n // The rules of this file, from the single table above: adding a validator there is enough,\n // and this map can never fall behind it.\n ...ARS_VALIDATOR_MESSAGES,\n };\n\n\n message = message ?? errors[0].message ?? fallback[errors[0].kind] ?? '';\n return message.length > 0 ? message : 'Non valido';\n }\n}\n","/*\n * Public API Surface of @arsedizioni/ars-utils/core.validators\n *\n * Template-driven form validators. Kept OUT of `core` on purpose: every one of them pulls in\n * `@angular/forms` (53 KB), and `core` is on the boot path of every application through\n * `ThemeService`, `BroadcastService` and friends. Importing a validator now costs `@angular/forms`\n * only to the lazy chunk that actually uses one.\n */\nexport * from './validators';\n\n// Signal-form flavour of the same rules. Lives here and not in a separate entry point because\n// `@angular/forms/signals` depends on `@angular/forms` anyway, so the two never travel apart.\nexport * from './signals';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAQA;;;AAGG;MAMU,kBAAkB,CAAA;AAL/B,IAAA,WAAA,GAAA;;QAQW,IAAA,CAAA,SAAS,GAAG,KAAK,CAAsE,SAAS;sFAAC;AAW3G,IAAA;AATC;;;;AAIG;AACH,IAAA,QAAQ,CAAC,OAAwB,EAAA;AAC/B,QAAA,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE;AAC3B,QAAA,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,IAAI;IAChC;8GAbW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,SAAA,EAHlB,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAG1E,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAL9B,SAAS;AAAC,YAAA,IAAA,EA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QAAA,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;AAAE,YAAA,OAAO,SAAS;AAEpD,QAAA,MAAM,QAAQ,GAA2B;;AAEvC,YAAA,GAAG,EAAE,qBAAqB;AAC1B,YAAA,GAAG,EAAE,oBAAoB;AACzB,YAAA,SAAS,EAAE,oBAAoB;AAC/B,YAAA,SAAS,EAAE,oBAAoB;AAC/B,YAAA,OAAO,EAAE,oBAAoB;AAC7B,YAAA,KAAK,EAAE,4BAA4B;AACnC,YAAA,OAAO,EAAE,sBAAsB;AAC/B,YAAA,OAAO,EAAE,oBAAoB;AAC7B,YAAA,KAAK,EAAE,mBAAmB;AAC1B,YAAA,kBAAkB,EAAE,iBAAiB;AACrC,YAAA,gBAAgB,EAAE,sBAAsB;AACxC,YAAA,gBAAgB,EAAE,oBAAoB;AACtC,YAAA,mBAAmB,EAAE,wBAAwB;AAC7C,YAAA,mBAAmB,EAAE,uBAAuB;AAC5C,YAAA,iBAAiB,EAAE,uBAAuB;AAC1C,YAAA,kBAAkB,EAAE,mBAAmB;AACvC,YAAA,gBAAgB,EAAE,sBAAsB;AACxC,YAAA,gBAAgB,EAAE,qBAAqB;;;AAGvC,YAAA,GAAG,sBAAsB;SAC1B;QAGD,OAAO,GAAG,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE;AACxE,QAAA,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,OAAO,GAAG,YAAY;IACpD;AACD;;ACnsBD;;;;;;;AAOG;;ACPH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -299,14 +299,14 @@ interface ArsValidatorConfig<TValue = string, TPathKind extends PathKind = PathK
|
|
|
299
299
|
* leave the map with a kind nobody produces.
|
|
300
300
|
*/
|
|
301
301
|
/**
|
|
302
|
-
* Earliest
|
|
302
|
+
* Earliest year {@link date} and {@link dateRange} accept: 1750.
|
|
303
303
|
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
304
|
+
* It is the floor of what the backend can store, and it is set that low on purpose: a birth date,
|
|
305
|
+
* the date of an old norm or the commissioning of an old machine are real data well before 1970.
|
|
306
|
+
* What it does catch is the 01/01/0001 or 01/01/0020 that a mistyped year produces, which SQL
|
|
307
|
+
* Server would reject with an error nobody can read.
|
|
308
308
|
*/
|
|
309
|
-
declare const MIN_VALID_YEAR =
|
|
309
|
+
declare const MIN_VALID_YEAR = 1750;
|
|
310
310
|
declare const ARS_VALIDATOR_MESSAGES: Record<string, string>;
|
|
311
311
|
/**
|
|
312
312
|
* Requires the value to be a well-formed GUID / UUID.
|
|
@@ -372,18 +372,6 @@ declare function notEmpty<TValue extends string | readonly unknown[] | undefined
|
|
|
372
372
|
* @returns void
|
|
373
373
|
*/
|
|
374
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;
|
|
375
|
-
/**
|
|
376
|
-
* Requires the value to be a date the backend can store: parseable, and after 1750.
|
|
377
|
-
*
|
|
378
|
-
* The signal-form counterpart of `SqlDateValidatorDirective`. The year floor is not arbitrary —
|
|
379
|
-
* it is what separates a real date from the 01/01/0001 that a mistyped year produces, which SQL
|
|
380
|
-
* Server rejects with an error nobody can read.
|
|
381
|
-
*
|
|
382
|
-
* @param path - Path of the field to validate.
|
|
383
|
-
* @param config - Optional message override and `when` condition.
|
|
384
|
-
* @returns void
|
|
385
|
-
*/
|
|
386
|
-
declare function sqlDate<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>, config?: ArsValidatorConfig<string, TPathKind>): void;
|
|
387
375
|
/**
|
|
388
376
|
* Requires the value to be a real date, as {@link SystemUtils.parseDate} understands one.
|
|
389
377
|
*
|
|
@@ -392,11 +380,11 @@ declare function sqlDate<TPathKind extends PathKind = PathKind.Root>(path: Schem
|
|
|
392
380
|
* `parseDate` handles the shapes this codebase produces (ISO, `dd/MM/yyyy`, `yyyy-MM-dd`, and the
|
|
393
381
|
* shorthand forms). Empty passes — saying "obbligatorio" is the job of `required()`.
|
|
394
382
|
*
|
|
395
|
-
* A date earlier than {@link MIN_VALID_YEAR} (
|
|
396
|
-
*
|
|
383
|
+
* A date earlier than {@link MIN_VALID_YEAR} (1750) is rejected: it is what the backend can
|
|
384
|
+
* store, so an earlier value is a mistyped year rather than data.
|
|
397
385
|
*
|
|
398
|
-
*
|
|
399
|
-
*
|
|
386
|
+
* It is also the signal-form counterpart of `SqlDateValidatorDirective`: one rule for every date,
|
|
387
|
+
* whether it is typed or picked.
|
|
400
388
|
*
|
|
401
389
|
* @param path - Path of the field to validate.
|
|
402
390
|
* @param config - Optional message override and `when` condition.
|
|
@@ -411,7 +399,7 @@ declare function date<TValue extends string | Date | null | undefined, TPathKind
|
|
|
411
399
|
* Written for the two inputs of a `mat-date-range-input`, whose start and end live in two
|
|
412
400
|
* separate fields of the model. Each end is checked with the same rule as {@link date}, and the
|
|
413
401
|
* ordering is checked only when BOTH ends are filled in — a half-open range ("from today
|
|
414
|
-
* onwards") is a legitimate filter, not an error. The
|
|
402
|
+
* onwards") is a legitimate filter, not an error. The {@link MIN_VALID_YEAR} floor of {@link date}
|
|
415
403
|
* applies to both ends.
|
|
416
404
|
*
|
|
417
405
|
* The rule is bound to BOTH paths, so the error appears on whichever end the user is looking at
|
|
@@ -433,11 +421,17 @@ declare function dateRange<TValue extends string | Date | null | undefined, TPat
|
|
|
433
421
|
* comparison is made on the end of the day, so a date entered this morning does not become
|
|
434
422
|
* invalid because the clock says 09:00.
|
|
435
423
|
*
|
|
424
|
+
* Like {@link notPast}, it accepts both the `Date` a Material datepicker writes into the model and
|
|
425
|
+
* the text of a plain input. An empty value passes: saying "obbligatorio" is the job of
|
|
426
|
+
* `required()`.
|
|
427
|
+
*
|
|
436
428
|
* @param path - Path of the field to validate.
|
|
437
429
|
* @param config - Optional message override and `when` condition.
|
|
438
430
|
* @returns void
|
|
431
|
+
* @example
|
|
432
|
+
* const f = form(this.model, p => { required(p.executionDate); notFuture(p.executionDate); });
|
|
439
433
|
*/
|
|
440
|
-
declare function notFuture<TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<
|
|
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;
|
|
441
435
|
/**
|
|
442
436
|
* Requires the value to be a date that is not in the past.
|
|
443
437
|
*
|
|
@@ -617,5 +611,5 @@ declare class SignalsUtils {
|
|
|
617
611
|
}[], message?: string): string | undefined;
|
|
618
612
|
}
|
|
619
613
|
|
|
620
|
-
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,
|
|
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 };
|
|
621
615
|
export type { ArsValidatorConfig };
|