Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions lib/components/Number.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const positiveValidation = value => {
const integerValidation = value => parseFloat(value) % 1 === 0;

const numberValidator = (decimal, negative) => value => {
if (value === '') {
return true;
}
if (value === '-' && negative) {
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
"prettier": {
"printWidth": 100,
"singleQuote": true,
"trailingComma": "es5"
"trailingComma": "es5",
"arrowParens": "avoid"
},
"husky": {
"hooks": {
Expand Down
9 changes: 3 additions & 6 deletions stories/Demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const NumPadDemo = () => {
negative={false}
position="startTopLeft"
placeholder="Positive"
value={state.positiveNumber}
>
<TextField label="Positive number" value={state.positiveNumber} />
</NumPad.Number>
Expand Down Expand Up @@ -196,12 +197,8 @@ const NumPadDemo = () => {
onChange={value => dispatch({ type: 'markers.calendar', value })}
dateFormat="DD.MM.YYYY"
markers={[
moment()
.subtract(4, 'days')
.format('DD.MM.YYYY'),
moment()
.add(1, 'days')
.format('DD.MM.YYYY'),
moment().subtract(4, 'days').format('DD.MM.YYYY'),
moment().add(1, 'days').format('DD.MM.YYYY'),
]}
position="startTopLeft"
>
Expand Down