ichec-angular-core 0.2.6 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ichec-angular-core.mjs +672 -531
- package/fesm2022/ichec-angular-core.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/styles.scss +9 -5
- package/styles/styles_theme-colors.scss +205 -0
- package/types/ichec-angular-core.d.ts +259 -230
|
@@ -1,55 +1,53 @@
|
|
|
1
|
-
import { map, catchError, mergeMap, throwError, BehaviorSubject, tap, of,
|
|
1
|
+
import { map, catchError, mergeMap, throwError, BehaviorSubject, tap, of, debounceTime, distinctUntilChanged, merge, 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, DOCUMENT, Injectable, signal,
|
|
4
|
+
import { InjectionToken, inject, DOCUMENT, Injectable, signal, Component, computed, input, output, viewChild } from '@angular/core';
|
|
5
5
|
import { CookieService } from 'ngx-cookie-service';
|
|
6
|
-
import * as i1$
|
|
6
|
+
import * as i1$2 from '@angular/forms';
|
|
7
7
|
import { FormControl, Validators, FormGroup, ReactiveFormsModule, FormBuilder } from '@angular/forms';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
12
|
-
import * as i1$1 from '@angular/material/icon';
|
|
13
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
14
|
-
import * as i2$1 from '@angular/material/button';
|
|
15
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
16
|
-
import * as i5 from '@angular/material/menu';
|
|
17
|
-
import { MatMenuModule } from '@angular/material/menu';
|
|
18
|
-
import * as i1$2 from '@angular/material/sidenav';
|
|
19
|
-
import { MatSidenavContent, MatSidenavModule } from '@angular/material/sidenav';
|
|
20
|
-
import * as i2$2 from '@angular/material/list';
|
|
21
|
-
import { MatListModule } from '@angular/material/list';
|
|
22
|
-
import { Location, TitleCasePipe, DatePipe, NgTemplateOutlet } from '@angular/common';
|
|
8
|
+
import { Location, NgTemplateOutlet, TitleCasePipe, DatePipe } from '@angular/common';
|
|
9
|
+
import * as i1$3 from '@angular/router';
|
|
10
|
+
import { ActivatedRoute, RouterModule, RouterOutlet } from '@angular/router';
|
|
23
11
|
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogClose, MatDialog } from '@angular/material/dialog';
|
|
24
|
-
import * as
|
|
12
|
+
import * as i2 from '@angular/material/button';
|
|
13
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
14
|
+
import * as i1 from '@angular/material/table';
|
|
15
|
+
import { MatTable, MatTableModule } from '@angular/material/table';
|
|
16
|
+
import * as i4 from '@angular/material/form-field';
|
|
25
17
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
18
|
+
import * as i6 from '@angular/material/select';
|
|
19
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
20
|
+
import * as i1$1 from '@angular/material/icon';
|
|
21
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
22
|
+
import * as i6$1 from '@angular/material/autocomplete';
|
|
23
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
26
24
|
import * as i3 from '@angular/material/input';
|
|
27
25
|
import { MatInputModule } from '@angular/material/input';
|
|
28
|
-
import * as
|
|
29
|
-
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
30
|
-
import * as i4 from '@angular/material/tooltip';
|
|
26
|
+
import * as i4$1 from '@angular/material/tooltip';
|
|
31
27
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
32
|
-
import * as
|
|
28
|
+
import * as i5 from '@angular/material/checkbox';
|
|
29
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
33
30
|
import { MatCardModule } from '@angular/material/card';
|
|
34
|
-
import * as i6 from '@angular/material/select';
|
|
35
|
-
import { MatSelectModule } from '@angular/material/select';
|
|
36
|
-
import * as i1$5 from '@angular/material/table';
|
|
37
|
-
import { MatTableModule, MatTable } from '@angular/material/table';
|
|
38
31
|
import * as i1$4 from '@angular/material/expansion';
|
|
39
32
|
import { MatExpansionModule } from '@angular/material/expansion';
|
|
40
|
-
import * as i6$1 from '@angular/material/autocomplete';
|
|
41
|
-
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
42
33
|
import * as i3$1 from '@angular/material/sort';
|
|
43
34
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
44
|
-
import * as i1$6 from '@angular/material/button-toggle';
|
|
45
35
|
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
46
|
-
import * as
|
|
36
|
+
import * as i1$5 from '@angular/material/progress-spinner';
|
|
47
37
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
48
|
-
import * as i2$
|
|
38
|
+
import * as i2$1 from '@angular/material/paginator';
|
|
49
39
|
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
50
|
-
import * as i2$
|
|
40
|
+
import * as i2$3 from '@angular/cdk/scrolling';
|
|
51
41
|
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
42
|
+
import * as i2$2 from '@angular/material/list';
|
|
43
|
+
import { MatListModule } from '@angular/material/list';
|
|
52
44
|
import { DataSource } from '@angular/cdk/collections';
|
|
45
|
+
import * as i2$4 from '@angular/material/toolbar';
|
|
46
|
+
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
47
|
+
import * as i5$1 from '@angular/material/menu';
|
|
48
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
49
|
+
import * as i1$6 from '@angular/material/sidenav';
|
|
50
|
+
import { MatSidenavContent, MatSidenavModule } from '@angular/material/sidenav';
|
|
53
51
|
import * as i7 from '@angular/material/tabs';
|
|
54
52
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
55
53
|
|
|
@@ -156,6 +154,27 @@ function getFieldTypeFromKey(key) {
|
|
|
156
154
|
}
|
|
157
155
|
return FieldType.Char;
|
|
158
156
|
}
|
|
157
|
+
function getFileFieldIds(form) {
|
|
158
|
+
const ids = [];
|
|
159
|
+
form.groups.map(g => g.fields.map(f => {
|
|
160
|
+
if (f.field_type == "FILE") {
|
|
161
|
+
ids.push(f.id);
|
|
162
|
+
}
|
|
163
|
+
}));
|
|
164
|
+
return ids;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
class FileRecord {
|
|
168
|
+
name = "";
|
|
169
|
+
display_name = "";
|
|
170
|
+
file_type = "standard";
|
|
171
|
+
file = null;
|
|
172
|
+
remote = "";
|
|
173
|
+
local = "";
|
|
174
|
+
constructor(params = {}) {
|
|
175
|
+
Object.assign(this, params);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
159
178
|
|
|
160
179
|
const REST_SERVICE_CONFIG = new InjectionToken("Config for the rest service");
|
|
161
180
|
class RestService {
|
|
@@ -318,47 +337,22 @@ class UserService extends ItemService {
|
|
|
318
337
|
permissions = new Map();
|
|
319
338
|
login(next = "/") {
|
|
320
339
|
console.log("Starting login flow");
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
_getServiceManifest(next) {
|
|
324
|
-
console.log("Fetching service manifest");
|
|
325
|
-
return this._http.get(this.config.endpoint_url + "/manifest").pipe(mergeMap(manifest => { this.manifest = manifest; return this._getSelf(next); }));
|
|
326
|
-
}
|
|
327
|
-
_getSelf(next) {
|
|
328
|
-
console.log("Attempting to fetch self profile");
|
|
329
|
-
return this.getUrl(this.config.endpoint_url + "/api/self/").pipe(tap(user => this.onLoggedIn(user)), map(user => { return user; }), catchError(e => this._login(e, next)));
|
|
330
|
-
}
|
|
331
|
-
_login(error, next) {
|
|
332
|
-
if (error.status == 401) {
|
|
333
|
-
console.log("Couldn't authenticate with session - redirect to login url: ", this.manifest.login_url, error);
|
|
334
|
-
this._do_login_redirect(next);
|
|
335
|
-
return of(null);
|
|
336
|
-
}
|
|
337
|
-
else {
|
|
338
|
-
console.log("Error logging in: ", error);
|
|
339
|
-
return throwError(() => error);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
_do_login_redirect(next) {
|
|
343
|
-
let prefix = "";
|
|
344
|
-
if (this.config.endpoint_url) {
|
|
345
|
-
prefix = this.config.endpoint_url + "/";
|
|
346
|
-
}
|
|
347
|
-
this.document.location.href = prefix + this.manifest.login_url + "/?next=" + next;
|
|
340
|
+
this._getServiceManifest().subscribe(m => { this.manifest = m; this._do_login(next); });
|
|
348
341
|
}
|
|
349
342
|
logout(next = "") {
|
|
350
|
-
if (this.loggedInUser === null) {
|
|
343
|
+
if (this.loggedInUser.value === null) {
|
|
351
344
|
return;
|
|
352
345
|
}
|
|
353
346
|
console.log("Session Log Out");
|
|
354
347
|
let prefix = "";
|
|
355
348
|
if (this.config.endpoint_url) {
|
|
356
|
-
prefix = this.config.endpoint_url;
|
|
349
|
+
prefix = this.config.endpoint_url + "/";
|
|
357
350
|
}
|
|
358
351
|
let suffix = "";
|
|
359
352
|
if (next) {
|
|
360
353
|
suffix = "?next=" + next;
|
|
361
354
|
}
|
|
355
|
+
console.log("posting logout to: ", prefix + this.manifest.logout_url + "/" + suffix);
|
|
362
356
|
this._http.post(prefix + this.manifest.logout_url + "/" + suffix, "", {
|
|
363
357
|
headers: new HttpHeaders({
|
|
364
358
|
'X-CSRFToken': this.cookieService.get("csrftoken")
|
|
@@ -374,6 +368,34 @@ class UserService extends ItemService {
|
|
|
374
368
|
//this.login(next)
|
|
375
369
|
});
|
|
376
370
|
}
|
|
371
|
+
getSelf() {
|
|
372
|
+
console.log("Attempting to fetch self profile");
|
|
373
|
+
return this._getServiceManifest().pipe(mergeMap(m => { this.manifest = m; return this._getSelf(); }));
|
|
374
|
+
}
|
|
375
|
+
_getSelf() {
|
|
376
|
+
return this.getUrl(this.config.endpoint_url + "/api/self/").pipe(tap(user => this.onSelf(user)), map(user => { return user; }), catchError(e => this._selfFetchFailed(e)));
|
|
377
|
+
}
|
|
378
|
+
_selfFetchFailed(error) {
|
|
379
|
+
if (error.status == 401) {
|
|
380
|
+
console.log("No valid user session found:", error);
|
|
381
|
+
return of(null);
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
console.log("Unexpected error fetching user session: ", error);
|
|
385
|
+
return throwError(() => error);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
_getServiceManifest() {
|
|
389
|
+
console.log("Fetching service manifest");
|
|
390
|
+
return this._http.get(this.config.endpoint_url + "/manifest");
|
|
391
|
+
}
|
|
392
|
+
_do_login(next) {
|
|
393
|
+
let prefix = "";
|
|
394
|
+
if (this.config.endpoint_url) {
|
|
395
|
+
prefix = this.config.endpoint_url + "/";
|
|
396
|
+
}
|
|
397
|
+
this.document.location.href = prefix + this.manifest.login_url + "/?next=" + next;
|
|
398
|
+
}
|
|
377
399
|
hasAddPermission(feature) {
|
|
378
400
|
const perm = this.permissions.get(feature);
|
|
379
401
|
if (!perm) {
|
|
@@ -402,8 +424,8 @@ class UserService extends ItemService {
|
|
|
402
424
|
}
|
|
403
425
|
return perm.canView;
|
|
404
426
|
}
|
|
405
|
-
|
|
406
|
-
console.log("
|
|
427
|
+
onSelf(user) {
|
|
428
|
+
console.log("Fetched self user: " + user.username);
|
|
407
429
|
this.loggedInUser.next(user);
|
|
408
430
|
this.processPermissions();
|
|
409
431
|
}
|
|
@@ -490,69 +512,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
490
512
|
}]
|
|
491
513
|
}], ctorParameters: () => [] });
|
|
492
514
|
|
|
493
|
-
class AddressService extends ItemWithUserService {
|
|
494
|
-
_url = Address.plural;
|
|
495
|
-
typename = Address.typename;
|
|
496
|
-
countryOptions = signal([], ...(ngDevMode ? [{ debugName: "countryOptions" }] : []));
|
|
497
|
-
refreshCountryOptions() {
|
|
498
|
-
this.getOptions().subscribe(options => this.onOptions(options));
|
|
499
|
-
}
|
|
500
|
-
onOptions(options) {
|
|
501
|
-
if (!options.actions) {
|
|
502
|
-
return;
|
|
503
|
-
}
|
|
504
|
-
if ('POST' in options.actions) {
|
|
505
|
-
this.onPostActions(options.actions['POST']);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
onPostActions(actions) {
|
|
509
|
-
if ('country' in actions && actions['country'].choices) {
|
|
510
|
-
this.onCountryChoices(actions['country'].choices);
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
onCountryChoices(choices) {
|
|
514
|
-
this.countryOptions.update(() => choices.map(c => { return { name: c.display_name, code: c.value, flag: "" }; }));
|
|
515
|
-
}
|
|
516
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: AddressService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
517
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: AddressService, providedIn: 'root' });
|
|
518
|
-
}
|
|
519
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: AddressService, decorators: [{
|
|
520
|
-
type: Injectable,
|
|
521
|
-
args: [{
|
|
522
|
-
providedIn: 'root'
|
|
523
|
-
}]
|
|
524
|
-
}] });
|
|
525
|
-
|
|
526
|
-
class GroupService extends ItemWithUserService {
|
|
527
|
-
_url = Group.plural;
|
|
528
|
-
typename = Group.typename;
|
|
529
|
-
constructor() {
|
|
530
|
-
super();
|
|
531
|
-
this.userService.loggedInUser.subscribe(user => this.refreshUserItems(user));
|
|
532
|
-
}
|
|
533
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GroupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
534
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GroupService, providedIn: 'root' });
|
|
535
|
-
}
|
|
536
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GroupService, decorators: [{
|
|
537
|
-
type: Injectable,
|
|
538
|
-
args: [{
|
|
539
|
-
providedIn: 'root'
|
|
540
|
-
}]
|
|
541
|
-
}], ctorParameters: () => [] });
|
|
542
|
-
|
|
543
|
-
class OrganizationService extends ItemWithUserService {
|
|
544
|
-
_url = Organization.plural;
|
|
545
|
-
typename = Organization.typename;
|
|
546
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
547
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationService, providedIn: 'root' });
|
|
548
|
-
}
|
|
549
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationService, decorators: [{
|
|
550
|
-
type: Injectable,
|
|
551
|
-
args: [{
|
|
552
|
-
providedIn: 'root'
|
|
553
|
-
}]
|
|
554
|
-
}] });
|
|
555
|
-
|
|
556
515
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
557
516
|
class FormService {
|
|
558
517
|
static getBaseTemplate() {
|
|
@@ -672,6 +631,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
672
631
|
}]
|
|
673
632
|
}] });
|
|
674
633
|
|
|
634
|
+
class GroupService extends ItemWithUserService {
|
|
635
|
+
_url = Group.plural;
|
|
636
|
+
typename = Group.typename;
|
|
637
|
+
constructor() {
|
|
638
|
+
super();
|
|
639
|
+
this.userService.loggedInUser.subscribe(user => this.refreshUserItems(user));
|
|
640
|
+
}
|
|
641
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GroupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
642
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GroupService, providedIn: 'root' });
|
|
643
|
+
}
|
|
644
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GroupService, decorators: [{
|
|
645
|
+
type: Injectable,
|
|
646
|
+
args: [{
|
|
647
|
+
providedIn: 'root'
|
|
648
|
+
}]
|
|
649
|
+
}], ctorParameters: () => [] });
|
|
650
|
+
|
|
675
651
|
class LeftNavService {
|
|
676
652
|
activeOptions = signal(new Set(), ...(ngDevMode ? [{ debugName: "activeOptions" }] : []));
|
|
677
653
|
_groups = [];
|
|
@@ -707,6 +683,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
707
683
|
}]
|
|
708
684
|
}], ctorParameters: () => [] });
|
|
709
685
|
|
|
686
|
+
class AddressService extends ItemWithUserService {
|
|
687
|
+
_url = Address.plural;
|
|
688
|
+
typename = Address.typename;
|
|
689
|
+
countryOptions = signal([], ...(ngDevMode ? [{ debugName: "countryOptions" }] : []));
|
|
690
|
+
refreshCountryOptions() {
|
|
691
|
+
this.getOptions().subscribe(options => this.onOptions(options));
|
|
692
|
+
}
|
|
693
|
+
onOptions(options) {
|
|
694
|
+
if (!options.actions) {
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
if ('POST' in options.actions) {
|
|
698
|
+
this.onPostActions(options.actions['POST']);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
onPostActions(actions) {
|
|
702
|
+
if ('country' in actions && actions['country'].choices) {
|
|
703
|
+
this.onCountryChoices(actions['country'].choices);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
onCountryChoices(choices) {
|
|
707
|
+
this.countryOptions.update(() => choices.map(c => { return { name: c.display_name, code: c.value, flag: "" }; }));
|
|
708
|
+
}
|
|
709
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: AddressService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
710
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: AddressService, providedIn: 'root' });
|
|
711
|
+
}
|
|
712
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: AddressService, decorators: [{
|
|
713
|
+
type: Injectable,
|
|
714
|
+
args: [{
|
|
715
|
+
providedIn: 'root'
|
|
716
|
+
}]
|
|
717
|
+
}] });
|
|
718
|
+
|
|
719
|
+
class OrganizationService extends ItemWithUserService {
|
|
720
|
+
_url = Organization.plural;
|
|
721
|
+
typename = Organization.typename;
|
|
722
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
723
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationService, providedIn: 'root' });
|
|
724
|
+
}
|
|
725
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationService, decorators: [{
|
|
726
|
+
type: Injectable,
|
|
727
|
+
args: [{
|
|
728
|
+
providedIn: 'root'
|
|
729
|
+
}]
|
|
730
|
+
}] });
|
|
731
|
+
|
|
710
732
|
class MockItemService {
|
|
711
733
|
canEdit() {
|
|
712
734
|
return false;
|
|
@@ -722,61 +744,6 @@ class MockItemService {
|
|
|
722
744
|
}
|
|
723
745
|
}
|
|
724
746
|
|
|
725
|
-
class TopBarComponent {
|
|
726
|
-
title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
727
|
-
user = input.required(...(ngDevMode ? [{ debugName: "user" }] : []));
|
|
728
|
-
userService = inject(UserService);
|
|
729
|
-
onLogout() {
|
|
730
|
-
this.userService.logout();
|
|
731
|
-
}
|
|
732
|
-
get initials() {
|
|
733
|
-
return PortalMember.getInitials(this.user());
|
|
734
|
-
}
|
|
735
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TopBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
736
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", type: TopBarComponent, isStandalone: true, selector: "lib-top-bar", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "\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", 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: 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: "ngmodule", type: MatMenuModule }, { kind: "component", type: i5.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.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }] });
|
|
737
|
-
}
|
|
738
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TopBarComponent, decorators: [{
|
|
739
|
-
type: Component,
|
|
740
|
-
args: [{ selector: 'lib-top-bar', imports: [RouterModule,
|
|
741
|
-
MatToolbarModule,
|
|
742
|
-
MatIconModule,
|
|
743
|
-
MatButtonModule,
|
|
744
|
-
MatMenuModule], template: "\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", styles: [".topbar-spacer{flex:1 1 auto}\n"] }]
|
|
745
|
-
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], user: [{ type: i0.Input, args: [{ isSignal: true, alias: "user", required: true }] }] } });
|
|
746
|
-
|
|
747
|
-
class LeftNavComponent {
|
|
748
|
-
_leftNavService = inject(LeftNavService);
|
|
749
|
-
sideNavContent = viewChild(MatSidenavContent, ...(ngDevMode ? [{ debugName: "sideNavContent" }] : []));
|
|
750
|
-
getOptions() {
|
|
751
|
-
return this._leftNavService.activeOptions;
|
|
752
|
-
}
|
|
753
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeftNavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
754
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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 _leftNavService.activeOptions(); 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$2.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { kind: "component", type: i1$2.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { kind: "component", type: i1$2.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"] }] });
|
|
755
|
-
}
|
|
756
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeftNavComponent, decorators: [{
|
|
757
|
-
type: Component,
|
|
758
|
-
args: [{ selector: 'lib-left-nav', imports: [MatSidenavModule, MatListModule, RouterOutlet, RouterModule], template: "<mat-sidenav-container class=\"leftnav-container\">\n <mat-sidenav mode=\"side\" class=\"leftnav-side\" opened>\n <mat-nav-list>\n @for (option of _leftNavService.activeOptions(); 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"] }]
|
|
759
|
-
}], propDecorators: { sideNavContent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatSidenavContent), { isSignal: true }] }] } });
|
|
760
|
-
|
|
761
|
-
class FeedbackComponent {
|
|
762
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FeedbackComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
763
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", type: FeedbackComponent, isStandalone: true, selector: "lib-feedback", ngImport: i0, template: "<p>feedback works!</p>\n", styles: [""] });
|
|
764
|
-
}
|
|
765
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FeedbackComponent, decorators: [{
|
|
766
|
-
type: Component,
|
|
767
|
-
args: [{ selector: 'lib-feedback', imports: [], template: "<p>feedback works!</p>\n" }]
|
|
768
|
-
}] });
|
|
769
|
-
|
|
770
|
-
class AvatarComponent {
|
|
771
|
-
text = input("", ...(ngDevMode ? [{ debugName: "text" }] : []));
|
|
772
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
773
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", type: AvatarComponent, isStandalone: true, selector: "lib-avatar", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"container\"> <span>{{text()}}</span> </div>", styles: [".container{width:36px;height:36px;border-radius:100%;text-align:center;justify-content:center;align-content:center;background-color:#d3d3d3}.container span{line-height:8px;color:#000}\n"] });
|
|
774
|
-
}
|
|
775
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
776
|
-
type: Component,
|
|
777
|
-
args: [{ selector: 'lib-avatar', imports: [], template: "<div class=\"container\"> <span>{{text()}}</span> </div>", styles: [".container{width:36px;height:36px;border-radius:100%;text-align:center;justify-content:center;align-content:center;background-color:#d3d3d3}.container span{line-height:8px;color:#000}\n"] }]
|
|
778
|
-
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }] } });
|
|
779
|
-
|
|
780
747
|
class DeleteDialogComponent {
|
|
781
748
|
dialogRef = inject((MatDialogRef));
|
|
782
749
|
data = inject(MAT_DIALOG_DATA);
|
|
@@ -784,7 +751,7 @@ class DeleteDialogComponent {
|
|
|
784
751
|
this.dialogRef.close();
|
|
785
752
|
}
|
|
786
753
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DeleteDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
787
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", type: DeleteDialogComponent, isStandalone: true, selector: "lib-delete-dialog", ngImport: i0, template: "<h2 mat-dialog-title>{{data.title}}</h2>\n<mat-dialog-content>\n <p>{{data.message}}</p>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button matButton (click)=\"onNoClick()\">No Thanks</button>\n <button matButton [mat-dialog-close]=\"true\" cdkFocusInitial>Delete</button>\n</mat-dialog-actions>", styles: [""], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2
|
|
754
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", type: DeleteDialogComponent, isStandalone: true, selector: "lib-delete-dialog", ngImport: i0, template: "<h2 mat-dialog-title>{{data.title}}</h2>\n<mat-dialog-content>\n <p>{{data.message}}</p>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button matButton (click)=\"onNoClick()\">No Thanks</button>\n <button matButton [mat-dialog-close]=\"true\" cdkFocusInitial>Delete</button>\n</mat-dialog-actions>", styles: [""], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.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: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] });
|
|
788
755
|
}
|
|
789
756
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DeleteDialogComponent, decorators: [{
|
|
790
757
|
type: Component,
|
|
@@ -806,7 +773,18 @@ class DetailView {
|
|
|
806
773
|
this.itemService = itemService;
|
|
807
774
|
}
|
|
808
775
|
onInit() {
|
|
809
|
-
this.
|
|
776
|
+
const id = Number(this.route.snapshot.paramMap.get('id'));
|
|
777
|
+
if (id) {
|
|
778
|
+
this._getItem(id);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
onSelection(id) {
|
|
782
|
+
if (id) {
|
|
783
|
+
this._getItem(id);
|
|
784
|
+
}
|
|
785
|
+
else {
|
|
786
|
+
this.item.set(null);
|
|
787
|
+
}
|
|
810
788
|
}
|
|
811
789
|
title() {
|
|
812
790
|
if (this.itemService.typename) {
|
|
@@ -821,12 +799,6 @@ class DetailView {
|
|
|
821
799
|
} });
|
|
822
800
|
}
|
|
823
801
|
onItemAndUserAvailable(_item, _user) { }
|
|
824
|
-
getItem() {
|
|
825
|
-
const id = Number(this.route.snapshot.paramMap.get('id'));
|
|
826
|
-
this.itemService.getItem(id).subscribe(item => {
|
|
827
|
-
this.onItemAvailable(item);
|
|
828
|
-
});
|
|
829
|
-
}
|
|
830
802
|
onDeleteClicked() {
|
|
831
803
|
const dialogRef = this.deleteDialog.open(DeleteDialogComponent, {
|
|
832
804
|
data: {
|
|
@@ -855,6 +827,11 @@ class DetailView {
|
|
|
855
827
|
canDelete() {
|
|
856
828
|
return this.itemService.canDelete();
|
|
857
829
|
}
|
|
830
|
+
_getItem(id) {
|
|
831
|
+
this.itemService.getItem(id).subscribe(item => {
|
|
832
|
+
this.onItemAvailable(item);
|
|
833
|
+
});
|
|
834
|
+
}
|
|
858
835
|
}
|
|
859
836
|
|
|
860
837
|
class EditView {
|
|
@@ -998,6 +975,172 @@ class EditView {
|
|
|
998
975
|
}
|
|
999
976
|
}
|
|
1000
977
|
|
|
978
|
+
class SelectTableComponent {
|
|
979
|
+
itemType = input("", ...(ngDevMode ? [{ debugName: "itemType" }] : []));
|
|
980
|
+
selected = input([], ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
981
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
982
|
+
columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
983
|
+
itemAdded = output();
|
|
984
|
+
itemRemoved = output();
|
|
985
|
+
searchChanged = output();
|
|
986
|
+
itemTemplate = input(null, ...(ngDevMode ? [{ debugName: "itemTemplate" }] : []));
|
|
987
|
+
columnNames = computed(() => { const names = this.columns().map(c => c.name); names.push("remove"); return names; }, ...(ngDevMode ? [{ debugName: "columnNames" }] : []));
|
|
988
|
+
searchControl = new FormControl('');
|
|
989
|
+
table = viewChild(MatTable, ...(ngDevMode ? [{ debugName: "table" }] : []));
|
|
990
|
+
ngOnInit() {
|
|
991
|
+
this.searchControl.valueChanges.subscribe(value => this.searchChanged.emit(value));
|
|
992
|
+
}
|
|
993
|
+
remove(id) {
|
|
994
|
+
this.itemRemoved.emit(id);
|
|
995
|
+
this.table()?.renderRows();
|
|
996
|
+
}
|
|
997
|
+
add() {
|
|
998
|
+
if (this.searchControl.value) {
|
|
999
|
+
this.itemAdded.emit(this.searchControl.value);
|
|
1000
|
+
}
|
|
1001
|
+
this.searchControl.reset();
|
|
1002
|
+
this.table()?.renderRows();
|
|
1003
|
+
}
|
|
1004
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SelectTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1005
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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 }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", 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' style=\"width:100%\">\n <div style=\"width:100%; display:flex; flex-direction: row;\">\n <mat-form-field style=\"width:100%\">\n <mat-label>Add {{itemType()}}</mat-label>\n <input \n type=\"text\"\n aria-label=\"Selected item\"\n matInput\n [formControl]=\"searchControl\" \n placeholder=\"Search\"\n [matAutocomplete]=\"auto\">\n\n <mat-autocomplete #auto=\"matAutocomplete\" style=\"width:100%\">\n @for(item of options(); track item.item.id){\n <mat-option [value]=\"item.title\" style=\"width:100%\">\n <ng-container\n *ngTemplateOutlet=\"itemTemplate(); context: { item: item.item }\">\n </ng-container>\n </mat-option>\n }\n </mat-autocomplete>\n </mat-form-field>\n\n <button mat-mini-fab type=\"button\" \n class=\"form_action_button\" \n (click)=\"add()\">\n <mat-icon>add</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.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1.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.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2.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: i1$1.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"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1006
|
+
}
|
|
1007
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SelectTableComponent, decorators: [{
|
|
1008
|
+
type: Component,
|
|
1009
|
+
args: [{ selector: 'lib-select-table', imports: [MatTableModule,
|
|
1010
|
+
MatFormFieldModule,
|
|
1011
|
+
MatButtonModule,
|
|
1012
|
+
MatSelectModule,
|
|
1013
|
+
MatIconModule,
|
|
1014
|
+
MatAutocompleteModule,
|
|
1015
|
+
ReactiveFormsModule,
|
|
1016
|
+
MatInputModule,
|
|
1017
|
+
NgTemplateOutlet], template: "<div class='select-container' style=\"width:100%\">\n <div style=\"width:100%; display:flex; flex-direction: row;\">\n <mat-form-field style=\"width:100%\">\n <mat-label>Add {{itemType()}}</mat-label>\n <input \n type=\"text\"\n aria-label=\"Selected item\"\n matInput\n [formControl]=\"searchControl\" \n placeholder=\"Search\"\n [matAutocomplete]=\"auto\">\n\n <mat-autocomplete #auto=\"matAutocomplete\" style=\"width:100%\">\n @for(item of options(); track item.item.id){\n <mat-option [value]=\"item.title\" style=\"width:100%\">\n <ng-container\n *ngTemplateOutlet=\"itemTemplate(); context: { item: item.item }\">\n </ng-container>\n </mat-option>\n }\n </mat-autocomplete>\n </mat-form-field>\n\n <button mat-mini-fab type=\"button\" \n class=\"form_action_button\" \n (click)=\"add()\">\n <mat-icon>add</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"] }]
|
|
1018
|
+
}], propDecorators: { itemType: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemType", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], itemAdded: [{ type: i0.Output, args: ["itemAdded"] }], itemRemoved: [{ type: i0.Output, args: ["itemRemoved"] }], searchChanged: [{ type: i0.Output, args: ["searchChanged"] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], table: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatTable), { isSignal: true }] }] } });
|
|
1019
|
+
|
|
1020
|
+
const USER_TABLE_FULL = [
|
|
1021
|
+
{ name: 'first_name', title: 'First Name', element_type: 'string' },
|
|
1022
|
+
{ name: 'last_name', title: 'Surname', element_type: 'string' },
|
|
1023
|
+
{ name: 'username', title: 'Username', element_type: 'string' },
|
|
1024
|
+
{ name: 'email', title: 'Email', element_type: 'email' }
|
|
1025
|
+
];
|
|
1026
|
+
|
|
1027
|
+
class SelectionManager {
|
|
1028
|
+
candidates = signal([], ...(ngDevMode ? [{ debugName: "candidates" }] : []));
|
|
1029
|
+
selected = signal([], ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
1030
|
+
columns = [];
|
|
1031
|
+
itemService;
|
|
1032
|
+
constructor(itemService) {
|
|
1033
|
+
this.itemService = itemService;
|
|
1034
|
+
}
|
|
1035
|
+
fetchCandidates(item, id) {
|
|
1036
|
+
const queries = new Map([[item, id.toString()]]);
|
|
1037
|
+
const query = new ItemQuery({ queries: queries });
|
|
1038
|
+
this.itemService.get(query).subscribe(items => this.selected.set(items.results));
|
|
1039
|
+
this.itemService.get().subscribe(items => this.updateCandidates(items));
|
|
1040
|
+
}
|
|
1041
|
+
updateCandidates(items) {
|
|
1042
|
+
this.candidates.set(items.results.map(item => this.toSelectable(item)));
|
|
1043
|
+
}
|
|
1044
|
+
onRemoved(id) {
|
|
1045
|
+
const url = this.selected().find(m => m.id == id).url;
|
|
1046
|
+
this.selected.update(items => items.filter(m => m.id != id));
|
|
1047
|
+
return url;
|
|
1048
|
+
}
|
|
1049
|
+
onAdded(title) {
|
|
1050
|
+
const selected = this.candidates().find(m => m.title == title);
|
|
1051
|
+
if (selected) {
|
|
1052
|
+
this.selected.update(members => { members.push(selected.item); return members; });
|
|
1053
|
+
}
|
|
1054
|
+
this.candidates.update(members => members.filter(m => m.title != title));
|
|
1055
|
+
return this.selected().find(m => this.hasTitle(m, title)).url;
|
|
1056
|
+
}
|
|
1057
|
+
onSearchChanged(searchTerm) {
|
|
1058
|
+
if (searchTerm) {
|
|
1059
|
+
this.itemService.get(new ItemQuery({ filter: searchTerm })).subscribe(items => this.updateCandidates(items));
|
|
1060
|
+
}
|
|
1061
|
+
else {
|
|
1062
|
+
this.itemService.get().subscribe(items => this.updateCandidates(items));
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
class MemberSelectionManager extends SelectionManager {
|
|
1067
|
+
columns = USER_TABLE_FULL;
|
|
1068
|
+
constructor() {
|
|
1069
|
+
super(inject(UserService));
|
|
1070
|
+
}
|
|
1071
|
+
toSelectable(item) {
|
|
1072
|
+
return { title: item.username, item: item };
|
|
1073
|
+
}
|
|
1074
|
+
hasTitle(item, title) {
|
|
1075
|
+
return item.username == title;
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
class BackButtonComponent {
|
|
1080
|
+
location = inject(Location);
|
|
1081
|
+
goBack() {
|
|
1082
|
+
this.location.back();
|
|
1083
|
+
}
|
|
1084
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: BackButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1085
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", 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-left:5px}\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.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }] });
|
|
1086
|
+
}
|
|
1087
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: BackButtonComponent, decorators: [{
|
|
1088
|
+
type: Component,
|
|
1089
|
+
args: [{ selector: 'lib-back-button', imports: [MatIconModule, MatButtonModule], 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-left:5px}\n"] }]
|
|
1090
|
+
}] });
|
|
1091
|
+
|
|
1092
|
+
class DetailHeaderComponent {
|
|
1093
|
+
id = input(0, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
1094
|
+
text = input("", ...(ngDevMode ? [{ debugName: "text" }] : []));
|
|
1095
|
+
route = input("", ...(ngDevMode ? [{ debugName: "route" }] : []));
|
|
1096
|
+
canEdit = input(false, ...(ngDevMode ? [{ debugName: "canEdit" }] : []));
|
|
1097
|
+
canDelete = input(false, ...(ngDevMode ? [{ debugName: "canDelete" }] : []));
|
|
1098
|
+
deleteClicked = output();
|
|
1099
|
+
fullRoute = computed(() => "/" + this.route() + "/edit/", ...(ngDevMode ? [{ debugName: "fullRoute" }] : []));
|
|
1100
|
+
deleteClick() {
|
|
1101
|
+
this.deleteClicked.emit();
|
|
1102
|
+
}
|
|
1103
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DetailHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1104
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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:0}.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$3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] });
|
|
1105
|
+
}
|
|
1106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DetailHeaderComponent, decorators: [{
|
|
1107
|
+
type: Component,
|
|
1108
|
+
args: [{ selector: 'lib-detail-header', imports: [RouterModule,
|
|
1109
|
+
MatButtonModule,
|
|
1110
|
+
MatIconModule, MatTooltipModule], 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:0}.controls{display:flex;flex-direction:row;align-content:center;justify-content:center}.control-button{padding:5px;margin:5px}\n"] }]
|
|
1111
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], route: [{ type: i0.Input, args: [{ isSignal: true, alias: "route", required: false }] }], canEdit: [{ type: i0.Input, args: [{ isSignal: true, alias: "canEdit", required: false }] }], canDelete: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDelete", required: false }] }], deleteClicked: [{ type: i0.Output, args: ["deleteClicked"] }] } });
|
|
1112
|
+
|
|
1113
|
+
class SearchBarComponent {
|
|
1114
|
+
itemType = input("", ...(ngDevMode ? [{ debugName: "itemType" }] : []));
|
|
1115
|
+
sortFields = input([], ...(ngDevMode ? [{ debugName: "sortFields" }] : []));
|
|
1116
|
+
sortAscending = signal(true, ...(ngDevMode ? [{ debugName: "sortAscending" }] : []));
|
|
1117
|
+
searchChanged = output();
|
|
1118
|
+
searchFilter = new FormControl();
|
|
1119
|
+
ngAfterViewInit() {
|
|
1120
|
+
this.searchFilter.valueChanges.pipe(debounceTime(150), distinctUntilChanged(), tap(() => {
|
|
1121
|
+
this.searchEntered();
|
|
1122
|
+
})).subscribe();
|
|
1123
|
+
}
|
|
1124
|
+
clearSearch() {
|
|
1125
|
+
this.searchFilter.setValue("");
|
|
1126
|
+
}
|
|
1127
|
+
searchEntered() {
|
|
1128
|
+
this.searchChanged.emit(this.searchFilter.value);
|
|
1129
|
+
}
|
|
1130
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SearchBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1131
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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;width:100%\">\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$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.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: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }] });
|
|
1132
|
+
}
|
|
1133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SearchBarComponent, decorators: [{
|
|
1134
|
+
type: Component,
|
|
1135
|
+
args: [{ selector: 'lib-search-bar', imports: [ReactiveFormsModule,
|
|
1136
|
+
MatInputModule,
|
|
1137
|
+
MatTooltipModule,
|
|
1138
|
+
MatButtonModule,
|
|
1139
|
+
MatSelectModule,
|
|
1140
|
+
MatIconModule,
|
|
1141
|
+
TitleCasePipe], template: "<div class=\"container\">\n <mat-form-field class=\"search\" style=\"margin: 10px;width:100%\">\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"] }]
|
|
1142
|
+
}], propDecorators: { itemType: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemType", required: false }] }], sortFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortFields", required: false }] }], searchChanged: [{ type: i0.Output, args: ["searchChanged"] }] } });
|
|
1143
|
+
|
|
1001
1144
|
class FileUploadComponent {
|
|
1002
1145
|
control = input.required(...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
1003
1146
|
onFileUpload(event) {
|
|
@@ -1032,7 +1175,7 @@ class FileUploadComponent {
|
|
|
1032
1175
|
this.control().setValue(record);
|
|
1033
1176
|
}
|
|
1034
1177
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1035
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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 || control().value.file)\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\n @if(control().value.local){\n <img alt=\"{{control().value.display_name}}\" src=\"{{control().value.local}}\" style=\"height:120px;\">\n }\n @else {\n <div>{{control().value.file?.name}}</div>\n }\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\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: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2
|
|
1178
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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 || control().value.file)\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\n @if(control().value.local){\n <img alt=\"{{control().value.display_name}}\" src=\"{{control().value.local}}\" style=\"height:120px;\">\n }\n @else {\n <div>{{control().value.file?.name}}</div>\n }\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\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: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.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$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }] });
|
|
1036
1179
|
}
|
|
1037
1180
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FileUploadComponent, decorators: [{
|
|
1038
1181
|
type: Component,
|
|
@@ -1056,7 +1199,7 @@ class FormFieldDetailComponent {
|
|
|
1056
1199
|
return this.form().get(this.key);
|
|
1057
1200
|
}
|
|
1058
1201
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FormFieldDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1059
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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 <h3>{{ field().label }}</h3>\n <p>{{field().description}}</p>\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 @case ('CHAR') {\n <mat-form-field class=\"form-field\">\n <mat-label>{{ field().label }}</mat-label>\n <input matInput\n [placeholder]=\"field().default\"\n type=\"text\"\n [formControlName]=\"key\"\n name=\"key\">\n </mat-form-field>\n }\n @case('FILE') {\n <div class=\"form-field\">\n @if(field().template)\n {\n <a href=\"{{field().template}}\" matFab extended aria-label=\"Download template\">\n <mat-icon>download</mat-icon>\n Download Form\n </a>\n }\n <h4>Upload Completed Form</h4>\n <lib-file-upload [control]=\"control\"></lib-file-upload>\n </div>\n } \n }\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$
|
|
1202
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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 <h3>{{ field().label }}</h3>\n <p>{{field().description}}</p>\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 @case ('CHAR') {\n <mat-form-field class=\"form-field\">\n <mat-label>{{ field().label }}</mat-label>\n <input matInput\n [placeholder]=\"field().default\"\n type=\"text\"\n [formControlName]=\"key\"\n name=\"key\">\n </mat-form-field>\n }\n @case('FILE') {\n <div class=\"form-field\">\n @if(field().template)\n {\n <a href=\"{{field().template}}\" matFab extended aria-label=\"Download template\">\n <mat-icon>download</mat-icon>\n Download Form\n </a>\n }\n <h4>Upload Completed Form</h4>\n <lib-file-upload [control]=\"control\"></lib-file-upload>\n </div>\n } \n }\n </div>\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],[formArray],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: MatButtonModule }, { kind: "component", type: i2.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i5.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: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: FileUploadComponent, selector: "lib-file-upload", inputs: ["control"] }] });
|
|
1060
1203
|
}
|
|
1061
1204
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FormFieldDetailComponent, decorators: [{
|
|
1062
1205
|
type: Component,
|
|
@@ -1091,7 +1234,7 @@ class FormFieldEditComponent {
|
|
|
1091
1234
|
this.cancelled.emit();
|
|
1092
1235
|
}
|
|
1093
1236
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FormFieldEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1094
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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 <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$
|
|
1237
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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 <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],[formArray],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.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: i1$1.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$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i5.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"] }] });
|
|
1095
1238
|
}
|
|
1096
1239
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FormFieldEditComponent, decorators: [{
|
|
1097
1240
|
type: Component,
|
|
@@ -1109,22 +1252,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
1109
1252
|
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 <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>" }]
|
|
1110
1253
|
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], editMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "editMode", required: false }] }], submitted: [{ type: i0.Output, args: ["submitted"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }] } });
|
|
1111
1254
|
|
|
1112
|
-
class DynamicFormComponent {
|
|
1113
|
-
formService = inject(FormService);
|
|
1114
|
-
inputForm = input.required(...(ngDevMode ? [{ debugName: "inputForm" }] : []));
|
|
1115
|
-
form = computed(() => this.formService.toFormGroup(this.inputForm()), ...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
1116
|
-
payLoad = '';
|
|
1117
|
-
onSubmit() {
|
|
1118
|
-
this.payLoad = JSON.stringify(this.form().getRawValue());
|
|
1119
|
-
}
|
|
1120
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DynamicFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1121
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
1122
|
-
}
|
|
1123
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DynamicFormComponent, decorators: [{
|
|
1124
|
-
type: Component,
|
|
1125
|
-
args: [{ selector: 'lib-dynamic-form', imports: [FormFieldDetailComponent, ReactiveFormsModule, FormFieldDetailComponent], 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>" }]
|
|
1126
|
-
}], propDecorators: { inputForm: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputForm", required: true }] }] } });
|
|
1127
|
-
|
|
1128
1255
|
class FormFieldForm {
|
|
1129
1256
|
static getBaseTemplate() {
|
|
1130
1257
|
return { name: "template", display_name: "template", file_type: "", remote: "", local: "", file: null };
|
|
@@ -1207,6 +1334,16 @@ class FormGroupForm {
|
|
|
1207
1334
|
id: fb.control(-1)
|
|
1208
1335
|
});
|
|
1209
1336
|
}
|
|
1337
|
+
static getFileRecords(form) {
|
|
1338
|
+
const records = [];
|
|
1339
|
+
this.getFields(form).controls.map(f => {
|
|
1340
|
+
const f_typed = f;
|
|
1341
|
+
if (f_typed.value.field_type == "FILE" && f_typed.value.template) {
|
|
1342
|
+
records.push(f_typed.value.template);
|
|
1343
|
+
}
|
|
1344
|
+
});
|
|
1345
|
+
return records;
|
|
1346
|
+
}
|
|
1210
1347
|
static createField(form, field) {
|
|
1211
1348
|
const fields = this.getFields(form);
|
|
1212
1349
|
field.patchValue({ order: fields.controls.length });
|
|
@@ -1283,123 +1420,6 @@ class FormGroupForm {
|
|
|
1283
1420
|
}
|
|
1284
1421
|
}
|
|
1285
1422
|
|
|
1286
|
-
class FormGroupEditComponent {
|
|
1287
|
-
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
1288
|
-
editMode = input(false, ...(ngDevMode ? [{ debugName: "editMode" }] : []));
|
|
1289
|
-
submitted = output();
|
|
1290
|
-
cancelled = output();
|
|
1291
|
-
deleted = output();
|
|
1292
|
-
fb = inject(FormBuilder);
|
|
1293
|
-
fieldForm = null;
|
|
1294
|
-
get fields() {
|
|
1295
|
-
return this.form().get('fields');
|
|
1296
|
-
}
|
|
1297
|
-
onFieldDelete(id) {
|
|
1298
|
-
FormGroupForm.deleteField(this.form(), id);
|
|
1299
|
-
}
|
|
1300
|
-
onFieldOrderUp(id) {
|
|
1301
|
-
FormGroupForm.reorderField(this.form(), id, id + 1);
|
|
1302
|
-
}
|
|
1303
|
-
onFieldOrderDown(id) {
|
|
1304
|
-
FormGroupForm.reorderField(this.form(), id, id - 1);
|
|
1305
|
-
}
|
|
1306
|
-
addField() {
|
|
1307
|
-
this.fieldForm = FormFieldForm.createForm(this.fb);
|
|
1308
|
-
}
|
|
1309
|
-
cancelField() {
|
|
1310
|
-
this.fieldForm = null;
|
|
1311
|
-
}
|
|
1312
|
-
submitField() {
|
|
1313
|
-
if (this.fieldForm) {
|
|
1314
|
-
FormGroupForm.createField(this.form(), this.fieldForm);
|
|
1315
|
-
}
|
|
1316
|
-
this.fieldForm = null;
|
|
1317
|
-
}
|
|
1318
|
-
onDelete() {
|
|
1319
|
-
this.deleted.emit();
|
|
1320
|
-
}
|
|
1321
|
-
cancel() {
|
|
1322
|
-
this.cancelled.emit();
|
|
1323
|
-
}
|
|
1324
|
-
submit() {
|
|
1325
|
-
this.submitted.emit();
|
|
1326
|
-
}
|
|
1327
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FormGroupEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1328
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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", deleted: "deleted" }, 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 <button matFab type=\"button\" style=\"margin:10px\" color=\"primary\" matTooltip=\"Delete the Group\" aria-label=\"Delete the group\"\n (click)=\"onDelete()\">\n <mat-icon>delete</mat-icon>\n </button>\n\n <h3>Fields</h3>\n @if(fieldForm){\n <lib-form-field-edit style=\"min-width:450px\" [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=\"min-width:450px\">\n @for(field of fields.controls; track field; let idx=$index)\n {\n <mat-expansion-panel style=\"width:100%\">\n <mat-expansion-panel-header class=\"expansion-panel\">\n <mat-panel-title>{{field.value.label}}</mat-panel-title>\n <div class=\"expansion-panel-controls\">\n <button mat-icon-button type=\"button\" class=\"control-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\" class=\"control-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\" class=\"control-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: [".expansion-panel-controls{display:none}.expansion-panel:hover .expansion-panel-controls{display:block}.control-button{margin-right:10px}\n"], 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: 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: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.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$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.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"] }] });
|
|
1329
|
-
}
|
|
1330
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FormGroupEditComponent, decorators: [{
|
|
1331
|
-
type: Component,
|
|
1332
|
-
args: [{ selector: 'lib-form-group-edit', imports: [MatExpansionModule,
|
|
1333
|
-
MatIconModule,
|
|
1334
|
-
MatButtonModule,
|
|
1335
|
-
MatTooltipModule,
|
|
1336
|
-
ReactiveFormsModule,
|
|
1337
|
-
MatFormFieldModule,
|
|
1338
|
-
MatInputModule,
|
|
1339
|
-
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 <button matFab type=\"button\" style=\"margin:10px\" color=\"primary\" matTooltip=\"Delete the Group\" aria-label=\"Delete the group\"\n (click)=\"onDelete()\">\n <mat-icon>delete</mat-icon>\n </button>\n\n <h3>Fields</h3>\n @if(fieldForm){\n <lib-form-field-edit style=\"min-width:450px\" [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=\"min-width:450px\">\n @for(field of fields.controls; track field; let idx=$index)\n {\n <mat-expansion-panel style=\"width:100%\">\n <mat-expansion-panel-header class=\"expansion-panel\">\n <mat-panel-title>{{field.value.label}}</mat-panel-title>\n <div class=\"expansion-panel-controls\">\n <button mat-icon-button type=\"button\" class=\"control-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\" class=\"control-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\" class=\"control-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: [".expansion-panel-controls{display:none}.expansion-panel:hover .expansion-panel-controls{display:block}.control-button{margin-right:10px}\n"] }]
|
|
1340
|
-
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], editMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "editMode", required: false }] }], submitted: [{ type: i0.Output, args: ["submitted"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }], deleted: [{ type: i0.Output, args: ["deleted"] }] } });
|
|
1341
|
-
|
|
1342
|
-
class DynamicFormBuilderComponent {
|
|
1343
|
-
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
1344
|
-
handleSubmit = input(false, ...(ngDevMode ? [{ debugName: "handleSubmit" }] : []));
|
|
1345
|
-
submitted = output();
|
|
1346
|
-
dirty = signal(false, ...(ngDevMode ? [{ debugName: "dirty" }] : []));
|
|
1347
|
-
fb = inject(FormBuilder);
|
|
1348
|
-
groupForm = null;
|
|
1349
|
-
addGroup() {
|
|
1350
|
-
this.groupForm = FormGroupForm.createForm(this.fb);
|
|
1351
|
-
}
|
|
1352
|
-
createGroup() {
|
|
1353
|
-
if (this.groupForm) {
|
|
1354
|
-
this.form().createGroup(this.groupForm);
|
|
1355
|
-
}
|
|
1356
|
-
this.groupForm = null;
|
|
1357
|
-
}
|
|
1358
|
-
cancelGroup() {
|
|
1359
|
-
this.groupForm = null;
|
|
1360
|
-
}
|
|
1361
|
-
onSubmit() {
|
|
1362
|
-
this.submitted.emit();
|
|
1363
|
-
this.dirty.set(false);
|
|
1364
|
-
}
|
|
1365
|
-
deleteGroup(id) {
|
|
1366
|
-
this.form().deleteGroup(id);
|
|
1367
|
-
this.dirty.set(true);
|
|
1368
|
-
}
|
|
1369
|
-
onOrderUp(id) {
|
|
1370
|
-
this.form().orderUp(id);
|
|
1371
|
-
this.dirty.set(true);
|
|
1372
|
-
}
|
|
1373
|
-
onOrderDown(id) {
|
|
1374
|
-
this.form().orderDown(id);
|
|
1375
|
-
this.dirty.set(true);
|
|
1376
|
-
}
|
|
1377
|
-
getLabel(control) {
|
|
1378
|
-
const form = control;
|
|
1379
|
-
if (form.value.label) {
|
|
1380
|
-
return form.value.label;
|
|
1381
|
-
}
|
|
1382
|
-
else {
|
|
1383
|
-
return "Group " + form.value.order.toString();
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DynamicFormBuilderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1387
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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<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 @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\" (deleted)=\"deleteGroup(group_idx)\"></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: i1$1.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.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", "deleted"] }] });
|
|
1388
|
-
}
|
|
1389
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DynamicFormBuilderComponent, decorators: [{
|
|
1390
|
-
type: Component,
|
|
1391
|
-
args: [{ selector: 'lib-dynamic-form-builder', imports: [
|
|
1392
|
-
MatIconModule,
|
|
1393
|
-
MatFormFieldModule,
|
|
1394
|
-
MatInputModule,
|
|
1395
|
-
ReactiveFormsModule,
|
|
1396
|
-
MatButtonModule,
|
|
1397
|
-
MatTooltipModule,
|
|
1398
|
-
MatExpansionModule,
|
|
1399
|
-
FormGroupEditComponent
|
|
1400
|
-
], 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<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 @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\" (deleted)=\"deleteGroup(group_idx)\"></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"] }]
|
|
1401
|
-
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], handleSubmit: [{ type: i0.Input, args: [{ isSignal: true, alias: "handleSubmit", required: false }] }], submitted: [{ type: i0.Output, args: ["submitted"] }] } });
|
|
1402
|
-
|
|
1403
1423
|
class DynamicFormForm {
|
|
1404
1424
|
fb = inject(FormBuilder);
|
|
1405
1425
|
form;
|
|
@@ -1411,6 +1431,16 @@ class DynamicFormForm {
|
|
|
1411
1431
|
get groups() {
|
|
1412
1432
|
return this.form.get('groups');
|
|
1413
1433
|
}
|
|
1434
|
+
getFileFields(form) {
|
|
1435
|
+
const ids = getFileFieldIds(form);
|
|
1436
|
+
const records = [];
|
|
1437
|
+
this.groups.controls.map(g => records.push(...FormGroupForm.getFileRecords(g)));
|
|
1438
|
+
const fields = [];
|
|
1439
|
+
for (let i = 0; i < ids.length; i++) {
|
|
1440
|
+
fields.push({ id: ids[i], file: records[i] });
|
|
1441
|
+
}
|
|
1442
|
+
return fields;
|
|
1443
|
+
}
|
|
1414
1444
|
orderUp(id) {
|
|
1415
1445
|
this.reorder(id, id - 1);
|
|
1416
1446
|
}
|
|
@@ -1546,114 +1576,148 @@ class PopulatedFormForm {
|
|
|
1546
1576
|
}
|
|
1547
1577
|
}
|
|
1548
1578
|
|
|
1549
|
-
class
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1579
|
+
class DynamicFormComponent {
|
|
1580
|
+
formService = inject(FormService);
|
|
1581
|
+
inputForm = input.required(...(ngDevMode ? [{ debugName: "inputForm" }] : []));
|
|
1582
|
+
form = computed(() => this.formService.toFormGroup(this.inputForm()), ...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
1583
|
+
payLoad = '';
|
|
1584
|
+
onSubmit() {
|
|
1585
|
+
this.payLoad = JSON.stringify(this.form().getRawValue());
|
|
1586
|
+
}
|
|
1587
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DynamicFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1588
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
1553
1589
|
}
|
|
1554
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type:
|
|
1590
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DynamicFormComponent, decorators: [{
|
|
1555
1591
|
type: Component,
|
|
1556
|
-
args: [{ selector: 'lib-
|
|
1557
|
-
}], propDecorators: {
|
|
1592
|
+
args: [{ selector: 'lib-dynamic-form', imports: [FormFieldDetailComponent, ReactiveFormsModule, FormFieldDetailComponent], 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>" }]
|
|
1593
|
+
}], propDecorators: { inputForm: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputForm", required: true }] }] } });
|
|
1558
1594
|
|
|
1559
|
-
class
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
table = viewChild(MatTable, ...(ngDevMode ? [{ debugName: "table" }] : []));
|
|
1570
|
-
ngOnInit() {
|
|
1571
|
-
this.searchControl.valueChanges.subscribe(value => this.searchChanged.emit(value));
|
|
1595
|
+
class FormGroupEditComponent {
|
|
1596
|
+
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
1597
|
+
editMode = input(false, ...(ngDevMode ? [{ debugName: "editMode" }] : []));
|
|
1598
|
+
submitted = output();
|
|
1599
|
+
cancelled = output();
|
|
1600
|
+
deleted = output();
|
|
1601
|
+
fb = inject(FormBuilder);
|
|
1602
|
+
fieldForm = null;
|
|
1603
|
+
get fields() {
|
|
1604
|
+
return this.form().get('fields');
|
|
1572
1605
|
}
|
|
1573
|
-
|
|
1574
|
-
this.
|
|
1575
|
-
this.table()?.renderRows();
|
|
1606
|
+
onFieldDelete(id) {
|
|
1607
|
+
FormGroupForm.deleteField(this.form(), id);
|
|
1576
1608
|
}
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1609
|
+
onFieldOrderUp(id) {
|
|
1610
|
+
FormGroupForm.reorderField(this.form(), id, id + 1);
|
|
1611
|
+
}
|
|
1612
|
+
onFieldOrderDown(id) {
|
|
1613
|
+
FormGroupForm.reorderField(this.form(), id, id - 1);
|
|
1614
|
+
}
|
|
1615
|
+
addField() {
|
|
1616
|
+
this.fieldForm = FormFieldForm.createForm(this.fb);
|
|
1617
|
+
}
|
|
1618
|
+
cancelField() {
|
|
1619
|
+
this.fieldForm = null;
|
|
1620
|
+
}
|
|
1621
|
+
submitField() {
|
|
1622
|
+
if (this.fieldForm) {
|
|
1623
|
+
FormGroupForm.createField(this.form(), this.fieldForm);
|
|
1580
1624
|
}
|
|
1581
|
-
this.
|
|
1582
|
-
this.table()?.renderRows();
|
|
1625
|
+
this.fieldForm = null;
|
|
1583
1626
|
}
|
|
1584
|
-
|
|
1585
|
-
|
|
1627
|
+
onDelete() {
|
|
1628
|
+
this.deleted.emit();
|
|
1629
|
+
}
|
|
1630
|
+
cancel() {
|
|
1631
|
+
this.cancelled.emit();
|
|
1632
|
+
}
|
|
1633
|
+
submit() {
|
|
1634
|
+
this.submitted.emit();
|
|
1635
|
+
}
|
|
1636
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FormGroupEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1637
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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", deleted: "deleted" }, 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 <button matFab type=\"button\" style=\"margin:10px\" color=\"primary\" matTooltip=\"Delete the Group\" aria-label=\"Delete the group\"\n (click)=\"onDelete()\">\n <mat-icon>delete</mat-icon>\n </button>\n\n <h3>Fields</h3>\n @if(fieldForm){\n <lib-form-field-edit style=\"min-width:450px\" [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=\"min-width:450px\">\n @for(field of fields.controls; track field; let idx=$index)\n {\n <mat-expansion-panel style=\"width:100%\">\n <mat-expansion-panel-header class=\"expansion-panel\">\n <mat-panel-title>{{field.value.label}}</mat-panel-title>\n <div class=\"expansion-panel-controls\">\n <button mat-icon-button type=\"button\" class=\"control-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\" class=\"control-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\" class=\"control-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: [".expansion-panel-controls{display:none}.expansion-panel:hover .expansion-panel-controls{display:block}.control-button{margin-right:10px}\n"], 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: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2.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$1.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],[formArray],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"] }] });
|
|
1586
1638
|
}
|
|
1587
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type:
|
|
1639
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FormGroupEditComponent, decorators: [{
|
|
1588
1640
|
type: Component,
|
|
1589
|
-
args: [{ selector: 'lib-
|
|
1590
|
-
MatFormFieldModule,
|
|
1591
|
-
MatButtonModule,
|
|
1592
|
-
MatSelectModule,
|
|
1641
|
+
args: [{ selector: 'lib-form-group-edit', imports: [MatExpansionModule,
|
|
1593
1642
|
MatIconModule,
|
|
1594
|
-
|
|
1643
|
+
MatButtonModule,
|
|
1644
|
+
MatTooltipModule,
|
|
1595
1645
|
ReactiveFormsModule,
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
{ name: 'first_name', title: 'First Name', element_type: 'string' },
|
|
1601
|
-
{ name: 'last_name', title: 'Surname', element_type: 'string' },
|
|
1602
|
-
{ name: 'username', title: 'Username', element_type: 'string' },
|
|
1603
|
-
{ name: 'email', title: 'Email', element_type: 'email' }
|
|
1604
|
-
];
|
|
1646
|
+
MatFormFieldModule,
|
|
1647
|
+
MatInputModule,
|
|
1648
|
+
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 <button matFab type=\"button\" style=\"margin:10px\" color=\"primary\" matTooltip=\"Delete the Group\" aria-label=\"Delete the group\"\n (click)=\"onDelete()\">\n <mat-icon>delete</mat-icon>\n </button>\n\n <h3>Fields</h3>\n @if(fieldForm){\n <lib-form-field-edit style=\"min-width:450px\" [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=\"min-width:450px\">\n @for(field of fields.controls; track field; let idx=$index)\n {\n <mat-expansion-panel style=\"width:100%\">\n <mat-expansion-panel-header class=\"expansion-panel\">\n <mat-panel-title>{{field.value.label}}</mat-panel-title>\n <div class=\"expansion-panel-controls\">\n <button mat-icon-button type=\"button\" class=\"control-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\" class=\"control-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\" class=\"control-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: [".expansion-panel-controls{display:none}.expansion-panel:hover .expansion-panel-controls{display:block}.control-button{margin-right:10px}\n"] }]
|
|
1649
|
+
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], editMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "editMode", required: false }] }], submitted: [{ type: i0.Output, args: ["submitted"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }], deleted: [{ type: i0.Output, args: ["deleted"] }] } });
|
|
1605
1650
|
|
|
1606
|
-
class
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1651
|
+
class DynamicFormBuilderComponent {
|
|
1652
|
+
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
1653
|
+
handleSubmit = input(false, ...(ngDevMode ? [{ debugName: "handleSubmit" }] : []));
|
|
1654
|
+
submitted = output();
|
|
1655
|
+
dirty = signal(false, ...(ngDevMode ? [{ debugName: "dirty" }] : []));
|
|
1656
|
+
fb = inject(FormBuilder);
|
|
1657
|
+
groupForm = null;
|
|
1658
|
+
addGroup() {
|
|
1659
|
+
this.groupForm = FormGroupForm.createForm(this.fb);
|
|
1613
1660
|
}
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
this.
|
|
1661
|
+
createGroup() {
|
|
1662
|
+
if (this.groupForm) {
|
|
1663
|
+
this.form().createGroup(this.groupForm);
|
|
1664
|
+
}
|
|
1665
|
+
this.groupForm = null;
|
|
1619
1666
|
}
|
|
1620
|
-
|
|
1621
|
-
this.
|
|
1667
|
+
cancelGroup() {
|
|
1668
|
+
this.groupForm = null;
|
|
1622
1669
|
}
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
this.
|
|
1626
|
-
return url;
|
|
1670
|
+
onSubmit() {
|
|
1671
|
+
this.submitted.emit();
|
|
1672
|
+
this.dirty.set(false);
|
|
1627
1673
|
}
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
this.selected.update(members => { members.push(selected.item); return members; });
|
|
1632
|
-
}
|
|
1633
|
-
this.candidates.update(members => members.filter(m => m.title != title));
|
|
1634
|
-
return this.selected().find(m => this.hasTitle(m, title)).url;
|
|
1674
|
+
deleteGroup(id) {
|
|
1675
|
+
this.form().deleteGroup(id);
|
|
1676
|
+
this.dirty.set(true);
|
|
1635
1677
|
}
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1678
|
+
onOrderUp(id) {
|
|
1679
|
+
this.form().orderUp(id);
|
|
1680
|
+
this.dirty.set(true);
|
|
1681
|
+
}
|
|
1682
|
+
onOrderDown(id) {
|
|
1683
|
+
this.form().orderDown(id);
|
|
1684
|
+
this.dirty.set(true);
|
|
1685
|
+
}
|
|
1686
|
+
getLabel(control) {
|
|
1687
|
+
const form = control;
|
|
1688
|
+
if (form.value.label) {
|
|
1689
|
+
return form.value.label;
|
|
1639
1690
|
}
|
|
1640
1691
|
else {
|
|
1641
|
-
|
|
1692
|
+
return "Group " + form.value.order.toString();
|
|
1642
1693
|
}
|
|
1643
1694
|
}
|
|
1695
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DynamicFormBuilderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1696
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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<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 @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\" (deleted)=\"deleteGroup(group_idx)\"></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: i1$1.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.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2.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$1.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", "deleted"] }] });
|
|
1644
1697
|
}
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1698
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: DynamicFormBuilderComponent, decorators: [{
|
|
1699
|
+
type: Component,
|
|
1700
|
+
args: [{ selector: 'lib-dynamic-form-builder', imports: [
|
|
1701
|
+
MatIconModule,
|
|
1702
|
+
MatFormFieldModule,
|
|
1703
|
+
MatInputModule,
|
|
1704
|
+
ReactiveFormsModule,
|
|
1705
|
+
MatButtonModule,
|
|
1706
|
+
MatTooltipModule,
|
|
1707
|
+
MatExpansionModule,
|
|
1708
|
+
FormGroupEditComponent
|
|
1709
|
+
], 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<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 @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\" (deleted)=\"deleteGroup(group_idx)\"></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"] }]
|
|
1710
|
+
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }], handleSubmit: [{ type: i0.Input, args: [{ isSignal: true, alias: "handleSubmit", required: false }] }], submitted: [{ type: i0.Output, args: ["submitted"] }] } });
|
|
1711
|
+
|
|
1712
|
+
class PopulatedFormComponent {
|
|
1713
|
+
form = input.required(...(ngDevMode ? [{ debugName: "form" }] : []));
|
|
1714
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: PopulatedFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1715
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: PopulatedFormComponent, isStandalone: true, selector: "lib-populated-form", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@for(value of form().values; track value.id)\n{\n@if(value.field.field_type === \"TEXT\" || value.field.field_type === \"RICH_TEXT\")\n{\n <div class=\"item-field\">\n <h3 style=\"margin-right: 10px\">{{value.field.label}}</h3>\n <p>{{value.value}}</p>\n </div>\n}\n@else if(value.field.field_type === \"CHAR\")\n{\n <div class=\"item-field\">\n <span style=\"margin-right: 10px\"><b>{{value.field.label}}:</b></span>\n <span>{{value.value}}</span>\n </div>\n}\n@else if(value.field.field_type === \"BOOLEAN\")\n{\n <div class=\"item-field\">\n <span style=\"margin-right: 10px\"><b>{{value.field.label}}:</b></span>\n @if(value.value === \"true\")\n {\n <mat-icon>check</mat-icon>\n }\n @else {\n <mat-icon>close_small</mat-icon>\n }\n </div>\n}\n@else if(value.field.field_type === \"FILE\" && value.asset)\n{\n <div class=\"item-field\">\n <span style=\"margin-right: 10px\"><b>{{value.field.label}}:</b></span>\n <a matFab href=\"value.asset\">\n <mat-icon>download</mat-icon>\n </a>\n </div>\n}\n}", styles: [""], 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.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }] });
|
|
1656
1716
|
}
|
|
1717
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: PopulatedFormComponent, decorators: [{
|
|
1718
|
+
type: Component,
|
|
1719
|
+
args: [{ selector: 'lib-populated-form', imports: [MatIconModule, MatButtonModule], template: "@for(value of form().values; track value.id)\n{\n@if(value.field.field_type === \"TEXT\" || value.field.field_type === \"RICH_TEXT\")\n{\n <div class=\"item-field\">\n <h3 style=\"margin-right: 10px\">{{value.field.label}}</h3>\n <p>{{value.value}}</p>\n </div>\n}\n@else if(value.field.field_type === \"CHAR\")\n{\n <div class=\"item-field\">\n <span style=\"margin-right: 10px\"><b>{{value.field.label}}:</b></span>\n <span>{{value.value}}</span>\n </div>\n}\n@else if(value.field.field_type === \"BOOLEAN\")\n{\n <div class=\"item-field\">\n <span style=\"margin-right: 10px\"><b>{{value.field.label}}:</b></span>\n @if(value.value === \"true\")\n {\n <mat-icon>check</mat-icon>\n }\n @else {\n <mat-icon>close_small</mat-icon>\n }\n </div>\n}\n@else if(value.field.field_type === \"FILE\" && value.asset)\n{\n <div class=\"item-field\">\n <span style=\"margin-right: 10px\"><b>{{value.field.label}}:</b></span>\n <a matFab href=\"value.asset\">\n <mat-icon>download</mat-icon>\n </a>\n </div>\n}\n}" }]
|
|
1720
|
+
}], propDecorators: { form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: true }] }] } });
|
|
1657
1721
|
|
|
1658
1722
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1659
1723
|
class ListTableViewComponent {
|
|
@@ -1700,7 +1764,7 @@ class ListTableViewComponent {
|
|
|
1700
1764
|
}));
|
|
1701
1765
|
}
|
|
1702
1766
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ListTableViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1703
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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\">\n\n @if(column.element_type === \"date\")\n {\n {{ element[column.name] | date}}\n }\n @else if(column.element_type === \"enum\")\n {\n {{ element[column.name] | titlecase}}\n }\n @else {\n {{ element[column.name] }}\n }\n </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
|
|
1767
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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\">\n\n @if(column.element_type === \"date\")\n {\n {{ element[column.name] | date}}\n }\n @else if(column.element_type === \"enum\")\n {\n {{ element[column.name] | titlecase}}\n }\n @else {\n {{ element[column.name] }}\n }\n </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.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1.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$1.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$3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$3.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }] });
|
|
1704
1768
|
}
|
|
1705
1769
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ListTableViewComponent, decorators: [{
|
|
1706
1770
|
type: Component,
|
|
@@ -1722,8 +1786,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
1722
1786
|
class ListScrollViewComponent {
|
|
1723
1787
|
searchTerm = input("", ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
|
|
1724
1788
|
pageSize = input(20, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
1789
|
+
itemHeight = input(100, ...(ngDevMode ? [{ debugName: "itemHeight" }] : []));
|
|
1725
1790
|
dataSource = input(...(ngDevMode ? [undefined, { debugName: "dataSource" }] : []));
|
|
1726
1791
|
listItemTemplate = input(null, ...(ngDevMode ? [{ debugName: "listItemTemplate" }] : []));
|
|
1792
|
+
selection = signal(null, ...(ngDevMode ? [{ debugName: "selection" }] : []));
|
|
1793
|
+
selected = output();
|
|
1727
1794
|
reset() {
|
|
1728
1795
|
const data_source = this.dataSource();
|
|
1729
1796
|
if (!data_source) {
|
|
@@ -1733,59 +1800,19 @@ class ListScrollViewComponent {
|
|
|
1733
1800
|
// sort_field: this.sort!.active,
|
|
1734
1801
|
data_source.reset(this.searchTerm(), this.pageSize());
|
|
1735
1802
|
}
|
|
1803
|
+
onSelected(id) {
|
|
1804
|
+
this.selection.set(id);
|
|
1805
|
+
this.selected.emit(id);
|
|
1806
|
+
}
|
|
1736
1807
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ListScrollViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1737
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", 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=\"
|
|
1808
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", 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 }, itemHeight: { classPropertyName: "itemHeight", publicName: "itemHeight", 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 } }, outputs: { selected: "selected" }, ngImport: i0, template: "<mat-nav-list style=\"padding: 0px; display:flex; justify-content: center; \">\n <ul style=\"margin: 0px; padding: 0px\">\n <cdk-virtual-scroll-viewport\n itemSize=\"itemHeight()\"\n class=\"scrollable-list\"\n style=\"height: 600px; width: 300px; padding: 5px\"\n >\n <ng-container *cdkVirtualFor=\"let item of dataSource(); let even = even;\">\n <li style=\"margin: 0px; padding: 0px\" \n (click)=\"onSelected(item.id)\" \n (keydown)=\"onSelected(item.id)\"\n tabindex=\"0\"\n role=\"button\">\n <ng-container\n *ngTemplateOutlet=\"listItemTemplate(); context: { item: item, even: even, selected: item.id === selection()}\" \n >\n </ng-container>\n </li>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n </ul>\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$3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2$3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2$3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }] });
|
|
1738
1809
|
}
|
|
1739
1810
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ListScrollViewComponent, decorators: [{
|
|
1740
1811
|
type: Component,
|
|
1741
1812
|
args: [{ selector: 'lib-list-scroll-view', imports: [MatListModule,
|
|
1742
1813
|
NgTemplateOutlet,
|
|
1743
|
-
ScrollingModule], template: "<mat-nav-list>\n <cdk-virtual-scroll-viewport\n itemSize=\"
|
|
1744
|
-
}], propDecorators: { searchTerm: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchTerm", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: false }] }], listItemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "listItemTemplate", required: false }] }] } });
|
|
1745
|
-
|
|
1746
|
-
class BackButtonComponent {
|
|
1747
|
-
location = inject(Location);
|
|
1748
|
-
goBack() {
|
|
1749
|
-
this.location.back();
|
|
1750
|
-
}
|
|
1751
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: BackButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1752
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", 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: 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"] }] });
|
|
1753
|
-
}
|
|
1754
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: BackButtonComponent, decorators: [{
|
|
1755
|
-
type: Component,
|
|
1756
|
-
args: [{ selector: 'lib-back-button', imports: [MatIconModule, MatButtonModule], 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"] }]
|
|
1757
|
-
}] });
|
|
1758
|
-
|
|
1759
|
-
class SearchBarComponent {
|
|
1760
|
-
itemType = input("", ...(ngDevMode ? [{ debugName: "itemType" }] : []));
|
|
1761
|
-
sortFields = input([], ...(ngDevMode ? [{ debugName: "sortFields" }] : []));
|
|
1762
|
-
sortAscending = signal(true, ...(ngDevMode ? [{ debugName: "sortAscending" }] : []));
|
|
1763
|
-
searchChanged = output();
|
|
1764
|
-
searchFilter = new FormControl();
|
|
1765
|
-
ngAfterViewInit() {
|
|
1766
|
-
this.searchFilter.valueChanges.pipe(debounceTime(150), distinctUntilChanged(), tap(() => {
|
|
1767
|
-
this.searchEntered();
|
|
1768
|
-
})).subscribe();
|
|
1769
|
-
}
|
|
1770
|
-
clearSearch() {
|
|
1771
|
-
this.searchFilter.setValue("");
|
|
1772
|
-
}
|
|
1773
|
-
searchEntered() {
|
|
1774
|
-
this.searchChanged.emit(this.searchFilter.value);
|
|
1775
|
-
}
|
|
1776
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SearchBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1777
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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$3.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$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.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$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.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: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }] });
|
|
1778
|
-
}
|
|
1779
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: SearchBarComponent, decorators: [{
|
|
1780
|
-
type: Component,
|
|
1781
|
-
args: [{ selector: 'lib-search-bar', imports: [ReactiveFormsModule,
|
|
1782
|
-
MatInputModule,
|
|
1783
|
-
MatTooltipModule,
|
|
1784
|
-
MatButtonModule,
|
|
1785
|
-
MatSelectModule,
|
|
1786
|
-
MatIconModule,
|
|
1787
|
-
TitleCasePipe], 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"] }]
|
|
1788
|
-
}], propDecorators: { itemType: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemType", required: false }] }], sortFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortFields", required: false }] }], searchChanged: [{ type: i0.Output, args: ["searchChanged"] }] } });
|
|
1814
|
+
ScrollingModule], template: "<mat-nav-list style=\"padding: 0px; display:flex; justify-content: center; \">\n <ul style=\"margin: 0px; padding: 0px\">\n <cdk-virtual-scroll-viewport\n itemSize=\"itemHeight()\"\n class=\"scrollable-list\"\n style=\"height: 600px; width: 300px; padding: 5px\"\n >\n <ng-container *cdkVirtualFor=\"let item of dataSource(); let even = even;\">\n <li style=\"margin: 0px; padding: 0px\" \n (click)=\"onSelected(item.id)\" \n (keydown)=\"onSelected(item.id)\"\n tabindex=\"0\"\n role=\"button\">\n <ng-container\n *ngTemplateOutlet=\"listItemTemplate(); context: { item: item, even: even, selected: item.id === selection()}\" \n >\n </ng-container>\n </li>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n </ul>\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"] }]
|
|
1815
|
+
}], propDecorators: { searchTerm: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchTerm", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], itemHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemHeight", required: false }] }], dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: false }] }], listItemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "listItemTemplate", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }] } });
|
|
1789
1816
|
|
|
1790
1817
|
class ListDataSource extends DataSource {
|
|
1791
1818
|
length = signal(0, ...(ngDevMode ? [{ debugName: "length" }] : []));
|
|
@@ -1865,10 +1892,36 @@ class ListDataSource extends DataSource {
|
|
|
1865
1892
|
}
|
|
1866
1893
|
}
|
|
1867
1894
|
|
|
1895
|
+
class ListHeaderComponent {
|
|
1896
|
+
itemType = input.required(...(ngDevMode ? [{ debugName: "itemType" }] : []));
|
|
1897
|
+
canCreate = input.required(...(ngDevMode ? [{ debugName: "canCreate" }] : []));
|
|
1898
|
+
showControls = input.required(...(ngDevMode ? [{ debugName: "showControls" }] : []));
|
|
1899
|
+
sortFields = input.required(...(ngDevMode ? [{ debugName: "sortFields" }] : []));
|
|
1900
|
+
searchChanged = output();
|
|
1901
|
+
title() {
|
|
1902
|
+
return this.itemType().replace("_", " ");
|
|
1903
|
+
}
|
|
1904
|
+
onSearchChange(value) {
|
|
1905
|
+
this.searchChanged.emit(value);
|
|
1906
|
+
}
|
|
1907
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ListHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1908
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: ListHeaderComponent, isStandalone: true, selector: "lib-list-header", inputs: { itemType: { classPropertyName: "itemType", publicName: "itemType", isSignal: true, isRequired: true, transformFunction: null }, canCreate: { classPropertyName: "canCreate", publicName: "canCreate", isSignal: true, isRequired: true, transformFunction: null }, showControls: { classPropertyName: "showControls", publicName: "showControls", isSignal: true, isRequired: true, transformFunction: null }, sortFields: { classPropertyName: "sortFields", publicName: "sortFields", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { searchChanged: "searchChanged" }, ngImport: i0, template: "<div class=\"container\">\n\n <div class=\"title-container\">\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\"\n [routerLink]=\"['/' + itemType(), 'create']\">\n <mat-icon>add</mat-icon></a>\n </div>\n }\n </div>\n\n <div class=\"controls\" [hidden]=\"!showControls()\">\n <lib-search-bar style=\"width:70%\" [itemType]=\"title()\" [sortFields]=\"sortFields()\"\n (searchChanged)=\"onSearchChange($event)\"></lib-search-bar>\n </div>\n</div>", styles: [".container{display:flex;flex-direction:column;align-items:center;justify-content:center}.title-container{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center}.title{text-align:center;padding:5px;margin:0}.controls{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { 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.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" }] });
|
|
1909
|
+
}
|
|
1910
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ListHeaderComponent, decorators: [{
|
|
1911
|
+
type: Component,
|
|
1912
|
+
args: [{ selector: 'lib-list-header', imports: [TitleCasePipe,
|
|
1913
|
+
RouterModule,
|
|
1914
|
+
MatIconModule,
|
|
1915
|
+
MatButtonModule,
|
|
1916
|
+
SearchBarComponent], template: "<div class=\"container\">\n\n <div class=\"title-container\">\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\"\n [routerLink]=\"['/' + itemType(), 'create']\">\n <mat-icon>add</mat-icon></a>\n </div>\n }\n </div>\n\n <div class=\"controls\" [hidden]=\"!showControls()\">\n <lib-search-bar style=\"width:70%\" [itemType]=\"title()\" [sortFields]=\"sortFields()\"\n (searchChanged)=\"onSearchChange($event)\"></lib-search-bar>\n </div>\n</div>", styles: [".container{display:flex;flex-direction:column;align-items:center;justify-content:center}.title-container{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center}.title{text-align:center;padding:5px;margin:0}.controls{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;width:100%}\n"] }]
|
|
1917
|
+
}], propDecorators: { itemType: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemType", required: true }] }], canCreate: [{ type: i0.Input, args: [{ isSignal: true, alias: "canCreate", required: true }] }], showControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "showControls", required: true }] }], sortFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortFields", required: true }] }], searchChanged: [{ type: i0.Output, args: ["searchChanged"] }] } });
|
|
1918
|
+
|
|
1868
1919
|
class ListViewComponent {
|
|
1869
1920
|
viewType = input("table", ...(ngDevMode ? [{ debugName: "viewType" }] : []));
|
|
1870
1921
|
itemService = input(...(ngDevMode ? [undefined, { debugName: "itemService" }] : []));
|
|
1922
|
+
listItemTemplate = input(null, ...(ngDevMode ? [{ debugName: "listItemTemplate" }] : []));
|
|
1871
1923
|
itemDetailTemplate = input(null, ...(ngDevMode ? [{ debugName: "itemDetailTemplate" }] : []));
|
|
1924
|
+
itemHeight = input(100, ...(ngDevMode ? [{ debugName: "itemHeight" }] : []));
|
|
1872
1925
|
columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
1873
1926
|
sortFields = input([], ...(ngDevMode ? [{ debugName: "sortFields" }] : []));
|
|
1874
1927
|
noSelfItemsMessage = input(...(ngDevMode ? [undefined, { debugName: "noSelfItemsMessage" }] : []));
|
|
@@ -1877,6 +1930,7 @@ class ListViewComponent {
|
|
|
1877
1930
|
defaultQueries = input([], ...(ngDevMode ? [{ debugName: "defaultQueries" }] : []));
|
|
1878
1931
|
embeddedMode = input(false, ...(ngDevMode ? [{ debugName: "embeddedMode" }] : []));
|
|
1879
1932
|
selectedViewType = signal("table", ...(ngDevMode ? [{ debugName: "selectedViewType" }] : []));
|
|
1933
|
+
selected = output();
|
|
1880
1934
|
pageSize = 20;
|
|
1881
1935
|
pageSizeOptions = [20, 50, 100];
|
|
1882
1936
|
route = inject(ActivatedRoute);
|
|
@@ -1894,6 +1948,9 @@ class ListViewComponent {
|
|
|
1894
1948
|
sort.sortChange.pipe(tap(() => this.reset())).subscribe();
|
|
1895
1949
|
}
|
|
1896
1950
|
}
|
|
1951
|
+
showControls() {
|
|
1952
|
+
return this.dataSource != undefined && !this.dataSource.sourceIsEmpty();
|
|
1953
|
+
}
|
|
1897
1954
|
onSearchChange(value) {
|
|
1898
1955
|
this.searchTerm = value;
|
|
1899
1956
|
this.reset();
|
|
@@ -1934,6 +1991,9 @@ class ListViewComponent {
|
|
|
1934
1991
|
this.selectedViewType.set(event.value);
|
|
1935
1992
|
this.resetDataSource();
|
|
1936
1993
|
}
|
|
1994
|
+
onSelection(id) {
|
|
1995
|
+
this.selected.emit(id);
|
|
1996
|
+
}
|
|
1937
1997
|
isSelfList() {
|
|
1938
1998
|
const url_segments = this.route.snapshot.url;
|
|
1939
1999
|
if (!url_segments) {
|
|
@@ -1942,7 +2002,7 @@ class ListViewComponent {
|
|
|
1942
2002
|
return (url_segments.length == 2) && (url_segments[1].path == "self");
|
|
1943
2003
|
}
|
|
1944
2004
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ListViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1945
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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 }, embeddedMode: { classPropertyName: "embeddedMode", publicName: "embeddedMode", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }], ngImport: i0, template: "@if(!embeddedMode()){\n<lib-back-button></lib-back-button>\n}\n\n<div class=\"container\">\n <
|
|
2005
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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 }, listItemTemplate: { classPropertyName: "listItemTemplate", publicName: "listItemTemplate", isSignal: true, isRequired: false, transformFunction: null }, itemDetailTemplate: { classPropertyName: "itemDetailTemplate", publicName: "itemDetailTemplate", isSignal: true, isRequired: false, transformFunction: null }, itemHeight: { classPropertyName: "itemHeight", publicName: "itemHeight", 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 }, embeddedMode: { classPropertyName: "embeddedMode", publicName: "embeddedMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }], ngImport: i0, template: "@if(!embeddedMode()){\n<lib-back-button style=\"position: absolute;\"></lib-back-button>\n}\n\n<div class=\"container\">\n <lib-list-header style=\"width:100%\"\n [itemType]=\"itemType()\" \n [canCreate]=\"canCreate()\" \n [showControls]=\"showControls()\"\n [sortFields]=\"sortFields()\"\n (searchChanged)=\"onSearchChange($event)\"></lib-list-header>\n\n <div class=\"content_container\" style=\"width:100%\">\n @if(dataSource)\n {\n <div class=\"search_result_container\" style=\"width:350px\">\n\n @if (dataSource.loading()) {\n <div class=\"spinner-container\">\n <mat-spinner></mat-spinner>\n </div>\n }\n\n @if(!embeddedMode()){\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\n <div style=\"width: 100%\" [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 <h2 style=\"margin-bottom:5px; margin-top: 0px; padding: 0px;\">Results: {{dataSource.length()}}</h2>\n <lib-list-scroll-view [listItemTemplate]=\"listItemTemplate()\" [itemHeight]=\"itemHeight()\" [dataSource]=\"dataSource\" (selected)=\"onSelection($event)\"></lib-list-scroll-view>\n }\n </div>\n </div>\n <div class=\"detail-container\" style=\"width:100%; min-width: 400px;\">\n <ng-container *ngTemplateOutlet=\"itemDetailTemplate()\">\n </ng-container>\n </div>\n }\n </div>\n</div>", styles: [":host{flex-grow:1}.container{display:flex;padding-left:10px;padding-right:10px;flex-direction:column;justify-content:center;text-align:center;align-items:center}.content_container{display:flex;flex-direction:row;justify-content:left;text-align:left;align-items:left}.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", "itemHeight", "dataSource", "listItemTemplate"], outputs: ["selected"] }, { kind: "component", type: BackButtonComponent, selector: "lib-back-button" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatButtonToggleModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i1$5.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: ListHeaderComponent, selector: "lib-list-header", inputs: ["itemType", "canCreate", "showControls", "sortFields"], outputs: ["searchChanged"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1946
2006
|
}
|
|
1947
2007
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ListViewComponent, decorators: [{
|
|
1948
2008
|
type: Component,
|
|
@@ -1955,47 +2015,100 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
1955
2015
|
MatIconModule,
|
|
1956
2016
|
ReactiveFormsModule,
|
|
1957
2017
|
RouterModule,
|
|
1958
|
-
TitleCasePipe,
|
|
1959
2018
|
MatInputModule,
|
|
1960
2019
|
MatTooltipModule,
|
|
1961
2020
|
MatButtonModule,
|
|
1962
|
-
|
|
1963
|
-
|
|
2021
|
+
ListHeaderComponent,
|
|
2022
|
+
NgTemplateOutlet], template: "@if(!embeddedMode()){\n<lib-back-button style=\"position: absolute;\"></lib-back-button>\n}\n\n<div class=\"container\">\n <lib-list-header style=\"width:100%\"\n [itemType]=\"itemType()\" \n [canCreate]=\"canCreate()\" \n [showControls]=\"showControls()\"\n [sortFields]=\"sortFields()\"\n (searchChanged)=\"onSearchChange($event)\"></lib-list-header>\n\n <div class=\"content_container\" style=\"width:100%\">\n @if(dataSource)\n {\n <div class=\"search_result_container\" style=\"width:350px\">\n\n @if (dataSource.loading()) {\n <div class=\"spinner-container\">\n <mat-spinner></mat-spinner>\n </div>\n }\n\n @if(!embeddedMode()){\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\n <div style=\"width: 100%\" [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 <h2 style=\"margin-bottom:5px; margin-top: 0px; padding: 0px;\">Results: {{dataSource.length()}}</h2>\n <lib-list-scroll-view [listItemTemplate]=\"listItemTemplate()\" [itemHeight]=\"itemHeight()\" [dataSource]=\"dataSource\" (selected)=\"onSelection($event)\"></lib-list-scroll-view>\n }\n </div>\n </div>\n <div class=\"detail-container\" style=\"width:100%; min-width: 400px;\">\n <ng-container *ngTemplateOutlet=\"itemDetailTemplate()\">\n </ng-container>\n </div>\n }\n </div>\n</div>", styles: [":host{flex-grow:1}.container{display:flex;padding-left:10px;padding-right:10px;flex-direction:column;justify-content:center;text-align:center;align-items:center}.content_container{display:flex;flex-direction:row;justify-content:left;text-align:left;align-items:left}.hide-element{display:none}\n"] }]
|
|
2023
|
+
}], propDecorators: { viewType: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewType", required: false }] }], itemService: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemService", required: false }] }], listItemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "listItemTemplate", required: false }] }], itemDetailTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemDetailTemplate", required: false }] }], itemHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemHeight", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], sortFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortFields", required: false }] }], noSelfItemsMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noSelfItemsMessage", required: false }] }], noItemsCanCreateMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noItemsCanCreateMessage", required: false }] }], noItemsMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noItemsMessage", required: false }] }], defaultQueries: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultQueries", required: false }] }], embeddedMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "embeddedMode", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }], sort: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatSort), { isSignal: true }] }] } });
|
|
1964
2024
|
|
|
1965
|
-
class
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
this.deleteClicked.emit();
|
|
2025
|
+
class TopBarComponent {
|
|
2026
|
+
title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
2027
|
+
logo = input(...(ngDevMode ? [undefined, { debugName: "logo" }] : []));
|
|
2028
|
+
background = input(...(ngDevMode ? [undefined, { debugName: "background" }] : []));
|
|
2029
|
+
user = signal(null, ...(ngDevMode ? [{ debugName: "user" }] : []));
|
|
2030
|
+
loginRoute = input("home", ...(ngDevMode ? [{ debugName: "loginRoute" }] : []));
|
|
2031
|
+
userService = inject(UserService);
|
|
2032
|
+
constructor() {
|
|
2033
|
+
this.userService.loggedInUser.subscribe(user => this.user.set(user));
|
|
1975
2034
|
}
|
|
1976
|
-
|
|
1977
|
-
|
|
2035
|
+
onLogout() {
|
|
2036
|
+
this.userService.logout();
|
|
2037
|
+
}
|
|
2038
|
+
onLogin() {
|
|
2039
|
+
this.userService.login("/" + this.loginRoute);
|
|
2040
|
+
}
|
|
2041
|
+
get initials() {
|
|
2042
|
+
const user = this.user();
|
|
2043
|
+
if (user) {
|
|
2044
|
+
return PortalMember.getInitials(user);
|
|
2045
|
+
}
|
|
2046
|
+
return "";
|
|
2047
|
+
}
|
|
2048
|
+
get backgroundStyle() {
|
|
2049
|
+
if (this.background()) {
|
|
2050
|
+
return "url(" + this.background() + ")";
|
|
2051
|
+
}
|
|
2052
|
+
else {
|
|
2053
|
+
return "none";
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TopBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2057
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: TopBarComponent, isStandalone: true, selector: "lib-top-bar", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null }, loginRoute: { classPropertyName: "loginRoute", publicName: "loginRoute", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-toolbar class=\"toolbar\" [style.background-image]=\"backgroundStyle\">\n\n @if(logo())\n {\n <a aria-label=\"Home\" [routerLink]=\"['home']\">\n <img src=\"{{logo()}}\" class=\"logo\" alt=\"Website logo\"/>\n </a>\n }\n @else {\n <a mat-icon-button aria-label=\"Home\" [routerLink]=\"['home']\">\n <mat-icon class=\"icon\">home</mat-icon>\n </a>\n <span>{{title()}}</span>\n }\n <span class=\"topbar-spacer\"></span>\n @if(user(); as user)\n {\n <span>{{user.username}}</span>\n \n <button mat-icon-button style=\"margin: 5px\" aria-label=\"User Profile\" [matMenuTriggerFor]=\"profile_menu\">\n <mat-icon class=\"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 }\n @else {\n <span>Log In</span>\n <button matIconButton (click)=\"onLogin()\">\n <mat-icon class=\"icon\">login</mat-icon>\n </button>\n }\n</mat-toolbar>\n", styles: [".topbar-spacer{flex:1 1 auto}.toolbar{height:60px;background-size:cover;--mat-toolbar-container-background-color: var(--mat-sys-primary);--mat-toolbar-container-text-color: var(--mat-sys-on-primary)}.logo{height:50px;margin-top:5px}.icon{color:var(--mat-sys-on-primary)}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatToolbarModule }, { kind: "component", type: i2$4.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { 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.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"] }] });
|
|
1978
2058
|
}
|
|
1979
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type:
|
|
2059
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: TopBarComponent, decorators: [{
|
|
1980
2060
|
type: Component,
|
|
1981
|
-
args: [{ selector: 'lib-
|
|
2061
|
+
args: [{ selector: 'lib-top-bar', imports: [RouterModule,
|
|
2062
|
+
MatToolbarModule,
|
|
2063
|
+
MatIconModule,
|
|
1982
2064
|
MatButtonModule,
|
|
1983
|
-
|
|
1984
|
-
}],
|
|
2065
|
+
MatMenuModule], template: "<mat-toolbar class=\"toolbar\" [style.background-image]=\"backgroundStyle\">\n\n @if(logo())\n {\n <a aria-label=\"Home\" [routerLink]=\"['home']\">\n <img src=\"{{logo()}}\" class=\"logo\" alt=\"Website logo\"/>\n </a>\n }\n @else {\n <a mat-icon-button aria-label=\"Home\" [routerLink]=\"['home']\">\n <mat-icon class=\"icon\">home</mat-icon>\n </a>\n <span>{{title()}}</span>\n }\n <span class=\"topbar-spacer\"></span>\n @if(user(); as user)\n {\n <span>{{user.username}}</span>\n \n <button mat-icon-button style=\"margin: 5px\" aria-label=\"User Profile\" [matMenuTriggerFor]=\"profile_menu\">\n <mat-icon class=\"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 }\n @else {\n <span>Log In</span>\n <button matIconButton (click)=\"onLogin()\">\n <mat-icon class=\"icon\">login</mat-icon>\n </button>\n }\n</mat-toolbar>\n", styles: [".topbar-spacer{flex:1 1 auto}.toolbar{height:60px;background-size:cover;--mat-toolbar-container-background-color: var(--mat-sys-primary);--mat-toolbar-container-text-color: var(--mat-sys-on-primary)}.logo{height:50px;margin-top:5px}.icon{color:var(--mat-sys-on-primary)}\n"] }]
|
|
2066
|
+
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], logo: [{ type: i0.Input, args: [{ isSignal: true, alias: "logo", required: false }] }], background: [{ type: i0.Input, args: [{ isSignal: true, alias: "background", required: false }] }], loginRoute: [{ type: i0.Input, args: [{ isSignal: true, alias: "loginRoute", required: false }] }] } });
|
|
1985
2067
|
|
|
1986
|
-
class
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
2068
|
+
class LeftNavComponent {
|
|
2069
|
+
background = input(...(ngDevMode ? [undefined, { debugName: "background" }] : []));
|
|
2070
|
+
_leftNavService = inject(LeftNavService);
|
|
2071
|
+
sideNavContent = viewChild(MatSidenavContent, ...(ngDevMode ? [{ debugName: "sideNavContent" }] : []));
|
|
2072
|
+
getOptions() {
|
|
2073
|
+
return this._leftNavService.activeOptions;
|
|
2074
|
+
}
|
|
2075
|
+
get backgroundStyle() {
|
|
2076
|
+
if (this.background()) {
|
|
2077
|
+
return "url(" + this.background() + ")";
|
|
2078
|
+
}
|
|
2079
|
+
else {
|
|
2080
|
+
return "none";
|
|
2081
|
+
}
|
|
1995
2082
|
}
|
|
2083
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeftNavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2084
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: LeftNavComponent, isStandalone: true, selector: "lib-left-nav", inputs: { background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: false, transformFunction: null } }, 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 <ul>\n @for (option of _leftNavService.activeOptions(); track option) {\n <li>\n <a mat-list-item \n [routerLink]=\"option.route\" \n routerLinkActive #rla=\"routerLinkActive\" \n [activated]=\"rla.isActive\">{{ option.name }}</a>\n </li>\n }\n </ul>\n </mat-nav-list>\n </mat-sidenav>\n <mat-sidenav-content class=\"leftnav-content\" [style.background-image]=\"backgroundStyle\"> \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;background-blend-mode:lighten;background-color:#ffffffa6;background-size:cover}.leftnav-side{padding:5px;width:200px}ul,li{margin:0;padding:0}\n"], dependencies: [{ kind: "ngmodule", type: MatSidenavModule }, { kind: "component", type: i1$6.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { kind: "component", type: i1$6.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { kind: "component", type: i1$6.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$3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$3.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }] });
|
|
2085
|
+
}
|
|
2086
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: LeftNavComponent, decorators: [{
|
|
2087
|
+
type: Component,
|
|
2088
|
+
args: [{ selector: 'lib-left-nav', imports: [MatSidenavModule, MatListModule, RouterOutlet, RouterModule], template: "<mat-sidenav-container class=\"leftnav-container\">\n <mat-sidenav mode=\"side\" class=\"leftnav-side\" opened>\n <mat-nav-list>\n <ul>\n @for (option of _leftNavService.activeOptions(); track option) {\n <li>\n <a mat-list-item \n [routerLink]=\"option.route\" \n routerLinkActive #rla=\"routerLinkActive\" \n [activated]=\"rla.isActive\">{{ option.name }}</a>\n </li>\n }\n </ul>\n </mat-nav-list>\n </mat-sidenav>\n <mat-sidenav-content class=\"leftnav-content\" [style.background-image]=\"backgroundStyle\"> \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;background-blend-mode:lighten;background-color:#ffffffa6;background-size:cover}.leftnav-side{padding:5px;width:200px}ul,li{margin:0;padding:0}\n"] }]
|
|
2089
|
+
}], propDecorators: { background: [{ type: i0.Input, args: [{ isSignal: true, alias: "background", required: false }] }], sideNavContent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatSidenavContent), { isSignal: true }] }] } });
|
|
2090
|
+
|
|
2091
|
+
class FeedbackComponent {
|
|
2092
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FeedbackComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2093
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", type: FeedbackComponent, isStandalone: true, selector: "lib-feedback", ngImport: i0, template: "<p>feedback works!</p>\n", styles: [""] });
|
|
2094
|
+
}
|
|
2095
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FeedbackComponent, decorators: [{
|
|
2096
|
+
type: Component,
|
|
2097
|
+
args: [{ selector: 'lib-feedback', imports: [], template: "<p>feedback works!</p>\n" }]
|
|
2098
|
+
}] });
|
|
2099
|
+
|
|
2100
|
+
class AvatarComponent {
|
|
2101
|
+
text = input("", ...(ngDevMode ? [{ debugName: "text" }] : []));
|
|
2102
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2103
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", type: AvatarComponent, isStandalone: true, selector: "lib-avatar", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"container\"> <span>{{text()}}</span> </div>", styles: [".container{width:36px;height:36px;border-radius:100%;text-align:center;justify-content:center;align-content:center;background-color:#d3d3d3}.container span{line-height:8px;color:#000}\n"] });
|
|
1996
2104
|
}
|
|
2105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
2106
|
+
type: Component,
|
|
2107
|
+
args: [{ selector: 'lib-avatar', imports: [], template: "<div class=\"container\"> <span>{{text()}}</span> </div>", styles: [".container{width:36px;height:36px;border-radius:100%;text-align:center;justify-content:center;align-content:center;background-color:#d3d3d3}.container span{line-height:8px;color:#000}\n"] }]
|
|
2108
|
+
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }] } });
|
|
1997
2109
|
|
|
1998
2110
|
class UserDetailComponent extends DetailView {
|
|
2111
|
+
showBack = input(true, ...(ngDevMode ? [{ debugName: "showBack" }] : []));
|
|
1999
2112
|
constructor() {
|
|
2000
2113
|
super(inject(UserService));
|
|
2001
2114
|
}
|
|
@@ -2012,13 +2125,12 @@ class UserDetailComponent extends DetailView {
|
|
|
2012
2125
|
return super.canEdit();
|
|
2013
2126
|
}
|
|
2014
2127
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: UserDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2015
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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"] }] });
|
|
2128
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: UserDetailComponent, isStandalone: true, selector: "lib-user-detail", inputs: { showBack: { classPropertyName: "showBack", publicName: "showBack", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "@if(showBack())\n{\n<lib-back-button style=\"position: absolute;\"></lib-back-button>\n}\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"] }] });
|
|
2016
2129
|
}
|
|
2017
2130
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: UserDetailComponent, decorators: [{
|
|
2018
2131
|
type: Component,
|
|
2019
|
-
args: [{ selector: 'lib-user-detail', imports: [BackButtonComponent,
|
|
2020
|
-
|
|
2021
|
-
}], ctorParameters: () => [] });
|
|
2132
|
+
args: [{ selector: 'lib-user-detail', imports: [BackButtonComponent, DetailHeaderComponent], template: "@if(showBack())\n{\n<lib-back-button style=\"position: absolute;\"></lib-back-button>\n}\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"] }]
|
|
2133
|
+
}], ctorParameters: () => [], propDecorators: { showBack: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBack", required: false }] }] } });
|
|
2022
2134
|
|
|
2023
2135
|
class UserForm {
|
|
2024
2136
|
fb = inject(FormBuilder);
|
|
@@ -2081,7 +2193,7 @@ class UserEditComponent extends EditView {
|
|
|
2081
2193
|
return this.form.form.get('profile');
|
|
2082
2194
|
}
|
|
2083
2195
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: UserEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2084
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", 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$
|
|
2196
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", 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],[formArray],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.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: i1$1.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" }] });
|
|
2085
2197
|
}
|
|
2086
2198
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: UserEditComponent, decorators: [{
|
|
2087
2199
|
type: Component,
|
|
@@ -2099,28 +2211,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
2099
2211
|
|
|
2100
2212
|
class UserListDetailComponent {
|
|
2101
2213
|
item = input.required(...(ngDevMode ? [{ debugName: "item" }] : []));
|
|
2214
|
+
even = input(true, ...(ngDevMode ? [{ debugName: "even" }] : []));
|
|
2215
|
+
selected = input(false, ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
2216
|
+
get title() {
|
|
2217
|
+
if (this.item().first_name && this.item().last_name) {
|
|
2218
|
+
return this.item().first_name + " " + this.item().last_name;
|
|
2219
|
+
}
|
|
2220
|
+
else {
|
|
2221
|
+
return this.item().username;
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2102
2224
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: UserListDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2103
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: UserListDetailComponent, isStandalone: true, selector: "lib-user-list-detail", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<
|
|
2225
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: UserListDetailComponent, isStandalone: true, selector: "lib-user-list-detail", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, even: { classPropertyName: "even", publicName: "even", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div mat-list-item class=\"container\" [class.even]=\"even() && !selected()\" [class.selected]=\"selected()\">\n @if(item().profile_thumbnail){\n <div class=\"image-holder\" style=\"width:35px;\">\n <img matListItemAvatar \n alt=\"User Avatar\" \n src=\"{{item().profile_thumbnail}}\" style=\"height:30px\">\n </div> \n }\n @else {\n <div class=\"image-holder\" style=\"width:35px;\">\n <mat-icon matListItemIcon>person</mat-icon>\n </div>\n }\n <div class=\"text-container\">\n <p matListItemTitle style=\"margin-bottom: 0px; margin-top: 0px\">{{title}}</p>\n <p matListItemLine>{{item().email}}</p>\n </div>\n</div>", styles: [":host{flex-grow:1}.container{height:60px;padding:5px;width:100%;display:flex;flex-direction:row;background-color:var(--mat-sys-surface-container-low)}.container:hover{background-color:var(--mat-sys-surface-container-high);cursor:pointer}.even{background-color:var(--mat-sys-surface-container-lowest)}.selected{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}\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: MatListModule }, { kind: "directive", type: i2$2.MatListItemAvatar, selector: "[matListItemAvatar]" }, { kind: "directive", type: i2$2.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "directive", type: i2$2.MatListItemLine, selector: "[matListItemLine]" }, { kind: "directive", type: i2$2.MatListItemTitle, selector: "[matListItemTitle]" }] });
|
|
2104
2226
|
}
|
|
2105
2227
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: UserListDetailComponent, decorators: [{
|
|
2106
2228
|
type: Component,
|
|
2107
|
-
args: [{ selector: 'lib-user-list-detail', imports: [MatListModule,
|
|
2108
|
-
|
|
2109
|
-
}], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }] } });
|
|
2229
|
+
args: [{ selector: 'lib-user-list-detail', imports: [MatIconModule, MatListModule], template: "<div mat-list-item class=\"container\" [class.even]=\"even() && !selected()\" [class.selected]=\"selected()\">\n @if(item().profile_thumbnail){\n <div class=\"image-holder\" style=\"width:35px;\">\n <img matListItemAvatar \n alt=\"User Avatar\" \n src=\"{{item().profile_thumbnail}}\" style=\"height:30px\">\n </div> \n }\n @else {\n <div class=\"image-holder\" style=\"width:35px;\">\n <mat-icon matListItemIcon>person</mat-icon>\n </div>\n }\n <div class=\"text-container\">\n <p matListItemTitle style=\"margin-bottom: 0px; margin-top: 0px\">{{title}}</p>\n <p matListItemLine>{{item().email}}</p>\n </div>\n</div>", styles: [":host{flex-grow:1}.container{height:60px;padding:5px;width:100%;display:flex;flex-direction:row;background-color:var(--mat-sys-surface-container-low)}.container:hover{background-color:var(--mat-sys-surface-container-high);cursor:pointer}.even{background-color:var(--mat-sys-surface-container-lowest)}.selected{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}\n"] }]
|
|
2230
|
+
}], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], even: [{ type: i0.Input, args: [{ isSignal: true, alias: "even", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }] } });
|
|
2110
2231
|
|
|
2111
2232
|
class UserComponent {
|
|
2112
|
-
viewType = signal("list", ...(ngDevMode ? [{ debugName: "viewType" }] : []));
|
|
2113
2233
|
itemService = inject(UserService);
|
|
2114
|
-
|
|
2234
|
+
detailView = viewChild(UserDetailComponent, ...(ngDevMode ? [{ debugName: "detailView" }] : []));
|
|
2235
|
+
onSelected(id) {
|
|
2236
|
+
if (id) {
|
|
2237
|
+
this.detailView()?.onSelection(id);
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2115
2240
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: UserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2116
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2241
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.3", type: UserComponent, isStandalone: true, selector: "lib-user", viewQueries: [{ propertyName: "detailView", first: true, predicate: UserDetailComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<lib-list-view\n [itemService]=\"itemService\"\n [listItemTemplate]=\"listItemTemplate\"\n [itemDetailTemplate]=\"itemDetailTemplate\"\n [viewType]=\"'list'\"\n [itemHeight]=\"60\"\n (selected)=\"onSelected($event)\"\n >\n <ng-template #listItemTemplate let-item=\"item\" let-even=\"even\" let-selected=\"selected\">\n <lib-user-list-detail [item]=\"item\" [even]=\"even\" [selected]=\"selected\"></lib-user-list-detail>\n </ng-template>\n\n <ng-template #itemDetailTemplate>\n <lib-user-detail [showBack]='false'></lib-user-detail>\n </ng-template>\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", "listItemTemplate", "itemDetailTemplate", "itemHeight", "columns", "sortFields", "noSelfItemsMessage", "noItemsCanCreateMessage", "noItemsMessage", "defaultQueries", "embeddedMode"], outputs: ["selected"] }, { kind: "component", type: UserListDetailComponent, selector: "lib-user-list-detail", inputs: ["item", "even", "selected"] }, { kind: "component", type: UserDetailComponent, selector: "lib-user-detail", inputs: ["showBack"] }] });
|
|
2117
2242
|
}
|
|
2118
2243
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: UserComponent, decorators: [{
|
|
2119
2244
|
type: Component,
|
|
2120
|
-
args: [{ selector: 'lib-user', imports: [ListViewComponent,
|
|
2121
|
-
|
|
2245
|
+
args: [{ selector: 'lib-user', imports: [ListViewComponent,
|
|
2246
|
+
UserListDetailComponent,
|
|
2247
|
+
UserDetailComponent], template: "<lib-list-view\n [itemService]=\"itemService\"\n [listItemTemplate]=\"listItemTemplate\"\n [itemDetailTemplate]=\"itemDetailTemplate\"\n [viewType]=\"'list'\"\n [itemHeight]=\"60\"\n (selected)=\"onSelected($event)\"\n >\n <ng-template #listItemTemplate let-item=\"item\" let-even=\"even\" let-selected=\"selected\">\n <lib-user-list-detail [item]=\"item\" [even]=\"even\" [selected]=\"selected\"></lib-user-list-detail>\n </ng-template>\n\n <ng-template #itemDetailTemplate>\n <lib-user-detail [showBack]='false'></lib-user-detail>\n </ng-template>\n\n</lib-list-view>\n\n", styles: [":host{flex-grow:1}\n"] }]
|
|
2248
|
+
}], propDecorators: { detailView: [{ type: i0.ViewChild, args: [i0.forwardRef(() => UserDetailComponent), { isSignal: true }] }] } });
|
|
2122
2249
|
|
|
2123
2250
|
class GroupDetailComponent extends DetailView {
|
|
2251
|
+
showBack = input(true, ...(ngDevMode ? [{ debugName: "showBack" }] : []));
|
|
2124
2252
|
constructor() {
|
|
2125
2253
|
super(inject(GroupService));
|
|
2126
2254
|
}
|
|
@@ -2128,30 +2256,35 @@ class GroupDetailComponent extends DetailView {
|
|
|
2128
2256
|
this.onInit();
|
|
2129
2257
|
}
|
|
2130
2258
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GroupDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2131
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: GroupDetailComponent, isStandalone: true, selector: "lib-group-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.name\"\n [id]=\"item.id\"\n [canEdit]=\"itemService.canEdit()\"\n [canDelete]=\"itemService.canDelete()\"\n [route]=\"itemService.typePlural()\"></lib-detail-header>\n \n <div class=\"item-field\">{{item.name}}</div>\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"] }] });
|
|
2259
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: GroupDetailComponent, isStandalone: true, selector: "lib-group-detail", inputs: { showBack: { classPropertyName: "showBack", publicName: "showBack", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "@if(showBack())\n{\n<lib-back-button style=\"position: absolute;\"></lib-back-button>\n}\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.name\"\n [id]=\"item.id\"\n [canEdit]=\"itemService.canEdit()\"\n [canDelete]=\"itemService.canDelete()\"\n [route]=\"itemService.typePlural()\"></lib-detail-header>\n \n <div class=\"item-field\">{{item.name}}</div>\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"] }] });
|
|
2132
2260
|
}
|
|
2133
2261
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GroupDetailComponent, decorators: [{
|
|
2134
2262
|
type: Component,
|
|
2135
2263
|
args: [{ selector: 'lib-group-detail', imports: [BackButtonComponent,
|
|
2136
|
-
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.name\"\n [id]=\"item.id\"\n [canEdit]=\"itemService.canEdit()\"\n [canDelete]=\"itemService.canDelete()\"\n [route]=\"itemService.typePlural()\"></lib-detail-header>\n \n <div class=\"item-field\">{{item.name}}</div>\n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}\n"] }]
|
|
2137
|
-
}], ctorParameters: () => [] });
|
|
2264
|
+
DetailHeaderComponent], template: "@if(showBack())\n{\n<lib-back-button style=\"position: absolute;\"></lib-back-button>\n}\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.name\"\n [id]=\"item.id\"\n [canEdit]=\"itemService.canEdit()\"\n [canDelete]=\"itemService.canDelete()\"\n [route]=\"itemService.typePlural()\"></lib-detail-header>\n \n <div class=\"item-field\">{{item.name}}</div>\n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}\n"] }]
|
|
2265
|
+
}], ctorParameters: () => [], propDecorators: { showBack: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBack", required: false }] }] } });
|
|
2138
2266
|
|
|
2139
2267
|
class GroupComponent {
|
|
2140
2268
|
itemService = inject(GroupService);
|
|
2141
|
-
|
|
2269
|
+
detailView = viewChild(GroupDetailComponent, ...(ngDevMode ? [{ debugName: "detailView" }] : []));
|
|
2270
|
+
onSelected(id) {
|
|
2271
|
+
if (id) {
|
|
2272
|
+
this.detailView()?.onSelection(id);
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2142
2275
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2143
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2276
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.3", type: GroupComponent, isStandalone: true, selector: "lib-group", viewQueries: [{ propertyName: "detailView", first: true, predicate: GroupDetailComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<lib-list-view\n [itemService]=\"itemService\"\n [listItemTemplate]=\"listItemTemplate\"\n [itemDetailTemplate]=\"itemDetailTemplate\"\n [viewType]=\"'list'\"\n [itemHeight]=\"60\"\n (selected)=\"onSelected($event)\"\n >\n <ng-template #listItemTemplate let-item=\"item\" let-even=\"even\" let-selected=\"selected\">\n\n <div mat-list-item class=\"container\" [class.even]=\"even && !selected\" [class.selected]=\"selected\">\n <div class=\"text-container\">\n <p matListItemTitle style=\"margin-bottom: 0px; margin-top: 0px\">{{item.name}}</p>\n </div>\n </div>\n\n </ng-template>\n\n <ng-template #itemDetailTemplate>\n <lib-group-detail [showBack]='false'></lib-group-detail>\n </ng-template>\n\n</lib-list-view>\n\n", styles: [":host{flex-grow:1}.container{height:60px;padding:5px;width:100%;display:flex;flex-direction:row;background-color:var(--mat-sys-surface-container-low)}.container:hover{background-color:var(--mat-sys-surface-container-high);cursor:pointer}.even{background-color:var(--mat-sys-surface-container-lowest)}.selected{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}\n"], dependencies: [{ kind: "component", type: ListViewComponent, selector: "lib-list-view", inputs: ["viewType", "itemService", "listItemTemplate", "itemDetailTemplate", "itemHeight", "columns", "sortFields", "noSelfItemsMessage", "noItemsCanCreateMessage", "noItemsMessage", "defaultQueries", "embeddedMode"], outputs: ["selected"] }, { kind: "component", type: GroupDetailComponent, selector: "lib-group-detail", inputs: ["showBack"] }, { kind: "ngmodule", type: MatListModule }, { kind: "directive", type: i2$2.MatListItemTitle, selector: "[matListItemTitle]" }] });
|
|
2144
2277
|
}
|
|
2145
2278
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: GroupComponent, decorators: [{
|
|
2146
2279
|
type: Component,
|
|
2147
|
-
args: [{ selector: 'lib-group', imports: [ListViewComponent], template: "<lib-list-view\n [itemService]=\"itemService\"\n [
|
|
2148
|
-
}] });
|
|
2280
|
+
args: [{ selector: 'lib-group', imports: [ListViewComponent, GroupDetailComponent, MatListModule], template: "<lib-list-view\n [itemService]=\"itemService\"\n [listItemTemplate]=\"listItemTemplate\"\n [itemDetailTemplate]=\"itemDetailTemplate\"\n [viewType]=\"'list'\"\n [itemHeight]=\"60\"\n (selected)=\"onSelected($event)\"\n >\n <ng-template #listItemTemplate let-item=\"item\" let-even=\"even\" let-selected=\"selected\">\n\n <div mat-list-item class=\"container\" [class.even]=\"even && !selected\" [class.selected]=\"selected\">\n <div class=\"text-container\">\n <p matListItemTitle style=\"margin-bottom: 0px; margin-top: 0px\">{{item.name}}</p>\n </div>\n </div>\n\n </ng-template>\n\n <ng-template #itemDetailTemplate>\n <lib-group-detail [showBack]='false'></lib-group-detail>\n </ng-template>\n\n</lib-list-view>\n\n", styles: [":host{flex-grow:1}.container{height:60px;padding:5px;width:100%;display:flex;flex-direction:row;background-color:var(--mat-sys-surface-container-low)}.container:hover{background-color:var(--mat-sys-surface-container-high);cursor:pointer}.even{background-color:var(--mat-sys-surface-container-lowest)}.selected{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}\n"] }]
|
|
2281
|
+
}], propDecorators: { detailView: [{ type: i0.ViewChild, args: [i0.forwardRef(() => GroupDetailComponent), { isSignal: true }] }] } });
|
|
2149
2282
|
|
|
2150
2283
|
class AddressEditComponent {
|
|
2151
2284
|
countryOptions = input([], ...(ngDevMode ? [{ debugName: "countryOptions" }] : []));
|
|
2152
2285
|
form = input(...(ngDevMode ? [undefined, { debugName: "form" }] : []));
|
|
2153
2286
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: AddressEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2154
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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
|
|
2287
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", 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],[formArray],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"] }] });
|
|
2155
2288
|
}
|
|
2156
2289
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: AddressEditComponent, decorators: [{
|
|
2157
2290
|
type: Component,
|
|
@@ -2225,22 +2358,8 @@ class AddressForm {
|
|
|
2225
2358
|
}
|
|
2226
2359
|
}
|
|
2227
2360
|
|
|
2228
|
-
class OrganizationComponent {
|
|
2229
|
-
itemService = inject(OrganizationService);
|
|
2230
|
-
columns = [{ name: 'name', title: 'Name', element_type: 'string' },
|
|
2231
|
-
{ name: 'website', title: 'Website', element_type: 'url' },
|
|
2232
|
-
{ name: 'is_partner', title: 'Is Partner', element_type: 'boolean' }];
|
|
2233
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2234
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", 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", "embeddedMode"] }] });
|
|
2235
|
-
}
|
|
2236
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationComponent, decorators: [{
|
|
2237
|
-
type: Component,
|
|
2238
|
-
args: [{ selector: 'lib-organization', imports: [
|
|
2239
|
-
ListViewComponent
|
|
2240
|
-
], 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"] }]
|
|
2241
|
-
}] });
|
|
2242
|
-
|
|
2243
2361
|
class OrganizationDetailComponent extends DetailView {
|
|
2362
|
+
showBack = input(true, ...(ngDevMode ? [{ debugName: "showBack" }] : []));
|
|
2244
2363
|
constructor() {
|
|
2245
2364
|
super(inject(OrganizationService));
|
|
2246
2365
|
}
|
|
@@ -2248,13 +2367,35 @@ class OrganizationDetailComponent extends DetailView {
|
|
|
2248
2367
|
this.onInit();
|
|
2249
2368
|
}
|
|
2250
2369
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2251
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: OrganizationDetailComponent, isStandalone: true, selector: "lib-organization-detail", usesInheritance: true, ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n @if(item(); as item){\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.name\"\n [id]=\"item.id\"\n [canEdit]=\"itemService.canEdit()\"\n [canDelete]=\"itemService.canDelete()\"\n [route]=\"itemService.typePlural()\"\n (deleteClicked)=\"onDeleteClicked()\"></lib-detail-header>\n\n <div class=\"item-field\">\n <p style=\"text-align: justify; text-justify: inter-word;\">{{item.description}}</p>\n </div>\n \n <h3>Address</h3>\n <lib-address-detail [address]=\"item.address\"></lib-address-detail>\n\n <h3>Website</h3>\n <div class=\"item-field\">\n <a href=\"{{item.website}}\" target=\"_blank\" rel=\"noopener noreferrer\">{{item.website}}</a>\n </div>\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"] }, { kind: "component", type: AddressDetailComponent, selector: "lib-address-detail", inputs: ["address"] }] });
|
|
2370
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: OrganizationDetailComponent, isStandalone: true, selector: "lib-organization-detail", inputs: { showBack: { classPropertyName: "showBack", publicName: "showBack", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "@if(showBack())\n{\n<lib-back-button style=\"position: absolute;\"></lib-back-button>\n}\n<div class=\"content-container\">\n\n @if(item(); as item){\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.name\"\n [id]=\"item.id\"\n [canEdit]=\"itemService.canEdit()\"\n [canDelete]=\"itemService.canDelete()\"\n [route]=\"itemService.typePlural()\"\n (deleteClicked)=\"onDeleteClicked()\"></lib-detail-header>\n\n <div class=\"item-field\">\n <p style=\"text-align: justify; text-justify: inter-word; max-width: 600px;\">{{item.description}}</p>\n </div>\n \n <h3>Address</h3>\n <lib-address-detail [address]=\"item.address\"></lib-address-detail>\n\n <h3>Website</h3>\n <div class=\"item-field\">\n <a href=\"{{item.website}}\" target=\"_blank\" rel=\"noopener noreferrer\">{{item.website}}</a>\n </div>\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"] }, { kind: "component", type: AddressDetailComponent, selector: "lib-address-detail", inputs: ["address"] }] });
|
|
2252
2371
|
}
|
|
2253
2372
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationDetailComponent, decorators: [{
|
|
2254
2373
|
type: Component,
|
|
2255
2374
|
args: [{ selector: 'lib-organization-detail', imports: [BackButtonComponent,
|
|
2256
|
-
DetailHeaderComponent, AddressDetailComponent], template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n @if(item(); as item){\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.name\"\n [id]=\"item.id\"\n [canEdit]=\"itemService.canEdit()\"\n [canDelete]=\"itemService.canDelete()\"\n [route]=\"itemService.typePlural()\"\n (deleteClicked)=\"onDeleteClicked()\"></lib-detail-header>\n\n <div class=\"item-field\">\n <p style=\"text-align: justify; text-justify: inter-word;\">{{item.description}}</p>\n </div>\n \n <h3>Address</h3>\n <lib-address-detail [address]=\"item.address\"></lib-address-detail>\n\n <h3>Website</h3>\n <div class=\"item-field\">\n <a href=\"{{item.website}}\" target=\"_blank\" rel=\"noopener noreferrer\">{{item.website}}</a>\n </div>\n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}\n"] }]
|
|
2257
|
-
}], ctorParameters: () => [] });
|
|
2375
|
+
DetailHeaderComponent, AddressDetailComponent], template: "@if(showBack())\n{\n<lib-back-button style=\"position: absolute;\"></lib-back-button>\n}\n<div class=\"content-container\">\n\n @if(item(); as item){\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.name\"\n [id]=\"item.id\"\n [canEdit]=\"itemService.canEdit()\"\n [canDelete]=\"itemService.canDelete()\"\n [route]=\"itemService.typePlural()\"\n (deleteClicked)=\"onDeleteClicked()\"></lib-detail-header>\n\n <div class=\"item-field\">\n <p style=\"text-align: justify; text-justify: inter-word; max-width: 600px;\">{{item.description}}</p>\n </div>\n \n <h3>Address</h3>\n <lib-address-detail [address]=\"item.address\"></lib-address-detail>\n\n <h3>Website</h3>\n <div class=\"item-field\">\n <a href=\"{{item.website}}\" target=\"_blank\" rel=\"noopener noreferrer\">{{item.website}}</a>\n </div>\n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}\n"] }]
|
|
2376
|
+
}], ctorParameters: () => [], propDecorators: { showBack: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBack", required: false }] }] } });
|
|
2377
|
+
|
|
2378
|
+
class OrganizationComponent {
|
|
2379
|
+
itemService = inject(OrganizationService);
|
|
2380
|
+
columns = [{ name: 'name', title: 'Name', element_type: 'string' },
|
|
2381
|
+
{ name: 'website', title: 'Website', element_type: 'url' },
|
|
2382
|
+
{ name: 'is_partner', title: 'Is Partner', element_type: 'boolean' }];
|
|
2383
|
+
detailView = viewChild(OrganizationDetailComponent, ...(ngDevMode ? [{ debugName: "detailView" }] : []));
|
|
2384
|
+
onSelected(id) {
|
|
2385
|
+
if (id) {
|
|
2386
|
+
this.detailView()?.onSelection(id);
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2390
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.3", type: OrganizationComponent, isStandalone: true, selector: "lib-organization", viewQueries: [{ propertyName: "detailView", first: true, predicate: OrganizationDetailComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<lib-list-view\n [itemService]=\"itemService\"\n [listItemTemplate]=\"listItemTemplate\"\n [itemDetailTemplate]=\"itemDetailTemplate\"\n [viewType]=\"'list'\"\n [itemHeight]=\"60\"\n (selected)=\"onSelected($event)\"\n >\n <ng-template #listItemTemplate let-item=\"item\" let-even=\"even\" let-selected=\"selected\">\n <div mat-list-item class=\"container\" [class.even]=\"even && !selected\" [class.selected]=\"selected\">\n <div class=\"text-container\">\n <p matListItemTitle style=\"margin-bottom: 0px; margin-top: 0px\">{{item.name}}</p>\n </div>\n </div>\n </ng-template>\n\n <ng-template #itemDetailTemplate>\n <lib-organization-detail [showBack]='false'></lib-organization-detail>\n </ng-template>\n\n</lib-list-view>\n\n\n\n", styles: [":host{flex-grow:1}.container{height:60px;padding:5px;width:100%;display:flex;flex-direction:row;background-color:var(--mat-sys-surface-container-low)}.container:hover{background-color:var(--mat-sys-surface-container-high);cursor:pointer}.even{background-color:var(--mat-sys-surface-container-lowest)}.selected{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}\n"], dependencies: [{ kind: "component", type: ListViewComponent, selector: "lib-list-view", inputs: ["viewType", "itemService", "listItemTemplate", "itemDetailTemplate", "itemHeight", "columns", "sortFields", "noSelfItemsMessage", "noItemsCanCreateMessage", "noItemsMessage", "defaultQueries", "embeddedMode"], outputs: ["selected"] }, { kind: "component", type: OrganizationDetailComponent, selector: "lib-organization-detail", inputs: ["showBack"] }] });
|
|
2391
|
+
}
|
|
2392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationComponent, decorators: [{
|
|
2393
|
+
type: Component,
|
|
2394
|
+
args: [{ selector: 'lib-organization', imports: [
|
|
2395
|
+
ListViewComponent,
|
|
2396
|
+
OrganizationDetailComponent
|
|
2397
|
+
], template: "<lib-list-view\n [itemService]=\"itemService\"\n [listItemTemplate]=\"listItemTemplate\"\n [itemDetailTemplate]=\"itemDetailTemplate\"\n [viewType]=\"'list'\"\n [itemHeight]=\"60\"\n (selected)=\"onSelected($event)\"\n >\n <ng-template #listItemTemplate let-item=\"item\" let-even=\"even\" let-selected=\"selected\">\n <div mat-list-item class=\"container\" [class.even]=\"even && !selected\" [class.selected]=\"selected\">\n <div class=\"text-container\">\n <p matListItemTitle style=\"margin-bottom: 0px; margin-top: 0px\">{{item.name}}</p>\n </div>\n </div>\n </ng-template>\n\n <ng-template #itemDetailTemplate>\n <lib-organization-detail [showBack]='false'></lib-organization-detail>\n </ng-template>\n\n</lib-list-view>\n\n\n\n", styles: [":host{flex-grow:1}.container{height:60px;padding:5px;width:100%;display:flex;flex-direction:row;background-color:var(--mat-sys-surface-container-low)}.container:hover{background-color:var(--mat-sys-surface-container-high);cursor:pointer}.even{background-color:var(--mat-sys-surface-container-lowest)}.selected{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-on-primary-container)}\n"] }]
|
|
2398
|
+
}], propDecorators: { detailView: [{ type: i0.ViewChild, args: [i0.forwardRef(() => OrganizationDetailComponent), { isSignal: true }] }] } });
|
|
2258
2399
|
|
|
2259
2400
|
class OrganizationForm {
|
|
2260
2401
|
fb = inject(FormBuilder);
|
|
@@ -2331,7 +2472,7 @@ class OrganizationEditComponent extends EditView {
|
|
|
2331
2472
|
this.selectionManager.fetchCandidates(this.itemService.typename, item.id);
|
|
2332
2473
|
}
|
|
2333
2474
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2334
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", 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=\"
|
|
2475
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", type: OrganizationEditComponent, isStandalone: true, selector: "lib-organization-edit", usesInheritance: true, ngImport: i0, template: "<lib-back-button style=\"position: absolute;\"></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\" style=\"padding: 0px; margin-top: 0px; margin-bottom: 5px;\">{{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-wide\">\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%\" [expanded]=\"true\">\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 style=\"width:100%\" [selected]=\"selectionManager.selected()\"\n [itemType]=\"'Members'\"\n [columns]=\"selectionManager.columns\"\n [itemTemplate]=\"itemTemplate\"\n [options]=\"selectionManager.candidates()\"\n (itemAdded)=\"selectionManager.onAdded($event)\"\n (itemRemoved)=\"selectionManager.onRemoved($event)\"\n (searchChanged)=\"selectionManager.onSearchChanged($event)\">\n </lib-select-table>\n <ng-template #itemTemplate let-item=\"item\">\n <div>\n <p><b>{{item.first_name}} {{item.last_name}} ({{item.username}})</b></p>\n <p>{{item.email}}</p>\n </div>\n </ng-template>\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 || !form.form.dirty\">\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],[formArray],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.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: i1$1.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", "itemTemplate"], 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" }] });
|
|
2335
2476
|
}
|
|
2336
2477
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: OrganizationEditComponent, decorators: [{
|
|
2337
2478
|
type: Component,
|
|
@@ -2349,7 +2490,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
2349
2490
|
SelectTableComponent,
|
|
2350
2491
|
MatTabsModule,
|
|
2351
2492
|
TitleCasePipe
|
|
2352
|
-
], 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=\"
|
|
2493
|
+
], template: "<lib-back-button style=\"position: absolute;\"></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\" style=\"padding: 0px; margin-top: 0px; margin-bottom: 5px;\">{{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-wide\">\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%\" [expanded]=\"true\">\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 style=\"width:100%\" [selected]=\"selectionManager.selected()\"\n [itemType]=\"'Members'\"\n [columns]=\"selectionManager.columns\"\n [itemTemplate]=\"itemTemplate\"\n [options]=\"selectionManager.candidates()\"\n (itemAdded)=\"selectionManager.onAdded($event)\"\n (itemRemoved)=\"selectionManager.onRemoved($event)\"\n (searchChanged)=\"selectionManager.onSearchChanged($event)\">\n </lib-select-table>\n <ng-template #itemTemplate let-item=\"item\">\n <div>\n <p><b>{{item.first_name}} {{item.last_name}} ({{item.username}})</b></p>\n <p>{{item.email}}</p>\n </div>\n </ng-template>\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 || !form.form.dirty\">\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"] }]
|
|
2353
2494
|
}], ctorParameters: () => [] });
|
|
2354
2495
|
|
|
2355
2496
|
/*
|
|
@@ -2360,5 +2501,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
2360
2501
|
* Generated bundle index. Do not edit.
|
|
2361
2502
|
*/
|
|
2362
2503
|
|
|
2363
|
-
export { Address, AddressDetailComponent, AddressEditComponent, AddressForm, AddressService, ApiError, AvatarComponent, BackButtonComponent, DetailHeaderComponent, DetailView, DynamicFormBuilderComponent, DynamicFormComponent, DynamicFormForm, EditView, ErrorCode, FORM_FIELD_CHOICES, FeedbackComponent, FieldType, FileRecord, FileUploadComponent, FormFieldDetailComponent, FormFieldEditComponent, FormFieldValueForm, FormService, Group, GroupComponent, GroupDetailComponent, GroupService, ItemQuery, ItemService, ItemWithUserService, LeftNavComponent, LeftNavService, ListTableViewComponent, ListViewComponent, MemberSelectionManager, MockItemService, Organization, OrganizationComponent, OrganizationDetailComponent, OrganizationEditComponent, OrganizationService, Paginated, Permission, PopulatedFormComponent, PopulatedFormForm, PortalMember, REST_SERVICE_CONFIG, ResolvedPermission, RestService, SearchBarComponent, SelectTableComponent, SelectionManager, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserService, getFieldTypeFromKey };
|
|
2504
|
+
export { Address, AddressDetailComponent, AddressEditComponent, AddressForm, AddressService, ApiError, AvatarComponent, BackButtonComponent, DetailHeaderComponent, DetailView, DynamicFormBuilderComponent, DynamicFormComponent, DynamicFormForm, EditView, ErrorCode, FORM_FIELD_CHOICES, FeedbackComponent, FieldType, FileRecord, FileUploadComponent, FormFieldDetailComponent, FormFieldEditComponent, FormFieldValueForm, FormService, Group, GroupComponent, GroupDetailComponent, GroupService, ItemQuery, ItemService, ItemWithUserService, LeftNavComponent, LeftNavService, ListTableViewComponent, ListViewComponent, MemberSelectionManager, MockItemService, Organization, OrganizationComponent, OrganizationDetailComponent, OrganizationEditComponent, OrganizationService, Paginated, Permission, PopulatedFormComponent, PopulatedFormForm, PortalMember, REST_SERVICE_CONFIG, ResolvedPermission, RestService, SearchBarComponent, SelectTableComponent, SelectionManager, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserService, getFieldTypeFromKey, getFileFieldIds };
|
|
2364
2505
|
//# sourceMappingURL=ichec-angular-core.mjs.map
|