@smartbit4all/ng-client 1.0.7 → 1.0.10

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.
Files changed (50) hide show
  1. package/esm2020/lib/smart-client/smart-component-api-client.mjs +28 -10
  2. package/esm2020/lib/view-context/api/model/componentModel.mjs +1 -12
  3. package/esm2020/lib/view-context/api/model/models.mjs +2 -1
  4. package/esm2020/lib/view-context/api/model/uiActionRequest.mjs +1 -1
  5. package/esm2020/lib/view-context/api/model/valueSet.mjs +2 -0
  6. package/esm2020/lib/view-context/api/model/view.mjs +1 -1
  7. package/esm2020/lib/view-context/property-definition-data.mjs +2 -0
  8. package/esm2020/lib/view-context/value-api/api/api.mjs +4 -0
  9. package/esm2020/lib/view-context/value-api/api/value.service.mjs +138 -0
  10. package/esm2020/lib/view-context/value-api/api.module.mjs +8 -8
  11. package/esm2020/lib/view-context/value-api/configuration.mjs +2 -2
  12. package/esm2020/lib/view-context/value-api/encoder.mjs +19 -0
  13. package/esm2020/lib/view-context/value-api/index.mjs +7 -6
  14. package/esm2020/lib/view-context/value-api/model/models.mjs +9 -2
  15. package/esm2020/lib/view-context/value-api/model/value.mjs +13 -0
  16. package/esm2020/lib/view-context/value-api/model/valueSetData.mjs +1 -1
  17. package/esm2020/lib/view-context/value-api/model/valueSetDefinition.mjs +2 -0
  18. package/esm2020/lib/view-context/value-api/model/valueSetDefinitionData.mjs +2 -0
  19. package/esm2020/lib/view-context/value-api/model/valueSetDefinitionKind.mjs +23 -0
  20. package/esm2020/lib/view-context/value-api/model/valueSetExpression.mjs +2 -0
  21. package/esm2020/lib/view-context/value-api/model/valueSetOperand.mjs +2 -0
  22. package/esm2020/lib/view-context/value-api/model/valueSetOperation.mjs +18 -0
  23. package/fesm2015/smartbit4all-ng-client.mjs +29 -9
  24. package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
  25. package/fesm2020/smartbit4all-ng-client.mjs +27 -21
  26. package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
  27. package/lib/smart-client/smart-component-api-client.d.ts +6 -2
  28. package/lib/view-context/api/model/componentModel.d.ts +7 -3
  29. package/lib/view-context/api/model/models.d.ts +1 -0
  30. package/lib/view-context/api/model/uiActionRequest.d.ts +1 -0
  31. package/lib/view-context/api/model/valueSet.d.ts +20 -0
  32. package/lib/view-context/api/model/view.d.ts +4 -0
  33. package/lib/view-context/property-definition-data.d.ts +5 -0
  34. package/lib/view-context/value-api/api/api.d.ts +3 -0
  35. package/lib/view-context/value-api/api/value.service.d.ts +35 -0
  36. package/lib/view-context/value-api/api.module.d.ts +3 -3
  37. package/lib/view-context/value-api/encoder.d.ts +11 -0
  38. package/lib/view-context/value-api/index.d.ts +6 -5
  39. package/lib/view-context/value-api/model/models.d.ts +8 -1
  40. package/lib/view-context/value-api/model/value.d.ts +29 -0
  41. package/lib/view-context/value-api/model/valueSetData.d.ts +4 -2
  42. package/lib/view-context/value-api/model/valueSetDefinition.d.ts +16 -0
  43. package/lib/view-context/value-api/model/valueSetDefinitionData.d.ts +55 -0
  44. package/lib/view-context/value-api/model/valueSetDefinitionKind.d.ts +23 -0
  45. package/lib/view-context/value-api/model/valueSetExpression.d.ts +20 -0
  46. package/lib/view-context/value-api/model/valueSetOperand.d.ts +25 -0
  47. package/lib/view-context/value-api/model/valueSetOperation.d.ts +18 -0
  48. package/package.json +1 -1
  49. package/smartbit4all-ng-client-1.0.10.tgz +0 -0
  50. package/smartbit4all-ng-client-1.0.7.tgz +0 -0
