@stemy/ngx-dynamic-form 13.2.0 → 13.2.2

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.
@@ -203,64 +203,64 @@ class DynamicSelectModel extends DynamicSelectModel$1 {
203
203
  }
204
204
 
205
205
  function createFormConfig(id, config) {
206
- config = config || { id };
207
- config.id = id;
208
- config.label = ObjectUtils.isNullOrUndefined(config.label) ? id : config.label;
209
- config.disabled = config.disabled || false;
210
- config.hidden = config.hidden || false;
211
- return config;
206
+ const res = (config || { id });
207
+ res.id = id;
208
+ res.label = ObjectUtils.isNullOrUndefined(config.label) ? id : config.label;
209
+ res.disabled = config.disabled || false;
210
+ res.hidden = config.hidden || false;
211
+ return res;
212
212
  }
213
213
  function createFormCheckbox(id, config, layout) {
214
- config = createFormConfig(id, config);
215
- config.indeterminate = config.indeterminate || false;
216
- return new DynamicCheckboxModel(config, layout);
214
+ const res = createFormConfig(id, config);
215
+ res.indeterminate = config.indeterminate || false;
216
+ return new DynamicCheckboxModel(res, layout);
217
217
  }
218
218
  function createFormDate(id, config, layout) {
219
- config = createFormConfig(id, config);
220
- config.autoFocus = config.autoFocus || false;
221
- config.focusedDate = config.focusedDate || new Date();
222
- config.inline = config.inline || false;
223
- return new DynamicDatePickerModel(config, layout);
219
+ const res = createFormConfig(id, config);
220
+ res.autoFocus = config.autoFocus || false;
221
+ res.focusedDate = config.focusedDate || new Date();
222
+ res.inline = config.inline || false;
223
+ return new DynamicDatePickerModel(res, layout);
224
224
  }
225
225
  function createFormEditor(id, config, layout) {
226
- config = createFormConfig(id, config);
227
- return new DynamicEditorModel(config, layout);
226
+ const res = createFormConfig(id, config);
227
+ return new DynamicEditorModel(res, layout);
228
228
  }
229
229
  function createFormArray(id, config, layout) {
230
- config = createFormConfig(id, config);
231
- return new DynamicFormArrayModel(config, layout);
230
+ const res = createFormConfig(id, config);
231
+ return new DynamicFormArrayModel(res, layout);
232
232
  }
233
233
  function createFormGroup(id, config, layout) {
234
- config = createFormConfig(id, config);
235
- config.name = config.name || "";
236
- return new DynamicFormGroupModel(config, layout);
234
+ const res = createFormConfig(id, config);
235
+ res.name = config.name || "";
236
+ return new DynamicFormGroupModel(res, layout);
237
237
  }
238
238
  function createFormInput(id, config, type = "text", layout) {
239
- config = createFormConfig(id, config);
240
- config.inputType = config.inputType || type;
241
- config.placeholder = config.placeholder || (config.inputType == "mask" ? "_" : "");
242
- config.step = config.step || 1;
243
- config.mask = config.mask || null;
244
- return new DynamicInputModel(config, layout);
239
+ const res = createFormConfig(id, config);
240
+ res.inputType = config.inputType || type;
241
+ res.placeholder = config.placeholder || (config.inputType == "mask" ? "_" : "");
242
+ res.step = config.step || 1;
243
+ res.mask = config.mask || null;
244
+ return new DynamicInputModel(res, layout);
245
245
  }
246
246
  function createFormSelect(id, config, layout) {
247
- config = createFormConfig(id, config);
248
- config.options = config.options || [];
249
- return new DynamicSelectModel(config, layout);
247
+ const res = createFormConfig(id, config);
248
+ res.options = config.options || [];
249
+ return new DynamicSelectModel(res, layout);
250
250
  }
251
251
  function createFormTextarea(id, config, layout) {
252
- config = createFormConfig(id, config);
253
- config.cols = config.cols || 10;
254
- config.rows = config.rows || 3;
255
- config.wrap = config.wrap || "soft";
256
- return new DynamicTextAreaModel(config, layout);
252
+ const res = createFormConfig(id, config);
253
+ res.cols = config.cols || 10;
254
+ res.rows = config.rows || 3;
255
+ res.wrap = config.wrap || "soft";
256
+ return new DynamicTextAreaModel(res, layout);
257
257
  }
258
258
  function createFormFile(id, config, layout) {
259
- config = createFormConfig(id, config);
260
- config.accept = config.accept || ["jpg", "jpeg", "png"];
261
- config.multiple = config.multiple || false;
262
- config.url = ObjectUtils.isString(config.url) ? config.url : "assets";
263
- return new DynamicFileUploadModel(config, layout);
259
+ const res = createFormConfig(id, config);
260
+ res.accept = config.accept || ["jpg", "jpeg", "png"];
261
+ res.multiple = config.multiple || false;
262
+ res.url = ObjectUtils.isString(config.url) ? config.url : "assets";
263
+ return new DynamicFileUploadModel(res, layout);
264
264
  }
265
265
 
266
266
  function isStringWithVal(val) {
@@ -722,6 +722,9 @@ class DynamicFormService extends DynamicFormService$1 {
722
722
  getFormInputConfig(property, schema) {
723
723
  let inputType = StringUtils.has(property.id, "password", "Password") ? "password" : (property.format || property.items?.type || property.type);
724
724
  switch (inputType) {
725
+ case "string":
726
+ inputType = "text";
727
+ break;
725
728
  case "boolean":
726
729
  inputType = "checkbox";
727
730
  break;