monkey-front-components 0.0.179 → 0.0.183

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 (84) hide show
  1. package/esm2020/lib/components/base/base-component.mjs +291 -0
  2. package/esm2020/lib/components/base/base-dynamic-array.mjs +221 -0
  3. package/esm2020/lib/components/base/base-dynamic.mjs +99 -0
  4. package/{esm2015/lib/components/base/base-validators.js → esm2020/lib/components/base/base-validators.mjs} +1 -1
  5. package/{esm2015/lib/components/base/index.js → esm2020/lib/components/base/index.mjs} +0 -0
  6. package/esm2020/lib/components/dynamic/button/button.component.mjs +52 -0
  7. package/{esm2015/lib/components/dynamic/button/index.js → esm2020/lib/components/dynamic/button/index.mjs} +0 -0
  8. package/esm2020/lib/components/dynamic/dynamic-directive.mjs +95 -0
  9. package/{esm2015/lib/components/dynamic/dynamic.module.js → esm2020/lib/components/dynamic/dynamic.module.mjs} +5 -5
  10. package/esm2020/lib/components/dynamic/file-upload/file-upload.component.mjs +52 -0
  11. package/{esm2015/lib/components/dynamic/file-upload/index.js → esm2020/lib/components/dynamic/file-upload/index.mjs} +0 -0
  12. package/esm2020/lib/components/dynamic/form/dynamic-form-array.component.mjs +72 -0
  13. package/esm2020/lib/components/dynamic/form/dynamic-form.component.mjs +46 -0
  14. package/{esm2015/lib/components/dynamic/form/index.js → esm2020/lib/components/dynamic/form/index.mjs} +0 -0
  15. package/{esm2015/lib/components/dynamic/index.js → esm2020/lib/components/dynamic/index.mjs} +0 -0
  16. package/{esm2015/lib/components/dynamic/input/index.js → esm2020/lib/components/dynamic/input/index.mjs} +0 -0
  17. package/esm2020/lib/components/dynamic/input/input.component.mjs +65 -0
  18. package/{esm2015/lib/components/dynamic/input-phone/index.js → esm2020/lib/components/dynamic/input-phone/index.mjs} +0 -0
  19. package/esm2020/lib/components/dynamic/input-phone/input-phone.component.mjs +65 -0
  20. package/{esm2015/lib/components/dynamic/radio/index.js → esm2020/lib/components/dynamic/radio/index.mjs} +0 -0
  21. package/esm2020/lib/components/dynamic/radio/radio.component.mjs +33 -0
  22. package/{esm2015/lib/components/dynamic/select/index.js → esm2020/lib/components/dynamic/select/index.mjs} +0 -0
  23. package/esm2020/lib/components/dynamic/select/select.component.mjs +80 -0
  24. package/{esm2015/lib/components/dynamic/select-search/index.js → esm2020/lib/components/dynamic/select-search/index.mjs} +0 -0
  25. package/esm2020/lib/components/dynamic/select-search/select-search.component.mjs +80 -0
  26. package/{esm2015/lib/components/index.js → esm2020/lib/components/index.mjs} +2 -1
  27. package/esm2020/lib/components/shared/index.mjs +3 -0
  28. package/esm2020/lib/components/shared/password-strength/index.mjs +3 -0
  29. package/esm2020/lib/components/shared/password-strength/password-strength.component.mjs +83 -0
  30. package/esm2020/lib/components/shared/password-strength/password-strength.mjs +2 -0
  31. package/esm2020/lib/components/shared/password-strength/password-strength.module.mjs +50 -0
  32. package/esm2020/lib/components/shared/progress-bar/index.mjs +4 -0
  33. package/esm2020/lib/components/shared/progress-bar/progress-bar.component.mjs +28 -0
  34. package/esm2020/lib/components/shared/progress-bar/progress-bar.module.mjs +18 -0
  35. package/esm2020/lib/components/shared/progress-bar/progress-bar.service.mjs +49 -0
  36. package/{esm2015/lib/interfaces/field-config.js → esm2020/lib/interfaces/field-config.mjs} +0 -0
  37. package/{esm2015/lib/interfaces/index.js → esm2020/lib/interfaces/index.mjs} +0 -0
  38. package/{esm2015/monkey-front-components.js → esm2020/monkey-front-components.mjs} +0 -0
  39. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  40. package/fesm2015/monkey-front-components.mjs +1487 -0
  41. package/fesm2015/monkey-front-components.mjs.map +1 -0
  42. package/fesm2020/monkey-front-components.mjs +1471 -0
  43. package/fesm2020/monkey-front-components.mjs.map +1 -0
  44. package/lib/components/base/base-component.d.ts +1 -1
  45. package/lib/components/base/base-dynamic-array.d.ts +1 -1
  46. package/lib/components/base/base-dynamic.d.ts +1 -1
  47. package/lib/components/base/base-validators.d.ts +1 -14
  48. package/lib/components/dynamic/button/button.component.d.ts +2 -2
  49. package/lib/components/dynamic/dynamic-directive.d.ts +2 -2
  50. package/lib/components/dynamic/input/input.component.d.ts +3 -3
  51. package/lib/components/dynamic/input-phone/input-phone.component.d.ts +3 -3
  52. package/lib/components/dynamic/radio/radio.component.d.ts +2 -2
  53. package/lib/components/dynamic/select/select.component.d.ts +2 -2
  54. package/lib/components/dynamic/select-search/select-search.component.d.ts +2 -2
  55. package/lib/components/index.d.ts +1 -0
  56. package/lib/components/shared/index.d.ts +2 -0
  57. package/lib/components/shared/password-strength/index.d.ts +2 -0
  58. package/lib/components/shared/password-strength/password-strength.component.d.ts +22 -0
  59. package/lib/components/shared/password-strength/password-strength.d.ts +5 -0
  60. package/lib/components/shared/password-strength/password-strength.module.d.ts +12 -0
  61. package/lib/components/shared/progress-bar/index.d.ts +3 -0
  62. package/lib/components/shared/progress-bar/progress-bar.component.d.ts +12 -0
  63. package/lib/components/shared/progress-bar/progress-bar.module.d.ts +8 -0
  64. package/lib/components/shared/progress-bar/progress-bar.service.d.ts +14 -0
  65. package/monkey-front-components-0.0.183.tgz +0 -0
  66. package/package.json +27 -13
  67. package/bundles/monkey-front-components.umd.js +0 -1729
  68. package/bundles/monkey-front-components.umd.js.map +0 -1
  69. package/esm2015/lib/components/base/base-component.js +0 -288
  70. package/esm2015/lib/components/base/base-dynamic-array.js +0 -215
  71. package/esm2015/lib/components/base/base-dynamic.js +0 -98
  72. package/esm2015/lib/components/dynamic/button/button.component.js +0 -57
  73. package/esm2015/lib/components/dynamic/dynamic-directive.js +0 -95
  74. package/esm2015/lib/components/dynamic/file-upload/file-upload.component.js +0 -57
  75. package/esm2015/lib/components/dynamic/form/dynamic-form-array.component.js +0 -77
  76. package/esm2015/lib/components/dynamic/form/dynamic-form.component.js +0 -51
  77. package/esm2015/lib/components/dynamic/input/input.component.js +0 -66
  78. package/esm2015/lib/components/dynamic/input-phone/input-phone.component.js +0 -66
  79. package/esm2015/lib/components/dynamic/radio/radio.component.js +0 -36
  80. package/esm2015/lib/components/dynamic/select/select.component.js +0 -81
  81. package/esm2015/lib/components/dynamic/select-search/select-search.component.js +0 -81
  82. package/fesm2015/monkey-front-components.js +0 -1290
  83. package/fesm2015/monkey-front-components.js.map +0 -1
  84. package/monkey-front-components-0.0.179.tgz +0 -0
