@apipass/schemas 0.2.16 → 1.0.7

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 (75) hide show
  1. package/README.md +33 -33
  2. package/base-schema.component.d.ts +12 -12
  3. package/{esm2015/apipass-schemas.js → esm2020/apipass-schemas.mjs} +4 -4
  4. package/esm2020/base-schema.component.mjs +37 -0
  5. package/esm2020/public-api.mjs +17 -0
  6. package/esm2020/schema-custom-attributes/schema-custom-attributes.mjs +169 -0
  7. package/esm2020/schema-fields.service.mjs +80 -0
  8. package/esm2020/schema-form/schema-array/array-session/array-session.mjs +143 -0
  9. package/esm2020/schema-form/schema-array/schema-array.mjs +220 -0
  10. package/esm2020/schema-form/schema-form.mjs +107 -0
  11. package/esm2020/schema-form/schema-input/field-render/field-render.mjs +69 -0
  12. package/esm2020/schema-form/schema-input/input-render/boolean-input/boolean-input.component.mjs +46 -0
  13. package/esm2020/schema-form/schema-input/input-render/input-render.mjs +192 -0
  14. package/esm2020/schema-form/schema-input/input-render/number-input/number-input.component.mjs +44 -0
  15. package/esm2020/schema-form/schema-input/schema-input.mjs +96 -0
  16. package/esm2020/schema-form/schema-object/schema-object.mjs +123 -0
  17. package/esm2020/schema-form-render.mjs +126 -0
  18. package/esm2020/schema-form-render.module.mjs +108 -0
  19. package/esm2020/schema-validation-field.mjs +14 -0
  20. package/esm2020/struct.utils.mjs +9 -0
  21. package/esm2020/type-script-compile/type-script-compile.base.mjs +114 -0
  22. package/fesm2015/apipass-schemas.mjs +1801 -0
  23. package/fesm2015/apipass-schemas.mjs.map +1 -0
  24. package/fesm2020/apipass-schemas.mjs +1616 -0
  25. package/fesm2020/apipass-schemas.mjs.map +1 -0
  26. package/{apipass-schemas.d.ts → index.d.ts} +5 -5
  27. package/package.json +32 -19
  28. package/public-api.d.ts +16 -16
  29. package/schema-custom-attributes/schema-custom-attributes.d.ts +21 -21
  30. package/schema-fields.service.d.ts +14 -15
  31. package/schema-form/schema-array/array-session/array-session.d.ts +19 -19
  32. package/schema-form/schema-array/schema-array.d.ts +32 -32
  33. package/schema-form/schema-form.d.ts +31 -31
  34. package/schema-form/schema-input/field-render/field-render.d.ts +16 -16
  35. package/schema-form/schema-input/input-render/boolean-input/boolean-input.component.d.ts +15 -15
  36. package/schema-form/schema-input/input-render/input-render.d.ts +29 -29
  37. package/schema-form/schema-input/input-render/number-input/number-input.component.d.ts +15 -15
  38. package/schema-form/schema-input/schema-input.d.ts +19 -19
  39. package/schema-form/schema-object/schema-object.d.ts +34 -34
  40. package/schema-form-render.d.ts +31 -31
  41. package/schema-form-render.module.d.ts +23 -22
  42. package/schema-validation-field.d.ts +23 -23
  43. package/struct.utils.d.ts +1 -1
  44. package/type-script-compile/type-script-compile.base.d.ts +17 -17
  45. package/assets/css/buttons.scss +0 -118
  46. package/assets/css/colors.scss +0 -34
  47. package/assets/css/fonts.scss +0 -24
  48. package/assets/css/inputs.scss +0 -197
  49. package/assets/css/pt_sans.scss +0 -144
  50. package/assets/css/spacing.scss +0 -28
  51. package/assets/css/texts.scss +0 -18
  52. package/bundles/apipass-schemas.umd.js +0 -2339
  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/public-api.js +0 -17
  58. package/esm2015/schema-custom-attributes/schema-custom-attributes.js +0 -192
  59. package/esm2015/schema-fields.service.js +0 -87
  60. package/esm2015/schema-form/schema-array/array-session/array-session.js +0 -161
  61. package/esm2015/schema-form/schema-array/schema-array.js +0 -234
  62. package/esm2015/schema-form/schema-form.js +0 -114
  63. package/esm2015/schema-form/schema-input/field-render/field-render.js +0 -74
  64. package/esm2015/schema-form/schema-input/input-render/boolean-input/boolean-input.component.js +0 -50
  65. package/esm2015/schema-form/schema-input/input-render/input-render.js +0 -199
  66. package/esm2015/schema-form/schema-input/input-render/number-input/number-input.component.js +0 -48
  67. package/esm2015/schema-form/schema-input/schema-input.js +0 -111
  68. package/esm2015/schema-form/schema-object/schema-object.js +0 -134
  69. package/esm2015/schema-form-render.js +0 -136
  70. package/esm2015/schema-form-render.module.js +0 -124
  71. package/esm2015/schema-validation-field.js +0 -15
  72. package/esm2015/struct.utils.js +0 -9
  73. package/esm2015/type-script-compile/type-script-compile.base.js +0 -112
  74. package/fesm2015/apipass-schemas.js +0 -1745
  75. package/fesm2015/apipass-schemas.js.map +0 -1
