ichec-angular-core 0.0.11 → 0.0.13

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
@@ -2,10 +2,11 @@ import * as rxjs from 'rxjs';
2
2
  import { Observable, BehaviorSubject } from 'rxjs';
3
3
  import { HttpClient, HttpErrorResponse } from '@angular/common/http';
4
4
  import * as i0 from '@angular/core';
5
- import { InjectionToken, OnInit } from '@angular/core';
5
+ import { InjectionToken, OnInit, WritableSignal } from '@angular/core';
6
6
  import * as ichec_angular_core from 'ichec-angular-core';
7
7
  import { ActivatedRoute } from '@angular/router';
8
8
  import { Location } from '@angular/common';
9
+ import * as _angular_forms from '@angular/forms';
9
10
  import { MatTable } from '@angular/material/table';
10
11
 
11
12
  interface Identifiable {
@@ -31,6 +32,7 @@ declare class PortalMember implements IPortalMember {
31
32
  phone: string;
32
33
  organization: string;
33
34
  profile_url: string;
35
+ constructor(params?: Partial<IPortalMember>);
34
36
  }
35
37
  interface IGroup extends Identifiable {
36
38
  name: string;
@@ -59,6 +61,7 @@ declare class Organization implements IOrganization {
59
61
  website: string;
60
62
  country: string;
61
63
  members: string[];
64
+ constructor(params?: Partial<IOrganization>);
62
65
  }
63
66
 
64
67
  declare enum ErrorCode {
@@ -171,15 +174,14 @@ declare class LeftNavService {
171
174
  }
172
175
 
173
176
  declare class TopBarComponent implements OnInit {
174
- user?: IPortalMember | null;
175
- title: string;
177
+ readonly title: i0.InputSignal<string | undefined>;
178
+ protected user: WritableSignal<IPortalMember | null>;
176
179
  private userService;
177
180
  private leftNavService;
178
- constructor();
179
181
  ngOnInit(): void;
180
182
  onLogout(): void;
181
183
  static ɵfac: i0.ɵɵFactoryDeclaration<TopBarComponent, never>;
182
- static ɵcmp: i0.ɵɵComponentDeclaration<TopBarComponent, "lib-top-bar", never, { "title": { "alias": "title"; "required": false; }; }, {}, never, never, true, never>;
184
+ static ɵcmp: i0.ɵɵComponentDeclaration<TopBarComponent, "lib-top-bar", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
183
185
  }
184
186
 
185
187
  declare class LeftNavComponent {
@@ -197,8 +199,8 @@ interface LoginUser {
197
199
  declare const LOGIN_USER: InjectionToken<LoginUser>;
198
200
  declare class LandingComponent implements OnInit {
199
201
  loginUser: LoginUser;
200
- loginError: string;
201
- message: string;
202
+ loginError: WritableSignal<string>;
203
+ message: i0.InputSignal<string | undefined>;
202
204
  private userService;
203
205
  private router;
204
206
  ngOnInit(): void;
@@ -206,32 +208,31 @@ declare class LandingComponent implements OnInit {
206
208
  onLoginError(error: HttpErrorResponse): void;
207
209
  onLoggedIn(): void;
208
210
  static ɵfac: i0.ɵɵFactoryDeclaration<LandingComponent, never>;
209
- static ɵcmp: i0.ɵɵComponentDeclaration<LandingComponent, "lib-landing", never, { "message": { "alias": "message"; "required": false; }; }, {}, never, never, true, never>;
211
+ static ɵcmp: i0.ɵɵComponentDeclaration<LandingComponent, "lib-landing", never, { "message": { "alias": "message"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
210
212
  }
211
213
 
212
214
  declare abstract class DetailView<T extends Identifiable> {
213
- item?: T;
214
- protected _route: ActivatedRoute;
215
- protected _location: Location;
216
- protected _userService: UserService;
217
- protected _restService: RestService<T>;
218
- constructor(_route: ActivatedRoute, _location: Location, _userService: UserService, _restService: RestService<T>);
215
+ protected item: WritableSignal<T | null>;
216
+ protected route: ActivatedRoute;
217
+ protected userService: UserService;
218
+ protected restService: RestService<T>;
219
+ constructor(restService: RestService<T>);
219
220
  onInit(): void;
220
221
  onItemAvailable(): void;
221
222
  onItemAndUserAvailable(_: IPortalMember): void;
222
- goBack(): void;
223
223
  private getItem;
224
- update(): void;
225
224
  }
226
225
 
227
226
  declare abstract class EditView<T extends Identifiable> {
228
- item?: T;
229
- createMode: boolean;
227
+ readonly typename: string;
228
+ createMode: WritableSignal<boolean>;
229
+ heading: i0.Signal<string>;
230
+ protected item: WritableSignal<T | null>;
230
231
  protected _route: ActivatedRoute;
231
232
  protected _location: Location;
232
233
  protected _userService: UserService;
233
234
  protected _restService: RestService<T>;
234
- constructor(_route: ActivatedRoute, _location: Location, _userService: UserService, _restServce: RestService<T>);
235
+ constructor(_restServce: RestService<T>);
235
236
  onInit(): void;
236
237
  onItemAvailable(): void;
237
238
  onItemAndUserAvailable(_: IPortalMember): void;
@@ -240,8 +241,6 @@ declare abstract class EditView<T extends Identifiable> {
240
241
  save(): void;
241
242
  cancel(): void;
242
243
  protected fetchRestOptions(): void;
243
- protected onFileUpload(event: Event): void;
244
- protected readFile(file: File): void;
245
244
  protected onUploadedFileReady(_file: File): void;
246
245
  protected onFileRead(_content: string | ArrayBuffer): void;
247
246
  protected createItem(): void;
@@ -257,13 +256,13 @@ declare abstract class EditView<T extends Identifiable> {
257
256
 
258
257
  declare class ListView<T extends Identifiable> {
259
258
  user?: IPortalMember;
260
- items: T[];
259
+ protected items: WritableSignal<T[]>;
261
260
  displayedColumns: string[];
262
261
  protected _route: ActivatedRoute;
263
262
  protected _location: Location;
264
263
  protected _userService: UserService;
265
264
  protected _restService: RestService<T>;
266
- constructor(_route: ActivatedRoute, _location: Location, _userService: UserService, _restService: RestService<T>);
265
+ constructor(_restService: RestService<T>);
267
266
  onInit(): void;
268
267
  getItems(): void;
269
268
  private onUserChange;
@@ -271,7 +270,61 @@ declare class ListView<T extends Identifiable> {
271
270
  goBack(): void;
272
271
  }
273
272
 
273
+ declare class BackButtonComponent {
274
+ protected location: Location;
275
+ protected goBack(): void;
276
+ static ɵfac: i0.ɵɵFactoryDeclaration<BackButtonComponent, never>;
277
+ static ɵcmp: i0.ɵɵComponentDeclaration<BackButtonComponent, "lib-back-button", never, {}, {}, never, never, true, never>;
278
+ }
279
+
280
+ declare class DetailHeaderComponent {
281
+ id: i0.InputSignal<number>;
282
+ text: i0.InputSignal<string>;
283
+ route: i0.InputSignal<string>;
284
+ fullRoute: i0.Signal<string>;
285
+ static ɵfac: i0.ɵɵFactoryDeclaration<DetailHeaderComponent, never>;
286
+ static ɵcmp: i0.ɵɵComponentDeclaration<DetailHeaderComponent, "lib-detail-header", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "route": { "alias": "route"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
287
+ }
288
+
289
+ interface IFileRecord {
290
+ name: string;
291
+ display_name: string;
292
+ file_type: string;
293
+ file: File | null;
294
+ remote: string;
295
+ local: string | ArrayBuffer;
296
+ }
297
+ declare class FileRecord {
298
+ name: string;
299
+ display_name: string;
300
+ file_type: string;
301
+ file: File | null;
302
+ remote: string;
303
+ local: string | ArrayBuffer;
304
+ constructor(params?: Partial<IFileRecord>);
305
+ }
306
+
307
+ interface IPreview {
308
+ name: string;
309
+ content: string | ArrayBuffer;
310
+ }
311
+ interface IFileUpload {
312
+ name: string;
313
+ file: File;
314
+ }
315
+ declare class FileUploadComponent {
316
+ files: i0.InputSignal<IFileRecord[]>;
317
+ previewLoaded: i0.OutputEmitterRef<IPreview>;
318
+ fileUploaded: i0.OutputEmitterRef<IFileUpload>;
319
+ protected onPreviewRead(name: string, content: string | ArrayBuffer): void;
320
+ protected onFileUpload(name: string, event: Event): void;
321
+ protected readFile(name: string, file: File): void;
322
+ static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, never>;
323
+ static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "lib-file-upload", never, { "files": { "alias": "files"; "required": false; "isSignal": true; }; }, { "previewLoaded": "previewLoaded"; "fileUploaded": "fileUploaded"; }, never, never, true, never>;
324
+ }
325
+
274
326
  declare class UserDetailComponent extends DetailView<IPortalMember> implements OnInit {
327
+ protected typename: string;
275
328
  constructor();
276
329
  ngOnInit(): void;
277
330
  static ɵfac: i0.ɵɵFactoryDeclaration<UserDetailComponent, never>;
@@ -279,13 +332,24 @@ declare class UserDetailComponent extends DetailView<IPortalMember> implements O
279
332
  }
280
333
 
281
334
  declare class UserEditComponent extends EditView<IPortalMember> implements OnInit {
282
- image: File | null;
283
- temporaryImageUrl: string | ArrayBuffer;
335
+ readonly typename: string;
336
+ files: WritableSignal<IFileRecord[]>;
337
+ private formBuilder;
338
+ form: _angular_forms.FormGroup<{
339
+ username: _angular_forms.FormControl<string | null>;
340
+ email: _angular_forms.FormControl<string | null>;
341
+ first_name: _angular_forms.FormControl<string | null>;
342
+ last_name: _angular_forms.FormControl<string | null>;
343
+ phone: _angular_forms.FormControl<string | null>;
344
+ }>;
284
345
  constructor();
285
346
  ngOnInit(): void;
347
+ onItemAvailable(): void;
348
+ submit(): void;
349
+ updateFromForm(item: IPortalMember): IPortalMember;
286
350
  protected getTemplateItem(): IPortalMember;
287
- protected onUploadedFileReady(file: File): void;
288
- protected onFileRead(content: string | ArrayBuffer): void;
351
+ onPreviewLoaded(preview: IPreview): void;
352
+ onFileUploaded(upload: IFileUpload): void;
289
353
  protected saveFiles(item: IPortalMember): void;
290
354
  static ɵfac: i0.ɵɵFactoryDeclaration<UserEditComponent, never>;
291
355
  static ɵcmp: i0.ɵɵComponentDeclaration<UserEditComponent, "lib-user-edit", never, {}, {}, never, never, true, never>;
@@ -299,19 +363,23 @@ declare class UserComponent extends ListView<IPortalMember> implements OnInit {
299
363
  }
300
364
 
301
365
  declare class UserSelectComponent {
302
- toAdd: IPortalMember | null;
303
- items: IPortalMember[];
304
- candidates: IPortalMember[];
305
- table: MatTable<IPortalMember>;
366
+ toAdd: WritableSignal<number>;
367
+ selected: i0.InputSignal<IPortalMember[]>;
368
+ options: i0.InputSignal<IPortalMember[]>;
369
+ itemAdded: i0.OutputEmitterRef<number>;
370
+ itemRemoved: i0.OutputEmitterRef<number>;
371
+ table: i0.Signal<MatTable<any> | undefined>;
306
372
  tableColumns: string[];
307
- remove(to_remove: IPortalMember): void;
373
+ remove(id: number): void;
308
374
  add(): void;
309
375
  static ɵfac: i0.ɵɵFactoryDeclaration<UserSelectComponent, never>;
310
- static ɵcmp: i0.ɵɵComponentDeclaration<UserSelectComponent, "lib-user-select", never, { "items": { "alias": "items"; "required": false; }; "candidates": { "alias": "candidates"; "required": false; }; }, {}, never, never, true, never>;
376
+ static ɵcmp: i0.ɵɵComponentDeclaration<UserSelectComponent, "lib-user-select", never, { "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; }, { "itemAdded": "itemAdded"; "itemRemoved": "itemRemoved"; }, never, never, true, never>;
311
377
  }
312
378
 
313
- declare class GroupDetailComponent extends DetailView<IGroup> {
379
+ declare class GroupDetailComponent extends DetailView<IGroup> implements OnInit {
380
+ protected typename: string;
314
381
  constructor();
382
+ ngOnInit(): void;
315
383
  static ɵfac: i0.ɵɵFactoryDeclaration<GroupDetailComponent, never>;
316
384
  static ɵcmp: i0.ɵɵComponentDeclaration<GroupDetailComponent, "lib-group-detail", never, {}, {}, never, never, true, never>;
317
385
  }
@@ -332,22 +400,41 @@ declare class OrganizationComponent extends ListView<Organization> implements On
332
400
  static ɵcmp: i0.ɵɵComponentDeclaration<OrganizationComponent, "lib-organization", never, {}, {}, never, never, true, never>;
333
401
  }
334
402
 
335
- declare class OrganizationDetailComponent extends DetailView<IOrganization> {
403
+ declare class OrganizationDetailComponent extends DetailView<IOrganization> implements OnInit {
404
+ typename: string;
336
405
  constructor();
406
+ ngOnInit(): void;
337
407
  static ɵfac: i0.ɵɵFactoryDeclaration<OrganizationDetailComponent, never>;
338
408
  static ɵcmp: i0.ɵɵComponentDeclaration<OrganizationDetailComponent, "lib-organization-detail", never, {}, {}, never, never, true, never>;
339
409
  }
340
410
 
341
411
  declare class OrganizationEditComponent extends EditView<IOrganization> implements OnInit {
342
- countryOptions: string[];
412
+ countryOptions: WritableSignal<string[]>;
413
+ candidateMembers: WritableSignal<IPortalMember[]>;
414
+ selectedMembers: WritableSignal<IPortalMember[]>;
415
+ readonly typename: string;
416
+ private formBuilder;
417
+ form: _angular_forms.FormGroup<{
418
+ name: _angular_forms.FormControl<string | null>;
419
+ acronym: _angular_forms.FormControl<string | null>;
420
+ description: _angular_forms.FormControl<string | null>;
421
+ address: _angular_forms.FormControl<string | null>;
422
+ website: _angular_forms.FormControl<string | null>;
423
+ country: _angular_forms.FormControl<string | null>;
424
+ }>;
343
425
  constructor();
344
426
  ngOnInit(): void;
427
+ onItemAndUserAvailable(_: IPortalMember): void;
428
+ submit(): void;
429
+ updateFromForm(item: IOrganization): IOrganization;
345
430
  protected getTemplateItem(): IOrganization;
346
431
  protected onPostActions(actions: Record<string, OptionAction>): void;
347
432
  protected onCountryChoices(choices: OptionActionChoice[]): void;
433
+ onMemberRemoved(id: number): void;
434
+ onMemberAdded(id: number): void;
348
435
  static ɵfac: i0.ɵɵFactoryDeclaration<OrganizationEditComponent, never>;
349
436
  static ɵcmp: i0.ɵɵComponentDeclaration<OrganizationEditComponent, "lib-organization-edit", never, {}, {}, never, never, true, never>;
350
437
  }
351
438
 
352
- export { ApiError, DetailView, ENDPOINT_URL, EditView, ErrorCode, Group, GroupComponent, GroupDetailComponent, GroupService, LOGIN_USER, LandingComponent, LeftNavComponent, LeftNavService, ListView, Organization, OrganizationComponent, OrganizationDetailComponent, OrganizationEditComponent, OrganizationService, PortalMember, RestService, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserSelectComponent, UserService };
353
- export type { IGroup, IOrganization, IPortalMember, IRestOptions, Identifiable, LeftNavCategory, LeftNavOption, NavGroup, NavOption, OptionAction, OptionActionChoice };
439
+ export { ApiError, BackButtonComponent, DetailHeaderComponent, DetailView, ENDPOINT_URL, EditView, ErrorCode, FileRecord, FileUploadComponent, Group, GroupComponent, GroupDetailComponent, GroupService, LOGIN_USER, LandingComponent, LeftNavComponent, LeftNavService, ListView, Organization, OrganizationComponent, OrganizationDetailComponent, OrganizationEditComponent, OrganizationService, PortalMember, RestService, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserSelectComponent, UserService };
440
+ export type { IFileRecord, IFileUpload, IGroup, IOrganization, IPortalMember, IPreview, IRestOptions, Identifiable, LeftNavCategory, LeftNavOption, NavGroup, NavOption, OptionAction, OptionActionChoice };
package/package.json CHANGED
@@ -1,17 +1,12 @@
1
1
  {
2
2
  "name": "ichec-angular-core",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.1.1",
6
6
  "@angular/core": "^20.1.1"
7
7
  },
8
- "dependencies": {
9
- "tslib": "^2.3.0"
10
- },
11
- "sideEffects": false,
12
- "module": "fesm2022/ichec-angular-core.mjs",
13
- "typings": "index.d.ts",
14
8
  "exports": {
9
+ "./styles/": "./styles",
15
10
  "./package.json": {
16
11
  "default": "./package.json"
17
12
  },
@@ -19,5 +14,11 @@
19
14
  "types": "./index.d.ts",
20
15
  "default": "./fesm2022/ichec-angular-core.mjs"
21
16
  }
22
- }
17
+ },
18
+ "dependencies": {
19
+ "tslib": "^2.3.0"
20
+ },
21
+ "sideEffects": false,
22
+ "module": "fesm2022/ichec-angular-core.mjs",
23
+ "typings": "index.d.ts"
23
24
  }
@@ -0,0 +1,95 @@
1
+ .content-container {
2
+ display: flex;
3
+ padding: 10px;
4
+ flex-direction: column;
5
+ justify-content: center;
6
+ align-items: center;
7
+ }
8
+
9
+ .tabular-list-container {
10
+ height: 100%;
11
+ width: 100%;
12
+ display: flex;
13
+ padding: 10px;
14
+ margin: 10px;
15
+ }
16
+
17
+ .item-detail-container {
18
+ display: flex;
19
+ justify-content: center;
20
+ align-items: center;
21
+ flex-direction: column;
22
+ padding: 5px;
23
+ }
24
+
25
+ .item-detail-heading {
26
+ width:100%;
27
+ max-width:500px
28
+ }
29
+
30
+ .item-detail-header{
31
+ display: inline;
32
+ width: 100%;
33
+ max-width: 100px;
34
+ }
35
+
36
+ .item-edit-container {
37
+ display: flex;
38
+ justify-content: left;
39
+ align-items: left;
40
+ flex-direction: column;
41
+ width:100%;
42
+ max-width:500px
43
+ }
44
+
45
+ .item-edit-header {
46
+ display: inline;
47
+ }
48
+
49
+ .item-field{
50
+ padding: 5px;
51
+ }
52
+
53
+ .item-card {
54
+ margin-bottom: 8px;
55
+ height:100%;
56
+ width:100%;
57
+ max-width:600px;
58
+ }
59
+
60
+ .item-card:hover{
61
+ background-color: lightgrey;
62
+ }
63
+
64
+ .image-holder {
65
+ display: flex;
66
+ justify-content: center;
67
+ align-items: center;
68
+ overflow: hidden;
69
+ padding: 5px;
70
+ }
71
+
72
+ .button-container{
73
+ padding: 10px;
74
+ }
75
+
76
+ .form-card{
77
+ justify-content: center;
78
+ align-items: center;
79
+ flex-direction: column;
80
+ display: flex;
81
+ }
82
+
83
+ .form-field{
84
+ padding: 5px;
85
+ }
86
+
87
+ .form-field-wide{
88
+ padding: 5px;
89
+ width:100%;
90
+ }
91
+
92
+
93
+
94
+
95
+