@smartbit4all/ng-client 4.0.27 → 4.0.29

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.
@@ -10472,6 +10472,442 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
10472
10472
  type: Injectable
10473
10473
  }], ctorParameters: () => [{ type: GridService }] });
10474
10474
 
10475
+ class SmartFilterService {
10476
+ constructor() {
10477
+ this._destroy$ = new Subject();
10478
+ this.shouldSubmit = new Subject();
10479
+ this.reSubscribeToSubmit = new Subject();
10480
+ this.change = new Subject();
10481
+ }
10482
+ ngOnDestroy() {
10483
+ this._destroy$.next();
10484
+ this._destroy$.complete();
10485
+ }
10486
+ async submit() {
10487
+ this.shouldSubmit.next();
10488
+ await this.shouldSubmit.pipe(takeUntil(this._destroy$)).toPromise();
10489
+ this.shouldSubmit = new Subject();
10490
+ this.reSubscribeToSubmit.next();
10491
+ return this.filter;
10492
+ }
10493
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
10494
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterService, providedIn: 'root' }); }
10495
+ }
10496
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterService, decorators: [{
10497
+ type: Injectable,
10498
+ args: [{
10499
+ providedIn: 'root',
10500
+ }]
10501
+ }], ctorParameters: () => [] });
10502
+
10503
+ /**
10504
+ * Filter API 2
10505
+ * Filter API 2
10506
+ *
10507
+ * The version of the OpenAPI document: 1.0.0
10508
+ * Contact: info@it4all.hu
10509
+ *
10510
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10511
+ * https://openapi-generator.tech
10512
+ * Do not edit the class manually.
10513
+ */
10514
+ var FilterExpressionBoolOperator$1;
10515
+ (function (FilterExpressionBoolOperator) {
10516
+ FilterExpressionBoolOperator["AND"] = "AND";
10517
+ FilterExpressionBoolOperator["OR"] = "OR";
10518
+ })(FilterExpressionBoolOperator$1 || (FilterExpressionBoolOperator$1 = {}));
10519
+
10520
+ /**
10521
+ * Filter API 2
10522
+ * Filter API 2
10523
+ *
10524
+ * The version of the OpenAPI document: 1.0.0
10525
+ * Contact: info@it4all.hu
10526
+ *
10527
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10528
+ * https://openapi-generator.tech
10529
+ * Do not edit the class manually.
10530
+ */
10531
+ var FilterExpressionDataType;
10532
+ (function (FilterExpressionDataType) {
10533
+ FilterExpressionDataType["STRING"] = "STRING";
10534
+ FilterExpressionDataType["NUMBER"] = "NUMBER";
10535
+ FilterExpressionDataType["DATE"] = "DATE";
10536
+ FilterExpressionDataType["DATE_TIME"] = "DATE_TIME";
10537
+ FilterExpressionDataType["BOOLEAN"] = "BOOLEAN";
10538
+ })(FilterExpressionDataType || (FilterExpressionDataType = {}));
10539
+
10540
+ /**
10541
+ * Filter API 2
10542
+ * Filter API 2
10543
+ *
10544
+ * The version of the OpenAPI document: 1.0.0
10545
+ * Contact: info@it4all.hu
10546
+ *
10547
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10548
+ * https://openapi-generator.tech
10549
+ * Do not edit the class manually.
10550
+ */
10551
+ var FilterExpressionFieldWidgetType;
10552
+ (function (FilterExpressionFieldWidgetType) {
10553
+ FilterExpressionFieldWidgetType["TEXT_FIELD"] = "TEXT_FIELD";
10554
+ FilterExpressionFieldWidgetType["TEXT_FIELD_CHIPS"] = "TEXT_FIELD_CHIPS";
10555
+ FilterExpressionFieldWidgetType["TEXT_FIELD_NUMBER"] = "TEXT_FIELD_NUMBER";
10556
+ FilterExpressionFieldWidgetType["TEXT_BOX"] = "TEXT_BOX";
10557
+ FilterExpressionFieldWidgetType["SELECT"] = "SELECT";
10558
+ FilterExpressionFieldWidgetType["SELECT_MULTIPLE"] = "SELECT_MULTIPLE";
10559
+ FilterExpressionFieldWidgetType["DATE"] = "DATE";
10560
+ FilterExpressionFieldWidgetType["TIME"] = "TIME";
10561
+ FilterExpressionFieldWidgetType["DATE_TIME"] = "DATE_TIME";
10562
+ FilterExpressionFieldWidgetType["CHECK_BOX"] = "CHECK_BOX";
10563
+ FilterExpressionFieldWidgetType["RADIO_BUTTON"] = "RADIO_BUTTON";
10564
+ FilterExpressionFieldWidgetType["RANGE"] = "RANGE";
10565
+ })(FilterExpressionFieldWidgetType || (FilterExpressionFieldWidgetType = {}));
10566
+
10567
+ /**
10568
+ * Filter API 2
10569
+ * Filter API 2
10570
+ *
10571
+ * The version of the OpenAPI document: 1.0.0
10572
+ * Contact: info@it4all.hu
10573
+ *
10574
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10575
+ * https://openapi-generator.tech
10576
+ * Do not edit the class manually.
10577
+ */
10578
+ var FilterExpressionOperation;
10579
+ (function (FilterExpressionOperation) {
10580
+ FilterExpressionOperation["EXPRESSION"] = "EXPRESSION";
10581
+ FilterExpressionOperation["EQUAL"] = "EQUAL";
10582
+ FilterExpressionOperation["NOT_EQUAL"] = "NOT_EQUAL";
10583
+ FilterExpressionOperation["LESS"] = "LESS";
10584
+ FilterExpressionOperation["LESS_OR_EQUAL"] = "LESS_OR_EQUAL";
10585
+ FilterExpressionOperation["GREATER"] = "GREATER";
10586
+ FilterExpressionOperation["GREATER_OR_EQUAL"] = "GREATER_OR_EQUAL";
10587
+ FilterExpressionOperation["LIKE"] = "LIKE";
10588
+ FilterExpressionOperation["NOT_LIKE"] = "NOT_LIKE";
10589
+ FilterExpressionOperation["BETWEEN"] = "BETWEEN";
10590
+ FilterExpressionOperation["NOT_BETWEEN"] = "NOT_BETWEEN";
10591
+ FilterExpressionOperation["IS_EMPTY"] = "IS_EMPTY";
10592
+ FilterExpressionOperation["IS_NOT_EMPTY"] = "IS_NOT_EMPTY";
10593
+ FilterExpressionOperation["EXISTS"] = "EXISTS";
10594
+ FilterExpressionOperation["NOT_EXISTS"] = "NOT_EXISTS";
10595
+ FilterExpressionOperation["IN"] = "IN";
10596
+ FilterExpressionOperation["NOT_IN"] = "NOT_IN";
10597
+ })(FilterExpressionOperation || (FilterExpressionOperation = {}));
10598
+
10599
+ /**
10600
+ * Filter API 2
10601
+ * Filter API 2
10602
+ *
10603
+ * The version of the OpenAPI document: 1.0.0
10604
+ * Contact: info@it4all.hu
10605
+ *
10606
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10607
+ * https://openapi-generator.tech
10608
+ * Do not edit the class manually.
10609
+ */
10610
+ var FilterExpressionOrderByOrderEnum;
10611
+ (function (FilterExpressionOrderByOrderEnum) {
10612
+ FilterExpressionOrderByOrderEnum["ASC"] = "ASC";
10613
+ FilterExpressionOrderByOrderEnum["DESC"] = "DESC";
10614
+ })(FilterExpressionOrderByOrderEnum || (FilterExpressionOrderByOrderEnum = {}));
10615
+ ;
10616
+
10617
+ /**
10618
+ * Filter API 2
10619
+ * Filter API 2
10620
+ *
10621
+ * The version of the OpenAPI document: 1.0.0
10622
+ * Contact: info@it4all.hu
10623
+ *
10624
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10625
+ * https://openapi-generator.tech
10626
+ * Do not edit the class manually.
10627
+ */
10628
+
10629
+ var FilterExpressionBuilderGroupBuilderGroupKindEnum;
10630
+ (function (FilterExpressionBuilderGroupBuilderGroupKindEnum) {
10631
+ FilterExpressionBuilderGroupBuilderGroupKindEnum["DIPLAY"] = "DIPLAY";
10632
+ FilterExpressionBuilderGroupBuilderGroupKindEnum["BRACKET"] = "BRACKET";
10633
+ FilterExpressionBuilderGroupBuilderGroupKindEnum["EXIST"] = "EXIST";
10634
+ })(FilterExpressionBuilderGroupBuilderGroupKindEnum || (FilterExpressionBuilderGroupBuilderGroupKindEnum = {}));
10635
+ ;
10636
+
10637
+ class SmartFilterSimpleFieldComponent {
10638
+ constructor(service, cfService) {
10639
+ this.service = service;
10640
+ this.cfService = cfService;
10641
+ this._destroy$ = new Subject();
10642
+ }
10643
+ ngOnInit() {
10644
+ this.operation = this.filterExpressionField.expressionData?.currentOperation;
10645
+ this.currentOperation = this.getOptionLabel(this.operation);
10646
+ }
10647
+ ngAfterViewInit() {
10648
+ this.constructForm();
10649
+ }
10650
+ ngOnDestroy() {
10651
+ this._destroy$.next();
10652
+ this._destroy$.complete();
10653
+ }
10654
+ constructFormWidget(key, label, widgetType, possibleValues, placeholder) {
10655
+ let type = widgetType;
10656
+ if (type === FilterExpressionFieldWidgetType.DATE) {
10657
+ type = SmartFormWidgetType.DATE_PICKER;
10658
+ }
10659
+ else if (type === FilterExpressionFieldWidgetType.DATE_TIME) {
10660
+ type = SmartFormWidgetType.DATE_TIME_PICKER;
10661
+ }
10662
+ let widget = {
10663
+ key,
10664
+ label,
10665
+ type,
10666
+ value: '',
10667
+ placeholder: placeholder,
10668
+ showLabel: true,
10669
+ valueList: possibleValues.map((value) => {
10670
+ return {
10671
+ key: value.objectUri ? value.objectUri : value.code,
10672
+ label: value.displayValue,
10673
+ type: SmartFormWidgetType.ITEM,
10674
+ value: value.objectUri ? value.objectUri : value.code,
10675
+ };
10676
+ }),
10677
+ };
10678
+ return widget;
10679
+ }
10680
+ constructForm() {
10681
+ this.vcRefForm?.clear();
10682
+ let widgets = [];
10683
+ let key;
10684
+ if (this.filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
10685
+ key = 'expressionData.operand2.selectedValues';
10686
+ }
10687
+ if (this.filterExpressionField.expressionData?.operand2) {
10688
+ if (key !== 'expressionData.operand2.selectedValues') {
10689
+ key = 'expressionData.operand2.valueAsString';
10690
+ }
10691
+ widgets.push(this.constructFormWidget(key, this.filterExpressionField.label2, this.filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, this.filterExpressionField.possibleValues, this.filterExpressionField.placeholder2));
10692
+ }
10693
+ if (this.filterExpressionField.expressionData?.operand3) {
10694
+ if (key !== 'selectedValues') {
10695
+ key = 'expressionData.operand3.valueAsString';
10696
+ }
10697
+ widgets.push(this.constructFormWidget(key, this.filterExpressionField.label3, this.filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, this.filterExpressionField.possibleValues, this.filterExpressionField.placeholder3));
10698
+ }
10699
+ this.operation = this.filterExpressionField.expressionData?.currentOperation;
10700
+ this.currentOperation = this.getOptionLabel(this.operation);
10701
+ this.smartForm = {
10702
+ direction: SmartFormWidgetDirection.ROW,
10703
+ componentModel: { data: this.filterExpressionField },
10704
+ useOnValueChangeEvent: true,
10705
+ useOnBlurEvent: true,
10706
+ submitOnEnter: this.service.filter?.submitOnEnter,
10707
+ widgets,
10708
+ translateService: this.service.filter?.translateService,
10709
+ };
10710
+ // Show form on page
10711
+ this.componentRefForm = this.cfService.createComponent(this.vcRefForm, SmartformComponent, new Map([['smartForm', this.smartForm]]));
10712
+ this.componentRefForm.instance.onValueChangeSubject
10713
+ ?.pipe(takeUntil(this._destroy$))
10714
+ .subscribe(() => {
10715
+ this.submit();
10716
+ this.service.change.next();
10717
+ });
10718
+ this.componentRefForm.instance.onBlurSubject?.pipe(takeUntil(this._destroy$)).subscribe(() => {
10719
+ this.submit();
10720
+ this.service.change.next();
10721
+ });
10722
+ }
10723
+ submit() {
10724
+ let form = this.componentRefForm.instance.submitForm();
10725
+ this.filterExpressionField = form.componentModel?.data;
10726
+ this.simpleFieldChildren.forEach((smartFilterFieldComponent, index) => {
10727
+ let filterExpressionField = smartFilterFieldComponent.submit();
10728
+ this.filterExpressionField.subFieldList.filters[index] = filterExpressionField;
10729
+ });
10730
+ return this.filterExpressionField;
10731
+ }
10732
+ optionSelected(option) {
10733
+ let oldOption = this.componentRefForm.instance.smartForm.componentModel.data.expressionData
10734
+ .currentOperation;
10735
+ this.componentRefForm.instance.smartForm.componentModel.data.expressionData.currentOperation =
10736
+ option;
10737
+ this.operation = option;
10738
+ this.currentOperation = this.getOptionLabel(this.operation);
10739
+ if (oldOption !== FilterExpressionOperation.BETWEEN &&
10740
+ option === FilterExpressionOperation.BETWEEN) {
10741
+ this.submit();
10742
+ let label = this.filterExpressionField.label2;
10743
+ this.filterExpressionField.label2 = `${label} - tól`;
10744
+ this.filterExpressionField.label3 = `${label} - ig`;
10745
+ this.filterExpressionField.expressionData.operand3 = {
10746
+ isDataName: this.filterExpressionField.expressionData.operand2?.isDataName,
10747
+ type: this.filterExpressionField.expressionData.operand3?.type,
10748
+ valueAsString: this.filterExpressionField.expressionData.operand3?.valueAsString,
10749
+ selectedValues: this.filterExpressionField.expressionData.operand3?.selectedValues,
10750
+ };
10751
+ this.constructForm();
10752
+ }
10753
+ else if (oldOption === FilterExpressionOperation.BETWEEN &&
10754
+ option !== FilterExpressionOperation.BETWEEN) {
10755
+ let label = this.filterExpressionField.label2.replace(' - tól', '');
10756
+ this.filterExpressionField.label2 = `${label}`;
10757
+ this.filterExpressionField.label3 = undefined;
10758
+ this.filterExpressionField.expressionData.operand3 = undefined;
10759
+ this.constructForm();
10760
+ }
10761
+ }
10762
+ getOptionLabel(option) {
10763
+ if (!option) {
10764
+ return '';
10765
+ }
10766
+ else if (this.operationTranslator) {
10767
+ return this.operationTranslator(option);
10768
+ }
10769
+ return option;
10770
+ }
10771
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterSimpleFieldComponent, deps: [{ token: SmartFilterService }, { token: ComponentFactoryService }], target: i0.ɵɵFactoryTarget.Component }); }
10772
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", 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-mdc-icon-button{height:24px;width:24px}.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-unelevated-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-outlined-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-raised-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-icon-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-fab .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-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"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i5$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i2$3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] }); }
10773
+ }
10774
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterSimpleFieldComponent, decorators: [{
10775
+ type: Component,
10776
+ 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-mdc-icon-button{height:24px;width:24px}.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-unelevated-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-outlined-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-raised-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-icon-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-fab .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-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"] }]
10777
+ }], ctorParameters: () => [{ type: SmartFilterService }, { type: ComponentFactoryService }], propDecorators: { simpleFieldChildren: [{
10778
+ type: ViewChildren,
10779
+ args: ['simpleField']
10780
+ }], operationTranslator: [{
10781
+ type: Input
10782
+ }], filterExpressionField: [{
10783
+ type: Input
10784
+ }], showPossibleActions: [{
10785
+ type: Input
10786
+ }], vcRefForm: [{
10787
+ type: ViewChild,
10788
+ args: ['form', { read: ViewContainerRef }]
10789
+ }] } });
10790
+
10791
+ class SmartFilterSimpleComponent {
10792
+ constructor(service) {
10793
+ this.service = service;
10794
+ this._destroy$ = new Subject();
10795
+ this.service.reSubscribeToSubmit.pipe(takeUntil(this._destroy$)).subscribe(() => {
10796
+ this.subscribeToSubmit();
10797
+ });
10798
+ this.subscribeToSubmit();
10799
+ }
10800
+ ngOnInit() {
10801
+ this.smartFilter = this.service.filter;
10802
+ }
10803
+ ngOnDestroy() {
10804
+ this._destroy$.next();
10805
+ this._destroy$.complete();
10806
+ }
10807
+ subscribeToSubmit() {
10808
+ this.service.shouldSubmit.pipe(takeUntil(this._destroy$)).subscribe(() => {
10809
+ this.submit();
10810
+ });
10811
+ }
10812
+ submit() {
10813
+ this.simpleFieldChildren.forEach((smartFilterFieldComponent, index) => {
10814
+ this.smartFilter.data[index] = smartFilterFieldComponent.submit();
10815
+ });
10816
+ this.service.filter = this.smartFilter;
10817
+ this.service.shouldSubmit.complete();
10818
+ }
10819
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterSimpleComponent, deps: [{ token: SmartFilterService }], target: i0.ɵɵFactoryTarget.Component }); }
10820
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", 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"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SmartFilterSimpleFieldComponent, selector: "smart-filter-simple-field", inputs: ["operationTranslator", "filterExpressionField", "showPossibleActions"] }] }); }
10821
+ }
10822
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterSimpleComponent, decorators: [{
10823
+ type: Component,
10824
+ 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"] }]
10825
+ }], ctorParameters: () => [{ type: SmartFilterService }], propDecorators: { simpleFieldChildren: [{
10826
+ type: ViewChildren,
10827
+ args: ["simpleField"]
10828
+ }] } });
10829
+
10830
+ class SmartFilterComponent {
10831
+ constructor(service) {
10832
+ this.service = service;
10833
+ }
10834
+ ngOnInit() {
10835
+ if (this.filter) {
10836
+ this.setUp();
10837
+ }
10838
+ }
10839
+ ngOnChanges(changes) {
10840
+ if (changes['filter'].currentValue) {
10841
+ this.setUp();
10842
+ }
10843
+ }
10844
+ setUp() {
10845
+ this.service.filter = this.filter;
10846
+ }
10847
+ async submit() {
10848
+ return await this.service.submit();
10849
+ }
10850
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterComponent, deps: [{ token: SmartFilterService }], target: i0.ɵɵFactoryTarget.Component }); }
10851
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", 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: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SmartFilterSimpleComponent, selector: "smart-filter-simple" }] }); }
10852
+ }
10853
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterComponent, decorators: [{
10854
+ type: Component,
10855
+ args: [{ selector: 'smart-filter', providers: [SmartFilterService], template: "<smart-filter-simple *ngIf=\"filter\" #simpleFilter></smart-filter-simple>\r\n" }]
10856
+ }], ctorParameters: () => [{ type: SmartFilterService }], propDecorators: { filter: [{
10857
+ type: Input
10858
+ }] } });
10859
+
10860
+ class SmartFilterExpressionFieldComponent {
10861
+ constructor() { }
10862
+ ngOnInit() {
10863
+ }
10864
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterExpressionFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10865
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: SmartFilterExpressionFieldComponent, selector: "lib-smart-filter-expression-field", ngImport: i0, template: "", styles: [""] }); }
10866
+ }
10867
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterExpressionFieldComponent, decorators: [{
10868
+ type: Component,
10869
+ args: [{ selector: 'lib-smart-filter-expression-field', template: "" }]
10870
+ }], ctorParameters: () => [] });
10871
+
10872
+ class SmartFilterModule {
10873
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
10874
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterModule, declarations: [SmartFilterComponent,
10875
+ SmartFilterExpressionFieldComponent,
10876
+ SmartFilterSimpleComponent,
10877
+ SmartFilterSimpleFieldComponent], imports: [BrowserModule, SmartViewContextModule, MatMenuModule, MatIconModule, MatButtonModule], exports: [SmartFilterComponent] }); }
10878
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterModule, imports: [BrowserModule, SmartViewContextModule, MatMenuModule, MatIconModule, MatButtonModule] }); }
10879
+ }
10880
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterModule, decorators: [{
10881
+ type: NgModule,
10882
+ args: [{
10883
+ declarations: [
10884
+ SmartFilterComponent,
10885
+ SmartFilterExpressionFieldComponent,
10886
+ SmartFilterSimpleComponent,
10887
+ SmartFilterSimpleFieldComponent,
10888
+ ],
10889
+ imports: [BrowserModule, SmartViewContextModule, MatMenuModule, MatIconModule, MatButtonModule],
10890
+ exports: [SmartFilterComponent],
10891
+ }]
10892
+ }] });
10893
+
10894
+ var SmartFilterPosition;
10895
+ (function (SmartFilterPosition) {
10896
+ SmartFilterPosition[SmartFilterPosition["TOP"] = 0] = "TOP";
10897
+ SmartFilterPosition[SmartFilterPosition["BOTTOM"] = 1] = "BOTTOM";
10898
+ SmartFilterPosition[SmartFilterPosition["LEFT"] = 2] = "LEFT";
10899
+ SmartFilterPosition[SmartFilterPosition["RIGHT"] = 3] = "RIGHT";
10900
+ })(SmartFilterPosition || (SmartFilterPosition = {}));
10901
+ var SmartFilterType;
10902
+ (function (SmartFilterType) {
10903
+ SmartFilterType[SmartFilterType["SIMPLE"] = 0] = "SIMPLE";
10904
+ SmartFilterType[SmartFilterType["ADVANCED"] = 1] = "ADVANCED";
10905
+ })(SmartFilterType || (SmartFilterType = {}));
10906
+
10907
+ /*
10908
+ * Public API Surface of smart-filter
10909
+ */
10910
+
10475
10911
  var ExpandableSectionButtonType;
