@birdnet/advanced-react-dates 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/.babelrc +67 -0
  2. package/.eslintrc +66 -0
  3. package/.nvmrc +1 -0
  4. package/.nyc_output/4d8efcd220c2aec1f2b4ffd49d875001.json +1 -0
  5. package/.nyc_output/66d34779498a5d49bcf9d757dfc7fdb5.json +1 -0
  6. package/.nyc_output/8ca7e04140934515928bc7d4ae476b73.json +1 -0
  7. package/.nyc_output/afc270bb597bfc50e690436959c2ae54.json +1 -0
  8. package/.nycrc +19 -0
  9. package/.travis.yml +13 -0
  10. package/CHANGELOG.md +665 -0
  11. package/CLAUDE.md +56 -0
  12. package/INTHEWILD.md +9 -0
  13. package/LICENSE +21 -0
  14. package/README.md +421 -2
  15. package/constants.js +2 -0
  16. package/esm/components/CalendarDay.js +321 -0
  17. package/esm/components/CalendarIcon.js +11 -0
  18. package/esm/components/CalendarMonth.js +254 -0
  19. package/esm/components/CalendarMonthGrid.js +365 -0
  20. package/esm/components/CalendarWeek.js +11 -0
  21. package/esm/components/ChevronDown.js +11 -0
  22. package/esm/components/ChevronUp.js +11 -0
  23. package/esm/components/CloseButton.js +12 -0
  24. package/esm/components/CustomizableCalendarDay.js +341 -0
  25. package/esm/components/DateInput.js +344 -0
  26. package/esm/components/DateRangePicker.js +647 -0
  27. package/esm/components/DateRangePickerInput.js +341 -0
  28. package/esm/components/DateRangePickerInputController.js +348 -0
  29. package/esm/components/DayPicker.js +1167 -0
  30. package/esm/components/DayPickerKeyboardShortcuts.js +364 -0
  31. package/esm/components/DayPickerNavigation.js +314 -0
  32. package/esm/components/DayPickerRangeController.js +1202 -0
  33. package/esm/components/DayPickerSingleDateController.js +690 -0
  34. package/esm/components/KeyboardShortcutRow.js +69 -0
  35. package/esm/components/LeftArrow.js +11 -0
  36. package/esm/components/RightArrow.js +11 -0
  37. package/esm/components/SingleDatePicker.js +605 -0
  38. package/esm/components/SingleDatePickerInput.js +264 -0
  39. package/esm/components/SingleDatePickerInputController.js +260 -0
  40. package/esm/constants.js +28 -0
  41. package/esm/defaultPhrases.js +225 -0
  42. package/esm/index.js +20 -0
  43. package/esm/initialize.js +2 -0
  44. package/esm/shapes/AnchorDirectionShape.js +3 -0
  45. package/esm/shapes/CalendarInfoPositionShape.js +3 -0
  46. package/esm/shapes/DateRangePickerShape.js +101 -0
  47. package/esm/shapes/DayOfWeekShape.js +3 -0
  48. package/esm/shapes/DisabledShape.js +3 -0
  49. package/esm/shapes/FocusedInputShape.js +3 -0
  50. package/esm/shapes/IconPositionShape.js +3 -0
  51. package/esm/shapes/ModifiersShape.js +18 -0
  52. package/esm/shapes/NavPositionShape.js +3 -0
  53. package/esm/shapes/OpenDirectionShape.js +3 -0
  54. package/esm/shapes/OrientationShape.js +3 -0
  55. package/esm/shapes/ScrollableOrientationShape.js +3 -0
  56. package/esm/shapes/SingleDatePickerShape.js +90 -0
  57. package/esm/theme/DefaultTheme.js +176 -0
  58. package/esm/utils/calculateDimension.js +28 -0
  59. package/esm/utils/disableScroll.js +67 -0
  60. package/esm/utils/getActiveElement.js +3 -0
  61. package/esm/utils/getCalendarDaySettings.js +48 -0
  62. package/esm/utils/getCalendarMonthWeeks.js +37 -0
  63. package/esm/utils/getCalendarMonthWidth.js +4 -0
  64. package/esm/utils/getDetachedContainerStyles.js +36 -0
  65. package/esm/utils/getInputHeight.js +42 -0
  66. package/esm/utils/getNumberOfCalendarMonthWeeks.js +11 -0
  67. package/esm/utils/getPhrase.js +7 -0
  68. package/esm/utils/getPhrasePropTypes.js +9 -0
  69. package/esm/utils/getPooledMoment.js +8 -0
  70. package/esm/utils/getPreviousMonthMemoLast.js +9 -0
  71. package/esm/utils/getResponsiveContainerStyles.js +8 -0
  72. package/esm/utils/getSelectedDateOffset.js +8 -0
  73. package/esm/utils/getTransformStyles.js +8 -0
  74. package/esm/utils/getVisibleDays.js +42 -0
  75. package/esm/utils/isAfterDay.js +7 -0
  76. package/esm/utils/isBeforeDay.js +13 -0
  77. package/esm/utils/isDayVisible.js +38 -0
  78. package/esm/utils/isInclusivelyAfterDay.js +6 -0
  79. package/esm/utils/isInclusivelyBeforeDay.js +6 -0
  80. package/esm/utils/isNextDay.js +7 -0
  81. package/esm/utils/isNextMonth.js +6 -0
  82. package/esm/utils/isPrevMonth.js +6 -0
  83. package/esm/utils/isPreviousDay.js +7 -0
  84. package/esm/utils/isSameDay.js +7 -0
  85. package/esm/utils/isSameMonth.js +7 -0
  86. package/esm/utils/isTransitionEndSupported.js +3 -0
  87. package/esm/utils/modifiers.js +94 -0
  88. package/esm/utils/noflip.js +10 -0
  89. package/esm/utils/registerCSSInterfaceWithDefaultTheme.js +5 -0
  90. package/esm/utils/registerInterfaceWithDefaultTheme.js +6 -0
  91. package/esm/utils/toISODateString.js +12 -0
  92. package/esm/utils/toISOMonthString.js +12 -0
  93. package/esm/utils/toLocalizedDateString.js +8 -0
  94. package/esm/utils/toMomentObject.js +7 -0
  95. package/index.js +2 -0
  96. package/initialize.js +2 -0
  97. package/karma.conf.js +82 -0
  98. package/lib/components/CalendarDay.js +327 -0
  99. package/lib/components/CalendarIcon.js +18 -0
  100. package/lib/components/CalendarMonth.js +259 -0
  101. package/lib/components/CalendarMonthGrid.js +372 -0
  102. package/lib/components/CalendarWeek.js +18 -0
  103. package/lib/components/ChevronDown.js +18 -0
  104. package/lib/components/ChevronUp.js +18 -0
  105. package/lib/components/CloseButton.js +19 -0
  106. package/lib/components/CustomizableCalendarDay.js +347 -0
  107. package/lib/components/DateInput.js +351 -0
  108. package/lib/components/DateRangePicker.js +653 -0
  109. package/lib/components/DateRangePickerInput.js +348 -0
  110. package/lib/components/DateRangePickerInputController.js +354 -0
  111. package/lib/components/DayPicker.js +1175 -0
  112. package/lib/components/DayPickerKeyboardShortcuts.js +371 -0
  113. package/lib/components/DayPickerNavigation.js +321 -0
  114. package/lib/components/DayPickerRangeController.js +1208 -0
  115. package/lib/components/DayPickerSingleDateController.js +695 -0
  116. package/lib/components/KeyboardShortcutRow.js +76 -0
  117. package/lib/components/LeftArrow.js +18 -0
  118. package/lib/components/RightArrow.js +18 -0
  119. package/lib/components/SingleDatePicker.js +611 -0
  120. package/lib/components/SingleDatePickerInput.js +271 -0
  121. package/lib/components/SingleDatePickerInputController.js +266 -0
  122. package/lib/constants.js +34 -0
  123. package/lib/css/_datepicker.css +886 -0
  124. package/lib/defaultPhrases.js +231 -0
  125. package/lib/index.js +146 -0
  126. package/lib/initialize.js +5 -0
  127. package/lib/shapes/AnchorDirectionShape.js +10 -0
  128. package/lib/shapes/CalendarInfoPositionShape.js +10 -0
  129. package/lib/shapes/DateRangePickerShape.js +108 -0
  130. package/lib/shapes/DayOfWeekShape.js +10 -0
  131. package/lib/shapes/DisabledShape.js +10 -0
  132. package/lib/shapes/FocusedInputShape.js +10 -0
  133. package/lib/shapes/IconPositionShape.js +10 -0
  134. package/lib/shapes/ModifiersShape.js +25 -0
  135. package/lib/shapes/NavPositionShape.js +10 -0
  136. package/lib/shapes/OpenDirectionShape.js +10 -0
  137. package/lib/shapes/OrientationShape.js +10 -0
  138. package/lib/shapes/ScrollableOrientationShape.js +10 -0
  139. package/lib/shapes/SingleDatePickerShape.js +97 -0
  140. package/lib/theme/DefaultTheme.js +182 -0
  141. package/lib/utils/calculateDimension.js +34 -0
  142. package/lib/utils/disableScroll.js +75 -0
  143. package/lib/utils/getActiveElement.js +9 -0
  144. package/lib/utils/getCalendarDaySettings.js +55 -0
  145. package/lib/utils/getCalendarMonthWeeks.js +44 -0
  146. package/lib/utils/getCalendarMonthWidth.js +10 -0
  147. package/lib/utils/getDetachedContainerStyles.js +41 -0
  148. package/lib/utils/getInputHeight.js +48 -0
  149. package/lib/utils/getNumberOfCalendarMonthWeeks.js +18 -0
  150. package/lib/utils/getPhrase.js +13 -0
  151. package/lib/utils/getPhrasePropTypes.js +16 -0
  152. package/lib/utils/getPooledMoment.js +15 -0
  153. package/lib/utils/getPreviousMonthMemoLast.js +15 -0
  154. package/lib/utils/getResponsiveContainerStyles.js +15 -0
  155. package/lib/utils/getSelectedDateOffset.js +14 -0
  156. package/lib/utils/getTransformStyles.js +14 -0
  157. package/lib/utils/getVisibleDays.js +49 -0
  158. package/lib/utils/isAfterDay.js +14 -0
  159. package/lib/utils/isBeforeDay.js +20 -0
  160. package/lib/utils/isDayVisible.js +45 -0
  161. package/lib/utils/isInclusivelyAfterDay.js +13 -0
  162. package/lib/utils/isInclusivelyBeforeDay.js +13 -0
  163. package/lib/utils/isNextDay.js +14 -0
  164. package/lib/utils/isNextMonth.js +13 -0
  165. package/lib/utils/isPrevMonth.js +13 -0
  166. package/lib/utils/isPreviousDay.js +14 -0
  167. package/lib/utils/isSameDay.js +14 -0
  168. package/lib/utils/isSameMonth.js +14 -0
  169. package/lib/utils/isTransitionEndSupported.js +9 -0
  170. package/lib/utils/modifiers.js +102 -0
  171. package/lib/utils/noflip.js +16 -0
  172. package/lib/utils/registerCSSInterfaceWithDefaultTheme.js +12 -0
  173. package/lib/utils/registerInterfaceWithDefaultTheme.js +13 -0
  174. package/lib/utils/toISODateString.js +19 -0
  175. package/lib/utils/toISOMonthString.js +19 -0
  176. package/lib/utils/toLocalizedDateString.js +15 -0
  177. package/lib/utils/toMomentObject.js +14 -0
  178. package/package.json +141 -4
  179. package/scripts/.eslintrc +7 -0
  180. package/scripts/buildCSS.js +37 -0
  181. package/scripts/pure-component-fallback.js +70 -0
  182. package/scripts/renderAllComponents.jsx +25 -0
  183. package/src/components/CalendarDay.jsx +366 -0
  184. package/src/components/CalendarIcon.jsx +3 -0
  185. package/src/components/CalendarMonth.jsx +300 -0
  186. package/src/components/CalendarMonthGrid.jsx +427 -0
  187. package/src/components/CalendarWeek.jsx +17 -0
  188. package/src/components/ChevronDown.jsx +3 -0
  189. package/src/components/ChevronUp.jsx +3 -0
  190. package/src/components/CloseButton.jsx +3 -0
  191. package/src/components/CustomizableCalendarDay.jsx +382 -0
  192. package/src/components/DateInput.jsx +401 -0
  193. package/src/components/DateRangePicker.jsx +777 -0
  194. package/src/components/DateRangePickerInput.jsx +434 -0
  195. package/src/components/DateRangePickerInputController.jsx +379 -0
  196. package/src/components/DayPicker.jsx +1407 -0
  197. package/src/components/DayPickerKeyboardShortcuts.jsx +443 -0
  198. package/src/components/DayPickerNavigation.jsx +445 -0
  199. package/src/components/DayPickerRangeController.jsx +1409 -0
  200. package/src/components/DayPickerSingleDateController.jsx +769 -0
  201. package/src/components/KeyboardShortcutRow.jsx +93 -0
  202. package/src/components/LeftArrow.jsx +3 -0
  203. package/src/components/RightArrow.jsx +3 -0
  204. package/src/components/SingleDatePicker.jsx +731 -0
  205. package/src/components/SingleDatePickerInput.jsx +329 -0
  206. package/src/components/SingleDatePickerInputController.jsx +280 -0
  207. package/src/constants.js +37 -0
  208. package/src/defaultPhrases.js +215 -0
  209. package/src/index.js +20 -0
  210. package/src/initialize.js +3 -0
  211. package/src/shapes/AnchorDirectionShape.js +8 -0
  212. package/src/shapes/CalendarInfoPositionShape.js +15 -0
  213. package/src/shapes/DateRangePickerShape.js +111 -0
  214. package/src/shapes/DayOfWeekShape.js +5 -0
  215. package/src/shapes/DisabledShape.js +5 -0
  216. package/src/shapes/FocusedInputShape.js +8 -0
  217. package/src/shapes/IconPositionShape.js +8 -0
  218. package/src/shapes/ModifiersShape.js +20 -0
  219. package/src/shapes/NavPositionShape.js +8 -0
  220. package/src/shapes/OpenDirectionShape.js +8 -0
  221. package/src/shapes/OrientationShape.js +8 -0
  222. package/src/shapes/ScrollableOrientationShape.js +13 -0
  223. package/src/shapes/SingleDatePickerShape.js +100 -0
  224. package/src/svg/arrow-left.svg +1 -0
  225. package/src/svg/arrow-right.svg +1 -0
  226. package/src/svg/calendar.svg +1 -0
  227. package/src/svg/chevron-down.svg +1 -0
  228. package/src/svg/chevron-up.svg +1 -0
  229. package/src/svg/close.svg +1 -0
  230. package/src/theme/DefaultTheme.js +196 -0
  231. package/src/utils/calculateDimension.js +32 -0
  232. package/src/utils/disableScroll.js +65 -0
  233. package/src/utils/getActiveElement.js +3 -0
  234. package/src/utils/getCalendarDaySettings.js +61 -0
  235. package/src/utils/getCalendarMonthWeeks.js +49 -0
  236. package/src/utils/getCalendarMonthWidth.js +3 -0
  237. package/src/utils/getDetachedContainerStyles.js +39 -0
  238. package/src/utils/getInputHeight.js +67 -0
  239. package/src/utils/getNumberOfCalendarMonthWeeks.js +15 -0
  240. package/src/utils/getPhrase.jsx +9 -0
  241. package/src/utils/getPhrasePropTypes.js +9 -0
  242. package/src/utils/getPooledMoment.js +10 -0
  243. package/src/utils/getPreviousMonthMemoLast.js +11 -0
  244. package/src/utils/getResponsiveContainerStyles.js +18 -0
  245. package/src/utils/getSelectedDateOffset.js +6 -0
  246. package/src/utils/getTransformStyles.js +8 -0
  247. package/src/utils/getVisibleDays.js +54 -0
  248. package/src/utils/isAfterDay.js +9 -0
  249. package/src/utils/isBeforeDay.js +18 -0
  250. package/src/utils/isDayVisible.js +57 -0
  251. package/src/utils/isInclusivelyAfterDay.js +8 -0
  252. package/src/utils/isInclusivelyBeforeDay.js +8 -0
  253. package/src/utils/isNextDay.js +9 -0
  254. package/src/utils/isNextMonth.js +8 -0
  255. package/src/utils/isPrevMonth.js +8 -0
  256. package/src/utils/isPreviousDay.js +9 -0
  257. package/src/utils/isSameDay.js +10 -0
  258. package/src/utils/isSameMonth.js +9 -0
  259. package/src/utils/isTransitionEndSupported.js +3 -0
  260. package/src/utils/modifiers.js +116 -0
  261. package/src/utils/noflip.js +11 -0
  262. package/src/utils/registerCSSInterfaceWithDefaultTheme.js +7 -0
  263. package/src/utils/registerInterfaceWithDefaultTheme.js +7 -0
  264. package/src/utils/toISODateString.js +14 -0
  265. package/src/utils/toISOMonthString.js +14 -0
  266. package/src/utils/toLocalizedDateString.js +12 -0
  267. package/src/utils/toMomentObject.js +12 -0
