form-aurora-stefanini 0.1.0 → 0.1.3

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 (46) hide show
  1. package/karma.conf.js +32 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +17 -28
  4. package/src/lib/Components/from-aurora/form-aurora.component.css +117 -0
  5. package/src/lib/Components/from-aurora/form-aurora.component.html +343 -0
  6. package/src/lib/Components/from-aurora/form-aurora.component.spec.ts +25 -0
  7. package/src/lib/Components/from-aurora/form-aurora.component.ts +725 -0
  8. package/src/lib/Models/company-parameters.ts +16 -0
  9. package/src/lib/Models/company.ts +25 -0
  10. package/src/lib/Models/fill.ts +6 -0
  11. package/src/lib/Models/state.ts +5 -0
  12. package/src/lib/Models/step.ts +15 -0
  13. package/src/lib/Models/stepMethod.ts +9 -0
  14. package/src/lib/form-aurora.module.ts +18 -0
  15. package/src/lib/services/TemplateService.ts +84 -0
  16. package/src/lib/services/data.service.ts +83 -0
  17. package/src/lib/utils/regex.ts +51 -0
  18. package/src/public-api.ts +9 -0
  19. package/src/test.ts +21 -0
  20. package/tsconfig.lib.json +26 -0
  21. package/tsconfig.spec.json +17 -0
  22. package/tslint.json +17 -0
  23. package/bundles/form-aurora-stefanini.umd.js +0 -975
  24. package/bundles/form-aurora-stefanini.umd.js.map +0 -1
  25. package/bundles/form-aurora-stefanini.umd.min.js +0 -16
  26. package/bundles/form-aurora-stefanini.umd.min.js.map +0 -1
  27. package/esm2015/form-aurora-stefanini.js +0 -5
  28. package/esm2015/lib/fill.js +0 -3
  29. package/esm2015/lib/form-aurora.component.js +0 -681
  30. package/esm2015/lib/form-aurora.module.js +0 -22
  31. package/esm2015/public-api.js +0 -6
  32. package/esm5/form-aurora-stefanini.js +0 -5
  33. package/esm5/lib/fill.js +0 -7
  34. package/esm5/lib/form-aurora.component.js +0 -733
  35. package/esm5/lib/form-aurora.module.js +0 -25
  36. package/esm5/public-api.js +0 -6
  37. package/fesm2015/form-aurora-stefanini.js +0 -703
  38. package/fesm2015/form-aurora-stefanini.js.map +0 -1
  39. package/fesm5/form-aurora-stefanini.js +0 -758
  40. package/fesm5/form-aurora-stefanini.js.map +0 -1
  41. package/form-aurora-stefanini.d.ts +0 -4
  42. package/form-aurora-stefanini.metadata.json +0 -1
  43. package/lib/fill.d.ts +0 -6
  44. package/lib/form-aurora.component.d.ts +0 -106
  45. package/lib/form-aurora.module.d.ts +0 -2
  46. package/public-api.d.ts +0 -2
