@nixweb/nixloc-ui 0.0.154 → 0.0.156

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.154",
3
+ "version": "0.0.156",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -10,7 +10,12 @@
10
10
  v-if="notifications.length > 0 && formDirty"
11
11
  class="required glyphicon fas fa-exclamation-triangle"
12
12
  ></i>
13
- <vue-editor v-model.trim="value" :editorToolbar="customToolbar"></vue-editor>
13
+ <vue-editor
14
+ v-model.trim="value"
15
+ :editorToolbar="customToolbar"
16
+ :disabled="disabled"
17
+ :class="{ disabled: disabled }"
18
+ ></vue-editor>
14
19
  </div>
15
20
 
16
21
  <div v-if="formDirty">
@@ -36,6 +41,7 @@ export default {
36
41
  field: String,
37
42
  formName: String,
38
43
  required: Boolean,
44
+ disabled: Boolean,
39
45
  maxLength: Number,
40
46
  value: String,
41
47
  },
@@ -44,16 +50,18 @@ export default {
44
50
  notifications: [],
45
51
  formDirty: false,
46
52
  textoEditor: "",
47
- customToolbar: [
48
- ["bold", "italic", "underline"],
49
- ],
53
+ customToolbar: [["bold", "italic", "underline"]],
50
54
  };
51
55
  },
52
56
  created() {
53
57
  this.validate();
54
58
  },
