form-aurora-stefanini 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/karma.conf.js +32 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +17 -28
  4. package/src/lib/Components/from-aurora/form-aurora.component.css +117 -0
  5. package/src/lib/Components/from-aurora/form-aurora.component.html +343 -0
  6. package/src/lib/Components/from-aurora/form-aurora.component.spec.ts +25 -0
  7. package/src/lib/Components/from-aurora/form-aurora.component.ts +725 -0
  8. package/src/lib/Models/company-parameters.ts +16 -0
  9. package/src/lib/Models/company.ts +25 -0
  10. package/src/lib/Models/fill.ts +6 -0
  11. package/src/lib/Models/state.ts +5 -0
  12. package/src/lib/Models/step.ts +15 -0
  13. package/src/lib/Models/stepMethod.ts +9 -0
  14. package/src/lib/form-aurora.module.ts +18 -0
  15. package/src/lib/services/TemplateService.ts +84 -0
  16. package/src/lib/services/data.service.ts +83 -0
  17. package/src/lib/utils/regex.ts +51 -0
  18. package/src/public-api.ts +9 -0
  19. package/src/test.ts +21 -0
  20. package/tsconfig.lib.json +26 -0
  21. package/tsconfig.spec.json +17 -0
  22. package/tslint.json +17 -0
  23. package/bundles/form-aurora-stefanini.umd.js +0 -975
  24. package/bundles/form-aurora-stefanini.umd.js.map +0 -1
  25. package/bundles/form-aurora-stefanini.umd.min.js +0 -16
  26. package/bundles/form-aurora-stefanini.umd.min.js.map +0 -1
  27. package/esm2015/form-aurora-stefanini.js +0 -5
  28. package/esm2015/lib/fill.js +0 -3
  29. package/esm2015/lib/form-aurora.component.js +0 -681
  30. package/esm2015/lib/form-aurora.module.js +0 -22
  31. package/esm2015/public-api.js +0 -6
  32. package/esm5/form-aurora-stefanini.js +0 -5
  33. package/esm5/lib/fill.js +0 -7
  34. package/esm5/lib/form-aurora.component.js +0 -733
  35. package/esm5/lib/form-aurora.module.js +0 -25
  36. package/esm5/public-api.js +0 -6
  37. package/fesm2015/form-aurora-stefanini.js +0 -703
  38. package/fesm2015/form-aurora-stefanini.js.map +0 -1
  39. package/fesm5/form-aurora-stefanini.js +0 -758
  40. package/fesm5/form-aurora-stefanini.js.map +0 -1
  41. package/form-aurora-stefanini.d.ts +0 -4
  42. package/form-aurora-stefanini.metadata.json +0 -1
  43. package/lib/fill.d.ts +0 -6
  44. package/lib/form-aurora.component.d.ts +0 -106
  45. package/lib/form-aurora.module.d.ts +0 -2
  46. package/public-api.d.ts +0 -2
