@nixweb/nixloc-ui 0.0.62 → 0.0.63

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.63",
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) {
@@ -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
  },
@@ -150,18 +151,19 @@ export default {
150
151
  },
151
152
  watch: {
152
153
  metodoExecutadoApi: function (value) {
153
- console.log(value);
154
154
  if (value === "deleteAllApi" || value === "deleteAllApiErro") {
155
155
  this.obterTodos();
156
156
  }
157
157
  },
158
158
  buscouPesquisa: function () {
159
- this.baseParams.pesquisa = this.pesquisa;
159
+ this.baseParams.pesquisa = this.pesquisa.conteudo;
160
+ this.baseParams.filtro = this.pesquisa.filtro.id;
160
161
  this.limpaParams();
161
162
  this.obterTodos();
162
163
  },
163
164
  limpouPesquisa: function () {
164
165
  this.baseParams.pesquisa = "";
166
+ this.baseParams.filtro = "";
165
167
  this.limpaParams();
166
168
  this.obterTodos();
167
169
  },
@@ -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,