form-aurora-stefanini 0.1.3 → 0.1.6
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/bundles/form-aurora-stefanini.umd.js +1225 -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/Components/from-aurora/form-aurora.component.js +707 -0
- package/esm2015/lib/Models/company-parameters.js +7 -0
- package/esm2015/lib/Models/company.js +1 -0
- package/esm2015/lib/Models/fill.js +3 -0
- package/esm2015/lib/Models/state.js +1 -0
- package/esm2015/lib/Models/step.js +1 -0
- package/esm2015/lib/Models/stepMethod.js +3 -0
- package/esm2015/lib/form-aurora.module.js +22 -0
- package/esm2015/lib/services/TemplateService.js +85 -0
- package/esm2015/lib/services/data.service.js +82 -0
- package/esm2015/lib/utils/regex.js +52 -0
- package/esm2015/public-api.js +10 -0
- package/esm5/form-aurora-stefanini.js +5 -0
- package/esm5/lib/Components/from-aurora/form-aurora.component.js +751 -0
- package/esm5/lib/Models/company-parameters.js +19 -0
- package/esm5/lib/Models/company.js +1 -0
- package/esm5/lib/Models/fill.js +7 -0
- package/esm5/lib/Models/state.js +1 -0
- package/esm5/lib/Models/step.js +1 -0
- package/esm5/lib/Models/stepMethod.js +7 -0
- package/esm5/lib/form-aurora.module.js +25 -0
- package/esm5/lib/services/TemplateService.js +97 -0
- package/esm5/lib/services/data.service.js +85 -0
- package/esm5/lib/utils/regex.js +52 -0
- package/esm5/public-api.js +10 -0
- package/fesm2015/form-aurora-stefanini.js +939 -0
- package/fesm2015/form-aurora-stefanini.js.map +1 -0
- package/fesm5/form-aurora-stefanini.js +1004 -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/Components/from-aurora/form-aurora.component.d.ts +118 -0
- package/lib/Models/company-parameters.d.ts +14 -0
- package/lib/Models/company.d.ts +22 -0
- package/lib/Models/fill.d.ts +6 -0
- package/lib/Models/state.d.ts +5 -0
- package/lib/Models/step.d.ts +14 -0
- package/lib/Models/stepMethod.d.ts +8 -0
- package/lib/form-aurora.module.d.ts +2 -0
- package/lib/services/TemplateService.d.ts +8 -0
- package/lib/services/data.service.d.ts +35 -0
- package/lib/utils/regex.d.ts +51 -0
- package/package.json +28 -17
- package/{src/public-api.ts → public-api.d.ts} +1 -4
- package/karma.conf.js +0 -32
- package/ng-package.json +0 -7
- package/src/lib/Components/from-aurora/form-aurora.component.css +0 -117
- package/src/lib/Components/from-aurora/form-aurora.component.html +0 -343
- package/src/lib/Components/from-aurora/form-aurora.component.spec.ts +0 -25
- package/src/lib/Components/from-aurora/form-aurora.component.ts +0 -725
- package/src/lib/Models/company-parameters.ts +0 -16
- package/src/lib/Models/company.ts +0 -25
- package/src/lib/Models/fill.ts +0 -6
- package/src/lib/Models/state.ts +0 -5
- package/src/lib/Models/step.ts +0 -15
- package/src/lib/Models/stepMethod.ts +0 -9
- package/src/lib/form-aurora.module.ts +0 -18
- package/src/lib/services/TemplateService.ts +0 -84
- package/src/lib/services/data.service.ts +0 -83
- package/src/lib/utils/regex.ts +0 -51
- package/src/test.ts +0 -21
- package/tsconfig.lib.json +0 -26
- package/tsconfig.spec.json +0 -17
- package/tslint.json +0 -17
@@ -0,0 +1,939 @@
|
|
1
|
+
import { __decorate } from 'tslib';
|
2
|
+
import { ɵɵdefineInjectable, Injectable, EventEmitter, Input, ViewChild, Output, Component, ɵɵinject, NgModule } from '@angular/core';
|
3
|
+
import { FormGroup, FormControl, Validators, 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 regexType = {
|
11
|
+
default: {
|
12
|
+
exp: '^[a-zA-Z0-9ñÑáéíóúüÁÉÍÓÚÜ,.\\-_\\s]*$',
|
13
|
+
message: 'Formato inválido, no use caracteres especiales'
|
14
|
+
},
|
15
|
+
word: {
|
16
|
+
exp: '^[a-zA-Z0-9ñÑáéíóúüÁÉÍÓÚÜ,.\\-_]*$',
|
17
|
+
message: 'Formato inválido, no use caracteres especiales ni espacios'
|
18
|
+
},
|
19
|
+
name: {
|
20
|
+
exp: '^[a-zA-ZñÑáéíóúüÁÉÍÓÚÜ\\s]*$',
|
21
|
+
message: 'Formato inválido, no use caracteres especiales ni números'
|
22
|
+
},
|
23
|
+
alphanumberWord: {
|
24
|
+
exp: '^[a-zA-Z0-9]*$',
|
25
|
+
message: 'Formato alfanúmerico inválido'
|
26
|
+
},
|
27
|
+
charWord: {
|
28
|
+
exp: '^[a-zA-Z]*$',
|
29
|
+
message: 'Formato de caracteres inválido'
|
30
|
+
},
|
31
|
+
anyWord: {
|
32
|
+
exp: '^\\S*$',
|
33
|
+
message: 'Formato inválido'
|
34
|
+
},
|
35
|
+
percent: {
|
36
|
+
exp: '^100$|^[0-9]{1,2}$|^[0-9]{1,2}\\.[0-9]{1,2}$',
|
37
|
+
message: 'Formato de porcentaje inválido, use el punto decimal (.)'
|
38
|
+
},
|
39
|
+
email: {
|
40
|
+
exp: /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
41
|
+
message: 'Formato de e-mail inválido'
|
42
|
+
},
|
43
|
+
number: {
|
44
|
+
exp: '^[0-9]*$',
|
45
|
+
message: 'Formato de número inválido'
|
46
|
+
},
|
47
|
+
time24: {
|
48
|
+
exp: '^([01]?[0-9]|2[0-3]):[0-5][0-9]$',
|
49
|
+
message: 'Formato de hora militar inválido, use 23:45'
|
50
|
+
},
|
51
|
+
date: {
|
52
|
+
exp: '^[0-9]{1,2}/[0-9]{1,2}/[0-9]{4}$',
|
53
|
+
message: 'Formato de fecha inválido',
|
54
|
+
internal: 'dd/mm/yyyy'
|
55
|
+
},
|
56
|
+
password: {
|
57
|
+
exp: '^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$',
|
58
|
+
message: 'La contraseña debe incluir una longitud mínima de 8 caracteres, una letra mayúscula, una letra minúscula, un número, un carácter especial (@#$%^&+=/.) y no debe tener espacios.'
|
59
|
+
}
|
60
|
+
};
|
61
|
+
|
62
|
+
var CommonDataService_1;
|
63
|
+
let CommonDataService = CommonDataService_1 = class CommonDataService {
|
64
|
+
constructor() { }
|
65
|
+
getData() {
|
66
|
+
if (localStorage.getItem("data") != null) {
|
67
|
+
var data = new Map(JSON.parse(localStorage.getItem("data")));
|
68
|
+
return data;
|
69
|
+
}
|
70
|
+
else {
|
71
|
+
/** Error get cookie */
|
72
|
+
}
|
73
|
+
}
|
74
|
+
setData(data) {
|
75
|
+
localStorage.setItem("data", JSON.stringify(Array.from(data.entries())));
|
76
|
+
}
|
77
|
+
initData() {
|
78
|
+
this.setData(new Map());
|
79
|
+
}
|
80
|
+
putValue(key, value) {
|
81
|
+
var data = this.getData();
|
82
|
+
data = data.set(key, value);
|
83
|
+
this.setData(data);
|
84
|
+
}
|
85
|
+
addValue(keyPrimary, keySecond, value) {
|
86
|
+
var data = this.getValue(keyPrimary);
|
87
|
+
var dataReturn = this.getData();
|
88
|
+
data[keySecond] = value;
|
89
|
+
dataReturn = dataReturn.set(keyPrimary, data);
|
90
|
+
this.setData(dataReturn);
|
91
|
+
}
|
92
|
+
getValue(key) {
|
93
|
+
return !this.getData() || !this.getData().has(key) ? undefined : this.getData().get(key);
|
94
|
+
}
|
95
|
+
hasValue(key) {
|
96
|
+
return this.getData() != undefined ? this.getData().has(key) : null;
|
97
|
+
}
|
98
|
+
clearMap() {
|
99
|
+
if (this.hasValue(CommonDataService_1.COMPANY_KEY)) {
|
100
|
+
let company = this.getValue(CommonDataService_1.COMPANY_KEY);
|
101
|
+
this.initData();
|
102
|
+
this.putValue(CommonDataService_1.COMPANY_KEY, company);
|
103
|
+
}
|
104
|
+
else {
|
105
|
+
this.initData();
|
106
|
+
}
|
107
|
+
}
|
108
|
+
};
|
109
|
+
CommonDataService.COMPANY_KEY = "company";
|
110
|
+
CommonDataService.DOC_NUMBER_KEY = "docNumber";
|
111
|
+
CommonDataService.DOC_TYPE_KEY = "docType";
|
112
|
+
CommonDataService.PHONE_KEY = "phone";
|
113
|
+
CommonDataService.TYPE_ATTENTION_KEY = "typeAttention";
|
114
|
+
CommonDataService.OFFICE_KEY = "office";
|
115
|
+
CommonDataService.TYPE_TURN_KEY = "typeTurn";
|
116
|
+
CommonDataService.SERVICE_KEY = "service";
|
117
|
+
CommonDataService.TURN_KEY = "turn";
|
118
|
+
CommonDataService.PROGRAMED_TURN_KEY = "programedTurn";
|
119
|
+
CommonDataService.REQUEST_CALL = "requestCall";
|
120
|
+
CommonDataService.FORM_DATA = "formdata";
|
121
|
+
CommonDataService.TEMPLATE = "template";
|
122
|
+
CommonDataService.TURN_RESCHEDULE = "turnReschedule";
|
123
|
+
CommonDataService.USER_GENDER = "genderUser";
|
124
|
+
CommonDataService.AUTO_REDIRECT = "autoRedirect";
|
125
|
+
CommonDataService.SCHEDULE_GENERAL = "scheduleGeneral";
|
126
|
+
CommonDataService.AGENDAMIENTO_TTP = "potencialCustomer";
|
127
|
+
CommonDataService.SINGLE_PAGE_ONE = "singlePageOne";
|
128
|
+
CommonDataService.AVAILABLE_SCHEDULE_GRAL = "availableScheduleGral";
|
129
|
+
CommonDataService.PROFILE = "profile";
|
130
|
+
CommonDataService.PAGE_NEXT = "pageNext";
|
131
|
+
CommonDataService.STEPS = "steps";
|
132
|
+
CommonDataService.TYPE_TURN_ID = "typeTurnId";
|
133
|
+
CommonDataService.ngInjectableDef = ɵɵdefineInjectable({ factory: function CommonDataService_Factory() { return new CommonDataService(); }, token: CommonDataService, providedIn: "root" });
|
134
|
+
CommonDataService = CommonDataService_1 = __decorate([
|
135
|
+
Injectable({
|
136
|
+
providedIn: "root",
|
137
|
+
})
|
138
|
+
], CommonDataService);
|
139
|
+
|
140
|
+
const moment = moment_;
|
141
|
+
// import { regexType } from "@app/_shared/_util/regex";
|
142
|
+
// import { ExternalService } from '@app/_shared/_services/external.service';
|
143
|
+
// import { AuroraService } from '@app/_shared/_services/aurora.service';
|
144
|
+
/**
|
145
|
+
* This Service handles how the date is represented in scripts i.e. ngModel.
|
146
|
+
*/
|
147
|
+
let CustomAdapter = class CustomAdapter extends NgbDateAdapter {
|
148
|
+
// import { regexType } from "@app/_shared/_util/regex";
|
149
|
+
// import { ExternalService } from '@app/_shared/_services/external.service';
|
150
|
+
// import { AuroraService } from '@app/_shared/_services/aurora.service';
|
151
|
+
/**
|
152
|
+
* This Service handles how the date is represented in scripts i.e. ngModel.
|
153
|
+
*/
|
154
|
+
constructor() {
|
155
|
+
super(...arguments);
|
156
|
+
this.DELIMITER = '/';
|
157
|
+
}
|
158
|
+
fromModel(value) {
|
159
|
+
if (value) {
|
160
|
+
const date = value.split(this.DELIMITER);
|
161
|
+
return {
|
162
|
+
day: parseInt(date[0], 10),
|
163
|
+
month: parseInt(date[1], 10),
|
164
|
+
year: parseInt(date[2], 10)
|
165
|
+
};
|
166
|
+
}
|
167
|
+
return null;
|
168
|
+
}
|
169
|
+
toModel(date) {
|
170
|
+
//return date ? date.day + this.DELIMITER + date.month + this.DELIMITER + date.year : null;
|
171
|
+
return date ? (date.day < 10 ? 0 + date.day : date.day) + this.DELIMITER + (date.month < 10 ? 0 + date.month : date.month) + this.DELIMITER + date.year : '';
|
172
|
+
}
|
173
|
+
};
|
174
|
+
CustomAdapter = __decorate([
|
175
|
+
Injectable()
|
176
|
+
], CustomAdapter);
|
177
|
+
/**
|
178
|
+
* This Service handles how the date is rendered and parsed from keyboard i.e. in the bound input field.
|
179
|
+
*/
|
180
|
+
let CustomDateParserFormatter = class CustomDateParserFormatter extends NgbDateParserFormatter {
|
181
|
+
/**
|
182
|
+
* This Service handles how the date is rendered and parsed from keyboard i.e. in the bound input field.
|
183
|
+
*/
|
184
|
+
constructor() {
|
185
|
+
super(...arguments);
|
186
|
+
this.DELIMITER = '/';
|
187
|
+
}
|
188
|
+
parse(value) {
|
189
|
+
if (value) {
|
190
|
+
const date = value.split(this.DELIMITER);
|
191
|
+
return {
|
192
|
+
day: parseInt(date[0], 10),
|
193
|
+
month: parseInt(date[1], 10),
|
194
|
+
year: parseInt(date[2], 10)
|
195
|
+
};
|
196
|
+
}
|
197
|
+
return null;
|
198
|
+
}
|
199
|
+
format(date) {
|
200
|
+
return date ? (date.day < 10 ? '0' + date.day : date.day) + this.DELIMITER + (date.month < 10 ? '0' + date.month : date.month) + this.DELIMITER + date.year : '';
|
201
|
+
}
|
202
|
+
};
|
203
|
+
CustomDateParserFormatter = __decorate([
|
204
|
+
Injectable()
|
205
|
+
], CustomDateParserFormatter);
|
206
|
+
const I18N_VALUES = {
|
207
|
+
'es': {
|
208
|
+
weekdays: ['Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa', 'Do'],
|
209
|
+
months: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
|
210
|
+
weekLabel: 'sem'
|
211
|
+
}
|
212
|
+
// other languages you would support
|
213
|
+
};
|
214
|
+
let I18n = class I18n {
|
215
|
+
constructor() {
|
216
|
+
this.language = 'es';
|
217
|
+
}
|
218
|
+
};
|
219
|
+
I18n = __decorate([
|
220
|
+
Injectable()
|
221
|
+
], I18n);
|
222
|
+
// Define custom service providing the months and weekdays translations
|
223
|
+
let CustomDatepickerI18n = class CustomDatepickerI18n extends NgbDatepickerI18n {
|
224
|
+
constructor(_i18n) {
|
225
|
+
super();
|
226
|
+
this._i18n = _i18n;
|
227
|
+
}
|
228
|
+
getWeekdayLabel(weekday) {
|
229
|
+
return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
|
230
|
+
}
|
231
|
+
getWeekLabel() {
|
232
|
+
return I18N_VALUES[this._i18n.language].weekLabel;
|
233
|
+
}
|
234
|
+
getMonthShortName(month) {
|
235
|
+
return I18N_VALUES[this._i18n.language].months[month - 1];
|
236
|
+
}
|
237
|
+
getMonthFullName(month) {
|
238
|
+
return this.getMonthShortName(month);
|
239
|
+
}
|
240
|
+
getDayAriaLabel(date) {
|
241
|
+
return `${date.day}-${date.month}-${date.year}`;
|
242
|
+
}
|
243
|
+
getWeekdayShortName(weekday) {
|
244
|
+
return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
|
245
|
+
}
|
246
|
+
;
|
247
|
+
};
|
248
|
+
CustomDatepickerI18n.ctorParameters = () => [
|
249
|
+
{ type: I18n }
|
250
|
+
];
|
251
|
+
CustomDatepickerI18n = __decorate([
|
252
|
+
Injectable()
|
253
|
+
], CustomDatepickerI18n);
|
254
|
+
let FormAuroraComponent = class FormAuroraComponent {
|
255
|
+
constructor(data, http) {
|
256
|
+
this.data = data;
|
257
|
+
this.http = http;
|
258
|
+
this.response = new EventEmitter();
|
259
|
+
this.summit = new EventEmitter();
|
260
|
+
this.viewAuthData = new EventEmitter();
|
261
|
+
this.tipodocNumDoc = false;
|
262
|
+
this.onSubmitEvent = false;
|
263
|
+
this.countSubmit = 0;
|
264
|
+
this.watchValid = false;
|
265
|
+
this.watchRequired = false;
|
266
|
+
this.captchaValid = false;
|
267
|
+
this.displayMonths = 2;
|
268
|
+
this.navigation = 'select';
|
269
|
+
this.showWeekNumbers = false;
|
270
|
+
this.outsideDays = 'visible';
|
271
|
+
this.respServiceSegmentation = null;
|
272
|
+
this.base64CheckAuthData = undefined;
|
273
|
+
//emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$";
|
274
|
+
this.today = moment(new Date());
|
275
|
+
this.maxYear = this.today.year();
|
276
|
+
this.minYear = this.today.year() - 82;
|
277
|
+
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()};
|
278
|
+
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()};
|
279
|
+
//Revisar variables
|
280
|
+
this.recharge = false;
|
281
|
+
this.indicativo = "57";
|
282
|
+
this.defaultDocType = "Cédula de ciudadanía";
|
283
|
+
this.patternNotValidDcto = false;
|
284
|
+
this.patternNotValidCel = false;
|
285
|
+
this.range = new FormGroup({
|
286
|
+
start: new FormControl(),
|
287
|
+
end: new FormControl(),
|
288
|
+
});
|
289
|
+
}
|
290
|
+
ngOnInit() {
|
291
|
+
this.minDate = new Date(this.minDate).toISOString().split('T')[0];
|
292
|
+
setTimeout(() => {
|
293
|
+
this.startComponent();
|
294
|
+
}, 2000);
|
295
|
+
}
|
296
|
+
startComponent() {
|
297
|
+
//ordena los campos
|
298
|
+
if (this.dataForm != null && this.dataForm.formQuestions != undefined) {
|
299
|
+
//Same row fields
|
300
|
+
this.tipodocNumDoc = (this.dataForm.formQuestions.some(question => question.question.value === "tipoDoc") && this.dataForm.formQuestions.some(question => question.question.value === "numeroDoc")) ? true : false;
|
301
|
+
this.dataForm.formQuestions = this.dataForm.formQuestions.sort(function (a, b) {
|
302
|
+
return a.order - b.order;
|
303
|
+
});
|
304
|
+
let existcaptcha = this.dataForm.formQuestions.filter((item) => item.question.questionType.id == 6);
|
305
|
+
if (existcaptcha.length == 0) {
|
306
|
+
this.captchaValid = true;
|
307
|
+
}
|
308
|
+
for (const item of this.dataForm.formQuestions) {
|
309
|
+
if (item.question.maxlength == null || item.question.maxlength == undefined || item.question.maxlength == 0) {
|
310
|
+
item.question.maxlength = 524288; //defaultvalue
|
311
|
+
}
|
312
|
+
if (item.question.minLength == null || item.question.minLength == undefined) {
|
313
|
+
item.question.minLength = 0;
|
314
|
+
}
|
315
|
+
this.dataReloadForm.forEach(element => {
|
316
|
+
this.filldata = element;
|
317
|
+
if ((item.question.questionType.id === 2 || item.question.questionType.id === 1 ||
|
318
|
+
item.question.questionType.id === 3) && (this.filldata.data !== null &&
|
319
|
+
this.filldata.data !== undefined) && item.question.id === this.filldata.id) {
|
320
|
+
item.question.registred = this.filldata.data;
|
321
|
+
}
|
322
|
+
});
|
323
|
+
if (item.question.registred == null || item.question.minLength == undefined) {
|
324
|
+
item.question.registred = '';
|
325
|
+
}
|
326
|
+
}
|
327
|
+
}
|
328
|
+
}
|
329
|
+
resolvedCaptcha(captchaResponse) {
|
330
|
+
this.captchaValid = true;
|
331
|
+
if (!this.formDynamic.form.value.captcha) {
|
332
|
+
this.formDynamic.controls.captcha.setValue(captchaResponse);
|
333
|
+
this.formDynamic.form.value.captcha = captchaResponse;
|
334
|
+
document.getElementById("btnIng").style.opacity = !this.formDynamic.valid ? "0.65" : "1";
|
335
|
+
}
|
336
|
+
}
|
337
|
+
//Forms
|
338
|
+
//Metodo para evitar el render de los items del for
|
339
|
+
trackByIndex(index, obj) {
|
340
|
+
return index;
|
341
|
+
}
|
342
|
+
onChangeValidPatter(event, question) {
|
343
|
+
if (question.pattern != undefined) {
|
344
|
+
let valid = true;
|
345
|
+
let keyvalid = [8, 32, 37, 38, 39, 40, 46, 9];
|
346
|
+
//diferente de Backpsace
|
347
|
+
//se deja catch por error no controlable en otro tiempo de ejecucion
|
348
|
+
try {
|
349
|
+
if (!keyvalid.includes(event.keyCode)) {
|
350
|
+
const regex = new RegExp(question.pattern);
|
351
|
+
valid = regex.test(event.key);
|
352
|
+
}
|
353
|
+
}
|
354
|
+
catch (error) { }
|
355
|
+
return valid;
|
356
|
+
}
|
357
|
+
if (question.questionType !== undefined) {
|
358
|
+
if (question.questionType.description === 'Number') {
|
359
|
+
if (question.value === 'numeroDoc') {
|
360
|
+
this.validateNumeroDocumento(this.formDynamic.controls["numeroDoc"].value.toString());
|
361
|
+
}
|
362
|
+
else if (question.value === 'celular') {
|
363
|
+
this.validateCelular(this.formDynamic.controls["celular"].value.toString());
|
364
|
+
}
|
365
|
+
}
|
366
|
+
}
|
367
|
+
document.getElementById("char" + question.value).setAttribute("hidden", "true");
|
368
|
+
//if temporal mientras se migran todos los tipos de campos al foreach
|
369
|
+
if (question.questionType.id != 11 && question.questionType.id != 7) {
|
370
|
+
if (this.validMinLength(this.formDynamic, question)) {
|
371
|
+
document.getElementById(question.value).style.borderColor = "#FF0000";
|
372
|
+
document.getElementById("ml" + question.value).removeAttribute("hidden");
|
373
|
+
}
|
374
|
+
else {
|
375
|
+
document.getElementById(question.value).style.borderColor = "#E4E4E4";
|
376
|
+
document.getElementById("ml" + question.value).setAttribute("hidden", "true");
|
377
|
+
}
|
378
|
+
if (this.validMaxLength(this.formDynamic, question)) {
|
379
|
+
document.getElementById(question.value).style.borderColor = "#FF0000";
|
380
|
+
document.getElementById("mxl" + question.value).removeAttribute("hidden");
|
381
|
+
}
|
382
|
+
else {
|
383
|
+
document.getElementById(question.value).style.borderColor = "#E4E4E4";
|
384
|
+
document.getElementById("mxl" + question.value).setAttribute("hidden", "true");
|
385
|
+
}
|
386
|
+
}
|
387
|
+
this.dataForm.formQuestions.forEach(formQuestion => {
|
388
|
+
switch (formQuestion.question.questionType.id) {
|
389
|
+
//se valida campo de tipo calendario
|
390
|
+
case 7:
|
391
|
+
if (question.questionType.id == 7)
|
392
|
+
this.calendarRulesValidate(formQuestion);
|
393
|
+
break;
|
394
|
+
//se valida campo de tipo email
|
395
|
+
case 11:
|
396
|
+
if (question.questionType.id == 11)
|
397
|
+
this.emailRulesValidate(formQuestion);
|
398
|
+
break;
|
399
|
+
}
|
400
|
+
});
|
401
|
+
document.getElementById("btnIng").style.opacity = !this.formDynamic.valid ? "0.65" : "1";
|
402
|
+
}
|
403
|
+
validOnlyText(event) {
|
404
|
+
let regex = /^[a-zA-Z\u00C0-\u017F]+$/g;
|
405
|
+
if (event.charCode == 32) {
|
406
|
+
return true;
|
407
|
+
}
|
408
|
+
let valid = regex.test(event.key);
|
409
|
+
return valid;
|
410
|
+
}
|
411
|
+
validDate(event) {
|
412
|
+
/*let pattern = /(?:0[1-9]|[12][0-9]|3[01])\/(?:0[1-9]|1[0-2])\/(?:19|20)[0-9]{2}/;
|
413
|
+
const regex = new RegExp(pattern);
|
414
|
+
valid = regex.test(event.key);
|
415
|
+
*/
|
416
|
+
const matches = String(event.key).match(regexType.date.exp);
|
417
|
+
let valid = true;
|
418
|
+
if (matches === null)
|
419
|
+
valid = false;
|
420
|
+
// alert(valid);
|
421
|
+
return valid;
|
422
|
+
}
|
423
|
+
onChangeValidDate(event) {
|
424
|
+
//let pattern = /(?:0[1-9]|1[0-2])\/(?:0[1-9]|[12][0-9]|3[01])\/(?:19|20)[0-9]{2}/;
|
425
|
+
let dateN = /[0-9]|\//;
|
426
|
+
let valid = true;
|
427
|
+
const regex = new RegExp(dateN);
|
428
|
+
valid = regex.test(event.key);
|
429
|
+
return valid;
|
430
|
+
}
|
431
|
+
rediretoutside(event, question) {
|
432
|
+
//se deja catch por error no controlable en otro tiempo de ejecucion
|
433
|
+
try {
|
434
|
+
event.preventDefault();
|
435
|
+
window.open(question.value, "_blank");
|
436
|
+
}
|
437
|
+
catch (error) { }
|
438
|
+
}
|
439
|
+
/**
|
440
|
+
* Dispatch submit event for validations exists
|
441
|
+
* @param change
|
442
|
+
*/
|
443
|
+
ngOnChanges(change) {
|
444
|
+
this.countSubmit++;
|
445
|
+
}
|
446
|
+
//onSubmit(form: NgForm) {
|
447
|
+
onSubmit() {
|
448
|
+
let form = this.formDynamic;
|
449
|
+
this.watchValid = true;
|
450
|
+
this.watchRequired = true;
|
451
|
+
if (form.valid) {
|
452
|
+
if (!this.validRulesFields(form.controls["numeroDoc"].value.toString(), form.controls["celular"].value.toString(), form.controls["email"].value))
|
453
|
+
return false;
|
454
|
+
}
|
455
|
+
if (this.validMinlenghtAllQuestions(form.value) && this.validMaxLengthAllQuestions(form.value) && form.valid) {
|
456
|
+
if (this.dataForm.urlSend != "" && this.captchaValid) {
|
457
|
+
this.http.post(this.dataForm.urlSend, form.value).subscribe((resp) => this.response.emit(resp));
|
458
|
+
}
|
459
|
+
else if (form.valid && this.captchaValid) {
|
460
|
+
this.summit.emit(form.value);
|
461
|
+
}
|
462
|
+
}
|
463
|
+
}
|
464
|
+
findParamBoolean(params, idParam) {
|
465
|
+
let showDescriptionParam = params.find((x) => x.id == idParam);
|
466
|
+
return showDescriptionParam != null && showDescriptionParam.value == "true";
|
467
|
+
}
|
468
|
+
validRulesFields(numeroDoc, numeroCel, email) {
|
469
|
+
// Validaciones para celular en caso de indicativo en Colombia
|
470
|
+
let cel = document.getElementById("charcelular");
|
471
|
+
let doc = document.getElementById("charnumeroDoc");
|
472
|
+
let valOk = true;
|
473
|
+
if (this.indicativo == "+57" || this.indicativo == "57") {
|
474
|
+
let stringOrdenado = this.orderString(numeroDoc);
|
475
|
+
if (this.nameCompany.toUpperCase() !== 'CLARO') { //claro acepta nro consecutivos
|
476
|
+
if (numeroDoc == stringOrdenado) {
|
477
|
+
doc.style.borderColor = "#FF0000";
|
478
|
+
doc.removeAttribute("hidden");
|
479
|
+
doc.textContent = "El numero documento No debe contener caracteres consecutivos";
|
480
|
+
valOk = false;
|
481
|
+
//this.msgErrorCampo = "El numero documento No debe contener caracteres consecutivos";
|
482
|
+
//return false;
|
483
|
+
}
|
484
|
+
}
|
485
|
+
if (numeroCel.substring(0, 1) != "3") {
|
486
|
+
cel.style.borderColor = "#FF0000";
|
487
|
+
cel.removeAttribute("hidden");
|
488
|
+
cel.textContent = "El primer carácter del celular debe ser 3";
|
489
|
+
valOk = false;
|
490
|
+
//this.msgErrorCampo = "El primer carácter del celular debe ser 3";
|
491
|
+
//return false;
|
492
|
+
}
|
493
|
+
/*
|
494
|
+
if (parseInt(numeroCel.substring(0, 3)) > 350) {
|
495
|
+
cel.style.borderColor = "#FF0000";
|
496
|
+
cel.removeAttribute("hidden");
|
497
|
+
cel.textContent = "El prefijo del celular no debe ser mayor a 350";
|
498
|
+
valOk = false;
|
499
|
+
//this.msgErrorCampo = "El prefijo del celular no debe ser mayor a 350";
|
500
|
+
//return false;
|
501
|
+
}
|
502
|
+
*/
|
503
|
+
//En caso de que el número se repita, ejemplo 33333333
|
504
|
+
let listnumber = numeroDoc.substring(0, 1);
|
505
|
+
for (let index = 1; index < numeroDoc.length; index++) {
|
506
|
+
listnumber = listnumber + numeroDoc.substring(0, 1);
|
507
|
+
}
|
508
|
+
if (numeroDoc == listnumber) {
|
509
|
+
doc.style.borderColor = "#FF0000";
|
510
|
+
doc.removeAttribute("hidden");
|
511
|
+
doc.textContent = "Caracteres numéricos no se pueden repetirse de manera continua ";
|
512
|
+
valOk = false;
|
513
|
+
//this.msgErrorCampo = "Caracteres numéricos no se pueden repetirse de manera continua ";
|
514
|
+
//return false;
|
515
|
+
}
|
516
|
+
if (!this.validateNumeroDocumento(numeroDoc)) {
|
517
|
+
return false;
|
518
|
+
}
|
519
|
+
if (!this.validateCelular(numeroCel)) {
|
520
|
+
return false;
|
521
|
+
}
|
522
|
+
// En caso de que el número se repita, ejemplo 33333333
|
523
|
+
let arrayPhoneRepeat = Array.from(String(numeroCel), Number);
|
524
|
+
let arrayPhoneOutRepeat = [...new Set(arrayPhoneRepeat)];
|
525
|
+
if (arrayPhoneOutRepeat.length == 1) {
|
526
|
+
cel.style.borderColor = "#FF0000";
|
527
|
+
cel.removeAttribute("hidden");
|
528
|
+
cel.textContent = "El número que ingresa no es valido";
|
529
|
+
valOk = false;
|
530
|
+
//this.msgErrorCampo = "El número que ingresa no es valido";
|
531
|
+
//return false;
|
532
|
+
}
|
533
|
+
}
|
534
|
+
else if (this.indicativo == "+593" || this.indicativo == "593") {
|
535
|
+
if (numeroCel.substring(0, 1) != "9") {
|
536
|
+
cel.style.borderColor = "#FF0000";
|
537
|
+
cel.removeAttribute("hidden");
|
538
|
+
cel.textContent = "El primer carácter del celular debe ser 9";
|
539
|
+
valOk = false;
|
540
|
+
//this.msgErrorCampo = "El primer carácter del celular debe ser 9";
|
541
|
+
//return false;
|
542
|
+
}
|
543
|
+
}
|
544
|
+
//se validan los campos por tipo de campo y no por value
|
545
|
+
this.dataForm.formQuestions.forEach(formQuestion => {
|
546
|
+
switch (formQuestion.question.questionType.id) {
|
547
|
+
//se valida campo de tipo email
|
548
|
+
case 11:
|
549
|
+
valOk = this.emailRulesValidate(formQuestion);
|
550
|
+
break;
|
551
|
+
}
|
552
|
+
});
|
553
|
+
return valOk;
|
554
|
+
}
|
555
|
+
orderString(value) {
|
556
|
+
let arrayNumber = [];
|
557
|
+
for (let index = 0; index < value.length; index++) {
|
558
|
+
arrayNumber.push(parseInt(value.substring(index, index + 1)));
|
559
|
+
}
|
560
|
+
//ordena el array
|
561
|
+
arrayNumber.sort(function (a, b) {
|
562
|
+
return a - b;
|
563
|
+
});
|
564
|
+
let numberOrder = "";
|
565
|
+
numberOrder = arrayNumber[0];
|
566
|
+
for (let index = 1; index < arrayNumber.length; index++) {
|
567
|
+
numberOrder = numberOrder + (arrayNumber[0] + index).toString();
|
568
|
+
}
|
569
|
+
return numberOrder;
|
570
|
+
}
|
571
|
+
validMinlenghtAllQuestions(form) {
|
572
|
+
for (const item of this.dataForm.formQuestions) {
|
573
|
+
if (item.question.questionType.id == 1 || item.question.questionType.id == 2) {
|
574
|
+
let minLength = parseInt(item.question.minLength);
|
575
|
+
let formValueLength = parseInt(form[item.question.value].toString().length);
|
576
|
+
if (minLength > 0 && formValueLength != minLength && formValueLength < minLength)
|
577
|
+
return false;
|
578
|
+
}
|
579
|
+
}
|
580
|
+
return true;
|
581
|
+
}
|
582
|
+
validMaxLengthAllQuestions(form) {
|
583
|
+
for (const item of this.dataForm.formQuestions) {
|
584
|
+
if (item.question.questionType.id == 1 || item.question.questionType.id == 2) {
|
585
|
+
let maxLength = parseInt(item.question.maxLength);
|
586
|
+
let formValueLength = parseInt(form[item.question.value].toString().length);
|
587
|
+
if (maxLength > 0 && formValueLength != maxLength && formValueLength > maxLength)
|
588
|
+
return false;
|
589
|
+
}
|
590
|
+
}
|
591
|
+
return true;
|
592
|
+
}
|
593
|
+
validRequired(form, question) {
|
594
|
+
//se deja catch por error no controlable en otro tiempo de ejecucion
|
595
|
+
try {
|
596
|
+
if (question != undefined && question.value != undefined) {
|
597
|
+
if (form.controls[question.value] != undefined &&
|
598
|
+
form.controls[question.value].errors != null &&
|
599
|
+
form.controls[question.value].errors.required) {
|
600
|
+
return true;
|
601
|
+
}
|
602
|
+
}
|
603
|
+
}
|
604
|
+
catch (error) { }
|
605
|
+
return false;
|
606
|
+
}
|
607
|
+
validMinLength(form, question) {
|
608
|
+
//se deja catch por error no controlable en otro tiempo de ejecucion
|
609
|
+
try {
|
610
|
+
if (question != undefined && question.value != undefined) {
|
611
|
+
if (question.minLength > form.controls[question.value].value.toLocaleString().length && question.minLength > 0) {
|
612
|
+
return true;
|
613
|
+
}
|
614
|
+
}
|
615
|
+
}
|
616
|
+
catch (error) { }
|
617
|
+
return false;
|
618
|
+
}
|
619
|
+
validMaxLength(form, question) {
|
620
|
+
//se deja catch por error no controlable en otro tiempo de ejecucion
|
621
|
+
try {
|
622
|
+
if (question != undefined && question.value != undefined) {
|
623
|
+
if (question.maxLength > 0) {
|
624
|
+
if (question.maxLength + 1 <= form.controls[question.value].value.toString().replace(/\./g, '').length) {
|
625
|
+
if (!this.formDynamic.controls[question.value].hasError('errorMaxLength')) {
|
626
|
+
this.formDynamic.controls[question.value].setErrors({ 'errorMaxLength': true });
|
627
|
+
}
|
628
|
+
return true;
|
629
|
+
}
|
630
|
+
}
|
631
|
+
}
|
632
|
+
}
|
633
|
+
catch (error) { }
|
634
|
+
return false;
|
635
|
+
}
|
636
|
+
tycSelection(event) {
|
637
|
+
this.viewAuthData.emit(event);
|
638
|
+
}
|
639
|
+
openLabelUrl(event, question) {
|
640
|
+
event.preventDefault();
|
641
|
+
let tyc = document.getElementById("check" + question.id);
|
642
|
+
tyc.style.color = "#A3AD32";
|
643
|
+
window.open(question.urllabel, "_blank");
|
644
|
+
}
|
645
|
+
cancellKeypress() {
|
646
|
+
return false;
|
647
|
+
}
|
648
|
+
emailRulesValidate(formQuestion) {
|
649
|
+
let valOk = true;
|
650
|
+
try {
|
651
|
+
let hasError = false;
|
652
|
+
document.getElementById(formQuestion.question.id).setAttribute("hidden", "true");
|
653
|
+
let eml = document.getElementById(formQuestion.question.id);
|
654
|
+
let email = formQuestion.question.registred;
|
655
|
+
if (!hasError) {
|
656
|
+
if (formQuestion.question.required && (email == "" || email == undefined || email == null)) {
|
657
|
+
eml.style.borderColor = "#FF0000";
|
658
|
+
eml.textContent = "El correco eléctronico es requerido";
|
659
|
+
eml.removeAttribute("hidden");
|
660
|
+
valOk = false;
|
661
|
+
hasError = true;
|
662
|
+
}
|
663
|
+
}
|
664
|
+
if (!hasError) {
|
665
|
+
if (this.validMinLength(undefined, formQuestion.question)) {
|
666
|
+
eml.style.borderColor = "#FF0000";
|
667
|
+
eml.textContent = "Debe ser mínimo de " + formQuestion.question.minLength + " caracteres";
|
668
|
+
document.getElementById(formQuestion.question.id).removeAttribute("hidden");
|
669
|
+
valOk = false;
|
670
|
+
hasError = true;
|
671
|
+
}
|
672
|
+
}
|
673
|
+
if (!hasError) {
|
674
|
+
if (this.validMaxLength(undefined, formQuestion.question)) {
|
675
|
+
eml.style.borderColor = "#FF0000";
|
676
|
+
eml.textContent = "Debe ser maximo de " + formQuestion.question.maxLength + " caracteres";
|
677
|
+
document.getElementById(formQuestion.question.id).removeAttribute("hidden");
|
678
|
+
valOk = false;
|
679
|
+
hasError = true;
|
680
|
+
}
|
681
|
+
}
|
682
|
+
if (!hasError) {
|
683
|
+
const matches = String(email).match(regexType.email.exp);
|
684
|
+
if (matches == null) {
|
685
|
+
eml.style.borderColor = "#FF0000";
|
686
|
+
eml.textContent = "Tu email es invalido";
|
687
|
+
eml.removeAttribute("hidden");
|
688
|
+
valOk = false;
|
689
|
+
hasError = true;
|
690
|
+
}
|
691
|
+
}
|
692
|
+
}
|
693
|
+
catch (error) {
|
694
|
+
}
|
695
|
+
return valOk;
|
696
|
+
}
|
697
|
+
calendarRulesValidate(formQuestion) {
|
698
|
+
let hasError = false;
|
699
|
+
try {
|
700
|
+
document.getElementById(formQuestion.question.id).setAttribute("hidden", "true");
|
701
|
+
let ecalendar = document.getElementById(formQuestion.question.id);
|
702
|
+
//se valida que no sea null si es requerido
|
703
|
+
let date = formQuestion.question.registred;
|
704
|
+
if (formQuestion.question.required && (date == "" || date == undefined || date == null)) {
|
705
|
+
ecalendar.style.borderColor = "#FF0000";
|
706
|
+
ecalendar.textContent = "La fecha es requerida";
|
707
|
+
ecalendar.removeAttribute("hidden");
|
708
|
+
}
|
709
|
+
}
|
710
|
+
catch (error) {
|
711
|
+
}
|
712
|
+
}
|
713
|
+
validateNotSpace(event) {
|
714
|
+
if (event.charCode == 32) {
|
715
|
+
return false;
|
716
|
+
}
|
717
|
+
else {
|
718
|
+
return true;
|
719
|
+
}
|
720
|
+
}
|
721
|
+
validateNumeroDocumento(numeroDoc) {
|
722
|
+
if (!numeroDoc.match("^[0-9]*$")) {
|
723
|
+
this.formDynamic.controls["numeroDoc"].setValidators([Validators.pattern('^[0-9]*$')]);
|
724
|
+
this.formDynamic.controls["numeroDoc"].markAsDirty();
|
725
|
+
this.formDynamic.controls["numeroDoc"].updateValueAndValidity();
|
726
|
+
this.formDynamic.controls["numeroDoc"].markAsTouched();
|
727
|
+
this.patternNotValidDcto = true;
|
728
|
+
return false;
|
729
|
+
}
|
730
|
+
this.patternNotValidDcto = false;
|
731
|
+
return true;
|
732
|
+
}
|
733
|
+
validateCelular(numeroCel) {
|
734
|
+
if (!numeroCel.match("^[0-9]*$")) {
|
735
|
+
this.formDynamic.controls["celular"].setValidators([Validators.pattern('^[0-9]*$')]);
|
736
|
+
this.formDynamic.controls["celular"].markAsDirty();
|
737
|
+
this.formDynamic.controls["celular"].updateValueAndValidity();
|
738
|
+
this.formDynamic.controls["celular"].markAsTouched();
|
739
|
+
this.patternNotValidCel = true;
|
740
|
+
return false;
|
741
|
+
}
|
742
|
+
this.patternNotValidCel = false;
|
743
|
+
return true;
|
744
|
+
}
|
745
|
+
onkeypress(event) {
|
746
|
+
return (event.charCode == 0) ? null : event.charCode >= 48 && event.charCode <= 57;
|
747
|
+
}
|
748
|
+
onChangeStep(step, nextStep, value) {
|
749
|
+
if (nextStep && nextStep.stepOrder != 1) {
|
750
|
+
this.resetField(step);
|
751
|
+
nextStep.viewData = [];
|
752
|
+
nextStep.viewData = nextStep.stepData.filter(x => x.relationalIds.includes(Number(value)));
|
753
|
+
}
|
754
|
+
}
|
755
|
+
resetField(stepIn) {
|
756
|
+
this.steps.forEach(step => {
|
757
|
+
if (step.stepOrder > stepIn.stepOrder) {
|
758
|
+
step.viewData = undefined;
|
759
|
+
step.value = undefined;
|
760
|
+
}
|
761
|
+
});
|
762
|
+
}
|
763
|
+
};
|
764
|
+
FormAuroraComponent.ctorParameters = () => [
|
765
|
+
{ type: CommonDataService },
|
766
|
+
{ type: HttpClient }
|
767
|
+
];
|
768
|
+
__decorate([
|
769
|
+
Input()
|
770
|
+
], FormAuroraComponent.prototype, "dataClassCss", void 0);
|
771
|
+
__decorate([
|
772
|
+
Input()
|
773
|
+
], FormAuroraComponent.prototype, "dataForm", void 0);
|
774
|
+
__decorate([
|
775
|
+
Input()
|
776
|
+
], FormAuroraComponent.prototype, "clickSubmit", void 0);
|
777
|
+
__decorate([
|
778
|
+
Input()
|
779
|
+
], FormAuroraComponent.prototype, "dataReloadForm", void 0);
|
780
|
+
__decorate([
|
781
|
+
Input()
|
782
|
+
], FormAuroraComponent.prototype, "welcomeTitle", void 0);
|
783
|
+
__decorate([
|
784
|
+
Input()
|
785
|
+
], FormAuroraComponent.prototype, "welcomeDescription", void 0);
|
786
|
+
__decorate([
|
787
|
+
Input()
|
788
|
+
], FormAuroraComponent.prototype, "urlPdf", void 0);
|
789
|
+
__decorate([
|
790
|
+
Input()
|
791
|
+
], FormAuroraComponent.prototype, "nameCompany", void 0);
|
792
|
+
__decorate([
|
793
|
+
Input()
|
794
|
+
], FormAuroraComponent.prototype, "schedule", void 0);
|
795
|
+
__decorate([
|
796
|
+
Input()
|
797
|
+
], FormAuroraComponent.prototype, "isSimpleFlow", void 0);
|
798
|
+
__decorate([
|
799
|
+
Input()
|
800
|
+
], FormAuroraComponent.prototype, "company", void 0);
|
801
|
+
__decorate([
|
802
|
+
Input()
|
803
|
+
], FormAuroraComponent.prototype, "steps", void 0);
|
804
|
+
__decorate([
|
805
|
+
ViewChild('formDynamic', { static: true })
|
806
|
+
], FormAuroraComponent.prototype, "formDynamic", void 0);
|
807
|
+
__decorate([
|
808
|
+
Output()
|
809
|
+
], FormAuroraComponent.prototype, "response", void 0);
|
810
|
+
__decorate([
|
811
|
+
Output()
|
812
|
+
], FormAuroraComponent.prototype, "summit", void 0);
|
813
|
+
__decorate([
|
814
|
+
Output()
|
815
|
+
], FormAuroraComponent.prototype, "viewAuthData", void 0);
|
816
|
+
__decorate([
|
817
|
+
ViewChild("modalTurns", { static: false })
|
818
|
+
], FormAuroraComponent.prototype, "myModal", void 0);
|
819
|
+
FormAuroraComponent = __decorate([
|
820
|
+
Component({
|
821
|
+
selector: 'lib-FormAurora',
|
822
|
+
template: "<div class=\"card\">\r\n <span class=\"text-center mt-2 d-none d-sm-block\" *ngIf=\"!isSimpleFlow\">\r\n <img style=\"width: 115px; height:96px;\" [class]=\"dataClassCss.logo\" id=\"logo\">\r\n </span>\r\n <div class=\"text-center mt-2 d-none d-sm-block\" *ngIf=\"isSimpleFlow\" style=\"margin-top: 4%!important;\">\r\n </div>\r\n <div class=\"card-body pt-0\">\r\n <ng-container *ngIf=\"schedule\">\r\n <h4 class=\"card-title text-center mb-0\" [class]=\"dataClassCss.bienvenida2\" style=\"color: #EE7E0E;\">\r\n Horarios de atenci\u00F3n\r\n </h4>\r\n <small class=\"text-center d-block\">{{schedule}}</small>\r\n </ng-container>\r\n <form #formDynamic=\"ngForm\">\r\n <div *ngFor=\"let control of dataForm?.formQuestions; let index = index; trackBy: trackByIndex\">\r\n <div\r\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\">\r\n <div class=\"row\"\r\n *ngIf=\"(index > 0 && (dataForm.formQuestions[index - 1].question.questionType.id == 3 && dataForm.formQuestions[index].question.questionType.id == 2))\">\r\n <div class=\"col-lg-6 col-xs-12\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index - 1].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left;\">\r\n <span class=\"h6 small bg-white text-muted\">{{dataForm.formQuestions[index -\r\n 1].question.label}}</span>\r\n </label>\r\n <div class=\"selectContainer\">\r\n <select [name]=\"dataForm.formQuestions[index - 1].question.value\"\r\n [required]=\"dataForm.formQuestions[index - 1].question.required\"\r\n [class]=\"dataClassCss.formcontrol\"\r\n id=\"{{dataForm.formQuestions[index - 1].question.value}}\"\r\n style=\"margin-top: -1rem !important;\"\r\n [(ngModel)]=\"defaultDocType !== '' ? defaultDocType : dataForm.formQuestions[index - 1].question.registred\">\r\n <option value=\"\" selected disabled hidden>Selecciona</option>\r\n <ng-container\r\n *ngFor=\"let item of dataForm.formQuestions[index - 1].question.questionAnswers\">\r\n <option *ngIf=\"item.answer.state.id == 1\" [value]=\"item.answer.value\">\r\n {{ item.answer.field }}\r\n </option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n </div>\r\n <div style=\"margin-left: 15px;\"\r\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\r\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index-1].question.value\"\r\n hidden></span>\r\n </div>\r\n </div>\r\n <div class=\"col-lg-6 col-xs-12\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\"\r\n class=\"col-sm-12 p-sm-0 px-sm-1\" style=\"display: block; text-align: left;\">\r\n <span\r\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <input type=\"text\" pattern=\"\\d*\" inputmode=\"numeric\"\r\n id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n style=\"margin-top: -1rem !important;\"\r\n [name]=\"dataForm.formQuestions[index].question.value\" placeholder=\"Escribe\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (keyup)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n onkeypress=\"onkeypress($event)\"\r\n onkeyup=\"(this.value=(value.replace(/[.]*/g,'')))\"\r\n maxlength=\"dataForm.formQuestions[index].question.maxLength\"\r\n [minLength]=\"dataForm.formQuestions[index].question.minLength\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n [class]=\"dataClassCss.formcontrol\" />\r\n\r\n </div>\r\n\r\n <div style=\"margin-left: 15px;\"\r\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\r\n <span class=\"error\" [id]=\"'rq'+dataForm.formQuestions[index].question.value\"\r\n *ngIf=\"validRequired(formDynamic,dataForm.formQuestions[index].question) && watchValid\">\r\n Este campo es obligatorio</span>\r\n <span class=\"error\" [id]=\"'ml'+dataForm.formQuestions[index].question.value\" hidden>\r\n Debe ser m\u00EDnimo de\r\n {{ dataForm.formQuestions[index].question.minLength }} caracteres</span>\r\n <span class=\"error\" [id]=\"'mxl'+dataForm.formQuestions[index].question.value\" hidden>\r\n Debe ser maximo de\r\n {{ dataForm.formQuestions[index].question.maxLength }} caracteres</span>\r\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index].question.value\"\r\n hidden></span>\r\n <span *ngIf=\"patternNotValidDcto === true\" class=\"error\">Formato no valido</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-template #switchTemp>\r\n <div [ngSwitch]=\"dataForm.formQuestions[index].question.questionType.id\">\r\n <div *ngSwitchCase=\"1\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left; \">\r\n <span\r\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\r\n [name]=\"dataForm.formQuestions[index].question.value\"\r\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n style=\"margin-top: -1rem !important;\" />\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"2\">\r\n\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left;\">\r\n <span\r\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <input type=\"text\" pattern=\"\\d*\" inputmode=\"numeric\"\r\n id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n style=\"margin-top: -1rem !important;\"\r\n [name]=\"dataForm.formQuestions[index].question.value\" placeholder=\"Escribe\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n onkeypress=\"onkeypress($event)\"\r\n onkeyup=\"(this.value=(value.replace(/[.]*/g,'')))\"\r\n maxlength=\"dataForm.formQuestions[index].question.maxLength\"\r\n [minLength]=\"dataForm.formQuestions[index].question.minLength\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n [class]=\"dataClassCss.formcontrol\" />\r\n <span *ngIf=\"patternNotValidCel === true\" class=\"error\">Formato no valido</span>\r\n </div>\r\n \r\n </div>\r\n <div *ngSwitchCase=\"3\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left;\">\r\n <span\r\n class=\"h6 small bg-white text-muted\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <select [name]=\"dataForm.formQuestions[index].question.value\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [class]=\"dataClassCss.formcontrol\"\r\n id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n style=\"margin-top: -1rem !important;\"\r\n [(ngModel)]=\"defaultDocType !== '' ? defaultDocType : dataForm.formQuestions[index].question.registred\">\r\n <option value=\"\" selected disabled hidden>Selecciona</option>\r\n <ng-container\r\n *ngFor=\"let item of dataForm.formQuestions[index].question.questionAnswers\">\r\n <option *ngIf=\"item.answer.state.id == 1\" [value]=\"item.answer.value\">\r\n {{ item.answer.field }}\r\n </option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"4\">\r\n <select class=\"{{ dataClassCss.formcontrol }} select-checkbox\"\r\n style=\"overflow: hidden; border-style: hidden;\"\r\n [style.height.px]=\"dataForm.formQuestions[index].question.questionAnswers.length * 24\"\r\n [name]=\"dataForm.formQuestions[index].question.value\"\r\n [required]=\"dataForm.formQuestions[index].question.required\" ngModel multiple>\r\n <option \r\n (mousemove)=\"$event.preventDefault()\"\r\n *ngFor=\"let item of dataForm.formQuestions[index].question.questionAnswers\"\r\n [value]=\"item.answer.value\">\r\n {{ item.answer.field }}\r\n </option>\r\n </select>\r\n </div>\r\n <div *ngSwitchCase=\"5\">\r\n <a (click)=\"rediretoutside($event,dataForm.formQuestions[index].question)\" href=\"\">\r\n <span>{{ dataForm.formQuestions[index].question.label }}</span>\r\n </a>\r\n </div>\r\n <div *ngSwitchCase=\"6\">\r\n <div [class]=\"dataClassCss.cl12\" [id]=\"'reCaptcha'\">\r\n <div class=\"cnt-captcha\">\r\n <re-captcha (resolved)=\"resolvedCaptcha($event)\"\r\n siteKey=\"6LfQisEZAAAAAARuuKFEAgS-x4qJse5uBA_QCA7v\"></re-captcha>\r\n <input hidden type=\"text\" [name]=\"dataForm.formQuestions[index].question.value\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\">\r\n </div>\r\n <span class=\"error\" *ngIf=\"watchValid && !captchaValid\" style=\"margin-top: 0;\">\r\n Debe resolver la captcha para continuar\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"7\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left; margin-bottom: 0 ;\">\r\n <span\r\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <input placeholder=\"dd/mm/aaaa\" style=\"margin-top: -0.4rem !important;\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [name]=\"dataForm.formQuestions[index].question.value\" type=\"date\" min=\"{{minDate}}\"\r\n max=\"{{maxDate}}\" [maxlength]=\"10\" (paste)=\"false\"\r\n id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n [class]=\"dataClassCss.txtCalendar\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n (keydown)=\"cancellKeypress()\"\r\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\">\r\n\r\n <button class=\"btn\" id=\"{{dataForm.formQuestions[index].question.value}}\" type=\"button\"\r\n style=\"width: 46px;\r\n top: 12px;\r\n color: white;\r\n right: 15px;\r\n position: absolute;\r\n background: #D25D42;\r\n pointer-events: none;\">\r\n <i class=\"fa fa-calendar\"></i>\r\n </button>\r\n\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"8\">\r\n <div [class]=\"dataClassCss.cl12\" style=\"text-align: left; margin-bottom: 10px;\">\r\n <input style=\"width: 4% !important; height: auto !important; display: inline !important;\" type=\"checkbox\"\r\n [name]=\"dataForm.formQuestions[index].question.value\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n [class]=\"dataClassCss.formcontrol\">\r\n <!-- (change)=\"checkTermsAndConditions(dataForm.formQuestions[index].question.registred)\" -->\r\n \r\n <!-- <a href=\"{{urlPdf}}\" target=\"_blank\" style=\"text-decoration: underline;\"\r\n id=\"txtPoliticas\" (click)=\"tycSelection()\">\r\n {{dataForm.formQuestions[index].question.label}}\r\n </a> -->\r\n <a target=\"_blank\" style=\"text-decoration: underline;color:blue;cursor: pointer;\"\r\n id=\"txtPoliticas\" (click)=\"tycSelection($event)\">\r\n {{dataForm.formQuestions[index].question.label}}\r\n </a>\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"9\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left; \">\r\n <span\r\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\r\n [name]=\"dataForm.formQuestions[index].question.value\"\r\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (keypress)=\"validOnlyText($event)\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n style=\"margin-top: -1rem !important;\" />\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"10\">\r\n <div [class]=\"dataClassCss.cl12\" style=\"text-align: left; margin-bottom: 10px;\">\r\n <input style=\"width: 4% !important; height: auto !important; display: inline !important;\"\r\n type=\"checkbox\" [name]=\"dataForm.formQuestions[index].question.value\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\">\r\n <a target=\"_blank\" style=\"text-decoration: underline;color:blue;cursor: pointer;\"\r\n id=\"check{{dataForm.formQuestions[index].question.id}}\"\r\n (click)=\"openLabelUrl($event,dataForm.formQuestions[index].question)\">\r\n {{dataForm.formQuestions[index].question.label}}\r\n </a>\r\n </div>\r\n </div>\r\n <div *ngSwitchCase=\"11\">\r\n <div [class]=\"dataClassCss.cl12\">\r\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\r\n style=\"display: block; text-align: left; \">\r\n <span\r\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\r\n </label>\r\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\r\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\r\n [required]=\"dataForm.formQuestions[index].question.required\"\r\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\r\n [name]=\"dataForm.formQuestions[index].question.value\"\r\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\r\n (keypress)=\"validateNotSpace($event)\"\r\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\r\n style=\"margin-top: -1rem !important;\" />\r\n </div>\r\n </div>\r\n <div *ngSwitchDefault>Tipo de control no detectado</div>\r\n <div style=\"margin-left: 15px;\"\r\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\r\n <span class=\"error\" [id]=\"'rq'+dataForm.formQuestions[index].question.value\"\r\n *ngIf=\"validRequired(formDynamic,dataForm.formQuestions[index].question) && watchValid\">\r\n Este campo es obligatorio</span>\r\n <span class=\"error\" [id]=\"'ml'+dataForm.formQuestions[index].question.value\" hidden>\r\n Debe ser m\u00EDnimo de\r\n {{ dataForm.formQuestions[index].question.minLength }} caracteres</span>\r\n <span class=\"error\" [id]=\"'mxl'+dataForm.formQuestions[index].question.value\" hidden>\r\n Debe ser maximo de\r\n {{ dataForm.formQuestions[index].question.maxLength }} caracteres</span>\r\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index].question.value\"\r\n hidden></span>\r\n <span class=\"error\" [id]=\"dataForm.formQuestions[index].question.id\" hidden></span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </div>\r\n <section *ngIf=\"isSimpleFlow\">\r\n <div *ngFor=\"let step of steps let index = index; trackBy: trackByIndex\">\r\n <div [class]=\"dataClassCss.cl12\" *ngIf=\"step.viewData\">\r\n <label for=\"{{step.id}}\" class=\"col-sm-12\" style=\"display: block; text-align: left;\">\r\n <span class=\"h6 small bg-white text-muted\">{{step.step}}</span>\r\n </label>\r\n <select [name]=\"step.step\" [required]=\"true\" [class]=\"dataClassCss.formcontrol\" id=\"{{step.step}}\"\r\n style=\"margin-top: -1rem !important;\" [(ngModel)]=\"step.value\"\r\n (ngModelChange)=\"onChangeStep(step,steps[index+1],$event)\">\r\n <option value=\"\" selected disabled hidden>Selecciona</option>\r\n <ng-container *ngFor=\"let subitem of step.viewData\">\r\n <option [value]=\"subitem.id\">\r\n {{ subitem.description }}\r\n </option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n </div>\r\n </section>\r\n <div class=\"mt-3 text-center\">\r\n <button type=\"button\" [class]=\"dataClassCss.btn\" (click)=\"onSubmit()\" [disabled]=\"!formDynamic.valid\"\r\n id=\"btnIng\">Ingresar</button>\r\n </div>\r\n </form>\r\n </div>\r\n</div>\r\n",
|
823
|
+
providers: [
|
824
|
+
{ provide: NgbDateAdapter, useClass: CustomAdapter },
|
825
|
+
{ provide: NgbDateParserFormatter, useClass: CustomDateParserFormatter },
|
826
|
+
{ provide: NgbDatepickerI18n, useClass: CustomDatepickerI18n },
|
827
|
+
I18n
|
828
|
+
],
|
829
|
+
styles: ["form{font-size:12px;overflow-y:scroll;overflow-x:hidden}form input,form select{border:1px solid #e4e4e4;height:40px;margin-bottom:5px}.selectContainer select{-webkit-appearance:none;-moz-appearance:none;appearance:none}.selectContainer::after{content:\"\\025be\";display:table-cell;text-align:center;padding-top:7px;width:30px;height:30px;position:absolute;top:14px;right:20px;pointer-events:none}form .error{color:red;font-size:12px;text-align:left;margin:-15px 0 15px;padding:0;width:90%}.error:after{content:\" \";display:block}.card{width:90%;margin:2% auto;border-radius:12px}@media (max-width:412px){.card{width:100%}.cnt-captcha{transform:scale(.77)}}@media (max-width:575.98px){.card{width:100%}.cnt-captcha{transform:scale(.77)}}@media (max-width:880.98px){.cnt-captcha{transform:scale(.82)}}input[type=date]::-webkit-calendar-picker-indicator{background:0 0;bottom:0;color:transparent;cursor:pointer;height:auto;left:0;position:absolute;right:0;top:0;width:auto}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background:#f5f5f5}::-webkit-scrollbar-thumb{background:#e0e0e0}::-webkit-scrollbar-thumb:hover{background:#bdbdbd}"]
|
830
|
+
})
|
831
|
+
], FormAuroraComponent);
|
832
|
+
|
833
|
+
let CommonTemplateService = class CommonTemplateService {
|
834
|
+
constructor(http) {
|
835
|
+
this.http = http;
|
836
|
+
}
|
837
|
+
getTemplate(idCompany, url) {
|
838
|
+
return this.http.get(`${url}/template/findByCompany/` + idCompany);
|
839
|
+
}
|
840
|
+
reloadStylePage(currentDocument, templateCompany) {
|
841
|
+
let objects = currentDocument.getElementsByClassName("template");
|
842
|
+
// debugger
|
843
|
+
for (let index = 0; index < objects.length; index++) {
|
844
|
+
const item = objects[index];
|
845
|
+
let itemClassName = typeof (item.className) == "object" ? item.className['baseVal'] : item.className;
|
846
|
+
let indexStart = itemClassName.indexOf("template");
|
847
|
+
// let keyString = itemClassName.substring(indexStart, itemClassName.length).split(' ')[1]
|
848
|
+
const keysString = itemClassName.substring(indexStart, itemClassName.length).split(' ').filter(a => a.indexOf('tmp_') !== -1);
|
849
|
+
for (let keyString of keysString) {
|
850
|
+
if (templateCompany[keyString] != undefined) {
|
851
|
+
if (keyString.includes("tmp_type_text_")) {
|
852
|
+
if (keyString.includes('tmp_type_text_6')) {
|
853
|
+
item['style'].setProperty('--' + keyString, templateCompany[keyString].color);
|
854
|
+
}
|
855
|
+
else {
|
856
|
+
item["style"].color = templateCompany[keyString].color;
|
857
|
+
if (itemClassName.includes("ratting-faces-v2")) {
|
858
|
+
item["style"].backgroundColor = templateCompany[keyString].color;
|
859
|
+
item["style"].borderColor = templateCompany[keyString].color;
|
860
|
+
item["style"].color = "white";
|
861
|
+
}
|
862
|
+
}
|
863
|
+
}
|
864
|
+
if (keyString.includes("title1")) {
|
865
|
+
/*item["style"].color = templateCompany[keyString].color*/
|
866
|
+
item["style"].color = "#EE7E0E";
|
867
|
+
}
|
868
|
+
if (keyString.includes("tmp_type_svg_")) {
|
869
|
+
item["style"].fill = templateCompany[keyString].fill;
|
870
|
+
}
|
871
|
+
if (keyString.includes("tmp_type_img_")) {
|
872
|
+
if (item.nodeName == "IMG") {
|
873
|
+
item["src"] = templateCompany[keyString].src;
|
874
|
+
}
|
875
|
+
else {
|
876
|
+
item["style"].background = templateCompany[keyString].background;
|
877
|
+
item["style"].backgroundSize = templateCompany[keyString].backgroundSize;
|
878
|
+
}
|
879
|
+
}
|
880
|
+
if (keyString.includes("tmp_type_head_")) {
|
881
|
+
item["style"].setProperty('--' + keyString, templateCompany[keyString].color);
|
882
|
+
}
|
883
|
+
if (keyString.includes("tmp_type_footer_")) {
|
884
|
+
// debugger
|
885
|
+
item["style"].setProperty('--' + keyString, templateCompany[keyString].color);
|
886
|
+
}
|
887
|
+
if (itemClassName.includes("tmp_type_cnt_")) {
|
888
|
+
indexStart = itemClassName.indexOf("tmp_type_cnt_");
|
889
|
+
keyString = itemClassName.substring(indexStart, itemClassName.length).split(' ')[0];
|
890
|
+
if (!!templateCompany[keyString]) {
|
891
|
+
item["style"].backgroundColor = templateCompany[keyString].backgroundColor;
|
892
|
+
}
|
893
|
+
}
|
894
|
+
if (keyString.includes('tmp_type_font_')) {
|
895
|
+
item['style'].setProperty('font-family', templateCompany[keyString]['font-family'], 'important');
|
896
|
+
}
|
897
|
+
}
|
898
|
+
}
|
899
|
+
}
|
900
|
+
}
|
901
|
+
};
|
902
|
+
CommonTemplateService.ctorParameters = () => [
|
903
|
+
{ type: HttpClient }
|
904
|
+
];
|
905
|
+
CommonTemplateService.ngInjectableDef = ɵɵdefineInjectable({ factory: function CommonTemplateService_Factory() { return new CommonTemplateService(ɵɵinject(HttpClient)); }, token: CommonTemplateService, providedIn: "root" });
|
906
|
+
CommonTemplateService = __decorate([
|
907
|
+
Injectable({
|
908
|
+
providedIn: "root",
|
909
|
+
})
|
910
|
+
], CommonTemplateService);
|
911
|
+
|
912
|
+
class Fill {
|
913
|
+
}
|
914
|
+
|
915
|
+
let FormAuroraModule = class FormAuroraModule {
|
916
|
+
};
|
917
|
+
FormAuroraModule = __decorate([
|
918
|
+
NgModule({
|
919
|
+
declarations: [FormAuroraComponent],
|
920
|
+
imports: [
|
921
|
+
CommonModule,
|
922
|
+
FormsModule,
|
923
|
+
RecaptchaModule,
|
924
|
+
RecaptchaFormsModule
|
925
|
+
],
|
926
|
+
exports: [FormAuroraComponent]
|
927
|
+
})
|
928
|
+
], FormAuroraModule);
|
929
|
+
|
930
|
+
/*
|
931
|
+
* Public API Surface of form-aurora
|
932
|
+
*/
|
933
|
+
|
934
|
+
/**
|
935
|
+
* Generated bundle index. Do not edit.
|
936
|
+
*/
|
937
|
+
|
938
|
+
export { CommonDataService, CommonTemplateService, CustomAdapter, CustomDateParserFormatter, CustomDatepickerI18n, Fill, FormAuroraComponent, FormAuroraModule, I18n, regexType };
|
939
|
+
//# sourceMappingURL=form-aurora-stefanini.js.map
|