@apipass/schemas 1.0.7 → 1.0.8

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 (57) hide show
  1. package/base-schema.component.d.ts +12 -12
  2. package/{esm2020 → esm2022}/apipass-schemas.mjs +4 -4
  3. package/esm2022/base-schema.component.mjs +38 -0
  4. package/{esm2020 → esm2022}/public-api.mjs +16 -16
  5. package/{esm2020 → esm2022}/schema-custom-attributes/schema-custom-attributes.mjs +169 -169
  6. package/esm2022/schema-fields.service.mjs +81 -0
  7. package/esm2022/schema-form/schema-array/array-session/array-session.mjs +141 -0
  8. package/{esm2020 → esm2022}/schema-form/schema-array/schema-array.mjs +219 -220
  9. package/esm2022/schema-form/schema-form.mjs +107 -0
  10. package/esm2022/schema-form/schema-input/field-render/field-render.mjs +76 -0
  11. package/esm2022/schema-form/schema-input/input-render/boolean-input/boolean-input.component.mjs +51 -0
  12. package/esm2022/schema-form/schema-input/input-render/input-render.mjs +193 -0
  13. package/esm2022/schema-form/schema-input/input-render/number-input/number-input.component.mjs +49 -0
  14. package/esm2022/schema-form/schema-input/schema-input.mjs +95 -0
  15. package/esm2022/schema-form/schema-object/schema-object.mjs +125 -0
  16. package/esm2022/schema-form-render.mjs +126 -0
  17. package/{esm2020 → esm2022}/schema-form-render.module.mjs +109 -108
  18. package/esm2022/schema-validation-field.mjs +18 -0
  19. package/{esm2020 → esm2022}/struct.utils.mjs +8 -8
  20. package/esm2022/type-script-compile/type-script-compile.base.mjs +115 -0
  21. package/{fesm2020 → fesm2022}/apipass-schemas.mjs +1571 -1563
  22. package/fesm2022/apipass-schemas.mjs.map +1 -0
  23. package/index.d.ts +5 -5
  24. package/package.json +15 -21
  25. package/public-api.d.ts +16 -16
  26. package/schema-custom-attributes/schema-custom-attributes.d.ts +21 -21
  27. package/schema-fields.service.d.ts +14 -14
  28. package/schema-form/schema-array/array-session/array-session.d.ts +19 -19
  29. package/schema-form/schema-array/schema-array.d.ts +31 -32
  30. package/schema-form/schema-form.d.ts +31 -31
  31. package/schema-form/schema-input/field-render/field-render.d.ts +16 -16
  32. package/schema-form/schema-input/input-render/boolean-input/boolean-input.component.d.ts +15 -15
  33. package/schema-form/schema-input/input-render/input-render.d.ts +29 -29
  34. package/schema-form/schema-input/input-render/number-input/number-input.component.d.ts +15 -15
  35. package/schema-form/schema-input/schema-input.d.ts +18 -19
  36. package/schema-form/schema-object/schema-object.d.ts +34 -34
  37. package/schema-form-render.d.ts +31 -31
  38. package/schema-form-render.module.d.ts +23 -23
  39. package/schema-validation-field.d.ts +23 -23
  40. package/struct.utils.d.ts +1 -1
  41. package/type-script-compile/type-script-compile.base.d.ts +17 -17
  42. package/esm2020/base-schema.component.mjs +0 -37
  43. package/esm2020/schema-fields.service.mjs +0 -80
  44. package/esm2020/schema-form/schema-array/array-session/array-session.mjs +0 -143
  45. package/esm2020/schema-form/schema-form.mjs +0 -107
  46. package/esm2020/schema-form/schema-input/field-render/field-render.mjs +0 -69
  47. package/esm2020/schema-form/schema-input/input-render/boolean-input/boolean-input.component.mjs +0 -46
  48. package/esm2020/schema-form/schema-input/input-render/input-render.mjs +0 -192
  49. package/esm2020/schema-form/schema-input/input-render/number-input/number-input.component.mjs +0 -44
  50. package/esm2020/schema-form/schema-input/schema-input.mjs +0 -96
  51. package/esm2020/schema-form/schema-object/schema-object.mjs +0 -123
  52. package/esm2020/schema-form-render.mjs +0 -126
  53. package/esm2020/schema-validation-field.mjs +0 -14
  54. package/esm2020/type-script-compile/type-script-compile.base.mjs +0 -114
  55. package/fesm2015/apipass-schemas.mjs +0 -1801
  56. package/fesm2015/apipass-schemas.mjs.map +0 -1
  57. package/fesm2020/apipass-schemas.mjs.map +0 -1
@@ -13,1603 +13,1611 @@ import { InputsModule } from '@apipass/inputs';
13
13
  import * as i5 from '@apipass/icons';
14
14
  import { IconsModule } from '@apipass/icons';
15
15
 
16
- class BaseSchemaComponent {
17
- constructor() {
18
- this.modelChange = new EventEmitter();
19
- }
20
- getSchemaProperties() {
21
- return this.schema.properties instanceof Array ? this.schema.properties : [this.schema.properties];
22
- }
23
- canRender(property) {
24
- property.canRender = property?.conditionExpression ? eval(property.conditionExpression) : true;
25
- return property.canRender;
26
- }
27
- onDrop(event, attr) {
28
- const data = event.data;
29
- if (!attr) {
30
- attr = '';
31
- }
32
- attr += `{{${data}}}`;
33
- return attr;
34
- }
35
- }
36
- BaseSchemaComponent.ɵfac = function BaseSchemaComponent_Factory(t) { return new (t || BaseSchemaComponent)(); };
37
- BaseSchemaComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵ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 });
38
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseSchemaComponent, [{
39
- type: Component,
40
- args: [{
41
- template: ''
42
- }]
43
- }], null, { model: [{
44
- type: Input
45
- }], schema: [{
46
- type: Input
47
- }], modelChange: [{
48
- type: Output
16
+ class BaseSchemaComponent {
17
+ model;
18
+ schema;
19
+ modelChange = new EventEmitter();
20
+ getSchemaProperties() {
21
+ return this.schema.properties instanceof Array ? this.schema.properties : [this.schema.properties];
22
+ }
23
+ canRender(property) {
24
+ property.canRender = property?.conditionExpression ? eval(property.conditionExpression) : true;
25
+ return property.canRender;
26
+ }
27
+ onDrop(event, attr) {
28
+ const data = event.data;
29
+ if (!attr) {
30
+ attr = '';
31
+ }
32
+ attr += `{{${data}}}`;
33
+ return attr;
34
+ }
35
+ static ɵfac = function BaseSchemaComponent_Factory(t) { return new (t || BaseSchemaComponent)(); };
36
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵ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 });
37
+ }
38
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseSchemaComponent, [{
39
+ type: Component,
40
+ args: [{
41
+ template: ''
42
+ }]
43
+ }], null, { model: [{
44
+ type: Input
45
+ }], schema: [{
46
+ type: Input
47
+ }], modelChange: [{
48
+ type: Output
49
49
  }] }); })();
50
50
 
51
- function onDropStruct(event, attr) {
52
- const data = event.data;
53
- if (!attr) {
54
- attr = '';
55
- }
56
- attr += `{{${data}}}`;
57
- return attr;
51
+ function onDropStruct(event, attr) {
52
+ const data = event.data;
53
+ if (!attr) {
54
+ attr = '';
55
+ }
56
+ attr += `{{${data}}}`;
57
+ return attr;
58
58
  }
59
59
 
60
- const _c0$6 = function () { return { standalone: true }; };
61
- function ArraySessionComponent_div_4_div_4_Template(rf, ctx) { if (rf & 1) {
62
- const _r8 = i0.ɵɵgetCurrentView();
63
- i0.ɵɵelementStart(0, "div", 0)(1, "div", 12)(2, "label", 13);
64
- i0.ɵɵtext(3, "Loop");
65
- i0.ɵɵelementEnd();
66
- i0.ɵɵelementStart(4, "input", 14);
67
- i0.ɵɵlistener("ngModelChange", function ArraySessionComponent_div_4_div_4_Template_input_ngModelChange_4_listener($event) { i0.ɵɵrestoreView(_r8); const item_r2 = i0.ɵɵnextContext().$implicit; return i0.ɵɵresetView(item_r2.loop = $event); })("dndDrop", function ArraySessionComponent_div_4_div_4_Template_input_dndDrop_4_listener($event) { i0.ɵɵrestoreView(_r8); const item_r2 = i0.ɵɵnextContext().$implicit; const ctx_r9 = i0.ɵɵnextContext(); return i0.ɵɵresetView(item_r2.loop = ctx_r9.onDrop($event, item_r2.loop)); });
68
- i0.ɵɵelementEnd()();
69
- i0.ɵɵelementStart(5, "div", 15)(6, "label", 13);
70
- i0.ɵɵtext(7, "Alias");
71
- i0.ɵɵelementEnd();
72
- i0.ɵɵelementStart(8, "input", 14);
73
- i0.ɵɵlistener("ngModelChange", function ArraySessionComponent_div_4_div_4_Template_input_ngModelChange_8_listener($event) { i0.ɵɵrestoreView(_r8); const item_r2 = i0.ɵɵnextContext().$implicit; return i0.ɵɵresetView(item_r2.alias = $event); })("dndDrop", function ArraySessionComponent_div_4_div_4_Template_input_dndDrop_8_listener($event) { i0.ɵɵrestoreView(_r8); const item_r2 = i0.ɵɵnextContext().$implicit; const ctx_r13 = i0.ɵɵnextContext(); return i0.ɵɵresetView(item_r2.alias = ctx_r13.onDrop($event, item_r2.alias)); });
74
- i0.ɵɵelementEnd()()();
75
- } if (rf & 2) {
76
- const item_r2 = i0.ɵɵnextContext().$implicit;
77
- i0.ɵɵadvance(4);
78
- i0.ɵɵproperty("ngModel", item_r2.loop)("ngModelOptions", i0.ɵɵpureFunction0(4, _c0$6));
79
- i0.ɵɵadvance(4);
80
- i0.ɵɵproperty("ngModel", item_r2.alias)("ngModelOptions", i0.ɵɵpureFunction0(5, _c0$6));
81
- } }
82
- function ArraySessionComponent_div_4_ng_container_5_Template(rf, ctx) { if (rf & 1) {
83
- i0.ɵɵelementContainer(0);
84
- } }
85
- const _c1$2 = function (a0, a1, a2) { return { items: a0, index: a1, mappingAttributes: a2 }; };
86
- const _c2 = function (a0) { return { $implicit: a0 }; };
87
- function ArraySessionComponent_div_4_Template(rf, ctx) { if (rf & 1) {
88
- const _r17 = i0.ɵɵgetCurrentView();
89
- i0.ɵɵelementStart(0, "div", 7)(1, "div", 8);
90
- i0.ɵɵtext(2);
91
- i0.ɵɵelementStart(3, "i", 9);
92
- i0.ɵɵlistener("click", function ArraySessionComponent_div_4_Template_i_click_3_listener() { const restoredCtx = i0.ɵɵrestoreView(_r17); const item_r2 = restoredCtx.$implicit; const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.remove(item_r2)); });
93
- i0.ɵɵelementEnd()();
94
- i0.ɵɵtemplate(4, ArraySessionComponent_div_4_div_4_Template, 9, 6, "div", 10);
95
- i0.ɵɵtemplate(5, ArraySessionComponent_div_4_ng_container_5_Template, 1, 0, "ng-container", 11);
96
- i0.ɵɵelementEnd();
97
- } if (rf & 2) {
98
- const item_r2 = ctx.$implicit;
99
- const index_r3 = ctx.index;
100
- const ctx_r0 = i0.ɵɵnextContext();
101
- i0.ɵɵadvance(2);
102
- i0.ɵɵtextInterpolate2("", ctx_r0.removeLabel, " ", index_r3 + 1, " ");
103
- i0.ɵɵadvance(2);
104
- i0.ɵɵproperty("ngIf", item_r2.mappingAttributes || item_r2.mappingAttributes === "");
105
- i0.ɵɵadvance(1);
106
- i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.subsectionItem)("ngTemplateOutletContext", i0.ɵɵpureFunction1(9, _c2, i0.ɵɵpureFunction3(5, _c1$2, ctx_r0.model, index_r3, item_r2.mappingAttributes || item_r2.mappingAttributes === "" ? item_r2.mappingAttributes : item_r2)));
107
- } }
108
- function ArraySessionComponent_button_9_Template(rf, ctx) { if (rf & 1) {
109
- const _r19 = i0.ɵɵgetCurrentView();
110
- i0.ɵɵelementStart(0, "button", 16);
111
- i0.ɵɵlistener("click", function ArraySessionComponent_button_9_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r19); const ctx_r18 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r18.addLoop()); });
112
- i0.ɵɵtext(1);
113
- i0.ɵɵelementEnd();
114
- } if (rf & 2) {
115
- const ctx_r1 = i0.ɵɵnextContext();
116
- i0.ɵɵadvance(1);
117
- i0.ɵɵtextInterpolate(ctx_r1.addLoopLabel);
118
- } }
119
- class ArraySessionComponent extends BaseSchemaComponent {
120
- constructor() {
121
- super(...arguments);
122
- this.label = '';
123
- this.removeLabel = 'Remove';
124
- this.addItemLabel = 'Add Item';
125
- this.addLoopLabel = 'Add Loop';
126
- this.showAddLoop = true;
127
- this.onAdd = new EventEmitter();
128
- this.onAddLoop = new EventEmitter();
129
- this.subsectionItem = null;
130
- }
131
- add() {
132
- this.onAdd.next();
133
- }
134
- addLoop() {
135
- this.onAddLoop.next();
136
- }
137
- remove(item) {
138
- const values = this.model;
139
- const index = values.indexOf(item);
140
- values.splice(index, 1);
141
- this.model = values;
142
- }
143
- trackByIndex(index, obj) {
144
- return index;
145
- }
146
- }
147
- ArraySessionComponent.ɵfac = /*@__PURE__*/ function () { let ɵArraySessionComponent_BaseFactory; return function ArraySessionComponent_Factory(t) { return (ɵArraySessionComponent_BaseFactory || (ɵArraySessionComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ArraySessionComponent)))(t || ArraySessionComponent); }; }();
148
- ArraySessionComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ArraySessionComponent, selectors: [["array-session"]], contentQueries: function ArraySessionComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
149
- i0.ɵɵcontentQuery(dirIndex, TemplateRef, 5, TemplateRef);
150
- } if (rf & 2) {
151
- let _t;
152
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.subsectionItem = _t.first);
153
- } }, inputs: { label: "label", removeLabel: "removeLabel", addItemLabel: "addItemLabel", addLoopLabel: "addLoopLabel", showAddLoop: "showAddLoop" }, outputs: { onAdd: "onAdd", onAddLoop: "onAddLoop" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 10, vars: 5, 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) {
154
- i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "label", 2);
155
- i0.ɵɵtext(3);
156
- i0.ɵɵelementEnd();
157
- i0.ɵɵtemplate(4, ArraySessionComponent_div_4_Template, 6, 11, "div", 3);
158
- i0.ɵɵelementEnd()();
159
- i0.ɵɵelementStart(5, "div", 4)(6, "div", 1)(7, "button", 5);
160
- i0.ɵɵlistener("click", function ArraySessionComponent_Template_button_click_7_listener() { return ctx.add(); });
161
- i0.ɵɵtext(8);
162
- i0.ɵɵelementEnd();
163
- i0.ɵɵtemplate(9, ArraySessionComponent_button_9_Template, 2, 1, "button", 6);
164
- i0.ɵɵelementEnd()();
165
- } if (rf & 2) {
166
- i0.ɵɵadvance(3);
167
- i0.ɵɵtextInterpolate(ctx.label);
168
- i0.ɵɵadvance(1);
169
- i0.ɵɵproperty("ngForOf", ctx.model)("ngForTrackBy", ctx.trackByIndex);
170
- i0.ɵɵadvance(4);
171
- i0.ɵɵtextInterpolate(ctx.addItemLabel);
172
- i0.ɵɵadvance(1);
173
- i0.ɵɵproperty("ngIf", ctx.showAddLoop);
174
- } }, dependencies: [i1.NgForOf, i1.NgIf, i1.NgTemplateOutlet, i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.NgModel], styles: [".subsection-element[_ngcontent-%COMP%]{padding:5px 15px 15px;margin-top:10px;border:1px solid #CCC;border-radius:5px;background:#FFF}.subsection-element[_ngcontent-%COMP%]:first-child{margin-top:0!important}.btn-personal-edit[_ngcontent-%COMP%]{margin:5px 0}.subsection-item-title[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:calc(100% + 30px);padding:7px 10px 7px 14px;margin-top:-5px;margin-bottom:5px;margin-left:-15px;background:#EEE;border-radius:5px 5px 0 0;font-weight:700;border-bottom:1px solid #CCC}.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}"] });
175
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ArraySessionComponent, [{
176
- type: Component,
177
- args: [{ selector: 'array-session', template: "<div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label bold\">{{ label }}</label>\r\n <div class=\"subsection-element\" *ngFor=\"let item of model; let index = index; trackBy:trackByIndex;\">\r\n <div class=\"subsection-item-title\">{{ removeLabel }} {{ index + 1 }}\r\n <i class=\"far fa-trash-alt\" (click)=\"remove(item)\"></i>\r\n </div>\r\n <div class=\"row\" *ngIf=\"item.mappingAttributes || item.mappingAttributes === ''\">\r\n <div class=\"col-md-8\">\r\n <label class=\"info-label\">Loop</label>\r\n <input class=\"form-control\" type=\"text\" [(ngModel)]=\"item.loop\" [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone (dndDrop)=\"item.loop = this.onDrop($event, item.loop)\" />\r\n </div>\r\n <div class=\"col-md-4\">\r\n <label class=\"info-label\">Alias</label>\r\n <input class=\"form-control\" type=\"text\" [(ngModel)]=\"item.alias\" [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone (dndDrop)=\"item.alias = this.onDrop($event, item.alias)\" />\r\n </div>\r\n </div>\r\n <ng-container *ngTemplateOutlet=\"subsectionItem, context: {\r\n $implicit: {\r\n items: model, index: index,\r\n mappingAttributes: (item.mappingAttributes || item.mappingAttributes === '') ? item.mappingAttributes : item\r\n }\r\n }\"></ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"row add-buttons\">\r\n <div class=\"col-md-12\">\r\n <button class=\"btn btn-outline-primary float-left btn-personal-edit\" (click)=\"add()\">{{ this.addItemLabel }}</button>\r\n <button class=\"btn btn-outline-primary float-left btn-personal-edit ml-2\" *ngIf=\"showAddLoop\" (click)=\"addLoop()\">{{ this.addLoopLabel }}</button>\r\n </div>\r\n</div>\r\n", styles: [".subsection-element{padding:5px 15px 15px;margin-top:10px;border:1px solid #CCC;border-radius:5px;background:#FFF}.subsection-element:first-child{margin-top:0!important}.btn-personal-edit{margin:5px 0}.subsection-item-title{display:flex;justify-content:space-between;align-items:center;width:calc(100% + 30px);padding:7px 10px 7px 14px;margin-top:-5px;margin-bottom:5px;margin-left:-15px;background:#EEE;border-radius:5px 5px 0 0;font-weight:700;border-bottom:1px solid #CCC}.subsection-item-title .fa-trash-alt{color:red;cursor:pointer}.subsection-item-title label{font-weight:700}.add-buttons{margin-top:5px}\n"] }]
178
- }], null, { label: [{
179
- type: Input
180
- }], removeLabel: [{
181
- type: Input
182
- }], addItemLabel: [{
183
- type: Input
184
- }], addLoopLabel: [{
185
- type: Input
186
- }], showAddLoop: [{
187
- type: Input
188
- }], onAdd: [{
189
- type: Output
190
- }], onAddLoop: [{
191
- type: Output
192
- }], subsectionItem: [{
193
- type: ContentChild,
194
- args: [TemplateRef, { read: TemplateRef }]
60
+ const _c0$6 = function () { return { standalone: true }; };
61
+ function ArraySessionComponent_div_4_div_4_Template(rf, ctx) { if (rf & 1) {
62
+ const _r8 = i0.ɵɵgetCurrentView();
63
+ i0.ɵɵelementStart(0, "div", 0)(1, "div", 12)(2, "label", 13);
64
+ i0.ɵɵtext(3, "Loop");
65
+ i0.ɵɵelementEnd();
66
+ i0.ɵɵelementStart(4, "input", 14);
67
+ i0.ɵɵlistener("ngModelChange", function ArraySessionComponent_div_4_div_4_Template_input_ngModelChange_4_listener($event) { i0.ɵɵrestoreView(_r8); const item_r2 = i0.ɵɵnextContext().$implicit; return i0.ɵɵresetView(item_r2.loop = $event); })("dndDrop", function ArraySessionComponent_div_4_div_4_Template_input_dndDrop_4_listener($event) { i0.ɵɵrestoreView(_r8); const item_r2 = i0.ɵɵnextContext().$implicit; const ctx_r9 = i0.ɵɵnextContext(); return i0.ɵɵresetView(item_r2.loop = ctx_r9.onDrop($event, item_r2.loop)); });
68
+ i0.ɵɵelementEnd()();
69
+ i0.ɵɵelementStart(5, "div", 15)(6, "label", 13);
70
+ i0.ɵɵtext(7, "Alias");
71
+ i0.ɵɵelementEnd();
72
+ i0.ɵɵelementStart(8, "input", 14);
73
+ i0.ɵɵlistener("ngModelChange", function ArraySessionComponent_div_4_div_4_Template_input_ngModelChange_8_listener($event) { i0.ɵɵrestoreView(_r8); const item_r2 = i0.ɵɵnextContext().$implicit; return i0.ɵɵresetView(item_r2.alias = $event); })("dndDrop", function ArraySessionComponent_div_4_div_4_Template_input_dndDrop_8_listener($event) { i0.ɵɵrestoreView(_r8); const item_r2 = i0.ɵɵnextContext().$implicit; const ctx_r13 = i0.ɵɵnextContext(); return i0.ɵɵresetView(item_r2.alias = ctx_r13.onDrop($event, item_r2.alias)); });
74
+ i0.ɵɵelementEnd()()();
75
+ } if (rf & 2) {
76
+ const item_r2 = i0.ɵɵnextContext().$implicit;
77
+ i0.ɵɵadvance(4);
78
+ i0.ɵɵproperty("ngModel", item_r2.loop)("ngModelOptions", i0.ɵɵpureFunction0(4, _c0$6));
79
+ i0.ɵɵadvance(4);
80
+ i0.ɵɵproperty("ngModel", item_r2.alias)("ngModelOptions", i0.ɵɵpureFunction0(5, _c0$6));
81
+ } }
82
+ function ArraySessionComponent_div_4_ng_container_5_Template(rf, ctx) { if (rf & 1) {
83
+ i0.ɵɵelementContainer(0);
84
+ } }
85
+ const _c1$2 = function (a0, a1, a2) { return { items: a0, index: a1, mappingAttributes: a2 }; };
86
+ const _c2 = function (a0) { return { $implicit: a0 }; };
87
+ function ArraySessionComponent_div_4_Template(rf, ctx) { if (rf & 1) {
88
+ const _r17 = i0.ɵɵgetCurrentView();
89
+ i0.ɵɵelementStart(0, "div", 7)(1, "div", 8);
90
+ i0.ɵɵtext(2);
91
+ i0.ɵɵelementStart(3, "i", 9);
92
+ i0.ɵɵlistener("click", function ArraySessionComponent_div_4_Template_i_click_3_listener() { const restoredCtx = i0.ɵɵrestoreView(_r17); const item_r2 = restoredCtx.$implicit; const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.remove(item_r2)); });
93
+ i0.ɵɵelementEnd()();
94
+ i0.ɵɵtemplate(4, ArraySessionComponent_div_4_div_4_Template, 9, 6, "div", 10);
95
+ i0.ɵɵtemplate(5, ArraySessionComponent_div_4_ng_container_5_Template, 1, 0, "ng-container", 11);
96
+ i0.ɵɵelementEnd();
97
+ } if (rf & 2) {
98
+ const item_r2 = ctx.$implicit;
99
+ const index_r3 = ctx.index;
100
+ const ctx_r0 = i0.ɵɵnextContext();
101
+ i0.ɵɵadvance(2);
102
+ i0.ɵɵtextInterpolate2("", ctx_r0.removeLabel, " ", index_r3 + 1, " ");
103
+ i0.ɵɵadvance(2);
104
+ i0.ɵɵproperty("ngIf", item_r2.mappingAttributes || item_r2.mappingAttributes === "");
105
+ i0.ɵɵadvance(1);
106
+ i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.subsectionItem)("ngTemplateOutletContext", i0.ɵɵpureFunction1(9, _c2, i0.ɵɵpureFunction3(5, _c1$2, ctx_r0.model, index_r3, item_r2.mappingAttributes || item_r2.mappingAttributes === "" ? item_r2.mappingAttributes : item_r2)));
107
+ } }
108
+ function ArraySessionComponent_button_9_Template(rf, ctx) { if (rf & 1) {
109
+ const _r19 = i0.ɵɵgetCurrentView();
110
+ i0.ɵɵelementStart(0, "button", 16);
111
+ i0.ɵɵlistener("click", function ArraySessionComponent_button_9_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r19); const ctx_r18 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r18.addLoop()); });
112
+ i0.ɵɵtext(1);
113
+ i0.ɵɵelementEnd();
114
+ } if (rf & 2) {
115
+ const ctx_r1 = i0.ɵɵnextContext();
116
+ i0.ɵɵadvance(1);
117
+ i0.ɵɵtextInterpolate(ctx_r1.addLoopLabel);
118
+ } }
119
+ class ArraySessionComponent extends BaseSchemaComponent {
120
+ label = '';
121
+ removeLabel = 'Remove';
122
+ addItemLabel = 'Add Item';
123
+ addLoopLabel = 'Add Loop';
124
+ showAddLoop = true;
125
+ onAdd = new EventEmitter();
126
+ onAddLoop = new EventEmitter();
127
+ subsectionItem = null;
128
+ add() {
129
+ this.onAdd.next(undefined);
130
+ }
131
+ addLoop() {
132
+ this.onAddLoop.next(undefined);
133
+ }
134
+ remove(item) {
135
+ const values = this.model;
136
+ const index = values.indexOf(item);
137
+ values.splice(index, 1);
138
+ this.model = values;
139
+ }
140
+ trackByIndex(index, obj) {
141
+ return index;
142
+ }
143
+ static ɵfac = /*@__PURE__*/ function () { let ɵArraySessionComponent_BaseFactory; return function ArraySessionComponent_Factory(t) { return (ɵArraySessionComponent_BaseFactory || (ɵArraySessionComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ArraySessionComponent)))(t || ArraySessionComponent); }; }();
144
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ArraySessionComponent, selectors: [["array-session"]], contentQueries: function ArraySessionComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
145
+ i0.ɵɵcontentQuery(dirIndex, TemplateRef, 5, TemplateRef);
146
+ } if (rf & 2) {
147
+ let _t;
148
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.subsectionItem = _t.first);
149
+ } }, inputs: { label: "label", removeLabel: "removeLabel", addItemLabel: "addItemLabel", addLoopLabel: "addLoopLabel", showAddLoop: "showAddLoop" }, outputs: { onAdd: "onAdd", onAddLoop: "onAddLoop" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 10, vars: 5, 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) {
150
+ i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "label", 2);
151
+ i0.ɵɵtext(3);
152
+ i0.ɵɵelementEnd();
153
+ i0.ɵɵtemplate(4, ArraySessionComponent_div_4_Template, 6, 11, "div", 3);
154
+ i0.ɵɵelementEnd()();
155
+ i0.ɵɵelementStart(5, "div", 4)(6, "div", 1)(7, "button", 5);
156
+ i0.ɵɵlistener("click", function ArraySessionComponent_Template_button_click_7_listener() { return ctx.add(); });
157
+ i0.ɵɵtext(8);
158
+ i0.ɵɵelementEnd();
159
+ i0.ɵɵtemplate(9, ArraySessionComponent_button_9_Template, 2, 1, "button", 6);
160
+ i0.ɵɵelementEnd()();
161
+ } if (rf & 2) {
162
+ i0.ɵɵadvance(3);
163
+ i0.ɵɵtextInterpolate(ctx.label);
164
+ i0.ɵɵadvance(1);
165
+ i0.ɵɵproperty("ngForOf", ctx.model)("ngForTrackBy", ctx.trackByIndex);
166
+ i0.ɵɵadvance(4);
167
+ i0.ɵɵtextInterpolate(ctx.addItemLabel);
168
+ i0.ɵɵadvance(1);
169
+ i0.ɵɵproperty("ngIf", ctx.showAddLoop);
170
+ } }, dependencies: [i1.NgForOf, i1.NgIf, i1.NgTemplateOutlet, i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.NgModel], styles: [".subsection-element[_ngcontent-%COMP%]{padding:5px 15px 15px;margin-top:10px;border:1px solid #CCC;border-radius:5px;background:#FFF}.subsection-element[_ngcontent-%COMP%]:first-child{margin-top:0!important}.btn-personal-edit[_ngcontent-%COMP%]{margin:5px 0}.subsection-item-title[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:calc(100% + 30px);padding:7px 10px 7px 14px;margin-top:-5px;margin-bottom:5px;margin-left:-15px;background:#EEE;border-radius:5px 5px 0 0;font-weight:700;border-bottom:1px solid #CCC}.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}"] });
171
+ }
172
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ArraySessionComponent, [{
173
+ type: Component,
174
+ args: [{ selector: 'array-session', template: "<div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label bold\">{{ label }}</label>\r\n <div class=\"subsection-element\" *ngFor=\"let item of model; let index = index; trackBy:trackByIndex;\">\r\n <div class=\"subsection-item-title\">{{ removeLabel }} {{ index + 1 }}\r\n <i class=\"far fa-trash-alt\" (click)=\"remove(item)\"></i>\r\n </div>\r\n <div class=\"row\" *ngIf=\"item.mappingAttributes || item.mappingAttributes === ''\">\r\n <div class=\"col-md-8\">\r\n <label class=\"info-label\">Loop</label>\r\n <input class=\"form-control\" type=\"text\" [(ngModel)]=\"item.loop\" [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone (dndDrop)=\"item.loop = this.onDrop($event, item.loop)\" />\r\n </div>\r\n <div class=\"col-md-4\">\r\n <label class=\"info-label\">Alias</label>\r\n <input class=\"form-control\" type=\"text\" [(ngModel)]=\"item.alias\" [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone (dndDrop)=\"item.alias = this.onDrop($event, item.alias)\" />\r\n </div>\r\n </div>\r\n <ng-container *ngTemplateOutlet=\"subsectionItem, context: {\r\n $implicit: {\r\n items: model, index: index,\r\n mappingAttributes: (item.mappingAttributes || item.mappingAttributes === '') ? item.mappingAttributes : item\r\n }\r\n }\"></ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"row add-buttons\">\r\n <div class=\"col-md-12\">\r\n <button class=\"btn btn-outline-primary float-left btn-personal-edit\" (click)=\"add()\">{{ this.addItemLabel }}</button>\r\n <button class=\"btn btn-outline-primary float-left btn-personal-edit ml-2\" *ngIf=\"showAddLoop\" (click)=\"addLoop()\">{{ this.addLoopLabel }}</button>\r\n </div>\r\n</div>\r\n", styles: [".subsection-element{padding:5px 15px 15px;margin-top:10px;border:1px solid #CCC;border-radius:5px;background:#FFF}.subsection-element:first-child{margin-top:0!important}.btn-personal-edit{margin:5px 0}.subsection-item-title{display:flex;justify-content:space-between;align-items:center;width:calc(100% + 30px);padding:7px 10px 7px 14px;margin-top:-5px;margin-bottom:5px;margin-left:-15px;background:#EEE;border-radius:5px 5px 0 0;font-weight:700;border-bottom:1px solid #CCC}.subsection-item-title .fa-trash-alt{color:red;cursor:pointer}.subsection-item-title label{font-weight:700}.add-buttons{margin-top:5px}\n"] }]
175
+ }], null, { label: [{
176
+ type: Input
177
+ }], removeLabel: [{
178
+ type: Input
179
+ }], addItemLabel: [{
180
+ type: Input
181
+ }], addLoopLabel: [{
182
+ type: Input
183
+ }], showAddLoop: [{
184
+ type: Input
185
+ }], onAdd: [{
186
+ type: Output
187
+ }], onAddLoop: [{
188
+ type: Output
189
+ }], subsectionItem: [{
190
+ type: ContentChild,
191
+ args: [TemplateRef, { read: TemplateRef }]
195
192
  }] }); })();
