@wawjs/ngx-bos 22.0.0 → 22.0.1
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 +19 -19
- 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 +2 -2
- package/fesm2022/wawjs-ngx-bos.mjs.map +1 -1
- package/package.json +1 -1
- package/src/feature/file/file.component.ts +220 -220
- package/src/feature/file/file.interface.ts +12 -12
- package/src/feature/file/file.service.ts +34 -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.ts +27 -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.ts +57 -57
- 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 +176 -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.ts +31 -31
- 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
|
@@ -1,86 +1,86 @@
|
|
|
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
|
-
_formcomponentService: FormcomponentService,
|
|
53
|
-
_formService: 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, 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
|
+
_formcomponentService: FormcomponentService,
|
|
53
|
+
_formService: 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,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Component,
|
|
3
|
-
effect,
|
|
4
|
-
inject,
|
|
5
|
-
signal,
|
|
6
|
-
} from '@angular/core';
|
|
7
|
-
import { Form, formForm, FormService } from '@wawjs/ngx-form';
|
|
8
|
-
import { TableComponent } from '@wawjs/ngx-ui';
|
|
9
|
-
import { NGX_BOS_CONFIG } from '../../ngx-bos.config';
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
effect,
|
|
4
|
+
inject,
|
|
5
|
+
signal,
|
|
6
|
+
} from '@angular/core';
|
|
7
|
+
import { Form, formForm, FormService } from '@wawjs/ngx-form';
|
|
8
|
+
import { TableComponent } from '@wawjs/ngx-ui';
|
|
9
|
+
import { NGX_BOS_CONFIG } from '../../ngx-bos.config';
|
|
10
10
|
|
|
11
11
|
@Component({
|
|
12
12
|
imports: [TableComponent],
|
|
13
13
|
templateUrl: './forms.component.html',
|
|
14
14
|
})
|
|
15
15
|
export class FormsComponent {
|
|
16
|
-
private _formService = inject(FormService);
|
|
17
|
-
private _bosConfig = inject(NGX_BOS_CONFIG);
|
|
16
|
+
private _formService = inject(FormService);
|
|
17
|
+
private _bosConfig = inject(NGX_BOS_CONFIG);
|
|
18
18
|
|
|
19
19
|
columns: string[] = ['formId', 'title'];
|
|
20
20
|
|
|
@@ -36,10 +36,10 @@ export class FormsComponent {
|
|
|
36
36
|
if (form._id) {
|
|
37
37
|
this._formService.update(updated as Form);
|
|
38
38
|
} else {
|
|
39
|
-
this._formService.create({
|
|
40
|
-
...(updated as Form),
|
|
41
|
-
appId: this._bosConfig.appId,
|
|
42
|
-
});
|
|
39
|
+
this._formService.create({
|
|
40
|
+
...(updated as Form),
|
|
41
|
+
appId: this._bosConfig.appId,
|
|
42
|
+
});
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
},
|
package/src/pipes/phone.pipe.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
-
import { CountryCode, parsePhoneNumberFromString } from 'libphonenumber-js';
|
|
3
|
-
|
|
4
|
-
@Pipe({ name: 'phone' })
|
|
5
|
-
export class PhonePipe implements PipeTransform {
|
|
6
|
-
transform(
|
|
7
|
-
value: string | null | undefined,
|
|
8
|
-
country: CountryCode = 'US',
|
|
9
|
-
): string {
|
|
10
|
-
const raw = String(value ?? '').trim();
|
|
11
|
-
if (!raw) return '';
|
|
12
|
-
|
|
13
|
-
const phone = parsePhoneNumberFromString(raw, country);
|
|
14
|
-
|
|
15
|
-
return phone ? phone.formatInternational() : raw;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
+
import { CountryCode, parsePhoneNumberFromString } from 'libphonenumber-js';
|
|
3
|
+
|
|
4
|
+
@Pipe({ name: 'phone' })
|
|
5
|
+
export class PhonePipe implements PipeTransform {
|
|
6
|
+
transform(
|
|
7
|
+
value: string | null | undefined,
|
|
8
|
+
country: CountryCode = 'US',
|
|
9
|
+
): string {
|
|
10
|
+
const raw = String(value ?? '').trim();
|
|
11
|
+
if (!raw) return '';
|
|
12
|
+
|
|
13
|
+
const phone = parsePhoneNumberFromString(raw, country);
|
|
14
|
+
|
|
15
|
+
return phone ? phone.formatInternational() : raw;
|
|
16
|
+
}
|
|
17
|
+
}
|
package/src/public-api.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Public API surface for @wawjs/ngx-bos.
|
|
3
|
-
*
|
|
4
|
-
* Reusable BOS contracts and services will be exported here as code moves from
|
|
5
|
-
* the source app into the package.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export const NGX_BOS_VERSION = '22.0.0' as const;
|
|
9
|
-
|
|
10
|
-
export type NgxBosVersion = typeof NGX_BOS_VERSION;
|
|
11
|
-
|
|
12
|
-
export * from './ngx-bos.config';
|
|
13
|
-
export * from './feature/file';
|
|
14
|
-
export * from './feature/file/selectors/file/file-selector.component';
|
|
15
|
-
export * from './feature/file/pages/files/files.component';
|
|
16
|
-
export * from './feature/file/pages/files/files.routes';
|
|
17
|
-
export * from './form-components';
|
|
18
|
-
export * from './feature/user/user.interface';
|
|
19
|
-
export * from './feature/user/user.const';
|
|
20
|
-
export * from './feature/user/user.form';
|
|
21
|
-
export * from './feature/user/user.service';
|
|
22
|
-
export * from './feature/user/guards/admins.guard';
|
|
23
|
-
export * from './feature/user/guards/authenticated.guard';
|
|
24
|
-
export * from './feature/user/guards/guest.guard';
|
|
25
|
-
export * from './feature/user/selectors/user/user-selector.component';
|
|
26
|
-
export * from './feature/user/components/user-preview/user-preview.component';
|
|
27
|
-
export * from './feature/user/pages/users/users.component';
|
|
28
|
-
export * from './feature/user/pages/users/users.routes';
|
|
29
|
-
export * from './feature/user/pages/clients/clients.component';
|
|
30
|
-
export * from './feature/user/pages/clients/clients.routes';
|
|
31
|
-
export * from './pages/form/form.component';
|
|
32
|
-
export * from './pages/form/form.routes';
|
|
33
|
-
export * from './pages/forms/forms.component';
|
|
34
|
-
export * from './pages/forms/forms.routes';
|
|
35
|
-
export * from './icons/spider';
|
|
36
|
-
export * from './pipes/phone.pipe';
|
|
1
|
+
/*
|
|
2
|
+
* Public API surface for @wawjs/ngx-bos.
|
|
3
|
+
*
|
|
4
|
+
* Reusable BOS contracts and services will be exported here as code moves from
|
|
5
|
+
* the source app into the package.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const NGX_BOS_VERSION = '22.0.0' as const;
|
|
9
|
+
|
|
10
|
+
export type NgxBosVersion = typeof NGX_BOS_VERSION;
|
|
11
|
+
|
|
12
|
+
export * from './ngx-bos.config';
|
|
13
|
+
export * from './feature/file';
|
|
14
|
+
export * from './feature/file/selectors/file/file-selector.component';
|
|
15
|
+
export * from './feature/file/pages/files/files.component';
|
|
16
|
+
export * from './feature/file/pages/files/files.routes';
|
|
17
|
+
export * from './form-components';
|
|
18
|
+
export * from './feature/user/user.interface';
|
|
19
|
+
export * from './feature/user/user.const';
|
|
20
|
+
export * from './feature/user/user.form';
|
|
21
|
+
export * from './feature/user/user.service';
|
|
22
|
+
export * from './feature/user/guards/admins.guard';
|
|
23
|
+
export * from './feature/user/guards/authenticated.guard';
|
|
24
|
+
export * from './feature/user/guards/guest.guard';
|
|
25
|
+
export * from './feature/user/selectors/user/user-selector.component';
|
|
26
|
+
export * from './feature/user/components/user-preview/user-preview.component';
|
|
27
|
+
export * from './feature/user/pages/users/users.component';
|
|
28
|
+
export * from './feature/user/pages/users/users.routes';
|
|
29
|
+
export * from './feature/user/pages/clients/clients.component';
|
|
30
|
+
export * from './feature/user/pages/clients/clients.routes';
|
|
31
|
+
export * from './pages/form/form.component';
|
|
32
|
+
export * from './pages/form/form.routes';
|
|
33
|
+
export * from './pages/forms/forms.component';
|
|
34
|
+
export * from './pages/forms/forms.routes';
|
|
35
|
+
export * from './icons/spider';
|
|
36
|
+
export * from './pipes/phone.pipe';
|