55
59
  methods: {
56
- ...mapMutations("validation", ["addValidation", "removeValidation", "updateFormDirty"]),
60
+ ...mapMutations("validation", [
61
+ "addValidation",
62
+ "removeValidation",
63
+ "updateFormDirty",
64
+ ]),
57
65
  validate() {
58
66
  this.notifications = [];
59
67
 
@@ -123,4 +131,8 @@ export default {
123
131
  color: #f0134d;
124
132
  font-size: 14px;
125
133
  }
134
+
135
+ .disabled {
136
+ color: #86929e;
137
+ }
126
138
  </style>
@@ -7,6 +7,7 @@
7
7
  :required="required"
8
8
  :formName="formName"
9
9
  _style="color:red;"
10
+ :disabled="disabled"
10
11
  v-model="discount.discount"
11
12
  >
12
13
  <div class="glyphicon margin-button">
@@ -16,6 +17,7 @@
16
17
  type="primary"
17
18
  classIcon="fa-solid fa-brazilian-real-sign"
18
19
  size="small"
20
+ :disabled="disabled"
19
21
  :clicked="change"
20
22
  /></div
21
23
  ></InputDecimal>
@@ -25,6 +27,7 @@
25
27
  field="discount"
26
28
  :formName="formName"
27
29
  :required="false"
30
+ :disabled="disabled"
28
31
  _style="color:red;"
29
32
  :maxLength="5"
30
33
  type="float"
@@ -34,6 +37,7 @@
34
37
  _key="btnDiscount"
35
38
  title=""
36
39
  type="primary"
40
+ :disabled="disabled"
37
41
  classIcon="fa-solid fa-percent"
38
42
  size="small"
39
43
  :clicked="change"
@@ -6,6 +6,7 @@
6
6
  small: size === 'small',
7
7
  medium: size === 'medium',
8
8
  large: size === 'large',
9
+ blue: type === 'blue',
9
10
  primary: type === 'primary',
10
11
  success: type === 'success',
11
12
  warning: type === 'warning',
@@ -66,6 +67,12 @@ export default {
66
67
  color: #fff;
67
68
  }
68
69
 
70
+ .blue {
71
+ background: #007bff;
72
+ border-color: #007bff;
73
+ color: #fff;
74
+ }
75
+
69
76
  .primary {
70
77
  background: #577696;
71
78
  border-color: #577696;
@@ -74,8 +81,8 @@ export default {
74
81
 
75
82
  .success {
76
83
  color: #fff;
77
- background: #38A169;
78
- border-color: #38A169;
84
+ background: #38a169;
85
+ border-color: #38a169;
79
86
  }
80
87
 
81
88
  .info {
@@ -19,7 +19,7 @@ export default {
19
19
  .molded {
20
20
  border: 1px solid #e8eaed;
21
21
  background-color: white;
22
- border-radius: 12px !important;
22
+ border-radius: 8px !important;
23
23
  padding: 10px;
24
24
  padding-top: 15px;
25
25
  padding-left: 30px;
@@ -71,7 +71,7 @@ export default {
71
71
  </script>
72
72
  <style scoped>
73
73
  .div-message {
74
- margin-top: 15px;
74
+ margin-top: 50px;
75
75
  }
76
76
 
77
77
  .div-message-modal {
@@ -23,7 +23,17 @@
23
23
  <span class="exemplo"> {{ item.example }}</span>
24
24
  </td>
25
25
  <td class="parametro">
26
- <span> {{ item.parameter }}</span>
26
+ <span @click="copy(item.parameter)" v-clipboard="item.parameter">
27
+ {{ item.parameter }}
28
+ <span v-if="item.parameter">
29
+ <span class="copy" v-if="copied != item.parameter">
30
+ <span>Copiar</span>
31
+ </span>
32
+ <span class="copied" v-else>
33
+ <span>Copiado</span>
34
+ </span>
35
+ </span>
36
+ </span>
27
37
  </td>
28
38
  </tr>
29
39
  </tbody>
@@ -49,6 +59,7 @@ export default {
49
59
  data() {
50
60
  return {
51
61
  legendLocal: [],
62
+ copied: "",
52
63
  };
53
64
  },
54
65
  mounted() {
@@ -56,6 +67,9 @@ export default {
56
67
  },
57
68
  methods: {
58
69
  ...mapMutations("generic", ["removeLoading"]),
70
+ copy(parameter) {
71
+ this.copied = parameter;
72
+ },
59
73
  },
60
74
  computed: {
61
75
  ...mapGetters("generic", ["groupBy"]),
@@ -128,11 +142,21 @@ export default {
128
142
  }
129
143
 
130
144
  .parametro {
131
- width: 250px;
145
+ font: 12px;
146
+ width: 340px;
147
+ cursor: pointer;
132
148
  }
133
149
 
134
150
  .exemplo {
135
151
  font-size: 14px;
136
152
  color: rgb(31, 31, 82);
137
153
  }
154
+
155
+ .copy {
156
+ color: rgb(31, 31, 82);
157
+ }
158
+
159
+ .copied {
160
+ color: red;
161
+ }
138
162
  </style>
@@ -1,6 +1,10 @@
1
1
  <template>
2
2
  <div>
3
- <FixedBar position="footer" backgroundColor="#FAFAFC" v-show="formDirty && !modal.open">
3
+ <FixedBar
4
+ position="footer"
5
+ backgroundColor="#FAFAFC"
6
+ v-show="formDirty && !modal.open && on"
7
+ >
4
8
  <div class="margin">
5
9
  <Button
6
10
  _key="cancelSaveCancel"
@@ -38,6 +42,7 @@ export default {
38
42
  data() {
39
43
  return {
40
44
  id: this.$route.params.id,
45
+ on: false,
41
46
  };
42
47
  },
43
48
  mounted() {
@@ -49,10 +54,17 @@ export default {
49
54
  self.removeLoading(["panel"]);
50
55
  }, 350);
51
56
  }
57
+
58
+ let self = this;
59
+ setTimeout(function () {
60
+ self.updateFormDirty(false);
61
+ self.on = true;
62
+ }, 1000);
52
63
  },
53
64
  computed: {
54
65
  ...mapState("validation", ["formDirty"]),
55
66
  ...mapState("generic", ["loading"]),
67
+ ...mapGetters("generic", ["event"]),
56
68
  ...mapGetters("validation", ["isFormValid"]),
57
69
  ...mapState("generic", ["modal"]),
58
70
  },
@@ -13,7 +13,6 @@
13
13
  <div class="div-select">
14
14
  <SelectStatic
15
15
  :title="obj.title"
16
- fieldTarget="timeZone"
17
16
  :data="select"
18
17
  :markFormDirty="false"
19
18
  v-model="obj.target"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- Atualizado em
3
+ {{ title }}
4
4
  <span class="timer">{{ time }}</span> segundos...
5
5
  </div>
6
6
  </template>
@@ -12,6 +12,10 @@ export default {
12
12
  type: Number,
13
13
  default: 10,
14
14
  },
15
+ title: {
16
+ type: String,
17
+ default: "Atualizado em",
18
+ },
15
19
  endTime: Function,
16
20
  },
17
21
  data() {
@@ -49,6 +49,7 @@
49
49
  <div class="side-by-side">
50
50
  <Button
51
51
  key="showModalLegend"
52
+ title="Parâmetros (Alt)"
52
53
  type="info"
53
54
  classIcon="fas fa-book-reader"
54
55
  size="small"
@@ -58,6 +59,7 @@
58
59
  <div class="side-by-side">
59
60
  <Button
60
61
  key="showModalCode"
62
+ title="Código"
61
63
  type="info"
62
64
  classIcon="far fa-code"
63
65
  size="small"
@@ -81,8 +83,8 @@
81
83
  <Modal title="Salvar" :width="800" v-show="showModal('saveDocument')">
82
84
  <slot></slot>
83
85
  </Modal>
84
- <Modal title="Parâmetros" :width="1100" v-if="showModal('legenda')">
85
- <ParameterLegend v-if="modal.open" :legend="parameterLegend" />
86
+ <Modal title="Parâmetros" :width="1100" v-show="showModal('legenda')">
87
+ <ParameterLegend v-show="modal.open" :legend="parameterLegend" />
86
88
  </Modal>
87
89
  <Modal title="Editor de Código" :width="900" v-if="showModal('code')">
88
90
  <CodeEditor v-if="modal.open" />
@@ -178,6 +180,15 @@ export default {
178
180
  setTimeout(function () {
179
181
  self.showDocumentEditor = true;
180
182
  }, 1500);
183
+ window.addEventListener("keydown", (e) => {
184
+ if (e.key == "Alt") {
185
+ if (this.modal.open) {
186
+ this.hideModal();
187
+ } else {
188
+ this.showModalLegend();
189
+ }
190
+ }
191
+ });
181
192
  },
182
193
  computed: {
183
194
  ...mapState("generic", ["modal", "documentHtml"]),
@@ -12,8 +12,8 @@
12
12
  <div class="div-loading" v-show="loading">
13
13
  <span
14
14
  >Aguarde, estamos carregando os dados, isso pode levar alguns
15
- minutos...</span
16
- >
15
+ minutos...
16
+ </span>
17
17
  <Loading type="line" :center="false" />
18
18
  </div>
19
19
  <Molded v-show="!loading">
@@ -85,6 +85,15 @@
85
85
  size="small"
86
86
  :clicked="openListError"
87
87
  />
88
+ <Button
89
+ v-if="isValid"
90
+ _key="btnImport"
91
+ type="success"
92
+ title="Importar"
93
+ classIcon="fa-solid fa-file-import"
94
+ size="small"
95
+ :clicked="startImport"
96
+ />
88
97
  </div>
89
98
  <br />
90
99
  <Alert type="danger" v-if="listError.length > 0">
@@ -102,6 +111,7 @@
102
111
  </Alert>
103
112
 
104
113
  <TableImport
114
+ v-if="fileName"
105
115
  :select="select"
106
116
  :headerTable="headerTable"
107
117
  :data="data"
@@ -155,6 +165,7 @@ export default {
155
165
  typeImport: Number,
156
166
  urlMapping: String,
157
167
  urlValidate: String,
168
+ urlImport: String,
158
169
  },
159
170
  data() {
160
171
  return {
@@ -218,6 +229,24 @@ export default {
218
229
  this.removeLoading(["btnValidate"]);
219
230
  });
220
231
  },
232
+ startImport() {
233
+ let params = {
234
+ url: this.urlImport,
235
+ obj: {
236
+ fileName: this.fileName,
237
+ container: this.container,
238
+ typeImport: this.typeImport,
239
+ items: this.headerTable,
240
+ },
241
+ notNotifyToast: true,
242
+ };
243
+ this.postApi(params).then((response) => {
244
+ if (response.success) {
245
+ alert();
246
+ }
247
+ this.removeLoading(["btnValidate"]);
248
+ });
249
+ },
221
250
  openListError() {
222
251
  this.openModal("listError");
223
252
  this.removeLoading(["btnListError"]);
@@ -321,13 +321,16 @@ export default {
321
321
 
322
322
  context.commit('addNotifications', response.data.notifications)
323
323
  context.commit('addToast', 'postApiError');
324
+
324
325
  return response.data;
325
326
  }
326
327
  }, (err) => {
327
328
 
328
329
  if (err.response)
329
- if (err.response.status === 403)
330
+ if (err.response.status === 403) {
330
331
  context.commit('addNotifications', [{ message: "Usuário sem permissão para executar esta ação!" }])
332
+ context.commit('addToast', 'falhaGenerica');
333
+ }
331
334
 
332
335
  if (!err.response)
333
336
  context.commit('addNotificationErrorApi');
@@ -357,8 +360,10 @@ export default {
357
360
  }
358
361
  }, (err) => {
359
362
  if (err.response)
360
- if (err.response.status === 403)
363
+ if (err.response.status === 403) {
361
364
  context.commit('addNotifications', [{ message: "Usuário sem permissão para executar esta ação!" }])
365
+ context.commit('addToast', 'falhaGenerica');
366
+ }
362
367
 
363
368
  if (!err.response)
364
369
  context.commit('addNotificationErrorApi');
@@ -436,8 +441,10 @@ export default {
436
441
 
437
442
  }, (err) => {
438
443
  if (err.response)
439
- if (err.response.status === 403)
444
+ if (err.response.status === 403) {
440
445
  context.commit('addNotifications', [{ message: "Usuário sem permissão para executar esta ação!" }])
446
+ context.commit('addToast', 'falhaGenerica');
447
+ }
441
448
 
442
449
  if (!err.response)
443
450
  context.commit('addNotificationErrorApi');
@@ -470,8 +477,10 @@ export default {
470
477
 
471
478
  }, (err) => {
472
479
  if (err.response)
473
- if (err.response.status === 403)
480
+ if (err.response.status === 403) {
474
481
  context.commit('addNotifications', [{ message: "Usuário sem permissão para executar esta ação!" }])
482
+ context.commit('addToast', 'falhaGenerica');
483
+ }
475
484
 
476
485
  if (!err.response)
477
486
  context.commit('addNotificationErrorApi');
@@ -500,8 +509,10 @@ export default {
500
509
 
501
510
  }, (err) => {
502
511
  if (err.response)
503
- if (err.response.status === 403)
512
+ if (err.response.status === 403) {
504
513
  context.commit('addNotifications', [{ message: "Usuário sem permissão para executar esta ação!" }])
514
+ context.commit('addToast', 'falhaGenerica');
515
+ }
505
516
 
506
517
  if (!err.response)
507
518
  context.commit('addNotificationErrorApi');
@@ -550,8 +561,10 @@ export default {
550
561
  }
551
562
  }, (err) => {
552
563
  if (err.response)
553
- if (err.response.status === 403)
554
- context.commit('addNotifications', [{ message: "Usuário sem permissão para adicionar!" }])
564
+ if (err.response.status === 403) {
565
+ context.commit('addNotifications', [{ message: "Usuário sem permissão para executar esta ação!" }])
566
+ context.commit('addToast', 'falhaGenerica');
567
+ }
555
568
 
556
569
  if (!err.response)
557
570
  context.commit('addNotificationErrorApi');
@@ -580,8 +593,10 @@ export default {
580
593
  }
581
594
  }, (err) => {
582
595
  if (err.response)
583
- if (err.response.status === 403)
584
- context.commit('addNotifications', [{ message: "Usuário sem permissão para remove!" }])
596
+ if (err.response.status === 403) {
597
+ context.commit('addNotifications', [{ message: "Usuário sem permissão para executar esta ação!" }])
598
+ context.commit('addToast', 'falhaGenerica');
599
+ }
585
600
 
586
601
  if (!err.response)
587
602
  context.commit('addNotificationErrorApi');