196
193
 
197
- function SchemaFormComponent_div_0_Template(rf, ctx) { if (rf & 1) {
198
- const _r4 = i0.ɵɵgetCurrentView();
199
- i0.ɵɵelementStart(0, "div", 1)(1, "schema-input", 2);
200
- i0.ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_input_modelChange_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.model = $event); });
201
- i0.ɵɵelementEnd();
202
- i0.ɵɵelementStart(2, "schema-object", 3);
203
- i0.ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_object_modelChange_2_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.model = $event); });
204
- i0.ɵɵelementEnd();
205
- i0.ɵɵelementStart(3, "schema-array", 3);
206
- i0.ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_array_modelChange_3_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r6 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r6.model = $event); });
207
- i0.ɵɵelementEnd()();
208
- } if (rf & 2) {
209
- const schema_r1 = ctx.$implicit;
210
- const i_r2 = ctx.index;
211
- const ctx_r0 = i0.ɵɵnextContext();
212
- i0.ɵɵadvance(1);
213
- i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r0.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r0.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r0.selectClearLabel)("selectNotFoundLabel", ctx_r0.selectNotFoundLabel)("requiredLabel", ctx_r0.requiredLabel)("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schema", schema_r1)("editing", ctx_r0.editing)("index", i_r2);
214
- i0.ɵɵadvance(1);
215
- i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r0.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r0.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r0.selectClearLabel)("selectNotFoundLabel", ctx_r0.selectNotFoundLabel)("requiredLabel", ctx_r0.requiredLabel)("addItemLabel", ctx_r0.addItemLabel)("addLoopLabel", ctx_r0.addLoopLabel)("additionalAttributesLabel", ctx_r0.additionalAttributesLabel)("customAttributeRemoveLabel", ctx_r0.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r0.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r0.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r0.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r0.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r0.newCustomFieldCancelLabel)("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schema", schema_r1)("editing", ctx_r0.editing)("index", i_r2);
216
- i0.ɵɵadvance(1);
217
- i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r0.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r0.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r0.selectClearLabel)("selectNotFoundLabel", ctx_r0.selectNotFoundLabel)("requiredLabel", ctx_r0.requiredLabel)("addItemLabel", ctx_r0.addItemLabel)("addLoopLabel", ctx_r0.addLoopLabel)("additionalAttributesLabel", ctx_r0.additionalAttributesLabel)("customAttributeRemoveLabel", ctx_r0.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r0.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r0.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r0.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r0.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r0.newCustomFieldCancelLabel)("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schema", schema_r1)("editing", ctx_r0.editing)("index", i_r2);
218
- } }
219
- class SchemaFormComponent extends BaseSchemaComponent {
220
- constructor() {
221
- super(...arguments);
222
- this.requiredLabel = '(required)';
223
- this.addItemLabel = 'Add Item';
224
- this.addLoopLabel = 'Add Loop';
225
- this.additionalAttributesLabel = 'Additional Fields';
226
- this.customAttributeRemoveLabel = 'Remove';
227
- this.newCustomFieldNameLabel = 'Name';
228
- this.newCustomFieldValueLabel = 'Value';
229
- this.newCustomFieldAddLabel = 'Add';
230
- this.newCustomFieldSaveLabel = 'Save';
231
- this.newCustomFieldCancelLabel = 'Cancel';
232
- this.selectPlaceHolderLabel = 'Select Item';
233
- this.selectSearchPlaceHolderLabel = 'Search';
234
- this.selectClearLabel = 'Clear';
235
- this.selectNotFoundLabel = 'No Items Found';
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 = /*@__PURE__*/ function () { let ɵSchemaFormComponent_BaseFactory; return function SchemaFormComponent_Factory(t) { return (ɵSchemaFormComponent_BaseFactory || (ɵSchemaFormComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SchemaFormComponent)))(t || SchemaFormComponent); }; }();
252
- SchemaFormComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchemaFormComponent, selectors: [["schema-form"]], inputs: { requiredLabel: "requiredLabel", addItemLabel: "addItemLabel", addLoopLabel: "addLoopLabel", additionalAttributesLabel: "additionalAttributesLabel", customAttributeRemoveLabel: "customAttributeRemoveLabel", newCustomFieldNameLabel: "newCustomFieldNameLabel", newCustomFieldValueLabel: "newCustomFieldValueLabel", newCustomFieldAddLabel: "newCustomFieldAddLabel", newCustomFieldSaveLabel: "newCustomFieldSaveLabel", newCustomFieldCancelLabel: "newCustomFieldCancelLabel", selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", idPrefix: "idPrefix", schemas: "schemas", customProperties: "customProperties", editing: "editing", inputType: "inputType" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "schema-properties", 4, "ngFor", "ngForOf"], [1, "schema-properties"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "idPrefix", "model", "schema", "editing", "index", "modelChange"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "addItemLabel", "addLoopLabel", "additionalAttributesLabel", "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "idPrefix", "model", "schema", "editing", "index", "modelChange"]], template: function SchemaFormComponent_Template(rf, ctx) { if (rf & 1) {
253
- i0.ɵɵtemplate(0, SchemaFormComponent_div_0_Template, 4, 48, "div", 0);
254
- } if (rf & 2) {
255
- i0.ɵɵproperty("ngForOf", ctx.schemas);
256
- } } });
257
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaFormComponent, [{
258
- type: Component,
259
- args: [{ selector: 'schema-form', template: "<div class=\"schema-properties\" *ngFor=\"let schema of schemas; let i = index\">\r\n <schema-input\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"model\"\r\n [schema]=\"schema\"\r\n [editing]=\"this.editing\"\r\n [index]=\"i\">\r\n </schema-input>\r\n <schema-object\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"model\"\r\n [schema]=\"schema\"\r\n [editing]=\"this.editing\"\r\n [index]=\"i\">\r\n </schema-object>\r\n <schema-array\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"model\"\r\n [schema]=\"schema\"\r\n [editing]=\"this.editing\"\r\n [index]=\"i\">\r\n </schema-array>\r\n</div>\r\n" }]
260
- }], null, { requiredLabel: [{
261
- type: Input
262
- }], addItemLabel: [{
263
- type: Input
264
- }], addLoopLabel: [{
265
- type: Input
266
- }], additionalAttributesLabel: [{
267
- type: Input
268
- }], customAttributeRemoveLabel: [{
269
- type: Input
270
- }], newCustomFieldNameLabel: [{
271
- type: Input
272
- }], newCustomFieldValueLabel: [{
273
- type: Input
274
- }], newCustomFieldAddLabel: [{
275
- type: Input
276
- }], newCustomFieldSaveLabel: [{
277
- type: Input
278
- }], newCustomFieldCancelLabel: [{
279
- type: Input
280
- }], selectPlaceHolderLabel: [{
281
- type: Input
282
- }], selectSearchPlaceHolderLabel: [{
283
- type: Input
284
- }], selectClearLabel: [{
285
- type: Input
286
- }], selectNotFoundLabel: [{
287
- type: Input
288
- }], idPrefix: [{
289
- type: Input
290
- }], schemas: [{
291
- type: Input
292
- }], customProperties: [{
293
- type: Input
294
- }], editing: [{
295
- type: Input
296
- }], inputType: [{
297
- type: Input
194
+ function SchemaFormComponent_div_0_Template(rf, ctx) { if (rf & 1) {
195
+ const _r4 = i0.ɵɵgetCurrentView();
196
+ i0.ɵɵelementStart(0, "div", 1)(1, "schema-input", 2);
197
+ i0.ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_input_modelChange_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.model = $event); });
198
+ i0.ɵɵelementEnd();
199
+ i0.ɵɵelementStart(2, "schema-object", 3);
200
+ i0.ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_object_modelChange_2_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.model = $event); });
201
+ i0.ɵɵelementEnd();
202
+ i0.ɵɵelementStart(3, "schema-array", 3);
203
+ i0.ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_array_modelChange_3_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r6 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r6.model = $event); });
204
+ i0.ɵɵelementEnd()();
205
+ } if (rf & 2) {
206
+ const schema_r1 = ctx.$implicit;
207
+ const i_r2 = ctx.index;
208
+ const ctx_r0 = i0.ɵɵnextContext();
209
+ i0.ɵɵadvance(1);
210
+ i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r0.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r0.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r0.selectClearLabel)("selectNotFoundLabel", ctx_r0.selectNotFoundLabel)("requiredLabel", ctx_r0.requiredLabel)("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schema", schema_r1)("editing", ctx_r0.editing)("index", i_r2);
211
+ i0.ɵɵadvance(1);
212
+ i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r0.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r0.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r0.selectClearLabel)("selectNotFoundLabel", ctx_r0.selectNotFoundLabel)("requiredLabel", ctx_r0.requiredLabel)("addItemLabel", ctx_r0.addItemLabel)("addLoopLabel", ctx_r0.addLoopLabel)("additionalAttributesLabel", ctx_r0.additionalAttributesLabel)("customAttributeRemoveLabel", ctx_r0.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r0.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r0.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r0.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r0.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r0.newCustomFieldCancelLabel)("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schema", schema_r1)("editing", ctx_r0.editing)("index", i_r2);
213
+ i0.ɵɵadvance(1);
214
+ i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r0.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r0.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r0.selectClearLabel)("selectNotFoundLabel", ctx_r0.selectNotFoundLabel)("requiredLabel", ctx_r0.requiredLabel)("addItemLabel", ctx_r0.addItemLabel)("addLoopLabel", ctx_r0.addLoopLabel)("additionalAttributesLabel", ctx_r0.additionalAttributesLabel)("customAttributeRemoveLabel", ctx_r0.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r0.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r0.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r0.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r0.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r0.newCustomFieldCancelLabel)("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schema", schema_r1)("editing", ctx_r0.editing)("index", i_r2);
215
+ } }
216
+ class SchemaFormComponent extends BaseSchemaComponent {
217
+ requiredLabel = '(required)';
218
+ addItemLabel = 'Add Item';
219
+ addLoopLabel = 'Add Loop';
220
+ additionalAttributesLabel = 'Additional Fields';
221
+ customAttributeRemoveLabel = 'Remove';
222
+ newCustomFieldNameLabel = 'Name';
223
+ newCustomFieldValueLabel = 'Value';
224
+ newCustomFieldAddLabel = 'Add';
225
+ newCustomFieldSaveLabel = 'Save';
226
+ newCustomFieldCancelLabel = 'Cancel';
227
+ selectPlaceHolderLabel = 'Select Item';
228
+ selectSearchPlaceHolderLabel = 'Search';
229
+ selectClearLabel = 'Clear';
230
+ selectNotFoundLabel = 'No Items Found';
231
+ idPrefix;
232
+ schemas = [];
233
+ customProperties = false;
234
+ editing = false;
235
+ inputType;
236
+ loaded = false;
237
+ ngAfterContentInit() {
238
+ this.loaded = true;
239
+ }
240
+ onDrop($event, modelElement) {
241
+ return onDropStruct($event, modelElement);
242
+ }
243
+ getId(index) {
244
+ return `${this.idPrefix}-struct-${index}`;
245
+ }
246
+ static ɵfac = /*@__PURE__*/ function () { let ɵSchemaFormComponent_BaseFactory; return function SchemaFormComponent_Factory(t) { return (ɵSchemaFormComponent_BaseFactory || (ɵSchemaFormComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SchemaFormComponent)))(t || SchemaFormComponent); }; }();
247
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchemaFormComponent, selectors: [["schema-form"]], inputs: { requiredLabel: "requiredLabel", addItemLabel: "addItemLabel", addLoopLabel: "addLoopLabel", additionalAttributesLabel: "additionalAttributesLabel", customAttributeRemoveLabel: "customAttributeRemoveLabel", newCustomFieldNameLabel: "newCustomFieldNameLabel", newCustomFieldValueLabel: "newCustomFieldValueLabel", newCustomFieldAddLabel: "newCustomFieldAddLabel", newCustomFieldSaveLabel: "newCustomFieldSaveLabel", newCustomFieldCancelLabel: "newCustomFieldCancelLabel", selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", idPrefix: "idPrefix", schemas: "schemas", customProperties: "customProperties", editing: "editing", inputType: "inputType" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "schema-properties", 4, "ngFor", "ngForOf"], [1, "schema-properties"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "idPrefix", "model", "schema", "editing", "index", "modelChange"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "addItemLabel", "addLoopLabel", "additionalAttributesLabel", "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "idPrefix", "model", "schema", "editing", "index", "modelChange"]], template: function SchemaFormComponent_Template(rf, ctx) { if (rf & 1) {
248
+ i0.ɵɵtemplate(0, SchemaFormComponent_div_0_Template, 4, 48, "div", 0);
249
+ } if (rf & 2) {
250
+ i0.ɵɵproperty("ngForOf", ctx.schemas);
251
+ } } });
252
+ }
253
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaFormComponent, [{
254
+ type: Component,
255
+ args: [{ selector: 'schema-form', template: "<div class=\"schema-properties\" *ngFor=\"let schema of schemas; let i = index\">\r\n <schema-input\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"model\"\r\n [schema]=\"schema\"\r\n [editing]=\"this.editing\"\r\n [index]=\"i\">\r\n </schema-input>\r\n <schema-object\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"model\"\r\n [schema]=\"schema\"\r\n [editing]=\"this.editing\"\r\n [index]=\"i\">\r\n </schema-object>\r\n <schema-array\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"model\"\r\n [schema]=\"schema\"\r\n [editing]=\"this.editing\"\r\n [index]=\"i\">\r\n </schema-array>\r\n</div>\r\n" }]
256
+ }], null, { requiredLabel: [{
257
+ type: Input
258
+ }], addItemLabel: [{
259
+ type: Input
260
+ }], addLoopLabel: [{
261
+ type: Input
262
+ }], additionalAttributesLabel: [{
263
+ type: Input
264
+ }], customAttributeRemoveLabel: [{
265
+ type: Input
266
+ }], newCustomFieldNameLabel: [{
267
+ type: Input
268
+ }], newCustomFieldValueLabel: [{
269
+ type: Input
270
+ }], newCustomFieldAddLabel: [{
271
+ type: Input
272
+ }], newCustomFieldSaveLabel: [{
273
+ type: Input
274
+ }], newCustomFieldCancelLabel: [{
275
+ type: Input
276
+ }], selectPlaceHolderLabel: [{
277
+ type: Input
278
+ }], selectSearchPlaceHolderLabel: [{
279
+ type: Input
280
+ }], selectClearLabel: [{
281
+ type: Input
282
+ }], selectNotFoundLabel: [{
283
+ type: Input
284
+ }], idPrefix: [{
285
+ type: Input
286
+ }], schemas: [{
287
+ type: Input
288
+ }], customProperties: [{
289
+ type: Input
290
+ }], editing: [{
291
+ type: Input
292
+ }], inputType: [{
293
+ type: Input
298
294
  }] }); })();
299
295
 
300
- const _c0$5 = function () { return { standalone: true }; };
301
- function SchemaCustomAttributesComponent_div_0_Template(rf, ctx) { if (rf & 1) {
302
- const _r8 = i0.ɵɵgetCurrentView();
303
- i0.ɵɵelementStart(0, "div", 6)(1, "div", 7)(2, "label", 8);
304
- i0.ɵɵtext(3);
305
- i0.ɵɵelementEnd();
306
- i0.ɵɵelementStart(4, "span", 9);
307
- i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_div_0_Template_span_click_4_listener() { const restoredCtx = i0.ɵɵrestoreView(_r8); const i_r6 = restoredCtx.index; const ctx_r7 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r7.removeCustomAttribute(i_r6)); });
308
- i0.ɵɵelement(5, "i", 10);
309
- i0.ɵɵelementEnd();
310
- i0.ɵɵelementStart(6, "input", 11);
311
- i0.ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_0_Template_input_ngModelChange_6_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r8); const attribute_r5 = restoredCtx.$implicit; return i0.ɵɵresetView(attribute_r5.value = $event); })("dndDrop", function SchemaCustomAttributesComponent_div_0_Template_input_dndDrop_6_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r8); const attribute_r5 = restoredCtx.$implicit; const ctx_r10 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r10.onDropAttr($event, "value", attribute_r5)); });
312
- i0.ɵɵelementEnd()()();
313
- } if (rf & 2) {
314
- const attribute_r5 = ctx.$implicit;
315
- const ctx_r0 = i0.ɵɵnextContext();
316
- i0.ɵɵadvance(3);
317
- i0.ɵɵtextInterpolate(attribute_r5.label);
318
- i0.ɵɵadvance(2);
319
- i0.ɵɵproperty("matTooltip", ctx_r0.customAttributeRemoveLabel);
320
- i0.ɵɵadvance(1);
321
- i0.ɵɵproperty("ngModel", attribute_r5.value)("ngModelOptions", i0.ɵɵpureFunction0(4, _c0$5));
322
- } }
323
- function SchemaCustomAttributesComponent_div_1_Template(rf, ctx) { if (rf & 1) {
324
- const _r12 = i0.ɵɵgetCurrentView();
325
- i0.ɵɵelementStart(0, "div", 12)(1, "div", 13)(2, "div", 7)(3, "label", 8);
326
- i0.ɵɵtext(4);
327
- i0.ɵɵelementStart(5, "strong");
328
- i0.ɵɵtext(6, "*");
329
- i0.ɵɵelementEnd()();
330
- i0.ɵɵelementStart(7, "input", 11);
331
- i0.ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_7_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.newCustomField.label = $event); })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_7_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r13 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r13.onDropAttr($event, "label", ctx_r13.newCustomField)); });
332
- i0.ɵɵelementEnd()()();
333
- i0.ɵɵelementStart(8, "div", 13)(9, "div", 7)(10, "label", 8);
334
- i0.ɵɵtext(11);
335
- i0.ɵɵelementStart(12, "strong");
336
- i0.ɵɵtext(13, "*");
337
- i0.ɵɵelementEnd()();
338
- i0.ɵɵelementStart(14, "input", 11);
339
- i0.ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_14_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r14 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r14.newCustomField.value = $event); })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_14_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r15 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r15.onDropAttr($event, "value", ctx_r15.newCustomField)); });
340
- i0.ɵɵelementEnd()()()();
341
- } if (rf & 2) {
342
- const ctx_r1 = i0.ɵɵnextContext();
343
- i0.ɵɵadvance(4);
344
- i0.ɵɵtextInterpolate(ctx_r1.newCustomFieldNameLabel);
345
- i0.ɵɵadvance(3);
346
- i0.ɵɵproperty("ngModel", ctx_r1.newCustomField.label)("ngModelOptions", i0.ɵɵpureFunction0(6, _c0$5));
347
- i0.ɵɵadvance(4);
348
- i0.ɵɵtextInterpolate(ctx_r1.newCustomFieldValueLabel);
349
- i0.ɵɵadvance(3);
350
- i0.ɵɵproperty("ngModel", ctx_r1.newCustomField.value)("ngModelOptions", i0.ɵɵpureFunction0(7, _c0$5));
351
- } }
352
- function SchemaCustomAttributesComponent_button_4_Template(rf, ctx) { if (rf & 1) {
353
- const _r17 = i0.ɵɵgetCurrentView();
354
- i0.ɵɵelementStart(0, "button", 14);
355
- i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_button_4_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r17); const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.newCustomField = {}); });
356
- i0.ɵɵtext(1);
357
- i0.ɵɵelementEnd();
358
- } if (rf & 2) {
359
- const ctx_r2 = i0.ɵɵnextContext();
360
- i0.ɵɵadvance(1);
361
- i0.ɵɵtextInterpolate1(" ", ctx_r2.newCustomFieldAddLabel, " ");
362
- } }
363
- function SchemaCustomAttributesComponent_button_5_Template(rf, ctx) { if (rf & 1) {
364
- const _r19 = i0.ɵɵgetCurrentView();
365
- i0.ɵɵelementStart(0, "button", 15);
366
- i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_button_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r19); const ctx_r18 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r18.newCustomField = null); });
367
- i0.ɵɵtext(1);
368
- i0.ɵɵelementEnd();
369
- } if (rf & 2) {
370
- const ctx_r3 = i0.ɵɵnextContext();
371
- i0.ɵɵadvance(1);
372
- i0.ɵɵtextInterpolate1(" ", ctx_r3.newCustomFieldCancelLabel, " ");
373
- } }
374
- function SchemaCustomAttributesComponent_button_6_Template(rf, ctx) { if (rf & 1) {
375
- const _r21 = i0.ɵɵgetCurrentView();
376
- i0.ɵɵelementStart(0, "button", 14);
377
- i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r21); const ctx_r20 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r20.saveNewAttribute(ctx_r20.newCustomField)); });
378
- i0.ɵɵtext(1);
379
- i0.ɵɵelementEnd();
380
- } if (rf & 2) {
381
- const ctx_r4 = i0.ɵɵnextContext();
382
- i0.ɵɵadvance(1);
383
- i0.ɵɵtextInterpolate1(" ", ctx_r4.newCustomFieldSaveLabel, " ");
384
- } }
385
- class SchemaCustomAttributesComponent extends BaseSchemaComponent {
386
- constructor() {
387
- super(...arguments);
388
- this.customAttributeRemoveLabel = 'Remove';
389
- this.newCustomFieldNameLabel = 'Name';
390
- this.newCustomFieldValueLabel = 'Value';
391
- this.newCustomFieldAddLabel = 'Add';
392
- this.newCustomFieldSaveLabel = 'Save';
393
- this.newCustomFieldCancelLabel = 'Cancel';
394
- this.onSaveAttribute = new EventEmitter();
395
- this.onDropOnAttribute = new EventEmitter();
396
- }
397
- ngAfterContentInit() {
398
- if (!this.model) {
399
- this.model = [];
400
- }
401
- }
402
- saveNewAttribute(newCustomField) {
403
- this.onSaveAttribute.emit(newCustomField);
404
- this.model.push(newCustomField);
405
- this.newCustomField = null;
406
- this.modelChange.emit(this.model);
407
- }
408
- removeCustomAttribute(attributeIndex) {
409
- this.model.splice(attributeIndex, 1);
410
- this.modelChange.emit(this.model);
411
- }
412
- onDropAttr($event, value, newCustomField) {
413
- if (!newCustomField[value]) {
414
- newCustomField[value] = '';
415
- }
416
- newCustomField[value] += `{{${$event.data}}}`;
417
- }
418
- }
419
- SchemaCustomAttributesComponent.ɵfac = /*@__PURE__*/ function () { let ɵSchemaCustomAttributesComponent_BaseFactory; return function SchemaCustomAttributesComponent_Factory(t) { return (ɵSchemaCustomAttributesComponent_BaseFactory || (ɵSchemaCustomAttributesComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SchemaCustomAttributesComponent)))(t || SchemaCustomAttributesComponent); }; }();
420
- SchemaCustomAttributesComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchemaCustomAttributesComponent, selectors: [["schema-custom-attributes"]], inputs: { onDropFunction: "onDropFunction", customAttributeRemoveLabel: "customAttributeRemoveLabel", newCustomFieldNameLabel: "newCustomFieldNameLabel", newCustomFieldValueLabel: "newCustomFieldValueLabel", newCustomFieldAddLabel: "newCustomFieldAddLabel", newCustomFieldSaveLabel: "newCustomFieldSaveLabel", newCustomFieldCancelLabel: "newCustomFieldCancelLabel" }, outputs: { onSaveAttribute: "onSaveAttribute", onDropOnAttribute: "onDropOnAttribute" }, features: [i0.ɵɵ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, "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) {
421
- i0.ɵɵtemplate(0, SchemaCustomAttributesComponent_div_0_Template, 7, 5, "div", 0);
422
- i0.ɵɵtemplate(1, SchemaCustomAttributesComponent_div_1_Template, 15, 8, "div", 1);
423
- i0.ɵɵelementStart(2, "div", 2)(3, "div", 3);
424
- i0.ɵɵtemplate(4, SchemaCustomAttributesComponent_button_4_Template, 2, 1, "button", 4);
425
- i0.ɵɵtemplate(5, SchemaCustomAttributesComponent_button_5_Template, 2, 1, "button", 5);
426
- i0.ɵɵtemplate(6, SchemaCustomAttributesComponent_button_6_Template, 2, 1, "button", 4);
427
- i0.ɵɵelementEnd()();
428
- } if (rf & 2) {
429
- i0.ɵɵproperty("ngForOf", ctx.model);
430
- i0.ɵɵadvance(1);
431
- i0.ɵɵproperty("ngIf", ctx.newCustomField);
432
- i0.ɵɵadvance(3);
433
- i0.ɵɵproperty("ngIf", !ctx.newCustomField);
434
- i0.ɵɵadvance(1);
435
- i0.ɵɵproperty("ngIf", ctx.newCustomField);
436
- i0.ɵɵadvance(1);
437
- i0.ɵɵproperty("ngIf", ctx.newCustomField && ctx.newCustomField.label && ctx.newCustomField.value);
438
- } }, dependencies: [i1.NgForOf, i1.NgIf, i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.NgModel, i2$1.MatTooltip], styles: [".customAttributeDeleteIcon[_ngcontent-%COMP%]{position:absolute;right:15px;top:4px;cursor:pointer;font-size:16px;color:red}.customAttributeDeleteIcon[_ngcontent-%COMP%]:hover{color:#777}.struct-custom-field[_ngcontent-%COMP%]{margin-top:16px;padding:8px 16px 16px;background-color:#ececec}"] });
439
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaCustomAttributesComponent, [{
440
- type: Component,
441
- args: [{ selector: 'schema-custom-attributes', template: "<div class=\"row custom-attributes\" *ngFor=\"let attribute of model; let i = index\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label\">{{ attribute.label }}</label>\r\n <span (click)=\"removeCustomAttribute(i)\" class=\"customAttributeDeleteIcon\">\r\n <i class=\"far fa-trash-alt\" [matTooltip]=\"this.customAttributeRemoveLabel\"></i>\r\n </span>\r\n\r\n <input\r\n class=\"form-control\"\r\n [(ngModel)]=\"attribute.value\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone\r\n (dndDrop)=\"onDropAttr($event, 'value', attribute)\"\r\n />\r\n </div>\r\n</div>\r\n<div *ngIf=\"newCustomField\" class=\"struct-custom-field\">\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label\">{{ this.newCustomFieldNameLabel }}<strong>*</strong></label>\r\n <input \r\n class=\"form-control\" \r\n [(ngModel)]=\"newCustomField.label\" \r\n [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone\r\n (dndDrop)=\"onDropAttr($event, 'label', newCustomField)\"\r\n />\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label\">{{ this.newCustomFieldValueLabel }}<strong>*</strong></label>\r\n <input\r\n class=\"form-control\"\r\n [(ngModel)]=\"newCustomField.value\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone\r\n (dndDrop)=\"onDropAttr($event, 'value', newCustomField)\"\r\n />\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"row actions-buttons\">\r\n <div class=\"col-md-12 pull-right\">\r\n <button class=\"btn btn-outline-primary float-left\" *ngIf=\"!newCustomField\" (click)=\"newCustomField = {}\">\r\n {{ this.newCustomFieldAddLabel }}\r\n </button>\r\n <button\r\n class=\"btn btn-outline-danger float-left ml-2\"\r\n *ngIf=\"newCustomField\"\r\n (click)=\"newCustomField = null\"\r\n >\r\n {{ this.newCustomFieldCancelLabel }}\r\n </button>\r\n <button\r\n class=\"btn btn-outline-primary float-left\"\r\n *ngIf=\"newCustomField && newCustomField.label && newCustomField.value\"\r\n (click)=\"saveNewAttribute(newCustomField)\"\r\n >\r\n {{ this.newCustomFieldSaveLabel }}\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".customAttributeDeleteIcon{position:absolute;right:15px;top:4px;cursor:pointer;font-size:16px;color:red}.customAttributeDeleteIcon:hover{color:#777}.struct-custom-field{margin-top:16px;padding:8px 16px 16px;background-color:#ececec}\n"] }]
442
- }], null, { onDropFunction: [{
443
- type: Input
444
- }], customAttributeRemoveLabel: [{
445
- type: Input
446
- }], newCustomFieldNameLabel: [{
447
- type: Input
448
- }], newCustomFieldValueLabel: [{
449
- type: Input
450
- }], newCustomFieldAddLabel: [{
451
- type: Input
452
- }], newCustomFieldSaveLabel: [{
453
- type: Input
454
- }], newCustomFieldCancelLabel: [{
455
- type: Input
456
- }], onSaveAttribute: [{
457
- type: Output
458
- }], onDropOnAttribute: [{
459
- type: Output
296
+ const _c0$5 = function () { return { standalone: true }; };
297
+ function SchemaCustomAttributesComponent_div_0_Template(rf, ctx) { if (rf & 1) {
298
+ const _r8 = i0.ɵɵgetCurrentView();
299
+ i0.ɵɵelementStart(0, "div", 6)(1, "div", 7)(2, "label", 8);
300
+ i0.ɵɵtext(3);
301
+ i0.ɵɵelementEnd();
302
+ i0.ɵɵelementStart(4, "span", 9);
303
+ i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_div_0_Template_span_click_4_listener() { const restoredCtx = i0.ɵɵrestoreView(_r8); const i_r6 = restoredCtx.index; const ctx_r7 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r7.removeCustomAttribute(i_r6)); });
304
+ i0.ɵɵelement(5, "i", 10);
305
+ i0.ɵɵelementEnd();
306
+ i0.ɵɵelementStart(6, "input", 11);
307
+ i0.ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_0_Template_input_ngModelChange_6_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r8); const attribute_r5 = restoredCtx.$implicit; return i0.ɵɵresetView(attribute_r5.value = $event); })("dndDrop", function SchemaCustomAttributesComponent_div_0_Template_input_dndDrop_6_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r8); const attribute_r5 = restoredCtx.$implicit; const ctx_r10 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r10.onDropAttr($event, "value", attribute_r5)); });
308
+ i0.ɵɵelementEnd()()();
309
+ } if (rf & 2) {
310
+ const attribute_r5 = ctx.$implicit;
311
+ const ctx_r0 = i0.ɵɵnextContext();
312
+ i0.ɵɵadvance(3);
313
+ i0.ɵɵtextInterpolate(attribute_r5.label);
314
+ i0.ɵɵadvance(2);
315
+ i0.ɵɵproperty("matTooltip", ctx_r0.customAttributeRemoveLabel);
316
+ i0.ɵɵadvance(1);
317
+ i0.ɵɵproperty("ngModel", attribute_r5.value)("ngModelOptions", i0.ɵɵpureFunction0(4, _c0$5));
318
+ } }
319
+ function SchemaCustomAttributesComponent_div_1_Template(rf, ctx) { if (rf & 1) {
320
+ const _r12 = i0.ɵɵgetCurrentView();
321
+ i0.ɵɵelementStart(0, "div", 12)(1, "div", 13)(2, "div", 7)(3, "label", 8);
322
+ i0.ɵɵtext(4);
323
+ i0.ɵɵelementStart(5, "strong");
324
+ i0.ɵɵtext(6, "*");
325
+ i0.ɵɵelementEnd()();
326
+ i0.ɵɵelementStart(7, "input", 11);
327
+ i0.ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_7_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.newCustomField.label = $event); })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_7_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r13 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r13.onDropAttr($event, "label", ctx_r13.newCustomField)); });
328
+ i0.ɵɵelementEnd()()();
329
+ i0.ɵɵelementStart(8, "div", 13)(9, "div", 7)(10, "label", 8);
330
+ i0.ɵɵtext(11);
331
+ i0.ɵɵelementStart(12, "strong");
332
+ i0.ɵɵtext(13, "*");
333
+ i0.ɵɵelementEnd()();
334
+ i0.ɵɵelementStart(14, "input", 11);
335
+ i0.ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_14_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r14 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r14.newCustomField.value = $event); })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_14_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r15 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r15.onDropAttr($event, "value", ctx_r15.newCustomField)); });
336
+ i0.ɵɵelementEnd()()()();
337
+ } if (rf & 2) {
338
+ const ctx_r1 = i0.ɵɵnextContext();
339
+ i0.ɵɵadvance(4);
340
+ i0.ɵɵtextInterpolate(ctx_r1.newCustomFieldNameLabel);
341
+ i0.ɵɵadvance(3);
342
+ i0.ɵɵproperty("ngModel", ctx_r1.newCustomField.label)("ngModelOptions", i0.ɵɵpureFunction0(6, _c0$5));
343
+ i0.ɵɵadvance(4);
344
+ i0.ɵɵtextInterpolate(ctx_r1.newCustomFieldValueLabel);
345
+ i0.ɵɵadvance(3);
346
+ i0.ɵɵproperty("ngModel", ctx_r1.newCustomField.value)("ngModelOptions", i0.ɵɵpureFunction0(7, _c0$5));
347
+ } }
348
+ function SchemaCustomAttributesComponent_button_4_Template(rf, ctx) { if (rf & 1) {
349
+ const _r17 = i0.ɵɵgetCurrentView();
350
+ i0.ɵɵelementStart(0, "button", 14);
351
+ i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_button_4_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r17); const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.newCustomField = {}); });
352
+ i0.ɵɵtext(1);
353
+ i0.ɵɵelementEnd();
354
+ } if (rf & 2) {
355
+ const ctx_r2 = i0.ɵɵnextContext();
356
+ i0.ɵɵadvance(1);
357
+ i0.ɵɵtextInterpolate1(" ", ctx_r2.newCustomFieldAddLabel, " ");
358
+ } }
359
+ function SchemaCustomAttributesComponent_button_5_Template(rf, ctx) { if (rf & 1) {
360
+ const _r19 = i0.ɵɵgetCurrentView();
361
+ i0.ɵɵelementStart(0, "button", 15);
362
+ i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_button_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r19); const ctx_r18 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r18.newCustomField = null); });
363
+ i0.ɵɵtext(1);
364
+ i0.ɵɵelementEnd();
365
+ } if (rf & 2) {
366
+ const ctx_r3 = i0.ɵɵnextContext();
367
+ i0.ɵɵadvance(1);
368
+ i0.ɵɵtextInterpolate1(" ", ctx_r3.newCustomFieldCancelLabel, " ");
369
+ } }
370
+ function SchemaCustomAttributesComponent_button_6_Template(rf, ctx) { if (rf & 1) {
371
+ const _r21 = i0.ɵɵgetCurrentView();
372
+ i0.ɵɵelementStart(0, "button", 14);
373
+ i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r21); const ctx_r20 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r20.saveNewAttribute(ctx_r20.newCustomField)); });
374
+ i0.ɵɵtext(1);
375
+ i0.ɵɵelementEnd();
376
+ } if (rf & 2) {
377
+ const ctx_r4 = i0.ɵɵnextContext();
378
+ i0.ɵɵadvance(1);
379
+ i0.ɵɵtextInterpolate1(" ", ctx_r4.newCustomFieldSaveLabel, " ");
380
+ } }
381
+ class SchemaCustomAttributesComponent extends BaseSchemaComponent {
382
+ onDropFunction;
383
+ customAttributeRemoveLabel = 'Remove';
384
+ newCustomFieldNameLabel = 'Name';
385
+ newCustomFieldValueLabel = 'Value';
386
+ newCustomFieldAddLabel = 'Add';
387
+ newCustomFieldSaveLabel = 'Save';
388
+ newCustomFieldCancelLabel = 'Cancel';
389
+ onSaveAttribute = new EventEmitter();
390
+ onDropOnAttribute = new EventEmitter();
391
+ newCustomField;
392
+ ngAfterContentInit() {
393
+ if (!this.model) {
394
+ this.model = [];
395
+ }
396
+ }
397
+ saveNewAttribute(newCustomField) {
398
+ this.onSaveAttribute.emit(newCustomField);
399
+ this.model.push(newCustomField);
400
+ this.newCustomField = null;
401
+ this.modelChange.emit(this.model);
402
+ }
403
+ removeCustomAttribute(attributeIndex) {
404
+ this.model.splice(attributeIndex, 1);
405
+ this.modelChange.emit(this.model);
406
+ }
407
+ onDropAttr($event, value, newCustomField) {
408
+ if (!newCustomField[value]) {
409
+ newCustomField[value] = '';
410
+ }
411
+ newCustomField[value] += `{{${$event.data}}}`;
412
+ }
413
+ static ɵfac = /*@__PURE__*/ function () { let ɵSchemaCustomAttributesComponent_BaseFactory; return function SchemaCustomAttributesComponent_Factory(t) { return (ɵSchemaCustomAttributesComponent_BaseFactory || (ɵSchemaCustomAttributesComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SchemaCustomAttributesComponent)))(t || SchemaCustomAttributesComponent); }; }();
414
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchemaCustomAttributesComponent, selectors: [["schema-custom-attributes"]], inputs: { onDropFunction: "onDropFunction", customAttributeRemoveLabel: "customAttributeRemoveLabel", newCustomFieldNameLabel: "newCustomFieldNameLabel", newCustomFieldValueLabel: "newCustomFieldValueLabel", newCustomFieldAddLabel: "newCustomFieldAddLabel", newCustomFieldSaveLabel: "newCustomFieldSaveLabel", newCustomFieldCancelLabel: "newCustomFieldCancelLabel" }, outputs: { onSaveAttribute: "onSaveAttribute", onDropOnAttribute: "onDropOnAttribute" }, features: [i0.ɵɵ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, "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) {
415
+ i0.ɵɵtemplate(0, SchemaCustomAttributesComponent_div_0_Template, 7, 5, "div", 0);
416
+ i0.ɵɵtemplate(1, SchemaCustomAttributesComponent_div_1_Template, 15, 8, "div", 1);
417
+ i0.ɵɵelementStart(2, "div", 2)(3, "div", 3);
418
+ i0.ɵɵtemplate(4, SchemaCustomAttributesComponent_button_4_Template, 2, 1, "button", 4);
419
+ i0.ɵɵtemplate(5, SchemaCustomAttributesComponent_button_5_Template, 2, 1, "button", 5);
420
+ i0.ɵɵtemplate(6, SchemaCustomAttributesComponent_button_6_Template, 2, 1, "button", 4);
421
+ i0.ɵɵelementEnd()();
422
+ } if (rf & 2) {
423
+ i0.ɵɵproperty("ngForOf", ctx.model);
424
+ i0.ɵɵadvance(1);
425
+ i0.ɵɵproperty("ngIf", ctx.newCustomField);
426
+ i0.ɵɵadvance(3);
427
+ i0.ɵɵproperty("ngIf", !ctx.newCustomField);
428
+ i0.ɵɵadvance(1);
429
+ i0.ɵɵproperty("ngIf", ctx.newCustomField);
430
+ i0.ɵɵadvance(1);
431
+ i0.ɵɵproperty("ngIf", ctx.newCustomField && ctx.newCustomField.label && ctx.newCustomField.value);
432
+ } }, dependencies: [i1.NgForOf, i1.NgIf, i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.NgModel, i2$1.MatTooltip], styles: [".customAttributeDeleteIcon[_ngcontent-%COMP%]{position:absolute;right:15px;top:4px;cursor:pointer;font-size:16px;color:red}.customAttributeDeleteIcon[_ngcontent-%COMP%]:hover{color:#777}.struct-custom-field[_ngcontent-%COMP%]{margin-top:16px;padding:8px 16px 16px;background-color:#ececec}"] });
433
+ }
434
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaCustomAttributesComponent, [{
435
+ type: Component,
436
+ args: [{ selector: 'schema-custom-attributes', template: "<div class=\"row custom-attributes\" *ngFor=\"let attribute of model; let i = index\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label\">{{ attribute.label }}</label>\r\n <span (click)=\"removeCustomAttribute(i)\" class=\"customAttributeDeleteIcon\">\r\n <i class=\"far fa-trash-alt\" [matTooltip]=\"this.customAttributeRemoveLabel\"></i>\r\n </span>\r\n\r\n <input\r\n class=\"form-control\"\r\n [(ngModel)]=\"attribute.value\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone\r\n (dndDrop)=\"onDropAttr($event, 'value', attribute)\"\r\n />\r\n </div>\r\n</div>\r\n<div *ngIf=\"newCustomField\" class=\"struct-custom-field\">\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label\">{{ this.newCustomFieldNameLabel }}<strong>*</strong></label>\r\n <input \r\n class=\"form-control\" \r\n [(ngModel)]=\"newCustomField.label\" \r\n [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone\r\n (dndDrop)=\"onDropAttr($event, 'label', newCustomField)\"\r\n />\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label\">{{ this.newCustomFieldValueLabel }}<strong>*</strong></label>\r\n <input\r\n class=\"form-control\"\r\n [(ngModel)]=\"newCustomField.value\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n dndDropzone\r\n (dndDrop)=\"onDropAttr($event, 'value', newCustomField)\"\r\n />\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"row actions-buttons\">\r\n <div class=\"col-md-12 pull-right\">\r\n <button class=\"btn btn-outline-primary float-left\" *ngIf=\"!newCustomField\" (click)=\"newCustomField = {}\">\r\n {{ this.newCustomFieldAddLabel }}\r\n </button>\r\n <button\r\n class=\"btn btn-outline-danger float-left ml-2\"\r\n *ngIf=\"newCustomField\"\r\n (click)=\"newCustomField = null\"\r\n >\r\n {{ this.newCustomFieldCancelLabel }}\r\n </button>\r\n <button\r\n class=\"btn btn-outline-primary float-left\"\r\n *ngIf=\"newCustomField && newCustomField.label && newCustomField.value\"\r\n (click)=\"saveNewAttribute(newCustomField)\"\r\n >\r\n {{ this.newCustomFieldSaveLabel }}\r\n </button>\r\n </div>\r\n</div>\r\n", styles: [".customAttributeDeleteIcon{position:absolute;right:15px;top:4px;cursor:pointer;font-size:16px;color:red}.customAttributeDeleteIcon:hover{color:#777}.struct-custom-field{margin-top:16px;padding:8px 16px 16px;background-color:#ececec}\n"] }]
437
+ }], null, { onDropFunction: [{
438
+ type: Input
439
+ }], customAttributeRemoveLabel: [{
440
+ type: Input
441
+ }], newCustomFieldNameLabel: [{
442
+ type: Input
443
+ }], newCustomFieldValueLabel: [{
444
+ type: Input
445
+ }], newCustomFieldAddLabel: [{
446
+ type: Input
447
+ }], newCustomFieldSaveLabel: [{
448
+ type: Input
449
+ }], newCustomFieldCancelLabel: [{
450
+ type: Input
451
+ }], onSaveAttribute: [{
452
+ type: Output
453
+ }], onDropOnAttribute: [{
454
+ type: Output
460
455
  }] }); })();
