@eturnity/eturnity_reusable_components 7.22.4--EPDM-10563.2 → 7.22.4--EPDM-10563.4
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
|
<template>
|
2
2
|
<info-container>
|
3
|
-
<icon name="info" size="24px" />
|
3
|
+
<icon name="info" size="24px" :color="color" />
|
4
4
|
<text-container>
|
5
5
|
<slot />
|
6
6
|
</text-container>
|
@@ -8,6 +8,7 @@
|
|
8
8
|
</template>
|
9
9
|
|
10
10
|
<script>
|
11
|
+
// import InfoCard from '@eturnity/eturnity_reusable_components/src/components/infoCard'
|
11
12
|
import styled from 'vue3-styled-components'
|
12
13
|
import Icon from '../icon'
|
13
14
|
|
@@ -31,6 +32,11 @@ export default {
|
|
31
32
|
Icon,
|
32
33
|
InfoContainer,
|
33
34
|
TextContainer
|
35
|
+
},
|
36
|
+
props: {
|
37
|
+
color: {
|
38
|
+
required: false
|
39
|
+
}
|
34
40
|
}
|
35
41
|
}
|
36
42
|
</script>
|
@@ -0,0 +1,83 @@
|
|
1
|
+
<template>
|
2
|
+
<PageContainer>
|
3
|
+
<TabsContainer>
|
4
|
+
<TabItem
|
5
|
+
v-for="item in tabsData"
|
6
|
+
:key="item.id"
|
7
|
+
:is-active="activeTab === item.id"
|
8
|
+
@click="onTabClick({ id: item.id })"
|
9
|
+
>
|
10
|
+
{{ item.text }}
|
11
|
+
</TabItem>
|
12
|
+
</TabsContainer>
|
13
|
+
</PageContainer>
|
14
|
+
</template>
|
15
|
+
|
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'
|
33
|
+
|
34
|
+
const PageContainer = styled.div``
|
35
|
+
|
36
|
+
const TabsContainer = styled.div`
|
37
|
+
display: flex;
|
38
|
+
cursor: pointer;
|
39
|
+
width: 100%;
|
40
|
+
`
|
41
|
+
|
42
|
+
const TabAttrs = { isActive: Boolean }
|
43
|
+
const TabItem = styled('div', TabAttrs)`
|
44
|
+
padding: 10px 20px;
|
45
|
+
font-size: 14px;
|
46
|
+
font-weight: 700;
|
47
|
+
background-color: ${(props) =>
|
48
|
+
props.isActive ? props.theme.colors.grey5 : props.theme.colors.white};
|
49
|
+
border-top: 3px solid
|
50
|
+
${(props) =>
|
51
|
+
props.isActive
|
52
|
+
? props.theme.colors.brightBlue
|
53
|
+
: props.theme.colors.grey4};
|
54
|
+
flex-grow: 1;
|
55
|
+
`
|
56
|
+
|
57
|
+
export default {
|
58
|
+
name: 'RCTabsHeader',
|
59
|
+
components: {
|
60
|
+
PageContainer,
|
61
|
+
TabsContainer,
|
62
|
+
TabItem
|
63
|
+
},
|
64
|
+
props: {
|
65
|
+
tabsData: {
|
66
|
+
required: true,
|
67
|
+
type: Array
|
68
|
+
},
|
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
|
+
}
|
82
|
+
}
|
83
|
+
</script>
|