form-aurora-stefanini 0.1.10 → 0.1.13

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