Skip to content

Commit

Permalink
Merge pull request #311 from Jacrys/fix-disabled-behaviour
Browse files Browse the repository at this point in the history
Fix: Standardize Disabled behaviour for several components
  • Loading branch information
luisDanielRoviraContreras authored Oct 18, 2018
2 parents 0ed12fa + 606f21b commit d728958
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 16 deletions.
8 changes: 4 additions & 4 deletions docs/components/dropDown.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,9 @@ export default {
<box>
## Buttom
## Button
You can customize the component or element that initialize the dropdown in this case is a Buttom that is the most common
You can customize the component or element that initialize the dropdown in this case, it is a Button that is the most common
:::tip
The component or element that initializes the dropdown is the one inside it with the possibility of total customization and flexibility in the required use
Expand All @@ -484,7 +484,7 @@ You can customize the component or element that initialize the dropdown in this
<vuecode md>
<div slot="demo">
<Demos-DropDown-Buttom />
<Demos-DropDown-Button />
</div>
<div slot="code">
Expand Down Expand Up @@ -591,7 +591,7 @@ export default {
align-items: center;
justify-content: center;
button
margin: 0px !important
margin: 0px !important;
&.btnx
margin-left: 10px !important;
border-radius: 5px 0px 0px 5px;
Expand Down
10 changes: 10 additions & 0 deletions src/components/vsCheckBox/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
z-index: 200;
cursor: pointer;
background: rgb(85, 215, 117);
&:disabled
cursor: default;
pointer-events: none;
& + span.checkbox_x
opacity $vs-disabled-opacity;
cursor: default;
pointer-events: none;
span._check
cursor: default;
pointer-events: none;
&:active:checked
& + span.checkbox_x
span._check
Expand Down
6 changes: 4 additions & 2 deletions src/components/vsCollapse/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
border-bottom: 1px solid rgba(0,0,0,.04)
transition: all .25s ease
&.disabledx
opacity .5
pointer-events: none
opacity: $vs-disabled-opacity;
cursor: default;
pointer-events: none;
z-index: 999;
header
display: block
padding: 10px
Expand Down
3 changes: 2 additions & 1 deletion src/components/vsDropDown/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@
user-select: none;
pointer-events: none !important;
cursor: default;
opacity: .3 !important;
opacity: $vs-disabled-opacity !important;
color: rgba(0,0,0,$vs-disabled-opacity) !important;
&.vsDivider
border-top: 1px solid rgba(0, 0, 0, 0.08)
margin-top: 5px;
Expand Down
8 changes: 8 additions & 0 deletions src/components/vsInput/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@
+ .input-span-placeholder
padding-left: .4rem;
padding-right: 28px
&:disabled
opacity: $vs-disabled-opacity;
cursor: default;
pointer-events: none;
+ .input-span-placeholder
opacity: $vs-disabled-opacity;
cursor: default;
pointer-events: none;
.input-span-placeholder
transition: all .2s ease
position: absolute
Expand Down
24 changes: 23 additions & 1 deletion src/components/vsInputNumber/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
color: rgba(255,255,255,1)
backface-visibility hidden
&:disabled
opacity: .5 !important
opacity: $vs-disabled-opacity;
cursor: default;
pointer-events: none;
i
font-size: .9rem

Expand All @@ -52,10 +54,30 @@
transform translate(10px)
&:active
transform scale(.9) translate(10px) !important
&:disabled
opacity: $vs-disabled-opacity;
cursor: default;
pointer-events: none;
background-color: rgba(0,0,0,$vs-disabled-opacity) !important;
&.btn-plus.limit
opacity: $vs-disabled-opacity;
cursor: default;
pointer-events: none;
background-color: rgba(0,0,0,$vs-disabled-opacity) !important;
&.btn-less
transform translate(-10px)
&:active
transform scale(.9) translate(-10px) !important
&:disabled
opacity: $vs-disabled-opacity;
cursor: default;
pointer-events: none;
background-color: rgba(0,0,0,$vs-disabled-opacity) !important;
&.btn-less.limit
opacity: $vs-disabled-opacity;
cursor: default;
pointer-events: none;
background-color: rgba(0,0,0,$vs-disabled-opacity) !important;

&.vs-input-number-size-medium
input
Expand Down
12 changes: 8 additions & 4 deletions src/components/vsInputNumber/vsInputNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
<button
v-repeat-click="less"
:disabled="$attrs.disabled"
:class="{
limit:value <= min
}"
:style="{
background:getColor,
opacity:(value == min?.5:1)
background:getColor
}"
class="btn-less"
type="button">
Expand All @@ -33,9 +35,11 @@
<button
v-repeat-click="plus"
:disabled="$attrs.disabled"
:class="{
limit:value >= max && max !== null
}"
:style="{
background:getColor,
opacity:value == max?.5:1
background:getColor
}"
class="btn-plus"
type="button">
Expand Down
3 changes: 2 additions & 1 deletion src/components/vsPagination/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@
&.btn-next-pagination
margin-left: 5px
&.btn-pagination.disabled
color: rgba(0,0,0,.1)
color: rgba(0,0,0,$vs-disabled-opacity)
cursor: default
pointer-events: none
&.btn-pagination.disabled:hover
background: rgb(240,240,240) !important
i
Expand Down
6 changes: 6 additions & 0 deletions src/components/vsSelect/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
padding-left 5px;
font-size: .85rem
color $vs-label-color
&:disabled
opacity $vs-disabled-opacity
cursor: default
pointer-events: none
.con-text-validation
position: relative
font-size: .65rem
Expand Down Expand Up @@ -135,6 +139,8 @@ for colorx, i in $vs-colors
text-transform: capitalize;
&.disabledx
opacity: $vs-disabled-opacity;
cursor: default
pointer-events: none
span.searchx
background: rgba(0, 0, 0, 0.07);
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
Expand Down
4 changes: 3 additions & 1 deletion src/components/vsSwitch/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
opacity: 1
transform: translate(0px);
&:disabled
opacity: .5;
opacity $vs-disabled-opacity
cursor: default
pointer-events: none
.vs-circle-switch
display: block;
width: 18px;
Expand Down
4 changes: 2 additions & 2 deletions src/components/vsUpload/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
&:hover
border: 1px dashed alpha($vs-colors[primary],.5)
&.disabled-upload
opacity .5
opacity: $vs-disabled-opacity
pointer-events: none
user-select none
user-select: none
input
position: absolute
width: 100%;
Expand Down

0 comments on commit d728958

Please sign in to comment.