@dynamic-field-kit/angular 1.2.4 → 1.2.10

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.
Files changed (55) hide show
  1. package/README.md +54 -46
  2. package/dist/README.md +126 -0
  3. package/dist/components/BaseInput.d.ts +22 -0
  4. package/{components → dist/components}/DynamicInput.d.ts +24 -28
  5. package/dist/components/FieldInput.d.ts +14 -0
  6. package/{components → dist/components}/MultiFieldInput.d.ts +23 -23
  7. package/dist/esm2022/components/BaseInput.mjs +60 -0
  8. package/dist/esm2022/components/DynamicInput.mjs +162 -0
  9. package/dist/esm2022/components/FieldInput.mjs +71 -0
  10. package/dist/esm2022/components/MultiFieldInput.mjs +85 -0
  11. package/{esm2020 → dist/esm2022}/dynamic-field-kit-angular.mjs +4 -4
  12. package/dist/esm2022/layout/defaultLayouts.mjs +67 -0
  13. package/{esm2020 → dist/esm2022}/layout/index.mjs +2 -2
  14. package/dist/esm2022/lib/dynamic-field-kit.module.mjs +52 -0
  15. package/{esm2020 → dist/esm2022}/public-api.mjs +14 -14
  16. package/{esm2020 → dist/esm2022}/types/layout.mjs +2 -2
  17. package/{fesm2020 → dist/fesm2022}/dynamic-field-kit-angular.mjs +434 -337
  18. package/dist/fesm2022/dynamic-field-kit-angular.mjs.map +1 -0
  19. package/{index.d.ts → dist/index.d.ts} +5 -5
  20. package/{layout → dist/layout}/defaultLayouts.d.ts +13 -13
  21. package/dist/layout/index.d.ts +1 -0
  22. package/{lib → dist/lib}/dynamic-field-kit.module.d.ts +11 -11
  23. package/{public-api.d.ts → dist/public-api.d.ts} +9 -9
  24. package/dist/types/layout.d.ts +1 -0
  25. package/ng-package.json +7 -0
  26. package/package.json +31 -28
  27. package/src/adapters/tailwind.ts +13 -0
  28. package/src/components/BaseInput.ts +31 -0
  29. package/src/components/DynamicInput.ts +188 -0
  30. package/src/components/FieldInput.ts +49 -0
  31. package/src/components/MultiFieldInput.ts +75 -0
  32. package/src/components/imports.ts +3 -0
  33. package/src/examples/index.ts +4 -0
  34. package/src/examples/registerExample.ts +7 -0
  35. package/src/examples/text-field.component.ts +18 -0
  36. package/src/layout/defaultLayouts.ts +38 -0
  37. package/src/layout/index.ts +1 -0
  38. package/src/lib/dynamic-field-kit.module.ts +29 -0
  39. package/src/public-api.ts +24 -0
  40. package/src/types/layout.ts +1 -0
  41. package/src/types.ts +1 -0
  42. package/tsconfig.json +13 -0
  43. package/components/BaseInput.d.ts +0 -22
  44. package/components/FieldInput.d.ts +0 -14
  45. package/esm2020/components/BaseInput.mjs +0 -46
  46. package/esm2020/components/DynamicInput.mjs +0 -146
  47. package/esm2020/components/FieldInput.mjs +0 -66
  48. package/esm2020/components/MultiFieldInput.mjs +0 -79
  49. package/esm2020/layout/defaultLayouts.mjs +0 -43
  50. package/esm2020/lib/dynamic-field-kit.module.mjs +0 -20
  51. package/fesm2015/dynamic-field-kit-angular.mjs +0 -393
  52. package/fesm2015/dynamic-field-kit-angular.mjs.map +0 -1
  53. package/fesm2020/dynamic-field-kit-angular.mjs.map +0 -1
  54. package/layout/index.d.ts +0 -1
  55. package/types/layout.d.ts +0 -1
@@ -1,210 +1,240 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, Input, Output, SimpleChange, ViewContainerRef, ViewChild, NgModule } from '@angular/core';
2
+ import { EventEmitter, Output, Input, Component, SimpleChange, ViewContainerRef, ViewChild, NgModule } from '@angular/core';
3
3
  import { CommonModule, NgIf, NgClass, NgFor } from '@angular/common';
4
4
  import { fieldRegistry } from '@dynamic-field-kit/core';
5
5
  export { fieldRegistry } from '@dynamic-field-kit/core';
6
6
 
