@nixweb/nixloc-ui 0.0.46 → 0.0.47

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.46",
3
+ "version": "0.0.47",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -81,7 +81,7 @@ export default {
81
81
  cursor: pointer;
82
82
  border: none;
83
83
  border-radius: 40px !important;
84
- font-size: 14px;
84
+ font-size: 13px !important;
85
85
  font-weight: 400;
86
86
  letter-spacing: 0.5px !important;
87
87
  -webkit-box-shadow: 0px 10px 20px -6px rgb(0 0 0 / 12%);
@@ -18,7 +18,7 @@
18
18
  v-bind:value="value"
19
19
  v-on:input="$emit('input', $event.target.value)"
20
20
  class="form-control"
21
- :class="{ 'requerido': notificacoes.length > 0 && formSujo }"
21
+ :class="{ requerido: notificacoes.length > 0 && formSujo }"
22
22
  />
23
23
  </div>
24
24
  <div v-if="formSujo">
@@ -64,7 +64,11 @@ export default {
64
64
  this.valida();
65
65
  },
66
66
  methods: {
67
- ...mapMutations("validation", ["insereValidacao", "removeValidacao"]),
67
+ ...mapMutations("validation", [
68
+ "insereValidacao",
69
+ "removeValidacao",
70
+ "insereFormSujo",
71
+ ]),
68
72
  valida() {
69
73
  this.notificacoes = [];
70
74
 
@@ -88,6 +92,7 @@ export default {
88
92
  value() {
89
93
  this.valida();
90
94
  this.formSujo = true;
95
+ this.insereFormSujo(true);
91
96
  },
92
97
  notificacoes() {
93
98
  let self = this;
@@ -23,7 +23,7 @@
23
23
  v-bind:value="value"
24
24
  v-on:input="$emit('input', $event.target.value)"
25
25
  class="form-control"
26
- :class="{ 'requerido': notificacoes.length > 0 && formSujo }"
26
+ :class="{ requerido: notificacoes.length > 0 && formSujo }"
27
27
  />
28
28
  </div>
29
29
  <div v-if="formSujo">
@@ -74,7 +74,11 @@ export default {
74
74
  this.valida();
75
75
  },
76
76
  methods: {
77
- ...mapMutations("validation", ["insereValidacao", "removeValidacao"]),
77
+ ...mapMutations("validation", [
78
+ "insereValidacao",
79
+ "removeValidacao",
80
+ "insereFormSujo",
81
+ ]),
78
82
  valida() {
79
83
  this.notificacoes = [];
80
84
 
@@ -109,6 +113,7 @@ export default {
109
113
  value() {
110
114
  this.valida();
111
115
  this.formSujo = true;
116
+ this.insereFormSujo(true);
112
117
  },
113
118
  notificacoes() {
114
119
  let self = this;
@@ -12,8 +12,9 @@
12
12
  uncheckedText="Não"
13
13
  :checkedBg="cor"
14
14
  uncheckedBg="lightgrey"
15
+ :disabled="desabilitado"
15
16
  :value="valor"
16
- @click="valor = !valor"
17
+ @click="clique"
17
18
  />
18
19
  </b-col>
19
20
  </b-row>
@@ -31,6 +32,10 @@ export default {
31
32
  props: {
32
33
  titulo: String,
33
34
  cor: String,
35
+ desabilitado: {
36
+ type: Boolean,
37
+ default: false,
38
+ },
34
39
  params: Object,
35
40
  alterou: Function,
36
41
  value: Boolean,
@@ -43,8 +48,9 @@ export default {
43
48
  created() {
44
49
  this.valor = this.value;
45
50
  },
46
- watch: {
47
- valor() {
51
+ methods: {
52
+ clique() {
53
+ this.valor = !this.valor;
48
54
  this.$emit("input", this.valor);
49
55
  if (this.alterou) this.alterou(this.params);
50
56
  },
@@ -8,8 +8,8 @@
8
8
  <ul v-for="item in menu" :key="item.titulo">
9
9
  <li>
10
10
  <span>{{ item.titulo }}</span>
11
- <ul v-for="primeiroNivel in item.primeiroNivel" :key="primeiroNivel.titulo">
12
- <li>
11
+ <ul>
12
+ <li v-for="primeiroNivel in item.primeiroNivel" :key="primeiroNivel.titulo">
13
13
  <span
14
14
  :class="{ titulo: primeiroNivel.rotaDestino != '' }"
15
15
  @click="navegarPara(primeiroNivel.rotaDestino)"
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <div>
3
+ <BarraFixa posicao="rodape" v-show="formSujo">
4
+ <div>
5
+ <Botao
6
+ chave="cancelarSalvarCancelar"
7
+ titulo="Cancelar"
8
+ tipo="perigo"
9
+ tamanho="medio"
10
+ :clique="cancelar"
11
+ />
12
+ <Botao
13
+ chave="salvarSalvarCancelar"
14
+ titulo="Salvar"
15
+ tipo="sucesso"
16
+ :desabilitado="!formValido(formNome)"
17
+ tamanho="medio"
18
+ :clique="salvar"
19
+ />
20
+ </div>
21
+ </BarraFixa>
22
+ </div>
23
+ </template>
24
+ <script>
25
+ import BarraFixa from "@nixweb/nixloc-ui/src/component/layout/BarraFixa.vue";
26
+ import Botao from "@nixweb/nixloc-ui/src/component/forms/Botao";
27
+
28
+ import { mapState, mapMutations, mapGetters } from "vuex";
29
+
30
+ export default {
31
+ name: "SalvarCancelar",
32
+ components: { BarraFixa, Botao },
33
+ props: {
34
+ formNome: String,
35
+ },
36
+ computed: {
37
+ ...mapState("validation", ["formSujo"]),
38
+ ...mapGetters("validation", ["formValido"]),
39
+ },
40
+ methods: {
41
+ ...mapMutations("validation", ["insereFormSujo"]),
42
+ ...mapMutations("generic", ["removeCarregando"]),
43
+ salvar() {},
44
+ cancelar() {
45
+ this.insereFormSujo(false);
46
+ this.removeCarregando(["cancelarSalvarCancelar"]);
47
+ },
48
+ },
49
+ };
50
+ </script>
@@ -14,16 +14,17 @@
14
14
  <slot name="conteudo-principal"></slot>
15
15
  </div>
16
16
  </Painel>
17
+ <SalvarCancelar :formNome="painel.formNome" />
17
18
  </div>
18
19
  </template>
19
20
 
20
21
  <script>
21
22
  import Painel from "@nixweb/nixloc-ui/src/component/layout/Painel";
22
-
23
+ import SalvarCancelar from "@nixweb/nixloc-ui/src/component/shared/SalvarCancelar";
23
24
 
24
25
  export default {
25
26
  name: "InserirEditarModeloView",
26
- components: { Painel },
27
+ components: { Painel, SalvarCancelar },
27
28
  props: {
28
29
  painel: Object,
29
30
  },