@apipass/schemas 0.2.16 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +33 -33
  2. package/base-schema.component.d.ts +12 -12
  3. package/{esm2015/apipass-schemas.js → esm2020/apipass-schemas.mjs} +4 -4
  4. package/esm2020/base-schema.component.mjs +37 -0
  5. package/esm2020/public-api.mjs +17 -0
  6. package/esm2020/schema-custom-attributes/schema-custom-attributes.mjs +169 -0
  7. package/esm2020/schema-fields.service.mjs +80 -0
  8. package/esm2020/schema-form/schema-array/array-session/array-session.mjs +143 -0
  9. package/esm2020/schema-form/schema-array/schema-array.mjs +220 -0
  10. package/esm2020/schema-form/schema-form.mjs +107 -0
  11. package/esm2020/schema-form/schema-input/field-render/field-render.mjs +69 -0
  12. package/esm2020/schema-form/schema-input/input-render/boolean-input/boolean-input.component.mjs +46 -0
  13. package/esm2020/schema-form/schema-input/input-render/input-render.mjs +192 -0
  14. package/esm2020/schema-form/schema-input/input-render/number-input/number-input.component.mjs +44 -0
  15. package/esm2020/schema-form/schema-input/schema-input.mjs +96 -0
  16. package/esm2020/schema-form/schema-object/schema-object.mjs +123 -0
  17. package/esm2020/schema-form-render.mjs +126 -0
  18. package/esm2020/schema-form-render.module.mjs +108 -0
  19. package/esm2020/schema-validation-field.mjs +14 -0
  20. package/esm2020/struct.utils.mjs +9 -0
  21. package/esm2020/type-script-compile/type-script-compile.base.mjs +114 -0
  22. package/fesm2015/apipass-schemas.mjs +1801 -0
  23. package/fesm2015/apipass-schemas.mjs.map +1 -0
  24. package/fesm2020/apipass-schemas.mjs +1616 -0
  25. package/fesm2020/apipass-schemas.mjs.map +1 -0
  26. package/{apipass-schemas.d.ts → index.d.ts} +5 -5
  27. package/package.json +32 -19
  28. package/public-api.d.ts +16 -16
  29. package/schema-custom-attributes/schema-custom-attributes.d.ts +21 -21
  30. package/schema-fields.service.d.ts +14 -15
  31. package/schema-form/schema-array/array-session/array-session.d.ts +19 -19
  32. package/schema-form/schema-array/schema-array.d.ts +32 -32
  33. package/schema-form/schema-form.d.ts +31 -31
  34. package/schema-form/schema-input/field-render/field-render.d.ts +16 -16
  35. package/schema-form/schema-input/input-render/boolean-input/boolean-input.component.d.ts +15 -15
  36. package/schema-form/schema-input/input-render/input-render.d.ts +29 -29
  37. package/schema-form/schema-input/input-render/number-input/number-input.component.d.ts +15 -15
  38. package/schema-form/schema-input/schema-input.d.ts +19 -19
  39. package/schema-form/schema-object/schema-object.d.ts +34 -34
  40. package/schema-form-render.d.ts +31 -31
  41. package/schema-form-render.module.d.ts +23 -22
  42. package/schema-validation-field.d.ts +23 -23
  43. package/struct.utils.d.ts +1 -1
  44. package/type-script-compile/type-script-compile.base.d.ts +17 -17
  45. package/assets/css/buttons.scss +0 -118
  46. package/assets/css/colors.scss +0 -34
  47. package/assets/css/fonts.scss +0 -24
  48. package/assets/css/inputs.scss +0 -197
  49. package/assets/css/pt_sans.scss +0 -144
  50. package/assets/css/spacing.scss +0 -28
  51. package/assets/css/texts.scss +0 -18
  52. package/bundles/apipass-schemas.umd.js +0 -2339
  53. package/bundles/apipass-schemas.umd.js.map +0 -1
  54. package/bundles/apipass-schemas.umd.min.js +0 -16
  55. package/bundles/apipass-schemas.umd.min.js.map +0 -1
  56. package/esm2015/base-schema.component.js +0 -38
  57. package/esm2015/public-api.js +0 -17
  58. package/esm2015/schema-custom-attributes/schema-custom-attributes.js +0 -192
  59. package/esm2015/schema-fields.service.js +0 -87
  60. package/esm2015/schema-form/schema-array/array-session/array-session.js +0 -161
  61. package/esm2015/schema-form/schema-array/schema-array.js +0 -234
  62. package/esm2015/schema-form/schema-form.js +0 -114
  63. package/esm2015/schema-form/schema-input/field-render/field-render.js +0 -74
  64. package/esm2015/schema-form/schema-input/input-render/boolean-input/boolean-input.component.js +0 -50
  65. package/esm2015/schema-form/schema-input/input-render/input-render.js +0 -199
  66. package/esm2015/schema-form/schema-input/input-render/number-input/number-input.component.js +0 -48
  67. package/esm2015/schema-form/schema-input/schema-input.js +0 -111
  68. package/esm2015/schema-form/schema-object/schema-object.js +0 -134
  69. package/esm2015/schema-form-render.js +0 -136
  70. package/esm2015/schema-form-render.module.js +0 -124
  71. package/esm2015/schema-validation-field.js +0 -15
  72. package/esm2015/struct.utils.js +0 -9
  73. package/esm2015/type-script-compile/type-script-compile.base.js +0 -112
  74. package/fesm2015/apipass-schemas.js +0 -1745
  75. package/fesm2015/apipass-schemas.js.map +0 -1