461
456
 
462
- function SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template(rf, ctx) { if (rf & 1) {
463
- const _r8 = i0.ɵɵgetCurrentView();
464
- i0.ɵɵelementStart(0, "schema-form", 4);
465
- i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template_schema_form_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r8); const item_r3 = i0.ɵɵnextContext().$implicit; const ctx_r7 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r7.model[ctx_r7.schema.id][item_r3.index].mappingAttributes = $event); });
466
- i0.ɵɵelementEnd();
467
- } if (rf & 2) {
468
- const item_r3 = i0.ɵɵnextContext().$implicit;
469
- const ctx_r4 = i0.ɵɵnextContext(2);
470
- i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r4.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r4.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r4.selectClearLabel)("selectNotFoundLabel", ctx_r4.selectNotFoundLabel)("requiredLabel", ctx_r4.requiredLabel)("addItemLabel", ctx_r4.addItemLabel)("addLoopLabel", ctx_r4.addLoopLabel)("additionalAttributesLabel", ctx_r4.additionalAttributesLabel)("customAttributeRemoveLabel", ctx_r4.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r4.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r4.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r4.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r4.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r4.newCustomFieldCancelLabel)("idPrefix", ctx_r4.idPrefix)("model", ctx_r4.model[ctx_r4.schema.id][item_r3.index].mappingAttributes)("schemas", ctx_r4.getSchemaProperties())("editing", ctx_r4.editing);
471
- } }
472
- function SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template(rf, ctx) { if (rf & 1) {
473
- const _r12 = i0.ɵɵgetCurrentView();
474
- i0.ɵɵelementStart(0, "schema-form", 4);
475
- i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template_schema_form_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r12); const item_r3 = i0.ɵɵnextContext().$implicit; const ctx_r11 = i0.ɵɵnextContext(2); return i0.ɵɵresetView((ctx_r11.model[ctx_r11.schema.id][item_r3.index] = $event)); });
476
- i0.ɵɵelementEnd();
477
- } if (rf & 2) {
478
- const item_r3 = i0.ɵɵnextContext().$implicit;
479
- const ctx_r5 = i0.ɵɵnextContext(2);
480
- i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r5.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r5.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r5.selectClearLabel)("selectNotFoundLabel", ctx_r5.selectNotFoundLabel)("requiredLabel", ctx_r5.requiredLabel)("addItemLabel", ctx_r5.addItemLabel)("addLoopLabel", ctx_r5.addLoopLabel)("additionalAttributesLabel", ctx_r5.additionalAttributesLabel)("customAttributeRemoveLabel", ctx_r5.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r5.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r5.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r5.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r5.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r5.newCustomFieldCancelLabel)("idPrefix", ctx_r5.idPrefix)("model", ctx_r5.model[ctx_r5.schema.id][item_r3.index])("schemas", ctx_r5.getSchemaProperties())("editing", ctx_r5.editing);
481
- } }
482
- function SchemaArrayComponent_div_0_ng_template_2_div_2_Template(rf, ctx) { if (rf & 1) {
483
- const _r16 = i0.ɵɵgetCurrentView();
484
- i0.ɵɵelementStart(0, "div", 5)(1, "div", 6)(2, "label", 7);
485
- i0.ɵɵtext(3);
486
- i0.ɵɵelementEnd();
487
- i0.ɵɵelementStart(4, "schema-custom-attributes", 8);
488
- i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_div_2_Template_schema_custom_attributes_modelChange_4_listener($event) { i0.ɵɵrestoreView(_r16); const item_r3 = i0.ɵɵnextContext().$implicit; const ctx_r15 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r15.model[ctx_r15.schema.id][item_r3.index].customAttributes = $event); });
489
- i0.ɵɵelementEnd()()();
490
- } if (rf & 2) {
491
- const item_r3 = i0.ɵɵnextContext().$implicit;
492
- const ctx_r6 = i0.ɵɵnextContext(2);
493
- i0.ɵɵadvance(3);
494
- i0.ɵɵtextInterpolate(ctx_r6.additionalAttributesLabel);
495
- i0.ɵɵadvance(1);
496
- i0.ɵɵproperty("customAttributeRemoveLabel", ctx_r6.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r6.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r6.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r6.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r6.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r6.newCustomFieldCancelLabel)("model", ctx_r6.model[ctx_r6.schema.id][item_r3.index].customAttributes)("onDropFunction", ctx_r6.onDrop);
497
- } }
498
- function SchemaArrayComponent_div_0_ng_template_2_Template(rf, ctx) { if (rf & 1) {
499
- i0.ɵɵtemplate(0, SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template, 1, 18, "schema-form", 2);
500
- i0.ɵɵtemplate(1, SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template, 1, 18, "schema-form", 2);
501
- i0.ɵɵtemplate(2, SchemaArrayComponent_div_0_ng_template_2_div_2_Template, 5, 9, "div", 3);
502
- } if (rf & 2) {
503
- const item_r3 = ctx.$implicit;
504
- const ctx_r2 = i0.ɵɵnextContext(2);
505
- i0.ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index].loop !== undefined);
506
- i0.ɵɵadvance(1);
507
- i0.ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index].loop == undefined);
508
- i0.ɵɵadvance(1);
509
- i0.ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index] && ctx_r2.schema.customProperties);
510
- } }
511
- function SchemaArrayComponent_div_0_Template(rf, ctx) { if (rf & 1) {
512
- const _r20 = i0.ɵɵgetCurrentView();
513
- i0.ɵɵelementStart(0, "div")(1, "array-session", 1);
514
- i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_Template_array_session_modelChange_1_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r19 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r19.model[ctx_r19.schema.id] = $event)); })("onAdd", function SchemaArrayComponent_div_0_Template_array_session_onAdd_1_listener() { i0.ɵɵrestoreView(_r20); const ctx_r21 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r21.addArrayItem(ctx_r21.schema.id, {})); })("onAddLoop", function SchemaArrayComponent_div_0_Template_array_session_onAddLoop_1_listener() { i0.ɵɵrestoreView(_r20); const ctx_r22 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r22.addArrayLoop(ctx_r22.schema.id, {})); });
515
- i0.ɵɵtemplate(2, SchemaArrayComponent_div_0_ng_template_2_Template, 3, 3, "ng-template");
516
- i0.ɵɵelementEnd()();
517
- } if (rf & 2) {
518
- const ctx_r0 = i0.ɵɵnextContext();
519
- i0.ɵɵadvance(1);
520
- i0.ɵɵproperty("addItemLabel", ctx_r0.addItemLabel)("addLoopLabel", ctx_r0.addLoopLabel)("label", ctx_r0.schema.title)("removeLabel", ctx_r0.schema.title)("model", ctx_r0.model[ctx_r0.schema.id])("showAddLoop", ctx_r0.schema.withoutLoop !== true);
521
- } }
522
- const _c0$4 = function () { return { standalone: true }; };
523
- function SchemaArrayComponent_div_1_ng_template_2_input_2_Template(rf, ctx) { if (rf & 1) {
524
- const _r30 = i0.ɵɵgetCurrentView();
525
- i0.ɵɵelementStart(0, "input", 12);
526
- i0.ɵɵlistener("ngModelChange", function SchemaArrayComponent_div_1_ng_template_2_input_2_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r30); const item_r24 = i0.ɵɵnextContext().$implicit; return i0.ɵɵresetView(item_r24.items[item_r24.index].mappingAttributes = $event); })("dndDrop", function SchemaArrayComponent_div_1_ng_template_2_input_2_Template_input_dndDrop_0_listener($event) { i0.ɵɵrestoreView(_r30); const item_r24 = i0.ɵɵnextContext().$implicit; const ctx_r31 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(item_r24.items[item_r24.index].mappingAttributes = ctx_r31.onDrop($event, item_r24.items[item_r24.index].mappingAttributes)); });
527
- i0.ɵɵelementEnd();
528
- } if (rf & 2) {
529
- const item_r24 = i0.ɵɵnextContext().$implicit;
530
- const ctx_r25 = i0.ɵɵnextContext(2);
531
- i0.ɵɵproperty("ngModel", item_r24.items[item_r24.index].mappingAttributes)("ngModelOptions", i0.ɵɵpureFunction0(3, _c0$4))("id", ctx_r25.getId(ctx_r25.index) + "-" + item_r24.index);
532
- } }
533
- function SchemaArrayComponent_div_1_ng_template_2_ng_template_3_Template(rf, ctx) { if (rf & 1) {
534
- const _r36 = i0.ɵɵgetCurrentView();
535
- i0.ɵɵelementStart(0, "input", 12);
536
- i0.ɵɵlistener("ngModelChange", function SchemaArrayComponent_div_1_ng_template_2_ng_template_3_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r36); const item_r24 = i0.ɵɵnextContext().$implicit; return i0.ɵɵresetView((item_r24.items[item_r24.index] = $event)); })("dndDrop", function SchemaArrayComponent_div_1_ng_template_2_ng_template_3_Template_input_dndDrop_0_listener($event) { i0.ɵɵrestoreView(_r36); const item_r24 = i0.ɵɵnextContext().$implicit; const ctx_r37 = i0.ɵɵnextContext(2); return i0.ɵɵresetView((item_r24.items[item_r24.index] = ctx_r37.onDrop($event, item_r24.items[item_r24.index]))); });
537
- i0.ɵɵelementEnd();
538
- } if (rf & 2) {
539
- const item_r24 = i0.ɵɵnextContext().$implicit;
540
- const ctx_r27 = i0.ɵɵnextContext(2);
541
- i0.ɵɵproperty("ngModel", item_r24.items[item_r24.index])("ngModelOptions", i0.ɵɵpureFunction0(3, _c0$4))("id", ctx_r27.getId(ctx_r27.index) + "-" + item_r24.index);
542
- } }
543
- function SchemaArrayComponent_div_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
544
- i0.ɵɵelementStart(0, "label", 9);
545
- i0.ɵɵtext(1);
546
- i0.ɵɵelementEnd();
547
- i0.ɵɵtemplate(2, SchemaArrayComponent_div_1_ng_template_2_input_2_Template, 1, 4, "input", 10);
548
- i0.ɵɵtemplate(3, SchemaArrayComponent_div_1_ng_template_2_ng_template_3_Template, 1, 4, "ng-template", null, 11, i0.ɵɵtemplateRefExtractor);
549
- } if (rf & 2) {
550
- const item_r24 = ctx.$implicit;
551
- const _r26 = i0.ɵɵreference(4);
552
- const ctx_r23 = i0.ɵɵnextContext(2);
553
- i0.ɵɵproperty("htmlFor", ctx_r23.getId(ctx_r23.index) + "-" + item_r24.index);
554
- i0.ɵɵadvance(1);
555
- i0.ɵɵtextInterpolate(ctx_r23.schema.title);
556
- i0.ɵɵadvance(1);
557
- i0.ɵɵproperty("ngIf", item_r24.items[item_r24.index].mappingAttributes || item_r24.items[item_r24.index].mappingAttributes === "")("ngIfElse", _r26);
558
- } }
559
- function SchemaArrayComponent_div_1_Template(rf, ctx) { if (rf & 1) {
560
- const _r41 = i0.ɵɵgetCurrentView();
561
- i0.ɵɵelementStart(0, "div")(1, "array-session", 1);
562
- i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_1_Template_array_session_modelChange_1_listener($event) { i0.ɵɵrestoreView(_r41); const ctx_r40 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r40.model[ctx_r40.schema.id] = $event)); })("onAdd", function SchemaArrayComponent_div_1_Template_array_session_onAdd_1_listener() { i0.ɵɵrestoreView(_r41); const ctx_r42 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r42.addArrayItem(ctx_r42.schema.id, "")); })("onAddLoop", function SchemaArrayComponent_div_1_Template_array_session_onAddLoop_1_listener() { i0.ɵɵrestoreView(_r41); const ctx_r43 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r43.addArrayLoop(ctx_r43.schema.id, "")); });
563
- i0.ɵɵtemplate(2, SchemaArrayComponent_div_1_ng_template_2_Template, 5, 4, "ng-template");
564
- i0.ɵɵelementEnd()();
565
- } if (rf & 2) {
566
- const ctx_r1 = i0.ɵɵnextContext();
567
- i0.ɵɵadvance(1);
568
- i0.ɵɵproperty("addItemLabel", ctx_r1.addItemLabel)("addLoopLabel", ctx_r1.addLoopLabel)("label", ctx_r1.schema.title)("removeLabel", ctx_r1.schema.title)("model", ctx_r1.model[ctx_r1.schema.id])("showAddLoop", ctx_r1.schema.withoutLoop !== true);
569
- } }
570
- class SchemaArrayComponent extends BaseSchemaComponent {
571
- constructor() {
572
- super(...arguments);
573
- this.requiredLabel = '(required)';
574
- this.addItemLabel = 'Add Item';
575
- this.addLoopLabel = 'Add Loop';
576
- this.additionalAttributesLabel = 'Additional Fields';
577
- this.customAttributeRemoveLabel = 'Remove';
578
- this.newCustomFieldNameLabel = 'Name';
579
- this.newCustomFieldValueLabel = 'Value';
580
- this.newCustomFieldAddLabel = 'Add';
581
- this.newCustomFieldSaveLabel = 'Save';
582
- this.newCustomFieldCancelLabel = 'Cancel';
583
- this.selectPlaceHolderLabel = 'Select Item';
584
- this.selectSearchPlaceHolderLabel = 'Search';
585
- this.selectClearLabel = 'Clear';
586
- this.selectNotFoundLabel = 'No Items Found';
587
- this.editing = false;
588
- }
589
- ngAfterContentInit() {
590
- if (this.schema?.type === 'array' && this.model && !this.model[this.schema.id]) {
591
- this.model[this.schema.id] = [];
592
- }
593
- this.loaded = true;
594
- }
595
- onDrop($event, modelElement) {
596
- return onDropStruct($event, modelElement);
597
- }
598
- getId(index) {
599
- return `${this.idPrefix}-struct-${index}`;
600
- }
601
- addArrayItem(id, param) {
602
- this.model[id] = this.model[id] || [];
603
- if (this.schema.properties) {
604
- param = {};
605
- Object.keys(this.schema.properties).forEach(key => {
606
- const schemaProperty = this.schema.properties[key];
607
- if (schemaProperty.type === 'object') {
608
- param[schemaProperty.id] = {};
609
- }
610
- else if (schemaProperty.type === 'array') {
611
- param[schemaProperty.id] = [];
612
- }
613
- });
614
- }
615
- this.model[id].push(param);
616
- }
617
- addArrayLoop(id, mappingAttributes) {
618
- this.model[id] = this.model[id] || [];
619
- this.model[id].push({ loop: '', alias: '', mappingAttributes });
620
- }
621
- }
622
- SchemaArrayComponent.ɵfac = /*@__PURE__*/ function () { let ɵSchemaArrayComponent_BaseFactory; return function SchemaArrayComponent_Factory(t) { return (ɵSchemaArrayComponent_BaseFactory || (ɵSchemaArrayComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SchemaArrayComponent)))(t || SchemaArrayComponent); }; }();
623
- SchemaArrayComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchemaArrayComponent, selectors: [["schema-array"]], inputs: { requiredLabel: "requiredLabel", addItemLabel: "addItemLabel", addLoopLabel: "addLoopLabel", additionalAttributesLabel: "additionalAttributesLabel", customAttributeRemoveLabel: "customAttributeRemoveLabel", newCustomFieldNameLabel: "newCustomFieldNameLabel", newCustomFieldValueLabel: "newCustomFieldValueLabel", newCustomFieldAddLabel: "newCustomFieldAddLabel", newCustomFieldSaveLabel: "newCustomFieldSaveLabel", newCustomFieldCancelLabel: "newCustomFieldCancelLabel", selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", idPrefix: "idPrefix", schema: "schema", editing: "editing", index: "index" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [[4, "ngIf"], [3, "addItemLabel", "addLoopLabel", "label", "removeLabel", "model", "showAddLoop", "modelChange", "onAdd", "onAddLoop"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "addItemLabel", "addLoopLabel", "additionalAttributesLabel", "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "idPrefix", "model", "schemas", "editing", "modelChange", 4, "ngIf"], ["class", "row struct-custom-properties", 4, "ngIf"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "addItemLabel", "addLoopLabel", "additionalAttributesLabel", "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "idPrefix", "model", "schemas", "editing", "modelChange"], [1, "row", "struct-custom-properties"], [1, "col-md-12"], [1, "info-label", "bold"], [3, "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "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) {
624
- i0.ɵɵtemplate(0, SchemaArrayComponent_div_0_Template, 3, 6, "div", 0);
625
- i0.ɵɵtemplate(1, SchemaArrayComponent_div_1_Template, 3, 6, "div", 0);
626
- } if (rf & 2) {
627
- i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type === "array" && ctx.schema.properties);
628
- i0.ɵɵadvance(1);
629
- i0.ɵɵproperty("ngIf", ctx.schema && ctx.canRender(ctx.schema) && ctx.schema.type === "array" && !ctx.schema.properties);
630
- } }, dependencies: [i1.NgIf, i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.NgModel, ArraySessionComponent, SchemaFormComponent, SchemaCustomAttributesComponent] });
631
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaArrayComponent, [{
632
- type: Component,
633
- args: [{ selector: 'schema-array', template: "<div *ngIf=\"loaded && canRender(schema) && schema.type === 'array' && schema.properties\">\r\n <array-session\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [label]=\"schema.title\"\r\n [removeLabel]=\"schema.title\"\r\n [(model)]=\"this.model[schema.id]\"\r\n [showAddLoop]=\"schema.withoutLoop !== true\"\r\n (onAdd)=\"addArrayItem(schema.id, {})\"\r\n (onAddLoop)=\"addArrayLoop(schema.id, {})\">\r\n <ng-template let-item>\r\n <schema-form\r\n *ngIf=\"this.model[schema.id][item.index].loop !== undefined\"\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"this.model[schema.id][item.index].mappingAttributes\"\r\n [schemas]=\"getSchemaProperties()\"\r\n [editing]=\"this.editing\">\r\n </schema-form>\r\n <schema-form\r\n *ngIf=\"this.model[schema.id][item.index].loop == undefined\"\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"this.model[schema.id][item.index]\"\r\n [schemas]=\"getSchemaProperties()\"\r\n [editing]=\"this.editing\">\r\n </schema-form>\r\n\r\n <div class=\"row struct-custom-properties\" *ngIf=\"this.model[schema.id][item.index] && schema.customProperties\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label bold\">{{ this.additionalAttributesLabel }}</label>\r\n <schema-custom-attributes\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [(model)]=\"this.model[schema.id][item.index].customAttributes\"\r\n [onDropFunction]=\"onDrop\">\r\n </schema-custom-attributes>\r\n </div>\r\n </div>\r\n\r\n </ng-template>\r\n </array-session>\r\n</div>\r\n<div *ngIf=\"schema && canRender(schema) && schema.type === 'array' && !schema.properties\">\r\n <array-session\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [label]=\"schema.title\"\r\n [removeLabel]=\"schema.title\"\r\n [(model)]=\"this.model[schema.id]\"\r\n [showAddLoop]=\"schema.withoutLoop !== true\"\r\n (onAdd)=\"addArrayItem(schema.id, '')\"\r\n (onAddLoop)=\"addArrayLoop(schema.id, '')\"\r\n >\r\n <ng-template let-item>\r\n <label class=\"info-label\" [htmlFor]=\"getId(index)+'-'+item.index\">{{ schema.title }}</label>\r\n <input class=\"form-control\" type=\"text\" [(ngModel)]=\"item.items[item.index].mappingAttributes\"\r\n [ngModelOptions]=\"{standalone: true}\" dndDropzone\r\n (dndDrop)=\"item.items[item.index].mappingAttributes = this.onDrop($event, item.items[item.index].mappingAttributes)\"\r\n *ngIf=\"item.items[item.index].mappingAttributes || item.items[item.index].mappingAttributes === ''; else elseBlock\"\r\n [id]=\"getId(index)+'-'+item.index\"/>\r\n <ng-template #elseBlock>\r\n <input class=\"form-control\" type=\"text\" [(ngModel)]=\"item.items[item.index]\"\r\n [ngModelOptions]=\"{standalone: true}\" dndDropzone\r\n (dndDrop)=\"item.items[item.index] = this.onDrop($event, item.items[item.index])\"\r\n [id]=\"getId(index)+'-'+item.index\"/>\r\n </ng-template>\r\n </ng-template>\r\n </array-session>\r\n</div>\r\n" }]
634
- }], null, { requiredLabel: [{
635
- type: Input
636
- }], addItemLabel: [{
637
- type: Input
638
- }], addLoopLabel: [{
639
- type: Input
640
- }], additionalAttributesLabel: [{
641
- type: Input
642
- }], customAttributeRemoveLabel: [{
643
- type: Input
644
- }], newCustomFieldNameLabel: [{
645
- type: Input
646
- }], newCustomFieldValueLabel: [{
647
- type: Input
648
- }], newCustomFieldAddLabel: [{
649
- type: Input
650
- }], newCustomFieldSaveLabel: [{
651
- type: Input
652
- }], newCustomFieldCancelLabel: [{
653
- type: Input
654
- }], selectPlaceHolderLabel: [{
655
- type: Input
656
- }], selectSearchPlaceHolderLabel: [{
657
- type: Input
658
- }], selectClearLabel: [{
659
- type: Input
660
- }], selectNotFoundLabel: [{
661
- type: Input
662
- }], idPrefix: [{
663
- type: Input
664
- }], schema: [{
665
- type: Input
666
- }], editing: [{
667
- type: Input
668
- }], index: [{
669
- type: Input
457
+ function SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template(rf, ctx) { if (rf & 1) {
458
+ const _r8 = i0.ɵɵgetCurrentView();
459
+ i0.ɵɵelementStart(0, "schema-form", 4);
460
+ i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template_schema_form_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r8); const item_r3 = i0.ɵɵnextContext().$implicit; const ctx_r7 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r7.model[ctx_r7.schema.id][item_r3.index].mappingAttributes = $event); });
461
+ i0.ɵɵelementEnd();
462
+ } if (rf & 2) {
463
+ const item_r3 = i0.ɵɵnextContext().$implicit;
464
+ const ctx_r4 = i0.ɵɵnextContext(2);
465
+ i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r4.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r4.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r4.selectClearLabel)("selectNotFoundLabel", ctx_r4.selectNotFoundLabel)("requiredLabel", ctx_r4.requiredLabel)("addItemLabel", ctx_r4.addItemLabel)("addLoopLabel", ctx_r4.addLoopLabel)("additionalAttributesLabel", ctx_r4.additionalAttributesLabel)("customAttributeRemoveLabel", ctx_r4.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r4.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r4.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r4.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r4.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r4.newCustomFieldCancelLabel)("idPrefix", ctx_r4.idPrefix)("model", ctx_r4.model[ctx_r4.schema.id][item_r3.index].mappingAttributes)("schemas", ctx_r4.getSchemaProperties())("editing", ctx_r4.editing);
466
+ } }
467
+ function SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template(rf, ctx) { if (rf & 1) {
468
+ const _r12 = i0.ɵɵgetCurrentView();
469
+ i0.ɵɵelementStart(0, "schema-form", 4);
470
+ i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template_schema_form_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r12); const item_r3 = i0.ɵɵnextContext().$implicit; const ctx_r11 = i0.ɵɵnextContext(2); return i0.ɵɵresetView((ctx_r11.model[ctx_r11.schema.id][item_r3.index] = $event)); });
471
+ i0.ɵɵelementEnd();
472
+ } if (rf & 2) {
473
+ const item_r3 = i0.ɵɵnextContext().$implicit;
474
+ const ctx_r5 = i0.ɵɵnextContext(2);
475
+ i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r5.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r5.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r5.selectClearLabel)("selectNotFoundLabel", ctx_r5.selectNotFoundLabel)("requiredLabel", ctx_r5.requiredLabel)("addItemLabel", ctx_r5.addItemLabel)("addLoopLabel", ctx_r5.addLoopLabel)("additionalAttributesLabel", ctx_r5.additionalAttributesLabel)("customAttributeRemoveLabel", ctx_r5.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r5.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r5.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r5.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r5.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r5.newCustomFieldCancelLabel)("idPrefix", ctx_r5.idPrefix)("model", ctx_r5.model[ctx_r5.schema.id][item_r3.index])("schemas", ctx_r5.getSchemaProperties())("editing", ctx_r5.editing);
476
+ } }
477
+ function SchemaArrayComponent_div_0_ng_template_2_div_2_Template(rf, ctx) { if (rf & 1) {
478
+ const _r16 = i0.ɵɵgetCurrentView();
479
+ i0.ɵɵelementStart(0, "div", 5)(1, "div", 6)(2, "label", 7);
480
+ i0.ɵɵtext(3);
481
+ i0.ɵɵelementEnd();
482
+ i0.ɵɵelementStart(4, "schema-custom-attributes", 8);
483
+ i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_div_2_Template_schema_custom_attributes_modelChange_4_listener($event) { i0.ɵɵrestoreView(_r16); const item_r3 = i0.ɵɵnextContext().$implicit; const ctx_r15 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r15.model[ctx_r15.schema.id][item_r3.index].customAttributes = $event); });
484
+ i0.ɵɵelementEnd()()();
485
+ } if (rf & 2) {
486
+ const item_r3 = i0.ɵɵnextContext().$implicit;
487
+ const ctx_r6 = i0.ɵɵnextContext(2);
488
+ i0.ɵɵadvance(3);
489
+ i0.ɵɵtextInterpolate(ctx_r6.additionalAttributesLabel);
490
+ i0.ɵɵadvance(1);
491
+ i0.ɵɵproperty("customAttributeRemoveLabel", ctx_r6.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r6.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r6.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r6.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r6.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r6.newCustomFieldCancelLabel)("model", ctx_r6.model[ctx_r6.schema.id][item_r3.index].customAttributes)("onDropFunction", ctx_r6.onDrop);
492
+ } }
493
+ function SchemaArrayComponent_div_0_ng_template_2_Template(rf, ctx) { if (rf & 1) {
494
+ i0.ɵɵtemplate(0, SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template, 1, 18, "schema-form", 2);
495
+ i0.ɵɵtemplate(1, SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template, 1, 18, "schema-form", 2);
496
+ i0.ɵɵtemplate(2, SchemaArrayComponent_div_0_ng_template_2_div_2_Template, 5, 9, "div", 3);
497
+ } if (rf & 2) {
498
+ const item_r3 = ctx.$implicit;
499
+ const ctx_r2 = i0.ɵɵnextContext(2);
500
+ i0.ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index].loop !== undefined);
501
+ i0.ɵɵadvance(1);
502
+ i0.ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index].loop == undefined);
503
+ i0.ɵɵadvance(1);
504
+ i0.ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index] && ctx_r2.schema.customProperties);
505
+ } }
506
+ function SchemaArrayComponent_div_0_Template(rf, ctx) { if (rf & 1) {
507
+ const _r20 = i0.ɵɵgetCurrentView();
508
+ i0.ɵɵelementStart(0, "div")(1, "array-session", 1);
509
+ i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_Template_array_session_modelChange_1_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r19 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r19.model[ctx_r19.schema.id] = $event)); })("onAdd", function SchemaArrayComponent_div_0_Template_array_session_onAdd_1_listener() { i0.ɵɵrestoreView(_r20); const ctx_r21 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r21.addArrayItem(ctx_r21.schema.id, {})); })("onAddLoop", function SchemaArrayComponent_div_0_Template_array_session_onAddLoop_1_listener() { i0.ɵɵrestoreView(_r20); const ctx_r22 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r22.addArrayLoop(ctx_r22.schema.id, {})); });
510
+ i0.ɵɵtemplate(2, SchemaArrayComponent_div_0_ng_template_2_Template, 3, 3, "ng-template");
511
+ i0.ɵɵelementEnd()();
512
+ } if (rf & 2) {
513
+ const ctx_r0 = i0.ɵɵnextContext();
514
+ i0.ɵɵadvance(1);
515
+ i0.ɵɵproperty("addItemLabel", ctx_r0.addItemLabel)("addLoopLabel", ctx_r0.addLoopLabel)("label", ctx_r0.schema.title)("removeLabel", ctx_r0.schema.title)("model", ctx_r0.model[ctx_r0.schema.id])("showAddLoop", ctx_r0.schema.withoutLoop !== true);
516
+ } }
517
+ const _c0$4 = function () { return { standalone: true }; };
518
+ function SchemaArrayComponent_div_1_ng_template_2_input_2_Template(rf, ctx) { if (rf & 1) {
519
+ const _r30 = i0.ɵɵgetCurrentView();
520
+ i0.ɵɵelementStart(0, "input", 12);
521
+ i0.ɵɵlistener("ngModelChange", function SchemaArrayComponent_div_1_ng_template_2_input_2_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r30); const item_r24 = i0.ɵɵnextContext().$implicit; return i0.ɵɵresetView(item_r24.items[item_r24.index].mappingAttributes = $event); })("dndDrop", function SchemaArrayComponent_div_1_ng_template_2_input_2_Template_input_dndDrop_0_listener($event) { i0.ɵɵrestoreView(_r30); const item_r24 = i0.ɵɵnextContext().$implicit; const ctx_r31 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(item_r24.items[item_r24.index].mappingAttributes = ctx_r31.onDrop($event, item_r24.items[item_r24.index].mappingAttributes)); });
522
+ i0.ɵɵelementEnd();
523
+ } if (rf & 2) {
524
+ const item_r24 = i0.ɵɵnextContext().$implicit;
525
+ const ctx_r25 = i0.ɵɵnextContext(2);
526
+ i0.ɵɵproperty("ngModel", item_r24.items[item_r24.index].mappingAttributes)("ngModelOptions", i0.ɵɵpureFunction0(3, _c0$4))("id", ctx_r25.getId(ctx_r25.index) + "-" + item_r24.index);
527
+ } }
528
+ function SchemaArrayComponent_div_1_ng_template_2_ng_template_3_Template(rf, ctx) { if (rf & 1) {
529
+ const _r36 = i0.ɵɵgetCurrentView();
530
+ i0.ɵɵelementStart(0, "input", 12);
531
+ i0.ɵɵlistener("ngModelChange", function SchemaArrayComponent_div_1_ng_template_2_ng_template_3_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r36); const item_r24 = i0.ɵɵnextContext().$implicit; return i0.ɵɵresetView((item_r24.items[item_r24.index] = $event)); })("dndDrop", function SchemaArrayComponent_div_1_ng_template_2_ng_template_3_Template_input_dndDrop_0_listener($event) { i0.ɵɵrestoreView(_r36); const item_r24 = i0.ɵɵnextContext().$implicit; const ctx_r37 = i0.ɵɵnextContext(2); return i0.ɵɵresetView((item_r24.items[item_r24.index] = ctx_r37.onDrop($event, item_r24.items[item_r24.index]))); });
532
+ i0.ɵɵelementEnd();
533
+ } if (rf & 2) {
534
+ const item_r24 = i0.ɵɵnextContext().$implicit;
535
+ const ctx_r27 = i0.ɵɵnextContext(2);
536
+ i0.ɵɵproperty("ngModel", item_r24.items[item_r24.index])("ngModelOptions", i0.ɵɵpureFunction0(3, _c0$4))("id", ctx_r27.getId(ctx_r27.index) + "-" + item_r24.index);
537
+ } }
538
+ function SchemaArrayComponent_div_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
539
+ i0.ɵɵelementStart(0, "label", 9);
540
+ i0.ɵɵtext(1);
541
+ i0.ɵɵelementEnd();
542
+ i0.ɵɵtemplate(2, SchemaArrayComponent_div_1_ng_template_2_input_2_Template, 1, 4, "input", 10);
543
+ i0.ɵɵtemplate(3, SchemaArrayComponent_div_1_ng_template_2_ng_template_3_Template, 1, 4, "ng-template", null, 11, i0.ɵɵtemplateRefExtractor);
544
+ } if (rf & 2) {
545
+ const item_r24 = ctx.$implicit;
546
+ const _r26 = i0.ɵɵreference(4);
547
+ const ctx_r23 = i0.ɵɵnextContext(2);
548
+ i0.ɵɵproperty("htmlFor", ctx_r23.getId(ctx_r23.index) + "-" + item_r24.index);
549
+ i0.ɵɵadvance(1);
550
+ i0.ɵɵtextInterpolate(ctx_r23.schema.title);
551
+ i0.ɵɵadvance(1);
552
+ i0.ɵɵproperty("ngIf", item_r24.items[item_r24.index].mappingAttributes || item_r24.items[item_r24.index].mappingAttributes === "")("ngIfElse", _r26);
553
+ } }
554
+ function SchemaArrayComponent_div_1_Template(rf, ctx) { if (rf & 1) {
555
+ const _r41 = i0.ɵɵgetCurrentView();
556
+ i0.ɵɵelementStart(0, "div")(1, "array-session", 1);
557
+ i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_1_Template_array_session_modelChange_1_listener($event) { i0.ɵɵrestoreView(_r41); const ctx_r40 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r40.model[ctx_r40.schema.id] = $event)); })("onAdd", function SchemaArrayComponent_div_1_Template_array_session_onAdd_1_listener() { i0.ɵɵrestoreView(_r41); const ctx_r42 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r42.addArrayItem(ctx_r42.schema.id, "")); })("onAddLoop", function SchemaArrayComponent_div_1_Template_array_session_onAddLoop_1_listener() { i0.ɵɵrestoreView(_r41); const ctx_r43 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r43.addArrayLoop(ctx_r43.schema.id, "")); });
558
+ i0.ɵɵtemplate(2, SchemaArrayComponent_div_1_ng_template_2_Template, 5, 4, "ng-template");
559
+ i0.ɵɵelementEnd()();
560
+ } if (rf & 2) {
561
+ const ctx_r1 = i0.ɵɵnextContext();
562
+ i0.ɵɵadvance(1);
563
+ i0.ɵɵproperty("addItemLabel", ctx_r1.addItemLabel)("addLoopLabel", ctx_r1.addLoopLabel)("label", ctx_r1.schema.title)("removeLabel", ctx_r1.schema.title)("model", ctx_r1.model[ctx_r1.schema.id])("showAddLoop", ctx_r1.schema.withoutLoop !== true);
564
+ } }
565
+ class SchemaArrayComponent extends BaseSchemaComponent {
566
+ requiredLabel = '(required)';
567
+ addItemLabel = 'Add Item';
568
+ addLoopLabel = 'Add Loop';
569
+ additionalAttributesLabel = 'Additional Fields';
570
+ customAttributeRemoveLabel = 'Remove';
571
+ newCustomFieldNameLabel = 'Name';
572
+ newCustomFieldValueLabel = 'Value';
573
+ newCustomFieldAddLabel = 'Add';
574
+ newCustomFieldSaveLabel = 'Save';
575
+ newCustomFieldCancelLabel = 'Cancel';
576
+ selectPlaceHolderLabel = 'Select Item';
577
+ selectSearchPlaceHolderLabel = 'Search';
578
+ selectClearLabel = 'Clear';
579
+ selectNotFoundLabel = 'No Items Found';
580
+ idPrefix;
581
+ editing = false;
582
+ index;
583
+ loaded;
584
+ ngAfterContentInit() {
585
+ if (this.schema?.type === 'array' && this.model && !this.model[this.schema.id]) {
586
+ this.model[this.schema.id] = [];
587
+ }
588
+ this.loaded = true;
589
+ }
590
+ onDrop($event, modelElement) {
591
+ return onDropStruct($event, modelElement);
592
+ }
593
+ getId(index) {
594
+ return `${this.idPrefix}-struct-${index}`;
595
+ }
596
+ addArrayItem(id, param) {
597
+ this.model[id] = this.model[id] || [];
598
+ if (this.schema.properties) {
599
+ param = {};
600
+ Object.keys(this.schema.properties).forEach(key => {
601
+ const schemaProperty = this.schema.properties[key];
602
+ if (schemaProperty.type === 'object') {
603
+ param[schemaProperty.id] = {};
604
+ }
605
+ else if (schemaProperty.type === 'array') {
606
+ param[schemaProperty.id] = [];
607
+ }
608
+ });
609
+ }
610
+ this.model[id].push(param);
611
+ }
612
+ addArrayLoop(id, mappingAttributes) {
613
+ this.model[id] = this.model[id] || [];
614
+ this.model[id].push({ loop: '', alias: '', mappingAttributes });
615
+ }
616
+ static ɵfac = /*@__PURE__*/ function () { let ɵSchemaArrayComponent_BaseFactory; return function SchemaArrayComponent_Factory(t) { return (ɵSchemaArrayComponent_BaseFactory || (ɵSchemaArrayComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SchemaArrayComponent)))(t || SchemaArrayComponent); }; }();
617
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchemaArrayComponent, selectors: [["schema-array"]], inputs: { requiredLabel: "requiredLabel", addItemLabel: "addItemLabel", addLoopLabel: "addLoopLabel", additionalAttributesLabel: "additionalAttributesLabel", customAttributeRemoveLabel: "customAttributeRemoveLabel", newCustomFieldNameLabel: "newCustomFieldNameLabel", newCustomFieldValueLabel: "newCustomFieldValueLabel", newCustomFieldAddLabel: "newCustomFieldAddLabel", newCustomFieldSaveLabel: "newCustomFieldSaveLabel", newCustomFieldCancelLabel: "newCustomFieldCancelLabel", selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", idPrefix: "idPrefix", editing: "editing", index: "index" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [[4, "ngIf"], [3, "addItemLabel", "addLoopLabel", "label", "removeLabel", "model", "showAddLoop", "modelChange", "onAdd", "onAddLoop"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "addItemLabel", "addLoopLabel", "additionalAttributesLabel", "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "idPrefix", "model", "schemas", "editing", "modelChange", 4, "ngIf"], ["class", "row struct-custom-properties", 4, "ngIf"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "addItemLabel", "addLoopLabel", "additionalAttributesLabel", "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "idPrefix", "model", "schemas", "editing", "modelChange"], [1, "row", "struct-custom-properties"], [1, "col-md-12"], [1, "info-label", "bold"], [3, "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "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) {
618
+ i0.ɵɵtemplate(0, SchemaArrayComponent_div_0_Template, 3, 6, "div", 0);
619
+ i0.ɵɵtemplate(1, SchemaArrayComponent_div_1_Template, 3, 6, "div", 0);
620
+ } if (rf & 2) {
621
+ i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type === "array" && ctx.schema.properties);
622
+ i0.ɵɵadvance(1);
623
+ i0.ɵɵproperty("ngIf", ctx.schema && ctx.canRender(ctx.schema) && ctx.schema.type === "array" && !ctx.schema.properties);
624
+ } }, dependencies: [i1.NgIf, i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.NgModel, ArraySessionComponent, SchemaFormComponent, SchemaCustomAttributesComponent] });
625
+ }
626
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaArrayComponent, [{
627
+ type: Component,
628
+ args: [{ selector: 'schema-array', template: "<div *ngIf=\"loaded && canRender(schema) && schema.type === 'array' && schema.properties\">\r\n <array-session\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [label]=\"schema.title\"\r\n [removeLabel]=\"schema.title\"\r\n [(model)]=\"this.model[schema.id]\"\r\n [showAddLoop]=\"schema.withoutLoop !== true\"\r\n (onAdd)=\"addArrayItem(schema.id, {})\"\r\n (onAddLoop)=\"addArrayLoop(schema.id, {})\">\r\n <ng-template let-item>\r\n <schema-form\r\n *ngIf=\"this.model[schema.id][item.index].loop !== undefined\"\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"this.model[schema.id][item.index].mappingAttributes\"\r\n [schemas]=\"getSchemaProperties()\"\r\n [editing]=\"this.editing\">\r\n </schema-form>\r\n <schema-form\r\n *ngIf=\"this.model[schema.id][item.index].loop == undefined\"\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"this.model[schema.id][item.index]\"\r\n [schemas]=\"getSchemaProperties()\"\r\n [editing]=\"this.editing\">\r\n </schema-form>\r\n\r\n <div class=\"row struct-custom-properties\" *ngIf=\"this.model[schema.id][item.index] && schema.customProperties\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label bold\">{{ this.additionalAttributesLabel }}</label>\r\n <schema-custom-attributes\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [(model)]=\"this.model[schema.id][item.index].customAttributes\"\r\n [onDropFunction]=\"onDrop\">\r\n </schema-custom-attributes>\r\n </div>\r\n </div>\r\n\r\n </ng-template>\r\n </array-session>\r\n</div>\r\n<div *ngIf=\"schema && canRender(schema) && schema.type === 'array' && !schema.properties\">\r\n <array-session\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [label]=\"schema.title\"\r\n [removeLabel]=\"schema.title\"\r\n [(model)]=\"this.model[schema.id]\"\r\n [showAddLoop]=\"schema.withoutLoop !== true\"\r\n (onAdd)=\"addArrayItem(schema.id, '')\"\r\n (onAddLoop)=\"addArrayLoop(schema.id, '')\"\r\n >\r\n <ng-template let-item>\r\n <label class=\"info-label\" [htmlFor]=\"getId(index)+'-'+item.index\">{{ schema.title }}</label>\r\n <input class=\"form-control\" type=\"text\" [(ngModel)]=\"item.items[item.index].mappingAttributes\"\r\n [ngModelOptions]=\"{standalone: true}\" dndDropzone\r\n (dndDrop)=\"item.items[item.index].mappingAttributes = this.onDrop($event, item.items[item.index].mappingAttributes)\"\r\n *ngIf=\"item.items[item.index].mappingAttributes || item.items[item.index].mappingAttributes === ''; else elseBlock\"\r\n [id]=\"getId(index)+'-'+item.index\"/>\r\n <ng-template #elseBlock>\r\n <input class=\"form-control\" type=\"text\" [(ngModel)]=\"item.items[item.index]\"\r\n [ngModelOptions]=\"{standalone: true}\" dndDropzone\r\n (dndDrop)=\"item.items[item.index] = this.onDrop($event, item.items[item.index])\"\r\n [id]=\"getId(index)+'-'+item.index\"/>\r\n </ng-template>\r\n </ng-template>\r\n </array-session>\r\n</div>\r\n" }]
629
+ }], null, { requiredLabel: [{
630
+ type: Input
631
+ }], addItemLabel: [{
632
+ type: Input
633
+ }], addLoopLabel: [{
634
+ type: Input
635
+ }], additionalAttributesLabel: [{
636
+ type: Input
637
+ }], customAttributeRemoveLabel: [{
638
+ type: Input
639
+ }], newCustomFieldNameLabel: [{
640
+ type: Input
641
+ }], newCustomFieldValueLabel: [{
642
+ type: Input
643
+ }], newCustomFieldAddLabel: [{
644
+ type: Input
645
+ }], newCustomFieldSaveLabel: [{
646
+ type: Input
647
+ }], newCustomFieldCancelLabel: [{
648
+ type: Input
649
+ }], selectPlaceHolderLabel: [{
650
+ type: Input
651
+ }], selectSearchPlaceHolderLabel: [{
652
+ type: Input
653
+ }], selectClearLabel: [{
654
+ type: Input
655
+ }], selectNotFoundLabel: [{
656
+ type: Input
657
+ }], idPrefix: [{
658
+ type: Input
659
+ }], editing: [{
660
+ type: Input
661
+ }], index: [{
662
+ type: Input
670
663
  }] }); })();
