monkey-front-components 0.0.179 → 0.0.183

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/esm2020/lib/components/base/base-component.mjs +291 -0
  2. package/esm2020/lib/components/base/base-dynamic-array.mjs +221 -0
  3. package/esm2020/lib/components/base/base-dynamic.mjs +99 -0
  4. package/{esm2015/lib/components/base/base-validators.js → esm2020/lib/components/base/base-validators.mjs} +1 -1
  5. package/{esm2015/lib/components/base/index.js → esm2020/lib/components/base/index.mjs} +0 -0
  6. package/esm2020/lib/components/dynamic/button/button.component.mjs +52 -0
  7. package/{esm2015/lib/components/dynamic/button/index.js → esm2020/lib/components/dynamic/button/index.mjs} +0 -0
  8. package/esm2020/lib/components/dynamic/dynamic-directive.mjs +95 -0
  9. package/{esm2015/lib/components/dynamic/dynamic.module.js → esm2020/lib/components/dynamic/dynamic.module.mjs} +5 -5
  10. package/esm2020/lib/components/dynamic/file-upload/file-upload.component.mjs +52 -0
  11. package/{esm2015/lib/components/dynamic/file-upload/index.js → esm2020/lib/components/dynamic/file-upload/index.mjs} +0 -0
  12. package/esm2020/lib/components/dynamic/form/dynamic-form-array.component.mjs +72 -0
  13. package/esm2020/lib/components/dynamic/form/dynamic-form.component.mjs +46 -0
  14. package/{esm2015/lib/components/dynamic/form/index.js → esm2020/lib/components/dynamic/form/index.mjs} +0 -0
  15. package/{esm2015/lib/components/dynamic/index.js → esm2020/lib/components/dynamic/index.mjs} +0 -0
  16. package/{esm2015/lib/components/dynamic/input/index.js → esm2020/lib/components/dynamic/input/index.mjs} +0 -0
  17. package/esm2020/lib/components/dynamic/input/input.component.mjs +65 -0
  18. package/{esm2015/lib/components/dynamic/input-phone/index.js → esm2020/lib/components/dynamic/input-phone/index.mjs} +0 -0
  19. package/esm2020/lib/components/dynamic/input-phone/input-phone.component.mjs +65 -0
  20. package/{esm2015/lib/components/dynamic/radio/index.js → esm2020/lib/components/dynamic/radio/index.mjs} +0 -0
  21. package/esm2020/lib/components/dynamic/radio/radio.component.mjs +33 -0
  22. package/{esm2015/lib/components/dynamic/select/index.js → esm2020/lib/components/dynamic/select/index.mjs} +0 -0
  23. package/esm2020/lib/components/dynamic/select/select.component.mjs +80 -0
  24. package/{esm2015/lib/components/dynamic/select-search/index.js → esm2020/lib/components/dynamic/select-search/index.mjs} +0 -0
  25. package/esm2020/lib/components/dynamic/select-search/select-search.component.mjs +80 -0
  26. package/{esm2015/lib/components/index.js → esm2020/lib/components/index.mjs} +2 -1
  27. package/esm2020/lib/components/shared/index.mjs +3 -0
  28. package/esm2020/lib/components/shared/password-strength/index.mjs +3 -0
  29. package/esm2020/lib/components/shared/password-strength/password-strength.component.mjs +83 -0
  30. package/esm2020/lib/components/shared/password-strength/password-strength.mjs +2 -0
  31. package/esm2020/lib/components/shared/password-strength/password-strength.module.mjs +50 -0
  32. package/esm2020/lib/components/shared/progress-bar/index.mjs +4 -0
  33. package/esm2020/lib/components/shared/progress-bar/progress-bar.component.mjs +28 -0
  34. package/esm2020/lib/components/shared/progress-bar/progress-bar.module.mjs +18 -0
  35. package/esm2020/lib/components/shared/progress-bar/progress-bar.service.mjs +49 -0
  36. package/{esm2015/lib/interfaces/field-config.js → esm2020/lib/interfaces/field-config.mjs} +0 -0
  37. package/{esm2015/lib/interfaces/index.js → esm2020/lib/interfaces/index.mjs} +0 -0
  38. package/{esm2015/monkey-front-components.js → esm2020/monkey-front-components.mjs} +0 -0
  39. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  40. package/fesm2015/monkey-front-components.mjs +1487 -0
  41. package/fesm2015/monkey-front-components.mjs.map +1 -0
  42. package/fesm2020/monkey-front-components.mjs +1471 -0
  43. package/fesm2020/monkey-front-components.mjs.map +1 -0
  44. package/lib/components/base/base-component.d.ts +1 -1
  45. package/lib/components/base/base-dynamic-array.d.ts +1 -1
  46. package/lib/components/base/base-dynamic.d.ts +1 -1
  47. package/lib/components/base/base-validators.d.ts +1 -14
  48. package/lib/components/dynamic/button/button.component.d.ts +2 -2
  49. package/lib/components/dynamic/dynamic-directive.d.ts +2 -2
  50. package/lib/components/dynamic/input/input.component.d.ts +3 -3
  51. package/lib/components/dynamic/input-phone/input-phone.component.d.ts +3 -3
  52. package/lib/components/dynamic/radio/radio.component.d.ts +2 -2
  53. package/lib/components/dynamic/select/select.component.d.ts +2 -2
  54. package/lib/components/dynamic/select-search/select-search.component.d.ts +2 -2
  55. package/lib/components/index.d.ts +1 -0
  56. package/lib/components/shared/index.d.ts +2 -0
  57. package/lib/components/shared/password-strength/index.d.ts +2 -0
  58. package/lib/components/shared/password-strength/password-strength.component.d.ts +22 -0
  59. package/lib/components/shared/password-strength/password-strength.d.ts +5 -0
  60. package/lib/components/shared/password-strength/password-strength.module.d.ts +12 -0
  61. package/lib/components/shared/progress-bar/index.d.ts +3 -0
  62. package/lib/components/shared/progress-bar/progress-bar.component.d.ts +12 -0
  63. package/lib/components/shared/progress-bar/progress-bar.module.d.ts +8 -0
  64. package/lib/components/shared/progress-bar/progress-bar.service.d.ts +14 -0
  65. package/monkey-front-components-0.0.183.tgz +0 -0
  66. package/package.json +27 -13
  67. package/bundles/monkey-front-components.umd.js +0 -1729
  68. package/bundles/monkey-front-components.umd.js.map +0 -1
  69. package/esm2015/lib/components/base/base-component.js +0 -288
  70. package/esm2015/lib/components/base/base-dynamic-array.js +0 -215
  71. package/esm2015/lib/components/base/base-dynamic.js +0 -98
  72. package/esm2015/lib/components/dynamic/button/button.component.js +0 -57
  73. package/esm2015/lib/components/dynamic/dynamic-directive.js +0 -95
  74. package/esm2015/lib/components/dynamic/file-upload/file-upload.component.js +0 -57
  75. package/esm2015/lib/components/dynamic/form/dynamic-form-array.component.js +0 -77
  76. package/esm2015/lib/components/dynamic/form/dynamic-form.component.js +0 -51
  77. package/esm2015/lib/components/dynamic/input/input.component.js +0 -66
  78. package/esm2015/lib/components/dynamic/input-phone/input-phone.component.js +0 -66
  79. package/esm2015/lib/components/dynamic/radio/radio.component.js +0 -36
  80. package/esm2015/lib/components/dynamic/select/select.component.js +0 -81
  81. package/esm2015/lib/components/dynamic/select-search/select-search.component.js +0 -81
  82. package/fesm2015/monkey-front-components.js +0 -1290
  83. package/fesm2015/monkey-front-components.js.map +0 -1
  84. package/monkey-front-components-0.0.179.tgz +0 -0
