Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pos/ios tabs #98

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5143fa9
feat: Complete component and follow design
thangnvse Nov 15, 2019
e191767
style: Change style of gtabs and remove hover effect in gtab
thangnvse Nov 15, 2019
8d12dbd
feat: Add list demo to story
thangnvse Nov 15, 2019
8cabb1d
style: Align tab to center
thangnvse Nov 15, 2019
4e118da
feat: Complete storybook for IosTab
thangnvse Nov 16, 2019
889aa3a
refactor: remove unused code
thangnvse Nov 16, 2019
3c1fafc
Merge branch 'master' into POS/IOSTabs
thangnvse Nov 16, 2019
b75f9ac
feat: Add slide animation between tab
thangnvse Nov 18, 2019
b87856f
feat: Use WAAPI to transition g-tab-item
thangnvse Nov 19, 2019
efe97ec
Merge branch 'master' into POS/IOSTabs
thangnvse Nov 19, 2019
13d7109
feat: Separate WAAPI to another file.
thangnvse Nov 19, 2019
99c264b
refactor: Change style code and try animation with javascript hook in…
thangnvse Nov 20, 2019
2343a6f
feat: Add animation by js hook with transition tag built-in Vue
thangnvse Nov 21, 2019
255100b
Merge branch 'master' into POS/IOSTabs
thangnvse Nov 21, 2019
b5620a3
refactor: Add scopeSlots to GListCustom
bboy114crew Nov 21, 2019
407f1eb
refactor: Refactor code in GTabItemVueAnimation
bboy114crew Nov 21, 2019
b6275c1
refactor: Change time in settimeout animation
bboy114crew Nov 21, 2019
8c39715
merge: Merge from master
bboy114crew Nov 21, 2019
16457ac
refactor: Remove console.log
bboy114crew Nov 21, 2019
d0682ca
refactor: Add story for each animation approach
bboy114crew Nov 21, 2019
5c5798e
style: Change style follow design
bboy114crew Nov 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions src/POSComponents/IosTab/GListCustom.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<script>
import GList from "../../components/GList/GList";
import { GListItemAction } from "../../components/GList/GListFunctionalComponent"
export default {
name: 'GListCustom',
components: {GList, GListItemAction},
props: {
height: String,
width: String,
disabled: Boolean,
rounded: Boolean,
shaped: Boolean,
elevation: {
type: [Number, String],
default: 2,
},
dense: Boolean,
nav: Boolean,
items: Array,
multiSection: Boolean,
subheader: String,
divider: {
type: [Boolean, String],
default: false,
},
prependType: {
type: String,
default: 'icon',
},
subtitleWrap: Boolean,
value: [String, Object, Number, Array],
selectable: Boolean,
multiple: Boolean,
mandatory: Boolean,
allowDuplicates: Boolean,
itemValue: String,
itemTitle: {
type: String,
default: 'title'
},
},
setup(props, context) {
return () => (
<g-list {...{
props,
scopedSlots: {
append: ({item, index}) => (
<g-list-item-action class="g-list-item-action" item={item}>{item.append}</g-list-item-action>
)
}
}
}>
</g-list>
)
}
}
</script>

<style lang="scss" scoped>
.g-list {
padding: 0;
border: 1px solid #D1D1D1;
border-radius: 4px;
}

::v-deep .g-list-item-content {
margin-left: 0;
align-self: flex-start;
.g-list-item-text__sub {
font-family: "Muli", sans-serif;
font-style: normal;
font-weight: normal;
font-size: 13px;
}
}

::v-deep .g-list-item-action {
margin: 0 0 0 16px;
align-self: flex-start;
}

::v-deep .g-list-item {
padding: 18px 27px 18px 27px;
}

::v-deep .g-list-header {
padding: 0 0 0 26px;
font-family: "Muli" , sans-serif;
font-style: normal;
font-weight: bold;
font-size: 13px;
line-height: 16px;
color: #1D1D26;
background: #D8D8D8;
border-radius: 3px 3px 0 0;
align-items: center;
}
</style>
106 changes: 106 additions & 0 deletions src/POSComponents/IosTab/IosTab.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<script>
import GTabs from "../../components/GTabs/GTabs";
import GTabItem from "../../components/GTabs/GTabItem";
import GTab from "../../components/GTabs/GTab";
import getVModel from "../../mixins/getVModel";

export default {
name: 'IosTab',
components: {GTab, GTabItem, GTabs},
props: {
items: Array,
value: null,
color: String,
textColor: String,
grow: Boolean,
sliderColor: String,
sliderSize: {
type: [Number, String],
default: 2
},
vertical: Boolean,
right: Boolean,
center: Boolean,
centerActive: Boolean,
icon: Boolean,
alignWithTitle: Boolean,
},
setup(props, context) {
const model = getVModel(props, context);
const gTabItems = () => props.items.map((item, index) => {
return (
<g-tab-item key={index} item={item}>
{item.title}
</g-tab-item>
)
});

return () => (
<g-tabs {
...{
props: {
...props,
ripple: false,
sliderColor: '#1271FF',
slideTransHorLeft: 'left 0.3s, right 0.3s',
slideTransHorRight: 'left 0.3s, right 0.3s',
sliderBorderColor: '29px',
sliderZindex: '-2',
sliderTop: '0px',
sliderHeight: '32px',
},
on: {
input(e) {
model.value = e
}
},
scopedSlots: {
tab: ({item, index}) => (
<g-tab item={item} key={index} >{item.title}</g-tab>
)
}
}
}
>
{context.slots.default ? context.slots.default() : gTabItems()}
</g-tabs>
)
}
}
</script>

<style lang="scss" scoped>
@import "../../style/colors";
@import "../../style/variables";
.g-tabs-wrapper {
align-items: center;
}
::v-deep .g-tab-items {
margin: 17px 0;
width: auto;
}
::v-deep .g-tabs-bar {
mix-blend-mode: normal;
width: 261px;
min-height: 32px;
border-radius: 29px;
font-family: "Muli", sans-serif;
font-style: normal;
font-weight: bold;
font-size: 13px;
line-height: 16px;
text-align: center;
}
::v-deep .g-tab {
flex-basis: 100%;
border-radius: 29px;
text-transform: none;
&:hover:before {
opacity: 0;
}
&:not(.g-tab__active):not(.g-tab__disabled) {
color: color("grey", "base");
opacity: 1;
}
}
</style>
Loading