@@ -1,1729 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('@angular/core'), require('rxjs/operators'), require('monkey-style-guide'), require('monkey-front-core'), require('@angular/forms'), require('@ngx-translate/core'), require('@angular/common')) :
3
- typeof define === 'function' && define.amd ? define('monkey-front-components', ['exports', 'rxjs', '@angular/core', 'rxjs/operators', 'monkey-style-guide', 'monkey-front-core', '@angular/forms', '@ngx-translate/core', '@angular/common'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["monkey-front-components"] = {}, global.rxjs, global.ng.core, global.rxjs.operators, global["monkey-style-guide"], global["monkey-front-core"], global.ng.forms, global["@ngx-translate/core"], global.ng.common));
5
- })(this, (function (exports, rxjs, i0, operators, i1, monkeyFrontCore, i1$1, i3, i3$1) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1);
27
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1$1);
28
- var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
29
- var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
30
-
31
- /*! *****************************************************************************
32
- Copyright (c) Microsoft Corporation.
33
-
34
- Permission to use, copy, modify, and/or distribute this software for any
35
- purpose with or without fee is hereby granted.
36
-
37
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
38
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
39
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
40
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
41
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
42
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
43
- PERFORMANCE OF THIS SOFTWARE.
44
- ***************************************************************************** */
45
- /* global Reflect, Promise */
46
- var extendStatics = function (d, b) {
47
- extendStatics = Object.setPrototypeOf ||
48
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
49
- function (d, b) { for (var p in b)
50
- if (Object.prototype.hasOwnProperty.call(b, p))
51
- d[p] = b[p]; };
52
- return extendStatics(d, b);
53
- };
54
- function __extends(d, b) {
55
- if (typeof b !== "function" && b !== null)
56
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
57
- extendStatics(d, b);
58
- function __() { this.constructor = d; }
59
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
60
- }
61
- var __assign = function () {
62
- __assign = Object.assign || function __assign(t) {
63
- for (var s, i = 1, n = arguments.length; i < n; i++) {
64
- s = arguments[i];
65
- for (var p in s)
66
- if (Object.prototype.hasOwnProperty.call(s, p))
67
- t[p] = s[p];
68
- }
69
- return t;
70
- };
71
- return __assign.apply(this, arguments);
72
- };
73
- function __rest(s, e) {
74
- var t = {};
75
- for (var p in s)
76
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
77
- t[p] = s[p];
78
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
79
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
80
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
81
- t[p[i]] = s[p[i]];
82
- }
83
- return t;
84
- }
85
- function __decorate(decorators, target, key, desc) {
86
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
87
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
88
- r = Reflect.decorate(decorators, target, key, desc);
89
- else
90
- for (var i = decorators.length - 1; i >= 0; i--)
91
- if (d = decorators[i])
92
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
93
- return c > 3 && r && Object.defineProperty(target, key, r), r;
94
- }
95
- function __param(paramIndex, decorator) {
96
- return function (target, key) { decorator(target, key, paramIndex); };
97
- }
98
- function __metadata(metadataKey, metadataValue) {
99
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
100
- return Reflect.metadata(metadataKey, metadataValue);
101
- }
102
- function __awaiter(thisArg, _arguments, P, generator) {
103
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
104
- return new (P || (P = Promise))(function (resolve, reject) {
105
- function fulfilled(value) { try {
106
- step(generator.next(value));
107
- }
108
- catch (e) {
109
- reject(e);
110
- } }
111
- function rejected(value) { try {
112
- step(generator["throw"](value));
113
- }
114
- catch (e) {
115
- reject(e);
116
- } }
117
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
118
- step((generator = generator.apply(thisArg, _arguments || [])).next());
119
- });
120
- }
121
- function __generator(thisArg, body) {
122
- var _ = { label: 0, sent: function () { if (t[0] & 1)
123
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
124
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
125
- function verb(n) { return function (v) { return step([n, v]); }; }
126
- function step(op) {
127
- if (f)
128
- throw new TypeError("Generator is already executing.");
129
- while (_)
130
- try {
131
- 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)
132
- return t;
133
- if (y = 0, t)
134
- op = [op[0] & 2, t.value];
135
- switch (op[0]) {
136
- case 0:
137
- case 1:
138
- t = op;
139
- break;
140
- case 4:
141
- _.label++;
142
- return { value: op[1], done: false };
143
- case 5:
144
- _.label++;
145
- y = op[1];
146
- op = [0];
147
- continue;
148
- case 7:
149
- op = _.ops.pop();
150
- _.trys.pop();
151
- continue;
152
- default:
153
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
154
- _ = 0;
155
- continue;
156
- }
157
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
158
- _.label = op[1];
159
- break;
160
- }
161
- if (op[0] === 6 && _.label < t[1]) {
162
- _.label = t[1];
163
- t = op;
164
- break;
165
- }
166
- if (t && _.label < t[2]) {
167
- _.label = t[2];
168
- _.ops.push(op);
169
- break;
170
- }
171
- if (t[2])
172
- _.ops.pop();
173
- _.trys.pop();
174
- continue;
175
- }
176
- op = body.call(thisArg, _);
177
- }
178
- catch (e) {
179
- op = [6, e];
180
- y = 0;
181
- }
182
- finally {
183
- f = t = 0;
184
- }
185
- if (op[0] & 5)
186
- throw op[1];
187
- return { value: op[0] ? op[1] : void 0, done: true };
188
- }
189
- }
190
- var __createBinding = Object.create ? (function (o, m, k, k2) {
191
- if (k2 === undefined)
192
- k2 = k;
193
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
194
- }) : (function (o, m, k, k2) {
195
- if (k2 === undefined)
196
- k2 = k;
197
- o[k2] = m[k];
198
- });
199
- function __exportStar(m, o) {
200
- for (var p in m)
201
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
202
- __createBinding(o, m, p);
203
- }
204
- function __values(o) {
205
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
206
- if (m)
207
- return m.call(o);
208
- if (o && typeof o.length === "number")
209
- return {
210
- next: function () {
211
- if (o && i >= o.length)
212
- o = void 0;
213
- return { value: o && o[i++], done: !o };
214
- }
215
- };
216
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
217
- }
218
- function __read(o, n) {
219
- var m = typeof Symbol === "function" && o[Symbol.iterator];
220
- if (!m)
221
- return o;
222
- var i = m.call(o), r, ar = [], e;
223
- try {
224
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
225
- ar.push(r.value);
226
- }
227
- catch (error) {
228
- e = { error: error };
229
- }
230
- finally {
231
- try {
232
- if (r && !r.done && (m = i["return"]))
233
- m.call(i);
234
- }
235
- finally {
236
- if (e)
237
- throw e.error;
238
- }
239
- }
240
- return ar;
241
- }
242
- /** @deprecated */
243
- function __spread() {
244
- for (var ar = [], i = 0; i < arguments.length; i++)
245
- ar = ar.concat(__read(arguments[i]));
246
- return ar;
247
- }
248
- /** @deprecated */
249
- function __spreadArrays() {
250
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
251
- s += arguments[i].length;
252
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
253
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
254
- r[k] = a[j];
255
- return r;
256
- }
257
- function __spreadArray(to, from, pack) {
258
- if (pack || arguments.length === 2)
259
- for (var i = 0, l = from.length, ar; i < l; i++) {
260
- if (ar || !(i in from)) {
261
- if (!ar)
262
- ar = Array.prototype.slice.call(from, 0, i);
263
- ar[i] = from[i];
264
- }
265
- }
266
- return to.concat(ar || Array.prototype.slice.call(from));
267
- }
268
- function __await(v) {
269
- return this instanceof __await ? (this.v = v, this) : new __await(v);
270
- }
271
- function __asyncGenerator(thisArg, _arguments, generator) {
272
- if (!Symbol.asyncIterator)
273
- throw new TypeError("Symbol.asyncIterator is not defined.");
274
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
275
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
276
- function verb(n) { if (g[n])
277
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
278
- function resume(n, v) { try {
279
- step(g[n](v));
280
- }
281
- catch (e) {
282
- settle(q[0][3], e);
283
- } }
284
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
285
- function fulfill(value) { resume("next", value); }
286
- function reject(value) { resume("throw", value); }
287
- function settle(f, v) { if (f(v), q.shift(), q.length)
288
- resume(q[0][0], q[0][1]); }
289
- }
290
- function __asyncDelegator(o) {
291
- var i, p;
292
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
293
- 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; }
294
- }
295
- function __asyncValues(o) {
296
- if (!Symbol.asyncIterator)
297
- throw new TypeError("Symbol.asyncIterator is not defined.");
298
- var m = o[Symbol.asyncIterator], i;
299
- 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);
300
- 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); }); }; }
301
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
302
- }
303
- function __makeTemplateObject(cooked, raw) {
304
- if (Object.defineProperty) {
305
- Object.defineProperty(cooked, "raw", { value: raw });
306
- }
307
- else {
308
- cooked.raw = raw;
309
- }
310
- return cooked;
311
- }
312
- ;
313
- var __setModuleDefault = Object.create ? (function (o, v) {
314
- Object.defineProperty(o, "default", { enumerable: true, value: v });
315
- }) : function (o, v) {
316
- o["default"] = v;
317
- };
318
- function __importStar(mod) {
319
- if (mod && mod.__esModule)
320
- return mod;
321
- var result = {};
322
- if (mod != null)
323
- for (var k in mod)
324
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
325
- __createBinding(result, mod, k);
326
- __setModuleDefault(result, mod);
327
- return result;
328
- }
329
- function __importDefault(mod) {
330
- return (mod && mod.__esModule) ? mod : { default: mod };
331
- }
332
- function __classPrivateFieldGet(receiver, state, kind, f) {
333
- if (kind === "a" && !f)
334
- throw new TypeError("Private accessor was defined without a getter");
335
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
336
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
337
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
338
- }
339
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
340
- if (kind === "m")
341
- throw new TypeError("Private method is not writable");
342
- if (kind === "a" && !f)
343
- throw new TypeError("Private accessor was defined without a setter");
344
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
345
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
346
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
347
- }
348
-
349
- var BaseComponent = /** @class */ (function () {
350
- function BaseComponent() {
351
- this.__isMobile = this.isMobile();
352
- this.__locales = ['pt-BR', 'es-CL'];
353
- this.__unsubscribeAll = new rxjs.Subject();
354
- }
355
- BaseComponent.prototype.isMobile = function () {
356
- var isMobileWidth = (window.screen.width <= 640) ||
357
- (window.matchMedia &&
358
- window.matchMedia('only screen and (max-width: 640px)').matches);
359
- return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile/i.test(navigator.userAgent)) || isMobileWidth;
360
- };
361
- BaseComponent.prototype.handlePagination = function (create) {
362
- var _this = this;
363
- if (create === void 0) { create = true; }
364
- var __paginationOptions = this.__paginationOptions;
365
- if (__paginationOptions) {
366
- var mainElement_1 = __paginationOptions.mainElement, service_1 = __paginationOptions.service;
367
- setTimeout(function () {
368
- var element = document.getElementById(mainElement_1);
369
- if (element) {
370
- element.scroll = null;
371
- element.onscroll = null;
372
- if (create) {
373
- _this.paginationFunc = function () {
374
- var scrollTop = element.scrollTop, scrollHeight = element.scrollHeight, offsetHeight = element.offsetHeight;
375
- var contentHeight = scrollHeight - offsetHeight;
376
- if (contentHeight <= scrollTop) {
377
- service_1.__onDoPagination$.next(null);
378
- }
379
- };
380
- element.addEventListener('scroll', _this.paginationFunc);
381
- }
382
- else {
383
- element.removeEventListener('scroll', _this.paginationFunc);
384
- }
385
- }
386
- }, 200);
387
- }
388
- };
389
- BaseComponent.prototype.handleSupport = function (supportControls) {
390
- var service = supportControls.service, show = supportControls.show;
391
- var method = show ? 'show' : 'hide';
392
- service[method.toLowerCase()]();
393
- };
394
- BaseComponent.prototype.handleTranslate = function (translateOptions) {
395
- var _this = this;
396
- var service = translateOptions.service;
397
- service.__oni18nDataChanged$
398
- .pipe(operators.takeUntil(this.__unsubscribeAll))
399
- .subscribe(function () {
400
- var data = service.__i18n;
401
- if (data) {
402
- _this.__i18n = data;
403
- }
404
- });
405
- };
406
- BaseComponent.prototype.getErrorFirstMessageTranslated = function (formControl) {
407
- if (formControl.hasError('required'))
408
- return 'FIELD-REQUIRED';
409
- if (formControl.hasError('invalid'))
410
- return 'FIELD-INVALID';
411
- if (formControl.hasError('email'))
412
- return 'INVALID-EMAIL';
413
- if (formControl.hasError('minlength'))
414
- return 'MIN-LENGTH';
415
- if (formControl.hasError('maxlength'))
416
- return 'MAX-LENGTH';
417
- if (formControl.hasError('max'))
418
- return 'MAX';
419
- if (formControl.hasError('min'))
420
- return 'MIN';
421
- if (formControl.hasError('passwordsNotMatching'))
422
- return 'MATCH-PASSWORD';
423
- if (formControl.hasError('invalidDate'))
424
- return 'INVALID-DATE';
425
- if (formControl.hasError('invalidTrue'))
426
- return 'INVALID-TRUE';
427
- if (formControl.hasError('invalidCpfCnpj'))
428
- return 'INVALID-DOCUMENT';
429
- if (formControl.hasError('invalidZipCode'))
430
- return 'INVALID-ZIPCODE';
431
- if (formControl.hasError('invalidCombo'))
432
- return 'INVALID-COMBO';
433
- if (formControl.hasError('invalidUrl'))
434
- return 'INVALID-URL';
435
- if (formControl.hasError('invalidUnlockRegister')) {
436
- return 'INVALID-UNLOCK-REGISTER';
437
- }
438
- if (formControl.hasError('dateStartMustBeLessThanAnd')) {
439
- return 'DATE-START-MUST-BE-LESS-THAN-AND';
440
- }
441
- if (formControl.hasError('dateEndMustBeGreaterThanStart')) {
442
- return 'DATE-END-MUST-BE-GREATER-THAN-SART';
443
- }
444
- if (formControl.hasError('phone'))
445
- return 'INVALID-PHONE';
446
- return 'FIELD-INVALID';
447
- };
448
- BaseComponent.prototype.getErrorLastMessageNotTranslated = function (formControl) {
449
- if (formControl.hasError('minlength')) {
450
- return formControl.getError('minlength').requiredLength + " caracteres.";
451
- }
452
- if (formControl.hasError('maxlength')) {
453
- return formControl.getError('maxlength').requiredLength + " caracteres.";
454
- }
455
- if (formControl.hasError('max')) {
456
- return "" + formControl.getError('max').max;
457
- }
458
- if (formControl.hasError('min')) {
459
- return "" + formControl.getError('min').min;
460
- }
461
- return '';
462
- };
463
- BaseComponent.prototype.validateFormWithTranslate = function (f, index) {
464
- var _this = this;
465
- var formErrors = f.value;
466
- if (f.status === 'VALID')
467
- return true;
468
- if (!formErrors)
469
- return true;
470
- Object.entries(formErrors).forEach(function (_a) {
471
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
472
- var control = f.get(key);
473
- formErrors[key] = '';
474
- if (control && !control.valid) {
475
- var msg = {
476
- first: "ERRORS." + _this.getErrorFirstMessageTranslated(f.get(key)),
477
- last: _this.getErrorLastMessageNotTranslated(f.get(key))
478
- };
479
- formErrors[key] = msg;
480
- }
481
- });
482
- if (i1.MonkeyUtils.persistNullEmptyUndefined(index)) {
483
- this.__monkeyecxFormErrors[index] = formErrors;
484
- }
485
- else {
486
- this.__monkeyecxFormErrors = formErrors;
487
- }
488
- return false;
489
- };
490
- BaseComponent.prototype.copyToClipboard = function (val) {
491
- var selBox = document.createElement('textarea');
492
- selBox.style.position = 'fixed';
493
- selBox.style.left = '0';
494
- selBox.style.top = '0';
495
- selBox.style.opacity = '0';
496
- selBox.value = val;
497
- document.body.appendChild(selBox);
498
- selBox.focus();
499
- selBox.select();
500
- document.execCommand('copy');
501
- document.body.removeChild(selBox);
502
- };
503
- BaseComponent.prototype.validateForm = function (f, index, alias) {
504
- var _a;
505
- var _this = this;
506
- var formErrors = f.value;
507
- if (f.status === 'VALID')
508
- return true;
509
- if (!formErrors)
510
- return true;
511
- Object.entries(formErrors).forEach(function (_a) {
512
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
513
- var control = f.get(key);
514
- formErrors[key] = '';
515
- if (control && !control.valid) {
516
- var msg = {
517
- firstMessage: "ERRORS." + _this.getErrorFirstMessageTranslated(f.get(key)),
518
- lastMessage: _this.getErrorLastMessageNotTranslated(f.get(key))
519
- };
520
- formErrors[key] = msg;
521
- }
522
- });
523
- if (i1.MonkeyUtils.persistNullEmptyUndefined(index)) {
524
- this.__monkeyecxFormErrors[index] = formErrors;
525
- }
526
- else {
527
- var obj = void 0;
528
- if (alias) {
529
- obj = (_a = {},
530
- _a[alias] = Object.assign({}, formErrors),
531
- _a);
532
- }
533
- else {
534
- obj = formErrors;
535
- }
536
- this.__monkeyecxFormErrors = Object.assign(Object.assign({}, this.__monkeyecxFormErrors), obj);
537
- }
538
- f.markAllAsTouched();
539
- return false;
540
- };
541
- BaseComponent.prototype.clearAllServiceData = function (clearData) {
542
- var context = this;
543
- Object.values(context).forEach(function (ctx) {
544
- if (ctx instanceof monkeyFrontCore.MonkeyEcxCommonsService) {
545
- ctx.clear(clearData);
546
- }
547
- });
548
- };
549
- BaseComponent.prototype.ngOnInit = function (args) {
550
- if (args === null || args === void 0 ? void 0 : args.paginationOptions) {
551
- this.__paginationOptions = args === null || args === void 0 ? void 0 : args.paginationOptions;
552
- this.handlePagination();
553
- }
554
- if (args === null || args === void 0 ? void 0 : args.supportControls) {
555
- this.handleSupport(args === null || args === void 0 ? void 0 : args.supportControls);
556
- }
557
- if (args === null || args === void 0 ? void 0 : args.translateOptions) {
558
- this.handleTranslate(args === null || args === void 0 ? void 0 : args.translateOptions);
559
- }
560
- };
561
- BaseComponent.prototype.ngOnDestroy = function (clearData) {
562
- if (clearData === void 0) { clearData = true; }
563
- this.__unsubscribeAll.next();
564
- this.__unsubscribeAll.complete();
565
- this.clearAllServiceData(clearData);
566
- this.handlePagination(false);
567
- };
568
- BaseComponent.prototype.handleErrorFromServices = function (error, f) {
569
- var _this = this;
570
- this.__monkeyecxFormErrors = null;
571
- if (error.type === 'Parameter_Error') {
572
- Object.entries(f.value).forEach(function (_a) {
573
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
574
- error.notifications.forEach(function (_) {
575
- var _a;
576
- var field = _.split(':')[0];
577
- var description = _.split(':')[1];
578
- if (field === key) {
579
- var msg = {
580
- firstMessage: '',
581
- lastMessage: description
582
- };
583
- _this.__monkeyecxFormErrors = Object.assign(Object.assign({}, _this.__monkeyecxFormErrors), (_a = {}, _a[key] = msg, _a));
584
- f.controls[key].setErrors({
585
- incorrect: true
586
- });
587
- }
588
- });
589
- });
590
- }
591
- f.markAllAsTouched();
592
- };
593
- BaseComponent.prototype.goBack = function () {
594
- window.history.back();
595
- };
596
- BaseComponent.prototype.goScroll = function (id) {
597
- var element = document.getElementById(id);
598
- if (element)
599
- element.scrollIntoView();
600
- };
601
- BaseComponent.prototype.getEmbeddedData = function (data, field) {
602
- var _embedded = data._embedded;
603
- return _embedded ? _embedded[field] : null;
604
- };
605
- BaseComponent.prototype.openWindow = function (url) {
606
- window.open("" + url, '_blank');
607
- };
608
- BaseComponent.prototype.fillI18n = function (data) {
609
- this.__i18n = data;
610
- };
611
- BaseComponent.prototype.getCountryPrefix = function (country) {
612
- return {
613
- br: 55,
614
- cl: 56
615
- }[country];
616
- };
617
- BaseComponent.prototype.getCountryCurrencyChartFormat = function (country) {
618
- return {
619
- br: 'R$ #,###,##0.00',
620
- cl: 'CLP #,###,##0'
621
- }[country];
622
- };
623
- BaseComponent.prototype.getCountryValidators = function (country) {
624
- return {
625
- br: {
626
- governmentId: monkeyFrontCore.ValidateUtils.DocumentValidator
627
- },
628
- cl: {
629
- governmentId: monkeyFrontCore.ValidateUtils.DocumentRutValidator
630
- }
631
- }[country];
632
- };
633
- return BaseComponent;
634
- }());
635
- BaseComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: BaseComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
636
- BaseComponent.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.14", type: BaseComponent, selector: "[baseComponent]", ngImport: i0__namespace });
637
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: BaseComponent, decorators: [{
638
- type: i0.Directive,
639
- args: [{
640
- selector: '[baseComponent]'
641
- }]
642
- }], ctorParameters: function () { return []; } });
643
-
644
- var validators = {
645
- required: i1$1.Validators.required,
646
- email: monkeyFrontCore.Validators.email,
647
- governmentId: monkeyFrontCore.Validators.documentBR,
648
- governmentIdRut: monkeyFrontCore.Validators.documentCL,
649
- documentBR: monkeyFrontCore.Validators.documentBR,
650
- documentCL: monkeyFrontCore.Validators.documentCL,
651
- date: monkeyFrontCore.Validators.date,
652
- zipCode: monkeyFrontCore.Validators.zipCode,
653
- minLength: function (param) {
654
- return i1$1.Validators.minLength(param);
655
- },
656
- maxLength: function (param) {
657
- return i1$1.Validators.maxLength(param);
658
- }
659
- };
660
-
661
- var BaseDynamic = /** @class */ (function (_super) {
662
- __extends(BaseDynamic, _super);
663
- function BaseDynamic(fb) {
664
- var _this = _super.call(this) || this;
665
- _this.fb = fb;
666
- _this.onHandleSubmit = new i0.EventEmitter();
667
- _this.onHandleUpdateForm = new i0.EventEmitter();
668
- _this.onHandleSubmitFormReady = new i0.EventEmitter();
669
- _this.fields = [];
670
- _this.disabled = false;
671
- return _this;
672
- }
673
- BaseDynamic.prototype.createControl = function () {
674
- var _this = this;
675
- var fields = this.fields;
676
- if (!fields)
677
- return null;
678
- // eslint-disable-next-line object-curly-newline
679
- var group = this.fb.group({});
680
- fields.forEach(function (field) {
681
- var fieldType = field.fieldType, validations = field.validations, name = field.name, disabled = field.disabled;
682
- var value = field.value;
683
- if (fieldType === 'button')
684
- return;
685
- if (fieldType === 'radiobutton' || fieldType === 'checkbox' || fieldType === 'select') {
686
- value = '';
687
- }
688
- var control = _this.fb.control(value, _this.bindValidations(validations || []));
689
- if (disabled || _this.disabled)
690
- control.disable();
691
- group.addControl(name, control);
692
- });
693
- return group;
694
- };
695
- BaseDynamic.prototype.bindValidations = function (validations) {
696
- if (validations.length > 0) {
697
- var validList_1 = [];
698
- validations.forEach(function (valid) {
699
- var validated = valid.param
700
- ? validators[valid.name](valid.param)
701
- : validators[valid.name];
702
- validList_1.push(validated);
703
- });
704
- return i1$1.Validators.compose(validList_1);
705
- }
706
- return null;
707
- };
708
- BaseDynamic.prototype.fillValues = function () {
709
- var _this = this;
710
- var data = this.data;
711
- if (!data || !this._form)
712
- return;
713
- Object.entries(data).forEach(function (_a) {
714
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
715
- if (i1.MonkeyUtils.persistNullEmptyUndefined(value) && _this._form.controls[key]) {
716
- _this._form.controls[key].setValue(value);
717
- }
718
- });
719
- };
720
- BaseDynamic.prototype.ngOnInit = function () {
721
- var _this = this;
722
- this._form = this.createControl();
723
- this.fillValues();
724
- this.onHandleUpdateForm.subscribe(function () {
725
- _this.fillValues();
726
- });
727
- };
728
- BaseDynamic.prototype.ngOnChanges = function () {
729
- if (!this._form) {
730
- this._form = this.createControl();
731
- }
732
- this.fillValues();
733
- };
734
- return BaseDynamic;
735
- }(BaseComponent));
736
- BaseDynamic.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: BaseDynamic, deps: [{ token: i1__namespace.FormBuilder }], target: i0__namespace.ɵɵFactoryTarget.Directive });
737
- BaseDynamic.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.14", type: BaseDynamic, selector: "[baseDynamic]", inputs: { onHandleSubmit: "onHandleSubmit", onHandleUpdateForm: "onHandleUpdateForm", self: "self", fields: "fields", data: "data", disabled: "disabled" }, outputs: { onHandleSubmitFormReady: "onHandleSubmitFormReady" }, usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace });
738
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: BaseDynamic, decorators: [{
739
- type: i0.Directive,
740
- args: [{
741
- selector: '[baseDynamic]'
742
- }]
743
- }], ctorParameters: function () { return [{ type: i1__namespace.FormBuilder }]; }, propDecorators: { onHandleSubmit: [{
744
- type: i0.Input
745
- }], onHandleUpdateForm: [{
746
- type: i0.Input
747
- }], onHandleSubmitFormReady: [{
748
- type: i0.Output
749
- }], self: [{
750
- type: i0.Input
751
- }], fields: [{
752
- type: i0.Input
753
- }], data: [{
754
- type: i0.Input
755
- }], disabled: [{
756
- type: i0.Input
757
- }] } });
758
-
759
- var BaseDynamicArray = /** @class */ (function (_super) {
760
- __extends(BaseDynamicArray, _super);
761
- function BaseDynamicArray(fb) {
762
- var _this = _super.call(this) || this;
763
- _this.fb = fb;
764
- _this.onHandleSubmit = new i0.EventEmitter();
765
- _this.onHandleUpdateForm = new i0.EventEmitter();
766
- _this.onHandleSubmitFormReady = new i0.EventEmitter();
767
- _this.fields = [];
768
- _this.qtd = 1;
769
- _this.disabled = false;
770
- // eslint-disable-next-line object-curly-newline
771
- _this._plusValidations = [];
772
- _this.changesUnsubscribe = new rxjs.Subject();
773
- _this.formBase = function () {
774
- // return this.fb.group(this.createControl());
775
- return _this.createControl();
776
- };
777
- return _this;
778
- }
779
- BaseDynamicArray.prototype.handleInternalPlusValidation = function (mainField, data) {
780
- var operator = mainField.operator, field = mainField.field, value = mainField.value;
781
- var validators = {
782
- e: function (val1, val2) { return val1 === val2; },
783
- lt: function (val1, val2) { return val1 < val2; },
784
- gt: function (val1, val2) { return val1 > val2; }
785
- };
786
- return validators[operator]((data === null || data === void 0 ? void 0 : data[field]) || data, value);
787
- };
788
- BaseDynamicArray.prototype.makeInternalPlusValidation = function (data, sourceField, settings, rowIndex) {
789
- var _this = this;
790
- var changeFields = function (show) {
791
- var saved = __spreadArray([], __read(_this.fields));
792
- saved.map(function (val) {
793
- var _b;
794
- var valSaved = Object.assign({}, val);
795
- if (val.name === sourceField) {
796
- _this._plusValidations[rowIndex] = (_b = {},
797
- _b[sourceField] = Object.assign(Object.assign({}, valSaved), { alwaysShow: show }),
798
- _b);
799
- _this.createOneControl(val.name, _this.formValues.controls[rowIndex], show);
800
- }
801
- else {
802
- _this._plusValidations[rowIndex] = Object.assign({}, valSaved);
803
- }
804
- return null;
805
- });
806
- };
807
- var validated = this.handleInternalPlusValidation(settings, data);
808
- changeFields(validated);
809
- };
810
- BaseDynamicArray.prototype.createOneControl = function (fieldName, ctrl, create) {
811
- var _this = this;
812
- if (create === void 0) { create = true; }
813
- var fields = this.fields;
814
- if (!fields)
815
- return;
816
- fields.forEach(function (field) {
817
- var fieldType = field.fieldType, validations = field.validations, name = field.name, disabled = field.disabled;
818
- if (name !== fieldName)
819
- return;
820
- var value = field.value;
821
- if (fieldType === 'button')
822
- return;
823
- if (fieldType === 'radiobutton' || fieldType === 'checkbox' || fieldType === 'select') {
824
- value = '';
825
- }
826
- if (create) {
827
- var control = _this.fb.control(value, _this.bindValidations(validations || []));
828
- if (disabled || _this.disabled)
829
- control.disable();
830
- ctrl.addControl(name, control);
831
- }
832
- else {
833
- ctrl.removeControl(name);
834
- }
835
- });
836
- };
837
- BaseDynamicArray.prototype.createControl = function (data) {
838
- var _this = this;
839
- var fields = this.fields;
840
- if (!fields)
841
- return null;
842
- // eslint-disable-next-line object-curly-newline
843
- var group = this.fb.group({});
844
- fields.forEach(function (field) {
845
- var fieldType = field.fieldType, validations = field.validations, name = field.name, disabled = field.disabled, alwaysShow = field.alwaysShow;
846
- var value = field.value;
847
- if (field.alwaysShowPlusValidation) {
848
- if (!_this.handleInternalPlusValidation(field.alwaysShowPlusValidation, data))
849
- return;
850
- }
851
- else if (!alwaysShow)
852
- return;
853
- if (fieldType === 'button')
854
- return;
855
- if (fieldType === 'radiobutton' || fieldType === 'checkbox' || fieldType === 'select') {
856
- value = '';
857
- }
858
- var control = _this.fb.control(value, _this.bindValidations(validations || []));
859
- if (disabled || _this.disabled)
860
- control.disable();
861
- group.addControl(name, control);
862
- });
863
- return group;
864
- };
865
- BaseDynamicArray.prototype.bindValidations = function (validations) {
866
- if (validations.length > 0) {
867
- var validList_1 = [];
868
- validations.forEach(function (valid) {
869
- var validated = valid.param
870
- ? validators[valid.name](valid.param)
871
- : validators[valid.name];
872
- validList_1.push(validated);
873
- });
874
- return i1$1.Validators.compose(validList_1);
875
- }
876
- return null;
877
- };
878
- BaseDynamicArray.prototype.buildForm = function () {
879
- var _this = this;
880
- var _a;
881
- var form = this.fb.group({
882
- fields: this.fb.array([])
883
- });
884
- (_a = form === null || form === void 0 ? void 0 : form.controls.fields) === null || _a === void 0 ? void 0 : _a.valueChanges.subscribe(function (_) {
885
- _this.watchForChanges();
886
- });
887
- return form;
888
- };
889
- BaseDynamicArray.prototype.watchForChanges = function () {
890
- var _this = this;
891
- var _b = this, fields = _b.fields, changesUnsubscribe = _b.changesUnsubscribe;
892
- changesUnsubscribe.next();
893
- this.formValues.controls.map(function (control, index) {
894
- fields.forEach(function (fieldConfig) {
895
- var _a;
896
- var name = fieldConfig.name, alwaysShowPlusValidation = fieldConfig.alwaysShowPlusValidation;
897
- if (!alwaysShowPlusValidation)
898
- return;
899
- var field = alwaysShowPlusValidation.field;
900
- if (field) {
901
- (_a = control.controls[field]) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(operators.takeUntil(changesUnsubscribe)).subscribe(function (_) {
902
- _this.makeInternalPlusValidation(_, name, alwaysShowPlusValidation, index);
903
- });
904
- }
905
- });
906
- return null;
907
- });
908
- };
909
- Object.defineProperty(BaseDynamicArray.prototype, "formValues", {
910
- get: function () {
911
- return this._form ? this._form.get('fields') : null;
912
- },
913
- enumerable: false,
914
- configurable: true
915
- });
916
- BaseDynamicArray.prototype.fillValues = function () {
917
- var _this = this;
918
- var _b = this, data = _b.data, qtd = _b.qtd;
919
- if ((!this._form) && qtd)
920
- return;
921
- if (qtd > 0) {
922
- Array(qtd)
923
- .fill(null)
924
- .map(function (_, index) {
925
- var form = _this.createControl();
926
- if (data && data[index]) {
927
- form = _this.createControl(data[index]);
928
- var handledData = data[index];
929
- Object.entries(handledData).forEach(function (_b) {
930
- var _c = __read(_b, 2), key = _c[0], value = _c[1];
931
- if (i1.MonkeyUtils.persistNullEmptyUndefined(value) && form.controls[key]) {
932
- form.controls[key].setValue(value);
933
- }
934
- });
935
- }
936
- _this.formValues.push(form);
937
- return null;
938
- });
939
- }
940
- };
941
- BaseDynamicArray.prototype.ngOnInit = function () {
942
- var _this = this;
943
- this._form = this.buildForm();
944
- this.fillValues();
945
- this.onHandleUpdateForm.subscribe(function () {
946
- _this.fillValues();
947
- });
948
- };
949
- BaseDynamicArray.prototype.ngOnChanges = function () {
950
- if (!this._form) {
951
- this._form = this.buildForm();
952
- }
953
- this.fillValues();
954
- };
955
- return BaseDynamicArray;
956
- }(BaseComponent));
957
- BaseDynamicArray.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: BaseDynamicArray, deps: [{ token: i1__namespace.FormBuilder }], target: i0__namespace.ɵɵFactoryTarget.Directive });
958
- BaseDynamicArray.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.14", type: BaseDynamicArray, selector: "[baseDynamicArray]", inputs: { onHandleSubmit: "onHandleSubmit", onHandleUpdateForm: "onHandleUpdateForm", self: "self", fields: "fields", data: "data", qtd: "qtd", disabled: "disabled" }, outputs: { onHandleSubmitFormReady: "onHandleSubmitFormReady" }, usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace });
959
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: BaseDynamicArray, decorators: [{
960
- type: i0.Directive,
961
- args: [{
962
- selector: '[baseDynamicArray]'
963
- }]
964
- }], ctorParameters: function () { return [{ type: i1__namespace.FormBuilder }]; }, propDecorators: { onHandleSubmit: [{
965
- type: i0.Input
966
- }], onHandleUpdateForm: [{
967
- type: i0.Input
968
- }], onHandleSubmitFormReady: [{
969
- type: i0.Output
970
- }], self: [{
971
- type: i0.Input
972
- }], fields: [{
973
- type: i0.Input
974
- }], data: [{
975
- type: i0.Input
976
- }], qtd: [{
977
- type: i0.Input
978
- }], disabled: [{
979
- type: i0.Input
980
- }] } });
981
-
982
- var MECXDynamicFileUploadComponent = /** @class */ (function () {
983
- function MECXDynamicFileUploadComponent(cdr) {
984
- var _this = this;
985
- this.cdr = cdr;
986
- // eslint-disable-next-line object-curly-newline
987
- this._formErrors = {};
988
- this._function = function (file, callback) {
989
- var _a, _b, _c, _d;
990
- if (_this._form.disabled)
991
- return;
992
- if (!((_b = (_a = _this._field) === null || _a === void 0 ? void 0 : _a.functions) === null || _b === void 0 ? void 0 : _b.onHandleUpload)) {
993
- console.error('onHandleUpload not declared');
994
- return;
995
- }
996
- var _e = (_d = (_c = _this._field) === null || _c === void 0 ? void 0 : _c.functions) === null || _d === void 0 ? void 0 : _d.onHandleUpload, func = _e.func, type = _e.type;
997
- if (!func || !_this.self[func]) {
998
- console.error('onHandleUpload not declared');
999
- return;
1000
- }
1001
- _this.self[func](file, type, callback);
1002
- };
1003
- // not to do
1004
- }
1005
- Object.defineProperty(MECXDynamicFileUploadComponent.prototype, "className", {
1006
- get: function () {
1007
- var _a, _b;
1008
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
1009
- },
1010
- enumerable: false,
1011
- configurable: true
1012
- });
1013
- MECXDynamicFileUploadComponent.prototype.ngOnChanges = function () {
1014
- this.cdr.detectChanges();
1015
- };
1016
- return MECXDynamicFileUploadComponent;
1017
- }());
1018
- MECXDynamicFileUploadComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicFileUploadComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1019
- MECXDynamicFileUploadComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicFileUploadComponent, selector: "mecx-dynamic-file-upload", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, usesOnChanges: true, ngImport: i0__namespace, template: "<monkey-file-upload\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\n [icon]=\"_field?.icon\" [formControl]=\"_form.controls[_field?.name]\"\n [placeholder]=\"_field?.placeholder | translate\"\n [helperMessage]=\"_field?.helperMessage | translate\" [label]=\"_field?.label | translate\"\n [maxSize]=\"_field?.maxSize || 5242880\" [fileUpload]=\"_function\"\n [maxSizeErrorMessage]=\"'FIELD.FILE.MAX-FILE' | translate\"\n [allowedExtensionErrorMessage]=\"'FIELD.FILE.ALLOWED-EXTENSION' | translate\"\n [allowedExtensions]=\"_field?.allowedExtensions || []\">\n</monkey-file-upload>", components: [{ type: i1__namespace$1.MonkeyFileUploadComponent, selector: "monkey-file-upload", inputs: ["name", "label", "helperMessage", "placeholder", "icon", "infoMessage", "uploadOngoingMessage", "errorMessage", "listenFiles", "maxSize", "allowedExtensions", "maxSizeErrorMessage", "allowedExtensionErrorMessage", "fileUpload", "value"], outputs: ["onChange", "onHandleFilesReady"] }], directives: [{ type: i1__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i3__namespace.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
1020
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicFileUploadComponent, decorators: [{
1021
- type: i0.Component,
1022
- args: [{
1023
- selector: 'mecx-dynamic-file-upload',
1024
- templateUrl: './file-upload.component.html',
1025
- encapsulation: i0.ViewEncapsulation.None
1026
- }]
1027
- }], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { _field: [{
1028
- type: i0.Input
1029
- }], _form: [{
1030
- type: i0.Input
1031
- }], _formErrors: [{
1032
- type: i0.Input
1033
- }], self: [{
1034
- type: i0.Input
1035
- }], className: [{
1036
- type: i0.HostBinding,
1037
- args: ['class']
1038
- }] } });
1039
-
1040
- var MECXDynamicButtonComponent = /** @class */ (function () {
1041
- function MECXDynamicButtonComponent(cdr) {
1042
- this.cdr = cdr;
1043
- // eslint-disable-next-line object-curly-newline
1044
- this._formErrors = {};
1045
- // not to do
1046
- }
1047
- Object.defineProperty(MECXDynamicButtonComponent.prototype, "className", {
1048
- get: function () {
1049
- var _a, _b;
1050
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
1051
- },
1052
- enumerable: false,
1053
- configurable: true
1054
- });
1055
- MECXDynamicButtonComponent.prototype.ngOnChanges = function () {
1056
- this.cdr.detectChanges();
1057
- };
1058
- MECXDynamicButtonComponent.prototype.onClick = function () {
1059
- var _a;
1060
- var _c = this, _form = _c._form, _field = _c._field, self = _c.self;
1061
- if (_form.disabled)
1062
- return;
1063
- var name = _field.name, value = _field.value;
1064
- var func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onClick;
1065
- if (func) {
1066
- self[func]({
1067
- name: name,
1068
- value: value,
1069
- form: _form
1070
- });
1071
- }
1072
- };
1073
- return MECXDynamicButtonComponent;
1074
- }());
1075
- MECXDynamicButtonComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicButtonComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1076
- MECXDynamicButtonComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicButtonComponent, selector: "mecx-dynamic-button", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, usesOnChanges: true, ngImport: i0__namespace, template: "<monkey-button [icon]=\"_field?.icon\" [type]=\"_field?.type\" [color]=\"_field?.color\"\n (click)=\"onClick()\">\n {{ _field?.label | translate }}\n</monkey-button>", styles: ["mecx-dynamic-button monkey-button button{height:40px}\n"], components: [{ type: i1__namespace$1.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], pipes: { "translate": i3__namespace.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
1077
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicButtonComponent, decorators: [{
1078
- type: i0.Component,
1079
- args: [{
1080
- selector: 'mecx-dynamic-button',
1081
- templateUrl: './button.component.html',
1082
- styleUrls: ['./button.component.scss'],
1083
- encapsulation: i0.ViewEncapsulation.None
1084
- }]
1085
- }], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { _field: [{
1086
- type: i0.Input
1087
- }], _form: [{
1088
- type: i0.Input
1089
- }], _formErrors: [{
1090
- type: i0.Input
1091
- }], self: [{
1092
- type: i0.Input
1093
- }], className: [{
1094
- type: i0.HostBinding,
1095
- args: ['class']
1096
- }] } });
1097
-
1098
- var MECXDynamicInputComponent = /** @class */ (function () {
1099
- function MECXDynamicInputComponent(cdr) {
1100
- this.cdr = cdr;
1101
- // eslint-disable-next-line object-curly-newline
1102
- this._formErrors = {};
1103
- // not to do
1104
- }
1105
- Object.defineProperty(MECXDynamicInputComponent.prototype, "className", {
1106
- get: function () {
1107
- var _a, _b;
1108
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
1109
- },
1110
- enumerable: false,
1111
- configurable: true
1112
- });
1113
- MECXDynamicInputComponent.prototype.ngOnInit = function () {
1114
- this.cdr.detectChanges();
1115
- };
1116
- MECXDynamicInputComponent.prototype.ngOnChanges = function () {
1117
- this.cdr.detectChanges();
1118
- };
1119
- MECXDynamicInputComponent.prototype.onChange = function (event) {
1120
- var _a;
1121
- var _c = this, _form = _c._form, _field = _c._field, self = _c.self;
1122
- var name = _field.name;
1123
- var func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onChange;
1124
- var isValid = _form.get(_field.name).valid;
1125
- if (func) {
1126
- self[func]({
1127
- name: name,
1128
- isValid: isValid,
1129
- event: event,
1130
- ctrl: _form.get(this._field.name),
1131
- form: _form
1132
- });
1133
- }
1134
- };
1135
- return MECXDynamicInputComponent;
1136
- }());
1137
- MECXDynamicInputComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicInputComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1138
- MECXDynamicInputComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicInputComponent, selector: "mecx-dynamic-input", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<monkey-input\r\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\r\n [mask]=\"_field?.mask\" [prefix]=\"_field?.prefix\" [name]=\"_field?.name\"\r\n [formControl]=\"_form.controls[_field?.name]\" [placeholder]=\"_field?.placeholder | translate\"\r\n [helperMessage]=\"_field?.helperMessage | translate\" [label]=\"_field?.label | translate\"\r\n [type]=\"_field?.type\" #inputElement (onChange)=\"onChange($event)\"\r\n [onlyNumber]=\"_field?.onlyNumber\" [currency]=\"_field?.currency\" [maxLength]=\"_field?.maxLength\"\r\n [maxDateToday]=\"_field?.maxDateToday\">\r\n</monkey-input>", components: [{ type: i1__namespace$1.MonkeyInputComponent, selector: "monkey-input", inputs: ["name", "label", "helperMessage", "placeholder", "icon", "type", "infoMessage", "errorMessage", "mask", "prefix", "maxLength", "onlyNumber", "onlyAlphaNumeric", "upperCase", "lowerCase", "capitalize", "currency", "percent", "maxDateToday", "value"], outputs: ["onChange"] }], directives: [{ type: i1__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i3__namespace.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
1139
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicInputComponent, decorators: [{
1140
- type: i0.Component,
1141
- args: [{
1142
- selector: 'mecx-dynamic-input',
1143
- templateUrl: './input.component.html',
1144
- encapsulation: i0.ViewEncapsulation.None
1145
- }]
1146
- }], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { _field: [{
1147
- type: i0.Input
1148
- }], _form: [{
1149
- type: i0.Input
1150
- }], _formErrors: [{
1151
- type: i0.Input
1152
- }], self: [{
1153
- type: i0.Input
1154
- }], inputElement: [{
1155
- type: i0.ViewChild,
1156
- args: ['inputElement', {
1157
- static: true
1158
- }]
1159
- }], className: [{
1160
- type: i0.HostBinding,
1161
- args: ['class']
1162
- }] } });
1163
-
1164
- var MECXDynamicInputPhoneComponent = /** @class */ (function () {
1165
- function MECXDynamicInputPhoneComponent(cdr) {
1166
- this.cdr = cdr;
1167
- // eslint-disable-next-line object-curly-newline
1168
- this._formErrors = {};
1169
- // not to do
1170
- }
1171
- Object.defineProperty(MECXDynamicInputPhoneComponent.prototype, "className", {
1172
- get: function () {
1173
- var _a, _b;
1174
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
1175
- },
1176
- enumerable: false,
1177
- configurable: true
1178
- });
1179
- MECXDynamicInputPhoneComponent.prototype.ngOnInit = function () {
1180
- this.cdr.detectChanges();
1181
- };
1182
- MECXDynamicInputPhoneComponent.prototype.ngOnChanges = function () {
1183
- this.cdr.detectChanges();
1184
- };
1185
- MECXDynamicInputPhoneComponent.prototype.onChange = function (event) {
1186
- var _a;
1187
- var _c = this, _form = _c._form, _field = _c._field, self = _c.self;
1188
- var name = _field.name;
1189
- var func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onChange;
1190
- var isValid = _form.get(_field.name).valid;
1191
- if (func) {
1192
- self[func]({
1193
- name: name,
1194
- isValid: isValid,
1195
- event: event,
1196
- ctrl: _form.get(this._field.name),
1197
- form: _form
1198
- });
1199
- }
1200
- };
1201
- return MECXDynamicInputPhoneComponent;
1202
- }());
1203
- MECXDynamicInputPhoneComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicInputPhoneComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1204
- MECXDynamicInputPhoneComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicInputPhoneComponent, selector: "mecx-dynamic-input-phone", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<monkey-input-phone [name]=\"_field?.name\" [label]=\"_field?.label | translate\"\r\n [helperMessage]=\"_field?.helperMessage | translate\"\r\n [placeholder]=\"_field?.placeholder | translate\" [icon]=\"_field?.icon\"\r\n (onChange)=\"onChange($event)\" [internationalNumber]=\"_field?.internationalNumber\"\r\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\r\n [maxLength]=\"_field?.maxLength\" [formControl]=\"_form.controls[_field?.name]\" #inputElement>\r\n</monkey-input-phone>", components: [{ type: i1__namespace$1.MonkeyInputPhoneComponent, selector: "monkey-input-phone", inputs: ["name", "label", "helperMessage", "placeholder", "icon", "infoMessage", "errorMessage", "maxLength", "internationalNumber", "value"], outputs: ["onChange"] }], directives: [{ type: i1__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i3__namespace.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
1205
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicInputPhoneComponent, decorators: [{
1206
- type: i0.Component,
1207
- args: [{
1208
- selector: 'mecx-dynamic-input-phone',
1209
- templateUrl: './input-phone.component.html',
1210
- encapsulation: i0.ViewEncapsulation.None
1211
- }]
1212
- }], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { _field: [{
1213
- type: i0.Input
1214
- }], _form: [{
1215
- type: i0.Input
1216
- }], _formErrors: [{
1217
- type: i0.Input
1218
- }], self: [{
1219
- type: i0.Input
1220
- }], inputElement: [{
1221
- type: i0.ViewChild,
1222
- args: ['inputElement', {
1223
- static: true
1224
- }]
1225
- }], className: [{
1226
- type: i0.HostBinding,
1227
- args: ['class']
1228
- }] } });
1229
-
1230
- var MECXDynamicRadioComponent = /** @class */ (function () {
1231
- function MECXDynamicRadioComponent() {
1232
- // eslint-disable-next-line object-curly-newline
1233
- this._formErrors = {};
1234
- }
1235
- Object.defineProperty(MECXDynamicRadioComponent.prototype, "className", {
1236
- get: function () {
1237
- var _a, _b;
1238
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
1239
- },
1240
- enumerable: false,
1241
- configurable: true
1242
- });
1243
- return MECXDynamicRadioComponent;
1244
- }());
1245
- MECXDynamicRadioComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicRadioComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1246
- MECXDynamicRadioComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicRadioComponent, selector: "mecx-dynamic-radio", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors" }, host: { properties: { "class": "this.className" } }, ngImport: i0__namespace, template: "<monkey-radiobutton\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\n [formControl]=\"_form.controls[_field?.name]\" [helperMessage]=\"_field?.helperMessage | translate\"\n [label]=\"_field?.label | translate\">\n <monkey-option *ngFor=\"let value of _field?.value\" [label]=\"value.description | translate\"\n [value]=\"value.value\">\n </monkey-option>\n</monkey-radiobutton>", components: [{ type: i1__namespace$1.MonkeyRadioButtonComponent, selector: "monkey-radiobutton", inputs: ["label", "helperMessage", "placeholder", "icon", "infoMessage", "errorMessage", "value"], outputs: ["onChange"] }, { type: i1__namespace$1.MonkeyOptionComponent, selector: "monkey-option", inputs: ["type", "label", "value", "selectAll", "selected", "enableClick"], outputs: ["onSelectOption"] }], directives: [{ type: i1__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i3__namespace.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
1247
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicRadioComponent, decorators: [{
1248
- type: i0.Component,
1249
- args: [{
1250
- selector: 'mecx-dynamic-radio',
1251
- templateUrl: './radio.component.html',
1252
- encapsulation: i0.ViewEncapsulation.None
1253
- }]
1254
- }], propDecorators: { _field: [{
1255
- type: i0.Input
1256
- }], _form: [{
1257
- type: i0.Input
1258
- }], _formErrors: [{
1259
- type: i0.Input
1260
- }], className: [{
1261
- type: i0.HostBinding,
1262
- args: ['class']
1263
- }] } });
1264
-
1265
- var MECXDynamicSelectComponent = /** @class */ (function () {
1266
- function MECXDynamicSelectComponent() {
1267
- // eslint-disable-next-line object-curly-newline
1268
- this._formErrors = {};
1269
- this._onHandleOptions = new i0.EventEmitter();
1270
- }
1271
- Object.defineProperty(MECXDynamicSelectComponent.prototype, "className", {
1272
- get: function () {
1273
- var _a, _b;
1274
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
1275
- },
1276
- enumerable: false,
1277
- configurable: true
1278
- });
1279
- MECXDynamicSelectComponent.prototype.onHandleGenericLoad = function () {
1280
- var _this = this;
1281
- var _a, _b;
1282
- var _c = this, _form = _c._form, _field = _c._field, self = _c.self;
1283
- if (_form.disabled)
1284
- return;
1285
- var name = _field.name;
1286
- if ((_a = _field === null || _field === void 0 ? void 0 : _field.value) === null || _a === void 0 ? void 0 : _a.length)
1287
- return;
1288
- var _d = (_b = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _b === void 0 ? void 0 : _b.onHandleGenericLoad, func = _d.func, url = _d.url;
1289
- if (!func || !self[func]) {
1290
- console.error('onHandleGenericLoad not declared');
1291
- return;
1292
- }
1293
- _form.disable();
1294
- self[func]({
1295
- name: name,
1296
- url: url,
1297
- form: _form,
1298
- callback: function (data) {
1299
- _this._field.value = data;
1300
- _this._form.enable();
1301
- _this._onHandleOptions.next(null);
1302
- }
1303
- });
1304
- };
1305
- MECXDynamicSelectComponent.prototype.onChange = function (event) {
1306
- var _a;
1307
- var _c = this, _form = _c._form, _field = _c._field, self = _c.self;
1308
- var name = _field.name;
1309
- var func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onChange;
1310
- var isValid = _form.get(_field.name).valid;
1311
- if (func) {
1312
- self[func]({
1313
- name: name,
1314
- isValid: isValid,
1315
- event: event,
1316
- ctrl: _form.get(this._field.name),
1317
- form: _form,
1318
- value: _field.value
1319
- });
1320
- }
1321
- };
1322
- return MECXDynamicSelectComponent;
1323
- }());
1324
- MECXDynamicSelectComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicSelectComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1325
- MECXDynamicSelectComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicSelectComponent, selector: "mecx-dynamic-select", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, ngImport: i0__namespace, template: "<monkey-select\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\n [formControl]=\"_form.controls[_field?.name]\" [helperMessage]=\"_field?.helperMessage | translate\"\n [label]=\"_field?.label | translate\" (click)=\"onHandleGenericLoad()\"\n [onHandleOptions]=\"_onHandleOptions\" (onChange)=\"onChange($event)\"\n [labelSelect]=\"_form.get(_field?.name).value || ('FIELD.SELECT' | translate)\"\n [placeholder]=\"_field?.placeholder | translate\">\n <monkey-option [label]=\"'FIELD.LOADING' | translate\" *ngIf=\"!_field?.value?.length\"\n enableClick=\"false\">\n </monkey-option>\n <monkey-option *ngFor=\"let value of _field?.value\" [label]=\"value.description | translate\"\n [value]=\"value.value\">\n </monkey-option>\n</monkey-select>", components: [{ type: i1__namespace$1.MonkeySelectComponent, selector: "monkey-select", inputs: ["label", "helperMessage", "placeholder", "icon", "infoMessage", "errorMessage", "labelSelect", "onHandleOptions", "value"], outputs: ["onChange"] }, { type: i1__namespace$1.MonkeyOptionComponent, selector: "monkey-option", inputs: ["type", "label", "value", "selectAll", "selected", "enableClick"], outputs: ["onSelectOption"] }], directives: [{ type: i1__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i3__namespace.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
1326
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicSelectComponent, decorators: [{
1327
- type: i0.Component,
1328
- args: [{
1329
- selector: 'mecx-dynamic-select',
1330
- templateUrl: './select.component.html',
1331
- encapsulation: i0.ViewEncapsulation.None
1332
- }]
1333
- }], propDecorators: { _field: [{
1334
- type: i0.Input
1335
- }], _form: [{
1336
- type: i0.Input
1337
- }], _formErrors: [{
1338
- type: i0.Input
1339
- }], self: [{
1340
- type: i0.Input
1341
- }], className: [{
1342
- type: i0.HostBinding,
1343
- args: ['class']
1344
- }] } });
1345
-
1346
- var MECXDynamicSelectSearchComponent = /** @class */ (function () {
1347
- function MECXDynamicSelectSearchComponent() {
1348
- // eslint-disable-next-line object-curly-newline
1349
- this._formErrors = {};
1350
- this._onHandleOptions = new i0.EventEmitter();
1351
- }
1352
- Object.defineProperty(MECXDynamicSelectSearchComponent.prototype, "className", {
1353
- get: function () {
1354
- var _a, _b;
1355
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
1356
- },
1357
- enumerable: false,
1358
- configurable: true
1359
- });
1360
- MECXDynamicSelectSearchComponent.prototype.onHandleGenericLoad = function () {
1361
- var _this = this;
1362
- var _a, _b;
1363
- var _c = this, _form = _c._form, _field = _c._field, self = _c.self;
1364
- if (_form.disabled)
1365
- return;
1366
- var name = _field.name;
1367
- if ((_a = _field === null || _field === void 0 ? void 0 : _field.value) === null || _a === void 0 ? void 0 : _a.length)
1368
- return;
1369
- var _d = (_b = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _b === void 0 ? void 0 : _b.onHandleGenericLoad, func = _d.func, url = _d.url;
1370
- if (!func || !self[func]) {
1371
- console.error('onHandleGenericLoad not declared');
1372
- return;
1373
- }
1374
- _form.disable();
1375
- self[func]({
1376
- name: name,
1377
- url: url,
1378
- form: _form,
1379
- callback: function (data) {
1380
- _this._field.value = data;
1381
- _this._form.enable();
1382
- _this._onHandleOptions.next(null);
1383
- }
1384
- });
1385
- };
1386
- MECXDynamicSelectSearchComponent.prototype.onChange = function (event) {
1387
- var _a;
1388
- var _c = this, _form = _c._form, _field = _c._field, self = _c.self;
1389
- var name = _field.name;
1390
- var func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onChange;
1391
- var isValid = _form.get(_field.name).valid;
1392
- if (func) {
1393
- self[func]({
1394
- name: name,
1395
- isValid: isValid,
1396
- event: event,
1397
- ctrl: _form.get(this._field.name),
1398
- form: _form,
1399
- value: _field.value
1400
- });
1401
- }
1402
- };
1403
- return MECXDynamicSelectSearchComponent;
1404
- }());
1405
- MECXDynamicSelectSearchComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicSelectSearchComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1406
- MECXDynamicSelectSearchComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicSelectSearchComponent, selector: "mecx-dynamic-select-search", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, ngImport: i0__namespace, template: "<monkey-select-search\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\n [formControl]=\"_form.controls[_field?.name]\" [helperMessage]=\"_field?.helperMessage | translate\"\n [label]=\"_field?.label | translate\" (click)=\"onHandleGenericLoad()\"\n [onHandleOptions]=\"_onHandleOptions\" (onChange)=\"onChange($event)\"\n [fieldToCompare]=\"_field?.fieldToCompare\"\n [labelSelect]=\"_form.get(_field?.name).value || ('FIELD.SELECT' | translate)\"\n [placeholder]=\"_field?.placeholder | translate\">\n <monkey-option [label]=\"'FIELD.LOADING' | translate\" *ngIf=\"!_field?.value?.length\"\n enableClick=\"false\">\n </monkey-option>\n <monkey-option *ngFor=\"let value of _field?.value\" [label]=\"value.description | translate\"\n [value]=\"value.value\">\n </monkey-option>\n</monkey-select-search>", components: [{ type: i1__namespace$1.MonkeySelectSearchComponent, selector: "monkey-select-search", inputs: ["label", "helperMessage", "placeholder", "icon", "infoMessage", "errorMessage", "labelSelect", "fieldToCompare", "onHandleOptions", "value"], outputs: ["onChange", "onSearch"] }, { type: i1__namespace$1.MonkeyOptionComponent, selector: "monkey-option", inputs: ["type", "label", "value", "selectAll", "selected", "enableClick"], outputs: ["onSelectOption"] }], directives: [{ type: i1__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1__namespace.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i3__namespace.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
1407
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicSelectSearchComponent, decorators: [{
1408
- type: i0.Component,
1409
- args: [{
1410
- selector: 'mecx-dynamic-select-search',
1411
- templateUrl: './select-search.component.html',
1412
- encapsulation: i0.ViewEncapsulation.None
1413
- }]
1414
- }], propDecorators: { _field: [{
1415
- type: i0.Input
1416
- }], _form: [{
1417
- type: i0.Input
1418
- }], _formErrors: [{
1419
- type: i0.Input
1420
- }], self: [{
1421
- type: i0.Input
1422
- }], className: [{
1423
- type: i0.HostBinding,
1424
- args: ['class']
1425
- }] } });
1426
-
1427
- var componentMapper = {
1428
- input: MECXDynamicInputComponent,
1429
- 'input-phone': MECXDynamicInputPhoneComponent,
1430
- radiobutton: MECXDynamicRadioComponent,
1431
- select: MECXDynamicSelectComponent,
1432
- 'select-search': MECXDynamicSelectSearchComponent,
1433
- 'file-upload': MECXDynamicFileUploadComponent,
1434
- button: MECXDynamicButtonComponent
1435
- };
1436
- var MECXDynamicDirective = /** @class */ (function () {
1437
- function MECXDynamicDirective(resolver, container, cdr) {
1438
- this.resolver = resolver;
1439
- this.container = container;
1440
- this.cdr = cdr;
1441
- // not to do
1442
- }
1443
- MECXDynamicDirective.prototype.handleInternalPlusValidation = function () {
1444
- var _a, _b;
1445
- if (!((_a = this.field) === null || _a === void 0 ? void 0 : _a.alwaysShowPlusValidation))
1446
- return false;
1447
- var _e = (_b = this.field) === null || _b === void 0 ? void 0 : _b.alwaysShowPlusValidation, operator = _e.operator, value = _e.value, field = _e.field;
1448
- var validators = {
1449
- e: function (val1, val2) { return val1 === val2; },
1450
- lt: function (val1, val2) { return val1 < val2; },
1451
- gt: function (val1, val2) { return val1 > val2; }
1452
- };
1453
- var data = this.form.controls[field].value;
1454
- return validators[operator](data, value);
1455
- };
1456
- MECXDynamicDirective.prototype.buildComponent = function () {
1457
- var _a;
1458
- if ((_a = this.componentRef) === null || _a === void 0 ? void 0 : _a.instance)
1459
- return;
1460
- var factory = this.resolver.resolveComponentFactory(componentMapper[this.field.fieldType]);
1461
- this.componentRef = this.container.createComponent(factory);
1462
- this.componentRef.instance._field = this.field;
1463
- this.componentRef.instance._form = this.form;
1464
- // eslint-disable-next-line object-curly-newline
1465
- this.componentRef.instance._formErrors = this.formErrors || {};
1466
- this.componentRef.instance.self = this.self;
1467
- };
1468
- MECXDynamicDirective.prototype.ngOnInit = function () {
1469
- if (!this.field.alwaysShow && !this.handleInternalPlusValidation())
1470
- return;
1471
- this.buildComponent();
1472
- };
1473
- MECXDynamicDirective.prototype.ngOnChanges = function () {
1474
- var _this = this;
1475
- var _a, _b, _c, _d;
1476
- if (this.plusValidations && this.plusValidations[this.field.name]) {
1477
- if (!this.field.alwaysShow && this.plusValidations[this.field.name].alwaysShow) {
1478
- setTimeout(function () {
1479
- _this.buildComponent();
1480
- _this.cdr.detectChanges();
1481
- }, 1);
1482
- }
1483
- if (((_a = this.componentRef) === null || _a === void 0 ? void 0 : _a.instance) && !this.plusValidations[this.field.name].alwaysShow) {
1484
- this.componentRef.destroy();
1485
- this.componentRef = null;
1486
- (_b = this.form.controls[this.field.name]) === null || _b === void 0 ? void 0 : _b.setValue(null);
1487
- (_c = this.form.controls[this.field.name]) === null || _c === void 0 ? void 0 : _c.clearValidators();
1488
- }
1489
- }
1490
- if (!((_d = this.componentRef) === null || _d === void 0 ? void 0 : _d.instance))
1491
- return;
1492
- this.componentRef.instance._formErrors = this.formErrors || {};
1493
- };
1494
- return MECXDynamicDirective;
1495
- }());
1496
- MECXDynamicDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicDirective, deps: [{ token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ViewContainerRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1497
- MECXDynamicDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicDirective, selector: "[MECXDynamic]", inputs: { field: "field", form: "form", formErrors: "formErrors", self: "self", plusValidations: "plusValidations" }, usesOnChanges: true, ngImport: i0__namespace });
1498
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicDirective, decorators: [{
1499
- type: i0.Directive,
1500
- args: [{
1501
- selector: '[MECXDynamic]'
1502
- }]
1503
- }], ctorParameters: function () { return [{ type: i0__namespace.ComponentFactoryResolver }, { type: i0__namespace.ViewContainerRef }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { field: [{
1504
- type: i0.Input
1505
- }], form: [{
1506
- type: i0.Input
1507
- }], formErrors: [{
1508
- type: i0.Input
1509
- }], self: [{
1510
- type: i0.Input
1511
- }], plusValidations: [{
1512
- type: i0.Input
1513
- }] } });
1514
-
1515
- var MECXDynamicFormComponent = /** @class */ (function (_super) {
1516
- __extends(MECXDynamicFormComponent, _super);
1517
- function MECXDynamicFormComponent(fb, cdr) {
1518
- var _this = _super.call(this, fb) || this;
1519
- _this.cdr = cdr;
1520
- _this.unsubscribeAll = new rxjs.Subject();
1521
- return _this;
1522
- }
1523
- MECXDynamicFormComponent.prototype.ngOnInit = function () {
1524
- var _this = this;
1525
- _super.prototype.ngOnInit.call(this);
1526
- this.onHandleSubmit.pipe(operators.takeUntil(this.unsubscribeAll)).subscribe(function (func) {
1527
- _this.onSubmit(func);
1528
- });
1529
- };
1530
- MECXDynamicFormComponent.prototype.ngOnDestroy = function () {
1531
- this.unsubscribeAll.next();
1532
- this.unsubscribeAll.complete();
1533
- };
1534
- MECXDynamicFormComponent.prototype.onSubmit = function (callback) {
1535
- var _form = this._form;
1536
- // eslint-disable-next-line object-curly-newline
1537
- this.__monkeyecxFormErrors = {};
1538
- var isValid = this.validateForm(_form);
1539
- this.cdr.detectChanges();
1540
- this.onHandleSubmitFormReady.next({
1541
- validate: {
1542
- isValid: isValid
1543
- },
1544
- callback: callback,
1545
- form: _form
1546
- });
1547
- };
1548
- return MECXDynamicFormComponent;
1549
- }(BaseDynamic));
1550
- MECXDynamicFormComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicFormComponent, deps: [{ token: i1__namespace.FormBuilder }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1551
- MECXDynamicFormComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicFormComponent, selector: "mecx-dynamic-form", usesInheritance: true, ngImport: i0__namespace, template: "<form name=\"form\" [formGroup]=\"_form\" *ngIf=\"_form\">\n <div class=\"row\">\n <div *ngFor=\"let field of fields;\" MECXDynamic [field]=\"field\" [form]=\"_form\" [self]=\"self\"\n [formErrors]=\"__monkeyecxFormErrors\" [style.display]=\"'none'\">\n </div>\n </div>\n</form>", directives: [{ type: i3__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MECXDynamicDirective, selector: "[MECXDynamic]", inputs: ["field", "form", "formErrors", "self", "plusValidations"] }], encapsulation: i0__namespace.ViewEncapsulation.None });
1552
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicFormComponent, decorators: [{
1553
- type: i0.Component,
1554
- args: [{
1555
- selector: 'mecx-dynamic-form',
1556
- templateUrl: './dynamic-form.component.html',
1557
- styles: [],
1558
- encapsulation: i0.ViewEncapsulation.None
1559
- }]
1560
- }], ctorParameters: function () { return [{ type: i1__namespace.FormBuilder }, { type: i0__namespace.ChangeDetectorRef }]; } });
1561
-
1562
- var MECXDynamicFormArrayComponent = /** @class */ (function (_super) {
1563
- __extends(MECXDynamicFormArrayComponent, _super);
1564
- function MECXDynamicFormArrayComponent(fb, cdr) {
1565
- var _this = _super.call(this, fb) || this;
1566
- _this.cdr = cdr;
1567
- _this.unsubscribeAll = new rxjs.Subject();
1568
- _this.__monkeyecxFormErrors = [];
1569
- return _this;
1570
- }
1571
- MECXDynamicFormArrayComponent.prototype.ngOnInit = function () {
1572
- var _this = this;
1573
- _super.prototype.ngOnInit.call(this);
1574
- this.onHandleSubmit.pipe(operators.takeUntil(this.unsubscribeAll)).subscribe(function (func) {
1575
- _this.onSubmit(func);
1576
- });
1577
- };
1578
- MECXDynamicFormArrayComponent.prototype.ngOnDestroy = function () {
1579
- this.unsubscribeAll.next();
1580
- this.unsubscribeAll.complete();
1581
- };
1582
- MECXDynamicFormArrayComponent.prototype.onSubmit = function (callback) {
1583
- var _this = this;
1584
- var _form = this._form;
1585
- // eslint-disable-next-line object-curly-newline
1586
- this.__monkeyecxFormErrors = [];
1587
- var validate = {
1588
- isValid: false
1589
- };
1590
- var hasErrors = false;
1591
- if (this.formValues) {
1592
- this.__monkeyecxFormErrors = [this.formValues.length];
1593
- this.formValues.controls.forEach(function (item, index) {
1594
- if (item instanceof i1$1.FormGroup) {
1595
- if (!_this.validateForm(item, index)) {
1596
- hasErrors = true;
1597
- }
1598
- }
1599
- });
1600
- }
1601
- validate = {
1602
- isValid: !hasErrors
1603
- };
1604
- this.cdr.detectChanges();
1605
- this.onHandleSubmitFormReady.next({
1606
- validate: validate,
1607
- callback: callback,
1608
- form: _form
1609
- });
1610
- };
1611
- MECXDynamicFormArrayComponent.prototype.onHandleAdd = function () {
1612
- this.formValues.push(this.formBase());
1613
- this.cdr.detectChanges();
1614
- };
1615
- MECXDynamicFormArrayComponent.prototype.onHandleRemove = function (index) {
1616
- this.formValues.removeAt(index);
1617
- this._plusValidations.splice(index, 1);
1618
- };
1619
- return MECXDynamicFormArrayComponent;
1620
- }(BaseDynamicArray));
1621
- MECXDynamicFormArrayComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicFormArrayComponent, deps: [{ token: i1__namespace.FormBuilder }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1622
- MECXDynamicFormArrayComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicFormArrayComponent, selector: "mecx-dynamic-form-array", usesInheritance: true, ngImport: i0__namespace, template: "<form name=\"form\" [formGroup]=\"_form\" *ngIf=\"_form\">\n <div formArrayName=\"fields\">\n <div *ngFor=\"let item of formValues.controls; let indForm=index\" [formGroupName]=\"indForm\">\n <monkey-button type=\"secondary\" color=\"error\" icon=\"close-20\" iconPosition=\"right\"\n [label]=\"'BUTTONS.REMOVE' | translate\" (click)=\"onHandleRemove(indForm)\"\n *ngIf=\"formValues.controls.length > 1 && !disabled\">\n </monkey-button>\n <div class=\"row mt-3\">\n <div *ngFor=\"let field of fields;\" MECXDynamic [field]=\"field\" [form]=\"item\" [self]=\"self\"\n [formErrors]=\"__monkeyecxFormErrors[indForm]\"\n [plusValidations]=\"_plusValidations[indForm]\" [style.display]=\"'none'\">\n </div>\n </div>\n </div>\n </div>\n</form>\n<monkey-button type=\"secondary\" color=\"theme\" icon=\"more-20\" iconPosition=\"right\"\n [label]=\"'BUTTONS.ADD' | translate\" (click)=\"onHandleAdd()\" *ngIf=\"!disabled\">\n</monkey-button>", styles: ["mecx-dynamic-form-array monkey-button{width:100%}mecx-dynamic-form-array monkey-button button{width:100%;height:40px}\n"], components: [{ type: i1__namespace$1.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i3__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1__namespace.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i3__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: MECXDynamicDirective, selector: "[MECXDynamic]", inputs: ["field", "form", "formErrors", "self", "plusValidations"] }], pipes: { "translate": i3__namespace.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
1623
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicFormArrayComponent, decorators: [{
1624
- type: i0.Component,
1625
- args: [{
1626
- selector: 'mecx-dynamic-form-array',
1627
- templateUrl: './dynamic-form-array.component.html',
1628
- styleUrls: ['./dynamic-form-array.component.scss'],
1629
- encapsulation: i0.ViewEncapsulation.None
1630
- }]
1631
- }], ctorParameters: function () { return [{ type: i1__namespace.FormBuilder }, { type: i0__namespace.ChangeDetectorRef }]; } });
1632
-
1633
- var MECXDynamicModule = /** @class */ (function () {
1634
- function MECXDynamicModule() {
1635
- }
1636
- return MECXDynamicModule;
1637
- }());
1638
- MECXDynamicModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1639
- MECXDynamicModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicModule, declarations: [MECXDynamicButtonComponent,
1640
- MECXDynamicFileUploadComponent,
1641
- MECXDynamicFormComponent,
1642
- MECXDynamicFormArrayComponent,
1643
- MECXDynamicInputComponent,
1644
- MECXDynamicInputPhoneComponent,
1645
- MECXDynamicRadioComponent,
1646
- MECXDynamicSelectComponent,
1647
- MECXDynamicSelectSearchComponent,
1648
- MECXDynamicDirective], imports: [i3$1.CommonModule,
1649
- i1$1.FormsModule,
1650
- i1$1.ReactiveFormsModule,
1651
- i1.MonkeyInputModule,
1652
- i1.MonkeySelectModule,
1653
- i1.MonkeyRadioButtonModule,
1654
- i1.MonkeyOptionModule,
1655
- i1.MonkeyFileUploadModule,
1656
- i1.MonkeyButtonModule,
1657
- i1.MonkeyInputPhoneModule, i3__namespace.TranslateModule], exports: [MECXDynamicDirective, MECXDynamicFormComponent, MECXDynamicFormArrayComponent] });
1658
- MECXDynamicModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicModule, imports: [[
1659
- i3$1.CommonModule,
1660
- i1$1.FormsModule,
1661
- i1$1.ReactiveFormsModule,
1662
- i1.MonkeyInputModule,
1663
- i1.MonkeySelectModule,
1664
- i1.MonkeyRadioButtonModule,
1665
- i1.MonkeyOptionModule,
1666
- i1.MonkeyFileUploadModule,
1667
- i1.MonkeyButtonModule,
1668
- i1.MonkeyInputPhoneModule,
1669
- i3.TranslateModule.forChild()
1670
- ]] });
1671
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0__namespace, type: MECXDynamicModule, decorators: [{
1672
- type: i0.NgModule,
1673
- args: [{
1674
- declarations: [
1675
- MECXDynamicButtonComponent,
1676
- MECXDynamicFileUploadComponent,
1677
- MECXDynamicFormComponent,
1678
- MECXDynamicFormArrayComponent,
1679
- MECXDynamicInputComponent,
1680
- MECXDynamicInputPhoneComponent,
1681
- MECXDynamicRadioComponent,
1682
- MECXDynamicSelectComponent,
1683
- MECXDynamicSelectSearchComponent,
1684
- MECXDynamicDirective
1685
- ],
1686
- imports: [
1687
- i3$1.CommonModule,
1688
- i1$1.FormsModule,
1689
- i1$1.ReactiveFormsModule,
1690
- i1.MonkeyInputModule,
1691
- i1.MonkeySelectModule,
1692
- i1.MonkeyRadioButtonModule,
1693
- i1.MonkeyOptionModule,
1694
- i1.MonkeyFileUploadModule,
1695
- i1.MonkeyButtonModule,
1696
- i1.MonkeyInputPhoneModule,
1697
- i3.TranslateModule.forChild()
1698
- ],
1699
- exports: [MECXDynamicDirective, MECXDynamicFormComponent, MECXDynamicFormArrayComponent],
1700
- entryComponents: [MECXDynamicInputComponent]
1701
- }]
1702
- }] });
1703
-
1704
- /*
1705
- * Public API Surface of monkey-front-components
1706
- */
1707
-
1708
- /**
1709
- * Generated bundle index. Do not edit.
1710
- */
1711
-
1712
- exports.BaseComponent = BaseComponent;
1713
- exports.BaseDynamic = BaseDynamic;
1714
- exports.BaseDynamicArray = BaseDynamicArray;
1715
- exports.MECXDynamicDirective = MECXDynamicDirective;
1716
- exports.MECXDynamicFileUploadComponent = MECXDynamicFileUploadComponent;
1717
- exports.MECXDynamicFormArrayComponent = MECXDynamicFormArrayComponent;
1718
- exports.MECXDynamicFormComponent = MECXDynamicFormComponent;
1719
- exports.MECXDynamicInputComponent = MECXDynamicInputComponent;
1720
- exports.MECXDynamicInputPhoneComponent = MECXDynamicInputPhoneComponent;
1721
- exports.MECXDynamicModule = MECXDynamicModule;
1722
- exports.MECXDynamicRadioComponent = MECXDynamicRadioComponent;
1723
- exports.MECXDynamicSelectComponent = MECXDynamicSelectComponent;
1724
- exports.validators = validators;
1725
-
1726
- Object.defineProperty(exports, '__esModule', { value: true });
1727
-
1728
- }));
1729
- //# sourceMappingURL=monkey-front-components.umd.js.map