@lenne.tech/ng-base 13.29.0 → 13.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base-cms/pages/base-cms/base-cms.component.d.ts +11 -4
- package/base-components/components/model-form/model-form.component.d.ts +11 -3
- package/base-components/components/model-table/model-table.component.d.ts +2 -3
- package/esm2020/base-cms/pages/base-cms/base-cms.component.mjs +22 -11
- package/esm2020/base-components/components/model-form/model-form.component.mjs +95 -56
- package/esm2020/base-components/components/model-table/model-table.component.mjs +9 -6
- package/esm2020/base-prototype/pages/profile/profile.component.mjs +1 -1
- package/esm2020/shared/classes/graphql-meta.class.mjs +8 -1
- package/esm2020/shared/interfaces/graphql-crud-type.interface.mjs +1 -1
- package/fesm2015/lenne.tech-ng-base-base-cms.mjs +22 -11
- package/fesm2015/lenne.tech-ng-base-base-cms.mjs.map +1 -1
- package/fesm2015/lenne.tech-ng-base-base-components.mjs +106 -59
- package/fesm2015/lenne.tech-ng-base-base-components.mjs.map +1 -1
- package/fesm2015/lenne.tech-ng-base-base-prototype.mjs +1 -1
- package/fesm2015/lenne.tech-ng-base-base-prototype.mjs.map +1 -1
- package/fesm2015/lenne.tech-ng-base-shared.mjs +7 -0
- package/fesm2015/lenne.tech-ng-base-shared.mjs.map +1 -1
- package/fesm2020/lenne.tech-ng-base-base-cms.mjs +21 -10
- package/fesm2020/lenne.tech-ng-base-base-cms.mjs.map +1 -1
- package/fesm2020/lenne.tech-ng-base-base-components.mjs +99 -57
- package/fesm2020/lenne.tech-ng-base-base-components.mjs.map +1 -1
- package/fesm2020/lenne.tech-ng-base-base-prototype.mjs +1 -1
- package/fesm2020/lenne.tech-ng-base-base-prototype.mjs.map +1 -1
- package/fesm2020/lenne.tech-ng-base-shared.mjs +7 -0
- package/fesm2020/lenne.tech-ng-base-shared.mjs.map +1 -1
- package/package.json +1 -1
- package/shared/interfaces/graphql-crud-type.interface.d.ts +1 -0
|
@@ -8,8 +8,9 @@ import { trigger, transition, query, style, animate } from '@angular/animations'
|
|
|
8
8
|
import { Subscription } from 'rxjs';
|
|
9
9
|
import * as i1$1 from '@lenne.tech/ng-base/shared';
|
|
10
10
|
import { ToastType, GraphQLRequestType, BasicUser } from '@lenne.tech/ng-base/shared';
|
|
11
|
-
import * as i1$2 from '@angular/common/http';
|
|
12
11
|
import { __awaiter } from 'tslib';
|
|
12
|
+
import * as i2$1 from '@angular/router';
|
|
13
|
+
import * as i1$2 from '@angular/common/http';
|
|
13
14
|
|
|
14
15
|
class InputComponent {
|
|
15
16
|
constructor() {
|
|
@@ -802,12 +803,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
802
803
|
}] } });
|
|
803
804
|
|
|
804
805
|
class ModelFormComponent {
|
|
805
|
-
constructor(graphQLMetaService, graphQLService, formsService, authService) {
|
|
806
|
+
constructor(graphQLMetaService, graphQLService, formsService, authService, router, route) {
|
|
806
807
|
this.graphQLMetaService = graphQLMetaService;
|
|
807
808
|
this.graphQLService = graphQLService;
|
|
808
809
|
this.formsService = formsService;
|
|
809
810
|
this.authService = authService;
|
|
811
|
+
this.router = router;
|
|
812
|
+
this.route = route;
|
|
810
813
|
this.delete = true;
|
|
814
|
+
this.duplicate = false;
|
|
811
815
|
this.logging = false;
|
|
812
816
|
this.config = {};
|
|
813
817
|
this.finished = new EventEmitter();
|
|
@@ -894,7 +898,7 @@ class ModelFormComponent {
|
|
|
894
898
|
},
|
|
895
899
|
error: (err) => {
|
|
896
900
|
console.error('Error on load object', err);
|
|
897
|
-
this.finished.emit(
|
|
901
|
+
this.finished.emit(null);
|
|
898
902
|
},
|
|
899
903
|
});
|
|
900
904
|
}
|
|
@@ -965,7 +969,7 @@ class ModelFormComponent {
|
|
|
965
969
|
})
|
|
966
970
|
.subscribe({
|
|
967
971
|
next: (value) => {
|
|
968
|
-
this.finished.emit(
|
|
972
|
+
this.finished.emit(null);
|
|
969
973
|
},
|
|
970
974
|
error: (err) => {
|
|
971
975
|
console.error('Error on delete object', err);
|
|
@@ -973,6 +977,35 @@ class ModelFormComponent {
|
|
|
973
977
|
});
|
|
974
978
|
}
|
|
975
979
|
}
|
|
980
|
+
/**
|
|
981
|
+
* It sends a GraphQL mutation to the server to duplicate the object
|
|
982
|
+
*/
|
|
983
|
+
duplicateObject() {
|
|
984
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
985
|
+
if (confirm('Möchtest du das Objekt wirklich duplizieren?')) {
|
|
986
|
+
yield this.submit(true);
|
|
987
|
+
this.graphQLService
|
|
988
|
+
.graphQl('duplicate' + this.capitalizeFirstLetter(this.modelName), {
|
|
989
|
+
arguments: { id: this.id },
|
|
990
|
+
fields: ['id'],
|
|
991
|
+
type: GraphQLRequestType.MUTATION,
|
|
992
|
+
})
|
|
993
|
+
.subscribe({
|
|
994
|
+
next: (value) => {
|
|
995
|
+
if (value === null || value === void 0 ? void 0 : value.id) {
|
|
996
|
+
this.router.navigate(['../' + value.id], { relativeTo: this.route });
|
|
997
|
+
}
|
|
998
|
+
else {
|
|
999
|
+
this.finished.emit(null);
|
|
1000
|
+
}
|
|
1001
|
+
},
|
|
1002
|
+
error: (err) => {
|
|
1003
|
+
console.error('Error on duplicate object', err);
|
|
1004
|
+
},
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
976
1009
|
/**
|
|
977
1010
|
* It takes a string, capitalizes the first letter, and returns the modified string
|
|
978
1011
|
*
|
|
@@ -997,65 +1030,71 @@ class ModelFormComponent {
|
|
|
997
1030
|
* @returns The id of the newly created or updated object.
|
|
998
1031
|
*/
|
|
999
1032
|
submit(secret = false) {
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
if (this.form.invalid && !secret) {
|
|
1005
|
-
this.formsService.validateAllFormFields(this.form);
|
|
1006
|
-
this.loading = false;
|
|
1007
|
-
return;
|
|
1008
|
-
}
|
|
1009
|
-
if (this.operation === 'update' && !this.id) {
|
|
1010
|
-
console.error('ID is missing for update!');
|
|
1011
|
-
this.loading = false;
|
|
1012
|
-
return;
|
|
1013
|
-
}
|
|
1014
|
-
if (this.logging) {
|
|
1015
|
-
console.log('ModelFormComponent::submit->formValue', this.form.value);
|
|
1016
|
-
}
|
|
1017
|
-
const data = Object.assign({}, this.form.value);
|
|
1018
|
-
for (const [key, value] of Object.entries(data)) {
|
|
1019
|
-
if ((((_a = this.config[key]) === null || _a === void 0 ? void 0 : _a.roles) ? !this.user.hasAllRoles((_b = this.config[key]) === null || _b === void 0 ? void 0 : _b.roles) : false) ||
|
|
1020
|
-
((_c = this.config[key]) === null || _c === void 0 ? void 0 : _c.exclude)) {
|
|
1021
|
-
delete data[key];
|
|
1033
|
+
return new Promise((resolve, reject) => {
|
|
1034
|
+
var _a, _b, _c, _d;
|
|
1035
|
+
if (!secret) {
|
|
1036
|
+
this.loading = true;
|
|
1022
1037
|
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1038
|
+
if (this.form.invalid && !secret) {
|
|
1039
|
+
this.formsService.validateAllFormFields(this.form);
|
|
1040
|
+
this.loading = false;
|
|
1041
|
+
reject();
|
|
1042
|
+
return;
|
|
1026
1043
|
}
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
.
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
this.finished.emit(true);
|
|
1044
|
+
if (this.operation === 'update' && !this.id) {
|
|
1045
|
+
console.error('ID is missing for update!');
|
|
1046
|
+
this.loading = false;
|
|
1047
|
+
reject();
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
if (this.logging) {
|
|
1051
|
+
console.log('ModelFormComponent::submit->formValue', this.form.value);
|
|
1052
|
+
}
|
|
1053
|
+
const data = Object.assign({}, this.form.value);
|
|
1054
|
+
for (const [key, value] of Object.entries(data)) {
|
|
1055
|
+
if ((((_a = this.config[key]) === null || _a === void 0 ? void 0 : _a.roles) ? !this.user.hasAllRoles((_b = this.config[key]) === null || _b === void 0 ? void 0 : _b.roles) : false) ||
|
|
1056
|
+
((_c = this.config[key]) === null || _c === void 0 ? void 0 : _c.exclude)) {
|
|
1057
|
+
delete data[key];
|
|
1042
1058
|
}
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
console.error('Failed on ' + this.operation, err);
|
|
1047
|
-
this.loading = false;
|
|
1059
|
+
// Set type for graphql method
|
|
1060
|
+
if (((_d = this.fields[key]) === null || _d === void 0 ? void 0 : _d.type) === 'Float') {
|
|
1061
|
+
data[key] = Number(value);
|
|
1048
1062
|
}
|
|
1049
|
-
}
|
|
1063
|
+
}
|
|
1064
|
+
if (this.logging) {
|
|
1065
|
+
console.log('ModelFormComponent::submit->valueToGraphql', data);
|
|
1066
|
+
}
|
|
1067
|
+
this.graphQLService
|
|
1068
|
+
.graphQl(this.operation + this.capitalizeFirstLetter(this.modelName), {
|
|
1069
|
+
arguments: this.operation === 'update' ? { id: this.id, input: data } : { input: data },
|
|
1070
|
+
fields: ['id'],
|
|
1071
|
+
type: GraphQLRequestType.MUTATION,
|
|
1072
|
+
})
|
|
1073
|
+
.subscribe({
|
|
1074
|
+
next: (value) => {
|
|
1075
|
+
if (!secret) {
|
|
1076
|
+
this.loading = false;
|
|
1077
|
+
this.finished.emit(null);
|
|
1078
|
+
}
|
|
1079
|
+
resolve(value);
|
|
1080
|
+
},
|
|
1081
|
+
error: (err) => {
|
|
1082
|
+
if (!secret) {
|
|
1083
|
+
console.error('Failed on ' + this.operation, err);
|
|
1084
|
+
this.loading = false;
|
|
1085
|
+
}
|
|
1086
|
+
reject();
|
|
1087
|
+
},
|
|
1088
|
+
});
|
|
1050
1089
|
});
|
|
1051
1090
|
}
|
|
1052
1091
|
}
|
|
1053
|
-
ModelFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: ModelFormComponent, deps: [{ token: i1$1.GraphQLMetaService }, { token: i1$1.GraphQLService }, { token: i1$1.FormsService }, { token: i1$1.AuthService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1054
|
-
ModelFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: ModelFormComponent, selector: "base-model-form", inputs: { modelName: "modelName", label: "label", id: "id", delete: "delete", logging: "logging", config: "config" }, outputs: { finished: "finished" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"w-100\" *ngIf=\"form\">\n <h2>\n
|
|
1092
|
+
ModelFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: ModelFormComponent, deps: [{ token: i1$1.GraphQLMetaService }, { token: i1$1.GraphQLService }, { token: i1$1.FormsService }, { token: i1$1.AuthService }, { token: i2$1.Router }, { token: i2$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
1093
|
+
ModelFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: ModelFormComponent, selector: "base-model-form", inputs: { modelName: "modelName", label: "label", id: "id", delete: "delete", duplicate: "duplicate", logging: "logging", config: "config" }, outputs: { finished: "finished" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"w-100\" *ngIf=\"form\">\n <div class=\"d-flex flex-row justify-content-between mt-3\">\n <h2>\n {{ label ? label : capitalizeFirstLetter(modelName) }} {{ operation === 'update' ? 'bearbeiten' : 'erstellen' }}\n </h2>\n\n <div>\n <button class=\"btn btn-outline-primary me-2\" *ngIf=\"id && duplicate && !loading\" (click)=\"duplicateObject()\">\n Duplizieren\n </button>\n <button class=\"btn btn-primary\" type=\"button\" (click)=\"submit(false)\" *ngIf=\"!loading\">\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}\n </button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}...\n </button>\n </div>\n </div>\n\n <form [formGroup]=\"form\">\n <base-model-form-sub\n [fields]=\"fields\"\n [config]=\"config\"\n [form]=\"form\"\n (imageChanged)=\"id ? submit(true) : null\"\n ></base-model-form-sub>\n\n <div class=\"d-flex mt-4\" [ngClass]=\"id && delete ? 'justify-content-between' : 'justify-content-end'\">\n <div *ngIf=\"id && delete\">\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteObject()\">L\u00F6schen</button>\n </div>\n <div>\n <button class=\"btn btn-primary\" type=\"button\" (click)=\"submit(false)\" *ngIf=\"!loading\">\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}\n </button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}...\n </button>\n </div>\n </div>\n </form>\n</div>\n", styles: [""], components: [{ type: ModelFormSubComponent, selector: "base-model-form-sub", inputs: ["fields", "form", "config"], outputs: ["imageChanged"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1055
1094
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: ModelFormComponent, decorators: [{
|
|
1056
1095
|
type: Component,
|
|
1057
|
-
args: [{ selector: 'base-model-form', template: "<div class=\"w-100\" *ngIf=\"form\">\n <h2>\n
|
|
1058
|
-
}], ctorParameters: function () { return [{ type: i1$1.GraphQLMetaService }, { type: i1$1.GraphQLService }, { type: i1$1.FormsService }, { type: i1$1.AuthService }]; }, propDecorators: { modelName: [{
|
|
1096
|
+
args: [{ selector: 'base-model-form', template: "<div class=\"w-100\" *ngIf=\"form\">\n <div class=\"d-flex flex-row justify-content-between mt-3\">\n <h2>\n {{ label ? label : capitalizeFirstLetter(modelName) }} {{ operation === 'update' ? 'bearbeiten' : 'erstellen' }}\n </h2>\n\n <div>\n <button class=\"btn btn-outline-primary me-2\" *ngIf=\"id && duplicate && !loading\" (click)=\"duplicateObject()\">\n Duplizieren\n </button>\n <button class=\"btn btn-primary\" type=\"button\" (click)=\"submit(false)\" *ngIf=\"!loading\">\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}\n </button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}...\n </button>\n </div>\n </div>\n\n <form [formGroup]=\"form\">\n <base-model-form-sub\n [fields]=\"fields\"\n [config]=\"config\"\n [form]=\"form\"\n (imageChanged)=\"id ? submit(true) : null\"\n ></base-model-form-sub>\n\n <div class=\"d-flex mt-4\" [ngClass]=\"id && delete ? 'justify-content-between' : 'justify-content-end'\">\n <div *ngIf=\"id && delete\">\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteObject()\">L\u00F6schen</button>\n </div>\n <div>\n <button class=\"btn btn-primary\" type=\"button\" (click)=\"submit(false)\" *ngIf=\"!loading\">\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}\n </button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n {{ operation === 'create' ? 'Erstellen' : 'Speichern' }}...\n </button>\n </div>\n </div>\n </form>\n</div>\n", styles: [""] }]
|
|
1097
|
+
}], ctorParameters: function () { return [{ type: i1$1.GraphQLMetaService }, { type: i1$1.GraphQLService }, { type: i1$1.FormsService }, { type: i1$1.AuthService }, { type: i2$1.Router }, { type: i2$1.ActivatedRoute }]; }, propDecorators: { modelName: [{
|
|
1059
1098
|
type: Input
|
|
1060
1099
|
}], label: [{
|
|
1061
1100
|
type: Input
|
|
@@ -1063,6 +1102,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
1063
1102
|
type: Input
|
|
1064
1103
|
}], delete: [{
|
|
1065
1104
|
type: Input
|
|
1105
|
+
}], duplicate: [{
|
|
1106
|
+
type: Input
|
|
1066
1107
|
}], logging: [{
|
|
1067
1108
|
type: Input
|
|
1068
1109
|
}], config: [{
|
|
@@ -1080,6 +1121,7 @@ class ModelTableComponent {
|
|
|
1080
1121
|
this.create = true;
|
|
1081
1122
|
this.update = true;
|
|
1082
1123
|
this.delete = true;
|
|
1124
|
+
this.duplicate = true;
|
|
1083
1125
|
this.config = {};
|
|
1084
1126
|
this.fieldConfig = {};
|
|
1085
1127
|
this.idSelected = new EventEmitter();
|
|
@@ -1179,7 +1221,12 @@ class ModelTableComponent {
|
|
|
1179
1221
|
if (this.logging) {
|
|
1180
1222
|
console.log('ModelTableComponent::loadObjects->value', value);
|
|
1181
1223
|
}
|
|
1182
|
-
|
|
1224
|
+
const arrayForSort = [...value];
|
|
1225
|
+
this.objects = arrayForSort.sort((a, b) => {
|
|
1226
|
+
var _a, _b;
|
|
1227
|
+
return ((b === null || b === void 0 ? void 0 : b.createdAt) ? (_a = new Date(b === null || b === void 0 ? void 0 : b.createdAt)) === null || _a === void 0 ? void 0 : _a.getTime() : new Date().getTime()) -
|
|
1228
|
+
((a === null || a === void 0 ? void 0 : a.createdAt) ? (_b = new Date(a === null || a === void 0 ? void 0 : a.createdAt)) === null || _b === void 0 ? void 0 : _b.getTime() : new Date().getTime());
|
|
1229
|
+
});
|
|
1183
1230
|
},
|
|
1184
1231
|
error: (err) => {
|
|
1185
1232
|
console.log('Error on loading objects', err);
|
|
@@ -1189,8 +1236,6 @@ class ModelTableComponent {
|
|
|
1189
1236
|
/**
|
|
1190
1237
|
* If the update property is true, then set the selectedId property to the id of the object passed in, and emit the
|
|
1191
1238
|
* selectedId property
|
|
1192
|
-
*
|
|
1193
|
-
* @param object - any - this is the object that is passed in from the child component.
|
|
1194
1239
|
*/
|
|
1195
1240
|
selectId(object) {
|
|
1196
1241
|
if (!object) {
|
|
@@ -1213,10 +1258,10 @@ class ModelTableComponent {
|
|
|
1213
1258
|
}
|
|
1214
1259
|
}
|
|
1215
1260
|
ModelTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: ModelTableComponent, deps: [{ token: i1$1.GraphQLMetaService }, { token: i1$1.GraphQLService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1216
|
-
ModelTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: ModelTableComponent, selector: "base-model-table", inputs: { modelName: "modelName", objectId: "objectId", createMode: "createMode", logging: "logging", create: "create", update: "update", delete: "delete", config: "config", fieldConfig: "fieldConfig" }, outputs: { idSelected: "idSelected", createModeChanged: "createModeChanged" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"!selectedId && !createMode\">\n <div class=\"w-100 d-flex flex-row justify-content-between mb-4\">\n <h2 *ngIf=\"modelName\">\n {{ config?.plural ? config?.plural : config?.label ? config?.label : capitalizeFirstLetter(modelName) + 's' }}\n </h2>\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-primary\" (click)=\"createNewObject()\" *ngIf=\"create\">Erstellen</button>\n </div>\n </div>\n <table class=\"table table-hover table-responsive bg-white\">\n <thead>\n <tr>\n <th scope=\"col\" *ngFor=\"let field of availableFields\">\n {{ tableFields[field]?.label ? tableFields[field]?.label : capitalizeFirstLetter(field) }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let object of objects\">\n <td class=\"cursor-pointer\" *ngFor=\"let field of availableFields\" (click)=\"selectId(object)\">\n <ng-container *ngIf=\"tableFields[field]?.dateFormat\">\n {{ object[field] | date: tableFields[field]?.dateFormat }} Uhr\n </ng-container>\n\n <ng-container *ngIf=\"!tableFields[field]?.dateFormat\">\n {{ object[field] }}\n </ng-container>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"w-100\" *ngIf=\"selectedId || createMode\">\n <button class=\"btn btn-outline-primary mb-3\" (click)=\"selectId('')\">Zur\u00FCck</button>\n <base-model-form\n [modelName]=\"modelName\"\n [label]=\"config?.label\"\n [config]=\"fieldConfig\"\n [logging]=\"logging\"\n [id]=\"selectedId\"\n (finished)=\"selectId('')\"\n [delete]=\"delete\"\n ></base-model-form>\n</div>\n", styles: [".cursor-pointer{cursor:pointer}.table>:not(:first-child){border-top:0}table{border-radius:.25rem;border-color:#e2e8f0!important}table thead{text-transform:uppercase;font-size:12px}table thead th{padding:12px 24px}table tbody tr td{font-weight:400!important;font-size:16px;padding:16px 24px}\n"], components: [{ type: ModelFormComponent, selector: "base-model-form", inputs: ["modelName", "label", "id", "delete", "logging", "config"], outputs: ["finished"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "date": i1.DatePipe } });
|
|
1261
|
+
ModelTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.3", type: ModelTableComponent, selector: "base-model-table", inputs: { modelName: "modelName", objectId: "objectId", createMode: "createMode", logging: "logging", create: "create", update: "update", delete: "delete", duplicate: "duplicate", config: "config", fieldConfig: "fieldConfig" }, outputs: { idSelected: "idSelected", createModeChanged: "createModeChanged" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"!selectedId && !createMode\">\n <div class=\"w-100 d-flex flex-row justify-content-between mb-4\">\n <h2 *ngIf=\"modelName\">\n {{ config?.plural ? config?.plural : config?.label ? config?.label : capitalizeFirstLetter(modelName) + 's' }}\n </h2>\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-primary\" (click)=\"createNewObject()\" *ngIf=\"create\">Erstellen</button>\n </div>\n </div>\n <table class=\"table table-hover table-responsive bg-white\">\n <thead>\n <tr>\n <th scope=\"col\" *ngFor=\"let field of availableFields\">\n {{ tableFields[field]?.label ? tableFields[field]?.label : capitalizeFirstLetter(field) }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let object of objects\">\n <td class=\"cursor-pointer\" *ngFor=\"let field of availableFields\" (click)=\"selectId(object)\">\n <ng-container *ngIf=\"tableFields[field]?.dateFormat\">\n {{ object[field] | date: tableFields[field]?.dateFormat }} Uhr\n </ng-container>\n\n <ng-container *ngIf=\"!tableFields[field]?.dateFormat\">\n {{ object[field] }}\n </ng-container>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"w-100\" *ngIf=\"selectedId || createMode\">\n <button class=\"btn btn-outline-primary mb-3\" (click)=\"selectId('')\">Zur\u00FCck</button>\n <base-model-form\n [modelName]=\"modelName\"\n [label]=\"config?.label\"\n [config]=\"fieldConfig\"\n [logging]=\"logging\"\n [id]=\"selectedId\"\n (finished)=\"selectId('')\"\n [delete]=\"delete\"\n [duplicate]=\"duplicate\"\n ></base-model-form>\n</div>\n", styles: [".cursor-pointer{cursor:pointer}.table>:not(:first-child){border-top:0}table{border-radius:.25rem;border-color:#e2e8f0!important}table thead{text-transform:uppercase;font-size:12px}table thead th{padding:12px 24px}table tbody tr td{font-weight:400!important;font-size:16px;padding:16px 24px}\n"], components: [{ type: ModelFormComponent, selector: "base-model-form", inputs: ["modelName", "label", "id", "delete", "duplicate", "logging", "config"], outputs: ["finished"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "date": i1.DatePipe } });
|
|
1217
1262
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImport: i0, type: ModelTableComponent, decorators: [{
|
|
1218
1263
|
type: Component,
|
|
1219
|
-
args: [{ selector: 'base-model-table', template: "<div *ngIf=\"!selectedId && !createMode\">\n <div class=\"w-100 d-flex flex-row justify-content-between mb-4\">\n <h2 *ngIf=\"modelName\">\n {{ config?.plural ? config?.plural : config?.label ? config?.label : capitalizeFirstLetter(modelName) + 's' }}\n </h2>\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-primary\" (click)=\"createNewObject()\" *ngIf=\"create\">Erstellen</button>\n </div>\n </div>\n <table class=\"table table-hover table-responsive bg-white\">\n <thead>\n <tr>\n <th scope=\"col\" *ngFor=\"let field of availableFields\">\n {{ tableFields[field]?.label ? tableFields[field]?.label : capitalizeFirstLetter(field) }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let object of objects\">\n <td class=\"cursor-pointer\" *ngFor=\"let field of availableFields\" (click)=\"selectId(object)\">\n <ng-container *ngIf=\"tableFields[field]?.dateFormat\">\n {{ object[field] | date: tableFields[field]?.dateFormat }} Uhr\n </ng-container>\n\n <ng-container *ngIf=\"!tableFields[field]?.dateFormat\">\n {{ object[field] }}\n </ng-container>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"w-100\" *ngIf=\"selectedId || createMode\">\n <button class=\"btn btn-outline-primary mb-3\" (click)=\"selectId('')\">Zur\u00FCck</button>\n <base-model-form\n [modelName]=\"modelName\"\n [label]=\"config?.label\"\n [config]=\"fieldConfig\"\n [logging]=\"logging\"\n [id]=\"selectedId\"\n (finished)=\"selectId('')\"\n [delete]=\"delete\"\n ></base-model-form>\n</div>\n", styles: [".cursor-pointer{cursor:pointer}.table>:not(:first-child){border-top:0}table{border-radius:.25rem;border-color:#e2e8f0!important}table thead{text-transform:uppercase;font-size:12px}table thead th{padding:12px 24px}table tbody tr td{font-weight:400!important;font-size:16px;padding:16px 24px}\n"] }]
|
|
1264
|
+
args: [{ selector: 'base-model-table', template: "<div *ngIf=\"!selectedId && !createMode\">\n <div class=\"w-100 d-flex flex-row justify-content-between mb-4\">\n <h2 *ngIf=\"modelName\">\n {{ config?.plural ? config?.plural : config?.label ? config?.label : capitalizeFirstLetter(modelName) + 's' }}\n </h2>\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-primary\" (click)=\"createNewObject()\" *ngIf=\"create\">Erstellen</button>\n </div>\n </div>\n <table class=\"table table-hover table-responsive bg-white\">\n <thead>\n <tr>\n <th scope=\"col\" *ngFor=\"let field of availableFields\">\n {{ tableFields[field]?.label ? tableFields[field]?.label : capitalizeFirstLetter(field) }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let object of objects\">\n <td class=\"cursor-pointer\" *ngFor=\"let field of availableFields\" (click)=\"selectId(object)\">\n <ng-container *ngIf=\"tableFields[field]?.dateFormat\">\n {{ object[field] | date: tableFields[field]?.dateFormat }} Uhr\n </ng-container>\n\n <ng-container *ngIf=\"!tableFields[field]?.dateFormat\">\n {{ object[field] }}\n </ng-container>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"w-100\" *ngIf=\"selectedId || createMode\">\n <button class=\"btn btn-outline-primary mb-3\" (click)=\"selectId('')\">Zur\u00FCck</button>\n <base-model-form\n [modelName]=\"modelName\"\n [label]=\"config?.label\"\n [config]=\"fieldConfig\"\n [logging]=\"logging\"\n [id]=\"selectedId\"\n (finished)=\"selectId('')\"\n [delete]=\"delete\"\n [duplicate]=\"duplicate\"\n ></base-model-form>\n</div>\n", styles: [".cursor-pointer{cursor:pointer}.table>:not(:first-child){border-top:0}table{border-radius:.25rem;border-color:#e2e8f0!important}table thead{text-transform:uppercase;font-size:12px}table thead th{padding:12px 24px}table tbody tr td{font-weight:400!important;font-size:16px;padding:16px 24px}\n"] }]
|
|
1220
1265
|
}], ctorParameters: function () { return [{ type: i1$1.GraphQLMetaService }, { type: i1$1.GraphQLService }]; }, propDecorators: { modelName: [{
|
|
1221
1266
|
type: Input
|
|
1222
1267
|
}], objectId: [{
|
|
@@ -1231,6 +1276,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
1231
1276
|
type: Input
|
|
1232
1277
|
}], delete: [{
|
|
1233
1278
|
type: Input
|
|
1279
|
+
}], duplicate: [{
|
|
1280
|
+
type: Input
|
|
1234
1281
|
}], config: [{
|
|
1235
1282
|
type: Input
|
|
1236
1283
|
}], fieldConfig: [{
|