7
- class BaseInputComponent {
8
- constructor(cdr) {
9
- this.cdr = cdr;
10
- // Add more from mplis as needed
11
- this.valueChange = new EventEmitter();
12
- }
13
- }
14
- BaseInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BaseInputComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
15
- BaseInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: BaseInputComponent, selector: "ng-component", inputs: { value: "value", label: "label", placeholder: "placeholder", required: "required", disabled: "disabled", options: "options", className: "className", description: "description", errorMessage: "errorMessage", acceptFile: "acceptFile", maxLength: "maxLength", minNumber: "minNumber", maxNumber: "maxNumber" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: '', isInline: true });
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BaseInputComponent, decorators: [{
17
- type: Component,
18
- args: [{
19
- template: ''
20
- }]
21
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { value: [{
22
- type: Input
23
- }], label: [{
24
- type: Input
25
- }], placeholder: [{
26
- type: Input
27
- }], required: [{
28
- type: Input
29
- }], disabled: [{
30
- type: Input
31
- }], options: [{
32
- type: Input
33
- }], className: [{
34
- type: Input
35
- }], description: [{
36
- type: Input
37
- }], errorMessage: [{
38
- type: Input
39
- }], acceptFile: [{
40
- type: Input
41
- }], maxLength: [{
42
- type: Input
43
- }], minNumber: [{
44
- type: Input
45
- }], maxNumber: [{
46
- type: Input
47
- }], valueChange: [{
48
- type: Output
7
+ class BaseInputComponent {
8
+ cdr;
9
+ value;
10
+ label;
11
+ placeholder;
12
+ required;
13
+ disabled;
14
+ options;
15
+ className;
16
+ description;
17
+ errorMessage;
18
+ acceptFile;
19
+ maxLength;
20
+ minNumber;
21
+ maxNumber;
22
+ // Add more from mplis as needed
23
+ valueChange = new EventEmitter();
24
+ constructor(cdr) {
25
+ this.cdr = cdr;
26
+ }
27
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BaseInputComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
28
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BaseInputComponent, isStandalone: true, selector: "ng-component", inputs: { value: "value", label: "label", placeholder: "placeholder", required: "required", disabled: "disabled", options: "options", className: "className", description: "description", errorMessage: "errorMessage", acceptFile: "acceptFile", maxLength: "maxLength", minNumber: "minNumber", maxNumber: "maxNumber" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: '', isInline: true });
29
+ }
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BaseInputComponent, decorators: [{
31
+ type: Component,
32
+ args: [{
33
+ template: '',
34
+ }]
35
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { value: [{
36
+ type: Input
37
+ }], label: [{
38
+ type: Input
39
+ }], placeholder: [{
40
+ type: Input
41
+ }], required: [{
42
+ type: Input
43
+ }], disabled: [{
44
+ type: Input
45
+ }], options: [{
46
+ type: Input
47
+ }], className: [{
48
+ type: Input
49
+ }], description: [{
50
+ type: Input
51
+ }], errorMessage: [{
52
+ type: Input
53
+ }], acceptFile: [{
54
+ type: Input
55
+ }], maxLength: [{
56
+ type: Input
57
+ }], minNumber: [{
58
+ type: Input
59
+ }], maxNumber: [{
60
+ type: Input
61
+ }], valueChange: [{
62
+ type: Output
49
63
  }] } });
50
64
 
51
- class DynamicInput extends BaseInputComponent {
52
- constructor() {
53
- super(...arguments);
54
- this.valueChange = new EventEmitter();
55
- this.onChange = new EventEmitter(); // backward compat
56
- }
57
- ngOnChanges(changes) {
58
- if (changes["type"] && !changes["type"].firstChange && this.host) {
59
- this.render();
60
- return;
61
- }
62
- if (this.inputInstance) {
63
- this.applyKnownProps(this.inputInstance);
64
- const childChanges = {};
65
- for (const prop in changes) {
66
- childChanges[prop] = new SimpleChange(changes[prop].previousValue, changes[prop].currentValue, changes[prop].firstChange);
67
- }
68
- this.inputInstance.ngOnChanges?.(childChanges);
69
- this.compRef?.changeDetectorRef.detectChanges();
70
- }
71
- else if (this.host) {
72
- this.render();
73
- }
74
- }
75
- ngAfterViewInit() {
76
- this.render();
77
- }
78
- render() {
79
- const Renderer = fieldRegistry.get(this.type);
80
- this.cleanupRenderedComponent();
81
- this.host.clear();
82
- if (!Renderer) {
83
- const el = document.createElement("div");
84
- el.textContent = `Unknown field type: ${this.type}`;
85
- this.host.element.nativeElement.appendChild(el);
86
- return;
87
- }
88
- try {
89
- const compType = Renderer;
90
- const compRef = this.host.createComponent(compType);
91
- const instance = compRef.instance;
92
- if (!instance)
93
- throw new Error(`Failed to create instance for ${this.type}`);
94
- this.applyKnownProps(instance);
95
- this.bindOutput(instance, "valueChange");
96
- this.bindOutput(instance, "onValueChange");
97
- instance.changeDetectorRef?.detectChanges();
98
- this.compRef = compRef;
99
- this.inputInstance = instance;
100
- compRef.changeDetectorRef.detectChanges();
101
- }
102
- catch (err) {
103
- // Fallback to function renderer
104
- try {
105
- const props = {
106
- value: this.value,
107
- onValueChange: (v) => this.emitValue(v),
108
- label: this.label,
109
- placeholder: this.placeholder,
110
- required: this.required,
111
- options: this.options,
112
- className: this.className,
113
- description: this.description,
114
- disabled: this.disabled,
115
- errorMessage: this.errorMessage,
116
- };
117
- const out = Renderer(props);
118
- if (typeof out === 'string') {
119
- const el = document.createElement('div');
120
- el.innerHTML = out;
121
- this.host.element.nativeElement.appendChild(el);
122
- }
123
- }
124
- catch (e) {
125
- const el = document.createElement('div');
126
- el.textContent = `Failed to render field: ${this.type}`;
127
- this.host.element.nativeElement.appendChild(el);
128
- }
129
- }
130
- }
131
- applyKnownProps(instance) {
132
- const knownProps = ["value", "label", "placeholder", "required", "disabled", "options", "className", "description", "errorMessage"];
133
- for (const prop of knownProps) {
134
- if (prop in this && prop in instance) {
135
- instance[prop] = this[prop];
136
- }
137
- }
138
- }
139
- bindOutput(instance, outputName) {
140
- const output = instance?.[outputName];
141
- if (!output || typeof output.subscribe !== "function")
142
- return;
143
- output.subscribe((value) => {
144
- this.emitValue(value);
145
- });
146
- }
147
- emitValue(value) {
148
- this.valueChange.emit(value);
149
- this.onChange.emit(value);
150
- }
151
- cleanupRenderedComponent() {
152
- this.compRef?.destroy();
153
- this.compRef = undefined;
154
- this.inputInstance = undefined;
155
- }
156
- }
157
- DynamicInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicInput, deps: null, target: i0.ɵɵFactoryTarget.Component });
158
- DynamicInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DynamicInput, isStandalone: true, selector: "dfk-dynamic-input", inputs: { type: "type", value: "value", label: "label", placeholder: "placeholder", required: "required", options: "options", className: "className", description: "description" }, outputs: { valueChange: "valueChange", onChange: "onChange" }, viewQueries: [{ propertyName: "host", first: true, predicate: ["host"], descendants: true, read: ViewContainerRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `<div #host style="display: contents;"></div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
159
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicInput, decorators: [{
160
- type: Component,
161
- args: [{
162
- selector: "dfk-dynamic-input",
163
- standalone: true,
164
- imports: [CommonModule],
165
- template: `<div #host style="display: contents;"></div>`,
166
- }]
167
- }], propDecorators: { type: [{
168
- type: Input
169
- }], value: [{
170
- type: Input
171
- }], label: [{
172
- type: Input
173
- }], placeholder: [{
174
- type: Input
175
- }], required: [{
176
- type: Input
177
- }], options: [{
178
- type: Input
179
- }], className: [{
180
- type: Input
181
- }], description: [{
182
- type: Input
183
- }], valueChange: [{
184
- type: Output
185
- }], onChange: [{
186
- type: Output
187
- }], host: [{
188
- type: ViewChild,
189
- args: ["host", { read: ViewContainerRef, static: false }]
65
+ class DynamicInput extends BaseInputComponent {
66
+ type;
67
+ valueChange = new EventEmitter();
68
+ onChange = new EventEmitter(); // backward compat
69
+ host;
70
+ compRef;
71
+ inputInstance;
72
+ subscriptions = [];
73
+ ngOnChanges(changes) {
74
+ if (changes['type'] && !changes['type'].firstChange && this.host) {
75
+ this.render();
76
+ return;
77
+ }
78
+ if (this.inputInstance) {
79
+ this.applyKnownProps(this.inputInstance);
80
+ const childChanges = {};
81
+ for (const prop in changes) {
82
+ childChanges[prop] = new SimpleChange(changes[prop].previousValue, changes[prop].currentValue, changes[prop].firstChange);
83
+ }
84
+ this.inputInstance.ngOnChanges?.(childChanges);
85
+ this.compRef?.changeDetectorRef.detectChanges();
86
+ }
87
+ else if (this.host) {
88
+ this.render();
89
+ }
90
+ }
91
+ ngAfterViewInit() {
92
+ this.render();
93
+ }
94
+ ngOnDestroy() {
95
+ this.cleanupSubscriptions();
96
+ this.cleanupRenderedComponent();
97
+ }
98
+ cleanupSubscriptions() {
99
+ this.subscriptions.forEach((s) => s.unsubscribe());
100
+ this.subscriptions = [];
101
+ }
102
+ render() {
103
+ const Renderer = fieldRegistry.get(this.type);
104
+ this.cleanupRenderedComponent();
105
+ this.cleanupSubscriptions();
106
+ this.host.clear();
107
+ if (!Renderer) {
108
+ const el = document.createElement('div');
109
+ el.textContent = `Unknown field type: ${this.type}`;
110
+ this.host.element.nativeElement.appendChild(el);
111
+ return;
112
+ }
113
+ try {
114
+ const compType = Renderer;
115
+ const compRef = this.host.createComponent(compType);
116
+ const instance = compRef.instance;
117
+ if (!instance) {
118
+ throw new Error(`Failed to create instance for ${this.type}`);
119
+ }
120
+ this.applyKnownProps(instance);
121
+ const subA = this.bindOutput(instance, 'valueChange');
122
+ if (subA) {
123
+ this.subscriptions.push(subA);
124
+ }
125
+ const subB = this.bindOutput(instance, 'onValueChange');
126
+ if (subB) {
127
+ this.subscriptions.push(subB);
128
+ }
129
+ instance.changeDetectorRef?.detectChanges();
130
+ this.compRef = compRef;
131
+ this.inputInstance = instance;
132
+ compRef.changeDetectorRef.detectChanges();
133
+ }
134
+ catch (err) {
135
+ // Fallback to function renderer
136
+ try {
137
+ const props = {
138
+ value: this.value,
139
+ onValueChange: (v) => this.emitValue(v),
140
+ label: this.label,
141
+ placeholder: this.placeholder,
142
+ required: this.required,
143
+ options: this.options,
144
+ className: this.className,
145
+ description: this.description,
146
+ disabled: this.disabled,
147
+ errorMessage: this.errorMessage,
148
+ };
149
+ const out = Renderer(props);
150
+ if (typeof out === 'string') {
151
+ const el = document.createElement('div');
152
+ el.innerHTML = out;
153
+ this.host.element.nativeElement.appendChild(el);
154
+ }
155
+ }
156
+ catch (e) {
157
+ const el = document.createElement('div');
158
+ el.textContent = `Failed to render field: ${this.type}`;
159
+ this.host.element.nativeElement.appendChild(el);
160
+ }
161
+ }
162
+ }
163
+ applyKnownProps(instance) {
164
+ const knownProps = [
165
+ 'value',
166
+ 'label',
167
+ 'placeholder',
168
+ 'required',
169
+ 'disabled',
170
+ 'options',
171
+ 'className',
172
+ 'description',
173
+ 'errorMessage',
174
+ ];
175
+ for (const prop of knownProps) {
176
+ if (prop in this && prop in instance) {
177
+ instance[prop] = this[prop];
178
+ }
179
+ }
180
+ }
181
+ bindOutput(instance, outputName) {
182
+ const output = instance?.[outputName];
183
+ if (!output || typeof output.subscribe !== 'function') {
184
+ return;
185
+ }
186
+ const sub = output.subscribe((value) => {
187
+ this.emitValue(value);
188
+ });
189
+ return sub;
190
+ }
191
+ emitValue(value) {
192
+ this.valueChange.emit(value);
193
+ this.onChange.emit(value);
194
+ }
195
+ cleanupRenderedComponent() {
196
+ this.compRef?.destroy();
197
+ this.compRef = undefined;
198
+ this.inputInstance = undefined;
199
+ }
200
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DynamicInput, deps: null, target: i0.ɵɵFactoryTarget.Component });
201
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: DynamicInput, isStandalone: true, selector: "dfk-dynamic-input", inputs: { type: "type" }, outputs: { valueChange: "valueChange", onChange: "onChange" }, viewQueries: [{ propertyName: "host", first: true, predicate: ["host"], descendants: true, read: ViewContainerRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `<div #host style="display: contents;"></div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
202
+ }
203
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DynamicInput, decorators: [{
204
+ type: Component,
205
+ args: [{
206
+ selector: 'dfk-dynamic-input',
207
+ standalone: true,
208
+ imports: [CommonModule],
209
+ template: `<div #host style="display: contents;"></div>`,
210
+ }]
211
+ }], propDecorators: { type: [{
212
+ type: Input
213
+ }], valueChange: [{
214
+ type: Output
215
+ }], onChange: [{
216
+ type: Output
217
+ }], host: [{
218
+ type: ViewChild,
219
+ args: ['host', { read: ViewContainerRef, static: false }]
190
220
  }] } });
