@stemy/ngx-dynamic-form 19.9.15 → 19.9.16
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.
|
@@ -542,7 +542,8 @@ class ConfigForSchemaWrap {
|
|
|
542
542
|
}
|
|
543
543
|
async customize(field, property, schema) {
|
|
544
544
|
field.defaultValue = property.format?.startsWith("date")
|
|
545
|
-
? convertToDateFormat(
|
|
545
|
+
? convertToDateFormat(field.defaultValue, property.format)
|
|
546
|
+
: field.defaultValue;
|
|
546
547
|
const res = await ForbiddenZone.run("customizer", () => this.fieldCustomizer(field, this.forCustomizer(), this.injector, property, schema));
|
|
547
548
|
return !res ? [field] : handleConfigs(res);
|
|
548
549
|
}
|
|
@@ -744,8 +745,7 @@ class DynamicFormBuilderService {
|
|
|
744
745
|
};
|
|
745
746
|
switch (type) {
|
|
746
747
|
case "checkbox":
|
|
747
|
-
data.defaultValue = data.defaultValue ??
|
|
748
|
-
console.log("Helo", key, data);
|
|
748
|
+
data.defaultValue = data.defaultValue ?? false;
|
|
749
749
|
break;
|
|
750
750
|
case "number":
|
|
751
751
|
case "integer":
|
|
@@ -760,6 +760,7 @@ class DynamicFormBuilderService {
|
|
|
760
760
|
case "string":
|
|
761
761
|
case "text":
|
|
762
762
|
case "textarea":
|
|
763
|
+
data.defaultValue = data.defaultValue ?? "";
|
|
763
764
|
props.minLength = isNaN(data.minLength) ? 0 : data.minLength;
|
|
764
765
|
props.maxLength = isNaN(data.maxLength) ? MAX_INPUT_NUM : data.maxLength;
|
|
765
766
|
break;
|
|
@@ -1255,7 +1256,7 @@ class DynamicFormSchemaService {
|
|
|
1255
1256
|
break;
|
|
1256
1257
|
}
|
|
1257
1258
|
const sub = property.type == "array" ? property.items || property : property;
|
|
1258
|
-
|
|
1259
|
+
const input = this.builder.createFormInput(property.id, {
|
|
1259
1260
|
...this.getFormFieldData(property, options),
|
|
1260
1261
|
type,
|
|
1261
1262
|
autocomplete: property.autocomplete,
|
|
@@ -1269,6 +1270,7 @@ class DynamicFormSchemaService {
|
|
|
1269
1270
|
indeterminate: property.indeterminate,
|
|
1270
1271
|
suffix: property.suffix
|
|
1271
1272
|
}, parent, options);
|
|
1273
|
+
return input;
|
|
1272
1274
|
}
|
|
1273
1275
|
getFormTextareaConfig(property, options, parent) {
|
|
1274
1276
|
return this.builder.createFormInput(property.id, {
|