@nixweb/nixloc-ui 1.2.0 → 1.3.0

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": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="c-div-button" v-b-tooltip.hover :title="tooltip">
3
- <button :style="'background-color:' + backGroundColor + ';color:' + color" class="button" :class="{
3
+ <button :id="_key" :style="'background-color:' + backGroundColor + ';color:' + color" class="button" :class="{
4
4
  small: size === 'small',
5
5
  medium: size === 'medium',
6
6
  large: size === 'large',
@@ -1,49 +1,77 @@
1
1
  <template>
2
2
  <div>
3
3
  <div class="btn-container side-by-side text-center">
4
- <div v-for="option in options" class="btn-item-button-filter side-by-side"
5
- :class="{ 'selected-button-filter': option.value == selected }" @click="execute(option)" :key="option.title">
4
+ <div v-for="option in options" :key="option.value || option.title" class="btn-item-button-filter side-by-side"
5
+ :class="{ 'selected-button-filter': option.value === selected }" @click="execute(option)">
6
6
  <i :class="option.classIcon"></i>
7
7
  <span class="btn-title">{{ option.title }}</span>
8
8
  </div>
9
9
  </div>
10
10
  </div>
11
11
  </template>
12
+
12
13
  <script>
13
14
  import { mapMutations } from "vuex";
14
15
 
15
16
  export default {
16
17
  name: "ButtonFilter",
17
- props: {
18
- initialOption: String,
19
- options: {
20
- type: Array,
21
- default: [],
22
- },
23
- value: String,
24
- params: Object,
25
- clicked: Function,
26
- },
18
+ props: ["initialOption", "options", "value", "params", "clicked"],
27
19
  data() {
28
20
  return {
29
- selected: "",
21
+ selected: null,
30
22
  };
31
23
  },
32
24
  created() {
33
- if (this.initialOption) this.selected = this.initialOption;
25
+ this.setSelectedFromProps();
26
+ },
27
+ watch: {
28
+ // se o pai atualizar o v-model (prop value), sincroniza
29
+ value() {
30
+ this.setSelectedFromProps();
31
+ },
32
+ // se o pai trocar a initialOption depois, sincroniza também
33
+ initialOption() {
34
+ this.setSelectedFromProps();
35
+ },
34
36
  },
35
37
  methods: {
36
38
  ...mapMutations("generic", ["addEvent"]),
39
+
40
+ setSelectedFromProps() {
41
+ // prioridade para v-model (value)
42
+ if (this.value !== undefined) {
43
+ this.selected = this.value;
44
+ return;
45
+ }
46
+
47
+ // aceita initialOption como valor (0, "", "x", etc.) ou como objeto { value: ... }
48
+ if (this.initialOption !== undefined && this.initialOption !== null) {
49
+ this.selected =
50
+ typeof this.initialOption === "object"
51
+ ? this.initialOption.value
52
+ : this.initialOption;
53
+ }
54
+ },
55
+
37
56
  execute(option) {
38
- if (this.initialOption) this.selected = option.value;
39
- this.addEvent({ name: option.eventName, data: option });
57
+ // SEMPRE atualiza o selecionado
58
+ this.selected = option.value;
59
+
60
+ // eventos
61
+ if (option.eventName) {
62
+ this.addEvent({ name: option.eventName, data: option });
63
+ }
64
+
65
+ // emite para v-model do pai
40
66
  this.$emit("input", option.value);
67
+
68
+ // callback opcional
41
69
  if (this.clicked) this.clicked(this.params);
42
70
  },
43
71
  },
44
-
45
72
  };
46
73
  </script>
74
+
47
75
  <style scoped>
