tin-spa 2.1.60 → 2.2.1
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/classes/Classes.mjs +1 -1
- package/esm2020/lib/classes/TinCore.mjs +14 -8
- package/esm2020/lib/components/table/detailsDialog.component.mjs +7 -5
- package/esm2020/lib/components/table/table.component.mjs +7 -7
- package/esm2020/lib/components/table-internal/detailsDialog-internal.component.mjs +4 -1
- package/esm2020/lib/components/table-internal/table-internal.component.mjs +7 -7
- package/fesm2015/tin-spa.mjs +34 -24
- package/fesm2015/tin-spa.mjs.map +1 -1
- package/fesm2020/tin-spa.mjs +34 -23
- package/fesm2020/tin-spa.mjs.map +1 -1
- package/lib/classes/Classes.d.ts +1 -1
- package/lib/components/table/detailsDialog.component.d.ts +1 -1
- package/package.json +1 -1
package/fesm2015/tin-spa.mjs
CHANGED
|
@@ -459,17 +459,16 @@ class Core {
|
|
|
459
459
|
Core.nullDate = "01 Jan 1969";
|
|
460
460
|
class DetailsDialogProcessor {
|
|
461
461
|
static processDetailsConfig(detailsConfig, row) {
|
|
462
|
-
var _a;
|
|
463
462
|
const updatedDetailsConfig = Core.getClone(detailsConfig);
|
|
464
463
|
updatedDetailsConfig.details = row;
|
|
465
|
-
updatedDetailsConfig.
|
|
466
|
-
updatedDetailsConfig.setHero =
|
|
464
|
+
updatedDetailsConfig.formConfig.mode = "view";
|
|
465
|
+
// updatedDetailsConfig.setHero = updatedDetailsConfig.setHero ?? false;
|
|
467
466
|
if (updatedDetailsConfig.heroField) {
|
|
468
467
|
updatedDetailsConfig.heroValue = row[updatedDetailsConfig.heroField];
|
|
469
468
|
function updateTableConfig(tableConfig) {
|
|
470
469
|
tableConfig.heroField = updatedDetailsConfig.heroField;
|
|
471
470
|
tableConfig.heroValue = updatedDetailsConfig.heroValue;
|
|
472
|
-
tableConfig.setHero = updatedDetailsConfig.setHero;
|
|
471
|
+
// tableConfig.setHero = updatedDetailsConfig.setHero;
|
|
473
472
|
tableConfig.searchConfig = null;
|
|
474
473
|
tableConfig.tileConfig = null;
|
|
475
474
|
tableConfig.parentData = updatedDetailsConfig.details;
|
|
@@ -502,15 +501,21 @@ class DetailsDialogProcessor {
|
|
|
502
501
|
var _a;
|
|
503
502
|
const tableConfig = detailsConfig.tableConfig;
|
|
504
503
|
const tableConfigs = detailsConfig.tableConfigs;
|
|
505
|
-
const formConfig = detailsConfig.
|
|
504
|
+
const formConfig = detailsConfig.formConfig;
|
|
506
505
|
const buttons = detailsConfig.buttons;
|
|
507
506
|
formConfig.mode = (_a = formConfig.mode) !== null && _a !== void 0 ? _a : "view";
|
|
508
507
|
return { tableConfig, tableConfigs, formConfig, buttons };
|
|
509
508
|
}
|
|
510
509
|
static setHeroValue(detailsConfig, details) {
|
|
511
|
-
|
|
512
|
-
|
|
510
|
+
console.log(detailsConfig);
|
|
511
|
+
if ((detailsConfig.formConfig.mode == "create") && detailsConfig.heroField && detailsConfig.heroValue) {
|
|
512
|
+
details[detailsConfig.heroField] = detailsConfig.heroValue;
|
|
513
|
+
return;
|
|
513
514
|
}
|
|
515
|
+
// if (detailsConfig.config.mode != "create" && detailsConfig.heroField) {
|
|
516
|
+
// detailsConfig.heroValue = details[detailsConfig.heroField];
|
|
517
|
+
// }
|
|
518
|
+
console.log(detailsConfig);
|
|
514
519
|
}
|
|
515
520
|
static handleFormMode(detailsConfig, formConfig) {
|
|
516
521
|
let details;
|
|
@@ -518,7 +523,7 @@ class DetailsDialogProcessor {
|
|
|
518
523
|
let loadByAction = false;
|
|
519
524
|
if (formConfig.mode === "create") {
|
|
520
525
|
details = Core.generateObject(formConfig.fields);
|
|
521
|
-
this.setHeroValue(detailsConfig, details);
|
|
526
|
+
// this.setHeroValue(detailsConfig, details);
|
|
522
527
|
}
|
|
523
528
|
else {
|
|
524
529
|
let resp = this.loadDetailsData(detailsConfig, formConfig);
|
|
@@ -3303,6 +3308,7 @@ class DetailsDialogInternal {
|
|
|
3303
3308
|
this.tableConfigs = tableConfigs;
|
|
3304
3309
|
this.formConfig = formConfig;
|
|
3305
3310
|
this.buttons = buttons;
|
|
3311
|
+
// console.log(this.detailsConfig)
|
|
3306
3312
|
let resp = DetailsDialogProcessor.handleFormMode(this.detailsConfig, this.formConfig);
|
|
3307
3313
|
if (resp.loadByAction) {
|
|
3308
3314
|
this.loadByAction = true;
|
|
@@ -3311,6 +3317,7 @@ class DetailsDialogInternal {
|
|
|
3311
3317
|
}
|
|
3312
3318
|
else {
|
|
3313
3319
|
this.details = resp.details;
|
|
3320
|
+
DetailsDialogProcessor.setHeroValue(this.detailsConfig, this.details);
|
|
3314
3321
|
this.loadByAction = false;
|
|
3315
3322
|
this.isLoadComplete = true;
|
|
3316
3323
|
}
|
|
@@ -3332,6 +3339,7 @@ class DetailsDialogInternal {
|
|
|
3332
3339
|
if (apiResponse.success) {
|
|
3333
3340
|
this.details = apiResponse.data;
|
|
3334
3341
|
this.isLoadComplete = true;
|
|
3342
|
+
// DetailsDialogProcessor.setHeroValue(this.detailsConfig, this.details);
|
|
3335
3343
|
}
|
|
3336
3344
|
else {
|
|
3337
3345
|
this.messageService.toast("Error: " + apiResponse.message);
|
|
@@ -3922,14 +3930,14 @@ class TableInternalComponent {
|
|
|
3922
3930
|
return;
|
|
3923
3931
|
}
|
|
3924
3932
|
let conf = {
|
|
3925
|
-
|
|
3933
|
+
formConfig: this.config.formConfig,
|
|
3926
3934
|
buttons: this.config.buttons,
|
|
3927
3935
|
details: row,
|
|
3928
3936
|
};
|
|
3929
3937
|
if (button.detailsConfig) {
|
|
3930
3938
|
conf = DetailsDialogProcessor.processDetailsConfig(button.detailsConfig, row);
|
|
3931
3939
|
}
|
|
3932
|
-
conf.
|
|
3940
|
+
conf.formConfig.mode = "view";
|
|
3933
3941
|
const dialogRef = this.dialog.open(DetailsDialogInternal, {
|
|
3934
3942
|
width: "900px",
|
|
3935
3943
|
data: conf
|
|
@@ -3955,13 +3963,13 @@ class TableInternalComponent {
|
|
|
3955
3963
|
}
|
|
3956
3964
|
this.config.formConfig.mode = "create";
|
|
3957
3965
|
let conf = {
|
|
3958
|
-
|
|
3966
|
+
formConfig: this.config.formConfig,
|
|
3959
3967
|
buttons: this.config.buttons,
|
|
3960
3968
|
};
|
|
3961
3969
|
if (button.detailsConfig) {
|
|
3962
3970
|
conf = button.detailsConfig;
|
|
3963
3971
|
}
|
|
3964
|
-
conf.
|
|
3972
|
+
conf.formConfig.mode = "create";
|
|
3965
3973
|
conf.heroField = (_a = this.config) === null || _a === void 0 ? void 0 : _a.heroField;
|
|
3966
3974
|
conf.heroValue = (_b = this.config) === null || _b === void 0 ? void 0 : _b.heroValue;
|
|
3967
3975
|
const dialogRef = this.dialog.open(DetailsDialogInternal, {
|
|
@@ -3992,14 +4000,14 @@ class TableInternalComponent {
|
|
|
3992
4000
|
}
|
|
3993
4001
|
this.config.formConfig.mode = "edit";
|
|
3994
4002
|
let conf = {
|
|
3995
|
-
|
|
4003
|
+
formConfig: this.config.formConfig,
|
|
3996
4004
|
buttons: this.config.buttons,
|
|
3997
4005
|
details: row,
|
|
3998
4006
|
};
|
|
3999
4007
|
if (button.detailsConfig) {
|
|
4000
4008
|
conf = DetailsDialogProcessor.processDetailsConfig(button.detailsConfig, row);
|
|
4001
4009
|
}
|
|
4002
|
-
conf.
|
|
4010
|
+
conf.formConfig.mode = "edit";
|
|
4003
4011
|
const dialogRef = this.dialog.open(DetailsDialogInternal, {
|
|
4004
4012
|
width: "900px",
|
|
4005
4013
|
data: conf
|
|
@@ -4131,7 +4139,7 @@ class DetailsDialog {
|
|
|
4131
4139
|
if (resp.loadByAction) {
|
|
4132
4140
|
this.loadByAction = true;
|
|
4133
4141
|
formConfig.loadAction = resp.action;
|
|
4134
|
-
this.loadData(resp.action);
|
|
4142
|
+
this.loadData(resp.action, false);
|
|
4135
4143
|
}
|
|
4136
4144
|
else {
|
|
4137
4145
|
this.details = resp.details;
|
|
@@ -4147,7 +4155,7 @@ class DetailsDialog {
|
|
|
4147
4155
|
this.deleteButton = deleteButton;
|
|
4148
4156
|
this.setTitleAction();
|
|
4149
4157
|
}
|
|
4150
|
-
loadData(action) {
|
|
4158
|
+
loadData(action, reload) {
|
|
4151
4159
|
console.log("loading details");
|
|
4152
4160
|
if (action && this.loadByAction) {
|
|
4153
4161
|
console.log("Loading action");
|
|
@@ -4156,6 +4164,8 @@ class DetailsDialog {
|
|
|
4156
4164
|
if (apiResponse.success) {
|
|
4157
4165
|
this.details = apiResponse.data;
|
|
4158
4166
|
this.isLoadComplete = true;
|
|
4167
|
+
if (reload)
|
|
4168
|
+
this.tableReload.next(true);
|
|
4159
4169
|
}
|
|
4160
4170
|
else {
|
|
4161
4171
|
this.messageService.toast("Error: " + apiResponse.message);
|
|
@@ -4338,10 +4348,10 @@ class DetailsDialog {
|
|
|
4338
4348
|
}
|
|
4339
4349
|
}
|
|
4340
4350
|
DetailsDialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DetailsDialog, deps: [{ token: i3$3.BreakpointObserver }, { token: LoaderService }, { token: DataServiceLib }, { token: MessageService }, { token: i4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
4341
|
-
DetailsDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: DetailsDialog, selector: "app-viewModel", outputs: { inputChange: "inputChange" }, ngImport: i0, template: "<mat-progress-bar mode=\"indeterminate\" *ngIf=\"isProcessing\"></mat-progress-bar>\r\n<div class=\"row d-flex align-items-center mt-0\">\r\n\r\n <div class=\"col\">\r\n <h2 mat-dialog-title>{{titleAction | titlecase}} {{formConfig?.title}}</h2>\r\n </div>\r\n\r\n <div class=\"col d-flex justify-content-end\">\r\n\r\n <div *ngIf=\"formConfig.mode=='view' && editButton && testVisible(details,editButton.name)\" class=\"col d-flex justify-content-end\">\r\n <button mat-icon-button matTooltipPosition=\"above\" matTooltip=\"Edit\" color=\"primary\" (click)=\"setMode('edit')\" [disabled]=\"testDisabled(details,editButton.name)\"><mat-icon>edit</mat-icon></button>\r\n </div>\r\n\r\n <button [disabled]=\"isProcessing\" *ngIf=\"loadByAction\" mat-icon-button matTooltipPosition=\"above\" matTooltip=\"Refresh\" color=\"primary\" (click)=\"loadData(formConfig.loadAction)\"><mat-icon class=\"refreshIcon\">cached</mat-icon></button>\r\n </div>\r\n\r\n</div>\r\n\r\n<mat-dialog-content class=\"mat-typography\">\r\n\r\n<div class=\"tin-input\" style=\"font-size:14px\">\r\n\r\n<p *ngIf=\"formConfig && !details\"><em>Loading...</em></p>\r\n\r\n<spa-form *ngIf=\"formConfig && details\" [files]=\"files\" [data]=\"details\" [config]=\"formConfig\" (inputChange)=\"inputChanged($event)\"></spa-form>\r\n\r\n<div *ngIf=\"tableConfig\" class=\"mt-3\" style=\" font-size: 14px;\">\r\n <spa-table-internal [config]=\"tableConfig\" [reload]=\"tableReload\" ></spa-table-internal>\r\n</div>\r\n\r\n<mat-tab-group *ngIf=\"tableConfigs\">\r\n\r\n <ng-container *ngFor=\"let tbl of tableConfigs\">\r\n\r\n <mat-tab *ngIf=\"testVisibleTab(tbl)\">\r\n <ng-template matTabLabel>\r\n <span>{{tbl.title}}</span>\r\n </ng-template>\r\n\r\n <spa-table-internal [config]=\"tbl\" [hideTitle]=\"true\" [reload]=\"tableReload\" ></spa-table-internal>\r\n\r\n </mat-tab>\r\n </ng-container>\r\n\r\n\r\n</mat-tab-group>\r\n\r\n\r\n\r\n</div>\r\n\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n\r\n <div>\r\n\r\n <button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='create' && createButton\"\r\n (click)=\"create()\" cdkFocusInitial>{{createButton.display ?? 'Submit'}}\r\n </button>\r\n\r\n <button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='edit' && editButton\"\r\n (click)=\"edit()\" cdkFocusInitial>{{editButton.display ?? 'Submit'}}\r\n </button>\r\n\r\n <ng-container *ngFor=\"let btn of extraButtons\" >\r\n <button *ngIf=\"!smallScreen && testVisible(details,btn.name)\" mat-stroked-button [disabled]=\"isProcessing || testDisabled(details,btn.name)\" [ngStyle]=\"{'color': getButtonColor(btn, details)}\"\r\n (click)=\"custom(btn)\" cdkFocusInitial><mat-icon [ngStyle]=\"{'color': getButtonColor(btn, details)}\">{{btn.icon.name}}</mat-icon>{{btn.display ?? btn.name}}\r\n </button>\r\n </ng-container>\r\n\r\n\r\n <button mat-stroked-button color=\"primary\" mat-dialog-close>Cancel</button>\r\n\r\n </div>\r\n\r\n <div class=\"col d-flex justify-content-end\" *ngIf=\"smallScreen\">\r\n <ng-container *ngFor=\"let btn of extraButtons\">\r\n <button *ngIf=\"testVisible(details,btn.name)\" mat-icon-button [disabled]=\"isProcessing || testDisabled(details,btn.name)\" [ngStyle]=\"{'color': getButtonColor(btn, details)}\"\r\n (click)=\"custom(btn)\" cdkFocusInitial><mat-icon>{{btn.icon.name}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n\r\n <button mat-icon-button [disabled]=\"isProcessing\" style=\"color: red;\" (click)=\"delete()\" *ngIf=\"formConfig.mode!='create' && deleteButton\"><mat-icon>delete</mat-icon></button>\r\n </div>\r\n\r\n\r\n</mat-dialog-actions>\r\n\r\n\r\n\r\n", styles: [".top{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center;margin-bottom:10px;margin-top:10px}.mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.mat-icon-button{width:32px;height:32px}.mat-icon-button mat-icon{font-size:20px;margin-top:-7px}.col-icon{margin-left:10px}.title{margin-top:10px;font-size:larger;font-weight:300}.make-gray{background-color:#e5e5e5}.right-padding{padding-right:10px}.action-buttons-container{display:flex;justify-content:flex-end;align-items:center}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i5.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"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i9.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { kind: "directive", type: i9.MatTabLabel, selector: "[mat-tab-label], [matTabLabel]" }, { kind: "component", type: i9.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "directive", type: i7$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i10$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: TableInternalComponent, selector: "spa-table-internal", inputs: ["hideTitle", "data", "config", "reload"], outputs: ["dataLoad", "refreshClick", "searchClick", "createClick", "actionClick", "inputChange"] }, { kind: "component", type: FormComponent, selector: "spa-form", inputs: ["files", "data", "config"], outputs: ["buttonClick", "inputChange"] }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }] });
|
|
4351
|
+
DetailsDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: DetailsDialog, selector: "app-viewModel", outputs: { inputChange: "inputChange" }, ngImport: i0, template: "<mat-progress-bar mode=\"indeterminate\" *ngIf=\"isProcessing\"></mat-progress-bar>\r\n<div class=\"row d-flex align-items-center mt-0\">\r\n\r\n <div class=\"col\">\r\n <h2 mat-dialog-title>{{titleAction | titlecase}} {{formConfig?.title}}</h2>\r\n </div>\r\n\r\n <div class=\"col d-flex justify-content-end\">\r\n\r\n <div *ngIf=\"formConfig.mode=='view' && editButton && testVisible(details,editButton.name)\" class=\"col d-flex justify-content-end\">\r\n <button mat-icon-button matTooltipPosition=\"above\" matTooltip=\"Edit\" color=\"primary\" (click)=\"setMode('edit')\" [disabled]=\"testDisabled(details,editButton.name)\"><mat-icon>edit</mat-icon></button>\r\n </div>\r\n\r\n <button [disabled]=\"isProcessing\" *ngIf=\"loadByAction\" mat-icon-button matTooltipPosition=\"above\" matTooltip=\"Refresh\" color=\"primary\" (click)=\"loadData(formConfig.loadAction, true)\"><mat-icon class=\"refreshIcon\">cached</mat-icon></button>\r\n </div>\r\n\r\n</div>\r\n\r\n<mat-dialog-content class=\"mat-typography\">\r\n\r\n<div class=\"tin-input\" style=\"font-size:14px\">\r\n\r\n<p *ngIf=\"formConfig && !details\"><em>Loading...</em></p>\r\n\r\n<spa-form *ngIf=\"formConfig && details\" [files]=\"files\" [data]=\"details\" [config]=\"formConfig\" (inputChange)=\"inputChanged($event)\"></spa-form>\r\n\r\n<div *ngIf=\"tableConfig\" class=\"mt-3\" style=\" font-size: 14px;\">\r\n <spa-table-internal [config]=\"tableConfig\" [reload]=\"tableReload\" ></spa-table-internal>\r\n</div>\r\n\r\n<mat-tab-group *ngIf=\"tableConfigs\">\r\n\r\n <ng-container *ngFor=\"let tbl of tableConfigs\">\r\n\r\n <mat-tab *ngIf=\"testVisibleTab(tbl)\">\r\n <ng-template matTabLabel>\r\n <span>{{tbl.title}}</span>\r\n </ng-template>\r\n\r\n <spa-table-internal [config]=\"tbl\" [hideTitle]=\"true\" [reload]=\"tableReload\" ></spa-table-internal>\r\n\r\n </mat-tab>\r\n </ng-container>\r\n\r\n\r\n</mat-tab-group>\r\n\r\n\r\n\r\n</div>\r\n\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n\r\n <div>\r\n\r\n <button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='create' && createButton\"\r\n (click)=\"create()\" cdkFocusInitial>{{createButton.display ?? 'Submit'}}\r\n </button>\r\n\r\n <button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='edit' && editButton\"\r\n (click)=\"edit()\" cdkFocusInitial>{{editButton.display ?? 'Submit'}}\r\n </button>\r\n\r\n <ng-container *ngFor=\"let btn of extraButtons\" >\r\n <button *ngIf=\"!smallScreen && testVisible(details,btn.name)\" mat-stroked-button [disabled]=\"isProcessing || testDisabled(details,btn.name)\" [ngStyle]=\"{'color': getButtonColor(btn, details)}\"\r\n (click)=\"custom(btn)\" cdkFocusInitial><mat-icon [ngStyle]=\"{'color': getButtonColor(btn, details)}\">{{btn.icon.name}}</mat-icon>{{btn.display ?? btn.name}}\r\n </button>\r\n </ng-container>\r\n\r\n\r\n <button mat-stroked-button color=\"primary\" mat-dialog-close>Cancel</button>\r\n\r\n </div>\r\n\r\n <div class=\"col d-flex justify-content-end\" *ngIf=\"smallScreen\">\r\n <ng-container *ngFor=\"let btn of extraButtons\">\r\n <button *ngIf=\"testVisible(details,btn.name)\" mat-icon-button [disabled]=\"isProcessing || testDisabled(details,btn.name)\" [ngStyle]=\"{'color': getButtonColor(btn, details)}\"\r\n (click)=\"custom(btn)\" cdkFocusInitial><mat-icon>{{btn.icon.name}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n\r\n <button mat-icon-button [disabled]=\"isProcessing\" style=\"color: red;\" (click)=\"delete()\" *ngIf=\"formConfig.mode!='create' && deleteButton\"><mat-icon>delete</mat-icon></button>\r\n </div>\r\n\r\n\r\n</mat-dialog-actions>\r\n\r\n\r\n\r\n", styles: [".top{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center;margin-bottom:10px;margin-top:10px}.mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.mat-icon-button{width:32px;height:32px}.mat-icon-button mat-icon{font-size:20px;margin-top:-7px}.col-icon{margin-left:10px}.title{margin-top:10px;font-size:larger;font-weight:300}.make-gray{background-color:#e5e5e5}.right-padding{padding-right:10px}.action-buttons-container{display:flex;justify-content:flex-end;align-items:center}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i5.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"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i9.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { kind: "directive", type: i9.MatTabLabel, selector: "[mat-tab-label], [matTabLabel]" }, { kind: "component", type: i9.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "directive", type: i7$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i10$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: TableInternalComponent, selector: "spa-table-internal", inputs: ["hideTitle", "data", "config", "reload"], outputs: ["dataLoad", "refreshClick", "searchClick", "createClick", "actionClick", "inputChange"] }, { kind: "component", type: FormComponent, selector: "spa-form", inputs: ["files", "data", "config"], outputs: ["buttonClick", "inputChange"] }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }] });
|
|
4342
4352
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DetailsDialog, decorators: [{
|
|
4343
4353
|
type: Component,
|
|
4344
|
-
args: [{ selector: 'app-viewModel', template: "<mat-progress-bar mode=\"indeterminate\" *ngIf=\"isProcessing\"></mat-progress-bar>\r\n<div class=\"row d-flex align-items-center mt-0\">\r\n\r\n <div class=\"col\">\r\n <h2 mat-dialog-title>{{titleAction | titlecase}} {{formConfig?.title}}</h2>\r\n </div>\r\n\r\n <div class=\"col d-flex justify-content-end\">\r\n\r\n <div *ngIf=\"formConfig.mode=='view' && editButton && testVisible(details,editButton.name)\" class=\"col d-flex justify-content-end\">\r\n <button mat-icon-button matTooltipPosition=\"above\" matTooltip=\"Edit\" color=\"primary\" (click)=\"setMode('edit')\" [disabled]=\"testDisabled(details,editButton.name)\"><mat-icon>edit</mat-icon></button>\r\n </div>\r\n\r\n <button [disabled]=\"isProcessing\" *ngIf=\"loadByAction\" mat-icon-button matTooltipPosition=\"above\" matTooltip=\"Refresh\" color=\"primary\" (click)=\"loadData(formConfig.loadAction)\"><mat-icon class=\"refreshIcon\">cached</mat-icon></button>\r\n </div>\r\n\r\n</div>\r\n\r\n<mat-dialog-content class=\"mat-typography\">\r\n\r\n<div class=\"tin-input\" style=\"font-size:14px\">\r\n\r\n<p *ngIf=\"formConfig && !details\"><em>Loading...</em></p>\r\n\r\n<spa-form *ngIf=\"formConfig && details\" [files]=\"files\" [data]=\"details\" [config]=\"formConfig\" (inputChange)=\"inputChanged($event)\"></spa-form>\r\n\r\n<div *ngIf=\"tableConfig\" class=\"mt-3\" style=\" font-size: 14px;\">\r\n <spa-table-internal [config]=\"tableConfig\" [reload]=\"tableReload\" ></spa-table-internal>\r\n</div>\r\n\r\n<mat-tab-group *ngIf=\"tableConfigs\">\r\n\r\n <ng-container *ngFor=\"let tbl of tableConfigs\">\r\n\r\n <mat-tab *ngIf=\"testVisibleTab(tbl)\">\r\n <ng-template matTabLabel>\r\n <span>{{tbl.title}}</span>\r\n </ng-template>\r\n\r\n <spa-table-internal [config]=\"tbl\" [hideTitle]=\"true\" [reload]=\"tableReload\" ></spa-table-internal>\r\n\r\n </mat-tab>\r\n </ng-container>\r\n\r\n\r\n</mat-tab-group>\r\n\r\n\r\n\r\n</div>\r\n\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n\r\n <div>\r\n\r\n <button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='create' && createButton\"\r\n (click)=\"create()\" cdkFocusInitial>{{createButton.display ?? 'Submit'}}\r\n </button>\r\n\r\n <button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='edit' && editButton\"\r\n (click)=\"edit()\" cdkFocusInitial>{{editButton.display ?? 'Submit'}}\r\n </button>\r\n\r\n <ng-container *ngFor=\"let btn of extraButtons\" >\r\n <button *ngIf=\"!smallScreen && testVisible(details,btn.name)\" mat-stroked-button [disabled]=\"isProcessing || testDisabled(details,btn.name)\" [ngStyle]=\"{'color': getButtonColor(btn, details)}\"\r\n (click)=\"custom(btn)\" cdkFocusInitial><mat-icon [ngStyle]=\"{'color': getButtonColor(btn, details)}\">{{btn.icon.name}}</mat-icon>{{btn.display ?? btn.name}}\r\n </button>\r\n </ng-container>\r\n\r\n\r\n <button mat-stroked-button color=\"primary\" mat-dialog-close>Cancel</button>\r\n\r\n </div>\r\n\r\n <div class=\"col d-flex justify-content-end\" *ngIf=\"smallScreen\">\r\n <ng-container *ngFor=\"let btn of extraButtons\">\r\n <button *ngIf=\"testVisible(details,btn.name)\" mat-icon-button [disabled]=\"isProcessing || testDisabled(details,btn.name)\" [ngStyle]=\"{'color': getButtonColor(btn, details)}\"\r\n (click)=\"custom(btn)\" cdkFocusInitial><mat-icon>{{btn.icon.name}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n\r\n <button mat-icon-button [disabled]=\"isProcessing\" style=\"color: red;\" (click)=\"delete()\" *ngIf=\"formConfig.mode!='create' && deleteButton\"><mat-icon>delete</mat-icon></button>\r\n </div>\r\n\r\n\r\n</mat-dialog-actions>\r\n\r\n\r\n\r\n", styles: [".top{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center;margin-bottom:10px;margin-top:10px}.mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.mat-icon-button{width:32px;height:32px}.mat-icon-button mat-icon{font-size:20px;margin-top:-7px}.col-icon{margin-left:10px}.title{margin-top:10px;font-size:larger;font-weight:300}.make-gray{background-color:#e5e5e5}.right-padding{padding-right:10px}.action-buttons-container{display:flex;justify-content:flex-end;align-items:center}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"] }]
|
|
4354
|
+
args: [{ selector: 'app-viewModel', template: "<mat-progress-bar mode=\"indeterminate\" *ngIf=\"isProcessing\"></mat-progress-bar>\r\n<div class=\"row d-flex align-items-center mt-0\">\r\n\r\n <div class=\"col\">\r\n <h2 mat-dialog-title>{{titleAction | titlecase}} {{formConfig?.title}}</h2>\r\n </div>\r\n\r\n <div class=\"col d-flex justify-content-end\">\r\n\r\n <div *ngIf=\"formConfig.mode=='view' && editButton && testVisible(details,editButton.name)\" class=\"col d-flex justify-content-end\">\r\n <button mat-icon-button matTooltipPosition=\"above\" matTooltip=\"Edit\" color=\"primary\" (click)=\"setMode('edit')\" [disabled]=\"testDisabled(details,editButton.name)\"><mat-icon>edit</mat-icon></button>\r\n </div>\r\n\r\n <button [disabled]=\"isProcessing\" *ngIf=\"loadByAction\" mat-icon-button matTooltipPosition=\"above\" matTooltip=\"Refresh\" color=\"primary\" (click)=\"loadData(formConfig.loadAction, true)\"><mat-icon class=\"refreshIcon\">cached</mat-icon></button>\r\n </div>\r\n\r\n</div>\r\n\r\n<mat-dialog-content class=\"mat-typography\">\r\n\r\n<div class=\"tin-input\" style=\"font-size:14px\">\r\n\r\n<p *ngIf=\"formConfig && !details\"><em>Loading...</em></p>\r\n\r\n<spa-form *ngIf=\"formConfig && details\" [files]=\"files\" [data]=\"details\" [config]=\"formConfig\" (inputChange)=\"inputChanged($event)\"></spa-form>\r\n\r\n<div *ngIf=\"tableConfig\" class=\"mt-3\" style=\" font-size: 14px;\">\r\n <spa-table-internal [config]=\"tableConfig\" [reload]=\"tableReload\" ></spa-table-internal>\r\n</div>\r\n\r\n<mat-tab-group *ngIf=\"tableConfigs\">\r\n\r\n <ng-container *ngFor=\"let tbl of tableConfigs\">\r\n\r\n <mat-tab *ngIf=\"testVisibleTab(tbl)\">\r\n <ng-template matTabLabel>\r\n <span>{{tbl.title}}</span>\r\n </ng-template>\r\n\r\n <spa-table-internal [config]=\"tbl\" [hideTitle]=\"true\" [reload]=\"tableReload\" ></spa-table-internal>\r\n\r\n </mat-tab>\r\n </ng-container>\r\n\r\n\r\n</mat-tab-group>\r\n\r\n\r\n\r\n</div>\r\n\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n\r\n <div>\r\n\r\n <button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='create' && createButton\"\r\n (click)=\"create()\" cdkFocusInitial>{{createButton.display ?? 'Submit'}}\r\n </button>\r\n\r\n <button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='edit' && editButton\"\r\n (click)=\"edit()\" cdkFocusInitial>{{editButton.display ?? 'Submit'}}\r\n </button>\r\n\r\n <ng-container *ngFor=\"let btn of extraButtons\" >\r\n <button *ngIf=\"!smallScreen && testVisible(details,btn.name)\" mat-stroked-button [disabled]=\"isProcessing || testDisabled(details,btn.name)\" [ngStyle]=\"{'color': getButtonColor(btn, details)}\"\r\n (click)=\"custom(btn)\" cdkFocusInitial><mat-icon [ngStyle]=\"{'color': getButtonColor(btn, details)}\">{{btn.icon.name}}</mat-icon>{{btn.display ?? btn.name}}\r\n </button>\r\n </ng-container>\r\n\r\n\r\n <button mat-stroked-button color=\"primary\" mat-dialog-close>Cancel</button>\r\n\r\n </div>\r\n\r\n <div class=\"col d-flex justify-content-end\" *ngIf=\"smallScreen\">\r\n <ng-container *ngFor=\"let btn of extraButtons\">\r\n <button *ngIf=\"testVisible(details,btn.name)\" mat-icon-button [disabled]=\"isProcessing || testDisabled(details,btn.name)\" [ngStyle]=\"{'color': getButtonColor(btn, details)}\"\r\n (click)=\"custom(btn)\" cdkFocusInitial><mat-icon>{{btn.icon.name}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n\r\n <button mat-icon-button [disabled]=\"isProcessing\" style=\"color: red;\" (click)=\"delete()\" *ngIf=\"formConfig.mode!='create' && deleteButton\"><mat-icon>delete</mat-icon></button>\r\n </div>\r\n\r\n\r\n</mat-dialog-actions>\r\n\r\n\r\n\r\n", styles: [".top{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center;margin-bottom:10px;margin-top:10px}.mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.mat-icon-button{width:32px;height:32px}.mat-icon-button mat-icon{font-size:20px;margin-top:-7px}.col-icon{margin-left:10px}.title{margin-top:10px;font-size:larger;font-weight:300}.make-gray{background-color:#e5e5e5}.right-padding{padding-right:10px}.action-buttons-container{display:flex;justify-content:flex-end;align-items:center}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"] }]
|
|
4345
4355
|
}], ctorParameters: function () {
|
|
4346
4356
|
return [{ type: i3$3.BreakpointObserver }, { type: LoaderService }, { type: DataServiceLib }, { type: MessageService }, { type: i4.MatDialogRef }, { type: DetailsDialogConfig, decorators: [{
|
|
4347
4357
|
type: Inject,
|
|
@@ -4730,14 +4740,14 @@ class TableComponent {
|
|
|
4730
4740
|
return;
|
|
4731
4741
|
}
|
|
4732
4742
|
let conf = {
|
|
4733
|
-
|
|
4743
|
+
formConfig: this.config.formConfig,
|
|
4734
4744
|
buttons: this.config.buttons,
|
|
4735
4745
|
details: row,
|
|
4736
4746
|
};
|
|
4737
4747
|
if (button.detailsConfig) {
|
|
4738
4748
|
conf = DetailsDialogProcessor.processDetailsConfig(button.detailsConfig, row);
|
|
4739
4749
|
}
|
|
4740
|
-
conf.
|
|
4750
|
+
conf.formConfig.mode = "view";
|
|
4741
4751
|
const dialogRef = this.dialog.open(DetailsDialog, {
|
|
4742
4752
|
width: "900px",
|
|
4743
4753
|
data: conf
|
|
@@ -4763,13 +4773,13 @@ class TableComponent {
|
|
|
4763
4773
|
}
|
|
4764
4774
|
this.config.formConfig.mode = "create";
|
|
4765
4775
|
let conf = {
|
|
4766
|
-
|
|
4776
|
+
formConfig: this.config.formConfig,
|
|
4767
4777
|
buttons: this.config.buttons,
|
|
4768
4778
|
};
|
|
4769
4779
|
if (button.detailsConfig) {
|
|
4770
4780
|
conf = button.detailsConfig;
|
|
4771
4781
|
}
|
|
4772
|
-
conf.
|
|
4782
|
+
conf.formConfig.mode = "create";
|
|
4773
4783
|
conf.heroField = (_a = this.config) === null || _a === void 0 ? void 0 : _a.heroField;
|
|
4774
4784
|
conf.heroValue = (_b = this.config) === null || _b === void 0 ? void 0 : _b.heroValue;
|
|
4775
4785
|
const dialogRef = this.dialog.open(DetailsDialog, {
|
|
@@ -4799,14 +4809,14 @@ class TableComponent {
|
|
|
4799
4809
|
return;
|
|
4800
4810
|
}
|
|
4801
4811
|
let conf = {
|
|
4802
|
-
|
|
4812
|
+
formConfig: this.config.formConfig,
|
|
4803
4813
|
buttons: this.config.buttons,
|
|
4804
4814
|
details: row,
|
|
4805
4815
|
};
|
|
4806
4816
|
if (button.detailsConfig) {
|
|
4807
4817
|
conf = DetailsDialogProcessor.processDetailsConfig(button.detailsConfig, row);
|
|
4808
4818
|
}
|
|
4809
|
-
conf.
|
|
4819
|
+
conf.formConfig.mode = "edit";
|
|
4810
4820
|
const dialogRef = this.dialog.open(DetailsDialog, {
|
|
4811
4821
|
width: "900px",
|
|
4812
4822
|
data: conf
|