@messaia/cdk 13.0.0-rc05 → 13.0.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.
@@ -2406,11 +2406,6 @@ class GenericFormBaseComponent extends BaseComponent {
2406
2406
  this.panelId = null;
2407
2407
  this.listRoute = this.addSaveAndCloseRoute;
2408
2408
  }
2409
- /**
2410
- * Gets form value
2411
- */
2412
- get formValue() { return this.item; }
2413
- ;
2414
2409
  /**
2415
2410
  * Called after the constructor, initializing input properties,
2416
2411
  * and the first call to ngOnChanges.
@@ -2537,7 +2532,7 @@ class GenericFormBaseComponent extends BaseComponent {
2537
2532
  /* Send the data to the server */
2538
2533
  this.create().subscribe({
2539
2534
  next: (response) => {
2540
- this.id = response.id;
2535
+ this.id = response?.id;
2541
2536
  this.onAfterSubmit(action, response);
2542
2537
  if (form) {
2543
2538
  Object.keys(form.controls).forEach(key => {
@@ -2597,15 +2592,7 @@ class GenericFormBaseComponent extends BaseComponent {
2597
2592
  isFormValid(form = null) {
2598
2593
  /* Print some debug information */
2599
2594
  if (this.debug) {
2600
- console.log('Form:', form);
2601
- Object.keys(form.controls).forEach(key => {
2602
- const controlErrors = form.controls[key].errors;
2603
- if (controlErrors != null) {
2604
- Object.keys(controlErrors).forEach(keyError => {
2605
- console.log('Key control: ' + key + ', keyError: ' + keyError + ', err value: ', controlErrors[keyError]);
2606
- });
2607
- }
2608
- });
2595
+ this.debugForm(form);
2609
2596
  }
2610
2597
  /* If the form ist not valid.. */
2611
2598
  if (!form.valid) {
@@ -2675,6 +2662,21 @@ class GenericFormBaseComponent extends BaseComponent {
2675
2662
  control.markAsTouched();
2676
2663
  }
2677
2664
  }
2665
+ /**
2666
+ * Shows form errors
2667
+ * @param form
2668
+ */
2669
+ debugForm(form = null) {
2670
+ console.log('Form:', form);
2671
+ Object.keys(form.controls).forEach(key => {
2672
+ const controlErrors = form.controls[key].errors;
2673
+ if (controlErrors != null) {
2674
+ Object.keys(controlErrors).forEach(keyError => {
2675
+ console.log('Key control: ' + key + ', keyError: ' + keyError + ', err value: ', controlErrors[keyError]);
2676
+ });
2677
+ }
2678
+ });
2679
+ }
2678
2680
  /**
2679
2681
  * Loads the previous URL in the history list.
2680
2682
  * @param action
@@ -2714,13 +2716,17 @@ class GenericFormBaseComponent extends BaseComponent {
2714
2716
  }
2715
2717
  /**
2716
2718
  * Creates the entity
2719
+ * @param httpOptions
2720
+ * @returns
2717
2721
  */
2718
2722
  create(httpOptions) {
2719
2723
  this.onBeforeCreate();
2720
2724
  return this.service.create(this.formValue, null, Object.assign(httpOptions || {}, { headers: this.toHttpHeaders({ 'Show-Message': 'yes' }) }), false);
2721
2725
  }
2722
2726
  /**
2723
- * updates the entity
2727
+ * Updates the entity
2728
+ * @param httpOptions
2729
+ * @returns
2724
2730
  */
2725
2731
  update(httpOptions) {
2726
2732
  this.onBeforeUpdate();
@@ -2871,6 +2877,11 @@ class GenericFormComponent extends GenericFormBaseComponent {
2871
2877
  this.changeDetectorRef = changeDetectorRef;
2872
2878
  this.listRoute = this.addSaveAndCloseRoute;
2873
2879
  }
2880
+ /**
2881
+ * Gets form value
2882
+ */
2883
+ get formValue() { return this.item; }
2884
+ ;
2874
2885
  }
2875
2886
  /** @nocollapse */ /** @nocollapse */ GenericFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: GenericFormComponent, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
2876
2887
  /** @nocollapse */ /** @nocollapse */ GenericFormComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: GenericFormComponent, usesInheritance: true, ngImport: i0 });
@@ -11390,6 +11401,14 @@ class GenericReactiveFormComponent extends GenericFormBaseComponent {
11390
11401
  this.form = this.formBuilder.formGroup(this.item, this.formBuilderConfig);
11391
11402
  this.onAfterFormBuild();
11392
11403
  }
11404
+ /**
11405
+ * Shows form errors
11406
+ * @param form
11407
+ */
11408
+ debugForm(form = null) {
11409
+ super.debugForm(form);
11410
+ console.log(this.form.getErrorSummary(false));
11411
+ }
11393
11412
  }
11394
11413
  /** @nocollapse */ /** @nocollapse */ GenericReactiveFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: GenericReactiveFormComponent, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
11395
11414
  /** @nocollapse */ /** @nocollapse */ GenericReactiveFormComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.3", type: GenericReactiveFormComponent, usesInheritance: true, ngImport: i0 });