@@ -1,758 +0,0 @@
1
- import { __extends, __decorate, __values, __spread, __awaiter, __generator } from 'tslib';
2
- import { Injectable, EventEmitter, Input, ViewChild, Output, Component, NgModule } from '@angular/core';
3
- import { FormGroup, FormControl, FormsModule } from '@angular/forms';
4
- import { HttpClient } from '@angular/common/http';
5
- import { NgbDateAdapter, NgbDateParserFormatter, NgbDatepickerI18n } from '@ng-bootstrap/ng-bootstrap';
6
- import * as moment_ from 'moment';
7
- import { CommonModule } from '@angular/common';
8
- import { RecaptchaModule, RecaptchaFormsModule } from 'ng-recaptcha';
9
-
10
- var moment = moment_;
11
- // import { regexType } from "@app/_shared/_util/regex";
12
- // import { ExternalService } from '@app/_shared/_services/external.service';
13
- // import { AuroraService } from '@app/_shared/_services/aurora.service';
14
- /**
15
- * This Service handles how the date is represented in scripts i.e. ngModel.
16
- */
17
- var CustomAdapter = /** @class */ (function (_super) {
18
- __extends(CustomAdapter, _super);
19
- function CustomAdapter() {
20
- var _this = _super !== null && _super.apply(this, arguments) || this;
21
- _this.DELIMITER = '/';
22
- return _this;
23
- }
24
- CustomAdapter.prototype.fromModel = function (value) {
25
- if (value) {
26
- var date = value.split(this.DELIMITER);
27
- return {
28
- day: parseInt(date[0], 10),
29
- month: parseInt(date[1], 10),
30
- year: parseInt(date[2], 10)
31
- };
32
- }
33
- return null;
34
- };
35
- CustomAdapter.prototype.toModel = function (date) {
36
- //return date ? date.day + this.DELIMITER + date.month + this.DELIMITER + date.year : null;
37
- return date ? (date.day < 10 ? 0 + date.day : date.day) + this.DELIMITER + (date.month < 10 ? 0 + date.month : date.month) + this.DELIMITER + date.year : '';
38
- };
39
- CustomAdapter = __decorate([
40
- Injectable()
41
- ], CustomAdapter);
42
- return CustomAdapter;
43
- }(NgbDateAdapter));
44
- /**
45
- * This Service handles how the date is rendered and parsed from keyboard i.e. in the bound input field.
46
- */
47
- var CustomDateParserFormatter = /** @class */ (function (_super) {
48
- __extends(CustomDateParserFormatter, _super);
49
- function CustomDateParserFormatter() {
50
- var _this = _super !== null && _super.apply(this, arguments) || this;
51
- _this.DELIMITER = '/';
52
- return _this;
53
- }
54
- CustomDateParserFormatter.prototype.parse = function (value) {
55
- if (value) {
56
- var date = value.split(this.DELIMITER);
57
- return {
58
- day: parseInt(date[0], 10),
59
- month: parseInt(date[1], 10),
60
- year: parseInt(date[2], 10)
61
- };
62
- }
63
- return null;
64
- };
65
- CustomDateParserFormatter.prototype.format = function (date) {
66
- return date ? (date.day < 10 ? '0' + date.day : date.day) + this.DELIMITER + (date.month < 10 ? '0' + date.month : date.month) + this.DELIMITER + date.year : '';
67
- };
68
- CustomDateParserFormatter = __decorate([
69
- Injectable()
70
- ], CustomDateParserFormatter);
71
- return CustomDateParserFormatter;
72
- }(NgbDateParserFormatter));
73
- var I18N_VALUES = {
74
- 'es': {
75
- weekdays: ['Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa', 'Do'],
76
- months: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
77
- weekLabel: 'sem'
78
- }
79
- // other languages you would support
80
- };
81
- var I18n = /** @class */ (function () {
82
- function I18n() {
83
- this.language = 'es';
84
- }
85
- I18n = __decorate([
86
- Injectable()
87
- ], I18n);
88
- return I18n;
89
- }());
90
- // Define custom service providing the months and weekdays translations
91
- var CustomDatepickerI18n = /** @class */ (function (_super) {
92
- __extends(CustomDatepickerI18n, _super);
93
- function CustomDatepickerI18n(_i18n) {
94
- var _this = _super.call(this) || this;
95
- _this._i18n = _i18n;
96
- return _this;
97
- }
98
- CustomDatepickerI18n.prototype.getWeekdayLabel = function (weekday) {
99
- return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
100
- };
101
- CustomDatepickerI18n.prototype.getWeekLabel = function () {
102
- return I18N_VALUES[this._i18n.language].weekLabel;
103
- };
104
- CustomDatepickerI18n.prototype.getMonthShortName = function (month) {
105
- return I18N_VALUES[this._i18n.language].months[month - 1];
106
- };
107
- CustomDatepickerI18n.prototype.getMonthFullName = function (month) {
108
- return this.getMonthShortName(month);
109
- };
110
- CustomDatepickerI18n.prototype.getDayAriaLabel = function (date) {
111
- return date.day + "-" + date.month + "-" + date.year;
112
- };
113
- CustomDatepickerI18n.prototype.getWeekdayShortName = function (weekday) {
114
- return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
115
- };
116
- ;
117
- CustomDatepickerI18n.ctorParameters = function () { return [
118
- { type: I18n }
119
- ]; };
120
- CustomDatepickerI18n = __decorate([
121
- Injectable()
122
- ], CustomDatepickerI18n);
123
- return CustomDatepickerI18n;
124
- }(NgbDatepickerI18n));
125
- var FormAuroraComponent = /** @class */ (function () {
126
- function FormAuroraComponent(http) {
127
- this.http = http;
128
- this.response = new EventEmitter();
129
- this.summit = new EventEmitter();
130
- this.setAcceptanceDocument = new EventEmitter();
131
- this.tipodocNumDoc = false;
132
- this.onSubmitEvent = false;
133
- this.countSubmit = 0;
134
- this.watchValid = false;
135
- this.watchRequired = false;
136
- this.captchaValid = false;
137
- this.displayMonths = 2;
138
- this.navigation = 'select';
139
- this.showWeekNumbers = false;
140
- this.outsideDays = 'visible';
141
- this.respServiceSegmentation = null;
142
- //emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$";
143
- this.today = moment(new Date());
144
- this.maxYear = this.today.year();
145
- this.minYear = this.today.year() - 82;
146
- this.minDate = this.minYear.toString() + '-' + this.today.month().toString().padStart(2, '0') + '-' + this.today.date().toString().padStart(2, '0'); // {year: this.minYear, month: this.today.month(), day: this.today.date()};
147
- this.maxDate = this.maxYear.toString() + '-' + (this.today.month() + 1).toString().padStart(2, '0') + '-' + this.today.date().toString().padStart(2, '0'); // {year: this.maxYear, month: this.today.month() + 1, day: this.today.date()};
148
- //Revisar variables
149
- this.recharge = false;
150
- this.indicativo = '57';
151
- this.defaultDocType = 'Cédula de ciudadanía';
152
- this.range = new FormGroup({
153
- start: new FormControl(),
154
- end: new FormControl(),
155
- });
156
- }
157
- FormAuroraComponent.prototype.ngOnInit = function () {
158
- var _this = this;
159
- console.log('nueva version 0.1.0');
160
- this.minDate = new Date(this.minDate).toISOString().split('T')[0];
161
- setTimeout(function () {
162
- _this.startComponent();
163
- }, 2000);
164
- };
165
- FormAuroraComponent.prototype.startComponent = function () {
166
- var e_1, _a;
167
- var _this = this;
168
- //ordena los campos
169
- if (this.dataForm != null && this.dataForm.formQuestions != undefined) {
170
- //Same row fields
171
- this.tipodocNumDoc = (this.dataForm.formQuestions.some(function (question) { return question.question.value === 'tipoDoc'; }) && this.dataForm.formQuestions.some(function (question) { return question.question.value === 'numeroDoc'; })) ? true : false;
172
- this.dataForm.formQuestions = this.dataForm.formQuestions.sort(function (a, b) {
173
- return a.order - b.order;
174
- });
175
- var existcaptcha = this.dataForm.formQuestions.filter(function (item) { return item.question.questionType.id == 6; });
176
- if (existcaptcha.length == 0) {
177
- this.captchaValid = true;
178
- }
179
- var _loop_1 = function (item) {
180
- if (item.question.maxlength == null || item.question.maxlength == undefined || item.question.maxlength == 0) {
181
- item.question.maxlength = 524288; //defaultvalue
182
- }
183
- if (item.question.minLength == null || item.question.minLength == undefined) {
184
- item.question.minLength = 0;
185
- }
186
- this_1.dataReloadForm.forEach(function (element) {
187
- _this.filldata = element;
188
- if ((item.question.questionType.id === 2 || item.question.questionType.id === 1 ||
189
- item.question.questionType.id === 3) && (_this.filldata.data !== null &&
190
- _this.filldata.data !== undefined) && item.question.id === _this.filldata.id) {
191
- item.question.registred = _this.filldata.data;
192
- }
193
- });
194
- if (item.question.registred == null || item.question.minLength == undefined) {
195
- item.question.registred = '';
196
- }
197
- };
198
- var this_1 = this;
199
- try {
200
- for (var _b = __values(this.dataForm.formQuestions), _c = _b.next(); !_c.done; _c = _b.next()) {
201
- var item = _c.value;
202
- _loop_1(item);
203
- }
204
- }
205
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
206
- finally {
207
- try {
208
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
209
- }
210
- finally { if (e_1) throw e_1.error; }
211
- }
212
- }
213
- };
214
- FormAuroraComponent.prototype.resolvedCaptcha = function (captchaResponse) {
215
- this.captchaValid = true;
216
- if (!this.formDynamic.form.value.captcha) {
217
- this.formDynamic.controls.captcha.setValue(captchaResponse);
218
- this.formDynamic.form.value.captcha = captchaResponse;
219
- document.getElementById('btnIng').style.opacity = !this.formDynamic.valid ? '0.65' : '1';
220
- }
221
- };
222
- //Forms
223
- //Metodo para evitar el render de los items del for
224
- FormAuroraComponent.prototype.trackByIndex = function (index, obj) {
225
- return index;
226
- };
227
- FormAuroraComponent.prototype.onChangeValidPatter = function (event, question) {
228
- var _this = this;
229
- if (question.pattern != undefined) {
230
- var valid = true;
231
- var keyvalid = [8, 32, 37, 38, 39, 40, 46, 9];
232
- //diferente de Backpsace
233
- //se deja catch por error no controlable en otro tiempo de ejecucion
234
- try {
235
- if (!keyvalid.includes(event.keyCode)) {
236
- var regex = new RegExp(question.pattern);
237
- valid = regex.test(event.key);
238
- }
239
- }
240
- catch (error) {
241
- }
242
- return valid;
243
- }
244
- document.getElementById('char' + question.value).setAttribute('hidden', 'true');
245
- //if temporal mientras se migran todos los tipos de campos al foreach
246
- if (question.questionType.id != 11 && question.questionType.id != 7) {
247
- if (this.validMinLength(this.formDynamic, question)) {
248
- document.getElementById(question.value).style.borderColor = '#FF0000';
249
- document.getElementById('ml' + question.value).removeAttribute('hidden');
250
- }
251
- else {
252
- document.getElementById(question.value).style.borderColor = '#E4E4E4';
253
- document.getElementById('ml' + question.value).setAttribute('hidden', 'true');
254
- }
255
- if (this.validMaxLength(this.formDynamic, question)) {
256
- document.getElementById(question.value).style.borderColor = '#FF0000';
257
- document.getElementById('mxl' + question.value).removeAttribute('hidden');
258
- }
259
- else {
260
- document.getElementById(question.value).style.borderColor = '#E4E4E4';
261
- document.getElementById('mxl' + question.value).setAttribute('hidden', 'true');
262
- }
263
- }
264
- this.dataForm.formQuestions.forEach(function (formQuestion) {
265
- switch (formQuestion.question.questionType.id) {
266
- //se valida campo de tipo calendario
267
- case 7:
268
- if (question.questionType.id == 7)
269
- _this.calendarRulesValidate(formQuestion);
270
- break;
271
- //se valida campo de tipo email
272
- case 11:
273
- if (question.questionType.id == 11)
274
- _this.emailRulesValidate(formQuestion);
275
- break;
276
- }
277
- });
278
- document.getElementById('btnIng').style.opacity = !this.formDynamic.valid ? '0.65' : '1';
279
- };
280
- FormAuroraComponent.prototype.validOnlyText = function (event) {
281
- var regex = /^[a-zA-Z\u00C0-\u017F]+$/g;
282
- if (event.charCode == 32) {
283
- return true;
284
- }
285
- var valid = regex.test(event.key);
286
- return valid;
287
- };
288
- FormAuroraComponent.prototype.validDate = function (event) {
289
- /*let pattern = /(?:0[1-9]|[12][0-9]|3[01])\/(?:0[1-9]|1[0-2])\/(?:19|20)[0-9]{2}/;
290
- const regex = new RegExp(pattern);
291
- valid = regex.test(event.key);
292
- */
293
- var matches = String(event.key).match(this.regexType.date.exp);
294
- var valid = true;
295
- if (matches === null)
296
- valid = false;
297
- // alert(valid);
298
- return valid;
299
- };
300
- FormAuroraComponent.prototype.onChangeValidDate = function (event) {
301
- //let pattern = /(?:0[1-9]|1[0-2])\/(?:0[1-9]|[12][0-9]|3[01])\/(?:19|20)[0-9]{2}/;
302
- var dateN = /[0-9]|\//;
303
- var valid = true;
304
- var regex = new RegExp(dateN);
305
- valid = regex.test(event.key);
306
- return valid;
307
- };
308
- FormAuroraComponent.prototype.rediretoutside = function (event, question) {
309
- //se deja catch por error no controlable en otro tiempo de ejecucion
310
- try {
311
- event.preventDefault();
312
- window.open(question.value, '_blank');
313
- }
314
- catch (error) {
315
- }
316
- };
317
- /**
318
- * Dispatch submit event for validations exists
319
- * @param change
320
- */
321
- FormAuroraComponent.prototype.ngOnChanges = function (change) {
322
- this.countSubmit++;
323
- };
324
- //onSubmit(form: NgForm) {
325
- FormAuroraComponent.prototype.onSubmit = function () {
326
- var _this = this;
327
- var form = this.formDynamic;
328
- this.watchValid = true;
329
- this.watchRequired = true;
330
- if (form.valid) {
331
- if (!this.validRulesFields(form.controls['numeroDoc'].value.toString(), form.controls['celular'].value.toString(), form.controls['email'].value))
332
- return false;
333
- }
334
- if (this.validMinlenghtAllQuestions(form.value) && this.validMaxLengthAllQuestions(form.value) && form.valid) {
335
- if (this.dataForm.urlSend != '' && this.captchaValid) {
336
- this.http.post(this.dataForm.urlSend, form.value).subscribe(function (resp) { return _this.response.emit(resp); });
337
- }
338
- else if (form.valid && this.captchaValid) {
339
- this.summit.emit(form.value);
340
- }
341
- }
342
- };
343
- FormAuroraComponent.prototype.validRulesFields = function (numeroDoc, numeroCel, email) {
344
- var _this = this;
345
- // Validaciones para celular en caso de indicativo en Colombia
346
- var cel = document.getElementById('charcelular');
347
- var doc = document.getElementById('charnumeroDoc');
348
- var valOk = true;
349
- if (this.indicativo == '+57' || this.indicativo == '57') {
350
- var stringOrdenado = this.orderString(numeroDoc);
351
- if (this.nameCompany.toUpperCase() !== 'CLARO') { //claro acepta nro consecutivos
352
- if (numeroDoc == stringOrdenado) {
353
- doc.style.borderColor = '#FF0000';
354
- doc.removeAttribute('hidden');
355
- doc.textContent = 'El numero documento No debe contener caracteres consecutivos';
356
- valOk = false;
357
- //this.msgErrorCampo = "El numero documento No debe contener caracteres consecutivos";
358
- //return false;
359
- }
360
- }
361
- if (numeroCel.substring(0, 1) != '3') {
362
- cel.style.borderColor = '#FF0000';
363
- cel.removeAttribute('hidden');
364
- cel.textContent = 'El primer carácter del celular debe ser 3';
365
- valOk = false;
366
- //this.msgErrorCampo = "El primer carácter del celular debe ser 3";
367
- //return false;
368
- }
369
- /*
370
- if (parseInt(numeroCel.substring(0, 3)) > 350) {
371
- cel.style.borderColor = "#FF0000";
372
- cel.removeAttribute("hidden");
373
- cel.textContent = "El prefijo del celular no debe ser mayor a 350";
374
- valOk = false;
375
- //this.msgErrorCampo = "El prefijo del celular no debe ser mayor a 350";
376
- //return false;
377
- }
378
- */
379
- //En caso de que el número se repita, ejemplo 33333333
380
- var listnumber = numeroDoc.substring(0, 1);
381
- for (var index = 1; index < numeroDoc.length; index++) {
382
- listnumber = listnumber + numeroDoc.substring(0, 1);
383
- }
384
- if (numeroDoc == listnumber) {
385
- doc.style.borderColor = '#FF0000';
386
- doc.removeAttribute('hidden');
387
- doc.textContent = 'Caracteres numéricos no se pueden repetirse de manera continua ';
388
- valOk = false;
389
- //this.msgErrorCampo = "Caracteres numéricos no se pueden repetirse de manera continua ";
390
- //return false;
391
- }
392
- // En caso de que el número se repita, ejemplo 33333333
393
- var arrayPhoneRepeat = Array.from(String(numeroCel), Number);
394
- var arrayPhoneOutRepeat = __spread(new Set(arrayPhoneRepeat));
395
- if (arrayPhoneOutRepeat.length == 1) {
396
- cel.style.borderColor = '#FF0000';
397
- cel.removeAttribute('hidden');
398
- cel.textContent = 'El número que ingresa no es valido';
399
- valOk = false;
400
- //this.msgErrorCampo = "El número que ingresa no es valido";
401
- //return false;
402
- }
403
- }
404
- else if (this.indicativo == '+593' || this.indicativo == '593') {
405
- if (numeroCel.substring(0, 1) != '9') {
406
- cel.style.borderColor = '#FF0000';
407
- cel.removeAttribute('hidden');
408
- cel.textContent = 'El primer carácter del celular debe ser 9';
409
- valOk = false;
410
- //this.msgErrorCampo = "El primer carácter del celular debe ser 9";
411
- //return false;
412
- }
413
- }
414
- //se validan los campos por tipo de campo y no por value
415
- this.dataForm.formQuestions.forEach(function (formQuestion) {
416
- switch (formQuestion.question.questionType.id) {
417
- //se valida campo de tipo email
418
- case 11:
419
- valOk = _this.emailRulesValidate(formQuestion);
420
- break;
421
- }
422
- });
423
- return valOk;
424
- };
425
- FormAuroraComponent.prototype.orderString = function (value) {
426
- var arrayNumber = [];
427
- for (var index = 0; index < value.length; index++) {
428
- arrayNumber.push(parseInt(value.substring(index, index + 1)));
429
- }
430
- //ordena el array
431
- arrayNumber.sort(function (a, b) {
432
- return a - b;
433
- });
434
- var numberOrder = '';
435
- numberOrder = arrayNumber[0];
436
- for (var index = 1; index < arrayNumber.length; index++) {
437
- numberOrder = numberOrder + (arrayNumber[0] + index).toString();
438
- }
439
- return numberOrder;
440
- };
441
- FormAuroraComponent.prototype.validMinlenghtAllQuestions = function (form) {
442
- var e_2, _a;
443
- try {
444
- for (var _b = __values(this.dataForm.formQuestions), _c = _b.next(); !_c.done; _c = _b.next()) {
445
- var item = _c.value;
446
- if (item.question.questionType.id == 1 || item.question.questionType.id == 2) {
447
- var minLength = parseInt(item.question.minLength);
448
- var formValueLength = parseInt(form[item.question.value].toString().length);
449
- if (minLength > 0 && formValueLength != minLength && formValueLength < minLength)
450
- return false;
451
- }
452
- }
453
- }
454
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
455
- finally {
456
- try {
457
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
458
- }
459
- finally { if (e_2) throw e_2.error; }
460
- }
461
- return true;
462
- };
463
- FormAuroraComponent.prototype.validMaxLengthAllQuestions = function (form) {
464
- var e_3, _a;
465
- try {
466
- for (var _b = __values(this.dataForm.formQuestions), _c = _b.next(); !_c.done; _c = _b.next()) {
467
- var item = _c.value;
468
- if (item.question.questionType.id == 1 || item.question.questionType.id == 2) {
469
- var maxLength = parseInt(item.question.maxLength);
470
- var formValueLength = parseInt(form[item.question.value].toString().length);
471
- if (maxLength > 0 && formValueLength != maxLength && formValueLength > maxLength)
472
- return false;
473
- }
474
- }
475
- }
476
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
477
- finally {
478
- try {
479
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
480
- }
481
- finally { if (e_3) throw e_3.error; }
482
- }
483
- return true;
484
- };
485
- FormAuroraComponent.prototype.validRequired = function (form, question) {
486
- //se deja catch por error no controlable en otro tiempo de ejecucion
487
- try {
488
- if (question != undefined && question.value != undefined) {
489
- if (form.controls[question.value] != undefined &&
490
- form.controls[question.value].errors != null &&
491
- form.controls[question.value].errors.required) {
492
- return true;
493
- }
494
- }
495
- }
496
- catch (error) {
497
- }
498
- return false;
499
- };
500
- FormAuroraComponent.prototype.validMinLength = function (form, question) {
501
- //se deja catch por error no controlable en otro tiempo de ejecucion
502
- try {
503
- if (question != undefined && question.value != undefined) {
504
- if (question.minLength > form.controls[question.value].value.toLocaleString().length && question.minLength > 0) {
505
- return true;
506
- }
507
- }
508
- }
509
- catch (error) {
510
- }
511
- return false;
512
- };
513
- FormAuroraComponent.prototype.validMaxLength = function (form, question) {
514
- //se deja catch por error no controlable en otro tiempo de ejecucion
515
- try {
516
- if (question != undefined && question.value != undefined) {
517
- if (question.maxLength > 0) {
518
- if (question.maxLength + 1 <= form.controls[question.value].value.toString().replace(/\./g, '').length) {
519
- if (!this.formDynamic.controls[question.value].hasError('errorMaxLength')) {
520
- this.formDynamic.controls[question.value].setErrors({ 'errorMaxLength': true });
521
- }
522
- return true;
523
- }
524
- }
525
- }
526
- }
527
- catch (error) {
528
- }
529
- return false;
530
- };
531
- FormAuroraComponent.prototype.tycSelection = function (event) {
532
- event.preventDefault();
533
- var tyc = document.getElementById('txtPoliticas');
534
- tyc.style.color = '#A3AD32';
535
- // this.externalService.getTermsAndConditions().subscribe(resp => {
536
- var b64 = null;
537
- if (this.getTermsAndConditions && this.getTermsAndConditions.listaDocumentos) {
538
- b64 = this.getTermsAndConditions.listaDocumentos[0].contenidoDocumento;
539
- this.respServiceSegmentation = this.getTermsAndConditions.listaDocumentos[0];
540
- var pdfWindow = window.open('');
541
- pdfWindow.document.write('<iframe width=\'100%\' height=\'100%\' src=\'data:application/pdf;base64, ' +
542
- encodeURI(b64) + '\'></iframe>');
543
- }
544
- // })
545
- };
546
- FormAuroraComponent.prototype.openLabelUrl = function (event, question) {
547
- event.preventDefault();
548
- var tyc = document.getElementById('check' + question.id);
549
- tyc.style.color = '#A3AD32';
550
- window.open(question.urllabel, '_blank');
551
- };
552
- FormAuroraComponent.prototype.checkTermsAndConditions = function (value) {
553
- return __awaiter(this, void 0, void 0, function () {
554
- var ipAddress, objToSend, aceptaciones;
555
- return __generator(this, function (_a) {
556
- switch (_a.label) {
557
- case 0:
558
- if (!value) return [3 /*break*/, 2];
559
- return [4 /*yield*/, this.getIpAddress];
560
- case 1:
561
- ipAddress = _a.sent();
562
- objToSend = {
563
- 'idDocumento': this.respServiceSegmentation.idDocumento || '',
564
- // "idDocumento": this.respServiceSegmentation?.idDocumento || "",
565
- 'nombrePortafolio': '0',
566
- 'aplicacion': 'ZP_OF',
567
- 'ip': ipAddress.ip,
568
- 'tipoIdAfil': 'CC',
569
- 'numeroIdAfil': this.formDynamic.controls['numeroDoc'].value.toString(),
570
- 'numeroCuentaPI': '0',
571
- 'transaccion': 'INICIO DE SESION_OF',
572
- 'conceptoAceptacion': 'HABEAS_DATA_USO_APP',
573
- 'respuesta': 'SI',
574
- 'usuarioCreacion': this.formDynamic.controls['numeroDoc'].value.toString()
575
- };
576
- aceptaciones = { aceptaciones: [objToSend] };
577
- // this.externalService.setAcceptanceDocument(aceptaciones).subscribe(() => { })
578
- this.setAcceptanceDocument.emit(aceptaciones);
579
- _a.label = 2;
580
- case 2: return [2 /*return*/];
581
- }
582
- });
583
- });
584
- };
585
- FormAuroraComponent.prototype.cancellKeypress = function () {
586
- return false;
587
- };
588
- FormAuroraComponent.prototype.emailRulesValidate = function (formQuestion) {
589
- var valOk = true;
590
- try {
591
- var hasError = false;
592
- document.getElementById(formQuestion.question.id).setAttribute('hidden', 'true');
593
- var eml = document.getElementById(formQuestion.question.id);
594
- var email = formQuestion.question.registred;
595
- if (!hasError) {
596
- if (formQuestion.question.required && (email == '' || email == undefined || email == null)) {
597
- eml.style.borderColor = '#FF0000';
598
- eml.textContent = 'El correco eléctronico es requerido';
599
- eml.removeAttribute('hidden');
600
- valOk = false;
601
- hasError = true;
602
- }
603
- }
604
- if (!hasError) {
605
- if (this.validMinLength(undefined, formQuestion.question)) {
606
- eml.style.borderColor = '#FF0000';
607
- eml.textContent = 'Debe ser mínimo de ' + formQuestion.question.minLength + ' caracteres';
608
- document.getElementById(formQuestion.question.id).removeAttribute('hidden');
609
- valOk = false;
610
- hasError = true;
611
- }
612
- }
613
- if (!hasError) {
614
- if (this.validMaxLength(undefined, formQuestion.question)) {
615
- eml.style.borderColor = '#FF0000';
616
- eml.textContent = 'Debe ser maximo de ' + formQuestion.question.maxLength + ' caracteres';
617
- document.getElementById(formQuestion.question.id).removeAttribute('hidden');
618
- valOk = false;
619
- hasError = true;
620
- }
621
- }
622
- if (!hasError) {
623
- var matches = String(email).match(this.regexType.email.exp);
624
- if (matches == null) {
625
- eml.style.borderColor = '#FF0000';
626
- eml.textContent = 'Tu email es invalido';
627
- eml.removeAttribute('hidden');
628
- valOk = false;
629
- hasError = true;
630
- }
631
- }
632
- }
633
- catch (error) {
634
- }
635
- return valOk;
636
- };
637
- FormAuroraComponent.prototype.calendarRulesValidate = function (formQuestion) {
638
- var hasError = false;
639
- try {
640
- document.getElementById(formQuestion.question.id).setAttribute('hidden', 'true');
641
- var ecalendar = document.getElementById(formQuestion.question.id);
642
- //se valida que no sea null si es requerido
643
- var date = formQuestion.question.registred;
644
- if (formQuestion.question.required && (date == '' || date == undefined || date == null)) {
645
- ecalendar.style.borderColor = '#FF0000';
646
- ecalendar.textContent = 'La fecha es requerida';
647
- ecalendar.removeAttribute('hidden');
648
- }
649
- }
650
- catch (error) {
651
- }
652
- };
653
- FormAuroraComponent.prototype.validateNotSpace = function (event) {
654
- if (event.charCode == 32) {
655
- return false;
656
- }
657
- else {
658
- return true;
659
- }
660
- };
661
- FormAuroraComponent.ctorParameters = function () { return [
662
- { type: HttpClient }
663
- ]; };
664
- __decorate([
665
- Input()
666
- ], FormAuroraComponent.prototype, "dataClassCss", void 0);
667
- __decorate([
668
- Input()
669
- ], FormAuroraComponent.prototype, "dataForm", void 0);
670
- __decorate([
671
- Input()
672
- ], FormAuroraComponent.prototype, "clickSubmit", void 0);
673
- __decorate([
674
- Input()
675
- ], FormAuroraComponent.prototype, "dataReloadForm", void 0);
676
- __decorate([
677
- Input()
678
- ], FormAuroraComponent.prototype, "welcomeTitle", void 0);
679
- __decorate([
680
- Input()
681
- ], FormAuroraComponent.prototype, "welcomeDescription", void 0);
682
- __decorate([
683
- Input()
684
- ], FormAuroraComponent.prototype, "urlPdf", void 0);
685
- __decorate([
686
- Input()
687
- ], FormAuroraComponent.prototype, "nameCompany", void 0);
688
- __decorate([
689
- Input()
690
- ], FormAuroraComponent.prototype, "schedule", void 0);
691
- __decorate([
692
- Input()
693
- ], FormAuroraComponent.prototype, "getTermsAndConditions", void 0);
694
- __decorate([
695
- Input()
696
- ], FormAuroraComponent.prototype, "regexType", void 0);
697
- __decorate([
698
- Input()
699
- ], FormAuroraComponent.prototype, "getIpAddress", void 0);
700
- __decorate([
701
- ViewChild('formDynamic', { static: true })
702
- ], FormAuroraComponent.prototype, "formDynamic", void 0);
703
- __decorate([
704
- Output()
705
- ], FormAuroraComponent.prototype, "response", void 0);
706
- __decorate([
707
- Output()
708
- ], FormAuroraComponent.prototype, "summit", void 0);
709
- __decorate([
710
- Output()
711
- ], FormAuroraComponent.prototype, "setAcceptanceDocument", void 0);
712
- __decorate([
713
- ViewChild('modalTurns', { static: false })
714
- ], FormAuroraComponent.prototype, "myModal", void 0);
715
- FormAuroraComponent = __decorate([
716
- Component({
717
- selector: 'lib-FormAurora',
718
- template: "<script src=\"https://www.google.com/recaptcha/api.js\" async defer></script>\n<div class=\"card\">\n <span class=\"text-center mt-2 d-none d-sm-block\">\n <img style=\"width: 115px; height:96px;\" [class]=\"dataClassCss.logo\" id=\"logo\">\n </span>\n <div class=\"card-body pt-0\">\n <ng-container *ngIf=\"schedule\">\n <h4 class=\"card-title text-center mb-0\" [class]=\"dataClassCss.bienvenida2\" style=\"color: #EE7E0E;\">\n Horarios de atenci\u00F3n\n </h4>\n <small class=\"text-center d-block\">{{schedule}}</small>\n </ng-container>\n <form #formDynamic=\"ngForm\">\n <div *ngFor=\"let control of dataForm?.formQuestions; let index = index; trackBy: trackByIndex\">\n <div\n *ngIf=\"(index > 0 && (dataForm.formQuestions[index - 1].question.questionType.id == 3 && dataForm.formQuestions[index].question.questionType.id == 2)) || (index < dataForm.formQuestions.length && dataForm.formQuestions[index].question.questionType.id == 3 && dataForm.formQuestions[index + 1].question.questionType.id == 2); else switchTemp\">\n <div class=\"row\"\n *ngIf=\"(index > 0 && (dataForm.formQuestions[index - 1].question.questionType.id == 3 && dataForm.formQuestions[index].question.questionType.id == 2))\">\n <div class=\"col-lg-6 col-xs-12\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index - 1].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left;\">\n <span class=\"h6 small bg-white text-muted\">{{dataForm.formQuestions[index -\n 1].question.label}}</span>\n </label>\n <div class=\"selectContainer\">\n <select [name]=\"dataForm.formQuestions[index - 1].question.value\"\n [required]=\"dataForm.formQuestions[index - 1].question.required\"\n [class]=\"dataClassCss.formcontrol\"\n id=\"{{dataForm.formQuestions[index - 1].question.value}}\"\n style=\"margin-top: -1rem !important;\"\n [(ngModel)]=\"defaultDocType !== '' ? defaultDocType : dataForm.formQuestions[index - 1].question.registred\">\n <option value=\"\" selected disabled hidden>Selecciona</option>\n <ng-container\n *ngFor=\"let item of dataForm.formQuestions[index - 1].question.questionAnswers\">\n <option *ngIf=\"item.answer.state.id == 1\" [value]=\"item.answer.value\">\n {{ item.answer.field }}\n </option>\n </ng-container>\n </select>\n </div>\n </div>\n <div style=\"margin-left: 15px;\"\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index-1].question.value\"\n hidden></span>\n </div>\n </div>\n <div class=\"col-lg-6 col-xs-12\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\"\n class=\"col-sm-12 p-sm-0 px-sm-1\" style=\"display: block; text-align: left;\">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" digitOnly id=\"{{dataForm.formQuestions[index].question.value}}\"\n style=\"margin-top: -1rem !important;\"\n [name]=\"dataForm.formQuestions[index].question.value\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (keyup)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n onkeypress=\"return (event.charCode == 0) ? null : event.charCode >= 48 && event.charCode <= 57\"\n onkeyup=\"(this.value=(value.replace(/[.]*/g,'')))\"\n maxlength=\"dataForm.formQuestions[index].question.maxLength\"\n [minLength]=\"dataForm.formQuestions[index].question.minLength\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n [class]=\"dataClassCss.formcontrol\"/>\n\n </div>\n <div style=\"margin-left: 15px;\"\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\n <span class=\"error\" [id]=\"'rq'+dataForm.formQuestions[index].question.value\"\n *ngIf=\"validRequired(formDynamic,dataForm.formQuestions[index].question) && watchValid\">\n Este campo es obligatorio</span>\n <span class=\"error\" [id]=\"'ml'+dataForm.formQuestions[index].question.value\" hidden>\n Debe ser m\u00EDnimo de\n {{ dataForm.formQuestions[index].question.minLength }} caracteres</span>\n <span class=\"error\" [id]=\"'mxl'+dataForm.formQuestions[index].question.value\" hidden>\n Debe ser maximo de\n {{ dataForm.formQuestions[index].question.maxLength }} caracteres</span>\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index].question.value\"\n hidden></span>\n </div>\n </div>\n </div>\n </div>\n\n <ng-template #switchTemp>\n <div [ngSwitch]=\"dataForm.formQuestions[index].question.questionType.id\">\n <div *ngSwitchCase=\"1\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left; \">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n style=\"margin-top: -1rem !important;\"/>\n </div>\n </div>\n <div *ngSwitchCase=\"2\">\n\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left;\">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" digitOnly id=\"{{dataForm.formQuestions[index].question.value}}\"\n style=\"margin-top: -1rem !important;\"\n [name]=\"dataForm.formQuestions[index].question.value\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n onkeypress=\"return (event.charCode == 0) ? null : event.charCode >= 48 && event.charCode <= 57\"\n onkeyup=\"(this.value=(value.replace(/[.]*/g,'')))\"\n maxlength=\"dataForm.formQuestions[index].question.maxLength\"\n [minLength]=\"dataForm.formQuestions[index].question.minLength\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n [class]=\"dataClassCss.formcontrol\"/>\n </div>\n\n </div>\n <div *ngSwitchCase=\"3\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left;\">\n <span\n class=\"h6 small bg-white text-muted\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <select [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [class]=\"dataClassCss.formcontrol\"\n id=\"{{dataForm.formQuestions[index].question.value}}\"\n style=\"margin-top: -1rem !important;\"\n [(ngModel)]=\"defaultDocType !== '' ? defaultDocType : dataForm.formQuestions[index].question.registred\">\n <option value=\"\" selected disabled hidden>Selecciona</option>\n <ng-container\n *ngFor=\"let item of dataForm.formQuestions[index].question.questionAnswers\">\n <option *ngIf=\"item.answer.state.id == 1\" [value]=\"item.answer.value\">\n {{ item.answer.field }}\n </option>\n </ng-container>\n </select>\n </div>\n </div>\n <div *ngSwitchCase=\"4\">\n <select class=\"{{ dataClassCss.formcontrol }} select-checkbox\"\n style=\"overflow: hidden; border-style: hidden;\"\n [style.height.px]=\"dataForm.formQuestions[index].question.questionAnswers.length * 24\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\" ngModel multiple>\n <!-- todo: delete (mousedown)=\"onMouseDown($event, dataForm.formQuestions[index].question.value, formDynamic)\"-->\n <option\n (mousemove)=\"$event.preventDefault()\"\n *ngFor=\"let item of dataForm.formQuestions[index].question.questionAnswers\"\n [value]=\"item.answer.value\">\n {{ item.answer.field }}\n </option>\n </select>\n </div>\n <div *ngSwitchCase=\"5\">\n <a (click)=\"rediretoutside($event,dataForm.formQuestions[index].question)\" href=\"\">\n <span>{{ dataForm.formQuestions[index].question.label }}</span>\n </a>\n </div>\n <div *ngSwitchCase=\"6\">\n <div [class]=\"dataClassCss.cl12\" [id]=\"'reCaptcha'\">\n <div class=\"cnt-captcha\">\n <re-captcha (resolved)=\"resolvedCaptcha($event)\"\n siteKey=\"6LfQisEZAAAAAARuuKFEAgS-x4qJse5uBA_QCA7v\"></re-captcha>\n <input hidden type=\"text\" [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\">\n </div>\n <span class=\"error\" *ngIf=\"watchValid && !captchaValid\" style=\"margin-top: 0;\">\n Debe resolver la captcha para continuar\n </span>\n </div>\n </div>\n <div *ngSwitchCase=\"7\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left; margin-bottom: 0 ;\">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input placeholder=\"dd/mm/aaaa\" style=\"margin-top: -0.4rem !important;\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [name]=\"dataForm.formQuestions[index].question.value\" type=\"date\" min=\"{{minDate}}\"\n max=\"{{maxDate}}\" [maxlength]=\"10\" (paste)=\"false\"\n id=\"{{dataForm.formQuestions[index].question.value}}\"\n [class]=\"dataClassCss.txtCalendar\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n (keydown)=\"cancellKeypress()\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\">\n\n <!-- for replace by id todo-->\n <button class=\"btn\" id=\"{{dataForm.formQuestions[index].question.value}}\" type=\"button\"\n style=\"width: 46px;\n top: 12px;\n color: white;\n right: 15px;\n position: absolute;\n background: #D25D42;\n pointer-events: none;\">\n <i class=\"fa fa-calendar\"></i>\n </button>\n\n </div>\n </div>\n <div *ngSwitchCase=\"8\">\n <div [class]=\"dataClassCss.cl12\" style=\"text-align: left; margin-bottom: 10px;\">\n <input [style]=\"'width: 4%; height: auto; display: inline;'\" type=\"checkbox\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n [class]=\"dataClassCss.formcontrol\"\n (change)=\"checkTermsAndConditions(dataForm.formQuestions[index].question.registred)\">\n <!-- <a href=\"{{urlPdf}}\" target=\"_blank\" style=\"text-decoration: underline;\"\n id=\"txtPoliticas\" (click)=\"tycSelection()\">\n {{dataForm.formQuestions[index].question.label}}\n </a> -->\n <a target=\"_blank\" style=\"text-decoration: underline;color:blue;cursor: pointer;\"\n id=\"txtPoliticas\" (click)=\"tycSelection($event)\">\n {{dataForm.formQuestions[index].question.label}}\n </a>\n </div>\n </div>\n <div *ngSwitchCase=\"9\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left; \">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (keypress)=\"validOnlyText($event)\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n style=\"margin-top: -1rem !important;\"/>\n </div>\n </div>\n <div *ngSwitchCase=\"10\">\n <div [class]=\"dataClassCss.cl12\" style=\"text-align: left; margin-bottom: 10px;\">\n <input [style]=\"'width: 4%; height: auto; display: inline;'\" type=\"checkbox\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n [class]=\"dataClassCss.formcontrol\">\n <a target=\"_blank\" style=\"text-decoration: underline;color:blue;cursor: pointer;\"\n id=\"check{{dataForm.formQuestions[index].question.id}}\"\n (click)=\"openLabelUrl($event,dataForm.formQuestions[index].question)\">\n {{dataForm.formQuestions[index].question.label}}\n </a>\n </div>\n </div>\n <div *ngSwitchCase=\"11\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left; \">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (keypress)=\"validateNotSpace($event)\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n style=\"margin-top: -1rem !important;\"/>\n </div>\n </div>\n <div *ngSwitchDefault>Tipo de control no detectado</div>\n <div style=\"margin-left: 15px;\"\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\n <span class=\"error\" [id]=\"'rq'+dataForm.formQuestions[index].question.value\"\n *ngIf=\"validRequired(formDynamic,dataForm.formQuestions[index].question) && watchValid\">\n Este campo es obligatorio</span>\n <span class=\"error\" [id]=\"'ml'+dataForm.formQuestions[index].question.value\" hidden>\n Debe ser m\u00EDnimo de\n {{ dataForm.formQuestions[index].question.minLength }} caracteres</span>\n <span class=\"error\" [id]=\"'mxl'+dataForm.formQuestions[index].question.value\" hidden>\n Debe ser maximo de\n {{ dataForm.formQuestions[index].question.maxLength }} caracteres</span>\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index].question.value\"\n hidden></span>\n <span class=\"error\" [id]=\"dataForm.formQuestions[index].question.id\" hidden></span>\n </div>\n </div>\n </ng-template>\n </div>\n <div class=\"mt-3 text-center\">\n <button type=\"button\" [class]=\"dataClassCss.btn\" (click)=\"onSubmit()\" [disabled]=\"!formDynamic.valid\"\n id=\"btnIng\">Ingresar\n </button>\n </div>\n </form>\n </div>\n</div>\n",
719
- providers: [
720
- { provide: NgbDateAdapter, useClass: CustomAdapter },
721
- { provide: NgbDateParserFormatter, useClass: CustomDateParserFormatter },
722
- { provide: NgbDatepickerI18n, useClass: CustomDatepickerI18n },
723
- I18n
724
- ],
725
- styles: [".select-checkbox option::before{content:\"\\2610\";width:1.3em;text-align:center;display:inline-block}.select-checkbox option:checked::before{content:\"\\2611\"}"]
726
- })
727
- ], FormAuroraComponent);
728
- return FormAuroraComponent;
729
- }());
730
-
731
- var FormAuroraModule = /** @class */ (function () {
732
- function FormAuroraModule() {
733
- }
734
- FormAuroraModule = __decorate([
735
- NgModule({
736
- declarations: [FormAuroraComponent],
737
- imports: [
738
- CommonModule,
739
- FormsModule,
740
- RecaptchaModule,
741
- RecaptchaFormsModule
742
- ],
743
- exports: [FormAuroraComponent]
744
- })
745
- ], FormAuroraModule);
746
- return FormAuroraModule;
747
- }());
748
-
749
- /*
750
- * Public API Surface of form-aurora
751
- */
752
-
753
- /**
754
- * Generated bundle index. Do not edit.
755
- */
756
-
757
- export { CustomAdapter, CustomDateParserFormatter, CustomDatepickerI18n, FormAuroraComponent, FormAuroraModule, I18n };
758
- //# sourceMappingURL=form-aurora-stefanini.js.map