react-time-picker
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -17,2 +17,6 @@ 'use strict'; | ||
var _mergeClassNames = require('merge-class-names'); | ||
var _mergeClassNames2 = _interopRequireDefault(_mergeClassNames); | ||
var _dates = require('../shared/dates'); | ||
@@ -54,4 +58,6 @@ | ||
var className = 'react-time-picker__button__input'; | ||
return _react2.default.createElement('input', { | ||
className: 'react-time-picker__button__input__hour', | ||
className: (0, _mergeClassNames2.default)(className + '__input', className + '__hour'), | ||
name: 'hour', | ||
@@ -58,0 +64,0 @@ max: maxHour, |
@@ -17,2 +17,6 @@ 'use strict'; | ||
var _mergeClassNames = require('merge-class-names'); | ||
var _mergeClassNames2 = _interopRequireDefault(_mergeClassNames); | ||
var _dates = require('../shared/dates'); | ||
@@ -53,5 +57,9 @@ | ||
var hasLeadingZero = value !== null && value < 10; | ||
return _react2.default.createElement('input', { | ||
className: 'react-time-picker__button__input__minute', | ||
var className = 'react-time-picker__button__input'; | ||
return [hasLeadingZero ? '0' : null, _react2.default.createElement('input', { | ||
key: 'minute', | ||
className: (0, _mergeClassNames2.default)(className + '__input', className + '__minute', hasLeadingZero && className + '__input--hasLeadingZero'), | ||
name: 'minute', | ||
@@ -75,3 +83,3 @@ max: maxMinute, | ||
value: value !== null ? value : '' | ||
}); | ||
})]; | ||
} | ||
@@ -78,0 +86,0 @@ }, { |
@@ -17,2 +17,6 @@ 'use strict'; | ||
var _mergeClassNames = require('merge-class-names'); | ||
var _mergeClassNames2 = _interopRequireDefault(_mergeClassNames); | ||
var _dates = require('../shared/dates'); | ||
@@ -53,5 +57,9 @@ | ||
var hasLeadingZero = value !== null && value < 10; | ||
return _react2.default.createElement('input', { | ||
className: 'react-time-picker__button__input__second', | ||
var className = 'react-time-picker__button__input'; | ||
return [hasLeadingZero ? '0' : null, _react2.default.createElement('input', { | ||
key: 'second', | ||
className: (0, _mergeClassNames2.default)(className + '__input', className + '__second', hasLeadingZero && className + '__input--hasLeadingZero'), | ||
name: 'second', | ||
@@ -75,3 +83,3 @@ max: maxSecond, | ||
value: value !== null ? value : '' | ||
}); | ||
})]; | ||
} | ||
@@ -78,0 +86,0 @@ }, { |
{ | ||
"name": "react-time-picker", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "An input component for picking time for your React application.", | ||
@@ -5,0 +5,0 @@ "main": "dist/entry.js", |
@@ -19,5 +19,5 @@ ![downloads](https://img.shields.io/npm/dt/react-time-picker.svg) ![build](https://img.shields.io/travis/wojtekmaj/react-time-picker.svg) ![dependencies](https://img.shields.io/david/wojtekmaj/react-time-picker.svg | ||
## Looking for a date picker? | ||
## Looking for a date picker or a datetime picker? | ||
React-Time-Picker will play nicely with [React-Date-Picker](https://github.com/wojtekmaj/react-date-picker). Check it out! | ||
React-Time-Picker will play nicely with [React-Date-Picker](https://github.com/wojtekmaj/react-date-picker) and [React-DateTime-Picker](https://github.com/wojtekmaj/react-datetime-picker). Check them out! | ||
@@ -24,0 +24,0 @@ ## Getting started |
import React, { PureComponent } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import mergeClassNames from 'merge-class-names'; | ||
@@ -33,5 +34,10 @@ import { | ||
const className = 'react-time-picker__button__input'; | ||
return ( | ||
<input | ||
className="react-time-picker__button__input__hour" | ||
className={mergeClassNames( | ||
`${className}__input`, | ||
`${className}__hour`, | ||
)} | ||
name="hour" | ||
@@ -38,0 +44,0 @@ max={maxHour} |
import React, { PureComponent } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import mergeClassNames from 'merge-class-names'; | ||
@@ -33,6 +34,15 @@ import { | ||
} = this.props; | ||
const hasLeadingZero = value !== null && value < 10; | ||
return ( | ||
const className = 'react-time-picker__button__input'; | ||
return [ | ||
(hasLeadingZero ? '0' : null), | ||
<input | ||
className="react-time-picker__button__input__minute" | ||
key="minute" | ||
className={mergeClassNames( | ||
`${className}__input`, | ||
`${className}__minute`, | ||
hasLeadingZero && `${className}__input--hasLeadingZero`, | ||
)} | ||
name="minute" | ||
@@ -56,4 +66,4 @@ max={maxMinute} | ||
value={value !== null ? value : ''} | ||
/> | ||
); | ||
/>, | ||
]; | ||
} | ||
@@ -60,0 +70,0 @@ } |
import React, { PureComponent } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import mergeClassNames from 'merge-class-names'; | ||
@@ -40,6 +41,15 @@ import { | ||
} = this.props; | ||
const hasLeadingZero = value !== null && value < 10; | ||
return ( | ||
const className = 'react-time-picker__button__input'; | ||
return [ | ||
(hasLeadingZero ? '0' : null), | ||
<input | ||
className="react-time-picker__button__input__second" | ||
key="second" | ||
className={mergeClassNames( | ||
`${className}__input`, | ||
`${className}__second`, | ||
hasLeadingZero && `${className}__input--hasLeadingZero`, | ||
)} | ||
name="second" | ||
@@ -63,4 +73,4 @@ max={maxSecond} | ||
value={value !== null ? value : ''} | ||
/> | ||
); | ||
/>, | ||
]; | ||
} | ||
@@ -67,0 +77,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97453
2349