-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(activator): update the default activator style
- Loading branch information
Showing
5 changed files
with
149 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<template> | ||
<div class="activator-wrapper"> | ||
<input v-bind="$attrs" class="text-field" :class="inputClass" type="text" :value="value"> | ||
<span v-if="picker.showActivatorBar" class="bar"></span> | ||
<label v-if="picker.showActivatorLabel">Select Date</label> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
inheritAttrs: false, | ||
inject: ['picker'], | ||
props: ['value'], | ||
computed: { | ||
inputClass () { | ||
return { | ||
'text-field__filled': this.value.trim().length > 0, | ||
}; | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
|
||
<style lang="scss"> | ||
@import '../../styles/components/activator.scss'; | ||
</style> |
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,64 @@ | ||
.md-date-range-picker__activator .activator-wrapper { | ||
position:relative; | ||
|
||
.text-field { | ||
display: block; | ||
font-size: 18px; | ||
padding: 4px 10px 10px 5px; | ||
width: 300px; | ||
border: none; | ||
border-bottom: 1px solid #757575; | ||
|
||
&:focus { outline: none; } | ||
} | ||
|
||
/* label */ | ||
label { | ||
color:#999; | ||
font-size:14px; | ||
font-weight: normal; | ||
position: absolute; | ||
pointer-events: none; | ||
left: 5px; | ||
top: 10px; | ||
transition: 0.2s ease all; | ||
} | ||
|
||
/* active state | ||
* use the class if the input value is not empty with javascript trim function | ||
* https://stackoverflow.com/questions/8639282/notempty-css-selector-is-not-working | ||
*/ | ||
.text-field__filled ~ label, | ||
.text-field:focus ~ label { | ||
top: -20px; | ||
font-size: 14px; | ||
color: #1976d2; | ||
} | ||
|
||
/* bottom bars */ | ||
.bar { | ||
position: relative; | ||
display: block; | ||
width: 315px; | ||
|
||
&:before, | ||
&:after { | ||
content: ''; | ||
height: 2px; | ||
width: 0; | ||
bottom: 1px; | ||
position: absolute; | ||
background: #1976d2; | ||
transition: 0.2s ease all; | ||
} | ||
|
||
&:before { left: 50%; } | ||
&:after { right: 50%; } | ||
} | ||
|
||
/* active state */ | ||
.text-field:focus ~ .bar:before, | ||
.text-field:focus ~ .bar:after { | ||
width: 50%; | ||
} | ||
} |
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