react-datetime-picker
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -493,3 +493,5 @@ "use strict"; | ||
disabled = _this$props6.disabled; | ||
var isOpen = this.state.isOpen; | ||
var _this$state4 = this.state, | ||
isCalendarOpen = _this$state4.isCalendarOpen, | ||
isClockOpen = _this$state4.isClockOpen; | ||
@@ -500,3 +502,3 @@ var onChange = eventProps.onChange, | ||
return /*#__PURE__*/_react["default"].createElement("div", _extends({ | ||
className: (0, _mergeClassNames["default"])(baseClassName, "".concat(baseClassName, "--").concat(isOpen ? 'open' : 'closed'), "".concat(baseClassName, "--").concat(disabled ? 'disabled' : 'enabled'), className) | ||
className: (0, _mergeClassNames["default"])(baseClassName, "".concat(baseClassName, "--").concat(isCalendarOpen || isClockOpen ? 'open' : 'closed'), "".concat(baseClassName, "--").concat(disabled ? 'disabled' : 'enabled'), className) | ||
}, eventPropsWithoutOnChange, { | ||
@@ -503,0 +505,0 @@ onFocus: this.onFocus, |
{ | ||
"name": "react-datetime-picker", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "A date range picker for your React app.", | ||
@@ -5,0 +5,0 @@ "main": "dist/entry.js", |
@@ -438,3 +438,3 @@ import React, { createRef, PureComponent } from 'react'; | ||
const { className, disabled } = this.props; | ||
const { isOpen } = this.state; | ||
const { isCalendarOpen, isClockOpen } = this.state; | ||
@@ -447,3 +447,3 @@ const { onChange, ...eventPropsWithoutOnChange } = eventProps; | ||
baseClassName, | ||
`${baseClassName}--${isOpen ? 'open' : 'closed'}`, | ||
`${baseClassName}--${isCalendarOpen || isClockOpen ? 'open' : 'closed'}`, | ||
`${baseClassName}--${disabled ? 'disabled' : 'enabled'}`, | ||
@@ -450,0 +450,0 @@ className, |
@@ -151,2 +151,18 @@ import React, { createRef } from 'react'; | ||
it('applies "--open" className to its wrapper when given isCalendarOpen flag', () => { | ||
const { container } = render(<DateTimePicker isCalendarOpen />); | ||
const wrapper = container.firstChild; | ||
expect(wrapper).toHaveClass('react-datetime-picker--open'); | ||
}); | ||
it('applies "--open" className to its wrapper when given isClockOpen flag', () => { | ||
const { container } = render(<DateTimePicker isClockOpen />); | ||
const wrapper = container.firstChild; | ||
expect(wrapper).toHaveClass('react-datetime-picker--open'); | ||
}); | ||
it('applies calendarClassName to the calendar when given a string', () => { | ||
@@ -153,0 +169,0 @@ const calendarClassName = 'testClassName'; |
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
224441
4489