191
221
 
192
- class FieldInput {
193
- constructor() {
194
- this.onValueChangeField = new EventEmitter();
195
- }
196
- getFieldValue() {
197
- if (!this.fieldDescription || !this.renderInfos)
198
- return undefined;
199
- const value = this.renderInfos[this.fieldDescription.name];
200
- if (value === undefined && this.fieldDescription.type === "text") {
201
- return "";
202
- }
203
- return value;
204
- }
205
- }
206
- FieldInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FieldInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
207
- FieldInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FieldInput, isStandalone: true, selector: "dfk-field-input", inputs: { fieldDescription: "fieldDescription", renderInfos: "renderInfos" }, outputs: { onValueChangeField: "onValueChangeField" }, ngImport: i0, template: `
222
+ class FieldInput {
223
+ fieldDescription;
224
+ renderInfos;
225
+ onValueChangeField = new EventEmitter();
226
+ getFieldValue() {
227
+ if (!this.fieldDescription || !this.renderInfos) {
228
+ return undefined;
229
+ }
230
+ const value = this.renderInfos[this.fieldDescription.name];
231
+ if (value === undefined && this.fieldDescription.type === 'text') {
232
+ return '';
233
+ }
234
+ return value;
235
+ }
236
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FieldInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
237
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: FieldInput, isStandalone: true, selector: "dfk-field-input", inputs: { fieldDescription: "fieldDescription", renderInfos: "renderInfos" }, outputs: { onValueChangeField: "onValueChangeField" }, ngImport: i0, template: `
208
238
  <dfk-dynamic-input
