@lenne.tech/ng-base 14.0.3 → 14.1.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-components/base-components.module.d.ts +20 -17
- package/base-components/components/model-form/model-form.component.d.ts +9 -4
- package/base-components/components/model-form-sub/model-form-sub.component.d.ts +7 -3
- package/base-components/components/model-table/model-table.component.d.ts +14 -5
- package/base-components/components/refence-input/refence-input.component.d.ts +10 -4
- package/{shared → base-components}/directives/back-button.directive.d.ts +1 -1
- package/{src → base-components}/directives/context-menu.directive.d.ts +0 -0
- package/{shared → base-components}/directives/sort.directive.d.ts +2 -2
- package/base-components/public-api.d.ts +3 -0
- package/esm2020/base-components/base-components.module.mjs +16 -1
- package/esm2020/base-components/components/model-form/model-form.component.mjs +87 -58
- package/esm2020/base-components/components/model-form-sub/model-form-sub.component.mjs +9 -3
- package/esm2020/base-components/components/model-table/model-table.component.mjs +30 -13
- package/esm2020/base-components/components/refence-input/refence-input.component.mjs +28 -22
- package/esm2020/base-components/components/tags/tags.component.mjs +2 -2
- package/esm2020/base-components/components/upload-image/upload-image.component.mjs +3 -5
- package/esm2020/{shared → base-components}/directives/back-button.directive.mjs +2 -2
- package/esm2020/base-components/directives/context-menu.directive.mjs +108 -0
- package/esm2020/base-components/directives/sort.directive.mjs +54 -0
- package/esm2020/base-components/public-api.mjs +5 -1
- package/esm2020/public-api.mjs +1 -2
- package/esm2020/shared/classes/graphql-meta.class.mjs +52 -28
- package/esm2020/shared/classes/graphql-type.class.mjs +2 -1
- package/esm2020/shared/classes/sort.class.mjs +1 -8
- package/esm2020/shared/public-api.mjs +2 -4
- package/esm2020/shared/services/cms.service.mjs +75 -0
- package/esm2020/shared/services/graphql.service.mjs +30 -36
- package/esm2020/src/base.module.mjs +1 -5
- package/fesm2015/lenne.tech-ng-base-base-components.mjs +361 -114
- package/fesm2015/lenne.tech-ng-base-base-components.mjs.map +1 -1
- package/fesm2015/lenne.tech-ng-base-shared.mjs +203 -190
- package/fesm2015/lenne.tech-ng-base-shared.mjs.map +1 -1
- package/fesm2015/lenne.tech-ng-base.mjs +2 -113
- package/fesm2015/lenne.tech-ng-base.mjs.map +1 -1
- package/fesm2020/lenne.tech-ng-base-base-components.mjs +340 -99
- package/fesm2020/lenne.tech-ng-base-base-components.mjs.map +1 -1
- package/fesm2020/lenne.tech-ng-base-shared.mjs +201 -188
- package/fesm2020/lenne.tech-ng-base-shared.mjs.map +1 -1
- package/fesm2020/lenne.tech-ng-base.mjs +2 -112
- package/fesm2020/lenne.tech-ng-base.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +0 -1
- package/shared/classes/graphql-meta.class.d.ts +7 -4
- package/shared/classes/graphql-type.class.d.ts +1 -0
- package/shared/classes/sort.class.d.ts +0 -7
- package/shared/public-api.d.ts +1 -2
- package/shared/services/cms.service.d.ts +23 -0
- package/shared/services/graphql.service.d.ts +4 -4
- package/src/base.module.d.ts +9 -10
- package/esm2020/shared/directives/sort.directive.mjs +0 -54
- package/esm2020/src/directives/context-menu.directive.mjs +0 -109
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Component, Input, Output, ViewChild, NgModule } from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, Input, Output, ViewChild, Directive, Inject, HostListener, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { UntypedFormControl, Validators, UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import * as i2 from '@angular/common';
|
|
6
|
-
import { CommonModule } from '@angular/common';
|
|
6
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
7
7
|
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
|
-
import { ToastType, GraphQLRequestType, BasicUser } from '@lenne.tech/ng-base/shared';
|
|
10
|
+
import { ToastType, Sort, GraphQLRequestType, BasicUser } from '@lenne.tech/ng-base/shared';
|
|
11
11
|
import { __awaiter } from 'tslib';
|
|
12
12
|
import * as i2$1 from '@angular/router';
|
|
13
13
|
import * as i1$2 from '@angular/common/http';
|
|
@@ -327,7 +327,7 @@ class TagsComponent {
|
|
|
327
327
|
*/
|
|
328
328
|
filterOptions() {
|
|
329
329
|
return this.options
|
|
330
|
-
? this.options.filter((e) => { var _a; return (!this.inputValue || ((_a = e === null || e === void 0 ? void 0 : e.text) === null || _a === void 0 ? void 0 : _a.includes(this.inputValue))) && !this.control.value.includes(e.value); })
|
|
330
|
+
? this.options.filter((e) => { var _a, _b; return (!this.inputValue || ((_a = e === null || e === void 0 ? void 0 : e.text) === null || _a === void 0 ? void 0 : _a.includes(this.inputValue))) && !((_b = this.control.value) === null || _b === void 0 ? void 0 : _b.includes(e.value)); })
|
|
331
331
|
: [];
|
|
332
332
|
}
|
|
333
333
|
/**
|
|
@@ -447,6 +447,165 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
447
447
|
args: [{ selector: 'base-breadcrumb', template: "<ul class=\"pt-3\">\n <li *ngFor=\"let breadcrumb of breadcrumbs$ | async\">\n <a [routerLink]=\"breadcrumb.url\">{{ breadcrumb.label }}</a>\n </li>\n</ul>\n", styles: ["ul{list-style:none;margin:0;padding:0}ul li{display:inline}ul li:before{content:\">\";margin:0 6px}ul li:first-child:before{content:\"\";margin:0}\n"] }]
|
|
448
448
|
}], ctorParameters: function () { return [{ type: i1$1.BreadcrumbService }]; } });
|
|
449
449
|
|
|
450
|
+
class SortDirective {
|
|
451
|
+
constructor(renderer, targetElem, document) {
|
|
452
|
+
this.renderer = renderer;
|
|
453
|
+
this.targetElem = targetElem;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Sorts columns on click
|
|
457
|
+
*/
|
|
458
|
+
sortColumn() {
|
|
459
|
+
const items = document.getElementsByTagName('th');
|
|
460
|
+
for (let i = 0; i < items.length; i++) {
|
|
461
|
+
items[i].classList.remove('asc');
|
|
462
|
+
items[i].classList.remove('desc');
|
|
463
|
+
}
|
|
464
|
+
const sort = new Sort();
|
|
465
|
+
const elem = this.targetElem.nativeElement;
|
|
466
|
+
const order = elem.getAttribute('data-order');
|
|
467
|
+
const type = elem.getAttribute('data-type');
|
|
468
|
+
const property = elem.getAttribute('data-name');
|
|
469
|
+
if (order === 'desc') {
|
|
470
|
+
this.baseSort.sort(sort.startSort(property, order, type));
|
|
471
|
+
elem.setAttribute('data-order', 'asc');
|
|
472
|
+
elem.classList.remove('desc');
|
|
473
|
+
elem.classList.add('asc');
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
this.baseSort.sort(sort.startSort(property, order, type));
|
|
477
|
+
elem.setAttribute('data-order', 'desc');
|
|
478
|
+
elem.classList.remove('asc');
|
|
479
|
+
elem.classList.add('desc');
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
SortDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: SortDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive });
|
|
484
|
+
SortDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0", type: SortDirective, selector: "[baseSort]", inputs: { baseSort: "baseSort" }, host: { listeners: { "click": "sortColumn()" } }, ngImport: i0 });
|
|
485
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: SortDirective, decorators: [{
|
|
486
|
+
type: Directive,
|
|
487
|
+
args: [{
|
|
488
|
+
selector: '[baseSort]',
|
|
489
|
+
}]
|
|
490
|
+
}], ctorParameters: function () {
|
|
491
|
+
return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: Document, decorators: [{
|
|
492
|
+
type: Inject,
|
|
493
|
+
args: [DOCUMENT]
|
|
494
|
+
}] }];
|
|
495
|
+
}, propDecorators: { baseSort: [{
|
|
496
|
+
type: Input
|
|
497
|
+
}], sortColumn: [{
|
|
498
|
+
type: HostListener,
|
|
499
|
+
args: ['click']
|
|
500
|
+
}] } });
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Directive vor context menu
|
|
504
|
+
* See https://stackblitz.com/edit/angular-custom-context-menu
|
|
505
|
+
*/
|
|
506
|
+
class ContextMenuDirective {
|
|
507
|
+
constructor(el) {
|
|
508
|
+
this.el = el;
|
|
509
|
+
this.xGap = 0;
|
|
510
|
+
this.yGap = 0;
|
|
511
|
+
this.overflowSpace = 10;
|
|
512
|
+
this.selectors = '*';
|
|
513
|
+
this.clickedElement = null;
|
|
514
|
+
this.previousDisplayStatus = null;
|
|
515
|
+
}
|
|
516
|
+
ngOnInit() {
|
|
517
|
+
if (this.ltContextMenu) {
|
|
518
|
+
this.previousDisplayStatus = this.ltContextMenu.style.display;
|
|
519
|
+
}
|
|
520
|
+
// Add a click listener to the window,
|
|
521
|
+
// so that we can close the context menu on left click
|
|
522
|
+
window.addEventListener('click', () => {
|
|
523
|
+
this.showContextMenu(null, false);
|
|
524
|
+
});
|
|
525
|
+
// Close context menu when escape is pressed
|
|
526
|
+
window.addEventListener('keydown', (e) => {
|
|
527
|
+
if (e.code === 'Escape') {
|
|
528
|
+
this.showContextMenu(null, false);
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
// Add an event listener to listen to the 'contextmenu' event
|
|
532
|
+
this.el.nativeElement.addEventListener('contextmenu', (e) => {
|
|
533
|
+
// Prevent the default context menu to popup
|
|
534
|
+
if (e.preventDefault) {
|
|
535
|
+
e.preventDefault();
|
|
536
|
+
}
|
|
537
|
+
// Shows our own context menu
|
|
538
|
+
this.showContextMenu(e, true);
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
// Shows or hides our custom context menu, which is specified as a input
|
|
542
|
+
showContextMenu(event, show) {
|
|
543
|
+
var _a;
|
|
544
|
+
const cm = this.ltContextMenu;
|
|
545
|
+
if (cm) {
|
|
546
|
+
// Try to open context menu
|
|
547
|
+
if (show && event && event instanceof MouseEvent) {
|
|
548
|
+
// Get valid clicked structureElement
|
|
549
|
+
const clickedElement = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.closest(this.selectors);
|
|
550
|
+
if (clickedElement) {
|
|
551
|
+
this.clickedElement = clickedElement;
|
|
552
|
+
setTimeout(() => {
|
|
553
|
+
// Set display status
|
|
554
|
+
cm.style.display = 'block';
|
|
555
|
+
// Calculate top position
|
|
556
|
+
let top = event.y + this.yGap;
|
|
557
|
+
if (top + cm.offsetHeight + 10 > document.documentElement.clientHeight) {
|
|
558
|
+
top = document.documentElement.clientHeight - cm.offsetHeight - this.overflowSpace;
|
|
559
|
+
}
|
|
560
|
+
// Calculate left position
|
|
561
|
+
let left = event.x + this.xGap;
|
|
562
|
+
if (left + cm.offsetWidth + 10 > document.documentElement.clientWidth) {
|
|
563
|
+
left = document.documentElement.clientWidth - cm.offsetWidth - this.overflowSpace;
|
|
564
|
+
}
|
|
565
|
+
// Set position
|
|
566
|
+
cm.style.top = top + 'px';
|
|
567
|
+
cm.style.left = left + 'px';
|
|
568
|
+
// Show
|
|
569
|
+
cm.style.opacity = '1.0';
|
|
570
|
+
cm.style['pointer-events'] = 'auto';
|
|
571
|
+
}, 1);
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
// Close context menu
|
|
576
|
+
this.clickedElement = null;
|
|
577
|
+
if (this.previousDisplayStatus) {
|
|
578
|
+
cm.style.display = this.previousDisplayStatus;
|
|
579
|
+
}
|
|
580
|
+
cm.style.opacity = '0.01';
|
|
581
|
+
cm.style['pointer-events'] = 'none';
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
ContextMenuDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ContextMenuDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
586
|
+
ContextMenuDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0", type: ContextMenuDirective, selector: "[ltContextMenu]", inputs: { contextMenuData: "contextMenuData", ltContextMenu: "ltContextMenu", xGap: "xGap", yGap: "yGap", overflowSpace: "overflowSpace", selectors: "selectors" }, outputs: { clickedElement: "clickedElement" }, exportAs: ["contextMenuData"], ngImport: i0 });
|
|
587
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ContextMenuDirective, decorators: [{
|
|
588
|
+
type: Directive,
|
|
589
|
+
args: [{
|
|
590
|
+
selector: '[ltContextMenu]',
|
|
591
|
+
exportAs: 'contextMenuData',
|
|
592
|
+
}]
|
|
593
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { contextMenuData: [{
|
|
594
|
+
type: Input
|
|
595
|
+
}], ltContextMenu: [{
|
|
596
|
+
type: Input
|
|
597
|
+
}], xGap: [{
|
|
598
|
+
type: Input
|
|
599
|
+
}], yGap: [{
|
|
600
|
+
type: Input
|
|
601
|
+
}], overflowSpace: [{
|
|
602
|
+
type: Input
|
|
603
|
+
}], selectors: [{
|
|
604
|
+
type: Input
|
|
605
|
+
}], clickedElement: [{
|
|
606
|
+
type: Output
|
|
607
|
+
}] } });
|
|
608
|
+
|
|
450
609
|
class UploadImageComponent {
|
|
451
610
|
constructor(httpClient, authService) {
|
|
452
611
|
this.httpClient = httpClient;
|
|
@@ -534,7 +693,6 @@ class UploadImageComponent {
|
|
|
534
693
|
data.append('file', this.selectedFile);
|
|
535
694
|
const httpOptions = {
|
|
536
695
|
headers: new HttpHeaders({
|
|
537
|
-
'Content-Type': 'application/json',
|
|
538
696
|
Authorization: 'Bearer ' + this.authService.token,
|
|
539
697
|
}),
|
|
540
698
|
};
|
|
@@ -558,7 +716,6 @@ class UploadImageComponent {
|
|
|
558
716
|
if (id) {
|
|
559
717
|
const httpOptions = {
|
|
560
718
|
headers: new HttpHeaders({
|
|
561
|
-
'Content-Type': 'application/json',
|
|
562
719
|
Authorization: 'Bearer ' + this.authService.token,
|
|
563
720
|
}),
|
|
564
721
|
};
|
|
@@ -573,10 +730,10 @@ class UploadImageComponent {
|
|
|
573
730
|
}
|
|
574
731
|
}
|
|
575
732
|
UploadImageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: UploadImageComponent, deps: [{ token: i1$2.HttpClient }, { token: i1$1.AuthService }], target: i0.ɵɵFactoryTarget.Component });
|
|
576
|
-
UploadImageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: UploadImageComponent, selector: "base-upload-image", inputs: { id: "id", name: "name", label: "label", supportText: "supportText", required: "required", dragText: "dragText", validExtensions: "validExtensions", control: "control", url: "url", uploadPath: "uploadPath", deletePath: "deletePath", path: "path" }, outputs: { imageUploaded: "imageUploaded", imageDeleted: "imageDeleted" }, ngImport: i0, template: "<div class=\"form-group mt-3\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <div\n class=\"drag-area\"\n (dragover)=\"dragOver($event)\"\n (dragleave)=\"dragLeave($event)\"\n (drop)=\"drop($event)\"\n [ngClass]=\"{ active: dragActive }\"\n >\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\n <div class=\"spinner-border text-primary\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n </div>\n\n <ng-container *ngIf=\"selectedFile && !control?.value && !loading\">\n <img [src]=\"fileUrl\" *ngIf=\"selectedFile\" />\n <button class=\"btn btn-danger\" (click)=\"deleteFile()\">L\u00F6schen</button>\n </ng-container>\n\n <ng-container *ngIf=\"control?.value && !loading\">\n <img [src]=\"url + path + control?.value\" />\n <button class=\"btn btn-danger\" (click)=\"deleteFile(control?.value)\">L\u00F6schen</button>\n </ng-container>\n\n <ng-container *ngIf=\"!selectedFile && !control?.value && !loading\">\n <div class=\"icon\">\n <i class=\"bi bi-images\"></i>\n </div>\n\n <span class=\"header\">{{ dragText }}</span>\n <span class=\"header\">or <span class=\"button\" (click)=\"fileInput.click()\">browse</span></span>\n <input type=\"file\" (change)=\"selectFile($event)\" hidden #fileInput />\n <span class=\"support\">{{ supportText }}</span>\n </ng-container>\n </div>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n </div>\n</div>\n", styles: [":host{--base-upload-image-area-bg: #ffffff;--base-upload-image-area-border-color: #e1e1e1;--base-upload-image-area-height: 400px}.required:after{content:\" *\"}.drag-area{height:var(--base-upload-image-area-height);border:2px dashed var(--base-upload-image-area-border-color);background-color:var(--base-upload-image-area-bg);display:flex;flex-direction:column;justify-content:center;align-items:center;margin:10px auto;padding:20px}.drag-area img{height:100%;max-height:300px;max-width:100%;object-fit:scale-down}.drag-area .btn-danger{margin-top:auto}.drag-area .icon{font-size:50px;color:var(--bs-primary)}.drag-area .header{font-size:20px;font-weight:500}.drag-area .support{font-size:12px;color:#e1e1e1;margin:10px 0 15px}.drag-area .button{font-size:20px;font-weight:500;color:var(--bs-primary);cursor:pointer}.active{border:2px solid var(--bs-primary)}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
733
|
+
UploadImageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: UploadImageComponent, selector: "base-upload-image", inputs: { id: "id", name: "name", label: "label", supportText: "supportText", required: "required", dragText: "dragText", validExtensions: "validExtensions", control: "control", url: "url", uploadPath: "uploadPath", deletePath: "deletePath", path: "path" }, outputs: { imageUploaded: "imageUploaded", imageDeleted: "imageDeleted" }, ngImport: i0, template: "<div class=\"form-group mt-3\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <div\n class=\"drag-area\"\n (dragover)=\"dragOver($event)\"\n (dragleave)=\"dragLeave($event)\"\n (drop)=\"drop($event)\"\n [ngClass]=\"{ active: dragActive }\"\n >\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\n <div class=\"spinner-border text-primary\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n </div>\n\n <ng-container *ngIf=\"selectedFile && !control?.value && !loading\">\n <img [src]=\"fileUrl\" *ngIf=\"selectedFile\" />\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteFile()\">L\u00F6schen</button>\n </ng-container>\n\n <ng-container *ngIf=\"control?.value && !loading\">\n <img [src]=\"url + path + control?.value\" />\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteFile(control?.value)\">L\u00F6schen</button>\n </ng-container>\n\n <ng-container *ngIf=\"!selectedFile && !control?.value && !loading\">\n <div class=\"icon\">\n <i class=\"bi bi-images\"></i>\n </div>\n\n <span class=\"header\">{{ dragText }}</span>\n <span class=\"header\">or <span class=\"button\" (click)=\"fileInput.click()\">browse</span></span>\n <input type=\"file\" (change)=\"selectFile($event)\" hidden #fileInput />\n <span class=\"support\">{{ supportText }}</span>\n </ng-container>\n </div>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n </div>\n</div>\n", styles: [":host{--base-upload-image-area-bg: #ffffff;--base-upload-image-area-border-color: #e1e1e1;--base-upload-image-area-height: 400px}.required:after{content:\" *\"}.drag-area{height:var(--base-upload-image-area-height);border:2px dashed var(--base-upload-image-area-border-color);background-color:var(--base-upload-image-area-bg);display:flex;flex-direction:column;justify-content:center;align-items:center;margin:10px auto;padding:20px}.drag-area img{height:100%;max-height:300px;max-width:100%;object-fit:scale-down}.drag-area .btn-danger{margin-top:auto}.drag-area .icon{font-size:50px;color:var(--bs-primary)}.drag-area .header{font-size:20px;font-weight:500}.drag-area .support{font-size:12px;color:#e1e1e1;margin:10px 0 15px}.drag-area .button{font-size:20px;font-weight:500;color:var(--bs-primary);cursor:pointer}.active{border:2px solid var(--bs-primary)}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
577
734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: UploadImageComponent, decorators: [{
|
|
578
735
|
type: Component,
|
|
579
|
-
args: [{ selector: 'base-upload-image', template: "<div class=\"form-group mt-3\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <div\n class=\"drag-area\"\n (dragover)=\"dragOver($event)\"\n (dragleave)=\"dragLeave($event)\"\n (drop)=\"drop($event)\"\n [ngClass]=\"{ active: dragActive }\"\n >\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\n <div class=\"spinner-border text-primary\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n </div>\n\n <ng-container *ngIf=\"selectedFile && !control?.value && !loading\">\n <img [src]=\"fileUrl\" *ngIf=\"selectedFile\" />\n <button class=\"btn btn-danger\" (click)=\"deleteFile()\">L\u00F6schen</button>\n </ng-container>\n\n <ng-container *ngIf=\"control?.value && !loading\">\n <img [src]=\"url + path + control?.value\" />\n <button class=\"btn btn-danger\" (click)=\"deleteFile(control?.value)\">L\u00F6schen</button>\n </ng-container>\n\n <ng-container *ngIf=\"!selectedFile && !control?.value && !loading\">\n <div class=\"icon\">\n <i class=\"bi bi-images\"></i>\n </div>\n\n <span class=\"header\">{{ dragText }}</span>\n <span class=\"header\">or <span class=\"button\" (click)=\"fileInput.click()\">browse</span></span>\n <input type=\"file\" (change)=\"selectFile($event)\" hidden #fileInput />\n <span class=\"support\">{{ supportText }}</span>\n </ng-container>\n </div>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n </div>\n</div>\n", styles: [":host{--base-upload-image-area-bg: #ffffff;--base-upload-image-area-border-color: #e1e1e1;--base-upload-image-area-height: 400px}.required:after{content:\" *\"}.drag-area{height:var(--base-upload-image-area-height);border:2px dashed var(--base-upload-image-area-border-color);background-color:var(--base-upload-image-area-bg);display:flex;flex-direction:column;justify-content:center;align-items:center;margin:10px auto;padding:20px}.drag-area img{height:100%;max-height:300px;max-width:100%;object-fit:scale-down}.drag-area .btn-danger{margin-top:auto}.drag-area .icon{font-size:50px;color:var(--bs-primary)}.drag-area .header{font-size:20px;font-weight:500}.drag-area .support{font-size:12px;color:#e1e1e1;margin:10px 0 15px}.drag-area .button{font-size:20px;font-weight:500;color:var(--bs-primary);cursor:pointer}.active{border:2px solid var(--bs-primary)}\n"] }]
|
|
736
|
+
args: [{ selector: 'base-upload-image', template: "<div class=\"form-group mt-3\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <div\n class=\"drag-area\"\n (dragover)=\"dragOver($event)\"\n (dragleave)=\"dragLeave($event)\"\n (drop)=\"drop($event)\"\n [ngClass]=\"{ active: dragActive }\"\n >\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\n <div class=\"spinner-border text-primary\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n </div>\n\n <ng-container *ngIf=\"selectedFile && !control?.value && !loading\">\n <img [src]=\"fileUrl\" *ngIf=\"selectedFile\" />\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteFile()\">L\u00F6schen</button>\n </ng-container>\n\n <ng-container *ngIf=\"control?.value && !loading\">\n <img [src]=\"url + path + control?.value\" />\n <button class=\"btn btn-danger\" type=\"button\" (click)=\"deleteFile(control?.value)\">L\u00F6schen</button>\n </ng-container>\n\n <ng-container *ngIf=\"!selectedFile && !control?.value && !loading\">\n <div class=\"icon\">\n <i class=\"bi bi-images\"></i>\n </div>\n\n <span class=\"header\">{{ dragText }}</span>\n <span class=\"header\">or <span class=\"button\" (click)=\"fileInput.click()\">browse</span></span>\n <input type=\"file\" (change)=\"selectFile($event)\" hidden #fileInput />\n <span class=\"support\">{{ supportText }}</span>\n </ng-container>\n </div>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control?.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n </div>\n</div>\n", styles: [":host{--base-upload-image-area-bg: #ffffff;--base-upload-image-area-border-color: #e1e1e1;--base-upload-image-area-height: 400px}.required:after{content:\" *\"}.drag-area{height:var(--base-upload-image-area-height);border:2px dashed var(--base-upload-image-area-border-color);background-color:var(--base-upload-image-area-bg);display:flex;flex-direction:column;justify-content:center;align-items:center;margin:10px auto;padding:20px}.drag-area img{height:100%;max-height:300px;max-width:100%;object-fit:scale-down}.drag-area .btn-danger{margin-top:auto}.drag-area .icon{font-size:50px;color:var(--bs-primary)}.drag-area .header{font-size:20px;font-weight:500}.drag-area .support{font-size:12px;color:#e1e1e1;margin:10px 0 15px}.drag-area .button{font-size:20px;font-weight:500;color:var(--bs-primary);cursor:pointer}.active{border:2px solid var(--bs-primary)}\n"] }]
|
|
580
737
|
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: i1$1.AuthService }]; }, propDecorators: { id: [{
|
|
581
738
|
type: Input
|
|
582
739
|
}], name: [{
|
|
@@ -619,29 +776,39 @@ class RefenceInputComponent {
|
|
|
619
776
|
this.textField = 'name';
|
|
620
777
|
this.objects = [];
|
|
621
778
|
this.optionsForTagInput = [];
|
|
779
|
+
this.subscription = new Subscription();
|
|
622
780
|
}
|
|
623
781
|
ngOnInit() {
|
|
624
782
|
return __awaiter(this, void 0, void 0, function* () {
|
|
625
|
-
this.
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
})
|
|
630
|
-
.subscribe((result) => __awaiter(this, void 0, void 0, function* () {
|
|
631
|
-
if (result) {
|
|
632
|
-
this.objects = result;
|
|
633
|
-
this.setObjectsAsOptions();
|
|
634
|
-
yield this.setValue();
|
|
783
|
+
this.getReferences();
|
|
784
|
+
this.subscription.add(this.control.valueChanges.subscribe(() => {
|
|
785
|
+
if (!this.currentValue) {
|
|
786
|
+
this.setValue();
|
|
635
787
|
}
|
|
636
788
|
}));
|
|
637
789
|
});
|
|
638
790
|
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
791
|
+
ngOnDestroy() {
|
|
792
|
+
this.subscription.unsubscribe();
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* It gets the references from the GraphQL server and sets the value of the select
|
|
796
|
+
*/
|
|
797
|
+
getReferences() {
|
|
798
|
+
this.graphQLService
|
|
799
|
+
.graphQl(this.method, {
|
|
800
|
+
fields: this.fields,
|
|
801
|
+
type: GraphQLRequestType.QUERY,
|
|
802
|
+
})
|
|
803
|
+
.subscribe((result) => __awaiter(this, void 0, void 0, function* () {
|
|
804
|
+
if (result) {
|
|
805
|
+
this.objects = result;
|
|
806
|
+
this.setObjectsAsOptions();
|
|
807
|
+
if (!this.currentValue) {
|
|
808
|
+
this.setValue();
|
|
809
|
+
}
|
|
643
810
|
}
|
|
644
|
-
});
|
|
811
|
+
}));
|
|
645
812
|
}
|
|
646
813
|
/**
|
|
647
814
|
* If the current value is not valid, set the control to an invalid state
|
|
@@ -677,23 +844,16 @@ class RefenceInputComponent {
|
|
|
677
844
|
* the objects array is empty, then set the currentValue to the control's value
|
|
678
845
|
*/
|
|
679
846
|
setValue() {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
if (((
|
|
683
|
-
|
|
684
|
-
if (foundElement) {
|
|
685
|
-
this.currentValue = foundElement[this.textField];
|
|
686
|
-
resolve(true);
|
|
687
|
-
}
|
|
688
|
-
else {
|
|
689
|
-
this.currentValue = this.control.value;
|
|
690
|
-
resolve(true);
|
|
691
|
-
}
|
|
847
|
+
var _a, _b, _c, _d;
|
|
848
|
+
if (((_a = this.control) === null || _a === void 0 ? void 0 : _a.value) && ((_b = this.objects) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
849
|
+
if ((_d = (_c = this.control) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.id) {
|
|
850
|
+
this.control.setValue(this.control.value.id);
|
|
692
851
|
}
|
|
693
|
-
|
|
694
|
-
|
|
852
|
+
const foundElement = this.objects.find((e) => e[this.valueField] === this.control.value);
|
|
853
|
+
if (foundElement) {
|
|
854
|
+
this.currentValue = foundElement[this.textField];
|
|
695
855
|
}
|
|
696
|
-
}
|
|
856
|
+
}
|
|
697
857
|
}
|
|
698
858
|
/**
|
|
699
859
|
* It sets the value of the control to the id of the selected option
|
|
@@ -744,7 +904,7 @@ class RefenceInputComponent {
|
|
|
744
904
|
}
|
|
745
905
|
}
|
|
746
906
|
RefenceInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: RefenceInputComponent, deps: [{ token: i1$1.GraphQLService }], target: i0.ɵɵFactoryTarget.Component });
|
|
747
|
-
RefenceInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: RefenceInputComponent, selector: "base-refence-input", inputs: { id: "id", name: "name", label: "label", isList: "isList", placeholder: "placeholder", autocomplete: "autocomplete", tabIndex: "tabIndex", control: "control", required: "required", method: "method", fields: "fields", valueField: "valueField", textField: "textField" },
|
|
907
|
+
RefenceInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: RefenceInputComponent, selector: "base-refence-input", inputs: { id: "id", name: "name", label: "label", isList: "isList", placeholder: "placeholder", autocomplete: "autocomplete", tabIndex: "tabIndex", control: "control", required: "required", method: "method", fields: "fields", valueField: "valueField", textField: "textField" }, ngImport: i0, template: "<ng-container *ngIf=\"!isList\">\n <div class=\"form-group mb-3\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n\n <div class=\"position-relative\">\n <input [formControl]=\"control\" hidden />\n <input\n [id]=\"id\"\n [name]=\"name\"\n class=\"form-control\"\n [(ngModel)]=\"currentValue\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onFocus()\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [autocomplete]=\"autocomplete ?? null\"\n [tabIndex]=\"tabIndex ?? null\"\n (keyup)=\"enterKey($event)\"\n />\n <div class=\"options\" *ngIf=\"objects && selectedElement\">\n <div class=\"option-item\" *ngFor=\"let object of filterOptions()\" (click)=\"set(object[valueField])\">\n {{ object[textField] }}\n </div>\n </div>\n </div>\n\n <div\n class=\"d-block invalid-feedback m-2\"\n *ngIf=\"control?.invalid && (control?.dirty || control?.touched) && !selectedElement\"\n >\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['invalidReference']\">Bitte w\u00E4hle einen g\u00FCltigen Wert aus.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['matching']\">Die Passw\u00F6rter m\u00FCssen \u00FCberein stimmen.</div>\n </div>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"isList\">\n <base-tags\n [id]=\"id\"\n [label]=\"label\"\n [name]=\"name\"\n [control]=\"control\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [custom]=\"false\"\n [options]=\"optionsForTagInput\"\n ></base-tags>\n</ng-container>\n", styles: [".options{position:absolute;display:block;top:100%;left:0;right:0;border-top:0;background-color:#fff;box-shadow:0 2px 5px #00000029,0 2px 10px #0000001f;transition:all .5s;z-index:999}.options .option-item{padding:10px;cursor:pointer}.options .option-item:hover{color:var(--bs-primary)}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TagsComponent, selector: "base-tags", inputs: ["id", "name", "label", "placeholder", "autocomplete", "tabIndex", "control", "options", "custom", "removeByKey", "required"] }] });
|
|
748
908
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: RefenceInputComponent, decorators: [{
|
|
749
909
|
type: Component,
|
|
750
910
|
args: [{ selector: 'base-refence-input', template: "<ng-container *ngIf=\"!isList\">\n <div class=\"form-group mb-3\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n\n <div class=\"position-relative\">\n <input [formControl]=\"control\" hidden />\n <input\n [id]=\"id\"\n [name]=\"name\"\n class=\"form-control\"\n [(ngModel)]=\"currentValue\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onFocus()\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [autocomplete]=\"autocomplete ?? null\"\n [tabIndex]=\"tabIndex ?? null\"\n (keyup)=\"enterKey($event)\"\n />\n <div class=\"options\" *ngIf=\"objects && selectedElement\">\n <div class=\"option-item\" *ngFor=\"let object of filterOptions()\" (click)=\"set(object[valueField])\">\n {{ object[textField] }}\n </div>\n </div>\n </div>\n\n <div\n class=\"d-block invalid-feedback m-2\"\n *ngIf=\"control?.invalid && (control?.dirty || control?.touched) && !selectedElement\"\n >\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['invalidReference']\">Bitte w\u00E4hle einen g\u00FCltigen Wert aus.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['matching']\">Die Passw\u00F6rter m\u00FCssen \u00FCberein stimmen.</div>\n </div>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"isList\">\n <base-tags\n [id]=\"id\"\n [label]=\"label\"\n [name]=\"name\"\n [control]=\"control\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [custom]=\"false\"\n [options]=\"optionsForTagInput\"\n ></base-tags>\n</ng-container>\n", styles: [".options{position:absolute;display:block;top:100%;left:0;right:0;border-top:0;background-color:#fff;box-shadow:0 2px 5px #00000029,0 2px 10px #0000001f;transition:all .5s;z-index:999}.options .option-item{padding:10px;cursor:pointer}.options .option-item:hover{color:var(--bs-primary)}\n"] }]
|
|
@@ -794,6 +954,13 @@ class ModelFormSubComponent {
|
|
|
794
954
|
// Set user for roles check
|
|
795
955
|
this.user = BasicUser.map(this.authService.currentUser);
|
|
796
956
|
}
|
|
957
|
+
/**
|
|
958
|
+
* If the field has fields, return true, otherwise return false.
|
|
959
|
+
*/
|
|
960
|
+
checkFieldHasFields(field) {
|
|
961
|
+
var _a;
|
|
962
|
+
return ((_a = Object.keys(field.fields)) === null || _a === void 0 ? void 0 : _a.length) !== 0;
|
|
963
|
+
}
|
|
797
964
|
/**
|
|
798
965
|
* It takes a string, capitalizes the first letter, and returns the new string
|
|
799
966
|
*
|
|
@@ -835,10 +1002,10 @@ class ModelFormSubComponent {
|
|
|
835
1002
|
}
|
|
836
1003
|
}
|
|
837
1004
|
ModelFormSubComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ModelFormSubComponent, deps: [{ token: i1$1.AuthService }], target: i0.ɵɵFactoryTarget.Component });
|
|
838
|
-
ModelFormSubComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: ModelFormSubComponent, selector: "base-model-form-sub", inputs: { fields: "fields", form: "form", config: "config" }, outputs: { imageChanged: "imageChanged" }, ngImport: i0, template: "<div class=\"mt-3\" *ngFor=\"let key of keys\">\n <ng-container *ngIf=\"!fields[key]?.type && (config[key]?.roles ? user?.hasAllRoles(config[key]?.roles) : true)\">\n <fieldset class=\"border rounded-3 p-3\">\n <legend class=\"float-none w-auto px-3\">\n {{ config[key]?.label ? config[key].label : capitalizeFirstLetter(key) }}\n </legend>\n <base-model-form-sub\n [fields]=\"fields[key]\"\n [config]=\"config[key]?.fields || {}\"\n [form]=\"form.get(key)\"\n ></base-model-form-sub>\n </fieldset>\n </ng-container>\n\n <ng-container *ngIf=\"fields[key]?.type && (config[key]?.roles ? user?.hasAllRoles(config[key]?.roles) : true)\">\n <ng-container *ngIf=\"fields[key]?.isEnum\">\n <base-select\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || 'Bitte einen Wert ausw\u00E4hlen'\"\n [options]=\"prepareEnumForSelect(fields[key]?.validEnums, config[key]?.enumValues)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\"\n ></base-select>\n </ng-container>\n\n <ng-container *ngIf=\"!fields[key]?.isEnum\">\n <ng-container [ngSwitch]=\"config[key]?.type ? config[key]?.type : fields[key]?.type\">\n <ng-container *ngSwitchCase=\"'String'\">\n <ng-container *ngIf=\"fields[key]?.isList && !config[key]?.exclude\">\n <base-tags\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-tags>\n </ng-container>\n\n <ng-container *ngIf=\"!fields[key]?.isList && !config[key]?.exclude\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'text'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Image'\">\n <base-upload-image\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [url]=\"config[key]?.url\"\n [path]=\"config[key]?.path || '/files/'\"\n [uploadPath]=\"config[key]?.uploadPath || '/files/upload'\"\n [deletePath]=\"config[key]?.deletePath || '/files/'\"\n [supportText]=\"config[key]?.supportText || 'Unterst\u00FCtzte Formate: JPEG, JPG, PNG'\"\n [dragText]=\"config[key]?.dragText || 'Drag & Drop'\"\n [validExtensions]=\"config[key]?.validExtensions || ['image/jpeg', 'image/jpg', 'image/png']\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n (imageDeleted)=\"imageChanged.emit()\"\n (imageUploaded)=\"imageChanged.emit()\"\n ></base-upload-image>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Reference'\">\n <base-refence-input\n [id]=\"key\"\n [name]=\"key\"\n [isList]=\"fields[key]?.isList\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [method]=\"config[key]?.method || 'find'\"\n [fields]=\"config[key]?.fields || ['id', 'name']\"\n [valueField]=\"config[key]?.valueField || 'id'\"\n [textField]=\"config[key]?.nameField || 'name'\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-refence-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <base-checkbox\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-checkbox>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'LongText'\">\n <base-textarea\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-textarea>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Float'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [type]=\"'number'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Password'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [type]=\"'password'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Color'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [type]=\"'color'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'datetime-local'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: InputComponent, selector: "base-input", inputs: ["id", "name", "label", "placeholder", "autocomplete", "tabIndex", "control", "type", "required"], outputs: ["enter"] }, { kind: "component", type: SelectComponent, selector: "base-select", inputs: ["id", "name", "label", "placeholder", "control", "tabIndex", "required", "multiple", "search", "options"] }, { kind: "component", type: CheckboxComponent, selector: "base-checkbox", inputs: ["id", "name", "label", "value", "control", "required"] }, { kind: "component", type: TextareaComponent, selector: "base-textarea", inputs: ["id", "name", "label", "placeholder", "control", "rows", "required", "tabIndex"] }, { kind: "component", type: TagsComponent, selector: "base-tags", inputs: ["id", "name", "label", "placeholder", "autocomplete", "tabIndex", "control", "options", "custom", "removeByKey", "required"] }, { kind: "component", type: ModelFormSubComponent, selector: "base-model-form-sub", inputs: ["fields", "form", "config"], outputs: ["imageChanged"] }, { kind: "component", type: UploadImageComponent, selector: "base-upload-image", inputs: ["id", "name", "label", "supportText", "required", "dragText", "validExtensions", "control", "url", "uploadPath", "deletePath", "path"], outputs: ["imageUploaded", "imageDeleted"] }, { kind: "component", type: RefenceInputComponent, selector: "base-refence-input", inputs: ["id", "name", "label", "isList", "placeholder", "autocomplete", "tabIndex", "control", "required", "method", "fields", "valueField", "textField"] }] });
|
|
1005
|
+
ModelFormSubComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: ModelFormSubComponent, selector: "base-model-form-sub", inputs: { fields: "fields", form: "form", config: "config" }, outputs: { imageChanged: "imageChanged" }, ngImport: i0, template: "<div class=\"mt-3\" *ngFor=\"let key of keys\">\n <ng-container\n *ngIf=\"checkFieldHasFields(fields[key]) && (config[key]?.roles ? user?.hasAllRoles(config[key]?.roles) : true)\"\n >\n <fieldset class=\"border rounded-3 p-3 mt-3\">\n <legend class=\"float-none w-auto px-3\">\n {{ config[key]?.label ? config[key].label : capitalizeFirstLetter(key) }}\n </legend>\n <base-model-form-sub\n [fields]=\"fields[key].fields\"\n [config]=\"config[key]?.fields || {}\"\n [form]=\"form.get(key)\"\n ></base-model-form-sub>\n </fieldset>\n </ng-container>\n\n <ng-container\n *ngIf=\"!checkFieldHasFields(fields[key]) && (config[key]?.roles ? user?.hasAllRoles(config[key]?.roles) : true)\"\n >\n <ng-container *ngIf=\"fields[key]?.isEnum && !config[key]?.exclude\">\n <base-select\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || 'Bitte einen Wert ausw\u00E4hlen'\"\n [options]=\"prepareEnumForSelect(fields[key]?.validEnums, config[key]?.enumValues)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\"\n ></base-select>\n </ng-container>\n\n <ng-container *ngIf=\"!fields[key]?.isEnum && !config[key]?.exclude\">\n <ng-container [ngSwitch]=\"config[key]?.type ? config[key]?.type : fields[key]?.type\">\n <ng-container *ngSwitchCase=\"'String'\">\n <ng-container *ngIf=\"fields[key]?.isList && !config[key]?.exclude\">\n <base-tags\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-tags>\n </ng-container>\n\n <ng-container *ngIf=\"!fields[key]?.isList && !config[key]?.exclude\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'text'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Image'\">\n <base-upload-image\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [url]=\"config[key]?.url\"\n [path]=\"config[key]?.path || '/files/'\"\n [uploadPath]=\"config[key]?.uploadPath || '/files/upload'\"\n [deletePath]=\"config[key]?.deletePath || '/files/'\"\n [supportText]=\"config[key]?.supportText || 'Unterst\u00FCtzte Formate: JPEG, JPG, PNG'\"\n [dragText]=\"config[key]?.dragText || 'Drag & Drop'\"\n [validExtensions]=\"config[key]?.validExtensions || ['image/jpeg', 'image/jpg', 'image/png']\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n (imageDeleted)=\"imageChanged.emit(key)\"\n (imageUploaded)=\"imageChanged.emit(key)\"\n ></base-upload-image>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Reference'\">\n <base-refence-input\n [id]=\"key\"\n [name]=\"key\"\n [isList]=\"fields[key]?.isList\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [method]=\"config[key]?.method || 'find'\"\n [fields]=\"config[key]?.fields || ['id', 'name']\"\n [valueField]=\"config[key]?.valueField || 'id'\"\n [textField]=\"config[key]?.nameField || 'name'\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-refence-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <base-checkbox\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-checkbox>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'LongText'\">\n <base-textarea\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-textarea>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Float'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [type]=\"'number'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Password'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [type]=\"'password'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Color'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [type]=\"'color'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'URL'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'url'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Email'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'email'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'datetime-local'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: InputComponent, selector: "base-input", inputs: ["id", "name", "label", "placeholder", "autocomplete", "tabIndex", "control", "type", "required"], outputs: ["enter"] }, { kind: "component", type: SelectComponent, selector: "base-select", inputs: ["id", "name", "label", "placeholder", "control", "tabIndex", "required", "multiple", "search", "options"] }, { kind: "component", type: CheckboxComponent, selector: "base-checkbox", inputs: ["id", "name", "label", "value", "control", "required"] }, { kind: "component", type: TextareaComponent, selector: "base-textarea", inputs: ["id", "name", "label", "placeholder", "control", "rows", "required", "tabIndex"] }, { kind: "component", type: TagsComponent, selector: "base-tags", inputs: ["id", "name", "label", "placeholder", "autocomplete", "tabIndex", "control", "options", "custom", "removeByKey", "required"] }, { kind: "component", type: ModelFormSubComponent, selector: "base-model-form-sub", inputs: ["fields", "form", "config"], outputs: ["imageChanged"] }, { kind: "component", type: UploadImageComponent, selector: "base-upload-image", inputs: ["id", "name", "label", "supportText", "required", "dragText", "validExtensions", "control", "url", "uploadPath", "deletePath", "path"], outputs: ["imageUploaded", "imageDeleted"] }, { kind: "component", type: RefenceInputComponent, selector: "base-refence-input", inputs: ["id", "name", "label", "isList", "placeholder", "autocomplete", "tabIndex", "control", "required", "method", "fields", "valueField", "textField"] }] });
|
|
839
1006
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ModelFormSubComponent, decorators: [{
|
|
840
1007
|
type: Component,
|
|
841
|
-
args: [{ selector: 'base-model-form-sub', template: "<div class=\"mt-3\" *ngFor=\"let key of keys\">\n <ng-container
|
|
1008
|
+
args: [{ selector: 'base-model-form-sub', template: "<div class=\"mt-3\" *ngFor=\"let key of keys\">\n <ng-container\n *ngIf=\"checkFieldHasFields(fields[key]) && (config[key]?.roles ? user?.hasAllRoles(config[key]?.roles) : true)\"\n >\n <fieldset class=\"border rounded-3 p-3 mt-3\">\n <legend class=\"float-none w-auto px-3\">\n {{ config[key]?.label ? config[key].label : capitalizeFirstLetter(key) }}\n </legend>\n <base-model-form-sub\n [fields]=\"fields[key].fields\"\n [config]=\"config[key]?.fields || {}\"\n [form]=\"form.get(key)\"\n ></base-model-form-sub>\n </fieldset>\n </ng-container>\n\n <ng-container\n *ngIf=\"!checkFieldHasFields(fields[key]) && (config[key]?.roles ? user?.hasAllRoles(config[key]?.roles) : true)\"\n >\n <ng-container *ngIf=\"fields[key]?.isEnum && !config[key]?.exclude\">\n <base-select\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || 'Bitte einen Wert ausw\u00E4hlen'\"\n [options]=\"prepareEnumForSelect(fields[key]?.validEnums, config[key]?.enumValues)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\"\n ></base-select>\n </ng-container>\n\n <ng-container *ngIf=\"!fields[key]?.isEnum && !config[key]?.exclude\">\n <ng-container [ngSwitch]=\"config[key]?.type ? config[key]?.type : fields[key]?.type\">\n <ng-container *ngSwitchCase=\"'String'\">\n <ng-container *ngIf=\"fields[key]?.isList && !config[key]?.exclude\">\n <base-tags\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-tags>\n </ng-container>\n\n <ng-container *ngIf=\"!fields[key]?.isList && !config[key]?.exclude\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'text'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Image'\">\n <base-upload-image\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [url]=\"config[key]?.url\"\n [path]=\"config[key]?.path || '/files/'\"\n [uploadPath]=\"config[key]?.uploadPath || '/files/upload'\"\n [deletePath]=\"config[key]?.deletePath || '/files/'\"\n [supportText]=\"config[key]?.supportText || 'Unterst\u00FCtzte Formate: JPEG, JPG, PNG'\"\n [dragText]=\"config[key]?.dragText || 'Drag & Drop'\"\n [validExtensions]=\"config[key]?.validExtensions || ['image/jpeg', 'image/jpg', 'image/png']\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n (imageDeleted)=\"imageChanged.emit(key)\"\n (imageUploaded)=\"imageChanged.emit(key)\"\n ></base-upload-image>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Reference'\">\n <base-refence-input\n [id]=\"key\"\n [name]=\"key\"\n [isList]=\"fields[key]?.isList\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [method]=\"config[key]?.method || 'find'\"\n [fields]=\"config[key]?.fields || ['id', 'name']\"\n [valueField]=\"config[key]?.valueField || 'id'\"\n [textField]=\"config[key]?.nameField || 'name'\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-refence-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <base-checkbox\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-checkbox>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'LongText'\">\n <base-textarea\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-textarea>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Float'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [type]=\"'number'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Password'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [type]=\"'password'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Color'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [type]=\"'color'\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'URL'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'url'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Email'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'email'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <base-input\n [id]=\"key\"\n [name]=\"key\"\n [label]=\"config[key]?.label ? config[key].label : capitalizeFirstLetter(key)\"\n [placeholder]=\"config[key]?.placeholder || ''\"\n [type]=\"'datetime-local'\"\n [control]=\"transformToControl(form?.get(key))\"\n [required]=\"\n config[key] && config[key]?.required !== undefined ? config[key]?.required : fields[key].isRequired\n \"\n ></base-input>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n</div>\n" }]
|
|
842
1009
|
}], ctorParameters: function () { return [{ type: i1$1.AuthService }]; }, propDecorators: { fields: [{
|
|
843
1010
|
type: Input
|
|
844
1011
|
}], form: [{
|
|
@@ -850,13 +1017,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
850
1017
|
}] } });
|
|
851
1018
|
|
|
852
1019
|
class ModelFormComponent {
|
|
853
|
-
constructor(graphQLMetaService, graphQLService, formsService, authService, router, route) {
|
|
1020
|
+
constructor(graphQLMetaService, graphQLService, formsService, authService, router, route, cmsService) {
|
|
854
1021
|
this.graphQLMetaService = graphQLMetaService;
|
|
855
1022
|
this.graphQLService = graphQLService;
|
|
856
1023
|
this.formsService = formsService;
|
|
857
1024
|
this.authService = authService;
|
|
858
1025
|
this.router = router;
|
|
859
1026
|
this.route = route;
|
|
1027
|
+
this.cmsService = cmsService;
|
|
860
1028
|
this.delete = true;
|
|
861
1029
|
this.duplicate = false;
|
|
862
1030
|
this.logging = false;
|
|
@@ -889,8 +1057,8 @@ class ModelFormComponent {
|
|
|
889
1057
|
this.operation = this.id ? 'update' : 'create';
|
|
890
1058
|
this.fields = this.meta.getArgs(this.operation + this.capitalizeFirstLetter(this.modelName), {
|
|
891
1059
|
type: GraphQLRequestType.MUTATION,
|
|
892
|
-
});
|
|
893
|
-
this.fields = this.fields['input'];
|
|
1060
|
+
}).fields;
|
|
1061
|
+
this.fields = this.fields['input'].fields;
|
|
894
1062
|
this.keys = Object.keys(this.fields);
|
|
895
1063
|
if (this.logging) {
|
|
896
1064
|
console.log('ModelFormComponent::init->fields', this.fields);
|
|
@@ -926,7 +1094,7 @@ class ModelFormComponent {
|
|
|
926
1094
|
})
|
|
927
1095
|
.subscribe({
|
|
928
1096
|
next: (response) => {
|
|
929
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1097
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
930
1098
|
if (this.logging) {
|
|
931
1099
|
console.log('ModelFormComponent::get->value', response);
|
|
932
1100
|
}
|
|
@@ -934,12 +1102,20 @@ class ModelFormComponent {
|
|
|
934
1102
|
// Process patchFields for reference input
|
|
935
1103
|
for (const [key, value] of Object.entries(this.config)) {
|
|
936
1104
|
// If it not an array
|
|
937
|
-
if (((_a = this.config[key]) === null || _a === void 0 ? void 0 : _a.
|
|
938
|
-
this.form.get(key)
|
|
1105
|
+
if (((_a = this.config[key]) === null || _a === void 0 ? void 0 : _a.type) === 'Reference' && !((_b = this.fields[key]) === null || _b === void 0 ? void 0 : _b.isList)) {
|
|
1106
|
+
if (this.form.get(key)) {
|
|
1107
|
+
this.form
|
|
1108
|
+
.get(key)
|
|
1109
|
+
.patchValue((_e = response[((_c = this.config[key]) === null || _c === void 0 ? void 0 : _c.patchField) ? (_d = this.config[key]) === null || _d === void 0 ? void 0 : _d.patchField : key]) === null || _e === void 0 ? void 0 : _e.id);
|
|
1110
|
+
}
|
|
939
1111
|
}
|
|
940
1112
|
// If value is an array
|
|
941
|
-
if (((
|
|
942
|
-
this.form.get(key)
|
|
1113
|
+
if (((_f = this.config[key]) === null || _f === void 0 ? void 0 : _f.type) === 'Reference' && ((_g = this.fields[key]) === null || _g === void 0 ? void 0 : _g.isList)) {
|
|
1114
|
+
if (this.form.get(key)) {
|
|
1115
|
+
this.form
|
|
1116
|
+
.get(key)
|
|
1117
|
+
.patchValue((_k = response[((_h = this.config[key]) === null || _h === void 0 ? void 0 : _h.patchField) ? (_j = this.config[key]) === null || _j === void 0 ? void 0 : _j.patchField : key]) === null || _k === void 0 ? void 0 : _k.map((e) => e === null || e === void 0 ? void 0 : e.id));
|
|
1118
|
+
}
|
|
943
1119
|
}
|
|
944
1120
|
}
|
|
945
1121
|
if (this.logging) {
|
|
@@ -960,19 +1136,22 @@ class ModelFormComponent {
|
|
|
960
1136
|
* @returns An array of strings and objects.
|
|
961
1137
|
*/
|
|
962
1138
|
createRequestObject(fields) {
|
|
963
|
-
var _a, _b, _c;
|
|
1139
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
964
1140
|
const requestFields = [];
|
|
965
1141
|
for (const [key, value] of Object.entries(fields)) {
|
|
966
|
-
if ((_a =
|
|
967
|
-
|
|
1142
|
+
if (((_a = this.config[key]) === null || _a === void 0 ? void 0 : _a.exclude) !== undefined && ((_b = this.config[key]) === null || _b === void 0 ? void 0 : _b.exclude)) {
|
|
1143
|
+
continue;
|
|
1144
|
+
}
|
|
1145
|
+
if (((_d = Object.keys((_c = fields[key]) === null || _c === void 0 ? void 0 : _c.fields)) === null || _d === void 0 ? void 0 : _d.length) === 0) {
|
|
1146
|
+
if (((_e = this.config[key]) === null || _e === void 0 ? void 0 : _e.type) !== 'Reference') {
|
|
968
1147
|
requestFields.push(key);
|
|
969
1148
|
}
|
|
970
1149
|
else {
|
|
971
|
-
requestFields.push({ [(
|
|
1150
|
+
requestFields.push({ [((_f = this.config[key]) === null || _f === void 0 ? void 0 : _f.patchField) ? (_g = this.config[key]) === null || _g === void 0 ? void 0 : _g.patchField : key]: ['id'] });
|
|
972
1151
|
}
|
|
973
1152
|
}
|
|
974
1153
|
else {
|
|
975
|
-
const subkeys = this.createRequestObject(fields[key]);
|
|
1154
|
+
const subkeys = this.createRequestObject(fields[key].fields);
|
|
976
1155
|
const resultObject = {};
|
|
977
1156
|
resultObject[key] = subkeys;
|
|
978
1157
|
requestFields.push(resultObject);
|
|
@@ -989,16 +1168,16 @@ class ModelFormComponent {
|
|
|
989
1168
|
* @param fields - IGraphQLTypeCollection
|
|
990
1169
|
*/
|
|
991
1170
|
createForm(fields) {
|
|
992
|
-
var _a, _b;
|
|
1171
|
+
var _a, _b, _c;
|
|
993
1172
|
const group = {};
|
|
994
1173
|
for (const [key, value] of Object.entries(fields)) {
|
|
995
|
-
if (value === null || value === void 0 ? void 0 : value.
|
|
996
|
-
group[key] = new UntypedFormControl(
|
|
1174
|
+
if (((_a = Object.keys(value === null || value === void 0 ? void 0 : value.fields)) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
|
1175
|
+
group[key] = new UntypedFormControl(null, (this.config[key] && ((_b = this.config[key]) === null || _b === void 0 ? void 0 : _b.required) !== undefined ? (_c = this.config[key]) === null || _c === void 0 ? void 0 : _c.required : value.isRequired)
|
|
997
1176
|
? Validators.required
|
|
998
1177
|
: []);
|
|
999
1178
|
}
|
|
1000
1179
|
else {
|
|
1001
|
-
group[key] = this.createForm(fields[key]);
|
|
1180
|
+
group[key] = this.createForm(fields[key].fields);
|
|
1002
1181
|
}
|
|
1003
1182
|
}
|
|
1004
1183
|
if (this.logging) {
|
|
@@ -1010,50 +1189,23 @@ class ModelFormComponent {
|
|
|
1010
1189
|
* It calls the graphQLService to delete the object with the id of the object that is currently being edited
|
|
1011
1190
|
*/
|
|
1012
1191
|
deleteObject() {
|
|
1013
|
-
|
|
1014
|
-
this.
|
|
1015
|
-
|
|
1016
|
-
arguments: { id: this.id },
|
|
1017
|
-
fields: ['id'],
|
|
1018
|
-
type: GraphQLRequestType.MUTATION,
|
|
1019
|
-
})
|
|
1020
|
-
.subscribe({
|
|
1021
|
-
next: (value) => {
|
|
1022
|
-
this.finished.emit(null);
|
|
1023
|
-
},
|
|
1024
|
-
error: (err) => {
|
|
1025
|
-
console.error('Error on delete object', err);
|
|
1026
|
-
},
|
|
1027
|
-
});
|
|
1028
|
-
}
|
|
1192
|
+
this.cmsService.deleteObject(this.id, this.modelName).then(() => {
|
|
1193
|
+
this.finished.emit(null);
|
|
1194
|
+
});
|
|
1029
1195
|
}
|
|
1030
1196
|
/**
|
|
1031
1197
|
* It sends a GraphQL mutation to the server to duplicate the object
|
|
1032
1198
|
*/
|
|
1033
1199
|
duplicateObject() {
|
|
1034
1200
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
.subscribe({
|
|
1044
|
-
next: (value) => {
|
|
1045
|
-
if (value === null || value === void 0 ? void 0 : value.id) {
|
|
1046
|
-
this.router.navigate(['../' + value.id], { relativeTo: this.route });
|
|
1047
|
-
}
|
|
1048
|
-
else {
|
|
1049
|
-
this.finished.emit(null);
|
|
1050
|
-
}
|
|
1051
|
-
},
|
|
1052
|
-
error: (err) => {
|
|
1053
|
-
console.error('Error on duplicate object', err);
|
|
1054
|
-
},
|
|
1055
|
-
});
|
|
1056
|
-
}
|
|
1201
|
+
this.cmsService.duplicateObject(this.id, this.modelName).then((value) => {
|
|
1202
|
+
if (value === null || value === void 0 ? void 0 : value.id) {
|
|
1203
|
+
this.router.navigate(['../' + value.id], { relativeTo: this.route });
|
|
1204
|
+
}
|
|
1205
|
+
else {
|
|
1206
|
+
this.finished.emit(null);
|
|
1207
|
+
}
|
|
1208
|
+
});
|
|
1057
1209
|
});
|
|
1058
1210
|
}
|
|
1059
1211
|
/**
|
|
@@ -1063,7 +1215,7 @@ class ModelFormComponent {
|
|
|
1063
1215
|
* @returns The first letter of the string is being capitalized and the rest of the string is being returned.
|
|
1064
1216
|
*/
|
|
1065
1217
|
capitalizeFirstLetter(value) {
|
|
1066
|
-
return
|
|
1218
|
+
return this.cmsService.capitalizeFirstLetter(value);
|
|
1067
1219
|
}
|
|
1068
1220
|
/**
|
|
1069
1221
|
* It takes an AbstractControl and returns a FormControl
|
|
@@ -1074,6 +1226,39 @@ class ModelFormComponent {
|
|
|
1074
1226
|
transformToControl(control) {
|
|
1075
1227
|
return control;
|
|
1076
1228
|
}
|
|
1229
|
+
/**
|
|
1230
|
+
* It takes the key of the form control that has changed, gets the value of that form control, creates an object with the
|
|
1231
|
+
* key and value, and then sends that object to the GraphQL server to update the database
|
|
1232
|
+
*/
|
|
1233
|
+
imageChanged(key) {
|
|
1234
|
+
const data = {};
|
|
1235
|
+
data[key] = this.form.get(key).value;
|
|
1236
|
+
if (this.logging) {
|
|
1237
|
+
console.log('ModelFormComponent::imageChanged->body', data);
|
|
1238
|
+
}
|
|
1239
|
+
if (this.id) {
|
|
1240
|
+
try {
|
|
1241
|
+
this.graphQLService
|
|
1242
|
+
.graphQl('update' + this.capitalizeFirstLetter(this.modelName), {
|
|
1243
|
+
arguments: { id: this.id, input: data },
|
|
1244
|
+
fields: ['id'],
|
|
1245
|
+
type: GraphQLRequestType.MUTATION,
|
|
1246
|
+
})
|
|
1247
|
+
.subscribe({
|
|
1248
|
+
next: (value) => {
|
|
1249
|
+
if (this.logging) {
|
|
1250
|
+
console.log('ModelFormComponent::imageChanged->success', value);
|
|
1251
|
+
}
|
|
1252
|
+
},
|
|
1253
|
+
});
|
|
1254
|
+
}
|
|
1255
|
+
catch (e) {
|
|
1256
|
+
if (this.logging) {
|
|
1257
|
+
console.log('ModelFormComponent::imageChanged->error', e);
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1077
1262
|
/**
|
|
1078
1263
|
* It takes the form, validates it, and then sends it to the GraphQL server
|
|
1079
1264
|
*
|
|
@@ -1081,7 +1266,7 @@ class ModelFormComponent {
|
|
|
1081
1266
|
*/
|
|
1082
1267
|
submit(secret = false) {
|
|
1083
1268
|
return new Promise((resolve, reject) => {
|
|
1084
|
-
var _a, _b, _c, _d;
|
|
1269
|
+
var _a, _b, _c, _d, _e;
|
|
1085
1270
|
if (!secret) {
|
|
1086
1271
|
this.loading = true;
|
|
1087
1272
|
}
|
|
@@ -1106,8 +1291,19 @@ class ModelFormComponent {
|
|
|
1106
1291
|
((_c = this.config[key]) === null || _c === void 0 ? void 0 : _c.exclude)) {
|
|
1107
1292
|
delete data[key];
|
|
1108
1293
|
}
|
|
1294
|
+
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
1295
|
+
data[key] = Object.keys(data[key])
|
|
1296
|
+
.filter((k) => data[key][k] != null)
|
|
1297
|
+
.reduce((a, k) => (Object.assign(Object.assign({}, a), { [k]: data[key][k] })), {});
|
|
1298
|
+
if (((_d = Object.keys(data[key])) === null || _d === void 0 ? void 0 : _d.length) === 0) {
|
|
1299
|
+
if (this.logging) {
|
|
1300
|
+
console.log('Object is empty from result');
|
|
1301
|
+
}
|
|
1302
|
+
data[key] = null;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1109
1305
|
// Set type for graphql method
|
|
1110
|
-
if (((
|
|
1306
|
+
if (((_e = this.fields[key]) === null || _e === void 0 ? void 0 : _e.type) === 'Float') {
|
|
1111
1307
|
data[key] = Number(value);
|
|
1112
1308
|
}
|
|
1113
1309
|
}
|
|
@@ -1139,12 +1335,12 @@ class ModelFormComponent {
|
|
|
1139
1335
|
});
|
|
1140
1336
|
}
|
|
1141
1337
|
}
|
|
1142
|
-
ModelFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", 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 });
|
|
1143
|
-
ModelFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", 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
|
|
1338
|
+
ModelFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", 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 }, { token: i1$1.CmsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1339
|
+
ModelFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", 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 class=\"mb-0\">\n {{ label ? label : capitalizeFirstLetter(modelName) }} {{ operation === 'update' ? 'bearbeiten' : 'erstellen' }}\n </h2>\n\n <div class=\"d-flex flex-row align-items-center justify-content-end\">\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)=\"imageChanged($event)\"\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: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ModelFormSubComponent, selector: "base-model-form-sub", inputs: ["fields", "form", "config"], outputs: ["imageChanged"] }] });
|
|
1144
1340
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ModelFormComponent, decorators: [{
|
|
1145
1341
|
type: Component,
|
|
1146
|
-
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
|
|
1147
|
-
}], 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: [{
|
|
1342
|
+
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 class=\"mb-0\">\n {{ label ? label : capitalizeFirstLetter(modelName) }} {{ operation === 'update' ? 'bearbeiten' : 'erstellen' }}\n </h2>\n\n <div class=\"d-flex flex-row align-items-center justify-content-end\">\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)=\"imageChanged($event)\"\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" }]
|
|
1343
|
+
}], 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 }, { type: i1$1.CmsService }]; }, propDecorators: { modelName: [{
|
|
1148
1344
|
type: Input
|
|
1149
1345
|
}], label: [{
|
|
1150
1346
|
type: Input
|
|
@@ -1163,9 +1359,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
1163
1359
|
}] } });
|
|
1164
1360
|
|
|
1165
1361
|
class ModelTableComponent {
|
|
1166
|
-
constructor(graphQLMetaService, graphQLService) {
|
|
1362
|
+
constructor(graphQLMetaService, graphQLService, cmsService) {
|
|
1167
1363
|
this.graphQLMetaService = graphQLMetaService;
|
|
1168
1364
|
this.graphQLService = graphQLService;
|
|
1365
|
+
this.cmsService = cmsService;
|
|
1169
1366
|
this.createMode = false;
|
|
1170
1367
|
this.logging = false;
|
|
1171
1368
|
this.create = true;
|
|
@@ -1174,6 +1371,7 @@ class ModelTableComponent {
|
|
|
1174
1371
|
this.duplicate = true;
|
|
1175
1372
|
this.config = {};
|
|
1176
1373
|
this.fieldConfig = {};
|
|
1374
|
+
this.uniqueField = 'id';
|
|
1177
1375
|
this.idSelected = new EventEmitter();
|
|
1178
1376
|
this.createModeChanged = new EventEmitter();
|
|
1179
1377
|
this.tableFields = {
|
|
@@ -1231,7 +1429,7 @@ class ModelTableComponent {
|
|
|
1231
1429
|
if ((_c = this.config) === null || _c === void 0 ? void 0 : _c.tableFields) {
|
|
1232
1430
|
this.tableFields = this.config.tableFields;
|
|
1233
1431
|
}
|
|
1234
|
-
const possibleFields = this.meta.getFields(this.queryName);
|
|
1432
|
+
const possibleFields = this.meta.getFields(this.queryName).fields;
|
|
1235
1433
|
const keys = Object.keys(possibleFields);
|
|
1236
1434
|
const tableFieldKeys = Object.keys(this.tableFields);
|
|
1237
1435
|
tableFieldKeys === null || tableFieldKeys === void 0 ? void 0 : tableFieldKeys.forEach((field) => {
|
|
@@ -1297,22 +1495,39 @@ class ModelTableComponent {
|
|
|
1297
1495
|
this.idSelected.emit(this.selectedId);
|
|
1298
1496
|
}
|
|
1299
1497
|
}
|
|
1498
|
+
/**
|
|
1499
|
+
* It calls the duplicateObject function in the cmsService, passing in the id of the object to be duplicated and the
|
|
1500
|
+
* modelName of the object
|
|
1501
|
+
*/
|
|
1502
|
+
duplicateObject(id) {
|
|
1503
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1504
|
+
yield this.cmsService.duplicateObject(id, this.modelName);
|
|
1505
|
+
this.loadObjects(this.availableFields);
|
|
1506
|
+
});
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* It calls the deleteObject function in the cmsService, passing in the id of the object to delete and the name of the
|
|
1510
|
+
* model
|
|
1511
|
+
*/
|
|
1512
|
+
deleteObject(id) {
|
|
1513
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1514
|
+
yield this.cmsService.deleteObject(id, this.modelName);
|
|
1515
|
+
this.loadObjects(this.availableFields);
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1300
1518
|
/**
|
|
1301
1519
|
* It takes a string, capitalizes the first letter, and returns the modified string
|
|
1302
|
-
*
|
|
1303
|
-
* @param value - The string to capitalize.
|
|
1304
|
-
* @returns The first letter of the string is being capitalized and the rest of the string is being returned.
|
|
1305
1520
|
*/
|
|
1306
1521
|
capitalizeFirstLetter(value) {
|
|
1307
|
-
return
|
|
1522
|
+
return this.cmsService.capitalizeFirstLetter(value);
|
|
1308
1523
|
}
|
|
1309
1524
|
}
|
|
1310
|
-
ModelTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ModelTableComponent, deps: [{ token: i1$1.GraphQLMetaService }, { token: i1$1.GraphQLService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1311
|
-
ModelTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", 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
|
|
1525
|
+
ModelTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ModelTableComponent, deps: [{ token: i1$1.GraphQLMetaService }, { token: i1$1.GraphQLService }, { token: i1$1.CmsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1526
|
+
ModelTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", 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 align-items-center mb-4\">\n <h2 class=\"mb-0\" *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\n <div\n class=\"table-responsive\"\n [ltContextMenu]=\"contextMenu\"\n [selectors]=\"'.object-col'\"\n #contextMenuData=\"contextMenuData\"\n >\n <table class=\"table table-hover bg-white\">\n <thead>\n <tr>\n <th\n scope=\"col\"\n *ngFor=\"let field of availableFields\"\n [baseSort]=\"objects\"\n data-order=\"desc\"\n [attr.data-name]=\"field\"\n >\n {{ tableFields[field]?.label ? tableFields[field]?.label : capitalizeFirstLetter(field) }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"object-col\" *ngFor=\"let object of objects\" [id]=\"object[uniqueField]\">\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\n <div class=\"context-menu\" #contextMenu>\n <div class=\"context-menu-item\" (click)=\"selectId({ id: contextMenuData.clickedElement?.id })\">Bearbeiten</div>\n <div class=\"context-menu-item\" *ngIf=\"duplicate\" (click)=\"duplicateObject(contextMenuData.clickedElement?.id)\">\n Duplizieren\n </div>\n <div class=\"context-menu-item\" *ngIf=\"delete\" (click)=\"deleteObject(contextMenuData.clickedElement?.id)\">\n L\u00F6schen\n </div>\n </div>\n </div>\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}.asc:after,.desc:after{border-style:solid;border-width:.2em .2em 0 0;content:\"\";display:inline-block;height:.45em;left:5px;position:relative;transform:rotate(-45deg);vertical-align:middle;width:.45em}.asc:after{transform:rotate(135deg)}td{vertical-align:middle}.bi,th{cursor:pointer;-webkit-user-select:none;user-select:none}.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}.context-menu{opacity:.01%;pointer-events:none;background-color:#fff;border:1px solid #ccc;box-shadow:1px 1px 10px #0000001a;padding:10px 0;position:fixed;top:0;left:0;width:200px}.context-menu-item{cursor:pointer;padding:8px 15px}.context-menu-item:hover{color:var(--bs-primary)}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: SortDirective, selector: "[baseSort]", inputs: ["baseSort"] }, { kind: "directive", type: ContextMenuDirective, selector: "[ltContextMenu]", inputs: ["contextMenuData", "ltContextMenu", "xGap", "yGap", "overflowSpace", "selectors"], outputs: ["clickedElement"], exportAs: ["contextMenuData"] }, { kind: "component", type: ModelFormComponent, selector: "base-model-form", inputs: ["modelName", "label", "id", "delete", "duplicate", "logging", "config"], outputs: ["finished"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }] });
|
|
1312
1527
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ModelTableComponent, decorators: [{
|
|
1313
1528
|
type: Component,
|
|
1314
|
-
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
|
|
1315
|
-
}], ctorParameters: function () { return [{ type: i1$1.GraphQLMetaService }, { type: i1$1.GraphQLService }]; }, propDecorators: { modelName: [{
|
|
1529
|
+
args: [{ selector: 'base-model-table', template: "<div *ngIf=\"!selectedId && !createMode\">\n <div class=\"w-100 d-flex flex-row justify-content-between align-items-center mb-4\">\n <h2 class=\"mb-0\" *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\n <div\n class=\"table-responsive\"\n [ltContextMenu]=\"contextMenu\"\n [selectors]=\"'.object-col'\"\n #contextMenuData=\"contextMenuData\"\n >\n <table class=\"table table-hover bg-white\">\n <thead>\n <tr>\n <th\n scope=\"col\"\n *ngFor=\"let field of availableFields\"\n [baseSort]=\"objects\"\n data-order=\"desc\"\n [attr.data-name]=\"field\"\n >\n {{ tableFields[field]?.label ? tableFields[field]?.label : capitalizeFirstLetter(field) }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"object-col\" *ngFor=\"let object of objects\" [id]=\"object[uniqueField]\">\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\n <div class=\"context-menu\" #contextMenu>\n <div class=\"context-menu-item\" (click)=\"selectId({ id: contextMenuData.clickedElement?.id })\">Bearbeiten</div>\n <div class=\"context-menu-item\" *ngIf=\"duplicate\" (click)=\"duplicateObject(contextMenuData.clickedElement?.id)\">\n Duplizieren\n </div>\n <div class=\"context-menu-item\" *ngIf=\"delete\" (click)=\"deleteObject(contextMenuData.clickedElement?.id)\">\n L\u00F6schen\n </div>\n </div>\n </div>\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}.asc:after,.desc:after{border-style:solid;border-width:.2em .2em 0 0;content:\"\";display:inline-block;height:.45em;left:5px;position:relative;transform:rotate(-45deg);vertical-align:middle;width:.45em}.asc:after{transform:rotate(135deg)}td{vertical-align:middle}.bi,th{cursor:pointer;-webkit-user-select:none;user-select:none}.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}.context-menu{opacity:.01%;pointer-events:none;background-color:#fff;border:1px solid #ccc;box-shadow:1px 1px 10px #0000001a;padding:10px 0;position:fixed;top:0;left:0;width:200px}.context-menu-item{cursor:pointer;padding:8px 15px}.context-menu-item:hover{color:var(--bs-primary)}\n"] }]
|
|
1530
|
+
}], ctorParameters: function () { return [{ type: i1$1.GraphQLMetaService }, { type: i1$1.GraphQLService }, { type: i1$1.CmsService }]; }, propDecorators: { modelName: [{
|
|
1316
1531
|
type: Input
|
|
1317
1532
|
}], objectId: [{
|
|
1318
1533
|
type: Input
|
|
@@ -1338,10 +1553,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
1338
1553
|
type: Output
|
|
1339
1554
|
}] } });
|
|
1340
1555
|
|
|
1556
|
+
class BackButtonDirective {
|
|
1557
|
+
constructor(navigation) {
|
|
1558
|
+
this.navigation = navigation;
|
|
1559
|
+
}
|
|
1560
|
+
onClick() {
|
|
1561
|
+
this.navigation.back();
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
BackButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: BackButtonDirective, deps: [{ token: i1$1.NavigationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1565
|
+
BackButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0", type: BackButtonDirective, selector: "[baseBackButton]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
1566
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: BackButtonDirective, decorators: [{
|
|
1567
|
+
type: Directive,
|
|
1568
|
+
args: [{
|
|
1569
|
+
selector: '[baseBackButton]',
|
|
1570
|
+
}]
|
|
1571
|
+
}], ctorParameters: function () { return [{ type: i1$1.NavigationService }]; }, propDecorators: { onClick: [{
|
|
1572
|
+
type: HostListener,
|
|
1573
|
+
args: ['click']
|
|
1574
|
+
}] } });
|
|
1575
|
+
|
|
1341
1576
|
// Modules
|
|
1342
1577
|
const imports = [FormsModule, ReactiveFormsModule, CommonModule];
|
|
1343
1578
|
// Imported and exported elements
|
|
1344
1579
|
const elements = [
|
|
1580
|
+
// Directives
|
|
1581
|
+
SortDirective,
|
|
1582
|
+
BackButtonDirective,
|
|
1583
|
+
ContextMenuDirective,
|
|
1345
1584
|
// Components
|
|
1346
1585
|
InputComponent,
|
|
1347
1586
|
SelectComponent,
|
|
@@ -1362,6 +1601,10 @@ class BaseComponentsModule {
|
|
|
1362
1601
|
}
|
|
1363
1602
|
BaseComponentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: BaseComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1364
1603
|
BaseComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0", ngImport: i0, type: BaseComponentsModule, declarations: [
|
|
1604
|
+
// Directives
|
|
1605
|
+
SortDirective,
|
|
1606
|
+
BackButtonDirective,
|
|
1607
|
+
ContextMenuDirective,
|
|
1365
1608
|
// Components
|
|
1366
1609
|
InputComponent,
|
|
1367
1610
|
SelectComponent,
|
|
@@ -1378,6 +1621,10 @@ BaseComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
|
|
|
1378
1621
|
UploadImageComponent,
|
|
1379
1622
|
RefenceInputComponent
|
|
1380
1623
|
], imports: [FormsModule, ReactiveFormsModule, CommonModule], exports: [
|
|
1624
|
+
// Directives
|
|
1625
|
+
SortDirective,
|
|
1626
|
+
BackButtonDirective,
|
|
1627
|
+
ContextMenuDirective,
|
|
1381
1628
|
// Components
|
|
1382
1629
|
InputComponent,
|
|
1383
1630
|
SelectComponent,
|
|
@@ -1412,5 +1659,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
1412
1659
|
* Generated bundle index. Do not edit.
|
|
1413
1660
|
*/
|
|
1414
1661
|
|
|
1415
|
-
export { BaseComponentsModule, BreadcrumbComponent, CheckboxComponent, InputComponent, LoadingBarComponent, ModelFormComponent, ModelFormSubComponent, ModelTableComponent, RefenceInputComponent, SelectComponent, SkeletonLoaderComponent, TagsComponent, TextareaComponent, ToastComponent, UploadImageComponent };
|
|
1662
|
+
export { BackButtonDirective, BaseComponentsModule, BreadcrumbComponent, CheckboxComponent, ContextMenuDirective, InputComponent, LoadingBarComponent, ModelFormComponent, ModelFormSubComponent, ModelTableComponent, RefenceInputComponent, SelectComponent, SkeletonLoaderComponent, SortDirective, TagsComponent, TextareaComponent, ToastComponent, UploadImageComponent };
|
|
1416
1663
|
//# sourceMappingURL=lenne.tech-ng-base-base-components.mjs.map
|