@stemy/ngx-dynamic-form 19.9.29 → 19.9.31

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.
@@ -459,11 +459,11 @@ function enumValidation($enum) {
459
459
  }, "enum");
460
460
  }
461
461
  function setFieldMinDate(field, min, setValue = true) {
462
- setFieldDefault(field, min);
463
462
  setFieldProp(field, "min", min);
464
463
  addFieldValidators(field, [minValueValidation()]);
465
464
  if (!setValue)
466
465
  return;
466
+ setFieldDefault(field, min);
467
467
  setFieldValue(field, min);
468
468
  }
469
469
 
@@ -679,7 +679,7 @@ class DynamicFormBuilderService {
679
679
  id,
680
680
  parent,
681
681
  schemas: new Set(),
682
- discriminator: parent.discriminator,
682
+ discriminator: parent?.discriminator,
683
683
  fieldGroup: fields,
684
684
  wrappers: ["form-fieldset"],
685
685
  props: {
@@ -830,11 +830,15 @@ class DynamicFormBuilderService {
830
830
  data.multiple = true;
831
831
  console.warn(`File upload property "multi" is deprecated. Use "multiple" instead.`);
832
832
  }
833
+ const baseUrl = data.url?.startsWith("http") ? data.url : this.api.url(data.url || "assets");
833
834
  return this.createFormField(key, "upload", data, {
834
835
  inline: data.inline === true,
835
836
  multiple: data.multiple === true,
836
837
  accept: data.accept || [".png", ".jpg"],
837
- url: data.url?.startsWith("http") ? data.url : this.api.url(data.url || "assets"),
838
+ url: baseUrl,
839
+ uploadUrl: data.url?.startsWith("http")
840
+ ? data.uploadUrl
841
+ : (data.uploadUrl ? this.api.url(data.uploadUrl || "assets") : baseUrl),
838
842
  maxSize: isNaN(data.maxSize) ? MAX_INPUT_NUM : data.maxSize,
839
843
  uploadOptions: data.uploadOptions || {},
840
844
  createUploadData: data.createUploadData
@@ -2301,11 +2305,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImpo
2301
2305
 
2302
2306
  class DynamicFormUploadComponent extends DynamicFieldType {
2303
2307
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormUploadComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2304
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: DynamicFormUploadComponent, isStandalone: false, selector: "dynamic-form-upload", usesInheritance: true, ngImport: i0, template: "<upload [formControl]=\"formControl\"\n [multiple]=\"props.multiple\"\n [inline]=\"props.inline\"\n [accept]=\"props.accept\"\n [baseUrl]=\"props.url\"\n [makeUpload]=\"props.createUploadData\"\n [formlyAttributes]=\"field\">\n</upload>\n", dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.UploadComponent, selector: "upload", inputs: ["value", "disabled", "inline", "accept", "baseUrl", "message", "multiple", "buttonText", "makeUpload", "preProcess"], outputs: ["onUploaded", "onRemove"] }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
2308
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: DynamicFormUploadComponent, isStandalone: false, selector: "dynamic-form-upload", usesInheritance: true, ngImport: i0, template: "<upload [formControl]=\"formControl\"\n [multiple]=\"props.multiple\"\n [inline]=\"props.inline\"\n [accept]=\"props.accept\"\n [baseUrl]=\"props.url\"\n [uploadUrl]=\"props.uploadUrl\"\n [makeUpload]=\"props.createUploadData\"\n [formlyAttributes]=\"field\">\n</upload>\n", dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.UploadComponent, selector: "upload", inputs: ["value", "disabled", "inline", "accept", "baseUrl", "uploadUrl", "message", "multiple", "buttonText", "makeUpload", "preProcess"], outputs: ["onUploaded", "onRemove"] }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
2305
2309
  }
2306
2310
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormUploadComponent, decorators: [{
2307
2311
  type: Component,
2308
- args: [{ standalone: false, selector: "dynamic-form-upload", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<upload [formControl]=\"formControl\"\n [multiple]=\"props.multiple\"\n [inline]=\"props.inline\"\n [accept]=\"props.accept\"\n [baseUrl]=\"props.url\"\n [makeUpload]=\"props.createUploadData\"\n [formlyAttributes]=\"field\">\n</upload>\n" }]
2312
+ args: [{ standalone: false, selector: "dynamic-form-upload", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<upload [formControl]=\"formControl\"\n [multiple]=\"props.multiple\"\n [inline]=\"props.inline\"\n [accept]=\"props.accept\"\n [baseUrl]=\"props.url\"\n [uploadUrl]=\"props.uploadUrl\"\n [makeUpload]=\"props.createUploadData\"\n [formlyAttributes]=\"field\">\n</upload>\n" }]
2309
2313
  }] });
2310
2314
 
2311
2315
  class DynamicFormWysiwygComponent extends DynamicFieldType {