209
239
  *ngIf="fieldDescription && renderInfos"
210
240
  [type]="fieldDescription!.type"
@@ -212,20 +242,23 @@ FieldInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "1
212
242
  [label]="fieldDescription!.label"
213
243
  [placeholder]="fieldDescription!.placeholder"
214
244
  [required]="fieldDescription!.required"
215
- [description]="fieldDescription!.description"
216
- [options]="fieldDescription!.options"
217
- [className]="fieldDescription!.className"
218
- (valueChange)="onValueChangeField.emit({ value: $event, key: fieldDescription!.name })"
219
- [disabled]="false"
220
- [errorMessage]="''"
221
- ></dfk-dynamic-input>
222
- `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: DynamicInput, selector: "dfk-dynamic-input", inputs: ["type", "value", "label", "placeholder", "required", "options", "className", "description"], outputs: ["valueChange", "onChange"] }] });
223
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FieldInput, decorators: [{
224
- type: Component,
225
- args: [{
226
- selector: "dfk-field-input",
227
- standalone: true,
228
- imports: [NgIf, DynamicInput],
245
+ [description]="fieldDescription!.description"
246
+ [options]="fieldDescription!.options"
247
+ [className]="fieldDescription!.className"
248
+ (valueChange)="
249
+ onValueChangeField.emit({ value: $event, key: fieldDescription!.name })
250
+ "
251
+ [disabled]="false"
252
+ [errorMessage]="''"
253
+ ></dfk-dynamic-input>
254
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: DynamicInput, selector: "dfk-dynamic-input", inputs: ["type"], outputs: ["valueChange", "onChange"] }] });
255
+ }
256
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FieldInput, decorators: [{
257
+ type: Component,
258
+ args: [{
259
+ selector: 'dfk-field-input',
260
+ standalone: true,
261
+ imports: [NgIf, DynamicInput],
229
262
  template: `
