diff --git a/CHANGELOG.md b/CHANGELOG.md index ef6014adcc2..53a55dd685d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Fixed `EuiComboBox` always showing a scrollbar ([#3744](https://github.com/elastic/eui/pull/3744)) - Replaced `react-focus-lock` with `react-focus-on` ([#3631](https://github.com/elastic/eui/pull/3631)) +- Fixed errors in `EuiSuperDatePicker` related to invalid and `null` date formatting ([#3750](https://github.com/elastic/eui/pull/3750)) ## [`27.1.0`](https://github.com/elastic/eui/tree/v27.1.0) diff --git a/packages/react-datepicker.js b/packages/react-datepicker.js index 7d65b53471e..0ef695d6779 100644 --- a/packages/react-datepicker.js +++ b/packages/react-datepicker.js @@ -212,11 +212,6 @@ UntouchabilityChecker.prototype.isUntouchable = function isUntouchable(node) { var tabbable_1 = tabbable; -var tabbable$1 = /*#__PURE__*/Object.freeze({ - default: tabbable_1, - __moduleExports: tabbable_1 -}); - var immutable = extend; var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -237,7 +232,12 @@ function extend() { return target } -var tabbable$2 = ( tabbable$1 && tabbable_1 ) || tabbable$1; +var immutable$1 = /*#__PURE__*/Object.freeze({ + default: immutable, + __moduleExports: immutable +}); + +var xtend = ( immutable$1 && immutable ) || immutable$1; var listeningFocusTrap = null; @@ -246,7 +246,7 @@ function focusTrap(element, userOptions) { var container = typeof element === 'string' ? doc.querySelector(element) : element; - var config = immutable( + var config = xtend( { returnFocusOnDeactivate: true, escapeDeactivates: true @@ -418,7 +418,7 @@ function focusTrap(element, userOptions) { if (container.contains(e.target)) return; if (config.clickOutsideDeactivates) { deactivate({ - returnFocus: !tabbable$2.isFocusable(e.target) + returnFocus: !tabbable_1.isFocusable(e.target) }); } else { e.preventDefault(); @@ -473,7 +473,7 @@ function focusTrap(element, userOptions) { } function updateTabbableNodes() { - var tabbableNodes = tabbable$2(container); + var tabbableNodes = tabbable_1(container); state.firstTabbableNode = tabbableNodes[0] || getInitialFocusNode(); state.lastTabbableNode = tabbableNodes[tabbableNodes.length - 1] || getInitialFocusNode(); @@ -3027,9 +3027,16 @@ var Month = function (_React$Component) { } }; + _this.onBlur = function () { + if (_this.props.accessibleMode) { + _this.setState({ readInstructions: false }); + } + }; + _this.onInputKeyDown = function (event) { var eventKey = event.key; - var copy = newDate(_this.props.preSelection); + // `preSelection` can be `null` but `day` is required. Use it as a fallback if necessary for invalid entries. + var copy = _this.props.preSelection ? newDate(_this.props.preSelection) : newDate(_this.props.day); var newSelection = void 0; switch (eventKey) { case "ArrowLeft": @@ -3059,7 +3066,7 @@ var Month = function (_React$Component) { case " ": case "Enter": event.preventDefault(); - _this.handleDayClick(_this.props.preSelection, event); + _this.handleDayClick(copy, event); break; } if (!newSelection) return; // Let the input component handle this keydown @@ -3161,8 +3168,7 @@ var Month = function (_React$Component) { "p", { "aria-live": true }, "You are focused on a calendar. Use the arrow keys to navigate the days in the month. Use the page up and down keys to navigate from month to month. Use the home and end keys to navigate from year to year.", - formatDate(this.props.preSelection, this.dayFormat), - " is the currently focused date." + this.props.preSelection ? formatDate(this.props.preSelection, this.dayFormat) + " is the\n currently focused date." : "No date is currently focused." ); } @@ -3175,7 +3181,8 @@ var Month = function (_React$Component) { "aria-label": "month-" + this.props.day.format("YYYY-MM"), tabIndex: this.props.accessibleMode ? 0 : -1, onKeyDown: this.onInputKeyDown, - onFocus: this.onFocus + onFocus: this.onFocus, + onBlur: this.onBlur }, React__default.createElement( ScreenReaderOnly, @@ -3311,8 +3318,10 @@ var Time = function (_React$Component) { } // update preSelection to the selection - this.setState({ - preSelection: this.props.selected + this.setState(function (prevState) { + return { + preSelection: prevState.selected + }; }); } @@ -3355,8 +3364,7 @@ var Time = function (_React$Component) { "p", { "aria-live": true }, "You are a in a time selector. Use the up and down keys to select from other common times then press enter to confirm.", - formatDate(this.state.preSelection, this.timeFormat), - " is currently focused." + this.state.preSelection ? formatDate(this.state.preSelection, this.timeFormat) + " is currently\n focused." : "No time is currently focused." ); } @@ -3449,7 +3457,7 @@ var _initialiseProps = function _initialiseProps() { this.onBlur = function () { if (_this3.props.accessibleMode) { - _this3.setState({ isFocused: false }); + _this3.setState({ readInstructions: false, isFocused: false }); } }; @@ -4532,17 +4540,24 @@ var _objectKeysInternal = function (object, names) { return result; }; +var _objectKeysInternal$1 = /*#__PURE__*/Object.freeze({ + default: _objectKeysInternal, + __moduleExports: _objectKeysInternal +}); + // IE 8- don't enum bug keys var _enumBugKeys = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); +var $keys = ( _objectKeysInternal$1 && _objectKeysInternal ) || _objectKeysInternal$1; + // 19.1.2.14 / 15.2.3.14 Object.keys(O) var _objectKeys = Object.keys || function keys(O) { - return _objectKeysInternal(O, _enumBugKeys); + return $keys(O, _enumBugKeys); }; var f$1 = Object.getOwnPropertySymbols; @@ -4597,18 +4612,32 @@ var _objectAssign = !$assign || _fails(function () { } return T; } : $assign; +var _objectAssign$1 = /*#__PURE__*/Object.freeze({ + default: _objectAssign, + __moduleExports: _objectAssign +}); + +var require$$0 = ( _objectAssign$1 && _objectAssign ) || _objectAssign$1; + // 19.1.3.1 Object.assign(target, source) -_export(_export.S + _export.F, 'Object', { assign: _objectAssign }); +_export(_export.S + _export.F, 'Object', { assign: require$$0 }); var assign = _core.Object.assign; -var assign$1 = createCommonjsModule(function (module) { -module.exports = { "default": assign, __esModule: true }; +var assign$1 = /*#__PURE__*/Object.freeze({ + default: assign, + __moduleExports: assign +}); + +var require$$0$1 = ( assign$1 && assign ) || assign$1; + +var assign$2 = createCommonjsModule(function (module) { +module.exports = { "default": require$$0$1, __esModule: true }; }); -unwrapExports(assign$1); +unwrapExports(assign$2); var _extends$1 = createCommonjsModule(function (module, exports) { @@ -4616,7 +4645,7 @@ exports.__esModule = true; -var _assign2 = _interopRequireDefault(assign$1); +var _assign2 = _interopRequireDefault(assign$2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4991,7 +5020,7 @@ var _isArray = Array.isArray || function isArray(arg) { var hiddenKeys = _enumBugKeys.concat('length', 'prototype'); var f$4 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return _objectKeysInternal(O, hiddenKeys); + return $keys(O, hiddenKeys); }; var _objectGopn = { @@ -5282,10 +5311,10 @@ var symbol$1 = /*#__PURE__*/Object.freeze({ __moduleExports: symbol }); -var require$$0 = ( symbol$1 && symbol ) || symbol$1; +var require$$0$2 = ( symbol$1 && symbol ) || symbol$1; var symbol$2 = createCommonjsModule(function (module) { -module.exports = { "default": require$$0, __esModule: true }; +module.exports = { "default": require$$0$2, __esModule: true }; }); unwrapExports(symbol$2); diff --git a/packages/react-datepicker/docs-site/bundle.js b/packages/react-datepicker/docs-site/bundle.js index 5aceee9350a..4ef89b10ca9 100644 --- a/packages/react-datepicker/docs-site/bundle.js +++ b/packages/react-datepicker/docs-site/bundle.js @@ -310,7 +310,7 @@ /***/ }), /* 3 */ -[841, 4, 5, 6, 8, 18, 22, 7, 23, 24, 19, 25, 26, 27, 29, 44, 12, 32, 16, 17, 45, 48, 50, 11, 30, 49, 43, 42, 28, 10], +[821, 4, 5, 6, 8, 18, 22, 7, 23, 24, 19, 25, 26, 27, 29, 44, 12, 32, 16, 17, 45, 48, 50, 11, 30, 49, 43, 42, 28, 10], /* 4 */ /***/ (function(module, exports) { @@ -334,7 +334,7 @@ /***/ }), /* 6 */ -[842, 7], +[822, 7], /* 7 */ /***/ (function(module, exports) { @@ -406,11 +406,11 @@ /***/ }), /* 10 */ -[843, 11, 17, 6], +[823, 11, 17, 6], /* 11 */ -[844, 12, 14, 16, 6], +[824, 12, 14, 16, 6], /* 12 */ -[845, 13], +[825, 13], /* 13 */ /***/ (function(module, exports) { @@ -421,11 +421,11 @@ /***/ }), /* 14 */ -[846, 6, 7, 15], +[826, 6, 7, 15], /* 15 */ -[847, 13, 4], +[827, 13, 4], /* 16 */ -[848, 13], +[828, 13], /* 17 */ /***/ (function(module, exports) { @@ -489,7 +489,7 @@ /***/ }), /* 20 */ -[849, 21], +[829, 21], /* 21 */ /***/ (function(module, exports) { @@ -501,17 +501,17 @@ /***/ }), /* 22 */ -[850, 19, 13, 5, 11, 7], +[830, 19, 13, 5, 11, 7], /* 23 */ -[851, 4], +[831, 4], /* 24 */ -[852, 11, 5, 25], +[832, 11, 5, 25], /* 25 */ -[853, 23, 19, 4], +[833, 23, 19, 4], /* 26 */ -[854, 25], +[834, 25], /* 27 */ -[855, 4, 9, 28, 26, 11], +[835, 4, 9, 28, 26, 11], /* 28 */ /***/ (function(module, exports) { @@ -520,15 +520,15 @@ /***/ }), /* 29 */ -[856, 30, 42, 43], +[836, 30, 42, 43], /* 30 */ -[857, 31, 41], +[837, 31, 41], /* 31 */ -[858, 5, 32, 36, 40], +[838, 5, 32, 36, 40], /* 32 */ -[859, 33, 35], +[839, 33, 35], /* 33 */ -[860, 34], +[840, 34], /* 34 */ /***/ (function(module, exports) { @@ -552,9 +552,9 @@ /***/ }), /* 36 */ -[861, 32, 37, 39], +[841, 32, 37, 39], /* 37 */ -[862, 38], +[842, 38], /* 38 */ /***/ (function(module, exports) { @@ -568,9 +568,9 @@ /***/ }), /* 39 */ -[863, 38], +[843, 38], /* 40 */ -[864, 23, 19], +[844, 23, 19], /* 41 */ /***/ (function(module, exports) { @@ -596,21 +596,21 @@ /***/ }), /* 44 */ -[865, 34], +[845, 34], /* 45 */ -[866, 12, 46, 41, 40, 15, 47], +[846, 12, 46, 41, 40, 15, 47], /* 46 */ -[867, 11, 12, 30, 6], +[847, 11, 12, 30, 6], /* 47 */ -[868, 4], +[848, 4], /* 48 */ -[869, 32, 49], +[849, 32, 49], /* 49 */ -[870, 31, 41], +[850, 31, 41], /* 50 */ -[871, 43, 17, 32, 16, 5, 14, 6], +[851, 43, 17, 32, 16, 5, 14, 6], /* 51 */ -[872, 8, 45], +[852, 8, 45], /* 52 */ /***/ (function(module, exports, __webpack_require__) { @@ -676,9 +676,9 @@ /***/ }), /* 57 */ -[873, 35], +[853, 35], /* 58 */ -[874, 5, 57, 40], +[854, 5, 57, 40], /* 59 */ /***/ (function(module, exports, __webpack_require__) { @@ -792,9 +792,9 @@ /***/ }), /* 67 */ -[875, 8, 68], +[855, 8, 68], /* 68 */ -[876, 30, 42, 43, 57, 33, 7], +[856, 30, 42, 43, 57, 33, 7], /* 69 */ /***/ (function(module, exports, __webpack_require__) { @@ -816,9 +816,9 @@ /***/ }), /* 71 */ -[877, 8, 72], +[857, 8, 72], /* 72 */ -[878, 13, 12, 20, 50], +[858, 13, 12, 20, 50], /* 73 */ /***/ (function(module, exports, __webpack_require__) { @@ -1851,11 +1851,11 @@ /***/ }), /* 126 */ -[879, 127, 128], +[859, 127, 128], /* 127 */ -[880, 38, 35], +[860, 38, 35], /* 128 */ -[881, 28, 8, 18, 10, 5, 129, 130, 24, 58, 25], +[861, 28, 8, 18, 10, 5, 129, 130, 24, 58, 25], /* 129 */ /***/ (function(module, exports) { @@ -1864,7 +1864,7 @@ /***/ }), /* 130 */ -[882, 45, 17, 24, 10, 25], +[862, 45, 17, 24, 10, 25], /* 131 */ /***/ (function(module, exports, __webpack_require__) { @@ -3020,7 +3020,7 @@ /***/ }), /* 194 */ -[883, 187, 195, 129, 32, 128], +[863, 187, 195, 129, 32, 128], /* 195 */ /***/ (function(module, exports) { @@ -5926,9 +5926,9 @@ /***/ }), /* 264 */ -[884, 27], +[864, 27], /* 265 */ -[885, 27], +[865, 27], /* 266 */ /***/ (function(module, exports, __webpack_require__) { @@ -8399,7 +8399,7 @@ var _example_components2 = _interopRequireDefault(_example_components); - var _hero_example = __webpack_require__(840); + var _hero_example = __webpack_require__(820); var _hero_example2 = _interopRequireDefault(_hero_example); @@ -8751,9 +8751,9 @@ var _render_custom_header2 = _interopRequireDefault(_render_custom_header); - __webpack_require__(838); + __webpack_require__(818); - __webpack_require__(839); + __webpack_require__(819); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -27417,9 +27417,9 @@ /***/ }), /* 517 */ -[886, 518], +[866, 518], /* 518 */ -[887, 519, 520, 521], +[867, 519, 520, 521], /* 519 */ /***/ (function(module, exports) { @@ -48002,9 +48002,16 @@ } }; + _this.onBlur = function () { + if (_this.props.accessibleMode) { + _this.setState({ readInstructions: false }); + } + }; + _this.onInputKeyDown = function (event) { var eventKey = event.key; - var copy = utils.newDate(_this.props.preSelection); + // `preSelection` can be `null` but `day` is required. Use it as a fallback if necessary for invalid entries. + var copy = _this.props.preSelection ? utils.newDate(_this.props.preSelection) : utils.newDate(_this.props.day); var newSelection = void 0; switch (eventKey) { case "ArrowLeft": @@ -48034,7 +48041,7 @@ case " ": case "Enter": event.preventDefault(); - _this.handleDayClick(_this.props.preSelection, event); + _this.handleDayClick(copy, event); break; } if (!newSelection) return; // Let the input component handle this keydown @@ -48136,8 +48143,7 @@ "p", { "aria-live": true }, "You are focused on a calendar. Use the arrow keys to navigate the days in the month. Use the page up and down keys to navigate from month to month. Use the home and end keys to navigate from year to year.", - utils.formatDate(this.props.preSelection, this.dayFormat), - " is the currently focused date." + this.props.preSelection ? utils.formatDate(this.props.preSelection, this.dayFormat) + " is the\n currently focused date." : "No date is currently focused." ); } @@ -48150,7 +48156,8 @@ "aria-label": "month-" + this.props.day.format("YYYY-MM"), tabIndex: this.props.accessibleMode ? 0 : -1, onKeyDown: this.onInputKeyDown, - onFocus: this.onFocus + onFocus: this.onFocus, + onBlur: this.onBlur }, _react2.default.createElement( _screen_reader_only.ScreenReaderOnly, @@ -48776,8 +48783,10 @@ } // update preSelection to the selection - this.setState({ - preSelection: this.props.selected + this.setState(function (prevState) { + return { + preSelection: prevState.selected + }; }); } @@ -48820,8 +48829,7 @@ "p", { "aria-live": true }, "You are a in a time selector. Use the up and down keys to select from other common times then press enter to confirm.", - (0, _date_utils.formatDate)(this.state.preSelection, this.timeFormat), - " is currently focused." + this.state.preSelection ? (0, _date_utils.formatDate)(this.state.preSelection, this.timeFormat) + " is currently\n focused." : "No time is currently focused." ); } @@ -48914,7 +48922,7 @@ this.onBlur = function () { if (_this3.props.accessibleMode) { - _this3.setState({ isFocused: false }); + _this3.setState({ readInstructions: false, isFocused: false }); } }; @@ -49437,7 +49445,7 @@ /***/ }), /* 674 */ -[875, 675, 690], +[855, 675, 690], /* 675 */ /***/ (function(module, exports, __webpack_require__) { @@ -49510,57 +49518,57 @@ /* 677 */ 9, /* 678 */ -[849, 679], +[829, 679], /* 679 */ 21, /* 680 */ -[843, 681, 689, 685], +[823, 681, 689, 685], /* 681 */ -[844, 682, 684, 688, 685], +[824, 682, 684, 688, 685], /* 682 */ -[845, 683], +[825, 683], /* 683 */ 13, /* 684 */ -[846, 685, 686, 687], +[826, 685, 686, 687], /* 685 */ -[842, 686], +[822, 686], /* 686 */ 7, /* 687 */ -[847, 683, 676], +[827, 683, 676], /* 688 */ -[848, 683], +[828, 683], /* 689 */ 17, /* 690 */ -[876, 691, 706, 707, 708, 695, 686], +[856, 691, 706, 707, 708, 695, 686], /* 691 */ -[857, 692, 705], +[837, 692, 705], /* 692 */ -[858, 693, 694, 698, 702], +[838, 693, 694, 698, 702], /* 693 */ 5, /* 694 */ -[859, 695, 697], +[839, 695, 697], /* 695 */ -[860, 696], +[840, 696], /* 696 */ 34, /* 697 */ 35, /* 698 */ -[861, 694, 699, 701], +[841, 694, 699, 701], /* 699 */ -[862, 700], +[842, 700], /* 700 */ 38, /* 701 */ -[863, 700], +[843, 700], /* 702 */ -[864, 703, 704], +[844, 703, 704], /* 703 */ -[851, 676], +[831, 676], /* 704 */ 19, /* 705 */ @@ -49570,7 +49578,7 @@ /* 707 */ 43, /* 708 */ -[873, 697], +[853, 697], /* 709 */ /***/ (function(module, exports) { @@ -49649,11 +49657,11 @@ /***/ }), /* 714 */ -[879, 715, 716], +[859, 715, 716], /* 715 */ -[880, 700, 697], +[860, 700, 697], /* 716 */ -[881, 717, 675, 718, 680, 693, 719, 720, 724, 726, 725], +[861, 717, 675, 718, 680, 693, 719, 720, 724, 726, 725], /* 717 */ /***/ (function(module, exports) { @@ -49671,19 +49679,19 @@ /* 719 */ 129, /* 720 */ -[882, 721, 689, 724, 680, 725], +[862, 721, 689, 724, 680, 725], /* 721 */ -[866, 682, 722, 705, 702, 687, 723], +[846, 682, 722, 705, 702, 687, 723], /* 722 */ -[867, 681, 682, 691, 685], +[847, 681, 682, 691, 685], /* 723 */ -[868, 676], +[848, 676], /* 724 */ -[852, 681, 693, 725], +[832, 681, 693, 725], /* 725 */ -[853, 703, 704, 676], +[833, 703, 704, 676], /* 726 */ -[874, 693, 708, 702], +[854, 693, 708, 702], /* 727 */ /***/ (function(module, exports, __webpack_require__) { @@ -49710,7 +49718,7 @@ /***/ }), /* 728 */ -[883, 729, 730, 719, 694, 716], +[863, 729, 730, 719, 694, 716], /* 729 */ /***/ (function(module, exports) { @@ -49721,7 +49729,7 @@ /* 730 */ 195, /* 731 */ -[854, 725], +[834, 725], /* 732 */ /***/ (function(module, exports, __webpack_require__) { @@ -49740,21 +49748,21 @@ /***/ }), /* 734 */ -[841, 676, 693, 685, 675, 718, 735, 686, 703, 724, 704, 725, 731, 736, 737, 738, 682, 694, 688, 689, 721, 739, 741, 681, 691, 740, 707, 706, 717, 680], +[821, 676, 693, 685, 675, 718, 735, 686, 703, 724, 704, 725, 731, 736, 737, 738, 682, 694, 688, 689, 721, 739, 741, 681, 691, 740, 707, 706, 717, 680], /* 735 */ -[850, 704, 683, 693, 681, 686], +[830, 704, 683, 693, 681, 686], /* 736 */ -[855, 676, 677, 717, 731, 681], +[835, 676, 677, 717, 731, 681], /* 737 */ -[856, 691, 706, 707], +[836, 691, 706, 707], /* 738 */ -[865, 696], +[845, 696], /* 739 */ -[869, 694, 740], +[849, 694, 740], /* 740 */ -[870, 692, 705], +[850, 692, 705], /* 741 */ -[871, 707, 689, 694, 688, 693, 684, 685], +[851, 707, 689, 694, 688, 693, 684, 685], /* 742 */ /***/ (function(module, exports) { @@ -49762,9 +49770,9 @@ /***/ }), /* 743 */ -[884, 736], +[864, 736], /* 744 */ -[885, 736], +[865, 736], /* 745 */ /***/ (function(module, exports, __webpack_require__) { @@ -49818,9 +49826,9 @@ /***/ }), /* 748 */ -[877, 675, 749], +[857, 675, 749], /* 749 */ -[878, 683, 682, 678, 741], +[858, 683, 682, 678, 741], /* 750 */ /***/ (function(module, exports, __webpack_require__) { @@ -49839,7 +49847,7 @@ /***/ }), /* 752 */ -[872, 675, 721], +[852, 675, 721], /* 753 */ /***/ (function(module, exports, __webpack_require__) { @@ -52669,9 +52677,9 @@ /***/ }), /* 757 */ -[886, 758], +[866, 758], /* 758 */ -[887, 759, 760, 761], +[867, 759, 760, 761], /* 759 */ 519, /* 760 */ @@ -57206,7 +57214,7 @@ /* 817 */ /***/ (function(module, exports, __webpack_require__) { - "use strict"; + 'use strict'; exports.__esModule = true; @@ -57222,10 +57230,6 @@ var _moment2 = _interopRequireDefault(_moment); - var _range = __webpack_require__(818); - - var _range2 = _interopRequireDefault(_range); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -57234,7 +57238,14 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var years = (0, _range2.default)(1990, (0, _moment2.default)().year() + 1, 1); + var range = function range(start, end) { + var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; + return Array.from({ length: (end - start + step - 1) / step }, function (_, i) { + return i * step + start; + }); + }; + + var years = range(1990, (0, _moment2.default)().year() + 1, 1); var months = _moment2.default.months(); var Default = function (_React$Component) { @@ -57259,20 +57270,20 @@ Default.prototype.render = function render() { return _react2.default.createElement( - "div", - { className: "row" }, + 'div', + { className: 'row' }, _react2.default.createElement( - "pre", - { className: "column example__code" }, + 'pre', + { className: 'column example__code' }, _react2.default.createElement( - "code", - { className: "jsx" }, - "\n {}}\n/>\n" + 'code', + { className: 'jsx' }, + '\n {}}\n/>\n' ) ), _react2.default.createElement( - "div", - { className: "column" }, + 'div', + { className: 'column' }, _react2.default.createElement(_reactDatepicker2.default, { renderCustomHeader: function renderCustomHeader(_ref) { var date = _ref.date, @@ -57283,63 +57294,58 @@ prevMonthButtonDisabled = _ref.prevMonthButtonDisabled, nextMonthButtonDisabled = _ref.nextMonthButtonDisabled; return _react2.default.createElement( - "div", + 'div', { style: { margin: 10, - display: "flex", - justifyContent: "center" - } - }, + display: 'flex', + justifyContent: 'center' + } }, _react2.default.createElement( - "button", + 'button', { onClick: decreaseMonth, - disabled: prevMonthButtonDisabled - }, - "<" + disabled: prevMonthButtonDisabled }, + '<' ), _react2.default.createElement( - "select", + 'select', { value: date.year(), onChange: function onChange(_ref2) { var value = _ref2.target.value; return changeYear(value); - } - }, + } }, years.map(function (option) { return _react2.default.createElement( - "option", + 'option', { key: option, value: option }, option ); }) ), _react2.default.createElement( - "select", + 'select', { value: months[date.month()], onChange: function onChange(_ref3) { var value = _ref3.target.value; return changeMonth(value); - } - }, + } }, months.map(function (option) { return _react2.default.createElement( - "option", + 'option', { key: option, value: option }, option ); }) ), _react2.default.createElement( - "button", + 'button', { onClick: increaseMonth, - disabled: nextMonthButtonDisabled - }, - ">" + disabled: nextMonthButtonDisabled }, + '>' ) ); }, @@ -57357,748 +57363,14 @@ /***/ }), /* 818 */ -/***/ (function(module, exports, __webpack_require__) { - - var createRange = __webpack_require__(819); - - /** - * Creates an array of numbers (positive and/or negative) progressing from - * `start` up to, but not including, `end`. A step of `-1` is used if a negative - * `start` is specified without an `end` or `step`. If `end` is not specified, - * it's set to `start` with `start` then set to `0`. - * - * **Note:** JavaScript follows the IEEE-754 standard for resolving - * floating-point values which can produce unexpected results. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @param {number} [step=1] The value to increment or decrement by. - * @returns {Array} Returns the range of numbers. - * @see _.inRange, _.rangeRight - * @example - * - * _.range(4); - * // => [0, 1, 2, 3] - * - * _.range(-4); - * // => [0, -1, -2, -3] - * - * _.range(1, 5); - * // => [1, 2, 3, 4] - * - * _.range(0, 20, 5); - * // => [0, 5, 10, 15] - * - * _.range(0, -4, -1); - * // => [0, -1, -2, -3] - * - * _.range(1, 4, 0); - * // => [1, 1, 1] - * - * _.range(0); - * // => [] - */ - var range = createRange(); - - module.exports = range; - - -/***/ }), -/* 819 */ -/***/ (function(module, exports, __webpack_require__) { - - var baseRange = __webpack_require__(820), - isIterateeCall = __webpack_require__(821), - toFinite = __webpack_require__(834); - - /** - * Creates a `_.range` or `_.rangeRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new range function. - */ - function createRange(fromRight) { - return function(start, end, step) { - if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { - end = step = undefined; - } - // Ensure the sign of `-0` is preserved. - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); - return baseRange(start, end, step, fromRight); - }; - } - - module.exports = createRange; - - -/***/ }), -/* 820 */ -/***/ (function(module, exports) { - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeCeil = Math.ceil, - nativeMax = Math.max; - - /** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments. - * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the range of numbers. - */ - function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); - - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; - } - return result; - } - - module.exports = baseRange; - - -/***/ }), -/* 821 */ -/***/ (function(module, exports, __webpack_require__) { - - var eq = __webpack_require__(822), - isArrayLike = __webpack_require__(823), - isIndex = __webpack_require__(833), - isObject = __webpack_require__(831); - - /** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; - } - - module.exports = isIterateeCall; - - -/***/ }), -/* 822 */ -/***/ (function(module, exports) { - - /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } - - module.exports = eq; - - -/***/ }), -/* 823 */ -/***/ (function(module, exports, __webpack_require__) { - - var isFunction = __webpack_require__(824), - isLength = __webpack_require__(832); - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - - module.exports = isArrayLike; - - -/***/ }), -/* 824 */ -/***/ (function(module, exports, __webpack_require__) { - - var baseGetTag = __webpack_require__(825), - isObject = __webpack_require__(831); - - /** `Object#toString` result references. */ - var asyncTag = '[object AsyncFunction]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - proxyTag = '[object Proxy]'; - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; - } - - module.exports = isFunction; - - -/***/ }), -/* 825 */ -/***/ (function(module, exports, __webpack_require__) { - - var Symbol = __webpack_require__(826), - getRawTag = __webpack_require__(829), - objectToString = __webpack_require__(830); - - /** `Object#toString` result references. */ - var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; - - /** Built-in value references. */ - var symToStringTag = Symbol ? Symbol.toStringTag : undefined; - - /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); - } - - module.exports = baseGetTag; - - -/***/ }), -/* 826 */ -/***/ (function(module, exports, __webpack_require__) { - - var root = __webpack_require__(827); - - /** Built-in value references. */ - var Symbol = root.Symbol; - - module.exports = Symbol; - - -/***/ }), -/* 827 */ -/***/ (function(module, exports, __webpack_require__) { - - var freeGlobal = __webpack_require__(828); - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - module.exports = root; - - -/***/ }), -/* 828 */ -/***/ (function(module, exports) { - - /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - - module.exports = freeGlobal; - - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) - -/***/ }), -/* 829 */ -/***/ (function(module, exports, __webpack_require__) { - - var Symbol = __webpack_require__(826); - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var nativeObjectToString = objectProto.toString; - - /** Built-in value references. */ - var symToStringTag = Symbol ? Symbol.toStringTag : undefined; - - /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ - function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; - } - - module.exports = getRawTag; - - -/***/ }), -/* 830 */ -/***/ (function(module, exports) { - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var nativeObjectToString = objectProto.toString; - - /** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ - function objectToString(value) { - return nativeObjectToString.call(value); - } - - module.exports = objectToString; - - -/***/ }), -/* 831 */ -/***/ (function(module, exports) { - - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); - } - - module.exports = isObject; - - -/***/ }), -/* 832 */ -/***/ (function(module, exports) { - - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - module.exports = isLength; - - -/***/ }), -/* 833 */ -/***/ (function(module, exports) { - - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); - } - - module.exports = isIndex; - - -/***/ }), -/* 834 */ -/***/ (function(module, exports, __webpack_require__) { - - var toNumber = __webpack_require__(835); - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308; - - /** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ - function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; - } - - module.exports = toFinite; - - -/***/ }), -/* 835 */ -/***/ (function(module, exports, __webpack_require__) { - - var isObject = __webpack_require__(831), - isSymbol = __webpack_require__(836); - - /** Used as references for various `Number` constants. */ - var NAN = 0 / 0; - - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Built-in method references without a dependency on `root`. */ - var freeParseInt = parseInt; - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ - function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); - } - - module.exports = toNumber; - - -/***/ }), -/* 836 */ -/***/ (function(module, exports, __webpack_require__) { - - var baseGetTag = __webpack_require__(825), - isObjectLike = __webpack_require__(837); - - /** `Object#toString` result references. */ - var symbolTag = '[object Symbol]'; - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); - } - - module.exports = isSymbol; - - -/***/ }), -/* 837 */ -/***/ (function(module, exports) { - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return value != null && typeof value == 'object'; - } - - module.exports = isObjectLike; - - -/***/ }), -/* 838 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 839 */ -838, -/* 840 */ +/* 819 */ +818, +/* 820 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -58159,7 +57431,7 @@ exports.default = HeroExample; /***/ }), -/* 841 */ +/* 821 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__, __webpack_module_template_argument_3__, __webpack_module_template_argument_4__, __webpack_module_template_argument_5__, __webpack_module_template_argument_6__, __webpack_module_template_argument_7__, __webpack_module_template_argument_8__, __webpack_module_template_argument_9__, __webpack_module_template_argument_10__, __webpack_module_template_argument_11__, __webpack_module_template_argument_12__, __webpack_module_template_argument_13__, __webpack_module_template_argument_14__, __webpack_module_template_argument_15__, __webpack_module_template_argument_16__, __webpack_module_template_argument_17__, __webpack_module_template_argument_18__, __webpack_module_template_argument_19__, __webpack_module_template_argument_20__, __webpack_module_template_argument_21__, __webpack_module_template_argument_22__, __webpack_module_template_argument_23__, __webpack_module_template_argument_24__, __webpack_module_template_argument_25__, __webpack_module_template_argument_26__, __webpack_module_template_argument_27__, __webpack_module_template_argument_28__) { 'use strict'; @@ -58399,7 +57671,7 @@ /***/ }), -/* 842 */ +/* 822 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { // Thank's IE8 for his funny defineProperty @@ -58409,7 +57681,7 @@ /***/ }), -/* 843 */ +/* 823 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__) { var dP = __webpack_require__(__webpack_module_template_argument_0__); @@ -58423,7 +57695,7 @@ /***/ }), -/* 844 */ +/* 824 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__, __webpack_module_template_argument_3__) { var anObject = __webpack_require__(__webpack_module_template_argument_0__); @@ -58445,7 +57717,7 @@ /***/ }), -/* 845 */ +/* 825 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { var isObject = __webpack_require__(__webpack_module_template_argument_0__); @@ -58456,7 +57728,7 @@ /***/ }), -/* 846 */ +/* 826 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__) { module.exports = !__webpack_require__(__webpack_module_template_argument_0__) && !__webpack_require__(__webpack_module_template_argument_1__)(function () { @@ -58465,7 +57737,7 @@ /***/ }), -/* 847 */ +/* 827 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) { var isObject = __webpack_require__(__webpack_module_template_argument_0__); @@ -58478,7 +57750,7 @@ /***/ }), -/* 848 */ +/* 828 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { // 7.1.1 ToPrimitive(input [, PreferredType]) @@ -58496,7 +57768,7 @@ /***/ }), -/* 849 */ +/* 829 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { // optional / simple context binding @@ -58522,7 +57794,7 @@ /***/ }), -/* 850 */ +/* 830 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__, __webpack_module_template_argument_3__, __webpack_module_template_argument_4__) { var META = __webpack_require__(__webpack_module_template_argument_0__)('meta'); @@ -58581,7 +57853,7 @@ /***/ }), -/* 851 */ +/* 831 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { var global = __webpack_require__(__webpack_module_template_argument_0__); @@ -58593,7 +57865,7 @@ /***/ }), -/* 852 */ +/* 832 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__) { var def = __webpack_require__(__webpack_module_template_argument_0__).f; @@ -58606,7 +57878,7 @@ /***/ }), -/* 853 */ +/* 833 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__) { var store = __webpack_require__(__webpack_module_template_argument_0__)('wks'); @@ -58623,14 +57895,14 @@ /***/ }), -/* 854 */ +/* 834 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { exports.f = __webpack_require__(__webpack_module_template_argument_0__); /***/ }), -/* 855 */ +/* 835 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__, __webpack_module_template_argument_3__, __webpack_module_template_argument_4__) { var global = __webpack_require__(__webpack_module_template_argument_0__); @@ -58645,7 +57917,7 @@ /***/ }), -/* 856 */ +/* 836 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__) { // all enumerable object keys, includes symbols @@ -58666,7 +57938,7 @@ /***/ }), -/* 857 */ +/* 837 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) { // 19.1.2.14 / 15.2.3.14 Object.keys(O) @@ -58679,7 +57951,7 @@ /***/ }), -/* 858 */ +/* 838 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__, __webpack_module_template_argument_3__) { var has = __webpack_require__(__webpack_module_template_argument_0__); @@ -58702,7 +57974,7 @@ /***/ }), -/* 859 */ +/* 839 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) { // to indexed object, toObject with fallback for non-array-like ES3 strings @@ -58714,7 +57986,7 @@ /***/ }), -/* 860 */ +/* 840 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { // fallback for non-array-like ES3 and non-enumerable old V8 strings @@ -58726,7 +57998,7 @@ /***/ }), -/* 861 */ +/* 841 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__) { // false -> Array#indexOf @@ -58755,7 +58027,7 @@ /***/ }), -/* 862 */ +/* 842 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { // 7.1.15 ToLength @@ -58767,7 +58039,7 @@ /***/ }), -/* 863 */ +/* 843 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { var toInteger = __webpack_require__(__webpack_module_template_argument_0__); @@ -58780,7 +58052,7 @@ /***/ }), -/* 864 */ +/* 844 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) { var shared = __webpack_require__(__webpack_module_template_argument_0__)('keys'); @@ -58791,7 +58063,7 @@ /***/ }), -/* 865 */ +/* 845 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { // 7.2.2 IsArray(argument) @@ -58802,7 +58074,7 @@ /***/ }), -/* 866 */ +/* 846 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__, __webpack_module_template_argument_3__, __webpack_module_template_argument_4__, __webpack_module_template_argument_5__) { // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) @@ -58849,7 +58121,7 @@ /***/ }), -/* 867 */ +/* 847 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__, __webpack_module_template_argument_3__) { var dP = __webpack_require__(__webpack_module_template_argument_0__); @@ -58868,7 +58140,7 @@ /***/ }), -/* 868 */ +/* 848 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { var document = __webpack_require__(__webpack_module_template_argument_0__).document; @@ -58876,7 +58148,7 @@ /***/ }), -/* 869 */ +/* 849 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) { // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window @@ -58901,7 +58173,7 @@ /***/ }), -/* 870 */ +/* 850 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) { // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) @@ -58914,7 +58186,7 @@ /***/ }), -/* 871 */ +/* 851 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__, __webpack_module_template_argument_3__, __webpack_module_template_argument_4__, __webpack_module_template_argument_5__, __webpack_module_template_argument_6__) { var pIE = __webpack_require__(__webpack_module_template_argument_0__); @@ -58936,7 +58208,7 @@ /***/ }), -/* 872 */ +/* 852 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) { var $export = __webpack_require__(__webpack_module_template_argument_0__); @@ -58945,7 +58217,7 @@ /***/ }), -/* 873 */ +/* 853 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { // 7.1.13 ToObject(argument) @@ -58956,7 +58228,7 @@ /***/ }), -/* 874 */ +/* 854 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__) { // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) @@ -58975,7 +58247,7 @@ /***/ }), -/* 875 */ +/* 855 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) { // 19.1.3.1 Object.assign(target, source) @@ -58985,7 +58257,7 @@ /***/ }), -/* 876 */ +/* 856 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__, __webpack_module_template_argument_3__, __webpack_module_template_argument_4__, __webpack_module_template_argument_5__) { 'use strict'; @@ -59025,7 +58297,7 @@ /***/ }), -/* 877 */ +/* 857 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) { // 19.1.3.19 Object.setPrototypeOf(O, proto) @@ -59034,7 +58306,7 @@ /***/ }), -/* 878 */ +/* 858 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__, __webpack_module_template_argument_3__) { // Works with __proto__ only. Old v8 can't work with null proto objects. @@ -59065,7 +58337,7 @@ /***/ }), -/* 879 */ +/* 859 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) { 'use strict'; @@ -59088,7 +58360,7 @@ /***/ }), -/* 880 */ +/* 860 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__) { var toInteger = __webpack_require__(__webpack_module_template_argument_0__); @@ -59111,7 +58383,7 @@ /***/ }), -/* 881 */ +/* 861 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__, __webpack_module_template_argument_3__, __webpack_module_template_argument_4__, __webpack_module_template_argument_5__, __webpack_module_template_argument_6__, __webpack_module_template_argument_7__, __webpack_module_template_argument_8__, __webpack_module_template_argument_9__) { 'use strict'; @@ -59187,7 +58459,7 @@ /***/ }), -/* 882 */ +/* 862 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__, __webpack_module_template_argument_3__, __webpack_module_template_argument_4__) { 'use strict'; @@ -59206,7 +58478,7 @@ /***/ }), -/* 883 */ +/* 863 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__, __webpack_module_template_argument_3__, __webpack_module_template_argument_4__) { 'use strict'; @@ -59246,21 +58518,21 @@ /***/ }), -/* 884 */ +/* 864 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { __webpack_require__(__webpack_module_template_argument_0__)('asyncIterator'); /***/ }), -/* 885 */ +/* 865 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { __webpack_require__(__webpack_module_template_argument_0__)('observable'); /***/ }), -/* 886 */ +/* 866 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__) { /** @@ -59294,7 +58566,7 @@ /***/ }), -/* 887 */ +/* 867 */ /***/ (function(module, exports, __webpack_require__, __webpack_module_template_argument_0__, __webpack_module_template_argument_1__, __webpack_module_template_argument_2__) { /** diff --git a/packages/react-datepicker/src/month.jsx b/packages/react-datepicker/src/month.jsx index 484bd286394..d1ebe092c6c 100644 --- a/packages/react-datepicker/src/month.jsx +++ b/packages/react-datepicker/src/month.jsx @@ -75,9 +75,16 @@ export default class Month extends React.Component { } }; + onBlur = () => { + if (this.props.accessibleMode) { + this.setState({ readInstructions: false }); + } + }; + onInputKeyDown = event => { const eventKey = event.key; - const copy = utils.newDate(this.props.preSelection); + // `preSelection` can be `null` but `day` is required. Use it as a fallback if necessary for invalid entries. + const copy = this.props.preSelection ? utils.newDate(this.props.preSelection) : utils.newDate(this.props.day); let newSelection; switch (eventKey) { case "ArrowLeft": @@ -107,7 +114,7 @@ export default class Month extends React.Component { case " ": case "Enter": event.preventDefault(); - this.handleDayClick(this.props.preSelection, event); + this.handleDayClick(copy, event); break; } if (!newSelection) return; // Let the input component handle this keydown @@ -209,8 +216,8 @@ export default class Month extends React.Component { You are focused on a calendar. Use the arrow keys to navigate the days in the month. Use the page up and down keys to navigate from month to month. Use the home and end keys to navigate from year to year. - {utils.formatDate(this.props.preSelection, this.dayFormat)} is the - currently focused date. + {this.props.preSelection ? `${utils.formatDate(this.props.preSelection, this.dayFormat)} is the + currently focused date.` : `No date is currently focused.`}

); } @@ -224,6 +231,7 @@ export default class Month extends React.Component { tabIndex={this.props.accessibleMode ? 0 : -1} onKeyDown={this.onInputKeyDown} onFocus={this.onFocus} + onBlur={this.onBlur} > {screenReaderInstructions} diff --git a/packages/react-datepicker/src/time.jsx b/packages/react-datepicker/src/time.jsx index 9e098d268bc..c0b32a0c9a4 100644 --- a/packages/react-datepicker/src/time.jsx +++ b/packages/react-datepicker/src/time.jsx @@ -151,7 +151,7 @@ export default class Time extends React.Component { onBlur = () => { if (this.props.accessibleMode) { - this.setState({ isFocused: false }); + this.setState({ readInstructions: false, isFocused: false }); } }; @@ -316,8 +316,8 @@ export default class Time extends React.Component {

You are a in a time selector. Use the up and down keys to select from other common times then press enter to confirm. - {formatDate(this.state.preSelection, this.timeFormat)} is currently - focused. + {this.state.preSelection ? `${formatDate(this.state.preSelection, this.timeFormat)} is currently + focused.`: `No time is currently focused.`}

); } diff --git a/src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx b/src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx index 03e12c4ae97..320557bdd4a 100644 --- a/src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx +++ b/src/components/date_picker/super_date_picker/date_popover/absolute_tab.tsx @@ -100,7 +100,7 @@ export class EuiAbsoluteTab extends Component< onChange(valueAsMoment.toISOString(), event); } this.setState({ - textInputValue: event.target.value as string, + textInputValue: event.target.value, isTextInvalid: !dateIsValid, valueAsMoment: dateIsValid ? valueAsMoment : null, });