@nettyapps/ntybase 0.0.6 → 0.0.7

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.
@@ -1839,6 +1839,26 @@ class AgGridSaveBase {
1839
1839
  this.commonService.goBack();
1840
1840
  }
1841
1841
  }
1842
+ validateSaveRecord(recordGUID) {
1843
+ if (this.saveForm && this.saveForm.invalid) {
1844
+ Object.keys(this.saveForm.controls).forEach((key) => {
1845
+ const control = this.saveForm.controls[key];
1846
+ control.markAsTouched();
1847
+ control.markAsDirty();
1848
+ });
1849
+ this.alertService.showError('@PleaseFillRequiredFields');
1850
+ return false;
1851
+ }
1852
+ // First check if there are any visual form changes
1853
+ if (!this.formChanged && recordGUID) {
1854
+ this.alertService.showAlert('@NoChangesDetected');
1855
+ if (this.closeAfterSave()) {
1856
+ this.closeSidenav();
1857
+ }
1858
+ return false;
1859
+ }
1860
+ return true;
1861
+ }
1842
1862
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: AgGridSaveBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
1843
1863
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: AgGridSaveBase, isStandalone: true, selector: "ntybase-ag-grid-save-base", inputs: { parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, embedded: { classPropertyName: "embedded", publicName: "embedded", isSignal: true, isRequired: false, transformFunction: null }, closeAfterSave: { classPropertyName: "closeAfterSave", publicName: "closeAfterSave", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeAfterSave: "closeAfterSaveChange" }, viewQueries: [{ propertyName: "saveForm", first: true, predicate: ["saveForm"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<p>ag-grid-save-base works!</p>\n", styles: [""] });
1844
1864
  }