tuain-ng-forms-lib 15.0.22 → 15.0.24

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.
@@ -859,6 +859,7 @@ class FieldDescriptor extends FormElement {
859
859
  this.defaultEditable = this.enabled;
860
860
  this.required = fld.required ?? false;
861
861
  this.outputOnly = fld.outputOnly ?? false;
862
+ this.minLength = fld.minLength ?? 0;
862
863
  this.maxLength = fld.maxLength || (this._captureType === 'TEXTAREA' ? BIG_MAX_LENGTH : STD_MAX_LENGTH);
863
864
  this.intrinsicErrorMessage = this._formConfig?.fieldValidations?.[this._fieldType]?.message
864
865
  ?? this._formConfig?.fieldValidations?.DEFAULT?.message ?? '';
@@ -902,6 +903,16 @@ class FieldDescriptor extends FormElement {
902
903
  return false;
903
904
  }
904
905
  ;
906
+ const arrayFieldTypes = this._formConfig.arrayFieldTypes ?? null;
907
+ if (arrayFieldTypes && Object.keys(arrayFieldTypes).includes(this._fieldType)) {
908
+ let arraySize = arrayFieldTypes[this._fieldType];
909
+ arraySize = !Number.isNaN(+arraySize) ? +arraySize : 0;
910
+ if (arraySize === 0) {
911
+ return (Array.isArray(fieldCurrentValue) && fieldCurrentValue.length === 0);
912
+ }
913
+ return (Array.isArray(fieldCurrentValue) && fieldCurrentValue.length < arraySize);
914
+ }
915
+ ;
905
916
  return fieldCurrentValue === '';
906
917
  }
907
918
  get error() { return { type: this._errorType, code: this._errorCode, message: this._errorMessage }; }
@@ -930,7 +941,9 @@ class FieldDescriptor extends FormElement {
930
941
  this.setAttr(attrs$1._maxValue, maxValue);
931
942
  }
932
943
  get minLength() { return this._minLength; }
933
- set minLength(requiredMinLength) { this.setAttr(attrs$1._minLength, requiredMinLength ? +requiredMinLength : null); }
944
+ set minLength(requiredMinLength) {
945
+ this.setAttr(attrs$1._minLength, requiredMinLength ? +requiredMinLength : null);
946
+ }
934
947
  get minValue() { return this._minValue; }
935
948
  set minValue(inputMinValue) {
936
949
  let minValue = inputMinValue;