@apipass/schemas 0.2.1-test.1 → 0.2.3-alpha.0

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 (52) hide show
  1. package/apipass-schemas.d.ts +5 -5
  2. package/assets/css/buttons.scss +118 -112
  3. package/assets/css/colors.scss +34 -34
  4. package/assets/css/fonts.scss +24 -24
  5. package/assets/css/inputs.scss +197 -197
  6. package/assets/css/pt_sans.scss +143 -143
  7. package/assets/css/spacing.scss +28 -28
  8. package/assets/css/texts.scss +18 -18
  9. package/base-schema.component.d.ts +12 -11
  10. package/bundles/apipass-schemas.umd.js +1945 -1930
  11. package/bundles/apipass-schemas.umd.js.map +1 -1
  12. package/bundles/apipass-schemas.umd.min.js +2 -2
  13. package/bundles/apipass-schemas.umd.min.js.map +1 -1
  14. package/esm2015/apipass-schemas.js +4 -4
  15. package/esm2015/base-schema.component.js +38 -30
  16. package/esm2015/public-api.js +17 -17
  17. package/esm2015/schema-custom-attributes/schema-custom-attributes.js +177 -177
  18. package/esm2015/schema-fields.service.js +77 -77
  19. package/esm2015/schema-form/schema-array/array-session/array-session.js +159 -158
  20. package/esm2015/schema-form/schema-array/schema-array.js +195 -196
  21. package/esm2015/schema-form/schema-form.js +72 -73
  22. package/esm2015/schema-form/schema-input/field-render/field-render.js +72 -72
  23. package/esm2015/schema-form/schema-input/input-render/boolean-input/boolean-input.component.js +50 -45
  24. package/esm2015/schema-form/schema-input/input-render/input-render.js +128 -124
  25. package/esm2015/schema-form/schema-input/input-render/number-input/number-input.component.js +48 -43
  26. package/esm2015/schema-form/schema-input/schema-input.js +98 -99
  27. package/esm2015/schema-form/schema-object/schema-object.js +94 -95
  28. package/esm2015/schema-form-render.js +96 -97
  29. package/esm2015/schema-form-render.module.js +121 -121
  30. package/esm2015/schema-validation-field.js +15 -15
  31. package/esm2015/struct.utils.js +9 -9
  32. package/esm2015/type-script-compile.js +77 -77
  33. package/fesm2015/apipass-schemas.js +1379 -1364
  34. package/fesm2015/apipass-schemas.js.map +1 -1
  35. package/package.json +2 -1
  36. package/public-api.d.ts +16 -16
  37. package/schema-custom-attributes/schema-custom-attributes.d.ts +15 -15
  38. package/schema-fields.service.d.ts +12 -12
  39. package/schema-form/schema-array/array-session/array-session.d.ts +17 -17
  40. package/schema-form/schema-array/schema-array.d.ts +18 -18
  41. package/schema-form/schema-form.d.ts +17 -17
  42. package/schema-form/schema-input/field-render/field-render.d.ts +15 -15
  43. package/schema-form/schema-input/input-render/boolean-input/boolean-input.component.d.ts +15 -13
  44. package/schema-form/schema-input/input-render/input-render.d.ts +20 -19
  45. package/schema-form/schema-input/input-render/number-input/number-input.component.d.ts +15 -13
  46. package/schema-form/schema-input/schema-input.d.ts +14 -14
  47. package/schema-form/schema-object/schema-object.d.ts +20 -20
  48. package/schema-form-render.d.ts +17 -17
  49. package/schema-form-render.module.d.ts +22 -22
  50. package/schema-validation-field.d.ts +17 -17
  51. package/struct.utils.d.ts +1 -1
  52. package/type-script-compile.d.ts +10 -10
@@ -2,1410 +2,1425 @@ import { EventEmitter, ɵɵdefineComponent, ɵsetClassMetadata, Component, Input
2
2
  import { NgForOf, NgIf, NgTemplateOutlet, NgClass, CommonModule, NgComponentOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe } from '@angular/common';
3
3
  import { DefaultValueAccessor, NgControlStatus, NgModel, MaxLengthValidator, FormsModule, ɵangular_packages_forms_forms_y, NgSelectOption, ɵangular_packages_forms_forms_x, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatusGroup, RequiredValidator, MinLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator, NgModelGroup, NgForm, FormControl, Validators } from '@angular/forms';
4
4
  import { TranslatePipe, TranslateService, TranslateModule, TranslateDirective } from '@ngx-translate/core';
5
- import { MatTooltip, MatTooltipModule, TooltipComponent } from '@angular/material/tooltip';
6
5
  import { DndDropzoneDirective, DndModule, DndDraggableDirective, DndHandleDirective, DndPlaceholderRefDirective, DndDragImageRefDirective } from 'ngx-drag-drop';
6
+ import { MatTooltip, MatTooltipModule, TooltipComponent } from '@angular/material/tooltip';
7
7
  import { SelectBoxComponent, InputsModule, SelectEnumComponent, InputTextComponent, InputPasswordComponent, InputAvatarComponent, InputFileComponent, CustomSelectComponent, FieldComponent } from '@apipass/inputs';
8
8
  import { __awaiter } from 'tslib';
9
9
  import { Dir } from '@angular/cdk/bidi';
10
10
  import { CdkScrollable } from '@angular/cdk/scrolling';
11
11
 
12
- class BaseSchemaComponent {
13
- constructor() {
14
- this.modelChange = new EventEmitter();
15
- }
16
- getSchemaProperties() {
17
- return this.schema.properties instanceof Array ? this.schema.properties : [this.schema.properties];
18
- }
19
- canRender(property) {
20
- // tslint:disable-next-line:no-eval
21
- property.canRender = (property === null || property === void 0 ? void 0 : property.conditionExpression) ? eval(property.conditionExpression) : true;
22
- return property.canRender;
23
- }
24
- }
25
- BaseSchemaComponent.ɵfac = function BaseSchemaComponent_Factory(t) { return new (t || BaseSchemaComponent)(); };
26
- BaseSchemaComponent.ɵcmp = ɵɵdefineComponent({ type: BaseSchemaComponent, selectors: [["ng-component"]], inputs: { model: "model", schema: "schema" }, outputs: { modelChange: "modelChange" }, decls: 0, vars: 0, template: function BaseSchemaComponent_Template(rf, ctx) { }, encapsulation: 2 });
27
- /*@__PURE__*/ (function () { ɵsetClassMetadata(BaseSchemaComponent, [{
28
- type: Component,
29
- args: [{
30
- template: ''
31
- }]
32
- }], null, { model: [{
33
- type: Input
34
- }], schema: [{
35
- type: Input
36
- }], modelChange: [{
37
- type: Output
12
+ class BaseSchemaComponent {
13
+ constructor() {
14
+ this.modelChange = new EventEmitter();
15
+ }
16
+ getSchemaProperties() {
17
+ return this.schema.properties instanceof Array ? this.schema.properties : [this.schema.properties];
18
+ }
19
+ canRender(property) {
20
+ // tslint:disable-next-line:no-eval
21
+ property.canRender = (property === null || property === void 0 ? void 0 : property.conditionExpression) ? eval(property.conditionExpression) : true;
22
+ return property.canRender;
23
+ }
24
+ onDrop(event, attr) {
25
+ const data = event.data;
26
+ if (!attr) {
27
+ attr = '';
28
+ }
29
+ attr += `{{${data}}}`;
30
+ return attr;
31
+ }
32
+ }
33
+ BaseSchemaComponent.ɵfac = function BaseSchemaComponent_Factory(t) { return new (t || BaseSchemaComponent)(); };
34
+ BaseSchemaComponent.ɵcmp = ɵɵdefineComponent({ type: BaseSchemaComponent, selectors: [["ng-component"]], inputs: { model: "model", schema: "schema" }, outputs: { modelChange: "modelChange" }, decls: 0, vars: 0, template: function BaseSchemaComponent_Template(rf, ctx) { }, encapsulation: 2 });
35
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(BaseSchemaComponent, [{
36
+ type: Component,
37
+ args: [{
38
+ template: ''
39
+ }]
40
+ }], null, { model: [{
41
+ type: Input
42
+ }], schema: [{
43
+ type: Input
44
+ }], modelChange: [{
45
+ type: Output
38
46
  }] }); })();
39
47
 
40
- function onDropStruct(event, attr) {
41
- const data = event.data;
42
- if (!attr) {
43
- attr = '';
44
- }
45
- attr += `{{${data}}}`;
46
- return attr;
48
+ function onDropStruct(event, attr) {
49
+ const data = event.data;
50
+ if (!attr) {
51
+ attr = '';
52
+ }
53
+ attr += `{{${data}}}`;
54
+ return attr;
47
55
  }
48
56
 
49
- const _c0 = function () { return { standalone: true }; };
50
- function ArraySessionComponent_div_5_div_5_Template(rf, ctx) { if (rf & 1) {
51
- const _r8 = ɵɵgetCurrentView();
52
- ɵɵelementStart(0, "div", 0);
53
- ɵɵelementStart(1, "div", 12);
54
- ɵɵelementStart(2, "label", 13);
55
- ɵɵtext(3, "Loop");
56
- ɵɵelementEnd();
57
- ɵɵelementStart(4, "input", 14);
58
- ɵɵlistener("ngModelChange", function ArraySessionComponent_div_5_div_5_Template_input_ngModelChange_4_listener($event) { ɵɵrestoreView(_r8); const item_r2 = ɵɵnextContext().$implicit; return item_r2.loop = $event; });
59
- ɵɵelementEnd();
60
- ɵɵelementEnd();
61
- ɵɵelementStart(5, "div", 15);
62
- ɵɵelementStart(6, "label", 13);
63
- ɵɵtext(7, "Alias");
64
- ɵɵelementEnd();
65
- ɵɵelementStart(8, "input", 14);
66
- ɵɵlistener("ngModelChange", function ArraySessionComponent_div_5_div_5_Template_input_ngModelChange_8_listener($event) { ɵɵrestoreView(_r8); const item_r2 = ɵɵnextContext().$implicit; return item_r2.alias = $event; });
67
- ɵɵelementEnd();
68
- ɵɵelementEnd();
69
- ɵɵelementEnd();
70
- } if (rf & 2) {
71
- const item_r2 = ɵɵnextContext().$implicit;
72
- ɵɵadvance(4);
73
- ɵɵproperty("ngModel", item_r2.loop)("ngModelOptions", ɵɵpureFunction0(4, _c0));
74
- ɵɵadvance(4);
75
- ɵɵproperty("ngModel", item_r2.alias)("ngModelOptions", ɵɵpureFunction0(5, _c0));
76
- } }
77
- function ArraySessionComponent_div_5_ng_container_6_Template(rf, ctx) { if (rf & 1) {
78
- ɵɵelementContainer(0);
79
- } }
80
- const _c1 = function (a0, a1, a2) { return { items: a0, index: a1, mappingAttributes: a2 }; };
81
- const _c2 = function (a0) { return { $implicit: a0 }; };
82
- function ArraySessionComponent_div_5_Template(rf, ctx) { if (rf & 1) {
83
- const _r13 = ɵɵgetCurrentView();
84
- ɵɵelementStart(0, "div", 7);
85
- ɵɵelementStart(1, "div", 8);
86
- ɵɵtext(2);
87
- ɵɵpipe(3, "translate");
88
- ɵɵelementStart(4, "i", 9);
89
- ɵɵlistener("click", function ArraySessionComponent_div_5_Template_i_click_4_listener() { ɵɵrestoreView(_r13); const item_r2 = ctx.$implicit; const ctx_r12 = ɵɵnextContext(); return ctx_r12.remove(item_r2); });
90
- ɵɵelementEnd();
91
- ɵɵelementEnd();
92
- ɵɵtemplate(5, ArraySessionComponent_div_5_div_5_Template, 9, 6, "div", 10);
93
- ɵɵtemplate(6, ArraySessionComponent_div_5_ng_container_6_Template, 1, 0, "ng-container", 11);
94
- ɵɵelementEnd();
95
- } if (rf & 2) {
96
- const item_r2 = ctx.$implicit;
97
- const index_r3 = ctx.index;
98
- const ctx_r0 = ɵɵnextContext();
99
- ɵɵadvance(2);
100
- ɵɵtextInterpolate2("", ɵɵpipeBind1(3, 5, ctx_r0.removeLabel), " ", index_r3 + 1, " ");
101
- ɵɵadvance(3);
102
- ɵɵproperty("ngIf", item_r2.mappingAttributes || item_r2.mappingAttributes === "");
103
- ɵɵadvance(1);
104
- ɵɵproperty("ngTemplateOutlet", ctx_r0.subsectionItem)("ngTemplateOutletContext", ɵɵpureFunction1(11, _c2, ɵɵpureFunction3(7, _c1, ctx_r0.model, index_r3, item_r2.mappingAttributes || item_r2.mappingAttributes === "" ? item_r2.mappingAttributes : item_r2)));
105
- } }
106
- function ArraySessionComponent_button_11_Template(rf, ctx) { if (rf & 1) {
107
- const _r15 = ɵɵgetCurrentView();
108
- ɵɵelementStart(0, "button", 16);
109
- ɵɵlistener("click", function ArraySessionComponent_button_11_Template_button_click_0_listener() { ɵɵrestoreView(_r15); const ctx_r14 = ɵɵnextContext(); return ctx_r14.addLoop(); });
110
- ɵɵtext(1);
111
- ɵɵpipe(2, "translate");
112
- ɵɵelementEnd();
113
- } if (rf & 2) {
114
- ɵɵadvance(1);
115
- ɵɵtextInterpolate(ɵɵpipeBind1(2, 1, "ADD_LOOP"));
116
- } }
117
- class ArraySessionComponent extends BaseSchemaComponent {
118
- constructor() {
119
- super(...arguments);
120
- this.label = '';
121
- this.showAddLoop = true;
122
- this.removeLabel = '';
123
- this.onAdd = new EventEmitter();
124
- this.onAddLoop = new EventEmitter();
125
- }
126
- add() {
127
- this.onAdd.next();
128
- }
129
- addLoop() {
130
- this.onAddLoop.next();
131
- }
132
- remove(item) {
133
- const values = this.model;
134
- const index = values.indexOf(item);
135
- values.splice(index, 1);
136
- this.model = values;
137
- }
138
- trackByIndex(index, obj) {
139
- return index;
140
- }
141
- }
142
- ArraySessionComponent.ɵfac = function ArraySessionComponent_Factory(t) { return ɵArraySessionComponent_BaseFactory(t || ArraySessionComponent); };
143
- ArraySessionComponent.ɵcmp = ɵɵdefineComponent({ type: ArraySessionComponent, selectors: [["array-session"]], contentQueries: function ArraySessionComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
144
- ɵɵcontentQuery(dirIndex, TemplateRef, true, TemplateRef);
145
- } if (rf & 2) {
146
- var _t;
147
- ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.subsectionItem = _t.first);
148
- } }, inputs: { label: "label", showAddLoop: "showAddLoop", removeLabel: "removeLabel" }, outputs: { onAdd: "onAdd", onAddLoop: "onAddLoop" }, features: [ɵɵInheritDefinitionFeature], decls: 12, vars: 9, consts: [[1, "row"], [1, "col-md-12"], [1, "info-label", "bold"], ["class", "subsection-element", 4, "ngFor", "ngForOf", "ngForTrackBy"], [1, "row", "add-buttons"], [1, "btn", "btn-outline-primary", "float-left", "btn-personal-edit", 3, "click"], ["class", "btn btn-outline-primary float-left btn-personal-edit ml-2", 3, "click", 4, "ngIf"], [1, "subsection-element"], [1, "subsection-item-title"], [1, "far", "fa-trash-alt", 3, "click"], ["class", "row", 4, "ngIf"], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "col-md-8"], [1, "info-label"], ["type", "text", 1, "form-control", 3, "ngModel", "ngModelOptions", "ngModelChange"], [1, "col-md-4"], [1, "btn", "btn-outline-primary", "float-left", "btn-personal-edit", "ml-2", 3, "click"]], template: function ArraySessionComponent_Template(rf, ctx) { if (rf & 1) {
149
- ɵɵelementStart(0, "div", 0);
150
- ɵɵelementStart(1, "div", 1);
151
- ɵɵelementStart(2, "label", 2);
152
- ɵɵtext(3);
153
- ɵɵpipe(4, "translate");
154
- ɵɵelementEnd();
155
- ɵɵtemplate(5, ArraySessionComponent_div_5_Template, 7, 13, "div", 3);
156
- ɵɵelementEnd();
157
- ɵɵelementEnd();
158
- ɵɵelementStart(6, "div", 4);
159
- ɵɵelementStart(7, "div", 1);
160
- ɵɵelementStart(8, "button", 5);
161
- ɵɵlistener("click", function ArraySessionComponent_Template_button_click_8_listener() { return ctx.add(); });
162
- ɵɵtext(9);
163
- ɵɵpipe(10, "translate");
164
- ɵɵelementEnd();
165
- ɵɵtemplate(11, ArraySessionComponent_button_11_Template, 3, 3, "button", 6);
166
- ɵɵelementEnd();
167
- ɵɵelementEnd();
168
- } if (rf & 2) {
169
- ɵɵadvance(3);
170
- ɵɵtextInterpolate(ɵɵpipeBind1(4, 5, ctx.label));
171
- ɵɵadvance(2);
172
- ɵɵproperty("ngForOf", ctx.model)("ngForTrackBy", ctx.trackByIndex);
173
- ɵɵadvance(4);
174
- ɵɵtextInterpolate(ɵɵpipeBind1(10, 7, "ADD_ITEM"));
175
- ɵɵadvance(2);
176
- ɵɵproperty("ngIf", ctx.showAddLoop);
177
- } }, directives: [NgForOf, NgIf, NgTemplateOutlet, DefaultValueAccessor, NgControlStatus, NgModel], pipes: [TranslatePipe], styles: [".subsection-element[_ngcontent-%COMP%]{background:#fff;border:1px solid #ccc;border-radius:5px;margin-top:10px;padding:5px 15px 15px}.subsection-element[_ngcontent-%COMP%]:first-child{margin-top:0!important}.btn-personal-edit[_ngcontent-%COMP%]{margin:5px 0}.subsection-item-title[_ngcontent-%COMP%]{align-items:center;background:#eee;border-bottom:1px solid #ccc;border-radius:5px 5px 0 0;display:flex;font-weight:700;justify-content:space-between;margin-bottom:5px;margin-left:-15px;margin-top:-5px;padding:7px 10px 7px 14px;width:calc(100% + 30px)}.subsection-item-title[_ngcontent-%COMP%] .fa-trash-alt[_ngcontent-%COMP%]{color:red;cursor:pointer}.subsection-item-title[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:700}.add-buttons[_ngcontent-%COMP%]{margin-top:5px}"] });
178
- const ɵArraySessionComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(ArraySessionComponent);
179
- /*@__PURE__*/ (function () { ɵsetClassMetadata(ArraySessionComponent, [{
180
- type: Component,
181
- args: [{
182
- selector: 'array-session',
183
- templateUrl: 'array-session.html',
184
- styleUrls: ['array-session.scss']
185
- }]
186
- }], null, { label: [{
187
- type: Input
188
- }], showAddLoop: [{
189
- type: Input
190
- }], removeLabel: [{
191
- type: Input
192
- }], onAdd: [{
193
- type: Output
194
- }], onAddLoop: [{
195
- type: Output
196
- }], subsectionItem: [{
197
- type: ContentChild,
198
- args: [TemplateRef, { read: TemplateRef }]
57
+ const _c0 = function () { return { standalone: true }; };
58
+ function ArraySessionComponent_div_5_div_5_Template(rf, ctx) { if (rf & 1) {
59
+ const _r8 = ɵɵgetCurrentView();
60
+ ɵɵelementStart(0, "div", 0);
61
+ ɵɵelementStart(1, "div", 12);
62
+ ɵɵelementStart(2, "label", 13);
63
+ ɵɵtext(3, "Loop");
64
+ ɵɵelementEnd();
65
+ ɵɵelementStart(4, "input", 14);
66
+ ɵɵlistener("ngModelChange", function ArraySessionComponent_div_5_div_5_Template_input_ngModelChange_4_listener($event) { ɵɵrestoreView(_r8); const item_r2 = ɵɵnextContext().$implicit; return item_r2.loop = $event; })("dndDrop", function ArraySessionComponent_div_5_div_5_Template_input_dndDrop_4_listener($event) { ɵɵrestoreView(_r8); const item_r2 = ɵɵnextContext().$implicit; const ctx_r9 = ɵɵnextContext(); return item_r2.loop = ctx_r9.onDrop($event, item_r2.loop); });
67
+ ɵɵelementEnd();
68
+ ɵɵelementEnd();
69
+ ɵɵelementStart(5, "div", 15);
70
+ ɵɵelementStart(6, "label", 13);
71
+ ɵɵtext(7, "Alias");
72
+ ɵɵelementEnd();
73
+ ɵɵelementStart(8, "input", 14);
74
+ ɵɵlistener("ngModelChange", function ArraySessionComponent_div_5_div_5_Template_input_ngModelChange_8_listener($event) { ɵɵrestoreView(_r8); const item_r2 = ɵɵnextContext().$implicit; return item_r2.alias = $event; })("dndDrop", function ArraySessionComponent_div_5_div_5_Template_input_dndDrop_8_listener($event) { ɵɵrestoreView(_r8); const item_r2 = ɵɵnextContext().$implicit; const ctx_r13 = ɵɵnextContext(); return item_r2.alias = ctx_r13.onDrop($event, item_r2.alias); });
75
+ ɵɵelementEnd();
76
+ ɵɵelementEnd();
77
+ ɵɵelementEnd();
78
+ } if (rf & 2) {
79
+ const item_r2 = ɵɵnextContext().$implicit;
80
+ ɵɵadvance(4);
81
+ ɵɵproperty("ngModel", item_r2.loop)("ngModelOptions", ɵɵpureFunction0(4, _c0));
82
+ ɵɵadvance(4);
83
+ ɵɵproperty("ngModel", item_r2.alias)("ngModelOptions", ɵɵpureFunction0(5, _c0));
84
+ } }
85
+ function ArraySessionComponent_div_5_ng_container_6_Template(rf, ctx) { if (rf & 1) {
86
+ ɵɵelementContainer(0);
87
+ } }
88
+ const _c1 = function (a0, a1, a2) { return { items: a0, index: a1, mappingAttributes: a2 }; };
89
+ const _c2 = function (a0) { return { $implicit: a0 }; };
90
+ function ArraySessionComponent_div_5_Template(rf, ctx) { if (rf & 1) {
91
+ const _r17 = ɵɵgetCurrentView();
92
+ ɵɵelementStart(0, "div", 7);
93
+ ɵɵelementStart(1, "div", 8);
94
+ ɵɵtext(2);
95
+ ɵɵpipe(3, "translate");
96
+ ɵɵelementStart(4, "i", 9);
97
+ ɵɵlistener("click", function ArraySessionComponent_div_5_Template_i_click_4_listener() { ɵɵrestoreView(_r17); const item_r2 = ctx.$implicit; const ctx_r16 = ɵɵnextContext(); return ctx_r16.remove(item_r2); });
98
+ ɵɵelementEnd();
99
+ ɵɵelementEnd();
100
+ ɵɵtemplate(5, ArraySessionComponent_div_5_div_5_Template, 9, 6, "div", 10);
101
+ ɵɵtemplate(6, ArraySessionComponent_div_5_ng_container_6_Template, 1, 0, "ng-container", 11);
102
+ ɵɵelementEnd();
103
+ } if (rf & 2) {
104
+ const item_r2 = ctx.$implicit;
105
+ const index_r3 = ctx.index;
106
+ const ctx_r0 = ɵɵnextContext();
107
+ ɵɵadvance(2);
108
+ ɵɵtextInterpolate2("", ɵɵpipeBind1(3, 5, ctx_r0.removeLabel), " ", index_r3 + 1, " ");
109
+ ɵɵadvance(3);
110
+ ɵɵproperty("ngIf", item_r2.mappingAttributes || item_r2.mappingAttributes === "");
111
+ ɵɵadvance(1);
112
+ ɵɵproperty("ngTemplateOutlet", ctx_r0.subsectionItem)("ngTemplateOutletContext", ɵɵpureFunction1(11, _c2, ɵɵpureFunction3(7, _c1, ctx_r0.model, index_r3, item_r2.mappingAttributes || item_r2.mappingAttributes === "" ? item_r2.mappingAttributes : item_r2)));
113
+ } }
114
+ function ArraySessionComponent_button_11_Template(rf, ctx) { if (rf & 1) {
115
+ const _r19 = ɵɵgetCurrentView();
116
+ ɵɵelementStart(0, "button", 16);
117
+ ɵɵlistener("click", function ArraySessionComponent_button_11_Template_button_click_0_listener() { ɵɵrestoreView(_r19); const ctx_r18 = ɵɵnextContext(); return ctx_r18.addLoop(); });
118
+ ɵɵtext(1);
119
+ ɵɵpipe(2, "translate");
120
+ ɵɵelementEnd();
121
+ } if (rf & 2) {
122
+ ɵɵadvance(1);
123
+ ɵɵtextInterpolate(ɵɵpipeBind1(2, 1, "ADD_LOOP"));
124
+ } }
125
+ class ArraySessionComponent extends BaseSchemaComponent {
126
+ constructor() {
127
+ super(...arguments);
128
+ this.label = '';
129
+ this.showAddLoop = true;
130
+ this.removeLabel = '';
131
+ this.onAdd = new EventEmitter();
132
+ this.onAddLoop = new EventEmitter();
133
+ }
134
+ add() {
135
+ this.onAdd.next();
136
+ }
137
+ addLoop() {
138
+ this.onAddLoop.next();
139
+ }
140
+ remove(item) {
141
+ const values = this.model;
142
+ const index = values.indexOf(item);
143
+ values.splice(index, 1);
144
+ this.model = values;
145
+ }
146
+ trackByIndex(index, obj) {
147
+ return index;
148
+ }
149
+ }
150
+ ArraySessionComponent.ɵfac = function ArraySessionComponent_Factory(t) { return ɵArraySessionComponent_BaseFactory(t || ArraySessionComponent); };
151
+ ArraySessionComponent.ɵcmp = ɵɵdefineComponent({ type: ArraySessionComponent, selectors: [["array-session"]], contentQueries: function ArraySessionComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
152
+ ɵɵcontentQuery(dirIndex, TemplateRef, true, TemplateRef);
153
+ } if (rf & 2) {
154
+ var _t;
155
+ ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.subsectionItem = _t.first);
156
+ } }, inputs: { label: "label", showAddLoop: "showAddLoop", removeLabel: "removeLabel" }, outputs: { onAdd: "onAdd", onAddLoop: "onAddLoop" }, features: [ɵɵInheritDefinitionFeature], decls: 12, vars: 9, consts: [[1, "row"], [1, "col-md-12"], [1, "info-label", "bold"], ["class", "subsection-element", 4, "ngFor", "ngForOf", "ngForTrackBy"], [1, "row", "add-buttons"], [1, "btn", "btn-outline-primary", "float-left", "btn-personal-edit", 3, "click"], ["class", "btn btn-outline-primary float-left btn-personal-edit ml-2", 3, "click", 4, "ngIf"], [1, "subsection-element"], [1, "subsection-item-title"], [1, "far", "fa-trash-alt", 3, "click"], ["class", "row", 4, "ngIf"], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "col-md-8"], [1, "info-label"], ["type", "text", "dndDropzone", "", 1, "form-control", 3, "ngModel", "ngModelOptions", "ngModelChange", "dndDrop"], [1, "col-md-4"], [1, "btn", "btn-outline-primary", "float-left", "btn-personal-edit", "ml-2", 3, "click"]], template: function ArraySessionComponent_Template(rf, ctx) { if (rf & 1) {
157
+ ɵɵelementStart(0, "div", 0);
158
+ ɵɵelementStart(1, "div", 1);
159
+ ɵɵelementStart(2, "label", 2);
160
+ ɵɵtext(3);
161
+ ɵɵpipe(4, "translate");
162
+ ɵɵelementEnd();
163
+ ɵɵtemplate(5, ArraySessionComponent_div_5_Template, 7, 13, "div", 3);
164
+ ɵɵelementEnd();
165
+ ɵɵelementEnd();
166
+ ɵɵelementStart(6, "div", 4);
167
+ ɵɵelementStart(7, "div", 1);
168
+ ɵɵelementStart(8, "button", 5);
169
+ ɵɵlistener("click", function ArraySessionComponent_Template_button_click_8_listener() { return ctx.add(); });
170
+ ɵɵtext(9);
171
+ ɵɵpipe(10, "translate");
172
+ ɵɵelementEnd();
173
+ ɵɵtemplate(11, ArraySessionComponent_button_11_Template, 3, 3, "button", 6);
174
+ ɵɵelementEnd();
175
+ ɵɵelementEnd();
176
+ } if (rf & 2) {
177
+ ɵɵadvance(3);
178
+ ɵɵtextInterpolate(ɵɵpipeBind1(4, 5, ctx.label));
179
+ ɵɵadvance(2);
180
+ ɵɵproperty("ngForOf", ctx.model)("ngForTrackBy", ctx.trackByIndex);
181
+ ɵɵadvance(4);
182
+ ɵɵtextInterpolate(ɵɵpipeBind1(10, 7, "ADD_ITEM"));
183
+ ɵɵadvance(2);
184
+ ɵɵproperty("ngIf", ctx.showAddLoop);
185
+ } }, directives: [NgForOf, NgIf, NgTemplateOutlet, DefaultValueAccessor, DndDropzoneDirective, NgControlStatus, NgModel], pipes: [TranslatePipe], styles: [".subsection-element[_ngcontent-%COMP%]{background:#fff;border:1px solid #ccc;border-radius:5px;margin-top:10px;padding:5px 15px 15px}.subsection-element[_ngcontent-%COMP%]:first-child{margin-top:0!important}.btn-personal-edit[_ngcontent-%COMP%]{margin:5px 0}.subsection-item-title[_ngcontent-%COMP%]{align-items:center;background:#eee;border-bottom:1px solid #ccc;border-radius:5px 5px 0 0;display:flex;font-weight:700;justify-content:space-between;margin-bottom:5px;margin-left:-15px;margin-top:-5px;padding:7px 10px 7px 14px;width:calc(100% + 30px)}.subsection-item-title[_ngcontent-%COMP%] .fa-trash-alt[_ngcontent-%COMP%]{color:red;cursor:pointer}.subsection-item-title[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:700}.add-buttons[_ngcontent-%COMP%]{margin-top:5px}"] });
186
+ const ɵArraySessionComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(ArraySessionComponent);
187
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(ArraySessionComponent, [{
188
+ type: Component,
189
+ args: [{
190
+ selector: 'array-session',
191
+ templateUrl: 'array-session.html',
192
+ styleUrls: ['array-session.scss']
193
+ }]
194
+ }], null, { label: [{
195
+ type: Input
196
+ }], showAddLoop: [{
197
+ type: Input
198
+ }], removeLabel: [{
199
+ type: Input
200
+ }], onAdd: [{
201
+ type: Output
202
+ }], onAddLoop: [{
203
+ type: Output
204
+ }], subsectionItem: [{
205
+ type: ContentChild,
206
+ args: [TemplateRef, { read: TemplateRef }]
199
207
  }] }); })();
200
208
 
201
- function SchemaFormComponent_div_0_Template(rf, ctx) { if (rf & 1) {
202
- const _r4 = ɵɵgetCurrentView();
203
- ɵɵelementStart(0, "div", 1);
204
- ɵɵelementStart(1, "schema-input", 2);
205
- ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_input_modelChange_1_listener($event) { ɵɵrestoreView(_r4); const ctx_r3 = ɵɵnextContext(); return ctx_r3.model = $event; });
206
- ɵɵelementEnd();
207
- ɵɵelementStart(2, "schema-object", 2);
208
- ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_object_modelChange_2_listener($event) { ɵɵrestoreView(_r4); const ctx_r5 = ɵɵnextContext(); return ctx_r5.model = $event; });
209
- ɵɵelementEnd();
210
- ɵɵelementStart(3, "schema-array", 2);
211
- ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_array_modelChange_3_listener($event) { ɵɵrestoreView(_r4); const ctx_r6 = ɵɵnextContext(); return ctx_r6.model = $event; });
212
- ɵɵelementEnd();
213
- ɵɵelementEnd();
214
- } if (rf & 2) {
215
- const schema_r1 = ctx.$implicit;
216
- const i_r2 = ctx.index;
217
- const ctx_r0 = ɵɵnextContext();
218
- ɵɵadvance(1);
219
- ɵɵproperty("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schema", schema_r1)("editing", ctx_r0.editing)("index", i_r2);
220
- ɵɵadvance(1);
221
- ɵɵproperty("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schema", schema_r1)("editing", ctx_r0.editing)("index", i_r2);
222
- ɵɵadvance(1);
223
- ɵɵproperty("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schema", schema_r1)("editing", ctx_r0.editing)("index", i_r2);
224
- } }
225
- class SchemaFormComponent extends BaseSchemaComponent {
226
- constructor() {
227
- super(...arguments);
228
- this.schemas = [];
229
- this.customProperties = false;
230
- this.editing = false;
231
- this.loaded = false;
232
- }
233
- ngAfterContentInit() {
234
- this.loaded = true;
235
- console.log('SchemaFormComponent schemas', this.schemas);
236
- }
237
- onDrop($event, modelElement) {
238
- return onDropStruct($event, modelElement);
239
- }
240
- getId(index) {
241
- return `${this.idPrefix}-struct-${index}`;
242
- }
243
- }
244
- SchemaFormComponent.ɵfac = function SchemaFormComponent_Factory(t) { return ɵSchemaFormComponent_BaseFactory(t || SchemaFormComponent); };
245
- SchemaFormComponent.ɵcmp = ɵɵdefineComponent({ type: SchemaFormComponent, selectors: [["schema-form"]], inputs: { idPrefix: "idPrefix", schemas: "schemas", customProperties: "customProperties", editing: "editing", inputType: "inputType" }, features: [ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "schema-properties", 4, "ngFor", "ngForOf"], [1, "schema-properties"], [3, "idPrefix", "model", "schema", "editing", "index", "modelChange"]], template: function SchemaFormComponent_Template(rf, ctx) { if (rf & 1) {
246
- ɵɵtemplate(0, SchemaFormComponent_div_0_Template, 4, 15, "div", 0);
247
- } if (rf & 2) {
248
- ɵɵproperty("ngForOf", ctx.schemas);
249
- } }, styles: [""] });
250
- const ɵSchemaFormComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaFormComponent);
251
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaFormComponent, [{
252
- type: Component,
253
- args: [{
254
- selector: 'schema-form',
255
- templateUrl: 'schema-form.html',
256
- styleUrls: ['./schema-form.scss']
257
- }]
258
- }], null, { idPrefix: [{
259
- type: Input
260
- }], schemas: [{
261
- type: Input
262
- }], customProperties: [{
263
- type: Input
264
- }], editing: [{
265
- type: Input
266
- }], inputType: [{
267
- type: Input
209
+ function SchemaFormComponent_div_0_Template(rf, ctx) { if (rf & 1) {
210
+ const _r4 = ɵɵgetCurrentView();
211
+ ɵɵelementStart(0, "div", 1);
212
+ ɵɵelementStart(1, "schema-input", 2);
213
+ ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_input_modelChange_1_listener($event) { ɵɵrestoreView(_r4); const ctx_r3 = ɵɵnextContext(); return ctx_r3.model = $event; });
214
+ ɵɵelementEnd();
215
+ ɵɵelementStart(2, "schema-object", 2);
216
+ ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_object_modelChange_2_listener($event) { ɵɵrestoreView(_r4); const ctx_r5 = ɵɵnextContext(); return ctx_r5.model = $event; });
217
+ ɵɵelementEnd();
218
+ ɵɵelementStart(3, "schema-array", 2);
219
+ ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_array_modelChange_3_listener($event) { ɵɵrestoreView(_r4); const ctx_r6 = ɵɵnextContext(); return ctx_r6.model = $event; });
220
+ ɵɵelementEnd();
221
+ ɵɵelementEnd();
222
+ } if (rf & 2) {
223
+ const schema_r1 = ctx.$implicit;
224
+ const i_r2 = ctx.index;
225
+ const ctx_r0 = ɵɵnextContext();
226
+ ɵɵadvance(1);
227
+ ɵɵproperty("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schema", schema_r1)("editing", ctx_r0.editing)("index", i_r2);
228
+ ɵɵadvance(1);
229
+ ɵɵproperty("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schema", schema_r1)("editing", ctx_r0.editing)("index", i_r2);
230
+ ɵɵadvance(1);
231
+ ɵɵproperty("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schema", schema_r1)("editing", ctx_r0.editing)("index", i_r2);
232
+ } }
233
+ class SchemaFormComponent extends BaseSchemaComponent {
234
+ constructor() {
235
+ super(...arguments);
236
+ this.schemas = [];
237
+ this.customProperties = false;
238
+ this.editing = false;
239
+ this.loaded = false;
240
+ }
241
+ ngAfterContentInit() {
242
+ this.loaded = true;
243
+ }
244
+ onDrop($event, modelElement) {
245
+ return onDropStruct($event, modelElement);
246
+ }
247
+ getId(index) {
248
+ return `${this.idPrefix}-struct-${index}`;
249
+ }
250
+ }
251
+ SchemaFormComponent.ɵfac = function SchemaFormComponent_Factory(t) { return ɵSchemaFormComponent_BaseFactory(t || SchemaFormComponent); };
252
+ SchemaFormComponent.ɵcmp = ɵɵdefineComponent({ type: SchemaFormComponent, selectors: [["schema-form"]], inputs: { idPrefix: "idPrefix", schemas: "schemas", customProperties: "customProperties", editing: "editing", inputType: "inputType" }, features: [ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "schema-properties", 4, "ngFor", "ngForOf"], [1, "schema-properties"], [3, "idPrefix", "model", "schema", "editing", "index", "modelChange"]], template: function SchemaFormComponent_Template(rf, ctx) { if (rf & 1) {
253
+ ɵɵtemplate(0, SchemaFormComponent_div_0_Template, 4, 15, "div", 0);
254
+ } if (rf & 2) {
255
+ ɵɵproperty("ngForOf", ctx.schemas);
256
+ } }, styles: [""] });
257
+ const ɵSchemaFormComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaFormComponent);
258
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaFormComponent, [{
259
+ type: Component,
260
+ args: [{
261
+ selector: 'schema-form',
262
+ templateUrl: 'schema-form.html',
263
+ styleUrls: ['./schema-form.scss']
264
+ }]
265
+ }], null, { idPrefix: [{
266
+ type: Input
267
+ }], schemas: [{
268
+ type: Input
269
+ }], customProperties: [{
270
+ type: Input
271
+ }], editing: [{
272
+ type: Input
273
+ }], inputType: [{
274
+ type: Input
268
275
  }] }); })();
