@smartbit4all/ng-client 3.3.48 → 3.3.50

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 (48) hide show
  1. package/esm2020/lib/smart-client/smart-component-api-client.mjs +5 -1
  2. package/esm2020/lib/smart-component-layout/api/model/componentWidgetType.mjs +2 -1
  3. package/esm2020/lib/smart-component-layout/api/model/smartComponentWidgetDefinition.mjs +1 -1
  4. package/esm2020/lib/smart-component-layout/smart-component-layout-utility.mjs +13 -1
  5. package/esm2020/lib/smart-component-layout/smart-component-layout.component.mjs +32 -6
  6. package/esm2020/lib/smart-component-layout/smart-component-layout.module.mjs +6 -2
  7. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBoolOperator.mjs +6 -5
  8. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBuilderField.mjs +1 -1
  9. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBuilderGroup.mjs +8 -9
  10. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBuilderModel.mjs +1 -1
  11. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionData.mjs +1 -1
  12. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionDataType.mjs +9 -8
  13. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionField.mjs +1 -1
  14. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionFieldList.mjs +1 -1
  15. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionFieldWidgetType.mjs +15 -14
  16. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionList.mjs +1 -1
  17. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionOperandData.mjs +1 -1
  18. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionOperation.mjs +21 -20
  19. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionOrderBy.mjs +7 -8
  20. package/esm2020/lib/smart-filter/smart-filter/components/smart-filter-simple/components/smart-filter-simple-field/smart-filter-simple-field.component.mjs +11 -10
  21. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionOrderBy.mjs +19 -0
  22. package/esm2020/lib/smart-filter-editor/smart-filter-editor-content/smart-filter-editor-content.component.mjs +8 -8
  23. package/esm2020/lib/smart-grid/api/grid-api/model/gridUpdateData.mjs +1 -1
  24. package/esm2020/lib/smart-grid/api/grid-api/model/gridView.mjs +1 -1
  25. package/esm2020/lib/smart-grid/smart-grid.component.mjs +2 -2
  26. package/fesm2015/smartbit4all-ng-client.mjs +664 -596
  27. package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
  28. package/fesm2020/smartbit4all-ng-client.mjs +1702 -1635
  29. package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
  30. package/lib/smart-component-layout/api/model/componentWidgetType.d.ts +2 -1
  31. package/lib/smart-component-layout/api/model/smartComponentWidgetDefinition.d.ts +1 -2
  32. package/lib/smart-component-layout/smart-component-layout-utility.d.ts +2 -0
  33. package/lib/smart-component-layout/smart-component-layout.component.d.ts +6 -0
  34. package/lib/smart-component-layout/smart-component-layout.module.d.ts +2 -1
  35. package/lib/smart-filter/api/filter/model/filterExpressionBoolOperator.d.ts +4 -5
  36. package/lib/smart-filter/api/filter/model/filterExpressionBuilderGroup.d.ts +5 -8
  37. package/lib/smart-filter/api/filter/model/filterExpressionBuilderModel.d.ts +6 -0
  38. package/lib/smart-filter/api/filter/model/filterExpressionDataType.d.ts +7 -8
  39. package/lib/smart-filter/api/filter/model/filterExpressionField.d.ts +3 -0
  40. package/lib/smart-filter/api/filter/model/filterExpressionFieldWidgetType.d.ts +13 -14
  41. package/lib/smart-filter/api/filter/model/filterExpressionOperation.d.ts +19 -20
  42. package/lib/smart-filter/api/filter/model/filterExpressionOrderBy.d.ts +4 -7
  43. package/lib/smart-filter-editor/api/model/filterExpressionOrderBy.d.ts +28 -0
  44. package/lib/smart-grid/api/grid-api/model/gridUpdateData.d.ts +1 -1
  45. package/lib/smart-grid/api/grid-api/model/gridView.d.ts +1 -1
  46. package/package.json +1 -1
  47. package/smartbit4all-ng-client-3.3.50.tgz +0 -0
  48. package/smartbit4all-ng-client-3.3.48.tgz +0 -0
@@ -9465,125 +9465,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
9465
9465
  args: ['forms']
9466
9466
  }] } });
9467
9467
 
9468
- class SmartFilterService {
9469
- constructor() {
9470
- this._destroy$ = new Subject();
9471
- this.shouldSubmit = new Subject();
9472
- this.reSubscribeToSubmit = new Subject();
9473
- this.change = new Subject();
9474
- }
9475
- ngOnDestroy() {
9476
- this._destroy$.next();
9477
- this._destroy$.complete();
9478
- }
9479
- async submit() {
9480
- this.shouldSubmit.next();
9481
- await this.shouldSubmit.pipe(takeUntil(this._destroy$)).toPromise();
9482
- this.shouldSubmit = new Subject();
9483
- this.reSubscribeToSubmit.next();
9484
- return this.filter;
9485
- }
9486
- }
9487
- SmartFilterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
9488
- SmartFilterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterService, providedIn: 'root' });
9489
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterService, decorators: [{
9490
- type: Injectable,
9491
- args: [{
9492
- providedIn: 'root',
9493
- }]
9494
- }], ctorParameters: function () { return []; } });
9495
-
9496
- /**
9497
- * Filter API 2
9498
- * Filter API 2
9499
- *
9500
- * The version of the OpenAPI document: 1.0.0
9501
- * Contact: info@it4all.hu
9502
- *
9503
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9504
- * https://openapi-generator.tech
9505
- * Do not edit the class manually.
9506
- */
9507
- const FilterExpressionBoolOperator$1 = {
9508
- And: 'AND',
9509
- Or: 'OR'
9510
- };
9511
-
9512
- /**
9513
- * Filter API 2
9514
- * Filter API 2
9515
- *
9516
- * The version of the OpenAPI document: 1.0.0
9517
- * Contact: info@it4all.hu
9518
- *
9519
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9520
- * https://openapi-generator.tech
9521
- * Do not edit the class manually.
9522
- */
9523
- const FilterExpressionDataType = {
9524
- String: 'STRING',
9525
- Number: 'NUMBER',
9526
- Date: 'DATE',
9527
- DateTime: 'DATE_TIME',
9528
- Boolean: 'BOOLEAN'
9529
- };
9530
-
9531
- /**
9532
- * Filter API 2
9533
- * Filter API 2
9534
- *
9535
- * The version of the OpenAPI document: 1.0.0
9536
- * Contact: info@it4all.hu
9537
- *
9538
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9539
- * https://openapi-generator.tech
9540
- * Do not edit the class manually.
9541
- */
9542
- const FilterExpressionFieldWidgetType = {
9543
- TextField: 'TEXT_FIELD',
9544
- TextFieldChips: 'TEXT_FIELD_CHIPS',
9545
- TextBox: 'TEXT_BOX',
9546
- Select: 'SELECT',
9547
- SelectMultiple: 'SELECT_MULTIPLE',
9548
- Date: 'DATE',
9549
- Time: 'TIME',
9550
- DateTime: 'DATE_TIME',
9551
- CheckBox: 'CHECK_BOX',
9552
- RadioButton: 'RADIO_BUTTON',
9553
- Range: 'RANGE'
9554
- };
9555
-
9556
- /**
9557
- * Filter API 2
9558
- * Filter API 2
9559
- *
9560
- * The version of the OpenAPI document: 1.0.0
9561
- * Contact: info@it4all.hu
9562
- *
9563
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9564
- * https://openapi-generator.tech
9565
- * Do not edit the class manually.
9566
- */
9567
- const FilterExpressionOperation = {
9568
- Expression: 'EXPRESSION',
9569
- Equal: 'EQUAL',
9570
- NotEqual: 'NOT_EQUAL',
9571
- Less: 'LESS',
9572
- LessOrEqual: 'LESS_OR_EQUAL',
9573
- Greater: 'GREATER',
9574
- GreaterOrEqual: 'GREATER_OR_EQUAL',
9575
- Like: 'LIKE',
9576
- NotLike: 'NOT_LIKE',
9577
- Between: 'BETWEEN',
9578
- NotBetween: 'NOT_BETWEEN',
9579
- IsEmpty: 'IS_EMPTY',
9580
- IsNotEmpty: 'IS_NOT_EMPTY',
9581
- Exists: 'EXISTS',
9582
- NotExists: 'NOT_EXISTS',
9583
- In: 'IN',
9584
- NotIn: 'NOT_IN'
9585
- };
9586
-
9587
9468
  /**
9588
9469
  * Filter API 2
9589
9470
  * Filter API 2
@@ -9599,452 +9480,158 @@ var FilterExpressionOrderBy;
9599
9480
  (function (FilterExpressionOrderBy) {
9600
9481
  FilterExpressionOrderBy.OrderEnum = {
9601
9482
  Asc: 'ASC',
9602
- Desc: 'DESC'
9483
+ Desc: 'DESC',
9603
9484
  };
9604
9485
  })(FilterExpressionOrderBy || (FilterExpressionOrderBy = {}));
9605
9486
 
9606
- /**
9607
- * Filter API 2
9608
- * Filter API 2
9609
- *
9610
- * The version of the OpenAPI document: 1.0.0
9611
- * Contact: info@it4all.hu
9612
- *
9613
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9614
- * https://openapi-generator.tech
9615
- * Do not edit the class manually.
9616
- */
9487
+ var ExpandableSectionButtonType;
9488
+ (function (ExpandableSectionButtonType) {
9489
+ ExpandableSectionButtonType[ExpandableSectionButtonType["BUTTON"] = 0] = "BUTTON";
9490
+ ExpandableSectionButtonType[ExpandableSectionButtonType["MENU"] = 1] = "MENU";
9491
+ ExpandableSectionButtonType[ExpandableSectionButtonType["MENU_ITEM"] = 2] = "MENU_ITEM";
9492
+ })(ExpandableSectionButtonType || (ExpandableSectionButtonType = {}));
9493
+ var ExpandableSectionButtonIconPosition;
9494
+ (function (ExpandableSectionButtonIconPosition) {
9495
+ ExpandableSectionButtonIconPosition["PRE"] = "Pre";
9496
+ ExpandableSectionButtonIconPosition["POST"] = "Post";
9497
+ })(ExpandableSectionButtonIconPosition || (ExpandableSectionButtonIconPosition = {}));
9617
9498
 
