@mckit/form 19.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/README.md +63 -0
- package/fesm2022/mckit-form.mjs +425 -0
- package/fesm2022/mckit-form.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/footer-modal-form/footer-modal-form.component.d.ts +19 -0
- package/lib/components/form/form.component.d.ts +21 -0
- package/lib/components/form-modal/form-modal.component.d.ts +25 -0
- package/lib/components/print-field/print-field.component.d.ts +16 -0
- package/lib/entities/mc-config-form.d.ts +6 -0
- package/lib/entities/mc-event-form.d.ts +5 -0
- package/lib/entities/mc-field.d.ts +15 -0
- package/lib/entities/mc-ifta-field.d.ts +13 -0
- package/lib/fields/ifta-text-field/ifta-text-field.component.d.ts +15 -0
- package/lib/fields/mc-field.component.d.ts +13 -0
- package/lib/fields/row-field/row-field.component.d.ts +13 -0
- package/lib/fields/submit-button-field/submit-button-field.component.d.ts +19 -0
- package/lib/services/form-modal.service.d.ts +18 -0
- package/lib/services/mc-form.service.d.ts +11 -0
- package/package.json +25 -0
- package/public-api.d.ts +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Form
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.1.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build form
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
```bash
|
|
35
|
+
cd dist/form
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
39
|
+
```bash
|
|
40
|
+
npm publish
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Running unit tests
|
|
44
|
+
|
|
45
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ng test
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Running end-to-end tests
|
|
52
|
+
|
|
53
|
+
For end-to-end (e2e) testing, run:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ng e2e
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
60
|
+
|
|
61
|
+
## Additional Resources
|
|
62
|
+
|
|
63
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, input, inject, ViewContainerRef, Component, signal, output, viewChild, computed } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { UntypedFormControl, UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { DialogService, DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import { Subject, take, switchMap } from 'rxjs';
|
|
8
|
+
import * as i1$1 from 'primeng/button';
|
|
9
|
+
import { ButtonModule } from 'primeng/button';
|
|
10
|
+
import * as i2 from 'primeng/iftalabel';
|
|
11
|
+
import { IftaLabelModule } from 'primeng/iftalabel';
|
|
12
|
+
import * as i3 from 'primeng/inputtext';
|
|
13
|
+
import { InputTextModule } from 'primeng/inputtext';
|
|
14
|
+
|
|
15
|
+
class MCField {
|
|
16
|
+
key;
|
|
17
|
+
component;
|
|
18
|
+
config;
|
|
19
|
+
static initCustom(key, component, config) {
|
|
20
|
+
let field = new MCField();
|
|
21
|
+
field.key = key;
|
|
22
|
+
field.component = component;
|
|
23
|
+
field.config = config;
|
|
24
|
+
return field;
|
|
25
|
+
}
|
|
26
|
+
static init(data) {
|
|
27
|
+
let field = new MCField();
|
|
28
|
+
field.key = data.key;
|
|
29
|
+
field.component = data.component;
|
|
30
|
+
field.config = {
|
|
31
|
+
validators: data.validators,
|
|
32
|
+
default_value: data.default_value,
|
|
33
|
+
disabled: data.disabled,
|
|
34
|
+
no_control: data.no_control
|
|
35
|
+
};
|
|
36
|
+
return field;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
class MCIftaField {
|
|
41
|
+
static init(data) {
|
|
42
|
+
let field = new MCField();
|
|
43
|
+
field.key = data.key;
|
|
44
|
+
field.component = data.component;
|
|
45
|
+
field.config = {
|
|
46
|
+
label: data.label,
|
|
47
|
+
validators: data.validators,
|
|
48
|
+
default_value: data.default_value,
|
|
49
|
+
disabled: data.disabled,
|
|
50
|
+
no_control: data.no_control
|
|
51
|
+
};
|
|
52
|
+
return field;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
class MCConfigForm {
|
|
57
|
+
fields = [];
|
|
58
|
+
item;
|
|
59
|
+
containerFieldClass;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
class MCEventForm {
|
|
63
|
+
key;
|
|
64
|
+
content;
|
|
65
|
+
static init(key, content) {
|
|
66
|
+
let eventForm = new MCEventForm();
|
|
67
|
+
eventForm.key = key;
|
|
68
|
+
eventForm.content = content;
|
|
69
|
+
return eventForm;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
class MCFormService {
|
|
74
|
+
createControl(field) {
|
|
75
|
+
let input = new UntypedFormControl();
|
|
76
|
+
if (field.config.validators) {
|
|
77
|
+
input.setValidators(field.config.validators);
|
|
78
|
+
}
|
|
79
|
+
if (field.config.default) {
|
|
80
|
+
input.setValue(field.config.default);
|
|
81
|
+
}
|
|
82
|
+
if (field.config.disabled) {
|
|
83
|
+
input.disable();
|
|
84
|
+
}
|
|
85
|
+
return input;
|
|
86
|
+
}
|
|
87
|
+
loadFieldsInNewGroup(group, fields, key, item) {
|
|
88
|
+
let newGroup = new UntypedFormGroup({});
|
|
89
|
+
this.loadFields(newGroup, fields, item);
|
|
90
|
+
group.addControl(key, newGroup);
|
|
91
|
+
}
|
|
92
|
+
loadFieldsWithChildren(group, field, item) {
|
|
93
|
+
if (field.config?.is_new_group) {
|
|
94
|
+
let fieldKey = field.key ?? 'row';
|
|
95
|
+
let subitem = item && item[fieldKey] ? item[fieldKey] : undefined;
|
|
96
|
+
this.loadFieldsInNewGroup(group, field.config.fields, fieldKey, subitem);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
this.loadFields(group, field.config.fields, item);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
loadFields(group, fields, item) {
|
|
103
|
+
for (const field of fields) {
|
|
104
|
+
if (field.config?.has_children) {
|
|
105
|
+
this.loadFieldsWithChildren(group, field, item);
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (field.key == undefined || field.key == '' || field.config?.no_control) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
group.addControl(field.key, this.createControl(field));
|
|
112
|
+
if (item && item[field.key]) {
|
|
113
|
+
group.get(field.key)?.setValue(item[field.key]);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCFormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
118
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCFormService, providedIn: 'root' });
|
|
119
|
+
}
|
|
120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCFormService, decorators: [{
|
|
121
|
+
type: Injectable,
|
|
122
|
+
args: [{
|
|
123
|
+
providedIn: 'root'
|
|
124
|
+
}]
|
|
125
|
+
}] });
|
|
126
|
+
|
|
127
|
+
class PrintFieldComponent {
|
|
128
|
+
field = input.required();
|
|
129
|
+
control = input();
|
|
130
|
+
group = input();
|
|
131
|
+
eventObs = input();
|
|
132
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
133
|
+
ngOnInit() {
|
|
134
|
+
const view = this.viewContainerRef.createComponent(this.field().component);
|
|
135
|
+
view.setInput('field', this.field());
|
|
136
|
+
view.setInput('control', this.control());
|
|
137
|
+
view.setInput('group', this.group());
|
|
138
|
+
view.setInput('eventObs', this.eventObs());
|
|
139
|
+
}
|
|
140
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: PrintFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
141
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.4", type: PrintFieldComponent, isStandalone: true, selector: "mc-print-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: false, transformFunction: null }, eventObs: { classPropertyName: "eventObs", publicName: "eventObs", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: '', isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }] });
|
|
142
|
+
}
|
|
143
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: PrintFieldComponent, decorators: [{
|
|
144
|
+
type: Component,
|
|
145
|
+
args: [{ selector: 'mc-print-field', imports: [CommonModule, ReactiveFormsModule], template: '' }]
|
|
146
|
+
}] });
|
|
147
|
+
|
|
148
|
+
class MCForm {
|
|
149
|
+
config = input.required();
|
|
150
|
+
formGroup = signal(undefined);
|
|
151
|
+
formService = inject(MCFormService);
|
|
152
|
+
onEvent = output();
|
|
153
|
+
eventObs = new Subject();
|
|
154
|
+
eventSubscription;
|
|
155
|
+
ngOnInit() {
|
|
156
|
+
this.eventSubscription = this.eventObs.subscribe(event => this.onEvent.emit(event));
|
|
157
|
+
this.loadFields();
|
|
158
|
+
}
|
|
159
|
+
ngOnDestroy() {
|
|
160
|
+
this.eventSubscription?.unsubscribe();
|
|
161
|
+
}
|
|
162
|
+
emitEvent(event) {
|
|
163
|
+
this.eventObs.next(event);
|
|
164
|
+
}
|
|
165
|
+
loadFields() {
|
|
166
|
+
let group = new UntypedFormGroup({});
|
|
167
|
+
let fields = this.config().fields ?? [];
|
|
168
|
+
this.formService.loadFields(group, fields, this.config().item);
|
|
169
|
+
this.formGroup.set(group);
|
|
170
|
+
}
|
|
171
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
172
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: MCForm, isStandalone: true, selector: "mc-form", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onEvent: "onEvent" }, ngImport: i0, template: "@if(formGroup()) {\n <form [formGroup]=\"formGroup()!\" class=\"mc-form\">\n @for (field of config().fields; track $index) {\n <div class=\"{{(config().containerFieldClass || 'mb-3')}}\">\n <mc-print-field [field]=\"field\" [control]=\"formGroup()!.get(field.key ?? '')\" [group]=\"formGroup()!\" [eventObs]=\"eventObs\" />\n </div>\n }\n </form>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: PrintFieldComponent, selector: "mc-print-field", inputs: ["field", "control", "group", "eventObs"] }] });
|
|
173
|
+
}
|
|
174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCForm, decorators: [{
|
|
175
|
+
type: Component,
|
|
176
|
+
args: [{ selector: 'mc-form', imports: [CommonModule, ReactiveFormsModule, PrintFieldComponent], template: "@if(formGroup()) {\n <form [formGroup]=\"formGroup()!\" class=\"mc-form\">\n @for (field of config().fields; track $index) {\n <div class=\"{{(config().containerFieldClass || 'mb-3')}}\">\n <mc-print-field [field]=\"field\" [control]=\"formGroup()!.get(field.key ?? '')\" [group]=\"formGroup()!\" [eventObs]=\"eventObs\" />\n </div>\n }\n </form>\n}\n" }]
|
|
177
|
+
}] });
|
|
178
|
+
|
|
179
|
+
class MCEventModalForm extends MCEventForm {
|
|
180
|
+
dialog;
|
|
181
|
+
}
|
|
182
|
+
class MCFormModalComponent {
|
|
183
|
+
formComponent = viewChild(MCForm);
|
|
184
|
+
dialogService = inject(DialogService);
|
|
185
|
+
dialogRef = inject(DynamicDialogRef);
|
|
186
|
+
formConfig = signal(new MCConfigForm());
|
|
187
|
+
eventObs = new Subject();
|
|
188
|
+
ngOnInit() {
|
|
189
|
+
this.initForm();
|
|
190
|
+
}
|
|
191
|
+
onEventForm(event) {
|
|
192
|
+
this.eventObs.next({ ...event, dialog: this.dialogRef });
|
|
193
|
+
}
|
|
194
|
+
initForm() {
|
|
195
|
+
let instance = this.dialogService.getInstance(this.dialogRef);
|
|
196
|
+
if (instance.data == undefined) {
|
|
197
|
+
this.dialogRef.close();
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
this.formConfig.set(instance.data);
|
|
201
|
+
}
|
|
202
|
+
getFormGroup() {
|
|
203
|
+
return this.formComponent()?.formGroup();
|
|
204
|
+
}
|
|
205
|
+
getEventObs() {
|
|
206
|
+
return this.eventObs;
|
|
207
|
+
}
|
|
208
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCFormModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
209
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.1.4", type: MCFormModalComponent, isStandalone: true, selector: "mc-form-modal", viewQueries: [{ propertyName: "formComponent", first: true, predicate: MCForm, descendants: true, isSignal: true }], ngImport: i0, template: "<mc-form [config]=\"formConfig()\" (onEvent)=\"onEventForm($event)\" />\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: MCForm, selector: "mc-form", inputs: ["config"], outputs: ["onEvent"] }] });
|
|
210
|
+
}
|
|
211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCFormModalComponent, decorators: [{
|
|
212
|
+
type: Component,
|
|
213
|
+
args: [{ selector: 'mc-form-modal', imports: [CommonModule, MCForm], template: "<mc-form [config]=\"formConfig()\" (onEvent)=\"onEventForm($event)\" />\n" }]
|
|
214
|
+
}] });
|
|
215
|
+
|
|
216
|
+
class MCFooterModalForm {
|
|
217
|
+
dialogService = inject(DialogService);
|
|
218
|
+
dialogRef = inject((DynamicDialogRef));
|
|
219
|
+
isLoading = signal(false);
|
|
220
|
+
group;
|
|
221
|
+
eventObs;
|
|
222
|
+
ngOnInit() {
|
|
223
|
+
this.initConfig();
|
|
224
|
+
}
|
|
225
|
+
onClickCancel() {
|
|
226
|
+
this.eventObs?.next(MCEventModalForm.init('close'));
|
|
227
|
+
this.dialogRef.close();
|
|
228
|
+
}
|
|
229
|
+
onClickSubmit() {
|
|
230
|
+
this.isLoading.set(true);
|
|
231
|
+
let event = new MCEventModalForm();
|
|
232
|
+
event.key = 'submit';
|
|
233
|
+
event.dialog = this.dialogRef;
|
|
234
|
+
if (this.group != undefined) {
|
|
235
|
+
event.content = this.group()?.value;
|
|
236
|
+
}
|
|
237
|
+
this.eventObs?.next(event);
|
|
238
|
+
}
|
|
239
|
+
initConfig() {
|
|
240
|
+
let instance = this.dialogService.getInstance(this.dialogRef);
|
|
241
|
+
if (instance.data == undefined) {
|
|
242
|
+
this.dialogRef.close();
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
this.dialogRef.onChildComponentLoaded
|
|
246
|
+
.pipe(take(1))
|
|
247
|
+
.subscribe((comp) => {
|
|
248
|
+
this.group = comp.formComponent()?.formGroup;
|
|
249
|
+
this.eventObs = comp.getEventObs();
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCFooterModalForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
253
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: MCFooterModalForm, isStandalone: true, selector: "mc-footer-modal-form", ngImport: i0, template: "<p-button label=\"Cancel\" severity=\"secondary\" (onClick)=\"onClickCancel()\" styleClass=\"mr-3\" />\n@if(group != undefined){\n <p-button label=\"Submit\" severity=\"primary\" (onClick)=\"onClickSubmit()\" icon=\"pi pi-send\" [disabled]=\"!group()?.valid || group()?.disabled\" [loading]=\"isLoading()\" />\n}\n\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i1$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }] });
|
|
254
|
+
}
|
|
255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCFooterModalForm, decorators: [{
|
|
256
|
+
type: Component,
|
|
257
|
+
args: [{ selector: 'mc-footer-modal-form', imports: [CommonModule, ButtonModule], template: "<p-button label=\"Cancel\" severity=\"secondary\" (onClick)=\"onClickCancel()\" styleClass=\"mr-3\" />\n@if(group != undefined){\n <p-button label=\"Submit\" severity=\"primary\" (onClick)=\"onClickSubmit()\" icon=\"pi pi-send\" [disabled]=\"!group()?.valid || group()?.disabled\" [loading]=\"isLoading()\" />\n}\n\n" }]
|
|
258
|
+
}] });
|
|
259
|
+
|
|
260
|
+
class MCConfigModalForm extends MCConfigForm {
|
|
261
|
+
title;
|
|
262
|
+
position;
|
|
263
|
+
styleClass;
|
|
264
|
+
style;
|
|
265
|
+
}
|
|
266
|
+
class MCFormModalService {
|
|
267
|
+
dialogService = inject(DialogService);
|
|
268
|
+
open(config) {
|
|
269
|
+
let dialog = this.dialogService.open(MCFormModalComponent, {
|
|
270
|
+
header: config.title,
|
|
271
|
+
footer: 'Test footer',
|
|
272
|
+
style: config.style,
|
|
273
|
+
styleClass: config.styleClass,
|
|
274
|
+
closable: true,
|
|
275
|
+
dismissableMask: true,
|
|
276
|
+
position: config.position,
|
|
277
|
+
templates: {
|
|
278
|
+
footer: MCFooterModalForm
|
|
279
|
+
},
|
|
280
|
+
data: config
|
|
281
|
+
});
|
|
282
|
+
return dialog.onChildComponentLoaded
|
|
283
|
+
.pipe(switchMap((comp) => comp.getEventObs()));
|
|
284
|
+
}
|
|
285
|
+
openRight(config) {
|
|
286
|
+
config.position = 'right';
|
|
287
|
+
config.style = { margin: '0px !important', 'max-height': '100%' };
|
|
288
|
+
config.styleClass = 'w-full md:w-2xl mc-form-modal';
|
|
289
|
+
return this.open(config);
|
|
290
|
+
}
|
|
291
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCFormModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
292
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCFormModalService, providedIn: 'root' });
|
|
293
|
+
}
|
|
294
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCFormModalService, decorators: [{
|
|
295
|
+
type: Injectable,
|
|
296
|
+
args: [{
|
|
297
|
+
providedIn: 'root',
|
|
298
|
+
}]
|
|
299
|
+
}] });
|
|
300
|
+
|
|
301
|
+
class MCFieldComponent {
|
|
302
|
+
field = input.required();
|
|
303
|
+
control = input();
|
|
304
|
+
group = input.required();
|
|
305
|
+
eventObs = input();
|
|
306
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
307
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.4", type: MCFieldComponent, isStandalone: true, selector: "mc-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null }, eventObs: { classPropertyName: "eventObs", publicName: "eventObs", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: '', isInline: true });
|
|
308
|
+
}
|
|
309
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: MCFieldComponent, decorators: [{
|
|
310
|
+
type: Component,
|
|
311
|
+
args: [{
|
|
312
|
+
selector: 'mc-field',
|
|
313
|
+
template: ''
|
|
314
|
+
}]
|
|
315
|
+
}] });
|
|
316
|
+
|
|
317
|
+
class IftaTextFieldComponent extends MCFieldComponent {
|
|
318
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: IftaTextFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
319
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: IftaTextFieldComponent, isStandalone: true, selector: "mc-ifta-text-field", usesInheritance: true, ngImport: i0, template: "<p-iftalabel>\n <input pInputText id=\"{{field().key}}\" class=\"w-full\" [formControl]=\"control()!\" />\n <label for=\"{{field().key}}\">{{field().config.label}}</label>\n</p-iftalabel>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: IftaLabelModule }, { kind: "component", type: i2.IftaLabel, selector: "p-iftalabel, p-iftaLabel, p-ifta-label" }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i3.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }] });
|
|
320
|
+
}
|
|
321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: IftaTextFieldComponent, decorators: [{
|
|
322
|
+
type: Component,
|
|
323
|
+
args: [{ selector: 'mc-ifta-text-field', imports: [CommonModule, ReactiveFormsModule, IftaLabelModule, InputTextModule], template: "<p-iftalabel>\n <input pInputText id=\"{{field().key}}\" class=\"w-full\" [formControl]=\"control()!\" />\n <label for=\"{{field().key}}\">{{field().config.label}}</label>\n</p-iftalabel>\n" }]
|
|
324
|
+
}] });
|
|
325
|
+
class IftaTextField {
|
|
326
|
+
static init(key, label, config) {
|
|
327
|
+
return MCIftaField.init({
|
|
328
|
+
key: key,
|
|
329
|
+
component: IftaTextFieldComponent,
|
|
330
|
+
label: label,
|
|
331
|
+
validators: config?.validators,
|
|
332
|
+
default_value: config?.default_value,
|
|
333
|
+
disabled: config?.disabled
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
class SubmitButtonFieldComponent extends MCFieldComponent {
|
|
339
|
+
isLoading = signal(false);
|
|
340
|
+
eventSubscription;
|
|
341
|
+
ngOnInit() {
|
|
342
|
+
this.eventSubscription = this.eventObs()?.subscribe(event => {
|
|
343
|
+
if (event.key == 'stop-loading') {
|
|
344
|
+
this.isLoading.set(false);
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
onClick() {
|
|
349
|
+
this.isLoading.set(true);
|
|
350
|
+
this.eventObs()?.next(MCEventForm.init(this.field().key ?? 'submit', this.group()?.value));
|
|
351
|
+
}
|
|
352
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SubmitButtonFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
353
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: SubmitButtonFieldComponent, isStandalone: true, selector: "mc-submit-button-field", usesInheritance: true, ngImport: i0, template: "<div class=\"flex justify-end\">\n <p-button [label]=\"field().config.label\" [disabled]=\"!group().valid || group().disabled\" (onClick)=\"onClick()\" [loading]=\"isLoading()\" [icon]=\"field().config.icon\" />\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i1$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }] });
|
|
354
|
+
}
|
|
355
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SubmitButtonFieldComponent, decorators: [{
|
|
356
|
+
type: Component,
|
|
357
|
+
args: [{ selector: 'mc-submit-button-field', imports: [CommonModule, ButtonModule], template: "<div class=\"flex justify-end\">\n <p-button [label]=\"field().config.label\" [disabled]=\"!group().valid || group().disabled\" (onClick)=\"onClick()\" [loading]=\"isLoading()\" [icon]=\"field().config.icon\" />\n</div>\n" }]
|
|
358
|
+
}] });
|
|
359
|
+
class SubmitButtonField {
|
|
360
|
+
static init(key, label, config) {
|
|
361
|
+
let field = MCIftaField.init({
|
|
362
|
+
key: key,
|
|
363
|
+
component: SubmitButtonFieldComponent,
|
|
364
|
+
label: label,
|
|
365
|
+
disabled: config?.disabled,
|
|
366
|
+
no_control: true
|
|
367
|
+
});
|
|
368
|
+
field.config.icon = config?.icon;
|
|
369
|
+
return field;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
class RowFieldComponent extends MCFieldComponent {
|
|
374
|
+
newGroup = computed(() => {
|
|
375
|
+
if (this.field().config?.is_new_group) {
|
|
376
|
+
return this.group().get(this.field().key);
|
|
377
|
+
}
|
|
378
|
+
return undefined;
|
|
379
|
+
});
|
|
380
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: RowFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
381
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: RowFieldComponent, isStandalone: true, selector: "mc-row-field", usesInheritance: true, ngImport: i0, template: "@if(newGroup()) {\n <div [formGroup]=\"newGroup()!\" class=\"mc-row-form flex flex-row gap-3\">\n @for (field of field().config.fields; track $index) {\n <div class=\"{{(field.config.containerFieldClass || 'mb-3 w-full')}}\">\n <mc-print-field [field]=\"field\" [control]=\"newGroup()!.get(field.key ?? '')\" [group]=\"newGroup()!\" [eventObs]=\"eventObs()\" />\n </div>\n }\n </div>\n} @else {\n <div class=\"mc-row-form flex flex-row gap-3\">\n @for (field of field().config.fields; track $index) {\n <div class=\"{{(field.config.containerFieldClass || 'mb-3 w-full')}}\">\n <mc-print-field [field]=\"field\" [control]=\"group()!.get(field.key ?? '')\" [group]=\"group()!\" [eventObs]=\"eventObs()\" />\n </div>\n }\n </div>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: PrintFieldComponent, selector: "mc-print-field", inputs: ["field", "control", "group", "eventObs"] }] });
|
|
382
|
+
}
|
|
383
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: RowFieldComponent, decorators: [{
|
|
384
|
+
type: Component,
|
|
385
|
+
args: [{ selector: 'mc-row-field', imports: [CommonModule, ReactiveFormsModule, PrintFieldComponent], template: "@if(newGroup()) {\n <div [formGroup]=\"newGroup()!\" class=\"mc-row-form flex flex-row gap-3\">\n @for (field of field().config.fields; track $index) {\n <div class=\"{{(field.config.containerFieldClass || 'mb-3 w-full')}}\">\n <mc-print-field [field]=\"field\" [control]=\"newGroup()!.get(field.key ?? '')\" [group]=\"newGroup()!\" [eventObs]=\"eventObs()\" />\n </div>\n }\n </div>\n} @else {\n <div class=\"mc-row-form flex flex-row gap-3\">\n @for (field of field().config.fields; track $index) {\n <div class=\"{{(field.config.containerFieldClass || 'mb-3 w-full')}}\">\n <mc-print-field [field]=\"field\" [control]=\"group()!.get(field.key ?? '')\" [group]=\"group()!\" [eventObs]=\"eventObs()\" />\n </div>\n }\n </div>\n}\n" }]
|
|
386
|
+
}] });
|
|
387
|
+
class RowField {
|
|
388
|
+
static initWithGroup(key, fields) {
|
|
389
|
+
let field = MCField.init({
|
|
390
|
+
key: key,
|
|
391
|
+
component: RowFieldComponent,
|
|
392
|
+
});
|
|
393
|
+
field.config = {
|
|
394
|
+
has_children: true,
|
|
395
|
+
fields: fields,
|
|
396
|
+
is_new_group: true
|
|
397
|
+
};
|
|
398
|
+
return field;
|
|
399
|
+
}
|
|
400
|
+
static init(fields) {
|
|
401
|
+
let field = MCField.init({
|
|
402
|
+
component: RowFieldComponent,
|
|
403
|
+
});
|
|
404
|
+
field.config = {
|
|
405
|
+
has_children: true,
|
|
406
|
+
fields: fields,
|
|
407
|
+
is_new_group: false
|
|
408
|
+
};
|
|
409
|
+
return field;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/*
|
|
414
|
+
* Public API Surface of form
|
|
415
|
+
*/
|
|
416
|
+
/**
|
|
417
|
+
* Entities
|
|
418
|
+
*/
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Generated bundle index. Do not edit.
|
|
422
|
+
*/
|
|
423
|
+
|
|
424
|
+
export { IftaTextField, IftaTextFieldComponent, MCConfigForm, MCConfigModalForm, MCEventForm, MCEventModalForm, MCField, MCFieldComponent, MCForm, MCFormModalComponent, MCFormModalService, MCFormService, MCIftaField, PrintFieldComponent, RowField, RowFieldComponent, SubmitButtonField, SubmitButtonFieldComponent };
|
|
425
|
+
//# sourceMappingURL=mckit-form.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mckit-form.mjs","sources":["../../../../projects/mckit/form/src/lib/entities/mc-field.ts","../../../../projects/mckit/form/src/lib/entities/mc-ifta-field.ts","../../../../projects/mckit/form/src/lib/entities/mc-config-form.ts","../../../../projects/mckit/form/src/lib/entities/mc-event-form.ts","../../../../projects/mckit/form/src/lib/services/mc-form.service.ts","../../../../projects/mckit/form/src/lib/components/print-field/print-field.component.ts","../../../../projects/mckit/form/src/lib/components/form/form.component.ts","../../../../projects/mckit/form/src/lib/components/form/form.component.html","../../../../projects/mckit/form/src/lib/components/form-modal/form-modal.component.ts","../../../../projects/mckit/form/src/lib/components/form-modal/form-modal.component.html","../../../../projects/mckit/form/src/lib/components/footer-modal-form/footer-modal-form.component.ts","../../../../projects/mckit/form/src/lib/components/footer-modal-form/footer-modal-form.component.html","../../../../projects/mckit/form/src/lib/services/form-modal.service.ts","../../../../projects/mckit/form/src/lib/fields/mc-field.component.ts","../../../../projects/mckit/form/src/lib/fields/ifta-text-field/ifta-text-field.component.ts","../../../../projects/mckit/form/src/lib/fields/ifta-text-field/ifta-text-field.component.html","../../../../projects/mckit/form/src/lib/fields/submit-button-field/submit-button-field.component.ts","../../../../projects/mckit/form/src/lib/fields/submit-button-field/submit-button-field.component.html","../../../../projects/mckit/form/src/lib/fields/row-field/row-field.component.ts","../../../../projects/mckit/form/src/lib/fields/row-field/row-field.component.html","../../../../projects/mckit/form/src/public-api.ts","../../../../projects/mckit/form/src/mckit-form.ts"],"sourcesContent":["import { ValidatorFn } from \"@angular/forms\";\n\nexport class MCField {\n key?: string;\n component: any;\n\n config?: any\n\n static initCustom(key: string, component: any, config: any): MCField {\n let field = new MCField();\n field.key = key;\n field.component = component;\n field.config = config;\n return field;\n }\n\n static init(data: {\n key?: string,\n component: any,\n validators?: ValidatorFn[],\n default_value?: any,\n disabled?: boolean,\n no_control?: boolean\n }): MCField {\n let field = new MCField();\n field.key = data.key;\n field.component = data.component;\n field.config = {\n validators: data.validators,\n default_value: data.default_value,\n disabled: data.disabled,\n no_control: data.no_control\n };\n return field;\n }\n}\n","import { ValidatorFn } from \"@angular/forms\";\nimport { MCField } from \"./mc-field\";\n\nexport class MCIftaField {\n\n static init(data: {\n key?: string,\n component: any,\n label: string,\n validators?: ValidatorFn[],\n default_value?: any,\n disabled?: boolean,\n no_control?: boolean\n }): MCField {\n let field = new MCField();\n field.key = data.key;\n field.component = data.component;\n field.config = {\n label: data.label,\n validators: data.validators,\n default_value: data.default_value,\n disabled: data.disabled,\n no_control: data.no_control\n };\n return field;\n }\n\n}\n","import { MCField } from \"./mc-field\";\n\nexport class MCConfigForm {\n fields: MCField[] = [];\n\n item: any;\n\n containerFieldClass?: string;\n}\n","export class MCEventForm {\n key!: string;\n content: any;\n\n static init(key: string, content?: any): MCEventForm {\n let eventForm = new MCEventForm();\n eventForm.key = key;\n eventForm.content = content;\n return eventForm;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { UntypedFormControl, UntypedFormGroup } from '@angular/forms';\nimport { MCField } from '../entities/mc-field';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class MCFormService {\n\n createControl(field: MCField): UntypedFormControl {\n let input = new UntypedFormControl();\n if(field.config.validators){\n input.setValidators(field.config.validators);\n }\n if(field.config.default){\n input.setValue(field.config.default);\n }\n if(field.config.disabled){\n input.disable();\n }\n\n return input;\n }\n\n loadFieldsInNewGroup(group: UntypedFormGroup, fields: MCField[], key: string, item: any) {\n let newGroup = new UntypedFormGroup({});\n this.loadFields(newGroup, fields, item);\n group.addControl(key, newGroup);\n }\n\n loadFieldsWithChildren(group: UntypedFormGroup, field: MCField, item: any) {\n if(field.config?.is_new_group){\n let fieldKey = field.key ?? 'row';\n let subitem = item && item[fieldKey] ? item[fieldKey] : undefined;\n this.loadFieldsInNewGroup(group, field.config.fields, fieldKey, subitem);\n } else {\n this.loadFields(group, field.config.fields, item);\n }\n }\n\n loadFields(group: UntypedFormGroup, fields: MCField[], item: any) {\n for (const field of fields) {\n if(field.config?.has_children){\n this.loadFieldsWithChildren(group, field, item);\n continue;\n }\n if(field.key == undefined || field.key == '' || field.config?.no_control) {\n continue;\n }\n\n group.addControl(field.key, this.createControl(field));\n\n if(item && item[field.key]){\n group.get(field.key)?.setValue(item[field.key]);\n }\n }\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { Component, inject, input, OnInit, ViewContainerRef } from '@angular/core';\nimport { MCField } from '../../entities/mc-field';\nimport { AbstractControl, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup } from '@angular/forms';\nimport { Subject } from 'rxjs';\nimport { MCEventForm } from '../../entities/mc-event-form';\n\n@Component({\n selector: 'mc-print-field',\n imports: [CommonModule, ReactiveFormsModule],\n template: '',\n styleUrl: './print-field.component.css'\n})\nexport class PrintFieldComponent implements OnInit {\n\n field = input.required<MCField>();\n control = input<AbstractControl|null>();\n group = input<UntypedFormGroup>();\n eventObs = input<Subject<MCEventForm>>();\n\n viewContainerRef = inject(ViewContainerRef);\n\n ngOnInit(): void {\n const view = this.viewContainerRef.createComponent(this.field().component);\n view.setInput('field', this.field());\n view.setInput('control', this.control());\n view.setInput('group', this.group());\n view.setInput('eventObs', this.eventObs());\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { Component, inject, input, OnInit, output, signal } from '@angular/core';\nimport { MCConfigForm } from '../../entities/mc-config-form';\nimport { PrintFieldComponent } from '../print-field/print-field.component';\nimport { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';\nimport { MCFormService } from '../../services/mc-form.service';\nimport { MCEventForm } from '../../entities/mc-event-form';\nimport { Subject, Subscription } from 'rxjs';\n\n@Component({\n selector: 'mc-form',\n imports: [CommonModule, ReactiveFormsModule, PrintFieldComponent],\n templateUrl: './form.component.html',\n styleUrl: './form.component.scss'\n})\nexport class MCForm implements OnInit {\n config = input.required<MCConfigForm>();\n\n formGroup = signal<UntypedFormGroup|undefined>(undefined);\n\n formService = inject(MCFormService);\n\n onEvent = output<MCEventForm>();\n eventObs = new Subject<MCEventForm>();\n eventSubscription?: Subscription;\n\n ngOnInit(): void {\n this.eventSubscription = this.eventObs.subscribe(event => this.onEvent.emit(event));\n this.loadFields();\n }\n\n ngOnDestroy(): void {\n this.eventSubscription?.unsubscribe();\n }\n\n emitEvent(event: MCEventForm) {\n this.eventObs.next(event);\n }\n\n loadFields() {\n let group = new UntypedFormGroup({});\n let fields = this.config().fields ?? [];\n this.formService.loadFields(group, fields, this.config().item);\n this.formGroup.set(group);\n }\n}\n","@if(formGroup()) {\n <form [formGroup]=\"formGroup()!\" class=\"mc-form\">\n @for (field of config().fields; track $index) {\n <div class=\"{{(config().containerFieldClass || 'mb-3')}}\">\n <mc-print-field [field]=\"field\" [control]=\"formGroup()!.get(field.key ?? '')\" [group]=\"formGroup()!\" [eventObs]=\"eventObs\" />\n </div>\n }\n </form>\n}\n","import { CommonModule } from '@angular/common';\nimport { Component, inject, OnInit, signal, viewChild } from '@angular/core';\nimport { MCForm } from '../form/form.component';\nimport { DialogService, DynamicDialogComponent, DynamicDialogRef } from 'primeng/dynamicdialog';\nimport { MCConfigForm } from '../../entities/mc-config-form';\nimport { MCEventForm } from '../../entities/mc-event-form';\nimport { Subject } from 'rxjs';\nimport { UntypedFormGroup } from '@angular/forms';\n\nexport class MCEventModalForm extends MCEventForm {\n dialog?: DynamicDialogRef;\n}\n\n@Component({\n selector: 'mc-form-modal',\n imports: [CommonModule, MCForm],\n templateUrl: './form-modal.component.html',\n styleUrl: './form-modal.component.css'\n})\nexport class MCFormModalComponent implements OnInit {\n\n formComponent = viewChild(MCForm);\n\n dialogService = inject(DialogService);\n dialogRef = inject(DynamicDialogRef);\n\n formConfig = signal<MCConfigForm>(new MCConfigForm());\n\n eventObs = new Subject<MCEventModalForm>();\n\n ngOnInit(): void {\n this.initForm();\n }\n\n onEventForm(event: MCEventForm) {\n this.eventObs.next({ ...event, dialog: this.dialogRef });\n }\n\n initForm() {\n let instance: DynamicDialogComponent = this.dialogService.getInstance(this.dialogRef);\n if(instance.data == undefined){\n this.dialogRef.close();\n return;\n }\n\n this.formConfig.set(instance.data);\n }\n\n getFormGroup(): UntypedFormGroup|undefined {\n return this.formComponent()?.formGroup();\n }\n\n getEventObs(): Subject<MCEventModalForm> {\n return this.eventObs;\n }\n}\n","<mc-form [config]=\"formConfig()\" (onEvent)=\"onEventForm($event)\" />\n","import { Component, inject, OnInit, signal, WritableSignal } from '@angular/core';\nimport { DialogService, DynamicDialogComponent, DynamicDialogRef } from 'primeng/dynamicdialog';\nimport { MCEventModalForm, MCFormModalComponent } from '../form-modal/form-modal.component';\nimport { CommonModule } from '@angular/common';\nimport { ButtonModule } from 'primeng/button';\nimport { UntypedFormGroup } from '@angular/forms';\nimport { Subject, take } from 'rxjs';\n\n@Component({\n selector: 'mc-footer-modal-form',\n imports: [CommonModule, ButtonModule],\n templateUrl: './footer-modal-form.component.html',\n styleUrl: './footer-modal-form.component.css'\n})\nexport class MCFooterModalForm implements OnInit {\n\n dialogService = inject(DialogService);\n dialogRef = inject(DynamicDialogRef<MCFormModalComponent>);\n\n isLoading = signal<boolean>(false);\n\n group?: WritableSignal<UntypedFormGroup|undefined>;\n\n eventObs?: Subject<MCEventModalForm>;\n\n ngOnInit(): void {\n this.initConfig();\n }\n\n onClickCancel() {\n this.eventObs?.next(MCEventModalForm.init('close'));\n this.dialogRef.close();\n }\n\n onClickSubmit() {\n this.isLoading.set(true);\n\n let event = new MCEventModalForm();\n event.key = 'submit';\n event.dialog = this.dialogRef;\n if(this.group != undefined){\n event.content = this.group()?.value;\n }\n\n this.eventObs?.next(event);\n }\n\n initConfig() {\n let instance: DynamicDialogComponent = this.dialogService.getInstance(this.dialogRef);\n if(instance.data == undefined){\n this.dialogRef.close();\n return;\n }\n\n this.dialogRef.onChildComponentLoaded\n .pipe(take(1))\n .subscribe((comp) => {\n this.group = comp.formComponent()?.formGroup;\n this.eventObs = comp.getEventObs();\n });\n }\n}\n","<p-button label=\"Cancel\" severity=\"secondary\" (onClick)=\"onClickCancel()\" styleClass=\"mr-3\" />\n@if(group != undefined){\n <p-button label=\"Submit\" severity=\"primary\" (onClick)=\"onClickSubmit()\" icon=\"pi pi-send\" [disabled]=\"!group()?.valid || group()?.disabled\" [loading]=\"isLoading()\" />\n}\n\n","import { inject, Injectable } from '@angular/core';\nimport { DialogService, DynamicDialogRef } from 'primeng/dynamicdialog';\nimport { MCConfigForm } from '../entities/mc-config-form';\nimport { MCEventModalForm, MCFormModalComponent } from '../components/form-modal/form-modal.component';\nimport { MCFooterModalForm } from '../components/footer-modal-form/footer-modal-form.component';\nimport { Observable, switchMap } from 'rxjs';\n\nexport class MCConfigModalForm extends MCConfigForm {\n title?: string;\n position?: string;\n styleClass?: string;\n style?: any;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MCFormModalService {\n\n dialogService = inject(DialogService);\n\n open(config: MCConfigModalForm): Observable<MCEventModalForm> {\n let dialog: DynamicDialogRef<MCFormModalComponent> = this.dialogService.open(MCFormModalComponent, {\n header: config.title,\n footer: 'Test footer',\n style: config.style,\n styleClass: config.styleClass,\n closable: true,\n dismissableMask: true,\n position: config.position,\n templates: {\n footer: MCFooterModalForm\n },\n data: config\n });\n\n return dialog.onChildComponentLoaded\n .pipe(switchMap((comp: MCFormModalComponent) => comp.getEventObs()));\n }\n\n openRight(config: MCConfigModalForm): Observable<MCEventModalForm> {\n config.position = 'right';\n config.style = { margin: '0px !important', 'max-height': '100%' };\n config.styleClass = 'w-full md:w-2xl mc-form-modal';\n return this.open(config);\n }\n}\n","import { Component, input } from \"@angular/core\";\nimport { MCField } from \"../entities/mc-field\";\nimport { UntypedFormControl, UntypedFormGroup } from \"@angular/forms\";\nimport { Subject } from \"rxjs\";\nimport { MCEventForm } from \"../entities/mc-event-form\";\n\n@Component({\n selector: 'mc-field',\n template: ''\n})\nexport class MCFieldComponent {\n field = input.required<MCField>();\n control = input<UntypedFormControl>();\n group = input.required<UntypedFormGroup>();\n eventObs = input<Subject<MCEventForm>>();\n}\n","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\nimport { IftaLabelModule } from 'primeng/iftalabel';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { MCFieldComponent } from '../mc-field.component';\nimport { MCField } from '../../entities/mc-field';\nimport { MCIftaField } from '../../entities/mc-ifta-field';\nimport { ReactiveFormsModule, ValidatorFn } from '@angular/forms';\n\n@Component({\n selector: 'mc-ifta-text-field',\n imports: [CommonModule, ReactiveFormsModule, IftaLabelModule, InputTextModule],\n templateUrl: './ifta-text-field.component.html',\n styleUrl: './ifta-text-field.component.css'\n})\nexport class IftaTextFieldComponent extends MCFieldComponent {\n\n}\n\nexport class IftaTextField {\n\n static init(key: string|undefined, label: string, config?: {\n validators?: ValidatorFn[],\n default_value?: any,\n disabled?: boolean\n }): MCField {\n return MCIftaField.init({\n key: key,\n component: IftaTextFieldComponent,\n label: label,\n validators: config?.validators,\n default_value: config?.default_value,\n disabled: config?.disabled\n });\n }\n\n}\n","<p-iftalabel>\n <input pInputText id=\"{{field().key}}\" class=\"w-full\" [formControl]=\"control()!\" />\n <label for=\"{{field().key}}\">{{field().config.label}}</label>\n</p-iftalabel>\n","import { Component, OnInit, signal } from '@angular/core';\nimport { MCFieldComponent } from '../mc-field.component';\nimport { CommonModule } from '@angular/common';\nimport { ButtonModule } from 'primeng/button';\nimport { MCField } from '../../entities/mc-field';\nimport { MCIftaField } from '../../entities/mc-ifta-field';\nimport { MCEventForm } from '../../entities/mc-event-form';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'mc-submit-button-field',\n imports: [CommonModule, ButtonModule],\n templateUrl: './submit-button-field.component.html',\n styleUrl: './submit-button-field.component.css'\n})\nexport class SubmitButtonFieldComponent extends MCFieldComponent implements OnInit {\n\n isLoading = signal<boolean>(false);\n\n eventSubscription?: Subscription;\n\n ngOnInit(): void {\n this.eventSubscription = this.eventObs()?.subscribe(event => {\n if(event.key == 'stop-loading') {\n this.isLoading.set(false);\n }\n });\n }\n\n onClick() {\n this.isLoading.set(true);\n this.eventObs()?.next(MCEventForm.init(this.field().key ?? 'submit', this.group()?.value));\n }\n}\n\nexport class SubmitButtonField {\n\n static init(key: string|undefined, label: string, config?: {\n icon?: string,\n disabled?: boolean\n }): MCField {\n let field = MCIftaField.init({\n key: key,\n component: SubmitButtonFieldComponent,\n label: label,\n disabled: config?.disabled,\n no_control: true\n });\n field.config.icon = config?.icon;\n return field;\n }\n\n}\n","<div class=\"flex justify-end\">\n <p-button [label]=\"field().config.label\" [disabled]=\"!group().valid || group().disabled\" (onClick)=\"onClick()\" [loading]=\"isLoading()\" [icon]=\"field().config.icon\" />\n</div>\n","import { Component, computed, inject } from '@angular/core';\nimport { MCFieldComponent } from '../mc-field.component';\nimport { CommonModule } from '@angular/common';\nimport { MCField } from '../../entities/mc-field';\nimport { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';\nimport { PrintFieldComponent } from '../../components/print-field/print-field.component';\n\n@Component({\n selector: 'mc-row-field',\n imports: [CommonModule, ReactiveFormsModule, PrintFieldComponent],\n templateUrl: './row-field.component.html',\n styleUrl: './row-field.component.css'\n})\nexport class RowFieldComponent extends MCFieldComponent {\n\n newGroup = computed<UntypedFormGroup|undefined>(() => {\n if(this.field().config?.is_new_group) {\n return this.group().get(this.field().key!) as UntypedFormGroup;\n }\n\n return undefined;\n });\n}\n\nexport class RowField {\n\n static initWithGroup(key: string, fields: MCField[]): MCField {\n let field = MCField.init({\n key: key,\n component: RowFieldComponent,\n });\n field.config = {\n has_children: true,\n fields: fields,\n is_new_group: true\n }\n\n return field;\n }\n\n static init(fields: MCField[]): MCField {\n let field = MCField.init({\n component: RowFieldComponent,\n });\n field.config = {\n has_children: true,\n fields: fields,\n is_new_group: false\n }\n\n return field;\n }\n}\n","@if(newGroup()) {\n <div [formGroup]=\"newGroup()!\" class=\"mc-row-form flex flex-row gap-3\">\n @for (field of field().config.fields; track $index) {\n <div class=\"{{(field.config.containerFieldClass || 'mb-3 w-full')}}\">\n <mc-print-field [field]=\"field\" [control]=\"newGroup()!.get(field.key ?? '')\" [group]=\"newGroup()!\" [eventObs]=\"eventObs()\" />\n </div>\n }\n </div>\n} @else {\n <div class=\"mc-row-form flex flex-row gap-3\">\n @for (field of field().config.fields; track $index) {\n <div class=\"{{(field.config.containerFieldClass || 'mb-3 w-full')}}\">\n <mc-print-field [field]=\"field\" [control]=\"group()!.get(field.key ?? '')\" [group]=\"group()!\" [eventObs]=\"eventObs()\" />\n </div>\n }\n </div>\n}\n","/*\n * Public API Surface of form\n */\n\n/**\n * Entities\n */\nexport * from './lib/entities/mc-field';\nexport * from './lib/entities/mc-ifta-field';\nexport * from './lib/entities/mc-config-form';\nexport * from './lib/entities/mc-event-form';\n\n/**\n * Services\n */\nexport * from './lib/services/mc-form.service';\nexport * from './lib/services/form-modal.service';\n\n/**\n * Fields\n */\nexport * from './lib/fields/mc-field.component';\nexport * from './lib/fields/ifta-text-field/ifta-text-field.component';\nexport * from './lib/fields/submit-button-field/submit-button-field.component';\nexport * from './lib/fields/row-field/row-field.component';\n\n/**\n * Components\n */\nexport * from './lib/components/print-field/print-field.component';\nexport * from './lib/components/form/form.component';\nexport * from './lib/components/form-modal/form-modal.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;MAEa,OAAO,CAAA;AAClB,IAAA,GAAG;AACH,IAAA,SAAS;AAET,IAAA,MAAM;AAEN,IAAA,OAAO,UAAU,CAAC,GAAW,EAAE,SAAc,EAAE,MAAW,EAAA;AACxD,QAAA,IAAI,KAAK,GAAG,IAAI,OAAO,EAAE;AACzB,QAA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AAA,EAAA,CAAA;kBAN7B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,cAAc,WACf,CAAC,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,CAAC,EAAA,QAAA,EAAA,+wBAAA,EAAA;;MAetD,QAAQ,CAAA;AAEnB,IAAA,OAAO,aAAa,CAAC,GAAW,EAAE,MAAiB,EAAA;AACjD,QAAA,IAAI,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;AACvB,YAAA,GAAG,EAAE,GAAG;AACR,YAAA,SAAS,EAAE,iBAAiB;AAC7B,SAAA,CAAC;QACF,KAAK,CAAC,MAAM,GAAG;AACb,YAAA,YAAY,EAAE,IAAI;AAClB,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,YAAY,EAAE;SACf;AAED,QAAA,OAAO,KAAK;;IAGd,OAAO,IAAI,CAAC,MAAiB,EAAA;AAC3B,QAAA,IAAI,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;AACvB,YAAA,SAAS,EAAE,iBAAiB;AAC7B,SAAA,CAAC;QACF,KAAK,CAAC,MAAM,GAAG;AACb,YAAA,YAAY,EAAE,IAAI;AAClB,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,YAAY,EAAE;SACf;AAED,QAAA,OAAO,KAAK;;AAEf;;AEpDD;;AAEG;AAEH;;AAEG;;ACNH;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OnInit, WritableSignal } from '@angular/core';
|
|
2
|
+
import { DialogService, DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
3
|
+
import { MCEventModalForm, MCFormModalComponent } from '../form-modal/form-modal.component';
|
|
4
|
+
import { UntypedFormGroup } from '@angular/forms';
|
|
5
|
+
import { Subject } from 'rxjs';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class MCFooterModalForm implements OnInit {
|
|
8
|
+
dialogService: DialogService;
|
|
9
|
+
dialogRef: DynamicDialogRef<MCFormModalComponent>;
|
|
10
|
+
isLoading: WritableSignal<boolean>;
|
|
11
|
+
group?: WritableSignal<UntypedFormGroup | undefined>;
|
|
12
|
+
eventObs?: Subject<MCEventModalForm>;
|
|
13
|
+
ngOnInit(): void;
|
|
14
|
+
onClickCancel(): void;
|
|
15
|
+
onClickSubmit(): void;
|
|
16
|
+
initConfig(): void;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MCFooterModalForm, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MCFooterModalForm, "mc-footer-modal-form", never, {}, {}, never, never, true, never>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { MCConfigForm } from '../../entities/mc-config-form';
|
|
3
|
+
import { UntypedFormGroup } from '@angular/forms';
|
|
4
|
+
import { MCFormService } from '../../services/mc-form.service';
|
|
5
|
+
import { MCEventForm } from '../../entities/mc-event-form';
|
|
6
|
+
import { Subject, Subscription } from 'rxjs';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class MCForm implements OnInit {
|
|
9
|
+
config: import("@angular/core").InputSignal<MCConfigForm>;
|
|
10
|
+
formGroup: import("@angular/core").WritableSignal<UntypedFormGroup | undefined>;
|
|
11
|
+
formService: MCFormService;
|
|
12
|
+
onEvent: import("@angular/core").OutputEmitterRef<MCEventForm>;
|
|
13
|
+
eventObs: Subject<MCEventForm>;
|
|
14
|
+
eventSubscription?: Subscription;
|
|
15
|
+
ngOnInit(): void;
|
|
16
|
+
ngOnDestroy(): void;
|
|
17
|
+
emitEvent(event: MCEventForm): void;
|
|
18
|
+
loadFields(): void;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MCForm, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MCForm, "mc-form", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "onEvent": "onEvent"; }, never, never, true, never>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { MCForm } from '../form/form.component';
|
|
3
|
+
import { DialogService, DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
4
|
+
import { MCConfigForm } from '../../entities/mc-config-form';
|
|
5
|
+
import { MCEventForm } from '../../entities/mc-event-form';
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
7
|
+
import { UntypedFormGroup } from '@angular/forms';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class MCEventModalForm extends MCEventForm {
|
|
10
|
+
dialog?: DynamicDialogRef;
|
|
11
|
+
}
|
|
12
|
+
export declare class MCFormModalComponent implements OnInit {
|
|
13
|
+
formComponent: import("@angular/core").Signal<MCForm | undefined>;
|
|
14
|
+
dialogService: DialogService;
|
|
15
|
+
dialogRef: DynamicDialogRef<any>;
|
|
16
|
+
formConfig: import("@angular/core").WritableSignal<MCConfigForm>;
|
|
17
|
+
eventObs: Subject<MCEventModalForm>;
|
|
18
|
+
ngOnInit(): void;
|
|
19
|
+
onEventForm(event: MCEventForm): void;
|
|
20
|
+
initForm(): void;
|
|
21
|
+
getFormGroup(): UntypedFormGroup | undefined;
|
|
22
|
+
getEventObs(): Subject<MCEventModalForm>;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MCFormModalComponent, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MCFormModalComponent, "mc-form-modal", never, {}, {}, never, never, true, never>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OnInit, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { MCField } from '../../entities/mc-field';
|
|
3
|
+
import { AbstractControl, UntypedFormGroup } from '@angular/forms';
|
|
4
|
+
import { Subject } from 'rxjs';
|
|
5
|
+
import { MCEventForm } from '../../entities/mc-event-form';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class PrintFieldComponent implements OnInit {
|
|
8
|
+
field: import("@angular/core").InputSignal<MCField>;
|
|
9
|
+
control: import("@angular/core").InputSignal<AbstractControl<any, any> | null | undefined>;
|
|
10
|
+
group: import("@angular/core").InputSignal<UntypedFormGroup | undefined>;
|
|
11
|
+
eventObs: import("@angular/core").InputSignal<Subject<MCEventForm> | undefined>;
|
|
12
|
+
viewContainerRef: ViewContainerRef;
|
|
13
|
+
ngOnInit(): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PrintFieldComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PrintFieldComponent, "mc-print-field", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "group": { "alias": "group"; "required": false; "isSignal": true; }; "eventObs": { "alias": "eventObs"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ValidatorFn } from "@angular/forms";
|
|
2
|
+
export declare class MCField {
|
|
3
|
+
key?: string;
|
|
4
|
+
component: any;
|
|
5
|
+
config?: any;
|
|
6
|
+
static initCustom(key: string, component: any, config: any): MCField;
|
|
7
|
+
static init(data: {
|
|
8
|
+
key?: string;
|
|
9
|
+
component: any;
|
|
10
|
+
validators?: ValidatorFn[];
|
|
11
|
+
default_value?: any;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
no_control?: boolean;
|
|
14
|
+
}): MCField;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ValidatorFn } from "@angular/forms";
|
|
2
|
+
import { MCField } from "./mc-field";
|
|
3
|
+
export declare class MCIftaField {
|
|
4
|
+
static init(data: {
|
|
5
|
+
key?: string;
|
|
6
|
+
component: any;
|
|
7
|
+
label: string;
|
|
8
|
+
validators?: ValidatorFn[];
|
|
9
|
+
default_value?: any;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
no_control?: boolean;
|
|
12
|
+
}): MCField;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MCFieldComponent } from '../mc-field.component';
|
|
2
|
+
import { MCField } from '../../entities/mc-field';
|
|
3
|
+
import { ValidatorFn } from '@angular/forms';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class IftaTextFieldComponent extends MCFieldComponent {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IftaTextFieldComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<IftaTextFieldComponent, "mc-ifta-text-field", never, {}, {}, never, never, true, never>;
|
|
8
|
+
}
|
|
9
|
+
export declare class IftaTextField {
|
|
10
|
+
static init(key: string | undefined, label: string, config?: {
|
|
11
|
+
validators?: ValidatorFn[];
|
|
12
|
+
default_value?: any;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}): MCField;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MCField } from "../entities/mc-field";
|
|
2
|
+
import { UntypedFormControl, UntypedFormGroup } from "@angular/forms";
|
|
3
|
+
import { Subject } from "rxjs";
|
|
4
|
+
import { MCEventForm } from "../entities/mc-event-form";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class MCFieldComponent {
|
|
7
|
+
field: import("@angular/core").InputSignal<MCField>;
|
|
8
|
+
control: import("@angular/core").InputSignal<UntypedFormControl | undefined>;
|
|
9
|
+
group: import("@angular/core").InputSignal<UntypedFormGroup>;
|
|
10
|
+
eventObs: import("@angular/core").InputSignal<Subject<MCEventForm> | undefined>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MCFieldComponent, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MCFieldComponent, "mc-field", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "group": { "alias": "group"; "required": true; "isSignal": true; }; "eventObs": { "alias": "eventObs"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MCFieldComponent } from '../mc-field.component';
|
|
2
|
+
import { MCField } from '../../entities/mc-field';
|
|
3
|
+
import { UntypedFormGroup } from '@angular/forms';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class RowFieldComponent extends MCFieldComponent {
|
|
6
|
+
newGroup: import("@angular/core").Signal<UntypedFormGroup | undefined>;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RowFieldComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RowFieldComponent, "mc-row-field", never, {}, {}, never, never, true, never>;
|
|
9
|
+
}
|
|
10
|
+
export declare class RowField {
|
|
11
|
+
static initWithGroup(key: string, fields: MCField[]): MCField;
|
|
12
|
+
static init(fields: MCField[]): MCField;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { MCFieldComponent } from '../mc-field.component';
|
|
3
|
+
import { MCField } from '../../entities/mc-field';
|
|
4
|
+
import { Subscription } from 'rxjs';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class SubmitButtonFieldComponent extends MCFieldComponent implements OnInit {
|
|
7
|
+
isLoading: import("@angular/core").WritableSignal<boolean>;
|
|
8
|
+
eventSubscription?: Subscription;
|
|
9
|
+
ngOnInit(): void;
|
|
10
|
+
onClick(): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SubmitButtonFieldComponent, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SubmitButtonFieldComponent, "mc-submit-button-field", never, {}, {}, never, never, true, never>;
|
|
13
|
+
}
|
|
14
|
+
export declare class SubmitButtonField {
|
|
15
|
+
static init(key: string | undefined, label: string, config?: {
|
|
16
|
+
icon?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}): MCField;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DialogService } from 'primeng/dynamicdialog';
|
|
2
|
+
import { MCConfigForm } from '../entities/mc-config-form';
|
|
3
|
+
import { MCEventModalForm } from '../components/form-modal/form-modal.component';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class MCConfigModalForm extends MCConfigForm {
|
|
7
|
+
title?: string;
|
|
8
|
+
position?: string;
|
|
9
|
+
styleClass?: string;
|
|
10
|
+
style?: any;
|
|
11
|
+
}
|
|
12
|
+
export declare class MCFormModalService {
|
|
13
|
+
dialogService: DialogService;
|
|
14
|
+
open(config: MCConfigModalForm): Observable<MCEventModalForm>;
|
|
15
|
+
openRight(config: MCConfigModalForm): Observable<MCEventModalForm>;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MCFormModalService, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MCFormModalService>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
|
2
|
+
import { MCField } from '../entities/mc-field';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MCFormService {
|
|
5
|
+
createControl(field: MCField): UntypedFormControl;
|
|
6
|
+
loadFieldsInNewGroup(group: UntypedFormGroup, fields: MCField[], key: string, item: any): void;
|
|
7
|
+
loadFieldsWithChildren(group: UntypedFormGroup, field: MCField, item: any): void;
|
|
8
|
+
loadFields(group: UntypedFormGroup, fields: MCField[], item: any): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MCFormService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MCFormService>;
|
|
11
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mckit/form",
|
|
3
|
+
"version": "19.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^19.1.0",
|
|
6
|
+
"@angular/core": "^19.1.0",
|
|
7
|
+
"@primeng/themes": "^19.0.0",
|
|
8
|
+
"@mckit/core": "^19.0.0"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"tslib": "^2.3.0"
|
|
12
|
+
},
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"module": "fesm2022/mckit-form.mjs",
|
|
15
|
+
"typings": "index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
"./package.json": {
|
|
18
|
+
"default": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./index.d.ts",
|
|
22
|
+
"default": "./fesm2022/mckit-form.mjs"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entities
|
|
3
|
+
*/
|
|
4
|
+
export * from './lib/entities/mc-field';
|
|
5
|
+
export * from './lib/entities/mc-ifta-field';
|
|
6
|
+
export * from './lib/entities/mc-config-form';
|
|
7
|
+
export * from './lib/entities/mc-event-form';
|
|
8
|
+
/**
|
|
9
|
+
* Services
|
|
10
|
+
*/
|
|
11
|
+
export * from './lib/services/mc-form.service';
|
|
12
|
+
export * from './lib/services/form-modal.service';
|
|
13
|
+
/**
|
|
14
|
+
* Fields
|
|
15
|
+
*/
|
|
16
|
+
export * from './lib/fields/mc-field.component';
|
|
17
|
+
export * from './lib/fields/ifta-text-field/ifta-text-field.component';
|
|
18
|
+
export * from './lib/fields/submit-button-field/submit-button-field.component';
|
|
19
|
+
export * from './lib/fields/row-field/row-field.component';
|
|
20
|
+
/**
|
|
21
|
+
* Components
|
|
22
|
+
*/
|
|
23
|
+
export * from './lib/components/print-field/print-field.component';
|
|
24
|
+
export * from './lib/components/form/form.component';
|
|
25
|
+
export * from './lib/components/form-modal/form-modal.component';
|