269
276
 
270
- const _c0$1 = function () { return { standalone: true }; };
271
- function SchemaCustomAttributesComponent_div_0_Template(rf, ctx) { if (rf & 1) {
272
- const _r8 = ɵɵgetCurrentView();
273
- ɵɵelementStart(0, "div", 6);
274
- ɵɵelementStart(1, "div", 7);
275
- ɵɵelementStart(2, "label", 8);
276
- ɵɵtext(3);
277
- ɵɵelementEnd();
278
- ɵɵelementStart(4, "span", 9);
279
- ɵɵlistener("click", function SchemaCustomAttributesComponent_div_0_Template_span_click_4_listener() { ɵɵrestoreView(_r8); const i_r6 = ctx.index; const ctx_r7 = ɵɵnextContext(); return ctx_r7.removeCustomAttribute(i_r6); });
280
- ɵɵelement(5, "i", 10);
281
- ɵɵpipe(6, "translate");
282
- ɵɵelementEnd();
283
- ɵɵelementStart(7, "input", 11);
284
- ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_0_Template_input_ngModelChange_7_listener($event) { ɵɵrestoreView(_r8); const attribute_r5 = ctx.$implicit; return attribute_r5.value = $event; })("dndDrop", function SchemaCustomAttributesComponent_div_0_Template_input_dndDrop_7_listener($event) { ɵɵrestoreView(_r8); const attribute_r5 = ctx.$implicit; const ctx_r10 = ɵɵnextContext(); return ctx_r10.onDrop($event, attribute_r5); });
285
- ɵɵelementEnd();
286
- ɵɵelementEnd();
287
- ɵɵelementEnd();
288
- } if (rf & 2) {
289
- const attribute_r5 = ctx.$implicit;
290
- ɵɵadvance(3);
291
- ɵɵtextInterpolate(attribute_r5.label);
292
- ɵɵadvance(2);
293
- ɵɵproperty("matTooltip", ɵɵpipeBind1(6, 4, "REMOVE"));
294
- ɵɵadvance(2);
295
- ɵɵproperty("ngModel", attribute_r5.value)("ngModelOptions", ɵɵpureFunction0(6, _c0$1));
296
- } }
297
- function SchemaCustomAttributesComponent_div_1_Template(rf, ctx) { if (rf & 1) {
298
- const _r12 = ɵɵgetCurrentView();
299
- ɵɵelementStart(0, "div", 12);
300
- ɵɵelementStart(1, "div", 13);
301
- ɵɵelementStart(2, "div", 7);
302
- ɵɵelementStart(3, "label", 8);
303
- ɵɵtext(4);
304
- ɵɵpipe(5, "translate");
305
- ɵɵelementStart(6, "strong");
306
- ɵɵtext(7, "*");
307
- ɵɵelementEnd();
308
- ɵɵelementEnd();
309
- ɵɵelementStart(8, "input", 14);
310
- ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_8_listener($event) { ɵɵrestoreView(_r12); const ctx_r11 = ɵɵnextContext(); return ctx_r11.newCustomField.label = $event; });
311
- ɵɵelementEnd();
312
- ɵɵelementEnd();
313
- ɵɵelementEnd();
314
- ɵɵelementStart(9, "div", 13);
315
- ɵɵelementStart(10, "div", 7);
316
- ɵɵelementStart(11, "label", 8);
317
- ɵɵtext(12);
318
- ɵɵpipe(13, "translate");
319
- ɵɵelementStart(14, "strong");
320
- ɵɵtext(15, "*");
321
- ɵɵelementEnd();
322
- ɵɵelementEnd();
323
- ɵɵelementStart(16, "input", 11);
324
- ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_16_listener($event) { ɵɵrestoreView(_r12); const ctx_r13 = ɵɵnextContext(); return ctx_r13.newCustomField.value = $event; })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_16_listener($event) { ɵɵrestoreView(_r12); const ctx_r14 = ɵɵnextContext(); return ctx_r14.onDrop($event, ctx_r14.newCustomField); });
325
- ɵɵelementEnd();
326
- ɵɵelementEnd();
327
- ɵɵelementEnd();
328
- ɵɵelementEnd();
329
- } if (rf & 2) {
330
- const ctx_r1 = ɵɵnextContext();
331
- ɵɵadvance(4);
332
- ɵɵtextInterpolate(ɵɵpipeBind1(5, 6, "STEP.NAME"));
333
- ɵɵadvance(4);
334
- ɵɵproperty("ngModel", ctx_r1.newCustomField.label)("ngModelOptions", ɵɵpureFunction0(10, _c0$1));
335
- ɵɵadvance(4);
336
- ɵɵtextInterpolate(ɵɵpipeBind1(13, 8, "STEP.VALUE"));
337
- ɵɵadvance(4);
338
- ɵɵproperty("ngModel", ctx_r1.newCustomField.value)("ngModelOptions", ɵɵpureFunction0(11, _c0$1));
339
- } }
340
- function SchemaCustomAttributesComponent_button_4_Template(rf, ctx) { if (rf & 1) {
341
- const _r16 = ɵɵgetCurrentView();
342
- ɵɵelementStart(0, "button", 15);
343
- ɵɵlistener("click", function SchemaCustomAttributesComponent_button_4_Template_button_click_0_listener() { ɵɵrestoreView(_r16); const ctx_r15 = ɵɵnextContext(); return ctx_r15.newCustomField = {}; });
344
- ɵɵtext(1);
345
- ɵɵpipe(2, "translate");
346
- ɵɵelementEnd();
347
- } if (rf & 2) {
348
- ɵɵadvance(1);
349
- ɵɵtextInterpolate1(" ", ɵɵpipeBind1(2, 1, "ADD"), " ");
350
- } }
351
- function SchemaCustomAttributesComponent_button_5_Template(rf, ctx) { if (rf & 1) {
352
- const _r18 = ɵɵgetCurrentView();
353
- ɵɵelementStart(0, "button", 16);
354
- ɵɵlistener("click", function SchemaCustomAttributesComponent_button_5_Template_button_click_0_listener() { ɵɵrestoreView(_r18); const ctx_r17 = ɵɵnextContext(); return ctx_r17.newCustomField = null; });
355
- ɵɵtext(1);
356
- ɵɵpipe(2, "translate");
357
- ɵɵelementEnd();
358
- } if (rf & 2) {
359
- ɵɵadvance(1);
360
- ɵɵtextInterpolate1(" ", ɵɵpipeBind1(2, 1, "CANCEL"), " ");
361
- } }
362
- function SchemaCustomAttributesComponent_button_6_Template(rf, ctx) { if (rf & 1) {
363
- const _r20 = ɵɵgetCurrentView();
364
- ɵɵelementStart(0, "button", 15);
365
- ɵɵlistener("click", function SchemaCustomAttributesComponent_button_6_Template_button_click_0_listener() { ɵɵrestoreView(_r20); const ctx_r19 = ɵɵnextContext(); return ctx_r19.saveNewAttribute(ctx_r19.newCustomField); });
366
- ɵɵtext(1);
367
- ɵɵpipe(2, "translate");
368
- ɵɵelementEnd();
369
- } if (rf & 2) {
370
- ɵɵadvance(1);
371
- ɵɵtextInterpolate1(" ", ɵɵpipeBind1(2, 1, "SAVE"), " ");
372
- } }
373
- class SchemaCustomAttributesComponent extends BaseSchemaComponent {
374
- constructor() {
375
- super(...arguments);
376
- this.onSaveAttribute = new EventEmitter();
377
- this.onDropOnAttribute = new EventEmitter();
378
- }
379
- ngAfterContentInit() {
380
- if (!this.model) {
381
- this.model = [];
382
- }
383
- }
384
- saveNewAttribute(newCustomField) {
385
- this.onSaveAttribute.emit(newCustomField);
386
- this.model.push(newCustomField);
387
- this.newCustomField = null;
388
- this.modelChange.emit(this.model);
389
- }
390
- removeCustomAttribute(attributeIndex) {
391
- this.model.splice(attributeIndex, 1);
392
- this.modelChange.emit(this.model);
393
- }
394
- onDrop($event, attribute) {
395
- if (!attribute.value) {
396
- attribute.value = '';
397
- }
398
- attribute.value += `{{${$event.data}}}`;
399
- }
400
- }
401
- SchemaCustomAttributesComponent.ɵfac = function SchemaCustomAttributesComponent_Factory(t) { return ɵSchemaCustomAttributesComponent_BaseFactory(t || SchemaCustomAttributesComponent); };
402
- SchemaCustomAttributesComponent.ɵcmp = ɵɵdefineComponent({ type: SchemaCustomAttributesComponent, selectors: [["schema-custom-attributes"]], inputs: { onDropFunction: "onDropFunction" }, outputs: { onSaveAttribute: "onSaveAttribute", onDropOnAttribute: "onDropOnAttribute" }, features: [ɵɵInheritDefinitionFeature], decls: 7, vars: 5, consts: [["class", "row custom-attributes", 4, "ngFor", "ngForOf"], ["class", "struct-custom-field", 4, "ngIf"], [1, "row", "actions-buttons"], [1, "col-md-12", "pull-right"], ["class", "btn btn-outline-primary float-left", 3, "click", 4, "ngIf"], ["class", "btn btn-outline-danger float-left ml-2", 3, "click", 4, "ngIf"], [1, "row", "custom-attributes"], [1, "col-md-12"], [1, "info-label"], [1, "customAttributeDeleteIcon", 3, "click"], [1, "far", "fa-trash-alt", 3, "matTooltip"], ["dndDropzone", "", 1, "form-control", 3, "ngModel", "ngModelOptions", "ngModelChange", "dndDrop"], [1, "struct-custom-field"], [1, "row"], [1, "form-control", 3, "ngModel", "ngModelOptions", "ngModelChange"], [1, "btn", "btn-outline-primary", "float-left", 3, "click"], [1, "btn", "btn-outline-danger", "float-left", "ml-2", 3, "click"]], template: function SchemaCustomAttributesComponent_Template(rf, ctx) { if (rf & 1) {
403
- ɵɵtemplate(0, SchemaCustomAttributesComponent_div_0_Template, 8, 7, "div", 0);
404
- ɵɵtemplate(1, SchemaCustomAttributesComponent_div_1_Template, 17, 12, "div", 1);
405
- ɵɵelementStart(2, "div", 2);
406
- ɵɵelementStart(3, "div", 3);
407
- ɵɵtemplate(4, SchemaCustomAttributesComponent_button_4_Template, 3, 3, "button", 4);
408
- ɵɵtemplate(5, SchemaCustomAttributesComponent_button_5_Template, 3, 3, "button", 5);
409
- ɵɵtemplate(6, SchemaCustomAttributesComponent_button_6_Template, 3, 3, "button", 4);
410
- ɵɵelementEnd();
411
- ɵɵelementEnd();
412
- } if (rf & 2) {
413
- ɵɵproperty("ngForOf", ctx.model);
414
- ɵɵadvance(1);
415
- ɵɵproperty("ngIf", ctx.newCustomField);
416
- ɵɵadvance(3);
417
- ɵɵproperty("ngIf", !ctx.newCustomField);
418
- ɵɵadvance(1);
419
- ɵɵproperty("ngIf", ctx.newCustomField);
420
- ɵɵadvance(1);
421
- ɵɵproperty("ngIf", ctx.newCustomField && ctx.newCustomField.label && ctx.newCustomField.value);
422
- } }, directives: [NgForOf, NgIf, MatTooltip, DefaultValueAccessor, DndDropzoneDirective, NgControlStatus, NgModel], pipes: [TranslatePipe], styles: [".customAttributeDeleteIcon[_ngcontent-%COMP%]{color:red;cursor:pointer;font-size:16px;position:absolute;right:15px;top:4px}.customAttributeDeleteIcon[_ngcontent-%COMP%]:hover{color:#777}.struct-custom-field[_ngcontent-%COMP%]{background-color:#ececec;margin-top:16px;padding:8px 16px 16px}"] });
423
- const ɵSchemaCustomAttributesComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaCustomAttributesComponent);
424
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaCustomAttributesComponent, [{
425
- type: Component,
426
- args: [{
427
- selector: 'schema-custom-attributes',
428
- templateUrl: 'schema-custom-attributes.html',
429
- styleUrls: ['./schema-custom-attributes.scss']
430
- }]
431
- }], null, { onDropFunction: [{
432
- type: Input
433
- }], onSaveAttribute: [{
434
- type: Output
435
- }], onDropOnAttribute: [{
436
- type: Output
277
+ const _c0$1 = function () { return { standalone: true }; };
278
+ function SchemaCustomAttributesComponent_div_0_Template(rf, ctx) { if (rf & 1) {
279
+ const _r8 = ɵɵgetCurrentView();
280
+ ɵɵelementStart(0, "div", 6);
281
+ ɵɵelementStart(1, "div", 7);
282
+ ɵɵelementStart(2, "label", 8);
283
+ ɵɵtext(3);
284
+ ɵɵelementEnd();
285
+ ɵɵelementStart(4, "span", 9);
286
+ ɵɵlistener("click", function SchemaCustomAttributesComponent_div_0_Template_span_click_4_listener() { ɵɵrestoreView(_r8); const i_r6 = ctx.index; const ctx_r7 = ɵɵnextContext(); return ctx_r7.removeCustomAttribute(i_r6); });
287
+ ɵɵelement(5, "i", 10);
288
+ ɵɵpipe(6, "translate");
289
+ ɵɵelementEnd();
290
+ ɵɵelementStart(7, "input", 11);
291
+ ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_0_Template_input_ngModelChange_7_listener($event) { ɵɵrestoreView(_r8); const attribute_r5 = ctx.$implicit; return attribute_r5.value = $event; })("dndDrop", function SchemaCustomAttributesComponent_div_0_Template_input_dndDrop_7_listener($event) { ɵɵrestoreView(_r8); const attribute_r5 = ctx.$implicit; const ctx_r10 = ɵɵnextContext(); return ctx_r10.onDropAttr($event, attribute_r5); });
292
+ ɵɵelementEnd();
293
+ ɵɵelementEnd();
294
+ ɵɵelementEnd();
295
+ } if (rf & 2) {
296
+ const attribute_r5 = ctx.$implicit;
297
+ ɵɵadvance(3);
298
+ ɵɵtextInterpolate(attribute_r5.label);
299
+ ɵɵadvance(2);
300
+ ɵɵproperty("matTooltip", ɵɵpipeBind1(6, 4, "REMOVE"));
301
+ ɵɵadvance(2);
302
+ ɵɵproperty("ngModel", attribute_r5.value)("ngModelOptions", ɵɵpureFunction0(6, _c0$1));
303
+ } }
304
+ function SchemaCustomAttributesComponent_div_1_Template(rf, ctx) { if (rf & 1) {
305
+ const _r12 = ɵɵgetCurrentView();
306
+ ɵɵelementStart(0, "div", 12);
307
+ ɵɵelementStart(1, "div", 13);
308
+ ɵɵelementStart(2, "div", 7);
309
+ ɵɵelementStart(3, "label", 8);
310
+ ɵɵtext(4);
311
+ ɵɵpipe(5, "translate");
312
+ ɵɵelementStart(6, "strong");
313
+ ɵɵtext(7, "*");
314
+ ɵɵelementEnd();
315
+ ɵɵelementEnd();
316
+ ɵɵelementStart(8, "input", 14);
317
+ ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_8_listener($event) { ɵɵrestoreView(_r12); const ctx_r11 = ɵɵnextContext(); return ctx_r11.newCustomField.label = $event; });
318
+ ɵɵelementEnd();
319
+ ɵɵelementEnd();
320
+ ɵɵelementEnd();
321
+ ɵɵelementStart(9, "div", 13);
322
+ ɵɵelementStart(10, "div", 7);
323
+ ɵɵelementStart(11, "label", 8);
324
+ ɵɵtext(12);
325
+ ɵɵpipe(13, "translate");
326
+ ɵɵelementStart(14, "strong");
327
+ ɵɵtext(15, "*");
328
+ ɵɵelementEnd();
329
+ ɵɵelementEnd();
330
+ ɵɵelementStart(16, "input", 11);
331
+ ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_16_listener($event) { ɵɵrestoreView(_r12); const ctx_r13 = ɵɵnextContext(); return ctx_r13.newCustomField.value = $event; })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_16_listener($event) { ɵɵrestoreView(_r12); const ctx_r14 = ɵɵnextContext(); return ctx_r14.onDropAttr($event, ctx_r14.newCustomField); });
332
+ ɵɵelementEnd();
333
+ ɵɵelementEnd();
334
+ ɵɵelementEnd();
335
+ ɵɵelementEnd();
336
+ } if (rf & 2) {
337
+ const ctx_r1 = ɵɵnextContext();
338
+ ɵɵadvance(4);
339
+ ɵɵtextInterpolate(ɵɵpipeBind1(5, 6, "STEP.NAME"));
340
+ ɵɵadvance(4);
341
+ ɵɵproperty("ngModel", ctx_r1.newCustomField.label)("ngModelOptions", ɵɵpureFunction0(10, _c0$1));
342
+ ɵɵadvance(4);
343
+ ɵɵtextInterpolate(ɵɵpipeBind1(13, 8, "STEP.VALUE"));
344
+ ɵɵadvance(4);
345
+ ɵɵproperty("ngModel", ctx_r1.newCustomField.value)("ngModelOptions", ɵɵpureFunction0(11, _c0$1));
346
+ } }
347
+ function SchemaCustomAttributesComponent_button_4_Template(rf, ctx) { if (rf & 1) {
348
+ const _r16 = ɵɵgetCurrentView();
349
+ ɵɵelementStart(0, "button", 15);
350
+ ɵɵlistener("click", function SchemaCustomAttributesComponent_button_4_Template_button_click_0_listener() { ɵɵrestoreView(_r16); const ctx_r15 = ɵɵnextContext(); return ctx_r15.newCustomField = {}; });
351
+ ɵɵtext(1);
352
+ ɵɵpipe(2, "translate");
353
+ ɵɵelementEnd();
354
+ } if (rf & 2) {
355
+ ɵɵadvance(1);
356
+ ɵɵtextInterpolate1(" ", ɵɵpipeBind1(2, 1, "ADD"), " ");
357
+ } }
358
+ function SchemaCustomAttributesComponent_button_5_Template(rf, ctx) { if (rf & 1) {
359
+ const _r18 = ɵɵgetCurrentView();
360
+ ɵɵelementStart(0, "button", 16);
361
+ ɵɵlistener("click", function SchemaCustomAttributesComponent_button_5_Template_button_click_0_listener() { ɵɵrestoreView(_r18); const ctx_r17 = ɵɵnextContext(); return ctx_r17.newCustomField = null; });
362
+ ɵɵtext(1);
363
+ ɵɵpipe(2, "translate");
364
+ ɵɵelementEnd();
365
+ } if (rf & 2) {
366
+ ɵɵadvance(1);
367
+ ɵɵtextInterpolate1(" ", ɵɵpipeBind1(2, 1, "CANCEL"), " ");
368
+ } }
369
+ function SchemaCustomAttributesComponent_button_6_Template(rf, ctx) { if (rf & 1) {
370
+ const _r20 = ɵɵgetCurrentView();
371
+ ɵɵelementStart(0, "button", 15);
372
+ ɵɵlistener("click", function SchemaCustomAttributesComponent_button_6_Template_button_click_0_listener() { ɵɵrestoreView(_r20); const ctx_r19 = ɵɵnextContext(); return ctx_r19.saveNewAttribute(ctx_r19.newCustomField); });
373
+ ɵɵtext(1);
374
+ ɵɵpipe(2, "translate");
375
+ ɵɵelementEnd();
376
+ } if (rf & 2) {
377
+ ɵɵadvance(1);
378
+ ɵɵtextInterpolate1(" ", ɵɵpipeBind1(2, 1, "SAVE"), " ");
379
+ } }
380
+ class SchemaCustomAttributesComponent extends BaseSchemaComponent {
381
+ constructor() {
382
+ super(...arguments);
383
+ this.onSaveAttribute = new EventEmitter();
384
+ this.onDropOnAttribute = new EventEmitter();
385
+ }
386
+ ngAfterContentInit() {
387
+ if (!this.model) {
388
+ this.model = [];
389
+ }
390
+ }
391
+ saveNewAttribute(newCustomField) {
392
+ this.onSaveAttribute.emit(newCustomField);
393
+ this.model.push(newCustomField);
394
+ this.newCustomField = null;
395
+ this.modelChange.emit(this.model);
396
+ }
397
+ removeCustomAttribute(attributeIndex) {
398
+ this.model.splice(attributeIndex, 1);
399
+ this.modelChange.emit(this.model);
400
+ }
401
+ onDropAttr($event, attribute) {
402
+ if (!attribute.value) {
403
+ attribute.value = '';
404
+ }
405
+ attribute.value += `{{${$event.data}}}`;
406
+ }
407
+ }
408
+ SchemaCustomAttributesComponent.ɵfac = function SchemaCustomAttributesComponent_Factory(t) { return ɵSchemaCustomAttributesComponent_BaseFactory(t || SchemaCustomAttributesComponent); };
409
+ SchemaCustomAttributesComponent.ɵcmp = ɵɵdefineComponent({ type: SchemaCustomAttributesComponent, selectors: [["schema-custom-attributes"]], inputs: { onDropFunction: "onDropFunction" }, outputs: { onSaveAttribute: "onSaveAttribute", onDropOnAttribute: "onDropOnAttribute" }, features: [ɵɵInheritDefinitionFeature], decls: 7, vars: 5, consts: [["class", "row custom-attributes", 4, "ngFor", "ngForOf"], ["class", "struct-custom-field", 4, "ngIf"], [1, "row", "actions-buttons"], [1, "col-md-12", "pull-right"], ["class", "btn btn-outline-primary float-left", 3, "click", 4, "ngIf"], ["class", "btn btn-outline-danger float-left ml-2", 3, "click", 4, "ngIf"], [1, "row", "custom-attributes"], [1, "col-md-12"], [1, "info-label"], [1, "customAttributeDeleteIcon", 3, "click"], [1, "far", "fa-trash-alt", 3, "matTooltip"], ["dndDropzone", "", 1, "form-control", 3, "ngModel", "ngModelOptions", "ngModelChange", "dndDrop"], [1, "struct-custom-field"], [1, "row"], [1, "form-control", 3, "ngModel", "ngModelOptions", "ngModelChange"], [1, "btn", "btn-outline-primary", "float-left", 3, "click"], [1, "btn", "btn-outline-danger", "float-left", "ml-2", 3, "click"]], template: function SchemaCustomAttributesComponent_Template(rf, ctx) { if (rf & 1) {
410
+ ɵɵtemplate(0, SchemaCustomAttributesComponent_div_0_Template, 8, 7, "div", 0);
411
+ ɵɵtemplate(1, SchemaCustomAttributesComponent_div_1_Template, 17, 12, "div", 1);
412
+ ɵɵelementStart(2, "div", 2);
413
+ ɵɵelementStart(3, "div", 3);
414
+ ɵɵtemplate(4, SchemaCustomAttributesComponent_button_4_Template, 3, 3, "button", 4);
415
+ ɵɵtemplate(5, SchemaCustomAttributesComponent_button_5_Template, 3, 3, "button", 5);
416
+ ɵɵtemplate(6, SchemaCustomAttributesComponent_button_6_Template, 3, 3, "button", 4);
417
+ ɵɵelementEnd();
418
+ ɵɵelementEnd();
419
+ } if (rf & 2) {
420
+ ɵɵproperty("ngForOf", ctx.model);
421
+ ɵɵadvance(1);
422
+ ɵɵproperty("ngIf", ctx.newCustomField);
423
+ ɵɵadvance(3);
424
+ ɵɵproperty("ngIf", !ctx.newCustomField);
425
+ ɵɵadvance(1);
426
+ ɵɵproperty("ngIf", ctx.newCustomField);
427
+ ɵɵadvance(1);
428
+ ɵɵproperty("ngIf", ctx.newCustomField && ctx.newCustomField.label && ctx.newCustomField.value);
429
+ } }, directives: [NgForOf, NgIf, MatTooltip, DefaultValueAccessor, DndDropzoneDirective, NgControlStatus, NgModel], pipes: [TranslatePipe], styles: [".customAttributeDeleteIcon[_ngcontent-%COMP%]{color:red;cursor:pointer;font-size:16px;position:absolute;right:15px;top:4px}.customAttributeDeleteIcon[_ngcontent-%COMP%]:hover{color:#777}.struct-custom-field[_ngcontent-%COMP%]{background-color:#ececec;margin-top:16px;padding:8px 16px 16px}"] });
430
+ const ɵSchemaCustomAttributesComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaCustomAttributesComponent);
431
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaCustomAttributesComponent, [{
432
+ type: Component,
433
+ args: [{
434
+ selector: 'schema-custom-attributes',
435
+ templateUrl: 'schema-custom-attributes.html',
436
+ styleUrls: ['./schema-custom-attributes.scss']
437
+ }]
438
+ }], null, { onDropFunction: [{
439
+ type: Input
440
+ }], onSaveAttribute: [{
441
+ type: Output
442
+ }], onDropOnAttribute: [{
443
+ type: Output
437
444
  }] }); })();
