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