@atlaskit/datetime-picker 15.9.2 → 15.9.3

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,16 @@
1
1
  # @atlaskit/datetime-picker
2
2
 
3
+ ## 15.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#165423](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/165423)
8
+ [`f07cb14952573`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f07cb14952573) -
9
+ Update internals of datetime picker to accommodate new props.
10
+ - [#165989](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/165989)
11
+ [`4e6b0a538b8a2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4e6b0a538b8a2) -
12
+ Fix bug that stopped down/up arrow presses from opening the menu on the input field.
13
+
3
14
  ## 15.9.2
4
15
 
5
16
  ### Patch Changes
@@ -43,7 +43,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
43
43
  * @jsx jsx
44
44
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
45
45
  var packageName = "@atlaskit/datetime-picker";
46
- var packageVersion = "15.9.2";
46
+ var packageVersion = "15.9.3";
47
47
  var dropdownIndicatorStyles = (0, _primitives.xcss)({
48
48
  minWidth: "var(--ds-space-300, 24px)",
49
49
  minHeight: "var(--ds-space-300, 24px)",
@@ -331,8 +331,9 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
331
331
  break;
332
332
  case 'arrowdown':
333
333
  case 'arrowup':
334
- if (_this.state.isOpen && !_this.state.shouldSetFocusOnCurrentDay) {
334
+ if (!_this.state.shouldSetFocusOnCurrentDay) {
335
335
  _this.setState({
336
+ isOpen: true,
336
337
  shouldSetFocusOnCurrentDay: true
337
338
  });
338
339
  }
@@ -342,6 +343,11 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
342
343
  }
343
344
  });
344
345
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onCalendarButtonKeyDown", function (e) {
346
+ // Don't allow an arrow up or down to open the menu, since the input key
347
+ // down handler is actually on the parent.
348
+ if (e.type === 'keydown' && (e.key === 'ArrowDown' || e.key === 'ArrowUp')) {
349
+ e.stopPropagation();
350
+ }
345
351
  // We want to stop this from triggering other keydown events, particularly
346
352
  // for space and enter presses. Otherwise, it opens and then closes
347
353
  // immediately.
@@ -39,7 +39,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
39
39
  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; }
40
40
  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; }
41
41
  var packageName = "@atlaskit/datetime-picker";
42
- var packageVersion = "15.9.2";
42
+ var packageVersion = "15.9.3";
43
43
  var analyticsAttributes = {
44
44
  componentName: 'datePicker',
45
45
  packageName: packageName,
@@ -414,7 +414,8 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedR
414
414
  break;
415
415
  case 'arrowdown':
416
416
  case 'arrowup':
417
- if (isOpen && !shouldSetFocusOnCurrentDay) {
417
+ if (!shouldSetFocusOnCurrentDay) {
418
+ setIsOpen(true);
418
419
  setShouldSetFocusOnCurrentDay(true);
419
420
  }
420
421
  break;
@@ -423,6 +424,11 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedR
423
424
  }
424
425
  };
425
426
  var onCalendarButtonKeyDown = function onCalendarButtonKeyDown(e) {
427
+ // Don't allow an arrow up or down to open the menu, since the input key
428
+ // down handler is actually on the parent.
429
+ if (e.type === 'keydown' && (e.key === 'ArrowDown' || e.key === 'ArrowUp')) {
430
+ e.stopPropagation();
431
+ }
426
432
  // We want to stop this from triggering other keydown events, particularly
427
433
  // for space and enter presses. Otherwise, it opens and then closes
428
434
  // immediately.
@@ -38,7 +38,7 @@ var DatePicker = (0, _ffComponent.componentWithCondition)(function () {
38
38
  return (0, _platformFeatureFlags.fg)('dst-date-picker-use-functional-component');
39
39
  }, _datePickerFc.default, _datePickerClass.default);
40
40
  var packageName = "@atlaskit/datetime-picker";
41
- var packageVersion = "15.9.2";
41
+ var packageVersion = "15.9.3";
42
42
  // Make DatePicker 50% the width of DateTimePicker
43
43
  // If rendering an icon container, shrink the TimePicker
44
44
  var datePickerContainerStyles = (0, _react2.css)({
@@ -37,7 +37,7 @@ function () {
37
37
  return (0, _platformFeatureFlags.fg)('dst-date-picker-use-functional-component');
38
38
  }, _datePickerFc.default, _datePickerClass.default);
39
39
  var packageName = "@atlaskit/datetime-picker";
40
- var packageVersion = "15.9.2";
40
+ var packageVersion = "15.9.3";
41
41
  var analyticsAttributes = {
42
42
  componentName: 'dateTimePicker',
43
43
  packageName: packageName,
@@ -319,6 +319,8 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
319
319
  icon: datePickerProps.icon,
320
320
  id: datePickerProps.id || id,
321
321
  innerProps: datePickerProps.innerProps,
322
+ inputLabel: datePickerProps.inputLabel,
323
+ inputLabelId: datePickerProps.inputLabelId,
322
324
  isDisabled: datePickerProps.isDisabled || isDisabled,
323
325
  isInvalid: datePickerProps.isInvalid || isInvalid,
324
326
  isOpen: datePickerProps.isOpen,
@@ -332,10 +334,12 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
332
334
  onBlur: onDateBlur,
333
335
  onChange: onDateChange,
334
336
  onFocus: onDateFocus,
337
+ openCalendarLabel: datePickerProps.openCalendarLabel,
335
338
  parseInputValue: datePickerProps.parseInputValue,
336
339
  placeholder: datePickerProps.placeholder,
337
340
  previousMonthLabel: datePickerProps.previousMonthLabel,
338
341
  selectProps: mergedDatePickerSelectProps,
342
+ shouldShowCalendarButton: datePickerProps.shouldShowCalendarButton,
339
343
  spacing: datePickerProps.spacing || spacing,
340
344
  testId: testId && "".concat(testId, "--datepicker") || datePickerProps.testId,
341
345
  value: dateValue,
@@ -27,7 +27,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
27
27
  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; }
28
28
  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; }
29
29
  var packageName = "@atlaskit/datetime-picker";
30
- var packageVersion = "15.9.2";
30
+ var packageVersion = "15.9.3";
31
31
  var menuStyles = {
32
32
  /* Need to remove default absolute positioning as that causes issues with position fixed */
33
33
  position: 'static',
@@ -26,7 +26,7 @@ import { Menu } from '../internal/menu';
26
26
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
27
27
  import { makeSingleValue } from '../internal/single-value';
28
28
  const packageName = "@atlaskit/datetime-picker";
29
- const packageVersion = "15.9.2";
29
+ const packageVersion = "15.9.3";
30
30
  const dropdownIndicatorStyles = xcss({
31
31
  minWidth: "var(--ds-space-300, 24px)",
32
32
  minHeight: "var(--ds-space-300, 24px)",
@@ -314,8 +314,9 @@ class DatePickerComponent extends Component {
314
314
  break;
315
315
  case 'arrowdown':
316
316
  case 'arrowup':
317
- if (this.state.isOpen && !this.state.shouldSetFocusOnCurrentDay) {
317
+ if (!this.state.shouldSetFocusOnCurrentDay) {
318
318
  this.setState({
319
+ isOpen: true,
319
320
  shouldSetFocusOnCurrentDay: true
320
321
  });
321
322
  }
@@ -325,6 +326,11 @@ class DatePickerComponent extends Component {
325
326
  }
326
327
  });
327
328
  _defineProperty(this, "onCalendarButtonKeyDown", e => {
329
+ // Don't allow an arrow up or down to open the menu, since the input key
330
+ // down handler is actually on the parent.
331
+ if (e.type === 'keydown' && (e.key === 'ArrowDown' || e.key === 'ArrowUp')) {
332
+ e.stopPropagation();
333
+ }
328
334
  // We want to stop this from triggering other keydown events, particularly
329
335
  // for space and enter presses. Otherwise, it opens and then closes
330
336
  // immediately.
@@ -24,7 +24,7 @@ import { Menu } from '../internal/menu';
24
24
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
25
25
  import { makeSingleValue } from '../internal/single-value';
26
26
  const packageName = "@atlaskit/datetime-picker";
27
- const packageVersion = "15.9.2";
27
+ const packageVersion = "15.9.3";
28
28
  const analyticsAttributes = {
29
29
  componentName: 'datePicker',
30
30
  packageName,
@@ -340,7 +340,8 @@ const DatePicker = /*#__PURE__*/forwardRef((props, forwardedRef) => {
340
340
  break;
341
341
  case 'arrowdown':
342
342
  case 'arrowup':
343
- if (isOpen && !shouldSetFocusOnCurrentDay) {
343
+ if (!shouldSetFocusOnCurrentDay) {
344
+ setIsOpen(true);
344
345
  setShouldSetFocusOnCurrentDay(true);
345
346
  }
346
347
  break;
@@ -349,6 +350,11 @@ const DatePicker = /*#__PURE__*/forwardRef((props, forwardedRef) => {
349
350
  }
350
351
  };
351
352
  const onCalendarButtonKeyDown = e => {
353
+ // Don't allow an arrow up or down to open the menu, since the input key
354
+ // down handler is actually on the parent.
355
+ if (e.type === 'keydown' && (e.key === 'ArrowDown' || e.key === 'ArrowUp')) {
356
+ e.stopPropagation();
357
+ }
352
358
  // We want to stop this from triggering other keydown events, particularly
353
359
  // for space and enter presses. Otherwise, it opens and then closes
354
360
  // immediately.
@@ -22,7 +22,7 @@ import DatePickerNew from './date-picker-fc';
22
22
  import TimePicker from './time-picker';
23
23
  const DatePicker = componentWithCondition(() => fg('dst-date-picker-use-functional-component'), DatePickerNew, DatePickerOld);
24
24
  const packageName = "@atlaskit/datetime-picker";
25
- const packageVersion = "15.9.2";
25
+ const packageVersion = "15.9.3";
26
26
  // Make DatePicker 50% the width of DateTimePicker
27
27
  // If rendering an icon container, shrink the TimePicker
28
28
  const datePickerContainerStyles = css({
@@ -18,7 +18,7 @@ const DatePicker = componentWithCondition(
18
18
  // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
19
19
  () => fg('dst-date-picker-use-functional-component'), DatePickerNew, DatePickerOld);
20
20
  const packageName = "@atlaskit/datetime-picker";
21
- const packageVersion = "15.9.2";
21
+ const packageVersion = "15.9.3";
22
22
  const analyticsAttributes = {
23
23
  componentName: 'dateTimePicker',
24
24
  packageName,
@@ -281,6 +281,8 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
281
281
  icon: datePickerProps.icon,
282
282
  id: datePickerProps.id || id,
283
283
  innerProps: datePickerProps.innerProps,
284
+ inputLabel: datePickerProps.inputLabel,
285
+ inputLabelId: datePickerProps.inputLabelId,
284
286
  isDisabled: datePickerProps.isDisabled || isDisabled,
285
287
  isInvalid: datePickerProps.isInvalid || isInvalid,
286
288
  isOpen: datePickerProps.isOpen,
@@ -294,10 +296,12 @@ const DateTimePicker = /*#__PURE__*/forwardRef(({
294
296
  onBlur: onDateBlur,
295
297
  onChange: onDateChange,
296
298
  onFocus: onDateFocus,
299
+ openCalendarLabel: datePickerProps.openCalendarLabel,
297
300
  parseInputValue: datePickerProps.parseInputValue,
298
301
  placeholder: datePickerProps.placeholder,
299
302
  previousMonthLabel: datePickerProps.previousMonthLabel,
300
303
  selectProps: mergedDatePickerSelectProps,
304
+ shouldShowCalendarButton: datePickerProps.shouldShowCalendarButton,
301
305
  spacing: datePickerProps.spacing || spacing,
302
306
  testId: testId && `${testId}--datepicker` || datePickerProps.testId,
303
307
  value: dateValue,
@@ -11,7 +11,7 @@ import parseTime from '../internal/parse-time';
11
11
  import { convertTokens } from '../internal/parse-tokens';
12
12
  import { makeSingleValue } from '../internal/single-value';
13
13
  const packageName = "@atlaskit/datetime-picker";
14
- const packageVersion = "15.9.2";
14
+ const packageVersion = "15.9.3";
15
15
  const menuStyles = {
16
16
  /* Need to remove default absolute positioning as that causes issues with position fixed */
17
17
  position: 'static',
@@ -36,7 +36,7 @@ import { Menu } from '../internal/menu';
36
36
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
37
37
  import { makeSingleValue } from '../internal/single-value';
38
38
  var packageName = "@atlaskit/datetime-picker";
39
- var packageVersion = "15.9.2";
39
+ var packageVersion = "15.9.3";
40
40
  var dropdownIndicatorStyles = xcss({
41
41
  minWidth: "var(--ds-space-300, 24px)",
42
42
  minHeight: "var(--ds-space-300, 24px)",
@@ -324,8 +324,9 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
324
324
  break;
325
325
  case 'arrowdown':
326
326
  case 'arrowup':
327
- if (_this.state.isOpen && !_this.state.shouldSetFocusOnCurrentDay) {
327
+ if (!_this.state.shouldSetFocusOnCurrentDay) {
328
328
  _this.setState({
329
+ isOpen: true,
329
330
  shouldSetFocusOnCurrentDay: true
330
331
  });
331
332
  }
@@ -335,6 +336,11 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
335
336
  }
336
337
  });
337
338
  _defineProperty(_assertThisInitialized(_this), "onCalendarButtonKeyDown", function (e) {
339
+ // Don't allow an arrow up or down to open the menu, since the input key
340
+ // down handler is actually on the parent.
341
+ if (e.type === 'keydown' && (e.key === 'ArrowDown' || e.key === 'ArrowUp')) {
342
+ e.stopPropagation();
343
+ }
338
344
  // We want to stop this from triggering other keydown events, particularly
339
345
  // for space and enter presses. Otherwise, it opens and then closes
340
346
  // immediately.
@@ -30,7 +30,7 @@ import { Menu } from '../internal/menu';
30
30
  import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
31
31
  import { makeSingleValue } from '../internal/single-value';
32
32
  var packageName = "@atlaskit/datetime-picker";
33
- var packageVersion = "15.9.2";
33
+ var packageVersion = "15.9.3";
34
34
  var analyticsAttributes = {
35
35
  componentName: 'datePicker',
36
36
  packageName: packageName,
@@ -405,7 +405,8 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
405
405
  break;
406
406
  case 'arrowdown':
407
407
  case 'arrowup':
408
- if (isOpen && !shouldSetFocusOnCurrentDay) {
408
+ if (!shouldSetFocusOnCurrentDay) {
409
+ setIsOpen(true);
409
410
  setShouldSetFocusOnCurrentDay(true);
410
411
  }
411
412
  break;
@@ -414,6 +415,11 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
414
415
  }
415
416
  };
416
417
  var onCalendarButtonKeyDown = function onCalendarButtonKeyDown(e) {
418
+ // Don't allow an arrow up or down to open the menu, since the input key
419
+ // down handler is actually on the parent.
420
+ if (e.type === 'keydown' && (e.key === 'ArrowDown' || e.key === 'ArrowUp')) {
421
+ e.stopPropagation();
422
+ }
417
423
  // We want to stop this from triggering other keydown events, particularly
418
424
  // for space and enter presses. Otherwise, it opens and then closes
419
425
  // immediately.
@@ -34,7 +34,7 @@ var DatePicker = componentWithCondition(function () {
34
34
  return fg('dst-date-picker-use-functional-component');
35
35
  }, DatePickerNew, DatePickerOld);
36
36
  var packageName = "@atlaskit/datetime-picker";
37
- var packageVersion = "15.9.2";
37
+ var packageVersion = "15.9.3";
38
38
  // Make DatePicker 50% the width of DateTimePicker
39
39
  // If rendering an icon container, shrink the TimePicker
40
40
  var datePickerContainerStyles = css({
@@ -27,7 +27,7 @@ function () {
27
27
  return fg('dst-date-picker-use-functional-component');
28
28
  }, DatePickerNew, DatePickerOld);
29
29
  var packageName = "@atlaskit/datetime-picker";
30
- var packageVersion = "15.9.2";
30
+ var packageVersion = "15.9.3";
31
31
  var analyticsAttributes = {
32
32
  componentName: 'dateTimePicker',
33
33
  packageName: packageName,
@@ -309,6 +309,8 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
309
309
  icon: datePickerProps.icon,
310
310
  id: datePickerProps.id || id,
311
311
  innerProps: datePickerProps.innerProps,
312
+ inputLabel: datePickerProps.inputLabel,
313
+ inputLabelId: datePickerProps.inputLabelId,
312
314
  isDisabled: datePickerProps.isDisabled || isDisabled,
313
315
  isInvalid: datePickerProps.isInvalid || isInvalid,
314
316
  isOpen: datePickerProps.isOpen,
@@ -322,10 +324,12 @@ var DateTimePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
322
324
  onBlur: onDateBlur,
323
325
  onChange: onDateChange,
324
326
  onFocus: onDateFocus,
327
+ openCalendarLabel: datePickerProps.openCalendarLabel,
325
328
  parseInputValue: datePickerProps.parseInputValue,
326
329
  placeholder: datePickerProps.placeholder,
327
330
  previousMonthLabel: datePickerProps.previousMonthLabel,
328
331
  selectProps: mergedDatePickerSelectProps,
332
+ shouldShowCalendarButton: datePickerProps.shouldShowCalendarButton,
329
333
  spacing: datePickerProps.spacing || spacing,
330
334
  testId: testId && "".concat(testId, "--datepicker") || datePickerProps.testId,
331
335
  value: dateValue,
@@ -17,7 +17,7 @@ import parseTime from '../internal/parse-time';
17
17
  import { convertTokens } from '../internal/parse-tokens';
18
18
  import { makeSingleValue } from '../internal/single-value';
19
19
  var packageName = "@atlaskit/datetime-picker";
20
- var packageVersion = "15.9.2";
20
+ var packageVersion = "15.9.3";
21
21
  var menuStyles = {
22
22
  /* Need to remove default absolute positioning as that causes issues with position fixed */
23
23
  position: 'static',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "15.9.2",
3
+ "version": "15.9.3",
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/"
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/locale": "^2.8.0",
45
45
  "@atlaskit/platform-feature-flags": "^0.3.0",
46
46
  "@atlaskit/popper": "^6.3.0",
47
- "@atlaskit/primitives": "^13.1.0",
47
+ "@atlaskit/primitives": "^13.2.0",
48
48
  "@atlaskit/select": "^18.5.0",
49
49
  "@atlaskit/theme": "^14.0.0",
50
50
  "@atlaskit/tokens": "^2.2.0",