438
445
 
439
- function SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template(rf, ctx) { if (rf & 1) {
440
- const _r8 = ɵɵgetCurrentView();
441
- ɵɵelementStart(0, "schema-form", 4);
442
- ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template_schema_form_modelChange_0_listener($event) { ɵɵrestoreView(_r8); const item_r3 = ɵɵnextContext().$implicit; const ctx_r7 = ɵɵnextContext(2); return ctx_r7.model[ctx_r7.schema.id][item_r3.index].mappingAttributes = $event; });
443
- ɵɵelementEnd();
444
- } if (rf & 2) {
445
- const item_r3 = ɵɵnextContext().$implicit;
446
- const ctx_r4 = ɵɵnextContext(2);
447
- ɵɵproperty("idPrefix", ctx_r4.idPrefix)("model", ctx_r4.model[ctx_r4.schema.id][item_r3.index].mappingAttributes)("schemas", ctx_r4.getSchemaProperties())("editing", ctx_r4.editing);
448
- } }
449
- function SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template(rf, ctx) { if (rf & 1) {
450
- const _r12 = ɵɵgetCurrentView();
451
- ɵɵelementStart(0, "schema-form", 4);
452
- ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template_schema_form_modelChange_0_listener($event) { ɵɵrestoreView(_r12); const item_r3 = ɵɵnextContext().$implicit; const ctx_r11 = ɵɵnextContext(2); return (ctx_r11.model[ctx_r11.schema.id][item_r3.index] = $event); });
453
- ɵɵelementEnd();
454
- } if (rf & 2) {
455
- const item_r3 = ɵɵnextContext().$implicit;
456
- const ctx_r5 = ɵɵnextContext(2);
457
- ɵɵproperty("idPrefix", ctx_r5.idPrefix)("model", ctx_r5.model[ctx_r5.schema.id][item_r3.index])("schemas", ctx_r5.getSchemaProperties())("editing", ctx_r5.editing);
458
- } }
459
- function SchemaArrayComponent_div_0_ng_template_2_div_2_Template(rf, ctx) { if (rf & 1) {
460
- const _r16 = ɵɵgetCurrentView();
461
- ɵɵelementStart(0, "div", 5);
462
- ɵɵelementStart(1, "div", 6);
463
- ɵɵelementStart(2, "label", 7);
464
- ɵɵtext(3);
465
- ɵɵpipe(4, "translate");
466
- ɵɵelementEnd();
467
- ɵɵelementStart(5, "schema-custom-attributes", 8);
468
- ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_div_2_Template_schema_custom_attributes_modelChange_5_listener($event) { ɵɵrestoreView(_r16); const item_r3 = ɵɵnextContext().$implicit; const ctx_r15 = ɵɵnextContext(2); return ctx_r15.model[ctx_r15.schema.id][item_r3.index].customAttributes = $event; });
469
- ɵɵelementEnd();
470
- ɵɵelementEnd();
471
- ɵɵelementEnd();
472
- } if (rf & 2) {
473
- const item_r3 = ɵɵnextContext().$implicit;
474
- const ctx_r6 = ɵɵnextContext(2);
475
- ɵɵadvance(3);
476
- ɵɵtextInterpolate(ɵɵpipeBind1(4, 3, "STEP.ADDITIONAL_ATTRIBUTES"));
477
- ɵɵadvance(2);
478
- ɵɵproperty("model", ctx_r6.model[ctx_r6.schema.id][item_r3.index].customAttributes)("onDropFunction", ctx_r6.onDrop);
479
- } }
480
- function SchemaArrayComponent_div_0_ng_template_2_Template(rf, ctx) { if (rf & 1) {
481
- ɵɵtemplate(0, SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template, 1, 4, "schema-form", 2);
482
- ɵɵtemplate(1, SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template, 1, 4, "schema-form", 2);
483
- ɵɵtemplate(2, SchemaArrayComponent_div_0_ng_template_2_div_2_Template, 6, 5, "div", 3);
484
- } if (rf & 2) {
485
- const item_r3 = ctx.$implicit;
486
- const ctx_r2 = ɵɵnextContext(2);
487
- ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index].loop !== undefined);
488
- ɵɵadvance(1);
489
- ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index].loop == undefined);
490
- ɵɵadvance(1);
491
- ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index] && ctx_r2.schema.customProperties);
492
- } }
493
- function SchemaArrayComponent_div_0_Template(rf, ctx) { if (rf & 1) {
494
- const _r20 = ɵɵgetCurrentView();
495
- ɵɵelementStart(0, "div");
496
- ɵɵelementStart(1, "array-session", 1);
497
- ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_Template_array_session_modelChange_1_listener($event) { ɵɵrestoreView(_r20); const ctx_r19 = ɵɵnextContext(); return (ctx_r19.model[ctx_r19.schema.id] = $event); })("onAdd", function SchemaArrayComponent_div_0_Template_array_session_onAdd_1_listener() { ɵɵrestoreView(_r20); const ctx_r21 = ɵɵnextContext(); return ctx_r21.addArrayItem(ctx_r21.schema.id, {}); })("onAddLoop", function SchemaArrayComponent_div_0_Template_array_session_onAddLoop_1_listener() { ɵɵrestoreView(_r20); const ctx_r22 = ɵɵnextContext(); return ctx_r22.addArrayLoop(ctx_r22.schema.id, {}); });
498
- ɵɵtemplate(2, SchemaArrayComponent_div_0_ng_template_2_Template, 3, 3, "ng-template");
499
- ɵɵelementEnd();
500
- ɵɵelementEnd();
501
- } if (rf & 2) {
502
- const ctx_r0 = ɵɵnextContext();
503
- ɵɵadvance(1);
504
- ɵɵproperty("label", ctx_r0.schema.title)("removeLabel", ctx_r0.schema.title)("model", ctx_r0.model[ctx_r0.schema.id])("showAddLoop", ctx_r0.schema.withoutLoop !== true);
505
- } }
506
- const _c0$2 = function () { return { standalone: true }; };
507
- function SchemaArrayComponent_div_1_ng_template_2_input_3_Template(rf, ctx) { if (rf & 1) {
508
- const _r30 = ɵɵgetCurrentView();
509
- ɵɵelementStart(0, "input", 12);
510
- ɵɵlistener("ngModelChange", function SchemaArrayComponent_div_1_ng_template_2_input_3_Template_input_ngModelChange_0_listener($event) { ɵɵrestoreView(_r30); const item_r24 = ɵɵnextContext().$implicit; return item_r24.items[item_r24.index].mappingAttributes = $event; })("dndDrop", function SchemaArrayComponent_div_1_ng_template_2_input_3_Template_input_dndDrop_0_listener($event) { ɵɵrestoreView(_r30); const item_r24 = ɵɵnextContext().$implicit; const ctx_r31 = ɵɵnextContext(2); return item_r24.items[item_r24.index].mappingAttributes = ctx_r31.onDrop($event, item_r24.items[item_r24.index].mappingAttributes); });
511
- ɵɵelementEnd();
512
- } if (rf & 2) {
513
- const item_r24 = ɵɵnextContext().$implicit;
514
- const ctx_r25 = ɵɵnextContext(2);
515
- ɵɵproperty("ngModel", item_r24.items[item_r24.index].mappingAttributes)("ngModelOptions", ɵɵpureFunction0(3, _c0$2))("id", ctx_r25.getId(ctx_r25.index) + "-" + item_r24.index);
516
- } }
517
- function SchemaArrayComponent_div_1_ng_template_2_ng_template_4_Template(rf, ctx) { if (rf & 1) {
518
- const _r36 = ɵɵgetCurrentView();
519
- ɵɵelementStart(0, "input", 12);
520
- ɵɵlistener("ngModelChange", function SchemaArrayComponent_div_1_ng_template_2_ng_template_4_Template_input_ngModelChange_0_listener($event) { ɵɵrestoreView(_r36); const item_r24 = ɵɵnextContext().$implicit; return (item_r24.items[item_r24.index] = $event); })("dndDrop", function SchemaArrayComponent_div_1_ng_template_2_ng_template_4_Template_input_dndDrop_0_listener($event) { ɵɵrestoreView(_r36); const item_r24 = ɵɵnextContext().$implicit; const ctx_r37 = ɵɵnextContext(2); return (item_r24.items[item_r24.index] = ctx_r37.onDrop($event, item_r24.items[item_r24.index])); });
521
- ɵɵelementEnd();
522
- } if (rf & 2) {
523
- const item_r24 = ɵɵnextContext().$implicit;
524
- const ctx_r27 = ɵɵnextContext(2);
525
- ɵɵproperty("ngModel", item_r24.items[item_r24.index])("ngModelOptions", ɵɵpureFunction0(3, _c0$2))("id", ctx_r27.getId(ctx_r27.index) + "-" + item_r24.index);
526
- } }
527
- function SchemaArrayComponent_div_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
528
- ɵɵelementStart(0, "label", 9);
529
- ɵɵtext(1);
530
- ɵɵpipe(2, "translate");
531
- ɵɵelementEnd();
532
- ɵɵtemplate(3, SchemaArrayComponent_div_1_ng_template_2_input_3_Template, 1, 4, "input", 10);
533
- ɵɵtemplate(4, SchemaArrayComponent_div_1_ng_template_2_ng_template_4_Template, 1, 4, "ng-template", null, 11, ɵɵtemplateRefExtractor);
534
- } if (rf & 2) {
535
- const item_r24 = ctx.$implicit;
536
- const _r26 = ɵɵreference(5);
537
- const ctx_r23 = ɵɵnextContext(2);
538
- ɵɵproperty("htmlFor", ctx_r23.getId(ctx_r23.index) + "-" + item_r24.index);
539
- ɵɵadvance(1);
540
- ɵɵtextInterpolate(ɵɵpipeBind1(2, 4, ctx_r23.schema.title));
541
- ɵɵadvance(2);
542
- ɵɵproperty("ngIf", item_r24.items[item_r24.index].mappingAttributes || item_r24.items[item_r24.index].mappingAttributes === "")("ngIfElse", _r26);
543
- } }
544
- function SchemaArrayComponent_div_1_Template(rf, ctx) { if (rf & 1) {
545
- const _r41 = ɵɵgetCurrentView();
546
- ɵɵelementStart(0, "div");
547
- ɵɵelementStart(1, "array-session", 1);
548
- ɵɵlistener("modelChange", function SchemaArrayComponent_div_1_Template_array_session_modelChange_1_listener($event) { ɵɵrestoreView(_r41); const ctx_r40 = ɵɵnextContext(); return (ctx_r40.model[ctx_r40.schema.id] = $event); })("onAdd", function SchemaArrayComponent_div_1_Template_array_session_onAdd_1_listener() { ɵɵrestoreView(_r41); const ctx_r42 = ɵɵnextContext(); return ctx_r42.addArrayItem(ctx_r42.schema.id, ""); })("onAddLoop", function SchemaArrayComponent_div_1_Template_array_session_onAddLoop_1_listener() { ɵɵrestoreView(_r41); const ctx_r43 = ɵɵnextContext(); return ctx_r43.addArrayLoop(ctx_r43.schema.id, ""); });
549
- ɵɵtemplate(2, SchemaArrayComponent_div_1_ng_template_2_Template, 6, 6, "ng-template");
550
- ɵɵelementEnd();
551
- ɵɵelementEnd();
552
- } if (rf & 2) {
553
- const ctx_r1 = ɵɵnextContext();
554
- ɵɵadvance(1);
555
- ɵɵproperty("label", ctx_r1.schema.title)("removeLabel", ctx_r1.schema.title)("model", ctx_r1.model[ctx_r1.schema.id])("showAddLoop", ctx_r1.schema.withoutLoop !== true);
556
- } }
557
- class SchemaArrayComponent extends BaseSchemaComponent {
558
- constructor() {
559
- super(...arguments);
560
- this.editing = false;
561
- }
562
- ngAfterContentInit() {
563
- var _a;
564
- if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) === 'array' && this.model && !this.model[this.schema.id]) {
565
- this.model[this.schema.id] = [];
566
- }
567
- this.loaded = true;
568
- console.log('SchemaArrayComponent schema', this.schema);
569
- }
570
- onDrop($event, modelElement) {
571
- return onDropStruct($event, modelElement);
572
- }
573
- getId(index) {
574
- return `${this.idPrefix}-struct-${index}`;
575
- }
576
- addArrayItem(id, param) {
577
- this.model[id] = this.model[id] || [];
578
- if (this.schema.properties) {
579
- param = {};
580
- Object.keys(this.schema.properties).forEach(key => {
581
- const schemaProperty = this.schema.properties[key];
582
- if (schemaProperty.type === 'object') {
583
- param[schemaProperty.id] = {};
584
- }
585
- else if (schemaProperty.type === 'array') {
586
- param[schemaProperty.id] = [];
587
- }
588
- });
589
- }
590
- this.model[id].push(param);
591
- }
592
- addArrayLoop(id, mappingAttributes) {
593
- this.model[id] = this.model[id] || [];
594
- this.model[id].push({ loop: '', alias: '', mappingAttributes });
595
- }
596
- }
597
- SchemaArrayComponent.ɵfac = function SchemaArrayComponent_Factory(t) { return ɵSchemaArrayComponent_BaseFactory(t || SchemaArrayComponent); };
598
- SchemaArrayComponent.ɵcmp = ɵɵdefineComponent({ type: SchemaArrayComponent, selectors: [["schema-array"]], inputs: { idPrefix: "idPrefix", schema: "schema", editing: "editing", index: "index" }, features: [ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [[4, "ngIf"], [3, "label", "removeLabel", "model", "showAddLoop", "modelChange", "onAdd", "onAddLoop"], [3, "idPrefix", "model", "schemas", "editing", "modelChange", 4, "ngIf"], ["class", "row struct-custom-properties", 4, "ngIf"], [3, "idPrefix", "model", "schemas", "editing", "modelChange"], [1, "row", "struct-custom-properties"], [1, "col-md-12"], [1, "info-label", "bold"], [3, "model", "onDropFunction", "modelChange"], [1, "info-label", 3, "htmlFor"], ["class", "form-control", "type", "text", "dndDropzone", "", 3, "ngModel", "ngModelOptions", "id", "ngModelChange", "dndDrop", 4, "ngIf", "ngIfElse"], ["elseBlock", ""], ["type", "text", "dndDropzone", "", 1, "form-control", 3, "ngModel", "ngModelOptions", "id", "ngModelChange", "dndDrop"]], template: function SchemaArrayComponent_Template(rf, ctx) { if (rf & 1) {
599
- ɵɵtemplate(0, SchemaArrayComponent_div_0_Template, 3, 4, "div", 0);
600
- ɵɵtemplate(1, SchemaArrayComponent_div_1_Template, 3, 4, "div", 0);
601
- } if (rf & 2) {
602
- ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type === "array" && ctx.schema.properties);
603
- ɵɵadvance(1);
604
- ɵɵproperty("ngIf", ctx.schema && ctx.canRender(ctx.schema) && ctx.schema.type === "array" && !ctx.schema.properties);
605
- } }, directives: [NgIf, ArraySessionComponent, SchemaFormComponent, SchemaCustomAttributesComponent, DefaultValueAccessor, DndDropzoneDirective, NgControlStatus, NgModel], pipes: [TranslatePipe], styles: [""] });
606
- const ɵSchemaArrayComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaArrayComponent);
607
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaArrayComponent, [{
608
- type: Component,
609
- args: [{
610
- selector: 'schema-array',
611
- templateUrl: 'schema-array.html',
612
- styleUrls: ['./schema-array.scss']
613
- }]
614
- }], null, { idPrefix: [{
615
- type: Input
616
- }], schema: [{
617
- type: Input
618
- }], editing: [{
619
- type: Input
620
- }], index: [{
621
- type: Input
446
+ function SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template(rf, ctx) { if (rf & 1) {
447
+ const _r8 = ɵɵgetCurrentView();
448
+ ɵɵelementStart(0, "schema-form", 4);
449
+ ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template_schema_form_modelChange_0_listener($event) { ɵɵrestoreView(_r8); const item_r3 = ɵɵnextContext().$implicit; const ctx_r7 = ɵɵnextContext(2); return ctx_r7.model[ctx_r7.schema.id][item_r3.index].mappingAttributes = $event; });
450
+ ɵɵelementEnd();
451
+ } if (rf & 2) {
452
+ const item_r3 = ɵɵnextContext().$implicit;
453
+ const ctx_r4 = ɵɵnextContext(2);
454
+ ɵɵproperty("idPrefix", ctx_r4.idPrefix)("model", ctx_r4.model[ctx_r4.schema.id][item_r3.index].mappingAttributes)("schemas", ctx_r4.getSchemaProperties())("editing", ctx_r4.editing);
455
+ } }
456
+ function SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template(rf, ctx) { if (rf & 1) {
457
+ const _r12 = ɵɵgetCurrentView();
458
+ ɵɵelementStart(0, "schema-form", 4);
459
+ ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template_schema_form_modelChange_0_listener($event) { ɵɵrestoreView(_r12); const item_r3 = ɵɵnextContext().$implicit; const ctx_r11 = ɵɵnextContext(2); return (ctx_r11.model[ctx_r11.schema.id][item_r3.index] = $event); });
460
+ ɵɵelementEnd();
461
+ } if (rf & 2) {
462
+ const item_r3 = ɵɵnextContext().$implicit;
463
+ const ctx_r5 = ɵɵnextContext(2);
464
+ ɵɵproperty("idPrefix", ctx_r5.idPrefix)("model", ctx_r5.model[ctx_r5.schema.id][item_r3.index])("schemas", ctx_r5.getSchemaProperties())("editing", ctx_r5.editing);
465
+ } }
466
+ function SchemaArrayComponent_div_0_ng_template_2_div_2_Template(rf, ctx) { if (rf & 1) {
467
+ const _r16 = ɵɵgetCurrentView();
468
+ ɵɵelementStart(0, "div", 5);
469
+ ɵɵelementStart(1, "div", 6);
470
+ ɵɵelementStart(2, "label", 7);
471
+ ɵɵtext(3);
472
+ ɵɵpipe(4, "translate");
473
+ ɵɵelementEnd();
474
+ ɵɵelementStart(5, "schema-custom-attributes", 8);
475
+ ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_div_2_Template_schema_custom_attributes_modelChange_5_listener($event) { ɵɵrestoreView(_r16); const item_r3 = ɵɵnextContext().$implicit; const ctx_r15 = ɵɵnextContext(2); return ctx_r15.model[ctx_r15.schema.id][item_r3.index].customAttributes = $event; });
476
+ ɵɵelementEnd();
477
+ ɵɵelementEnd();
478
+ ɵɵelementEnd();
479
+ } if (rf & 2) {
480
+ const item_r3 = ɵɵnextContext().$implicit;
481
+ const ctx_r6 = ɵɵnextContext(2);
482
+ ɵɵadvance(3);
483
+ ɵɵtextInterpolate(ɵɵpipeBind1(4, 3, "STEP.ADDITIONAL_ATTRIBUTES"));
484
+ ɵɵadvance(2);
485
+ ɵɵproperty("model", ctx_r6.model[ctx_r6.schema.id][item_r3.index].customAttributes)("onDropFunction", ctx_r6.onDrop);
486
+ } }
487
+ function SchemaArrayComponent_div_0_ng_template_2_Template(rf, ctx) { if (rf & 1) {
488
+ ɵɵtemplate(0, SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template, 1, 4, "schema-form", 2);
489
+ ɵɵtemplate(1, SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template, 1, 4, "schema-form", 2);
490
+ ɵɵtemplate(2, SchemaArrayComponent_div_0_ng_template_2_div_2_Template, 6, 5, "div", 3);
491
+ } if (rf & 2) {
492
+ const item_r3 = ctx.$implicit;
493
+ const ctx_r2 = ɵɵnextContext(2);
494
+ ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index].loop !== undefined);
495
+ ɵɵadvance(1);
496
+ ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index].loop == undefined);
497
+ ɵɵadvance(1);
498
+ ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index] && ctx_r2.schema.customProperties);
499
+ } }
500
+ function SchemaArrayComponent_div_0_Template(rf, ctx) { if (rf & 1) {
501
+ const _r20 = ɵɵgetCurrentView();
502
+ ɵɵelementStart(0, "div");
503
+ ɵɵelementStart(1, "array-session", 1);
504
+ ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_Template_array_session_modelChange_1_listener($event) { ɵɵrestoreView(_r20); const ctx_r19 = ɵɵnextContext(); return (ctx_r19.model[ctx_r19.schema.id] = $event); })("onAdd", function SchemaArrayComponent_div_0_Template_array_session_onAdd_1_listener() { ɵɵrestoreView(_r20); const ctx_r21 = ɵɵnextContext(); return ctx_r21.addArrayItem(ctx_r21.schema.id, {}); })("onAddLoop", function SchemaArrayComponent_div_0_Template_array_session_onAddLoop_1_listener() { ɵɵrestoreView(_r20); const ctx_r22 = ɵɵnextContext(); return ctx_r22.addArrayLoop(ctx_r22.schema.id, {}); });
505
+ ɵɵtemplate(2, SchemaArrayComponent_div_0_ng_template_2_Template, 3, 3, "ng-template");
506
+ ɵɵelementEnd();
507
+ ɵɵelementEnd();
508
+ } if (rf & 2) {
509
+ const ctx_r0 = ɵɵnextContext();
510
+ ɵɵadvance(1);
511
+ ɵɵproperty("label", ctx_r0.schema.title)("removeLabel", ctx_r0.schema.title)("model", ctx_r0.model[ctx_r0.schema.id])("showAddLoop", ctx_r0.schema.withoutLoop !== true);
512
+ } }
513
+ const _c0$2 = function () { return { standalone: true }; };
514
+ function SchemaArrayComponent_div_1_ng_template_2_input_3_Template(rf, ctx) { if (rf & 1) {
515
+ const _r30 = ɵɵgetCurrentView();
516
+ ɵɵelementStart(0, "input", 12);
517
+ ɵɵlistener("ngModelChange", function SchemaArrayComponent_div_1_ng_template_2_input_3_Template_input_ngModelChange_0_listener($event) { ɵɵrestoreView(_r30); const item_r24 = ɵɵnextContext().$implicit; return item_r24.items[item_r24.index].mappingAttributes = $event; })("dndDrop", function SchemaArrayComponent_div_1_ng_template_2_input_3_Template_input_dndDrop_0_listener($event) { ɵɵrestoreView(_r30); const item_r24 = ɵɵnextContext().$implicit; const ctx_r31 = ɵɵnextContext(2); return item_r24.items[item_r24.index].mappingAttributes = ctx_r31.onDrop($event, item_r24.items[item_r24.index].mappingAttributes); });
518
+ ɵɵelementEnd();
519
+ } if (rf & 2) {
520
+ const item_r24 = ɵɵnextContext().$implicit;
521
+ const ctx_r25 = ɵɵnextContext(2);
522
+ ɵɵproperty("ngModel", item_r24.items[item_r24.index].mappingAttributes)("ngModelOptions", ɵɵpureFunction0(3, _c0$2))("id", ctx_r25.getId(ctx_r25.index) + "-" + item_r24.index);
523
+ } }
524
+ function SchemaArrayComponent_div_1_ng_template_2_ng_template_4_Template(rf, ctx) { if (rf & 1) {
525
+ const _r36 = ɵɵgetCurrentView();
526
+ ɵɵelementStart(0, "input", 12);
527
+ ɵɵlistener("ngModelChange", function SchemaArrayComponent_div_1_ng_template_2_ng_template_4_Template_input_ngModelChange_0_listener($event) { ɵɵrestoreView(_r36); const item_r24 = ɵɵnextContext().$implicit; return (item_r24.items[item_r24.index] = $event); })("dndDrop", function SchemaArrayComponent_div_1_ng_template_2_ng_template_4_Template_input_dndDrop_0_listener($event) { ɵɵrestoreView(_r36); const item_r24 = ɵɵnextContext().$implicit; const ctx_r37 = ɵɵnextContext(2); return (item_r24.items[item_r24.index] = ctx_r37.onDrop($event, item_r24.items[item_r24.index])); });
528
+ ɵɵelementEnd();
529
+ } if (rf & 2) {
530
+ const item_r24 = ɵɵnextContext().$implicit;
531
+ const ctx_r27 = ɵɵnextContext(2);
532
+ ɵɵproperty("ngModel", item_r24.items[item_r24.index])("ngModelOptions", ɵɵpureFunction0(3, _c0$2))("id", ctx_r27.getId(ctx_r27.index) + "-" + item_r24.index);
533
+ } }
534
+ function SchemaArrayComponent_div_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
535
+ ɵɵelementStart(0, "label", 9);
536
+ ɵɵtext(1);
537
+ ɵɵpipe(2, "translate");
538
+ ɵɵelementEnd();
539
+ ɵɵtemplate(3, SchemaArrayComponent_div_1_ng_template_2_input_3_Template, 1, 4, "input", 10);
540
+ ɵɵtemplate(4, SchemaArrayComponent_div_1_ng_template_2_ng_template_4_Template, 1, 4, "ng-template", null, 11, ɵɵtemplateRefExtractor);
541
+ } if (rf & 2) {
542
+ const item_r24 = ctx.$implicit;
543
+ const _r26 = ɵɵreference(5);
544
+ const ctx_r23 = ɵɵnextContext(2);
545
+ ɵɵproperty("htmlFor", ctx_r23.getId(ctx_r23.index) + "-" + item_r24.index);
546
+ ɵɵadvance(1);
547
+ ɵɵtextInterpolate(ɵɵpipeBind1(2, 4, ctx_r23.schema.title));
548
+ ɵɵadvance(2);
549
+ ɵɵproperty("ngIf", item_r24.items[item_r24.index].mappingAttributes || item_r24.items[item_r24.index].mappingAttributes === "")("ngIfElse", _r26);
550
+ } }
551
+ function SchemaArrayComponent_div_1_Template(rf, ctx) { if (rf & 1) {
552
+ const _r41 = ɵɵgetCurrentView();
553
+ ɵɵelementStart(0, "div");
554
+ ɵɵelementStart(1, "array-session", 1);
555
+ ɵɵlistener("modelChange", function SchemaArrayComponent_div_1_Template_array_session_modelChange_1_listener($event) { ɵɵrestoreView(_r41); const ctx_r40 = ɵɵnextContext(); return (ctx_r40.model[ctx_r40.schema.id] = $event); })("onAdd", function SchemaArrayComponent_div_1_Template_array_session_onAdd_1_listener() { ɵɵrestoreView(_r41); const ctx_r42 = ɵɵnextContext(); return ctx_r42.addArrayItem(ctx_r42.schema.id, ""); })("onAddLoop", function SchemaArrayComponent_div_1_Template_array_session_onAddLoop_1_listener() { ɵɵrestoreView(_r41); const ctx_r43 = ɵɵnextContext(); return ctx_r43.addArrayLoop(ctx_r43.schema.id, ""); });
556
+ ɵɵtemplate(2, SchemaArrayComponent_div_1_ng_template_2_Template, 6, 6, "ng-template");
557
+ ɵɵelementEnd();
558
+ ɵɵelementEnd();
559
+ } if (rf & 2) {
560
+ const ctx_r1 = ɵɵnextContext();
561
+ ɵɵadvance(1);
562
+ ɵɵproperty("label", ctx_r1.schema.title)("removeLabel", ctx_r1.schema.title)("model", ctx_r1.model[ctx_r1.schema.id])("showAddLoop", ctx_r1.schema.withoutLoop !== true);
563
+ } }
564
+ class SchemaArrayComponent extends BaseSchemaComponent {
565
+ constructor() {
566
+ super(...arguments);
567
+ this.editing = false;
568
+ }
569
+ ngAfterContentInit() {
570
+ var _a;
571
+ if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) === 'array' && this.model && !this.model[this.schema.id]) {
572
+ this.model[this.schema.id] = [];
573
+ }
574
+ this.loaded = true;
575
+ }
576
+ onDrop($event, modelElement) {
577
+ return onDropStruct($event, modelElement);
578
+ }
579
+ getId(index) {
580
+ return `${this.idPrefix}-struct-${index}`;
581
+ }
582
+ addArrayItem(id, param) {
583
+ this.model[id] = this.model[id] || [];
584
+ if (this.schema.properties) {
585
+ param = {};
586
+ Object.keys(this.schema.properties).forEach(key => {
587
+ const schemaProperty = this.schema.properties[key];
588
+ if (schemaProperty.type === 'object') {
589
+ param[schemaProperty.id] = {};
590
+ }
591
+ else if (schemaProperty.type === 'array') {
592
+ param[schemaProperty.id] = [];
593
+ }
594
+ });
595
+ }
596
+ this.model[id].push(param);
597
+ }
598
+ addArrayLoop(id, mappingAttributes) {
599
+ this.model[id] = this.model[id] || [];
600
+ this.model[id].push({ loop: '', alias: '', mappingAttributes });
601
+ }
602
+ }
603
+ SchemaArrayComponent.ɵfac = function SchemaArrayComponent_Factory(t) { return ɵSchemaArrayComponent_BaseFactory(t || SchemaArrayComponent); };
604
+ SchemaArrayComponent.ɵcmp = ɵɵdefineComponent({ type: SchemaArrayComponent, selectors: [["schema-array"]], inputs: { idPrefix: "idPrefix", schema: "schema", editing: "editing", index: "index" }, features: [ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [[4, "ngIf"], [3, "label", "removeLabel", "model", "showAddLoop", "modelChange", "onAdd", "onAddLoop"], [3, "idPrefix", "model", "schemas", "editing", "modelChange", 4, "ngIf"], ["class", "row struct-custom-properties", 4, "ngIf"], [3, "idPrefix", "model", "schemas", "editing", "modelChange"], [1, "row", "struct-custom-properties"], [1, "col-md-12"], [1, "info-label", "bold"], [3, "model", "onDropFunction", "modelChange"], [1, "info-label", 3, "htmlFor"], ["class", "form-control", "type", "text", "dndDropzone", "", 3, "ngModel", "ngModelOptions", "id", "ngModelChange", "dndDrop", 4, "ngIf", "ngIfElse"], ["elseBlock", ""], ["type", "text", "dndDropzone", "", 1, "form-control", 3, "ngModel", "ngModelOptions", "id", "ngModelChange", "dndDrop"]], template: function SchemaArrayComponent_Template(rf, ctx) { if (rf & 1) {
605
+ ɵɵtemplate(0, SchemaArrayComponent_div_0_Template, 3, 4, "div", 0);
606
+ ɵɵtemplate(1, SchemaArrayComponent_div_1_Template, 3, 4, "div", 0);
607
+ } if (rf & 2) {
608
+ ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type === "array" && ctx.schema.properties);
609
+ ɵɵadvance(1);
610
+ ɵɵproperty("ngIf", ctx.schema && ctx.canRender(ctx.schema) && ctx.schema.type === "array" && !ctx.schema.properties);
611
+ } }, directives: [NgIf, ArraySessionComponent, SchemaFormComponent, SchemaCustomAttributesComponent, DefaultValueAccessor, DndDropzoneDirective, NgControlStatus, NgModel], pipes: [TranslatePipe], styles: [""] });
612
+ const ɵSchemaArrayComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaArrayComponent);
613
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaArrayComponent, [{
614
+ type: Component,
615
+ args: [{
616
+ selector: 'schema-array',
617
+ templateUrl: 'schema-array.html',
618
+ styleUrls: ['./schema-array.scss']
619
+ }]
620
+ }], null, { idPrefix: [{
621
+ type: Input
622
+ }], schema: [{
623
+ type: Input
624
+ }], editing: [{
625
+ type: Input
626
+ }], index: [{
627
+ type: Input
622
628
  }] }); })();
