@apipass/schemas 0.2.15 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +33 -33
  2. package/assets/css/buttons.scss +118 -118
  3. package/assets/css/colors.scss +34 -34
  4. package/assets/css/fonts.scss +24 -24
  5. package/assets/css/inputs.scss +197 -197
  6. package/assets/css/pt_sans.scss +143 -143
  7. package/assets/css/spacing.scss +28 -28
  8. package/assets/css/texts.scss +18 -18
  9. package/base-schema.component.d.ts +12 -12
  10. package/{esm2015/apipass-schemas.js → esm2020/apipass-schemas.mjs} +4 -4
  11. package/esm2020/base-schema.component.mjs +38 -0
  12. package/{esm2015/public-api.js → esm2020/public-api.mjs} +17 -17
  13. package/esm2020/schema-custom-attributes/schema-custom-attributes.mjs +169 -0
  14. package/esm2020/schema-fields.service.mjs +82 -0
  15. package/esm2020/schema-form/schema-array/array-session/array-session.mjs +143 -0
  16. package/esm2020/schema-form/schema-array/schema-array.mjs +220 -0
  17. package/esm2020/schema-form/schema-form.mjs +107 -0
  18. package/esm2020/schema-form/schema-input/field-render/field-render.mjs +69 -0
  19. package/esm2020/schema-form/schema-input/input-render/boolean-input/boolean-input.component.mjs +46 -0
  20. package/esm2020/schema-form/schema-input/input-render/input-render.mjs +192 -0
  21. package/esm2020/schema-form/schema-input/input-render/number-input/number-input.component.mjs +44 -0
  22. package/esm2020/schema-form/schema-input/schema-input.mjs +96 -0
  23. package/esm2020/schema-form/schema-object/schema-object.mjs +123 -0
  24. package/esm2020/schema-form-render.mjs +126 -0
  25. package/esm2020/schema-form-render.module.mjs +108 -0
  26. package/esm2020/schema-validation-field.mjs +14 -0
  27. package/{esm2015/struct.utils.js → esm2020/struct.utils.mjs} +9 -9
  28. package/esm2020/type-script-compile/type-script-compile.base.mjs +112 -0
  29. package/fesm2015/apipass-schemas.mjs +1803 -0
  30. package/fesm2015/apipass-schemas.mjs.map +1 -0
  31. package/fesm2020/apipass-schemas.mjs +1618 -0
  32. package/fesm2020/apipass-schemas.mjs.map +1 -0
  33. package/{apipass-schemas.d.ts → index.d.ts} +5 -5
  34. package/package.json +32 -19
  35. package/public-api.d.ts +16 -16
  36. package/schema-custom-attributes/schema-custom-attributes.d.ts +21 -21
  37. package/schema-fields.service.d.ts +15 -15
  38. package/schema-form/schema-array/array-session/array-session.d.ts +19 -19
  39. package/schema-form/schema-array/schema-array.d.ts +32 -32
  40. package/schema-form/schema-form.d.ts +31 -31
  41. package/schema-form/schema-input/field-render/field-render.d.ts +16 -16
  42. package/schema-form/schema-input/input-render/boolean-input/boolean-input.component.d.ts +15 -15
  43. package/schema-form/schema-input/input-render/input-render.d.ts +29 -29
  44. package/schema-form/schema-input/input-render/number-input/number-input.component.d.ts +15 -15
  45. package/schema-form/schema-input/schema-input.d.ts +19 -19
  46. package/schema-form/schema-object/schema-object.d.ts +34 -34
  47. package/schema-form-render.d.ts +31 -31
  48. package/schema-form-render.module.d.ts +23 -22
  49. package/schema-validation-field.d.ts +23 -23
  50. package/struct.utils.d.ts +1 -1
  51. package/type-script-compile/type-script-compile.base.d.ts +17 -17
  52. package/bundles/apipass-schemas.umd.js +0 -2312
  53. package/bundles/apipass-schemas.umd.js.map +0 -1
  54. package/bundles/apipass-schemas.umd.min.js +0 -16
  55. package/bundles/apipass-schemas.umd.min.js.map +0 -1
  56. package/esm2015/base-schema.component.js +0 -38
  57. package/esm2015/schema-custom-attributes/schema-custom-attributes.js +0 -192
  58. package/esm2015/schema-fields.service.js +0 -87
  59. package/esm2015/schema-form/schema-array/array-session/array-session.js +0 -161
  60. package/esm2015/schema-form/schema-array/schema-array.js +0 -234
  61. package/esm2015/schema-form/schema-form.js +0 -114
  62. package/esm2015/schema-form/schema-input/field-render/field-render.js +0 -74
  63. package/esm2015/schema-form/schema-input/input-render/boolean-input/boolean-input.component.js +0 -50
  64. package/esm2015/schema-form/schema-input/input-render/input-render.js +0 -179
  65. package/esm2015/schema-form/schema-input/input-render/number-input/number-input.component.js +0 -48
  66. package/esm2015/schema-form/schema-input/schema-input.js +0 -111
  67. package/esm2015/schema-form/schema-object/schema-object.js +0 -134
  68. package/esm2015/schema-form-render.js +0 -136
  69. package/esm2015/schema-form-render.module.js +0 -124
  70. package/esm2015/schema-validation-field.js +0 -15
  71. package/esm2015/type-script-compile/type-script-compile.base.js +0 -112
  72. package/fesm2015/apipass-schemas.js +0 -1725
  73. package/fesm2015/apipass-schemas.js.map +0 -1
