@smartbit4all/ng-client 4.0.28 → 4.0.30
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.
- package/esm2022/lib/smart-grid/smart-grid.component.mjs +48 -4
- package/fesm2022/smartbit4all-ng-client.mjs +1771 -1728
- package/fesm2022/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-grid/smart-grid.component.d.ts +7 -3
- package/package.json +1 -1
- package/smartbit4all-ng-client-4.0.30.tgz +0 -0
- package/smartbit4all-ng-client-4.0.28.tgz +0 -0
|
@@ -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
|
|
11171
|
+
this.columns.push(colum);
|
|
10736
11172
|
}
|
|
10737
11173
|
});
|
|
10738
11174
|
});
|
|
@@ -11315,12 +11751,55 @@ 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
|
+
if (meta.field === order.field && order.order != meta.order) {
|
|
11760
|
+
switch (order.order) {
|
|
11761
|
+
case -1:
|
|
11762
|
+
event.multiSortMeta.splice(index, 1);
|
|
11763
|
+
break;
|
|
11764
|
+
}
|
|
11765
|
+
}
|
|
11766
|
+
});
|
|
11767
|
+
}
|
|
11768
|
+
else {
|
|
11769
|
+
this.previousmultiSortMeta = event.multiSortMeta;
|
|
11770
|
+
}
|
|
11771
|
+
});
|
|
11772
|
+
event.multiSortMeta?.map((meta) => {
|
|
11773
|
+
orderByList.push({
|
|
11774
|
+
propertyName: meta.field,
|
|
11775
|
+
order: meta.order === 1
|
|
11776
|
+
? FilterExpressionOrderByOrderEnum.ASC
|
|
11777
|
+
: meta.order === -1
|
|
11778
|
+
? FilterExpressionOrderByOrderEnum.DESC
|
|
11779
|
+
: undefined,
|
|
11780
|
+
});
|
|
11781
|
+
});
|
|
11782
|
+
this.service.sort(this.smartGrid, {
|
|
11783
|
+
orderByList: orderByList,
|
|
11784
|
+
orderedColumnNames: this.smartGrid?.gridModel.view?.orderedColumnNames,
|
|
11785
|
+
});
|
|
11786
|
+
}
|
|
11787
|
+
lazyLoad(event) {
|
|
11788
|
+
this.previousmultiSortMeta = [];
|
|
11789
|
+
this.smartGrid?.gridModel.view?.orderByList.map((order) => {
|
|
11790
|
+
this.previousmultiSortMeta?.push({
|
|
11791
|
+
field: order.propertyName,
|
|
11792
|
+
order: order.order === FilterExpressionOrderByOrderEnum.ASC ? 1 : -1,
|
|
11793
|
+
});
|
|
11794
|
+
});
|
|
11795
|
+
event.multiSortMeta = this.previousmultiSortMeta;
|
|
11796
|
+
}
|
|
11318
11797
|
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 *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: "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"] }] }); }
|
|
11798
|
+
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
11799
|
}
|
|
11321
11800
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartGridComponent, decorators: [{
|
|
11322
11801
|
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
|
|
11802
|
+
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
11803
|
}], ctorParameters: () => [{ type: SmartGridService }, { type: ComponentFactoryService }, { type: i1$1.MatDialog }, { type: UiActionDescriptorService }, { type: ComponentLibrary, decorators: [{
|
|
11325
11804
|
type: Inject,
|
|
11326
11805
|
args: [COMPONENT_LIBRARY]
|
|
@@ -12196,214 +12675,10 @@ class TreeService {
|
|
|
12196
12675
|
}
|
|
12197
12676
|
getRootNodes(viewUuid, treeId, observe = 'body', reportProgress = false, options) {
|
|
12198
12677
|
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.');
|
|
12678
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling getRootNodes.');
|
|
12398
12679
|
}
|
|
12399
12680
|
if (treeId === null || treeId === undefined) {
|
|
12400
|
-
throw new Error('Required parameter treeId was null or undefined when calling
|
|
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.');
|
|
12681
|
+
throw new Error('Required parameter treeId was null or undefined when calling getRootNodes.');
|
|
12407
12682
|
}
|
|
12408
12683
|
let localVarHeaders = this.defaultHeaders;
|
|
12409
12684
|
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
@@ -12419,12 +12694,6 @@ class TreeService {
|
|
|
12419
12694
|
if (localVarHttpContext === undefined) {
|
|
12420
12695
|
localVarHttpContext = new HttpContext();
|
|
12421
12696
|
}
|
|
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
12697
|
let responseType_ = 'json';
|
|
12429
12698
|
if (localVarHttpHeaderAcceptSelected) {
|
|
12430
12699
|
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
@@ -12437,7 +12706,7 @@ class TreeService {
|
|
|
12437
12706
|
responseType_ = 'blob';
|
|
12438
12707
|
}
|
|
12439
12708
|
}
|
|
12440
|
-
let localVarPath = `/
|
|
12709
|
+
let localVarPath = `/tree/${this.configuration.encodeParam({
|
|
12441
12710
|
name: 'viewUuid',
|
|
12442
12711
|
value: viewUuid,
|
|
12443
12712
|
in: 'path',
|
|
@@ -12453,18 +12722,9 @@ class TreeService {
|
|
|
12453
12722
|
explode: false,
|
|
12454
12723
|
dataType: 'string',
|
|
12455
12724
|
dataFormat: undefined,
|
|
12456
|
-
})}
|
|
12457
|
-
|
|
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}`, {
|
|
12725
|
+
})}`;
|
|
12726
|
+
return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
|
|
12466
12727
|
context: localVarHttpContext,
|
|
12467
|
-
body: body,
|
|
12468
12728
|
responseType: responseType_,
|
|
12469
12729
|
withCredentials: this.configuration.withCredentials,
|
|
12470
12730
|
headers: localVarHeaders,
|
|
@@ -12472,15 +12732,12 @@ class TreeService {
|
|
|
12472
12732
|
reportProgress: reportProgress,
|
|
12473
12733
|
});
|
|
12474
12734
|
}
|
|
12475
|
-
|
|
12735
|
+
getRootNodes2(viewUuid, treeId, observe = 'body', reportProgress = false, options) {
|
|
12476
12736
|
if (viewUuid === null || viewUuid === undefined) {
|
|
12477
|
-
throw new Error('Required parameter viewUuid was null or undefined when calling
|
|
12737
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling getRootNodes2.');
|
|
12478
12738
|
}
|
|
12479
12739
|
if (treeId === null || treeId === undefined) {
|
|
12480
|
-
throw new Error('Required parameter treeId was null or undefined when calling
|
|
12481
|
-
}
|
|
12482
|
-
if (body === null || body === undefined) {
|
|
12483
|
-
throw new Error('Required parameter body was null or undefined when calling performMainAction.');
|
|
12740
|
+
throw new Error('Required parameter treeId was null or undefined when calling getRootNodes2.');
|
|
12484
12741
|
}
|
|
12485
12742
|
let localVarHeaders = this.defaultHeaders;
|
|
12486
12743
|
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
@@ -12496,12 +12753,6 @@ class TreeService {
|
|
|
12496
12753
|
if (localVarHttpContext === undefined) {
|
|
12497
12754
|
localVarHttpContext = new HttpContext();
|
|
12498
12755
|
}
|
|
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
12756
|
let responseType_ = 'json';
|
|
12506
12757
|
if (localVarHttpHeaderAcceptSelected) {
|
|
12507
12758
|
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
@@ -12514,7 +12765,7 @@ class TreeService {
|
|
|
12514
12765
|
responseType_ = 'blob';
|
|
12515
12766
|
}
|
|
12516
12767
|
}
|
|
12517
|
-
let localVarPath = `/
|
|
12768
|
+
let localVarPath = `/tree2/${this.configuration.encodeParam({
|
|
12518
12769
|
name: 'viewUuid',
|
|
12519
12770
|
value: viewUuid,
|
|
12520
12771
|
in: 'path',
|
|
@@ -12530,10 +12781,9 @@ class TreeService {
|
|
|
12530
12781
|
explode: false,
|
|
12531
12782
|
dataType: 'string',
|
|
12532
12783
|
dataFormat: undefined,
|
|
12533
|
-
})}
|
|
12534
|
-
return this.httpClient.request('
|
|
12784
|
+
})}`;
|
|
12785
|
+
return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
|
|
12535
12786
|
context: localVarHttpContext,
|
|
12536
|
-
body: body,
|
|
12537
12787
|
responseType: responseType_,
|
|
12538
12788
|
withCredentials: this.configuration.withCredentials,
|
|
12539
12789
|
headers: localVarHeaders,
|
|
@@ -12541,15 +12791,18 @@ class TreeService {
|
|
|
12541
12791
|
reportProgress: reportProgress,
|
|
12542
12792
|
});
|
|
12543
12793
|
}
|
|
12544
|
-
|
|
12794
|
+
performAction(viewUuid, treeId, nodeId, body, observe = 'body', reportProgress = false, options) {
|
|
12545
12795
|
if (viewUuid === null || viewUuid === undefined) {
|
|
12546
|
-
throw new Error('Required parameter viewUuid was null or undefined when calling
|
|
12796
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling performAction.');
|
|
12547
12797
|
}
|
|
12548
12798
|
if (treeId === null || treeId === undefined) {
|
|
12549
|
-
throw new Error('Required parameter treeId was null or undefined when calling
|
|
12799
|
+
throw new Error('Required parameter treeId was null or undefined when calling performAction.');
|
|
12800
|
+
}
|
|
12801
|
+
if (nodeId === null || nodeId === undefined) {
|
|
12802
|
+
throw new Error('Required parameter nodeId was null or undefined when calling performAction.');
|
|
12550
12803
|
}
|
|
12551
12804
|
if (body === null || body === undefined) {
|
|
12552
|
-
throw new Error('Required parameter body was null or undefined when calling
|
|
12805
|
+
throw new Error('Required parameter body was null or undefined when calling performAction.');
|
|
12553
12806
|
}
|
|
12554
12807
|
let localVarHeaders = this.defaultHeaders;
|
|
12555
12808
|
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
@@ -12583,7 +12836,7 @@ class TreeService {
|
|
|
12583
12836
|
responseType_ = 'blob';
|
|
12584
12837
|
}
|
|
12585
12838
|
}
|
|
12586
|
-
let localVarPath = `/
|
|
12839
|
+
let localVarPath = `/tree/${this.configuration.encodeParam({
|
|
12587
12840
|
name: 'viewUuid',
|
|
12588
12841
|
value: viewUuid,
|
|
12589
12842
|
in: 'path',
|
|
@@ -12599,6 +12852,14 @@ class TreeService {
|
|
|
12599
12852
|
explode: false,
|
|
12600
12853
|
dataType: 'string',
|
|
12601
12854
|
dataFormat: undefined,
|
|
12855
|
+
})}/${this.configuration.encodeParam({
|
|
12856
|
+
name: 'nodeId',
|
|
12857
|
+
value: nodeId,
|
|
12858
|
+
in: 'path',
|
|
12859
|
+
style: 'simple',
|
|
12860
|
+
explode: false,
|
|
12861
|
+
dataType: 'string',
|
|
12862
|
+
dataFormat: undefined,
|
|
12602
12863
|
})}/action`;
|
|
12603
12864
|
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
12604
12865
|
context: localVarHttpContext,
|
|
@@ -12610,15 +12871,18 @@ class TreeService {
|
|
|
12610
12871
|
reportProgress: reportProgress,
|
|
12611
12872
|
});
|
|
12612
12873
|
}
|
|
12613
|
-
|
|
12874
|
+
performAction2(viewUuid, treeId, nodeId, body, observe = 'body', reportProgress = false, options) {
|
|
12614
12875
|
if (viewUuid === null || viewUuid === undefined) {
|
|
12615
|
-
throw new Error('Required parameter viewUuid was null or undefined when calling
|
|
12876
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling performAction2.');
|
|
12616
12877
|
}
|
|
12617
12878
|
if (treeId === null || treeId === undefined) {
|
|
12618
|
-
throw new Error('Required parameter treeId was null or undefined when calling
|
|
12879
|
+
throw new Error('Required parameter treeId was null or undefined when calling performAction2.');
|
|
12619
12880
|
}
|
|
12620
12881
|
if (nodeId === null || nodeId === undefined) {
|
|
12621
|
-
throw new Error('Required parameter nodeId was null or undefined when calling
|
|
12882
|
+
throw new Error('Required parameter nodeId was null or undefined when calling performAction2.');
|
|
12883
|
+
}
|
|
12884
|
+
if (body === null || body === undefined) {
|
|
12885
|
+
throw new Error('Required parameter body was null or undefined when calling performAction2.');
|
|
12622
12886
|
}
|
|
12623
12887
|
let localVarHeaders = this.defaultHeaders;
|
|
12624
12888
|
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
@@ -12634,6 +12898,12 @@ class TreeService {
|
|
|
12634
12898
|
if (localVarHttpContext === undefined) {
|
|
12635
12899
|
localVarHttpContext = new HttpContext();
|
|
12636
12900
|
}
|
|
12901
|
+
// to determine the Content-Type header
|
|
12902
|
+
const consumes = ['application/json'];
|
|
12903
|
+
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
12904
|
+
if (httpContentTypeSelected !== undefined) {
|
|
12905
|
+
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
12906
|
+
}
|
|
12637
12907
|
let responseType_ = 'json';
|
|
12638
12908
|
if (localVarHttpHeaderAcceptSelected) {
|
|
12639
12909
|
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
@@ -12646,7 +12916,7 @@ class TreeService {
|
|
|
12646
12916
|
responseType_ = 'blob';
|
|
12647
12917
|
}
|
|
12648
12918
|
}
|
|
12649
|
-
let localVarPath = `/
|
|
12919
|
+
let localVarPath = `/tree2/${this.configuration.encodeParam({
|
|
12650
12920
|
name: 'viewUuid',
|
|
12651
12921
|
value: viewUuid,
|
|
12652
12922
|
in: 'path',
|
|
@@ -12670,9 +12940,10 @@ class TreeService {
|
|
|
12670
12940
|
explode: false,
|
|
12671
12941
|
dataType: 'string',
|
|
12672
12942
|
dataFormat: undefined,
|
|
12673
|
-
})}/
|
|
12943
|
+
})}/action`;
|
|
12674
12944
|
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
12675
12945
|
context: localVarHttpContext,
|
|
12946
|
+
body: body,
|
|
12676
12947
|
responseType: responseType_,
|
|
12677
12948
|
withCredentials: this.configuration.withCredentials,
|
|
12678
12949
|
headers: localVarHeaders,
|
|
@@ -12680,15 +12951,15 @@ class TreeService {
|
|
|
12680
12951
|
reportProgress: reportProgress,
|
|
12681
12952
|
});
|
|
12682
12953
|
}
|
|
12683
|
-
|
|
12954
|
+
performMainAction(viewUuid, treeId, body, observe = 'body', reportProgress = false, options) {
|
|
12684
12955
|
if (viewUuid === null || viewUuid === undefined) {
|
|
12685
|
-
throw new Error('Required parameter viewUuid was null or undefined when calling
|
|
12956
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling performMainAction.');
|
|
12686
12957
|
}
|
|
12687
12958
|
if (treeId === null || treeId === undefined) {
|
|
12688
|
-
throw new Error('Required parameter treeId was null or undefined when calling
|
|
12959
|
+
throw new Error('Required parameter treeId was null or undefined when calling performMainAction.');
|
|
12689
12960
|
}
|
|
12690
|
-
if (
|
|
12691
|
-
throw new Error('Required parameter
|
|
12961
|
+
if (body === null || body === undefined) {
|
|
12962
|
+
throw new Error('Required parameter body was null or undefined when calling performMainAction.');
|
|
12692
12963
|
}
|
|
12693
12964
|
let localVarHeaders = this.defaultHeaders;
|
|
12694
12965
|
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
@@ -12704,6 +12975,12 @@ class TreeService {
|
|
|
12704
12975
|
if (localVarHttpContext === undefined) {
|
|
12705
12976
|
localVarHttpContext = new HttpContext();
|
|
12706
12977
|
}
|
|
12978
|
+
// to determine the Content-Type header
|
|
12979
|
+
const consumes = ['application/json'];
|
|
12980
|
+
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
12981
|
+
if (httpContentTypeSelected !== undefined) {
|
|
12982
|
+
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
12983
|
+
}
|
|
12707
12984
|
let responseType_ = 'json';
|
|
12708
12985
|
if (localVarHttpHeaderAcceptSelected) {
|
|
12709
12986
|
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
@@ -12716,7 +12993,7 @@ class TreeService {
|
|
|
12716
12993
|
responseType_ = 'blob';
|
|
12717
12994
|
}
|
|
12718
12995
|
}
|
|
12719
|
-
let localVarPath = `/
|
|
12996
|
+
let localVarPath = `/tree/${this.configuration.encodeParam({
|
|
12720
12997
|
name: 'viewUuid',
|
|
12721
12998
|
value: viewUuid,
|
|
12722
12999
|
in: 'path',
|
|
@@ -12732,1338 +13009,909 @@ class TreeService {
|
|
|
12732
13009
|
explode: false,
|
|
12733
13010
|
dataType: 'string',
|
|
12734
13011
|
dataFormat: undefined,
|
|
12735
|
-
})}
|
|
12736
|
-
name: 'nodeId',
|
|
12737
|
-
value: nodeId,
|
|
12738
|
-
in: 'path',
|
|
12739
|
-
style: 'simple',
|
|
12740
|
-
explode: false,
|
|
12741
|
-
dataType: 'string',
|
|
12742
|
-
dataFormat: undefined,
|
|
12743
|
-
})}/select`;
|
|
13012
|
+
})}/action`;
|
|
12744
13013
|
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
12745
13014
|
context: localVarHttpContext,
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
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;
|
|
13015
|
+
body: body,
|
|
13016
|
+
responseType: responseType_,
|
|
13017
|
+
withCredentials: this.configuration.withCredentials,
|
|
13018
|
+
headers: localVarHeaders,
|
|
13019
|
+
observe: observe,
|
|
13020
|
+
reportProgress: reportProgress,
|
|
13021
|
+
});
|
|
12877
13022
|
}
|
|
12878
|
-
|
|
12879
|
-
|
|
12880
|
-
|
|
12881
|
-
if (!children) {
|
|
12882
|
-
throw new Error(`Node with identifier ${parentNode.identifier} does not have children.`);
|
|
13023
|
+
performMainAction2(viewUuid, treeId, body, observe = 'body', reportProgress = false, options) {
|
|
13024
|
+
if (viewUuid === null || viewUuid === undefined) {
|
|
13025
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling performMainAction2.');
|
|
12883
13026
|
}
|
|
12884
|
-
|
|
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;
|
|
13027
|
+
if (treeId === null || treeId === undefined) {
|
|
13028
|
+
throw new Error('Required parameter treeId was null or undefined when calling performMainAction2.');
|
|
12891
13029
|
}
|
|
12892
|
-
|
|
12893
|
-
|
|
12894
|
-
treeNode = tempTreeNode;
|
|
13030
|
+
if (body === null || body === undefined) {
|
|
13031
|
+
throw new Error('Required parameter body was null or undefined when calling performMainAction2.');
|
|
12895
13032
|
}
|
|
12896
|
-
let
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
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;
|
|
13033
|
+
let localVarHeaders = this.defaultHeaders;
|
|
13034
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
13035
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
13036
|
+
// to determine the Accept header
|
|
13037
|
+
const httpHeaderAccepts = ['application/json'];
|
|
13038
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
12909
13039
|
}
|
|
12910
|
-
|
|
12911
|
-
|
|
12912
|
-
if (!node) {
|
|
12913
|
-
throw Error('Tree node does not exist');
|
|
13040
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
13041
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
12914
13042
|
}
|
|
12915
|
-
|
|
12916
|
-
|
|
12917
|
-
|
|
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;
|
|
13043
|
+
let localVarHttpContext = options && options.context;
|
|
13044
|
+
if (localVarHttpContext === undefined) {
|
|
13045
|
+
localVarHttpContext = new HttpContext();
|
|
12930
13046
|
}
|
|
12931
|
-
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
|
|
12935
|
-
|
|
13047
|
+
// to determine the Content-Type header
|
|
13048
|
+
const consumes = ['application/json'];
|
|
13049
|
+
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
13050
|
+
if (httpContentTypeSelected !== undefined) {
|
|
13051
|
+
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
12936
13052
|
}
|
|
12937
|
-
let
|
|
12938
|
-
|
|
12939
|
-
|
|
12940
|
-
|
|
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;
|
|
13053
|
+
let responseType_ = 'json';
|
|
13054
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
13055
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
13056
|
+
responseType_ = 'text';
|
|
12954
13057
|
}
|
|
12955
|
-
if (
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
13058
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
13059
|
+
responseType_ = 'json';
|
|
13060
|
+
}
|
|
13061
|
+
else {
|
|
13062
|
+
responseType_ = 'blob';
|
|
12960
13063
|
}
|
|
12961
13064
|
}
|
|
12962
|
-
|
|
13065
|
+
let localVarPath = `/tree2/${this.configuration.encodeParam({
|
|
13066
|
+
name: 'viewUuid',
|
|
13067
|
+
value: viewUuid,
|
|
13068
|
+
in: 'path',
|
|
13069
|
+
style: 'simple',
|
|
13070
|
+
explode: false,
|
|
13071
|
+
dataType: 'string',
|
|
13072
|
+
dataFormat: 'uuid',
|
|
13073
|
+
})}/${this.configuration.encodeParam({
|
|
13074
|
+
name: 'treeId',
|
|
13075
|
+
value: treeId,
|
|
13076
|
+
in: 'path',
|
|
13077
|
+
style: 'simple',
|
|
13078
|
+
explode: false,
|
|
13079
|
+
dataType: 'string',
|
|
13080
|
+
dataFormat: undefined,
|
|
13081
|
+
})}/action`;
|
|
13082
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
13083
|
+
context: localVarHttpContext,
|
|
13084
|
+
body: body,
|
|
13085
|
+
responseType: responseType_,
|
|
13086
|
+
withCredentials: this.configuration.withCredentials,
|
|
13087
|
+
headers: localVarHeaders,
|
|
13088
|
+
observe: observe,
|
|
13089
|
+
reportProgress: reportProgress,
|
|
13090
|
+
});
|
|
12963
13091
|
}
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
|
|
12968
|
-
|
|
13092
|
+
selectNode(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
|
|
13093
|
+
if (viewUuid === null || viewUuid === undefined) {
|
|
13094
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling selectNode.');
|
|
13095
|
+
}
|
|
13096
|
+
if (treeId === null || treeId === undefined) {
|
|
13097
|
+
throw new Error('Required parameter treeId was null or undefined when calling selectNode.');
|
|
13098
|
+
}
|
|
13099
|
+
if (nodeId === null || nodeId === undefined) {
|
|
13100
|
+
throw new Error('Required parameter nodeId was null or undefined when calling selectNode.');
|
|
13101
|
+
}
|
|
13102
|
+
let localVarHeaders = this.defaultHeaders;
|
|
13103
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
13104
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
13105
|
+
// to determine the Accept header
|
|
13106
|
+
const httpHeaderAccepts = ['application/json'];
|
|
13107
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
13108
|
+
}
|
|
13109
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
13110
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
13111
|
+
}
|
|
13112
|
+
let localVarHttpContext = options && options.context;
|
|
13113
|
+
if (localVarHttpContext === undefined) {
|
|
13114
|
+
localVarHttpContext = new HttpContext();
|
|
13115
|
+
}
|
|
13116
|
+
let responseType_ = 'json';
|
|
13117
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
13118
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
13119
|
+
responseType_ = 'text';
|
|
12969
13120
|
}
|
|
12970
|
-
else if (
|
|
12971
|
-
|
|
13121
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
13122
|
+
responseType_ = 'json';
|
|
12972
13123
|
}
|
|
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);
|
|
13124
|
+
else {
|
|
13125
|
+
responseType_ = 'blob';
|
|
12995
13126
|
}
|
|
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
13127
|
}
|
|
13005
|
-
|
|
13006
|
-
|
|
13007
|
-
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
}
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13024
|
-
|
|
13025
|
-
|
|
13128
|
+
let localVarPath = `/tree/${this.configuration.encodeParam({
|
|
13129
|
+
name: 'viewUuid',
|
|
13130
|
+
value: viewUuid,
|
|
13131
|
+
in: 'path',
|
|
13132
|
+
style: 'simple',
|
|
13133
|
+
explode: false,
|
|
13134
|
+
dataType: 'string',
|
|
13135
|
+
dataFormat: 'uuid',
|
|
13136
|
+
})}/${this.configuration.encodeParam({
|
|
13137
|
+
name: 'treeId',
|
|
13138
|
+
value: treeId,
|
|
13139
|
+
in: 'path',
|
|
13140
|
+
style: 'simple',
|
|
13141
|
+
explode: false,
|
|
13142
|
+
dataType: 'string',
|
|
13143
|
+
dataFormat: undefined,
|
|
13144
|
+
})}/${this.configuration.encodeParam({
|
|
13145
|
+
name: 'nodeId',
|
|
13146
|
+
value: nodeId,
|
|
13147
|
+
in: 'path',
|
|
13148
|
+
style: 'simple',
|
|
13149
|
+
explode: false,
|
|
13150
|
+
dataType: 'string',
|
|
13151
|
+
dataFormat: undefined,
|
|
13152
|
+
})}/select`;
|
|
13153
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
13154
|
+
context: localVarHttpContext,
|
|
13155
|
+
responseType: responseType_,
|
|
13156
|
+
withCredentials: this.configuration.withCredentials,
|
|
13157
|
+
headers: localVarHeaders,
|
|
13158
|
+
observe: observe,
|
|
13159
|
+
reportProgress: reportProgress,
|
|
13026
13160
|
});
|
|
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
13161
|
}
|
|
13038
|
-
|
|
13039
|
-
|
|
13040
|
-
|
|
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
|
-
};
|
|
13162
|
+
selectNode2(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
|
|
13163
|
+
if (viewUuid === null || viewUuid === undefined) {
|
|
13164
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling selectNode2.');
|
|
13050
13165
|
}
|
|
13051
|
-
|
|
13052
|
-
|
|
13053
|
-
forTextField: '',
|
|
13054
|
-
};
|
|
13055
|
-
}
|
|
13056
|
-
getModel() {
|
|
13057
|
-
return {};
|
|
13058
|
-
}
|
|
13059
|
-
async performUiActionRequest(uiActionRequest) {
|
|
13060
|
-
if (uiActionRequest.params['nodeUuid']) {
|
|
13061
|
-
await this.performNodeUiActionRequest(uiActionRequest);
|
|
13166
|
+
if (treeId === null || treeId === undefined) {
|
|
13167
|
+
throw new Error('Required parameter treeId was null or undefined when calling selectNode2.');
|
|
13062
13168
|
}
|
|
13063
|
-
|
|
13064
|
-
|
|
13169
|
+
if (nodeId === null || nodeId === undefined) {
|
|
13170
|
+
throw new Error('Required parameter nodeId was null or undefined when calling selectNode2.');
|
|
13065
13171
|
}
|
|
13066
|
-
|
|
13067
|
-
|
|
13068
|
-
|
|
13069
|
-
|
|
13070
|
-
|
|
13071
|
-
|
|
13072
|
-
|
|
13073
|
-
|
|
13074
|
-
|
|
13075
|
-
|
|
13076
|
-
let
|
|
13077
|
-
|
|
13078
|
-
|
|
13079
|
-
|
|
13080
|
-
|
|
13172
|
+
let localVarHeaders = this.defaultHeaders;
|
|
13173
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
13174
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
13175
|
+
// to determine the Accept header
|
|
13176
|
+
const httpHeaderAccepts = ['application/json'];
|
|
13177
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
13178
|
+
}
|
|
13179
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
13180
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
13181
|
+
}
|
|
13182
|
+
let localVarHttpContext = options && options.context;
|
|
13183
|
+
if (localVarHttpContext === undefined) {
|
|
13184
|
+
localVarHttpContext = new HttpContext();
|
|
13185
|
+
}
|
|
13186
|
+
let responseType_ = 'json';
|
|
13187
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
13188
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
13189
|
+
responseType_ = 'text';
|
|
13190
|
+
}
|
|
13191
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
13192
|
+
responseType_ = 'json';
|
|
13193
|
+
}
|
|
13194
|
+
else {
|
|
13195
|
+
responseType_ = 'blob';
|
|
13196
|
+
}
|
|
13197
|
+
}
|
|
13198
|
+
let localVarPath = `/tree2/${this.configuration.encodeParam({
|
|
13199
|
+
name: 'viewUuid',
|
|
13200
|
+
value: viewUuid,
|
|
13201
|
+
in: 'path',
|
|
13202
|
+
style: 'simple',
|
|
13203
|
+
explode: false,
|
|
13204
|
+
dataType: 'string',
|
|
13205
|
+
dataFormat: 'uuid',
|
|
13206
|
+
})}/${this.configuration.encodeParam({
|
|
13207
|
+
name: 'treeId',
|
|
13208
|
+
value: treeId,
|
|
13209
|
+
in: 'path',
|
|
13210
|
+
style: 'simple',
|
|
13211
|
+
explode: false,
|
|
13212
|
+
dataType: 'string',
|
|
13213
|
+
dataFormat: undefined,
|
|
13214
|
+
})}/${this.configuration.encodeParam({
|
|
13215
|
+
name: 'nodeId',
|
|
13216
|
+
value: nodeId,
|
|
13217
|
+
in: 'path',
|
|
13218
|
+
style: 'simple',
|
|
13219
|
+
explode: false,
|
|
13220
|
+
dataType: 'string',
|
|
13221
|
+
dataFormat: undefined,
|
|
13222
|
+
})}/select`;
|
|
13223
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
13224
|
+
context: localVarHttpContext,
|
|
13225
|
+
responseType: responseType_,
|
|
13226
|
+
withCredentials: this.configuration.withCredentials,
|
|
13227
|
+
headers: localVarHeaders,
|
|
13228
|
+
observe: observe,
|
|
13229
|
+
reportProgress: reportProgress,
|
|
13230
|
+
});
|
|
13081
13231
|
}
|
|
13082
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
13083
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
13232
|
+
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 }); }
|
|
13233
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: TreeService, providedIn: 'root' }); }
|
|
13084
13234
|
}
|
|
13085
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
13235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: TreeService, decorators: [{
|
|
13086
13236
|
type: Injectable,
|
|
13087
13237
|
args: [{
|
|
13088
13238
|
providedIn: 'root',
|
|
13089
13239
|
}]
|
|
13090
|
-
}], ctorParameters: () => [{ type:
|
|
13091
|
-
type:
|
|
13092
|
-
|
|
13093
|
-
}] }, { type: undefined, decorators: [{
|
|
13094
|
-
type: Inject,
|
|
13095
|
-
args: ['treeId']
|
|
13096
|
-
}] }, { type: undefined, decorators: [{
|
|
13240
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
13241
|
+
type: Optional
|
|
13242
|
+
}, {
|
|
13097
13243
|
type: Inject,
|
|
13098
|
-
args: [
|
|
13244
|
+
args: [BASE_PATH$2]
|
|
13245
|
+
}] }, { type: Configuration$2, decorators: [{
|
|
13246
|
+
type: Optional
|
|
13099
13247
|
}] }] });
|
|
13100
13248
|
|
|
13101
|
-
|
|
13102
|
-
|
|
13103
|
-
|
|
13104
|
-
|
|
13105
|
-
|
|
13106
|
-
|
|
13107
|
-
|
|
13108
|
-
|
|
13109
|
-
|
|
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 {};
|
|
13249
|
+
var SmartTreeNodeButtonType;
|
|
13250
|
+
(function (SmartTreeNodeButtonType) {
|
|
13251
|
+
SmartTreeNodeButtonType["MENU"] = "MENU";
|
|
13252
|
+
SmartTreeNodeButtonType["ICON"] = "ICON";
|
|
13253
|
+
SmartTreeNodeButtonType["NORMAL"] = "NORMAL";
|
|
13254
|
+
})(SmartTreeNodeButtonType || (SmartTreeNodeButtonType = {}));
|
|
13255
|
+
|
|
13256
|
+
class SmarttreeService {
|
|
13257
|
+
get uiActionModels() {
|
|
13258
|
+
return this._uiActionModels;
|
|
13190
13259
|
}
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
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
|
-
}
|
|
13260
|
+
set uiActionModels(uiActionModels) {
|
|
13261
|
+
this._uiActionModels = uiActionModels;
|
|
13262
|
+
this.uiActionModelsChanged.next();
|
|
13206
13263
|
}
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
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;
|
|
13264
|
+
constructor() {
|
|
13265
|
+
this.errorMessage = 'The tree is currently unavailable';
|
|
13266
|
+
this.smartTreeModelChanged = new Subject();
|
|
13267
|
+
this.uiActionModelsChanged = new Subject();
|
|
13225
13268
|
}
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
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;
|
|
13269
|
+
async initialize() {
|
|
13270
|
+
await this.downloadTree().then((rootNodes) => {
|
|
13271
|
+
this.treeFromBackend = rootNodes;
|
|
13272
|
+
this.syncTree();
|
|
13273
|
+
});
|
|
13241
13274
|
}
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
classes.push(this.getCustomClass('group', node.level));
|
|
13245
|
-
return classes;
|
|
13275
|
+
async downloadTree() {
|
|
13276
|
+
throw new Error('downloadTree method not implemented.');
|
|
13246
13277
|
}
|
|
13247
|
-
|
|
13248
|
-
|
|
13278
|
+
async downloadChildren(parentNode) {
|
|
13279
|
+
throw new Error('downloadChildren method not implemented.');
|
|
13249
13280
|
}
|
|
13250
|
-
|
|
13251
|
-
|
|
13252
|
-
}
|
|
13253
|
-
|
|
13254
|
-
|
|
13255
|
-
|
|
13256
|
-
|
|
13257
|
-
|
|
13258
|
-
|
|
13259
|
-
|
|
13260
|
-
|
|
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] }); }
|
|
13281
|
+
onTreeNodeClick(treeNode) {
|
|
13282
|
+
throw new Error('onTreeNodeClick method not implemented.');
|
|
13283
|
+
}
|
|
13284
|
+
onTreeNodeOpen(treeNode) {
|
|
13285
|
+
throw new Error('onTreeNodeOpen method not implemented.');
|
|
13286
|
+
}
|
|
13287
|
+
syncTree() {
|
|
13288
|
+
throw new Error('syncTree method not implemented.');
|
|
13289
|
+
}
|
|
13290
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
13291
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeService, providedIn: 'root' }); }
|
|
13290
13292
|
}
|
|
13291
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
13292
|
-
type:
|
|
13293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeService, decorators: [{
|
|
13294
|
+
type: Injectable,
|
|
13293
13295
|
args: [{
|
|
13294
|
-
|
|
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
|
-
],
|
|
13296
|
+
providedIn: 'root',
|
|
13312
13297
|
}]
|
|
13313
|
-
}] });
|
|
13298
|
+
}], ctorParameters: () => [] });
|
|
13314
13299
|
|
|
13315
|
-
|
|
13316
|
-
|
|
13317
|
-
|
|
13318
|
-
|
|
13319
|
-
|
|
13320
|
-
|
|
13321
|
-
|
|
13322
|
-
|
|
13323
|
-
|
|
13324
|
-
|
|
13300
|
+
class SmarttreeGenericService extends SmarttreeService {
|
|
13301
|
+
constructor(inject, pageName, treeId, treeMenuIcon) {
|
|
13302
|
+
super();
|
|
13303
|
+
this.pageName = pageName;
|
|
13304
|
+
this.treeId = treeId;
|
|
13305
|
+
this.treeMenuIcon = treeMenuIcon;
|
|
13306
|
+
// UseUiAction properties
|
|
13307
|
+
this.submit = new Subject();
|
|
13308
|
+
this.reSubscribeToChange = new Subject();
|
|
13309
|
+
this.uiActionDescriptors = new Map();
|
|
13310
|
+
if (!this.treeMenuIcon) {
|
|
13311
|
+
this.treeMenuIcon = inject.get('treeMenuIcon');
|
|
13312
|
+
}
|
|
13313
|
+
this.configureTree({
|
|
13314
|
+
pageName: this.pageName,
|
|
13315
|
+
treeid: this.treeId,
|
|
13316
|
+
});
|
|
13317
|
+
this.viewContext = inject.get(SmartViewContextService);
|
|
13318
|
+
this.service = inject.get(TreeService);
|
|
13319
|
+
this.uiActionService = inject.get(UiActionService);
|
|
13320
|
+
this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
|
|
13321
|
+
this.initialize();
|
|
13325
13322
|
}
|
|
13326
|
-
|
|
13327
|
-
|
|
13323
|
+
constructUiActionModels(uiActions) {
|
|
13324
|
+
this.uiActionModels = uiActions.map((uiAction) => {
|
|
13325
|
+
return {
|
|
13326
|
+
serviceToUse: this,
|
|
13327
|
+
uiAction,
|
|
13328
|
+
};
|
|
13329
|
+
});
|
|
13328
13330
|
}
|
|
13329
|
-
|
|
13330
|
-
|
|
13331
|
+
configureTree(configuration) {
|
|
13332
|
+
this.treeId = configuration.treeid;
|
|
13333
|
+
this.pageName = configuration.pageName;
|
|
13331
13334
|
}
|
|
13332
|
-
|
|
13333
|
-
|
|
13334
|
-
|
|
13335
|
-
|
|
13336
|
-
|
|
13337
|
-
|
|
13338
|
-
|
|
13339
|
-
|
|
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);
|
|
13335
|
+
async initialize() {
|
|
13336
|
+
if (this.viewContext.hasViewContextUuid()) {
|
|
13337
|
+
await this.downloadTree().then((rootNodes) => {
|
|
13338
|
+
if (!deepEqual(this.treeFromBackend, rootNodes)) {
|
|
13339
|
+
this.treeFromBackend = rootNodes;
|
|
13340
|
+
this.syncTree();
|
|
13341
|
+
}
|
|
13342
|
+
});
|
|
13356
13343
|
}
|
|
13357
|
-
|
|
13358
|
-
|
|
13344
|
+
}
|
|
13345
|
+
async downloadTree() {
|
|
13346
|
+
let uuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
13347
|
+
const rootNodes = await this.viewContext.handlePerformActionResponse(await this.service.getRootNodes2(uuid, this.treeId).toPromise());
|
|
13348
|
+
const uiActions = await this.viewContext.handlePerformActionResponse(await this.service.getMainActions2(uuid, this.treeId).toPromise());
|
|
13349
|
+
if (uiActions) {
|
|
13350
|
+
this.constructUiActionModels(uiActions);
|
|
13359
13351
|
}
|
|
13360
|
-
|
|
13361
|
-
|
|
13352
|
+
if (!rootNodes) {
|
|
13353
|
+
throw new Error('RootNodes are undefined!');
|
|
13362
13354
|
}
|
|
13355
|
+
return rootNodes;
|
|
13363
13356
|
}
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
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];
|
|
13357
|
+
async downloadChildren(parentNode) {
|
|
13358
|
+
let uuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
13359
|
+
const children = await this.viewContext.handlePerformActionResponse(await this.service.getChildrenNodes2(uuid, this.treeId, parentNode.identifier).toPromise());
|
|
13360
|
+
if (!children) {
|
|
13361
|
+
throw new Error(`Node with identifier ${parentNode.identifier} does not have children.`);
|
|
13378
13362
|
}
|
|
13379
|
-
return
|
|
13363
|
+
return children;
|
|
13380
13364
|
}
|
|
13381
|
-
|
|
13382
|
-
|
|
13383
|
-
|
|
13384
|
-
|
|
13385
|
-
|
|
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;
|
|
13365
|
+
async onTreeNodeOpen(treeNode) {
|
|
13366
|
+
let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
13367
|
+
if (treeNode?.expanded) {
|
|
13368
|
+
let tempTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.collapseNode2(viewUuid, this.treeId, treeNode.identifier).toPromise());
|
|
13369
|
+
treeNode = tempTreeNode;
|
|
13391
13370
|
}
|
|
13392
|
-
|
|
13393
|
-
|
|
13394
|
-
|
|
13371
|
+
else if (!treeNode?.expanded) {
|
|
13372
|
+
let tempTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.expandNode2(viewUuid, this.treeId, treeNode?.identifier).toPromise());
|
|
13373
|
+
treeNode = tempTreeNode;
|
|
13395
13374
|
}
|
|
13396
|
-
|
|
13397
|
-
|
|
13398
|
-
|
|
13399
|
-
|
|
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;
|
|
13375
|
+
let node = this.deepSearchTreeNode(treeNode?.identifier, this.treeFromBackend);
|
|
13376
|
+
node.expanded = treeNode?.expanded;
|
|
13377
|
+
node.childrenNodes = treeNode?.childrenNodes;
|
|
13378
|
+
this.syncTree();
|
|
13417
13379
|
}
|
|
13418
|
-
|
|
13419
|
-
|
|
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));
|
|
13380
|
+
onTreeNodeClick(treeNode) {
|
|
13381
|
+
this.selectFolder(treeNode.identifier, treeNode);
|
|
13430
13382
|
}
|
|
13431
|
-
|
|
13432
|
-
|
|
13433
|
-
|
|
13434
|
-
|
|
13435
|
-
|
|
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;
|
|
13383
|
+
async selectFolder(folderUri, treeNode) {
|
|
13384
|
+
let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
13385
|
+
let updatedTreeNode = await this.viewContext.handlePerformActionResponse(await this.service.selectNode2(viewUuid, this.treeId, treeNode.identifier).toPromise());
|
|
13386
|
+
if (this.selectedNode) {
|
|
13387
|
+
this.selectedNode.selected = false;
|
|
13453
13388
|
}
|
|
13454
|
-
|
|
13455
|
-
|
|
13456
|
-
|
|
13457
|
-
|
|
13458
|
-
if (typeof basePath !== 'string') {
|
|
13459
|
-
basePath = this.basePath;
|
|
13460
|
-
}
|
|
13461
|
-
this.configuration.basePath = basePath;
|
|
13389
|
+
this.selectedNode = updatedTreeNode;
|
|
13390
|
+
let node = this.deepSearchTreeNode(updatedTreeNode?.identifier, this.treeFromBackend);
|
|
13391
|
+
if (!node) {
|
|
13392
|
+
throw Error('Tree node does not exist');
|
|
13462
13393
|
}
|
|
13463
|
-
|
|
13394
|
+
node.expanded = updatedTreeNode?.expanded;
|
|
13395
|
+
node.childrenNodes = updatedTreeNode?.childrenNodes;
|
|
13396
|
+
node.selected = updatedTreeNode?.selected;
|
|
13397
|
+
treeNode = updatedTreeNode;
|
|
13398
|
+
this.syncTree();
|
|
13399
|
+
//this.viewContext.getAndSyncViewContext(this.viewContext.getViewContextUuid());
|
|
13464
13400
|
}
|
|
13465
|
-
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13401
|
+
async updateTreeOnTheFly() {
|
|
13402
|
+
await this.initialize();
|
|
13403
|
+
}
|
|
13404
|
+
async syncTree() {
|
|
13405
|
+
if (this.treeFromBackend === null || this.treeFromBackend === undefined) {
|
|
13406
|
+
//throw new Error('There is no treeFromBackend available!');
|
|
13407
|
+
console.warn('There is no treeFromBackend available in syncTree!');
|
|
13408
|
+
return;
|
|
13469
13409
|
}
|
|
13470
|
-
|
|
13471
|
-
|
|
13410
|
+
await this.cacheActionDesciptors(this.getAllNodes(this.treeFromBackend));
|
|
13411
|
+
if (!this.smartTreeModel) {
|
|
13412
|
+
this.smartTreeModel = {
|
|
13413
|
+
rootNodes: [],
|
|
13414
|
+
};
|
|
13472
13415
|
}
|
|
13473
|
-
|
|
13416
|
+
let smartTreeNodes = this.createButtonsForTreeNodes(this.treeFromBackend);
|
|
13417
|
+
this.smartTreeModel = undefined;
|
|
13418
|
+
this.smartTreeModel = {
|
|
13419
|
+
rootNodes: [],
|
|
13420
|
+
};
|
|
13421
|
+
this.smartTreeModelChanged.next(this.smartTreeModel);
|
|
13422
|
+
this.smartTreeModel.rootNodes = smartTreeNodes;
|
|
13423
|
+
this.findSelected(this.smartTreeModel.rootNodes);
|
|
13424
|
+
this.smartTreeModelChanged.next(this.smartTreeModel);
|
|
13474
13425
|
}
|
|
13475
|
-
|
|
13476
|
-
|
|
13477
|
-
|
|
13478
|
-
|
|
13479
|
-
|
|
13480
|
-
|
|
13481
|
-
|
|
13426
|
+
deepSearchTreeNode(identifier, nodes) {
|
|
13427
|
+
let treeNode;
|
|
13428
|
+
for (let index = 0; index < nodes.length; index++) {
|
|
13429
|
+
const node = nodes[index];
|
|
13430
|
+
if (node.identifier === identifier) {
|
|
13431
|
+
treeNode = node;
|
|
13432
|
+
break;
|
|
13482
13433
|
}
|
|
13483
|
-
|
|
13484
|
-
|
|
13485
|
-
|
|
13486
|
-
|
|
13487
|
-
else {
|
|
13488
|
-
throw Error("key may not be null if value is Date");
|
|
13434
|
+
if (node.childrenNodes && node.childrenNodes.length) {
|
|
13435
|
+
treeNode = this.deepSearchTreeNode(identifier, node.childrenNodes);
|
|
13436
|
+
if (treeNode) {
|
|
13437
|
+
break;
|
|
13489
13438
|
}
|
|
13490
13439
|
}
|
|
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
13440
|
}
|
|
13498
|
-
|
|
13499
|
-
throw Error("key may not be null if value is not object or array");
|
|
13500
|
-
}
|
|
13501
|
-
return httpParams;
|
|
13441
|
+
return treeNode;
|
|
13502
13442
|
}
|
|
13503
|
-
|
|
13504
|
-
|
|
13505
|
-
|
|
13506
|
-
|
|
13507
|
-
|
|
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';
|
|
13443
|
+
findSelected(nodes) {
|
|
13444
|
+
return nodes.forEach((node) => {
|
|
13445
|
+
if (node.selected) {
|
|
13446
|
+
this.selectedNode = node;
|
|
13447
|
+
return;
|
|
13522
13448
|
}
|
|
13523
|
-
else if (
|
|
13524
|
-
|
|
13449
|
+
else if (node.childrenNodes && node.childrenNodes.length) {
|
|
13450
|
+
return this.findSelected(node.childrenNodes);
|
|
13525
13451
|
}
|
|
13526
|
-
|
|
13527
|
-
|
|
13452
|
+
});
|
|
13453
|
+
}
|
|
13454
|
+
createButtonsForTreeNodes(nodes) {
|
|
13455
|
+
let icon = this.treeMenuIcon ?? 'more_vert';
|
|
13456
|
+
nodes.map((node) => {
|
|
13457
|
+
node.button = node.actions?.length
|
|
13458
|
+
? {
|
|
13459
|
+
type: SmartTreeNodeButtonType.MENU,
|
|
13460
|
+
icon: icon,
|
|
13461
|
+
menuItemButtons: node.actions.map((action) => {
|
|
13462
|
+
return {
|
|
13463
|
+
type: SmartTreeNodeButtonType.NORMAL,
|
|
13464
|
+
label: this.getLabelByAction(action),
|
|
13465
|
+
callback: this.doAction.bind(this),
|
|
13466
|
+
args: [action, node.identifier],
|
|
13467
|
+
};
|
|
13468
|
+
}),
|
|
13469
|
+
}
|
|
13470
|
+
: undefined;
|
|
13471
|
+
node.icon = 'Folders';
|
|
13472
|
+
if (node.childrenNodes) {
|
|
13473
|
+
node.childrenNodes = this.createButtonsForTreeNodes(node.childrenNodes);
|
|
13528
13474
|
}
|
|
13475
|
+
});
|
|
13476
|
+
return nodes;
|
|
13477
|
+
}
|
|
13478
|
+
async doAction(args) {
|
|
13479
|
+
let uiAction = args[0];
|
|
13480
|
+
let nodeUuid = args[1];
|
|
13481
|
+
if (uiAction.params) {
|
|
13482
|
+
uiAction.params['nodeUuid'] = nodeUuid;
|
|
13529
13483
|
}
|
|
13530
|
-
|
|
13531
|
-
|
|
13532
|
-
|
|
13533
|
-
|
|
13534
|
-
|
|
13535
|
-
|
|
13536
|
-
|
|
13537
|
-
|
|
13484
|
+
else {
|
|
13485
|
+
uiAction.params = {
|
|
13486
|
+
nodeUuid: nodeUuid,
|
|
13487
|
+
};
|
|
13488
|
+
}
|
|
13489
|
+
let uiActionModel = {
|
|
13490
|
+
serviceToUse: this,
|
|
13491
|
+
uiAction,
|
|
13492
|
+
};
|
|
13493
|
+
this.uiActionService.uiActionModel = uiActionModel;
|
|
13494
|
+
this.uiActionService.execute(uiAction);
|
|
13495
|
+
}
|
|
13496
|
+
getAllNodes(nodes) {
|
|
13497
|
+
return nodes.flatMap((n) => [n, ...this.getAllNodes(n.childrenNodes)]);
|
|
13498
|
+
}
|
|
13499
|
+
async cacheActionDesciptors(nodes) {
|
|
13500
|
+
let newUiActions = new Set();
|
|
13501
|
+
nodes.forEach((node) => {
|
|
13502
|
+
node.actions
|
|
13503
|
+
?.filter((uiAction) => !this.uiActionDescriptors.get(uiAction.code))
|
|
13504
|
+
.forEach((action) => newUiActions.add(action));
|
|
13538
13505
|
});
|
|
13506
|
+
for (let action of newUiActions) {
|
|
13507
|
+
if (!this.uiActionDescriptors.get(action.code)) {
|
|
13508
|
+
let descriptor = await this.uiActionDescriptorService.getActionDescriptor(action);
|
|
13509
|
+
this.uiActionDescriptors.set(action.code, descriptor);
|
|
13510
|
+
}
|
|
13511
|
+
}
|
|
13512
|
+
}
|
|
13513
|
+
getLabelByAction(action) {
|
|
13514
|
+
let desc = this.uiActionDescriptors.get(action.code);
|
|
13515
|
+
return desc.title;
|
|
13539
13516
|
}
|
|
13540
|
-
|
|
13541
|
-
|
|
13542
|
-
|
|
13543
|
-
|
|
13544
|
-
|
|
13545
|
-
|
|
13546
|
-
|
|
13547
|
-
|
|
13548
|
-
|
|
13549
|
-
|
|
13550
|
-
|
|
13551
|
-
|
|
13552
|
-
|
|
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) {
|
|
13517
|
+
// #region UseUiAction
|
|
13518
|
+
getAdditionalParams(uiAction) {
|
|
13519
|
+
if (uiAction.params && uiAction.params['nodeUuid']) {
|
|
13520
|
+
let nodeUuid = uiAction.params['nodeUuid'];
|
|
13521
|
+
let nodeName;
|
|
13522
|
+
if (uiAction.code === 'RENAME') {
|
|
13523
|
+
nodeName = this.deepSearchTreeNode(nodeUuid, this.treeFromBackend)?.caption;
|
|
13524
|
+
}
|
|
13525
|
+
return {
|
|
13526
|
+
forTextArea: '',
|
|
13527
|
+
forTextField: nodeName ? nodeName : '',
|
|
13528
|
+
};
|
|
13529
|
+
}
|
|
13615
13530
|
return {
|
|
13616
|
-
|
|
13617
|
-
|
|
13531
|
+
forTextArea: '',
|
|
13532
|
+
forTextField: '',
|
|
13618
13533
|
};
|
|
13619
13534
|
}
|
|
13620
|
-
|
|
13621
|
-
|
|
13622
|
-
|
|
13535
|
+
getModel() {
|
|
13536
|
+
return {};
|
|
13537
|
+
}
|
|
13538
|
+
async performUiActionRequest(uiActionRequest) {
|
|
13539
|
+
if (uiActionRequest.params['nodeUuid']) {
|
|
13540
|
+
await this.performNodeUiActionRequest(uiActionRequest);
|
|
13623
13541
|
}
|
|
13624
|
-
|
|
13625
|
-
|
|
13626
|
-
'See also https://github.com/angular/angular/issues/20575');
|
|
13542
|
+
else {
|
|
13543
|
+
await this.performMainUiActionRequest(uiActionRequest);
|
|
13627
13544
|
}
|
|
13545
|
+
//await this.viewContext.getAndSyncViewContext();
|
|
13546
|
+
this.syncTree();
|
|
13628
13547
|
}
|
|
13629
|
-
|
|
13630
|
-
|
|
13631
|
-
|
|
13548
|
+
async performNodeUiActionRequest(uiActionRequest) {
|
|
13549
|
+
let nodeId = uiActionRequest.params['nodeUuid'];
|
|
13550
|
+
delete uiActionRequest.params['nodeUuid'];
|
|
13551
|
+
let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
13552
|
+
this.treeFromBackend = await this.viewContext.handlePerformActionResponse(await this.service.performAction2(viewUuid, this.treeId, nodeId, uiActionRequest).toPromise());
|
|
13553
|
+
}
|
|
13554
|
+
async performMainUiActionRequest(uiActionRequest) {
|
|
13555
|
+
let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
13556
|
+
this.treeFromBackend = await this.viewContext.handlePerformActionResponse(await this.service.performMainAction2(viewUuid, this.treeId, uiActionRequest).toPromise());
|
|
13557
|
+
}
|
|
13558
|
+
handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
|
|
13559
|
+
throw new Error('Method not implemented.');
|
|
13560
|
+
}
|
|
13561
|
+
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 }); }
|
|
13562
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeGenericService, providedIn: 'root' }); }
|
|
13632
13563
|
}
|
|
13633
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
13634
|
-
type:
|
|
13564
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeGenericService, decorators: [{
|
|
13565
|
+
type: Injectable,
|
|
13635
13566
|
args: [{
|
|
13636
|
-
|
|
13637
|
-
declarations: [],
|
|
13638
|
-
exports: [],
|
|
13639
|
-
providers: []
|
|
13567
|
+
providedIn: 'root',
|
|
13640
13568
|
}]
|
|
13641
|
-
}], ctorParameters: () => [{ type:
|
|
13642
|
-
type:
|
|
13643
|
-
|
|
13644
|
-
|
|
13645
|
-
|
|
13646
|
-
|
|
13569
|
+
}], ctorParameters: () => [{ type: i0.Injector }, { type: undefined, decorators: [{
|
|
13570
|
+
type: Inject,
|
|
13571
|
+
args: ['pageName']
|
|
13572
|
+
}] }, { type: undefined, decorators: [{
|
|
13573
|
+
type: Inject,
|
|
13574
|
+
args: ['treeId']
|
|
13575
|
+
}] }, { type: undefined, decorators: [{
|
|
13576
|
+
type: Inject,
|
|
13577
|
+
args: ['treeMenuIcon']
|
|
13647
13578
|
}] }] });
|
|
13648
13579
|
|
|
13649
|
-
|
|
13650
|
-
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
class SmartComponentLayoutComponent {
|
|
13654
|
-
constructor(layoutService, element, renderer) {
|
|
13655
|
-
this.layoutService = layoutService;
|
|
13656
|
-
this.element = element;
|
|
13657
|
-
this.renderer = renderer;
|
|
13580
|
+
class SmartTreeComponent {
|
|
13581
|
+
constructor(cdr) {
|
|
13582
|
+
this.cdr = cdr;
|
|
13658
13583
|
this._destroy$ = new Subject();
|
|
13584
|
+
this.treeControl = new NestedTreeControl((node) => node.childrenNodes);
|
|
13585
|
+
this.dataSource = new MatTreeNestedDataSource();
|
|
13586
|
+
this.smartTreeNodeButtonType = SmartTreeNodeButtonType;
|
|
13587
|
+
this.uiActionModels = [];
|
|
13588
|
+
this.hasChild = (_, node) => node.hasChildren;
|
|
13659
13589
|
}
|
|
13660
|
-
|
|
13661
|
-
if (this.
|
|
13662
|
-
|
|
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);
|
|
13590
|
+
ngOnInit() {
|
|
13591
|
+
if (!this.treeService) {
|
|
13592
|
+
throw new Error('TreeService has not been given!');
|
|
13671
13593
|
}
|
|
13672
|
-
this.
|
|
13673
|
-
|
|
13674
|
-
.
|
|
13675
|
-
this.
|
|
13594
|
+
this.errorMessage = this.treeService.errorMessage;
|
|
13595
|
+
this.treeService.smartTreeModelChanged.subscribe((newSmartTree) => {
|
|
13596
|
+
this.treeData = newSmartTree;
|
|
13597
|
+
this.dataSource.data = this.treeData.rootNodes;
|
|
13598
|
+
this.expandTreeNodes();
|
|
13676
13599
|
});
|
|
13677
|
-
this.
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
if (!this.smartFilterComponent) {
|
|
13681
|
-
this.smartFilterComponent = list.first;
|
|
13682
|
-
this.bindFilter();
|
|
13600
|
+
this.treeService.uiActionModelsChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13601
|
+
if (this.treeService.uiActionModels) {
|
|
13602
|
+
this.uiActionModels = this.treeService.uiActionModels;
|
|
13683
13603
|
}
|
|
13684
13604
|
});
|
|
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
13605
|
}
|
|
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);
|
|
13606
|
+
ngOnDestroy() {
|
|
13607
|
+
this._destroy$.next();
|
|
13608
|
+
this._destroy$.complete();
|
|
13743
13609
|
}
|
|
13744
|
-
|
|
13745
|
-
return
|
|
13610
|
+
getIfExpanded(node) {
|
|
13611
|
+
return this.treeControl.isExpanded(node);
|
|
13746
13612
|
}
|
|
13747
|
-
|
|
13748
|
-
|
|
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
|
-
};
|
|
13613
|
+
expandTreeNodes() {
|
|
13614
|
+
this.expandTreeNodesDeeply(this.dataSource.data);
|
|
13759
13615
|
}
|
|
13760
|
-
|
|
13761
|
-
|
|
13762
|
-
|
|
13616
|
+
expandTreeNodesDeeply(nodes) {
|
|
13617
|
+
nodes.forEach((node) => {
|
|
13618
|
+
if (node.expanded) {
|
|
13619
|
+
this.treeControl.expand(node);
|
|
13620
|
+
this.cdr.markForCheck();
|
|
13621
|
+
if (node.childrenNodes && node.childrenNodes.length) {
|
|
13622
|
+
this.expandTreeNodesDeeply(node.childrenNodes);
|
|
13623
|
+
}
|
|
13624
|
+
}
|
|
13625
|
+
else {
|
|
13626
|
+
this.treeControl.collapse(node);
|
|
13627
|
+
}
|
|
13763
13628
|
});
|
|
13764
|
-
this.smartForm = {
|
|
13765
|
-
direction: this.getFormLayout(),
|
|
13766
|
-
componentModel: this.parentSmartComponent?.model,
|
|
13767
|
-
widgets,
|
|
13768
|
-
};
|
|
13769
|
-
this.bindForm();
|
|
13770
13629
|
}
|
|
13771
|
-
|
|
13772
|
-
|
|
13773
|
-
|
|
13774
|
-
|
|
13775
|
-
|
|
13630
|
+
onNodeClick(event, node) {
|
|
13631
|
+
event.stopPropagation();
|
|
13632
|
+
if (this.tempActiveNode)
|
|
13633
|
+
this.tempActiveNode.selected = false;
|
|
13634
|
+
node.selected = true;
|
|
13635
|
+
this.tempActiveNode = node;
|
|
13636
|
+
this.treeService.onTreeNodeClick(node);
|
|
13637
|
+
}
|
|
13638
|
+
onOpenNode(event, node) {
|
|
13639
|
+
event.stopPropagation();
|
|
13640
|
+
this.treeService.onTreeNodeOpen(node);
|
|
13641
|
+
}
|
|
13642
|
+
getNodeStyle(node) {
|
|
13643
|
+
if (this.treeStyle) {
|
|
13644
|
+
var style = node.selected
|
|
13645
|
+
? {
|
|
13646
|
+
background: this.treeStyle.activeStyle?.backgroundColor,
|
|
13647
|
+
color: this.treeStyle.activeStyle?.color,
|
|
13648
|
+
}
|
|
13649
|
+
: {
|
|
13650
|
+
background: this.treeStyle.levelBackgroundColor[node.level],
|
|
13651
|
+
color: this.treeStyle.color,
|
|
13652
|
+
};
|
|
13653
|
+
return style;
|
|
13776
13654
|
}
|
|
13777
|
-
return
|
|
13655
|
+
return {};
|
|
13778
13656
|
}
|
|
13779
|
-
|
|
13780
|
-
if (
|
|
13781
|
-
|
|
13782
|
-
|
|
13657
|
+
getNodePadding(node) {
|
|
13658
|
+
if (this.treeStyle) {
|
|
13659
|
+
var style = node.selected
|
|
13660
|
+
? {
|
|
13661
|
+
'padding-left': 15 * node.level + 'px',
|
|
13662
|
+
}
|
|
13663
|
+
: {
|
|
13664
|
+
'padding-left': 15 * node.level + 'px',
|
|
13665
|
+
};
|
|
13666
|
+
return style;
|
|
13783
13667
|
}
|
|
13668
|
+
return {};
|
|
13784
13669
|
}
|
|
13785
|
-
|
|
13786
|
-
|
|
13670
|
+
customButtonClicked(event, button, close) {
|
|
13671
|
+
event.stopPropagation();
|
|
13672
|
+
if (button.type === SmartTreeNodeButtonType.MENU) {
|
|
13787
13673
|
return;
|
|
13788
13674
|
}
|
|
13789
|
-
if (
|
|
13790
|
-
|
|
13791
|
-
// unique identifier for the form
|
|
13792
|
-
`form_${this.makeid(5)}`, this.smartForm, this.smartFormComponent);
|
|
13675
|
+
if (!button.callback) {
|
|
13676
|
+
throw new Error(`Button with name ${button.label || button.icon} does not have a callback!`);
|
|
13793
13677
|
}
|
|
13794
|
-
|
|
13795
|
-
|
|
13796
|
-
|
|
13797
|
-
|
|
13798
|
-
|
|
13799
|
-
|
|
13800
|
-
while (counter < length) {
|
|
13801
|
-
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
13802
|
-
counter += 1;
|
|
13678
|
+
button.callback(button.args);
|
|
13679
|
+
if (close) {
|
|
13680
|
+
let openMenus = this.trigger.filter((matMenuTrigger) => matMenuTrigger.menuOpen);
|
|
13681
|
+
openMenus.forEach((matMenuTrigger) => {
|
|
13682
|
+
matMenuTrigger.closeMenu();
|
|
13683
|
+
});
|
|
13803
13684
|
}
|
|
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
13685
|
}
|
|
13820
|
-
|
|
13821
|
-
|
|
13822
|
-
|
|
13823
|
-
this.
|
|
13686
|
+
getClassesForTreeNode(node) {
|
|
13687
|
+
let classes = [];
|
|
13688
|
+
if (node.expanded) {
|
|
13689
|
+
classes.push(this.getCustomClass('expanded', node.level));
|
|
13824
13690
|
}
|
|
13825
|
-
|
|
13826
|
-
|
|
13827
|
-
if (this.parentSmartComponent?.useQueryLists) {
|
|
13828
|
-
return;
|
|
13691
|
+
else {
|
|
13692
|
+
classes.push(this.getCustomClass('collapsed', node.level));
|
|
13829
13693
|
}
|
|
13830
|
-
if (
|
|
13831
|
-
|
|
13832
|
-
rowUiActionType: GridUiActionType.POPUP_MENU,
|
|
13833
|
-
}, false, this.smartGridComponent);
|
|
13694
|
+
if (node.selected) {
|
|
13695
|
+
classes.push(this.getCustomClass('selected', node.level));
|
|
13834
13696
|
}
|
|
13835
|
-
|
|
13836
|
-
|
|
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;
|
|
13697
|
+
else {
|
|
13698
|
+
classes.push(this.getCustomClass('unselected', node.level));
|
|
13854
13699
|
}
|
|
13855
|
-
|
|
13856
|
-
|
|
13700
|
+
if (node.level !== 0) {
|
|
13701
|
+
classes.push(this.getCustomClass('child', node.level));
|
|
13702
|
+
}
|
|
13703
|
+
return classes;
|
|
13857
13704
|
}
|
|
13858
|
-
|
|
13859
|
-
let
|
|
13860
|
-
if (
|
|
13861
|
-
this.
|
|
13705
|
+
getInnerClassesForTreeNode(node) {
|
|
13706
|
+
let classes = [];
|
|
13707
|
+
if (node.expanded) {
|
|
13708
|
+
classes.push(this.getCustomClass('inner-expanded', node.level));
|
|
13709
|
+
}
|
|
13710
|
+
else {
|
|
13711
|
+
classes.push(this.getCustomClass('inner-collapsed', node.level));
|
|
13712
|
+
}
|
|
13713
|
+
if (node.selected) {
|
|
13714
|
+
classes.push(this.getCustomClass('inner-selected', node.level));
|
|
13715
|
+
}
|
|
13716
|
+
else {
|
|
13717
|
+
classes.push(this.getCustomClass('inner-unselected', node.level));
|
|
13862
13718
|
}
|
|
13719
|
+
return classes;
|
|
13863
13720
|
}
|
|
13864
|
-
|
|
13865
|
-
|
|
13721
|
+
getClassesForTreeNodeChildren(node) {
|
|
13722
|
+
let classes = [];
|
|
13723
|
+
classes.push(this.getCustomClass('group', node.level));
|
|
13724
|
+
return classes;
|
|
13725
|
+
}
|
|
13726
|
+
getCustomClass(cssClass, plusProperty) {
|
|
13727
|
+
return `${cssClass}-${plusProperty}`;
|
|
13728
|
+
}
|
|
13729
|
+
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 }); }
|
|
13730
|
+
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
13731
|
}
|
|
13867
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
13732
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartTreeComponent, decorators: [{
|
|
13868
13733
|
type: Component,
|
|
13869
|
-
args: [{ selector: 'smart-
|
|
13870
|
-
}], ctorParameters: () => [{ type:
|
|
13871
|
-
type:
|
|
13872
|
-
|
|
13734
|
+
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"] }]
|
|
13735
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { trigger: [{
|
|
13736
|
+
type: ViewChildren,
|
|
13737
|
+
args: [MatMenuTrigger]
|
|
13738
|
+
}], tree: [{
|
|
13739
|
+
type: ViewChild,
|
|
13740
|
+
args: ['tree']
|
|
13741
|
+
}], treeStyle: [{
|
|
13873
13742
|
type: Input
|
|
13874
|
-
}],
|
|
13743
|
+
}], treeService: [{
|
|
13875
13744
|
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
13745
|
}] } });
|
|
13895
13746
|
|
|
13896
|
-
class
|
|
13897
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
13898
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type:
|
|
13747
|
+
class SmarttreeModule {
|
|
13748
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
13749
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeModule, declarations: [SmartTreeComponent], imports: [BrowserModule,
|
|
13899
13750
|
MatCommonModule,
|
|
13900
|
-
|
|
13901
|
-
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
|
|
13751
|
+
MatButtonModule,
|
|
13752
|
+
MatIconModule,
|
|
13753
|
+
MatTreeModule,
|
|
13754
|
+
MatMenuModule,
|
|
13755
|
+
SmartIconModule,
|
|
13756
|
+
SmartViewContextModule], exports: [SmartTreeComponent] }); }
|
|
13757
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeModule, providers: [
|
|
13758
|
+
SmarttreeService,
|
|
13759
|
+
SmarttreeGenericService,
|
|
13760
|
+
{ provide: 'treeMenuIcon', useValue: 'more_vert' },
|
|
13761
|
+
], imports: [BrowserModule,
|
|
13905
13762
|
MatCommonModule,
|
|
13906
|
-
|
|
13907
|
-
|
|
13908
|
-
|
|
13763
|
+
MatButtonModule,
|
|
13764
|
+
MatIconModule,
|
|
13765
|
+
MatTreeModule,
|
|
13766
|
+
MatMenuModule,
|
|
13767
|
+
SmartIconModule,
|
|
13909
13768
|
SmartViewContextModule] }); }
|
|
13910
13769
|
}
|
|
13911
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
13770
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmarttreeModule, decorators: [{
|
|
13912
13771
|
type: NgModule,
|
|
13913
13772
|
args: [{
|
|
13914
|
-
declarations: [
|
|
13773
|
+
declarations: [SmartTreeComponent],
|
|
13915
13774
|
imports: [
|
|
13916
13775
|
BrowserModule,
|
|
13917
13776
|
MatCommonModule,
|
|
13918
|
-
|
|
13919
|
-
|
|
13920
|
-
|
|
13777
|
+
MatButtonModule,
|
|
13778
|
+
MatIconModule,
|
|
13779
|
+
MatTreeModule,
|
|
13780
|
+
MatMenuModule,
|
|
13781
|
+
SmartIconModule,
|
|
13921
13782
|
SmartViewContextModule,
|
|
13922
13783
|
],
|
|
13923
|
-
exports: [
|
|
13924
|
-
|
|
13784
|
+
exports: [SmartTreeComponent],
|
|
13785
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
13786
|
+
providers: [
|
|
13787
|
+
SmarttreeService,
|
|
13788
|
+
SmarttreeGenericService,
|
|
13789
|
+
{ provide: 'treeMenuIcon', useValue: 'more_vert' },
|
|
13790
|
+
],
|
|
13925
13791
|
}]
|
|
13926
13792
|
}] });
|
|
13927
13793
|
|
|
13928
|
-
|
|
13929
|
-
|
|
13930
|
-
|
|
13931
|
-
|
|
13932
|
-
|
|
13933
|
-
|
|
13934
|
-
|
|
13935
|
-
},
|
|
13936
|
-
});
|
|
13794
|
+
/**
|
|
13795
|
+
* Custom HttpParameterCodec
|
|
13796
|
+
* Workaround for https://github.com/angular/angular/issues/18261
|
|
13797
|
+
*/
|
|
13798
|
+
let CustomHttpParameterCodec$1 = class CustomHttpParameterCodec {
|
|
13799
|
+
encodeKey(k) {
|
|
13800
|
+
return encodeURIComponent(k);
|
|
13937
13801
|
}
|
|
13938
|
-
|
|
13939
|
-
|
|
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 = [];
|
|
13802
|
+
encodeValue(v) {
|
|
13803
|
+
return encodeURIComponent(v);
|
|
13952
13804
|
}
|
|
13953
|
-
|
|
13954
|
-
|
|
13955
|
-
this.setUp(this.service.model);
|
|
13956
|
-
});
|
|
13957
|
-
this.setUp(this.service.model);
|
|
13805
|
+
decodeKey(k) {
|
|
13806
|
+
return decodeURIComponent(k);
|
|
13958
13807
|
}
|
|
13959
|
-
|
|
13960
|
-
|
|
13961
|
-
this._destroy$.complete();
|
|
13808
|
+
decodeValue(v) {
|
|
13809
|
+
return decodeURIComponent(v);
|
|
13962
13810
|
}
|
|
13963
|
-
|
|
13964
|
-
|
|
13965
|
-
|
|
13966
|
-
|
|
13811
|
+
};
|
|
13812
|
+
|
|
13813
|
+
const BASE_PATH$1 = new InjectionToken('basePath');
|
|
13814
|
+
const COLLECTION_FORMATS$1 = {
|
|
13815
|
+
'csv': ',',
|
|
13816
|
+
'tsv': ' ',
|
|
13817
|
+
'ssv': ' ',
|
|
13818
|
+
'pipes': '|'
|
|
13819
|
+
};
|
|
13820
|
+
|
|
13821
|
+
let Configuration$1 = class Configuration {
|
|
13822
|
+
constructor(configurationParameters = {}) {
|
|
13823
|
+
this.apiKeys = configurationParameters.apiKeys;
|
|
13824
|
+
this.username = configurationParameters.username;
|
|
13825
|
+
this.password = configurationParameters.password;
|
|
13826
|
+
this.accessToken = configurationParameters.accessToken;
|
|
13827
|
+
this.basePath = configurationParameters.basePath;
|
|
13828
|
+
this.withCredentials = configurationParameters.withCredentials;
|
|
13829
|
+
this.encoder = configurationParameters.encoder;
|
|
13830
|
+
if (configurationParameters.encodeParam) {
|
|
13831
|
+
this.encodeParam = configurationParameters.encodeParam;
|
|
13832
|
+
}
|
|
13833
|
+
else {
|
|
13834
|
+
this.encodeParam = param => this.defaultEncodeParam(param);
|
|
13835
|
+
}
|
|
13836
|
+
if (configurationParameters.credentials) {
|
|
13837
|
+
this.credentials = configurationParameters.credentials;
|
|
13838
|
+
}
|
|
13839
|
+
else {
|
|
13840
|
+
this.credentials = {};
|
|
13967
13841
|
}
|
|
13968
13842
|
}
|
|
13969
|
-
|
|
13970
|
-
|
|
13971
|
-
|
|
13972
|
-
|
|
13973
|
-
|
|
13974
|
-
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
13983
|
-
});
|
|
13843
|
+
/**
|
|
13844
|
+
* Select the correct content-type to use for a request.
|
|
13845
|
+
* Uses {@link Configuration#isJsonMime} to determine the correct content-type.
|
|
13846
|
+
* If no content type is found return the first found type if the contentTypes is not empty
|
|
13847
|
+
* @param contentTypes - the array of content types that are available for selection
|
|
13848
|
+
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
13849
|
+
*/
|
|
13850
|
+
selectHeaderContentType(contentTypes) {
|
|
13851
|
+
if (contentTypes.length === 0) {
|
|
13852
|
+
return undefined;
|
|
13853
|
+
}
|
|
13854
|
+
const type = contentTypes.find((x) => this.isJsonMime(x));
|
|
13855
|
+
if (type === undefined) {
|
|
13856
|
+
return contentTypes[0];
|
|
13984
13857
|
}
|
|
13858
|
+
return type;
|
|
13985
13859
|
}
|
|
13986
|
-
|
|
13987
|
-
|
|
13988
|
-
}
|
|
13989
|
-
|
|
13990
|
-
|
|
13991
|
-
|
|
13992
|
-
|
|
13993
|
-
|
|
13994
|
-
|
|
13995
|
-
|
|
13996
|
-
|
|
13997
|
-
|
|
13998
|
-
|
|
13999
|
-
|
|
14000
|
-
|
|
14001
|
-
|
|
14002
|
-
this.shouldSubmit = new Subject();
|
|
14003
|
-
this.reSubscribeToSubmit = new Subject();
|
|
14004
|
-
this.change = new Subject();
|
|
13860
|
+
/**
|
|
13861
|
+
* Select the correct accept content-type to use for a request.
|
|
13862
|
+
* Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
|
|
13863
|
+
* If no content type is found return the first found type if the contentTypes is not empty
|
|
13864
|
+
* @param accepts - the array of content types that are available for selection.
|
|
13865
|
+
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
13866
|
+
*/
|
|
13867
|
+
selectHeaderAccept(accepts) {
|
|
13868
|
+
if (accepts.length === 0) {
|
|
13869
|
+
return undefined;
|
|
13870
|
+
}
|
|
13871
|
+
const type = accepts.find((x) => this.isJsonMime(x));
|
|
13872
|
+
if (type === undefined) {
|
|
13873
|
+
return accepts[0];
|
|
13874
|
+
}
|
|
13875
|
+
return type;
|
|
14005
13876
|
}
|
|
14006
|
-
|
|
14007
|
-
|
|
14008
|
-
|
|
13877
|
+
/**
|
|
13878
|
+
* Check if the given MIME is a JSON MIME.
|
|
13879
|
+
* JSON MIME examples:
|
|
13880
|
+
* application/json
|
|
13881
|
+
* application/json; charset=UTF8
|
|
13882
|
+
* APPLICATION/JSON
|
|
13883
|
+
* application/vnd.company+json
|
|
13884
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
13885
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
13886
|
+
*/
|
|
13887
|
+
isJsonMime(mime) {
|
|
13888
|
+
const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
13889
|
+
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
14009
13890
|
}
|
|
14010
|
-
|
|
14011
|
-
this.
|
|
14012
|
-
|
|
14013
|
-
|
|
14014
|
-
|
|
14015
|
-
return this.filter;
|
|
13891
|
+
lookupCredential(key) {
|
|
13892
|
+
const value = this.credentials[key];
|
|
13893
|
+
return typeof value === 'function'
|
|
13894
|
+
? value()
|
|
13895
|
+
: value;
|
|
14016
13896
|
}
|
|
14017
|
-
|
|
14018
|
-
|
|
14019
|
-
|
|
14020
|
-
|
|
14021
|
-
|
|
14022
|
-
|
|
14023
|
-
|
|
14024
|
-
|
|
14025
|
-
|
|
14026
|
-
|
|
14027
|
-
|
|
14028
|
-
|
|
14029
|
-
|
|
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 = {}));
|
|
13897
|
+
defaultEncodeParam(param) {
|
|
13898
|
+
// This implementation exists as fallback for missing configuration
|
|
13899
|
+
// and for backwards compatibility to older typescript-angular generator versions.
|
|
13900
|
+
// It only works for the 'simple' parameter style.
|
|
13901
|
+
// Date-handling only works for the 'date-time' format.
|
|
13902
|
+
// All other styles and Date-formats are probably handled incorrectly.
|
|
13903
|
+
//
|
|
13904
|
+
// But: if that's all you need (i.e.: the most common use-case): no need for customization!
|
|
13905
|
+
const value = param.dataFormat === 'date-time' && param.value instanceof Date
|
|
13906
|
+
? param.value.toISOString()
|
|
13907
|
+
: param.value;
|
|
13908
|
+
return encodeURIComponent(String(value));
|
|
13909
|
+
}
|
|
13910
|
+
};
|
|
14063
13911
|
|
|
14064
13912
|
/**
|
|
14065
|
-
*
|
|
14066
|
-
*
|
|
13913
|
+
* Form layout definition
|
|
13914
|
+
* Contains form layout definition objects.
|
|
14067
13915
|
*
|
|
14068
13916
|
* The version of the OpenAPI document: 1.0.0
|
|
14069
13917
|
* Contact: info@it4all.hu
|
|
@@ -14072,25 +13920,124 @@ var FilterExpressionDataType;
|
|
|
14072
13920
|
* https://openapi-generator.tech
|
|
14073
13921
|
* Do not edit the class manually.
|
|
14074
13922
|
*/
|
|
14075
|
-
|
|
14076
|
-
|
|
14077
|
-
|
|
14078
|
-
|
|
14079
|
-
|
|
14080
|
-
|
|
14081
|
-
|
|
14082
|
-
|
|
14083
|
-
|
|
14084
|
-
|
|
14085
|
-
|
|
14086
|
-
|
|
14087
|
-
|
|
14088
|
-
|
|
14089
|
-
|
|
13923
|
+
/* tslint:disable:no-unused-variable member-ordering */
|
|
13924
|
+
class DefaultService {
|
|
13925
|
+
constructor(httpClient, basePath, configuration) {
|
|
13926
|
+
this.httpClient = httpClient;
|
|
13927
|
+
this.basePath = 'http://localhost';
|
|
13928
|
+
this.defaultHeaders = new HttpHeaders();
|
|
13929
|
+
this.configuration = new Configuration$1();
|
|
13930
|
+
if (configuration) {
|
|
13931
|
+
this.configuration = configuration;
|
|
13932
|
+
}
|
|
13933
|
+
if (typeof this.configuration.basePath !== 'string') {
|
|
13934
|
+
if (Array.isArray(basePath) && basePath.length > 0) {
|
|
13935
|
+
basePath = basePath[0];
|
|
13936
|
+
}
|
|
13937
|
+
if (typeof basePath !== 'string') {
|
|
13938
|
+
basePath = this.basePath;
|
|
13939
|
+
}
|
|
13940
|
+
this.configuration.basePath = basePath;
|
|
13941
|
+
}
|
|
13942
|
+
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec$1();
|
|
13943
|
+
}
|
|
13944
|
+
// @ts-ignore
|
|
13945
|
+
addToHttpParams(httpParams, value, key) {
|
|
13946
|
+
if (typeof value === "object" && value instanceof Date === false) {
|
|
13947
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value);
|
|
13948
|
+
}
|
|
13949
|
+
else {
|
|
13950
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
|
|
13951
|
+
}
|
|
13952
|
+
return httpParams;
|
|
13953
|
+
}
|
|
13954
|
+
addToHttpParamsRecursive(httpParams, value, key) {
|
|
13955
|
+
if (value == null) {
|
|
13956
|
+
return httpParams;
|
|
13957
|
+
}
|
|
13958
|
+
if (typeof value === "object") {
|
|
13959
|
+
if (Array.isArray(value)) {
|
|
13960
|
+
value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
|
|
13961
|
+
}
|
|
13962
|
+
else if (value instanceof Date) {
|
|
13963
|
+
if (key != null) {
|
|
13964
|
+
httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
|
|
13965
|
+
}
|
|
13966
|
+
else {
|
|
13967
|
+
throw Error("key may not be null if value is Date");
|
|
13968
|
+
}
|
|
13969
|
+
}
|
|
13970
|
+
else {
|
|
13971
|
+
Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
|
|
13972
|
+
}
|
|
13973
|
+
}
|
|
13974
|
+
else if (key != null) {
|
|
13975
|
+
httpParams = httpParams.append(key, value);
|
|
13976
|
+
}
|
|
13977
|
+
else {
|
|
13978
|
+
throw Error("key may not be null if value is not object or array");
|
|
13979
|
+
}
|
|
13980
|
+
return httpParams;
|
|
13981
|
+
}
|
|
13982
|
+
nopePost(observe = 'body', reportProgress = false, options) {
|
|
13983
|
+
let localVarHeaders = this.defaultHeaders;
|
|
13984
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
13985
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
13986
|
+
// to determine the Accept header
|
|
13987
|
+
const httpHeaderAccepts = [];
|
|
13988
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
13989
|
+
}
|
|
13990
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
13991
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
13992
|
+
}
|
|
13993
|
+
let localVarHttpContext = options && options.context;
|
|
13994
|
+
if (localVarHttpContext === undefined) {
|
|
13995
|
+
localVarHttpContext = new HttpContext();
|
|
13996
|
+
}
|
|
13997
|
+
let responseType_ = 'json';
|
|
13998
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
13999
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
14000
|
+
responseType_ = 'text';
|
|
14001
|
+
}
|
|
14002
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
14003
|
+
responseType_ = 'json';
|
|
14004
|
+
}
|
|
14005
|
+
else {
|
|
14006
|
+
responseType_ = 'blob';
|
|
14007
|
+
}
|
|
14008
|
+
}
|
|
14009
|
+
let localVarPath = `/nope`;
|
|
14010
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
14011
|
+
context: localVarHttpContext,
|
|
14012
|
+
responseType: responseType_,
|
|
14013
|
+
withCredentials: this.configuration.withCredentials,
|
|
14014
|
+
headers: localVarHeaders,
|
|
14015
|
+
observe: observe,
|
|
14016
|
+
reportProgress: reportProgress
|
|
14017
|
+
});
|
|
14018
|
+
}
|
|
14019
|
+
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 }); }
|
|
14020
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: DefaultService, providedIn: 'root' }); }
|
|
14021
|
+
}
|
|
14022
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: DefaultService, decorators: [{
|
|
14023
|
+
type: Injectable,
|
|
14024
|
+
args: [{
|
|
14025
|
+
providedIn: 'root'
|
|
14026
|
+
}]
|
|
14027
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
14028
|
+
type: Optional
|
|
14029
|
+
}, {
|
|
14030
|
+
type: Inject,
|
|
14031
|
+
args: [BASE_PATH$1]
|
|
14032
|
+
}] }, { type: Configuration$1, decorators: [{
|
|
14033
|
+
type: Optional
|
|
14034
|
+
}] }] });
|
|
14035
|
+
|
|
14036
|
+
const APIS = [DefaultService];
|
|
14090
14037
|
|
|
14091
14038
|
/**
|
|
14092
|
-
*
|
|
14093
|
-
*
|
|
14039
|
+
* Form layout definition
|
|
14040
|
+
* Contains form layout definition objects.
|
|
14094
14041
|
*
|
|
14095
14042
|
* The version of the OpenAPI document: 1.0.0
|
|
14096
14043
|
* Contact: info@it4all.hu
|
|
@@ -14099,30 +14046,16 @@ var FilterExpressionFieldWidgetType;
|
|
|
14099
14046
|
* https://openapi-generator.tech
|
|
14100
14047
|
* Do not edit the class manually.
|
|
14101
14048
|
*/
|
|
14102
|
-
var
|
|
14103
|
-
(function (
|
|
14104
|
-
|
|
14105
|
-
|
|
14106
|
-
|
|
14107
|
-
|
|
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 = {}));
|
|
14049
|
+
var ComponentType;
|
|
14050
|
+
(function (ComponentType) {
|
|
14051
|
+
ComponentType["CONTAINER"] = "container";
|
|
14052
|
+
ComponentType["FORM"] = "form";
|
|
14053
|
+
ComponentType["WIDGET"] = "widget";
|
|
14054
|
+
})(ComponentType || (ComponentType = {}));
|
|
14122
14055
|
|
|
14123
14056
|
/**
|
|
14124
|
-
*
|
|
14125
|
-
*
|
|
14057
|
+
* Form layout definition
|
|
14058
|
+
* Contains form layout definition objects.
|
|
14126
14059
|
*
|
|
14127
14060
|
* The version of the OpenAPI document: 1.0.0
|
|
14128
14061
|
* Contact: info@it4all.hu
|
|
@@ -14131,16 +14064,17 @@ var FilterExpressionOperation;
|
|
|
14131
14064
|
* https://openapi-generator.tech
|
|
14132
14065
|
* Do not edit the class manually.
|
|
14133
14066
|
*/
|
|
14134
|
-
var
|
|
14135
|
-
(function (
|
|
14136
|
-
|
|
14137
|
-
|
|
14138
|
-
|
|
14139
|
-
;
|
|
14067
|
+
var ComponentWidgetType;
|
|
14068
|
+
(function (ComponentWidgetType) {
|
|
14069
|
+
ComponentWidgetType["GRID"] = "grid";
|
|
14070
|
+
ComponentWidgetType["FILTER"] = "filter";
|
|
14071
|
+
ComponentWidgetType["TREE"] = "tree";
|
|
14072
|
+
ComponentWidgetType["TOOLBAR"] = "toolbar";
|
|
14073
|
+
})(ComponentWidgetType || (ComponentWidgetType = {}));
|
|
14140
14074
|
|
|
14141
14075
|
/**
|
|
14142
|
-
*
|
|
14143
|
-
*
|
|
14076
|
+
* Form layout definition
|
|
14077
|
+
* Contains form layout definition objects.
|
|
14144
14078
|
*
|
|
14145
14079
|
* The version of the OpenAPI document: 1.0.0
|
|
14146
14080
|
* Contact: info@it4all.hu
|
|
@@ -14149,289 +14083,398 @@ var FilterExpressionOrderByOrderEnum;
|
|
|
14149
14083
|
* https://openapi-generator.tech
|
|
14150
14084
|
* Do not edit the class manually.
|
|
14151
14085
|
*/
|
|
14086
|
+
var LayoutDirection;
|
|
14087
|
+
(function (LayoutDirection) {
|
|
14088
|
+
LayoutDirection["HORIZONTAL"] = "horizontal";
|
|
14089
|
+
LayoutDirection["VERTICAL"] = "vertical";
|
|
14090
|
+
})(LayoutDirection || (LayoutDirection = {}));
|
|
14152
14091
|
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
}
|
|
14159
|
-
;
|
|
14160
|
-
|
|
14161
|
-
class SmartFilterSimpleFieldComponent {
|
|
14162
|
-
constructor(service, cfService) {
|
|
14163
|
-
this.service = service;
|
|
14164
|
-
this.cfService = cfService;
|
|
14165
|
-
this._destroy$ = new Subject();
|
|
14092
|
+
class ApiModule {
|
|
14093
|
+
static forRoot(configurationFactory) {
|
|
14094
|
+
return {
|
|
14095
|
+
ngModule: ApiModule,
|
|
14096
|
+
providers: [{ provide: Configuration$1, useFactory: configurationFactory }]
|
|
14097
|
+
};
|
|
14166
14098
|
}
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
|
|
14099
|
+
constructor(parentModule, http) {
|
|
14100
|
+
if (parentModule) {
|
|
14101
|
+
throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
|
|
14102
|
+
}
|
|
14103
|
+
if (!http) {
|
|
14104
|
+
throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
|
|
14105
|
+
'See also https://github.com/angular/angular/issues/20575');
|
|
14106
|
+
}
|
|
14107
|
+
}
|
|
14108
|
+
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 }); }
|
|
14109
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: ApiModule }); }
|
|
14110
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ApiModule }); }
|
|
14111
|
+
}
|
|
14112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: ApiModule, decorators: [{
|
|
14113
|
+
type: NgModule,
|
|
14114
|
+
args: [{
|
|
14115
|
+
imports: [],
|
|
14116
|
+
declarations: [],
|
|
14117
|
+
exports: [],
|
|
14118
|
+
providers: []
|
|
14119
|
+
}]
|
|
14120
|
+
}], ctorParameters: () => [{ type: ApiModule, decorators: [{
|
|
14121
|
+
type: Optional
|
|
14122
|
+
}, {
|
|
14123
|
+
type: SkipSelf
|
|
14124
|
+
}] }, { type: i1.HttpClient, decorators: [{
|
|
14125
|
+
type: Optional
|
|
14126
|
+
}] }] });
|
|
14127
|
+
|
|
14128
|
+
/*
|
|
14129
|
+
* Public API Surface of smart-grid
|
|
14130
|
+
*/
|
|
14131
|
+
|
|
14132
|
+
class SmartComponentLayoutComponent {
|
|
14133
|
+
constructor(layoutService, element, renderer) {
|
|
14134
|
+
this.layoutService = layoutService;
|
|
14135
|
+
this.element = element;
|
|
14136
|
+
this.renderer = renderer;
|
|
14137
|
+
this._destroy$ = new Subject();
|
|
14170
14138
|
}
|
|
14171
14139
|
ngAfterViewInit() {
|
|
14172
|
-
this.
|
|
14140
|
+
if (this.smartFormList?.first) {
|
|
14141
|
+
this.setFormComponent(this.smartFormList?.first);
|
|
14142
|
+
}
|
|
14143
|
+
this.smartFormList.changes
|
|
14144
|
+
.pipe(takeUntil(this._destroy$))
|
|
14145
|
+
.subscribe((list) => {
|
|
14146
|
+
this.setFormComponent(list.first);
|
|
14147
|
+
});
|
|
14148
|
+
if (this.smartGridList?.first) {
|
|
14149
|
+
this.setGridComponent(this.smartGridList?.first);
|
|
14150
|
+
}
|
|
14151
|
+
this.smartGridList.changes
|
|
14152
|
+
.pipe(takeUntil(this._destroy$))
|
|
14153
|
+
.subscribe((list) => {
|
|
14154
|
+
this.setGridComponent(list.first);
|
|
14155
|
+
});
|
|
14156
|
+
this.smartFilterList.changes
|
|
14157
|
+
.pipe(takeUntil(this._destroy$))
|
|
14158
|
+
.subscribe((list) => {
|
|
14159
|
+
if (!this.smartFilterComponent) {
|
|
14160
|
+
this.smartFilterComponent = list.first;
|
|
14161
|
+
this.bindFilter();
|
|
14162
|
+
}
|
|
14163
|
+
});
|
|
14164
|
+
if (this.toolbarList?.first) {
|
|
14165
|
+
this.setToolbarComponent(this.toolbarList?.first);
|
|
14166
|
+
}
|
|
14167
|
+
this.toolbarList.changes
|
|
14168
|
+
.pipe(takeUntil(this._destroy$))
|
|
14169
|
+
.subscribe((list) => {
|
|
14170
|
+
this.setToolbarComponent(list.first);
|
|
14171
|
+
});
|
|
14172
|
+
this.setUp();
|
|
14173
14173
|
}
|
|
14174
14174
|
ngOnDestroy() {
|
|
14175
14175
|
this._destroy$.next();
|
|
14176
14176
|
this._destroy$.complete();
|
|
14177
14177
|
}
|
|
14178
|
-
|
|
14179
|
-
|
|
14180
|
-
|
|
14181
|
-
|
|
14178
|
+
ngOnChanges(changes) {
|
|
14179
|
+
this.setUp();
|
|
14180
|
+
}
|
|
14181
|
+
setUp() {
|
|
14182
|
+
if (!this.parentSmartComponent || !this.smartComponentLayout) {
|
|
14183
|
+
return;
|
|
14182
14184
|
}
|
|
14183
|
-
|
|
14184
|
-
|
|
14185
|
+
if (deepEqual(this.smartComponentLayout, this.currentLayout)) {
|
|
14186
|
+
// no layout change, keep current state
|
|
14187
|
+
this.smartComponentLayout = this.currentLayout;
|
|
14188
|
+
return;
|
|
14185
14189
|
}
|
|
14186
|
-
|
|
14187
|
-
|
|
14188
|
-
|
|
14189
|
-
|
|
14190
|
-
|
|
14191
|
-
|
|
14192
|
-
|
|
14193
|
-
|
|
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';
|
|
14190
|
+
// layout changed, render, but save current
|
|
14191
|
+
// this.currentLayout = JSON.parse(JSON.stringify(this.smartComponentLayout));
|
|
14192
|
+
this.currentLayout = this.smartComponentLayout;
|
|
14193
|
+
this.uuid = this.parentSmartComponent.uuid;
|
|
14194
|
+
this.treeService = this.parentSmartComponent.smartTreeService;
|
|
14195
|
+
this.smartComponentLayout?.direction;
|
|
14196
|
+
if (this.smartComponentLayout?.expandable) {
|
|
14197
|
+
this.constructExpandableSection();
|
|
14210
14198
|
}
|
|
14211
|
-
if (this.
|
|
14212
|
-
|
|
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));
|
|
14199
|
+
else if (this.smartComponentLayout?.type === ComponentType.FORM) {
|
|
14200
|
+
this.constructForm();
|
|
14216
14201
|
}
|
|
14217
|
-
if (this.
|
|
14218
|
-
if (
|
|
14219
|
-
|
|
14202
|
+
else if (this.smartComponentLayout?.type === ComponentType.WIDGET) {
|
|
14203
|
+
if (this.smartComponentLayout.widget?.type === ComponentWidgetType.GRID) {
|
|
14204
|
+
this.constructGrid();
|
|
14205
|
+
}
|
|
14206
|
+
else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.FILTER) {
|
|
14207
|
+
console.warn('ComponentWidgetType.FILTER is not supported');
|
|
14208
|
+
// this.constructFilter();
|
|
14209
|
+
}
|
|
14210
|
+
else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.TREE) {
|
|
14211
|
+
this.constructTree();
|
|
14212
|
+
}
|
|
14213
|
+
else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.TOOLBAR) {
|
|
14214
|
+
this.constructToolbar();
|
|
14215
|
+
}
|
|
14216
|
+
if (!this.parentLayoutComponent) {
|
|
14217
|
+
// only top level component should call init actions
|
|
14218
|
+
this.parentSmartComponent.initActions();
|
|
14220
14219
|
}
|
|
14221
|
-
widgets.push(this.constructFormWidget(key, this.filterExpressionField.label3, this.filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, this.filterExpressionField.possibleValues, this.filterExpressionField.placeholder3));
|
|
14222
14220
|
}
|
|
14223
|
-
this.
|
|
14224
|
-
|
|
14221
|
+
SmartStyleUtility.applyStyle(this.smartComponentLayout.style, this.element, this.renderer);
|
|
14222
|
+
}
|
|
14223
|
+
type() {
|
|
14224
|
+
return ComponentType;
|
|
14225
|
+
}
|
|
14226
|
+
constructExpandableSection() {
|
|
14227
|
+
let data = { ...this.smartComponentLayout };
|
|
14228
|
+
data.expandable = false;
|
|
14229
|
+
this.expandableSection = {
|
|
14230
|
+
title: this.smartComponentLayout?.expandableSectionLabel ?? '',
|
|
14231
|
+
inputs: new Map([
|
|
14232
|
+
['smartComponentLayout', data],
|
|
14233
|
+
['parentSmartComponent', this.parentSmartComponent],
|
|
14234
|
+
['parentLayoutComponent', this.parentLayoutComponent],
|
|
14235
|
+
]),
|
|
14236
|
+
customComponent: SmartComponentLayoutComponent,
|
|
14237
|
+
};
|
|
14238
|
+
}
|
|
14239
|
+
constructForm() {
|
|
14240
|
+
const widgets = this.layoutService.render({
|
|
14241
|
+
layoutDefinitions: this.smartComponentLayout?.form,
|
|
14242
|
+
});
|
|
14225
14243
|
this.smartForm = {
|
|
14226
|
-
direction:
|
|
14227
|
-
componentModel:
|
|
14228
|
-
useOnValueChangeEvent: true,
|
|
14229
|
-
useOnBlurEvent: true,
|
|
14230
|
-
submitOnEnter: this.service.filter?.submitOnEnter,
|
|
14244
|
+
direction: this.getFormLayout(),
|
|
14245
|
+
componentModel: this.parentSmartComponent?.model,
|
|
14231
14246
|
widgets,
|
|
14232
|
-
translateService: this.service.filter?.translateService,
|
|
14233
14247
|
};
|
|
14234
|
-
|
|
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
|
-
});
|
|
14248
|
+
this.bindForm();
|
|
14246
14249
|
}
|
|
14247
|
-
|
|
14248
|
-
|
|
14249
|
-
|
|
14250
|
-
|
|
14251
|
-
|
|
14252
|
-
|
|
14253
|
-
|
|
14254
|
-
return this.filterExpressionField;
|
|
14250
|
+
getFormLayout() {
|
|
14251
|
+
if (this.smartComponentLayout?.direction) {
|
|
14252
|
+
return this.smartComponentLayout?.direction === LayoutDirection.HORIZONTAL
|
|
14253
|
+
? SmartFormWidgetDirection.ROW
|
|
14254
|
+
: SmartFormWidgetDirection.COL;
|
|
14255
|
+
}
|
|
14256
|
+
return SmartFormWidgetDirection.COL;
|
|
14255
14257
|
}
|
|
14256
|
-
|
|
14257
|
-
|
|
14258
|
-
.
|
|
14259
|
-
|
|
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();
|
|
14258
|
+
setFormComponent(comp) {
|
|
14259
|
+
if (!this.smartFormComponent) {
|
|
14260
|
+
this.smartFormComponent = comp;
|
|
14261
|
+
this.bindForm();
|
|
14276
14262
|
}
|
|
14277
|
-
|
|
14278
|
-
|
|
14279
|
-
|
|
14280
|
-
|
|
14281
|
-
|
|
14282
|
-
|
|
14283
|
-
this.
|
|
14263
|
+
}
|
|
14264
|
+
bindForm() {
|
|
14265
|
+
if (this.parentSmartComponent?.useQueryLists) {
|
|
14266
|
+
return;
|
|
14267
|
+
}
|
|
14268
|
+
if (this.smartForm && this.smartFormComponent) {
|
|
14269
|
+
this.parentSmartComponent?.addForm(
|
|
14270
|
+
// unique identifier for the form
|
|
14271
|
+
`form_${this.makeid(5)}`, this.smartForm, this.smartFormComponent);
|
|
14272
|
+
}
|
|
14273
|
+
}
|
|
14274
|
+
makeid(length) {
|
|
14275
|
+
let result = '';
|
|
14276
|
+
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
14277
|
+
const charactersLength = characters.length;
|
|
14278
|
+
let counter = 0;
|
|
14279
|
+
while (counter < length) {
|
|
14280
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
14281
|
+
counter += 1;
|
|
14282
|
+
}
|
|
14283
|
+
return result;
|
|
14284
|
+
}
|
|
14285
|
+
constructGrid() {
|
|
14286
|
+
this.smartGrid = {
|
|
14287
|
+
gridIdentifier: this.smartComponentLayout?.widget?.identifier,
|
|
14288
|
+
gridModel: {
|
|
14289
|
+
page: {},
|
|
14290
|
+
},
|
|
14291
|
+
options: {
|
|
14292
|
+
rowUiActionType: GridUiActionType.POPUP_MENU,
|
|
14293
|
+
},
|
|
14294
|
+
layoutDef: SmartLayoutDef.TABLE,
|
|
14295
|
+
paginator: true,
|
|
14296
|
+
};
|
|
14297
|
+
this.bindGrid();
|
|
14298
|
+
}
|
|
14299
|
+
setGridComponent(comp) {
|
|
14300
|
+
if (!this.smartGridComponent) {
|
|
14301
|
+
this.smartGridComponent = comp;
|
|
14302
|
+
this.bindGrid();
|
|
14303
|
+
}
|
|
14304
|
+
}
|
|
14305
|
+
bindGrid() {
|
|
14306
|
+
if (this.parentSmartComponent?.useQueryLists) {
|
|
14307
|
+
return;
|
|
14308
|
+
}
|
|
14309
|
+
if (this.smartGrid && this.smartGridComponent) {
|
|
14310
|
+
this.smartGrid = this.parentSmartComponent?.addGrid(this.smartGrid, {
|
|
14311
|
+
rowUiActionType: GridUiActionType.POPUP_MENU,
|
|
14312
|
+
}, false, this.smartGridComponent);
|
|
14284
14313
|
}
|
|
14285
14314
|
}
|
|
14286
|
-
|
|
14287
|
-
|
|
14288
|
-
|
|
14315
|
+
setToolbarComponent(comp) {
|
|
14316
|
+
this.toolbar = comp;
|
|
14317
|
+
}
|
|
14318
|
+
// NOT USED, DOESN'T WORK
|
|
14319
|
+
// constructFilter(): void {
|
|
14320
|
+
// this.smartFilter = (this.smartComponentLayout!.parentComponent as any).addFilter(
|
|
14321
|
+
// `filter_${this.makeid(5)}`,
|
|
14322
|
+
// this.smartComponentLayout?.widget?.filterExpressionFieldList,
|
|
14323
|
+
// this.smartComponentLayout?.widget?.filterType,
|
|
14324
|
+
// this.smartFilterComponent
|
|
14325
|
+
// );
|
|
14326
|
+
// }
|
|
14327
|
+
bindFilter() {
|
|
14328
|
+
// TODO
|
|
14329
|
+
}
|
|
14330
|
+
constructTree() {
|
|
14331
|
+
if (this.parentSmartComponent?.useQueryLists) {
|
|
14332
|
+
return;
|
|
14289
14333
|
}
|
|
14290
|
-
|
|
14291
|
-
|
|
14334
|
+
this.parentSmartComponent.setUpDefaultTree(this.smartComponentLayout?.widget?.identifier);
|
|
14335
|
+
this.treeService?.initialize();
|
|
14336
|
+
}
|
|
14337
|
+
constructToolbar() {
|
|
14338
|
+
let toolbarId = this.smartComponentLayout?.widget?.identifier;
|
|
14339
|
+
if (this.toolbarId !== toolbarId) {
|
|
14340
|
+
this.toolbarId = toolbarId;
|
|
14292
14341
|
}
|
|
14293
|
-
return option;
|
|
14294
14342
|
}
|
|
14295
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
14296
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type:
|
|
14343
|
+
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 }); }
|
|
14344
|
+
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
14345
|
}
|
|
14298
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
14346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutComponent, decorators: [{
|
|
14299
14347
|
type: Component,
|
|
14300
|
-
args: [{ selector: 'smart-
|
|
14301
|
-
}], ctorParameters: () => [{ type:
|
|
14302
|
-
type: ViewChildren,
|
|
14303
|
-
args: ['simpleField']
|
|
14304
|
-
}], operationTranslator: [{
|
|
14348
|
+
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"] }]
|
|
14349
|
+
}], ctorParameters: () => [{ type: SmartformLayoutDefinitionService }, { type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { smartComponentLayout: [{
|
|
14305
14350
|
type: Input
|
|
14306
|
-
}],
|
|
14351
|
+
}], parentLayoutComponent: [{
|
|
14307
14352
|
type: Input
|
|
14308
|
-
}],
|
|
14353
|
+
}], parentSmartComponent: [{
|
|
14309
14354
|
type: Input
|
|
14310
|
-
}],
|
|
14311
|
-
type:
|
|
14312
|
-
args: ['form'
|
|
14355
|
+
}], smartFormList: [{
|
|
14356
|
+
type: ViewChildren,
|
|
14357
|
+
args: ['form']
|
|
14358
|
+
}], smartGridList: [{
|
|
14359
|
+
type: ViewChildren,
|
|
14360
|
+
args: ['grid']
|
|
14361
|
+
}], smartFilterList: [{
|
|
14362
|
+
type: ViewChildren,
|
|
14363
|
+
args: ['filter']
|
|
14364
|
+
}], toolbarList: [{
|
|
14365
|
+
type: ViewChildren,
|
|
14366
|
+
args: ['toolbar']
|
|
14367
|
+
}], expandableComponents: [{
|
|
14368
|
+
type: ViewChildren,
|
|
14369
|
+
args: [ExpandableSectionComponent]
|
|
14370
|
+
}], components: [{
|
|
14371
|
+
type: ViewChildren,
|
|
14372
|
+
args: [SmartComponentLayoutComponent]
|
|
14313
14373
|
}] } });
|
|
14314
14374
|
|
|
14315
|
-
class
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14319
|
-
|
|
14320
|
-
|
|
14321
|
-
|
|
14322
|
-
|
|
14323
|
-
|
|
14324
|
-
|
|
14325
|
-
|
|
14326
|
-
|
|
14327
|
-
|
|
14328
|
-
|
|
14329
|
-
|
|
14330
|
-
|
|
14331
|
-
|
|
14332
|
-
|
|
14333
|
-
|
|
14334
|
-
|
|
14335
|
-
|
|
14336
|
-
|
|
14337
|
-
|
|
14338
|
-
|
|
14375
|
+
class SmartComponentLayoutModule {
|
|
14376
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
14377
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutModule, declarations: [SmartComponentLayoutComponent], imports: [BrowserModule,
|
|
14378
|
+
MatCommonModule,
|
|
14379
|
+
SmartGridModule,
|
|
14380
|
+
SmartExpandableSectionModule,
|
|
14381
|
+
SmarttreeModule,
|
|
14382
|
+
SmartViewContextModule], exports: [SmartComponentLayoutComponent] }); }
|
|
14383
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutModule, imports: [BrowserModule,
|
|
14384
|
+
MatCommonModule,
|
|
14385
|
+
SmartGridModule,
|
|
14386
|
+
SmartExpandableSectionModule,
|
|
14387
|
+
SmarttreeModule,
|
|
14388
|
+
SmartViewContextModule] }); }
|
|
14389
|
+
}
|
|
14390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartComponentLayoutModule, decorators: [{
|
|
14391
|
+
type: NgModule,
|
|
14392
|
+
args: [{
|
|
14393
|
+
declarations: [SmartComponentLayoutComponent],
|
|
14394
|
+
imports: [
|
|
14395
|
+
BrowserModule,
|
|
14396
|
+
MatCommonModule,
|
|
14397
|
+
SmartGridModule,
|
|
14398
|
+
SmartExpandableSectionModule,
|
|
14399
|
+
SmarttreeModule,
|
|
14400
|
+
SmartViewContextModule,
|
|
14401
|
+
],
|
|
14402
|
+
exports: [SmartComponentLayoutComponent],
|
|
14403
|
+
providers: [],
|
|
14404
|
+
}]
|
|
14405
|
+
}] });
|
|
14406
|
+
|
|
14407
|
+
class SmartFilterParamComponent {
|
|
14408
|
+
constructor() { }
|
|
14409
|
+
onItemClick(item) {
|
|
14410
|
+
this.data.serviceToUse.peformWidgetAction({
|
|
14411
|
+
code: 'ADD_FILTER_EXPRESSION',
|
|
14412
|
+
params: {
|
|
14413
|
+
model: item,
|
|
14414
|
+
},
|
|
14339
14415
|
});
|
|
14340
|
-
this.service.filter = this.smartFilter;
|
|
14341
|
-
this.service.shouldSubmit.complete();
|
|
14342
14416
|
}
|
|
14343
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
14344
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type:
|
|
14417
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterParamComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14418
|
+
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
14419
|
}
|
|
14346
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
14420
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterParamComponent, decorators: [{
|
|
14347
14421
|
type: Component,
|
|
14348
|
-
args: [{ selector:
|
|
14349
|
-
}], ctorParameters: () => [
|
|
14350
|
-
type:
|
|
14351
|
-
args: ["simpleField"]
|
|
14422
|
+
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"] }]
|
|
14423
|
+
}], ctorParameters: () => [], propDecorators: { data: [{
|
|
14424
|
+
type: Input
|
|
14352
14425
|
}] } });
|
|
14353
14426
|
|
|
14354
|
-
class
|
|
14355
|
-
constructor(
|
|
14356
|
-
this.
|
|
14427
|
+
class SmartFilterParamsComponent {
|
|
14428
|
+
constructor() {
|
|
14429
|
+
this._destroy$ = new Subject();
|
|
14430
|
+
this.expandableSections = [];
|
|
14357
14431
|
}
|
|
14358
14432
|
ngOnInit() {
|
|
14359
|
-
|
|
14360
|
-
this.setUp();
|
|
14361
|
-
}
|
|
14433
|
+
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
14434
|
+
this.setUp(this.service.model);
|
|
14435
|
+
});
|
|
14436
|
+
this.setUp(this.service.model);
|
|
14362
14437
|
}
|
|
14363
|
-
|
|
14364
|
-
|
|
14365
|
-
|
|
14366
|
-
}
|
|
14438
|
+
ngOnDestroy() {
|
|
14439
|
+
this._destroy$.next();
|
|
14440
|
+
this._destroy$.complete();
|
|
14367
14441
|
}
|
|
14368
|
-
setUp() {
|
|
14369
|
-
|
|
14442
|
+
setUp(model) {
|
|
14443
|
+
if (model?.model) {
|
|
14444
|
+
this.filterBuilder = model.model;
|
|
14445
|
+
this.constructExpandableSections();
|
|
14446
|
+
}
|
|
14370
14447
|
}
|
|
14371
|
-
|
|
14372
|
-
|
|
14448
|
+
constructExpandableSections() {
|
|
14449
|
+
if (this.filterBuilder.groups) {
|
|
14450
|
+
this.expandableSections = this.filterBuilder.groups.map((filterExpressionBuilderGroup) => {
|
|
14451
|
+
return {
|
|
14452
|
+
title: filterExpressionBuilderGroup.label,
|
|
14453
|
+
cssClass: 'filterExpressionBuilderGroup',
|
|
14454
|
+
customComponent: SmartFilterParamComponent,
|
|
14455
|
+
data: {
|
|
14456
|
+
group: filterExpressionBuilderGroup.fields,
|
|
14457
|
+
serviceToUse: this.service,
|
|
14458
|
+
},
|
|
14459
|
+
inputName: 'data',
|
|
14460
|
+
isExpanded: true,
|
|
14461
|
+
};
|
|
14462
|
+
});
|
|
14463
|
+
}
|
|
14373
14464
|
}
|
|
14374
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
14375
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type:
|
|
14465
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterParamsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14466
|
+
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
14467
|
}
|
|
14377
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type:
|
|
14468
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: SmartFilterParamsComponent, decorators: [{
|
|
14378
14469
|
type: Component,
|
|
14379
|
-
args: [{ selector: 'smart-filter',
|
|
14380
|
-
}], ctorParameters: () => [
|
|
14470
|
+
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"] }]
|
|
14471
|
+
}], ctorParameters: () => [], propDecorators: { service: [{
|
|
14381
14472
|
type: Input
|
|
14473
|
+
}], filterVcRef: [{
|
|
14474
|
+
type: ViewChild,
|
|
14475
|
+
args: ['smartFilter', { read: ViewContainerRef }]
|
|
14382
14476
|
}] } });
|
|
14383
14477
|
|
|
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
14478
|
var FilterExpressionBuilderUiModelTypeEnum;
|
|
14436
14479
|
(function (FilterExpressionBuilderUiModelTypeEnum) {
|
|
14437
14480
|
FilterExpressionBuilderUiModelTypeEnum["SIMPLE"] = "SIMPLE";
|