@wawjs/ngx-bos 22.0.3 → 22.0.5

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 (29) hide show
  1. package/AGENTS.md +4 -0
  2. package/README.md +10 -3
  3. package/RELEASES.md +46 -19
  4. package/ai/decisions/2026-06-02-version-start.md +1 -1
  5. package/fesm2022/wawjs-ngx-bos-ngx-bos.config-B6tWU_X3.mjs +29 -0
  6. package/fesm2022/wawjs-ngx-bos-ngx-bos.config-B6tWU_X3.mjs.map +1 -0
  7. package/fesm2022/wawjs-ngx-bos-user.service-BL0vq7J4.mjs +181 -0
  8. package/fesm2022/wawjs-ngx-bos-user.service-BL0vq7J4.mjs.map +1 -0
  9. package/fesm2022/wawjs-ngx-bos.mjs +3063 -2293
  10. package/fesm2022/wawjs-ngx-bos.mjs.map +1 -1
  11. package/package.json +10 -10
  12. package/src/feature/file/file.component.ts +239 -236
  13. package/src/feature/file/file.service.ts +36 -35
  14. package/src/feature/file/pages/files/files.component.html +12 -12
  15. package/src/feature/file/pages/files/files.component.ts +116 -117
  16. package/src/feature/user/guards/admins.guard.ts +21 -28
  17. package/src/feature/user/guards/authenticated.guard.ts +15 -22
  18. package/src/feature/user/guards/guest.guard.ts +15 -15
  19. package/src/feature/user/pages/users/users.component.html +3 -3
  20. package/src/feature/user/pages/users/users.component.scss +12 -12
  21. package/src/feature/user/pages/users/users.component.ts +43 -47
  22. package/src/feature/user/user.service.ts +7 -22
  23. package/src/feature/user/user.storage.ts +31 -0
  24. package/src/icons/spider/spider.component.ts +4 -4
  25. package/src/ngx-bos.config.ts +1 -1
  26. package/src/pages/form/form.component.ts +100 -86
  27. package/src/pages/forms/forms.component.ts +9 -22
  28. package/src/public-api.ts +1 -1
  29. package/types/wawjs-ngx-bos.d.ts +402 -305