230
263
  <dfk-dynamic-input
231
264
  *ngIf="fieldDescription && renderInfos"
@@ -234,60 +267,64 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
234
267
  [label]="fieldDescription!.label"
235
268
  [placeholder]="fieldDescription!.placeholder"
236
269
  [required]="fieldDescription!.required"
237
- [description]="fieldDescription!.description"
238
- [options]="fieldDescription!.options"
239
- [className]="fieldDescription!.className"
240
- (valueChange)="onValueChangeField.emit({ value: $event, key: fieldDescription!.name })"
241
- [disabled]="false"
242
- [errorMessage]="''"
243
- ></dfk-dynamic-input>
244
- `,
245
- }]
246
- }], propDecorators: { fieldDescription: [{
247
- type: Input
248
- }], renderInfos: [{
249
- type: Input
250
- }], onValueChangeField: [{
251
- type: Output
270
+ [description]="fieldDescription!.description"
271
+ [options]="fieldDescription!.options"
272
+ [className]="fieldDescription!.className"
273
+ (valueChange)="
274
+ onValueChangeField.emit({ value: $event, key: fieldDescription!.name })
275
+ "
276
+ [disabled]="false"
277
+ [errorMessage]="''"
278
+ ></dfk-dynamic-input>
279
+ `,
280
+ }]
281
+ }], propDecorators: { fieldDescription: [{
282
+ type: Input
283
+ }], renderInfos: [{
284
+ type: Input
285
+ }], onValueChangeField: [{
286
+ type: Output
252
287
  }] } });
