@nixweb/nixloc-ui 0.0.62 → 0.0.65

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nixweb/nixloc-ui",
3
- "version": "0.0.62",
3
+ "version": "0.0.65",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -60,6 +60,10 @@ export default {
60
60
  type: Boolean,
61
61
  default: false,
62
62
  },
63
+ somenteConsulta: {
64
+ type: Boolean,
65
+ default: false,
66
+ },
63
67
  dados: Array,
64
68
  value: Object,
65
69
  },
@@ -84,7 +88,7 @@ export default {
84
88
  aoSelecionar(value) {
85
89
  this.$emit("input", value);
86
90
  let obj = { campoAlvo: this.campoAlvo, valor: value.id };
87
- this.insereFiltro(obj);
91
+ if (!this.somenteConsulta) this.insereFiltro(obj);
88
92
  },
89
93
  aoPesquisar(value) {},
90
94
  rotulo(value) {
@@ -11,20 +11,9 @@
11
11
  class="requerido glyphicon fas fa-exclamation-triangle"
12
12
  ></i>
13
13
  <slot v-else></slot>
14
- <!-- <vue-numeric
15
- class="form-control"
16
- v-on:keyup.enter.native="apertouEnter"
17
- :class="{ 'is-invalid': notificacoes.length > 0 && formSujo }"
18
- :placeholder="placeholder"
19
- :disabled="desabilitado"
20
- separator="."
21
- v-bind:precision="1"
22
- v-model="valor"
23
- ></vue-numeric>-->
24
14
  <input
25
15
  class="form-control"
26
16
  type="number"
27
- v-int
28
17
  v-model="valor"
29
18
  @keyup.enter.prevent="apertouEnter"
30
19
  />
@@ -40,13 +29,12 @@
40
29
 
41
30
  <script>
42
31
  import Dica from "../shared/Dica.vue";
43
- import VueNumeric from "vue-numeric";
44
32
 
45
33
  import { mapState, mapMutations } from "vuex";
46
34
 
47
35
  export default {
48
36
  name: "Numero",
49
- components: { Dica, VueNumeric },
37
+ components: { Dica },
50
38
  props: {
51
39
  titulo: String,
52
40
  campo: String,
@@ -54,6 +42,11 @@ export default {
54
42
  desabilitado: Boolean,
55
43
  formNome: String,
56
44
  requerido: Boolean,
45
+ tamanhoMaximo: Number,
46
+ tipo: {
47
+ type: String,
48
+ default: "float",
49
+ },
57
50
  value: Number,
58
51
  alterou: Function,
59
52
  enter: Function,
@@ -72,7 +65,11 @@ export default {
72
65
  },
73
66
 
74
67
  methods: {
75
- ...mapMutations("validation", ["insereValidacao", "removeValidacao"]),
68
+ ...mapMutations("validation", [
69
+ "insereValidacao",
70
+ "removeValidacao",
71
+ "insereFormSujo",
72
+ ]),
76
73
  valida() {
77
74
  this.notificacoes = [];
78
75
  if (this.value == 0) return;
@@ -80,6 +77,11 @@ export default {
80
77
  var mensagem = `${this.titulo} não pode ser vazio!`;
81
78
  this.notificacoes.push(mensagem);
82
79
  }
80
+
81
+ if (this.valor.toString().length > this.tamanhoMaximo) {
82
+ var mensagem = `Valor inválido!`;
83
+ this.notificacoes.push(mensagem);
84
+ }
83
85
  },
84
86
  apertouEnter() {
85
87
  if (this.enter) this.enter();
@@ -95,8 +97,16 @@ export default {
95
97
  },
96
98
  valor() {
97
99
  this.valida();
100
+
101
+ let valor;
102
+ if (this.tipo === "int") valor = parseInt(this.valor);
103
+ if (this.tipo === "float") valor = parseFloat(this.valor);
104
+
105
+ this.$emit("input", valor);
98
106
  this.formSujo = true;
99
- this.$emit("input", this.valor);
107
+ this.insereFormSujo(true);
108
+
109
+ this.valor = valor;
100
110
  },
101
111
  notificacoes() {
102
112
  let self = this;
@@ -16,6 +16,9 @@
16
16
 
17
17
  <script>
18
18
  import Dica from "../shared/Dica.vue";
19
+
20
+ import { mapState, mapMutations } from "vuex";
21
+
19
22
  export default {
20
23
  components: { Dica },
21
24
  name: "Opcoes",
@@ -25,12 +28,16 @@ export default {
25
28
  selecionado: this.value,
26
29
  };
27
30
  },
31
+ methods: {
32
+ ...mapMutations("validation", ["insereFormSujo"]),
33
+ },
28
34
  watch: {
29
35
  value() {
30
36
  this.selecionado = this.value;
31
37
  },
32
38
  selecionado() {
33
39
  this.$emit("input", this.selecionado);
40
+ this.insereFormSujo(true);
34
41
  if (this.alterou) this.alterou();
35
42
  },
36
43
  },
@@ -41,3 +48,4 @@ export default {
41
48
  margin-top: 5px;
42
49
  }
43
50
  </style>
51
+
@@ -8,7 +8,7 @@
8
8
  :class="sessaoDestaque('home')"
9
9
  >
10
10
  <div class="div-icone lado-a-lado" :style="'background-color:' + corBase">
11
- <i class="fa fa-home icone" aria-hidden="true"></i>
11
+ <i class="fas fa-chart-area icone" aria-hidden="true"></i>
12
12
  </div>
13
13
  <div class="lado-a-lado titulo">Dashboard</div>
14
14
  </a>
@@ -133,7 +133,7 @@ export default {
133
133
  .div-icone {
134
134
  width: 30px;
135
135
  height: 30px;
136
- padding-left: 6px;
136
+ text-align: center;
137
137
  padding-top: 3px;
138
138
  border-radius: 8px;
139
139
  }
@@ -147,6 +147,5 @@ export default {
147
147
  margin-left: 15px;
148
148
  }
149
149
 
150
- .seta {
151
- }
150
+
152
151
  </style>
@@ -32,8 +32,8 @@
32
32
  </div>
33
33
  </div>
34
34
  <br v-show="mostrarBotoes || mostrarPesquisa" />
35
- <div class="row" v-show="mostrarBotoes || mostrarPesquisa">
36
- <div class="col-8">
35
+ <div v-show="mostrarBotoes || mostrarPesquisa">
36
+ <div>
37
37
  <div v-show="mostrarPesquisa"><Pesquisa /></div>
38
38
  </div>
39
39
  </div>
@@ -1,16 +1,30 @@
1
1
  <template>
2
2
  <b-row>
3
- <b-col xs="12" sm="12" md="12" lg="7" xl="7">
4
- <input
5
- type="text"
6
- name="pesquisar"
7
- placeholder="Pesquisar ..."
8
- @keyup="verificaLimpaPesquisa()"
9
- @keyup.enter.prevent="buscaPesquisa()"
10
- v-model="pesquisa"
3
+ <b-col xs="12" sm="12" md="12" lg="5" xl="5">
4
+ <div class="margem">
5
+ <input
6
+ type="text"
7
+ name="pesquisar"
8
+ placeholder="Pesquisar ..."
9
+ @keyup="verificaLimpaPesquisa()"
10
+ @keyup.enter.prevent="buscaPesquisa()"
11
+ v-model="pesquisa.conteudo"
12
+ />
13
+ </div>
14
+ </b-col>
15
+ <b-col xs="12" sm="12" md="12" lg="2" xl="2">
16
+ <EscolherEstatico
17
+ campoAlvo="filtro"
18
+ :somenteConsulta="true"
19
+ :valorInicial="{ conteudo: 'Contém', id: 'contem' }"
20
+ v-model="pesquisa.filtro"
21
+ :dados="[
22
+ { conteudo: 'Contém', id: 'contem' },
23
+ { conteudo: 'Igual', id: 'igual' },
24
+ ]"
11
25
  />
12
26
  </b-col>
13
- <b-col xs="12" sm="12" md="12" lg="5" xl="5">
27
+ <b-col xs="4" sm="4" md="4" lg="4" xl="4">
14
28
  <div class="div-botao">
15
29
  <Botao
16
30
  chave="pesquisar"
@@ -35,11 +49,12 @@
35
49
 
36
50
  <script>
37
51
  import Botao from "../forms/Botao";
52
+ import EscolherEstatico from "../forms/EscolherEstatico.vue";
38
53
 
39
54
  import { mapMutations } from "vuex";
40
55
 
41
56
  export default {
42
- components: { Botao },
57
+ components: { Botao, EscolherEstatico },
43
58
  name: "Pesquisa",
44
59
  computed: {
45
60
  pesquisa: {
@@ -62,10 +77,11 @@ export default {
62
77
  },
63
78
  limpaPesquisa() {
64
79
  this.limpouPesquisa();
65
- this.atualizaCampoPesquisa("");
80
+ let pesquisa = { conteudo: "", filtro: { conteudo: "contem", id: "contem" } };
81
+ this.atualizaCampoPesquisa(pesquisa);
66
82
  },
67
83
  verificaLimpaPesquisa() {
68
- if (this.pesquisa.length == 0) this.limpouPesquisa();
84
+ if (this.pesquisa.conteudo.length == 0) this.limpouPesquisa();
69
85
  },
70
86
  },
71
87
  };
@@ -82,8 +98,12 @@ export default {
82
98
  display: inline-block;
83
99
  }
84
100
 
101
+ .margem {
102
+ padding-top: 25px;
103
+ }
104
+
85
105
  .div-botao {
86
- margin-top: 5px;
106
+ padding-top: 25px;
87
107
  }
88
108
 
89
109
  ::placeholder {
@@ -105,7 +125,6 @@ input[type="text"] {
105
125
  transition: background-color 0.1s ease-in 0s, border 0.1s ease-in 0s;
106
126
  }
107
127
 
108
- /* When the input field gets focus, change its width to 100% */
109
128
  input[type="text"]:focus {
110
129
  outline: none;
111
130
  }
@@ -84,6 +84,7 @@ export default {
84
84
  },
85
85
  baseParams: {
86
86
  pesquisa: undefined,
87
+ filtro: "contem",
87
88
  paginaAtual: 1,
88
89
  totalPorPagina: 10,
89
90
  },
@@ -101,7 +102,8 @@ export default {
101
102
  });
102
103
  },
103
104
  beforeDestroy() {
104
- this.atualizaCampoPesquisa("");
105
+ let pesquisa = { conteudo: "", filtro: { conteudo: "contem", id: "contem" } };
106
+ this.atualizaCampoPesquisa(pesquisa);
105
107
  },
106
108
  computed: {
107
109
  ...mapState("generic", [
@@ -150,18 +152,19 @@ export default {
150
152
  },
151
153
  watch: {
152
154
  metodoExecutadoApi: function (value) {
153
- console.log(value);
154
155
  if (value === "deleteAllApi" || value === "deleteAllApiErro") {
155
156
  this.obterTodos();
156
157
  }
157
158
  },
158
159
  buscouPesquisa: function () {
159
- this.baseParams.pesquisa = this.pesquisa;
160
+ this.baseParams.pesquisa = this.pesquisa.conteudo;
161
+ this.baseParams.filtro = this.pesquisa.filtro.id;
160
162
  this.limpaParams();
161
163
  this.obterTodos();
162
164
  },
163
165
  limpouPesquisa: function () {
164
166
  this.baseParams.pesquisa = "";
167
+ this.baseParams.filtro = "";
165
168
  this.limpaParams();
166
169
  this.obterTodos();
167
170
  },
@@ -28,7 +28,7 @@ export default {
28
28
  tipo: undefined,
29
29
  },
30
30
  ids: undefined,
31
- pesquisa: undefined,
31
+ pesquisa: { conteudo: "", filtro: { conteudo: "contem", id: "contem" } },
32
32
  EscolherEstatico: { dataHora: undefined, campoAlvo: undefined, valor: undefined },
33
33
  buscouPesquisa: false,
34
34
  limpouPesquisa: false,