@nixweb/nixloc-ui 0.0.121 → 0.0.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/src/component/template/ModeloRelatorioView.drawio +2 -2
- package/docs/src/store/modulos/relatorio.drawio +2 -2
- package/package.json +77 -77
- package/public/styles/app.css +1 -1
- package/src/component/forms/{Botao.vue → Button.vue} +53 -57
- package/src/component/forms/CheckboxGroup.vue +63 -0
- package/src/component/forms/{CheckboxUnico.vue → CheckboxSimple.vue} +8 -8
- package/src/component/forms/{Cor.vue → Color.vue} +9 -9
- package/src/component/forms/DateTime.vue +55 -55
- package/src/component/forms/{BotaoDropdown.vue → Dropdown.vue} +58 -58
- package/src/component/forms/EditorHtml.vue +123 -0
- package/src/component/forms/FileUpload.vue +189 -0
- package/src/component/forms/InputDecimal.vue +137 -0
- package/src/component/forms/InputNumber.vue +149 -0
- package/src/component/forms/InputPassword.vue +135 -0
- package/src/component/forms/InputText.vue +157 -0
- package/src/component/forms/Modal.vue +15 -15
- package/src/component/forms/RadioGroup.vue +50 -0
- package/src/component/forms/Select.vue +337 -0
- package/src/component/forms/SelectStatic.vue +120 -0
- package/src/component/forms/TextArea.vue +126 -0
- package/src/component/forms/Toggle.vue +13 -13
- package/src/component/layout/{Conta.vue → Account.vue} +28 -28
- package/src/component/layout/{Alerta.vue → Alert.vue} +22 -22
- package/src/component/layout/Badge.vue +23 -23
- package/src/component/layout/{BarraFixa.vue → FixedBar.vue} +16 -16
- package/src/component/layout/{Topo.vue → Header.vue} +5 -5
- package/src/component/layout/{CarregandoTelaInteira.vue → LoadingFullPage.vue} +3 -3
- package/src/component/layout/Menu.vue +66 -66
- package/src/component/layout/{Moldura.vue → Molded.vue} +4 -4
- package/src/component/layout/Panel.vue +142 -0
- package/src/component/layout/Popover.vue +1 -1
- package/src/component/layout/{BarraRolagem.vue → Scrollbar.vue} +9 -11
- package/src/component/layout/Tag.vue +15 -15
- package/src/component/layout/Wizard.vue +3 -3
- package/src/component/shared/{CodigoEditor.vue → CodeEditor.vue} +25 -25
- package/src/component/shared/Collapse.vue +131 -0
- package/src/component/shared/Confirmation.vue +80 -0
- package/src/component/shared/{DocumentoEditor.vue → DocumentEditor.vue} +10 -16
- package/src/component/shared/{DocumentoPreview.vue → DocumentPreview.vue} +2 -2
- package/src/component/shared/ExportExcel.vue +67 -0
- package/src/component/shared/{ExportarPDF.vue → ExportPDF.vue} +18 -18
- package/src/component/shared/HeaderPrint.vue +36 -0
- package/src/component/shared/HorizontalFilter.vue +59 -0
- package/src/component/shared/LegendaParametro.vue +22 -22
- package/src/component/shared/{Carregando.vue → Loading.vue} +16 -16
- package/src/component/shared/LoadingMoreButton.vue +23 -0
- package/src/component/shared/Messages.vue +83 -0
- package/src/component/shared/{Paginacao.vue → Pagination.vue} +12 -12
- package/src/component/shared/ProgressBar.vue +21 -0
- package/src/component/shared/{BotaoConsulta.vue → QueryButton.vue} +16 -16
- package/src/component/shared/SaveCancel.vue +56 -0
- package/src/component/shared/{Pesquisa.vue → Search.vue} +46 -46
- package/src/component/shared/Table.vue +243 -0
- package/src/component/shared/TableButton.vue +36 -0
- package/src/component/shared/{Registro.vue → TableTotalRecords.vue} +7 -7
- package/src/component/shared/{ResumoTabela.vue → TableTotalization.vue} +12 -8
- package/src/component/shared/Tip.vue +42 -0
- package/src/component/shared/Toast.vue +7 -7
- package/src/component/shared/{FiltroVertical.vue → VerticalFilter.vue} +24 -24
- package/src/component/shared/query-builder/AddRule.vue +187 -0
- package/src/component/shared/query-builder/ConvertToOdata.js +80 -0
- package/src/component/shared/query-builder/DynamicComponent.vue +107 -0
- package/src/component/shared/query-builder/Fields.vue +127 -0
- package/src/component/shared/query-builder/ListDynamicComponent.vue +42 -0
- package/src/component/shared/query-builder/QueryBuilder.vue +25 -120
- package/src/component/shared/query-builder/{Filtro.vue → Rules.vue} +13 -18
- package/src/component/shared/query-builder/SelectRule.vue +96 -0
- package/src/component/shared/query-builder/Tags.vue +14 -14
- package/src/component/shared/query-builder/{Rodape.vue → Totalization.vue} +10 -10
- package/src/component/template/AddEditReport.vue +106 -0
- package/src/component/template/ListViewWithHandlerData.vue +231 -0
- package/src/component/template/ViewTemplateConfiguration.vue +69 -0
- package/src/component/template/ViewTemplateDocumentView.vue +227 -0
- package/src/component/template/ViewTemplateReportList.vue +230 -0
- package/src/component/template/ViewTemplateReportPreview.vue +500 -0
- package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -0
- package/src/component/template/ViewTemplateWithTable.vue +49 -0
- package/src/component/template/model/Report.js +6 -0
- package/src/component/value-objects/DadosContato.vue +34 -35
- package/src/component/value-objects/DadosPessoa.vue +58 -58
- package/src/component/value-objects/Endereco.vue +96 -97
- package/src/config/dicas.js +1 -1
- package/src/config/token.js +2 -2
- package/src/store/modules/generic.js +489 -0
- package/src/store/modules/report.js +246 -0
- package/src/store/modules/user.js +38 -0
- package/src/store/modules/validation.js +39 -0
- package/src/store/store.js +4 -4
- package/src/component/forms/ArquivoUpload.vue +0 -199
- package/src/component/forms/CheckboxMultiplo.vue +0 -63
- package/src/component/forms/Decimal.vue +0 -137
- package/src/component/forms/Escolher.vue +0 -335
- package/src/component/forms/EscolherEstatico.vue +0 -139
- package/src/component/forms/Numero.vue +0 -153
- package/src/component/forms/Opcoes.vue +0 -51
- package/src/component/forms/Senha.vue +0 -139
- package/src/component/forms/Texto.vue +0 -161
- package/src/component/forms/TextoArea.vue +0 -126
- package/src/component/forms/TextoEditor.vue +0 -123
- package/src/component/layout/Painel.vue +0 -142
- package/src/component/shared/BotaoCarregarMais.vue +0 -23
- package/src/component/shared/CabecalhoImpressao.vue +0 -36
- package/src/component/shared/Confirmacao.vue +0 -80
- package/src/component/shared/Dica.vue +0 -42
- package/src/component/shared/EsconderMostrar.vue +0 -131
- package/src/component/shared/ExportarExcel.vue +0 -67
- package/src/component/shared/FiltroHorizontal.vue +0 -59
- package/src/component/shared/Mensagem.vue +0 -86
- package/src/component/shared/Progresso.vue +0 -21
- package/src/component/shared/SalvarCancelar.vue +0 -56
- package/src/component/shared/Tabela.vue +0 -275
- package/src/component/shared/TabelaBotao.vue +0 -36
- package/src/component/shared/query-builder/Campo.vue +0 -116
- package/src/component/shared/query-builder/ConverteParaOdata.js +0 -77
- package/src/component/shared/query-builder/components/CustomSelect.vue +0 -115
- package/src/component/shared/query-builder/components/QueryBuilderChildren.vue +0 -46
- package/src/component/shared/query-builder/components/QueryBuilderGroup.vue +0 -151
- package/src/component/shared/query-builder/components/QueryBuilderRule.vue +0 -81
- package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapGroup.vue +0 -120
- package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapRule.vue +0 -187
- package/src/component/shared/query-builder/main.js +0 -81
- package/src/component/template/ModeloAdicionarModificarView.vue +0 -32
- package/src/component/template/ModeloDocumentoView.vue +0 -227
- package/src/component/template/ModeloLista.vue +0 -231
- package/src/component/template/ModeloRelatorioListaView.vue +0 -227
- package/src/component/template/ModeloRelatorioView.vue +0 -489
- package/src/component/template/ModeloSubView.vue +0 -69
- package/src/component/template/ModeloView.vue +0 -49
- package/src/component/template/Relatorio.js +0 -10
- package/src/component/template/RelatorioAdicionarModificar.vue +0 -106
- package/src/store/modulos/generic.js +0 -494
- package/src/store/modulos/relatorio.js +0 -204
- package/src/store/modulos/usuario.js +0 -38
- package/src/store/modulos/validation.js +0 -39
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="form-group">
|
|
3
|
-
<label>
|
|
4
|
-
<span class="titulo">{{ titulo }}</span>
|
|
5
|
-
<span class="requerido" v-if="requerido">*</span>
|
|
6
|
-
<Dica :campo="campo" :formNome="formNome" />
|
|
7
|
-
</label>
|
|
8
|
-
<div class="inner-addon right-addon">
|
|
9
|
-
<i
|
|
10
|
-
v-if="notificacoes.length > 0 && formSujo"
|
|
11
|
-
class="requerido glyphicon fas fa-exclamation-triangle"
|
|
12
|
-
></i>
|
|
13
|
-
<slot v-else></slot>
|
|
14
|
-
<input
|
|
15
|
-
class="form-control"
|
|
16
|
-
type="number"
|
|
17
|
-
v-model="valor"
|
|
18
|
-
@keyup.enter.prevent="apertouEnter"
|
|
19
|
-
/>
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
|
-
<div v-if="formSujo">
|
|
23
|
-
<div v-for="mensagem in notificacoes" :key="mensagem">
|
|
24
|
-
<span class="invalido">{{ mensagem }}</span>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<script>
|
|
31
|
-
import Dica from "../shared/Dica.vue";
|
|
32
|
-
|
|
33
|
-
import { mapState, mapMutations } from "vuex";
|
|
34
|
-
|
|
35
|
-
export default {
|
|
36
|
-
name: "Numero",
|
|
37
|
-
components: { Dica },
|
|
38
|
-
props: {
|
|
39
|
-
titulo: String,
|
|
40
|
-
campo: String,
|
|
41
|
-
placeholder: String,
|
|
42
|
-
desabilitado: Boolean,
|
|
43
|
-
formNome: String,
|
|
44
|
-
requerido: Boolean,
|
|
45
|
-
tamanhoMaximo: Number,
|
|
46
|
-
tipo: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: "float",
|
|
49
|
-
},
|
|
50
|
-
marcarFormSujo: {
|
|
51
|
-
type: Boolean,
|
|
52
|
-
default: true,
|
|
53
|
-
},
|
|
54
|
-
value: Number,
|
|
55
|
-
alterou: Function,
|
|
56
|
-
enter: Function,
|
|
57
|
-
},
|
|
58
|
-
data() {
|
|
59
|
-
return {
|
|
60
|
-
notificacoes: [],
|
|
61
|
-
formSujo: false,
|
|
62
|
-
valor: 0,
|
|
63
|
-
precision: 1,
|
|
64
|
-
};
|
|
65
|
-
},
|
|
66
|
-
created() {
|
|
67
|
-
// não carregar as validações iniciais para number
|
|
68
|
-
this.valor = this.value;
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
methods: {
|
|
72
|
-
...mapMutations("validation", [
|
|
73
|
-
"insereValidacao",
|
|
74
|
-
"removeValidacao",
|
|
75
|
-
"insereFormSujo",
|
|
76
|
-
]),
|
|
77
|
-
valida() {
|
|
78
|
-
this.notificacoes = [];
|
|
79
|
-
if (this.value == 0) return;
|
|
80
|
-
if (this.requerido && !this.value) {
|
|
81
|
-
var mensagem = `${this.titulo} não pode ser vazio!`;
|
|
82
|
-
this.notificacoes.push(mensagem);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (this.valor.toString().length > this.tamanhoMaximo) {
|
|
86
|
-
var mensagem = `Valor inválido!`;
|
|
87
|
-
this.notificacoes.push(mensagem);
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
apertouEnter() {
|
|
91
|
-
if (this.enter) this.enter();
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
computed: {
|
|
95
|
-
...mapState("validation", ["reiniciaForm"]),
|
|
96
|
-
},
|
|
97
|
-
watch: {
|
|
98
|
-
value() {
|
|
99
|
-
this.valor = this.value;
|
|
100
|
-
if (this.alterou) this.alterou();
|
|
101
|
-
},
|
|
102
|
-
valor() {
|
|
103
|
-
this.valida();
|
|
104
|
-
|
|
105
|
-
let valor;
|
|
106
|
-
if (this.tipo === "int") valor = parseInt(this.valor);
|
|
107
|
-
if (this.tipo === "float") valor = parseFloat(this.valor);
|
|
108
|
-
|
|
109
|
-
this.$emit("input", valor);
|
|
110
|
-
this.formSujo = true;
|
|
111
|
-
if (this.marcarFormSujo) this.insereFormSujo(true);
|
|
112
|
-
|
|
113
|
-
this.valor = valor;
|
|
114
|
-
},
|
|
115
|
-
notificacoes() {
|
|
116
|
-
let self = this;
|
|
117
|
-
this.notificacoes.forEach(function (notificacao) {
|
|
118
|
-
let obj = {
|
|
119
|
-
chave: self.campo + "&" + self.formNome,
|
|
120
|
-
formNome: self.formNome,
|
|
121
|
-
notificacao: notificacao,
|
|
122
|
-
};
|
|
123
|
-
self.insereValidacao(obj);
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
if (this.notificacoes.length == 0) {
|
|
127
|
-
let obj = {
|
|
128
|
-
chave: self.campo + "&" + self.formNome,
|
|
129
|
-
formNome: self.formNome,
|
|
130
|
-
};
|
|
131
|
-
self.removeValidacao(obj);
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
reiniciaForm: {
|
|
135
|
-
handler(form) {
|
|
136
|
-
if (form.nome == this.formNome) this.formSujo = false;
|
|
137
|
-
},
|
|
138
|
-
deep: true,
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
};
|
|
142
|
-
</script>
|
|
143
|
-
|
|
144
|
-
<style scoped>
|
|
145
|
-
.sucesso {
|
|
146
|
-
color: #94aa2a;
|
|
147
|
-
font-size: 14px;
|
|
148
|
-
}
|
|
149
|
-
.invalido {
|
|
150
|
-
color: #f0134d;
|
|
151
|
-
font-size: 14px;
|
|
152
|
-
}
|
|
153
|
-
</style>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<span class="titulo">{{ titulo }}</span>
|
|
4
|
-
<Dica :campo="campo" :formNome="formNome" />
|
|
5
|
-
<div class="opcoes">
|
|
6
|
-
<b-form-group>
|
|
7
|
-
<b-form-radio-group
|
|
8
|
-
v-model="selecionado"
|
|
9
|
-
:options="opcoes"
|
|
10
|
-
:disabled="desabilitado"
|
|
11
|
-
></b-form-radio-group>
|
|
12
|
-
</b-form-group>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
import Dica from "../shared/Dica.vue";
|
|
19
|
-
|
|
20
|
-
import { mapState, mapMutations } from "vuex";
|
|
21
|
-
|
|
22
|
-
export default {
|
|
23
|
-
components: { Dica },
|
|
24
|
-
name: "Opcoes",
|
|
25
|
-
props: ["titulo", "opcoes", "value", "alterou", "campo", "formNome", "desabilitado"],
|
|
26
|
-
data() {
|
|
27
|
-
return {
|
|
28
|
-
selecionado: this.value,
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
methods: {
|
|
32
|
-
...mapMutations("validation", ["insereFormSujo"]),
|
|
33
|
-
},
|
|
34
|
-
watch: {
|
|
35
|
-
value() {
|
|
36
|
-
this.selecionado = this.value;
|
|
37
|
-
},
|
|
38
|
-
selecionado() {
|
|
39
|
-
this.$emit("input", this.selecionado);
|
|
40
|
-
this.insereFormSujo(true);
|
|
41
|
-
if (this.alterou) this.alterou();
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
</script>
|
|
46
|
-
<style scoped>
|
|
47
|
-
.opcoes {
|
|
48
|
-
margin-top: 5px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
</style>
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="form-group">
|
|
3
|
-
<label>
|
|
4
|
-
<span class="titulo" :style="'color: ' + corTitulo">{{ titulo }} </span>
|
|
5
|
-
<span class="requerido" v-if="requerido">*</span>
|
|
6
|
-
<Dica :campo="campo" :formNome="formNome" />
|
|
7
|
-
</label>
|
|
8
|
-
<div class="inner-addon right-addon">
|
|
9
|
-
<i
|
|
10
|
-
v-if="notificacoes.length > 0 && formSujo"
|
|
11
|
-
class="requerido glyphicon fas fa-exclamation-triangle"
|
|
12
|
-
></i>
|
|
13
|
-
<slot v-else></slot>
|
|
14
|
-
<input
|
|
15
|
-
type="password"
|
|
16
|
-
:placeholder="placeholder"
|
|
17
|
-
v-mask="mascara || semMascara"
|
|
18
|
-
v-bind:value="value"
|
|
19
|
-
v-on:input="$emit('input', $event.target.value)"
|
|
20
|
-
class="form-control"
|
|
21
|
-
:class="{ requerido: notificacoes.length > 0 && formSujo }"
|
|
22
|
-
/>
|
|
23
|
-
</div>
|
|
24
|
-
<div v-if="formSujo">
|
|
25
|
-
<div v-for="mensagem in notificacoes" :key="mensagem">
|
|
26
|
-
<span class="invalido">{{ mensagem }}</span>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script>
|
|
33
|
-
import Dica from "../shared/Dica.vue";
|
|
34
|
-
import { mapState, mapMutations } from "vuex";
|
|
35
|
-
|
|
36
|
-
export default {
|
|
37
|
-
components: { Dica },
|
|
38
|
-
name: "Senha",
|
|
39
|
-
mixins: [],
|
|
40
|
-
props: [
|
|
41
|
-
"titulo",
|
|
42
|
-
"campo",
|
|
43
|
-
"corTitulo",
|
|
44
|
-
"placeholder",
|
|
45
|
-
"mascara",
|
|
46
|
-
"formNome",
|
|
47
|
-
"requerido",
|
|
48
|
-
"tamanhoMaximo",
|
|
49
|
-
"value",
|
|
50
|
-
],
|
|
51
|
-
data() {
|
|
52
|
-
return {
|
|
53
|
-
notificacoes: [],
|
|
54
|
-
formSujo: false,
|
|
55
|
-
semMascara: {
|
|
56
|
-
mask: "*".repeat(255),
|
|
57
|
-
tokens: {
|
|
58
|
-
"*": { pattern: /./ },
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
},
|
|
63
|
-
created() {
|
|
64
|
-
this.valida();
|
|
65
|
-
},
|
|
66
|
-
methods: {
|
|
67
|
-
...mapMutations("validation", [
|
|
68
|
-
"insereValidacao",
|
|
69
|
-
"removeValidacao",
|
|
70
|
-
"insereFormSujo",
|
|
71
|
-
]),
|
|
72
|
-
valida() {
|
|
73
|
-
this.notificacoes = [];
|
|
74
|
-
|
|
75
|
-
if (this.requerido && this.value.length == 0) {
|
|
76
|
-
var mensagem = `${this.titulo} não pode ser vazio!`;
|
|
77
|
-
this.notificacoes.push(mensagem);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (this.tamanhoMaximo > 0) {
|
|
81
|
-
if (this.value.length > this.tamanhoMaximo) {
|
|
82
|
-
var mensagem = `Máximo de ${this.tamanhoMaximo} caracteres!`;
|
|
83
|
-
this.notificacoes.push(mensagem);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
computed: {
|
|
89
|
-
...mapState("validation", ["reiniciaForm", "validacao"]),
|
|
90
|
-
},
|
|
91
|
-
watch: {
|
|
92
|
-
value() {
|
|
93
|
-
this.valida();
|
|
94
|
-
this.formSujo = true;
|
|
95
|
-
this.insereFormSujo(true);
|
|
96
|
-
},
|
|
97
|
-
notificacoes() {
|
|
98
|
-
let self = this;
|
|
99
|
-
this.notificacoes.forEach(function (notificacao) {
|
|
100
|
-
let obj = {
|
|
101
|
-
chave: self.campo + "&" + self.formNome,
|
|
102
|
-
formNome: self.formNome,
|
|
103
|
-
notificacao: notificacao,
|
|
104
|
-
};
|
|
105
|
-
self.insereValidacao(obj);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
if (this.notificacoes.length == 0) {
|
|
109
|
-
let obj = {
|
|
110
|
-
chave: self.campo + "&" + self.formNome,
|
|
111
|
-
formNome: self.formNome,
|
|
112
|
-
};
|
|
113
|
-
self.removeValidacao(obj);
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
reiniciaForm: {
|
|
117
|
-
handler(form) {
|
|
118
|
-
if (form.nome == this.formNome) this.formSujo = false;
|
|
119
|
-
},
|
|
120
|
-
deep: true,
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
</script>
|
|
125
|
-
|
|
126
|
-
<style scoped>
|
|
127
|
-
.sucesso {
|
|
128
|
-
color: #94aa2a;
|
|
129
|
-
font-size: 14px;
|
|
130
|
-
}
|
|
131
|
-
.invalido {
|
|
132
|
-
color: #f0134d;
|
|
133
|
-
font-size: 14px;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.margem-botao {
|
|
137
|
-
margin-top: -10px;
|
|
138
|
-
}
|
|
139
|
-
</style>
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="form-group">
|
|
3
|
-
<label>
|
|
4
|
-
<span class="titulo" :style="'color: ' + corTitulo">{{ titulo }} </span>
|
|
5
|
-
<span class="requerido" v-if="requerido">*</span>
|
|
6
|
-
<Dica :campo="campo" :formNome="formNome" />
|
|
7
|
-
</label>
|
|
8
|
-
<div class="inner-addon right-addon">
|
|
9
|
-
<div class="requerido glyphicon" v-if="notificacoes.length > 0 && formSujo">
|
|
10
|
-
<i class="fas fa-exclamation-triangle"></i>
|
|
11
|
-
</div>
|
|
12
|
-
<slot v-else></slot>
|
|
13
|
-
<input
|
|
14
|
-
type="text"
|
|
15
|
-
:style="estilo"
|
|
16
|
-
:placeholder="placeholder"
|
|
17
|
-
:disabled="desabilitado"
|
|
18
|
-
@keyup.enter.prevent="apertouEnter"
|
|
19
|
-
@keyup="limpouCampo"
|
|
20
|
-
@blur="saiuCampo"
|
|
21
|
-
v-mask="mascara || semMascara"
|
|
22
|
-
v-bind:value="value"
|
|
23
|
-
v-on:input="$emit('input', $event.target.value)"
|
|
24
|
-
class="form-control"
|
|
25
|
-
:class="{ requerido: notificacoes.length > 0 && formSujo }"
|
|
26
|
-
/>
|
|
27
|
-
</div>
|
|
28
|
-
<div v-if="formSujo">
|
|
29
|
-
<div v-for="mensagem in notificacoes" :key="mensagem">
|
|
30
|
-
<span class="invalido">{{ mensagem }}</span>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<script>
|
|
37
|
-
import Dica from "../shared/Dica.vue";
|
|
38
|
-
import { mapState, mapMutations } from "vuex";
|
|
39
|
-
|
|
40
|
-
export default {
|
|
41
|
-
components: { Dica },
|
|
42
|
-
name: "Texto",
|
|
43
|
-
props: [
|
|
44
|
-
"titulo",
|
|
45
|
-
"campo",
|
|
46
|
-
"placeholder",
|
|
47
|
-
"desabilitado",
|
|
48
|
-
"corTitulo",
|
|
49
|
-
"mascara",
|
|
50
|
-
"estilo",
|
|
51
|
-
"formNome",
|
|
52
|
-
"requerido",
|
|
53
|
-
"tamanhoMaximo",
|
|
54
|
-
"value",
|
|
55
|
-
"enter",
|
|
56
|
-
"limpou",
|
|
57
|
-
"saiu",
|
|
58
|
-
"marcarFormSujo",
|
|
59
|
-
],
|
|
60
|
-
data() {
|
|
61
|
-
return {
|
|
62
|
-
notificacoes: [],
|
|
63
|
-
formSujo: false,
|
|
64
|
-
semMascara: {
|
|
65
|
-
mask: "*".repeat(255),
|
|
66
|
-
tokens: {
|
|
67
|
-
"*": { pattern: /./ },
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
created() {
|
|
73
|
-
this.valida();
|
|
74
|
-
},
|
|
75
|
-
methods: {
|
|
76
|
-
...mapMutations("validation", [
|
|
77
|
-
"insereValidacao",
|
|
78
|
-
"removeValidacao",
|
|
79
|
-
"insereFormSujo",
|
|
80
|
-
]),
|
|
81
|
-
valida() {
|
|
82
|
-
this.notificacoes = [];
|
|
83
|
-
|
|
84
|
-
if (this.requerido && this.value.length == 0) {
|
|
85
|
-
var mensagem = `${this.titulo} não pode ser vazio!`;
|
|
86
|
-
this.notificacoes.push(mensagem);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (this.tamanhoMaximo > 0) {
|
|
90
|
-
if (this.value.length > this.tamanhoMaximo) {
|
|
91
|
-
var mensagem = `Máximo de ${this.tamanhoMaximo} caracteres!`;
|
|
92
|
-
this.notificacoes.push(mensagem);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
apertouEnter() {
|
|
97
|
-
if (this.enter) this.enter();
|
|
98
|
-
},
|
|
99
|
-
saiuCampo() {
|
|
100
|
-
if (this.saiu) this.saiu();
|
|
101
|
-
},
|
|
102
|
-
limpouCampo() {
|
|
103
|
-
if (this.value.length == 0) {
|
|
104
|
-
if (this.limpou) this.limpou();
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
computed: {
|
|
109
|
-
...mapState("validation", ["reiniciaForm", "validacao"]),
|
|
110
|
-
},
|
|
111
|
-
watch: {
|
|
112
|
-
value() {
|
|
113
|
-
this.valida();
|
|
114
|
-
this.formSujo = true;
|
|
115
|
-
// inverti a validação devido não colocar o default como true no props
|
|
116
|
-
var valor = this.marcarFormSujo == undefined ? true : this.marcarFormSujo;
|
|
117
|
-
if (valor) this.insereFormSujo(true);
|
|
118
|
-
},
|
|
119
|
-
notificacoes() {
|
|
120
|
-
let self = this;
|
|
121
|
-
this.notificacoes.forEach(function (notificacao) {
|
|
122
|
-
let obj = {
|
|
123
|
-
chave: self.campo + "&" + self.formNome,
|
|
124
|
-
formNome: self.formNome,
|
|
125
|
-
notificacao: notificacao,
|
|
126
|
-
};
|
|
127
|
-
self.insereValidacao(obj);
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
if (this.notificacoes.length == 0) {
|
|
131
|
-
let obj = {
|
|
132
|
-
chave: self.campo + "&" + self.formNome,
|
|
133
|
-
formNome: self.formNome,
|
|
134
|
-
};
|
|
135
|
-
self.removeValidacao(obj);
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
reiniciaForm: {
|
|
139
|
-
handler(form) {
|
|
140
|
-
if (form.nome == this.formNome) this.formSujo = false;
|
|
141
|
-
},
|
|
142
|
-
deep: true,
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
</script>
|
|
147
|
-
|
|
148
|
-
<style scoped>
|
|
149
|
-
.sucesso {
|
|
150
|
-
color: #94aa2a;
|
|
151
|
-
font-size: 14px;
|
|
152
|
-
}
|
|
153
|
-
.invalido {
|
|
154
|
-
color: #f0134d;
|
|
155
|
-
font-size: 14px;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.margem-botao {
|
|
159
|
-
margin-top: -3px;
|
|
160
|
-
}
|
|
161
|
-
</style>
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="form-group">
|
|
3
|
-
<label>
|
|
4
|
-
<span class="titulo">{{ titulo }}</span>
|
|
5
|
-
<span class="requerido" v-if="requerido">*</span>
|
|
6
|
-
<Dica :campo="campo" :formNome="formNome" />
|
|
7
|
-
</label>
|
|
8
|
-
<div class="inner-addon right-addon">
|
|
9
|
-
<i
|
|
10
|
-
v-if="notificacoes.length > 0 && formSujo"
|
|
11
|
-
class="requerido glyphicon fas fa-exclamation-triangle"
|
|
12
|
-
></i>
|
|
13
|
-
|
|
14
|
-
<textarea
|
|
15
|
-
type="text"
|
|
16
|
-
:placeholder="placeholder"
|
|
17
|
-
v-bind:value="value"
|
|
18
|
-
v-on:input="$emit('input', $event.target.value)"
|
|
19
|
-
class="form-control"
|
|
20
|
-
:class="{ 'is-invalid': notificacoes.length > 0 && formSujo }"
|
|
21
|
-
></textarea>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<div v-if="formSujo">
|
|
25
|
-
<div v-for="mensagem in notificacoes" :key="mensagem">
|
|
26
|
-
<span class="invalido">{{ mensagem }}</span>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script>
|
|
33
|
-
import Dica from "../shared/Dica.vue";
|
|
34
|
-
import { mapState, mapMutations } from "vuex";
|
|
35
|
-
|
|
36
|
-
export default {
|
|
37
|
-
components: { Dica },
|
|
38
|
-
name: "TextoArea",
|
|
39
|
-
props: {
|
|
40
|
-
titulo: String,
|
|
41
|
-
campo: String,
|
|
42
|
-
placeholder: String,
|
|
43
|
-
formNome: String,
|
|
44
|
-
requerido: Boolean,
|
|
45
|
-
tamanhoMaximo: Number,
|
|
46
|
-
value: String,
|
|
47
|
-
},
|
|
48
|
-
data() {
|
|
49
|
-
return {
|
|
50
|
-
notificacoes: [],
|
|
51
|
-
formSujo: false,
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
created() {
|
|
55
|
-
this.valida();
|
|
56
|
-
},
|
|
57
|
-
methods: {
|
|
58
|
-
...mapMutations("validation", [
|
|
59
|
-
"insereValidacao",
|
|
60
|
-
"removeValidacao",
|
|
61
|
-
"insereFormSujo",
|
|
62
|
-
]),
|
|
63
|
-
valida() {
|
|
64
|
-
this.notificacoes = [];
|
|
65
|
-
|
|
66
|
-
if (this.requerido && this.value.length == 0) {
|
|
67
|
-
var mensagem = `${this.titulo} não pode ser vazio!`;
|
|
68
|
-
this.notificacoes.push(mensagem);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (this.tamanhoMaximo > 0) {
|
|
72
|
-
if (this.value.length > this.tamanhoMaximo) {
|
|
73
|
-
var mensagem = `Máximo de ${this.tamanhoMaximo} caracteres!`;
|
|
74
|
-
this.notificacoes.push(mensagem);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
computed: {
|
|
80
|
-
...mapState("validation", ["reiniciaForm", "validacao"]),
|
|
81
|
-
},
|
|
82
|
-
watch: {
|
|
83
|
-
value() {
|
|
84
|
-
this.valida();
|
|
85
|
-
this.formSujo = true;
|
|
86
|
-
this.insereFormSujo(true);
|
|
87
|
-
},
|
|
88
|
-
notificacoes() {
|
|
89
|
-
let self = this;
|
|
90
|
-
this.notificacoes.forEach(function (notificacao) {
|
|
91
|
-
let obj = {
|
|
92
|
-
chave: self.campo + "&" + self.formNome,
|
|
93
|
-
formNome: self.formNome,
|
|
94
|
-
notificacao: notificacao,
|
|
95
|
-
};
|
|
96
|
-
self.insereValidacao(obj);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
if (this.notificacoes.length == 0) {
|
|
100
|
-
let obj = {
|
|
101
|
-
chave: self.campo + "&" + self.formNome,
|
|
102
|
-
formNome: self.formNome,
|
|
103
|
-
};
|
|
104
|
-
self.removeValidacao(obj);
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
reiniciaForm: {
|
|
108
|
-
handler(form) {
|
|
109
|
-
if (form.nome == this.formNome) this.formSujo = false;
|
|
110
|
-
},
|
|
111
|
-
deep: true,
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
</script>
|
|
116
|
-
|
|
117
|
-
<style scoped>
|
|
118
|
-
.sucesso {
|
|
119
|
-
color: #94aa2a;
|
|
120
|
-
font-size: 14px;
|
|
121
|
-
}
|
|
122
|
-
.invalido {
|
|
123
|
-
color: #f0134d;
|
|
124
|
-
font-size: 14px;
|
|
125
|
-
}
|
|
126
|
-
</style>
|