@smartbit4all/ng-client 3.1.86 → 3.1.88

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.
@@ -12154,10 +12154,10 @@ class SmartComponentLayoutComponent {
12154
12154
  }
12155
12155
  }
12156
12156
  SmartComponentLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutComponent, deps: [{ token: SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
12157
- SmartComponentLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: { smartComponentLayout: "smartComponentLayout" }, viewQueries: [{ propertyName: "smartFormList", predicate: ["form"], descendants: true }, { propertyName: "smartGridList", predicate: ["grid"], descendants: true }, { propertyName: "smartFilterList", predicate: ["filter"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"smartComponentLayout?.expandable; then expandable; else normal\"> </div>\r\n\r\n<ng-template #expandable>\r\n <smart-expandable-section\r\n *ngIf=\"expandableSection\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n</ng-template>\r\n\r\n<ng-template #normal>\r\n <div\r\n *ngIf=\"smartComponentLayout?.type === type().Container\"\r\n [ngClass]=\"smartComponentLayout?.direction ?? 'vertical'\"\r\n >\r\n <smart-component-layout\r\n [smartComponentLayout]=\"layout\"\r\n *ngFor=\"let layout of smartComponentLayout?.components\"\r\n ></smart-component-layout>\r\n </div>\r\n <smartform #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid #grid [smartGrid]=\"smartGrid\" [uuid]=\"uuid!\"></smart-grid>\r\n <!-- <smart-filter #filter [filter]=\"smartFilter\"></smart-filter> -->\r\n <smart-tree *ngIf=\"treeService\" [treeService]=\"treeService!\"></smart-tree>\r\n</ng-template>\r\n", styles: [".horizontal{display:flex;flex-direction:row}.vertical{display:flex;flex-direction:column}\n"], components: [{ type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }, { type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: ["smartComponentLayout"] }, { type: SmartformComponent, selector: "smartform", inputs: ["smartForm"] }, { type: SmartGridComponent, selector: "smart-grid", inputs: ["smartGrid", "uuid", "dev"] }, { type: SmartTreeComponent, selector: "smart-tree", inputs: ["treeStyle", "treeService"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
12157
+ SmartComponentLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: { smartComponentLayout: "smartComponentLayout" }, viewQueries: [{ propertyName: "smartFormList", predicate: ["form"], descendants: true }, { propertyName: "smartGridList", predicate: ["grid"], descendants: true }, { propertyName: "smartFilterList", predicate: ["filter"], descendants: true }, { propertyName: "components", predicate: SmartComponentLayoutComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"smartComponentLayout?.expandable; then expandable; else normal\"> </div>\r\n\r\n<ng-template #expandable>\r\n <smart-expandable-section\r\n *ngIf=\"expandableSection\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n</ng-template>\r\n\r\n<ng-template #normal>\r\n <div\r\n *ngIf=\"smartComponentLayout?.type === type().Container\"\r\n [ngClass]=\"smartComponentLayout?.direction ?? 'vertical'\"\r\n >\r\n <smart-component-layout\r\n *ngFor=\"let layout of smartComponentLayout?.components\"\r\n [smartComponentLayout]=\"layout\"\r\n ></smart-component-layout>\r\n </div>\r\n <smartform #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid #grid [smartGrid]=\"smartGrid\" [uuid]=\"uuid!\"></smart-grid>\r\n <!-- <smart-filter #filter [filter]=\"smartFilter\"></smart-filter> -->\r\n <smart-tree *ngIf=\"treeService\" [treeService]=\"treeService!\"></smart-tree>\r\n</ng-template>\r\n", styles: [".horizontal{display:flex;flex-direction:row}.vertical{display:flex;flex-direction:column}\n"], components: [{ type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }, { type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: ["smartComponentLayout"] }, { type: SmartformComponent, selector: "smartform", inputs: ["smartForm"] }, { type: SmartGridComponent, selector: "smart-grid", inputs: ["smartGrid", "uuid", "dev"] }, { type: SmartTreeComponent, selector: "smart-tree", inputs: ["treeStyle", "treeService"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
12158
12158
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutComponent, decorators: [{
12159
12159
  type: Component,
12160
- args: [{ selector: 'smart-component-layout', template: "<div *ngIf=\"smartComponentLayout?.expandable; then expandable; else normal\"> </div>\r\n\r\n<ng-template #expandable>\r\n <smart-expandable-section\r\n *ngIf=\"expandableSection\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n</ng-template>\r\n\r\n<ng-template #normal>\r\n <div\r\n *ngIf=\"smartComponentLayout?.type === type().Container\"\r\n [ngClass]=\"smartComponentLayout?.direction ?? 'vertical'\"\r\n >\r\n <smart-component-layout\r\n [smartComponentLayout]=\"layout\"\r\n *ngFor=\"let layout of smartComponentLayout?.components\"\r\n ></smart-component-layout>\r\n </div>\r\n <smartform #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid #grid [smartGrid]=\"smartGrid\" [uuid]=\"uuid!\"></smart-grid>\r\n <!-- <smart-filter #filter [filter]=\"smartFilter\"></smart-filter> -->\r\n <smart-tree *ngIf=\"treeService\" [treeService]=\"treeService!\"></smart-tree>\r\n</ng-template>\r\n", styles: [".horizontal{display:flex;flex-direction:row}.vertical{display:flex;flex-direction:column}\n"] }]
12160
+ args: [{ selector: 'smart-component-layout', template: "<div *ngIf=\"smartComponentLayout?.expandable; then expandable; else normal\"> </div>\r\n\r\n<ng-template #expandable>\r\n <smart-expandable-section\r\n *ngIf=\"expandableSection\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n</ng-template>\r\n\r\n<ng-template #normal>\r\n <div\r\n *ngIf=\"smartComponentLayout?.type === type().Container\"\r\n [ngClass]=\"smartComponentLayout?.direction ?? 'vertical'\"\r\n >\r\n <smart-component-layout\r\n *ngFor=\"let layout of smartComponentLayout?.components\"\r\n [smartComponentLayout]=\"layout\"\r\n ></smart-component-layout>\r\n </div>\r\n <smartform #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid #grid [smartGrid]=\"smartGrid\" [uuid]=\"uuid!\"></smart-grid>\r\n <!-- <smart-filter #filter [filter]=\"smartFilter\"></smart-filter> -->\r\n <smart-tree *ngIf=\"treeService\" [treeService]=\"treeService!\"></smart-tree>\r\n</ng-template>\r\n", styles: [".horizontal{display:flex;flex-direction:row}.vertical{display:flex;flex-direction:column}\n"] }]
12161
12161
  }], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }]; }, propDecorators: { smartComponentLayout: [{
12162
12162
  type: Input
12163
12163
  }], smartFormList: [{
@@ -12169,6 +12169,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
12169
12169
  }], smartFilterList: [{
12170
12170
  type: ViewChildren,
12171
12171
  args: ['filter']
12172
+ }], components: [{
12173
+ type: ViewChildren,
12174
+ args: [SmartComponentLayoutComponent]
12172
12175
  }] } });
12173
12176
 
12174
12177
  class SmartComponentLayoutModule {
@@ -13364,6 +13367,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
13364
13367
  * Public API Surface of smarttree
13365
13368
  */
13366
13369
 
13370
+ class SmartComponentLayoutUtility {
13371
+ static setParent(layout, parent) {
13372
+ layout.parentComponent = parent;
13373
+ layout.components?.forEach((l) => this.setParent(l, parent));
13374
+ }
13375
+ static getForms(comp) {
13376
+ let result = [];
13377
+ if (comp.components) {
13378
+ result = comp.components
13379
+ .map((c) => this.getForms(c))
13380
+ .reduce((acc, value) => acc.concat(value), []);
13381
+ }
13382
+ if (comp.smartFormComponent) {
13383
+ result.push(comp.smartFormComponent);
13384
+ }
13385
+ return result;
13386
+ }
13387
+ static getGrids(comp) {
13388
+ let result = [];
13389
+ if (comp.components) {
13390
+ result = comp.components
13391
+ .map((c) => this.getGrids(c))
13392
+ .reduce((acc, value) => acc.concat(value), []);
13393
+ }
13394
+ if (comp.smartGridComponent) {
13395
+ result.push(comp.smartGridComponent);
13396
+ }
13397
+ return result;
13398
+ }
13399
+ static getTrees(comp) {
13400
+ let result = [];
13401
+ if (comp.components) {
13402
+ result = comp.components
13403
+ ?.map((c) => this.getTrees(c))
13404
+ .reduce((acc, value) => acc.concat(value), []);
13405
+ }
13406
+ if (comp.treeService) {
13407
+ result.push(comp.treeService);
13408
+ }
13409
+ return result;
13410
+ }
13411
+ }
13412
+
13413
+ /*
13414
+ * Public API Surface of smart-component-layout
13415
+ */
13416
+
13367
13417
  let SmartComponentApiClient = class SmartComponentApiClient {
13368
13418
  constructor(inject, auth, pageName) {
13369
13419
  this.inject = inject;
@@ -13450,19 +13500,34 @@ let SmartComponentApiClient = class SmartComponentApiClient {
13450
13500
  this._destroy$.next();
13451
13501
  this._destroy$.complete();
13452
13502
  }
13503
+ _ngAfterViewInit() {
13504
+ if (!this.getSmartComponentLayoutsQL()) {
13505
+ console.warn('SmartComponentLayoutsQL not available!');
13506
+ return;
13507
+ }
13508
+ // TODO maybe we should set comp.parent, not comp.smartComponentLayout.parentComponent..
13509
+ this.getSmartComponentLayoutsQL().forEach((comp) => {
13510
+ if (comp.smartComponentLayout) {
13511
+ SmartComponentLayoutUtility.setParent(comp.smartComponentLayout, this);
13512
+ }
13513
+ });
13514
+ this.getSmartComponentLayoutsQL()
13515
+ .changes.pipe(takeUntil(this._destroy$))
13516
+ .subscribe((list) => list.forEach((comp) => {
13517
+ if (comp.smartComponentLayout) {
13518
+ SmartComponentLayoutUtility.setParent(comp.smartComponentLayout, this);
13519
+ }
13520
+ }));
13521
+ }
13453
13522
  getWidgets() {
13454
13523
  if (this.useQueryLists) {
13455
13524
  let widgets = new WidgetMap();
13456
- if (this.getAllGridComponents()) {
13457
- this.getAllGridComponents()
13458
- .filter((grid) => (grid?.smartGrid?.gridIdentifier ? true : false))
13459
- .forEach((grid) => widgets.addWidget(grid.smartGrid.gridIdentifier, grid));
13460
- }
13461
- if (this.getAllTreeComponents()) {
13462
- this.getAllTreeComponents()
13463
- .filter((tree) => (tree?.smartTreeModel?.identifier ? true : false))
13464
- .forEach((tree) => widgets.addWidget(tree.smartTreeModel.identifier, tree));
13465
- }
13525
+ this.getAllSmartGridComponents()
13526
+ .filter((grid) => (grid?.smartGrid?.gridIdentifier ? true : false))
13527
+ .forEach((grid) => widgets.addWidget(grid.smartGrid.gridIdentifier, grid));
13528
+ this.getAllSmartTreeComponents()
13529
+ .filter((tree) => (tree?.smartTreeModel?.identifier ? true : false))
13530
+ .forEach((tree) => widgets.addWidget(tree.smartTreeModel.identifier, tree));
13466
13531
  return widgets;
13467
13532
  }
13468
13533
  return this.widgets;
@@ -13471,14 +13536,36 @@ let SmartComponentApiClient = class SmartComponentApiClient {
13471
13536
  this.initData();
13472
13537
  this.initActions();
13473
13538
  if (this.useQueryLists) {
13474
- this.getAllFormComponents()?.forEach((form) => {
13539
+ this.getAllSmartFormComponents()?.forEach((form) => {
13475
13540
  if (form.smartForm) {
13476
13541
  form.smartForm.componentModel = this.model;
13542
+ // uses data, valueSets, constraints
13477
13543
  form.constructForm();
13478
13544
  }
13479
13545
  });
13480
13546
  }
13481
- // TODO: layout, valueSet, widgets
13547
+ // TODO: layout, widgets
13548
+ }
13549
+ getAllSmartFormComponents() {
13550
+ let forms = this.getSmartFormsQL()?.toArray() ?? [];
13551
+ this.getSmartComponentLayoutsQL()?.forEach((comp) => {
13552
+ forms.push(...SmartComponentLayoutUtility.getForms(comp));
13553
+ });
13554
+ return forms;
13555
+ }
13556
+ getAllSmartGridComponents() {
13557
+ let grids = this.getSmartGridsQL()?.toArray() ?? [];
13558
+ this.getSmartComponentLayoutsQL()?.forEach((comp) => {
13559
+ grids.push(...SmartComponentLayoutUtility.getGrids(comp));
13560
+ });
13561
+ return grids;
13562
+ }
13563
+ getAllSmartTreeComponents() {
13564
+ let trees = this.getSmartTreesQL()?.toArray() ?? [];
13565
+ this.getSmartComponentLayoutsQL()?.forEach((comp) => {
13566
+ trees.push(...SmartComponentLayoutUtility.getTrees(comp));
13567
+ });
13568
+ return trees;
13482
13569
  }
13483
13570
  initData() {
13484
13571
  if (this.model?.data) {
@@ -13523,7 +13610,7 @@ let SmartComponentApiClient = class SmartComponentApiClient {
13523
13610
  invalidFieldNames: [],
13524
13611
  };
13525
13612
  if (this.useQueryLists) {
13526
- this.getAllFormComponents()?.forEach((form) => this.validateForm(form, aggregatedInvalidFields));
13613
+ this.getAllSmartFormComponents()?.forEach((form) => this.validateForm(form, aggregatedInvalidFields));
13527
13614
  }
13528
13615
  else {
13529
13616
  this.formWidgets?.widgets?.forEach((form) => this.validateForm(form, aggregatedInvalidFields));
@@ -13596,7 +13683,7 @@ let SmartComponentApiClient = class SmartComponentApiClient {
13596
13683
  */
13597
13684
  submitForms(validate) {
13598
13685
  if (this.useQueryLists) {
13599
- this.getAllFormComponents()?.forEach((form) => {
13686
+ this.getAllSmartFormComponents()?.forEach((form) => {
13600
13687
  form?.submitForm(validate);
13601
13688
  });
13602
13689
  }
@@ -13769,7 +13856,7 @@ let SmartComponentApiClient = class SmartComponentApiClient {
13769
13856
  handleDataChange(changes, changeKey) {
13770
13857
  this.setValueDeeply(this.model, changeKey, changes[changeKey]);
13771
13858
  if (this.useQueryLists) {
13772
- this.getAllFormComponents()?.forEach((form) => form.refresh());
13859
+ this.getAllSmartFormComponents()?.forEach((form) => form.refresh());
13773
13860
  }
13774
13861
  else {
13775
13862
  this.formWidgets.widgets.forEach((formComponent, key) => {
@@ -13840,18 +13927,24 @@ class SmartComponent extends SmartComponentApiClient {
13840
13927
  ngOnDestroy() {
13841
13928
  this._ngOnDestroy();
13842
13929
  }
13843
- getAllFormComponents() {
13844
- return this.formComponents;
13930
+ ngAfterViewInit() {
13931
+ this._ngAfterViewInit();
13932
+ }
13933
+ getSmartFormsQL() {
13934
+ return this.smartFormsQL;
13845
13935
  }
13846
- getAllGridComponents() {
13847
- return this.gridComponents;
13936
+ getSmartGridsQL() {
13937
+ return this.smartGridsQL;
13848
13938
  }
13849
- getAllTreeComponents() {
13850
- return this.treeComponents;
13939
+ getSmartTreesQL() {
13940
+ return this.smartTreesQL;
13941
+ }
13942
+ getSmartComponentLayoutsQL() {
13943
+ return this.smartComponentLayoutsQL;
13851
13944
  }
13852
13945
  }
13853
13946
  SmartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponent, deps: [{ token: i0.Injector }, { token: SmartAuthService }, { token: 'pageName' }], target: i0.ɵɵFactoryTarget.Component });
13854
- SmartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartComponent, selector: "ng-component", viewQueries: [{ propertyName: "formComponents", predicate: SmartformComponent, descendants: true }, { propertyName: "gridComponents", predicate: SmartGridComponent, descendants: true }, { propertyName: "treeComponents", predicate: SmarttreeGenericService, descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
13947
+ SmartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartComponent, selector: "ng-component", viewQueries: [{ propertyName: "smartFormsQL", predicate: SmartformComponent, descendants: true }, { propertyName: "smartGridsQL", predicate: SmartGridComponent, descendants: true }, { propertyName: "smartTreesQL", predicate: SmarttreeGenericService, descendants: true }, { propertyName: "smartComponentLayoutsQL", predicate: SmartComponentLayoutComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
13855
13948
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponent, decorators: [{
13856
13949
  type: Component,
13857
13950
  args: [{
@@ -13863,15 +13956,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
13863
13956
  }] }, { type: undefined, decorators: [{
13864
13957
  type: Inject,
13865
13958
  args: ['pageName']
13866
- }] }]; }, propDecorators: { formComponents: [{
13959
+ }] }]; }, propDecorators: { smartFormsQL: [{
13867
13960
  type: ViewChildren,
13868
13961
  args: [SmartformComponent]
13869
- }], gridComponents: [{
13962
+ }], smartGridsQL: [{
13870
13963
  type: ViewChildren,
13871
13964
  args: [SmartGridComponent]
13872
- }], treeComponents: [{
13965
+ }], smartTreesQL: [{
13873
13966
  type: ViewChildren,
13874
13967
  args: [SmarttreeGenericService]
13968
+ }], smartComponentLayoutsQL: [{
13969
+ type: ViewChildren,
13970
+ args: [SmartComponentLayoutComponent]
13875
13971
  }] } });
13876
13972
 
13877
13973
  class SmartService extends SmartComponentApiClient {
@@ -13884,14 +13980,20 @@ class SmartService extends SmartComponentApiClient {
13884
13980
  ngOnDestroy() {
13885
13981
  this._ngOnDestroy();
13886
13982
  }
13887
- getAllFormComponents() {
13888
- return this.formComponents;
13983
+ ngAfterViewInit() {
13984
+ this._ngAfterViewInit();
13889
13985
  }
13890
- getAllGridComponents() {
13891
- return this.gridComponents;
13986
+ getSmartFormsQL() {
13987
+ return this.smartFormsQL;
13892
13988
  }
13893
- getAllTreeComponents() {
13894
- return this.treeComponents;
13989
+ getSmartGridsQL() {
13990
+ return this.smartGridsQL;
13991
+ }
13992
+ getSmartTreesQL() {
13993
+ return this.smartTreesQL;
13994
+ }
13995
+ getSmartComponentLayoutsQL() {
13996
+ return this.smartComponentLayoutsQL;
13895
13997
  }
13896
13998
  }
13897
13999
  SmartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartService, deps: [{ token: i0.Injector }, { token: SmartAuthService }, { token: 'pageName' }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -13907,28 +14009,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
13907
14009
  }] }, { type: undefined, decorators: [{
13908
14010
  type: Inject,
13909
14011
  args: ['pageName']
13910
- }] }]; }, propDecorators: { formComponents: [{
14012
+ }] }]; }, propDecorators: { smartFormsQL: [{
13911
14013
  type: ViewChildren,
13912
14014
  args: [SmartformComponent]
13913
- }], gridComponents: [{
14015
+ }], smartGridsQL: [{
13914
14016
  type: ViewChildren,
13915
14017
  args: [SmartGridComponent]
13916
- }], treeComponents: [{
14018
+ }], smartTreesQL: [{
13917
14019
  type: ViewChildren,
13918
14020
  args: [SmarttreeGenericService]
14021
+ }], smartComponentLayoutsQL: [{
14022
+ type: ViewChildren,
14023
+ args: [SmartComponentLayoutComponent]
13919
14024
  }] } });
13920
14025
 
13921
- class SmartComponentLayoutUtility {
13922
- static setParent(layout, parent) {
13923
- layout.parentComponent = parent;
13924
- layout.components?.forEach((l) => this.setParent(l, parent));
13925
- }
13926
- }
13927
-
13928
- /*
13929
- * Public API Surface of smart-component-layout
13930
- */
13931
-
13932
14026
  class SmartNavbarService {
13933
14027
  constructor() { }
13934
14028
  }