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