@farm-investimentos/front-mfe-components 2.2.2 → 2.2.6

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": "@farm-investimentos/front-mfe-components",
3
- "version": "2.2.2",
3
+ "version": "2.2.6",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -13,10 +13,13 @@
13
13
  }
14
14
  }
15
15
 
16
- th.sortable:not(.active) {
17
- &:hover {
18
- .v-icon {
19
- opacity: 0.5 !important;
16
+ th.sortable {
17
+ cursor: pointer;
18
+ &:not(.active) {
19
+ &:hover {
20
+ .v-icon {
21
+ opacity: 0.5 !important;
22
+ }
20
23
  }
21
24
  }
22
- }
25
+ }
@@ -44,17 +44,33 @@ export default Vue.extend({
44
44
  VIcon,
45
45
  },
46
46
  props: {
47
+ /**
48
+ * Cabeçalho
49
+ */
47
50
  headers: {
48
51
  type: Array,
49
52
  require: true,
50
53
  },
54
+ /**
55
+ * Array para controle da exibição da ordenação
56
+ */
51
57
  sortClick: {
52
58
  type: Array,
53
59
  require: true,
54
60
  },
61
+ /**
62
+ * Começar selecionado
63
+ */
55
64
  firstSelected: {
56
65
  type: Boolean,
57
- default: () => false,
66
+ default: false,
67
+ },
68
+ /**
69
+ * Index do item do cabeçalho que deve começar selecionado
70
+ */
71
+ selectedIndex: {
72
+ type: Number,
73
+ default: 0,
58
74
  },
59
75
  },
60
76
  methods: {
@@ -88,8 +104,8 @@ export default Vue.extend({
88
104
  this.sortClick[i].show = false;
89
105
  }
90
106
  },
91
- checkFistSelected(index) {
92
- if (index === 0) {
107
+ checkFirstSelected(index) {
108
+ if (index === this.selectedIndex) {
93
109
  return this.firstSelected;
94
110
  }
95
111
  return false;
@@ -104,8 +120,8 @@ export default Vue.extend({
104
120
  [this.headers[i].value]: false,
105
121
  descending: 'ASC',
106
122
  field: this.headers[i].value,
107
- clicked: this.checkFistSelected(i),
108
- show: this.checkFistSelected(i),
123
+ clicked: this.checkFirstSelected(i),
124
+ show: this.checkFirstSelected(i),
109
125
  });
110
126
  }
111
127
  },