@commercetools-uikit/date-range-input 19.11.0 → 19.12.1

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.
@@ -22,7 +22,6 @@ var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instan
22
22
  var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
23
23
  var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
24
24
  var _fillInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/fill');
25
- var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
26
25
  var react = require('react');
27
26
  var Downshift = require('downshift');
28
27
  var reactIntl = require('react-intl');
@@ -48,12 +47,11 @@ var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstancePro
48
47
  var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
49
48
  var _sortInstanceProperty__default = /*#__PURE__*/_interopDefault(_sortInstanceProperty);
50
49
  var _fillInstanceProperty__default = /*#__PURE__*/_interopDefault(_fillInstanceProperty);
51
- var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
52
50
  var Downshift__default = /*#__PURE__*/_interopDefault(Downshift);
53
51
  var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
54
52
 
55
53
  function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
56
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
54
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
57
55
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
58
56
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
59
57
  const preventDownshiftDefault = event => {
@@ -107,7 +105,6 @@ const getRange = _ref => {
107
105
  };
108
106
  };
109
107
  let DateRangeInput = /*#__PURE__*/function (_Component) {
110
- _inherits(DateRangeInput, _Component);
111
108
  function DateRangeInput() {
112
109
  var _this;
113
110
  _classCallCheck(this, DateRangeInput);
@@ -141,10 +138,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
141
138
  _this.setState(prevState => ({
142
139
  calendarDate: today,
143
140
  highlightedIndex: prevState.suggestedItems.length + calendarUtils.getDateInMonth(today) - 1
144
- }), () => {
145
- var _this$inputRef$curren;
146
- return (_this$inputRef$curren = _this.inputRef.current) === null || _this$inputRef$curren === void 0 ? void 0 : _this$inputRef$curren.focus();
147
- });
141
+ }), () => _this.inputRef.current?.focus());
148
142
  };
149
143
  _this.handleBlur = () => {
150
144
  if (_this.props.onBlur) _this.props.onBlur({
@@ -155,8 +149,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
155
149
  });
156
150
  };