@@ -1,2339 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('ngx-drag-drop'), require('@angular/material/tooltip'), require('@apipass/icons'), require('@apipass/inputs'), require('@angular/cdk/bidi'), require('@angular/cdk/scrolling')) :
3
- typeof define === 'function' && define.amd ? define('@apipass/schemas', ['exports', '@angular/core', '@angular/common', '@angular/forms', 'ngx-drag-drop', '@angular/material/tooltip', '@apipass/icons', '@apipass/inputs', '@angular/cdk/bidi', '@angular/cdk/scrolling'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.apipass = global.apipass || {}, global.apipass.schemas = {}), global.ng.core, global.ng.common, global.ng.forms, global.i2, global.ng.material.tooltip, global.i2$1, global.i7, global.ng.cdk.bidi, global.ng.cdk.scrolling));
5
- }(this, (function (exports, i0, i1, i3, i2, i4, i2$1, i7, i5, i6) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
- var extendStatics = function (d, b) {
23
- extendStatics = Object.setPrototypeOf ||
24
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
- function (d, b) { for (var p in b)
26
- if (b.hasOwnProperty(p))
27
- d[p] = b[p]; };
28
- return extendStatics(d, b);
29
- };
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
- var __assign = function () {
36
- __assign = Object.assign || function __assign(t) {
37
- for (var s, i = 1, n = arguments.length; i < n; i++) {
38
- s = arguments[i];
39
- for (var p in s)
40
- if (Object.prototype.hasOwnProperty.call(s, p))
41
- t[p] = s[p];
42
- }
43
- return t;
44
- };
45
- return __assign.apply(this, arguments);
46
- };
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s)
50
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
- t[p] = s[p];
52
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
- t[p[i]] = s[p[i]];
56
- }
57
- return t;
58
- }
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
62
- r = Reflect.decorate(decorators, target, key, desc);
63
- else
64
- for (var i = decorators.length - 1; i >= 0; i--)
65
- if (d = decorators[i])
66
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
67
- return c > 3 && r && Object.defineProperty(target, key, r), r;
68
- }
69
- function __param(paramIndex, decorator) {
70
- return function (target, key) { decorator(target, key, paramIndex); };
71
- }
72
- function __metadata(metadataKey, metadataValue) {
73
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
74
- return Reflect.metadata(metadataKey, metadataValue);
75
- }
76
- function __awaiter(thisArg, _arguments, P, generator) {
77
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
78
- return new (P || (P = Promise))(function (resolve, reject) {
79
- function fulfilled(value) { try {
80
- step(generator.next(value));
81
- }
82
- catch (e) {
83
- reject(e);
84
- } }
85
- function rejected(value) { try {
86
- step(generator["throw"](value));
87
- }
88
- catch (e) {
89
- reject(e);
90
- } }
91
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
92
- step((generator = generator.apply(thisArg, _arguments || [])).next());
93
- });
94
- }
95
- function __generator(thisArg, body) {
96
- var _ = { label: 0, sent: function () { if (t[0] & 1)
97
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
98
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
99
- function verb(n) { return function (v) { return step([n, v]); }; }
100
- function step(op) {
101
- if (f)
102
- throw new TypeError("Generator is already executing.");
103
- while (_)
104
- try {
105
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
106
- return t;
107
- if (y = 0, t)
108
- op = [op[0] & 2, t.value];
109
- switch (op[0]) {
110
- case 0:
111
- case 1:
112
- t = op;
113
- break;
114
- case 4:
115
- _.label++;
116
- return { value: op[1], done: false };
117
- case 5:
118
- _.label++;
119
- y = op[1];
120
- op = [0];
121
- continue;
122
- case 7:
123
- op = _.ops.pop();
124
- _.trys.pop();
125
- continue;
126
- default:
127
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
128
- _ = 0;
129
- continue;
130
- }
131
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
132
- _.label = op[1];
133
- break;
134
- }
135
- if (op[0] === 6 && _.label < t[1]) {
136
- _.label = t[1];
137
- t = op;
138
- break;
139
- }
140
- if (t && _.label < t[2]) {
141
- _.label = t[2];
142
- _.ops.push(op);
143
- break;
144
- }
145
- if (t[2])
146
- _.ops.pop();
147
- _.trys.pop();
148
- continue;
149
- }
150
- op = body.call(thisArg, _);
151
- }
152
- catch (e) {
153
- op = [6, e];
154
- y = 0;
155
- }
156
- finally {
157
- f = t = 0;
158
- }
159
- if (op[0] & 5)
160
- throw op[1];
161
- return { value: op[0] ? op[1] : void 0, done: true };
162
- }
163
- }
164
- var __createBinding = Object.create ? (function (o, m, k, k2) {
165
- if (k2 === undefined)
166
- k2 = k;
167
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
168
- }) : (function (o, m, k, k2) {
169
- if (k2 === undefined)
170
- k2 = k;
171
- o[k2] = m[k];
172
- });
173
- function __exportStar(m, exports) {
174
- for (var p in m)
175
- if (p !== "default" && !exports.hasOwnProperty(p))
176
- __createBinding(exports, m, p);
177
- }
178
- function __values(o) {
179
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
180
- if (m)
181
- return m.call(o);
182
- if (o && typeof o.length === "number")
183
- return {
184
- next: function () {
185
- if (o && i >= o.length)
186
- o = void 0;
187
- return { value: o && o[i++], done: !o };
188
- }
189
- };
190
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
191
- }
192
- function __read(o, n) {
193
- var m = typeof Symbol === "function" && o[Symbol.iterator];
194
- if (!m)
195
- return o;
196
- var i = m.call(o), r, ar = [], e;
197
- try {
198
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
199
- ar.push(r.value);
200
- }
201
- catch (error) {
202
- e = { error: error };
203
- }
204
- finally {
205
- try {
206
- if (r && !r.done && (m = i["return"]))
207
- m.call(i);
208
- }
209
- finally {
210
- if (e)
211
- throw e.error;
212
- }
213
- }
214
- return ar;
215
- }
216
- function __spread() {
217
- for (var ar = [], i = 0; i < arguments.length; i++)
218
- ar = ar.concat(__read(arguments[i]));
219
- return ar;
220
- }
221
- function __spreadArrays() {
222
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
223
- s += arguments[i].length;
224
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
225
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
226
- r[k] = a[j];
227
- return r;
228
- }
229
- ;
230
- function __await(v) {
231
- return this instanceof __await ? (this.v = v, this) : new __await(v);
232
- }
233
- function __asyncGenerator(thisArg, _arguments, generator) {
234
- if (!Symbol.asyncIterator)
235
- throw new TypeError("Symbol.asyncIterator is not defined.");
236
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
237
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
238
- function verb(n) { if (g[n])
239
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
240
- function resume(n, v) { try {
241
- step(g[n](v));
242
- }
243
- catch (e) {
244
- settle(q[0][3], e);
245
- } }
246
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
247
- function fulfill(value) { resume("next", value); }
248
- function reject(value) { resume("throw", value); }
249
- function settle(f, v) { if (f(v), q.shift(), q.length)
250
- resume(q[0][0], q[0][1]); }
251
- }
252
- function __asyncDelegator(o) {
253
- var i, p;
254
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
255
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
256
- }
257
- function __asyncValues(o) {
258
- if (!Symbol.asyncIterator)
259
- throw new TypeError("Symbol.asyncIterator is not defined.");
260
- var m = o[Symbol.asyncIterator], i;
261
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
262
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
263
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
264
- }
265
- function __makeTemplateObject(cooked, raw) {
266
- if (Object.defineProperty) {
267
- Object.defineProperty(cooked, "raw", { value: raw });
268
- }
269
- else {
270
- cooked.raw = raw;
271
- }
272
- return cooked;
273
- }
274
- ;
275
- var __setModuleDefault = Object.create ? (function (o, v) {
276
- Object.defineProperty(o, "default", { enumerable: true, value: v });
277
- }) : function (o, v) {
278
- o["default"] = v;
279
- };
280
- function __importStar(mod) {
281
- if (mod && mod.__esModule)
282
- return mod;
283
- var result = {};
284
- if (mod != null)
285
- for (var k in mod)
286
- if (Object.hasOwnProperty.call(mod, k))
287
- __createBinding(result, mod, k);
288
- __setModuleDefault(result, mod);
289
- return result;
290
- }
291
- function __importDefault(mod) {
292
- return (mod && mod.__esModule) ? mod : { default: mod };
293
- }
294
- function __classPrivateFieldGet(receiver, privateMap) {
295
- if (!privateMap.has(receiver)) {
296
- throw new TypeError("attempted to get private field on non-instance");
297
- }
298
- return privateMap.get(receiver);
299
- }
300
- function __classPrivateFieldSet(receiver, privateMap, value) {
301
- if (!privateMap.has(receiver)) {
302
- throw new TypeError("attempted to set private field on non-instance");
303
- }
304
- privateMap.set(receiver, value);
305
- return value;
306
- }
307
-
308
- var BaseSchemaComponent = /** @class */ (function () {
309
- function BaseSchemaComponent() {
310
- this.modelChange = new i0.EventEmitter();
311
- }
312
- BaseSchemaComponent.prototype.getSchemaProperties = function () {
313
- return this.schema.properties instanceof Array ? this.schema.properties : [this.schema.properties];
314
- };
315
- BaseSchemaComponent.prototype.canRender = function (property) {
316
- // tslint:disable-next-line:no-eval
317
- property.canRender = (property === null || property === void 0 ? void 0 : property.conditionExpression) ? eval(property.conditionExpression) : true;
318
- return property.canRender;
319
- };
320
- BaseSchemaComponent.prototype.onDrop = function (event, attr) {
321
- var data = event.data;
322
- if (!attr) {
323
- attr = '';
324
- }
325
- attr += "{{" + data + "}}";
326
- return attr;
327
- };
328
- return BaseSchemaComponent;
329
- }());
330
- BaseSchemaComponent.ɵfac = function BaseSchemaComponent_Factory(t) { return new (t || BaseSchemaComponent)(); };
331
- BaseSchemaComponent.ɵcmp = 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 });
332
- /*@__PURE__*/ (function () {
333
- i0.ɵsetClassMetadata(BaseSchemaComponent, [{
334
- type: i0.Component,
335
- args: [{
336
- template: ''
337
- }]
338
- }], null, { model: [{
339
- type: i0.Input
340
- }], schema: [{
341
- type: i0.Input
342
- }], modelChange: [{
343
- type: i0.Output
344
- }] });
345
- })();
346
-
347
- function onDropStruct(event, attr) {
348
- var data = event.data;
349
- if (!attr) {
350
- attr = '';
351
- }
352
- attr += "{{" + data + "}}";
353
- return attr;
354
- }
355
-
356
- var _c0 = function () { return { standalone: true }; };
357
- function ArraySessionComponent_div_4_div_4_Template(rf, ctx) {
358
- if (rf & 1) {
359
- var _r8_1 = i0.ɵɵgetCurrentView();
360
- i0.ɵɵelementStart(0, "div", 0);
361
- i0.ɵɵelementStart(1, "div", 12);
362
- i0.ɵɵelementStart(2, "label", 13);
363
- i0.ɵɵtext(3, "Loop");
364
- i0.ɵɵelementEnd();
365
- i0.ɵɵelementStart(4, "input", 14);
366
- i0.ɵɵlistener("ngModelChange", function ArraySessionComponent_div_4_div_4_Template_input_ngModelChange_4_listener($event) { i0.ɵɵrestoreView(_r8_1); var item_r2 = i0.ɵɵnextContext().$implicit; return item_r2.loop = $event; })("dndDrop", function ArraySessionComponent_div_4_div_4_Template_input_dndDrop_4_listener($event) { i0.ɵɵrestoreView(_r8_1); var item_r2 = i0.ɵɵnextContext().$implicit; var ctx_r9 = i0.ɵɵnextContext(); return item_r2.loop = ctx_r9.onDrop($event, item_r2.loop); });
367
- i0.ɵɵelementEnd();
368
- i0.ɵɵelementEnd();
369
- i0.ɵɵelementStart(5, "div", 15);
370
- i0.ɵɵelementStart(6, "label", 13);
371
- i0.ɵɵtext(7, "Alias");
372
- i0.ɵɵelementEnd();
373
- i0.ɵɵelementStart(8, "input", 14);
374
- i0.ɵɵlistener("ngModelChange", function ArraySessionComponent_div_4_div_4_Template_input_ngModelChange_8_listener($event) { i0.ɵɵrestoreView(_r8_1); var item_r2 = i0.ɵɵnextContext().$implicit; return item_r2.alias = $event; })("dndDrop", function ArraySessionComponent_div_4_div_4_Template_input_dndDrop_8_listener($event) { i0.ɵɵrestoreView(_r8_1); var item_r2 = i0.ɵɵnextContext().$implicit; var ctx_r13 = i0.ɵɵnextContext(); return item_r2.alias = ctx_r13.onDrop($event, item_r2.alias); });
375
- i0.ɵɵelementEnd();
376
- i0.ɵɵelementEnd();
377
- i0.ɵɵelementEnd();
378
- }
379
- if (rf & 2) {
380
- var item_r2 = i0.ɵɵnextContext().$implicit;
381
- i0.ɵɵadvance(4);
382
- i0.ɵɵproperty("ngModel", item_r2.loop)("ngModelOptions", i0.ɵɵpureFunction0(4, _c0));
383
- i0.ɵɵadvance(4);
384
- i0.ɵɵproperty("ngModel", item_r2.alias)("ngModelOptions", i0.ɵɵpureFunction0(5, _c0));
385
- }
386
- }
387
- function ArraySessionComponent_div_4_ng_container_5_Template(rf, ctx) {
388
- if (rf & 1) {
389
- i0.ɵɵelementContainer(0);
390
- }
391
- }
392
- var _c1 = function (a0, a1, a2) { return { items: a0, index: a1, mappingAttributes: a2 }; };
393
- var _c2 = function (a0) { return { $implicit: a0 }; };
394
- function ArraySessionComponent_div_4_Template(rf, ctx) {
395
- if (rf & 1) {
396
- var _r17_1 = i0.ɵɵgetCurrentView();
397
- i0.ɵɵelementStart(0, "div", 7);
398
- i0.ɵɵelementStart(1, "div", 8);
399
- i0.ɵɵtext(2);
400
- i0.ɵɵelementStart(3, "i", 9);
401
- i0.ɵɵlistener("click", function ArraySessionComponent_div_4_Template_i_click_3_listener() { i0.ɵɵrestoreView(_r17_1); var item_r2 = ctx.$implicit; var ctx_r16 = i0.ɵɵnextContext(); return ctx_r16.remove(item_r2); });
402
- i0.ɵɵelementEnd();
403
- i0.ɵɵelementEnd();
404
- i0.ɵɵtemplate(4, ArraySessionComponent_div_4_div_4_Template, 9, 6, "div", 10);
405
- i0.ɵɵtemplate(5, ArraySessionComponent_div_4_ng_container_5_Template, 1, 0, "ng-container", 11);
406
- i0.ɵɵelementEnd();
407
- }
408
- if (rf & 2) {
409
- var item_r2 = ctx.$implicit;
410
- var index_r3 = ctx.index;
411
- var ctx_r0 = i0.ɵɵnextContext();
412
- i0.ɵɵadvance(2);
413
- i0.ɵɵtextInterpolate2("", ctx_r0.removeLabel, " ", index_r3 + 1, " ");
414
- i0.ɵɵadvance(2);
415
- i0.ɵɵproperty("ngIf", item_r2.mappingAttributes || item_r2.mappingAttributes === "");
416
- i0.ɵɵadvance(1);
417
- i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.subsectionItem)("ngTemplateOutletContext", i0.ɵɵpureFunction1(9, _c2, i0.ɵɵpureFunction3(5, _c1, ctx_r0.model, index_r3, item_r2.mappingAttributes || item_r2.mappingAttributes === "" ? item_r2.mappingAttributes : item_r2)));
418
- }
419
- }
420
- function ArraySessionComponent_button_9_Template(rf, ctx) {
421
- if (rf & 1) {
422
- var _r19_1 = i0.ɵɵgetCurrentView();
423
- i0.ɵɵelementStart(0, "button", 16);
424
- i0.ɵɵlistener("click", function ArraySessionComponent_button_9_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r19_1); var ctx_r18 = i0.ɵɵnextContext(); return ctx_r18.addLoop(); });
425
- i0.ɵɵtext(1);
426
- i0.ɵɵelementEnd();
427
- }
428
- if (rf & 2) {
429
- var ctx_r1 = i0.ɵɵnextContext();
430
- i0.ɵɵadvance(1);
431
- i0.ɵɵtextInterpolate(ctx_r1.addLoopLabel);
432
- }
433
- }
434
- var ArraySessionComponent = /** @class */ (function (_super) {
435
- __extends(ArraySessionComponent, _super);
436
- function ArraySessionComponent() {
437
- var _this = _super.apply(this, __spread(arguments)) || this;
438
- _this.label = '';
439
- _this.removeLabel = 'Remove';
440
- _this.addItemLabel = 'Add Item';
441
- _this.addLoopLabel = 'Add Loop';
442
- _this.showAddLoop = true;
443
- _this.onAdd = new i0.EventEmitter();
444
- _this.onAddLoop = new i0.EventEmitter();
445
- return _this;
446
- }
447
- ArraySessionComponent.prototype.add = function () {
448
- this.onAdd.next();
449
- };
450
- ArraySessionComponent.prototype.addLoop = function () {
451
- this.onAddLoop.next();
452
- };
453
- ArraySessionComponent.prototype.remove = function (item) {
454
- var values = this.model;
455
- var index = values.indexOf(item);
456
- values.splice(index, 1);
457
- this.model = values;
458
- };
459
- ArraySessionComponent.prototype.trackByIndex = function (index, obj) {
460
- return index;
461
- };
462
- return ArraySessionComponent;
463
- }(BaseSchemaComponent));
464
- ArraySessionComponent.ɵfac = function ArraySessionComponent_Factory(t) { return ɵArraySessionComponent_BaseFactory(t || ArraySessionComponent); };
465
- ArraySessionComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ArraySessionComponent, selectors: [["array-session"]], contentQueries: function ArraySessionComponent_ContentQueries(rf, ctx, dirIndex) {
466
- if (rf & 1) {
467
- i0.ɵɵcontentQuery(dirIndex, i0.TemplateRef, true, i0.TemplateRef);
468
- }
469
- if (rf & 2) {
470
- var _t;
471
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.subsectionItem = _t.first);
472
- }
473
- }, 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) {
474
- if (rf & 1) {
475
- i0.ɵɵelementStart(0, "div", 0);
476
- i0.ɵɵelementStart(1, "div", 1);
477
- i0.ɵɵelementStart(2, "label", 2);
478
- i0.ɵɵtext(3);
479
- i0.ɵɵelementEnd();
480
- i0.ɵɵtemplate(4, ArraySessionComponent_div_4_Template, 6, 11, "div", 3);
481
- i0.ɵɵelementEnd();
482
- i0.ɵɵelementEnd();
483
- i0.ɵɵelementStart(5, "div", 4);
484
- i0.ɵɵelementStart(6, "div", 1);
485
- i0.ɵɵelementStart(7, "button", 5);
486
- i0.ɵɵlistener("click", function ArraySessionComponent_Template_button_click_7_listener() { return ctx.add(); });
487
- i0.ɵɵtext(8);
488
- i0.ɵɵelementEnd();
489
- i0.ɵɵtemplate(9, ArraySessionComponent_button_9_Template, 2, 1, "button", 6);
490
- i0.ɵɵelementEnd();
491
- i0.ɵɵelementEnd();
492
- }
493
- if (rf & 2) {
494
- i0.ɵɵadvance(3);
495
- i0.ɵɵtextInterpolate(ctx.label);
496
- i0.ɵɵadvance(1);
497
- i0.ɵɵproperty("ngForOf", ctx.model)("ngForTrackBy", ctx.trackByIndex);
498
- i0.ɵɵadvance(4);
499
- i0.ɵɵtextInterpolate(ctx.addItemLabel);
500
- i0.ɵɵadvance(1);
501
- i0.ɵɵproperty("ngIf", ctx.showAddLoop);
502
- }
503
- }, directives: [i1.NgForOf, i1.NgIf, i1.NgTemplateOutlet, i3.DefaultValueAccessor, i2.DndDropzoneDirective, i3.NgControlStatus, i3.NgModel], styles: [".subsection-element[_ngcontent-%COMP%]{background:#fff;border:1px solid #ccc;border-radius:5px;margin-top:10px;padding:5px 15px 15px}.subsection-element[_ngcontent-%COMP%]:first-child{margin-top:0!important}.btn-personal-edit[_ngcontent-%COMP%]{margin:5px 0}.subsection-item-title[_ngcontent-%COMP%]{align-items:center;background:#eee;border-bottom:1px solid #ccc;border-radius:5px 5px 0 0;display:flex;font-weight:700;justify-content:space-between;margin-bottom:5px;margin-left:-15px;margin-top:-5px;padding:7px 10px 7px 14px;width:calc(100% + 30px)}.subsection-item-title[_ngcontent-%COMP%] .fa-trash-alt[_ngcontent-%COMP%]{color:red;cursor:pointer}.subsection-item-title[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:700}.add-buttons[_ngcontent-%COMP%]{margin-top:5px}"] });
504
- var ɵArraySessionComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(ArraySessionComponent);
505
- /*@__PURE__*/ (function () {
506
- i0.ɵsetClassMetadata(ArraySessionComponent, [{
507
- type: i0.Component,
508
- args: [{
509
- selector: 'array-session',
510
- templateUrl: 'array-session.html',
511
- styleUrls: ['array-session.scss']
512
- }]
513
- }], null, { label: [{
514
- type: i0.Input
515
- }], removeLabel: [{
516
- type: i0.Input
517
- }], addItemLabel: [{
518
- type: i0.Input
519
- }], addLoopLabel: [{
520
- type: i0.Input
521
- }], showAddLoop: [{
522
- type: i0.Input
523
- }], onAdd: [{
524
- type: i0.Output
525
- }], onAddLoop: [{
526
- type: i0.Output
527
- }], subsectionItem: [{
528
- type: i0.ContentChild,
529
- args: [i0.TemplateRef, { read: i0.TemplateRef }]
530
- }] });
531
- })();
532
-
533
- function SchemaFormComponent_div_0_Template(rf, ctx) {
534
- if (rf & 1) {
535
- var _r4_1 = i0.ɵɵgetCurrentView();
536
- i0.ɵɵelementStart(0, "div", 1);
537
- i0.ɵɵelementStart(1, "schema-input", 2);
538
- i0.ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_input_modelChange_1_listener($event) { i0.ɵɵrestoreView(_r4_1); var ctx_r3 = i0.ɵɵnextContext(); return ctx_r3.model = $event; });
539
- i0.ɵɵelementEnd();
540
- i0.ɵɵelementStart(2, "schema-object", 3);
541
- i0.ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_object_modelChange_2_listener($event) { i0.ɵɵrestoreView(_r4_1); var ctx_r5 = i0.ɵɵnextContext(); return ctx_r5.model = $event; });
542
- i0.ɵɵelementEnd();
543
- i0.ɵɵelementStart(3, "schema-array", 3);
544
- i0.ɵɵlistener("modelChange", function SchemaFormComponent_div_0_Template_schema_array_modelChange_3_listener($event) { i0.ɵɵrestoreView(_r4_1); var ctx_r6 = i0.ɵɵnextContext(); return ctx_r6.model = $event; });
545
- i0.ɵɵelementEnd();
546
- i0.ɵɵelementEnd();
547
- }
548
- if (rf & 2) {
549
- var schema_r1 = ctx.$implicit;
550
- var i_r2 = ctx.index;
551
- var ctx_r0 = i0.ɵɵnextContext();
552
- i0.ɵɵadvance(1);
553
- 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);
554
- i0.ɵɵadvance(1);
555
- 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);
556
- i0.ɵɵadvance(1);
557
- 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);
558
- }
559
- }
560
- var SchemaFormComponent = /** @class */ (function (_super) {
561
- __extends(SchemaFormComponent, _super);
562
- function SchemaFormComponent() {
563
- var _this = _super.apply(this, __spread(arguments)) || this;
564
- _this.requiredLabel = '(required)';
565
- _this.addItemLabel = 'Add Item';
566
- _this.addLoopLabel = 'Add Loop';
567
- _this.additionalAttributesLabel = 'Additional Fields';
568
- _this.customAttributeRemoveLabel = 'Remove';
569
- _this.newCustomFieldNameLabel = 'Name';
570
- _this.newCustomFieldValueLabel = 'Value';
571
- _this.newCustomFieldAddLabel = 'Add';
572
- _this.newCustomFieldSaveLabel = 'Save';
573
- _this.newCustomFieldCancelLabel = 'Cancel';
574
- _this.selectPlaceHolderLabel = 'Select Item';
575
- _this.selectSearchPlaceHolderLabel = 'Search';
576
- _this.selectClearLabel = 'Clear';
577
- _this.selectNotFoundLabel = 'No Items Found';
578
- _this.schemas = [];
579
- _this.customProperties = false;
580
- _this.editing = false;
581
- _this.loaded = false;
582
- return _this;
583
- }
584
- SchemaFormComponent.prototype.ngAfterContentInit = function () {
585
- this.loaded = true;
586
- };
587
- SchemaFormComponent.prototype.onDrop = function ($event, modelElement) {
588
- return onDropStruct($event, modelElement);
589
- };
590
- SchemaFormComponent.prototype.getId = function (index) {
591
- return this.idPrefix + "-struct-" + index;
592
- };
593
- return SchemaFormComponent;
594
- }(BaseSchemaComponent));
595
- SchemaFormComponent.ɵfac = function SchemaFormComponent_Factory(t) { return ɵSchemaFormComponent_BaseFactory(t || SchemaFormComponent); };
596
- SchemaFormComponent.ɵcmp = 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) {
597
- if (rf & 1) {
598
- i0.ɵɵtemplate(0, SchemaFormComponent_div_0_Template, 4, 48, "div", 0);
599
- }
600
- if (rf & 2) {
601
- i0.ɵɵproperty("ngForOf", ctx.schemas);
602
- }
603
- }, styles: [""] });
604
- var ɵSchemaFormComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(SchemaFormComponent);
605
- /*@__PURE__*/ (function () {
606
- i0.ɵsetClassMetadata(SchemaFormComponent, [{
607
- type: i0.Component,
608
- args: [{
609
- selector: 'schema-form',
610
- templateUrl: 'schema-form.html',
611
- styleUrls: ['./schema-form.scss']
612
- }]
613
- }], null, { requiredLabel: [{
614
- type: i0.Input
615
- }], addItemLabel: [{
616
- type: i0.Input
617
- }], addLoopLabel: [{
618
- type: i0.Input
619
- }], additionalAttributesLabel: [{
620
- type: i0.Input
621
- }], customAttributeRemoveLabel: [{
622
- type: i0.Input
623
- }], newCustomFieldNameLabel: [{
624
- type: i0.Input
625
- }], newCustomFieldValueLabel: [{
626
- type: i0.Input
627
- }], newCustomFieldAddLabel: [{
628
- type: i0.Input
629
- }], newCustomFieldSaveLabel: [{
630
- type: i0.Input
631
- }], newCustomFieldCancelLabel: [{
632
- type: i0.Input
633
- }], selectPlaceHolderLabel: [{
634
- type: i0.Input
635
- }], selectSearchPlaceHolderLabel: [{
636
- type: i0.Input
637
- }], selectClearLabel: [{
638
- type: i0.Input
639
- }], selectNotFoundLabel: [{
640
- type: i0.Input
641
- }], idPrefix: [{
642
- type: i0.Input
643
- }], schemas: [{
644
- type: i0.Input
645
- }], customProperties: [{
646
- type: i0.Input
647
- }], editing: [{
648
- type: i0.Input
649
- }], inputType: [{
650
- type: i0.Input
651
- }] });
652
- })();
653
-
654
- var _c0$1 = function () { return { standalone: true }; };
655
- function SchemaCustomAttributesComponent_div_0_Template(rf, ctx) {
656
- if (rf & 1) {
657
- var _r8_1 = i0.ɵɵgetCurrentView();
658
- i0.ɵɵelementStart(0, "div", 6);
659
- i0.ɵɵelementStart(1, "div", 7);
660
- i0.ɵɵelementStart(2, "label", 8);
661
- i0.ɵɵtext(3);
662
- i0.ɵɵelementEnd();
663
- i0.ɵɵelementStart(4, "span", 9);
664
- i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_div_0_Template_span_click_4_listener() { i0.ɵɵrestoreView(_r8_1); var i_r6 = ctx.index; var ctx_r7 = i0.ɵɵnextContext(); return ctx_r7.removeCustomAttribute(i_r6); });
665
- i0.ɵɵelement(5, "i", 10);
666
- i0.ɵɵelementEnd();
667
- i0.ɵɵelementStart(6, "input", 11);
668
- i0.ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_0_Template_input_ngModelChange_6_listener($event) { i0.ɵɵrestoreView(_r8_1); var attribute_r5 = ctx.$implicit; return attribute_r5.value = $event; })("dndDrop", function SchemaCustomAttributesComponent_div_0_Template_input_dndDrop_6_listener($event) { i0.ɵɵrestoreView(_r8_1); var attribute_r5 = ctx.$implicit; var ctx_r10 = i0.ɵɵnextContext(); return ctx_r10.onDropAttr($event, "value", attribute_r5); });
669
- i0.ɵɵelementEnd();
670
- i0.ɵɵelementEnd();
671
- i0.ɵɵelementEnd();
672
- }
673
- if (rf & 2) {
674
- var attribute_r5 = ctx.$implicit;
675
- var ctx_r0 = i0.ɵɵnextContext();
676
- i0.ɵɵadvance(3);
677
- i0.ɵɵtextInterpolate(attribute_r5.label);
678
- i0.ɵɵadvance(2);
679
- i0.ɵɵproperty("matTooltip", ctx_r0.customAttributeRemoveLabel);
680
- i0.ɵɵadvance(1);
681
- i0.ɵɵproperty("ngModel", attribute_r5.value)("ngModelOptions", i0.ɵɵpureFunction0(4, _c0$1));
682
- }
683
- }
684
- function SchemaCustomAttributesComponent_div_1_Template(rf, ctx) {
685
- if (rf & 1) {
686
- var _r12_1 = i0.ɵɵgetCurrentView();
687
- i0.ɵɵelementStart(0, "div", 12);
688
- i0.ɵɵelementStart(1, "div", 13);
689
- i0.ɵɵelementStart(2, "div", 7);
690
- i0.ɵɵelementStart(3, "label", 8);
691
- i0.ɵɵtext(4);
692
- i0.ɵɵelementStart(5, "strong");
693
- i0.ɵɵtext(6, "*");
694
- i0.ɵɵelementEnd();
695
- i0.ɵɵelementEnd();
696
- i0.ɵɵelementStart(7, "input", 11);
697
- i0.ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_7_listener($event) { i0.ɵɵrestoreView(_r12_1); var ctx_r11 = i0.ɵɵnextContext(); return ctx_r11.newCustomField.label = $event; })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_7_listener($event) { i0.ɵɵrestoreView(_r12_1); var ctx_r13 = i0.ɵɵnextContext(); return ctx_r13.onDropAttr($event, "label", ctx_r13.newCustomField); });
698
- i0.ɵɵelementEnd();
699
- i0.ɵɵelementEnd();
700
- i0.ɵɵelementEnd();
701
- i0.ɵɵelementStart(8, "div", 13);
702
- i0.ɵɵelementStart(9, "div", 7);
703
- i0.ɵɵelementStart(10, "label", 8);
704
- i0.ɵɵtext(11);
705
- i0.ɵɵelementStart(12, "strong");
706
- i0.ɵɵtext(13, "*");
707
- i0.ɵɵelementEnd();
708
- i0.ɵɵelementEnd();
709
- i0.ɵɵelementStart(14, "input", 11);
710
- i0.ɵɵlistener("ngModelChange", function SchemaCustomAttributesComponent_div_1_Template_input_ngModelChange_14_listener($event) { i0.ɵɵrestoreView(_r12_1); var ctx_r14 = i0.ɵɵnextContext(); return ctx_r14.newCustomField.value = $event; })("dndDrop", function SchemaCustomAttributesComponent_div_1_Template_input_dndDrop_14_listener($event) { i0.ɵɵrestoreView(_r12_1); var ctx_r15 = i0.ɵɵnextContext(); return ctx_r15.onDropAttr($event, "value", ctx_r15.newCustomField); });
711
- i0.ɵɵelementEnd();
712
- i0.ɵɵelementEnd();
713
- i0.ɵɵelementEnd();
714
- i0.ɵɵelementEnd();
715
- }
716
- if (rf & 2) {
717
- var ctx_r1 = i0.ɵɵnextContext();
718
- i0.ɵɵadvance(4);
719
- i0.ɵɵtextInterpolate(ctx_r1.newCustomFieldNameLabel);
720
- i0.ɵɵadvance(3);
721
- i0.ɵɵproperty("ngModel", ctx_r1.newCustomField.label)("ngModelOptions", i0.ɵɵpureFunction0(6, _c0$1));
722
- i0.ɵɵadvance(4);
723
- i0.ɵɵtextInterpolate(ctx_r1.newCustomFieldValueLabel);
724
- i0.ɵɵadvance(3);
725
- i0.ɵɵproperty("ngModel", ctx_r1.newCustomField.value)("ngModelOptions", i0.ɵɵpureFunction0(7, _c0$1));
726
- }
727
- }
728
- function SchemaCustomAttributesComponent_button_4_Template(rf, ctx) {
729
- if (rf & 1) {
730
- var _r17_1 = i0.ɵɵgetCurrentView();
731
- i0.ɵɵelementStart(0, "button", 14);
732
- i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_button_4_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r17_1); var ctx_r16 = i0.ɵɵnextContext(); return ctx_r16.newCustomField = {}; });
733
- i0.ɵɵtext(1);
734
- i0.ɵɵelementEnd();
735
- }
736
- if (rf & 2) {
737
- var ctx_r2 = i0.ɵɵnextContext();
738
- i0.ɵɵadvance(1);
739
- i0.ɵɵtextInterpolate1(" ", ctx_r2.newCustomFieldAddLabel, " ");
740
- }
741
- }
742
- function SchemaCustomAttributesComponent_button_5_Template(rf, ctx) {
743
- if (rf & 1) {
744
- var _r19_1 = i0.ɵɵgetCurrentView();
745
- i0.ɵɵelementStart(0, "button", 15);
746
- i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_button_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r19_1); var ctx_r18 = i0.ɵɵnextContext(); return ctx_r18.newCustomField = null; });
747
- i0.ɵɵtext(1);
748
- i0.ɵɵelementEnd();
749
- }
750
- if (rf & 2) {
751
- var ctx_r3 = i0.ɵɵnextContext();
752
- i0.ɵɵadvance(1);
753
- i0.ɵɵtextInterpolate1(" ", ctx_r3.newCustomFieldCancelLabel, " ");
754
- }
755
- }
756
- function SchemaCustomAttributesComponent_button_6_Template(rf, ctx) {
757
- if (rf & 1) {
758
- var _r21_1 = i0.ɵɵgetCurrentView();
759
- i0.ɵɵelementStart(0, "button", 14);
760
- i0.ɵɵlistener("click", function SchemaCustomAttributesComponent_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r21_1); var ctx_r20 = i0.ɵɵnextContext(); return ctx_r20.saveNewAttribute(ctx_r20.newCustomField); });
761
- i0.ɵɵtext(1);
762
- i0.ɵɵelementEnd();
763
- }
764
- if (rf & 2) {
765
- var ctx_r4 = i0.ɵɵnextContext();
766
- i0.ɵɵadvance(1);
767
- i0.ɵɵtextInterpolate1(" ", ctx_r4.newCustomFieldSaveLabel, " ");
768
- }
769
- }
770
- var SchemaCustomAttributesComponent = /** @class */ (function (_super) {
771
- __extends(SchemaCustomAttributesComponent, _super);
772
- function SchemaCustomAttributesComponent() {
773
- var _this = _super.apply(this, __spread(arguments)) || this;
774
- _this.customAttributeRemoveLabel = 'Remove';
775
- _this.newCustomFieldNameLabel = 'Name';
776
- _this.newCustomFieldValueLabel = 'Value';
777
- _this.newCustomFieldAddLabel = 'Add';
778
- _this.newCustomFieldSaveLabel = 'Save';
779
- _this.newCustomFieldCancelLabel = 'Cancel';
780
- _this.onSaveAttribute = new i0.EventEmitter();
781
- _this.onDropOnAttribute = new i0.EventEmitter();
782
- return _this;
783
- }
784
- SchemaCustomAttributesComponent.prototype.ngAfterContentInit = function () {
785
- if (!this.model) {
786
- this.model = [];
787
- }
788
- };
789
- SchemaCustomAttributesComponent.prototype.saveNewAttribute = function (newCustomField) {
790
- this.onSaveAttribute.emit(newCustomField);
791
- this.model.push(newCustomField);
792
- this.newCustomField = null;
793
- this.modelChange.emit(this.model);
794
- };
795
- SchemaCustomAttributesComponent.prototype.removeCustomAttribute = function (attributeIndex) {
796
- this.model.splice(attributeIndex, 1);
797
- this.modelChange.emit(this.model);
798
- };
799
- SchemaCustomAttributesComponent.prototype.onDropAttr = function ($event, value, newCustomField) {
800
- if (!newCustomField[value]) {
801
- newCustomField[value] = '';
802
- }
803
- newCustomField[value] += "{{" + $event.data + "}}";
804
- };
805
- return SchemaCustomAttributesComponent;
806
- }(BaseSchemaComponent));
807
- SchemaCustomAttributesComponent.ɵfac = function SchemaCustomAttributesComponent_Factory(t) { return ɵSchemaCustomAttributesComponent_BaseFactory(t || SchemaCustomAttributesComponent); };
808
- SchemaCustomAttributesComponent.ɵcmp = 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) {
809
- if (rf & 1) {
810
- i0.ɵɵtemplate(0, SchemaCustomAttributesComponent_div_0_Template, 7, 5, "div", 0);
811
- i0.ɵɵtemplate(1, SchemaCustomAttributesComponent_div_1_Template, 15, 8, "div", 1);
812
- i0.ɵɵelementStart(2, "div", 2);
813
- i0.ɵɵelementStart(3, "div", 3);
814
- i0.ɵɵtemplate(4, SchemaCustomAttributesComponent_button_4_Template, 2, 1, "button", 4);
815
- i0.ɵɵtemplate(5, SchemaCustomAttributesComponent_button_5_Template, 2, 1, "button", 5);
816
- i0.ɵɵtemplate(6, SchemaCustomAttributesComponent_button_6_Template, 2, 1, "button", 4);
817
- i0.ɵɵelementEnd();
818
- i0.ɵɵelementEnd();
819
- }
820
- if (rf & 2) {
821
- i0.ɵɵproperty("ngForOf", ctx.model);
822
- i0.ɵɵadvance(1);
823
- i0.ɵɵproperty("ngIf", ctx.newCustomField);
824
- i0.ɵɵadvance(3);
825
- i0.ɵɵproperty("ngIf", !ctx.newCustomField);
826
- i0.ɵɵadvance(1);
827
- i0.ɵɵproperty("ngIf", ctx.newCustomField);
828
- i0.ɵɵadvance(1);
829
- i0.ɵɵproperty("ngIf", ctx.newCustomField && ctx.newCustomField.label && ctx.newCustomField.value);
830
- }
831
- }, directives: [i1.NgForOf, i1.NgIf, i4.MatTooltip, i3.DefaultValueAccessor, i2.DndDropzoneDirective, i3.NgControlStatus, i3.NgModel], styles: [".customAttributeDeleteIcon[_ngcontent-%COMP%]{color:red;cursor:pointer;font-size:16px;position:absolute;right:15px;top:4px}.customAttributeDeleteIcon[_ngcontent-%COMP%]:hover{color:#777}.struct-custom-field[_ngcontent-%COMP%]{background-color:#ececec;margin-top:16px;padding:8px 16px 16px}"] });
832
- var ɵSchemaCustomAttributesComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(SchemaCustomAttributesComponent);
833
- /*@__PURE__*/ (function () {
834
- i0.ɵsetClassMetadata(SchemaCustomAttributesComponent, [{
835
- type: i0.Component,
836
- args: [{
837
- selector: 'schema-custom-attributes',
838
- templateUrl: 'schema-custom-attributes.html',
839
- styleUrls: ['./schema-custom-attributes.scss']
840
- }]
841
- }], null, { onDropFunction: [{
842
- type: i0.Input
843
- }], customAttributeRemoveLabel: [{
844
- type: i0.Input
845
- }], newCustomFieldNameLabel: [{
846
- type: i0.Input
847
- }], newCustomFieldValueLabel: [{
848
- type: i0.Input
849
- }], newCustomFieldAddLabel: [{
850
- type: i0.Input
851
- }], newCustomFieldSaveLabel: [{
852
- type: i0.Input
853
- }], newCustomFieldCancelLabel: [{
854
- type: i0.Input
855
- }], onSaveAttribute: [{
856
- type: i0.Output
857
- }], onDropOnAttribute: [{
858
- type: i0.Output
859
- }] });
860
- })();
861
-
862
- function SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template(rf, ctx) {
863
- if (rf & 1) {
864
- var _r8_1 = i0.ɵɵgetCurrentView();
865
- i0.ɵɵelementStart(0, "schema-form", 4);
866
- i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template_schema_form_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r8_1); var item_r3 = i0.ɵɵnextContext().$implicit; var ctx_r7 = i0.ɵɵnextContext(2); return ctx_r7.model[ctx_r7.schema.id][item_r3.index].mappingAttributes = $event; });
867
- i0.ɵɵelementEnd();
868
- }
869
- if (rf & 2) {
870
- var item_r3 = i0.ɵɵnextContext().$implicit;
871
- var ctx_r4 = i0.ɵɵnextContext(2);
872
- 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);
873
- }
874
- }
875
- function SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template(rf, ctx) {
876
- if (rf & 1) {
877
- var _r12_1 = i0.ɵɵgetCurrentView();
878
- i0.ɵɵelementStart(0, "schema-form", 4);
879
- i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template_schema_form_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r12_1); var item_r3 = i0.ɵɵnextContext().$implicit; var ctx_r11 = i0.ɵɵnextContext(2); return (ctx_r11.model[ctx_r11.schema.id][item_r3.index] = $event); });
880
- i0.ɵɵelementEnd();
881
- }
882
- if (rf & 2) {
883
- var item_r3 = i0.ɵɵnextContext().$implicit;
884
- var ctx_r5 = i0.ɵɵnextContext(2);
885
- 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);
886
- }
887
- }
888
- function SchemaArrayComponent_div_0_ng_template_2_div_2_Template(rf, ctx) {
889
- if (rf & 1) {
890
- var _r16_1 = i0.ɵɵgetCurrentView();
891
- i0.ɵɵelementStart(0, "div", 5);
892
- i0.ɵɵelementStart(1, "div", 6);
893
- i0.ɵɵelementStart(2, "label", 7);
894
- i0.ɵɵtext(3);
895
- i0.ɵɵelementEnd();
896
- i0.ɵɵelementStart(4, "schema-custom-attributes", 8);
897
- i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_ng_template_2_div_2_Template_schema_custom_attributes_modelChange_4_listener($event) { i0.ɵɵrestoreView(_r16_1); var item_r3 = i0.ɵɵnextContext().$implicit; var ctx_r15 = i0.ɵɵnextContext(2); return ctx_r15.model[ctx_r15.schema.id][item_r3.index].customAttributes = $event; });
898
- i0.ɵɵelementEnd();
899
- i0.ɵɵelementEnd();
900
- i0.ɵɵelementEnd();
901
- }
902
- if (rf & 2) {
903
- var item_r3 = i0.ɵɵnextContext().$implicit;
904
- var ctx_r6 = i0.ɵɵnextContext(2);
905
- i0.ɵɵadvance(3);
906
- i0.ɵɵtextInterpolate(ctx_r6.additionalAttributesLabel);
907
- i0.ɵɵadvance(1);
908
- 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);
909
- }
910
- }
911
- function SchemaArrayComponent_div_0_ng_template_2_Template(rf, ctx) {
912
- if (rf & 1) {
913
- i0.ɵɵtemplate(0, SchemaArrayComponent_div_0_ng_template_2_schema_form_0_Template, 1, 18, "schema-form", 2);
914
- i0.ɵɵtemplate(1, SchemaArrayComponent_div_0_ng_template_2_schema_form_1_Template, 1, 18, "schema-form", 2);
915
- i0.ɵɵtemplate(2, SchemaArrayComponent_div_0_ng_template_2_div_2_Template, 5, 9, "div", 3);
916
- }
917
- if (rf & 2) {
918
- var item_r3 = ctx.$implicit;
919
- var ctx_r2 = i0.ɵɵnextContext(2);
920
- i0.ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index].loop !== undefined);
921
- i0.ɵɵadvance(1);
922
- i0.ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index].loop == undefined);
923
- i0.ɵɵadvance(1);
924
- i0.ɵɵproperty("ngIf", ctx_r2.model[ctx_r2.schema.id][item_r3.index] && ctx_r2.schema.customProperties);
925
- }
926
- }
927
- function SchemaArrayComponent_div_0_Template(rf, ctx) {
928
- if (rf & 1) {
929
- var _r20_1 = i0.ɵɵgetCurrentView();
930
- i0.ɵɵelementStart(0, "div");
931
- i0.ɵɵelementStart(1, "array-session", 1);
932
- i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_0_Template_array_session_modelChange_1_listener($event) { i0.ɵɵrestoreView(_r20_1); var ctx_r19 = i0.ɵɵnextContext(); return (ctx_r19.model[ctx_r19.schema.id] = $event); })("onAdd", function SchemaArrayComponent_div_0_Template_array_session_onAdd_1_listener() { i0.ɵɵrestoreView(_r20_1); var ctx_r21 = i0.ɵɵnextContext(); return ctx_r21.addArrayItem(ctx_r21.schema.id, {}); })("onAddLoop", function SchemaArrayComponent_div_0_Template_array_session_onAddLoop_1_listener() { i0.ɵɵrestoreView(_r20_1); var ctx_r22 = i0.ɵɵnextContext(); return ctx_r22.addArrayLoop(ctx_r22.schema.id, {}); });
933
- i0.ɵɵtemplate(2, SchemaArrayComponent_div_0_ng_template_2_Template, 3, 3, "ng-template");
934
- i0.ɵɵelementEnd();
935
- i0.ɵɵelementEnd();
936
- }
937
- if (rf & 2) {
938
- var ctx_r0 = i0.ɵɵnextContext();
939
- i0.ɵɵadvance(1);
940
- 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);
941
- }
942
- }
943
- var _c0$2 = function () { return { standalone: true }; };
944
- function SchemaArrayComponent_div_1_ng_template_2_input_2_Template(rf, ctx) {
945
- if (rf & 1) {
946
- var _r30_1 = i0.ɵɵgetCurrentView();
947
- i0.ɵɵelementStart(0, "input", 12);
948
- i0.ɵɵlistener("ngModelChange", function SchemaArrayComponent_div_1_ng_template_2_input_2_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r30_1); var item_r24 = i0.ɵɵnextContext().$implicit; return item_r24.items[item_r24.index].mappingAttributes = $event; })("dndDrop", function SchemaArrayComponent_div_1_ng_template_2_input_2_Template_input_dndDrop_0_listener($event) { i0.ɵɵrestoreView(_r30_1); var item_r24 = i0.ɵɵnextContext().$implicit; var ctx_r31 = i0.ɵɵnextContext(2); return item_r24.items[item_r24.index].mappingAttributes = ctx_r31.onDrop($event, item_r24.items[item_r24.index].mappingAttributes); });
949
- i0.ɵɵelementEnd();
950
- }
951
- if (rf & 2) {
952
- var item_r24 = i0.ɵɵnextContext().$implicit;
953
- var ctx_r25 = i0.ɵɵnextContext(2);
954
- i0.ɵɵproperty("ngModel", item_r24.items[item_r24.index].mappingAttributes)("ngModelOptions", i0.ɵɵpureFunction0(3, _c0$2))("id", ctx_r25.getId(ctx_r25.index) + "-" + item_r24.index);
955
- }
956
- }
957
- function SchemaArrayComponent_div_1_ng_template_2_ng_template_3_Template(rf, ctx) {
958
- if (rf & 1) {
959
- var _r36_1 = i0.ɵɵgetCurrentView();
960
- i0.ɵɵelementStart(0, "input", 12);
961
- i0.ɵɵlistener("ngModelChange", function SchemaArrayComponent_div_1_ng_template_2_ng_template_3_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r36_1); var item_r24 = i0.ɵɵnextContext().$implicit; return (item_r24.items[item_r24.index] = $event); })("dndDrop", function SchemaArrayComponent_div_1_ng_template_2_ng_template_3_Template_input_dndDrop_0_listener($event) { i0.ɵɵrestoreView(_r36_1); var item_r24 = i0.ɵɵnextContext().$implicit; var ctx_r37 = i0.ɵɵnextContext(2); return (item_r24.items[item_r24.index] = ctx_r37.onDrop($event, item_r24.items[item_r24.index])); });
962
- i0.ɵɵelementEnd();
963
- }
964
- if (rf & 2) {
965
- var item_r24 = i0.ɵɵnextContext().$implicit;
966
- var ctx_r27 = i0.ɵɵnextContext(2);
967
- i0.ɵɵproperty("ngModel", item_r24.items[item_r24.index])("ngModelOptions", i0.ɵɵpureFunction0(3, _c0$2))("id", ctx_r27.getId(ctx_r27.index) + "-" + item_r24.index);
968
- }
969
- }
970
- function SchemaArrayComponent_div_1_ng_template_2_Template(rf, ctx) {
971
- if (rf & 1) {
972
- i0.ɵɵelementStart(0, "label", 9);
973
- i0.ɵɵtext(1);
974
- i0.ɵɵelementEnd();
975
- i0.ɵɵtemplate(2, SchemaArrayComponent_div_1_ng_template_2_input_2_Template, 1, 4, "input", 10);
976
- i0.ɵɵtemplate(3, SchemaArrayComponent_div_1_ng_template_2_ng_template_3_Template, 1, 4, "ng-template", null, 11, i0.ɵɵtemplateRefExtractor);
977
- }
978
- if (rf & 2) {
979
- var item_r24 = ctx.$implicit;
980
- var _r26 = i0.ɵɵreference(4);
981
- var ctx_r23 = i0.ɵɵnextContext(2);
982
- i0.ɵɵproperty("htmlFor", ctx_r23.getId(ctx_r23.index) + "-" + item_r24.index);
983
- i0.ɵɵadvance(1);
984
- i0.ɵɵtextInterpolate(ctx_r23.schema.title);
985
- i0.ɵɵadvance(1);
986
- i0.ɵɵproperty("ngIf", item_r24.items[item_r24.index].mappingAttributes || item_r24.items[item_r24.index].mappingAttributes === "")("ngIfElse", _r26);
987
- }
988
- }
989
- function SchemaArrayComponent_div_1_Template(rf, ctx) {
990
- if (rf & 1) {
991
- var _r41_1 = i0.ɵɵgetCurrentView();
992
- i0.ɵɵelementStart(0, "div");
993
- i0.ɵɵelementStart(1, "array-session", 1);
994
- i0.ɵɵlistener("modelChange", function SchemaArrayComponent_div_1_Template_array_session_modelChange_1_listener($event) { i0.ɵɵrestoreView(_r41_1); var ctx_r40 = i0.ɵɵnextContext(); return (ctx_r40.model[ctx_r40.schema.id] = $event); })("onAdd", function SchemaArrayComponent_div_1_Template_array_session_onAdd_1_listener() { i0.ɵɵrestoreView(_r41_1); var ctx_r42 = i0.ɵɵnextContext(); return ctx_r42.addArrayItem(ctx_r42.schema.id, ""); })("onAddLoop", function SchemaArrayComponent_div_1_Template_array_session_onAddLoop_1_listener() { i0.ɵɵrestoreView(_r41_1); var ctx_r43 = i0.ɵɵnextContext(); return ctx_r43.addArrayLoop(ctx_r43.schema.id, ""); });
995
- i0.ɵɵtemplate(2, SchemaArrayComponent_div_1_ng_template_2_Template, 5, 4, "ng-template");
996
- i0.ɵɵelementEnd();
997
- i0.ɵɵelementEnd();
998
- }
999
- if (rf & 2) {
1000
- var ctx_r1 = i0.ɵɵnextContext();
1001
- i0.ɵɵadvance(1);
1002
- 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);
1003
- }
1004
- }
1005
- var SchemaArrayComponent = /** @class */ (function (_super) {
1006
- __extends(SchemaArrayComponent, _super);
1007
- function SchemaArrayComponent() {
1008
- var _this = _super.apply(this, __spread(arguments)) || this;
1009
- _this.requiredLabel = '(required)';
1010
- _this.addItemLabel = 'Add Item';
1011
- _this.addLoopLabel = 'Add Loop';
1012
- _this.additionalAttributesLabel = 'Additional Fields';
1013
- _this.customAttributeRemoveLabel = 'Remove';
1014
- _this.newCustomFieldNameLabel = 'Name';
1015
- _this.newCustomFieldValueLabel = 'Value';
1016
- _this.newCustomFieldAddLabel = 'Add';
1017
- _this.newCustomFieldSaveLabel = 'Save';
1018
- _this.newCustomFieldCancelLabel = 'Cancel';
1019
- _this.selectPlaceHolderLabel = 'Select Item';
1020
- _this.selectSearchPlaceHolderLabel = 'Search';
1021
- _this.selectClearLabel = 'Clear';
1022
- _this.selectNotFoundLabel = 'No Items Found';
1023
- _this.editing = false;
1024
- return _this;
1025
- }
1026
- SchemaArrayComponent.prototype.ngAfterContentInit = function () {
1027
- var _a;
1028
- if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) === 'array' && this.model && !this.model[this.schema.id]) {
1029
- this.model[this.schema.id] = [];
1030
- }
1031
- this.loaded = true;
1032
- };
1033
- SchemaArrayComponent.prototype.onDrop = function ($event, modelElement) {
1034
- return onDropStruct($event, modelElement);
1035
- };
1036
- SchemaArrayComponent.prototype.getId = function (index) {
1037
- return this.idPrefix + "-struct-" + index;
1038
- };
1039
- SchemaArrayComponent.prototype.addArrayItem = function (id, param) {
1040
- var _this = this;
1041
- this.model[id] = this.model[id] || [];
1042
- if (this.schema.properties) {
1043
- param = {};
1044
- Object.keys(this.schema.properties).forEach(function (key) {
1045
- var schemaProperty = _this.schema.properties[key];
1046
- if (schemaProperty.type === 'object') {
1047
- param[schemaProperty.id] = {};
1048
- }
1049
- else if (schemaProperty.type === 'array') {
1050
- param[schemaProperty.id] = [];
1051
- }
1052
- });
1053
- }
1054
- this.model[id].push(param);
1055
- };
1056
- SchemaArrayComponent.prototype.addArrayLoop = function (id, mappingAttributes) {
1057
- this.model[id] = this.model[id] || [];
1058
- this.model[id].push({ loop: '', alias: '', mappingAttributes: mappingAttributes });
1059
- };
1060
- return SchemaArrayComponent;
1061
- }(BaseSchemaComponent));
1062
- SchemaArrayComponent.ɵfac = function SchemaArrayComponent_Factory(t) { return ɵSchemaArrayComponent_BaseFactory(t || SchemaArrayComponent); };
1063
- SchemaArrayComponent.ɵcmp = i0.ɵɵdefineComponent({ type: SchemaArrayComponent, selectors: [["schema-array"]], inputs: { requiredLabel: "requiredLabel", addItemLabel: "addItemLabel", addLoopLabel: "addLoopLabel", additionalAttributesLabel: "additionalAttributesLabel", customAttributeRemoveLabel: "customAttributeRemoveLabel", newCustomFieldNameLabel: "newCustomFieldNameLabel", newCustomFieldValueLabel: "newCustomFieldValueLabel", newCustomFieldAddLabel: "newCustomFieldAddLabel", newCustomFieldSaveLabel: "newCustomFieldSaveLabel", newCustomFieldCancelLabel: "newCustomFieldCancelLabel", selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", idPrefix: "idPrefix", schema: "schema", editing: "editing", index: "index" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [[4, "ngIf"], [3, "addItemLabel", "addLoopLabel", "label", "removeLabel", "model", "showAddLoop", "modelChange", "onAdd", "onAddLoop"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "addItemLabel", "addLoopLabel", "additionalAttributesLabel", "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "idPrefix", "model", "schemas", "editing", "modelChange", 4, "ngIf"], ["class", "row struct-custom-properties", 4, "ngIf"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "requiredLabel", "addItemLabel", "addLoopLabel", "additionalAttributesLabel", "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "idPrefix", "model", "schemas", "editing", "modelChange"], [1, "row", "struct-custom-properties"], [1, "col-md-12"], [1, "info-label", "bold"], [3, "customAttributeRemoveLabel", "newCustomFieldNameLabel", "newCustomFieldValueLabel", "newCustomFieldAddLabel", "newCustomFieldSaveLabel", "newCustomFieldCancelLabel", "model", "onDropFunction", "modelChange"], [1, "info-label", 3, "htmlFor"], ["class", "form-control", "type", "text", "dndDropzone", "", 3, "ngModel", "ngModelOptions", "id", "ngModelChange", "dndDrop", 4, "ngIf", "ngIfElse"], ["elseBlock", ""], ["type", "text", "dndDropzone", "", 1, "form-control", 3, "ngModel", "ngModelOptions", "id", "ngModelChange", "dndDrop"]], template: function SchemaArrayComponent_Template(rf, ctx) {
1064
- if (rf & 1) {
1065
- i0.ɵɵtemplate(0, SchemaArrayComponent_div_0_Template, 3, 6, "div", 0);
1066
- i0.ɵɵtemplate(1, SchemaArrayComponent_div_1_Template, 3, 6, "div", 0);
1067
- }
1068
- if (rf & 2) {
1069
- i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type === "array" && ctx.schema.properties);
1070
- i0.ɵɵadvance(1);
1071
- i0.ɵɵproperty("ngIf", ctx.schema && ctx.canRender(ctx.schema) && ctx.schema.type === "array" && !ctx.schema.properties);
1072
- }
1073
- }, directives: [i1.NgIf, ArraySessionComponent, SchemaFormComponent, SchemaCustomAttributesComponent, i3.DefaultValueAccessor, i2.DndDropzoneDirective, i3.NgControlStatus, i3.NgModel], styles: [""] });
1074
- var ɵSchemaArrayComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(SchemaArrayComponent);
1075
- /*@__PURE__*/ (function () {
1076
- i0.ɵsetClassMetadata(SchemaArrayComponent, [{
1077
- type: i0.Component,
1078
- args: [{
1079
- selector: 'schema-array',
1080
- templateUrl: 'schema-array.html',
1081
- styleUrls: ['./schema-array.scss']
1082
- }]
1083
- }], null, { requiredLabel: [{
1084
- type: i0.Input
1085
- }], addItemLabel: [{
1086
- type: i0.Input
1087
- }], addLoopLabel: [{
1088
- type: i0.Input
1089
- }], additionalAttributesLabel: [{
1090
- type: i0.Input
1091
- }], customAttributeRemoveLabel: [{
1092
- type: i0.Input
1093
- }], newCustomFieldNameLabel: [{
1094
- type: i0.Input
1095
- }], newCustomFieldValueLabel: [{
1096
- type: i0.Input
1097
- }], newCustomFieldAddLabel: [{
1098
- type: i0.Input
1099
- }], newCustomFieldSaveLabel: [{
1100
- type: i0.Input
1101
- }], newCustomFieldCancelLabel: [{
1102
- type: i0.Input
1103
- }], selectPlaceHolderLabel: [{
1104
- type: i0.Input
1105
- }], selectSearchPlaceHolderLabel: [{
1106
- type: i0.Input
1107
- }], selectClearLabel: [{
1108
- type: i0.Input
1109
- }], selectNotFoundLabel: [{
1110
- type: i0.Input
1111
- }], idPrefix: [{
1112
- type: i0.Input
1113
- }], schema: [{
1114
- type: i0.Input
1115
- }], editing: [{
1116
- type: i0.Input
1117
- }], index: [{
1118
- type: i0.Input
1119
- }] });
1120
- })();
1121
-
1122
- var _c0$3 = function (a0) { return { "has-error": a0 }; };
1123
- function FieldRenderComponent_small_3_Template(rf, ctx) {
1124
- if (rf & 1) {
1125
- i0.ɵɵelementStart(0, "small", 0);
1126
- i0.ɵɵtext(1);
1127
- i0.ɵɵelementEnd();
1128
- }
1129
- if (rf & 2) {
1130
- var ctx_r0 = i0.ɵɵnextContext();
1131
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c0$3, ctx_r0.state && !ctx_r0.state.valid && ctx_r0.state.errors));
1132
- i0.ɵɵadvance(1);
1133
- i0.ɵɵtextInterpolate(ctx_r0.requiredLabel);
1134
- }
1135
- }
1136
- function FieldRenderComponent_span_4_Template(rf, ctx) {
1137
- if (rf & 1) {
1138
- i0.ɵɵelementStart(0, "span", 4);
1139
- i0.ɵɵelement(1, "i", 5);
1140
- i0.ɵɵelementEnd();
1141
- }
1142
- if (rf & 2) {
1143
- var ctx_r1 = i0.ɵɵnextContext();
1144
- i0.ɵɵpropertyInterpolate("matTooltip", ctx_r1.tooltip);
1145
- }
1146
- }
1147
- var _c1$1 = ["*"];
1148
- var FieldRenderComponent = /** @class */ (function () {
1149
- function FieldRenderComponent() {
1150
- this.requiredLabel = '(required)';
1151
- this.label = '';
1152
- this.required = true;
1153
- }
1154
- return FieldRenderComponent;
1155
- }());
1156
- FieldRenderComponent.ɵfac = function FieldRenderComponent_Factory(t) { return new (t || FieldRenderComponent)(); };
1157
- FieldRenderComponent.ɵcmp = 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) {
1158
- if (rf & 1) {
1159
- i0.ɵɵprojectionDef();
1160
- i0.ɵɵelementStart(0, "div", 0);
1161
- i0.ɵɵelementStart(1, "label", 1);
1162
- i0.ɵɵtext(2);
1163
- i0.ɵɵtemplate(3, FieldRenderComponent_small_3_Template, 2, 4, "small", 2);
1164
- i0.ɵɵtemplate(4, FieldRenderComponent_span_4_Template, 2, 1, "span", 3);
1165
- i0.ɵɵelementEnd();
1166
- i0.ɵɵprojection(5);
1167
- i0.ɵɵelementEnd();
1168
- }
1169
- if (rf & 2) {
1170
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(5, _c0$3, ctx.state && !ctx.state.valid && (!ctx.state.pristine || ctx.state.touched) && ctx.state.errors));
1171
- i0.ɵɵadvance(1);
1172
- i0.ɵɵproperty("htmlFor", ctx.inputId);
1173
- i0.ɵɵadvance(1);
1174
- i0.ɵɵtextInterpolate1(" ", ctx.label, " ");
1175
- i0.ɵɵadvance(1);
1176
- i0.ɵɵproperty("ngIf", ctx.required);
1177
- i0.ɵɵadvance(1);
1178
- i0.ɵɵproperty("ngIf", ctx.tooltip);
1179
- }
1180
- }, directives: [i1.NgClass, i1.NgIf, i4.MatTooltip], styles: [".info-icon[_ngcontent-%COMP%]{color:#222d57;float:right;font-size:13px;margin-left:4px}"] });
1181
- /*@__PURE__*/ (function () {
1182
- i0.ɵsetClassMetadata(FieldRenderComponent, [{
1183
- type: i0.Component,
1184
- args: [{
1185
- selector: 'field-render',
1186
- templateUrl: 'field-render.html',
1187
- styleUrls: ['field-render.scss']
1188
- }]
1189
- }], null, { requiredLabel: [{
1190
- type: i0.Input
1191
- }], label: [{
1192
- type: i0.Input
1193
- }], inputId: [{
1194
- type: i0.Input
1195
- }], tooltip: [{
1196
- type: i0.Input
1197
- }], required: [{
1198
- type: i0.Input
1199
- }], state: [{
1200
- type: i0.Input
1201
- }] });
1202
- })();
1203
-
1204
- var _c0$4 = function () { return { standalone: true }; };
1205
- var NumberInputComponent = /** @class */ (function (_super) {
1206
- __extends(NumberInputComponent, _super);
1207
- function NumberInputComponent() {
1208
- return _super !== null && _super.apply(this, arguments) || this;
1209
- }
1210
- NumberInputComponent.prototype.ngAfterContentInit = function () {
1211
- this.value = this.model;
1212
- };
1213
- NumberInputComponent.prototype.onDropCallBack = function ($event, value) {
1214
- this.value = value = _super.prototype.onDrop.call(this, $event, value);
1215
- this.changeValue(value);
1216
- };
1217
- NumberInputComponent.prototype.changeValue = function ($event) {
1218
- if ($event && !isNaN($event)) {
1219
- this.model = Number($event);
1220
- this.modelChange.emit(this.model);
1221
- }
1222
- else {
1223
- this.model = $event;
1224
- this.modelChange.emit(this.model);
1225
- }
1226
- };
1227
- return NumberInputComponent;
1228
- }(BaseSchemaComponent));
1229
- NumberInputComponent.ɵfac = function NumberInputComponent_Factory(t) { return ɵNumberInputComponent_BaseFactory(t || NumberInputComponent); };
1230
- NumberInputComponent.ɵcmp = 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) {
1231
- if (rf & 1) {
1232
- i0.ɵɵelementStart(0, "input", 0);
1233
- 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); });
1234
- i0.ɵɵelementEnd();
1235
- }
1236
- if (rf & 2) {
1237
- i0.ɵɵproperty("id", ctx.inputId)("placeholder", ctx.placeholder)("ngModel", ctx.value)("ngModelOptions", i0.ɵɵpureFunction0(5, _c0$4))("maxlength", ctx.maxLength);
1238
- }
1239
- }, directives: [i3.DefaultValueAccessor, i2.DndDropzoneDirective, i3.NgControlStatus, i3.NgModel, i3.MaxLengthValidator], encapsulation: 2 });
1240
- var ɵNumberInputComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(NumberInputComponent);
1241
- /*@__PURE__*/ (function () {
1242
- i0.ɵsetClassMetadata(NumberInputComponent, [{
1243
- type: i0.Component,
1244
- args: [{
1245
- selector: 'number-input',
1246
- templateUrl: 'number-input.component.html'
1247
- }]
1248
- }], null, { placeholder: [{
1249
- type: i0.Input
1250
- }], inputId: [{
1251
- type: i0.Input
1252
- }], maxLength: [{
1253
- type: i0.Input
1254
- }] });
1255
- })();
1256
-
1257
- var _c0$5 = function () { return { standalone: true }; };
1258
- var BooleanInputComponent = /** @class */ (function (_super) {
1259
- __extends(BooleanInputComponent, _super);
1260
- function BooleanInputComponent() {
1261
- return _super !== null && _super.apply(this, arguments) || this;
1262
- }
1263
- BooleanInputComponent.prototype.ngAfterContentInit = function () {
1264
- this.value = this.model;
1265
- };
1266
- BooleanInputComponent.prototype.onDropCallBack = function ($event, value) {
1267
- this.value = value = _super.prototype.onDrop.call(this, $event, value);
1268
- this.changeValue(value);
1269
- };
1270
- BooleanInputComponent.prototype.changeValue = function ($event) {
1271
- if ($event && ($event === 'true' || $event === 'false')) {
1272
- this.model = $event === 'true';
1273
- this.value = this.model;
1274
- this.modelChange.emit(this.model);
1275
- }
1276
- else {
1277
- this.model = $event;
1278
- this.value = this.model;
1279
- this.modelChange.emit(this.model);
1280
- }
1281
- };
1282
- return BooleanInputComponent;
1283
- }(BaseSchemaComponent));
1284
- BooleanInputComponent.ɵfac = function BooleanInputComponent_Factory(t) { return ɵBooleanInputComponent_BaseFactory(t || BooleanInputComponent); };
1285
- BooleanInputComponent.ɵcmp = 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) {
1286
- if (rf & 1) {
1287
- i0.ɵɵelementStart(0, "input", 0);
1288
- 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); });
1289
- i0.ɵɵelementEnd();
1290
- }
1291
- if (rf & 2) {
1292
- i0.ɵɵproperty("id", ctx.inputId)("placeholder", ctx.placeholder)("ngModel", ctx.value)("ngModelOptions", i0.ɵɵpureFunction0(5, _c0$5))("maxlength", ctx.maxLength);
1293
- }
1294
- }, directives: [i3.DefaultValueAccessor, i2.DndDropzoneDirective, i3.NgControlStatus, i3.NgModel, i3.MaxLengthValidator], encapsulation: 2 });
1295
- var ɵBooleanInputComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(BooleanInputComponent);
1296
- /*@__PURE__*/ (function () {
1297
- i0.ɵsetClassMetadata(BooleanInputComponent, [{
1298
- type: i0.Component,
1299
- args: [{
1300
- selector: 'boolean-input',
1301
- templateUrl: 'boolean-input.component.html',
1302
- }]
1303
- }], null, { placeholder: [{
1304
- type: i0.Input
1305
- }], inputId: [{
1306
- type: i0.Input
1307
- }], maxLength: [{
1308
- type: i0.Input
1309
- }] });
1310
- })();
1311
-
1312
- function InputRenderComponent_div_1_icon_1_Template(rf, ctx) {
1313
- if (rf & 1) {
1314
- var _r8_1 = i0.ɵɵgetCurrentView();
1315
- i0.ɵɵelementStart(0, "icon", 8);
1316
- i0.ɵɵlistener("onClick", function InputRenderComponent_div_1_icon_1_Template_icon_onClick_0_listener() { i0.ɵɵrestoreView(_r8_1); var ctx_r7 = i0.ɵɵnextContext(2); return ctx_r7.editPassword(); });
1317
- i0.ɵɵelementEnd();
1318
- }
1319
- if (rf & 2) {
1320
- i0.ɵɵproperty("name", "fas fa-pencil-alt");
1321
- }
1322
- }
1323
- function InputRenderComponent_div_1_icon_2_Template(rf, ctx) {
1324
- if (rf & 1) {
1325
- var _r10_1 = i0.ɵɵgetCurrentView();
1326
- i0.ɵɵelementStart(0, "icon", 9);
1327
- i0.ɵɵlistener("mousedown", function InputRenderComponent_div_1_icon_2_Template_icon_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r10_1); var ctx_r9 = i0.ɵɵnextContext(2); ctx_r9.cancelEditPassword(); return $event.stopPropagation(); });
1328
- i0.ɵɵelementEnd();
1329
- }
1330
- if (rf & 2) {
1331
- i0.ɵɵproperty("name", "fas fa-ban");
1332
- }
1333
- }
1334
- function InputRenderComponent_div_1_Template(rf, ctx) {
1335
- if (rf & 1) {
1336
- i0.ɵɵelementStart(0, "div", 5);
1337
- i0.ɵɵtemplate(1, InputRenderComponent_div_1_icon_1_Template, 1, 1, "icon", 6);
1338
- i0.ɵɵtemplate(2, InputRenderComponent_div_1_icon_2_Template, 1, 1, "icon", 7);
1339
- i0.ɵɵelementEnd();
1340
- }
1341
- if (rf & 2) {
1342
- var ctx_r0 = i0.ɵɵnextContext();
1343
- i0.ɵɵadvance(1);
1344
- i0.ɵɵproperty("ngIf", ctx_r0.schema.readOnlyPassword);
1345
- i0.ɵɵadvance(1);
1346
- i0.ɵɵproperty("ngIf", !ctx_r0.schema.readOnlyPassword);
1347
- }
1348
- }
1349
- var _c0$6 = function () { return { standalone: true }; };
1350
- function InputRenderComponent_input_2_Template(rf, ctx) {
1351
- if (rf & 1) {
1352
- var _r12_1 = i0.ɵɵgetCurrentView();
1353
- i0.ɵɵelementStart(0, "input", 10);
1354
- i0.ɵɵlistener("blur", function InputRenderComponent_input_2_Template_input_blur_0_listener() { i0.ɵɵrestoreView(_r12_1); var ctx_r11 = i0.ɵɵnextContext(); return ctx_r11.onInputBlur(); })("ngModelChange", function InputRenderComponent_input_2_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r12_1); var ctx_r13 = i0.ɵɵnextContext(); return ctx_r13.value = $event; })("ngModelChange", function InputRenderComponent_input_2_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r12_1); var ctx_r14 = i0.ɵɵnextContext(); return ctx_r14.onChange($event); })("dndDrop", function InputRenderComponent_input_2_Template_input_dndDrop_0_listener($event) { i0.ɵɵrestoreView(_r12_1); var ctx_r15 = i0.ɵɵnextContext(); return ctx_r15.onDropCallBack($event, ctx_r15.value); });
1355
- i0.ɵɵelementEnd();
1356
- }
1357
- if (rf & 2) {
1358
- var ctx_r1 = i0.ɵɵnextContext();
1359
- i0.ɵɵpropertyInterpolate("placeholder", ctx_r1.schema.type === "password" && ctx_r1.schema.readOnlyPassword ? "*****" : ctx_r1.schema.description);
1360
- i0.ɵɵproperty("disabled", ctx_r1.schema.readOnlyPassword)("type", ctx_r1.schema.type === "password" ? "password" : "text")("ngModel", ctx_r1.value)("ngModelOptions", i0.ɵɵpureFunction0(7, _c0$6))("id", ctx_r1.inputId)("maxlength", ctx_r1.schema.maxLength);
1361
- }
1362
- }
1363
- function InputRenderComponent_select_box_3_Template(rf, ctx) {
1364
- if (rf & 1) {
1365
- var _r17_1 = i0.ɵɵgetCurrentView();
1366
- i0.ɵɵelementStart(0, "select-box", 11);
1367
- i0.ɵɵlistener("ngModelChange", function InputRenderComponent_select_box_3_Template_select_box_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r17_1); var ctx_r16 = i0.ɵɵnextContext(); return ctx_r16.value = $event; })("ngModelChange", function InputRenderComponent_select_box_3_Template_select_box_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r17_1); var ctx_r18 = i0.ɵɵnextContext(); return ctx_r18.onChange($event.key); });
1368
- i0.ɵɵelementEnd();
1369
- }
1370
- if (rf & 2) {
1371
- var ctx_r2 = i0.ɵɵnextContext();
1372
- i0.ɵɵproperty("id", ctx_r2.inputId)("ngModel", ctx_r2.value)("ngModelOptions", i0.ɵɵpureFunction0(12, _c0$6))("placeholder", ctx_r2.schema.description || ctx_r2.selectPlaceHolderLabel)("searchPlaceHolder", ctx_r2.selectSearchPlaceHolderLabel)("clearText", ctx_r2.selectClearLabel)("notFoundText", ctx_r2.selectNotFoundLabel)("bindKey", "key")("bindValue", "value")("enabledSearch", true)("limitItens", 30)("data", ctx_r2.schema.options);
1373
- }
1374
- }
1375
- function InputRenderComponent_number_input_4_Template(rf, ctx) {
1376
- if (rf & 1) {
1377
- var _r20_1 = i0.ɵɵgetCurrentView();
1378
- i0.ɵɵelementStart(0, "number-input", 12);
1379
- i0.ɵɵlistener("modelChange", function InputRenderComponent_number_input_4_Template_number_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r20_1); var ctx_r19 = i0.ɵɵnextContext(); return ctx_r19.value = $event; })("modelChange", function InputRenderComponent_number_input_4_Template_number_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r20_1); var ctx_r21 = i0.ɵɵnextContext(); return ctx_r21.onChange($event); });
1380
- i0.ɵɵelementEnd();
1381
- }
1382
- if (rf & 2) {
1383
- var ctx_r3 = i0.ɵɵnextContext();
1384
- i0.ɵɵproperty("model", ctx_r3.value)("inputId", ctx_r3.inputId)("placeholder", ctx_r3.schema.description)("maxLength", ctx_r3.schema.maxLength);
1385
- }
1386
- }
1387
- function InputRenderComponent_boolean_input_5_Template(rf, ctx) {
1388
- if (rf & 1) {
1389
- var _r23_1 = i0.ɵɵgetCurrentView();
1390
- i0.ɵɵelementStart(0, "boolean-input", 12);
1391
- i0.ɵɵlistener("modelChange", function InputRenderComponent_boolean_input_5_Template_boolean_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r23_1); var ctx_r22 = i0.ɵɵnextContext(); return ctx_r22.value = $event; })("modelChange", function InputRenderComponent_boolean_input_5_Template_boolean_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r23_1); var ctx_r24 = i0.ɵɵnextContext(); return ctx_r24.onChange($event); });
1392
- i0.ɵɵelementEnd();
1393
- }
1394
- if (rf & 2) {
1395
- var ctx_r4 = i0.ɵɵnextContext();
1396
- i0.ɵɵproperty("model", ctx_r4.value)("inputId", ctx_r4.inputId)("placeholder", ctx_r4.schema.description)("maxLength", ctx_r4.schema.maxLength);
1397
- }
1398
- }
1399
- var _c1$2 = function (a0) { return { "schema-input-container-password": a0 }; };
1400
- var InputRenderComponent = /** @class */ (function (_super) {
1401
- __extends(InputRenderComponent, _super);
1402
- function InputRenderComponent() {
1403
- var _this = _super.apply(this, __spread(arguments)) || this;
1404
- _this.selectPlaceHolderLabel = 'Select Item';
1405
- _this.selectSearchPlaceHolderLabel = 'Search';
1406
- _this.selectClearLabel = 'Clear';
1407
- _this.selectNotFoundLabel = 'No Items Found';
1408
- _this.schema = {};
1409
- _this.editing = false;
1410
- _this.onDropEvent = new i0.EventEmitter();
1411
- return _this;
1412
- }
1413
- InputRenderComponent.prototype.ngAfterContentInit = function () {
1414
- var _this = this;
1415
- var _a, _b, _c;
1416
- if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) !== 'object' && ((_b = this.schema) === null || _b === void 0 ? void 0 : _b.type) !== 'array') {
1417
- if (!this.editing && this.schema.options) {
1418
- var $event = this.schema.options.filter(function (item) { return item.selected === true; });
1419
- if ($event[0]) {
1420
- this.onChange($event[0].key);
1421
- this.value = $event[0];
1422
- }
1423
- }
1424
- else if (this.editing && this.schema.options && this.model) {
1425
- var $event = this.schema.options.filter(function (item) { return item.key === _this.model; });
1426
- if ($event[0]) {
1427
- this.onChange($event[0].key);
1428
- this.value = $event[0];
1429
- }
1430
- }
1431
- else {
1432
- this.value = this.model;
1433
- }
1434
- }
1435
- if (this.editing && ((_c = this.schema) === null || _c === void 0 ? void 0 : _c.type) === 'password') {
1436
- this.schema.readOnlyPassword = true;
1437
- }
1438
- };
1439
- InputRenderComponent.prototype.onDropCallBack = function ($event, value) {
1440
- this.value = value = _super.prototype.onDrop.call(this, $event, value);
1441
- this.onChange(value);
1442
- };
1443
- InputRenderComponent.prototype.onChange = function ($event) {
1444
- if (this.schema.type !== 'password' || !this.editing) {
1445
- this.model = $event;
1446
- this.modelChange.emit(this.model);
1447
- }
1448
- };
1449
- InputRenderComponent.prototype.onInputBlur = function () {
1450
- var _a;
1451
- if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) === 'password') {
1452
- this.savePassword();
1453
- }
1454
- };
1455
- InputRenderComponent.prototype.savePassword = function () {
1456
- this.model = this.value || '';
1457
- this.modelChange.emit(this.model);
1458
- this.setReadOnlyPassword(true);
1459
- };
1460
- InputRenderComponent.prototype.cancelEditPassword = function () {
1461
- var _this = this;
1462
- setTimeout(function () {
1463
- _this.value = undefined;
1464
- _this.model = undefined;
1465
- _this.modelChange.emit(_this.model);
1466
- _this.setReadOnlyPassword(true);
1467
- }, 100);
1468
- };
1469
- InputRenderComponent.prototype.editPassword = function () {
1470
- this.setReadOnlyPassword(false);
1471
- };
1472
- InputRenderComponent.prototype.setReadOnlyPassword = function (value) {
1473
- this.schema.readOnlyPassword = value;
1474
- };
1475
- return InputRenderComponent;
1476
- }(BaseSchemaComponent));
1477
- InputRenderComponent.ɵfac = function InputRenderComponent_Factory(t) { return ɵInputRenderComponent_BaseFactory(t || InputRenderComponent); };
1478
- InputRenderComponent.ɵcmp = 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) {
1479
- if (rf & 1) {
1480
- i0.ɵɵelementStart(0, "div", 0);
1481
- i0.ɵɵtemplate(1, InputRenderComponent_div_1_Template, 3, 2, "div", 1);
1482
- i0.ɵɵtemplate(2, InputRenderComponent_input_2_Template, 1, 8, "input", 2);
1483
- i0.ɵɵtemplate(3, InputRenderComponent_select_box_3_Template, 1, 13, "select-box", 3);
1484
- i0.ɵɵtemplate(4, InputRenderComponent_number_input_4_Template, 1, 4, "number-input", 4);
1485
- i0.ɵɵtemplate(5, InputRenderComponent_boolean_input_5_Template, 1, 4, "boolean-input", 4);
1486
- i0.ɵɵelementEnd();
1487
- }
1488
- if (rf & 2) {
1489
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c1$2, ctx.schema.type === "password"));
1490
- i0.ɵɵadvance(1);
1491
- i0.ɵɵproperty("ngIf", ctx.schema.type === "password" && ctx.editing);
1492
- i0.ɵɵadvance(1);
1493
- i0.ɵɵproperty("ngIf", (ctx.schema.type === "string" || ctx.schema.type === "password") && !ctx.schema.options);
1494
- i0.ɵɵadvance(1);
1495
- i0.ɵɵproperty("ngIf", ctx.schema.type === "string" && ctx.schema.options);
1496
- i0.ɵɵadvance(1);
1497
- i0.ɵɵproperty("ngIf", ctx.schema.type === "number");
1498
- i0.ɵɵadvance(1);
1499
- i0.ɵɵproperty("ngIf", ctx.schema.type === "boolean");
1500
- }
1501
- }, directives: [i1.NgClass, i1.NgIf, i2$1.IconComponent, i3.DefaultValueAccessor, i2.DndDropzoneDirective, i3.NgControlStatus, i3.NgModel, i3.MaxLengthValidator, i7.SelectBoxComponent, NumberInputComponent, BooleanInputComponent], styles: [".schema-input-container-password[_ngcontent-%COMP%]{position:relative}.schema-input-container-password[_ngcontent-%COMP%] .edit-icon[_ngcontent-%COMP%]{position:absolute;right:-5px;top:10px;width:30px;z-index:1}.schema-input-container-password[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:block;padding-right:40px!important}"] });
1502
- var ɵInputRenderComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(InputRenderComponent);
1503
- /*@__PURE__*/ (function () {
1504
- i0.ɵsetClassMetadata(InputRenderComponent, [{
1505
- type: i0.Component,
1506
- args: [{
1507
- selector: 'input-render',
1508
- templateUrl: 'input-render.html',
1509
- styleUrls: ['./input-render.scss']
1510
- }]
1511
- }], null, { selectPlaceHolderLabel: [{
1512
- type: i0.Input
1513
- }], selectSearchPlaceHolderLabel: [{
1514
- type: i0.Input
1515
- }], selectClearLabel: [{
1516
- type: i0.Input
1517
- }], selectNotFoundLabel: [{
1518
- type: i0.Input
1519
- }], schema: [{
1520
- type: i0.Input
1521
- }], modelPropertiesPath: [{
1522
- type: i0.Input
1523
- }], inputId: [{
1524
- type: i0.Input
1525
- }], editing: [{
1526
- type: i0.Input
1527
- }], onDropEvent: [{
1528
- type: i0.Output
1529
- }] });
1530
- })();
1531
-
1532
- function SchemaInputComponent_div_0_Template(rf, ctx) {
1533
- if (rf & 1) {
1534
- var _r3_1 = i0.ɵɵgetCurrentView();
1535
- i0.ɵɵelementStart(0, "div", 1);
1536
- i0.ɵɵelementStart(1, "div", 2);
1537
- i0.ɵɵelementStart(2, "field-render", 3);
1538
- i0.ɵɵelementStart(3, "input-render", 4);
1539
- i0.ɵɵlistener("modelChange", function SchemaInputComponent_div_0_Template_input_render_modelChange_3_listener($event) { i0.ɵɵrestoreView(_r3_1); var ctx_r2 = i0.ɵɵnextContext(); return (ctx_r2.model[ctx_r2.schema.id] = $event); });
1540
- i0.ɵɵelementEnd();
1541
- i0.ɵɵelementEnd();
1542
- i0.ɵɵelementEnd();
1543
- i0.ɵɵelementEnd();
1544
- }
1545
- if (rf & 2) {
1546
- var ctx_r0 = i0.ɵɵnextContext();
1547
- i0.ɵɵadvance(2);
1548
- i0.ɵɵproperty("requiredLabel", ctx_r0.requiredLabel)("label", ctx_r0.schema.title)("tooltip", ctx_r0.schema.help)("inputId", ctx_r0.getId(ctx_r0.index));
1549
- i0.ɵɵadvance(1);
1550
- 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);
1551
- }
1552
- }
1553
- function SchemaInputComponent_div_1_span_4_Template(rf, ctx) {
1554
- if (rf & 1) {
1555
- i0.ɵɵelementStart(0, "span", 7);
1556
- i0.ɵɵtext(1, "?");
1557
- i0.ɵɵelementEnd();
1558
- }
1559
- if (rf & 2) {
1560
- var ctx_r4 = i0.ɵɵnextContext(2);
1561
- i0.ɵɵpropertyInterpolate("matTooltip", ctx_r4.schema.help);
1562
- }
1563
- }
1564
- function SchemaInputComponent_div_1_Template(rf, ctx) {
1565
- if (rf & 1) {
1566
- var _r6_1 = i0.ɵɵgetCurrentView();
1567
- i0.ɵɵelementStart(0, "div", 1);
1568
- i0.ɵɵelementStart(1, "div", 2);
1569
- i0.ɵɵelementStart(2, "label", 5);
1570
- i0.ɵɵtext(3);
1571
- i0.ɵɵtemplate(4, SchemaInputComponent_div_1_span_4_Template, 2, 1, "span", 6);
1572
- i0.ɵɵelementEnd();
1573
- i0.ɵɵelementStart(5, "input-render", 4);
1574
- i0.ɵɵlistener("modelChange", function SchemaInputComponent_div_1_Template_input_render_modelChange_5_listener($event) { i0.ɵɵrestoreView(_r6_1); var ctx_r5 = i0.ɵɵnextContext(); return (ctx_r5.model[ctx_r5.schema.id] = $event); });
1575
- i0.ɵɵelementEnd();
1576
- i0.ɵɵelementEnd();
1577
- i0.ɵɵelementEnd();
1578
- }
1579
- if (rf & 2) {
1580
- var ctx_r1 = i0.ɵɵnextContext();
1581
- i0.ɵɵadvance(2);
1582
- i0.ɵɵproperty("htmlFor", ctx_r1.getId(ctx_r1.index));
1583
- i0.ɵɵadvance(1);
1584
- i0.ɵɵtextInterpolate1(" ", ctx_r1.schema.title, " ");
1585
- i0.ɵɵadvance(1);
1586
- i0.ɵɵproperty("ngIf", ctx_r1.schema.help);
1587
- i0.ɵɵadvance(1);
1588
- 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);
1589
- }
1590
- }
1591
- var SchemaInputComponent = /** @class */ (function (_super) {
1592
- __extends(SchemaInputComponent, _super);
1593
- function SchemaInputComponent() {
1594
- var _this = _super.apply(this, __spread(arguments)) || this;
1595
- _this.requiredLabel = '(required)';
1596
- _this.selectPlaceHolderLabel = 'Select Item';
1597
- _this.selectSearchPlaceHolderLabel = 'Search';
1598
- _this.selectClearLabel = 'Clear';
1599
- _this.selectNotFoundLabel = 'No Items Found';
1600
- _this.editing = false;
1601
- return _this;
1602
- }
1603
- SchemaInputComponent.prototype.ngAfterContentInit = function () {
1604
- this.loaded = true;
1605
- };
1606
- SchemaInputComponent.prototype.getId = function (index) {
1607
- return this.idPrefix + "-struct-" + index;
1608
- };
1609
- return SchemaInputComponent;
1610
- }(BaseSchemaComponent));
1611
- SchemaInputComponent.ɵfac = function SchemaInputComponent_Factory(t) { return ɵSchemaInputComponent_BaseFactory(t || SchemaInputComponent); };
1612
- SchemaInputComponent.ɵcmp = i0.ɵɵdefineComponent({ type: SchemaInputComponent, selectors: [["schema-input"]], inputs: { requiredLabel: "requiredLabel", selectPlaceHolderLabel: "selectPlaceHolderLabel", selectSearchPlaceHolderLabel: "selectSearchPlaceHolderLabel", selectClearLabel: "selectClearLabel", selectNotFoundLabel: "selectNotFoundLabel", idPrefix: "idPrefix", schema: "schema", editing: "editing", index: "index" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [["class", "row schema-input", 4, "ngIf"], [1, "row", "schema-input"], [1, "col-md-12"], [3, "requiredLabel", "label", "tooltip", "inputId"], [3, "selectPlaceHolderLabel", "selectSearchPlaceHolderLabel", "selectClearLabel", "selectNotFoundLabel", "inputId", "schema", "model", "modelPropertiesPath", "editing", "modelChange"], [1, "info-label", "bold", 3, "htmlFor"], ["class", "config-tooltip", 3, "matTooltip", 4, "ngIf"], [1, "config-tooltip", 3, "matTooltip"]], template: function SchemaInputComponent_Template(rf, ctx) {
1613
- if (rf & 1) {
1614
- i0.ɵɵtemplate(0, SchemaInputComponent_div_0_Template, 4, 13, "div", 0);
1615
- i0.ɵɵtemplate(1, SchemaInputComponent_div_1_Template, 6, 12, "div", 0);
1616
- }
1617
- if (rf & 2) {
1618
- i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && ctx.schema.minLength && ctx.schema.minLength > 0);
1619
- i0.ɵɵadvance(1);
1620
- i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && (!ctx.schema.minLength || ctx.schema.minLength === 0));
1621
- }
1622
- }, directives: [i1.NgIf, FieldRenderComponent, InputRenderComponent, i4.MatTooltip], styles: [""] });
1623
- var ɵSchemaInputComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(SchemaInputComponent);
1624
- /*@__PURE__*/ (function () {
1625
- i0.ɵsetClassMetadata(SchemaInputComponent, [{
1626
- type: i0.Component,
1627
- args: [{
1628
- selector: 'schema-input',
1629
- templateUrl: 'schema-input.html',
1630
- styleUrls: ['./schema-input.scss']
1631
- }]
1632
- }], null, { requiredLabel: [{
1633
- type: i0.Input
1634
- }], selectPlaceHolderLabel: [{
1635
- type: i0.Input
1636
- }], selectSearchPlaceHolderLabel: [{
1637
- type: i0.Input
1638
- }], selectClearLabel: [{
1639
- type: i0.Input
1640
- }], selectNotFoundLabel: [{
1641
- type: i0.Input
1642
- }], idPrefix: [{
1643
- type: i0.Input
1644
- }], schema: [{
1645
- type: i0.Input
1646
- }], editing: [{
1647
- type: i0.Input
1648
- }], index: [{
1649
- type: i0.Input
1650
- }] });
1651
- })();
1652
-
1653
- function SchemaObjectComponent_div_0_div_4_Template(rf, ctx) {
1654
- if (rf & 1) {
1655
- var _r3_1 = i0.ɵɵgetCurrentView();
1656
- i0.ɵɵelementStart(0, "div", 5);
1657
- i0.ɵɵelementStart(1, "div", 6);
1658
- i0.ɵɵelementStart(2, "label", 7);
1659
- i0.ɵɵtext(3);
1660
- i0.ɵɵelementEnd();
1661
- i0.ɵɵelementStart(4, "schema-custom-attributes", 8);
1662
- i0.ɵɵlistener("modelChange", function SchemaObjectComponent_div_0_div_4_Template_schema_custom_attributes_modelChange_4_listener($event) { i0.ɵɵrestoreView(_r3_1); var ctx_r2 = i0.ɵɵnextContext(2); return ctx_r2.model[ctx_r2.schema.id].customAttributes = $event; });
1663
- i0.ɵɵelementEnd();
1664
- i0.ɵɵelementEnd();
1665
- i0.ɵɵelementEnd();
1666
- }
1667
- if (rf & 2) {
1668
- var ctx_r1 = i0.ɵɵnextContext(2);
1669
- i0.ɵɵadvance(3);
1670
- i0.ɵɵtextInterpolate(ctx_r1.additionalAttributesLabel);
1671
- i0.ɵɵadvance(1);
1672
- 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);
1673
- }
1674
- }
1675
- function SchemaObjectComponent_div_0_Template(rf, ctx) {
1676
- if (rf & 1) {
1677
- var _r5_1 = i0.ɵɵgetCurrentView();
1678
- i0.ɵɵelementStart(0, "div", 1);
1679
- i0.ɵɵelementStart(1, "div", 2);
1680
- i0.ɵɵtext(2);
1681
- i0.ɵɵelementEnd();
1682
- i0.ɵɵelementStart(3, "schema-form", 3);
1683
- i0.ɵɵlistener("modelChange", function SchemaObjectComponent_div_0_Template_schema_form_modelChange_3_listener($event) { i0.ɵɵrestoreView(_r5_1); var ctx_r4 = i0.ɵɵnextContext(); return (ctx_r4.model[ctx_r4.schema.id] = $event); });
1684
- i0.ɵɵelementEnd();
1685
- i0.ɵɵtemplate(4, SchemaObjectComponent_div_0_div_4_Template, 5, 9, "div", 4);
1686
- i0.ɵɵelementEnd();
1687
- }
1688
- if (rf & 2) {
1689
- var ctx_r0 = i0.ɵɵnextContext();
1690
- i0.ɵɵadvance(2);
1691
- i0.ɵɵtextInterpolate(ctx_r0.schema.title);
1692
- i0.ɵɵadvance(1);
1693
- 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);
1694
- i0.ɵɵadvance(1);
1695
- i0.ɵɵproperty("ngIf", ctx_r0.model[ctx_r0.schema.id] && ctx_r0.schema.customProperties);
1696
- }
1697
- }
1698
- var SchemaObjectComponent = /** @class */ (function (_super) {
1699
- __extends(SchemaObjectComponent, _super);
1700
- function SchemaObjectComponent() {
1701
- var _this = _super.apply(this, __spread(arguments)) || this;
1702
- _this.requiredLabel = '(required)';
1703
- _this.addItemLabel = 'Add Item';
1704
- _this.addLoopLabel = 'Add Loop';
1705
- _this.additionalAttributesLabel = 'Additional Fields';
1706
- _this.customAttributeRemoveLabel = 'Remove';
1707
- _this.newCustomFieldNameLabel = 'Name';
1708
- _this.newCustomFieldValueLabel = 'Value';
1709
- _this.newCustomFieldAddLabel = 'Add';
1710
- _this.newCustomFieldSaveLabel = 'Save';
1711
- _this.newCustomFieldCancelLabel = 'Cancel';
1712
- _this.selectPlaceHolderLabel = 'Select Item';
1713
- _this.selectSearchPlaceHolderLabel = 'Search';
1714
- _this.selectClearLabel = 'Clear';
1715
- _this.selectNotFoundLabel = 'No Items Found';
1716
- _this.editing = false;
1717
- _this.onDropEvent = new i0.EventEmitter();
1718
- _this.loaded = false;
1719
- return _this;
1720
- }
1721
- SchemaObjectComponent.prototype.ngAfterContentInit = function () {
1722
- var _a;
1723
- if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) === 'object' && this.model) {
1724
- this.model[this.schema.id] = this.model[this.schema.id] || {};
1725
- }
1726
- this.loaded = true;
1727
- };
1728
- SchemaObjectComponent.prototype.onDrop = function ($event, modelElement) {
1729
- return onDropStruct($event, modelElement);
1730
- };
1731
- return SchemaObjectComponent;
1732
- }(BaseSchemaComponent));
1733
- SchemaObjectComponent.ɵfac = function SchemaObjectComponent_Factory(t) { return ɵSchemaObjectComponent_BaseFactory(t || SchemaObjectComponent); };
1734
- SchemaObjectComponent.ɵcmp = 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) {
1735
- if (rf & 1) {
1736
- i0.ɵɵtemplate(0, SchemaObjectComponent_div_0_Template, 5, 20, "div", 0);
1737
- }
1738
- if (rf & 2) {
1739
- i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type == "object");
1740
- }
1741
- }, directives: [i1.NgIf, SchemaFormComponent, SchemaCustomAttributesComponent], styles: [".schema-object-container[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:5px;margin-bottom:10px;margin-top:10px;padding:10px}.schema-object-container[_ngcontent-%COMP%] .schema-object-title[_ngcontent-%COMP%]{background:#eee;border-bottom:1px solid #ddd;font-weight:700;margin-left:-10px;margin-top:-10px;padding:10px;width:calc(100% + 20px)}"] });
1742
- var ɵSchemaObjectComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(SchemaObjectComponent);
1743
- /*@__PURE__*/ (function () {
1744
- i0.ɵsetClassMetadata(SchemaObjectComponent, [{
1745
- type: i0.Component,
1746
- args: [{
1747
- selector: 'schema-object',
1748
- templateUrl: 'schema-object.html',
1749
- styleUrls: ['./schema-object.scss']
1750
- }]
1751
- }], null, { requiredLabel: [{
1752
- type: i0.Input
1753
- }], addItemLabel: [{
1754
- type: i0.Input
1755
- }], addLoopLabel: [{
1756
- type: i0.Input
1757
- }], additionalAttributesLabel: [{
1758
- type: i0.Input
1759
- }], customAttributeRemoveLabel: [{
1760
- type: i0.Input
1761
- }], newCustomFieldNameLabel: [{
1762
- type: i0.Input
1763
- }], newCustomFieldValueLabel: [{
1764
- type: i0.Input
1765
- }], newCustomFieldAddLabel: [{
1766
- type: i0.Input
1767
- }], newCustomFieldSaveLabel: [{
1768
- type: i0.Input
1769
- }], newCustomFieldCancelLabel: [{
1770
- type: i0.Input
1771
- }], selectPlaceHolderLabel: [{
1772
- type: i0.Input
1773
- }], selectSearchPlaceHolderLabel: [{
1774
- type: i0.Input
1775
- }], selectClearLabel: [{
1776
- type: i0.Input
1777
- }], selectNotFoundLabel: [{
1778
- type: i0.Input
1779
- }], idPrefix: [{
1780
- type: i0.Input
1781
- }], modelPropertiesPath: [{
1782
- type: i0.Input
1783
- }], inputId: [{
1784
- type: i0.Input
1785
- }], editing: [{
1786
- type: i0.Input
1787
- }], index: [{
1788
- type: i0.Input
1789
- }], onDropEvent: [{
1790
- type: i0.Output
1791
- }] });
1792
- })();
1793
-
1794
- var SchemaValidationField = /** @class */ (function () {
1795
- function SchemaValidationField(emptyFields, invalidMinLengthFields, invalidMaxLengthFields) {
1796
- this.emptyFields = emptyFields;
1797
- this.invalidMinLengthFields = invalidMinLengthFields;
1798
- this.invalidMaxLengthFields = invalidMaxLengthFields;
1799
- }
1800
- SchemaValidationField.prototype.isValidSchemaFields = function () {
1801
- var _a, _b, _c;
1802
- return ((_a = this.emptyFields) === null || _a === void 0 ? void 0 : _a.length) < 1 && ((_b = this.invalidMinLengthFields) === null || _b === void 0 ? void 0 : _b.length) < 1 && ((_c = this.invalidMaxLengthFields) === null || _c === void 0 ? void 0 : _c.length) < 1;
1803
- };
1804
- SchemaValidationField.prototype.isInvalidSchemaFields = function () {
1805
- return !this.isValidSchemaFields();
1806
- };
1807
- return SchemaValidationField;
1808
- }());
1809
-
1810
- var SchemaFieldsService = /** @class */ (function () {
1811
- function SchemaFieldsService() {
1812
- }
1813
- SchemaFieldsService.prototype.validateSchemaFields = function (propertiesRendered, model, editing) {
1814
- return __awaiter(this, void 0, void 0, function () {
1815
- var emptyFields, invalidMinLengthFields, invalidMaxLengthFields, structValidationField, _a;
1816
- return __generator(this, function (_b) {
1817
- switch (_b.label) {
1818
- case 0:
1819
- if (!propertiesRendered) {
1820
- return [2 /*return*/, new SchemaValidationField([], [], [])];
1821
- }
1822
- emptyFields = [];
1823
- invalidMinLengthFields = [];
1824
- invalidMaxLengthFields = [];
1825
- this.processProperties(propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1826
- structValidationField = new SchemaValidationField(emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1827
- _a = structValidationField;
1828
- return [4 /*yield*/, this.getErrorsStringArray(structValidationField)];
1829
- case 1:
1830
- _a.validationErrorsLabel = _b.sent();
1831
- return [2 /*return*/, structValidationField];
1832
- }
1833
- });
1834
- });
1835
- };
1836
- SchemaFieldsService.prototype.processProperties = function (propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, recursive) {
1837
- var e_1, _a;
1838
- try {
1839
- for (var propertiesRendered_1 = __values(propertiesRendered), propertiesRendered_1_1 = propertiesRendered_1.next(); !propertiesRendered_1_1.done; propertiesRendered_1_1 = propertiesRendered_1.next()) {
1840
- var property = propertiesRendered_1_1.value;
1841
- if ((property.type === 'object' || property.type === 'array') && property.properties) {
1842
- this.processProperties(property.properties, model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1843
- }
1844
- else if (property.type === 'array' && !property.properties) {
1845
- var newProperty = Object.assign({}, property);
1846
- newProperty.type = 'string';
1847
- this.processProperties([newProperty], model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1848
- }
1849
- else {
1850
- var validateModel = recursive ? model : model[property.id];
1851
- if (property.type !== 'password' || !editing || validateModel !== undefined) {
1852
- if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.minLength) > 0
1853
- && (validateModel === undefined || validateModel === '' || validateModel === null)) {
1854
- emptyFields.push(property);
1855
- }
1856
- else if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.minLength) > 0 && ((validateModel === null || validateModel === void 0 ? void 0 : validateModel.length) < property.minLength)) {
1857
- invalidMinLengthFields.push(property);
1858
- }
1859
- else if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.maxLength) > 0 && ((validateModel === null || validateModel === void 0 ? void 0 : validateModel.length) > property.maxLength)) {
1860
- invalidMaxLengthFields.push(property);
1861
- }
1862
- }
1863
- }
1864
- }
1865
- }
1866
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1867
- finally {
1868
- try {
1869
- if (propertiesRendered_1_1 && !propertiesRendered_1_1.done && (_a = propertiesRendered_1.return)) _a.call(propertiesRendered_1);
1870
- }
1871
- finally { if (e_1) throw e_1.error; }
1872
- }
1873
- };
1874
- SchemaFieldsService.prototype.getErrorsStringArray = function (structValidation) {
1875
- return __awaiter(this, void 0, void 0, function () {
1876
- var errors, _a, _b, field, fieldName, _c, _d, field, fieldName, _e, _f, field, fieldName;
1877
- var e_2, _g, e_3, _h, e_4, _j;
1878
- return __generator(this, function (_k) {
1879
- if (!structValidation.isInvalidSchemaFields()) {
1880
- return [2 /*return*/, []];
1881
- }
1882
- errors = [];
1883
- try {
1884
- for (_a = __values(structValidation.emptyFields), _b = _a.next(); !_b.done; _b = _a.next()) {
1885
- field = _b.value;
1886
- fieldName = field.title || field.id;
1887
- errors.push({
1888
- type: 'emptyFields',
1889
- fieldName: fieldName
1890
- });
1891
- }
1892
- }
1893
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
1894
- finally {
1895
- try {
1896
- if (_b && !_b.done && (_g = _a.return)) _g.call(_a);
1897
- }
1898
- finally { if (e_2) throw e_2.error; }
1899
- }
1900
- try {
1901
- for (_c = __values(structValidation.invalidMinLengthFields), _d = _c.next(); !_d.done; _d = _c.next()) {
1902
- field = _d.value;
1903
- fieldName = field.title || field.id;
1904
- errors.push({
1905
- type: 'invalidMinLengthFields',
1906
- fieldName: fieldName,
1907
- minLength: field.minLength
1908
- });
1909
- }
1910
- }
1911
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
1912
- finally {
1913
- try {
1914
- if (_d && !_d.done && (_h = _c.return)) _h.call(_c);
1915
- }
1916
- finally { if (e_3) throw e_3.error; }
1917
- }
1918
- try {
1919
- for (_e = __values(structValidation.invalidMaxLengthFields), _f = _e.next(); !_f.done; _f = _e.next()) {
1920
- field = _f.value;
1921
- fieldName = field.title || field.id;
1922
- errors.push({
1923
- type: 'invalidMaxLengthFields',
1924
- fieldName: fieldName,
1925
- maxLength: field.maxLength
1926
- });
1927
- }
1928
- }
1929
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
1930
- finally {
1931
- try {
1932
- if (_f && !_f.done && (_j = _e.return)) _j.call(_e);
1933
- }
1934
- finally { if (e_4) throw e_4.error; }
1935
- }
1936
- return [2 /*return*/, errors];
1937
- });
1938
- });
1939
- };
1940
- return SchemaFieldsService;
1941
- }());
1942
- SchemaFieldsService.ɵfac = function SchemaFieldsService_Factory(t) { return new (t || SchemaFieldsService)(); };
1943
- SchemaFieldsService.ɵprov = i0.ɵɵdefineInjectable({ token: SchemaFieldsService, factory: SchemaFieldsService.ɵfac });
1944
- /*@__PURE__*/ (function () {
1945
- i0.ɵsetClassMetadata(SchemaFieldsService, [{
1946
- type: i0.Injectable
1947
- }], function () { return []; }, null);
1948
- })();
1949
-
1950
- function SchemaFormRenderComponent_div_0_div_2_div_1_Template(rf, ctx) {
1951
- if (rf & 1) {
1952
- var _r6_1 = i0.ɵɵgetCurrentView();
1953
- i0.ɵɵelementStart(0, "div", 6);
1954
- i0.ɵɵelementStart(1, "div", 7);
1955
- i0.ɵɵelementStart(2, "label", 8);
1956
- i0.ɵɵtext(3);
1957
- i0.ɵɵelementEnd();
1958
- i0.ɵɵelementStart(4, "schema-custom-attributes", 9);
1959
- i0.ɵɵlistener("modelChange", function SchemaFormRenderComponent_div_0_div_2_div_1_Template_schema_custom_attributes_modelChange_4_listener($event) { i0.ɵɵrestoreView(_r6_1); var ctx_r5 = i0.ɵɵnextContext(3); return ctx_r5.model.customAttributes = $event; });
1960
- i0.ɵɵelementEnd();
1961
- i0.ɵɵelementEnd();
1962
- i0.ɵɵelementEnd();
1963
- }
1964
- if (rf & 2) {
1965
- var ctx_r4 = i0.ɵɵnextContext(3);
1966
- i0.ɵɵadvance(3);
1967
- i0.ɵɵtextInterpolate(ctx_r4.additionalAttributesLabel);
1968
- i0.ɵɵadvance(1);
1969
- 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);
1970
- }
1971
- }
1972
- function SchemaFormRenderComponent_div_0_div_2_Template(rf, ctx) {
1973
- if (rf & 1) {
1974
- i0.ɵɵelementStart(0, "div", 4);
1975
- i0.ɵɵtemplate(1, SchemaFormRenderComponent_div_0_div_2_div_1_Template, 5, 9, "div", 5);
1976
- i0.ɵɵelementEnd();
1977
- }
1978
- if (rf & 2) {
1979
- var ctx_r1 = i0.ɵɵnextContext(2);
1980
- i0.ɵɵadvance(1);
1981
- i0.ɵɵproperty("ngIf", ctx_r1.model && ctx_r1.customProperties);
1982
- }
1983
- }
1984
- function SchemaFormRenderComponent_div_0_Template(rf, ctx) {
1985
- if (rf & 1) {
1986
- var _r8_1 = i0.ɵɵgetCurrentView();
1987
- i0.ɵɵelementStart(0, "div", 1);
1988
- i0.ɵɵelementStart(1, "schema-form", 2);
1989
- i0.ɵɵlistener("modelChange", function SchemaFormRenderComponent_div_0_Template_schema_form_modelChange_1_listener($event) { i0.ɵɵrestoreView(_r8_1); var ctx_r7 = i0.ɵɵnextContext(); return ctx_r7.model = $event; });
1990
- i0.ɵɵelementEnd();
1991
- i0.ɵɵtemplate(2, SchemaFormRenderComponent_div_0_div_2_Template, 2, 1, "div", 3);
1992
- i0.ɵɵelementEnd();
1993
- }
1994
- if (rf & 2) {
1995
- var ctx_r0 = i0.ɵɵnextContext();
1996
- i0.ɵɵadvance(1);
1997
- 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);
1998
- i0.ɵɵadvance(1);
1999
- i0.ɵɵproperty("ngForOf", ctx_r0.schemas);
2000
- }
2001
- }
2002
- var SchemaFormRenderComponent = /** @class */ (function (_super) {
2003
- __extends(SchemaFormRenderComponent, _super);
2004
- function SchemaFormRenderComponent() {
2005
- var _this = _super.apply(this, __spread(arguments)) || this;
2006
- _this.requiredLabel = '(required)';
2007
- _this.addItemLabel = 'Add Item';
2008
- _this.addLoopLabel = 'Add Loop';
2009
- _this.additionalAttributesLabel = 'Additional Fields';
2010
- _this.customAttributeRemoveLabel = 'Remove';
2011
- _this.newCustomFieldNameLabel = 'Name';
2012
- _this.newCustomFieldValueLabel = 'Value';
2013
- _this.newCustomFieldAddLabel = 'Add';
2014
- _this.newCustomFieldSaveLabel = 'Save';
2015
- _this.newCustomFieldCancelLabel = 'Cancel';
2016
- _this.selectPlaceHolderLabel = 'Select Item';
2017
- _this.selectSearchPlaceHolderLabel = 'Search';
2018
- _this.selectClearLabel = 'Clear';
2019
- _this.selectNotFoundLabel = 'No Items Found';
2020
- _this.schemas = [];
2021
- _this.customProperties = false;
2022
- _this.editing = false;
2023
- _this.loaded = false;
2024
- return _this;
2025
- }
2026
- SchemaFormRenderComponent.prototype.ngAfterContentInit = function () {
2027
- this.loaded = true;
2028
- };
2029
- SchemaFormRenderComponent.prototype.onDrop = function ($event, modelElement) {
2030
- return onDropStruct($event, modelElement);
2031
- };
2032
- SchemaFormRenderComponent.prototype.getId = function (index) {
2033
- return this.idPrefix + "-struct-" + index;
2034
- };
2035
- return SchemaFormRenderComponent;
2036
- }(BaseSchemaComponent));
2037
- SchemaFormRenderComponent.ɵfac = function SchemaFormRenderComponent_Factory(t) { return ɵSchemaFormRenderComponent_BaseFactory(t || SchemaFormRenderComponent); };
2038
- SchemaFormRenderComponent.ɵcmp = 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) {
2039
- if (rf & 1) {
2040
- i0.ɵɵtemplate(0, SchemaFormRenderComponent_div_0_Template, 3, 19, "div", 0);
2041
- }
2042
- if (rf & 2) {
2043
- i0.ɵɵproperty("ngIf", ctx.loaded);
2044
- }
2045
- }, directives: [i1.NgIf, SchemaFormComponent, i1.NgForOf, SchemaCustomAttributesComponent], styles: [".schema[_ngcontent-%COMP%] .info-label{display:block}.schema[_ngcontent-%COMP%] input.form-control{background:#fff;border:1px solid #ddd;border-radius:3px;padding:11px;width:100%}.schema[_ngcontent-%COMP%] input.form-control:disabled{background:#ccc}.schema[_ngcontent-%COMP%] select.form-control{border:1px solid #ddd;border-radius:4px;color:#777;cursor:pointer;padding:11px;width:100%}.schema[_ngcontent-%COMP%] .ng-select-container{height:38px!important;min-height:38px!important}.schema[_ngcontent-%COMP%] .btn-outline-primary{background:var(--color-primary);border:1px solid var(--color-secondary);border-radius:4px;color:var(--color-secondary);cursor:pointer;padding:5px 15px}.schema[_ngcontent-%COMP%] .btn-outline-primary:hover{background:var(--color-primary-hover)}.schema[_ngcontent-%COMP%] .subsection-item-title, .schema[_ngcontent-%COMP%] array-session .subsection-element{color:var(--color-primary)}"] });
2046
- var ɵSchemaFormRenderComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(SchemaFormRenderComponent);
2047
- /*@__PURE__*/ (function () {
2048
- i0.ɵsetClassMetadata(SchemaFormRenderComponent, [{
2049
- type: i0.Component,
2050
- args: [{
2051
- selector: 'schema-form-render',
2052
- templateUrl: 'schema-form-render.html',
2053
- styleUrls: ['./schema-form-render.scss']
2054
- }]
2055
- }], null, { requiredLabel: [{
2056
- type: i0.Input
2057
- }], addItemLabel: [{
2058
- type: i0.Input
2059
- }], addLoopLabel: [{
2060
- type: i0.Input
2061
- }], additionalAttributesLabel: [{
2062
- type: i0.Input
2063
- }], customAttributeRemoveLabel: [{
2064
- type: i0.Input
2065
- }], newCustomFieldNameLabel: [{
2066
- type: i0.Input
2067
- }], newCustomFieldValueLabel: [{
2068
- type: i0.Input
2069
- }], newCustomFieldAddLabel: [{
2070
- type: i0.Input
2071
- }], newCustomFieldSaveLabel: [{
2072
- type: i0.Input
2073
- }], newCustomFieldCancelLabel: [{
2074
- type: i0.Input
2075
- }], selectPlaceHolderLabel: [{
2076
- type: i0.Input
2077
- }], selectSearchPlaceHolderLabel: [{
2078
- type: i0.Input
2079
- }], selectClearLabel: [{
2080
- type: i0.Input
2081
- }], selectNotFoundLabel: [{
2082
- type: i0.Input
2083
- }], idPrefix: [{
2084
- type: i0.Input
2085
- }], schemas: [{
2086
- type: i0.Input
2087
- }], customProperties: [{
2088
- type: i0.Input
2089
- }], editing: [{
2090
- type: i0.Input
2091
- }], inputType: [{
2092
- type: i0.Input
2093
- }] });
2094
- })();
2095
-
2096
- var TypeScriptCompileBase = /** @class */ (function () {
2097
- function TypeScriptCompileBase() {
2098
- }
2099
- TypeScriptCompileBase.prototype.getTranslate = function (text) {
2100
- return text;
2101
- };
2102
- TypeScriptCompileBase.prototype.addItemToFormProperties = function (formProperties, item, key) {
2103
- this.translateProperties(item);
2104
- if (item.minLength && item.minLength > 0) {
2105
- formProperties[key] = new i3.FormControl([null, [i3.Validators.required]]);
2106
- }
2107
- else {
2108
- formProperties[key] = new i3.FormControl([null]);
2109
- }
2110
- };
2111
- TypeScriptCompileBase.prototype.compileProperties = function (input) {
2112
- var compiledProperties = [];
2113
- var formProperties = {};
2114
- var inputData = {};
2115
- var inputToCompile = JSON.parse(JSON.stringify(input));
2116
- this.translateProperties(inputToCompile);
2117
- if (inputToCompile.properties) {
2118
- if (inputToCompile.type === 'array') {
2119
- inputData = [];
2120
- }
2121
- if (inputToCompile.type === 'object') {
2122
- inputData = {};
2123
- }
2124
- inputToCompile.id = 'inputData';
2125
- this.proccessProperties(inputToCompile, formProperties, 'inputData');
2126
- this.translateProperties(inputToCompile);
2127
- compiledProperties.push(inputToCompile);
2128
- }
2129
- else if (inputToCompile.type === 'array') {
2130
- inputToCompile.id = 'inputData';
2131
- inputData = [];
2132
- this.addItemToFormProperties(formProperties, inputToCompile, 'inputData');
2133
- compiledProperties.push(inputToCompile);
2134
- }
2135
- else if (!inputToCompile.type) {
2136
- for (var index = 0; index < Object.keys(inputToCompile).length; index++) {
2137
- var key = Object.keys(inputToCompile)[index];
2138
- var item = inputToCompile[key];
2139
- item.id = key;
2140
- if (item.type === 'array') {
2141
- inputData[item.id] = [];
2142
- }
2143
- if (item.type === 'object') {
2144
- inputData[item.id] = {};
2145
- }
2146
- this.proccessProperties(item, formProperties, key);
2147
- this.translateProperties(item);
2148
- compiledProperties.push(item);
2149
- }
2150
- }
2151
- compiledProperties.sort(function (a, b) { return a.propertyOrder - b.propertyOrder; });
2152
- return { compiledProperties: compiledProperties, formProperties: formProperties, inputData: inputData };
2153
- };
2154
- TypeScriptCompileBase.prototype.translateProperties = function (input) {
2155
- var _this = this;
2156
- if (input === null || input === void 0 ? void 0 : input.title) {
2157
- input.title = this.getTranslate(input.title);
2158
- }
2159
- if (input === null || input === void 0 ? void 0 : input.description) {
2160
- input.description = this.getTranslate(input.description);
2161
- }
2162
- if ((input === null || input === void 0 ? void 0 : input.options) instanceof Array) {
2163
- input === null || input === void 0 ? void 0 : input.options.forEach(function (option) { return option.value = _this.getTranslate(option.value); });
2164
- }
2165
- };
2166
- TypeScriptCompileBase.prototype.proccessProperties = function (item, formProperties, key) {
2167
- this.translateProperties(item);
2168
- if (this.hasProperties(item)) {
2169
- var arFieldsChild = [];
2170
- for (var indexChild = 0; indexChild < Object.keys(item.properties).length; indexChild++) {
2171
- var keyChild = Object.keys(item.properties)[indexChild];
2172
- var itemChild = item.properties[keyChild];
2173
- itemChild.id = keyChild;
2174
- if (this.hasProperties(itemChild)) {
2175
- this.proccessProperties(itemChild, formProperties, keyChild);
2176
- arFieldsChild.push(itemChild);
2177
- }
2178
- else {
2179
- this.addItemToFormProperties(formProperties, itemChild, keyChild);
2180
- arFieldsChild.push(itemChild);
2181
- }
2182
- }
2183
- item.properties = arFieldsChild;
2184
- }
2185
- else {
2186
- this.addItemToFormProperties(formProperties, item, key);
2187
- }
2188
- };
2189
- TypeScriptCompileBase.prototype.hasProperties = function (item) {
2190
- return item.type === 'object' || (item.type === 'array' && item.properties);
2191
- };
2192
- return TypeScriptCompileBase;
2193
- }());
2194
- TypeScriptCompileBase.ɵfac = function TypeScriptCompileBase_Factory(t) { return new (t || TypeScriptCompileBase)(); };
2195
- TypeScriptCompileBase.ɵprov = i0.ɵɵdefineInjectable({ token: TypeScriptCompileBase, factory: TypeScriptCompileBase.ɵfac, providedIn: 'root' });
2196
- /*@__PURE__*/ (function () {
2197
- i0.ɵsetClassMetadata(TypeScriptCompileBase, [{
2198
- type: i0.Injectable,
2199
- args: [{ providedIn: 'root' }]
2200
- }], null, null);
2201
- })();
2202
- function APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY(parentIntl) {
2203
- return parentIntl || new TypeScriptCompileBase();
2204
- }
2205
- var APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER = {
2206
- provide: TypeScriptCompileBase,
2207
- deps: [[new i0.Optional(), new i0.SkipSelf(), TypeScriptCompileBase]],
2208
- useFactory: APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY,
2209
- };
2210
-
2211
- var SchemaFormRenderModule = /** @class */ (function () {
2212
- function SchemaFormRenderModule() {
2213
- }
2214
- return SchemaFormRenderModule;
2215
- }());
2216
- SchemaFormRenderModule.ɵmod = i0.ɵɵdefineNgModule({ type: SchemaFormRenderModule });
2217
- SchemaFormRenderModule.ɵinj = i0.ɵɵdefineInjector({ factory: function SchemaFormRenderModule_Factory(t) { return new (t || SchemaFormRenderModule)(); }, providers: [
2218
- SchemaFieldsService,
2219
- APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER
2220
- ], imports: [[
2221
- i1.CommonModule,
2222
- i2.DndModule,
2223
- i3.FormsModule,
2224
- i4.MatTooltipModule,
2225
- i7.InputsModule,
2226
- i2$1.IconsModule
2227
- ]] });
2228
- (function () {
2229
- (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(SchemaFormRenderModule, { declarations: [ArraySessionComponent,
2230
- SchemaArrayComponent,
2231
- FieldRenderComponent,
2232
- InputRenderComponent,
2233
- BooleanInputComponent,
2234
- NumberInputComponent,
2235
- SchemaInputComponent,
2236
- SchemaObjectComponent,
2237
- SchemaFormRenderComponent,
2238
- SchemaFormComponent,
2239
- SchemaCustomAttributesComponent], imports: [i1.CommonModule,
2240
- i2.DndModule,
2241
- i3.FormsModule,
2242
- i4.MatTooltipModule,
2243
- i7.InputsModule,
2244
- i2$1.IconsModule], exports: [ArraySessionComponent,
2245
- SchemaArrayComponent,
2246
- FieldRenderComponent,
2247
- InputRenderComponent,
2248
- BooleanInputComponent,
2249
- NumberInputComponent,
2250
- SchemaInputComponent,
2251
- SchemaObjectComponent,
2252
- SchemaFormRenderComponent,
2253
- SchemaFormComponent,
2254
- SchemaCustomAttributesComponent] });
2255
- })();
2256
- /*@__PURE__*/ (function () {
2257
- i0.ɵsetClassMetadata(SchemaFormRenderModule, [{
2258
- type: i0.NgModule,
2259
- args: [{
2260
- imports: [
2261
- i1.CommonModule,
2262
- i2.DndModule,
2263
- i3.FormsModule,
2264
- i4.MatTooltipModule,
2265
- i7.InputsModule,
2266
- i2$1.IconsModule
2267
- ],
2268
- declarations: [
2269
- ArraySessionComponent,
2270
- SchemaArrayComponent,
2271
- FieldRenderComponent,
2272
- InputRenderComponent,
2273
- BooleanInputComponent,
2274
- NumberInputComponent,
2275
- SchemaInputComponent,
2276
- SchemaObjectComponent,
2277
- SchemaFormRenderComponent,
2278
- SchemaFormComponent,
2279
- SchemaCustomAttributesComponent
2280
- ],
2281
- exports: [
2282
- ArraySessionComponent,
2283
- SchemaArrayComponent,
2284
- FieldRenderComponent,
2285
- InputRenderComponent,
2286
- BooleanInputComponent,
2287
- NumberInputComponent,
2288
- SchemaInputComponent,
2289
- SchemaObjectComponent,
2290
- SchemaFormRenderComponent,
2291
- SchemaFormComponent,
2292
- SchemaCustomAttributesComponent
2293
- ],
2294
- providers: [
2295
- SchemaFieldsService,
2296
- APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER
2297
- ]
2298
- }]
2299
- }], null, null);
2300
- })();
2301
- i0.ɵɵsetComponentScope(SchemaFormComponent, [i1.NgClass, i1.NgComponentOutlet, i1.NgForOf, i1.NgIf, i1.NgTemplateOutlet, i1.NgStyle, i1.NgSwitch, i1.NgSwitchCase, i1.NgSwitchDefault, i1.NgPlural, i1.NgPluralCase, i2.DndDraggableDirective, i2.DndDropzoneDirective, i2.DndHandleDirective, i2.DndPlaceholderRefDirective, i2.DndDragImageRefDirective, i3.ɵangular_packages_forms_forms_y, i3.NgSelectOption, i3.ɵangular_packages_forms_forms_x, i3.DefaultValueAccessor, i3.NumberValueAccessor, i3.RangeValueAccessor, i3.CheckboxControlValueAccessor, i3.SelectControlValueAccessor, i3.SelectMultipleControlValueAccessor, i3.RadioControlValueAccessor, i3.NgControlStatus, i3.NgControlStatusGroup, i3.RequiredValidator, i3.MinLengthValidator, i3.MaxLengthValidator, i3.PatternValidator, i3.CheckboxRequiredValidator, i3.EmailValidator, i3.NgModel, i3.NgModelGroup, i3.NgForm, i4.MatTooltip, i4.TooltipComponent, i5.Dir, i6.CdkScrollable, i7.SelectBoxComponent, i7.SelectEnumComponent, i7.InputTextComponent, i7.InputPasswordComponent, i7.InputAvatarComponent, i7.InputFileComponent, i7.CustomSelectComponent, i7.FieldComponent, i2$1.IconComponent, ArraySessionComponent,
2302
- SchemaArrayComponent,
2303
- FieldRenderComponent,
2304
- InputRenderComponent,
2305
- BooleanInputComponent,
2306
- NumberInputComponent,
2307
- SchemaInputComponent,
2308
- SchemaObjectComponent,
2309
- SchemaFormRenderComponent,
2310
- SchemaFormComponent,
2311
- SchemaCustomAttributesComponent], [i1.AsyncPipe, i1.UpperCasePipe, i1.LowerCasePipe, i1.JsonPipe, i1.SlicePipe, i1.DecimalPipe, i1.PercentPipe, i1.TitleCasePipe, i1.CurrencyPipe, i1.DatePipe, i1.I18nPluralPipe, i1.I18nSelectPipe, i1.KeyValuePipe]);
2312
-
2313
- /**
2314
- * Generated bundle index. Do not edit.
2315
- */
2316
-
2317
- exports.APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY = APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY;
2318
- exports.APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER = APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER;
2319
- exports.ArraySessionComponent = ArraySessionComponent;
2320
- exports.BaseSchemaComponent = BaseSchemaComponent;
2321
- exports.BooleanInputComponent = BooleanInputComponent;
2322
- exports.FieldRenderComponent = FieldRenderComponent;
2323
- exports.InputRenderComponent = InputRenderComponent;
2324
- exports.NumberInputComponent = NumberInputComponent;
2325
- exports.SchemaArrayComponent = SchemaArrayComponent;
2326
- exports.SchemaCustomAttributesComponent = SchemaCustomAttributesComponent;
2327
- exports.SchemaFieldsService = SchemaFieldsService;
2328
- exports.SchemaFormComponent = SchemaFormComponent;
2329
- exports.SchemaFormRenderComponent = SchemaFormRenderComponent;
2330
- exports.SchemaFormRenderModule = SchemaFormRenderModule;
2331
- exports.SchemaInputComponent = SchemaInputComponent;
2332
- exports.SchemaObjectComponent = SchemaObjectComponent;
2333
- exports.SchemaValidationField = SchemaValidationField;
2334
- exports.TypeScriptCompileBase = TypeScriptCompileBase;
2335
-
2336
- Object.defineProperty(exports, '__esModule', { value: true });
2337
-
2338
- })));
2339
- //# sourceMappingURL=apipass-schemas.umd.js.map