@atlaskit/datetime-picker 16.0.2 → 16.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 +14 -0
- package/dist/cjs/components/date-picker-class.js +5 -3
- package/dist/cjs/components/date-picker-fc.js +9 -3
- package/dist/cjs/components/date-time-picker-class.js +1 -1
- package/dist/cjs/components/date-time-picker-fc.js +1 -1
- package/dist/cjs/components/time-picker.js +1 -1
- package/dist/cjs/internal/menu.js +11 -8
- package/dist/es2019/components/date-picker-class.js +5 -3
- package/dist/es2019/components/date-picker-fc.js +9 -3
- package/dist/es2019/components/date-time-picker-class.js +1 -1
- package/dist/es2019/components/date-time-picker-fc.js +1 -1
- package/dist/es2019/components/time-picker.js +1 -1
- package/dist/es2019/internal/menu.js +6 -4
- package/dist/esm/components/date-picker-class.js +5 -3
- package/dist/esm/components/date-picker-fc.js +9 -3
- package/dist/esm/components/date-time-picker-class.js +1 -1
- package/dist/esm/components/date-time-picker-fc.js +1 -1
- package/dist/esm/components/time-picker.js +1 -1
- package/dist/esm/internal/menu.js +6 -4
- package/dist/types/components/date-picker-class.d.ts +1 -1
- package/dist/types/components/date-picker.d.ts +1 -1
- package/dist/types/types.d.ts +7 -0
- package/dist/types-ts4.5/components/date-picker-class.d.ts +1 -1
- package/dist/types-ts4.5/components/date-picker.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +7 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/datetime-picker
|
|
2
2
|
|
|
3
|
+
## 16.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#115611](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/115611)
|
|
8
|
+
[`5f9efb77e9d97`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5f9efb77e9d97) -
|
|
9
|
+
Adds a new prop to allow wrapping the DatePicker calendar, for internal use only.
|
|
10
|
+
|
|
11
|
+
## 16.0.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 16.0.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -40,7 +40,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
40
40
|
* @jsx jsx
|
|
41
41
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
42
42
|
var packageName = "@atlaskit/datetime-picker";
|
|
43
|
-
var packageVersion = "16.0
|
|
43
|
+
var packageVersion = "16.1.0";
|
|
44
44
|
var dropdownIndicatorStyles = (0, _primitives.xcss)({
|
|
45
45
|
minWidth: "var(--ds-space-300, 24px)",
|
|
46
46
|
minHeight: "var(--ds-space-300, 24px)",
|
|
@@ -515,7 +515,8 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
|
|
|
515
515
|
onCalendarSelect: this.onCalendarSelect,
|
|
516
516
|
calendarLocale: locale,
|
|
517
517
|
calendarWeekStartDay: weekStartDay,
|
|
518
|
-
shouldSetFocusOnCurrentDay: this.state.shouldSetFocusOnCurrentDay
|
|
518
|
+
shouldSetFocusOnCurrentDay: this.state.shouldSetFocusOnCurrentDay,
|
|
519
|
+
menuInnerWrapper: this.props.menuInnerWrapper
|
|
519
520
|
};
|
|
520
521
|
|
|
521
522
|
// @ts-ignore -- Argument of type 'StylesConfig<OptionType, false, GroupBase<OptionType>>' is not assignable to parameter of type 'StylesConfig<OptionType, boolean, GroupBase<OptionType>>'.
|
|
@@ -618,7 +619,8 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
|
|
|
618
619
|
onCalendarChange: calendarProps.onCalendarChange,
|
|
619
620
|
onCalendarSelect: calendarProps.onCalendarSelect,
|
|
620
621
|
previousMonthLabel: previousMonthLabel,
|
|
621
|
-
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay
|
|
622
|
+
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
|
|
623
|
+
menuInnerWrapper: calendarProps.menuInnerWrapper
|
|
622
624
|
})), shouldShowCalendarButton && !isDisabled ? (0, _react2.jsx)(_useId.IdProvider, {
|
|
623
625
|
prefix: "open-calendar-label--"
|
|
624
626
|
}, function (_ref3) {
|
|
@@ -38,7 +38,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
38
38
|
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; }
|
|
39
39
|
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; }
|
|
40
40
|
var packageName = "@atlaskit/datetime-picker";
|
|
41
|
-
var packageVersion = "16.0
|
|
41
|
+
var packageVersion = "16.1.0";
|
|
42
42
|
var analyticsAttributes = {
|
|
43
43
|
componentName: 'datePicker',
|
|
44
44
|
packageName: packageName,
|
|
@@ -509,7 +509,12 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedR
|
|
|
509
509
|
onCalendarSelect: onCalendarSelect,
|
|
510
510
|
calendarLocale: locale,
|
|
511
511
|
calendarWeekStartDay: weekStartDay,
|
|
512
|
-
shouldSetFocusOnCurrentDay: shouldSetFocusOnCurrentDay
|
|
512
|
+
shouldSetFocusOnCurrentDay: shouldSetFocusOnCurrentDay,
|
|
513
|
+
/**
|
|
514
|
+
* This overrides the inner wrapper the Calendar.
|
|
515
|
+
* @private Please use this with extreme caution, this API may be changed in the future.
|
|
516
|
+
*/
|
|
517
|
+
menuInnerWrapper: props === null || props === void 0 ? void 0 : props.menuInnerWrapper
|
|
513
518
|
};
|
|
514
519
|
|
|
515
520
|
// @ts-ignore -- Argument of type 'StylesConfig<OptionType, false, GroupBase<OptionType>>' is not assignable to parameter of type 'StylesConfig<OptionType, boolean, GroupBase<OptionType>>'.
|
|
@@ -615,7 +620,8 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, forwardedR
|
|
|
615
620
|
onCalendarChange: calendarProps.onCalendarChange,
|
|
616
621
|
onCalendarSelect: calendarProps.onCalendarSelect,
|
|
617
622
|
previousMonthLabel: previousMonthLabel,
|
|
618
|
-
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay
|
|
623
|
+
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
|
|
624
|
+
menuInnerWrapper: calendarProps.menuInnerWrapper
|
|
619
625
|
})), shouldShowCalendarButton && !isDisabled ? (0, _react2.jsx)(_primitives.Box, {
|
|
620
626
|
xcss: [iconContainerStyles, value && !hideIcon ? iconSpacingWithClearButtonStyles : iconSpacingWithoutClearButtonStyles]
|
|
621
627
|
}, (0, _react2.jsx)(_new.IconButton, {
|
|
@@ -37,7 +37,7 @@ var DatePicker = (0, _ffComponent.componentWithCondition)(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 = "16.0
|
|
40
|
+
var packageVersion = "16.1.0";
|
|
41
41
|
// Make DatePicker 50% the width of DateTimePicker
|
|
42
42
|
// If rendering an icon container, shrink the TimePicker
|
|
43
43
|
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 = "16.0
|
|
40
|
+
var packageVersion = "16.1.0";
|
|
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 = "16.0
|
|
30
|
+
var packageVersion = "16.1.0";
|
|
31
31
|
var menuStyles = {
|
|
32
32
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
33
33
|
position: 'static',
|
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.Menu = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _react = require("
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _react2 = require("@emotion/react");
|
|
10
11
|
var _dateFns = require("date-fns");
|
|
11
12
|
var _calendar = _interopRequireDefault(require("@atlaskit/calendar"));
|
|
12
13
|
var _layering = require("@atlaskit/layering");
|
|
@@ -33,7 +34,7 @@ function getValidDate(isos) {
|
|
|
33
34
|
} : acc;
|
|
34
35
|
}, {});
|
|
35
36
|
}
|
|
36
|
-
var menuStyles = (0,
|
|
37
|
+
var menuStyles = (0, _react2.css)({
|
|
37
38
|
zIndex: _constants.layers.dialog(),
|
|
38
39
|
backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
|
|
39
40
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
@@ -48,7 +49,8 @@ var Menu = exports.Menu = function Menu(_ref) {
|
|
|
48
49
|
var selectProps = _ref.selectProps,
|
|
49
50
|
innerProps = _ref.innerProps;
|
|
50
51
|
var calendarValue = selectProps.calendarValue,
|
|
51
|
-
calendarView = selectProps.calendarView
|
|
52
|
+
calendarView = selectProps.calendarView,
|
|
53
|
+
MenuInnerWrapper = selectProps.menuInnerWrapper;
|
|
52
54
|
var _getValidDate = getValidDate([calendarValue, calendarView]),
|
|
53
55
|
day = _getValidDate.day,
|
|
54
56
|
month = _getValidDate.month,
|
|
@@ -60,9 +62,10 @@ var Menu = exports.Menu = function Menu(_ref) {
|
|
|
60
62
|
event.stopPropagation();
|
|
61
63
|
event.preventDefault();
|
|
62
64
|
};
|
|
63
|
-
|
|
65
|
+
var Wrapper = typeof MenuInnerWrapper === 'function' ? MenuInnerWrapper : _react.Fragment;
|
|
66
|
+
return (0, _react2.jsx)(_layering.Layering, {
|
|
64
67
|
isDisabled: false
|
|
65
|
-
}, (0,
|
|
68
|
+
}, (0, _react2.jsx)(_fixedLayer.default, {
|
|
66
69
|
inputValue: selectProps.inputValue,
|
|
67
70
|
containerRef: selectProps.calendarContainerRef,
|
|
68
71
|
content:
|
|
@@ -73,11 +76,11 @@ var Menu = exports.Menu = function Menu(_ref) {
|
|
|
73
76
|
// firing. This is passed in via the `innerProps`. Therefore, we must
|
|
74
77
|
// pass it in *after* the `innerProps` spread.
|
|
75
78
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
76
|
-
(0,
|
|
79
|
+
(0, _react2.jsx)("div", (0, _extends2.default)({
|
|
77
80
|
css: menuStyles
|
|
78
81
|
}, innerProps, {
|
|
79
82
|
onMouseDown: onMenuMouseDown
|
|
80
|
-
}), (0,
|
|
83
|
+
}), (0, _react2.jsx)(Wrapper, null, (0, _react2.jsx)(_calendar.default, {
|
|
81
84
|
day: day,
|
|
82
85
|
month: month,
|
|
83
86
|
year: year,
|
|
@@ -95,7 +98,7 @@ var Menu = exports.Menu = function Menu(_ref) {
|
|
|
95
98
|
locale: selectProps.calendarLocale,
|
|
96
99
|
testId: selectProps.testId && "".concat(selectProps.testId, "--calendar"),
|
|
97
100
|
weekStartDay: selectProps.calendarWeekStartDay
|
|
98
|
-
})),
|
|
101
|
+
}))),
|
|
99
102
|
testId: selectProps.testId
|
|
100
103
|
}));
|
|
101
104
|
};
|
|
@@ -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 = "16.0
|
|
27
|
+
const packageVersion = "16.1.0";
|
|
28
28
|
const dropdownIndicatorStyles = xcss({
|
|
29
29
|
minWidth: "var(--ds-space-300, 24px)",
|
|
30
30
|
minHeight: "var(--ds-space-300, 24px)",
|
|
@@ -493,7 +493,8 @@ class DatePickerComponent extends Component {
|
|
|
493
493
|
onCalendarSelect: this.onCalendarSelect,
|
|
494
494
|
calendarLocale: locale,
|
|
495
495
|
calendarWeekStartDay: weekStartDay,
|
|
496
|
-
shouldSetFocusOnCurrentDay: this.state.shouldSetFocusOnCurrentDay
|
|
496
|
+
shouldSetFocusOnCurrentDay: this.state.shouldSetFocusOnCurrentDay,
|
|
497
|
+
menuInnerWrapper: this.props.menuInnerWrapper
|
|
497
498
|
};
|
|
498
499
|
|
|
499
500
|
// @ts-ignore -- Argument of type 'StylesConfig<OptionType, false, GroupBase<OptionType>>' is not assignable to parameter of type 'StylesConfig<OptionType, boolean, GroupBase<OptionType>>'.
|
|
@@ -596,7 +597,8 @@ class DatePickerComponent extends Component {
|
|
|
596
597
|
onCalendarChange: calendarProps.onCalendarChange,
|
|
597
598
|
onCalendarSelect: calendarProps.onCalendarSelect,
|
|
598
599
|
previousMonthLabel: previousMonthLabel,
|
|
599
|
-
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay
|
|
600
|
+
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
|
|
601
|
+
menuInnerWrapper: calendarProps.menuInnerWrapper
|
|
600
602
|
})), shouldShowCalendarButton && !isDisabled ? jsx(IdProvider, {
|
|
601
603
|
prefix: "open-calendar-label--"
|
|
602
604
|
}, ({
|
|
@@ -23,7 +23,7 @@ import { Menu } from '../internal/menu';
|
|
|
23
23
|
import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
|
|
24
24
|
import { makeSingleValue } from '../internal/single-value';
|
|
25
25
|
const packageName = "@atlaskit/datetime-picker";
|
|
26
|
-
const packageVersion = "16.0
|
|
26
|
+
const packageVersion = "16.1.0";
|
|
27
27
|
const analyticsAttributes = {
|
|
28
28
|
componentName: 'datePicker',
|
|
29
29
|
packageName,
|
|
@@ -435,7 +435,12 @@ const DatePicker = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
435
435
|
onCalendarSelect,
|
|
436
436
|
calendarLocale: locale,
|
|
437
437
|
calendarWeekStartDay: weekStartDay,
|
|
438
|
-
shouldSetFocusOnCurrentDay
|
|
438
|
+
shouldSetFocusOnCurrentDay,
|
|
439
|
+
/**
|
|
440
|
+
* This overrides the inner wrapper the Calendar.
|
|
441
|
+
* @private Please use this with extreme caution, this API may be changed in the future.
|
|
442
|
+
*/
|
|
443
|
+
menuInnerWrapper: props === null || props === void 0 ? void 0 : props.menuInnerWrapper
|
|
439
444
|
};
|
|
440
445
|
|
|
441
446
|
// @ts-ignore -- Argument of type 'StylesConfig<OptionType, false, GroupBase<OptionType>>' is not assignable to parameter of type 'StylesConfig<OptionType, boolean, GroupBase<OptionType>>'.
|
|
@@ -541,7 +546,8 @@ const DatePicker = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
541
546
|
onCalendarChange: calendarProps.onCalendarChange,
|
|
542
547
|
onCalendarSelect: calendarProps.onCalendarSelect,
|
|
543
548
|
previousMonthLabel: previousMonthLabel,
|
|
544
|
-
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay
|
|
549
|
+
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
|
|
550
|
+
menuInnerWrapper: calendarProps.menuInnerWrapper
|
|
545
551
|
})), shouldShowCalendarButton && !isDisabled ? jsx(Box, {
|
|
546
552
|
xcss: [iconContainerStyles, value && !hideIcon ? iconSpacingWithClearButtonStyles : iconSpacingWithoutClearButtonStyles]
|
|
547
553
|
}, jsx(IconButton, {
|
|
@@ -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 = "16.0
|
|
25
|
+
const packageVersion = "16.1.0";
|
|
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 = "16.0
|
|
21
|
+
const packageVersion = "16.1.0";
|
|
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 = "16.0
|
|
14
|
+
const packageVersion = "16.1.0";
|
|
15
15
|
const menuStyles = {
|
|
16
16
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
17
17
|
position: 'static',
|
|
@@ -4,7 +4,7 @@ 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
|
+
import { Fragment } from 'react';
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { isValid, parseISO } from 'date-fns';
|
|
10
10
|
import Calendar from '@atlaskit/calendar';
|
|
@@ -44,7 +44,8 @@ export const Menu = ({
|
|
|
44
44
|
}) => {
|
|
45
45
|
const {
|
|
46
46
|
calendarValue,
|
|
47
|
-
calendarView
|
|
47
|
+
calendarView,
|
|
48
|
+
menuInnerWrapper: MenuInnerWrapper
|
|
48
49
|
} = selectProps;
|
|
49
50
|
const {
|
|
50
51
|
day,
|
|
@@ -58,6 +59,7 @@ export const Menu = ({
|
|
|
58
59
|
event.stopPropagation();
|
|
59
60
|
event.preventDefault();
|
|
60
61
|
};
|
|
62
|
+
const Wrapper = typeof MenuInnerWrapper === 'function' ? MenuInnerWrapper : Fragment;
|
|
61
63
|
return jsx(Layering, {
|
|
62
64
|
isDisabled: false
|
|
63
65
|
}, jsx(FixedLayer, {
|
|
@@ -75,7 +77,7 @@ export const Menu = ({
|
|
|
75
77
|
css: menuStyles
|
|
76
78
|
}, innerProps, {
|
|
77
79
|
onMouseDown: onMenuMouseDown
|
|
78
|
-
}), jsx(Calendar, {
|
|
80
|
+
}), jsx(Wrapper, null, jsx(Calendar, {
|
|
79
81
|
day: day,
|
|
80
82
|
month: month,
|
|
81
83
|
year: year,
|
|
@@ -93,7 +95,7 @@ export const Menu = ({
|
|
|
93
95
|
locale: selectProps.calendarLocale,
|
|
94
96
|
testId: selectProps.testId && `${selectProps.testId}--calendar`,
|
|
95
97
|
weekStartDay: selectProps.calendarWeekStartDay
|
|
96
|
-
})),
|
|
98
|
+
}))),
|
|
97
99
|
testId: selectProps.testId
|
|
98
100
|
}));
|
|
99
101
|
};
|
|
@@ -33,7 +33,7 @@ import { Menu } from '../internal/menu';
|
|
|
33
33
|
import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date';
|
|
34
34
|
import { makeSingleValue } from '../internal/single-value';
|
|
35
35
|
var packageName = "@atlaskit/datetime-picker";
|
|
36
|
-
var packageVersion = "16.0
|
|
36
|
+
var packageVersion = "16.1.0";
|
|
37
37
|
var dropdownIndicatorStyles = xcss({
|
|
38
38
|
minWidth: "var(--ds-space-300, 24px)",
|
|
39
39
|
minHeight: "var(--ds-space-300, 24px)",
|
|
@@ -508,7 +508,8 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
|
|
|
508
508
|
onCalendarSelect: this.onCalendarSelect,
|
|
509
509
|
calendarLocale: locale,
|
|
510
510
|
calendarWeekStartDay: weekStartDay,
|
|
511
|
-
shouldSetFocusOnCurrentDay: this.state.shouldSetFocusOnCurrentDay
|
|
511
|
+
shouldSetFocusOnCurrentDay: this.state.shouldSetFocusOnCurrentDay,
|
|
512
|
+
menuInnerWrapper: this.props.menuInnerWrapper
|
|
512
513
|
};
|
|
513
514
|
|
|
514
515
|
// @ts-ignore -- Argument of type 'StylesConfig<OptionType, false, GroupBase<OptionType>>' is not assignable to parameter of type 'StylesConfig<OptionType, boolean, GroupBase<OptionType>>'.
|
|
@@ -611,7 +612,8 @@ var DatePickerComponent = /*#__PURE__*/function (_Component) {
|
|
|
611
612
|
onCalendarChange: calendarProps.onCalendarChange,
|
|
612
613
|
onCalendarSelect: calendarProps.onCalendarSelect,
|
|
613
614
|
previousMonthLabel: previousMonthLabel,
|
|
614
|
-
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay
|
|
615
|
+
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
|
|
616
|
+
menuInnerWrapper: calendarProps.menuInnerWrapper
|
|
615
617
|
})), shouldShowCalendarButton && !isDisabled ? jsx(IdProvider, {
|
|
616
618
|
prefix: "open-calendar-label--"
|
|
617
619
|
}, function (_ref3) {
|
|
@@ -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 = "16.0
|
|
32
|
+
var packageVersion = "16.1.0";
|
|
33
33
|
var analyticsAttributes = {
|
|
34
34
|
componentName: 'datePicker',
|
|
35
35
|
packageName: packageName,
|
|
@@ -500,7 +500,12 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
500
500
|
onCalendarSelect: onCalendarSelect,
|
|
501
501
|
calendarLocale: locale,
|
|
502
502
|
calendarWeekStartDay: weekStartDay,
|
|
503
|
-
shouldSetFocusOnCurrentDay: shouldSetFocusOnCurrentDay
|
|
503
|
+
shouldSetFocusOnCurrentDay: shouldSetFocusOnCurrentDay,
|
|
504
|
+
/**
|
|
505
|
+
* This overrides the inner wrapper the Calendar.
|
|
506
|
+
* @private Please use this with extreme caution, this API may be changed in the future.
|
|
507
|
+
*/
|
|
508
|
+
menuInnerWrapper: props === null || props === void 0 ? void 0 : props.menuInnerWrapper
|
|
504
509
|
};
|
|
505
510
|
|
|
506
511
|
// @ts-ignore -- Argument of type 'StylesConfig<OptionType, false, GroupBase<OptionType>>' is not assignable to parameter of type 'StylesConfig<OptionType, boolean, GroupBase<OptionType>>'.
|
|
@@ -606,7 +611,8 @@ var DatePicker = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
606
611
|
onCalendarChange: calendarProps.onCalendarChange,
|
|
607
612
|
onCalendarSelect: calendarProps.onCalendarSelect,
|
|
608
613
|
previousMonthLabel: previousMonthLabel,
|
|
609
|
-
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay
|
|
614
|
+
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay,
|
|
615
|
+
menuInnerWrapper: calendarProps.menuInnerWrapper
|
|
610
616
|
})), shouldShowCalendarButton && !isDisabled ? jsx(Box, {
|
|
611
617
|
xcss: [iconContainerStyles, value && !hideIcon ? iconSpacingWithClearButtonStyles : iconSpacingWithoutClearButtonStyles]
|
|
612
618
|
}, jsx(IconButton, {
|
|
@@ -33,7 +33,7 @@ var DatePicker = componentWithCondition(function () {
|
|
|
33
33
|
return fg('dst-date-picker-use-functional-component');
|
|
34
34
|
}, DatePickerNew, DatePickerOld);
|
|
35
35
|
var packageName = "@atlaskit/datetime-picker";
|
|
36
|
-
var packageVersion = "16.0
|
|
36
|
+
var packageVersion = "16.1.0";
|
|
37
37
|
// Make DatePicker 50% the width of DateTimePicker
|
|
38
38
|
// If rendering an icon container, shrink the TimePicker
|
|
39
39
|
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 = "16.0
|
|
30
|
+
var packageVersion = "16.1.0";
|
|
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 = "16.0
|
|
20
|
+
var packageVersion = "16.1.0";
|
|
21
21
|
var menuStyles = {
|
|
22
22
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
23
23
|
position: 'static',
|
|
@@ -4,7 +4,7 @@ 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
|
+
import { Fragment } from 'react';
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { isValid, parseISO } from 'date-fns';
|
|
10
10
|
import Calendar from '@atlaskit/calendar';
|
|
@@ -42,7 +42,8 @@ export var Menu = function Menu(_ref) {
|
|
|
42
42
|
var selectProps = _ref.selectProps,
|
|
43
43
|
innerProps = _ref.innerProps;
|
|
44
44
|
var calendarValue = selectProps.calendarValue,
|
|
45
|
-
calendarView = selectProps.calendarView
|
|
45
|
+
calendarView = selectProps.calendarView,
|
|
46
|
+
MenuInnerWrapper = selectProps.menuInnerWrapper;
|
|
46
47
|
var _getValidDate = getValidDate([calendarValue, calendarView]),
|
|
47
48
|
day = _getValidDate.day,
|
|
48
49
|
month = _getValidDate.month,
|
|
@@ -54,6 +55,7 @@ export var Menu = function Menu(_ref) {
|
|
|
54
55
|
event.stopPropagation();
|
|
55
56
|
event.preventDefault();
|
|
56
57
|
};
|
|
58
|
+
var Wrapper = typeof MenuInnerWrapper === 'function' ? MenuInnerWrapper : Fragment;
|
|
57
59
|
return jsx(Layering, {
|
|
58
60
|
isDisabled: false
|
|
59
61
|
}, jsx(FixedLayer, {
|
|
@@ -71,7 +73,7 @@ export var Menu = function Menu(_ref) {
|
|
|
71
73
|
css: menuStyles
|
|
72
74
|
}, innerProps, {
|
|
73
75
|
onMouseDown: onMenuMouseDown
|
|
74
|
-
}), jsx(Calendar, {
|
|
76
|
+
}), jsx(Wrapper, null, jsx(Calendar, {
|
|
75
77
|
day: day,
|
|
76
78
|
month: month,
|
|
77
79
|
year: year,
|
|
@@ -89,7 +91,7 @@ export var Menu = function Menu(_ref) {
|
|
|
89
91
|
locale: selectProps.calendarLocale,
|
|
90
92
|
testId: selectProps.testId && "".concat(selectProps.testId, "--calendar"),
|
|
91
93
|
weekStartDay: selectProps.calendarWeekStartDay
|
|
92
|
-
})),
|
|
94
|
+
}))),
|
|
93
95
|
testId: selectProps.testId
|
|
94
96
|
}));
|
|
95
97
|
};
|
|
@@ -97,7 +97,7 @@ declare const DatePicker: import("react").ForwardRefExoticComponent<Omit<Pick<Om
|
|
|
97
97
|
onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
98
98
|
onChange: (_value: string) => void;
|
|
99
99
|
onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
100
|
-
} & DatePickerBaseProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "parseInputValue" | "dateFormat" | "formatDisplayLabel" | "placeholder" | "appearance" | "isDisabled" | "innerProps" | "selectProps" | "autoFocus" | "id" | "aria-describedby" | "value" | "testId" | "icon" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "weekStartDay" | "clearControlLabel" | "isInvalid" | "isRequired" | "name" | "spacing" | "isOpen" | "inputLabel" | "inputLabelId" | "openCalendarLabel" | "shouldShowCalendarButton" | "hideIcon"> & {
|
|
100
|
+
} & DatePickerBaseProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "parseInputValue" | "dateFormat" | "formatDisplayLabel" | "placeholder" | "appearance" | "isDisabled" | "innerProps" | "selectProps" | "autoFocus" | "id" | "aria-describedby" | "value" | "testId" | "icon" | "menuInnerWrapper" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "weekStartDay" | "clearControlLabel" | "isInvalid" | "isRequired" | "name" | "spacing" | "isOpen" | "inputLabel" | "inputLabelId" | "openCalendarLabel" | "shouldShowCalendarButton" | "hideIcon"> & {
|
|
101
101
|
disabled?: string[] | undefined;
|
|
102
102
|
defaultValue?: string | undefined;
|
|
103
103
|
onFocus?: (((_event: React.FocusEvent<HTMLInputElement>) => void) & import("react").FocusEventHandler<HTMLInputElement>) | undefined;
|
|
@@ -8,7 +8,7 @@ declare const DatePicker: import("react").FC<Omit<Omit<import("./date-picker-fc"
|
|
|
8
8
|
onBlur: (_event: import("react").FocusEvent<HTMLInputElement, Element>) => void;
|
|
9
9
|
onChange: (_value: string) => void;
|
|
10
10
|
onFocus: (_event: import("react").FocusEvent<HTMLInputElement, Element>) => void;
|
|
11
|
-
} & import("..").DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "parseInputValue" | "dateFormat" | "formatDisplayLabel" | "placeholder" | "appearance" | "isDisabled" | "innerProps" | "selectProps" | "autoFocus" | "id" | "aria-describedby" | "value" | "testId" | "icon" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "weekStartDay" | "clearControlLabel" | "isInvalid" | "isRequired" | "name" | "spacing" | "isOpen" | "inputLabel" | "inputLabelId" | "openCalendarLabel" | "shouldShowCalendarButton" | "hideIcon"> & {
|
|
11
|
+
} & import("..").DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "parseInputValue" | "dateFormat" | "formatDisplayLabel" | "placeholder" | "appearance" | "isDisabled" | "innerProps" | "selectProps" | "autoFocus" | "id" | "aria-describedby" | "value" | "testId" | "icon" | "menuInnerWrapper" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "weekStartDay" | "clearControlLabel" | "isInvalid" | "isRequired" | "name" | "spacing" | "isOpen" | "inputLabel" | "inputLabelId" | "openCalendarLabel" | "shouldShowCalendarButton" | "hideIcon"> & {
|
|
12
12
|
disabled?: string[] | undefined;
|
|
13
13
|
defaultValue?: string | undefined;
|
|
14
14
|
onFocus?: (((_event: import("react").FocusEvent<HTMLInputElement, Element>) => void) & import("react").FocusEventHandler<HTMLInputElement>) | undefined;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -268,6 +268,13 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps, PickerSel
|
|
|
268
268
|
* - `6` saturday
|
|
269
269
|
*/
|
|
270
270
|
weekStartDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
271
|
+
/**
|
|
272
|
+
* This overrides the inner wrapper the Calendar.
|
|
273
|
+
* @private Please use this with extreme caution, this API may be changed in the future.
|
|
274
|
+
*/
|
|
275
|
+
menuInnerWrapper?: React.ComponentType<{
|
|
276
|
+
children: React.ReactNode;
|
|
277
|
+
}>;
|
|
271
278
|
}
|
|
272
279
|
export interface TimePickerBaseProps extends WithAnalyticsEventsProps, PickerSelectProps {
|
|
273
280
|
/**
|
|
@@ -97,7 +97,7 @@ declare const DatePicker: import("react").ForwardRefExoticComponent<Omit<Pick<Om
|
|
|
97
97
|
onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
98
98
|
onChange: (_value: string) => void;
|
|
99
99
|
onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
100
|
-
} & DatePickerBaseProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "parseInputValue" | "dateFormat" | "formatDisplayLabel" | "placeholder" | "appearance" | "isDisabled" | "innerProps" | "selectProps" | "autoFocus" | "id" | "aria-describedby" | "value" | "testId" | "icon" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "weekStartDay" | "clearControlLabel" | "isInvalid" | "isRequired" | "name" | "spacing" | "isOpen" | "inputLabel" | "inputLabelId" | "openCalendarLabel" | "shouldShowCalendarButton" | "hideIcon"> & {
|
|
100
|
+
} & DatePickerBaseProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "parseInputValue" | "dateFormat" | "formatDisplayLabel" | "placeholder" | "appearance" | "isDisabled" | "innerProps" | "selectProps" | "autoFocus" | "id" | "aria-describedby" | "value" | "testId" | "icon" | "menuInnerWrapper" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "weekStartDay" | "clearControlLabel" | "isInvalid" | "isRequired" | "name" | "spacing" | "isOpen" | "inputLabel" | "inputLabelId" | "openCalendarLabel" | "shouldShowCalendarButton" | "hideIcon"> & {
|
|
101
101
|
disabled?: string[] | undefined;
|
|
102
102
|
defaultValue?: string | undefined;
|
|
103
103
|
onFocus?: (((_event: React.FocusEvent<HTMLInputElement>) => void) & import("react").FocusEventHandler<HTMLInputElement>) | undefined;
|
|
@@ -8,7 +8,7 @@ declare const DatePicker: import("react").FC<Omit<Omit<import("./date-picker-fc"
|
|
|
8
8
|
onBlur: (_event: import("react").FocusEvent<HTMLInputElement, Element>) => void;
|
|
9
9
|
onChange: (_value: string) => void;
|
|
10
10
|
onFocus: (_event: import("react").FocusEvent<HTMLInputElement, Element>) => void;
|
|
11
|
-
} & import("..").DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "parseInputValue" | "dateFormat" | "formatDisplayLabel" | "placeholder" | "appearance" | "isDisabled" | "innerProps" | "selectProps" | "autoFocus" | "id" | "aria-describedby" | "value" | "testId" | "icon" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "weekStartDay" | "clearControlLabel" | "isInvalid" | "isRequired" | "name" | "spacing" | "isOpen" | "inputLabel" | "inputLabelId" | "openCalendarLabel" | "shouldShowCalendarButton" | "hideIcon"> & {
|
|
11
|
+
} & import("..").DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "parseInputValue" | "dateFormat" | "formatDisplayLabel" | "placeholder" | "appearance" | "isDisabled" | "innerProps" | "selectProps" | "autoFocus" | "id" | "aria-describedby" | "value" | "testId" | "icon" | "menuInnerWrapper" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "weekStartDay" | "clearControlLabel" | "isInvalid" | "isRequired" | "name" | "spacing" | "isOpen" | "inputLabel" | "inputLabelId" | "openCalendarLabel" | "shouldShowCalendarButton" | "hideIcon"> & {
|
|
12
12
|
disabled?: string[] | undefined;
|
|
13
13
|
defaultValue?: string | undefined;
|
|
14
14
|
onFocus?: (((_event: import("react").FocusEvent<HTMLInputElement, Element>) => void) & import("react").FocusEventHandler<HTMLInputElement>) | undefined;
|
|
@@ -268,6 +268,13 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps, PickerSel
|
|
|
268
268
|
* - `6` saturday
|
|
269
269
|
*/
|
|
270
270
|
weekStartDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
271
|
+
/**
|
|
272
|
+
* This overrides the inner wrapper the Calendar.
|
|
273
|
+
* @private Please use this with extreme caution, this API may be changed in the future.
|
|
274
|
+
*/
|
|
275
|
+
menuInnerWrapper?: React.ComponentType<{
|
|
276
|
+
children: React.ReactNode;
|
|
277
|
+
}>;
|
|
271
278
|
}
|
|
272
279
|
export interface TimePickerBaseProps extends WithAnalyticsEventsProps, PickerSelectProps {
|
|
273
280
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/datetime-picker",
|
|
3
|
-
"version": "16.0
|
|
3
|
+
"version": "16.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/"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/popper": "^7.0.0",
|
|
49
49
|
"@atlaskit/primitives": "^14.1.0",
|
|
50
50
|
"@atlaskit/select": "^20.0.0",
|
|
51
|
-
"@atlaskit/theme": "^
|
|
51
|
+
"@atlaskit/theme": "^18.0.0",
|
|
52
52
|
"@atlaskit/tokens": "^4.3.0",
|
|
53
53
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|