@nixweb/nixloc-ui 0.0.53 → 0.0.56

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.53",
3
+ "version": "0.0.56",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -0,0 +1,132 @@
1
+ <template>
2
+ <div>
3
+ <div class="foto-container" @click="escondeMostra = !escondeMostra">
4
+ <img
5
+ src="https://portal1.iff.edu.br/desenvolvimento-institucional/imagens/avatar.jpg/@@images/image.jpeg"
6
+ alt="Avatar"
7
+ />
8
+ </div>
9
+ <div class="perfil-container" v-if="escondeMostra">
10
+ <div class="item-header text-center">
11
+ <span>Conta</span>
12
+ </div>
13
+ <div class="perfil-conteudo" v-for="item in itens" :key="item.titulo">
14
+ <div class="item-conteudo" @click="navegarPara(item.nomeRota)">
15
+ <div class="titulo-container">
16
+ <span>
17
+ <i :class="item.classeIcone"></i>
18
+ <span class="titulo-perfil titulo-input">{{ item.titulo }}</span>
19
+ </span>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ <div class="perfil-conteudo" @click="executarSair">
24
+ <div class="item-conteudo">
25
+ <div class="titulo-container">
26
+ <span>
27
+ <i class="fas fa-sign-in"></i>
28
+ <span class="titulo-perfil titulo-input">Sair</span>
29
+ </span>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </template>
36
+ <script>
37
+ export default {
38
+ name: "Conta",
39
+ props: {
40
+ itens: [],
41
+ sair: Function,
42
+ },
43
+ data() {
44
+ return {
45
+ escondeMostra: false,
46
+ };
47
+ },
48
+ methods: {
49
+ navegarPara(nomeRota) {
50
+ this.$router.push({ name: nomeRota });
51
+ this.escondeMostra = false;
52
+ },
53
+ executarSair() {
54
+ if (this.sair) this.sair();
55
+ },
56
+ },
57
+ };
58
+ </script>
59
+ <style scoped>
60
+ .foto-container {
61
+ margin-top: -32px;
62
+ padding-right: 10px;
63
+ cursor: pointer;
64
+ position: fixed;
65
+ float: right;
66
+ left: auto;
67
+ right: 0;
68
+ }
69
+
70
+ img {
71
+ border-radius: 50%;
72
+ height: 45px;
73
+ width: 45px;
74
+ }
75
+
76
+ .perfil-container {
77
+ position: fixed;
78
+ float: right;
79
+ left: auto;
80
+ right: 0;
81
+ margin-right: 20px;
82
+ height: 100%;
83
+ z-index: 1000;
84
+ width: 190px;
85
+ margin-top: 26px;
86
+ background-color: white;
87
+ height: auto;
88
+ border-bottom: 1px solid #e9ebec;
89
+ }
90
+
91
+ .perfil-conteudo {
92
+ right: 0;
93
+ height: 100%;
94
+ z-index: 101;
95
+ width: 190px;
96
+ height: auto;
97
+ }
98
+
99
+ .item-header {
100
+ padding: 8px 20px;
101
+ background: #f8f8f8;
102
+ border-left: 1px solid #e9ebec;
103
+ border-right: 1px solid #e9ebec;
104
+ border-top: 1px solid #e9ebec;
105
+ }
106
+
107
+ .item-conteudo {
108
+ padding-left: 15px;
109
+ height: 45px;
110
+ background: white;
111
+ border: 1px solid #e9ebec;
112
+ border-bottom: 0px solid #e9ebec;
113
+ cursor: pointer;
114
+ }
115
+
116
+ .item-conteudo:hover {
117
+ background: #f8f8f8;
118
+ }
119
+
120
+ .titulo-container {
121
+ padding-top: 10px;
122
+ }
123
+
124
+ .titulo-container:hover {
125
+ padding-top: 10px;
126
+ color: #37597c;
127
+ }
128
+
129
+ .titulo-perfil {
130
+ padding-left: 10px;
131
+ }
132
+ </style>
@@ -5,7 +5,10 @@
5
5
  :class="{ esconde: menu.escondeMostra, mostra: !menu.escondeMostra }"
6
6
  :style="'background-color:' + corTopo"
7
7
  >
8
- <span class="icone" @click="mostrar = !mostrar"><i class="fal fa-bars"></i></span>
8
+ <div class="lado-a-lado" @click="mostrar = !mostrar">
9
+ <span class="icone"><i class="fal fa-bars"></i></span>
10
+ </div>
11
+ <div class="lado-a-lado"><slot></slot></div>
9
12
  </div>
10
13
  <br />