671
664
 
672
- const _c0$3 = function (a0) { return { "has-error": a0 }; };
673
- function FieldRenderComponent_small_3_Template(rf, ctx) { if (rf & 1) {
674
- i0.ɵɵelementStart(0, "small", 0);
675
- i0.ɵɵtext(1);
676
- i0.ɵɵelementEnd();
677
- } if (rf & 2) {
678
- const ctx_r0 = i0.ɵɵnextContext();
679
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c0$3, ctx_r0.state && !ctx_r0.state.valid && ctx_r0.state.errors));
680
- i0.ɵɵadvance(1);
681
- i0.ɵɵtextInterpolate(ctx_r0.requiredLabel);
682
- } }
683
- function FieldRenderComponent_span_4_Template(rf, ctx) { if (rf & 1) {
684
- i0.ɵɵelementStart(0, "span", 4);
685
- i0.ɵɵelement(1, "i", 5);
686
- i0.ɵɵelementEnd();
687
- } if (rf & 2) {
688
- const ctx_r1 = i0.ɵɵnextContext();
689
- i0.ɵɵpropertyInterpolate("matTooltip", ctx_r1.tooltip);
690
- } }
691
- const _c1$1 = ["*"];
692
- class FieldRenderComponent {
693
- constructor() {
694
- this.requiredLabel = '(required)';
695
- this.label = '';
696
- this.required = true;
697
- }
698
- }
699
- FieldRenderComponent.ɵfac = function FieldRenderComponent_Factory(t) { return new (t || FieldRenderComponent)(); };
700
- FieldRenderComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FieldRenderComponent, selectors: [["field-render"]], inputs: { requiredLabel: "requiredLabel", label: "label", inputId: "inputId", tooltip: "tooltip", required: "required", state: "state" }, ngContentSelectors: _c1$1, decls: 6, vars: 7, 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) {
701
- i0.ɵɵprojectionDef();
702
- i0.ɵɵelementStart(0, "div", 0)(1, "label", 1);
703
- i0.ɵɵtext(2);
704
- i0.ɵɵtemplate(3, FieldRenderComponent_small_3_Template, 2, 4, "small", 2);
705
- i0.ɵɵtemplate(4, FieldRenderComponent_span_4_Template, 2, 1, "span", 3);
706
- i0.ɵɵelementEnd();
707
- i0.ɵɵprojection(5);
708
- i0.ɵɵelementEnd();
709
- } if (rf & 2) {
710
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(5, _c0$3, ctx.state && !ctx.state.valid && (!ctx.state.pristine || ctx.state.touched) && ctx.state.errors));
711
- i0.ɵɵadvance(1);
712
- i0.ɵɵproperty("htmlFor", ctx.inputId);
713
- i0.ɵɵadvance(1);
714
- i0.ɵɵtextInterpolate1(" ", ctx.label, " ");
715
- i0.ɵɵadvance(1);
716
- i0.ɵɵproperty("ngIf", ctx.required);
717
- i0.ɵɵadvance(1);
718
- i0.ɵɵproperty("ngIf", ctx.tooltip);
719
- } }, dependencies: [i1.NgClass, i1.NgIf, i2$1.MatTooltip], styles: [".info-icon[_ngcontent-%COMP%]{color:#222d57;font-size:13px;float:right;margin-left:4px}"] });
720
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FieldRenderComponent, [{
721
- type: Component,
722
- args: [{ selector: 'field-render', template: "<div [ngClass]=\"{'has-error':state && !state.valid && (!state.pristine || state.touched) && state.errors}\">\r\n <label class=\"info-label bold\" [htmlFor]=\"inputId\">\r\n {{ label }}\r\n <small [ngClass]=\"{'has-error':state && !state.valid && state.errors}\" *ngIf=\"required\">{{this.requiredLabel}}</small>\r\n <span class=\"info-icon\" matTooltip=\"{{ tooltip }}\" *ngIf=\"tooltip\">\r\n <i class=\"far fa-question-circle\"></i>\r\n </span>\r\n </label>\r\n\r\n <!-- Input, textarea or select -->\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: [".info-icon{color:#222d57;font-size:13px;float:right;margin-left:4px}\n"] }]
723
- }], null, { requiredLabel: [{
724
- type: Input
725
- }], label: [{
726
- type: Input
727
- }], inputId: [{
728
- type: Input
729
- }], tooltip: [{
730
- type: Input
731
- }], required: [{
732
- type: Input
733
- }], state: [{
734
- type: Input
665
+ const _c0$3 = function (a0) { return { "has-error": a0 }; };
666
+ function FieldRenderComponent_small_3_Template(rf, ctx) { if (rf & 1) {
667
+ i0.ɵɵelementStart(0, "small", 0);
668
+ i0.ɵɵtext(1);
669
+ i0.ɵɵelementEnd();
670
+ } if (rf & 2) {
671
+ const ctx_r0 = i0.ɵɵnextContext();
672
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c0$3, ctx_r0.state && !ctx_r0.state.valid && ctx_r0.state.errors));
673
+ i0.ɵɵadvance(1);
674
+ i0.ɵɵtextInterpolate(ctx_r0.requiredLabel);
675
+ } }
676
+ function FieldRenderComponent_span_4_Template(rf, ctx) { if (rf & 1) {
677
+ i0.ɵɵelementStart(0, "span", 4);
678
+ i0.ɵɵelement(1, "i", 5);
679
+ i0.ɵɵelementEnd();
680
+ } if (rf & 2) {
681
+ const ctx_r1 = i0.ɵɵnextContext();
682
+ i0.ɵɵpropertyInterpolate("matTooltip", ctx_r1.tooltip);
683
+ } }
684
+ const _c1$1 = ["*"];
685
+ class FieldRenderComponent {
686
+ requiredLabel = '(required)';
687
+ label = '';
688
+ inputId;
689
+ tooltip;
690
+ required = true;
691
+ /**
692
+ * Estado do input no formulário para validar quando
693
+ * é necessário exibir as mensagens de erro.
694
+ */
695
+ state;
696
+ static ɵfac = function FieldRenderComponent_Factory(t) { return new (t || FieldRenderComponent)(); };
697
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FieldRenderComponent, selectors: [["field-render"]], inputs: { requiredLabel: "requiredLabel", label: "label", inputId: "inputId", tooltip: "tooltip", required: "required", state: "state" }, ngContentSelectors: _c1$1, decls: 6, vars: 7, 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) {
698
+ i0.ɵɵprojectionDef();
699
+ i0.ɵɵelementStart(0, "div", 0)(1, "label", 1);
700
+ i0.ɵɵtext(2);
701
+ i0.ɵɵtemplate(3, FieldRenderComponent_small_3_Template, 2, 4, "small", 2);
702
+ i0.ɵɵtemplate(4, FieldRenderComponent_span_4_Template, 2, 1, "span", 3);
703
+ i0.ɵɵelementEnd();
704
+ i0.ɵɵprojection(5);
705
+ i0.ɵɵelementEnd();
706
+ } if (rf & 2) {
707
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(5, _c0$3, ctx.state && !ctx.state.valid && (!ctx.state.pristine || ctx.state.touched) && ctx.state.errors));
708
+ i0.ɵɵadvance(1);
709
+ i0.ɵɵproperty("htmlFor", ctx.inputId);
710
+ i0.ɵɵadvance(1);
711
+ i0.ɵɵtextInterpolate1(" ", ctx.label, " ");
712
+ i0.ɵɵadvance(1);
713
+ i0.ɵɵproperty("ngIf", ctx.required);
714
+ i0.ɵɵadvance(1);
715
+ i0.ɵɵproperty("ngIf", ctx.tooltip);
716
+ } }, dependencies: [i1.NgClass, i1.NgIf, i2$1.MatTooltip], styles: [".info-icon[_ngcontent-%COMP%]{color:#222d57;font-size:13px;float:right;margin-left:4px}"] });
717
+ }
718
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FieldRenderComponent, [{
719
+ type: Component,
720
+ args: [{ selector: 'field-render', template: "<div [ngClass]=\"{'has-error':state && !state.valid && (!state.pristine || state.touched) && state.errors}\">\r\n <label class=\"info-label bold\" [htmlFor]=\"inputId\">\r\n {{ label }}\r\n <small [ngClass]=\"{'has-error':state && !state.valid && state.errors}\" *ngIf=\"required\">{{this.requiredLabel}}</small>\r\n <span class=\"info-icon\" matTooltip=\"{{ tooltip }}\" *ngIf=\"tooltip\">\r\n <i class=\"far fa-question-circle\"></i>\r\n </span>\r\n </label>\r\n\r\n <!-- Input, textarea or select -->\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: [".info-icon{color:#222d57;font-size:13px;float:right;margin-left:4px}\n"] }]
721
+ }], null, { requiredLabel: [{
722
+ type: Input
723
+ }], label: [{
724
+ type: Input
725
+ }], inputId: [{
726
+ type: Input
727
+ }], tooltip: [{
728
+ type: Input
729
+ }], required: [{
730
+ type: Input
731
+ }], state: [{
732
+ type: Input
735
733
  }] }); })();
