monkey-front-components 0.0.180 → 0.0.181

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