@@ -1,1290 +0,0 @@
1
- import { Subject } from 'rxjs';
2
- import * as i0 from '@angular/core';
3
- import { Directive, EventEmitter, Input, Output, Component, ViewEncapsulation, HostBinding, ViewChild, NgModule } from '@angular/core';
4
- import { takeUntil } from 'rxjs/operators';
5
- import * as i1$1 from 'monkey-style-guide';
6
- import { MonkeyUtils, MonkeyInputModule, MonkeySelectModule, MonkeyRadioButtonModule, MonkeyOptionModule, MonkeyFileUploadModule, MonkeyButtonModule, MonkeyInputPhoneModule } from 'monkey-style-guide';
7
- import { MonkeyEcxCommonsService, ValidateUtils, Validators as Validators$1 } from 'monkey-front-core';
8
- import * as i1 from '@angular/forms';
9
- import { Validators, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
10
- import * as i3 from '@ngx-translate/core';
11
- import { TranslateModule } from '@ngx-translate/core';
12
- import * as i3$1 from '@angular/common';
13
- import { CommonModule } from '@angular/common';
14
-
15
- class BaseComponent {
16
- constructor() {
17
- this.__isMobile = this.isMobile();
18
- this.__locales = ['pt-BR', 'es-CL'];
19
- this.__unsubscribeAll = new Subject();
20
- }
21
- isMobile() {
22
- const isMobileWidth = (window.screen.width <= 640) ||
23
- (window.matchMedia &&
24
- window.matchMedia('only screen and (max-width: 640px)').matches);
25
- return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile/i.test(navigator.userAgent)) || isMobileWidth;
26
- }
27
- handlePagination(create = true) {
28
- const { __paginationOptions } = this;
29
- if (__paginationOptions) {
30
- const { mainElement, service } = __paginationOptions;
31
- setTimeout(() => {
32
- const element = document.getElementById(mainElement);
33
- if (element) {
34
- element.scroll = null;
35
- element.onscroll = null;
36
- if (create) {
37
- this.paginationFunc = () => {
38
- const { scrollTop, scrollHeight, offsetHeight } = element;
39
- const contentHeight = scrollHeight - offsetHeight;
40
- if (contentHeight <= scrollTop) {
41
- service.__onDoPagination$.next(null);
42
- }
43
- };
44
- element.addEventListener('scroll', this.paginationFunc);
45
- }
46
- else {
47
- element.removeEventListener('scroll', this.paginationFunc);
48
- }
49
- }
50
- }, 200);
51
- }
52
- }
53
- handleSupport(supportControls) {
54
- const { service, show } = supportControls;
55
- const method = show ? 'show' : 'hide';
56
- service[method.toLowerCase()]();
57
- }
58
- handleTranslate(translateOptions) {
59
- const { service } = translateOptions;
60
- service.__oni18nDataChanged$
61
- .pipe(takeUntil(this.__unsubscribeAll))
62
- .subscribe(() => {
63
- const data = service.__i18n;
64
- if (data) {
65
- this.__i18n = data;
66
- }
67
- });
68
- }
69
- getErrorFirstMessageTranslated(formControl) {
70
- if (formControl.hasError('required'))
71
- return 'FIELD-REQUIRED';
72
- if (formControl.hasError('invalid'))
73
- return 'FIELD-INVALID';
74
- if (formControl.hasError('email'))
75
- return 'INVALID-EMAIL';
76
- if (formControl.hasError('minlength'))
77
- return 'MIN-LENGTH';
78
- if (formControl.hasError('maxlength'))
79
- return 'MAX-LENGTH';
80
- if (formControl.hasError('max'))
81
- return 'MAX';
82
- if (formControl.hasError('min'))
83
- return 'MIN';
84
- if (formControl.hasError('passwordsNotMatching'))
85
- return 'MATCH-PASSWORD';
86
- if (formControl.hasError('invalidDate'))
87
- return 'INVALID-DATE';
88
- if (formControl.hasError('invalidTrue'))
89
- return 'INVALID-TRUE';
90
- if (formControl.hasError('invalidCpfCnpj'))
91
- return 'INVALID-DOCUMENT';
92
- if (formControl.hasError('invalidZipCode'))
93
- return 'INVALID-ZIPCODE';
94
- if (formControl.hasError('invalidCombo'))
95
- return 'INVALID-COMBO';
96
- if (formControl.hasError('invalidUrl'))
97
- return 'INVALID-URL';
98
- if (formControl.hasError('invalidUnlockRegister')) {
99
- return 'INVALID-UNLOCK-REGISTER';
100
- }
101
- if (formControl.hasError('dateStartMustBeLessThanAnd')) {
102
- return 'DATE-START-MUST-BE-LESS-THAN-AND';
103
- }
104
- if (formControl.hasError('dateEndMustBeGreaterThanStart')) {
105
- return 'DATE-END-MUST-BE-GREATER-THAN-SART';
106
- }
107
- if (formControl.hasError('phone'))
108
- return 'INVALID-PHONE';
109
- return 'FIELD-INVALID';
110
- }
111
- getErrorLastMessageNotTranslated(formControl) {
112
- if (formControl.hasError('minlength')) {
113
- return `${formControl.getError('minlength').requiredLength} caracteres.`;
114
- }
115
- if (formControl.hasError('maxlength')) {
116
- return `${formControl.getError('maxlength').requiredLength} caracteres.`;
117
- }
118
- if (formControl.hasError('max')) {
119
- return `${formControl.getError('max').max}`;
120
- }
121
- if (formControl.hasError('min')) {
122
- return `${formControl.getError('min').min}`;
123
- }
124
- return '';
125
- }
126
- validateFormWithTranslate(f, index) {
127
- const formErrors = f.value;
128
- if (f.status === 'VALID')
129
- return true;
130
- if (!formErrors)
131
- return true;
132
- Object.entries(formErrors).forEach(([key, value]) => {
133
- const control = f.get(key);
134
- formErrors[key] = '';
135
- if (control && !control.valid) {
136
- const msg = {
137
- first: `ERRORS.${this.getErrorFirstMessageTranslated(f.get(key))}`,
138
- last: this.getErrorLastMessageNotTranslated(f.get(key))
139
- };
140
- formErrors[key] = msg;
141
- }
142
- });
143
- if (MonkeyUtils.persistNullEmptyUndefined(index)) {
144
- this.__monkeyecxFormErrors[index] = formErrors;
145
- }
146
- else {
147
- this.__monkeyecxFormErrors = formErrors;
148
- }
149
- return false;
150
- }
151
- copyToClipboard(val) {
152
- const selBox = document.createElement('textarea');
153
- selBox.style.position = 'fixed';
154
- selBox.style.left = '0';
155
- selBox.style.top = '0';
156
- selBox.style.opacity = '0';
157
- selBox.value = val;
158
- document.body.appendChild(selBox);
159
- selBox.focus();
160
- selBox.select();
161
- document.execCommand('copy');
162
- document.body.removeChild(selBox);
163
- }
164
- validateForm(f, index, alias) {
165
- const formErrors = f.value;
166
- if (f.status === 'VALID')
167
- return true;
168
- if (!formErrors)
169
- return true;
170
- Object.entries(formErrors).forEach(([key, value]) => {
171
- const control = f.get(key);
172
- formErrors[key] = '';
173
- if (control && !control.valid) {
174
- const msg = {
175
- firstMessage: `ERRORS.${this.getErrorFirstMessageTranslated(f.get(key))}`,
176
- lastMessage: this.getErrorLastMessageNotTranslated(f.get(key))
177
- };
178
- formErrors[key] = msg;
179
- }
180
- });
181
- if (MonkeyUtils.persistNullEmptyUndefined(index)) {
182
- this.__monkeyecxFormErrors[index] = formErrors;
183
- }
184
- else {
185
- let obj;
186
- if (alias) {
187
- obj = {
188
- [alias]: Object.assign({}, formErrors)
189
- };
190
- }
191
- else {
192
- obj = formErrors;
193
- }
194
- this.__monkeyecxFormErrors = Object.assign(Object.assign({}, this.__monkeyecxFormErrors), obj);
195
- }
196
- f.markAllAsTouched();
197
- return false;
198
- }
199
- clearAllServiceData(clearData) {
200
- const context = this;
201
- Object.values(context).forEach((ctx) => {
202
- if (ctx instanceof MonkeyEcxCommonsService) {
203
- ctx.clear(clearData);
204
- }
205
- });
206
- }
207
- ngOnInit(args) {
208
- if (args === null || args === void 0 ? void 0 : args.paginationOptions) {
209
- this.__paginationOptions = args === null || args === void 0 ? void 0 : args.paginationOptions;
210
- this.handlePagination();
211
- }
212
- if (args === null || args === void 0 ? void 0 : args.supportControls) {
213
- this.handleSupport(args === null || args === void 0 ? void 0 : args.supportControls);
214
- }
215
- if (args === null || args === void 0 ? void 0 : args.translateOptions) {
216
- this.handleTranslate(args === null || args === void 0 ? void 0 : args.translateOptions);
217
- }
218
- }
219
- ngOnDestroy(clearData = true) {
220
- this.__unsubscribeAll.next();
221
- this.__unsubscribeAll.complete();
222
- this.clearAllServiceData(clearData);
223
- this.handlePagination(false);
224
- }
225
- handleErrorFromServices(error, f) {
226
- this.__monkeyecxFormErrors = null;
227
- if (error.type === 'Parameter_Error') {
228
- Object.entries(f.value).forEach(([key, value]) => {
229
- error.notifications.forEach((_) => {
230
- const field = _.split(':')[0];
231
- const description = _.split(':')[1];
232
- if (field === key) {
233
- const msg = {
234
- firstMessage: '',
235
- lastMessage: description
236
- };
237
- this.__monkeyecxFormErrors = Object.assign(Object.assign({}, this.__monkeyecxFormErrors), { [key]: msg });
238
- f.controls[key].setErrors({
239
- incorrect: true
240
- });
241
- }
242
- });
243
- });
244
- }
245
- f.markAllAsTouched();
246
- }
247
- goBack() {
248
- window.history.back();
249
- }
250
- goScroll(id) {
251
- const element = document.getElementById(id);
252
- if (element)
253
- element.scrollIntoView();
254
- }
255
- getEmbeddedData(data, field) {
256
- const { _embedded } = data;
257
- return _embedded ? _embedded[field] : null;
258
- }
259
- openWindow(url) {
260
- window.open(`${url}`, '_blank');
261
- }
262
- fillI18n(data) {
263
- this.__i18n = data;
264
- }
265
- getCountryPrefix(country) {
266
- return {
267
- br: 55,
268
- cl: 56
269
- }[country];
270
- }
271
- getCountryCurrencyChartFormat(country) {
272
- return {
273
- br: 'R$ #,###,##0.00',
274
- cl: 'CLP #,###,##0'
275
- }[country];
276
- }
277
- getCountryValidators(country) {
278
- return {
279
- br: {
280
- governmentId: ValidateUtils.DocumentValidator
281
- },
282
- cl: {
283
- governmentId: ValidateUtils.DocumentRutValidator
284
- }
285
- }[country];
286
- }
287
- }
288
- BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
289
- BaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.14", type: BaseComponent, selector: "[baseComponent]", ngImport: i0 });
290
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: BaseComponent, decorators: [{
291
- type: Directive,
292
- args: [{
293
- selector: '[baseComponent]'
294
- }]
295
- }], ctorParameters: function () { return []; } });
296
-
297
- const validators = {
298
- required: Validators.required,
299
- email: Validators$1.email,
300
- governmentId: Validators$1.documentBR,
301
- governmentIdRut: Validators$1.documentCL,
302
- documentBR: Validators$1.documentBR,
303
- documentCL: Validators$1.documentCL,
304
- date: Validators$1.date,
305
- zipCode: Validators$1.zipCode,
306
- minLength: (param) => {
307
- return Validators.minLength(param);
308
- },
309
- maxLength: (param) => {
310
- return Validators.maxLength(param);
311
- }
312
- };
313
-
314
- class BaseDynamic extends BaseComponent {
315
- constructor(fb) {
316
- super();
317
- this.fb = fb;
318
- this.onHandleSubmit = new EventEmitter();
319
- this.onHandleUpdateForm = new EventEmitter();
320
- this.onHandleSubmitFormReady = new EventEmitter();
321
- this.fields = [];
322
- this.disabled = false;
323
- }
324
- createControl() {
325
- const { fields } = this;
326
- if (!fields)
327
- return null;
328
- // eslint-disable-next-line object-curly-newline
329
- const group = this.fb.group({});
330
- fields.forEach((field) => {
331
- const { fieldType, validations, name, disabled } = field;
332
- let { value } = field;
333
- if (fieldType === 'button')
334
- return;
335
- if (fieldType === 'radiobutton' || fieldType === 'checkbox' || fieldType === 'select') {
336
- value = '';
337
- }
338
- const control = this.fb.control(value, this.bindValidations(validations || []));
339
- if (disabled || this.disabled)
340
- control.disable();
341
- group.addControl(name, control);
342
- });
343
- return group;
344
- }
345
- bindValidations(validations) {
346
- if (validations.length > 0) {
347
- const validList = [];
348
- validations.forEach((valid) => {
349
- const validated = valid.param
350
- ? validators[valid.name](valid.param)
351
- : validators[valid.name];
352
- validList.push(validated);
353
- });
354
- return Validators.compose(validList);
355
- }
356
- return null;
357
- }
358
- fillValues() {
359
- const { data } = this;
360
- if (!data || !this._form)
361
- return;
362
- Object.entries(data).forEach(([key, value]) => {
363
- if (MonkeyUtils.persistNullEmptyUndefined(value) && this._form.controls[key]) {
364
- this._form.controls[key].setValue(value);
365
- }
366
- });
367
- }
368
- ngOnInit() {
369
- this._form = this.createControl();
370
- this.fillValues();
371
- this.onHandleUpdateForm.subscribe(() => {
372
- this.fillValues();
373
- });
374
- }
375
- ngOnChanges() {
376
- if (!this._form) {
377
- this._form = this.createControl();
378
- }
379
- this.fillValues();
380
- }
381
- }
382
- BaseDynamic.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: BaseDynamic, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Directive });
383
- BaseDynamic.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.14", type: BaseDynamic, selector: "[baseDynamic]", inputs: { onHandleSubmit: "onHandleSubmit", onHandleUpdateForm: "onHandleUpdateForm", self: "self", fields: "fields", data: "data", disabled: "disabled" }, outputs: { onHandleSubmitFormReady: "onHandleSubmitFormReady" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
384
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: BaseDynamic, decorators: [{
385
- type: Directive,
386
- args: [{
387
- selector: '[baseDynamic]'
388
- }]
389
- }], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { onHandleSubmit: [{
390
- type: Input
391
- }], onHandleUpdateForm: [{
392
- type: Input
393
- }], onHandleSubmitFormReady: [{
394
- type: Output
395
- }], self: [{
396
- type: Input
397
- }], fields: [{
398
- type: Input
399
- }], data: [{
400
- type: Input
401
- }], disabled: [{
402
- type: Input
403
- }] } });
404
-
405
- class BaseDynamicArray extends BaseComponent {
406
- constructor(fb) {
407
- super();
408
- this.fb = fb;
409
- this.onHandleSubmit = new EventEmitter();
410
- this.onHandleUpdateForm = new EventEmitter();
411
- this.onHandleSubmitFormReady = new EventEmitter();
412
- this.fields = [];
413
- this.qtd = 1;
414
- this.disabled = false;
415
- // eslint-disable-next-line object-curly-newline
416
- this._plusValidations = [];
417
- this.changesUnsubscribe = new Subject();
418
- this.formBase = () => {
419
- // return this.fb.group(this.createControl());
420
- return this.createControl();
421
- };
422
- }
423
- handleInternalPlusValidation(mainField, data) {
424
- const { operator, field, value } = mainField;
425
- const validators = {
426
- e: (val1, val2) => { return val1 === val2; },
427
- lt: (val1, val2) => { return val1 < val2; },
428
- gt: (val1, val2) => { return val1 > val2; }
429
- };
430
- return validators[operator]((data === null || data === void 0 ? void 0 : data[field]) || data, value);
431
- }
432
- makeInternalPlusValidation(data, sourceField, settings, rowIndex) {
433
- const changeFields = (show) => {
434
- const saved = [...this.fields];
435
- saved.map((val) => {
436
- const valSaved = Object.assign({}, val);
437
- if (val.name === sourceField) {
438
- this._plusValidations[rowIndex] = {
439
- [sourceField]: Object.assign(Object.assign({}, valSaved), { alwaysShow: show })
440
- };
441
- this.createOneControl(val.name, this.formValues.controls[rowIndex], show);
442
- }
443
- else {
444
- this._plusValidations[rowIndex] = Object.assign({}, valSaved);
445
- }
446
- return null;
447
- });
448
- };
449
- const validated = this.handleInternalPlusValidation(settings, data);
450
- changeFields(validated);
451
- }
452
- createOneControl(fieldName, ctrl, create = true) {
453
- const { fields } = this;
454
- if (!fields)
455
- return;
456
- fields.forEach((field) => {
457
- const { fieldType, validations, name, disabled } = field;
458
- if (name !== fieldName)
459
- return;
460
- let { value } = field;
461
- if (fieldType === 'button')
462
- return;
463
- if (fieldType === 'radiobutton' || fieldType === 'checkbox' || fieldType === 'select') {
464
- value = '';
465
- }
466
- if (create) {
467
- const control = this.fb.control(value, this.bindValidations(validations || []));
468
- if (disabled || this.disabled)
469
- control.disable();
470
- ctrl.addControl(name, control);
471
- }
472
- else {
473
- ctrl.removeControl(name);
474
- }
475
- });
476
- }
477
- createControl(data) {
478
- const { fields } = this;
479
- if (!fields)
480
- return null;
481
- // eslint-disable-next-line object-curly-newline
482
- const group = this.fb.group({});
483
- fields.forEach((field) => {
484
- const { fieldType, validations, name, disabled, alwaysShow } = field;
485
- let { value } = field;
486
- if (field.alwaysShowPlusValidation) {
487
- if (!this.handleInternalPlusValidation(field.alwaysShowPlusValidation, data))
488
- return;
489
- }
490
- else if (!alwaysShow)
491
- return;
492
- if (fieldType === 'button')
493
- return;
494
- if (fieldType === 'radiobutton' || fieldType === 'checkbox' || fieldType === 'select') {
495
- value = '';
496
- }
497
- const control = this.fb.control(value, this.bindValidations(validations || []));
498
- if (disabled || this.disabled)
499
- control.disable();
500
- group.addControl(name, control);
501
- });
502
- return group;
503
- }
504
- bindValidations(validations) {
505
- if (validations.length > 0) {
506
- const validList = [];
507
- validations.forEach((valid) => {
508
- const validated = valid.param
509
- ? validators[valid.name](valid.param)
510
- : validators[valid.name];
511
- validList.push(validated);
512
- });
513
- return Validators.compose(validList);
514
- }
515
- return null;
516
- }
517
- buildForm() {
518
- var _a;
519
- const form = this.fb.group({
520
- fields: this.fb.array([])
521
- });
522
- (_a = form === null || form === void 0 ? void 0 : form.controls.fields) === null || _a === void 0 ? void 0 : _a.valueChanges.subscribe((_) => {
523
- this.watchForChanges();
524
- });
525
- return form;
526
- }
527
- watchForChanges() {
528
- const { fields, changesUnsubscribe } = this;
529
- changesUnsubscribe.next();
530
- this.formValues.controls.map((control, index) => {
531
- fields.forEach((fieldConfig) => {
532
- var _a;
533
- const { name, alwaysShowPlusValidation } = fieldConfig;
534
- if (!alwaysShowPlusValidation)
535
- return;
536
- const { field } = alwaysShowPlusValidation;
537
- if (field) {
538
- (_a = control.controls[field]) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(takeUntil(changesUnsubscribe)).subscribe((_) => {
539
- this.makeInternalPlusValidation(_, name, alwaysShowPlusValidation, index);
540
- });
541
- }
542
- });
543
- return null;
544
- });
545
- }
546
- get formValues() {
547
- return this._form ? this._form.get('fields') : null;
548
- }
549
- fillValues() {
550
- const { data, qtd } = this;
551
- if ((!this._form) && qtd)
552
- return;
553
- if (qtd > 0) {
554
- Array(qtd)
555
- .fill(null)
556
- .map((_, index) => {
557
- let form = this.createControl();
558
- if (data && data[index]) {
559
- form = this.createControl(data[index]);
560
- const handledData = data[index];
561
- Object.entries(handledData).forEach(([key, value]) => {
562
- if (MonkeyUtils.persistNullEmptyUndefined(value) && form.controls[key]) {
563
- form.controls[key].setValue(value);
564
- }
565
- });
566
- }
567
- this.formValues.push(form);
568
- return null;
569
- });
570
- }
571
- }
572
- ngOnInit() {
573
- this._form = this.buildForm();
574
- this.fillValues();
575
- this.onHandleUpdateForm.subscribe(() => {
576
- this.fillValues();
577
- });
578
- }
579
- ngOnChanges() {
580
- if (!this._form) {
581
- this._form = this.buildForm();
582
- }
583
- this.fillValues();
584
- }
585
- }
586
- BaseDynamicArray.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: BaseDynamicArray, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Directive });
587
- BaseDynamicArray.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.14", type: BaseDynamicArray, selector: "[baseDynamicArray]", inputs: { onHandleSubmit: "onHandleSubmit", onHandleUpdateForm: "onHandleUpdateForm", self: "self", fields: "fields", data: "data", qtd: "qtd", disabled: "disabled" }, outputs: { onHandleSubmitFormReady: "onHandleSubmitFormReady" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
588
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: BaseDynamicArray, decorators: [{
589
- type: Directive,
590
- args: [{
591
- selector: '[baseDynamicArray]'
592
- }]
593
- }], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { onHandleSubmit: [{
594
- type: Input
595
- }], onHandleUpdateForm: [{
596
- type: Input
597
- }], onHandleSubmitFormReady: [{
598
- type: Output
599
- }], self: [{
600
- type: Input
601
- }], fields: [{
602
- type: Input
603
- }], data: [{
604
- type: Input
605
- }], qtd: [{
606
- type: Input
607
- }], disabled: [{
608
- type: Input
609
- }] } });
610
-
611
- class MECXDynamicFileUploadComponent {
612
- constructor(cdr) {
613
- this.cdr = cdr;
614
- // eslint-disable-next-line object-curly-newline
615
- this._formErrors = {};
616
- this._function = (file, callback) => {
617
- var _a, _b, _c, _d;
618
- if (this._form.disabled)
619
- return;
620
- if (!((_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.functions) === null || _b === void 0 ? void 0 : _b.onHandleUpload)) {
621
- console.error('onHandleUpload not declared');
622
- return;
623
- }
624
- const { func, type } = (_d = (_c = this._field) === null || _c === void 0 ? void 0 : _c.functions) === null || _d === void 0 ? void 0 : _d.onHandleUpload;
625
- if (!func || !this.self[func]) {
626
- console.error('onHandleUpload not declared');
627
- return;
628
- }
629
- this.self[func](file, type, callback);
630
- };
631
- // not to do
632
- }
633
- get className() {
634
- var _a, _b;
635
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
636
- }
637
- ngOnChanges() {
638
- this.cdr.detectChanges();
639
- }
640
- }
641
- MECXDynamicFileUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicFileUploadComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
642
- MECXDynamicFileUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicFileUploadComponent, selector: "mecx-dynamic-file-upload", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, usesOnChanges: true, ngImport: i0, 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$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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
643
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicFileUploadComponent, decorators: [{
644
- type: Component,
645
- args: [{
646
- selector: 'mecx-dynamic-file-upload',
647
- templateUrl: './file-upload.component.html',
648
- encapsulation: ViewEncapsulation.None
649
- }]
650
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { _field: [{
651
- type: Input
652
- }], _form: [{
653
- type: Input
654
- }], _formErrors: [{
655
- type: Input
656
- }], self: [{
657
- type: Input
658
- }], className: [{
659
- type: HostBinding,
660
- args: ['class']
661
- }] } });
662
-
663
- class MECXDynamicButtonComponent {
664
- constructor(cdr) {
665
- this.cdr = cdr;
666
- // eslint-disable-next-line object-curly-newline
667
- this._formErrors = {};
668
- // not to do
669
- }
670
- get className() {
671
- var _a, _b;
672
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
673
- }
674
- ngOnChanges() {
675
- this.cdr.detectChanges();
676
- }
677
- onClick() {
678
- var _a;
679
- const { _form, _field, self } = this;
680
- if (_form.disabled)
681
- return;
682
- const { name, value } = _field;
683
- const func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onClick;
684
- if (func) {
685
- self[func]({
686
- name,
687
- value,
688
- form: _form
689
- });
690
- }
691
- }
692
- }
693
- MECXDynamicButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicButtonComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
694
- MECXDynamicButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicButtonComponent, selector: "mecx-dynamic-button", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, usesOnChanges: true, ngImport: i0, 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$1.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], pipes: { "translate": i3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
695
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicButtonComponent, decorators: [{
696
- type: Component,
697
- args: [{
698
- selector: 'mecx-dynamic-button',
699
- templateUrl: './button.component.html',
700
- styleUrls: ['./button.component.scss'],
701
- encapsulation: ViewEncapsulation.None
702
- }]
703
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { _field: [{
704
- type: Input
705
- }], _form: [{
706
- type: Input
707
- }], _formErrors: [{
708
- type: Input
709
- }], self: [{
710
- type: Input
711
- }], className: [{
712
- type: HostBinding,
713
- args: ['class']
714
- }] } });
715
-
716
- class MECXDynamicInputComponent {
717
- constructor(cdr) {
718
- this.cdr = cdr;
719
- // eslint-disable-next-line object-curly-newline
720
- this._formErrors = {};
721
- // not to do
722
- }
723
- get className() {
724
- var _a, _b;
725
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
726
- }
727
- ngOnInit() {
728
- this.cdr.detectChanges();
729
- }
730
- ngOnChanges() {
731
- this.cdr.detectChanges();
732
- }
733
- onChange(event) {
734
- var _a;
735
- const { _form, _field, self } = this;
736
- const { name } = _field;
737
- const func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onChange;
738
- const isValid = _form.get(_field.name).valid;
739
- if (func) {
740
- self[func]({
741
- name,
742
- isValid,
743
- event,
744
- ctrl: _form.get(this._field.name),
745
- form: _form
746
- });
747
- }
748
- }
749
- }
750
- MECXDynamicInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicInputComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
751
- MECXDynamicInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicInputComponent, selector: "mecx-dynamic-input", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, 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$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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
752
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicInputComponent, decorators: [{
753
- type: Component,
754
- args: [{
755
- selector: 'mecx-dynamic-input',
756
- templateUrl: './input.component.html',
757
- encapsulation: ViewEncapsulation.None
758
- }]
759
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { _field: [{
760
- type: Input
761
- }], _form: [{
762
- type: Input
763
- }], _formErrors: [{
764
- type: Input
765
- }], self: [{
766
- type: Input
767
- }], inputElement: [{
768
- type: ViewChild,
769
- args: ['inputElement', {
770
- static: true
771
- }]
772
- }], className: [{
773
- type: HostBinding,
774
- args: ['class']
775
- }] } });
776
-
777
- class MECXDynamicInputPhoneComponent {
778
- constructor(cdr) {
779
- this.cdr = cdr;
780
- // eslint-disable-next-line object-curly-newline
781
- this._formErrors = {};
782
- // not to do
783
- }
784
- get className() {
785
- var _a, _b;
786
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
787
- }
788
- ngOnInit() {
789
- this.cdr.detectChanges();
790
- }
791
- ngOnChanges() {
792
- this.cdr.detectChanges();
793
- }
794
- onChange(event) {
795
- var _a;
796
- const { _form, _field, self } = this;
797
- const { name } = _field;
798
- const func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onChange;
799
- const isValid = _form.get(_field.name).valid;
800
- if (func) {
801
- self[func]({
802
- name,
803
- isValid,
804
- event,
805
- ctrl: _form.get(this._field.name),
806
- form: _form
807
- });
808
- }
809
- }
810
- }
811
- MECXDynamicInputPhoneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicInputPhoneComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
812
- MECXDynamicInputPhoneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicInputPhoneComponent, selector: "mecx-dynamic-input-phone", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, 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$1.MonkeyInputPhoneComponent, selector: "monkey-input-phone", inputs: ["name", "label", "helperMessage", "placeholder", "icon", "infoMessage", "errorMessage", "maxLength", "internationalNumber", "value"], outputs: ["onChange"] }], directives: [{ type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
813
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicInputPhoneComponent, decorators: [{
814
- type: Component,
815
- args: [{
816
- selector: 'mecx-dynamic-input-phone',
817
- templateUrl: './input-phone.component.html',
818
- encapsulation: ViewEncapsulation.None
819
- }]
820
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { _field: [{
821
- type: Input
822
- }], _form: [{
823
- type: Input
824
- }], _formErrors: [{
825
- type: Input
826
- }], self: [{
827
- type: Input
828
- }], inputElement: [{
829
- type: ViewChild,
830
- args: ['inputElement', {
831
- static: true
832
- }]
833
- }], className: [{
834
- type: HostBinding,
835
- args: ['class']
836
- }] } });
837
-
838
- class MECXDynamicRadioComponent {
839
- constructor() {
840
- // eslint-disable-next-line object-curly-newline
841
- this._formErrors = {};
842
- }
843
- get className() {
844
- var _a, _b;
845
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
846
- }
847
- }
848
- MECXDynamicRadioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
849
- MECXDynamicRadioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicRadioComponent, selector: "mecx-dynamic-radio", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors" }, host: { properties: { "class": "this.className" } }, ngImport: i0, 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$1.MonkeyRadioButtonComponent, selector: "monkey-radiobutton", inputs: ["label", "helperMessage", "placeholder", "icon", "infoMessage", "errorMessage", "value"], outputs: ["onChange"] }, { type: i1$1.MonkeyOptionComponent, selector: "monkey-option", inputs: ["type", "label", "value", "selectAll", "selected", "enableClick"], outputs: ["onSelectOption"] }], directives: [{ type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
850
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicRadioComponent, decorators: [{
851
- type: Component,
852
- args: [{
853
- selector: 'mecx-dynamic-radio',
854
- templateUrl: './radio.component.html',
855
- encapsulation: ViewEncapsulation.None
856
- }]
857
- }], propDecorators: { _field: [{
858
- type: Input
859
- }], _form: [{
860
- type: Input
861
- }], _formErrors: [{
862
- type: Input
863
- }], className: [{
864
- type: HostBinding,
865
- args: ['class']
866
- }] } });
867
-
868
- class MECXDynamicSelectComponent {
869
- constructor() {
870
- // eslint-disable-next-line object-curly-newline
871
- this._formErrors = {};
872
- this._onHandleOptions = new EventEmitter();
873
- }
874
- get className() {
875
- var _a, _b;
876
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
877
- }
878
- onHandleGenericLoad() {
879
- var _a, _b;
880
- const { _form, _field, self } = this;
881
- if (_form.disabled)
882
- return;
883
- const { name } = _field;
884
- if ((_a = _field === null || _field === void 0 ? void 0 : _field.value) === null || _a === void 0 ? void 0 : _a.length)
885
- return;
886
- const { func, url } = (_b = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _b === void 0 ? void 0 : _b.onHandleGenericLoad;
887
- if (!func || !self[func]) {
888
- console.error('onHandleGenericLoad not declared');
889
- return;
890
- }
891
- _form.disable();
892
- self[func]({
893
- name,
894
- url,
895
- form: _form,
896
- callback: (data) => {
897
- this._field.value = data;
898
- this._form.enable();
899
- this._onHandleOptions.next(null);
900
- }
901
- });
902
- }
903
- onChange(event) {
904
- var _a;
905
- const { _form, _field, self } = this;
906
- const { name } = _field;
907
- const func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onChange;
908
- const isValid = _form.get(_field.name).valid;
909
- if (func) {
910
- self[func]({
911
- name,
912
- isValid,
913
- event,
914
- ctrl: _form.get(this._field.name),
915
- form: _form,
916
- value: _field.value
917
- });
918
- }
919
- }
920
- }
921
- MECXDynamicSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
922
- MECXDynamicSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicSelectComponent, selector: "mecx-dynamic-select", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, ngImport: i0, 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$1.MonkeySelectComponent, selector: "monkey-select", inputs: ["label", "helperMessage", "placeholder", "icon", "infoMessage", "errorMessage", "labelSelect", "onHandleOptions", "value"], outputs: ["onChange"] }, { type: i1$1.MonkeyOptionComponent, selector: "monkey-option", inputs: ["type", "label", "value", "selectAll", "selected", "enableClick"], outputs: ["onSelectOption"] }], directives: [{ type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
923
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicSelectComponent, decorators: [{
924
- type: Component,
925
- args: [{
926
- selector: 'mecx-dynamic-select',
927
- templateUrl: './select.component.html',
928
- encapsulation: ViewEncapsulation.None
929
- }]
930
- }], propDecorators: { _field: [{
931
- type: Input
932
- }], _form: [{
933
- type: Input
934
- }], _formErrors: [{
935
- type: Input
936
- }], self: [{
937
- type: Input
938
- }], className: [{
939
- type: HostBinding,
940
- args: ['class']
941
- }] } });
942
-
943
- class MECXDynamicSelectSearchComponent {
944
- constructor() {
945
- // eslint-disable-next-line object-curly-newline
946
- this._formErrors = {};
947
- this._onHandleOptions = new EventEmitter();
948
- }
949
- get className() {
950
- var _a, _b;
951
- return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
952
- }
953
- onHandleGenericLoad() {
954
- var _a, _b;
955
- const { _form, _field, self } = this;
956
- if (_form.disabled)
957
- return;
958
- const { name } = _field;
959
- if ((_a = _field === null || _field === void 0 ? void 0 : _field.value) === null || _a === void 0 ? void 0 : _a.length)
960
- return;
961
- const { func, url } = (_b = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _b === void 0 ? void 0 : _b.onHandleGenericLoad;
962
- if (!func || !self[func]) {
963
- console.error('onHandleGenericLoad not declared');
964
- return;
965
- }
966
- _form.disable();
967
- self[func]({
968
- name,
969
- url,
970
- form: _form,
971
- callback: (data) => {
972
- this._field.value = data;
973
- this._form.enable();
974
- this._onHandleOptions.next(null);
975
- }
976
- });
977
- }
978
- onChange(event) {
979
- var _a;
980
- const { _form, _field, self } = this;
981
- const { name } = _field;
982
- const func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onChange;
983
- const isValid = _form.get(_field.name).valid;
984
- if (func) {
985
- self[func]({
986
- name,
987
- isValid,
988
- event,
989
- ctrl: _form.get(this._field.name),
990
- form: _form,
991
- value: _field.value
992
- });
993
- }
994
- }
995
- }
996
- MECXDynamicSelectSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicSelectSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
997
- MECXDynamicSelectSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicSelectSearchComponent, selector: "mecx-dynamic-select-search", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, ngImport: i0, 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$1.MonkeySelectSearchComponent, selector: "monkey-select-search", inputs: ["label", "helperMessage", "placeholder", "icon", "infoMessage", "errorMessage", "labelSelect", "fieldToCompare", "onHandleOptions", "value"], outputs: ["onChange", "onSearch"] }, { type: i1$1.MonkeyOptionComponent, selector: "monkey-option", inputs: ["type", "label", "value", "selectAll", "selected", "enableClick"], outputs: ["onSelectOption"] }], directives: [{ type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
998
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicSelectSearchComponent, decorators: [{
999
- type: Component,
1000
- args: [{
1001
- selector: 'mecx-dynamic-select-search',
1002
- templateUrl: './select-search.component.html',
1003
- encapsulation: ViewEncapsulation.None
1004
- }]
1005
- }], propDecorators: { _field: [{
1006
- type: Input
1007
- }], _form: [{
1008
- type: Input
1009
- }], _formErrors: [{
1010
- type: Input
1011
- }], self: [{
1012
- type: Input
1013
- }], className: [{
1014
- type: HostBinding,
1015
- args: ['class']
1016
- }] } });
1017
-
1018
- const componentMapper = {
1019
- input: MECXDynamicInputComponent,
1020
- 'input-phone': MECXDynamicInputPhoneComponent,
1021
- radiobutton: MECXDynamicRadioComponent,
1022
- select: MECXDynamicSelectComponent,
1023
- 'select-search': MECXDynamicSelectSearchComponent,
1024
- 'file-upload': MECXDynamicFileUploadComponent,
1025
- button: MECXDynamicButtonComponent
1026
- };
1027
- class MECXDynamicDirective {
1028
- constructor(resolver, container, cdr) {
1029
- this.resolver = resolver;
1030
- this.container = container;
1031
- this.cdr = cdr;
1032
- // not to do
1033
- }
1034
- handleInternalPlusValidation() {
1035
- var _a, _b;
1036
- if (!((_a = this.field) === null || _a === void 0 ? void 0 : _a.alwaysShowPlusValidation))
1037
- return false;
1038
- const { operator, value, field } = (_b = this.field) === null || _b === void 0 ? void 0 : _b.alwaysShowPlusValidation;
1039
- const validators = {
1040
- e: (val1, val2) => { return val1 === val2; },
1041
- lt: (val1, val2) => { return val1 < val2; },
1042
- gt: (val1, val2) => { return val1 > val2; }
1043
- };
1044
- const data = this.form.controls[field].value;
1045
- return validators[operator](data, value);
1046
- }
1047
- buildComponent() {
1048
- var _a;
1049
- if ((_a = this.componentRef) === null || _a === void 0 ? void 0 : _a.instance)
1050
- return;
1051
- const factory = this.resolver.resolveComponentFactory(componentMapper[this.field.fieldType]);
1052
- this.componentRef = this.container.createComponent(factory);
1053
- this.componentRef.instance._field = this.field;
1054
- this.componentRef.instance._form = this.form;
1055
- // eslint-disable-next-line object-curly-newline
1056
- this.componentRef.instance._formErrors = this.formErrors || {};
1057
- this.componentRef.instance.self = this.self;
1058
- }
1059
- ngOnInit() {
1060
- if (!this.field.alwaysShow && !this.handleInternalPlusValidation())
1061
- return;
1062
- this.buildComponent();
1063
- }
1064
- ngOnChanges() {
1065
- var _a, _b, _c, _d;
1066
- if (this.plusValidations && this.plusValidations[this.field.name]) {
1067
- if (!this.field.alwaysShow && this.plusValidations[this.field.name].alwaysShow) {
1068
- setTimeout(() => {
1069
- this.buildComponent();
1070
- this.cdr.detectChanges();
1071
- }, 1);
1072
- }
1073
- if (((_a = this.componentRef) === null || _a === void 0 ? void 0 : _a.instance) && !this.plusValidations[this.field.name].alwaysShow) {
1074
- this.componentRef.destroy();
1075
- this.componentRef = null;
1076
- (_b = this.form.controls[this.field.name]) === null || _b === void 0 ? void 0 : _b.setValue(null);
1077
- (_c = this.form.controls[this.field.name]) === null || _c === void 0 ? void 0 : _c.clearValidators();
1078
- }
1079
- }
1080
- if (!((_d = this.componentRef) === null || _d === void 0 ? void 0 : _d.instance))
1081
- return;
1082
- this.componentRef.instance._formErrors = this.formErrors || {};
1083
- }
1084
- }
1085
- MECXDynamicDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicDirective, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
1086
- MECXDynamicDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicDirective, selector: "[MECXDynamic]", inputs: { field: "field", form: "form", formErrors: "formErrors", self: "self", plusValidations: "plusValidations" }, usesOnChanges: true, ngImport: i0 });
1087
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicDirective, decorators: [{
1088
- type: Directive,
1089
- args: [{
1090
- selector: '[MECXDynamic]'
1091
- }]
1092
- }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { field: [{
1093
- type: Input
1094
- }], form: [{
1095
- type: Input
1096
- }], formErrors: [{
1097
- type: Input
1098
- }], self: [{
1099
- type: Input
1100
- }], plusValidations: [{
1101
- type: Input
1102
- }] } });
1103
-
1104
- class MECXDynamicFormComponent extends BaseDynamic {
1105
- constructor(fb, cdr) {
1106
- super(fb);
1107
- this.cdr = cdr;
1108
- this.unsubscribeAll = new Subject();
1109
- }
1110
- ngOnInit() {
1111
- super.ngOnInit();
1112
- this.onHandleSubmit.pipe(takeUntil(this.unsubscribeAll)).subscribe((func) => {
1113
- this.onSubmit(func);
1114
- });
1115
- }
1116
- ngOnDestroy() {
1117
- this.unsubscribeAll.next();
1118
- this.unsubscribeAll.complete();
1119
- }
1120
- onSubmit(callback) {
1121
- const { _form } = this;
1122
- // eslint-disable-next-line object-curly-newline
1123
- this.__monkeyecxFormErrors = {};
1124
- const isValid = this.validateForm(_form);
1125
- this.cdr.detectChanges();
1126
- this.onHandleSubmitFormReady.next({
1127
- validate: {
1128
- isValid
1129
- },
1130
- callback,
1131
- form: _form
1132
- });
1133
- }
1134
- }
1135
- MECXDynamicFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicFormComponent, deps: [{ token: i1.FormBuilder }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1136
- MECXDynamicFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicFormComponent, selector: "mecx-dynamic-form", usesInheritance: true, ngImport: i0, 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$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MECXDynamicDirective, selector: "[MECXDynamic]", inputs: ["field", "form", "formErrors", "self", "plusValidations"] }], encapsulation: i0.ViewEncapsulation.None });
1137
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicFormComponent, decorators: [{
1138
- type: Component,
1139
- args: [{
1140
- selector: 'mecx-dynamic-form',
1141
- templateUrl: './dynamic-form.component.html',
1142
- styles: [],
1143
- encapsulation: ViewEncapsulation.None
1144
- }]
1145
- }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i0.ChangeDetectorRef }]; } });
1146
-
1147
- class MECXDynamicFormArrayComponent extends BaseDynamicArray {
1148
- constructor(fb, cdr) {
1149
- super(fb);
1150
- this.cdr = cdr;
1151
- this.unsubscribeAll = new Subject();
1152
- this.__monkeyecxFormErrors = [];
1153
- }
1154
- ngOnInit() {
1155
- super.ngOnInit();
1156
- this.onHandleSubmit.pipe(takeUntil(this.unsubscribeAll)).subscribe((func) => {
1157
- this.onSubmit(func);
1158
- });
1159
- }
1160
- ngOnDestroy() {
1161
- this.unsubscribeAll.next();
1162
- this.unsubscribeAll.complete();
1163
- }
1164
- onSubmit(callback) {
1165
- const { _form } = this;
1166
- // eslint-disable-next-line object-curly-newline
1167
- this.__monkeyecxFormErrors = [];
1168
- let validate = {
1169
- isValid: false
1170
- };
1171
- let hasErrors = false;
1172
- if (this.formValues) {
1173
- this.__monkeyecxFormErrors = [this.formValues.length];
1174
- this.formValues.controls.forEach((item, index) => {
1175
- if (item instanceof FormGroup) {
1176
- if (!this.validateForm(item, index)) {
1177
- hasErrors = true;
1178
- }
1179
- }
1180
- });
1181
- }
1182
- validate = {
1183
- isValid: !hasErrors
1184
- };
1185
- this.cdr.detectChanges();
1186
- this.onHandleSubmitFormReady.next({
1187
- validate,
1188
- callback,
1189
- form: _form
1190
- });
1191
- }
1192
- onHandleAdd() {
1193
- this.formValues.push(this.formBase());
1194
- this.cdr.detectChanges();
1195
- }
1196
- onHandleRemove(index) {
1197
- this.formValues.removeAt(index);
1198
- this._plusValidations.splice(index, 1);
1199
- }
1200
- }
1201
- MECXDynamicFormArrayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicFormArrayComponent, deps: [{ token: i1.FormBuilder }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1202
- MECXDynamicFormArrayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: MECXDynamicFormArrayComponent, selector: "mecx-dynamic-form-array", usesInheritance: true, ngImport: i0, 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$1.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: MECXDynamicDirective, selector: "[MECXDynamic]", inputs: ["field", "form", "formErrors", "self", "plusValidations"] }], pipes: { "translate": i3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
1203
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicFormArrayComponent, decorators: [{
1204
- type: Component,
1205
- args: [{
1206
- selector: 'mecx-dynamic-form-array',
1207
- templateUrl: './dynamic-form-array.component.html',
1208
- styleUrls: ['./dynamic-form-array.component.scss'],
1209
- encapsulation: ViewEncapsulation.None
1210
- }]
1211
- }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i0.ChangeDetectorRef }]; } });
1212
-
1213
- class MECXDynamicModule {
1214
- }
1215
- MECXDynamicModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1216
- MECXDynamicModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicModule, declarations: [MECXDynamicButtonComponent,
1217
- MECXDynamicFileUploadComponent,
1218
- MECXDynamicFormComponent,
1219
- MECXDynamicFormArrayComponent,
1220
- MECXDynamicInputComponent,
1221
- MECXDynamicInputPhoneComponent,
1222
- MECXDynamicRadioComponent,
1223
- MECXDynamicSelectComponent,
1224
- MECXDynamicSelectSearchComponent,
1225
- MECXDynamicDirective], imports: [CommonModule,
1226
- FormsModule,
1227
- ReactiveFormsModule,
1228
- MonkeyInputModule,
1229
- MonkeySelectModule,
1230
- MonkeyRadioButtonModule,
1231
- MonkeyOptionModule,
1232
- MonkeyFileUploadModule,
1233
- MonkeyButtonModule,
1234
- MonkeyInputPhoneModule, i3.TranslateModule], exports: [MECXDynamicDirective, MECXDynamicFormComponent, MECXDynamicFormArrayComponent] });
1235
- MECXDynamicModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicModule, imports: [[
1236
- CommonModule,
1237
- FormsModule,
1238
- ReactiveFormsModule,
1239
- MonkeyInputModule,
1240
- MonkeySelectModule,
1241
- MonkeyRadioButtonModule,
1242
- MonkeyOptionModule,
1243
- MonkeyFileUploadModule,
1244
- MonkeyButtonModule,
1245
- MonkeyInputPhoneModule,
1246
- TranslateModule.forChild()
1247
- ]] });
1248
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: MECXDynamicModule, decorators: [{
1249
- type: NgModule,
1250
- args: [{
1251
- declarations: [
1252
- MECXDynamicButtonComponent,
1253
- MECXDynamicFileUploadComponent,
1254
- MECXDynamicFormComponent,
1255
- MECXDynamicFormArrayComponent,
1256
- MECXDynamicInputComponent,
1257
- MECXDynamicInputPhoneComponent,
1258
- MECXDynamicRadioComponent,
1259
- MECXDynamicSelectComponent,
1260
- MECXDynamicSelectSearchComponent,
1261
- MECXDynamicDirective
1262
- ],
1263
- imports: [
1264
- CommonModule,
1265
- FormsModule,
1266
- ReactiveFormsModule,
1267
- MonkeyInputModule,
1268
- MonkeySelectModule,
1269
- MonkeyRadioButtonModule,
1270
- MonkeyOptionModule,
1271
- MonkeyFileUploadModule,
1272
- MonkeyButtonModule,
1273
- MonkeyInputPhoneModule,
1274
- TranslateModule.forChild()
1275
- ],
1276
- exports: [MECXDynamicDirective, MECXDynamicFormComponent, MECXDynamicFormArrayComponent],
1277
- entryComponents: [MECXDynamicInputComponent]
1278
- }]
1279
- }] });
1280
-
1281
- /*
1282
- * Public API Surface of monkey-front-components
1283
- */
1284
-
1285
- /**
1286
- * Generated bundle index. Do not edit.
1287
- */
1288
-
1289
- export { BaseComponent, BaseDynamic, BaseDynamicArray, MECXDynamicDirective, MECXDynamicFileUploadComponent, MECXDynamicFormArrayComponent, MECXDynamicFormComponent, MECXDynamicInputComponent, MECXDynamicInputPhoneComponent, MECXDynamicModule, MECXDynamicRadioComponent, MECXDynamicSelectComponent, validators };
1290
- //# sourceMappingURL=monkey-front-components.js.map