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