@wawjs/ngx-bos 22.0.0 → 22.0.2
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 +23 -23
- package/README.md +105 -105
- package/RELEASES.md +41 -15
- package/ai/architecture.md +40 -40
- package/ai/code-style.md +33 -33
- package/ai/decisions/2026-06-02-browser-only-bos-spa.md +16 -16
- package/ai/decisions/2026-06-02-package-boundary.md +22 -22
- package/ai/decisions/2026-06-02-version-start.md +12 -12
- package/ai/decisions/index.md +7 -7
- package/ai/onboarding.md +19 -19
- package/ai/task-execution.md +35 -35
- package/ai/tooling.md +33 -33
- package/fesm2022/wawjs-ngx-bos.mjs +138 -98
- package/fesm2022/wawjs-ngx-bos.mjs.map +1 -1
- package/package.json +1 -1
- package/src/feature/file/file.component.html +1 -1
- package/src/feature/file/file.component.ts +236 -220
- package/src/feature/file/file.interface.ts +12 -12
- package/src/feature/file/file.service.ts +35 -34
- package/src/feature/file/pages/files/files.component.html +2 -2
- package/src/feature/file/pages/files/files.component.ts +117 -117
- package/src/feature/file/pages/files/files.routes.ts +9 -9
- package/src/feature/file/selectors/file/file-selector.component.html +2 -5
- package/src/feature/file/selectors/file/file-selector.component.ts +24 -27
- package/src/feature/user/guards/admins.guard.ts +22 -22
- package/src/feature/user/guards/authenticated.guard.ts +14 -14
- package/src/feature/user/guards/guest.guard.ts +14 -14
- package/src/feature/user/pages/clients/clients.component.ts +45 -45
- package/src/feature/user/pages/clients/clients.routes.ts +1 -1
- package/src/feature/user/pages/users/users.component.html +3 -2
- package/src/feature/user/pages/users/users.component.scss +12 -0
- package/src/feature/user/pages/users/users.component.ts +78 -45
- package/src/feature/user/pages/users/users.routes.ts +1 -1
- package/src/feature/user/selectors/user/user-selector.component.ts +17 -17
- package/src/feature/user/user.const.ts +3 -3
- package/src/feature/user/user.form.ts +54 -54
- package/src/feature/user/user.interface.ts +12 -12
- package/src/feature/user/user.service.ts +178 -176
- package/src/form-components/ace/ace.component.ts +210 -210
- package/src/form-components/button/button.component.ts +31 -31
- package/src/form-components/file/file.component.ts +91 -91
- package/src/form-components/form-bridge.interface.ts +27 -27
- package/src/form-components/index.ts +85 -85
- package/src/form-components/input/input.component.html +1 -0
- package/src/form-components/input/input.component.ts +31 -31
- package/src/form-components/select/select.component.html +2 -2
- package/src/form-components/select/select.component.ts +31 -31
- package/src/form-components/tinymce/tinymce.component.ts +221 -221
- package/src/ngx-bos.config.ts +55 -55
- package/src/pages/form/form.component.ts +86 -86
- package/src/pages/form/form.routes.ts +1 -1
- package/src/pages/forms/forms.component.ts +15 -15
- package/src/pages/forms/forms.routes.ts +1 -1
- package/src/pipes/phone.pipe.ts +17 -17
- package/src/public-api.ts +36 -36
- package/types/wawjs-ngx-bos.d.ts +13 -9
|
@@ -1,57 +1,90 @@
|
|
|
1
|
-
import { Component, inject } from '@angular/core';
|
|
2
|
-
import { Router } from '@angular/router';
|
|
3
|
-
import { FormInterface, FormService } from '@wawjs/ngx-form';
|
|
4
|
-
import { CrudComponent } from '@wawjs/ngx-crud';
|
|
5
|
-
import { CellDirective, InputComponent, TableComponent } from '@wawjs/ngx-ui';
|
|
6
|
-
import { userFormComponentsFactory } from '../../user.form';
|
|
7
|
-
import { User } from '../../user.interface';
|
|
8
|
-
import { UserService } from '../../user.service';
|
|
9
|
-
|
|
10
|
-
@Component({
|
|
1
|
+
import { Component, inject } from '@angular/core';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
3
|
+
import { FormInterface, FormService } from '@wawjs/ngx-form';
|
|
4
|
+
import { CrudComponent } from '@wawjs/ngx-crud';
|
|
5
|
+
import { CellDirective, InputComponent, TableComponent } from '@wawjs/ngx-ui';
|
|
6
|
+
import { userFormComponentsFactory } from '../../user.form';
|
|
7
|
+
import { User } from '../../user.interface';
|
|
8
|
+
import { UserService } from '../../user.service';
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
11
|
imports: [TableComponent, CellDirective, InputComponent],
|
|
12
12
|
templateUrl: './users.component.html',
|
|
13
|
+
styleUrl: './users.component.scss',
|
|
13
14
|
})
|
|
14
|
-
export class UsersComponent extends CrudComponent<
|
|
15
|
-
UserService,
|
|
16
|
-
User,
|
|
17
|
-
FormInterface
|
|
18
|
-
> {
|
|
15
|
+
export class UsersComponent extends CrudComponent<
|
|
16
|
+
UserService,
|
|
17
|
+
User,
|
|
18
|
+
FormInterface
|
|
19
|
+
> {
|
|
19
20
|
protected override configType: 'server' | 'local' = 'local';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
private readonly _formService = inject(FormService);
|
|
22
|
+
|
|
23
|
+
protected override allowUrl(): boolean {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
|
|
25
27
|
protected override async delete(doc: User) {
|
|
26
|
-
this.userService.deleteAdmin(doc).subscribe(() => {
|
|
27
|
-
this.setDocuments();
|
|
28
|
-
});
|
|
28
|
+
this.userService.deleteAdmin(doc).subscribe(() => {
|
|
29
|
+
this.setDocuments();
|
|
30
|
+
});
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
columns = ['name', 'email'];
|
|
40
|
-
|
|
41
|
-
config = this.getConfig();
|
|
33
|
+
protected override update(doc: User): void {
|
|
34
|
+
if (this.form.formId) {
|
|
35
|
+
this._formService.reset(
|
|
36
|
+
this.form.formId,
|
|
37
|
+
doc as unknown as Record<string, unknown>,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
this._formService.modal(
|
|
42
|
+
this.form,
|
|
43
|
+
{
|
|
44
|
+
label: 'Update',
|
|
45
|
+
click: (updated: unknown, close: () => void) => {
|
|
46
|
+
close();
|
|
47
|
+
Object.assign(doc, updated as User);
|
|
48
|
+
this.userService.updateAdmin(doc).subscribe(() => {
|
|
49
|
+
this.setDocuments();
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
doc,
|
|
49
54
|
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private _router = inject(Router);
|
|
58
|
+
|
|
59
|
+
userService = inject(UserService);
|
|
60
|
+
|
|
61
|
+
readonly roles = this._router.url.includes('admin')
|
|
62
|
+
? this.userService.roles
|
|
63
|
+
: this.userService.employees;
|
|
64
|
+
|
|
65
|
+
columns = ['name', 'email'];
|
|
66
|
+
|
|
67
|
+
config = this.getConfig();
|
|
68
|
+
|
|
69
|
+
constructor() {
|
|
70
|
+
super(
|
|
71
|
+
userFormComponentsFactory(),
|
|
72
|
+
inject(FormService),
|
|
73
|
+
inject(UserService),
|
|
74
|
+
'user',
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
this.setDocuments();
|
|
78
|
+
|
|
79
|
+
for (const role of this.userService.roles) {
|
|
80
|
+
this.columns.push(role);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
50
83
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.
|
|
55
|
-
}
|
|
84
|
+
updateRole(user: User, role: string, value: boolean): void {
|
|
85
|
+
user.is[role] = value;
|
|
86
|
+
this.userService.updateAdmin(user).subscribe(() => {
|
|
87
|
+
this.setDocuments();
|
|
88
|
+
});
|
|
56
89
|
}
|
|
57
90
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Component, inject, input, output } from '@angular/core';
|
|
2
|
-
import { SelectComponent, SelectValue } from '@wawjs/ngx-ui';
|
|
3
|
-
import { UserService } from '../../user.service';
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
imports: [SelectComponent],
|
|
7
|
-
selector: 'user-selector',
|
|
8
|
-
templateUrl: './user-selector.component.html',
|
|
9
|
-
styleUrl: './user-selector.component.scss',
|
|
10
|
-
})
|
|
11
|
-
export class UserSelectorComponent {
|
|
12
|
-
userService = inject(UserService);
|
|
13
|
-
|
|
14
|
-
value = input('');
|
|
15
|
-
|
|
16
|
-
onChange = output<SelectValue>();
|
|
17
|
-
}
|
|
1
|
+
import { Component, inject, input, output } from '@angular/core';
|
|
2
|
+
import { SelectComponent, SelectValue } from '@wawjs/ngx-ui';
|
|
3
|
+
import { UserService } from '../../user.service';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
imports: [SelectComponent],
|
|
7
|
+
selector: 'user-selector',
|
|
8
|
+
templateUrl: './user-selector.component.html',
|
|
9
|
+
styleUrl: './user-selector.component.scss',
|
|
10
|
+
})
|
|
11
|
+
export class UserSelectorComponent {
|
|
12
|
+
userService = inject(UserService);
|
|
13
|
+
|
|
14
|
+
value = input('');
|
|
15
|
+
|
|
16
|
+
onChange = output<SelectValue>();
|
|
17
|
+
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { inject } from '@angular/core';
|
|
2
|
-
import { FormComponentInterface } from '@wawjs/ngx-form';
|
|
3
|
-
import { NGX_BOS_CONFIG } from '../../ngx-bos.config';
|
|
4
|
-
|
|
5
|
-
export const createUserFormComponents = (
|
|
6
|
-
userForm: FormComponentInterface[] = [],
|
|
7
|
-
) => ({
|
|
8
|
-
formId: 'user',
|
|
9
|
-
title: 'Profile Settings',
|
|
10
|
-
components: [
|
|
11
|
-
{
|
|
12
|
-
name: 'Input',
|
|
13
|
-
key: 'name',
|
|
14
|
-
focused: true,
|
|
15
|
-
props: {
|
|
16
|
-
placeholder: 'Enter name...',
|
|
17
|
-
label: 'Name',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: 'Input',
|
|
22
|
-
key: 'email',
|
|
23
|
-
props: {
|
|
24
|
-
placeholder: 'Enter email...',
|
|
25
|
-
label: 'Email',
|
|
26
|
-
type: 'email',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'Input',
|
|
31
|
-
key: 'phone',
|
|
32
|
-
props: {
|
|
33
|
-
placeholder: 'Enter phone...',
|
|
34
|
-
label: 'Phone',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'Input',
|
|
39
|
-
key: 'bio',
|
|
40
|
-
props: {
|
|
41
|
-
placeholder: 'Enter bio...',
|
|
42
|
-
label: 'Biography',
|
|
43
|
-
type: 'textarea',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
...userForm,
|
|
47
|
-
],
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
export const userFormComponentsFactory = () => {
|
|
51
|
-
const config = inject(NGX_BOS_CONFIG);
|
|
52
|
-
|
|
53
|
-
return createUserFormComponents(config.userForm);
|
|
54
|
-
};
|
|
1
|
+
import { inject } from '@angular/core';
|
|
2
|
+
import { FormComponentInterface } from '@wawjs/ngx-form';
|
|
3
|
+
import { NGX_BOS_CONFIG } from '../../ngx-bos.config';
|
|
4
|
+
|
|
5
|
+
export const createUserFormComponents = (
|
|
6
|
+
userForm: FormComponentInterface[] = [],
|
|
7
|
+
) => ({
|
|
8
|
+
formId: 'user',
|
|
9
|
+
title: 'Profile Settings',
|
|
10
|
+
components: [
|
|
11
|
+
{
|
|
12
|
+
name: 'Input',
|
|
13
|
+
key: 'name',
|
|
14
|
+
focused: true,
|
|
15
|
+
props: {
|
|
16
|
+
placeholder: 'Enter name...',
|
|
17
|
+
label: 'Name',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Input',
|
|
22
|
+
key: 'email',
|
|
23
|
+
props: {
|
|
24
|
+
placeholder: 'Enter email...',
|
|
25
|
+
label: 'Email',
|
|
26
|
+
type: 'email',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Input',
|
|
31
|
+
key: 'phone',
|
|
32
|
+
props: {
|
|
33
|
+
placeholder: 'Enter phone...',
|
|
34
|
+
label: 'Phone',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'Input',
|
|
39
|
+
key: 'bio',
|
|
40
|
+
props: {
|
|
41
|
+
placeholder: 'Enter bio...',
|
|
42
|
+
label: 'Biography',
|
|
43
|
+
type: 'textarea',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
...userForm,
|
|
47
|
+
],
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const userFormComponentsFactory = () => {
|
|
51
|
+
const config = inject(NGX_BOS_CONFIG);
|
|
52
|
+
|
|
53
|
+
return createUserFormComponents(config.userForm);
|
|
54
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CrudDocument } from '@wawjs/ngx-crud';
|
|
2
|
-
|
|
3
|
-
export interface User extends CrudDocument<User> {
|
|
4
|
-
data: Record<string, unknown>;
|
|
5
|
-
is: Record<string, boolean>;
|
|
6
|
-
roles: string[];
|
|
7
|
-
name: string;
|
|
8
|
-
phone: string;
|
|
9
|
-
bio: string;
|
|
10
|
-
email: string;
|
|
11
|
-
thumb: string;
|
|
12
|
-
}
|
|
1
|
+
import { CrudDocument } from '@wawjs/ngx-crud';
|
|
2
|
+
|
|
3
|
+
export interface User extends CrudDocument<User> {
|
|
4
|
+
data: Record<string, unknown>;
|
|
5
|
+
is: Record<string, boolean>;
|
|
6
|
+
roles: string[];
|
|
7
|
+
name: string;
|
|
8
|
+
phone: string;
|
|
9
|
+
bio: string;
|
|
10
|
+
email: string;
|
|
11
|
+
thumb: string;
|
|
12
|
+
}
|