253
288
 
254
- class MultiFieldInput {
255
- constructor() {
256
- this.fieldDescriptions = [];
257
- this.onChange = new EventEmitter();
258
- this.layout = "column";
259
- this.data = {};
260
- this.visibleFields = [];
261
- }
262
- trackByFn(index, field) {
263
- return field.name || index;
264
- }
265
- ngOnInit() {
266
- this.init();
267
- }
268
- ngOnChanges(_changes) {
269
- this.init();
270
- }
271
- init() {
272
- if (this.properties)
273
- this.data = { ...this.properties };
274
- this.updateVisibleFields();
275
- }
276
- updateVisibleFields() {
277
- this.visibleFields = this.fieldDescriptions.filter((f) => !f.appearCondition || f.appearCondition(this.data));
278
- }
279
- onFieldChange(event) {
280
- this.data = { ...this.data, [event.key]: event.value };
281
- this.updateVisibleFields();
282
- this.onChange.emit(this.data);
283
- }
284
- }
285
- MultiFieldInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MultiFieldInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
286
- MultiFieldInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: MultiFieldInput, isStandalone: true, selector: "dfk-multi-field-input", inputs: { fieldDescriptions: "fieldDescriptions", properties: "properties", layout: "layout" }, outputs: { onChange: "onChange" }, usesOnChanges: true, ngImport: i0, template: `
287
- <div class="flex flex-col gap-3 p-4 border rounded-lg bg-gray-50" [ngClass]="{
288
- 'flex-row gap-3': layout === 'row',
289
- 'grid grid-cols-2 gap-3': layout === 'grid'
290
- }">
289
+ class MultiFieldInput {
290
+ fieldDescriptions = [];
291
+ properties;
292
+ onChange = new EventEmitter();
293
+ layout = 'column';
294
+ data = {};
295
+ visibleFields = [];
296
+ trackByFn(index, field) {
297
+ return field.name || index;
298
+ }
299
+ ngOnInit() {
300
+ this.init();
301
+ }
302
+ ngOnChanges(_changes) {
303
+ this.init();
304
+ }
305
+ init() {
306
+ if (this.properties) {
307
+ this.data = { ...this.properties };
308
+ }
309
+ this.updateVisibleFields();
310
+ }
311
+ updateVisibleFields() {
312
+ this.visibleFields = this.fieldDescriptions.filter((f) => !f.appearCondition || f.appearCondition(this.data));
313
+ }
314
+ onFieldChange(event) {
315
+ this.data = { ...this.data, [event.key]: event.value };
316
+ this.updateVisibleFields();
317
+ this.onChange.emit(this.data);
318
+ }
319
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: MultiFieldInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
320
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: MultiFieldInput, isStandalone: true, selector: "dfk-multi-field-input", inputs: { fieldDescriptions: "fieldDescriptions", properties: "properties", layout: "layout" }, outputs: { onChange: "onChange" }, usesOnChanges: true, ngImport: i0, template: `
321
+ <div
322
+ class="flex flex-col gap-3 p-4 border rounded-lg bg-gray-50"
323
+ [ngClass]="{
324
+ 'flex-row gap-3': layout === 'row',
325
+ 'grid grid-cols-2 gap-3': layout === 'grid'
326
+ }"
327
+ >
291
328
  <dfk-field-input
292
329
  *ngFor="let field of visibleFields; trackBy: trackByFn"
293
330
  [fieldDescription]="field"
@@ -295,18 +332,22 @@ MultiFieldInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", versio
295
332
  (onValueChangeField)="onFieldChange($event)"
296
333
  ></dfk-field-input>
297
334
  </div>
298
- `, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: FieldInput, selector: "dfk-field-input", inputs: ["fieldDescription", "renderInfos"], outputs: ["onValueChangeField"] }] });
299
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MultiFieldInput, decorators: [{
300
- type: Component,
301
- args: [{
302
- selector: "dfk-multi-field-input",
303
- standalone: true,
304
- imports: [NgClass, NgFor, FieldInput],
335
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: FieldInput, selector: "dfk-field-input", inputs: ["fieldDescription", "renderInfos"], outputs: ["onValueChangeField"] }] });
336
+ }
337
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: MultiFieldInput, decorators: [{
338
+ type: Component,
339
+ args: [{
340
+ selector: 'dfk-multi-field-input',
341
+ standalone: true,
342
+ imports: [NgClass, NgFor, FieldInput],
305
343
  template: `