623
629
 
624
- const _c0$3 = function (a0) { return { "has-error": a0 }; };
625
- function FieldRenderComponent_small_4_Template(rf, ctx) { if (rf & 1) {
626
- ɵɵelementStart(0, "small", 0);
627
- ɵɵtext(1, "(obrigat\u00F3rio)");
628
- ɵɵelementEnd();
629
- } if (rf & 2) {
630
- const ctx_r0 = ɵɵnextContext();
631
- ɵɵproperty("ngClass", ɵɵpureFunction1(1, _c0$3, ctx_r0.state && !ctx_r0.state.valid && ctx_r0.state.errors));
632
- } }
633
- function FieldRenderComponent_span_5_Template(rf, ctx) { if (rf & 1) {
634
- ɵɵelementStart(0, "span", 4);
635
- ɵɵpipe(1, "translate");
636
- ɵɵelement(2, "i", 5);
637
- ɵɵelementEnd();
638
- } if (rf & 2) {
639
- const ctx_r1 = ɵɵnextContext();
640
- ɵɵpropertyInterpolate("matTooltip", ɵɵpipeBind1(1, 1, ctx_r1.tooltip));
641
- } }
642
- const _c1$1 = ["*"];
643
- class FieldRenderComponent {
644
- constructor() {
645
- this.label = '';
646
- this.required = true;
647
- }
648
- }
649
- FieldRenderComponent.ɵfac = function FieldRenderComponent_Factory(t) { return new (t || FieldRenderComponent)(); };
650
- FieldRenderComponent.ɵcmp = ɵɵdefineComponent({ type: FieldRenderComponent, selectors: [["field-render"]], inputs: { label: "label", inputId: "inputId", tooltip: "tooltip", required: "required", state: "state" }, ngContentSelectors: _c1$1, decls: 7, vars: 9, consts: [[3, "ngClass"], [1, "info-label", "bold", 3, "htmlFor"], [3, "ngClass", 4, "ngIf"], ["class", "info-icon", 3, "matTooltip", 4, "ngIf"], [1, "info-icon", 3, "matTooltip"], [1, "far", "fa-question-circle"]], template: function FieldRenderComponent_Template(rf, ctx) { if (rf & 1) {
651
- ɵɵprojectionDef();
652
- ɵɵelementStart(0, "div", 0);
653
- ɵɵelementStart(1, "label", 1);
654
- ɵɵtext(2);
655
- ɵɵpipe(3, "translate");
656
- ɵɵtemplate(4, FieldRenderComponent_small_4_Template, 2, 3, "small", 2);
657
- ɵɵtemplate(5, FieldRenderComponent_span_5_Template, 3, 3, "span", 3);
658
- ɵɵelementEnd();
659
- ɵɵprojection(6);
660
- ɵɵelementEnd();
661
- } if (rf & 2) {
662
- ɵɵproperty("ngClass", ɵɵpureFunction1(7, _c0$3, ctx.state && !ctx.state.valid && (!ctx.state.pristine || ctx.state.touched) && ctx.state.errors));
663
- ɵɵadvance(1);
664
- ɵɵproperty("htmlFor", ctx.inputId);
665
- ɵɵadvance(1);
666
- ɵɵtextInterpolate1(" ", ɵɵpipeBind1(3, 5, ctx.label), " ");
667
- ɵɵadvance(2);
668
- ɵɵproperty("ngIf", ctx.required);
669
- ɵɵadvance(1);
670
- ɵɵproperty("ngIf", ctx.tooltip);
671
- } }, directives: [NgClass, NgIf, MatTooltip], pipes: [TranslatePipe], styles: [".info-icon[_ngcontent-%COMP%]{color:#222d57;float:right;font-size:13px;margin-left:4px}"] });
672
- /*@__PURE__*/ (function () { ɵsetClassMetadata(FieldRenderComponent, [{
673
- type: Component,
674
- args: [{
675
- selector: 'field-render',
676
- templateUrl: 'field-render.html',
677
- styleUrls: ['field-render.scss']
678
- }]
679
- }], null, { label: [{
680
- type: Input
681
- }], inputId: [{
682
- type: Input
683
- }], tooltip: [{
684
- type: Input
685
- }], required: [{
686
- type: Input
687
- }], state: [{
688
- type: Input
630
+ const _c0$3 = function (a0) { return { "has-error": a0 }; };
631
+ function FieldRenderComponent_small_4_Template(rf, ctx) { if (rf & 1) {
632
+ ɵɵelementStart(0, "small", 0);
633
+ ɵɵtext(1, "(obrigat\u00F3rio)");
634
+ ɵɵelementEnd();
635
+ } if (rf & 2) {
636
+ const ctx_r0 = ɵɵnextContext();
637
+ ɵɵproperty("ngClass", ɵɵpureFunction1(1, _c0$3, ctx_r0.state && !ctx_r0.state.valid && ctx_r0.state.errors));
638
+ } }
639
+ function FieldRenderComponent_span_5_Template(rf, ctx) { if (rf & 1) {
640
+ ɵɵelementStart(0, "span", 4);
641
+ ɵɵpipe(1, "translate");
642
+ ɵɵelement(2, "i", 5);
643
+ ɵɵelementEnd();
644
+ } if (rf & 2) {
645
+ const ctx_r1 = ɵɵnextContext();
646
+ ɵɵpropertyInterpolate("matTooltip", ɵɵpipeBind1(1, 1, ctx_r1.tooltip));
647
+ } }
648
+ const _c1$1 = ["*"];
649
+ class FieldRenderComponent {
650
+ constructor() {
651
+ this.label = '';
652
+ this.required = true;
653
+ }
654
+ }
655
+ FieldRenderComponent.ɵfac = function FieldRenderComponent_Factory(t) { return new (t || FieldRenderComponent)(); };
656
+ FieldRenderComponent.ɵcmp = ɵɵdefineComponent({ type: FieldRenderComponent, selectors: [["field-render"]], inputs: { label: "label", inputId: "inputId", tooltip: "tooltip", required: "required", state: "state" }, ngContentSelectors: _c1$1, decls: 7, vars: 9, consts: [[3, "ngClass"], [1, "info-label", "bold", 3, "htmlFor"], [3, "ngClass", 4, "ngIf"], ["class", "info-icon", 3, "matTooltip", 4, "ngIf"], [1, "info-icon", 3, "matTooltip"], [1, "far", "fa-question-circle"]], template: function FieldRenderComponent_Template(rf, ctx) { if (rf & 1) {
657
+ ɵɵprojectionDef();
658
+ ɵɵelementStart(0, "div", 0);
659
+ ɵɵelementStart(1, "label", 1);
660
+ ɵɵtext(2);
661
+ ɵɵpipe(3, "translate");
662
+ ɵɵtemplate(4, FieldRenderComponent_small_4_Template, 2, 3, "small", 2);
663
+ ɵɵtemplate(5, FieldRenderComponent_span_5_Template, 3, 3, "span", 3);
664
+ ɵɵelementEnd();
665
+ ɵɵprojection(6);
666
+ ɵɵelementEnd();
667
+ } if (rf & 2) {
668
+ ɵɵproperty("ngClass", ɵɵpureFunction1(7, _c0$3, ctx.state && !ctx.state.valid && (!ctx.state.pristine || ctx.state.touched) && ctx.state.errors));
669
+ ɵɵadvance(1);
670
+ ɵɵproperty("htmlFor", ctx.inputId);
671
+ ɵɵadvance(1);
672
+ ɵɵtextInterpolate1(" ", ɵɵpipeBind1(3, 5, ctx.label), " ");
673
+ ɵɵadvance(2);
674
+ ɵɵproperty("ngIf", ctx.required);
675
+ ɵɵadvance(1);
676
+ ɵɵproperty("ngIf", ctx.tooltip);
677
+ } }, directives: [NgClass, NgIf, MatTooltip], pipes: [TranslatePipe], styles: [".info-icon[_ngcontent-%COMP%]{color:#222d57;float:right;font-size:13px;margin-left:4px}"] });
678
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(FieldRenderComponent, [{
679
+ type: Component,
680
+ args: [{
681
+ selector: 'field-render',
682
+ templateUrl: 'field-render.html',
683
+ styleUrls: ['field-render.scss']
684
+ }]
685
+ }], null, { label: [{
686
+ type: Input
687
+ }], inputId: [{
688
+ type: Input
689
+ }], tooltip: [{
690
+ type: Input
691
+ }], required: [{
692
+ type: Input
693
+ }], state: [{
694
+ type: Input
689
695
  }] }); })();
690
696
 
691
- const _c0$4 = function () { return { standalone: true }; };
692
- class NumberInputComponent extends BaseSchemaComponent {
693
- ngAfterContentInit() {
694
- this.value = this.model;
695
- }
696
- changeValue($event) {
697
- if ($event && !isNaN($event)) {
698
- this.model = Number($event);
699
- this.modelChange.emit(this.model);
700
- }
701
- else {
702
- this.model = $event;
703
- this.modelChange.emit(this.model);
704
- }
705
- }
706
- }
707
- NumberInputComponent.ɵfac = function NumberInputComponent_Factory(t) { return ɵNumberInputComponent_BaseFactory(t || NumberInputComponent); };
708
- NumberInputComponent.ɵcmp = ɵɵdefineComponent({ type: NumberInputComponent, selectors: [["number-input"]], inputs: { placeholder: "placeholder", inputId: "inputId", maxLength: "maxLength" }, features: [ɵɵInheritDefinitionFeature], decls: 1, vars: 6, consts: [[1, "form-control", "number-input", 3, "id", "placeholder", "ngModel", "ngModelOptions", "maxlength", "ngModelChange"]], template: function NumberInputComponent_Template(rf, ctx) { if (rf & 1) {
709
- ɵɵelementStart(0, "input", 0);
710
- ɵɵlistener("ngModelChange", function NumberInputComponent_Template_input_ngModelChange_0_listener($event) { return ctx.value = $event; })("ngModelChange", function NumberInputComponent_Template_input_ngModelChange_0_listener($event) { return ctx.changeValue($event); });
711
- ɵɵelementEnd();
712
- } if (rf & 2) {
713
- ɵɵproperty("id", ctx.inputId)("placeholder", ctx.placeholder)("ngModel", ctx.value)("ngModelOptions", ɵɵpureFunction0(5, _c0$4))("maxlength", ctx.maxLength);
714
- } }, directives: [DefaultValueAccessor, NgControlStatus, NgModel, MaxLengthValidator], encapsulation: 2 });
715
- const ɵNumberInputComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(NumberInputComponent);
716
- /*@__PURE__*/ (function () { ɵsetClassMetadata(NumberInputComponent, [{
717
- type: Component,
718
- args: [{
719
- selector: 'number-input',
720
- templateUrl: 'number-input.component.html'
721
- }]
722
- }], null, { placeholder: [{
723
- type: Input
724
- }], inputId: [{
725
- type: Input
726
- }], maxLength: [{
727
- type: Input
697
+ const _c0$4 = function () { return { standalone: true }; };
698
+ class NumberInputComponent extends BaseSchemaComponent {
699
+ ngAfterContentInit() {
700
+ this.value = this.model;
701
+ }
702
+ onDropCallBack($event, value) {
703
+ this.value = value = super.onDrop($event, value);
704
+ this.changeValue(value);
705
+ }
706
+ changeValue($event) {
707
+ if ($event && !isNaN($event)) {
708
+ this.model = Number($event);
709
+ this.modelChange.emit(this.model);
710
+ }
711
+ else {
712
+ this.model = $event;
713
+ this.modelChange.emit(this.model);
714
+ }
715
+ }
716
+ }
717
+ NumberInputComponent.ɵfac = function NumberInputComponent_Factory(t) { return ɵNumberInputComponent_BaseFactory(t || NumberInputComponent); };
718
+ NumberInputComponent.ɵcmp = ɵɵdefineComponent({ type: NumberInputComponent, selectors: [["number-input"]], inputs: { placeholder: "placeholder", inputId: "inputId", maxLength: "maxLength" }, features: [ɵɵInheritDefinitionFeature], decls: 1, vars: 6, consts: [["dndDropzone", "", 1, "form-control", "number-input", 3, "id", "placeholder", "ngModel", "ngModelOptions", "maxlength", "ngModelChange", "dndDrop"]], template: function NumberInputComponent_Template(rf, ctx) { if (rf & 1) {
719
+ ɵɵelementStart(0, "input", 0);
720
+ ɵɵlistener("ngModelChange", function NumberInputComponent_Template_input_ngModelChange_0_listener($event) { return ctx.value = $event; })("ngModelChange", function NumberInputComponent_Template_input_ngModelChange_0_listener($event) { return ctx.changeValue($event); })("dndDrop", function NumberInputComponent_Template_input_dndDrop_0_listener($event) { return ctx.onDropCallBack($event, ctx.value); });
721
+ ɵɵelementEnd();
722
+ } if (rf & 2) {
723
+ ɵɵproperty("id", ctx.inputId)("placeholder", ctx.placeholder)("ngModel", ctx.value)("ngModelOptions", ɵɵpureFunction0(5, _c0$4))("maxlength", ctx.maxLength);
724
+ } }, directives: [DefaultValueAccessor, DndDropzoneDirective, NgControlStatus, NgModel, MaxLengthValidator], encapsulation: 2 });
725
+ const ɵNumberInputComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(NumberInputComponent);
726
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(NumberInputComponent, [{
727
+ type: Component,
728
+ args: [{
729
+ selector: 'number-input',
730
+ templateUrl: 'number-input.component.html'
731
+ }]
732
+ }], null, { placeholder: [{
733
+ type: Input
734
+ }], inputId: [{
735
+ type: Input
736
+ }], maxLength: [{
737
+ type: Input
728
738
  }] }); })();
729
739
 
730
- const _c0$5 = function () { return { standalone: true }; };
731
- class BooleanInputComponent extends BaseSchemaComponent {
732
- ngAfterContentInit() {
733
- this.value = this.model;
734
- }
735
- changeValue($event) {
736
- if ($event && ($event === 'true' || $event === 'false')) {
737
- this.model = $event === 'true';
738
- this.value = this.model;
739
- this.modelChange.emit(this.model);
740
- }
741
- else {
742
- this.model = $event;
743
- this.value = this.model;
744
- this.modelChange.emit(this.model);
745
- }
746
- }
747
- }
748
- BooleanInputComponent.ɵfac = function BooleanInputComponent_Factory(t) { return ɵBooleanInputComponent_BaseFactory(t || BooleanInputComponent); };
749
- BooleanInputComponent.ɵcmp = ɵɵdefineComponent({ type: BooleanInputComponent, selectors: [["boolean-input"]], inputs: { placeholder: "placeholder", inputId: "inputId", maxLength: "maxLength" }, features: [ɵɵInheritDefinitionFeature], decls: 1, vars: 6, consts: [[1, "form-control", 3, "id", "placeholder", "ngModel", "ngModelOptions", "maxlength", "ngModelChange"]], template: function BooleanInputComponent_Template(rf, ctx) { if (rf & 1) {
750
- ɵɵelementStart(0, "input", 0);
751
- ɵɵlistener("ngModelChange", function BooleanInputComponent_Template_input_ngModelChange_0_listener($event) { return ctx.value = $event; })("ngModelChange", function BooleanInputComponent_Template_input_ngModelChange_0_listener($event) { return ctx.changeValue($event); });
752
- ɵɵelementEnd();
753
- } if (rf & 2) {
754
- ɵɵproperty("id", ctx.inputId)("placeholder", ctx.placeholder)("ngModel", ctx.value)("ngModelOptions", ɵɵpureFunction0(5, _c0$5))("maxlength", ctx.maxLength);
755
- } }, directives: [DefaultValueAccessor, NgControlStatus, NgModel, MaxLengthValidator], encapsulation: 2 });
756
- const ɵBooleanInputComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(BooleanInputComponent);
757
- /*@__PURE__*/ (function () { ɵsetClassMetadata(BooleanInputComponent, [{
758
- type: Component,
759
- args: [{
760
- selector: 'boolean-input',
761
- templateUrl: 'boolean-input.component.html',
762
- }]
763
- }], null, { placeholder: [{
764
- type: Input
765
- }], inputId: [{
766
- type: Input
767
- }], maxLength: [{
768
- type: Input
740
+ const _c0$5 = function () { return { standalone: true }; };
741
+ class BooleanInputComponent extends BaseSchemaComponent {
742
+ ngAfterContentInit() {
743
+ this.value = this.model;
744
+ }
745
+ onDropCallBack($event, value) {
746
+ this.value = value = super.onDrop($event, value);
747
+ this.changeValue(value);
748
+ }
749
+ changeValue($event) {
750
+ if ($event && ($event === 'true' || $event === 'false')) {
751
+ this.model = $event === 'true';
752
+ this.value = this.model;
753
+ this.modelChange.emit(this.model);
754
+ }
755
+ else {
756
+ this.model = $event;
757
+ this.value = this.model;
758
+ this.modelChange.emit(this.model);
759
+ }
760
+ }
761
+ }
762
+ BooleanInputComponent.ɵfac = function BooleanInputComponent_Factory(t) { return ɵBooleanInputComponent_BaseFactory(t || BooleanInputComponent); };
763
+ BooleanInputComponent.ɵcmp = ɵɵdefineComponent({ type: BooleanInputComponent, selectors: [["boolean-input"]], inputs: { placeholder: "placeholder", inputId: "inputId", maxLength: "maxLength" }, features: [ɵɵInheritDefinitionFeature], decls: 1, vars: 6, consts: [["dndDropzone", "", 1, "form-control", 3, "id", "placeholder", "ngModel", "ngModelOptions", "maxlength", "ngModelChange", "dndDrop"]], template: function BooleanInputComponent_Template(rf, ctx) { if (rf & 1) {
764
+ ɵɵelementStart(0, "input", 0);
765
+ ɵɵlistener("ngModelChange", function BooleanInputComponent_Template_input_ngModelChange_0_listener($event) { return ctx.value = $event; })("ngModelChange", function BooleanInputComponent_Template_input_ngModelChange_0_listener($event) { return ctx.changeValue($event); })("dndDrop", function BooleanInputComponent_Template_input_dndDrop_0_listener($event) { return ctx.onDropCallBack($event, ctx.value); });
766
+ ɵɵelementEnd();
767
+ } if (rf & 2) {
768
+ ɵɵproperty("id", ctx.inputId)("placeholder", ctx.placeholder)("ngModel", ctx.value)("ngModelOptions", ɵɵpureFunction0(5, _c0$5))("maxlength", ctx.maxLength);
769
+ } }, directives: [DefaultValueAccessor, DndDropzoneDirective, NgControlStatus, NgModel, MaxLengthValidator], encapsulation: 2 });
770
+ const ɵBooleanInputComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(BooleanInputComponent);
771
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(BooleanInputComponent, [{
772
+ type: Component,
773
+ args: [{
774
+ selector: 'boolean-input',
775
+ templateUrl: 'boolean-input.component.html',
776
+ }]
777
+ }], null, { placeholder: [{
778
+ type: Input
779
+ }], inputId: [{
780
+ type: Input
781
+ }], maxLength: [{
782
+ type: Input
769
783
  }] }); })();
770
784
 
771
- const _c0$6 = function () { return { standalone: true }; };
772
- function InputRenderComponent_input_1_Template(rf, ctx) { if (rf & 1) {
773
- const _r5 = ɵɵgetCurrentView();
774
- ɵɵelementStart(0, "input", 4);
775
- ɵɵlistener("ngModelChange", function InputRenderComponent_input_1_Template_input_ngModelChange_0_listener($event) { ɵɵrestoreView(_r5); const ctx_r4 = ɵɵnextContext(); return ctx_r4.value = $event; })("ngModelChange", function InputRenderComponent_input_1_Template_input_ngModelChange_0_listener($event) { ɵɵrestoreView(_r5); const ctx_r6 = ɵɵnextContext(); return ctx_r6.onChange($event); });
776
- ɵɵelementEnd();
777
- } if (rf & 2) {
778
- const ctx_r0 = ɵɵnextContext();
779
- ɵɵpropertyInterpolate("placeholder", ctx_r0.schema.description);
780
- ɵɵproperty("type", ctx_r0.schema.type === "password" ? "password" : "text")("ngModel", ctx_r0.value)("ngModelOptions", ɵɵpureFunction0(6, _c0$6))("id", ctx_r0.inputId)("maxlength", ctx_r0.schema.maxLength);
781
- } }
782
- function InputRenderComponent_select_box_2_Template(rf, ctx) { if (rf & 1) {
783
- const _r8 = ɵɵgetCurrentView();
784
- ɵɵelementStart(0, "select-box", 5);
785
- ɵɵlistener("ngModelChange", function InputRenderComponent_select_box_2_Template_select_box_ngModelChange_0_listener($event) { ɵɵrestoreView(_r8); const ctx_r7 = ɵɵnextContext(); return ctx_r7.value = $event; })("ngModelChange", function InputRenderComponent_select_box_2_Template_select_box_ngModelChange_0_listener($event) { ɵɵrestoreView(_r8); const ctx_r9 = ɵɵnextContext(); return ctx_r9.onChange($event.key); });
786
- ɵɵpipe(1, "translate");
787
- ɵɵpipe(2, "translate");
788
- ɵɵpipe(3, "translate");
789
- ɵɵpipe(4, "translate");
790
- ɵɵelementEnd();
791
- } if (rf & 2) {
792
- const ctx_r1 = ɵɵnextContext();
793
- ɵɵproperty("id", ctx_r1.inputId)("ngModel", ctx_r1.value)("ngModelOptions", ɵɵpureFunction0(20, _c0$6))("placeholder", ɵɵpipeBind1(1, 12, ctx_r1.schema.description || "COMPONENTS.SCHEMA.SELECT.PLACEHOLDER"))("searchPlaceHolder", ɵɵpipeBind1(2, 14, "COMPONENTS.SCHEMA.SELECT.SEARCH"))("clearText", ɵɵpipeBind1(3, 16, "COMPONENTS.SCHEMA.SELECT.CLEAR"))("notFoundText", ɵɵpipeBind1(4, 18, "COMPONENTS.SCHEMA.SELECT.NOT_FOUND"))("bindKey", "key")("bindValue", "value")("enabledSearch", true)("limitItens", 30)("data", ctx_r1.schema.options);
794
- } }
795
- function InputRenderComponent_number_input_3_Template(rf, ctx) { if (rf & 1) {
796
- const _r11 = ɵɵgetCurrentView();
797
- ɵɵelementStart(0, "number-input", 6);
798
- ɵɵlistener("modelChange", function InputRenderComponent_number_input_3_Template_number_input_modelChange_0_listener($event) { ɵɵrestoreView(_r11); const ctx_r10 = ɵɵnextContext(); return ctx_r10.value = $event; })("modelChange", function InputRenderComponent_number_input_3_Template_number_input_modelChange_0_listener($event) { ɵɵrestoreView(_r11); const ctx_r12 = ɵɵnextContext(); return ctx_r12.onChange($event); });
799
- ɵɵelementEnd();
800
- } if (rf & 2) {
801
- const ctx_r2 = ɵɵnextContext();
802
- ɵɵproperty("model", ctx_r2.value)("inputId", ctx_r2.inputId)("placeholder", ctx_r2.schema.description)("maxLength", ctx_r2.schema.maxLength);
803
- } }
804
- function InputRenderComponent_boolean_input_4_Template(rf, ctx) { if (rf & 1) {
805
- const _r14 = ɵɵgetCurrentView();
806
- ɵɵelementStart(0, "boolean-input", 6);
807
- ɵɵlistener("modelChange", function InputRenderComponent_boolean_input_4_Template_boolean_input_modelChange_0_listener($event) { ɵɵrestoreView(_r14); const ctx_r13 = ɵɵnextContext(); return ctx_r13.value = $event; })("modelChange", function InputRenderComponent_boolean_input_4_Template_boolean_input_modelChange_0_listener($event) { ɵɵrestoreView(_r14); const ctx_r15 = ɵɵnextContext(); return ctx_r15.onChange($event); });
808
- ɵɵelementEnd();
809
- } if (rf & 2) {
810
- const ctx_r3 = ɵɵnextContext();
811
- ɵɵproperty("model", ctx_r3.value)("inputId", ctx_r3.inputId)("placeholder", ctx_r3.schema.description)("maxLength", ctx_r3.schema.maxLength);
812
- } }
813
- class InputRenderComponent extends BaseSchemaComponent {
814
- constructor() {
815
- super(...arguments);
816
- this.schema = {};
817
- this.editing = false;
818
- this.onDropEvent = new EventEmitter();
819
- }
820
- ngAfterContentInit() {
821
- var _a, _b;
822
- if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) !== 'object' && ((_b = this.schema) === null || _b === void 0 ? void 0 : _b.type) !== 'array') {
823
- if (!this.editing && this.schema.options) {
824
- const $event = this.schema.options.filter((item) => item.selected === true);
825
- if ($event[0]) {
826
- this.onChange($event[0].key);
827
- this.value = $event[0];
828
- }
829
- }
830
- else if (this.editing && this.schema.options && this.model) {
831
- const $event = this.schema.options.filter((item) => item.key === this.model);
832
- if ($event[0]) {
833
- this.onChange($event[0].key);
834
- this.value = $event[0];
835
- }
836
- }
837
- else {
838
- this.value = this.model;
839
- }
840
- }
841
- }
842
- onChange($event) {
843
- this.model = $event;
844
- this.modelChange.emit(this.model);
845
- }
846
- }
847
- InputRenderComponent.ɵfac = function InputRenderComponent_Factory(t) { return ɵInputRenderComponent_BaseFactory(t || InputRenderComponent); };
848
- InputRenderComponent.ɵcmp = ɵɵdefineComponent({ type: InputRenderComponent, selectors: [["input-render"]], inputs: { schema: "schema", modelPropertiesPath: "modelPropertiesPath", inputId: "inputId", editing: "editing" }, outputs: { onDropEvent: "onDropEvent" }, features: [ɵɵInheritDefinitionFeature], decls: 5, vars: 4, consts: [[1, "schema-input-container"], ["class", "form-control", "dndDropzone", "", 3, "type", "placeholder", "ngModel", "ngModelOptions", "id", "maxlength", "ngModelChange", 4, "ngIf"], [3, "id", "ngModel", "ngModelOptions", "placeholder", "searchPlaceHolder", "clearText", "notFoundText", "bindKey", "bindValue", "enabledSearch", "limitItens", "data", "ngModelChange", 4, "ngIf"], ["dndDropzone", "", 3, "model", "inputId", "placeholder", "maxLength", "modelChange", 4, "ngIf"], ["dndDropzone", "", 1, "form-control", 3, "type", "placeholder", "ngModel", "ngModelOptions", "id", "maxlength", "ngModelChange"], [3, "id", "ngModel", "ngModelOptions", "placeholder", "searchPlaceHolder", "clearText", "notFoundText", "bindKey", "bindValue", "enabledSearch", "limitItens", "data", "ngModelChange"], ["dndDropzone", "", 3, "model", "inputId", "placeholder", "maxLength", "modelChange"]], template: function InputRenderComponent_Template(rf, ctx) { if (rf & 1) {
849
- ɵɵelementStart(0, "div", 0);
850
- ɵɵtemplate(1, InputRenderComponent_input_1_Template, 1, 7, "input", 1);
851
- ɵɵtemplate(2, InputRenderComponent_select_box_2_Template, 5, 21, "select-box", 2);
852
- ɵɵtemplate(3, InputRenderComponent_number_input_3_Template, 1, 4, "number-input", 3);
853
- ɵɵtemplate(4, InputRenderComponent_boolean_input_4_Template, 1, 4, "boolean-input", 3);
854
- ɵɵelementEnd();
855
- } if (rf & 2) {
856
- ɵɵadvance(1);
857
- ɵɵproperty("ngIf", (ctx.schema.type === "string" || ctx.schema.type === "password") && !ctx.schema.options);
858
- ɵɵadvance(1);
859
- ɵɵproperty("ngIf", ctx.schema.type === "string" && ctx.schema.options);
860
- ɵɵadvance(1);
861
- ɵɵproperty("ngIf", ctx.schema.type === "number");
862
- ɵɵadvance(1);
863
- ɵɵproperty("ngIf", ctx.schema.type === "boolean");
864
- } }, directives: [NgIf, DefaultValueAccessor, DndDropzoneDirective, NgControlStatus, NgModel, MaxLengthValidator, SelectBoxComponent, NumberInputComponent, BooleanInputComponent], pipes: [TranslatePipe], styles: [""] });
865
- const ɵInputRenderComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(InputRenderComponent);
866
- /*@__PURE__*/ (function () { ɵsetClassMetadata(InputRenderComponent, [{
867
- type: Component,
868
- args: [{
869
- selector: 'input-render',
870
- templateUrl: 'input-render.html',
871
- styleUrls: ['./input-render.scss']
872
- }]
873
- }], null, { schema: [{
874
- type: Input
875
- }], modelPropertiesPath: [{
876
- type: Input
877
- }], inputId: [{
878
- type: Input
879
- }], editing: [{
880
- type: Input
881
- }], onDropEvent: [{
882
- type: Output
785
+ const _c0$6 = function () { return { standalone: true }; };
786
+ function InputRenderComponent_input_1_Template(rf, ctx) { if (rf & 1) {
787
+ const _r5 = ɵɵgetCurrentView();
788
+ ɵɵelementStart(0, "input", 4);
789
+ ɵɵlistener("ngModelChange", function InputRenderComponent_input_1_Template_input_ngModelChange_0_listener($event) { ɵɵrestoreView(_r5); const ctx_r4 = ɵɵnextContext(); return ctx_r4.value = $event; })("ngModelChange", function InputRenderComponent_input_1_Template_input_ngModelChange_0_listener($event) { ɵɵrestoreView(_r5); const ctx_r6 = ɵɵnextContext(); return ctx_r6.onChange($event); })("dndDrop", function InputRenderComponent_input_1_Template_input_dndDrop_0_listener($event) { ɵɵrestoreView(_r5); const ctx_r7 = ɵɵnextContext(); return ctx_r7.onDropCallBack($event, ctx_r7.value); });
790
+ ɵɵelementEnd();
791
+ } if (rf & 2) {
792
+ const ctx_r0 = ɵɵnextContext();
793
+ ɵɵpropertyInterpolate("placeholder", ctx_r0.schema.description);
794
+ ɵɵproperty("type", ctx_r0.schema.type === "password" ? "password" : "text")("ngModel", ctx_r0.value)("ngModelOptions", ɵɵpureFunction0(6, _c0$6))("id", ctx_r0.inputId)("maxlength", ctx_r0.schema.maxLength);
795
+ } }
796
+ function InputRenderComponent_select_box_2_Template(rf, ctx) { if (rf & 1) {
797
+ const _r9 = ɵɵgetCurrentView();
798
+ ɵɵelementStart(0, "select-box", 5);
799
+ ɵɵlistener("ngModelChange", function InputRenderComponent_select_box_2_Template_select_box_ngModelChange_0_listener($event) { ɵɵrestoreView(_r9); const ctx_r8 = ɵɵnextContext(); return ctx_r8.value = $event; })("ngModelChange", function InputRenderComponent_select_box_2_Template_select_box_ngModelChange_0_listener($event) { ɵɵrestoreView(_r9); const ctx_r10 = ɵɵnextContext(); return ctx_r10.onChange($event.key); });
800
+ ɵɵpipe(1, "translate");
801
+ ɵɵpipe(2, "translate");
802
+ ɵɵpipe(3, "translate");
803
+ ɵɵpipe(4, "translate");
804
+ ɵɵelementEnd();
805
+ } if (rf & 2) {
806
+ const ctx_r1 = ɵɵnextContext();
807
+ ɵɵproperty("id", ctx_r1.inputId)("ngModel", ctx_r1.value)("ngModelOptions", ɵɵpureFunction0(20, _c0$6))("placeholder", ɵɵpipeBind1(1, 12, ctx_r1.schema.description || "COMPONENTS.SCHEMA.SELECT.PLACEHOLDER"))("searchPlaceHolder", ɵɵpipeBind1(2, 14, "COMPONENTS.SCHEMA.SELECT.SEARCH"))("clearText", ɵɵpipeBind1(3, 16, "COMPONENTS.SCHEMA.SELECT.CLEAR"))("notFoundText", ɵɵpipeBind1(4, 18, "COMPONENTS.SCHEMA.SELECT.NOT_FOUND"))("bindKey", "key")("bindValue", "value")("enabledSearch", true)("limitItens", 30)("data", ctx_r1.schema.options);
808
+ } }
809
+ function InputRenderComponent_number_input_3_Template(rf, ctx) { if (rf & 1) {
810
+ const _r12 = ɵɵgetCurrentView();
811
+ ɵɵelementStart(0, "number-input", 6);
812
+ ɵɵlistener("modelChange", function InputRenderComponent_number_input_3_Template_number_input_modelChange_0_listener($event) { ɵɵrestoreView(_r12); const ctx_r11 = ɵɵnextContext(); return ctx_r11.value = $event; })("modelChange", function InputRenderComponent_number_input_3_Template_number_input_modelChange_0_listener($event) { ɵɵrestoreView(_r12); const ctx_r13 = ɵɵnextContext(); return ctx_r13.onChange($event); });
813
+ ɵɵelementEnd();
814
+ } if (rf & 2) {
815
+ const ctx_r2 = ɵɵnextContext();
816
+ ɵɵproperty("model", ctx_r2.value)("inputId", ctx_r2.inputId)("placeholder", ctx_r2.schema.description)("maxLength", ctx_r2.schema.maxLength);
817
+ } }
818
+ function InputRenderComponent_boolean_input_4_Template(rf, ctx) { if (rf & 1) {
819
+ const _r15 = ɵɵgetCurrentView();
820
+ ɵɵelementStart(0, "boolean-input", 6);
821
+ ɵɵlistener("modelChange", function InputRenderComponent_boolean_input_4_Template_boolean_input_modelChange_0_listener($event) { ɵɵrestoreView(_r15); const ctx_r14 = ɵɵnextContext(); return ctx_r14.value = $event; })("modelChange", function InputRenderComponent_boolean_input_4_Template_boolean_input_modelChange_0_listener($event) { ɵɵrestoreView(_r15); const ctx_r16 = ɵɵnextContext(); return ctx_r16.onChange($event); });
822
+ ɵɵelementEnd();
823
+ } if (rf & 2) {
824
+ const ctx_r3 = ɵɵnextContext();
825
+ ɵɵproperty("model", ctx_r3.value)("inputId", ctx_r3.inputId)("placeholder", ctx_r3.schema.description)("maxLength", ctx_r3.schema.maxLength);
826
+ } }
827
+ class InputRenderComponent extends BaseSchemaComponent {
828
+ constructor() {
829
+ super(...arguments);
830
+ this.schema = {};
831
+ this.editing = false;
832
+ this.onDropEvent = new EventEmitter();
833
+ }
834
+ ngAfterContentInit() {
835
+ var _a, _b;
836
+ if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) !== 'object' && ((_b = this.schema) === null || _b === void 0 ? void 0 : _b.type) !== 'array') {
837
+ if (!this.editing && this.schema.options) {
838
+ const $event = this.schema.options.filter((item) => item.selected === true);
839
+ if ($event[0]) {
840
+ this.onChange($event[0].key);
841
+ this.value = $event[0];
842
+ }
843
+ }
844
+ else if (this.editing && this.schema.options && this.model) {
845
+ const $event = this.schema.options.filter((item) => item.key === this.model);
846
+ if ($event[0]) {
847
+ this.onChange($event[0].key);
848
+ this.value = $event[0];
849
+ }
850
+ }
851
+ else {
852
+ this.value = this.model;
853
+ }
854
+ }
855
+ }
856
+ onDropCallBack($event, value) {
857
+ this.value = value = super.onDrop($event, value);
858
+ this.onChange(value);
859
+ }
860
+ onChange($event) {
861
+ this.model = $event;
862
+ this.modelChange.emit(this.model);
863
+ }
864
+ }
865
+ InputRenderComponent.ɵfac = function InputRenderComponent_Factory(t) { return ɵInputRenderComponent_BaseFactory(t || InputRenderComponent); };
866
+ InputRenderComponent.ɵcmp = ɵɵdefineComponent({ type: InputRenderComponent, selectors: [["input-render"]], inputs: { schema: "schema", modelPropertiesPath: "modelPropertiesPath", inputId: "inputId", editing: "editing" }, outputs: { onDropEvent: "onDropEvent" }, features: [ɵɵInheritDefinitionFeature], decls: 5, vars: 4, consts: [[1, "schema-input-container"], ["class", "form-control", "dndDropzone", "", 3, "type", "placeholder", "ngModel", "ngModelOptions", "id", "maxlength", "ngModelChange", "dndDrop", 4, "ngIf"], [3, "id", "ngModel", "ngModelOptions", "placeholder", "searchPlaceHolder", "clearText", "notFoundText", "bindKey", "bindValue", "enabledSearch", "limitItens", "data", "ngModelChange", 4, "ngIf"], [3, "model", "inputId", "placeholder", "maxLength", "modelChange", 4, "ngIf"], ["dndDropzone", "", 1, "form-control", 3, "type", "placeholder", "ngModel", "ngModelOptions", "id", "maxlength", "ngModelChange", "dndDrop"], [3, "id", "ngModel", "ngModelOptions", "placeholder", "searchPlaceHolder", "clearText", "notFoundText", "bindKey", "bindValue", "enabledSearch", "limitItens", "data", "ngModelChange"], [3, "model", "inputId", "placeholder", "maxLength", "modelChange"]], template: function InputRenderComponent_Template(rf, ctx) { if (rf & 1) {
867
+ ɵɵelementStart(0, "div", 0);
868
+ ɵɵtemplate(1, InputRenderComponent_input_1_Template, 1, 7, "input", 1);
869
+ ɵɵtemplate(2, InputRenderComponent_select_box_2_Template, 5, 21, "select-box", 2);
870
+ ɵɵtemplate(3, InputRenderComponent_number_input_3_Template, 1, 4, "number-input", 3);
871
+ ɵɵtemplate(4, InputRenderComponent_boolean_input_4_Template, 1, 4, "boolean-input", 3);
872
+ ɵɵelementEnd();
873
+ } if (rf & 2) {
874
+ ɵɵadvance(1);
875
+ ɵɵproperty("ngIf", (ctx.schema.type === "string" || ctx.schema.type === "password") && !ctx.schema.options);
876
+ ɵɵadvance(1);
877
+ ɵɵproperty("ngIf", ctx.schema.type === "string" && ctx.schema.options);
878
+ ɵɵadvance(1);
879
+ ɵɵproperty("ngIf", ctx.schema.type === "number");
880
+ ɵɵadvance(1);
881
+ ɵɵproperty("ngIf", ctx.schema.type === "boolean");
882
+ } }, directives: [NgIf, DefaultValueAccessor, DndDropzoneDirective, NgControlStatus, NgModel, MaxLengthValidator, SelectBoxComponent, NumberInputComponent, BooleanInputComponent], pipes: [TranslatePipe], styles: [""] });
883
+ const ɵInputRenderComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(InputRenderComponent);
884
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(InputRenderComponent, [{
885
+ type: Component,
886
+ args: [{
887
+ selector: 'input-render',
888
+ templateUrl: 'input-render.html',
889
+ styleUrls: ['./input-render.scss']
890
+ }]
891
+ }], null, { schema: [{
892
+ type: Input
893
+ }], modelPropertiesPath: [{
894
+ type: Input
895
+ }], inputId: [{
896
+ type: Input
897
+ }], editing: [{
898
+ type: Input
899
+ }], onDropEvent: [{
900
+ type: Output
883
901
  }] }); })();
884
902
 
885
- function SchemaInputComponent_div_0_Template(rf, ctx) { if (rf & 1) {
886
- const _r3 = ɵɵgetCurrentView();
887
- ɵɵelementStart(0, "div", 1);
888
- ɵɵelementStart(1, "div", 2);
889
- ɵɵelementStart(2, "field-render", 3);
890
- ɵɵelementStart(3, "input-render", 4);
891
- ɵɵlistener("modelChange", function SchemaInputComponent_div_0_Template_input_render_modelChange_3_listener($event) { ɵɵrestoreView(_r3); const ctx_r2 = ɵɵnextContext(); return (ctx_r2.model[ctx_r2.schema.id] = $event); });
892
- ɵɵelementEnd();
893
- ɵɵelementEnd();
894
- ɵɵelementEnd();
895
- ɵɵelementEnd();
896
- } if (rf & 2) {
897
- const ctx_r0 = ɵɵnextContext();
898
- ɵɵadvance(2);
899
- ɵɵproperty("label", ctx_r0.schema.title)("tooltip", ctx_r0.schema.help)("inputId", ctx_r0.getId(ctx_r0.index));
900
- ɵɵadvance(1);
901
- ɵɵproperty("inputId", ctx_r0.getId(ctx_r0.index))("schema", ctx_r0.schema)("model", ctx_r0.model[ctx_r0.schema.id])("modelPropertiesPath", "mappingAttributes." + ctx_r0.schema.id)("editing", ctx_r0.editing);
902
- } }
903
- function SchemaInputComponent_div_1_span_4_Template(rf, ctx) { if (rf & 1) {
904
- ɵɵelementStart(0, "span", 7);
905
- ɵɵpipe(1, "translate");
906
- ɵɵtext(2, "?");
907
- ɵɵelementEnd();
908
- } if (rf & 2) {
909
- const ctx_r4 = ɵɵnextContext(2);
910
- ɵɵpropertyInterpolate("matTooltip", ɵɵpipeBind1(1, 1, ctx_r4.schema.help));
911
- } }
912
- function SchemaInputComponent_div_1_Template(rf, ctx) { if (rf & 1) {
913
- const _r6 = ɵɵgetCurrentView();
914
- ɵɵelementStart(0, "div", 1);
915
- ɵɵelementStart(1, "div", 2);
916
- ɵɵelementStart(2, "label", 5);
917
- ɵɵtext(3);
918
- ɵɵtemplate(4, SchemaInputComponent_div_1_span_4_Template, 3, 3, "span", 6);
919
- ɵɵelementEnd();
920
- ɵɵelementStart(5, "input-render", 4);
921
- ɵɵlistener("modelChange", function SchemaInputComponent_div_1_Template_input_render_modelChange_5_listener($event) { ɵɵrestoreView(_r6); const ctx_r5 = ɵɵnextContext(); return (ctx_r5.model[ctx_r5.schema.id] = $event); });
922
- ɵɵelementEnd();
923
- ɵɵelementEnd();
924
- ɵɵelementEnd();
925
- } if (rf & 2) {
926
- const ctx_r1 = ɵɵnextContext();
927
- ɵɵadvance(2);
928
- ɵɵproperty("htmlFor", ctx_r1.getId(ctx_r1.index));
929
- ɵɵadvance(1);
930
- ɵɵtextInterpolate1(" ", ctx_r1.schema.title, " ");
931
- ɵɵadvance(1);
932
- ɵɵproperty("ngIf", ctx_r1.schema.help);
933
- ɵɵadvance(1);
934
- ɵɵproperty("inputId", ctx_r1.getId(ctx_r1.index))("schema", ctx_r1.schema)("model", ctx_r1.model[ctx_r1.schema.id])("modelPropertiesPath", "mappingAttributes." + ctx_r1.schema.id)("editing", ctx_r1.editing);
935
- } }
936
- class SchemaInputComponent extends BaseSchemaComponent {
937
- constructor() {
938
- super(...arguments);
939
- this.editing = false;
940
- }
941
- ngAfterContentInit() {
942
- this.loaded = true;
943
- console.log('SchemaInputComponent schema', this.schema);
944
- }
945
- getId(index) {
946
- return `${this.idPrefix}-struct-${index}`;
947
- }
948
- }
949
- SchemaInputComponent.ɵfac = function SchemaInputComponent_Factory(t) { return ɵSchemaInputComponent_BaseFactory(t || SchemaInputComponent); };
950
- SchemaInputComponent.ɵcmp = ɵɵdefineComponent({ type: SchemaInputComponent, selectors: [["schema-input"]], inputs: { idPrefix: "idPrefix", schema: "schema", editing: "editing", index: "index" }, features: [ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [["class", "row schema-input", 4, "ngIf"], [1, "row", "schema-input"], [1, "col-md-12"], [3, "label", "tooltip", "inputId"], [3, "inputId", "schema", "model", "modelPropertiesPath", "editing", "modelChange"], [1, "info-label", "bold", 3, "htmlFor"], ["class", "config-tooltip", 3, "matTooltip", 4, "ngIf"], [1, "config-tooltip", 3, "matTooltip"]], template: function SchemaInputComponent_Template(rf, ctx) { if (rf & 1) {
951
- ɵɵtemplate(0, SchemaInputComponent_div_0_Template, 4, 8, "div", 0);
952
- ɵɵtemplate(1, SchemaInputComponent_div_1_Template, 6, 8, "div", 0);
953
- } if (rf & 2) {
954
- ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && ctx.schema.minLength && ctx.schema.minLength > 0);
955
- ɵɵadvance(1);
956
- ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && (!ctx.schema.minLength || ctx.schema.minLength === 0));
957
- } }, directives: [NgIf, FieldRenderComponent, InputRenderComponent, MatTooltip], pipes: [TranslatePipe], styles: [""] });
958
- const ɵSchemaInputComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaInputComponent);
959
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaInputComponent, [{
960
- type: Component,
961
- args: [{
962
- selector: 'schema-input',
963
- templateUrl: 'schema-input.html',
964
- styleUrls: ['./schema-input.scss']
965
- }]
966
- }], null, { idPrefix: [{
967
- type: Input
968
- }], schema: [{
969
- type: Input
970
- }], editing: [{
971
- type: Input
972
- }], index: [{
973
- type: Input
903
+ function SchemaInputComponent_div_0_Template(rf, ctx) { if (rf & 1) {
904
+ const _r3 = ɵɵgetCurrentView();
905
+ ɵɵelementStart(0, "div", 1);
906
+ ɵɵelementStart(1, "div", 2);
907
+ ɵɵelementStart(2, "field-render", 3);
908
+ ɵɵelementStart(3, "input-render", 4);
909
+ ɵɵlistener("modelChange", function SchemaInputComponent_div_0_Template_input_render_modelChange_3_listener($event) { ɵɵrestoreView(_r3); const ctx_r2 = ɵɵnextContext(); return (ctx_r2.model[ctx_r2.schema.id] = $event); });
910
+ ɵɵelementEnd();
911
+ ɵɵelementEnd();
912
+ ɵɵelementEnd();
913
+ ɵɵelementEnd();
914
+ } if (rf & 2) {
915
+ const ctx_r0 = ɵɵnextContext();
916
+ ɵɵadvance(2);
917
+ ɵɵproperty("label", ctx_r0.schema.title)("tooltip", ctx_r0.schema.help)("inputId", ctx_r0.getId(ctx_r0.index));
918
+ ɵɵadvance(1);
919
+ ɵɵproperty("inputId", ctx_r0.getId(ctx_r0.index))("schema", ctx_r0.schema)("model", ctx_r0.model[ctx_r0.schema.id])("modelPropertiesPath", "mappingAttributes." + ctx_r0.schema.id)("editing", ctx_r0.editing);
920
+ } }
921
+ function SchemaInputComponent_div_1_span_4_Template(rf, ctx) { if (rf & 1) {
922
+ ɵɵelementStart(0, "span", 7);
923
+ ɵɵpipe(1, "translate");
924
+ ɵɵtext(2, "?");
925
+ ɵɵelementEnd();
926
+ } if (rf & 2) {
927
+ const ctx_r4 = ɵɵnextContext(2);
928
+ ɵɵpropertyInterpolate("matTooltip", ɵɵpipeBind1(1, 1, ctx_r4.schema.help));
929
+ } }
930
+ function SchemaInputComponent_div_1_Template(rf, ctx) { if (rf & 1) {
931
+ const _r6 = ɵɵgetCurrentView();
932
+ ɵɵelementStart(0, "div", 1);
933
+ ɵɵelementStart(1, "div", 2);
934
+ ɵɵelementStart(2, "label", 5);
935
+ ɵɵtext(3);
936
+ ɵɵtemplate(4, SchemaInputComponent_div_1_span_4_Template, 3, 3, "span", 6);
937
+ ɵɵelementEnd();
938
+ ɵɵelementStart(5, "input-render", 4);
939
+ ɵɵlistener("modelChange", function SchemaInputComponent_div_1_Template_input_render_modelChange_5_listener($event) { ɵɵrestoreView(_r6); const ctx_r5 = ɵɵnextContext(); return (ctx_r5.model[ctx_r5.schema.id] = $event); });
940
+ ɵɵelementEnd();
941
+ ɵɵelementEnd();
942
+ ɵɵelementEnd();
943
+ } if (rf & 2) {
944
+ const ctx_r1 = ɵɵnextContext();
945
+ ɵɵadvance(2);
946
+ ɵɵproperty("htmlFor", ctx_r1.getId(ctx_r1.index));
947
+ ɵɵadvance(1);
948
+ ɵɵtextInterpolate1(" ", ctx_r1.schema.title, " ");
949
+ ɵɵadvance(1);
950
+ ɵɵproperty("ngIf", ctx_r1.schema.help);
951
+ ɵɵadvance(1);
952
+ ɵɵproperty("inputId", ctx_r1.getId(ctx_r1.index))("schema", ctx_r1.schema)("model", ctx_r1.model[ctx_r1.schema.id])("modelPropertiesPath", "mappingAttributes." + ctx_r1.schema.id)("editing", ctx_r1.editing);
953
+ } }
954
+ class SchemaInputComponent extends BaseSchemaComponent {
955
+ constructor() {
956
+ super(...arguments);
957
+ this.editing = false;
958
+ }
959
+ ngAfterContentInit() {
960
+ this.loaded = true;
961
+ }
962
+ getId(index) {
963
+ return `${this.idPrefix}-struct-${index}`;
964
+ }
965
+ }
966
+ SchemaInputComponent.ɵfac = function SchemaInputComponent_Factory(t) { return ɵSchemaInputComponent_BaseFactory(t || SchemaInputComponent); };
967
+ SchemaInputComponent.ɵcmp = ɵɵdefineComponent({ type: SchemaInputComponent, selectors: [["schema-input"]], inputs: { idPrefix: "idPrefix", schema: "schema", editing: "editing", index: "index" }, features: [ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [["class", "row schema-input", 4, "ngIf"], [1, "row", "schema-input"], [1, "col-md-12"], [3, "label", "tooltip", "inputId"], [3, "inputId", "schema", "model", "modelPropertiesPath", "editing", "modelChange"], [1, "info-label", "bold", 3, "htmlFor"], ["class", "config-tooltip", 3, "matTooltip", 4, "ngIf"], [1, "config-tooltip", 3, "matTooltip"]], template: function SchemaInputComponent_Template(rf, ctx) { if (rf & 1) {
968
+ ɵɵtemplate(0, SchemaInputComponent_div_0_Template, 4, 8, "div", 0);
969
+ ɵɵtemplate(1, SchemaInputComponent_div_1_Template, 6, 8, "div", 0);
970
+ } if (rf & 2) {
971
+ ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && ctx.schema.minLength && ctx.schema.minLength > 0);
972
+ ɵɵadvance(1);
973
+ ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && (!ctx.schema.minLength || ctx.schema.minLength === 0));
974
+ } }, directives: [NgIf, FieldRenderComponent, InputRenderComponent, MatTooltip], pipes: [TranslatePipe], styles: [""] });
975
+ const ɵSchemaInputComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaInputComponent);
976
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaInputComponent, [{
977
+ type: Component,
978
+ args: [{
979
+ selector: 'schema-input',
980
+ templateUrl: 'schema-input.html',
981
+ styleUrls: ['./schema-input.scss']
982
+ }]
983
+ }], null, { idPrefix: [{
984
+ type: Input
985
+ }], schema: [{
986
+ type: Input
987
+ }], editing: [{
988
+ type: Input
989
+ }], index: [{
990
+ type: Input
974
991
  }] }); })();
975
992
 
976
- function SchemaObjectComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
977
- const _r3 = ɵɵgetCurrentView();
978
- ɵɵelementStart(0, "div", 5);
979
- ɵɵelementStart(1, "div", 6);
980
- ɵɵelementStart(2, "label", 7);
981
- ɵɵtext(3);
982
- ɵɵpipe(4, "translate");
983
- ɵɵelementEnd();
984
- ɵɵelementStart(5, "schema-custom-attributes", 8);
985
- ɵɵlistener("modelChange", function SchemaObjectComponent_div_0_div_4_Template_schema_custom_attributes_modelChange_5_listener($event) { ɵɵrestoreView(_r3); const ctx_r2 = ɵɵnextContext(2); return ctx_r2.model[ctx_r2.schema.id].customAttributes = $event; });
986
- ɵɵelementEnd();
987
- ɵɵelementEnd();
988
- ɵɵelementEnd();
989
- } if (rf & 2) {
990
- const ctx_r1 = ɵɵnextContext(2);
991
- ɵɵadvance(3);
992
- ɵɵtextInterpolate(ɵɵpipeBind1(4, 3, "STEP.ADDITIONAL_ATTRIBUTES"));
993
- ɵɵadvance(2);
994
- ɵɵproperty("model", ctx_r1.model[ctx_r1.schema.id].customAttributes)("onDropFunction", ctx_r1.onDrop);
995
- } }
996
- function SchemaObjectComponent_div_0_Template(rf, ctx) { if (rf & 1) {
997
- const _r5 = ɵɵgetCurrentView();
998
- ɵɵelementStart(0, "div", 1);
999
- ɵɵelementStart(1, "div", 2);
1000
- ɵɵtext(2);
1001
- ɵɵelementEnd();
1002
- ɵɵelementStart(3, "schema-form", 3);
1003
- ɵɵlistener("modelChange", function SchemaObjectComponent_div_0_Template_schema_form_modelChange_3_listener($event) { ɵɵrestoreView(_r5); const ctx_r4 = ɵɵnextContext(); return (ctx_r4.model[ctx_r4.schema.id] = $event); });
1004
- ɵɵelementEnd();
1005
- ɵɵtemplate(4, SchemaObjectComponent_div_0_div_4_Template, 6, 5, "div", 4);
1006
- ɵɵelementEnd();
1007
- } if (rf & 2) {
1008
- const ctx_r0 = ɵɵnextContext();
1009
- ɵɵadvance(2);
1010
- ɵɵtextInterpolate(ctx_r0.schema.title);
1011
- ɵɵadvance(1);
1012
- ɵɵproperty("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model[ctx_r0.schema.id])("schemas", ctx_r0.getSchemaProperties())("editing", ctx_r0.editing);
1013
- ɵɵadvance(1);
1014
- ɵɵproperty("ngIf", ctx_r0.model[ctx_r0.schema.id] && ctx_r0.schema.customProperties);
1015
- } }
1016
- class SchemaObjectComponent extends BaseSchemaComponent {
1017
- constructor() {
1018
- super(...arguments);
1019
- this.editing = false;
1020
- this.onDropEvent = new EventEmitter();
1021
- this.loaded = false;
1022
- }
1023
- ngAfterContentInit() {
1024
- var _a;
1025
- if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) === 'object' && this.model) {
1026
- this.model[this.schema.id] = this.model[this.schema.id] || {};
1027
- }
1028
- this.loaded = true;
1029
- console.log('SchemaObjectComponent schema', this.schema);
1030
- }
1031
- onDrop($event, modelElement) {
1032
- return onDropStruct($event, modelElement);
1033
- }
1034
- }
1035
- SchemaObjectComponent.ɵfac = function SchemaObjectComponent_Factory(t) { return ɵSchemaObjectComponent_BaseFactory(t || SchemaObjectComponent); };
1036
- SchemaObjectComponent.ɵcmp = ɵɵdefineComponent({ type: SchemaObjectComponent, selectors: [["schema-object"]], inputs: { idPrefix: "idPrefix", modelPropertiesPath: "modelPropertiesPath", inputId: "inputId", editing: "editing", index: "index" }, outputs: { onDropEvent: "onDropEvent" }, features: [ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "schema-object-container", 4, "ngIf"], [1, "schema-object-container"], [1, "schema-object-title"], [3, "idPrefix", "model", "schemas", "editing", "modelChange"], ["class", "row struct-custom-properties", 4, "ngIf"], [1, "row", "struct-custom-properties"], [1, "col-md-12"], [1, "info-label", "bold"], [3, "model", "onDropFunction", "modelChange"]], template: function SchemaObjectComponent_Template(rf, ctx) { if (rf & 1) {
1037
- ɵɵtemplate(0, SchemaObjectComponent_div_0_Template, 5, 6, "div", 0);
1038
- } if (rf & 2) {
1039
- ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type == "object");
1040
- } }, directives: [NgIf, SchemaFormComponent, SchemaCustomAttributesComponent], pipes: [TranslatePipe], styles: [".schema-object-container[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:5px;margin-bottom:10px;margin-top:10px;padding:10px}.schema-object-container[_ngcontent-%COMP%] .schema-object-title[_ngcontent-%COMP%]{background:#eee;border-bottom:1px solid #ddd;font-weight:700;margin-left:-10px;margin-top:-10px;padding:10px;width:calc(100% + 20px)}"] });
1041
- const ɵSchemaObjectComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaObjectComponent);
1042
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaObjectComponent, [{
1043
- type: Component,
1044
- args: [{
1045
- selector: 'schema-object',
1046
- templateUrl: 'schema-object.html',
1047
- styleUrls: ['./schema-object.scss']
1048
- }]
1049
- }], null, { idPrefix: [{
1050
- type: Input
1051
- }], modelPropertiesPath: [{
1052
- type: Input
1053
- }], inputId: [{
1054
- type: Input
1055
- }], editing: [{
1056
- type: Input
1057
- }], index: [{
1058
- type: Input
1059
- }], onDropEvent: [{
1060
- type: Output
993
+ function SchemaObjectComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
994
+ const _r3 = ɵɵgetCurrentView();
995
+ ɵɵelementStart(0, "div", 5);
996
+ ɵɵelementStart(1, "div", 6);
997
+ ɵɵelementStart(2, "label", 7);
998
+ ɵɵtext(3);
999
+ ɵɵpipe(4, "translate");
1000
+ ɵɵelementEnd();
1001
+ ɵɵelementStart(5, "schema-custom-attributes", 8);
1002
+ ɵɵlistener("modelChange", function SchemaObjectComponent_div_0_div_4_Template_schema_custom_attributes_modelChange_5_listener($event) { ɵɵrestoreView(_r3); const ctx_r2 = ɵɵnextContext(2); return ctx_r2.model[ctx_r2.schema.id].customAttributes = $event; });
1003
+ ɵɵelementEnd();
1004
+ ɵɵelementEnd();
1005
+ ɵɵelementEnd();
1006
+ } if (rf & 2) {
1007
+ const ctx_r1 = ɵɵnextContext(2);
1008
+ ɵɵadvance(3);
1009
+ ɵɵtextInterpolate(ɵɵpipeBind1(4, 3, "STEP.ADDITIONAL_ATTRIBUTES"));
1010
+ ɵɵadvance(2);
1011
+ ɵɵproperty("model", ctx_r1.model[ctx_r1.schema.id].customAttributes)("onDropFunction", ctx_r1.onDrop);
1012
+ } }
1013
+ function SchemaObjectComponent_div_0_Template(rf, ctx) { if (rf & 1) {
1014
+ const _r5 = ɵɵgetCurrentView();
1015
+ ɵɵelementStart(0, "div", 1);
1016
+ ɵɵelementStart(1, "div", 2);
1017
+ ɵɵtext(2);
1018
+ ɵɵelementEnd();
1019
+ ɵɵelementStart(3, "schema-form", 3);
1020
+ ɵɵlistener("modelChange", function SchemaObjectComponent_div_0_Template_schema_form_modelChange_3_listener($event) { ɵɵrestoreView(_r5); const ctx_r4 = ɵɵnextContext(); return (ctx_r4.model[ctx_r4.schema.id] = $event); });
1021
+ ɵɵelementEnd();
1022
+ ɵɵtemplate(4, SchemaObjectComponent_div_0_div_4_Template, 6, 5, "div", 4);
1023
+ ɵɵelementEnd();
1024
+ } if (rf & 2) {
1025
+ const ctx_r0 = ɵɵnextContext();
1026
+ ɵɵadvance(2);
1027
+ ɵɵtextInterpolate(ctx_r0.schema.title);
1028
+ ɵɵadvance(1);
1029
+ ɵɵproperty("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model[ctx_r0.schema.id])("schemas", ctx_r0.getSchemaProperties())("editing", ctx_r0.editing);
1030
+ ɵɵadvance(1);
1031
+ ɵɵproperty("ngIf", ctx_r0.model[ctx_r0.schema.id] && ctx_r0.schema.customProperties);
1032
+ } }
1033
+ class SchemaObjectComponent extends BaseSchemaComponent {
1034
+ constructor() {
1035
+ super(...arguments);
1036
+ this.editing = false;
1037
+ this.onDropEvent = new EventEmitter();
1038
+ this.loaded = false;
1039
+ }
1040
+ ngAfterContentInit() {
1041
+ var _a;
1042
+ if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) === 'object' && this.model) {
1043
+ this.model[this.schema.id] = this.model[this.schema.id] || {};
1044
+ }
1045
+ this.loaded = true;
1046
+ }
1047
+ onDrop($event, modelElement) {
1048
+ return onDropStruct($event, modelElement);
1049
+ }
1050
+ }
1051
+ SchemaObjectComponent.ɵfac = function SchemaObjectComponent_Factory(t) { return ɵSchemaObjectComponent_BaseFactory(t || SchemaObjectComponent); };
1052
+ SchemaObjectComponent.ɵcmp = ɵɵdefineComponent({ type: SchemaObjectComponent, selectors: [["schema-object"]], inputs: { idPrefix: "idPrefix", modelPropertiesPath: "modelPropertiesPath", inputId: "inputId", editing: "editing", index: "index" }, outputs: { onDropEvent: "onDropEvent" }, features: [ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "schema-object-container", 4, "ngIf"], [1, "schema-object-container"], [1, "schema-object-title"], [3, "idPrefix", "model", "schemas", "editing", "modelChange"], ["class", "row struct-custom-properties", 4, "ngIf"], [1, "row", "struct-custom-properties"], [1, "col-md-12"], [1, "info-label", "bold"], [3, "model", "onDropFunction", "modelChange"]], template: function SchemaObjectComponent_Template(rf, ctx) { if (rf & 1) {
1053
+ ɵɵtemplate(0, SchemaObjectComponent_div_0_Template, 5, 6, "div", 0);
1054
+ } if (rf & 2) {
1055
+ ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type == "object");
1056
+ } }, directives: [NgIf, SchemaFormComponent, SchemaCustomAttributesComponent], pipes: [TranslatePipe], styles: [".schema-object-container[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:5px;margin-bottom:10px;margin-top:10px;padding:10px}.schema-object-container[_ngcontent-%COMP%] .schema-object-title[_ngcontent-%COMP%]{background:#eee;border-bottom:1px solid #ddd;font-weight:700;margin-left:-10px;margin-top:-10px;padding:10px;width:calc(100% + 20px)}"] });
1057
+ const ɵSchemaObjectComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaObjectComponent);
1058
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaObjectComponent, [{
1059
+ type: Component,
1060
+ args: [{
1061
+ selector: 'schema-object',
1062
+ templateUrl: 'schema-object.html',
1063
+ styleUrls: ['./schema-object.scss']
1064
+ }]
1065
+ }], null, { idPrefix: [{
1066
+ type: Input
1067
+ }], modelPropertiesPath: [{
1068
+ type: Input
1069
+ }], inputId: [{
1070
+ type: Input
1071
+ }], editing: [{
1072
+ type: Input
1073
+ }], index: [{
1074
+ type: Input
1075
+ }], onDropEvent: [{
1076
+ type: Output
1061
1077
  }] }); })();