11
14
  </div>
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div :class="{ 'div-mensagem': !modal.abrir }" v-if="notificacoes.length > 0">
3
- <Alerta tipo="perigo">
4
- <div v-for="notificacao in notificacoes">
3
+ <div v-for="notificacao in notificacoes">
4
+ <Alerta tipo="perigo">
5
5
  {{ notificacao.mensagem }}
6
- </div>
7
- </Alerta>
6
+ </Alerta>
7
+ </div>
8
8
  <b-alert
9
9
  v-show="false"
10
10
  :show="contagemRegressiva"
@@ -18,11 +18,11 @@ export default {
18
18
  },
19
19
  methods: {
20
20
  notifica(value) {
21
- if (value.tipo == "adicionarApiSucesso" || value.tipo == "modificarApiSucesso")
21
+ if (value.tipo == "postApi" || value.tipo == "putApi")
22
22
  this.$toasted.show("Salvo com sucesso", {
23
23
  type: "success",
24
24
  });
25
- if (value.tipo == "adicionarApiErro" || value.tipo == "modificarApiErro") {
25
+ if (value.tipo == "postApiErro" || value.tipo == "putApiErro") {
26
26
  this.$toasted.show("Ops! Algo deu errado", {
27
27
  type: "error",
28
28
  });
@@ -150,8 +150,8 @@ export default {
150
150
  },
151
151
  watch: {
152
152
  metodoExecutadoApi: function (value) {
153
- if (value != "obterTodosApi" && value != "" && value != "escolherApi") {
154
- // this.obterTodos();
153
+ if (value == "deleteAllApi") {
154
+ this.obterTodos();
155
155
  }
156
156
  },
157
157
  buscouPesquisa: function () {
@@ -7,11 +7,7 @@ export default {
7
7
  namespaced: true,
8
8
  state: {
9
9
  menu: {
10
- escondeMostra: false, itens: [{
11
- href: "/dashboard",
12
- title: "Dashboard",
13
- icon: "fa fa-chart-area",
14
- },]
10
+ escondeMostra: false, itens: []
15
11
  },
16
12
  modal: {
17
13
  nome: undefined,
@@ -73,8 +69,13 @@ export default {
73
69
  },
74
70
  },
75
71
  mutations: {
76
- insereItemMenu: (state, obj) => {
77
- state.menu.itens.push(obj);
72
+ insereItemMenu: (state, itens) => {
73
+ itens.forEach(function (obj) {
74
+ state.menu.itens.push(obj);
75
+ });
76
+ },
77
+ removeItensMenu: (state) => {
78
+ state.menu.itens = [];
78
79
  },
79
80
  escondeMostraMenu: (state, escondeMostra) => {
80
81
  state.menu.escondeMostra = escondeMostra;
@@ -175,14 +176,17 @@ export default {
175
176
  .then((response) => {
176
177
  if (response.data.sucesso) {
177
178
  context.commit('insereMetodoExecutadoApi', params.MetodoExecutadoApi);
178
- context.commit('insereToast', 'adicionarApiSucesso');
179
+
180
+ if (!params.naoNotificarToast)
181
+ context.commit('insereToast', 'postApi');
182
+
179
183
  context.commit('removeNotificacao');
180
184
  context.commit('validation/removeFormSujo', null, { root: true });
181
185
  return response.data;
182
186
  } else {
183
187
 
184
188
  context.commit('insereNotificacao', response.data.notificacoes)
185
- context.commit('insereToast', 'falhaGenerica');
189
+ context.commit('insereToast', 'postApiErro');
186
190
  return response.data;
187
191
  }
188
192
  }, (err) => {
@@ -198,12 +202,15 @@ export default {
198
202
  .then((response) => {
199
203
  if (response.data.sucesso) {
200
204
  context.commit('insereMetodoExecutadoApi', params.MetodoExecutadoApi);
201
- context.commit('insereToast', 'modificarApiSucesso');
205
+
206
+ if (!params.naoNotificarToast)
207
+ context.commit('insereToast', 'putApi');
208
+
202
209
  context.commit('removeNotificacao');
203
210
  context.commit('validation/removeFormSujo', null, { root: true });
204
211
  return response.data;
205
212
  } else {
206
- context.commit('insereToast', 'modificarApiErro');
213
+ context.commit('insereToast', 'putApiErro');
207
214
  context.commit('insereNotificacao', response.data.notificacoes)
208
215
  return response.data;
209
216
  }
@@ -246,7 +253,7 @@ export default {
246
253
  })
247
254
  .then((response) => {
248
255
  if (response.data.sucesso) {
249
- context.commit('insereMetodoExecutadoApi', 'deleteApi')
256
+ context.commit('insereMetodoExecutadoApi', 'deleteAllApi');
250
257
  context.commit('insereToast', 'deleteApiSucesso');
251
258
  context.commit('removeNotificacao');
252
259
  return response.data;