@@ -1,1745 +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_icon_1_Template(rf, ctx) { if (rf & 1) {
890
- const _r8 = ɵɵgetCurrentView();
891
- ɵɵelementStart(0, "icon", 8);
892
- ɵɵlistener("onClick", function InputRenderComponent_div_1_icon_1_Template_icon_onClick_0_listener() { ɵɵrestoreView(_r8); const ctx_r7 = ɵɵnextContext(2); return ctx_r7.editPassword(); });
893
- ɵɵelementEnd();
894
- } if (rf & 2) {
895
- ɵɵproperty("name", "fas fa-pencil-alt");
896
- } }
897
- function InputRenderComponent_div_1_icon_2_Template(rf, ctx) { if (rf & 1) {
898
- const _r10 = ɵɵgetCurrentView();
899
- ɵɵelementStart(0, "icon", 9);
900
- ɵɵlistener("mousedown", function InputRenderComponent_div_1_icon_2_Template_icon_mousedown_0_listener($event) { ɵɵrestoreView(_r10); const ctx_r9 = ɵɵnextContext(2); ctx_r9.cancelEditPassword(); return $event.stopPropagation(); });
901
- ɵɵelementEnd();
902
- } if (rf & 2) {
903
- ɵɵproperty("name", "fas fa-ban");
904
- } }
905
- function InputRenderComponent_div_1_Template(rf, ctx) { if (rf & 1) {
906
- ɵɵelementStart(0, "div", 5);
907
- ɵɵtemplate(1, InputRenderComponent_div_1_icon_1_Template, 1, 1, "icon", 6);
908
- ɵɵtemplate(2, InputRenderComponent_div_1_icon_2_Template, 1, 1, "icon", 7);
909
- ɵɵelementEnd();
910
- } if (rf & 2) {
911
- const ctx_r0 = ɵɵnextContext();
912
- ɵɵadvance(1);
913
- ɵɵproperty("ngIf", ctx_r0.schema.readOnlyPassword);
914
- ɵɵadvance(1);
915
- ɵɵproperty("ngIf", !ctx_r0.schema.readOnlyPassword);
916
- } }
917
- const _c0$6 = function () { return { standalone: true }; };
918
- function InputRenderComponent_input_2_Template(rf, ctx) { if (rf & 1) {
919
- const _r12 = ɵɵgetCurrentView();
920
- ɵɵelementStart(0, "input", 10);
921
- ɵɵlistener("blur", function InputRenderComponent_input_2_Template_input_blur_0_listener() { ɵɵrestoreView(_r12); const ctx_r11 = ɵɵnextContext(); return ctx_r11.onInputBlur(); })("ngModelChange", function InputRenderComponent_input_2_Template_input_ngModelChange_0_listener($event) { ɵɵrestoreView(_r12); const ctx_r13 = ɵɵnextContext(); return ctx_r13.value = $event; })("ngModelChange", function InputRenderComponent_input_2_Template_input_ngModelChange_0_listener($event) { ɵɵrestoreView(_r12); const ctx_r14 = ɵɵnextContext(); return ctx_r14.onChange($event); })("dndDrop", function InputRenderComponent_input_2_Template_input_dndDrop_0_listener($event) { ɵɵrestoreView(_r12); const ctx_r15 = ɵɵnextContext(); return ctx_r15.onDropCallBack($event, ctx_r15.value); });
922
- ɵɵelementEnd();
923
- } if (rf & 2) {
924
- const ctx_r1 = ɵɵnextContext();
925
- ɵɵpropertyInterpolate("placeholder", ctx_r1.schema.type === "password" && ctx_r1.schema.readOnlyPassword ? "*****" : ctx_r1.schema.description);
926
- ɵɵ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);
927
- } }
928
- function InputRenderComponent_select_box_3_Template(rf, ctx) { if (rf & 1) {
929
- const _r17 = ɵɵgetCurrentView();
930
- ɵɵelementStart(0, "select-box", 11);
931
- ɵɵlistener("ngModelChange", function InputRenderComponent_select_box_3_Template_select_box_ngModelChange_0_listener($event) { ɵɵrestoreView(_r17); const ctx_r16 = ɵɵnextContext(); return ctx_r16.value = $event; })("ngModelChange", function InputRenderComponent_select_box_3_Template_select_box_ngModelChange_0_listener($event) { ɵɵrestoreView(_r17); const ctx_r18 = ɵɵnextContext(); return ctx_r18.onChange($event.key); });
932
- ɵɵelementEnd();
933
- } if (rf & 2) {
934
- const ctx_r2 = ɵɵnextContext();
935
- ɵɵ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);
936
- } }
937
- function InputRenderComponent_number_input_4_Template(rf, ctx) { if (rf & 1) {
938
- const _r20 = ɵɵgetCurrentView();
939
- ɵɵelementStart(0, "number-input", 12);
940
- ɵɵlistener("modelChange", function InputRenderComponent_number_input_4_Template_number_input_modelChange_0_listener($event) { ɵɵrestoreView(_r20); const ctx_r19 = ɵɵnextContext(); return ctx_r19.value = $event; })("modelChange", function InputRenderComponent_number_input_4_Template_number_input_modelChange_0_listener($event) { ɵɵrestoreView(_r20); const ctx_r21 = ɵɵnextContext(); return ctx_r21.onChange($event); });
941
- ɵɵelementEnd();
942
- } if (rf & 2) {
943
- const ctx_r3 = ɵɵnextContext();
944
- ɵɵproperty("model", ctx_r3.value)("inputId", ctx_r3.inputId)("placeholder", ctx_r3.schema.description)("maxLength", ctx_r3.schema.maxLength);
945
- } }
946
- function InputRenderComponent_boolean_input_5_Template(rf, ctx) { if (rf & 1) {
947
- const _r23 = ɵɵgetCurrentView();
948
- ɵɵelementStart(0, "boolean-input", 12);
949
- ɵɵlistener("modelChange", function InputRenderComponent_boolean_input_5_Template_boolean_input_modelChange_0_listener($event) { ɵɵrestoreView(_r23); const ctx_r22 = ɵɵnextContext(); return ctx_r22.value = $event; })("modelChange", function InputRenderComponent_boolean_input_5_Template_boolean_input_modelChange_0_listener($event) { ɵɵrestoreView(_r23); const ctx_r24 = ɵɵnextContext(); return ctx_r24.onChange($event); });
950
- ɵɵelementEnd();
951
- } if (rf & 2) {
952
- const ctx_r4 = ɵɵnextContext();
953
- ɵɵproperty("model", ctx_r4.value)("inputId", ctx_r4.inputId)("placeholder", ctx_r4.schema.description)("maxLength", ctx_r4.schema.maxLength);
954
- } }
955
- const _c1$2 = function (a0) { return { "schema-input-container-password": a0 }; };
956
- class InputRenderComponent extends BaseSchemaComponent {
957
- constructor() {
958
- super(...arguments);
959
- this.selectPlaceHolderLabel = 'Select Item';
960
- this.selectSearchPlaceHolderLabel = 'Search';
961
- this.selectClearLabel = 'Clear';
962
- this.selectNotFoundLabel = 'No Items Found';
963
- this.schema = {};
964
- this.editing = false;
965
- this.onDropEvent = new EventEmitter();
966
- }
967
- ngAfterContentInit() {
968
- var _a, _b, _c;
969
- 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') {
970
- if (!this.editing && this.schema.options) {
971
- const $event = this.schema.options.filter((item) => item.selected === true);
972
- if ($event[0]) {
973
- this.onChange($event[0].key);
974
- this.value = $event[0];
975
- }
976
- }
977
- else if (this.editing && this.schema.options && this.model) {
978
- const $event = this.schema.options.filter((item) => item.key === this.model);
979
- if ($event[0]) {
980
- this.onChange($event[0].key);
981
- this.value = $event[0];
982
- }
983
- }
984
- else {
985
- this.value = this.model;
986
- }
987
- }
988
- if (this.editing && ((_c = this.schema) === null || _c === void 0 ? void 0 : _c.type) === 'password') {
989
- this.schema.readOnlyPassword = true;
990
- }
991
- }
992
- onDropCallBack($event, value) {
993
- this.value = value = super.onDrop($event, value);
994
- this.onChange(value);
995
- }
996
- onChange($event) {
997
- if (this.schema.type !== 'password' || !this.editing) {
998
- this.model = $event;
999
- this.modelChange.emit(this.model);
1000
- }
1001
- }
1002
- onInputBlur() {
1003
- var _a;
1004
- if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) === 'password') {
1005
- this.savePassword();
1006
- }
1007
- }
1008
- savePassword() {
1009
- this.model = this.value || '';
1010
- this.modelChange.emit(this.model);
1011
- this.setReadOnlyPassword(true);
1012
- }
1013
- cancelEditPassword() {
1014
- setTimeout(() => {
1015
- this.value = undefined;
1016
- this.model = undefined;
1017
- this.modelChange.emit(this.model);
1018
- this.setReadOnlyPassword(true);
1019
- }, 100);
1020
- }
1021
- editPassword() {
1022
- this.setReadOnlyPassword(false);
1023
- }
1024
- setReadOnlyPassword(value) {
1025
- this.schema.readOnlyPassword = value;
1026
- }
1027
- }
1028
- InputRenderComponent.ɵfac = function InputRenderComponent_Factory(t) { return ɵInputRenderComponent_BaseFactory(t || InputRenderComponent); };
1029
- 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", 4, "ngIf"], ["size", "15", "type", "primary clickable", 3, "name", "mousedown", 4, "ngIf"], ["size", "15", "type", "primary", 3, "name", "onClick"], ["size", "15", "type", "primary clickable", 3, "name", "mousedown"], ["dndDropzone", "", 1, "form-control", 3, "disabled", "type", "placeholder", "ngModel", "ngModelOptions", "id", "maxlength", "blur", "ngModelChange", "dndDrop"], [3, "id", "ngModel", "ngModelOptions", "placeholder", "searchPlaceHolder", "clearText", "notFoundText", "bindKey", "bindValue", "enabledSearch", "limitItens", "data", "ngModelChange"], [3, "model", "inputId", "placeholder", "maxLength", "modelChange"]], template: function InputRenderComponent_Template(rf, ctx) { if (rf & 1) {
1030
- ɵɵelementStart(0, "div", 0);
1031
- ɵɵtemplate(1, InputRenderComponent_div_1_Template, 3, 2, "div", 1);
1032
- ɵɵtemplate(2, InputRenderComponent_input_2_Template, 1, 8, "input", 2);
1033
- ɵɵtemplate(3, InputRenderComponent_select_box_3_Template, 1, 13, "select-box", 3);
1034
- ɵɵtemplate(4, InputRenderComponent_number_input_4_Template, 1, 4, "number-input", 4);
1035
- ɵɵtemplate(5, InputRenderComponent_boolean_input_5_Template, 1, 4, "boolean-input", 4);
1036
- ɵɵelementEnd();
1037
- } if (rf & 2) {
1038
- ɵɵproperty("ngClass", ɵɵpureFunction1(6, _c1$2, ctx.schema.type === "password"));
1039
- ɵɵadvance(1);
1040
- ɵɵproperty("ngIf", ctx.schema.type === "password" && ctx.editing);
1041
- ɵɵadvance(1);
1042
- ɵɵproperty("ngIf", (ctx.schema.type === "string" || ctx.schema.type === "password") && !ctx.schema.options);
1043
- ɵɵadvance(1);
1044
- ɵɵproperty("ngIf", ctx.schema.type === "string" && ctx.schema.options);
1045
- ɵɵadvance(1);
1046
- ɵɵproperty("ngIf", ctx.schema.type === "number");
1047
- ɵɵadvance(1);
1048
- ɵɵproperty("ngIf", ctx.schema.type === "boolean");
1049
- } }, 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}"] });
1050
- const ɵInputRenderComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(InputRenderComponent);
1051
- /*@__PURE__*/ (function () { ɵsetClassMetadata(InputRenderComponent, [{
1052
- type: Component,
1053
- args: [{
1054
- selector: 'input-render',
1055
- templateUrl: 'input-render.html',
1056
- styleUrls: ['./input-render.scss']
1057
- }]
1058
- }], null, { selectPlaceHolderLabel: [{
1059
- type: Input
1060
- }], selectSearchPlaceHolderLabel: [{
1061
- type: Input
1062
- }], selectClearLabel: [{
1063
- type: Input
1064
- }], selectNotFoundLabel: [{
1065
- type: Input
1066
- }], schema: [{
1067
- type: Input
1068
- }], modelPropertiesPath: [{
1069
- type: Input
1070
- }], inputId: [{
1071
- type: Input
1072
- }], editing: [{
1073
- type: Input
1074
- }], onDropEvent: [{
1075
- type: Output
1076
- }] }); })();
1077
-
1078
- function SchemaInputComponent_div_0_Template(rf, ctx) { if (rf & 1) {
1079
- const _r3 = ɵɵgetCurrentView();
1080
- ɵɵelementStart(0, "div", 1);
1081
- ɵɵelementStart(1, "div", 2);
1082
- ɵɵelementStart(2, "field-render", 3);
1083
- ɵɵelementStart(3, "input-render", 4);
1084
- ɵɵ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); });
1085
- ɵɵelementEnd();
1086
- ɵɵelementEnd();
1087
- ɵɵelementEnd();
1088
- ɵɵelementEnd();
1089
- } if (rf & 2) {
1090
- const ctx_r0 = ɵɵnextContext();
1091
- ɵɵadvance(2);
1092
- ɵɵproperty("requiredLabel", ctx_r0.requiredLabel)("label", ctx_r0.schema.title)("tooltip", ctx_r0.schema.help)("inputId", ctx_r0.getId(ctx_r0.index));
1093
- ɵɵadvance(1);
1094
- ɵɵ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);
1095
- } }
1096
- function SchemaInputComponent_div_1_span_4_Template(rf, ctx) { if (rf & 1) {
1097
- ɵɵelementStart(0, "span", 7);
1098
- ɵɵtext(1, "?");
1099
- ɵɵelementEnd();
1100
- } if (rf & 2) {
1101
- const ctx_r4 = ɵɵnextContext(2);
1102
- ɵɵpropertyInterpolate("matTooltip", ctx_r4.schema.help);
1103
- } }
1104
- function SchemaInputComponent_div_1_Template(rf, ctx) { if (rf & 1) {
1105
- const _r6 = ɵɵgetCurrentView();
1106
- ɵɵelementStart(0, "div", 1);
1107
- ɵɵelementStart(1, "div", 2);
1108
- ɵɵelementStart(2, "label", 5);
1109
- ɵɵtext(3);
1110
- ɵɵtemplate(4, SchemaInputComponent_div_1_span_4_Template, 2, 1, "span", 6);
1111
- ɵɵelementEnd();
1112
- ɵɵelementStart(5, "input-render", 4);
1113
- ɵɵ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); });
1114
- ɵɵelementEnd();
1115
- ɵɵelementEnd();
1116
- ɵɵelementEnd();
1117
- } if (rf & 2) {
1118
- const ctx_r1 = ɵɵnextContext();
1119
- ɵɵadvance(2);
1120
- ɵɵproperty("htmlFor", ctx_r1.getId(ctx_r1.index));
1121
- ɵɵadvance(1);
1122
- ɵɵtextInterpolate1(" ", ctx_r1.schema.title, " ");
1123
- ɵɵadvance(1);
1124
- ɵɵproperty("ngIf", ctx_r1.schema.help);
1125
- ɵɵadvance(1);
1126
- ɵɵ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);
1127
- } }
1128
- class SchemaInputComponent extends BaseSchemaComponent {
1129
- constructor() {
1130
- super(...arguments);
1131
- this.requiredLabel = '(required)';
1132
- this.selectPlaceHolderLabel = 'Select Item';
1133
- this.selectSearchPlaceHolderLabel = 'Search';
1134
- this.selectClearLabel = 'Clear';
1135
- this.selectNotFoundLabel = 'No Items Found';
1136
- this.editing = false;
1137
- }
1138
- ngAfterContentInit() {
1139
- this.loaded = true;
1140
- }
1141
- getId(index) {
1142
- return `${this.idPrefix}-struct-${index}`;
1143
- }
1144
- }
1145
- SchemaInputComponent.ɵfac = function SchemaInputComponent_Factory(t) { return ɵSchemaInputComponent_BaseFactory(t || SchemaInputComponent); };
1146
- 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) {
1147
- ɵɵtemplate(0, SchemaInputComponent_div_0_Template, 4, 13, "div", 0);
1148
- ɵɵtemplate(1, SchemaInputComponent_div_1_Template, 6, 12, "div", 0);
1149
- } if (rf & 2) {
1150
- ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && ctx.schema.minLength && ctx.schema.minLength > 0);
1151
- ɵɵadvance(1);
1152
- ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && (!ctx.schema.minLength || ctx.schema.minLength === 0));
1153
- } }, directives: [NgIf, FieldRenderComponent, InputRenderComponent, MatTooltip], styles: [""] });
1154
- const ɵSchemaInputComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaInputComponent);
1155
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaInputComponent, [{
1156
- type: Component,
1157
- args: [{
1158
- selector: 'schema-input',
1159
- templateUrl: 'schema-input.html',
1160
- styleUrls: ['./schema-input.scss']
1161
- }]
1162
- }], null, { requiredLabel: [{
1163
- type: Input
1164
- }], selectPlaceHolderLabel: [{
1165
- type: Input
1166
- }], selectSearchPlaceHolderLabel: [{
1167
- type: Input
1168
- }], selectClearLabel: [{
1169
- type: Input
1170
- }], selectNotFoundLabel: [{
1171
- type: Input
1172
- }], idPrefix: [{
1173
- type: Input
1174
- }], schema: [{
1175
- type: Input
1176
- }], editing: [{
1177
- type: Input
1178
- }], index: [{
1179
- type: Input
1180
- }] }); })();
1181
-
1182
- function SchemaObjectComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
1183
- const _r3 = ɵɵgetCurrentView();
1184
- ɵɵelementStart(0, "div", 5);
1185
- ɵɵelementStart(1, "div", 6);
1186
- ɵɵelementStart(2, "label", 7);
1187
- ɵɵtext(3);
1188
- ɵɵelementEnd();
1189
- ɵɵelementStart(4, "schema-custom-attributes", 8);
1190
- ɵɵ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; });
1191
- ɵɵelementEnd();
1192
- ɵɵelementEnd();
1193
- ɵɵelementEnd();
1194
- } if (rf & 2) {
1195
- const ctx_r1 = ɵɵnextContext(2);
1196
- ɵɵadvance(3);
1197
- ɵɵtextInterpolate(ctx_r1.additionalAttributesLabel);
1198
- ɵɵadvance(1);
1199
- ɵɵ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);
1200
- } }
1201
- function SchemaObjectComponent_div_0_Template(rf, ctx) { if (rf & 1) {
1202
- const _r5 = ɵɵgetCurrentView();
1203
- ɵɵelementStart(0, "div", 1);
1204
- ɵɵelementStart(1, "div", 2);
1205
- ɵɵtext(2);
1206
- ɵɵelementEnd();
1207
- ɵɵelementStart(3, "schema-form", 3);
1208
- ɵɵ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); });
1209
- ɵɵelementEnd();
1210
- ɵɵtemplate(4, SchemaObjectComponent_div_0_div_4_Template, 5, 9, "div", 4);
1211
- ɵɵelementEnd();
1212
- } if (rf & 2) {
1213
- const ctx_r0 = ɵɵnextContext();
1214
- ɵɵadvance(2);
1215
- ɵɵtextInterpolate(ctx_r0.schema.title);
1216
- ɵɵadvance(1);
1217
- ɵɵ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);
1218
- ɵɵadvance(1);
1219
- ɵɵproperty("ngIf", ctx_r0.model[ctx_r0.schema.id] && ctx_r0.schema.customProperties);
1220
- } }
1221
- class SchemaObjectComponent extends BaseSchemaComponent {
1222
- constructor() {
1223
- super(...arguments);
1224
- this.requiredLabel = '(required)';
1225
- this.addItemLabel = 'Add Item';
1226
- this.addLoopLabel = 'Add Loop';
1227
- this.additionalAttributesLabel = 'Additional Fields';
1228
- this.customAttributeRemoveLabel = 'Remove';
1229
- this.newCustomFieldNameLabel = 'Name';
1230
- this.newCustomFieldValueLabel = 'Value';
1231
- this.newCustomFieldAddLabel = 'Add';
1232
- this.newCustomFieldSaveLabel = 'Save';
1233
- this.newCustomFieldCancelLabel = 'Cancel';
1234
- this.selectPlaceHolderLabel = 'Select Item';
1235
- this.selectSearchPlaceHolderLabel = 'Search';
1236
- this.selectClearLabel = 'Clear';
1237
- this.selectNotFoundLabel = 'No Items Found';
1238
- this.editing = false;
1239
- this.onDropEvent = new EventEmitter();
1240
- this.loaded = false;
1241
- }
1242
- ngAfterContentInit() {
1243
- var _a;
1244
- if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) === 'object' && this.model) {
1245
- this.model[this.schema.id] = this.model[this.schema.id] || {};
1246
- }
1247
- this.loaded = true;
1248
- }
1249
- onDrop($event, modelElement) {
1250
- return onDropStruct($event, modelElement);
1251
- }
1252
- }
1253
- SchemaObjectComponent.ɵfac = function SchemaObjectComponent_Factory(t) { return ɵSchemaObjectComponent_BaseFactory(t || SchemaObjectComponent); };
1254
- 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) {
1255
- ɵɵtemplate(0, SchemaObjectComponent_div_0_Template, 5, 20, "div", 0);
1256
- } if (rf & 2) {
1257
- ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type == "object");
1258
- } }, 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)}"] });
1259
- const ɵSchemaObjectComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaObjectComponent);
1260
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaObjectComponent, [{
1261
- type: Component,
1262
- args: [{
1263
- selector: 'schema-object',
1264
- templateUrl: 'schema-object.html',
1265
- styleUrls: ['./schema-object.scss']
1266
- }]
1267
- }], null, { requiredLabel: [{
1268
- type: Input
1269
- }], addItemLabel: [{
1270
- type: Input
1271
- }], addLoopLabel: [{
1272
- type: Input
1273
- }], additionalAttributesLabel: [{
1274
- type: Input
1275
- }], customAttributeRemoveLabel: [{
1276
- type: Input
1277
- }], newCustomFieldNameLabel: [{
1278
- type: Input
1279
- }], newCustomFieldValueLabel: [{
1280
- type: Input
1281
- }], newCustomFieldAddLabel: [{
1282
- type: Input
1283
- }], newCustomFieldSaveLabel: [{
1284
- type: Input
1285
- }], newCustomFieldCancelLabel: [{
1286
- type: Input
1287
- }], selectPlaceHolderLabel: [{
1288
- type: Input
1289
- }], selectSearchPlaceHolderLabel: [{
1290
- type: Input
1291
- }], selectClearLabel: [{
1292
- type: Input
1293
- }], selectNotFoundLabel: [{
1294
- type: Input
1295
- }], idPrefix: [{
1296
- type: Input
1297
- }], modelPropertiesPath: [{
1298
- type: Input
1299
- }], inputId: [{
1300
- type: Input
1301
- }], editing: [{
1302
- type: Input
1303
- }], index: [{
1304
- type: Input
1305
- }], onDropEvent: [{
1306
- type: Output
1307
- }] }); })();
1308
-
1309
- class SchemaValidationField {
1310
- constructor(emptyFields, invalidMinLengthFields, invalidMaxLengthFields) {
1311
- this.emptyFields = emptyFields;
1312
- this.invalidMinLengthFields = invalidMinLengthFields;
1313
- this.invalidMaxLengthFields = invalidMaxLengthFields;
1314
- }
1315
- isValidSchemaFields() {
1316
- var _a, _b, _c;
1317
- 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;
1318
- }
1319
- isInvalidSchemaFields() {
1320
- return !this.isValidSchemaFields();
1321
- }
1322
- }
1323
-
1324
- class SchemaFieldsService {
1325
- constructor() {
1326
- }
1327
- validateSchemaFields(propertiesRendered, model, editing) {
1328
- return __awaiter(this, void 0, void 0, function* () {
1329
- if (!propertiesRendered) {
1330
- return new SchemaValidationField([], [], []);
1331
- }
1332
- const emptyFields = [];
1333
- const invalidMinLengthFields = [];
1334
- const invalidMaxLengthFields = [];
1335
- this.processProperties(propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1336
- const structValidationField = new SchemaValidationField(emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1337
- structValidationField.validationErrorsLabel = yield this.getErrorsStringArray(structValidationField);
1338
- return structValidationField;
1339
- });
1340
- }
1341
- processProperties(propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, recursive) {
1342
- for (const property of propertiesRendered) {
1343
- if ((property.type === 'object' || property.type === 'array') && property.properties) {
1344
- this.processProperties(property.properties, model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1345
- }
1346
- else if (property.type === 'array' && !property.properties) {
1347
- const newProperty = Object.assign({}, property);
1348
- newProperty.type = 'string';
1349
- this.processProperties([newProperty], model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1350
- }
1351
- else {
1352
- const validateModel = recursive ? model : model[property.id];
1353
- if (property.type !== 'password' || !editing || validateModel !== undefined) {
1354
- if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.minLength) > 0
1355
- && (validateModel === undefined || validateModel === '' || validateModel === null)) {
1356
- emptyFields.push(property);
1357
- }
1358
- 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)) {
1359
- invalidMinLengthFields.push(property);
1360
- }
1361
- 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)) {
1362
- invalidMaxLengthFields.push(property);
1363
- }
1364
- }
1365
- }
1366
- }
1367
- }
1368
- getErrorsStringArray(structValidation) {
1369
- return __awaiter(this, void 0, void 0, function* () {
1370
- if (!structValidation.isInvalidSchemaFields()) {
1371
- return [];
1372
- }
1373
- const errors = [];
1374
- for (const field of structValidation.emptyFields) {
1375
- const fieldName = field.title || field.id;
1376
- errors.push({
1377
- type: 'emptyFields',
1378
- fieldName
1379
- });
1380
- }
1381
- for (const field of structValidation.invalidMinLengthFields) {
1382
- const fieldName = field.title || field.id;
1383
- errors.push({
1384
- type: 'invalidMinLengthFields',
1385
- fieldName,
1386
- minLength: field.minLength
1387
- });
1388
- }
1389
- for (const field of structValidation.invalidMaxLengthFields) {
1390
- const fieldName = field.title || field.id;
1391
- errors.push({
1392
- type: 'invalidMaxLengthFields',
1393
- fieldName,
1394
- maxLength: field.maxLength
1395
- });
1396
- }
1397
- return errors;
1398
- });
1399
- }
1400
- }
1401
- SchemaFieldsService.ɵfac = function SchemaFieldsService_Factory(t) { return new (t || SchemaFieldsService)(); };
1402
- SchemaFieldsService.ɵprov = ɵɵdefineInjectable({ token: SchemaFieldsService, factory: SchemaFieldsService.ɵfac });
1403
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaFieldsService, [{
1404
- type: Injectable
1405
- }], function () { return []; }, null); })();
1406
-
1407
- function SchemaFormRenderComponent_div_0_div_2_div_1_Template(rf, ctx) { if (rf & 1) {
1408
- const _r6 = ɵɵgetCurrentView();
1409
- ɵɵelementStart(0, "div", 6);
1410
- ɵɵelementStart(1, "div", 7);
1411
- ɵɵelementStart(2, "label", 8);
1412
- ɵɵtext(3);
1413
- ɵɵelementEnd();
1414
- ɵɵelementStart(4, "schema-custom-attributes", 9);
1415
- ɵɵ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; });
1416
- ɵɵelementEnd();
1417
- ɵɵelementEnd();
1418
- ɵɵelementEnd();
1419
- } if (rf & 2) {
1420
- const ctx_r4 = ɵɵnextContext(3);
1421
- ɵɵadvance(3);
1422
- ɵɵtextInterpolate(ctx_r4.additionalAttributesLabel);
1423
- ɵɵadvance(1);
1424
- ɵɵ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);
1425
- } }
1426
- function SchemaFormRenderComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
1427
- ɵɵelementStart(0, "div", 4);
1428
- ɵɵtemplate(1, SchemaFormRenderComponent_div_0_div_2_div_1_Template, 5, 9, "div", 5);
1429
- ɵɵelementEnd();
1430
- } if (rf & 2) {
1431
- const ctx_r1 = ɵɵnextContext(2);
1432
- ɵɵadvance(1);
1433
- ɵɵproperty("ngIf", ctx_r1.model && ctx_r1.customProperties);
1434
- } }
1435
- function SchemaFormRenderComponent_div_0_Template(rf, ctx) { if (rf & 1) {
1436
- const _r8 = ɵɵgetCurrentView();
1437
- ɵɵelementStart(0, "div", 1);
1438
- ɵɵelementStart(1, "schema-form", 2);
1439
- ɵɵlistener("modelChange", function SchemaFormRenderComponent_div_0_Template_schema_form_modelChange_1_listener($event) { ɵɵrestoreView(_r8); const ctx_r7 = ɵɵnextContext(); return ctx_r7.model = $event; });
1440
- ɵɵelementEnd();
1441
- ɵɵtemplate(2, SchemaFormRenderComponent_div_0_div_2_Template, 2, 1, "div", 3);
1442
- ɵɵelementEnd();
1443
- } if (rf & 2) {
1444
- const ctx_r0 = ɵɵnextContext();
1445
- ɵɵadvance(1);
1446
- ɵɵ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);
1447
- ɵɵadvance(1);
1448
- ɵɵproperty("ngForOf", ctx_r0.schemas);
1449
- } }
1450
- class SchemaFormRenderComponent extends BaseSchemaComponent {
1451
- constructor() {
1452
- super(...arguments);
1453
- this.requiredLabel = '(required)';
1454
- this.addItemLabel = 'Add Item';
1455
- this.addLoopLabel = 'Add Loop';
1456
- this.additionalAttributesLabel = 'Additional Fields';
1457
- this.customAttributeRemoveLabel = 'Remove';
1458
- this.newCustomFieldNameLabel = 'Name';
1459
- this.newCustomFieldValueLabel = 'Value';
1460
- this.newCustomFieldAddLabel = 'Add';
1461
- this.newCustomFieldSaveLabel = 'Save';
1462
- this.newCustomFieldCancelLabel = 'Cancel';
1463
- this.selectPlaceHolderLabel = 'Select Item';
1464
- this.selectSearchPlaceHolderLabel = 'Search';
1465
- this.selectClearLabel = 'Clear';
1466
- this.selectNotFoundLabel = 'No Items Found';
1467
- this.schemas = [];
1468
- this.customProperties = false;
1469
- this.editing = false;
1470
- this.loaded = false;
1471
- }
1472
- ngAfterContentInit() {
1473
- this.loaded = true;
1474
- }
1475
- onDrop($event, modelElement) {
1476
- return onDropStruct($event, modelElement);
1477
- }
1478
- getId(index) {
1479
- return `${this.idPrefix}-struct-${index}`;
1480
- }
1481
- }
1482
- SchemaFormRenderComponent.ɵfac = function SchemaFormRenderComponent_Factory(t) { return ɵSchemaFormRenderComponent_BaseFactory(t || SchemaFormRenderComponent); };
1483
- 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) {
1484
- ɵɵtemplate(0, SchemaFormRenderComponent_div_0_Template, 3, 19, "div", 0);
1485
- } if (rf & 2) {
1486
- ɵɵproperty("ngIf", ctx.loaded);
1487
- } }, 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)}"] });
1488
- const ɵSchemaFormRenderComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(SchemaFormRenderComponent);
1489
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaFormRenderComponent, [{
1490
- type: Component,
1491
- args: [{
1492
- selector: 'schema-form-render',
1493
- templateUrl: 'schema-form-render.html',
1494
- styleUrls: ['./schema-form-render.scss']
1495
- }]
1496
- }], null, { requiredLabel: [{
1497
- type: Input
1498
- }], addItemLabel: [{
1499
- type: Input
1500
- }], addLoopLabel: [{
1501
- type: Input
1502
- }], additionalAttributesLabel: [{
1503
- type: Input
1504
- }], customAttributeRemoveLabel: [{
1505
- type: Input
1506
- }], newCustomFieldNameLabel: [{
1507
- type: Input
1508
- }], newCustomFieldValueLabel: [{
1509
- type: Input
1510
- }], newCustomFieldAddLabel: [{
1511
- type: Input
1512
- }], newCustomFieldSaveLabel: [{
1513
- type: Input
1514
- }], newCustomFieldCancelLabel: [{
1515
- type: Input
1516
- }], selectPlaceHolderLabel: [{
1517
- type: Input
1518
- }], selectSearchPlaceHolderLabel: [{
1519
- type: Input
1520
- }], selectClearLabel: [{
1521
- type: Input
1522
- }], selectNotFoundLabel: [{
1523
- type: Input
1524
- }], idPrefix: [{
1525
- type: Input
1526
- }], schemas: [{
1527
- type: Input
1528
- }], customProperties: [{
1529
- type: Input
1530
- }], editing: [{
1531
- type: Input
1532
- }], inputType: [{
1533
- type: Input
1534
- }] }); })();
1535
-
1536
- class TypeScriptCompileBase {
1537
- getTranslate(text) {
1538
- return text;
1539
- }
1540
- addItemToFormProperties(formProperties, item, key) {
1541
- this.translateProperties(item);
1542
- if (item.minLength && item.minLength > 0) {
1543
- formProperties[key] = new FormControl([null, [Validators.required]]);
1544
- }
1545
- else {
1546
- formProperties[key] = new FormControl([null]);
1547
- }
1548
- }
1549
- compileProperties(input) {
1550
- const compiledProperties = [];
1551
- const formProperties = {};
1552
- let inputData = {};
1553
- const inputToCompile = JSON.parse(JSON.stringify(input));
1554
- this.translateProperties(inputToCompile);
1555
- if (inputToCompile.properties) {
1556
- if (inputToCompile.type === 'array') {
1557
- inputData = [];
1558
- }
1559
- if (inputToCompile.type === 'object') {
1560
- inputData = {};
1561
- }
1562
- inputToCompile.id = 'inputData';
1563
- this.proccessProperties(inputToCompile, formProperties, 'inputData');
1564
- this.translateProperties(inputToCompile);
1565
- compiledProperties.push(inputToCompile);
1566
- }
1567
- else if (inputToCompile.type === 'array') {
1568
- inputToCompile.id = 'inputData';
1569
- inputData = [];
1570
- this.addItemToFormProperties(formProperties, inputToCompile, 'inputData');
1571
- compiledProperties.push(inputToCompile);
1572
- }
1573
- else if (!inputToCompile.type) {
1574
- for (let index = 0; index < Object.keys(inputToCompile).length; index++) {
1575
- const key = Object.keys(inputToCompile)[index];
1576
- const item = inputToCompile[key];
1577
- item.id = key;
1578
- if (item.type === 'array') {
1579
- inputData[item.id] = [];
1580
- }
1581
- if (item.type === 'object') {
1582
- inputData[item.id] = {};
1583
- }
1584
- this.proccessProperties(item, formProperties, key);
1585
- this.translateProperties(item);
1586
- compiledProperties.push(item);
1587
- }
1588
- }
1589
- compiledProperties.sort((a, b) => a.propertyOrder - b.propertyOrder);
1590
- return { compiledProperties, formProperties, inputData };
1591
- }
1592
- translateProperties(input) {
1593
- if (input === null || input === void 0 ? void 0 : input.title) {
1594
- input.title = this.getTranslate(input.title);
1595
- }
1596
- if (input === null || input === void 0 ? void 0 : input.description) {
1597
- input.description = this.getTranslate(input.description);
1598
- }
1599
- if ((input === null || input === void 0 ? void 0 : input.options) instanceof Array) {
1600
- input === null || input === void 0 ? void 0 : input.options.forEach((option) => option.value = this.getTranslate(option.value));
1601
- }
1602
- }
1603
- proccessProperties(item, formProperties, key) {
1604
- this.translateProperties(item);
1605
- if (this.hasProperties(item)) {
1606
- const arFieldsChild = [];
1607
- for (let indexChild = 0; indexChild < Object.keys(item.properties).length; indexChild++) {
1608
- const keyChild = Object.keys(item.properties)[indexChild];
1609
- const itemChild = item.properties[keyChild];
1610
- itemChild.id = keyChild;
1611
- if (this.hasProperties(itemChild)) {
1612
- this.proccessProperties(itemChild, formProperties, keyChild);
1613
- arFieldsChild.push(itemChild);
1614
- }
1615
- else {
1616
- this.addItemToFormProperties(formProperties, itemChild, keyChild);
1617
- arFieldsChild.push(itemChild);
1618
- }
1619
- }
1620
- item.properties = arFieldsChild;
1621
- }
1622
- else {
1623
- this.addItemToFormProperties(formProperties, item, key);
1624
- }
1625
- }
1626
- hasProperties(item) {
1627
- return item.type === 'object' || (item.type === 'array' && item.properties);
1628
- }
1629
- }
1630
- TypeScriptCompileBase.ɵfac = function TypeScriptCompileBase_Factory(t) { return new (t || TypeScriptCompileBase)(); };
1631
- TypeScriptCompileBase.ɵprov = ɵɵdefineInjectable({ token: TypeScriptCompileBase, factory: TypeScriptCompileBase.ɵfac, providedIn: 'root' });
1632
- /*@__PURE__*/ (function () { ɵsetClassMetadata(TypeScriptCompileBase, [{
1633
- type: Injectable,
1634
- args: [{ providedIn: 'root' }]
1635
- }], null, null); })();
1636
- function APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY(parentIntl) {
1637
- return parentIntl || new TypeScriptCompileBase();
1638
- }
1639
- const APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER = {
1640
- provide: TypeScriptCompileBase,
1641
- deps: [[new Optional(), new SkipSelf(), TypeScriptCompileBase]],
1642
- useFactory: APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY,
1643
- };
1644
-
1645
- class SchemaFormRenderModule {
1646
- }
1647
- SchemaFormRenderModule.ɵmod = ɵɵdefineNgModule({ type: SchemaFormRenderModule });
1648
- SchemaFormRenderModule.ɵinj = ɵɵdefineInjector({ factory: function SchemaFormRenderModule_Factory(t) { return new (t || SchemaFormRenderModule)(); }, providers: [
1649
- SchemaFieldsService,
1650
- APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER
1651
- ], imports: [[
1652
- CommonModule,
1653
- DndModule,
1654
- FormsModule,
1655
- MatTooltipModule,
1656
- InputsModule,
1657
- IconsModule
1658
- ]] });
1659
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(SchemaFormRenderModule, { declarations: [ArraySessionComponent,
1660
- SchemaArrayComponent,
1661
- FieldRenderComponent,
1662
- InputRenderComponent,
1663
- BooleanInputComponent,
1664
- NumberInputComponent,
1665
- SchemaInputComponent,
1666
- SchemaObjectComponent,
1667
- SchemaFormRenderComponent,
1668
- SchemaFormComponent,
1669
- SchemaCustomAttributesComponent], imports: [CommonModule,
1670
- DndModule,
1671
- FormsModule,
1672
- MatTooltipModule,
1673
- InputsModule,
1674
- IconsModule], exports: [ArraySessionComponent,
1675
- SchemaArrayComponent,
1676
- FieldRenderComponent,
1677
- InputRenderComponent,
1678
- BooleanInputComponent,
1679
- NumberInputComponent,
1680
- SchemaInputComponent,
1681
- SchemaObjectComponent,
1682
- SchemaFormRenderComponent,
1683
- SchemaFormComponent,
1684
- SchemaCustomAttributesComponent] }); })();
1685
- /*@__PURE__*/ (function () { ɵsetClassMetadata(SchemaFormRenderModule, [{
1686
- type: NgModule,
1687
- args: [{
1688
- imports: [
1689
- CommonModule,
1690
- DndModule,
1691
- FormsModule,
1692
- MatTooltipModule,
1693
- InputsModule,
1694
- IconsModule
1695
- ],
1696
- declarations: [
1697
- ArraySessionComponent,
1698
- SchemaArrayComponent,
1699
- FieldRenderComponent,
1700
- InputRenderComponent,
1701
- BooleanInputComponent,
1702
- NumberInputComponent,
1703
- SchemaInputComponent,
1704
- SchemaObjectComponent,
1705
- SchemaFormRenderComponent,
1706
- SchemaFormComponent,
1707
- SchemaCustomAttributesComponent
1708
- ],
1709
- exports: [
1710
- ArraySessionComponent,
1711
- SchemaArrayComponent,
1712
- FieldRenderComponent,
1713
- InputRenderComponent,
1714
- BooleanInputComponent,
1715
- NumberInputComponent,
1716
- SchemaInputComponent,
1717
- SchemaObjectComponent,
1718
- SchemaFormRenderComponent,
1719
- SchemaFormComponent,
1720
- SchemaCustomAttributesComponent
1721
- ],
1722
- providers: [
1723
- SchemaFieldsService,
1724
- APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER
1725
- ]
1726
- }]
1727
- }], null, null); })();
1728
- ɵɵ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,
1729
- SchemaArrayComponent,
1730
- FieldRenderComponent,
1731
- InputRenderComponent,
1732
- BooleanInputComponent,
1733
- NumberInputComponent,
1734
- SchemaInputComponent,
1735
- SchemaObjectComponent,
1736
- SchemaFormRenderComponent,
1737
- SchemaFormComponent,
1738
- SchemaCustomAttributesComponent], [AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe]);
1739
-
1740
- /**
1741
- * Generated bundle index. Do not edit.
1742
- */
1743
-
1744
- 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 };
1745
- //# sourceMappingURL=apipass-schemas.js.map