1062
1078
 
1063
- class SchemaValidationField {
1064
- constructor(emptyFields, invalidMinLengthFields, invalidMaxLengthFields) {
1065
- this.emptyFields = emptyFields;
1066
- this.invalidMinLengthFields = invalidMinLengthFields;
1067
- this.invalidMaxLengthFields = invalidMaxLengthFields;
1068
- }
1069
- isValidSchemaFields() {
1070
- var _a, _b, _c;
1071
- return ((_a = this.emptyFields) === null || _a === void 0 ? void 0 : _a.length) < 1 && ((_b = this.invalidMinLengthFields) === null || _b === void 0 ? void 0 : _b.length) < 1 && ((_c = this.invalidMaxLengthFields) === null || _c === void 0 ? void 0 : _c.length) < 1;
1072
- }
1073
- isInvalidSchemaFields() {
1074
- return !this.isValidSchemaFields();
1075
- }
1079
+ class SchemaValidationField {
1080
+ constructor(emptyFields, invalidMinLengthFields, invalidMaxLengthFields) {
1081
+ this.emptyFields = emptyFields;
1082
+ this.invalidMinLengthFields = invalidMinLengthFields;
1083
+ this.invalidMaxLengthFields = invalidMaxLengthFields;
1084
+ }
1085
+ isValidSchemaFields() {
1086
+ var _a, _b, _c;
1087
+ return ((_a = this.emptyFields) === null || _a === void 0 ? void 0 : _a.length) < 1 && ((_b = this.invalidMinLengthFields) === null || _b === void 0 ? void 0 : _b.length) < 1 && ((_c = this.invalidMaxLengthFields) === null || _c === void 0 ? void 0 : _c.length) < 1;
1088
+ }
1089
+ isInvalidSchemaFields() {
1090
+ return !this.isValidSchemaFields();
1091
+ }
1076
1092
  }
1077
1093
 
1078
- class SchemaFieldsService {
1079
- constructor(translate) {
1080
- this.translate = translate;
1081
- }
1082
- validateSchemaFields(propertiesRendered, model) {
1083
- return __awaiter(this, void 0, void 0, function* () {
1084
- if (!propertiesRendered) {
1085
- return new SchemaValidationField([], [], []);
1086
- }
1087
- const emptyFields = [];
1088
- const invalidMinLengthFields = [];
1089
- const invalidMaxLengthFields = [];
1090
- this.processProperties(propertiesRendered, model, emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1091
- const structValidationField = new SchemaValidationField(emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1092
- structValidationField.validationErrorsLabel = yield this.getErrorsStringArray(structValidationField);
1093
- return structValidationField;
1094
- });
1095
- }
1096
- processProperties(propertiesRendered, model, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, recursive) {
1097
- for (const property of propertiesRendered) {
1098
- if ((property.type === 'object' || property.type === 'array') && property.properties) {
1099
- this.processProperties(property.properties, model[property.id], emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1100
- }
1101
- else if (property.type === 'array' && !property.properties) {
1102
- const newProperty = Object.assign({}, property);
1103
- newProperty.type = 'string';
1104
- this.processProperties([newProperty], model[property.id], emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1105
- }
1106
- else {
1107
- const validateModel = recursive ? model : model[property.id];
1108
- if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.minLength) > 0
1109
- && (validateModel === undefined || validateModel === '' || validateModel === null)) {
1110
- emptyFields.push(property);
1111
- }
1112
- else if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.minLength) > 0 && ((validateModel === null || validateModel === void 0 ? void 0 : validateModel.length) < property.minLength)) {
1113
- invalidMinLengthFields.push(property);
1114
- }
1115
- else if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.maxLength) > 0 && ((validateModel === null || validateModel === void 0 ? void 0 : validateModel.length) > property.maxLength)) {
1116
- invalidMaxLengthFields.push(property);
1117
- }
1118
- }
1119
- }
1120
- }
1121
- getErrorsStringArray(structValidation) {
1122
- return __awaiter(this, void 0, void 0, function* () {
1123
- if (!structValidation.isInvalidSchemaFields()) {
1124
- return [];
1125
- }
1126
- const errors = [];
1127
- for (const field of structValidation.emptyFields) {
1128
- const fieldName = field.title || field.id;
1129
- errors.push(this.translate.instant('COMPONENTS.STRUCT.VALIDATION_FIELDS.REQUIRED_FIELD_ERROR', { fieldName }));
1130
- }
1131
- for (const field of structValidation.invalidMinLengthFields) {
1132
- const fieldName = field.title || field.id;
1133
- errors.push(this.translate.instant('COMPONENTS.STRUCT.VALIDATION_FIELDS.MINLENGTH_FIELD_ERROR', { fieldName, minLength: field.minLength }));
1134
- }
1135
- for (const field of structValidation.invalidMaxLengthFields) {
1136
- const fieldName = field.title || field.id;
1137
- errors.push(this.translate.instant('COMPONENTS.STRUCT.VALIDATION_FIELDS.MAXLENGTH_FIELD_ERROR', { fieldName, maxLength: field.maxLength }));
1138
- }
1139
- return errors;
1140
- });
1141
- }
1142
- }
1143
- SchemaFieldsService.ɵfac = function SchemaFieldsService_Factory(t) { return new (t || SchemaFieldsService)(ɵɵinject(TranslateService)); };
1144
- SchemaFieldsService.ɵprov = ɵɵdefineInjectable({ token: SchemaFieldsService, factory: SchemaFieldsService.ɵfac });
1145
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaFieldsService, [{
1146
- type: Injectable
1094
+ class SchemaFieldsService {
1095
+ constructor(translate) {
1096
+ this.translate = translate;
1097
+ }
1098
+ validateSchemaFields(propertiesRendered, model) {
1099
+ return __awaiter(this, void 0, void 0, function* () {
1100
+ if (!propertiesRendered) {
1101
+ return new SchemaValidationField([], [], []);
1102
+ }
1103
+ const emptyFields = [];
1104
+ const invalidMinLengthFields = [];
1105
+ const invalidMaxLengthFields = [];
1106
+ this.processProperties(propertiesRendered, model, emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1107
+ const structValidationField = new SchemaValidationField(emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1108
+ structValidationField.validationErrorsLabel = yield this.getErrorsStringArray(structValidationField);
1109
+ return structValidationField;
1110
+ });
1111
+ }
1112
+ processProperties(propertiesRendered, model, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, recursive) {
1113
+ for (const property of propertiesRendered) {
1114
+ if ((property.type === 'object' || property.type === 'array') && property.properties) {
1115
+ this.processProperties(property.properties, model[property.id], emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1116
+ }
1117
+ else if (property.type === 'array' && !property.properties) {
1118
+ const newProperty = Object.assign({}, property);
1119
+ newProperty.type = 'string';
1120
+ this.processProperties([newProperty], model[property.id], emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1121
+ }
1122
+ else {
1123
+ const validateModel = recursive ? model : model[property.id];
1124
+ if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.minLength) > 0
1125
+ && (validateModel === undefined || validateModel === '' || validateModel === null)) {
1126
+ emptyFields.push(property);
1127
+ }
1128
+ else if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.minLength) > 0 && ((validateModel === null || validateModel === void 0 ? void 0 : validateModel.length) < property.minLength)) {
1129
+ invalidMinLengthFields.push(property);
1130
+ }
1131
+ else if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.maxLength) > 0 && ((validateModel === null || validateModel === void 0 ? void 0 : validateModel.length) > property.maxLength)) {
1132
+ invalidMaxLengthFields.push(property);
1133
+ }
1134
+ }
1135
+ }
1136
+ }
1137
+ getErrorsStringArray(structValidation) {
1138
+ return __awaiter(this, void 0, void 0, function* () {
1139
+ if (!structValidation.isInvalidSchemaFields()) {
1140
+ return [];
1141
+ }
1142
+ const errors = [];
1143
+ for (const field of structValidation.emptyFields) {
1144
+ const fieldName = field.title || field.id;
1145
+ errors.push(this.translate.instant('COMPONENTS.STRUCT.VALIDATION_FIELDS.REQUIRED_FIELD_ERROR', { fieldName }));
1146
+ }
1147
+ for (const field of structValidation.invalidMinLengthFields) {
1148
+ const fieldName = field.title || field.id;
1149
+ errors.push(this.translate.instant('COMPONENTS.STRUCT.VALIDATION_FIELDS.MINLENGTH_FIELD_ERROR', { fieldName, minLength: field.minLength }));
1150
+ }
1151
+ for (const field of structValidation.invalidMaxLengthFields) {
1152
+ const fieldName = field.title || field.id;
1153
+ errors.push(this.translate.instant('COMPONENTS.STRUCT.VALIDATION_FIELDS.MAXLENGTH_FIELD_ERROR', { fieldName, maxLength: field.maxLength }));
1154
+ }
1155
+ return errors;
1156
+ });
1157
+ }
1158
+ }
1159
+ SchemaFieldsService.ɵfac = function SchemaFieldsService_Factory(t) { return new (t || SchemaFieldsService)(ɵɵinject(TranslateService)); };
1160
+ SchemaFieldsService.ɵprov = ɵɵdefineInjectable({ token: SchemaFieldsService, factory: SchemaFieldsService.ɵfac });
1161
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaFieldsService, [{
1162
+ type: Injectable
1147
1163
  }], function () { return [{ type: TranslateService }]; }, null); })();