736
734
 
737
- const _c0$2 = function () { return { standalone: true }; };
738
- class BooleanInputComponent extends BaseSchemaComponent {
739
- ngAfterContentInit() {
740
- this.value = this.model;
741
- }
742
- onDropCallBack($event, value) {
743
- this.value = value = super.onDrop($event, value);
744
- this.changeValue(value);
745
- }
746
- changeValue($event) {
747
- if ($event && ($event === 'true' || $event === 'false')) {
748
- this.model = $event === 'true';
749
- this.value = this.model;
750
- this.modelChange.emit(this.model);
751
- }
752
- else {
753
- this.model = $event;
754
- this.value = this.model;
755
- this.modelChange.emit(this.model);
756
- }
757
- }
758
- }
759
- BooleanInputComponent.ɵfac = /*@__PURE__*/ function () { let ɵBooleanInputComponent_BaseFactory; return function BooleanInputComponent_Factory(t) { return (ɵBooleanInputComponent_BaseFactory || (ɵBooleanInputComponent_BaseFactory = i0.ɵɵgetInheritedFactory(BooleanInputComponent)))(t || BooleanInputComponent); }; }();
760
- BooleanInputComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BooleanInputComponent, selectors: [["boolean-input"]], inputs: { placeholder: "placeholder", inputId: "inputId", maxLength: "maxLength" }, features: [i0.ɵɵ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) {
761
- i0.ɵɵelementStart(0, "input", 0);
762
- i0.ɵɵ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); });
763
- i0.ɵɵelementEnd();
764
- } if (rf & 2) {
765
- i0.ɵɵproperty("id", ctx.inputId)("placeholder", ctx.placeholder)("ngModel", ctx.value)("ngModelOptions", i0.ɵɵpureFunction0(5, _c0$2))("maxlength", ctx.maxLength);
766
- } }, dependencies: [i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.MaxLengthValidator, i3.NgModel], encapsulation: 2 });
767
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BooleanInputComponent, [{
768
- type: Component,
769
- args: [{ selector: 'boolean-input', template: "<input class=\"form-control\"\r\n [id]=\"inputId\"\r\n [placeholder]=\"placeholder\"\r\n [(ngModel)]=\"value\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n (ngModelChange)=\"changeValue($event)\"\r\n dndDropzone (dndDrop)=\"onDropCallBack($event, value)\"\r\n [maxlength]=\"maxLength\">\r\n" }]
770
- }], null, { placeholder: [{
771
- type: Input
772
- }], inputId: [{
773
- type: Input
774
- }], maxLength: [{
775
- type: Input
735
+ const _c0$2 = function () { return { standalone: true }; };
736
+ class BooleanInputComponent extends BaseSchemaComponent {
737
+ placeholder;
738
+ inputId;
739
+ maxLength;
740
+ value;
741
+ ngAfterContentInit() {
742
+ this.value = this.model;
743
+ }
744
+ onDropCallBack($event, value) {
745
+ this.value = value = super.onDrop($event, value);
746
+ this.changeValue(value);
747
+ }
748
+ changeValue($event) {
749
+ if ($event && ($event === 'true' || $event === 'false')) {
750
+ this.model = $event === 'true';
751
+ this.value = this.model;
752
+ this.modelChange.emit(this.model);
753
+ }
754
+ else {
755
+ this.model = $event;
756
+ this.value = this.model;
757
+ this.modelChange.emit(this.model);
758
+ }
759
+ }
760
+ static ɵfac = /*@__PURE__*/ function () { let ɵBooleanInputComponent_BaseFactory; return function BooleanInputComponent_Factory(t) { return (ɵBooleanInputComponent_BaseFactory || (ɵBooleanInputComponent_BaseFactory = i0.ɵɵgetInheritedFactory(BooleanInputComponent)))(t || BooleanInputComponent); }; }();
761
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BooleanInputComponent, selectors: [["boolean-input"]], inputs: { placeholder: "placeholder", inputId: "inputId", maxLength: "maxLength" }, features: [i0.ɵɵ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) {
762
+ i0.ɵɵelementStart(0, "input", 0);
763
+ i0.ɵɵ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); });
764
+ i0.ɵɵelementEnd();
765
+ } if (rf & 2) {
766
+ i0.ɵɵproperty("id", ctx.inputId)("placeholder", ctx.placeholder)("ngModel", ctx.value)("ngModelOptions", i0.ɵɵpureFunction0(5, _c0$2))("maxlength", ctx.maxLength);
767
+ } }, dependencies: [i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.MaxLengthValidator, i3.NgModel], encapsulation: 2 });
768
+ }
769
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BooleanInputComponent, [{
770
+ type: Component,
771
+ args: [{ selector: 'boolean-input', template: "<input class=\"form-control\"\r\n [id]=\"inputId\"\r\n [placeholder]=\"placeholder\"\r\n [(ngModel)]=\"value\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n (ngModelChange)=\"changeValue($event)\"\r\n dndDropzone (dndDrop)=\"onDropCallBack($event, value)\"\r\n [maxlength]=\"maxLength\">\r\n" }]
772
+ }], null, { placeholder: [{
773
+ type: Input
774
+ }], inputId: [{
775
+ type: Input
776
+ }], maxLength: [{
777
+ type: Input
776
778
  }] }); })();
777
779
 
778
- const _c0$1 = function () { return { standalone: true }; };
779
- class NumberInputComponent extends BaseSchemaComponent {
780
- ngAfterContentInit() {
781
- this.value = this.model;
782
- }
783
- onDropCallBack($event, value) {
784
- this.value = value = super.onDrop($event, value);
785
- this.changeValue(value);
786
- }
787
- changeValue($event) {
788
- if ($event && !isNaN($event)) {
789
- this.model = Number($event);
790
- this.modelChange.emit(this.model);
791
- }
792
- else {
793
- this.model = $event;
794
- this.modelChange.emit(this.model);
795
- }
796
- }
797
- }
798
- NumberInputComponent.ɵfac = /*@__PURE__*/ function () { let ɵNumberInputComponent_BaseFactory; return function NumberInputComponent_Factory(t) { return (ɵNumberInputComponent_BaseFactory || (ɵNumberInputComponent_BaseFactory = i0.ɵɵgetInheritedFactory(NumberInputComponent)))(t || NumberInputComponent); }; }();
799
- NumberInputComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NumberInputComponent, selectors: [["number-input"]], inputs: { placeholder: "placeholder", inputId: "inputId", maxLength: "maxLength" }, features: [i0.ɵɵ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) {
800
- i0.ɵɵelementStart(0, "input", 0);
801
- i0.ɵɵ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); });
802
- i0.ɵɵelementEnd();
803
- } if (rf & 2) {
804
- i0.ɵɵproperty("id", ctx.inputId)("placeholder", ctx.placeholder)("ngModel", ctx.value)("ngModelOptions", i0.ɵɵpureFunction0(5, _c0$1))("maxlength", ctx.maxLength);
805
- } }, dependencies: [i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.MaxLengthValidator, i3.NgModel], encapsulation: 2 });
806
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NumberInputComponent, [{
807
- type: Component,
808
- args: [{ selector: 'number-input', template: "<input class=\"form-control number-input\"\r\n [id]=\"inputId\"\r\n [placeholder]=\"placeholder\"\r\n [(ngModel)]=\"value\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n (ngModelChange)=\"changeValue($event)\"\r\n dndDropzone (dndDrop)=\"onDropCallBack($event, value)\"\r\n [maxlength]=\"maxLength\">\r\n" }]
809
- }], null, { placeholder: [{
810
- type: Input
811
- }], inputId: [{
812
- type: Input
813
- }], maxLength: [{
814
- type: Input
780
+ const _c0$1 = function () { return { standalone: true }; };
781
+ class NumberInputComponent extends BaseSchemaComponent {
782
+ placeholder;
783
+ inputId;
784
+ maxLength;
785
+ value;
786
+ ngAfterContentInit() {
787
+ this.value = this.model;
788
+ }
789
+ onDropCallBack($event, value) {
790
+ this.value = value = super.onDrop($event, value);
791
+ this.changeValue(value);
792
+ }
793
+ changeValue($event) {
794
+ if ($event && !isNaN($event)) {
795
+ this.model = Number($event);
796
+ this.modelChange.emit(this.model);
797
+ }
798
+ else {
799
+ this.model = $event;
800
+ this.modelChange.emit(this.model);
801
+ }
802
+ }
803
+ static ɵfac = /*@__PURE__*/ function () { let ɵNumberInputComponent_BaseFactory; return function NumberInputComponent_Factory(t) { return (ɵNumberInputComponent_BaseFactory || (ɵNumberInputComponent_BaseFactory = i0.ɵɵgetInheritedFactory(NumberInputComponent)))(t || NumberInputComponent); }; }();
804
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NumberInputComponent, selectors: [["number-input"]], inputs: { placeholder: "placeholder", inputId: "inputId", maxLength: "maxLength" }, features: [i0.ɵɵ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) {
805
+ i0.ɵɵelementStart(0, "input", 0);
806
+ i0.ɵɵ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); });
807
+ i0.ɵɵelementEnd();
808
+ } if (rf & 2) {
809
+ i0.ɵɵproperty("id", ctx.inputId)("placeholder", ctx.placeholder)("ngModel", ctx.value)("ngModelOptions", i0.ɵɵpureFunction0(5, _c0$1))("maxlength", ctx.maxLength);
810
+ } }, dependencies: [i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.MaxLengthValidator, i3.NgModel], encapsulation: 2 });
811
+ }
812
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NumberInputComponent, [{
813
+ type: Component,
814
+ args: [{ selector: 'number-input', template: "<input class=\"form-control number-input\"\r\n [id]=\"inputId\"\r\n [placeholder]=\"placeholder\"\r\n [(ngModel)]=\"value\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n (ngModelChange)=\"changeValue($event)\"\r\n dndDropzone (dndDrop)=\"onDropCallBack($event, value)\"\r\n [maxlength]=\"maxLength\">\r\n" }]
815
+ }], null, { placeholder: [{
816
+ type: Input
817
+ }], inputId: [{
818
+ type: Input
819
+ }], maxLength: [{
820
+ type: Input
815
821
  }] }); })();
816
822
 
817
- function InputRenderComponent_div_1_icon_1_Template(rf, ctx) { if (rf & 1) {
818
- const _r8 = i0.ɵɵgetCurrentView();
819
- i0.ɵɵelementStart(0, "icon", 8);
820
- i0.ɵɵlistener("onClick", function InputRenderComponent_div_1_icon_1_Template_icon_onClick_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r7.editPassword()); });
821
- i0.ɵɵelementEnd();
822
- } if (rf & 2) {
823
- i0.ɵɵproperty("name", "fas fa-pencil-alt");
824
- } }
825
- function InputRenderComponent_div_1_icon_2_Template(rf, ctx) { if (rf & 1) {
826
- const _r10 = i0.ɵɵgetCurrentView();
827
- i0.ɵɵelementStart(0, "icon", 9);
828
- i0.ɵɵlistener("mousedown", function InputRenderComponent_div_1_icon_2_Template_icon_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r10); const ctx_r9 = i0.ɵɵnextContext(2); ctx_r9.cancelEditPassword(); return i0.ɵɵresetView($event.stopPropagation()); });
829
- i0.ɵɵelementEnd();
830
- } if (rf & 2) {
831
- i0.ɵɵproperty("name", "fas fa-ban");
832
- } }
833
- function InputRenderComponent_div_1_Template(rf, ctx) { if (rf & 1) {
834
- i0.ɵɵelementStart(0, "div", 5);
835
- i0.ɵɵtemplate(1, InputRenderComponent_div_1_icon_1_Template, 1, 1, "icon", 6);
836
- i0.ɵɵtemplate(2, InputRenderComponent_div_1_icon_2_Template, 1, 1, "icon", 7);
837
- i0.ɵɵelementEnd();
838
- } if (rf & 2) {
839
- const ctx_r0 = i0.ɵɵnextContext();
840
- i0.ɵɵadvance(1);
841
- i0.ɵɵproperty("ngIf", ctx_r0.schema.readOnlyPassword);
842
- i0.ɵɵadvance(1);
843
- i0.ɵɵproperty("ngIf", !ctx_r0.schema.readOnlyPassword);
844
- } }
845
- const _c0 = function () { return { standalone: true }; };
846
- function InputRenderComponent_input_2_Template(rf, ctx) { if (rf & 1) {
847
- const _r12 = i0.ɵɵgetCurrentView();
848
- i0.ɵɵelementStart(0, "input", 10);
849
- i0.ɵɵlistener("blur", function InputRenderComponent_input_2_Template_input_blur_0_listener() { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.onInputBlur()); })("ngModelChange", function InputRenderComponent_input_2_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r13 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r13.value = $event); })("ngModelChange", function InputRenderComponent_input_2_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r14 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r14.onChange($event)); })("dndDrop", function InputRenderComponent_input_2_Template_input_dndDrop_0_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r15 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r15.onDropCallBack($event, ctx_r15.value)); });
850
- i0.ɵɵelementEnd();
851
- } if (rf & 2) {
852
- const ctx_r1 = i0.ɵɵnextContext();
853
- i0.ɵɵpropertyInterpolate("placeholder", ctx_r1.schema.type === "password" && ctx_r1.schema.readOnlyPassword ? "*****" : ctx_r1.schema.description);
854
- i0.ɵɵproperty("disabled", ctx_r1.schema.readOnlyPassword)("type", ctx_r1.schema.type === "password" ? "password" : "text")("ngModel", ctx_r1.value)("ngModelOptions", i0.ɵɵpureFunction0(7, _c0))("id", ctx_r1.inputId)("maxlength", ctx_r1.schema.maxLength);
855
- } }
856
- function InputRenderComponent_select_box_3_Template(rf, ctx) { if (rf & 1) {
857
- const _r17 = i0.ɵɵgetCurrentView();
858
- i0.ɵɵelementStart(0, "select-box", 11);
859
- i0.ɵɵlistener("ngModelChange", function InputRenderComponent_select_box_3_Template_select_box_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r17); const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.value = $event); })("ngModelChange", function InputRenderComponent_select_box_3_Template_select_box_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r17); const ctx_r18 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r18.onChange($event.key)); });
860
- i0.ɵɵelementEnd();
861
- } if (rf & 2) {
862
- const ctx_r2 = i0.ɵɵnextContext();
863
- i0.ɵɵproperty("id", ctx_r2.inputId)("ngModel", ctx_r2.value)("ngModelOptions", i0.ɵɵpureFunction0(12, _c0))("placeholder", ctx_r2.schema.description || ctx_r2.selectPlaceHolderLabel)("searchPlaceHolder", ctx_r2.selectSearchPlaceHolderLabel)("clearText", ctx_r2.selectClearLabel)("notFoundText", ctx_r2.selectNotFoundLabel)("bindKey", "key")("bindValue", "value")("enabledSearch", true)("limitItens", 30)("data", ctx_r2.schema.options);
864
- } }
865
- function InputRenderComponent_number_input_4_Template(rf, ctx) { if (rf & 1) {
866
- const _r20 = i0.ɵɵgetCurrentView();
867
- i0.ɵɵelementStart(0, "number-input", 12);
868
- i0.ɵɵlistener("modelChange", function InputRenderComponent_number_input_4_Template_number_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r19 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r19.value = $event); })("modelChange", function InputRenderComponent_number_input_4_Template_number_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r21 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r21.onChange($event)); });
869
- i0.ɵɵelementEnd();
870
- } if (rf & 2) {
871
- const ctx_r3 = i0.ɵɵnextContext();
872
- i0.ɵɵproperty("model", ctx_r3.value)("inputId", ctx_r3.inputId)("placeholder", ctx_r3.schema.description)("maxLength", ctx_r3.schema.maxLength);
873
- } }
874
- function InputRenderComponent_boolean_input_5_Template(rf, ctx) { if (rf & 1) {
875
- const _r23 = i0.ɵɵgetCurrentView();
876
- i0.ɵɵelementStart(0, "boolean-input", 12);
877
- i0.ɵɵlistener("modelChange", function InputRenderComponent_boolean_input_5_Template_boolean_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r23); const ctx_r22 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r22.value = $event); })("modelChange", function InputRenderComponent_boolean_input_5_Template_boolean_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r23); const ctx_r24 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r24.onChange($event)); });
878
- i0.ɵɵelementEnd();
879
- } if (rf & 2) {
880
- const ctx_r4 = i0.ɵɵnextContext();
881
- i0.ɵɵproperty("model", ctx_r4.value)("inputId", ctx_r4.inputId)("placeholder", ctx_r4.schema.description)("maxLength", ctx_r4.schema.maxLength);
882
- } }
883
- const _c1 = function (a0) { return { "schema-input-container-password": a0 }; };
884
- class InputRenderComponent extends BaseSchemaComponent {
885
- constructor() {
886
- super(...arguments);
887
- this.selectPlaceHolderLabel = 'Select Item';
888
- this.selectSearchPlaceHolderLabel = 'Search';
889
- this.selectClearLabel = 'Clear';
890
- this.selectNotFoundLabel = 'No Items Found';
891
- this.schema = {};
892
- this.editing = false;
893
- this.onDropEvent = new EventEmitter();
894
- }
895
- ngAfterContentInit() {
896
- if (this.schema?.type !== 'object' && this.schema?.type !== 'array') {
897
- if (!this.editing && this.schema.options) {
898
- const $event = this.schema.options.filter((item) => item.selected === true);
899
- if ($event[0]) {
900
- this.onChange($event[0].key);
901
- this.value = $event[0];
902
- }
903
- }
904
- else if (this.editing && this.schema.options && this.model) {
905
- const $event = this.schema.options.filter((item) => item.key === this.model);
906
- if ($event[0]) {
907
- this.onChange($event[0].key);
908
- this.value = $event[0];
909
- }
910
- }
911
- else {
912
- this.value = this.model;
913
- }
914
- }
915
- if (this.editing && this.schema?.type === 'password') {
916
- this.schema.readOnlyPassword = true;
917
- }
918
- }
919
- onDropCallBack($event, value) {
920
- this.value = value = super.onDrop($event, value);
921
- this.onChange(value);
922
- }
923
- onChange($event) {
924
- if (this.schema.type !== 'password' || !this.editing) {
925
- this.model = $event;
926
- this.modelChange.emit(this.model);
927
- }
928
- }
929
- onInputBlur() {
930
- if (this.schema?.type === 'password') {
931
- this.savePassword();
932
- }
933
- }
934
- savePassword() {
935
- this.model = this.value || '';
936
- this.modelChange.emit(this.model);
937
- this.setReadOnlyPassword(true);
938
- }
939
- cancelEditPassword() {
940
- setTimeout(() => {
941
- this.value = undefined;
942
- this.model = undefined;
943
- this.modelChange.emit(this.model);
944
- this.setReadOnlyPassword(true);
945
- }, 100);
946
- }
947
- editPassword() {
948
- this.setReadOnlyPassword(false);
949
- }
950
- setReadOnlyPassword(value) {
951
- this.schema.readOnlyPassword = value;
952
- }
953
- }
954
- InputRenderComponent.ɵfac = /*@__PURE__*/ function () { let ɵInputRenderComponent_BaseFactory; return function InputRenderComponent_Factory(t) { return (ɵInputRenderComponent_BaseFactory || (ɵInputRenderComponent_BaseFactory = i0.ɵɵgetInheritedFactory(InputRenderComponent)))(t || InputRenderComponent); }; }();
955
- InputRenderComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: InputRenderComponent, selectors: [["input-render"]], inputs: { selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", schema: "schema", modelPropertiesPath: "modelPropertiesPath", inputId: "inputId", editing: "editing" }, outputs: { onDropEvent: "onDropEvent" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 6, vars: 8, consts: [[1, "schema-input-container", 3, "ngClass"], ["class", "edit-icon", 4, "ngIf"], ["class", "form-control", "dndDropzone", "", 3, "disabled", "type", "placeholder", "ngModel", "ngModelOptions", "id", "maxlength", "blur", "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"], [1, "edit-icon"], ["size", "15", "type", "primary", 3, "name", "onClick", 4, "ngIf"], ["size", "15", "type", "primary clickable", 3, "name", "mousedown", 4, "ngIf"], ["size", "15", "type", "primary", 3, "name", "onClick"], ["size", "15", "type", "primary clickable", 3, "name", "mousedown"], ["dndDropzone", "", 1, "form-control", 3, "disabled", "type", "placeholder", "ngModel", "ngModelOptions", "id", "maxlength", "blur", "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) {
956
- i0.ɵɵelementStart(0, "div", 0);
957
- i0.ɵɵtemplate(1, InputRenderComponent_div_1_Template, 3, 2, "div", 1);
958
- i0.ɵɵtemplate(2, InputRenderComponent_input_2_Template, 1, 8, "input", 2);
959
- i0.ɵɵtemplate(3, InputRenderComponent_select_box_3_Template, 1, 13, "select-box", 3);
960
- i0.ɵɵtemplate(4, InputRenderComponent_number_input_4_Template, 1, 4, "number-input", 4);
961
- i0.ɵɵtemplate(5, InputRenderComponent_boolean_input_5_Template, 1, 4, "boolean-input", 4);
962
- i0.ɵɵelementEnd();
963
- } if (rf & 2) {
964
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c1, ctx.schema.type === "password"));
965
- i0.ɵɵadvance(1);
966
- i0.ɵɵproperty("ngIf", ctx.schema.type === "password" && ctx.editing);
967
- i0.ɵɵadvance(1);
968
- i0.ɵɵproperty("ngIf", (ctx.schema.type === "string" || ctx.schema.type === "password") && !ctx.schema.options);
969
- i0.ɵɵadvance(1);
970
- i0.ɵɵproperty("ngIf", ctx.schema.type === "string" && ctx.schema.options);
971
- i0.ɵɵadvance(1);
972
- i0.ɵɵproperty("ngIf", ctx.schema.type === "number");
973
- i0.ɵɵadvance(1);
974
- i0.ɵɵproperty("ngIf", ctx.schema.type === "boolean");
975
- } }, dependencies: [i1.NgClass, i1.NgIf, i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.MaxLengthValidator, i3.NgModel, i4.SelectBoxComponent, i5.IconComponent, BooleanInputComponent, NumberInputComponent], styles: [".schema-input-container-password[_ngcontent-%COMP%]{position:relative}.schema-input-container-password[_ngcontent-%COMP%] .edit-icon[_ngcontent-%COMP%]{position:absolute;width:30px;right:-5px;top:10px;z-index:1}.schema-input-container-password[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:block;padding-right:38px!important;width:calc(100% - 51px)!important}"] });
976
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InputRenderComponent, [{
977
- type: Component,
978
- args: [{ selector: 'input-render', template: "<div class=\"schema-input-container\" [ngClass]=\"{'schema-input-container-password' : schema.type === 'password' }\" >\r\n <div *ngIf=\"schema.type === 'password' && editing\" class=\"edit-icon\">\r\n <icon *ngIf=\"this.schema.readOnlyPassword\" size=\"15\" type=\"primary\" [name]=\"'fas fa-pencil-alt'\"\r\n (onClick)=\"editPassword()\">\r\n </icon>\r\n <icon *ngIf=\"!this.schema.readOnlyPassword\" size=\"15\" type=\"primary clickable\" [name]=\"'fas fa-ban'\"\r\n (mousedown)=\"cancelEditPassword(); $event.stopPropagation()\">\r\n </icon>\r\n </div>\r\n <input (blur)=\"onInputBlur()\"\r\n [disabled]=\"schema.readOnlyPassword\" class=\"form-control\"\r\n [type]=\"schema.type === 'password' ? 'password' : 'text'\"\r\n placeholder=\"{{schema.type === 'password' && this.schema.readOnlyPassword ? '*****' : schema.description}}\"\r\n *ngIf=\"(schema.type === 'string' || schema.type === 'password') && !schema.options\"\r\n [(ngModel)]=\"value\" [ngModelOptions]=\"{standalone: true}\"\r\n (ngModelChange)=\"onChange($event)\"\r\n dndDropzone (dndDrop)=\"onDropCallBack($event, value)\" [id]=\"inputId\" [maxlength]=\"schema.maxLength\"/>\r\n\r\n <select-box\r\n [id]=\"inputId\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"onChange($event.key)\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n *ngIf=\"schema.type === 'string' && schema.options\"\r\n [placeholder]=\"schema.description || this.selectPlaceHolderLabel\"\r\n [searchPlaceHolder]=\"selectSearchPlaceHolderLabel\"\r\n [clearText]=\"this.selectClearLabel\"\r\n [notFoundText]=\"this.selectNotFoundLabel\"\r\n [bindKey]=\"'key'\"\r\n [bindValue]=\"'value'\"\r\n [enabledSearch]=\"true\"\r\n [limitItens]=\"30\"\r\n [data]=\"schema.options\">\r\n </select-box>\r\n\r\n <number-input [(model)]=\"value\" [inputId]=\"inputId\"\r\n *ngIf=\"schema.type === 'number'\"\r\n [placeholder]=\"schema.description\" [maxLength]=\"schema.maxLength\"\r\n (modelChange)=\"onChange($event)\"></number-input>\r\n\r\n <boolean-input [(model)]=\"value\" [inputId]=\"inputId\"\r\n *ngIf=\"schema.type === 'boolean'\"\r\n [placeholder]=\"schema.description\" [maxLength]=\"schema.maxLength\"\r\n (modelChange)=\"onChange($event)\"></boolean-input>\r\n</div>\r\n", styles: [".schema-input-container-password{position:relative}.schema-input-container-password .edit-icon{position:absolute;width:30px;right:-5px;top:10px;z-index:1}.schema-input-container-password input{display:block;padding-right:38px!important;width:calc(100% - 51px)!important}\n"] }]
979
- }], null, { selectPlaceHolderLabel: [{
980
- type: Input
981
- }], selectSearchPlaceHolderLabel: [{
982
- type: Input
983
- }], selectClearLabel: [{
984
- type: Input
985
- }], selectNotFoundLabel: [{
986
- type: Input
987
- }], schema: [{
988
- type: Input
989
- }], modelPropertiesPath: [{
990
- type: Input
991
- }], inputId: [{
992
- type: Input
993
- }], editing: [{
994
- type: Input
995
- }], onDropEvent: [{
996
- type: Output
823
+ function InputRenderComponent_div_1_icon_1_Template(rf, ctx) { if (rf & 1) {
824
+ const _r8 = i0.ɵɵgetCurrentView();
825
+ i0.ɵɵelementStart(0, "icon", 8);
826
+ i0.ɵɵlistener("onClick", function InputRenderComponent_div_1_icon_1_Template_icon_onClick_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r7.editPassword()); });
827
+ i0.ɵɵelementEnd();
828
+ } if (rf & 2) {
829
+ i0.ɵɵproperty("name", "fas fa-pencil-alt");
830
+ } }
831
+ function InputRenderComponent_div_1_icon_2_Template(rf, ctx) { if (rf & 1) {
832
+ const _r10 = i0.ɵɵgetCurrentView();
833
+ i0.ɵɵelementStart(0, "icon", 9);
834
+ i0.ɵɵlistener("mousedown", function InputRenderComponent_div_1_icon_2_Template_icon_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r10); const ctx_r9 = i0.ɵɵnextContext(2); ctx_r9.cancelEditPassword(); return i0.ɵɵresetView($event.stopPropagation()); });
835
+ i0.ɵɵelementEnd();
836
+ } if (rf & 2) {
837
+ i0.ɵɵproperty("name", "fas fa-ban");
838
+ } }
839
+ function InputRenderComponent_div_1_Template(rf, ctx) { if (rf & 1) {
840
+ i0.ɵɵelementStart(0, "div", 5);
841
+ i0.ɵɵtemplate(1, InputRenderComponent_div_1_icon_1_Template, 1, 1, "icon", 6);
842
+ i0.ɵɵtemplate(2, InputRenderComponent_div_1_icon_2_Template, 1, 1, "icon", 7);
843
+ i0.ɵɵelementEnd();
844
+ } if (rf & 2) {
845
+ const ctx_r0 = i0.ɵɵnextContext();
846
+ i0.ɵɵadvance(1);
847
+ i0.ɵɵproperty("ngIf", ctx_r0.schema.readOnlyPassword);
848
+ i0.ɵɵadvance(1);
849
+ i0.ɵɵproperty("ngIf", !ctx_r0.schema.readOnlyPassword);
850
+ } }
851
+ const _c0 = function () { return { standalone: true }; };
852
+ function InputRenderComponent_input_2_Template(rf, ctx) { if (rf & 1) {
853
+ const _r12 = i0.ɵɵgetCurrentView();
854
+ i0.ɵɵelementStart(0, "input", 10);
855
+ i0.ɵɵlistener("blur", function InputRenderComponent_input_2_Template_input_blur_0_listener() { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.onInputBlur()); })("ngModelChange", function InputRenderComponent_input_2_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r13 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r13.value = $event); })("ngModelChange", function InputRenderComponent_input_2_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r14 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r14.onChange($event)); })("dndDrop", function InputRenderComponent_input_2_Template_input_dndDrop_0_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r15 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r15.onDropCallBack($event, ctx_r15.value)); });
856
+ i0.ɵɵelementEnd();
857
+ } if (rf & 2) {
858
+ const ctx_r1 = i0.ɵɵnextContext();
859
+ i0.ɵɵpropertyInterpolate("placeholder", ctx_r1.schema.type === "password" && ctx_r1.schema.readOnlyPassword ? "*****" : ctx_r1.schema.description);
860
+ i0.ɵɵproperty("disabled", ctx_r1.schema.readOnlyPassword)("type", ctx_r1.schema.type === "password" ? "password" : "text")("ngModel", ctx_r1.value)("ngModelOptions", i0.ɵɵpureFunction0(7, _c0))("id", ctx_r1.inputId)("maxlength", ctx_r1.schema.maxLength);
861
+ } }
862
+ function InputRenderComponent_select_box_3_Template(rf, ctx) { if (rf & 1) {
863
+ const _r17 = i0.ɵɵgetCurrentView();
864
+ i0.ɵɵelementStart(0, "select-box", 11);
865
+ i0.ɵɵlistener("ngModelChange", function InputRenderComponent_select_box_3_Template_select_box_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r17); const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.value = $event); })("ngModelChange", function InputRenderComponent_select_box_3_Template_select_box_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r17); const ctx_r18 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r18.onChange($event.key)); });
866
+ i0.ɵɵelementEnd();
867
+ } if (rf & 2) {
868
+ const ctx_r2 = i0.ɵɵnextContext();
869
+ i0.ɵɵproperty("id", ctx_r2.inputId)("ngModel", ctx_r2.value)("ngModelOptions", i0.ɵɵpureFunction0(12, _c0))("placeholder", ctx_r2.schema.description || ctx_r2.selectPlaceHolderLabel)("searchPlaceHolder", ctx_r2.selectSearchPlaceHolderLabel)("clearText", ctx_r2.selectClearLabel)("notFoundText", ctx_r2.selectNotFoundLabel)("bindKey", "key")("bindValue", "value")("enabledSearch", true)("limitItens", 30)("data", ctx_r2.schema.options);
870
+ } }
871
+ function InputRenderComponent_number_input_4_Template(rf, ctx) { if (rf & 1) {
872
+ const _r20 = i0.ɵɵgetCurrentView();
873
+ i0.ɵɵelementStart(0, "number-input", 12);
874
+ i0.ɵɵlistener("modelChange", function InputRenderComponent_number_input_4_Template_number_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r19 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r19.value = $event); })("modelChange", function InputRenderComponent_number_input_4_Template_number_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r21 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r21.onChange($event)); });
875
+ i0.ɵɵelementEnd();
876
+ } if (rf & 2) {
877
+ const ctx_r3 = i0.ɵɵnextContext();
878
+ i0.ɵɵproperty("model", ctx_r3.value)("inputId", ctx_r3.inputId)("placeholder", ctx_r3.schema.description)("maxLength", ctx_r3.schema.maxLength);
879
+ } }
880
+ function InputRenderComponent_boolean_input_5_Template(rf, ctx) { if (rf & 1) {
881
+ const _r23 = i0.ɵɵgetCurrentView();
882
+ i0.ɵɵelementStart(0, "boolean-input", 12);
883
+ i0.ɵɵlistener("modelChange", function InputRenderComponent_boolean_input_5_Template_boolean_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r23); const ctx_r22 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r22.value = $event); })("modelChange", function InputRenderComponent_boolean_input_5_Template_boolean_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r23); const ctx_r24 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r24.onChange($event)); });
884
+ i0.ɵɵelementEnd();
885
+ } if (rf & 2) {
886
+ const ctx_r4 = i0.ɵɵnextContext();
887
+ i0.ɵɵproperty("model", ctx_r4.value)("inputId", ctx_r4.inputId)("placeholder", ctx_r4.schema.description)("maxLength", ctx_r4.schema.maxLength);
888
+ } }
889
+ const _c1 = function (a0) { return { "schema-input-container-password": a0 }; };
890
+ class InputRenderComponent extends BaseSchemaComponent {
891
+ selectPlaceHolderLabel = 'Select Item';
892
+ selectSearchPlaceHolderLabel = 'Search';
893
+ selectClearLabel = 'Clear';
894
+ selectNotFoundLabel = 'No Items Found';
895
+ schema = {};
896
+ modelPropertiesPath;
897
+ inputId;
898
+ editing = false;
899
+ onDropEvent = new EventEmitter();
900
+ value;
901
+ ngAfterContentInit() {
902
+ if (this.schema?.type !== 'object' && this.schema?.type !== 'array') {
903
+ if (!this.editing && this.schema.options) {
904
+ const $event = this.schema.options.filter((item) => item.selected === true);
905
+ if ($event[0]) {
906
+ this.onChange($event[0].key);
907
+ this.value = $event[0];
908
+ }
909
+ }
910
+ else if (this.editing && this.schema.options && this.model) {
911
+ const $event = this.schema.options.filter((item) => item.key === this.model);
912
+ if ($event[0]) {
913
+ this.onChange($event[0].key);
914
+ this.value = $event[0];
915
+ }
916
+ }
917
+ else {
918
+ this.value = this.model;
919
+ }
920
+ }
921
+ if (this.editing && this.schema?.type === 'password') {
922
+ this.schema.readOnlyPassword = true;
923
+ }
924
+ }
925
+ onDropCallBack($event, value) {
926
+ this.value = value = super.onDrop($event, value);
927
+ this.onChange(value);
928
+ }
929
+ onChange($event) {
930
+ if (this.schema.type !== 'password' || !this.editing) {
931
+ this.model = $event;
932
+ this.modelChange.emit(this.model);
933
+ }
934
+ }
935
+ onInputBlur() {
936
+ if (this.schema?.type === 'password') {
937
+ this.savePassword();
938
+ }
939
+ }
940
+ savePassword() {
941
+ this.model = this.value || '';
942
+ this.modelChange.emit(this.model);
943
+ this.setReadOnlyPassword(true);
944
+ }
945
+ cancelEditPassword() {
946
+ setTimeout(() => {
947
+ this.value = undefined;
948
+ this.model = undefined;
949
+ this.modelChange.emit(this.model);
950
+ this.setReadOnlyPassword(true);
951
+ }, 100);
952
+ }
953
+ editPassword() {
954
+ this.setReadOnlyPassword(false);
955
+ }
956
+ setReadOnlyPassword(value) {
957
+ this.schema.readOnlyPassword = value;
958
+ }
959
+ static ɵfac = /*@__PURE__*/ function () { let ɵInputRenderComponent_BaseFactory; return function InputRenderComponent_Factory(t) { return (ɵInputRenderComponent_BaseFactory || (ɵInputRenderComponent_BaseFactory = i0.ɵɵgetInheritedFactory(InputRenderComponent)))(t || InputRenderComponent); }; }();
960
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: InputRenderComponent, selectors: [["input-render"]], inputs: { selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", schema: "schema", modelPropertiesPath: "modelPropertiesPath", inputId: "inputId", editing: "editing" }, outputs: { onDropEvent: "onDropEvent" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 6, vars: 8, consts: [[1, "schema-input-container", 3, "ngClass"], ["class", "edit-icon", 4, "ngIf"], ["class", "form-control", "dndDropzone", "", 3, "disabled", "type", "placeholder", "ngModel", "ngModelOptions", "id", "maxlength", "blur", "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"], [1, "edit-icon"], ["size", "15", "type", "primary", 3, "name", "onClick", 4, "ngIf"], ["size", "15", "type", "primary clickable", 3, "name", "mousedown", 4, "ngIf"], ["size", "15", "type", "primary", 3, "name", "onClick"], ["size", "15", "type", "primary clickable", 3, "name", "mousedown"], ["dndDropzone", "", 1, "form-control", 3, "disabled", "type", "placeholder", "ngModel", "ngModelOptions", "id", "maxlength", "blur", "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) {
961
+ i0.ɵɵelementStart(0, "div", 0);
962
+ i0.ɵɵtemplate(1, InputRenderComponent_div_1_Template, 3, 2, "div", 1);
963
+ i0.ɵɵtemplate(2, InputRenderComponent_input_2_Template, 1, 8, "input", 2);
964
+ i0.ɵɵtemplate(3, InputRenderComponent_select_box_3_Template, 1, 13, "select-box", 3);
965
+ i0.ɵɵtemplate(4, InputRenderComponent_number_input_4_Template, 1, 4, "number-input", 4);
966
+ i0.ɵɵtemplate(5, InputRenderComponent_boolean_input_5_Template, 1, 4, "boolean-input", 4);
967
+ i0.ɵɵelementEnd();
968
+ } if (rf & 2) {
969
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c1, ctx.schema.type === "password"));
970
+ i0.ɵɵadvance(1);
971
+ i0.ɵɵproperty("ngIf", ctx.schema.type === "password" && ctx.editing);
972
+ i0.ɵɵadvance(1);
973
+ i0.ɵɵproperty("ngIf", (ctx.schema.type === "string" || ctx.schema.type === "password") && !ctx.schema.options);
974
+ i0.ɵɵadvance(1);
975
+ i0.ɵɵproperty("ngIf", ctx.schema.type === "string" && ctx.schema.options);
976
+ i0.ɵɵadvance(1);
977
+ i0.ɵɵproperty("ngIf", ctx.schema.type === "number");
978
+ i0.ɵɵadvance(1);
979
+ i0.ɵɵproperty("ngIf", ctx.schema.type === "boolean");
980
+ } }, dependencies: [i1.NgClass, i1.NgIf, i2.DndDropzoneDirective, i3.DefaultValueAccessor, i3.NgControlStatus, i3.MaxLengthValidator, i3.NgModel, i4.SelectBoxComponent, i5.IconComponent, BooleanInputComponent, NumberInputComponent], styles: [".schema-input-container-password[_ngcontent-%COMP%]{position:relative}.schema-input-container-password[_ngcontent-%COMP%] .edit-icon[_ngcontent-%COMP%]{position:absolute;width:30px;right:-5px;top:10px;z-index:1}.schema-input-container-password[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:block;padding-right:38px!important;width:calc(100% - 51px)!important}"] });
981
+ }
982
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InputRenderComponent, [{
983
+ type: Component,
984
+ args: [{ selector: 'input-render', template: "<div class=\"schema-input-container\" [ngClass]=\"{'schema-input-container-password' : schema.type === 'password' }\" >\r\n <div *ngIf=\"schema.type === 'password' && editing\" class=\"edit-icon\">\r\n <icon *ngIf=\"this.schema.readOnlyPassword\" size=\"15\" type=\"primary\" [name]=\"'fas fa-pencil-alt'\"\r\n (onClick)=\"editPassword()\">\r\n </icon>\r\n <icon *ngIf=\"!this.schema.readOnlyPassword\" size=\"15\" type=\"primary clickable\" [name]=\"'fas fa-ban'\"\r\n (mousedown)=\"cancelEditPassword(); $event.stopPropagation()\">\r\n </icon>\r\n </div>\r\n <input (blur)=\"onInputBlur()\"\r\n [disabled]=\"schema.readOnlyPassword\" class=\"form-control\"\r\n [type]=\"schema.type === 'password' ? 'password' : 'text'\"\r\n placeholder=\"{{schema.type === 'password' && this.schema.readOnlyPassword ? '*****' : schema.description}}\"\r\n *ngIf=\"(schema.type === 'string' || schema.type === 'password') && !schema.options\"\r\n [(ngModel)]=\"value\" [ngModelOptions]=\"{standalone: true}\"\r\n (ngModelChange)=\"onChange($event)\"\r\n dndDropzone (dndDrop)=\"onDropCallBack($event, value)\" [id]=\"inputId\" [maxlength]=\"schema.maxLength\"/>\r\n\r\n <select-box\r\n [id]=\"inputId\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"onChange($event.key)\"\r\n [ngModelOptions]=\"{standalone: true}\"\r\n *ngIf=\"schema.type === 'string' && schema.options\"\r\n [placeholder]=\"schema.description || this.selectPlaceHolderLabel\"\r\n [searchPlaceHolder]=\"selectSearchPlaceHolderLabel\"\r\n [clearText]=\"this.selectClearLabel\"\r\n [notFoundText]=\"this.selectNotFoundLabel\"\r\n [bindKey]=\"'key'\"\r\n [bindValue]=\"'value'\"\r\n [enabledSearch]=\"true\"\r\n [limitItens]=\"30\"\r\n [data]=\"schema.options\">\r\n </select-box>\r\n\r\n <number-input [(model)]=\"value\" [inputId]=\"inputId\"\r\n *ngIf=\"schema.type === 'number'\"\r\n [placeholder]=\"schema.description\" [maxLength]=\"schema.maxLength\"\r\n (modelChange)=\"onChange($event)\"></number-input>\r\n\r\n <boolean-input [(model)]=\"value\" [inputId]=\"inputId\"\r\n *ngIf=\"schema.type === 'boolean'\"\r\n [placeholder]=\"schema.description\" [maxLength]=\"schema.maxLength\"\r\n (modelChange)=\"onChange($event)\"></boolean-input>\r\n</div>\r\n", styles: [".schema-input-container-password{position:relative}.schema-input-container-password .edit-icon{position:absolute;width:30px;right:-5px;top:10px;z-index:1}.schema-input-container-password input{display:block;padding-right:38px!important;width:calc(100% - 51px)!important}\n"] }]
985
+ }], null, { selectPlaceHolderLabel: [{
986
+ type: Input
987
+ }], selectSearchPlaceHolderLabel: [{
988
+ type: Input
989
+ }], selectClearLabel: [{
990
+ type: Input
991
+ }], selectNotFoundLabel: [{
992
+ type: Input
993
+ }], schema: [{
994
+ type: Input
995
+ }], modelPropertiesPath: [{
996
+ type: Input
997
+ }], inputId: [{
998
+ type: Input
999
+ }], editing: [{
1000
+ type: Input
1001
+ }], onDropEvent: [{
1002
+ type: Output
997
1003
  }] }); })();