10476
10912
  (function (ExpandableSectionButtonType) {
10477
10913
  ExpandableSectionButtonType[ExpandableSectionButtonType["BUTTON"] = 0] = "BUTTON";
@@ -10732,7 +11168,7 @@ class SmartGridComponent {
10732
11168
  this.smartGrid?.gridModel.view?.orderedColumnNames.map((orderedCol) => {
10733
11169
  this.smartGrid?.gridModel.view?.descriptor?.columns.map((colum) => {
10734
11170
  if (orderedCol === colum.propertyName) {
10735
- this.columns.push(colum.label);
11171
+ this.columns.push(colum);
10736
11172
  }
10737
11173
  });
10738
11174
  });
@@ -11315,12 +11751,56 @@ class SmartGridComponent {
11315
11751
  });
11316
11752
  this.menu.toggle(event);
11317
11753
  }
11754
+ gridSort(event) {
11755
+ let orderByList = [];
11756
+ event.multiSortMeta?.map((meta, index) => {
11757
+ if (this.previousmultiSortMeta && this.previousmultiSortMeta.length > 0) {
11758
+ this.previousmultiSortMeta.map((order) => {
11759
+ console.log(order);
11760
+ if (meta.field === order.field && order.order != meta.order) {
11761
+ switch (order.order) {
11762
+ case -1:
11763
+ event.multiSortMeta.splice(index, 1);
11764
+ break;
11765
+ }
11766
+ }
11767
+ });
11768
+ }
11769
+ else {
11770
+ this.previousmultiSortMeta = event.multiSortMeta;
11771
+ }
11772
+ });
11773
+ event.multiSortMeta?.map((meta) => {
11774
+ orderByList.push({
11775
+ propertyName: meta.field,
11776
+ order: meta.order === 1
11777
+ ? FilterExpressionOrderByOrderEnum.ASC
11778
+ : meta.order === -1
11779
+ ? FilterExpressionOrderByOrderEnum.DESC
11780
+ : undefined,
11781
+ });
11782
+ });
11783
+ this.service.sort(this.smartGrid, {
11784
+ orderByList: orderByList,
11785
+ orderedColumnNames: this.smartGrid?.gridModel.view?.orderedColumnNames,
11786
+ });
11787
+ }
11788
+ lazyLoad(event) {
11789
+ this.previousmultiSortMeta = [];
11790
+ this.smartGrid?.gridModel.view?.orderByList.map((order) => {
11791
+ this.previousmultiSortMeta?.push({
11792
+ field: order.propertyName,
11793
+ order: order.order === FilterExpressionOrderByOrderEnum.ASC ? 1 : -1,
11794
+ });
11795
+ });
11796
+ event.multiSortMeta = this.previousmultiSortMeta;
11797
+ }
11318
11798
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartGridComponent, deps: [{ token: SmartGridService }, { token: ComponentFactoryService }, { token: i1$1.MatDialog }, { token: UiActionDescriptorService }, { token: COMPONENT_LIBRARY }, { token: 'gridMenuIcon' }], target: i0.ɵɵFactoryTarget.Component }); }
11319
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.11", type: SmartGridComponent, selector: "smart-grid", inputs: { smartGrid: "smartGrid", uuid: "uuid", dev: "dev" }, providers: [SmartGridService], viewQueries: [{ propertyName: "vcRefTable", first: true, predicate: ["table"], descendants: true, read: ViewContainerRef }, { propertyName: "toolbar", first: true, predicate: ["toolbar"], descendants: true }, { propertyName: "menu", first: true, predicate: ["menu"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if(compLib === componentLibrary.PRIMENG) {\r\n<div *ngIf=\"smartGrid\" class=\"primeSmartGrid-container\">\r\n <p-table #pTable [value]=\"smartGrid.gridModel.page.rows!\">\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th *ngFor=\"let col of columns\">\r\n {{ col }}\r\n </th>\r\n <th></th>\r\n </tr>\r\n <!-- <tr>\r\n <th *ngFor=\"let col of smartGrid?.gridModel?.view?.orderedColumnNames\">\r\n <p-columnFilter\r\n type=\"text\"\r\n [field]=\"'data.' + col\"\r\n [placeholder]=\"'Search by ' + col\"\r\n [ariaLabel]=\"'Filter ' + col\"\r\n />\r\n </th>\r\n </tr> -->\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-row>\r\n <tr>\r\n <td *ngFor=\"let col of smartGrid?.gridModel?.view?.orderedColumnNames\">\r\n {{ row.data[col] }}\r\n </td>\r\n <td>\r\n <p-button\r\n [rounded]=\"true\"\r\n [text]=\"true\"\r\n *ngIf=\"row.actions && row.actions.length > 0\"\r\n (onClick)=\"onOptionsClick($event, row)\"\r\n >\r\n <smart-icon icon=\"ellipsis-v\"></smart-icon>\r\n </p-button>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <p-paginator\r\n *ngIf=\"smartGrid.paginator\"\r\n [first]=\"pageIndex!\"\r\n [totalRecords]=\"length!\"\r\n [rows]=\"pageSize\"\r\n [rowsPerPageOptions]=\"pageSizeOptions\"\r\n (onPageChange)=\"onPrimeChangePage($event)\"\r\n [showCurrentPageReport]=\"true\"\r\n />\r\n <p-menu #menu [model]=\"menuButtons\" [popup]=\"true\"> </p-menu>\r\n</div>\r\n}@else {\r\n<div *ngIf=\"smartGrid\" class=\"smartGrid-container\">\r\n <div class=\"smart-grid-toolbar\">\r\n <smart-ui-action-toolbar #toolbar [id]=\"'grid_not_initialized'\"></smart-ui-action-toolbar>\r\n <button\r\n (click)=\"editColumns()\"\r\n mat-mini-fab\r\n color=\"text-primary\"\r\n *ngIf=\"smartGrid.showEditColumns\"\r\n >\r\n <mat-icon aria-hidden=\"false\" aria-label=\"Columns\" class=\"smart-grid-edit-icon\"\r\n >view_columns</mat-icon\r\n >\r\n </button>\r\n </div>\r\n <!-- <div [ngClass]=\"isBlocked ? 'blocked' : ''\"></div> -->\r\n <div class=\"smartGridContent\">\r\n <div>\r\n <div *ngIf=\"smartGrid.showResultCount\">\r\n <div class=\"smartGrid-data-number\">\r\n {{ smartGrid.gridModel.totalRowCount }}\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"smart-grid-table-container\">\r\n <ng-template #table></ng-template>\r\n </div>\r\n\r\n <div *ngIf=\"smartGrid.layoutDef === layoutDef().EXPANDABLE\">\r\n <smart-expandable-section\r\n #gridExpandableSection\r\n *ngFor=\"let expandableSection of expandableSections\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n </div>\r\n <div\r\n *ngIf=\"smartGrid.layoutDef === layoutDef().CARD\"\r\n class=\"cards-container\"\r\n [ngStyle]=\"{\r\n 'grid-template-columns':\r\n smartGrid.numberOfColumn !== undefined\r\n ? 'repeat(' + smartGrid.numberOfColumn + ', 1fr)'\r\n : ''\r\n }\"\r\n >\r\n <app-smart-grid-card\r\n class=\"smartGrid-card-container\"\r\n *ngFor=\"let task of smartGrid.gridModel.page.rows\"\r\n [item]=\"task\"\r\n [smartGrid]=\"smartGrid\"\r\n [onSelect]=\"onSelect.bind(this)\"\r\n ></app-smart-grid-card>\r\n </div>\r\n <div\r\n *ngIf=\"smartGrid.layoutDef === layoutDef().TREE && treeControl\"\r\n class=\"tree-container\"\r\n [ngStyle]=\"{\r\n 'grid-template-columns':\r\n smartGrid.numberOfColumn !== undefined\r\n ? 'repeat(' + smartGrid.numberOfColumn + ', 1fr)'\r\n : ''\r\n }\"\r\n >\r\n <mat-tree [dataSource]=\"treeDataSource!\" [treeControl]=\"treeControl!\">\r\n <mat-tree-node\r\n *matTreeNodeDef=\"let node\"\r\n matTreeNodeToggle\r\n matTreeNodePadding\r\n matTreeNodePaddingIndent=\"24\"\r\n >\r\n <button mat-icon-button disabled class=\"tree-button\"></button>\r\n <mat-checkbox\r\n class=\"checklist-leaf-node\"\r\n [checked]=\"treeChecklistSelection?.isSelected(node)\"\r\n (change)=\"treeNodeSelectionToggle(node)\"\r\n >{{ getTreeItem(node) }}</mat-checkbox\r\n >\r\n </mat-tree-node>\r\n\r\n <mat-tree-node\r\n *matTreeNodeDef=\"let node; when: hasChild\"\r\n matTreeNodePadding\r\n matTreeNodePaddingIndent=\"24\"\r\n >\r\n <button\r\n mat-icon-button\r\n matTreeNodeToggle\r\n class=\"tree-button\"\r\n [attr.aria-label]=\"'Toggle ' + node.item\"\r\n >\r\n <mat-icon class=\"mat-icon-rtl-mirror\">\r\n {{ treeControl!.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\r\n </mat-icon>\r\n </button>\r\n <mat-checkbox\r\n [checked]=\"treeChecklistSelection?.isSelected(node)\"\r\n [indeterminate]=\"descendantsPartiallySelected(node)\"\r\n (change)=\"treeNodeSelectionToggle(node)\"\r\n >{{ getTreeItem(node) }}</mat-checkbox\r\n >\r\n </mat-tree-node>\r\n </mat-tree>\r\n </div>\r\n </div>\r\n\r\n <mat-paginator\r\n *ngIf=\"smartGrid.paginator && !treeControl\"\r\n #paginator\r\n [length]=\"length\"\r\n [pageIndex]=\"pageIndex\"\r\n [pageSize]=\"pageSize\"\r\n [pageSizeOptions]=\"pageSizeOptions\"\r\n (page)=\"onChangePage($event)\"\r\n ></mat-paginator>\r\n</div>\r\n}\r\n", styles: [".smartGrid-container{position:relative;padding:1.5rem;display:flex;flex-direction:column;gap:1rem}.primeSmartGrid-container{display:flex;flex-direction:column;gap:1rem}.smartGrid-data-number{padding-bottom:1rem}.cards-container{display:grid;gap:1rem;padding:1rem}.smartGrid-card-container{height:auto;border:1px solid black;border-radius:8px}.smartGrid-container ::ng-deep .mat-form-field-appearance-legacy .mat-form-field-underline{bottom:0}.smartGridContent{width:100%;flex:1;overflow:auto}.blocked{position:absolute;width:calc(100% - 3rem);height:calc(100% - 3rem);z-index:110;background-color:#0003}.smart-grid-table-container{display:flex;flex-direction:column;gap:1rem}.smart-grid-toolbar{display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.smart-grid-toolbar smart-ui-action-toolbar{width:100%}.smart-grid-edit-icon{color:var(--light-gray)}.tree-button{width:24px!important;height:24px!important}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i2$3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i2$3.MatMiniFabButton, selector: "button[mat-mini-fab]", exportAs: ["matButton"] }, { kind: "component", type: i9$1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: i10$1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i10$1.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i10$1.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i10$1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i10$1.MatTreeNode, selector: "mat-tree-node", inputs: ["disabled", "tabIndex"], exportAs: ["matTreeNode"] }, { kind: "component", type: i4$2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }, { kind: "component", type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id"] }, { kind: "component", type: i14.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll", "virtualRowHeight"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i5$3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i17$1.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex"], outputs: ["onShow", "onHide", "onBlur", "onFocus"] }, { kind: "component", type: i18$1.Paginator, selector: "p-paginator", inputs: ["pageLinkSize", "style", "styleClass", "alwaysShow", "dropdownAppendTo", "templateLeft", "templateRight", "appendTo", "dropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showFirstLastIcon", "totalRecords", "rows", "rowsPerPageOptions", "showJumpToPageDropdown", "showJumpToPageInput", "jumpToPageItemTemplate", "showPageLinks", "locale", "dropdownItemTemplate", "first"], outputs: ["onPageChange"] }, { kind: "component", type: SmartGridCardComponent, selector: "app-smart-grid-card", inputs: ["item", "smartGrid", "onSelect"] }] }); }
11799
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.11", type: SmartGridComponent, selector: "smart-grid", inputs: { smartGrid: "smartGrid", uuid: "uuid", dev: "dev" }, providers: [SmartGridService], viewQueries: [{ propertyName: "vcRefTable", first: true, predicate: ["table"], descendants: true, read: ViewContainerRef }, { propertyName: "toolbar", first: true, predicate: ["toolbar"], descendants: true }, { propertyName: "menu", first: true, predicate: ["menu"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if(compLib === componentLibrary.PRIMENG) {\r\n<div *ngIf=\"smartGrid\" class=\"primeSmartGrid-container\">\r\n <p-table\r\n #pTable\r\n [value]=\"smartGrid.gridModel.page.rows!\"\r\n (sortFunction)=\"gridSort($event)\"\r\n [customSort]=\"true\"\r\n [sortMode]=\"'multiple'\"\r\n [lazy]=\"true\"\r\n (onLazyLoad)=\"lazyLoad($event)\"\r\n >\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th [pSortableColumn]=\"col.propertyName\" *ngFor=\"let col of columns\">\r\n <p-sortIcon [field]=\"col.propertyName\" />\r\n {{ col.label }}\r\n </th>\r\n <th></th>\r\n </tr>\r\n <!-- <tr>\r\n <th *ngFor=\"let col of smartGrid?.gridModel?.view?.orderedColumnNames\">\r\n <p-columnFilter\r\n type=\"text\"\r\n [field]=\"'data.' + col\"\r\n [placeholder]=\"'Search by ' + col\"\r\n [ariaLabel]=\"'Filter ' + col\"\r\n />\r\n </th>\r\n </tr> -->\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-row>\r\n <tr *ngIf=\"row && row.data\">\r\n <td *ngFor=\"let col of smartGrid?.gridModel?.view?.orderedColumnNames\">\r\n {{ row.data[col] }}\r\n </td>\r\n <td>\r\n <p-button\r\n [rounded]=\"true\"\r\n [text]=\"true\"\r\n *ngIf=\"row.actions && row.actions.length > 0\"\r\n (onClick)=\"onOptionsClick($event, row)\"\r\n >\r\n <smart-icon icon=\"ellipsis-v\"></smart-icon>\r\n </p-button>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <p-paginator\r\n *ngIf=\"smartGrid.paginator\"\r\n [first]=\"pageIndex!\"\r\n [totalRecords]=\"length!\"\r\n [rows]=\"pageSize\"\r\n [rowsPerPageOptions]=\"pageSizeOptions\"\r\n (onPageChange)=\"onPrimeChangePage($event)\"\r\n [showCurrentPageReport]=\"true\"\r\n />\r\n <p-menu #menu [model]=\"menuButtons\" [popup]=\"true\"> </p-menu>\r\n</div>\r\n}@else {\r\n<div *ngIf=\"smartGrid\" class=\"smartGrid-container\">\r\n <div class=\"smart-grid-toolbar\">\r\n <smart-ui-action-toolbar #toolbar [id]=\"'grid_not_initialized'\"></smart-ui-action-toolbar>\r\n <button\r\n (click)=\"editColumns()\"\r\n mat-mini-fab\r\n color=\"text-primary\"\r\n *ngIf=\"smartGrid.showEditColumns\"\r\n >\r\n <mat-icon aria-hidden=\"false\" aria-label=\"Columns\" class=\"smart-grid-edit-icon\"\r\n >view_columns</mat-icon\r\n >\r\n </button>\r\n </div>\r\n <!-- <div [ngClass]=\"isBlocked ? 'blocked' : ''\"></div> -->\r\n <div class=\"smartGridContent\">\r\n <div>\r\n <div *ngIf=\"smartGrid.showResultCount\">\r\n <div class=\"smartGrid-data-number\">\r\n {{ smartGrid.gridModel.totalRowCount }}\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"smart-grid-table-container\">\r\n <ng-template #table></ng-template>\r\n </div>\r\n\r\n <div *ngIf=\"smartGrid.layoutDef === layoutDef().EXPANDABLE\">\r\n <smart-expandable-section\r\n #gridExpandableSection\r\n *ngFor=\"let expandableSection of expandableSections\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n </div>\r\n <div\r\n *ngIf=\"smartGrid.layoutDef === layoutDef().CARD\"\r\n class=\"cards-container\"\r\n [ngStyle]=\"{\r\n 'grid-template-columns':\r\n smartGrid.numberOfColumn !== undefined\r\n ? 'repeat(' + smartGrid.numberOfColumn + ', 1fr)'\r\n : ''\r\n }\"\r\n >\r\n <app-smart-grid-card\r\n class=\"smartGrid-card-container\"\r\n *ngFor=\"let task of smartGrid.gridModel.page.rows\"\r\n [item]=\"task\"\r\n [smartGrid]=\"smartGrid\"\r\n [onSelect]=\"onSelect.bind(this)\"\r\n ></app-smart-grid-card>\r\n </div>\r\n <div\r\n *ngIf=\"smartGrid.layoutDef === layoutDef().TREE && treeControl\"\r\n class=\"tree-container\"\r\n [ngStyle]=\"{\r\n 'grid-template-columns':\r\n smartGrid.numberOfColumn !== undefined\r\n ? 'repeat(' + smartGrid.numberOfColumn + ', 1fr)'\r\n : ''\r\n }\"\r\n >\r\n <mat-tree [dataSource]=\"treeDataSource!\" [treeControl]=\"treeControl!\">\r\n <mat-tree-node\r\n *matTreeNodeDef=\"let node\"\r\n matTreeNodeToggle\r\n matTreeNodePadding\r\n matTreeNodePaddingIndent=\"24\"\r\n >\r\n <button mat-icon-button disabled class=\"tree-button\"></button>\r\n <mat-checkbox\r\n class=\"checklist-leaf-node\"\r\n [checked]=\"treeChecklistSelection?.isSelected(node)\"\r\n (change)=\"treeNodeSelectionToggle(node)\"\r\n >{{ getTreeItem(node) }}</mat-checkbox\r\n >\r\n </mat-tree-node>\r\n\r\n <mat-tree-node\r\n *matTreeNodeDef=\"let node; when: hasChild\"\r\n matTreeNodePadding\r\n matTreeNodePaddingIndent=\"24\"\r\n >\r\n <button\r\n mat-icon-button\r\n matTreeNodeToggle\r\n class=\"tree-button\"\r\n [attr.aria-label]=\"'Toggle ' + node.item\"\r\n >\r\n <mat-icon class=\"mat-icon-rtl-mirror\">\r\n {{ treeControl!.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\r\n </mat-icon>\r\n </button>\r\n <mat-checkbox\r\n [checked]=\"treeChecklistSelection?.isSelected(node)\"\r\n [indeterminate]=\"descendantsPartiallySelected(node)\"\r\n (change)=\"treeNodeSelectionToggle(node)\"\r\n >{{ getTreeItem(node) }}</mat-checkbox\r\n >\r\n </mat-tree-node>\r\n </mat-tree>\r\n </div>\r\n </div>\r\n\r\n <mat-paginator\r\n *ngIf=\"smartGrid.paginator && !treeControl\"\r\n #paginator\r\n [length]=\"length\"\r\n [pageIndex]=\"pageIndex\"\r\n [pageSize]=\"pageSize\"\r\n [pageSizeOptions]=\"pageSizeOptions\"\r\n (page)=\"onChangePage($event)\"\r\n ></mat-paginator>\r\n</div>\r\n}\r\n", styles: [".smartGrid-container{position:relative;padding:1.5rem;display:flex;flex-direction:column;gap:1rem}.primeSmartGrid-container{display:flex;flex-direction:column;gap:1rem}.smartGrid-data-number{padding-bottom:1rem}.cards-container{display:grid;gap:1rem;padding:1rem}.smartGrid-card-container{height:auto;border:1px solid black;border-radius:8px}.smartGrid-container ::ng-deep .mat-form-field-appearance-legacy .mat-form-field-underline{bottom:0}.smartGridContent{width:100%;flex:1;overflow:auto}.blocked{position:absolute;width:calc(100% - 3rem);height:calc(100% - 3rem);z-index:110;background-color:#0003}.smart-grid-table-container{display:flex;flex-direction:column;gap:1rem}.smart-grid-toolbar{display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.smart-grid-toolbar smart-ui-action-toolbar{width:100%}.smart-grid-edit-icon{color:var(--light-gray)}.tree-button{width:24px!important;height:24px!important}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i2$3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i2$3.MatMiniFabButton, selector: "button[mat-mini-fab]", exportAs: ["matButton"] }, { kind: "component", type: i9$1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: i10$1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i10$1.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i10$1.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i10$1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i10$1.MatTreeNode, selector: "mat-tree-node", inputs: ["disabled", "tabIndex"], exportAs: ["matTreeNode"] }, { kind: "component", type: i4$2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }, { kind: "component", type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id"] }, { kind: "component", type: i14.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll", "virtualRowHeight"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i5$3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i14.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "component", type: i14.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i17$1.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex"], outputs: ["onShow", "onHide", "onBlur", "onFocus"] }, { kind: "component", type: i18$1.Paginator, selector: "p-paginator", inputs: ["pageLinkSize", "style", "styleClass", "alwaysShow", "dropdownAppendTo", "templateLeft", "templateRight", "appendTo", "dropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showFirstLastIcon", "totalRecords", "rows", "rowsPerPageOptions", "showJumpToPageDropdown", "showJumpToPageInput", "jumpToPageItemTemplate", "showPageLinks", "locale", "dropdownItemTemplate", "first"], outputs: ["onPageChange"] }, { kind: "component", type: SmartGridCardComponent, selector: "app-smart-grid-card", inputs: ["item", "smartGrid", "onSelect"] }] }); }
11320
11800
  }