@@ -1,2312 +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_Template(rf, ctx) {
1313
- if (rf & 1) {
1314
- var _r6_1 = i0.ɵɵgetCurrentView();
1315
- i0.ɵɵelementStart(0, "div", 5);
1316
- i0.ɵɵelementStart(1, "icon", 6);
1317
- i0.ɵɵlistener("onClick", function InputRenderComponent_div_1_Template_icon_onClick_1_listener() { i0.ɵɵrestoreView(_r6_1); var ctx_r5 = i0.ɵɵnextContext(); return ctx_r5.schema.readOnlyPassword ? ctx_r5.editPassword() : ctx_r5.cancelEditPassword(); });
1318
- i0.ɵɵelementEnd();
1319
- i0.ɵɵelementEnd();
1320
- }
1321
- if (rf & 2) {
1322
- var ctx_r0 = i0.ɵɵnextContext();
1323
- i0.ɵɵadvance(1);
1324
- i0.ɵɵproperty("name", ctx_r0.schema.readOnlyPassword ? "fas fa-pencil-alt" : "fas fa-ban");
1325
- }
1326
- }
1327
- var _c0$6 = function () { return { standalone: true }; };
1328
- function InputRenderComponent_input_2_Template(rf, ctx) {
1329
- if (rf & 1) {
1330
- var _r8_1 = i0.ɵɵgetCurrentView();
1331
- i0.ɵɵelementStart(0, "input", 7);
1332
- i0.ɵɵlistener("blur", function InputRenderComponent_input_2_Template_input_blur_0_listener() { i0.ɵɵrestoreView(_r8_1); var ctx_r7 = i0.ɵɵnextContext(); return ctx_r7.onInputBlur(); })("ngModelChange", function InputRenderComponent_input_2_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r8_1); var ctx_r9 = i0.ɵɵnextContext(); return ctx_r9.value = $event; })("ngModelChange", function InputRenderComponent_input_2_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r8_1); var ctx_r10 = i0.ɵɵnextContext(); return ctx_r10.onChange($event); })("dndDrop", function InputRenderComponent_input_2_Template_input_dndDrop_0_listener($event) { i0.ɵɵrestoreView(_r8_1); var ctx_r11 = i0.ɵɵnextContext(); return ctx_r11.onDropCallBack($event, ctx_r11.value); });
1333
- i0.ɵɵelementEnd();
1334
- }
1335
- if (rf & 2) {
1336
- var ctx_r1 = i0.ɵɵnextContext();
1337
- i0.ɵɵpropertyInterpolate("placeholder", ctx_r1.schema.type === "password" && ctx_r1.schema.readOnlyPassword ? "*****" : ctx_r1.schema.description);
1338
- 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);
1339
- }
1340
- }
1341
- function InputRenderComponent_select_box_3_Template(rf, ctx) {
1342
- if (rf & 1) {
1343
- var _r13_1 = i0.ɵɵgetCurrentView();
1344
- i0.ɵɵelementStart(0, "select-box", 8);
1345
- i0.ɵɵlistener("ngModelChange", function InputRenderComponent_select_box_3_Template_select_box_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r13_1); var ctx_r12 = i0.ɵɵnextContext(); return ctx_r12.value = $event; })("ngModelChange", function InputRenderComponent_select_box_3_Template_select_box_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r13_1); var ctx_r14 = i0.ɵɵnextContext(); return ctx_r14.onChange($event.key); });
1346
- i0.ɵɵelementEnd();
1347
- }
1348
- if (rf & 2) {
1349
- var ctx_r2 = i0.ɵɵnextContext();
1350
- 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);
1351
- }
1352
- }
1353
- function InputRenderComponent_number_input_4_Template(rf, ctx) {
1354
- if (rf & 1) {
1355
- var _r16_1 = i0.ɵɵgetCurrentView();
1356
- i0.ɵɵelementStart(0, "number-input", 9);
1357
- i0.ɵɵlistener("modelChange", function InputRenderComponent_number_input_4_Template_number_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r16_1); var ctx_r15 = i0.ɵɵnextContext(); return ctx_r15.value = $event; })("modelChange", function InputRenderComponent_number_input_4_Template_number_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r16_1); var ctx_r17 = i0.ɵɵnextContext(); return ctx_r17.onChange($event); });
1358
- i0.ɵɵelementEnd();
1359
- }
1360
- if (rf & 2) {
1361
- var ctx_r3 = i0.ɵɵnextContext();
1362
- i0.ɵɵproperty("model", ctx_r3.value)("inputId", ctx_r3.inputId)("placeholder", ctx_r3.schema.description)("maxLength", ctx_r3.schema.maxLength);
1363
- }
1364
- }
1365
- function InputRenderComponent_boolean_input_5_Template(rf, ctx) {
1366
- if (rf & 1) {
1367
- var _r19_1 = i0.ɵɵgetCurrentView();
1368
- i0.ɵɵelementStart(0, "boolean-input", 9);
1369
- i0.ɵɵlistener("modelChange", function InputRenderComponent_boolean_input_5_Template_boolean_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r19_1); var ctx_r18 = i0.ɵɵnextContext(); return ctx_r18.value = $event; })("modelChange", function InputRenderComponent_boolean_input_5_Template_boolean_input_modelChange_0_listener($event) { i0.ɵɵrestoreView(_r19_1); var ctx_r20 = i0.ɵɵnextContext(); return ctx_r20.onChange($event); });
1370
- i0.ɵɵelementEnd();
1371
- }
1372
- if (rf & 2) {
1373
- var ctx_r4 = i0.ɵɵnextContext();
1374
- i0.ɵɵproperty("model", ctx_r4.value)("inputId", ctx_r4.inputId)("placeholder", ctx_r4.schema.description)("maxLength", ctx_r4.schema.maxLength);
1375
- }
1376
- }
1377
- var _c1$2 = function (a0) { return { "schema-input-container-password": a0 }; };
1378
- var InputRenderComponent = /** @class */ (function (_super) {
1379
- __extends(InputRenderComponent, _super);
1380
- function InputRenderComponent() {
1381
- var _this = _super.apply(this, __spread(arguments)) || this;
1382
- _this.selectPlaceHolderLabel = 'Select Item';
1383
- _this.selectSearchPlaceHolderLabel = 'Search';
1384
- _this.selectClearLabel = 'Clear';
1385
- _this.selectNotFoundLabel = 'No Items Found';
1386
- _this.schema = {};
1387
- _this.editing = false;
1388
- _this.onDropEvent = new i0.EventEmitter();
1389
- return _this;
1390
- }
1391
- InputRenderComponent.prototype.ngAfterContentInit = function () {
1392
- var _this = this;
1393
- var _a, _b, _c;
1394
- 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') {
1395
- if (!this.editing && this.schema.options) {
1396
- var $event = this.schema.options.filter(function (item) { return item.selected === true; });
1397
- if ($event[0]) {
1398
- this.onChange($event[0].key);
1399
- this.value = $event[0];
1400
- }
1401
- }
1402
- else if (this.editing && this.schema.options && this.model) {
1403
- var $event = this.schema.options.filter(function (item) { return item.key === _this.model; });
1404
- if ($event[0]) {
1405
- this.onChange($event[0].key);
1406
- this.value = $event[0];
1407
- }
1408
- }
1409
- else {
1410
- this.value = this.model;
1411
- }
1412
- }
1413
- if (this.editing && ((_c = this.schema) === null || _c === void 0 ? void 0 : _c.type) === 'password') {
1414
- this.schema.readOnlyPassword = true;
1415
- }
1416
- };
1417
- InputRenderComponent.prototype.onDropCallBack = function ($event, value) {
1418
- this.value = value = _super.prototype.onDrop.call(this, $event, value);
1419
- this.onChange(value);
1420
- };
1421
- InputRenderComponent.prototype.onChange = function ($event) {
1422
- if (this.schema.type !== 'password' || !this.editing) {
1423
- this.model = $event;
1424
- this.modelChange.emit(this.model);
1425
- }
1426
- };
1427
- InputRenderComponent.prototype.onInputBlur = function () {
1428
- var _a;
1429
- if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) === 'password') {
1430
- this.savePassword();
1431
- }
1432
- };
1433
- InputRenderComponent.prototype.savePassword = function () {
1434
- this.model = this.value || '';
1435
- this.modelChange.emit(this.model);
1436
- this.setReadOnlyPassword(true);
1437
- };
1438
- InputRenderComponent.prototype.cancelEditPassword = function () {
1439
- this.model = undefined;
1440
- this.setReadOnlyPassword(true);
1441
- };
1442
- InputRenderComponent.prototype.editPassword = function () {
1443
- this.setReadOnlyPassword(false);
1444
- };
1445
- InputRenderComponent.prototype.setReadOnlyPassword = function (value) {
1446
- this.schema.readOnlyPassword = value;
1447
- };
1448
- return InputRenderComponent;
1449
- }(BaseSchemaComponent));
1450
- InputRenderComponent.ɵfac = function InputRenderComponent_Factory(t) { return ɵInputRenderComponent_BaseFactory(t || InputRenderComponent); };
1451
- 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"], ["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) {
1452
- if (rf & 1) {
1453
- i0.ɵɵelementStart(0, "div", 0);
1454
- i0.ɵɵtemplate(1, InputRenderComponent_div_1_Template, 2, 1, "div", 1);
1455
- i0.ɵɵtemplate(2, InputRenderComponent_input_2_Template, 1, 8, "input", 2);
1456
- i0.ɵɵtemplate(3, InputRenderComponent_select_box_3_Template, 1, 13, "select-box", 3);
1457
- i0.ɵɵtemplate(4, InputRenderComponent_number_input_4_Template, 1, 4, "number-input", 4);
1458
- i0.ɵɵtemplate(5, InputRenderComponent_boolean_input_5_Template, 1, 4, "boolean-input", 4);
1459
- i0.ɵɵelementEnd();
1460
- }
1461
- if (rf & 2) {
1462
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c1$2, ctx.schema.type === "password"));
1463
- i0.ɵɵadvance(1);
1464
- i0.ɵɵproperty("ngIf", ctx.schema.type === "password" && ctx.editing);
1465
- i0.ɵɵadvance(1);
1466
- i0.ɵɵproperty("ngIf", (ctx.schema.type === "string" || ctx.schema.type === "password") && !ctx.schema.options);
1467
- i0.ɵɵadvance(1);
1468
- i0.ɵɵproperty("ngIf", ctx.schema.type === "string" && ctx.schema.options);
1469
- i0.ɵɵadvance(1);
1470
- i0.ɵɵproperty("ngIf", ctx.schema.type === "number");
1471
- i0.ɵɵadvance(1);
1472
- i0.ɵɵproperty("ngIf", ctx.schema.type === "boolean");
1473
- }
1474
- }, 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}"] });
1475
- var ɵInputRenderComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(InputRenderComponent);
1476
- /*@__PURE__*/ (function () {
1477
- i0.ɵsetClassMetadata(InputRenderComponent, [{
1478
- type: i0.Component,
1479
- args: [{
1480
- selector: 'input-render',
1481
- templateUrl: 'input-render.html',
1482
- styleUrls: ['./input-render.scss']
1483
- }]
1484
- }], null, { selectPlaceHolderLabel: [{
1485
- type: i0.Input
1486
- }], selectSearchPlaceHolderLabel: [{
1487
- type: i0.Input
1488
- }], selectClearLabel: [{
1489
- type: i0.Input
1490
- }], selectNotFoundLabel: [{
1491
- type: i0.Input
1492
- }], schema: [{
1493
- type: i0.Input
1494
- }], modelPropertiesPath: [{
1495
- type: i0.Input
1496
- }], inputId: [{
1497
- type: i0.Input
1498
- }], editing: [{
1499
- type: i0.Input
1500
- }], onDropEvent: [{
1501
- type: i0.Output
1502
- }] });
1503
- })();
1504
-
1505
- function SchemaInputComponent_div_0_Template(rf, ctx) {
1506
- if (rf & 1) {
1507
- var _r3_1 = i0.ɵɵgetCurrentView();
1508
- i0.ɵɵelementStart(0, "div", 1);
1509
- i0.ɵɵelementStart(1, "div", 2);
1510
- i0.ɵɵelementStart(2, "field-render", 3);
1511
- i0.ɵɵelementStart(3, "input-render", 4);
1512
- 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); });
1513
- i0.ɵɵelementEnd();
1514
- i0.ɵɵelementEnd();
1515
- i0.ɵɵelementEnd();
1516
- i0.ɵɵelementEnd();
1517
- }
1518
- if (rf & 2) {
1519
- var ctx_r0 = i0.ɵɵnextContext();
1520
- i0.ɵɵadvance(2);
1521
- i0.ɵɵproperty("requiredLabel", ctx_r0.requiredLabel)("label", ctx_r0.schema.title)("tooltip", ctx_r0.schema.help)("inputId", ctx_r0.getId(ctx_r0.index));
1522
- i0.ɵɵadvance(1);
1523
- 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);
1524
- }
1525
- }
1526
- function SchemaInputComponent_div_1_span_4_Template(rf, ctx) {
1527
- if (rf & 1) {
1528
- i0.ɵɵelementStart(0, "span", 7);
1529
- i0.ɵɵtext(1, "?");
1530
- i0.ɵɵelementEnd();
1531
- }
1532
- if (rf & 2) {
1533
- var ctx_r4 = i0.ɵɵnextContext(2);
1534
- i0.ɵɵpropertyInterpolate("matTooltip", ctx_r4.schema.help);
1535
- }
1536
- }
1537
- function SchemaInputComponent_div_1_Template(rf, ctx) {
1538
- if (rf & 1) {
1539
- var _r6_1 = i0.ɵɵgetCurrentView();
1540
- i0.ɵɵelementStart(0, "div", 1);
1541
- i0.ɵɵelementStart(1, "div", 2);
1542
- i0.ɵɵelementStart(2, "label", 5);
1543
- i0.ɵɵtext(3);
1544
- i0.ɵɵtemplate(4, SchemaInputComponent_div_1_span_4_Template, 2, 1, "span", 6);
1545
- i0.ɵɵelementEnd();
1546
- i0.ɵɵelementStart(5, "input-render", 4);
1547
- 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); });
1548
- i0.ɵɵelementEnd();
1549
- i0.ɵɵelementEnd();
1550
- i0.ɵɵelementEnd();
1551
- }
1552
- if (rf & 2) {
1553
- var ctx_r1 = i0.ɵɵnextContext();
1554
- i0.ɵɵadvance(2);
1555
- i0.ɵɵproperty("htmlFor", ctx_r1.getId(ctx_r1.index));
1556
- i0.ɵɵadvance(1);
1557
- i0.ɵɵtextInterpolate1(" ", ctx_r1.schema.title, " ");
1558
- i0.ɵɵadvance(1);
1559
- i0.ɵɵproperty("ngIf", ctx_r1.schema.help);
1560
- i0.ɵɵadvance(1);
1561
- 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);
1562
- }
1563
- }
1564
- var SchemaInputComponent = /** @class */ (function (_super) {
1565
- __extends(SchemaInputComponent, _super);
1566
- function SchemaInputComponent() {
1567
- var _this = _super.apply(this, __spread(arguments)) || this;
1568
- _this.requiredLabel = '(required)';
1569
- _this.selectPlaceHolderLabel = 'Select Item';
1570
- _this.selectSearchPlaceHolderLabel = 'Search';
1571
- _this.selectClearLabel = 'Clear';
1572
- _this.selectNotFoundLabel = 'No Items Found';
1573
- _this.editing = false;
1574
- return _this;
1575
- }
1576
- SchemaInputComponent.prototype.ngAfterContentInit = function () {
1577
- this.loaded = true;
1578
- };
1579
- SchemaInputComponent.prototype.getId = function (index) {
1580
- return this.idPrefix + "-struct-" + index;
1581
- };
1582
- return SchemaInputComponent;
1583
- }(BaseSchemaComponent));
1584
- SchemaInputComponent.ɵfac = function SchemaInputComponent_Factory(t) { return ɵSchemaInputComponent_BaseFactory(t || SchemaInputComponent); };
1585
- 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) {
1586
- if (rf & 1) {
1587
- i0.ɵɵtemplate(0, SchemaInputComponent_div_0_Template, 4, 13, "div", 0);
1588
- i0.ɵɵtemplate(1, SchemaInputComponent_div_1_Template, 6, 12, "div", 0);
1589
- }
1590
- if (rf & 2) {
1591
- i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && ctx.schema.minLength && ctx.schema.minLength > 0);
1592
- i0.ɵɵadvance(1);
1593
- i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type !== "array" && ctx.schema.type !== "object" && (!ctx.schema.minLength || ctx.schema.minLength === 0));
1594
- }
1595
- }, directives: [i1.NgIf, FieldRenderComponent, InputRenderComponent, i4.MatTooltip], styles: [""] });
1596
- var ɵSchemaInputComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(SchemaInputComponent);
1597
- /*@__PURE__*/ (function () {
1598
- i0.ɵsetClassMetadata(SchemaInputComponent, [{
1599
- type: i0.Component,
1600
- args: [{
1601
- selector: 'schema-input',
1602
- templateUrl: 'schema-input.html',
1603
- styleUrls: ['./schema-input.scss']
1604
- }]
1605
- }], null, { requiredLabel: [{
1606
- type: i0.Input
1607
- }], selectPlaceHolderLabel: [{
1608
- type: i0.Input
1609
- }], selectSearchPlaceHolderLabel: [{
1610
- type: i0.Input
1611
- }], selectClearLabel: [{
1612
- type: i0.Input
1613
- }], selectNotFoundLabel: [{
1614
- type: i0.Input
1615
- }], idPrefix: [{
1616
- type: i0.Input
1617
- }], schema: [{
1618
- type: i0.Input
1619
- }], editing: [{
1620
- type: i0.Input
1621
- }], index: [{
1622
- type: i0.Input
1623
- }] });
1624
- })();
1625
-
1626
- function SchemaObjectComponent_div_0_div_4_Template(rf, ctx) {
1627
- if (rf & 1) {
1628
- var _r3_1 = i0.ɵɵgetCurrentView();
1629
- i0.ɵɵelementStart(0, "div", 5);
1630
- i0.ɵɵelementStart(1, "div", 6);
1631
- i0.ɵɵelementStart(2, "label", 7);
1632
- i0.ɵɵtext(3);
1633
- i0.ɵɵelementEnd();
1634
- i0.ɵɵelementStart(4, "schema-custom-attributes", 8);
1635
- 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; });
1636
- i0.ɵɵelementEnd();
1637
- i0.ɵɵelementEnd();
1638
- i0.ɵɵelementEnd();
1639
- }
1640
- if (rf & 2) {
1641
- var ctx_r1 = i0.ɵɵnextContext(2);
1642
- i0.ɵɵadvance(3);
1643
- i0.ɵɵtextInterpolate(ctx_r1.additionalAttributesLabel);
1644
- i0.ɵɵadvance(1);
1645
- 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);
1646
- }
1647
- }
1648
- function SchemaObjectComponent_div_0_Template(rf, ctx) {
1649
- if (rf & 1) {
1650
- var _r5_1 = i0.ɵɵgetCurrentView();
1651
- i0.ɵɵelementStart(0, "div", 1);
1652
- i0.ɵɵelementStart(1, "div", 2);
1653
- i0.ɵɵtext(2);
1654
- i0.ɵɵelementEnd();
1655
- i0.ɵɵelementStart(3, "schema-form", 3);
1656
- 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); });
1657
- i0.ɵɵelementEnd();
1658
- i0.ɵɵtemplate(4, SchemaObjectComponent_div_0_div_4_Template, 5, 9, "div", 4);
1659
- i0.ɵɵelementEnd();
1660
- }
1661
- if (rf & 2) {
1662
- var ctx_r0 = i0.ɵɵnextContext();
1663
- i0.ɵɵadvance(2);
1664
- i0.ɵɵtextInterpolate(ctx_r0.schema.title);
1665
- i0.ɵɵadvance(1);
1666
- 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);
1667
- i0.ɵɵadvance(1);
1668
- i0.ɵɵproperty("ngIf", ctx_r0.model[ctx_r0.schema.id] && ctx_r0.schema.customProperties);
1669
- }
1670
- }
1671
- var SchemaObjectComponent = /** @class */ (function (_super) {
1672
- __extends(SchemaObjectComponent, _super);
1673
- function SchemaObjectComponent() {
1674
- var _this = _super.apply(this, __spread(arguments)) || this;
1675
- _this.requiredLabel = '(required)';
1676
- _this.addItemLabel = 'Add Item';
1677
- _this.addLoopLabel = 'Add Loop';
1678
- _this.additionalAttributesLabel = 'Additional Fields';
1679
- _this.customAttributeRemoveLabel = 'Remove';
1680
- _this.newCustomFieldNameLabel = 'Name';
1681
- _this.newCustomFieldValueLabel = 'Value';
1682
- _this.newCustomFieldAddLabel = 'Add';
1683
- _this.newCustomFieldSaveLabel = 'Save';
1684
- _this.newCustomFieldCancelLabel = 'Cancel';
1685
- _this.selectPlaceHolderLabel = 'Select Item';
1686
- _this.selectSearchPlaceHolderLabel = 'Search';
1687
- _this.selectClearLabel = 'Clear';
1688
- _this.selectNotFoundLabel = 'No Items Found';
1689
- _this.editing = false;
1690
- _this.onDropEvent = new i0.EventEmitter();
1691
- _this.loaded = false;
1692
- return _this;
1693
- }
1694
- SchemaObjectComponent.prototype.ngAfterContentInit = function () {
1695
- var _a;
1696
- if (((_a = this.schema) === null || _a === void 0 ? void 0 : _a.type) === 'object' && this.model) {
1697
- this.model[this.schema.id] = this.model[this.schema.id] || {};
1698
- }
1699
- this.loaded = true;
1700
- };
1701
- SchemaObjectComponent.prototype.onDrop = function ($event, modelElement) {
1702
- return onDropStruct($event, modelElement);
1703
- };
1704
- return SchemaObjectComponent;
1705
- }(BaseSchemaComponent));
1706
- SchemaObjectComponent.ɵfac = function SchemaObjectComponent_Factory(t) { return ɵSchemaObjectComponent_BaseFactory(t || SchemaObjectComponent); };
1707
- 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) {
1708
- if (rf & 1) {
1709
- i0.ɵɵtemplate(0, SchemaObjectComponent_div_0_Template, 5, 20, "div", 0);
1710
- }
1711
- if (rf & 2) {
1712
- i0.ɵɵproperty("ngIf", ctx.loaded && ctx.canRender(ctx.schema) && ctx.schema.type == "object");
1713
- }
1714
- }, 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)}"] });
1715
- var ɵSchemaObjectComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(SchemaObjectComponent);
1716
- /*@__PURE__*/ (function () {
1717
- i0.ɵsetClassMetadata(SchemaObjectComponent, [{
1718
- type: i0.Component,
1719
- args: [{
1720
- selector: 'schema-object',
1721
- templateUrl: 'schema-object.html',
1722
- styleUrls: ['./schema-object.scss']
1723
- }]
1724
- }], null, { requiredLabel: [{
1725
- type: i0.Input
1726
- }], addItemLabel: [{
1727
- type: i0.Input
1728
- }], addLoopLabel: [{
1729
- type: i0.Input
1730
- }], additionalAttributesLabel: [{
1731
- type: i0.Input
1732
- }], customAttributeRemoveLabel: [{
1733
- type: i0.Input
1734
- }], newCustomFieldNameLabel: [{
1735
- type: i0.Input
1736
- }], newCustomFieldValueLabel: [{
1737
- type: i0.Input
1738
- }], newCustomFieldAddLabel: [{
1739
- type: i0.Input
1740
- }], newCustomFieldSaveLabel: [{
1741
- type: i0.Input
1742
- }], newCustomFieldCancelLabel: [{
1743
- type: i0.Input
1744
- }], selectPlaceHolderLabel: [{
1745
- type: i0.Input
1746
- }], selectSearchPlaceHolderLabel: [{
1747
- type: i0.Input
1748
- }], selectClearLabel: [{
1749
- type: i0.Input
1750
- }], selectNotFoundLabel: [{
1751
- type: i0.Input
1752
- }], idPrefix: [{
1753
- type: i0.Input
1754
- }], modelPropertiesPath: [{
1755
- type: i0.Input
1756
- }], inputId: [{
1757
- type: i0.Input
1758
- }], editing: [{
1759
- type: i0.Input
1760
- }], index: [{
1761
- type: i0.Input
1762
- }], onDropEvent: [{
1763
- type: i0.Output
1764
- }] });
1765
- })();
1766
-
1767
- var SchemaValidationField = /** @class */ (function () {
1768
- function SchemaValidationField(emptyFields, invalidMinLengthFields, invalidMaxLengthFields) {
1769
- this.emptyFields = emptyFields;
1770
- this.invalidMinLengthFields = invalidMinLengthFields;
1771
- this.invalidMaxLengthFields = invalidMaxLengthFields;
1772
- }
1773
- SchemaValidationField.prototype.isValidSchemaFields = function () {
1774
- var _a, _b, _c;
1775
- 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;
1776
- };
1777
- SchemaValidationField.prototype.isInvalidSchemaFields = function () {
1778
- return !this.isValidSchemaFields();
1779
- };
1780
- return SchemaValidationField;
1781
- }());
1782
-
1783
- var SchemaFieldsService = /** @class */ (function () {
1784
- function SchemaFieldsService() {
1785
- }
1786
- SchemaFieldsService.prototype.validateSchemaFields = function (propertiesRendered, model, editing) {
1787
- return __awaiter(this, void 0, void 0, function () {
1788
- var emptyFields, invalidMinLengthFields, invalidMaxLengthFields, structValidationField, _a;
1789
- return __generator(this, function (_b) {
1790
- switch (_b.label) {
1791
- case 0:
1792
- if (!propertiesRendered) {
1793
- return [2 /*return*/, new SchemaValidationField([], [], [])];
1794
- }
1795
- emptyFields = [];
1796
- invalidMinLengthFields = [];
1797
- invalidMaxLengthFields = [];
1798
- this.processProperties(propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1799
- structValidationField = new SchemaValidationField(emptyFields, invalidMinLengthFields, invalidMaxLengthFields);
1800
- _a = structValidationField;
1801
- return [4 /*yield*/, this.getErrorsStringArray(structValidationField)];
1802
- case 1:
1803
- _a.validationErrorsLabel = _b.sent();
1804
- return [2 /*return*/, structValidationField];
1805
- }
1806
- });
1807
- });
1808
- };
1809
- SchemaFieldsService.prototype.processProperties = function (propertiesRendered, model, editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, recursive) {
1810
- var e_1, _a;
1811
- try {
1812
- for (var propertiesRendered_1 = __values(propertiesRendered), propertiesRendered_1_1 = propertiesRendered_1.next(); !propertiesRendered_1_1.done; propertiesRendered_1_1 = propertiesRendered_1.next()) {
1813
- var property = propertiesRendered_1_1.value;
1814
- if ((property.type === 'object' || property.type === 'array') && property.properties) {
1815
- this.processProperties(property.properties, model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1816
- }
1817
- else if (property.type === 'array' && !property.properties) {
1818
- var newProperty = Object.assign({}, property);
1819
- newProperty.type = 'string';
1820
- this.processProperties([newProperty], model[property.id], editing, emptyFields, invalidMinLengthFields, invalidMaxLengthFields, true);
1821
- }
1822
- else {
1823
- var validateModel = recursive ? model : model[property.id];
1824
- if (property.type !== 'password' || !editing || validateModel !== undefined) {
1825
- if ((property === null || property === void 0 ? void 0 : property.canRender) && (property === null || property === void 0 ? void 0 : property.minLength) > 0
1826
- && (validateModel === undefined || validateModel === '' || validateModel === null)) {
1827
- emptyFields.push(property);
1828
- }
1829
- 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)) {
1830
- invalidMinLengthFields.push(property);
1831
- }
1832
- 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)) {
1833
- invalidMaxLengthFields.push(property);
1834
- }
1835
- }
1836
- }
1837
- }
1838
- }
1839
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1840
- finally {
1841
- try {
1842
- if (propertiesRendered_1_1 && !propertiesRendered_1_1.done && (_a = propertiesRendered_1.return)) _a.call(propertiesRendered_1);
1843
- }
1844
- finally { if (e_1) throw e_1.error; }
1845
- }
1846
- };
1847
- SchemaFieldsService.prototype.getErrorsStringArray = function (structValidation) {
1848
- return __awaiter(this, void 0, void 0, function () {
1849
- var errors, _a, _b, field, fieldName, _c, _d, field, fieldName, _e, _f, field, fieldName;
1850
- var e_2, _g, e_3, _h, e_4, _j;
1851
- return __generator(this, function (_k) {
1852
- if (!structValidation.isInvalidSchemaFields()) {
1853
- return [2 /*return*/, []];
1854
- }
1855
- errors = [];
1856
- try {
1857
- for (_a = __values(structValidation.emptyFields), _b = _a.next(); !_b.done; _b = _a.next()) {
1858
- field = _b.value;
1859
- fieldName = field.title || field.id;
1860
- errors.push({
1861
- type: 'emptyFields',
1862
- fieldName: fieldName
1863
- });
1864
- }
1865
- }
1866
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
1867
- finally {
1868
- try {
1869
- if (_b && !_b.done && (_g = _a.return)) _g.call(_a);
1870
- }
1871
- finally { if (e_2) throw e_2.error; }
1872
- }
1873
- try {
1874
- for (_c = __values(structValidation.invalidMinLengthFields), _d = _c.next(); !_d.done; _d = _c.next()) {
1875
- field = _d.value;
1876
- fieldName = field.title || field.id;
1877
- errors.push({
1878
- type: 'invalidMinLengthFields',
1879
- fieldName: fieldName,
1880
- minLength: field.minLength
1881
- });
1882
- }
1883
- }
1884
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
1885
- finally {
1886
- try {
1887
- if (_d && !_d.done && (_h = _c.return)) _h.call(_c);
1888
- }
1889
- finally { if (e_3) throw e_3.error; }
1890
- }
1891
- try {
1892
- for (_e = __values(structValidation.invalidMaxLengthFields), _f = _e.next(); !_f.done; _f = _e.next()) {
1893
- field = _f.value;
1894
- fieldName = field.title || field.id;
1895
- errors.push({
1896
- type: 'invalidMaxLengthFields',
1897
- fieldName: fieldName,
1898
- maxLength: field.maxLength
1899
- });
1900
- }
1901
- }
1902
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
1903
- finally {
1904
- try {
1905
- if (_f && !_f.done && (_j = _e.return)) _j.call(_e);
1906
- }
1907
- finally { if (e_4) throw e_4.error; }
1908
- }
1909
- return [2 /*return*/, errors];
1910
- });
1911
- });
1912
- };
1913
- return SchemaFieldsService;
1914
- }());
1915
- SchemaFieldsService.ɵfac = function SchemaFieldsService_Factory(t) { return new (t || SchemaFieldsService)(); };
1916
- SchemaFieldsService.ɵprov = i0.ɵɵdefineInjectable({ token: SchemaFieldsService, factory: SchemaFieldsService.ɵfac });
1917
- /*@__PURE__*/ (function () {
1918
- i0.ɵsetClassMetadata(SchemaFieldsService, [{
1919
- type: i0.Injectable
1920
- }], function () { return []; }, null);
1921
- })();
1922
-
1923
- function SchemaFormRenderComponent_div_0_div_2_div_1_Template(rf, ctx) {
1924
- if (rf & 1) {
1925
- var _r6_1 = i0.ɵɵgetCurrentView();
1926
- i0.ɵɵelementStart(0, "div", 6);
1927
- i0.ɵɵelementStart(1, "div", 7);
1928
- i0.ɵɵelementStart(2, "label", 8);
1929
- i0.ɵɵtext(3);
1930
- i0.ɵɵelementEnd();
1931
- i0.ɵɵelementStart(4, "schema-custom-attributes", 9);
1932
- 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; });
1933
- i0.ɵɵelementEnd();
1934
- i0.ɵɵelementEnd();
1935
- i0.ɵɵelementEnd();
1936
- }
1937
- if (rf & 2) {
1938
- var ctx_r4 = i0.ɵɵnextContext(3);
1939
- i0.ɵɵadvance(3);
1940
- i0.ɵɵtextInterpolate(ctx_r4.additionalAttributesLabel);
1941
- i0.ɵɵadvance(1);
1942
- 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);
1943
- }
1944
- }
1945
- function SchemaFormRenderComponent_div_0_div_2_Template(rf, ctx) {
1946
- if (rf & 1) {
1947
- i0.ɵɵelementStart(0, "div", 4);
1948
- i0.ɵɵtemplate(1, SchemaFormRenderComponent_div_0_div_2_div_1_Template, 5, 9, "div", 5);
1949
- i0.ɵɵelementEnd();
1950
- }
1951
- if (rf & 2) {
1952
- var ctx_r1 = i0.ɵɵnextContext(2);
1953
- i0.ɵɵadvance(1);
1954
- i0.ɵɵproperty("ngIf", ctx_r1.model && ctx_r1.customProperties);
1955
- }
1956
- }
1957
- function SchemaFormRenderComponent_div_0_Template(rf, ctx) {
1958
- if (rf & 1) {
1959
- var _r8_1 = i0.ɵɵgetCurrentView();
1960
- i0.ɵɵelementStart(0, "div", 1);
1961
- i0.ɵɵelementStart(1, "schema-form", 2);
1962
- 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; });
1963
- i0.ɵɵelementEnd();
1964
- i0.ɵɵtemplate(2, SchemaFormRenderComponent_div_0_div_2_Template, 2, 1, "div", 3);
1965
- i0.ɵɵelementEnd();
1966
- }
1967
- if (rf & 2) {
1968
- var ctx_r0 = i0.ɵɵnextContext();
1969
- i0.ɵɵadvance(1);
1970
- 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);
1971
- i0.ɵɵadvance(1);
1972
- i0.ɵɵproperty("ngForOf", ctx_r0.schemas);
1973
- }
1974
- }
1975
- var SchemaFormRenderComponent = /** @class */ (function (_super) {
1976
- __extends(SchemaFormRenderComponent, _super);
1977
- function SchemaFormRenderComponent() {
1978
- var _this = _super.apply(this, __spread(arguments)) || this;
1979
- _this.requiredLabel = '(required)';
1980
- _this.addItemLabel = 'Add Item';
1981
- _this.addLoopLabel = 'Add Loop';
1982
- _this.additionalAttributesLabel = 'Additional Fields';
1983
- _this.customAttributeRemoveLabel = 'Remove';
1984
- _this.newCustomFieldNameLabel = 'Name';
1985
- _this.newCustomFieldValueLabel = 'Value';
1986
- _this.newCustomFieldAddLabel = 'Add';
1987
- _this.newCustomFieldSaveLabel = 'Save';
1988
- _this.newCustomFieldCancelLabel = 'Cancel';
1989
- _this.selectPlaceHolderLabel = 'Select Item';
1990
- _this.selectSearchPlaceHolderLabel = 'Search';
1991
- _this.selectClearLabel = 'Clear';
1992
- _this.selectNotFoundLabel = 'No Items Found';
1993
- _this.schemas = [];
1994
- _this.customProperties = false;
1995
- _this.editing = false;
1996
- _this.loaded = false;
1997
- return _this;
1998
- }
1999
- SchemaFormRenderComponent.prototype.ngAfterContentInit = function () {
2000
- this.loaded = true;
2001
- };
2002
- SchemaFormRenderComponent.prototype.onDrop = function ($event, modelElement) {
2003
- return onDropStruct($event, modelElement);
2004
- };
2005
- SchemaFormRenderComponent.prototype.getId = function (index) {
2006
- return this.idPrefix + "-struct-" + index;
2007
- };
2008
- return SchemaFormRenderComponent;
2009
- }(BaseSchemaComponent));
2010
- SchemaFormRenderComponent.ɵfac = function SchemaFormRenderComponent_Factory(t) { return ɵSchemaFormRenderComponent_BaseFactory(t || SchemaFormRenderComponent); };
2011
- 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) {
2012
- if (rf & 1) {
2013
- i0.ɵɵtemplate(0, SchemaFormRenderComponent_div_0_Template, 3, 19, "div", 0);
2014
- }
2015
- if (rf & 2) {
2016
- i0.ɵɵproperty("ngIf", ctx.loaded);
2017
- }
2018
- }, 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)}"] });
2019
- var ɵSchemaFormRenderComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(SchemaFormRenderComponent);
2020
- /*@__PURE__*/ (function () {
2021
- i0.ɵsetClassMetadata(SchemaFormRenderComponent, [{
2022
- type: i0.Component,
2023
- args: [{
2024
- selector: 'schema-form-render',
2025
- templateUrl: 'schema-form-render.html',
2026
- styleUrls: ['./schema-form-render.scss']
2027
- }]
2028
- }], null, { requiredLabel: [{
2029
- type: i0.Input
2030
- }], addItemLabel: [{
2031
- type: i0.Input
2032
- }], addLoopLabel: [{
2033
- type: i0.Input
2034
- }], additionalAttributesLabel: [{
2035
- type: i0.Input
2036
- }], customAttributeRemoveLabel: [{
2037
- type: i0.Input
2038
- }], newCustomFieldNameLabel: [{
2039
- type: i0.Input
2040
- }], newCustomFieldValueLabel: [{
2041
- type: i0.Input
2042
- }], newCustomFieldAddLabel: [{
2043
- type: i0.Input
2044
- }], newCustomFieldSaveLabel: [{
2045
- type: i0.Input
2046
- }], newCustomFieldCancelLabel: [{
2047
- type: i0.Input
2048
- }], selectPlaceHolderLabel: [{
2049
- type: i0.Input
2050
- }], selectSearchPlaceHolderLabel: [{
2051
- type: i0.Input
2052
- }], selectClearLabel: [{
2053
- type: i0.Input
2054
- }], selectNotFoundLabel: [{
2055
- type: i0.Input
2056
- }], idPrefix: [{
2057
- type: i0.Input
2058
- }], schemas: [{
2059
- type: i0.Input
2060
- }], customProperties: [{
2061
- type: i0.Input
2062
- }], editing: [{
2063
- type: i0.Input
2064
- }], inputType: [{
2065
- type: i0.Input
2066
- }] });
2067
- })();
2068
-
2069
- var TypeScriptCompileBase = /** @class */ (function () {
2070
- function TypeScriptCompileBase() {
2071
- }
2072
- TypeScriptCompileBase.prototype.getTranslate = function (text) {
2073
- return text;
2074
- };
2075
- TypeScriptCompileBase.prototype.addItemToFormProperties = function (formProperties, item, key) {
2076
- this.translateProperties(item);
2077
- if (item.minLength && item.minLength > 0) {
2078
- formProperties[key] = new i3.FormControl([null, [i3.Validators.required]]);
2079
- }
2080
- else {
2081
- formProperties[key] = new i3.FormControl([null]);
2082
- }
2083
- };
2084
- TypeScriptCompileBase.prototype.compileProperties = function (input) {
2085
- var compiledProperties = [];
2086
- var formProperties = {};
2087
- var inputData = {};
2088
- var inputToCompile = JSON.parse(JSON.stringify(input));
2089
- this.translateProperties(inputToCompile);
2090
- if (inputToCompile.properties) {
2091
- if (inputToCompile.type === 'array') {
2092
- inputData = [];
2093
- }
2094
- if (inputToCompile.type === 'object') {
2095
- inputData = {};
2096
- }
2097
- inputToCompile.id = 'inputData';
2098
- this.proccessProperties(inputToCompile, formProperties, 'inputData');
2099
- this.translateProperties(inputToCompile);
2100
- compiledProperties.push(inputToCompile);
2101
- }
2102
- else if (inputToCompile.type === 'array') {
2103
- inputToCompile.id = 'inputData';
2104
- inputData = [];
2105
- this.addItemToFormProperties(formProperties, inputToCompile, 'inputData');
2106
- compiledProperties.push(inputToCompile);
2107
- }
2108
- else if (!inputToCompile.type) {
2109
- for (var index = 0; index < Object.keys(inputToCompile).length; index++) {
2110
- var key = Object.keys(inputToCompile)[index];
2111
- var item = inputToCompile[key];
2112
- item.id = key;
2113
- if (item.type === 'array') {
2114
- inputData[item.id] = [];
2115
- }
2116
- if (item.type === 'object') {
2117
- inputData[item.id] = {};
2118
- }
2119
- this.proccessProperties(item, formProperties, key);
2120
- this.translateProperties(item);
2121
- compiledProperties.push(item);
2122
- }
2123
- }
2124
- compiledProperties.sort(function (a, b) { return a.propertyOrder - b.propertyOrder; });
2125
- return { compiledProperties: compiledProperties, formProperties: formProperties, inputData: inputData };
2126
- };
2127
- TypeScriptCompileBase.prototype.translateProperties = function (input) {
2128
- var _this = this;
2129
- if (input === null || input === void 0 ? void 0 : input.title) {
2130
- input.title = this.getTranslate(input.title);
2131
- }
2132
- if (input === null || input === void 0 ? void 0 : input.description) {
2133
- input.description = this.getTranslate(input.description);
2134
- }
2135
- if ((input === null || input === void 0 ? void 0 : input.options) instanceof Array) {
2136
- input === null || input === void 0 ? void 0 : input.options.forEach(function (option) { return option.value = _this.getTranslate(option.value); });
2137
- }
2138
- };
2139
- TypeScriptCompileBase.prototype.proccessProperties = function (item, formProperties, key) {
2140
- this.translateProperties(item);
2141
- if (this.hasProperties(item)) {
2142
- var arFieldsChild = [];
2143
- for (var indexChild = 0; indexChild < Object.keys(item.properties).length; indexChild++) {
2144
- var keyChild = Object.keys(item.properties)[indexChild];
2145
- var itemChild = item.properties[keyChild];
2146
- itemChild.id = keyChild;
2147
- if (this.hasProperties(itemChild)) {
2148
- this.proccessProperties(itemChild, formProperties, keyChild);
2149
- arFieldsChild.push(itemChild);
2150
- }
2151
- else {
2152
- this.addItemToFormProperties(formProperties, itemChild, keyChild);
2153
- arFieldsChild.push(itemChild);
2154
- }
2155
- }
2156
- item.properties = arFieldsChild;
2157
- }
2158
- else {
2159
- this.addItemToFormProperties(formProperties, item, key);
2160
- }
2161
- };
2162
- TypeScriptCompileBase.prototype.hasProperties = function (item) {
2163
- return item.type === 'object' || (item.type === 'array' && item.properties);
2164
- };
2165
- return TypeScriptCompileBase;
2166
- }());
2167
- TypeScriptCompileBase.ɵfac = function TypeScriptCompileBase_Factory(t) { return new (t || TypeScriptCompileBase)(); };
2168
- TypeScriptCompileBase.ɵprov = i0.ɵɵdefineInjectable({ token: TypeScriptCompileBase, factory: TypeScriptCompileBase.ɵfac, providedIn: 'root' });
2169
- /*@__PURE__*/ (function () {
2170
- i0.ɵsetClassMetadata(TypeScriptCompileBase, [{
2171
- type: i0.Injectable,
2172
- args: [{ providedIn: 'root' }]
2173
- }], null, null);
2174
- })();
2175
- function APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY(parentIntl) {
2176
- return parentIntl || new TypeScriptCompileBase();
2177
- }
2178
- var APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER = {
2179
- provide: TypeScriptCompileBase,
2180
- deps: [[new i0.Optional(), new i0.SkipSelf(), TypeScriptCompileBase]],
2181
- useFactory: APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY,
2182
- };
2183
-
2184
- var SchemaFormRenderModule = /** @class */ (function () {
2185
- function SchemaFormRenderModule() {
2186
- }
2187
- return SchemaFormRenderModule;
2188
- }());
2189
- SchemaFormRenderModule.ɵmod = i0.ɵɵdefineNgModule({ type: SchemaFormRenderModule });
2190
- SchemaFormRenderModule.ɵinj = i0.ɵɵdefineInjector({ factory: function SchemaFormRenderModule_Factory(t) { return new (t || SchemaFormRenderModule)(); }, providers: [
2191
- SchemaFieldsService,
2192
- APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER
2193
- ], imports: [[
2194
- i1.CommonModule,
2195
- i2.DndModule,
2196
- i3.FormsModule,
2197
- i4.MatTooltipModule,
2198
- i7.InputsModule,
2199
- i2$1.IconsModule
2200
- ]] });
2201
- (function () {
2202
- (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(SchemaFormRenderModule, { declarations: [ArraySessionComponent,
2203
- SchemaArrayComponent,
2204
- FieldRenderComponent,
2205
- InputRenderComponent,
2206
- BooleanInputComponent,
2207
- NumberInputComponent,
2208
- SchemaInputComponent,
2209
- SchemaObjectComponent,
2210
- SchemaFormRenderComponent,
2211
- SchemaFormComponent,
2212
- SchemaCustomAttributesComponent], imports: [i1.CommonModule,
2213
- i2.DndModule,
2214
- i3.FormsModule,
2215
- i4.MatTooltipModule,
2216
- i7.InputsModule,
2217
- i2$1.IconsModule], exports: [ArraySessionComponent,
2218
- SchemaArrayComponent,
2219
- FieldRenderComponent,
2220
- InputRenderComponent,
2221
- BooleanInputComponent,
2222
- NumberInputComponent,
2223
- SchemaInputComponent,
2224
- SchemaObjectComponent,
2225
- SchemaFormRenderComponent,
2226
- SchemaFormComponent,
2227
- SchemaCustomAttributesComponent] });
2228
- })();
2229
- /*@__PURE__*/ (function () {
2230
- i0.ɵsetClassMetadata(SchemaFormRenderModule, [{
2231
- type: i0.NgModule,
2232
- args: [{
2233
- imports: [
2234
- i1.CommonModule,
2235
- i2.DndModule,
2236
- i3.FormsModule,
2237
- i4.MatTooltipModule,
2238
- i7.InputsModule,
2239
- i2$1.IconsModule
2240
- ],
2241
- declarations: [
2242
- ArraySessionComponent,
2243
- SchemaArrayComponent,
2244
- FieldRenderComponent,
2245
- InputRenderComponent,
2246
- BooleanInputComponent,
2247
- NumberInputComponent,
2248
- SchemaInputComponent,
2249
- SchemaObjectComponent,
2250
- SchemaFormRenderComponent,
2251
- SchemaFormComponent,
2252
- SchemaCustomAttributesComponent
2253
- ],
2254
- exports: [
2255
- ArraySessionComponent,
2256
- SchemaArrayComponent,
2257
- FieldRenderComponent,
2258
- InputRenderComponent,
2259
- BooleanInputComponent,
2260
- NumberInputComponent,
2261
- SchemaInputComponent,
2262
- SchemaObjectComponent,
2263
- SchemaFormRenderComponent,
2264
- SchemaFormComponent,
2265
- SchemaCustomAttributesComponent
2266
- ],
2267
- providers: [
2268
- SchemaFieldsService,
2269
- APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER
2270
- ]
2271
- }]
2272
- }], null, null);
2273
- })();
2274
- 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,
2275
- SchemaArrayComponent,
2276
- FieldRenderComponent,
2277
- InputRenderComponent,
2278
- BooleanInputComponent,
2279
- NumberInputComponent,
2280
- SchemaInputComponent,
2281
- SchemaObjectComponent,
2282
- SchemaFormRenderComponent,
2283
- SchemaFormComponent,
2284
- 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]);
2285
-
2286
- /**
2287
- * Generated bundle index. Do not edit.
2288
- */
2289
-
2290
- exports.APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY = APIPASS_TYPESCRIPT_COMPILE_BASE_PROVIDER_FACTORY;
2291
- exports.APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER = APIPASS_TYPESCRIPT_COMPILE_INTL_PROVIDER;
2292
- exports.ArraySessionComponent = ArraySessionComponent;
2293
- exports.BaseSchemaComponent = BaseSchemaComponent;
2294
- exports.BooleanInputComponent = BooleanInputComponent;
2295
- exports.FieldRenderComponent = FieldRenderComponent;
2296
- exports.InputRenderComponent = InputRenderComponent;
2297
- exports.NumberInputComponent = NumberInputComponent;
2298
- exports.SchemaArrayComponent = SchemaArrayComponent;
2299
- exports.SchemaCustomAttributesComponent = SchemaCustomAttributesComponent;
2300
- exports.SchemaFieldsService = SchemaFieldsService;
2301
- exports.SchemaFormComponent = SchemaFormComponent;
2302
- exports.SchemaFormRenderComponent = SchemaFormRenderComponent;
2303
- exports.SchemaFormRenderModule = SchemaFormRenderModule;
2304
- exports.SchemaInputComponent = SchemaInputComponent;
2305
- exports.SchemaObjectComponent = SchemaObjectComponent;
2306
- exports.SchemaValidationField = SchemaValidationField;
2307
- exports.TypeScriptCompileBase = TypeScriptCompileBase;
2308
-
2309
- Object.defineProperty(exports, '__esModule', { value: true });
2310
-
2311
- })));
2312
- //# sourceMappingURL=apipass-schemas.umd.js.map