@@ -0,0 +1,647 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
+ import shallowEqual from "enzyme-shallow-equal";
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
+ import React from 'react';
8
+ import moment from 'moment';
9
+ import { withStyles, withStylesPropTypes } from 'react-with-styles';
10
+ import { Portal } from 'react-portal';
11
+ import { forbidExtraProps } from 'airbnb-prop-types';
12
+ import { addEventListener } from 'consolidated-events';
13
+ import isTouchDevice from 'is-touch-device';
14
+ import OutsideClickHandler from 'react-outside-click-handler';
15
+ import { darken } from 'color2k';
16
+ import DateRangePickerShape from '../shapes/DateRangePickerShape';
17
+ import { DateRangePickerPhrases } from '../defaultPhrases';
18
+ import getResponsiveContainerStyles from '../utils/getResponsiveContainerStyles';
19
+ import getDetachedContainerStyles from '../utils/getDetachedContainerStyles';
20
+ import getInputHeight from '../utils/getInputHeight';
21
+ import isInclusivelyAfterDay from '../utils/isInclusivelyAfterDay';
22
+ import _disableScroll from '../utils/disableScroll';
23
+ import noflip from '../utils/noflip';
24
+ import DateRangePickerInputController from './DateRangePickerInputController';
25
+ import DayPickerRangeController from './DayPickerRangeController';
26
+ import CloseButton from './CloseButton';
27
+ import { START_DATE, END_DATE, HORIZONTAL_ORIENTATION, VERTICAL_ORIENTATION, ANCHOR_LEFT, ANCHOR_RIGHT, OPEN_DOWN, OPEN_UP, DAY_SIZE, ICON_BEFORE_POSITION, INFO_POSITION_BOTTOM, FANG_HEIGHT_PX, DEFAULT_VERTICAL_SPACING, NAV_POSITION_TOP } from '../constants';
28
+ var propTypes = process.env.NODE_ENV !== "production" ? forbidExtraProps(_objectSpread(_objectSpread({}, withStylesPropTypes), DateRangePickerShape)) : {};
29
+ var defaultProps = {
30
+ // required props for a functional interactive DateRangePicker
31
+ startDate: null,
32
+ endDate: null,
33
+ focusedInput: null,
34
+ // input related props
35
+ startDatePlaceholderText: 'Start Date',
36
+ endDatePlaceholderText: 'End Date',
37
+ startDateAriaLabel: undefined,
38
+ endDateAriaLabel: undefined,
39
+ startDateTitleText: undefined,
40
+ endDateTitleText: undefined,
41
+ startDateOffset: undefined,
42
+ endDateOffset: undefined,
43
+ disabled: false,
44
+ required: false,
45
+ readOnly: false,
46
+ screenReaderInputMessage: '',
47
+ showClearDates: false,
48
+ showDefaultInputIcon: false,
49
+ inputIconPosition: ICON_BEFORE_POSITION,
50
+ customInputIcon: null,
51
+ customArrowIcon: null,
52
+ customCloseIcon: null,
53
+ noBorder: false,
54
+ block: false,
55
+ small: false,
56
+ regular: false,
57
+ keepFocusOnInput: false,
58
+ // calendar presentation and interaction related props
59
+ renderMonthText: null,
60
+ renderWeekHeaderElement: null,
61
+ orientation: HORIZONTAL_ORIENTATION,
62
+ anchorDirection: ANCHOR_LEFT,
63
+ openDirection: OPEN_DOWN,
64
+ horizontalMargin: 0,
65
+ withPortal: false,
66
+ withFullScreenPortal: false,
67
+ appendToBody: false,
68
+ disableScroll: false,
69
+ initialVisibleMonth: null,
70
+ numberOfMonths: 2,
71
+ keepOpenOnDateSelect: false,
72
+ reopenPickerOnClearDates: false,
73
+ renderCalendarInfo: null,
74
+ calendarInfoPosition: INFO_POSITION_BOTTOM,
75
+ hideKeyboardShortcutsPanel: false,
76
+ daySize: DAY_SIZE,
77
+ isRTL: false,
78
+ firstDayOfWeek: null,
79
+ verticalHeight: null,
80
+ transitionDuration: undefined,
81
+ verticalSpacing: DEFAULT_VERTICAL_SPACING,
82
+ autoComplete: 'off',
83
+ horizontalMonthPadding: undefined,
84
+ // navigation related props
85
+ dayPickerNavigationInlineStyles: null,
86
+ navPosition: NAV_POSITION_TOP,
87
+ navPrev: null,
88
+ navNext: null,
89
+ renderNavPrevButton: null,
90
+ renderNavNextButton: null,
91
+ onPrevMonthClick: function onPrevMonthClick() {},
92
+ onNextMonthClick: function onNextMonthClick() {},
93
+ onClose: function onClose() {},
94
+ // day presentation and interaction related props
95
+ renderCalendarDay: undefined,
96
+ renderDayContents: null,
97
+ renderMonthElement: null,
98
+ minimumNights: 1,
99
+ enableOutsideDays: false,
100
+ isDayBlocked: function isDayBlocked() {
101
+ return false;
102
+ },
103
+ isOutsideRange: function isOutsideRange(day) {
104
+ return !isInclusivelyAfterDay(day, moment());
105
+ },
106
+ isDayHighlighted: function isDayHighlighted() {
107
+ return false;
108
+ },
109
+ minDate: undefined,
110
+ maxDate: undefined,
111
+ // internationalization
112
+ displayFormat: function displayFormat() {
113
+ return moment.localeData().longDateFormat('L');
114
+ },
115
+ monthFormat: 'MMMM YYYY',
116
+ weekDayFormat: 'dd',
117
+ phrases: DateRangePickerPhrases,
118
+ dayAriaLabelFormat: undefined
119
+ };
120
+ var DateRangePicker = /*#__PURE__*/function (_ref2, _ref) {
121
+ function DateRangePicker(props) {
122
+ var _this;
123
+ _this = _ref2.call(this, props) || this;
124
+ _this.state = {
125
+ dayPickerContainerStyles: {},
126
+ isDateRangePickerInputFocused: false,
127
+ isDayPickerFocused: false,
128
+ showKeyboardShortcuts: false
129
+ };
130
+ _this.isTouchDevice = false;
131
+ _this.onOutsideClick = _this.onOutsideClick.bind(_this);
132
+ _this.onDateRangePickerInputFocus = _this.onDateRangePickerInputFocus.bind(_this);
133
+ _this.onDayPickerFocus = _this.onDayPickerFocus.bind(_this);
134
+ _this.onDayPickerFocusOut = _this.onDayPickerFocusOut.bind(_this);
135
+ _this.onDayPickerBlur = _this.onDayPickerBlur.bind(_this);
136
+ _this.showKeyboardShortcutsPanel = _this.showKeyboardShortcutsPanel.bind(_this);
137
+ _this.responsivizePickerPosition = _this.responsivizePickerPosition.bind(_this);
138
+ _this.disableScroll = _this.disableScroll.bind(_this);
139
+ _this.setDayPickerContainerRef = _this.setDayPickerContainerRef.bind(_this);
140
+ _this.setContainerRef = _this.setContainerRef.bind(_this);
141
+ return _this;
142
+ }
143
+ _inheritsLoose(DateRangePicker, _ref2);
144
+ var _proto = DateRangePicker.prototype;
145
+ _proto[_ref] = function (nextProps, nextState) {
146
+ return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState);
147
+ };
148
+ _proto.componentDidMount = function componentDidMount() {
149
+ this.removeEventListener = addEventListener(window, 'resize', this.responsivizePickerPosition, {
150
+ passive: true
151
+ });
152
+ this.responsivizePickerPosition();
153
+ this.disableScroll();
154
+ var focusedInput = this.props.focusedInput;
155
+ if (focusedInput) {
156
+ this.setState({
157
+ isDateRangePickerInputFocused: true
158
+ });
159
+ }
160
+ this.isTouchDevice = isTouchDevice();
161
+ };
162
+ _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
163
+ var focusedInput = this.props.focusedInput;
164
+ if (!prevProps.focusedInput && focusedInput && this.isOpened()) {
165
+ // The date picker just changed from being closed to being open.
166
+ this.responsivizePickerPosition();
167
+ this.disableScroll();
168
+ } else if (prevProps.focusedInput && !focusedInput && !this.isOpened()) {
169
+ // The date picker just changed from being open to being closed.
170
+ if (this.enableScroll) this.enableScroll();
171
+ }
172
+ };
173
+ _proto.componentWillUnmount = function componentWillUnmount() {
174
+ this.removeDayPickerEventListeners();
175
+ if (this.removeEventListener) this.removeEventListener();
176
+ if (this.enableScroll) this.enableScroll();
177
+ };
178
+ _proto.onOutsideClick = function onOutsideClick(event) {
179
+ var _this$props = this.props,
180
+ onFocusChange = _this$props.onFocusChange,
181
+ onClose = _this$props.onClose,
182
+ startDate = _this$props.startDate,
183
+ endDate = _this$props.endDate,
184
+ appendToBody = _this$props.appendToBody;
185
+ if (!this.isOpened()) return;
186
+ if (appendToBody && this.dayPickerContainer.contains(event.target)) return;
187
+ this.setState({
188
+ isDateRangePickerInputFocused: false,
189
+ isDayPickerFocused: false,
190
+ showKeyboardShortcuts: false
191
+ });
192
+ onFocusChange(null);
193
+ onClose({
194
+ startDate: startDate,
195
+ endDate: endDate
196
+ });
197
+ };
198
+ _proto.onDateRangePickerInputFocus = function onDateRangePickerInputFocus(focusedInput) {
199
+ var _this$props2 = this.props,
200
+ onFocusChange = _this$props2.onFocusChange,
201
+ readOnly = _this$props2.readOnly,
202
+ withPortal = _this$props2.withPortal,
203
+ withFullScreenPortal = _this$props2.withFullScreenPortal,
204
+ keepFocusOnInput = _this$props2.keepFocusOnInput;
205
+ if (focusedInput) {
206
+ var withAnyPortal = withPortal || withFullScreenPortal;
207
+ var moveFocusToDayPicker = withAnyPortal || readOnly && !keepFocusOnInput || this.isTouchDevice && !keepFocusOnInput;
208
+ if (moveFocusToDayPicker) {
209
+ this.onDayPickerFocus();
210
+ } else {
211
+ this.onDayPickerBlur();
212
+ }
213
+ }
214
+ onFocusChange(focusedInput);
215
+ };
216
+ _proto.onDayPickerFocus = function onDayPickerFocus() {
217
+ var _this$props3 = this.props,
218
+ focusedInput = _this$props3.focusedInput,
219
+ onFocusChange = _this$props3.onFocusChange;
220
+ if (!focusedInput) onFocusChange(START_DATE);
221
+ this.setState({
222
+ isDateRangePickerInputFocused: false,
223
+ isDayPickerFocused: true,
224
+ showKeyboardShortcuts: false
225
+ });
226
+ };
227
+ _proto.onDayPickerFocusOut = function onDayPickerFocusOut(event) {
228
+ // In cases where **relatedTarget** is not null, it points to the right
229
+ // element here. However, in cases where it is null (such as clicking on a
230
+ // specific day) or it is **document.body** (IE11), the appropriate value is **event.target**.
231
+ //
232
+ // We handle both situations here by using the ` || ` operator to fallback
233
+ // to *event.target** when **relatedTarget** is not provided.
234
+ var relatedTarget = event.relatedTarget === document.body ? event.target : event.relatedTarget || event.target;
235
+ if (this.dayPickerContainer.contains(relatedTarget)) return;
236
+ this.onOutsideClick(event);
237
+ };
238
+ _proto.onDayPickerBlur = function onDayPickerBlur() {
239
+ this.setState({
240
+ isDateRangePickerInputFocused: true,
241
+ isDayPickerFocused: false,
242
+ showKeyboardShortcuts: false
243
+ });
244
+ };
245
+ _proto.setDayPickerContainerRef = function setDayPickerContainerRef(ref) {
246
+ if (ref === this.dayPickerContainer) return;
247
+ if (this.dayPickerContainer) this.removeDayPickerEventListeners();
248
+ this.dayPickerContainer = ref;
249
+ if (!ref) return;
250
+ this.addDayPickerEventListeners();
251
+ };
252
+ _proto.setContainerRef = function setContainerRef(ref) {
253
+ this.container = ref;
254
+ };
255
+ _proto.addDayPickerEventListeners = function addDayPickerEventListeners() {
256
+ // NOTE: We are using a manual event listener here, because React doesn't
257
+ // provide FocusOut, while blur and keydown don't provide the information
258
+ // needed in order to know whether we have left focus or not.
259
+ //
260
+ // For reference, this issue is further described here:
261
+ // - https://github.com/facebook/react/issues/6410
262
+ this.removeDayPickerFocusOut = addEventListener(this.dayPickerContainer, 'focusout', this.onDayPickerFocusOut);
263
+ };
264
+ _proto.removeDayPickerEventListeners = function removeDayPickerEventListeners() {
265
+ if (this.removeDayPickerFocusOut) this.removeDayPickerFocusOut();
266
+ };
267
+ _proto.isOpened = function isOpened() {
268
+ var focusedInput = this.props.focusedInput;
269
+ return focusedInput === START_DATE || focusedInput === END_DATE;
270
+ };
271
+ _proto.disableScroll = function disableScroll() {
272
+ var _this$props4 = this.props,
273
+ appendToBody = _this$props4.appendToBody,
274
+ propDisableScroll = _this$props4.disableScroll;
275
+ if (!appendToBody && !propDisableScroll) return;
276
+ if (!this.isOpened()) return;
277
+
278
+ // Disable scroll for every ancestor of this DateRangePicker up to the
279
+ // document level. This ensures the input and the picker never move. Other
280
+ // sibling elements or the picker itself can scroll.
281
+ this.enableScroll = _disableScroll(this.container);
282
+ };
283
+ _proto.responsivizePickerPosition = function responsivizePickerPosition() {
284
+ // It's possible the portal props have been changed in response to window resizes
285
+ // So let's ensure we reset this back to the base state each time
286
+ var dayPickerContainerStyles = this.state.dayPickerContainerStyles;
287
+ if (Object.keys(dayPickerContainerStyles).length > 0) {
288
+ this.setState({
289
+ dayPickerContainerStyles: {}
290
+ });
291
+ }
292
+ if (!this.isOpened()) {
293
+ return;
294
+ }
295
+ var _this$props5 = this.props,
296
+ openDirection = _this$props5.openDirection,
297
+ anchorDirection = _this$props5.anchorDirection,
298
+ horizontalMargin = _this$props5.horizontalMargin,
299
+ withPortal = _this$props5.withPortal,
300
+ withFullScreenPortal = _this$props5.withFullScreenPortal,
301
+ appendToBody = _this$props5.appendToBody;
302
+ var isAnchoredLeft = anchorDirection === ANCHOR_LEFT;
303
+ if (!withPortal && !withFullScreenPortal) {
304
+ var containerRect = this.dayPickerContainer.getBoundingClientRect();
305
+ var currentOffset = dayPickerContainerStyles[anchorDirection] || 0;
306
+ var containerEdge = isAnchoredLeft ? containerRect[ANCHOR_RIGHT] : containerRect[ANCHOR_LEFT];
307
+ this.setState({
308
+ dayPickerContainerStyles: _objectSpread(_objectSpread({}, getResponsiveContainerStyles(anchorDirection, currentOffset, containerEdge, horizontalMargin)), appendToBody && getDetachedContainerStyles(openDirection, anchorDirection, this.container))
309
+ });
310
+ }
311
+ };
312
+ _proto.showKeyboardShortcutsPanel = function showKeyboardShortcutsPanel() {
313
+ this.setState({
314
+ isDateRangePickerInputFocused: false,
315
+ isDayPickerFocused: true,
316
+ showKeyboardShortcuts: true
317
+ });
318
+ };
319
+ _proto.maybeRenderDayPickerWithPortal = function maybeRenderDayPickerWithPortal() {
320
+ var _this$props6 = this.props,
321
+ withPortal = _this$props6.withPortal,
322
+ withFullScreenPortal = _this$props6.withFullScreenPortal,
323
+ appendToBody = _this$props6.appendToBody;
324
+ if (!this.isOpened()) {
325
+ return null;
326
+ }
327
+ if (withPortal || withFullScreenPortal || appendToBody) {
328
+ return /*#__PURE__*/React.createElement(Portal, null, this.renderDayPicker());
329
+ }
330
+ return this.renderDayPicker();
331
+ };
332
+ _proto.renderDayPicker = function renderDayPicker() {
333
+ var _this$props7 = this.props,
334
+ anchorDirection = _this$props7.anchorDirection,
335
+ openDirection = _this$props7.openDirection,
336
+ isDayBlocked = _this$props7.isDayBlocked,
337
+ isDayHighlighted = _this$props7.isDayHighlighted,
338
+ isOutsideRange = _this$props7.isOutsideRange,
339
+ numberOfMonths = _this$props7.numberOfMonths,
340
+ orientation = _this$props7.orientation,
341
+ monthFormat = _this$props7.monthFormat,
342
+ renderMonthText = _this$props7.renderMonthText,
343
+ renderWeekHeaderElement = _this$props7.renderWeekHeaderElement,
344
+ dayPickerNavigationInlineStyles = _this$props7.dayPickerNavigationInlineStyles,
345
+ navPosition = _this$props7.navPosition,
346
+ navPrev = _this$props7.navPrev,
347
+ navNext = _this$props7.navNext,
348
+ renderNavPrevButton = _this$props7.renderNavPrevButton,
349
+ renderNavNextButton = _this$props7.renderNavNextButton,
350
+ onPrevMonthClick = _this$props7.onPrevMonthClick,
351
+ onNextMonthClick = _this$props7.onNextMonthClick,
352
+ onDatesChange = _this$props7.onDatesChange,
353
+ onFocusChange = _this$props7.onFocusChange,
354
+ withPortal = _this$props7.withPortal,
355
+ withFullScreenPortal = _this$props7.withFullScreenPortal,
356
+ daySize = _this$props7.daySize,
357
+ enableOutsideDays = _this$props7.enableOutsideDays,
358
+ focusedInput = _this$props7.focusedInput,
359
+ startDate = _this$props7.startDate,
360
+ startDateOffset = _this$props7.startDateOffset,
361
+ endDate = _this$props7.endDate,
362
+ endDateOffset = _this$props7.endDateOffset,
363
+ minDate = _this$props7.minDate,
364
+ maxDate = _this$props7.maxDate,
365
+ minimumNights = _this$props7.minimumNights,
366
+ keepOpenOnDateSelect = _this$props7.keepOpenOnDateSelect,
367
+ renderCalendarDay = _this$props7.renderCalendarDay,
368
+ renderDayContents = _this$props7.renderDayContents,
369
+ renderCalendarInfo = _this$props7.renderCalendarInfo,
370
+ renderMonthElement = _this$props7.renderMonthElement,
371
+ calendarInfoPosition = _this$props7.calendarInfoPosition,
372
+ firstDayOfWeek = _this$props7.firstDayOfWeek,
373
+ initialVisibleMonth = _this$props7.initialVisibleMonth,
374
+ hideKeyboardShortcutsPanel = _this$props7.hideKeyboardShortcutsPanel,
375
+ customCloseIcon = _this$props7.customCloseIcon,
376
+ onClose = _this$props7.onClose,
377
+ phrases = _this$props7.phrases,
378
+ dayAriaLabelFormat = _this$props7.dayAriaLabelFormat,
379
+ isRTL = _this$props7.isRTL,
380
+ weekDayFormat = _this$props7.weekDayFormat,
381
+ css = _this$props7.css,
382
+ styles = _this$props7.styles,
383
+ verticalHeight = _this$props7.verticalHeight,
384
+ noBorder = _this$props7.noBorder,
385
+ transitionDuration = _this$props7.transitionDuration,
386
+ verticalSpacing = _this$props7.verticalSpacing,
387
+ horizontalMonthPadding = _this$props7.horizontalMonthPadding,
388
+ small = _this$props7.small,
389
+ disabled = _this$props7.disabled,
390
+ reactDates = _this$props7.theme.reactDates;
391
+ var _this$state = this.state,
392
+ dayPickerContainerStyles = _this$state.dayPickerContainerStyles,
393
+ isDayPickerFocused = _this$state.isDayPickerFocused,
394
+ showKeyboardShortcuts = _this$state.showKeyboardShortcuts;
395
+ var onOutsideClick = !withFullScreenPortal && withPortal ? this.onOutsideClick : undefined;
396
+ var initialVisibleMonthThunk = initialVisibleMonth || function () {
397
+ return startDate || endDate || moment();
398
+ };
399
+ var closeIcon = customCloseIcon || /*#__PURE__*/React.createElement(CloseButton, css(styles.DateRangePicker_closeButton_svg));
400
+ var inputHeight = getInputHeight(reactDates, small);
401
+ var withAnyPortal = withPortal || withFullScreenPortal;
402
+
403
+ /* eslint-disable jsx-a11y/no-static-element-interactions */
404
+ /* eslint-disable jsx-a11y/click-events-have-key-events */
405
+ return /*#__PURE__*/React.createElement("div", _extends({
406
+ key: "day-picker",
407
+ ref: this.setDayPickerContainerRef
408
+ }, css(styles.DateRangePicker_picker, anchorDirection === ANCHOR_LEFT && styles.DateRangePicker_picker__directionLeft, anchorDirection === ANCHOR_RIGHT && styles.DateRangePicker_picker__directionRight, orientation === HORIZONTAL_ORIENTATION && styles.DateRangePicker_picker__horizontal, orientation === VERTICAL_ORIENTATION && styles.DateRangePicker_picker__vertical, !withAnyPortal && openDirection === OPEN_DOWN && {
409
+ top: inputHeight + verticalSpacing
410
+ }, !withAnyPortal && openDirection === OPEN_UP && {
411
+ bottom: inputHeight + verticalSpacing
412
+ }, withAnyPortal && styles.DateRangePicker_picker__portal, withFullScreenPortal && styles.DateRangePicker_picker__fullScreenPortal, isRTL && styles.DateRangePicker_picker__rtl, dayPickerContainerStyles), {
413
+ onClick: onOutsideClick
414
+ }), /*#__PURE__*/React.createElement(DayPickerRangeController, {
415
+ orientation: orientation,
416
+ enableOutsideDays: enableOutsideDays,
417
+ numberOfMonths: numberOfMonths,
418
+ onPrevMonthClick: onPrevMonthClick,
419
+ onNextMonthClick: onNextMonthClick,
420
+ onDatesChange: onDatesChange,
421
+ onFocusChange: onFocusChange,
422
+ onClose: onClose,
423
+ focusedInput: focusedInput,
424
+ startDate: startDate,
425
+ startDateOffset: startDateOffset,
426
+ endDate: endDate,
427
+ endDateOffset: endDateOffset,
428
+ minDate: minDate,
429
+ maxDate: maxDate,
430
+ monthFormat: monthFormat,
431
+ renderMonthText: renderMonthText,
432
+ renderWeekHeaderElement: renderWeekHeaderElement,
433
+ withPortal: withAnyPortal,
434
+ daySize: daySize,
435
+ initialVisibleMonth: initialVisibleMonthThunk,
436
+ hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
437
+ dayPickerNavigationInlineStyles: dayPickerNavigationInlineStyles,
438
+ navPosition: navPosition,
439
+ navPrev: navPrev,
440
+ navNext: navNext,
441
+ renderNavPrevButton: renderNavPrevButton,
442
+ renderNavNextButton: renderNavNextButton,
443
+ minimumNights: minimumNights,
444
+ isOutsideRange: isOutsideRange,
445
+ isDayHighlighted: isDayHighlighted,
446
+ isDayBlocked: isDayBlocked,
447
+ keepOpenOnDateSelect: keepOpenOnDateSelect,
448
+ renderCalendarDay: renderCalendarDay,
449
+ renderDayContents: renderDayContents,
450
+ renderCalendarInfo: renderCalendarInfo,
451
+ renderMonthElement: renderMonthElement,
452
+ calendarInfoPosition: calendarInfoPosition,
453
+ isFocused: isDayPickerFocused,
454
+ showKeyboardShortcuts: showKeyboardShortcuts,
455
+ onBlur: this.onDayPickerBlur,
456
+ phrases: phrases,
457
+ dayAriaLabelFormat: dayAriaLabelFormat,
458
+ isRTL: isRTL,
459
+ firstDayOfWeek: firstDayOfWeek,
460
+ weekDayFormat: weekDayFormat,
461
+ verticalHeight: verticalHeight,
462
+ noBorder: noBorder,
463
+ transitionDuration: transitionDuration,
464
+ disabled: disabled,
465
+ horizontalMonthPadding: horizontalMonthPadding
466
+ }), withFullScreenPortal && /*#__PURE__*/React.createElement("button", _extends({}, css(styles.DateRangePicker_closeButton), {
467
+ type: "button",
468
+ onClick: this.onOutsideClick,
469
+ "aria-label": phrases.closeDatePicker,
470
+ tabIndex: "-1"
471
+ }), closeIcon));
472
+ /* eslint-enable jsx-a11y/no-static-element-interactions */
473
+ /* eslint-enable jsx-a11y/click-events-have-key-events */
474
+ };
475
+ _proto.render = function render() {
476
+ var _this$props8 = this.props,
477
+ startDate = _this$props8.startDate,
478
+ startDateId = _this$props8.startDateId,
479
+ startDatePlaceholderText = _this$props8.startDatePlaceholderText,
480
+ startDateAriaLabel = _this$props8.startDateAriaLabel,
481
+ startDateTitleText = _this$props8.startDateTitleText,
482
+ endDate = _this$props8.endDate,
483
+ endDateId = _this$props8.endDateId,
484
+ endDatePlaceholderText = _this$props8.endDatePlaceholderText,
485
+ endDateAriaLabel = _this$props8.endDateAriaLabel,
486
+ endDateTitleText = _this$props8.endDateTitleText,
487
+ focusedInput = _this$props8.focusedInput,
488
+ screenReaderInputMessage = _this$props8.screenReaderInputMessage,
489
+ showClearDates = _this$props8.showClearDates,
490
+ showDefaultInputIcon = _this$props8.showDefaultInputIcon,
491
+ inputIconPosition = _this$props8.inputIconPosition,
492
+ customInputIcon = _this$props8.customInputIcon,
493
+ customArrowIcon = _this$props8.customArrowIcon,
494
+ customCloseIcon = _this$props8.customCloseIcon,
495
+ disabled = _this$props8.disabled,
496
+ required = _this$props8.required,
497
+ readOnly = _this$props8.readOnly,
498
+ autoComplete = _this$props8.autoComplete,
499
+ openDirection = _this$props8.openDirection,
500
+ phrases = _this$props8.phrases,
501
+ isOutsideRange = _this$props8.isOutsideRange,
502
+ isDayBlocked = _this$props8.isDayBlocked,
503
+ minimumNights = _this$props8.minimumNights,
504
+ withPortal = _this$props8.withPortal,
505
+ withFullScreenPortal = _this$props8.withFullScreenPortal,
506
+ displayFormat = _this$props8.displayFormat,
507
+ reopenPickerOnClearDates = _this$props8.reopenPickerOnClearDates,
508
+ keepOpenOnDateSelect = _this$props8.keepOpenOnDateSelect,
509
+ onDatesChange = _this$props8.onDatesChange,
510
+ onClose = _this$props8.onClose,
511
+ isRTL = _this$props8.isRTL,
512
+ noBorder = _this$props8.noBorder,
513
+ block = _this$props8.block,
514
+ verticalSpacing = _this$props8.verticalSpacing,
515
+ small = _this$props8.small,
516
+ regular = _this$props8.regular,
517
+ css = _this$props8.css,
518
+ styles = _this$props8.styles;
519
+ var isDateRangePickerInputFocused = this.state.isDateRangePickerInputFocused;
520
+ var enableOutsideClick = !withPortal && !withFullScreenPortal;
521
+ var hideFang = verticalSpacing < FANG_HEIGHT_PX;
522
+ var input = /*#__PURE__*/React.createElement(DateRangePickerInputController, {
523
+ startDate: startDate,
524
+ startDateId: startDateId,
525
+ startDatePlaceholderText: startDatePlaceholderText,
526
+ isStartDateFocused: focusedInput === START_DATE,
527
+ startDateAriaLabel: startDateAriaLabel,
528
+ startDateTitleText: startDateTitleText,
529
+ endDate: endDate,
530
+ endDateId: endDateId,
531
+ endDatePlaceholderText: endDatePlaceholderText,
532
+ isEndDateFocused: focusedInput === END_DATE,
533
+ endDateAriaLabel: endDateAriaLabel,
534
+ endDateTitleText: endDateTitleText,
535
+ displayFormat: displayFormat,
536
+ showClearDates: showClearDates,
537
+ showCaret: !withPortal && !withFullScreenPortal && !hideFang,
538
+ showDefaultInputIcon: showDefaultInputIcon,
539
+ inputIconPosition: inputIconPosition,
540
+ customInputIcon: customInputIcon,
541
+ customArrowIcon: customArrowIcon,
542
+ customCloseIcon: customCloseIcon,
543
+ disabled: disabled,
544
+ required: required,
545
+ readOnly: readOnly,
546
+ openDirection: openDirection,
547
+ reopenPickerOnClearDates: reopenPickerOnClearDates,
548
+ keepOpenOnDateSelect: keepOpenOnDateSelect,
549
+ isOutsideRange: isOutsideRange,
550
+ isDayBlocked: isDayBlocked,
551
+ minimumNights: minimumNights,
552
+ withFullScreenPortal: withFullScreenPortal,
553
+ onDatesChange: onDatesChange,
554
+ onFocusChange: this.onDateRangePickerInputFocus,
555
+ onKeyDownArrowDown: this.onDayPickerFocus,
556
+ onKeyDownQuestionMark: this.showKeyboardShortcutsPanel,
557
+ onClose: onClose,
558
+ phrases: phrases,
559
+ screenReaderMessage: screenReaderInputMessage,
560
+ isFocused: isDateRangePickerInputFocused,
561
+ isRTL: isRTL,
562
+ noBorder: noBorder,
563
+ block: block,
564
+ small: small,
565
+ regular: regular,
566
+ verticalSpacing: verticalSpacing,
567
+ autoComplete: autoComplete
568
+ }, this.maybeRenderDayPickerWithPortal());
569
+ return /*#__PURE__*/React.createElement("div", _extends({
570
+ ref: this.setContainerRef
571
+ }, css(styles.DateRangePicker, block && styles.DateRangePicker__block)), enableOutsideClick && /*#__PURE__*/React.createElement(OutsideClickHandler, {
572
+ onOutsideClick: this.onOutsideClick
573
+ }, input), enableOutsideClick || input);
574
+ };
575
+ return DateRangePicker;
576
+ }(React.PureComponent || React.Component, !React.PureComponent && "shouldComponentUpdate");
577
+ DateRangePicker.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
578
+ DateRangePicker.defaultProps = defaultProps;
579
+ export { DateRangePicker as PureDateRangePicker };
580
+ export default withStyles(function (_ref3) {
581
+ var _ref3$reactDates = _ref3.reactDates,
582
+ color = _ref3$reactDates.color,
583
+ zIndex = _ref3$reactDates.zIndex;
584
+ return {
585
+ DateRangePicker: {
586
+ position: 'relative',
587
+ display: 'inline-block'
588
+ },
589
+ DateRangePicker__block: {
590
+ display: 'block'
591
+ },
592
+ DateRangePicker_picker: {
593
+ zIndex: zIndex + 1,
594
+ backgroundColor: color.background,
595
+ position: 'absolute'
596
+ },
597
+ DateRangePicker_picker__rtl: {
598
+ direction: noflip('rtl')
599
+ },
600
+ DateRangePicker_picker__directionLeft: {
601
+ left: noflip(0)
602
+ },
603
+ DateRangePicker_picker__directionRight: {
604
+ right: noflip(0)
605
+ },
606
+ DateRangePicker_picker__portal: {
607
+ backgroundColor: 'rgba(0, 0, 0, 0.3)',
608
+ position: 'fixed',
609
+ top: 0,
610
+ left: noflip(0),
611
+ height: '100%',
612
+ width: '100%'
613
+ },
614
+ DateRangePicker_picker__fullScreenPortal: {
615
+ backgroundColor: color.background
616
+ },
617
+ DateRangePicker_closeButton: {
618
+ background: 'none',
619
+ border: 0,
620
+ color: 'inherit',
621
+ font: 'inherit',
622
+ lineHeight: 'normal',
623
+ overflow: 'visible',
624
+ cursor: 'pointer',
625
+ position: 'absolute',
626
+ top: 0,
627
+ right: noflip(0),
628
+ padding: 15,
629
+ zIndex: zIndex + 2,
630
+ ':hover': {
631
+ color: darken(color.core.grayLighter, 0.1),
632
+ textDecoration: 'none'
633
+ },
634
+ ':focus': {
635
+ color: darken(color.core.grayLighter, 0.1),
636
+ textDecoration: 'none'
637
+ }
638
+ },
639
+ DateRangePicker_closeButton_svg: {
640
+ height: 15,
641
+ width: 15,
642
+ fill: color.core.grayLighter
643
+ }
644
+ };
645
+ }, {
646
+ pureComponent: typeof React.PureComponent !== 'undefined'
647
+ })(DateRangePicker);