998
1004
 
999
- function SchemaInputComponent_div_0_Template(rf, ctx) { if (rf & 1) {
1000
- const _r3 = i0.ɵɵgetCurrentView();
1001
- i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "field-render", 3)(3, "input-render", 4);
1002
- i0.ɵɵlistener("modelChange", function SchemaInputComponent_div_0_Template_input_render_modelChange_3_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r2.model[ctx_r2.schema.id] = $event)); });
1003
- i0.ɵɵelementEnd()()()();
1004
- } if (rf & 2) {
1005
- const ctx_r0 = i0.ɵɵnextContext();
1006
- i0.ɵɵadvance(2);
1007
- i0.ɵɵproperty("requiredLabel", ctx_r0.requiredLabel)("label", ctx_r0.schema.title)("tooltip", ctx_r0.schema.help)("inputId", ctx_r0.getId(ctx_r0.index));
1008
- i0.ɵɵadvance(1);
1009
- i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r0.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r0.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r0.selectClearLabel)("selectNotFoundLabel", ctx_r0.selectNotFoundLabel)("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);
1010
- } }
1011
- function SchemaInputComponent_div_1_span_4_Template(rf, ctx) { if (rf & 1) {
1012
- i0.ɵɵelementStart(0, "span", 7);
1013
- i0.ɵɵtext(1, "?");
1014
- i0.ɵɵelementEnd();
1015
- } if (rf & 2) {
1016
- const ctx_r4 = i0.ɵɵnextContext(2);
1017
- i0.ɵɵpropertyInterpolate("matTooltip", ctx_r4.schema.help);
1018
- } }
1019
- function SchemaInputComponent_div_1_Template(rf, ctx) { if (rf & 1) {
1020
- const _r6 = i0.ɵɵgetCurrentView();
1021
- i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "label", 5);
1022
- i0.ɵɵtext(3);
1023
- i0.ɵɵtemplate(4, SchemaInputComponent_div_1_span_4_Template, 2, 1, "span", 6);
1024
- i0.ɵɵelementEnd();
1025
- i0.ɵɵelementStart(5, "input-render", 4);
1026
- i0.ɵɵlistener("modelChange", function SchemaInputComponent_div_1_Template_input_render_modelChange_5_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r5.model[ctx_r5.schema.id] = $event)); });
1027
- i0.ɵɵelementEnd()()();
1028
- } if (rf & 2) {
1029
- const ctx_r1 = i0.ɵɵnextContext();
1030
- i0.ɵɵadvance(2);
1031
- i0.ɵɵproperty("htmlFor", ctx_r1.getId(ctx_r1.index));
1032
- i0.ɵɵadvance(1);
1033
- i0.ɵɵtextInterpolate1(" ", ctx_r1.schema.title, " ");
1034
- i0.ɵɵadvance(1);
1035
- i0.ɵɵproperty("ngIf", ctx_r1.schema.help);
1036
- i0.ɵɵadvance(1);
1037
- i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r1.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r1.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r1.selectClearLabel)("selectNotFoundLabel", ctx_r1.selectNotFoundLabel)("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);
1038
- } }
1039
- class SchemaInputComponent extends BaseSchemaComponent {
1040
- constructor() {
1041
- super(...arguments);
1042
- this.requiredLabel = '(required)';
1043
- this.selectPlaceHolderLabel = 'Select Item';
1044
- this.selectSearchPlaceHolderLabel = 'Search';
1045
- this.selectClearLabel = 'Clear';
1046
- this.selectNotFoundLabel = 'No Items Found';
1047
- this.editing = false;
1048
- }
1049
- ngAfterContentInit() {
1050
- this.loaded = true;
1051
- }
1052
- getId(index) {
1053
- return `${this.idPrefix}-struct-${index}`;
1054
- }
1055
- }
1056
- SchemaInputComponent.ɵfac = /*@__PURE__*/ function () { let ɵSchemaInputComponent_BaseFactory; return function SchemaInputComponent_Factory(t) { return (ɵSchemaInputComponent_BaseFactory || (ɵSchemaInputComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SchemaInputComponent)))(t || SchemaInputComponent); }; }();
1057
- SchemaInputComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchemaInputComponent, selectors: [["schema-input"]], inputs: { requiredLabel: "requiredLabel", selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", idPrefix: "idPrefix", schema: "schema", editing: "editing", index: "index" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [["class", "row schema-input", 4, "ngIf"], [1, "row", "schema-input"], [1, "col-md-12"], [3, "requiredLabel", "label", "tooltip", "inputId"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "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) {
1058
- i0.ɵɵtemplate(0, SchemaInputComponent_div_0_Template, 4, 13, "div", 0);
1059
- i0.ɵɵtemplate(1, SchemaInputComponent_div_1_Template, 6, 12, "div", 0);
1060
- } if (rf & 2) {
1061
- i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && ctx.schema.minLength && ctx.schema.minLength > 0);
1062
- i0.ɵɵadvance(1);
1063
- i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && (!ctx.schema.minLength || ctx.schema.minLength === 0));
1064
- } }, dependencies: [i1.NgIf, i2$1.MatTooltip, FieldRenderComponent, InputRenderComponent] });
1065
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaInputComponent, [{
1066
- type: Component,
1067
- args: [{ selector: 'schema-input', template: "<div class=\"row schema-input\"\r\n *ngIf=\"loaded && canRender(schema) && schema.type !== 'array' && schema.type !== 'object' && schema.minLength && schema.minLength > 0\">\r\n <div class=\"col-md-12\">\r\n <field-render [requiredLabel]=\"requiredLabel\" [label]=\"schema.title\" [tooltip]=\"schema.help\" [inputId]=\"getId(index)\">\r\n <input-render\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [inputId]=\"getId(index)\"\r\n [schema]=\"schema\"\r\n [(model)]=\"this.model[schema.id]\"\r\n [modelPropertiesPath]=\"'mappingAttributes.' + schema.id\"\r\n [editing]=\"this.editing\"></input-render>\r\n </field-render>\r\n </div>\r\n</div>\r\n<div class=\"row schema-input\"\r\n *ngIf=\"loaded && canRender(schema) && schema.type !== 'array' && schema.type !== 'object' && (!schema.minLength || schema.minLength === 0)\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label bold\" [htmlFor]=\"getId(index)\">\r\n {{schema.title}}\r\n <span class=\"config-tooltip\" matTooltip=\"{{ schema.help }}\" *ngIf=\"schema.help\">?</span>\r\n </label>\r\n <input-render\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [inputId]=\"getId(index)\"\r\n [schema]=\"schema\"\r\n [(model)]=\"this.model[schema.id]\"\r\n [modelPropertiesPath]=\"'mappingAttributes.' + schema.id\"\r\n [editing]=\"this.editing\"></input-render>\r\n </div>\r\n</div>\r\n" }]
1068
- }], null, { requiredLabel: [{
1069
- type: Input
1070
- }], selectPlaceHolderLabel: [{
1071
- type: Input
1072
- }], selectSearchPlaceHolderLabel: [{
1073
- type: Input
1074
- }], selectClearLabel: [{
1075
- type: Input
1076
- }], selectNotFoundLabel: [{
1077
- type: Input
1078
- }], idPrefix: [{
1079
- type: Input
1080
- }], schema: [{
1081
- type: Input
1082
- }], editing: [{
1083
- type: Input
1084
- }], index: [{
1085
- type: Input
1005
+ function SchemaInputComponent_div_0_Template(rf, ctx) { if (rf & 1) {
1006
+ const _r3 = i0.ɵɵgetCurrentView();
1007
+ i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "field-render", 3)(3, "input-render", 4);
1008
+ i0.ɵɵlistener("modelChange", function SchemaInputComponent_div_0_Template_input_render_modelChange_3_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r2.model[ctx_r2.schema.id] = $event)); });
1009
+ i0.ɵɵelementEnd()()()();
1010
+ } if (rf & 2) {
1011
+ const ctx_r0 = i0.ɵɵnextContext();
1012
+ i0.ɵɵadvance(2);
1013
+ i0.ɵɵproperty("requiredLabel", ctx_r0.requiredLabel)("label", ctx_r0.schema.title)("tooltip", ctx_r0.schema.help)("inputId", ctx_r0.getId(ctx_r0.index));
1014
+ i0.ɵɵadvance(1);
1015
+ i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r0.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r0.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r0.selectClearLabel)("selectNotFoundLabel", ctx_r0.selectNotFoundLabel)("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);
1016
+ } }
1017
+ function SchemaInputComponent_div_1_span_4_Template(rf, ctx) { if (rf & 1) {
1018
+ i0.ɵɵelementStart(0, "span", 7);
1019
+ i0.ɵɵtext(1, "?");
1020
+ i0.ɵɵelementEnd();
1021
+ } if (rf & 2) {
1022
+ const ctx_r4 = i0.ɵɵnextContext(2);
1023
+ i0.ɵɵpropertyInterpolate("matTooltip", ctx_r4.schema.help);
1024
+ } }
1025
+ function SchemaInputComponent_div_1_Template(rf, ctx) { if (rf & 1) {
1026
+ const _r6 = i0.ɵɵgetCurrentView();
1027
+ i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "label", 5);
1028
+ i0.ɵɵtext(3);
1029
+ i0.ɵɵtemplate(4, SchemaInputComponent_div_1_span_4_Template, 2, 1, "span", 6);
1030
+ i0.ɵɵelementEnd();
1031
+ i0.ɵɵelementStart(5, "input-render", 4);
1032
+ i0.ɵɵlistener("modelChange", function SchemaInputComponent_div_1_Template_input_render_modelChange_5_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r5.model[ctx_r5.schema.id] = $event)); });
1033
+ i0.ɵɵelementEnd()()();
1034
+ } if (rf & 2) {
1035
+ const ctx_r1 = i0.ɵɵnextContext();
1036
+ i0.ɵɵadvance(2);
1037
+ i0.ɵɵproperty("htmlFor", ctx_r1.getId(ctx_r1.index));
1038
+ i0.ɵɵadvance(1);
1039
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.schema.title, " ");
1040
+ i0.ɵɵadvance(1);
1041
+ i0.ɵɵproperty("ngIf", ctx_r1.schema.help);
1042
+ i0.ɵɵadvance(1);
1043
+ i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r1.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r1.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r1.selectClearLabel)("selectNotFoundLabel", ctx_r1.selectNotFoundLabel)("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);
1044
+ } }
1045
+ class SchemaInputComponent extends BaseSchemaComponent {
1046
+ requiredLabel = '(required)';
1047
+ selectPlaceHolderLabel = 'Select Item';
1048
+ selectSearchPlaceHolderLabel = 'Search';
1049
+ selectClearLabel = 'Clear';
1050
+ selectNotFoundLabel = 'No Items Found';
1051
+ idPrefix;
1052
+ editing = false;
1053
+ index;
1054
+ loaded;
1055
+ ngAfterContentInit() {
1056
+ this.loaded = true;
1057
+ }
1058
+ getId(index) {
1059
+ return `${this.idPrefix}-struct-${index}`;
1060
+ }
1061
+ static ɵfac = /*@__PURE__*/ function () { let ɵSchemaInputComponent_BaseFactory; return function SchemaInputComponent_Factory(t) { return (ɵSchemaInputComponent_BaseFactory || (ɵSchemaInputComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SchemaInputComponent)))(t || SchemaInputComponent); }; }();
1062
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchemaInputComponent, selectors: [["schema-input"]], inputs: { requiredLabel: "requiredLabel", selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", idPrefix: "idPrefix", editing: "editing", index: "index" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [["class", "row schema-input", 4, "ngIf"], [1, "row", "schema-input"], [1, "col-md-12"], [3, "requiredLabel", "label", "tooltip", "inputId"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "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) {
1063
+ i0.ɵɵtemplate(0, SchemaInputComponent_div_0_Template, 4, 13, "div", 0);
1064
+ i0.ɵɵtemplate(1, SchemaInputComponent_div_1_Template, 6, 12, "div", 0);
1065
+ } if (rf & 2) {
1066
+ i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && ctx.schema.minLength && ctx.schema.minLength > 0);
1067
+ i0.ɵɵadvance(1);
1068
+ i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && (!ctx.schema.minLength || ctx.schema.minLength === 0));
1069
+ } }, dependencies: [i1.NgIf, i2$1.MatTooltip, FieldRenderComponent, InputRenderComponent] });
1070
+ }
1071
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaInputComponent, [{
1072
+ type: Component,
1073
+ args: [{ selector: 'schema-input', template: "<div class=\"row schema-input\"\r\n *ngIf=\"loaded && canRender(schema) && schema.type !== 'array' && schema.type !== 'object' && schema.minLength && schema.minLength > 0\">\r\n <div class=\"col-md-12\">\r\n <field-render [requiredLabel]=\"requiredLabel\" [label]=\"schema.title\" [tooltip]=\"schema.help\" [inputId]=\"getId(index)\">\r\n <input-render\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [inputId]=\"getId(index)\"\r\n [schema]=\"schema\"\r\n [(model)]=\"this.model[schema.id]\"\r\n [modelPropertiesPath]=\"'mappingAttributes.' + schema.id\"\r\n [editing]=\"this.editing\"></input-render>\r\n </field-render>\r\n </div>\r\n</div>\r\n<div class=\"row schema-input\"\r\n *ngIf=\"loaded && canRender(schema) && schema.type !== 'array' && schema.type !== 'object' && (!schema.minLength || schema.minLength === 0)\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label bold\" [htmlFor]=\"getId(index)\">\r\n {{schema.title}}\r\n <span class=\"config-tooltip\" matTooltip=\"{{ schema.help }}\" *ngIf=\"schema.help\">?</span>\r\n </label>\r\n <input-render\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [inputId]=\"getId(index)\"\r\n [schema]=\"schema\"\r\n [(model)]=\"this.model[schema.id]\"\r\n [modelPropertiesPath]=\"'mappingAttributes.' + schema.id\"\r\n [editing]=\"this.editing\"></input-render>\r\n </div>\r\n</div>\r\n" }]
1074
+ }], null, { requiredLabel: [{
1075
+ type: Input
1076
+ }], selectPlaceHolderLabel: [{
1077
+ type: Input
1078
+ }], selectSearchPlaceHolderLabel: [{
1079
+ type: Input
1080
+ }], selectClearLabel: [{
1081
+ type: Input
1082
+ }], selectNotFoundLabel: [{
1083
+ type: Input
1084
+ }], idPrefix: [{
1085
+ type: Input
1086
+ }], editing: [{
1087
+ type: Input
1088
+ }], index: [{
1089
+ type: Input
1086
1090
  }] }); })();
1087
1091
 