1148
1164
 
1149
- function SchemaFormRenderComponent_div_0_div_2_div_1_Template(rf, ctx) { if (rf & 1) {
1150
- const _r6 = ɵɵgetCurrentView();
1151
- ɵɵelementStart(0, "div", 6);
1152
- ɵɵelementStart(1, "div", 7);
1153
- ɵɵelementStart(2, "label", 8);
1154
- ɵɵtext(3);
1155
- ɵɵpipe(4, "translate");
1156
- ɵɵelementEnd();
1157
- ɵɵelementStart(5, "schema-custom-attributes", 9);
1158
- ɵɵlistener("modelChange", function SchemaFormRenderComponent_div_0_div_2_div_1_Template_schema_custom_attributes_modelChange_5_listener($event) { ɵɵrestoreView(_r6); const ctx_r5 = ɵɵnextContext(3); return ctx_r5.model.customAttributes = $event; });
1159
- ɵɵelementEnd();
1160
- ɵɵelementEnd();
1161
- ɵɵelementEnd();
1162
- } if (rf & 2) {
1163
- const ctx_r4 = ɵɵnextContext(3);
1164
- ɵɵadvance(3);
1165
- ɵɵtextInterpolate(ɵɵpipeBind1(4, 3, "STEP.ADDITIONAL_ATTRIBUTES"));
1166
- ɵɵadvance(2);
1167
- ɵɵproperty("model", ctx_r4.model.customAttributes)("onDropFunction", ctx_r4.onDrop);
1168
- } }
1169
- function SchemaFormRenderComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
1170
- ɵɵelementStart(0, "div", 4);
1171
- ɵɵtemplate(1, SchemaFormRenderComponent_div_0_div_2_div_1_Template, 6, 5, "div", 5);
1172
- ɵɵelementEnd();
1173
- } if (rf & 2) {
1174
- const ctx_r1 = ɵɵnextContext(2);
1175
- ɵɵadvance(1);
1176
- ɵɵproperty("ngIf", ctx_r1.model && ctx_r1.customProperties);
1177
- } }
1178
- function SchemaFormRenderComponent_div_0_Template(rf, ctx) { if (rf & 1) {
1179
- const _r8 = ɵɵgetCurrentView();
1180
- ɵɵelementStart(0, "div", 1);
1181
- ɵɵelementStart(1, "schema-form", 2);
1182
- ɵɵlistener("modelChange", function SchemaFormRenderComponent_div_0_Template_schema_form_modelChange_1_listener($event) { ɵɵrestoreView(_r8); const ctx_r7 = ɵɵnextContext(); return ctx_r7.model = $event; });
1183
- ɵɵelementEnd();
1184
- ɵɵtemplate(2, SchemaFormRenderComponent_div_0_div_2_Template, 2, 1, "div", 3);
1185
- ɵɵelementEnd();
1186
- } if (rf & 2) {
1187
- const ctx_r0 = ɵɵnextContext();
1188
- ɵɵadvance(1);
1189
- ɵɵproperty("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schemas", ctx_r0.schemas)("editing", ctx_r0.editing);
1190
- ɵɵadvance(1);
1191
- ɵɵproperty("ngForOf", ctx_r0.schemas);
1192
- } }
1193
- class SchemaFormRenderComponent extends BaseSchemaComponent {
1194
- constructor() {
1195
- super(...arguments);
1196
- this.schemas = [];
1197
- this.customProperties = false;
1198
- this.editing = false;
1199
- this.loaded = false;
1200
- }
1201
- ngAfterContentInit() {
1202
- this.loaded = true;
1203
- console.log('SchemaFormRenderComponent schemas', this.schemas);
1204
- }
1205
- onDrop($event, modelElement) {
1206
- return onDropStruct($event, modelElement);
1207
- }
1208
- getId(index) {
1209
- return `${this.idPrefix}-struct-${index}`;
1210
- }
1211
- }
1212
- SchemaFormRenderComponent.ɵfac = function SchemaFormRenderComponent_Factory(t) { return ɵSchemaFormRenderComponent_BaseFactory(t || SchemaFormRenderComponent); };
1213
- SchemaFormRenderComponent.ɵcmp = ɵɵdefineComponent({ type: SchemaFormRenderComponent, selectors: [["schema-form-render"]], inputs: { idPrefix: "idPrefix", schemas: "schemas", customProperties: "customProperties", editing: "editing", inputType: "inputType" }, features: [ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "schema", 4, "ngIf"], [1, "schema"], [3, "idPrefix", "model", "schemas", "editing", "modelChange"], ["class", "schema-properties", 4, "ngFor", "ngForOf"], [1, "schema-properties"], ["class", "row struct-custom-properties", 4, "ngIf"], [1, "row", "struct-custom-properties"], [1, "col-md-12"], [1, "info-label", "bold"], [3, "model", "onDropFunction", "modelChange"]], template: function SchemaFormRenderComponent_Template(rf, ctx) { if (rf & 1) {
1214
- ɵɵtemplate(0, SchemaFormRenderComponent_div_0_Template, 3, 5, "div", 0);
1215
- } if (rf & 2) {
1216
- ɵɵproperty("ngIf", ctx.loaded);
1217
- } }, directives: [NgIf, SchemaFormComponent, NgForOf, SchemaCustomAttributesComponent], pipes: [TranslatePipe], styles: [".schema[_ngcontent-%COMP%] .info-label{display:block}.schema[_ngcontent-%COMP%] input.form-control{background:#fff;border:1px solid #ddd;border-radius:3px;padding:11px;width:100%}.schema[_ngcontent-%COMP%] select.form-control{border:1px solid #ddd;border-radius:4px;color:#777;cursor:pointer;padding:11px;width:100%}.schema[_ngcontent-%COMP%] .ng-select-container{height:38px!important;min-height:38px!important}.schema[_ngcontent-%COMP%] .btn-outline-primary{background:var(--color-primary);border:1px solid var(--color-secondary);border-radius:4px;color:var(--color-secondary);cursor:pointer;padding:5px 15px}.schema[_ngcontent-%COMP%] .btn-outline-primary:hover{background:var(--color-primary-hover)}.schema[_ngcontent-%COMP%] .subsection-item-title, .schema[_ngcontent-%COMP%] array-session .subsection-element{color:var(--color-primary)}"] });
1218
- const ɵSchemaFormRenderComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaFormRenderComponent);
1219
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaFormRenderComponent, [{
1220
- type: Component,
1221
- args: [{
1222
- selector: 'schema-form-render',
1223
- templateUrl: 'schema-form-render.html',
1224
- styleUrls: ['./schema-form-render.scss']
1225
- }]
1226
- }], null, { idPrefix: [{
1227
- type: Input
1228
- }], schemas: [{
1229
- type: Input
1230
- }], customProperties: [{
1231
- type: Input
1232
- }], editing: [{
1233
- type: Input
1234
- }], inputType: [{
1235
- type: Input
1165
+ function SchemaFormRenderComponent_div_0_div_2_div_1_Template(rf, ctx) { if (rf & 1) {
1166
+ const _r6 = ɵɵgetCurrentView();
1167
+ ɵɵelementStart(0, "div", 6);
1168
+ ɵɵelementStart(1, "div", 7);
1169
+ ɵɵelementStart(2, "label", 8);
1170
+ ɵɵtext(3);
1171
+ ɵɵpipe(4, "translate");
1172
+ ɵɵelementEnd();
1173
+ ɵɵelementStart(5, "schema-custom-attributes", 9);
1174
+ ɵɵlistener("modelChange", function SchemaFormRenderComponent_div_0_div_2_div_1_Template_schema_custom_attributes_modelChange_5_listener($event) { ɵɵrestoreView(_r6); const ctx_r5 = ɵɵnextContext(3); return ctx_r5.model.customAttributes = $event; });
1175
+ ɵɵelementEnd();
1176
+ ɵɵelementEnd();
1177
+ ɵɵelementEnd();
1178
+ } if (rf & 2) {
1179
+ const ctx_r4 = ɵɵnextContext(3);
1180
+ ɵɵadvance(3);
1181
+ ɵɵtextInterpolate(ɵɵpipeBind1(4, 3, "STEP.ADDITIONAL_ATTRIBUTES"));
1182
+ ɵɵadvance(2);
1183
+ ɵɵproperty("model", ctx_r4.model.customAttributes)("onDropFunction", ctx_r4.onDrop);
1184
+ } }
1185
+ function SchemaFormRenderComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
1186
+ ɵɵelementStart(0, "div", 4);
1187
+ ɵɵtemplate(1, SchemaFormRenderComponent_div_0_div_2_div_1_Template, 6, 5, "div", 5);
1188
+ ɵɵelementEnd();
1189
+ } if (rf & 2) {
1190
+ const ctx_r1 = ɵɵnextContext(2);
1191
+ ɵɵadvance(1);
1192
+ ɵɵproperty("ngIf", ctx_r1.model && ctx_r1.customProperties);
1193
+ } }
1194
+ function SchemaFormRenderComponent_div_0_Template(rf, ctx) { if (rf & 1) {
1195
+ const _r8 = ɵɵgetCurrentView();
1196
+ ɵɵelementStart(0, "div", 1);
1197
+ ɵɵelementStart(1, "schema-form", 2);
1198
+ ɵɵlistener("modelChange", function SchemaFormRenderComponent_div_0_Template_schema_form_modelChange_1_listener($event) { ɵɵrestoreView(_r8); const ctx_r7 = ɵɵnextContext(); return ctx_r7.model = $event; });
1199
+ ɵɵelementEnd();
1200
+ ɵɵtemplate(2, SchemaFormRenderComponent_div_0_div_2_Template, 2, 1, "div", 3);
1201
+ ɵɵelementEnd();
1202
+ } if (rf & 2) {
1203
+ const ctx_r0 = ɵɵnextContext();
1204
+ ɵɵadvance(1);
1205
+ ɵɵproperty("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schemas", ctx_r0.schemas)("editing", ctx_r0.editing);
1206
+ ɵɵadvance(1);
1207
+ ɵɵproperty("ngForOf", ctx_r0.schemas);
1208
+ } }
1209
+ class SchemaFormRenderComponent extends BaseSchemaComponent {
1210
+ constructor() {
1211
+ super(...arguments);
1212
+ this.schemas = [];
1213
+ this.customProperties = false;
1214
+ this.editing = false;
1215
+ this.loaded = false;
1216
+ }
1217
+ ngAfterContentInit() {
1218
+ this.loaded = true;
1219
+ }
1220
+ onDrop($event, modelElement) {
1221
+ return onDropStruct($event, modelElement);
1222
+ }
1223
+ getId(index) {
1224
+ return `${this.idPrefix}-struct-${index}`;
1225
+ }
1226
+ }
1227
+ SchemaFormRenderComponent.ɵfac = function SchemaFormRenderComponent_Factory(t) { return ɵSchemaFormRenderComponent_BaseFactory(t || SchemaFormRenderComponent); };
1228
+ SchemaFormRenderComponent.ɵcmp = ɵɵdefineComponent({ type: SchemaFormRenderComponent, selectors: [["schema-form-render"]], inputs: { idPrefix: "idPrefix", schemas: "schemas", customProperties: "customProperties", editing: "editing", inputType: "inputType" }, features: [ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "schema", 4, "ngIf"], [1, "schema"], [3, "idPrefix", "model", "schemas", "editing", "modelChange"], ["class", "schema-properties", 4, "ngFor", "ngForOf"], [1, "schema-properties"], ["class", "row struct-custom-properties", 4, "ngIf"], [1, "row", "struct-custom-properties"], [1, "col-md-12"], [1, "info-label", "bold"], [3, "model", "onDropFunction", "modelChange"]], template: function SchemaFormRenderComponent_Template(rf, ctx) { if (rf & 1) {
1229
+ ɵɵtemplate(0, SchemaFormRenderComponent_div_0_Template, 3, 5, "div", 0);
1230
+ } if (rf & 2) {
1231
+ ɵɵproperty("ngIf", ctx.loaded);
1232
+ } }, directives: [NgIf, SchemaFormComponent, NgForOf, SchemaCustomAttributesComponent], pipes: [TranslatePipe], styles: [".schema[_ngcontent-%COMP%] .info-label{display:block}.schema[_ngcontent-%COMP%] input.form-control{background:#fff;border:1px solid #ddd;border-radius:3px;padding:11px;width:100%}.schema[_ngcontent-%COMP%] select.form-control{border:1px solid #ddd;border-radius:4px;color:#777;cursor:pointer;padding:11px;width:100%}.schema[_ngcontent-%COMP%] .ng-select-container{height:38px!important;min-height:38px!important}.schema[_ngcontent-%COMP%] .btn-outline-primary{background:var(--color-primary);border:1px solid var(--color-secondary);border-radius:4px;color:var(--color-secondary);cursor:pointer;padding:5px 15px}.schema[_ngcontent-%COMP%] .btn-outline-primary:hover{background:var(--color-primary-hover)}.schema[_ngcontent-%COMP%] .subsection-item-title, .schema[_ngcontent-%COMP%] array-session .subsection-element{color:var(--color-primary)}"] });
1233
+ const ɵSchemaFormRenderComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaFormRenderComponent);
1234
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaFormRenderComponent, [{
1235
+ type: Component,
1236
+ args: [{
1237
+ selector: 'schema-form-render',
1238
+ templateUrl: 'schema-form-render.html',
1239
+ styleUrls: ['./schema-form-render.scss']
1240
+ }]
1241
+ }], null, { idPrefix: [{
1242
+ type: Input
1243
+ }], schemas: [{
1244
+ type: Input
1245
+ }], customProperties: [{
1246
+ type: Input
1247
+ }], editing: [{
1248
+ type: Input
1249
+ }], inputType: [{
1250
+ type: Input
1236
1251
  }] }); })();
