@nixweb/nixloc-ui 0.0.43 → 0.0.46

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.43",
3
+ "version": "0.0.46",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -1,20 +1,63 @@
1
1
  <template>
2
- <div>
3
- <VueToggles
4
- height="30"
5
- width="90"
6
- checkedText="On"
7
- uncheckedText="Off"
8
- checkedBg="#b4d455"
9
- uncheckedBg="lightgrey"
10
- :value="value"
11
- @click="value = !value"
12
- />
2
+ <div class="principal">
3
+ <b-row>
4
+ <b-col xs="6" sm="6" md="6" lg="4" xl="4">
5
+ <div class="lado-a-lado titulo">{{ titulo }}</div>
6
+ </b-col>
7
+ <b-col xs="6" sm="6" md="6" lg="4" xl="4">
8
+ <VueToggles
9
+ height="23"
10
+ width="60"
11
+ checkedText="Sim"
12
+ uncheckedText="Não"
13
+ :checkedBg="cor"
14
+ uncheckedBg="lightgrey"
15
+ :value="valor"
16
+ @click="valor = !valor"
17
+ />
18
+ </b-col>
19
+ </b-row>
13
20
  </div>
14
21
  </template>
15
22
 
16
23
  <script>
24
+ import VueToggles from "vue-toggles";
25
+
17
26
  export default {
18
27
  name: "Toggle",
28
+ components: {
29
+ VueToggles,
30
+ },
31
+ props: {
32
+ titulo: String,
33
+ cor: String,
34
+ params: Object,
35
+ alterou: Function,
36
+ value: Boolean,
37
+ },
38
+ data() {
39
+ return {
40
+ valor: false,
41
+ };
42
+ },
43
+ created() {
44
+ this.valor = this.value;
45
+ },
46
+ watch: {
47
+ valor() {
48
+ this.$emit("input", this.valor);
49
+ if (this.alterou) this.alterou(this.params);
50
+ },
51
+ },
19
52
  };
20
53
  </script>
54
+
55
+ <style scoped>
56
+ .principal {
57
+ padding: 5px;
58
+ }
59
+
60
+ .titulo {
61
+ padding-right: 35px;
62
+ }
63
+ </style>
@@ -202,7 +202,7 @@ export default {
202
202
  params: params.obj,
203
203
  headers: new Token().tokenHeaders(),
204
204
  })
205
- .then((response) => {
205
+ .then((response) => {
206
206
  if (response.data.sucesso) {
207
207
  context.commit('insereMetodoExecutadoApi', params.MetodoExecutadoApi);
208
208
  context.commit('removeNotificacao');
@@ -217,7 +217,7 @@ export default {
217
217
  return false;
218
218
  })
219
219
  },
220
- deleteApi: async function (context, params) {
220
+ deleteAllApi: async function (context, params) {
221
221
 
222
222
  context.commit('limpaMetodoExecutadoApi');
223
223
  context.commit('listaIdParaStringVirgula', params.selecionados);
@@ -245,6 +245,31 @@ export default {
245
245
  return false;
246
246
  })
247
247
  },
248
+ deleteApi: async function (context, params) {
249
+
250
+ context.commit('limpaMetodoExecutadoApi');
251
+ let url = params.url;
252
+
253
+ return axios.delete(`${url}`, {
254
+ headers: new Token().tokenHeaders(),
255
+ })
256
+ .then((response) => {
257
+ if (response.data.sucesso) {
258
+ context.commit('insereMetodoExecutadoApi', 'deleteApi')
259
+ context.commit('insereToast', 'deleteApiSucesso');
260
+ context.commit('removeNotificacao');
261
+ return response.data;
262
+ } else {
263
+ context.commit('insereNotificacao', response.data.notificacoes)
264
+ context.commit('insereToast', 'deleteApiErro');
265
+ return response.data;
266
+ }
267
+
268
+ }, (err) => {
269
+ context.commit('insereNotificacaoErroApi');
270
+ return false;
271
+ })
272
+ },
248
273
  getPdfApi: async function (context, params) {
249
274
  context.commit('limpaMetodoExecutadoApi');
250
275
  return axios.post(params.url, params.obj, {