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