@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,27 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shape of the dynamic `data` payload handed to template-bridge components by
|
|
3
|
-
* the wform engine. The engine populates a subset of these per field, so every
|
|
4
|
-
* member is optional and consumers must feature-detect before use.
|
|
5
|
-
*/
|
|
6
|
-
export interface FormBridgeFieldState {
|
|
7
|
-
value?: (() => unknown) & { set?: (value: unknown) => void };
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type FormBridgeField = (() => FormBridgeFieldState) &
|
|
11
|
-
Record<string, unknown>;
|
|
12
|
-
|
|
13
|
-
export type FormBridgeModel = (() => Record<string, unknown>) & {
|
|
14
|
-
update?: (
|
|
15
|
-
updater: (current: Record<string, unknown>) => Record<string, unknown>,
|
|
16
|
-
) => void;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export interface FormBridgeData {
|
|
20
|
-
key?: string | null;
|
|
21
|
-
field?: FormBridgeField;
|
|
22
|
-
model?: FormBridgeModel;
|
|
23
|
-
submition?: Record<string, unknown>;
|
|
24
|
-
props?: Record<string, unknown>;
|
|
25
|
-
component?: { class?: string; disabled?: boolean };
|
|
26
|
-
wChange?: () => void;
|
|
27
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Shape of the dynamic `data` payload handed to template-bridge components by
|
|
3
|
+
* the wform engine. The engine populates a subset of these per field, so every
|
|
4
|
+
* member is optional and consumers must feature-detect before use.
|
|
5
|
+
*/
|
|
6
|
+
export interface FormBridgeFieldState {
|
|
7
|
+
value?: (() => unknown) & { set?: (value: unknown) => void };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type FormBridgeField = (() => FormBridgeFieldState) &
|
|
11
|
+
Record<string, unknown>;
|
|
12
|
+
|
|
13
|
+
export type FormBridgeModel = (() => Record<string, unknown>) & {
|
|
14
|
+
update?: (
|
|
15
|
+
updater: (current: Record<string, unknown>) => Record<string, unknown>,
|
|
16
|
+
) => void;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export interface FormBridgeData {
|
|
20
|
+
key?: string | null;
|
|
21
|
+
field?: FormBridgeField;
|
|
22
|
+
model?: FormBridgeModel;
|
|
23
|
+
submition?: Record<string, unknown>;
|
|
24
|
+
props?: Record<string, unknown>;
|
|
25
|
+
component?: { class?: string; disabled?: boolean };
|
|
26
|
+
wChange?: () => void;
|
|
27
|
+
}
|
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
import {
|
|
2
|
-
APP_INITIALIZER,
|
|
3
|
-
ApplicationRef,
|
|
4
|
-
EnvironmentInjector,
|
|
5
|
-
Provider,
|
|
6
|
-
Type,
|
|
7
|
-
createComponent,
|
|
8
|
-
} from '@angular/core';
|
|
9
|
-
import { FormInterface } from '@wawjs/ngx-form';
|
|
10
|
-
import { AceFormComponent } from './ace/ace.component';
|
|
11
|
-
import { aceForm } from './ace/ace.form';
|
|
12
|
-
import { ButtonFormComponent } from './button/button.component';
|
|
13
|
-
import { buttonForm } from './button/button.form';
|
|
14
|
-
import { FileFormComponent } from './file/file.component';
|
|
15
|
-
import { fileForm } from './file/file.form';
|
|
16
|
-
import { InputFormComponent } from './input/input.component';
|
|
17
|
-
import { inputForm } from './input/input.form';
|
|
18
|
-
import { SelectFormComponent } from './select/select.component';
|
|
19
|
-
import { selectForm } from './select/select.form';
|
|
20
|
-
import { TinymceFormComponent } from './tinymce/tinymce.component';
|
|
21
|
-
import { tinymceForm } from './tinymce/tinymce.form';
|
|
22
|
-
/* components */
|
|
23
|
-
|
|
24
|
-
export const FORM_COMPONENTS = [
|
|
25
|
-
'Input',
|
|
26
|
-
'Select',
|
|
27
|
-
'File',
|
|
28
|
-
'Button',
|
|
29
|
-
'Ace',
|
|
30
|
-
'Tinymce',
|
|
31
|
-
];
|
|
32
|
-
|
|
33
|
-
export const FORM_COMPONENT_FORM = (key: string): FormInterface => {
|
|
34
|
-
return {
|
|
35
|
-
Input: inputForm,
|
|
36
|
-
Select: selectForm,
|
|
37
|
-
File: fileForm,
|
|
38
|
-
Button: buttonForm,
|
|
39
|
-
Ace: aceForm,
|
|
40
|
-
Tinymce: tinymceForm,
|
|
41
|
-
}[key] as FormInterface;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Central registry: template name → component class.
|
|
46
|
-
* Names must match `component.name` in form schema (e.g. `{ name: 'Input', ... }`)
|
|
47
|
-
* and what the template component passes into FormService.addTemplateComponent().
|
|
48
|
-
*/
|
|
49
|
-
export const FORM_TEMPLATE_COMPONENTS: Record<string, Type<unknown>> = {
|
|
50
|
-
Input: InputFormComponent,
|
|
51
|
-
Select: SelectFormComponent,
|
|
52
|
-
File: FileFormComponent,
|
|
53
|
-
Button: ButtonFormComponent,
|
|
54
|
-
Ace: AceFormComponent,
|
|
55
|
-
Tinymce: TinymceFormComponent,
|
|
56
|
-
/* addComponents */
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
function registerFormTemplatesFactory(
|
|
60
|
-
injector: EnvironmentInjector,
|
|
61
|
-
appRef: ApplicationRef,
|
|
62
|
-
): () => void {
|
|
63
|
-
return () => {
|
|
64
|
-
// Instantiate each template component once so their ngOnInit runs
|
|
65
|
-
// and they call FormService.addTemplateComponent(name, templateRef)
|
|
66
|
-
Object.values(FORM_TEMPLATE_COMPONENTS).forEach((cmp) => {
|
|
67
|
-
const ref = createComponent(cmp, {
|
|
68
|
-
environmentInjector: injector,
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
appRef.attachView(ref.hostView);
|
|
72
|
-
(ref.hostView as any).detectChanges?.();
|
|
73
|
-
// no DOM insertion – purely for registration side-effects
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export const provideFormComponents = (): Provider => {
|
|
79
|
-
return {
|
|
80
|
-
provide: APP_INITIALIZER,
|
|
81
|
-
multi: true,
|
|
82
|
-
useFactory: registerFormTemplatesFactory,
|
|
83
|
-
deps: [EnvironmentInjector, ApplicationRef],
|
|
84
|
-
};
|
|
85
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
APP_INITIALIZER,
|
|
3
|
+
ApplicationRef,
|
|
4
|
+
EnvironmentInjector,
|
|
5
|
+
Provider,
|
|
6
|
+
Type,
|
|
7
|
+
createComponent,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { FormInterface } from '@wawjs/ngx-form';
|
|
10
|
+
import { AceFormComponent } from './ace/ace.component';
|
|
11
|
+
import { aceForm } from './ace/ace.form';
|
|
12
|
+
import { ButtonFormComponent } from './button/button.component';
|
|
13
|
+
import { buttonForm } from './button/button.form';
|
|
14
|
+
import { FileFormComponent } from './file/file.component';
|
|
15
|
+
import { fileForm } from './file/file.form';
|
|
16
|
+
import { InputFormComponent } from './input/input.component';
|
|
17
|
+
import { inputForm } from './input/input.form';
|
|
18
|
+
import { SelectFormComponent } from './select/select.component';
|
|
19
|
+
import { selectForm } from './select/select.form';
|
|
20
|
+
import { TinymceFormComponent } from './tinymce/tinymce.component';
|
|
21
|
+
import { tinymceForm } from './tinymce/tinymce.form';
|
|
22
|
+
/* components */
|
|
23
|
+
|
|
24
|
+
export const FORM_COMPONENTS = [
|
|
25
|
+
'Input',
|
|
26
|
+
'Select',
|
|
27
|
+
'File',
|
|
28
|
+
'Button',
|
|
29
|
+
'Ace',
|
|
30
|
+
'Tinymce',
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
export const FORM_COMPONENT_FORM = (key: string): FormInterface => {
|
|
34
|
+
return {
|
|
35
|
+
Input: inputForm,
|
|
36
|
+
Select: selectForm,
|
|
37
|
+
File: fileForm,
|
|
38
|
+
Button: buttonForm,
|
|
39
|
+
Ace: aceForm,
|
|
40
|
+
Tinymce: tinymceForm,
|
|
41
|
+
}[key] as FormInterface;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Central registry: template name → component class.
|
|
46
|
+
* Names must match `component.name` in form schema (e.g. `{ name: 'Input', ... }`)
|
|
47
|
+
* and what the template component passes into FormService.addTemplateComponent().
|
|
48
|
+
*/
|
|
49
|
+
export const FORM_TEMPLATE_COMPONENTS: Record<string, Type<unknown>> = {
|
|
50
|
+
Input: InputFormComponent,
|
|
51
|
+
Select: SelectFormComponent,
|
|
52
|
+
File: FileFormComponent,
|
|
53
|
+
Button: ButtonFormComponent,
|
|
54
|
+
Ace: AceFormComponent,
|
|
55
|
+
Tinymce: TinymceFormComponent,
|
|
56
|
+
/* addComponents */
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
function registerFormTemplatesFactory(
|
|
60
|
+
injector: EnvironmentInjector,
|
|
61
|
+
appRef: ApplicationRef,
|
|
62
|
+
): () => void {
|
|
63
|
+
return () => {
|
|
64
|
+
// Instantiate each template component once so their ngOnInit runs
|
|
65
|
+
// and they call FormService.addTemplateComponent(name, templateRef)
|
|
66
|
+
Object.values(FORM_TEMPLATE_COMPONENTS).forEach((cmp) => {
|
|
67
|
+
const ref = createComponent(cmp, {
|
|
68
|
+
environmentInjector: injector,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
appRef.attachView(ref.hostView);
|
|
72
|
+
(ref.hostView as any).detectChanges?.();
|
|
73
|
+
// no DOM insertion – purely for registration side-effects
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const provideFormComponents = (): Provider => {
|
|
79
|
+
return {
|
|
80
|
+
provide: APP_INITIALIZER,
|
|
81
|
+
multi: true,
|
|
82
|
+
useFactory: registerFormTemplatesFactory,
|
|
83
|
+
deps: [EnvironmentInjector, ApplicationRef],
|
|
84
|
+
};
|
|
85
|
+
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Component,
|
|
3
|
-
OnInit,
|
|
4
|
-
TemplateRef,
|
|
5
|
-
inject,
|
|
6
|
-
viewChild,
|
|
7
|
-
} from '@angular/core';
|
|
8
|
-
import { FormService } from '@wawjs/ngx-form';
|
|
9
|
-
import { InputComponent, inputDefaults } from '@wawjs/ngx-ui';
|
|
10
|
-
|
|
11
|
-
interface Interface {}
|
|
12
|
-
|
|
13
|
-
@Component({
|
|
14
|
-
imports: [InputComponent],
|
|
15
|
-
templateUrl: './input.component.html',
|
|
16
|
-
})
|
|
17
|
-
export class InputFormComponent implements OnInit {
|
|
18
|
-
private readonly _formService = inject(FormService);
|
|
19
|
-
|
|
20
|
-
readonly templateRef =
|
|
21
|
-
viewChild.required<TemplateRef<Interface>>('templateRef');
|
|
22
|
-
|
|
23
|
-
readonly inputDefaults = inputDefaults;
|
|
24
|
-
|
|
25
|
-
ngOnInit(): void {
|
|
26
|
-
this._formService.addTemplateComponent<Interface>(
|
|
27
|
-
'Input',
|
|
28
|
-
this.templateRef(),
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
OnInit,
|
|
4
|
+
TemplateRef,
|
|
5
|
+
inject,
|
|
6
|
+
viewChild,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
import { FormService } from '@wawjs/ngx-form';
|
|
9
|
+
import { InputComponent, inputDefaults } from '@wawjs/ngx-ui';
|
|
10
|
+
|
|
11
|
+
interface Interface {}
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
imports: [InputComponent],
|
|
15
|
+
templateUrl: './input.component.html',
|
|
16
|
+
})
|
|
17
|
+
export class InputFormComponent implements OnInit {
|
|
18
|
+
private readonly _formService = inject(FormService);
|
|
19
|
+
|
|
20
|
+
readonly templateRef =
|
|
21
|
+
viewChild.required<TemplateRef<Interface>>('templateRef');
|
|
22
|
+
|
|
23
|
+
readonly inputDefaults = inputDefaults;
|
|
24
|
+
|
|
25
|
+
ngOnInit(): void {
|
|
26
|
+
this._formService.addTemplateComponent<Interface>(
|
|
27
|
+
'Input',
|
|
28
|
+
this.templateRef(),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Component,
|
|
3
|
-
OnInit,
|
|
4
|
-
TemplateRef,
|
|
5
|
-
inject,
|
|
6
|
-
viewChild,
|
|
7
|
-
} from '@angular/core';
|
|
8
|
-
import { FormService } from '@wawjs/ngx-form';
|
|
9
|
-
import { SelectComponent, selectDefaults } from '@wawjs/ngx-ui';
|
|
10
|
-
|
|
11
|
-
interface SelectTemplateContext {}
|
|
12
|
-
|
|
13
|
-
@Component({
|
|
14
|
-
imports: [SelectComponent],
|
|
15
|
-
templateUrl: './select.component.html',
|
|
16
|
-
})
|
|
17
|
-
export class SelectFormComponent implements OnInit {
|
|
18
|
-
private readonly _formService = inject(FormService);
|
|
19
|
-
|
|
20
|
-
readonly templateRef =
|
|
21
|
-
viewChild.required<TemplateRef<SelectTemplateContext>>('templateRef');
|
|
22
|
-
|
|
23
|
-
readonly selectDefaults = selectDefaults;
|
|
24
|
-
|
|
25
|
-
ngOnInit(): void {
|
|
26
|
-
this._formService.addTemplateComponent<SelectTemplateContext>(
|
|
27
|
-
'Select',
|
|
28
|
-
this.templateRef(),
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
OnInit,
|
|
4
|
+
TemplateRef,
|
|
5
|
+
inject,
|
|
6
|
+
viewChild,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
import { FormService } from '@wawjs/ngx-form';
|
|
9
|
+
import { SelectComponent, selectDefaults } from '@wawjs/ngx-ui';
|
|
10
|
+
|
|
11
|
+
interface SelectTemplateContext {}
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
imports: [SelectComponent],
|
|
15
|
+
templateUrl: './select.component.html',
|
|
16
|
+
})
|
|
17
|
+
export class SelectFormComponent implements OnInit {
|
|
18
|
+
private readonly _formService = inject(FormService);
|
|
19
|
+
|
|
20
|
+
readonly templateRef =
|
|
21
|
+
viewChild.required<TemplateRef<SelectTemplateContext>>('templateRef');
|
|
22
|
+
|
|
23
|
+
readonly selectDefaults = selectDefaults;
|
|
24
|
+
|
|
25
|
+
ngOnInit(): void {
|
|
26
|
+
this._formService.addTemplateComponent<SelectTemplateContext>(
|
|
27
|
+
'Select',
|
|
28
|
+
this.templateRef(),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|