@commercetools-uikit/date-time-input 15.0.0 → 15.0.2
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.
|
@@ -76,19 +76,6 @@ DateCalendarTimeInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
76
76
|
DateCalendarTimeInput.displayName = 'DateCalendarTimeInput';
|
|
77
77
|
var TimeInput = DateCalendarTimeInput;
|
|
78
78
|
|
|
79
|
-
var messages = reactIntl.defineMessages({
|
|
80
|
-
placeholder: {
|
|
81
|
-
id: 'UIKit.DateTimeInput.placeholder',
|
|
82
|
-
description: 'Placeholder for date time input',
|
|
83
|
-
defaultMessage: 'MM/DD/YYYY - HH:mm AM/PM'
|
|
84
|
-
},
|
|
85
|
-
timePlaceholder: {
|
|
86
|
-
id: 'UIKit.DateTimeInput.timePlaceholder',
|
|
87
|
-
description: 'Placeholder for time input at bottom of date-time-input',
|
|
88
|
-
defaultMessage: 'HH:mm AM/PM'
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
|
|
92
79
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); 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; }
|
|
93
80
|
|
|
94
81
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
@@ -326,7 +313,7 @@ var DateTimeInput = /*#__PURE__*/function (_Component) {
|
|
|
326
313
|
// between the <label for> and the <input id>.
|
|
327
314
|
'aria-labelledby': undefined,
|
|
328
315
|
name: _this2.props.name,
|
|
329
|
-
placeholder: typeof _this2.props.placeholder === 'string' ? _this2.props.placeholder : _this2.props.intl.
|
|
316
|
+
placeholder: typeof _this2.props.placeholder === 'string' ? _this2.props.placeholder : calendarTimeUtils.getLocalizedDateTimeFormatPattern(_this2.props.intl.locale, 'full'),
|
|
330
317
|
onMouseEnter: function onMouseEnter() {
|
|
331
318
|
// we remove the highlight so that the user can use the
|
|
332
319
|
// arrow keys to move the cursor when hovering
|
|
@@ -460,7 +447,7 @@ var DateTimeInput = /*#__PURE__*/function (_Component) {
|
|
|
460
447
|
}), jsxRuntime.jsx(TimeInput, {
|
|
461
448
|
isDisabled: !isTimeInputVisible,
|
|
462
449
|
timeInputRef: _this2.timeInputRef,
|
|
463
|
-
placeholder: _this2.props.intl.
|
|
450
|
+
placeholder: calendarTimeUtils.getLocalizedDateTimeFormatPattern(_this2.props.intl.locale, 'time'),
|
|
464
451
|
value: _this2.state.timeString,
|
|
465
452
|
onChange: _this2.handleTimeChange,
|
|
466
453
|
onKeyDown: function onKeyDown(event) {
|
|
@@ -514,7 +501,7 @@ DateTimeInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
514
501
|
var dateTimeInput = reactIntl.injectIntl(DateTimeInput);
|
|
515
502
|
|
|
516
503
|
// NOTE: This string will be replaced on build time with the package version.
|
|
517
|
-
var version = "15.0.
|
|
504
|
+
var version = "15.0.2";
|
|
518
505
|
|
|
519
506
|
exports["default"] = dateTimeInput;
|
|
520
507
|
exports.version = version;
|
|
@@ -72,19 +72,6 @@ DateCalendarTimeInput.propTypes = {};
|
|
|
72
72
|
DateCalendarTimeInput.displayName = 'DateCalendarTimeInput';
|
|
73
73
|
var TimeInput = DateCalendarTimeInput;
|
|
74
74
|
|
|
75
|
-
var messages = reactIntl.defineMessages({
|
|
76
|
-
placeholder: {
|
|
77
|
-
id: 'UIKit.DateTimeInput.placeholder',
|
|
78
|
-
description: 'Placeholder for date time input',
|
|
79
|
-
defaultMessage: 'MM/DD/YYYY - HH:mm AM/PM'
|
|
80
|
-
},
|
|
81
|
-
timePlaceholder: {
|
|
82
|
-
id: 'UIKit.DateTimeInput.timePlaceholder',
|
|
83
|
-
description: 'Placeholder for time input at bottom of date-time-input',
|
|
84
|
-
defaultMessage: 'HH:mm AM/PM'
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
75
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); 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; }
|
|
89
76
|
|
|
90
77
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
@@ -320,7 +307,7 @@ var DateTimeInput = /*#__PURE__*/function (_Component) {
|
|
|
320
307
|
// between the <label for> and the <input id>.
|
|
321
308
|
'aria-labelledby': undefined,
|
|
322
309
|
name: _this2.props.name,
|
|
323
|
-
placeholder: typeof _this2.props.placeholder === 'string' ? _this2.props.placeholder : _this2.props.intl.
|
|
310
|
+
placeholder: typeof _this2.props.placeholder === 'string' ? _this2.props.placeholder : calendarTimeUtils.getLocalizedDateTimeFormatPattern(_this2.props.intl.locale, 'full'),
|
|
324
311
|
onMouseEnter: function onMouseEnter() {
|
|
325
312
|
// we remove the highlight so that the user can use the
|
|
326
313
|
// arrow keys to move the cursor when hovering
|
|
@@ -454,7 +441,7 @@ var DateTimeInput = /*#__PURE__*/function (_Component) {
|
|
|
454
441
|
}), jsxRuntime.jsx(TimeInput, {
|
|
455
442
|
isDisabled: !isTimeInputVisible,
|
|
456
443
|
timeInputRef: _this2.timeInputRef,
|
|
457
|
-
placeholder: _this2.props.intl.
|
|
444
|
+
placeholder: calendarTimeUtils.getLocalizedDateTimeFormatPattern(_this2.props.intl.locale, 'time'),
|
|
458
445
|
value: _this2.state.timeString,
|
|
459
446
|
onChange: _this2.handleTimeChange,
|
|
460
447
|
onKeyDown: function onKeyDown(event) {
|
|
@@ -492,7 +479,7 @@ DateTimeInput.propTypes = {};
|
|
|
492
479
|
var dateTimeInput = reactIntl.injectIntl(DateTimeInput);
|
|
493
480
|
|
|
494
481
|
// NOTE: This string will be replaced on build time with the package version.
|
|
495
|
-
var version = "15.0.
|
|
482
|
+
var version = "15.0.2";
|
|
496
483
|
|
|
497
484
|
exports["default"] = dateTimeInput;
|
|
498
485
|
exports.version = version;
|
|
@@ -20,10 +20,10 @@ import _fillInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instanc
|
|
|
20
20
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
21
21
|
import { createRef, Component } from 'react';
|
|
22
22
|
import Downshift from 'downshift';
|
|
23
|
-
import {
|
|
23
|
+
import { injectIntl } from 'react-intl';
|
|
24
24
|
import Constraints from '@commercetools-uikit/constraints';
|
|
25
25
|
import { parseTime, warning, filterDataAttributes } from '@commercetools-uikit/utils';
|
|
26
|
-
import { getToday, getDateInMonth, changeMonth, getStartOf, changeTime, createItemDateTimeToString, formatTime, createSuggestedItems, createCalendarItems, getPaddingDayCount, getWeekdayNames, parseInputText, getPreviousDay, getDaysInMonth, getMonthCalendarLabel, getYearCalendarLabel, isSameDay, getCalendarDayLabel } from '@commercetools-uikit/calendar-time-utils';
|
|
26
|
+
import { getToday, getDateInMonth, changeMonth, getStartOf, changeTime, createItemDateTimeToString, formatTime, createSuggestedItems, createCalendarItems, getPaddingDayCount, getWeekdayNames, getLocalizedDateTimeFormatPattern, parseInputText, getPreviousDay, getDaysInMonth, getMonthCalendarLabel, getYearCalendarLabel, isSameDay, getCalendarDayLabel } from '@commercetools-uikit/calendar-time-utils';
|
|
27
27
|
import { CalendarBody, CalendarMenu, CalendarHeader, CalendarContent, CalendarDay } from '@commercetools-uikit/calendar-utils';
|
|
28
28
|
import { css } from '@emotion/react';
|
|
29
29
|
import { customProperties } from '@commercetools-uikit/design-system';
|
|
@@ -53,19 +53,6 @@ DateCalendarTimeInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
53
53
|
DateCalendarTimeInput.displayName = 'DateCalendarTimeInput';
|
|
54
54
|
var TimeInput = DateCalendarTimeInput;
|
|
55
55
|
|
|
56
|
-
var messages = defineMessages({
|
|
57
|
-
placeholder: {
|
|
58
|
-
id: 'UIKit.DateTimeInput.placeholder',
|
|
59
|
-
description: 'Placeholder for date time input',
|
|
60
|
-
defaultMessage: 'MM/DD/YYYY - HH:mm AM/PM'
|
|
61
|
-
},
|
|
62
|
-
timePlaceholder: {
|
|
63
|
-
id: 'UIKit.DateTimeInput.timePlaceholder',
|
|
64
|
-
description: 'Placeholder for time input at bottom of date-time-input',
|
|
65
|
-
defaultMessage: 'HH:mm AM/PM'
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
|
|
69
56
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
70
57
|
|
|
71
58
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -303,7 +290,7 @@ var DateTimeInput = /*#__PURE__*/function (_Component) {
|
|
|
303
290
|
// between the <label for> and the <input id>.
|
|
304
291
|
'aria-labelledby': undefined,
|
|
305
292
|
name: _this2.props.name,
|
|
306
|
-
placeholder: typeof _this2.props.placeholder === 'string' ? _this2.props.placeholder : _this2.props.intl.
|
|
293
|
+
placeholder: typeof _this2.props.placeholder === 'string' ? _this2.props.placeholder : getLocalizedDateTimeFormatPattern(_this2.props.intl.locale, 'full'),
|
|
307
294
|
onMouseEnter: function onMouseEnter() {
|
|
308
295
|
// we remove the highlight so that the user can use the
|
|
309
296
|
// arrow keys to move the cursor when hovering
|
|
@@ -437,7 +424,7 @@ var DateTimeInput = /*#__PURE__*/function (_Component) {
|
|
|
437
424
|
}), jsx(TimeInput, {
|
|
438
425
|
isDisabled: !isTimeInputVisible,
|
|
439
426
|
timeInputRef: _this2.timeInputRef,
|
|
440
|
-
placeholder: _this2.props.intl.
|
|
427
|
+
placeholder: getLocalizedDateTimeFormatPattern(_this2.props.intl.locale, 'time'),
|
|
441
428
|
value: _this2.state.timeString,
|
|
442
429
|
onChange: _this2.handleTimeChange,
|
|
443
430
|
onKeyDown: function onKeyDown(event) {
|
|
@@ -491,6 +478,6 @@ DateTimeInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
491
478
|
var dateTimeInput = injectIntl(DateTimeInput);
|
|
492
479
|
|
|
493
480
|
// NOTE: This string will be replaced on build time with the package version.
|
|
494
|
-
var version = "15.0.
|
|
481
|
+
var version = "15.0.2";
|
|
495
482
|
|
|
496
483
|
export { dateTimeInput as default, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/date-time-input",
|
|
3
3
|
"description": "The `DateTimeInput` component allows the user to select a date. This component also supports multiple date selection.",
|
|
4
|
-
"version": "15.0.
|
|
4
|
+
"version": "15.0.2",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@babel/runtime": "^7.17.2",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.17.2",
|
|
24
24
|
"@commercetools-uikit/accessible-button": "15.0.0",
|
|
25
|
-
"@commercetools-uikit/calendar-time-utils": "15.0.
|
|
25
|
+
"@commercetools-uikit/calendar-time-utils": "15.0.2",
|
|
26
26
|
"@commercetools-uikit/calendar-utils": "15.0.0",
|
|
27
27
|
"@commercetools-uikit/constraints": "15.0.0",
|
|
28
28
|
"@commercetools-uikit/design-system": "15.0.0",
|