@alfresco/adf-core 8.4.0-17399835374 → 8.4.0-17407900008
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/fesm2022/adf-core.mjs
CHANGED
|
@@ -21186,27 +21186,23 @@ class MinLengthFieldValidator {
|
|
|
21186
21186
|
}
|
|
21187
21187
|
}
|
|
21188
21188
|
class MaxLengthFieldValidator {
|
|
21189
|
-
constructor(
|
|
21190
|
-
this.supportedTypes =
|
|
21191
|
-
this.maxLength = maxLength;
|
|
21189
|
+
constructor() {
|
|
21190
|
+
this.supportedTypes = [FormFieldTypes.TEXT, FormFieldTypes.MULTILINE_TEXT];
|
|
21192
21191
|
}
|
|
21193
21192
|
isSupported(field) {
|
|
21194
|
-
return field && this.supportedTypes.indexOf(field.type) > -1 &&
|
|
21193
|
+
return field && this.supportedTypes.indexOf(field.type) > -1 && field.maxLength > 0;
|
|
21195
21194
|
}
|
|
21196
21195
|
validate(field) {
|
|
21197
21196
|
if (this.isSupported(field) && field.value && field.isVisible) {
|
|
21198
|
-
if (field.value.
|
|
21197
|
+
if (field.value.length <= field.maxLength) {
|
|
21199
21198
|
return true;
|
|
21200
21199
|
}
|
|
21201
21200
|
field.validationSummary.message = `FORM.FIELD.VALIDATOR.NO_LONGER_THAN`;
|
|
21202
|
-
field.validationSummary.attributes.set('maxLength',
|
|
21201
|
+
field.validationSummary.attributes.set('maxLength', field.maxLength.toLocaleString());
|
|
21203
21202
|
return false;
|
|
21204
21203
|
}
|
|
21205
21204
|
return true;
|
|
21206
21205
|
}
|
|
21207
|
-
getMaxLength(field) {
|
|
21208
|
-
return this.maxLength ?? field.maxLength;
|
|
21209
|
-
}
|
|
21210
21206
|
}
|
|
21211
21207
|
class MinValueFieldValidator {
|
|
21212
21208
|
constructor() {
|
|
@@ -21337,7 +21333,6 @@ const FORM_FIELD_VALIDATORS = [
|
|
|
21337
21333
|
new NumberFieldValidator(),
|
|
21338
21334
|
new MinLengthFieldValidator(),
|
|
21339
21335
|
new MaxLengthFieldValidator(),
|
|
21340
|
-
new MaxLengthFieldValidator([FormFieldTypes.NUMBER], 10),
|
|
21341
21336
|
new MinValueFieldValidator(),
|
|
21342
21337
|
new MaxValueFieldValidator(),
|
|
21343
21338
|
new RegExFieldValidator(),
|