@farm-investimentos/front-mfe-components 2.4.4 → 2.4.5

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.4",
3
+ "version": "2.4.5",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -1,97 +1,100 @@
1
1
  <template>
2
- <v-tabs color="secondary" v-model="selected">
3
- <v-tab
4
- v-for="(tab, index) in tabs"
5
- :key="index"
6
- :class="{ hideCounter: !showCounter }"
7
- @change="changeTab(tab, index)"
8
- :disabled="!allowUserChange"
9
- >
10
- <div
11
- v-if="showCounter"
12
- :class="{ 'is-selected': isSelected(index) }"
13
- class="pl-3 pr-3 pt-2 pb-2 mr-2 rounded-circle d-inline-block white--text"
14
- >
15
- <span>{{ index + 1 }}</span>
16
- </div>
17
- <span class="black--text text-capitalize">{{ tab.name }}</span>
18
- </v-tab>
19
- </v-tabs>
2
+ <v-tabs color="secondary" v-model="selected">
3
+ <v-tab
4
+ v-for="(tab, index) in tabs"
5
+ :key="index"
6
+ :class="{ hideCounter: !showCounter }"
7
+ @change="changeTab(tab, index)"
8
+ :disabled="!allowUserChange"
9
+ >
10
+ <div
11
+ v-if="showCounter"
12
+ :class="{ 'is-selected': isSelected(index) }"
13
+ class="pl-3 pr-3 pt-2 pb-2 mr-2 rounded-circle d-inline-block white--text"
14
+ >
15
+ <span>{{ index + 1 }}</span>
16
+ </div>
17
+ <span class="black--text text-capitalize">{{ tab.name }}</span>
18
+ </v-tab>
19
+ </v-tabs>
20
20
  </template>
21
21
 
22
22
  <script>
23
23
  import { VTabs, VTab } from 'vuetify/lib/components/VTabs';
24
24
  export default {
25
- data: () => ({
26
- selected: 0,
27
- }),
28
- props: {
29
- tabs: {
30
- type: Array,
31
- default: () => [
32
- {
33
- name: 'Seleção',
34
- path: 'selection',
35
- },
36
- {
37
- name: 'Revisão',
38
- path: 'review',
39
- },
40
- ],
41
- },
42
- showCounter: {
43
- type: Boolean,
44
- default: true,
45
- },
46
- initialSelect: {
47
- type: Number,
48
- default: 0,
49
- },
50
- allowUserChange: {
51
- type: Boolean,
52
- default: true,
53
- },
54
- },
55
- methods: {
56
- isSelected(index) {
57
- return index === this.selected;
58
- },
59
- changeTab(_, index) {
60
- this.$emit('update', this.tabs[index]);
61
- },
62
- next() {
63
- this.selected = this.selected + 1;
64
- this.$emit('update', this.tabs[this.selected]);
65
- },
66
- previous() {
67
- this.selected = this.selected - 1;
68
- this.$emit('update', this.tabs[this.selected]);
69
- },
70
- toIndex(index) {
71
- this.selected = index;
72
- this.$emit('update', this.tabs[index]);
73
- },
74
- updateTabRouting: (component, item, nextRoutePrefix) => {
75
- component.currentTab = item.path;
76
- const nextRoute = `${nextRoutePrefix}/${item.path}`;
77
- const currentRoute = component.$router.history.current.path;
78
- if (nextRoute !== currentRoute) component.$router.push(nextRoute);
79
- },
80
- },
81
- created() {
82
- this.selected = this.initialSelect;
83
- },
84
- components: {
85
- VTabs,
86
- VTab,
87
- },
25
+ data: () => ({
26
+ selected: 0,
27
+ }),
28
+ props: {
29
+ tabs: {
30
+ type: Array,
31
+ default: () => [
32
+ {
33
+ name: 'Seleção',
34
+ path: 'selection',
35
+ },
36
+ {
37
+ name: 'Revisão',
38
+ path: 'review',
39
+ },
40
+ ],
41
+ },
42
+ showCounter: {
43
+ type: Boolean,
44
+ default: true,
45
+ },
46
+ initialSelect: {
47
+ type: Number,
48
+ default: 0,
49
+ },
50
+ allowUserChange: {
51
+ type: Boolean,
52
+ default: true,
53
+ },
54
+ },
55
+ methods: {
56
+ isSelected(index) {
57
+ return index === this.selected;
58
+ },
59
+ changeTab(_, index) {
60
+ this.$emit('update', this.tabs[index]);
61
+ },
62
+ next() {
63
+ this.selected = this.selected + 1;
64
+ this.$emit('update', this.tabs[this.selected]);
65
+ },
66
+ previous() {
67
+ this.selected = this.selected - 1;
68
+ this.$emit('update', this.tabs[this.selected]);
69
+ },
70
+ toIndex(index) {
71
+ this.selected = index;
72
+ this.$emit('update', this.tabs[index]);
73
+ },
74
+ updateTabRouting: (component, item, nextRoutePrefix) => {
75
+ component.currentTab = item.path;
76
+ const nextRoute = `${nextRoutePrefix}/${item.path}`;
77
+ const currentRoute = component.$router.history.current.path;
78
+ if (nextRoute !== currentRoute) component.$router.push(nextRoute);
79
+ },
80
+ },
81
+ created() {
82
+ this.selected = this.initialSelect;
83
+ },
84
+ components: {
85
+ VTabs,
86
+ VTab,
87
+ },
88
88
  };
89
89
  </script>
90
90
  <style scoped lang="scss">
91
91
  div.rounded-circle {
92
- background-color: var(--v-gray-lighten3);
93
- &.is-selected {
94
- background-color: var(--v-secondary-base);
95
- }
92
+ background-color: var(--v-gray-lighten3);
93
+ &.is-selected {
94
+ background-color: var(--v-secondary-base);
95
+ }
96
96
  }
97
- </style>
97
+ .v-tab--active.v-tab--disabled {
98
+ opacity: 1;
99
+ }
100
+ </style>