11321
11801
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartGridComponent, decorators: [{
11322
11802
  type: Component,
11323
- args: [{ selector: 'smart-grid', providers: [SmartGridService], template: "@if(compLib === componentLibrary.PRIMENG) {\r\n<div *ngIf=\"smartGrid\" class=\"primeSmartGrid-container\">\r\n <p-table #pTable [value]=\"smartGrid.gridModel.page.rows!\">\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th *ngFor=\"let col of columns\">\r\n {{ col }}\r\n </th>\r\n <th></th>\r\n </tr>\r\n <!-- <tr>\r\n <th *ngFor=\"let col of smartGrid?.gridModel?.view?.orderedColumnNames\">\r\n <p-columnFilter\r\n type=\"text\"\r\n [field]=\"'data.' + col\"\r\n [placeholder]=\"'Search by ' + col\"\r\n [ariaLabel]=\"'Filter ' + col\"\r\n />\r\n </th>\r\n </tr> -->\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-row>\r\n <tr>\r\n <td *ngFor=\"let col of smartGrid?.gridModel?.view?.orderedColumnNames\">\r\n {{ row.data[col] }}\r\n </td>\r\n <td>\r\n <p-button\r\n [rounded]=\"true\"\r\n [text]=\"true\"\r\n *ngIf=\"row.actions && row.actions.length > 0\"\r\n (onClick)=\"onOptionsClick($event, row)\"\r\n >\r\n <smart-icon icon=\"ellipsis-v\"></smart-icon>\r\n </p-button>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <p-paginator\r\n *ngIf=\"smartGrid.paginator\"\r\n [first]=\"pageIndex!\"\r\n [totalRecords]=\"length!\"\r\n [rows]=\"pageSize\"\r\n [rowsPerPageOptions]=\"pageSizeOptions\"\r\n (onPageChange)=\"onPrimeChangePage($event)\"\r\n [showCurrentPageReport]=\"true\"\r\n />\r\n <p-menu #menu [model]=\"menuButtons\" [popup]=\"true\"> </p-menu>\r\n</div>\r\n}@else {\r\n<div *ngIf=\"smartGrid\" class=\"smartGrid-container\">\r\n <div class=\"smart-grid-toolbar\">\r\n <smart-ui-action-toolbar #toolbar [id]=\"'grid_not_initialized'\"></smart-ui-action-toolbar>\r\n <button\r\n (click)=\"editColumns()\"\r\n mat-mini-fab\r\n color=\"text-primary\"\r\n *ngIf=\"smartGrid.showEditColumns\"\r\n >\r\n <mat-icon aria-hidden=\"false\" aria-label=\"Columns\" class=\"smart-grid-edit-icon\"\r\n >view_columns</mat-icon\r\n >\r\n </button>\r\n </div>\r\n <!-- <div [ngClass]=\"isBlocked ? 'blocked' : ''\"></div> -->\r\n <div class=\"smartGridContent\">\r\n <div>\r\n <div *ngIf=\"smartGrid.showResultCount\">\r\n <div class=\"smartGrid-data-number\">\r\n {{ smartGrid.gridModel.totalRowCount }}\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"smart-grid-table-container\">\r\n <ng-template #table></ng-template>\r\n </div>\r\n\r\n <div *ngIf=\"smartGrid.layoutDef === layoutDef().EXPANDABLE\">\r\n <smart-expandable-section\r\n #gridExpandableSection\r\n *ngFor=\"let expandableSection of expandableSections\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n </div>\r\n <div\r\n *ngIf=\"smartGrid.layoutDef === layoutDef().CARD\"\r\n class=\"cards-container\"\r\n [ngStyle]=\"{\r\n 'grid-template-columns':\r\n smartGrid.numberOfColumn !== undefined\r\n ? 'repeat(' + smartGrid.numberOfColumn + ', 1fr)'\r\n : ''\r\n }\"\r\n >\r\n <app-smart-grid-card\r\n class=\"smartGrid-card-container\"\r\n *ngFor=\"let task of smartGrid.gridModel.page.rows\"\r\n [item]=\"task\"\r\n [smartGrid]=\"smartGrid\"\r\n [onSelect]=\"onSelect.bind(this)\"\r\n ></app-smart-grid-card>\r\n </div>\r\n <div\r\n *ngIf=\"smartGrid.layoutDef === layoutDef().TREE && treeControl\"\r\n class=\"tree-container\"\r\n [ngStyle]=\"{\r\n 'grid-template-columns':\r\n smartGrid.numberOfColumn !== undefined\r\n ? 'repeat(' + smartGrid.numberOfColumn + ', 1fr)'\r\n : ''\r\n }\"\r\n >\r\n <mat-tree [dataSource]=\"treeDataSource!\" [treeControl]=\"treeControl!\">\r\n <mat-tree-node\r\n *matTreeNodeDef=\"let node\"\r\n matTreeNodeToggle\r\n matTreeNodePadding\r\n matTreeNodePaddingIndent=\"24\"\r\n >\r\n <button mat-icon-button disabled class=\"tree-button\"></button>\r\n <mat-checkbox\r\n class=\"checklist-leaf-node\"\r\n [checked]=\"treeChecklistSelection?.isSelected(node)\"\r\n (change)=\"treeNodeSelectionToggle(node)\"\r\n >{{ getTreeItem(node) }}</mat-checkbox\r\n >\r\n </mat-tree-node>\r\n\r\n <mat-tree-node\r\n *matTreeNodeDef=\"let node; when: hasChild\"\r\n matTreeNodePadding\r\n matTreeNodePaddingIndent=\"24\"\r\n >\r\n <button\r\n mat-icon-button\r\n matTreeNodeToggle\r\n class=\"tree-button\"\r\n [attr.aria-label]=\"'Toggle ' + node.item\"\r\n >\r\n <mat-icon class=\"mat-icon-rtl-mirror\">\r\n {{ treeControl!.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\r\n </mat-icon>\r\n </button>\r\n <mat-checkbox\r\n [checked]=\"treeChecklistSelection?.isSelected(node)\"\r\n [indeterminate]=\"descendantsPartiallySelected(node)\"\r\n (change)=\"treeNodeSelectionToggle(node)\"\r\n >{{ getTreeItem(node) }}</mat-checkbox\r\n >\r\n </mat-tree-node>\r\n </mat-tree>\r\n </div>\r\n </div>\r\n\r\n <mat-paginator\r\n *ngIf=\"smartGrid.paginator && !treeControl\"\r\n #paginator\r\n [length]=\"length\"\r\n [pageIndex]=\"pageIndex\"\r\n [pageSize]=\"pageSize\"\r\n [pageSizeOptions]=\"pageSizeOptions\"\r\n (page)=\"onChangePage($event)\"\r\n ></mat-paginator>\r\n</div>\r\n}\r\n", styles: [".smartGrid-container{position:relative;padding:1.5rem;display:flex;flex-direction:column;gap:1rem}.primeSmartGrid-container{display:flex;flex-direction:column;gap:1rem}.smartGrid-data-number{padding-bottom:1rem}.cards-container{display:grid;gap:1rem;padding:1rem}.smartGrid-card-container{height:auto;border:1px solid black;border-radius:8px}.smartGrid-container ::ng-deep .mat-form-field-appearance-legacy .mat-form-field-underline{bottom:0}.smartGridContent{width:100%;flex:1;overflow:auto}.blocked{position:absolute;width:calc(100% - 3rem);height:calc(100% - 3rem);z-index:110;background-color:#0003}.smart-grid-table-container{display:flex;flex-direction:column;gap:1rem}.smart-grid-toolbar{display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.smart-grid-toolbar smart-ui-action-toolbar{width:100%}.smart-grid-edit-icon{color:var(--light-gray)}.tree-button{width:24px!important;height:24px!important}\n"] }]
11803
+ args: [{ selector: 'smart-grid', providers: [SmartGridService], template: "@if(compLib === componentLibrary.PRIMENG) {\r\n<div *ngIf=\"smartGrid\" class=\"primeSmartGrid-container\">\r\n <p-table\r\n #pTable\r\n [value]=\"smartGrid.gridModel.page.rows!\"\r\n (sortFunction)=\"gridSort($event)\"\r\n [customSort]=\"true\"\r\n [sortMode]=\"'multiple'\"\r\n [lazy]=\"true\"\r\n (onLazyLoad)=\"lazyLoad($event)\"\r\n >\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th [pSortableColumn]=\"col.propertyName\" *ngFor=\"let col of columns\">\r\n <p-sortIcon [field]=\"col.propertyName\" />\r\n {{ col.label }}\r\n </th>\r\n <th></th>\r\n </tr>\r\n <!-- <tr>\r\n <th *ngFor=\"let col of smartGrid?.gridModel?.view?.orderedColumnNames\">\r\n <p-columnFilter\r\n type=\"text\"\r\n [field]=\"'data.' + col\"\r\n [placeholder]=\"'Search by ' + col\"\r\n [ariaLabel]=\"'Filter ' + col\"\r\n />\r\n </th>\r\n </tr> -->\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-row>\r\n <tr *ngIf=\"row && row.data\">\r\n <td *ngFor=\"let col of smartGrid?.gridModel?.view?.orderedColumnNames\">\r\n {{ row.data[col] }}\r\n </td>\r\n <td>\r\n <p-button\r\n [rounded]=\"true\"\r\n [text]=\"true\"\r\n *ngIf=\"row.actions && row.actions.length > 0\"\r\n (onClick)=\"onOptionsClick($event, row)\"\r\n >\r\n <smart-icon icon=\"ellipsis-v\"></smart-icon>\r\n </p-button>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <p-paginator\r\n *ngIf=\"smartGrid.paginator\"\r\n [first]=\"pageIndex!\"\r\n [totalRecords]=\"length!\"\r\n [rows]=\"pageSize\"\r\n [rowsPerPageOptions]=\"pageSizeOptions\"\r\n (onPageChange)=\"onPrimeChangePage($event)\"\r\n [showCurrentPageReport]=\"true\"\r\n />\r\n <p-menu #menu [model]=\"menuButtons\" [popup]=\"true\"> </p-menu>\r\n</div>\r\n}@else {\r\n<div *ngIf=\"smartGrid\" class=\"smartGrid-container\">\r\n <div class=\"smart-grid-toolbar\">\r\n <smart-ui-action-toolbar #toolbar [id]=\"'grid_not_initialized'\"></smart-ui-action-toolbar>\r\n <button\r\n (click)=\"editColumns()\"\r\n mat-mini-fab\r\n color=\"text-primary\"\r\n *ngIf=\"smartGrid.showEditColumns\"\r\n >\r\n <mat-icon aria-hidden=\"false\" aria-label=\"Columns\" class=\"smart-grid-edit-icon\"\r\n >view_columns</mat-icon\r\n >\r\n </button>\r\n </div>\r\n <!-- <div [ngClass]=\"isBlocked ? 'blocked' : ''\"></div> -->\r\n <div class=\"smartGridContent\">\r\n <div>\r\n <div *ngIf=\"smartGrid.showResultCount\">\r\n <div class=\"smartGrid-data-number\">\r\n {{ smartGrid.gridModel.totalRowCount }}\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"smart-grid-table-container\">\r\n <ng-template #table></ng-template>\r\n </div>\r\n\r\n <div *ngIf=\"smartGrid.layoutDef === layoutDef().EXPANDABLE\">\r\n <smart-expandable-section\r\n #gridExpandableSection\r\n *ngFor=\"let expandableSection of expandableSections\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n </div>\r\n <div\r\n *ngIf=\"smartGrid.layoutDef === layoutDef().CARD\"\r\n class=\"cards-container\"\r\n [ngStyle]=\"{\r\n 'grid-template-columns':\r\n smartGrid.numberOfColumn !== undefined\r\n ? 'repeat(' + smartGrid.numberOfColumn + ', 1fr)'\r\n : ''\r\n }\"\r\n >\r\n <app-smart-grid-card\r\n class=\"smartGrid-card-container\"\r\n *ngFor=\"let task of smartGrid.gridModel.page.rows\"\r\n [item]=\"task\"\r\n [smartGrid]=\"smartGrid\"\r\n [onSelect]=\"onSelect.bind(this)\"\r\n ></app-smart-grid-card>\r\n </div>\r\n <div\r\n *ngIf=\"smartGrid.layoutDef === layoutDef().TREE && treeControl\"\r\n class=\"tree-container\"\r\n [ngStyle]=\"{\r\n 'grid-template-columns':\r\n smartGrid.numberOfColumn !== undefined\r\n ? 'repeat(' + smartGrid.numberOfColumn + ', 1fr)'\r\n : ''\r\n }\"\r\n >\r\n <mat-tree [dataSource]=\"treeDataSource!\" [treeControl]=\"treeControl!\">\r\n <mat-tree-node\r\n *matTreeNodeDef=\"let node\"\r\n matTreeNodeToggle\r\n matTreeNodePadding\r\n matTreeNodePaddingIndent=\"24\"\r\n >\r\n <button mat-icon-button disabled class=\"tree-button\"></button>\r\n <mat-checkbox\r\n class=\"checklist-leaf-node\"\r\n [checked]=\"treeChecklistSelection?.isSelected(node)\"\r\n (change)=\"treeNodeSelectionToggle(node)\"\r\n >{{ getTreeItem(node) }}</mat-checkbox\r\n >\r\n </mat-tree-node>\r\n\r\n <mat-tree-node\r\n *matTreeNodeDef=\"let node; when: hasChild\"\r\n matTreeNodePadding\r\n matTreeNodePaddingIndent=\"24\"\r\n >\r\n <button\r\n mat-icon-button\r\n matTreeNodeToggle\r\n class=\"tree-button\"\r\n [attr.aria-label]=\"'Toggle ' + node.item\"\r\n >\r\n <mat-icon class=\"mat-icon-rtl-mirror\">\r\n {{ treeControl!.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\r\n </mat-icon>\r\n </button>\r\n <mat-checkbox\r\n [checked]=\"treeChecklistSelection?.isSelected(node)\"\r\n [indeterminate]=\"descendantsPartiallySelected(node)\"\r\n (change)=\"treeNodeSelectionToggle(node)\"\r\n >{{ getTreeItem(node) }}</mat-checkbox\r\n >\r\n </mat-tree-node>\r\n </mat-tree>\r\n </div>\r\n </div>\r\n\r\n <mat-paginator\r\n *ngIf=\"smartGrid.paginator && !treeControl\"\r\n #paginator\r\n [length]=\"length\"\r\n [pageIndex]=\"pageIndex\"\r\n [pageSize]=\"pageSize\"\r\n [pageSizeOptions]=\"pageSizeOptions\"\r\n (page)=\"onChangePage($event)\"\r\n ></mat-paginator>\r\n</div>\r\n}\r\n", styles: [".smartGrid-container{position:relative;padding:1.5rem;display:flex;flex-direction:column;gap:1rem}.primeSmartGrid-container{display:flex;flex-direction:column;gap:1rem}.smartGrid-data-number{padding-bottom:1rem}.cards-container{display:grid;gap:1rem;padding:1rem}.smartGrid-card-container{height:auto;border:1px solid black;border-radius:8px}.smartGrid-container ::ng-deep .mat-form-field-appearance-legacy .mat-form-field-underline{bottom:0}.smartGridContent{width:100%;flex:1;overflow:auto}.blocked{position:absolute;width:calc(100% - 3rem);height:calc(100% - 3rem);z-index:110;background-color:#0003}.smart-grid-table-container{display:flex;flex-direction:column;gap:1rem}.smart-grid-toolbar{display:flex;flex-direction:row;justify-content:flex-end;align-items:center}.smart-grid-toolbar smart-ui-action-toolbar{width:100%}.smart-grid-edit-icon{color:var(--light-gray)}.tree-button{width:24px!important;height:24px!important}\n"] }]
11324
11804
  }], ctorParameters: () => [{ type: SmartGridService }, { type: ComponentFactoryService }, { type: i1$1.MatDialog }, { type: UiActionDescriptorService }, { type: ComponentLibrary, decorators: [{
11325
11805
  type: Inject,
11326
11806
  args: [COMPONENT_LIBRARY]
@@ -12196,214 +12676,10 @@ class TreeService {
12196
12676
  }
12197
12677
  getRootNodes(viewUuid, treeId, observe = 'body', reportProgress = false, options) {
12198
12678
  if (viewUuid === null || viewUuid === undefined) {
12199
- throw new Error('Required parameter viewUuid was null or undefined when calling getRootNodes.');
12200
- }
12201
- if (treeId === null || treeId === undefined) {
12202
- throw new Error('Required parameter treeId was null or undefined when calling getRootNodes.');
12203
- }
12204
- let localVarHeaders = this.defaultHeaders;
12205
- let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
12206
- if (localVarHttpHeaderAcceptSelected === undefined) {
12207
- // to determine the Accept header
12208
- const httpHeaderAccepts = ['application/json'];
12209
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
12210
- }
12211
- if (localVarHttpHeaderAcceptSelected !== undefined) {
12212
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
12213
- }
12214
- let localVarHttpContext = options && options.context;
12215
- if (localVarHttpContext === undefined) {
12216
- localVarHttpContext = new HttpContext();
12217
- }
12218
- let responseType_ = 'json';
12219
- if (localVarHttpHeaderAcceptSelected) {
12220
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
12221
- responseType_ = 'text';
12222
- }
12223
- else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
12224
- responseType_ = 'json';
12225
- }
12226
- else {
12227
- responseType_ = 'blob';
12228
- }
12229
- }
12230
- let localVarPath = `/tree/${this.configuration.encodeParam({
12231
- name: 'viewUuid',
12232
- value: viewUuid,
12233
- in: 'path',
12234
- style: 'simple',
12235
- explode: false,
12236
- dataType: 'string',
12237
- dataFormat: 'uuid',
12238
- })}/${this.configuration.encodeParam({
12239
- name: 'treeId',
12240
- value: treeId,
12241
- in: 'path',
12242
- style: 'simple',
12243
- explode: false,
12244
- dataType: 'string',
12245
- dataFormat: undefined,
12246
- })}`;
12247
- return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
12248
- context: localVarHttpContext,
12249
- responseType: responseType_,
12250
- withCredentials: this.configuration.withCredentials,
12251
- headers: localVarHeaders,
12252
- observe: observe,
12253
- reportProgress: reportProgress,
12254
- });
12255
- }
12256
- getRootNodes2(viewUuid, treeId, observe = 'body', reportProgress = false, options) {
12257
- if (viewUuid === null || viewUuid === undefined) {
12258
- throw new Error('Required parameter viewUuid was null or undefined when calling getRootNodes2.');
12259
- }
12260
- if (treeId === null || treeId === undefined) {
12261
- throw new Error('Required parameter treeId was null or undefined when calling getRootNodes2.');
12262
- }
12263
- let localVarHeaders = this.defaultHeaders;
12264
- let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
12265
- if (localVarHttpHeaderAcceptSelected === undefined) {
12266
- // to determine the Accept header
12267
- const httpHeaderAccepts = ['application/json'];
12268
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
12269
- }
12270
- if (localVarHttpHeaderAcceptSelected !== undefined) {
12271
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
12272
- }
12273
- let localVarHttpContext = options && options.context;
12274
- if (localVarHttpContext === undefined) {
12275
- localVarHttpContext = new HttpContext();
12276
- }
12277
- let responseType_ = 'json';
12278
- if (localVarHttpHeaderAcceptSelected) {
12279
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
12280
- responseType_ = 'text';
12281
- }
12282
- else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
12283
- responseType_ = 'json';
12284
- }
12285
- else {
12286
- responseType_ = 'blob';
12287
- }
12288
- }
12289
- let localVarPath = `/tree2/${this.configuration.encodeParam({
12290
- name: 'viewUuid',
12291
- value: viewUuid,
12292
- in: 'path',
12293
- style: 'simple',
12294
- explode: false,
12295
- dataType: 'string',
12296
- dataFormat: 'uuid',
12297
- })}/${this.configuration.encodeParam({
12298
- name: 'treeId',
12299
- value: treeId,
12300
- in: 'path',
12301
- style: 'simple',
12302
- explode: false,
12303
- dataType: 'string',
12304
- dataFormat: undefined,
12305
- })}`;
12306
- return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
12307
- context: localVarHttpContext,
12308
- responseType: responseType_,
12309
- withCredentials: this.configuration.withCredentials,
12310
- headers: localVarHeaders,
12311
- observe: observe,
12312
- reportProgress: reportProgress,
12313
- });
12314
- }
12315
- performAction(viewUuid, treeId, nodeId, body, observe = 'body', reportProgress = false, options) {
12316
- if (viewUuid === null || viewUuid === undefined) {
12317
- throw new Error('Required parameter viewUuid was null or undefined when calling performAction.');
12318
- }
12319
- if (treeId === null || treeId === undefined) {
12320
- throw new Error('Required parameter treeId was null or undefined when calling performAction.');
12321
- }
12322
- if (nodeId === null || nodeId === undefined) {
12323
- throw new Error('Required parameter nodeId was null or undefined when calling performAction.');
12324
- }
12325
- if (body === null || body === undefined) {
12326
- throw new Error('Required parameter body was null or undefined when calling performAction.');
12327
- }
12328
- let localVarHeaders = this.defaultHeaders;
12329
- let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
12330
- if (localVarHttpHeaderAcceptSelected === undefined) {
12331
- // to determine the Accept header
12332
- const httpHeaderAccepts = ['application/json'];
12333
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
12334
- }
12335
- if (localVarHttpHeaderAcceptSelected !== undefined) {
12336
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
12337
- }
12338
- let localVarHttpContext = options && options.context;
12339
- if (localVarHttpContext === undefined) {
12340
- localVarHttpContext = new HttpContext();
12341
- }
12342
- // to determine the Content-Type header
12343
- const consumes = ['application/json'];
12344
- const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
12345
- if (httpContentTypeSelected !== undefined) {
12346
- localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
12347
- }
12348
- let responseType_ = 'json';
12349
- if (localVarHttpHeaderAcceptSelected) {
12350
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
12351
- responseType_ = 'text';
12352
- }
12353
- else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
12354
- responseType_ = 'json';
12355
- }
12356
- else {
12357
- responseType_ = 'blob';
12358
- }
12359
- }
12360
- let localVarPath = `/tree/${this.configuration.encodeParam({
12361
- name: 'viewUuid',
12362
- value: viewUuid,
12363
- in: 'path',
12364
- style: 'simple',
12365
- explode: false,
12366
- dataType: 'string',
12367
- dataFormat: 'uuid',
12368
- })}/${this.configuration.encodeParam({
12369
- name: 'treeId',
12370
- value: treeId,
12371
- in: 'path',
12372
- style: 'simple',
12373
- explode: false,
12374
- dataType: 'string',
12375
- dataFormat: undefined,
12376
- })}/${this.configuration.encodeParam({
12377
- name: 'nodeId',
12378
- value: nodeId,
12379
- in: 'path',
12380
- style: 'simple',
12381
- explode: false,
12382
- dataType: 'string',
12383
- dataFormat: undefined,
12384
- })}/action`;
12385
- return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
12386
- context: localVarHttpContext,
12387
- body: body,
12388
- responseType: responseType_,
12389
- withCredentials: this.configuration.withCredentials,
12390
- headers: localVarHeaders,
12391
- observe: observe,
12392
- reportProgress: reportProgress,
12393
- });
12394
- }
12395
- performAction2(viewUuid, treeId, nodeId, body, observe = 'body', reportProgress = false, options) {
12396
- if (viewUuid === null || viewUuid === undefined) {
12397
- throw new Error('Required parameter viewUuid was null or undefined when calling performAction2.');
12679
+ throw new Error('Required parameter viewUuid was null or undefined when calling getRootNodes.');
12398
12680
  }
12399
12681
  if (treeId === null || treeId === undefined) {
12400
- throw new Error('Required parameter treeId was null or undefined when calling performAction2.');
12401
- }
12402
- if (nodeId === null || nodeId === undefined) {
12403
- throw new Error('Required parameter nodeId was null or undefined when calling performAction2.');
12404
- }
12405
- if (body === null || body === undefined) {
12406
- throw new Error('Required parameter body was null or undefined when calling performAction2.');
12682
+ throw new Error('Required parameter treeId was null or undefined when calling getRootNodes.');
12407
12683
  }
12408
12684
  let localVarHeaders = this.defaultHeaders;
12409
12685
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
@@ -12419,12 +12695,6 @@ class TreeService {
12419
12695
  if (localVarHttpContext === undefined) {
12420
12696
  localVarHttpContext = new HttpContext();
12421
12697
  }
12422
- // to determine the Content-Type header
12423
- const consumes = ['application/json'];
12424
- const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
12425
- if (httpContentTypeSelected !== undefined) {
12426
- localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
12427
- }
12428
12698
  let responseType_ = 'json';
12429
12699
  if (localVarHttpHeaderAcceptSelected) {
12430
12700
  if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
@@ -12437,7 +12707,7 @@ class TreeService {
12437
12707
  responseType_ = 'blob';
12438
12708
  }
12439
12709
  }
12440
- let localVarPath = `/tree2/${this.configuration.encodeParam({
12710
+ let localVarPath = `/tree/${this.configuration.encodeParam({
12441
12711
  name: 'viewUuid',
12442
12712
  value: viewUuid,
12443
12713
  in: 'path',
@@ -12453,18 +12723,9 @@ class TreeService {
12453
12723
  explode: false,
12454
12724
  dataType: 'string',
12455
12725
  dataFormat: undefined,
12456
- })}/${this.configuration.encodeParam({
12457
- name: 'nodeId',
12458
- value: nodeId,
12459
- in: 'path',
12460
- style: 'simple',
12461
- explode: false,
12462
- dataType: 'string',
12463
- dataFormat: undefined,
12464
- })}/action`;
12465
- return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
12726
+ })}`;
12727
+ return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
12466
12728
  context: localVarHttpContext,
12467
- body: body,
12468
12729
  responseType: responseType_,
12469
12730
  withCredentials: this.configuration.withCredentials,
12470
12731
  headers: localVarHeaders,
@@ -12472,15 +12733,12 @@ class TreeService {
12472
12733
  reportProgress: reportProgress,
12473
12734
  });
12474
12735
  }
12475
- performMainAction(viewUuid, treeId, body, observe = 'body', reportProgress = false, options) {
12736
+ getRootNodes2(viewUuid, treeId, observe = 'body', reportProgress = false, options) {
12476
12737
  if (viewUuid === null || viewUuid === undefined) {
12477
- throw new Error('Required parameter viewUuid was null or undefined when calling performMainAction.');
12738
+ throw new Error('Required parameter viewUuid was null or undefined when calling getRootNodes2.');
12478
12739
  }
12479
12740
  if (treeId === null || treeId === undefined) {
12480
- throw new Error('Required parameter treeId was null or undefined when calling performMainAction.');
12481
- }
12482
- if (body === null || body === undefined) {
12483
- throw new Error('Required parameter body was null or undefined when calling performMainAction.');
12741
+ throw new Error('Required parameter treeId was null or undefined when calling getRootNodes2.');
12484
12742
  }
12485
12743
  let localVarHeaders = this.defaultHeaders;
12486
12744
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
@@ -12496,12 +12754,6 @@ class TreeService {
12496
12754
  if (localVarHttpContext === undefined) {
12497
12755
  localVarHttpContext = new HttpContext();
12498
12756
  }
12499
- // to determine the Content-Type header
12500
- const consumes = ['application/json'];
12501
- const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
12502
- if (httpContentTypeSelected !== undefined) {
12503
- localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
12504
- }
12505
12757
  let responseType_ = 'json';
12506
12758
  if (localVarHttpHeaderAcceptSelected) {
12507
12759
  if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
@@ -12514,7 +12766,7 @@ class TreeService {
12514
12766
  responseType_ = 'blob';
12515
12767
  }
12516
12768
  }
12517
- let localVarPath = `/tree/${this.configuration.encodeParam({
12769
+ let localVarPath = `/tree2/${this.configuration.encodeParam({
12518
12770
  name: 'viewUuid',
12519
12771
  value: viewUuid,
12520
12772
  in: 'path',
@@ -12530,10 +12782,9 @@ class TreeService {
12530
12782
  explode: false,
12531
12783
  dataType: 'string',
12532
12784
  dataFormat: undefined,
12533
- })}/action`;
12534
- return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
12785
+ })}`;
12786
+ return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
12535
12787
  context: localVarHttpContext,
12536
- body: body,
12537
12788
  responseType: responseType_,
12538
12789
  withCredentials: this.configuration.withCredentials,
12539
12790
  headers: localVarHeaders,
@@ -12541,15 +12792,18 @@ class TreeService {
12541
12792
  reportProgress: reportProgress,
12542
12793
  });
12543
12794
  }
12544
- performMainAction2(viewUuid, treeId, body, observe = 'body', reportProgress = false, options) {
12795
+ performAction(viewUuid, treeId, nodeId, body, observe = 'body', reportProgress = false, options) {
12545
12796
  if (viewUuid === null || viewUuid === undefined) {
12546
- throw new Error('Required parameter viewUuid was null or undefined when calling performMainAction2.');
12797
+ throw new Error('Required parameter viewUuid was null or undefined when calling performAction.');
12547
12798
  }
12548
12799
  if (treeId === null || treeId === undefined) {
12549
- throw new Error('Required parameter treeId was null or undefined when calling performMainAction2.');
12800
+ throw new Error('Required parameter treeId was null or undefined when calling performAction.');
12801
+ }
12802
+ if (nodeId === null || nodeId === undefined) {
12803
+ throw new Error('Required parameter nodeId was null or undefined when calling performAction.');
12550
12804
  }
12551
12805
  if (body === null || body === undefined) {
12552
- throw new Error('Required parameter body was null or undefined when calling performMainAction2.');
12806
+ throw new Error('Required parameter body was null or undefined when calling performAction.');
12553
12807
  }
12554
12808
  let localVarHeaders = this.defaultHeaders;
12555
12809
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
@@ -12583,7 +12837,7 @@ class TreeService {
12583
12837
  responseType_ = 'blob';
12584
12838
  }
12585
12839
  }
12586
- let localVarPath = `/tree2/${this.configuration.encodeParam({
12840
+ let localVarPath = `/tree/${this.configuration.encodeParam({
12587
12841
  name: 'viewUuid',
12588
12842
  value: viewUuid,
12589
12843
  in: 'path',
@@ -12599,6 +12853,14 @@ class TreeService {
12599
12853
  explode: false,
12600
12854
  dataType: 'string',
12601
12855
  dataFormat: undefined,
12856
+ })}/${this.configuration.encodeParam({
12857
+ name: 'nodeId',
12858
+ value: nodeId,
12859
+ in: 'path',
12860
+ style: 'simple',
12861
+ explode: false,
12862
+ dataType: 'string',
12863
+ dataFormat: undefined,
12602
12864
  })}/action`;
12603
12865
  return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
12604
12866
  context: localVarHttpContext,
@@ -12610,15 +12872,18 @@ class TreeService {
12610
12872
  reportProgress: reportProgress,
12611
12873
  });
12612
12874
  }
12613
- selectNode(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
12875
+ performAction2(viewUuid, treeId, nodeId, body, observe = 'body', reportProgress = false, options) {
12614
12876
  if (viewUuid === null || viewUuid === undefined) {
12615
- throw new Error('Required parameter viewUuid was null or undefined when calling selectNode.');
12877
+ throw new Error('Required parameter viewUuid was null or undefined when calling performAction2.');
12616
12878
  }
12617
12879
  if (treeId === null || treeId === undefined) {
12618
- throw new Error('Required parameter treeId was null or undefined when calling selectNode.');
12880
+ throw new Error('Required parameter treeId was null or undefined when calling performAction2.');
12619
12881
  }
12620
12882
  if (nodeId === null || nodeId === undefined) {
12621
- throw new Error('Required parameter nodeId was null or undefined when calling selectNode.');
12883
+ throw new Error('Required parameter nodeId was null or undefined when calling performAction2.');
12884
+ }
12885
+ if (body === null || body === undefined) {
12886
+ throw new Error('Required parameter body was null or undefined when calling performAction2.');
12622
12887
  }
12623
12888
  let localVarHeaders = this.defaultHeaders;
12624
12889
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
@@ -12634,6 +12899,12 @@ class TreeService {
12634
12899
  if (localVarHttpContext === undefined) {
12635
12900
  localVarHttpContext = new HttpContext();
12636
12901
  }
12902
+ // to determine the Content-Type header
12903
+ const consumes = ['application/json'];
12904
+ const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
12905
+ if (httpContentTypeSelected !== undefined) {
12906
+ localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
12907
+ }
12637
12908
  let responseType_ = 'json';
12638
12909
  if (localVarHttpHeaderAcceptSelected) {
12639
12910
  if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
@@ -12646,7 +12917,7 @@ class TreeService {
12646
12917
  responseType_ = 'blob';
12647
12918
  }
12648
12919
  }
12649
- let localVarPath = `/tree/${this.configuration.encodeParam({
12920
+ let localVarPath = `/tree2/${this.configuration.encodeParam({
12650
12921
  name: 'viewUuid',
12651
12922
  value: viewUuid,
12652
12923
  in: 'path',
@@ -12670,9 +12941,10 @@ class TreeService {
12670
12941
  explode: false,
12671
12942
  dataType: 'string',
12672
12943
  dataFormat: undefined,
12673
- })}/select`;
12944
+ })}/action`;
12674
12945
  return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
12675
12946
  context: localVarHttpContext,
12947
+ body: body,
12676
12948
  responseType: responseType_,
12677
12949
  withCredentials: this.configuration.withCredentials,
12678
12950
  headers: localVarHeaders,
@@ -12680,15 +12952,15 @@ class TreeService {
12680
12952
  reportProgress: reportProgress,
12681
12953
  });
12682
12954
  }
12683
- selectNode2(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
12955
+ performMainAction(viewUuid, treeId, body, observe = 'body', reportProgress = false, options) {
12684
12956
  if (viewUuid === null || viewUuid === undefined) {
12685
- throw new Error('Required parameter viewUuid was null or undefined when calling selectNode2.');
12957
+ throw new Error('Required parameter viewUuid was null or undefined when calling performMainAction.');
12686
12958
  }
12687
12959
  if (treeId === null || treeId === undefined) {
12688
- throw new Error('Required parameter treeId was null or undefined when calling selectNode2.');
12960
+ throw new Error('Required parameter treeId was null or undefined when calling performMainAction.');
12689
12961
  }
12690
- if (nodeId === null || nodeId === undefined) {
12691
- throw new Error('Required parameter nodeId was null or undefined when calling selectNode2.');
12962
+ if (body === null || body === undefined) {
12963
+ throw new Error('Required parameter body was null or undefined when calling performMainAction.');
12692
12964
  }
12693
12965
  let localVarHeaders = this.defaultHeaders;
12694
12966
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
@@ -12704,6 +12976,12 @@ class TreeService {
12704
12976
  if (localVarHttpContext === undefined) {
12705
12977
  localVarHttpContext = new HttpContext();
12706
12978
  }
12979
+ // to determine the Content-Type header
12980
+ const consumes = ['application/json'];
12981
+ const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
12982
+ if (httpContentTypeSelected !== undefined) {
12983
+ localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
12984
+ }
12707
12985
  let responseType_ = 'json';
12708
12986
  if (localVarHttpHeaderAcceptSelected) {
12709
12987
  if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
@@ -12716,7 +12994,7 @@ class TreeService {
12716
12994
  responseType_ = 'blob';
12717
12995
  }
12718
12996
  }
12719
- let localVarPath = `/tree2/${this.configuration.encodeParam({
12997
+ let localVarPath = `/tree/${this.configuration.encodeParam({
12720
12998
  name: 'viewUuid',
12721
12999
  value: viewUuid,
12722
13000
  in: 'path',
@@ -12732,1338 +13010,909 @@ class TreeService {
12732
13010
  explode: false,
12733
13011
  dataType: 'string',
12734
13012
  dataFormat: undefined,
12735
- })}/${this.configuration.encodeParam({
12736
- name: 'nodeId',
12737
- value: nodeId,
12738
- in: 'path',
12739
- style: 'simple',
12740
- explode: false,
12741
- dataType: 'string',
12742
- dataFormat: undefined,
12743
- })}/select`;
13013
+ })}/action`;
12744
13014
  return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
12745
13015
  context: localVarHttpContext,
12746
- responseType: responseType_,
12747
- withCredentials: this.configuration.withCredentials,
12748
- headers: localVarHeaders,
12749
- observe: observe,
12750
- reportProgress: reportProgress,
12751
- });
12752
- }
12753
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: TreeService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH$2, optional: true }, { token: Configuration$2, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
12754
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: TreeService, providedIn: 'root' }); }
12755
- }
12756
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: TreeService, decorators: [{
12757
- type: Injectable,
12758
- args: [{
12759
- providedIn: 'root',
12760
- }]
12761
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
12762
- type: Optional
12763
- }, {
12764
- type: Inject,
12765
- args: [BASE_PATH$2]
12766
- }] }, { type: Configuration$2, decorators: [{
12767
- type: Optional
12768
- }] }] });
12769
-
12770
- var SmartTreeNodeButtonType;
12771
- (function (SmartTreeNodeButtonType) {
12772
- SmartTreeNodeButtonType["MENU"] = "MENU";
12773
- SmartTreeNodeButtonType["ICON"] = "ICON";
12774
- SmartTreeNodeButtonType["NORMAL"] = "NORMAL";
12775
- })(SmartTreeNodeButtonType || (SmartTreeNodeButtonType = {}));
12776
-
12777
- class SmarttreeService {
12778
- get uiActionModels() {
12779
- return this._uiActionModels;
12780
- }
12781
- set uiActionModels(uiActionModels) {
12782
- this._uiActionModels = uiActionModels;
12783
- this.uiActionModelsChanged.next();
12784
- }
12785
- constructor() {
12786
- this.errorMessage = 'The tree is currently unavailable';
12787
- this.smartTreeModelChanged = new Subject();
12788
- this.uiActionModelsChanged = new Subject();
12789
- }
12790
- async initialize() {
12791
- await this.downloadTree().then((rootNodes) => {
12792
- this.treeFromBackend = rootNodes;
12793
- this.syncTree();
12794
- });
12795
- }
12796
- async downloadTree() {
12797
- throw new Error('downloadTree method not implemented.');
12798
- }
12799
- async downloadChildren(parentNode) {
12800
- throw new Error('downloadChildren method not implemented.');
12801
- }
12802
- onTreeNodeClick(treeNode) {
12803
- throw new Error('onTreeNodeClick method not implemented.');
12804
- }
12805
- onTreeNodeOpen(treeNode) {
12806
- throw new Error('onTreeNodeOpen method not implemented.');
12807
- }
12808
- syncTree() {
12809
- throw new Error('syncTree method not implemented.');
12810
- }
12811
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
12812
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeService, providedIn: 'root' }); }
12813
- }
12814
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeService, decorators: [{
12815
- type: Injectable,
12816
- args: [{
12817
- providedIn: 'root',
12818
- }]
12819
- }], ctorParameters: () => [] });
12820
-
12821
- class SmarttreeGenericService extends SmarttreeService {
12822
- constructor(inject, pageName, treeId, treeMenuIcon) {
12823
- super();
12824
- this.pageName = pageName;
12825
- this.treeId = treeId;
12826
- this.treeMenuIcon = treeMenuIcon;
12827
- // UseUiAction properties
12828
- this.submit = new Subject();
12829
- this.reSubscribeToChange = new Subject();
12830
- this.uiActionDescriptors = new Map();
12831
- if (!this.treeMenuIcon) {
12832
- this.treeMenuIcon = inject.get('treeMenuIcon');
12833
- }
12834
- this.configureTree({
12835
- pageName: this.pageName,
12836
- treeid: this.treeId,
12837
- });
12838
- this.viewContext = inject.get(SmartViewContextService);
12839
- this.service = inject.get(TreeService);
12840
- this.uiActionService = inject.get(UiActionService);
12841
- this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
12842
- this.initialize();
12843
- }
12844
- constructUiActionModels(uiActions) {
12845
- this.uiActionModels = uiActions.map((uiAction) => {
12846
- return {
12847
- serviceToUse: this,
12848
- uiAction,
12849
- };
12850
- });
12851
- }
12852
- configureTree(configuration) {
12853
- this.treeId = configuration.treeid;
12854
- this.pageName = configuration.pageName;
12855
- }
12856
- async initialize() {
12857
- if (this.viewContext.hasViewContextUuid()) {
12858
- await this.downloadTree().then((rootNodes) => {
12859
- if (!deepEqual(this.treeFromBackend, rootNodes)) {
12860
- this.treeFromBackend = rootNodes;
12861
- this.syncTree();
12862
- }
12863
- });
12864
- }
12865
- }
12866
- async downloadTree() {
12867
- let uuid = this.viewContext.getUuidOfPage(this.pageName);
12868
- const rootNodes = await this.viewContext.handlePerformActionResponse(await this.service.getRootNodes2(uuid, this.treeId).toPromise());
12869
- const uiActions = await this.viewContext.handlePerformActionResponse(await this.service.getMainActions2(uuid, this.treeId).toPromise());
12870
- if (uiActions) {
12871
- this.constructUiActionModels(uiActions);
12872
- }
12873
- if (!rootNodes) {
12874
- throw new Error('RootNodes are undefined!');
12875
- }
12876
- return rootNodes;
13016
+ body: body,
13017
+ responseType: responseType_,
13018
+ withCredentials: this.configuration.withCredentials,
13019
+ headers: localVarHeaders,
13020
+ observe: observe,
13021
+ reportProgress: reportProgress,
13022
+ });
12877
13023
  }
12878
- async downloadChildren(parentNode) {
12879
- let uuid = this.viewContext.getUuidOfPage(this.pageName);
12880
- const children = await this.viewContext.handlePerformActionResponse(await this.service.getChildrenNodes2(uuid, this.treeId, parentNode.identifier).toPromise());
12881
- if (!children) {
12882
- throw new Error(`Node with identifier ${parentNode.identifier} does not have children.`);
13024
+ performMainAction2(viewUuid, treeId, body, observe = 'body', reportProgress = false, options) {
13025
+ if (viewUuid === null || viewUuid === undefined) {
13026
+ throw new Error('Required parameter viewUuid was null or undefined when calling performMainAction2.');
12883
13027
  }
12884
- return children;
12885
- }
12886
- async onTreeNodeOpen(treeNode) {
12887
- let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
12888
- if (treeNode?.expanded) {
12889
- let tempTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.collapseNode2(viewUuid, this.treeId, treeNode.identifier).toPromise());
12890
- treeNode = tempTreeNode;
13028
+ if (treeId === null || treeId === undefined) {
13029
+ throw new Error('Required parameter treeId was null or undefined when calling performMainAction2.');
12891
13030
  }
12892
- else if (!treeNode?.expanded) {
12893
- let tempTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.expandNode2(viewUuid, this.treeId, treeNode?.identifier).toPromise());
12894
- treeNode = tempTreeNode;
13031
+ if (body === null || body === undefined) {
13032
+ throw new Error('Required parameter body was null or undefined when calling performMainAction2.');
12895
13033
  }
12896
- let node = this.deepSearchTreeNode(treeNode?.identifier, this.treeFromBackend);
12897
- node.expanded = treeNode?.expanded;
12898
- node.childrenNodes = treeNode?.childrenNodes;
12899
- this.syncTree();
12900
- }
12901
- onTreeNodeClick(treeNode) {
12902
- this.selectFolder(treeNode.identifier, treeNode);
12903
- }
12904
- async selectFolder(folderUri, treeNode) {
12905
- let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
12906
- let updatedTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.selectNode2(viewUuid, this.treeId, treeNode.identifier).toPromise());
12907
- if (this.selectedNode) {
12908
- this.selectedNode.selected = false;
13034
+ let localVarHeaders = this.defaultHeaders;
13035
+ let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
13036
+ if (localVarHttpHeaderAcceptSelected === undefined) {
13037
+ // to determine the Accept header
13038
+ const httpHeaderAccepts = ['application/json'];
13039
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
12909
13040
  }
12910
- this.selectedNode = updatedTreeNode;
12911
- let node = this.deepSearchTreeNode(updatedTreeNode?.identifier, this.treeFromBackend);
12912
- if (!node) {
12913
- throw Error('Tree node does not exist');
13041
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
13042
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
12914
13043
  }
12915
- node.expanded = updatedTreeNode?.expanded;
12916
- node.childrenNodes = updatedTreeNode?.childrenNodes;
12917
- node.selected = updatedTreeNode?.selected;
12918
- treeNode = updatedTreeNode;
12919
- this.syncTree();
12920
- //this.viewContext.getAndSyncViewContext(this.viewContext.getViewContextUuid());
12921
- }
12922
- async updateTreeOnTheFly() {
12923
- await this.initialize();
12924
- }
12925
- async syncTree() {
12926
- if (this.treeFromBackend === null || this.treeFromBackend === undefined) {
12927
- //throw new Error('There is no treeFromBackend available!');
12928
- console.warn('There is no treeFromBackend available in syncTree!');
12929
- return;
13044
+ let localVarHttpContext = options && options.context;
13045
+ if (localVarHttpContext === undefined) {
13046
+ localVarHttpContext = new HttpContext();
12930
13047
  }
12931
- await this.cacheActionDesciptors(this.getAllNodes(this.treeFromBackend));
12932
- if (!this.smartTreeModel) {
12933
- this.smartTreeModel = {
12934
- rootNodes: [],
12935
- };
13048
+ // to determine the Content-Type header
13049
+ const consumes = ['application/json'];
13050
+ const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
13051
+ if (httpContentTypeSelected !== undefined) {
13052
+ localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
12936
13053
  }
12937
- let smartTreeNodes = this.createButtonsForTreeNodes(this.treeFromBackend);
12938
- this.smartTreeModel = undefined;
12939
- this.smartTreeModel = {
12940
- rootNodes: [],
12941
- };
12942
- this.smartTreeModelChanged.next(this.smartTreeModel);
12943
- this.smartTreeModel.rootNodes = smartTreeNodes;
12944
- this.findSelected(this.smartTreeModel.rootNodes);
12945
- this.smartTreeModelChanged.next(this.smartTreeModel);
12946
- }
12947
- deepSearchTreeNode(identifier, nodes) {
12948
- let treeNode;
12949
- for (let index = 0; index < nodes.length; index++) {
12950
- const node = nodes[index];
12951
- if (node.identifier === identifier) {
12952
- treeNode = node;
12953
- break;
13054
+ let responseType_ = 'json';
13055
+ if (localVarHttpHeaderAcceptSelected) {
13056
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
13057
+ responseType_ = 'text';
12954
13058
  }
12955
- if (node.childrenNodes && node.childrenNodes.length) {
12956
- treeNode = this.deepSearchTreeNode(identifier, node.childrenNodes);
12957
- if (treeNode) {
12958
- break;
12959
- }
13059
+ else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
13060
+ responseType_ = 'json';
13061
+ }
13062
+ else {
13063
+ responseType_ = 'blob';
12960
13064
  }
12961
13065
  }
12962
- return treeNode;
13066
+ let localVarPath = `/tree2/${this.configuration.encodeParam({
13067
+ name: 'viewUuid',
13068
+ value: viewUuid,
13069
+ in: 'path',
13070
+ style: 'simple',
13071
+ explode: false,
13072
+ dataType: 'string',
13073
+ dataFormat: 'uuid',
13074
+ })}/${this.configuration.encodeParam({
13075
+ name: 'treeId',
13076
+ value: treeId,
13077
+ in: 'path',
13078
+ style: 'simple',
13079
+ explode: false,
13080
+ dataType: 'string',
13081
+ dataFormat: undefined,
13082
+ })}/action`;
13083
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
13084
+ context: localVarHttpContext,
13085
+ body: body,
13086
+ responseType: responseType_,
13087
+ withCredentials: this.configuration.withCredentials,
13088
+ headers: localVarHeaders,
13089
+ observe: observe,
13090
+ reportProgress: reportProgress,
13091
+ });
12963
13092
  }
12964
- findSelected(nodes) {
12965
- return nodes.forEach((node) => {
12966
- if (node.selected) {
12967
- this.selectedNode = node;
12968
- return;
13093
+ selectNode(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
13094
+ if (viewUuid === null || viewUuid === undefined) {
13095
+ throw new Error('Required parameter viewUuid was null or undefined when calling selectNode.');
13096
+ }
13097
+ if (treeId === null || treeId === undefined) {
13098
+ throw new Error('Required parameter treeId was null or undefined when calling selectNode.');
13099
+ }
13100
+ if (nodeId === null || nodeId === undefined) {
13101
+ throw new Error('Required parameter nodeId was null or undefined when calling selectNode.');
13102
+ }
13103
+ let localVarHeaders = this.defaultHeaders;
13104
+ let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
13105
+ if (localVarHttpHeaderAcceptSelected === undefined) {
13106
+ // to determine the Accept header
13107
+ const httpHeaderAccepts = ['application/json'];
13108
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
13109
+ }
13110
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
13111
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
13112
+ }
13113
+ let localVarHttpContext = options && options.context;
13114
+ if (localVarHttpContext === undefined) {
13115
+ localVarHttpContext = new HttpContext();
13116
+ }
13117
+ let responseType_ = 'json';
13118
+ if (localVarHttpHeaderAcceptSelected) {
13119
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
13120
+ responseType_ = 'text';
12969
13121
  }
12970
- else if (node.childrenNodes && node.childrenNodes.length) {
12971
- return this.findSelected(node.childrenNodes);
13122
+ else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
13123
+ responseType_ = 'json';
12972
13124
  }
12973
- });
12974
- }
12975
- createButtonsForTreeNodes(nodes) {
12976
- let icon = this.treeMenuIcon ?? 'more_vert';
12977
- nodes.map((node) => {
12978
- node.button = node.actions?.length
12979
- ? {
12980
- type: SmartTreeNodeButtonType.MENU,
12981
- icon: icon,
12982
- menuItemButtons: node.actions.map((action) => {
12983
- return {
12984
- type: SmartTreeNodeButtonType.NORMAL,
12985
- label: this.getLabelByAction(action),
12986
- callback: this.doAction.bind(this),
12987
- args: [action, node.identifier],
12988
- };
12989
- }),
12990
- }
12991
- : undefined;
12992
- node.icon = 'Folders';
12993
- if (node.childrenNodes) {
12994
- node.childrenNodes = this.createButtonsForTreeNodes(node.childrenNodes);
13125
+ else {
13126
+ responseType_ = 'blob';
12995
13127
  }
12996
- });
12997
- return nodes;
12998
- }
12999
- async doAction(args) {
13000
- let uiAction = args[0];
13001
- let nodeUuid = args[1];
13002
- if (uiAction.params) {
13003
- uiAction.params['nodeUuid'] = nodeUuid;
13004
13128
  }
13005
- else {
13006
- uiAction.params = {
13007
- nodeUuid: nodeUuid,
13008
- };
13009
- }
13010
- let uiActionModel = {
13011
- serviceToUse: this,
13012
- uiAction,
13013
- };
13014
- this.uiActionService.uiActionModel = uiActionModel;
13015
- this.uiActionService.execute(uiAction);
13016
- }
13017
- getAllNodes(nodes) {
13018
- return nodes.flatMap((n) => [n, ...this.getAllNodes(n.childrenNodes)]);
13019
- }
13020
- async cacheActionDesciptors(nodes) {
13021
- let newUiActions = new Set();
13022
- nodes.forEach((node) => {
13023
- node.actions
13024
- ?.filter((uiAction) => !this.uiActionDescriptors.get(uiAction.code))
13025
- .forEach((action) => newUiActions.add(action));
13129
+ let localVarPath = `/tree/${this.configuration.encodeParam({
13130
+ name: 'viewUuid',
13131
+ value: viewUuid,
13132
+ in: 'path',
13133
+ style: 'simple',
13134
+ explode: false,
13135
+ dataType: 'string',
13136
+ dataFormat: 'uuid',
13137
+ })}/${this.configuration.encodeParam({
13138
+ name: 'treeId',
13139
+ value: treeId,
13140
+ in: 'path',
13141
+ style: 'simple',
13142
+ explode: false,
13143
+ dataType: 'string',
13144
+ dataFormat: undefined,
13145
+ })}/${this.configuration.encodeParam({
13146
+ name: 'nodeId',
13147
+ value: nodeId,
13148
+ in: 'path',
13149
+ style: 'simple',
13150
+ explode: false,
13151
+ dataType: 'string',
13152
+ dataFormat: undefined,
13153
+ })}/select`;
13154
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
13155
+ context: localVarHttpContext,
13156
+ responseType: responseType_,
13157
+ withCredentials: this.configuration.withCredentials,
13158
+ headers: localVarHeaders,
13159
+ observe: observe,
13160
+ reportProgress: reportProgress,
13026
13161
  });
13027
- for (let action of newUiActions) {
13028
- if (!this.uiActionDescriptors.get(action.code)) {
13029
- let descriptor = await this.uiActionDescriptorService.getActionDescriptor(action);
13030
- this.uiActionDescriptors.set(action.code, descriptor);
13031
- }
13032
- }
13033
- }
13034
- getLabelByAction(action) {
13035
- let desc = this.uiActionDescriptors.get(action.code);
13036
- return desc.title;
13037
13162
  }
13038
- // #region UseUiAction
13039
- getAdditionalParams(uiAction) {
13040
- if (uiAction.params && uiAction.params['nodeUuid']) {
13041
- let nodeUuid = uiAction.params['nodeUuid'];
13042
- let nodeName;
13043
- if (uiAction.code === 'RENAME') {
13044
- nodeName = this.deepSearchTreeNode(nodeUuid, this.treeFromBackend)?.caption;
13045
- }
13046
- return {
13047
- forTextArea: '',
13048
- forTextField: nodeName ? nodeName : '',
13049
- };
13163
+ selectNode2(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
13164
+ if (viewUuid === null || viewUuid === undefined) {
13165
+ throw new Error('Required parameter viewUuid was null or undefined when calling selectNode2.');
13050
13166
  }
13051
- return {
13052
- forTextArea: '',
13053
- forTextField: '',
13054
- };
13055
- }
13056
- getModel() {
13057
- return {};
13058
- }
13059
- async performUiActionRequest(uiActionRequest) {
13060
- if (uiActionRequest.params['nodeUuid']) {
13061
- await this.performNodeUiActionRequest(uiActionRequest);
13167
+ if (treeId === null || treeId === undefined) {
13168
+ throw new Error('Required parameter treeId was null or undefined when calling selectNode2.');
13062
13169
  }
13063
- else {
13064
- await this.performMainUiActionRequest(uiActionRequest);
13170
+ if (nodeId === null || nodeId === undefined) {
13171
+ throw new Error('Required parameter nodeId was null or undefined when calling selectNode2.');
13065
13172
  }
13066
- //await this.viewContext.getAndSyncViewContext();
13067
- this.syncTree();
13068
- }
13069
- async performNodeUiActionRequest(uiActionRequest) {
13070
- let nodeId = uiActionRequest.params['nodeUuid'];
13071
- delete uiActionRequest.params['nodeUuid'];
13072
- let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
13073
- this.treeFromBackend = await this.viewContext.handlePerformActionResponse(await this.service.performAction2(viewUuid, this.treeId, nodeId, uiActionRequest).toPromise());
13074
- }
13075
- async performMainUiActionRequest(uiActionRequest) {
13076
- let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
13077
- this.treeFromBackend = await this.viewContext.handlePerformActionResponse(await this.service.performMainAction2(viewUuid, this.treeId, uiActionRequest).toPromise());
13078
- }
13079
- handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
13080
- throw new Error('Method not implemented.');
13173
+ let localVarHeaders = this.defaultHeaders;
13174
+ let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
13175
+ if (localVarHttpHeaderAcceptSelected === undefined) {
13176
+ // to determine the Accept header
13177
+ const httpHeaderAccepts = ['application/json'];
13178
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
13179
+ }
13180
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
13181
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
13182
+ }
13183
+ let localVarHttpContext = options && options.context;
13184
+ if (localVarHttpContext === undefined) {
13185
+ localVarHttpContext = new HttpContext();
13186
+ }
13187
+ let responseType_ = 'json';
13188
+ if (localVarHttpHeaderAcceptSelected) {
13189
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
13190
+ responseType_ = 'text';
13191
+ }
13192
+ else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
13193
+ responseType_ = 'json';
13194
+ }
13195
+ else {
13196
+ responseType_ = 'blob';
13197
+ }
13198
+ }
13199
+ let localVarPath = `/tree2/${this.configuration.encodeParam({
13200
+ name: 'viewUuid',
13201
+ value: viewUuid,
13202
+ in: 'path',
13203
+ style: 'simple',
13204
+ explode: false,
13205
+ dataType: 'string',
13206
+ dataFormat: 'uuid',
13207
+ })}/${this.configuration.encodeParam({
13208
+ name: 'treeId',
13209
+ value: treeId,
13210
+ in: 'path',
13211
+ style: 'simple',
13212
+ explode: false,
13213
+ dataType: 'string',
13214
+ dataFormat: undefined,
13215
+ })}/${this.configuration.encodeParam({
13216
+ name: 'nodeId',
13217
+ value: nodeId,
13218
+ in: 'path',
13219
+ style: 'simple',
13220
+ explode: false,
13221
+ dataType: 'string',
13222
+ dataFormat: undefined,
13223
+ })}/select`;
13224
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
13225
+ context: localVarHttpContext,
13226
+ responseType: responseType_,
13227
+ withCredentials: this.configuration.withCredentials,
13228
+ headers: localVarHeaders,
13229
+ observe: observe,
13230
+ reportProgress: reportProgress,
13231
+ });
13081
13232
  }
13082
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeGenericService, deps: [{ token: i0.Injector }, { token: 'pageName' }, { token: 'treeId' }, { token: 'treeMenuIcon' }], target: i0.ɵɵFactoryTarget.Injectable }); }
13083
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeGenericService, providedIn: 'root' }); }
13233
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: TreeService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH$2, optional: true }, { token: Configuration$2, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
13234
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: TreeService, providedIn: 'root' }); }
13084
13235
  }
13085
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeGenericService, decorators: [{
13236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: TreeService, decorators: [{
13086
13237
  type: Injectable,
13087
13238
  args: [{
13088
13239
  providedIn: 'root',
13089
13240
  }]
13090
- }], ctorParameters: () => [{ type: i0.Injector }, { type: undefined, decorators: [{
13091
- type: Inject,
13092
- args: ['pageName']
13093
- }] }, { type: undefined, decorators: [{
13094
- type: Inject,
13095
- args: ['treeId']
13096
- }] }, { type: undefined, decorators: [{
13241
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
13242
+ type: Optional
13243
+ }, {
13097
13244
  type: Inject,
13098
- args: ['treeMenuIcon']
13245
+ args: [BASE_PATH$2]
13246
+ }] }, { type: Configuration$2, decorators: [{
13247
+ type: Optional
13099
13248
  }] }] });
13100
13249
 
13101
- class SmartTreeComponent {
13102
- constructor(cdr) {
13103
- this.cdr = cdr;
13104
- this._destroy$ = new Subject();
13105
- this.treeControl = new NestedTreeControl((node) => node.childrenNodes);
13106
- this.dataSource = new MatTreeNestedDataSource();
13107
- this.smartTreeNodeButtonType = SmartTreeNodeButtonType;
13108
- this.uiActionModels = [];
13109
- this.hasChild = (_, node) => node.hasChildren;
13110
- }
13111
- ngOnInit() {
13112
- if (!this.treeService) {
13113
- throw new Error('TreeService has not been given!');
13114
- }
13115
- this.errorMessage = this.treeService.errorMessage;
13116
- this.treeService.smartTreeModelChanged.subscribe((newSmartTree) => {
13117
- this.treeData = newSmartTree;
13118
- this.dataSource.data = this.treeData.rootNodes;
13119
- this.expandTreeNodes();
13120
- });
13121
- this.treeService.uiActionModelsChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
13122
- if (this.treeService.uiActionModels) {
13123
- this.uiActionModels = this.treeService.uiActionModels;
13124
- }
13125
- });
13126
- }
13127
- ngOnDestroy() {
13128
- this._destroy$.next();
13129
- this._destroy$.complete();
13130
- }
13131
- getIfExpanded(node) {
13132
- return this.treeControl.isExpanded(node);
13133
- }
13134
- expandTreeNodes() {
13135
- this.expandTreeNodesDeeply(this.dataSource.data);
13136
- }
13137
- expandTreeNodesDeeply(nodes) {
13138
- nodes.forEach((node) => {
13139
- if (node.expanded) {
13140
- this.treeControl.expand(node);
13141
- this.cdr.markForCheck();
13142
- if (node.childrenNodes && node.childrenNodes.length) {
13143
- this.expandTreeNodesDeeply(node.childrenNodes);
13144
- }
13145
- }
13146
- else {
13147
- this.treeControl.collapse(node);
13148
- }
13149
- });
13150
- }
13151
- onNodeClick(event, node) {
13152
- event.stopPropagation();
13153
- if (this.tempActiveNode)
13154
- this.tempActiveNode.selected = false;
13155
- node.selected = true;
13156
- this.tempActiveNode = node;
13157
- this.treeService.onTreeNodeClick(node);
13158
- }
13159
- onOpenNode(event, node) {
13160
- event.stopPropagation();
13161
- this.treeService.onTreeNodeOpen(node);
13162
- }
13163
- getNodeStyle(node) {
13164
- if (this.treeStyle) {
13165
- var style = node.selected
13166
- ? {
13167
- background: this.treeStyle.activeStyle?.backgroundColor,
13168
- color: this.treeStyle.activeStyle?.color,
13169
- }
13170
- : {
13171
- background: this.treeStyle.levelBackgroundColor[node.level],
13172
- color: this.treeStyle.color,
13173
- };
13174
- return style;
13175
- }
13176
- return {};
13177
- }
13178
- getNodePadding(node) {
13179
- if (this.treeStyle) {
13180
- var style = node.selected
13181
- ? {
13182
- 'padding-left': 15 * node.level + 'px',
13183
- }
13184
- : {
13185
- 'padding-left': 15 * node.level + 'px',
13186
- };
13187
- return style;
13188
- }
13189
- return {};
13250
+ var SmartTreeNodeButtonType;
13251
+ (function (SmartTreeNodeButtonType) {
13252
+ SmartTreeNodeButtonType["MENU"] = "MENU";
13253
+ SmartTreeNodeButtonType["ICON"] = "ICON";
13254
+ SmartTreeNodeButtonType["NORMAL"] = "NORMAL";
13255
+ })(SmartTreeNodeButtonType || (SmartTreeNodeButtonType = {}));
13256
+
13257
+ class SmarttreeService {
13258
+ get uiActionModels() {
13259
+ return this._uiActionModels;
13190
13260
  }
13191
- customButtonClicked(event, button, close) {
13192
- event.stopPropagation();
13193
- if (button.type === SmartTreeNodeButtonType.MENU) {
13194
- return;
13195
- }
13196
- if (!button.callback) {
13197
- throw new Error(`Button with name ${button.label || button.icon} does not have a callback!`);
13198
- }
13199
- button.callback(button.args);
13200
- if (close) {
13201
- let openMenus = this.trigger.filter((matMenuTrigger) => matMenuTrigger.menuOpen);
13202
- openMenus.forEach((matMenuTrigger) => {
13203
- matMenuTrigger.closeMenu();
13204
- });
13205
- }
13261
+ set uiActionModels(uiActionModels) {
13262
+ this._uiActionModels = uiActionModels;
13263
+ this.uiActionModelsChanged.next();
13206
13264
  }
13207
- getClassesForTreeNode(node) {
13208
- let classes = [];
13209
- if (node.expanded) {
13210
- classes.push(this.getCustomClass('expanded', node.level));
13211
- }
13212
- else {
13213
- classes.push(this.getCustomClass('collapsed', node.level));
13214
- }
13215
- if (node.selected) {
13216
- classes.push(this.getCustomClass('selected', node.level));
13217
- }
13218
- else {
13219
- classes.push(this.getCustomClass('unselected', node.level));
13220
- }
13221
- if (node.level !== 0) {
13222
- classes.push(this.getCustomClass('child', node.level));
13223
- }
13224
- return classes;
13265
+ constructor() {
13266
+ this.errorMessage = 'The tree is currently unavailable';
13267
+ this.smartTreeModelChanged = new Subject();
13268
+ this.uiActionModelsChanged = new Subject();
13225
13269
  }
13226
- getInnerClassesForTreeNode(node) {
13227
- let classes = [];
13228
- if (node.expanded) {
13229
- classes.push(this.getCustomClass('inner-expanded', node.level));
13230
- }
13231
- else {
13232
- classes.push(this.getCustomClass('inner-collapsed', node.level));
13233
- }
13234
- if (node.selected) {
13235
- classes.push(this.getCustomClass('inner-selected', node.level));
13236
- }
13237
- else {
13238
- classes.push(this.getCustomClass('inner-unselected', node.level));
13239
- }
13240
- return classes;
13270
+ async initialize() {
13271
+ await this.downloadTree().then((rootNodes) => {
13272
+ this.treeFromBackend = rootNodes;
13273
+ this.syncTree();
13274
+ });
13241
13275
  }
13242
- getClassesForTreeNodeChildren(node) {
13243
- let classes = [];
13244
- classes.push(this.getCustomClass('group', node.level));
13245
- return classes;
13276
+ async downloadTree() {
13277
+ throw new Error('downloadTree method not implemented.');
13246
13278
  }
13247
- getCustomClass(cssClass, plusProperty) {
13248
- return `${cssClass}-${plusProperty}`;
13279
+ async downloadChildren(parentNode) {
13280
+ throw new Error('downloadChildren method not implemented.');
13249
13281
  }
13250
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartTreeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
13251
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", 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"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i2$3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2$3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i10$1.MatNestedTreeNode, selector: "mat-nested-tree-node", inputs: ["matNestedTreeNode", "disabled", "tabIndex"], exportAs: ["matNestedTreeNode"] }, { kind: "directive", type: i10$1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i10$1.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i10$1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i10$1.MatTreeNodeOutlet, selector: "[matTreeNodeOutlet]" }, { kind: "component", type: i5$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i5$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { kind: "component", type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id"] }] }); }
13252
- }
13253
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartTreeComponent, decorators: [{
13254
- type: Component,
13255
- 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"] }]
13256
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { trigger: [{
13257
- type: ViewChildren,
13258
- args: [MatMenuTrigger]
13259
- }], tree: [{
13260
- type: ViewChild,
13261
- args: ['tree']
13262
- }], treeStyle: [{
13263
- type: Input
13264
- }], treeService: [{
13265
- type: Input
13266
- }] } });
13267
-
13268
- class SmarttreeModule {
13269
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
13270
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeModule, declarations: [SmartTreeComponent], imports: [BrowserModule,
13271
- MatCommonModule,
13272
- MatButtonModule,
13273
- MatIconModule,
13274
- MatTreeModule,
13275
- MatMenuModule,
13276
- SmartIconModule,
13277
- SmartViewContextModule], exports: [SmartTreeComponent] }); }
13278
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeModule, providers: [
13279
- SmarttreeService,
13280
- SmarttreeGenericService,
13281
- { provide: 'treeMenuIcon', useValue: 'more_vert' },
13282
- ], imports: [BrowserModule,
13283
- MatCommonModule,
13284
- MatButtonModule,
13285
- MatIconModule,
13286
- MatTreeModule,
13287
- MatMenuModule,
13288
- SmartIconModule,
13289
- SmartViewContextModule] }); }
13282
+ onTreeNodeClick(treeNode) {
13283
+ throw new Error('onTreeNodeClick method not implemented.');
13284
+ }
13285
+ onTreeNodeOpen(treeNode) {
13286
+ throw new Error('onTreeNodeOpen method not implemented.');
13287
+ }
13288
+ syncTree() {
13289
+ throw new Error('syncTree method not implemented.');
13290
+ }
13291
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
13292
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeService, providedIn: 'root' }); }
13290
13293
  }
13291
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeModule, decorators: [{
13292
- type: NgModule,
13294
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeService, decorators: [{
13295
+ type: Injectable,
13293
13296
  args: [{
13294
- declarations: [SmartTreeComponent],
13295
- imports: [
13296
- BrowserModule,
13297
- MatCommonModule,
13298
- MatButtonModule,
13299
- MatIconModule,
13300
- MatTreeModule,
13301
- MatMenuModule,
13302
- SmartIconModule,
13303
- SmartViewContextModule,
13304
- ],
13305
- exports: [SmartTreeComponent],
13306
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
13307
- providers: [
13308
- SmarttreeService,
13309
- SmarttreeGenericService,
13310
- { provide: 'treeMenuIcon', useValue: 'more_vert' },
13311
- ],
13297
+ providedIn: 'root',
13312
13298
  }]
13313
- }] });
13299
+ }], ctorParameters: () => [] });
13314
13300
 
13315
- /**
13316
- * Custom HttpParameterCodec
13317
- * Workaround for https://github.com/angular/angular/issues/18261
13318
- */
13319
- let CustomHttpParameterCodec$1 = class CustomHttpParameterCodec {
13320
- encodeKey(k) {
13321
- return encodeURIComponent(k);
13322
- }
13323
- encodeValue(v) {
13324
- return encodeURIComponent(v);
13301
+ class SmarttreeGenericService extends SmarttreeService {
13302
+ constructor(inject, pageName, treeId, treeMenuIcon) {
13303
+ super();
13304
+ this.pageName = pageName;
13305
+ this.treeId = treeId;
13306
+ this.treeMenuIcon = treeMenuIcon;
13307
+ // UseUiAction properties
13308
+ this.submit = new Subject();
13309
+ this.reSubscribeToChange = new Subject();
13310
+ this.uiActionDescriptors = new Map();
13311
+ if (!this.treeMenuIcon) {
13312
+ this.treeMenuIcon = inject.get('treeMenuIcon');
13313
+ }
13314
+ this.configureTree({
13315
+ pageName: this.pageName,
13316
+ treeid: this.treeId,
13317
+ });
13318
+ this.viewContext = inject.get(SmartViewContextService);
13319
+ this.service = inject.get(TreeService);
13320
+ this.uiActionService = inject.get(UiActionService);
13321
+ this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
13322
+ this.initialize();
13325
13323
  }
13326
- decodeKey(k) {
13327
- return decodeURIComponent(k);
13324
+ constructUiActionModels(uiActions) {
13325
+ this.uiActionModels = uiActions.map((uiAction) => {
13326
+ return {
13327
+ serviceToUse: this,
13328
+ uiAction,
13329
+ };
13330
+ });
13328
13331
  }
13329
- decodeValue(v) {
13330
- return decodeURIComponent(v);
13332
+ configureTree(configuration) {
13333
+ this.treeId = configuration.treeid;
13334
+ this.pageName = configuration.pageName;
13331
13335
  }
13332
- };
13333
-
13334
- const BASE_PATH$1 = new InjectionToken('basePath');
13335
- const COLLECTION_FORMATS$1 = {
13336
- 'csv': ',',
13337
- 'tsv': ' ',
13338
- 'ssv': ' ',
13339
- 'pipes': '|'
13340
- };
13341
-
13342
- let Configuration$1 = class Configuration {
13343
- constructor(configurationParameters = {}) {
13344
- this.apiKeys = configurationParameters.apiKeys;
13345
- this.username = configurationParameters.username;
13346
- this.password = configurationParameters.password;
13347
- this.accessToken = configurationParameters.accessToken;
13348
- this.basePath = configurationParameters.basePath;
13349
- this.withCredentials = configurationParameters.withCredentials;
13350
- this.encoder = configurationParameters.encoder;
13351
- if (configurationParameters.encodeParam) {
13352
- this.encodeParam = configurationParameters.encodeParam;
13353
- }
13354
- else {
13355
- this.encodeParam = param => this.defaultEncodeParam(param);
13336
+ async initialize() {
13337
+ if (this.viewContext.hasViewContextUuid()) {
13338
+ await this.downloadTree().then((rootNodes) => {
13339
+ if (!deepEqual(this.treeFromBackend, rootNodes)) {
13340
+ this.treeFromBackend = rootNodes;
13341
+ this.syncTree();
13342
+ }
13343
+ });
13356
13344
  }
13357
- if (configurationParameters.credentials) {
13358
- this.credentials = configurationParameters.credentials;
13345
+ }
13346
+ async downloadTree() {
13347
+ let uuid = this.viewContext.getUuidOfPage(this.pageName);
13348
+ const rootNodes = await this.viewContext.handlePerformActionResponse(await this.service.getRootNodes2(uuid, this.treeId).toPromise());
13349
+ const uiActions = await this.viewContext.handlePerformActionResponse(await this.service.getMainActions2(uuid, this.treeId).toPromise());
13350
+ if (uiActions) {
13351
+ this.constructUiActionModels(uiActions);
13359
13352
  }
13360
- else {
13361
- this.credentials = {};
13353
+ if (!rootNodes) {
13354
+ throw new Error('RootNodes are undefined!');
13362
13355
  }
13356
+ return rootNodes;
13363
13357
  }
13364
- /**
13365
- * Select the correct content-type to use for a request.
13366
- * Uses {@link Configuration#isJsonMime} to determine the correct content-type.
13367
- * If no content type is found return the first found type if the contentTypes is not empty
13368
- * @param contentTypes - the array of content types that are available for selection
13369
- * @returns the selected content-type or <code>undefined</code> if no selection could be made.
13370
- */
13371
- selectHeaderContentType(contentTypes) {
13372
- if (contentTypes.length === 0) {
13373
- return undefined;
13374
- }
13375
- const type = contentTypes.find((x) => this.isJsonMime(x));
13376
- if (type === undefined) {
13377
- return contentTypes[0];
13358
+ async downloadChildren(parentNode) {
13359
+ let uuid = this.viewContext.getUuidOfPage(this.pageName);
13360
+ const children = await this.viewContext.handlePerformActionResponse(await this.service.getChildrenNodes2(uuid, this.treeId, parentNode.identifier).toPromise());
13361
+ if (!children) {
13362
+ throw new Error(`Node with identifier ${parentNode.identifier} does not have children.`);
13378
13363
  }
13379
- return type;
13364
+ return children;
13380
13365
  }
13381
- /**
13382
- * Select the correct accept content-type to use for a request.
13383
- * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
13384
- * If no content type is found return the first found type if the contentTypes is not empty
13385
- * @param accepts - the array of content types that are available for selection.
13386
- * @returns the selected content-type or <code>undefined</code> if no selection could be made.
13387
- */
13388
- selectHeaderAccept(accepts) {
13389
- if (accepts.length === 0) {
13390
- return undefined;
13366
+ async onTreeNodeOpen(treeNode) {
13367
+ let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
13368
+ if (treeNode?.expanded) {
13369
+ let tempTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.collapseNode2(viewUuid, this.treeId, treeNode.identifier).toPromise());
13370
+ treeNode = tempTreeNode;
13391
13371
  }
13392
- const type = accepts.find((x) => this.isJsonMime(x));
13393
- if (type === undefined) {
13394
- return accepts[0];
13372
+ else if (!treeNode?.expanded) {
13373
+ let tempTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.expandNode2(viewUuid, this.treeId, treeNode?.identifier).toPromise());
13374
+ treeNode = tempTreeNode;
13395
13375
  }
13396
- return type;
13397
- }
13398
- /**
13399
- * Check if the given MIME is a JSON MIME.
13400
- * JSON MIME examples:
13401
- * application/json
13402
- * application/json; charset=UTF8
13403
- * APPLICATION/JSON
13404
- * application/vnd.company+json
13405
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
13406
- * @return True if the given MIME is JSON, false otherwise.
13407
- */
13408
- isJsonMime(mime) {
13409
- const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
13410
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
13411
- }
13412
- lookupCredential(key) {
13413
- const value = this.credentials[key];
13414
- return typeof value === 'function'
13415
- ? value()
13416
- : value;
13376
+ let node = this.deepSearchTreeNode(treeNode?.identifier, this.treeFromBackend);
13377
+ node.expanded = treeNode?.expanded;
13378
+ node.childrenNodes = treeNode?.childrenNodes;
13379
+ this.syncTree();
13417
13380
  }
13418
- defaultEncodeParam(param) {
13419
- // This implementation exists as fallback for missing configuration
13420
- // and for backwards compatibility to older typescript-angular generator versions.
13421
- // It only works for the 'simple' parameter style.
13422
- // Date-handling only works for the 'date-time' format.
13423
- // All other styles and Date-formats are probably handled incorrectly.
13424
- //
13425
- // But: if that's all you need (i.e.: the most common use-case): no need for customization!
13426
- const value = param.dataFormat === 'date-time' && param.value instanceof Date
13427
- ? param.value.toISOString()
13428
- : param.value;
13429
- return encodeURIComponent(String(value));
13381
+ onTreeNodeClick(treeNode) {
13382
+ this.selectFolder(treeNode.identifier, treeNode);
13430
13383
  }
13431
- };
13432
-
13433
- /**
13434
- * Form layout definition
13435
- * Contains form layout definition objects.
13436
- *
13437
- * The version of the OpenAPI document: 1.0.0
13438
- * Contact: info@it4all.hu
13439
- *
13440
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
13441
- * https://openapi-generator.tech
13442
- * Do not edit the class manually.
13443
- */
13444
- /* tslint:disable:no-unused-variable member-ordering */
13445
- class DefaultService {
13446
- constructor(httpClient, basePath, configuration) {
13447
- this.httpClient = httpClient;
13448
- this.basePath = 'http://localhost';
13449
- this.defaultHeaders = new HttpHeaders();
13450
- this.configuration = new Configuration$1();
13451
- if (configuration) {
13452
- this.configuration = configuration;
13384
+ async selectFolder(folderUri, treeNode) {
13385
+ let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
13386
+ let updatedTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.selectNode2(viewUuid, this.treeId, treeNode.identifier).toPromise());
13387
+ if (this.selectedNode) {
13388
+ this.selectedNode.selected = false;
13453
13389
  }
13454
- if (typeof this.configuration.basePath !== 'string') {
13455
- if (Array.isArray(basePath) && basePath.length > 0) {
13456
- basePath = basePath[0];
13457
- }
13458
- if (typeof basePath !== 'string') {
13459
- basePath = this.basePath;
13460
- }
13461
- this.configuration.basePath = basePath;
13390
+ this.selectedNode = updatedTreeNode;
13391
+ let node = this.deepSearchTreeNode(updatedTreeNode?.identifier, this.treeFromBackend);
13392
+ if (!node) {
13393
+ throw Error('Tree node does not exist');
13462
13394
  }
13463
- this.encoder = this.configuration.encoder || new CustomHttpParameterCodec$1();
13395
+ node.expanded = updatedTreeNode?.expanded;
13396
+ node.childrenNodes = updatedTreeNode?.childrenNodes;
13397
+ node.selected = updatedTreeNode?.selected;
13398
+ treeNode = updatedTreeNode;
13399
+ this.syncTree();
13400
+ //this.viewContext.getAndSyncViewContext(this.viewContext.getViewContextUuid());
13464
13401
  }
13465
- // @ts-ignore
13466
- addToHttpParams(httpParams, value, key) {
13467
- if (typeof value === "object" && value instanceof Date === false) {
13468
- httpParams = this.addToHttpParamsRecursive(httpParams, value);
13402
+ async updateTreeOnTheFly() {
13403
+ await this.initialize();
13404
+ }
13405
+ async syncTree() {
13406
+ if (this.treeFromBackend === null || this.treeFromBackend === undefined) {
13407
+ //throw new Error('There is no treeFromBackend available!');
13408
+ console.warn('There is no treeFromBackend available in syncTree!');
13409
+ return;
13469
13410
  }
13470
- else {
13471
- httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
13411
+ await this.cacheActionDesciptors(this.getAllNodes(this.treeFromBackend));
13412
+ if (!this.smartTreeModel) {
13413
+ this.smartTreeModel = {
13414
+ rootNodes: [],
13415
+ };
13472
13416
  }
13473
- return httpParams;
13417
+ let smartTreeNodes = this.createButtonsForTreeNodes(this.treeFromBackend);
13418
+ this.smartTreeModel = undefined;
13419
+ this.smartTreeModel = {
13420
+ rootNodes: [],
13421
+ };
13422
+ this.smartTreeModelChanged.next(this.smartTreeModel);
13423
+ this.smartTreeModel.rootNodes = smartTreeNodes;
13424
+ this.findSelected(this.smartTreeModel.rootNodes);
13425
+ this.smartTreeModelChanged.next(this.smartTreeModel);
13474
13426
  }
13475
- addToHttpParamsRecursive(httpParams, value, key) {
13476
- if (value == null) {
13477
- return httpParams;
13478
- }
13479
- if (typeof value === "object") {
13480
- if (Array.isArray(value)) {
13481
- value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
13427
+ deepSearchTreeNode(identifier, nodes) {
13428
+ let treeNode;
13429
+ for (let index = 0; index < nodes.length; index++) {
13430
+ const node = nodes[index];
13431
+ if (node.identifier === identifier) {
13432
+ treeNode = node;
13433
+ break;
13482
13434
  }
13483
- else if (value instanceof Date) {
13484
- if (key != null) {
13485
- httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
13486
- }
13487
- else {
13488
- throw Error("key may not be null if value is Date");
13435
+ if (node.childrenNodes && node.childrenNodes.length) {
13436
+ treeNode = this.deepSearchTreeNode(identifier, node.childrenNodes);
13437
+ if (treeNode) {
13438
+ break;
13489
13439
  }
13490
13440
  }
13491
- else {
13492
- Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
13493
- }
13494
- }
13495
- else if (key != null) {
13496
- httpParams = httpParams.append(key, value);
13497
13441
  }
13498
- else {
13499
- throw Error("key may not be null if value is not object or array");
13500
- }
13501
- return httpParams;
13442
+ return treeNode;
13502
13443
  }
13503
- nopePost(observe = 'body', reportProgress = false, options) {
13504
- let localVarHeaders = this.defaultHeaders;
13505
- let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
13506
- if (localVarHttpHeaderAcceptSelected === undefined) {
13507
- // to determine the Accept header
13508
- const httpHeaderAccepts = [];
13509
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
13510
- }
13511
- if (localVarHttpHeaderAcceptSelected !== undefined) {
13512
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
13513
- }
13514
- let localVarHttpContext = options && options.context;
13515
- if (localVarHttpContext === undefined) {
13516
- localVarHttpContext = new HttpContext();
13517
- }
13518
- let responseType_ = 'json';
13519
- if (localVarHttpHeaderAcceptSelected) {
13520
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
13521
- responseType_ = 'text';
13444
+ findSelected(nodes) {
13445
+ return nodes.forEach((node) => {
13446
+ if (node.selected) {
13447
+ this.selectedNode = node;
13448
+ return;
13522
13449
  }
13523
- else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
13524
- responseType_ = 'json';
13450
+ else if (node.childrenNodes && node.childrenNodes.length) {
13451
+ return this.findSelected(node.childrenNodes);
13525
13452
  }
13526
- else {
13527
- responseType_ = 'blob';
13453
+ });
13454
+ }
13455
+ createButtonsForTreeNodes(nodes) {
13456
+ let icon = this.treeMenuIcon ?? 'more_vert';
13457
+ nodes.map((node) => {
13458
+ node.button = node.actions?.length
13459
+ ? {
13460
+ type: SmartTreeNodeButtonType.MENU,
13461
+ icon: icon,
13462
+ menuItemButtons: node.actions.map((action) => {
13463
+ return {
13464
+ type: SmartTreeNodeButtonType.NORMAL,
13465
+ label: this.getLabelByAction(action),
13466
+ callback: this.doAction.bind(this),
13467
+ args: [action, node.identifier],
13468
+ };
13469
+ }),
13470
+ }
13471
+ : undefined;
13472
+ node.icon = 'Folders';
13473
+ if (node.childrenNodes) {
13474
+ node.childrenNodes = this.createButtonsForTreeNodes(node.childrenNodes);
13528
13475
  }
13476
+ });
13477
+ return nodes;
13478
+ }
13479
+ async doAction(args) {
13480
+ let uiAction = args[0];
13481
+ let nodeUuid = args[1];
13482
+ if (uiAction.params) {
13483
+ uiAction.params['nodeUuid'] = nodeUuid;
13529
13484
  }
13530
- let localVarPath = `/nope`;
13531
- return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
13532
- context: localVarHttpContext,
13533
- responseType: responseType_,
13534
- withCredentials: this.configuration.withCredentials,
13535
- headers: localVarHeaders,
13536
- observe: observe,
13537
- reportProgress: reportProgress
13485
+ else {
13486
+ uiAction.params = {
13487
+ nodeUuid: nodeUuid,
13488
+ };
13489
+ }
13490
+ let uiActionModel = {
13491
+ serviceToUse: this,
13492
+ uiAction,
13493
+ };
13494
+ this.uiActionService.uiActionModel = uiActionModel;
13495
+ this.uiActionService.execute(uiAction);
13496
+ }
13497
+ getAllNodes(nodes) {
13498
+ return nodes.flatMap((n) => [n, ...this.getAllNodes(n.childrenNodes)]);
13499
+ }
13500
+ async cacheActionDesciptors(nodes) {
13501
+ let newUiActions = new Set();
13502
+ nodes.forEach((node) => {
13503
+ node.actions
13504
+ ?.filter((uiAction) => !this.uiActionDescriptors.get(uiAction.code))
13505
+ .forEach((action) => newUiActions.add(action));
13538
13506
  });
13507
+ for (let action of newUiActions) {
13508
+ if (!this.uiActionDescriptors.get(action.code)) {
13509
+ let descriptor = await this.uiActionDescriptorService.getActionDescriptor(action);
13510
+ this.uiActionDescriptors.set(action.code, descriptor);
13511
+ }
13512
+ }
13513
+ }
13514
+ getLabelByAction(action) {
13515
+ let desc = this.uiActionDescriptors.get(action.code);
13516
+ return desc.title;
13539
13517
  }
13540
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: DefaultService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH$1, optional: true }, { token: Configuration$1, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
13541
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: DefaultService, providedIn: 'root' }); }
13542
- }
13543
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: DefaultService, decorators: [{
13544
- type: Injectable,
13545
- args: [{
13546
- providedIn: 'root'
13547
- }]
13548
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
13549
- type: Optional
13550
- }, {
13551
- type: Inject,
13552
- args: [BASE_PATH$1]
13553
- }] }, { type: Configuration$1, decorators: [{
13554
- type: Optional
13555
- }] }] });
13556
-
13557
- const APIS = [DefaultService];
13558
-
13559
- /**
13560
- * Form layout definition
13561
- * Contains form layout definition objects.
13562
- *
13563
- * The version of the OpenAPI document: 1.0.0
13564
- * Contact: info@it4all.hu
13565
- *
13566
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
13567
- * https://openapi-generator.tech
13568
- * Do not edit the class manually.
13569
- */
13570
- var ComponentType;
13571
- (function (ComponentType) {
13572
- ComponentType["CONTAINER"] = "container";
13573
- ComponentType["FORM"] = "form";
13574
- ComponentType["WIDGET"] = "widget";
13575
- })(ComponentType || (ComponentType = {}));
13576
-
13577
- /**
13578
- * Form layout definition
13579
- * Contains form layout definition objects.
13580
- *
13581
- * The version of the OpenAPI document: 1.0.0
13582
- * Contact: info@it4all.hu
13583
- *
13584
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
13585
- * https://openapi-generator.tech
13586
- * Do not edit the class manually.
13587
- */
13588
- var ComponentWidgetType;
13589
- (function (ComponentWidgetType) {
13590
- ComponentWidgetType["GRID"] = "grid";
13591
- ComponentWidgetType["FILTER"] = "filter";
13592
- ComponentWidgetType["TREE"] = "tree";
13593
- ComponentWidgetType["TOOLBAR"] = "toolbar";
13594
- })(ComponentWidgetType || (ComponentWidgetType = {}));
13595
-
13596
- /**
13597
- * Form layout definition
13598
- * Contains form layout definition objects.
13599
- *
13600
- * The version of the OpenAPI document: 1.0.0
13601
- * Contact: info@it4all.hu
13602
- *
13603
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
13604
- * https://openapi-generator.tech
13605
- * Do not edit the class manually.
13606
- */
13607
- var LayoutDirection;
13608
- (function (LayoutDirection) {
13609
- LayoutDirection["HORIZONTAL"] = "horizontal";
13610
- LayoutDirection["VERTICAL"] = "vertical";
13611
- })(LayoutDirection || (LayoutDirection = {}));
13612
-
13613
- class ApiModule {
13614
- static forRoot(configurationFactory) {
13518
+ // #region UseUiAction
13519
+ getAdditionalParams(uiAction) {
13520
+ if (uiAction.params && uiAction.params['nodeUuid']) {
13521
+ let nodeUuid = uiAction.params['nodeUuid'];
13522
+ let nodeName;
13523
+ if (uiAction.code === 'RENAME') {
13524
+ nodeName = this.deepSearchTreeNode(nodeUuid, this.treeFromBackend)?.caption;
13525
+ }
13526
+ return {
13527
+ forTextArea: '',
13528
+ forTextField: nodeName ? nodeName : '',
13529
+ };
13530
+ }
13615
13531
  return {
13616
- ngModule: ApiModule,
13617
- providers: [{ provide: Configuration$1, useFactory: configurationFactory }]
13532
+ forTextArea: '',
13533
+ forTextField: '',
13618
13534
  };
13619
13535
  }
13620
- constructor(parentModule, http) {
13621
- if (parentModule) {
13622
- throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
13536
+ getModel() {
13537
+ return {};
13538
+ }
13539
+ async performUiActionRequest(uiActionRequest) {
13540
+ if (uiActionRequest.params['nodeUuid']) {
13541
+ await this.performNodeUiActionRequest(uiActionRequest);
13623
13542
  }
13624
- if (!http) {
13625
- throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
13626
- 'See also https://github.com/angular/angular/issues/20575');
13543
+ else {
13544
+ await this.performMainUiActionRequest(uiActionRequest);
13627
13545
  }
13546
+ //await this.viewContext.getAndSyncViewContext();
13547
+ this.syncTree();
13628
13548
  }
13629
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ApiModule, deps: [{ token: ApiModule, optional: true, skipSelf: true }, { token: i1.HttpClient, optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
13630
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: ApiModule }); }
13631
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ApiModule }); }
13549
+ async performNodeUiActionRequest(uiActionRequest) {
13550
+ let nodeId = uiActionRequest.params['nodeUuid'];
13551
+ delete uiActionRequest.params['nodeUuid'];
13552
+ let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
13553
+ this.treeFromBackend = await this.viewContext.handlePerformActionResponse(await this.service.performAction2(viewUuid, this.treeId, nodeId, uiActionRequest).toPromise());
13554
+ }
13555
+ async performMainUiActionRequest(uiActionRequest) {
13556
+ let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
13557
+ this.treeFromBackend = await this.viewContext.handlePerformActionResponse(await this.service.performMainAction2(viewUuid, this.treeId, uiActionRequest).toPromise());
13558
+ }
13559
+ handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
13560
+ throw new Error('Method not implemented.');
13561
+ }
13562
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeGenericService, deps: [{ token: i0.Injector }, { token: 'pageName' }, { token: 'treeId' }, { token: 'treeMenuIcon' }], target: i0.ɵɵFactoryTarget.Injectable }); }
13563
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeGenericService, providedIn: 'root' }); }
13632
13564
  }
13633
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ApiModule, decorators: [{
13634
- type: NgModule,
13565
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeGenericService, decorators: [{
13566
+ type: Injectable,
13635
13567
  args: [{
13636
- imports: [],
13637
- declarations: [],
13638
- exports: [],
13639
- providers: []
13568
+ providedIn: 'root',
13640
13569
  }]
13641
- }], ctorParameters: () => [{ type: ApiModule, decorators: [{
13642
- type: Optional
13643
- }, {
13644
- type: SkipSelf
13645
- }] }, { type: i1.HttpClient, decorators: [{
13646
- type: Optional
13570
+ }], ctorParameters: () => [{ type: i0.Injector }, { type: undefined, decorators: [{
13571
+ type: Inject,
13572
+ args: ['pageName']
13573
+ }] }, { type: undefined, decorators: [{
13574
+ type: Inject,
13575
+ args: ['treeId']
13576
+ }] }, { type: undefined, decorators: [{
13577
+ type: Inject,
13578
+ args: ['treeMenuIcon']
13647
13579
  }] }] });
13648
13580
 
13649
- /*
13650
- * Public API Surface of smart-grid
13651
- */
13652
-
13653
- class SmartComponentLayoutComponent {
13654
- constructor(layoutService, element, renderer) {
13655
- this.layoutService = layoutService;
13656
- this.element = element;
13657
- this.renderer = renderer;
13581
+ class SmartTreeComponent {
13582
+ constructor(cdr) {
13583
+ this.cdr = cdr;
13658
13584
  this._destroy$ = new Subject();
13585
+ this.treeControl = new NestedTreeControl((node) => node.childrenNodes);
13586
+ this.dataSource = new MatTreeNestedDataSource();
13587
+ this.smartTreeNodeButtonType = SmartTreeNodeButtonType;
13588
+ this.uiActionModels = [];
13589
+ this.hasChild = (_, node) => node.hasChildren;
13659
13590
  }
13660
- ngAfterViewInit() {
13661
- if (this.smartFormList?.first) {
13662
- this.setFormComponent(this.smartFormList?.first);
13663
- }
13664
- this.smartFormList.changes
13665
- .pipe(takeUntil(this._destroy$))
13666
- .subscribe((list) => {
13667
- this.setFormComponent(list.first);
13668
- });
13669
- if (this.smartGridList?.first) {
13670
- this.setGridComponent(this.smartGridList?.first);
13591
+ ngOnInit() {
13592
+ if (!this.treeService) {
13593
+ throw new Error('TreeService has not been given!');
13671
13594
  }
13672
- this.smartGridList.changes
13673
- .pipe(takeUntil(this._destroy$))
13674
- .subscribe((list) => {
13675
- this.setGridComponent(list.first);
13595
+ this.errorMessage = this.treeService.errorMessage;
13596
+ this.treeService.smartTreeModelChanged.subscribe((newSmartTree) => {
13597
+ this.treeData = newSmartTree;
13598
+ this.dataSource.data = this.treeData.rootNodes;
13599
+ this.expandTreeNodes();
13676
13600
  });
13677
- this.smartFilterList.changes
13678
- .pipe(takeUntil(this._destroy$))
13679
- .subscribe((list) => {
13680
- if (!this.smartFilterComponent) {
13681
- this.smartFilterComponent = list.first;
13682
- this.bindFilter();
13601
+ this.treeService.uiActionModelsChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
13602
+ if (this.treeService.uiActionModels) {
13603
+ this.uiActionModels = this.treeService.uiActionModels;
13683
13604
  }
13684
13605
  });
13685
- if (this.toolbarList?.first) {
13686
- this.setToolbarComponent(this.toolbarList?.first);
13687
- }
13688
- this.toolbarList.changes
13689
- .pipe(takeUntil(this._destroy$))
13690
- .subscribe((list) => {
13691
- this.setToolbarComponent(list.first);
13692
- });
13693
- this.setUp();
13694
13606
  }
13695
- ngOnDestroy() {
13696
- this._destroy$.next();
13697
- this._destroy$.complete();
13698
- }
13699
- ngOnChanges(changes) {
13700
- this.setUp();
13701
- }
13702
- setUp() {
13703
- if (!this.parentSmartComponent || !this.smartComponentLayout) {
13704
- return;
13705
- }
13706
- if (deepEqual(this.smartComponentLayout, this.currentLayout)) {
13707
- // no layout change, keep current state
13708
- this.smartComponentLayout = this.currentLayout;
13709
- return;
13710
- }
13711
- // layout changed, render, but save current
13712
- // this.currentLayout = JSON.parse(JSON.stringify(this.smartComponentLayout));
13713
- this.currentLayout = this.smartComponentLayout;
13714
- this.uuid = this.parentSmartComponent.uuid;
13715
- this.treeService = this.parentSmartComponent.smartTreeService;
13716
- this.smartComponentLayout?.direction;
13717
- if (this.smartComponentLayout?.expandable) {
13718
- this.constructExpandableSection();
13719
- }
13720
- else if (this.smartComponentLayout?.type === ComponentType.FORM) {
13721
- this.constructForm();
13722
- }
13723
- else if (this.smartComponentLayout?.type === ComponentType.WIDGET) {
13724
- if (this.smartComponentLayout.widget?.type === ComponentWidgetType.GRID) {
13725
- this.constructGrid();
13726
- }
13727
- else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.FILTER) {
13728
- console.warn('ComponentWidgetType.FILTER is not supported');
13729
- // this.constructFilter();
13730
- }
13731
- else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.TREE) {
13732
- this.constructTree();
13733
- }
13734
- else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.TOOLBAR) {
13735
- this.constructToolbar();
13736
- }
13737
- if (!this.parentLayoutComponent) {
13738
- // only top level component should call init actions
13739
- this.parentSmartComponent.initActions();
13740
- }
13741
- }
13742
- SmartStyleUtility.applyStyle(this.smartComponentLayout.style, this.element, this.renderer);
13607
+ ngOnDestroy() {
13608
+ this._destroy$.next();
13609
+ this._destroy$.complete();
13743
13610
  }
13744
- type() {
13745
- return ComponentType;
13611
+ getIfExpanded(node) {
13612
+ return this.treeControl.isExpanded(node);
13746
13613
  }
13747
- constructExpandableSection() {
13748
- let data = { ...this.smartComponentLayout };
13749
- data.expandable = false;
13750
- this.expandableSection = {
13751
- title: this.smartComponentLayout?.expandableSectionLabel ?? '',
13752
- inputs: new Map([
13753
- ['smartComponentLayout', data],
13754
- ['parentSmartComponent', this.parentSmartComponent],
13755
- ['parentLayoutComponent', this.parentLayoutComponent],
13756
- ]),
13757
- customComponent: SmartComponentLayoutComponent,
13758
- };
13614
+ expandTreeNodes() {
13615
+ this.expandTreeNodesDeeply(this.dataSource.data);
13759
13616
  }
13760
- constructForm() {
13761
- const widgets = this.layoutService.render({
13762
- layoutDefinitions: this.smartComponentLayout?.form,
13617
+ expandTreeNodesDeeply(nodes) {
13618
+ nodes.forEach((node) => {
13619
+ if (node.expanded) {
13620
+ this.treeControl.expand(node);
13621
+ this.cdr.markForCheck();
13622
+ if (node.childrenNodes && node.childrenNodes.length) {
13623
+ this.expandTreeNodesDeeply(node.childrenNodes);
13624
+ }
13625
+ }
13626
+ else {
13627
+ this.treeControl.collapse(node);
13628
+ }
13763
13629
  });
13764
- this.smartForm = {
13765
- direction: this.getFormLayout(),
13766
- componentModel: this.parentSmartComponent?.model,
13767
- widgets,
13768
- };
13769
- this.bindForm();
13770
13630
  }
13771
- getFormLayout() {
13772
- if (this.smartComponentLayout?.direction) {
13773
- return this.smartComponentLayout?.direction === LayoutDirection.HORIZONTAL
13774
- ? SmartFormWidgetDirection.ROW
13775
- : SmartFormWidgetDirection.COL;
13631
+ onNodeClick(event, node) {
13632
+ event.stopPropagation();
13633
+ if (this.tempActiveNode)
13634
+ this.tempActiveNode.selected = false;
13635
+ node.selected = true;
13636
+ this.tempActiveNode = node;
13637
+ this.treeService.onTreeNodeClick(node);
13638
+ }
13639
+ onOpenNode(event, node) {
13640
+ event.stopPropagation();
13641
+ this.treeService.onTreeNodeOpen(node);
13642
+ }
13643
+ getNodeStyle(node) {
13644
+ if (this.treeStyle) {
13645
+ var style = node.selected
13646
+ ? {
13647
+ background: this.treeStyle.activeStyle?.backgroundColor,
13648
+ color: this.treeStyle.activeStyle?.color,
13649
+ }
13650
+ : {
13651
+ background: this.treeStyle.levelBackgroundColor[node.level],
13652
+ color: this.treeStyle.color,
13653
+ };
13654
+ return style;
13776
13655
  }
13777
- return SmartFormWidgetDirection.COL;
13656
+ return {};
13778
13657
  }
13779
- setFormComponent(comp) {
13780
- if (!this.smartFormComponent) {
13781
- this.smartFormComponent = comp;
13782
- this.bindForm();
13658
+ getNodePadding(node) {
13659
+ if (this.treeStyle) {
13660
+ var style = node.selected
13661
+ ? {
13662
+ 'padding-left': 15 * node.level + 'px',
13663
+ }
13664
+ : {
13665
+ 'padding-left': 15 * node.level + 'px',
13666
+ };
13667
+ return style;
13783
13668
  }
13669
+ return {};
13784
13670
  }
13785
- bindForm() {
13786
- if (this.parentSmartComponent?.useQueryLists) {
13671
+ customButtonClicked(event, button, close) {
13672
+ event.stopPropagation();
13673
+ if (button.type === SmartTreeNodeButtonType.MENU) {
13787
13674
  return;
13788
13675
  }
13789
- if (this.smartForm && this.smartFormComponent) {
13790
- this.parentSmartComponent?.addForm(
13791
- // unique identifier for the form
13792
- `form_${this.makeid(5)}`, this.smartForm, this.smartFormComponent);
13676
+ if (!button.callback) {
13677
+ throw new Error(`Button with name ${button.label || button.icon} does not have a callback!`);
13793
13678
  }
13794
- }
13795
- makeid(length) {
13796
- let result = '';
13797
- const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
13798
- const charactersLength = characters.length;
13799
- let counter = 0;
13800
- while (counter < length) {
13801
- result += characters.charAt(Math.floor(Math.random() * charactersLength));
13802
- counter += 1;
13679
+ button.callback(button.args);
13680
+ if (close) {
13681
+ let openMenus = this.trigger.filter((matMenuTrigger) => matMenuTrigger.menuOpen);
13682
+ openMenus.forEach((matMenuTrigger) => {
13683
+ matMenuTrigger.closeMenu();
13684
+ });
13803
13685
  }
13804
- return result;
13805
- }
13806
- constructGrid() {
13807
- this.smartGrid = {
13808
- gridIdentifier: this.smartComponentLayout?.widget?.identifier,
13809
- gridModel: {
13810
- page: {},
13811
- },
13812
- options: {
13813
- rowUiActionType: GridUiActionType.POPUP_MENU,
13814
- },
13815
- layoutDef: SmartLayoutDef.TABLE,
13816
- paginator: true,
13817
- };
13818
- this.bindGrid();
13819
13686
  }
13820
- setGridComponent(comp) {
13821
- if (!this.smartGridComponent) {
13822
- this.smartGridComponent = comp;
13823
- this.bindGrid();
13687
+ getClassesForTreeNode(node) {
13688
+ let classes = [];
13689
+ if (node.expanded) {
13690
+ classes.push(this.getCustomClass('expanded', node.level));
13824
13691
  }
13825
- }
13826
- bindGrid() {
13827
- if (this.parentSmartComponent?.useQueryLists) {
13828
- return;
13692
+ else {
13693
+ classes.push(this.getCustomClass('collapsed', node.level));
13829
13694
  }
13830
- if (this.smartGrid && this.smartGridComponent) {
13831
- this.smartGrid = this.parentSmartComponent?.addGrid(this.smartGrid, {
13832
- rowUiActionType: GridUiActionType.POPUP_MENU,
13833
- }, false, this.smartGridComponent);
13695
+ if (node.selected) {
13696
+ classes.push(this.getCustomClass('selected', node.level));
13834
13697
  }
13835
- }
13836
- setToolbarComponent(comp) {
13837
- this.toolbar = comp;
13838
- }
13839
- // NOT USED, DOESN'T WORK
13840
- // constructFilter(): void {
13841
- // this.smartFilter = (this.smartComponentLayout!.parentComponent as any).addFilter(
13842
- // `filter_${this.makeid(5)}`,
13843
- // this.smartComponentLayout?.widget?.filterExpressionFieldList,
13844
- // this.smartComponentLayout?.widget?.filterType,
13845
- // this.smartFilterComponent
13846
- // );
13847
- // }
13848
- bindFilter() {
13849
- // TODO
13850
- }
13851
- constructTree() {
13852
- if (this.parentSmartComponent?.useQueryLists) {
13853
- return;
13698
+ else {
13699
+ classes.push(this.getCustomClass('unselected', node.level));
13854
13700
  }
13855
- this.parentSmartComponent.setUpDefaultTree(this.smartComponentLayout?.widget?.identifier);
13856
- this.treeService?.initialize();
13701
+ if (node.level !== 0) {
13702
+ classes.push(this.getCustomClass('child', node.level));
13703
+ }
13704
+ return classes;
13857
13705
  }
13858
- constructToolbar() {
13859
- let toolbarId = this.smartComponentLayout?.widget?.identifier;
13860
- if (this.toolbarId !== toolbarId) {
13861
- this.toolbarId = toolbarId;
13706
+ getInnerClassesForTreeNode(node) {
13707
+ let classes = [];
13708
+ if (node.expanded) {
13709
+ classes.push(this.getCustomClass('inner-expanded', node.level));
13710
+ }
13711
+ else {
13712
+ classes.push(this.getCustomClass('inner-collapsed', node.level));
13713
+ }
13714
+ if (node.selected) {
13715
+ classes.push(this.getCustomClass('inner-selected', node.level));
13716
+ }
13717
+ else {
13718
+ classes.push(this.getCustomClass('inner-unselected', node.level));
13862
13719
  }
13720
+ return classes;
13863
13721
  }
13864
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutComponent, deps: [{ token: SmartformLayoutDefinitionService }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
13865
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: { smartComponentLayout: "smartComponentLayout", parentLayoutComponent: "parentLayoutComponent", parentSmartComponent: "parentSmartComponent" }, 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: "expandableComponents", predicate: ExpandableSectionComponent, 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 [parentSmartComponent]=\"parentSmartComponent\"\r\n [parentLayoutComponent]=\"this\"\r\n [smartComponentLayout]=\"layout\"\r\n ></smart-component-layout>\r\n </div>\r\n <smartform *ngIf=\"smartForm\" #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid *ngIf=\"smartGrid\" #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 *ngIf=\"!!toolbarId\" #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"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SmartGridComponent, selector: "smart-grid", inputs: ["smartGrid", "uuid", "dev"] }, { kind: "component", type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }, { kind: "component", type: SmartTreeComponent, selector: "smart-tree", inputs: ["treeStyle", "treeService"] }, { kind: "component", type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id"] }, { kind: "component", type: SmartformComponent, selector: "smartform", inputs: ["smartForm"] }, { kind: "component", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: ["smartComponentLayout", "parentLayoutComponent", "parentSmartComponent"] }] }); }
13722
+ getClassesForTreeNodeChildren(node) {
13723
+ let classes = [];
13724
+ classes.push(this.getCustomClass('group', node.level));
13725
+ return classes;
13726
+ }
13727
+ getCustomClass(cssClass, plusProperty) {
13728
+ return `${cssClass}-${plusProperty}`;
13729
+ }
13730
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartTreeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
13731
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", 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"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i2$3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2$3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i10$1.MatNestedTreeNode, selector: "mat-nested-tree-node", inputs: ["matNestedTreeNode", "disabled", "tabIndex"], exportAs: ["matNestedTreeNode"] }, { kind: "directive", type: i10$1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i10$1.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i10$1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i10$1.MatTreeNodeOutlet, selector: "[matTreeNodeOutlet]" }, { kind: "component", type: i5$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i5$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { kind: "component", type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id"] }] }); }
13866
13732
  }
13867
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutComponent, decorators: [{
13733
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartTreeComponent, decorators: [{
13868
13734
  type: Component,
13869
- 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 [parentSmartComponent]=\"parentSmartComponent\"\r\n [parentLayoutComponent]=\"this\"\r\n [smartComponentLayout]=\"layout\"\r\n ></smart-component-layout>\r\n </div>\r\n <smartform *ngIf=\"smartForm\" #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid *ngIf=\"smartGrid\" #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 *ngIf=\"!!toolbarId\" #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"] }]
13870
- }], ctorParameters: () => [{ type: SmartformLayoutDefinitionService }, { type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { smartComponentLayout: [{
13871
- type: Input
13872
- }], parentLayoutComponent: [{
13735
+ 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"] }]
13736
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { trigger: [{
13737
+ type: ViewChildren,
13738
+ args: [MatMenuTrigger]
13739
+ }], tree: [{
13740
+ type: ViewChild,
13741
+ args: ['tree']
13742
+ }], treeStyle: [{
13873
13743
  type: Input
13874
- }], parentSmartComponent: [{
13744
+ }], treeService: [{
13875
13745
  type: Input
13876
- }], smartFormList: [{
13877
- type: ViewChildren,
13878
- args: ['form']
13879
- }], smartGridList: [{
13880
- type: ViewChildren,
13881
- args: ['grid']
13882
- }], smartFilterList: [{
13883
- type: ViewChildren,
13884
- args: ['filter']
13885
- }], toolbarList: [{
13886
- type: ViewChildren,
13887
- args: ['toolbar']
13888
- }], expandableComponents: [{
13889
- type: ViewChildren,
13890
- args: [ExpandableSectionComponent]
13891
- }], components: [{
13892
- type: ViewChildren,
13893
- args: [SmartComponentLayoutComponent]
13894
13746
  }] } });
13895
13747
 
13896
- class SmartComponentLayoutModule {
13897
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
13898
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutModule, declarations: [SmartComponentLayoutComponent], imports: [BrowserModule,
13748
+ class SmarttreeModule {
13749
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
13750
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeModule, declarations: [SmartTreeComponent], imports: [BrowserModule,
13899
13751
  MatCommonModule,
13900
- SmartGridModule,
13901
- SmartExpandableSectionModule,
13902
- SmarttreeModule,
13903
- SmartViewContextModule], exports: [SmartComponentLayoutComponent] }); }
13904
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutModule, imports: [BrowserModule,
13752
+ MatButtonModule,
13753
+ MatIconModule,
13754
+ MatTreeModule,
13755
+ MatMenuModule,
13756
+ SmartIconModule,
13757
+ SmartViewContextModule], exports: [SmartTreeComponent] }); }
13758
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeModule, providers: [
13759
+ SmarttreeService,
13760
+ SmarttreeGenericService,
13761
+ { provide: 'treeMenuIcon', useValue: 'more_vert' },
13762
+ ], imports: [BrowserModule,
13905
13763
  MatCommonModule,
13906
- SmartGridModule,
13907
- SmartExpandableSectionModule,
13908
- SmarttreeModule,
13764
+ MatButtonModule,
13765
+ MatIconModule,
13766
+ MatTreeModule,
13767
+ MatMenuModule,
13768
+ SmartIconModule,
13909
13769
  SmartViewContextModule] }); }
13910
13770
  }
13911
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutModule, decorators: [{
13771
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeModule, decorators: [{
13912
13772
  type: NgModule,
13913
13773
  args: [{
13914
- declarations: [SmartComponentLayoutComponent],
13774
+ declarations: [SmartTreeComponent],
13915
13775
  imports: [
13916
13776
  BrowserModule,
13917
13777
  MatCommonModule,
13918
- SmartGridModule,
13919
- SmartExpandableSectionModule,
13920
- SmarttreeModule,
13778
+ MatButtonModule,
13779
+ MatIconModule,
13780
+ MatTreeModule,
13781
+ MatMenuModule,
13782
+ SmartIconModule,
13921
13783
  SmartViewContextModule,
13922
13784
  ],
13923
- exports: [SmartComponentLayoutComponent],
13924
- providers: [],
13785
+ exports: [SmartTreeComponent],
13786
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
13787
+ providers: [
13788
+ SmarttreeService,
13789
+ SmarttreeGenericService,
13790
+ { provide: 'treeMenuIcon', useValue: 'more_vert' },
13791
+ ],
13925
13792
  }]
13926
13793
  }] });
13927
13794
 
13928
- class SmartFilterParamComponent {
13929
- constructor() { }
13930
- onItemClick(item) {
13931
- this.data.serviceToUse.peformWidgetAction({
13932
- code: 'ADD_FILTER_EXPRESSION',
13933
- params: {
13934
- model: item,
13935
- },
13936
- });
13795
+ /**
13796
+ * Custom HttpParameterCodec
13797
+ * Workaround for https://github.com/angular/angular/issues/18261
13798
+ */
13799
+ let CustomHttpParameterCodec$1 = class CustomHttpParameterCodec {
13800
+ encodeKey(k) {
13801
+ return encodeURIComponent(k);
13937
13802
  }
13938
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterParamComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13939
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", 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"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }] }); }
13940
- }
13941
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterParamComponent, decorators: [{
13942
- type: Component,
13943
- 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"] }]
13944
- }], ctorParameters: () => [], propDecorators: { data: [{
13945
- type: Input
13946
- }] } });
13947
-
13948
- class SmartFilterParamsComponent {
13949
- constructor() {
13950
- this._destroy$ = new Subject();
13951
- this.expandableSections = [];
13803
+ encodeValue(v) {
13804
+ return encodeURIComponent(v);
13952
13805
  }
13953
- ngOnInit() {
13954
- this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
13955
- this.setUp(this.service.model);
13956
- });
13957
- this.setUp(this.service.model);
13806
+ decodeKey(k) {
13807
+ return decodeURIComponent(k);
13958
13808
  }
13959
- ngOnDestroy() {
13960
- this._destroy$.next();
13961
- this._destroy$.complete();
13809
+ decodeValue(v) {
13810
+ return decodeURIComponent(v);
13962
13811
  }
13963
- setUp(model) {
13964
- if (model?.model) {
13965
- this.filterBuilder = model.model;
13966
- this.constructExpandableSections();
13812
+ };
13813
+
13814
+ const BASE_PATH$1 = new InjectionToken('basePath');
13815
+ const COLLECTION_FORMATS$1 = {
13816
+ 'csv': ',',
13817
+ 'tsv': ' ',
13818
+ 'ssv': ' ',
13819
+ 'pipes': '|'
13820
+ };
13821
+
13822
+ let Configuration$1 = class Configuration {
13823
+ constructor(configurationParameters = {}) {
13824
+ this.apiKeys = configurationParameters.apiKeys;
13825
+ this.username = configurationParameters.username;
13826
+ this.password = configurationParameters.password;
13827
+ this.accessToken = configurationParameters.accessToken;
13828
+ this.basePath = configurationParameters.basePath;
13829
+ this.withCredentials = configurationParameters.withCredentials;
13830
+ this.encoder = configurationParameters.encoder;
13831
+ if (configurationParameters.encodeParam) {
13832
+ this.encodeParam = configurationParameters.encodeParam;
13833
+ }
13834
+ else {
13835
+ this.encodeParam = param => this.defaultEncodeParam(param);
13836
+ }
13837
+ if (configurationParameters.credentials) {
13838
+ this.credentials = configurationParameters.credentials;
13839
+ }
13840
+ else {
13841
+ this.credentials = {};
13967
13842
  }
13968
13843
  }
13969
- constructExpandableSections() {
13970
- if (this.filterBuilder.groups) {
13971
- this.expandableSections = this.filterBuilder.groups.map((filterExpressionBuilderGroup) => {
13972
- return {
13973
- title: filterExpressionBuilderGroup.label,
13974
- cssClass: 'filterExpressionBuilderGroup',
13975
- customComponent: SmartFilterParamComponent,
13976
- data: {
13977
- group: filterExpressionBuilderGroup.fields,
13978
- serviceToUse: this.service,
13979
- },
13980
- inputName: 'data',
13981
- isExpanded: true,
13982
- };
13983
- });
13844
+ /**
13845
+ * Select the correct content-type to use for a request.
13846
+ * Uses {@link Configuration#isJsonMime} to determine the correct content-type.
13847
+ * If no content type is found return the first found type if the contentTypes is not empty
13848
+ * @param contentTypes - the array of content types that are available for selection
13849
+ * @returns the selected content-type or <code>undefined</code> if no selection could be made.
13850
+ */
13851
+ selectHeaderContentType(contentTypes) {
13852
+ if (contentTypes.length === 0) {
13853
+ return undefined;
13854
+ }
13855
+ const type = contentTypes.find((x) => this.isJsonMime(x));
13856
+ if (type === undefined) {
13857
+ return contentTypes[0];
13984
13858
  }
13859
+ return type;
13985
13860
  }
13986
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterParamsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13987
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", 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"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }] }); }
13988
- }
13989
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterParamsComponent, decorators: [{
13990
- type: Component,
13991
- 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"] }]
13992
- }], ctorParameters: () => [], propDecorators: { service: [{
13993
- type: Input
13994
- }], filterVcRef: [{
13995
- type: ViewChild,
13996
- args: ['smartFilter', { read: ViewContainerRef }]
13997
- }] } });
13998
-
13999
- class SmartFilterService {
14000
- constructor() {
14001
- this._destroy$ = new Subject();
14002
- this.shouldSubmit = new Subject();
14003
- this.reSubscribeToSubmit = new Subject();
14004
- this.change = new Subject();
13861
+ /**
13862
+ * Select the correct accept content-type to use for a request.
13863
+ * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
13864
+ * If no content type is found return the first found type if the contentTypes is not empty
13865
+ * @param accepts - the array of content types that are available for selection.
13866
+ * @returns the selected content-type or <code>undefined</code> if no selection could be made.
13867
+ */
13868
+ selectHeaderAccept(accepts) {
13869
+ if (accepts.length === 0) {
13870
+ return undefined;
13871
+ }
13872
+ const type = accepts.find((x) => this.isJsonMime(x));
13873
+ if (type === undefined) {
13874
+ return accepts[0];
13875
+ }
13876
+ return type;
14005
13877
  }
14006
- ngOnDestroy() {
14007
- this._destroy$.next();
14008
- this._destroy$.complete();
13878
+ /**
13879
+ * Check if the given MIME is a JSON MIME.
13880
+ * JSON MIME examples:
13881
+ * application/json
13882
+ * application/json; charset=UTF8
13883
+ * APPLICATION/JSON
13884
+ * application/vnd.company+json
13885
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
13886
+ * @return True if the given MIME is JSON, false otherwise.
13887
+ */
13888
+ isJsonMime(mime) {
13889
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
13890
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
14009
13891
  }
14010
- async submit() {
14011
- this.shouldSubmit.next();
14012
- await this.shouldSubmit.pipe(takeUntil(this._destroy$)).toPromise();
14013
- this.shouldSubmit = new Subject();
14014
- this.reSubscribeToSubmit.next();
14015
- return this.filter;
13892
+ lookupCredential(key) {
13893
+ const value = this.credentials[key];
13894
+ return typeof value === 'function'
13895
+ ? value()
13896
+ : value;
14016
13897
  }
14017
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
14018
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterService, providedIn: 'root' }); }
14019
- }
14020
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterService, decorators: [{
14021
- type: Injectable,
14022
- args: [{
14023
- providedIn: 'root',
14024
- }]
14025
- }], ctorParameters: () => [] });
14026
-
14027
- /**
14028
- * Filter API 2
14029
- * Filter API 2
14030
- *
14031
- * The version of the OpenAPI document: 1.0.0
14032
- * Contact: info@it4all.hu
14033
- *
14034
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
14035
- * https://openapi-generator.tech
14036
- * Do not edit the class manually.
14037
- */
14038
- var FilterExpressionBoolOperator$1;
14039
- (function (FilterExpressionBoolOperator) {
14040
- FilterExpressionBoolOperator["AND"] = "AND";
14041
- FilterExpressionBoolOperator["OR"] = "OR";
14042
- })(FilterExpressionBoolOperator$1 || (FilterExpressionBoolOperator$1 = {}));
14043
-
14044
- /**
14045
- * Filter API 2
14046
- * Filter API 2
14047
- *
14048
- * The version of the OpenAPI document: 1.0.0
14049
- * Contact: info@it4all.hu
14050
- *
14051
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
14052
- * https://openapi-generator.tech
14053
- * Do not edit the class manually.
14054
- */
14055
- var FilterExpressionDataType;
14056
- (function (FilterExpressionDataType) {
14057
- FilterExpressionDataType["STRING"] = "STRING";
14058
- FilterExpressionDataType["NUMBER"] = "NUMBER";
14059
- FilterExpressionDataType["DATE"] = "DATE";
14060
- FilterExpressionDataType["DATE_TIME"] = "DATE_TIME";
14061
- FilterExpressionDataType["BOOLEAN"] = "BOOLEAN";
14062
- })(FilterExpressionDataType || (FilterExpressionDataType = {}));
13898
+ defaultEncodeParam(param) {
13899
+ // This implementation exists as fallback for missing configuration
13900
+ // and for backwards compatibility to older typescript-angular generator versions.
13901
+ // It only works for the 'simple' parameter style.
13902
+ // Date-handling only works for the 'date-time' format.
13903
+ // All other styles and Date-formats are probably handled incorrectly.
13904
+ //
13905
+ // But: if that's all you need (i.e.: the most common use-case): no need for customization!
13906
+ const value = param.dataFormat === 'date-time' && param.value instanceof Date
13907
+ ? param.value.toISOString()
13908
+ : param.value;
13909
+ return encodeURIComponent(String(value));
13910
+ }
13911
+ };
14063
13912
 
14064
13913
  /**
14065
- * Filter API 2
14066
- * Filter API 2
13914
+ * Form layout definition
13915
+ * Contains form layout definition objects.
14067
13916
  *
14068
13917
  * The version of the OpenAPI document: 1.0.0
14069
13918
  * Contact: info@it4all.hu
@@ -14072,25 +13921,124 @@ var FilterExpressionDataType;
14072
13921
  * https://openapi-generator.tech
14073
13922
  * Do not edit the class manually.
14074
13923
  */
14075
- var FilterExpressionFieldWidgetType;
14076
- (function (FilterExpressionFieldWidgetType) {
14077
- FilterExpressionFieldWidgetType["TEXT_FIELD"] = "TEXT_FIELD";
14078
- FilterExpressionFieldWidgetType["TEXT_FIELD_CHIPS"] = "TEXT_FIELD_CHIPS";
14079
- FilterExpressionFieldWidgetType["TEXT_FIELD_NUMBER"] = "TEXT_FIELD_NUMBER";
14080
- FilterExpressionFieldWidgetType["TEXT_BOX"] = "TEXT_BOX";
14081
- FilterExpressionFieldWidgetType["SELECT"] = "SELECT";
14082
- FilterExpressionFieldWidgetType["SELECT_MULTIPLE"] = "SELECT_MULTIPLE";
14083
- FilterExpressionFieldWidgetType["DATE"] = "DATE";
14084
- FilterExpressionFieldWidgetType["TIME"] = "TIME";
14085
- FilterExpressionFieldWidgetType["DATE_TIME"] = "DATE_TIME";
14086
- FilterExpressionFieldWidgetType["CHECK_BOX"] = "CHECK_BOX";
14087
- FilterExpressionFieldWidgetType["RADIO_BUTTON"] = "RADIO_BUTTON";
14088
- FilterExpressionFieldWidgetType["RANGE"] = "RANGE";
14089
- })(FilterExpressionFieldWidgetType || (FilterExpressionFieldWidgetType = {}));
13924
+ /* tslint:disable:no-unused-variable member-ordering */
13925
+ class DefaultService {
13926
+ constructor(httpClient, basePath, configuration) {
13927
+ this.httpClient = httpClient;
13928
+ this.basePath = 'http://localhost';
13929
+ this.defaultHeaders = new HttpHeaders();
13930
+ this.configuration = new Configuration$1();
13931
+ if (configuration) {
13932
+ this.configuration = configuration;
13933
+ }
13934
+ if (typeof this.configuration.basePath !== 'string') {
13935
+ if (Array.isArray(basePath) && basePath.length > 0) {
13936
+ basePath = basePath[0];
13937
+ }
13938
+ if (typeof basePath !== 'string') {
13939
+ basePath = this.basePath;
13940
+ }
13941
+ this.configuration.basePath = basePath;
13942
+ }
13943
+ this.encoder = this.configuration.encoder || new CustomHttpParameterCodec$1();
13944
+ }
13945
+ // @ts-ignore
13946
+ addToHttpParams(httpParams, value, key) {
13947
+ if (typeof value === "object" && value instanceof Date === false) {
13948
+ httpParams = this.addToHttpParamsRecursive(httpParams, value);
13949
+ }
13950
+ else {
13951
+ httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
13952
+ }
13953
+ return httpParams;
13954
+ }
13955
+ addToHttpParamsRecursive(httpParams, value, key) {
13956
+ if (value == null) {
13957
+ return httpParams;
13958
+ }
13959
+ if (typeof value === "object") {
13960
+ if (Array.isArray(value)) {
13961
+ value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
13962
+ }
13963
+ else if (value instanceof Date) {
13964
+ if (key != null) {
13965
+ httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
13966
+ }
13967
+ else {
13968
+ throw Error("key may not be null if value is Date");
13969
+ }
13970
+ }
13971
+ else {
13972
+ Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
13973
+ }
13974
+ }
13975
+ else if (key != null) {
13976
+ httpParams = httpParams.append(key, value);
13977
+ }
13978
+ else {
13979
+ throw Error("key may not be null if value is not object or array");
13980
+ }
13981
+ return httpParams;
13982
+ }
13983
+ nopePost(observe = 'body', reportProgress = false, options) {
13984
+ let localVarHeaders = this.defaultHeaders;
13985
+ let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
13986
+ if (localVarHttpHeaderAcceptSelected === undefined) {
13987
+ // to determine the Accept header
13988
+ const httpHeaderAccepts = [];
13989
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
13990
+ }
13991
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
13992
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
13993
+ }
13994
+ let localVarHttpContext = options && options.context;
13995
+ if (localVarHttpContext === undefined) {
13996
+ localVarHttpContext = new HttpContext();
13997
+ }
13998
+ let responseType_ = 'json';
13999
+ if (localVarHttpHeaderAcceptSelected) {
14000
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
14001
+ responseType_ = 'text';
14002
+ }
14003
+ else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
14004
+ responseType_ = 'json';
14005
+ }
14006
+ else {
14007
+ responseType_ = 'blob';
14008
+ }
14009
+ }
14010
+ let localVarPath = `/nope`;
14011
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
14012
+ context: localVarHttpContext,
14013
+ responseType: responseType_,
14014
+ withCredentials: this.configuration.withCredentials,
14015
+ headers: localVarHeaders,
14016
+ observe: observe,
14017
+ reportProgress: reportProgress
14018
+ });
14019
+ }
14020
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: DefaultService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH$1, optional: true }, { token: Configuration$1, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
14021
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: DefaultService, providedIn: 'root' }); }
14022
+ }
14023
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: DefaultService, decorators: [{
14024
+ type: Injectable,
14025
+ args: [{
14026
+ providedIn: 'root'
14027
+ }]
14028
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
14029
+ type: Optional
14030
+ }, {
14031
+ type: Inject,
14032
+ args: [BASE_PATH$1]
14033
+ }] }, { type: Configuration$1, decorators: [{
14034
+ type: Optional
14035
+ }] }] });
14036
+
14037
+ const APIS = [DefaultService];
14090
14038
 
14091
14039
  /**
14092
- * Filter API 2
14093
- * Filter API 2
14040
+ * Form layout definition
14041
+ * Contains form layout definition objects.
14094
14042
  *
14095
14043
  * The version of the OpenAPI document: 1.0.0
14096
14044
  * Contact: info@it4all.hu
@@ -14099,30 +14047,16 @@ var FilterExpressionFieldWidgetType;
14099
14047
  * https://openapi-generator.tech
14100
14048
  * Do not edit the class manually.
14101
14049
  */
14102
- var FilterExpressionOperation;
14103
- (function (FilterExpressionOperation) {
14104
- FilterExpressionOperation["EXPRESSION"] = "EXPRESSION";
14105
- FilterExpressionOperation["EQUAL"] = "EQUAL";
14106
- FilterExpressionOperation["NOT_EQUAL"] = "NOT_EQUAL";
14107
- FilterExpressionOperation["LESS"] = "LESS";
14108
- FilterExpressionOperation["LESS_OR_EQUAL"] = "LESS_OR_EQUAL";
14109
- FilterExpressionOperation["GREATER"] = "GREATER";
14110
- FilterExpressionOperation["GREATER_OR_EQUAL"] = "GREATER_OR_EQUAL";
14111
- FilterExpressionOperation["LIKE"] = "LIKE";
14112
- FilterExpressionOperation["NOT_LIKE"] = "NOT_LIKE";
14113
- FilterExpressionOperation["BETWEEN"] = "BETWEEN";
14114
- FilterExpressionOperation["NOT_BETWEEN"] = "NOT_BETWEEN";
14115
- FilterExpressionOperation["IS_EMPTY"] = "IS_EMPTY";
14116
- FilterExpressionOperation["IS_NOT_EMPTY"] = "IS_NOT_EMPTY";
14117
- FilterExpressionOperation["EXISTS"] = "EXISTS";
14118
- FilterExpressionOperation["NOT_EXISTS"] = "NOT_EXISTS";
14119
- FilterExpressionOperation["IN"] = "IN";
14120
- FilterExpressionOperation["NOT_IN"] = "NOT_IN";
14121
- })(FilterExpressionOperation || (FilterExpressionOperation = {}));
14050
+ var ComponentType;
14051
+ (function (ComponentType) {
14052
+ ComponentType["CONTAINER"] = "container";
14053
+ ComponentType["FORM"] = "form";
14054
+ ComponentType["WIDGET"] = "widget";
14055
+ })(ComponentType || (ComponentType = {}));
14122
14056
 
14123
14057
  /**
14124
- * Filter API 2
14125
- * Filter API 2
14058
+ * Form layout definition
14059
+ * Contains form layout definition objects.
14126
14060
  *
14127
14061
  * The version of the OpenAPI document: 1.0.0
14128
14062
  * Contact: info@it4all.hu
@@ -14131,16 +14065,17 @@ var FilterExpressionOperation;
14131
14065
  * https://openapi-generator.tech
14132
14066
  * Do not edit the class manually.
14133
14067
  */
14134
- var FilterExpressionOrderByOrderEnum;
14135
- (function (FilterExpressionOrderByOrderEnum) {
14136
- FilterExpressionOrderByOrderEnum["ASC"] = "ASC";
14137
- FilterExpressionOrderByOrderEnum["DESC"] = "DESC";
14138
- })(FilterExpressionOrderByOrderEnum || (FilterExpressionOrderByOrderEnum = {}));
14139
- ;
14068
+ var ComponentWidgetType;
14069
+ (function (ComponentWidgetType) {
14070
+ ComponentWidgetType["GRID"] = "grid";
14071
+ ComponentWidgetType["FILTER"] = "filter";
14072
+ ComponentWidgetType["TREE"] = "tree";
14073
+ ComponentWidgetType["TOOLBAR"] = "toolbar";
14074
+ })(ComponentWidgetType || (ComponentWidgetType = {}));
14140
14075
 
14141
14076
  /**
14142
- * Filter API 2
14143
- * Filter API 2
14077
+ * Form layout definition
14078
+ * Contains form layout definition objects.
14144
14079
  *
14145
14080
  * The version of the OpenAPI document: 1.0.0
14146
14081
  * Contact: info@it4all.hu
@@ -14149,289 +14084,398 @@ var FilterExpressionOrderByOrderEnum;
14149
14084
  * https://openapi-generator.tech
14150
14085
  * Do not edit the class manually.
14151
14086
  */
14087
+ var LayoutDirection;
14088
+ (function (LayoutDirection) {
14089
+ LayoutDirection["HORIZONTAL"] = "horizontal";
14090
+ LayoutDirection["VERTICAL"] = "vertical";
14091
+ })(LayoutDirection || (LayoutDirection = {}));
14152
14092
 
14153
- var FilterExpressionBuilderGroupBuilderGroupKindEnum;
14154
- (function (FilterExpressionBuilderGroupBuilderGroupKindEnum) {
14155
- FilterExpressionBuilderGroupBuilderGroupKindEnum["DIPLAY"] = "DIPLAY";
14156
- FilterExpressionBuilderGroupBuilderGroupKindEnum["BRACKET"] = "BRACKET";
14157
- FilterExpressionBuilderGroupBuilderGroupKindEnum["EXIST"] = "EXIST";
14158
- })(FilterExpressionBuilderGroupBuilderGroupKindEnum || (FilterExpressionBuilderGroupBuilderGroupKindEnum = {}));
14159
- ;
14160
-
14161
- class SmartFilterSimpleFieldComponent {
14162
- constructor(service, cfService) {
14163
- this.service = service;
14164
- this.cfService = cfService;
14165
- this._destroy$ = new Subject();
14093
+ class ApiModule {
14094
+ static forRoot(configurationFactory) {
14095
+ return {
14096
+ ngModule: ApiModule,
14097
+ providers: [{ provide: Configuration$1, useFactory: configurationFactory }]
14098
+ };
14166
14099
  }
14167
- ngOnInit() {
14168
- this.operation = this.filterExpressionField.expressionData?.currentOperation;
14169
- this.currentOperation = this.getOptionLabel(this.operation);
14100
+ constructor(parentModule, http) {
14101
+ if (parentModule) {
14102
+ throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
14103
+ }
14104
+ if (!http) {
14105
+ throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
14106
+ 'See also https://github.com/angular/angular/issues/20575');
14107
+ }
14108
+ }
14109
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ApiModule, deps: [{ token: ApiModule, optional: true, skipSelf: true }, { token: i1.HttpClient, optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
14110
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: ApiModule }); }
14111
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ApiModule }); }
14112
+ }
14113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ApiModule, decorators: [{
14114
+ type: NgModule,
14115
+ args: [{
14116
+ imports: [],
14117
+ declarations: [],
14118
+ exports: [],
14119
+ providers: []
14120
+ }]
14121
+ }], ctorParameters: () => [{ type: ApiModule, decorators: [{
14122
+ type: Optional
14123
+ }, {
14124
+ type: SkipSelf
14125
+ }] }, { type: i1.HttpClient, decorators: [{
14126
+ type: Optional
14127
+ }] }] });
14128
+
14129
+ /*
14130
+ * Public API Surface of smart-grid
14131
+ */
14132
+
14133
+ class SmartComponentLayoutComponent {
14134
+ constructor(layoutService, element, renderer) {
14135
+ this.layoutService = layoutService;
14136
+ this.element = element;
14137
+ this.renderer = renderer;
14138
+ this._destroy$ = new Subject();
14170
14139
  }
14171
14140
  ngAfterViewInit() {
14172
- this.constructForm();
14141
+ if (this.smartFormList?.first) {
14142
+ this.setFormComponent(this.smartFormList?.first);
14143
+ }
14144
+ this.smartFormList.changes
14145
+ .pipe(takeUntil(this._destroy$))
14146
+ .subscribe((list) => {
14147
+ this.setFormComponent(list.first);
14148
+ });
14149
+ if (this.smartGridList?.first) {
14150
+ this.setGridComponent(this.smartGridList?.first);
14151
+ }
14152
+ this.smartGridList.changes
14153
+ .pipe(takeUntil(this._destroy$))
14154
+ .subscribe((list) => {
14155
+ this.setGridComponent(list.first);
14156
+ });
14157
+ this.smartFilterList.changes
14158
+ .pipe(takeUntil(this._destroy$))
14159
+ .subscribe((list) => {
14160
+ if (!this.smartFilterComponent) {
14161
+ this.smartFilterComponent = list.first;
14162
+ this.bindFilter();
14163
+ }
14164
+ });
14165
+ if (this.toolbarList?.first) {
14166
+ this.setToolbarComponent(this.toolbarList?.first);
14167
+ }
14168
+ this.toolbarList.changes
14169
+ .pipe(takeUntil(this._destroy$))
14170
+ .subscribe((list) => {
14171
+ this.setToolbarComponent(list.first);
14172
+ });
14173
+ this.setUp();
14173
14174
  }
14174
14175
  ngOnDestroy() {
14175
14176
  this._destroy$.next();
14176
14177
  this._destroy$.complete();
14177
14178
  }
14178
- constructFormWidget(key, label, widgetType, possibleValues, placeholder) {
14179
- let type = widgetType;
14180
- if (type === FilterExpressionFieldWidgetType.DATE) {
14181
- type = SmartFormWidgetType.DATE_PICKER;
14179
+ ngOnChanges(changes) {
14180
+ this.setUp();
14181
+ }
14182
+ setUp() {
14183
+ if (!this.parentSmartComponent || !this.smartComponentLayout) {
14184
+ return;
14182
14185
  }
14183
- else if (type === FilterExpressionFieldWidgetType.DATE_TIME) {
14184
- type = SmartFormWidgetType.DATE_TIME_PICKER;
14186
+ if (deepEqual(this.smartComponentLayout, this.currentLayout)) {
14187
+ // no layout change, keep current state
14188
+ this.smartComponentLayout = this.currentLayout;
14189
+ return;
14185
14190
  }
14186
- let widget = {
14187
- key,
14188
- label,
14189
- type,
14190
- value: '',
14191
- placeholder: placeholder,
14192
- showLabel: true,
14193
- valueList: possibleValues.map((value) => {
14194
- return {
14195
- key: value.objectUri ? value.objectUri : value.code,
14196
- label: value.displayValue,
14197
- type: SmartFormWidgetType.ITEM,
14198
- value: value.objectUri ? value.objectUri : value.code,
14199
- };
14200
- }),
14201
- };
14202
- return widget;
14203
- }
14204
- constructForm() {
14205
- this.vcRefForm?.clear();
14206
- let widgets = [];
14207
- let key;
14208
- if (this.filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
14209
- key = 'expressionData.operand2.selectedValues';
14191
+ // layout changed, render, but save current
14192
+ // this.currentLayout = JSON.parse(JSON.stringify(this.smartComponentLayout));
14193
+ this.currentLayout = this.smartComponentLayout;
14194
+ this.uuid = this.parentSmartComponent.uuid;
14195
+ this.treeService = this.parentSmartComponent.smartTreeService;
14196
+ this.smartComponentLayout?.direction;
14197
+ if (this.smartComponentLayout?.expandable) {
14198
+ this.constructExpandableSection();
14210
14199
  }
14211
- if (this.filterExpressionField.expressionData?.operand2) {
14212
- if (key !== 'expressionData.operand2.selectedValues') {
14213
- key = 'expressionData.operand2.valueAsString';
14214
- }
14215
- widgets.push(this.constructFormWidget(key, this.filterExpressionField.label2, this.filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, this.filterExpressionField.possibleValues, this.filterExpressionField.placeholder2));
14200
+ else if (this.smartComponentLayout?.type === ComponentType.FORM) {
14201
+ this.constructForm();
14216
14202
  }
14217
- if (this.filterExpressionField.expressionData?.operand3) {
14218
- if (key !== 'selectedValues') {
14219
- key = 'expressionData.operand3.valueAsString';
14203
+ else if (this.smartComponentLayout?.type === ComponentType.WIDGET) {
14204
+ if (this.smartComponentLayout.widget?.type === ComponentWidgetType.GRID) {
14205
+ this.constructGrid();
14206
+ }
14207
+ else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.FILTER) {
14208
+ console.warn('ComponentWidgetType.FILTER is not supported');
14209
+ // this.constructFilter();
14210
+ }
14211
+ else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.TREE) {
14212
+ this.constructTree();
14213
+ }
14214
+ else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.TOOLBAR) {
14215
+ this.constructToolbar();
14216
+ }
14217
+ if (!this.parentLayoutComponent) {
14218
+ // only top level component should call init actions
14219
+ this.parentSmartComponent.initActions();
14220
14220
  }
14221
- widgets.push(this.constructFormWidget(key, this.filterExpressionField.label3, this.filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, this.filterExpressionField.possibleValues, this.filterExpressionField.placeholder3));
14222
14221
  }
14223
- this.operation = this.filterExpressionField.expressionData?.currentOperation;
14224
- this.currentOperation = this.getOptionLabel(this.operation);
14222
+ SmartStyleUtility.applyStyle(this.smartComponentLayout.style, this.element, this.renderer);
14223
+ }
14224
+ type() {
14225
+ return ComponentType;
14226
+ }
14227
+ constructExpandableSection() {
14228
+ let data = { ...this.smartComponentLayout };
14229
+ data.expandable = false;
14230
+ this.expandableSection = {
14231
+ title: this.smartComponentLayout?.expandableSectionLabel ?? '',
14232
+ inputs: new Map([
14233
+ ['smartComponentLayout', data],
14234
+ ['parentSmartComponent', this.parentSmartComponent],
14235
+ ['parentLayoutComponent', this.parentLayoutComponent],
14236
+ ]),
14237
+ customComponent: SmartComponentLayoutComponent,
14238
+ };
14239
+ }
14240
+ constructForm() {
14241
+ const widgets = this.layoutService.render({
14242
+ layoutDefinitions: this.smartComponentLayout?.form,
14243
+ });
14225
14244
  this.smartForm = {
14226
- direction: SmartFormWidgetDirection.ROW,
14227
- componentModel: { data: this.filterExpressionField },
14228
- useOnValueChangeEvent: true,
14229
- useOnBlurEvent: true,
14230
- submitOnEnter: this.service.filter?.submitOnEnter,
14245
+ direction: this.getFormLayout(),
14246
+ componentModel: this.parentSmartComponent?.model,
14231
14247
  widgets,
14232
- translateService: this.service.filter?.translateService,
14233
14248
  };
14234
- // Show form on page
14235
- this.componentRefForm = this.cfService.createComponent(this.vcRefForm, SmartformComponent, new Map([['smartForm', this.smartForm]]));
14236
- this.componentRefForm.instance.onValueChangeSubject
14237
- ?.pipe(takeUntil(this._destroy$))
14238
- .subscribe(() => {
14239
- this.submit();
14240
- this.service.change.next();
14241
- });
14242
- this.componentRefForm.instance.onBlurSubject?.pipe(takeUntil(this._destroy$)).subscribe(() => {
14243
- this.submit();
14244
- this.service.change.next();
14245
- });
14249
+ this.bindForm();
14246
14250
  }
14247
- submit() {
14248
- let form = this.componentRefForm.instance.submitForm();
14249
- this.filterExpressionField = form.componentModel?.data;
14250
- this.simpleFieldChildren.forEach((smartFilterFieldComponent, index) => {
14251
- let filterExpressionField = smartFilterFieldComponent.submit();
14252
- this.filterExpressionField.subFieldList.filters[index] = filterExpressionField;
14253
- });
14254
- return this.filterExpressionField;
14251
+ getFormLayout() {
14252
+ if (this.smartComponentLayout?.direction) {
14253
+ return this.smartComponentLayout?.direction === LayoutDirection.HORIZONTAL
14254
+ ? SmartFormWidgetDirection.ROW
14255
+ : SmartFormWidgetDirection.COL;
14256
+ }
14257
+ return SmartFormWidgetDirection.COL;
14255
14258
  }
14256
- optionSelected(option) {
14257
- let oldOption = this.componentRefForm.instance.smartForm.componentModel.data.expressionData
14258
- .currentOperation;
14259
- this.componentRefForm.instance.smartForm.componentModel.data.expressionData.currentOperation =
14260
- option;
14261
- this.operation = option;
14262
- this.currentOperation = this.getOptionLabel(this.operation);
14263
- if (oldOption !== FilterExpressionOperation.BETWEEN &&
14264
- option === FilterExpressionOperation.BETWEEN) {
14265
- this.submit();
14266
- let label = this.filterExpressionField.label2;
14267
- this.filterExpressionField.label2 = `${label} - tól`;
14268
- this.filterExpressionField.label3 = `${label} - ig`;
14269
- this.filterExpressionField.expressionData.operand3 = {
14270
- isDataName: this.filterExpressionField.expressionData.operand2?.isDataName,
14271
- type: this.filterExpressionField.expressionData.operand3?.type,
14272
- valueAsString: this.filterExpressionField.expressionData.operand3?.valueAsString,
14273
- selectedValues: this.filterExpressionField.expressionData.operand3?.selectedValues,
14274
- };
14275
- this.constructForm();
14259
+ setFormComponent(comp) {
14260
+ if (!this.smartFormComponent) {
14261
+ this.smartFormComponent = comp;
14262
+ this.bindForm();
14276
14263
  }
14277
- else if (oldOption === FilterExpressionOperation.BETWEEN &&
14278
- option !== FilterExpressionOperation.BETWEEN) {
14279
- let label = this.filterExpressionField.label2.replace(' - tól', '');
14280
- this.filterExpressionField.label2 = `${label}`;
14281
- this.filterExpressionField.label3 = undefined;
14282
- this.filterExpressionField.expressionData.operand3 = undefined;
14283
- this.constructForm();
14264
+ }
14265
+ bindForm() {
14266
+ if (this.parentSmartComponent?.useQueryLists) {
14267
+ return;
14268
+ }
14269
+ if (this.smartForm && this.smartFormComponent) {
14270
+ this.parentSmartComponent?.addForm(
14271
+ // unique identifier for the form
14272
+ `form_${this.makeid(5)}`, this.smartForm, this.smartFormComponent);
14273
+ }
14274
+ }
14275
+ makeid(length) {
14276
+ let result = '';
14277
+ const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
14278
+ const charactersLength = characters.length;
14279
+ let counter = 0;
14280
+ while (counter < length) {
14281
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
14282
+ counter += 1;
14283
+ }
14284
+ return result;
14285
+ }
14286
+ constructGrid() {
14287
+ this.smartGrid = {
14288
+ gridIdentifier: this.smartComponentLayout?.widget?.identifier,
14289
+ gridModel: {
14290
+ page: {},
14291
+ },
14292
+ options: {
14293
+ rowUiActionType: GridUiActionType.POPUP_MENU,
14294
+ },
14295
+ layoutDef: SmartLayoutDef.TABLE,
14296
+ paginator: true,
14297
+ };
14298
+ this.bindGrid();
14299
+ }
14300
+ setGridComponent(comp) {
14301
+ if (!this.smartGridComponent) {
14302
+ this.smartGridComponent = comp;
14303
+ this.bindGrid();
14304
+ }
14305
+ }
14306
+ bindGrid() {
14307
+ if (this.parentSmartComponent?.useQueryLists) {
14308
+ return;
14309
+ }
14310
+ if (this.smartGrid && this.smartGridComponent) {
14311
+ this.smartGrid = this.parentSmartComponent?.addGrid(this.smartGrid, {
14312
+ rowUiActionType: GridUiActionType.POPUP_MENU,
14313
+ }, false, this.smartGridComponent);
14284
14314
  }
14285
14315
  }
14286
- getOptionLabel(option) {
14287
- if (!option) {
14288
- return '';
14316
+ setToolbarComponent(comp) {
14317
+ this.toolbar = comp;
14318
+ }
14319
+ // NOT USED, DOESN'T WORK
14320
+ // constructFilter(): void {
14321
+ // this.smartFilter = (this.smartComponentLayout!.parentComponent as any).addFilter(
14322
+ // `filter_${this.makeid(5)}`,
14323
+ // this.smartComponentLayout?.widget?.filterExpressionFieldList,
14324
+ // this.smartComponentLayout?.widget?.filterType,
14325
+ // this.smartFilterComponent
14326
+ // );
14327
+ // }
14328
+ bindFilter() {
14329
+ // TODO
14330
+ }
14331
+ constructTree() {
14332
+ if (this.parentSmartComponent?.useQueryLists) {
14333
+ return;
14289
14334
  }
14290
- else if (this.operationTranslator) {
14291
- return this.operationTranslator(option);
14335
+ this.parentSmartComponent.setUpDefaultTree(this.smartComponentLayout?.widget?.identifier);
14336
+ this.treeService?.initialize();
14337
+ }
14338
+ constructToolbar() {
14339
+ let toolbarId = this.smartComponentLayout?.widget?.identifier;
14340
+ if (this.toolbarId !== toolbarId) {
14341
+ this.toolbarId = toolbarId;
14292
14342
  }
14293
- return option;
14294
14343
  }
14295
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterSimpleFieldComponent, deps: [{ token: SmartFilterService }, { token: ComponentFactoryService }], target: i0.ɵɵFactoryTarget.Component }); }
14296
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", 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-mdc-icon-button{height:24px;width:24px}.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-unelevated-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-outlined-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-raised-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-icon-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-fab .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-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"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i5$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i2$3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] }); }
14344
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutComponent, deps: [{ token: SmartformLayoutDefinitionService }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
14345
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: { smartComponentLayout: "smartComponentLayout", parentLayoutComponent: "parentLayoutComponent", parentSmartComponent: "parentSmartComponent" }, 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: "expandableComponents", predicate: ExpandableSectionComponent, 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 [parentSmartComponent]=\"parentSmartComponent\"\r\n [parentLayoutComponent]=\"this\"\r\n [smartComponentLayout]=\"layout\"\r\n ></smart-component-layout>\r\n </div>\r\n <smartform *ngIf=\"smartForm\" #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid *ngIf=\"smartGrid\" #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 *ngIf=\"!!toolbarId\" #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"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SmartGridComponent, selector: "smart-grid", inputs: ["smartGrid", "uuid", "dev"] }, { kind: "component", type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }, { kind: "component", type: SmartTreeComponent, selector: "smart-tree", inputs: ["treeStyle", "treeService"] }, { kind: "component", type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id"] }, { kind: "component", type: SmartformComponent, selector: "smartform", inputs: ["smartForm"] }, { kind: "component", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: ["smartComponentLayout", "parentLayoutComponent", "parentSmartComponent"] }] }); }
14297
14346
  }
14298
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterSimpleFieldComponent, decorators: [{
14347
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutComponent, decorators: [{
14299
14348
  type: Component,
14300
- 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-mdc-icon-button{height:24px;width:24px}.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-unelevated-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-outlined-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-raised-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-icon-button .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-fab .mat-button-wrapper>*,.smart-filter-simple-field-form-widget ::ng-deep .mat-mdc-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"] }]
14301
- }], ctorParameters: () => [{ type: SmartFilterService }, { type: ComponentFactoryService }], propDecorators: { simpleFieldChildren: [{
14302
- type: ViewChildren,
14303
- args: ['simpleField']
14304
- }], operationTranslator: [{
14349
+ 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 [parentSmartComponent]=\"parentSmartComponent\"\r\n [parentLayoutComponent]=\"this\"\r\n [smartComponentLayout]=\"layout\"\r\n ></smart-component-layout>\r\n </div>\r\n <smartform *ngIf=\"smartForm\" #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid *ngIf=\"smartGrid\" #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 *ngIf=\"!!toolbarId\" #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"] }]
14350
+ }], ctorParameters: () => [{ type: SmartformLayoutDefinitionService }, { type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { smartComponentLayout: [{
14305
14351
  type: Input
14306
- }], filterExpressionField: [{
14352
+ }], parentLayoutComponent: [{
14307
14353
  type: Input
14308
- }], showPossibleActions: [{
14354
+ }], parentSmartComponent: [{
14309
14355
  type: Input
14310
- }], vcRefForm: [{
14311
- type: ViewChild,
14312
- args: ['form', { read: ViewContainerRef }]
14356
+ }], smartFormList: [{
14357
+ type: ViewChildren,
14358
+ args: ['form']
14359
+ }], smartGridList: [{
14360
+ type: ViewChildren,
14361
+ args: ['grid']
14362
+ }], smartFilterList: [{
14363
+ type: ViewChildren,
14364
+ args: ['filter']
14365
+ }], toolbarList: [{
14366
+ type: ViewChildren,
14367
+ args: ['toolbar']
14368
+ }], expandableComponents: [{
14369
+ type: ViewChildren,
14370
+ args: [ExpandableSectionComponent]
14371
+ }], components: [{
14372
+ type: ViewChildren,
14373
+ args: [SmartComponentLayoutComponent]
14313
14374
  }] } });
14314
14375
 
14315
- class SmartFilterSimpleComponent {
14316
- constructor(service) {
14317
- this.service = service;
14318
- this._destroy$ = new Subject();
14319
- this.service.reSubscribeToSubmit.pipe(takeUntil(this._destroy$)).subscribe(() => {
14320
- this.subscribeToSubmit();
14321
- });
14322
- this.subscribeToSubmit();
14323
- }
14324
- ngOnInit() {
14325
- this.smartFilter = this.service.filter;
14326
- }
14327
- ngOnDestroy() {
14328
- this._destroy$.next();
14329
- this._destroy$.complete();
14330
- }
14331
- subscribeToSubmit() {
14332
- this.service.shouldSubmit.pipe(takeUntil(this._destroy$)).subscribe(() => {
14333
- this.submit();
14334
- });
14335
- }
14336
- submit() {
14337
- this.simpleFieldChildren.forEach((smartFilterFieldComponent, index) => {
14338
- this.smartFilter.data[index] = smartFilterFieldComponent.submit();
14376
+ class SmartComponentLayoutModule {
14377
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
14378
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutModule, declarations: [SmartComponentLayoutComponent], imports: [BrowserModule,
14379
+ MatCommonModule,
14380
+ SmartGridModule,
14381
+ SmartExpandableSectionModule,
14382
+ SmarttreeModule,
14383
+ SmartViewContextModule], exports: [SmartComponentLayoutComponent] }); }
14384
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutModule, imports: [BrowserModule,
14385
+ MatCommonModule,
14386
+ SmartGridModule,
14387
+ SmartExpandableSectionModule,
14388
+ SmarttreeModule,
14389
+ SmartViewContextModule] }); }
14390
+ }
14391
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutModule, decorators: [{
14392
+ type: NgModule,
14393
+ args: [{
14394
+ declarations: [SmartComponentLayoutComponent],
14395
+ imports: [
14396
+ BrowserModule,
14397
+ MatCommonModule,
14398
+ SmartGridModule,
14399
+ SmartExpandableSectionModule,
14400
+ SmarttreeModule,
14401
+ SmartViewContextModule,
14402
+ ],
14403
+ exports: [SmartComponentLayoutComponent],
14404
+ providers: [],
14405
+ }]
14406
+ }] });
14407
+
14408
+ class SmartFilterParamComponent {
14409
+ constructor() { }
14410
+ onItemClick(item) {
14411
+ this.data.serviceToUse.peformWidgetAction({
14412
+ code: 'ADD_FILTER_EXPRESSION',
14413
+ params: {
14414
+ model: item,
14415
+ },
14339
14416
  });
14340
- this.service.filter = this.smartFilter;
14341
- this.service.shouldSubmit.complete();
14342
14417
  }
14343
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterSimpleComponent, deps: [{ token: SmartFilterService }], target: i0.ɵɵFactoryTarget.Component }); }
14344
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", 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"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SmartFilterSimpleFieldComponent, selector: "smart-filter-simple-field", inputs: ["operationTranslator", "filterExpressionField", "showPossibleActions"] }] }); }
14418
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterParamComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
14419
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", 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"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }] }); }
14345
14420
  }
14346
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterSimpleComponent, decorators: [{
14421
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterParamComponent, decorators: [{
14347
14422
  type: Component,
14348
- 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"] }]
14349
- }], ctorParameters: () => [{ type: SmartFilterService }], propDecorators: { simpleFieldChildren: [{
14350
- type: ViewChildren,
14351
- args: ["simpleField"]
14423
+ 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"] }]
14424
+ }], ctorParameters: () => [], propDecorators: { data: [{
14425
+ type: Input
14352
14426
  }] } });
14353
14427
 
14354
- class SmartFilterComponent {
14355
- constructor(service) {
14356
- this.service = service;
14428
+ class SmartFilterParamsComponent {
14429
+ constructor() {
14430
+ this._destroy$ = new Subject();
14431
+ this.expandableSections = [];
14357
14432
  }
14358
14433
  ngOnInit() {
14359
- if (this.filter) {
14360
- this.setUp();
14361
- }
14434
+ this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
14435
+ this.setUp(this.service.model);
14436
+ });
14437
+ this.setUp(this.service.model);
14362
14438
  }
14363
- ngOnChanges(changes) {
14364
- if (changes['filter'].currentValue) {
14365
- this.setUp();
14366
- }
14439
+ ngOnDestroy() {
14440
+ this._destroy$.next();
14441
+ this._destroy$.complete();
14367
14442
  }
14368
- setUp() {
14369
- this.service.filter = this.filter;
14443
+ setUp(model) {
14444
+ if (model?.model) {
14445
+ this.filterBuilder = model.model;
14446
+ this.constructExpandableSections();
14447
+ }
14370
14448
  }
14371
- async submit() {
14372
- return await this.service.submit();
14449
+ constructExpandableSections() {
14450
+ if (this.filterBuilder.groups) {
14451
+ this.expandableSections = this.filterBuilder.groups.map((filterExpressionBuilderGroup) => {
14452
+ return {
14453
+ title: filterExpressionBuilderGroup.label,
14454
+ cssClass: 'filterExpressionBuilderGroup',
14455
+ customComponent: SmartFilterParamComponent,
14456
+ data: {
14457
+ group: filterExpressionBuilderGroup.fields,
14458
+ serviceToUse: this.service,
14459
+ },
14460
+ inputName: 'data',
14461
+ isExpanded: true,
14462
+ };
14463
+ });
14464
+ }
14373
14465
  }
14374
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterComponent, deps: [{ token: SmartFilterService }], target: i0.ɵɵFactoryTarget.Component }); }
14375
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", 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: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SmartFilterSimpleComponent, selector: "smart-filter-simple" }] }); }
14466
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterParamsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
14467
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", 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"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }] }); }
14376
14468
  }
14377
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterComponent, decorators: [{
14469
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterParamsComponent, decorators: [{
14378
14470
  type: Component,
14379
- args: [{ selector: 'smart-filter', providers: [SmartFilterService], template: "<smart-filter-simple *ngIf=\"filter\" #simpleFilter></smart-filter-simple>\r\n" }]
14380
- }], ctorParameters: () => [{ type: SmartFilterService }], propDecorators: { filter: [{
14471
+ 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"] }]
14472
+ }], ctorParameters: () => [], propDecorators: { service: [{
14381
14473
  type: Input
14474
+ }], filterVcRef: [{
14475
+ type: ViewChild,
14476
+ args: ['smartFilter', { read: ViewContainerRef }]
14382
14477
  }] } });
14383
14478
 
14384
- class SmartFilterExpressionFieldComponent {
14385
- constructor() { }
14386
- ngOnInit() {
14387
- }
14388
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterExpressionFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
14389
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: SmartFilterExpressionFieldComponent, selector: "lib-smart-filter-expression-field", ngImport: i0, template: "", styles: [""] }); }
14390
- }
14391
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterExpressionFieldComponent, decorators: [{
14392
- type: Component,
14393
- args: [{ selector: 'lib-smart-filter-expression-field', template: "" }]
14394
- }], ctorParameters: () => [] });
14395
-
14396
- class SmartFilterModule {
14397
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
14398
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterModule, declarations: [SmartFilterComponent,
14399
- SmartFilterExpressionFieldComponent,
14400
- SmartFilterSimpleComponent,
14401
- SmartFilterSimpleFieldComponent], imports: [BrowserModule, SmartViewContextModule, MatMenuModule, MatIconModule, MatButtonModule], exports: [SmartFilterComponent] }); }
14402
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterModule, imports: [BrowserModule, SmartViewContextModule, MatMenuModule, MatIconModule, MatButtonModule] }); }
14403
- }
14404
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterModule, decorators: [{
14405
- type: NgModule,
14406
- args: [{
14407
- declarations: [
14408
- SmartFilterComponent,
14409
- SmartFilterExpressionFieldComponent,
14410
- SmartFilterSimpleComponent,
14411
- SmartFilterSimpleFieldComponent,
14412
- ],
14413
- imports: [BrowserModule, SmartViewContextModule, MatMenuModule, MatIconModule, MatButtonModule],
14414
- exports: [SmartFilterComponent],
14415
- }]
14416
- }] });
14417
-
14418
- var SmartFilterPosition;
14419
- (function (SmartFilterPosition) {
14420
- SmartFilterPosition[SmartFilterPosition["TOP"] = 0] = "TOP";
14421
- SmartFilterPosition[SmartFilterPosition["BOTTOM"] = 1] = "BOTTOM";
14422
- SmartFilterPosition[SmartFilterPosition["LEFT"] = 2] = "LEFT";
14423
- SmartFilterPosition[SmartFilterPosition["RIGHT"] = 3] = "RIGHT";
14424
- })(SmartFilterPosition || (SmartFilterPosition = {}));
14425
- var SmartFilterType;
14426
- (function (SmartFilterType) {
14427
- SmartFilterType[SmartFilterType["SIMPLE"] = 0] = "SIMPLE";
14428
- SmartFilterType[SmartFilterType["ADVANCED"] = 1] = "ADVANCED";
14429
- })(SmartFilterType || (SmartFilterType = {}));
14430
-
14431
- /*
14432
- * Public API Surface of smart-filter
14433
- */
14434
-
14435
14479
  var FilterExpressionBuilderUiModelTypeEnum;
14436
14480
  (function (FilterExpressionBuilderUiModelTypeEnum) {
14437
14481
  FilterExpressionBuilderUiModelTypeEnum["SIMPLE"] = "SIMPLE";