ichec-angular-core 0.1.2 → 0.1.3

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, FormControl } 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> {
42
+ form: FormGroup;
43
+ setValue(item: D): void;
44
+ createItem(): C;
45
+ updateItem(item: D): D;
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
59
  all_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 {
@@ -190,29 +179,29 @@ interface LeftNavCategory {
190
179
  }
191
180
 
192
181
  declare const ENDPOINT_URL: InjectionToken<string>;
193
- declare class RestService<T extends Identifiable> {
182
+ declare class RestService<D extends Identifiable, L extends Identifiable = D, C = D> {
194
183
  readonly _url: string;
195
184
  protected _endpoint_url: string;
196
185
  protected _http: HttpClient;
197
186
  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>>;
187
+ getForUser(user: IPortalMemberDetail, query?: IItemQuery): Observable<IPaginated<L>>;
188
+ get(query?: IItemQuery): Observable<IPaginated<L>>;
189
+ getItem(id: number): Observable<D>;
190
+ getUrl(url: string): Observable<D>;
191
+ getPaginatedUrl(url: string): Observable<IPaginated<L>>;
203
192
  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>;
193
+ putItem(item: D, content_type?: string): Observable<D>;
194
+ patchItemMedia(id: number, form: FormData): Observable<D>;
195
+ postFile(id: number, field: string, file: File): Observable<D>;
196
+ patchItem(item: D, include_keys: string[], exclude_keys: string[]): Observable<D>;
197
+ postItem(item: C): Observable<D>;
209
198
  private getHeaders;
210
199
  private getBaseUrl;
211
200
  private getMediaUrl;
212
201
  handleError(error: HttpErrorResponse): Observable<never>;
213
202
  }
214
203
 
215
- declare class ItemService<T extends Identifiable> extends RestService<T> {
204
+ declare class ItemService<D extends Identifiable, L extends Identifiable = D, C = D> extends RestService<D, L, C> {
216
205
  typenamePlural: string;
217
206
  typename: string;
218
207
  canEdit(): boolean;
@@ -220,8 +209,6 @@ declare class ItemService<T extends Identifiable> extends RestService<T> {
220
209
  canDelete(): boolean;
221
210
  canView(): boolean;
222
211
  typePlural(): string;
223
- instantiateType(_: T): T;
224
- getItem(id: number): Observable<T>;
225
212
  }
226
213
 
227
214
  declare class ResolvedPermission {
@@ -230,15 +217,14 @@ declare class ResolvedPermission {
230
217
  canView: boolean;
231
218
  canDelete: boolean;
232
219
  }
233
- declare class UserService extends ItemService<IPortalMember> {
220
+ declare class UserService extends ItemService<IPortalMemberDetail, IPortalMemberList, IPortalMemberCreate> {
234
221
  /**
235
222
  Service to handle IPortalMember via REST and also handle logins.
236
223
  */
237
- loggedInUser: BehaviorSubject<IPortalMember | null>;
224
+ loggedInUser: BehaviorSubject<IPortalMemberList | null>;
238
225
  readonly _url: string;
239
226
  typename: string;
240
227
  private permissions;
241
- instantiateType(item: IPortalMember): IPortalMember;
242
228
  login(username: string, password: string): Observable<void>;
243
229
  hasAddPermission(feature: string): boolean;
244
230
  hasDeletePermission(feature: string): boolean;
@@ -253,41 +239,38 @@ declare class UserService extends ItemService<IPortalMember> {
253
239
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<UserService>;
254
240
  }
255
241
 
256
- declare class ItemWithUserService<T extends Identifiable> extends ItemService<T> {
242
+ declare class ItemWithUserService<D extends Identifiable, L extends Identifiable = D, C = D> extends ItemService<D, L, C> {
257
243
  protected userService: UserService;
258
- userItems: BehaviorSubject<T[]>;
244
+ userItems: BehaviorSubject<L[]>;
259
245
  canCreate(): boolean;
260
246
  canView(): boolean;
261
247
  canEdit(): boolean;
262
248
  canDelete(): boolean;
263
249
  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>>;
250
+ getUserItems(): Observable<IPaginated<L>>;
251
+ protected refreshUserItems(user: IPortalMemberDetail | null): void;
252
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ItemWithUserService<any, any, any>, never>;
253
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<ItemWithUserService<any, any, any>>;
268
254
  }
269
255
 
270
- declare class AddressService extends ItemWithUserService<IAddress> {
256
+ declare class AddressService extends ItemWithUserService<IAddressDetail, IAddressList, IAddressCreate> {
271
257
  readonly _url: string;
272
258
  typename: string;
273
- instantiateType(item: IAddress): IAddress;
274
259
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AddressService, never>;
275
260
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<AddressService>;
276
261
  }
277
262
 
278
- declare class GroupService extends ItemWithUserService<IGroup> {
263
+ declare class GroupService extends ItemWithUserService<IGroupDetail, IGroupList, IGroupCreate> {
279
264
  readonly _url: string;
280
265
  typename: string;
281
266
  constructor();
282
- instantiateType(item: IGroup): IGroup;
283
267
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<GroupService, never>;
284
268
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<GroupService>;
285
269
  }
286
270
 
287
- declare class OrganizationService extends ItemWithUserService<IOrganization> {
271
+ declare class OrganizationService extends ItemWithUserService<IOrganizationDetail, IOrganizationList, IOrganizationCreate> {
288
272
  readonly _url: string;
289
273
  typename: string;
290
- instantiateType(item: IOrganization): IOrganization;
291
274
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<OrganizationService, never>;
292
275
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<OrganizationService>;
293
276
  }
@@ -306,7 +289,7 @@ declare class LeftNavService {
306
289
  private _defaultOptions;
307
290
  private _groupService;
308
291
  constructor();
309
- onGroupsUpdated(groups: IGroup[]): void;
292
+ onGroupsUpdated(groups: IGroupList[]): void;
310
293
  addNavGroup(group: NavGroup): void;
311
294
  setDefaultOptions(options: NavOption[]): void;
312
295
  setGroups(groups: NavGroup[]): void;
@@ -323,7 +306,7 @@ declare class MockItemService {
323
306
 
324
307
  declare class TopBarComponent implements OnInit {
325
308
  readonly title: _angular_core.InputSignal<string | undefined>;
326
- protected user: _angular_core.WritableSignal<IPortalMember | null>;
309
+ protected user: _angular_core.WritableSignal<ichec_angular_core.IPortalMemberList | null>;
327
310
  private userService;
328
311
  private leftNavService;
329
312
  ngOnInit(): void;
@@ -372,34 +355,35 @@ declare class AvatarComponent {
372
355
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AvatarComponent, "lib-avatar", never, { "text": { "alias": "text"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
373
356
  }
374
357
 
375
- declare abstract class DetailView<T extends Identifiable> {
376
- protected item: WritableSignal<T | null>;
358
+ declare abstract class DetailView<D extends Identifiable, L extends Identifiable, C = D> {
359
+ protected item: _angular_core.WritableSignal<D | null>;
377
360
  protected route: ActivatedRoute;
378
361
  protected userService: UserService;
379
- protected itemService: ItemService<T>;
380
- constructor(itemService: ItemService<T>);
362
+ protected itemService: ItemService<D, L, C>;
363
+ constructor(itemService: ItemService<D, L, C>);
381
364
  onInit(): void;
382
365
  title(): string;
383
- onItemAvailable(item: T): void;
384
- onItemAndUserAvailable(_item: T, _user: IPortalMember): void;
366
+ onItemAvailable(item: D): void;
367
+ onItemAndUserAvailable(_item: D, _user: IPortalMemberDetail): void;
385
368
  private getItem;
386
369
  onDelete(): void;
387
370
  protected canEdit(): boolean;
388
371
  protected canDelete(): boolean;
389
372
  }
390
373
 
391
- declare abstract class EditView<T extends Identifiable> {
392
- createMode: WritableSignal<boolean>;
374
+ declare abstract class EditView<D extends Identifiable, L extends Identifiable, C = D> {
375
+ createMode: _angular_core.WritableSignal<boolean>;
393
376
  heading: _angular_core.Signal<string>;
394
- protected item: WritableSignal<T | null>;
377
+ protected item: _angular_core.WritableSignal<D | null>;
395
378
  protected _route: ActivatedRoute;
396
379
  protected _location: Location;
397
380
  protected _userService: UserService;
398
- protected itemService: ItemService<T>;
399
- constructor(itemService: ItemService<T>);
381
+ protected form: IForm<C, D>;
382
+ protected itemService: ItemService<D, L, C>;
383
+ constructor(itemService: ItemService<D, L, C>, form: IForm<C, D>);
400
384
  onInit(): void;
401
- onItemAvailable(): void;
402
- onItemAndUserAvailable(_: IPortalMember): void;
385
+ onItemAvailable(item: D): void;
386
+ onItemAndUserAvailable(_item: D, _user: IPortalMemberDetail): void;
403
387
  goBack(): void;
404
388
  submit(): void;
405
389
  save(): void;
@@ -408,18 +392,19 @@ declare abstract class EditView<T extends Identifiable> {
408
392
  protected fetchRestOptions(): void;
409
393
  protected onUploadedFileReady(_file: File): void;
410
394
  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;
395
+ protected createItem(): C;
396
+ protected updateItem(item: D): D;
397
+ protected postItem(): void;
398
+ protected putItem(item: D): void;
399
+ protected saveFiles(item: D): void;
415
400
  private isCreateRoute;
416
401
  private getItem;
417
- protected onItemUpdated(item: T): void;
402
+ protected onItemUpdated(item: D): void;
418
403
  protected onOptions(options: IRestOptions): void;
419
404
  protected onPostActions(_actions: Record<string, OptionAction>): void;
420
405
  }
421
406
 
422
- declare class ListDataSource<T extends Identifiable> extends DataSource<T> {
407
+ declare class ListDataSource<D extends Identifiable, L extends Identifiable, C = D> extends DataSource<L> {
423
408
  length: _angular_core.WritableSignal<number>;
424
409
  loading: _angular_core.WritableSignal<boolean>;
425
410
  searchTerm: _angular_core.WritableSignal<string>;
@@ -428,17 +413,17 @@ declare class ListDataSource<T extends Identifiable> extends DataSource<T> {
428
413
  sourceIsEmpty: _angular_core.Signal<boolean>;
429
414
  private consumerType;
430
415
  private items;
431
- itemService: ItemService<T>;
416
+ itemService: ItemService<D, L, C>;
432
417
  private subscription;
433
418
  private fetchedPages;
434
- constructor(itemService: ItemService<T>, consumerType?: string);
435
- connect(collectionViewer: CollectionViewer): Observable<T[]>;
419
+ constructor(itemService: ItemService<D, L, C>, consumerType?: string);
420
+ connect(collectionViewer: CollectionViewer): Observable<L[]>;
436
421
  hasTableConsumer(): boolean;
437
422
  onRange(range: ListRange): void;
438
423
  reset(searchTerm?: string, pageSize?: number): void;
439
424
  fetchPage(idx: number): void;
440
425
  fetch(query: IItemQuery): void;
441
- onResponse(response: IPaginated<T>): void;
426
+ onResponse(response: IPaginated<L>): void;
442
427
  disconnect(): void;
443
428
  }
444
429
 
@@ -450,7 +435,7 @@ interface TableColumn {
450
435
  declare class ListTableViewComponent implements AfterViewInit {
451
436
  itemType: _angular_core.InputSignal<string>;
452
437
  columns: _angular_core.InputSignal<TableColumn[]>;
453
- dataSource: _angular_core.InputSignal<ListDataSource<any> | undefined>;
438
+ dataSource: _angular_core.InputSignal<ListDataSource<any, any, any> | undefined>;
454
439
  searchFilter: _angular_core.InputSignal<string>;
455
440
  pageSizeOptions: number[];
456
441
  initialPageSize: number;
@@ -486,9 +471,21 @@ declare class SelectTableComponent<T extends Identifiable> implements OnInit {
486
471
  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
472
  }
488
473
 
489
- declare class ListViewComponent<T extends Identifiable> implements OnInit, AfterViewInit {
474
+ declare class SelectionManager {
475
+ candidates: _angular_core.WritableSignal<Selectable<ichec_angular_core.IPortalMemberList>[]>;
476
+ selected: _angular_core.WritableSignal<ichec_angular_core.IPortalMemberList[]>;
477
+ columns: ichec_angular_core.TableColumn[];
478
+ userService: UserService;
479
+ fetchCandidates(item: string, id: number): void;
480
+ protected updateCandidates(users: IPaginated<IPortalMemberDetail>): void;
481
+ onRemoved(id: number): string;
482
+ onAdded(title: string): string;
483
+ onSearchChanged(searchTerm: string | null): void;
484
+ }
485
+
486
+ declare class ListViewComponent<D extends Identifiable, L extends Identifiable, C = D> implements OnInit, AfterViewInit {
490
487
  viewType: _angular_core.InputSignal<string>;
491
- itemService: _angular_core.InputSignal<ItemService<T> | undefined>;
488
+ itemService: _angular_core.InputSignal<ItemService<D, L, C> | undefined>;
492
489
  itemDetailTemplate: _angular_core.InputSignal<TemplateRef<unknown> | null>;
493
490
  columns: _angular_core.InputSignal<TableColumn[]>;
494
491
  sortFields: _angular_core.InputSignal<string[]>;
@@ -499,7 +496,7 @@ declare class ListViewComponent<T extends Identifiable> implements OnInit, After
499
496
  pageSize: number;
500
497
  pageSizeOptions: number[];
501
498
  protected route: ActivatedRoute;
502
- dataSource: ListDataSource<T> | undefined;
499
+ dataSource: ListDataSource<D, L, C> | undefined;
503
500
  sort: _angular_core.Signal<MatSort | undefined>;
504
501
  columnNames: _angular_core.Signal<string[]>;
505
502
  searchTerm: string;
@@ -514,8 +511,8 @@ declare class ListViewComponent<T extends Identifiable> implements OnInit, After
514
511
  reset(): void;
515
512
  viewChanged(event: MatButtonToggleChange): void;
516
513
  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>;
514
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListViewComponent<any, any, any>, never>;
515
+ 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
516
  }
520
517
 
521
518
  declare class BackButtonComponent {
@@ -590,32 +587,22 @@ declare class FileUploadComponent {
590
587
  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
588
  }
592
589
 
593
- declare class UserDetailComponent extends DetailView<IPortalMember> implements OnInit {
590
+ declare class UserDetailComponent extends DetailView<IPortalMemberDetail, IPortalMemberList, IPortalMemberCreate> implements OnInit {
594
591
  constructor();
595
592
  ngOnInit(): void;
596
593
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserDetailComponent, never>;
597
594
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserDetailComponent, "lib-user-detail", never, {}, {}, never, never, true, never>;
598
595
  }
599
596
 
600
- declare class UserEditComponent extends EditView<IPortalMember> implements OnInit {
597
+ declare class UserEditComponent extends EditView<IPortalMemberDetail, IPortalMemberList, IPortalMemberCreate> implements OnInit {
601
598
  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
599
  constructor();
611
600
  ngOnInit(): void;
612
- onItemAvailable(): void;
601
+ onItemAvailable(item: IPortalMemberDetail): void;
613
602
  submit(): void;
614
- updateFromForm(item: IPortalMember): IPortalMember;
615
- protected getTemplateItem(): IPortalMember;
616
603
  onPreviewLoaded(preview: IPreview): void;
617
604
  onFileUploaded(upload: IFileUpload): void;
618
- protected saveFiles(item: IPortalMember): void;
605
+ protected saveFiles(item: IPortalMemberDetail): void;
619
606
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserEditComponent, never>;
620
607
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserEditComponent, "lib-user-edit", never, {}, {}, never, never, true, never>;
621
608
  }
@@ -628,7 +615,7 @@ declare class UserComponent {
628
615
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserComponent, "lib-user", never, {}, {}, never, never, true, never>;
629
616
  }
630
617
 
631
- declare class GroupDetailComponent extends DetailView<IGroup> implements OnInit {
618
+ declare class GroupDetailComponent extends DetailView<IGroupDetail, IGroupList, IGroupCreate> implements OnInit {
632
619
  constructor();
633
620
  ngOnInit(): void;
634
621
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<GroupDetailComponent, never>;
@@ -650,12 +637,12 @@ declare class AddressEditComponent {
650
637
  }
651
638
 
652
639
  declare class AddressDetailComponent {
653
- address: _angular_core.InputSignal<IAddress | undefined>;
640
+ address: _angular_core.InputSignal<ichec_angular_core.IAddressList | undefined>;
654
641
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AddressDetailComponent, never>;
655
642
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AddressDetailComponent, "lib-address-detail", never, { "address": { "alias": "address"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
656
643
  }
657
644
 
658
- declare class AddressForm {
645
+ declare class AddressForm implements IForm<IAddressCreate, IAddressDetail> {
659
646
  private formBuilder;
660
647
  form: _angular_forms.FormGroup<{
661
648
  line1: _angular_forms.FormControl<string | null>;
@@ -666,8 +653,9 @@ declare class AddressForm {
666
653
  postcode: _angular_forms.FormControl<string | null>;
667
654
  country: _angular_forms.FormControl<string | null>;
668
655
  }>;
669
- setValue(item: IAddress): void;
670
- updateItem(item: IAddress): IAddress;
656
+ setValue(item: IAddressDetail): void;
657
+ createItem(): IAddressCreate;
658
+ updateItem(item: IAddressDetail): IAddressDetail;
671
659
  }
672
660
 
673
661
  declare class OrganizationComponent {
@@ -677,63 +665,27 @@ declare class OrganizationComponent {
677
665
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<OrganizationComponent, "lib-organization", never, {}, {}, never, never, true, never>;
678
666
  }
679
667
 
680
- declare class OrganizationDetailComponent extends DetailView<IOrganization> implements OnInit {
681
- address: _angular_core.WritableSignal<IAddress | null>;
682
- private addressService;
668
+ declare class OrganizationDetailComponent extends DetailView<IOrganizationDetail, IOrganizationList, IOrganizationCreate> implements OnInit {
683
669
  constructor();
684
670
  ngOnInit(): void;
685
- onItemAndUserAvailable(item: IOrganization, _user: IPortalMember): void;
686
671
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<OrganizationDetailComponent, never>;
687
672
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<OrganizationDetailComponent, "lib-organization-detail", never, {}, {}, never, never, true, never>;
688
673
  }
689
674
 
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 {
675
+ declare class OrganizationEditComponent extends EditView<IOrganizationDetail, IOrganizationList, IOrganizationCreate> implements OnInit {
712
676
  countryOptions: _angular_core.WritableSignal<ICountry[]>;
713
677
  selectionManager: SelectionManager;
714
- form: OrganizationForm;
715
- address: IAddress;
716
- addressService: AddressService;
717
678
  constructor();
718
679
  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;
680
+ addressForm(): FormGroup;
681
+ createItem(): IOrganizationCreate;
682
+ protected updateItem(item: IOrganizationDetail): IOrganizationDetail;
683
+ onItemAndUserAvailable(item: IOrganizationDetail, _: IPortalMemberDetail): void;
728
684
  protected onPostActions(actions: Record<string, OptionAction>): void;
729
685
  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
686
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<OrganizationEditComponent, never>;
735
687
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<OrganizationEditComponent, "lib-organization-edit", never, {}, {}, never, never, true, never>;
736
688
  }
737
689
 
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 };
690
+ 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, SelectionManager, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserService };
691
+ export type { IAddressBase, IAddressCreate, IAddressDetail, IAddressList, ICountry, IFileRecord, IFileUpload, IForm, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ichec-angular-core",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.1.1",
6
6
  "@angular/core": "^20.1.1"