-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MINOR: Fix/bimdata tabs component (#259)
* add possibility to know the active tab * add example for use custom tabs with colors
- Loading branch information
Showing
4 changed files
with
171 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
<template> | ||
<div> | ||
<BIMDataText component="h3" color="color-primary" margin="15px 0 10px"> | ||
Or custom tabs with add colors : | ||
</BIMDataText> | ||
|
||
<div class="m-b-12">Result:</div> | ||
<div class="m-b-12"> | ||
<BIMDataTabs | ||
:tabs="tabsData" | ||
width="100%" | ||
height="40px" | ||
tabSize="220px" | ||
:selected="0" | ||
> | ||
<template #tab="{ tab, active }"> | ||
<div | ||
:style="{ | ||
width: '100%', | ||
height: '100%', | ||
backgroundColor: 'white', | ||
}" | ||
> | ||
<div | ||
:style="{ | ||
backgroundColor: active ? tab.color + '1A' : '', | ||
width: '100%', | ||
height: '100%', | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}" | ||
> | ||
<BIMDataIcon :name="tab.icon" size="xs" margin="0 6px 0 0" /> | ||
<span>{{ tab.text }}</span> | ||
<div | ||
:style="{ | ||
margin: '0 6px', | ||
backgroundColor: active ? tab.color : '#F0F5FF', | ||
width: '15px', | ||
height: '15px', | ||
fontSize: '9px', | ||
fontWeight: 'bold', | ||
color: active ? 'white' : 'var(--color-granite)', | ||
borderRadius: '2px', | ||
lineHeight: '15px', | ||
}" | ||
> | ||
1 | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
</BIMDataTabs> | ||
</div> | ||
<div class="m-b-12"> | ||
<Code language="xml"> | ||
<pre> | ||
<BIMDataTabs | ||
:tabs="[ | ||
{ id: 0, text: 'IFC', icon: 'ifc', color: '#205DBD' }, | ||
{ id: 1, text: 'BCF', icon: 'bcf', color: '#f9c72c' }, | ||
{ id: 2, text: 'My Account', icon: 'user', color: '#44BCFF' }, | ||
{ id: 3, text: 'Settings', icon: 'settings', color: '#FF1E1E' }, | ||
]" | ||
width="100%" | ||
height="40px" | ||
tabSize="220px" | ||
:selected="0" | ||
> | ||
<template #tab="{ tab, active }" > | ||
<div | ||
:style="{ | ||
width: '100%', | ||
height: '100%', | ||
backgroundColor: 'white', | ||
}" | ||
> | ||
<div | ||
:style="{ | ||
backgroundColor: active ? tab.color + '1A' : '', | ||
width: '100%', | ||
height: '100%', | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}" | ||
> | ||
<BIMDataIcon :name="tab.icon" size="xs" margin="0 6px 0 0" /> | ||
<span>{{ "{{ tab.text }" + "}" }}</span> | ||
<div | ||
:style="{ | ||
margin: '0 6px', | ||
backgroundColor: active ? tab.color : '#F0F5FF', | ||
width: '15px', | ||
height: '15px', | ||
fontSize: '9px', | ||
fontWeight: 'bold', | ||
color: active ? 'white' : 'var(--color-granite)', | ||
borderRadius: '2px', | ||
lineHeight: '15px', | ||
}" | ||
> | ||
1 | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
</BIMDataTabs> | ||
</pre | ||
> | ||
</Code> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Code from "../../Elements/Code/Code.vue"; | ||
// components | ||
import BIMDataIcon from "../../../../BIMDataComponents/BIMDataIcon/BIMDataIcon.vue"; | ||
import BIMDataTabs from "../../../../BIMDataComponents/BIMDataTabs/BIMDataTabs.vue"; | ||
import BIMDataText from "../../../../../src/BIMDataComponents/BIMDataText/BIMDataText.vue"; | ||
export default { | ||
components: { | ||
Code, | ||
BIMDataIcon, | ||
BIMDataTabs, | ||
BIMDataText, | ||
}, | ||
data() { | ||
return { | ||
tabsData: [ | ||
{ id: 0, text: "IFC", icon: "ifc", color: "#205DBD" }, | ||
{ id: 1, text: "BCF", icon: "bcf", color: "#f9c72c" }, | ||
{ id: 2, text: "My Account", icon: "user", color: "#44BCFF" }, | ||
{ id: 3, text: "Settings", icon: "settings", color: "#FF1E1E" }, | ||
], | ||
}; | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters