wt-front-shared 19.0.44 → 19.0.45

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.
Files changed (51) hide show
  1. package/README.md +72 -13
  2. package/fesm2022/wt-front-shared.mjs +3823 -803
  3. package/fesm2022/wt-front-shared.mjs.map +1 -1
  4. package/lib/core/+state/router/router.effects.d.ts +1 -1
  5. package/lib/core/+state/static-data/static-data.actions.d.ts +1 -0
  6. package/lib/core/+state/static-data/static-data.facade.d.ts +1 -0
  7. package/lib/core/+state/users/users.effects.d.ts +7 -2
  8. package/lib/core/components/auto-form/interfaces/form-field-others.d.ts +11 -0
  9. package/lib/core/components/auto-form/interfaces/form-field.d.ts +3 -0
  10. package/lib/core/components/external-services/external-service-dialog.component.d.ts +15 -0
  11. package/lib/core/components/external-services/external-service.models.d.ts +19 -0
  12. package/lib/core/components/external-services/external-services.facade.d.ts +23 -0
  13. package/lib/core/components/external-services/index.d.ts +3 -0
  14. package/lib/core/components/image/image.component.d.ts +6 -1
  15. package/lib/core/components/index.d.ts +4 -0
  16. package/lib/core/components/profile/profile.component.d.ts +29 -0
  17. package/lib/core/components/profile/profile.module.d.ts +12 -0
  18. package/lib/core/components/static-data/boards/board-edit-dialog.component.d.ts +22 -0
  19. package/lib/core/components/static-data/boards/board-filter.component.d.ts +55 -0
  20. package/lib/core/components/static-data/boards/board-settings-dialog.component.d.ts +41 -0
  21. package/lib/core/components/static-data/boards/board.models.d.ts +28 -0
  22. package/lib/core/components/static-data/boards/boards.facade.d.ts +17 -0
  23. package/lib/core/components/static-data/boards/index.d.ts +6 -0
  24. package/lib/core/components/static-data/boards/kanban.component.d.ts +24 -0
  25. package/lib/core/components/static-data/components/filtering-dialog/filtering-dialog.component.d.ts +6 -3
  26. package/lib/core/components/static-data/components/static-data-list-items/column-preferences.d.ts +6 -0
  27. package/lib/core/components/static-data/components/static-data-list-items/group-nested-items.d.ts +6 -0
  28. package/lib/core/components/static-data/components/static-data-list-items/static-data-list-items.component.d.ts +74 -12
  29. package/lib/core/components/static-data/components/static-data-list-items/visible-nested-rows.d.ts +4 -0
  30. package/lib/core/components/static-data/containers/static-data-items/column-filter.component.d.ts +26 -0
  31. package/lib/core/components/static-data/containers/static-data-items/column-resize.directive.d.ts +26 -0
  32. package/lib/core/components/static-data/containers/static-data-items/static-data-items.component.d.ts +9 -1
  33. package/lib/core/components/static-data/containers/static-data-list/static-data-list.component.d.ts +13 -4
  34. package/lib/core/components/static-data/interfaces/static-data.interface.d.ts +17 -1
  35. package/lib/core/components/static-data/presets/index.d.ts +4 -0
  36. package/lib/core/components/static-data/presets/preset.models.d.ts +10 -0
  37. package/lib/core/components/static-data/presets/presets.component.d.ts +29 -0
  38. package/lib/core/components/static-data/presets/presets.facade.d.ts +13 -0
  39. package/lib/core/components/static-data/presets/save-preset-dialog.component.d.ts +23 -0
  40. package/lib/core/interceptors/headers.interceptor.d.ts +1 -0
  41. package/lib/core/services/static-data/static-data.service.d.ts +2 -0
  42. package/lib/core/utils/index.d.ts +1 -0
  43. package/lib/core/utils/user-profile.helper.d.ts +76 -0
  44. package/lib/models/endpoints/static-data/board-settings-request.d.ts +28 -0
  45. package/lib/models/endpoints/static-data/index.d.ts +2 -0
  46. package/lib/models/endpoints/static-data/preset-settings-request.d.ts +28 -0
  47. package/lib/models/endpoints/static-data/static-data-endpoint-types.d.ts +4 -0
  48. package/lib/models/endpoints/static-data/static-data-get-list/request/static-data-get-list-request-config.d.ts +1 -0
  49. package/lib/models/models/user/user-model.d.ts +1 -0
  50. package/package.json +1 -1
  51. package/public-api.d.ts +4 -0
package/README.md CHANGED
@@ -1,24 +1,83 @@
1
- # WtFrontShared
1
+ # wt-front-shared
2
2
 
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.1.0.
3
+ Angular 19 library with shared admin-panel building blocks:
4
4
 
