@smartbit4all/ng-client 1.2.1 → 2.0.0
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/esm2020/lib/smart-client/smart-component-api-client.mjs +2 -2
- package/esm2020/lib/smart-ng-client.module.mjs +15 -4
- package/esm2020/lib/smart-tree/projects.mjs +9 -0
- package/esm2020/lib/smart-tree/smarttree-generic.service.mjs +292 -0
- package/esm2020/lib/smart-tree/smarttree.component.mjs +180 -0
- package/esm2020/lib/smart-tree/smarttree.model.mjs +7 -0
- package/esm2020/lib/smart-tree/smarttree.module.mjs +50 -0
- package/esm2020/lib/smart-tree/smarttree.node.model.mjs +6 -0
- package/esm2020/lib/smart-tree/smarttree.service.interface.mjs +2 -0
- package/esm2020/lib/smart-tree/smarttree.service.mjs +47 -0
- package/esm2020/lib/smart-tree/tree-api/api/tree.service.mjs +644 -0
- package/esm2020/lib/smart-tree/tree-api/configuration.mjs +91 -0
- package/esm2020/lib/smart-tree/tree-api/encoder.mjs +19 -0
- package/esm2020/lib/smart-tree/tree-api/param.mjs +2 -0
- package/esm2020/lib/smart-tree/tree-api/variables.mjs +9 -0
- package/esm2020/projects.mjs +2 -1
- package/fesm2015/smartbit4all-ng-client.mjs +1418 -70
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +1380 -70
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-client/smart-component-api-client.d.ts +1 -1
- package/lib/smart-ng-client.module.d.ts +2 -1
- package/lib/smart-tree/projects.d.ts +5 -0
- package/lib/smart-tree/smarttree-generic.service.d.ts +50 -0
- package/lib/smart-tree/smarttree.component.d.ts +42 -0
- package/lib/smart-tree/smarttree.model.d.ts +41 -0
- package/lib/smart-tree/smarttree.module.d.ts +14 -0
- package/lib/smart-tree/smarttree.node.model.d.ts +13 -0
- package/lib/smart-tree/smarttree.service.d.ts +24 -0
- package/lib/smart-tree/smarttree.service.interface.d.ts +43 -0
- package/lib/smart-tree/tree-api/api/tree.service.d.ts +177 -0
- package/lib/smart-tree/tree-api/configuration.d.ts +104 -0
- package/lib/smart-tree/tree-api/encoder.d.ts +11 -0
- package/lib/smart-tree/tree-api/param.d.ts +37 -0
- package/lib/smart-tree/tree-api/variables.d.ts +8 -0
- package/package.json +1 -1
- package/projects.d.ts +1 -0
- package/smartbit4all-ng-client-2.0.0.tgz +0 -0
- package/src/lib/smart-tree/tree-api/README.md +226 -0
- package/smartbit4all-ng-client-1.2.1.tgz +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, Optional, Inject, PLATFORM_ID, NgModule, SkipSelf, Component, Pipe, CUSTOM_ELEMENTS_SCHEMA, ViewChild, Input } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Injectable, Optional, Inject, PLATFORM_ID, NgModule, SkipSelf, Component, Pipe, CUSTOM_ELEMENTS_SCHEMA, ViewChild, Input, ViewChildren } from '@angular/core';
|
|
3
3
|
import { __awaiter, __decorate, __param } from 'tslib';
|
|
4
4
|
import { Subject, takeUntil, map, catchError, throwError, from } from 'rxjs';
|
|
5
5
|
import { SmartSubject } from '@smartbit4all/subject';
|
|
@@ -29,14 +29,18 @@ import { catchError as catchError$1, switchMap } from 'rxjs/operators';
|
|
|
29
29
|
import * as i4$4 from '@angular/material/snack-bar';
|
|
30
30
|
import { MAT_SNACK_BAR_DATA, MatSnackBarModule } from '@angular/material/snack-bar';
|
|
31
31
|
import { Validators } from '@angular/forms';
|
|
32
|
+
import * as i5$1 from '@angular/material/menu';
|
|
33
|
+
import { MatMenuTrigger, MatMenuModule } from '@angular/material/menu';
|
|
34
|
+
import * as i1$2 from '@angular/material/tree';
|
|
35
|
+
import { MatTreeNestedDataSource, MatTreeModule } from '@angular/material/tree';
|
|
36
|
+
import { NestedTreeControl } from '@angular/cdk/tree';
|
|
32
37
|
import { SmartGridComponent } from '@smartbit4all/grid';
|
|
33
|
-
import { SmarttreeGenericService } from '@smartbit4all/tree';
|
|
34
38
|
|
|
35
39
|
/**
|
|
36
40
|
* Custom HttpParameterCodec
|
|
37
41
|
* Workaround for https://github.com/angular/angular/issues/18261
|
|
38
42
|
*/
|
|
39
|
-
class CustomHttpParameterCodec$
|
|
43
|
+
class CustomHttpParameterCodec$2 {
|
|
40
44
|
encodeKey(k) {
|
|
41
45
|
return encodeURIComponent(k);
|
|
42
46
|
}
|
|
@@ -51,15 +55,15 @@ class CustomHttpParameterCodec$1 {
|
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
const BASE_PATH$
|
|
55
|
-
const COLLECTION_FORMATS$
|
|
58
|
+
const BASE_PATH$2 = new InjectionToken('basePath');
|
|
59
|
+
const COLLECTION_FORMATS$2 = {
|
|
56
60
|
'csv': ',',
|
|
57
61
|
'tsv': ' ',
|
|
58
62
|
'ssv': ' ',
|
|
59
63
|
'pipes': '|'
|
|
60
64
|
};
|
|
61
65
|
|
|
62
|
-
class Configuration$
|
|
66
|
+
class Configuration$2 {
|
|
63
67
|
constructor(configurationParameters = {}) {
|
|
64
68
|
this.apiKeys = configurationParameters.apiKeys;
|
|
65
69
|
this.username = configurationParameters.username;
|
|
@@ -166,7 +170,7 @@ class SessionService {
|
|
|
166
170
|
this.httpClient = httpClient;
|
|
167
171
|
this.basePath = 'http://localhost';
|
|
168
172
|
this.defaultHeaders = new HttpHeaders();
|
|
169
|
-
this.configuration = new Configuration$
|
|
173
|
+
this.configuration = new Configuration$2();
|
|
170
174
|
if (configuration) {
|
|
171
175
|
this.configuration = configuration;
|
|
172
176
|
}
|
|
@@ -179,7 +183,7 @@ class SessionService {
|
|
|
179
183
|
}
|
|
180
184
|
this.configuration.basePath = basePath;
|
|
181
185
|
}
|
|
182
|
-
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec$
|
|
186
|
+
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec$2();
|
|
183
187
|
}
|
|
184
188
|
// @ts-ignore
|
|
185
189
|
addToHttpParams(httpParams, value, key) {
|
|
@@ -430,7 +434,7 @@ class SessionService {
|
|
|
430
434
|
});
|
|
431
435
|
}
|
|
432
436
|
}
|
|
433
|
-
SessionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SessionService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH$
|
|
437
|
+
SessionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SessionService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH$2, optional: true }, { token: Configuration$2, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
434
438
|
SessionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SessionService, providedIn: 'root' });
|
|
435
439
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SessionService, decorators: [{
|
|
436
440
|
type: Injectable,
|
|
@@ -442,8 +446,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
442
446
|
type: Optional
|
|
443
447
|
}, {
|
|
444
448
|
type: Inject,
|
|
445
|
-
args: [BASE_PATH$
|
|
446
|
-
}] }, { type: Configuration$
|
|
449
|
+
args: [BASE_PATH$2]
|
|
450
|
+
}] }, { type: Configuration$2, decorators: [{
|
|
447
451
|
type: Optional
|
|
448
452
|
}] }];
|
|
449
453
|
} });
|
|
@@ -914,7 +918,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
914
918
|
* Custom HttpParameterCodec
|
|
915
919
|
* Workaround for https://github.com/angular/angular/issues/18261
|
|
916
920
|
*/
|
|
917
|
-
class CustomHttpParameterCodec {
|
|
921
|
+
class CustomHttpParameterCodec$1 {
|
|
918
922
|
encodeKey(k) {
|
|
919
923
|
return encodeURIComponent(k);
|
|
920
924
|
}
|
|
@@ -929,15 +933,15 @@ class CustomHttpParameterCodec {
|
|
|
929
933
|
}
|
|
930
934
|
}
|
|
931
935
|
|
|
932
|
-
const BASE_PATH = new InjectionToken('basePath');
|
|
933
|
-
const COLLECTION_FORMATS = {
|
|
936
|
+
const BASE_PATH$1 = new InjectionToken('basePath');
|
|
937
|
+
const COLLECTION_FORMATS$1 = {
|
|
934
938
|
'csv': ',',
|
|
935
939
|
'tsv': ' ',
|
|
936
940
|
'ssv': ' ',
|
|
937
941
|
'pipes': '|'
|
|
938
942
|
};
|
|
939
943
|
|
|
940
|
-
class Configuration {
|
|
944
|
+
class Configuration$1 {
|
|
941
945
|
constructor(configurationParameters = {}) {
|
|
942
946
|
this.apiKeys = configurationParameters.apiKeys;
|
|
943
947
|
this.username = configurationParameters.username;
|
|
@@ -1044,7 +1048,7 @@ class ViewService {
|
|
|
1044
1048
|
this.httpClient = httpClient;
|
|
1045
1049
|
this.basePath = 'http://localhost';
|
|
1046
1050
|
this.defaultHeaders = new HttpHeaders();
|
|
1047
|
-
this.configuration = new Configuration();
|
|
1051
|
+
this.configuration = new Configuration$1();
|
|
1048
1052
|
if (configuration) {
|
|
1049
1053
|
this.configuration = configuration;
|
|
1050
1054
|
}
|
|
@@ -1057,7 +1061,7 @@ class ViewService {
|
|
|
1057
1061
|
}
|
|
1058
1062
|
this.configuration.basePath = basePath;
|
|
1059
1063
|
}
|
|
1060
|
-
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
|
|
1064
|
+
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec$1();
|
|
1061
1065
|
}
|
|
1062
1066
|
/**
|
|
1063
1067
|
* @param consumes string[] mime-types
|
|
@@ -1834,7 +1838,7 @@ class ViewService {
|
|
|
1834
1838
|
});
|
|
1835
1839
|
}
|
|
1836
1840
|
else {
|
|
1837
|
-
localVarFormParams = localVarFormParams.append('contents', [...contents].join(COLLECTION_FORMATS['csv'])) || localVarFormParams;
|
|
1841
|
+
localVarFormParams = localVarFormParams.append('contents', [...contents].join(COLLECTION_FORMATS$1['csv'])) || localVarFormParams;
|
|
1838
1842
|
}
|
|
1839
1843
|
}
|
|
1840
1844
|
let responseType_ = 'json';
|
|
@@ -1861,7 +1865,7 @@ class ViewService {
|
|
|
1861
1865
|
});
|
|
1862
1866
|
}
|
|
1863
1867
|
}
|
|
1864
|
-
ViewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ViewService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH, optional: true }, { token: Configuration, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1868
|
+
ViewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ViewService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH$1, optional: true }, { token: Configuration$1, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1865
1869
|
ViewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ViewService, providedIn: 'root' });
|
|
1866
1870
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ViewService, decorators: [{
|
|
1867
1871
|
type: Injectable,
|
|
@@ -1873,8 +1877,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
1873
1877
|
type: Optional
|
|
1874
1878
|
}, {
|
|
1875
1879
|
type: Inject,
|
|
1876
|
-
args: [BASE_PATH]
|
|
1877
|
-
}] }, { type: Configuration, decorators: [{
|
|
1880
|
+
args: [BASE_PATH$1]
|
|
1881
|
+
}] }, { type: Configuration$1, decorators: [{
|
|
1878
1882
|
type: Optional
|
|
1879
1883
|
}] }];
|
|
1880
1884
|
} });
|
|
@@ -2094,7 +2098,7 @@ class ApiModule {
|
|
|
2094
2098
|
static forRoot(configurationFactory) {
|
|
2095
2099
|
return {
|
|
2096
2100
|
ngModule: ApiModule,
|
|
2097
|
-
providers: [{ provide: Configuration, useFactory: configurationFactory }]
|
|
2101
|
+
providers: [{ provide: Configuration$1, useFactory: configurationFactory }]
|
|
2098
2102
|
};
|
|
2099
2103
|
}
|
|
2100
2104
|
}
|
|
@@ -4456,56 +4460,1400 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
4456
4460
|
type: Input
|
|
4457
4461
|
}] } });
|
|
4458
4462
|
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
type: NgModule,
|
|
4478
|
-
args: [{
|
|
4479
|
-
declarations: [SmartFileUploaderComponent],
|
|
4480
|
-
imports: [
|
|
4481
|
-
BrowserModule,
|
|
4482
|
-
MatCommonModule,
|
|
4483
|
-
SmartSessionModule,
|
|
4484
|
-
SmartViewContextModule,
|
|
4485
|
-
SmartformModule,
|
|
4486
|
-
SmartExpandableSectionModule,
|
|
4487
|
-
],
|
|
4488
|
-
exports: [SmartSessionModule, SmartViewContextModule, SmartFileUploaderComponent],
|
|
4489
|
-
providers: [SmartNgClientService],
|
|
4490
|
-
}]
|
|
4491
|
-
}] });
|
|
4463
|
+
/**
|
|
4464
|
+
* Custom HttpParameterCodec
|
|
4465
|
+
* Workaround for https://github.com/angular/angular/issues/18261
|
|
4466
|
+
*/
|
|
4467
|
+
class CustomHttpParameterCodec {
|
|
4468
|
+
encodeKey(k) {
|
|
4469
|
+
return encodeURIComponent(k);
|
|
4470
|
+
}
|
|
4471
|
+
encodeValue(v) {
|
|
4472
|
+
return encodeURIComponent(v);
|
|
4473
|
+
}
|
|
4474
|
+
decodeKey(k) {
|
|
4475
|
+
return decodeURIComponent(k);
|
|
4476
|
+
}
|
|
4477
|
+
decodeValue(v) {
|
|
4478
|
+
return decodeURIComponent(v);
|
|
4479
|
+
}
|
|
4480
|
+
}
|
|
4492
4481
|
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4482
|
+
const BASE_PATH = new InjectionToken('basePath');
|
|
4483
|
+
const COLLECTION_FORMATS = {
|
|
4484
|
+
'csv': ',',
|
|
4485
|
+
'tsv': ' ',
|
|
4486
|
+
'ssv': ' ',
|
|
4487
|
+
'pipes': '|'
|
|
4488
|
+
};
|
|
4489
|
+
|
|
4490
|
+
class Configuration {
|
|
4491
|
+
constructor(configurationParameters = {}) {
|
|
4492
|
+
this.apiKeys = configurationParameters.apiKeys;
|
|
4493
|
+
this.username = configurationParameters.username;
|
|
4494
|
+
this.password = configurationParameters.password;
|
|
4495
|
+
this.accessToken = configurationParameters.accessToken;
|
|
4496
|
+
this.basePath = configurationParameters.basePath;
|
|
4497
|
+
this.withCredentials = configurationParameters.withCredentials;
|
|
4498
|
+
this.encoder = configurationParameters.encoder;
|
|
4499
|
+
if (configurationParameters.encodeParam) {
|
|
4500
|
+
this.encodeParam = configurationParameters.encodeParam;
|
|
4501
|
+
}
|
|
4502
|
+
else {
|
|
4503
|
+
this.encodeParam = param => this.defaultEncodeParam(param);
|
|
4504
|
+
}
|
|
4505
|
+
if (configurationParameters.credentials) {
|
|
4506
|
+
this.credentials = configurationParameters.credentials;
|
|
4507
|
+
}
|
|
4508
|
+
else {
|
|
4509
|
+
this.credentials = {};
|
|
4510
|
+
}
|
|
4498
4511
|
}
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4512
|
+
/**
|
|
4513
|
+
* Select the correct content-type to use for a request.
|
|
4514
|
+
* Uses {@link Configuration#isJsonMime} to determine the correct content-type.
|
|
4515
|
+
* If no content type is found return the first found type if the contentTypes is not empty
|
|
4516
|
+
* @param contentTypes - the array of content types that are available for selection
|
|
4517
|
+
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
4518
|
+
*/
|
|
4519
|
+
selectHeaderContentType(contentTypes) {
|
|
4520
|
+
if (contentTypes.length === 0) {
|
|
4521
|
+
return undefined;
|
|
4522
|
+
}
|
|
4523
|
+
const type = contentTypes.find((x) => this.isJsonMime(x));
|
|
4524
|
+
if (type === undefined) {
|
|
4525
|
+
return contentTypes[0];
|
|
4526
|
+
}
|
|
4527
|
+
return type;
|
|
4502
4528
|
}
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4529
|
+
/**
|
|
4530
|
+
* Select the correct accept content-type to use for a request.
|
|
4531
|
+
* Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
|
|
4532
|
+
* If no content type is found return the first found type if the contentTypes is not empty
|
|
4533
|
+
* @param accepts - the array of content types that are available for selection.
|
|
4534
|
+
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
4535
|
+
*/
|
|
4536
|
+
selectHeaderAccept(accepts) {
|
|
4537
|
+
if (accepts.length === 0) {
|
|
4538
|
+
return undefined;
|
|
4539
|
+
}
|
|
4540
|
+
const type = accepts.find((x) => this.isJsonMime(x));
|
|
4541
|
+
if (type === undefined) {
|
|
4542
|
+
return accepts[0];
|
|
4543
|
+
}
|
|
4544
|
+
return type;
|
|
4545
|
+
}
|
|
4546
|
+
/**
|
|
4547
|
+
* Check if the given MIME is a JSON MIME.
|
|
4548
|
+
* JSON MIME examples:
|
|
4549
|
+
* application/json
|
|
4550
|
+
* application/json; charset=UTF8
|
|
4551
|
+
* APPLICATION/JSON
|
|
4552
|
+
* application/vnd.company+json
|
|
4553
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
4554
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
4555
|
+
*/
|
|
4556
|
+
isJsonMime(mime) {
|
|
4557
|
+
const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
4558
|
+
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
4559
|
+
}
|
|
4560
|
+
lookupCredential(key) {
|
|
4561
|
+
const value = this.credentials[key];
|
|
4562
|
+
return typeof value === 'function'
|
|
4563
|
+
? value()
|
|
4564
|
+
: value;
|
|
4565
|
+
}
|
|
4566
|
+
defaultEncodeParam(param) {
|
|
4567
|
+
// This implementation exists as fallback for missing configuration
|
|
4568
|
+
// and for backwards compatibility to older typescript-angular generator versions.
|
|
4569
|
+
// It only works for the 'simple' parameter style.
|
|
4570
|
+
// Date-handling only works for the 'date-time' format.
|
|
4571
|
+
// All other styles and Date-formats are probably handled incorrectly.
|
|
4572
|
+
//
|
|
4573
|
+
// But: if that's all you need (i.e.: the most common use-case): no need for customization!
|
|
4574
|
+
const value = param.dataFormat === 'date-time'
|
|
4575
|
+
? param.value.toISOString()
|
|
4576
|
+
: param.value;
|
|
4577
|
+
return encodeURIComponent(String(value));
|
|
4578
|
+
}
|
|
4579
|
+
}
|
|
4580
|
+
|
|
4581
|
+
/**
|
|
4582
|
+
* UiTree domain objects
|
|
4583
|
+
* Tree domain objects
|
|
4584
|
+
*
|
|
4585
|
+
* The version of the OpenAPI document: 1.0.0
|
|
4586
|
+
* Contact: info@it4all.hu
|
|
4587
|
+
*
|
|
4588
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
4589
|
+
* https://openapi-generator.tech
|
|
4590
|
+
* Do not edit the class manually.
|
|
4591
|
+
*/
|
|
4592
|
+
class TreeService {
|
|
4593
|
+
constructor(httpClient, basePath, configuration) {
|
|
4594
|
+
this.httpClient = httpClient;
|
|
4595
|
+
this.basePath = 'http://localhost';
|
|
4596
|
+
this.defaultHeaders = new HttpHeaders();
|
|
4597
|
+
this.configuration = new Configuration();
|
|
4598
|
+
if (configuration) {
|
|
4599
|
+
this.configuration = configuration;
|
|
4600
|
+
}
|
|
4601
|
+
if (typeof this.configuration.basePath !== 'string') {
|
|
4602
|
+
if (Array.isArray(basePath) && basePath.length > 0) {
|
|
4603
|
+
basePath = basePath[0];
|
|
4604
|
+
}
|
|
4605
|
+
if (typeof basePath !== 'string') {
|
|
4606
|
+
basePath = this.basePath;
|
|
4607
|
+
}
|
|
4608
|
+
this.configuration.basePath = basePath;
|
|
4609
|
+
}
|
|
4610
|
+
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
|
|
4611
|
+
}
|
|
4612
|
+
// @ts-ignore
|
|
4613
|
+
addToHttpParams(httpParams, value, key) {
|
|
4614
|
+
if (typeof value === 'object' && value instanceof Date === false) {
|
|
4615
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value);
|
|
4616
|
+
}
|
|
4617
|
+
else {
|
|
4618
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
|
|
4619
|
+
}
|
|
4620
|
+
return httpParams;
|
|
4621
|
+
}
|
|
4622
|
+
addToHttpParamsRecursive(httpParams, value, key) {
|
|
4623
|
+
if (value == null) {
|
|
4624
|
+
return httpParams;
|
|
4625
|
+
}
|
|
4626
|
+
if (typeof value === 'object') {
|
|
4627
|
+
if (Array.isArray(value)) {
|
|
4628
|
+
value.forEach((elem) => (httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)));
|
|
4629
|
+
}
|
|
4630
|
+
else if (value instanceof Date) {
|
|
4631
|
+
if (key != null) {
|
|
4632
|
+
httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
|
|
4633
|
+
}
|
|
4634
|
+
else {
|
|
4635
|
+
throw Error('key may not be null if value is Date');
|
|
4636
|
+
}
|
|
4637
|
+
}
|
|
4638
|
+
else {
|
|
4639
|
+
Object.keys(value).forEach((k) => (httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k)));
|
|
4640
|
+
}
|
|
4641
|
+
}
|
|
4642
|
+
else if (key != null) {
|
|
4643
|
+
httpParams = httpParams.append(key, value);
|
|
4644
|
+
}
|
|
4645
|
+
else {
|
|
4646
|
+
throw Error('key may not be null if value is not object or array');
|
|
4647
|
+
}
|
|
4648
|
+
return httpParams;
|
|
4649
|
+
}
|
|
4650
|
+
collapseNode(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
|
|
4651
|
+
if (viewUuid === null || viewUuid === undefined) {
|
|
4652
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling collapseNode.');
|
|
4653
|
+
}
|
|
4654
|
+
if (treeId === null || treeId === undefined) {
|
|
4655
|
+
throw new Error('Required parameter treeId was null or undefined when calling collapseNode.');
|
|
4656
|
+
}
|
|
4657
|
+
if (nodeId === null || nodeId === undefined) {
|
|
4658
|
+
throw new Error('Required parameter nodeId was null or undefined when calling collapseNode.');
|
|
4659
|
+
}
|
|
4660
|
+
let localVarHeaders = this.defaultHeaders;
|
|
4661
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
4662
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
4663
|
+
// to determine the Accept header
|
|
4664
|
+
const httpHeaderAccepts = ['application/json'];
|
|
4665
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
4666
|
+
}
|
|
4667
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
4668
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
4669
|
+
}
|
|
4670
|
+
let localVarHttpContext = options && options.context;
|
|
4671
|
+
if (localVarHttpContext === undefined) {
|
|
4672
|
+
localVarHttpContext = new HttpContext();
|
|
4673
|
+
}
|
|
4674
|
+
let responseType_ = 'json';
|
|
4675
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
4676
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
4677
|
+
responseType_ = 'text';
|
|
4678
|
+
}
|
|
4679
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
4680
|
+
responseType_ = 'json';
|
|
4681
|
+
}
|
|
4682
|
+
else {
|
|
4683
|
+
responseType_ = 'blob';
|
|
4684
|
+
}
|
|
4685
|
+
}
|
|
4686
|
+
let localVarPath = `/tree/${this.configuration.encodeParam({
|
|
4687
|
+
name: 'viewUuid',
|
|
4688
|
+
value: viewUuid,
|
|
4689
|
+
in: 'path',
|
|
4690
|
+
style: 'simple',
|
|
4691
|
+
explode: false,
|
|
4692
|
+
dataType: 'string',
|
|
4693
|
+
dataFormat: 'uuid',
|
|
4694
|
+
})}/${this.configuration.encodeParam({
|
|
4695
|
+
name: 'treeId',
|
|
4696
|
+
value: treeId,
|
|
4697
|
+
in: 'path',
|
|
4698
|
+
style: 'simple',
|
|
4699
|
+
explode: false,
|
|
4700
|
+
dataType: 'string',
|
|
4701
|
+
dataFormat: undefined,
|
|
4702
|
+
})}/${this.configuration.encodeParam({
|
|
4703
|
+
name: 'nodeId',
|
|
4704
|
+
value: nodeId,
|
|
4705
|
+
in: 'path',
|
|
4706
|
+
style: 'simple',
|
|
4707
|
+
explode: false,
|
|
4708
|
+
dataType: 'string',
|
|
4709
|
+
dataFormat: undefined,
|
|
4710
|
+
})}/collapse`;
|
|
4711
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
4712
|
+
context: localVarHttpContext,
|
|
4713
|
+
responseType: responseType_,
|
|
4714
|
+
withCredentials: this.configuration.withCredentials,
|
|
4715
|
+
headers: localVarHeaders,
|
|
4716
|
+
observe: observe,
|
|
4717
|
+
reportProgress: reportProgress,
|
|
4718
|
+
});
|
|
4719
|
+
}
|
|
4720
|
+
expandNode(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
|
|
4721
|
+
if (viewUuid === null || viewUuid === undefined) {
|
|
4722
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling expandNode.');
|
|
4723
|
+
}
|
|
4724
|
+
if (treeId === null || treeId === undefined) {
|
|
4725
|
+
throw new Error('Required parameter treeId was null or undefined when calling expandNode.');
|
|
4726
|
+
}
|
|
4727
|
+
if (nodeId === null || nodeId === undefined) {
|
|
4728
|
+
throw new Error('Required parameter nodeId was null or undefined when calling expandNode.');
|
|
4729
|
+
}
|
|
4730
|
+
let localVarHeaders = this.defaultHeaders;
|
|
4731
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
4732
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
4733
|
+
// to determine the Accept header
|
|
4734
|
+
const httpHeaderAccepts = ['application/json'];
|
|
4735
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
4736
|
+
}
|
|
4737
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
4738
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
4739
|
+
}
|
|
4740
|
+
let localVarHttpContext = options && options.context;
|
|
4741
|
+
if (localVarHttpContext === undefined) {
|
|
4742
|
+
localVarHttpContext = new HttpContext();
|
|
4743
|
+
}
|
|
4744
|
+
let responseType_ = 'json';
|
|
4745
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
4746
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
4747
|
+
responseType_ = 'text';
|
|
4748
|
+
}
|
|
4749
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
4750
|
+
responseType_ = 'json';
|
|
4751
|
+
}
|
|
4752
|
+
else {
|
|
4753
|
+
responseType_ = 'blob';
|
|
4754
|
+
}
|
|
4755
|
+
}
|
|
4756
|
+
let localVarPath = `/tree/${this.configuration.encodeParam({
|
|
4757
|
+
name: 'viewUuid',
|
|
4758
|
+
value: viewUuid,
|
|
4759
|
+
in: 'path',
|
|
4760
|
+
style: 'simple',
|
|
4761
|
+
explode: false,
|
|
4762
|
+
dataType: 'string',
|
|
4763
|
+
dataFormat: 'uuid',
|
|
4764
|
+
})}/${this.configuration.encodeParam({
|
|
4765
|
+
name: 'treeId',
|
|
4766
|
+
value: treeId,
|
|
4767
|
+
in: 'path',
|
|
4768
|
+
style: 'simple',
|
|
4769
|
+
explode: false,
|
|
4770
|
+
dataType: 'string',
|
|
4771
|
+
dataFormat: undefined,
|
|
4772
|
+
})}/${this.configuration.encodeParam({
|
|
4773
|
+
name: 'nodeId',
|
|
4774
|
+
value: nodeId,
|
|
4775
|
+
in: 'path',
|
|
4776
|
+
style: 'simple',
|
|
4777
|
+
explode: false,
|
|
4778
|
+
dataType: 'string',
|
|
4779
|
+
dataFormat: undefined,
|
|
4780
|
+
})}/expand`;
|
|
4781
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
4782
|
+
context: localVarHttpContext,
|
|
4783
|
+
responseType: responseType_,
|
|
4784
|
+
withCredentials: this.configuration.withCredentials,
|
|
4785
|
+
headers: localVarHeaders,
|
|
4786
|
+
observe: observe,
|
|
4787
|
+
reportProgress: reportProgress,
|
|
4788
|
+
});
|
|
4789
|
+
}
|
|
4790
|
+
getChildrenNodes(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
|
|
4791
|
+
if (viewUuid === null || viewUuid === undefined) {
|
|
4792
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling getChildrenNodes.');
|
|
4793
|
+
}
|
|
4794
|
+
if (treeId === null || treeId === undefined) {
|
|
4795
|
+
throw new Error('Required parameter treeId was null or undefined when calling getChildrenNodes.');
|
|
4796
|
+
}
|
|
4797
|
+
if (nodeId === null || nodeId === undefined) {
|
|
4798
|
+
throw new Error('Required parameter nodeId was null or undefined when calling getChildrenNodes.');
|
|
4799
|
+
}
|
|
4800
|
+
let localVarHeaders = this.defaultHeaders;
|
|
4801
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
4802
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
4803
|
+
// to determine the Accept header
|
|
4804
|
+
const httpHeaderAccepts = ['application/json'];
|
|
4805
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
4806
|
+
}
|
|
4807
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
4808
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
4809
|
+
}
|
|
4810
|
+
let localVarHttpContext = options && options.context;
|
|
4811
|
+
if (localVarHttpContext === undefined) {
|
|
4812
|
+
localVarHttpContext = new HttpContext();
|
|
4813
|
+
}
|
|
4814
|
+
let responseType_ = 'json';
|
|
4815
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
4816
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
4817
|
+
responseType_ = 'text';
|
|
4818
|
+
}
|
|
4819
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
4820
|
+
responseType_ = 'json';
|
|
4821
|
+
}
|
|
4822
|
+
else {
|
|
4823
|
+
responseType_ = 'blob';
|
|
4824
|
+
}
|
|
4825
|
+
}
|
|
4826
|
+
let localVarPath = `/tree/${this.configuration.encodeParam({
|
|
4827
|
+
name: 'viewUuid',
|
|
4828
|
+
value: viewUuid,
|
|
4829
|
+
in: 'path',
|
|
4830
|
+
style: 'simple',
|
|
4831
|
+
explode: false,
|
|
4832
|
+
dataType: 'string',
|
|
4833
|
+
dataFormat: 'uuid',
|
|
4834
|
+
})}/${this.configuration.encodeParam({
|
|
4835
|
+
name: 'treeId',
|
|
4836
|
+
value: treeId,
|
|
4837
|
+
in: 'path',
|
|
4838
|
+
style: 'simple',
|
|
4839
|
+
explode: false,
|
|
4840
|
+
dataType: 'string',
|
|
4841
|
+
dataFormat: undefined,
|
|
4842
|
+
})}/${this.configuration.encodeParam({
|
|
4843
|
+
name: 'nodeId',
|
|
4844
|
+
value: nodeId,
|
|
4845
|
+
in: 'path',
|
|
4846
|
+
style: 'simple',
|
|
4847
|
+
explode: false,
|
|
4848
|
+
dataType: 'string',
|
|
4849
|
+
dataFormat: undefined,
|
|
4850
|
+
})}`;
|
|
4851
|
+
return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
|
|
4852
|
+
context: localVarHttpContext,
|
|
4853
|
+
responseType: responseType_,
|
|
4854
|
+
withCredentials: this.configuration.withCredentials,
|
|
4855
|
+
headers: localVarHeaders,
|
|
4856
|
+
observe: observe,
|
|
4857
|
+
reportProgress: reportProgress,
|
|
4858
|
+
});
|
|
4859
|
+
}
|
|
4860
|
+
getMainActions(viewUuid, treeId, observe = 'body', reportProgress = false, options) {
|
|
4861
|
+
if (viewUuid === null || viewUuid === undefined) {
|
|
4862
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling getMainActions.');
|
|
4863
|
+
}
|
|
4864
|
+
if (treeId === null || treeId === undefined) {
|
|
4865
|
+
throw new Error('Required parameter treeId was null or undefined when calling getMainActions.');
|
|
4866
|
+
}
|
|
4867
|
+
let localVarHeaders = this.defaultHeaders;
|
|
4868
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
4869
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
4870
|
+
// to determine the Accept header
|
|
4871
|
+
const httpHeaderAccepts = ['application/json'];
|
|
4872
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
4873
|
+
}
|
|
4874
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
4875
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
4876
|
+
}
|
|
4877
|
+
let localVarHttpContext = options && options.context;
|
|
4878
|
+
if (localVarHttpContext === undefined) {
|
|
4879
|
+
localVarHttpContext = new HttpContext();
|
|
4880
|
+
}
|
|
4881
|
+
let responseType_ = 'json';
|
|
4882
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
4883
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
4884
|
+
responseType_ = 'text';
|
|
4885
|
+
}
|
|
4886
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
4887
|
+
responseType_ = 'json';
|
|
4888
|
+
}
|
|
4889
|
+
else {
|
|
4890
|
+
responseType_ = 'blob';
|
|
4891
|
+
}
|
|
4892
|
+
}
|
|
4893
|
+
let localVarPath = `/tree/${this.configuration.encodeParam({
|
|
4894
|
+
name: 'viewUuid',
|
|
4895
|
+
value: viewUuid,
|
|
4896
|
+
in: 'path',
|
|
4897
|
+
style: 'simple',
|
|
4898
|
+
explode: false,
|
|
4899
|
+
dataType: 'string',
|
|
4900
|
+
dataFormat: 'uuid',
|
|
4901
|
+
})}/${this.configuration.encodeParam({
|
|
4902
|
+
name: 'treeId',
|
|
4903
|
+
value: treeId,
|
|
4904
|
+
in: 'path',
|
|
4905
|
+
style: 'simple',
|
|
4906
|
+
explode: false,
|
|
4907
|
+
dataType: 'string',
|
|
4908
|
+
dataFormat: undefined,
|
|
4909
|
+
})}/action`;
|
|
4910
|
+
return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
|
|
4911
|
+
context: localVarHttpContext,
|
|
4912
|
+
responseType: responseType_,
|
|
4913
|
+
withCredentials: this.configuration.withCredentials,
|
|
4914
|
+
headers: localVarHeaders,
|
|
4915
|
+
observe: observe,
|
|
4916
|
+
reportProgress: reportProgress,
|
|
4917
|
+
});
|
|
4918
|
+
}
|
|
4919
|
+
getRootNodes(viewUuid, treeId, observe = 'body', reportProgress = false, options) {
|
|
4920
|
+
if (viewUuid === null || viewUuid === undefined) {
|
|
4921
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling getRootNodes.');
|
|
4922
|
+
}
|
|
4923
|
+
if (treeId === null || treeId === undefined) {
|
|
4924
|
+
throw new Error('Required parameter treeId was null or undefined when calling getRootNodes.');
|
|
4925
|
+
}
|
|
4926
|
+
let localVarHeaders = this.defaultHeaders;
|
|
4927
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
4928
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
4929
|
+
// to determine the Accept header
|
|
4930
|
+
const httpHeaderAccepts = ['application/json'];
|
|
4931
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
4932
|
+
}
|
|
4933
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
4934
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
4935
|
+
}
|
|
4936
|
+
let localVarHttpContext = options && options.context;
|
|
4937
|
+
if (localVarHttpContext === undefined) {
|
|
4938
|
+
localVarHttpContext = new HttpContext();
|
|
4939
|
+
}
|
|
4940
|
+
let responseType_ = 'json';
|
|
4941
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
4942
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
4943
|
+
responseType_ = 'text';
|
|
4944
|
+
}
|
|
4945
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
4946
|
+
responseType_ = 'json';
|
|
4947
|
+
}
|
|
4948
|
+
else {
|
|
4949
|
+
responseType_ = 'blob';
|
|
4950
|
+
}
|
|
4951
|
+
}
|
|
4952
|
+
let localVarPath = `/tree/${this.configuration.encodeParam({
|
|
4953
|
+
name: 'viewUuid',
|
|
4954
|
+
value: viewUuid,
|
|
4955
|
+
in: 'path',
|
|
4956
|
+
style: 'simple',
|
|
4957
|
+
explode: false,
|
|
4958
|
+
dataType: 'string',
|
|
4959
|
+
dataFormat: 'uuid',
|
|
4960
|
+
})}/${this.configuration.encodeParam({
|
|
4961
|
+
name: 'treeId',
|
|
4962
|
+
value: treeId,
|
|
4963
|
+
in: 'path',
|
|
4964
|
+
style: 'simple',
|
|
4965
|
+
explode: false,
|
|
4966
|
+
dataType: 'string',
|
|
4967
|
+
dataFormat: undefined,
|
|
4968
|
+
})}`;
|
|
4969
|
+
return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
|
|
4970
|
+
context: localVarHttpContext,
|
|
4971
|
+
responseType: responseType_,
|
|
4972
|
+
withCredentials: this.configuration.withCredentials,
|
|
4973
|
+
headers: localVarHeaders,
|
|
4974
|
+
observe: observe,
|
|
4975
|
+
reportProgress: reportProgress,
|
|
4976
|
+
});
|
|
4977
|
+
}
|
|
4978
|
+
performAction(viewUuid, treeId, nodeId, body, observe = 'body', reportProgress = false, options) {
|
|
4979
|
+
if (viewUuid === null || viewUuid === undefined) {
|
|
4980
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling performAction.');
|
|
4981
|
+
}
|
|
4982
|
+
if (treeId === null || treeId === undefined) {
|
|
4983
|
+
throw new Error('Required parameter treeId was null or undefined when calling performAction.');
|
|
4984
|
+
}
|
|
4985
|
+
if (nodeId === null || nodeId === undefined) {
|
|
4986
|
+
throw new Error('Required parameter nodeId was null or undefined when calling performAction.');
|
|
4987
|
+
}
|
|
4988
|
+
if (body === null || body === undefined) {
|
|
4989
|
+
throw new Error('Required parameter body was null or undefined when calling performAction.');
|
|
4990
|
+
}
|
|
4991
|
+
let localVarHeaders = this.defaultHeaders;
|
|
4992
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
4993
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
4994
|
+
// to determine the Accept header
|
|
4995
|
+
const httpHeaderAccepts = ['application/json'];
|
|
4996
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
4997
|
+
}
|
|
4998
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
4999
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
5000
|
+
}
|
|
5001
|
+
let localVarHttpContext = options && options.context;
|
|
5002
|
+
if (localVarHttpContext === undefined) {
|
|
5003
|
+
localVarHttpContext = new HttpContext();
|
|
5004
|
+
}
|
|
5005
|
+
// to determine the Content-Type header
|
|
5006
|
+
const consumes = ['application/json'];
|
|
5007
|
+
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
5008
|
+
if (httpContentTypeSelected !== undefined) {
|
|
5009
|
+
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
5010
|
+
}
|
|
5011
|
+
let responseType_ = 'json';
|
|
5012
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
5013
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
5014
|
+
responseType_ = 'text';
|
|
5015
|
+
}
|
|
5016
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
5017
|
+
responseType_ = 'json';
|
|
5018
|
+
}
|
|
5019
|
+
else {
|
|
5020
|
+
responseType_ = 'blob';
|
|
5021
|
+
}
|
|
5022
|
+
}
|
|
5023
|
+
let localVarPath = `/tree/${this.configuration.encodeParam({
|
|
5024
|
+
name: 'viewUuid',
|
|
5025
|
+
value: viewUuid,
|
|
5026
|
+
in: 'path',
|
|
5027
|
+
style: 'simple',
|
|
5028
|
+
explode: false,
|
|
5029
|
+
dataType: 'string',
|
|
5030
|
+
dataFormat: 'uuid',
|
|
5031
|
+
})}/${this.configuration.encodeParam({
|
|
5032
|
+
name: 'treeId',
|
|
5033
|
+
value: treeId,
|
|
5034
|
+
in: 'path',
|
|
5035
|
+
style: 'simple',
|
|
5036
|
+
explode: false,
|
|
5037
|
+
dataType: 'string',
|
|
5038
|
+
dataFormat: undefined,
|
|
5039
|
+
})}/${this.configuration.encodeParam({
|
|
5040
|
+
name: 'nodeId',
|
|
5041
|
+
value: nodeId,
|
|
5042
|
+
in: 'path',
|
|
5043
|
+
style: 'simple',
|
|
5044
|
+
explode: false,
|
|
5045
|
+
dataType: 'string',
|
|
5046
|
+
dataFormat: undefined,
|
|
5047
|
+
})}/action`;
|
|
5048
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
5049
|
+
context: localVarHttpContext,
|
|
5050
|
+
body: body,
|
|
5051
|
+
responseType: responseType_,
|
|
5052
|
+
withCredentials: this.configuration.withCredentials,
|
|
5053
|
+
headers: localVarHeaders,
|
|
5054
|
+
observe: observe,
|
|
5055
|
+
reportProgress: reportProgress,
|
|
5056
|
+
});
|
|
5057
|
+
}
|
|
5058
|
+
performMainAction(viewUuid, treeId, body, observe = 'body', reportProgress = false, options) {
|
|
5059
|
+
if (viewUuid === null || viewUuid === undefined) {
|
|
5060
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling performMainAction.');
|
|
5061
|
+
}
|
|
5062
|
+
if (treeId === null || treeId === undefined) {
|
|
5063
|
+
throw new Error('Required parameter treeId was null or undefined when calling performMainAction.');
|
|
5064
|
+
}
|
|
5065
|
+
if (body === null || body === undefined) {
|
|
5066
|
+
throw new Error('Required parameter body was null or undefined when calling performMainAction.');
|
|
5067
|
+
}
|
|
5068
|
+
let localVarHeaders = this.defaultHeaders;
|
|
5069
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
5070
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
5071
|
+
// to determine the Accept header
|
|
5072
|
+
const httpHeaderAccepts = ['application/json'];
|
|
5073
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
5074
|
+
}
|
|
5075
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
5076
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
5077
|
+
}
|
|
5078
|
+
let localVarHttpContext = options && options.context;
|
|
5079
|
+
if (localVarHttpContext === undefined) {
|
|
5080
|
+
localVarHttpContext = new HttpContext();
|
|
5081
|
+
}
|
|
5082
|
+
// to determine the Content-Type header
|
|
5083
|
+
const consumes = ['application/json'];
|
|
5084
|
+
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
5085
|
+
if (httpContentTypeSelected !== undefined) {
|
|
5086
|
+
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
5087
|
+
}
|
|
5088
|
+
let responseType_ = 'json';
|
|
5089
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
5090
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
5091
|
+
responseType_ = 'text';
|
|
5092
|
+
}
|
|
5093
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
5094
|
+
responseType_ = 'json';
|
|
5095
|
+
}
|
|
5096
|
+
else {
|
|
5097
|
+
responseType_ = 'blob';
|
|
5098
|
+
}
|
|
5099
|
+
}
|
|
5100
|
+
let localVarPath = `/tree/${this.configuration.encodeParam({
|
|
5101
|
+
name: 'viewUuid',
|
|
5102
|
+
value: viewUuid,
|
|
5103
|
+
in: 'path',
|
|
5104
|
+
style: 'simple',
|
|
5105
|
+
explode: false,
|
|
5106
|
+
dataType: 'string',
|
|
5107
|
+
dataFormat: 'uuid',
|
|
5108
|
+
})}/${this.configuration.encodeParam({
|
|
5109
|
+
name: 'treeId',
|
|
5110
|
+
value: treeId,
|
|
5111
|
+
in: 'path',
|
|
5112
|
+
style: 'simple',
|
|
5113
|
+
explode: false,
|
|
5114
|
+
dataType: 'string',
|
|
5115
|
+
dataFormat: undefined,
|
|
5116
|
+
})}/action`;
|
|
5117
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
5118
|
+
context: localVarHttpContext,
|
|
5119
|
+
body: body,
|
|
5120
|
+
responseType: responseType_,
|
|
5121
|
+
withCredentials: this.configuration.withCredentials,
|
|
5122
|
+
headers: localVarHeaders,
|
|
5123
|
+
observe: observe,
|
|
5124
|
+
reportProgress: reportProgress,
|
|
5125
|
+
});
|
|
5126
|
+
}
|
|
5127
|
+
selectNode(viewUuid, treeId, nodeId, observe = 'body', reportProgress = false, options) {
|
|
5128
|
+
if (viewUuid === null || viewUuid === undefined) {
|
|
5129
|
+
throw new Error('Required parameter viewUuid was null or undefined when calling selectNode.');
|
|
5130
|
+
}
|
|
5131
|
+
if (treeId === null || treeId === undefined) {
|
|
5132
|
+
throw new Error('Required parameter treeId was null or undefined when calling selectNode.');
|
|
5133
|
+
}
|
|
5134
|
+
if (nodeId === null || nodeId === undefined) {
|
|
5135
|
+
throw new Error('Required parameter nodeId was null or undefined when calling selectNode.');
|
|
5136
|
+
}
|
|
5137
|
+
let localVarHeaders = this.defaultHeaders;
|
|
5138
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
5139
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
5140
|
+
// to determine the Accept header
|
|
5141
|
+
const httpHeaderAccepts = ['application/json'];
|
|
5142
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
5143
|
+
}
|
|
5144
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
5145
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
5146
|
+
}
|
|
5147
|
+
let localVarHttpContext = options && options.context;
|
|
5148
|
+
if (localVarHttpContext === undefined) {
|
|
5149
|
+
localVarHttpContext = new HttpContext();
|
|
5150
|
+
}
|
|
5151
|
+
let responseType_ = 'json';
|
|
5152
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
5153
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
5154
|
+
responseType_ = 'text';
|
|
5155
|
+
}
|
|
5156
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
5157
|
+
responseType_ = 'json';
|
|
5158
|
+
}
|
|
5159
|
+
else {
|
|
5160
|
+
responseType_ = 'blob';
|
|
5161
|
+
}
|
|
5162
|
+
}
|
|
5163
|
+
let localVarPath = `/tree/${this.configuration.encodeParam({
|
|
5164
|
+
name: 'viewUuid',
|
|
5165
|
+
value: viewUuid,
|
|
5166
|
+
in: 'path',
|
|
5167
|
+
style: 'simple',
|
|
5168
|
+
explode: false,
|
|
5169
|
+
dataType: 'string',
|
|
5170
|
+
dataFormat: 'uuid',
|
|
5171
|
+
})}/${this.configuration.encodeParam({
|
|
5172
|
+
name: 'treeId',
|
|
5173
|
+
value: treeId,
|
|
5174
|
+
in: 'path',
|
|
5175
|
+
style: 'simple',
|
|
5176
|
+
explode: false,
|
|
5177
|
+
dataType: 'string',
|
|
5178
|
+
dataFormat: undefined,
|
|
5179
|
+
})}/${this.configuration.encodeParam({
|
|
5180
|
+
name: 'nodeId',
|
|
5181
|
+
value: nodeId,
|
|
5182
|
+
in: 'path',
|
|
5183
|
+
style: 'simple',
|
|
5184
|
+
explode: false,
|
|
5185
|
+
dataType: 'string',
|
|
5186
|
+
dataFormat: undefined,
|
|
5187
|
+
})}/select`;
|
|
5188
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
5189
|
+
context: localVarHttpContext,
|
|
5190
|
+
responseType: responseType_,
|
|
5191
|
+
withCredentials: this.configuration.withCredentials,
|
|
5192
|
+
headers: localVarHeaders,
|
|
5193
|
+
observe: observe,
|
|
5194
|
+
reportProgress: reportProgress,
|
|
5195
|
+
});
|
|
5196
|
+
}
|
|
5197
|
+
}
|
|
5198
|
+
TreeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TreeService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH, optional: true }, { token: Configuration, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5199
|
+
TreeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TreeService, providedIn: 'root' });
|
|
5200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TreeService, decorators: [{
|
|
5201
|
+
type: Injectable,
|
|
5202
|
+
args: [{
|
|
5203
|
+
providedIn: 'root',
|
|
5204
|
+
}]
|
|
5205
|
+
}], ctorParameters: function () {
|
|
5206
|
+
return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
5207
|
+
type: Optional
|
|
5208
|
+
}, {
|
|
5209
|
+
type: Inject,
|
|
5210
|
+
args: [BASE_PATH]
|
|
5211
|
+
}] }, { type: Configuration, decorators: [{
|
|
5212
|
+
type: Optional
|
|
5213
|
+
}] }];
|
|
5214
|
+
} });
|
|
5215
|
+
|
|
5216
|
+
var SmartTreeNodeButtonType;
|
|
5217
|
+
(function (SmartTreeNodeButtonType) {
|
|
5218
|
+
SmartTreeNodeButtonType["MENU"] = "MENU";
|
|
5219
|
+
SmartTreeNodeButtonType["ICON"] = "ICON";
|
|
5220
|
+
SmartTreeNodeButtonType["NORMAL"] = "NORMAL";
|
|
5221
|
+
})(SmartTreeNodeButtonType || (SmartTreeNodeButtonType = {}));
|
|
5222
|
+
|
|
5223
|
+
class SmarttreeService {
|
|
5224
|
+
constructor() {
|
|
5225
|
+
this.errorMessage = 'The tree is currently unavailable';
|
|
5226
|
+
this.smartTreeModelChanged = new Subject();
|
|
5227
|
+
this.uiActionModelsChanged = new Subject();
|
|
5228
|
+
}
|
|
5229
|
+
get uiActionModels() {
|
|
5230
|
+
return this._uiActionModels;
|
|
5231
|
+
}
|
|
5232
|
+
set uiActionModels(uiActionModels) {
|
|
5233
|
+
this._uiActionModels = uiActionModels;
|
|
5234
|
+
this.uiActionModelsChanged.next();
|
|
5235
|
+
}
|
|
5236
|
+
initialize() {
|
|
5237
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5238
|
+
yield this.downloadTree().then((rootNodes) => {
|
|
5239
|
+
this.treeFromBackend = rootNodes;
|
|
5240
|
+
this.syncTree();
|
|
5241
|
+
});
|
|
5242
|
+
});
|
|
5243
|
+
}
|
|
5244
|
+
downloadTree() {
|
|
5245
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5246
|
+
throw new Error('downloadTree method not implemented.');
|
|
5247
|
+
});
|
|
5248
|
+
}
|
|
5249
|
+
downloadChildren(parentNode) {
|
|
5250
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5251
|
+
throw new Error('downloadChildren method not implemented.');
|
|
5252
|
+
});
|
|
5253
|
+
}
|
|
5254
|
+
onTreeNodeClick(treeNode) {
|
|
5255
|
+
throw new Error('onTreeNodeClick method not implemented.');
|
|
5256
|
+
}
|
|
5257
|
+
onTreeNodeOpen(treeNode) {
|
|
5258
|
+
throw new Error('onTreeNodeOpen method not implemented.');
|
|
5259
|
+
}
|
|
5260
|
+
syncTree() {
|
|
5261
|
+
throw new Error('syncTree method not implemented.');
|
|
5262
|
+
}
|
|
5263
|
+
}
|
|
5264
|
+
SmarttreeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5265
|
+
SmarttreeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeService, providedIn: 'root' });
|
|
5266
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeService, decorators: [{
|
|
5267
|
+
type: Injectable,
|
|
5268
|
+
args: [{
|
|
5269
|
+
providedIn: 'root',
|
|
5270
|
+
}]
|
|
5271
|
+
}], ctorParameters: function () { return []; } });
|
|
5272
|
+
|
|
5273
|
+
class SmarttreeGenericService extends SmarttreeService {
|
|
5274
|
+
constructor(inject, pageName, treeId) {
|
|
5275
|
+
super();
|
|
5276
|
+
this.pageName = pageName;
|
|
5277
|
+
this.treeId = treeId;
|
|
5278
|
+
// UseUiAction properties
|
|
5279
|
+
this.submit = new Subject();
|
|
5280
|
+
this.reSubscribeToChange = new Subject();
|
|
5281
|
+
this.uiActionDescriptors = new Map();
|
|
5282
|
+
this.viewContextName = 'viewContextUuid';
|
|
5283
|
+
this.configureTree({
|
|
5284
|
+
pageName: this.pageName,
|
|
5285
|
+
treeid: this.treeId,
|
|
5286
|
+
viewContextName: this.viewContextName,
|
|
5287
|
+
});
|
|
5288
|
+
this.viewContext = inject.get(SmartViewContextService);
|
|
5289
|
+
this.service = inject.get(TreeService);
|
|
5290
|
+
this.uiActionService = inject.get(UiActionService);
|
|
5291
|
+
this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
|
|
5292
|
+
this.initialize();
|
|
5293
|
+
}
|
|
5294
|
+
constructUiActionModels(uiActions) {
|
|
5295
|
+
this.uiActionModels = uiActions.map((uiAction) => {
|
|
5296
|
+
return {
|
|
5297
|
+
serviceToUse: this,
|
|
5298
|
+
uiAction,
|
|
5299
|
+
};
|
|
5300
|
+
});
|
|
5301
|
+
}
|
|
5302
|
+
configureTree(configuration) {
|
|
5303
|
+
this.treeId = configuration.treeid;
|
|
5304
|
+
this.viewContextName = configuration.viewContextName;
|
|
5305
|
+
this.pageName = configuration.pageName;
|
|
5306
|
+
}
|
|
5307
|
+
initialize() {
|
|
5308
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5309
|
+
if (sessionStorage.getItem(this.viewContextName)) {
|
|
5310
|
+
yield this.downloadTree().then((rootNodes) => {
|
|
5311
|
+
this.treeFromBackend = rootNodes;
|
|
5312
|
+
this.syncTree();
|
|
5313
|
+
});
|
|
5314
|
+
}
|
|
5315
|
+
});
|
|
5316
|
+
}
|
|
5317
|
+
downloadTree() {
|
|
5318
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5319
|
+
let uuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
5320
|
+
const rootNodes = yield this.service.getRootNodes(uuid, this.treeId).toPromise();
|
|
5321
|
+
const uiActions = yield this.service.getMainActions(uuid, this.treeId).toPromise();
|
|
5322
|
+
if (uiActions) {
|
|
5323
|
+
this.constructUiActionModels(uiActions);
|
|
5324
|
+
}
|
|
5325
|
+
if (!rootNodes) {
|
|
5326
|
+
throw new Error('RootNodes are undefined!');
|
|
5327
|
+
}
|
|
5328
|
+
return rootNodes;
|
|
5329
|
+
});
|
|
5330
|
+
}
|
|
5331
|
+
downloadChildren(parentNode) {
|
|
5332
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5333
|
+
let uuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
5334
|
+
const children = yield this.service
|
|
5335
|
+
.getChildrenNodes(uuid, this.treeId, parentNode.identifier)
|
|
5336
|
+
.toPromise();
|
|
5337
|
+
if (!children) {
|
|
5338
|
+
throw new Error(`Node with identifier ${parentNode.identifier} does not have children.`);
|
|
5339
|
+
}
|
|
5340
|
+
return children;
|
|
5341
|
+
});
|
|
5342
|
+
}
|
|
5343
|
+
onTreeNodeOpen(treeNode) {
|
|
5344
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5345
|
+
let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
5346
|
+
if (treeNode === null || treeNode === void 0 ? void 0 : treeNode.expanded) {
|
|
5347
|
+
let tempTreeNode = yield this.service
|
|
5348
|
+
.collapseNode(viewUuid, this.treeId, treeNode.identifier)
|
|
5349
|
+
.toPromise();
|
|
5350
|
+
treeNode = tempTreeNode;
|
|
5351
|
+
}
|
|
5352
|
+
else if (!(treeNode === null || treeNode === void 0 ? void 0 : treeNode.expanded)) {
|
|
5353
|
+
let tempTreeNode = yield this.service
|
|
5354
|
+
.expandNode(viewUuid, this.treeId, treeNode === null || treeNode === void 0 ? void 0 : treeNode.identifier)
|
|
5355
|
+
.toPromise();
|
|
5356
|
+
treeNode = tempTreeNode;
|
|
5357
|
+
}
|
|
5358
|
+
let node = this.deepSearchTreeNode(treeNode === null || treeNode === void 0 ? void 0 : treeNode.identifier, this.treeFromBackend);
|
|
5359
|
+
node.expanded = treeNode === null || treeNode === void 0 ? void 0 : treeNode.expanded;
|
|
5360
|
+
node.childrenNodes = treeNode === null || treeNode === void 0 ? void 0 : treeNode.childrenNodes;
|
|
5361
|
+
this.syncTree();
|
|
5362
|
+
});
|
|
5363
|
+
}
|
|
5364
|
+
onTreeNodeClick(treeNode) {
|
|
5365
|
+
this.selectFolder(treeNode.identifier, treeNode);
|
|
5366
|
+
}
|
|
5367
|
+
selectFolder(folderUri, treeNode) {
|
|
5368
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5369
|
+
let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
5370
|
+
yield this.service
|
|
5371
|
+
.selectNode(viewUuid, this.treeId, treeNode.identifier)
|
|
5372
|
+
.toPromise()
|
|
5373
|
+
.then((updatedTreeNode) => {
|
|
5374
|
+
if (this.selectedNode) {
|
|
5375
|
+
this.selectedNode.selected = false;
|
|
5376
|
+
}
|
|
5377
|
+
this.selectedNode = updatedTreeNode;
|
|
5378
|
+
let node = this.deepSearchTreeNode(updatedTreeNode === null || updatedTreeNode === void 0 ? void 0 : updatedTreeNode.identifier, this.treeFromBackend);
|
|
5379
|
+
if (!node) {
|
|
5380
|
+
throw Error('Tree node does not exist');
|
|
5381
|
+
}
|
|
5382
|
+
node.expanded = updatedTreeNode === null || updatedTreeNode === void 0 ? void 0 : updatedTreeNode.expanded;
|
|
5383
|
+
node.childrenNodes = updatedTreeNode === null || updatedTreeNode === void 0 ? void 0 : updatedTreeNode.childrenNodes;
|
|
5384
|
+
node.selected = updatedTreeNode === null || updatedTreeNode === void 0 ? void 0 : updatedTreeNode.selected;
|
|
5385
|
+
treeNode = updatedTreeNode;
|
|
5386
|
+
this.syncTree();
|
|
5387
|
+
this.viewContext.getAndSyncViewContext(this.viewContext.getUuidOfPage(this.viewContextName));
|
|
5388
|
+
});
|
|
5389
|
+
});
|
|
5390
|
+
}
|
|
5391
|
+
updateTreeOnTheFly() {
|
|
5392
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5393
|
+
yield this.initialize();
|
|
5394
|
+
});
|
|
5395
|
+
}
|
|
5396
|
+
syncTree() {
|
|
5397
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5398
|
+
yield this.cacheActionDesciptors(this.getAllNodes(this.treeFromBackend));
|
|
5399
|
+
if (!this.treeFromBackend) {
|
|
5400
|
+
throw new Error('There is no treeFromBackend available!');
|
|
5401
|
+
}
|
|
5402
|
+
if (!this.smartTreeModel) {
|
|
5403
|
+
this.smartTreeModel = {
|
|
5404
|
+
rootNodes: [],
|
|
5405
|
+
};
|
|
5406
|
+
}
|
|
5407
|
+
let smartTreeNodes = this.createButtonsForTreeNodes(this.treeFromBackend);
|
|
5408
|
+
this.smartTreeModel = undefined;
|
|
5409
|
+
this.smartTreeModel = {
|
|
5410
|
+
rootNodes: [],
|
|
5411
|
+
};
|
|
5412
|
+
this.smartTreeModelChanged.next(this.smartTreeModel);
|
|
5413
|
+
this.smartTreeModel.rootNodes = smartTreeNodes;
|
|
5414
|
+
this.findSelected(this.smartTreeModel.rootNodes);
|
|
5415
|
+
this.smartTreeModelChanged.next(this.smartTreeModel);
|
|
5416
|
+
});
|
|
5417
|
+
}
|
|
5418
|
+
deepSearchTreeNode(identifier, nodes) {
|
|
5419
|
+
let treeNode;
|
|
5420
|
+
for (let index = 0; index < nodes.length; index++) {
|
|
5421
|
+
const node = nodes[index];
|
|
5422
|
+
if (node.identifier === identifier) {
|
|
5423
|
+
treeNode = node;
|
|
5424
|
+
break;
|
|
5425
|
+
}
|
|
5426
|
+
if (node.childrenNodes && node.childrenNodes.length) {
|
|
5427
|
+
treeNode = this.deepSearchTreeNode(identifier, node.childrenNodes);
|
|
5428
|
+
if (treeNode) {
|
|
5429
|
+
break;
|
|
5430
|
+
}
|
|
5431
|
+
}
|
|
5432
|
+
}
|
|
5433
|
+
return treeNode;
|
|
5434
|
+
}
|
|
5435
|
+
findSelected(nodes) {
|
|
5436
|
+
return nodes.forEach((node) => {
|
|
5437
|
+
if (node.selected) {
|
|
5438
|
+
this.selectedNode = node;
|
|
5439
|
+
return;
|
|
5440
|
+
}
|
|
5441
|
+
else if (node.childrenNodes && node.childrenNodes.length) {
|
|
5442
|
+
return this.findSelected(node.childrenNodes);
|
|
5443
|
+
}
|
|
5444
|
+
});
|
|
5445
|
+
}
|
|
5446
|
+
createButtonsForTreeNodes(nodes) {
|
|
5447
|
+
nodes.map((node) => {
|
|
5448
|
+
var _a;
|
|
5449
|
+
node.button = ((_a = node.actions) === null || _a === void 0 ? void 0 : _a.length)
|
|
5450
|
+
? {
|
|
5451
|
+
type: SmartTreeNodeButtonType.MENU,
|
|
5452
|
+
icon: 'more_vert',
|
|
5453
|
+
menuItemButtons: node.actions.map((action) => {
|
|
5454
|
+
return {
|
|
5455
|
+
type: SmartTreeNodeButtonType.NORMAL,
|
|
5456
|
+
label: this.getLabelByAction(action),
|
|
5457
|
+
callback: this.doAction.bind(this),
|
|
5458
|
+
args: [action, node.identifier],
|
|
5459
|
+
};
|
|
5460
|
+
}),
|
|
5461
|
+
}
|
|
5462
|
+
: undefined;
|
|
5463
|
+
node.icon = 'Folders';
|
|
5464
|
+
if (node.childrenNodes) {
|
|
5465
|
+
node.childrenNodes = this.createButtonsForTreeNodes(node.childrenNodes);
|
|
5466
|
+
}
|
|
5467
|
+
});
|
|
5468
|
+
return nodes;
|
|
5469
|
+
}
|
|
5470
|
+
doAction(args) {
|
|
5471
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5472
|
+
let uiAction = args[0];
|
|
5473
|
+
let nodeUuid = args[1];
|
|
5474
|
+
if (uiAction.params) {
|
|
5475
|
+
uiAction.params['nodeUuid'] = nodeUuid;
|
|
5476
|
+
}
|
|
5477
|
+
else {
|
|
5478
|
+
uiAction.params = {
|
|
5479
|
+
nodeUuid: nodeUuid,
|
|
5480
|
+
};
|
|
5481
|
+
}
|
|
5482
|
+
let uiActionModel = {
|
|
5483
|
+
serviceToUse: this,
|
|
5484
|
+
uiAction,
|
|
5485
|
+
};
|
|
5486
|
+
this.uiActionService.uiActionModel = uiActionModel;
|
|
5487
|
+
this.uiActionService.execute(uiAction);
|
|
5488
|
+
});
|
|
5489
|
+
}
|
|
5490
|
+
getAllNodes(nodes) {
|
|
5491
|
+
return nodes.flatMap((n) => [n, ...this.getAllNodes(n.childrenNodes)]);
|
|
5492
|
+
}
|
|
5493
|
+
cacheActionDesciptors(nodes) {
|
|
5494
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5495
|
+
yield Promise.all(nodes.map((node) => __awaiter(this, void 0, void 0, function* () {
|
|
5496
|
+
var _a;
|
|
5497
|
+
let newUiActions = (_a = node.actions) === null || _a === void 0 ? void 0 : _a.filter((uiAction) => !this.uiActionDescriptors.get(uiAction.code));
|
|
5498
|
+
if (!newUiActions) {
|
|
5499
|
+
return;
|
|
5500
|
+
}
|
|
5501
|
+
yield Promise.all(newUiActions.map((uiAction) => __awaiter(this, void 0, void 0, function* () {
|
|
5502
|
+
if (!this.uiActionDescriptors.get(uiAction.code)) {
|
|
5503
|
+
let descriptor = yield this.uiActionDescriptorService.getActionDescriptor(uiAction);
|
|
5504
|
+
this.uiActionDescriptors.set(uiAction.code, descriptor);
|
|
5505
|
+
}
|
|
5506
|
+
})));
|
|
5507
|
+
})));
|
|
5508
|
+
});
|
|
5509
|
+
}
|
|
5510
|
+
getLabelByAction(action) {
|
|
5511
|
+
let desc = this.uiActionDescriptors.get(action.code);
|
|
5512
|
+
return desc.title;
|
|
5513
|
+
}
|
|
5514
|
+
// #region UseUiAction
|
|
5515
|
+
getAdditionalParams(uiAction) {
|
|
5516
|
+
var _a;
|
|
5517
|
+
if (uiAction.params && uiAction.params['nodeUuid']) {
|
|
5518
|
+
let nodeUuid = uiAction.params['nodeUuid'];
|
|
5519
|
+
let nodeName;
|
|
5520
|
+
if (uiAction.code === 'RENAME') {
|
|
5521
|
+
nodeName = (_a = this.deepSearchTreeNode(nodeUuid, this.treeFromBackend)) === null || _a === void 0 ? void 0 : _a.caption;
|
|
5522
|
+
}
|
|
5523
|
+
return {
|
|
5524
|
+
forTextArea: '',
|
|
5525
|
+
forTextField: nodeName ? nodeName : '',
|
|
5526
|
+
};
|
|
5527
|
+
}
|
|
5528
|
+
return {
|
|
5529
|
+
forTextArea: '',
|
|
5530
|
+
forTextField: '',
|
|
5531
|
+
};
|
|
5532
|
+
}
|
|
5533
|
+
getModel() {
|
|
5534
|
+
return {};
|
|
5535
|
+
}
|
|
5536
|
+
performUiActionRequest(uiActionRequest) {
|
|
5537
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5538
|
+
if (uiActionRequest.params['nodeUuid']) {
|
|
5539
|
+
yield this.performNodeUiActionRequest(uiActionRequest);
|
|
5540
|
+
}
|
|
5541
|
+
else {
|
|
5542
|
+
yield this.performMainUiActionRequest(uiActionRequest);
|
|
5543
|
+
}
|
|
5544
|
+
yield this.viewContext.getAndSyncViewContext();
|
|
5545
|
+
this.syncTree();
|
|
5546
|
+
});
|
|
5547
|
+
}
|
|
5548
|
+
performNodeUiActionRequest(uiActionRequest) {
|
|
5549
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5550
|
+
let nodeId = uiActionRequest.params['nodeUuid'];
|
|
5551
|
+
delete uiActionRequest.params['nodeUuid'];
|
|
5552
|
+
let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
5553
|
+
this.treeFromBackend = yield this.service
|
|
5554
|
+
.performAction(viewUuid, this.treeId, nodeId, uiActionRequest)
|
|
5555
|
+
.toPromise();
|
|
5556
|
+
});
|
|
5557
|
+
}
|
|
5558
|
+
performMainUiActionRequest(uiActionRequest) {
|
|
5559
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5560
|
+
let viewUuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
5561
|
+
this.treeFromBackend = yield this.service
|
|
5562
|
+
.performMainAction(viewUuid, this.treeId, uiActionRequest)
|
|
5563
|
+
.toPromise();
|
|
5564
|
+
});
|
|
5565
|
+
}
|
|
5566
|
+
handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
|
|
5567
|
+
throw new Error('Method not implemented.');
|
|
5568
|
+
}
|
|
5569
|
+
}
|
|
5570
|
+
SmarttreeGenericService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeGenericService, deps: [{ token: i0.Injector }, { token: 'pageName' }, { token: 'treeId' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5571
|
+
SmarttreeGenericService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeGenericService, providedIn: 'root' });
|
|
5572
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeGenericService, decorators: [{
|
|
5573
|
+
type: Injectable,
|
|
5574
|
+
args: [{
|
|
5575
|
+
providedIn: 'root',
|
|
5576
|
+
}]
|
|
5577
|
+
}], ctorParameters: function () {
|
|
5578
|
+
return [{ type: i0.Injector }, { type: undefined, decorators: [{
|
|
5579
|
+
type: Inject,
|
|
5580
|
+
args: ['pageName']
|
|
5581
|
+
}] }, { type: undefined, decorators: [{
|
|
5582
|
+
type: Inject,
|
|
5583
|
+
args: ['treeId']
|
|
5584
|
+
}] }];
|
|
5585
|
+
} });
|
|
5586
|
+
|
|
5587
|
+
class SmartTreeComponent {
|
|
5588
|
+
constructor(cdr) {
|
|
5589
|
+
this.cdr = cdr;
|
|
5590
|
+
this._destroy$ = new Subject();
|
|
5591
|
+
this.treeControl = new NestedTreeControl((node) => node.childrenNodes);
|
|
5592
|
+
this.dataSource = new MatTreeNestedDataSource();
|
|
5593
|
+
this.smartTreeNodeButtonType = SmartTreeNodeButtonType;
|
|
5594
|
+
this.uiActionModels = [];
|
|
5595
|
+
this.hasChild = (_, node) => node.hasChildren;
|
|
5596
|
+
}
|
|
5597
|
+
ngOnInit() {
|
|
5598
|
+
if (!this.treeService) {
|
|
5599
|
+
throw new Error('TreeService has not been given!');
|
|
5600
|
+
}
|
|
5601
|
+
this.errorMessage = this.treeService.errorMessage;
|
|
5602
|
+
this.treeService.smartTreeModelChanged.subscribe((newSmartTree) => {
|
|
5603
|
+
this.treeData = newSmartTree;
|
|
5604
|
+
this.dataSource.data = this.treeData.rootNodes;
|
|
5605
|
+
this.expandTreeNodes();
|
|
5606
|
+
});
|
|
5607
|
+
this.treeService.uiActionModelsChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
5608
|
+
if (this.treeService.uiActionModels) {
|
|
5609
|
+
this.uiActionModels = this.treeService.uiActionModels;
|
|
5610
|
+
}
|
|
5611
|
+
});
|
|
5612
|
+
}
|
|
5613
|
+
ngOnDestroy() {
|
|
5614
|
+
this._destroy$.next();
|
|
5615
|
+
this._destroy$.complete();
|
|
5616
|
+
}
|
|
5617
|
+
getIfExpanded(node) {
|
|
5618
|
+
return this.treeControl.isExpanded(node);
|
|
5619
|
+
}
|
|
5620
|
+
expandTreeNodes() {
|
|
5621
|
+
this.expandTreeNodesDeeply(this.dataSource.data);
|
|
5622
|
+
}
|
|
5623
|
+
expandTreeNodesDeeply(nodes) {
|
|
5624
|
+
nodes.forEach((node) => {
|
|
5625
|
+
if (node.expanded) {
|
|
5626
|
+
this.treeControl.expand(node);
|
|
5627
|
+
this.cdr.markForCheck();
|
|
5628
|
+
if (node.childrenNodes && node.childrenNodes.length) {
|
|
5629
|
+
this.expandTreeNodesDeeply(node.childrenNodes);
|
|
5630
|
+
}
|
|
5631
|
+
}
|
|
5632
|
+
else {
|
|
5633
|
+
this.treeControl.collapse(node);
|
|
5634
|
+
}
|
|
5635
|
+
});
|
|
5636
|
+
}
|
|
5637
|
+
onNodeClick(event, node) {
|
|
5638
|
+
event.stopPropagation();
|
|
5639
|
+
if (this.tempActiveNode)
|
|
5640
|
+
this.tempActiveNode.selected = false;
|
|
5641
|
+
node.selected = true;
|
|
5642
|
+
this.tempActiveNode = node;
|
|
5643
|
+
this.treeService.onTreeNodeClick(node);
|
|
5644
|
+
}
|
|
5645
|
+
onOpenNode(event, node) {
|
|
5646
|
+
event.stopPropagation();
|
|
5647
|
+
this.treeService.onTreeNodeOpen(node);
|
|
5648
|
+
}
|
|
5649
|
+
getNodeStyle(node) {
|
|
5650
|
+
var _a, _b;
|
|
5651
|
+
if (this.treeStyle) {
|
|
5652
|
+
var style = node.selected
|
|
5653
|
+
? {
|
|
5654
|
+
background: (_a = this.treeStyle.activeStyle) === null || _a === void 0 ? void 0 : _a.backgroundColor,
|
|
5655
|
+
color: (_b = this.treeStyle.activeStyle) === null || _b === void 0 ? void 0 : _b.color,
|
|
5656
|
+
}
|
|
5657
|
+
: {
|
|
5658
|
+
background: this.treeStyle.levelBackgroundColor[node.level],
|
|
5659
|
+
color: this.treeStyle.color,
|
|
5660
|
+
};
|
|
5661
|
+
return style;
|
|
5662
|
+
}
|
|
5663
|
+
return {};
|
|
5664
|
+
}
|
|
5665
|
+
getNodePadding(node) {
|
|
5666
|
+
if (this.treeStyle) {
|
|
5667
|
+
var style = node.selected
|
|
5668
|
+
? {
|
|
5669
|
+
'padding-left': 15 * node.level + 'px',
|
|
5670
|
+
}
|
|
5671
|
+
: {
|
|
5672
|
+
'padding-left': 15 * node.level + 'px',
|
|
5673
|
+
};
|
|
5674
|
+
return style;
|
|
5675
|
+
}
|
|
5676
|
+
return {};
|
|
5677
|
+
}
|
|
5678
|
+
customButtonClicked(event, button, close) {
|
|
5679
|
+
event.stopPropagation();
|
|
5680
|
+
if (button.type === SmartTreeNodeButtonType.MENU) {
|
|
5681
|
+
return;
|
|
5682
|
+
}
|
|
5683
|
+
if (!button.callback) {
|
|
5684
|
+
throw new Error(`Button with name ${button.label || button.icon} does not have a callback!`);
|
|
5685
|
+
}
|
|
5686
|
+
button.callback(button.args);
|
|
5687
|
+
if (close) {
|
|
5688
|
+
let openMenus = this.trigger.filter((matMenuTrigger) => matMenuTrigger.menuOpen);
|
|
5689
|
+
openMenus.forEach((matMenuTrigger) => {
|
|
5690
|
+
matMenuTrigger.closeMenu();
|
|
5691
|
+
});
|
|
5692
|
+
}
|
|
5693
|
+
}
|
|
5694
|
+
getClassesForTreeNode(node) {
|
|
5695
|
+
let classes = [];
|
|
5696
|
+
if (node.expanded) {
|
|
5697
|
+
classes.push(this.getCustomClass('expanded', node.level));
|
|
5698
|
+
}
|
|
5699
|
+
else {
|
|
5700
|
+
classes.push(this.getCustomClass('collapsed', node.level));
|
|
5701
|
+
}
|
|
5702
|
+
if (node.selected) {
|
|
5703
|
+
classes.push(this.getCustomClass('selected', node.level));
|
|
5704
|
+
}
|
|
5705
|
+
else {
|
|
5706
|
+
classes.push(this.getCustomClass('unselected', node.level));
|
|
5707
|
+
}
|
|
5708
|
+
if (node.level !== 0) {
|
|
5709
|
+
classes.push(this.getCustomClass('child', node.level));
|
|
5710
|
+
}
|
|
5711
|
+
return classes;
|
|
5712
|
+
}
|
|
5713
|
+
getInnerClassesForTreeNode(node) {
|
|
5714
|
+
let classes = [];
|
|
5715
|
+
if (node.expanded) {
|
|
5716
|
+
classes.push(this.getCustomClass('inner-expanded', node.level));
|
|
5717
|
+
}
|
|
5718
|
+
else {
|
|
5719
|
+
classes.push(this.getCustomClass('inner-collapsed', node.level));
|
|
5720
|
+
}
|
|
5721
|
+
if (node.selected) {
|
|
5722
|
+
classes.push(this.getCustomClass('inner-selected', node.level));
|
|
5723
|
+
}
|
|
5724
|
+
else {
|
|
5725
|
+
classes.push(this.getCustomClass('inner-unselected', node.level));
|
|
5726
|
+
}
|
|
5727
|
+
return classes;
|
|
5728
|
+
}
|
|
5729
|
+
getClassesForTreeNodeChildren(node) {
|
|
5730
|
+
let classes = [];
|
|
5731
|
+
classes.push(this.getCustomClass('group', node.level));
|
|
5732
|
+
return classes;
|
|
5733
|
+
}
|
|
5734
|
+
getCustomClass(cssClass, plusProperty) {
|
|
5735
|
+
return `${cssClass}-${plusProperty}`;
|
|
5736
|
+
}
|
|
5737
|
+
}
|
|
5738
|
+
SmartTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTreeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
5739
|
+
SmartTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartTreeComponent, selector: "smart-tree", inputs: { treeStyle: "treeStyle", treeService: "treeService" }, viewQueries: [{ propertyName: "tree", first: true, predicate: ["tree"], descendants: true }, { propertyName: "trigger", predicate: MatMenuTrigger, descendants: true }], ngImport: i0, template: "<div class=\"smartTreeContainer\">\r\n <smart-ui-action-toolbar\r\n *ngIf=\"uiActionModels.length\"\r\n [uiActionModels]=\"uiActionModels\"\r\n ></smart-ui-action-toolbar>\r\n <mat-tree\r\n #tree\r\n *ngIf=\"treeData\"\r\n [dataSource]=\"dataSource\"\r\n [treeControl]=\"treeControl\"\r\n class=\"sm-tree\"\r\n >\r\n <mat-nested-tree-node\r\n *matTreeNodeDef=\"let node; when: hasChild\"\r\n matTreeNodeToggle=\"{{ getIfExpanded(node) }}\"\r\n [ngClass]=\"getClassesForTreeNode(node)\"\r\n [ngStyle]=\"getNodeStyle(node)\"\r\n >\r\n <div\r\n [ngStyle]=\"getNodePadding(node)\"\r\n [ngClass]=\"getInnerClassesForTreeNode(node)\"\r\n class=\"mat-tree-node sm-tree-node\"\r\n (click)=\"onNodeClick($event, node)\"\r\n >\r\n <button mat-icon-button [attr.aria-label]=\"'Toggle ' + node.name\">\r\n <mat-icon\r\n class=\"mat-icon-rtl-mirror\"\r\n matTreeNodeToggle\r\n (click)=\"onOpenNode($event, node)\"\r\n >\r\n <div *ngIf=\"hasChild(node.level, node)\">\r\n {{ treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right' }}\r\n </div>\r\n </mat-icon>\r\n </button>\r\n <smart-icon [icon]=\"node.icon\"> </smart-icon>\r\n <div class=\"sm-tree-row\" [ngClass]=\"node.classes\">\r\n <div class=\"sm-tree-row-caption\">\r\n {{ node.caption }}\r\n </div>\r\n <div class=\"sm-shortDescription-spacer\"></div>\r\n <div class=\"sm-tree-row-shortDescription\">\r\n {{ node.shortDescription }}\r\n </div>\r\n <div class=\"sm-shortDescription-button-spacer\"></div>\r\n <div *ngIf=\"node.button\" class=\"sm-tree-node-button\" [ngSwitch]=\"node.button.type\">\r\n <button\r\n (click)=\"customButtonClicked($event, node.button)\"\r\n *ngSwitchCase=\"smartTreeNodeButtonType.ICON\"\r\n mat-icon-button\r\n >\r\n <smart-icon title=\"{{ node.button.icon }}\" [icon]=\"node.button.icon\"></smart-icon>\r\n </button>\r\n <div *ngSwitchCase=\"smartTreeNodeButtonType.MENU\">\r\n <button\r\n mat-button\r\n [matMenuTriggerFor]=\"menu\"\r\n (click)=\"customButtonClicked($event, node.button, true)\"\r\n >\r\n <smart-icon *ngIf=\"node.button.icon\" [icon]=\"node.button.icon\"></smart-icon\r\n >{{ node.button.label }}\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button\r\n *ngFor=\"let button of node.button.menuItemButtons\"\r\n (click)=\"customButtonClicked($event, button, true)\"\r\n mat-menu-item\r\n >\r\n <smart-icon *ngIf=\"button.icon\" [icon]=\"button.icon\"></smart-icon\r\n >{{ button.label }}\r\n </button>\r\n </mat-menu>\r\n </div>\r\n <button\r\n (click)=\"customButtonClicked($event, node.button)\"\r\n *ngSwitchCase=\"smartTreeNodeButtonType.NORMAL\"\r\n mat-raised-button\r\n >\r\n <smart-icon *ngIf=\"node.button.icon\" [icon]=\"node.button.icon\"></smart-icon>\r\n {{ node.button.icon }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div\r\n [class.sm-tree-invisible]=\"!treeControl.isExpanded(node)\"\r\n [ngClass]=\"getClassesForTreeNodeChildren(node)\"\r\n role=\"group\"\r\n >\r\n <ng-container matTreeNodeOutlet></ng-container>\r\n </div>\r\n </mat-nested-tree-node>\r\n </mat-tree>\r\n <div *ngIf=\"!treeData\">\r\n <h3>\r\n {{ errorMessage }}\r\n </h3>\r\n </div>\r\n</div>\r\n", styles: [".smartTreeContainer{display:flex;flex-direction:column;gap:.5rem}.sm-tree-invisible{display:none}.sm-tree ul,.sm-tree li{margin-top:0;margin-bottom:0;list-style-type:none}.sm-tree div[role=group]>.mat-tree-node{padding-left:40px}.sm-tee-node{padding-left:40px}.sm-tree-node-name{padding-left:15px;padding-top:15px;display:flex;flex-direction:column}.sm-tree-node-name-row{padding-left:15px;padding-top:15px;display:flex;flex-direction:row;justify-content:space-between}.sm-tree-node-name-col{padding-left:15px;padding-top:15px;display:flex;flex-direction:column}.sm-tee-node-id{font-weight:lighter}.mat-tree-node:hover{cursor:pointer}::ng-deep .mat-icon-rtl-mirror{display:flex;flex-direction:row}.sm-tree-row{display:flex;flex-direction:row;flex:1;align-items:center}.sm-shortDescription-spacer{flex:1}\n"], components: [{ type: i1$2.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$2.SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { type: i5$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i5$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$2.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { type: i1$2.MatNestedTreeNode, selector: "mat-nested-tree-node", inputs: ["role", "disabled", "tabIndex", "matNestedTreeNode"], exportAs: ["matNestedTreeNode"] }, { type: i1$2.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i5$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$2.MatTreeNodeOutlet, selector: "[matTreeNodeOutlet]" }] });
|
|
5740
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartTreeComponent, decorators: [{
|
|
5741
|
+
type: Component,
|
|
5742
|
+
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"] }]
|
|
5743
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { trigger: [{
|
|
5744
|
+
type: ViewChildren,
|
|
5745
|
+
args: [MatMenuTrigger]
|
|
5746
|
+
}], tree: [{
|
|
5747
|
+
type: ViewChild,
|
|
5748
|
+
args: ['tree']
|
|
5749
|
+
}], treeStyle: [{
|
|
5750
|
+
type: Input
|
|
5751
|
+
}], treeService: [{
|
|
5752
|
+
type: Input
|
|
5753
|
+
}] } });
|
|
5754
|
+
|
|
5755
|
+
class SmarttreeModule {
|
|
5756
|
+
}
|
|
5757
|
+
SmarttreeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5758
|
+
SmarttreeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeModule, declarations: [SmartTreeComponent], imports: [BrowserModule,
|
|
5759
|
+
MatCommonModule,
|
|
5760
|
+
MatButtonModule,
|
|
5761
|
+
MatIconModule,
|
|
5762
|
+
MatTreeModule,
|
|
5763
|
+
MatMenuModule,
|
|
5764
|
+
SmartIconModule], exports: [SmartTreeComponent] });
|
|
5765
|
+
SmarttreeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeModule, providers: [SmarttreeService, SmarttreeGenericService], imports: [[
|
|
5766
|
+
BrowserModule,
|
|
5767
|
+
MatCommonModule,
|
|
5768
|
+
MatButtonModule,
|
|
5769
|
+
MatIconModule,
|
|
5770
|
+
MatTreeModule,
|
|
5771
|
+
MatMenuModule,
|
|
5772
|
+
SmartIconModule,
|
|
5773
|
+
]] });
|
|
5774
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmarttreeModule, decorators: [{
|
|
5775
|
+
type: NgModule,
|
|
5776
|
+
args: [{
|
|
5777
|
+
declarations: [SmartTreeComponent],
|
|
5778
|
+
imports: [
|
|
5779
|
+
BrowserModule,
|
|
5780
|
+
MatCommonModule,
|
|
5781
|
+
MatButtonModule,
|
|
5782
|
+
MatIconModule,
|
|
5783
|
+
MatTreeModule,
|
|
5784
|
+
MatMenuModule,
|
|
5785
|
+
SmartIconModule,
|
|
5786
|
+
],
|
|
5787
|
+
exports: [SmartTreeComponent],
|
|
5788
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
5789
|
+
providers: [SmarttreeService, SmarttreeGenericService],
|
|
5790
|
+
}]
|
|
5791
|
+
}] });
|
|
5792
|
+
|
|
5793
|
+
class SmartNgClientModule {
|
|
5794
|
+
}
|
|
5795
|
+
SmartNgClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5796
|
+
SmartNgClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, declarations: [SmartFileUploaderComponent], imports: [BrowserModule,
|
|
5797
|
+
MatCommonModule,
|
|
5798
|
+
SmartSessionModule,
|
|
5799
|
+
SmartViewContextModule,
|
|
5800
|
+
SmartformModule,
|
|
5801
|
+
SmartExpandableSectionModule], exports: [SmartSessionModule,
|
|
5802
|
+
SmartViewContextModule,
|
|
5803
|
+
SmartFileUploaderComponent,
|
|
5804
|
+
SmarttreeModule] });
|
|
5805
|
+
SmartNgClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, providers: [SmartNgClientService], imports: [[
|
|
5806
|
+
BrowserModule,
|
|
5807
|
+
MatCommonModule,
|
|
5808
|
+
SmartSessionModule,
|
|
5809
|
+
SmartViewContextModule,
|
|
5810
|
+
SmartformModule,
|
|
5811
|
+
SmartExpandableSectionModule,
|
|
5812
|
+
], SmartSessionModule,
|
|
5813
|
+
SmartViewContextModule,
|
|
5814
|
+
SmarttreeModule] });
|
|
5815
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, decorators: [{
|
|
5816
|
+
type: NgModule,
|
|
5817
|
+
args: [{
|
|
5818
|
+
declarations: [SmartFileUploaderComponent],
|
|
5819
|
+
imports: [
|
|
5820
|
+
BrowserModule,
|
|
5821
|
+
MatCommonModule,
|
|
5822
|
+
SmartSessionModule,
|
|
5823
|
+
SmartViewContextModule,
|
|
5824
|
+
SmartformModule,
|
|
5825
|
+
SmartExpandableSectionModule,
|
|
5826
|
+
],
|
|
5827
|
+
exports: [
|
|
5828
|
+
SmartSessionModule,
|
|
5829
|
+
SmartViewContextModule,
|
|
5830
|
+
SmartFileUploaderComponent,
|
|
5831
|
+
SmarttreeModule,
|
|
5832
|
+
],
|
|
5833
|
+
providers: [SmartNgClientService],
|
|
5834
|
+
}]
|
|
5835
|
+
}] });
|
|
5836
|
+
|
|
5837
|
+
class SmartAuthService {
|
|
5838
|
+
constructor() {
|
|
5839
|
+
this.bffApisHaveBeenSetUp = false;
|
|
5840
|
+
this._destroy$ = new Subject();
|
|
5841
|
+
this.headersUpdated = new SmartSubject(this._destroy$);
|
|
5842
|
+
}
|
|
5843
|
+
ngOnDestroy() {
|
|
5844
|
+
this._destroy$.next();
|
|
5845
|
+
this._destroy$.complete();
|
|
5846
|
+
}
|
|
5847
|
+
}
|
|
5848
|
+
SmartAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5849
|
+
SmartAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService });
|
|
5850
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, decorators: [{
|
|
5851
|
+
type: Injectable
|
|
5852
|
+
}] });
|
|
5853
|
+
|
|
5854
|
+
/*
|
|
5855
|
+
* Public API Surface of smarttree
|
|
5856
|
+
*/
|
|
4509
5857
|
|
|
4510
5858
|
let SmartComponentApiClient = class SmartComponentApiClient {
|
|
4511
5859
|
constructor(inject, auth, pageName) {
|
|
@@ -4941,5 +6289,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
4941
6289
|
* Generated bundle index. Do not edit.
|
|
4942
6290
|
*/
|
|
4943
6291
|
|
|
4944
|
-
export { APIS, ApiModule, ApiQueueService, BASE_PATH, COLLECTION_FORMATS, CloseResult, Configuration, DataChangeKind, IS_ASYNC_PARAM_NAME, MessageOptionType, MessageType, SessionAPIS, SessionErrorBehaviour, SessionService, SmartAuthService, SmartComponent, SmartComponentApiClient, SmartDevToolDatePipe, SmartDevToolFloatingButtonComponent, SmartDevToolService, SmartFileUploaderComponent, SmartLinkChannelVariableInPath, SmartLinkUuidVariableInPath, SmartNgClientModule, SmartNgClientService, SmartService, SmartSessionModule, SmartSessionService, SmartSessionTimerComponent, SmartSessionTimerService, SmartViewContextErrorDialogButtonLabel, SmartViewContextErrorDialogMessage, SmartViewContextErrorDialogTitle, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, UiActionButtonIconPos, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, ViewEventHandler, ViewService, ViewState, ViewType, WidgetMap };
|
|
6292
|
+
export { APIS, ApiModule, ApiQueueService, BASE_PATH$1 as BASE_PATH, COLLECTION_FORMATS$1 as COLLECTION_FORMATS, CloseResult, Configuration$1 as Configuration, DataChangeKind, IS_ASYNC_PARAM_NAME, MessageOptionType, MessageType, SessionAPIS, SessionErrorBehaviour, SessionService, SmartAuthService, SmartComponent, SmartComponentApiClient, SmartDevToolDatePipe, SmartDevToolFloatingButtonComponent, SmartDevToolService, SmartFileUploaderComponent, SmartLinkChannelVariableInPath, SmartLinkUuidVariableInPath, SmartNgClientModule, SmartNgClientService, SmartService, SmartSessionModule, SmartSessionService, SmartSessionTimerComponent, SmartSessionTimerService, SmartTreeComponent, SmartTreeNodeButtonType, SmartViewContextErrorDialogButtonLabel, SmartViewContextErrorDialogMessage, SmartViewContextErrorDialogTitle, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, SmarttreeGenericService, SmarttreeModule, SmarttreeService, UiActionButtonIconPos, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, ViewEventHandler, ViewService, ViewState, ViewType, WidgetMap };
|
|
4945
6293
|
//# sourceMappingURL=smartbit4all-ng-client.mjs.map
|