48
76
  .btn-container {
49
77
  margin-left: 10px;
@@ -67,10 +95,10 @@ export default {
67
95
  }
68
96
 
69
97
  .selected-button-filter {
70
- background-color: #4BB4E2;
71
- color: white;
98
+ background-color: #4bb4e2;
99
+ color: #fff;
72
100
  padding-left: 10px;
73
101
  padding-right: 10px;
74
102
  border-radius: 15px;
75
103
  }
76
- </style>
104
+ </style>
@@ -78,13 +78,6 @@ export default {
78
78
  };
79
79
  </script>
80
80
  <style>
81
- .custom-control-label {
82
- font-size: 13px !important;
83
- font-weight: 400 !important;
84
- text-transform: uppercase;
85
- color: #778498;
86
- }
87
-
88
81
  .options {
89
82
  margin-top: 5px;
90
83
  }
@@ -94,7 +94,7 @@ export default {
94
94
  width: 38px;
95
95
  height: 38px;
96
96
  border-radius: 50%;
97
- background: #007bff;
97
+ background: #D98621;
98
98
  display: flex;
99
99
  align-items: center;
100
100
  justify-content: center;
@@ -110,7 +110,7 @@ export default {
110
110
  top: -5px;
111
111
  right: -5px;
112
112
  background: #fff;
113
- color: #007bff;
113
+ color: #D98621;
114
114
  font-size: 11px;
115
115
  font-weight: bold;
116
116
  border-radius: 50%;
@@ -119,7 +119,7 @@ export default {
119
119
  display: flex;
120
120
  align-items: center;
121
121
  justify-content: center;
122
- border: 2px solid #007bff;
122
+ border: 2px solid #D98621;
123
123
  }
124
124
 
125
125
  .bab-title {
@@ -17,7 +17,7 @@
17
17
  <tr>
18
18
  <th class="td-checkbox" v-if="showChecks">
19
19
  <div class="hide-print">
20
- <b-form-checkbox v-model="selectAll" @change="select" />
20
+ <b-form-checkbox v-model="selectAll" @change="select" />
21
21
  </div>
22
22
  </th>
23
23
  <th v-for="(obj, ind) in header" :key="ind">
@@ -152,7 +152,7 @@ table tbody tr td {
152
152
  }
153
153
 
154
154
  .td-checkbox {
155
- width: 30px;
155
+ width: 0px;
156
156
  }
157
157
 
158
158
  tr:hover {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div>
2
+ <div class="item-main">
3
3
  <div v-if="obj.type === 'period-rent'" class="period-rent" @click="navegateTo(obj, row)" :style="obj.styleBody"
4
4
  :class="convertClass(row[obj.fieldComparison], obj.classCssBody)">
5
5
  <DisplayPeriodRent :periodRent="row[obj.field]" :fontSize="14" :showDeliveryDevolution="true" />
@@ -18,7 +18,7 @@
18
18
  {{ row[obj.field] }}
19
19
  </div>
20
20
  </div>
21
- <div v-if="obj.type === 'html' && row[obj.field]" :style="obj.styleBody"
21
+ <div class="item-align-center" v-if="obj.type === 'html' && row[obj.field]" :style="obj.styleBody"
22
22
  :class="convertClass(row[obj.fieldComparison], obj.classCssBody)">
23
23
  <div v-if="row[obj.field]" v-html="row[obj.field]"></div>
24
24
  <div v-else v-html="obj.html"></div>
@@ -149,6 +149,7 @@ export default {
149
149
  <style scoped>
150
150
  .field-second {
151
151
  color: rgb(83, 82, 82);
152
+ font-size: 13px;
152
153
  }
153
154
 
154
155
  .table-currency {
@@ -213,4 +214,15 @@ export default {
213
214
  margin-top: 11px;
214
215
  width: 200px;
215
216
  }
217
+
218
+ .item-main {
219
+ display: table;
220
+ height: 100%;
221
+ width: 100%;
222
+ }
223
+
224
+ .item-main > * {
225
+ display: table-cell;
226
+ vertical-align: middle;
227
+ }
216
228
  </style>
@@ -23,8 +23,8 @@
23
23
  </ScrollBar>
24
24
 
25
25
  <div class="text-center">
26
- <Button key="closeErrors" title="Fechar" color="white" backGroundColor="#6B7280" size="small"
27
- :clicked="() => $emit('close')" />
26
+ <Button key="closeErrors" title="Fechar" classIcon="fa-solid fa-circle-xmark" color="white"
27
+ backGroundColor="#6D757B" size="small" :clicked="() => $emit('close')" />
28
28
  </div>
29
29
  </div>
30
30
  </template>
@@ -63,8 +63,8 @@ export default {
63
63
  }
64
64
 
65
65
  .error-details-title {
66
- font-weight: 600;
67
- color: #111827;
66
+ font-weight: 500;
67
+ color: #6b7280;
68
68
  }
69
69
 
70
70
  .error-details-sub {
@@ -10,7 +10,7 @@
10
10
  </div>
11
11
 
12
12
  <div v-else class="text-center">
13
- <Button key="finish" title="Fechar" classIcon="fa-solid fa-xmark" color="white" backGroundColor="#6D757B" size="medium"
13
+ <Button key="finish" title="Fechar" classIcon="fa-solid fa-circle-xmark" color="white" backGroundColor="#6D757B" size="medium"
14
14
  :clicked="finished" />
15
15
  </div>
16
16
  </div>