@commercetools-uikit/date-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.
@@ -49,9 +49,9 @@ var messages = reactIntl.defineMessages({
49
49
  }
50
50
  });
51
51
 
52
- 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; }
52
+ 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; }
53
53
 
54
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty__default['default'](_context2 = ownKeys(Object(source), true)).call(_context2, 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 _context3; _forEachInstanceProperty__default['default'](_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty__default['default'](target, key, _Object$getOwnPropertyDescriptor__default['default'](source, key)); }); } } return target; }
54
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source), true)).call(_context2, 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 _context3; _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
55
55
 
56
56
  var preventDownshiftDefault = function preventDownshiftDefault(event) {
57
57
  // eslint-disable-next-line no-param-reassign
@@ -117,9 +117,9 @@ var DateInput = function DateInput(props) {
117
117
  setHighlightedIndex(dayToHighlight);
118
118
  };
119
119
 
120
- return jsxRuntime.jsx(Constraints__default['default'].Horizontal, {
120
+ return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
121
121
  max: props.horizontalConstraint,
122
- children: jsxRuntime.jsx(Downshift__default['default'], {
122
+ children: jsxRuntime.jsx(Downshift__default["default"], {
123
123
  inputId: props.id,
124
124
  itemToString: calendarUtils.createItemToString(intl.locale),
125
125
  selectedItem: props.value === '' ? null : props.value,
@@ -129,7 +129,7 @@ var DateInput = function DateInput(props) {
129
129
  /* eslint-disable no-prototype-builtins */
130
130
  if (changes.hasOwnProperty('inputValue')) {
131
131
  // input changed because user typed
132
- if (changes.type === Downshift__default['default'].stateChangeTypes.changeInput) {
132
+ if (changes.type === Downshift__default["default"].stateChangeTypes.changeInput) {
133
133
  var date = calendarUtils.parseInputToDate(changes.inputValue, intl.locale);
134
134
 
135
135
  if (date === '') {
@@ -174,7 +174,7 @@ var DateInput = function DateInput(props) {
174
174
  var calendarItems = calendarUtils.createCalendarItems(calendarDate, intl);
175
175
  var paddingDayCount = calendarUtils.getPaddingDayCount(calendarDate, intl.locale);
176
176
 
177
- var paddingDays = _fillInstanceProperty__default['default'](_context = Array(paddingDayCount)).call(_context);
177
+ var paddingDays = _fillInstanceProperty__default["default"](_context = Array(paddingDayCount)).call(_context);
178
178
 
179
179
  var weekdays = calendarUtils.getWeekdayNames(intl.locale);
180
180
  var today = calendarUtils.getToday();
@@ -200,7 +200,7 @@ var DateInput = function DateInput(props) {
200
200
  return;
201
201
  }
202
202
 
203
- if (event.key === 'Enter' && _trimInstanceProperty__default['default'](inputValue).call(inputValue) === '') {
203
+ if (event.key === 'Enter' && _trimInstanceProperty__default["default"](inputValue).call(inputValue) === '') {
204
204
  clearSelection();
205
205
  } // ArrowDown
206
206
 
@@ -277,16 +277,16 @@ var DateInput = function DateInput(props) {
277
277
  return jumpMonth(12);
278
278
  }
279
279
  }), jsxRuntime.jsxs(calendarUtils.CalendarContent, {
280
- children: [_mapInstanceProperty__default['default'](weekdays).call(weekdays, function (weekday) {
280
+ children: [_mapInstanceProperty__default["default"](weekdays).call(weekdays, function (weekday) {
281
281
  return jsxRuntime.jsx(calendarUtils.CalendarDay, {
282
282
  type: "heading",
283
283
  children: weekday
284
284
  }, weekday);
285
- }), _mapInstanceProperty__default['default'](paddingDays).call(paddingDays, function (day, index) {
285
+ }), _mapInstanceProperty__default["default"](paddingDays).call(paddingDays, function (day, index) {
286
286
  return jsxRuntime.jsx(calendarUtils.CalendarDay, {
287
287
  type: "spacing"
288
288
  }, index);
289
- }), _mapInstanceProperty__default['default'](calendarItems).call(calendarItems, function (item, index) {
289
+ }), _mapInstanceProperty__default["default"](calendarItems).call(calendarItems, function (item, index) {
290
290
  return jsxRuntime.jsx(calendarUtils.CalendarDay, _objectSpread(_objectSpread({
291
291
  isToday: calendarUtils.isSameDay(today, item)
292
292
  }, getItemProps({
@@ -319,79 +319,79 @@ DateInput.propTypes = process.env.NODE_ENV !== "production" ? {
319
319
  /**
320
320
  * Horizontal size limit of the input field.
321
321
  */
322
- horizontalConstraint: PropTypes__default['default'].oneOf([6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
322
+ horizontalConstraint: PropTypes__default["default"].oneOf([6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
323
323
 
324
324
  /**
325
325
  * The selected date, must either be an empty string or a date formatted as "YYYY-MM-DD".
326
326
  */
327
- value: PropTypes__default['default'].string.isRequired,
327
+ value: PropTypes__default["default"].string.isRequired,
328
328
 
329
329
  /**
330
330
  * Called when the date changes. Called with an event containing either an empty string (no value) or a string in this format: "YYYY-MM-DD".
331
331
  * <br />
332
332
  * Signature: `(event) => void`
333
333
  */
334
- onChange: PropTypes__default['default'].func.isRequired,
334
+ onChange: PropTypes__default["default"].func.isRequired,
335
335
 
336
336
  /**
337
337
  * Called when the date input gains focus.
338
338
  */
339
- onFocus: PropTypes__default['default'].func,
339
+ onFocus: PropTypes__default["default"].func,
340
340
 
341
341
  /**
342
342
  * Called when the date input loses focus.
343
343
  */
344
- onBlur: PropTypes__default['default'].func,
344
+ onBlur: PropTypes__default["default"].func,
345
345
 
346
346
  /**
347
347
  * Used as the HTML `id` attribute.
348
348
  */
349
- id: PropTypes__default['default'].string,
349
+ id: PropTypes__default["default"].string,
350
350
 
351
351
  /**
352
352
  * Used as the HTML `name` attribute.
353
353
  */
354
- name: PropTypes__default['default'].string,
354
+ name: PropTypes__default["default"].string,
355
355
 
356
356
  /**
357
357
  * Placeholder value to show in the input field
358
358
  */
359
- placeholder: PropTypes__default['default'].string,
359
+ placeholder: PropTypes__default["default"].string,
360
360
 
361
361
  /**
362
362
  * Disables the date picker
363
363
  */
364
- isDisabled: PropTypes__default['default'].bool,
364
+ isDisabled: PropTypes__default["default"].bool,
365
365
 
366
366
  /**
367
367
  * Disables the date picker menu and makes input field read-only
368
368
  */
369
- isReadOnly: PropTypes__default['default'].bool,
369
+ isReadOnly: PropTypes__default["default"].bool,
370
370
 
371
371
  /**
372
372
  * Indicates the input field has an error
373
373
  */
374
- hasError: PropTypes__default['default'].bool,
374
+ hasError: PropTypes__default["default"].bool,
375
375
 
376
376
  /**
377
377
  * Indicates the input field has a warning
378
378
  */
379
- hasWarning: PropTypes__default['default'].bool,
379
+ hasWarning: PropTypes__default["default"].bool,
380
380
 
381
381
  /**
382
382
  * A minimum selectable date. Must either be an empty string or a date formatted as "YYYY-MM-DD".
383
383
  */
384
- minValue: PropTypes__default['default'].string,
384
+ minValue: PropTypes__default["default"].string,
385
385
 
386
386
  /**
387
387
  * A maximum selectable date. Must either be an empty string or a date formatted as "YYYY-MM-DD".
388
388
  */
389
- maxValue: PropTypes__default['default'].string
389
+ maxValue: PropTypes__default["default"].string
390
390
  } : {};
391
391
  var DateInput$1 = DateInput;
392
392
 
393
- // NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
394
- var version = '12.2.3';
393
+ // NOTE: This string will be replaced on build time with the package version.
394
+ var version = "12.2.7";
395
395
 
396
- exports['default'] = DateInput$1;
396
+ exports["default"] = DateInput$1;
397
397
  exports.version = version;
@@ -48,9 +48,9 @@ var messages = reactIntl.defineMessages({
48
48
  }
49
49
  });
50
50
 
51
- 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; }
51
+ 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; }
52
52
 
53
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty__default['default'](_context2 = ownKeys(Object(source), true)).call(_context2, 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 _context3; _forEachInstanceProperty__default['default'](_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty__default['default'](target, key, _Object$getOwnPropertyDescriptor__default['default'](source, key)); }); } } return target; }
53
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source), true)).call(_context2, 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 _context3; _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
54
54
 
55
55
  var preventDownshiftDefault = function preventDownshiftDefault(event) {
56
56
  // eslint-disable-next-line no-param-reassign
@@ -116,9 +116,9 @@ var DateInput = function DateInput(props) {
116
116
  setHighlightedIndex(dayToHighlight);
117
117
  };
118
118
 
119
- return jsxRuntime.jsx(Constraints__default['default'].Horizontal, {
119
+ return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
120
120
  max: props.horizontalConstraint,
121
- children: jsxRuntime.jsx(Downshift__default['default'], {
121
+ children: jsxRuntime.jsx(Downshift__default["default"], {
122
122
  inputId: props.id,
123
123
  itemToString: calendarUtils.createItemToString(intl.locale),
124
124
  selectedItem: props.value === '' ? null : props.value,
@@ -128,7 +128,7 @@ var DateInput = function DateInput(props) {
128
128
  /* eslint-disable no-prototype-builtins */
129
129
  if (changes.hasOwnProperty('inputValue')) {
130
130
  // input changed because user typed
131
- if (changes.type === Downshift__default['default'].stateChangeTypes.changeInput) {
131
+ if (changes.type === Downshift__default["default"].stateChangeTypes.changeInput) {
132
132
  var date = calendarUtils.parseInputToDate(changes.inputValue, intl.locale);
133
133
 
134
134
  if (date === '') {
@@ -173,7 +173,7 @@ var DateInput = function DateInput(props) {
173
173
  var calendarItems = calendarUtils.createCalendarItems(calendarDate, intl);
174
174
  var paddingDayCount = calendarUtils.getPaddingDayCount(calendarDate, intl.locale);
175
175
 
176
- var paddingDays = _fillInstanceProperty__default['default'](_context = Array(paddingDayCount)).call(_context);
176
+ var paddingDays = _fillInstanceProperty__default["default"](_context = Array(paddingDayCount)).call(_context);
177
177
 
178
178
  var weekdays = calendarUtils.getWeekdayNames(intl.locale);
179
179
  var today = calendarUtils.getToday();
@@ -199,7 +199,7 @@ var DateInput = function DateInput(props) {
199
199
  return;
200
200
  }
201
201
 
202
- if (event.key === 'Enter' && _trimInstanceProperty__default['default'](inputValue).call(inputValue) === '') {
202
+ if (event.key === 'Enter' && _trimInstanceProperty__default["default"](inputValue).call(inputValue) === '') {
203
203
  clearSelection();
204
204
  } // ArrowDown
205
205
 
@@ -276,16 +276,16 @@ var DateInput = function DateInput(props) {
276
276
  return jumpMonth(12);
277
277
  }
278
278
  }), jsxRuntime.jsxs(calendarUtils.CalendarContent, {
279
- children: [_mapInstanceProperty__default['default'](weekdays).call(weekdays, function (weekday) {
279
+ children: [_mapInstanceProperty__default["default"](weekdays).call(weekdays, function (weekday) {
280
280
  return jsxRuntime.jsx(calendarUtils.CalendarDay, {
281
281
  type: "heading",
282
282
  children: weekday
283
283
  }, weekday);
284
- }), _mapInstanceProperty__default['default'](paddingDays).call(paddingDays, function (day, index) {
284
+ }), _mapInstanceProperty__default["default"](paddingDays).call(paddingDays, function (day, index) {
285
285
  return jsxRuntime.jsx(calendarUtils.CalendarDay, {
286
286
  type: "spacing"
287
287
  }, index);
288
- }), _mapInstanceProperty__default['default'](calendarItems).call(calendarItems, function (item, index) {
288
+ }), _mapInstanceProperty__default["default"](calendarItems).call(calendarItems, function (item, index) {
289
289
  return jsxRuntime.jsx(calendarUtils.CalendarDay, _objectSpread(_objectSpread({
290
290
  isToday: calendarUtils.isSameDay(today, item)
291
291
  }, getItemProps({
@@ -317,8 +317,8 @@ DateInput.isEmpty = function (value) {
317
317
  DateInput.propTypes = {};
318
318
  var DateInput$1 = DateInput;
319
319
 
320
- // NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
321
- var version = '12.2.3';
320
+ // NOTE: This string will be replaced on build time with the package version.
321
+ var version = "12.2.7";
322
322
 
323
- exports['default'] = DateInput$1;
323
+ exports["default"] = DateInput$1;
324
324
  exports.version = version;
@@ -369,7 +369,7 @@ DateInput.propTypes = process.env.NODE_ENV !== "production" ? {
369
369
  } : {};
370
370
  var DateInput$1 = DateInput;
371
371
 
372
- // NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
373
- var version = '12.2.3';
372
+ // NOTE: This string will be replaced on build time with the package version.
373
+ var version = "12.2.7";
374
374
 
375
375
  export { DateInput$1 as default, version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/date-input",
3
3
  "description": "The `DateInput` component allows the user to select a date. It formats the selected date depending on the users' locale.",
4
- "version": "12.2.3",
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-input.cjs.js",
20
19
  "module": "dist/commercetools-uikit-date-input.esm.js",
21
20
  "files": ["dist"],
22
- "scripts": {
23
- "prepare": "../../../../scripts/version.js replace"
24
- },
25
21
  "dependencies": {
26
- "@babel/runtime": "7.14.8",
27
- "@babel/runtime-corejs3": "7.14.9",
28
- "@commercetools-uikit/accessible-button": "12.2.3",
29
- "@commercetools-uikit/calendar-utils": "12.2.3",
30
- "@commercetools-uikit/constraints": "12.2.3",
31
- "@commercetools-uikit/design-system": "12.2.3",
32
- "@commercetools-uikit/hooks": "12.2.3",
33
- "@commercetools-uikit/icons": "12.2.3",
34
- "@commercetools-uikit/secondary-icon-button": "12.2.3",
35
- "@commercetools-uikit/select-utils": "12.2.3",
36
- "@commercetools-uikit/spacings-inline": "12.2.3",
37
- "@commercetools-uikit/text": "12.2.3",
38
- "@commercetools-uikit/tooltip": "12.2.3",
39
- "@commercetools-uikit/utils": "12.2.0",
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.0",
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.20.7"
48
+ "react-intl": "5.21.2"
53
49
  },
54
50
  "peerDependencies": {
55
51
  "moment": "2.x",