ichec-angular-core 0.0.10 → 0.0.12

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,12 @@ 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';
10
+ import { MatTable } from '@angular/material/table';
9
11
 
10
12
  interface Identifiable {
11
13
  id: number;
@@ -30,6 +32,7 @@ declare class PortalMember implements IPortalMember {
30
32
  phone: string;
31
33
  organization: string;
32
34
  profile_url: string;
35
+ constructor(params?: Partial<IPortalMember>);
33
36
  }
34
37
  interface IGroup extends Identifiable {
35
38
  name: string;
@@ -58,17 +61,16 @@ declare class Organization implements IOrganization {
58
61
  website: string;
59
62
  country: string;
60
63
  members: string[];
64
+ constructor(params?: Partial<IOrganization>);
61
65
  }
62
66
 
63
- interface LeftNavOption {
64
- name: string;
65
- route: string;
67
+ declare enum ErrorCode {
68
+ UnknownError = 1
66
69
  }
67
- interface LeftNavCategory {
68
- name: string;
69
- options: LeftNavOption[];
70
+ declare class ApiError {
71
+ code: ErrorCode;
72
+ text: string;
70
73
  }
71
-
72
74
  interface OptionActionChoice {
73
75
  value: string;
74
76
  display_name: string;
@@ -89,6 +91,15 @@ interface IRestOptions {
89
91
  actions?: Record<string, Record<string, OptionAction>>;
90
92
  }
91
93
 
94
+ interface LeftNavOption {
95
+ name: string;
96
+ route: string;
97
+ }
98
+ interface LeftNavCategory {
99
+ name: string;
100
+ options: LeftNavOption[];
101
+ }
102
+
92
103
  declare const ENDPOINT_URL: InjectionToken<string>;
93
104
  declare class RestService<T extends Identifiable> {
94
105
  private _url;
@@ -163,15 +174,14 @@ declare class LeftNavService {
163
174
  }
164
175
 
165
176
  declare class TopBarComponent implements OnInit {
166
- user?: IPortalMember | null;
167
- title: string;
177
+ readonly title: i0.InputSignal<string | undefined>;
178
+ protected user: WritableSignal<IPortalMember | null>;
168
179
  private userService;
169
180
  private leftNavService;
170
- constructor();
171
181
  ngOnInit(): void;
172
182
  onLogout(): void;
173
183
  static ɵfac: i0.ɵɵFactoryDeclaration<TopBarComponent, never>;
174
- 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>;
175
185
  }
176
186
 
177
187
  declare class LeftNavComponent {
@@ -189,8 +199,8 @@ interface LoginUser {
189
199
  declare const LOGIN_USER: InjectionToken<LoginUser>;
190
200
  declare class LandingComponent implements OnInit {
191
201
  loginUser: LoginUser;
192
- loginError: string;
193
- message: string;
202
+ loginError: WritableSignal<string>;
203
+ message: i0.InputSignal<string | undefined>;
194
204
  private userService;
195
205
  private router;
196
206
  ngOnInit(): void;
@@ -198,56 +208,61 @@ declare class LandingComponent implements OnInit {
198
208
  onLoginError(error: HttpErrorResponse): void;
199
209
  onLoggedIn(): void;
200
210
  static ɵfac: i0.ɵɵFactoryDeclaration<LandingComponent, never>;
201
- 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>;
202
212
  }
203
213
 
204
214
  declare abstract class DetailView<T extends Identifiable> {
205
- item?: T;
206
- protected _route: ActivatedRoute;
207
- protected _location: Location;
208
- protected _userService: UserService;
209
- protected _restService: RestService<T>;
210
- 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>);
211
220
  onInit(): void;
212
221
  onItemAvailable(): void;
213
222
  onItemAndUserAvailable(_: IPortalMember): void;
214
- goBack(): void;
215
223
  private getItem;
216
- update(): void;
217
224
  }
218
225
 
219
226
  declare abstract class EditView<T extends Identifiable> {
220
- item?: T;
221
- createMode: boolean;
227
+ readonly typename: string;
228
+ createMode: WritableSignal<boolean>;
229
+ heading: i0.Signal<string>;
230
+ protected item: WritableSignal<T | null>;
222
231
  protected _route: ActivatedRoute;
223
232
  protected _location: Location;
224
233
  protected _userService: UserService;
225
234
  protected _restService: RestService<T>;
226
- constructor(_route: ActivatedRoute, _location: Location, _userService: UserService, _restServce: RestService<T>);
235
+ constructor(_restServce: RestService<T>);
227
236
  onInit(): void;
228
237
  onItemAvailable(): void;
229
238
  onItemAndUserAvailable(_: IPortalMember): void;
230
239
  goBack(): void;
240
+ submit(): void;
231
241
  save(): void;
242
+ cancel(): void;
243
+ protected fetchRestOptions(): void;
244
+ protected onUploadedFileReady(_file: File): void;
245
+ protected onFileRead(_content: string | ArrayBuffer): void;
232
246
  protected createItem(): void;
233
247
  protected updateItem(): void;
234
248
  protected saveFiles(item: T): void;
235
- cancel(): void;
236
249
  protected abstract getTemplateItem(): T;
237
250
  private isCreateRoute;
238
251
  private getItem;
239
252
  protected onItemUpdated(item: T): void;
253
+ protected onOptions(options: IRestOptions): void;
254
+ protected onPostActions(_actions: Record<string, OptionAction>): void;
240
255
  }
241
256
 
242
257
  declare class ListView<T extends Identifiable> {
243
258
  user?: IPortalMember;
244
- items: T[];
259
+ protected items: WritableSignal<T[]>;
245
260
  displayedColumns: string[];
246
261
  protected _route: ActivatedRoute;
247
262
  protected _location: Location;
248
263
  protected _userService: UserService;
249
264
  protected _restService: RestService<T>;
250
- constructor(_route: ActivatedRoute, _location: Location, _userService: UserService, _restService: RestService<T>);
265
+ constructor(_restService: RestService<T>);
251
266
  onInit(): void;
252
267
  getItems(): void;
253
268
  private onUserChange;
@@ -256,21 +271,51 @@ declare class ListView<T extends Identifiable> {
256
271
  }
257
272
 
258
273
  declare class UserDetailComponent extends DetailView<IPortalMember> implements OnInit {
274
+ protected typename: string;
259
275
  constructor();
260
276
  ngOnInit(): void;
261
277
  static ɵfac: i0.ɵɵFactoryDeclaration<UserDetailComponent, never>;
262
278
  static ɵcmp: i0.ɵɵComponentDeclaration<UserDetailComponent, "lib-user-detail", never, {}, {}, never, never, true, never>;
263
279
  }
264
280
 
281
+ interface IFileRecord {
282
+ name: string;
283
+ display_name: string;
284
+ file_type: string;
285
+ file: File | null;
286
+ remote: string;
287
+ local: string | ArrayBuffer;
288
+ }
289
+
290
+ interface IPreview {
291
+ name: string;
292
+ content: string | ArrayBuffer;
293
+ }
294
+ interface IFileUpload {
295
+ name: string;
296
+ file: File;
297
+ }
298
+
265
299
  declare class UserEditComponent extends EditView<IPortalMember> implements OnInit {
266
- image: File | null;
267
- temporaryImageUrl: string | ArrayBuffer;
300
+ readonly typename: string;
301
+ files: WritableSignal<IFileRecord[]>;
302
+ private formBuilder;
303
+ form: _angular_forms.FormGroup<{
304
+ username: _angular_forms.FormControl<string | null>;
305
+ email: _angular_forms.FormControl<string | null>;
306
+ first_name: _angular_forms.FormControl<string | null>;
307
+ last_name: _angular_forms.FormControl<string | null>;
308
+ phone: _angular_forms.FormControl<string | null>;
309
+ }>;
268
310
  constructor();
269
311
  ngOnInit(): void;
270
- protected getTemplateItem(): IPortalMember;
271
- saveFiles(item: IPortalMember): void;
312
+ onItemAvailable(): void;
272
313
  submit(): void;
273
- onFileUpload(event: Event): void;
314
+ updateFromForm(item: IPortalMember): IPortalMember;
315
+ protected getTemplateItem(): IPortalMember;
316
+ onPreviewLoaded(preview: IPreview): void;
317
+ onFileUploaded(upload: IFileUpload): void;
318
+ protected saveFiles(item: IPortalMember): void;
274
319
  static ɵfac: i0.ɵɵFactoryDeclaration<UserEditComponent, never>;
275
320
  static ɵcmp: i0.ɵɵComponentDeclaration<UserEditComponent, "lib-user-edit", never, {}, {}, never, never, true, never>;
276
321
  }
@@ -282,8 +327,24 @@ declare class UserComponent extends ListView<IPortalMember> implements OnInit {
282
327
  static ɵcmp: i0.ɵɵComponentDeclaration<UserComponent, "lib-user", never, {}, {}, never, never, true, never>;
283
328
  }
284
329
 
285
- declare class GroupDetailComponent extends DetailView<IGroup> {
330
+ declare class UserSelectComponent {
331
+ toAdd: WritableSignal<number>;
332
+ selected: i0.InputSignal<IPortalMember[]>;
333
+ options: i0.InputSignal<IPortalMember[]>;
334
+ itemAdded: i0.OutputEmitterRef<number>;
335
+ itemRemoved: i0.OutputEmitterRef<number>;
336
+ table: i0.Signal<MatTable<any> | undefined>;
337
+ tableColumns: string[];
338
+ remove(id: number): void;
339
+ add(): void;
340
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserSelectComponent, never>;
341
+ 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>;
342
+ }
343
+
344
+ declare class GroupDetailComponent extends DetailView<IGroup> implements OnInit {
345
+ protected typename: string;
286
346
  constructor();
347
+ ngOnInit(): void;
287
348
  static ɵfac: i0.ɵɵFactoryDeclaration<GroupDetailComponent, never>;
288
349
  static ɵcmp: i0.ɵɵComponentDeclaration<GroupDetailComponent, "lib-group-detail", never, {}, {}, never, never, true, never>;
289
350
  }
@@ -304,22 +365,41 @@ declare class OrganizationComponent extends ListView<Organization> implements On
304
365
  static ɵcmp: i0.ɵɵComponentDeclaration<OrganizationComponent, "lib-organization", never, {}, {}, never, never, true, never>;
305
366
  }
306
367
 
307
- declare class OrganizationDetailComponent extends DetailView<IOrganization> {
368
+ declare class OrganizationDetailComponent extends DetailView<IOrganization> implements OnInit {
369
+ typename: string;
308
370
  constructor();
371
+ ngOnInit(): void;
309
372
  static ɵfac: i0.ɵɵFactoryDeclaration<OrganizationDetailComponent, never>;
310
373
  static ɵcmp: i0.ɵɵComponentDeclaration<OrganizationDetailComponent, "lib-organization-detail", never, {}, {}, never, never, true, never>;
311
374
  }
312
375
 
313
376
  declare class OrganizationEditComponent extends EditView<IOrganization> implements OnInit {
314
- countryOptions: string[];
377
+ countryOptions: WritableSignal<string[]>;
378
+ candidateMembers: WritableSignal<IPortalMember[]>;
379
+ selectedMembers: WritableSignal<IPortalMember[]>;
380
+ readonly typename: string;
381
+ private formBuilder;
382
+ form: _angular_forms.FormGroup<{
383
+ name: _angular_forms.FormControl<string | null>;
384
+ acronym: _angular_forms.FormControl<string | null>;
385
+ description: _angular_forms.FormControl<string | null>;
386
+ address: _angular_forms.FormControl<string | null>;
387
+ website: _angular_forms.FormControl<string | null>;
388
+ country: _angular_forms.FormControl<string | null>;
389
+ }>;
315
390
  constructor();
316
391
  ngOnInit(): void;
392
+ onItemAndUserAvailable(_: IPortalMember): void;
317
393
  submit(): void;
318
- onOptions(options: IRestOptions): void;
394
+ updateFromForm(item: IOrganization): IOrganization;
319
395
  protected getTemplateItem(): IOrganization;
396
+ protected onPostActions(actions: Record<string, OptionAction>): void;
397
+ protected onCountryChoices(choices: OptionActionChoice[]): void;
398
+ onMemberRemoved(id: number): void;
399
+ onMemberAdded(id: number): void;
320
400
  static ɵfac: i0.ɵɵFactoryDeclaration<OrganizationEditComponent, never>;
321
401
  static ɵcmp: i0.ɵɵComponentDeclaration<OrganizationEditComponent, "lib-organization-edit", never, {}, {}, never, never, true, never>;
322
402
  }
323
403
 
324
- export { DetailView, ENDPOINT_URL, EditView, Group, GroupComponent, GroupDetailComponent, GroupService, LOGIN_USER, LandingComponent, LeftNavComponent, LeftNavService, ListView, Organization, OrganizationComponent, OrganizationDetailComponent, OrganizationEditComponent, OrganizationService, PortalMember, RestService, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserService };
325
- export type { IGroup, IOrganization, IPortalMember, Identifiable, LeftNavCategory, LeftNavOption, NavGroup, NavOption };
404
+ 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 };
405
+ export type { IGroup, IOrganization, IPortalMember, 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.10",
3
+ "version": "0.0.12",
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
+