9618
- var FilterExpressionBuilderGroup;
9619
- (function (FilterExpressionBuilderGroup) {
9620
- FilterExpressionBuilderGroup.BuilderGroupKindEnum = {
9621
- Diplay: 'DIPLAY',
9622
- Bracket: 'BRACKET',
9623
- Exist: 'EXIST'
9624
- };
9625
- })(FilterExpressionBuilderGroup || (FilterExpressionBuilderGroup = {}));
9499
+ class ExpandableSectionComponent {
9500
+ constructor(cfService) {
9501
+ this.cfService = cfService;
9502
+ this.stateChange = new Subject();
9503
+ }
9504
+ onStateChange(isOpened) {
9505
+ this.data.isExpanded = isOpened;
9506
+ this.stateChange.next(this.data);
9507
+ if (this.data.stateChanged) {
9508
+ this.data.stateChanged.next({
9509
+ data: this.data.data,
9510
+ isExpanded: isOpened,
9511
+ index: this.data.index,
9512
+ });
9513
+ }
9514
+ }
9515
+ ngOnInit() { }
9516
+ ngAfterViewInit() {
9517
+ if (this.data.headerComponent) {
9518
+ this.cfService.createComponent(this.vcRefheader, this.data.headerComponent, new Map([
9519
+ [this.data.headerInputName ?? '', this.data.headerData],
9520
+ ['stateChange', this.stateChange],
9521
+ ['index', this.data.index],
9522
+ ['sectionIndex', this.index],
9523
+ ]));
9524
+ }
9525
+ this.componentRef = this.cfService.createComponent(this.vcRef, this.data.customComponent, new Map([
9526
+ [this.data.inputName ?? '', this.data.data],
9527
+ ['stateChange', this.stateChange],
9528
+ ['index', this.data.index],
9529
+ ['sectionIndex', this.index],
9530
+ ]));
9531
+ }
9532
+ action(button, event) {
9533
+ event.stopPropagation();
9534
+ if (!button.callback) {
9535
+ throw new Error(`Button with name ${button.label} or icon ${button.icon} does not have a callback!`);
9536
+ }
9537
+ button.callback(button.args);
9538
+ }
9539
+ setExpanded() { }
9540
+ type() {
9541
+ return ExpandableSectionButtonType;
9542
+ }
9543
+ position() {
9544
+ return ExpandableSectionButtonIconPosition;
9545
+ }
9546
+ customButtonClicked(event, button, element) {
9547
+ event.stopPropagation();
9548
+ if (!button.callback) {
9549
+ throw new Error(`Button with name ${button.label} or icon ${button.icon} does not have a callback!`);
9550
+ }
9551
+ button.callback(button.args, element);
9552
+ }
9553
+ }
9554
+ ExpandableSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ExpandableSectionComponent, deps: [{ token: ComponentFactoryService }], target: i0.ɵɵFactoryTarget.Component });
9555
+ ExpandableSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: { data: "data", index: "index" }, viewQueries: [{ propertyName: "vcRef", first: true, predicate: ["renderComponent"], descendants: true, read: ViewContainerRef }, { propertyName: "vcRefheader", first: true, predicate: ["headerComponent"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"section-container\" [ngClass]=\"data.cssClass ?? ''\">\r\n <mat-expansion-panel\r\n [expanded]=\"data.isExpanded\"\r\n (opened)=\"onStateChange(true)\"\r\n (closed)=\"onStateChange(false)\"\r\n >\r\n <mat-expansion-panel-header *ngIf=\"data.headerComponent\">\r\n <ng-template #headerComponent></ng-template>\r\n </mat-expansion-panel-header>\r\n <mat-expansion-panel-header *ngIf=\"!data.headerComponent\">\r\n <mat-panel-title> {{ data.title }} </mat-panel-title>\r\n <div class=\"btn-container\" *ngIf=\"data.button\">\r\n <button\r\n *ngIf=\"data.button.type === type().BUTTON\"\r\n class=\"btn\"\r\n (click)=\"action(data.button, $event)\"\r\n mat-stroked-button\r\n >\r\n <smart-icon\r\n *ngIf=\"\r\n data.button.icon &&\r\n (!data.button.iconPosition ||\r\n data.button.iconPosition === position().PRE)\r\n \"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon>\r\n {{ data.button.label }}\r\n <smart-icon\r\n *ngIf=\"data.button.icon && data.button.iconPosition === position().POST\"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon>\r\n </button>\r\n <button\r\n *ngIf=\"data.button.type === type().MENU\"\r\n mat-button\r\n [matMenuTriggerFor]=\"menu\"\r\n (click)=\"$event.stopPropagation()\"\r\n color=\"{{ data.button.color }}\"\r\n >\r\n <smart-icon\r\n *ngIf=\"\r\n data.button.icon &&\r\n (!data.button.iconPosition ||\r\n data.button.iconPosition === position().PRE)\r\n \"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon\r\n >{{ data.button.label }}\r\n <smart-icon\r\n *ngIf=\"data.button.icon && data.button.iconPosition === position().POST\"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n *ngFor=\"let button of data.button.menuItemButtons\"\r\n (click)=\"customButtonClicked($event, button, data.index)\"\r\n mat-menu-item\r\n >\r\n <smart-icon\r\n *ngIf=\"\r\n button.icon &&\r\n (!button.iconPosition || button.iconPosition === position().PRE)\r\n \"\r\n [icon]=\"button.icon\"\r\n ></smart-icon\r\n >{{ button.label }}\r\n <smart-icon\r\n *ngIf=\"button.icon && button.iconPosition === position().POST\"\r\n [icon]=\"button.icon\"\r\n ></smart-icon>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n </mat-expansion-panel-header>\r\n <ng-template #renderComponent></ng-template>\r\n </mat-expansion-panel>\r\n</div>\r\n", styles: [".section-container{margin-bottom:50px}:host::ng-deep .mat-expansion-panel-header{background:var(--primary-lighter-color)}:host::ng-deep .mat-expansion-panel-header-title{color:var(--primary-color)}:host::ng-deep .btn-container{margin:1em 3em 1em 1em}:host::ng-deep .btn{border-radius:24px}\n"], components: [{ type: i2$6.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { type: i2$6.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { type: i5.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }], directives: [{ type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$6.MatExpansionPanelTitle, selector: "mat-panel-title" }, { type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
9556
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ExpandableSectionComponent, decorators: [{
9557
+ type: Component,
9558
+ args: [{ selector: 'smart-expandable-section', template: "<div class=\"section-container\" [ngClass]=\"data.cssClass ?? ''\">\r\n <mat-expansion-panel\r\n [expanded]=\"data.isExpanded\"\r\n (opened)=\"onStateChange(true)\"\r\n (closed)=\"onStateChange(false)\"\r\n >\r\n <mat-expansion-panel-header *ngIf=\"data.headerComponent\">\r\n <ng-template #headerComponent></ng-template>\r\n </mat-expansion-panel-header>\r\n <mat-expansion-panel-header *ngIf=\"!data.headerComponent\">\r\n <mat-panel-title> {{ data.title }} </mat-panel-title>\r\n <div class=\"btn-container\" *ngIf=\"data.button\">\r\n <button\r\n *ngIf=\"data.button.type === type().BUTTON\"\r\n class=\"btn\"\r\n (click)=\"action(data.button, $event)\"\r\n mat-stroked-button\r\n >\r\n <smart-icon\r\n *ngIf=\"\r\n data.button.icon &&\r\n (!data.button.iconPosition ||\r\n data.button.iconPosition === position().PRE)\r\n \"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon>\r\n {{ data.button.label }}\r\n <smart-icon\r\n *ngIf=\"data.button.icon && data.button.iconPosition === position().POST\"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon>\r\n </button>\r\n <button\r\n *ngIf=\"data.button.type === type().MENU\"\r\n mat-button\r\n [matMenuTriggerFor]=\"menu\"\r\n (click)=\"$event.stopPropagation()\"\r\n color=\"{{ data.button.color }}\"\r\n >\r\n <smart-icon\r\n *ngIf=\"\r\n data.button.icon &&\r\n (!data.button.iconPosition ||\r\n data.button.iconPosition === position().PRE)\r\n \"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon\r\n >{{ data.button.label }}\r\n <smart-icon\r\n *ngIf=\"data.button.icon && data.button.iconPosition === position().POST\"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n *ngFor=\"let button of data.button.menuItemButtons\"\r\n (click)=\"customButtonClicked($event, button, data.index)\"\r\n mat-menu-item\r\n >\r\n <smart-icon\r\n *ngIf=\"\r\n button.icon &&\r\n (!button.iconPosition || button.iconPosition === position().PRE)\r\n \"\r\n [icon]=\"button.icon\"\r\n ></smart-icon\r\n >{{ button.label }}\r\n <smart-icon\r\n *ngIf=\"button.icon && button.iconPosition === position().POST\"\r\n [icon]=\"button.icon\"\r\n ></smart-icon>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n </mat-expansion-panel-header>\r\n <ng-template #renderComponent></ng-template>\r\n </mat-expansion-panel>\r\n</div>\r\n", styles: [".section-container{margin-bottom:50px}:host::ng-deep .mat-expansion-panel-header{background:var(--primary-lighter-color)}:host::ng-deep .mat-expansion-panel-header-title{color:var(--primary-color)}:host::ng-deep .btn-container{margin:1em 3em 1em 1em}:host::ng-deep .btn{border-radius:24px}\n"] }]
9559
+ }], ctorParameters: function () { return [{ type: ComponentFactoryService }]; }, propDecorators: { data: [{
9560
+ type: Input
9561
+ }], index: [{
9562
+ type: Input
9563
+ }], vcRef: [{
9564
+ type: ViewChild,
9565
+ args: ['renderComponent', { read: ViewContainerRef }]
9566
+ }], vcRefheader: [{
9567
+ type: ViewChild,
9568
+ args: ['headerComponent', { read: ViewContainerRef }]
9569
+ }] } });
9626
9570
 
9627
- class SmartFilterSimpleFieldComponent {
9628
- constructor(service, cfService) {
9571
+ class SmartGridComponent {
9572
+ constructor(service, cfService, dialog, uiActionDescriptorService) {
9629
9573
  this.service = service;
9630
9574
  this.cfService = cfService;
9575
+ this.dialog = dialog;
9576
+ this.uiActionDescriptorService = uiActionDescriptorService;
9577
+ // private readonly defaultPageSize: number = 10;
9578
+ this.defaultPageSizeOptions = [5, 10, 25, 50];
9631
9579
  this._destroy$ = new Subject();
9580
+ this.dev = false;
9581
+ this.pageSizeOptions = this.defaultPageSizeOptions;
9582
+ this.selectionChanges = new Subject();
9583
+ this.uiActionDescriptors = new Map();
9584
+ this.afterViewInitExecuted = false;
9585
+ this.isBlocked = true;
9586
+ this.getLevel = (node) => node.level ?? 0;
9587
+ this.isExpandable = (node) => (node.children && node.children.length > 0 ? true : false);
9588
+ this.getChildren = (node) => {
9589
+ if (node.children) {
9590
+ let rows = this.smartGrid?.gridModel.page.rows?.filter((row) => node.children?.some((child) => child === row.id));
9591
+ if (rows) {
9592
+ return rows;
9593
+ }
9594
+ }
9595
+ return [];
9596
+ };
9597
+ this.hasChild = (_, _nodeData) => this.isExpandable(_nodeData);
9598
+ this.transformer = (row, level) => {
9599
+ row.level = level;
9600
+ return row;
9601
+ };
9602
+ this.service.gridModelChanged.subscribe(() => {
9603
+ // called after every service call (load, save, refresh, etc.)
9604
+ this.smartGrid.gridModel = this.service.gridModel;
9605
+ this.render();
9606
+ });
9632
9607
  }
9633
- ngOnInit() {
9634
- this.operation = this.filterExpressionField.expressionData?.currentOperation;
9635
- this.currentOperation = this.getOptionLabel(this.operation);
9636
- }
9637
- ngAfterViewInit() {
9638
- this.constructForm();
9608
+ ngOnChanges(changes) {
9609
+ if (changes['smartGrid']) {
9610
+ this.smartGrid = changes['smartGrid'].currentValue;
9611
+ this.service.paginator = this.smartGrid?.paginator;
9612
+ this.setupToolbar();
9613
+ }
9614
+ if (changes['uuid']) {
9615
+ this.uuid = changes['uuid'].currentValue;
9616
+ }
9617
+ if (this.afterViewInitExecuted && this.uuid && this.smartGrid) {
9618
+ this.refresh();
9619
+ }
9639
9620
  }
9640
9621
  ngOnDestroy() {
9641
9622
  this._destroy$.next();
9642
9623
  this._destroy$.complete();
9643
9624
  }
9644
- constructFormWidget(key, label, widgetType, possibleValues) {
9645
- let type = widgetType;
9646
- if (type === FilterExpressionFieldWidgetType.Date) {
9647
- type = SmartFormWidgetType.DATE_PICKER;
9625
+ ngAfterViewInit() {
9626
+ if (this.dev) {
9627
+ // for dev purposes
9628
+ this.service.gridModel = this.smartGrid.gridModel;
9629
+ this.render();
9648
9630
  }
9649
- else if (type === FilterExpressionFieldWidgetType.DateTime) {
9650
- type = SmartFormWidgetType.DATE_TIME_PICKER;
9631
+ if (this.uuid && this.smartGrid && !this.dev) {
9632
+ this.refresh();
9651
9633
  }
9652
- let widget = {
9653
- key,
9654
- label,
9655
- type,
9656
- value: '',
9657
- showLabel: true,
9658
- valueList: possibleValues.map((value) => {
9659
- return {
9660
- key: value.objectUri ? value.objectUri : value.code,
9661
- label: value.displayValue,
9662
- type: SmartFormWidgetType.ITEM,
9663
- value: value.objectUri ? value.objectUri : value.code,
9664
- };
9665
- }),
9666
- };
9667
- return widget;
9668
- }
9669
- constructForm() {
9670
- this.vcRefForm?.clear();
9671
- let widgets = [];
9672
- let key;
9673
- if (this.filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
9674
- key = 'expressionData.operand2.selectedValues';
9675
- }
9676
- if (this.filterExpressionField.expressionData?.operand2) {
9677
- if (key !== 'expressionData.operand2.selectedValues') {
9678
- key = 'expressionData.operand2.valueAsString';
9679
- }
9680
- widgets.push(this.constructFormWidget(key, this.filterExpressionField.label2, this.filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, this.filterExpressionField.possibleValues));
9681
- }
9682
- if (this.filterExpressionField.expressionData?.operand3) {
9683
- if (key !== 'selectedValues') {
9684
- key = 'expressionData.operand3.valueAsString';
9685
- }
9686
- widgets.push(this.constructFormWidget(key, this.filterExpressionField.label3, this.filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, this.filterExpressionField.possibleValues));
9687
- }
9688
- this.operation = this.filterExpressionField.expressionData?.currentOperation;
9689
- this.currentOperation = this.getOptionLabel(this.operation);
9690
- this.smartForm = {
9691
- direction: SmartFormWidgetDirection.ROW,
9692
- componentModel: { data: this.filterExpressionField },
9693
- useOnValueChangeEvent: true,
9694
- useOnBlurEvent: true,
9695
- submitOnEnter: this.service.filter?.submitOnEnter,
9696
- widgets,
9697
- translateService: this.service.filter?.translateService,
9698
- };
9699
- // Show form on page
9700
- this.componentRefForm = this.cfService.createComponent(this.vcRefForm, SmartformComponent, new Map([['smartForm', this.smartForm]]));
9701
- this.componentRefForm.instance.onValueChangeSubject
9702
- ?.pipe(takeUntil(this._destroy$))
9703
- .subscribe(() => {
9704
- this.submit();
9705
- this.service.change.next();
9706
- });
9707
- this.componentRefForm.instance.onBlurSubject?.pipe(takeUntil(this._destroy$)).subscribe(() => {
9708
- this.submit();
9709
- this.service.change.next();
9710
- });
9711
- }
9712
- submit() {
9713
- let form = this.componentRefForm.instance.submitForm();
9714
- this.filterExpressionField = form.componentModel?.data;
9715
- this.simpleFieldChildren.forEach((smartFilterFieldComponent, index) => {
9716
- let filterExpressionField = smartFilterFieldComponent.submit();
9717
- this.filterExpressionField.subFieldList.filters[index] = filterExpressionField;
9718
- });
9719
- return this.filterExpressionField;
9720
- }
9721
- optionSelected(option) {
9722
- let oldOption = this.componentRefForm.instance.smartForm.componentModel.data.expressionData
9723
- .currentOperation;
9724
- this.componentRefForm.instance.smartForm.componentModel.data.expressionData.currentOperation =
9725
- option;
9726
- this.operation = option;
9727
- this.currentOperation = this.getOptionLabel(this.operation);
9728
- if (oldOption !== FilterExpressionOperation.Between &&
9729
- option === FilterExpressionOperation.Between) {
9730
- this.submit();
9731
- let label = this.filterExpressionField.label2;
9732
- this.filterExpressionField.label2 = `${label} - tól`;
9733
- this.filterExpressionField.label3 = `${label} - ig`;
9734
- this.filterExpressionField.expressionData.operand3 = {
9735
- isDataName: this.filterExpressionField.expressionData.operand2?.isDataName,
9736
- type: this.filterExpressionField.expressionData.operand3?.type,
9737
- valueAsString: this.filterExpressionField.expressionData.operand3?.valueAsString,
9738
- selectedValues: this.filterExpressionField.expressionData.operand3?.selectedValues,
9739
- };
9740
- this.constructForm();
9741
- }
9742
- else if (oldOption === FilterExpressionOperation.Between &&
9743
- option !== FilterExpressionOperation.Between) {
9744
- let label = this.filterExpressionField.label2.replace(' - tól', '');
9745
- this.filterExpressionField.label2 = `${label}`;
9746
- this.filterExpressionField.label3 = undefined;
9747
- this.filterExpressionField.expressionData.operand3 = undefined;
9748
- this.constructForm();
9749
- }
9750
- }
9751
- getOptionLabel(option) {
9752
- if (!option) {
9753
- return '';
9754
- }
9755
- else if (this.operationTranslator) {
9756
- return this.operationTranslator(option);
9757
- }
9758
- return option;
9759
- }
9760
- }
9761
- SmartFilterSimpleFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterSimpleFieldComponent, deps: [{ token: SmartFilterService }, { token: ComponentFactoryService }], target: i0.ɵɵFactoryTarget.Component });
9762
- SmartFilterSimpleFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterSimpleFieldComponent, selector: "smart-filter-simple-field", inputs: { operationTranslator: "operationTranslator", filterExpressionField: "filterExpressionField", showPossibleActions: "showPossibleActions" }, viewQueries: [{ propertyName: "vcRefForm", first: true, predicate: ["form"], descendants: true, read: ViewContainerRef }, { propertyName: "simpleFieldChildren", predicate: ["simpleField"], descendants: true }], ngImport: i0, template: "<div class=\"smart-filter-simple-field-container\">\r\n <div class=\"smart-filter-simple-field-form-widget\">\r\n <div\r\n class=\"smart-filter-simple-field-form-widget-row\"\r\n *ngIf=\"showPossibleActions\"\r\n >\r\n <p>({{ currentOperation }})</p>\r\n <button\r\n mat-icon-button\r\n [matMenuTriggerFor]=\"menu\"\r\n aria-label=\"Example icon-button with a menu\"\r\n >\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n mat-menu-item\r\n *ngFor=\"let option of filterExpressionField.possibleOperations\"\r\n (click)=\"optionSelected(option)\"\r\n >\r\n <span>\r\n {{ getOptionLabel(option) }}\r\n </span>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n <ng-template #form></ng-template>\r\n </div>\r\n</div>\r\n", styles: [".smart-filter-simple-field-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem}.smart-filter-simple-field-form-widget{padding:1rem;border-radius:1rem;display:flex;flex-direction:column}.smart-filter-simple-field-form-widget-row{display:flex;flex-direction:row;justify-content:space-between}.smart-filter-simple-field-form-widget-row p{color:#00000042}.smart-filter-simple-field-form-widget ::ng-deep .mat-icon-button{height:24px;width:24px}.smart-filter-simple-field-form-widget ::ng-deep .mat-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-flat-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-stroked-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-raised-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-icon-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-fab .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mini-fab .mat-button-wrapper>*{vertical-align:inherit!important}.smart-filter-simple-field-subfields-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem}.smart-filter-simple-field-container ::ng-deep h4{margin:0}\n"], components: [{ type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i5.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
9763
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterSimpleFieldComponent, decorators: [{
9764
- type: Component,
9765
- args: [{ selector: 'smart-filter-simple-field', template: "<div class=\"smart-filter-simple-field-container\">\r\n <div class=\"smart-filter-simple-field-form-widget\">\r\n <div\r\n class=\"smart-filter-simple-field-form-widget-row\"\r\n *ngIf=\"showPossibleActions\"\r\n >\r\n <p>({{ currentOperation }})</p>\r\n <button\r\n mat-icon-button\r\n [matMenuTriggerFor]=\"menu\"\r\n aria-label=\"Example icon-button with a menu\"\r\n >\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n mat-menu-item\r\n *ngFor=\"let option of filterExpressionField.possibleOperations\"\r\n (click)=\"optionSelected(option)\"\r\n >\r\n <span>\r\n {{ getOptionLabel(option) }}\r\n </span>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n <ng-template #form></ng-template>\r\n </div>\r\n</div>\r\n", styles: [".smart-filter-simple-field-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem}.smart-filter-simple-field-form-widget{padding:1rem;border-radius:1rem;display:flex;flex-direction:column}.smart-filter-simple-field-form-widget-row{display:flex;flex-direction:row;justify-content:space-between}.smart-filter-simple-field-form-widget-row p{color:#00000042}.smart-filter-simple-field-form-widget ::ng-deep .mat-icon-button{height:24px;width:24px}.smart-filter-simple-field-form-widget ::ng-deep .mat-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-flat-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-stroked-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-raised-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-icon-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-fab .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mini-fab .mat-button-wrapper>*{vertical-align:inherit!important}.smart-filter-simple-field-subfields-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem}.smart-filter-simple-field-container ::ng-deep h4{margin:0}\n"] }]
9766
- }], ctorParameters: function () { return [{ type: SmartFilterService }, { type: ComponentFactoryService }]; }, propDecorators: { simpleFieldChildren: [{
9767
- type: ViewChildren,
9768
- args: ['simpleField']
9769
- }], operationTranslator: [{
9770
- type: Input
9771
- }], filterExpressionField: [{
9772
- type: Input
9773
- }], showPossibleActions: [{
9774
- type: Input
9775
- }], vcRefForm: [{
9776
- type: ViewChild,
9777
- args: ['form', { read: ViewContainerRef }]
9778
- }] } });
9779
-
9780
- class SmartFilterSimpleComponent {
9781
- constructor(service) {
9782
- this.service = service;
9783
- this._destroy$ = new Subject();
9784
- this.service.reSubscribeToSubmit.pipe(takeUntil(this._destroy$)).subscribe(() => {
9785
- this.subscribeToSubmit();
9786
- });
9787
- this.subscribeToSubmit();
9788
- }
9789
- ngOnInit() {
9790
- this.smartFilter = this.service.filter;
9791
- }
9792
- ngOnDestroy() {
9793
- this._destroy$.next();
9794
- this._destroy$.complete();
9795
- }
9796
- subscribeToSubmit() {
9797
- this.service.shouldSubmit.pipe(takeUntil(this._destroy$)).subscribe(() => {
9798
- this.submit();
9799
- });
9800
- }
9801
- submit() {
9802
- this.simpleFieldChildren.forEach((smartFilterFieldComponent, index) => {
9803
- this.smartFilter.data[index] = smartFilterFieldComponent.submit();
9804
- });
9805
- this.service.filter = this.smartFilter;
9806
- this.service.shouldSubmit.complete();
9807
- }
9808
- }
9809
- SmartFilterSimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterSimpleComponent, deps: [{ token: SmartFilterService }], target: i0.ɵɵFactoryTarget.Component });
9810
- SmartFilterSimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterSimpleComponent, selector: "smart-filter-simple", viewQueries: [{ propertyName: "simpleFieldChildren", predicate: ["simpleField"], descendants: true }], ngImport: i0, template: "<div *ngIf=\"smartFilter\" class=\"smart-simple-fields-container\">\r\n <div *ngFor=\"let filterExpressionField of smartFilter.data; let i = index\">\r\n <smart-filter-simple-field\r\n #simpleField\r\n [filterExpressionField]=\"filterExpressionField\"\r\n [operationTranslator]=\"smartFilter.operationTranslator\"\r\n [showPossibleActions]=\"smartFilter.showPossibleActions\"\r\n ></smart-filter-simple-field>\r\n <div *ngFor=\"let subfilterExpressionField of filterExpressionField.subFieldList?.filters\">\r\n <smart-filter-simple-field\r\n #simpleField\r\n [filterExpressionField]=\"filterExpressionField\"\r\n [operationTranslator]=\"smartFilter.operationTranslator\"\r\n [showPossibleActions]=\"smartFilter.showPossibleActions\"\r\n ></smart-filter-simple-field>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".smart-simple-fields-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem;justify-content:center}\n"], components: [{ type: SmartFilterSimpleFieldComponent, selector: "smart-filter-simple-field", inputs: ["operationTranslator", "filterExpressionField", "showPossibleActions"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
9811
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterSimpleComponent, decorators: [{
9812
- type: Component,
9813
- args: [{ selector: "smart-filter-simple", template: "<div *ngIf=\"smartFilter\" class=\"smart-simple-fields-container\">\r\n <div *ngFor=\"let filterExpressionField of smartFilter.data; let i = index\">\r\n <smart-filter-simple-field\r\n #simpleField\r\n [filterExpressionField]=\"filterExpressionField\"\r\n [operationTranslator]=\"smartFilter.operationTranslator\"\r\n [showPossibleActions]=\"smartFilter.showPossibleActions\"\r\n ></smart-filter-simple-field>\r\n <div *ngFor=\"let subfilterExpressionField of filterExpressionField.subFieldList?.filters\">\r\n <smart-filter-simple-field\r\n #simpleField\r\n [filterExpressionField]=\"filterExpressionField\"\r\n [operationTranslator]=\"smartFilter.operationTranslator\"\r\n [showPossibleActions]=\"smartFilter.showPossibleActions\"\r\n ></smart-filter-simple-field>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".smart-simple-fields-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem;justify-content:center}\n"] }]
9814
- }], ctorParameters: function () { return [{ type: SmartFilterService }]; }, propDecorators: { simpleFieldChildren: [{
9815
- type: ViewChildren,
9816
- args: ["simpleField"]
9817
- }] } });
9818
-
9819
- class SmartFilterComponent {
9820
- constructor(service) {
9821
- this.service = service;
9822
- }
9823
- ngOnInit() {
9824
- if (this.filter) {
9825
- this.setUp();
9826
- }
9827
- }
9828
- ngOnChanges(changes) {
9829
- if (changes['filter'].currentValue) {
9830
- this.setUp();
9831
- }
9832
- }
9833
- setUp() {
9834
- this.service.filter = this.filter;
9835
- }
9836
- async submit() {
9837
- return await this.service.submit();
9838
- }
9839
- }
9840
- SmartFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterComponent, deps: [{ token: SmartFilterService }], target: i0.ɵɵFactoryTarget.Component });
9841
- SmartFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterComponent, selector: "smart-filter", inputs: { filter: "filter" }, providers: [SmartFilterService], usesOnChanges: true, ngImport: i0, template: "<smart-filter-simple *ngIf=\"filter\" #simpleFilter></smart-filter-simple>\r\n", styles: [""], components: [{ type: SmartFilterSimpleComponent, selector: "smart-filter-simple" }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
9842
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterComponent, decorators: [{
9843
- type: Component,
9844
- args: [{ selector: 'smart-filter', providers: [SmartFilterService], template: "<smart-filter-simple *ngIf=\"filter\" #simpleFilter></smart-filter-simple>\r\n", styles: [""] }]
9845
- }], ctorParameters: function () { return [{ type: SmartFilterService }]; }, propDecorators: { filter: [{
9846
- type: Input
9847
- }] } });
9848
-
9849
- class SmartFilterExpressionFieldComponent {
9850
- constructor() { }
9851
- ngOnInit() {
9852
- }
9853
- }
9854
- SmartFilterExpressionFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
9855
- SmartFilterExpressionFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterExpressionFieldComponent, selector: "lib-smart-filter-expression-field", ngImport: i0, template: "", styles: [""] });
9856
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionFieldComponent, decorators: [{
9857
- type: Component,
9858
- args: [{ selector: 'lib-smart-filter-expression-field', template: "", styles: [""] }]
9859
- }], ctorParameters: function () { return []; } });
9860
-
9861
- class SmartFilterModule {
9862
- }
9863
- SmartFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
9864
- SmartFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterModule, declarations: [SmartFilterComponent,
9865
- SmartFilterExpressionFieldComponent,
9866
- SmartFilterSimpleComponent,
9867
- SmartFilterSimpleFieldComponent], imports: [BrowserModule, SmartformModule, MatMenuModule, MatIconModule, MatButtonModule], exports: [SmartFilterComponent] });
9868
- SmartFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterModule, imports: [[BrowserModule, SmartformModule, MatMenuModule, MatIconModule, MatButtonModule]] });
9869
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterModule, decorators: [{
9870
- type: NgModule,
9871
- args: [{
9872
- declarations: [
9873
- SmartFilterComponent,
9874
- SmartFilterExpressionFieldComponent,
9875
- SmartFilterSimpleComponent,
9876
- SmartFilterSimpleFieldComponent,
9877
- ],
9878
- imports: [BrowserModule, SmartformModule, MatMenuModule, MatIconModule, MatButtonModule],
9879
- exports: [SmartFilterComponent],
9880
- }]
9881
- }] });
9882
-
9883
- var SmartFilterPosition;
9884
- (function (SmartFilterPosition) {
9885
- SmartFilterPosition[SmartFilterPosition["TOP"] = 0] = "TOP";
9886
- SmartFilterPosition[SmartFilterPosition["BOTTOM"] = 1] = "BOTTOM";
9887
- SmartFilterPosition[SmartFilterPosition["LEFT"] = 2] = "LEFT";
9888
- SmartFilterPosition[SmartFilterPosition["RIGHT"] = 3] = "RIGHT";
9889
- })(SmartFilterPosition || (SmartFilterPosition = {}));
9890
- var SmartFilterType;
9891
- (function (SmartFilterType) {
9892
- SmartFilterType[SmartFilterType["SIMPLE"] = 0] = "SIMPLE";
9893
- SmartFilterType[SmartFilterType["ADVANCED"] = 1] = "ADVANCED";
9894
- })(SmartFilterType || (SmartFilterType = {}));
9895
-
9896
- /*
9897
- * Public API Surface of smart-filter
9898
- */
9899
-
9900
- var ExpandableSectionButtonType;
9901
- (function (ExpandableSectionButtonType) {
9902
- ExpandableSectionButtonType[ExpandableSectionButtonType["BUTTON"] = 0] = "BUTTON";
9903
- ExpandableSectionButtonType[ExpandableSectionButtonType["MENU"] = 1] = "MENU";
9904
- ExpandableSectionButtonType[ExpandableSectionButtonType["MENU_ITEM"] = 2] = "MENU_ITEM";
9905
- })(ExpandableSectionButtonType || (ExpandableSectionButtonType = {}));
9906
- var ExpandableSectionButtonIconPosition;
9907
- (function (ExpandableSectionButtonIconPosition) {
9908
- ExpandableSectionButtonIconPosition["PRE"] = "Pre";
9909
- ExpandableSectionButtonIconPosition["POST"] = "Post";
9910
- })(ExpandableSectionButtonIconPosition || (ExpandableSectionButtonIconPosition = {}));
9911
-
9912
- class ExpandableSectionComponent {
9913
- constructor(cfService) {
9914
- this.cfService = cfService;
9915
- this.stateChange = new Subject();
9916
- }
9917
- onStateChange(isOpened) {
9918
- this.data.isExpanded = isOpened;
9919
- this.stateChange.next(this.data);
9920
- if (this.data.stateChanged) {
9921
- this.data.stateChanged.next({
9922
- data: this.data.data,
9923
- isExpanded: isOpened,
9924
- index: this.data.index,
9925
- });
9926
- }
9927
- }
9928
- ngOnInit() { }
9929
- ngAfterViewInit() {
9930
- if (this.data.headerComponent) {
9931
- this.cfService.createComponent(this.vcRefheader, this.data.headerComponent, new Map([
9932
- [this.data.headerInputName ?? '', this.data.headerData],
9933
- ['stateChange', this.stateChange],
9934
- ['index', this.data.index],
9935
- ['sectionIndex', this.index],
9936
- ]));
9937
- }
9938
- this.componentRef = this.cfService.createComponent(this.vcRef, this.data.customComponent, new Map([
9939
- [this.data.inputName ?? '', this.data.data],
9940
- ['stateChange', this.stateChange],
9941
- ['index', this.data.index],
9942
- ['sectionIndex', this.index],
9943
- ]));
9944
- }
9945
- action(button, event) {
9946
- event.stopPropagation();
9947
- if (!button.callback) {
9948
- throw new Error(`Button with name ${button.label} or icon ${button.icon} does not have a callback!`);
9949
- }
9950
- button.callback(button.args);
9951
- }
9952
- setExpanded() { }
9953
- type() {
9954
- return ExpandableSectionButtonType;
9955
- }
9956
- position() {
9957
- return ExpandableSectionButtonIconPosition;
9958
- }
9959
- customButtonClicked(event, button, element) {
9960
- event.stopPropagation();
9961
- if (!button.callback) {
9962
- throw new Error(`Button with name ${button.label} or icon ${button.icon} does not have a callback!`);
9963
- }
9964
- button.callback(button.args, element);
9965
- }
9966
- }
9967
- ExpandableSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ExpandableSectionComponent, deps: [{ token: ComponentFactoryService }], target: i0.ɵɵFactoryTarget.Component });
9968
- ExpandableSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: { data: "data", index: "index" }, viewQueries: [{ propertyName: "vcRef", first: true, predicate: ["renderComponent"], descendants: true, read: ViewContainerRef }, { propertyName: "vcRefheader", first: true, predicate: ["headerComponent"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"section-container\" [ngClass]=\"data.cssClass ?? ''\">\r\n <mat-expansion-panel\r\n [expanded]=\"data.isExpanded\"\r\n (opened)=\"onStateChange(true)\"\r\n (closed)=\"onStateChange(false)\"\r\n >\r\n <mat-expansion-panel-header *ngIf=\"data.headerComponent\">\r\n <ng-template #headerComponent></ng-template>\r\n </mat-expansion-panel-header>\r\n <mat-expansion-panel-header *ngIf=\"!data.headerComponent\">\r\n <mat-panel-title> {{ data.title }} </mat-panel-title>\r\n <div class=\"btn-container\" *ngIf=\"data.button\">\r\n <button\r\n *ngIf=\"data.button.type === type().BUTTON\"\r\n class=\"btn\"\r\n (click)=\"action(data.button, $event)\"\r\n mat-stroked-button\r\n >\r\n <smart-icon\r\n *ngIf=\"\r\n data.button.icon &&\r\n (!data.button.iconPosition ||\r\n data.button.iconPosition === position().PRE)\r\n \"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon>\r\n {{ data.button.label }}\r\n <smart-icon\r\n *ngIf=\"data.button.icon && data.button.iconPosition === position().POST\"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon>\r\n </button>\r\n <button\r\n *ngIf=\"data.button.type === type().MENU\"\r\n mat-button\r\n [matMenuTriggerFor]=\"menu\"\r\n (click)=\"$event.stopPropagation()\"\r\n color=\"{{ data.button.color }}\"\r\n >\r\n <smart-icon\r\n *ngIf=\"\r\n data.button.icon &&\r\n (!data.button.iconPosition ||\r\n data.button.iconPosition === position().PRE)\r\n \"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon\r\n >{{ data.button.label }}\r\n <smart-icon\r\n *ngIf=\"data.button.icon && data.button.iconPosition === position().POST\"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n *ngFor=\"let button of data.button.menuItemButtons\"\r\n (click)=\"customButtonClicked($event, button, data.index)\"\r\n mat-menu-item\r\n >\r\n <smart-icon\r\n *ngIf=\"\r\n button.icon &&\r\n (!button.iconPosition || button.iconPosition === position().PRE)\r\n \"\r\n [icon]=\"button.icon\"\r\n ></smart-icon\r\n >{{ button.label }}\r\n <smart-icon\r\n *ngIf=\"button.icon && button.iconPosition === position().POST\"\r\n [icon]=\"button.icon\"\r\n ></smart-icon>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n </mat-expansion-panel-header>\r\n <ng-template #renderComponent></ng-template>\r\n </mat-expansion-panel>\r\n</div>\r\n", styles: [".section-container{margin-bottom:50px}:host::ng-deep .mat-expansion-panel-header{background:var(--primary-lighter-color)}:host::ng-deep .mat-expansion-panel-header-title{color:var(--primary-color)}:host::ng-deep .btn-container{margin:1em 3em 1em 1em}:host::ng-deep .btn{border-radius:24px}\n"], components: [{ type: i2$6.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { type: i2$6.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { type: i5.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }], directives: [{ type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$6.MatExpansionPanelTitle, selector: "mat-panel-title" }, { type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
9969
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ExpandableSectionComponent, decorators: [{
9970
- type: Component,
9971
- args: [{ selector: 'smart-expandable-section', template: "<div class=\"section-container\" [ngClass]=\"data.cssClass ?? ''\">\r\n <mat-expansion-panel\r\n [expanded]=\"data.isExpanded\"\r\n (opened)=\"onStateChange(true)\"\r\n (closed)=\"onStateChange(false)\"\r\n >\r\n <mat-expansion-panel-header *ngIf=\"data.headerComponent\">\r\n <ng-template #headerComponent></ng-template>\r\n </mat-expansion-panel-header>\r\n <mat-expansion-panel-header *ngIf=\"!data.headerComponent\">\r\n <mat-panel-title> {{ data.title }} </mat-panel-title>\r\n <div class=\"btn-container\" *ngIf=\"data.button\">\r\n <button\r\n *ngIf=\"data.button.type === type().BUTTON\"\r\n class=\"btn\"\r\n (click)=\"action(data.button, $event)\"\r\n mat-stroked-button\r\n >\r\n <smart-icon\r\n *ngIf=\"\r\n data.button.icon &&\r\n (!data.button.iconPosition ||\r\n data.button.iconPosition === position().PRE)\r\n \"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon>\r\n {{ data.button.label }}\r\n <smart-icon\r\n *ngIf=\"data.button.icon && data.button.iconPosition === position().POST\"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon>\r\n </button>\r\n <button\r\n *ngIf=\"data.button.type === type().MENU\"\r\n mat-button\r\n [matMenuTriggerFor]=\"menu\"\r\n (click)=\"$event.stopPropagation()\"\r\n color=\"{{ data.button.color }}\"\r\n >\r\n <smart-icon\r\n *ngIf=\"\r\n data.button.icon &&\r\n (!data.button.iconPosition ||\r\n data.button.iconPosition === position().PRE)\r\n \"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon\r\n >{{ data.button.label }}\r\n <smart-icon\r\n *ngIf=\"data.button.icon && data.button.iconPosition === position().POST\"\r\n [icon]=\"data.button.icon\"\r\n ></smart-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n *ngFor=\"let button of data.button.menuItemButtons\"\r\n (click)=\"customButtonClicked($event, button, data.index)\"\r\n mat-menu-item\r\n >\r\n <smart-icon\r\n *ngIf=\"\r\n button.icon &&\r\n (!button.iconPosition || button.iconPosition === position().PRE)\r\n \"\r\n [icon]=\"button.icon\"\r\n ></smart-icon\r\n >{{ button.label }}\r\n <smart-icon\r\n *ngIf=\"button.icon && button.iconPosition === position().POST\"\r\n [icon]=\"button.icon\"\r\n ></smart-icon>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n </mat-expansion-panel-header>\r\n <ng-template #renderComponent></ng-template>\r\n </mat-expansion-panel>\r\n</div>\r\n", styles: [".section-container{margin-bottom:50px}:host::ng-deep .mat-expansion-panel-header{background:var(--primary-lighter-color)}:host::ng-deep .mat-expansion-panel-header-title{color:var(--primary-color)}:host::ng-deep .btn-container{margin:1em 3em 1em 1em}:host::ng-deep .btn{border-radius:24px}\n"] }]
9972
- }], ctorParameters: function () { return [{ type: ComponentFactoryService }]; }, propDecorators: { data: [{
9973
- type: Input
9974
- }], index: [{
9975
- type: Input
9976
- }], vcRef: [{
9977
- type: ViewChild,
9978
- args: ['renderComponent', { read: ViewContainerRef }]
9979
- }], vcRefheader: [{
9980
- type: ViewChild,
9981
- args: ['headerComponent', { read: ViewContainerRef }]
9982
- }] } });
9983
-
9984
- class SmartGridComponent {
9985
- constructor(service, cfService, dialog, uiActionDescriptorService) {
9986
- this.service = service;
9987
- this.cfService = cfService;
9988
- this.dialog = dialog;
9989
- this.uiActionDescriptorService = uiActionDescriptorService;
9990
- // private readonly defaultPageSize: number = 10;
9991
- this.defaultPageSizeOptions = [5, 10, 25, 50];
9992
- this._destroy$ = new Subject();
9993
- this.dev = false;
9994
- this.pageSizeOptions = this.defaultPageSizeOptions;
9995
- this.selectionChanges = new Subject();
9996
- this.uiActionDescriptors = new Map();
9997
- this.afterViewInitExecuted = false;
9998
- this.isBlocked = true;
9999
- this.getLevel = (node) => node.level ?? 0;
10000
- this.isExpandable = (node) => (node.children && node.children.length > 0 ? true : false);
10001
- this.getChildren = (node) => {
10002
- if (node.children) {
10003
- let rows = this.smartGrid?.gridModel.page.rows?.filter((row) => node.children?.some((child) => child === row.id));
10004
- if (rows) {
10005
- return rows;
10006
- }
10007
- }
10008
- return [];
10009
- };
10010
- this.hasChild = (_, _nodeData) => this.isExpandable(_nodeData);
10011
- this.transformer = (row, level) => {
10012
- row.level = level;
10013
- return row;
10014
- };
10015
- this.service.gridModelChanged.subscribe(() => {
10016
- // called after every service call (load, save, refresh, etc.)
10017
- this.smartGrid.gridModel = this.service.gridModel;
10018
- this.render();
10019
- });
10020
- }
10021
- ngOnChanges(changes) {
10022
- if (changes['smartGrid']) {
10023
- this.smartGrid = changes['smartGrid'].currentValue;
10024
- this.service.paginator = this.smartGrid?.paginator;
10025
- this.setupToolbar();
10026
- }
10027
- if (changes['uuid']) {
10028
- this.uuid = changes['uuid'].currentValue;
10029
- }
10030
- if (this.afterViewInitExecuted && this.uuid && this.smartGrid) {
10031
- this.refresh();
10032
- }
10033
- }
10034
- ngOnDestroy() {
10035
- this._destroy$.next();
10036
- this._destroy$.complete();
10037
- }
10038
- ngAfterViewInit() {
10039
- if (this.dev) {
10040
- // for dev purposes
10041
- this.service.gridModel = this.smartGrid.gridModel;
10042
- this.render();
10043
- }
10044
- if (this.uuid && this.smartGrid && !this.dev) {
10045
- this.refresh();
10046
- }
10047
- this.afterViewInitExecuted = true;
9634
+ this.afterViewInitExecuted = true;
10048
9635
  }
10049
9636
  /**
10050
9637
  *
@@ -11912,816 +11499,1369 @@ class TreeService {
11912
11499
  reportProgress: reportProgress,
11913
11500
  });
11914
11501
  }
11915
- selectNode(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
11916
- if (viewUuid === null || viewUuid === undefined) {
11917
- throw new Error('Required parameter viewUuid was null or undefined when calling selectNode.');
11502
+ selectNode(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
11503
+ if (viewUuid === null || viewUuid === undefined) {
11504
+ throw new Error('Required parameter viewUuid was null or undefined when calling selectNode.');
11505
+ }
11506
+ if (treeId === null || treeId === undefined) {
11507
+ throw new Error('Required parameter treeId was null or undefined when calling selectNode.');
11508
+ }
11509
+ if (nodeId === null || nodeId === undefined) {
11510
+ throw new Error('Required parameter nodeId was null or undefined when calling selectNode.');
11511
+ }
11512
+ let localVarHeaders = this.defaultHeaders;
11513
+ let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
11514
+ if (localVarHttpHeaderAcceptSelected === undefined) {
11515
+ // to determine the Accept header
11516
+ const httpHeaderAccepts = ['application/json'];
11517
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
11518
+ }
11519
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
11520
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
11521
+ }
11522
+ let localVarHttpContext = options && options.context;
11523
+ if (localVarHttpContext === undefined) {
11524
+ localVarHttpContext = new HttpContext();
11525
+ }
11526
+ let responseType_ = 'json';
11527
+ if (localVarHttpHeaderAcceptSelected) {
11528
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
11529
+ responseType_ = 'text';
11530
+ }
11531
+ else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
11532
+ responseType_ = 'json';
11533
+ }
11534
+ else {
11535
+ responseType_ = 'blob';
11536
+ }
11537
+ }
11538
+ let localVarPath = `/tree/${this.configuration.encodeParam({
11539
+ name: 'viewUuid',
11540
+ value: viewUuid,
11541
+ in: 'path',
11542
+ style: 'simple',
11543
+ explode: false,
11544
+ dataType: 'string',
11545
+ dataFormat: 'uuid',
11546
+ })}/${this.configuration.encodeParam({
11547
+ name: 'treeId',
11548
+ value: treeId,
11549
+ in: 'path',
11550
+ style: 'simple',
11551
+ explode: false,
11552
+ dataType: 'string',
11553
+ dataFormat: undefined,
11554
+ })}/${this.configuration.encodeParam({
11555
+ name: 'nodeId',
11556
+ value: nodeId,
11557
+ in: 'path',
11558
+ style: 'simple',
11559
+ explode: false,
11560
+ dataType: 'string',
11561
+ dataFormat: undefined,
11562
+ })}/select`;
11563
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
11564
+ context: localVarHttpContext,
11565
+ responseType: responseType_,
11566
+ withCredentials: this.configuration.withCredentials,
11567
+ headers: localVarHeaders,
11568
+ observe: observe,
11569
+ reportProgress: reportProgress,
11570
+ });
11571
+ }
11572
+ selectNode2(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
11573
+ if (viewUuid === null || viewUuid === undefined) {
11574
+ throw new Error('Required parameter viewUuid was null or undefined when calling selectNode2.');
11575
+ }
11576
+ if (treeId === null || treeId === undefined) {
11577
+ throw new Error('Required parameter treeId was null or undefined when calling selectNode2.');
11578
+ }
11579
+ if (nodeId === null || nodeId === undefined) {
11580
+ throw new Error('Required parameter nodeId was null or undefined when calling selectNode2.');
11581
+ }
11582
+ let localVarHeaders = this.defaultHeaders;
11583
+ let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
11584
+ if (localVarHttpHeaderAcceptSelected === undefined) {
11585
+ // to determine the Accept header
11586
+ const httpHeaderAccepts = ['application/json'];
11587
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
11588
+ }
11589
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
11590
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
11591
+ }
11592
+ let localVarHttpContext = options && options.context;
11593
+ if (localVarHttpContext === undefined) {
11594
+ localVarHttpContext = new HttpContext();
11595
+ }
11596
+ let responseType_ = 'json';
11597
+ if (localVarHttpHeaderAcceptSelected) {
11598
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
11599
+ responseType_ = 'text';
11600
+ }
11601
+ else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
11602
+ responseType_ = 'json';
11603
+ }
11604
+ else {
11605
+ responseType_ = 'blob';
11606
+ }
11607
+ }
11608
+ let localVarPath = `/tree2/${this.configuration.encodeParam({
11609
+ name: 'viewUuid',
11610
+ value: viewUuid,
11611
+ in: 'path',
11612
+ style: 'simple',
11613
+ explode: false,
11614
+ dataType: 'string',
11615
+ dataFormat: 'uuid',
11616
+ })}/${this.configuration.encodeParam({
11617
+ name: 'treeId',
11618
+ value: treeId,
11619
+ in: 'path',
11620
+ style: 'simple',
11621
+ explode: false,
11622
+ dataType: 'string',
11623
+ dataFormat: undefined,
11624
+ })}/${this.configuration.encodeParam({
11625
+ name: 'nodeId',
11626
+ value: nodeId,
11627
+ in: 'path',
11628
+ style: 'simple',
11629
+ explode: false,
11630
+ dataType: 'string',
11631
+ dataFormat: undefined,
11632
+ })}/select`;
11633
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
11634
+ context: localVarHttpContext,
11635
+ responseType: responseType_,
11636
+ withCredentials: this.configuration.withCredentials,
11637
+ headers: localVarHeaders,
11638
+ observe: observe,
11639
+ reportProgress: reportProgress,
11640
+ });
11641
+ }
11642
+ }
11643
+ TreeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TreeService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH$2, optional: true }, { token: Configuration$2, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
11644
+ TreeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TreeService, providedIn: 'root' });
11645
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TreeService, decorators: [{
11646
+ type: Injectable,
11647
+ args: [{
11648
+ providedIn: 'root',
11649
+ }]
11650
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
11651
+ type: Optional
11652
+ }, {
11653
+ type: Inject,
11654
+ args: [BASE_PATH$2]
11655
+ }] }, { type: Configuration$2, decorators: [{
11656
+ type: Optional
11657
+ }] }]; } });
11658
+
11659
+ var SmartTreeNodeButtonType;
11660
+ (function (SmartTreeNodeButtonType) {
11661
+ SmartTreeNodeButtonType["MENU"] = "MENU";
11662
+ SmartTreeNodeButtonType["ICON"] = "ICON";
11663
+ SmartTreeNodeButtonType["NORMAL"] = "NORMAL";
11664
+ })(SmartTreeNodeButtonType || (SmartTreeNodeButtonType = {}));
11665
+
11666
+ class SmarttreeService {
11667
+ constructor() {
11668
+ this.errorMessage = 'The tree is currently unavailable';
11669
+ this.smartTreeModelChanged = new Subject();
11670
+ this.uiActionModelsChanged = new Subject();
11671
+ }
11672
+ get uiActionModels() {
11673
+ return this._uiActionModels;
11674
+ }
11675
+ set uiActionModels(uiActionModels) {
11676
+ this._uiActionModels = uiActionModels;
11677
+ this.uiActionModelsChanged.next();
11678
+ }
11679
+ async initialize() {
11680
+ await this.downloadTree().then((rootNodes) => {
11681
+ this.treeFromBackend = rootNodes;
11682
+ this.syncTree();
11683
+ });
11684
+ }
11685
+ async downloadTree() {
11686
+ throw new Error('downloadTree method not implemented.');
11687
+ }
11688
+ async downloadChildren(parentNode) {
11689
+ throw new Error('downloadChildren method not implemented.');
11690
+ }
11691
+ onTreeNodeClick(treeNode) {
11692
+ throw new Error('onTreeNodeClick method not implemented.');
11693
+ }
11694
+ onTreeNodeOpen(treeNode) {
11695
+ throw new Error('onTreeNodeOpen method not implemented.');
11696
+ }
11697
+ syncTree() {
11698
+ throw new Error('syncTree method not implemented.');
11699
+ }
11700
+ }
11701
+ SmarttreeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11702
+ SmarttreeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeService, providedIn: 'root' });
11703
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeService, decorators: [{
11704
+ type: Injectable,
11705
+ args: [{
11706
+ providedIn: 'root',
11707
+ }]
11708
+ }], ctorParameters: function () { return []; } });
11709
+
11710
+ class SmarttreeGenericService extends SmarttreeService {
11711
+ constructor(inject, pageName, treeId) {
11712
+ super();
11713
+ this.pageName = pageName;
11714
+ this.treeId = treeId;
11715
+ // UseUiAction properties
11716
+ this.submit = new Subject();
11717
+ this.reSubscribeToChange = new Subject();
11718
+ this.uiActionDescriptors = new Map();
11719
+ this.viewContextName = 'viewContextUuid';
11720
+ this.configureTree({
11721
+ pageName: this.pageName,
11722
+ treeid: this.treeId,
11723
+ viewContextName: this.viewContextName,
11724
+ });
11725
+ this.viewContext = inject.get(SmartViewContextService);
11726
+ this.service = inject.get(TreeService);
11727
+ this.uiActionService = inject.get(UiActionService);
11728
+ this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
11729
+ this.initialize();
11730
+ }
11731
+ constructUiActionModels(uiActions) {
11732
+ this.uiActionModels = uiActions.map((uiAction) => {
11733
+ return {
11734
+ serviceToUse: this,
11735
+ uiAction,
11736
+ };
11737
+ });
11738
+ }
11739
+ configureTree(configuration) {
11740
+ this.treeId = configuration.treeid;
11741
+ this.viewContextName = configuration.viewContextName;
11742
+ this.pageName = configuration.pageName;
11743
+ }
11744
+ async initialize() {
11745
+ if (sessionStorage.getItem(this.viewContextName)) {
11746
+ await this.downloadTree().then((rootNodes) => {
11747
+ if (!deepEqual(this.treeFromBackend, rootNodes)) {
11748
+ this.treeFromBackend = rootNodes;
11749
+ this.syncTree();
11750
+ }
11751
+ });
11918
11752
  }
11919
- if (treeId === null || treeId === undefined) {
11920
- throw new Error('Required parameter treeId was null or undefined when calling selectNode.');
11753
+ }
11754
+ async downloadTree() {
11755
+ let uuid = this.viewContext.getUuidOfPage(this.pageName);
11756
+ const rootNodes = await this.viewContext.handlePerformActionResponse(await this.service.getRootNodes2(uuid, this.treeId).toPromise());
11757
+ const uiActions = await this.viewContext.handlePerformActionResponse(await this.service.getMainActions2(uuid, this.treeId).toPromise());
11758
+ if (uiActions) {
11759
+ this.constructUiActionModels(uiActions);
11921
11760
  }
11922
- if (nodeId === null || nodeId === undefined) {
11923
- throw new Error('Required parameter nodeId was null or undefined when calling selectNode.');
11761
+ if (!rootNodes) {
11762
+ throw new Error('RootNodes are undefined!');
11924
11763
  }
11925
- let localVarHeaders = this.defaultHeaders;
11926
- let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
11927
- if (localVarHttpHeaderAcceptSelected === undefined) {
11928
- // to determine the Accept header
11929
- const httpHeaderAccepts = ['application/json'];
11930
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
11764
+ return rootNodes;
11765
+ }
11766
+ async downloadChildren(parentNode) {
11767
+ let uuid = this.viewContext.getUuidOfPage(this.pageName);
11768
+ const children = await this.viewContext.handlePerformActionResponse(await this.service.getChildrenNodes2(uuid, this.treeId, parentNode.identifier).toPromise());
11769
+ if (!children) {
11770
+ throw new Error(`Node with identifier ${parentNode.identifier} does not have children.`);
11931
11771
  }
11932
- if (localVarHttpHeaderAcceptSelected !== undefined) {
11933
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
11772
+ return children;
11773
+ }
11774
+ async onTreeNodeOpen(treeNode) {
11775
+ let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
11776
+ if (treeNode?.expanded) {
11777
+ let tempTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.collapseNode2(viewUuid, this.treeId, treeNode.identifier).toPromise());
11778
+ treeNode = tempTreeNode;
11934
11779
  }
11935
- let localVarHttpContext = options && options.context;
11936
- if (localVarHttpContext === undefined) {
11937
- localVarHttpContext = new HttpContext();
11780
+ else if (!treeNode?.expanded) {
11781
+ let tempTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.expandNode2(viewUuid, this.treeId, treeNode?.identifier).toPromise());
11782
+ treeNode = tempTreeNode;
11938
11783
  }
11939
- let responseType_ = 'json';
11940
- if (localVarHttpHeaderAcceptSelected) {
11941
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
11942
- responseType_ = 'text';
11943
- }
11944
- else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
11945
- responseType_ = 'json';
11784
+ let node = this.deepSearchTreeNode(treeNode?.identifier, this.treeFromBackend);
11785
+ node.expanded = treeNode?.expanded;
11786
+ node.childrenNodes = treeNode?.childrenNodes;
11787
+ this.syncTree();
11788
+ }
11789
+ onTreeNodeClick(treeNode) {
11790
+ this.selectFolder(treeNode.identifier, treeNode);
11791
+ }
11792
+ async selectFolder(folderUri, treeNode) {
11793
+ let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
11794
+ let updatedTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.selectNode2(viewUuid, this.treeId, treeNode.identifier).toPromise());
11795
+ if (this.selectedNode) {
11796
+ this.selectedNode.selected = false;
11797
+ }
11798
+ this.selectedNode = updatedTreeNode;
11799
+ let node = this.deepSearchTreeNode(updatedTreeNode?.identifier, this.treeFromBackend);
11800
+ if (!node) {
11801
+ throw Error('Tree node does not exist');
11802
+ }
11803
+ node.expanded = updatedTreeNode?.expanded;
11804
+ node.childrenNodes = updatedTreeNode?.childrenNodes;
11805
+ node.selected = updatedTreeNode?.selected;
11806
+ treeNode = updatedTreeNode;
11807
+ this.syncTree();
11808
+ this.viewContext.getAndSyncViewContext(this.viewContext.getUuidOfPage(this.viewContextName));
11809
+ }
11810
+ async updateTreeOnTheFly() {
11811
+ await this.initialize();
11812
+ }
11813
+ async syncTree() {
11814
+ await this.cacheActionDesciptors(this.getAllNodes(this.treeFromBackend));
11815
+ if (!this.treeFromBackend) {
11816
+ throw new Error('There is no treeFromBackend available!');
11817
+ }
11818
+ if (!this.smartTreeModel) {
11819
+ this.smartTreeModel = {
11820
+ rootNodes: [],
11821
+ };
11822
+ }
11823
+ let smartTreeNodes = this.createButtonsForTreeNodes(this.treeFromBackend);
11824
+ this.smartTreeModel = undefined;
11825
+ this.smartTreeModel = {
11826
+ rootNodes: [],
11827
+ };
11828
+ this.smartTreeModelChanged.next(this.smartTreeModel);
11829
+ this.smartTreeModel.rootNodes = smartTreeNodes;
11830
+ this.findSelected(this.smartTreeModel.rootNodes);
11831
+ this.smartTreeModelChanged.next(this.smartTreeModel);
11832
+ }
11833
+ deepSearchTreeNode(identifier, nodes) {
11834
+ let treeNode;
11835
+ for (let index = 0; index < nodes.length; index++) {
11836
+ const node = nodes[index];
11837
+ if (node.identifier === identifier) {
11838
+ treeNode = node;
11839
+ break;
11946
11840
  }
11947
- else {
11948
- responseType_ = 'blob';
11841
+ if (node.childrenNodes && node.childrenNodes.length) {
11842
+ treeNode = this.deepSearchTreeNode(identifier, node.childrenNodes);
11843
+ if (treeNode) {
11844
+ break;
11845
+ }
11949
11846
  }
11950
11847
  }
11951
- let localVarPath = `/tree/${this.configuration.encodeParam({
11952
- name: 'viewUuid',
11953
- value: viewUuid,
11954
- in: 'path',
11955
- style: 'simple',
11956
- explode: false,
11957
- dataType: 'string',
11958
- dataFormat: 'uuid',
11959
- })}/${this.configuration.encodeParam({
11960
- name: 'treeId',
11961
- value: treeId,
11962
- in: 'path',
11963
- style: 'simple',
11964
- explode: false,
11965
- dataType: 'string',
11966
- dataFormat: undefined,
11967
- })}/${this.configuration.encodeParam({
11968
- name: 'nodeId',
11969
- value: nodeId,
11970
- in: 'path',
11971
- style: 'simple',
11972
- explode: false,
11973
- dataType: 'string',
11974
- dataFormat: undefined,
11975
- })}/select`;
11976
- return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
11977
- context: localVarHttpContext,
11978
- responseType: responseType_,
11979
- withCredentials: this.configuration.withCredentials,
11980
- headers: localVarHeaders,
11981
- observe: observe,
11982
- reportProgress: reportProgress,
11848
+ return treeNode;
11849
+ }
11850
+ findSelected(nodes) {
11851
+ return nodes.forEach((node) => {
11852
+ if (node.selected) {
11853
+ this.selectedNode = node;
11854
+ return;
11855
+ }
11856
+ else if (node.childrenNodes && node.childrenNodes.length) {
11857
+ return this.findSelected(node.childrenNodes);
11858
+ }
11983
11859
  });
11984
11860
  }
11985
- selectNode2(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
11986
- if (viewUuid === null || viewUuid === undefined) {
11987
- throw new Error('Required parameter viewUuid was null or undefined when calling selectNode2.');
11988
- }
11989
- if (treeId === null || treeId === undefined) {
11990
- throw new Error('Required parameter treeId was null or undefined when calling selectNode2.');
11861
+ createButtonsForTreeNodes(nodes) {
11862
+ nodes.map((node) => {
11863
+ node.button = node.actions?.length
11864
+ ? {
11865
+ type: SmartTreeNodeButtonType.MENU,
11866
+ icon: 'more_vert',
11867
+ menuItemButtons: node.actions.map((action) => {
11868
+ return {
11869
+ type: SmartTreeNodeButtonType.NORMAL,
11870
+ label: this.getLabelByAction(action),
11871
+ callback: this.doAction.bind(this),
11872
+ args: [action, node.identifier],
11873
+ };
11874
+ }),
11875
+ }
11876
+ : undefined;
11877
+ node.icon = 'Folders';
11878
+ if (node.childrenNodes) {
11879
+ node.childrenNodes = this.createButtonsForTreeNodes(node.childrenNodes);
11880
+ }
11881
+ });
11882
+ return nodes;
11883
+ }
11884
+ async doAction(args) {
11885
+ let uiAction = args[0];
11886
+ let nodeUuid = args[1];
11887
+ if (uiAction.params) {
11888
+ uiAction.params['nodeUuid'] = nodeUuid;
11991
11889
  }
11992
- if (nodeId === null || nodeId === undefined) {
11993
- throw new Error('Required parameter nodeId was null or undefined when calling selectNode2.');
11890
+ else {
11891
+ uiAction.params = {
11892
+ nodeUuid: nodeUuid,
11893
+ };
11994
11894
  }
11995
- let localVarHeaders = this.defaultHeaders;
11996
- let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
11997
- if (localVarHttpHeaderAcceptSelected === undefined) {
11998
- // to determine the Accept header
11999
- const httpHeaderAccepts = ['application/json'];
12000
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
11895
+ let uiActionModel = {
11896
+ serviceToUse: this,
11897
+ uiAction,
11898
+ };
11899
+ this.uiActionService.uiActionModel = uiActionModel;
11900
+ this.uiActionService.execute(uiAction);
11901
+ }
11902
+ getAllNodes(nodes) {
11903
+ return nodes.flatMap((n) => [n, ...this.getAllNodes(n.childrenNodes)]);
11904
+ }
11905
+ async cacheActionDesciptors(nodes) {
11906
+ let newUiActions = new Set();
11907
+ nodes.forEach((node) => {
11908
+ node.actions
11909
+ ?.filter((uiAction) => !this.uiActionDescriptors.get(uiAction.code))
11910
+ .forEach((action) => newUiActions.add(action));
11911
+ });
11912
+ for (let action of newUiActions) {
11913
+ if (!this.uiActionDescriptors.get(action.code)) {
11914
+ let descriptor = await this.uiActionDescriptorService.getActionDescriptor(action);
11915
+ this.uiActionDescriptors.set(action.code, descriptor);
11916
+ }
12001
11917
  }
12002
- if (localVarHttpHeaderAcceptSelected !== undefined) {
12003
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
11918
+ }
11919
+ getLabelByAction(action) {
11920
+ let desc = this.uiActionDescriptors.get(action.code);
11921
+ return desc.title;
11922
+ }
11923
+ // #region UseUiAction
11924
+ getAdditionalParams(uiAction) {
11925
+ if (uiAction.params && uiAction.params['nodeUuid']) {
11926
+ let nodeUuid = uiAction.params['nodeUuid'];
11927
+ let nodeName;
11928
+ if (uiAction.code === 'RENAME') {
11929
+ nodeName = this.deepSearchTreeNode(nodeUuid, this.treeFromBackend)?.caption;
11930
+ }
11931
+ return {
11932
+ forTextArea: '',
11933
+ forTextField: nodeName ? nodeName : '',
11934
+ };
12004
11935
  }
12005
- let localVarHttpContext = options && options.context;
12006
- if (localVarHttpContext === undefined) {
12007
- localVarHttpContext = new HttpContext();
11936
+ return {
11937
+ forTextArea: '',
11938
+ forTextField: '',
11939
+ };
11940
+ }
11941
+ getModel() {
11942
+ return {};
11943
+ }
11944
+ async performUiActionRequest(uiActionRequest) {
11945
+ if (uiActionRequest.params['nodeUuid']) {
11946
+ await this.performNodeUiActionRequest(uiActionRequest);
12008
11947
  }
12009
- let responseType_ = 'json';
12010
- if (localVarHttpHeaderAcceptSelected) {
12011
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
12012
- responseType_ = 'text';
12013
- }
12014
- else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
12015
- responseType_ = 'json';
12016
- }
12017
- else {
12018
- responseType_ = 'blob';
12019
- }
11948
+ else {
11949
+ await this.performMainUiActionRequest(uiActionRequest);
12020
11950
  }
12021
- let localVarPath = `/tree2/${this.configuration.encodeParam({
12022
- name: 'viewUuid',
12023
- value: viewUuid,
12024
- in: 'path',
12025
- style: 'simple',
12026
- explode: false,
12027
- dataType: 'string',
12028
- dataFormat: 'uuid',
12029
- })}/${this.configuration.encodeParam({
12030
- name: 'treeId',
12031
- value: treeId,
12032
- in: 'path',
12033
- style: 'simple',
12034
- explode: false,
12035
- dataType: 'string',
12036
- dataFormat: undefined,
12037
- })}/${this.configuration.encodeParam({
12038
- name: 'nodeId',
12039
- value: nodeId,
12040
- in: 'path',
12041
- style: 'simple',
12042
- explode: false,
12043
- dataType: 'string',
12044
- dataFormat: undefined,
12045
- })}/select`;
12046
- return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
12047
- context: localVarHttpContext,
12048
- responseType: responseType_,
12049
- withCredentials: this.configuration.withCredentials,
12050
- headers: localVarHeaders,
12051
- observe: observe,
12052
- reportProgress: reportProgress,
12053
- });
11951
+ await this.viewContext.getAndSyncViewContext();
11952
+ this.syncTree();
11953
+ }
11954
+ async performNodeUiActionRequest(uiActionRequest) {
11955
+ let nodeId = uiActionRequest.params['nodeUuid'];
11956
+ delete uiActionRequest.params['nodeUuid'];
11957
+ let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
11958
+ this.treeFromBackend = await this.viewContext.handlePerformActionResponse(await this.service.performAction2(viewUuid, this.treeId, nodeId, uiActionRequest).toPromise());
11959
+ }
11960
+ async performMainUiActionRequest(uiActionRequest) {
11961
+ let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
11962
+ this.treeFromBackend = await this.viewContext.handlePerformActionResponse(await this.service.performMainAction2(viewUuid, this.treeId, uiActionRequest).toPromise());
11963
+ }
11964
+ handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
11965
+ throw new Error('Method not implemented.');
12054
11966
  }
12055
11967
  }
12056
- TreeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TreeService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH$2, optional: true }, { token: Configuration$2, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
12057
- TreeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TreeService, providedIn: 'root' });
12058
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TreeService, decorators: [{
11968
+ SmarttreeGenericService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeGenericService, deps: [{ token: i0.Injector }, { token: 'pageName' }, { token: 'treeId' }], target: i0.ɵɵFactoryTarget.Injectable });
11969
+ SmarttreeGenericService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeGenericService, providedIn: 'root' });
11970
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeGenericService, decorators: [{
12059
11971
  type: Injectable,
12060
11972
  args: [{
12061
11973
  providedIn: 'root',
12062
11974
  }]
12063
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
12064
- type: Optional
12065
- }, {
11975
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: undefined, decorators: [{
12066
11976
  type: Inject,
12067
- args: [BASE_PATH$2]
12068
- }] }, { type: Configuration$2, decorators: [{
12069
- type: Optional
11977
+ args: ['pageName']
11978
+ }] }, { type: undefined, decorators: [{
11979
+ type: Inject,
11980
+ args: ['treeId']
12070
11981
  }] }]; } });
12071
11982
 
12072
- var SmartTreeNodeButtonType;
12073
- (function (SmartTreeNodeButtonType) {
12074
- SmartTreeNodeButtonType["MENU"] = "MENU";
12075
- SmartTreeNodeButtonType["ICON"] = "ICON";
12076
- SmartTreeNodeButtonType["NORMAL"] = "NORMAL";
12077
- })(SmartTreeNodeButtonType || (SmartTreeNodeButtonType = {}));
12078
-
12079
- class SmarttreeService {
12080
- constructor() {
12081
- this.errorMessage = 'The tree is currently unavailable';
12082
- this.smartTreeModelChanged = new Subject();
12083
- this.uiActionModelsChanged = new Subject();
11983
+ class SmartTreeComponent {
11984
+ constructor(cdr) {
11985
+ this.cdr = cdr;
11986
+ this._destroy$ = new Subject();
11987
+ this.treeControl = new NestedTreeControl((node) => node.childrenNodes);
11988
+ this.dataSource = new MatTreeNestedDataSource();
11989
+ this.smartTreeNodeButtonType = SmartTreeNodeButtonType;
11990
+ this.uiActionModels = [];
11991
+ this.hasChild = (_, node) => node.hasChildren;
12084
11992
  }
12085
- get uiActionModels() {
12086
- return this._uiActionModels;
11993
+ ngOnInit() {
11994
+ if (!this.treeService) {
11995
+ throw new Error('TreeService has not been given!');
11996
+ }
11997
+ this.errorMessage = this.treeService.errorMessage;
11998
+ this.treeService.smartTreeModelChanged.subscribe((newSmartTree) => {
11999
+ this.treeData = newSmartTree;
12000
+ this.dataSource.data = this.treeData.rootNodes;
12001
+ this.expandTreeNodes();
12002
+ });
12003
+ this.treeService.uiActionModelsChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
12004
+ if (this.treeService.uiActionModels) {
12005
+ this.uiActionModels = this.treeService.uiActionModels;
12006
+ }
12007
+ });
12087
12008
  }
12088
- set uiActionModels(uiActionModels) {
12089
- this._uiActionModels = uiActionModels;
12090
- this.uiActionModelsChanged.next();
12009
+ ngOnDestroy() {
12010
+ this._destroy$.next();
12011
+ this._destroy$.complete();
12091
12012
  }
12092
- async initialize() {
12093
- await this.downloadTree().then((rootNodes) => {
12094
- this.treeFromBackend = rootNodes;
12095
- this.syncTree();
12013
+ getIfExpanded(node) {
12014
+ return this.treeControl.isExpanded(node);
12015
+ }
12016
+ expandTreeNodes() {
12017
+ this.expandTreeNodesDeeply(this.dataSource.data);
12018
+ }
12019
+ expandTreeNodesDeeply(nodes) {
12020
+ nodes.forEach((node) => {
12021
+ if (node.expanded) {
12022
+ this.treeControl.expand(node);
12023
+ this.cdr.markForCheck();
12024
+ if (node.childrenNodes && node.childrenNodes.length) {
12025
+ this.expandTreeNodesDeeply(node.childrenNodes);
12026
+ }
12027
+ }
12028
+ else {
12029
+ this.treeControl.collapse(node);
12030
+ }
12096
12031
  });
12097
12032
  }
12098
- async downloadTree() {
12099
- throw new Error('downloadTree method not implemented.');
12033
+ onNodeClick(event, node) {
12034
+ event.stopPropagation();
12035
+ if (this.tempActiveNode)
12036
+ this.tempActiveNode.selected = false;
12037
+ node.selected = true;
12038
+ this.tempActiveNode = node;
12039
+ this.treeService.onTreeNodeClick(node);
12100
12040
  }
12101
- async downloadChildren(parentNode) {
12102
- throw new Error('downloadChildren method not implemented.');
12041
+ onOpenNode(event, node) {
12042
+ event.stopPropagation();
12043
+ this.treeService.onTreeNodeOpen(node);
12103
12044
  }
12104
- onTreeNodeClick(treeNode) {
12105
- throw new Error('onTreeNodeClick method not implemented.');
12045
+ getNodeStyle(node) {
12046
+ if (this.treeStyle) {
12047
+ var style = node.selected
12048
+ ? {
12049
+ background: this.treeStyle.activeStyle?.backgroundColor,
12050
+ color: this.treeStyle.activeStyle?.color,
12051
+ }
12052
+ : {
12053
+ background: this.treeStyle.levelBackgroundColor[node.level],
12054
+ color: this.treeStyle.color,
12055
+ };
12056
+ return style;
12057
+ }
12058
+ return {};
12106
12059
  }
12107
- onTreeNodeOpen(treeNode) {
12108
- throw new Error('onTreeNodeOpen method not implemented.');
12060
+ getNodePadding(node) {
12061
+ if (this.treeStyle) {
12062
+ var style = node.selected
12063
+ ? {
12064
+ 'padding-left': 15 * node.level + 'px',
12065
+ }
12066
+ : {
12067
+ 'padding-left': 15 * node.level + 'px',
12068
+ };
12069
+ return style;
12070
+ }
12071
+ return {};
12072
+ }
12073
+ customButtonClicked(event, button, close) {
12074
+ event.stopPropagation();
12075
+ if (button.type === SmartTreeNodeButtonType.MENU) {
12076
+ return;
12077
+ }
12078
+ if (!button.callback) {
12079
+ throw new Error(`Button with name ${button.label || button.icon} does not have a callback!`);
12080
+ }
12081
+ button.callback(button.args);
12082
+ if (close) {
12083
+ let openMenus = this.trigger.filter((matMenuTrigger) => matMenuTrigger.menuOpen);
12084
+ openMenus.forEach((matMenuTrigger) => {
12085
+ matMenuTrigger.closeMenu();
12086
+ });
12087
+ }
12088
+ }
12089
+ getClassesForTreeNode(node) {
12090
+ let classes = [];
12091
+ if (node.expanded) {
12092
+ classes.push(this.getCustomClass('expanded', node.level));
12093
+ }
12094
+ else {
12095
+ classes.push(this.getCustomClass('collapsed', node.level));
12096
+ }
12097
+ if (node.selected) {
12098
+ classes.push(this.getCustomClass('selected', node.level));
12099
+ }
12100
+ else {
12101
+ classes.push(this.getCustomClass('unselected', node.level));
12102
+ }
12103
+ if (node.level !== 0) {
12104
+ classes.push(this.getCustomClass('child', node.level));
12105
+ }
12106
+ return classes;
12107
+ }
12108
+ getInnerClassesForTreeNode(node) {
12109
+ let classes = [];
12110
+ if (node.expanded) {
12111
+ classes.push(this.getCustomClass('inner-expanded', node.level));
12112
+ }
12113
+ else {
12114
+ classes.push(this.getCustomClass('inner-collapsed', node.level));
12115
+ }
12116
+ if (node.selected) {
12117
+ classes.push(this.getCustomClass('inner-selected', node.level));
12118
+ }
12119
+ else {
12120
+ classes.push(this.getCustomClass('inner-unselected', node.level));
12121
+ }
12122
+ return classes;
12109
12123
  }
12110
- syncTree() {
12111
- throw new Error('syncTree method not implemented.');
12124
+ getClassesForTreeNodeChildren(node) {
12125
+ let classes = [];
12126
+ classes.push(this.getCustomClass('group', node.level));
12127
+ return classes;
12128
+ }
12129
+ getCustomClass(cssClass, plusProperty) {
12130
+ return `${cssClass}-${plusProperty}`;
12112
12131
  }
12113
12132
  }
12114
- SmarttreeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
12115
- SmarttreeServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeService, providedIn: 'root' });
12116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeService, decorators: [{
12117
- type: Injectable,
12133
+ SmartTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTreeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
12134
+ SmartTreeComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartTreeComponent, selector: "smart-tree", inputs: { treeStyle: "treeStyle", treeService: "treeService" }, viewQueries: [{ propertyName: "tree", first: true, predicate: ["tree"], descendants: true }, { propertyName: "trigger", predicate: MatMenuTrigger, descendants: true }], ngImport: i0, template: "<div class=\"smartTreeContainer\">\r\n <smart-ui-action-toolbar\r\n *ngIf=\"uiActionModels.length\"\r\n [uiActionModels]=\"uiActionModels\"\r\n ></smart-ui-action-toolbar>\r\n <mat-tree\r\n #tree\r\n *ngIf=\"treeData\"\r\n [dataSource]=\"dataSource\"\r\n [treeControl]=\"treeControl\"\r\n class=\"sm-tree\"\r\n >\r\n <mat-nested-tree-node\r\n *matTreeNodeDef=\"let node; when: hasChild\"\r\n matTreeNodeToggle=\"{{ getIfExpanded(node) }}\"\r\n [ngClass]=\"getClassesForTreeNode(node)\"\r\n [ngStyle]=\"getNodeStyle(node)\"\r\n >\r\n <div\r\n [ngStyle]=\"getNodePadding(node)\"\r\n [ngClass]=\"getInnerClassesForTreeNode(node)\"\r\n class=\"mat-tree-node sm-tree-node\"\r\n (click)=\"onNodeClick($event, node)\"\r\n >\r\n <button mat-icon-button [attr.aria-label]=\"'Toggle ' + node.name\">\r\n <mat-icon\r\n class=\"mat-icon-rtl-mirror\"\r\n matTreeNodeToggle\r\n (click)=\"onOpenNode($event, node)\"\r\n >\r\n <div *ngIf=\"hasChild(node.level, node)\">\r\n {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\r\n </div>\r\n </mat-icon>\r\n </button>\r\n <smart-icon [icon]=\"node.icon\"> </smart-icon>\r\n <div class=\"sm-tree-row\" [ngClass]=\"node.classes\">\r\n <div class=\"sm-tree-row-caption\">\r\n {{ node.caption }}\r\n </div>\r\n <div class=\"sm-shortDescription-spacer\"></div>\r\n <div class=\"sm-tree-row-shortDescription\">\r\n {{ node.shortDescription }}\r\n </div>\r\n <div class=\"sm-shortDescription-button-spacer\"></div>\r\n <div *ngIf=\"node.button\" class=\"sm-tree-node-button\" [ngSwitch]=\"node.button.type\">\r\n <button\r\n (click)=\"customButtonClicked($event, node.button)\"\r\n *ngSwitchCase=\"smartTreeNodeButtonType.ICON\"\r\n mat-icon-button\r\n >\r\n <smart-icon title=\"{{ node.button.icon }}\" [icon]=\"node.button.icon\"></smart-icon>\r\n </button>\r\n <div *ngSwitchCase=\"smartTreeNodeButtonType.MENU\">\r\n <button\r\n mat-button\r\n [matMenuTriggerFor]=\"menu\"\r\n (click)=\"customButtonClicked($event, node.button, true)\"\r\n >\r\n <smart-icon *ngIf=\"node.button.icon\" [icon]=\"node.button.icon\"></smart-icon\r\n >{{ node.button.label }}\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n *ngFor=\"let button of node.button.menuItemButtons\"\r\n (click)=\"customButtonClicked($event, button, true)\"\r\n mat-menu-item\r\n >\r\n <smart-icon *ngIf=\"button.icon\" [icon]=\"button.icon\"></smart-icon\r\n >{{ button.label }}\r\n </button>\r\n </mat-menu>\r\n </div>\r\n <button\r\n (click)=\"customButtonClicked($event, node.button)\"\r\n *ngSwitchCase=\"smartTreeNodeButtonType.NORMAL\"\r\n mat-raised-button\r\n >\r\n <smart-icon *ngIf=\"node.button.icon\" [icon]=\"node.button.icon\"></smart-icon>\r\n {{ node.button.icon }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div\r\n [class.sm-tree-invisible]=\"!treeControl.isExpanded(node)\"\r\n [ngClass]=\"getClassesForTreeNodeChildren(node)\"\r\n role=\"group\"\r\n >\r\n <ng-container matTreeNodeOutlet></ng-container>\r\n </div>\r\n </mat-nested-tree-node>\r\n </mat-tree>\r\n <div *ngIf=\"!treeData\">\r\n <h3>\r\n {{ errorMessage }}\r\n </h3>\r\n </div>\r\n</div>\r\n", styles: [".smartTreeContainer{display:flex;flex-direction:column;gap:.5rem}.sm-tree-invisible{display:none}.sm-tree ul,.sm-tree li{margin-top:0;margin-bottom:0;list-style-type:none}.sm-tree div[role=group]>.mat-tree-node{padding-left:40px}.sm-tee-node{padding-left:40px}.sm-tree-node-name{padding-left:15px;padding-top:15px;display:flex;flex-direction:column}.sm-tree-node-name-row{padding-left:15px;padding-top:15px;display:flex;flex-direction:row;justify-content:space-between}.sm-tree-node-name-col{padding-left:15px;padding-top:15px;display:flex;flex-direction:column}.sm-tee-node-id{font-weight:lighter}.mat-tree-node:hover{cursor:pointer}::ng-deep .mat-icon-rtl-mirror{display:flex;flex-direction:row}.sm-tree-row{display:flex;flex-direction:row;flex:1;align-items:center}.sm-shortDescription-spacer{flex:1}\n"], components: [{ type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id"] }, { type: i10$1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { type: i5.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10$1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { type: i10$1.MatNestedTreeNode, selector: "mat-nested-tree-node", inputs: ["role", "disabled", "tabIndex", "matNestedTreeNode"], exportAs: ["matNestedTreeNode"] }, { type: i10$1.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10$1.MatTreeNodeOutlet, selector: "[matTreeNodeOutlet]" }] });
12135
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTreeComponent, decorators: [{
12136
+ type: Component,
12137
+ args: [{ selector: 'smart-tree', template: "<div class=\"smartTreeContainer\">\r\n <smart-ui-action-toolbar\r\n *ngIf=\"uiActionModels.length\"\r\n [uiActionModels]=\"uiActionModels\"\r\n ></smart-ui-action-toolbar>\r\n <mat-tree\r\n #tree\r\n *ngIf=\"treeData\"\r\n [dataSource]=\"dataSource\"\r\n [treeControl]=\"treeControl\"\r\n class=\"sm-tree\"\r\n >\r\n <mat-nested-tree-node\r\n *matTreeNodeDef=\"let node; when: hasChild\"\r\n matTreeNodeToggle=\"{{ getIfExpanded(node) }}\"\r\n [ngClass]=\"getClassesForTreeNode(node)\"\r\n [ngStyle]=\"getNodeStyle(node)\"\r\n >\r\n <div\r\n [ngStyle]=\"getNodePadding(node)\"\r\n [ngClass]=\"getInnerClassesForTreeNode(node)\"\r\n class=\"mat-tree-node sm-tree-node\"\r\n (click)=\"onNodeClick($event, node)\"\r\n >\r\n <button mat-icon-button [attr.aria-label]=\"'Toggle ' + node.name\">\r\n <mat-icon\r\n class=\"mat-icon-rtl-mirror\"\r\n matTreeNodeToggle\r\n (click)=\"onOpenNode($event, node)\"\r\n >\r\n <div *ngIf=\"hasChild(node.level, node)\">\r\n {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\r\n </div>\r\n </mat-icon>\r\n </button>\r\n <smart-icon [icon]=\"node.icon\"> </smart-icon>\r\n <div class=\"sm-tree-row\" [ngClass]=\"node.classes\">\r\n <div class=\"sm-tree-row-caption\">\r\n {{ node.caption }}\r\n </div>\r\n <div class=\"sm-shortDescription-spacer\"></div>\r\n <div class=\"sm-tree-row-shortDescription\">\r\n {{ node.shortDescription }}\r\n </div>\r\n <div class=\"sm-shortDescription-button-spacer\"></div>\r\n <div *ngIf=\"node.button\" class=\"sm-tree-node-button\" [ngSwitch]=\"node.button.type\">\r\n <button\r\n (click)=\"customButtonClicked($event, node.button)\"\r\n *ngSwitchCase=\"smartTreeNodeButtonType.ICON\"\r\n mat-icon-button\r\n >\r\n <smart-icon title=\"{{ node.button.icon }}\" [icon]=\"node.button.icon\"></smart-icon>\r\n </button>\r\n <div *ngSwitchCase=\"smartTreeNodeButtonType.MENU\">\r\n <button\r\n mat-button\r\n [matMenuTriggerFor]=\"menu\"\r\n (click)=\"customButtonClicked($event, node.button, true)\"\r\n >\r\n <smart-icon *ngIf=\"node.button.icon\" [icon]=\"node.button.icon\"></smart-icon\r\n >{{ node.button.label }}\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n *ngFor=\"let button of node.button.menuItemButtons\"\r\n (click)=\"customButtonClicked($event, button, true)\"\r\n mat-menu-item\r\n >\r\n <smart-icon *ngIf=\"button.icon\" [icon]=\"button.icon\"></smart-icon\r\n >{{ button.label }}\r\n </button>\r\n </mat-menu>\r\n </div>\r\n <button\r\n (click)=\"customButtonClicked($event, node.button)\"\r\n *ngSwitchCase=\"smartTreeNodeButtonType.NORMAL\"\r\n mat-raised-button\r\n >\r\n <smart-icon *ngIf=\"node.button.icon\" [icon]=\"node.button.icon\"></smart-icon>\r\n {{ node.button.icon }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div\r\n [class.sm-tree-invisible]=\"!treeControl.isExpanded(node)\"\r\n [ngClass]=\"getClassesForTreeNodeChildren(node)\"\r\n role=\"group\"\r\n >\r\n <ng-container matTreeNodeOutlet></ng-container>\r\n </div>\r\n </mat-nested-tree-node>\r\n </mat-tree>\r\n <div *ngIf=\"!treeData\">\r\n <h3>\r\n {{ errorMessage }}\r\n </h3>\r\n </div>\r\n</div>\r\n", styles: [".smartTreeContainer{display:flex;flex-direction:column;gap:.5rem}.sm-tree-invisible{display:none}.sm-tree ul,.sm-tree li{margin-top:0;margin-bottom:0;list-style-type:none}.sm-tree div[role=group]>.mat-tree-node{padding-left:40px}.sm-tee-node{padding-left:40px}.sm-tree-node-name{padding-left:15px;padding-top:15px;display:flex;flex-direction:column}.sm-tree-node-name-row{padding-left:15px;padding-top:15px;display:flex;flex-direction:row;justify-content:space-between}.sm-tree-node-name-col{padding-left:15px;padding-top:15px;display:flex;flex-direction:column}.sm-tee-node-id{font-weight:lighter}.mat-tree-node:hover{cursor:pointer}::ng-deep .mat-icon-rtl-mirror{display:flex;flex-direction:row}.sm-tree-row{display:flex;flex-direction:row;flex:1;align-items:center}.sm-shortDescription-spacer{flex:1}\n"] }]
12138
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { trigger: [{
12139
+ type: ViewChildren,
12140
+ args: [MatMenuTrigger]
12141
+ }], tree: [{
12142
+ type: ViewChild,
12143
+ args: ['tree']
12144
+ }], treeStyle: [{
12145
+ type: Input
12146
+ }], treeService: [{
12147
+ type: Input
12148
+ }] } });
12149
+
12150
+ class SmarttreeModule {
12151
+ }
12152
+ SmarttreeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
12153
+ SmarttreeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeModule, declarations: [SmartTreeComponent], imports: [BrowserModule,
12154
+ MatCommonModule,
12155
+ MatButtonModule,
12156
+ MatIconModule,
12157
+ MatTreeModule,
12158
+ MatMenuModule,
12159
+ SmartIconModule,
12160
+ SmartViewContextModule], exports: [SmartTreeComponent] });
12161
+ SmarttreeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeModule, providers: [SmarttreeService, SmarttreeGenericService], imports: [[
12162
+ BrowserModule,
12163
+ MatCommonModule,
12164
+ MatButtonModule,
12165
+ MatIconModule,
12166
+ MatTreeModule,
12167
+ MatMenuModule,
12168
+ SmartIconModule,
12169
+ SmartViewContextModule,
12170
+ ]] });
12171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeModule, decorators: [{
12172
+ type: NgModule,
12118
12173
  args: [{
12119
- providedIn: 'root',
12174
+ declarations: [SmartTreeComponent],
12175
+ imports: [
12176
+ BrowserModule,
12177
+ MatCommonModule,
12178
+ MatButtonModule,
12179
+ MatIconModule,
12180
+ MatTreeModule,
12181
+ MatMenuModule,
12182
+ SmartIconModule,
12183
+ SmartViewContextModule,
12184
+ ],
12185
+ exports: [SmartTreeComponent],
12186
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
12187
+ providers: [SmarttreeService, SmarttreeGenericService],
12120
12188
  }]
12121
- }], ctorParameters: function () { return []; } });
12189
+ }] });
12122
12190
 
12123
- class SmarttreeGenericService extends SmarttreeService {
12124
- constructor(inject, pageName, treeId) {
12125
- super();
12126
- this.pageName = pageName;
12127
- this.treeId = treeId;
12128
- // UseUiAction properties
12129
- this.submit = new Subject();
12130
- this.reSubscribeToChange = new Subject();
12131
- this.uiActionDescriptors = new Map();
12132
- this.viewContextName = 'viewContextUuid';
12133
- this.configureTree({
12134
- pageName: this.pageName,
12135
- treeid: this.treeId,
12136
- viewContextName: this.viewContextName,
12137
- });
12138
- this.viewContext = inject.get(SmartViewContextService);
12139
- this.service = inject.get(TreeService);
12140
- this.uiActionService = inject.get(UiActionService);
12141
- this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
12142
- this.initialize();
12191
+ /**
12192
+ * Custom HttpParameterCodec
12193
+ * Workaround for https://github.com/angular/angular/issues/18261
12194
+ */
12195
+ class CustomHttpParameterCodec$1 {
12196
+ encodeKey(k) {
12197
+ return encodeURIComponent(k);
12143
12198
  }
12144
- constructUiActionModels(uiActions) {
12145
- this.uiActionModels = uiActions.map((uiAction) => {
12146
- return {
12147
- serviceToUse: this,
12148
- uiAction,
12149
- };
12150
- });
12199
+ encodeValue(v) {
12200
+ return encodeURIComponent(v);
12151
12201
  }
12152
- configureTree(configuration) {
12153
- this.treeId = configuration.treeid;
12154
- this.viewContextName = configuration.viewContextName;
12155
- this.pageName = configuration.pageName;
12202
+ decodeKey(k) {
12203
+ return decodeURIComponent(k);
12156
12204
  }
12157
- async initialize() {
12158
- if (sessionStorage.getItem(this.viewContextName)) {
12159
- await this.downloadTree().then((rootNodes) => {
12160
- if (!deepEqual(this.treeFromBackend, rootNodes)) {
12161
- this.treeFromBackend = rootNodes;
12162
- this.syncTree();
12163
- }
12164
- });
12205
+ decodeValue(v) {
12206
+ return decodeURIComponent(v);
12207
+ }
12208
+ }
12209
+
12210
+ const BASE_PATH$1 = new InjectionToken('basePath');
12211
+ const COLLECTION_FORMATS$1 = {
12212
+ 'csv': ',',
12213
+ 'tsv': ' ',
12214
+ 'ssv': ' ',
12215
+ 'pipes': '|'
12216
+ };
12217
+
12218
+ class Configuration$1 {
12219
+ constructor(configurationParameters = {}) {
12220
+ this.apiKeys = configurationParameters.apiKeys;
12221
+ this.username = configurationParameters.username;
12222
+ this.password = configurationParameters.password;
12223
+ this.accessToken = configurationParameters.accessToken;
12224
+ this.basePath = configurationParameters.basePath;
12225
+ this.withCredentials = configurationParameters.withCredentials;
12226
+ this.encoder = configurationParameters.encoder;
12227
+ if (configurationParameters.encodeParam) {
12228
+ this.encodeParam = configurationParameters.encodeParam;
12229
+ }
12230
+ else {
12231
+ this.encodeParam = param => this.defaultEncodeParam(param);
12232
+ }
12233
+ if (configurationParameters.credentials) {
12234
+ this.credentials = configurationParameters.credentials;
12235
+ }
12236
+ else {
12237
+ this.credentials = {};
12165
12238
  }
12166
12239
  }
12167
- async downloadTree() {
12168
- let uuid = this.viewContext.getUuidOfPage(this.pageName);
12169
- const rootNodes = await this.viewContext.handlePerformActionResponse(await this.service.getRootNodes2(uuid, this.treeId).toPromise());
12170
- const uiActions = await this.viewContext.handlePerformActionResponse(await this.service.getMainActions2(uuid, this.treeId).toPromise());
12171
- if (uiActions) {
12172
- this.constructUiActionModels(uiActions);
12240
+ /**
12241
+ * Select the correct content-type to use for a request.
12242
+ * Uses {@link Configuration#isJsonMime} to determine the correct content-type.
12243
+ * If no content type is found return the first found type if the contentTypes is not empty
12244
+ * @param contentTypes - the array of content types that are available for selection
12245
+ * @returns the selected content-type or <code>undefined</code> if no selection could be made.
12246
+ */
12247
+ selectHeaderContentType(contentTypes) {
12248
+ if (contentTypes.length === 0) {
12249
+ return undefined;
12173
12250
  }
12174
- if (!rootNodes) {
12175
- throw new Error('RootNodes are undefined!');
12251
+ const type = contentTypes.find((x) => this.isJsonMime(x));
12252
+ if (type === undefined) {
12253
+ return contentTypes[0];
12176
12254
  }
12177
- return rootNodes;
12255
+ return type;
12178
12256
  }
12179
- async downloadChildren(parentNode) {
12180
- let uuid = this.viewContext.getUuidOfPage(this.pageName);
12181
- const children = await this.viewContext.handlePerformActionResponse(await this.service.getChildrenNodes2(uuid, this.treeId, parentNode.identifier).toPromise());
12182
- if (!children) {
12183
- throw new Error(`Node with identifier ${parentNode.identifier} does not have children.`);
12257
+ /**
12258
+ * Select the correct accept content-type to use for a request.
12259
+ * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
12260
+ * If no content type is found return the first found type if the contentTypes is not empty
12261
+ * @param accepts - the array of content types that are available for selection.
12262
+ * @returns the selected content-type or <code>undefined</code> if no selection could be made.
12263
+ */
12264
+ selectHeaderAccept(accepts) {
12265
+ if (accepts.length === 0) {
12266
+ return undefined;
12184
12267
  }
12185
- return children;
12268
+ const type = accepts.find((x) => this.isJsonMime(x));
12269
+ if (type === undefined) {
12270
+ return accepts[0];
12271
+ }
12272
+ return type;
12186
12273
  }
12187
- async onTreeNodeOpen(treeNode) {
12188
- let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
12189
- if (treeNode?.expanded) {
12190
- let tempTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.collapseNode2(viewUuid, this.treeId, treeNode.identifier).toPromise());
12191
- treeNode = tempTreeNode;
12274
+ /**
12275
+ * Check if the given MIME is a JSON MIME.
12276
+ * JSON MIME examples:
12277
+ * application/json
12278
+ * application/json; charset=UTF8
12279
+ * APPLICATION/JSON
12280
+ * application/vnd.company+json
12281
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
12282
+ * @return True if the given MIME is JSON, false otherwise.
12283
+ */
12284
+ isJsonMime(mime) {
12285
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
12286
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
12287
+ }
12288
+ lookupCredential(key) {
12289
+ const value = this.credentials[key];
12290
+ return typeof value === 'function'
12291
+ ? value()
12292
+ : value;
12293
+ }
12294
+ defaultEncodeParam(param) {
12295
+ // This implementation exists as fallback for missing configuration
12296
+ // and for backwards compatibility to older typescript-angular generator versions.
12297
+ // It only works for the 'simple' parameter style.
12298
+ // Date-handling only works for the 'date-time' format.
12299
+ // All other styles and Date-formats are probably handled incorrectly.
12300
+ //
12301
+ // But: if that's all you need (i.e.: the most common use-case): no need for customization!
12302
+ const value = param.dataFormat === 'date-time' && param.value instanceof Date
12303
+ ? param.value.toISOString()
12304
+ : param.value;
12305
+ return encodeURIComponent(String(value));
12306
+ }
12307
+ }
12308
+
12309
+ /**
12310
+ * Form layout definition
12311
+ * Contains form layout definition objects.
12312
+ *
12313
+ * The version of the OpenAPI document: 1.0.0
12314
+ * Contact: info@it4all.hu
12315
+ *
12316
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12317
+ * https://openapi-generator.tech
12318
+ * Do not edit the class manually.
12319
+ */
12320
+ class DefaultService {
12321
+ constructor(httpClient, basePath, configuration) {
12322
+ this.httpClient = httpClient;
12323
+ this.basePath = 'http://localhost';
12324
+ this.defaultHeaders = new HttpHeaders();
12325
+ this.configuration = new Configuration$1();
12326
+ if (configuration) {
12327
+ this.configuration = configuration;
12192
12328
  }
12193
- else if (!treeNode?.expanded) {
12194
- let tempTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.expandNode2(viewUuid, this.treeId, treeNode?.identifier).toPromise());
12195
- treeNode = tempTreeNode;
12329
+ if (typeof this.configuration.basePath !== 'string') {
12330
+ if (Array.isArray(basePath) && basePath.length > 0) {
12331
+ basePath = basePath[0];
12332
+ }
12333
+ if (typeof basePath !== 'string') {
12334
+ basePath = this.basePath;
12335
+ }
12336
+ this.configuration.basePath = basePath;
12196
12337
  }
12197
- let node = this.deepSearchTreeNode(treeNode?.identifier, this.treeFromBackend);
12198
- node.expanded = treeNode?.expanded;
12199
- node.childrenNodes = treeNode?.childrenNodes;
12200
- this.syncTree();
12201
- }
12202
- onTreeNodeClick(treeNode) {
12203
- this.selectFolder(treeNode.identifier, treeNode);
12338
+ this.encoder = this.configuration.encoder || new CustomHttpParameterCodec$1();
12204
12339
  }
12205
- async selectFolder(folderUri, treeNode) {
12206
- let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
12207
- let updatedTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.selectNode2(viewUuid, this.treeId, treeNode.identifier).toPromise());
12208
- if (this.selectedNode) {
12209
- this.selectedNode.selected = false;
12340
+ // @ts-ignore
12341
+ addToHttpParams(httpParams, value, key) {
12342
+ if (typeof value === "object" && value instanceof Date === false) {
12343
+ httpParams = this.addToHttpParamsRecursive(httpParams, value);
12210
12344
  }
12211
- this.selectedNode = updatedTreeNode;
12212
- let node = this.deepSearchTreeNode(updatedTreeNode?.identifier, this.treeFromBackend);
12213
- if (!node) {
12214
- throw Error('Tree node does not exist');
12345
+ else {
12346
+ httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
12215
12347
  }
12216
- node.expanded = updatedTreeNode?.expanded;
12217
- node.childrenNodes = updatedTreeNode?.childrenNodes;
12218
- node.selected = updatedTreeNode?.selected;
12219
- treeNode = updatedTreeNode;
12220
- this.syncTree();
12221
- this.viewContext.getAndSyncViewContext(this.viewContext.getUuidOfPage(this.viewContextName));
12222
- }
12223
- async updateTreeOnTheFly() {
12224
- await this.initialize();
12348
+ return httpParams;
12225
12349
  }
12226
- async syncTree() {
12227
- await this.cacheActionDesciptors(this.getAllNodes(this.treeFromBackend));
12228
- if (!this.treeFromBackend) {
12229
- throw new Error('There is no treeFromBackend available!');
12230
- }
12231
- if (!this.smartTreeModel) {
12232
- this.smartTreeModel = {
12233
- rootNodes: [],
12234
- };
12350
+ addToHttpParamsRecursive(httpParams, value, key) {
12351
+ if (value == null) {
12352
+ return httpParams;
12235
12353
  }
12236
- let smartTreeNodes = this.createButtonsForTreeNodes(this.treeFromBackend);
12237
- this.smartTreeModel = undefined;
12238
- this.smartTreeModel = {
12239
- rootNodes: [],
12240
- };
12241
- this.smartTreeModelChanged.next(this.smartTreeModel);
12242
- this.smartTreeModel.rootNodes = smartTreeNodes;
12243
- this.findSelected(this.smartTreeModel.rootNodes);
12244
- this.smartTreeModelChanged.next(this.smartTreeModel);
12245
- }
12246
- deepSearchTreeNode(identifier, nodes) {
12247
- let treeNode;
12248
- for (let index = 0; index < nodes.length; index++) {
12249
- const node = nodes[index];
12250
- if (node.identifier === identifier) {
12251
- treeNode = node;
12252
- break;
12354
+ if (typeof value === "object") {
12355
+ if (Array.isArray(value)) {
12356
+ value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
12253
12357
  }
12254
- if (node.childrenNodes && node.childrenNodes.length) {
12255
- treeNode = this.deepSearchTreeNode(identifier, node.childrenNodes);
12256
- if (treeNode) {
12257
- break;
12358
+ else if (value instanceof Date) {
12359
+ if (key != null) {
12360
+ httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
12361
+ }
12362
+ else {
12363
+ throw Error("key may not be null if value is Date");
12258
12364
  }
12259
12365
  }
12366
+ else {
12367
+ Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
12368
+ }
12260
12369
  }
12261
- return treeNode;
12370
+ else if (key != null) {
12371
+ httpParams = httpParams.append(key, value);
12372
+ }
12373
+ else {
12374
+ throw Error("key may not be null if value is not object or array");
12375
+ }
12376
+ return httpParams;
12262
12377
  }
12263
- findSelected(nodes) {
12264
- return nodes.forEach((node) => {
12265
- if (node.selected) {
12266
- this.selectedNode = node;
12267
- return;
12378
+ nopePost(observe = 'body', reportProgress = false, options) {
12379
+ let localVarHeaders = this.defaultHeaders;
12380
+ let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
12381
+ if (localVarHttpHeaderAcceptSelected === undefined) {
12382
+ // to determine the Accept header
12383
+ const httpHeaderAccepts = [];
12384
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
12385
+ }
12386
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
12387
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
12388
+ }
12389
+ let localVarHttpContext = options && options.context;
12390
+ if (localVarHttpContext === undefined) {
12391
+ localVarHttpContext = new HttpContext();
12392
+ }
12393
+ let responseType_ = 'json';
12394
+ if (localVarHttpHeaderAcceptSelected) {
12395
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
12396
+ responseType_ = 'text';
12268
12397
  }
12269
- else if (node.childrenNodes && node.childrenNodes.length) {
12270
- return this.findSelected(node.childrenNodes);
12398
+ else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
12399
+ responseType_ = 'json';
12271
12400
  }
12272
- });
12273
- }
12274
- createButtonsForTreeNodes(nodes) {
12275
- nodes.map((node) => {
12276
- node.button = node.actions?.length
12277
- ? {
12278
- type: SmartTreeNodeButtonType.MENU,
12279
- icon: 'more_vert',
12280
- menuItemButtons: node.actions.map((action) => {
12281
- return {
12282
- type: SmartTreeNodeButtonType.NORMAL,
12283
- label: this.getLabelByAction(action),
12284
- callback: this.doAction.bind(this),
12285
- args: [action, node.identifier],
12286
- };
12287
- }),
12288
- }
12289
- : undefined;
12290
- node.icon = 'Folders';
12291
- if (node.childrenNodes) {
12292
- node.childrenNodes = this.createButtonsForTreeNodes(node.childrenNodes);
12401
+ else {
12402
+ responseType_ = 'blob';
12293
12403
  }
12294
- });
12295
- return nodes;
12296
- }
12297
- async doAction(args) {
12298
- let uiAction = args[0];
12299
- let nodeUuid = args[1];
12300
- if (uiAction.params) {
12301
- uiAction.params['nodeUuid'] = nodeUuid;
12302
- }
12303
- else {
12304
- uiAction.params = {
12305
- nodeUuid: nodeUuid,
12306
- };
12307
12404
  }
12308
- let uiActionModel = {
12309
- serviceToUse: this,
12310
- uiAction,
12311
- };
12312
- this.uiActionService.uiActionModel = uiActionModel;
12313
- this.uiActionService.execute(uiAction);
12314
- }
12315
- getAllNodes(nodes) {
12316
- return nodes.flatMap((n) => [n, ...this.getAllNodes(n.childrenNodes)]);
12317
- }
12318
- async cacheActionDesciptors(nodes) {
12319
- let newUiActions = new Set();
12320
- nodes.forEach((node) => {
12321
- node.actions
12322
- ?.filter((uiAction) => !this.uiActionDescriptors.get(uiAction.code))
12323
- .forEach((action) => newUiActions.add(action));
12405
+ let localVarPath = `/nope`;
12406
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
12407
+ context: localVarHttpContext,
12408
+ responseType: responseType_,
12409
+ withCredentials: this.configuration.withCredentials,
12410
+ headers: localVarHeaders,
12411
+ observe: observe,
12412
+ reportProgress: reportProgress
12324
12413
  });
12325
- for (let action of newUiActions) {
12326
- if (!this.uiActionDescriptors.get(action.code)) {
12327
- let descriptor = await this.uiActionDescriptorService.getActionDescriptor(action);
12328
- this.uiActionDescriptors.set(action.code, descriptor);
12329
- }
12414
+ }
12415
+ }
12416
+ DefaultService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DefaultService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH$1, optional: true }, { token: Configuration$1, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
12417
+ DefaultService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DefaultService, providedIn: 'root' });
12418
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DefaultService, decorators: [{
12419
+ type: Injectable,
12420
+ args: [{
12421
+ providedIn: 'root'
12422
+ }]
12423
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
12424
+ type: Optional
12425
+ }, {
12426
+ type: Inject,
12427
+ args: [BASE_PATH$1]
12428
+ }] }, { type: Configuration$1, decorators: [{
12429
+ type: Optional
12430
+ }] }]; } });
12431
+
12432
+ const APIS = [DefaultService];
12433
+
12434
+ /**
12435
+ * Form layout definition
12436
+ * Contains form layout definition objects.
12437
+ *
12438
+ * The version of the OpenAPI document: 1.0.0
12439
+ * Contact: info@it4all.hu
12440
+ *
12441
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12442
+ * https://openapi-generator.tech
12443
+ * Do not edit the class manually.
12444
+ */
12445
+ var ComponentType;
12446
+ (function (ComponentType) {
12447
+ ComponentType["CONTAINER"] = "container";
12448
+ ComponentType["FORM"] = "form";
12449
+ ComponentType["WIDGET"] = "widget";
12450
+ })(ComponentType || (ComponentType = {}));
12451
+
12452
+ /**
12453
+ * Form layout definition
12454
+ * Contains form layout definition objects.
12455
+ *
12456
+ * The version of the OpenAPI document: 1.0.0
12457
+ * Contact: info@it4all.hu
12458
+ *
12459
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12460
+ * https://openapi-generator.tech
12461
+ * Do not edit the class manually.
12462
+ */
12463
+ var ComponentWidgetType;
12464
+ (function (ComponentWidgetType) {
12465
+ ComponentWidgetType["GRID"] = "grid";
12466
+ ComponentWidgetType["FILTER"] = "filter";
12467
+ ComponentWidgetType["TREE"] = "tree";
12468
+ ComponentWidgetType["TOOLBAR"] = "toolbar";
12469
+ })(ComponentWidgetType || (ComponentWidgetType = {}));
12470
+
12471
+ /**
12472
+ * Form layout definition
12473
+ * Contains form layout definition objects.
12474
+ *
12475
+ * The version of the OpenAPI document: 1.0.0
12476
+ * Contact: info@it4all.hu
12477
+ *
12478
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12479
+ * https://openapi-generator.tech
12480
+ * Do not edit the class manually.
12481
+ */
12482
+ var LayoutDirection;
12483
+ (function (LayoutDirection) {
12484
+ LayoutDirection["HORIZONTAL"] = "horizontal";
12485
+ LayoutDirection["VERTICAL"] = "vertical";
12486
+ })(LayoutDirection || (LayoutDirection = {}));
12487
+
12488
+ class ApiModule {
12489
+ constructor(parentModule, http) {
12490
+ if (parentModule) {
12491
+ throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
12330
12492
  }
12331
- }
12332
- getLabelByAction(action) {
12333
- let desc = this.uiActionDescriptors.get(action.code);
12334
- return desc.title;
12335
- }
12336
- // #region UseUiAction
12337
- getAdditionalParams(uiAction) {
12338
- if (uiAction.params && uiAction.params['nodeUuid']) {
12339
- let nodeUuid = uiAction.params['nodeUuid'];
12340
- let nodeName;
12341
- if (uiAction.code === 'RENAME') {
12342
- nodeName = this.deepSearchTreeNode(nodeUuid, this.treeFromBackend)?.caption;
12343
- }
12344
- return {
12345
- forTextArea: '',
12346
- forTextField: nodeName ? nodeName : '',
12347
- };
12493
+ if (!http) {
12494
+ throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
12495
+ 'See also https://github.com/angular/angular/issues/20575');
12348
12496
  }
12497
+ }
12498
+ static forRoot(configurationFactory) {
12349
12499
  return {
12350
- forTextArea: '',
12351
- forTextField: '',
12500
+ ngModule: ApiModule,
12501
+ providers: [{ provide: Configuration$1, useFactory: configurationFactory }]
12352
12502
  };
12353
12503
  }
12354
- getModel() {
12355
- return {};
12356
- }
12357
- async performUiActionRequest(uiActionRequest) {
12358
- if (uiActionRequest.params['nodeUuid']) {
12359
- await this.performNodeUiActionRequest(uiActionRequest);
12360
- }
12361
- else {
12362
- await this.performMainUiActionRequest(uiActionRequest);
12363
- }
12364
- await this.viewContext.getAndSyncViewContext();
12365
- this.syncTree();
12366
- }
12367
- async performNodeUiActionRequest(uiActionRequest) {
12368
- let nodeId = uiActionRequest.params['nodeUuid'];
12369
- delete uiActionRequest.params['nodeUuid'];
12370
- let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
12371
- this.treeFromBackend = await this.viewContext.handlePerformActionResponse(await this.service.performAction2(viewUuid, this.treeId, nodeId, uiActionRequest).toPromise());
12372
- }
12373
- async performMainUiActionRequest(uiActionRequest) {
12374
- let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
12375
- this.treeFromBackend = await this.viewContext.handlePerformActionResponse(await this.service.performMainAction2(viewUuid, this.treeId, uiActionRequest).toPromise());
12376
- }
12377
- handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
12378
- throw new Error('Method not implemented.');
12379
- }
12380
12504
  }
12381
- SmarttreeGenericService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeGenericService, deps: [{ token: i0.Injector }, { token: 'pageName' }, { token: 'treeId' }], target: i0.ɵɵFactoryTarget.Injectable });
12382
- SmarttreeGenericServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeGenericService, providedIn: 'root' });
12383
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeGenericService, decorators: [{
12384
- type: Injectable,
12505
+ ApiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiModule, deps: [{ token: ApiModule, optional: true, skipSelf: true }, { token: i1.HttpClient, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
12506
+ ApiModulemod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiModule });
12507
+ ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiModule, providers: [], imports: [[]] });
12508
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiModule, decorators: [{
12509
+ type: NgModule,
12385
12510
  args: [{
12386
- providedIn: 'root',
12511
+ imports: [],
12512
+ declarations: [],
12513
+ exports: [],
12514
+ providers: []
12387
12515
  }]
12388
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: undefined, decorators: [{
12389
- type: Inject,
12390
- args: ['pageName']
12391
- }] }, { type: undefined, decorators: [{
12392
- type: Inject,
12393
- args: ['treeId']
12516
+ }], ctorParameters: function () { return [{ type: ApiModule, decorators: [{
12517
+ type: Optional
12518
+ }, {
12519
+ type: SkipSelf
12520
+ }] }, { type: i1.HttpClient, decorators: [{
12521
+ type: Optional
12394
12522
  }] }]; } });
12395
12523
 
12396
- class SmartTreeComponent {
12397
- constructor(cdr) {
12398
- this.cdr = cdr;
12524
+ /*
12525
+ * Public API Surface of smart-grid
12526
+ */
12527
+
12528
+ class SmartComponentLayoutComponent {
12529
+ constructor(layoutService) {
12530
+ this.layoutService = layoutService;
12399
12531
  this._destroy$ = new Subject();
12400
- this.treeControl = new NestedTreeControl((node) => node.childrenNodes);
12401
- this.dataSource = new MatTreeNestedDataSource();
12402
- this.smartTreeNodeButtonType = SmartTreeNodeButtonType;
12403
- this.uiActionModels = [];
12404
- this.hasChild = (_, node) => node.hasChildren;
12532
+ this.toolbarId = 'not_initialized_yet';
12405
12533
  }
12406
- ngOnInit() {
12407
- if (!this.treeService) {
12408
- throw new Error('TreeService has not been given!');
12534
+ ngAfterViewInit() {
12535
+ if (this.smartFormList?.first) {
12536
+ this.setFormComponent(this.smartFormList?.first);
12409
12537
  }
12410
- this.errorMessage = this.treeService.errorMessage;
12411
- this.treeService.smartTreeModelChanged.subscribe((newSmartTree) => {
12412
- this.treeData = newSmartTree;
12413
- this.dataSource.data = this.treeData.rootNodes;
12414
- this.expandTreeNodes();
12538
+ this.smartFormList.changes
12539
+ .pipe(takeUntil(this._destroy$))
12540
+ .subscribe((list) => {
12541
+ this.setFormComponent(list.first);
12415
12542
  });
12416
- this.treeService.uiActionModelsChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
12417
- if (this.treeService.uiActionModels) {
12418
- this.uiActionModels = this.treeService.uiActionModels;
12543
+ if (this.smartGridList?.first) {
12544
+ this.setGridComponent(this.smartGridList?.first);
12545
+ }
12546
+ this.smartGridList.changes
12547
+ .pipe(takeUntil(this._destroy$))
12548
+ .subscribe((list) => {
12549
+ this.setGridComponent(list.first);
12550
+ });
12551
+ this.smartFilterList.changes
12552
+ .pipe(takeUntil(this._destroy$))
12553
+ .subscribe((list) => {
12554
+ if (!this.smartFilterComponent) {
12555
+ this.smartFilterComponent = list.first;
12556
+ this.bindFilter();
12419
12557
  }
12420
12558
  });
12559
+ if (this.toolbarList?.first) {
12560
+ this.setToolbarComponent(this.toolbarList?.first);
12561
+ }
12562
+ this.toolbarList.changes
12563
+ .pipe(takeUntil(this._destroy$))
12564
+ .subscribe((list) => {
12565
+ this.setToolbarComponent(list.first);
12566
+ });
12567
+ if (this.smartComponentLayout) {
12568
+ this.setUp();
12569
+ }
12421
12570
  }
12422
12571
  ngOnDestroy() {
12423
12572
  this._destroy$.next();
12424
12573
  this._destroy$.complete();
12425
12574
  }
12426
- getIfExpanded(node) {
12427
- return this.treeControl.isExpanded(node);
12428
- }
12429
- expandTreeNodes() {
12430
- this.expandTreeNodesDeeply(this.dataSource.data);
12575
+ ngOnChanges(changes) {
12576
+ this.smartComponentLayout = changes['smartComponentLayout'].currentValue;
12577
+ if (this.smartComponentLayout) {
12578
+ this.setUp();
12579
+ }
12431
12580
  }
12432
- expandTreeNodesDeeply(nodes) {
12433
- nodes.forEach((node) => {
12434
- if (node.expanded) {
12435
- this.treeControl.expand(node);
12436
- this.cdr.markForCheck();
12437
- if (node.childrenNodes && node.childrenNodes.length) {
12438
- this.expandTreeNodesDeeply(node.childrenNodes);
12439
- }
12581
+ setUp() {
12582
+ this.parent = this.smartComponentLayout?.parentComponent;
12583
+ this.uuid = this.parent.uuid;
12584
+ this.treeService = this.parent.smartTreeService;
12585
+ if (this.smartComponentLayout?.expandable) {
12586
+ this.constructExpandableSection();
12587
+ }
12588
+ else if (this.smartComponentLayout?.type === ComponentType.FORM) {
12589
+ this.constructForm();
12590
+ }
12591
+ else if (this.smartComponentLayout?.type === ComponentType.WIDGET) {
12592
+ if (this.smartComponentLayout.widget?.type === ComponentWidgetType.GRID) {
12593
+ this.constructGrid();
12440
12594
  }
12441
- else {
12442
- this.treeControl.collapse(node);
12595
+ else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.FILTER) {
12596
+ this.constructFilter();
12443
12597
  }
12444
- });
12445
- }
12446
- onNodeClick(event, node) {
12447
- event.stopPropagation();
12448
- if (this.tempActiveNode)
12449
- this.tempActiveNode.selected = false;
12450
- node.selected = true;
12451
- this.tempActiveNode = node;
12452
- this.treeService.onTreeNodeClick(node);
12453
- }
12454
- onOpenNode(event, node) {
12455
- event.stopPropagation();
12456
- this.treeService.onTreeNodeOpen(node);
12457
- }
12458
- getNodeStyle(node) {
12459
- if (this.treeStyle) {
12460
- var style = node.selected
12461
- ? {
12462
- background: this.treeStyle.activeStyle?.backgroundColor,
12463
- color: this.treeStyle.activeStyle?.color,
12464
- }
12465
- : {
12466
- background: this.treeStyle.levelBackgroundColor[node.level],
12467
- color: this.treeStyle.color,
12468
- };
12469
- return style;
12598
+ else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.TREE) {
12599
+ this.constructTree();
12600
+ }
12601
+ else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.TOOLBAR) {
12602
+ this.constructToolbar();
12603
+ }
12604
+ this.parent.initActions();
12470
12605
  }
12471
- return {};
12472
12606
  }
12473
- getNodePadding(node) {
12474
- if (this.treeStyle) {
12475
- var style = node.selected
12476
- ? {
12477
- 'padding-left': 15 * node.level + 'px',
12478
- }
12479
- : {
12480
- 'padding-left': 15 * node.level + 'px',
12481
- };
12482
- return style;
12483
- }
12484
- return {};
12607
+ type() {
12608
+ return ComponentType;
12485
12609
  }
12486
- customButtonClicked(event, button, close) {
12487
- event.stopPropagation();
12488
- if (button.type === SmartTreeNodeButtonType.MENU) {
12489
- return;
12490
- }
12491
- if (!button.callback) {
12492
- throw new Error(`Button with name ${button.label || button.icon} does not have a callback!`);
12493
- }
12494
- button.callback(button.args);
12495
- if (close) {
12496
- let openMenus = this.trigger.filter((matMenuTrigger) => matMenuTrigger.menuOpen);
12497
- openMenus.forEach((matMenuTrigger) => {
12498
- matMenuTrigger.closeMenu();
12499
- });
12500
- }
12610
+ constructExpandableSection() {
12611
+ let data = { ...this.smartComponentLayout };
12612
+ data.expandable = false;
12613
+ this.expandableSection = {
12614
+ title: this.smartComponentLayout?.expandableSectionLabel ?? '',
12615
+ data,
12616
+ inputName: 'smartComponentLayout',
12617
+ customComponent: SmartComponentLayoutComponent,
12618
+ };
12619
+ }
12620
+ constructForm() {
12621
+ const widgets = this.layoutService.render({
12622
+ layoutDefinitions: this.smartComponentLayout?.form,
12623
+ });
12624
+ this.smartForm = {
12625
+ direction: SmartFormWidgetDirection.COL,
12626
+ componentModel: this.parent?.model,
12627
+ widgets,
12628
+ };
12629
+ this.bindForm();
12501
12630
  }
12502
- getClassesForTreeNode(node) {
12503
- let classes = [];
12504
- if (node.expanded) {
12505
- classes.push(this.getCustomClass('expanded', node.level));
12506
- }
12507
- else {
12508
- classes.push(this.getCustomClass('collapsed', node.level));
12509
- }
12510
- if (node.selected) {
12511
- classes.push(this.getCustomClass('selected', node.level));
12512
- }
12513
- else {
12514
- classes.push(this.getCustomClass('unselected', node.level));
12515
- }
12516
- if (node.level !== 0) {
12517
- classes.push(this.getCustomClass('child', node.level));
12631
+ setFormComponent(comp) {
12632
+ if (!this.smartFormComponent) {
12633
+ this.smartFormComponent = comp;
12634
+ this.bindForm();
12518
12635
  }
12519
- return classes;
12520
12636
  }
12521
- getInnerClassesForTreeNode(node) {
12522
- let classes = [];
12523
- if (node.expanded) {
12524
- classes.push(this.getCustomClass('inner-expanded', node.level));
12637
+ bindForm() {
12638
+ if (this.smartForm && this.smartFormComponent) {
12639
+ this.parent?.addForm(
12640
+ // unique identifier for the form
12641
+ `form_${this.makeid(5)}`, this.smartForm, this.smartFormComponent);
12525
12642
  }
12526
- else {
12527
- classes.push(this.getCustomClass('inner-collapsed', node.level));
12643
+ }
12644
+ makeid(length) {
12645
+ let result = '';
12646
+ const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
12647
+ const charactersLength = characters.length;
12648
+ let counter = 0;
12649
+ while (counter < length) {
12650
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
12651
+ counter += 1;
12528
12652
  }
12529
- if (node.selected) {
12530
- classes.push(this.getCustomClass('inner-selected', node.level));
12653
+ return result;
12654
+ }
12655
+ constructGrid() {
12656
+ this.smartGrid = {
12657
+ gridIdentifier: this.smartComponentLayout?.widget?.identifier,
12658
+ gridModel: {
12659
+ page: {},
12660
+ },
12661
+ options: {
12662
+ rowUiActionType: GridUiActionType.POPUP_MENU,
12663
+ },
12664
+ layoutDef: SmartLayoutDef.TABLE,
12665
+ paginator: true,
12666
+ };
12667
+ this.bindGrid();
12668
+ }
12669
+ setGridComponent(comp) {
12670
+ if (!this.smartGridComponent) {
12671
+ this.smartGridComponent = comp;
12672
+ this.bindGrid();
12531
12673
  }
12532
- else {
12533
- classes.push(this.getCustomClass('inner-unselected', node.level));
12674
+ }
12675
+ bindGrid() {
12676
+ if (this.smartGrid && this.smartGridComponent) {
12677
+ this.smartGrid = this.parent?.addGrid(this.smartGrid, {
12678
+ rowUiActionType: GridUiActionType.POPUP_MENU,
12679
+ }, false, this.smartGridComponent);
12534
12680
  }
12535
- return classes;
12536
12681
  }
12537
- getClassesForTreeNodeChildren(node) {
12538
- let classes = [];
12539
- classes.push(this.getCustomClass('group', node.level));
12540
- return classes;
12682
+ setToolbarComponent(comp) {
12683
+ this.toolbar = comp;
12541
12684
  }
12542
- getCustomClass(cssClass, plusProperty) {
12543
- return `${cssClass}-${plusProperty}`;
12685
+ constructFilter() {
12686
+ this.smartFilter = this.smartComponentLayout.parentComponent.addFilter(`filter_${this.makeid(5)}`, this.smartComponentLayout?.widget?.filterExpressionFieldList, this.smartComponentLayout?.widget?.filterType, this.smartFilterComponent);
12687
+ }
12688
+ bindFilter() {
12689
+ // TODO
12690
+ }
12691
+ constructTree() {
12692
+ this.parent.setUpDefaultTree(this.smartComponentLayout?.widget?.identifier);
12693
+ this.treeService?.initialize();
12694
+ }
12695
+ constructToolbar() {
12696
+ let toolbarId = this.smartComponentLayout?.widget?.identifier;
12697
+ if (this.toolbarId !== toolbarId) {
12698
+ this.toolbarId = toolbarId;
12699
+ }
12544
12700
  }
12545
12701
  }
12546
- SmartTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTreeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
12547
- SmartTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartTreeComponent, selector: "smart-tree", inputs: { treeStyle: "treeStyle", treeService: "treeService" }, viewQueries: [{ propertyName: "tree", first: true, predicate: ["tree"], descendants: true }, { propertyName: "trigger", predicate: MatMenuTrigger, descendants: true }], ngImport: i0, template: "<div class=\"smartTreeContainer\">\r\n <smart-ui-action-toolbar\r\n *ngIf=\"uiActionModels.length\"\r\n [uiActionModels]=\"uiActionModels\"\r\n ></smart-ui-action-toolbar>\r\n <mat-tree\r\n #tree\r\n *ngIf=\"treeData\"\r\n [dataSource]=\"dataSource\"\r\n [treeControl]=\"treeControl\"\r\n class=\"sm-tree\"\r\n >\r\n <mat-nested-tree-node\r\n *matTreeNodeDef=\"let node; when: hasChild\"\r\n matTreeNodeToggle=\"{{ getIfExpanded(node) }}\"\r\n [ngClass]=\"getClassesForTreeNode(node)\"\r\n [ngStyle]=\"getNodeStyle(node)\"\r\n >\r\n <div\r\n [ngStyle]=\"getNodePadding(node)\"\r\n [ngClass]=\"getInnerClassesForTreeNode(node)\"\r\n class=\"mat-tree-node sm-tree-node\"\r\n (click)=\"onNodeClick($event, node)\"\r\n >\r\n <button mat-icon-button [attr.aria-label]=\"'Toggle ' + node.name\">\r\n <mat-icon\r\n class=\"mat-icon-rtl-mirror\"\r\n matTreeNodeToggle\r\n (click)=\"onOpenNode($event, node)\"\r\n >\r\n <div *ngIf=\"hasChild(node.level, node)\">\r\n {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\r\n </div>\r\n </mat-icon>\r\n </button>\r\n <smart-icon [icon]=\"node.icon\"> </smart-icon>\r\n <div class=\"sm-tree-row\" [ngClass]=\"node.classes\">\r\n <div class=\"sm-tree-row-caption\">\r\n {{ node.caption }}\r\n </div>\r\n <div class=\"sm-shortDescription-spacer\"></div>\r\n <div class=\"sm-tree-row-shortDescription\">\r\n {{ node.shortDescription }}\r\n </div>\r\n <div class=\"sm-shortDescription-button-spacer\"></div>\r\n <div *ngIf=\"node.button\" class=\"sm-tree-node-button\" [ngSwitch]=\"node.button.type\">\r\n <button\r\n (click)=\"customButtonClicked($event, node.button)\"\r\n *ngSwitchCase=\"smartTreeNodeButtonType.ICON\"\r\n mat-icon-button\r\n >\r\n <smart-icon title=\"{{ node.button.icon }}\" [icon]=\"node.button.icon\"></smart-icon>\r\n </button>\r\n <div *ngSwitchCase=\"smartTreeNodeButtonType.MENU\">\r\n <button\r\n mat-button\r\n [matMenuTriggerFor]=\"menu\"\r\n (click)=\"customButtonClicked($event, node.button, true)\"\r\n >\r\n <smart-icon *ngIf=\"node.button.icon\" [icon]=\"node.button.icon\"></smart-icon\r\n >{{ node.button.label }}\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n *ngFor=\"let button of node.button.menuItemButtons\"\r\n (click)=\"customButtonClicked($event, button, true)\"\r\n mat-menu-item\r\n >\r\n <smart-icon *ngIf=\"button.icon\" [icon]=\"button.icon\"></smart-icon\r\n >{{ button.label }}\r\n </button>\r\n </mat-menu>\r\n </div>\r\n <button\r\n (click)=\"customButtonClicked($event, node.button)\"\r\n *ngSwitchCase=\"smartTreeNodeButtonType.NORMAL\"\r\n mat-raised-button\r\n >\r\n <smart-icon *ngIf=\"node.button.icon\" [icon]=\"node.button.icon\"></smart-icon>\r\n {{ node.button.icon }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div\r\n [class.sm-tree-invisible]=\"!treeControl.isExpanded(node)\"\r\n [ngClass]=\"getClassesForTreeNodeChildren(node)\"\r\n role=\"group\"\r\n >\r\n <ng-container matTreeNodeOutlet></ng-container>\r\n </div>\r\n </mat-nested-tree-node>\r\n </mat-tree>\r\n <div *ngIf=\"!treeData\">\r\n <h3>\r\n {{ errorMessage }}\r\n </h3>\r\n </div>\r\n</div>\r\n", styles: [".smartTreeContainer{display:flex;flex-direction:column;gap:.5rem}.sm-tree-invisible{display:none}.sm-tree ul,.sm-tree li{margin-top:0;margin-bottom:0;list-style-type:none}.sm-tree div[role=group]>.mat-tree-node{padding-left:40px}.sm-tee-node{padding-left:40px}.sm-tree-node-name{padding-left:15px;padding-top:15px;display:flex;flex-direction:column}.sm-tree-node-name-row{padding-left:15px;padding-top:15px;display:flex;flex-direction:row;justify-content:space-between}.sm-tree-node-name-col{padding-left:15px;padding-top:15px;display:flex;flex-direction:column}.sm-tee-node-id{font-weight:lighter}.mat-tree-node:hover{cursor:pointer}::ng-deep .mat-icon-rtl-mirror{display:flex;flex-direction:row}.sm-tree-row{display:flex;flex-direction:row;flex:1;align-items:center}.sm-shortDescription-spacer{flex:1}\n"], components: [{ type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id"] }, { type: i10$1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { type: i5.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10$1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { type: i10$1.MatNestedTreeNode, selector: "mat-nested-tree-node", inputs: ["role", "disabled", "tabIndex", "matNestedTreeNode"], exportAs: ["matNestedTreeNode"] }, { type: i10$1.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10$1.MatTreeNodeOutlet, selector: "[matTreeNodeOutlet]" }] });
12548
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTreeComponent, decorators: [{
12702
+ SmartComponentLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutComponent, deps: [{ token: SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
12703
+ 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: "toolbarList", predicate: ["toolbar"], 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 <smart-ui-action-toolbar #toolbar [id]=\"toolbarId\"></smart-ui-action-toolbar>\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"] }, { type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id"] }], 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"] }] });
12704
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutComponent, decorators: [{
12549
12705
  type: Component,
12550
- args: [{ selector: 'smart-tree', template: "<div class=\"smartTreeContainer\">\r\n <smart-ui-action-toolbar\r\n *ngIf=\"uiActionModels.length\"\r\n [uiActionModels]=\"uiActionModels\"\r\n ></smart-ui-action-toolbar>\r\n <mat-tree\r\n #tree\r\n *ngIf=\"treeData\"\r\n [dataSource]=\"dataSource\"\r\n [treeControl]=\"treeControl\"\r\n class=\"sm-tree\"\r\n >\r\n <mat-nested-tree-node\r\n *matTreeNodeDef=\"let node; when: hasChild\"\r\n matTreeNodeToggle=\"{{ getIfExpanded(node) }}\"\r\n [ngClass]=\"getClassesForTreeNode(node)\"\r\n [ngStyle]=\"getNodeStyle(node)\"\r\n >\r\n <div\r\n [ngStyle]=\"getNodePadding(node)\"\r\n [ngClass]=\"getInnerClassesForTreeNode(node)\"\r\n class=\"mat-tree-node sm-tree-node\"\r\n (click)=\"onNodeClick($event, node)\"\r\n >\r\n <button mat-icon-button [attr.aria-label]=\"'Toggle ' + node.name\">\r\n <mat-icon\r\n class=\"mat-icon-rtl-mirror\"\r\n matTreeNodeToggle\r\n (click)=\"onOpenNode($event, node)\"\r\n >\r\n <div *ngIf=\"hasChild(node.level, node)\">\r\n {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\r\n </div>\r\n </mat-icon>\r\n </button>\r\n <smart-icon [icon]=\"node.icon\"> </smart-icon>\r\n <div class=\"sm-tree-row\" [ngClass]=\"node.classes\">\r\n <div class=\"sm-tree-row-caption\">\r\n {{ node.caption }}\r\n </div>\r\n <div class=\"sm-shortDescription-spacer\"></div>\r\n <div class=\"sm-tree-row-shortDescription\">\r\n {{ node.shortDescription }}\r\n </div>\r\n <div class=\"sm-shortDescription-button-spacer\"></div>\r\n <div *ngIf=\"node.button\" class=\"sm-tree-node-button\" [ngSwitch]=\"node.button.type\">\r\n <button\r\n (click)=\"customButtonClicked($event, node.button)\"\r\n *ngSwitchCase=\"smartTreeNodeButtonType.ICON\"\r\n mat-icon-button\r\n >\r\n <smart-icon title=\"{{ node.button.icon }}\" [icon]=\"node.button.icon\"></smart-icon>\r\n </button>\r\n <div *ngSwitchCase=\"smartTreeNodeButtonType.MENU\">\r\n <button\r\n mat-button\r\n [matMenuTriggerFor]=\"menu\"\r\n (click)=\"customButtonClicked($event, node.button, true)\"\r\n >\r\n <smart-icon *ngIf=\"node.button.icon\" [icon]=\"node.button.icon\"></smart-icon\r\n >{{ node.button.label }}\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n *ngFor=\"let button of node.button.menuItemButtons\"\r\n (click)=\"customButtonClicked($event, button, true)\"\r\n mat-menu-item\r\n >\r\n <smart-icon *ngIf=\"button.icon\" [icon]=\"button.icon\"></smart-icon\r\n >{{ button.label }}\r\n </button>\r\n </mat-menu>\r\n </div>\r\n <button\r\n (click)=\"customButtonClicked($event, node.button)\"\r\n *ngSwitchCase=\"smartTreeNodeButtonType.NORMAL\"\r\n mat-raised-button\r\n >\r\n <smart-icon *ngIf=\"node.button.icon\" [icon]=\"node.button.icon\"></smart-icon>\r\n {{ node.button.icon }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div\r\n [class.sm-tree-invisible]=\"!treeControl.isExpanded(node)\"\r\n [ngClass]=\"getClassesForTreeNodeChildren(node)\"\r\n role=\"group\"\r\n >\r\n <ng-container matTreeNodeOutlet></ng-container>\r\n </div>\r\n </mat-nested-tree-node>\r\n </mat-tree>\r\n <div *ngIf=\"!treeData\">\r\n <h3>\r\n {{ errorMessage }}\r\n </h3>\r\n </div>\r\n</div>\r\n", styles: [".smartTreeContainer{display:flex;flex-direction:column;gap:.5rem}.sm-tree-invisible{display:none}.sm-tree ul,.sm-tree li{margin-top:0;margin-bottom:0;list-style-type:none}.sm-tree div[role=group]>.mat-tree-node{padding-left:40px}.sm-tee-node{padding-left:40px}.sm-tree-node-name{padding-left:15px;padding-top:15px;display:flex;flex-direction:column}.sm-tree-node-name-row{padding-left:15px;padding-top:15px;display:flex;flex-direction:row;justify-content:space-between}.sm-tree-node-name-col{padding-left:15px;padding-top:15px;display:flex;flex-direction:column}.sm-tee-node-id{font-weight:lighter}.mat-tree-node:hover{cursor:pointer}::ng-deep .mat-icon-rtl-mirror{display:flex;flex-direction:row}.sm-tree-row{display:flex;flex-direction:row;flex:1;align-items:center}.sm-shortDescription-spacer{flex:1}\n"] }]
12551
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { trigger: [{
12552
- type: ViewChildren,
12553
- args: [MatMenuTrigger]
12554
- }], tree: [{
12555
- type: ViewChild,
12556
- args: ['tree']
12557
- }], treeStyle: [{
12558
- type: Input
12559
- }], treeService: [{
12706
+ 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 <smart-ui-action-toolbar #toolbar [id]=\"toolbarId\"></smart-ui-action-toolbar>\r\n</ng-template>\r\n", styles: [".horizontal{display:flex;flex-direction:row}.vertical{display:flex;flex-direction:column}\n"] }]
12707
+ }], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }]; }, propDecorators: { smartComponentLayout: [{
12560
12708
  type: Input
12709
+ }], smartFormList: [{
12710
+ type: ViewChildren,
12711
+ args: ['form']
12712
+ }], smartGridList: [{
12713
+ type: ViewChildren,
12714
+ args: ['grid']
12715
+ }], smartFilterList: [{
12716
+ type: ViewChildren,
12717
+ args: ['filter']
12718
+ }], toolbarList: [{
12719
+ type: ViewChildren,
12720
+ args: ['toolbar']
12721
+ }], components: [{
12722
+ type: ViewChildren,
12723
+ args: [SmartComponentLayoutComponent]
12561
12724
  }] } });
12562
12725
 
12563
- class SmarttreeModule {
12726
+ class SmartComponentLayoutModule {
12564
12727
  }
12565
- SmarttreeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
12566
- SmarttreeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeModule, declarations: [SmartTreeComponent], imports: [BrowserModule,
12728
+ SmartComponentLayoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
12729
+ SmartComponentLayoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutModule, declarations: [SmartComponentLayoutComponent], imports: [BrowserModule,
12567
12730
  MatCommonModule,
12568
- MatButtonModule,
12569
- MatIconModule,
12570
- MatTreeModule,
12571
- MatMenuModule,
12572
- SmartIconModule,
12573
- SmartViewContextModule], exports: [SmartTreeComponent] });
12574
- SmarttreeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeModule, providers: [SmarttreeService, SmarttreeGenericService], imports: [[
12731
+ SmartformModule,
12732
+ SmartGridModule,
12733
+ SmartExpandableSectionModule,
12734
+ SmarttreeModule,
12735
+ SmartViewContextModule], exports: [SmartComponentLayoutComponent] });
12736
+ SmartComponentLayoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutModule, providers: [], imports: [[
12575
12737
  BrowserModule,
12576
12738
  MatCommonModule,
12577
- MatButtonModule,
12578
- MatIconModule,
12579
- MatTreeModule,
12580
- MatMenuModule,
12581
- SmartIconModule,
12739
+ SmartformModule,
12740
+ SmartGridModule,
12741
+ SmartExpandableSectionModule,
12742
+ SmarttreeModule,
12582
12743
  SmartViewContextModule,
12583
12744
  ]] });
12584
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeModule, decorators: [{
12745
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutModule, decorators: [{
12585
12746
  type: NgModule,
12586
12747
  args: [{
12587
- declarations: [SmartTreeComponent],
12748
+ declarations: [SmartComponentLayoutComponent],
12588
12749
  imports: [
12589
12750
  BrowserModule,
12590
12751
  MatCommonModule,
12591
- MatButtonModule,
12592
- MatIconModule,
12593
- MatTreeModule,
12594
- MatMenuModule,
12595
- SmartIconModule,
12752
+ SmartformModule,
12753
+ SmartGridModule,
12754
+ SmartExpandableSectionModule,
12755
+ SmarttreeModule,
12596
12756
  SmartViewContextModule,
12597
12757
  ],
12598
- exports: [SmartTreeComponent],
12599
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
12600
- providers: [SmarttreeService, SmarttreeGenericService],
12758
+ exports: [SmartComponentLayoutComponent],
12759
+ providers: [],
12601
12760
  }]
12602
12761
  }] });
12603
12762
 
12604
- /**
12605
- * Custom HttpParameterCodec
12606
- * Workaround for https://github.com/angular/angular/issues/18261
12607
- */
12608
- class CustomHttpParameterCodec$1 {
12609
- encodeKey(k) {
12610
- return encodeURIComponent(k);
12611
- }
12612
- encodeValue(v) {
12613
- return encodeURIComponent(v);
12614
- }
12615
- decodeKey(k) {
12616
- return decodeURIComponent(k);
12617
- }
12618
- decodeValue(v) {
12619
- return decodeURIComponent(v);
12763
+ class SmartFilterParamComponent {
12764
+ constructor() { }
12765
+ onItemClick(item) {
12766
+ this.data.serviceToUse.peformWidgetAction({
12767
+ code: 'ADD_FILTER_EXPRESSION',
12768
+ params: {
12769
+ model: item,
12770
+ },
12771
+ });
12620
12772
  }
12621
- }
12622
-
12623
- const BASE_PATH$1 = new InjectionToken('basePath');
12624
- const COLLECTION_FORMATS$1 = {
12625
- 'csv': ',',
12626
- 'tsv': ' ',
12627
- 'ssv': ' ',
12628
- 'pipes': '|'
12629
- };
12773
+ }
12774
+ SmartFilterParamComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
12775
+ SmartFilterParamComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterParamComponent, selector: "app-target-group-filter-param", inputs: { data: "data" }, ngImport: i0, template: "<div class=\"targetGroupFilterParamContainer\">\r\n <div\r\n class=\"targetGroupFilterItem\"\r\n *ngFor=\"let data of data?.group\"\r\n (click)=\"onItemClick(data)\"\r\n >\r\n <smart-icon icon=\"Ic24_Chevron_Right\" color=\"gray\"></smart-icon>\r\n <div class=\"mat-caption\">\r\n {{ data.label }}\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamContainer{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterItem{padding:.75rem;border-radius:.25rem;display:flex;flex-direction:row;gap:.5rem;cursor:pointer}.targetGroupFilterItem .mat-caption{margin:auto 0}\n"], components: [{ type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }], directives: [{ type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
12776
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, decorators: [{
12777
+ type: Component,
12778
+ args: [{ selector: 'app-target-group-filter-param', template: "<div class=\"targetGroupFilterParamContainer\">\r\n <div\r\n class=\"targetGroupFilterItem\"\r\n *ngFor=\"let data of data?.group\"\r\n (click)=\"onItemClick(data)\"\r\n >\r\n <smart-icon icon=\"Ic24_Chevron_Right\" color=\"gray\"></smart-icon>\r\n <div class=\"mat-caption\">\r\n {{ data.label }}\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamContainer{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterItem{padding:.75rem;border-radius:.25rem;display:flex;flex-direction:row;gap:.5rem;cursor:pointer}.targetGroupFilterItem .mat-caption{margin:auto 0}\n"] }]
12779
+ }], ctorParameters: function () { return []; }, propDecorators: { data: [{
12780
+ type: Input
12781
+ }] } });
12630
12782
 
12631
- class Configuration$1 {
12632
- constructor(configurationParameters = {}) {
12633
- this.apiKeys = configurationParameters.apiKeys;
12634
- this.username = configurationParameters.username;
12635
- this.password = configurationParameters.password;
12636
- this.accessToken = configurationParameters.accessToken;
12637
- this.basePath = configurationParameters.basePath;
12638
- this.withCredentials = configurationParameters.withCredentials;
12639
- this.encoder = configurationParameters.encoder;
12640
- if (configurationParameters.encodeParam) {
12641
- this.encodeParam = configurationParameters.encodeParam;
12642
- }
12643
- else {
12644
- this.encodeParam = param => this.defaultEncodeParam(param);
12645
- }
12646
- if (configurationParameters.credentials) {
12647
- this.credentials = configurationParameters.credentials;
12648
- }
12649
- else {
12650
- this.credentials = {};
12651
- }
12783
+ class SmartFilterParamsComponent {
12784
+ constructor() {
12785
+ this._destroy$ = new Subject();
12786
+ this.expandableSections = [];
12652
12787
  }
12653
- /**
12654
- * Select the correct content-type to use for a request.
12655
- * Uses {@link Configuration#isJsonMime} to determine the correct content-type.
12656
- * If no content type is found return the first found type if the contentTypes is not empty
12657
- * @param contentTypes - the array of content types that are available for selection
12658
- * @returns the selected content-type or <code>undefined</code> if no selection could be made.
12659
- */
12660
- selectHeaderContentType(contentTypes) {
12661
- if (contentTypes.length === 0) {
12662
- return undefined;
12663
- }
12664
- const type = contentTypes.find((x) => this.isJsonMime(x));
12665
- if (type === undefined) {
12666
- return contentTypes[0];
12667
- }
12668
- return type;
12788
+ ngOnInit() {
12789
+ this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
12790
+ this.setUp(this.service.model);
12791
+ });
12792
+ this.setUp(this.service.model);
12793
+ }
12794
+ ngOnDestroy() {
12795
+ this._destroy$.next();
12796
+ this._destroy$.complete();
12669
12797
  }
12670
- /**
12671
- * Select the correct accept content-type to use for a request.
12672
- * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
12673
- * If no content type is found return the first found type if the contentTypes is not empty
12674
- * @param accepts - the array of content types that are available for selection.
12675
- * @returns the selected content-type or <code>undefined</code> if no selection could be made.
12676
- */
12677
- selectHeaderAccept(accepts) {
12678
- if (accepts.length === 0) {
12679
- return undefined;
12798
+ setUp(model) {
12799
+ if (model?.model) {
12800
+ this.filterBuilder = model.model;
12801
+ this.constructExpandableSections();
12680
12802
  }
12681
- const type = accepts.find((x) => this.isJsonMime(x));
12682
- if (type === undefined) {
12683
- return accepts[0];
12803
+ }
12804
+ constructExpandableSections() {
12805
+ if (this.filterBuilder.groups) {
12806
+ this.expandableSections = this.filterBuilder.groups.map((filterExpressionBuilderGroup) => {
12807
+ return {
12808
+ title: filterExpressionBuilderGroup.label,
12809
+ cssClass: 'filterExpressionBuilderGroup',
12810
+ customComponent: SmartFilterParamComponent,
12811
+ data: {
12812
+ group: filterExpressionBuilderGroup.fields,
12813
+ serviceToUse: this.service,
12814
+ },
12815
+ inputName: 'data',
12816
+ isExpanded: true,
12817
+ };
12818
+ });
12684
12819
  }
12685
- return type;
12686
12820
  }
12687
- /**
12688
- * Check if the given MIME is a JSON MIME.
12689
- * JSON MIME examples:
12690
- * application/json
12691
- * application/json; charset=UTF8
12692
- * APPLICATION/JSON
12693
- * application/vnd.company+json
12694
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
12695
- * @return True if the given MIME is JSON, false otherwise.
12696
- */
12697
- isJsonMime(mime) {
12698
- const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
12699
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
12821
+ }
12822
+ SmartFilterParamsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
12823
+ SmartFilterParamsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterParamsComponent, selector: "smart-filter-group-params", inputs: { service: "service" }, viewQueries: [{ propertyName: "filterVcRef", first: true, predicate: ["smartFilter"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div\r\n class=\"targetGroupFilterParamsContainer\"\r\n *ngIf=\"service.model?.showGroups && !service.model?.readOnly\"\r\n>\r\n <!-- <ng-template #smartFilter></ng-template> -->\r\n <!-- <div class=\"dataSource-options\" *ngIf=\"service.model?.extarnalDatabase\">\r\n <div class=\"dataSource-btns\">\r\n <div class=\"dataSource-btn\">K\u00FCls\u0151 adatb\u00E1zis</div>\r\n <div class=\"dataSource-btn dataSource-btn-disabled\">Bels\u0151 adatb\u00E1zis</div>\r\n </div>\r\n <div class=\"dataSource-add-database\">\r\n <div class=\"dataSource-add-database-title\">\r\n <smart-icon icon=\"Ic24_View_Table\" color=\"sucess\"></smart-icon>\r\n Adatb\u00E1zis\r\n </div>\r\n <button title=\"add\" mat-icon-button (click)=\"addDataSource()\">\r\n <smart-icon icon=\"Ic24_Plus_Circle\" color=\"success\"></smart-icon>\r\n </button>\r\n </div>\r\n </div> -->\r\n <div class=\"sections\">\r\n <smart-expandable-section\r\n class=\"excel\"\r\n *ngIf=\"expandableSectionsFromExcel\"\r\n [data]=\"expandableSectionsFromExcel!\"\r\n ></smart-expandable-section>\r\n <smart-expandable-section\r\n [data]=\"data\"\r\n *ngFor=\"let data of expandableSections\"\r\n ></smart-expandable-section>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamsContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;border-right:2px solid var(--primary-dark-color)}.sections{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-body{background-color:var(--success-lighter-color)}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--success-color)!important}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-body{padding:0 0 0 1rem!important;background-color:var(--light-blue-color)}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header{background-color:var(--primary-light-color);padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header-title{color:var(--primary-lighter-color);font-weight:600}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--accent-color)!important;padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded .mat-expansion-panel-header-title{color:#fff}.dataSource-btns{display:flex;flex-direction:row;justify-content:space-around;background-color:var(--success-lighter-color);height:44px;padding:8px 12px;align-items:center;border:1.5px solid var(--success-color);border-left:6px solid var(--success-color);border-radius:4px}.dataSource-btn{display:flex;padding:1rem 2rem;justify-content:center;align-items:center;background-color:var(--success-color);border-radius:4px;cursor:pointer}.dataSource-btn-disabled{background-color:var(--success-lighter-color);cursor:auto}.dataSource-add-database{display:flex;flex-direction:row;justify-content:space-between;background-color:var(--success-lighter-color);padding:8px;border-radius:4px}.dataSource-add-database-title{display:flex;flex-direction:row;gap:1rem;align-items:center}.dataSource-options{display:flex;flex-direction:column;gap:1rem}\n"], components: [{ type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
12824
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, decorators: [{
12825
+ type: Component,
12826
+ args: [{ selector: 'smart-filter-group-params', template: "<div\r\n class=\"targetGroupFilterParamsContainer\"\r\n *ngIf=\"service.model?.showGroups && !service.model?.readOnly\"\r\n>\r\n <!-- <ng-template #smartFilter></ng-template> -->\r\n <!-- <div class=\"dataSource-options\" *ngIf=\"service.model?.extarnalDatabase\">\r\n <div class=\"dataSource-btns\">\r\n <div class=\"dataSource-btn\">K\u00FCls\u0151 adatb\u00E1zis</div>\r\n <div class=\"dataSource-btn dataSource-btn-disabled\">Bels\u0151 adatb\u00E1zis</div>\r\n </div>\r\n <div class=\"dataSource-add-database\">\r\n <div class=\"dataSource-add-database-title\">\r\n <smart-icon icon=\"Ic24_View_Table\" color=\"sucess\"></smart-icon>\r\n Adatb\u00E1zis\r\n </div>\r\n <button title=\"add\" mat-icon-button (click)=\"addDataSource()\">\r\n <smart-icon icon=\"Ic24_Plus_Circle\" color=\"success\"></smart-icon>\r\n </button>\r\n </div>\r\n </div> -->\r\n <div class=\"sections\">\r\n <smart-expandable-section\r\n class=\"excel\"\r\n *ngIf=\"expandableSectionsFromExcel\"\r\n [data]=\"expandableSectionsFromExcel!\"\r\n ></smart-expandable-section>\r\n <smart-expandable-section\r\n [data]=\"data\"\r\n *ngFor=\"let data of expandableSections\"\r\n ></smart-expandable-section>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamsContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;border-right:2px solid var(--primary-dark-color)}.sections{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-body{background-color:var(--success-lighter-color)}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--success-color)!important}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-body{padding:0 0 0 1rem!important;background-color:var(--light-blue-color)}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header{background-color:var(--primary-light-color);padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header-title{color:var(--primary-lighter-color);font-weight:600}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--accent-color)!important;padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded .mat-expansion-panel-header-title{color:#fff}.dataSource-btns{display:flex;flex-direction:row;justify-content:space-around;background-color:var(--success-lighter-color);height:44px;padding:8px 12px;align-items:center;border:1.5px solid var(--success-color);border-left:6px solid var(--success-color);border-radius:4px}.dataSource-btn{display:flex;padding:1rem 2rem;justify-content:center;align-items:center;background-color:var(--success-color);border-radius:4px;cursor:pointer}.dataSource-btn-disabled{background-color:var(--success-lighter-color);cursor:auto}.dataSource-add-database{display:flex;flex-direction:row;justify-content:space-between;background-color:var(--success-lighter-color);padding:8px;border-radius:4px}.dataSource-add-database-title{display:flex;flex-direction:row;gap:1rem;align-items:center}.dataSource-options{display:flex;flex-direction:column;gap:1rem}\n"] }]
12827
+ }], ctorParameters: function () { return []; }, propDecorators: { service: [{
12828
+ type: Input
12829
+ }], filterVcRef: [{
12830
+ type: ViewChild,
12831
+ args: ['smartFilter', { read: ViewContainerRef }]
12832
+ }] } });
12833
+
12834
+ class SmartFilterService {
12835
+ constructor() {
12836
+ this._destroy$ = new Subject();
12837
+ this.shouldSubmit = new Subject();
12838
+ this.reSubscribeToSubmit = new Subject();
12839
+ this.change = new Subject();
12700
12840
  }
12701
- lookupCredential(key) {
12702
- const value = this.credentials[key];
12703
- return typeof value === 'function'
12704
- ? value()
12705
- : value;
12841
+ ngOnDestroy() {
12842
+ this._destroy$.next();
12843
+ this._destroy$.complete();
12706
12844
  }
12707
- defaultEncodeParam(param) {
12708
- // This implementation exists as fallback for missing configuration
12709
- // and for backwards compatibility to older typescript-angular generator versions.
12710
- // It only works for the 'simple' parameter style.
12711
- // Date-handling only works for the 'date-time' format.
12712
- // All other styles and Date-formats are probably handled incorrectly.
12713
- //
12714
- // But: if that's all you need (i.e.: the most common use-case): no need for customization!
12715
- const value = param.dataFormat === 'date-time' && param.value instanceof Date
12716
- ? param.value.toISOString()
12717
- : param.value;
12718
- return encodeURIComponent(String(value));
12845
+ async submit() {
12846
+ this.shouldSubmit.next();
12847
+ await this.shouldSubmit.pipe(takeUntil(this._destroy$)).toPromise();
12848
+ this.shouldSubmit = new Subject();
12849
+ this.reSubscribeToSubmit.next();
12850
+ return this.filter;
12719
12851
  }
12720
- }
12852
+ }
12853
+ SmartFilterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
12854
+ SmartFilterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterService, providedIn: 'root' });
12855
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterService, decorators: [{
12856
+ type: Injectable,
12857
+ args: [{
12858
+ providedIn: 'root',
12859
+ }]
12860
+ }], ctorParameters: function () { return []; } });
12721
12861
 
12722
12862
  /**
12723
- * Form layout definition
12724
- * Contains form layout definition objects.
12863
+ * Filter API 2
12864
+ * Filter API 2
12725
12865
  *
12726
12866
  * The version of the OpenAPI document: 1.0.0
12727
12867
  * Contact: info@it4all.hu
@@ -12730,123 +12870,35 @@ class Configuration$1 {
12730
12870
  * https://openapi-generator.tech
12731
12871
  * Do not edit the class manually.
12732
12872
  */
12733
- class DefaultService {
12734
- constructor(httpClient, basePath, configuration) {
12735
- this.httpClient = httpClient;
12736
- this.basePath = 'http://localhost';
12737
- this.defaultHeaders = new HttpHeaders();
12738
- this.configuration = new Configuration$1();
12739
- if (configuration) {
12740
- this.configuration = configuration;
12741
- }
12742
- if (typeof this.configuration.basePath !== 'string') {
12743
- if (Array.isArray(basePath) && basePath.length > 0) {
12744
- basePath = basePath[0];
12745
- }
12746
- if (typeof basePath !== 'string') {
12747
- basePath = this.basePath;
12748
- }
12749
- this.configuration.basePath = basePath;
12750
- }
12751
- this.encoder = this.configuration.encoder || new CustomHttpParameterCodec$1();
12752
- }
12753
- // @ts-ignore
12754
- addToHttpParams(httpParams, value, key) {
12755
- if (typeof value === "object" && value instanceof Date === false) {
12756
- httpParams = this.addToHttpParamsRecursive(httpParams, value);
12757
- }
12758
- else {
12759
- httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
12760
- }
12761
- return httpParams;
12762
- }
12763
- addToHttpParamsRecursive(httpParams, value, key) {
12764
- if (value == null) {
12765
- return httpParams;
12766
- }
12767
- if (typeof value === "object") {
12768
- if (Array.isArray(value)) {
12769
- value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
12770
- }
12771
- else if (value instanceof Date) {
12772
- if (key != null) {
12773
- httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
12774
- }
12775
- else {
12776
- throw Error("key may not be null if value is Date");
12777
- }
12778
- }
12779
- else {
12780
- Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
12781
- }
12782
- }
12783
- else if (key != null) {
12784
- httpParams = httpParams.append(key, value);
12785
- }
12786
- else {
12787
- throw Error("key may not be null if value is not object or array");
12788
- }
12789
- return httpParams;
12790
- }
12791
- nopePost(observe = 'body', reportProgress = false, options) {
12792
- let localVarHeaders = this.defaultHeaders;
12793
- let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
12794
- if (localVarHttpHeaderAcceptSelected === undefined) {
12795
- // to determine the Accept header
12796
- const httpHeaderAccepts = [];
12797
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
12798
- }
12799
- if (localVarHttpHeaderAcceptSelected !== undefined) {
12800
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
12801
- }
12802
- let localVarHttpContext = options && options.context;
12803
- if (localVarHttpContext === undefined) {
12804
- localVarHttpContext = new HttpContext();
12805
- }
12806
- let responseType_ = 'json';
12807
- if (localVarHttpHeaderAcceptSelected) {
12808
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
12809
- responseType_ = 'text';
12810
- }
12811
- else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
12812
- responseType_ = 'json';
12813
- }
12814
- else {
12815
- responseType_ = 'blob';
12816
- }
12817
- }
12818
- let localVarPath = `/nope`;
12819
- return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
12820
- context: localVarHttpContext,
12821
- responseType: responseType_,
12822
- withCredentials: this.configuration.withCredentials,
12823
- headers: localVarHeaders,
12824
- observe: observe,
12825
- reportProgress: reportProgress
12826
- });
12827
- }
12828
- }
12829
- DefaultService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DefaultService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH$1, optional: true }, { token: Configuration$1, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
12830
- DefaultService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DefaultService, providedIn: 'root' });
12831
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DefaultService, decorators: [{
12832
- type: Injectable,
12833
- args: [{
12834
- providedIn: 'root'
12835
- }]
12836
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
12837
- type: Optional
12838
- }, {
12839
- type: Inject,
12840
- args: [BASE_PATH$1]
12841
- }] }, { type: Configuration$1, decorators: [{
12842
- type: Optional
12843
- }] }]; } });
12873
+ var FilterExpressionBoolOperator$1;
12874
+ (function (FilterExpressionBoolOperator) {
12875
+ FilterExpressionBoolOperator["AND"] = "AND";
12876
+ FilterExpressionBoolOperator["OR"] = "OR";
12877
+ })(FilterExpressionBoolOperator$1 || (FilterExpressionBoolOperator$1 = {}));
12844
12878
 
12845
- const APIS = [DefaultService];
12879
+ /**
12880
+ * Filter API 2
12881
+ * Filter API 2
12882
+ *
12883
+ * The version of the OpenAPI document: 1.0.0
12884
+ * Contact: info@it4all.hu
12885
+ *
12886
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12887
+ * https://openapi-generator.tech
12888
+ * Do not edit the class manually.
12889
+ */
12890
+ var FilterExpressionDataType;
12891
+ (function (FilterExpressionDataType) {
12892
+ FilterExpressionDataType["STRING"] = "STRING";
12893
+ FilterExpressionDataType["NUMBER"] = "NUMBER";
12894
+ FilterExpressionDataType["DATE"] = "DATE";
12895
+ FilterExpressionDataType["DATE_TIME"] = "DATE_TIME";
12896
+ FilterExpressionDataType["BOOLEAN"] = "BOOLEAN";
12897
+ })(FilterExpressionDataType || (FilterExpressionDataType = {}));
12846
12898
 
12847
12899
  /**
12848
- * Form layout definition
12849
- * Contains form layout definition objects.
12900
+ * Filter API 2
12901
+ * Filter API 2
12850
12902
  *
12851
12903
  * The version of the OpenAPI document: 1.0.0
12852
12904
  * Contact: info@it4all.hu
@@ -12855,16 +12907,24 @@ const APIS = [DefaultService];
12855
12907
  * https://openapi-generator.tech
12856
12908
  * Do not edit the class manually.
12857
12909
  */
12858
- var ComponentType;
12859
- (function (ComponentType) {
12860
- ComponentType["CONTAINER"] = "container";
12861
- ComponentType["FORM"] = "form";
12862
- ComponentType["WIDGET"] = "widget";
12863
- })(ComponentType || (ComponentType = {}));
12910
+ var FilterExpressionFieldWidgetType;
12911
+ (function (FilterExpressionFieldWidgetType) {
12912
+ FilterExpressionFieldWidgetType["TEXT_FIELD"] = "TEXT_FIELD";
12913
+ FilterExpressionFieldWidgetType["TEXT_FIELD_CHIPS"] = "TEXT_FIELD_CHIPS";
12914
+ FilterExpressionFieldWidgetType["TEXT_BOX"] = "TEXT_BOX";
12915
+ FilterExpressionFieldWidgetType["SELECT"] = "SELECT";
12916
+ FilterExpressionFieldWidgetType["SELECT_MULTIPLE"] = "SELECT_MULTIPLE";
12917
+ FilterExpressionFieldWidgetType["DATE"] = "DATE";
12918
+ FilterExpressionFieldWidgetType["TIME"] = "TIME";
12919
+ FilterExpressionFieldWidgetType["DATE_TIME"] = "DATE_TIME";
12920
+ FilterExpressionFieldWidgetType["CHECK_BOX"] = "CHECK_BOX";
12921
+ FilterExpressionFieldWidgetType["RADIO_BUTTON"] = "RADIO_BUTTON";
12922
+ FilterExpressionFieldWidgetType["RANGE"] = "RANGE";
12923
+ })(FilterExpressionFieldWidgetType || (FilterExpressionFieldWidgetType = {}));
12864
12924
 
12865
12925
  /**
12866
- * Form layout definition
12867
- * Contains form layout definition objects.
12926
+ * Filter API 2
12927
+ * Filter API 2
12868
12928
  *
12869
12929
  * The version of the OpenAPI document: 1.0.0
12870
12930
  * Contact: info@it4all.hu
@@ -12873,16 +12933,30 @@ var ComponentType;
12873
12933
  * https://openapi-generator.tech
12874
12934
  * Do not edit the class manually.
12875
12935
  */
12876
- var ComponentWidgetType;
12877
- (function (ComponentWidgetType) {
12878
- ComponentWidgetType["GRID"] = "grid";
12879
- ComponentWidgetType["FILTER"] = "filter";
12880
- ComponentWidgetType["TREE"] = "tree";
12881
- })(ComponentWidgetType || (ComponentWidgetType = {}));
12936
+ var FilterExpressionOperation;
12937
+ (function (FilterExpressionOperation) {
12938
+ FilterExpressionOperation["EXPRESSION"] = "EXPRESSION";
12939
+ FilterExpressionOperation["EQUAL"] = "EQUAL";
12940
+ FilterExpressionOperation["NOT_EQUAL"] = "NOT_EQUAL";
12941
+ FilterExpressionOperation["LESS"] = "LESS";
12942
+ FilterExpressionOperation["LESS_OR_EQUAL"] = "LESS_OR_EQUAL";
12943
+ FilterExpressionOperation["GREATER"] = "GREATER";
12944
+ FilterExpressionOperation["GREATER_OR_EQUAL"] = "GREATER_OR_EQUAL";
12945
+ FilterExpressionOperation["LIKE"] = "LIKE";
12946
+ FilterExpressionOperation["NOT_LIKE"] = "NOT_LIKE";
12947
+ FilterExpressionOperation["BETWEEN"] = "BETWEEN";
12948
+ FilterExpressionOperation["NOT_BETWEEN"] = "NOT_BETWEEN";
12949
+ FilterExpressionOperation["IS_EMPTY"] = "IS_EMPTY";
12950
+ FilterExpressionOperation["IS_NOT_EMPTY"] = "IS_NOT_EMPTY";
12951
+ FilterExpressionOperation["EXISTS"] = "EXISTS";
12952
+ FilterExpressionOperation["NOT_EXISTS"] = "NOT_EXISTS";
12953
+ FilterExpressionOperation["IN"] = "IN";
12954
+ FilterExpressionOperation["NOT_IN"] = "NOT_IN";
12955
+ })(FilterExpressionOperation || (FilterExpressionOperation = {}));
12882
12956
 
12883
12957
  /**
12884
- * Form layout definition
12885
- * Contains form layout definition objects.
12958
+ * Filter API 2
12959
+ * Filter API 2
12886
12960
  *
12887
12961
  * The version of the OpenAPI document: 1.0.0
12888
12962
  * Contact: info@it4all.hu
@@ -12891,330 +12965,307 @@ var ComponentWidgetType;
12891
12965
  * https://openapi-generator.tech
12892
12966
  * Do not edit the class manually.
12893
12967
  */
12894
- var LayoutDirection;
12895
- (function (LayoutDirection) {
12896
- LayoutDirection["HORIZONTAL"] = "horizontal";
12897
- LayoutDirection["VERTICAL"] = "vertical";
12898
- })(LayoutDirection || (LayoutDirection = {}));
12899
-
12900
- class ApiModule {
12901
- constructor(parentModule, http) {
12902
- if (parentModule) {
12903
- throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
12904
- }
12905
- if (!http) {
12906
- throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
12907
- 'See also https://github.com/angular/angular/issues/20575');
12908
- }
12909
- }
12910
- static forRoot(configurationFactory) {
12911
- return {
12912
- ngModule: ApiModule,
12913
- providers: [{ provide: Configuration$1, useFactory: configurationFactory }]
12914
- };
12915
- }
12916
- }
12917
- ApiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiModule, deps: [{ token: ApiModule, optional: true, skipSelf: true }, { token: i1.HttpClient, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
12918
- ApiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiModule });
12919
- ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiModule, providers: [], imports: [[]] });
12920
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ApiModule, decorators: [{
12921
- type: NgModule,
12922
- args: [{
12923
- imports: [],
12924
- declarations: [],
12925
- exports: [],
12926
- providers: []
12927
- }]
12928
- }], ctorParameters: function () { return [{ type: ApiModule, decorators: [{
12929
- type: Optional
12930
- }, {
12931
- type: SkipSelf
12932
- }] }, { type: i1.HttpClient, decorators: [{
12933
- type: Optional
12934
- }] }]; } });
12968
+ var FilterExpressionOrderByOrderEnum;
12969
+ (function (FilterExpressionOrderByOrderEnum) {
12970
+ FilterExpressionOrderByOrderEnum["ASC"] = "ASC";
12971
+ FilterExpressionOrderByOrderEnum["DESC"] = "DESC";
12972
+ })(FilterExpressionOrderByOrderEnum || (FilterExpressionOrderByOrderEnum = {}));
12973
+ ;
12935
12974
 
12936
- /*
12937
- * Public API Surface of smart-grid
12975
+ /**
12976
+ * Filter API 2
12977
+ * Filter API 2
12978
+ *
12979
+ * The version of the OpenAPI document: 1.0.0
12980
+ * Contact: info@it4all.hu
12981
+ *
12982
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12983
+ * https://openapi-generator.tech
12984
+ * Do not edit the class manually.
12938
12985
  */
12939
12986
 
12940
- class SmartComponentLayoutComponent {
12941
- constructor(layoutService) {
12942
- this.layoutService = layoutService;
12987
+ var FilterExpressionBuilderGroupBuilderGroupKindEnum;
12988
+ (function (FilterExpressionBuilderGroupBuilderGroupKindEnum) {
12989
+ FilterExpressionBuilderGroupBuilderGroupKindEnum["DIPLAY"] = "DIPLAY";
12990
+ FilterExpressionBuilderGroupBuilderGroupKindEnum["BRACKET"] = "BRACKET";
12991
+ FilterExpressionBuilderGroupBuilderGroupKindEnum["EXIST"] = "EXIST";
12992
+ })(FilterExpressionBuilderGroupBuilderGroupKindEnum || (FilterExpressionBuilderGroupBuilderGroupKindEnum = {}));
12993
+ ;
12994
+
12995
+ class SmartFilterSimpleFieldComponent {
12996
+ constructor(service, cfService) {
12997
+ this.service = service;
12998
+ this.cfService = cfService;
12943
12999
  this._destroy$ = new Subject();
12944
13000
  }
13001
+ ngOnInit() {
13002
+ this.operation = this.filterExpressionField.expressionData?.currentOperation;
13003
+ this.currentOperation = this.getOptionLabel(this.operation);
13004
+ }
12945
13005
  ngAfterViewInit() {
12946
- if (this.smartFormList?.first) {
12947
- this.setFormComponent(this.smartFormList?.first);
12948
- }
12949
- this.smartFormList.changes
12950
- .pipe(takeUntil(this._destroy$))
12951
- .subscribe((list) => {
12952
- this.setFormComponent(list.first);
12953
- });
12954
- if (this.smartGridList?.first) {
12955
- this.setGridComponent(this.smartGridList?.first);
12956
- }
12957
- this.smartGridList.changes
12958
- .pipe(takeUntil(this._destroy$))
12959
- .subscribe((list) => {
12960
- this.setGridComponent(list.first);
12961
- });
12962
- this.smartFilterList.changes
12963
- .pipe(takeUntil(this._destroy$))
12964
- .subscribe((list) => {
12965
- if (!this.smartFilterComponent) {
12966
- this.smartFilterComponent = list.first;
12967
- this.bindFilter();
12968
- }
12969
- });
12970
- if (this.smartComponentLayout) {
12971
- this.setUp();
12972
- }
13006
+ this.constructForm();
12973
13007
  }
12974
13008
  ngOnDestroy() {
12975
13009
  this._destroy$.next();
12976
13010
  this._destroy$.complete();
12977
13011
  }
12978
- ngOnChanges(changes) {
12979
- this.smartComponentLayout = changes['smartComponentLayout'].currentValue;
12980
- if (this.smartComponentLayout) {
12981
- this.setUp();
13012
+ constructFormWidget(key, label, widgetType, possibleValues, placeholder) {
13013
+ let type = widgetType;
13014
+ if (type === FilterExpressionFieldWidgetType.DATE) {
13015
+ type = SmartFormWidgetType.DATE_PICKER;
12982
13016
  }
12983
- }
12984
- setUp() {
12985
- this.parent = this.smartComponentLayout?.parentComponent;
12986
- this.uuid = this.parent.uuid;
12987
- this.treeService = this.parent.smartTreeService;
12988
- if (this.smartComponentLayout?.expandable) {
12989
- this.constructExpandableSection();
13017
+ else if (type === FilterExpressionFieldWidgetType.DATE_TIME) {
13018
+ type = SmartFormWidgetType.DATE_TIME_PICKER;
12990
13019
  }
12991
- else if (this.smartComponentLayout?.type === ComponentType.FORM) {
12992
- this.constructForm();
13020
+ let widget = {
13021
+ key,
13022
+ label,
13023
+ type,
13024
+ value: '',
13025
+ placeholder: placeholder,
13026
+ showLabel: true,
13027
+ valueList: possibleValues.map((value) => {
13028
+ return {
13029
+ key: value.objectUri ? value.objectUri : value.code,
13030
+ label: value.displayValue,
13031
+ type: SmartFormWidgetType.ITEM,
13032
+ value: value.objectUri ? value.objectUri : value.code,
13033
+ };
13034
+ }),
13035
+ };
13036
+ return widget;
13037
+ }
13038
+ constructForm() {
13039
+ this.vcRefForm?.clear();
13040
+ let widgets = [];
13041
+ let key;
13042
+ if (this.filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
13043
+ key = 'expressionData.operand2.selectedValues';
12993
13044
  }
12994
- else if (this.smartComponentLayout?.type === ComponentType.WIDGET) {
12995
- if (this.smartComponentLayout.widget?.type === ComponentWidgetType.GRID) {
12996
- this.constructGrid();
12997
- }
12998
- else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.FILTER) {
12999
- this.constructFilter();
13045
+ if (this.filterExpressionField.expressionData?.operand2) {
13046
+ if (key !== 'expressionData.operand2.selectedValues') {
13047
+ key = 'expressionData.operand2.valueAsString';
13000
13048
  }
13001
- else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.TREE) {
13002
- this.constructTree();
13049
+ widgets.push(this.constructFormWidget(key, this.filterExpressionField.label2, this.filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, this.filterExpressionField.possibleValues, this.filterExpressionField.placeholder2));
13050
+ }
13051
+ if (this.filterExpressionField.expressionData?.operand3) {
13052
+ if (key !== 'selectedValues') {
13053
+ key = 'expressionData.operand3.valueAsString';
13003
13054
  }
13055
+ widgets.push(this.constructFormWidget(key, this.filterExpressionField.label3, this.filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, this.filterExpressionField.possibleValues, this.filterExpressionField.placeholder3));
13004
13056
  }
13005
- }
13006
- type() {
13007
- return ComponentType;
13008
- }
13009
- constructExpandableSection() {
13010
- let data = { ...this.smartComponentLayout };
13011
- data.expandable = false;
13012
- this.expandableSection = {
13013
- title: this.smartComponentLayout?.expandableSectionLabel ?? '',
13014
- data,
13015
- inputName: 'smartComponentLayout',
13016
- customComponent: SmartComponentLayoutComponent,
13017
- };
13018
- }
13019
- constructForm() {
13020
- const widgets = this.layoutService.render({
13021
- layoutDefinitions: this.smartComponentLayout?.form,
13022
- });
13057
+ this.operation = this.filterExpressionField.expressionData?.currentOperation;
13058
+ this.currentOperation = this.getOptionLabel(this.operation);
13023
13059
  this.smartForm = {
13024
- direction: SmartFormWidgetDirection.COL,
13025
- componentModel: this.parent?.model,
13060
+ direction: SmartFormWidgetDirection.ROW,
13061
+ componentModel: { data: this.filterExpressionField },
13062
+ useOnValueChangeEvent: true,
13063
+ useOnBlurEvent: true,
13064
+ submitOnEnter: this.service.filter?.submitOnEnter,
13026
13065
  widgets,
13066
+ translateService: this.service.filter?.translateService,
13027
13067
  };
13028
- this.bindForm();
13029
- }
13030
- setFormComponent(comp) {
13031
- if (!this.smartFormComponent) {
13032
- this.smartFormComponent = comp;
13033
- this.bindForm();
13034
- }
13035
- }
13036
- bindForm() {
13037
- if (this.smartForm && this.smartFormComponent) {
13038
- this.parent?.addForm(
13039
- // unique identifier for the form
13040
- `form_${this.makeid(5)}`, this.smartForm, this.smartFormComponent);
13041
- }
13042
- }
13043
- makeid(length) {
13044
- let result = '';
13045
- const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
13046
- const charactersLength = characters.length;
13047
- let counter = 0;
13048
- while (counter < length) {
13049
- result += characters.charAt(Math.floor(Math.random() * charactersLength));
13050
- counter += 1;
13051
- }
13052
- return result;
13068
+ // Show form on page
13069
+ this.componentRefForm = this.cfService.createComponent(this.vcRefForm, SmartformComponent, new Map([['smartForm', this.smartForm]]));
13070
+ this.componentRefForm.instance.onValueChangeSubject
13071
+ ?.pipe(takeUntil(this._destroy$))
13072
+ .subscribe(() => {
13073
+ this.submit();
13074
+ this.service.change.next();
13075
+ });
13076
+ this.componentRefForm.instance.onBlurSubject?.pipe(takeUntil(this._destroy$)).subscribe(() => {
13077
+ this.submit();
13078
+ this.service.change.next();
13079
+ });
13053
13080
  }
13054
- constructGrid() {
13055
- this.smartGrid = {
13056
- gridIdentifier: this.smartComponentLayout?.widget?.gridIdentifier,
13057
- gridModel: {
13058
- page: {},
13059
- },
13060
- options: {
13061
- rowUiActionType: GridUiActionType.POPUP_MENU,
13062
- },
13063
- layoutDef: SmartLayoutDef.TABLE,
13064
- paginator: true,
13065
- };
13066
- this.bindGrid();
13081
+ submit() {
13082
+ let form = this.componentRefForm.instance.submitForm();
13083
+ this.filterExpressionField = form.componentModel?.data;
13084
+ this.simpleFieldChildren.forEach((smartFilterFieldComponent, index) => {
13085
+ let filterExpressionField = smartFilterFieldComponent.submit();
13086
+ this.filterExpressionField.subFieldList.filters[index] = filterExpressionField;
13087
+ });
13088
+ return this.filterExpressionField;
13067
13089
  }
13068
- setGridComponent(comp) {
13069
- if (!this.smartGridComponent) {
13070
- this.smartGridComponent = comp;
13071
- this.bindGrid();
13090
+ optionSelected(option) {
13091
+ let oldOption = this.componentRefForm.instance.smartForm.componentModel.data.expressionData
13092
+ .currentOperation;
13093
+ this.componentRefForm.instance.smartForm.componentModel.data.expressionData.currentOperation =
13094
+ option;
13095
+ this.operation = option;
13096
+ this.currentOperation = this.getOptionLabel(this.operation);
13097
+ if (oldOption !== FilterExpressionOperation.BETWEEN &&
13098
+ option === FilterExpressionOperation.BETWEEN) {
13099
+ this.submit();
13100
+ let label = this.filterExpressionField.label2;
13101
+ this.filterExpressionField.label2 = `${label} - tól`;
13102
+ this.filterExpressionField.label3 = `${label} - ig`;
13103
+ this.filterExpressionField.expressionData.operand3 = {
13104
+ isDataName: this.filterExpressionField.expressionData.operand2?.isDataName,
13105
+ type: this.filterExpressionField.expressionData.operand3?.type,
13106
+ valueAsString: this.filterExpressionField.expressionData.operand3?.valueAsString,
13107
+ selectedValues: this.filterExpressionField.expressionData.operand3?.selectedValues,
13108
+ };
13109
+ this.constructForm();
13072
13110
  }
13073
- }
13074
- bindGrid() {
13075
- if (this.smartGrid && this.smartGridComponent) {
13076
- this.smartGrid = this.parent?.addGrid(this.smartGrid, {
13077
- rowUiActionType: GridUiActionType.POPUP_MENU,
13078
- }, false, this.smartGridComponent);
13111
+ else if (oldOption === FilterExpressionOperation.BETWEEN &&
13112
+ option !== FilterExpressionOperation.BETWEEN) {
13113
+ let label = this.filterExpressionField.label2.replace(' - tól', '');
13114
+ this.filterExpressionField.label2 = `${label}`;
13115
+ this.filterExpressionField.label3 = undefined;
13116
+ this.filterExpressionField.expressionData.operand3 = undefined;
13117
+ this.constructForm();
13079
13118
  }
13080
13119
  }
13081
- constructFilter() {
13082
- this.smartFilter = this.smartComponentLayout.parentComponent.addFilter(`filter_${this.makeid(5)}`, this.smartComponentLayout?.widget?.filterExpressionFieldList, this.smartComponentLayout?.widget?.filterType, this.smartFilterComponent);
13083
- }
13084
- bindFilter() {
13085
- // TODO
13086
- }
13087
- constructTree() {
13088
- this.parent.setUpDefaultTree(this.smartComponentLayout?.widget?.treeIdentifier);
13089
- this.treeService?.initialize();
13120
+ getOptionLabel(option) {
13121
+ if (!option) {
13122
+ return '';
13123
+ }
13124
+ else if (this.operationTranslator) {
13125
+ return this.operationTranslator(option);
13126
+ }
13127
+ return option;
13090
13128
  }
13091
13129
  }
13092
- SmartComponentLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutComponent, deps: [{ token: SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
13093
- 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"] }] });
13094
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutComponent, decorators: [{
13130
+ SmartFilterSimpleFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterSimpleFieldComponent, deps: [{ token: SmartFilterService }, { token: ComponentFactoryService }], target: i0.ɵɵFactoryTarget.Component });
13131
+ SmartFilterSimpleFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterSimpleFieldComponent, selector: "smart-filter-simple-field", inputs: { operationTranslator: "operationTranslator", filterExpressionField: "filterExpressionField", showPossibleActions: "showPossibleActions" }, viewQueries: [{ propertyName: "vcRefForm", first: true, predicate: ["form"], descendants: true, read: ViewContainerRef }, { propertyName: "simpleFieldChildren", predicate: ["simpleField"], descendants: true }], ngImport: i0, template: "<div class=\"smart-filter-simple-field-container\">\r\n <div class=\"smart-filter-simple-field-form-widget\">\r\n <div\r\n class=\"smart-filter-simple-field-form-widget-row\"\r\n *ngIf=\"showPossibleActions\"\r\n >\r\n <p>({{ currentOperation }})</p>\r\n <button\r\n mat-icon-button\r\n [matMenuTriggerFor]=\"menu\"\r\n aria-label=\"Example icon-button with a menu\"\r\n >\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n mat-menu-item\r\n *ngFor=\"let option of filterExpressionField.possibleOperations\"\r\n (click)=\"optionSelected(option)\"\r\n >\r\n <span>\r\n {{ getOptionLabel(option) }}\r\n </span>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n <ng-template #form></ng-template>\r\n </div>\r\n</div>\r\n", styles: [".smart-filter-simple-field-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem}.smart-filter-simple-field-form-widget{padding:1rem;border-radius:1rem;display:flex;flex-direction:column}.smart-filter-simple-field-form-widget-row{display:flex;flex-direction:row;justify-content:space-between}.smart-filter-simple-field-form-widget-row p{color:#00000042}.smart-filter-simple-field-form-widget ::ng-deep .mat-icon-button{height:24px;width:24px}.smart-filter-simple-field-form-widget ::ng-deep .mat-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-flat-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-stroked-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-raised-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-icon-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-fab .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mini-fab .mat-button-wrapper>*{vertical-align:inherit!important}.smart-filter-simple-field-subfields-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem}.smart-filter-simple-field-container ::ng-deep h4{margin:0}\n"], components: [{ type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i5.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
13132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterSimpleFieldComponent, decorators: [{
13095
13133
  type: Component,
13096
- 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"] }]
13097
- }], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }]; }, propDecorators: { smartComponentLayout: [{
13098
- type: Input
13099
- }], smartFormList: [{
13100
- type: ViewChildren,
13101
- args: ['form']
13102
- }], smartGridList: [{
13103
- type: ViewChildren,
13104
- args: ['grid']
13105
- }], smartFilterList: [{
13106
- type: ViewChildren,
13107
- args: ['filter']
13108
- }], components: [{
13134
+ args: [{ selector: 'smart-filter-simple-field', template: "<div class=\"smart-filter-simple-field-container\">\r\n <div class=\"smart-filter-simple-field-form-widget\">\r\n <div\r\n class=\"smart-filter-simple-field-form-widget-row\"\r\n *ngIf=\"showPossibleActions\"\r\n >\r\n <p>({{ currentOperation }})</p>\r\n <button\r\n mat-icon-button\r\n [matMenuTriggerFor]=\"menu\"\r\n aria-label=\"Example icon-button with a menu\"\r\n >\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n mat-menu-item\r\n *ngFor=\"let option of filterExpressionField.possibleOperations\"\r\n (click)=\"optionSelected(option)\"\r\n >\r\n <span>\r\n {{ getOptionLabel(option) }}\r\n </span>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n <ng-template #form></ng-template>\r\n </div>\r\n</div>\r\n", styles: [".smart-filter-simple-field-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem}.smart-filter-simple-field-form-widget{padding:1rem;border-radius:1rem;display:flex;flex-direction:column}.smart-filter-simple-field-form-widget-row{display:flex;flex-direction:row;justify-content:space-between}.smart-filter-simple-field-form-widget-row p{color:#00000042}.smart-filter-simple-field-form-widget ::ng-deep .mat-icon-button{height:24px;width:24px}.smart-filter-simple-field-form-widget ::ng-deep .mat-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-flat-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-stroked-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-raised-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-icon-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-fab .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mini-fab .mat-button-wrapper>*{vertical-align:inherit!important}.smart-filter-simple-field-subfields-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem}.smart-filter-simple-field-container ::ng-deep h4{margin:0}\n"] }]
13135
+ }], ctorParameters: function () { return [{ type: SmartFilterService }, { type: ComponentFactoryService }]; }, propDecorators: { simpleFieldChildren: [{
13109
13136
  type: ViewChildren,
13110
- args: [SmartComponentLayoutComponent]
13111
- }] } });
13112
-
13113
- class SmartComponentLayoutModule {
13114
- }
13115
- SmartComponentLayoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
13116
- SmartComponentLayoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutModule, declarations: [SmartComponentLayoutComponent], imports: [BrowserModule,
13117
- MatCommonModule,
13118
- SmartformModule,
13119
- SmartGridModule,
13120
- SmartExpandableSectionModule,
13121
- SmarttreeModule], exports: [SmartComponentLayoutComponent] });
13122
- SmartComponentLayoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutModule, providers: [], imports: [[
13123
- BrowserModule,
13124
- MatCommonModule,
13125
- SmartformModule,
13126
- SmartGridModule,
13127
- SmartExpandableSectionModule,
13128
- SmarttreeModule,
13129
- ]] });
13130
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutModule, decorators: [{
13131
- type: NgModule,
13132
- args: [{
13133
- declarations: [SmartComponentLayoutComponent],
13134
- imports: [
13135
- BrowserModule,
13136
- MatCommonModule,
13137
- SmartformModule,
13138
- SmartGridModule,
13139
- SmartExpandableSectionModule,
13140
- SmarttreeModule,
13141
- ],
13142
- exports: [SmartComponentLayoutComponent],
13143
- providers: [],
13144
- }]
13145
- }] });
13146
-
13147
- class SmartFilterParamComponent {
13148
- constructor() { }
13149
- onItemClick(item) {
13150
- this.data.serviceToUse.peformWidgetAction({
13151
- code: 'ADD_FILTER_EXPRESSION',
13152
- params: {
13153
- model: item,
13154
- },
13155
- });
13156
- }
13157
- }
13158
- SmartFilterParamComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13159
- SmartFilterParamComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterParamComponent, selector: "app-target-group-filter-param", inputs: { data: "data" }, ngImport: i0, template: "<div class=\"targetGroupFilterParamContainer\">\r\n <div\r\n class=\"targetGroupFilterItem\"\r\n *ngFor=\"let data of data?.group\"\r\n (click)=\"onItemClick(data)\"\r\n >\r\n <smart-icon icon=\"Ic24_Chevron_Right\" color=\"gray\"></smart-icon>\r\n <div class=\"mat-caption\">\r\n {{ data.label }}\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamContainer{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterItem{padding:.75rem;border-radius:.25rem;display:flex;flex-direction:row;gap:.5rem;cursor:pointer}.targetGroupFilterItem .mat-caption{margin:auto 0}\n"], components: [{ type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }], directives: [{ type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
13160
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, decorators: [{
13161
- type: Component,
13162
- args: [{ selector: 'app-target-group-filter-param', template: "<div class=\"targetGroupFilterParamContainer\">\r\n <div\r\n class=\"targetGroupFilterItem\"\r\n *ngFor=\"let data of data?.group\"\r\n (click)=\"onItemClick(data)\"\r\n >\r\n <smart-icon icon=\"Ic24_Chevron_Right\" color=\"gray\"></smart-icon>\r\n <div class=\"mat-caption\">\r\n {{ data.label }}\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamContainer{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterItem{padding:.75rem;border-radius:.25rem;display:flex;flex-direction:row;gap:.5rem;cursor:pointer}.targetGroupFilterItem .mat-caption{margin:auto 0}\n"] }]
13163
- }], ctorParameters: function () { return []; }, propDecorators: { data: [{
13137
+ args: ['simpleField']
13138
+ }], operationTranslator: [{
13139
+ type: Input
13140
+ }], filterExpressionField: [{
13164
13141
  type: Input
13142
+ }], showPossibleActions: [{
13143
+ type: Input
13144
+ }], vcRefForm: [{
13145
+ type: ViewChild,
13146
+ args: ['form', { read: ViewContainerRef }]
13165
13147
  }] } });
13166
13148
 
13167
- class SmartFilterParamsComponent {
13168
- constructor() {
13149
+ class SmartFilterSimpleComponent {
13150
+ constructor(service) {
13151
+ this.service = service;
13169
13152
  this._destroy$ = new Subject();
13170
- this.expandableSections = [];
13153
+ this.service.reSubscribeToSubmit.pipe(takeUntil(this._destroy$)).subscribe(() => {
13154
+ this.subscribeToSubmit();
13155
+ });
13156
+ this.subscribeToSubmit();
13171
13157
  }
13172
13158
  ngOnInit() {
13173
- this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
13174
- this.setUp(this.service.model);
13175
- });
13176
- this.setUp(this.service.model);
13159
+ this.smartFilter = this.service.filter;
13177
13160
  }
13178
13161
  ngOnDestroy() {
13179
13162
  this._destroy$.next();
13180
13163
  this._destroy$.complete();
13181
13164
  }
13182
- setUp(model) {
13183
- if (model?.model) {
13184
- this.filterBuilder = model.model;
13185
- this.constructExpandableSections();
13165
+ subscribeToSubmit() {
13166
+ this.service.shouldSubmit.pipe(takeUntil(this._destroy$)).subscribe(() => {
13167
+ this.submit();
13168
+ });
13169
+ }
13170
+ submit() {
13171
+ this.simpleFieldChildren.forEach((smartFilterFieldComponent, index) => {
13172
+ this.smartFilter.data[index] = smartFilterFieldComponent.submit();
13173
+ });
13174
+ this.service.filter = this.smartFilter;
13175
+ this.service.shouldSubmit.complete();
13176
+ }
13177
+ }
13178
+ SmartFilterSimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterSimpleComponent, deps: [{ token: SmartFilterService }], target: i0.ɵɵFactoryTarget.Component });
13179
+ SmartFilterSimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterSimpleComponent, selector: "smart-filter-simple", viewQueries: [{ propertyName: "simpleFieldChildren", predicate: ["simpleField"], descendants: true }], ngImport: i0, template: "<div *ngIf=\"smartFilter\" class=\"smart-simple-fields-container\">\r\n <div *ngFor=\"let filterExpressionField of smartFilter.data; let i = index\">\r\n <smart-filter-simple-field\r\n #simpleField\r\n [filterExpressionField]=\"filterExpressionField\"\r\n [operationTranslator]=\"smartFilter.operationTranslator\"\r\n [showPossibleActions]=\"smartFilter.showPossibleActions\"\r\n ></smart-filter-simple-field>\r\n <div *ngFor=\"let subfilterExpressionField of filterExpressionField.subFieldList?.filters\">\r\n <smart-filter-simple-field\r\n #simpleField\r\n [filterExpressionField]=\"filterExpressionField\"\r\n [operationTranslator]=\"smartFilter.operationTranslator\"\r\n [showPossibleActions]=\"smartFilter.showPossibleActions\"\r\n ></smart-filter-simple-field>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".smart-simple-fields-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem;justify-content:center}\n"], components: [{ type: SmartFilterSimpleFieldComponent, selector: "smart-filter-simple-field", inputs: ["operationTranslator", "filterExpressionField", "showPossibleActions"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
13180
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterSimpleComponent, decorators: [{
13181
+ type: Component,
13182
+ args: [{ selector: "smart-filter-simple", template: "<div *ngIf=\"smartFilter\" class=\"smart-simple-fields-container\">\r\n <div *ngFor=\"let filterExpressionField of smartFilter.data; let i = index\">\r\n <smart-filter-simple-field\r\n #simpleField\r\n [filterExpressionField]=\"filterExpressionField\"\r\n [operationTranslator]=\"smartFilter.operationTranslator\"\r\n [showPossibleActions]=\"smartFilter.showPossibleActions\"\r\n ></smart-filter-simple-field>\r\n <div *ngFor=\"let subfilterExpressionField of filterExpressionField.subFieldList?.filters\">\r\n <smart-filter-simple-field\r\n #simpleField\r\n [filterExpressionField]=\"filterExpressionField\"\r\n [operationTranslator]=\"smartFilter.operationTranslator\"\r\n [showPossibleActions]=\"smartFilter.showPossibleActions\"\r\n ></smart-filter-simple-field>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".smart-simple-fields-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem;justify-content:center}\n"] }]
13183
+ }], ctorParameters: function () { return [{ type: SmartFilterService }]; }, propDecorators: { simpleFieldChildren: [{
13184
+ type: ViewChildren,
13185
+ args: ["simpleField"]
13186
+ }] } });
13187
+
13188
+ class SmartFilterComponent {
13189
+ constructor(service) {
13190
+ this.service = service;
13191
+ }
13192
+ ngOnInit() {
13193
+ if (this.filter) {
13194
+ this.setUp();
13186
13195
  }
13187
13196
  }
13188
- constructExpandableSections() {
13189
- if (this.filterBuilder.groups) {
13190
- this.expandableSections = this.filterBuilder.groups.map((filterExpressionBuilderGroup) => {
13191
- return {
13192
- title: filterExpressionBuilderGroup.label,
13193
- cssClass: 'filterExpressionBuilderGroup',
13194
- customComponent: SmartFilterParamComponent,
13195
- data: {
13196
- group: filterExpressionBuilderGroup.fields,
13197
- serviceToUse: this.service,
13198
- },
13199
- inputName: 'data',
13200
- isExpanded: true,
13201
- };
13202
- });
13197
+ ngOnChanges(changes) {
13198
+ if (changes['filter'].currentValue) {
13199
+ this.setUp();
13203
13200
  }
13204
13201
  }
13202
+ setUp() {
13203
+ this.service.filter = this.filter;
13204
+ }
13205
+ async submit() {
13206
+ return await this.service.submit();
13207
+ }
13205
13208
  }
13206
- SmartFilterParamsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13207
- SmartFilterParamsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterParamsComponent, selector: "smart-filter-group-params", inputs: { service: "service" }, viewQueries: [{ propertyName: "filterVcRef", first: true, predicate: ["smartFilter"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div\r\n class=\"targetGroupFilterParamsContainer\"\r\n *ngIf=\"service.model?.showGroups && !service.model?.readOnly\"\r\n>\r\n <!-- <ng-template #smartFilter></ng-template> -->\r\n <!-- <div class=\"dataSource-options\" *ngIf=\"service.model?.extarnalDatabase\">\r\n <div class=\"dataSource-btns\">\r\n <div class=\"dataSource-btn\">K\u00FCls\u0151 adatb\u00E1zis</div>\r\n <div class=\"dataSource-btn dataSource-btn-disabled\">Bels\u0151 adatb\u00E1zis</div>\r\n </div>\r\n <div class=\"dataSource-add-database\">\r\n <div class=\"dataSource-add-database-title\">\r\n <smart-icon icon=\"Ic24_View_Table\" color=\"sucess\"></smart-icon>\r\n Adatb\u00E1zis\r\n </div>\r\n <button title=\"add\" mat-icon-button (click)=\"addDataSource()\">\r\n <smart-icon icon=\"Ic24_Plus_Circle\" color=\"success\"></smart-icon>\r\n </button>\r\n </div>\r\n </div> -->\r\n <div class=\"sections\">\r\n <smart-expandable-section\r\n class=\"excel\"\r\n *ngIf=\"expandableSectionsFromExcel\"\r\n [data]=\"expandableSectionsFromExcel!\"\r\n ></smart-expandable-section>\r\n <smart-expandable-section\r\n [data]=\"data\"\r\n *ngFor=\"let data of expandableSections\"\r\n ></smart-expandable-section>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamsContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;border-right:2px solid var(--primary-dark-color)}.sections{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-body{background-color:var(--success-lighter-color)}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--success-color)!important}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-body{padding:0 0 0 1rem!important;background-color:var(--light-blue-color)}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header{background-color:var(--primary-light-color);padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header-title{color:var(--primary-lighter-color);font-weight:600}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--accent-color)!important;padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded .mat-expansion-panel-header-title{color:#fff}.dataSource-btns{display:flex;flex-direction:row;justify-content:space-around;background-color:var(--success-lighter-color);height:44px;padding:8px 12px;align-items:center;border:1.5px solid var(--success-color);border-left:6px solid var(--success-color);border-radius:4px}.dataSource-btn{display:flex;padding:1rem 2rem;justify-content:center;align-items:center;background-color:var(--success-color);border-radius:4px;cursor:pointer}.dataSource-btn-disabled{background-color:var(--success-lighter-color);cursor:auto}.dataSource-add-database{display:flex;flex-direction:row;justify-content:space-between;background-color:var(--success-lighter-color);padding:8px;border-radius:4px}.dataSource-add-database-title{display:flex;flex-direction:row;gap:1rem;align-items:center}.dataSource-options{display:flex;flex-direction:column;gap:1rem}\n"], components: [{ type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
13208
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, decorators: [{
13209
+ SmartFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterComponent, deps: [{ token: SmartFilterService }], target: i0.ɵɵFactoryTarget.Component });
13210
+ SmartFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterComponent, selector: "smart-filter", inputs: { filter: "filter" }, providers: [SmartFilterService], usesOnChanges: true, ngImport: i0, template: "<smart-filter-simple *ngIf=\"filter\" #simpleFilter></smart-filter-simple>\r\n", styles: [""], components: [{ type: SmartFilterSimpleComponent, selector: "smart-filter-simple" }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
13211
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterComponent, decorators: [{
13209
13212
  type: Component,
13210
- args: [{ selector: 'smart-filter-group-params', template: "<div\r\n class=\"targetGroupFilterParamsContainer\"\r\n *ngIf=\"service.model?.showGroups && !service.model?.readOnly\"\r\n>\r\n <!-- <ng-template #smartFilter></ng-template> -->\r\n <!-- <div class=\"dataSource-options\" *ngIf=\"service.model?.extarnalDatabase\">\r\n <div class=\"dataSource-btns\">\r\n <div class=\"dataSource-btn\">K\u00FCls\u0151 adatb\u00E1zis</div>\r\n <div class=\"dataSource-btn dataSource-btn-disabled\">Bels\u0151 adatb\u00E1zis</div>\r\n </div>\r\n <div class=\"dataSource-add-database\">\r\n <div class=\"dataSource-add-database-title\">\r\n <smart-icon icon=\"Ic24_View_Table\" color=\"sucess\"></smart-icon>\r\n Adatb\u00E1zis\r\n </div>\r\n <button title=\"add\" mat-icon-button (click)=\"addDataSource()\">\r\n <smart-icon icon=\"Ic24_Plus_Circle\" color=\"success\"></smart-icon>\r\n </button>\r\n </div>\r\n </div> -->\r\n <div class=\"sections\">\r\n <smart-expandable-section\r\n class=\"excel\"\r\n *ngIf=\"expandableSectionsFromExcel\"\r\n [data]=\"expandableSectionsFromExcel!\"\r\n ></smart-expandable-section>\r\n <smart-expandable-section\r\n [data]=\"data\"\r\n *ngFor=\"let data of expandableSections\"\r\n ></smart-expandable-section>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamsContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;border-right:2px solid var(--primary-dark-color)}.sections{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-body{background-color:var(--success-lighter-color)}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--success-color)!important}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-body{padding:0 0 0 1rem!important;background-color:var(--light-blue-color)}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header{background-color:var(--primary-light-color);padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header-title{color:var(--primary-lighter-color);font-weight:600}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--accent-color)!important;padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded .mat-expansion-panel-header-title{color:#fff}.dataSource-btns{display:flex;flex-direction:row;justify-content:space-around;background-color:var(--success-lighter-color);height:44px;padding:8px 12px;align-items:center;border:1.5px solid var(--success-color);border-left:6px solid var(--success-color);border-radius:4px}.dataSource-btn{display:flex;padding:1rem 2rem;justify-content:center;align-items:center;background-color:var(--success-color);border-radius:4px;cursor:pointer}.dataSource-btn-disabled{background-color:var(--success-lighter-color);cursor:auto}.dataSource-add-database{display:flex;flex-direction:row;justify-content:space-between;background-color:var(--success-lighter-color);padding:8px;border-radius:4px}.dataSource-add-database-title{display:flex;flex-direction:row;gap:1rem;align-items:center}.dataSource-options{display:flex;flex-direction:column;gap:1rem}\n"] }]
13211
- }], ctorParameters: function () { return []; }, propDecorators: { service: [{
13213
+ args: [{ selector: 'smart-filter', providers: [SmartFilterService], template: "<smart-filter-simple *ngIf=\"filter\" #simpleFilter></smart-filter-simple>\r\n", styles: [""] }]
13214
+ }], ctorParameters: function () { return [{ type: SmartFilterService }]; }, propDecorators: { filter: [{
13212
13215
  type: Input
13213
- }], filterVcRef: [{
13214
- type: ViewChild,
13215
- args: ['smartFilter', { read: ViewContainerRef }]
13216
13216
  }] } });
13217
13217
 
13218
+ class SmartFilterExpressionFieldComponent {
13219
+ constructor() { }
13220
+ ngOnInit() {
13221
+ }
13222
+ }
13223
+ SmartFilterExpressionFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13224
+ SmartFilterExpressionFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterExpressionFieldComponent, selector: "lib-smart-filter-expression-field", ngImport: i0, template: "", styles: [""] });
13225
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionFieldComponent, decorators: [{
13226
+ type: Component,
13227
+ args: [{ selector: 'lib-smart-filter-expression-field', template: "", styles: [""] }]
13228
+ }], ctorParameters: function () { return []; } });
13229
+
13230
+ class SmartFilterModule {
13231
+ }
13232
+ SmartFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
13233
+ SmartFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterModule, declarations: [SmartFilterComponent,
13234
+ SmartFilterExpressionFieldComponent,
13235
+ SmartFilterSimpleComponent,
13236
+ SmartFilterSimpleFieldComponent], imports: [BrowserModule, SmartformModule, MatMenuModule, MatIconModule, MatButtonModule], exports: [SmartFilterComponent] });
13237
+ SmartFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterModule, imports: [[BrowserModule, SmartformModule, MatMenuModule, MatIconModule, MatButtonModule]] });
13238
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterModule, decorators: [{
13239
+ type: NgModule,
13240
+ args: [{
13241
+ declarations: [
13242
+ SmartFilterComponent,
13243
+ SmartFilterExpressionFieldComponent,
13244
+ SmartFilterSimpleComponent,
13245
+ SmartFilterSimpleFieldComponent,
13246
+ ],
13247
+ imports: [BrowserModule, SmartformModule, MatMenuModule, MatIconModule, MatButtonModule],
13248
+ exports: [SmartFilterComponent],
13249
+ }]
13250
+ }] });
13251
+
13252
+ var SmartFilterPosition;
13253
+ (function (SmartFilterPosition) {
13254
+ SmartFilterPosition[SmartFilterPosition["TOP"] = 0] = "TOP";
13255
+ SmartFilterPosition[SmartFilterPosition["BOTTOM"] = 1] = "BOTTOM";
13256
+ SmartFilterPosition[SmartFilterPosition["LEFT"] = 2] = "LEFT";
13257
+ SmartFilterPosition[SmartFilterPosition["RIGHT"] = 3] = "RIGHT";
13258
+ })(SmartFilterPosition || (SmartFilterPosition = {}));
13259
+ var SmartFilterType;
13260
+ (function (SmartFilterType) {
13261
+ SmartFilterType[SmartFilterType["SIMPLE"] = 0] = "SIMPLE";
13262
+ SmartFilterType[SmartFilterType["ADVANCED"] = 1] = "ADVANCED";
13263
+ })(SmartFilterType || (SmartFilterType = {}));
13264
+
13265
+ /*
13266
+ * Public API Surface of smart-filter
13267
+ */
13268
+
13218
13269
  var FilterExpressionBuilderUiModelTypeEnum;
13219
13270
  (function (FilterExpressionBuilderUiModelTypeEnum) {
13220
13271
  FilterExpressionBuilderUiModelTypeEnum["SIMPLE"] = "SIMPLE";
@@ -13402,28 +13453,28 @@ class SmartFilterEditorContentComponent {
13402
13453
  model[index] = filterExpressionField;
13403
13454
  if (filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
13404
13455
  key = index + '.expressionData.operand2.selectedValues';
13405
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand2?.valueAsString ?? ''));
13456
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand2?.valueAsString ?? ''));
13406
13457
  return;
13407
13458
  }
13408
13459
  if (filterExpressionField.expressionData?.currentOperation === 'BETWEEN') {
13409
13460
  key = index + '.expressionData.operand2.valueAsString';
13410
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand2?.valueAsString ?? ''));
13461
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand2?.valueAsString ?? ''));
13411
13462
  key = index + '.expressionData.operand3.valueAsString';
13412
- widgets.push(this.constructFormWidget(key, filterExpressionField.label3, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand3?.valueAsString ?? ''));
13463
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label3, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand3?.valueAsString ?? ''));
13413
13464
  return;
13414
13465
  }
13415
13466
  if (filterExpressionField.expressionData?.operand2) {
13416
13467
  if (key !== index + '.expressionData.operand2.selectedValues') {
13417
13468
  key = index + '.expressionData.operand2.valueAsString';
13418
13469
  }
13419
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand2?.valueAsString ?? ''));
13470
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand2?.valueAsString ?? ''));
13420
13471
  return;
13421
13472
  }
13422
13473
  if (filterExpressionField?.expressionData?.operand3) {
13423
13474
  if (key !== index + '.selectedValues') {
13424
13475
  key = index + '.expressionData.operand3.valueAsString';
13425
13476
  }
13426
- widgets.push(this.constructFormWidget(key, filterExpressionField.label3, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand3?.valueAsString ?? ''));
13477
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label3, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand3?.valueAsString ?? ''));
13427
13478
  return;
13428
13479
  }
13429
13480
  });
@@ -13528,10 +13579,10 @@ class SmartFilterEditorContentComponent {
13528
13579
  }
13529
13580
  constructFormWidget(key, label, widgetType, possibleValues, value) {
13530
13581
  let type = widgetType;
13531
- if (type === FilterExpressionFieldWidgetType.Date) {
13582
+ if (type === FilterExpressionFieldWidgetType.DATE) {
13532
13583
  type = SmartFormWidgetType.DATE_PICKER;
13533
13584
  }
13534
- else if (type === FilterExpressionFieldWidgetType.DateTime) {
13585
+ else if (type === FilterExpressionFieldWidgetType.DATE_TIME) {
13535
13586
  type = SmartFormWidgetType.DATE_TIME_PICKER;
13536
13587
  }
13537
13588
  let widget = {
@@ -14049,6 +14100,18 @@ class SmartComponentLayoutUtility {
14049
14100
  }
14050
14101
  return result;
14051
14102
  }
14103
+ static getToolbars(comp) {
14104
+ let result = [];
14105
+ if (comp.components) {
14106
+ result = comp.components
14107
+ .map((c) => this.getToolbars(c))
14108
+ .reduce((acc, value) => acc.concat(value), []);
14109
+ }
14110
+ if (comp.toolbar) {
14111
+ result.push(comp.toolbar);
14112
+ }
14113
+ return result;
14114
+ }
14052
14115
  }
14053
14116
 
14054
14117
  /*
@@ -14513,6 +14576,7 @@ class SmartComponentApiClient {
14513
14576
  if (comp.smartComponentLayout) {
14514
14577
  // TODO maybe we should set comp.parent, not comp.smartComponentLayout.parentComponent..
14515
14578
  SmartComponentLayoutUtility.setParent(comp.smartComponentLayout, this);
14579
+ this.initActions();
14516
14580
  }
14517
14581
  if (this.uuid && this.uuid !== comp.uuid)
14518
14582
  comp.uuid = this.uuid;
@@ -14639,6 +14703,9 @@ class SmartComponentApiClient {
14639
14703
  toolbars.push(grid.toolbar);
14640
14704
  }
14641
14705
  });
14706
+ this.getSmartComponentLayoutsQL()?.forEach((comp) => {
14707
+ toolbars.push(...SmartComponentLayoutUtility.getToolbars(comp));
14708
+ });
14642
14709
  return toolbars;
14643
14710
  }
14644
14711
  initData() {
@@ -15186,5 +15253,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
15186
15253
  * Generated bundle index. Do not edit.
15187
15254
  */
15188
15255
 
15189
- export { APIS$3 as APIS, ApiModule$3 as ApiModule, ApiQueueService, BASE_PATH$5 as BASE_PATH, COLLECTION_FORMATS$5 as COLLECTION_FORMATS, CloseResult, ComponentFactoryService, ComponentFactoryServiceModule, ComponentType, ComponentWidgetType, Configuration$5 as Configuration, DIALOG_DISABLE_CLOSE, DataChangeKind, DefaultUiActionCode_CLOSE, ExpandableSectionButtonIconPosition, ExpandableSectionButtonType, ExpandableSectionComponent, FilterExpressionBoolOperator$1 as FilterExpressionBoolOperator, FilterExpressionBuilderGroup, FilterExpressionDataType, FilterExpressionFieldWidgetType, FilterExpressionOperation, FilterExpressionOrderBy, GridColumnContentType, GridDataAccessConfigKindEnum, GridSelectionMode, GridSelectionType, GridUiActionType, GridViewDescriptorKindEnum, IS_ASYNC_PARAM_NAME, IconPosition, ImageResourceKindEnum, LayoutDirection, LinkTargetEnum, MessageOptionType, MessageTextType, MessageType, SelectionDefinitionTypeEnum, SessionAPIS, SessionErrorBehaviour, SessionService, SharedModule, SimplifiedTabGroupComponent, SmartActionType, SmartAuthService, SmartComponent, SmartComponentApiClient, SmartComponentLayoutComponent, SmartComponentLayoutModule, SmartComponentLayoutUtility, SmartDatePipe, SmartDateTimePipe, SmartDialog, SmartExpandableSectionModule, SmartExpandableSectionService, SmartFileUploaderComponent, SmartFilterComponent, SmartFilterEditorContentComponent, SmartFilterEditorModule, SmartFilterEditorService, SmartFilterExpressionItemComponent, SmartFilterExpressionItemsComponent, SmartFilterModule, SmartFilterParamComponent, SmartFilterParamsComponent, SmartFilterPosition, SmartFilterType, SmartFormTextFieldButtonIconPosition, SmartFormWidgetDirection, SmartFormWidgetType, SmartFormWidgetWidth, SmartGridButtonType, SmartGridComponent, SmartGridDataLayout, SmartGridModule, SmartGridService, SmartGridType, SmartIconComponent, SmartIconModule, SmartIconService, SmartLayoutDef, SmartLinkChannelVariableInPath, SmartLinkUuidVariableInPath, SmartNavbarComponent, SmartNavbarModule, SmartNavbarService, SmartNavigationModule, SmartNavigationService, SmartNgClientModule, SmartNgClientService, SmartService, SmartSessionModule, SmartSessionService, SmartSessionTimerComponent, SmartSessionTimerService, SmartSubject, SmartTabGroupModule, SmartTabGroupService, SmartTable, SmartTableButtonType, SmartTableHeaderPropertyType, SmartTableInterfaceTypeEnum, SmartTableOptionButtonDirection, SmartTableOrder, SmartTableType, SmartTimePipe, SmartTooltipDirective, SmartTreeComponent, SmartTreeNodeButtonType, SmartUserSettinsIconPosition, SmartValidatorName, SmartViewContextErrorDialogButtonLabel, SmartViewContextErrorDialogMessage, SmartViewContextErrorDialogTitle, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, SmartWidgetHintPosition, SmartWidgetHintPositionEnum, SmartWidgetSettings, SmartdialogModule, SmartdialogService, SmartfileuploaderComponent, SmartformComponent, SmartformLayoutDefinitionService, SmartformModule, SmartformwidgetComponent, SmarttableComponent, SmarttableModule, SmarttableService, SmarttreeGenericService, SmarttreeModule, SmarttreeService, TabGroupComponent, ToggleLabelPosition, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, UiActionTooltipTooltipPositionEnum, ViewEventHandlerViewEventTypeEnum, ViewService, ViewState, ViewType, WidgetMap };
15256
+ export { APIS$3 as APIS, ApiModule$3 as ApiModule, ApiQueueService, BASE_PATH$5 as BASE_PATH, COLLECTION_FORMATS$5 as COLLECTION_FORMATS, CloseResult, ComponentFactoryService, ComponentFactoryServiceModule, ComponentType, ComponentWidgetType, Configuration$5 as Configuration, DIALOG_DISABLE_CLOSE, DataChangeKind, DefaultUiActionCode_CLOSE, ExpandableSectionButtonIconPosition, ExpandableSectionButtonType, ExpandableSectionComponent, FilterExpressionBoolOperator$1 as FilterExpressionBoolOperator, FilterExpressionBuilderGroupBuilderGroupKindEnum, FilterExpressionDataType, FilterExpressionFieldWidgetType, FilterExpressionOperation, FilterExpressionOrderByOrderEnum, GridColumnContentType, GridDataAccessConfigKindEnum, GridSelectionMode, GridSelectionType, GridUiActionType, GridViewDescriptorKindEnum, IS_ASYNC_PARAM_NAME, IconPosition, ImageResourceKindEnum, LayoutDirection, LinkTargetEnum, MessageOptionType, MessageTextType, MessageType, SelectionDefinitionTypeEnum, SessionAPIS, SessionErrorBehaviour, SessionService, SharedModule, SimplifiedTabGroupComponent, SmartActionType, SmartAuthService, SmartComponent, SmartComponentApiClient, SmartComponentLayoutComponent, SmartComponentLayoutModule, SmartComponentLayoutUtility, SmartDatePipe, SmartDateTimePipe, SmartDialog, SmartExpandableSectionModule, SmartExpandableSectionService, SmartFileUploaderComponent, SmartFilterComponent, SmartFilterEditorContentComponent, SmartFilterEditorModule, SmartFilterEditorService, SmartFilterExpressionItemComponent, SmartFilterExpressionItemsComponent, SmartFilterModule, SmartFilterParamComponent, SmartFilterParamsComponent, SmartFilterPosition, SmartFilterType, SmartFormTextFieldButtonIconPosition, SmartFormWidgetDirection, SmartFormWidgetType, SmartFormWidgetWidth, SmartGridButtonType, SmartGridComponent, SmartGridDataLayout, SmartGridModule, SmartGridService, SmartGridType, SmartIconComponent, SmartIconModule, SmartIconService, SmartLayoutDef, SmartLinkChannelVariableInPath, SmartLinkUuidVariableInPath, SmartNavbarComponent, SmartNavbarModule, SmartNavbarService, SmartNavigationModule, SmartNavigationService, SmartNgClientModule, SmartNgClientService, SmartService, SmartSessionModule, SmartSessionService, SmartSessionTimerComponent, SmartSessionTimerService, SmartSubject, SmartTabGroupModule, SmartTabGroupService, SmartTable, SmartTableButtonType, SmartTableHeaderPropertyType, SmartTableInterfaceTypeEnum, SmartTableOptionButtonDirection, SmartTableOrder, SmartTableType, SmartTimePipe, SmartTooltipDirective, SmartTreeComponent, SmartTreeNodeButtonType, SmartUserSettinsIconPosition, SmartValidatorName, SmartViewContextErrorDialogButtonLabel, SmartViewContextErrorDialogMessage, SmartViewContextErrorDialogTitle, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, SmartWidgetHintPosition, SmartWidgetHintPositionEnum, SmartWidgetSettings, SmartdialogModule, SmartdialogService, SmartfileuploaderComponent, SmartformComponent, SmartformLayoutDefinitionService, SmartformModule, SmartformwidgetComponent, SmarttableComponent, SmarttableModule, SmarttableService, SmarttreeGenericService, SmarttreeModule, SmarttreeService, TabGroupComponent, ToggleLabelPosition, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, UiActionTooltipTooltipPositionEnum, ViewEventHandlerViewEventTypeEnum, ViewService, ViewState, ViewType, WidgetMap };
15190
15257
  //# sourceMappingURL=smartbit4all-ng-client.mjs.map