@@ -1592,18 +1592,6 @@ const CloseResult = {
1592
1592
  * Do not edit the class manually.
1593
1593
  */
1594
1594
 
1595
- /**
1596
- * View API
1597
- * View API
1598
- *
1599
- * The version of the OpenAPI document: 1.0.0
1600
- * Contact: info@it4all.hu
1601
- *
1602
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1603
- * https://openapi-generator.tech
1604
- * Do not edit the class manually.
1605
- */
1606
-
1607
1595
  /**
1608
1596
  * View API
1609
1597
  * View API
@@ -3630,12 +3618,14 @@ let SmartComponentApiClient = class SmartComponentApiClient {
3630
3618
  this.pageName = pageName;
3631
3619
  this._destroy$ = new Subject();
3632
3620
  this.detectChange = new SmartSubject(this._destroy$);
3633
- this.modelChanged = new SmartSubject(this._destroy$);
3621
+ this.uiActionModels = [];
3622
+ this.dataChanged = new SmartSubject(this._destroy$);
3634
3623
  // UseUiAction
3635
3624
  this.submit = new SmartSubject(this._destroy$);
3636
3625
  this.reSubscribeToChange = new SmartSubject(this._destroy$);
3637
- this.detectChange.subscribe((data) => {
3638
- this.data = data;
3626
+ this.detectChange.subscribe((model) => {
3627
+ this.model = model;
3628
+ this.data = model.data;
3639
3629
  });
3640
3630
  }
3641
3631
  get uuid() {
@@ -3650,16 +3640,14 @@ let SmartComponentApiClient = class SmartComponentApiClient {
3650
3640
  }
3651
3641
  set model(model) {
3652
3642
  this._model = model;
3653
- if (model?.data) {
3654
- this.data = model?.data;
3655
- }
3643
+ this.initComponentByModel();
3656
3644
  }
3657
3645
  get data() {
3658
3646
  return this._data;
3659
3647
  }
3660
3648
  set data(model) {
3661
3649
  this._data = model;
3662
- this.modelChanged.next();
3650
+ this.dataChanged.next();
3663
3651
  }
3664
3652
  _ngOnInit() {
3665
3653
  this.run();
@@ -3669,6 +3657,26 @@ let SmartComponentApiClient = class SmartComponentApiClient {
3669
3657
  this._destroy$.next();
3670
3658
  this._destroy$.complete();
3671
3659
  }
3660
+ initComponentByModel() {
3661
+ this.initData();
3662
+ this.initActions();
3663
+ // TODO: layout, valueSet, widgets
3664
+ }
3665
+ initData() {
3666
+ if (this.model?.data) {
3667
+ this.data = this.model?.data;
3668
+ }
3669
+ }
3670
+ initActions() {
3671
+ if (this.model?.actions) {
3672
+ this.uiActionModels = this.model?.actions.map((uiAction) => {
3673
+ return {
3674
+ serviceToUse: this,
3675
+ uiAction,
3676
+ };
3677
+ });
3678
+ }
3679
+ }
3672
3680
  run() {
3673
3681
  if (this.auth.bffApisHaveBeenSetUp) {
3674
3682
  this.load();
@@ -3688,14 +3696,12 @@ let SmartComponentApiClient = class SmartComponentApiClient {
3688
3696
  getModel() {
3689
3697
  return this.data;
3690
3698
  }
3691
- // this should not be abstract
3692
3699
  async performUiActionRequest(uiActionRequest) {
3693
3700
  await this.viewContext.performAction(this.uuid, uiActionRequest);
3694
3701
  }
3695
3702
  handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
3696
3703
  throw new Error("handleSpecificDemandsAsynchronously method not implemented.");
3697
3704
  }
3698
- // this should not be abstract
3699
3705
  async load() {
3700
3706
  this.uuid = this.viewContext.getUuidOfPage(this.pageName);
3701
3707
  this.model = await this.viewContext.load(this.uuid);