306
- <div class="flex flex-col gap-3 p-4 border rounded-lg bg-gray-50" [ngClass]="{
307
- 'flex-row gap-3': layout === 'row',
308
- 'grid grid-cols-2 gap-3': layout === 'grid'
309
- }">
344
+ <div
345
+ class="flex flex-col gap-3 p-4 border rounded-lg bg-gray-50"
346
+ [ngClass]="{
347
+ 'flex-row gap-3': layout === 'row',
348
+ 'grid grid-cols-2 gap-3': layout === 'grid'
349
+ }"
350
+ >
310
351
  <dfk-field-input
311
352
  *ngFor="let field of visibleFields; trackBy: trackByFn"
312
353
  [fieldDescription]="field"
@@ -314,76 +355,132 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
314
355
  (onValueChangeField)="onFieldChange($event)"
315
356
  ></dfk-field-input>
316
357
  </div>
317
- `,
318
- }]
319
- }], propDecorators: { fieldDescriptions: [{
320
- type: Input
321
- }], properties: [{
322
- type: Input
323
- }], onChange: [{
324
- type: Output
325
- }], layout: [{
326
- type: Input
358
+ `,
359
+ }]
360
+ }], propDecorators: { fieldDescriptions: [{
361
+ type: Input
362
+ }], properties: [{
363
+ type: Input
364
+ }], onChange: [{
365
+ type: Output
366
+ }], layout: [{
367
+ type: Input
327
368
  }] } });
328
369
 
329
- class ColumnLayout {
330
- }
331
- ColumnLayout.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ColumnLayout, deps: [], target: i0.ɵɵFactoryTarget.Component });
332
- ColumnLayout.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ColumnLayout, isStandalone: true, selector: "dfk-column-layout", ngImport: i0, template: `<div style="display:flex;flex-direction:column;gap:var(--dfk-gap,12px)"><ng-content></ng-content></div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
333
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ColumnLayout, decorators: [{
334
- type: Component,
335
- args: [{
336
- selector: "dfk-column-layout",
337
- standalone: true,
338
- imports: [CommonModule],
339
- template: `<div style="display:flex;flex-direction:column;gap:var(--dfk-gap,12px)"><ng-content></ng-content></div>`,
340
- }]
341
- }] });
342
- class RowLayout {
343
- }
344
- RowLayout.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RowLayout, deps: [], target: i0.ɵɵFactoryTarget.Component });
345
- RowLayout.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: RowLayout, isStandalone: true, selector: "dfk-row-layout", ngImport: i0, template: `<div style="display:flex;flex-direction:row;gap:var(--dfk-gap,12px)"><ng-content></ng-content></div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
346
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RowLayout, decorators: [{
347
- type: Component,
348
- args: [{
349
- selector: "dfk-row-layout",
350
- standalone: true,
351
- imports: [CommonModule],
352
- template: `<div style="display:flex;flex-direction:row;gap:var(--dfk-gap,12px)"><ng-content></ng-content></div>`,
353
- }]
354
- }] });
355
- class GridLayout {
356
- }
357
- GridLayout.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GridLayout, deps: [], target: i0.ɵɵFactoryTarget.Component });
358
- GridLayout.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: GridLayout, isStandalone: true, selector: "dfk-grid-layout", ngImport: i0, template: `<div style="display:grid;grid-template-columns:repeat(var(--dfk-columns,2),1fr);gap:var(--dfk-gap,12px)"><ng-content></ng-content></div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
359
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GridLayout, decorators: [{
360
- type: Component,
361
- args: [{
362
- selector: "dfk-grid-layout",
363
- standalone: true,
364
- imports: [CommonModule],
365
- template: `<div style="display:grid;grid-template-columns:repeat(var(--dfk-columns,2),1fr);gap:var(--dfk-gap,12px)"><ng-content></ng-content></div>`,
366
- }]
370
+ class ColumnLayout {
371
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ColumnLayout, deps: [], target: i0.ɵɵFactoryTarget.Component });
372
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: ColumnLayout, isStandalone: true, selector: "dfk-column-layout", ngImport: i0, template: `<div
373
+ style="display:flex;flex-direction:column;gap:var(--dfk-gap,12px)"
374
+ >
375
+ <ng-content></ng-content>
376
+ </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
377
+ }
378
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ColumnLayout, decorators: [{
379
+ type: Component,
380
+ args: [{
381
+ selector: 'dfk-column-layout',
382
+ standalone: true,
383
+ imports: [CommonModule],
384
+ template: `<div
385
+ style="display:flex;flex-direction:column;gap:var(--dfk-gap,12px)"
386
+ >
387
+ <ng-content></ng-content>
388
+ </div>`,
389
+ }]
390
+ }] });
391
+ class RowLayout {
392
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: RowLayout, deps: [], target: i0.ɵɵFactoryTarget.Component });
393
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: RowLayout, isStandalone: true, selector: "dfk-row-layout", ngImport: i0, template: `<div
394
+ style="display:flex;flex-direction:row;gap:var(--dfk-gap,12px)"
395
+ >
396
+ <ng-content></ng-content>
397
+ </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
398
+ }
399
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: RowLayout, decorators: [{
400
+ type: Component,
401
+ args: [{
402
+ selector: 'dfk-row-layout',
403
+ standalone: true,
404
+ imports: [CommonModule],
405
+ template: `<div
406
+ style="display:flex;flex-direction:row;gap:var(--dfk-gap,12px)"
407
+ >
408
+ <ng-content></ng-content>
409
+ </div>`,
410
+ }]
411
+ }] });
412
+ class GridLayout {
413
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: GridLayout, deps: [], target: i0.ɵɵFactoryTarget.Component });
414
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: GridLayout, isStandalone: true, selector: "dfk-grid-layout", ngImport: i0, template: `<div
415
+ style="display:grid;grid-template-columns:repeat(var(--dfk-columns,2),1fr);gap:var(--dfk-gap,12px)"
416
+ >
417
+ <ng-content></ng-content>
418
+ </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
419
+ }
420
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: GridLayout, decorators: [{
421
+ type: Component,
422
+ args: [{
423
+ selector: 'dfk-grid-layout',
424
+ standalone: true,
425
+ imports: [CommonModule],
426
+ template: `<div
427
+ style="display:grid;grid-template-columns:repeat(var(--dfk-columns,2),1fr);gap:var(--dfk-gap,12px)"
428
+ >
429
+ <ng-content></ng-content>
430
+ </div>`,
431
+ }]
367
432
  }] });
