ichec-angular-core 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ichec-angular-core.mjs +344 -316
- package/fesm2022/ichec-angular-core.mjs.map +1 -1
- package/index.d.ts +98 -98
- package/package.json +1 -1
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import { map, catchError, tap, mergeMap, throwError, BehaviorSubject, mergeAll, of, merge, debounceTime, distinctUntilChanged, Subscription, finalize } from 'rxjs';
|
|
2
2
|
import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, inject, Injectable,
|
|
5
|
-
import * as i1$
|
|
4
|
+
import { InjectionToken, inject, Injectable, signal, input, Component, viewChild, computed, output } from '@angular/core';
|
|
5
|
+
import * as i1$2 from '@angular/forms';
|
|
6
6
|
import { FormControl, Validators, FormGroup, FormsModule, ReactiveFormsModule, FormBuilder } from '@angular/forms';
|
|
7
7
|
import * as i1 from '@angular/router';
|
|
8
8
|
import { RouterModule, RouterOutlet, Router, ActivatedRoute } from '@angular/router';
|
|
9
9
|
import * as i2 from '@angular/material/toolbar';
|
|
10
10
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
11
|
-
import * as
|
|
11
|
+
import * as i5 from '@angular/material/icon';
|
|
12
12
|
import { MatIconModule } from '@angular/material/icon';
|
|
13
13
|
import * as i2$1 from '@angular/material/button';
|
|
14
14
|
import { MatButtonModule } from '@angular/material/button';
|
|
15
|
-
import * as i5 from '@angular/material/menu';
|
|
15
|
+
import * as i5$1 from '@angular/material/menu';
|
|
16
16
|
import { MatMenuModule } from '@angular/material/menu';
|
|
17
|
-
import * as i1$
|
|
17
|
+
import * as i1$1 from '@angular/material/sidenav';
|
|
18
18
|
import { MatSidenavContent, MatSidenavModule } from '@angular/material/sidenav';
|
|
19
19
|
import * as i2$2 from '@angular/material/list';
|
|
20
20
|
import { MatListModule } from '@angular/material/list';
|
|
21
|
-
import { NgIf, Location,
|
|
21
|
+
import { NgIf, Location, TitleCasePipe, NgTemplateOutlet } from '@angular/common';
|
|
22
22
|
import * as i3 from '@angular/material/input';
|
|
23
23
|
import { MatInputModule } from '@angular/material/input';
|
|
24
|
-
import * as
|
|
24
|
+
import * as i4 from '@angular/material/form-field';
|
|
25
25
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
26
|
-
import * as i1$
|
|
26
|
+
import * as i1$3 from '@angular/material/card';
|
|
27
27
|
import { MatCardModule } from '@angular/material/card';
|
|
28
|
-
import * as i4 from '@angular/material/checkbox';
|
|
28
|
+
import * as i4$1 from '@angular/material/checkbox';
|
|
29
29
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
30
|
-
import * as i1$5 from '@angular/material/table';
|
|
31
|
-
import { MatTableModule, MatTable } from '@angular/material/table';
|
|
32
30
|
import * as i6 from '@angular/material/select';
|
|
33
31
|
import { MatSelectModule } from '@angular/material/select';
|
|
34
|
-
import * as
|
|
32
|
+
import * as i1$5 from '@angular/material/table';
|
|
33
|
+
import { MatTableModule, MatTable } from '@angular/material/table';
|
|
34
|
+
import * as i4$2 from '@angular/material/tooltip';
|
|
35
35
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
36
|
+
import * as i1$4 from '@angular/material/expansion';
|
|
37
|
+
import { MatExpansionModule } from '@angular/material/expansion';
|
|
36
38
|
import * as i6$1 from '@angular/material/autocomplete';
|
|
37
39
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
38
40
|
import * as i3$1 from '@angular/material/sort';
|
|
39
41
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
40
42
|
import * as i1$6 from '@angular/material/button-toggle';
|
|
41
43
|
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
42
|
-
import * as i2$
|
|
44
|
+
import * as i2$5 from '@angular/material/progress-spinner';
|
|
43
45
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
44
|
-
import * as i2$
|
|
46
|
+
import * as i2$3 from '@angular/material/paginator';
|
|
45
47
|
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
46
|
-
import * as i2$
|
|
48
|
+
import * as i2$4 from '@angular/cdk/scrolling';
|
|
47
49
|
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
48
50
|
import { DataSource } from '@angular/cdk/collections';
|
|
49
|
-
import * as i6$2 from '@angular/material/expansion';
|
|
50
|
-
import { MatExpansionModule } from '@angular/material/expansion';
|
|
51
51
|
import * as i7 from '@angular/material/tabs';
|
|
52
52
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
53
53
|
|
|
@@ -118,6 +118,16 @@ class ApiError {
|
|
|
118
118
|
text = "";
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
var FieldType;
|
|
122
|
+
(function (FieldType) {
|
|
123
|
+
FieldType[FieldType["Boolean"] = 0] = "Boolean";
|
|
124
|
+
FieldType[FieldType["Char"] = 1] = "Char";
|
|
125
|
+
FieldType[FieldType["Text"] = 2] = "Text";
|
|
126
|
+
FieldType[FieldType["RichText"] = 3] = "RichText";
|
|
127
|
+
FieldType[FieldType["Selection"] = 4] = "Selection";
|
|
128
|
+
FieldType[FieldType["Integer"] = 5] = "Integer";
|
|
129
|
+
FieldType[FieldType["File"] = 6] = "File";
|
|
130
|
+
})(FieldType || (FieldType = {}));
|
|
121
131
|
const FORM_FIELD_CHOICES = [{ value: "BOOLEAN", display_name: "Boolean" },
|
|
122
132
|
{ value: "CHAR", display_name: "Short Text" },
|
|
123
133
|
{ value: "TEXT", display_name: "Long Text" },
|
|
@@ -126,6 +136,23 @@ const FORM_FIELD_CHOICES = [{ value: "BOOLEAN", display_name: "Boolean" },
|
|
|
126
136
|
{ value: "INTEGER", display_name: "Integer" },
|
|
127
137
|
{ value: "FILE", display_name: "File" }
|
|
128
138
|
];
|
|
139
|
+
function getFieldTypeFromKey(key) {
|
|
140
|
+
switch (key) {
|
|
141
|
+
case "CHAR":
|
|
142
|
+
return FieldType.Char;
|
|
143
|
+
case "TEXT":
|
|
144
|
+
return FieldType.Text;
|
|
145
|
+
case "RICH_TEXT":
|
|
146
|
+
return FieldType.RichText;
|
|
147
|
+
case "SELECTION":
|
|
148
|
+
return FieldType.Selection;
|
|
149
|
+
case "INTEGER":
|
|
150
|
+
return FieldType.Integer;
|
|
151
|
+
case "FILE":
|
|
152
|
+
return FieldType.File;
|
|
153
|
+
}
|
|
154
|
+
return FieldType.Char;
|
|
155
|
+
}
|
|
129
156
|
|
|
130
157
|
const ENDPOINT_URL = new InjectionToken("Default endpoint url");
|
|
131
158
|
class RestService {
|
|
@@ -197,7 +224,16 @@ class RestService {
|
|
|
197
224
|
});
|
|
198
225
|
const form = new FormData();
|
|
199
226
|
form.append("file", file);
|
|
200
|
-
return this._http.post(this.getBaseUrl() + id + "/" + field, form, { headers: headers }).pipe(mergeMap(_ => this.getItem(id)), catchError(this.handleError));
|
|
227
|
+
return this._http.post(this.getBaseUrl() + id + "/" + field + "/upload", form, { headers: headers }).pipe(mergeMap(_ => this.getItem(id)), catchError(this.handleError));
|
|
228
|
+
}
|
|
229
|
+
putFile(id, field, file) {
|
|
230
|
+
const token = "Token " + localStorage.getItem("api_token");
|
|
231
|
+
const headers = new HttpHeaders({
|
|
232
|
+
'Authorization': token,
|
|
233
|
+
'Accept': 'application/json',
|
|
234
|
+
'Content-Disposition': 'attachment; filename=' + file.name
|
|
235
|
+
});
|
|
236
|
+
return this._http.put(this.getBaseUrl() + id + "/" + field + "/upload", file, { headers: headers }).pipe(mergeMap(_ => this.getItem(id)), catchError(this.handleError));
|
|
201
237
|
}
|
|
202
238
|
patchItem(item, include_keys, exclude_keys) {
|
|
203
239
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -413,6 +449,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
413
449
|
class AddressService extends ItemWithUserService {
|
|
414
450
|
_url = Address.plural;
|
|
415
451
|
typename = Address.typename;
|
|
452
|
+
countryOptions = signal([], ...(ngDevMode ? [{ debugName: "countryOptions" }] : []));
|
|
453
|
+
refreshCountryOptions() {
|
|
454
|
+
this.getOptions().subscribe(options => this.onOptions(options));
|
|
455
|
+
}
|
|
456
|
+
onOptions(options) {
|
|
457
|
+
if (!options.actions) {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
if ('POST' in options.actions) {
|
|
461
|
+
this.onPostActions(options.actions['POST']);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
onPostActions(actions) {
|
|
465
|
+
if ('country' in actions && actions['country'].choices) {
|
|
466
|
+
this.onCountryChoices(actions['country'].choices);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
onCountryChoices(choices) {
|
|
470
|
+
this.countryOptions.update(() => choices.map(c => { return { name: c.display_name, code: c.value, flag: "" }; }));
|
|
471
|
+
}
|
|
416
472
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: AddressService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
417
473
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: AddressService, providedIn: 'root' });
|
|
418
474
|
}
|
|
@@ -579,7 +635,7 @@ class TopBarComponent {
|
|
|
579
635
|
return "";
|
|
580
636
|
}
|
|
581
637
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: TopBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
582
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: TopBarComponent, isStandalone: true, selector: "lib-top-bar", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "\n@if(user(); as user){\n<mat-toolbar style=\"height:60px\">\n <a mat-icon-button aria-label=\"Home\" [routerLink]=\"['home']\">\n <mat-icon>home</mat-icon>\n </a>\n <span>{{title()}}</span>\n <span class=\"topbar-spacer\"></span>\n <span>{{user.username}}</span>\n \n <button mat-icon-button style=\"margin: 5px\" aria-label=\"User Profile\" [matMenuTriggerFor]=\"profile_menu\">\n <mat-icon>person</mat-icon>\n </button>\n\n <mat-menu #profile_menu=\"matMenu\">\n <a mat-menu-item aria-label=\"My Profile\" [routerLink]=\"['/members/detail', user.id]\">\n <mat-icon>manage_accounts</mat-icon>\n <span>My Profile</span>\n </a> \n <a mat-menu-item aria-label=\"Get Support\" [routerLink]=\"['/feedback']\">\n <mat-icon>contact_support</mat-icon>\n <span>Get Support</span>\n </a> \n <button mat-menu-item (click)=\"onLogout()\">\n <mat-icon>logout</mat-icon>\n <span>Log Out</span>\n </button>\n\n </mat-menu>\n</mat-toolbar>\n}\n", styles: [".topbar-spacer{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatToolbarModule }, { kind: "component", type: i2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type:
|
|
638
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: TopBarComponent, isStandalone: true, selector: "lib-top-bar", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "\n@if(user(); as user){\n<mat-toolbar style=\"height:60px\">\n <a mat-icon-button aria-label=\"Home\" [routerLink]=\"['home']\">\n <mat-icon>home</mat-icon>\n </a>\n <span>{{title()}}</span>\n <span class=\"topbar-spacer\"></span>\n <span>{{user.username}}</span>\n \n <button mat-icon-button style=\"margin: 5px\" aria-label=\"User Profile\" [matMenuTriggerFor]=\"profile_menu\">\n <mat-icon>person</mat-icon>\n </button>\n\n <mat-menu #profile_menu=\"matMenu\">\n <a mat-menu-item aria-label=\"My Profile\" [routerLink]=\"['/members/detail', user.id]\">\n <mat-icon>manage_accounts</mat-icon>\n <span>My Profile</span>\n </a> \n <a mat-menu-item aria-label=\"Get Support\" [routerLink]=\"['/feedback']\">\n <mat-icon>contact_support</mat-icon>\n <span>Get Support</span>\n </a> \n <button mat-menu-item (click)=\"onLogout()\">\n <mat-icon>logout</mat-icon>\n <span>Log Out</span>\n </button>\n\n </mat-menu>\n</mat-toolbar>\n}\n", styles: [".topbar-spacer{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatToolbarModule }, { kind: "component", type: i2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i5$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i5$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }] });
|
|
583
639
|
}
|
|
584
640
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: TopBarComponent, decorators: [{
|
|
585
641
|
type: Component,
|
|
@@ -597,7 +653,7 @@ class LeftNavComponent {
|
|
|
597
653
|
return this._leftNavService.activeOptions;
|
|
598
654
|
}
|
|
599
655
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: LeftNavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
600
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: LeftNavComponent, isStandalone: true, selector: "lib-left-nav", viewQueries: [{ propertyName: "sideNavContent", first: true, predicate: MatSidenavContent, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-sidenav-container class=\"leftnav-container\">\n <mat-sidenav mode=\"side\" class=\"leftnav-side\" opened>\n <mat-nav-list>\n @for (option of getOptions(); track option) {\n <a mat-list-item [routerLink]=\"option.route\" [routerLinkActive]=\"['is-active']\">{{ option.name }}</a>\n }\n </mat-nav-list>\n </mat-sidenav>\n <mat-sidenav-content class=\"leftnav-content\"> \n <router-outlet />\n </mat-sidenav-content>\n</mat-sidenav-container>\n", styles: [":host{display:flex;flex-direction:column}.leftnav-container{flex-grow:1;display:flex}.leftnav-content{display:flex;flex-grow:1;height:90vh}.leftnav-side{padding:5px;width:200px}.is-active{background-color:#d3d3d3}\n"], dependencies: [{ kind: "ngmodule", type: MatSidenavModule }, { kind: "component", type: i1$
|
|
656
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: LeftNavComponent, isStandalone: true, selector: "lib-left-nav", viewQueries: [{ propertyName: "sideNavContent", first: true, predicate: MatSidenavContent, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-sidenav-container class=\"leftnav-container\">\n <mat-sidenav mode=\"side\" class=\"leftnav-side\" opened>\n <mat-nav-list>\n @for (option of getOptions(); track option) {\n <a mat-list-item [routerLink]=\"option.route\" [routerLinkActive]=\"['is-active']\">{{ option.name }}</a>\n }\n </mat-nav-list>\n </mat-sidenav>\n <mat-sidenav-content class=\"leftnav-content\"> \n <router-outlet />\n </mat-sidenav-content>\n</mat-sidenav-container>\n", styles: [":host{display:flex;flex-direction:column}.leftnav-container{flex-grow:1;display:flex}.leftnav-content{display:flex;flex-grow:1;height:90vh}.leftnav-side{padding:5px;width:200px}.is-active{background-color:#d3d3d3}\n"], dependencies: [{ kind: "ngmodule", type: MatSidenavModule }, { kind: "component", type: i1$1.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { kind: "component", type: i1$1.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { kind: "component", type: i1$1.MatSidenavContent, selector: "mat-sidenav-content" }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i2$2.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i2$2.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }] });
|
|
601
657
|
}
|
|
602
658
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: LeftNavComponent, decorators: [{
|
|
603
659
|
type: Component,
|
|
@@ -640,7 +696,7 @@ class LandingComponent {
|
|
|
640
696
|
this.router.navigateByUrl("/home");
|
|
641
697
|
}
|
|
642
698
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: LandingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
643
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: LandingComponent, isStandalone: true, selector: "lib-landing", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "\n @if(message(); as message){\n <p>{{message}}</p>\n }\n \n <mat-card style=\"text-align:center;\">\n <form class=\"base-form\" #loginForm=\"ngForm\" (ngSubmit)=\"login()\">\n <mat-card-content>\n <mat-form-field class=\"form-field\">\n <input matInput\n placeholder=\"Username\"\n type=\"text\"\n [(ngModel)]=\"loginUser.name\"\n name=\"username\"\n required>\n </mat-form-field>\n <mat-form-field class=\"form-field\">\n <input matInput\n placeholder=\"Password\"\n type=\"password\"\n [(ngModel)]=\"loginUser.password\"\n name=\"password\"\n required>\n </mat-form-field>\n </mat-card-content>\n <div *ngIf=\"loginError\" class=\"error\">\n <mat-icon>error</mat-icon><p>{{loginError()}}</p>\n </div>\n <button mat-flat-button\n type=\"submit\"\n [disabled]=\"!loginForm.form.valid\">Log In</button>\n </form>\n </mat-card>\n\n\n \n", styles: [":host{display:flex;align-items:center;flex-grow:1;background-color:#a5b3c9;flex-direction:column}.base-form{padding:10px}.form-field{display:flex}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$
|
|
699
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: LandingComponent, isStandalone: true, selector: "lib-landing", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "\n @if(message(); as message){\n <p>{{message}}</p>\n }\n \n <mat-card style=\"text-align:center;\">\n <form class=\"base-form\" #loginForm=\"ngForm\" (ngSubmit)=\"login()\">\n <mat-card-content>\n <mat-form-field class=\"form-field\">\n <input matInput\n placeholder=\"Username\"\n type=\"text\"\n [(ngModel)]=\"loginUser.name\"\n name=\"username\"\n required>\n </mat-form-field>\n <mat-form-field class=\"form-field\">\n <input matInput\n placeholder=\"Password\"\n type=\"password\"\n [(ngModel)]=\"loginUser.password\"\n name=\"password\"\n required>\n </mat-form-field>\n </mat-card-content>\n <div *ngIf=\"loginError\" class=\"error\">\n <mat-icon>error</mat-icon><p>{{loginError()}}</p>\n </div>\n <button mat-flat-button\n type=\"submit\"\n [disabled]=\"!loginForm.form.valid\">Log In</button>\n </form>\n </mat-card>\n\n\n \n", styles: [":host{display:flex;align-items:center;flex-grow:1;background-color:#a5b3c9;flex-direction:column}.base-form{padding:10px}.form-field{display:flex}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1$3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$3.MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
644
700
|
}
|
|
645
701
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: LandingComponent, decorators: [{
|
|
646
702
|
type: Component,
|
|
@@ -714,11 +770,13 @@ class EditView {
|
|
|
714
770
|
createMode = signal(false, ...(ngDevMode ? [{ debugName: "createMode" }] : []));
|
|
715
771
|
heading = computed(() => { const prefix = this.createMode() ? "New " : "Edit "; return prefix + this.getTitle(); }, ...(ngDevMode ? [{ debugName: "heading" }] : []));
|
|
716
772
|
item = signal(null, ...(ngDevMode ? [{ debugName: "item" }] : []));
|
|
773
|
+
fileKeys = [];
|
|
717
774
|
_route = inject(ActivatedRoute);
|
|
718
775
|
_location = inject(Location);
|
|
719
776
|
_userService = inject(UserService);
|
|
720
777
|
form;
|
|
721
778
|
itemService;
|
|
779
|
+
uploadedFiles = [];
|
|
722
780
|
constructor(itemService, form) {
|
|
723
781
|
this.itemService = itemService;
|
|
724
782
|
this.form = form;
|
|
@@ -727,6 +785,7 @@ class EditView {
|
|
|
727
785
|
this.getItem();
|
|
728
786
|
}
|
|
729
787
|
onItemAvailable(item) {
|
|
788
|
+
this.form.setValue(item);
|
|
730
789
|
this._userService.loggedInUser.subscribe(user => { if (user) {
|
|
731
790
|
this.onItemAndUserAvailable(item, user);
|
|
732
791
|
} });
|
|
@@ -781,7 +840,32 @@ class EditView {
|
|
|
781
840
|
this.itemService.putItem(this.updateItem(item)).subscribe(item => this.saveFiles(item));
|
|
782
841
|
}
|
|
783
842
|
saveFiles(item) {
|
|
784
|
-
|
|
843
|
+
console.log("Saving files");
|
|
844
|
+
const next_file = this.getNextFileForUpload();
|
|
845
|
+
console.log("next is:", next_file);
|
|
846
|
+
if (next_file) {
|
|
847
|
+
this.saveFile(item, next_file);
|
|
848
|
+
}
|
|
849
|
+
else {
|
|
850
|
+
this.onItemUpdated(item);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
saveFile(item, record) {
|
|
854
|
+
this.uploadedFiles.push(record.name);
|
|
855
|
+
if (record.file) {
|
|
856
|
+
this.itemService.putFile(item.id, record.name, record.file).subscribe(item => this.saveFiles(item));
|
|
857
|
+
}
|
|
858
|
+
else {
|
|
859
|
+
this.saveFiles(item);
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
getNextFileForUpload() {
|
|
863
|
+
for (const key of this.fileKeys) {
|
|
864
|
+
if (!this.uploadedFiles.includes(key)) {
|
|
865
|
+
return this.form.form.get(key)?.value;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
return null;
|
|
785
869
|
}
|
|
786
870
|
isCreateRoute() {
|
|
787
871
|
const urls = this._route.snapshot.url;
|
|
@@ -809,6 +893,7 @@ class EditView {
|
|
|
809
893
|
}
|
|
810
894
|
}
|
|
811
895
|
onItemUpdated(item) {
|
|
896
|
+
this.uploadedFiles = [];
|
|
812
897
|
this.item.set(item);
|
|
813
898
|
this.goBack();
|
|
814
899
|
}
|
|
@@ -834,7 +919,7 @@ class FormFieldDetailComponent {
|
|
|
834
919
|
return this.field().id.toString();
|
|
835
920
|
}
|
|
836
921
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FormFieldDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
837
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: FormFieldDetailComponent, isStandalone: true, selector: "lib-form-field-detail", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div [formGroup]=\"form()\">\n <label [attr.for]=\"key\">{{ field().label }}</label>\n <div>\n @switch (field().field_type) {\n @case ('TEXT') {\n <mat-form-field class=\"form-field-wide\">\n <mat-label [attr.for]=\"key\">{{ field().label }}</mat-label>\n <textarea matInput\n [placeholder]=\"field().default\"\n type=\"text\"\n style=\"min-height:150px\"\n [formControlName]=\"key\"\n [name]=\"key\"></textarea>\n </mat-form-field>\n }\n @case('BOOLEAN')\n {\n <mat-checkbox\n class=\"form-field\"\n [name]=\"key\"\n [formControlName]=\"key\">\n {{ field().label }}\n </mat-checkbox>\n }\n @case ('INTEGER') {\n <mat-form-field class=\"form-field\">\n <mat-label>{{ field().label }}</mat-label>\n <input matInput\n [placeholder]=\"field().default\"\n type=\"number\"\n max=\"10\" min=\"1\"\n [formControlName]=\"key\"\n name=\"trl_stage\">\n </mat-form-field>\n }\n }\n </div>\n @if (!isValid) {\n <div class=\"errorMessage\">{{ field().label }} is required</div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$
|
|
922
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: FormFieldDetailComponent, isStandalone: true, selector: "lib-form-field-detail", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div [formGroup]=\"form()\">\n <label [attr.for]=\"key\">{{ field().label }}</label>\n <div>\n @switch (field().field_type) {\n @case ('TEXT') {\n <mat-form-field class=\"form-field-wide\">\n <mat-label [attr.for]=\"key\">{{ field().label }}</mat-label>\n <textarea matInput\n [placeholder]=\"field().default\"\n type=\"text\"\n style=\"min-height:150px\"\n [formControlName]=\"key\"\n [name]=\"key\"></textarea>\n </mat-form-field>\n }\n @case('BOOLEAN')\n {\n <mat-checkbox\n class=\"form-field\"\n [name]=\"key\"\n [formControlName]=\"key\">\n {{ field().label }}\n </mat-checkbox>\n }\n @case ('INTEGER') {\n <mat-form-field class=\"form-field\">\n <mat-label>{{ field().label }}</mat-label>\n <input matInput\n [placeholder]=\"field().default\"\n type=\"number\"\n max=\"10\" min=\"1\"\n [formControlName]=\"key\"\n name=\"trl_stage\">\n </mat-form-field>\n }\n }\n </div>\n @if (!isValid) {\n <div class=\"errorMessage\">{{ field().label }} is required</div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.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$2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1$2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }] });
|
|
838
923
|
}
|
|
839
924
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FormFieldDetailComponent, decorators: [{
|
|
840
925
|
type: Component,
|
|
@@ -844,102 +929,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
844
929
|
MatCheckboxModule], template: "<div [formGroup]=\"form()\">\n <label [attr.for]=\"key\">{{ field().label }}</label>\n <div>\n @switch (field().field_type) {\n @case ('TEXT') {\n <mat-form-field class=\"form-field-wide\">\n <mat-label [attr.for]=\"key\">{{ field().label }}</mat-label>\n <textarea matInput\n [placeholder]=\"field().default\"\n type=\"text\"\n style=\"min-height:150px\"\n [formControlName]=\"key\"\n [name]=\"key\"></textarea>\n </mat-form-field>\n }\n @case('BOOLEAN')\n {\n <mat-checkbox\n class=\"form-field\"\n [name]=\"key\"\n [formControlName]=\"key\">\n {{ field().label }}\n </mat-checkbox>\n }\n @case ('INTEGER') {\n <mat-form-field class=\"form-field\">\n <mat-label>{{ field().label }}</mat-label>\n <input matInput\n [placeholder]=\"field().default\"\n type=\"number\"\n max=\"10\" min=\"1\"\n [formControlName]=\"key\"\n name=\"trl_stage\">\n </mat-form-field>\n }\n }\n </div>\n @if (!isValid) {\n <div class=\"errorMessage\">{{ field().label }} is required</div>\n }\n</div>\n" }]
|
|
845
930
|
}] });
|
|
846
931
|
|
|
847
|
-
const FORM_FIELD_TABLE_FULL = [
|
|
848
|
-
{ name: 'label', title: 'Label', element_type: 'string' },
|
|
849
|
-
{ name: 'field_type', title: 'Type', element_type: 'string' }
|
|
850
|
-
];
|
|
851
|
-
const FORM_GROUP_TABLE_FULL = [
|
|
852
|
-
{ name: 'label', title: 'Label', element_type: 'string' }
|
|
853
|
-
];
|
|
854
|
-
|
|
855
|
-
class FormFieldListComponent {
|
|
856
|
-
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
857
|
-
edit = output();
|
|
858
|
-
columns = FORM_FIELD_TABLE_FULL;
|
|
859
|
-
columnNames = computed(() => { const names = this.columns.map(c => c.name); names.push("edit"); return names; }, ...(ngDevMode ? [{ debugName: "columnNames" }] : []));
|
|
860
|
-
onEdit(id) {
|
|
861
|
-
this.edit.emit(id);
|
|
862
|
-
}
|
|
863
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FormFieldListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
864
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: FormFieldListComponent, isStandalone: true, selector: "lib-form-field-list", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { edit: "edit" }, ngImport: i0, template: "<table mat-table [dataSource]=\"form().controls\" class=\"mat-elevation-z8\">\n @for (column of columns; track column.name) {\n <ng-container matColumnDef=\"{{ column.name }}\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>\n {{ column.title }}\n </th>\n <td mat-cell *matCellDef=\"let element\">{{ element.value[column.name] }}</td>\n </ng-container>\n }\n\n <ng-container matColumnDef=\"edit\">\n <th mat-header-cell *matHeaderCellDef>Edit\n </th>\n <td mat-cell *matCellDef=\"let idx = index\">\n <button mat-icon-button\n type=\"button\"\n color=\"primary\"\n aria-label=\"Edit an item\"\n (click)=\"onEdit(idx)\">\n <mat-icon>edit\n </mat-icon>\n </button>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnNames()\">\n </tr>\n <tr mat-row *matRowDef=\"let row; columns: columnNames();\">\n </tr>\n</table>\n\n\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$5.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i1$5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
865
|
-
}
|
|
866
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FormFieldListComponent, decorators: [{
|
|
867
|
-
type: Component,
|
|
868
|
-
args: [{ selector: 'lib-form-field-list', imports: [MatTableModule, MatButtonModule, MatIconModule], template: "<table mat-table [dataSource]=\"form().controls\" class=\"mat-elevation-z8\">\n @for (column of columns; track column.name) {\n <ng-container matColumnDef=\"{{ column.name }}\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>\n {{ column.title }}\n </th>\n <td mat-cell *matCellDef=\"let element\">{{ element.value[column.name] }}</td>\n </ng-container>\n }\n\n <ng-container matColumnDef=\"edit\">\n <th mat-header-cell *matHeaderCellDef>Edit\n </th>\n <td mat-cell *matCellDef=\"let idx = index\">\n <button mat-icon-button\n type=\"button\"\n color=\"primary\"\n aria-label=\"Edit an item\"\n (click)=\"onEdit(idx)\">\n <mat-icon>edit\n </mat-icon>\n </button>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnNames()\">\n </tr>\n <tr mat-row *matRowDef=\"let row; columns: columnNames();\">\n </tr>\n</table>\n\n\n" }]
|
|
869
|
-
}] });
|
|
870
|
-
|
|
871
932
|
class FileUploadComponent {
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
fileUploaded = output();
|
|
875
|
-
clearLocal = output();
|
|
876
|
-
onPreviewRead(name, content) {
|
|
877
|
-
this.previewLoaded.emit({ name: name, content: content });
|
|
878
|
-
}
|
|
879
|
-
onFileUpload(name, event) {
|
|
933
|
+
control = input.required(...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
934
|
+
onFileUpload(event) {
|
|
880
935
|
if (!event.target) {
|
|
881
936
|
return;
|
|
882
937
|
}
|
|
883
938
|
const input_element = event.target;
|
|
884
939
|
if (input_element.files && input_element.files.length > 0) {
|
|
885
|
-
|
|
886
|
-
this.fileUploaded.emit({ name: name, file: file });
|
|
887
|
-
const record = this.files().find(f => f.name == name);
|
|
888
|
-
if (record && record.file_type == "image") {
|
|
889
|
-
this.readFile(name, file);
|
|
890
|
-
}
|
|
940
|
+
this.onFileUploaded(input_element.files[0]);
|
|
891
941
|
}
|
|
892
942
|
}
|
|
893
|
-
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
943
|
+
onFileUploaded(file) {
|
|
944
|
+
const record = this.control().value;
|
|
945
|
+
record.file = file;
|
|
946
|
+
this.control().setValue(record);
|
|
947
|
+
if (record.file_type == "image") {
|
|
948
|
+
const reader = new FileReader();
|
|
949
|
+
reader.readAsDataURL(file);
|
|
950
|
+
reader.onload = () => { if (reader.result) {
|
|
951
|
+
this.onPreviewLoaded(reader.result);
|
|
952
|
+
} ; };
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
onPreviewLoaded(preview) {
|
|
956
|
+
const record = this.control().value;
|
|
957
|
+
record.local = preview;
|
|
958
|
+
this.control().setValue(record);
|
|
902
959
|
}
|
|
903
960
|
onClearLocal() {
|
|
904
|
-
this.
|
|
961
|
+
const record = this.control().value;
|
|
962
|
+
record.local = "";
|
|
963
|
+
this.control().setValue(record);
|
|
905
964
|
}
|
|
906
965
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
907
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: FileUploadComponent, isStandalone: true, selector: "lib-file-upload", inputs: {
|
|
966
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: FileUploadComponent, isStandalone: true, selector: "lib-file-upload", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"container\">\n @if (control().value.local)\n {\n <div class=\"image_holder\">\n <p>Update {{control().value.display_name | titlecase}}</p>\n <div style=\"display:flex; flex-direction:row; justify-content: center; align-content: center;\">\n <img alt=\"{{control().value.display_name}}\" src=\"{{control().value.local}}\" style=\"height:120px;\">\n\n <button mat-mini-fab (click)=\"onClearLocal()\" matTooltip=\"Clear\" type=\"button\" style=\"margin:10px\">\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n </div>\n }\n @else\n {\n @if (control().value.remote){\n <div class=\"image_holder\">\n <p>Update {{control().value.display_name | titlecase}}</p>\n <img alt=\"{{control().value.display_name}}\" src=\"{{control().value.remote}}\" style=\"height:120px;\">\n </div>\n }\n @else {\n <div>\n <span>Upload a {{control().value.display_name}}</span>\n </div>\n }\n <div class=\"button-row\">\n <button mat-mini-fab (click)=\"fileInput.click()\" matTooltip=\"Attach\" type=\"button\" style=\"margin:10px\">\n <mat-icon>attachment</mat-icon>\n </button>\n <input hidden type=\"file\" #fileInput (change)=\"onFileUpload($event)\" />\n </div>\n }\n</div>", styles: [".container{padding:10px;display:flex;justify-content:center;text-align:center;flex-direction:column;max-width:300px}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }] });
|
|
908
967
|
}
|
|
909
968
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FileUploadComponent, decorators: [{
|
|
910
969
|
type: Component,
|
|
911
|
-
args: [{ selector: 'lib-file-upload', imports: [MatIconModule, MatButtonModule], template: "<div class=\"container\">\n @
|
|
970
|
+
args: [{ selector: 'lib-file-upload', imports: [MatIconModule, MatButtonModule, MatTooltipModule, TitleCasePipe], template: "<div class=\"container\">\n @if (control().value.local)\n {\n <div class=\"image_holder\">\n <p>Update {{control().value.display_name | titlecase}}</p>\n <div style=\"display:flex; flex-direction:row; justify-content: center; align-content: center;\">\n <img alt=\"{{control().value.display_name}}\" src=\"{{control().value.local}}\" style=\"height:120px;\">\n\n <button mat-mini-fab (click)=\"onClearLocal()\" matTooltip=\"Clear\" type=\"button\" style=\"margin:10px\">\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n </div>\n }\n @else\n {\n @if (control().value.remote){\n <div class=\"image_holder\">\n <p>Update {{control().value.display_name | titlecase}}</p>\n <img alt=\"{{control().value.display_name}}\" src=\"{{control().value.remote}}\" style=\"height:120px;\">\n </div>\n }\n @else {\n <div>\n <span>Upload a {{control().value.display_name}}</span>\n </div>\n }\n <div class=\"button-row\">\n <button mat-mini-fab (click)=\"fileInput.click()\" matTooltip=\"Attach\" type=\"button\" style=\"margin:10px\">\n <mat-icon>attachment</mat-icon>\n </button>\n <input hidden type=\"file\" #fileInput (change)=\"onFileUpload($event)\" />\n </div>\n }\n</div>", styles: [".container{padding:10px;display:flex;justify-content:center;text-align:center;flex-direction:column;max-width:300px}\n"] }]
|
|
912
971
|
}] });
|
|
913
972
|
|
|
914
973
|
class FormFieldEditComponent {
|
|
915
974
|
availableTypes = FORM_FIELD_CHOICES;
|
|
975
|
+
FieldType = FieldType;
|
|
916
976
|
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
917
977
|
editMode = input(false, ...(ngDevMode ? [{ debugName: "editMode" }] : []));
|
|
918
978
|
submitted = output();
|
|
919
979
|
cancelled = output();
|
|
920
|
-
get
|
|
921
|
-
return this.
|
|
922
|
-
}
|
|
923
|
-
get isShortText() {
|
|
924
|
-
return this.fieldType === "CHAR";
|
|
925
|
-
}
|
|
926
|
-
get isLongText() {
|
|
927
|
-
return this.fieldType === "TEXT";
|
|
928
|
-
}
|
|
929
|
-
get isRichText() {
|
|
930
|
-
return this.fieldType === "RICH_TEXT";
|
|
931
|
-
}
|
|
932
|
-
get isSelection() {
|
|
933
|
-
return this.fieldType === "SELECTION";
|
|
934
|
-
}
|
|
935
|
-
get isInteger() {
|
|
936
|
-
return this.fieldType === "INTEGER";
|
|
937
|
-
}
|
|
938
|
-
get isFile() {
|
|
939
|
-
return this.fieldType === "FILE";
|
|
980
|
+
get templateControl() {
|
|
981
|
+
return this.form().get('template');
|
|
940
982
|
}
|
|
941
983
|
get fieldType() {
|
|
942
|
-
return this.form().value.field_type;
|
|
984
|
+
return getFieldTypeFromKey(this.form().value.field_type);
|
|
943
985
|
}
|
|
944
986
|
submit() {
|
|
945
987
|
this.submitted.emit();
|
|
@@ -948,7 +990,7 @@ class FormFieldEditComponent {
|
|
|
948
990
|
this.cancelled.emit();
|
|
949
991
|
}
|
|
950
992
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FormFieldEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
951
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: FormFieldEditComponent, isStandalone: true, selector: "lib-form-field-edit", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, editMode: { classPropertyName: "editMode", publicName: "editMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted", cancelled: "cancelled" }, ngImport: i0, template: "<form class=\"form-card\" id=\"app-field-form\" [formGroup]=\"form()\" (ngSubmit)=\"submit()\">\n <mat-form-field class=\"form-field\">\n
|
|
993
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: FormFieldEditComponent, isStandalone: true, selector: "lib-form-field-edit", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, editMode: { classPropertyName: "editMode", publicName: "editMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted", cancelled: "cancelled" }, ngImport: i0, template: "<form class=\"form-card\" id=\"app-field-form\" [formGroup]=\"form()\" (ngSubmit)=\"submit()\">\n <mat-form-field class=\"form-field\">\n <mat-label>Label</mat-label>\n <input matInput placeholder=\"Label\" type=\"text\" formControlName=\"label\" required name=\"label\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label>Key</mat-label>\n <input matInput placeholder=\"Key\" type=\"text\" formControlName=\"key\" required name=\"key\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field-wide\">\n <mat-label>Description</mat-label>\n <textarea matInput placeholder=\"Description\" style=\"min-height:150px\" type=\"text\" formControlName=\"description\"\n required name=\"description\"></textarea>\n </mat-form-field>\n\n <mat-checkbox class=\"example-margin\" formControlName=\"required\">Required?</mat-checkbox>\n\n <mat-form-field class=\"form-field\">\n <mat-label>Type</mat-label>\n <mat-select formControlName=\"field_type\" name=\"field_type\" required>\n @for(type of availableTypes; track type.value){\n <mat-option [value]=\"type.value\">{{type.display_name}}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n @switch (fieldType) {\n @case(FieldType.Boolean)\n {\n <mat-form-field class=\"form-field\">\n <mat-label>Default</mat-label>\n <mat-select formControlName=\"default\" name=\"default\" required>\n <mat-option [value]=\"'true'\">True</mat-option>\n <mat-option [value]=\"'false'\">False</mat-option>\n </mat-select>\n </mat-form-field>\n }\n @case(FieldType.Char)\n {\n <mat-form-field class=\"form-field\">\n <mat-label>Default</mat-label>\n <input matInput placeholder=\"Default\" type=\"text\" formControlName=\"default\" name=\"default\">\n </mat-form-field>\n }\n @case(FieldType.Text || FieldType.RichText)\n {\n <mat-form-field class=\"form-field-wide\">\n <mat-label>Default</mat-label>\n <textarea matInput placeholder=\"Default\" style=\"min-height:150px\" type=\"text\" formControlName=\"default\"\n name=\"default\"></textarea>\n </mat-form-field>\n }\n @case(FieldType.File)\n {\n <lib-file-upload [control]=\"templateControl\"></lib-file-upload>\n }\n}\n\n <div>\n @if(!editMode()) {\n <button mat-fab class=\"form-action-button\" type=\"submit\" matTooltip=\"Add Field\"\n [disabled]=\"!form().valid\">\n <mat-icon>add</mat-icon>\n </button>\n <button mat-fab class=\"form-action-button\" (click)=\"cancel()\" type=\"button\" matTooltip=\"Cancel\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\n </div>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "ngmodule", type: MatTableModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i6.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: FileUploadComponent, selector: "lib-file-upload", inputs: ["control"] }] });
|
|
952
994
|
}
|
|
953
995
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FormFieldEditComponent, decorators: [{
|
|
954
996
|
type: Component,
|
|
@@ -963,7 +1005,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
963
1005
|
MatSelectModule,
|
|
964
1006
|
MatTooltipModule,
|
|
965
1007
|
MatCheckboxModule,
|
|
966
|
-
FileUploadComponent], template: "<form class=\"form-card\" id=\"app-field-form\" [formGroup]=\"form()\" (ngSubmit)=\"submit()\">\n <mat-form-field class=\"form-field\">\n
|
|
1008
|
+
FileUploadComponent], template: "<form class=\"form-card\" id=\"app-field-form\" [formGroup]=\"form()\" (ngSubmit)=\"submit()\">\n <mat-form-field class=\"form-field\">\n <mat-label>Label</mat-label>\n <input matInput placeholder=\"Label\" type=\"text\" formControlName=\"label\" required name=\"label\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label>Key</mat-label>\n <input matInput placeholder=\"Key\" type=\"text\" formControlName=\"key\" required name=\"key\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field-wide\">\n <mat-label>Description</mat-label>\n <textarea matInput placeholder=\"Description\" style=\"min-height:150px\" type=\"text\" formControlName=\"description\"\n required name=\"description\"></textarea>\n </mat-form-field>\n\n <mat-checkbox class=\"example-margin\" formControlName=\"required\">Required?</mat-checkbox>\n\n <mat-form-field class=\"form-field\">\n <mat-label>Type</mat-label>\n <mat-select formControlName=\"field_type\" name=\"field_type\" required>\n @for(type of availableTypes; track type.value){\n <mat-option [value]=\"type.value\">{{type.display_name}}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n @switch (fieldType) {\n @case(FieldType.Boolean)\n {\n <mat-form-field class=\"form-field\">\n <mat-label>Default</mat-label>\n <mat-select formControlName=\"default\" name=\"default\" required>\n <mat-option [value]=\"'true'\">True</mat-option>\n <mat-option [value]=\"'false'\">False</mat-option>\n </mat-select>\n </mat-form-field>\n }\n @case(FieldType.Char)\n {\n <mat-form-field class=\"form-field\">\n <mat-label>Default</mat-label>\n <input matInput placeholder=\"Default\" type=\"text\" formControlName=\"default\" name=\"default\">\n </mat-form-field>\n }\n @case(FieldType.Text || FieldType.RichText)\n {\n <mat-form-field class=\"form-field-wide\">\n <mat-label>Default</mat-label>\n <textarea matInput placeholder=\"Default\" style=\"min-height:150px\" type=\"text\" formControlName=\"default\"\n name=\"default\"></textarea>\n </mat-form-field>\n }\n @case(FieldType.File)\n {\n <lib-file-upload [control]=\"templateControl\"></lib-file-upload>\n }\n}\n\n <div>\n @if(!editMode()) {\n <button mat-fab class=\"form-action-button\" type=\"submit\" matTooltip=\"Add Field\"\n [disabled]=\"!form().valid\">\n <mat-icon>add</mat-icon>\n </button>\n <button mat-fab class=\"form-action-button\" (click)=\"cancel()\" type=\"button\" matTooltip=\"Cancel\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\n </div>\n</form>" }]
|
|
967
1009
|
}] });
|
|
968
1010
|
|
|
969
1011
|
class DynamicFormComponent {
|
|
@@ -975,7 +1017,7 @@ class DynamicFormComponent {
|
|
|
975
1017
|
this.payLoad = JSON.stringify(this.form().getRawValue());
|
|
976
1018
|
}
|
|
977
1019
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: DynamicFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
978
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: DynamicFormComponent, isStandalone: true, selector: "lib-dynamic-form", inputs: { inputForm: { classPropertyName: "inputForm", publicName: "inputForm", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div>\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"form()\">\n\n @for (group of inputForm().groups; track group.order) {\n\n @if(group.label)\n {\n <h3>{{group.label}}</h3>\n }\n\n @if(group.description){\n <p>{{group.description}}</p>\n }\n\n @for (field of group.fields; track field.order) {\n <div class=\"form-row\">\n <lib-form-field-detail [field]=\"field\" [form]=\"form()\" />\n </div>\n }\n }\n </form>\n</div>", styles: [""], dependencies: [{ kind: "component", type: FormFieldDetailComponent, selector: "lib-form-field-detail", inputs: ["field", "form"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$
|
|
1020
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: DynamicFormComponent, isStandalone: true, selector: "lib-dynamic-form", inputs: { inputForm: { classPropertyName: "inputForm", publicName: "inputForm", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div>\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"form()\">\n\n @for (group of inputForm().groups; track group.order) {\n\n @if(group.label)\n {\n <h3>{{group.label}}</h3>\n }\n\n @if(group.description){\n <p>{{group.description}}</p>\n }\n\n @for (field of group.fields; track field.order) {\n <div class=\"form-row\">\n <lib-form-field-detail [field]=\"field\" [form]=\"form()\" />\n </div>\n }\n }\n </form>\n</div>", styles: [""], dependencies: [{ kind: "component", type: FormFieldDetailComponent, selector: "lib-form-field-detail", inputs: ["field", "form"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
979
1021
|
}
|
|
980
1022
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: DynamicFormComponent, decorators: [{
|
|
981
1023
|
type: Component,
|
|
@@ -983,12 +1025,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
983
1025
|
}] });
|
|
984
1026
|
|
|
985
1027
|
class FormFieldForm {
|
|
1028
|
+
static getBaseTemplate() {
|
|
1029
|
+
return { name: "template", display_name: "template", file_type: "", remote: "", local: "", file: null };
|
|
1030
|
+
}
|
|
986
1031
|
static createForm(fb) {
|
|
987
1032
|
return fb.group({
|
|
988
1033
|
label: fb.control('', Validators.required),
|
|
1034
|
+
key: fb.control('', Validators.required),
|
|
989
1035
|
required: fb.control(false, Validators.required),
|
|
990
1036
|
description: fb.control('', Validators.required),
|
|
991
|
-
template: fb.control(
|
|
1037
|
+
template: fb.control(this.getBaseTemplate()),
|
|
992
1038
|
options: fb.control(null),
|
|
993
1039
|
default: fb.control(''),
|
|
994
1040
|
field_type: fb.control("BOOLEAN", Validators.required),
|
|
@@ -1006,11 +1052,16 @@ class FormFieldForm {
|
|
|
1006
1052
|
if ('id' in item) {
|
|
1007
1053
|
id = item.id;
|
|
1008
1054
|
}
|
|
1055
|
+
const template = this.getBaseTemplate();
|
|
1056
|
+
if (item.template) {
|
|
1057
|
+
template.remote = item.template;
|
|
1058
|
+
}
|
|
1009
1059
|
form.setValue({
|
|
1010
1060
|
label: item.label,
|
|
1061
|
+
key: item.key,
|
|
1011
1062
|
required: item.required,
|
|
1012
1063
|
description: item.description,
|
|
1013
|
-
template:
|
|
1064
|
+
template: template,
|
|
1014
1065
|
options: "",
|
|
1015
1066
|
default: item.default,
|
|
1016
1067
|
field_type: item.field_type,
|
|
@@ -1022,9 +1073,9 @@ class FormFieldForm {
|
|
|
1022
1073
|
const value = form.value;
|
|
1023
1074
|
return {
|
|
1024
1075
|
label: value.label || "",
|
|
1076
|
+
key: value.key || "",
|
|
1025
1077
|
required: value.required || false,
|
|
1026
1078
|
description: value.description || "",
|
|
1027
|
-
template: value.template || null,
|
|
1028
1079
|
options: null,
|
|
1029
1080
|
default: value.default || "",
|
|
1030
1081
|
field_type: value.field_type || "BOOLEAN",
|
|
@@ -1034,9 +1085,9 @@ class FormFieldForm {
|
|
|
1034
1085
|
static updateItem(form, item) {
|
|
1035
1086
|
const value = form.value;
|
|
1036
1087
|
item.label = value.label || "";
|
|
1088
|
+
item.key = value.key || "";
|
|
1037
1089
|
item.required = value.required || false;
|
|
1038
1090
|
item.description = value.description || "";
|
|
1039
|
-
item.template = value.template || null;
|
|
1040
1091
|
item.options = null;
|
|
1041
1092
|
item.default = value.default || "";
|
|
1042
1093
|
item.field_type = value.field_type || "BOOLEAN";
|
|
@@ -1063,6 +1114,14 @@ class FormGroupForm {
|
|
|
1063
1114
|
static deleteField(form, id) {
|
|
1064
1115
|
this.getFields(form).removeAt(id);
|
|
1065
1116
|
}
|
|
1117
|
+
static reorderField(group, id, newIndex) {
|
|
1118
|
+
const current_field = this.getFields(group).at(id);
|
|
1119
|
+
current_field.patchValue({ "order": newIndex });
|
|
1120
|
+
const swap_field = this.getFields(group).at(newIndex);
|
|
1121
|
+
swap_field.patchValue({ "order": id });
|
|
1122
|
+
this.getFields(group).removeAt(id);
|
|
1123
|
+
this.getFields(group).insert(newIndex, current_field);
|
|
1124
|
+
}
|
|
1066
1125
|
static fromItem(item, fb) {
|
|
1067
1126
|
const form = this.createForm(fb);
|
|
1068
1127
|
this.setValue(form, item, fb);
|
|
@@ -1124,161 +1183,116 @@ class FormGroupForm {
|
|
|
1124
1183
|
}
|
|
1125
1184
|
|
|
1126
1185
|
class FormGroupEditComponent {
|
|
1127
|
-
create = input(false, ...(ngDevMode ? [{ debugName: "create" }] : []));
|
|
1128
1186
|
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
1129
|
-
|
|
1187
|
+
editMode = input(false, ...(ngDevMode ? [{ debugName: "editMode" }] : []));
|
|
1130
1188
|
submitted = output();
|
|
1131
|
-
|
|
1132
|
-
|
|
1189
|
+
cancelled = output();
|
|
1190
|
+
fb = inject(FormBuilder);
|
|
1133
1191
|
fieldForm = null;
|
|
1134
|
-
builder = inject(FormBuilder);
|
|
1135
1192
|
get fields() {
|
|
1136
1193
|
return this.form().get('fields');
|
|
1137
1194
|
}
|
|
1138
|
-
|
|
1139
|
-
this.
|
|
1195
|
+
onFieldDelete(id) {
|
|
1196
|
+
FormGroupForm.deleteField(this.form(), id);
|
|
1140
1197
|
}
|
|
1141
|
-
|
|
1142
|
-
this.
|
|
1198
|
+
onFieldOrderUp(id) {
|
|
1199
|
+
FormGroupForm.reorderField(this.form(), id, id + 1);
|
|
1143
1200
|
}
|
|
1144
|
-
|
|
1145
|
-
this.
|
|
1146
|
-
this.fieldForm = FormFieldForm.createForm(this.builder);
|
|
1201
|
+
onFieldOrderDown(id) {
|
|
1202
|
+
FormGroupForm.reorderField(this.form(), id, id - 1);
|
|
1147
1203
|
}
|
|
1148
|
-
|
|
1149
|
-
this.
|
|
1150
|
-
this.fieldForm = this.fields.controls[this.editingField()];
|
|
1204
|
+
addField() {
|
|
1205
|
+
this.fieldForm = FormFieldForm.createForm(this.fb);
|
|
1151
1206
|
}
|
|
1152
1207
|
cancelField() {
|
|
1153
|
-
this.resetField();
|
|
1154
|
-
}
|
|
1155
|
-
resetField() {
|
|
1156
|
-
this.creatingField.set(false);
|
|
1157
1208
|
this.fieldForm = null;
|
|
1158
|
-
this.editingField.set(-1);
|
|
1159
1209
|
}
|
|
1160
1210
|
submitField() {
|
|
1161
|
-
if (this.
|
|
1211
|
+
if (this.fieldForm) {
|
|
1162
1212
|
FormGroupForm.createField(this.form(), this.fieldForm);
|
|
1163
1213
|
}
|
|
1164
|
-
this.
|
|
1214
|
+
this.fieldForm = null;
|
|
1215
|
+
}
|
|
1216
|
+
cancel() {
|
|
1217
|
+
this.cancelled.emit();
|
|
1218
|
+
}
|
|
1219
|
+
submit() {
|
|
1220
|
+
this.submitted.emit();
|
|
1165
1221
|
}
|
|
1166
1222
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FormGroupEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1167
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: FormGroupEditComponent, isStandalone: true, selector: "lib-form-group-edit", inputs: {
|
|
1223
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: FormGroupEditComponent, isStandalone: true, selector: "lib-form-group-edit", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, editMode: { classPropertyName: "editMode", publicName: "editMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted", cancelled: "cancelled" }, ngImport: i0, template: "<form class=\"form-card\" style=\"width:100%\" [formGroup]=\"form()\" (ngSubmit)=\"submit()\">\n\n <mat-form-field class=\"form-field\">\n <mat-label for=\"label\">Label</mat-label>\n <input matInput placeholder=\"\" type=\"text\" formControlName=\"label\"\n name=\"label\"/>\n </mat-form-field> \n\n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"description\">Description</mat-label>\n <textarea matInput placeholder=\"\" type=\"text\" style=\"min-height:150px\" formControlName=\"description\"\n name=\"description\"></textarea>\n </mat-form-field>\n\n <h3>Fields</h3>\n @if(fieldForm){\n <lib-form-field-edit [form]=\"fieldForm\" (submitted)=\"submitField()\" (cancelled)=\"cancelField()\"></lib-form-field-edit>\n }\n @else {\n\n <button mat-fab class=\"form-action-button\" (click)=\"addField()\" matTooltip=\"Add a Field\" type=\"button\">\n <mat-icon>add</mat-icon>\n </button>\n\n <mat-accordion style=\"width:100%\">\n @for(field of fields.controls; track field; let idx=$index)\n {\n <mat-expansion-panel style=\"width:100%\">\n <mat-expansion-panel-header>\n <mat-panel-title>{{field.value.label}}</mat-panel-title>\n <div class=\"control\">\n <button mat-icon-button type=\"button\" color=\"primary\" matTooltip=\"Delete the Field\" aria-label=\"Delete an item\"\n (click)=\"onFieldDelete(idx)\">\n <mat-icon>delete\n </mat-icon>\n </button>\n @if(idx>0){\n <button mat-icon-button type=\"button\" color=\"primary\" matTooltip=\"Move Order Up\" aria-label=\"Move Order Up\"\n (click)=\"onFieldOrderUp(idx)\">\n <mat-icon>arrow_upward\n </mat-icon>\n </button>\n }\n @if(idx<fields.controls.length -1){\n <button mat-icon-button type=\"button\" color=\"primary\" matTooltip=\"Move Order Down\" aria-label=\"Move Order Down\"\n (click)=\"onFieldOrderDown(idx)\">\n <mat-icon>arrow_downward\n </mat-icon>\n </button>\n }\n </div>\n </mat-expansion-panel-header>\n <lib-form-field-edit [form]=\"field\" [editMode]=\"true\"></lib-form-field-edit>\n </mat-expansion-panel>\n }\n </mat-accordion>\n }\n\n @if(!editMode()){\n <div>\n <button mat-fab class=\"form-action-button\" \n type=\"submit\" matTooltip=\"Save Group\" [disabled]=\"!form().valid\">\n <mat-icon>save</mat-icon>\n </button>\n <button mat-fab class=\"form-action-button\" \n type=\"button\" matTooltip=\"Cancel\" (click)=\"cancel()\">\n <mat-icon>cancel</mat-icon>\n </button> \n </div>\n}\n<form>", styles: [""], dependencies: [{ kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i1$4.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i1$4.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i1$4.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i1$4.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2$1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: FormFieldEditComponent, selector: "lib-form-field-edit", inputs: ["form", "editMode"], outputs: ["submitted", "cancelled"] }] });
|
|
1168
1224
|
}
|
|
1169
1225
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FormGroupEditComponent, decorators: [{
|
|
1170
1226
|
type: Component,
|
|
1171
|
-
args: [{ selector: 'lib-form-group-edit', imports: [
|
|
1172
|
-
FormFieldListComponent,
|
|
1227
|
+
args: [{ selector: 'lib-form-group-edit', imports: [MatExpansionModule,
|
|
1173
1228
|
MatIconModule,
|
|
1174
|
-
MatFormFieldModule,
|
|
1175
|
-
ReactiveFormsModule,
|
|
1176
1229
|
MatButtonModule,
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
form
|
|
1182
|
-
edit = output();
|
|
1183
|
-
delete = output();
|
|
1184
|
-
orderUp = output();
|
|
1185
|
-
orderDown = output();
|
|
1186
|
-
add = output();
|
|
1187
|
-
table = viewChild(MatTable, ...(ngDevMode ? [{ debugName: "table" }] : []));
|
|
1188
|
-
columns = FORM_GROUP_TABLE_FULL;
|
|
1189
|
-
columnNames = computed(() => {
|
|
1190
|
-
const names = this.columns.map(c => c.name);
|
|
1191
|
-
names.push("edit");
|
|
1192
|
-
return names;
|
|
1193
|
-
}, ...(ngDevMode ? [{ debugName: "columnNames" }] : []));
|
|
1194
|
-
onEdit(form) {
|
|
1195
|
-
this.edit.emit(form.value.order);
|
|
1196
|
-
}
|
|
1197
|
-
onDelete(form) {
|
|
1198
|
-
this.delete.emit(form.value.order);
|
|
1199
|
-
this.table()?.renderRows();
|
|
1200
|
-
}
|
|
1201
|
-
onOrderUp(form) {
|
|
1202
|
-
this.orderUp.emit(form.value.order);
|
|
1203
|
-
this.table()?.renderRows();
|
|
1204
|
-
}
|
|
1205
|
-
onOrderDown(form) {
|
|
1206
|
-
this.orderDown.emit(form.value.order);
|
|
1207
|
-
this.table()?.renderRows();
|
|
1208
|
-
}
|
|
1209
|
-
onAdd() {
|
|
1210
|
-
this.add.emit();
|
|
1211
|
-
}
|
|
1212
|
-
getLabel(form) {
|
|
1213
|
-
if (form.value.label) {
|
|
1214
|
-
return form.value.label;
|
|
1215
|
-
}
|
|
1216
|
-
else {
|
|
1217
|
-
return "Group " + form.value.order.toString();
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FormGroupListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1221
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: FormGroupListComponent, isStandalone: true, selector: "lib-form-group-list", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { edit: "edit", delete: "delete", orderUp: "orderUp", orderDown: "orderDown", add: "add" }, viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true, isSignal: true }], ngImport: i0, template: "@if(form(); as form){\n\n@if (form.controls.length > 0){\n<table mat-table [dataSource]=\"form.controls\" class=\"mat-elevation-z8\">\n @for (column of columns; track column.name) {\n <ng-container matColumnDef=\"{{ column.name }}\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>\n {{ column.title }}\n </th>\n <td mat-cell *matCellDef=\"let element;\">\n {{ getLabel(element) }}\n </td>\n </ng-container>\n }\n <ng-container matColumnDef=\"edit\">\n <th mat-header-cell *matHeaderCellDef>Edit\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <div class=\"control\">\n <button mat-icon-button\n type=\"button\"\n color=\"primary\"\n aria-label=\"Edit an item\"\n (click)=\"onEdit(element)\">\n <mat-icon>edit\n </mat-icon>\n </button>\n <button mat-icon-button\n type=\"button\"\n color=\"primary\"\n aria-label=\"Delete an item\"\n (click)=\"onDelete(element)\">\n <mat-icon>delete\n </mat-icon>\n </button>\n <button mat-icon-button\n type=\"button\"\n color=\"primary\"\n aria-label=\"Move Order Up\"\n (click)=\"onOrderUp(element)\">\n <mat-icon>arrow_upward\n </mat-icon>\n </button> \n <button mat-icon-button\n type=\"button\"\n color=\"primary\"\n aria-label=\"Move Order Down\"\n (click)=\"onOrderDown(element)\">\n <mat-icon>arrow_downward\n </mat-icon>\n </button>\n </div>\n </td>\n </ng-container>\n \n <tr mat-header-row *matHeaderRowDef=\"columnNames()\">\n </tr>\n <tr mat-row *matRowDef=\"let row; columns: columnNames();\">\n </tr>\n</table>\n}\n}\n\n<button mat-fab class=\"form-action-button\" \n (click)=\"onAdd()\" matTooltip=\"Add a Group\" type=\"button\">\n<mat-icon>add</mat-icon>\n</button>\n\n", styles: [".control,.mat-row:hover .control{display:block}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2$1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$5.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i1$5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] });
|
|
1222
|
-
}
|
|
1223
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FormGroupListComponent, decorators: [{
|
|
1224
|
-
type: Component,
|
|
1225
|
-
args: [{ selector: 'lib-form-group-list', imports: [MatIconModule, MatButtonModule, MatTableModule, MatTooltipModule], template: "@if(form(); as form){\n\n@if (form.controls.length > 0){\n<table mat-table [dataSource]=\"form.controls\" class=\"mat-elevation-z8\">\n @for (column of columns; track column.name) {\n <ng-container matColumnDef=\"{{ column.name }}\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>\n {{ column.title }}\n </th>\n <td mat-cell *matCellDef=\"let element;\">\n {{ getLabel(element) }}\n </td>\n </ng-container>\n }\n <ng-container matColumnDef=\"edit\">\n <th mat-header-cell *matHeaderCellDef>Edit\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <div class=\"control\">\n <button mat-icon-button\n type=\"button\"\n color=\"primary\"\n aria-label=\"Edit an item\"\n (click)=\"onEdit(element)\">\n <mat-icon>edit\n </mat-icon>\n </button>\n <button mat-icon-button\n type=\"button\"\n color=\"primary\"\n aria-label=\"Delete an item\"\n (click)=\"onDelete(element)\">\n <mat-icon>delete\n </mat-icon>\n </button>\n <button mat-icon-button\n type=\"button\"\n color=\"primary\"\n aria-label=\"Move Order Up\"\n (click)=\"onOrderUp(element)\">\n <mat-icon>arrow_upward\n </mat-icon>\n </button> \n <button mat-icon-button\n type=\"button\"\n color=\"primary\"\n aria-label=\"Move Order Down\"\n (click)=\"onOrderDown(element)\">\n <mat-icon>arrow_downward\n </mat-icon>\n </button>\n </div>\n </td>\n </ng-container>\n \n <tr mat-header-row *matHeaderRowDef=\"columnNames()\">\n </tr>\n <tr mat-row *matRowDef=\"let row; columns: columnNames();\">\n </tr>\n</table>\n}\n}\n\n<button mat-fab class=\"form-action-button\" \n (click)=\"onAdd()\" matTooltip=\"Add a Group\" type=\"button\">\n<mat-icon>add</mat-icon>\n</button>\n\n", styles: [".control,.mat-row:hover .control{display:block}\n"] }]
|
|
1230
|
+
MatTooltipModule,
|
|
1231
|
+
ReactiveFormsModule,
|
|
1232
|
+
MatFormFieldModule,
|
|
1233
|
+
MatInputModule,
|
|
1234
|
+
FormFieldEditComponent], template: "<form class=\"form-card\" style=\"width:100%\" [formGroup]=\"form()\" (ngSubmit)=\"submit()\">\n\n <mat-form-field class=\"form-field\">\n <mat-label for=\"label\">Label</mat-label>\n <input matInput placeholder=\"\" type=\"text\" formControlName=\"label\"\n name=\"label\"/>\n </mat-form-field> \n\n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"description\">Description</mat-label>\n <textarea matInput placeholder=\"\" type=\"text\" style=\"min-height:150px\" formControlName=\"description\"\n name=\"description\"></textarea>\n </mat-form-field>\n\n <h3>Fields</h3>\n @if(fieldForm){\n <lib-form-field-edit [form]=\"fieldForm\" (submitted)=\"submitField()\" (cancelled)=\"cancelField()\"></lib-form-field-edit>\n }\n @else {\n\n <button mat-fab class=\"form-action-button\" (click)=\"addField()\" matTooltip=\"Add a Field\" type=\"button\">\n <mat-icon>add</mat-icon>\n </button>\n\n <mat-accordion style=\"width:100%\">\n @for(field of fields.controls; track field; let idx=$index)\n {\n <mat-expansion-panel style=\"width:100%\">\n <mat-expansion-panel-header>\n <mat-panel-title>{{field.value.label}}</mat-panel-title>\n <div class=\"control\">\n <button mat-icon-button type=\"button\" color=\"primary\" matTooltip=\"Delete the Field\" aria-label=\"Delete an item\"\n (click)=\"onFieldDelete(idx)\">\n <mat-icon>delete\n </mat-icon>\n </button>\n @if(idx>0){\n <button mat-icon-button type=\"button\" color=\"primary\" matTooltip=\"Move Order Up\" aria-label=\"Move Order Up\"\n (click)=\"onFieldOrderUp(idx)\">\n <mat-icon>arrow_upward\n </mat-icon>\n </button>\n }\n @if(idx<fields.controls.length -1){\n <button mat-icon-button type=\"button\" color=\"primary\" matTooltip=\"Move Order Down\" aria-label=\"Move Order Down\"\n (click)=\"onFieldOrderDown(idx)\">\n <mat-icon>arrow_downward\n </mat-icon>\n </button>\n }\n </div>\n </mat-expansion-panel-header>\n <lib-form-field-edit [form]=\"field\" [editMode]=\"true\"></lib-form-field-edit>\n </mat-expansion-panel>\n }\n </mat-accordion>\n }\n\n @if(!editMode()){\n <div>\n <button mat-fab class=\"form-action-button\" \n type=\"submit\" matTooltip=\"Save Group\" [disabled]=\"!form().valid\">\n <mat-icon>save</mat-icon>\n </button>\n <button mat-fab class=\"form-action-button\" \n type=\"button\" matTooltip=\"Cancel\" (click)=\"cancel()\">\n <mat-icon>cancel</mat-icon>\n </button> \n </div>\n}\n<form>" }]
|
|
1226
1235
|
}] });
|
|
1227
1236
|
|
|
1228
1237
|
class DynamicFormBuilderComponent {
|
|
1229
1238
|
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
1230
1239
|
handleSubmit = input(false, ...(ngDevMode ? [{ debugName: "handleSubmit" }] : []));
|
|
1231
1240
|
submitted = output();
|
|
1232
|
-
editingField = signal(-1, ...(ngDevMode ? [{ debugName: "editingField" }] : []));
|
|
1233
|
-
creatingField = signal(false, ...(ngDevMode ? [{ debugName: "creatingField" }] : []));
|
|
1234
|
-
editingGroup = signal(-1, ...(ngDevMode ? [{ debugName: "editingGroup" }] : []));
|
|
1235
|
-
creatingGroup = signal(false, ...(ngDevMode ? [{ debugName: "creatingGroup" }] : []));
|
|
1236
1241
|
dirty = signal(false, ...(ngDevMode ? [{ debugName: "dirty" }] : []));
|
|
1237
|
-
|
|
1242
|
+
fb = inject(FormBuilder);
|
|
1238
1243
|
groupForm = null;
|
|
1239
1244
|
addGroup() {
|
|
1240
|
-
this.
|
|
1241
|
-
this.groupForm = FormGroupForm.createForm(this.formBuilder);
|
|
1242
|
-
}
|
|
1243
|
-
editGroup(id) {
|
|
1244
|
-
this.editingGroup.set(id);
|
|
1245
|
-
this.groupForm = this.form().groups.controls[id];
|
|
1246
|
-
}
|
|
1247
|
-
deleteGroup(id) {
|
|
1248
|
-
this.form().deleteGroup(id);
|
|
1249
|
-
this.dirty.set(true);
|
|
1250
|
-
this.reset();
|
|
1245
|
+
this.groupForm = FormGroupForm.createForm(this.fb);
|
|
1251
1246
|
}
|
|
1252
|
-
|
|
1253
|
-
if (this.
|
|
1247
|
+
createGroup() {
|
|
1248
|
+
if (this.groupForm) {
|
|
1254
1249
|
this.form().createGroup(this.groupForm);
|
|
1255
1250
|
}
|
|
1256
|
-
this.
|
|
1257
|
-
this.reset();
|
|
1258
|
-
}
|
|
1259
|
-
cancel() {
|
|
1260
|
-
this.reset();
|
|
1251
|
+
this.groupForm = null;
|
|
1261
1252
|
}
|
|
1262
|
-
|
|
1253
|
+
cancelGroup() {
|
|
1263
1254
|
this.groupForm = null;
|
|
1264
|
-
this.creatingGroup.set(false);
|
|
1265
|
-
this.editingGroup.set(-1);
|
|
1266
1255
|
}
|
|
1267
1256
|
onSubmit() {
|
|
1268
1257
|
this.submitted.emit();
|
|
1269
1258
|
this.dirty.set(false);
|
|
1270
1259
|
}
|
|
1260
|
+
deleteGroup(id) {
|
|
1261
|
+
this.form().deleteGroup(id);
|
|
1262
|
+
this.dirty.set(true);
|
|
1263
|
+
}
|
|
1264
|
+
onOrderUp(id) {
|
|
1265
|
+
this.form().orderUp(id);
|
|
1266
|
+
this.dirty.set(true);
|
|
1267
|
+
}
|
|
1268
|
+
onOrderDown(id) {
|
|
1269
|
+
this.form().orderDown(id);
|
|
1270
|
+
this.dirty.set(true);
|
|
1271
|
+
}
|
|
1272
|
+
getLabel(control) {
|
|
1273
|
+
const form = control;
|
|
1274
|
+
if (form.value.label) {
|
|
1275
|
+
return form.value.label;
|
|
1276
|
+
}
|
|
1277
|
+
else {
|
|
1278
|
+
return "Group " + form.value.order.toString();
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1271
1281
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: DynamicFormBuilderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1272
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: DynamicFormBuilderComponent, isStandalone: true, selector: "lib-dynamic-form-builder", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, handleSubmit: { classPropertyName: "handleSubmit", publicName: "handleSubmit", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, ngImport: i0, template: "<h2>Groups</h2>\n\n@if(groupForm)\n{\n<lib-form-group-edit [form]=\"groupForm\"
|
|
1282
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: DynamicFormBuilderComponent, isStandalone: true, selector: "lib-dynamic-form-builder", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null }, handleSubmit: { classPropertyName: "handleSubmit", publicName: "handleSubmit", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, ngImport: i0, template: "<h2>Groups</h2>\n\n\n@if(groupForm)\n{\n<lib-form-group-edit [form]=\"groupForm\" (cancelled)=\"cancelGroup()\" (submitted)=\"createGroup()\"></lib-form-group-edit>\n}\n@else{\n\n<button mat-fab class=\"form-action-button\" (click)=\"addGroup()\" matTooltip=\"Add a Group\" type=\"button\">\n <mat-icon>add</mat-icon>\n</button>\n\n@if (form().groups.length > 0){\n\n<mat-accordion style=\"width:100%\">\n\n @for(group of form().groups.controls; track group; let group_idx=$index)\n {\n <mat-expansion-panel style=\"width:100%\">\n <mat-expansion-panel-header class=\"expansion-panel\">\n <mat-panel-title>{{getLabel(group)}}</mat-panel-title>\n <div class=\"expansion-panel-controls\">\n <button mat-icon-button type=\"button\" class=\"control-button\" color=\"primary\" matTooltip=\"Delete the Group\" aria-label=\"Delete an item\"\n (click)=\"deleteGroup(group_idx)\">\n <mat-icon>delete\n </mat-icon>\n </button>\n @if(group_idx>0){\n <button mat-icon-button class=\"control-button\" type=\"button\" color=\"primary\" matTooltip=\"Move Order Up\" aria-label=\"Move Order Up\"\n (click)=\"onOrderUp(group_idx)\">\n <mat-icon>arrow_upward\n </mat-icon>\n </button>\n }\n @if(group_idx < form().groups.controls.length - 1){\n <button mat-icon-button class=\"control-button\" type=\"button\" color=\"primary\" matTooltip=\"Move Order Down\" aria-label=\"Move Order Down\"\n (click)=\"onOrderDown(group_idx)\">\n <mat-icon>arrow_downward\n </mat-icon>\n </button>\n }\n </div>\n </mat-expansion-panel-header>\n <lib-form-group-edit [form]=\"group\" [editMode]=\"true\"></lib-form-group-edit>\n </mat-expansion-panel>\n }\n</mat-accordion>\n\n}\n\n@if(handleSubmit() && dirty())\n{\n <div>\n <button mat-fab class=\"form-action-button\" \n type=\"button\" matTooltip=\"Save Changes\" (click)=\"onSubmit()\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n}\n}", styles: [".expansion-panel-controls{display:none}.expansion-panel:hover .expansion-panel-controls{display:block}.control-button{margin-right:10px}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2$1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i1$4.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i1$4.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i1$4.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i1$4.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "component", type: FormGroupEditComponent, selector: "lib-form-group-edit", inputs: ["form", "editMode"], outputs: ["submitted", "cancelled"] }] });
|
|
1273
1283
|
}
|
|
1274
1284
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: DynamicFormBuilderComponent, decorators: [{
|
|
1275
1285
|
type: Component,
|
|
1276
1286
|
args: [{ selector: 'lib-dynamic-form-builder', imports: [
|
|
1277
1287
|
MatIconModule,
|
|
1278
1288
|
MatFormFieldModule,
|
|
1289
|
+
MatInputModule,
|
|
1279
1290
|
ReactiveFormsModule,
|
|
1280
|
-
MatButtonModule,
|
|
1281
|
-
|
|
1291
|
+
MatButtonModule,
|
|
1292
|
+
MatTooltipModule,
|
|
1293
|
+
MatExpansionModule,
|
|
1294
|
+
FormGroupEditComponent
|
|
1295
|
+
], template: "<h2>Groups</h2>\n\n\n@if(groupForm)\n{\n<lib-form-group-edit [form]=\"groupForm\" (cancelled)=\"cancelGroup()\" (submitted)=\"createGroup()\"></lib-form-group-edit>\n}\n@else{\n\n<button mat-fab class=\"form-action-button\" (click)=\"addGroup()\" matTooltip=\"Add a Group\" type=\"button\">\n <mat-icon>add</mat-icon>\n</button>\n\n@if (form().groups.length > 0){\n\n<mat-accordion style=\"width:100%\">\n\n @for(group of form().groups.controls; track group; let group_idx=$index)\n {\n <mat-expansion-panel style=\"width:100%\">\n <mat-expansion-panel-header class=\"expansion-panel\">\n <mat-panel-title>{{getLabel(group)}}</mat-panel-title>\n <div class=\"expansion-panel-controls\">\n <button mat-icon-button type=\"button\" class=\"control-button\" color=\"primary\" matTooltip=\"Delete the Group\" aria-label=\"Delete an item\"\n (click)=\"deleteGroup(group_idx)\">\n <mat-icon>delete\n </mat-icon>\n </button>\n @if(group_idx>0){\n <button mat-icon-button class=\"control-button\" type=\"button\" color=\"primary\" matTooltip=\"Move Order Up\" aria-label=\"Move Order Up\"\n (click)=\"onOrderUp(group_idx)\">\n <mat-icon>arrow_upward\n </mat-icon>\n </button>\n }\n @if(group_idx < form().groups.controls.length - 1){\n <button mat-icon-button class=\"control-button\" type=\"button\" color=\"primary\" matTooltip=\"Move Order Down\" aria-label=\"Move Order Down\"\n (click)=\"onOrderDown(group_idx)\">\n <mat-icon>arrow_downward\n </mat-icon>\n </button>\n }\n </div>\n </mat-expansion-panel-header>\n <lib-form-group-edit [form]=\"group\" [editMode]=\"true\"></lib-form-group-edit>\n </mat-expansion-panel>\n }\n</mat-accordion>\n\n}\n\n@if(handleSubmit() && dirty())\n{\n <div>\n <button mat-fab class=\"form-action-button\" \n type=\"button\" matTooltip=\"Save Changes\" (click)=\"onSubmit()\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n}\n}", styles: [".expansion-panel-controls{display:none}.expansion-panel:hover .expansion-panel-controls{display:block}.control-button{margin-right:10px}\n"] }]
|
|
1282
1296
|
}] });
|
|
1283
1297
|
|
|
1284
1298
|
class DynamicFormForm {
|
|
@@ -1292,6 +1306,29 @@ class DynamicFormForm {
|
|
|
1292
1306
|
get groups() {
|
|
1293
1307
|
return this.form.get('groups');
|
|
1294
1308
|
}
|
|
1309
|
+
orderUp(id) {
|
|
1310
|
+
this.reorder(id, id - 1);
|
|
1311
|
+
}
|
|
1312
|
+
orderDown(id) {
|
|
1313
|
+
this.reorder(id, id + 1);
|
|
1314
|
+
}
|
|
1315
|
+
reorder(id, newIndex) {
|
|
1316
|
+
const current_group = this.groups.at(id);
|
|
1317
|
+
current_group.patchValue({ "order": newIndex });
|
|
1318
|
+
const swap_group = this.groups.at(newIndex);
|
|
1319
|
+
swap_group.patchValue({ "order": id });
|
|
1320
|
+
this.groups.removeAt(id);
|
|
1321
|
+
this.groups.insert(newIndex, current_group);
|
|
1322
|
+
}
|
|
1323
|
+
fieldOrderUp(group_id, id) {
|
|
1324
|
+
this.reorderField(group_id, id, id - 1);
|
|
1325
|
+
}
|
|
1326
|
+
fieldOrderDown(group_id, id) {
|
|
1327
|
+
this.reorderField(group_id, id, id + 1);
|
|
1328
|
+
}
|
|
1329
|
+
reorderField(group_id, id, newIndex) {
|
|
1330
|
+
FormGroupForm.reorderField(this.groups.at(group_id), id, newIndex);
|
|
1331
|
+
}
|
|
1295
1332
|
createGroup(group) {
|
|
1296
1333
|
group.patchValue({ order: this.groups.controls.length });
|
|
1297
1334
|
this.groups.push(group);
|
|
@@ -1299,6 +1336,9 @@ class DynamicFormForm {
|
|
|
1299
1336
|
deleteGroup(id) {
|
|
1300
1337
|
this.groups.removeAt(id);
|
|
1301
1338
|
}
|
|
1339
|
+
deleteField(group_id, field_id) {
|
|
1340
|
+
FormGroupForm.deleteField(this.groups.at(group_id), field_id);
|
|
1341
|
+
}
|
|
1302
1342
|
reset() {
|
|
1303
1343
|
this.form = this.fb.group({
|
|
1304
1344
|
groups: this.fb.array([])
|
|
@@ -1427,7 +1467,7 @@ class SelectTableComponent {
|
|
|
1427
1467
|
this.table()?.renderRows();
|
|
1428
1468
|
}
|
|
1429
1469
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: SelectTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1430
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: SelectTableComponent, isStandalone: true, selector: "lib-select-table", inputs: { itemType: { classPropertyName: "itemType", publicName: "itemType", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemAdded: "itemAdded", itemRemoved: "itemRemoved", searchChanged: "searchChanged" }, viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true, isSignal: true }], ngImport: i0, template: "<div class='select-container'>\n <div>\n <mat-form-field>\n <mat-label>Add {{itemType()}}</mat-label>\n <input \n type=\"text\"\n aria-label=\"Selected item\"\n matInput\n [formControl]=\"searchControl\" \n [matAutocomplete]=\"auto\">\n\n <mat-autocomplete #auto=\"matAutocomplete\">\n @for(item of options(); track item.item.id){\n <mat-option [value]=\"item.title\">{{item.title}}\n </mat-option>\n }\n </mat-autocomplete>\n </mat-form-field>\n\n <button mat-mini-fab type=\"button\" class=\"form_action_button\" (click)=\"add()\">\n <mat-icon>add\n </mat-icon>\n </button>\n </div>\n\n @if(selected().length > 0){\n <table mat-table [dataSource]=\"selected()\" class=\"mat-elevation-z8\">\n @for (column of columns(); track column.name) {\n <ng-container matColumnDef=\"{{ column.name }}\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>\n {{ column.title }}\n </th>\n <td mat-cell *matCellDef=\"let element\">{{ element[column.name] }}</td>\n </ng-container>\n }\n\n <ng-container matColumnDef=\"remove\">\n <th mat-header-cell *matHeaderCellDef>Remove\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <button mat-icon-button\n color=\"primary\"\n aria-label=\"Remove an item\"\n (click)=\"remove(element.id)\">\n <mat-icon>remove\n </mat-icon>\n </button>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnNames()\">\n </tr>\n <tr mat-row *matRowDef=\"let row; columns: columnNames();\">\n </tr>\n </table>\n }\n</div>", styles: [".select-container,.table_container{display:flex;text-align:center;justify-content:center;flex-direction:column}.form_action_button{padding:5px;margin:5px}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$5.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i1$5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type:
|
|
1470
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: SelectTableComponent, isStandalone: true, selector: "lib-select-table", inputs: { itemType: { classPropertyName: "itemType", publicName: "itemType", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemAdded: "itemAdded", itemRemoved: "itemRemoved", searchChanged: "searchChanged" }, viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true, isSignal: true }], ngImport: i0, template: "<div class='select-container'>\n <div>\n <mat-form-field>\n <mat-label>Add {{itemType()}}</mat-label>\n <input \n type=\"text\"\n aria-label=\"Selected item\"\n matInput\n [formControl]=\"searchControl\" \n [matAutocomplete]=\"auto\">\n\n <mat-autocomplete #auto=\"matAutocomplete\">\n @for(item of options(); track item.item.id){\n <mat-option [value]=\"item.title\">{{item.title}}\n </mat-option>\n }\n </mat-autocomplete>\n </mat-form-field>\n\n <button mat-mini-fab type=\"button\" class=\"form_action_button\" (click)=\"add()\">\n <mat-icon>add\n </mat-icon>\n </button>\n </div>\n\n @if(selected().length > 0){\n <table mat-table [dataSource]=\"selected()\" class=\"mat-elevation-z8\">\n @for (column of columns(); track column.name) {\n <ng-container matColumnDef=\"{{ column.name }}\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>\n {{ column.title }}\n </th>\n <td mat-cell *matCellDef=\"let element\">{{ element[column.name] }}</td>\n </ng-container>\n }\n\n <ng-container matColumnDef=\"remove\">\n <th mat-header-cell *matHeaderCellDef>Remove\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <button mat-icon-button\n color=\"primary\"\n aria-label=\"Remove an item\"\n (click)=\"remove(element.id)\">\n <mat-icon>remove\n </mat-icon>\n </button>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnNames()\">\n </tr>\n <tr mat-row *matRowDef=\"let row; columns: columnNames();\">\n </tr>\n </table>\n }\n</div>", styles: [".select-container,.table_container{display:flex;text-align:center;justify-content:center;flex-direction:column}.form_action_button{padding:5px;margin:5px}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$5.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i1$5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i6$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i6$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] });
|
|
1431
1471
|
}
|
|
1432
1472
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: SelectTableComponent, decorators: [{
|
|
1433
1473
|
type: Component,
|
|
@@ -1530,7 +1570,7 @@ class ListTableViewComponent {
|
|
|
1530
1570
|
}));
|
|
1531
1571
|
}
|
|
1532
1572
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: ListTableViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1533
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: ListTableViewComponent, isStandalone: true, selector: "lib-list-table-view", inputs: { itemType: { classPropertyName: "itemType", publicName: "itemType", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, searchFilter: { classPropertyName: "searchFilter", publicName: "searchFilter", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }], ngImport: i0, template: "@if (dataSource(); as dataSource) {\n <table\n mat-table\n [dataSource]=\"dataSource\"\n matSort\n matSortActive=\"name\"\n matSortDisableClear\n matSortDirection=\"desc\"\n class=\"mat-elevation-z8\"\n >\n @for (column of columns(); track column.name) {\n <ng-container matColumnDef=\"{{ column.name }}\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>\n {{ column.title }}\n </th>\n <td mat-cell *matCellDef=\"let element\">{{ element[column.name] }}</td>\n </ng-container>\n }\n\n <tr mat-header-row *matHeaderRowDef=\"columnNames()\"></tr>\n <tr\n mat-row\n *matRowDef=\"let row; columns: columnNames()\"\n [routerLink]=\"['/' + itemType() + '/detail/', row.id]\"\n [routerLinkActive]=\"['is-active']\"\n ></tr>\n </table>\n\n <mat-paginator\n [length]=\"dataSource.length()\"\n [pageSize]=\"20\"\n [pageSizeOptions]=\"pageSizeOptions\"\n aria-label=\"Select page\"\n >\n </mat-paginator>\n}\n", styles: [".mat-mdc-row .mat-mdc-cell{border-bottom:1px solid transparent;border-top:1px solid transparent;cursor:pointer}.mat-mdc-row:hover .mat-mdc-cell{border-color:currentColor}.is-active{font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$5.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i1$5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i2$
|
|
1573
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: ListTableViewComponent, isStandalone: true, selector: "lib-list-table-view", inputs: { itemType: { classPropertyName: "itemType", publicName: "itemType", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, searchFilter: { classPropertyName: "searchFilter", publicName: "searchFilter", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }], ngImport: i0, template: "@if (dataSource(); as dataSource) {\n <table\n mat-table\n [dataSource]=\"dataSource\"\n matSort\n matSortActive=\"name\"\n matSortDisableClear\n matSortDirection=\"desc\"\n class=\"mat-elevation-z8\"\n >\n @for (column of columns(); track column.name) {\n <ng-container matColumnDef=\"{{ column.name }}\">\n <th mat-header-cell mat-sort-header *matHeaderCellDef>\n {{ column.title }}\n </th>\n <td mat-cell *matCellDef=\"let element\">{{ element[column.name] }}</td>\n </ng-container>\n }\n\n <tr mat-header-row *matHeaderRowDef=\"columnNames()\"></tr>\n <tr\n mat-row\n *matRowDef=\"let row; columns: columnNames()\"\n [routerLink]=\"['/' + itemType() + '/detail/', row.id]\"\n [routerLinkActive]=\"['is-active']\"\n ></tr>\n </table>\n\n <mat-paginator\n [length]=\"dataSource.length()\"\n [pageSize]=\"20\"\n [pageSizeOptions]=\"pageSizeOptions\"\n aria-label=\"Select page\"\n >\n </mat-paginator>\n}\n", styles: [".mat-mdc-row .mat-mdc-cell{border-bottom:1px solid transparent;border-top:1px solid transparent;cursor:pointer}.mat-mdc-row:hover .mat-mdc-cell{border-color:currentColor}.is-active{font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$5.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i1$5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i2$3.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i3$1.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i3$1.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }] });
|
|
1534
1574
|
}
|
|
1535
1575
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: ListTableViewComponent, decorators: [{
|
|
1536
1576
|
type: Component,
|
|
@@ -1562,7 +1602,7 @@ class ListScrollViewComponent {
|
|
|
1562
1602
|
data_source.reset(this.searchTerm(), this.pageSize());
|
|
1563
1603
|
}
|
|
1564
1604
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: ListScrollViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1565
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.1", type: ListScrollViewComponent, isStandalone: true, selector: "lib-list-scroll-view", inputs: { searchTerm: { classPropertyName: "searchTerm", publicName: "searchTerm", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, listItemTemplate: { classPropertyName: "listItemTemplate", publicName: "listItemTemplate", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-nav-list>\n <cdk-virtual-scroll-viewport\n itemSize=\"150\"\n class=\"scrollable-list\"\n style=\"height: 600px; width: 500px\"\n >\n <ng-container *cdkVirtualFor=\"let item of dataSource()\">\n <ng-container\n *ngTemplateOutlet=\"listItemTemplate(); context: { item: item }\"\n >\n </ng-container>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n</mat-nav-list>\n", styles: [":host{flex-grow:1}.mat-mdc-row .mat-mdc-cell{border-bottom:1px solid transparent;border-top:1px solid transparent;cursor:pointer}.mat-mdc-row:hover .mat-mdc-cell{border-color:currentColor}.is-active{font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: MatListModule }, { kind: "component", type: i2$2.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i2$
|
|
1605
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.1", type: ListScrollViewComponent, isStandalone: true, selector: "lib-list-scroll-view", inputs: { searchTerm: { classPropertyName: "searchTerm", publicName: "searchTerm", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, listItemTemplate: { classPropertyName: "listItemTemplate", publicName: "listItemTemplate", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-nav-list>\n <cdk-virtual-scroll-viewport\n itemSize=\"150\"\n class=\"scrollable-list\"\n style=\"height: 600px; width: 500px\"\n >\n <ng-container *cdkVirtualFor=\"let item of dataSource()\">\n <ng-container\n *ngTemplateOutlet=\"listItemTemplate(); context: { item: item }\"\n >\n </ng-container>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n</mat-nav-list>\n", styles: [":host{flex-grow:1}.mat-mdc-row .mat-mdc-cell{border-bottom:1px solid transparent;border-top:1px solid transparent;cursor:pointer}.mat-mdc-row:hover .mat-mdc-cell{border-color:currentColor}.is-active{font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: MatListModule }, { kind: "component", type: i2$2.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i2$4.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2$4.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2$4.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }] });
|
|
1566
1606
|
}
|
|
1567
1607
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: ListScrollViewComponent, decorators: [{
|
|
1568
1608
|
type: Component,
|
|
@@ -1577,7 +1617,7 @@ class BackButtonComponent {
|
|
|
1577
1617
|
this.location.back();
|
|
1578
1618
|
}
|
|
1579
1619
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: BackButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1580
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: BackButtonComponent, isStandalone: true, selector: "lib-back-button", ngImport: i0, template: "<a mat-icon-button class=\"padded-button\"\n (click)=\"goBack()\"\n (keydown)=\"goBack()\"\n tabindex=\"0\"\n role=\"button\">\n<mat-icon>arrow_back</mat-icon>\n</a>\n\n", styles: [".padded-button{margin:5px}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type:
|
|
1620
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: BackButtonComponent, isStandalone: true, selector: "lib-back-button", ngImport: i0, template: "<a mat-icon-button class=\"padded-button\"\n (click)=\"goBack()\"\n (keydown)=\"goBack()\"\n tabindex=\"0\"\n role=\"button\">\n<mat-icon>arrow_back</mat-icon>\n</a>\n\n", styles: [".padded-button{margin:5px}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }] });
|
|
1581
1621
|
}
|
|
1582
1622
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: BackButtonComponent, decorators: [{
|
|
1583
1623
|
type: Component,
|
|
@@ -1602,7 +1642,7 @@ class SearchBarComponent {
|
|
|
1602
1642
|
this.searchChanged.emit(this.searchFilter.value);
|
|
1603
1643
|
}
|
|
1604
1644
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: SearchBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1605
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: SearchBarComponent, isStandalone: true, selector: "lib-search-bar", inputs: { itemType: { classPropertyName: "itemType", publicName: "itemType", isSignal: true, isRequired: false, transformFunction: null }, sortFields: { classPropertyName: "sortFields", publicName: "sortFields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { searchChanged: "searchChanged" }, ngImport: i0, template: "<div class=\"container\">\n <mat-form-field class=\"search\" style=\"margin: 10px;\">\n <mat-label>Search</mat-label>\n <input matInput [formControl]=\"searchFilter\" placeholder=\"Search {{ itemType() | titlecase }}\" />\n\n @if(searchFilter.value){\n <button matSuffix mat-icon-button aria-label=\"Cancel\" (click)=\"clearSearch()\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\n @else(){\n <button matSuffix mat-icon-button aria-label=\"Search\">\n <mat-icon>search</mat-icon>\n </button>\n }\n </mat-form-field>\n\n @if(sortFields().length > 0){\n <mat-form-field style=\"margin: 10px\">\n <mat-label>Sort By</mat-label>\n <mat-select>\n @for(field of sortFields(); track field)\n {\n <mat-option>{{field}}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <button mat-icon-button aria-label=\"Sort Order\" matTooltip=\"Toggle sort order\">\n <mat-icon>sort</mat-icon>\n </button>\n }\n</div>", styles: [".container{width:100%;display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$
|
|
1645
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: SearchBarComponent, isStandalone: true, selector: "lib-search-bar", inputs: { itemType: { classPropertyName: "itemType", publicName: "itemType", isSignal: true, isRequired: false, transformFunction: null }, sortFields: { classPropertyName: "sortFields", publicName: "sortFields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { searchChanged: "searchChanged" }, ngImport: i0, template: "<div class=\"container\">\n <mat-form-field class=\"search\" style=\"margin: 10px;\">\n <mat-label>Search</mat-label>\n <input matInput [formControl]=\"searchFilter\" placeholder=\"Search {{ itemType() | titlecase }}\" />\n\n @if(searchFilter.value){\n <button matSuffix mat-icon-button aria-label=\"Cancel\" (click)=\"clearSearch()\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\n @else(){\n <button matSuffix mat-icon-button aria-label=\"Search\">\n <mat-icon>search</mat-icon>\n </button>\n }\n </mat-form-field>\n\n @if(sortFields().length > 0){\n <mat-form-field style=\"margin: 10px\">\n <mat-label>Sort By</mat-label>\n <mat-select>\n @for(field of sortFields(); track field)\n {\n <mat-option>{{field}}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <button mat-icon-button aria-label=\"Sort Order\" matTooltip=\"Toggle sort order\">\n <mat-icon>sort</mat-icon>\n </button>\n }\n</div>", styles: [".container{width:100%;display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i6.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }] });
|
|
1606
1646
|
}
|
|
1607
1647
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: SearchBarComponent, decorators: [{
|
|
1608
1648
|
type: Component,
|
|
@@ -1627,10 +1667,12 @@ class ListDataSource extends DataSource {
|
|
|
1627
1667
|
itemService;
|
|
1628
1668
|
subscription = new Subscription();
|
|
1629
1669
|
fetchedPages = new Set();
|
|
1630
|
-
|
|
1670
|
+
defaultQueries = [];
|
|
1671
|
+
constructor(itemService, consumerType = "table", defaultQueries = []) {
|
|
1631
1672
|
super();
|
|
1632
1673
|
this.itemService = itemService;
|
|
1633
1674
|
this.consumerType = consumerType;
|
|
1675
|
+
this.defaultQueries = defaultQueries;
|
|
1634
1676
|
}
|
|
1635
1677
|
connect(collectionViewer) {
|
|
1636
1678
|
if (!this.hasTableConsumer()) {
|
|
@@ -1662,8 +1704,11 @@ class ListDataSource extends DataSource {
|
|
|
1662
1704
|
return;
|
|
1663
1705
|
}
|
|
1664
1706
|
this.fetchedPages.add(idx);
|
|
1707
|
+
const queries = new Map([]);
|
|
1708
|
+
this.defaultQueries.forEach(q => queries.set(q.key, q.value));
|
|
1665
1709
|
this.fetch(new ItemQuery({ page: idx + 1,
|
|
1666
1710
|
page_size: this.pageSize(),
|
|
1711
|
+
queries: queries,
|
|
1667
1712
|
filter: this.searchTerm() }));
|
|
1668
1713
|
}
|
|
1669
1714
|
fetch(query) {
|
|
@@ -1697,6 +1742,7 @@ class ListViewComponent {
|
|
|
1697
1742
|
noSelfItemsMessage = input(...(ngDevMode ? [undefined, { debugName: "noSelfItemsMessage" }] : []));
|
|
1698
1743
|
noItemsCanCreateMessage = input(...(ngDevMode ? [undefined, { debugName: "noItemsCanCreateMessage" }] : []));
|
|
1699
1744
|
noItemsMessage = input(...(ngDevMode ? [undefined, { debugName: "noItemsMessage" }] : []));
|
|
1745
|
+
defaultQueries = input([], ...(ngDevMode ? [{ debugName: "defaultQueries" }] : []));
|
|
1700
1746
|
selectedViewType = signal("table", ...(ngDevMode ? [{ debugName: "selectedViewType" }] : []));
|
|
1701
1747
|
pageSize = 20;
|
|
1702
1748
|
pageSizeOptions = [20, 50, 100];
|
|
@@ -1742,7 +1788,7 @@ class ListViewComponent {
|
|
|
1742
1788
|
resetDataSource() {
|
|
1743
1789
|
const item_service = this.itemService();
|
|
1744
1790
|
if (item_service) {
|
|
1745
|
-
this.dataSource = new ListDataSource(item_service, this.selectedViewType());
|
|
1791
|
+
this.dataSource = new ListDataSource(item_service, this.selectedViewType(), this.defaultQueries());
|
|
1746
1792
|
}
|
|
1747
1793
|
this.reset();
|
|
1748
1794
|
}
|
|
@@ -1753,7 +1799,6 @@ class ListViewComponent {
|
|
|
1753
1799
|
}
|
|
1754
1800
|
viewChanged(event) {
|
|
1755
1801
|
this.selectedViewType.set(event.value);
|
|
1756
|
-
console.log(this.selectedViewType());
|
|
1757
1802
|
this.resetDataSource();
|
|
1758
1803
|
}
|
|
1759
1804
|
isSelfList() {
|
|
@@ -1761,7 +1806,7 @@ class ListViewComponent {
|
|
|
1761
1806
|
return (url_segments.length == 2) && (url_segments[1].path == "self");
|
|
1762
1807
|
}
|
|
1763
1808
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: ListViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1764
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: ListViewComponent, isStandalone: true, selector: "lib-list-view", inputs: { viewType: { classPropertyName: "viewType", publicName: "viewType", isSignal: true, isRequired: false, transformFunction: null }, itemService: { classPropertyName: "itemService", publicName: "itemService", isSignal: true, isRequired: false, transformFunction: null }, itemDetailTemplate: { classPropertyName: "itemDetailTemplate", publicName: "itemDetailTemplate", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, sortFields: { classPropertyName: "sortFields", publicName: "sortFields", isSignal: true, isRequired: false, transformFunction: null }, noSelfItemsMessage: { classPropertyName: "noSelfItemsMessage", publicName: "noSelfItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, noItemsCanCreateMessage: { classPropertyName: "noItemsCanCreateMessage", publicName: "noItemsCanCreateMessage", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }], ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"container\">\n <div class=\"header\">\n <h1 class=\"title\">{{ title() | titlecase }}</h1>\n\n @if (canCreate()) {\n <div class=\"button-container\">\n <a mat-fab class=\"padded-button\" aria-label=\"Add new item\" matTooltip=\"Add new item\" [routerLink]=\"['create']\">\n <mat-icon>add</mat-icon></a>\n </div>\n }\n </div>\n\n @if(dataSource)\n {\n <div class=\"controls\" [hidden]=\"dataSource.sourceIsEmpty()\">\n <lib-search-bar [itemType]=\"title()\" [sortFields]=\"sortFields()\"\n (searchChanged)=\"onSearchChange($event)\"></lib-search-bar>\n\n @if(itemDetailTemplate()){\n <div style=\"margin: 10px\">\n <mat-button-toggle-group name=\"viewType\" aria-label=\"View Type\" [value]=\"selectedViewType()\"\n (change)=\"viewChanged($event)\">\n\n <mat-button-toggle value=\"table\" matTooltip=\"Show as table\">\n <mat-icon>table_view</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle value=\"scroll\" matTooltip=\"Show as list\">\n <mat-icon>list</mat-icon>\n </mat-button-toggle>\n\n </mat-button-toggle-group>\n </div>\n }\n </div>\n\n @if (dataSource.loading()) {\n <div class=\"spinner-container\">\n <mat-spinner></mat-spinner>\n </div>\n }\n\n <div [hidden]=\"!dataSource.sourceIsEmpty()\">\n @if(isSelfList())\n {\n @if(noSelfItemsMessage())\n {\n <p>{{noSelfItemsMessage()}}</p>\n }\n @else {\n <p>You do not have any {{itemType()}}.</p> \n }\n }\n @else{\n @if(canCreate()){\n @if(noItemsCanCreateMessage())\n {\n <p>{{noItemsCanCreateMessage()}}</p>\n }\n @else{\n <p>There are currently no {{itemType()}}, click above to add one.</p>\n }\n }\n @else{\n @if(noItemsMessage())\n {\n <p>{{noItemsMessage()}}</p>\n }\n @else\n {\n <p>There are currently no {{itemType()}}.</p>\n }\n }\n }\n </div>\n\n <div [hidden]=\"dataSource.sourceIsEmpty()\">\n @if(isTableView()) {\n <lib-list-table-view [itemType]=\"itemType()\" [columns]=\"columns()\" [dataSource]=\"dataSource\">\n </lib-list-table-view>\n } \n @else {\n <lib-list-scroll-view [listItemTemplate]=\"itemDetailTemplate()\" [dataSource]=\"dataSource\"></lib-list-scroll-view>\n }\n\n </div>\n }\n</div>", styles: [":host{flex-grow:1}.container{display:flex;padding:10px;flex-direction:column;justify-content:center;text-align:center;align-items:center}.header{display:flex;flex-direction:row;align-items:center;justify-content:center}.title{text-align:center;padding:10px}.controls{display:flex;align-items:center;justify-content:center;flex-wrap:wrap}.hide-element{display:none}\n"], dependencies: [{ kind: "component", type: ListTableViewComponent, selector: "lib-list-table-view", inputs: ["itemType", "columns", "dataSource", "searchFilter"] }, { kind: "component", type: ListScrollViewComponent, selector: "lib-list-scroll-view", inputs: ["searchTerm", "pageSize", "dataSource", "listItemTemplate"] }, { kind: "component", type: BackButtonComponent, selector: "lib-back-button" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: i1$6.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i1$6.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i2$
|
|
1809
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: ListViewComponent, isStandalone: true, selector: "lib-list-view", inputs: { viewType: { classPropertyName: "viewType", publicName: "viewType", isSignal: true, isRequired: false, transformFunction: null }, itemService: { classPropertyName: "itemService", publicName: "itemService", isSignal: true, isRequired: false, transformFunction: null }, itemDetailTemplate: { classPropertyName: "itemDetailTemplate", publicName: "itemDetailTemplate", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, sortFields: { classPropertyName: "sortFields", publicName: "sortFields", isSignal: true, isRequired: false, transformFunction: null }, noSelfItemsMessage: { classPropertyName: "noSelfItemsMessage", publicName: "noSelfItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, noItemsCanCreateMessage: { classPropertyName: "noItemsCanCreateMessage", publicName: "noItemsCanCreateMessage", isSignal: true, isRequired: false, transformFunction: null }, noItemsMessage: { classPropertyName: "noItemsMessage", publicName: "noItemsMessage", isSignal: true, isRequired: false, transformFunction: null }, defaultQueries: { classPropertyName: "defaultQueries", publicName: "defaultQueries", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }], ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"container\">\n <div class=\"header\">\n <h1 class=\"title\">{{ title() | titlecase }}</h1>\n\n @if (canCreate()) {\n <div class=\"button-container\">\n <a mat-fab class=\"padded-button\" aria-label=\"Add new item\" matTooltip=\"Add new item\" [routerLink]=\"['create']\">\n <mat-icon>add</mat-icon></a>\n </div>\n }\n </div>\n\n @if(dataSource)\n {\n <div class=\"controls\" [hidden]=\"dataSource.sourceIsEmpty()\">\n <lib-search-bar [itemType]=\"title()\" [sortFields]=\"sortFields()\"\n (searchChanged)=\"onSearchChange($event)\"></lib-search-bar>\n\n @if(itemDetailTemplate()){\n <div style=\"margin: 10px\">\n <mat-button-toggle-group name=\"viewType\" aria-label=\"View Type\" [value]=\"selectedViewType()\"\n (change)=\"viewChanged($event)\">\n\n <mat-button-toggle value=\"table\" matTooltip=\"Show as table\">\n <mat-icon>table_view</mat-icon>\n </mat-button-toggle>\n\n <mat-button-toggle value=\"scroll\" matTooltip=\"Show as list\">\n <mat-icon>list</mat-icon>\n </mat-button-toggle>\n\n </mat-button-toggle-group>\n </div>\n }\n </div>\n\n @if (dataSource.loading()) {\n <div class=\"spinner-container\">\n <mat-spinner></mat-spinner>\n </div>\n }\n\n <div [hidden]=\"!dataSource.sourceIsEmpty()\">\n @if(isSelfList())\n {\n @if(noSelfItemsMessage())\n {\n <p>{{noSelfItemsMessage()}}</p>\n }\n @else {\n <p>You do not have any {{itemType()}}.</p> \n }\n }\n @else{\n @if(canCreate()){\n @if(noItemsCanCreateMessage())\n {\n <p>{{noItemsCanCreateMessage()}}</p>\n }\n @else{\n <p>There are currently no {{itemType()}}, click above to add one.</p>\n }\n }\n @else{\n @if(noItemsMessage())\n {\n <p>{{noItemsMessage()}}</p>\n }\n @else\n {\n <p>There are currently no {{itemType()}}.</p>\n }\n }\n }\n </div>\n\n <div [hidden]=\"dataSource.sourceIsEmpty()\">\n @if(isTableView()) {\n <lib-list-table-view [itemType]=\"itemType()\" [columns]=\"columns()\" [dataSource]=\"dataSource\">\n </lib-list-table-view>\n } \n @else {\n <lib-list-scroll-view [listItemTemplate]=\"itemDetailTemplate()\" [dataSource]=\"dataSource\"></lib-list-scroll-view>\n }\n\n </div>\n }\n</div>", styles: [":host{flex-grow:1}.container{display:flex;padding:10px;flex-direction:column;justify-content:center;text-align:center;align-items:center}.header{display:flex;flex-direction:row;align-items:center;justify-content:center}.title{text-align:center;padding:10px}.controls{display:flex;align-items:center;justify-content:center;flex-wrap:wrap}.hide-element{display:none}\n"], dependencies: [{ kind: "component", type: ListTableViewComponent, selector: "lib-list-table-view", inputs: ["itemType", "columns", "dataSource", "searchFilter"] }, { kind: "component", type: ListScrollViewComponent, selector: "lib-list-scroll-view", inputs: ["searchTerm", "pageSize", "dataSource", "listItemTemplate"] }, { kind: "component", type: BackButtonComponent, selector: "lib-back-button" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: i1$6.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i1$6.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i2$5.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: SearchBarComponent, selector: "lib-search-bar", inputs: ["itemType", "sortFields"], outputs: ["searchChanged"] }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }] });
|
|
1765
1810
|
}
|
|
1766
1811
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: ListViewComponent, decorators: [{
|
|
1767
1812
|
type: Component,
|
|
@@ -1793,7 +1838,7 @@ class DetailHeaderComponent {
|
|
|
1793
1838
|
this.deleteClicked.emit();
|
|
1794
1839
|
}
|
|
1795
1840
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: DetailHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1796
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: DetailHeaderComponent, isStandalone: true, selector: "lib-detail-header", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, route: { classPropertyName: "route", publicName: "route", isSignal: true, isRequired: false, transformFunction: null }, canEdit: { classPropertyName: "canEdit", publicName: "canEdit", isSignal: true, isRequired: false, transformFunction: null }, canDelete: { classPropertyName: "canDelete", publicName: "canDelete", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deleteClicked: "deleteClicked" }, ngImport: i0, template: "<div class=\"container\">\n\n <h1 class=\"header\">{{text()}}</h1>\n\n <div class=\"controls\">\n @if(canEdit()){\n <a mat-mini-fab class=\"control-button\" matTooltip=\"Edit the item\" title=\"Click to edit this item\" aria-label=\"Click to edit this item\"\n [routerLink]=\"[fullRoute(), id()]\">\n <mat-icon>edit</mat-icon>\n </a>\n }\n\n @if(canDelete()){\n <button mat-mini-fab class=\"control-button\" (click)=\"deleteClick()\" matTooltip=\"Delete the item\" title=\"Click to delete this item\"\n aria-label=\"Click to delete this item\">\n <mat-icon>delete</mat-icon></button>\n }\n </div>\n\n</div>", styles: [".container{width:100%;max-width:500px;padding:5px}.header{width:100%;padding:5px;margin:5px}.controls{display:flex;flex-direction:row;align-content:center;justify-content:center}.control-button{padding:5px;margin:5px}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type:
|
|
1841
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: DetailHeaderComponent, isStandalone: true, selector: "lib-detail-header", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, route: { classPropertyName: "route", publicName: "route", isSignal: true, isRequired: false, transformFunction: null }, canEdit: { classPropertyName: "canEdit", publicName: "canEdit", isSignal: true, isRequired: false, transformFunction: null }, canDelete: { classPropertyName: "canDelete", publicName: "canDelete", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { deleteClicked: "deleteClicked" }, ngImport: i0, template: "<div class=\"container\">\n\n <h1 class=\"header\">{{text()}}</h1>\n\n <div class=\"controls\">\n @if(canEdit()){\n <a mat-mini-fab class=\"control-button\" matTooltip=\"Edit the item\" title=\"Click to edit this item\" aria-label=\"Click to edit this item\"\n [routerLink]=\"[fullRoute(), id()]\">\n <mat-icon>edit</mat-icon>\n </a>\n }\n\n @if(canDelete()){\n <button mat-mini-fab class=\"control-button\" (click)=\"deleteClick()\" matTooltip=\"Delete the item\" title=\"Click to delete this item\"\n aria-label=\"Click to delete this item\">\n <mat-icon>delete</mat-icon></button>\n }\n </div>\n\n</div>", styles: [".container{width:100%;max-width:500px;padding:5px}.header{width:100%;padding:5px;margin:5px}.controls{display:flex;flex-direction:row;align-content:center;justify-content:center}.control-button{padding:5px;margin:5px}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] });
|
|
1797
1842
|
}
|
|
1798
1843
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: DetailHeaderComponent, decorators: [{
|
|
1799
1844
|
type: Component,
|
|
@@ -1831,30 +1876,39 @@ class UserDetailComponent extends DetailView {
|
|
|
1831
1876
|
return super.canEdit();
|
|
1832
1877
|
}
|
|
1833
1878
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1834
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: UserDetailComponent, isStandalone: true, selector: "lib-user-detail", usesInheritance: true, ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n @if(item(); as item){\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.username\"\n [id]=\"item.id\"\n [route]=\"itemService.typePlural()\"\n [canEdit]=\"canEdit()\"\n [canDelete]=\"canDelete()\"\n (onDelete)=\"onDelete()\"></lib-detail-header>\n\n @if(item.
|
|
1879
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: UserDetailComponent, isStandalone: true, selector: "lib-user-detail", usesInheritance: true, ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n @if(item(); as item){\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.username\"\n [id]=\"item.id\"\n [route]=\"itemService.typePlural()\"\n [canEdit]=\"canEdit()\"\n [canDelete]=\"canDelete()\"\n (onDelete)=\"onDelete()\"></lib-detail-header>\n\n @if(item.profile){\n <div class=\"image-holder\">\n <img alt=\"User Profile Image\" src=\"{{item.profile}}\" style=\"height:120px;\">\n </div> \n }\n \n <div class=\"item-field\">\n <span><b>Email: </b></span>\n {{item.email}}\n </div>\n \n <div class=\"item-field\">\n <span><b>First Name: </b></span>\n {{item.first_name}}\n </div>\n \n <div class=\"item-field\">\n <span><b>Last Name: </b></span>\n {{item.last_name}}\n </div>\n \n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}\n"], dependencies: [{ kind: "component", type: BackButtonComponent, selector: "lib-back-button" }, { kind: "component", type: DetailHeaderComponent, selector: "lib-detail-header", inputs: ["id", "text", "route", "canEdit", "canDelete"], outputs: ["deleteClicked"] }] });
|
|
1835
1880
|
}
|
|
1836
1881
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserDetailComponent, decorators: [{
|
|
1837
1882
|
type: Component,
|
|
1838
1883
|
args: [{ selector: 'lib-user-detail', imports: [BackButtonComponent,
|
|
1839
|
-
DetailHeaderComponent], template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n @if(item(); as item){\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.username\"\n [id]=\"item.id\"\n [route]=\"itemService.typePlural()\"\n [canEdit]=\"canEdit()\"\n [canDelete]=\"canDelete()\"\n (onDelete)=\"onDelete()\"></lib-detail-header>\n\n @if(item.
|
|
1884
|
+
DetailHeaderComponent], template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n @if(item(); as item){\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.username\"\n [id]=\"item.id\"\n [route]=\"itemService.typePlural()\"\n [canEdit]=\"canEdit()\"\n [canDelete]=\"canDelete()\"\n (onDelete)=\"onDelete()\"></lib-detail-header>\n\n @if(item.profile){\n <div class=\"image-holder\">\n <img alt=\"User Profile Image\" src=\"{{item.profile}}\" style=\"height:120px;\">\n </div> \n }\n \n <div class=\"item-field\">\n <span><b>Email: </b></span>\n {{item.email}}\n </div>\n \n <div class=\"item-field\">\n <span><b>First Name: </b></span>\n {{item.first_name}}\n </div>\n \n <div class=\"item-field\">\n <span><b>Last Name: </b></span>\n {{item.last_name}}\n </div>\n \n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}\n"] }]
|
|
1840
1885
|
}], ctorParameters: () => [] });
|
|
1841
1886
|
|
|
1842
1887
|
class UserForm {
|
|
1843
|
-
|
|
1844
|
-
form = this.
|
|
1845
|
-
username:
|
|
1846
|
-
email:
|
|
1847
|
-
first_name:
|
|
1848
|
-
last_name:
|
|
1849
|
-
phone:
|
|
1888
|
+
fb = inject(FormBuilder);
|
|
1889
|
+
form = this.fb.group({
|
|
1890
|
+
username: this.fb.control('', Validators.required),
|
|
1891
|
+
email: this.fb.control('', Validators.required),
|
|
1892
|
+
first_name: this.fb.control(''),
|
|
1893
|
+
last_name: this.fb.control(''),
|
|
1894
|
+
phone: this.fb.control(''),
|
|
1895
|
+
profile: this.fb.control(UserForm.getDefaultProfile()),
|
|
1850
1896
|
});
|
|
1897
|
+
static getDefaultProfile() {
|
|
1898
|
+
return { name: "profile", display_name: "Profile Image", file_type: "image", remote: "", local: "", file: null };
|
|
1899
|
+
}
|
|
1851
1900
|
setValue(item) {
|
|
1901
|
+
const profile = UserForm.getDefaultProfile();
|
|
1902
|
+
if (item.profile) {
|
|
1903
|
+
profile.remote = item.profile;
|
|
1904
|
+
}
|
|
1852
1905
|
this.form.setValue({
|
|
1853
1906
|
username: item.username,
|
|
1854
1907
|
email: item.email,
|
|
1855
1908
|
first_name: item.first_name,
|
|
1856
1909
|
last_name: item.last_name,
|
|
1857
|
-
phone: item.phone
|
|
1910
|
+
phone: item.phone,
|
|
1911
|
+
profile: profile
|
|
1858
1912
|
});
|
|
1859
1913
|
}
|
|
1860
1914
|
createItem() {
|
|
@@ -1879,49 +1933,18 @@ class UserForm {
|
|
|
1879
1933
|
}
|
|
1880
1934
|
|
|
1881
1935
|
class UserEditComponent extends EditView {
|
|
1882
|
-
|
|
1883
|
-
name: "image",
|
|
1884
|
-
display_name: "Profile Image",
|
|
1885
|
-
file_type: "image"
|
|
1886
|
-
})], ...(ngDevMode ? [{ debugName: "files" }] : []));
|
|
1936
|
+
fileKeys = ["profile"];
|
|
1887
1937
|
constructor() {
|
|
1888
1938
|
super(inject(UserService), new UserForm());
|
|
1889
1939
|
}
|
|
1890
1940
|
ngOnInit() {
|
|
1891
1941
|
this.onInit();
|
|
1892
1942
|
}
|
|
1893
|
-
|
|
1894
|
-
this.form.
|
|
1895
|
-
if (item.profile_url) {
|
|
1896
|
-
this.files.update(files => { const file = files.find(f => f.name === "image"); if (file) {
|
|
1897
|
-
file.remote = item.url + item.profile_url;
|
|
1898
|
-
} ; return files; });
|
|
1899
|
-
}
|
|
1900
|
-
super.onItemAvailable(item);
|
|
1901
|
-
}
|
|
1902
|
-
submit() {
|
|
1903
|
-
this.item.update((item) => { if (item) {
|
|
1904
|
-
item = this.form.updateItem(item);
|
|
1905
|
-
} return item; });
|
|
1906
|
-
super.submit();
|
|
1907
|
-
}
|
|
1908
|
-
onPreviewLoaded(preview) {
|
|
1909
|
-
this.files.update(files => { const file = files.find(f => f.name === preview.name); if (file) {
|
|
1910
|
-
file.local = preview.content;
|
|
1911
|
-
} ; return files; });
|
|
1912
|
-
}
|
|
1913
|
-
onFileUploaded(upload) {
|
|
1914
|
-
this.files.update(files => { const file = files.find(f => f.name === upload.name); if (file) {
|
|
1915
|
-
file.file = upload.file;
|
|
1916
|
-
} ; return files; });
|
|
1917
|
-
}
|
|
1918
|
-
saveFiles(item) {
|
|
1919
|
-
this.files().forEach(record => { if (record.file) {
|
|
1920
|
-
this.itemService.postFile(item.id, record.name, record.file).subscribe(item => this.onItemUpdated(item));
|
|
1921
|
-
} ; });
|
|
1943
|
+
get profileControl() {
|
|
1944
|
+
return this.form.form.get('profile');
|
|
1922
1945
|
}
|
|
1923
1946
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1924
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: UserEditComponent, isStandalone: true, selector: "lib-user-edit", usesInheritance: true, ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n <div class=\"item-edit-container\">\n\n <h1 class=\"item-edit-header\">{{heading() | titlecase}}</h1>\n\n <form class=\"form-card\" [formGroup]=\"form.form\" (ngSubmit)=\"submit()\">\n <mat-form-field class=\"form-field-wide\">\n <mat-label>Username</mat-label>\n <input matInput\n placeholder=\"Username\"\n type=\"text\"\n formControlName=\"username\"\n name=\"username\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field-wide\">\n <mat-label>Email</mat-label>\n <input matInput\n placeholder=\"Email\"\n type=\"text\"\n formControlName=\"email\"\n name=\"email\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label>First Name</mat-label>\n <input matInput\n placeholder=\"First Name\"\n type=\"text\"\n formControlName=\"first_name\"\n name=\"first_name\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field\">\n <mat-label>Last Name</mat-label>\n <input matInput\n placeholder=\"Last Name\"\n type=\"text\"\n formControlName=\"last_name\"\n name=\"last_name\">\n </mat-form-field>\n\n <lib-file-upload [
|
|
1947
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: UserEditComponent, isStandalone: true, selector: "lib-user-edit", usesInheritance: true, ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n <div class=\"item-edit-container\">\n\n <h1 class=\"item-edit-header\">{{heading() | titlecase}}</h1>\n\n <form class=\"form-card\" [formGroup]=\"form.form\" (ngSubmit)=\"submit()\">\n <mat-form-field class=\"form-field-wide\">\n <mat-label>Username</mat-label>\n <input matInput\n placeholder=\"Username\"\n type=\"text\"\n formControlName=\"username\"\n name=\"username\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field-wide\">\n <mat-label>Email</mat-label>\n <input matInput\n placeholder=\"Email\"\n type=\"text\"\n formControlName=\"email\"\n name=\"email\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label>First Name</mat-label>\n <input matInput\n placeholder=\"First Name\"\n type=\"text\"\n formControlName=\"first_name\"\n name=\"first_name\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field\">\n <mat-label>Last Name</mat-label>\n <input matInput\n placeholder=\"Last Name\"\n type=\"text\"\n formControlName=\"last_name\"\n name=\"last_name\">\n </mat-form-field>\n\n <lib-file-upload [control]=\"profileControl\"></lib-file-upload>\n\n <div class=\"button_group\">\n <button mat-fab\n class=\"form_action_button\"\n type=\"submit\"\n [disabled]=\"!form.form.valid\">\n <mat-icon>save</mat-icon></button>\n \n <button mat-fab\n class=\"form_action_button\"\n type=\"button\"\n (click)=\"cancel()\">\n <mat-icon>cancel</mat-icon></button>\n </div> \n </form>\n </div>\n</div>\n", styles: [":host{flex-grow:1}.item_view{display:flex;justify-content:left;align-items:left;flex-direction:column}.checkbox_group{justify-content:left;display:flex;flex-direction:column}.button_group{margin:10px;display:flex;flex-direction:row;justify-content:center}.btn-block{padding:5px}.form_action_button{padding:5px;margin:5px}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: BackButtonComponent, selector: "lib-back-button" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: FileUploadComponent, selector: "lib-file-upload", inputs: ["control"] }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }] });
|
|
1925
1948
|
}
|
|
1926
1949
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserEditComponent, decorators: [{
|
|
1927
1950
|
type: Component,
|
|
@@ -1934,18 +1957,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
1934
1957
|
MatIconModule,
|
|
1935
1958
|
FileUploadComponent,
|
|
1936
1959
|
TitleCasePipe
|
|
1937
|
-
], template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n <div class=\"item-edit-container\">\n\n <h1 class=\"item-edit-header\">{{heading() | titlecase}}</h1>\n\n <form class=\"form-card\" [formGroup]=\"form.form\" (ngSubmit)=\"submit()\">\n <mat-form-field class=\"form-field-wide\">\n <mat-label>Username</mat-label>\n <input matInput\n placeholder=\"Username\"\n type=\"text\"\n formControlName=\"username\"\n name=\"username\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field-wide\">\n <mat-label>Email</mat-label>\n <input matInput\n placeholder=\"Email\"\n type=\"text\"\n formControlName=\"email\"\n name=\"email\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label>First Name</mat-label>\n <input matInput\n placeholder=\"First Name\"\n type=\"text\"\n formControlName=\"first_name\"\n name=\"first_name\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field\">\n <mat-label>Last Name</mat-label>\n <input matInput\n placeholder=\"Last Name\"\n type=\"text\"\n formControlName=\"last_name\"\n name=\"last_name\">\n </mat-form-field>\n\n <lib-file-upload [
|
|
1960
|
+
], template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n <div class=\"item-edit-container\">\n\n <h1 class=\"item-edit-header\">{{heading() | titlecase}}</h1>\n\n <form class=\"form-card\" [formGroup]=\"form.form\" (ngSubmit)=\"submit()\">\n <mat-form-field class=\"form-field-wide\">\n <mat-label>Username</mat-label>\n <input matInput\n placeholder=\"Username\"\n type=\"text\"\n formControlName=\"username\"\n name=\"username\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field-wide\">\n <mat-label>Email</mat-label>\n <input matInput\n placeholder=\"Email\"\n type=\"text\"\n formControlName=\"email\"\n name=\"email\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label>First Name</mat-label>\n <input matInput\n placeholder=\"First Name\"\n type=\"text\"\n formControlName=\"first_name\"\n name=\"first_name\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field\">\n <mat-label>Last Name</mat-label>\n <input matInput\n placeholder=\"Last Name\"\n type=\"text\"\n formControlName=\"last_name\"\n name=\"last_name\">\n </mat-form-field>\n\n <lib-file-upload [control]=\"profileControl\"></lib-file-upload>\n\n <div class=\"button_group\">\n <button mat-fab\n class=\"form_action_button\"\n type=\"submit\"\n [disabled]=\"!form.form.valid\">\n <mat-icon>save</mat-icon></button>\n \n <button mat-fab\n class=\"form_action_button\"\n type=\"button\"\n (click)=\"cancel()\">\n <mat-icon>cancel</mat-icon></button>\n </div> \n </form>\n </div>\n</div>\n", styles: [":host{flex-grow:1}.item_view{display:flex;justify-content:left;align-items:left;flex-direction:column}.checkbox_group{justify-content:left;display:flex;flex-direction:column}.button_group{margin:10px;display:flex;flex-direction:row;justify-content:center}.btn-block{padding:5px}.form_action_button{padding:5px;margin:5px}\n"] }]
|
|
1938
1961
|
}], ctorParameters: () => [] });
|
|
1939
1962
|
|
|
1940
1963
|
class UserListDetailComponent {
|
|
1941
|
-
item = input(...(ngDevMode ? [
|
|
1964
|
+
item = input.required(...(ngDevMode ? [{ debugName: "item" }] : []));
|
|
1965
|
+
ngOnInit() {
|
|
1966
|
+
console.log(this.item());
|
|
1967
|
+
}
|
|
1942
1968
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserListDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1943
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: UserListDetailComponent, isStandalone: true, selector: "lib-user-list-detail", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired:
|
|
1969
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: UserListDetailComponent, isStandalone: true, selector: "lib-user-list-detail", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mat-card mat-list-item class=\"item-card\">\n <mat-card-header>\n @if(item().profile_thumbnail)\n {\n <img mat-card-avatar src=\"{{item().profile_thumbnail}}\" alt=\"User avatar\">\n }\n <mat-card-title-group style=\"padding: 5px\">\n <mat-card-title\n >{{ item().first_name }} {{ item().last_name }}</mat-card-title\n >\n <mat-card-subtitle>{{ item().username }}</mat-card-subtitle>\n </mat-card-title-group>\n </mat-card-header>\n\n <mat-card-content>\n <p>Email: {{ item().email }}</p>\n </mat-card-content>\n</mat-card>\n", styles: [":host{flex-grow:1}.mat-mdc-row .mat-mdc-cell{border-bottom:1px solid transparent;border-top:1px solid transparent;cursor:pointer}.mat-mdc-row:hover .mat-mdc-cell{border-color:currentColor}.is-active{font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: MatListModule }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1$3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$3.MatCardAvatar, selector: "[mat-card-avatar], [matCardAvatar]" }, { kind: "directive", type: i1$3.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i1$3.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i1$3.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { kind: "directive", type: i1$3.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i1$3.MatCardTitleGroup, selector: "mat-card-title-group" }] });
|
|
1944
1970
|
}
|
|
1945
1971
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserListDetailComponent, decorators: [{
|
|
1946
1972
|
type: Component,
|
|
1947
1973
|
args: [{ selector: 'lib-user-list-detail', imports: [MatListModule,
|
|
1948
|
-
MatCardModule], template: "<mat-card mat-list-item class=\"item-card\">\n @if(item()
|
|
1974
|
+
MatCardModule], template: "<mat-card mat-list-item class=\"item-card\">\n <mat-card-header>\n @if(item().profile_thumbnail)\n {\n <img mat-card-avatar src=\"{{item().profile_thumbnail}}\" alt=\"User avatar\">\n }\n <mat-card-title-group style=\"padding: 5px\">\n <mat-card-title\n >{{ item().first_name }} {{ item().last_name }}</mat-card-title\n >\n <mat-card-subtitle>{{ item().username }}</mat-card-subtitle>\n </mat-card-title-group>\n </mat-card-header>\n\n <mat-card-content>\n <p>Email: {{ item().email }}</p>\n </mat-card-content>\n</mat-card>\n", styles: [":host{flex-grow:1}.mat-mdc-row .mat-mdc-cell{border-bottom:1px solid transparent;border-top:1px solid transparent;cursor:pointer}.mat-mdc-row:hover .mat-mdc-cell{border-color:currentColor}.is-active{font-weight:700}\n"] }]
|
|
1949
1975
|
}] });
|
|
1950
1976
|
|
|
1951
1977
|
class UserComponent {
|
|
@@ -1953,7 +1979,7 @@ class UserComponent {
|
|
|
1953
1979
|
itemService = inject(UserService);
|
|
1954
1980
|
columns = USER_TABLE_FULL;
|
|
1955
1981
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1956
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: UserComponent, isStandalone: true, selector: "lib-user", ngImport: i0, template: "<lib-list-view\n [itemService]=\"itemService\"\n [itemDetailTemplate]=\"listItemTemplate\"\n [columns]=\"columns\"\n [viewType]=\"viewType()\"\n >\n <ng-template #listItemTemplate let-item=\"item\">\n <lib-user-list-detail [item]=\"item\"\n [routerLink]=\"['/' + itemService.typePlural() + '/detail/', item.id]\"\n [routerLinkActive]=\"['is-active']\">\n </lib-user-list-detail>\n </ng-template>\n</lib-list-view>\n", styles: [":host{flex-grow:1}\n"], dependencies: [{ kind: "component", type: ListViewComponent, selector: "lib-list-view", inputs: ["viewType", "itemService", "itemDetailTemplate", "columns", "sortFields", "noSelfItemsMessage", "noItemsCanCreateMessage", "noItemsMessage"] }, { kind: "component", type: UserListDetailComponent, selector: "lib-user-list-detail", inputs: ["item"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }] });
|
|
1982
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: UserComponent, isStandalone: true, selector: "lib-user", ngImport: i0, template: "<lib-list-view\n [itemService]=\"itemService\"\n [itemDetailTemplate]=\"listItemTemplate\"\n [columns]=\"columns\"\n [viewType]=\"viewType()\"\n >\n <ng-template #listItemTemplate let-item=\"item\">\n <lib-user-list-detail [item]=\"item\"\n [routerLink]=\"['/' + itemService.typePlural() + '/detail/', item.id]\"\n [routerLinkActive]=\"['is-active']\">\n </lib-user-list-detail>\n </ng-template>\n</lib-list-view>\n", styles: [":host{flex-grow:1}\n"], dependencies: [{ kind: "component", type: ListViewComponent, selector: "lib-list-view", inputs: ["viewType", "itemService", "itemDetailTemplate", "columns", "sortFields", "noSelfItemsMessage", "noItemsCanCreateMessage", "noItemsMessage", "defaultQueries"] }, { kind: "component", type: UserListDetailComponent, selector: "lib-user-list-detail", inputs: ["item"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }] });
|
|
1957
1983
|
}
|
|
1958
1984
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserComponent, decorators: [{
|
|
1959
1985
|
type: Component,
|
|
@@ -1980,7 +2006,7 @@ class GroupComponent {
|
|
|
1980
2006
|
itemService = inject(GroupService);
|
|
1981
2007
|
columns = [{ name: 'name', title: 'Name', element_type: 'string' }];
|
|
1982
2008
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: GroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1983
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: GroupComponent, isStandalone: true, selector: "lib-group", ngImport: i0, template: "<lib-list-view\n [itemService]=\"itemService\"\n [columns]=\"columns\"\n >\n</lib-list-view>\n\n", styles: [":host{flex-grow:1}\n"], dependencies: [{ kind: "component", type: ListViewComponent, selector: "lib-list-view", inputs: ["viewType", "itemService", "itemDetailTemplate", "columns", "sortFields", "noSelfItemsMessage", "noItemsCanCreateMessage", "noItemsMessage"] }] });
|
|
2009
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: GroupComponent, isStandalone: true, selector: "lib-group", ngImport: i0, template: "<lib-list-view\n [itemService]=\"itemService\"\n [columns]=\"columns\"\n >\n</lib-list-view>\n\n", styles: [":host{flex-grow:1}\n"], dependencies: [{ kind: "component", type: ListViewComponent, selector: "lib-list-view", inputs: ["viewType", "itemService", "itemDetailTemplate", "columns", "sortFields", "noSelfItemsMessage", "noItemsCanCreateMessage", "noItemsMessage", "defaultQueries"] }] });
|
|
1984
2010
|
}
|
|
1985
2011
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: GroupComponent, decorators: [{
|
|
1986
2012
|
type: Component,
|
|
@@ -1991,7 +2017,7 @@ class AddressEditComponent {
|
|
|
1991
2017
|
countryOptions = input([], ...(ngDevMode ? [{ debugName: "countryOptions" }] : []));
|
|
1992
2018
|
form = input(...(ngDevMode ? [undefined, { debugName: "form" }] : []));
|
|
1993
2019
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: AddressEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1994
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: AddressEditComponent, isStandalone: true, selector: "lib-address-edit", inputs: { countryOptions: { classPropertyName: "countryOptions", publicName: "countryOptions", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if(form(); as form){\n<div [formGroup]=\"form\" style=\"display: flex; flex-direction: column; width:100%\">\n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"line1\">Line 1</mat-label>\n <input matInput placeholder=\"Address Line 1\" type=\"text\" id=\"line1\" formControlName=\"line1\" name=\"line1\"\n required>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"line2\">Line 2</mat-label>\n <input matInput placeholder=\"Address Line 2\" type=\"text\" id=\"line2\" formControlName=\"line2\" name=\"line1\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"line3\">Line 3</mat-label>\n <input matInput placeholder=\"Address Line 3\" type=\"text\" id=\"line3\" formControlName=\"line3\" name=\"line3\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label for=\"city\">City</mat-label>\n <input matInput placeholder=\"City\" type=\"text\" id=\"city\" formControlName=\"city\" name=\"city\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label for=\"region\">Region</mat-label>\n <input matInput placeholder=\"Region\" type=\"text\" id=\"region\" formControlName=\"region\" name=\"region\" required>\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label for=\"line1\">Post Code</mat-label>\n <input matInput placeholder=\"Post Code\" type=\"text\" id=\"postcode\" formControlName=\"postcode\" name=\"postcode\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label for=\"country\">Country</mat-label>\n <mat-select formControlName=\"country\" name=\"country\" id=\"country\" required>\n @for(country of countryOptions(); track $index){\n <mat-option [value]=\"country.code\">{{country.name}}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n</div>\n}", styles: [""], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type:
|
|
2020
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: AddressEditComponent, isStandalone: true, selector: "lib-address-edit", inputs: { countryOptions: { classPropertyName: "countryOptions", publicName: "countryOptions", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if(form(); as form){\n<div [formGroup]=\"form\" style=\"display: flex; flex-direction: column; width:100%\">\n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"line1\">Line 1</mat-label>\n <input matInput placeholder=\"Address Line 1\" type=\"text\" id=\"line1\" formControlName=\"line1\" name=\"line1\"\n required>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"line2\">Line 2</mat-label>\n <input matInput placeholder=\"Address Line 2\" type=\"text\" id=\"line2\" formControlName=\"line2\" name=\"line1\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"line3\">Line 3</mat-label>\n <input matInput placeholder=\"Address Line 3\" type=\"text\" id=\"line3\" formControlName=\"line3\" name=\"line3\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label for=\"city\">City</mat-label>\n <input matInput placeholder=\"City\" type=\"text\" id=\"city\" formControlName=\"city\" name=\"city\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label for=\"region\">Region</mat-label>\n <input matInput placeholder=\"Region\" type=\"text\" id=\"region\" formControlName=\"region\" name=\"region\" required>\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label for=\"line1\">Post Code</mat-label>\n <input matInput placeholder=\"Post Code\" type=\"text\" id=\"postcode\" formControlName=\"postcode\" name=\"postcode\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label for=\"country\">Country</mat-label>\n <mat-select formControlName=\"country\" name=\"country\" id=\"country\" required>\n @for(country of countryOptions(); track $index){\n <mat-option [value]=\"country.code\">{{country.name}}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n</div>\n}", styles: [""], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i6.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
1995
2021
|
}
|
|
1996
2022
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: AddressEditComponent, decorators: [{
|
|
1997
2023
|
type: Component,
|
|
@@ -2013,18 +2039,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
2013
2039
|
}] });
|
|
2014
2040
|
|
|
2015
2041
|
class AddressForm {
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2042
|
+
static createForm(fb) {
|
|
2043
|
+
return fb.group({
|
|
2044
|
+
line1: fb.control('', Validators.required),
|
|
2045
|
+
line2: fb.control(''),
|
|
2046
|
+
line3: fb.control(''),
|
|
2047
|
+
city: fb.control(''),
|
|
2048
|
+
region: fb.control('', Validators.required),
|
|
2049
|
+
postcode: fb.control(''),
|
|
2050
|
+
country: fb.control('', Validators.required)
|
|
2051
|
+
});
|
|
2052
|
+
}
|
|
2053
|
+
static fromItem(item, fb) {
|
|
2054
|
+
const form = this.createForm(fb);
|
|
2055
|
+
this.setValue(form, item);
|
|
2056
|
+
return form;
|
|
2057
|
+
}
|
|
2058
|
+
static setValue(form, item) {
|
|
2059
|
+
form.setValue({
|
|
2028
2060
|
line1: item.line1,
|
|
2029
2061
|
line2: item.line2 || "",
|
|
2030
2062
|
line3: item.line3 || "",
|
|
@@ -2034,18 +2066,20 @@ class AddressForm {
|
|
|
2034
2066
|
country: item.country
|
|
2035
2067
|
});
|
|
2036
2068
|
}
|
|
2037
|
-
createItem() {
|
|
2038
|
-
const value =
|
|
2039
|
-
return {
|
|
2069
|
+
static createItem(form) {
|
|
2070
|
+
const value = form.value;
|
|
2071
|
+
return {
|
|
2072
|
+
line1: value.line1 || "",
|
|
2040
2073
|
line2: value.line2 || null,
|
|
2041
2074
|
line3: value.line3 || null,
|
|
2042
2075
|
city: value.city || null,
|
|
2043
2076
|
region: value.region || "",
|
|
2044
2077
|
postcode: value.postcode || null,
|
|
2045
|
-
country: value.country || ""
|
|
2078
|
+
country: value.country || ""
|
|
2079
|
+
};
|
|
2046
2080
|
}
|
|
2047
|
-
updateItem(item) {
|
|
2048
|
-
const value =
|
|
2081
|
+
static updateItem(form, item) {
|
|
2082
|
+
const value = form.value;
|
|
2049
2083
|
item.line1 = value.line1 || "";
|
|
2050
2084
|
item.line2 = value.line2 || null;
|
|
2051
2085
|
item.line3 = value.line3 || null;
|
|
@@ -2063,7 +2097,7 @@ class OrganizationComponent {
|
|
|
2063
2097
|
{ name: 'website', title: 'Website', element_type: 'url' },
|
|
2064
2098
|
{ name: 'is_partner', title: 'Is Partner', element_type: 'boolean' }];
|
|
2065
2099
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2066
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: OrganizationComponent, isStandalone: true, selector: "lib-organization", ngImport: i0, template: "<lib-list-view\n [itemService]=\"itemService\"\n [columns]=\"columns\"\n >\n</lib-list-view>\n\n\n\n", styles: [":host{flex-grow:1}\n"], dependencies: [{ kind: "component", type: ListViewComponent, selector: "lib-list-view", inputs: ["viewType", "itemService", "itemDetailTemplate", "columns", "sortFields", "noSelfItemsMessage", "noItemsCanCreateMessage", "noItemsMessage"] }] });
|
|
2100
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: OrganizationComponent, isStandalone: true, selector: "lib-organization", ngImport: i0, template: "<lib-list-view\n [itemService]=\"itemService\"\n [columns]=\"columns\"\n >\n</lib-list-view>\n\n\n\n", styles: [":host{flex-grow:1}\n"], dependencies: [{ kind: "component", type: ListViewComponent, selector: "lib-list-view", inputs: ["viewType", "itemService", "itemDetailTemplate", "columns", "sortFields", "noSelfItemsMessage", "noItemsCanCreateMessage", "noItemsMessage", "defaultQueries"] }] });
|
|
2067
2101
|
}
|
|
2068
2102
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationComponent, decorators: [{
|
|
2069
2103
|
type: Component,
|
|
@@ -2089,27 +2123,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
2089
2123
|
}], ctorParameters: () => [] });
|
|
2090
2124
|
|
|
2091
2125
|
class OrganizationForm {
|
|
2092
|
-
|
|
2126
|
+
fb = inject(FormBuilder);
|
|
2093
2127
|
form;
|
|
2094
|
-
address = new AddressForm();
|
|
2095
2128
|
constructor() {
|
|
2096
|
-
this.form = this.
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2129
|
+
this.form = OrganizationForm.createForm(this.fb);
|
|
2130
|
+
}
|
|
2131
|
+
static createForm(fb) {
|
|
2132
|
+
return fb.group({
|
|
2133
|
+
name: fb.control('', Validators.required),
|
|
2134
|
+
acronym: fb.control(''),
|
|
2135
|
+
description: fb.control(''),
|
|
2136
|
+
website: fb.control(''),
|
|
2137
|
+
address: AddressForm.createForm(fb)
|
|
2102
2138
|
});
|
|
2103
2139
|
}
|
|
2140
|
+
get address() {
|
|
2141
|
+
return this.form.get('address');
|
|
2142
|
+
}
|
|
2104
2143
|
setValue(item) {
|
|
2105
|
-
this.
|
|
2106
|
-
this.form.setValue({
|
|
2144
|
+
this.form.patchValue({
|
|
2107
2145
|
name: item.name,
|
|
2108
2146
|
acronym: item.acronym,
|
|
2109
2147
|
description: item.description,
|
|
2110
|
-
website: item.website
|
|
2111
|
-
address: this.address.form
|
|
2148
|
+
website: item.website
|
|
2112
2149
|
});
|
|
2150
|
+
AddressForm.setValue(this.address, item.address);
|
|
2113
2151
|
}
|
|
2114
2152
|
createItem() {
|
|
2115
2153
|
const value = this.form.value;
|
|
@@ -2118,7 +2156,7 @@ class OrganizationForm {
|
|
|
2118
2156
|
acronym: value.acronym || "",
|
|
2119
2157
|
description: value.description || "",
|
|
2120
2158
|
website: value.website || "",
|
|
2121
|
-
address: this.address
|
|
2159
|
+
address: AddressForm.createItem(this.address),
|
|
2122
2160
|
members: []
|
|
2123
2161
|
};
|
|
2124
2162
|
}
|
|
@@ -2127,24 +2165,23 @@ class OrganizationForm {
|
|
|
2127
2165
|
item.acronym = this.form.value.acronym || "";
|
|
2128
2166
|
item.description = this.form.value.description || "";
|
|
2129
2167
|
item.website = this.form.value.website || "";
|
|
2130
|
-
item.address = this.address
|
|
2168
|
+
item.address = AddressForm.updateItem(this.address, item.address);
|
|
2131
2169
|
return item;
|
|
2132
2170
|
}
|
|
2133
2171
|
}
|
|
2134
2172
|
|
|
2135
2173
|
class OrganizationEditComponent extends EditView {
|
|
2136
|
-
countryOptions = signal([], ...(ngDevMode ? [{ debugName: "countryOptions" }] : []));
|
|
2137
2174
|
addressService = inject(AddressService);
|
|
2138
2175
|
selectionManager = new SelectionManager();
|
|
2139
2176
|
constructor() {
|
|
2140
2177
|
super(inject(OrganizationService), new OrganizationForm());
|
|
2178
|
+
this.addressService.refreshCountryOptions();
|
|
2141
2179
|
}
|
|
2142
2180
|
ngOnInit() {
|
|
2143
2181
|
this.onInit();
|
|
2144
|
-
this.addressService.getOptions().subscribe(options => this.onOptions(options));
|
|
2145
2182
|
}
|
|
2146
2183
|
addressForm() {
|
|
2147
|
-
return this.form.address
|
|
2184
|
+
return this.form.address;
|
|
2148
2185
|
}
|
|
2149
2186
|
createItem() {
|
|
2150
2187
|
const item = this.form.createItem();
|
|
@@ -2157,19 +2194,10 @@ class OrganizationEditComponent extends EditView {
|
|
|
2157
2194
|
return item;
|
|
2158
2195
|
}
|
|
2159
2196
|
onItemAndUserAvailable(item, _) {
|
|
2160
|
-
this.form.setValue(item);
|
|
2161
2197
|
this.selectionManager.fetchCandidates(this.itemService.typename, item.id);
|
|
2162
2198
|
}
|
|
2163
|
-
onPostActions(actions) {
|
|
2164
|
-
if ('country' in actions && actions['country'].choices) {
|
|
2165
|
-
this.onCountryChoices(actions['country'].choices);
|
|
2166
|
-
}
|
|
2167
|
-
}
|
|
2168
|
-
onCountryChoices(choices) {
|
|
2169
|
-
this.countryOptions.update(() => choices.map(c => { return { name: c.display_name, code: c.value, flag: "" }; }));
|
|
2170
|
-
}
|
|
2171
2199
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2172
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: OrganizationEditComponent, isStandalone: true, selector: "lib-organization-edit", usesInheritance: true, ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n <div class=\"item-edit-container\" style=\"width:100%\">\n \n <h1 class=\"item-edit-header\">{{heading() | titlecase}}</h1>\n\n <form class=\"form-card\" [formGroup]=\"form.form\" (ngSubmit)=\"submit()\">\n\n <mat-tab-group mat-stretch-tabs=\"true\" mat-align-tabs=\"center\" style=\"width:100%;\">\n\n <mat-tab label=\"Overview\" style=\"width:100%;\">\n <div style=\"padding:10px;\">\n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"name\">Name</mat-label>\n <input matInput placeholder=\"Name\"\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n name=\"name\"\n required>\n </mat-form-field>\n \n <mat-form-field class=\"form-field\">\n <mat-label for=\"acronym\">Acronym</mat-label> \n <input matInput placeholder=\"Acronym\"\n type=\"text\"\n id=\"acronym\"\n formControlName=\"acronym\"\n name=\"acronym\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"description\">Description</mat-label>\n <textarea matInput placeholder=\"Description\"\n type=\"text\"\n id=\"description\"\n formControlName=\"description\"\n name=\"description\"\n class=\"medium-textarea\"\n required></textarea>\n </mat-form-field>\n\n <mat-accordion style=\"width:100%\">\n <mat-expansion-panel style=\"width:100%\">\n <mat-expansion-panel-header>\n <mat-panel-title>Address</mat-panel-title>\n </mat-expansion-panel-header>\n\n <lib-address-edit \n [countryOptions]=\"countryOptions()\"\n [form]=\"addressForm()\"\n ></lib-address-edit>\n </mat-expansion-panel>\n </mat-accordion>\n </div>\n </mat-tab>\n\n <mat-tab label=\"Members\" style=\"width:100%;\">\n <div style=\"padding:10px\">\n <lib-select-table [selected]=\"selectionManager.selected()\"\n [itemType]=\"'Members'\"\n [columns]=\"selectionManager.columns\"\n [options]=\"selectionManager.candidates()\"\n (itemAdded)=\"selectionManager.onAdded($event)\"\n (itemRemoved)=\"selectionManager.onRemoved($event)\"\n (searchChanged)=\"selectionManager.onSearchChanged($event)\">\n </lib-select-table>\n </div>\n </mat-tab>\n\n </mat-tab-group>\n\n <div class=\"button_group\">\n <button mat-fab\n class=\"form_action_button\"\n type=\"submit\"\n [disabled]=\"!form.form.valid\">\n <mat-icon>save</mat-icon>\n </button>\n \n <button mat-fab\n type=\"button\"\n class=\"form_action_button\"\n (click)=\"cancel()\">\n <mat-icon>cancel</mat-icon>\n </button>\n </div>\n </form>\n </div>\n</div>\n", styles: [":host{flex-grow:1}.medium-textarea{min-height:150px}.checkbox_group{justify-content:left;display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$
|
|
2200
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: OrganizationEditComponent, isStandalone: true, selector: "lib-organization-edit", usesInheritance: true, ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n <div class=\"item-edit-container\" style=\"width:100%\">\n \n <h1 class=\"item-edit-header\">{{heading() | titlecase}}</h1>\n\n <form class=\"form-card\" [formGroup]=\"form.form\" (ngSubmit)=\"submit()\">\n\n <mat-tab-group mat-stretch-tabs=\"true\" mat-align-tabs=\"center\" style=\"width:100%;\">\n\n <mat-tab label=\"Overview\" style=\"width:100%;\">\n <div style=\"padding:10px;\">\n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"name\">Name</mat-label>\n <input matInput placeholder=\"Name\"\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n name=\"name\"\n required>\n </mat-form-field>\n \n <mat-form-field class=\"form-field\">\n <mat-label for=\"acronym\">Acronym</mat-label> \n <input matInput placeholder=\"Acronym\"\n type=\"text\"\n id=\"acronym\"\n formControlName=\"acronym\"\n name=\"acronym\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"description\">Description</mat-label>\n <textarea matInput placeholder=\"Description\"\n type=\"text\"\n id=\"description\"\n formControlName=\"description\"\n name=\"description\"\n class=\"medium-textarea\"\n required></textarea>\n </mat-form-field>\n\n <mat-accordion style=\"width:100%\">\n <mat-expansion-panel style=\"width:100%\">\n <mat-expansion-panel-header>\n <mat-panel-title>Address</mat-panel-title>\n </mat-expansion-panel-header>\n\n <lib-address-edit \n [countryOptions]=\"addressService.countryOptions()\"\n [form]=\"addressForm()\"\n ></lib-address-edit>\n </mat-expansion-panel>\n </mat-accordion>\n </div>\n </mat-tab>\n\n <mat-tab label=\"Members\" style=\"width:100%;\">\n <div style=\"padding:10px\">\n <lib-select-table [selected]=\"selectionManager.selected()\"\n [itemType]=\"'Members'\"\n [columns]=\"selectionManager.columns\"\n [options]=\"selectionManager.candidates()\"\n (itemAdded)=\"selectionManager.onAdded($event)\"\n (itemRemoved)=\"selectionManager.onRemoved($event)\"\n (searchChanged)=\"selectionManager.onSearchChanged($event)\">\n </lib-select-table>\n </div>\n </mat-tab>\n\n </mat-tab-group>\n\n <div class=\"button_group\">\n <button mat-fab\n class=\"form_action_button\"\n type=\"submit\"\n [disabled]=\"!form.form.valid\">\n <mat-icon>save</mat-icon>\n </button>\n \n <button mat-fab\n type=\"button\"\n class=\"form_action_button\"\n (click)=\"cancel()\">\n <mat-icon>cancel</mat-icon>\n </button>\n </div>\n </form>\n </div>\n</div>\n", styles: [":host{flex-grow:1}.medium-textarea{min-height:150px}.checkbox_group{justify-content:left;display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatSelectModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i1$4.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i1$4.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i1$4.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i1$4.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "component", type: BackButtonComponent, selector: "lib-back-button" }, { kind: "component", type: AddressEditComponent, selector: "lib-address-edit", inputs: ["countryOptions", "form"] }, { kind: "component", type: SelectTableComponent, selector: "lib-select-table", inputs: ["itemType", "selected", "options", "columns"], outputs: ["itemAdded", "itemRemoved", "searchChanged"] }, { kind: "ngmodule", type: MatTabsModule }, { kind: "component", type: i7.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i7.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }] });
|
|
2173
2201
|
}
|
|
2174
2202
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationEditComponent, decorators: [{
|
|
2175
2203
|
type: Component,
|
|
@@ -2187,7 +2215,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
2187
2215
|
SelectTableComponent,
|
|
2188
2216
|
MatTabsModule,
|
|
2189
2217
|
TitleCasePipe
|
|
2190
|
-
], template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n <div class=\"item-edit-container\" style=\"width:100%\">\n \n <h1 class=\"item-edit-header\">{{heading() | titlecase}}</h1>\n\n <form class=\"form-card\" [formGroup]=\"form.form\" (ngSubmit)=\"submit()\">\n\n <mat-tab-group mat-stretch-tabs=\"true\" mat-align-tabs=\"center\" style=\"width:100%;\">\n\n <mat-tab label=\"Overview\" style=\"width:100%;\">\n <div style=\"padding:10px;\">\n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"name\">Name</mat-label>\n <input matInput placeholder=\"Name\"\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n name=\"name\"\n required>\n </mat-form-field>\n \n <mat-form-field class=\"form-field\">\n <mat-label for=\"acronym\">Acronym</mat-label> \n <input matInput placeholder=\"Acronym\"\n type=\"text\"\n id=\"acronym\"\n formControlName=\"acronym\"\n name=\"acronym\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"description\">Description</mat-label>\n <textarea matInput placeholder=\"Description\"\n type=\"text\"\n id=\"description\"\n formControlName=\"description\"\n name=\"description\"\n class=\"medium-textarea\"\n required></textarea>\n </mat-form-field>\n\n <mat-accordion style=\"width:100%\">\n <mat-expansion-panel style=\"width:100%\">\n <mat-expansion-panel-header>\n <mat-panel-title>Address</mat-panel-title>\n </mat-expansion-panel-header>\n\n <lib-address-edit \n [countryOptions]=\"countryOptions()\"\n [form]=\"addressForm()\"\n ></lib-address-edit>\n </mat-expansion-panel>\n </mat-accordion>\n </div>\n </mat-tab>\n\n <mat-tab label=\"Members\" style=\"width:100%;\">\n <div style=\"padding:10px\">\n <lib-select-table [selected]=\"selectionManager.selected()\"\n [itemType]=\"'Members'\"\n [columns]=\"selectionManager.columns\"\n [options]=\"selectionManager.candidates()\"\n (itemAdded)=\"selectionManager.onAdded($event)\"\n (itemRemoved)=\"selectionManager.onRemoved($event)\"\n (searchChanged)=\"selectionManager.onSearchChanged($event)\">\n </lib-select-table>\n </div>\n </mat-tab>\n\n </mat-tab-group>\n\n <div class=\"button_group\">\n <button mat-fab\n class=\"form_action_button\"\n type=\"submit\"\n [disabled]=\"!form.form.valid\">\n <mat-icon>save</mat-icon>\n </button>\n \n <button mat-fab\n type=\"button\"\n class=\"form_action_button\"\n (click)=\"cancel()\">\n <mat-icon>cancel</mat-icon>\n </button>\n </div>\n </form>\n </div>\n</div>\n", styles: [":host{flex-grow:1}.medium-textarea{min-height:150px}.checkbox_group{justify-content:left;display:flex;flex-direction:column}\n"] }]
|
|
2218
|
+
], template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n <div class=\"item-edit-container\" style=\"width:100%\">\n \n <h1 class=\"item-edit-header\">{{heading() | titlecase}}</h1>\n\n <form class=\"form-card\" [formGroup]=\"form.form\" (ngSubmit)=\"submit()\">\n\n <mat-tab-group mat-stretch-tabs=\"true\" mat-align-tabs=\"center\" style=\"width:100%;\">\n\n <mat-tab label=\"Overview\" style=\"width:100%;\">\n <div style=\"padding:10px;\">\n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"name\">Name</mat-label>\n <input matInput placeholder=\"Name\"\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n name=\"name\"\n required>\n </mat-form-field>\n \n <mat-form-field class=\"form-field\">\n <mat-label for=\"acronym\">Acronym</mat-label> \n <input matInput placeholder=\"Acronym\"\n type=\"text\"\n id=\"acronym\"\n formControlName=\"acronym\"\n name=\"acronym\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field-wide\">\n <mat-label for=\"description\">Description</mat-label>\n <textarea matInput placeholder=\"Description\"\n type=\"text\"\n id=\"description\"\n formControlName=\"description\"\n name=\"description\"\n class=\"medium-textarea\"\n required></textarea>\n </mat-form-field>\n\n <mat-accordion style=\"width:100%\">\n <mat-expansion-panel style=\"width:100%\">\n <mat-expansion-panel-header>\n <mat-panel-title>Address</mat-panel-title>\n </mat-expansion-panel-header>\n\n <lib-address-edit \n [countryOptions]=\"addressService.countryOptions()\"\n [form]=\"addressForm()\"\n ></lib-address-edit>\n </mat-expansion-panel>\n </mat-accordion>\n </div>\n </mat-tab>\n\n <mat-tab label=\"Members\" style=\"width:100%;\">\n <div style=\"padding:10px\">\n <lib-select-table [selected]=\"selectionManager.selected()\"\n [itemType]=\"'Members'\"\n [columns]=\"selectionManager.columns\"\n [options]=\"selectionManager.candidates()\"\n (itemAdded)=\"selectionManager.onAdded($event)\"\n (itemRemoved)=\"selectionManager.onRemoved($event)\"\n (searchChanged)=\"selectionManager.onSearchChanged($event)\">\n </lib-select-table>\n </div>\n </mat-tab>\n\n </mat-tab-group>\n\n <div class=\"button_group\">\n <button mat-fab\n class=\"form_action_button\"\n type=\"submit\"\n [disabled]=\"!form.form.valid\">\n <mat-icon>save</mat-icon>\n </button>\n \n <button mat-fab\n type=\"button\"\n class=\"form_action_button\"\n (click)=\"cancel()\">\n <mat-icon>cancel</mat-icon>\n </button>\n </div>\n </form>\n </div>\n</div>\n", styles: [":host{flex-grow:1}.medium-textarea{min-height:150px}.checkbox_group{justify-content:left;display:flex;flex-direction:column}\n"] }]
|
|
2191
2219
|
}], ctorParameters: () => [] });
|
|
2192
2220
|
|
|
2193
2221
|
/*
|
|
@@ -2198,5 +2226,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
2198
2226
|
* Generated bundle index. Do not edit.
|
|
2199
2227
|
*/
|
|
2200
2228
|
|
|
2201
|
-
export { Address, AddressDetailComponent, AddressEditComponent, AddressForm, AddressService, ApiError, AvatarComponent, BackButtonComponent, DetailHeaderComponent, DetailView, DynamicFormBuilderComponent, DynamicFormComponent, DynamicFormForm, ENDPOINT_URL, EditView, ErrorCode, FORM_FIELD_CHOICES, FeedbackComponent, FileRecord, FileUploadComponent, FormFieldDetailComponent, FormFieldEditComponent,
|
|
2229
|
+
export { Address, AddressDetailComponent, AddressEditComponent, AddressForm, AddressService, ApiError, AvatarComponent, BackButtonComponent, DetailHeaderComponent, DetailView, DynamicFormBuilderComponent, DynamicFormComponent, DynamicFormForm, ENDPOINT_URL, EditView, ErrorCode, FORM_FIELD_CHOICES, FeedbackComponent, FieldType, FileRecord, FileUploadComponent, FormFieldDetailComponent, FormFieldEditComponent, FormFieldValueForm, FormService, Group, GroupComponent, GroupDetailComponent, GroupService, ItemQuery, ItemService, ItemWithUserService, LOGIN_USER, LandingComponent, LeftNavComponent, LeftNavService, ListTableViewComponent, ListViewComponent, MockItemService, Organization, OrganizationComponent, OrganizationDetailComponent, OrganizationEditComponent, OrganizationService, Paginated, Permission, PopulatedFormForm, PortalMember, ResolvedPermission, RestService, SearchBarComponent, SelectTableComponent, SelectionManager, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserService, getFieldTypeFromKey };
|
|
2202
2230
|
//# sourceMappingURL=ichec-angular-core.mjs.map
|