wt-front-shared 19.0.43 → 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.
- package/README.md +72 -13
- package/fesm2022/wt-front-shared.mjs +3932 -805
- package/fesm2022/wt-front-shared.mjs.map +1 -1
- package/lib/core/+state/form-validation/form-validation.effects.d.ts +2 -2
- package/lib/core/+state/router/router.effects.d.ts +1 -1
- package/lib/core/+state/static-data/static-data.actions.d.ts +1 -0
- package/lib/core/+state/static-data/static-data.facade.d.ts +1 -0
- package/lib/core/+state/users/users.effects.d.ts +7 -2
- package/lib/core/components/auto-form/auto-form.module.d.ts +29 -26
- package/lib/core/components/auto-form/components/form-field-date/form-field-date.component.d.ts +53 -0
- package/lib/core/components/auto-form/interfaces/field-type.d.ts +2 -0
- package/lib/core/components/auto-form/interfaces/form-field-others.d.ts +11 -0
- package/lib/core/components/auto-form/interfaces/form-field.d.ts +3 -0
- package/lib/core/components/external-services/external-service-dialog.component.d.ts +15 -0
- package/lib/core/components/external-services/external-service.models.d.ts +19 -0
- package/lib/core/components/external-services/external-services.facade.d.ts +23 -0
- package/lib/core/components/external-services/index.d.ts +3 -0
- package/lib/core/components/image/image.component.d.ts +6 -1
- package/lib/core/components/index.d.ts +4 -0
- package/lib/core/components/profile/profile.component.d.ts +29 -0
- package/lib/core/components/profile/profile.module.d.ts +12 -0
- package/lib/core/components/static-data/boards/board-edit-dialog.component.d.ts +22 -0
- package/lib/core/components/static-data/boards/board-filter.component.d.ts +55 -0
- package/lib/core/components/static-data/boards/board-settings-dialog.component.d.ts +41 -0
- package/lib/core/components/static-data/boards/board.models.d.ts +28 -0
- package/lib/core/components/static-data/boards/boards.facade.d.ts +17 -0
- package/lib/core/components/static-data/boards/index.d.ts +6 -0
- package/lib/core/components/static-data/boards/kanban.component.d.ts +24 -0
- package/lib/core/components/static-data/components/filtering-dialog/filtering-dialog.component.d.ts +6 -3
- package/lib/core/components/static-data/components/static-data-list-items/column-preferences.d.ts +6 -0
- package/lib/core/components/static-data/components/static-data-list-items/group-nested-items.d.ts +6 -0
- package/lib/core/components/static-data/components/static-data-list-items/static-data-list-items.component.d.ts +74 -12
- package/lib/core/components/static-data/components/static-data-list-items/visible-nested-rows.d.ts +4 -0
- package/lib/core/components/static-data/containers/static-data-items/column-filter.component.d.ts +26 -0
- package/lib/core/components/static-data/containers/static-data-items/column-resize.directive.d.ts +26 -0
- package/lib/core/components/static-data/containers/static-data-items/static-data-items.component.d.ts +9 -1
- package/lib/core/components/static-data/containers/static-data-list/static-data-list.component.d.ts +13 -4
- package/lib/core/components/static-data/interfaces/static-data.interface.d.ts +17 -1
- package/lib/core/components/static-data/presets/index.d.ts +4 -0
- package/lib/core/components/static-data/presets/preset.models.d.ts +10 -0
- package/lib/core/components/static-data/presets/presets.component.d.ts +29 -0
- package/lib/core/components/static-data/presets/presets.facade.d.ts +13 -0
- package/lib/core/components/static-data/presets/save-preset-dialog.component.d.ts +23 -0
- package/lib/core/interceptors/headers.interceptor.d.ts +1 -0
- package/lib/core/services/static-data/static-data.service.d.ts +2 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/user-profile.helper.d.ts +76 -0
- package/lib/models/endpoints/static-data/board-settings-request.d.ts +28 -0
- package/lib/models/endpoints/static-data/index.d.ts +2 -0
- package/lib/models/endpoints/static-data/preset-settings-request.d.ts +28 -0
- package/lib/models/endpoints/static-data/static-data-endpoint-types.d.ts +4 -0
- package/lib/models/endpoints/static-data/static-data-get-list/request/static-data-get-list-request-config.d.ts +1 -0
- package/lib/models/models/user/user-model.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +4 -0
package/README.md
CHANGED
|
@@ -1,24 +1,83 @@
|
|
|
1
|
-
#
|
|
1
|
+
# wt-front-shared
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Angular 19 library with shared admin-panel building blocks:
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
13
|
+
## Install
|
|
11
14
|
|
|
12
|
-
|
|
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
|
-
##
|
|
17
|
+
## Setup in an app
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
```ts
|
|
20
|
+
import {
|
|
21
|
+
CORE_CONFIG, HeadersInterceptor, JwtInterceptor, SharedReducer, sharedEffects, WtFrontSharedModule,
|
|
22
|
+
} from 'wt-front-shared';
|
|
17
23
|
|
|
18
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
+
```
|