ichec-angular-core 0.1.2 → 0.1.4

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/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import * as _angular_forms from '@angular/forms';
2
+ import { FormGroup, FormArray, FormControl, FormBuilder } from '@angular/forms';
1
3
  import * as rxjs from 'rxjs';
2
4
  import { Observable, BehaviorSubject } from 'rxjs';
3
5
  import { HttpClient, HttpErrorResponse } from '@angular/common/http';
@@ -7,8 +9,6 @@ import * as ichec_angular_core from 'ichec-angular-core';
7
9
  import { MatSidenavContent } from '@angular/material/sidenav';
8
10
  import { ActivatedRoute } from '@angular/router';
9
11
  import { Location } from '@angular/common';
10
- import * as _angular_forms from '@angular/forms';
11
- import { FormControl, FormGroup } from '@angular/forms';
12
12
  import { MatTable } from '@angular/material/table';
13
13
  import { MatSort } from '@angular/material/sort';
14
14
  import { MatPaginator } from '@angular/material/paginator';
@@ -34,50 +34,47 @@ declare class Paginated<T extends Identifiable> implements IPaginated<T> {
34
34
  interface IPermission extends Identifiable {
35
35
  codename: string;
36
36
  }
37
- declare class Permission implements IPermission {
38
- id: number;
39
- url: string;
40
- codename: string;
37
+ declare class Permission {
41
38
  static typename: string;
42
39
  static plural: string;
43
- constructor(params?: Partial<IPermission>);
44
40
  }
45
- interface IPortalMember extends Identifiable {
41
+ interface IForm<C, D, U = D> {
42
+ form: FormGroup;
43
+ setValue(item: D): void;
44
+ createItem(): C;
45
+ updateItem(item: D): U;
46
+ }
47
+
48
+ interface IPortalMemberBase {
46
49
  username: string;
47
50
  email: string;
48
51
  first_name: string;
49
52
  last_name: string;
50
53
  phone: string;
54
+ }
55
+ type IPortalMemberCreate = IPortalMemberBase;
56
+ interface IPortalMemberList extends IPortalMemberBase, Identifiable {
51
57
  organization: string;
52
58
  profile_url: string;
53
- all_permissions: string[];
59
+ permissions: string[];
54
60
  }
55
- declare class PortalMember implements IPortalMember {
61
+ type IPortalMemberDetail = IPortalMemberList;
62
+ declare class PortalMember {
56
63
  static typename: string;
57
64
  static plural: string;
58
- id: number;
59
- url: string;
60
- username: string;
61
- email: string;
62
- first_name: string;
63
- last_name: string;
64
- phone: string;
65
- organization: string;
66
- profile_url: string;
67
- all_permissions: never[];
68
- constructor(params?: Partial<IPortalMember>);
69
- static getInitials(member: IPortalMember): string;
65
+ static getInitials(member: IPortalMemberDetail): string;
70
66
  }
71
- interface IGroup extends Identifiable {
67
+
68
+ interface IGroupBase {
72
69
  name: string;
73
70
  }
74
- declare class Group implements IGroup {
71
+ type IGroupCreate = IGroupBase;
72
+ interface IGroupList extends IGroupBase, Identifiable {
73
+ }
74
+ type IGroupDetail = IGroupList;
75
+ declare class Group {
75
76
  static typename: string;
76
77
  static plural: string;
77
- name: string;
78
- url: string;
79
- id: number;
80
- constructor(params?: Partial<IGroup>);
81
78
  }
82
79
 
83
80
  interface ICountry {
@@ -85,7 +82,7 @@ interface ICountry {
85
82
  code: string;
86
83
  flag: string;
87
84
  }
88
- interface IAddress extends Identifiable {
85
+ interface IAddressBase {
89
86
  line1: string;
90
87
  line2: string | null;
91
88
  line3: string | null;
@@ -93,45 +90,37 @@ interface IAddress extends Identifiable {
93
90
  region: string;
94
91
  postcode: string | null;
95
92
  country: string;
93
+ }
94
+ type IAddressCreate = IAddressBase;
95
+ interface IAddressList extends IAddressBase, Identifiable {
96
96
  country_name: string;
97
97
  country_flag: string;
98
98
  }
99
- declare class Address implements IAddress {
99
+ type IAddressDetail = IAddressList;
100
+ declare class Address {
100
101
  static typename: string;
101
102
  static plural: string;
102
- id: number;
103
- url: string;
104
- line1: string;
105
- line2: null;
106
- line3: null;
107
- city: null;
108
- region: string;
109
- postcode: null;
110
- country: string;
111
- country_name: string;
112
- country_flag: string;
113
- constructor(params?: Partial<IAddress>);
114
103
  }
115
- interface IOrganization extends Identifiable {
104
+
105
+ interface IOrganizationBase {
116
106
  name: string;
117
107
  acronym: string;
118
108
  description: string;
119
- address: string;
120
109
  website: string;
121
110
  members: string[];
122
111
  }
123
- declare class Organization implements IOrganization {
112
+ interface IOrganizationCreate extends IOrganizationBase {
113
+ address: IAddressCreate;
114
+ }
115
+ interface IOrganizationList extends IOrganizationBase, Identifiable {
116
+ address: string;
117
+ }
118
+ interface IOrganizationDetail extends IOrganizationBase, Identifiable {
119
+ address: IAddressDetail;
120
+ }
121
+ declare class Organization {
124
122
  static typename: string;
125
123
  static plural: string;
126
- id: number;
127
- url: string;
128
- name: string;
129
- acronym: string;
130
- description: string;
131
- address: string;
132
- website: string;
133
- members: string[];
134
- constructor(params?: Partial<IOrganization>);
135
124
  }
136
125
 
137
126
  interface IItemQuery {
@@ -180,6 +169,56 @@ interface IRestOptions {
180
169
  actions?: Record<string, Record<string, OptionAction>>;
181
170
  }
182
171
 
172
+ interface TypeChoice {
173
+ value: string;
174
+ display_name: string;
175
+ }
176
+ declare const FORM_FIELD_CHOICES: TypeChoice[];
177
+ interface IFormFieldBase {
178
+ label: string;
179
+ required: boolean;
180
+ order: number;
181
+ field_type: string;
182
+ description: string;
183
+ default: string;
184
+ template: null;
185
+ options: {
186
+ key: string;
187
+ value: string;
188
+ }[] | null;
189
+ }
190
+ type IFormFieldCreate = IFormFieldBase;
191
+ interface IFormFieldDetail extends IFormFieldBase {
192
+ id: number;
193
+ }
194
+ interface IFormGroupBase {
195
+ label: string | null;
196
+ description: string | null;
197
+ order: number;
198
+ }
199
+ interface IFormGroupCreate extends IFormGroupBase {
200
+ fields: IFormFieldCreate[];
201
+ }
202
+ interface IFormGroupDetail extends IFormGroupBase {
203
+ id: number;
204
+ fields: IFormFieldDetail[];
205
+ }
206
+ interface IFormGroupUpdate extends IFormGroupBase {
207
+ id: number;
208
+ fields: IFormFieldBase[];
209
+ }
210
+ interface IFormCreate {
211
+ groups: IFormGroupCreate[];
212
+ }
213
+ interface IFormDetail {
214
+ id: number;
215
+ groups: IFormGroupDetail[];
216
+ }
217
+ interface IFormUpdate {
218
+ id: number;
219
+ groups: IFormGroupBase[];
220
+ }
221
+
183
222
  interface LeftNavOption {
184
223
  name: string;
185
224
  route: string;
@@ -190,29 +229,29 @@ interface LeftNavCategory {
190
229
  }
191
230
 
192
231
  declare const ENDPOINT_URL: InjectionToken<string>;
193
- declare class RestService<T extends Identifiable> {
232
+ declare class RestService<D extends Identifiable, L extends Identifiable = D, C = D, U extends Identifiable = D> {
194
233
  readonly _url: string;
195
234
  protected _endpoint_url: string;
196
235
  protected _http: HttpClient;
197
236
  deleteItem(id: number): Observable<void>;
198
- getForUser(user: IPortalMember, query?: IItemQuery): Observable<IPaginated<T>>;
199
- get(query?: IItemQuery): Observable<IPaginated<T>>;
200
- getItem(id: number): Observable<T>;
201
- getUrl(url: string): Observable<T>;
202
- getPaginatedUrl(url: string): Observable<IPaginated<T>>;
237
+ getForUser(user: IPortalMemberDetail, query?: IItemQuery): Observable<IPaginated<L>>;
238
+ get(query?: IItemQuery): Observable<IPaginated<L>>;
239
+ getItem(id: number): Observable<D>;
240
+ getUrl(url: string): Observable<D>;
241
+ getPaginatedUrl(url: string): Observable<IPaginated<L>>;
203
242
  getOptions(): Observable<IRestOptions>;
204
- putItem(item: T, content_type?: string): Observable<T>;
205
- patchItemMedia(id: number, form: FormData): Observable<T>;
206
- postFile(id: number, field: string, file: File): Observable<T>;
207
- patchItem(item: T, include_keys: string[], exclude_keys: string[]): Observable<T>;
208
- postItem(item: T): Observable<T>;
243
+ putItem(item: U, content_type?: string): Observable<D>;
244
+ patchItemMedia(id: number, form: FormData): Observable<D>;
245
+ postFile(id: number, field: string, file: File): Observable<D>;
246
+ patchItem(item: U, include_keys: string[], exclude_keys: string[]): Observable<D>;
247
+ postItem(item: C): Observable<D>;
209
248
  private getHeaders;
210
249
  private getBaseUrl;
211
250
  private getMediaUrl;
212
251
  handleError(error: HttpErrorResponse): Observable<never>;
213
252
  }
214
253
 
215
- declare class ItemService<T extends Identifiable> extends RestService<T> {
254
+ declare class ItemService<D extends Identifiable, L extends Identifiable = D, C = D, U extends Identifiable = D> extends RestService<D, L, C, U> {
216
255
  typenamePlural: string;
217
256
  typename: string;
218
257
  canEdit(): boolean;
@@ -220,8 +259,6 @@ declare class ItemService<T extends Identifiable> extends RestService<T> {
220
259
  canDelete(): boolean;
221
260
  canView(): boolean;
222
261
  typePlural(): string;
223
- instantiateType(_: T): T;
224
- getItem(id: number): Observable<T>;
225
262
  }
226
263
 
227
264
  declare class ResolvedPermission {
@@ -230,15 +267,14 @@ declare class ResolvedPermission {
230
267
  canView: boolean;
231
268
  canDelete: boolean;
232
269
  }
233
- declare class UserService extends ItemService<IPortalMember> {
270
+ declare class UserService extends ItemService<IPortalMemberDetail, IPortalMemberList, IPortalMemberCreate> {
234
271
  /**
235
272
  Service to handle IPortalMember via REST and also handle logins.
236
273
  */
237
- loggedInUser: BehaviorSubject<IPortalMember | null>;
274
+ loggedInUser: BehaviorSubject<IPortalMemberList | null>;
238
275
  readonly _url: string;
239
276
  typename: string;
240
277
  private permissions;
241
- instantiateType(item: IPortalMember): IPortalMember;
242
278
  login(username: string, password: string): Observable<void>;
243
279
  hasAddPermission(feature: string): boolean;
244
280
  hasDeletePermission(feature: string): boolean;
@@ -253,45 +289,48 @@ declare class UserService extends ItemService<IPortalMember> {
253
289
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<UserService>;
254
290
  }
255
291
 
256
- declare class ItemWithUserService<T extends Identifiable> extends ItemService<T> {
292
+ declare class ItemWithUserService<D extends Identifiable, L extends Identifiable = D, C = D> extends ItemService<D, L, C> {
257
293
  protected userService: UserService;
258
- userItems: BehaviorSubject<T[]>;
294
+ userItems: BehaviorSubject<L[]>;
259
295
  canCreate(): boolean;
260
296
  canView(): boolean;
261
297
  canEdit(): boolean;
262
298
  canDelete(): boolean;
263
299
  private permissionName;
264
- getUserItems(): Observable<IPaginated<T>>;
265
- protected refreshUserItems(user: IPortalMember | null): void;
266
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ItemWithUserService<any>, never>;
267
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<ItemWithUserService<any>>;
300
+ getUserItems(): Observable<IPaginated<L>>;
301
+ protected refreshUserItems(user: IPortalMemberDetail | null): void;
302
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ItemWithUserService<any, any, any>, never>;
303
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<ItemWithUserService<any, any, any>>;
268
304
  }
269
305
 
270
- declare class AddressService extends ItemWithUserService<IAddress> {
306
+ declare class AddressService extends ItemWithUserService<IAddressDetail, IAddressList, IAddressCreate> {
271
307
  readonly _url: string;
272
308
  typename: string;
273
- instantiateType(item: IAddress): IAddress;
274
309
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AddressService, never>;
275
310
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<AddressService>;
276
311
  }
277
312
 
278
- declare class GroupService extends ItemWithUserService<IGroup> {
313
+ declare class GroupService extends ItemWithUserService<IGroupDetail, IGroupList, IGroupCreate> {
279
314
  readonly _url: string;
280
315
  typename: string;
281
316
  constructor();
282
- instantiateType(item: IGroup): IGroup;
283
317
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<GroupService, never>;
284
318
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<GroupService>;
285
319
  }
286
320
 
287
- declare class OrganizationService extends ItemWithUserService<IOrganization> {
321
+ declare class OrganizationService extends ItemWithUserService<IOrganizationDetail, IOrganizationList, IOrganizationCreate> {
288
322
  readonly _url: string;
289
323
  typename: string;
290
- instantiateType(item: IOrganization): IOrganization;
291
324
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<OrganizationService, never>;
292
325
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<OrganizationService>;
293
326
  }
294
327
 
328
+ declare class FormService {
329
+ toFormGroup(form: IFormDetail): FormGroup<any>;
330
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormService, never>;
331
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<FormService>;
332
+ }
333
+
295
334
  interface NavOption {
296
335
  name: string;
297
336
  route: string;
@@ -306,7 +345,7 @@ declare class LeftNavService {
306
345
  private _defaultOptions;
307
346
  private _groupService;
308
347
  constructor();
309
- onGroupsUpdated(groups: IGroup[]): void;
348
+ onGroupsUpdated(groups: IGroupList[]): void;
310
349
  addNavGroup(group: NavGroup): void;
311
350
  setDefaultOptions(options: NavOption[]): void;
312
351
  setGroups(groups: NavGroup[]): void;
@@ -323,7 +362,7 @@ declare class MockItemService {
323
362
 
324
363
  declare class TopBarComponent implements OnInit {
325
364
  readonly title: _angular_core.InputSignal<string | undefined>;
326
- protected user: _angular_core.WritableSignal<IPortalMember | null>;
365
+ protected user: _angular_core.WritableSignal<ichec_angular_core.IPortalMemberList | null>;
327
366
  private userService;
328
367
  private leftNavService;
329
368
  ngOnInit(): void;
@@ -372,34 +411,35 @@ declare class AvatarComponent {
372
411
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AvatarComponent, "lib-avatar", never, { "text": { "alias": "text"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
373
412
  }
374
413
 
375
- declare abstract class DetailView<T extends Identifiable> {
376
- protected item: WritableSignal<T | null>;
414
+ declare abstract class DetailView<D extends Identifiable, L extends Identifiable, C = D> {
415
+ protected item: _angular_core.WritableSignal<D | null>;
377
416
  protected route: ActivatedRoute;
378
417
  protected userService: UserService;
379
- protected itemService: ItemService<T>;
380
- constructor(itemService: ItemService<T>);
418
+ protected itemService: ItemService<D, L, C>;
419
+ constructor(itemService: ItemService<D, L, C>);
381
420
  onInit(): void;
382
421
  title(): string;
383
- onItemAvailable(item: T): void;
384
- onItemAndUserAvailable(_item: T, _user: IPortalMember): void;
422
+ onItemAvailable(item: D): void;
423
+ onItemAndUserAvailable(_item: D, _user: IPortalMemberDetail): void;
385
424
  private getItem;
386
425
  onDelete(): void;
387
426
  protected canEdit(): boolean;
388
427
  protected canDelete(): boolean;
389
428
  }
390
429
 
391
- declare abstract class EditView<T extends Identifiable> {
392
- createMode: WritableSignal<boolean>;
430
+ declare abstract class EditView<D extends Identifiable, L extends Identifiable, C = D, U extends Identifiable = D> {
431
+ createMode: _angular_core.WritableSignal<boolean>;
393
432
  heading: _angular_core.Signal<string>;
394
- protected item: WritableSignal<T | null>;
433
+ protected item: _angular_core.WritableSignal<D | null>;
395
434
  protected _route: ActivatedRoute;
396
435
  protected _location: Location;
397
436
  protected _userService: UserService;
398
- protected itemService: ItemService<T>;
399
- constructor(itemService: ItemService<T>);
437
+ protected form: IForm<C, D, U>;
438
+ protected itemService: ItemService<D, L, C, U>;
439
+ constructor(itemService: ItemService<D, L, C, U>, form: IForm<C, D, U>);
400
440
  onInit(): void;
401
- onItemAvailable(): void;
402
- onItemAndUserAvailable(_: IPortalMember): void;
441
+ onItemAvailable(item: D): void;
442
+ onItemAndUserAvailable(_item: D, _user: IPortalMemberDetail): void;
403
443
  goBack(): void;
404
444
  submit(): void;
405
445
  save(): void;
@@ -408,18 +448,127 @@ declare abstract class EditView<T extends Identifiable> {
408
448
  protected fetchRestOptions(): void;
409
449
  protected onUploadedFileReady(_file: File): void;
410
450
  protected onFileRead(_content: string | ArrayBuffer): void;
411
- protected createItem(): void;
412
- protected updateItem(): void;
413
- protected saveFiles(item: T): void;
414
- protected abstract getTemplateItem(): T;
451
+ protected createItem(): C;
452
+ protected updateItem(item: D): U;
453
+ protected postItem(): void;
454
+ protected putItem(item: D): void;
455
+ protected saveFiles(item: D): void;
415
456
  private isCreateRoute;
416
457
  private getItem;
417
- protected onItemUpdated(item: T): void;
458
+ protected onItemUpdated(item: D): void;
418
459
  protected onOptions(options: IRestOptions): void;
419
460
  protected onPostActions(_actions: Record<string, OptionAction>): void;
420
461
  }
421
462
 
422
- declare class ListDataSource<T extends Identifiable> extends DataSource<T> {
463
+ declare class FormFieldDetailComponent {
464
+ readonly field: _angular_core.InputSignal<IFormFieldDetail>;
465
+ readonly form: _angular_core.InputSignal<FormGroup<any>>;
466
+ get isValid(): boolean;
467
+ get key(): string;
468
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormFieldDetailComponent, never>;
469
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldDetailComponent, "lib-form-field-detail", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "form": { "alias": "form"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
470
+ }
471
+
472
+ declare class FormFieldListComponent {
473
+ form: _angular_core.InputSignal<FormArray<any>>;
474
+ edit: _angular_core.OutputEmitterRef<number>;
475
+ columns: ichec_angular_core.TableColumn[];
476
+ columnNames: _angular_core.Signal<string[]>;
477
+ onEdit(id: number): void;
478
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormFieldListComponent, never>;
479
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldListComponent, "lib-form-field-list", never, { "form": { "alias": "form"; "required": true; "isSignal": true; }; }, { "edit": "edit"; }, never, never, true, never>;
480
+ }
481
+
482
+ declare class FormFieldEditComponent {
483
+ availableTypes: ichec_angular_core.TypeChoice[];
484
+ form: _angular_core.InputSignal<FormGroup<any>>;
485
+ editMode: _angular_core.InputSignal<boolean>;
486
+ submitted: _angular_core.OutputEmitterRef<void>;
487
+ cancelled: _angular_core.OutputEmitterRef<void>;
488
+ get isBoolean(): boolean;
489
+ get isShortText(): boolean;
490
+ get isLongText(): boolean;
491
+ get isRichText(): boolean;
492
+ get isSelection(): boolean;
493
+ get isInteger(): boolean;
494
+ get isFile(): boolean;
495
+ get fieldType(): string;
496
+ submit(): void;
497
+ cancel(): void;
498
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FormFieldEditComponent, never>;
499
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldEditComponent, "lib-form-field-edit", never, { "form": { "alias": "form"; "required": true; "isSignal": true; }; "editMode": { "alias": "editMode"; "required": false; "isSignal": true; }; }, { "submitted": "submitted"; "cancelled": "cancelled"; }, never, never, true, never>;
500
+ }
501
+
502
+ declare class DynamicFormComponent {
503
+ private readonly formService;
504
+ readonly inputForm: _angular_core.InputSignal<IFormDetail>;
505
+ readonly form: _angular_core.Signal<FormGroup<any>>;
506
+ payLoad: string;
507
+ onSubmit(): void;
508
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DynamicFormComponent, never>;
509
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DynamicFormComponent, "lib-dynamic-form", never, { "inputForm": { "alias": "inputForm"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
510
+ }
511
+
512
+ interface IFormFieldForm {
513
+ label: FormControl<string | null>;
514
+ required: FormControl<boolean | null>;
515
+ description: FormControl<string | null>;
516
+ template: FormControl<null>;
517
+ options: FormControl<string | null>;
518
+ default: FormControl<string | null>;
519
+ field_type: FormControl<string | null>;
520
+ order: FormControl<number | null>;
521
+ id: FormControl<number | null>;
522
+ }
523
+
524
+ interface IFormGroupForm {
525
+ label: FormControl<string | null>;
526
+ description: FormControl<string | null>;
527
+ order: FormControl<number | null>;
528
+ id: FormControl<number | null>;
529
+ fields: FormArray<FormGroup<IFormFieldForm>>;
530
+ }
531
+
532
+ interface IDynamicFormForm {
533
+ groups: FormArray<FormGroup<IFormGroupForm>>;
534
+ }
535
+ declare class DynamicFormForm {
536
+ fb: FormBuilder;
537
+ form: FormGroup;
538
+ constructor();
539
+ get groups(): FormArray<FormGroup<IFormGroupForm>>;
540
+ createGroup(group: FormGroup<IFormGroupForm>): void;
541
+ deleteGroup(id: number): void;
542
+ reset(): void;
543
+ setValue(item: IFormCreate | IFormDetail): void;
544
+ createItem(): IFormCreate;
545
+ createOrUpdateGroup(form: FormGroup<IFormGroupForm>, items: IFormGroupBase[]): IFormGroupCreate | IFormGroupUpdate;
546
+ updateItem(item: IFormDetail): IFormCreate | IFormUpdate;
547
+ }
548
+
549
+ declare class DynamicFormBuilderComponent {
550
+ form: _angular_core.InputSignal<DynamicFormForm>;
551
+ handleSubmit: _angular_core.InputSignal<boolean>;
552
+ submitted: _angular_core.OutputEmitterRef<void>;
553
+ editingField: _angular_core.WritableSignal<number>;
554
+ creatingField: _angular_core.WritableSignal<boolean>;
555
+ editingGroup: _angular_core.WritableSignal<number>;
556
+ creatingGroup: _angular_core.WritableSignal<boolean>;
557
+ dirty: _angular_core.WritableSignal<boolean>;
558
+ formBuilder: FormBuilder;
559
+ groupForm: FormGroup | null;
560
+ addGroup(): void;
561
+ editGroup(id: number): void;
562
+ deleteGroup(id: number): void;
563
+ submitGroup(): void;
564
+ cancel(): void;
565
+ reset(): void;
566
+ onSubmit(): void;
567
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DynamicFormBuilderComponent, never>;
568
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DynamicFormBuilderComponent, "lib-dynamic-form-builder", never, { "form": { "alias": "form"; "required": true; "isSignal": true; }; "handleSubmit": { "alias": "handleSubmit"; "required": false; "isSignal": true; }; }, { "submitted": "submitted"; }, never, never, true, never>;
569
+ }
570
+
571
+ declare class ListDataSource<D extends Identifiable, L extends Identifiable, C = D> extends DataSource<L> {
423
572
  length: _angular_core.WritableSignal<number>;
424
573
  loading: _angular_core.WritableSignal<boolean>;
425
574
  searchTerm: _angular_core.WritableSignal<string>;
@@ -428,17 +577,17 @@ declare class ListDataSource<T extends Identifiable> extends DataSource<T> {
428
577
  sourceIsEmpty: _angular_core.Signal<boolean>;
429
578
  private consumerType;
430
579
  private items;
431
- itemService: ItemService<T>;
580
+ itemService: ItemService<D, L, C>;
432
581
  private subscription;
433
582
  private fetchedPages;
434
- constructor(itemService: ItemService<T>, consumerType?: string);
435
- connect(collectionViewer: CollectionViewer): Observable<T[]>;
583
+ constructor(itemService: ItemService<D, L, C>, consumerType?: string);
584
+ connect(collectionViewer: CollectionViewer): Observable<L[]>;
436
585
  hasTableConsumer(): boolean;
437
586
  onRange(range: ListRange): void;
438
587
  reset(searchTerm?: string, pageSize?: number): void;
439
588
  fetchPage(idx: number): void;
440
589
  fetch(query: IItemQuery): void;
441
- onResponse(response: IPaginated<T>): void;
590
+ onResponse(response: IPaginated<L>): void;
442
591
  disconnect(): void;
443
592
  }
444
593
 
@@ -450,7 +599,7 @@ interface TableColumn {
450
599
  declare class ListTableViewComponent implements AfterViewInit {
451
600
  itemType: _angular_core.InputSignal<string>;
452
601
  columns: _angular_core.InputSignal<TableColumn[]>;
453
- dataSource: _angular_core.InputSignal<ListDataSource<any> | undefined>;
602
+ dataSource: _angular_core.InputSignal<ListDataSource<any, any, any> | undefined>;
454
603
  searchFilter: _angular_core.InputSignal<string>;
455
604
  pageSizeOptions: number[];
456
605
  initialPageSize: number;
@@ -486,9 +635,21 @@ declare class SelectTableComponent<T extends Identifiable> implements OnInit {
486
635
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SelectTableComponent<any>, "lib-select-table", never, { "itemType": { "alias": "itemType"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; }, { "itemAdded": "itemAdded"; "itemRemoved": "itemRemoved"; "searchChanged": "searchChanged"; }, never, never, true, never>;
487
636
  }
488
637
 
489
- declare class ListViewComponent<T extends Identifiable> implements OnInit, AfterViewInit {
638
+ declare class SelectionManager {
639
+ candidates: _angular_core.WritableSignal<Selectable<ichec_angular_core.IPortalMemberList>[]>;
640
+ selected: _angular_core.WritableSignal<ichec_angular_core.IPortalMemberList[]>;
641
+ columns: ichec_angular_core.TableColumn[];
642
+ userService: UserService;
643
+ fetchCandidates(item: string, id: number): void;
644
+ protected updateCandidates(users: IPaginated<IPortalMemberDetail>): void;
645
+ onRemoved(id: number): string;
646
+ onAdded(title: string): string;
647
+ onSearchChanged(searchTerm: string | null): void;
648
+ }
649
+
650
+ declare class ListViewComponent<D extends Identifiable, L extends Identifiable, C = D> implements OnInit, AfterViewInit {
490
651
  viewType: _angular_core.InputSignal<string>;
491
- itemService: _angular_core.InputSignal<ItemService<T> | undefined>;
652
+ itemService: _angular_core.InputSignal<ItemService<D, L, C, D> | undefined>;
492
653
  itemDetailTemplate: _angular_core.InputSignal<TemplateRef<unknown> | null>;
493
654
  columns: _angular_core.InputSignal<TableColumn[]>;
494
655
  sortFields: _angular_core.InputSignal<string[]>;
@@ -499,7 +660,7 @@ declare class ListViewComponent<T extends Identifiable> implements OnInit, After
499
660
  pageSize: number;
500
661
  pageSizeOptions: number[];
501
662
  protected route: ActivatedRoute;
502
- dataSource: ListDataSource<T> | undefined;
663
+ dataSource: ListDataSource<D, L, C> | undefined;
503
664
  sort: _angular_core.Signal<MatSort | undefined>;
504
665
  columnNames: _angular_core.Signal<string[]>;
505
666
  searchTerm: string;
@@ -514,8 +675,8 @@ declare class ListViewComponent<T extends Identifiable> implements OnInit, After
514
675
  reset(): void;
515
676
  viewChanged(event: MatButtonToggleChange): void;
516
677
  protected isSelfList(): boolean;
517
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListViewComponent<any>, never>;
518
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ListViewComponent<any>, "lib-list-view", never, { "viewType": { "alias": "viewType"; "required": false; "isSignal": true; }; "itemService": { "alias": "itemService"; "required": false; "isSignal": true; }; "itemDetailTemplate": { "alias": "itemDetailTemplate"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "sortFields": { "alias": "sortFields"; "required": false; "isSignal": true; }; "noSelfItemsMessage": { "alias": "noSelfItemsMessage"; "required": false; "isSignal": true; }; "noItemsCanCreateMessage": { "alias": "noItemsCanCreateMessage"; "required": false; "isSignal": true; }; "noItemsMessage": { "alias": "noItemsMessage"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
678
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListViewComponent<any, any, any>, never>;
679
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ListViewComponent<any, any, any>, "lib-list-view", never, { "viewType": { "alias": "viewType"; "required": false; "isSignal": true; }; "itemService": { "alias": "itemService"; "required": false; "isSignal": true; }; "itemDetailTemplate": { "alias": "itemDetailTemplate"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "sortFields": { "alias": "sortFields"; "required": false; "isSignal": true; }; "noSelfItemsMessage": { "alias": "noSelfItemsMessage"; "required": false; "isSignal": true; }; "noItemsCanCreateMessage": { "alias": "noItemsCanCreateMessage"; "required": false; "isSignal": true; }; "noItemsMessage": { "alias": "noItemsMessage"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
519
680
  }
520
681
 
521
682
  declare class BackButtonComponent {
@@ -590,32 +751,23 @@ declare class FileUploadComponent {
590
751
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<FileUploadComponent, "lib-file-upload", never, { "files": { "alias": "files"; "required": false; "isSignal": true; }; }, { "previewLoaded": "previewLoaded"; "fileUploaded": "fileUploaded"; "clearLocal": "clearLocal"; }, never, never, true, never>;
591
752
  }
592
753
 
593
- declare class UserDetailComponent extends DetailView<IPortalMember> implements OnInit {
754
+ declare class UserDetailComponent extends DetailView<IPortalMemberDetail, IPortalMemberList, IPortalMemberCreate> implements OnInit {
594
755
  constructor();
595
756
  ngOnInit(): void;
757
+ protected canEdit(): boolean;
596
758
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserDetailComponent, never>;
597
759
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserDetailComponent, "lib-user-detail", never, {}, {}, never, never, true, never>;
598
760
  }
599
761
 
600
- declare class UserEditComponent extends EditView<IPortalMember> implements OnInit {
762
+ declare class UserEditComponent extends EditView<IPortalMemberDetail, IPortalMemberList, IPortalMemberCreate> implements OnInit {
601
763
  files: _angular_core.WritableSignal<FileRecord[]>;
602
- private formBuilder;
603
- form: _angular_forms.FormGroup<{
604
- username: _angular_forms.FormControl<string | null>;
605
- email: _angular_forms.FormControl<string | null>;
606
- first_name: _angular_forms.FormControl<string | null>;
607
- last_name: _angular_forms.FormControl<string | null>;
608
- phone: _angular_forms.FormControl<string | null>;
609
- }>;
610
764
  constructor();
611
765
  ngOnInit(): void;
612
- onItemAvailable(): void;
766
+ onItemAvailable(item: IPortalMemberDetail): void;
613
767
  submit(): void;
614
- updateFromForm(item: IPortalMember): IPortalMember;
615
- protected getTemplateItem(): IPortalMember;
616
768
  onPreviewLoaded(preview: IPreview): void;
617
769
  onFileUploaded(upload: IFileUpload): void;
618
- protected saveFiles(item: IPortalMember): void;
770
+ protected saveFiles(item: IPortalMemberDetail): void;
619
771
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserEditComponent, never>;
620
772
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserEditComponent, "lib-user-edit", never, {}, {}, never, never, true, never>;
621
773
  }
@@ -628,7 +780,7 @@ declare class UserComponent {
628
780
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserComponent, "lib-user", never, {}, {}, never, never, true, never>;
629
781
  }
630
782
 
631
- declare class GroupDetailComponent extends DetailView<IGroup> implements OnInit {
783
+ declare class GroupDetailComponent extends DetailView<IGroupDetail, IGroupList, IGroupCreate> implements OnInit {
632
784
  constructor();
633
785
  ngOnInit(): void;
634
786
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<GroupDetailComponent, never>;
@@ -650,12 +802,12 @@ declare class AddressEditComponent {
650
802
  }
651
803
 
652
804
  declare class AddressDetailComponent {
653
- address: _angular_core.InputSignal<IAddress | undefined>;
805
+ address: _angular_core.InputSignal<ichec_angular_core.IAddressList | undefined>;
654
806
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AddressDetailComponent, never>;
655
807
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AddressDetailComponent, "lib-address-detail", never, { "address": { "alias": "address"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
656
808
  }
657
809
 
658
- declare class AddressForm {
810
+ declare class AddressForm implements IForm<IAddressCreate, IAddressDetail> {
659
811
  private formBuilder;
660
812
  form: _angular_forms.FormGroup<{
661
813
  line1: _angular_forms.FormControl<string | null>;
@@ -666,8 +818,9 @@ declare class AddressForm {
666
818
  postcode: _angular_forms.FormControl<string | null>;
667
819
  country: _angular_forms.FormControl<string | null>;
668
820
  }>;
669
- setValue(item: IAddress): void;
670
- updateItem(item: IAddress): IAddress;
821
+ setValue(item: IAddressDetail): void;
822
+ createItem(): IAddressCreate;
823
+ updateItem(item: IAddressDetail): IAddressDetail;
671
824
  }
672
825
 
673
826
  declare class OrganizationComponent {
@@ -677,63 +830,28 @@ declare class OrganizationComponent {
677
830
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<OrganizationComponent, "lib-organization", never, {}, {}, never, never, true, never>;
678
831
  }
679
832
 
680
- declare class OrganizationDetailComponent extends DetailView<IOrganization> implements OnInit {
681
- address: _angular_core.WritableSignal<IAddress | null>;
682
- private addressService;
833
+ declare class OrganizationDetailComponent extends DetailView<IOrganizationDetail, IOrganizationList, IOrganizationCreate> implements OnInit {
683
834
  constructor();
684
835
  ngOnInit(): void;
685
- onItemAndUserAvailable(item: IOrganization, _user: IPortalMember): void;
686
836
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<OrganizationDetailComponent, never>;
687
837
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<OrganizationDetailComponent, "lib-organization-detail", never, {}, {}, never, never, true, never>;
688
838
  }
689
839
 
690
- declare class SelectionManager {
691
- candidates: _angular_core.WritableSignal<Selectable<IPortalMember>[]>;
692
- selected: _angular_core.WritableSignal<IPortalMember[]>;
693
- columns: ichec_angular_core.TableColumn[];
694
- userService: UserService;
695
- fetchCandidates(item: string, id: number): void;
696
- protected updateCandidates(users: IPaginated<IPortalMember>): void;
697
- onRemoved(id: number): string;
698
- onAdded(title: string): string;
699
- onSearchChanged(searchTerm: string | null): void;
700
- }
701
-
702
- declare class OrganizationForm {
703
- private formBuilder;
704
- form: FormGroup;
705
- address: AddressForm;
706
- constructor();
707
- updateFromItem(item: IOrganization): void;
708
- updateItem(item: IOrganization): IOrganization;
709
- }
710
-
711
- declare class OrganizationEditComponent extends EditView<IOrganization> implements OnInit {
840
+ declare class OrganizationEditComponent extends EditView<IOrganizationDetail, IOrganizationList, IOrganizationCreate> implements OnInit {
712
841
  countryOptions: _angular_core.WritableSignal<ICountry[]>;
713
- selectionManager: SelectionManager;
714
- form: OrganizationForm;
715
- address: IAddress;
716
842
  addressService: AddressService;
843
+ selectionManager: SelectionManager;
717
844
  constructor();
718
845
  ngOnInit(): void;
719
- onItemAndUserAvailable(_: IPortalMember): void;
720
- submit(): void;
721
- protected fetchAddress(url: string): void;
722
- protected updateAddress(): void;
723
- protected createAddress(): Observable<IAddress>;
724
- protected onAddressUpdated(address: IAddress): void;
725
- protected onAddressCreated(address: IAddress): void;
726
- protected syncFromForm(): void;
727
- protected getTemplateItem(): IOrganization;
846
+ addressForm(): FormGroup;
847
+ createItem(): IOrganizationCreate;
848
+ protected updateItem(item: IOrganizationDetail): IOrganizationDetail;
849
+ onItemAndUserAvailable(item: IOrganizationDetail, _: IPortalMemberDetail): void;
728
850
  protected onPostActions(actions: Record<string, OptionAction>): void;
729
851
  protected onCountryChoices(choices: OptionActionChoice[]): void;
730
- addMember(url: string): void;
731
- removeMember(url: string): void;
732
- onMemberRemoved(id: number): void;
733
- onMemberAdded(title: string): void;
734
852
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<OrganizationEditComponent, never>;
735
853
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<OrganizationEditComponent, "lib-organization-edit", never, {}, {}, never, never, true, never>;
736
854
  }
737
855
 
738
- export { Address, AddressDetailComponent, AddressEditComponent, AddressForm, AddressService, ApiError, AvatarComponent, BackButtonComponent, DetailHeaderComponent, DetailView, ENDPOINT_URL, EditView, ErrorCode, FeedbackComponent, FileRecord, FileUploadComponent, Group, GroupComponent, GroupDetailComponent, GroupService, ItemQuery, ItemService, ItemWithUserService, LOGIN_USER, LandingComponent, LeftNavComponent, LeftNavService, ListTableViewComponent, ListViewComponent, MockItemService, Organization, OrganizationComponent, OrganizationDetailComponent, OrganizationEditComponent, OrganizationService, Paginated, Permission, PortalMember, ResolvedPermission, RestService, SearchBarComponent, SelectTableComponent, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserService };
739
- export type { IAddress, ICountry, IFileRecord, IFileUpload, IGroup, IItemQuery, IOrganization, IPaginated, IPermission, IPortalMember, IPreview, IRestOptions, Identifiable, LeftNavCategory, LeftNavOption, NavGroup, NavOption, OptionAction, OptionActionChoice, Selectable, TableColumn };
856
+ export { Address, AddressDetailComponent, AddressEditComponent, AddressForm, AddressService, ApiError, AvatarComponent, BackButtonComponent, DetailHeaderComponent, DetailView, DynamicFormBuilderComponent, DynamicFormComponent, DynamicFormForm, ENDPOINT_URL, EditView, ErrorCode, FORM_FIELD_CHOICES, FeedbackComponent, FileRecord, FileUploadComponent, FormFieldDetailComponent, FormFieldEditComponent, FormFieldListComponent, FormService, Group, GroupComponent, GroupDetailComponent, GroupService, ItemQuery, ItemService, ItemWithUserService, LOGIN_USER, LandingComponent, LeftNavComponent, LeftNavService, ListTableViewComponent, ListViewComponent, MockItemService, Organization, OrganizationComponent, OrganizationDetailComponent, OrganizationEditComponent, OrganizationService, Paginated, Permission, PortalMember, ResolvedPermission, RestService, SearchBarComponent, SelectTableComponent, SelectionManager, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserService };
857
+ export type { IAddressBase, IAddressCreate, IAddressDetail, IAddressList, ICountry, IDynamicFormForm, IFileRecord, IFileUpload, IForm, IFormCreate, IFormDetail, IFormFieldBase, IFormFieldCreate, IFormFieldDetail, IFormGroupBase, IFormGroupCreate, IFormGroupDetail, IFormGroupUpdate, IFormUpdate, IGroupBase, IGroupCreate, IGroupDetail, IGroupList, IItemQuery, IOrganizationBase, IOrganizationCreate, IOrganizationDetail, IOrganizationList, IPaginated, IPermission, IPortalMemberBase, IPortalMemberCreate, IPortalMemberDetail, IPortalMemberList, IPreview, IRestOptions, Identifiable, LeftNavCategory, LeftNavOption, NavGroup, NavOption, OptionAction, OptionActionChoice, Selectable, TableColumn, TypeChoice };