@apipass/schemas 0.2.15 → 1.0.0

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