@commercetools-uikit/date-range-input 12.2.3 → 12.2.7
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.
|
@@ -60,13 +60,13 @@ var messages = reactIntl.defineMessages({
|
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
63
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
64
64
|
|
|
65
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context6; _forEachInstanceProperty__default[
|
|
65
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context6; _forEachInstanceProperty__default["default"](_context6 = ownKeys(Object(source), true)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context7; _forEachInstanceProperty__default["default"](_context7 = ownKeys(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
66
66
|
|
|
67
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default[
|
|
67
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
68
68
|
|
|
69
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default[
|
|
69
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
70
70
|
|
|
71
71
|
var preventDownshiftDefault = function preventDownshiftDefault(event) {
|
|
72
72
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -76,8 +76,8 @@ var preventDownshiftDefault = function preventDownshiftDefault(event) {
|
|
|
76
76
|
var parseRangeText = function parseRangeText(text, locale) {
|
|
77
77
|
var _context, _context2;
|
|
78
78
|
|
|
79
|
-
var parts = _filterInstanceProperty__default[
|
|
80
|
-
var parsedDate = calendarUtils.parseInputToDate(_trimInstanceProperty__default[
|
|
79
|
+
var parts = _filterInstanceProperty__default["default"](_context = _mapInstanceProperty__default["default"](_context2 = text.split(' - ')).call(_context2, function (part) {
|
|
80
|
+
var parsedDate = calendarUtils.parseInputToDate(_trimInstanceProperty__default["default"](part).call(part), locale);
|
|
81
81
|
return parsedDate === '' ? null : parsedDate;
|
|
82
82
|
})).call(_context, Boolean);
|
|
83
83
|
|
|
@@ -147,7 +147,7 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
147
147
|
args[_key] = arguments[_key];
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
_this = _super.call.apply(_super, _concatInstanceProperty__default[
|
|
150
|
+
_this = _super.call.apply(_super, _concatInstanceProperty__default["default"](_context3 = [this]).call(_context3, args));
|
|
151
151
|
_this.inputRef = /*#__PURE__*/react.createRef();
|
|
152
152
|
_this.state = {
|
|
153
153
|
calendarDate: _this.props.value.length === 2 ? _this.props.value[0] : calendarUtils.getToday(),
|
|
@@ -199,7 +199,7 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
199
199
|
target: {
|
|
200
200
|
id: _this.props.id,
|
|
201
201
|
name: _this.props.name,
|
|
202
|
-
value: _sortInstanceProperty__default[
|
|
202
|
+
value: _sortInstanceProperty__default["default"](unsortedRange).call(unsortedRange)
|
|
203
203
|
}
|
|
204
204
|
});
|
|
205
205
|
};
|
|
@@ -212,9 +212,9 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
212
212
|
value: function render() {
|
|
213
213
|
var _this2 = this;
|
|
214
214
|
|
|
215
|
-
return jsxRuntime.jsx(Constraints__default[
|
|
215
|
+
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
216
216
|
max: this.props.horizontalConstraint,
|
|
217
|
-
children: jsxRuntime.jsx(Downshift__default[
|
|
217
|
+
children: jsxRuntime.jsx(Downshift__default["default"], {
|
|
218
218
|
inputId: this.props.id,
|
|
219
219
|
itemToString: calendarUtils.createItemRangeToString(this.props.intl.locale),
|
|
220
220
|
inputValue: this.state.inputValue,
|
|
@@ -223,7 +223,7 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
223
223
|
onInputValueChange: function onInputValueChange(inputValue, changes) {
|
|
224
224
|
// only attempt to parse input when the user typed into the input
|
|
225
225
|
// field
|
|
226
|
-
if (changes.type !== Downshift__default[
|
|
226
|
+
if (changes.type !== Downshift__default["default"].stateChangeTypes.changeInput) return;
|
|
227
227
|
|
|
228
228
|
_this2.setState(function () {
|
|
229
229
|
var parsedRange = parseRangeText(inputValue, _this2.props.intl.locale);
|
|
@@ -263,7 +263,7 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
263
263
|
/* eslint-disable no-prototype-builtins */
|
|
264
264
|
_this2.setState(function (prevState) {
|
|
265
265
|
// ensure input value matches prop value when menu is closed
|
|
266
|
-
if (changes.type === Downshift__default[
|
|
266
|
+
if (changes.type === Downshift__default["default"].stateChangeTypes.mouseUp || changes.type === Downshift__default["default"].stateChangeTypes.blurInput) {
|
|
267
267
|
return {
|
|
268
268
|
highlightedIndex: null,
|
|
269
269
|
isOpen: false,
|
|
@@ -340,11 +340,11 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
340
340
|
inputValue = _ref2.inputValue;
|
|
341
341
|
var calendarItems = calendarUtils.createCalendarItems(_this2.state.calendarDate, _this2.props.intl);
|
|
342
342
|
|
|
343
|
-
var allItems = _concatInstanceProperty__default[
|
|
343
|
+
var allItems = _concatInstanceProperty__default["default"](_context4 = []).call(_context4, _toConsumableArray(_this2.state.suggestedItems), _toConsumableArray(calendarItems));
|
|
344
344
|
|
|
345
345
|
var paddingDayCount = calendarUtils.getPaddingDayCount(_this2.state.calendarDate, _this2.props.intl.locale);
|
|
346
346
|
|
|
347
|
-
var paddingDays = _fillInstanceProperty__default[
|
|
347
|
+
var paddingDays = _fillInstanceProperty__default["default"](_context5 = Array(paddingDayCount)).call(_context5);
|
|
348
348
|
|
|
349
349
|
var weekdays = calendarUtils.getWeekdayNames(_this2.props.intl.locale);
|
|
350
350
|
var today = calendarUtils.getToday();
|
|
@@ -370,7 +370,7 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
370
370
|
return;
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
-
if (event.key === 'Enter' && _trimInstanceProperty__default[
|
|
373
|
+
if (event.key === 'Enter' && _trimInstanceProperty__default["default"](inputValue).call(inputValue) === '' && // do not clear value when user presses Enter to
|
|
374
374
|
// select the end date (so only clear when there is no
|
|
375
375
|
// startDate)
|
|
376
376
|
!_this2.state.startDate && _this2.props.isClearable) {
|
|
@@ -445,16 +445,16 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
445
445
|
return _this2.jumpMonth(12);
|
|
446
446
|
}
|
|
447
447
|
}), jsxRuntime.jsxs(calendarUtils.CalendarContent, {
|
|
448
|
-
children: [_mapInstanceProperty__default[
|
|
448
|
+
children: [_mapInstanceProperty__default["default"](weekdays).call(weekdays, function (weekday) {
|
|
449
449
|
return jsxRuntime.jsx(calendarUtils.CalendarDay, {
|
|
450
450
|
type: "heading",
|
|
451
451
|
children: weekday
|
|
452
452
|
}, weekday);
|
|
453
|
-
}), _mapInstanceProperty__default[
|
|
453
|
+
}), _mapInstanceProperty__default["default"](paddingDays).call(paddingDays, function (day, index) {
|
|
454
454
|
return jsxRuntime.jsx(calendarUtils.CalendarDay, {
|
|
455
455
|
type: "spacing"
|
|
456
456
|
}, index);
|
|
457
|
-
}), _mapInstanceProperty__default[
|
|
457
|
+
}), _mapInstanceProperty__default["default"](calendarItems).call(calendarItems, function (item, index) {
|
|
458
458
|
var isHighlighted = _this2.state.suggestedItems.length + index === highlightedIndex;
|
|
459
459
|
|
|
460
460
|
var _getRange = getRange({
|
|
@@ -521,82 +521,82 @@ DateRangeCalendar.isEmpty = function (range) {
|
|
|
521
521
|
};
|
|
522
522
|
|
|
523
523
|
DateRangeCalendar.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
524
|
-
intl: PropTypes__default[
|
|
525
|
-
locale: PropTypes__default[
|
|
526
|
-
formatMessage: PropTypes__default[
|
|
524
|
+
intl: PropTypes__default["default"].shape({
|
|
525
|
+
locale: PropTypes__default["default"].string.isRequired,
|
|
526
|
+
formatMessage: PropTypes__default["default"].func.isRequired
|
|
527
527
|
}).isRequired,
|
|
528
528
|
|
|
529
529
|
/**
|
|
530
530
|
* Horizontal size limit of the input field.
|
|
531
531
|
*/
|
|
532
|
-
horizontalConstraint: PropTypes__default[
|
|
532
|
+
horizontalConstraint: PropTypes__default["default"].oneOf([6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
|
|
533
533
|
|
|
534
534
|
/**
|
|
535
535
|
* The selected date range, must either be an empty array or an array of two strings holding dates formatted as "YYYY-MM-DD".
|
|
536
536
|
*/
|
|
537
|
-
value: PropTypes__default[
|
|
537
|
+
value: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string).isRequired,
|
|
538
538
|
|
|
539
539
|
/**
|
|
540
540
|
* Called when the date range changes. Called with an event containing either an empty array (no value) or an array holding two string in this format: "YYYY-MM-DD".
|
|
541
541
|
* <br />
|
|
542
542
|
* Signature: `(event) => void`
|
|
543
543
|
*/
|
|
544
|
-
onChange: PropTypes__default[
|
|
544
|
+
onChange: PropTypes__default["default"].func.isRequired,
|
|
545
545
|
|
|
546
546
|
/**
|
|
547
547
|
* Allows the range to be cleared
|
|
548
548
|
*/
|
|
549
|
-
isClearable: PropTypes__default[
|
|
549
|
+
isClearable: PropTypes__default["default"].bool,
|
|
550
550
|
|
|
551
551
|
/**
|
|
552
552
|
* Called when the date input gains focus.
|
|
553
553
|
*/
|
|
554
|
-
onFocus: PropTypes__default[
|
|
554
|
+
onFocus: PropTypes__default["default"].func,
|
|
555
555
|
|
|
556
556
|
/**
|
|
557
557
|
* Called when the date input loses focus.
|
|
558
558
|
*/
|
|
559
|
-
onBlur: PropTypes__default[
|
|
559
|
+
onBlur: PropTypes__default["default"].func,
|
|
560
560
|
|
|
561
561
|
/**
|
|
562
562
|
* Used as the HTML `id` attribute.
|
|
563
563
|
*/
|
|
564
|
-
id: PropTypes__default[
|
|
564
|
+
id: PropTypes__default["default"].string,
|
|
565
565
|
|
|
566
566
|
/**
|
|
567
567
|
* Used as the HTML `name` attribute.
|
|
568
568
|
*/
|
|
569
|
-
name: PropTypes__default[
|
|
569
|
+
name: PropTypes__default["default"].string,
|
|
570
570
|
|
|
571
571
|
/**
|
|
572
572
|
* Placeholder value to show in the input field
|
|
573
573
|
*/
|
|
574
|
-
placeholder: PropTypes__default[
|
|
574
|
+
placeholder: PropTypes__default["default"].string,
|
|
575
575
|
|
|
576
576
|
/**
|
|
577
577
|
* Disables the date picker
|
|
578
578
|
*/
|
|
579
|
-
isDisabled: PropTypes__default[
|
|
579
|
+
isDisabled: PropTypes__default["default"].bool,
|
|
580
580
|
|
|
581
581
|
/**
|
|
582
582
|
* Disables the date picker menu and makes input field read-only
|
|
583
583
|
*/
|
|
584
|
-
isReadOnly: PropTypes__default[
|
|
584
|
+
isReadOnly: PropTypes__default["default"].bool,
|
|
585
585
|
|
|
586
586
|
/**
|
|
587
587
|
* Indicates the input field has an error
|
|
588
588
|
*/
|
|
589
|
-
hasError: PropTypes__default[
|
|
589
|
+
hasError: PropTypes__default["default"].bool,
|
|
590
590
|
|
|
591
591
|
/**
|
|
592
592
|
* Indicates the input field has warning
|
|
593
593
|
*/
|
|
594
|
-
hasWarning: PropTypes__default[
|
|
594
|
+
hasWarning: PropTypes__default["default"].bool
|
|
595
595
|
} : {};
|
|
596
596
|
var dateRangeInput = reactIntl.injectIntl(DateRangeCalendar);
|
|
597
597
|
|
|
598
|
-
// NOTE: This string will be replaced
|
|
599
|
-
var version =
|
|
598
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
599
|
+
var version = "12.2.7";
|
|
600
600
|
|
|
601
|
-
exports[
|
|
601
|
+
exports["default"] = dateRangeInput;
|
|
602
602
|
exports.version = version;
|
|
@@ -59,13 +59,13 @@ var messages = reactIntl.defineMessages({
|
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
62
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
63
63
|
|
|
64
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context6; _forEachInstanceProperty__default[
|
|
64
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context6; _forEachInstanceProperty__default["default"](_context6 = ownKeys(Object(source), true)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context7; _forEachInstanceProperty__default["default"](_context7 = ownKeys(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
65
65
|
|
|
66
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default[
|
|
66
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
67
67
|
|
|
68
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default[
|
|
68
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
69
69
|
|
|
70
70
|
var preventDownshiftDefault = function preventDownshiftDefault(event) {
|
|
71
71
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -75,8 +75,8 @@ var preventDownshiftDefault = function preventDownshiftDefault(event) {
|
|
|
75
75
|
var parseRangeText = function parseRangeText(text, locale) {
|
|
76
76
|
var _context, _context2;
|
|
77
77
|
|
|
78
|
-
var parts = _filterInstanceProperty__default[
|
|
79
|
-
var parsedDate = calendarUtils.parseInputToDate(_trimInstanceProperty__default[
|
|
78
|
+
var parts = _filterInstanceProperty__default["default"](_context = _mapInstanceProperty__default["default"](_context2 = text.split(' - ')).call(_context2, function (part) {
|
|
79
|
+
var parsedDate = calendarUtils.parseInputToDate(_trimInstanceProperty__default["default"](part).call(part), locale);
|
|
80
80
|
return parsedDate === '' ? null : parsedDate;
|
|
81
81
|
})).call(_context, Boolean);
|
|
82
82
|
|
|
@@ -146,7 +146,7 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
146
146
|
args[_key] = arguments[_key];
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
_this = _super.call.apply(_super, _concatInstanceProperty__default[
|
|
149
|
+
_this = _super.call.apply(_super, _concatInstanceProperty__default["default"](_context3 = [this]).call(_context3, args));
|
|
150
150
|
_this.inputRef = /*#__PURE__*/react.createRef();
|
|
151
151
|
_this.state = {
|
|
152
152
|
calendarDate: _this.props.value.length === 2 ? _this.props.value[0] : calendarUtils.getToday(),
|
|
@@ -198,7 +198,7 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
198
198
|
target: {
|
|
199
199
|
id: _this.props.id,
|
|
200
200
|
name: _this.props.name,
|
|
201
|
-
value: _sortInstanceProperty__default[
|
|
201
|
+
value: _sortInstanceProperty__default["default"](unsortedRange).call(unsortedRange)
|
|
202
202
|
}
|
|
203
203
|
});
|
|
204
204
|
};
|
|
@@ -211,9 +211,9 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
211
211
|
value: function render() {
|
|
212
212
|
var _this2 = this;
|
|
213
213
|
|
|
214
|
-
return jsxRuntime.jsx(Constraints__default[
|
|
214
|
+
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
215
215
|
max: this.props.horizontalConstraint,
|
|
216
|
-
children: jsxRuntime.jsx(Downshift__default[
|
|
216
|
+
children: jsxRuntime.jsx(Downshift__default["default"], {
|
|
217
217
|
inputId: this.props.id,
|
|
218
218
|
itemToString: calendarUtils.createItemRangeToString(this.props.intl.locale),
|
|
219
219
|
inputValue: this.state.inputValue,
|
|
@@ -222,7 +222,7 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
222
222
|
onInputValueChange: function onInputValueChange(inputValue, changes) {
|
|
223
223
|
// only attempt to parse input when the user typed into the input
|
|
224
224
|
// field
|
|
225
|
-
if (changes.type !== Downshift__default[
|
|
225
|
+
if (changes.type !== Downshift__default["default"].stateChangeTypes.changeInput) return;
|
|
226
226
|
|
|
227
227
|
_this2.setState(function () {
|
|
228
228
|
var parsedRange = parseRangeText(inputValue, _this2.props.intl.locale);
|
|
@@ -262,7 +262,7 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
262
262
|
/* eslint-disable no-prototype-builtins */
|
|
263
263
|
_this2.setState(function (prevState) {
|
|
264
264
|
// ensure input value matches prop value when menu is closed
|
|
265
|
-
if (changes.type === Downshift__default[
|
|
265
|
+
if (changes.type === Downshift__default["default"].stateChangeTypes.mouseUp || changes.type === Downshift__default["default"].stateChangeTypes.blurInput) {
|
|
266
266
|
return {
|
|
267
267
|
highlightedIndex: null,
|
|
268
268
|
isOpen: false,
|
|
@@ -339,11 +339,11 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
339
339
|
inputValue = _ref2.inputValue;
|
|
340
340
|
var calendarItems = calendarUtils.createCalendarItems(_this2.state.calendarDate, _this2.props.intl);
|
|
341
341
|
|
|
342
|
-
var allItems = _concatInstanceProperty__default[
|
|
342
|
+
var allItems = _concatInstanceProperty__default["default"](_context4 = []).call(_context4, _toConsumableArray(_this2.state.suggestedItems), _toConsumableArray(calendarItems));
|
|
343
343
|
|
|
344
344
|
var paddingDayCount = calendarUtils.getPaddingDayCount(_this2.state.calendarDate, _this2.props.intl.locale);
|
|
345
345
|
|
|
346
|
-
var paddingDays = _fillInstanceProperty__default[
|
|
346
|
+
var paddingDays = _fillInstanceProperty__default["default"](_context5 = Array(paddingDayCount)).call(_context5);
|
|
347
347
|
|
|
348
348
|
var weekdays = calendarUtils.getWeekdayNames(_this2.props.intl.locale);
|
|
349
349
|
var today = calendarUtils.getToday();
|
|
@@ -369,7 +369,7 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
371
371
|
|
|
372
|
-
if (event.key === 'Enter' && _trimInstanceProperty__default[
|
|
372
|
+
if (event.key === 'Enter' && _trimInstanceProperty__default["default"](inputValue).call(inputValue) === '' && // do not clear value when user presses Enter to
|
|
373
373
|
// select the end date (so only clear when there is no
|
|
374
374
|
// startDate)
|
|
375
375
|
!_this2.state.startDate && _this2.props.isClearable) {
|
|
@@ -444,16 +444,16 @@ var DateRangeCalendar = /*#__PURE__*/function (_Component) {
|
|
|
444
444
|
return _this2.jumpMonth(12);
|
|
445
445
|
}
|
|
446
446
|
}), jsxRuntime.jsxs(calendarUtils.CalendarContent, {
|
|
447
|
-
children: [_mapInstanceProperty__default[
|
|
447
|
+
children: [_mapInstanceProperty__default["default"](weekdays).call(weekdays, function (weekday) {
|
|
448
448
|
return jsxRuntime.jsx(calendarUtils.CalendarDay, {
|
|
449
449
|
type: "heading",
|
|
450
450
|
children: weekday
|
|
451
451
|
}, weekday);
|
|
452
|
-
}), _mapInstanceProperty__default[
|
|
452
|
+
}), _mapInstanceProperty__default["default"](paddingDays).call(paddingDays, function (day, index) {
|
|
453
453
|
return jsxRuntime.jsx(calendarUtils.CalendarDay, {
|
|
454
454
|
type: "spacing"
|
|
455
455
|
}, index);
|
|
456
|
-
}), _mapInstanceProperty__default[
|
|
456
|
+
}), _mapInstanceProperty__default["default"](calendarItems).call(calendarItems, function (item, index) {
|
|
457
457
|
var isHighlighted = _this2.state.suggestedItems.length + index === highlightedIndex;
|
|
458
458
|
|
|
459
459
|
var _getRange = getRange({
|
|
@@ -522,8 +522,8 @@ DateRangeCalendar.isEmpty = function (range) {
|
|
|
522
522
|
DateRangeCalendar.propTypes = {};
|
|
523
523
|
var dateRangeInput = reactIntl.injectIntl(DateRangeCalendar);
|
|
524
524
|
|
|
525
|
-
// NOTE: This string will be replaced
|
|
526
|
-
var version =
|
|
525
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
526
|
+
var version = "12.2.7";
|
|
527
527
|
|
|
528
|
-
exports[
|
|
528
|
+
exports["default"] = dateRangeInput;
|
|
529
529
|
exports.version = version;
|
|
@@ -571,7 +571,7 @@ DateRangeCalendar.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
571
571
|
} : {};
|
|
572
572
|
var dateRangeInput = injectIntl(DateRangeCalendar);
|
|
573
573
|
|
|
574
|
-
// NOTE: This string will be replaced
|
|
575
|
-
var version =
|
|
574
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
575
|
+
var version = "12.2.7";
|
|
576
576
|
|
|
577
577
|
export { dateRangeInput as default, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/date-range-input",
|
|
3
3
|
"description": "The `DateRangeInput` component allows the user to select a date range.",
|
|
4
|
-
"version": "12.2.
|
|
4
|
+
"version": "12.2.7",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"homepage": "https://uikit.commercetools.com",
|
|
12
12
|
"keywords": ["javascript", "design system", "react", "uikit"],
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"private": false,
|
|
15
14
|
"publishConfig": {
|
|
16
15
|
"access": "public"
|
|
17
16
|
},
|
|
@@ -19,27 +18,24 @@
|
|
|
19
18
|
"main": "dist/commercetools-uikit-date-range-input.cjs.js",
|
|
20
19
|
"module": "dist/commercetools-uikit-date-range-input.esm.js",
|
|
21
20
|
"files": ["dist"],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"prepare": "../../../../scripts/version.js replace"
|
|
24
|
-
},
|
|
25
21
|
"dependencies": {
|
|
26
|
-
"@babel/runtime": "7.
|
|
27
|
-
"@babel/runtime-corejs3": "7.
|
|
28
|
-
"@commercetools-uikit/accessible-button": "12.2.
|
|
29
|
-
"@commercetools-uikit/calendar-utils": "12.2.
|
|
30
|
-
"@commercetools-uikit/constraints": "12.2.
|
|
31
|
-
"@commercetools-uikit/design-system": "12.2.
|
|
32
|
-
"@commercetools-uikit/hooks": "12.2.
|
|
33
|
-
"@commercetools-uikit/icons": "12.2.
|
|
34
|
-
"@commercetools-uikit/secondary-icon-button": "12.2.
|
|
35
|
-
"@commercetools-uikit/select-utils": "12.2.
|
|
36
|
-
"@commercetools-uikit/spacings-inline": "12.2.
|
|
37
|
-
"@commercetools-uikit/text": "12.2.
|
|
38
|
-
"@commercetools-uikit/tooltip": "12.2.
|
|
39
|
-
"@commercetools-uikit/utils": "12.2.
|
|
22
|
+
"@babel/runtime": "7.16.3",
|
|
23
|
+
"@babel/runtime-corejs3": "7.16.3",
|
|
24
|
+
"@commercetools-uikit/accessible-button": "12.2.5",
|
|
25
|
+
"@commercetools-uikit/calendar-utils": "12.2.7",
|
|
26
|
+
"@commercetools-uikit/constraints": "12.2.5",
|
|
27
|
+
"@commercetools-uikit/design-system": "12.2.5",
|
|
28
|
+
"@commercetools-uikit/hooks": "12.2.5",
|
|
29
|
+
"@commercetools-uikit/icons": "12.2.7",
|
|
30
|
+
"@commercetools-uikit/secondary-icon-button": "12.2.5",
|
|
31
|
+
"@commercetools-uikit/select-utils": "12.2.7",
|
|
32
|
+
"@commercetools-uikit/spacings-inline": "12.2.5",
|
|
33
|
+
"@commercetools-uikit/text": "12.2.5",
|
|
34
|
+
"@commercetools-uikit/tooltip": "12.2.5",
|
|
35
|
+
"@commercetools-uikit/utils": "12.2.5",
|
|
40
36
|
"@emotion/react": "^11.4.0",
|
|
41
37
|
"@emotion/styled": "^11.3.0",
|
|
42
|
-
"common-tags": "1.8.
|
|
38
|
+
"common-tags": "1.8.2",
|
|
43
39
|
"downshift": "6.1.7",
|
|
44
40
|
"prop-types": "15.7.2",
|
|
45
41
|
"react-is": "17.0.2",
|
|
@@ -49,7 +45,7 @@
|
|
|
49
45
|
"devDependencies": {
|
|
50
46
|
"moment": "2.29.1",
|
|
51
47
|
"react": "17.0.2",
|
|
52
|
-
"react-intl": "5.
|
|
48
|
+
"react-intl": "5.21.2"
|
|
53
49
|
},
|
|
54
50
|
"peerDependencies": {
|
|
55
51
|
"moment": "2.x",
|