i-tech-shared-components 1.1.30 → 1.1.31
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/fesm2022/i-tech-shared-components.mjs +274 -3
- package/fesm2022/i-tech-shared-components.mjs.map +1 -1
- package/lib/components/confirmation-dialog-by-type/confirmation-dialog-by-type.component.d.ts +39 -0
- package/lib/components/custom-dialog/custom-dialog.component.d.ts +21 -0
- package/lib/components/label/label.component.d.ts +16 -0
- package/lib/components/loading/loading.component.d.ts +8 -0
- package/lib/components/standard-dialog/standard-dialog.component.d.ts +53 -0
- package/lib/interfaces/confirmation-dialog-types.enum.d.ts +4 -0
- package/lib/interfaces/label-type.enum.d.ts +15 -0
- package/lib/interfaces/standard-dialog-button.interface.d.ts +11 -0
- package/lib/services/dialog.service.d.ts +47 -0
- package/package.json +1 -1
- package/public-api.d.ts +7 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe, inject, Injectable, Directive, Input, HostListener, EventEmitter, Component, Output, ViewChild } from '@angular/core';
|
|
2
|
+
import { Pipe, inject, Injectable, Directive, Input, HostListener, EventEmitter, Component, Output, ViewChild, ViewContainerRef, Inject } from '@angular/core';
|
|
3
3
|
import * as i2 from '@ngx-translate/core';
|
|
4
4
|
import { TranslateModule, TranslatePipe, TranslateService } from '@ngx-translate/core';
|
|
5
5
|
import * as i3 from '@angular/forms';
|
|
6
6
|
import { NgControl, FormControlName, ReactiveFormsModule, UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
|
|
7
7
|
import { MatIconButton, MatFabButton, MatButton } from '@angular/material/button';
|
|
8
|
-
import
|
|
8
|
+
import * as i3$2 from '@angular/common';
|
|
9
|
+
import { NgClass, NgIf, NgOptimizedImage, NgFor, NgForOf, NgComponentOutlet, CommonModule } from '@angular/common';
|
|
9
10
|
import { MatTooltip } from '@angular/material/tooltip';
|
|
10
11
|
import * as i1 from '@angular/material/icon';
|
|
11
12
|
import { MatIcon, MatIconModule } from '@angular/material/icon';
|
|
@@ -20,6 +21,10 @@ import * as i6 from '@angular/material/core';
|
|
|
20
21
|
import * as i3$1 from '@angular/material/datepicker';
|
|
21
22
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
22
23
|
import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu';
|
|
24
|
+
import { MatChip } from '@angular/material/chips';
|
|
25
|
+
import * as i1$1 from '@angular/material/dialog';
|
|
26
|
+
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
27
|
+
import { NoopScrollStrategy } from '@angular/cdk/overlay';
|
|
23
28
|
|
|
24
29
|
class GenerateErrorMessagesPipe {
|
|
25
30
|
constructor(translateService) {
|
|
@@ -1236,6 +1241,272 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImpor
|
|
|
1236
1241
|
type: Output
|
|
1237
1242
|
}] } });
|
|
1238
1243
|
|
|
1244
|
+
var LabelTypeEnum;
|
|
1245
|
+
(function (LabelTypeEnum) {
|
|
1246
|
+
LabelTypeEnum["purple"] = "purple";
|
|
1247
|
+
LabelTypeEnum["teal"] = "teal";
|
|
1248
|
+
LabelTypeEnum["olive"] = "olive";
|
|
1249
|
+
LabelTypeEnum["orange"] = "orange";
|
|
1250
|
+
LabelTypeEnum["blue"] = "blue";
|
|
1251
|
+
LabelTypeEnum["cyan"] = "cyan";
|
|
1252
|
+
LabelTypeEnum["raspberry"] = "raspberry";
|
|
1253
|
+
LabelTypeEnum["yellow"] = "yellow";
|
|
1254
|
+
LabelTypeEnum["wine"] = "wine";
|
|
1255
|
+
LabelTypeEnum["primary"] = "primary";
|
|
1256
|
+
LabelTypeEnum["green"] = "green";
|
|
1257
|
+
LabelTypeEnum["red"] = "red";
|
|
1258
|
+
LabelTypeEnum["gray"] = "gray";
|
|
1259
|
+
})(LabelTypeEnum || (LabelTypeEnum = {}));
|
|
1260
|
+
|
|
1261
|
+
class LabelComponent {
|
|
1262
|
+
constructor() {
|
|
1263
|
+
this.color = LabelTypeEnum.primary;
|
|
1264
|
+
this.bordered = false;
|
|
1265
|
+
this.size = 'standard';
|
|
1266
|
+
this.iconSvg = '';
|
|
1267
|
+
this.disableRipple = false;
|
|
1268
|
+
this.forTable = false;
|
|
1269
|
+
}
|
|
1270
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1271
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.2", type: LabelComponent, isStandalone: true, selector: "i-tech-label", inputs: { color: "color", text: "text", bordered: "bordered", tooltip: "tooltip", size: "size", iconName: "iconName", iconSvg: "iconSvg", disableRipple: "disableRipple", forTable: "forTable", innerHtml: "innerHtml" }, ngImport: i0, template: "<div [class]=\"{table_row_item: forTable,'trailing-icon' : iconName || iconSvg}\">\r\n\r\n <mat-chip\r\n [class]=\"'label_' + color\"\r\n [ngClass]=\"{bordered: bordered, small: size === 'small'}\"\r\n [matTooltip]=\"(tooltip || '') | translate\"\r\n [disableRipple]=\"disableRipple\"\r\n >\r\n <div class=\"flex_align_center flex_gap\">\r\n <span *ngIf=\"!innerHtml\">{{text | translate}}</span>\r\n <span *ngIf=\"innerHtml\" [innerHtml]=\"innerHtml | translate\"></span>\r\n <mat-icon *ngIf=\"iconName\">{{iconName}}</mat-icon>\r\n <mat-icon *ngIf=\"iconSvg\" [svgIcon]=\"iconSvg\"></mat-icon>\r\n </div>\r\n </mat-chip>\r\n</div>\r\n", dependencies: [{ kind: "component", type: MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
|
|
1272
|
+
}
|
|
1273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: LabelComponent, decorators: [{
|
|
1274
|
+
type: Component,
|
|
1275
|
+
args: [{ selector: 'i-tech-label', imports: [
|
|
1276
|
+
MatChip,
|
|
1277
|
+
MatTooltip,
|
|
1278
|
+
NgClass,
|
|
1279
|
+
TranslateModule,
|
|
1280
|
+
MatIcon
|
|
1281
|
+
], template: "<div [class]=\"{table_row_item: forTable,'trailing-icon' : iconName || iconSvg}\">\r\n\r\n <mat-chip\r\n [class]=\"'label_' + color\"\r\n [ngClass]=\"{bordered: bordered, small: size === 'small'}\"\r\n [matTooltip]=\"(tooltip || '') | translate\"\r\n [disableRipple]=\"disableRipple\"\r\n >\r\n <div class=\"flex_align_center flex_gap\">\r\n <span *ngIf=\"!innerHtml\">{{text | translate}}</span>\r\n <span *ngIf=\"innerHtml\" [innerHtml]=\"innerHtml | translate\"></span>\r\n <mat-icon *ngIf=\"iconName\">{{iconName}}</mat-icon>\r\n <mat-icon *ngIf=\"iconSvg\" [svgIcon]=\"iconSvg\"></mat-icon>\r\n </div>\r\n </mat-chip>\r\n</div>\r\n" }]
|
|
1282
|
+
}], propDecorators: { color: [{
|
|
1283
|
+
type: Input
|
|
1284
|
+
}], text: [{
|
|
1285
|
+
type: Input
|
|
1286
|
+
}], bordered: [{
|
|
1287
|
+
type: Input
|
|
1288
|
+
}], tooltip: [{
|
|
1289
|
+
type: Input
|
|
1290
|
+
}], size: [{
|
|
1291
|
+
type: Input
|
|
1292
|
+
}], iconName: [{
|
|
1293
|
+
type: Input
|
|
1294
|
+
}], iconSvg: [{
|
|
1295
|
+
type: Input
|
|
1296
|
+
}], disableRipple: [{
|
|
1297
|
+
type: Input
|
|
1298
|
+
}], forTable: [{
|
|
1299
|
+
type: Input
|
|
1300
|
+
}], innerHtml: [{
|
|
1301
|
+
type: Input
|
|
1302
|
+
}] } });
|
|
1303
|
+
|
|
1304
|
+
class LoadingComponent {
|
|
1305
|
+
constructor() {
|
|
1306
|
+
this.loading = false;
|
|
1307
|
+
this.absolute = false;
|
|
1308
|
+
this.smallLoading = false;
|
|
1309
|
+
}
|
|
1310
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: LoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1311
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.2", type: LoadingComponent, isStandalone: true, selector: "i-tech-loading", inputs: { loading: "loading", absolute: "absolute", smallLoading: "smallLoading" }, ngImport: i0, template: "<div [hidden]=\"!loading\" class=\"big_loading\" [ngClass]=\"{absolute: absolute, small_loading: smallLoading}\">\r\n <img alt=\"\" src=\"assets/images/table-loader.svg\" />\r\n</div>\r\n", styles: [".big_loading{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:999}.big_loading img{width:100px;height:100px}.small_loading img{width:40px;height:40px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
|
|
1312
|
+
}
|
|
1313
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: LoadingComponent, decorators: [{
|
|
1314
|
+
type: Component,
|
|
1315
|
+
args: [{ selector: 'i-tech-loading', imports: [
|
|
1316
|
+
NgClass
|
|
1317
|
+
], template: "<div [hidden]=\"!loading\" class=\"big_loading\" [ngClass]=\"{absolute: absolute, small_loading: smallLoading}\">\r\n <img alt=\"\" src=\"assets/images/table-loader.svg\" />\r\n</div>\r\n", styles: [".big_loading{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:999}.big_loading img{width:100px;height:100px}.small_loading img{width:40px;height:40px}\n"] }]
|
|
1318
|
+
}], propDecorators: { loading: [{
|
|
1319
|
+
type: Input
|
|
1320
|
+
}], absolute: [{
|
|
1321
|
+
type: Input
|
|
1322
|
+
}], smallLoading: [{
|
|
1323
|
+
type: Input
|
|
1324
|
+
}] } });
|
|
1325
|
+
|
|
1326
|
+
class StandardDialogComponent {
|
|
1327
|
+
constructor(data, componentFactoryResolver, dialogRef) {
|
|
1328
|
+
this.data = data;
|
|
1329
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
1330
|
+
this.dialogRef = dialogRef;
|
|
1331
|
+
this.loading = true;
|
|
1332
|
+
this.pending = false;
|
|
1333
|
+
this.ButtonType = ButtonType;
|
|
1334
|
+
}
|
|
1335
|
+
ngAfterViewInit() {
|
|
1336
|
+
setTimeout(() => {
|
|
1337
|
+
if (!this.data.component) {
|
|
1338
|
+
return;
|
|
1339
|
+
}
|
|
1340
|
+
this.component = this.componentContainer?.createComponent(this.componentFactoryResolver.resolveComponentFactory(this.data.component));
|
|
1341
|
+
if (this.component) {
|
|
1342
|
+
if (this.data.configs?.data) {
|
|
1343
|
+
this.component.instance.ready?.subscribe(() => {
|
|
1344
|
+
setTimeout(() => this.loading = false, 300);
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1347
|
+
else {
|
|
1348
|
+
setTimeout(() => this.loading = false, 300);
|
|
1349
|
+
}
|
|
1350
|
+
this.component.instance.data = this.data.configs?.data;
|
|
1351
|
+
this.component.instance.closeModal.subscribe((data) => {
|
|
1352
|
+
this.dialogRef.close(data);
|
|
1353
|
+
});
|
|
1354
|
+
this.component.instance.loading?.subscribe((start) => {
|
|
1355
|
+
this.pending = start;
|
|
1356
|
+
});
|
|
1357
|
+
this.component.instance.disable?.subscribe((disabled) => {
|
|
1358
|
+
if (this.data.configs?.button) {
|
|
1359
|
+
this.data.configs.button.disabled = disabled;
|
|
1360
|
+
}
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1363
|
+
}, 10);
|
|
1364
|
+
}
|
|
1365
|
+
save(type = '') {
|
|
1366
|
+
if (type === 'close') {
|
|
1367
|
+
this.dialogRef.close(true);
|
|
1368
|
+
}
|
|
1369
|
+
else if (this.component) {
|
|
1370
|
+
if (this.pending) {
|
|
1371
|
+
return;
|
|
1372
|
+
}
|
|
1373
|
+
this.component.instance.save();
|
|
1374
|
+
}
|
|
1375
|
+
else {
|
|
1376
|
+
this.dialogRef.close(true);
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
close() {
|
|
1380
|
+
this.dialogRef.close(null);
|
|
1381
|
+
}
|
|
1382
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: StandardDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i0.ComponentFactoryResolver }, { token: i1$1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1383
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.2", type: StandardDialogComponent, isStandalone: true, selector: "i-tech-standard-dialog", viewQueries: [{ propertyName: "componentContainer", first: true, predicate: ["component"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"modal_content standard_dialog flex_between\" *ngIf=\"data\" [ngClass]=\"{visibility_hidden: loading}\">\r\n <div class=\"modal-title-text base-bold\" *ngIf=\"data.configs?.title\">\r\n {{(data.configs?.title || '') | translate}}\r\n </div>\r\n <div *ngIf=\"data.configs?.description\" class=\"modal-body-text mt-16\">\r\n {{(data.configs?.description || '') | translate}}\r\n </div>\r\n\r\n <div class=\"modal_content--content\"\r\n [ngClass]=\"data?.configs?.marginTop === false || !data.configs?.title ? '' : 'mt-20 mb-standard-dialog'\"\r\n >\r\n <ng-container #component></ng-container>\r\n </div>\r\n <div class=\"ml-auto flex_align_center\" [ngClass]=\"data.configs?.actionsMarginTop || ''\">\r\n <i-tech-button\r\n *ngIf=\"!data.configs?.cancelButton?.hidden\"\r\n (click)=\"close()\"\r\n [customClass]=\"'mr-20'\"\r\n [type]=\"ButtonType.TONAL\"\r\n [text]=\"data.configs?.cancelButton?.text || 'Cancel'\"\r\n ></i-tech-button>\r\n <i-tech-button\r\n *ngIf=\"!data.configs?.button?.hidden\"\r\n [customClass]=\"(data.configs?.button?.class || '') + ' ' + (data.configs?.button?.disabled ? ' disabled' : '')\"\r\n [disabled]=\"data.configs?.button?.disabled || false\"\r\n [submit]=\"pending\"\r\n [type]=\"data.configs?.button?.buttonType || ButtonType.FILLED\"\r\n (click)=\"save(data.configs?.button?.type)\"\r\n [text]=\"(data.configs?.button?.text || 'Save')\"\r\n ></i-tech-button>\r\n </div>\r\n</div>\r\n<i-tech-loading [loading]=\"loading\" ></i-tech-loading>\r\n", styles: [".modal_content{position:relative}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "component", type: LoadingComponent, selector: "i-tech-loading", inputs: ["loading", "absolute", "smallLoading"] }, { kind: "component", type: ButtonComponent, selector: "i-tech-button", inputs: ["text", "data_cy", "fontIcon", "svgIcon", "type", "customClass", "submit", "disabled", "activated", "color"], outputs: ["buttonClick"] }] }); }
|
|
1384
|
+
}
|
|
1385
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: StandardDialogComponent, decorators: [{
|
|
1386
|
+
type: Component,
|
|
1387
|
+
args: [{ selector: 'i-tech-standard-dialog', imports: [
|
|
1388
|
+
NgClass,
|
|
1389
|
+
NgIf,
|
|
1390
|
+
TranslateModule,
|
|
1391
|
+
LoadingComponent,
|
|
1392
|
+
ButtonComponent,
|
|
1393
|
+
], template: "<div class=\"modal_content standard_dialog flex_between\" *ngIf=\"data\" [ngClass]=\"{visibility_hidden: loading}\">\r\n <div class=\"modal-title-text base-bold\" *ngIf=\"data.configs?.title\">\r\n {{(data.configs?.title || '') | translate}}\r\n </div>\r\n <div *ngIf=\"data.configs?.description\" class=\"modal-body-text mt-16\">\r\n {{(data.configs?.description || '') | translate}}\r\n </div>\r\n\r\n <div class=\"modal_content--content\"\r\n [ngClass]=\"data?.configs?.marginTop === false || !data.configs?.title ? '' : 'mt-20 mb-standard-dialog'\"\r\n >\r\n <ng-container #component></ng-container>\r\n </div>\r\n <div class=\"ml-auto flex_align_center\" [ngClass]=\"data.configs?.actionsMarginTop || ''\">\r\n <i-tech-button\r\n *ngIf=\"!data.configs?.cancelButton?.hidden\"\r\n (click)=\"close()\"\r\n [customClass]=\"'mr-20'\"\r\n [type]=\"ButtonType.TONAL\"\r\n [text]=\"data.configs?.cancelButton?.text || 'Cancel'\"\r\n ></i-tech-button>\r\n <i-tech-button\r\n *ngIf=\"!data.configs?.button?.hidden\"\r\n [customClass]=\"(data.configs?.button?.class || '') + ' ' + (data.configs?.button?.disabled ? ' disabled' : '')\"\r\n [disabled]=\"data.configs?.button?.disabled || false\"\r\n [submit]=\"pending\"\r\n [type]=\"data.configs?.button?.buttonType || ButtonType.FILLED\"\r\n (click)=\"save(data.configs?.button?.type)\"\r\n [text]=\"(data.configs?.button?.text || 'Save')\"\r\n ></i-tech-button>\r\n </div>\r\n</div>\r\n<i-tech-loading [loading]=\"loading\" ></i-tech-loading>\r\n", styles: [".modal_content{position:relative}\n"] }]
|
|
1394
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1395
|
+
type: Inject,
|
|
1396
|
+
args: [MAT_DIALOG_DATA]
|
|
1397
|
+
}] }, { type: i0.ComponentFactoryResolver }, { type: i1$1.MatDialogRef }], propDecorators: { componentContainer: [{
|
|
1398
|
+
type: ViewChild,
|
|
1399
|
+
args: ['component', { read: ViewContainerRef }]
|
|
1400
|
+
}] } });
|
|
1401
|
+
|
|
1402
|
+
// Services
|
|
1403
|
+
class CustomDialogComponent {
|
|
1404
|
+
constructor(data) {
|
|
1405
|
+
this.data = data;
|
|
1406
|
+
}
|
|
1407
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: CustomDialogComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1408
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.2", type: CustomDialogComponent, isStandalone: true, selector: "i-tech-custom-dialog", ngImport: i0, template: "<div class=\"modal_content flex_between\">\r\n <div class=\"modal_content--content\">\r\n <ng-template [ngComponentOutlet]=\"data.component\"></ng-template>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }] }); }
|
|
1409
|
+
}
|
|
1410
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: CustomDialogComponent, decorators: [{
|
|
1411
|
+
type: Component,
|
|
1412
|
+
args: [{ selector: 'i-tech-custom-dialog', imports: [
|
|
1413
|
+
NgComponentOutlet
|
|
1414
|
+
], template: "<div class=\"modal_content flex_between\">\r\n <div class=\"modal_content--content\">\r\n <ng-template [ngComponentOutlet]=\"data.component\"></ng-template>\r\n </div>\r\n</div>\r\n" }]
|
|
1415
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1416
|
+
type: Inject,
|
|
1417
|
+
args: [MAT_DIALOG_DATA]
|
|
1418
|
+
}] }] });
|
|
1419
|
+
|
|
1420
|
+
var ConfirmationDialogTypesEnum;
|
|
1421
|
+
(function (ConfirmationDialogTypesEnum) {
|
|
1422
|
+
ConfirmationDialogTypesEnum["WARNING"] = "WARNING";
|
|
1423
|
+
ConfirmationDialogTypesEnum["CONFIRMATION"] = "CONFIRMATION";
|
|
1424
|
+
})(ConfirmationDialogTypesEnum || (ConfirmationDialogTypesEnum = {}));
|
|
1425
|
+
|
|
1426
|
+
class ConfirmationDialogByTypeComponent {
|
|
1427
|
+
constructor(data, dialogRef) {
|
|
1428
|
+
this.data = data;
|
|
1429
|
+
this.dialogRef = dialogRef;
|
|
1430
|
+
this.ConfirmationDialogTypesEnum = ConfirmationDialogTypesEnum;
|
|
1431
|
+
this.ButtonType = ButtonType;
|
|
1432
|
+
this.loading = false;
|
|
1433
|
+
if (data.subject) {
|
|
1434
|
+
data.subject.subscribe(res => {
|
|
1435
|
+
if (res.type === 'close') {
|
|
1436
|
+
this.dialogRef.close(1);
|
|
1437
|
+
}
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
confirm() {
|
|
1442
|
+
if (this.data.subject) {
|
|
1443
|
+
this.loading = true;
|
|
1444
|
+
this.data.subject.next({ type: 'access' });
|
|
1445
|
+
return;
|
|
1446
|
+
}
|
|
1447
|
+
this.dialogRef.close(1);
|
|
1448
|
+
}
|
|
1449
|
+
dismiss() {
|
|
1450
|
+
this.dialogRef.close(0);
|
|
1451
|
+
}
|
|
1452
|
+
ngOnDestroy() {
|
|
1453
|
+
this.data.subject?.unsubscribe();
|
|
1454
|
+
}
|
|
1455
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: ConfirmationDialogByTypeComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1456
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.2", type: ConfirmationDialogByTypeComponent, isStandalone: true, selector: "i-tech-confirmation-dialog-by-type", ngImport: i0, template: "<div class=\"modal_content flex_between\" *ngIf=\"data\">\r\n <div class=\"modal-title-text base-bold\">\r\n {{(data?.modalTitle || data.type) | translate}}\r\n </div>\r\n <div class=\"modal-body-text mt-20\" *ngIf=\"!data.descriptionByHtml\" [ngClass]=\"{unset_max_width: data.unsetMaxWidth}\">\r\n {{(data.description || '') | translate }}\r\n </div>\r\n\r\n <div class=\"modal-body-text mt-20\" *ngIf=\"data.descriptionByHtml\"\r\n [innerHTML]=\"data.description\"\r\n [ngClass]=\"{unset_max_width: data.unsetMaxWidth}\"\r\n >\r\n </div>\r\n\r\n <div class=\"mt-50 flex_end flex_align_center\">\r\n <i-tech-button\r\n [type]=\"ButtonType.TONAL\"\r\n [customClass]=\"'mr-20'\"\r\n (click)=\"dismiss()\"\r\n [text]=\"(data.cancelText || 'cancel._')\"\r\n ></i-tech-button>\r\n <i-tech-button\r\n (click)=\"confirm()\"\r\n [color]=\"data.type === ConfirmationDialogTypesEnum.CONFIRMATION ? 'primary' : 'warn'\"\r\n [text]=\"(data.confirmText || 'yes')\"\r\n ></i-tech-button>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "component", type: ButtonComponent, selector: "i-tech-button", inputs: ["text", "data_cy", "fontIcon", "svgIcon", "type", "customClass", "submit", "disabled", "activated", "color"], outputs: ["buttonClick"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
1457
|
+
}
|
|
1458
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: ConfirmationDialogByTypeComponent, decorators: [{
|
|
1459
|
+
type: Component,
|
|
1460
|
+
args: [{ selector: 'i-tech-confirmation-dialog-by-type', imports: [
|
|
1461
|
+
TranslateModule,
|
|
1462
|
+
ButtonComponent,
|
|
1463
|
+
CommonModule
|
|
1464
|
+
], template: "<div class=\"modal_content flex_between\" *ngIf=\"data\">\r\n <div class=\"modal-title-text base-bold\">\r\n {{(data?.modalTitle || data.type) | translate}}\r\n </div>\r\n <div class=\"modal-body-text mt-20\" *ngIf=\"!data.descriptionByHtml\" [ngClass]=\"{unset_max_width: data.unsetMaxWidth}\">\r\n {{(data.description || '') | translate }}\r\n </div>\r\n\r\n <div class=\"modal-body-text mt-20\" *ngIf=\"data.descriptionByHtml\"\r\n [innerHTML]=\"data.description\"\r\n [ngClass]=\"{unset_max_width: data.unsetMaxWidth}\"\r\n >\r\n </div>\r\n\r\n <div class=\"mt-50 flex_end flex_align_center\">\r\n <i-tech-button\r\n [type]=\"ButtonType.TONAL\"\r\n [customClass]=\"'mr-20'\"\r\n (click)=\"dismiss()\"\r\n [text]=\"(data.cancelText || 'cancel._')\"\r\n ></i-tech-button>\r\n <i-tech-button\r\n (click)=\"confirm()\"\r\n [color]=\"data.type === ConfirmationDialogTypesEnum.CONFIRMATION ? 'primary' : 'warn'\"\r\n [text]=\"(data.confirmText || 'yes')\"\r\n ></i-tech-button>\r\n </div>\r\n</div>\r\n" }]
|
|
1465
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1466
|
+
type: Inject,
|
|
1467
|
+
args: [MAT_DIALOG_DATA]
|
|
1468
|
+
}] }, { type: i1$1.MatDialogRef }] });
|
|
1469
|
+
|
|
1470
|
+
class DialogService {
|
|
1471
|
+
constructor(dialogService) {
|
|
1472
|
+
this.dialogService = dialogService;
|
|
1473
|
+
}
|
|
1474
|
+
openStandardDialog(component = null, styleConfigs, data = null) {
|
|
1475
|
+
styleConfigs.maxHeight = '90vh';
|
|
1476
|
+
if (!styleConfigs.maxWidth) {
|
|
1477
|
+
styleConfigs.maxWidth = '90vw';
|
|
1478
|
+
}
|
|
1479
|
+
return this.dialogService.open(StandardDialogComponent, {
|
|
1480
|
+
...styleConfigs,
|
|
1481
|
+
data: { configs: data, component },
|
|
1482
|
+
scrollStrategy: new NoopScrollStrategy(),
|
|
1483
|
+
});
|
|
1484
|
+
}
|
|
1485
|
+
openCustomDialog(component, styleConfigs = {}, data = null) {
|
|
1486
|
+
styleConfigs.maxWidth = '95vw';
|
|
1487
|
+
return this.dialogService.open(CustomDialogComponent, {
|
|
1488
|
+
...styleConfigs,
|
|
1489
|
+
data: { configs: data, component },
|
|
1490
|
+
scrollStrategy: new NoopScrollStrategy()
|
|
1491
|
+
});
|
|
1492
|
+
}
|
|
1493
|
+
openConfirmationDialogByType(type, styleConfigs, data) {
|
|
1494
|
+
return this.dialogService.open(ConfirmationDialogByTypeComponent, {
|
|
1495
|
+
...styleConfigs,
|
|
1496
|
+
data: { ...data, type },
|
|
1497
|
+
scrollStrategy: new NoopScrollStrategy(),
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: DialogService, deps: [{ token: i1$1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1501
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: DialogService, providedIn: 'root' }); }
|
|
1502
|
+
}
|
|
1503
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImport: i0, type: DialogService, decorators: [{
|
|
1504
|
+
type: Injectable,
|
|
1505
|
+
args: [{
|
|
1506
|
+
providedIn: 'root'
|
|
1507
|
+
}]
|
|
1508
|
+
}], ctorParameters: () => [{ type: i1$1.MatDialog }] });
|
|
1509
|
+
|
|
1239
1510
|
/*
|
|
1240
1511
|
* Public API Surface of shared-components
|
|
1241
1512
|
*/
|
|
@@ -1244,5 +1515,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.2", ngImpor
|
|
|
1244
1515
|
* Generated bundle index. Do not edit.
|
|
1245
1516
|
*/
|
|
1246
1517
|
|
|
1247
|
-
export { ArrayToStringPipe, AutocompleteSelectComponent, ButtonComponent, ButtonType, ClearValueComponent, DatePickerComponent, DateRangeDatepickerComponent, GenerateErrorMessagesPipe, GetValueByKeyFromObjectPipe, IconButtonComponent, InputMaskDirective, InputService, MenuComponent, TextInputComponent };
|
|
1518
|
+
export { ArrayToStringPipe, AutocompleteSelectComponent, ButtonComponent, ButtonType, ClearValueComponent, ConfirmationDialogByTypeComponent, CustomDialogComponent, DatePickerComponent, DateRangeDatepickerComponent, DialogService, GenerateErrorMessagesPipe, GetValueByKeyFromObjectPipe, IconButtonComponent, InputMaskDirective, InputService, LabelComponent, LoadingComponent, MenuComponent, StandardDialogComponent, TextInputComponent };
|
|
1248
1519
|
//# sourceMappingURL=i-tech-shared-components.mjs.map
|