@smartbit4all/ng-client 1.1.41 → 1.1.43
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/api/model/componentWidgetType.mjs +4 -2
- package/esm2020/lib/smart-client/api/model/smartComponentWidgetDefinition.mjs +1 -1
- package/esm2020/lib/smart-client/smart-component-api-client.mjs +26 -1
- package/esm2020/lib/smart-client/smart-component-layout/smart-component-layout.component.mjs +41 -9
- package/esm2020/lib/smart-ng-client.module.mjs +13 -9
- package/fesm2015/smartbit4all-ng-client.mjs +1367 -1304
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +1301 -1239
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-client/api/model/componentWidgetType.d.ts +4 -2
- package/lib/smart-client/api/model/smartComponentWidgetDefinition.d.ts +4 -2
- package/lib/smart-client/smart-component-api-client.d.ts +3 -2
- package/lib/smart-client/smart-component-layout/smart-component-layout.component.d.ts +9 -2
- package/lib/smart-ng-client.module.d.ts +2 -1
- package/package.json +1 -1
- package/smartbit4all-ng-client-1.1.43.tgz +0 -0
- package/smartbit4all-ng-client-1.1.41.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,
|
|
2
|
+
import { InjectionToken, Injectable, Optional, Inject, PLATFORM_ID, NgModule, SkipSelf, Component, Pipe, CUSTOM_ELEMENTS_SCHEMA, Input, ViewChild } 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';
|
|
@@ -15,24 +15,25 @@ import * as i3$1 from '@smartbit4all/navigation';
|
|
|
15
15
|
import * as i4$1 from '@smartbit4all/dialog';
|
|
16
16
|
import { SmartdialogService, SmartdialogModule } from '@smartbit4all/dialog';
|
|
17
17
|
import { MatCommonModule } from '@angular/material/core';
|
|
18
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
19
|
+
import * as i2$2 from '@smartbit4all/expandable-section';
|
|
20
|
+
import { SmartExpandableSectionModule } from '@smartbit4all/expandable-section';
|
|
21
|
+
import * as i1$2 from '@smartbit4all/form';
|
|
22
|
+
import { SmartFormWidgetDirection, SmartFormWidgetType, SmartValidatorName, SmartformModule } from '@smartbit4all/form';
|
|
23
|
+
import * as i3$2 from '@smartbit4all/grid';
|
|
24
|
+
import { SmartLayoutDef, GridUiActionType, SmartGridModule, SmartGridComponent } from '@smartbit4all/grid';
|
|
25
|
+
import * as i4$4 from '@smartbit4all/tree';
|
|
26
|
+
import { SmarttreeModule, SmarttreeGenericService } from '@smartbit4all/tree';
|
|
18
27
|
import * as i4$3 from '@angular/material/expansion';
|
|
19
28
|
import { MatExpansionModule } from '@angular/material/expansion';
|
|
20
|
-
import { BrowserModule } from '@angular/platform-browser';
|
|
21
29
|
import * as i4$2 from '@smartbit4all/icon';
|
|
22
30
|
import { SmartIconModule } from '@smartbit4all/icon';
|
|
23
31
|
import * as i1$1 from '@angular/material/dialog';
|
|
24
32
|
import * as i2$1 from '@angular/router';
|
|
25
33
|
import { catchError as catchError$1, switchMap } from 'rxjs/operators';
|
|
26
|
-
import * as i4$
|
|
34
|
+
import * as i4$5 from '@angular/material/snack-bar';
|
|
27
35
|
import { MAT_SNACK_BAR_DATA, MatSnackBarModule } from '@angular/material/snack-bar';
|
|
28
36
|
import { Validators } from '@angular/forms';
|
|
29
|
-
import * as i1$2 from '@smartbit4all/form';
|
|
30
|
-
import { SmartFormWidgetType, SmartValidatorName, SmartFormWidgetDirection, SmartformModule } from '@smartbit4all/form';
|
|
31
|
-
import * as i3$2 from '@smartbit4all/grid';
|
|
32
|
-
import { SmartLayoutDef, GridUiActionType, SmartGridModule, SmartGridComponent } from '@smartbit4all/grid';
|
|
33
|
-
import * as i2$2 from '@smartbit4all/expandable-section';
|
|
34
|
-
import { SmartExpandableSectionModule } from '@smartbit4all/expandable-section';
|
|
35
|
-
import { SmarttreeGenericService } from '@smartbit4all/tree';
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
39
|
* Custom HttpParameterCodec
|
|
@@ -3388,1494 +3389,1528 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
3388
3389
|
}]
|
|
3389
3390
|
}] });
|
|
3390
3391
|
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3392
|
+
/**
|
|
3393
|
+
* Custom HttpParameterCodec
|
|
3394
|
+
* Workaround for https://github.com/angular/angular/issues/18261
|
|
3395
|
+
*/
|
|
3396
|
+
class CustomHttpParameterCodec {
|
|
3397
|
+
encodeKey(k) {
|
|
3398
|
+
return encodeURIComponent(k);
|
|
3396
3399
|
}
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
const dialogData = {
|
|
3400
|
-
content: {
|
|
3401
|
-
title: '',
|
|
3402
|
-
},
|
|
3403
|
-
size: {},
|
|
3404
|
-
customComponent: SmartViewContextErrorDialogComponent,
|
|
3405
|
-
};
|
|
3406
|
-
this.dialogRefs.push(this.createDialogRef(dialogData, SmartViewContextErrorDialogComponent));
|
|
3400
|
+
encodeValue(v) {
|
|
3401
|
+
return encodeURIComponent(v);
|
|
3407
3402
|
}
|
|
3408
|
-
|
|
3409
|
-
return
|
|
3410
|
-
let dialogRef = this.dialogRefs.pop();
|
|
3411
|
-
dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.close();
|
|
3412
|
-
});
|
|
3403
|
+
decodeKey(k) {
|
|
3404
|
+
return decodeURIComponent(k);
|
|
3413
3405
|
}
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3417
|
-
if ((_a = this.viewApiError) === null || _a === void 0 ? void 0 : _a.code) {
|
|
3418
|
-
return yield this.viewContext.getSmartViewContextApiErrorByCode(this.viewApiError.code);
|
|
3419
|
-
}
|
|
3420
|
-
let dialogTitle;
|
|
3421
|
-
let buttonLabel;
|
|
3422
|
-
let message;
|
|
3423
|
-
if (this.viewContext.translateService) {
|
|
3424
|
-
dialogTitle = yield this.viewContext.translateService
|
|
3425
|
-
.get(SmartViewContextErrorDialogTitle)
|
|
3426
|
-
.toPromise();
|
|
3427
|
-
buttonLabel = yield this.viewContext.translateService
|
|
3428
|
-
.get(SmartViewContextErrorDialogButtonLabel)
|
|
3429
|
-
.toPromise();
|
|
3430
|
-
message = yield this.viewContext.translateService
|
|
3431
|
-
.get(SmartViewContextErrorDialogMessage)
|
|
3432
|
-
.toPromise();
|
|
3433
|
-
}
|
|
3434
|
-
else {
|
|
3435
|
-
buttonLabel = 'Ok';
|
|
3436
|
-
dialogTitle = 'Hiba';
|
|
3437
|
-
message = 'An error has occured.';
|
|
3438
|
-
}
|
|
3439
|
-
return {
|
|
3440
|
-
code: (_c = (_b = this.viewApiError) === null || _b === void 0 ? void 0 : _b.code) !== null && _c !== void 0 ? _c : '',
|
|
3441
|
-
message: (_e = (_d = this.viewApiError) === null || _d === void 0 ? void 0 : _d.message) !== null && _e !== void 0 ? _e : message,
|
|
3442
|
-
buttonLabel,
|
|
3443
|
-
dialogTitle,
|
|
3444
|
-
};
|
|
3445
|
-
});
|
|
3406
|
+
decodeValue(v) {
|
|
3407
|
+
return decodeURIComponent(v);
|
|
3446
3408
|
}
|
|
3447
3409
|
}
|
|
3448
|
-
SmartViewContextErrorDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogService, deps: [{ token: i1$1.MatDialog }, { token: i2$1.Router }, { token: SmartViewContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3449
|
-
SmartViewContextErrorDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogService, providedIn: 'root' });
|
|
3450
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogService, decorators: [{
|
|
3451
|
-
type: Injectable,
|
|
3452
|
-
args: [{
|
|
3453
|
-
providedIn: 'root',
|
|
3454
|
-
}]
|
|
3455
|
-
}], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: i2$1.Router }, { type: SmartViewContextService }]; } });
|
|
3456
3410
|
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3411
|
+
const BASE_PATH = new InjectionToken('basePath');
|
|
3412
|
+
const COLLECTION_FORMATS = {
|
|
3413
|
+
'csv': ',',
|
|
3414
|
+
'tsv': ' ',
|
|
3415
|
+
'ssv': ' ',
|
|
3416
|
+
'pipes': '|'
|
|
3417
|
+
};
|
|
3418
|
+
|
|
3419
|
+
class Configuration {
|
|
3420
|
+
constructor(configurationParameters = {}) {
|
|
3421
|
+
this.apiKeys = configurationParameters.apiKeys;
|
|
3422
|
+
this.username = configurationParameters.username;
|
|
3423
|
+
this.password = configurationParameters.password;
|
|
3424
|
+
this.accessToken = configurationParameters.accessToken;
|
|
3425
|
+
this.basePath = configurationParameters.basePath;
|
|
3426
|
+
this.withCredentials = configurationParameters.withCredentials;
|
|
3427
|
+
this.encoder = configurationParameters.encoder;
|
|
3428
|
+
if (configurationParameters.encodeParam) {
|
|
3429
|
+
this.encodeParam = configurationParameters.encodeParam;
|
|
3430
|
+
}
|
|
3431
|
+
else {
|
|
3432
|
+
this.encodeParam = param => this.defaultEncodeParam(param);
|
|
3433
|
+
}
|
|
3434
|
+
if (configurationParameters.credentials) {
|
|
3435
|
+
this.credentials = configurationParameters.credentials;
|
|
3436
|
+
}
|
|
3437
|
+
else {
|
|
3438
|
+
this.credentials = {};
|
|
3471
3439
|
}
|
|
3472
|
-
this.service.closeDialog();
|
|
3473
3440
|
}
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3441
|
+
/**
|
|
3442
|
+
* Select the correct content-type to use for a request.
|
|
3443
|
+
* Uses {@link Configuration#isJsonMime} to determine the correct content-type.
|
|
3444
|
+
* If no content type is found return the first found type if the contentTypes is not empty
|
|
3445
|
+
* @param contentTypes - the array of content types that are available for selection
|
|
3446
|
+
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
3447
|
+
*/
|
|
3448
|
+
selectHeaderContentType(contentTypes) {
|
|
3449
|
+
if (contentTypes.length === 0) {
|
|
3450
|
+
return undefined;
|
|
3451
|
+
}
|
|
3452
|
+
const type = contentTypes.find((x) => this.isJsonMime(x));
|
|
3453
|
+
if (type === undefined) {
|
|
3454
|
+
return contentTypes[0];
|
|
3455
|
+
}
|
|
3456
|
+
return type;
|
|
3485
3457
|
}
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3458
|
+
/**
|
|
3459
|
+
* Select the correct accept content-type to use for a request.
|
|
3460
|
+
* Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
|
|
3461
|
+
* If no content type is found return the first found type if the contentTypes is not empty
|
|
3462
|
+
* @param accepts - the array of content types that are available for selection.
|
|
3463
|
+
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
3464
|
+
*/
|
|
3465
|
+
selectHeaderAccept(accepts) {
|
|
3466
|
+
if (accepts.length === 0) {
|
|
3467
|
+
return undefined;
|
|
3496
3468
|
}
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
return throwError(error);
|
|
3503
|
-
}));
|
|
3469
|
+
const type = accepts.find((x) => this.isJsonMime(x));
|
|
3470
|
+
if (type === undefined) {
|
|
3471
|
+
return accepts[0];
|
|
3472
|
+
}
|
|
3473
|
+
return type;
|
|
3504
3474
|
}
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3475
|
+
/**
|
|
3476
|
+
* Check if the given MIME is a JSON MIME.
|
|
3477
|
+
* JSON MIME examples:
|
|
3478
|
+
* application/json
|
|
3479
|
+
* application/json; charset=UTF8
|
|
3480
|
+
* APPLICATION/JSON
|
|
3481
|
+
* application/vnd.company+json
|
|
3482
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
3483
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
3484
|
+
*/
|
|
3485
|
+
isJsonMime(mime) {
|
|
3486
|
+
const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
3487
|
+
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
3508
3488
|
}
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
}
|
|
3528
|
-
this.service.showPublishedView(channel, uuid);
|
|
3529
|
-
});
|
|
3489
|
+
lookupCredential(key) {
|
|
3490
|
+
const value = this.credentials[key];
|
|
3491
|
+
return typeof value === 'function'
|
|
3492
|
+
? value()
|
|
3493
|
+
: value;
|
|
3494
|
+
}
|
|
3495
|
+
defaultEncodeParam(param) {
|
|
3496
|
+
// This implementation exists as fallback for missing configuration
|
|
3497
|
+
// and for backwards compatibility to older typescript-angular generator versions.
|
|
3498
|
+
// It only works for the 'simple' parameter style.
|
|
3499
|
+
// Date-handling only works for the 'date-time' format.
|
|
3500
|
+
// All other styles and Date-formats are probably handled incorrectly.
|
|
3501
|
+
//
|
|
3502
|
+
// But: if that's all you need (i.e.: the most common use-case): no need for customization!
|
|
3503
|
+
const value = param.dataFormat === 'date-time' && param.value instanceof Date
|
|
3504
|
+
? param.value.toISOString()
|
|
3505
|
+
: param.value;
|
|
3506
|
+
return encodeURIComponent(String(value));
|
|
3530
3507
|
}
|
|
3531
3508
|
}
|
|
3532
|
-
SmartViewRedirect.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewRedirect, deps: [{ token: SmartViewContextService }, { token: i3$1.SmartNavigationService }, { token: i2$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
3533
|
-
SmartViewRedirect.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SmartViewRedirect, selector: "app-redirect", ngImport: i0, template: "<div>Smart redirect</div>", isInline: true });
|
|
3534
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewRedirect, decorators: [{
|
|
3535
|
-
type: Component,
|
|
3536
|
-
args: [{
|
|
3537
|
-
selector: "app-redirect",
|
|
3538
|
-
template: "<div>Smart redirect</div>",
|
|
3539
|
-
}]
|
|
3540
|
-
}], ctorParameters: function () { return [{ type: SmartViewContextService }, { type: i3$1.SmartNavigationService }, { type: i2$1.ActivatedRoute }]; } });
|
|
3541
|
-
const SmartLinkChannelVariableInPath = "channel";
|
|
3542
|
-
const SmartLinkUuidVariableInPath = "uuid";
|
|
3543
3509
|
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
actionButton: {
|
|
3564
|
-
caption: '',
|
|
3565
|
-
color: 'accent',
|
|
3566
|
-
},
|
|
3567
|
-
cancelButton: {
|
|
3568
|
-
caption: 'Mégse',
|
|
3569
|
-
color: '',
|
|
3570
|
-
},
|
|
3571
|
-
},
|
|
3572
|
-
},
|
|
3573
|
-
],
|
|
3574
|
-
]);
|
|
3575
|
-
if (this.viewContext.translateService) {
|
|
3576
|
-
this.subscribeToTranslateService();
|
|
3510
|
+
/**
|
|
3511
|
+
* Form layout definition
|
|
3512
|
+
* Contains form layout definition objects.
|
|
3513
|
+
*
|
|
3514
|
+
* The version of the OpenAPI document: 1.0.0
|
|
3515
|
+
* Contact: info@it4all.hu
|
|
3516
|
+
*
|
|
3517
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
3518
|
+
* https://openapi-generator.tech
|
|
3519
|
+
* Do not edit the class manually.
|
|
3520
|
+
*/
|
|
3521
|
+
class DefaultService {
|
|
3522
|
+
constructor(httpClient, basePath, configuration) {
|
|
3523
|
+
this.httpClient = httpClient;
|
|
3524
|
+
this.basePath = 'http://localhost';
|
|
3525
|
+
this.defaultHeaders = new HttpHeaders();
|
|
3526
|
+
this.configuration = new Configuration();
|
|
3527
|
+
if (configuration) {
|
|
3528
|
+
this.configuration = configuration;
|
|
3577
3529
|
}
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
}
|
|
3530
|
+
if (typeof this.configuration.basePath !== 'string') {
|
|
3531
|
+
if (Array.isArray(basePath) && basePath.length > 0) {
|
|
3532
|
+
basePath = basePath[0];
|
|
3533
|
+
}
|
|
3534
|
+
if (typeof basePath !== 'string') {
|
|
3535
|
+
basePath = this.basePath;
|
|
3536
|
+
}
|
|
3537
|
+
this.configuration.basePath = basePath;
|
|
3582
3538
|
}
|
|
3539
|
+
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
|
|
3583
3540
|
}
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
.
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
});
|
|
3541
|
+
// @ts-ignore
|
|
3542
|
+
addToHttpParams(httpParams, value, key) {
|
|
3543
|
+
if (typeof value === "object" && value instanceof Date === false) {
|
|
3544
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value);
|
|
3545
|
+
}
|
|
3546
|
+
else {
|
|
3547
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
|
|
3548
|
+
}
|
|
3549
|
+
return httpParams;
|
|
3594
3550
|
}
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
if (actionDescriptorFromDescriptors) {
|
|
3603
|
-
actionDescriptor = JSON.parse(JSON.stringify(actionDescriptorFromDescriptors));
|
|
3551
|
+
addToHttpParamsRecursive(httpParams, value, key) {
|
|
3552
|
+
if (value == null) {
|
|
3553
|
+
return httpParams;
|
|
3554
|
+
}
|
|
3555
|
+
if (typeof value === "object") {
|
|
3556
|
+
if (Array.isArray(value)) {
|
|
3557
|
+
value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
|
|
3604
3558
|
}
|
|
3605
|
-
if (
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3559
|
+
else if (value instanceof Date) {
|
|
3560
|
+
if (key != null) {
|
|
3561
|
+
httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
|
|
3562
|
+
}
|
|
3563
|
+
else {
|
|
3564
|
+
throw Error("key may not be null if value is Date");
|
|
3565
|
+
}
|
|
3610
3566
|
}
|
|
3611
|
-
|
|
3612
|
-
|
|
3567
|
+
else {
|
|
3568
|
+
Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
|
|
3613
3569
|
}
|
|
3614
|
-
|
|
3615
|
-
|
|
3570
|
+
}
|
|
3571
|
+
else if (key != null) {
|
|
3572
|
+
httpParams = httpParams.append(key, value);
|
|
3573
|
+
}
|
|
3574
|
+
else {
|
|
3575
|
+
throw Error("key may not be null if value is not object or array");
|
|
3576
|
+
}
|
|
3577
|
+
return httpParams;
|
|
3578
|
+
}
|
|
3579
|
+
nopePost(observe = 'body', reportProgress = false, options) {
|
|
3580
|
+
let localVarHeaders = this.defaultHeaders;
|
|
3581
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
3582
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
3583
|
+
// to determine the Accept header
|
|
3584
|
+
const httpHeaderAccepts = [];
|
|
3585
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
3586
|
+
}
|
|
3587
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
3588
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
3589
|
+
}
|
|
3590
|
+
let localVarHttpContext = options && options.context;
|
|
3591
|
+
if (localVarHttpContext === undefined) {
|
|
3592
|
+
localVarHttpContext = new HttpContext();
|
|
3593
|
+
}
|
|
3594
|
+
let responseType_ = 'json';
|
|
3595
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
3596
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
3597
|
+
responseType_ = 'text';
|
|
3616
3598
|
}
|
|
3617
|
-
if (this.
|
|
3618
|
-
|
|
3599
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
3600
|
+
responseType_ = 'json';
|
|
3619
3601
|
}
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
yield Promise.all(Object.keys(model).map((key) => __awaiter(this, void 0, void 0, function* () {
|
|
3633
|
-
if (model[key] !== undefined &&
|
|
3634
|
-
typeof model[key] === 'string' &&
|
|
3635
|
-
model[key].length &&
|
|
3636
|
-
this.keysToTranslate.includes(key)) {
|
|
3637
|
-
model[key] = yield this.viewContext.translateService.get(model[key]).toPromise();
|
|
3638
|
-
}
|
|
3639
|
-
else if (model[key] !== undefined && typeof model[key] === 'object') {
|
|
3640
|
-
model[key] = yield this.deepTranslate(model[key]);
|
|
3641
|
-
}
|
|
3642
|
-
return model;
|
|
3643
|
-
})));
|
|
3644
|
-
return model;
|
|
3602
|
+
else {
|
|
3603
|
+
responseType_ = 'blob';
|
|
3604
|
+
}
|
|
3605
|
+
}
|
|
3606
|
+
let localVarPath = `/nope`;
|
|
3607
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
3608
|
+
context: localVarHttpContext,
|
|
3609
|
+
responseType: responseType_,
|
|
3610
|
+
withCredentials: this.configuration.withCredentials,
|
|
3611
|
+
headers: localVarHeaders,
|
|
3612
|
+
observe: observe,
|
|
3613
|
+
reportProgress: reportProgress
|
|
3645
3614
|
});
|
|
3646
3615
|
}
|
|
3647
|
-
setUpUnkownDialogDescriptor(code, uiActionDescriptor, dialogType) {
|
|
3648
|
-
let unkownDescriptor = this.basicActionDescriptors.get('UNKOWN');
|
|
3649
|
-
uiActionDescriptor[dialogType] = unkownDescriptor.dialog;
|
|
3650
|
-
uiActionDescriptor[dialogType].title = code;
|
|
3651
|
-
uiActionDescriptor[dialogType].actionButton.caption = code;
|
|
3652
|
-
return uiActionDescriptor;
|
|
3653
|
-
}
|
|
3654
3616
|
}
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type:
|
|
3617
|
+
DefaultService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DefaultService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH, optional: true }, { token: Configuration, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3618
|
+
DefaultService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DefaultService, providedIn: 'root' });
|
|
3619
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DefaultService, decorators: [{
|
|
3658
3620
|
type: Injectable,
|
|
3659
3621
|
args: [{
|
|
3660
|
-
providedIn: 'root'
|
|
3622
|
+
providedIn: 'root'
|
|
3661
3623
|
}]
|
|
3662
|
-
}], ctorParameters: function () { return [{ type: SmartViewContextService }]; } });
|
|
3663
|
-
|
|
3664
|
-
class SuccessSnackBarComponent {
|
|
3665
|
-
constructor(data, viewContext, manager) {
|
|
3666
|
-
this.data = data;
|
|
3667
|
-
this.viewContext = viewContext;
|
|
3668
|
-
this.manager = manager;
|
|
3669
|
-
this.manager.getActionDescriptor(data).then((descriptor) => {
|
|
3670
|
-
var _a;
|
|
3671
|
-
if (descriptor.feedbackText) {
|
|
3672
|
-
this.text = descriptor.feedbackText;
|
|
3673
|
-
}
|
|
3674
|
-
else {
|
|
3675
|
-
this.text = (_a = this.viewContext.commonFeedbackText) !== null && _a !== void 0 ? _a : "A mentés sikeres volt!";
|
|
3676
|
-
}
|
|
3677
|
-
});
|
|
3678
|
-
}
|
|
3679
|
-
}
|
|
3680
|
-
SuccessSnackBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SuccessSnackBarComponent, deps: [{ token: MAT_SNACK_BAR_DATA }, { token: SmartViewContextService }, { token: UiActionDescriptorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3681
|
-
SuccessSnackBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SuccessSnackBarComponent, selector: "app-success-snack-bar", ngImport: i0, template: "<span class=\"successSnakBarContainer\" matSnackBarLabel> {{ text }} </span>\n", styles: ["::ng-deep .mat-snack-bar-container{text-align:center;border-radius:2rem}.successSnakBarContainer{color:#fff}\n"] });
|
|
3682
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SuccessSnackBarComponent, decorators: [{
|
|
3683
|
-
type: Component,
|
|
3684
|
-
args: [{ selector: "app-success-snack-bar", template: "<span class=\"successSnakBarContainer\" matSnackBarLabel> {{ text }} </span>\n", styles: ["::ng-deep .mat-snack-bar-container{text-align:center;border-radius:2rem}.successSnakBarContainer{color:#fff}\n"] }]
|
|
3685
3624
|
}], ctorParameters: function () {
|
|
3686
|
-
return [{ type: undefined, decorators: [{
|
|
3625
|
+
return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
3626
|
+
type: Optional
|
|
3627
|
+
}, {
|
|
3687
3628
|
type: Inject,
|
|
3688
|
-
args: [
|
|
3689
|
-
}] }, { type:
|
|
3629
|
+
args: [BASE_PATH]
|
|
3630
|
+
}] }, { type: Configuration, decorators: [{
|
|
3631
|
+
type: Optional
|
|
3632
|
+
}] }];
|
|
3690
3633
|
} });
|
|
3691
3634
|
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3635
|
+
const APIS = [DefaultService];
|
|
3636
|
+
|
|
3637
|
+
/**
|
|
3638
|
+
* Form layout definition
|
|
3639
|
+
* Contains form layout definition objects.
|
|
3640
|
+
*
|
|
3641
|
+
* The version of the OpenAPI document: 1.0.0
|
|
3642
|
+
* Contact: info@it4all.hu
|
|
3643
|
+
*
|
|
3644
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
3645
|
+
* https://openapi-generator.tech
|
|
3646
|
+
* Do not edit the class manually.
|
|
3647
|
+
*/
|
|
3648
|
+
const ComponentType = {
|
|
3649
|
+
Container: 'container',
|
|
3650
|
+
Form: 'form',
|
|
3651
|
+
Widget: 'widget'
|
|
3652
|
+
};
|
|
3653
|
+
|
|
3654
|
+
/**
|
|
3655
|
+
* Form layout definition
|
|
3656
|
+
* Contains form layout definition objects.
|
|
3657
|
+
*
|
|
3658
|
+
* The version of the OpenAPI document: 1.0.0
|
|
3659
|
+
* Contact: info@it4all.hu
|
|
3660
|
+
*
|
|
3661
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
3662
|
+
* https://openapi-generator.tech
|
|
3663
|
+
* Do not edit the class manually.
|
|
3664
|
+
*/
|
|
3665
|
+
const ComponentWidgetType = {
|
|
3666
|
+
Grid: 'grid',
|
|
3667
|
+
Filter: 'filter',
|
|
3668
|
+
Tree: 'tree'
|
|
3669
|
+
};
|
|
3670
|
+
|
|
3671
|
+
/**
|
|
3672
|
+
* Form layout definition
|
|
3673
|
+
* Contains form layout definition objects.
|
|
3674
|
+
*
|
|
3675
|
+
* The version of the OpenAPI document: 1.0.0
|
|
3676
|
+
* Contact: info@it4all.hu
|
|
3677
|
+
*
|
|
3678
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
3679
|
+
* https://openapi-generator.tech
|
|
3680
|
+
* Do not edit the class manually.
|
|
3681
|
+
*/
|
|
3682
|
+
const LayoutDirection = {
|
|
3683
|
+
Horizontal: 'horizontal',
|
|
3684
|
+
Vertical: 'vertical'
|
|
3685
|
+
};
|
|
3686
|
+
|
|
3687
|
+
class ApiModule {
|
|
3688
|
+
constructor(parentModule, http) {
|
|
3689
|
+
if (parentModule) {
|
|
3690
|
+
throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
|
|
3691
|
+
}
|
|
3692
|
+
if (!http) {
|
|
3693
|
+
throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
|
|
3694
|
+
'See also https://github.com/angular/angular/issues/20575');
|
|
3695
|
+
}
|
|
3718
3696
|
}
|
|
3719
|
-
|
|
3720
|
-
return
|
|
3697
|
+
static forRoot(configurationFactory) {
|
|
3698
|
+
return {
|
|
3699
|
+
ngModule: ApiModule,
|
|
3700
|
+
providers: [{ provide: Configuration, useFactory: configurationFactory }]
|
|
3701
|
+
};
|
|
3721
3702
|
}
|
|
3722
|
-
|
|
3723
|
-
|
|
3703
|
+
}
|
|
3704
|
+
ApiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ApiModule, deps: [{ token: ApiModule, optional: true, skipSelf: true }, { token: i1.HttpClient, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3705
|
+
ApiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ApiModule });
|
|
3706
|
+
ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ApiModule, providers: [], imports: [[]] });
|
|
3707
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ApiModule, decorators: [{
|
|
3708
|
+
type: NgModule,
|
|
3709
|
+
args: [{
|
|
3710
|
+
imports: [],
|
|
3711
|
+
declarations: [],
|
|
3712
|
+
exports: [],
|
|
3713
|
+
providers: []
|
|
3714
|
+
}]
|
|
3715
|
+
}], ctorParameters: function () {
|
|
3716
|
+
return [{ type: ApiModule, decorators: [{
|
|
3717
|
+
type: Optional
|
|
3718
|
+
}, {
|
|
3719
|
+
type: SkipSelf
|
|
3720
|
+
}] }, { type: i1.HttpClient, decorators: [{
|
|
3721
|
+
type: Optional
|
|
3722
|
+
}] }];
|
|
3723
|
+
} });
|
|
3724
|
+
|
|
3725
|
+
// import { SmartFilter, SmartFilterComponent } from '@smartbit4all/filter';
|
|
3726
|
+
class SmartComponentLayoutComponent {
|
|
3727
|
+
constructor(layoutService) {
|
|
3728
|
+
this.layoutService = layoutService;
|
|
3724
3729
|
}
|
|
3725
|
-
|
|
3726
|
-
|
|
3730
|
+
ngOnInit() {
|
|
3731
|
+
if (this.smartComponentLayout) {
|
|
3732
|
+
this.setUp();
|
|
3733
|
+
}
|
|
3727
3734
|
}
|
|
3728
|
-
|
|
3729
|
-
this.
|
|
3735
|
+
ngOnChanges(changes) {
|
|
3736
|
+
this.smartComponentLayout = changes['smartComponentLayout'].currentValue;
|
|
3737
|
+
if (this.smartComponentLayout) {
|
|
3738
|
+
this.setUp();
|
|
3739
|
+
}
|
|
3730
3740
|
}
|
|
3731
|
-
|
|
3732
|
-
|
|
3741
|
+
setUp() {
|
|
3742
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
3743
|
+
this.parent = (_a = this.smartComponentLayout) === null || _a === void 0 ? void 0 : _a.parentComponent;
|
|
3744
|
+
this.uuid = this.parent.uuid;
|
|
3745
|
+
this.treeService = this.parent.smartTreeService;
|
|
3746
|
+
if ((_b = this.smartComponentLayout) === null || _b === void 0 ? void 0 : _b.expandable) {
|
|
3747
|
+
this.constructExpandableSection();
|
|
3748
|
+
}
|
|
3749
|
+
else if (((_c = this.smartComponentLayout) === null || _c === void 0 ? void 0 : _c.type) === ComponentType.Form) {
|
|
3750
|
+
this.constructForm();
|
|
3751
|
+
}
|
|
3752
|
+
else if (((_d = this.smartComponentLayout) === null || _d === void 0 ? void 0 : _d.type) === ComponentType.Widget) {
|
|
3753
|
+
if (((_e = this.smartComponentLayout.widget) === null || _e === void 0 ? void 0 : _e.type) === ComponentWidgetType.Grid) {
|
|
3754
|
+
this.constructGrid();
|
|
3755
|
+
}
|
|
3756
|
+
else if (((_f = this.smartComponentLayout.widget) === null || _f === void 0 ? void 0 : _f.type) === ComponentWidgetType.Filter) {
|
|
3757
|
+
this.constructFilter();
|
|
3758
|
+
}
|
|
3759
|
+
else if (((_g = this.smartComponentLayout.widget) === null || _g === void 0 ? void 0 : _g.type) === ComponentWidgetType.Tree) {
|
|
3760
|
+
this.constructTree();
|
|
3761
|
+
}
|
|
3762
|
+
}
|
|
3763
|
+
}
|
|
3764
|
+
type() {
|
|
3765
|
+
return ComponentType;
|
|
3766
|
+
}
|
|
3767
|
+
constructExpandableSection() {
|
|
3768
|
+
var _a, _b;
|
|
3769
|
+
let data = Object.assign({}, this.smartComponentLayout);
|
|
3770
|
+
data.expandable = false;
|
|
3771
|
+
this.expandableSection = {
|
|
3772
|
+
title: (_b = (_a = this.smartComponentLayout) === null || _a === void 0 ? void 0 : _a.expandableSectionLabel) !== null && _b !== void 0 ? _b : '',
|
|
3773
|
+
data,
|
|
3774
|
+
inputName: 'smartComponentLayout',
|
|
3775
|
+
customComponent: SmartComponentLayoutComponent,
|
|
3776
|
+
};
|
|
3777
|
+
}
|
|
3778
|
+
constructForm() {
|
|
3779
|
+
var _a, _b, _c, _d, _e;
|
|
3780
|
+
const widgets = this.layoutService.render({
|
|
3781
|
+
layoutDefinitions: (_a = this.smartComponentLayout) === null || _a === void 0 ? void 0 : _a.form,
|
|
3782
|
+
});
|
|
3783
|
+
this.smartForm = {
|
|
3784
|
+
direction: SmartFormWidgetDirection.COL,
|
|
3785
|
+
model: (_b = this.parent) === null || _b === void 0 ? void 0 : _b.model,
|
|
3786
|
+
constraints: (_d = (_c = this.parent) === null || _c === void 0 ? void 0 : _c.model) === null || _d === void 0 ? void 0 : _d.constraints,
|
|
3787
|
+
widgets,
|
|
3788
|
+
};
|
|
3789
|
+
(_e = this.parent) === null || _e === void 0 ? void 0 : _e.addForm(
|
|
3790
|
+
// unique identifier for the form
|
|
3791
|
+
`form_${this.makeid(5)}`, this.smartForm, this.formChild);
|
|
3792
|
+
}
|
|
3793
|
+
makeid(length) {
|
|
3794
|
+
let result = '';
|
|
3795
|
+
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
3796
|
+
const charactersLength = characters.length;
|
|
3797
|
+
let counter = 0;
|
|
3798
|
+
while (counter < length) {
|
|
3799
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
3800
|
+
counter += 1;
|
|
3801
|
+
}
|
|
3802
|
+
return result;
|
|
3803
|
+
}
|
|
3804
|
+
constructGrid() {
|
|
3805
|
+
var _a, _b, _c;
|
|
3806
|
+
this.smartGrid = {
|
|
3807
|
+
gridIdentifier: (_b = (_a = this.smartComponentLayout) === null || _a === void 0 ? void 0 : _a.widget) === null || _b === void 0 ? void 0 : _b.gridIdentifier,
|
|
3808
|
+
gridModel: {
|
|
3809
|
+
page: {},
|
|
3810
|
+
},
|
|
3811
|
+
layoutDef: SmartLayoutDef.TABLE,
|
|
3812
|
+
};
|
|
3813
|
+
this.smartGrid = (_c = this.parent) === null || _c === void 0 ? void 0 : _c.addGrid(this.smartGrid, {
|
|
3814
|
+
rowUiActionType: GridUiActionType.POPUP_MENU,
|
|
3815
|
+
}, false, this.gridChild);
|
|
3816
|
+
}
|
|
3817
|
+
constructFilter() {
|
|
3818
|
+
// this.smartFilter = (this.smartComponentLayout!.parentComponent as any).addFilter(
|
|
3819
|
+
// `filter_${this.makeid(5)}`,
|
|
3820
|
+
// this.smartComponentLayout?.widget?.filterExpressionFieldList,
|
|
3821
|
+
// this.smartComponentLayout?.widget?.filterType,
|
|
3822
|
+
// this.filterChild
|
|
3823
|
+
// );
|
|
3824
|
+
}
|
|
3825
|
+
constructTree() {
|
|
3826
|
+
var _a, _b, _c;
|
|
3827
|
+
this.parent.setUpDefaultTree((_b = (_a = this.smartComponentLayout) === null || _a === void 0 ? void 0 : _a.widget) === null || _b === void 0 ? void 0 : _b.treeIdentifier);
|
|
3828
|
+
(_c = this.treeService) === null || _c === void 0 ? void 0 : _c.initialize();
|
|
3733
3829
|
}
|
|
3734
3830
|
}
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type:
|
|
3831
|
+
SmartComponentLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartComponentLayoutComponent, deps: [{ token: i1$2.SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3832
|
+
SmartComponentLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: { smartComponentLayout: "smartComponentLayout" }, viewQueries: [{ propertyName: "formChild", first: true, predicate: ["form"], descendants: true }, { propertyName: "gridChild", first: true, predicate: ["grid"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"smartComponentLayout?.expandable; then expandable; else normal\"> </div>\n\n<ng-template #expandable>\n <smart-expandable-section\n *ngIf=\"expandableSection\"\n [data]=\"expandableSection\"\n ></smart-expandable-section>\n</ng-template>\n\n<ng-template #normal>\n <div\n *ngIf=\"smartComponentLayout?.type === type().Container\"\n [ngClass]=\"smartComponentLayout?.direction ?? 'vertical'\"\n >\n <smart-component-layout\n [smartComponentLayout]=\"layout\"\n *ngFor=\"let layout of smartComponentLayout?.components\"\n ></smart-component-layout>\n </div>\n <smartform #form [smartForm]=\"smartForm\"></smartform>\n <smart-grid #grid [smartGrid]=\"smartGrid\" [uuid]=\"uuid!\"></smart-grid>\n <!-- <smart-filter #filter [filter]=\"smartFilter\"></smart-filter> -->\n <smart-tree [treeService]=\"treeService!\"></smart-tree>\n</ng-template>\n", styles: [".horizontal{display:flex;flex-direction:row}.vertical{display:flex;flex-direction:column}\n"], components: [{ type: i2$2.ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }, { type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: ["smartComponentLayout"] }, { type: i1$2.SmartformComponent, selector: "smartform", inputs: ["smartForm"] }, { type: i3$2.SmartGridComponent, selector: "smart-grid", inputs: ["smartGrid", "uuid", "dev"] }, { type: i4$4.SmartTreeComponent, selector: "smart-tree", inputs: ["treeStyle", "treeService"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
3833
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartComponentLayoutComponent, decorators: [{
|
|
3738
3834
|
type: Component,
|
|
3739
|
-
args: [{ selector:
|
|
3740
|
-
}], ctorParameters: function () { return [{ type:
|
|
3835
|
+
args: [{ selector: 'smart-component-layout', template: "<div *ngIf=\"smartComponentLayout?.expandable; then expandable; else normal\"> </div>\n\n<ng-template #expandable>\n <smart-expandable-section\n *ngIf=\"expandableSection\"\n [data]=\"expandableSection\"\n ></smart-expandable-section>\n</ng-template>\n\n<ng-template #normal>\n <div\n *ngIf=\"smartComponentLayout?.type === type().Container\"\n [ngClass]=\"smartComponentLayout?.direction ?? 'vertical'\"\n >\n <smart-component-layout\n [smartComponentLayout]=\"layout\"\n *ngFor=\"let layout of smartComponentLayout?.components\"\n ></smart-component-layout>\n </div>\n <smartform #form [smartForm]=\"smartForm\"></smartform>\n <smart-grid #grid [smartGrid]=\"smartGrid\" [uuid]=\"uuid!\"></smart-grid>\n <!-- <smart-filter #filter [filter]=\"smartFilter\"></smart-filter> -->\n <smart-tree [treeService]=\"treeService!\"></smart-tree>\n</ng-template>\n", styles: [".horizontal{display:flex;flex-direction:row}.vertical{display:flex;flex-direction:column}\n"] }]
|
|
3836
|
+
}], ctorParameters: function () { return [{ type: i1$2.SmartformLayoutDefinitionService }]; }, propDecorators: { smartComponentLayout: [{
|
|
3837
|
+
type: Input
|
|
3838
|
+
}], formChild: [{
|
|
3839
|
+
type: ViewChild,
|
|
3840
|
+
args: ['form']
|
|
3841
|
+
}], gridChild: [{
|
|
3842
|
+
type: ViewChild,
|
|
3843
|
+
args: ['grid']
|
|
3844
|
+
}] } });
|
|
3741
3845
|
|
|
3742
|
-
class
|
|
3743
|
-
constructor(dialog, router) {
|
|
3846
|
+
class SmartViewContextErrorDialogService extends SmartdialogService {
|
|
3847
|
+
constructor(dialog, router, viewContext) {
|
|
3744
3848
|
super(dialog, router);
|
|
3745
|
-
this.
|
|
3746
|
-
this.
|
|
3747
|
-
this.shouldDoAction = false;
|
|
3849
|
+
this.viewContext = viewContext;
|
|
3850
|
+
this.dialogRefs = [];
|
|
3748
3851
|
}
|
|
3852
|
+
handleAfterClosed(result) { }
|
|
3749
3853
|
openDialog() {
|
|
3750
|
-
this.shouldDoAction = false;
|
|
3751
|
-
this.onAction = new SmartSubject(this._destroy$);
|
|
3752
3854
|
const dialogData = {
|
|
3753
3855
|
content: {
|
|
3754
3856
|
title: '',
|
|
3755
3857
|
},
|
|
3756
3858
|
size: {},
|
|
3757
|
-
customComponent:
|
|
3859
|
+
customComponent: SmartViewContextErrorDialogComponent,
|
|
3758
3860
|
};
|
|
3759
|
-
this.
|
|
3760
|
-
}
|
|
3761
|
-
doAction() {
|
|
3762
|
-
this.shouldDoAction = true;
|
|
3763
|
-
this.onAction.complete();
|
|
3764
|
-
this.closeDialog();
|
|
3765
|
-
this.onAction = new SmartSubject(this._destroy$);
|
|
3766
|
-
}
|
|
3767
|
-
cancel() {
|
|
3768
|
-
this.onAction.complete();
|
|
3769
|
-
this.closeDialog();
|
|
3770
|
-
this.onAction = new SmartSubject(this._destroy$);
|
|
3771
|
-
}
|
|
3772
|
-
}
|
|
3773
|
-
UiActionConfirmDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionConfirmDialogService, deps: [{ token: i1$1.MatDialog }, { token: i2$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3774
|
-
UiActionConfirmDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionConfirmDialogService, providedIn: 'root' });
|
|
3775
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionConfirmDialogService, decorators: [{
|
|
3776
|
-
type: Injectable,
|
|
3777
|
-
args: [{
|
|
3778
|
-
providedIn: 'root',
|
|
3779
|
-
}]
|
|
3780
|
-
}], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: i2$1.Router }]; } });
|
|
3781
|
-
|
|
3782
|
-
class UiActionInputDialogComponent {
|
|
3783
|
-
constructor(service, manager) {
|
|
3784
|
-
this.service = service;
|
|
3785
|
-
this.manager = manager;
|
|
3786
|
-
this.code = this.service.action.code;
|
|
3787
|
-
this.setUp();
|
|
3788
|
-
}
|
|
3789
|
-
ngOnDestroy() {
|
|
3790
|
-
this.service._destroy$.next();
|
|
3791
|
-
this.cancel();
|
|
3861
|
+
this.dialogRefs.push(this.createDialogRef(dialogData, SmartViewContextErrorDialogComponent));
|
|
3792
3862
|
}
|
|
3793
|
-
|
|
3863
|
+
closeDialog() {
|
|
3794
3864
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
this.dialogType = this.service.inputTypeName;
|
|
3798
|
-
}
|
|
3799
|
-
else {
|
|
3800
|
-
this.dialogType = this.descriptor.inputDialog ? 'inputDialog' : 'dialog';
|
|
3801
|
-
}
|
|
3802
|
-
this.constructForm();
|
|
3865
|
+
let dialogRef = this.dialogRefs.pop();
|
|
3866
|
+
dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.close();
|
|
3803
3867
|
});
|
|
3804
3868
|
}
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
}
|
|
3808
|
-
getText() {
|
|
3809
|
-
var _a;
|
|
3810
|
-
return (_a = this.descriptor[this.dialogType].text) !== null && _a !== void 0 ? _a : '';
|
|
3811
|
-
}
|
|
3812
|
-
getActionButtonLabel() {
|
|
3813
|
-
return this.descriptor[this.dialogType].actionButton.caption;
|
|
3814
|
-
}
|
|
3815
|
-
getActionButtonColor() {
|
|
3816
|
-
return this.descriptor[this.dialogType].actionButton.color;
|
|
3817
|
-
}
|
|
3818
|
-
getCancelButtonLabel() {
|
|
3819
|
-
return this.descriptor[this.dialogType].cancelButton.caption;
|
|
3820
|
-
}
|
|
3821
|
-
getCancelButtonColor() {
|
|
3822
|
-
return this.descriptor[this.dialogType].cancelButton.color;
|
|
3823
|
-
}
|
|
3824
|
-
constructForm() {
|
|
3825
|
-
var _a, _b, _c;
|
|
3826
|
-
let model = {};
|
|
3827
|
-
let inputName;
|
|
3828
|
-
if (this.service.inputTypeName === 'inputDialog') {
|
|
3829
|
-
inputName = 'input';
|
|
3830
|
-
}
|
|
3831
|
-
else {
|
|
3832
|
-
inputName = 'input2';
|
|
3833
|
-
}
|
|
3834
|
-
if (this.service.nodeName) {
|
|
3835
|
-
model[inputName] = this.service.nodeName;
|
|
3836
|
-
}
|
|
3837
|
-
else {
|
|
3838
|
-
model[inputName] = '';
|
|
3839
|
-
}
|
|
3840
|
-
let type;
|
|
3841
|
-
let inputType = `${inputName}Type`;
|
|
3842
|
-
if (this.service.action[inputType] === UiActionInputType.Textfield) {
|
|
3843
|
-
type = SmartFormWidgetType.TEXT_FIELD;
|
|
3844
|
-
}
|
|
3845
|
-
else {
|
|
3846
|
-
type = SmartFormWidgetType.TEXT_BOX;
|
|
3847
|
-
}
|
|
3848
|
-
let widgets = [
|
|
3849
|
-
{
|
|
3850
|
-
key: inputName,
|
|
3851
|
-
label: '',
|
|
3852
|
-
type,
|
|
3853
|
-
value: '',
|
|
3854
|
-
validators: [
|
|
3855
|
-
{
|
|
3856
|
-
validator: Validators.required,
|
|
3857
|
-
name: SmartValidatorName.required,
|
|
3858
|
-
errorMessage: 'Ez a mező kötelező',
|
|
3859
|
-
},
|
|
3860
|
-
],
|
|
3861
|
-
placeholder: (_a = this.descriptor[this.dialogType].placeholder) !== null && _a !== void 0 ? _a : '',
|
|
3862
|
-
showLabel: true,
|
|
3863
|
-
},
|
|
3864
|
-
];
|
|
3865
|
-
if (widgets[0].type === SmartFormWidgetType.TEXT_FIELD && ((_b = this.descriptor[this.dialogType]) === null || _b === void 0 ? void 0 : _b.mask)) {
|
|
3866
|
-
widgets[0].mask = (_c = this.descriptor[this.dialogType]) === null || _c === void 0 ? void 0 : _c.mask;
|
|
3867
|
-
}
|
|
3868
|
-
this.folderForm = {
|
|
3869
|
-
direction: SmartFormWidgetDirection.COL,
|
|
3870
|
-
model,
|
|
3871
|
-
widgets,
|
|
3872
|
-
};
|
|
3873
|
-
}
|
|
3874
|
-
save() {
|
|
3875
|
-
let form = this.folderFormChild.submitForm();
|
|
3876
|
-
if (form.invalidFields) {
|
|
3877
|
-
throw new Error('The form is invalid!');
|
|
3878
|
-
}
|
|
3879
|
-
this.service.onSave(form.model);
|
|
3880
|
-
}
|
|
3881
|
-
cancel() {
|
|
3882
|
-
this.service.cancel();
|
|
3883
|
-
}
|
|
3884
|
-
}
|
|
3885
|
-
UiActionInputDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionInputDialogComponent, deps: [{ token: UiActionInputDialogService }, { token: UiActionDescriptorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3886
|
-
UiActionInputDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: UiActionInputDialogComponent, selector: "smart-ui-action-input-dialog", viewQueries: [{ propertyName: "folderFormChild", first: true, predicate: ["form"], descendants: true }], ngImport: i0, template: "<div class=\"folderNameDialogContainer\">\n\t<div class=\"headerContainer\">\n\t\t<h3 class=\"color-accent-700\">\n\t\t\t{{ getTitle() }}\n\t\t</h3>\n\t\t<button mat-icon-button title=\"close\" (click)=\"cancel()\">\n\t\t\t<smart-icon [color]=\"'primary'\" [icon]=\"'X'\"></smart-icon>\n\t\t</button>\n\t</div>\n\t<p>\n\t\t{{ getText() }}\n\t</p>\n\t<smartform #form [smartForm]=\"folderForm\"></smartform>\n\t<div class=\"folderNameDialogButtonsContainer\">\n\t\t<button mat-button color=\"accent\" [color]=\"getCancelButtonColor()\" (click)=\"cancel()\">\n\t\t\t{{ getCancelButtonLabel() }}\n\t\t</button>\n\t\t<button mat-raised-button [color]=\"getActionButtonColor()\" (click)=\"save()\">\n\t\t\t{{ getActionButtonLabel() }}\n\t\t</button>\n\t</div>\n</div>\n", styles: [".folderNameDialogContainer{width:25rem;display:flex;flex-direction:column;gap:1rem}.headerContainer{display:flex;flex-direction:row;justify-content:space-between}.headerContainer h3{margin:0}.folderNameDialogButtonsContainer{display:flex;flex-direction:row;justify-content:flex-end;gap:.5rem}\n"], components: [{ 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: i4$2.SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { type: i1$2.SmartformComponent, selector: "smartform", inputs: ["smartForm"] }] });
|
|
3887
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionInputDialogComponent, decorators: [{
|
|
3888
|
-
type: Component,
|
|
3889
|
-
args: [{ selector: 'smart-ui-action-input-dialog', template: "<div class=\"folderNameDialogContainer\">\n\t<div class=\"headerContainer\">\n\t\t<h3 class=\"color-accent-700\">\n\t\t\t{{ getTitle() }}\n\t\t</h3>\n\t\t<button mat-icon-button title=\"close\" (click)=\"cancel()\">\n\t\t\t<smart-icon [color]=\"'primary'\" [icon]=\"'X'\"></smart-icon>\n\t\t</button>\n\t</div>\n\t<p>\n\t\t{{ getText() }}\n\t</p>\n\t<smartform #form [smartForm]=\"folderForm\"></smartform>\n\t<div class=\"folderNameDialogButtonsContainer\">\n\t\t<button mat-button color=\"accent\" [color]=\"getCancelButtonColor()\" (click)=\"cancel()\">\n\t\t\t{{ getCancelButtonLabel() }}\n\t\t</button>\n\t\t<button mat-raised-button [color]=\"getActionButtonColor()\" (click)=\"save()\">\n\t\t\t{{ getActionButtonLabel() }}\n\t\t</button>\n\t</div>\n</div>\n", styles: [".folderNameDialogContainer{width:25rem;display:flex;flex-direction:column;gap:1rem}.headerContainer{display:flex;flex-direction:row;justify-content:space-between}.headerContainer h3{margin:0}.folderNameDialogButtonsContainer{display:flex;flex-direction:row;justify-content:flex-end;gap:.5rem}\n"] }]
|
|
3890
|
-
}], ctorParameters: function () { return [{ type: UiActionInputDialogService }, { type: UiActionDescriptorService }]; }, propDecorators: { folderFormChild: [{
|
|
3891
|
-
type: ViewChild,
|
|
3892
|
-
args: ['form']
|
|
3893
|
-
}] } });
|
|
3894
|
-
|
|
3895
|
-
class UiActionInputDialogService extends SmartdialogService {
|
|
3896
|
-
constructor(dialog, router) {
|
|
3897
|
-
super(dialog, router);
|
|
3898
|
-
this._destroy$ = new Subject();
|
|
3899
|
-
this.onAction = new SmartSubject(this._destroy$);
|
|
3900
|
-
}
|
|
3901
|
-
setDataAndOpenDialog(action, nodeName) {
|
|
3902
|
-
this.action = action;
|
|
3903
|
-
this.nodeName = nodeName;
|
|
3904
|
-
this.openDialog();
|
|
3905
|
-
}
|
|
3906
|
-
openDialog() {
|
|
3907
|
-
this.params = undefined;
|
|
3908
|
-
this.onAction = new SmartSubject(this._destroy$);
|
|
3909
|
-
const dialogData = {
|
|
3910
|
-
content: {
|
|
3911
|
-
title: '',
|
|
3912
|
-
},
|
|
3913
|
-
size: {},
|
|
3914
|
-
customComponent: UiActionInputDialogComponent,
|
|
3915
|
-
};
|
|
3916
|
-
this.createDialog(dialogData, UiActionInputDialogComponent);
|
|
3917
|
-
}
|
|
3918
|
-
onSave(params) {
|
|
3869
|
+
getSmartViewContextApiError() {
|
|
3870
|
+
var _a, _b, _c, _d, _e;
|
|
3919
3871
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3920
|
-
this.
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3872
|
+
if ((_a = this.viewApiError) === null || _a === void 0 ? void 0 : _a.code) {
|
|
3873
|
+
return yield this.viewContext.getSmartViewContextApiErrorByCode(this.viewApiError.code);
|
|
3874
|
+
}
|
|
3875
|
+
let dialogTitle;
|
|
3876
|
+
let buttonLabel;
|
|
3877
|
+
let message;
|
|
3878
|
+
if (this.viewContext.translateService) {
|
|
3879
|
+
dialogTitle = yield this.viewContext.translateService
|
|
3880
|
+
.get(SmartViewContextErrorDialogTitle)
|
|
3881
|
+
.toPromise();
|
|
3882
|
+
buttonLabel = yield this.viewContext.translateService
|
|
3883
|
+
.get(SmartViewContextErrorDialogButtonLabel)
|
|
3884
|
+
.toPromise();
|
|
3885
|
+
message = yield this.viewContext.translateService
|
|
3886
|
+
.get(SmartViewContextErrorDialogMessage)
|
|
3887
|
+
.toPromise();
|
|
3888
|
+
}
|
|
3889
|
+
else {
|
|
3890
|
+
buttonLabel = 'Ok';
|
|
3891
|
+
dialogTitle = 'Hiba';
|
|
3892
|
+
message = 'An error has occured.';
|
|
3893
|
+
}
|
|
3894
|
+
return {
|
|
3895
|
+
code: (_c = (_b = this.viewApiError) === null || _b === void 0 ? void 0 : _b.code) !== null && _c !== void 0 ? _c : '',
|
|
3896
|
+
message: (_e = (_d = this.viewApiError) === null || _d === void 0 ? void 0 : _d.message) !== null && _e !== void 0 ? _e : message,
|
|
3897
|
+
buttonLabel,
|
|
3898
|
+
dialogTitle,
|
|
3899
|
+
};
|
|
3924
3900
|
});
|
|
3925
3901
|
}
|
|
3926
|
-
cancel() {
|
|
3927
|
-
this.onAction.complete();
|
|
3928
|
-
this.closeDialog();
|
|
3929
|
-
this.onAction = new SmartSubject(this._destroy$);
|
|
3930
|
-
}
|
|
3931
3902
|
}
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type:
|
|
3903
|
+
SmartViewContextErrorDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogService, deps: [{ token: i1$1.MatDialog }, { token: i2$1.Router }, { token: SmartViewContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3904
|
+
SmartViewContextErrorDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogService, providedIn: 'root' });
|
|
3905
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogService, decorators: [{
|
|
3935
3906
|
type: Injectable,
|
|
3936
3907
|
args: [{
|
|
3937
3908
|
providedIn: 'root',
|
|
3938
3909
|
}]
|
|
3939
|
-
}], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: i2$1.Router }]; } });
|
|
3910
|
+
}], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: i2$1.Router }, { type: SmartViewContextService }]; } });
|
|
3940
3911
|
|
|
3941
|
-
class
|
|
3942
|
-
constructor(service
|
|
3912
|
+
class SmartViewContextErrorDialogComponent {
|
|
3913
|
+
constructor(service) {
|
|
3943
3914
|
this.service = service;
|
|
3944
|
-
this.
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
ngOnDestroy() {
|
|
3949
|
-
this.service._destroy$.next();
|
|
3950
|
-
this.cancel();
|
|
3951
|
-
}
|
|
3952
|
-
setUp() {
|
|
3953
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
3954
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3955
|
-
this.descriptor = yield this.manager.getActionDescriptor(this.service.action);
|
|
3956
|
-
this.isMultiple = this.service.isMultiple;
|
|
3957
|
-
this.i18n = {
|
|
3958
|
-
addFile: (_b = (_a = this.descriptor.upload) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : 'dokumentum hozzáadása',
|
|
3959
|
-
browseOrDrag: (_d = (_c = this.descriptor.upload) === null || _c === void 0 ? void 0 : _c.description) !== null && _d !== void 0 ? _d : 'tallózás vagy behúzás',
|
|
3960
|
-
formats: (_f = (_e = this.descriptor.upload) === null || _e === void 0 ? void 0 : _e.formats) !== null && _f !== void 0 ? _f : '',
|
|
3961
|
-
maxSize: (_h = (_g = this.descriptor.upload) === null || _g === void 0 ? void 0 : _g.maxSize) !== null && _h !== void 0 ? _h : '',
|
|
3962
|
-
upload: (_j = this.descriptor.upload) === null || _j === void 0 ? void 0 : _j.uploadButtonTitle,
|
|
3963
|
-
};
|
|
3964
|
-
// TODO set max size and file formats by UiAction.params
|
|
3965
|
-
if (this.descriptor[this.service.inputTypeName]) {
|
|
3966
|
-
this.dialogType = this.service.inputTypeName;
|
|
3967
|
-
}
|
|
3968
|
-
else {
|
|
3969
|
-
this.dialogType = this.descriptor.inputDialog ? 'inputDialog' : 'dialog';
|
|
3970
|
-
}
|
|
3915
|
+
this.service
|
|
3916
|
+
.getSmartViewContextApiError()
|
|
3917
|
+
.then((smartViewContextApiError) => {
|
|
3918
|
+
this.smartViewContextApiError = smartViewContextApiError;
|
|
3971
3919
|
});
|
|
3972
3920
|
}
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
}
|
|
3976
|
-
getText() {
|
|
3921
|
+
ngOnInit() { }
|
|
3922
|
+
onActionClick() {
|
|
3977
3923
|
var _a;
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
}
|
|
3983
|
-
getActionButtonColor() {
|
|
3984
|
-
return this.descriptor[this.dialogType].actionButton.color;
|
|
3985
|
-
}
|
|
3986
|
-
getCancelButtonLabel() {
|
|
3987
|
-
return this.descriptor[this.dialogType].cancelButton.caption;
|
|
3988
|
-
}
|
|
3989
|
-
getCancelButtonColor() {
|
|
3990
|
-
return this.descriptor[this.dialogType].cancelButton.color;
|
|
3991
|
-
}
|
|
3992
|
-
upload(files) {
|
|
3993
|
-
this.service.onSave(files);
|
|
3994
|
-
}
|
|
3995
|
-
cancel() {
|
|
3996
|
-
this.service.cancel();
|
|
3924
|
+
if ((_a = this.smartViewContextApiError) === null || _a === void 0 ? void 0 : _a.customAction) {
|
|
3925
|
+
this.smartViewContextApiError.customAction();
|
|
3926
|
+
}
|
|
3927
|
+
this.service.closeDialog();
|
|
3997
3928
|
}
|
|
3998
3929
|
}
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type:
|
|
3930
|
+
SmartViewContextErrorDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogComponent, deps: [{ token: SmartViewContextErrorDialogService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3931
|
+
SmartViewContextErrorDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SmartViewContextErrorDialogComponent, selector: "lib-smart-view-context-error-dialog", ngImport: i0, template: "<div *ngIf=\"smartViewContextApiError\" class=\"container\">\n <h3 class=\"color-accent-700\">\n {{ smartViewContextApiError.dialogTitle }}\n </h3>\n <div class=\"content\">\n <p>\n {{ smartViewContextApiError.message }}\n </p>\n </div>\n <div class=\"buttonContainer\">\n <button mat-raised-button color=\"primary\" (click)=\"onActionClick()\">\n {{ smartViewContextApiError.buttonLabel }}\n </button>\n </div>\n</div>\n", styles: [".container{display:flex;flex-direction:column;gap:1em;min-width:25rem;max-width:50vw;height:auto;max-height:75vh}.content{flex:1;overflow:auto}.buttonContainer{display:flex;flex-direction:row;justify-content:flex-end}\n"], components: [{ 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"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3932
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextErrorDialogComponent, decorators: [{
|
|
4002
3933
|
type: Component,
|
|
4003
|
-
args: [{ selector: 'lib-
|
|
4004
|
-
}], ctorParameters: function () { return [{ type:
|
|
3934
|
+
args: [{ selector: 'lib-smart-view-context-error-dialog', template: "<div *ngIf=\"smartViewContextApiError\" class=\"container\">\n <h3 class=\"color-accent-700\">\n {{ smartViewContextApiError.dialogTitle }}\n </h3>\n <div class=\"content\">\n <p>\n {{ smartViewContextApiError.message }}\n </p>\n </div>\n <div class=\"buttonContainer\">\n <button mat-raised-button color=\"primary\" (click)=\"onActionClick()\">\n {{ smartViewContextApiError.buttonLabel }}\n </button>\n </div>\n</div>\n", styles: [".container{display:flex;flex-direction:column;gap:1em;min-width:25rem;max-width:50vw;height:auto;max-height:75vh}.content{flex:1;overflow:auto}.buttonContainer{display:flex;flex-direction:row;justify-content:flex-end}\n"] }]
|
|
3935
|
+
}], ctorParameters: function () { return [{ type: SmartViewContextErrorDialogService }]; } });
|
|
4005
3936
|
|
|
4006
|
-
class
|
|
4007
|
-
constructor(
|
|
4008
|
-
|
|
4009
|
-
this._destroy$ = new Subject();
|
|
4010
|
-
this.onAction = new SmartSubject(this._destroy$);
|
|
4011
|
-
this.isMultiple = false;
|
|
4012
|
-
}
|
|
4013
|
-
setDataAndOpenDialog(action, nodeName) {
|
|
4014
|
-
this.action = action;
|
|
4015
|
-
this.nodeName = nodeName;
|
|
4016
|
-
this.openDialog();
|
|
4017
|
-
}
|
|
4018
|
-
openDialog() {
|
|
4019
|
-
this.files = undefined;
|
|
4020
|
-
this.onAction = new SmartSubject(this._destroy$);
|
|
4021
|
-
const dialogData = {
|
|
4022
|
-
content: {
|
|
4023
|
-
title: '',
|
|
4024
|
-
},
|
|
4025
|
-
size: {},
|
|
4026
|
-
customComponent: UiActionFileUploadDialogComponent,
|
|
4027
|
-
};
|
|
4028
|
-
this.createDialog(dialogData, UiActionFileUploadDialogComponent);
|
|
3937
|
+
class SmartViewContextInterceptor {
|
|
3938
|
+
constructor(viewContextErrorDialog) {
|
|
3939
|
+
this.viewContextErrorDialog = viewContextErrorDialog;
|
|
4029
3940
|
}
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
3941
|
+
intercept(request, next) {
|
|
3942
|
+
// parameter: async: True -> don't throw/open error (dialog)
|
|
3943
|
+
if (request.body) {
|
|
3944
|
+
try {
|
|
3945
|
+
let body = request.body;
|
|
3946
|
+
if (body.params[IS_ASYNC_PARAM_NAME]) {
|
|
3947
|
+
return next.handle(request);
|
|
3948
|
+
}
|
|
3949
|
+
}
|
|
3950
|
+
catch (error) { }
|
|
3951
|
+
}
|
|
3952
|
+
return next.handle(request).pipe(catchError((error) => {
|
|
3953
|
+
if (error.status === 409 &&
|
|
3954
|
+
(error.error.code || error.error.message)) {
|
|
3955
|
+
this.openErrorDialog(error.error);
|
|
3956
|
+
}
|
|
3957
|
+
return throwError(error);
|
|
3958
|
+
}));
|
|
4037
3959
|
}
|
|
4038
|
-
|
|
4039
|
-
this.
|
|
4040
|
-
this.
|
|
4041
|
-
this.onAction = new SmartSubject(this._destroy$);
|
|
3960
|
+
openErrorDialog(viewApiError) {
|
|
3961
|
+
this.viewContextErrorDialog.viewApiError = viewApiError;
|
|
3962
|
+
this.viewContextErrorDialog.openDialog();
|
|
4042
3963
|
}
|
|
4043
3964
|
}
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type:
|
|
4047
|
-
type: Injectable
|
|
3965
|
+
SmartViewContextInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextInterceptor, deps: [{ token: SmartViewContextErrorDialogService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3966
|
+
SmartViewContextInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextInterceptor });
|
|
3967
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextInterceptor, decorators: [{
|
|
3968
|
+
type: Injectable
|
|
3969
|
+
}], ctorParameters: function () { return [{ type: SmartViewContextErrorDialogService }]; } });
|
|
3970
|
+
|
|
3971
|
+
class SmartViewRedirect {
|
|
3972
|
+
constructor(service, navigation, route) {
|
|
3973
|
+
this.service = service;
|
|
3974
|
+
this.navigation = navigation;
|
|
3975
|
+
this.route = route;
|
|
3976
|
+
this.navigation.route = this.route;
|
|
3977
|
+
this.navigation.subscribeToUrlChange((url) => {
|
|
3978
|
+
let channel = this.route.snapshot.paramMap.get(SmartLinkChannelVariableInPath);
|
|
3979
|
+
let uuid = this.route.snapshot.paramMap.get(SmartLinkUuidVariableInPath);
|
|
3980
|
+
if (!channel || !uuid) {
|
|
3981
|
+
throw new Error("channel or uuid is not reachable from the url!");
|
|
3982
|
+
}
|
|
3983
|
+
this.service.showPublishedView(channel, uuid);
|
|
3984
|
+
});
|
|
3985
|
+
}
|
|
3986
|
+
}
|
|
3987
|
+
SmartViewRedirect.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewRedirect, deps: [{ token: SmartViewContextService }, { token: i3$1.SmartNavigationService }, { token: i2$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
3988
|
+
SmartViewRedirect.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SmartViewRedirect, selector: "app-redirect", ngImport: i0, template: "<div>Smart redirect</div>", isInline: true });
|
|
3989
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewRedirect, decorators: [{
|
|
3990
|
+
type: Component,
|
|
4048
3991
|
args: [{
|
|
4049
|
-
|
|
3992
|
+
selector: "app-redirect",
|
|
3993
|
+
template: "<div>Smart redirect</div>",
|
|
4050
3994
|
}]
|
|
4051
|
-
}], ctorParameters: function () { return [{ type:
|
|
3995
|
+
}], ctorParameters: function () { return [{ type: SmartViewContextService }, { type: i3$1.SmartNavigationService }, { type: i2$1.ActivatedRoute }]; } });
|
|
3996
|
+
const SmartLinkChannelVariableInPath = "channel";
|
|
3997
|
+
const SmartLinkUuidVariableInPath = "uuid";
|
|
4052
3998
|
|
|
4053
|
-
class
|
|
4054
|
-
constructor(
|
|
4055
|
-
this.
|
|
4056
|
-
this.textFieldDialogService = textFieldDialogService;
|
|
4057
|
-
this.fileUploadDialogService = fileUploadDialogService;
|
|
4058
|
-
this._snackBar = _snackBar;
|
|
3999
|
+
class UiActionDescriptorService {
|
|
4000
|
+
constructor(viewContext) {
|
|
4001
|
+
this.viewContext = viewContext;
|
|
4059
4002
|
this._destroy$ = new Subject();
|
|
4003
|
+
this.languageChanged = new SmartSubject(this._destroy$);
|
|
4004
|
+
this.keysToTranslate = ['title', 'text', 'placeholder', 'caption', 'feedbackText'];
|
|
4005
|
+
this.basicActionDescriptors = new Map([
|
|
4006
|
+
[
|
|
4007
|
+
'UNKOWN',
|
|
4008
|
+
{
|
|
4009
|
+
title: '',
|
|
4010
|
+
type: UiActionButtonType.Normal,
|
|
4011
|
+
color: 'accent',
|
|
4012
|
+
icon: 'Question',
|
|
4013
|
+
iconColor: `text-primary`,
|
|
4014
|
+
iconPosition: UiActionButtonIconPos.Post,
|
|
4015
|
+
dialog: {
|
|
4016
|
+
title: '',
|
|
4017
|
+
placeholder: 'placeholder',
|
|
4018
|
+
actionButton: {
|
|
4019
|
+
caption: '',
|
|
4020
|
+
color: 'accent',
|
|
4021
|
+
},
|
|
4022
|
+
cancelButton: {
|
|
4023
|
+
caption: 'Mégse',
|
|
4024
|
+
color: '',
|
|
4025
|
+
},
|
|
4026
|
+
},
|
|
4027
|
+
},
|
|
4028
|
+
],
|
|
4029
|
+
]);
|
|
4030
|
+
if (this.viewContext.translateService) {
|
|
4031
|
+
this.subscribeToTranslateService();
|
|
4032
|
+
}
|
|
4033
|
+
else {
|
|
4034
|
+
this.viewContext.translateServiceChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
4035
|
+
this.subscribeToTranslateService();
|
|
4036
|
+
});
|
|
4037
|
+
}
|
|
4060
4038
|
}
|
|
4061
4039
|
ngOnDestroy() {
|
|
4062
4040
|
this._destroy$.next();
|
|
4063
4041
|
this._destroy$.complete();
|
|
4064
4042
|
}
|
|
4065
|
-
|
|
4043
|
+
subscribeToTranslateService() {
|
|
4044
|
+
this.viewContext
|
|
4045
|
+
.translateService.onLangChange.pipe(takeUntil(this._destroy$))
|
|
4046
|
+
.subscribe(() => {
|
|
4047
|
+
this.languageChanged.next();
|
|
4048
|
+
});
|
|
4049
|
+
}
|
|
4050
|
+
getActionDescriptor(uiAction) {
|
|
4066
4051
|
var _a;
|
|
4067
4052
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4068
|
-
let
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
if (uiAction.submit) {
|
|
4075
|
-
this.uiActionModel.serviceToUse.submit.next();
|
|
4076
|
-
try {
|
|
4077
|
-
yield this.uiActionModel.serviceToUse.submit.toPromise();
|
|
4078
|
-
this.uiActionModel.serviceToUse.submit = new SmartSubject(this._destroy$);
|
|
4079
|
-
this.uiActionModel.serviceToUse.reSubscribeToChange.next();
|
|
4080
|
-
}
|
|
4081
|
-
catch (error) {
|
|
4082
|
-
console.error(error);
|
|
4083
|
-
this.uiActionModel.serviceToUse.submit = new SmartSubject(this._destroy$);
|
|
4084
|
-
this.uiActionModel.serviceToUse.reSubscribeToChange.next();
|
|
4085
|
-
return;
|
|
4086
|
-
}
|
|
4087
|
-
}
|
|
4088
|
-
if (uiAction.confirm) {
|
|
4089
|
-
this.confirmDialogService.action = uiAction;
|
|
4090
|
-
this.confirmDialogService.openDialog();
|
|
4091
|
-
yield this.confirmDialogService.onAction.toPromise();
|
|
4092
|
-
if (!this.confirmDialogService.shouldDoAction) {
|
|
4093
|
-
return;
|
|
4094
|
-
}
|
|
4053
|
+
let code = uiAction.code;
|
|
4054
|
+
let actionDescriptorFromDescriptors = (_a = this.viewContext.getActionDescriptors()) === null || _a === void 0 ? void 0 : _a.get(code);
|
|
4055
|
+
let isUnkown = false;
|
|
4056
|
+
let actionDescriptor;
|
|
4057
|
+
if (actionDescriptorFromDescriptors) {
|
|
4058
|
+
actionDescriptor = JSON.parse(JSON.stringify(actionDescriptorFromDescriptors));
|
|
4095
4059
|
}
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
}
|
|
4102
|
-
yield new Promise((resolve) => setTimeout(resolve, 250));
|
|
4060
|
+
if (!actionDescriptor) {
|
|
4061
|
+
isUnkown = true;
|
|
4062
|
+
let unkownActionDescriptor = this.basicActionDescriptors.get('UNKOWN');
|
|
4063
|
+
actionDescriptor = Object.assign({}, unkownActionDescriptor);
|
|
4064
|
+
actionDescriptor.title = code;
|
|
4103
4065
|
}
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
uiActionRequest = yield this.handleInputType(uiAction.input2Type, uiAction, uiActionRequest, 'input2Dialog');
|
|
4107
|
-
if (!uiActionRequest) {
|
|
4108
|
-
return;
|
|
4109
|
-
}
|
|
4066
|
+
if (!actionDescriptor.dialog) {
|
|
4067
|
+
actionDescriptor = this.setUpUnkownDialogDescriptor(code, actionDescriptor, 'dialog');
|
|
4110
4068
|
}
|
|
4111
|
-
if (
|
|
4112
|
-
|
|
4113
|
-
if (!response.shouldPerformAction || !response.uiActionRequest) {
|
|
4114
|
-
return;
|
|
4115
|
-
}
|
|
4116
|
-
uiActionRequest = response.uiActionRequest;
|
|
4069
|
+
if (!actionDescriptor.feedbackType && uiAction.submit) {
|
|
4070
|
+
actionDescriptor.feedbackType = UiActionFeedbackType.Snackbar;
|
|
4117
4071
|
}
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
}
|
|
4121
|
-
handleInputType(inputType, uiAction, uiActionRequest, inputTypeName) {
|
|
4122
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
4123
|
-
switch (inputType) {
|
|
4124
|
-
case UiActionInputType.None:
|
|
4125
|
-
return uiActionRequest;
|
|
4126
|
-
case UiActionInputType.Textarea:
|
|
4127
|
-
case UiActionInputType.Textfield:
|
|
4128
|
-
return yield this.handleInputTypeTextField(inputTypeName, uiAction, uiActionRequest);
|
|
4129
|
-
case UiActionInputType.UserSelect:
|
|
4130
|
-
return yield this.handleInputTypeUserSelect(inputTypeName, uiAction, uiActionRequest);
|
|
4131
|
-
case UiActionInputType.File:
|
|
4132
|
-
return yield this.handleInputTypeUpload(inputTypeName, uiAction, uiActionRequest, false);
|
|
4133
|
-
case UiActionInputType.MultipleFiles:
|
|
4134
|
-
return yield this.handleInputTypeUpload(inputTypeName, uiAction, uiActionRequest, true);
|
|
4135
|
-
default:
|
|
4136
|
-
return uiActionRequest;
|
|
4072
|
+
if (this.viewContext.translateService && actionDescriptor && !isUnkown) {
|
|
4073
|
+
actionDescriptor = yield this.translateUiActionDescriptor(actionDescriptor);
|
|
4137
4074
|
}
|
|
4075
|
+
return actionDescriptor;
|
|
4138
4076
|
});
|
|
4139
4077
|
}
|
|
4140
|
-
|
|
4078
|
+
translateUiActionDescriptor(uiActionDescriptor) {
|
|
4141
4079
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
if (uiAction[inputType] === UiActionInputType.Textfield) {
|
|
4145
|
-
this.textFieldDialogService.nodeName = additionalParams.forTextField;
|
|
4146
|
-
}
|
|
4147
|
-
else if (uiAction[inputType] === UiActionInputType.Textarea) {
|
|
4148
|
-
this.textFieldDialogService.nodeName = additionalParams.forTextArea;
|
|
4149
|
-
}
|
|
4150
|
-
this.textFieldDialogService.inputTypeName = inputTypeName;
|
|
4151
|
-
this.textFieldDialogService.action = uiAction;
|
|
4152
|
-
this.textFieldDialogService.openDialog();
|
|
4153
|
-
yield this.textFieldDialogService.onAction.toPromise();
|
|
4154
|
-
let params = this.textFieldDialogService.params;
|
|
4155
|
-
if (!params) {
|
|
4156
|
-
console.error('There was no response from InputDialog');
|
|
4157
|
-
return;
|
|
4158
|
-
}
|
|
4159
|
-
uiActionRequest.params = Object.assign(Object.assign({}, uiActionRequest.params), params);
|
|
4160
|
-
return uiActionRequest;
|
|
4080
|
+
uiActionDescriptor = yield this.deepTranslate(uiActionDescriptor);
|
|
4081
|
+
return uiActionDescriptor;
|
|
4161
4082
|
});
|
|
4162
4083
|
}
|
|
4163
|
-
|
|
4084
|
+
deepTranslate(_model) {
|
|
4164
4085
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
return
|
|
4086
|
+
let model = Object.assign({}, _model);
|
|
4087
|
+
yield Promise.all(Object.keys(model).map((key) => __awaiter(this, void 0, void 0, function* () {
|
|
4088
|
+
if (model[key] !== undefined &&
|
|
4089
|
+
typeof model[key] === 'string' &&
|
|
4090
|
+
model[key].length &&
|
|
4091
|
+
this.keysToTranslate.includes(key)) {
|
|
4092
|
+
model[key] = yield this.viewContext.translateService.get(model[key]).toPromise();
|
|
4093
|
+
}
|
|
4094
|
+
else if (model[key] !== undefined && typeof model[key] === 'object') {
|
|
4095
|
+
model[key] = yield this.deepTranslate(model[key]);
|
|
4096
|
+
}
|
|
4097
|
+
return model;
|
|
4098
|
+
})));
|
|
4099
|
+
return model;
|
|
4179
4100
|
});
|
|
4180
4101
|
}
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
uiActionRequest = response.uiActionRequest;
|
|
4188
|
-
return uiActionRequest;
|
|
4189
|
-
});
|
|
4102
|
+
setUpUnkownDialogDescriptor(code, uiActionDescriptor, dialogType) {
|
|
4103
|
+
let unkownDescriptor = this.basicActionDescriptors.get('UNKOWN');
|
|
4104
|
+
uiActionDescriptor[dialogType] = unkownDescriptor.dialog;
|
|
4105
|
+
uiActionDescriptor[dialogType].title = code;
|
|
4106
|
+
uiActionDescriptor[dialogType].actionButton.caption = code;
|
|
4107
|
+
return uiActionDescriptor;
|
|
4190
4108
|
}
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
}
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4109
|
+
}
|
|
4110
|
+
UiActionDescriptorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionDescriptorService, deps: [{ token: SmartViewContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4111
|
+
UiActionDescriptorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionDescriptorService, providedIn: 'root' });
|
|
4112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionDescriptorService, decorators: [{
|
|
4113
|
+
type: Injectable,
|
|
4114
|
+
args: [{
|
|
4115
|
+
providedIn: 'root',
|
|
4116
|
+
}]
|
|
4117
|
+
}], ctorParameters: function () { return [{ type: SmartViewContextService }]; } });
|
|
4118
|
+
|
|
4119
|
+
class SuccessSnackBarComponent {
|
|
4120
|
+
constructor(data, viewContext, manager) {
|
|
4121
|
+
this.data = data;
|
|
4122
|
+
this.viewContext = viewContext;
|
|
4123
|
+
this.manager = manager;
|
|
4124
|
+
this.manager.getActionDescriptor(data).then((descriptor) => {
|
|
4125
|
+
var _a;
|
|
4126
|
+
if (descriptor.feedbackText) {
|
|
4127
|
+
this.text = descriptor.feedbackText;
|
|
4208
4128
|
}
|
|
4209
|
-
|
|
4210
|
-
|
|
4129
|
+
else {
|
|
4130
|
+
this.text = (_a = this.viewContext.commonFeedbackText) !== null && _a !== void 0 ? _a : "A mentés sikeres volt!";
|
|
4211
4131
|
}
|
|
4212
4132
|
});
|
|
4213
4133
|
}
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4134
|
+
}
|
|
4135
|
+
SuccessSnackBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SuccessSnackBarComponent, deps: [{ token: MAT_SNACK_BAR_DATA }, { token: SmartViewContextService }, { token: UiActionDescriptorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4136
|
+
SuccessSnackBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SuccessSnackBarComponent, selector: "app-success-snack-bar", ngImport: i0, template: "<span class=\"successSnakBarContainer\" matSnackBarLabel> {{ text }} </span>\n", styles: ["::ng-deep .mat-snack-bar-container{text-align:center;border-radius:2rem}.successSnakBarContainer{color:#fff}\n"] });
|
|
4137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SuccessSnackBarComponent, decorators: [{
|
|
4138
|
+
type: Component,
|
|
4139
|
+
args: [{ selector: "app-success-snack-bar", template: "<span class=\"successSnakBarContainer\" matSnackBarLabel> {{ text }} </span>\n", styles: ["::ng-deep .mat-snack-bar-container{text-align:center;border-radius:2rem}.successSnakBarContainer{color:#fff}\n"] }]
|
|
4140
|
+
}], ctorParameters: function () {
|
|
4141
|
+
return [{ type: undefined, decorators: [{
|
|
4142
|
+
type: Inject,
|
|
4143
|
+
args: [MAT_SNACK_BAR_DATA]
|
|
4144
|
+
}] }, { type: SmartViewContextService }, { type: UiActionDescriptorService }];
|
|
4145
|
+
} });
|
|
4146
|
+
|
|
4147
|
+
class UiActionConfirmDialogComponent {
|
|
4148
|
+
constructor(service, manager) {
|
|
4149
|
+
this.service = service;
|
|
4150
|
+
this.manager = manager;
|
|
4151
|
+
this.code = this.service.action.code;
|
|
4152
|
+
this.setUp();
|
|
4153
|
+
}
|
|
4154
|
+
setUp() {
|
|
4155
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4156
|
+
this.descriptor = yield this.manager.getActionDescriptor(this.service.action);
|
|
4157
|
+
this.dialogType = this.descriptor.confirmDialog ? "confirmDialog" : "dialog";
|
|
4219
4158
|
});
|
|
4220
4159
|
}
|
|
4160
|
+
ngOnDestroy() {
|
|
4161
|
+
this.service._destroy$.next();
|
|
4162
|
+
this.cancel();
|
|
4163
|
+
}
|
|
4164
|
+
getTitle() {
|
|
4165
|
+
return this.descriptor[this.dialogType].title;
|
|
4166
|
+
}
|
|
4167
|
+
getText() {
|
|
4168
|
+
var _a;
|
|
4169
|
+
return (_a = this.descriptor[this.dialogType].text) !== null && _a !== void 0 ? _a : "";
|
|
4170
|
+
}
|
|
4171
|
+
getActionButtonLabel() {
|
|
4172
|
+
return this.descriptor[this.dialogType].actionButton.caption;
|
|
4173
|
+
}
|
|
4174
|
+
getActionButtonColor() {
|
|
4175
|
+
return this.descriptor[this.dialogType].actionButton.color;
|
|
4176
|
+
}
|
|
4177
|
+
getCancelButtonLabel() {
|
|
4178
|
+
return this.descriptor[this.dialogType].cancelButton.caption;
|
|
4179
|
+
}
|
|
4180
|
+
getCancelButtonColor() {
|
|
4181
|
+
return this.descriptor[this.dialogType].cancelButton.color;
|
|
4182
|
+
}
|
|
4183
|
+
doAction() {
|
|
4184
|
+
this.service.doAction();
|
|
4185
|
+
}
|
|
4186
|
+
cancel() {
|
|
4187
|
+
this.service.cancel();
|
|
4188
|
+
}
|
|
4221
4189
|
}
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type:
|
|
4190
|
+
UiActionConfirmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionConfirmDialogComponent, deps: [{ token: UiActionConfirmDialogService }, { token: UiActionDescriptorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4191
|
+
UiActionConfirmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: UiActionConfirmDialogComponent, selector: "app-ui-action-confirm-dialog", ngImport: i0, template: "<div class=\"folderNameDialogContainer\">\n\t<div class=\"headerContainer\">\n\t\t<h3 class=\"color-accent-700\">\n\t\t\t{{ getTitle() }}\n\t\t</h3>\n\t\t<button mat-icon-button title=\"close\" (click)=\"cancel()\">\n\t\t\t<smart-icon [color]=\"'primary'\" [icon]=\"'X'\"></smart-icon>\n\t\t</button>\n\t</div>\n\t<p>\n\t\t{{ getText() }}\n\t</p>\n\t<div class=\"folderNameDialogButtonsContainer\">\n\t\t<button mat-button color=\"accent\" [color]=\"getCancelButtonColor()\" (click)=\"cancel()\">\n\t\t\t{{ getCancelButtonLabel() }}\n\t\t</button>\n\t\t<button mat-raised-button [color]=\"getActionButtonColor()\" (click)=\"doAction()\">\n\t\t\t{{ getActionButtonLabel() }}\n\t\t</button>\n\t</div>\n</div>\n", styles: [".folderNameDialogContainer{width:25rem;display:flex;flex-direction:column;gap:1rem}.headerContainer{display:flex;flex-direction:row;justify-content:space-between}.headerContainer h3{margin:0}.folderNameDialogButtonsContainer{display:flex;flex-direction:row;justify-content:flex-end;gap:.5rem}\n"], components: [{ 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: i4$2.SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }] });
|
|
4192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionConfirmDialogComponent, decorators: [{
|
|
4193
|
+
type: Component,
|
|
4194
|
+
args: [{ selector: "app-ui-action-confirm-dialog", template: "<div class=\"folderNameDialogContainer\">\n\t<div class=\"headerContainer\">\n\t\t<h3 class=\"color-accent-700\">\n\t\t\t{{ getTitle() }}\n\t\t</h3>\n\t\t<button mat-icon-button title=\"close\" (click)=\"cancel()\">\n\t\t\t<smart-icon [color]=\"'primary'\" [icon]=\"'X'\"></smart-icon>\n\t\t</button>\n\t</div>\n\t<p>\n\t\t{{ getText() }}\n\t</p>\n\t<div class=\"folderNameDialogButtonsContainer\">\n\t\t<button mat-button color=\"accent\" [color]=\"getCancelButtonColor()\" (click)=\"cancel()\">\n\t\t\t{{ getCancelButtonLabel() }}\n\t\t</button>\n\t\t<button mat-raised-button [color]=\"getActionButtonColor()\" (click)=\"doAction()\">\n\t\t\t{{ getActionButtonLabel() }}\n\t\t</button>\n\t</div>\n</div>\n", styles: [".folderNameDialogContainer{width:25rem;display:flex;flex-direction:column;gap:1rem}.headerContainer{display:flex;flex-direction:row;justify-content:space-between}.headerContainer h3{margin:0}.folderNameDialogButtonsContainer{display:flex;flex-direction:row;justify-content:flex-end;gap:.5rem}\n"] }]
|
|
4195
|
+
}], ctorParameters: function () { return [{ type: UiActionConfirmDialogService }, { type: UiActionDescriptorService }]; } });
|
|
4196
|
+
|
|
4197
|
+
class UiActionConfirmDialogService extends SmartdialogService {
|
|
4198
|
+
constructor(dialog, router) {
|
|
4199
|
+
super(dialog, router);
|
|
4200
|
+
this._destroy$ = new Subject();
|
|
4201
|
+
this.onAction = new SmartSubject(this._destroy$);
|
|
4202
|
+
this.shouldDoAction = false;
|
|
4203
|
+
}
|
|
4204
|
+
openDialog() {
|
|
4205
|
+
this.shouldDoAction = false;
|
|
4206
|
+
this.onAction = new SmartSubject(this._destroy$);
|
|
4207
|
+
const dialogData = {
|
|
4208
|
+
content: {
|
|
4209
|
+
title: '',
|
|
4210
|
+
},
|
|
4211
|
+
size: {},
|
|
4212
|
+
customComponent: UiActionConfirmDialogComponent,
|
|
4213
|
+
};
|
|
4214
|
+
this.createDialog(dialogData, UiActionConfirmDialogComponent);
|
|
4215
|
+
}
|
|
4216
|
+
doAction() {
|
|
4217
|
+
this.shouldDoAction = true;
|
|
4218
|
+
this.onAction.complete();
|
|
4219
|
+
this.closeDialog();
|
|
4220
|
+
this.onAction = new SmartSubject(this._destroy$);
|
|
4221
|
+
}
|
|
4222
|
+
cancel() {
|
|
4223
|
+
this.onAction.complete();
|
|
4224
|
+
this.closeDialog();
|
|
4225
|
+
this.onAction = new SmartSubject(this._destroy$);
|
|
4226
|
+
}
|
|
4227
|
+
}
|
|
4228
|
+
UiActionConfirmDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionConfirmDialogService, deps: [{ token: i1$1.MatDialog }, { token: i2$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4229
|
+
UiActionConfirmDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionConfirmDialogService, providedIn: 'root' });
|
|
4230
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionConfirmDialogService, decorators: [{
|
|
4225
4231
|
type: Injectable,
|
|
4226
4232
|
args: [{
|
|
4227
4233
|
providedIn: 'root',
|
|
4228
4234
|
}]
|
|
4229
|
-
}], ctorParameters: function () { return [{ type:
|
|
4235
|
+
}], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: i2$1.Router }]; } });
|
|
4230
4236
|
|
|
4231
|
-
class
|
|
4232
|
-
constructor(service,
|
|
4237
|
+
class UiActionInputDialogComponent {
|
|
4238
|
+
constructor(service, manager) {
|
|
4233
4239
|
this.service = service;
|
|
4234
|
-
this.
|
|
4235
|
-
this.
|
|
4236
|
-
this.pressedButtonActive = true;
|
|
4237
|
-
// Injects the basic UiActionDescriptorService provided by the AppModule
|
|
4238
|
-
this.manager = inject.get(UiActionDescriptorService);
|
|
4239
|
-
this.subscribeToLanguageChange();
|
|
4240
|
-
}
|
|
4241
|
-
ngOnInit() {
|
|
4242
|
-
// Overrides the basic UiActionDescriptorService with a custom one if there is one
|
|
4243
|
-
if (this.uiActionDescriptorService) {
|
|
4244
|
-
this.manager = this.uiActionDescriptorService;
|
|
4245
|
-
this.subscribeToLanguageChange();
|
|
4246
|
-
}
|
|
4240
|
+
this.manager = manager;
|
|
4241
|
+
this.code = this.service.action.code;
|
|
4247
4242
|
this.setUp();
|
|
4248
4243
|
}
|
|
4249
|
-
ngOnChanges(changes) {
|
|
4250
|
-
let uiActionModels = changes['uiActionModels'].currentValue;
|
|
4251
|
-
if (uiActionModels) {
|
|
4252
|
-
this.uiActionModels = uiActionModels;
|
|
4253
|
-
this.setUp();
|
|
4254
|
-
}
|
|
4255
|
-
}
|
|
4256
4244
|
ngOnDestroy() {
|
|
4257
|
-
this._destroy$.next();
|
|
4258
|
-
|
|
4259
|
-
subscribeToLanguageChange() {
|
|
4260
|
-
var _a;
|
|
4261
|
-
(_a = this.languageChangedSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
4262
|
-
this.languageChangedSubscription = this.manager.languageChanged
|
|
4263
|
-
.pipe(takeUntil(this._destroy$))
|
|
4264
|
-
.subscribe(() => {
|
|
4265
|
-
this.setUp();
|
|
4266
|
-
});
|
|
4245
|
+
this.service._destroy$.next();
|
|
4246
|
+
this.cancel();
|
|
4267
4247
|
}
|
|
4268
4248
|
setUp() {
|
|
4269
4249
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4270
|
-
this.
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
})));
|
|
4274
|
-
});
|
|
4275
|
-
}
|
|
4276
|
-
onActionClicked(event, uiActionModel) {
|
|
4277
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
4278
|
-
event.stopPropagation();
|
|
4279
|
-
if (this.pressedButtonActive) {
|
|
4280
|
-
this.pressedButtonActive = false;
|
|
4281
|
-
this.service.uiActionModel = uiActionModel;
|
|
4282
|
-
let options = {
|
|
4283
|
-
nodeId: uiActionModel.nodeId,
|
|
4284
|
-
widgetId: uiActionModel.widgetId,
|
|
4285
|
-
};
|
|
4286
|
-
yield this.service.execute(uiActionModel.uiAction, options);
|
|
4287
|
-
this.pressedButtonActive = true;
|
|
4250
|
+
this.descriptor = yield this.manager.getActionDescriptor(this.service.action);
|
|
4251
|
+
if (this.descriptor[this.service.inputTypeName]) {
|
|
4252
|
+
this.dialogType = this.service.inputTypeName;
|
|
4288
4253
|
}
|
|
4254
|
+
else {
|
|
4255
|
+
this.dialogType = this.descriptor.inputDialog ? 'inputDialog' : 'dialog';
|
|
4256
|
+
}
|
|
4257
|
+
this.constructForm();
|
|
4289
4258
|
});
|
|
4290
4259
|
}
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
// We do not handle double clicks
|
|
4260
|
+
getTitle() {
|
|
4261
|
+
return this.descriptor[this.dialogType].title;
|
|
4294
4262
|
}
|
|
4295
|
-
|
|
4296
|
-
var _a
|
|
4297
|
-
|
|
4298
|
-
case UiActionButtonType.Normal:
|
|
4299
|
-
return 'mat-button';
|
|
4300
|
-
case UiActionButtonType.Flat:
|
|
4301
|
-
return 'mat-flat-button';
|
|
4302
|
-
case UiActionButtonType.Raised:
|
|
4303
|
-
return 'mat-raised-button';
|
|
4304
|
-
case UiActionButtonType.Stroked:
|
|
4305
|
-
return 'mat-stroked-button';
|
|
4306
|
-
case UiActionButtonType.Icon:
|
|
4307
|
-
return 'mat-icon-button';
|
|
4308
|
-
case UiActionButtonType.MiniFab:
|
|
4309
|
-
return 'mat-mini-fab';
|
|
4310
|
-
case UiActionButtonType.Fab:
|
|
4311
|
-
return 'mat-fab';
|
|
4312
|
-
default:
|
|
4313
|
-
console.log(`Unhandled action button type case: ${(_b = uiActionModel.descriptor) === null || _b === void 0 ? void 0 : _b.type}`);
|
|
4314
|
-
return `mat-button`;
|
|
4315
|
-
}
|
|
4263
|
+
getText() {
|
|
4264
|
+
var _a;
|
|
4265
|
+
return (_a = this.descriptor[this.dialogType].text) !== null && _a !== void 0 ? _a : '';
|
|
4316
4266
|
}
|
|
4317
|
-
|
|
4318
|
-
return
|
|
4267
|
+
getActionButtonLabel() {
|
|
4268
|
+
return this.descriptor[this.dialogType].actionButton.caption;
|
|
4319
4269
|
}
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4270
|
+
getActionButtonColor() {
|
|
4271
|
+
return this.descriptor[this.dialogType].actionButton.color;
|
|
4272
|
+
}
|
|
4273
|
+
getCancelButtonLabel() {
|
|
4274
|
+
return this.descriptor[this.dialogType].cancelButton.caption;
|
|
4275
|
+
}
|
|
4276
|
+
getCancelButtonColor() {
|
|
4277
|
+
return this.descriptor[this.dialogType].cancelButton.color;
|
|
4278
|
+
}
|
|
4279
|
+
constructForm() {
|
|
4280
|
+
var _a, _b, _c;
|
|
4281
|
+
let model = {};
|
|
4282
|
+
let inputName;
|
|
4283
|
+
if (this.service.inputTypeName === 'inputDialog') {
|
|
4284
|
+
inputName = 'input';
|
|
4285
|
+
}
|
|
4286
|
+
else {
|
|
4287
|
+
inputName = 'input2';
|
|
4288
|
+
}
|
|
4289
|
+
if (this.service.nodeName) {
|
|
4290
|
+
model[inputName] = this.service.nodeName;
|
|
4291
|
+
}
|
|
4292
|
+
else {
|
|
4293
|
+
model[inputName] = '';
|
|
4294
|
+
}
|
|
4295
|
+
let type;
|
|
4296
|
+
let inputType = `${inputName}Type`;
|
|
4297
|
+
if (this.service.action[inputType] === UiActionInputType.Textfield) {
|
|
4298
|
+
type = SmartFormWidgetType.TEXT_FIELD;
|
|
4299
|
+
}
|
|
4300
|
+
else {
|
|
4301
|
+
type = SmartFormWidgetType.TEXT_BOX;
|
|
4302
|
+
}
|
|
4303
|
+
let widgets = [
|
|
4304
|
+
{
|
|
4305
|
+
key: inputName,
|
|
4306
|
+
label: '',
|
|
4307
|
+
type,
|
|
4308
|
+
value: '',
|
|
4309
|
+
validators: [
|
|
4310
|
+
{
|
|
4311
|
+
validator: Validators.required,
|
|
4312
|
+
name: SmartValidatorName.required,
|
|
4313
|
+
errorMessage: 'Ez a mező kötelező',
|
|
4314
|
+
},
|
|
4315
|
+
],
|
|
4316
|
+
placeholder: (_a = this.descriptor[this.dialogType].placeholder) !== null && _a !== void 0 ? _a : '',
|
|
4317
|
+
showLabel: true,
|
|
4318
|
+
},
|
|
4319
|
+
];
|
|
4320
|
+
if (widgets[0].type === SmartFormWidgetType.TEXT_FIELD && ((_b = this.descriptor[this.dialogType]) === null || _b === void 0 ? void 0 : _b.mask)) {
|
|
4321
|
+
widgets[0].mask = (_c = this.descriptor[this.dialogType]) === null || _c === void 0 ? void 0 : _c.mask;
|
|
4322
|
+
}
|
|
4323
|
+
this.folderForm = {
|
|
4324
|
+
direction: SmartFormWidgetDirection.COL,
|
|
4325
|
+
model,
|
|
4326
|
+
widgets,
|
|
4327
|
+
};
|
|
4328
|
+
}
|
|
4329
|
+
save() {
|
|
4330
|
+
let form = this.folderFormChild.submitForm();
|
|
4331
|
+
if (form.invalidFields) {
|
|
4332
|
+
throw new Error('The form is invalid!');
|
|
4333
|
+
}
|
|
4334
|
+
this.service.onSave(form.model);
|
|
4335
|
+
}
|
|
4336
|
+
cancel() {
|
|
4337
|
+
this.service.cancel();
|
|
4325
4338
|
}
|
|
4326
4339
|
}
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type:
|
|
4340
|
+
UiActionInputDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionInputDialogComponent, deps: [{ token: UiActionInputDialogService }, { token: UiActionDescriptorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4341
|
+
UiActionInputDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: UiActionInputDialogComponent, selector: "smart-ui-action-input-dialog", viewQueries: [{ propertyName: "folderFormChild", first: true, predicate: ["form"], descendants: true }], ngImport: i0, template: "<div class=\"folderNameDialogContainer\">\n\t<div class=\"headerContainer\">\n\t\t<h3 class=\"color-accent-700\">\n\t\t\t{{ getTitle() }}\n\t\t</h3>\n\t\t<button mat-icon-button title=\"close\" (click)=\"cancel()\">\n\t\t\t<smart-icon [color]=\"'primary'\" [icon]=\"'X'\"></smart-icon>\n\t\t</button>\n\t</div>\n\t<p>\n\t\t{{ getText() }}\n\t</p>\n\t<smartform #form [smartForm]=\"folderForm\"></smartform>\n\t<div class=\"folderNameDialogButtonsContainer\">\n\t\t<button mat-button color=\"accent\" [color]=\"getCancelButtonColor()\" (click)=\"cancel()\">\n\t\t\t{{ getCancelButtonLabel() }}\n\t\t</button>\n\t\t<button mat-raised-button [color]=\"getActionButtonColor()\" (click)=\"save()\">\n\t\t\t{{ getActionButtonLabel() }}\n\t\t</button>\n\t</div>\n</div>\n", styles: [".folderNameDialogContainer{width:25rem;display:flex;flex-direction:column;gap:1rem}.headerContainer{display:flex;flex-direction:row;justify-content:space-between}.headerContainer h3{margin:0}.folderNameDialogButtonsContainer{display:flex;flex-direction:row;justify-content:flex-end;gap:.5rem}\n"], components: [{ 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: i4$2.SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { type: i1$2.SmartformComponent, selector: "smartform", inputs: ["smartForm"] }] });
|
|
4342
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionInputDialogComponent, decorators: [{
|
|
4330
4343
|
type: Component,
|
|
4331
|
-
args: [{ selector: 'smart-ui-action-
|
|
4332
|
-
}], ctorParameters: function () { return [{ type:
|
|
4333
|
-
type:
|
|
4334
|
-
|
|
4335
|
-
type: Input
|
|
4344
|
+
args: [{ selector: 'smart-ui-action-input-dialog', template: "<div class=\"folderNameDialogContainer\">\n\t<div class=\"headerContainer\">\n\t\t<h3 class=\"color-accent-700\">\n\t\t\t{{ getTitle() }}\n\t\t</h3>\n\t\t<button mat-icon-button title=\"close\" (click)=\"cancel()\">\n\t\t\t<smart-icon [color]=\"'primary'\" [icon]=\"'X'\"></smart-icon>\n\t\t</button>\n\t</div>\n\t<p>\n\t\t{{ getText() }}\n\t</p>\n\t<smartform #form [smartForm]=\"folderForm\"></smartform>\n\t<div class=\"folderNameDialogButtonsContainer\">\n\t\t<button mat-button color=\"accent\" [color]=\"getCancelButtonColor()\" (click)=\"cancel()\">\n\t\t\t{{ getCancelButtonLabel() }}\n\t\t</button>\n\t\t<button mat-raised-button [color]=\"getActionButtonColor()\" (click)=\"save()\">\n\t\t\t{{ getActionButtonLabel() }}\n\t\t</button>\n\t</div>\n</div>\n", styles: [".folderNameDialogContainer{width:25rem;display:flex;flex-direction:column;gap:1rem}.headerContainer{display:flex;flex-direction:row;justify-content:space-between}.headerContainer h3{margin:0}.folderNameDialogButtonsContainer{display:flex;flex-direction:row;justify-content:flex-end;gap:.5rem}\n"] }]
|
|
4345
|
+
}], ctorParameters: function () { return [{ type: UiActionInputDialogService }, { type: UiActionDescriptorService }]; }, propDecorators: { folderFormChild: [{
|
|
4346
|
+
type: ViewChild,
|
|
4347
|
+
args: ['form']
|
|
4336
4348
|
}] } });
|
|
4337
4349
|
|
|
4338
|
-
class
|
|
4350
|
+
class UiActionInputDialogService extends SmartdialogService {
|
|
4351
|
+
constructor(dialog, router) {
|
|
4352
|
+
super(dialog, router);
|
|
4353
|
+
this._destroy$ = new Subject();
|
|
4354
|
+
this.onAction = new SmartSubject(this._destroy$);
|
|
4355
|
+
}
|
|
4356
|
+
setDataAndOpenDialog(action, nodeName) {
|
|
4357
|
+
this.action = action;
|
|
4358
|
+
this.nodeName = nodeName;
|
|
4359
|
+
this.openDialog();
|
|
4360
|
+
}
|
|
4361
|
+
openDialog() {
|
|
4362
|
+
this.params = undefined;
|
|
4363
|
+
this.onAction = new SmartSubject(this._destroy$);
|
|
4364
|
+
const dialogData = {
|
|
4365
|
+
content: {
|
|
4366
|
+
title: '',
|
|
4367
|
+
},
|
|
4368
|
+
size: {},
|
|
4369
|
+
customComponent: UiActionInputDialogComponent,
|
|
4370
|
+
};
|
|
4371
|
+
this.createDialog(dialogData, UiActionInputDialogComponent);
|
|
4372
|
+
}
|
|
4373
|
+
onSave(params) {
|
|
4374
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4375
|
+
this.params = params;
|
|
4376
|
+
this.onAction.complete();
|
|
4377
|
+
this.closeDialog();
|
|
4378
|
+
this.onAction = new SmartSubject(this._destroy$);
|
|
4379
|
+
});
|
|
4380
|
+
}
|
|
4381
|
+
cancel() {
|
|
4382
|
+
this.onAction.complete();
|
|
4383
|
+
this.closeDialog();
|
|
4384
|
+
this.onAction = new SmartSubject(this._destroy$);
|
|
4385
|
+
}
|
|
4339
4386
|
}
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
UiActionToolbarComponent,
|
|
4345
|
-
UiActionInputDialogComponent,
|
|
4346
|
-
UiActionConfirmDialogComponent,
|
|
4347
|
-
UiActionFileUploadDialogComponent], imports: [CommonModule,
|
|
4348
|
-
HttpClientModule,
|
|
4349
|
-
MatCommonModule,
|
|
4350
|
-
MatButtonModule,
|
|
4351
|
-
MatIconModule,
|
|
4352
|
-
MatSnackBarModule,
|
|
4353
|
-
SmartIconModule,
|
|
4354
|
-
SmartformModule], exports: [UiActionToolbarComponent, UiActionInputDialogComponent] });
|
|
4355
|
-
SmartViewContextModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextModule, providers: [
|
|
4356
|
-
SmartViewContextService,
|
|
4357
|
-
{
|
|
4358
|
-
provide: HTTP_INTERCEPTORS,
|
|
4359
|
-
useClass: SmartViewContextInterceptor,
|
|
4360
|
-
multi: true,
|
|
4361
|
-
},
|
|
4362
|
-
], imports: [[
|
|
4363
|
-
CommonModule,
|
|
4364
|
-
HttpClientModule,
|
|
4365
|
-
MatCommonModule,
|
|
4366
|
-
MatButtonModule,
|
|
4367
|
-
MatIconModule,
|
|
4368
|
-
MatSnackBarModule,
|
|
4369
|
-
SmartIconModule,
|
|
4370
|
-
SmartformModule,
|
|
4371
|
-
]] });
|
|
4372
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextModule, decorators: [{
|
|
4373
|
-
type: NgModule,
|
|
4387
|
+
UiActionInputDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionInputDialogService, deps: [{ token: i1$1.MatDialog }, { token: i2$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4388
|
+
UiActionInputDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionInputDialogService, providedIn: 'root' });
|
|
4389
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionInputDialogService, decorators: [{
|
|
4390
|
+
type: Injectable,
|
|
4374
4391
|
args: [{
|
|
4375
|
-
|
|
4376
|
-
MessageDialogComponent,
|
|
4377
|
-
SmartViewContextErrorDialogComponent,
|
|
4378
|
-
SmartViewRedirect,
|
|
4379
|
-
UiActionToolbarComponent,
|
|
4380
|
-
UiActionInputDialogComponent,
|
|
4381
|
-
UiActionConfirmDialogComponent,
|
|
4382
|
-
UiActionFileUploadDialogComponent,
|
|
4383
|
-
],
|
|
4384
|
-
imports: [
|
|
4385
|
-
CommonModule,
|
|
4386
|
-
HttpClientModule,
|
|
4387
|
-
MatCommonModule,
|
|
4388
|
-
MatButtonModule,
|
|
4389
|
-
MatIconModule,
|
|
4390
|
-
MatSnackBarModule,
|
|
4391
|
-
SmartIconModule,
|
|
4392
|
-
SmartformModule,
|
|
4393
|
-
],
|
|
4394
|
-
exports: [UiActionToolbarComponent, UiActionInputDialogComponent],
|
|
4395
|
-
providers: [
|
|
4396
|
-
SmartViewContextService,
|
|
4397
|
-
{
|
|
4398
|
-
provide: HTTP_INTERCEPTORS,
|
|
4399
|
-
useClass: SmartViewContextInterceptor,
|
|
4400
|
-
multi: true,
|
|
4401
|
-
},
|
|
4402
|
-
],
|
|
4392
|
+
providedIn: 'root',
|
|
4403
4393
|
}]
|
|
4404
|
-
}] });
|
|
4405
|
-
|
|
4406
|
-
var UiActionDialogType;
|
|
4407
|
-
(function (UiActionDialogType) {
|
|
4408
|
-
UiActionDialogType["inputDialog"] = "inputDialog";
|
|
4409
|
-
UiActionDialogType["confirmDialog"] = "confirmDialog";
|
|
4410
|
-
UiActionDialogType["dialog"] = "dialog";
|
|
4411
|
-
})(UiActionDialogType || (UiActionDialogType = {}));
|
|
4412
|
-
|
|
4413
|
-
/*
|
|
4414
|
-
* Public API Surface of smart-view-context
|
|
4415
|
-
*/
|
|
4394
|
+
}], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: i2$1.Router }]; } });
|
|
4416
4395
|
|
|
4417
|
-
class
|
|
4418
|
-
constructor(
|
|
4419
|
-
this.
|
|
4420
|
-
this.
|
|
4396
|
+
class UiActionFileUploadDialogComponent {
|
|
4397
|
+
constructor(service, manager) {
|
|
4398
|
+
this.service = service;
|
|
4399
|
+
this.manager = manager;
|
|
4400
|
+
this.code = this.service.action.code;
|
|
4401
|
+
this.setUp();
|
|
4421
4402
|
}
|
|
4422
|
-
|
|
4423
|
-
this.
|
|
4424
|
-
|
|
4425
|
-
this.setUp();
|
|
4426
|
-
}
|
|
4403
|
+
ngOnDestroy() {
|
|
4404
|
+
this.service._destroy$.next();
|
|
4405
|
+
this.cancel();
|
|
4427
4406
|
}
|
|
4428
4407
|
setUp() {
|
|
4429
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
4408
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
4430
4409
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4431
|
-
this.
|
|
4432
|
-
|
|
4433
|
-
throw new Error(`UiAction with code ${(_b = this.config) === null || _b === void 0 ? void 0 : _b.uiActionCode} could not found`);
|
|
4434
|
-
}
|
|
4435
|
-
const descriptor = yield this.uiActionDescriptorService.getActionDescriptor(this.uiActionModel.uiAction);
|
|
4410
|
+
this.descriptor = yield this.manager.getActionDescriptor(this.service.action);
|
|
4411
|
+
this.isMultiple = this.service.isMultiple;
|
|
4436
4412
|
this.i18n = {
|
|
4437
|
-
addFile: (
|
|
4438
|
-
browseOrDrag: (
|
|
4439
|
-
formats: (
|
|
4440
|
-
maxSize: (
|
|
4441
|
-
upload: (
|
|
4413
|
+
addFile: (_b = (_a = this.descriptor.upload) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : 'dokumentum hozzáadása',
|
|
4414
|
+
browseOrDrag: (_d = (_c = this.descriptor.upload) === null || _c === void 0 ? void 0 : _c.description) !== null && _d !== void 0 ? _d : 'tallózás vagy behúzás',
|
|
4415
|
+
formats: (_f = (_e = this.descriptor.upload) === null || _e === void 0 ? void 0 : _e.formats) !== null && _f !== void 0 ? _f : '',
|
|
4416
|
+
maxSize: (_h = (_g = this.descriptor.upload) === null || _g === void 0 ? void 0 : _g.maxSize) !== null && _h !== void 0 ? _h : '',
|
|
4417
|
+
upload: (_j = this.descriptor.upload) === null || _j === void 0 ? void 0 : _j.uploadButtonTitle,
|
|
4442
4418
|
};
|
|
4419
|
+
// TODO set max size and file formats by UiAction.params
|
|
4420
|
+
if (this.descriptor[this.service.inputTypeName]) {
|
|
4421
|
+
this.dialogType = this.service.inputTypeName;
|
|
4422
|
+
}
|
|
4423
|
+
else {
|
|
4424
|
+
this.dialogType = this.descriptor.inputDialog ? 'inputDialog' : 'dialog';
|
|
4425
|
+
}
|
|
4443
4426
|
});
|
|
4444
4427
|
}
|
|
4445
|
-
|
|
4428
|
+
getTitle() {
|
|
4429
|
+
return this.descriptor[this.dialogType].title;
|
|
4430
|
+
}
|
|
4431
|
+
getText() {
|
|
4446
4432
|
var _a;
|
|
4447
|
-
|
|
4448
|
-
this.uiActionService.uiActionModel = this.uiActionModel;
|
|
4449
|
-
this.uiActionService.execute(this.uiActionModel.uiAction);
|
|
4433
|
+
return (_a = this.descriptor[this.dialogType].text) !== null && _a !== void 0 ? _a : '';
|
|
4450
4434
|
}
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
SmartFileUploaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SmartFileUploaderComponent, selector: "smart-file-uploader4sc", inputs: { config: "config" }, usesOnChanges: true, ngImport: i0, template: "<smartfileuploader\n *ngIf=\"i18n\"\n [i18n]=\"i18n\"\n [fileFormats]=\"config?.fileFormats\"\n [isMultiple]=\"config?.isMultiple\"\n [maxSizeMb]=\"config?.maxSizeMb\"\n [uploadCallback]=\"executeUpload.bind(this)\"\n></smartfileuploader>\n", styles: [""], components: [{ type: i1$2.SmartfileuploaderComponent, selector: "smartfileuploader", inputs: ["uploadCallback", "fileFormats", "maxSizeMb", "i18n", "useIconButton", "isMultiple"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
4454
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartFileUploaderComponent, decorators: [{
|
|
4455
|
-
type: Component,
|
|
4456
|
-
args: [{ selector: 'smart-file-uploader4sc', template: "<smartfileuploader\n *ngIf=\"i18n\"\n [i18n]=\"i18n\"\n [fileFormats]=\"config?.fileFormats\"\n [isMultiple]=\"config?.isMultiple\"\n [maxSizeMb]=\"config?.maxSizeMb\"\n [uploadCallback]=\"executeUpload.bind(this)\"\n></smartfileuploader>\n", styles: [""] }]
|
|
4457
|
-
}], ctorParameters: function () { return [{ type: UiActionService }, { type: UiActionDescriptorService }]; }, propDecorators: { config: [{
|
|
4458
|
-
type: Input
|
|
4459
|
-
}] } });
|
|
4460
|
-
|
|
4461
|
-
/**
|
|
4462
|
-
* Custom HttpParameterCodec
|
|
4463
|
-
* Workaround for https://github.com/angular/angular/issues/18261
|
|
4464
|
-
*/
|
|
4465
|
-
class CustomHttpParameterCodec {
|
|
4466
|
-
encodeKey(k) {
|
|
4467
|
-
return encodeURIComponent(k);
|
|
4435
|
+
getActionButtonLabel() {
|
|
4436
|
+
return this.descriptor[this.dialogType].actionButton.caption;
|
|
4468
4437
|
}
|
|
4469
|
-
|
|
4470
|
-
return
|
|
4438
|
+
getActionButtonColor() {
|
|
4439
|
+
return this.descriptor[this.dialogType].actionButton.color;
|
|
4471
4440
|
}
|
|
4472
|
-
|
|
4473
|
-
return
|
|
4441
|
+
getCancelButtonLabel() {
|
|
4442
|
+
return this.descriptor[this.dialogType].cancelButton.caption;
|
|
4474
4443
|
}
|
|
4475
|
-
|
|
4476
|
-
return
|
|
4444
|
+
getCancelButtonColor() {
|
|
4445
|
+
return this.descriptor[this.dialogType].cancelButton.color;
|
|
4446
|
+
}
|
|
4447
|
+
upload(files) {
|
|
4448
|
+
this.service.onSave(files);
|
|
4449
|
+
}
|
|
4450
|
+
cancel() {
|
|
4451
|
+
this.service.cancel();
|
|
4477
4452
|
}
|
|
4478
4453
|
}
|
|
4454
|
+
UiActionFileUploadDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionFileUploadDialogComponent, deps: [{ token: UiActionFileUploadDialogService }, { token: UiActionDescriptorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4455
|
+
UiActionFileUploadDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: UiActionFileUploadDialogComponent, selector: "lib-ui-action-file-upload-dialog", ngImport: i0, template: "<div class=\"folderNameDialogContainer\">\n <div class=\"headerContainer\">\n <h3 class=\"color-accent-700\">\n {{ getTitle() }}\n </h3>\n <button mat-icon-button title=\"close\" (click)=\"cancel()\">\n <smart-icon [color]=\"'primary'\" [icon]=\"'X'\"></smart-icon>\n </button>\n </div>\n <p>\n {{ getText() }}\n </p>\n <smartfileuploader\n [i18n]=\"i18n\"\n [fileFormats]=\"fileFormats\"\n [maxSizeMb]=\"maxSizeMb\"\n [uploadCallback]=\"upload.bind(this)\"\n [isMultiple]=\"isMultiple\"\n ></smartfileuploader>\n <div class=\"folderNameDialogButtonsContainer\">\n <button mat-button color=\"accent\" [color]=\"getCancelButtonColor()\" (click)=\"cancel()\">\n {{ getCancelButtonLabel() }}\n </button>\n <!-- <button mat-raised-button [color]=\"getActionButtonColor()\" (click)=\"upload()\">\n {{ getActionButtonLabel() }}\n </button> -->\n </div>\n</div>\n", styles: [".folderNameDialogContainer{width:25rem;display:flex;flex-direction:column;gap:1rem}.headerContainer{display:flex;flex-direction:row;justify-content:space-between}.headerContainer h3{margin:0}.folderNameDialogButtonsContainer{display:flex;flex-direction:row;justify-content:flex-end;gap:.5rem}\n"], components: [{ 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: i4$2.SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { type: i1$2.SmartfileuploaderComponent, selector: "smartfileuploader", inputs: ["uploadCallback", "fileFormats", "maxSizeMb", "i18n", "useIconButton", "isMultiple"] }] });
|
|
4456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionFileUploadDialogComponent, decorators: [{
|
|
4457
|
+
type: Component,
|
|
4458
|
+
args: [{ selector: 'lib-ui-action-file-upload-dialog', template: "<div class=\"folderNameDialogContainer\">\n <div class=\"headerContainer\">\n <h3 class=\"color-accent-700\">\n {{ getTitle() }}\n </h3>\n <button mat-icon-button title=\"close\" (click)=\"cancel()\">\n <smart-icon [color]=\"'primary'\" [icon]=\"'X'\"></smart-icon>\n </button>\n </div>\n <p>\n {{ getText() }}\n </p>\n <smartfileuploader\n [i18n]=\"i18n\"\n [fileFormats]=\"fileFormats\"\n [maxSizeMb]=\"maxSizeMb\"\n [uploadCallback]=\"upload.bind(this)\"\n [isMultiple]=\"isMultiple\"\n ></smartfileuploader>\n <div class=\"folderNameDialogButtonsContainer\">\n <button mat-button color=\"accent\" [color]=\"getCancelButtonColor()\" (click)=\"cancel()\">\n {{ getCancelButtonLabel() }}\n </button>\n <!-- <button mat-raised-button [color]=\"getActionButtonColor()\" (click)=\"upload()\">\n {{ getActionButtonLabel() }}\n </button> -->\n </div>\n</div>\n", styles: [".folderNameDialogContainer{width:25rem;display:flex;flex-direction:column;gap:1rem}.headerContainer{display:flex;flex-direction:row;justify-content:space-between}.headerContainer h3{margin:0}.folderNameDialogButtonsContainer{display:flex;flex-direction:row;justify-content:flex-end;gap:.5rem}\n"] }]
|
|
4459
|
+
}], ctorParameters: function () { return [{ type: UiActionFileUploadDialogService }, { type: UiActionDescriptorService }]; } });
|
|
4479
4460
|
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
};
|
|
4487
|
-
|
|
4488
|
-
class Configuration {
|
|
4489
|
-
constructor(configurationParameters = {}) {
|
|
4490
|
-
this.apiKeys = configurationParameters.apiKeys;
|
|
4491
|
-
this.username = configurationParameters.username;
|
|
4492
|
-
this.password = configurationParameters.password;
|
|
4493
|
-
this.accessToken = configurationParameters.accessToken;
|
|
4494
|
-
this.basePath = configurationParameters.basePath;
|
|
4495
|
-
this.withCredentials = configurationParameters.withCredentials;
|
|
4496
|
-
this.encoder = configurationParameters.encoder;
|
|
4497
|
-
if (configurationParameters.encodeParam) {
|
|
4498
|
-
this.encodeParam = configurationParameters.encodeParam;
|
|
4499
|
-
}
|
|
4500
|
-
else {
|
|
4501
|
-
this.encodeParam = param => this.defaultEncodeParam(param);
|
|
4502
|
-
}
|
|
4503
|
-
if (configurationParameters.credentials) {
|
|
4504
|
-
this.credentials = configurationParameters.credentials;
|
|
4505
|
-
}
|
|
4506
|
-
else {
|
|
4507
|
-
this.credentials = {};
|
|
4508
|
-
}
|
|
4509
|
-
}
|
|
4510
|
-
/**
|
|
4511
|
-
* Select the correct content-type to use for a request.
|
|
4512
|
-
* Uses {@link Configuration#isJsonMime} to determine the correct content-type.
|
|
4513
|
-
* If no content type is found return the first found type if the contentTypes is not empty
|
|
4514
|
-
* @param contentTypes - the array of content types that are available for selection
|
|
4515
|
-
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
4516
|
-
*/
|
|
4517
|
-
selectHeaderContentType(contentTypes) {
|
|
4518
|
-
if (contentTypes.length === 0) {
|
|
4519
|
-
return undefined;
|
|
4520
|
-
}
|
|
4521
|
-
const type = contentTypes.find((x) => this.isJsonMime(x));
|
|
4522
|
-
if (type === undefined) {
|
|
4523
|
-
return contentTypes[0];
|
|
4524
|
-
}
|
|
4525
|
-
return type;
|
|
4461
|
+
class UiActionFileUploadDialogService extends SmartdialogService {
|
|
4462
|
+
constructor(dialog, router) {
|
|
4463
|
+
super(dialog, router);
|
|
4464
|
+
this._destroy$ = new Subject();
|
|
4465
|
+
this.onAction = new SmartSubject(this._destroy$);
|
|
4466
|
+
this.isMultiple = false;
|
|
4526
4467
|
}
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
* @param accepts - the array of content types that are available for selection.
|
|
4532
|
-
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
4533
|
-
*/
|
|
4534
|
-
selectHeaderAccept(accepts) {
|
|
4535
|
-
if (accepts.length === 0) {
|
|
4536
|
-
return undefined;
|
|
4537
|
-
}
|
|
4538
|
-
const type = accepts.find((x) => this.isJsonMime(x));
|
|
4539
|
-
if (type === undefined) {
|
|
4540
|
-
return accepts[0];
|
|
4541
|
-
}
|
|
4542
|
-
return type;
|
|
4468
|
+
setDataAndOpenDialog(action, nodeName) {
|
|
4469
|
+
this.action = action;
|
|
4470
|
+
this.nodeName = nodeName;
|
|
4471
|
+
this.openDialog();
|
|
4543
4472
|
}
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
4556
|
-
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
4473
|
+
openDialog() {
|
|
4474
|
+
this.files = undefined;
|
|
4475
|
+
this.onAction = new SmartSubject(this._destroy$);
|
|
4476
|
+
const dialogData = {
|
|
4477
|
+
content: {
|
|
4478
|
+
title: '',
|
|
4479
|
+
},
|
|
4480
|
+
size: {},
|
|
4481
|
+
customComponent: UiActionFileUploadDialogComponent,
|
|
4482
|
+
};
|
|
4483
|
+
this.createDialog(dialogData, UiActionFileUploadDialogComponent);
|
|
4557
4484
|
}
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4485
|
+
onSave(files) {
|
|
4486
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4487
|
+
this.files = files;
|
|
4488
|
+
this.onAction.complete();
|
|
4489
|
+
this.closeDialog();
|
|
4490
|
+
this.onAction = new SmartSubject(this._destroy$);
|
|
4491
|
+
});
|
|
4563
4492
|
}
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
// Date-handling only works for the 'date-time' format.
|
|
4569
|
-
// All other styles and Date-formats are probably handled incorrectly.
|
|
4570
|
-
//
|
|
4571
|
-
// But: if that's all you need (i.e.: the most common use-case): no need for customization!
|
|
4572
|
-
const value = param.dataFormat === 'date-time' && param.value instanceof Date
|
|
4573
|
-
? param.value.toISOString()
|
|
4574
|
-
: param.value;
|
|
4575
|
-
return encodeURIComponent(String(value));
|
|
4493
|
+
cancel() {
|
|
4494
|
+
this.onAction.complete();
|
|
4495
|
+
this.closeDialog();
|
|
4496
|
+
this.onAction = new SmartSubject(this._destroy$);
|
|
4576
4497
|
}
|
|
4577
4498
|
}
|
|
4499
|
+
UiActionFileUploadDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionFileUploadDialogService, deps: [{ token: i1$1.MatDialog }, { token: i2$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4500
|
+
UiActionFileUploadDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionFileUploadDialogService, providedIn: 'root' });
|
|
4501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionFileUploadDialogService, decorators: [{
|
|
4502
|
+
type: Injectable,
|
|
4503
|
+
args: [{
|
|
4504
|
+
providedIn: 'root',
|
|
4505
|
+
}]
|
|
4506
|
+
}], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: i2$1.Router }]; } });
|
|
4578
4507
|
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
4587
|
-
* https://openapi-generator.tech
|
|
4588
|
-
* Do not edit the class manually.
|
|
4589
|
-
*/
|
|
4590
|
-
class DefaultService {
|
|
4591
|
-
constructor(httpClient, basePath, configuration) {
|
|
4592
|
-
this.httpClient = httpClient;
|
|
4593
|
-
this.basePath = 'http://localhost';
|
|
4594
|
-
this.defaultHeaders = new HttpHeaders();
|
|
4595
|
-
this.configuration = new Configuration();
|
|
4596
|
-
if (configuration) {
|
|
4597
|
-
this.configuration = configuration;
|
|
4598
|
-
}
|
|
4599
|
-
if (typeof this.configuration.basePath !== 'string') {
|
|
4600
|
-
if (Array.isArray(basePath) && basePath.length > 0) {
|
|
4601
|
-
basePath = basePath[0];
|
|
4602
|
-
}
|
|
4603
|
-
if (typeof basePath !== 'string') {
|
|
4604
|
-
basePath = this.basePath;
|
|
4605
|
-
}
|
|
4606
|
-
this.configuration.basePath = basePath;
|
|
4607
|
-
}
|
|
4608
|
-
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
|
|
4508
|
+
class UiActionService {
|
|
4509
|
+
constructor(confirmDialogService, textFieldDialogService, fileUploadDialogService, _snackBar) {
|
|
4510
|
+
this.confirmDialogService = confirmDialogService;
|
|
4511
|
+
this.textFieldDialogService = textFieldDialogService;
|
|
4512
|
+
this.fileUploadDialogService = fileUploadDialogService;
|
|
4513
|
+
this._snackBar = _snackBar;
|
|
4514
|
+
this._destroy$ = new Subject();
|
|
4609
4515
|
}
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
httpParams = this.addToHttpParamsRecursive(httpParams, value);
|
|
4614
|
-
}
|
|
4615
|
-
else {
|
|
4616
|
-
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
|
|
4617
|
-
}
|
|
4618
|
-
return httpParams;
|
|
4516
|
+
ngOnDestroy() {
|
|
4517
|
+
this._destroy$.next();
|
|
4518
|
+
this._destroy$.complete();
|
|
4619
4519
|
}
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4520
|
+
execute(uiAction, options) {
|
|
4521
|
+
var _a;
|
|
4522
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4523
|
+
let uiActionRequest;
|
|
4524
|
+
uiActionRequest = {
|
|
4525
|
+
code: uiAction.code,
|
|
4526
|
+
identifier: uiAction.identifier,
|
|
4527
|
+
params: (_a = uiAction.params) !== null && _a !== void 0 ? _a : {},
|
|
4528
|
+
};
|
|
4529
|
+
if (uiAction.submit) {
|
|
4530
|
+
this.uiActionModel.serviceToUse.submit.next();
|
|
4531
|
+
try {
|
|
4532
|
+
yield this.uiActionModel.serviceToUse.submit.toPromise();
|
|
4533
|
+
this.uiActionModel.serviceToUse.submit = new SmartSubject(this._destroy$);
|
|
4534
|
+
this.uiActionModel.serviceToUse.reSubscribeToChange.next();
|
|
4631
4535
|
}
|
|
4632
|
-
|
|
4633
|
-
|
|
4536
|
+
catch (error) {
|
|
4537
|
+
console.error(error);
|
|
4538
|
+
this.uiActionModel.serviceToUse.submit = new SmartSubject(this._destroy$);
|
|
4539
|
+
this.uiActionModel.serviceToUse.reSubscribeToChange.next();
|
|
4540
|
+
return;
|
|
4634
4541
|
}
|
|
4635
4542
|
}
|
|
4636
|
-
|
|
4637
|
-
|
|
4543
|
+
if (uiAction.confirm) {
|
|
4544
|
+
this.confirmDialogService.action = uiAction;
|
|
4545
|
+
this.confirmDialogService.openDialog();
|
|
4546
|
+
yield this.confirmDialogService.onAction.toPromise();
|
|
4547
|
+
if (!this.confirmDialogService.shouldDoAction) {
|
|
4548
|
+
return;
|
|
4549
|
+
}
|
|
4638
4550
|
}
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4551
|
+
// InputType
|
|
4552
|
+
if (uiAction.inputType) {
|
|
4553
|
+
uiActionRequest = yield this.handleInputType(uiAction.inputType, uiAction, uiActionRequest, 'inputDialog');
|
|
4554
|
+
if (!uiActionRequest) {
|
|
4555
|
+
return;
|
|
4556
|
+
}
|
|
4557
|
+
yield new Promise((resolve) => setTimeout(resolve, 250));
|
|
4558
|
+
}
|
|
4559
|
+
// Input2Type
|
|
4560
|
+
if (uiAction.input2Type) {
|
|
4561
|
+
uiActionRequest = yield this.handleInputType(uiAction.input2Type, uiAction, uiActionRequest, 'input2Dialog');
|
|
4562
|
+
if (!uiActionRequest) {
|
|
4563
|
+
return;
|
|
4564
|
+
}
|
|
4565
|
+
}
|
|
4566
|
+
if (this.uiActionModel.exception) {
|
|
4567
|
+
let response = yield this.uiActionModel.serviceToUse.handleSpecificDemandsAsynchronously(uiAction, uiActionRequest);
|
|
4568
|
+
if (!response.shouldPerformAction || !response.uiActionRequest) {
|
|
4569
|
+
return;
|
|
4570
|
+
}
|
|
4571
|
+
uiActionRequest = response.uiActionRequest;
|
|
4572
|
+
}
|
|
4573
|
+
yield this.performAction(uiAction, uiActionRequest, options);
|
|
4574
|
+
});
|
|
4647
4575
|
}
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
if (localVarHttpHeaderAcceptSelected) {
|
|
4665
|
-
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
4666
|
-
responseType_ = 'text';
|
|
4576
|
+
handleInputType(inputType, uiAction, uiActionRequest, inputTypeName) {
|
|
4577
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4578
|
+
switch (inputType) {
|
|
4579
|
+
case UiActionInputType.None:
|
|
4580
|
+
return uiActionRequest;
|
|
4581
|
+
case UiActionInputType.Textarea:
|
|
4582
|
+
case UiActionInputType.Textfield:
|
|
4583
|
+
return yield this.handleInputTypeTextField(inputTypeName, uiAction, uiActionRequest);
|
|
4584
|
+
case UiActionInputType.UserSelect:
|
|
4585
|
+
return yield this.handleInputTypeUserSelect(inputTypeName, uiAction, uiActionRequest);
|
|
4586
|
+
case UiActionInputType.File:
|
|
4587
|
+
return yield this.handleInputTypeUpload(inputTypeName, uiAction, uiActionRequest, false);
|
|
4588
|
+
case UiActionInputType.MultipleFiles:
|
|
4589
|
+
return yield this.handleInputTypeUpload(inputTypeName, uiAction, uiActionRequest, true);
|
|
4590
|
+
default:
|
|
4591
|
+
return uiActionRequest;
|
|
4667
4592
|
}
|
|
4668
|
-
|
|
4669
|
-
|
|
4593
|
+
});
|
|
4594
|
+
}
|
|
4595
|
+
handleInputTypeTextField(inputTypeName, uiAction, uiActionRequest) {
|
|
4596
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4597
|
+
let additionalParams = this.uiActionModel.serviceToUse.getAdditionalParams(uiAction);
|
|
4598
|
+
let inputType = inputTypeName === 'inputDialog' ? 'inputType' : 'input2Type';
|
|
4599
|
+
if (uiAction[inputType] === UiActionInputType.Textfield) {
|
|
4600
|
+
this.textFieldDialogService.nodeName = additionalParams.forTextField;
|
|
4670
4601
|
}
|
|
4671
|
-
else {
|
|
4672
|
-
|
|
4602
|
+
else if (uiAction[inputType] === UiActionInputType.Textarea) {
|
|
4603
|
+
this.textFieldDialogService.nodeName = additionalParams.forTextArea;
|
|
4604
|
+
}
|
|
4605
|
+
this.textFieldDialogService.inputTypeName = inputTypeName;
|
|
4606
|
+
this.textFieldDialogService.action = uiAction;
|
|
4607
|
+
this.textFieldDialogService.openDialog();
|
|
4608
|
+
yield this.textFieldDialogService.onAction.toPromise();
|
|
4609
|
+
let params = this.textFieldDialogService.params;
|
|
4610
|
+
if (!params) {
|
|
4611
|
+
console.error('There was no response from InputDialog');
|
|
4612
|
+
return;
|
|
4613
|
+
}
|
|
4614
|
+
uiActionRequest.params = Object.assign(Object.assign({}, uiActionRequest.params), params);
|
|
4615
|
+
return uiActionRequest;
|
|
4616
|
+
});
|
|
4617
|
+
}
|
|
4618
|
+
handleInputTypeUpload(inputTypeName, uiAction, uiActionRequest, isMultiple) {
|
|
4619
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4620
|
+
this.fileUploadDialogService.inputTypeName = inputTypeName;
|
|
4621
|
+
this.fileUploadDialogService.action = uiAction;
|
|
4622
|
+
this.fileUploadDialogService.isMultiple = isMultiple;
|
|
4623
|
+
this.fileUploadDialogService.openDialog();
|
|
4624
|
+
yield this.fileUploadDialogService.onAction.toPromise();
|
|
4625
|
+
let files = this.fileUploadDialogService.files;
|
|
4626
|
+
if (!files || !files.length) {
|
|
4627
|
+
console.error('There was no response from InputDialog');
|
|
4628
|
+
return;
|
|
4629
|
+
}
|
|
4630
|
+
uiActionRequest.params = Object.assign(Object.assign({}, uiActionRequest.params), { _files: files, isMultiple, param: uiAction.inputType === 'file' || uiAction.inputType === 'multiple_files'
|
|
4631
|
+
? 'INPUT'
|
|
4632
|
+
: 'INPUT2' });
|
|
4633
|
+
return uiActionRequest;
|
|
4634
|
+
});
|
|
4635
|
+
}
|
|
4636
|
+
handleInputTypeUserSelect(inputTypeName, uiAction, uiActionRequest) {
|
|
4637
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4638
|
+
let response = yield this.uiActionModel.serviceToUse.handleSpecificDemandsAsynchronously(uiAction, uiActionRequest);
|
|
4639
|
+
if (!response.shouldPerformAction || !response.uiActionRequest) {
|
|
4640
|
+
return;
|
|
4641
|
+
}
|
|
4642
|
+
uiActionRequest = response.uiActionRequest;
|
|
4643
|
+
return uiActionRequest;
|
|
4644
|
+
});
|
|
4645
|
+
}
|
|
4646
|
+
performAction(uiAction, uiActionRequest, options) {
|
|
4647
|
+
var _a;
|
|
4648
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4649
|
+
if (!uiActionRequest.params ||
|
|
4650
|
+
(uiActionRequest.params && !Object.keys(uiActionRequest.params).length)) {
|
|
4651
|
+
uiActionRequest.params = {
|
|
4652
|
+
model: this.uiActionModel.serviceToUse.getModel(),
|
|
4653
|
+
};
|
|
4654
|
+
}
|
|
4655
|
+
else if (uiAction.submit) {
|
|
4656
|
+
uiActionRequest.params['model'] = this.uiActionModel.serviceToUse.getModel();
|
|
4657
|
+
}
|
|
4658
|
+
try {
|
|
4659
|
+
yield this.uiActionModel.serviceToUse.performUiActionRequest(uiActionRequest, options === null || options === void 0 ? void 0 : options.widgetId, options === null || options === void 0 ? void 0 : options.nodeId);
|
|
4660
|
+
if (((_a = this.uiActionModel.descriptor) === null || _a === void 0 ? void 0 : _a.feedbackType) === UiActionFeedbackType.Snackbar) {
|
|
4661
|
+
this.showSavedSnackbar(uiAction);
|
|
4662
|
+
}
|
|
4663
|
+
}
|
|
4664
|
+
catch (error) {
|
|
4665
|
+
console.error(error);
|
|
4673
4666
|
}
|
|
4674
|
-
}
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
observe: observe,
|
|
4682
|
-
reportProgress: reportProgress
|
|
4667
|
+
});
|
|
4668
|
+
}
|
|
4669
|
+
showSavedSnackbar(uiAction) {
|
|
4670
|
+
this._snackBar.openFromComponent(SuccessSnackBarComponent, {
|
|
4671
|
+
duration: 5 * 1000,
|
|
4672
|
+
panelClass: ['backgroundColor-accent'],
|
|
4673
|
+
data: uiAction,
|
|
4683
4674
|
});
|
|
4684
4675
|
}
|
|
4685
4676
|
}
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type:
|
|
4677
|
+
UiActionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionService, deps: [{ token: UiActionConfirmDialogService }, { token: UiActionInputDialogService }, { token: UiActionFileUploadDialogService }, { token: i4$5.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4678
|
+
UiActionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionService, providedIn: 'root' });
|
|
4679
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionService, decorators: [{
|
|
4689
4680
|
type: Injectable,
|
|
4690
4681
|
args: [{
|
|
4691
|
-
providedIn: 'root'
|
|
4682
|
+
providedIn: 'root',
|
|
4692
4683
|
}]
|
|
4693
|
-
}], ctorParameters: function () {
|
|
4694
|
-
return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
4695
|
-
type: Optional
|
|
4696
|
-
}, {
|
|
4697
|
-
type: Inject,
|
|
4698
|
-
args: [BASE_PATH]
|
|
4699
|
-
}] }, { type: Configuration, decorators: [{
|
|
4700
|
-
type: Optional
|
|
4701
|
-
}] }];
|
|
4702
|
-
} });
|
|
4703
|
-
|
|
4704
|
-
const APIS = [DefaultService];
|
|
4705
|
-
|
|
4706
|
-
/**
|
|
4707
|
-
* Form layout definition
|
|
4708
|
-
* Contains form layout definition objects.
|
|
4709
|
-
*
|
|
4710
|
-
* The version of the OpenAPI document: 1.0.0
|
|
4711
|
-
* Contact: info@it4all.hu
|
|
4712
|
-
*
|
|
4713
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
4714
|
-
* https://openapi-generator.tech
|
|
4715
|
-
* Do not edit the class manually.
|
|
4716
|
-
*/
|
|
4717
|
-
const ComponentType = {
|
|
4718
|
-
Container: 'container',
|
|
4719
|
-
Form: 'form',
|
|
4720
|
-
Widget: 'widget'
|
|
4721
|
-
};
|
|
4684
|
+
}], ctorParameters: function () { return [{ type: UiActionConfirmDialogService }, { type: UiActionInputDialogService }, { type: UiActionFileUploadDialogService }, { type: i4$5.MatSnackBar }]; } });
|
|
4722
4685
|
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
/**
|
|
4739
|
-
* Form layout definition
|
|
4740
|
-
* Contains form layout definition objects.
|
|
4741
|
-
*
|
|
4742
|
-
* The version of the OpenAPI document: 1.0.0
|
|
4743
|
-
* Contact: info@it4all.hu
|
|
4744
|
-
*
|
|
4745
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
4746
|
-
* https://openapi-generator.tech
|
|
4747
|
-
* Do not edit the class manually.
|
|
4748
|
-
*/
|
|
4749
|
-
const LayoutDirection = {
|
|
4750
|
-
Horizontal: 'horizontal',
|
|
4751
|
-
Vertical: 'vertical'
|
|
4752
|
-
};
|
|
4753
|
-
|
|
4754
|
-
class ApiModule {
|
|
4755
|
-
constructor(parentModule, http) {
|
|
4756
|
-
if (parentModule) {
|
|
4757
|
-
throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
|
|
4686
|
+
class UiActionToolbarComponent {
|
|
4687
|
+
constructor(service, inject) {
|
|
4688
|
+
this.service = service;
|
|
4689
|
+
this.inject = inject;
|
|
4690
|
+
this._destroy$ = new Subject();
|
|
4691
|
+
this.pressedButtonActive = true;
|
|
4692
|
+
// Injects the basic UiActionDescriptorService provided by the AppModule
|
|
4693
|
+
this.manager = inject.get(UiActionDescriptorService);
|
|
4694
|
+
this.subscribeToLanguageChange();
|
|
4695
|
+
}
|
|
4696
|
+
ngOnInit() {
|
|
4697
|
+
// Overrides the basic UiActionDescriptorService with a custom one if there is one
|
|
4698
|
+
if (this.uiActionDescriptorService) {
|
|
4699
|
+
this.manager = this.uiActionDescriptorService;
|
|
4700
|
+
this.subscribeToLanguageChange();
|
|
4758
4701
|
}
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4702
|
+
this.setUp();
|
|
4703
|
+
}
|
|
4704
|
+
ngOnChanges(changes) {
|
|
4705
|
+
let uiActionModels = changes['uiActionModels'].currentValue;
|
|
4706
|
+
if (uiActionModels) {
|
|
4707
|
+
this.uiActionModels = uiActionModels;
|
|
4708
|
+
this.setUp();
|
|
4709
|
+
}
|
|
4710
|
+
}
|
|
4711
|
+
ngOnDestroy() {
|
|
4712
|
+
this._destroy$.next();
|
|
4713
|
+
}
|
|
4714
|
+
subscribeToLanguageChange() {
|
|
4715
|
+
var _a;
|
|
4716
|
+
(_a = this.languageChangedSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
4717
|
+
this.languageChangedSubscription = this.manager.languageChanged
|
|
4718
|
+
.pipe(takeUntil(this._destroy$))
|
|
4719
|
+
.subscribe(() => {
|
|
4720
|
+
this.setUp();
|
|
4721
|
+
});
|
|
4722
|
+
}
|
|
4723
|
+
setUp() {
|
|
4724
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4725
|
+
this.uiActionModelsWithDescriptions = yield Promise.all(this.uiActionModels.map((uiActionModel) => __awaiter(this, void 0, void 0, function* () {
|
|
4726
|
+
uiActionModel.descriptor = yield this.manager.getActionDescriptor(uiActionModel.uiAction);
|
|
4727
|
+
return uiActionModel;
|
|
4728
|
+
})));
|
|
4729
|
+
});
|
|
4730
|
+
}
|
|
4731
|
+
onActionClicked(event, uiActionModel) {
|
|
4732
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4733
|
+
event.stopPropagation();
|
|
4734
|
+
if (this.pressedButtonActive) {
|
|
4735
|
+
this.pressedButtonActive = false;
|
|
4736
|
+
this.service.uiActionModel = uiActionModel;
|
|
4737
|
+
let options = {
|
|
4738
|
+
nodeId: uiActionModel.nodeId,
|
|
4739
|
+
widgetId: uiActionModel.widgetId,
|
|
4740
|
+
};
|
|
4741
|
+
yield this.service.execute(uiActionModel.uiAction, options);
|
|
4742
|
+
this.pressedButtonActive = true;
|
|
4743
|
+
}
|
|
4744
|
+
});
|
|
4745
|
+
}
|
|
4746
|
+
onActionDoubleClicked(event, uiActionModel) {
|
|
4747
|
+
event.stopPropagation();
|
|
4748
|
+
// We do not handle double clicks
|
|
4749
|
+
}
|
|
4750
|
+
getType(uiActionModel) {
|
|
4751
|
+
var _a, _b;
|
|
4752
|
+
switch ((_a = uiActionModel.descriptor) === null || _a === void 0 ? void 0 : _a.type) {
|
|
4753
|
+
case UiActionButtonType.Normal:
|
|
4754
|
+
return 'mat-button';
|
|
4755
|
+
case UiActionButtonType.Flat:
|
|
4756
|
+
return 'mat-flat-button';
|
|
4757
|
+
case UiActionButtonType.Raised:
|
|
4758
|
+
return 'mat-raised-button';
|
|
4759
|
+
case UiActionButtonType.Stroked:
|
|
4760
|
+
return 'mat-stroked-button';
|
|
4761
|
+
case UiActionButtonType.Icon:
|
|
4762
|
+
return 'mat-icon-button';
|
|
4763
|
+
case UiActionButtonType.MiniFab:
|
|
4764
|
+
return 'mat-mini-fab';
|
|
4765
|
+
case UiActionButtonType.Fab:
|
|
4766
|
+
return 'mat-fab';
|
|
4767
|
+
default:
|
|
4768
|
+
console.log(`Unhandled action button type case: ${(_b = uiActionModel.descriptor) === null || _b === void 0 ? void 0 : _b.type}`);
|
|
4769
|
+
return `mat-button`;
|
|
4762
4770
|
}
|
|
4763
4771
|
}
|
|
4764
|
-
|
|
4765
|
-
return
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4772
|
+
iconPosition() {
|
|
4773
|
+
return UiActionButtonIconPos;
|
|
4774
|
+
}
|
|
4775
|
+
isOnlyIcon(uiActionModel) {
|
|
4776
|
+
var _a, _b, _c;
|
|
4777
|
+
return (((_a = uiActionModel.descriptor) === null || _a === void 0 ? void 0 : _a.type) === UiActionButtonType.Icon ||
|
|
4778
|
+
((_b = uiActionModel.descriptor) === null || _b === void 0 ? void 0 : _b.type) === UiActionButtonType.MiniFab ||
|
|
4779
|
+
((_c = uiActionModel.descriptor) === null || _c === void 0 ? void 0 : _c.type) === UiActionButtonType.Fab);
|
|
4769
4780
|
}
|
|
4770
4781
|
}
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4782
|
+
UiActionToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionToolbarComponent, deps: [{ token: UiActionService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
4783
|
+
UiActionToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: { uiActionModels: "uiActionModels", uiActionDescriptorService: "uiActionDescriptorService" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"uiActionButtonsContainer\">\n <button\n *ngFor=\"let uiActionModel of uiActionModelsWithDescriptions\"\n mat-button\n [ngClass]=\"getType(uiActionModel)\"\n class=\"{{ uiActionModel.cssClass }}\"\n [color]=\"uiActionModel.descriptor?.color\"\n (click)=\"onActionClicked($event, uiActionModel)\"\n (dblclick)=\"onActionDoubleClicked($event, uiActionModel)\"\n >\n <div *ngIf=\"isOnlyIcon(uiActionModel); then iconOnly; else text\"></div>\n <ng-template #iconOnly>\n <smart-icon\n *ngIf=\"uiActionModel.descriptor?.icon\"\n [icon]=\"uiActionModel.descriptor!.icon!\"\n [color]=\"uiActionModel.descriptor?.iconColor ?? uiActionModel.descriptor?.color\"\n ></smart-icon>\n </ng-template>\n <ng-template #text>\n <smart-icon\n *ngIf=\"\n uiActionModel.descriptor?.icon &&\n uiActionModel.descriptor?.iconPosition === iconPosition().Pre\n \"\n [icon]=\"uiActionModel.descriptor!.icon!\"\n [color]=\"uiActionModel.descriptor?.iconColor ?? uiActionModel.descriptor?.color\"\n ></smart-icon>\n {{ uiActionModel.descriptor?.title }}\n <smart-icon\n *ngIf=\"\n uiActionModel.descriptor?.icon &&\n uiActionModel.descriptor?.iconPosition === iconPosition().Post\n \"\n [icon]=\"uiActionModel.descriptor!.icon!\"\n [color]=\"uiActionModel.descriptor?.iconColor ?? uiActionModel.descriptor?.color\"\n ></smart-icon>\n </ng-template>\n </button>\n</div>\n", styles: [".uiActionButtonsContainer{display:flex;flex-direction:row;gap:1rem;flex-wrap:wrap;min-height:2.25rem}\n"], components: [{ 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: i4$2.SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
4784
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionToolbarComponent, decorators: [{
|
|
4785
|
+
type: Component,
|
|
4786
|
+
args: [{ selector: 'smart-ui-action-toolbar', template: "<div class=\"uiActionButtonsContainer\">\n <button\n *ngFor=\"let uiActionModel of uiActionModelsWithDescriptions\"\n mat-button\n [ngClass]=\"getType(uiActionModel)\"\n class=\"{{ uiActionModel.cssClass }}\"\n [color]=\"uiActionModel.descriptor?.color\"\n (click)=\"onActionClicked($event, uiActionModel)\"\n (dblclick)=\"onActionDoubleClicked($event, uiActionModel)\"\n >\n <div *ngIf=\"isOnlyIcon(uiActionModel); then iconOnly; else text\"></div>\n <ng-template #iconOnly>\n <smart-icon\n *ngIf=\"uiActionModel.descriptor?.icon\"\n [icon]=\"uiActionModel.descriptor!.icon!\"\n [color]=\"uiActionModel.descriptor?.iconColor ?? uiActionModel.descriptor?.color\"\n ></smart-icon>\n </ng-template>\n <ng-template #text>\n <smart-icon\n *ngIf=\"\n uiActionModel.descriptor?.icon &&\n uiActionModel.descriptor?.iconPosition === iconPosition().Pre\n \"\n [icon]=\"uiActionModel.descriptor!.icon!\"\n [color]=\"uiActionModel.descriptor?.iconColor ?? uiActionModel.descriptor?.color\"\n ></smart-icon>\n {{ uiActionModel.descriptor?.title }}\n <smart-icon\n *ngIf=\"\n uiActionModel.descriptor?.icon &&\n uiActionModel.descriptor?.iconPosition === iconPosition().Post\n \"\n [icon]=\"uiActionModel.descriptor!.icon!\"\n [color]=\"uiActionModel.descriptor?.iconColor ?? uiActionModel.descriptor?.color\"\n ></smart-icon>\n </ng-template>\n </button>\n</div>\n", styles: [".uiActionButtonsContainer{display:flex;flex-direction:row;gap:1rem;flex-wrap:wrap;min-height:2.25rem}\n"] }]
|
|
4787
|
+
}], ctorParameters: function () { return [{ type: UiActionService }, { type: i0.Injector }]; }, propDecorators: { uiActionModels: [{
|
|
4788
|
+
type: Input
|
|
4789
|
+
}], uiActionDescriptorService: [{
|
|
4790
|
+
type: Input
|
|
4791
|
+
}] } });
|
|
4792
|
+
|
|
4793
|
+
class SmartViewContextModule {
|
|
4794
|
+
}
|
|
4795
|
+
SmartViewContextModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4796
|
+
SmartViewContextModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextModule, declarations: [MessageDialogComponent,
|
|
4797
|
+
SmartViewContextErrorDialogComponent,
|
|
4798
|
+
SmartViewRedirect,
|
|
4799
|
+
UiActionToolbarComponent,
|
|
4800
|
+
UiActionInputDialogComponent,
|
|
4801
|
+
UiActionConfirmDialogComponent,
|
|
4802
|
+
UiActionFileUploadDialogComponent], imports: [CommonModule,
|
|
4803
|
+
HttpClientModule,
|
|
4804
|
+
MatCommonModule,
|
|
4805
|
+
MatButtonModule,
|
|
4806
|
+
MatIconModule,
|
|
4807
|
+
MatSnackBarModule,
|
|
4808
|
+
SmartIconModule,
|
|
4809
|
+
SmartformModule], exports: [UiActionToolbarComponent, UiActionInputDialogComponent] });
|
|
4810
|
+
SmartViewContextModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextModule, providers: [
|
|
4811
|
+
SmartViewContextService,
|
|
4812
|
+
{
|
|
4813
|
+
provide: HTTP_INTERCEPTORS,
|
|
4814
|
+
useClass: SmartViewContextInterceptor,
|
|
4815
|
+
multi: true,
|
|
4816
|
+
},
|
|
4817
|
+
], imports: [[
|
|
4818
|
+
CommonModule,
|
|
4819
|
+
HttpClientModule,
|
|
4820
|
+
MatCommonModule,
|
|
4821
|
+
MatButtonModule,
|
|
4822
|
+
MatIconModule,
|
|
4823
|
+
MatSnackBarModule,
|
|
4824
|
+
SmartIconModule,
|
|
4825
|
+
SmartformModule,
|
|
4826
|
+
]] });
|
|
4827
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextModule, decorators: [{
|
|
4775
4828
|
type: NgModule,
|
|
4776
4829
|
args: [{
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4830
|
+
declarations: [
|
|
4831
|
+
MessageDialogComponent,
|
|
4832
|
+
SmartViewContextErrorDialogComponent,
|
|
4833
|
+
SmartViewRedirect,
|
|
4834
|
+
UiActionToolbarComponent,
|
|
4835
|
+
UiActionInputDialogComponent,
|
|
4836
|
+
UiActionConfirmDialogComponent,
|
|
4837
|
+
UiActionFileUploadDialogComponent,
|
|
4838
|
+
],
|
|
4839
|
+
imports: [
|
|
4840
|
+
CommonModule,
|
|
4841
|
+
HttpClientModule,
|
|
4842
|
+
MatCommonModule,
|
|
4843
|
+
MatButtonModule,
|
|
4844
|
+
MatIconModule,
|
|
4845
|
+
MatSnackBarModule,
|
|
4846
|
+
SmartIconModule,
|
|
4847
|
+
SmartformModule,
|
|
4848
|
+
],
|
|
4849
|
+
exports: [UiActionToolbarComponent, UiActionInputDialogComponent],
|
|
4850
|
+
providers: [
|
|
4851
|
+
SmartViewContextService,
|
|
4852
|
+
{
|
|
4853
|
+
provide: HTTP_INTERCEPTORS,
|
|
4854
|
+
useClass: SmartViewContextInterceptor,
|
|
4855
|
+
multi: true,
|
|
4856
|
+
},
|
|
4857
|
+
],
|
|
4781
4858
|
}]
|
|
4782
|
-
}]
|
|
4783
|
-
return [{ type: ApiModule, decorators: [{
|
|
4784
|
-
type: Optional
|
|
4785
|
-
}, {
|
|
4786
|
-
type: SkipSelf
|
|
4787
|
-
}] }, { type: i1.HttpClient, decorators: [{
|
|
4788
|
-
type: Optional
|
|
4789
|
-
}] }];
|
|
4790
|
-
} });
|
|
4859
|
+
}] });
|
|
4791
4860
|
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4861
|
+
var UiActionDialogType;
|
|
4862
|
+
(function (UiActionDialogType) {
|
|
4863
|
+
UiActionDialogType["inputDialog"] = "inputDialog";
|
|
4864
|
+
UiActionDialogType["confirmDialog"] = "confirmDialog";
|
|
4865
|
+
UiActionDialogType["dialog"] = "dialog";
|
|
4866
|
+
})(UiActionDialogType || (UiActionDialogType = {}));
|
|
4867
|
+
|
|
4868
|
+
/*
|
|
4869
|
+
* Public API Surface of smart-view-context
|
|
4870
|
+
*/
|
|
4871
|
+
|
|
4872
|
+
class SmartFileUploaderComponent {
|
|
4873
|
+
constructor(uiActionService, uiActionDescriptorService) {
|
|
4874
|
+
this.uiActionService = uiActionService;
|
|
4875
|
+
this.uiActionDescriptorService = uiActionDescriptorService;
|
|
4795
4876
|
}
|
|
4796
4877
|
ngOnChanges(changes) {
|
|
4797
|
-
|
|
4798
|
-
this.
|
|
4799
|
-
|
|
4800
|
-
if ((_b = this.smartComponentLayout) === null || _b === void 0 ? void 0 : _b.expandable) {
|
|
4801
|
-
this.constructExpandableSection();
|
|
4802
|
-
}
|
|
4803
|
-
else if (((_c = this.smartComponentLayout) === null || _c === void 0 ? void 0 : _c.type) === ComponentType.Form) {
|
|
4804
|
-
this.constructForm();
|
|
4805
|
-
}
|
|
4806
|
-
else if (((_d = this.smartComponentLayout) === null || _d === void 0 ? void 0 : _d.type) === ComponentType.Widget) {
|
|
4807
|
-
if (((_e = this.smartComponentLayout.widget) === null || _e === void 0 ? void 0 : _e.type) === ComponentWidgetType.Grid) {
|
|
4808
|
-
this.constructGrid();
|
|
4809
|
-
}
|
|
4878
|
+
this.config = changes['config'].currentValue;
|
|
4879
|
+
if (this.config) {
|
|
4880
|
+
this.setUp();
|
|
4810
4881
|
}
|
|
4811
4882
|
}
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
var _a, _b, _c, _d, _e;
|
|
4828
|
-
const widgets = this.layoutService.render({
|
|
4829
|
-
layoutDefinitions: (_a = this.smartComponentLayout) === null || _a === void 0 ? void 0 : _a.form,
|
|
4883
|
+
setUp() {
|
|
4884
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
4885
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4886
|
+
this.uiActionModel = (_a = this.config) === null || _a === void 0 ? void 0 : _a.smartComponent.uiActionModels.find((uiActionModel) => { var _a; return uiActionModel.uiAction.code === ((_a = this.config) === null || _a === void 0 ? void 0 : _a.uiActionCode); });
|
|
4887
|
+
if (!this.uiActionModel) {
|
|
4888
|
+
throw new Error(`UiAction with code ${(_b = this.config) === null || _b === void 0 ? void 0 : _b.uiActionCode} could not found`);
|
|
4889
|
+
}
|
|
4890
|
+
const descriptor = yield this.uiActionDescriptorService.getActionDescriptor(this.uiActionModel.uiAction);
|
|
4891
|
+
this.i18n = {
|
|
4892
|
+
addFile: (_d = (_c = descriptor.upload) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : 'dokumentum hozzáadása',
|
|
4893
|
+
browseOrDrag: (_f = (_e = descriptor.upload) === null || _e === void 0 ? void 0 : _e.description) !== null && _f !== void 0 ? _f : 'tallózás vagy behúzás',
|
|
4894
|
+
formats: (_h = (_g = descriptor.upload) === null || _g === void 0 ? void 0 : _g.formats) !== null && _h !== void 0 ? _h : '',
|
|
4895
|
+
maxSize: (_k = (_j = descriptor.upload) === null || _j === void 0 ? void 0 : _j.maxSize) !== null && _k !== void 0 ? _k : '',
|
|
4896
|
+
upload: (_l = descriptor.upload) === null || _l === void 0 ? void 0 : _l.uploadButtonTitle,
|
|
4897
|
+
};
|
|
4830
4898
|
});
|
|
4831
|
-
this.smartForm = {
|
|
4832
|
-
direction: SmartFormWidgetDirection.COL,
|
|
4833
|
-
model: (_b = this.smartComponentLayout) === null || _b === void 0 ? void 0 : _b.parentComponent.model,
|
|
4834
|
-
constraints: (_d = (_c = this.smartComponentLayout) === null || _c === void 0 ? void 0 : _c.parentComponent.model) === null || _d === void 0 ? void 0 : _d.constraints,
|
|
4835
|
-
widgets,
|
|
4836
|
-
};
|
|
4837
|
-
(_e = this.smartComponentLayout) === null || _e === void 0 ? void 0 : _e.parentComponent.addForm(
|
|
4838
|
-
// unique identifier for the form
|
|
4839
|
-
`form_${this.makeid(5)}`, this.smartForm, this.formChild);
|
|
4840
|
-
}
|
|
4841
|
-
makeid(length) {
|
|
4842
|
-
let result = '';
|
|
4843
|
-
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
4844
|
-
const charactersLength = characters.length;
|
|
4845
|
-
let counter = 0;
|
|
4846
|
-
while (counter < length) {
|
|
4847
|
-
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
4848
|
-
counter += 1;
|
|
4849
|
-
}
|
|
4850
|
-
return result;
|
|
4851
4899
|
}
|
|
4852
|
-
|
|
4853
|
-
var _a
|
|
4854
|
-
this.
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
page: {},
|
|
4858
|
-
},
|
|
4859
|
-
layoutDef: SmartLayoutDef.TABLE,
|
|
4860
|
-
};
|
|
4861
|
-
this.smartGrid = (_c = this.smartComponentLayout) === null || _c === void 0 ? void 0 : _c.parentComponent.addGrid(this.smartGrid, {
|
|
4862
|
-
rowUiActionType: GridUiActionType.POPUP_MENU,
|
|
4863
|
-
}, false, this.gridChild);
|
|
4900
|
+
executeUpload(files) {
|
|
4901
|
+
var _a;
|
|
4902
|
+
this.uiActionModel.uiAction.params = Object.assign(Object.assign({}, this.uiActionModel.uiAction.params), { _files: files, isMultiple: (_a = this.config) === null || _a === void 0 ? void 0 : _a.isMultiple, param: 'INPUT' });
|
|
4903
|
+
this.uiActionService.uiActionModel = this.uiActionModel;
|
|
4904
|
+
this.uiActionService.execute(this.uiActionModel.uiAction);
|
|
4864
4905
|
}
|
|
4865
4906
|
}
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type:
|
|
4907
|
+
SmartFileUploaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartFileUploaderComponent, deps: [{ token: UiActionService }, { token: UiActionDescriptorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4908
|
+
SmartFileUploaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SmartFileUploaderComponent, selector: "smart-file-uploader4sc", inputs: { config: "config" }, usesOnChanges: true, ngImport: i0, template: "<smartfileuploader\n *ngIf=\"i18n\"\n [i18n]=\"i18n\"\n [fileFormats]=\"config?.fileFormats\"\n [isMultiple]=\"config?.isMultiple\"\n [maxSizeMb]=\"config?.maxSizeMb\"\n [uploadCallback]=\"executeUpload.bind(this)\"\n></smartfileuploader>\n", styles: [""], components: [{ type: i1$2.SmartfileuploaderComponent, selector: "smartfileuploader", inputs: ["uploadCallback", "fileFormats", "maxSizeMb", "i18n", "useIconButton", "isMultiple"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
4909
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartFileUploaderComponent, decorators: [{
|
|
4869
4910
|
type: Component,
|
|
4870
|
-
args: [{ selector: 'smart-
|
|
4871
|
-
}], ctorParameters: function () { return [{ type:
|
|
4911
|
+
args: [{ selector: 'smart-file-uploader4sc', template: "<smartfileuploader\n *ngIf=\"i18n\"\n [i18n]=\"i18n\"\n [fileFormats]=\"config?.fileFormats\"\n [isMultiple]=\"config?.isMultiple\"\n [maxSizeMb]=\"config?.maxSizeMb\"\n [uploadCallback]=\"executeUpload.bind(this)\"\n></smartfileuploader>\n", styles: [""] }]
|
|
4912
|
+
}], ctorParameters: function () { return [{ type: UiActionService }, { type: UiActionDescriptorService }]; }, propDecorators: { config: [{
|
|
4872
4913
|
type: Input
|
|
4873
|
-
}], formChild: [{
|
|
4874
|
-
type: ViewChild,
|
|
4875
|
-
args: ['form']
|
|
4876
|
-
}], gridChild: [{
|
|
4877
|
-
type: ViewChild,
|
|
4878
|
-
args: ['grid']
|
|
4879
4914
|
}] } });
|
|
4880
4915
|
|
|
4881
4916
|
class SmartNgClientModule {
|
|
@@ -4887,7 +4922,8 @@ SmartNgClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ver
|
|
|
4887
4922
|
SmartViewContextModule,
|
|
4888
4923
|
SmartformModule,
|
|
4889
4924
|
SmartGridModule,
|
|
4890
|
-
SmartExpandableSectionModule
|
|
4925
|
+
SmartExpandableSectionModule,
|
|
4926
|
+
SmarttreeModule], exports: [SmartSessionModule,
|
|
4891
4927
|
SmartViewContextModule,
|
|
4892
4928
|
SmartFileUploaderComponent,
|
|
4893
4929
|
SmartComponentLayoutComponent] });
|
|
@@ -4899,6 +4935,7 @@ SmartNgClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
|
|
|
4899
4935
|
SmartformModule,
|
|
4900
4936
|
SmartGridModule,
|
|
4901
4937
|
SmartExpandableSectionModule,
|
|
4938
|
+
SmarttreeModule,
|
|
4902
4939
|
], SmartSessionModule,
|
|
4903
4940
|
SmartViewContextModule] });
|
|
4904
4941
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartNgClientModule, decorators: [{
|
|
@@ -4913,6 +4950,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
4913
4950
|
SmartformModule,
|
|
4914
4951
|
SmartGridModule,
|
|
4915
4952
|
SmartExpandableSectionModule,
|
|
4953
|
+
SmarttreeModule,
|
|
4916
4954
|
],
|
|
4917
4955
|
exports: [
|
|
4918
4956
|
SmartSessionModule,
|
|
@@ -4941,6 +4979,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
4941
4979
|
type: Injectable
|
|
4942
4980
|
}] });
|
|
4943
4981
|
|
|
4982
|
+
// import {
|
|
4983
|
+
// FilterExpressionFieldList,
|
|
4984
|
+
// SmartFilter,
|
|
4985
|
+
// SmartFilterComponent,
|
|
4986
|
+
// SmartFilterType,
|
|
4987
|
+
// } from '@smartbit4all/filter';
|
|
4944
4988
|
let SmartComponentApiClient = class SmartComponentApiClient {
|
|
4945
4989
|
constructor(inject, auth, pageName) {
|
|
4946
4990
|
this.inject = inject;
|
|
@@ -5176,6 +5220,25 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
5176
5220
|
maxSizeMb,
|
|
5177
5221
|
};
|
|
5178
5222
|
}
|
|
5223
|
+
// public addFilter(
|
|
5224
|
+
// smartFilterId: string,
|
|
5225
|
+
// filter: FilterExpressionFieldList,
|
|
5226
|
+
// type: SmartFilterType,
|
|
5227
|
+
// smartFilterComponent: SmartFilterComponent,
|
|
5228
|
+
// isDefault?: boolean
|
|
5229
|
+
// ): SmartFilter {
|
|
5230
|
+
// const smartFilter: SmartFilter = {
|
|
5231
|
+
// data: filter.filters,
|
|
5232
|
+
// type,
|
|
5233
|
+
// translateService: this.translate,
|
|
5234
|
+
// };
|
|
5235
|
+
// this.widgets.addWidget(smartFilterId, smartFilterComponent);
|
|
5236
|
+
// if (isDefault) {
|
|
5237
|
+
// this.smartFilter = smartFilter;
|
|
5238
|
+
// return this.smartFilter!;
|
|
5239
|
+
// }
|
|
5240
|
+
// return smartFilter;
|
|
5241
|
+
// }
|
|
5179
5242
|
// #region handle changes
|
|
5180
5243
|
handleValueChanges(valueChange) {
|
|
5181
5244
|
let dataChange;
|