@smartbit4all/ng-client 1.1.36 → 1.1.37

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.
@@ -4617,6 +4617,8 @@ let SmartComponentApiClient = class SmartComponentApiClient {
4617
4617
  this.pageName = pageName;
4618
4618
  this._destroy$ = new Subject();
4619
4619
  this.sendDataChanges = false;
4620
+ this._useAutoSubmit = false;
4621
+ this._useAutoSubmitTurnedOff = new SmartSubject(this._destroy$);
4620
4622
  this.detectChange = new SmartSubject(this._destroy$);
4621
4623
  this.uiActionModels = [];
4622
4624
  this.dataChanged = new SmartSubject(this._destroy$);
@@ -4633,6 +4635,27 @@ let SmartComponentApiClient = class SmartComponentApiClient {
4633
4635
  this.uiActionService = inject.get(UiActionService);
4634
4636
  this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
4635
4637
  }
4638
+ get useAutoSubmit() {
4639
+ return this._useAutoSubmit;
4640
+ }
4641
+ set useAutoSubmit(useAutoSubmit) {
4642
+ this._useAutoSubmit = useAutoSubmit;
4643
+ if (this._useAutoSubmit) {
4644
+ this.subscribeToAutoSubmit();
4645
+ this.reSubscribeToChange.pipe(takeUntil(this._useAutoSubmitTurnedOff)).subscribe(() => {
4646
+ this.subscribeToAutoSubmit();
4647
+ });
4648
+ }
4649
+ else {
4650
+ this._useAutoSubmitTurnedOff.next();
4651
+ }
4652
+ }
4653
+ subscribeToAutoSubmit() {
4654
+ this.submit.pipe(takeUntil(this._useAutoSubmitTurnedOff)).subscribe(() => {
4655
+ this.submitForms();
4656
+ this.submit.complete();
4657
+ });
4658
+ }
4636
4659
  get uuid() {
4637
4660
  return this._uuid;
4638
4661
  }
@@ -4763,6 +4786,14 @@ let SmartComponentApiClient = class SmartComponentApiClient {
4763
4786
  layout.components = layout.components?.map((l) => this.setParentComponent(l));
4764
4787
  return layout;
4765
4788
  }
4789
+ /**
4790
+ * Submits all the registered forms in the SmartComponent
4791
+ */
4792
+ submitForms() {
4793
+ Object.keys(this.formWidgets.widgets).map((key) => {
4794
+ this.formWidgets.widgets.get(key)?.submitForm();
4795
+ });
4796
+ }
4766
4797
  addGrid(smartGrid, options, useAsDefaultGrid, componentReference) {
4767
4798
  smartGrid.options = options;
4768
4799
  smartGrid.uiActionService = this.uiActionService;