@atlaskit/datetime-picker 12.3.11 → 12.3.12

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,12 @@
1
1
  # @atlaskit/datetime-picker
2
2
 
3
+ ## 12.3.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY remove before merging to master; dupe adf-schema via adf-utils
8
+ - [`e754545d460`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e754545d460) - [ux] Ensure no duplicate ID's when using `selectProps` on any of the DateTime Picker components.
9
+
3
10
  ## 12.3.11
4
11
 
5
12
  ### Patch Changes
@@ -34,9 +34,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
34
34
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
35
35
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
36
36
  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); }; }
37
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
37
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable @repo/internal/react/use-noop */ /** @jsx jsx */ // eslint-disable-next-line no-restricted-imports
38
38
  var packageName = "@atlaskit/datetime-picker";
39
- var packageVersion = "12.3.11";
39
+ var packageVersion = "12.3.12";
40
40
 
41
41
  /* eslint-disable react/no-unused-prop-types */
42
42
 
@@ -388,6 +388,19 @@ var DatePicker = /*#__PURE__*/function (_Component) {
388
388
 
389
389
  // All state needs to be accessed via this function so that the state is mapped from props
390
390
  // correctly to allow controlled/uncontrolled usage.
391
+ /**
392
+ * There are two props that can change how the date is parsed.
393
+ * The priority of props used is:
394
+ * 1. parseInputValue
395
+ * 2. locale
396
+ */
397
+ /**
398
+ * There are multiple props that can change how the date is formatted.
399
+ * The priority of props used is:
400
+ * 1. formatDisplayLabel
401
+ * 2. dateFormat
402
+ * 3. locale
403
+ */
391
404
  }, {
392
405
  key: "render",
393
406
  value: function render() {
@@ -457,7 +470,6 @@ var DatePicker = /*#__PURE__*/function (_Component) {
457
470
  ref: this.getContainerRef,
458
471
  "data-testid": testId && "".concat(testId, "--container")
459
472
  }), (0, _react2.jsx)("input", {
460
- id: selectProps.inputId,
461
473
  name: name,
462
474
  type: "hidden",
463
475
  value: value,
@@ -29,9 +29,9 @@ var _utils = require("./utils");
29
29
  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); }; }
30
30
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
31
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
32
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
32
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } /* eslint-disable @repo/internal/react/use-noop */ /** @jsx jsx */ // eslint-disable-next-line no-restricted-imports
33
33
  var packageName = "@atlaskit/datetime-picker";
34
- var packageVersion = "12.3.11";
34
+ var packageVersion = "12.3.12";
35
35
 
36
36
  /* eslint-disable react/no-unused-prop-types */
37
37
 
@@ -206,7 +206,8 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
206
206
  }));
207
207
  });
208
208
  return _this;