157
151
  _this.emit = unsortedRange => {
158
- var _this$props$onChange, _this$props;
159
- (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props, {
152
+ _this.props.onChange?.({
160
153
  target: {
161
154
  id: _this.props.id,
162
155
  name: _this.props.name,
@@ -166,7 +159,8 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
166
159
  };
167
160
  return _this;
168
161
  }
169
- _createClass(DateRangeInput, [{
162
+ _inherits(DateRangeInput, _Component);
163
+ return _createClass(DateRangeInput, [{
170
164
  key: "render",
171
165
  value: function render() {
172
166
  return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
@@ -270,7 +264,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
270
264
  },
271
265
  isOpen: this.state.isOpen,
272
266
  children: _ref2 => {
273
- var _context3, _context4;
267
+ var _context3;
274
268
  let getInputProps = _ref2.getInputProps,
275
269
  getMenuProps = _ref2.getMenuProps,
276
270
  getItemProps = _ref2.getItemProps,
@@ -300,7 +294,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
300
294
  // between the <label for> and the <input id>.
301
295
  'aria-labelledby': undefined,
302
296
  name: this.props.name,
303
- placeholder: typeof this.props.placeholder === 'string' ? this.props.placeholder : _concatInstanceProperty__default["default"](_context4 = "".concat(calendarTimeUtils.getLocalizedDateTimeFormatPattern(this.props.intl.locale), " - ")).call(_context4, calendarTimeUtils.getLocalizedDateTimeFormatPattern(this.props.intl.locale)),
297
+ placeholder: typeof this.props.placeholder === 'string' ? this.props.placeholder : `${calendarTimeUtils.getLocalizedDateTimeFormatPattern(this.props.intl.locale)} - ${calendarTimeUtils.getLocalizedDateTimeFormatPattern(this.props.intl.locale)}`,
304
298
  onMouseEnter: () => {
305
299
  // we remove the highlight so that the user can use the
306
300
  // arrow keys to move the cursor when hovering
@@ -312,7 +306,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
312
306
  preventDownshiftDefault(event);
313
307
  return;
314
308
  }
315
- if (event.key === 'Enter' && (inputValue === null || inputValue === void 0 ? void 0 : _trimInstanceProperty__default["default"](inputValue).call(inputValue)) === '' &&
309
+ if (event.key === 'Enter' && inputValue?.trim() === '' &&
316
310
  // do not clear value when user presses Enter to
317
311
  // select the end date (so only clear when there is no
318
312
  // startDate)
@@ -432,7 +426,6 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
432
426
  };
433
427
  }
434
428
  }]);
435
- return DateRangeInput;
436
429
  }(react.Component);
437
430
  DateRangeInput.displayName = 'DateRangeInput';
438
431
  DateRangeInput.defaultProps = {
@@ -460,7 +453,7 @@ DateRangeInput.propTypes = process.env.NODE_ENV !== "production" ? {
460
453
  var dateRangeInput = reactIntl.injectIntl(DateRangeInput);
461
454
 
462
455
  // NOTE: This string will be replaced on build time with the package version.
463
- var version = "19.11.0";
456
+ var version = "19.12.1";
464
457
 
465
458
  exports["default"] = dateRangeInput;
466
459
  exports.version = version;
@@ -22,7 +22,6 @@ var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instan
22
22
  var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
23
23
  var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
24
24
  var _fillInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/fill');
25
- var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
26
25
  var react = require('react');
27
26
  var Downshift = require('downshift');
28
27
  var reactIntl = require('react-intl');
@@ -47,12 +46,11 @@ var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstancePro
47
46
  var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
48
47
  var _sortInstanceProperty__default = /*#__PURE__*/_interopDefault(_sortInstanceProperty);
49
48
  var _fillInstanceProperty__default = /*#__PURE__*/_interopDefault(_fillInstanceProperty);
50
- var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
51
49
  var Downshift__default = /*#__PURE__*/_interopDefault(Downshift);
52
50
  var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
53
51
 
54
52
  function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
55
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
53
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
56
54
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
57
55
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
58
56
  const preventDownshiftDefault = event => {
@@ -106,7 +104,6 @@ const getRange = _ref => {
106
104
  };
107
105
  };
108
106
  let DateRangeInput = /*#__PURE__*/function (_Component) {
109
- _inherits(DateRangeInput, _Component);
110
107
  function DateRangeInput() {
111
108
  var _this;
112
109
  _classCallCheck(this, DateRangeInput);
@@ -140,10 +137,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
140
137
  _this.setState(prevState => ({
141
138
  calendarDate: today,
142
139
  highlightedIndex: prevState.suggestedItems.length + calendarUtils.getDateInMonth(today) - 1
143
- }), () => {
144
- var _this$inputRef$curren;
145
- return (_this$inputRef$curren = _this.inputRef.current) === null || _this$inputRef$curren === void 0 ? void 0 : _this$inputRef$curren.focus();
146
- });
140
+ }), () => _this.inputRef.current?.focus());
147
141
  };
148
142
  _this.handleBlur = () => {
149
143
  if (_this.props.onBlur) _this.props.onBlur({
@@ -154,8 +148,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
154
148
  });
155
149
  };
156
150
  _this.emit = unsortedRange => {
157
- var _this$props$onChange, _this$props;
158
- (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props, {
151
+ _this.props.onChange?.({
159
152
  target: {
160
153
  id: _this.props.id,
161
154
  name: _this.props.name,
@@ -165,7 +158,8 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
165
158
  };
166
159
  return _this;
167
160
  }
168
- _createClass(DateRangeInput, [{
161
+ _inherits(DateRangeInput, _Component);
162
+ return _createClass(DateRangeInput, [{
169
163
  key: "render",
170
164
  value: function render() {
171
165
  return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
@@ -269,7 +263,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
269
263
  },
270
264
  isOpen: this.state.isOpen,
271
265
  children: _ref2 => {
272
- var _context3, _context4;
266
+ var _context3;
273
267
  let getInputProps = _ref2.getInputProps,
274
268
  getMenuProps = _ref2.getMenuProps,
275
269
  getItemProps = _ref2.getItemProps,
@@ -299,7 +293,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
299
293
  // between the <label for> and the <input id>.
300
294
  'aria-labelledby': undefined,
301
295
  name: this.props.name,
302
- placeholder: typeof this.props.placeholder === 'string' ? this.props.placeholder : _concatInstanceProperty__default["default"](_context4 = "".concat(calendarTimeUtils.getLocalizedDateTimeFormatPattern(this.props.intl.locale), " - ")).call(_context4, calendarTimeUtils.getLocalizedDateTimeFormatPattern(this.props.intl.locale)),
296
+ placeholder: typeof this.props.placeholder === 'string' ? this.props.placeholder : `${calendarTimeUtils.getLocalizedDateTimeFormatPattern(this.props.intl.locale)} - ${calendarTimeUtils.getLocalizedDateTimeFormatPattern(this.props.intl.locale)}`,
303
297
  onMouseEnter: () => {
304
298
  // we remove the highlight so that the user can use the
305
299
  // arrow keys to move the cursor when hovering
@@ -311,7 +305,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
311
305
  preventDownshiftDefault(event);
312
306
  return;
313
307
  }
314
- if (event.key === 'Enter' && (inputValue === null || inputValue === void 0 ? void 0 : _trimInstanceProperty__default["default"](inputValue).call(inputValue)) === '' &&
308
+ if (event.key === 'Enter' && inputValue?.trim() === '' &&
315
309
  // do not clear value when user presses Enter to
316
310
  // select the end date (so only clear when there is no
317
311
  // startDate)
@@ -431,7 +425,6 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
431
425
  };
432
426
  }
433
427
  }]);
434
- return DateRangeInput;
435
428
  }(react.Component);
436
429
  DateRangeInput.displayName = 'DateRangeInput';
437
430
  DateRangeInput.defaultProps = {
@@ -442,7 +435,7 @@ DateRangeInput.propTypes = {};
442
435
  var dateRangeInput = reactIntl.injectIntl(DateRangeInput);
443
436
 
444
437
  // NOTE: This string will be replaced on build time with the package version.
445
- var version = "19.11.0";
438
+ var version = "19.12.1";
446
439
 
447
440
  exports["default"] = dateRangeInput;
448
441
  exports.version = version;
@@ -18,18 +18,17 @@ import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance
18
18
  import _trimInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/trim';
19
19
  import _sortInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/sort';
20
20
  import _fillInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/fill';
21
- import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
22
- import { createRef, Component } from 'react';
21
+ import { Component, createRef } from 'react';
23
22
  import Downshift from 'downshift';
24
23
  import { injectIntl } from 'react-intl';
25
24
  import Constraints from '@commercetools-uikit/constraints';
26
25
  import { filterDataAttributes } from '@commercetools-uikit/utils';
27
- import { getToday, formatRange, changeMonth, getDateInMonth, createItemRangeToString, createCalendarItems, getPaddingDayCount, getWeekdayNames, CalendarBody, getPreviousDay, getDaysInMonth, CalendarMenu, CalendarHeader, getMonthCalendarLabel, getYearCalendarLabel, CalendarContent, CalendarDay, isSameDay, getCalendarDayLabel, parseInputToDate, isBetween } from '@commercetools-uikit/calendar-utils';
26
+ import { createItemRangeToString, getDateInMonth, formatRange, getToday, createCalendarItems, getPaddingDayCount, getWeekdayNames, CalendarBody, getPreviousDay, getDaysInMonth, CalendarMenu, CalendarHeader, getMonthCalendarLabel, getYearCalendarLabel, CalendarContent, CalendarDay, isSameDay, getCalendarDayLabel, parseInputToDate, isBetween, changeMonth } from '@commercetools-uikit/calendar-utils';
28
27
  import { getLocalizedDateTimeFormatPattern } from '@commercetools-uikit/calendar-time-utils';
29
28
  import { jsx, jsxs } from '@emotion/react/jsx-runtime';
30
29
 
31
30
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
32
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
31
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context5 = ownKeys(Object(t))).call(_context5, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
33
32
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
34
33
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
35
34
  const preventDownshiftDefault = event => {
@@ -83,7 +82,6 @@ const getRange = _ref => {
83
82
  };
84
83
  };
85
84
  let DateRangeInput = /*#__PURE__*/function (_Component) {
86
- _inherits(DateRangeInput, _Component);
87
85
  function DateRangeInput() {
88
86
  var _this;
89
87
  _classCallCheck(this, DateRangeInput);
@@ -117,10 +115,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
117
115
  _this.setState(prevState => ({
118
116
  calendarDate: today,
119
117
  highlightedIndex: prevState.suggestedItems.length + getDateInMonth(today) - 1
120
- }), () => {
121
- var _this$inputRef$curren;
122
- return (_this$inputRef$curren = _this.inputRef.current) === null || _this$inputRef$curren === void 0 ? void 0 : _this$inputRef$curren.focus();
123
- });
118
+ }), () => _this.inputRef.current?.focus());
124
119
  };
125
120
  _this.handleBlur = () => {
126
121
  if (_this.props.onBlur) _this.props.onBlur({
@@ -131,8 +126,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
131
126
  });
132
127
  };
133
128
  _this.emit = unsortedRange => {
134
- var _this$props$onChange, _this$props;
135
- (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props, {
129
+ _this.props.onChange?.({
136
130
  target: {
137
131
  id: _this.props.id,
138
132
  name: _this.props.name,
@@ -142,7 +136,8 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
142
136
  };
143
137
  return _this;
144
138
  }
145
- _createClass(DateRangeInput, [{
139
+ _inherits(DateRangeInput, _Component);
140
+ return _createClass(DateRangeInput, [{
146
141
  key: "render",
147
142
  value: function render() {
148
143
  return jsx(Constraints.Horizontal, {
@@ -246,7 +241,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
246
241
  },
247
242
  isOpen: this.state.isOpen,
248
243
  children: _ref2 => {
249
- var _context3, _context4;
244
+ var _context3;
250
245
  let getInputProps = _ref2.getInputProps,
251
246
  getMenuProps = _ref2.getMenuProps,
252
247
  getItemProps = _ref2.getItemProps,
@@ -276,7 +271,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
276
271
  // between the <label for> and the <input id>.
277
272
  'aria-labelledby': undefined,
278
273
  name: this.props.name,
279
- placeholder: typeof this.props.placeholder === 'string' ? this.props.placeholder : _concatInstanceProperty(_context4 = "".concat(getLocalizedDateTimeFormatPattern(this.props.intl.locale), " - ")).call(_context4, getLocalizedDateTimeFormatPattern(this.props.intl.locale)),
274
+ placeholder: typeof this.props.placeholder === 'string' ? this.props.placeholder : `${getLocalizedDateTimeFormatPattern(this.props.intl.locale)} - ${getLocalizedDateTimeFormatPattern(this.props.intl.locale)}`,
280
275
  onMouseEnter: () => {
281
276
  // we remove the highlight so that the user can use the
282
277
  // arrow keys to move the cursor when hovering
@@ -288,7 +283,7 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
288
283
  preventDownshiftDefault(event);
289
284
  return;
290
285
  }
291
- if (event.key === 'Enter' && (inputValue === null || inputValue === void 0 ? void 0 : _trimInstanceProperty(inputValue).call(inputValue)) === '' &&
286
+ if (event.key === 'Enter' && inputValue?.trim() === '' &&
292
287
  // do not clear value when user presses Enter to
293
288
  // select the end date (so only clear when there is no
294
289
  // startDate)
@@ -408,7 +403,6 @@ let DateRangeInput = /*#__PURE__*/function (_Component) {
408
403
  };
409
404
  }
410
405
  }]);
411
- return DateRangeInput;
412
406
  }(Component);
413
407
  DateRangeInput.displayName = 'DateRangeInput';
414
408
  DateRangeInput.defaultProps = {
@@ -436,6 +430,6 @@ DateRangeInput.propTypes = process.env.NODE_ENV !== "production" ? {
436
430
  var dateRangeInput = injectIntl(DateRangeInput);
437
431
 
438
432
  // NOTE: This string will be replaced on build time with the package version.
439
- var version = "19.11.0";
433
+ var version = "19.12.1";
440
434
 
441
435
  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": "19.11.0",
4
+ "version": "19.12.1",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,19 +21,19 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.20.13",
23
23
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/accessible-button": "19.11.0",
25
- "@commercetools-uikit/calendar-time-utils": "19.11.0",
26
- "@commercetools-uikit/calendar-utils": "19.11.0",
27
- "@commercetools-uikit/constraints": "19.11.0",
28
- "@commercetools-uikit/design-system": "19.11.0",
29
- "@commercetools-uikit/hooks": "19.11.0",
30
- "@commercetools-uikit/icons": "19.11.0",
31
- "@commercetools-uikit/secondary-icon-button": "19.11.0",
32
- "@commercetools-uikit/select-utils": "19.11.0",
33
- "@commercetools-uikit/spacings-inline": "19.11.0",
34
- "@commercetools-uikit/text": "19.11.0",
35
- "@commercetools-uikit/tooltip": "19.11.0",
36
- "@commercetools-uikit/utils": "19.11.0",
24
+ "@commercetools-uikit/accessible-button": "19.12.1",
25
+ "@commercetools-uikit/calendar-time-utils": "19.12.1",
26
+ "@commercetools-uikit/calendar-utils": "19.12.1",
27
+ "@commercetools-uikit/constraints": "19.12.1",
28
+ "@commercetools-uikit/design-system": "19.12.1",
29
+ "@commercetools-uikit/hooks": "19.12.1",
30
+ "@commercetools-uikit/icons": "19.12.1",
31
+ "@commercetools-uikit/secondary-icon-button": "19.12.1",
32
+ "@commercetools-uikit/select-utils": "19.12.1",
33
+ "@commercetools-uikit/spacings-inline": "19.12.1",
34
+ "@commercetools-uikit/text": "19.12.1",
35
+ "@commercetools-uikit/tooltip": "19.12.1",
36
+ "@commercetools-uikit/utils": "19.12.1",
37
37
  "@emotion/react": "^11.10.5",
38
38
  "@emotion/styled": "^11.10.5",
39
39
  "downshift": "6.1.12",