@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.
- package/AGENTS.md +4 -0
- package/README.md +10 -3
- package/RELEASES.md +46 -19
- package/ai/decisions/2026-06-02-version-start.md +1 -1
- package/fesm2022/wawjs-ngx-bos-ngx-bos.config-B6tWU_X3.mjs +29 -0
- package/fesm2022/wawjs-ngx-bos-ngx-bos.config-B6tWU_X3.mjs.map +1 -0
- package/fesm2022/wawjs-ngx-bos-user.service-BL0vq7J4.mjs +181 -0
- package/fesm2022/wawjs-ngx-bos-user.service-BL0vq7J4.mjs.map +1 -0
- package/fesm2022/wawjs-ngx-bos.mjs +3063 -2293
- package/fesm2022/wawjs-ngx-bos.mjs.map +1 -1
- package/package.json +10 -10
- package/src/feature/file/file.component.ts +239 -236
- package/src/feature/file/file.service.ts +36 -35
- package/src/feature/file/pages/files/files.component.html +12 -12
- package/src/feature/file/pages/files/files.component.ts +116 -117
- package/src/feature/user/guards/admins.guard.ts +21 -28
- package/src/feature/user/guards/authenticated.guard.ts +15 -22
- package/src/feature/user/guards/guest.guard.ts +15 -15
- package/src/feature/user/pages/users/users.component.html +3 -3
- package/src/feature/user/pages/users/users.component.scss +12 -12
- package/src/feature/user/pages/users/users.component.ts +43 -47
- package/src/feature/user/user.service.ts +7 -22
- package/src/feature/user/user.storage.ts +31 -0
- package/src/icons/spider/spider.component.ts +4 -4
- package/src/ngx-bos.config.ts +1 -1
- package/src/pages/form/form.component.ts +100 -86
- package/src/pages/forms/forms.component.ts +9 -22
- package/src/public-api.ts +1 -1
- package/types/wawjs-ngx-bos.d.ts +402 -305
|
@@ -1,86 +1,100 @@
|
|
|
1
|
-
import { Component, effect, inject } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
private
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
protected override
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
doc.
|
|
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 =
|
|
54
|
+
readonly documents = computed<Form[]>(() => {
|
|
55
|
+
const byFormId = this._formService.getFieldSignals('formId')();
|
|
60
56
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
}
|