1237
1252
 
1238
- class SchemaFormRenderModule {
1239
- }
1240
- SchemaFormRenderModule.ɵmod = ɵɵdefineNgModule({ type: SchemaFormRenderModule });
1241
- SchemaFormRenderModule.ɵinj = ɵɵdefineInjector({ factory: function SchemaFormRenderModule_Factory(t) { return new (t || SchemaFormRenderModule)(); }, providers: [
1242
- SchemaFieldsService
1243
- ], imports: [[
1244
- CommonModule,
1245
- DndModule,
1246
- FormsModule,
1247
- MatTooltipModule,
1248
- TranslateModule,
1249
- InputsModule
1250
- ]] });
1251
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(SchemaFormRenderModule, { declarations: [ArraySessionComponent,
1252
- SchemaArrayComponent,
1253
- FieldRenderComponent,
1254
- InputRenderComponent,
1255
- BooleanInputComponent,
1256
- NumberInputComponent,
1257
- SchemaInputComponent,
1258
- SchemaObjectComponent,
1259
- SchemaFormRenderComponent,
1260
- SchemaFormComponent,
1261
- SchemaCustomAttributesComponent], imports: [CommonModule,
1262
- DndModule,
1263
- FormsModule,
1264
- MatTooltipModule,
1265
- TranslateModule,
1266
- InputsModule], exports: [ArraySessionComponent,
1267
- SchemaArrayComponent,
1268
- FieldRenderComponent,
1269
- InputRenderComponent,
1270
- BooleanInputComponent,
1271
- NumberInputComponent,
1272
- SchemaInputComponent,
1273
- SchemaObjectComponent,
1274
- SchemaFormRenderComponent,
1275
- SchemaFormComponent,
1276
- SchemaCustomAttributesComponent] }); })();
1277
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaFormRenderModule, [{
1278
- type: NgModule,
1279
- args: [{
1280
- imports: [
1281
- CommonModule,
1282
- DndModule,
1283
- FormsModule,
1284
- MatTooltipModule,
1285
- TranslateModule,
1286
- InputsModule
1287
- ],
1288
- declarations: [
1289
- ArraySessionComponent,
1290
- SchemaArrayComponent,
1291
- FieldRenderComponent,
1292
- InputRenderComponent,
1293
- BooleanInputComponent,
1294
- NumberInputComponent,
1295
- SchemaInputComponent,
1296
- SchemaObjectComponent,
1297
- SchemaFormRenderComponent,
1298
- SchemaFormComponent,
1299
- SchemaCustomAttributesComponent
1300
- ],
1301
- exports: [
1302
- ArraySessionComponent,
1303
- SchemaArrayComponent,
1304
- FieldRenderComponent,
1305
- InputRenderComponent,
1306
- BooleanInputComponent,
1307
- NumberInputComponent,
1308
- SchemaInputComponent,
1309
- SchemaObjectComponent,
1310
- SchemaFormRenderComponent,
1311
- SchemaFormComponent,
1312
- SchemaCustomAttributesComponent
1313
- ],
1314
- providers: [
1315
- SchemaFieldsService
1316
- ]
1317
- }]
1318
- }], null, null); })();
1319
- ɵɵsetComponentScope(SchemaFormComponent, [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, DndDraggableDirective, DndDropzoneDirective, DndHandleDirective, DndPlaceholderRefDirective, DndDragImageRefDirective, ɵangular_packages_forms_forms_y, NgSelectOption, ɵangular_packages_forms_forms_x, DefaultValueAccessor, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatus, NgControlStatusGroup, RequiredValidator, MinLengthValidator, MaxLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator, NgModel, NgModelGroup, NgForm, MatTooltip, TooltipComponent, Dir, CdkScrollable, TranslateDirective, SelectBoxComponent, SelectEnumComponent, InputTextComponent, InputPasswordComponent, InputAvatarComponent, InputFileComponent, CustomSelectComponent, FieldComponent, ArraySessionComponent,
1320
- SchemaArrayComponent,
1321
- FieldRenderComponent,
1322
- InputRenderComponent,
1323
- BooleanInputComponent,
1324
- NumberInputComponent,
1325
- SchemaInputComponent,
1326
- SchemaObjectComponent,
1327
- SchemaFormRenderComponent,
1328
- SchemaFormComponent,
1253
+ class SchemaFormRenderModule {
1254
+ }
1255
+ SchemaFormRenderModule.ɵmod = ɵɵdefineNgModule({ type: SchemaFormRenderModule });
1256
+ SchemaFormRenderModule.ɵinj = ɵɵdefineInjector({ factory: function SchemaFormRenderModule_Factory(t) { return new (t || SchemaFormRenderModule)(); }, providers: [
1257
+ SchemaFieldsService
1258
+ ], imports: [[
1259
+ CommonModule,
1260
+ DndModule,
1261
+ FormsModule,
1262
+ MatTooltipModule,
1263
+ TranslateModule,
1264
+ InputsModule
1265
+ ]] });
1266
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(SchemaFormRenderModule, { declarations: [ArraySessionComponent,
1267
+ SchemaArrayComponent,
1268
+ FieldRenderComponent,
1269
+ InputRenderComponent,
1270
+ BooleanInputComponent,
1271
+ NumberInputComponent,
1272
+ SchemaInputComponent,
1273
+ SchemaObjectComponent,
1274
+ SchemaFormRenderComponent,
1275
+ SchemaFormComponent,
1276
+ SchemaCustomAttributesComponent], imports: [CommonModule,
1277
+ DndModule,
1278
+ FormsModule,
1279
+ MatTooltipModule,
1280
+ TranslateModule,
1281
+ InputsModule], exports: [ArraySessionComponent,
1282
+ SchemaArrayComponent,
1283
+ FieldRenderComponent,
1284
+ InputRenderComponent,
1285
+ BooleanInputComponent,
1286
+ NumberInputComponent,
1287
+ SchemaInputComponent,
1288
+ SchemaObjectComponent,
1289
+ SchemaFormRenderComponent,
1290
+ SchemaFormComponent,
1291
+ SchemaCustomAttributesComponent] }); })();
1292
+ /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaFormRenderModule, [{
1293
+ type: NgModule,
1294
+ args: [{
1295
+ imports: [
1296
+ CommonModule,
1297
+ DndModule,
1298
+ FormsModule,
1299
+ MatTooltipModule,
1300
+ TranslateModule,
1301
+ InputsModule
1302
+ ],
1303
+ declarations: [
1304
+ ArraySessionComponent,
1305
+ SchemaArrayComponent,
1306
+ FieldRenderComponent,
1307
+ InputRenderComponent,
1308
+ BooleanInputComponent,
1309
+ NumberInputComponent,
1310
+ SchemaInputComponent,
1311
+ SchemaObjectComponent,
1312
+ SchemaFormRenderComponent,
1313
+ SchemaFormComponent,
1314
+ SchemaCustomAttributesComponent
1315
+ ],
1316
+ exports: [
1317
+ ArraySessionComponent,
1318
+ SchemaArrayComponent,
1319
+ FieldRenderComponent,
1320
+ InputRenderComponent,
1321
+ BooleanInputComponent,
1322
+ NumberInputComponent,
1323
+ SchemaInputComponent,
1324
+ SchemaObjectComponent,
1325
+ SchemaFormRenderComponent,
1326
+ SchemaFormComponent,
1327
+ SchemaCustomAttributesComponent
1328
+ ],
1329
+ providers: [
1330
+ SchemaFieldsService
1331
+ ]
1332
+ }]
1333
+ }], null, null); })();
1334
+ ɵɵsetComponentScope(SchemaFormComponent, [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, DndDraggableDirective, DndDropzoneDirective, DndHandleDirective, DndPlaceholderRefDirective, DndDragImageRefDirective, ɵangular_packages_forms_forms_y, NgSelectOption, ɵangular_packages_forms_forms_x, DefaultValueAccessor, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatus, NgControlStatusGroup, RequiredValidator, MinLengthValidator, MaxLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator, NgModel, NgModelGroup, NgForm, MatTooltip, TooltipComponent, Dir, CdkScrollable, TranslateDirective, SelectBoxComponent, SelectEnumComponent, InputTextComponent, InputPasswordComponent, InputAvatarComponent, InputFileComponent, CustomSelectComponent, FieldComponent, ArraySessionComponent,
1335
+ SchemaArrayComponent,
1336
+ FieldRenderComponent,
1337
+ InputRenderComponent,
1338
+ BooleanInputComponent,
1339
+ NumberInputComponent,
1340
+ SchemaInputComponent,
1341
+ SchemaObjectComponent,
1342
+ SchemaFormRenderComponent,
1343
+ SchemaFormComponent,
1329
1344
  SchemaCustomAttributesComponent], [AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe, TranslatePipe]);
