@farm-investimentos/front-mfe-components 2.4.2 → 2.4.3

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.4.2",
3
+ "version": "2.4.3",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -22,4 +22,4 @@ th.sortable {
22
22
  }
23
23
  }
24
24
  }
25
- }
25
+ }
@@ -31,6 +31,14 @@
31
31
  mdi-sort-descending
32
32
  </v-icon>
33
33
  </span>
34
+
35
+ <span v-if="isTHDataTableSelect(item)">
36
+ <v-simple-checkbox
37
+ :indeterminate="headerProps.someItems && !headerProps.everyItem"
38
+ v-model="inputVal"
39
+ @input="selectAll"
40
+ ></v-simple-checkbox>
41
+ </span>
34
42
  </th>
35
43
  </tr>
36
44
  </thead>
@@ -39,10 +47,13 @@
39
47
  <script>
40
48
  import Vue from 'vue';
41
49
  import VIcon from 'vuetify/lib/components/VIcon';
50
+ import VSimpleCheckbox from 'vuetify/lib/components/VCheckbox/VSimpleCheckbox';
51
+
42
52
  export default Vue.extend({
43
53
  name: 'farm-datatable-header',
44
54
  components: {
45
55
  VIcon,
56
+ VSimpleCheckbox,
46
57
  },
47
58
  props: {
48
59
  /**
@@ -73,6 +84,28 @@ export default Vue.extend({
73
84
  type: Number,
74
85
  default: 0,
75
86
  },
87
+ /**
88
+ * v-model for data-table-select
89
+ */
90
+ value: {
91
+ required: true,
92
+ },
93
+ /**
94
+ * Original header props
95
+ */
96
+ headerProps: {
97
+ type: Object,
98
+ },
99
+ },
100
+ computed: {
101
+ inputVal: {
102
+ get() {
103
+ return this.value;
104
+ },
105
+ set(val) {
106
+ this.$emit('input', val);
107
+ },
108
+ },
76
109
  },
77
110
  methods: {
78
111
  getTypeSort(value) {
@@ -120,6 +153,10 @@ export default Vue.extend({
120
153
  isTHDataTableSelect(item) {
121
154
  return item.value === 'data-table-select';
122
155
  },
156
+ selectAll(value) {
157
+ this.$emit('toggleSelectAll', value);
158
+ this.inputVal = value;
159
+ },
123
160
  },
124
161
  created() {
125
162
  for (let i = 0; i < this.headers.length; i += 1) {