1088
- function SchemaObjectComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
1089
- const _r3 = i0.ɵɵgetCurrentView();
1090
- i0.ɵɵelementStart(0, "div", 5)(1, "div", 6)(2, "label", 7);
1091
- i0.ɵɵtext(3);
1092
- i0.ɵɵelementEnd();
1093
- i0.ɵɵelementStart(4, "schema-custom-attributes", 8);
1094
- i0.ɵɵlistener("modelChange", function SchemaObjectComponent_div_0_div_4_Template_schema_custom_attributes_modelChange_4_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.model[ctx_r2.schema.id].customAttributes = $event); });
1095
- i0.ɵɵelementEnd()()();
1096
- } if (rf & 2) {
1097
- const ctx_r1 = i0.ɵɵnextContext(2);
1098
- i0.ɵɵadvance(3);
1099
- i0.ɵɵtextInterpolate(ctx_r1.additionalAttributesLabel);
1100
- i0.ɵɵadvance(1);
1101
- i0.ɵɵproperty("customAttributeRemoveLabel", ctx_r1.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r1.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r1.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r1.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r1.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r1.newCustomFieldCancelLabel)("model", ctx_r1.model[ctx_r1.schema.id].customAttributes)("onDropFunction", ctx_r1.onDrop);
1102
- } }
1103
- function SchemaObjectComponent_div_0_Template(rf, ctx) { if (rf & 1) {
1104
- const _r5 = i0.ɵɵgetCurrentView();
1105
- i0.ɵɵelementStart(0, "div", 1)(1, "div", 2);
1106
- i0.ɵɵtext(2);
1107
- i0.ɵɵelementEnd();
1108
- i0.ɵɵelementStart(3, "schema-form", 3);
1109
- i0.ɵɵlistener("modelChange", function SchemaObjectComponent_div_0_Template_schema_form_modelChange_3_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r4.model[ctx_r4.schema.id] = $event)); });
1110
- i0.ɵɵelementEnd();
1111
- i0.ɵɵtemplate(4, SchemaObjectComponent_div_0_div_4_Template, 5, 9, "div", 4);
1112
- i0.ɵɵelementEnd();
1113
- } if (rf & 2) {
1114
- const ctx_r0 = i0.ɵɵnextContext();
1115
- i0.ɵɵadvance(2);
1116
- i0.ɵɵtextInterpolate(ctx_r0.schema.title);
1117
- i0.ɵɵadvance(1);
1118
- i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r0.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r0.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r0.selectClearLabel)("selectNotFoundLabel", ctx_r0.selectNotFoundLabel)("requiredLabel", ctx_r0.requiredLabel)("addItemLabel", ctx_r0.addItemLabel)("addLoopLabel", ctx_r0.addLoopLabel)("additionalAttributesLabel", ctx_r0.additionalAttributesLabel)("customAttributeRemoveLabel", ctx_r0.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r0.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r0.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r0.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r0.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r0.newCustomFieldCancelLabel)("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model[ctx_r0.schema.id])("schemas", ctx_r0.getSchemaProperties())("editing", ctx_r0.editing);
1119
- i0.ɵɵadvance(1);
1120
- i0.ɵɵproperty("ngIf", ctx_r0.model[ctx_r0.schema.id] && ctx_r0.schema.customProperties);
1121
- } }
1122
- class SchemaObjectComponent extends BaseSchemaComponent {
1123
- constructor() {
1124
- super(...arguments);
1125
- this.requiredLabel = '(required)';
1126
- this.addItemLabel = 'Add Item';
1127
- this.addLoopLabel = 'Add Loop';
1128
- this.additionalAttributesLabel = 'Additional Fields';
1129
- this.customAttributeRemoveLabel = 'Remove';
1130
- this.newCustomFieldNameLabel = 'Name';
1131
- this.newCustomFieldValueLabel = 'Value';
1132
- this.newCustomFieldAddLabel = 'Add';
1133
- this.newCustomFieldSaveLabel = 'Save';
1134
- this.newCustomFieldCancelLabel = 'Cancel';
1135
- this.selectPlaceHolderLabel = 'Select Item';
1136
- this.selectSearchPlaceHolderLabel = 'Search';
1137
- this.selectClearLabel = 'Clear';
1138
- this.selectNotFoundLabel = 'No Items Found';
1139
- this.editing = false;
1140
- this.onDropEvent = new EventEmitter();
1141
- this.loaded = false;
1142
- }
1143
- ngAfterContentInit() {
1144
- if (this.schema?.type === 'object' && this.model) {
1145
- this.model[this.schema.id] = this.model[this.schema.id] || {};
1146
- }
1147
- this.loaded = true;
1148
- }
1149
- onDrop($event, modelElement) {
1150
- return onDropStruct($event, modelElement);
1151
- }
1152
- }
1153
- SchemaObjectComponent.ɵfac = /*@__PURE__*/ function () { let ɵSchemaObjectComponent_BaseFactory; return function SchemaObjectComponent_Factory(t) { return (ɵSchemaObjectComponent_BaseFactory || (ɵSchemaObjectComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SchemaObjectComponent)))(t || SchemaObjectComponent); }; }();
1154
- SchemaObjectComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchemaObjectComponent, selectors: [["schema-object"]], inputs: { requiredLabel: "requiredLabel", addItemLabel: "addItemLabel", addLoopLabel: "addLoopLabel", additionalAttributesLabel: "additionalAttributesLabel", customAttributeRemoveLabel: "customAttributeRemoveLabel", newCustomFieldNameLabel: "newCustomFieldNameLabel", newCustomFieldValueLabel: "newCustomFieldValueLabel", newCustomFieldAddLabel: "newCustomFieldAddLabel", newCustomFieldSaveLabel: "newCustomFieldSaveLabel", newCustomFieldCancelLabel: "newCustomFieldCancelLabel", selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", idPrefix: "idPrefix", modelPropertiesPath: "modelPropertiesPath", inputId: "inputId", editing: "editing", index: "index" }, outputs: { onDropEvent: "onDropEvent" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "schema-object-container", 4, "ngIf"], [1, "schema-object-container"], [1, "schema-object-title"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "addItemLabel", "addLoopLabel", "additionalAttributesLabel", "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "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, "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "model", "onDropFunction", "modelChange"]], template: function SchemaObjectComponent_Template(rf, ctx) { if (rf & 1) {
1155
- i0.ɵɵtemplate(0, SchemaObjectComponent_div_0_Template, 5, 20, "div", 0);
1156
- } if (rf & 2) {
1157
- i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type == "object");
1158
- } }, dependencies: [i1.NgIf, SchemaFormComponent, SchemaCustomAttributesComponent], styles: [".schema-object-container[_ngcontent-%COMP%]{border:1px solid #ddd;padding:10px;margin-top:10px;margin-bottom:10px;border-radius:5px}.schema-object-container[_ngcontent-%COMP%] .schema-object-title[_ngcontent-%COMP%]{background:#EEEEEE;font-weight:700;border-bottom:1px solid #ddd;padding:10px;margin-top:-10px;margin-left:-10px;width:calc(100% + 20px)}"] });
1159
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaObjectComponent, [{
1160
- type: Component,
1161
- args: [{ selector: 'schema-object', template: "<div class=\"schema-object-container\" *ngIf=\"loaded && canRender(schema) && schema.type == 'object'\">\r\n <div class=\"schema-object-title\">{{schema.title}}</div>\r\n <schema-form\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"model[schema.id]\"\r\n [schemas]=\"getSchemaProperties()\"\r\n [editing]=\"this.editing\">\r\n </schema-form>\r\n\r\n <div class=\"row struct-custom-properties\" *ngIf=\"this.model[schema.id] && schema.customProperties\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label bold\">{{ this.additionalAttributesLabel }}</label>\r\n <schema-custom-attributes\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [(model)]=\"this.model[schema.id].customAttributes\"\r\n [onDropFunction]=\"onDrop\">\r\n </schema-custom-attributes>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", styles: [".schema-object-container{border:1px solid #ddd;padding:10px;margin-top:10px;margin-bottom:10px;border-radius:5px}.schema-object-container .schema-object-title{background:#EEEEEE;font-weight:700;border-bottom:1px solid #ddd;padding:10px;margin-top:-10px;margin-left:-10px;width:calc(100% + 20px)}\n"] }]
1162
- }], null, { requiredLabel: [{
1163
- type: Input
1164
- }], addItemLabel: [{
1165
- type: Input
1166
- }], addLoopLabel: [{
1167
- type: Input
1168
- }], additionalAttributesLabel: [{
1169
- type: Input
1170
- }], customAttributeRemoveLabel: [{
1171
- type: Input
1172
- }], newCustomFieldNameLabel: [{
1173
- type: Input
1174
- }], newCustomFieldValueLabel: [{
1175
- type: Input
1176
- }], newCustomFieldAddLabel: [{
1177
- type: Input
1178
- }], newCustomFieldSaveLabel: [{
1179
- type: Input
1180
- }], newCustomFieldCancelLabel: [{
1181
- type: Input
1182
- }], selectPlaceHolderLabel: [{
1183
- type: Input
1184
- }], selectSearchPlaceHolderLabel: [{
1185
- type: Input
1186
- }], selectClearLabel: [{
1187
- type: Input
1188
- }], selectNotFoundLabel: [{
1189
- type: Input
1190
- }], idPrefix: [{
1191
- type: Input
1192
- }], modelPropertiesPath: [{
1193
- type: Input
1194
- }], inputId: [{
1195
- type: Input
1196
- }], editing: [{
1197
- type: Input
1198
- }], index: [{
1199
- type: Input
1200
- }], onDropEvent: [{
1201
- type: Output
1092
+ function SchemaObjectComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
1093
+ const _r3 = i0.ɵɵgetCurrentView();
1094
+ i0.ɵɵelementStart(0, "div", 5)(1, "div", 6)(2, "label", 7);
1095
+ i0.ɵɵtext(3);
1096
+ i0.ɵɵelementEnd();
1097
+ i0.ɵɵelementStart(4, "schema-custom-attributes", 8);
1098
+ i0.ɵɵlistener("modelChange", function SchemaObjectComponent_div_0_div_4_Template_schema_custom_attributes_modelChange_4_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.model[ctx_r2.schema.id].customAttributes = $event); });
1099
+ i0.ɵɵelementEnd()()();
1100
+ } if (rf & 2) {
1101
+ const ctx_r1 = i0.ɵɵnextContext(2);
1102
+ i0.ɵɵadvance(3);
1103
+ i0.ɵɵtextInterpolate(ctx_r1.additionalAttributesLabel);
1104
+ i0.ɵɵadvance(1);
1105
+ i0.ɵɵproperty("customAttributeRemoveLabel", ctx_r1.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r1.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r1.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r1.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r1.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r1.newCustomFieldCancelLabel)("model", ctx_r1.model[ctx_r1.schema.id].customAttributes)("onDropFunction", ctx_r1.onDrop);
1106
+ } }
1107
+ function SchemaObjectComponent_div_0_Template(rf, ctx) { if (rf & 1) {
1108
+ const _r5 = i0.ɵɵgetCurrentView();
1109
+ i0.ɵɵelementStart(0, "div", 1)(1, "div", 2);
1110
+ i0.ɵɵtext(2);
1111
+ i0.ɵɵelementEnd();
1112
+ i0.ɵɵelementStart(3, "schema-form", 3);
1113
+ i0.ɵɵlistener("modelChange", function SchemaObjectComponent_div_0_Template_schema_form_modelChange_3_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView((ctx_r4.model[ctx_r4.schema.id] = $event)); });
1114
+ i0.ɵɵelementEnd();
1115
+ i0.ɵɵtemplate(4, SchemaObjectComponent_div_0_div_4_Template, 5, 9, "div", 4);
1116
+ i0.ɵɵelementEnd();
1117
+ } if (rf & 2) {
1118
+ const ctx_r0 = i0.ɵɵnextContext();
1119
+ i0.ɵɵadvance(2);
1120
+ i0.ɵɵtextInterpolate(ctx_r0.schema.title);
1121
+ i0.ɵɵadvance(1);
1122
+ i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r0.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r0.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r0.selectClearLabel)("selectNotFoundLabel", ctx_r0.selectNotFoundLabel)("requiredLabel", ctx_r0.requiredLabel)("addItemLabel", ctx_r0.addItemLabel)("addLoopLabel", ctx_r0.addLoopLabel)("additionalAttributesLabel", ctx_r0.additionalAttributesLabel)("customAttributeRemoveLabel", ctx_r0.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r0.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r0.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r0.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r0.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r0.newCustomFieldCancelLabel)("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model[ctx_r0.schema.id])("schemas", ctx_r0.getSchemaProperties())("editing", ctx_r0.editing);
1123
+ i0.ɵɵadvance(1);
1124
+ i0.ɵɵproperty("ngIf", ctx_r0.model[ctx_r0.schema.id] && ctx_r0.schema.customProperties);
1125
+ } }
1126
+ class SchemaObjectComponent extends BaseSchemaComponent {
1127
+ requiredLabel = '(required)';
1128
+ addItemLabel = 'Add Item';
1129
+ addLoopLabel = 'Add Loop';
1130
+ additionalAttributesLabel = 'Additional Fields';
1131
+ customAttributeRemoveLabel = 'Remove';
1132
+ newCustomFieldNameLabel = 'Name';
1133
+ newCustomFieldValueLabel = 'Value';
1134
+ newCustomFieldAddLabel = 'Add';
1135
+ newCustomFieldSaveLabel = 'Save';
1136
+ newCustomFieldCancelLabel = 'Cancel';
1137
+ selectPlaceHolderLabel = 'Select Item';
1138
+ selectSearchPlaceHolderLabel = 'Search';
1139
+ selectClearLabel = 'Clear';
1140
+ selectNotFoundLabel = 'No Items Found';
1141
+ idPrefix;
1142
+ modelPropertiesPath;
1143
+ inputId;
1144
+ editing = false;
1145
+ index;
1146
+ onDropEvent = new EventEmitter();
1147
+ loaded = false;
1148
+ ngAfterContentInit() {
1149
+ if (this.schema?.type === 'object' && this.model) {
1150
+ this.model[this.schema.id] = this.model[this.schema.id] || {};
1151
+ }
1152
+ this.loaded = true;
1153
+ }
1154
+ onDrop($event, modelElement) {
1155
+ return onDropStruct($event, modelElement);
1156
+ }
1157
+ static ɵfac = /*@__PURE__*/ function () { let ɵSchemaObjectComponent_BaseFactory; return function SchemaObjectComponent_Factory(t) { return (ɵSchemaObjectComponent_BaseFactory || (ɵSchemaObjectComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SchemaObjectComponent)))(t || SchemaObjectComponent); }; }();
1158
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchemaObjectComponent, selectors: [["schema-object"]], inputs: { requiredLabel: "requiredLabel", addItemLabel: "addItemLabel", addLoopLabel: "addLoopLabel", additionalAttributesLabel: "additionalAttributesLabel", customAttributeRemoveLabel: "customAttributeRemoveLabel", newCustomFieldNameLabel: "newCustomFieldNameLabel", newCustomFieldValueLabel: "newCustomFieldValueLabel", newCustomFieldAddLabel: "newCustomFieldAddLabel", newCustomFieldSaveLabel: "newCustomFieldSaveLabel", newCustomFieldCancelLabel: "newCustomFieldCancelLabel", selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", idPrefix: "idPrefix", modelPropertiesPath: "modelPropertiesPath", inputId: "inputId", editing: "editing", index: "index" }, outputs: { onDropEvent: "onDropEvent" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "schema-object-container", 4, "ngIf"], [1, "schema-object-container"], [1, "schema-object-title"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "addItemLabel", "addLoopLabel", "additionalAttributesLabel", "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "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, "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "model", "onDropFunction", "modelChange"]], template: function SchemaObjectComponent_Template(rf, ctx) { if (rf & 1) {
1159
+ i0.ɵɵtemplate(0, SchemaObjectComponent_div_0_Template, 5, 20, "div", 0);
1160
+ } if (rf & 2) {
1161
+ i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type == "object");
1162
+ } }, dependencies: [i1.NgIf, SchemaFormComponent, SchemaCustomAttributesComponent], styles: [".schema-object-container[_ngcontent-%COMP%]{border:1px solid #ddd;padding:10px;margin-top:10px;margin-bottom:10px;border-radius:5px}.schema-object-container[_ngcontent-%COMP%] .schema-object-title[_ngcontent-%COMP%]{background:#EEEEEE;font-weight:700;border-bottom:1px solid #ddd;padding:10px;margin-top:-10px;margin-left:-10px;width:calc(100% + 20px)}"] });
1163
+ }
1164
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaObjectComponent, [{
1165
+ type: Component,
1166
+ args: [{ selector: 'schema-object', template: "<div class=\"schema-object-container\" *ngIf=\"loaded && canRender(schema) && schema.type == 'object'\">\r\n <div class=\"schema-object-title\">{{schema.title}}</div>\r\n <schema-form\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"model[schema.id]\"\r\n [schemas]=\"getSchemaProperties()\"\r\n [editing]=\"this.editing\">\r\n </schema-form>\r\n\r\n <div class=\"row struct-custom-properties\" *ngIf=\"this.model[schema.id] && schema.customProperties\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label bold\">{{ this.additionalAttributesLabel }}</label>\r\n <schema-custom-attributes\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [(model)]=\"this.model[schema.id].customAttributes\"\r\n [onDropFunction]=\"onDrop\">\r\n </schema-custom-attributes>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", styles: [".schema-object-container{border:1px solid #ddd;padding:10px;margin-top:10px;margin-bottom:10px;border-radius:5px}.schema-object-container .schema-object-title{background:#EEEEEE;font-weight:700;border-bottom:1px solid #ddd;padding:10px;margin-top:-10px;margin-left:-10px;width:calc(100% + 20px)}\n"] }]
1167
+ }], null, { requiredLabel: [{
1168
+ type: Input
1169
+ }], addItemLabel: [{
1170
+ type: Input
1171
+ }], addLoopLabel: [{
1172
+ type: Input
1173
+ }], additionalAttributesLabel: [{
1174
+ type: Input
1175
+ }], customAttributeRemoveLabel: [{
1176
+ type: Input
1177
+ }], newCustomFieldNameLabel: [{
1178
+ type: Input
1179
+ }], newCustomFieldValueLabel: [{
1180
+ type: Input
1181
+ }], newCustomFieldAddLabel: [{
1182
+ type: Input
1183
+ }], newCustomFieldSaveLabel: [{
1184
+ type: Input
1185
+ }], newCustomFieldCancelLabel: [{
1186
+ type: Input
1187
+ }], selectPlaceHolderLabel: [{
1188
+ type: Input
1189
+ }], selectSearchPlaceHolderLabel: [{
1190
+ type: Input
1191
+ }], selectClearLabel: [{
1192
+ type: Input
1193
+ }], selectNotFoundLabel: [{
1194
+ type: Input
1195
+ }], idPrefix: [{
1196
+ type: Input
1197
+ }], modelPropertiesPath: [{
1198
+ type: Input
1199
+ }], inputId: [{
1200
+ type: Input
1201
+ }], editing: [{
1202
+ type: Input
1203
+ }], index: [{
1204
+ type: Input
1205
+ }], onDropEvent: [{
1206
+ type: Output
1202
1207
  }] }); })();
1203
1208
 
1204
- class SchemaValidationField {
1205
- constructor(emptyFields, invalidMinLengthFields, invalidMaxLengthFields) {
1206
- this.emptyFields = emptyFields;
1207
- this.invalidMinLengthFields = invalidMinLengthFields;
1208
- this.invalidMaxLengthFields = invalidMaxLengthFields;
1209
- }
1210
- isValidSchemaFields() {
1211
- return this.emptyFields?.length < 1 && this.invalidMinLengthFields?.length < 1 && this.invalidMaxLengthFields?.length < 1;
1212
- }
1213
- isInvalidSchemaFields() {
1214
- return !this.isValidSchemaFields();
1215
- }
1209
+ class SchemaValidationField {
1210
+ emptyFields;
1211
+ invalidMinLengthFields;
1212
+ invalidMaxLengthFields;
1213
+ validationErrorsLabel;
1214
+ constructor(emptyFields, invalidMinLengthFields, invalidMaxLengthFields) {
1215
+ this.emptyFields = emptyFields;
1216
+ this.invalidMinLengthFields = invalidMinLengthFields;
1217
+ this.invalidMaxLengthFields = invalidMaxLengthFields;
1218
+ }
1219
+ isValidSchemaFields() {
1220
+ return this.emptyFields?.length < 1 && this.invalidMinLengthFields?.length < 1 && this.invalidMaxLengthFields?.length < 1;
1221
+ }
1222
+ isInvalidSchemaFields() {
1223
+ return !this.isValidSchemaFields();
1224
+ }
1216
1225
  }
1217
1226
 
1218
- class SchemaFieldsService {
1219
- async validateSchemaFields(propertiesRendered, model, editing) {
1220
- if (!propertiesRendered) {
1221
- return new SchemaValidationField([], [], []);
1222
- }
1223
- const emptyFields = [];
1224
- const invalidMinLengthFields = [];
1225
- const invalidMaxLengthFields = [];
1226
- this.processProperties(propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1227
- const structValidationField = new SchemaValidationField(emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1228
- structValidationField.validationErrorsLabel = await this.getErrorsStringArray(structValidationField);
1229
- return structValidationField;
1230
- }
1231
- processProperties(propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, recursive) {
1232
- for (const property of propertiesRendered) {
1233
- if ((property.type === 'object' || property.type === 'array') && property.properties) {
1234
- this.processProperties(property.properties, model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1235
- }
1236
- else if (property.type === 'array' && !property.properties) {
1237
- const newProperty = { ...property };
1238
- newProperty.type = 'string';
1239
- this.processProperties([newProperty], model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1240
- }
1241
- else {
1242
- const validateModel = recursive ? model : model[property.id];
1243
- if (property.type !== 'password' || !editing || validateModel !== undefined) {
1244
- if (property?.canRender && property?.minLength > 0 &&
1245
- (validateModel === undefined || validateModel === '' || validateModel === null)) {
1246
- emptyFields.push(property);
1247
- }
1248
- else if (property?.canRender && property?.minLength > 0 && (validateModel?.length < property.minLength)) {
1249
- invalidMinLengthFields.push(property);
1250
- }
1251
- else if (property?.canRender && property?.maxLength > 0 && (validateModel?.length > property.maxLength)) {
1252
- invalidMaxLengthFields.push(property);
1253
- }
1254
- }
1255
- }
1256
- }
1257
- }
1258
- async getErrorsStringArray(structValidation) {
1259
- if (!structValidation.isInvalidSchemaFields()) {
1260
- return [];
1261
- }
1262
- const errors = [];
1263
- for (const field of structValidation.emptyFields) {
1264
- const fieldName = field.title || field.id;
1265
- errors.push({
1266
- type: 'emptyFields',
1267
- fieldName
1268
- });
1269
- }
1270
- for (const field of structValidation.invalidMinLengthFields) {
1271
- const fieldName = field.title || field.id;
1272
- errors.push({
1273
- type: 'invalidMinLengthFields',
1274
- fieldName,
1275
- minLength: field.minLength
1276
- });
1277
- }
1278
- for (const field of structValidation.invalidMaxLengthFields) {
1279
- const fieldName = field.title || field.id;
1280
- errors.push({
1281
- type: 'invalidMaxLengthFields',
1282
- fieldName,
1283
- maxLength: field.maxLength
1284
- });
1285
- }
1286
- return errors;
1287
- }
1288
- }
1289
- SchemaFieldsService.ɵfac = function SchemaFieldsService_Factory(t) { return new (t || SchemaFieldsService)(); };
1290
- SchemaFieldsService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: SchemaFieldsService, factory: SchemaFieldsService.ɵfac });
1291
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaFieldsService, [{
1292
- type: Injectable
1227
+ class SchemaFieldsService {
1228
+ async validateSchemaFields(propertiesRendered, model, editing) {
1229
+ if (!propertiesRendered) {
1230
+ return new SchemaValidationField([], [], []);
1231
+ }
1232
+ const emptyFields = [];
1233
+ const invalidMinLengthFields = [];
1234
+ const invalidMaxLengthFields = [];
1235
+ this.processProperties(propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1236
+ const structValidationField = new SchemaValidationField(emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1237
+ structValidationField.validationErrorsLabel = await this.getErrorsStringArray(structValidationField);
1238
+ return structValidationField;
1239
+ }
1240
+ processProperties(propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, recursive) {
1241
+ for (const property of propertiesRendered) {
1242
+ if ((property.type === 'object' || property.type === 'array') && property.properties) {
1243
+ this.processProperties(property.properties, model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1244
+ }
1245
+ else if (property.type === 'array' && !property.properties) {
1246
+ const newProperty = { ...property };
1247
+ newProperty.type = 'string';
1248
+ this.processProperties([newProperty], model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1249
+ }
1250
+ else {
1251
+ const validateModel = recursive ? model : model[property.id];
1252
+ if (property.type !== 'password' || !editing || validateModel !== undefined) {
1253
+ if (property?.canRender && property?.minLength > 0 &&
1254
+ (validateModel === undefined || validateModel === '' || validateModel === null)) {
1255
+ emptyFields.push(property);
1256
+ }
1257
+ else if (property?.canRender && property?.minLength > 0 && (validateModel?.length < property.minLength)) {
1258
+ invalidMinLengthFields.push(property);
1259
+ }
1260
+ else if (property?.canRender && property?.maxLength > 0 && (validateModel?.length > property.maxLength)) {
1261
+ invalidMaxLengthFields.push(property);
1262
+ }
1263
+ }
1264
+ }
1265
+ }
1266
+ }
1267
+ async getErrorsStringArray(structValidation) {
1268
+ if (!structValidation.isInvalidSchemaFields()) {
1269
+ return [];
1270
+ }
1271
+ const errors = [];
1272
+ for (const field of structValidation.emptyFields) {
1273
+ const fieldName = field.title || field.id;
1274
+ errors.push({
1275
+ type: 'emptyFields',
1276
+ fieldName
1277
+ });
1278
+ }
1279
+ for (const field of structValidation.invalidMinLengthFields) {
1280
+ const fieldName = field.title || field.id;
1281
+ errors.push({
1282
+ type: 'invalidMinLengthFields',
1283
+ fieldName,
1284
+ minLength: field.minLength
1285
+ });
1286
+ }
1287
+ for (const field of structValidation.invalidMaxLengthFields) {
1288
+ const fieldName = field.title || field.id;
1289
+ errors.push({
1290
+ type: 'invalidMaxLengthFields',
1291
+ fieldName,
1292
+ maxLength: field.maxLength
1293
+ });
1294
+ }
1295
+ return errors;
1296
+ }
1297
+ static ɵfac = function SchemaFieldsService_Factory(t) { return new (t || SchemaFieldsService)(); };
1298
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: SchemaFieldsService, factory: SchemaFieldsService.ɵfac });
1299
+ }
1300
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaFieldsService, [{
1301
+ type: Injectable
1293
1302
  }], null, null); })();
1294
1303
 
1295
- function SchemaFormRenderComponent_div_0_div_2_div_1_Template(rf, ctx) { if (rf & 1) {
1296
- const _r6 = i0.ɵɵgetCurrentView();
1297
- i0.ɵɵelementStart(0, "div", 6)(1, "div", 7)(2, "label", 8);
1298
- i0.ɵɵtext(3);
1299
- i0.ɵɵelementEnd();
1300
- i0.ɵɵelementStart(4, "schema-custom-attributes", 9);
1301
- i0.ɵɵlistener("modelChange", function SchemaFormRenderComponent_div_0_div_2_div_1_Template_schema_custom_attributes_modelChange_4_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r5.model.customAttributes = $event); });
1302
- i0.ɵɵelementEnd()()();
1303
- } if (rf & 2) {
1304
- const ctx_r4 = i0.ɵɵnextContext(3);
1305
- i0.ɵɵadvance(3);
1306
- i0.ɵɵtextInterpolate(ctx_r4.additionalAttributesLabel);
1307
- i0.ɵɵadvance(1);
1308
- i0.ɵɵproperty("customAttributeRemoveLabel", ctx_r4.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r4.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r4.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r4.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r4.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r4.newCustomFieldCancelLabel)("model", ctx_r4.model.customAttributes)("onDropFunction", ctx_r4.onDrop);
1309
- } }
1310
- function SchemaFormRenderComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
1311
- i0.ɵɵelementStart(0, "div", 4);
1312
- i0.ɵɵtemplate(1, SchemaFormRenderComponent_div_0_div_2_div_1_Template, 5, 9, "div", 5);
1313
- i0.ɵɵelementEnd();
1314
- } if (rf & 2) {
1315
- const ctx_r1 = i0.ɵɵnextContext(2);
1316
- i0.ɵɵadvance(1);
1317
- i0.ɵɵproperty("ngIf", ctx_r1.model && ctx_r1.customProperties);
1318
- } }
1319
- function SchemaFormRenderComponent_div_0_Template(rf, ctx) { if (rf & 1) {
1320
- const _r8 = i0.ɵɵgetCurrentView();
1321
- i0.ɵɵelementStart(0, "div", 1)(1, "schema-form", 2);
1322
- i0.ɵɵlistener("modelChange", function SchemaFormRenderComponent_div_0_Template_schema_form_modelChange_1_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r7.model = $event); });
1323
- i0.ɵɵelementEnd();
1324
- i0.ɵɵtemplate(2, SchemaFormRenderComponent_div_0_div_2_Template, 2, 1, "div", 3);
1325
- i0.ɵɵelementEnd();
1326
- } if (rf & 2) {
1327
- const ctx_r0 = i0.ɵɵnextContext();
1328
- i0.ɵɵadvance(1);
1329
- i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r0.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r0.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r0.selectClearLabel)("selectNotFoundLabel", ctx_r0.selectNotFoundLabel)("requiredLabel", ctx_r0.requiredLabel)("addItemLabel", ctx_r0.addItemLabel)("addLoopLabel", ctx_r0.addLoopLabel)("additionalAttributesLabel", ctx_r0.additionalAttributesLabel)("customAttributeRemoveLabel", ctx_r0.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r0.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r0.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r0.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r0.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r0.newCustomFieldCancelLabel)("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schemas", ctx_r0.schemas)("editing", ctx_r0.editing);
1330
- i0.ɵɵadvance(1);
1331
- i0.ɵɵproperty("ngForOf", ctx_r0.schemas);
1332
- } }
1333
- class SchemaFormRenderComponent extends BaseSchemaComponent {
1334
- constructor() {
1335
- super(...arguments);
1336
- this.requiredLabel = '(required)';
1337
- this.addItemLabel = 'Add Item';
1338
- this.addLoopLabel = 'Add Loop';
1339
- this.additionalAttributesLabel = 'Additional Fields';
1340
- this.customAttributeRemoveLabel = 'Remove';
1341
- this.newCustomFieldNameLabel = 'Name';
1342
- this.newCustomFieldValueLabel = 'Value';
1343
- this.newCustomFieldAddLabel = 'Add';
1344
- this.newCustomFieldSaveLabel = 'Save';
1345
- this.newCustomFieldCancelLabel = 'Cancel';
1346
- this.selectPlaceHolderLabel = 'Select Item';
1347
- this.selectSearchPlaceHolderLabel = 'Search';
1348
- this.selectClearLabel = 'Clear';
1349
- this.selectNotFoundLabel = 'No Items Found';
1350
- this.schemas = [];
1351
- this.customProperties = false;
1352
- this.editing = false;
1353
- this.loaded = false;
1354
- }
1355
- ngAfterContentInit() {
1356
- this.loaded = true;
1357
- }
1358
- onDrop($event, modelElement) {
1359
- return onDropStruct($event, modelElement);
1360
- }
1361
- getId(index) {
1362
- return `${this.idPrefix}-struct-${index}`;
1363
- }
1364
- }
1365
- SchemaFormRenderComponent.ɵfac = /*@__PURE__*/ function () { let ɵSchemaFormRenderComponent_BaseFactory; return function SchemaFormRenderComponent_Factory(t) { return (ɵSchemaFormRenderComponent_BaseFactory || (ɵSchemaFormRenderComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SchemaFormRenderComponent)))(t || SchemaFormRenderComponent); }; }();
1366
- SchemaFormRenderComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchemaFormRenderComponent, selectors: [["schema-form-render"]], inputs: { requiredLabel: "requiredLabel", addItemLabel: "addItemLabel", addLoopLabel: "addLoopLabel", additionalAttributesLabel: "additionalAttributesLabel", customAttributeRemoveLabel: "customAttributeRemoveLabel", newCustomFieldNameLabel: "newCustomFieldNameLabel", newCustomFieldValueLabel: "newCustomFieldValueLabel", newCustomFieldAddLabel: "newCustomFieldAddLabel", newCustomFieldSaveLabel: "newCustomFieldSaveLabel", newCustomFieldCancelLabel: "newCustomFieldCancelLabel", selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", idPrefix: "idPrefix", schemas: "schemas", customProperties: "customProperties", editing: "editing", inputType: "inputType" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "schema", 4, "ngIf"], [1, "schema"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "addItemLabel", "addLoopLabel", "additionalAttributesLabel", "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "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, "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "model", "onDropFunction", "modelChange"]], template: function SchemaFormRenderComponent_Template(rf, ctx) { if (rf & 1) {
1367
- i0.ɵɵtemplate(0, SchemaFormRenderComponent_div_0_Template, 3, 19, "div", 0);
1368
- } if (rf & 2) {
1369
- i0.ɵɵproperty("ngIf", ctx.loaded);
1370
- } }, dependencies: [i1.NgForOf, i1.NgIf, SchemaFormComponent, SchemaCustomAttributesComponent], styles: [".schema[_ngcontent-%COMP%] .info-label{display:block}.schema[_ngcontent-%COMP%] input.form-control{width:calc(100% - 24px);padding:11px;border:1px solid #DDD;border-radius:3px;background:#FFF}.schema[_ngcontent-%COMP%] input.form-control:disabled{background:#ccc}.schema[_ngcontent-%COMP%] select.form-control{width:100%;padding:11px;border-radius:4px;border:1px solid #DDD;color:#777;cursor:pointer}.schema[_ngcontent-%COMP%] .ng-select-container{height:38px!important;min-height:38px!important}.schema[_ngcontent-%COMP%] .btn-outline-primary{padding:5px 15px;background:var(--color-primary);border:1px solid var(--color-secondary);color:var(--color-secondary);border-radius:4px;cursor:pointer}.schema[_ngcontent-%COMP%] .btn-outline-primary:hover{background:var(--color-primary-hover)}.schema[_ngcontent-%COMP%] .subsection-item-title{color:var(--color-primary)}.schema[_ngcontent-%COMP%] array-session .subsection-element{color:var(--color-primary)}"] });
1371
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaFormRenderComponent, [{
1372
- type: Component,
1373
- args: [{ selector: 'schema-form-render', template: "<div class=\"schema\" *ngIf=\"loaded\">\r\n <schema-form\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"model\"\r\n [schemas]=\"schemas\"\r\n [editing]=\"this.editing\"></schema-form>\r\n\r\n <div class=\"schema-properties\" *ngFor=\"let schema of schemas; let i = index\">\r\n <div class=\"row struct-custom-properties\" *ngIf=\"this.model && customProperties\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label bold\">{{ this.additionalAttributesLabel }}</label>\r\n <schema-custom-attributes\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [(model)]=\"model.customAttributes\"\r\n [onDropFunction]=\"onDrop\">\r\n </schema-custom-attributes>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", styles: [".schema ::ng-deep .info-label{display:block}.schema ::ng-deep input.form-control{width:calc(100% - 24px);padding:11px;border:1px solid #DDD;border-radius:3px;background:#FFF}.schema ::ng-deep input.form-control:disabled{background:#ccc}.schema ::ng-deep select.form-control{width:100%;padding:11px;border-radius:4px;border:1px solid #DDD;color:#777;cursor:pointer}.schema ::ng-deep .ng-select-container{height:38px!important;min-height:38px!important}.schema ::ng-deep .btn-outline-primary{padding:5px 15px;background:var(--color-primary);border:1px solid var(--color-secondary);color:var(--color-secondary);border-radius:4px;cursor:pointer}.schema ::ng-deep .btn-outline-primary:hover{background:var(--color-primary-hover)}.schema ::ng-deep .subsection-item-title{color:var(--color-primary)}.schema ::ng-deep array-session .subsection-element{color:var(--color-primary)}\n"] }]
1374
- }], null, { requiredLabel: [{
1375
- type: Input
1376
- }], addItemLabel: [{
1377
- type: Input
1378
- }], addLoopLabel: [{
1379
- type: Input
1380
- }], additionalAttributesLabel: [{
1381
- type: Input
1382
- }], customAttributeRemoveLabel: [{
1383
- type: Input
1384
- }], newCustomFieldNameLabel: [{
1385
- type: Input
1386
- }], newCustomFieldValueLabel: [{
1387
- type: Input
1388
- }], newCustomFieldAddLabel: [{
1389
- type: Input
1390
- }], newCustomFieldSaveLabel: [{
1391
- type: Input
1392
- }], newCustomFieldCancelLabel: [{
1393
- type: Input
1394
- }], selectPlaceHolderLabel: [{
1395
- type: Input
1396
- }], selectSearchPlaceHolderLabel: [{
1397
- type: Input
1398
- }], selectClearLabel: [{
1399
- type: Input
1400
- }], selectNotFoundLabel: [{
1401
- type: Input
1402
- }], idPrefix: [{
1403
- type: Input
1404
- }], schemas: [{
1405
- type: Input
1406
- }], customProperties: [{
1407
- type: Input
1408
- }], editing: [{
1409
- type: Input
1410
- }], inputType: [{
1411
- type: Input
1304
+ function SchemaFormRenderComponent_div_0_div_2_div_1_Template(rf, ctx) { if (rf & 1) {
1305
+ const _r6 = i0.ɵɵgetCurrentView();
1306
+ i0.ɵɵelementStart(0, "div", 6)(1, "div", 7)(2, "label", 8);
1307
+ i0.ɵɵtext(3);
1308
+ i0.ɵɵelementEnd();
1309
+ i0.ɵɵelementStart(4, "schema-custom-attributes", 9);
1310
+ i0.ɵɵlistener("modelChange", function SchemaFormRenderComponent_div_0_div_2_div_1_Template_schema_custom_attributes_modelChange_4_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r5.model.customAttributes = $event); });
1311
+ i0.ɵɵelementEnd()()();
1312
+ } if (rf & 2) {
1313
+ const ctx_r4 = i0.ɵɵnextContext(3);
1314
+ i0.ɵɵadvance(3);
1315
+ i0.ɵɵtextInterpolate(ctx_r4.additionalAttributesLabel);
1316
+ i0.ɵɵadvance(1);
1317
+ i0.ɵɵproperty("customAttributeRemoveLabel", ctx_r4.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r4.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r4.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r4.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r4.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r4.newCustomFieldCancelLabel)("model", ctx_r4.model.customAttributes)("onDropFunction", ctx_r4.onDrop);
1318
+ } }
1319
+ function SchemaFormRenderComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
1320
+ i0.ɵɵelementStart(0, "div", 4);
1321
+ i0.ɵɵtemplate(1, SchemaFormRenderComponent_div_0_div_2_div_1_Template, 5, 9, "div", 5);
1322
+ i0.ɵɵelementEnd();
1323
+ } if (rf & 2) {
1324
+ const ctx_r1 = i0.ɵɵnextContext(2);
1325
+ i0.ɵɵadvance(1);
1326
+ i0.ɵɵproperty("ngIf", ctx_r1.model && ctx_r1.customProperties);
1327
+ } }
1328
+ function SchemaFormRenderComponent_div_0_Template(rf, ctx) { if (rf & 1) {
1329
+ const _r8 = i0.ɵɵgetCurrentView();
1330
+ i0.ɵɵelementStart(0, "div", 1)(1, "schema-form", 2);
1331
+ i0.ɵɵlistener("modelChange", function SchemaFormRenderComponent_div_0_Template_schema_form_modelChange_1_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r7.model = $event); });
1332
+ i0.ɵɵelementEnd();
1333
+ i0.ɵɵtemplate(2, SchemaFormRenderComponent_div_0_div_2_Template, 2, 1, "div", 3);
1334
+ i0.ɵɵelementEnd();
1335
+ } if (rf & 2) {
1336
+ const ctx_r0 = i0.ɵɵnextContext();
1337
+ i0.ɵɵadvance(1);
1338
+ i0.ɵɵproperty("selectPlaceHolderLabel", ctx_r0.selectPlaceHolderLabel)("selectSearchPlaceHolderLabel", ctx_r0.selectSearchPlaceHolderLabel)("selectClearLabel", ctx_r0.selectClearLabel)("selectNotFoundLabel", ctx_r0.selectNotFoundLabel)("requiredLabel", ctx_r0.requiredLabel)("addItemLabel", ctx_r0.addItemLabel)("addLoopLabel", ctx_r0.addLoopLabel)("additionalAttributesLabel", ctx_r0.additionalAttributesLabel)("customAttributeRemoveLabel", ctx_r0.customAttributeRemoveLabel)("newCustomFieldNameLabel", ctx_r0.newCustomFieldNameLabel)("newCustomFieldValueLabel", ctx_r0.newCustomFieldValueLabel)("newCustomFieldAddLabel", ctx_r0.newCustomFieldAddLabel)("newCustomFieldSaveLabel", ctx_r0.newCustomFieldSaveLabel)("newCustomFieldCancelLabel", ctx_r0.newCustomFieldCancelLabel)("idPrefix", ctx_r0.idPrefix)("model", ctx_r0.model)("schemas", ctx_r0.schemas)("editing", ctx_r0.editing);
1339
+ i0.ɵɵadvance(1);
1340
+ i0.ɵɵproperty("ngForOf", ctx_r0.schemas);
1341
+ } }
1342
+ class SchemaFormRenderComponent extends BaseSchemaComponent {
1343
+ requiredLabel = '(required)';
1344
+ addItemLabel = 'Add Item';
1345
+ addLoopLabel = 'Add Loop';
1346
+ additionalAttributesLabel = 'Additional Fields';
1347
+ customAttributeRemoveLabel = 'Remove';
1348
+ newCustomFieldNameLabel = 'Name';
1349
+ newCustomFieldValueLabel = 'Value';
1350
+ newCustomFieldAddLabel = 'Add';
1351
+ newCustomFieldSaveLabel = 'Save';
1352
+ newCustomFieldCancelLabel = 'Cancel';
1353
+ selectPlaceHolderLabel = 'Select Item';
1354
+ selectSearchPlaceHolderLabel = 'Search';
1355
+ selectClearLabel = 'Clear';
1356
+ selectNotFoundLabel = 'No Items Found';
1357
+ idPrefix;
1358
+ schemas = [];
1359
+ customProperties = false;
1360
+ editing = false;
1361
+ inputType;
1362
+ loaded = false;
1363
+ ngAfterContentInit() {
1364
+ this.loaded = true;
1365
+ }
1366
+ onDrop($event, modelElement) {
1367
+ return onDropStruct($event, modelElement);
1368
+ }
1369
+ getId(index) {
1370
+ return `${this.idPrefix}-struct-${index}`;
1371
+ }
1372
+ static ɵfac = /*@__PURE__*/ function () { let ɵSchemaFormRenderComponent_BaseFactory; return function SchemaFormRenderComponent_Factory(t) { return (ɵSchemaFormRenderComponent_BaseFactory || (ɵSchemaFormRenderComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SchemaFormRenderComponent)))(t || SchemaFormRenderComponent); }; }();
1373
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SchemaFormRenderComponent, selectors: [["schema-form-render"]], inputs: { requiredLabel: "requiredLabel", addItemLabel: "addItemLabel", addLoopLabel: "addLoopLabel", additionalAttributesLabel: "additionalAttributesLabel", customAttributeRemoveLabel: "customAttributeRemoveLabel", newCustomFieldNameLabel: "newCustomFieldNameLabel", newCustomFieldValueLabel: "newCustomFieldValueLabel", newCustomFieldAddLabel: "newCustomFieldAddLabel", newCustomFieldSaveLabel: "newCustomFieldSaveLabel", newCustomFieldCancelLabel: "newCustomFieldCancelLabel", selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", idPrefix: "idPrefix", schemas: "schemas", customProperties: "customProperties", editing: "editing", inputType: "inputType" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "schema", 4, "ngIf"], [1, "schema"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "addItemLabel", "addLoopLabel", "additionalAttributesLabel", "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "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, "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "model", "onDropFunction", "modelChange"]], template: function SchemaFormRenderComponent_Template(rf, ctx) { if (rf & 1) {
1374
+ i0.ɵɵtemplate(0, SchemaFormRenderComponent_div_0_Template, 3, 19, "div", 0);
1375
+ } if (rf & 2) {
1376
+ i0.ɵɵproperty("ngIf", ctx.loaded);
1377
+ } }, dependencies: [i1.NgForOf, i1.NgIf, SchemaFormComponent, SchemaCustomAttributesComponent], styles: [".schema[_ngcontent-%COMP%] .info-label{display:block}.schema[_ngcontent-%COMP%] input.form-control{width:calc(100% - 24px);padding:11px;border:1px solid #DDD;border-radius:3px;background:#FFF}.schema[_ngcontent-%COMP%] input.form-control:disabled{background:#ccc}.schema[_ngcontent-%COMP%] select.form-control{width:100%;padding:11px;border-radius:4px;border:1px solid #DDD;color:#777;cursor:pointer}.schema[_ngcontent-%COMP%] .ng-select-container{height:38px!important;min-height:38px!important}.schema[_ngcontent-%COMP%] .btn-outline-primary{padding:5px 15px;background:var(--color-primary);border:1px solid var(--color-secondary);color:var(--color-secondary);border-radius:4px;cursor:pointer}.schema[_ngcontent-%COMP%] .btn-outline-primary:hover{background:var(--color-primary-hover)}.schema[_ngcontent-%COMP%] .subsection-item-title{color:var(--color-primary)}.schema[_ngcontent-%COMP%] array-session .subsection-element{color:var(--color-primary)}"] });
1378
+ }
1379
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaFormRenderComponent, [{
1380
+ type: Component,
1381
+ args: [{ selector: 'schema-form-render', template: "<div class=\"schema\" *ngIf=\"loaded\">\r\n <schema-form\r\n [selectPlaceHolderLabel]=\"selectPlaceHolderLabel\"\r\n [selectSearchPlaceHolderLabel]=\"selectSearchPlaceHolderLabel\"\r\n [selectClearLabel]=\"selectClearLabel\"\r\n [selectNotFoundLabel]=\"selectNotFoundLabel\"\r\n [requiredLabel]=\"requiredLabel\"\r\n [addItemLabel]=\"addItemLabel\"\r\n [addLoopLabel]=\"addLoopLabel\"\r\n [additionalAttributesLabel]=\"additionalAttributesLabel\"\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [idPrefix]=\"idPrefix\"\r\n [(model)]=\"model\"\r\n [schemas]=\"schemas\"\r\n [editing]=\"this.editing\"></schema-form>\r\n\r\n <div class=\"schema-properties\" *ngFor=\"let schema of schemas; let i = index\">\r\n <div class=\"row struct-custom-properties\" *ngIf=\"this.model && customProperties\">\r\n <div class=\"col-md-12\">\r\n <label class=\"info-label bold\">{{ this.additionalAttributesLabel }}</label>\r\n <schema-custom-attributes\r\n [customAttributeRemoveLabel]=\"customAttributeRemoveLabel\"\r\n [newCustomFieldNameLabel]=\"newCustomFieldNameLabel\"\r\n [newCustomFieldValueLabel]=\"newCustomFieldValueLabel\"\r\n [newCustomFieldAddLabel]=\"newCustomFieldAddLabel\"\r\n [newCustomFieldSaveLabel]=\"newCustomFieldSaveLabel\"\r\n [newCustomFieldCancelLabel]=\"newCustomFieldCancelLabel\"\r\n [(model)]=\"model.customAttributes\"\r\n [onDropFunction]=\"onDrop\">\r\n </schema-custom-attributes>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", styles: [".schema ::ng-deep .info-label{display:block}.schema ::ng-deep input.form-control{width:calc(100% - 24px);padding:11px;border:1px solid #DDD;border-radius:3px;background:#FFF}.schema ::ng-deep input.form-control:disabled{background:#ccc}.schema ::ng-deep select.form-control{width:100%;padding:11px;border-radius:4px;border:1px solid #DDD;color:#777;cursor:pointer}.schema ::ng-deep .ng-select-container{height:38px!important;min-height:38px!important}.schema ::ng-deep .btn-outline-primary{padding:5px 15px;background:var(--color-primary);border:1px solid var(--color-secondary);color:var(--color-secondary);border-radius:4px;cursor:pointer}.schema ::ng-deep .btn-outline-primary:hover{background:var(--color-primary-hover)}.schema ::ng-deep .subsection-item-title{color:var(--color-primary)}.schema ::ng-deep array-session .subsection-element{color:var(--color-primary)}\n"] }]
1382
+ }], null, { requiredLabel: [{
1383
+ type: Input
1384
+ }], addItemLabel: [{
1385
+ type: Input
1386
+ }], addLoopLabel: [{
1387
+ type: Input
1388
+ }], additionalAttributesLabel: [{
1389
+ type: Input
1390
+ }], customAttributeRemoveLabel: [{
1391
+ type: Input
1392
+ }], newCustomFieldNameLabel: [{
1393
+ type: Input
1394
+ }], newCustomFieldValueLabel: [{
1395
+ type: Input
1396
+ }], newCustomFieldAddLabel: [{
1397
+ type: Input
1398
+ }], newCustomFieldSaveLabel: [{
1399
+ type: Input
1400
+ }], newCustomFieldCancelLabel: [{
1401
+ type: Input
1402
+ }], selectPlaceHolderLabel: [{
1403
+ type: Input
1404
+ }], selectSearchPlaceHolderLabel: [{
1405
+ type: Input
1406
+ }], selectClearLabel: [{
1407
+ type: Input
1408
+ }], selectNotFoundLabel: [{
1409
+ type: Input
1410
+ }], idPrefix: [{
1411
+ type: Input
1412
+ }], schemas: [{
1413
+ type: Input
1414
+ }], customProperties: [{
1415
+ type: Input
1416
+ }], editing: [{
1417
+ type: Input
1418
+ }], inputType: [{
1419
+ type: Input
1412
1420
  }] }); })();
