@eturnity/eturnity_reusable_components 8.7.4--EPDM-12729.0 → 8.7.4--EPDM-12729.1
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -14,70 +14,73 @@
|
|
14
14
|
</template>
|
15
15
|
|
16
16
|
<script>
|
17
|
-
// import RCTabsHeader from "@eturnity/eturnity_reusable_components/src/components/tabsHeader"
|
18
|
-
// To use:
|
19
|
-
// <RCTabsHeader
|
20
|
-
// :activeTab="activeTabIndex" // should match the 'id'
|
21
|
-
// :tabsData="[
|
22
|
-
// {
|
23
|
-
// text: 'Tab 1',
|
24
|
-
// id: 0
|
25
|
-
// },
|
26
|
-
// {
|
27
|
-
// text: 'Tab 1',
|
28
|
-
// id: 1
|
29
|
-
// }
|
30
|
-
// ]"
|
31
|
-
// />
|
32
|
-
import styled from 'vue3-styled-components'
|
17
|
+
// import RCTabsHeader from "@eturnity/eturnity_reusable_components/src/components/tabsHeader"
|
18
|
+
// To use:
|
19
|
+
// <RCTabsHeader
|
20
|
+
// :activeTab="activeTabIndex" // should match the 'id'
|
21
|
+
// :tabsData="[
|
22
|
+
// {
|
23
|
+
// text: 'Tab 1',
|
24
|
+
// id: 0
|
25
|
+
// },
|
26
|
+
// {
|
27
|
+
// text: 'Tab 1',
|
28
|
+
// id: 1
|
29
|
+
// }
|
30
|
+
// ]"
|
31
|
+
// />
|
32
|
+
import styled from 'vue3-styled-components'
|
33
33
|
|
34
|
-
const PageContainer = styled.div``
|
34
|
+
const PageContainer = styled.div``
|
35
35
|
|
36
|
-
const TabsContainer = styled.div`
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
`
|
36
|
+
const TabsContainer = styled.div`
|
37
|
+
display: flex;
|
38
|
+
cursor: pointer;
|
39
|
+
width: 100%;
|
40
|
+
`
|
41
41
|
|
42
|
-
const TabAttrs = { isActive: Boolean }
|
43
|
-
const TabItem = styled('div', TabAttrs)`
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
${(props) =>
|
42
|
+
const TabAttrs = { isActive: Boolean }
|
43
|
+
const TabItem = styled('div', TabAttrs)`
|
44
|
+
padding: 10px 20px;
|
45
|
+
font-size: 14px;
|
46
|
+
font-weight: 600;
|
47
|
+
background-color: ${(props) =>
|
48
|
+
props.isActive ? props.theme.colors.secondary : props.theme.colors.white};
|
49
|
+
color: ${(props) =>
|
51
50
|
props.isActive
|
52
51
|
? props.theme.colors.brightBlue
|
53
|
-
: props.theme.colors.
|
54
|
-
|
55
|
-
|
52
|
+
: props.theme.colors.black};
|
53
|
+
border-bottom: ${(props) =>
|
54
|
+
props.isActive
|
55
|
+
? '4px solid' + props.theme.colors.brightBlue
|
56
|
+
: '1px solid' + props.theme.colors.grey4};
|
57
|
+
flex-grow: 1;
|
58
|
+
`
|
56
59
|
|
57
|
-
export default {
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
60
|
+
export default {
|
61
|
+
name: 'RCTabsHeader',
|
62
|
+
components: {
|
63
|
+
PageContainer,
|
64
|
+
TabsContainer,
|
65
|
+
TabItem,
|
66
|
+
},
|
67
|
+
props: {
|
68
|
+
tabsData: {
|
69
|
+
required: true,
|
70
|
+
type: Array,
|
71
|
+
},
|
72
|
+
activeTab: {
|
73
|
+
required: true,
|
74
|
+
type: Number,
|
75
|
+
},
|
76
|
+
},
|
77
|
+
methods: {
|
78
|
+
onTabClick({ id }) {
|
79
|
+
if (id === this.activeTab) {
|
80
|
+
return
|
81
|
+
}
|
82
|
+
this.$emit('on-tab-change', id)
|
83
|
+
},
|
68
84
|
},
|
69
|
-
activeTab: {
|
70
|
-
required: true,
|
71
|
-
type: Number
|
72
|
-
}
|
73
|
-
},
|
74
|
-
methods: {
|
75
|
-
onTabClick({ id }) {
|
76
|
-
if (id === this.activeTab) {
|
77
|
-
return
|
78
|
-
}
|
79
|
-
this.$emit('on-tab-change', id)
|
80
|
-
}
|
81
85
|
}
|
82
|
-
}
|
83
86
|
</script>
|