5
- ## Code scaffolding
5
+ - **NgRx state** (`SharedReducer`, `sharedEffects`, facades such as `StaticDataFacade`, `UsersFacade`, `FormsFacade`, `NotificationsFacade`)
6
+ - **auto-form** — config-driven forms (`<shared-auto-form>`, `<shared-auto-form-show>`, `IFormField`, `FieldType`)
7
+ - **static-data** — config-driven CRUD pages (`StaticDataModule` with list / edit / view routes)
8
+ - **HTTP layer** — API services, `JwtInterceptor`, `HeadersInterceptor`, `AuthenticationService`
9
+ - UI components (`shared-button`, `shared-spinner`, `shared-files-upload`, dialogs, pipes, animations)
6
10
 
7
- Run `ng generate component component-name --project wt-front-shared` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project wt-front-shared`.
8
- > Note: Don't forget to add `--project wt-front-shared` or else it will be added to the default project in your `angular.json` file.
11
+ Full documentation (one README per folder) lives in the source repository: start with `CLAUDE.md` in the repo root.
9
12
 
10
- ## Build
13
+ ## Install
11
14
 
12
- Run `ng build wt-front-shared` to build the project. The build artifacts will be stored in the `dist/` directory.
15
+ The app must provide these packages (only `@angular/common`, `@angular/core`, `rxjs` and `object-hash` are declared as peer dependencies; the rest are imported by the library code): `@angular/*` 19, `@angular/material` 19, `@ngrx/*` 19, `rxjs` 7, `ngx-toastr`, `ngx-cookie-service`, `ngx-mask`, `ngx-mat-select-search`, `ng2-file-upload`, `driver.js`, `dayjs`, `object-hash`, `lodash`, `ckeditor5` (lazy-loaded).
13
16
 
14
- ## Publishing
17
+ ## Setup in an app
15
18
 
16
- After building your library with `ng build wt-front-shared`, go to the dist folder `cd dist/wt-front-shared` and run `npm publish`.
19
+ ```ts
20
+ import {
21
+ CORE_CONFIG, HeadersInterceptor, JwtInterceptor, SharedReducer, sharedEffects, WtFrontSharedModule,
22
+ } from 'wt-front-shared';
17
23
 
18
- ## Running unit tests
24
+ const appConfig = {
25
+ apiUrl: environment.apiUrl, // requests go to `${apiUrl}/api/...`
26
+ publicUrl: environment.publicUrl,
27
+ tokenCookiesName: {accessToken: '', refreshAccessToken: ''}, // always define this object
28
+ staticDataMapping: MapFiles, // {[contentType]: StaticDataSection} for static-data pages
29
+ staticDataConfig: StaticData, // {[name]: {key, store}}
30
+ env: environment.env, // 'development' logs all NgRx actions
31
+ };
19
32
 
20
- Run `ng test wt-front-shared` to execute the unit tests via [Karma](https://karma-runner.github.io).
33
+ @NgModule({
34
+ imports: [
35
+ BrowserAnimationsModule,
36
+ StoreModule.forRoot({...SharedReducer}),
37
+ EffectsModule.forRoot([...sharedEffects]),
38
+ StoreRouterConnectingModule.forRoot(),
39
+ ToastrModule.forRoot(),
40
+ WtFrontSharedModule,
41
+ ],
42
+ providers: [
43
+ provideHttpClient(withInterceptorsFromDi()),
44
+ {provide: CORE_CONFIG, useValue: appConfig},
45
+ {provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true},
46
+ {provide: HTTP_INTERCEPTORS, useClass: HeadersInterceptor, multi: true},
47
+ ],
48
+ })
49
+ export class AppModule {}
21
50
 
22
- ## Further help
51
+ // routes: generic CRUD pages at /static-data/:contentType, /static-data/:contentType/:id, /static-data/:contentType/:id/view
52
+ {path: 'static-data', loadChildren: () => import('wt-front-shared').then(m => m.StaticDataModule)}
53
+ ```
23
54
 
24
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
55
+ ## Minimal form example
56
+
57
+ ```ts
58
+ fields: IFormField[] = [
59
+ {field: 'id', title: 'ID', type: FieldType.FieldTypeInput, options: {notEditable: true}},
60
+ {field: 'name', title: 'Name', type: FieldType.FieldTypeInput, validators: [ValidatorsType.Required], options: {}},
61
+ ];
62
+ form = this.fb.group(this.autoFormService.getPreparedFields(this.fields));
63
+
64
+ save() {
65
+ this.staticDataFacade.update(this.formId, 'countries', this.id, this.form.value);
66
+ }
67
+ ```
68
+
69
+ ```html
70
+ <shared-auto-form [fields]="fields" [form]="form" [formId]="formId" entity="countries" [itemId]="id">
71
+ <button submitButton (click)="save()">Save</button>
72
+ </shared-auto-form>
73
+ ```
74
+
75
+ Import `AutoFormModule` in the module that declares the component. Always give every field an `options` object.
76
+
77
+ ## Develop the library
78
+
79
+ ```bash
80
+ npm run build # dist/wt-front-shared
81
+ npm run build-prod # build + global styles.css
82
+ npm run publish # publish dist/wt-front-shared
83
+ ```