368
433
 
369
- class DynamicFieldKitModule {
370
- }
371
- DynamicFieldKitModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicFieldKitModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
372
- DynamicFieldKitModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: DynamicFieldKitModule, imports: [CommonModule, DynamicInput, FieldInput, MultiFieldInput, ColumnLayout, RowLayout, GridLayout], exports: [DynamicInput, FieldInput, MultiFieldInput, ColumnLayout, RowLayout, GridLayout] });
373
- DynamicFieldKitModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicFieldKitModule, imports: [CommonModule, DynamicInput, FieldInput, MultiFieldInput, ColumnLayout, RowLayout, GridLayout] });
374
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicFieldKitModule, decorators: [{
375
- type: NgModule,
376
- args: [{
377
- imports: [CommonModule, DynamicInput, FieldInput, MultiFieldInput, ColumnLayout, RowLayout, GridLayout],
378
- exports: [DynamicInput, FieldInput, MultiFieldInput, ColumnLayout, RowLayout, GridLayout],
379
- }]
434
+ class DynamicFieldKitModule {
435
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DynamicFieldKitModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
436
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.20", ngImport: i0, type: DynamicFieldKitModule, imports: [CommonModule,
437
+ DynamicInput,
438
+ FieldInput,
439
+ MultiFieldInput,
440
+ ColumnLayout,
441
+ RowLayout,
442
+ GridLayout], exports: [DynamicInput,
443
+ FieldInput,
444
+ MultiFieldInput,
445
+ ColumnLayout,
446
+ RowLayout,
447
+ GridLayout] });
448
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DynamicFieldKitModule, imports: [CommonModule,
449
+ DynamicInput,
450
+ FieldInput,
451
+ MultiFieldInput,
452
+ ColumnLayout,
453
+ RowLayout,
454
+ GridLayout] });
455
+ }
456
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DynamicFieldKitModule, decorators: [{
457
+ type: NgModule,
458
+ args: [{
459
+ imports: [
460
+ CommonModule,
461
+ DynamicInput,
462
+ FieldInput,
463
+ MultiFieldInput,
464
+ ColumnLayout,
465
+ RowLayout,
466
+ GridLayout,
467
+ ],
468
+ exports: [
469
+ DynamicInput,
470
+ FieldInput,
471
+ MultiFieldInput,
472
+ ColumnLayout,
473
+ RowLayout,
474
+ GridLayout,
475
+ ],
476
+ }]
380
477
  }] });
381
478
 
382
- // public-api.ts
479
+ // public-api.ts
383
480
  // Components
384
481
 
385
- /**
386
- * Generated bundle index. Do not edit.
482
+ /**
483
+ * Generated bundle index. Do not edit.
387
484
  */
388
485
 
389
486
  export { BaseInputComponent, ColumnLayout, DynamicFieldKitModule, DynamicInput, FieldInput, GridLayout, MultiFieldInput, RowLayout };