@nixweb/nixloc-ui 0.0.63 → 0.0.66

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.63",
3
+ "version": "0.0.66",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -78,7 +78,11 @@ export default {
78
78
  this.valor = this.value;
79
79
  },
80
80
  methods: {
81
- ...mapMutations("validation", ["insereValidacao", "removeValidacao"]),
81
+ ...mapMutations("validation", [
82
+ "insereValidacao",
83
+ "removeValidacao",
84
+ "insereFormSujo",
85
+ ]),
82
86
  ...mapMutations("generic", ["insereFiltro"]),
83
87
  valida() {
84
88
  this.notificacoes = [];
@@ -112,6 +116,7 @@ export default {
112
116
  valor() {
113
117
  this.valida();
114
118
  this.formSujo = true;
119
+ this.insereFormSujo(true);
115
120
  this.$emit("input", this.valor);
116
121
  },
117
122
  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>
@@ -102,7 +102,8 @@ export default {
102
102
  });
103
103
  },
104
104
  beforeDestroy() {
105
- this.atualizaCampoPesquisa("");
105
+ let pesquisa = { conteudo: "", filtro: { conteudo: "contem", id: "contem" } };
106
+ this.atualizaCampoPesquisa(pesquisa);
106
107
  },
107
108
  computed: {
108
109
  ...mapState("generic", [