@@ -1,975 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@angular/common/http'), require('@ng-bootstrap/ng-bootstrap'), require('moment'), require('@angular/common'), require('ng-recaptcha')) :
3
- typeof define === 'function' && define.amd ? define('form-aurora-stefanini', ['exports', '@angular/core', '@angular/forms', '@angular/common/http', '@ng-bootstrap/ng-bootstrap', 'moment', '@angular/common', 'ng-recaptcha'], factory) :
4
- (global = global || self, factory(global['form-aurora-stefanini'] = {}, global.ng.core, global.ng.forms, global.ng.common.http, global.ngBootstrap, global.moment_, global.ng.common, global.ngRecaptcha));
5
- }(this, (function (exports, core, forms, http, ngBootstrap, moment_, common, ngRecaptcha) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
-
23
- var extendStatics = function(d, b) {
24
- extendStatics = Object.setPrototypeOf ||
25
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
- return extendStatics(d, b);
28
- };
29
-
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
-
36
- var __assign = function() {
37
- __assign = Object.assign || function __assign(t) {
38
- for (var s, i = 1, n = arguments.length; i < n; i++) {
39
- s = arguments[i];
40
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
- }
42
- return t;
43
- };
44
- return __assign.apply(this, arguments);
45
- };
46
-
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
- t[p] = s[p];
51
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
- t[p[i]] = s[p[i]];
55
- }
56
- return t;
57
- }
58
-
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
62
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
63
- return c > 3 && r && Object.defineProperty(target, key, r), r;
64
- }
65
-
66
- function __param(paramIndex, decorator) {
67
- return function (target, key) { decorator(target, key, paramIndex); }
68
- }
69
-
70
- function __metadata(metadataKey, metadataValue) {
71
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
72
- }
73
-
74
- function __awaiter(thisArg, _arguments, P, generator) {
75
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
76
- return new (P || (P = Promise))(function (resolve, reject) {
77
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
78
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
79
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
80
- step((generator = generator.apply(thisArg, _arguments || [])).next());
81
- });
82
- }
83
-
84
- function __generator(thisArg, body) {
85
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
86
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
87
- function verb(n) { return function (v) { return step([n, v]); }; }
88
- function step(op) {
89
- if (f) throw new TypeError("Generator is already executing.");
90
- while (_) try {
91
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
92
- if (y = 0, t) op = [op[0] & 2, t.value];
93
- switch (op[0]) {
94
- case 0: case 1: t = op; break;
95
- case 4: _.label++; return { value: op[1], done: false };
96
- case 5: _.label++; y = op[1]; op = [0]; continue;
97
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
98
- default:
99
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
100
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
101
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
102
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103
- if (t[2]) _.ops.pop();
104
- _.trys.pop(); continue;
105
- }
106
- op = body.call(thisArg, _);
107
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
108
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
109
- }
110
- }
111
-
112
- function __createBinding(o, m, k, k2) {
113
- if (k2 === undefined) k2 = k;
114
- o[k2] = m[k];
115
- }
116
-
117
- function __exportStar(m, exports) {
118
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
119
- }
120
-
121
- function __values(o) {
122
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
123
- if (m) return m.call(o);
124
- if (o && typeof o.length === "number") return {
125
- next: function () {
126
- if (o && i >= o.length) o = void 0;
127
- return { value: o && o[i++], done: !o };
128
- }
129
- };
130
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
131
- }
132
-
133
- function __read(o, n) {
134
- var m = typeof Symbol === "function" && o[Symbol.iterator];
135
- if (!m) return o;
136
- var i = m.call(o), r, ar = [], e;
137
- try {
138
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
139
- }
140
- catch (error) { e = { error: error }; }
141
- finally {
142
- try {
143
- if (r && !r.done && (m = i["return"])) m.call(i);
144
- }
145
- finally { if (e) throw e.error; }
146
- }
147
- return ar;
148
- }
149
-
150
- function __spread() {
151
- for (var ar = [], i = 0; i < arguments.length; i++)
152
- ar = ar.concat(__read(arguments[i]));
153
- return ar;
154
- }
155
-
156
- function __spreadArrays() {
157
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
158
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
159
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
160
- r[k] = a[j];
161
- return r;
162
- };
163
-
164
- function __await(v) {
165
- return this instanceof __await ? (this.v = v, this) : new __await(v);
166
- }
167
-
168
- function __asyncGenerator(thisArg, _arguments, generator) {
169
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
170
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
171
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
172
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
173
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
174
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
175
- function fulfill(value) { resume("next", value); }
176
- function reject(value) { resume("throw", value); }
177
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
178
- }
179
-
180
- function __asyncDelegator(o) {
181
- var i, p;
182
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
183
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
184
- }
185
-
186
- function __asyncValues(o) {
187
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
188
- var m = o[Symbol.asyncIterator], i;
189
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
190
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
191
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
192
- }
193
-
194
- function __makeTemplateObject(cooked, raw) {
195
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
196
- return cooked;
197
- };
198
-
199
- function __importStar(mod) {
200
- if (mod && mod.__esModule) return mod;
201
- var result = {};
202
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
203
- result.default = mod;
204
- return result;
205
- }
206
-
207
- function __importDefault(mod) {
208
- return (mod && mod.__esModule) ? mod : { default: mod };
209
- }
210
-
211
- function __classPrivateFieldGet(receiver, privateMap) {
212
- if (!privateMap.has(receiver)) {
213
- throw new TypeError("attempted to get private field on non-instance");
214
- }
215
- return privateMap.get(receiver);
216
- }
217
-
218
- function __classPrivateFieldSet(receiver, privateMap, value) {
219
- if (!privateMap.has(receiver)) {
220
- throw new TypeError("attempted to set private field on non-instance");
221
- }
222
- privateMap.set(receiver, value);
223
- return value;
224
- }
225
-
226
- var moment = moment_;
227
- // import { regexType } from "@app/_shared/_util/regex";
228
- // import { ExternalService } from '@app/_shared/_services/external.service';
229
- // import { AuroraService } from '@app/_shared/_services/aurora.service';
230
- /**
231
- * This Service handles how the date is represented in scripts i.e. ngModel.
232
- */
233
- var CustomAdapter = /** @class */ (function (_super) {
234
- __extends(CustomAdapter, _super);
235
- function CustomAdapter() {
236
- var _this = _super !== null && _super.apply(this, arguments) || this;
237
- _this.DELIMITER = '/';
238
- return _this;
239
- }
240
- CustomAdapter.prototype.fromModel = function (value) {
241
- if (value) {
242
- var date = value.split(this.DELIMITER);
243
- return {
244
- day: parseInt(date[0], 10),
245
- month: parseInt(date[1], 10),
246
- year: parseInt(date[2], 10)
247
- };
248
- }
249
- return null;
250
- };
251
- CustomAdapter.prototype.toModel = function (date) {
252
- //return date ? date.day + this.DELIMITER + date.month + this.DELIMITER + date.year : null;
253
- return date ? (date.day < 10 ? 0 + date.day : date.day) + this.DELIMITER + (date.month < 10 ? 0 + date.month : date.month) + this.DELIMITER + date.year : '';
254
- };
255
- CustomAdapter = __decorate([
256
- core.Injectable()
257
- ], CustomAdapter);
258
- return CustomAdapter;
259
- }(ngBootstrap.NgbDateAdapter));
260
- /**
261
- * This Service handles how the date is rendered and parsed from keyboard i.e. in the bound input field.
262
- */
263
- var CustomDateParserFormatter = /** @class */ (function (_super) {
264
- __extends(CustomDateParserFormatter, _super);
265
- function CustomDateParserFormatter() {
266
- var _this = _super !== null && _super.apply(this, arguments) || this;
267
- _this.DELIMITER = '/';
268
- return _this;
269
- }
270
- CustomDateParserFormatter.prototype.parse = function (value) {
271
- if (value) {
272
- var date = value.split(this.DELIMITER);
273
- return {
274
- day: parseInt(date[0], 10),
275
- month: parseInt(date[1], 10),
276
- year: parseInt(date[2], 10)
277
- };
278
- }
279
- return null;
280
- };
281
- CustomDateParserFormatter.prototype.format = function (date) {
282
- return date ? (date.day < 10 ? '0' + date.day : date.day) + this.DELIMITER + (date.month < 10 ? '0' + date.month : date.month) + this.DELIMITER + date.year : '';
283
- };
284
- CustomDateParserFormatter = __decorate([
285
- core.Injectable()
286
- ], CustomDateParserFormatter);
287
- return CustomDateParserFormatter;
288
- }(ngBootstrap.NgbDateParserFormatter));
289
- var I18N_VALUES = {
290
- 'es': {
291
- weekdays: ['Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa', 'Do'],
292
- months: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
293
- weekLabel: 'sem'
294
- }
295
- // other languages you would support
296
- };
297
- var I18n = /** @class */ (function () {
298
- function I18n() {
299
- this.language = 'es';
300
- }
301
- I18n = __decorate([
302
- core.Injectable()
303
- ], I18n);
304
- return I18n;
305
- }());
306
- // Define custom service providing the months and weekdays translations
307
- var CustomDatepickerI18n = /** @class */ (function (_super) {
308
- __extends(CustomDatepickerI18n, _super);
309
- function CustomDatepickerI18n(_i18n) {
310
- var _this = _super.call(this) || this;
311
- _this._i18n = _i18n;
312
- return _this;
313
- }
314
- CustomDatepickerI18n.prototype.getWeekdayLabel = function (weekday) {
315
- return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
316
- };
317
- CustomDatepickerI18n.prototype.getWeekLabel = function () {
318
- return I18N_VALUES[this._i18n.language].weekLabel;
319
- };
320
- CustomDatepickerI18n.prototype.getMonthShortName = function (month) {
321
- return I18N_VALUES[this._i18n.language].months[month - 1];
322
- };
323
- CustomDatepickerI18n.prototype.getMonthFullName = function (month) {
324
- return this.getMonthShortName(month);
325
- };
326
- CustomDatepickerI18n.prototype.getDayAriaLabel = function (date) {
327
- return date.day + "-" + date.month + "-" + date.year;
328
- };
329
- CustomDatepickerI18n.prototype.getWeekdayShortName = function (weekday) {
330
- return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
331
- };
332
- ;
333
- CustomDatepickerI18n.ctorParameters = function () { return [
334
- { type: I18n }
335
- ]; };
336
- CustomDatepickerI18n = __decorate([
337
- core.Injectable()
338
- ], CustomDatepickerI18n);
339
- return CustomDatepickerI18n;
340
- }(ngBootstrap.NgbDatepickerI18n));
341
- var FormAuroraComponent = /** @class */ (function () {
342
- function FormAuroraComponent(http) {
343
- this.http = http;
344
- this.response = new core.EventEmitter();
345
- this.summit = new core.EventEmitter();
346
- this.setAcceptanceDocument = new core.EventEmitter();
347
- this.tipodocNumDoc = false;
348
- this.onSubmitEvent = false;
349
- this.countSubmit = 0;
350
- this.watchValid = false;
351
- this.watchRequired = false;
352
- this.captchaValid = false;
353
- this.displayMonths = 2;
354
- this.navigation = 'select';
355
- this.showWeekNumbers = false;
356
- this.outsideDays = 'visible';
357
- this.respServiceSegmentation = null;
358
- //emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$";
359
- this.today = moment(new Date());
360
- this.maxYear = this.today.year();
361
- this.minYear = this.today.year() - 82;
362
- 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()};
363
- 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()};
364
- //Revisar variables
365
- this.recharge = false;
366
- this.indicativo = '57';
367
- this.defaultDocType = 'Cédula de ciudadanía';
368
- this.range = new forms.FormGroup({
369
- start: new forms.FormControl(),
370
- end: new forms.FormControl(),
371
- });
372
- }
373
- FormAuroraComponent.prototype.ngOnInit = function () {
374
- var _this = this;
375
- console.log('nueva version 0.1.0');
376
- this.minDate = new Date(this.minDate).toISOString().split('T')[0];
377
- setTimeout(function () {
378
- _this.startComponent();
379
- }, 2000);
380
- };
381
- FormAuroraComponent.prototype.startComponent = function () {
382
- var e_1, _a;
383
- var _this = this;
384
- //ordena los campos
385
- if (this.dataForm != null && this.dataForm.formQuestions != undefined) {
386
- //Same row fields
387
- this.tipodocNumDoc = (this.dataForm.formQuestions.some(function (question) { return question.question.value === 'tipoDoc'; }) && this.dataForm.formQuestions.some(function (question) { return question.question.value === 'numeroDoc'; })) ? true : false;
388
- this.dataForm.formQuestions = this.dataForm.formQuestions.sort(function (a, b) {
389
- return a.order - b.order;
390
- });
391
- var existcaptcha = this.dataForm.formQuestions.filter(function (item) { return item.question.questionType.id == 6; });
392
- if (existcaptcha.length == 0) {
393
- this.captchaValid = true;
394
- }
395
- var _loop_1 = function (item) {
396
- if (item.question.maxlength == null || item.question.maxlength == undefined || item.question.maxlength == 0) {
397
- item.question.maxlength = 524288; //defaultvalue
398
- }
399
- if (item.question.minLength == null || item.question.minLength == undefined) {
400
- item.question.minLength = 0;
401
- }
402
- this_1.dataReloadForm.forEach(function (element) {
403
- _this.filldata = element;
404
- if ((item.question.questionType.id === 2 || item.question.questionType.id === 1 ||
405
- item.question.questionType.id === 3) && (_this.filldata.data !== null &&
406
- _this.filldata.data !== undefined) && item.question.id === _this.filldata.id) {
407
- item.question.registred = _this.filldata.data;
408
- }
409
- });
410
- if (item.question.registred == null || item.question.minLength == undefined) {
411
- item.question.registred = '';
412
- }
413
- };
414
- var this_1 = this;
415
- try {
416
- for (var _b = __values(this.dataForm.formQuestions), _c = _b.next(); !_c.done; _c = _b.next()) {
417
- var item = _c.value;
418
- _loop_1(item);
419
- }
420
- }
421
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
422
- finally {
423
- try {
424
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
425
- }
426
- finally { if (e_1) throw e_1.error; }
427
- }
428
- }
429
- };
430
- FormAuroraComponent.prototype.resolvedCaptcha = function (captchaResponse) {
431
- this.captchaValid = true;
432
- if (!this.formDynamic.form.value.captcha) {
433
- this.formDynamic.controls.captcha.setValue(captchaResponse);
434
- this.formDynamic.form.value.captcha = captchaResponse;
435
- document.getElementById('btnIng').style.opacity = !this.formDynamic.valid ? '0.65' : '1';
436
- }
437
- };
438
- //Forms
439
- //Metodo para evitar el render de los items del for
440
- FormAuroraComponent.prototype.trackByIndex = function (index, obj) {
441
- return index;
442
- };
443
- FormAuroraComponent.prototype.onChangeValidPatter = function (event, question) {
444
- var _this = this;
445
- if (question.pattern != undefined) {
446
- var valid = true;
447
- var keyvalid = [8, 32, 37, 38, 39, 40, 46, 9];
448
- //diferente de Backpsace
449
- //se deja catch por error no controlable en otro tiempo de ejecucion
450
- try {
451
- if (!keyvalid.includes(event.keyCode)) {
452
- var regex = new RegExp(question.pattern);
453
- valid = regex.test(event.key);
454
- }
455
- }
456
- catch (error) {
457
- }
458
- return valid;
459
- }
460
- document.getElementById('char' + question.value).setAttribute('hidden', 'true');
461
- //if temporal mientras se migran todos los tipos de campos al foreach
462
- if (question.questionType.id != 11 && question.questionType.id != 7) {
463
- if (this.validMinLength(this.formDynamic, question)) {
464
- document.getElementById(question.value).style.borderColor = '#FF0000';
465
- document.getElementById('ml' + question.value).removeAttribute('hidden');
466
- }
467
- else {
468
- document.getElementById(question.value).style.borderColor = '#E4E4E4';
469
- document.getElementById('ml' + question.value).setAttribute('hidden', 'true');
470
- }
471
- if (this.validMaxLength(this.formDynamic, question)) {
472
- document.getElementById(question.value).style.borderColor = '#FF0000';
473
- document.getElementById('mxl' + question.value).removeAttribute('hidden');
474
- }
475
- else {
476
- document.getElementById(question.value).style.borderColor = '#E4E4E4';
477
- document.getElementById('mxl' + question.value).setAttribute('hidden', 'true');
478
- }
479
- }
480
- this.dataForm.formQuestions.forEach(function (formQuestion) {
481
- switch (formQuestion.question.questionType.id) {
482
- //se valida campo de tipo calendario
483
- case 7:
484
- if (question.questionType.id == 7)
485
- _this.calendarRulesValidate(formQuestion);
486
- break;
487
- //se valida campo de tipo email
488
- case 11:
489
- if (question.questionType.id == 11)
490
- _this.emailRulesValidate(formQuestion);
491
- break;
492
- }
493
- });
494
- document.getElementById('btnIng').style.opacity = !this.formDynamic.valid ? '0.65' : '1';
495
- };
496
- FormAuroraComponent.prototype.validOnlyText = function (event) {
497
- var regex = /^[a-zA-Z\u00C0-\u017F]+$/g;
498
- if (event.charCode == 32) {
499
- return true;
500
- }
501
- var valid = regex.test(event.key);
502
- return valid;
503
- };
504
- FormAuroraComponent.prototype.validDate = function (event) {
505
- /*let pattern = /(?:0[1-9]|[12][0-9]|3[01])\/(?:0[1-9]|1[0-2])\/(?:19|20)[0-9]{2}/;
506
- const regex = new RegExp(pattern);
507
- valid = regex.test(event.key);
508
- */
509
- var matches = String(event.key).match(this.regexType.date.exp);
510
- var valid = true;
511
- if (matches === null)
512
- valid = false;
513
- // alert(valid);
514
- return valid;
515
- };
516
- FormAuroraComponent.prototype.onChangeValidDate = function (event) {
517
- //let pattern = /(?:0[1-9]|1[0-2])\/(?:0[1-9]|[12][0-9]|3[01])\/(?:19|20)[0-9]{2}/;
518
- var dateN = /[0-9]|\//;
519
- var valid = true;
520
- var regex = new RegExp(dateN);
521
- valid = regex.test(event.key);
522
- return valid;
523
- };
524
- FormAuroraComponent.prototype.rediretoutside = function (event, question) {
525
- //se deja catch por error no controlable en otro tiempo de ejecucion
526
- try {
527
- event.preventDefault();
528
- window.open(question.value, '_blank');
529
- }
530
- catch (error) {
531
- }
532
- };
533
- /**
534
- * Dispatch submit event for validations exists
535
- * @param change
536
- */
537
- FormAuroraComponent.prototype.ngOnChanges = function (change) {
538
- this.countSubmit++;
539
- };
540
- //onSubmit(form: NgForm) {
541
- FormAuroraComponent.prototype.onSubmit = function () {
542
- var _this = this;
543
- var form = this.formDynamic;
544
- this.watchValid = true;
545
- this.watchRequired = true;
546
- if (form.valid) {
547
- if (!this.validRulesFields(form.controls['numeroDoc'].value.toString(), form.controls['celular'].value.toString(), form.controls['email'].value))
548
- return false;
549
- }
550
- if (this.validMinlenghtAllQuestions(form.value) && this.validMaxLengthAllQuestions(form.value) && form.valid) {
551
- if (this.dataForm.urlSend != '' && this.captchaValid) {
552
- this.http.post(this.dataForm.urlSend, form.value).subscribe(function (resp) { return _this.response.emit(resp); });
553
- }
554
- else if (form.valid && this.captchaValid) {
555
- this.summit.emit(form.value);
556
- }
557
- }
558
- };
559
- FormAuroraComponent.prototype.validRulesFields = function (numeroDoc, numeroCel, email) {
560
- var _this = this;
561
- // Validaciones para celular en caso de indicativo en Colombia
562
- var cel = document.getElementById('charcelular');
563
- var doc = document.getElementById('charnumeroDoc');
564
- var valOk = true;
565
- if (this.indicativo == '+57' || this.indicativo == '57') {
566
- var stringOrdenado = this.orderString(numeroDoc);
567
- if (this.nameCompany.toUpperCase() !== 'CLARO') { //claro acepta nro consecutivos
568
- if (numeroDoc == stringOrdenado) {
569
- doc.style.borderColor = '#FF0000';
570
- doc.removeAttribute('hidden');
571
- doc.textContent = 'El numero documento No debe contener caracteres consecutivos';
572
- valOk = false;
573
- //this.msgErrorCampo = "El numero documento No debe contener caracteres consecutivos";
574
- //return false;
575
- }
576
- }
577
- if (numeroCel.substring(0, 1) != '3') {
578
- cel.style.borderColor = '#FF0000';
579
- cel.removeAttribute('hidden');
580
- cel.textContent = 'El primer carácter del celular debe ser 3';
581
- valOk = false;
582
- //this.msgErrorCampo = "El primer carácter del celular debe ser 3";
583
- //return false;
584
- }
585
- /*
586
- if (parseInt(numeroCel.substring(0, 3)) > 350) {
587
- cel.style.borderColor = "#FF0000";
588
- cel.removeAttribute("hidden");
589
- cel.textContent = "El prefijo del celular no debe ser mayor a 350";
590
- valOk = false;
591
- //this.msgErrorCampo = "El prefijo del celular no debe ser mayor a 350";
592
- //return false;
593
- }
594
- */
595
- //En caso de que el número se repita, ejemplo 33333333
596
- var listnumber = numeroDoc.substring(0, 1);
597
- for (var index = 1; index < numeroDoc.length; index++) {
598
- listnumber = listnumber + numeroDoc.substring(0, 1);
599
- }
600
- if (numeroDoc == listnumber) {
601
- doc.style.borderColor = '#FF0000';
602
- doc.removeAttribute('hidden');
603
- doc.textContent = 'Caracteres numéricos no se pueden repetirse de manera continua ';
604
- valOk = false;
605
- //this.msgErrorCampo = "Caracteres numéricos no se pueden repetirse de manera continua ";
606
- //return false;
607
- }
608
- // En caso de que el número se repita, ejemplo 33333333
609
- var arrayPhoneRepeat = Array.from(String(numeroCel), Number);
610
- var arrayPhoneOutRepeat = __spread(new Set(arrayPhoneRepeat));
611
- if (arrayPhoneOutRepeat.length == 1) {
612
- cel.style.borderColor = '#FF0000';
613
- cel.removeAttribute('hidden');
614
- cel.textContent = 'El número que ingresa no es valido';
615
- valOk = false;
616
- //this.msgErrorCampo = "El número que ingresa no es valido";
617
- //return false;
618
- }
619
- }
620
- else if (this.indicativo == '+593' || this.indicativo == '593') {
621
- if (numeroCel.substring(0, 1) != '9') {
622
- cel.style.borderColor = '#FF0000';
623
- cel.removeAttribute('hidden');
624
- cel.textContent = 'El primer carácter del celular debe ser 9';
625
- valOk = false;
626
- //this.msgErrorCampo = "El primer carácter del celular debe ser 9";
627
- //return false;
628
- }
629
- }
630
- //se validan los campos por tipo de campo y no por value
631
- this.dataForm.formQuestions.forEach(function (formQuestion) {
632
- switch (formQuestion.question.questionType.id) {
633
- //se valida campo de tipo email
634
- case 11:
635
- valOk = _this.emailRulesValidate(formQuestion);
636
- break;
637
- }
638
- });
639
- return valOk;
640
- };
641
- FormAuroraComponent.prototype.orderString = function (value) {
642
- var arrayNumber = [];
643
- for (var index = 0; index < value.length; index++) {
644
- arrayNumber.push(parseInt(value.substring(index, index + 1)));
645
- }
646
- //ordena el array
647
- arrayNumber.sort(function (a, b) {
648
- return a - b;
649
- });
650
- var numberOrder = '';
651
- numberOrder = arrayNumber[0];
652
- for (var index = 1; index < arrayNumber.length; index++) {
653
- numberOrder = numberOrder + (arrayNumber[0] + index).toString();
654
- }
655
- return numberOrder;
656
- };
657
- FormAuroraComponent.prototype.validMinlenghtAllQuestions = function (form) {
658
- var e_2, _a;
659
- try {
660
- for (var _b = __values(this.dataForm.formQuestions), _c = _b.next(); !_c.done; _c = _b.next()) {
661
- var item = _c.value;
662
- if (item.question.questionType.id == 1 || item.question.questionType.id == 2) {
663
- var minLength = parseInt(item.question.minLength);
664
- var formValueLength = parseInt(form[item.question.value].toString().length);
665
- if (minLength > 0 && formValueLength != minLength && formValueLength < minLength)
666
- return false;
667
- }
668
- }
669
- }
670
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
671
- finally {
672
- try {
673
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
674
- }
675
- finally { if (e_2) throw e_2.error; }
676
- }
677
- return true;
678
- };
679
- FormAuroraComponent.prototype.validMaxLengthAllQuestions = function (form) {
680
- var e_3, _a;
681
- try {
682
- for (var _b = __values(this.dataForm.formQuestions), _c = _b.next(); !_c.done; _c = _b.next()) {
683
- var item = _c.value;
684
- if (item.question.questionType.id == 1 || item.question.questionType.id == 2) {
685
- var maxLength = parseInt(item.question.maxLength);
686
- var formValueLength = parseInt(form[item.question.value].toString().length);
687
- if (maxLength > 0 && formValueLength != maxLength && formValueLength > maxLength)
688
- return false;
689
- }
690
- }
691
- }
692
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
693
- finally {
694
- try {
695
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
696
- }
697
- finally { if (e_3) throw e_3.error; }
698
- }
699
- return true;
700
- };
701
- FormAuroraComponent.prototype.validRequired = function (form, question) {
702
- //se deja catch por error no controlable en otro tiempo de ejecucion
703
- try {
704
- if (question != undefined && question.value != undefined) {
705
- if (form.controls[question.value] != undefined &&
706
- form.controls[question.value].errors != null &&
707
- form.controls[question.value].errors.required) {
708
- return true;
709
- }
710
- }
711
- }
712
- catch (error) {
713
- }
714
- return false;
715
- };
716
- FormAuroraComponent.prototype.validMinLength = function (form, question) {
717
- //se deja catch por error no controlable en otro tiempo de ejecucion
718
- try {
719
- if (question != undefined && question.value != undefined) {
720
- if (question.minLength > form.controls[question.value].value.toLocaleString().length && question.minLength > 0) {
721
- return true;
722
- }
723
- }
724
- }
725
- catch (error) {
726
- }
727
- return false;
728
- };
729
- FormAuroraComponent.prototype.validMaxLength = function (form, question) {
730
- //se deja catch por error no controlable en otro tiempo de ejecucion
731
- try {
732
- if (question != undefined && question.value != undefined) {
733
- if (question.maxLength > 0) {
734
- if (question.maxLength + 1 <= form.controls[question.value].value.toString().replace(/\./g, '').length) {
735
- if (!this.formDynamic.controls[question.value].hasError('errorMaxLength')) {
736
- this.formDynamic.controls[question.value].setErrors({ 'errorMaxLength': true });
737
- }
738
- return true;
739
- }
740
- }
741
- }
742
- }
743
- catch (error) {
744
- }
745
- return false;
746
- };
747
- FormAuroraComponent.prototype.tycSelection = function (event) {
748
- event.preventDefault();
749
- var tyc = document.getElementById('txtPoliticas');
750
- tyc.style.color = '#A3AD32';
751
- // this.externalService.getTermsAndConditions().subscribe(resp => {
752
- var b64 = null;
753
- if (this.getTermsAndConditions && this.getTermsAndConditions.listaDocumentos) {
754
- b64 = this.getTermsAndConditions.listaDocumentos[0].contenidoDocumento;
755
- this.respServiceSegmentation = this.getTermsAndConditions.listaDocumentos[0];
756
- var pdfWindow = window.open('');
757
- pdfWindow.document.write('<iframe width=\'100%\' height=\'100%\' src=\'data:application/pdf;base64, ' +
758
- encodeURI(b64) + '\'></iframe>');
759
- }
760
- // })
761
- };
762
- FormAuroraComponent.prototype.openLabelUrl = function (event, question) {
763
- event.preventDefault();
764
- var tyc = document.getElementById('check' + question.id);
765
- tyc.style.color = '#A3AD32';
766
- window.open(question.urllabel, '_blank');
767
- };
768
- FormAuroraComponent.prototype.checkTermsAndConditions = function (value) {
769
- return __awaiter(this, void 0, void 0, function () {
770
- var ipAddress, objToSend, aceptaciones;
771
- return __generator(this, function (_a) {
772
- switch (_a.label) {
773
- case 0:
774
- if (!value) return [3 /*break*/, 2];
775
- return [4 /*yield*/, this.getIpAddress];
776
- case 1:
777
- ipAddress = _a.sent();
778
- objToSend = {
779
- 'idDocumento': this.respServiceSegmentation.idDocumento || '',
780
- // "idDocumento": this.respServiceSegmentation?.idDocumento || "",
781
- 'nombrePortafolio': '0',
782
- 'aplicacion': 'ZP_OF',
783
- 'ip': ipAddress.ip,
784
- 'tipoIdAfil': 'CC',
785
- 'numeroIdAfil': this.formDynamic.controls['numeroDoc'].value.toString(),
786
- 'numeroCuentaPI': '0',
787
- 'transaccion': 'INICIO DE SESION_OF',
788
- 'conceptoAceptacion': 'HABEAS_DATA_USO_APP',
789
- 'respuesta': 'SI',
790
- 'usuarioCreacion': this.formDynamic.controls['numeroDoc'].value.toString()
791
- };
792
- aceptaciones = { aceptaciones: [objToSend] };
793
- // this.externalService.setAcceptanceDocument(aceptaciones).subscribe(() => { })
794
- this.setAcceptanceDocument.emit(aceptaciones);
795
- _a.label = 2;
796
- case 2: return [2 /*return*/];
797
- }
798
- });
799
- });
800
- };
801
- FormAuroraComponent.prototype.cancellKeypress = function () {
802
- return false;
803
- };
804
- FormAuroraComponent.prototype.emailRulesValidate = function (formQuestion) {
805
- var valOk = true;
806
- try {
807
- var hasError = false;
808
- document.getElementById(formQuestion.question.id).setAttribute('hidden', 'true');
809
- var eml = document.getElementById(formQuestion.question.id);
810
- var email = formQuestion.question.registred;
811
- if (!hasError) {
812
- if (formQuestion.question.required && (email == '' || email == undefined || email == null)) {
813
- eml.style.borderColor = '#FF0000';
814
- eml.textContent = 'El correco eléctronico es requerido';
815
- eml.removeAttribute('hidden');
816
- valOk = false;
817
- hasError = true;
818
- }
819
- }
820
- if (!hasError) {
821
- if (this.validMinLength(undefined, formQuestion.question)) {
822
- eml.style.borderColor = '#FF0000';
823
- eml.textContent = 'Debe ser mínimo de ' + formQuestion.question.minLength + ' caracteres';
824
- document.getElementById(formQuestion.question.id).removeAttribute('hidden');
825
- valOk = false;
826
- hasError = true;
827
- }
828
- }
829
- if (!hasError) {
830
- if (this.validMaxLength(undefined, formQuestion.question)) {
831
- eml.style.borderColor = '#FF0000';
832
- eml.textContent = 'Debe ser maximo de ' + formQuestion.question.maxLength + ' caracteres';
833
- document.getElementById(formQuestion.question.id).removeAttribute('hidden');
834
- valOk = false;
835
- hasError = true;
836
- }
837
- }
838
- if (!hasError) {
839
- var matches = String(email).match(this.regexType.email.exp);
840
- if (matches == null) {
841
- eml.style.borderColor = '#FF0000';
842
- eml.textContent = 'Tu email es invalido';
843
- eml.removeAttribute('hidden');
844
- valOk = false;
845
- hasError = true;
846
- }
847
- }
848
- }
849
- catch (error) {
850
- }
851
- return valOk;
852
- };
853
- FormAuroraComponent.prototype.calendarRulesValidate = function (formQuestion) {
854
- var hasError = false;
855
- try {
856
- document.getElementById(formQuestion.question.id).setAttribute('hidden', 'true');
857
- var ecalendar = document.getElementById(formQuestion.question.id);
858
- //se valida que no sea null si es requerido
859
- var date = formQuestion.question.registred;
860
- if (formQuestion.question.required && (date == '' || date == undefined || date == null)) {
861
- ecalendar.style.borderColor = '#FF0000';
862
- ecalendar.textContent = 'La fecha es requerida';
863
- ecalendar.removeAttribute('hidden');
864
- }
865
- }
866
- catch (error) {
867
- }
868
- };
869
- FormAuroraComponent.prototype.validateNotSpace = function (event) {
870
- if (event.charCode == 32) {
871
- return false;
872
- }
873
- else {
874
- return true;
875
- }
876
- };
877
- FormAuroraComponent.ctorParameters = function () { return [
878
- { type: http.HttpClient }
879
- ]; };
880
- __decorate([
881
- core.Input()
882
- ], FormAuroraComponent.prototype, "dataClassCss", void 0);
883
- __decorate([
884
- core.Input()
885
- ], FormAuroraComponent.prototype, "dataForm", void 0);
886
- __decorate([
887
- core.Input()
888
- ], FormAuroraComponent.prototype, "clickSubmit", void 0);
889
- __decorate([
890
- core.Input()
891
- ], FormAuroraComponent.prototype, "dataReloadForm", void 0);
892
- __decorate([
893
- core.Input()
894
- ], FormAuroraComponent.prototype, "welcomeTitle", void 0);
895
- __decorate([
896
- core.Input()
897
- ], FormAuroraComponent.prototype, "welcomeDescription", void 0);
898
- __decorate([
899
- core.Input()
900
- ], FormAuroraComponent.prototype, "urlPdf", void 0);
901
- __decorate([
902
- core.Input()
903
- ], FormAuroraComponent.prototype, "nameCompany", void 0);
904
- __decorate([
905
- core.Input()
906
- ], FormAuroraComponent.prototype, "schedule", void 0);
907
- __decorate([
908
- core.Input()
909
- ], FormAuroraComponent.prototype, "getTermsAndConditions", void 0);
910
- __decorate([
911
- core.Input()
912
- ], FormAuroraComponent.prototype, "regexType", void 0);
913
- __decorate([
914
- core.Input()
915
- ], FormAuroraComponent.prototype, "getIpAddress", void 0);
916
- __decorate([
917
- core.ViewChild('formDynamic', { static: true })
918
- ], FormAuroraComponent.prototype, "formDynamic", void 0);
919
- __decorate([
920
- core.Output()
921
- ], FormAuroraComponent.prototype, "response", void 0);
922
- __decorate([
923
- core.Output()
924
- ], FormAuroraComponent.prototype, "summit", void 0);
925
- __decorate([
926
- core.Output()
927
- ], FormAuroraComponent.prototype, "setAcceptanceDocument", void 0);
928
- __decorate([
929
- core.ViewChild('modalTurns', { static: false })
930
- ], FormAuroraComponent.prototype, "myModal", void 0);
931
- FormAuroraComponent = __decorate([
932
- core.Component({
933
- selector: 'lib-FormAurora',
934
- template: "<script src=\"https://www.google.com/recaptcha/api.js\" async defer></script>\n<div class=\"card\">\n <span class=\"text-center mt-2 d-none d-sm-block\">\n <img style=\"width: 115px; height:96px;\" [class]=\"dataClassCss.logo\" id=\"logo\">\n </span>\n <div class=\"card-body pt-0\">\n <ng-container *ngIf=\"schedule\">\n <h4 class=\"card-title text-center mb-0\" [class]=\"dataClassCss.bienvenida2\" style=\"color: #EE7E0E;\">\n Horarios de atenci\u00F3n\n </h4>\n <small class=\"text-center d-block\">{{schedule}}</small>\n </ng-container>\n <form #formDynamic=\"ngForm\">\n <div *ngFor=\"let control of dataForm?.formQuestions; let index = index; trackBy: trackByIndex\">\n <div\n *ngIf=\"(index > 0 && (dataForm.formQuestions[index - 1].question.questionType.id == 3 && dataForm.formQuestions[index].question.questionType.id == 2)) || (index < dataForm.formQuestions.length && dataForm.formQuestions[index].question.questionType.id == 3 && dataForm.formQuestions[index + 1].question.questionType.id == 2); else switchTemp\">\n <div class=\"row\"\n *ngIf=\"(index > 0 && (dataForm.formQuestions[index - 1].question.questionType.id == 3 && dataForm.formQuestions[index].question.questionType.id == 2))\">\n <div class=\"col-lg-6 col-xs-12\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index - 1].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left;\">\n <span class=\"h6 small bg-white text-muted\">{{dataForm.formQuestions[index -\n 1].question.label}}</span>\n </label>\n <div class=\"selectContainer\">\n <select [name]=\"dataForm.formQuestions[index - 1].question.value\"\n [required]=\"dataForm.formQuestions[index - 1].question.required\"\n [class]=\"dataClassCss.formcontrol\"\n id=\"{{dataForm.formQuestions[index - 1].question.value}}\"\n style=\"margin-top: -1rem !important;\"\n [(ngModel)]=\"defaultDocType !== '' ? defaultDocType : dataForm.formQuestions[index - 1].question.registred\">\n <option value=\"\" selected disabled hidden>Selecciona</option>\n <ng-container\n *ngFor=\"let item of dataForm.formQuestions[index - 1].question.questionAnswers\">\n <option *ngIf=\"item.answer.state.id == 1\" [value]=\"item.answer.value\">\n {{ item.answer.field }}\n </option>\n </ng-container>\n </select>\n </div>\n </div>\n <div style=\"margin-left: 15px;\"\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index-1].question.value\"\n hidden></span>\n </div>\n </div>\n <div class=\"col-lg-6 col-xs-12\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\"\n class=\"col-sm-12 p-sm-0 px-sm-1\" style=\"display: block; text-align: left;\">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" digitOnly id=\"{{dataForm.formQuestions[index].question.value}}\"\n style=\"margin-top: -1rem !important;\"\n [name]=\"dataForm.formQuestions[index].question.value\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (keyup)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n onkeypress=\"return (event.charCode == 0) ? null : event.charCode >= 48 && event.charCode <= 57\"\n onkeyup=\"(this.value=(value.replace(/[.]*/g,'')))\"\n maxlength=\"dataForm.formQuestions[index].question.maxLength\"\n [minLength]=\"dataForm.formQuestions[index].question.minLength\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n [class]=\"dataClassCss.formcontrol\"/>\n\n </div>\n <div style=\"margin-left: 15px;\"\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\n <span class=\"error\" [id]=\"'rq'+dataForm.formQuestions[index].question.value\"\n *ngIf=\"validRequired(formDynamic,dataForm.formQuestions[index].question) && watchValid\">\n Este campo es obligatorio</span>\n <span class=\"error\" [id]=\"'ml'+dataForm.formQuestions[index].question.value\" hidden>\n Debe ser m\u00EDnimo de\n {{ dataForm.formQuestions[index].question.minLength }} caracteres</span>\n <span class=\"error\" [id]=\"'mxl'+dataForm.formQuestions[index].question.value\" hidden>\n Debe ser maximo de\n {{ dataForm.formQuestions[index].question.maxLength }} caracteres</span>\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index].question.value\"\n hidden></span>\n </div>\n </div>\n </div>\n </div>\n\n <ng-template #switchTemp>\n <div [ngSwitch]=\"dataForm.formQuestions[index].question.questionType.id\">\n <div *ngSwitchCase=\"1\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left; \">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n style=\"margin-top: -1rem !important;\"/>\n </div>\n </div>\n <div *ngSwitchCase=\"2\">\n\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left;\">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" digitOnly id=\"{{dataForm.formQuestions[index].question.value}}\"\n style=\"margin-top: -1rem !important;\"\n [name]=\"dataForm.formQuestions[index].question.value\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n onkeypress=\"return (event.charCode == 0) ? null : event.charCode >= 48 && event.charCode <= 57\"\n onkeyup=\"(this.value=(value.replace(/[.]*/g,'')))\"\n maxlength=\"dataForm.formQuestions[index].question.maxLength\"\n [minLength]=\"dataForm.formQuestions[index].question.minLength\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n [class]=\"dataClassCss.formcontrol\"/>\n </div>\n\n </div>\n <div *ngSwitchCase=\"3\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left;\">\n <span\n class=\"h6 small bg-white text-muted\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <select [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [class]=\"dataClassCss.formcontrol\"\n id=\"{{dataForm.formQuestions[index].question.value}}\"\n style=\"margin-top: -1rem !important;\"\n [(ngModel)]=\"defaultDocType !== '' ? defaultDocType : dataForm.formQuestions[index].question.registred\">\n <option value=\"\" selected disabled hidden>Selecciona</option>\n <ng-container\n *ngFor=\"let item of dataForm.formQuestions[index].question.questionAnswers\">\n <option *ngIf=\"item.answer.state.id == 1\" [value]=\"item.answer.value\">\n {{ item.answer.field }}\n </option>\n </ng-container>\n </select>\n </div>\n </div>\n <div *ngSwitchCase=\"4\">\n <select class=\"{{ dataClassCss.formcontrol }} select-checkbox\"\n style=\"overflow: hidden; border-style: hidden;\"\n [style.height.px]=\"dataForm.formQuestions[index].question.questionAnswers.length * 24\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\" ngModel multiple>\n <!-- todo: delete (mousedown)=\"onMouseDown($event, dataForm.formQuestions[index].question.value, formDynamic)\"-->\n <option\n (mousemove)=\"$event.preventDefault()\"\n *ngFor=\"let item of dataForm.formQuestions[index].question.questionAnswers\"\n [value]=\"item.answer.value\">\n {{ item.answer.field }}\n </option>\n </select>\n </div>\n <div *ngSwitchCase=\"5\">\n <a (click)=\"rediretoutside($event,dataForm.formQuestions[index].question)\" href=\"\">\n <span>{{ dataForm.formQuestions[index].question.label }}</span>\n </a>\n </div>\n <div *ngSwitchCase=\"6\">\n <div [class]=\"dataClassCss.cl12\" [id]=\"'reCaptcha'\">\n <div class=\"cnt-captcha\">\n <re-captcha (resolved)=\"resolvedCaptcha($event)\"\n siteKey=\"6LfQisEZAAAAAARuuKFEAgS-x4qJse5uBA_QCA7v\"></re-captcha>\n <input hidden type=\"text\" [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\">\n </div>\n <span class=\"error\" *ngIf=\"watchValid && !captchaValid\" style=\"margin-top: 0;\">\n Debe resolver la captcha para continuar\n </span>\n </div>\n </div>\n <div *ngSwitchCase=\"7\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left; margin-bottom: 0 ;\">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input placeholder=\"dd/mm/aaaa\" style=\"margin-top: -0.4rem !important;\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [name]=\"dataForm.formQuestions[index].question.value\" type=\"date\" min=\"{{minDate}}\"\n max=\"{{maxDate}}\" [maxlength]=\"10\" (paste)=\"false\"\n id=\"{{dataForm.formQuestions[index].question.value}}\"\n [class]=\"dataClassCss.txtCalendar\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n (keydown)=\"cancellKeypress()\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\">\n\n <!-- for replace by id todo-->\n <button class=\"btn\" id=\"{{dataForm.formQuestions[index].question.value}}\" type=\"button\"\n style=\"width: 46px;\n top: 12px;\n color: white;\n right: 15px;\n position: absolute;\n background: #D25D42;\n pointer-events: none;\">\n <i class=\"fa fa-calendar\"></i>\n </button>\n\n </div>\n </div>\n <div *ngSwitchCase=\"8\">\n <div [class]=\"dataClassCss.cl12\" style=\"text-align: left; margin-bottom: 10px;\">\n <input [style]=\"'width: 4%; height: auto; display: inline;'\" type=\"checkbox\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n [class]=\"dataClassCss.formcontrol\"\n (change)=\"checkTermsAndConditions(dataForm.formQuestions[index].question.registred)\">\n <!-- <a href=\"{{urlPdf}}\" target=\"_blank\" style=\"text-decoration: underline;\"\n id=\"txtPoliticas\" (click)=\"tycSelection()\">\n {{dataForm.formQuestions[index].question.label}}\n </a> -->\n <a target=\"_blank\" style=\"text-decoration: underline;color:blue;cursor: pointer;\"\n id=\"txtPoliticas\" (click)=\"tycSelection($event)\">\n {{dataForm.formQuestions[index].question.label}}\n </a>\n </div>\n </div>\n <div *ngSwitchCase=\"9\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left; \">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (keypress)=\"validOnlyText($event)\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n style=\"margin-top: -1rem !important;\"/>\n </div>\n </div>\n <div *ngSwitchCase=\"10\">\n <div [class]=\"dataClassCss.cl12\" style=\"text-align: left; margin-bottom: 10px;\">\n <input [style]=\"'width: 4%; height: auto; display: inline;'\" type=\"checkbox\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n [class]=\"dataClassCss.formcontrol\">\n <a target=\"_blank\" style=\"text-decoration: underline;color:blue;cursor: pointer;\"\n id=\"check{{dataForm.formQuestions[index].question.id}}\"\n (click)=\"openLabelUrl($event,dataForm.formQuestions[index].question)\">\n {{dataForm.formQuestions[index].question.label}}\n </a>\n </div>\n </div>\n <div *ngSwitchCase=\"11\">\n <div [class]=\"dataClassCss.cl12\">\n <label for=\"{{dataForm.formQuestions[index].question.value}}\" class=\"col-sm-12\"\n style=\"display: block; text-align: left; \">\n <span\n class=\"h6 small bg-white text-muted pt-1 pl-2 pr-2\">{{dataForm.formQuestions[index].question.label}}</span>\n </label>\n <input type=\"text\" id=\"{{dataForm.formQuestions[index].question.value}}\"\n [class]=\"dataClassCss.formcontrol\" placeholder=\"Escribe\"\n [required]=\"dataForm.formQuestions[index].question.required\"\n [maxlength]=\"dataForm.formQuestions[index].question.maxLength\"\n [name]=\"dataForm.formQuestions[index].question.value\"\n (keydown)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (change)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (blur)=\"onChangeValidPatter($event, dataForm.formQuestions[index].question)\"\n (keypress)=\"validateNotSpace($event)\"\n [(ngModel)]=\"dataForm.formQuestions[index].question.registred\"\n style=\"margin-top: -1rem !important;\"/>\n </div>\n </div>\n <div *ngSwitchDefault>Tipo de control no detectado</div>\n <div style=\"margin-left: 15px;\"\n *ngIf=\"dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6\">\n <span class=\"error\" [id]=\"'rq'+dataForm.formQuestions[index].question.value\"\n *ngIf=\"validRequired(formDynamic,dataForm.formQuestions[index].question) && watchValid\">\n Este campo es obligatorio</span>\n <span class=\"error\" [id]=\"'ml'+dataForm.formQuestions[index].question.value\" hidden>\n Debe ser m\u00EDnimo de\n {{ dataForm.formQuestions[index].question.minLength }} caracteres</span>\n <span class=\"error\" [id]=\"'mxl'+dataForm.formQuestions[index].question.value\" hidden>\n Debe ser maximo de\n {{ dataForm.formQuestions[index].question.maxLength }} caracteres</span>\n <span class=\"error\" [id]=\"'char'+dataForm.formQuestions[index].question.value\"\n hidden></span>\n <span class=\"error\" [id]=\"dataForm.formQuestions[index].question.id\" hidden></span>\n </div>\n </div>\n </ng-template>\n </div>\n <div class=\"mt-3 text-center\">\n <button type=\"button\" [class]=\"dataClassCss.btn\" (click)=\"onSubmit()\" [disabled]=\"!formDynamic.valid\"\n id=\"btnIng\">Ingresar\n </button>\n </div>\n </form>\n </div>\n</div>\n",
935
- providers: [
936
- { provide: ngBootstrap.NgbDateAdapter, useClass: CustomAdapter },
937
- { provide: ngBootstrap.NgbDateParserFormatter, useClass: CustomDateParserFormatter },
938
- { provide: ngBootstrap.NgbDatepickerI18n, useClass: CustomDatepickerI18n },
939
- I18n
940
- ],
941
- styles: [".select-checkbox option::before{content:\"\\2610\";width:1.3em;text-align:center;display:inline-block}.select-checkbox option:checked::before{content:\"\\2611\"}"]
942
- })
943
- ], FormAuroraComponent);
944
- return FormAuroraComponent;
945
- }());
946
-
947
- var FormAuroraModule = /** @class */ (function () {
948
- function FormAuroraModule() {
949
- }
950
- FormAuroraModule = __decorate([
951
- core.NgModule({
952
- declarations: [FormAuroraComponent],
953
- imports: [
954
- common.CommonModule,
955
- forms.FormsModule,
956
- ngRecaptcha.RecaptchaModule,
957
- ngRecaptcha.RecaptchaFormsModule
958
- ],
959
- exports: [FormAuroraComponent]
960
- })
961
- ], FormAuroraModule);
962
- return FormAuroraModule;
963
- }());
964
-
965
- exports.CustomAdapter = CustomAdapter;
966
- exports.CustomDateParserFormatter = CustomDateParserFormatter;
967
- exports.CustomDatepickerI18n = CustomDatepickerI18n;
968
- exports.FormAuroraComponent = FormAuroraComponent;
969
- exports.FormAuroraModule = FormAuroraModule;
970
- exports.I18n = I18n;
971
-
972
- Object.defineProperty(exports, '__esModule', { value: true });
973
-
974
- })));
975
- //# sourceMappingURL=form-aurora-stefanini.umd.js.map