209
- }
209
+ } // All state needs to be accessed via this function so that the state is mapped from props
210
+ // correctly to allow controlled/uncontrolled usage.
210
211
  (0, _createClass2.default)(DateTimePicker, [{
211
212
  key: "parseValue",
212
213
  value: function parseValue(value, dateValue, timeValue, zoneValue) {
@@ -299,16 +300,15 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
299
300
  // Don't use Date or TimePicker's because they can't be customised
300
301
  var isClearable = Boolean(dateValue || timeValue);
301
302
  var notFocusedOrIsDisabled = !(isFocused || isDisabled);
302
- var labelId = (datePickerSelectProps === null || datePickerSelectProps === void 0 ? void 0 : datePickerSelectProps.inputId) || (timePickerSelectProps === null || timePickerSelectProps === void 0 ? void 0 : timePickerSelectProps.inputId) || '';
303
303
  return (0, _react2.jsx)("div", (0, _extends2.default)({
304
304
  css: [baseContainerStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, bothProps.appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, bothProps.isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (bothProps.isInvalid ? isInvalidHoverStyles : hoverStyles), bothProps.appearance === 'none' && noBgStyles]
305
305
  }, innerProps, {
306
306
  "data-testid": testId
307
307
  }), (0, _react2.jsx)("input", {
308
- id: labelId,
309
308
  name: name,
310
309
  type: "hidden",
311
- value: value
310
+ value: value,
311
+ "data-testid": testId && "".concat(testId, "--input")
312
312
  }), (0, _react2.jsx)("div", {
313
313
  css: datePickerContainerStyles
314
314
  }, (0, _react2.jsx)(_datePicker.default, (0, _extends2.default)({}, bothProps, {
@@ -28,6 +28,9 @@ var _parseTime = _interopRequireDefault(require("../internal/parse-time"));
28
28
  var _utils = require("./utils");
29
29
  var _excluded = ["selectProps"],
30
30
  _excluded2 = ["styles"];
31
+ /* eslint-disable @repo/internal/react/use-noop */
32
+ // eslint-disable-next-line no-restricted-imports
33
+ // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
31
34
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
32
35
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
33
36
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -35,7 +38,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
35
38
  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); }; }
36
39
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
37
40
  var packageName = "@atlaskit/datetime-picker";
38
- var packageVersion = "12.3.11";
41
+ var packageVersion = "12.3.12";
42
+
43
+ /* eslint-disable react/no-unused-prop-types */
44
+
39
45
  var menuStyles = {
40
46
  /* Need to remove default absolute positioning as that causes issues with position fixed */
41
47
  position: 'static',
@@ -247,6 +253,18 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
247
253
  };
248
254
  });
249
255
  }
256
+
257
+ /**
258
+ * Only allow custom times if timeIsEditable prop is true
259
+ */
260
+
261
+ /**
262
+ * There are multiple props that can change how the time is formatted.
263
+ * The priority of props used is:
264
+ * 1. formatDisplayLabel
265
+ * 2. timeFormat
266
+ * 3. locale
267
+ */
250
268
  }, {
251
269
  key: "render",
252
270
  value: function render() {
@@ -309,10 +327,10 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
309
327
  "data-testid": testId && "".concat(testId, "--container"),
310
328
  onKeyDown: this.onSelectKeyDown
311
329
  }), /*#__PURE__*/_react.default.createElement("input", {
312
- id: selectProps.inputId,
313
330
  name: name,
314
331
  type: "hidden",
315
- value: value
332
+ value: value,
333
+ "data-testid": testId && "".concat(testId, "--input")
316
334
  }), /*#__PURE__*/_react.default.createElement(SelectComponent, (0, _extends2.default)({
317
335
  appearance: this.props.appearance,
318
336
  autoFocus: autoFocus,
@@ -21,7 +21,7 @@ var _constants = require("@atlaskit/theme/constants");
21
21
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
22
22
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
23
  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); }; }
24
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
24
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
25
25
  /**
26
26
  * This component renders layered content with fixed positioning.
27
27
  * Scroll is locked outside the layer to prevent the layered content from detaching from the
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "12.3.11",
3
+ "version": "12.3.12",
4
4
  "sideEffects": false
5
5
  }
@@ -18,7 +18,7 @@ import { defaultDateFormat, EmptyComponent, padToTwo, placeholderDatetime } from
18
18
  import FixedLayer from '../internal/fixed-layer';
19
19
  import { convertTokens } from './utils';
20
20
  const packageName = "@atlaskit/datetime-picker";
21
- const packageVersion = "12.3.11";
21
+ const packageVersion = "12.3.12";
22
22
 
23
23
  /* eslint-disable react/no-unused-prop-types */
24
24
 
@@ -376,7 +376,19 @@ class DatePicker extends Component {
376
376
 
377
377
  // All state needs to be accessed via this function so that the state is mapped from props
378
378
  // correctly to allow controlled/uncontrolled usage.
379
-
379
+ /**
380
+ * There are two props that can change how the date is parsed.
381
+ * The priority of props used is:
382
+ * 1. parseInputValue
383
+ * 2. locale
384
+ */
385
+ /**
386
+ * There are multiple props that can change how the date is formatted.
387
+ * The priority of props used is:
388
+ * 1. formatDisplayLabel
389
+ * 2. dateFormat
390
+ * 3. locale
391
+ */
380
392
  render() {
381
393
  const {
382
394
  appearance,
@@ -448,7 +460,6 @@ class DatePicker extends Component {
448
460
  ref: this.getContainerRef,
449
461
  "data-testid": testId && `${testId}--container`
450
462
  }), jsx("input", {
451
- id: selectProps.inputId,
452
463
  name: name,
453
464
  type: "hidden",
454
465
  value: value,
@@ -17,7 +17,7 @@ import DatePicker from './date-picker';
17
17
  import TimePicker from './time-picker';
18
18
  import { convertTokens } from './utils';
19
19
  const packageName = "@atlaskit/datetime-picker";
20
- const packageVersion = "12.3.11";
20
+ const packageVersion = "12.3.12";
21
21
 
22
22
  /* eslint-disable react/no-unused-prop-types */
23
23
 
@@ -193,7 +193,8 @@ class DateTimePicker extends React.Component {
193
193
  dateValue: ''
194
194
  });
195
195
  });
196
- }
196
+ } // All state needs to be accessed via this function so that the state is mapped from props
197
+ // correctly to allow controlled/uncontrolled usage.
197
198
  parseValue(value, dateValue, timeValue, zoneValue) {
198
199
  if (this.props.parseValue) {
199
200
  return this.props.parseValue(value, dateValue, timeValue, zoneValue);
@@ -288,16 +289,15 @@ class DateTimePicker extends React.Component {
288
289
  // Don't use Date or TimePicker's because they can't be customised
289
290
  const isClearable = Boolean(dateValue || timeValue);
290
291
  const notFocusedOrIsDisabled = !(isFocused || isDisabled);
291
- const labelId = (datePickerSelectProps === null || datePickerSelectProps === void 0 ? void 0 : datePickerSelectProps.inputId) || (timePickerSelectProps === null || timePickerSelectProps === void 0 ? void 0 : timePickerSelectProps.inputId) || '';
292
292
  return jsx("div", _extends({
293
293
  css: [baseContainerStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, bothProps.appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, bothProps.isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (bothProps.isInvalid ? isInvalidHoverStyles : hoverStyles), bothProps.appearance === 'none' && noBgStyles]
294
294
  }, innerProps, {
295
295
  "data-testid": testId
296
296
  }), jsx("input", {
297
- id: labelId,
298
297
  name: name,
299
298
  type: "hidden",
300
- value: value
299
+ value: value,
300
+ "data-testid": testId && `${testId}--input`
301
301
  }), jsx("div", {
302
302
  css: datePickerContainerStyles
303
303
  }, jsx(DatePicker, _extends({}, bothProps, {
@@ -16,7 +16,10 @@ import FixedLayer from '../internal/fixed-layer';
16
16
  import parseTime from '../internal/parse-time';
17
17
  import { convertTokens } from './utils';
18
18
  const packageName = "@atlaskit/datetime-picker";
19
- const packageVersion = "12.3.11";
19
+ const packageVersion = "12.3.12";
20
+
21
+ /* eslint-disable react/no-unused-prop-types */
22
+
20
23
  const menuStyles = {
21
24
  /* Need to remove default absolute positioning as that causes issues with position fixed */
22
25
  position: 'static',
@@ -217,7 +220,6 @@ class TimePicker extends React.Component {
217
220
 
218
221
  // All state needs to be accessed via this function so that the state is mapped from props
219
222
  // correctly to allow controlled/uncontrolled usage.
220
-
221
223
  getOptions() {
222
224
  return this.props.times.map(time => {
223
225
  return {
@@ -226,6 +228,19 @@ class TimePicker extends React.Component {
226
228
  };
227
229
  });
228
230
  }
231
+
232
+ /**
233
+ * Only allow custom times if timeIsEditable prop is true
234
+ */
235
+
236
+ /**
237
+ * There are multiple props that can change how the time is formatted.
238
+ * The priority of props used is:
239
+ * 1. formatDisplayLabel
240
+ * 2. timeFormat
241
+ * 3. locale
242
+ */
243
+
229
244
  render() {
230
245
  const {
231
246
  autoFocus,
@@ -287,10 +302,10 @@ class TimePicker extends React.Component {
287
302
  "data-testid": testId && `${testId}--container`,
288
303
  onKeyDown: this.onSelectKeyDown
289
304
  }), /*#__PURE__*/React.createElement("input", {
290
- id: selectProps.inputId,
291
305
  name: name,
292
306
  type: "hidden",
293
- value: value
307
+ value: value,
308
+ "data-testid": testId && `${testId}--input`
294
309
  }), /*#__PURE__*/React.createElement(SelectComponent, _extends({
295
310
  appearance: this.props.appearance,
296
311
  autoFocus: autoFocus,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "12.3.11",
3
+ "version": "12.3.12",
4
4
  "sideEffects": false
5
5
  }
@@ -29,7 +29,7 @@ import { defaultDateFormat, EmptyComponent, padToTwo, placeholderDatetime } from
29
29
  import FixedLayer from '../internal/fixed-layer';
30
30
  import { convertTokens } from './utils';
31
31
  var packageName = "@atlaskit/datetime-picker";
32
- var packageVersion = "12.3.11";
32
+ var packageVersion = "12.3.12";
33
33
 
34
34
  /* eslint-disable react/no-unused-prop-types */
35
35
 
@@ -381,6 +381,19 @@ var DatePicker = /*#__PURE__*/function (_Component) {
381
381
 
382
382
  // All state needs to be accessed via this function so that the state is mapped from props
383
383
  // correctly to allow controlled/uncontrolled usage.
384
+ /**
385
+ * There are two props that can change how the date is parsed.
386
+ * The priority of props used is:
387
+ * 1. parseInputValue
388
+ * 2. locale
389
+ */
390
+ /**
391
+ * There are multiple props that can change how the date is formatted.
392
+ * The priority of props used is:
393
+ * 1. formatDisplayLabel
394
+ * 2. dateFormat
395
+ * 3. locale
396
+ */
384
397
  }, {
385
398
  key: "render",
386
399
  value: function render() {
@@ -450,7 +463,6 @@ var DatePicker = /*#__PURE__*/function (_Component) {
450
463
  ref: this.getContainerRef,
451
464
  "data-testid": testId && "".concat(testId, "--container")
452
465
  }), jsx("input", {
453
- id: selectProps.inputId,
454
466
  name: name,
455
467
  type: "hidden",
456
468
  value: value,
@@ -27,7 +27,7 @@ import DatePicker from './date-picker';
27
27
  import TimePicker from './time-picker';
28
28
  import { convertTokens } from './utils';
29
29
  var packageName = "@atlaskit/datetime-picker";
30
- var packageVersion = "12.3.11";
30
+ var packageVersion = "12.3.12";
31
31
 
32
32
  /* eslint-disable react/no-unused-prop-types */
33
33
 
@@ -202,7 +202,8 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
202
202
  }));
203
203
  });
204
204
  return _this;
205
- }
205
+ } // All state needs to be accessed via this function so that the state is mapped from props
206
+ // correctly to allow controlled/uncontrolled usage.
206
207
  _createClass(DateTimePicker, [{
207
208
  key: "parseValue",
208
209
  value: function parseValue(value, dateValue, timeValue, zoneValue) {
@@ -295,16 +296,15 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
295
296
  // Don't use Date or TimePicker's because they can't be customised
296
297
  var isClearable = Boolean(dateValue || timeValue);
297
298
  var notFocusedOrIsDisabled = !(isFocused || isDisabled);
298
- var labelId = (datePickerSelectProps === null || datePickerSelectProps === void 0 ? void 0 : datePickerSelectProps.inputId) || (timePickerSelectProps === null || timePickerSelectProps === void 0 ? void 0 : timePickerSelectProps.inputId) || '';
299
299
  return jsx("div", _extends({
300
300
  css: [baseContainerStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, bothProps.appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, bothProps.isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (bothProps.isInvalid ? isInvalidHoverStyles : hoverStyles), bothProps.appearance === 'none' && noBgStyles]
301
301
  }, innerProps, {
302
302
  "data-testid": testId
303
303
  }), jsx("input", {
304
- id: labelId,
305
304
  name: name,
306
305
  type: "hidden",
307
- value: value
306
+ value: value,
307
+ "data-testid": testId && "".concat(testId, "--input")
308
308
  }), jsx("div", {
309
309
  css: datePickerContainerStyles
310
310
  }, jsx(DatePicker, _extends({}, bothProps, {
@@ -29,7 +29,10 @@ import FixedLayer from '../internal/fixed-layer';
29
29
  import parseTime from '../internal/parse-time';
30
30
  import { convertTokens } from './utils';
31
31
  var packageName = "@atlaskit/datetime-picker";
32
- var packageVersion = "12.3.11";
32
+ var packageVersion = "12.3.12";
33
+
34
+ /* eslint-disable react/no-unused-prop-types */
35
+
33
36
  var menuStyles = {
34
37
  /* Need to remove default absolute positioning as that causes issues with position fixed */
35
38
  position: 'static',
@@ -241,6 +244,18 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
241
244
  };
242
245
  });
243
246
  }
247
+
248
+ /**
249
+ * Only allow custom times if timeIsEditable prop is true
250
+ */
251
+
252
+ /**
253
+ * There are multiple props that can change how the time is formatted.
254
+ * The priority of props used is:
255
+ * 1. formatDisplayLabel
256
+ * 2. timeFormat
257
+ * 3. locale
258
+ */
244
259
  }, {
245
260
  key: "render",
246
261
  value: function render() {
@@ -303,10 +318,10 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
303
318
  "data-testid": testId && "".concat(testId, "--container"),
304
319
  onKeyDown: this.onSelectKeyDown
305
320
  }), /*#__PURE__*/React.createElement("input", {
306
- id: selectProps.inputId,
307
321
  name: name,
308
322
  type: "hidden",
309
- value: value
323
+ value: value,
324
+ "data-testid": testId && "".concat(testId, "--input")
310
325
  }), /*#__PURE__*/React.createElement(SelectComponent, _extends({
311
326
  appearance: this.props.appearance,
312
327
  autoFocus: autoFocus,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "12.3.11",
3
+ "version": "12.3.12",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "12.3.11",
3
+ "version": "12.3.12",
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/"
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/locale": "^2.1.0",
32
32
  "@atlaskit/popper": "^5.4.0",
33
33
  "@atlaskit/select": "^16.1.0",
34
- "@atlaskit/theme": "^12.3.0",
34
+ "@atlaskit/theme": "^12.4.0",
35
35
  "@atlaskit/tokens": "^1.2.0",
36
36
  "@babel/runtime": "^7.0.0",
37
37
  "@emotion/react": "^11.7.1",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/button": "^16.6.0",
47
47
  "@atlaskit/docs": "*",
48
48
  "@atlaskit/field-base": "^15.0.5",
49
- "@atlaskit/form": "^8.8.0",
49
+ "@atlaskit/form": "^8.9.0",
50
50
  "@atlaskit/modal-dialog": "^12.4.0",
51
51
  "@atlaskit/popup": "^1.5.0",
52
52
  "@atlaskit/range": "^7.0.0",