@atlaskit/datetime-picker 15.9.0 → 15.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/datetime-picker
2
2
 
3
+ ## 15.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#163831](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/163831)
8
+ [`bdee2726c1e39`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bdee2726c1e39) -
9
+ Fix bug in calendar date selection caused by underlying `react-select` mousedown event.
10
+
11
+ ## 15.9.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#161638](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/161638)
16
+ [`d2e5e5ce0053d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d2e5e5ce0053d) -
17
+ Use new API of layering without UNSAFE prefix
18
+
3
19
  ## 15.9.0
4
20
 
5
21
  ### Minor 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.0";
46
+ var packageVersion = "15.9.2";
47
47
  var dropdownIndicatorStyles = (0, _primitives.xcss)({
48
48
  minWidth: "var(--ds-space-300, 24px)",
49
49
  minHeight: "var(--ds-space-300, 24px)",
@@ -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.0";
42
+ var packageVersion = "15.9.2";
43
43
  var analyticsAttributes = {
44
44
  componentName: 'datePicker',
45
45
  packageName: packageName,
@@ -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.0";
41
+ var packageVersion = "15.9.2";
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.0";
40
+ var packageVersion = "15.9.2";
41
41
  var analyticsAttributes = {
42
42
  componentName: 'dateTimePicker',
43
43
  packageName: packageName,
@@ -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.0";
30
+ var packageVersion = "15.9.2";
31
31
  var menuStyles = {
32
32
  /* Need to remove default absolute positioning as that causes issues with position fixed */
33
33
  position: 'static',
@@ -53,14 +53,31 @@ var Menu = exports.Menu = function Menu(_ref) {
53
53
  day = _getValidDate.day,
54
54
  month = _getValidDate.month,
55
55
  year = _getValidDate.year;
56
- return (0, _react.jsx)(_layering.UNSAFE_LAYERING, {
56
+ var onMenuMouseDown = function onMenuMouseDown(event) {
57
+ if (event.button !== 0) {
58
+ return;
59
+ }
60
+ event.stopPropagation();
61
+ event.preventDefault();
62
+ };
63
+ return (0, _react.jsx)(_layering.Layering, {
57
64
  isDisabled: false
58
65
  }, (0, _react.jsx)(_fixedLayer.default, {
59
66
  inputValue: selectProps.inputValue,
60
67
  containerRef: selectProps.calendarContainerRef,
61
- content: (0, _react.jsx)("div", (0, _extends2.default)({
68
+ content:
69
+ // The mousedown event is required for a date selection to work when
70
+ // the menu is opened via the calendar button. The reason why is
71
+ // because there is a mousedown event on the menu inside of
72
+ // `react-select` that will stop the calendar select event from
73
+ // firing. This is passed in via the `innerProps`. Therefore, we must
74
+ // pass it in *after* the `innerProps` spread.
75
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
76
+ (0, _react.jsx)("div", (0, _extends2.default)({
62
77
  css: menuStyles
63
- }, innerProps), (0, _react.jsx)(_calendar.default, {
78
+ }, innerProps, {
79
+ onMouseDown: onMenuMouseDown
80
+ }), (0, _react.jsx)(_calendar.default, {
64
81
  day: day,
65
82
  month: month,
66
83
  year: year,
@@ -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.0";
29
+ const packageVersion = "15.9.2";
30
30
  const dropdownIndicatorStyles = xcss({
31
31
  minWidth: "var(--ds-space-300, 24px)",
32
32
  minHeight: "var(--ds-space-300, 24px)",
@@ -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.0";
27
+ const packageVersion = "15.9.2";
28
28
  const analyticsAttributes = {
29
29
  componentName: 'datePicker',
30
30
  packageName,
@@ -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.0";
25
+ const packageVersion = "15.9.2";
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.0";
21
+ const packageVersion = "15.9.2";
22
22
  const analyticsAttributes = {
23
23
  componentName: 'dateTimePicker',
24
24
  packageName,
@@ -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.0";
14
+ const packageVersion = "15.9.2";
15
15
  const menuStyles = {
16
16
  /* Need to remove default absolute positioning as that causes issues with position fixed */
17
17
  position: 'static',
@@ -4,10 +4,11 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  * @jsx jsx
5
5
  */
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
+
7
8
  import { css, jsx } from '@emotion/react';
8
9
  import { isValid, parseISO } from 'date-fns';
9
10
  import Calendar from '@atlaskit/calendar';
10
- import { UNSAFE_LAYERING } from '@atlaskit/layering';
11
+ import { Layering } from '@atlaskit/layering';
11
12
  import { N0, N50A, N60A } from '@atlaskit/theme/colors';
12
13
  import { layers } from '@atlaskit/theme/constants';
13
14
  import FixedLayer from '../internal/fixed-layer';
@@ -50,14 +51,31 @@ export const Menu = ({
50
51
  month,
51
52
  year
52
53
  } = getValidDate([calendarValue, calendarView]);
53
- return jsx(UNSAFE_LAYERING, {
54
+ const onMenuMouseDown = event => {
55
+ if (event.button !== 0) {
56
+ return;
57
+ }
58
+ event.stopPropagation();
59
+ event.preventDefault();
60
+ };
61
+ return jsx(Layering, {
54
62
  isDisabled: false
55
63
  }, jsx(FixedLayer, {
56
64
  inputValue: selectProps.inputValue,
57
65
  containerRef: selectProps.calendarContainerRef,
58
- content: jsx("div", _extends({
66
+ content:
67
+ // The mousedown event is required for a date selection to work when
68
+ // the menu is opened via the calendar button. The reason why is
69
+ // because there is a mousedown event on the menu inside of
70
+ // `react-select` that will stop the calendar select event from
71
+ // firing. This is passed in via the `innerProps`. Therefore, we must
72
+ // pass it in *after* the `innerProps` spread.
73
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
74
+ jsx("div", _extends({
59
75
  css: menuStyles
60
- }, innerProps), jsx(Calendar, {
76
+ }, innerProps, {
77
+ onMouseDown: onMenuMouseDown
78
+ }), jsx(Calendar, {
61
79
  day: day,
62
80
  month: month,
63
81
  year: year,
@@ -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.0";
39
+ var packageVersion = "15.9.2";
40
40
  var dropdownIndicatorStyles = xcss({
41
41
  minWidth: "var(--ds-space-300, 24px)",
42
42
  minHeight: "var(--ds-space-300, 24px)",
@@ -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.0";
33
+ var packageVersion = "15.9.2";
34
34
  var analyticsAttributes = {
35
35
  componentName: 'datePicker',
36
36
  packageName: packageName,
@@ -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.0";
37
+ var packageVersion = "15.9.2";
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.0";
30
+ var packageVersion = "15.9.2";
31
31
  var analyticsAttributes = {
32
32
  componentName: 'dateTimePicker',
33
33
  packageName: packageName,
@@ -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.0";
20
+ var packageVersion = "15.9.2";
21
21
  var menuStyles = {
22
22
  /* Need to remove default absolute positioning as that causes issues with position fixed */
23
23
  position: 'static',
@@ -4,10 +4,11 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  * @jsx jsx
5
5
  */
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
+
7
8
  import { css, jsx } from '@emotion/react';
8
9
  import { isValid, parseISO } from 'date-fns';
9
10
  import Calendar from '@atlaskit/calendar';
10
- import { UNSAFE_LAYERING } from '@atlaskit/layering';
11
+ import { Layering } from '@atlaskit/layering';
11
12
  import { N0, N50A, N60A } from '@atlaskit/theme/colors';
12
13
  import { layers } from '@atlaskit/theme/constants';
13
14
  import FixedLayer from '../internal/fixed-layer';
@@ -46,14 +47,31 @@ export var Menu = function Menu(_ref) {
46
47
  day = _getValidDate.day,
47
48
  month = _getValidDate.month,
48
49
  year = _getValidDate.year;
49
- return jsx(UNSAFE_LAYERING, {
50
+ var onMenuMouseDown = function onMenuMouseDown(event) {
51
+ if (event.button !== 0) {
52
+ return;
53
+ }
54
+ event.stopPropagation();
55
+ event.preventDefault();
56
+ };
57
+ return jsx(Layering, {
50
58
  isDisabled: false
51
59
  }, jsx(FixedLayer, {
52
60
  inputValue: selectProps.inputValue,
53
61
  containerRef: selectProps.calendarContainerRef,
54
- content: jsx("div", _extends({
62
+ content:
63
+ // The mousedown event is required for a date selection to work when
64
+ // the menu is opened via the calendar button. The reason why is
65
+ // because there is a mousedown event on the menu inside of
66
+ // `react-select` that will stop the calendar select event from
67
+ // firing. This is passed in via the `innerProps`. Therefore, we must
68
+ // pass it in *after* the `innerProps` spread.
69
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
70
+ jsx("div", _extends({
55
71
  css: menuStyles
56
- }, innerProps), jsx(Calendar, {
72
+ }, innerProps, {
73
+ onMouseDown: onMenuMouseDown
74
+ }), jsx(Calendar, {
57
75
  day: day,
58
76
  month: month,
59
77
  year: year,
@@ -1,7 +1,3 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
1
  import { jsx } from '@emotion/react';
6
2
  import { type MenuProps } from '@atlaskit/select';
7
3
  /**
@@ -1,7 +1,3 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
1
  import { jsx } from '@emotion/react';
6
2
  import { type MenuProps } from '@atlaskit/select';
7
3
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "15.9.0",
3
+ "version": "15.9.2",
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,9 +38,9 @@
38
38
  "@atlaskit/analytics-next": "^10.1.0",
39
39
  "@atlaskit/button": "^20.3.1",
40
40
  "@atlaskit/calendar": "^15.1.0",
41
- "@atlaskit/ds-lib": "^3.1.0",
41
+ "@atlaskit/ds-lib": "^3.2.0",
42
42
  "@atlaskit/icon": "^22.24.0",
43
- "@atlaskit/layering": "^0.7.0",
43
+ "@atlaskit/layering": "^0.7.3",
44
44
  "@atlaskit/locale": "^2.8.0",
45
45
  "@atlaskit/platform-feature-flags": "^0.3.0",
46
46
  "@atlaskit/popper": "^6.3.0",