-
Notifications
You must be signed in to change notification settings - Fork 995
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #30638 - replace react-numeric-input with rc-number-input
- Loading branch information
yifatmakias
committed
Aug 26, 2020
1 parent
85befdd
commit 5f8a0de
Showing
6 changed files
with
135 additions
and
32 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
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
104 changes: 104 additions & 0 deletions
104
webpack/assets/javascripts/react_app/components/common/forms/NumericInput.scss
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,104 @@ | ||
@import "~@theforeman/vendor/scss/variables"; | ||
@import "~@theforeman/vendor/scss/mixins"; | ||
|
||
.foreman-numeric-input { | ||
position: relative; | ||
display: flex; | ||
|
||
.foreman-numeric-input-input-wrap { | ||
width: 100%; | ||
|
||
// Remove input style when this PR is merged: https://github.com/react-component/input-number/pull/262 | ||
input { | ||
flex: 1; | ||
height: 26px; | ||
width: 100%; | ||
padding-right: $padding-small-vertical; | ||
box-sizing: border-box; | ||
font-size: inherit; | ||
border: 1px solid $input-border; | ||
border-radius: $input-border-radius; | ||
padding-left: $padding-small-vertical; | ||
display: block; | ||
appearance: none; | ||
line-height: normal; | ||
|
||
&:focus { | ||
@include form-control-outline; | ||
} | ||
|
||
&:hover { | ||
border-color: $input-border-hover; | ||
} | ||
|
||
&[disabled] { | ||
box-shadow: none; | ||
border-color: $input-border; | ||
color: #8b8d8f; | ||
cursor: not-allowed; | ||
} | ||
} | ||
} | ||
|
||
.foreman-numeric-input-handler-up-inner, | ||
.foreman-numeric-input-handler-down-inner { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
border-style: solid; | ||
margin: -0.3ex 0 0 -0.56ex; | ||
} | ||
|
||
.foreman-numeric-input-handler-up-inner { | ||
border-width: 0 0.6ex 0.6ex 0.6ex; | ||
border-color: transparent transparent $color-pf-black-600; | ||
} | ||
|
||
.foreman-numeric-input-handler-down-inner { | ||
border-width: 0.6ex 0.6ex 0 0.6ex; | ||
border-color: $color-pf-black-600 transparent transparent; | ||
} | ||
|
||
.foreman-numeric-input-handler-up { | ||
top: 2px; | ||
bottom: 50%; | ||
border-radius: 2px 2px 0 0; | ||
border-width: 1px 1px 0; | ||
} | ||
|
||
.foreman-numeric-input-handler-down { | ||
top: 50%; | ||
bottom: 2px; | ||
border-radius: 0 0 2px 2px; | ||
border-width: 0 1px 1px 1px; | ||
} | ||
|
||
.foreman-numeric-input-handler-up, | ||
.foreman-numeric-input-handler-down { | ||
position: absolute; | ||
right: 2px; | ||
width: 2.26ex; | ||
border-color: $color-pf-black-300; | ||
border-style: solid; | ||
text-align: center; | ||
cursor: default; | ||
transition: all 0.1s ease 0s; | ||
background: $color-pf-black-300; | ||
box-shadow: $color-pf-black-300 -1px -1px 3px inset, $color-pf-black-200 1px 1px 3px inset; | ||
|
||
&:hover { | ||
background: $color-pf-black-400; | ||
} | ||
|
||
&:active { | ||
background: $color-pf-black-500; | ||
box-shadow: 0 1px 3px $color-pf-black-300 inset, -1px -1px 4px $color-pf-black-200 inset; | ||
} | ||
|
||
&:disabled { | ||
opacity: 0.5; | ||
box-shadow: none; | ||
cursor: not-allowed; | ||
} | ||
} | ||
} |
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