@@ -1,86 +1,100 @@
1
- import { Component, effect, inject } from '@angular/core';
2
- import { Router } from '@angular/router';
3
- import { TableComponent } from '@wawjs/ngx-ui';
4
- import {
5
- Formcomponent,
6
- FormcomponentService,
7
- formcomponentForm,
8
- FormInterface,
9
- FormService,
10
- } from '@wawjs/ngx-form';
11
- import { CrudComponent } from '@wawjs/ngx-crud';
12
- import { FORM_COMPONENT_FORM } from '../../form-components';
13
- import { NGX_BOS_CONFIG } from '../../ngx-bos.config';
14
-
15
- @Component({
16
- imports: [TableComponent],
17
- templateUrl: './form.component.html',
18
- })
19
- export class FormComponent extends CrudComponent<
20
- FormcomponentService,
21
- Formcomponent,
22
- FormInterface
23
- > {
24
- private _router = inject(Router);
25
- private _bosConfig = inject(NGX_BOS_CONFIG);
26
-
27
- readonly formId = this._router.url.split('form/')[1];
28
-
29
- protected override configType: 'server' | 'local' = 'local';
30
-
31
- protected override preCreate(doc: Formcomponent) {
32
- doc.formId = this.formId;
33
-
34
- doc.appId = this._bosConfig.appId;
35
- }
36
-
37
- protected override localDocumentsFilter = (doc: Formcomponent) => {
38
- return doc.formId === this.formId;
39
- };
40
-
41
- protected override allowUrl() {
42
- return false;
43
- }
44
-
45
- /** Basic columns for clients table */
46
- columns = ['name', 'key'];
47
-
48
- /** wtable config built by CrudComponent, aware of server mode */
49
- config = this.getConfig();
50
-
51
- constructor() {
52
- const formcomponentService = inject(FormcomponentService);
53
- const formService = inject(FormService);
54
-
55
- super(formcomponentForm, formService, formcomponentService, 'user');
56
-
57
- effect(() => {
58
- if (formcomponentService.isLoaded()) {
59
- this.setDocuments();
60
- }
61
- });
62
-
63
- this.config.buttons.unshift({
64
- icon: 'settings',
65
- click: (doc: Formcomponent) => {
66
- formService.modal<Record<string, unknown>>(
67
- FORM_COMPONENT_FORM(doc.name),
68
- {
69
- label: 'Update',
70
- click: async (updated: unknown, close: () => void) => {
71
- close();
72
-
73
- doc.props = {
74
- ...doc.props,
75
- ...(updated as object),
76
- };
77
-
78
- formcomponentService.update(doc);
79
- },
80
- },
81
- doc.props || {},
82
- );
83
- },
84
- });
85
- }
86
- }
1
+ import { Component, computed, effect, inject } from '@angular/core';
2
+ import { toSignal } from '@angular/core/rxjs-interop';
3
+ import { ActivatedRoute } from '@angular/router';
4
+ import { TableComponent } from '@wawjs/ngx-ui';
5
+ import {
6
+ Formcomponent,
7
+ FormcomponentService,
8
+ formcomponentForm,
9
+ FormInterface,
10
+ FormService,
11
+ } from '@wawjs/ngx-form';
12
+ import { CrudComponent } from '@wawjs/ngx-crud';
13
+ import { FORM_COMPONENT_FORM } from '../../form-components';
14
+ import { NGX_BOS_CONFIG } from '../../ngx-bos.config';
15
+
16
+ @Component({
17
+ imports: [TableComponent],
18
+ templateUrl: './form.component.html',
19
+ })
20
+ export class FormComponent extends CrudComponent<
21
+ FormcomponentService,
22
+ Formcomponent,
23
+ FormInterface
24
+ > {
25
+ private _route = inject(ActivatedRoute);
26
+ private _bosConfig = inject(NGX_BOS_CONFIG);
27
+
28
+ private readonly _params = toSignal(this._route.paramMap, {
29
+ initialValue: this._route.snapshot.paramMap,
30
+ });
31
+
32
+ /** Current `:formId` route param; updates when navigating between forms. */
33
+ readonly formId = computed(() => this._params().get('formId') || '');
34
+
35
+ protected override configType: 'server' | 'local' = 'local';
36
+
37
+ protected override preCreate(doc: Formcomponent) {
38
+ doc.formId = this.formId();
39
+
40
+ doc.appId = this._bosConfig.appId;
41
+ }
42
+
43
+ protected override localDocumentsFilter = (doc: Formcomponent) => {
44
+ return doc.formId === this.formId();
45
+ };
46
+
47
+ protected override allowUrl() {
48
+ return false;
49
+ }
50
+
51
+ /** Basic columns for clients table */
52
+ columns = ['name', 'key'];
53
+
54
+ /** wtable config built by CrudComponent, aware of server mode */
55
+ config = this.getConfig();
56
+
57
+ constructor() {
58
+ const formcomponentService = inject(FormcomponentService);
59
+ const formService = inject(FormService);
60
+
61
+ super(
62
+ formcomponentForm,
63
+ formService,
64
+ formcomponentService,
65
+ 'formcomponent',
66
+ );
67
+
68
+ effect(() => {
69
+ // Re-filter when the route's formId changes (component is reused).
70
+ this.formId();
71
+
72
+ if (formcomponentService.isLoaded()) {
73
+ this.setDocuments();
74
+ }
75
+ });
76
+
77
+ this.config.buttons.unshift({
78
+ icon: 'settings',
79
+ click: (doc: Formcomponent) => {
80
+ formService.modal<Record<string, unknown>>(
81
+ FORM_COMPONENT_FORM(doc.name),
82
+ {
83
+ label: 'Update',
84
+ click: async (updated: unknown, close: () => void) => {
85
+ close();
86
+
87
+ doc.props = {
88
+ ...doc.props,
89
+ ...(updated as object),
90
+ };
91
+
92
+ formcomponentService.update(doc);
93
+ },
94
+ },
95
+ doc.props || {},
96
+ );
97
+ },
98
+ });
99
+ }
100
+ }
@@ -1,9 +1,4 @@
1
- import {
2
- Component,
3
- effect,
4
- inject,
5
- signal,
6
- } from '@angular/core';
1
+ import { Component, computed, inject } from '@angular/core';
7
2
  import { Form, formForm, FormService } from '@wawjs/ngx-form';
8
3
  import { TableComponent } from '@wawjs/ngx-ui';
9
4
  import { NGX_BOS_CONFIG } from '../../ngx-bos.config';
@@ -56,22 +51,14 @@ export class FormsComponent {
56
51
  ],
57
52
  };
58
53
 
59
- documents = signal<Form[]>([]);
54
+ readonly documents = computed<Form[]>(() => {
55
+ const byFormId = this._formService.getFieldSignals('formId')();
60
56
 
61
- constructor() {
62
- effect(() => {
63
- const byFormId = this._formService.getFieldSignals('formId')();
64
-
65
- this.documents.set(
66
- this._formService.formIds().map((formId) => {
67
- return {
68
- formId,
69
- ...(byFormId[formId]?.length
70
- ? byFormId[formId][0]()
71
- : {}),
72
- } as Form;
73
- }),
74
- );
57
+ return this._formService.formIds().map((formId) => {
58
+ return {
59
+ formId,
60
+ ...(byFormId[formId]?.length ? byFormId[formId][0]() : {}),
61
+ } as Form;
75
62
  });
76
- }
63
+ });
77
64
  }
package/src/public-api.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * the source app into the package.
6
6
  */
7
7
 
8
- export const NGX_BOS_VERSION = '22.0.2' as const;
8
+ export const NGX_BOS_VERSION = '22.0.4' as const;
9
9
 
10
10
  export type NgxBosVersion = typeof NGX_BOS_VERSION;
11
11