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