form-aurora-stefanini 0.1.1 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- package/karma.conf.js +32 -0
- package/ng-package.json +7 -0
- package/package.json +17 -28
- package/src/lib/Components/from-aurora/form-aurora.component.css +117 -0
- package/src/lib/Components/from-aurora/form-aurora.component.html +343 -0
- package/src/lib/Components/from-aurora/form-aurora.component.spec.ts +25 -0
- package/src/lib/Components/from-aurora/form-aurora.component.ts +725 -0
- package/src/lib/Models/company-parameters.ts +16 -0
- package/src/lib/Models/company.ts +25 -0
- package/src/lib/Models/fill.ts +6 -0
- package/src/lib/Models/state.ts +5 -0
- package/src/lib/Models/step.ts +15 -0
- package/src/lib/Models/stepMethod.ts +9 -0
- package/src/lib/form-aurora.module.ts +18 -0
- package/src/lib/services/TemplateService.ts +84 -0
- package/src/lib/services/data.service.ts +83 -0
- package/src/lib/utils/regex.ts +51 -0
- package/src/public-api.ts +9 -0
- package/src/test.ts +21 -0
- package/tsconfig.lib.json +26 -0
- package/tsconfig.spec.json +17 -0
- package/tslint.json +17 -0
- package/bundles/form-aurora-stefanini.umd.js +0 -975
- package/bundles/form-aurora-stefanini.umd.js.map +0 -1
- package/bundles/form-aurora-stefanini.umd.min.js +0 -16
- package/bundles/form-aurora-stefanini.umd.min.js.map +0 -1
- package/esm2015/form-aurora-stefanini.js +0 -5
- package/esm2015/lib/fill.js +0 -3
- package/esm2015/lib/form-aurora.component.js +0 -681
- package/esm2015/lib/form-aurora.module.js +0 -22
- package/esm2015/public-api.js +0 -6
- package/esm5/form-aurora-stefanini.js +0 -5
- package/esm5/lib/fill.js +0 -7
- package/esm5/lib/form-aurora.component.js +0 -733
- package/esm5/lib/form-aurora.module.js +0 -25
- package/esm5/public-api.js +0 -6
- package/fesm2015/form-aurora-stefanini.js +0 -703
- package/fesm2015/form-aurora-stefanini.js.map +0 -1
- package/fesm5/form-aurora-stefanini.js +0 -758
- package/fesm5/form-aurora-stefanini.js.map +0 -1
- package/form-aurora-stefanini.d.ts +0 -4
- package/form-aurora-stefanini.metadata.json +0 -1
- package/lib/fill.d.ts +0 -6
- package/lib/form-aurora.component.d.ts +0 -106
- package/lib/form-aurora.module.d.ts +0 -2
- package/public-api.d.ts +0 -2
package/karma.conf.js
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
// Karma configuration file, see link for more information
|
2
|
+
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
3
|
+
|
4
|
+
module.exports = function (config) {
|
5
|
+
config.set({
|
6
|
+
basePath: '',
|
7
|
+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
8
|
+
plugins: [
|
9
|
+
require('karma-jasmine'),
|
10
|
+
require('karma-chrome-launcher'),
|
11
|
+
require('karma-jasmine-html-reporter'),
|
12
|
+
require('karma-coverage-istanbul-reporter'),
|
13
|
+
require('@angular-devkit/build-angular/plugins/karma')
|
14
|
+
],
|
15
|
+
client: {
|
16
|
+
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
17
|
+
},
|
18
|
+
coverageIstanbulReporter: {
|
19
|
+
dir: require('path').join(__dirname, '../../coverage/form-aurora'),
|
20
|
+
reports: ['html', 'lcovonly', 'text-summary'],
|
21
|
+
fixWebpackSourcePaths: true
|
22
|
+
},
|
23
|
+
reporters: ['progress', 'kjhtml'],
|
24
|
+
port: 9876,
|
25
|
+
colors: true,
|
26
|
+
logLevel: config.LOG_INFO,
|
27
|
+
autoWatch: true,
|
28
|
+
browsers: ['Chrome'],
|
29
|
+
singleRun: false,
|
30
|
+
restartOnFileChange: true
|
31
|
+
});
|
32
|
+
};
|
package/ng-package.json
ADDED
package/package.json
CHANGED
@@ -1,28 +1,17 @@
|
|
1
|
-
{
|
2
|
-
"name": "form-aurora-stefanini",
|
3
|
-
"version": "0.1.
|
4
|
-
"license": "Stefanini Colombia",
|
5
|
-
"author": {
|
6
|
-
"name": "Stefanini Colombia",
|
7
|
-
"email": "stefanini.librerias@gmail.com"
|
8
|
-
},
|
9
|
-
"peerDependencies": {
|
10
|
-
"@angular/common": "^8.2.
|
11
|
-
"@angular/core": "^8.2.
|
12
|
-
"ng-recaptcha": "^5.0.0",
|
13
|
-
"moment": "^2.26.0"
|
14
|
-
},
|
15
|
-
"dependencies": {
|
16
|
-
|
17
|
-
|
18
|
-
"main": "bundles/form-aurora-stefanini.umd.js",
|
19
|
-
"module": "fesm5/form-aurora-stefanini.js",
|
20
|
-
"es2015": "fesm2015/form-aurora-stefanini.js",
|
21
|
-
"esm5": "esm5/form-aurora-stefanini.js",
|
22
|
-
"esm2015": "esm2015/form-aurora-stefanini.js",
|
23
|
-
"fesm5": "fesm5/form-aurora-stefanini.js",
|
24
|
-
"fesm2015": "fesm2015/form-aurora-stefanini.js",
|
25
|
-
"typings": "form-aurora-stefanini.d.ts",
|
26
|
-
"metadata": "form-aurora-stefanini.metadata.json",
|
27
|
-
"sideEffects": false
|
28
|
-
}
|
1
|
+
{
|
2
|
+
"name": "form-aurora-stefanini",
|
3
|
+
"version": "0.1.4",
|
4
|
+
"license": "Stefanini Colombia",
|
5
|
+
"author": {
|
6
|
+
"name": "Stefanini Colombia",
|
7
|
+
"email": "stefanini.librerias@gmail.com"
|
8
|
+
},
|
9
|
+
"peerDependencies": {
|
10
|
+
"@angular/common": "^8.2.0",
|
11
|
+
"@angular/core": "^8.2.0",
|
12
|
+
"ng-recaptcha": "^5.0.0",
|
13
|
+
"moment": "^2.26.0"
|
14
|
+
},
|
15
|
+
"dependencies": {
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,117 @@
|
|
1
|
+
form {
|
2
|
+
font-size: 12px;
|
3
|
+
}
|
4
|
+
|
5
|
+
form input,
|
6
|
+
form select {
|
7
|
+
border: 1px solid #e4e4e4;
|
8
|
+
height: 40px;
|
9
|
+
margin-bottom: 5px;
|
10
|
+
}
|
11
|
+
|
12
|
+
.selectContainer select{
|
13
|
+
appearance: none;
|
14
|
+
}
|
15
|
+
.selectContainer::after {
|
16
|
+
content: "\025be";
|
17
|
+
display: table-cell;
|
18
|
+
text-align: center;
|
19
|
+
padding-top: 7px;
|
20
|
+
width: 30px;
|
21
|
+
height: 30px;
|
22
|
+
position: absolute;
|
23
|
+
top: 14px;
|
24
|
+
right: 20px;
|
25
|
+
pointer-events: none;
|
26
|
+
}
|
27
|
+
|
28
|
+
form .error {
|
29
|
+
color: red;
|
30
|
+
font-size: 12px;
|
31
|
+
text-align: left;
|
32
|
+
margin: 0;
|
33
|
+
padding: 0;
|
34
|
+
/*display: flex;*/
|
35
|
+
width: 90%;
|
36
|
+
margin-top: -15px;
|
37
|
+
margin-bottom: 15px;
|
38
|
+
}
|
39
|
+
|
40
|
+
.error:after {
|
41
|
+
content: " ";
|
42
|
+
display: block;
|
43
|
+
}
|
44
|
+
|
45
|
+
.card {
|
46
|
+
width: 90%;
|
47
|
+
margin: 2% auto;
|
48
|
+
border-radius: 12px;
|
49
|
+
}
|
50
|
+
|
51
|
+
/* Extra small devices (portrait phones, less than 576px) */
|
52
|
+
@media (max-width: 412px) {
|
53
|
+
.card {
|
54
|
+
width: 100%;
|
55
|
+
}
|
56
|
+
|
57
|
+
.cnt-captcha {
|
58
|
+
transform: scale(0.77);
|
59
|
+
/*transform-origin: 0;*/
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
/* Extra small devices (portrait phones, less than 576px) */
|
64
|
+
@media (max-width: 575.98px) {
|
65
|
+
.card {
|
66
|
+
width: 100%;
|
67
|
+
}
|
68
|
+
|
69
|
+
.cnt-captcha {
|
70
|
+
transform: scale(0.77);
|
71
|
+
/*transform-origin: 0;*/
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
@media (max-width: 880.98px) {
|
76
|
+
.cnt-captcha {
|
77
|
+
transform: scale(0.82);
|
78
|
+
/*transform-origin: 0;*/
|
79
|
+
}
|
80
|
+
}
|
81
|
+
input[type="date"]::-webkit-calendar-picker-indicator {
|
82
|
+
background: transparent;
|
83
|
+
bottom: 0;
|
84
|
+
color: transparent;
|
85
|
+
cursor: pointer;
|
86
|
+
height: auto;
|
87
|
+
left: 0;
|
88
|
+
position: absolute;
|
89
|
+
right: 0;
|
90
|
+
top: 0;
|
91
|
+
width: auto;
|
92
|
+
}
|
93
|
+
|
94
|
+
form{
|
95
|
+
overflow-y: scroll;
|
96
|
+
overflow-x: hidden;
|
97
|
+
}
|
98
|
+
|
99
|
+
::-webkit-scrollbar {
|
100
|
+
width: 5px;
|
101
|
+
}
|
102
|
+
|
103
|
+
/* Track */
|
104
|
+
::-webkit-scrollbar-track {
|
105
|
+
background: #f5f5f5;
|
106
|
+
}
|
107
|
+
|
108
|
+
/* Handle */
|
109
|
+
::-webkit-scrollbar-thumb {
|
110
|
+
background: #e0e0e0;
|
111
|
+
}
|
112
|
+
|
113
|
+
/* Handle on hover */
|
114
|
+
::-webkit-scrollbar-thumb:hover {
|
115
|
+
background: #bdbdbd;
|
116
|
+
}
|
117
|
+
|
@@ -0,0 +1,343 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<span class="text-center mt-2 d-none d-sm-block" *ngIf="!isSimpleFlow">
|
3
|
+
<img style="width: 115px; height:96px;" [class]="dataClassCss.logo" id="logo">
|
4
|
+
</span>
|
5
|
+
<div class="text-center mt-2 d-none d-sm-block" *ngIf="isSimpleFlow" style="margin-top: 4%!important;">
|
6
|
+
</div>
|
7
|
+
<div class="card-body pt-0">
|
8
|
+
<ng-container *ngIf="schedule">
|
9
|
+
<h4 class="card-title text-center mb-0" [class]="dataClassCss.bienvenida2" style="color: #EE7E0E;">
|
10
|
+
Horarios de atención
|
11
|
+
</h4>
|
12
|
+
<small class="text-center d-block">{{schedule}}</small>
|
13
|
+
</ng-container>
|
14
|
+
<form #formDynamic="ngForm">
|
15
|
+
<div *ngFor="let control of dataForm?.formQuestions; let index = index; trackBy: trackByIndex">
|
16
|
+
<div
|
17
|
+
*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">
|
18
|
+
<div class="row"
|
19
|
+
*ngIf="(index > 0 && (dataForm.formQuestions[index - 1].question.questionType.id == 3 && dataForm.formQuestions[index].question.questionType.id == 2))">
|
20
|
+
<div class="col-lg-6 col-xs-12">
|
21
|
+
<div [class]="dataClassCss.cl12">
|
22
|
+
<label for="{{dataForm.formQuestions[index - 1].question.value}}" class="col-sm-12"
|
23
|
+
style="display: block; text-align: left;">
|
24
|
+
<span class="h6 small bg-white text-muted">{{dataForm.formQuestions[index -
|
25
|
+
1].question.label}}</span>
|
26
|
+
</label>
|
27
|
+
<div class="selectContainer">
|
28
|
+
<select [name]="dataForm.formQuestions[index - 1].question.value"
|
29
|
+
[required]="dataForm.formQuestions[index - 1].question.required"
|
30
|
+
[class]="dataClassCss.formcontrol"
|
31
|
+
id="{{dataForm.formQuestions[index - 1].question.value}}"
|
32
|
+
style="margin-top: -1rem !important;"
|
33
|
+
[(ngModel)]="defaultDocType !== '' ? defaultDocType : dataForm.formQuestions[index - 1].question.registred">
|
34
|
+
<option value="" selected disabled hidden>Selecciona</option>
|
35
|
+
<ng-container
|
36
|
+
*ngFor="let item of dataForm.formQuestions[index - 1].question.questionAnswers">
|
37
|
+
<option *ngIf="item.answer.state.id == 1" [value]="item.answer.value">
|
38
|
+
{{ item.answer.field }}
|
39
|
+
</option>
|
40
|
+
</ng-container>
|
41
|
+
</select>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
<div style="margin-left: 15px;"
|
45
|
+
*ngIf="dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6">
|
46
|
+
<span class="error" [id]="'char'+dataForm.formQuestions[index-1].question.value"
|
47
|
+
hidden></span>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
<div class="col-lg-6 col-xs-12">
|
51
|
+
<div [class]="dataClassCss.cl12">
|
52
|
+
<label for="{{dataForm.formQuestions[index].question.value}}"
|
53
|
+
class="col-sm-12 p-sm-0 px-sm-1" style="display: block; text-align: left;">
|
54
|
+
<span
|
55
|
+
class="h6 small bg-white text-muted pt-1 pl-2 pr-2">{{dataForm.formQuestions[index].question.label}}</span>
|
56
|
+
</label>
|
57
|
+
<input type="text" pattern="\d*" inputmode="numeric"
|
58
|
+
id="{{dataForm.formQuestions[index].question.value}}"
|
59
|
+
style="margin-top: -1rem !important;"
|
60
|
+
[name]="dataForm.formQuestions[index].question.value" placeholder="Escribe"
|
61
|
+
[required]="dataForm.formQuestions[index].question.required"
|
62
|
+
(change)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
63
|
+
(blur)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
64
|
+
(keyup)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
65
|
+
onkeypress="onkeypress($event)"
|
66
|
+
onkeyup="(this.value=(value.replace(/[.]*/g,'')))"
|
67
|
+
maxlength="dataForm.formQuestions[index].question.maxLength"
|
68
|
+
[minLength]="dataForm.formQuestions[index].question.minLength"
|
69
|
+
[(ngModel)]="dataForm.formQuestions[index].question.registred"
|
70
|
+
[class]="dataClassCss.formcontrol" />
|
71
|
+
|
72
|
+
</div>
|
73
|
+
|
74
|
+
<div style="margin-left: 15px;"
|
75
|
+
*ngIf="dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6">
|
76
|
+
<span class="error" [id]="'rq'+dataForm.formQuestions[index].question.value"
|
77
|
+
*ngIf="validRequired(formDynamic,dataForm.formQuestions[index].question) && watchValid">
|
78
|
+
Este campo es obligatorio</span>
|
79
|
+
<span class="error" [id]="'ml'+dataForm.formQuestions[index].question.value" hidden>
|
80
|
+
Debe ser mínimo de
|
81
|
+
{{ dataForm.formQuestions[index].question.minLength }} caracteres</span>
|
82
|
+
<span class="error" [id]="'mxl'+dataForm.formQuestions[index].question.value" hidden>
|
83
|
+
Debe ser maximo de
|
84
|
+
{{ dataForm.formQuestions[index].question.maxLength }} caracteres</span>
|
85
|
+
<span class="error" [id]="'char'+dataForm.formQuestions[index].question.value"
|
86
|
+
hidden></span>
|
87
|
+
<span *ngIf="patternNotValidDcto === true" class="error">Formato no valido</span>
|
88
|
+
</div>
|
89
|
+
</div>
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<ng-template #switchTemp>
|
94
|
+
<div [ngSwitch]="dataForm.formQuestions[index].question.questionType.id">
|
95
|
+
<div *ngSwitchCase="1">
|
96
|
+
<div [class]="dataClassCss.cl12">
|
97
|
+
<label for="{{dataForm.formQuestions[index].question.value}}" class="col-sm-12"
|
98
|
+
style="display: block; text-align: left; ">
|
99
|
+
<span
|
100
|
+
class="h6 small bg-white text-muted pt-1 pl-2 pr-2">{{dataForm.formQuestions[index].question.label}}</span>
|
101
|
+
</label>
|
102
|
+
<input type="text" id="{{dataForm.formQuestions[index].question.value}}"
|
103
|
+
[class]="dataClassCss.formcontrol" placeholder="Escribe"
|
104
|
+
[required]="dataForm.formQuestions[index].question.required"
|
105
|
+
[maxlength]="dataForm.formQuestions[index].question.maxLength"
|
106
|
+
[name]="dataForm.formQuestions[index].question.value"
|
107
|
+
(keydown)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
108
|
+
(change)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
109
|
+
(blur)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
110
|
+
[(ngModel)]="dataForm.formQuestions[index].question.registred"
|
111
|
+
style="margin-top: -1rem !important;" />
|
112
|
+
</div>
|
113
|
+
</div>
|
114
|
+
<div *ngSwitchCase="2">
|
115
|
+
|
116
|
+
<div [class]="dataClassCss.cl12">
|
117
|
+
<label for="{{dataForm.formQuestions[index].question.value}}" class="col-sm-12"
|
118
|
+
style="display: block; text-align: left;">
|
119
|
+
<span
|
120
|
+
class="h6 small bg-white text-muted pt-1 pl-2 pr-2">{{dataForm.formQuestions[index].question.label}}</span>
|
121
|
+
</label>
|
122
|
+
<input type="text" pattern="\d*" inputmode="numeric"
|
123
|
+
id="{{dataForm.formQuestions[index].question.value}}"
|
124
|
+
style="margin-top: -1rem !important;"
|
125
|
+
[name]="dataForm.formQuestions[index].question.value" placeholder="Escribe"
|
126
|
+
[required]="dataForm.formQuestions[index].question.required"
|
127
|
+
(keydown)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
128
|
+
(change)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
129
|
+
(blur)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
130
|
+
onkeypress="onkeypress($event)"
|
131
|
+
onkeyup="(this.value=(value.replace(/[.]*/g,'')))"
|
132
|
+
maxlength="dataForm.formQuestions[index].question.maxLength"
|
133
|
+
[minLength]="dataForm.formQuestions[index].question.minLength"
|
134
|
+
[(ngModel)]="dataForm.formQuestions[index].question.registred"
|
135
|
+
[class]="dataClassCss.formcontrol" />
|
136
|
+
<span *ngIf="patternNotValidCel === true" class="error">Formato no valido</span>
|
137
|
+
</div>
|
138
|
+
|
139
|
+
</div>
|
140
|
+
<div *ngSwitchCase="3">
|
141
|
+
<div [class]="dataClassCss.cl12">
|
142
|
+
<label for="{{dataForm.formQuestions[index].question.value}}" class="col-sm-12"
|
143
|
+
style="display: block; text-align: left;">
|
144
|
+
<span
|
145
|
+
class="h6 small bg-white text-muted">{{dataForm.formQuestions[index].question.label}}</span>
|
146
|
+
</label>
|
147
|
+
<select [name]="dataForm.formQuestions[index].question.value"
|
148
|
+
[required]="dataForm.formQuestions[index].question.required"
|
149
|
+
[class]="dataClassCss.formcontrol"
|
150
|
+
id="{{dataForm.formQuestions[index].question.value}}"
|
151
|
+
style="margin-top: -1rem !important;"
|
152
|
+
[(ngModel)]="defaultDocType !== '' ? defaultDocType : dataForm.formQuestions[index].question.registred">
|
153
|
+
<option value="" selected disabled hidden>Selecciona</option>
|
154
|
+
<ng-container
|
155
|
+
*ngFor="let item of dataForm.formQuestions[index].question.questionAnswers">
|
156
|
+
<option *ngIf="item.answer.state.id == 1" [value]="item.answer.value">
|
157
|
+
{{ item.answer.field }}
|
158
|
+
</option>
|
159
|
+
</ng-container>
|
160
|
+
</select>
|
161
|
+
</div>
|
162
|
+
</div>
|
163
|
+
<div *ngSwitchCase="4">
|
164
|
+
<select class="{{ dataClassCss.formcontrol }} select-checkbox"
|
165
|
+
style="overflow: hidden; border-style: hidden;"
|
166
|
+
[style.height.px]="dataForm.formQuestions[index].question.questionAnswers.length * 24"
|
167
|
+
[name]="dataForm.formQuestions[index].question.value"
|
168
|
+
[required]="dataForm.formQuestions[index].question.required" ngModel multiple>
|
169
|
+
<option
|
170
|
+
(mousemove)="$event.preventDefault()"
|
171
|
+
*ngFor="let item of dataForm.formQuestions[index].question.questionAnswers"
|
172
|
+
[value]="item.answer.value">
|
173
|
+
{{ item.answer.field }}
|
174
|
+
</option>
|
175
|
+
</select>
|
176
|
+
</div>
|
177
|
+
<div *ngSwitchCase="5">
|
178
|
+
<a (click)="rediretoutside($event,dataForm.formQuestions[index].question)" href="">
|
179
|
+
<span>{{ dataForm.formQuestions[index].question.label }}</span>
|
180
|
+
</a>
|
181
|
+
</div>
|
182
|
+
<div *ngSwitchCase="6">
|
183
|
+
<div [class]="dataClassCss.cl12" [id]="'reCaptcha'">
|
184
|
+
<div class="cnt-captcha">
|
185
|
+
<re-captcha (resolved)="resolvedCaptcha($event)"
|
186
|
+
siteKey="6LfQisEZAAAAAARuuKFEAgS-x4qJse5uBA_QCA7v"></re-captcha>
|
187
|
+
<input hidden type="text" [name]="dataForm.formQuestions[index].question.value"
|
188
|
+
[required]="dataForm.formQuestions[index].question.required"
|
189
|
+
[(ngModel)]="dataForm.formQuestions[index].question.registred">
|
190
|
+
</div>
|
191
|
+
<span class="error" *ngIf="watchValid && !captchaValid" style="margin-top: 0;">
|
192
|
+
Debe resolver la captcha para continuar
|
193
|
+
</span>
|
194
|
+
</div>
|
195
|
+
</div>
|
196
|
+
<div *ngSwitchCase="7">
|
197
|
+
<div [class]="dataClassCss.cl12">
|
198
|
+
<label for="{{dataForm.formQuestions[index].question.value}}" class="col-sm-12"
|
199
|
+
style="display: block; text-align: left; margin-bottom: 0 ;">
|
200
|
+
<span
|
201
|
+
class="h6 small bg-white text-muted pt-1 pl-2 pr-2">{{dataForm.formQuestions[index].question.label}}</span>
|
202
|
+
</label>
|
203
|
+
<input placeholder="dd/mm/aaaa" style="margin-top: -0.4rem !important;"
|
204
|
+
[required]="dataForm.formQuestions[index].question.required"
|
205
|
+
[name]="dataForm.formQuestions[index].question.value" type="date" min="{{minDate}}"
|
206
|
+
max="{{maxDate}}" [maxlength]="10" (paste)="false"
|
207
|
+
id="{{dataForm.formQuestions[index].question.value}}"
|
208
|
+
[class]="dataClassCss.txtCalendar"
|
209
|
+
[(ngModel)]="dataForm.formQuestions[index].question.registred"
|
210
|
+
(keydown)="cancellKeypress()"
|
211
|
+
(change)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
212
|
+
(blur)="onChangeValidPatter($event, dataForm.formQuestions[index].question)">
|
213
|
+
|
214
|
+
<button class="btn" id="{{dataForm.formQuestions[index].question.value}}" type="button"
|
215
|
+
style="width: 46px;
|
216
|
+
top: 12px;
|
217
|
+
color: white;
|
218
|
+
right: 15px;
|
219
|
+
position: absolute;
|
220
|
+
background: #D25D42;
|
221
|
+
pointer-events: none;">
|
222
|
+
<i class="fa fa-calendar"></i>
|
223
|
+
</button>
|
224
|
+
|
225
|
+
</div>
|
226
|
+
</div>
|
227
|
+
<div *ngSwitchCase="8">
|
228
|
+
<div [class]="dataClassCss.cl12" style="text-align: left; margin-bottom: 10px;">
|
229
|
+
<input style="width: 4% !important; height: auto !important; display: inline !important;" type="checkbox"
|
230
|
+
[name]="dataForm.formQuestions[index].question.value"
|
231
|
+
[required]="dataForm.formQuestions[index].question.required"
|
232
|
+
[(ngModel)]="dataForm.formQuestions[index].question.registred"
|
233
|
+
[class]="dataClassCss.formcontrol">
|
234
|
+
<!-- (change)="checkTermsAndConditions(dataForm.formQuestions[index].question.registred)" -->
|
235
|
+
|
236
|
+
<!-- <a href="{{urlPdf}}" target="_blank" style="text-decoration: underline;"
|
237
|
+
id="txtPoliticas" (click)="tycSelection()">
|
238
|
+
{{dataForm.formQuestions[index].question.label}}
|
239
|
+
</a> -->
|
240
|
+
<a target="_blank" style="text-decoration: underline;color:blue;cursor: pointer;"
|
241
|
+
id="txtPoliticas" (click)="tycSelection($event)">
|
242
|
+
{{dataForm.formQuestions[index].question.label}}
|
243
|
+
</a>
|
244
|
+
</div>
|
245
|
+
</div>
|
246
|
+
<div *ngSwitchCase="9">
|
247
|
+
<div [class]="dataClassCss.cl12">
|
248
|
+
<label for="{{dataForm.formQuestions[index].question.value}}" class="col-sm-12"
|
249
|
+
style="display: block; text-align: left; ">
|
250
|
+
<span
|
251
|
+
class="h6 small bg-white text-muted pt-1 pl-2 pr-2">{{dataForm.formQuestions[index].question.label}}</span>
|
252
|
+
</label>
|
253
|
+
<input type="text" id="{{dataForm.formQuestions[index].question.value}}"
|
254
|
+
[class]="dataClassCss.formcontrol" placeholder="Escribe"
|
255
|
+
[required]="dataForm.formQuestions[index].question.required"
|
256
|
+
[maxlength]="dataForm.formQuestions[index].question.maxLength"
|
257
|
+
[name]="dataForm.formQuestions[index].question.value"
|
258
|
+
(keydown)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
259
|
+
(change)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
260
|
+
(blur)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
261
|
+
(keypress)="validOnlyText($event)"
|
262
|
+
[(ngModel)]="dataForm.formQuestions[index].question.registred"
|
263
|
+
style="margin-top: -1rem !important;" />
|
264
|
+
</div>
|
265
|
+
</div>
|
266
|
+
<div *ngSwitchCase="10">
|
267
|
+
<div [class]="dataClassCss.cl12" style="text-align: left; margin-bottom: 10px;">
|
268
|
+
<input style="width: 4% !important; height: auto !important; display: inline !important;"
|
269
|
+
type="checkbox" [name]="dataForm.formQuestions[index].question.value"
|
270
|
+
[required]="dataForm.formQuestions[index].question.required"
|
271
|
+
[(ngModel)]="dataForm.formQuestions[index].question.registred">
|
272
|
+
<a target="_blank" style="text-decoration: underline;color:blue;cursor: pointer;"
|
273
|
+
id="check{{dataForm.formQuestions[index].question.id}}"
|
274
|
+
(click)="openLabelUrl($event,dataForm.formQuestions[index].question)">
|
275
|
+
{{dataForm.formQuestions[index].question.label}}
|
276
|
+
</a>
|
277
|
+
</div>
|
278
|
+
</div>
|
279
|
+
<div *ngSwitchCase="11">
|
280
|
+
<div [class]="dataClassCss.cl12">
|
281
|
+
<label for="{{dataForm.formQuestions[index].question.value}}" class="col-sm-12"
|
282
|
+
style="display: block; text-align: left; ">
|
283
|
+
<span
|
284
|
+
class="h6 small bg-white text-muted pt-1 pl-2 pr-2">{{dataForm.formQuestions[index].question.label}}</span>
|
285
|
+
</label>
|
286
|
+
<input type="text" id="{{dataForm.formQuestions[index].question.value}}"
|
287
|
+
[class]="dataClassCss.formcontrol" placeholder="Escribe"
|
288
|
+
[required]="dataForm.formQuestions[index].question.required"
|
289
|
+
[maxlength]="dataForm.formQuestions[index].question.maxLength"
|
290
|
+
[name]="dataForm.formQuestions[index].question.value"
|
291
|
+
(keydown)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
292
|
+
(change)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
293
|
+
(blur)="onChangeValidPatter($event, dataForm.formQuestions[index].question)"
|
294
|
+
(keypress)="validateNotSpace($event)"
|
295
|
+
[(ngModel)]="dataForm.formQuestions[index].question.registred"
|
296
|
+
style="margin-top: -1rem !important;" />
|
297
|
+
</div>
|
298
|
+
</div>
|
299
|
+
<div *ngSwitchDefault>Tipo de control no detectado</div>
|
300
|
+
<div style="margin-left: 15px;"
|
301
|
+
*ngIf="dataForm.formQuestions[index].question.questionType.id != 5 && dataForm.formQuestions[index].question.questionType.id != 6">
|
302
|
+
<span class="error" [id]="'rq'+dataForm.formQuestions[index].question.value"
|
303
|
+
*ngIf="validRequired(formDynamic,dataForm.formQuestions[index].question) && watchValid">
|
304
|
+
Este campo es obligatorio</span>
|
305
|
+
<span class="error" [id]="'ml'+dataForm.formQuestions[index].question.value" hidden>
|
306
|
+
Debe ser mínimo de
|
307
|
+
{{ dataForm.formQuestions[index].question.minLength }} caracteres</span>
|
308
|
+
<span class="error" [id]="'mxl'+dataForm.formQuestions[index].question.value" hidden>
|
309
|
+
Debe ser maximo de
|
310
|
+
{{ dataForm.formQuestions[index].question.maxLength }} caracteres</span>
|
311
|
+
<span class="error" [id]="'char'+dataForm.formQuestions[index].question.value"
|
312
|
+
hidden></span>
|
313
|
+
<span class="error" [id]="dataForm.formQuestions[index].question.id" hidden></span>
|
314
|
+
</div>
|
315
|
+
</div>
|
316
|
+
</ng-template>
|
317
|
+
</div>
|
318
|
+
<section *ngIf="isSimpleFlow">
|
319
|
+
<div *ngFor="let step of steps let index = index; trackBy: trackByIndex">
|
320
|
+
<div [class]="dataClassCss.cl12" *ngIf="step.viewData">
|
321
|
+
<label for="{{step.id}}" class="col-sm-12" style="display: block; text-align: left;">
|
322
|
+
<span class="h6 small bg-white text-muted">{{step.step}}</span>
|
323
|
+
</label>
|
324
|
+
<select [name]="step.step" [required]="true" [class]="dataClassCss.formcontrol" id="{{step.step}}"
|
325
|
+
style="margin-top: -1rem !important;" [(ngModel)]="step.value"
|
326
|
+
(ngModelChange)="onChangeStep(step,steps[index+1],$event)">
|
327
|
+
<option value="" selected disabled hidden>Selecciona</option>
|
328
|
+
<ng-container *ngFor="let subitem of step.viewData">
|
329
|
+
<option [value]="subitem.id">
|
330
|
+
{{ subitem.description }}
|
331
|
+
</option>
|
332
|
+
</ng-container>
|
333
|
+
</select>
|
334
|
+
</div>
|
335
|
+
</div>
|
336
|
+
</section>
|
337
|
+
<div class="mt-3 text-center">
|
338
|
+
<button type="button" [class]="dataClassCss.btn" (click)="onSubmit()" [disabled]="!formDynamic.valid"
|
339
|
+
id="btnIng">Ingresar</button>
|
340
|
+
</div>
|
341
|
+
</form>
|
342
|
+
</div>
|
343
|
+
</div>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
2
|
+
|
3
|
+
import { FormAuroraComponent } from './form-aurora.component';
|
4
|
+
|
5
|
+
describe('FormAuroraComponent', () => {
|
6
|
+
let component: FormAuroraComponent;
|
7
|
+
let fixture: ComponentFixture<FormAuroraComponent>;
|
8
|
+
|
9
|
+
beforeEach(async(() => {
|
10
|
+
TestBed.configureTestingModule({
|
11
|
+
declarations: [ FormAuroraComponent ]
|
12
|
+
})
|
13
|
+
.compileComponents();
|
14
|
+
}));
|
15
|
+
|
16
|
+
beforeEach(() => {
|
17
|
+
fixture = TestBed.createComponent(FormAuroraComponent);
|
18
|
+
component = fixture.componentInstance;
|
19
|
+
fixture.detectChanges();
|
20
|
+
});
|
21
|
+
|
22
|
+
it('should create', () => {
|
23
|
+
expect(component).toBeTruthy();
|
24
|
+
});
|
25
|
+
});
|