@atlaskit/datetime-picker 14.0.4 → 14.1.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @atlaskit/datetime-picker
2
2
 
3
+ ## 14.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#142807](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/142807)
8
+ [`e4b42ed1ea941`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e4b42ed1ea941) -
9
+ These two props that were removed on 14.0.0 and no longer impacted the functionality of the
10
+ `DateTimePicker` were misrepresented in the type interface as options and have been fully removed
11
+ now.
12
+
13
+ - `timeIsEditable`
14
+ - `times`
15
+
16
+ We recommend running the codemod provided in major change 14.0.0. If you have already run this
17
+ once, it does not need to be run again.
18
+
19
+ ## 14.0.5
20
+
21
+ ### Patch Changes
22
+
23
+ - [#138676](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/138676)
24
+ [`9f9a53335523d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9f9a53335523d) -
25
+ Use parsed year instead of ISO year in internal `getParsedISO` function.
26
+
3
27
  ## 14.0.4
4
28
 
5
29
  ### Patch Changes
@@ -27,16 +27,16 @@ var _menu = require("../internal/menu");
27
27
  var _parseDate = require("../internal/parse-date");
28
28
  var _singleValue = require("../internal/single-value");
29
29
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
30
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
30
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
31
31
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
32
32
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
33
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
33
+ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
34
34
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
35
35
  * @jsxRuntime classic
36
36
  * @jsx jsx
37
37
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
38
38
  var packageName = "@atlaskit/datetime-picker";
39
- var packageVersion = "14.0.4";
39
+ var packageVersion = "14.1.0";
40
40
  var datePickerDefaultProps = {
41
41
  appearance: 'default',
42
42
  autoFocus: false,
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.timePickerDefaultAriaLabel = exports.default = exports.datePickerDefaultAriaLabel = exports.DateTimePickerWithoutAnalytics = void 0;
8
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
10
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
@@ -25,9 +24,7 @@ var _dateTimePickerContainer = require("../internal/date-time-picker-container")
25
24
  var _parseTokens = require("../internal/parse-tokens");
26
25
  var _datePicker = _interopRequireDefault(require("./date-picker"));
27
26
  var _timePicker = _interopRequireDefault(require("./time-picker"));
28
- var _excluded = ["selectProps"],
29
- _excluded2 = ["selectProps"];
30
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
27
+ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
31
28
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
32
29
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
33
30
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
@@ -35,7 +32,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
35
32
  * @jsx jsx
36
33
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
37
34
  var packageName = "@atlaskit/datetime-picker";
38
- var packageVersion = "14.0.4";
35
+ var packageVersion = "14.1.0";
39
36
  // Make DatePicker 50% the width of DateTimePicker
40
37
  // If rendering an icon container, shrink the TimePicker
41
38
  var datePickerContainerStyles = (0, _react2.css)({
@@ -81,27 +78,13 @@ var styles = {
81
78
  }
82
79
  };
83
80
  var dateTimePickerDefaultProps = {
84
- appearance: 'default',
85
- autoFocus: false,
86
- isDisabled: false,
87
- name: '',
88
81
  // These disables are here for proper typing when used as defaults. They
89
82
  // should *not* use the `noop` function.
90
83
  /* eslint-disable @repo/internal/react/use-noop */
91
84
  onBlur: function onBlur(_event) {},
92
85
  onChange: function onChange(_value) {},
93
- onFocus: function onFocus(_event) {},
86
+ onFocus: function onFocus(_event) {}
94
87
  /* eslint-enable @repo/internal/react/use-noop */
95
- innerProps: {},
96
- id: '',
97
- defaultValue: '',
98
- timeIsEditable: false,
99
- isInvalid: false,
100
- datePickerProps: {},
101
- timePickerProps: {},
102
- times: _internal.defaultTimes,
103
- spacing: 'default',
104
- locale: 'en-US'
105
88
  // Not including a default prop for value as it will
106
89
  // Make the component a controlled component
107
90
  };
@@ -121,7 +104,7 @@ var DateTimePickerComponent = exports.DateTimePickerWithoutAnalytics = /*#__PURE
121
104
  dateValue: '',
122
105
  isFocused: false,
123
106
  timeValue: '',
124
- value: _this.props.defaultValue,
107
+ value: _this.props.defaultValue || '',
125
108
  zoneValue: ''
126
109
  });
127
110
  // All state needs to be accessed via this function so that the state is mapped from props
@@ -134,16 +117,18 @@ var DateTimePickerComponent = exports.DateTimePickerWithoutAnalytics = /*#__PURE
134
117
  return (_this$props$value = _this.props.value) !== null && _this$props$value !== void 0 ? _this$props$value : _this.state.value;
135
118
  });
136
119
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onBlur", function (event) {
120
+ var _this$props$onBlur, _this$props;
137
121
  _this.setState({
138
122
  isFocused: false
139
123
  });
140
- _this.props.onBlur(event);
124
+ (_this$props$onBlur = (_this$props = _this.props).onBlur) === null || _this$props$onBlur === void 0 || _this$props$onBlur.call(_this$props, event);
141
125
  });
142
126
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onFocus", function (event) {
127
+ var _this$props$onFocus, _this$props2;
143
128
  _this.setState({
144
129
  isFocused: true
145
130
  });
146
- _this.props.onFocus(event);
131
+ (_this$props$onFocus = (_this$props2 = _this.props).onFocus) === null || _this$props$onFocus === void 0 || _this$props$onFocus.call(_this$props2, event);
147
132
  });
148
133
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onDateChange", function (dateValue) {
149
134
  var parsedValues = _this.getParsedValues();
@@ -211,6 +196,7 @@ var DateTimePickerComponent = exports.DateTimePickerWithoutAnalytics = /*#__PURE
211
196
  zoneValue: zoneValue
212
197
  });
213
198
  if (dateValue && timeValue) {
199
+ var _this$props$onChange, _this$props3;
214
200
  var value = (0, _internal.formatDateTimeZoneIntoIso)(dateValue, timeValue, zoneValue);
215
201
  var _this$parseValue = this.parseValue(value, dateValue, timeValue, zoneValue),
216
202
  parsedZone = _this$parseValue.zoneValue;
@@ -218,46 +204,56 @@ var DateTimePickerComponent = exports.DateTimePickerWithoutAnalytics = /*#__PURE
218
204
  this.setState({
219
205
  value: valueWithValidZone
220
206
  });
221
- this.props.onChange(valueWithValidZone);
207
+ (_this$props$onChange = (_this$props3 = this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props3, valueWithValidZone);
222
208
  // If the date or time value was cleared when there is an existing datetime value, then clear the value.
223
209
  } else if (this.getValue()) {
210
+ var _this$props$onChange2, _this$props4;
224
211
  this.setState({
225
212
  value: ''
226
213
  });
227
- this.props.onChange('');
214
+ (_this$props$onChange2 = (_this$props4 = this.props).onChange) === null || _this$props$onChange2 === void 0 || _this$props$onChange2.call(_this$props4, '');
228
215
  }
229
216
  }
230
217
  }, {
231
218
  key: "render",
232
219
  value: function render() {
233
- var _this$props = this.props,
234
- ariaDescribedBy = _this$props['aria-describedby'],
235
- appearance = _this$props.appearance,
236
- autoFocus = _this$props.autoFocus,
237
- datePickerPropsWithSelectProps = _this$props.datePickerProps,
238
- id = _this$props.id,
239
- innerProps = _this$props.innerProps,
240
- isDisabled = _this$props.isDisabled,
241
- isInvalid = _this$props.isInvalid,
242
- locale = _this$props.locale,
243
- name = _this$props.name,
244
- spacing = _this$props.spacing,
245
- testId = _this$props.testId,
246
- timePickerPropsWithSelectProps = _this$props.timePickerProps;
220
+ var _this$props5 = this.props,
221
+ ariaDescribedBy = _this$props5['aria-describedby'],
222
+ _this$props5$appearan = _this$props5.appearance,
223
+ appearance = _this$props5$appearan === void 0 ? 'default' : _this$props5$appearan,
224
+ _this$props5$autoFocu = _this$props5.autoFocus,
225
+ autoFocus = _this$props5$autoFocu === void 0 ? false : _this$props5$autoFocu,
226
+ _this$props5$datePick = _this$props5.datePickerProps,
227
+ datePickerProps = _this$props5$datePick === void 0 ? {} : _this$props5$datePick,
228
+ _this$props5$id = _this$props5.id,
229
+ id = _this$props5$id === void 0 ? '' : _this$props5$id,
230
+ _this$props5$innerPro = _this$props5.innerProps,
231
+ innerProps = _this$props5$innerPro === void 0 ? {} : _this$props5$innerPro,
232
+ _this$props5$isDisabl = _this$props5.isDisabled,
233
+ isDisabled = _this$props5$isDisabl === void 0 ? false : _this$props5$isDisabl,
234
+ _this$props5$isInvali = _this$props5.isInvalid,
235
+ isInvalid = _this$props5$isInvali === void 0 ? false : _this$props5$isInvali,
236
+ _this$props5$locale = _this$props5.locale,
237
+ locale = _this$props5$locale === void 0 ? 'en-US' : _this$props5$locale,
238
+ _this$props5$name = _this$props5.name,
239
+ name = _this$props5$name === void 0 ? '' : _this$props5$name,
240
+ _this$props5$spacing = _this$props5.spacing,
241
+ spacing = _this$props5$spacing === void 0 ? 'default' : _this$props5$spacing,
242
+ testId = _this$props5.testId,
243
+ _this$props5$timePick = _this$props5.timePickerProps,
244
+ timePickerProps = _this$props5$timePick === void 0 ? {} : _this$props5$timePick;
247
245
  var value = this.getValue();
248
246
  var isFocused = this.state.isFocused;
249
247
  var parsedValues = this.getParsedValues();
250
248
  var dateValue = parsedValues === null || parsedValues === void 0 ? void 0 : parsedValues.dateValue;
251
249
  var timeValue = parsedValues === null || parsedValues === void 0 ? void 0 : parsedValues.timeValue;
252
- var datePickerSelectProps = datePickerPropsWithSelectProps.selectProps,
253
- datePickerProps = (0, _objectWithoutProperties2.default)(datePickerPropsWithSelectProps, _excluded);
250
+ var datePickerSelectProps = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.selectProps;
254
251
  var datePickerAriaDescribedBy = datePickerProps['aria-describedby'] || ariaDescribedBy;
255
252
  var datePickerLabel = datePickerProps.label || datePickerDefaultAriaLabel;
256
253
  var mergedDatePickerSelectProps = _objectSpread(_objectSpread({}, datePickerSelectProps), {}, {
257
254
  styles: (0, _select.mergeStyles)(styles, datePickerSelectProps === null || datePickerSelectProps === void 0 ? void 0 : datePickerSelectProps.styles)
258
255
  });
259
- var timePickerSelectProps = timePickerPropsWithSelectProps.selectProps,
260
- timePickerProps = (0, _objectWithoutProperties2.default)(timePickerPropsWithSelectProps, _excluded2);
256
+ var timePickerSelectProps = timePickerProps === null || timePickerProps === void 0 ? void 0 : timePickerProps.selectProps;
261
257
  var timePickerAriaDescribedBy = timePickerProps['aria-describedby'] || ariaDescribedBy;
262
258
  var timePickerLabel = timePickerProps.label || timePickerDefaultAriaLabel;
263
259
  var mergedTimePickerSelectProps = _objectSpread(_objectSpread({}, timePickerSelectProps), {}, {
@@ -24,12 +24,12 @@ var _parseTokens = require("../internal/parse-tokens");
24
24
  var _singleValue = require("../internal/single-value");
25
25
  var _excluded = ["styles"];
26
26
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
27
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
27
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
28
28
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
29
29
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // eslint-disable-next-line no-restricted-imports
30
30
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
31
31
  var packageName = "@atlaskit/datetime-picker";
32
- var packageVersion = "14.0.4";
32
+ var packageVersion = "14.1.0";
33
33
  var menuStyles = {
34
34
  /* Need to remove default absolute positioning as that causes issues with position fixed */
35
35
  position: 'static',
@@ -45,9 +45,9 @@ var getParsedISO = exports.getParsedISO = function getParsedISO(di) {
45
45
  var lastDayInMonth = (0, _dateFns.lastDayOfMonth)(new Date(parsedYear, parsedMonth - 1) // This needs to be -1, because the Date constructor expects an index of the given month
46
46
  ).getDate();
47
47
  if (lastDayInMonth < parsedDate) {
48
- newIso = "".concat(year, "-").concat((0, _index.padToTwo)(parsedMonth), "-").concat((0, _index.padToTwo)(lastDayInMonth));
48
+ newIso = "".concat(parsedYear, "-").concat((0, _index.padToTwo)(parsedMonth), "-").concat((0, _index.padToTwo)(lastDayInMonth));
49
49
  } else {
50
- newIso = "".concat(year, "-").concat((0, _index.padToTwo)(parsedMonth), "-").concat((0, _index.padToTwo)(parsedDate));
50
+ newIso = "".concat(parsedYear, "-").concat((0, _index.padToTwo)(parsedMonth), "-").concat((0, _index.padToTwo)(parsedDate));
51
51
  }
52
52
  return newIso;
53
53
  };
@@ -19,7 +19,7 @@ var _popper = require("@atlaskit/popper");
19
19
  var _constants = require("@atlaskit/theme/constants");
20
20
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
21
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
22
+ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
23
23
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
24
24
  /**
25
25
  * This component renders layered content with fixed positioning.
@@ -19,7 +19,7 @@ import { Menu } from '../internal/menu';
19
19
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
20
20
  import { makeSingleValue } from '../internal/single-value';
21
21
  const packageName = "@atlaskit/datetime-picker";
22
- const packageVersion = "14.0.4";
22
+ const packageVersion = "14.1.0";
23
23
  const datePickerDefaultProps = {
24
24
  appearance: 'default',
25
25
  autoFocus: false,
@@ -12,13 +12,13 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
12
12
  import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
13
13
  import { mergeStyles } from '@atlaskit/select';
14
14
  import { N500, N70 } from '@atlaskit/theme/colors';
15
- import { defaultTimes, formatDateTimeZoneIntoIso } from '../internal';
15
+ import { formatDateTimeZoneIntoIso } from '../internal';
16
16
  import { DateTimePickerContainer } from '../internal/date-time-picker-container';
17
17
  import { convertTokens } from '../internal/parse-tokens';
18
18
  import DatePicker from './date-picker';
19
19
  import TimePicker from './time-picker';
20
20
  const packageName = "@atlaskit/datetime-picker";
21
- const packageVersion = "14.0.4";
21
+ const packageVersion = "14.1.0";
22
22
  // Make DatePicker 50% the width of DateTimePicker
23
23
  // If rendering an icon container, shrink the TimePicker
24
24
  const datePickerContainerStyles = css({
@@ -63,27 +63,13 @@ const styles = {
63
63
  })
64
64
  };
65
65
  const dateTimePickerDefaultProps = {
66
- appearance: 'default',
67
- autoFocus: false,
68
- isDisabled: false,
69
- name: '',
70
66
  // These disables are here for proper typing when used as defaults. They
71
67
  // should *not* use the `noop` function.
72
68
  /* eslint-disable @repo/internal/react/use-noop */
73
69
  onBlur: _event => {},
74
70
  onChange: _value => {},
75
- onFocus: _event => {},
71
+ onFocus: _event => {}
76
72
  /* eslint-enable @repo/internal/react/use-noop */
77
- innerProps: {},
78
- id: '',
79
- defaultValue: '',
80
- timeIsEditable: false,
81
- isInvalid: false,
82
- datePickerProps: {},
83
- timePickerProps: {},
84
- times: defaultTimes,
85
- spacing: 'default',
86
- locale: 'en-US'
87
73
  // Not including a default prop for value as it will
88
74
  // Make the component a controlled component
89
75
  };
@@ -96,7 +82,7 @@ class DateTimePickerComponent extends React.Component {
96
82
  dateValue: '',
97
83
  isFocused: false,
98
84
  timeValue: '',
99
- value: this.props.defaultValue,
85
+ value: this.props.defaultValue || '',
100
86
  zoneValue: ''
101
87
  });
102
88
  // All state needs to be accessed via this function so that the state is mapped from props
@@ -107,16 +93,18 @@ class DateTimePickerComponent extends React.Component {
107
93
  return (_this$props$value = this.props.value) !== null && _this$props$value !== void 0 ? _this$props$value : this.state.value;
108
94
  });
109
95
  _defineProperty(this, "onBlur", event => {
96
+ var _this$props$onBlur, _this$props;
110
97
  this.setState({
111
98
  isFocused: false
112
99
  });
113
- this.props.onBlur(event);
100
+ (_this$props$onBlur = (_this$props = this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props, event);
114
101
  });
115
102
  _defineProperty(this, "onFocus", event => {
103
+ var _this$props$onFocus, _this$props2;
116
104
  this.setState({
117
105
  isFocused: true
118
106
  });
119
- this.props.onFocus(event);
107
+ (_this$props$onFocus = (_this$props2 = this.props).onFocus) === null || _this$props$onFocus === void 0 ? void 0 : _this$props$onFocus.call(_this$props2, event);
120
108
  });
121
109
  _defineProperty(this, "onDateChange", dateValue => {
122
110
  const parsedValues = this.getParsedValues();
@@ -180,6 +168,7 @@ class DateTimePickerComponent extends React.Component {
180
168
  zoneValue
181
169
  });
182
170
  if (dateValue && timeValue) {
171
+ var _this$props$onChange, _this$props3;
183
172
  const value = formatDateTimeZoneIntoIso(dateValue, timeValue, zoneValue);
184
173
  const {
185
174
  zoneValue: parsedZone
@@ -188,30 +177,31 @@ class DateTimePickerComponent extends React.Component {
188
177
  this.setState({
189
178
  value: valueWithValidZone
190
179
  });
191
- this.props.onChange(valueWithValidZone);
180
+ (_this$props$onChange = (_this$props3 = this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props3, valueWithValidZone);
192
181
  // If the date or time value was cleared when there is an existing datetime value, then clear the value.
193
182
  } else if (this.getValue()) {
183
+ var _this$props$onChange2, _this$props4;
194
184
  this.setState({
195
185
  value: ''
196
186
  });
197
- this.props.onChange('');
187
+ (_this$props$onChange2 = (_this$props4 = this.props).onChange) === null || _this$props$onChange2 === void 0 ? void 0 : _this$props$onChange2.call(_this$props4, '');
198
188
  }
199
189
  }
200
190
  render() {
201
191
  const {
202
192
  'aria-describedby': ariaDescribedBy,
203
- appearance,
204
- autoFocus,
205
- datePickerProps: datePickerPropsWithSelectProps,
206
- id,
207
- innerProps,
208
- isDisabled,
209
- isInvalid,
210
- locale,
211
- name,
212
- spacing,
193
+ appearance = 'default',
194
+ autoFocus = false,
195
+ datePickerProps = {},
196
+ id = '',
197
+ innerProps = {},
198
+ isDisabled = false,
199
+ isInvalid = false,
200
+ locale = 'en-US',
201
+ name = '',
202
+ spacing = 'default',
213
203
  testId,
214
- timePickerProps: timePickerPropsWithSelectProps
204
+ timePickerProps = {}
215
205
  } = this.props;
216
206
  const value = this.getValue();
217
207
  const {
@@ -220,20 +210,14 @@ class DateTimePickerComponent extends React.Component {
220
210
  const parsedValues = this.getParsedValues();
221
211
  const dateValue = parsedValues === null || parsedValues === void 0 ? void 0 : parsedValues.dateValue;
222
212
  const timeValue = parsedValues === null || parsedValues === void 0 ? void 0 : parsedValues.timeValue;
223
- const {
224
- selectProps: datePickerSelectProps,
225
- ...datePickerProps
226
- } = datePickerPropsWithSelectProps;
213
+ const datePickerSelectProps = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.selectProps;
227
214
  const datePickerAriaDescribedBy = datePickerProps['aria-describedby'] || ariaDescribedBy;
228
215
  const datePickerLabel = datePickerProps.label || datePickerDefaultAriaLabel;
229
216
  const mergedDatePickerSelectProps = {
230
217
  ...datePickerSelectProps,
231
218
  styles: mergeStyles(styles, datePickerSelectProps === null || datePickerSelectProps === void 0 ? void 0 : datePickerSelectProps.styles)
232
219
  };
233
- const {
234
- selectProps: timePickerSelectProps,
235
- ...timePickerProps
236
- } = timePickerPropsWithSelectProps;
220
+ const timePickerSelectProps = timePickerProps === null || timePickerProps === void 0 ? void 0 : timePickerProps.selectProps;
237
221
  const timePickerAriaDescribedBy = timePickerProps['aria-describedby'] || ariaDescribedBy;
238
222
  const timePickerLabel = timePickerProps.label || timePickerDefaultAriaLabel;
239
223
  const mergedTimePickerSelectProps = {
@@ -15,7 +15,7 @@ import parseTime from '../internal/parse-time';
15
15
  import { convertTokens } from '../internal/parse-tokens';
16
16
  import { makeSingleValue } from '../internal/single-value';
17
17
  const packageName = "@atlaskit/datetime-picker";
18
- const packageVersion = "14.0.4";
18
+ const packageVersion = "14.1.0";
19
19
  const menuStyles = {
20
20
  /* Need to remove default absolute positioning as that causes issues with position fixed */
21
21
  position: 'static',
@@ -37,9 +37,9 @@ export const getParsedISO = di => {
37
37
  const lastDayInMonth = lastDayOfMonth(new Date(parsedYear, parsedMonth - 1) // This needs to be -1, because the Date constructor expects an index of the given month
38
38
  ).getDate();
39
39
  if (lastDayInMonth < parsedDate) {
40
- newIso = `${year}-${padToTwo(parsedMonth)}-${padToTwo(lastDayInMonth)}`;
40
+ newIso = `${parsedYear}-${padToTwo(parsedMonth)}-${padToTwo(lastDayInMonth)}`;
41
41
  } else {
42
- newIso = `${year}-${padToTwo(parsedMonth)}-${padToTwo(parsedDate)}`;
42
+ newIso = `${parsedYear}-${padToTwo(parsedMonth)}-${padToTwo(parsedDate)}`;
43
43
  }
44
44
  return newIso;
45
45
  };
@@ -8,7 +8,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10
10
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
+ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
12
12
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
13
  /**
14
14
  * @jsxRuntime classic
@@ -29,7 +29,7 @@ import { Menu } from '../internal/menu';
29
29
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
30
30
  import { makeSingleValue } from '../internal/single-value';
31
31
  var packageName = "@atlaskit/datetime-picker";
32
- var packageVersion = "14.0.4";
32
+ var packageVersion = "14.1.0";
33
33
  var datePickerDefaultProps = {
34
34
  appearance: 'default',
35
35
  autoFocus: false,
@@ -1,4 +1,3 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
2
  import _createClass from "@babel/runtime/helpers/createClass";
4
3
  import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
@@ -6,9 +5,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
6
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- var _excluded = ["selectProps"],
10
- _excluded2 = ["selectProps"];
11
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
+ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
12
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
10
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
11
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -25,13 +22,13 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
25
22
  import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
26
23
  import { mergeStyles } from '@atlaskit/select';
27
24
  import { N500, N70 } from '@atlaskit/theme/colors';
28
- import { defaultTimes, formatDateTimeZoneIntoIso } from '../internal';
25
+ import { formatDateTimeZoneIntoIso } from '../internal';
29
26
  import { DateTimePickerContainer } from '../internal/date-time-picker-container';
30
27
  import { convertTokens } from '../internal/parse-tokens';
31
28
  import DatePicker from './date-picker';
32
29
  import TimePicker from './time-picker';
33
30
  var packageName = "@atlaskit/datetime-picker";
34
- var packageVersion = "14.0.4";
31
+ var packageVersion = "14.1.0";
35
32
  // Make DatePicker 50% the width of DateTimePicker
36
33
  // If rendering an icon container, shrink the TimePicker
37
34
  var datePickerContainerStyles = css({
@@ -77,27 +74,13 @@ var styles = {
77
74
  }
78
75
  };
79
76
  var dateTimePickerDefaultProps = {
80
- appearance: 'default',
81
- autoFocus: false,
82
- isDisabled: false,
83
- name: '',
84
77
  // These disables are here for proper typing when used as defaults. They
85
78
  // should *not* use the `noop` function.
86
79
  /* eslint-disable @repo/internal/react/use-noop */
87
80
  onBlur: function onBlur(_event) {},
88
81
  onChange: function onChange(_value) {},
89
- onFocus: function onFocus(_event) {},
82
+ onFocus: function onFocus(_event) {}
90
83
  /* eslint-enable @repo/internal/react/use-noop */
91
- innerProps: {},
92
- id: '',
93
- defaultValue: '',
94
- timeIsEditable: false,
95
- isInvalid: false,
96
- datePickerProps: {},
97
- timePickerProps: {},
98
- times: defaultTimes,
99
- spacing: 'default',
100
- locale: 'en-US'
101
84
  // Not including a default prop for value as it will
102
85
  // Make the component a controlled component
103
86
  };
@@ -117,7 +100,7 @@ var DateTimePickerComponent = /*#__PURE__*/function (_React$Component) {
117
100
  dateValue: '',
118
101
  isFocused: false,
119
102
  timeValue: '',
120
- value: _this.props.defaultValue,
103
+ value: _this.props.defaultValue || '',
121
104
  zoneValue: ''
122
105
  });
123
106
  // All state needs to be accessed via this function so that the state is mapped from props
@@ -130,16 +113,18 @@ var DateTimePickerComponent = /*#__PURE__*/function (_React$Component) {
130
113
  return (_this$props$value = _this.props.value) !== null && _this$props$value !== void 0 ? _this$props$value : _this.state.value;
131
114
  });
132
115
  _defineProperty(_assertThisInitialized(_this), "onBlur", function (event) {
116
+ var _this$props$onBlur, _this$props;
133
117
  _this.setState({
134
118
  isFocused: false
135
119
  });
136
- _this.props.onBlur(event);
120
+ (_this$props$onBlur = (_this$props = _this.props).onBlur) === null || _this$props$onBlur === void 0 || _this$props$onBlur.call(_this$props, event);
137
121
  });
138
122
  _defineProperty(_assertThisInitialized(_this), "onFocus", function (event) {
123
+ var _this$props$onFocus, _this$props2;
139
124
  _this.setState({
140
125
  isFocused: true
141
126
  });
142
- _this.props.onFocus(event);
127
+ (_this$props$onFocus = (_this$props2 = _this.props).onFocus) === null || _this$props$onFocus === void 0 || _this$props$onFocus.call(_this$props2, event);
143
128
  });
144
129
  _defineProperty(_assertThisInitialized(_this), "onDateChange", function (dateValue) {
145
130
  var parsedValues = _this.getParsedValues();
@@ -207,6 +192,7 @@ var DateTimePickerComponent = /*#__PURE__*/function (_React$Component) {
207
192
  zoneValue: zoneValue
208
193
  });
209
194
  if (dateValue && timeValue) {
195
+ var _this$props$onChange, _this$props3;
210
196
  var value = formatDateTimeZoneIntoIso(dateValue, timeValue, zoneValue);
211
197
  var _this$parseValue = this.parseValue(value, dateValue, timeValue, zoneValue),
212
198
  parsedZone = _this$parseValue.zoneValue;
@@ -214,46 +200,56 @@ var DateTimePickerComponent = /*#__PURE__*/function (_React$Component) {
214
200
  this.setState({
215
201
  value: valueWithValidZone
216
202
  });
217
- this.props.onChange(valueWithValidZone);
203
+ (_this$props$onChange = (_this$props3 = this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props3, valueWithValidZone);
218
204
  // If the date or time value was cleared when there is an existing datetime value, then clear the value.
219
205
  } else if (this.getValue()) {
206
+ var _this$props$onChange2, _this$props4;
220
207
  this.setState({
221
208
  value: ''
222
209
  });
223
- this.props.onChange('');
210
+ (_this$props$onChange2 = (_this$props4 = this.props).onChange) === null || _this$props$onChange2 === void 0 || _this$props$onChange2.call(_this$props4, '');
224
211
  }
225
212
  }
226
213
  }, {
227
214
  key: "render",
228
215
  value: function render() {
229
- var _this$props = this.props,
230
- ariaDescribedBy = _this$props['aria-describedby'],
231
- appearance = _this$props.appearance,
232
- autoFocus = _this$props.autoFocus,
233
- datePickerPropsWithSelectProps = _this$props.datePickerProps,
234
- id = _this$props.id,
235
- innerProps = _this$props.innerProps,
236
- isDisabled = _this$props.isDisabled,
237
- isInvalid = _this$props.isInvalid,
238
- locale = _this$props.locale,
239
- name = _this$props.name,
240
- spacing = _this$props.spacing,
241
- testId = _this$props.testId,
242
- timePickerPropsWithSelectProps = _this$props.timePickerProps;
216
+ var _this$props5 = this.props,
217
+ ariaDescribedBy = _this$props5['aria-describedby'],
218
+ _this$props5$appearan = _this$props5.appearance,
219
+ appearance = _this$props5$appearan === void 0 ? 'default' : _this$props5$appearan,
220
+ _this$props5$autoFocu = _this$props5.autoFocus,
221
+ autoFocus = _this$props5$autoFocu === void 0 ? false : _this$props5$autoFocu,
222
+ _this$props5$datePick = _this$props5.datePickerProps,
223
+ datePickerProps = _this$props5$datePick === void 0 ? {} : _this$props5$datePick,
224
+ _this$props5$id = _this$props5.id,
225
+ id = _this$props5$id === void 0 ? '' : _this$props5$id,
226
+ _this$props5$innerPro = _this$props5.innerProps,
227
+ innerProps = _this$props5$innerPro === void 0 ? {} : _this$props5$innerPro,
228
+ _this$props5$isDisabl = _this$props5.isDisabled,
229
+ isDisabled = _this$props5$isDisabl === void 0 ? false : _this$props5$isDisabl,
230
+ _this$props5$isInvali = _this$props5.isInvalid,
231
+ isInvalid = _this$props5$isInvali === void 0 ? false : _this$props5$isInvali,
232
+ _this$props5$locale = _this$props5.locale,
233
+ locale = _this$props5$locale === void 0 ? 'en-US' : _this$props5$locale,
234
+ _this$props5$name = _this$props5.name,
235
+ name = _this$props5$name === void 0 ? '' : _this$props5$name,
236
+ _this$props5$spacing = _this$props5.spacing,
237
+ spacing = _this$props5$spacing === void 0 ? 'default' : _this$props5$spacing,
238
+ testId = _this$props5.testId,
239
+ _this$props5$timePick = _this$props5.timePickerProps,
240
+ timePickerProps = _this$props5$timePick === void 0 ? {} : _this$props5$timePick;
243
241
  var value = this.getValue();
244
242
  var isFocused = this.state.isFocused;
245
243
  var parsedValues = this.getParsedValues();
246
244
  var dateValue = parsedValues === null || parsedValues === void 0 ? void 0 : parsedValues.dateValue;
247
245
  var timeValue = parsedValues === null || parsedValues === void 0 ? void 0 : parsedValues.timeValue;
248
- var datePickerSelectProps = datePickerPropsWithSelectProps.selectProps,
249
- datePickerProps = _objectWithoutProperties(datePickerPropsWithSelectProps, _excluded);
246
+ var datePickerSelectProps = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.selectProps;
250
247
  var datePickerAriaDescribedBy = datePickerProps['aria-describedby'] || ariaDescribedBy;
251
248
  var datePickerLabel = datePickerProps.label || datePickerDefaultAriaLabel;
252
249
  var mergedDatePickerSelectProps = _objectSpread(_objectSpread({}, datePickerSelectProps), {}, {
253
250
  styles: mergeStyles(styles, datePickerSelectProps === null || datePickerSelectProps === void 0 ? void 0 : datePickerSelectProps.styles)
254
251
  });
255
- var timePickerSelectProps = timePickerPropsWithSelectProps.selectProps,
256
- timePickerProps = _objectWithoutProperties(timePickerPropsWithSelectProps, _excluded2);
252
+ var timePickerSelectProps = timePickerProps === null || timePickerProps === void 0 ? void 0 : timePickerProps.selectProps;
257
253
  var timePickerAriaDescribedBy = timePickerProps['aria-describedby'] || ariaDescribedBy;
258
254
  var timePickerLabel = timePickerProps.label || timePickerDefaultAriaLabel;
259
255
  var mergedTimePickerSelectProps = _objectSpread(_objectSpread({}, timePickerSelectProps), {}, {
@@ -21,7 +21,7 @@ import parseTime from '../internal/parse-time';
21
21
  import { convertTokens } from '../internal/parse-tokens';
22
22
  import { makeSingleValue } from '../internal/single-value';
23
23
  var packageName = "@atlaskit/datetime-picker";
24
- var packageVersion = "14.0.4";
24
+ var packageVersion = "14.1.0";
25
25
  var menuStyles = {
26
26
  /* Need to remove default absolute positioning as that causes issues with position fixed */
27
27
  position: 'static',
@@ -38,9 +38,9 @@ export var getParsedISO = function getParsedISO(di) {
38
38
  var lastDayInMonth = lastDayOfMonth(new Date(parsedYear, parsedMonth - 1) // This needs to be -1, because the Date constructor expects an index of the given month
39
39
  ).getDate();
40
40
  if (lastDayInMonth < parsedDate) {
41
- newIso = "".concat(year, "-").concat(padToTwo(parsedMonth), "-").concat(padToTwo(lastDayInMonth));
41
+ newIso = "".concat(parsedYear, "-").concat(padToTwo(parsedMonth), "-").concat(padToTwo(lastDayInMonth));
42
42
  } else {
43
- newIso = "".concat(year, "-").concat(padToTwo(parsedMonth), "-").concat(padToTwo(parsedDate));
43
+ newIso = "".concat(parsedYear, "-").concat(padToTwo(parsedMonth), "-").concat(padToTwo(parsedDate));
44
44
  }
45
45
  return newIso;
46
46
  };
@@ -7,7 +7,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
9
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
+ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
11
11
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
12
  import React from 'react';
13
13
  import noop from '@atlaskit/ds-lib/noop';
@@ -5,7 +5,6 @@
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import { type DateTimePickerBaseProps } from '../types';
8
- type DateTimePickerProps = typeof dateTimePickerDefaultProps & DateTimePickerBaseProps;
9
8
  interface State {
10
9
  dateValue: string;
11
10
  isFocused: boolean;
@@ -13,29 +12,10 @@ interface State {
13
12
  value: string;
14
13
  zoneValue: string;
15
14
  }
16
- declare const dateTimePickerDefaultProps: {
17
- appearance: NonNullable<import("../types").Appearance | undefined>;
18
- autoFocus: boolean;
19
- isDisabled: boolean;
20
- name: string;
21
- onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
22
- onChange: (_value: string) => void;
23
- onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
24
- innerProps: {};
25
- id: string;
26
- defaultValue: string;
27
- timeIsEditable: boolean;
28
- isInvalid: boolean;
29
- datePickerProps: {};
30
- timePickerProps: {};
31
- times: string[];
32
- spacing: NonNullable<import("../types").Spacing | undefined>;
33
- locale: string;
34
- };
35
15
  export declare const datePickerDefaultAriaLabel = "Date";
36
16
  export declare const timePickerDefaultAriaLabel = "Time";
37
- declare class DateTimePickerComponent extends React.Component<DateTimePickerProps, State> {
38
- static defaultProps: DateTimePickerProps;
17
+ declare class DateTimePickerComponent extends React.Component<DateTimePickerBaseProps, State> {
18
+ static defaultProps: DateTimePickerBaseProps;
39
19
  state: State;
40
20
  getParsedValues: () => {
41
21
  dateValue: string;
@@ -70,5 +50,5 @@ export { DateTimePickerComponent as DateTimePickerWithoutAnalytics };
70
50
  * - [Code](https://atlassian.design/components/datetime-picker/code)
71
51
  * - [Usage](https://atlassian.design/components/datetime-picker/usage)
72
52
  */
73
- declare const DateTimePicker: React.ForwardRefExoticComponent<Pick<Pick<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "parseValue">> & Partial<Pick<DateTimePickerProps, "ref" | "createAnalyticsEvent">>, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "parseValue"> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "parseValue"> & React.RefAttributes<any>>;
53
+ declare const DateTimePicker: React.ForwardRefExoticComponent<Pick<Pick<Pick<Omit<DateTimePickerBaseProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<DateTimePickerBaseProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "datePickerProps" | "timePickerProps" | "parseValue">> & Partial<Pick<DateTimePickerBaseProps, "ref" | "createAnalyticsEvent">>, "testId" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "datePickerProps" | "timePickerProps" | "parseValue"> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "appearance" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "datePickerProps" | "timePickerProps" | "parseValue"> & React.RefAttributes<any>>;
74
54
  export default DateTimePicker;
@@ -5,7 +5,6 @@
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import { type DateTimePickerBaseProps } from '../types';
8
- type DateTimePickerProps = typeof dateTimePickerDefaultProps & DateTimePickerBaseProps;
9
8
  interface State {
10
9
  dateValue: string;
11
10
  isFocused: boolean;
@@ -13,29 +12,10 @@ interface State {
13
12
  value: string;
14
13
  zoneValue: string;
15
14
  }
16
- declare const dateTimePickerDefaultProps: {
17
- appearance: NonNullable<import("../types").Appearance | undefined>;
18
- autoFocus: boolean;
19
- isDisabled: boolean;
20
- name: string;
21
- onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
22
- onChange: (_value: string) => void;
23
- onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
24
- innerProps: {};
25
- id: string;
26
- defaultValue: string;
27
- timeIsEditable: boolean;
28
- isInvalid: boolean;
29
- datePickerProps: {};
30
- timePickerProps: {};
31
- times: string[];
32
- spacing: NonNullable<import("../types").Spacing | undefined>;
33
- locale: string;
34
- };
35
15
  export declare const datePickerDefaultAriaLabel = "Date";
36
16
  export declare const timePickerDefaultAriaLabel = "Time";
37
- declare class DateTimePickerComponent extends React.Component<DateTimePickerProps, State> {
38
- static defaultProps: DateTimePickerProps;
17
+ declare class DateTimePickerComponent extends React.Component<DateTimePickerBaseProps, State> {
18
+ static defaultProps: DateTimePickerBaseProps;
39
19
  state: State;
40
20
  getParsedValues: () => {
41
21
  dateValue: string;
@@ -70,5 +50,5 @@ export { DateTimePickerComponent as DateTimePickerWithoutAnalytics };
70
50
  * - [Code](https://atlassian.design/components/datetime-picker/code)
71
51
  * - [Usage](https://atlassian.design/components/datetime-picker/usage)
72
52
  */
73
- declare const DateTimePicker: React.ForwardRefExoticComponent<Pick<Pick<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "parseValue">> & Partial<Pick<DateTimePickerProps, "ref" | "createAnalyticsEvent">>, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "parseValue"> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "parseValue"> & React.RefAttributes<any>>;
53
+ declare const DateTimePicker: React.ForwardRefExoticComponent<Pick<Pick<Pick<Omit<DateTimePickerBaseProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<DateTimePickerBaseProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "datePickerProps" | "timePickerProps" | "parseValue">> & Partial<Pick<DateTimePickerBaseProps, "ref" | "createAnalyticsEvent">>, "testId" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "datePickerProps" | "timePickerProps" | "parseValue"> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "appearance" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "datePickerProps" | "timePickerProps" | "parseValue"> & React.RefAttributes<any>>;
74
54
  export default DateTimePicker;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "14.0.4",
3
+ "version": "14.1.0",
4
4
  "description": "A date time picker allows the user to select an associated date and time.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -38,13 +38,13 @@
38
38
  "@atlaskit/analytics-next": "^10.1.0",
39
39
  "@atlaskit/calendar": "^15.0.0",
40
40
  "@atlaskit/ds-lib": "^2.5.0",
41
- "@atlaskit/icon": "^22.16.0",
41
+ "@atlaskit/icon": "^22.18.0",
42
42
  "@atlaskit/layering": "^0.4.0",
43
43
  "@atlaskit/locale": "^2.8.0",
44
44
  "@atlaskit/popper": "^6.3.0",
45
- "@atlaskit/select": "^17.15.0",
45
+ "@atlaskit/select": "^17.19.0",
46
46
  "@atlaskit/theme": "^13.0.0",
47
- "@atlaskit/tokens": "^1.59.0",
47
+ "@atlaskit/tokens": "^1.60.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@emotion/react": "^11.7.1",
50
50
  "date-fns": "^2.17.0"
@@ -60,8 +60,8 @@
60
60
  "@atlaskit/codemod-utils": "4.2.4",
61
61
  "@atlaskit/docs": "*",
62
62
  "@atlaskit/form": "^10.5.0",
63
- "@atlaskit/modal-dialog": "^12.15.0",
64
- "@atlaskit/popup": "^1.25.0",
63
+ "@atlaskit/modal-dialog": "^12.16.0",
64
+ "@atlaskit/popup": "^1.26.0",
65
65
  "@atlaskit/range": "^7.4.0",
66
66
  "@atlaskit/section-message": "^6.6.0",
67
67
  "@atlaskit/ssr": "*",