1413
1421
 
1414
- class TypeScriptCompileBase {
1415
- getTranslate(text) {
1416
- return text;
1417
- }
1418
- addItemToFormProperties(formProperties, item, key) {
1419
- this.translateProperties(item);
1420
- if (item.minLength && item.minLength > 0) {
1421
- formProperties[key] = new FormControl([null, [Validators.required]]);
1422
- }
1423
- else {
1424
- formProperties[key] = new FormControl([null]);
1425
- }
1426
- }
1427
- compileProperties(input) {
1428
- const compiledProperties = [];
1429
- const formProperties = {};
1430
- let inputData = {};
1431
- const inputToCompile = JSON.parse(JSON.stringify(input));
1432
- this.translateProperties(inputToCompile);
1433
- if (inputToCompile.properties) {
1434
- if (inputToCompile.type === 'array') {
1435
- inputData = [];
1436
- }
1437
- if (inputToCompile.type === 'object') {
1438
- inputData = {};
1439
- }
1440
- inputToCompile.id = 'inputData';
1441
- this.proccessProperties(inputToCompile, formProperties, 'inputData');
1442
- this.translateProperties(inputToCompile);
1443
- compiledProperties.push(inputToCompile);
1444
- }
1445
- else if (inputToCompile.type === 'array') {
1446
- inputToCompile.id = 'inputData';
1447
- inputData = [];
1448
- this.addItemToFormProperties(formProperties, inputToCompile, 'inputData');
1449
- compiledProperties.push(inputToCompile);
1450
- }
1451
- else if (!inputToCompile.type) {
1452
- for (let index = 0; index < Object.keys(inputToCompile).length; index++) {
1453
- const key = Object.keys(inputToCompile)[index];
1454
- const item = inputToCompile[key];
1455
- item.id = key;
1456
- if (item.type === 'array') {
1457
- inputData[item.id] = [];
1458
- }
1459
- if (item.type === 'object') {
1460
- inputData[item.id] = {};
1461
- }
1462
- this.proccessProperties(item, formProperties, key);
1463
- this.translateProperties(item);
1464
- compiledProperties.push(item);
1465
- }
1466
- }
1467
- compiledProperties.sort((a, b) => a.propertyOrder - b.propertyOrder);
1468
- return { compiledProperties, formProperties, inputData };
1469
- }
1470
- translateProperties(input) {
1471
- if (input?.title) {
1472
- input.title = this.getTranslate(input.title);
1473
- }
1474
- if (input?.description) {
1475
- input.description = this.getTranslate(input.description);
1476
- }
1477
- if (input?.options instanceof Array) {
1478
- input?.options.forEach((option) => {
1479
- option.value = this.getTranslate(option.value);
1480
- });
1481
- }
1482
- }
1483
- proccessProperties(item, formProperties, key) {
1484
- this.translateProperties(item);
1485
- if (this.hasProperties(item)) {
1486
- const arFieldsChild = [];
1487
- for (let indexChild = 0; indexChild < Object.keys(item.properties).length; indexChild++) {
1488
- const keyChild = Object.keys(item.properties)[indexChild];
1489
- const itemChild = item.properties[keyChild];
1490
- itemChild.id = keyChild;
1491
- if (this.hasProperties(itemChild)) {
1492
- this.proccessProperties(itemChild, formProperties, keyChild);
1493
- arFieldsChild.push(itemChild);
1494
- }
1495
- else {
1496
- this.addItemToFormProperties(formProperties, itemChild, keyChild);
1497
- arFieldsChild.push(itemChild);
1498
- }
1499
- }
1500
- item.properties = arFieldsChild;
1501
- }
1502
- else {
1503
- this.addItemToFormProperties(formProperties, item, key);
1504
- }
1505
- }
1506
- hasProperties(item) {
1507
- return item.type === 'object' || (item.type === 'array' && item.properties);
1508
- }
1509
- }
1510
- TypeScriptCompileBase.ɵfac = function TypeScriptCompileBase_Factory(t) { return new (t || TypeScriptCompileBase)(); };
1511
- TypeScriptCompileBase.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: TypeScriptCompileBase, factory: TypeScriptCompileBase.ɵfac, providedIn: 'root' });
1512
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TypeScriptCompileBase, [{
1513
- type: Injectable,
1514
- args: [{ providedIn: 'root' }]
1515
- }], null, null); })();
1516
- function APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY(parentIntl) {
1517
- return parentIntl || new TypeScriptCompileBase();
1518
- }
1519
- const APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER = {
1520
- provide: TypeScriptCompileBase,
1521
- deps: [[new Optional(), new SkipSelf(), TypeScriptCompileBase]],
1522
- useFactory: APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY
1422
+ class TypeScriptCompileBase {
1423
+ getTranslate(text) {
1424
+ return text;
1425
+ }
1426
+ addItemToFormProperties(formProperties, item, key) {
1427
+ this.translateProperties(item);
1428
+ if (item.minLength && item.minLength > 0) {
1429
+ formProperties[key] = new FormControl([null, [Validators.required]]);
1430
+ }
1431
+ else {
1432
+ formProperties[key] = new FormControl([null]);
1433
+ }
1434
+ }
1435
+ compileProperties(input) {
1436
+ const compiledProperties = [];
1437
+ const formProperties = {};
1438
+ let inputData = {};
1439
+ const inputToCompile = JSON.parse(JSON.stringify(input));
1440
+ this.translateProperties(inputToCompile);
1441
+ if (inputToCompile.properties) {
1442
+ if (inputToCompile.type === 'array') {
1443
+ inputData = [];
1444
+ }
1445
+ if (inputToCompile.type === 'object') {
1446
+ inputData = {};
1447
+ }
1448
+ inputToCompile.id = 'inputData';
1449
+ this.proccessProperties(inputToCompile, formProperties, 'inputData');
1450
+ this.translateProperties(inputToCompile);
1451
+ compiledProperties.push(inputToCompile);
1452
+ }
1453
+ else if (inputToCompile.type === 'array') {
1454
+ inputToCompile.id = 'inputData';
1455
+ inputData = [];
1456
+ this.addItemToFormProperties(formProperties, inputToCompile, 'inputData');
1457
+ compiledProperties.push(inputToCompile);
1458
+ }
1459
+ else if (!inputToCompile.type) {
1460
+ for (let index = 0; index < Object.keys(inputToCompile).length; index++) {
1461
+ const key = Object.keys(inputToCompile)[index];
1462
+ const item = inputToCompile[key];
1463
+ item.id = key;
1464
+ if (item.type === 'array') {
1465
+ inputData[item.id] = [];
1466
+ }
1467
+ if (item.type === 'object') {
1468
+ inputData[item.id] = {};
1469
+ }
1470
+ this.proccessProperties(item, formProperties, key);
1471
+ this.translateProperties(item);
1472
+ compiledProperties.push(item);
1473
+ }
1474
+ }
1475
+ compiledProperties.sort((a, b) => a.propertyOrder - b.propertyOrder);
1476
+ return { compiledProperties, formProperties, inputData };
1477
+ }
1478
+ translateProperties(input) {
1479
+ if (input?.title) {
1480
+ input.title = this.getTranslate(input.title);
1481
+ }
1482
+ if (input?.description) {
1483
+ input.description = this.getTranslate(input.description);
1484
+ }
1485
+ if (input?.options instanceof Array) {
1486
+ input?.options.forEach((option) => {
1487
+ option.value = this.getTranslate(option.value);
1488
+ });
1489
+ }
1490
+ }
1491
+ proccessProperties(item, formProperties, key) {
1492
+ this.translateProperties(item);
1493
+ if (this.hasProperties(item)) {
1494
+ const arFieldsChild = [];
1495
+ for (let indexChild = 0; indexChild < Object.keys(item.properties).length; indexChild++) {
1496
+ const keyChild = Object.keys(item.properties)[indexChild];
1497
+ const itemChild = item.properties[keyChild];
1498
+ itemChild.id = keyChild;
1499
+ if (this.hasProperties(itemChild)) {
1500
+ this.proccessProperties(itemChild, formProperties, keyChild);
1501
+ arFieldsChild.push(itemChild);
1502
+ }
1503
+ else {
1504
+ this.addItemToFormProperties(formProperties, itemChild, keyChild);
1505
+ arFieldsChild.push(itemChild);
1506
+ }
1507
+ }
1508
+ item.properties = arFieldsChild;
1509
+ }
1510
+ else {
1511
+ this.addItemToFormProperties(formProperties, item, key);
1512
+ }
1513
+ }
1514
+ hasProperties(item) {
1515
+ return item.type === 'object' || (item.type === 'array' && item.properties);
1516
+ }
1517
+ static ɵfac = function TypeScriptCompileBase_Factory(t) { return new (t || TypeScriptCompileBase)(); };
1518
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: TypeScriptCompileBase, factory: TypeScriptCompileBase.ɵfac, providedIn: 'root' });
1519
+ }
1520
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TypeScriptCompileBase, [{
1521
+ type: Injectable,
1522
+ args: [{ providedIn: 'root' }]
1523
+ }], null, null); })();
1524
+ function APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY(parentIntl) {
1525
+ return parentIntl || new TypeScriptCompileBase();
1526
+ }
1527
+ const APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER = {
1528
+ provide: TypeScriptCompileBase,
1529
+ deps: [[new Optional(), new SkipSelf(), TypeScriptCompileBase]],
1530
+ useFactory: APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY
1523
1531
  };
1524
1532
 
1525
- class SchemaFormRenderModule {
1526
- }
1527
- SchemaFormRenderModule.ɵfac = function SchemaFormRenderModule_Factory(t) { return new (t || SchemaFormRenderModule)(); };
1528
- SchemaFormRenderModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: SchemaFormRenderModule });
1529
- SchemaFormRenderModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
1530
- SchemaFieldsService,
1531
- APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER
1532
- ], imports: [CommonModule,
1533
- DndModule,
1534
- FormsModule,
1535
- MatTooltipModule,
1536
- InputsModule,
1537
- IconsModule] });
1538
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaFormRenderModule, [{
1539
- type: NgModule,
1540
- args: [{
1541
- imports: [
1542
- CommonModule,
1543
- DndModule,
1544
- FormsModule,
1545
- MatTooltipModule,
1546
- InputsModule,
1547
- IconsModule
1548
- ],
1549
- declarations: [
1550
- ArraySessionComponent,
1551
- SchemaArrayComponent,
1552
- FieldRenderComponent,
1553
- InputRenderComponent,
1554
- BooleanInputComponent,
1555
- NumberInputComponent,
1556
- SchemaInputComponent,
1557
- SchemaObjectComponent,
1558
- SchemaFormRenderComponent,
1559
- SchemaFormComponent,
1560
- SchemaCustomAttributesComponent
1561
- ],
1562
- exports: [
1563
- ArraySessionComponent,
1564
- SchemaArrayComponent,
1565
- FieldRenderComponent,
1566
- InputRenderComponent,
1567
- BooleanInputComponent,
1568
- NumberInputComponent,
1569
- SchemaInputComponent,
1570
- SchemaObjectComponent,
1571
- SchemaFormRenderComponent,
1572
- SchemaFormComponent,
1573
- SchemaCustomAttributesComponent
1574
- ],
1575
- providers: [
1576
- SchemaFieldsService,
1577
- APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER
1578
- ]
1579
- }]
1580
- }], null, null); })();
1581
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(SchemaFormRenderModule, { declarations: [ArraySessionComponent,
1582
- SchemaArrayComponent,
1583
- FieldRenderComponent,
1584
- InputRenderComponent,
1585
- BooleanInputComponent,
1586
- NumberInputComponent,
1587
- SchemaInputComponent,
1588
- SchemaObjectComponent,
1589
- SchemaFormRenderComponent,
1590
- SchemaFormComponent,
1591
- SchemaCustomAttributesComponent], imports: [CommonModule,
1592
- DndModule,
1593
- FormsModule,
1594
- MatTooltipModule,
1595
- InputsModule,
1596
- IconsModule], exports: [ArraySessionComponent,
1597
- SchemaArrayComponent,
1598
- FieldRenderComponent,
1599
- InputRenderComponent,
1600
- BooleanInputComponent,
1601
- NumberInputComponent,
1602
- SchemaInputComponent,
1603
- SchemaObjectComponent,
1604
- SchemaFormRenderComponent,
1605
- SchemaFormComponent,
1606
- SchemaCustomAttributesComponent] }); })();
1607
- i0.ɵɵsetComponentScope(SchemaFormComponent, [i1.NgForOf, SchemaArrayComponent,
1608
- SchemaInputComponent,
1533
+ class SchemaFormRenderModule {
1534
+ static ɵfac = function SchemaFormRenderModule_Factory(t) { return new (t || SchemaFormRenderModule)(); };
1535
+ static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: SchemaFormRenderModule });
1536
+ static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
1537
+ SchemaFieldsService,
1538
+ APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER
1539
+ ], imports: [CommonModule,
1540
+ DndModule,
1541
+ FormsModule,
1542
+ MatTooltipModule,
1543
+ InputsModule,
1544
+ IconsModule] });
1545
+ }
1546
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SchemaFormRenderModule, [{
1547
+ type: NgModule,
1548
+ args: [{
1549
+ imports: [
1550
+ CommonModule,
1551
+ DndModule,
1552
+ FormsModule,
1553
+ MatTooltipModule,
1554
+ InputsModule,
1555
+ IconsModule
1556
+ ],
1557
+ declarations: [
1558
+ ArraySessionComponent,
1559
+ SchemaArrayComponent,
1560
+ FieldRenderComponent,
1561
+ InputRenderComponent,
1562
+ BooleanInputComponent,
1563
+ NumberInputComponent,
1564
+ SchemaInputComponent,
1565
+ SchemaObjectComponent,
1566
+ SchemaFormRenderComponent,
1567
+ SchemaFormComponent,
1568
+ SchemaCustomAttributesComponent
1569
+ ],
1570
+ exports: [
1571
+ ArraySessionComponent,
1572
+ SchemaArrayComponent,
1573
+ FieldRenderComponent,
1574
+ InputRenderComponent,
1575
+ BooleanInputComponent,
1576
+ NumberInputComponent,
1577
+ SchemaInputComponent,
1578
+ SchemaObjectComponent,
1579
+ SchemaFormRenderComponent,
1580
+ SchemaFormComponent,
1581
+ SchemaCustomAttributesComponent
1582
+ ],
1583
+ providers: [
1584
+ SchemaFieldsService,
1585
+ APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER
1586
+ ]
1587
+ }]
1588
+ }], null, null); })();
1589
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(SchemaFormRenderModule, { declarations: [ArraySessionComponent,
1590
+ SchemaArrayComponent,
1591
+ FieldRenderComponent,
1592
+ InputRenderComponent,
1593
+ BooleanInputComponent,
1594
+ NumberInputComponent,
1595
+ SchemaInputComponent,
1596
+ SchemaObjectComponent,
1597
+ SchemaFormRenderComponent,
1598
+ SchemaFormComponent,
1599
+ SchemaCustomAttributesComponent], imports: [CommonModule,
1600
+ DndModule,
1601
+ FormsModule,
1602
+ MatTooltipModule,
1603
+ InputsModule,
1604
+ IconsModule], exports: [ArraySessionComponent,
1605
+ SchemaArrayComponent,
1606
+ FieldRenderComponent,
1607
+ InputRenderComponent,
1608
+ BooleanInputComponent,
1609
+ NumberInputComponent,
1610
+ SchemaInputComponent,
1611
+ SchemaObjectComponent,
1612
+ SchemaFormRenderComponent,
1613
+ SchemaFormComponent,
1614
+ SchemaCustomAttributesComponent] }); })();
1615
+ i0.ɵɵsetComponentScope(SchemaFormComponent, [i1.NgForOf, SchemaArrayComponent,
1616
+ SchemaInputComponent,
1609
1617
  SchemaObjectComponent], []);
1610
1618
 
1611
- /**
1612
- * Generated bundle index. Do not edit.
1619
+ /**
1620
+ * Generated bundle index. Do not edit.
1613
1621
  */
1614
1622
 
1615
1623
  export { APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY, APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER, ArraySessionComponent, BaseSchemaComponent, BooleanInputComponent, FieldRenderComponent, InputRenderComponent, NumberInputComponent, SchemaArrayComponent, SchemaCustomAttributesComponent, SchemaFieldsService, SchemaFormComponent, SchemaFormRenderComponent, SchemaFormRenderModule, SchemaInputComponent, SchemaObjectComponent, SchemaValidationField, TypeScriptCompileBase };