1330
1345
 
1331
- class TypeScriptCompile {
1332
- static addItemToFormProperties(formProperties, item, key) {
1333
- if (item.minLength && item.minLength > 0) {
1334
- formProperties[key] = new FormControl([null, [Validators.required]]);
1335
- }
1336
- else {
1337
- formProperties[key] = new FormControl([null]);
1338
- }
1339
- }
1340
- static compileProperties(input) {
1341
- const compiledProperties = [];
1342
- const formProperties = {};
1343
- let inputData = {};
1344
- const inputToCompile = JSON.parse(JSON.stringify(input));
1345
- if (inputToCompile.properties) {
1346
- if (inputToCompile.type === 'array') {
1347
- inputData = [];
1348
- }
1349
- if (inputToCompile.type === 'object') {
1350
- inputData = {};
1351
- }
1352
- inputToCompile.id = 'inputData';
1353
- this.proccessProperties(inputToCompile, formProperties, 'inputData');
1354
- compiledProperties.push(inputToCompile);
1355
- }
1356
- else if (inputToCompile.type === 'array') {
1357
- inputToCompile.id = 'inputData';
1358
- inputData = [];
1359
- TypeScriptCompile.addItemToFormProperties(formProperties, inputToCompile, 'inputData');
1360
- compiledProperties.push(inputToCompile);
1361
- }
1362
- else if (!inputToCompile.type) {
1363
- for (let index = 0; index < Object.keys(inputToCompile).length; index++) {
1364
- const key = Object.keys(inputToCompile)[index];
1365
- const item = inputToCompile[key];
1366
- item.id = key;
1367
- if (item.type === 'array') {
1368
- inputData[item.id] = [];
1369
- }
1370
- if (item.type === 'object') {
1371
- inputData[item.id] = {};
1372
- }
1373
- this.proccessProperties(item, formProperties, key);
1374
- compiledProperties.push(item);
1375
- }
1376
- }
1377
- compiledProperties.sort((a, b) => a.propertyOrder - b.propertyOrder);
1378
- return { compiledProperties, formProperties, inputData };
1379
- }
1380
- static proccessProperties(item, formProperties, key) {
1381
- if (this.hasProperties(item)) {
1382
- const arFieldsChild = [];
1383
- for (let indexChild = 0; indexChild < Object.keys(item.properties).length; indexChild++) {
1384
- const keyChild = Object.keys(item.properties)[indexChild];
1385
- const itemChild = item.properties[keyChild];
1386
- itemChild.id = keyChild;
1387
- if (this.hasProperties(itemChild)) {
1388
- this.proccessProperties(itemChild, formProperties, keyChild);
1389
- arFieldsChild.push(itemChild);
1390
- }
1391
- else {
1392
- TypeScriptCompile.addItemToFormProperties(formProperties, itemChild, keyChild);
1393
- arFieldsChild.push(itemChild);
1394
- }
1395
- }
1396
- item.properties = arFieldsChild;
1397
- }
1398
- else {
1399
- TypeScriptCompile.addItemToFormProperties(formProperties, item, key);
1400
- }
1401
- }
1402
- static hasProperties(item) {
1403
- return item.type === 'object' || (item.type === 'array' && item.properties);
1404
- }
1346
+ class TypeScriptCompile {
1347
+ static addItemToFormProperties(formProperties, item, key) {
1348
+ if (item.minLength && item.minLength > 0) {
1349
+ formProperties[key] = new FormControl([null, [Validators.required]]);
1350
+ }
1351
+ else {
1352
+ formProperties[key] = new FormControl([null]);
1353
+ }
1354
+ }
1355
+ static compileProperties(input) {
1356
+ const compiledProperties = [];
1357
+ const formProperties = {};
1358
+ let inputData = {};
1359
+ const inputToCompile = JSON.parse(JSON.stringify(input));
1360
+ if (inputToCompile.properties) {
1361
+ if (inputToCompile.type === 'array') {
1362
+ inputData = [];
1363
+ }
1364
+ if (inputToCompile.type === 'object') {
1365
+ inputData = {};
1366
+ }
1367
+ inputToCompile.id = 'inputData';
1368
+ this.proccessProperties(inputToCompile, formProperties, 'inputData');
1369
+ compiledProperties.push(inputToCompile);
1370
+ }
1371
+ else if (inputToCompile.type === 'array') {
1372
+ inputToCompile.id = 'inputData';
1373
+ inputData = [];
1374
+ TypeScriptCompile.addItemToFormProperties(formProperties, inputToCompile, 'inputData');
1375
+ compiledProperties.push(inputToCompile);
1376
+ }
1377
+ else if (!inputToCompile.type) {
1378
+ for (let index = 0; index < Object.keys(inputToCompile).length; index++) {
1379
+ const key = Object.keys(inputToCompile)[index];
1380
+ const item = inputToCompile[key];
1381
+ item.id = key;
1382
+ if (item.type === 'array') {
1383
+ inputData[item.id] = [];
1384
+ }
1385
+ if (item.type === 'object') {
1386
+ inputData[item.id] = {};
1387
+ }
1388
+ this.proccessProperties(item, formProperties, key);
1389
+ compiledProperties.push(item);
1390
+ }
1391
+ }
1392
+ compiledProperties.sort((a, b) => a.propertyOrder - b.propertyOrder);
1393
+ return { compiledProperties, formProperties, inputData };
1394
+ }
1395
+ static proccessProperties(item, formProperties, key) {
1396
+ if (this.hasProperties(item)) {
1397
+ const arFieldsChild = [];
1398
+ for (let indexChild = 0; indexChild < Object.keys(item.properties).length; indexChild++) {
1399
+ const keyChild = Object.keys(item.properties)[indexChild];
1400
+ const itemChild = item.properties[keyChild];
1401
+ itemChild.id = keyChild;
1402
+ if (this.hasProperties(itemChild)) {
1403
+ this.proccessProperties(itemChild, formProperties, keyChild);
1404
+ arFieldsChild.push(itemChild);
1405
+ }
1406
+ else {
1407
+ TypeScriptCompile.addItemToFormProperties(formProperties, itemChild, keyChild);
1408
+ arFieldsChild.push(itemChild);
1409
+ }
1410
+ }
1411
+ item.properties = arFieldsChild;
1412
+ }
1413
+ else {
1414
+ TypeScriptCompile.addItemToFormProperties(formProperties, item, key);
1415
+ }
1416
+ }
1417
+ static hasProperties(item) {
1418
+ return item.type === 'object' || (item.type === 'array' && item.properties);
1419
+ }
1405
1420
  }
1406
1421
 
1407
- /**
1408
- * Generated bundle index. Do not edit.
1422
+ /**
1423
+ * Generated bundle index. Do not edit.
1409
1424
  */
1410
1425
 
1411
1426
  export { ArraySessionComponent, BaseSchemaComponent, BooleanInputComponent, FieldRenderComponent, InputRenderComponent, NumberInputComponent, SchemaArrayComponent, SchemaCustomAttributesComponent, SchemaFieldsService, SchemaFormComponent, SchemaFormRenderComponent, SchemaFormRenderModule, SchemaInputComponent, SchemaObjectComponent, SchemaValidationField, TypeScriptCompile };