@smartbit4all/ng-client 1.1.35 → 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.
@@ -4488,6 +4488,11 @@ class SmartComponentLayoutComponent {
4488
4488
  if (this.smartComponentLayout?.type === ComponentType.Form) {
4489
4489
  this.constructForm();
4490
4490
  }
4491
+ else if (this.smartComponentLayout?.type === ComponentType.Widget) {
4492
+ if (this.smartComponentLayout.widget?.type === ComponentWidgetType.Grid) {
4493
+ this.constructGrid();
4494
+ }
4495
+ }
4491
4496
  }
4492
4497
  type() {
4493
4498
  return ComponentType;
@@ -4612,6 +4617,8 @@ let SmartComponentApiClient = class SmartComponentApiClient {
4612
4617
  this.pageName = pageName;
4613
4618
  this._destroy$ = new Subject();
4614
4619
  this.sendDataChanges = false;
4620
+ this._useAutoSubmit = false;
4621
+ this._useAutoSubmitTurnedOff = new SmartSubject(this._destroy$);
4615
4622
  this.detectChange = new SmartSubject(this._destroy$);
4616
4623
  this.uiActionModels = [];
4617
4624
  this.dataChanged = new SmartSubject(this._destroy$);
@@ -4628,6 +4635,27 @@ let SmartComponentApiClient = class SmartComponentApiClient {
4628
4635
  this.uiActionService = inject.get(UiActionService);
4629
4636
  this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
4630
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
+ }
4631
4659
  get uuid() {
4632
4660
  return this._uuid;
4633
4661
  }
@@ -4758,6 +4786,14 @@ let SmartComponentApiClient = class SmartComponentApiClient {
4758
4786
  layout.components = layout.components?.map((l) => this.setParentComponent(l));
4759
4787
  return layout;
4760
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
+ }
4761
4797
  addGrid(smartGrid, options, useAsDefaultGrid, componentReference) {
4762
4798
  smartGrid.options = options;
4763
4799
  smartGrid.uiActionService = this.uiActionService;