@atlaskit/datetime-picker 11.0.2 → 11.1.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 +33 -0
- package/dist/cjs/components/DatePicker.js +22 -21
- package/dist/cjs/components/DateTimePicker.js +83 -110
- package/dist/cjs/components/TimePicker.js +4 -4
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/internal/index.js +3 -2
- package/dist/cjs/internal/parseTime.js +4 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/DatePicker.js +22 -19
- package/dist/es2019/components/DateTimePicker.js +78 -121
- package/dist/es2019/components/TimePicker.js +3 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/DatePicker.js +24 -20
- package/dist/esm/components/DateTimePicker.js +84 -98
- package/dist/esm/components/TimePicker.js +4 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/components/DatePicker.d.ts +15 -14
- package/dist/types/components/DateTimePicker.d.ts +4 -3
- package/dist/types/components/TimePicker.d.ts +3 -3
- package/dist/types/internal/index.d.ts +1 -0
- package/package.json +13 -6
|
@@ -6,9 +6,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
10
|
-
|
|
11
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
12
9
|
|
|
13
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
11
|
|
|
@@ -18,104 +15,91 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
18
15
|
|
|
19
16
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
20
17
|
|
|
18
|
+
/** @jsx jsx */
|
|
21
19
|
import React from 'react';
|
|
22
|
-
import
|
|
20
|
+
import { css, jsx } from '@emotion/core'; // eslint-disable-next-line no-restricted-imports
|
|
23
21
|
|
|
24
22
|
import { format, isValid, parseISO } from 'date-fns';
|
|
25
23
|
import pick from 'lodash/pick';
|
|
26
24
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
27
25
|
import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
|
|
28
26
|
import { mergeStyles } from '@atlaskit/select';
|
|
29
|
-
import
|
|
27
|
+
import { B100, N0, N20, N30, N500, N70, R400 } from '@atlaskit/theme/colors';
|
|
30
28
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
31
29
|
import { defaultTimes, formatDateTimeZoneIntoIso } from '../internal';
|
|
32
30
|
import DatePicker from './DatePicker';
|
|
33
31
|
import TimePicker from './TimePicker';
|
|
34
32
|
import { convertTokens } from './utils';
|
|
35
33
|
var packageName = "@atlaskit/datetime-picker";
|
|
36
|
-
var packageVersion = "11.
|
|
34
|
+
var packageVersion = "11.1.3";
|
|
37
35
|
/* eslint-disable react/no-unused-prop-types */
|
|
38
36
|
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
var isInvalidBorderStyles = css({
|
|
38
|
+
borderColor: "var(--ds-iconBorder-danger, ".concat(R400, ")")
|
|
39
|
+
});
|
|
40
|
+
var isFocusedBorderStyles = css({
|
|
41
|
+
borderColor: "var(--ds-border-focus, ".concat(B100, ")")
|
|
42
|
+
});
|
|
43
|
+
var isFocusedStyles = css({
|
|
44
|
+
backgroundColor: "var(--ds-background-default, ".concat(N0, ")")
|
|
45
|
+
});
|
|
46
|
+
var subtleBgStyles = css({
|
|
47
|
+
backgroundColor: 'transparent',
|
|
48
|
+
borderColor: 'transparent'
|
|
49
|
+
});
|
|
50
|
+
var hoverStyles = css({
|
|
51
|
+
'&:hover': {
|
|
52
|
+
backgroundColor: "var(--ds-background-default, ".concat(N30, ")"),
|
|
53
|
+
borderColor: "var(--ds-border-neutral, ".concat(N30, ")")
|
|
51
54
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return "border: 2px solid ".concat(color, ";");
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
var getBorderColorHover = function getBorderColorHover(_ref2) {
|
|
61
|
-
var isFocused = _ref2.isFocused,
|
|
62
|
-
isInvalid = _ref2.isInvalid,
|
|
63
|
-
isDisabled = _ref2.isDisabled;
|
|
64
|
-
var color = colors.N30;
|
|
65
|
-
|
|
66
|
-
if (isFocused || isDisabled) {
|
|
67
|
-
return "";
|
|
55
|
+
});
|
|
56
|
+
var isInvalidHoverStyles = css({
|
|
57
|
+
'&:hover': {
|
|
58
|
+
backgroundColor: "var(--ds-background-default, ".concat(N0, ")"),
|
|
59
|
+
borderColor: "var(--ds-iconBorder-danger, ".concat(R400, ")")
|
|
68
60
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
});
|
|
62
|
+
var isDisabledStyles = css({
|
|
63
|
+
'&:hover': {
|
|
64
|
+
cursor: 'default'
|
|
72
65
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (isFocused) {
|
|
83
|
-
color = colors.N0;
|
|
66
|
+
});
|
|
67
|
+
var baseContainerStyles = css({
|
|
68
|
+
display: 'flex',
|
|
69
|
+
backgroundColor: "var(--ds-background-subtleNeutral-resting, ".concat(N20, ")"),
|
|
70
|
+
border: "2px solid ".concat("var(--ds-border-neutral, ".concat(N20, ")")),
|
|
71
|
+
borderRadius: "".concat(borderRadius(), "px"),
|
|
72
|
+
transition: 'background-color 200ms ease-in-out, border-color 200ms ease-in-out',
|
|
73
|
+
'&:hover': {
|
|
74
|
+
cursor: 'pointer'
|
|
84
75
|
}
|
|
85
|
-
|
|
86
|
-
if (appearance === 'subtle') {
|
|
87
|
-
color = 'transparent';
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return "background-color: ".concat(color, ";");
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
var getBackgroundColorHover = function getBackgroundColorHover(_ref4) {
|
|
94
|
-
var isFocused = _ref4.isFocused,
|
|
95
|
-
isInvalid = _ref4.isInvalid,
|
|
96
|
-
isDisabled = _ref4.isDisabled;
|
|
97
|
-
var color = colors.N30;
|
|
98
|
-
|
|
99
|
-
if (isFocused || isDisabled) {
|
|
100
|
-
return "";
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (isInvalid) {
|
|
104
|
-
color = colors.N0;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return "background-color: ".concat(color, ";");
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
var Flex = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n ", "\n border-radius: ", "px;\n display: flex;\n transition: background-color 200ms ease-in-out, border-color 200ms ease-in-out;\n &:hover {\n cursor: ", ";\n ", "\n ", "\n }\n"])), getBackgroundColor, getBorder, borderRadius(), function (props) {
|
|
111
|
-
return props.isDisabled ? 'default' : 'pointer';
|
|
112
|
-
}, getBackgroundColorHover, getBorderColorHover); // Make DatePicker 50% the width of DateTimePicker
|
|
76
|
+
}); // Make DatePicker 50% the width of DateTimePicker
|
|
113
77
|
// If rendering an icon container, shrink the TimePicker
|
|
114
78
|
|
|
115
|
-
var
|
|
116
|
-
|
|
79
|
+
var datePickerContainerStyles = css({
|
|
80
|
+
flexBasis: '50%',
|
|
81
|
+
flexGrow: 1,
|
|
82
|
+
flexShrink: 0
|
|
83
|
+
});
|
|
84
|
+
var timePickerContainerStyles = css({
|
|
85
|
+
flexBasis: '50%',
|
|
86
|
+
flexGrow: 1
|
|
87
|
+
});
|
|
117
88
|
var ICON_PADDING = 2;
|
|
118
|
-
var
|
|
89
|
+
var iconContainerStyles = css({
|
|
90
|
+
display: 'flex',
|
|
91
|
+
paddingTop: "6px",
|
|
92
|
+
paddingRight: "".concat(gridSize(), "px"),
|
|
93
|
+
paddingBottom: "6px",
|
|
94
|
+
paddingLeft: "".concat(ICON_PADDING * 2, "px"),
|
|
95
|
+
alignItems: 'center',
|
|
96
|
+
flexBasis: 'inherit',
|
|
97
|
+
color: "var(--ds-text-lowEmphasis, ".concat(N70, ")"),
|
|
98
|
+
transition: "color 150ms",
|
|
99
|
+
'&:hover': {
|
|
100
|
+
color: "var(--ds-text-mediumEmphasis, ".concat(N500, ")")
|
|
101
|
+
}
|
|
102
|
+
}); // react-select overrides (via @atlaskit/select).
|
|
119
103
|
|
|
120
104
|
var styles = {
|
|
121
105
|
control: function control(style) {
|
|
@@ -244,10 +228,10 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
244
228
|
}
|
|
245
229
|
}, {
|
|
246
230
|
key: "onValueChange",
|
|
247
|
-
value: function onValueChange(
|
|
248
|
-
var dateValue =
|
|
249
|
-
timeValue =
|
|
250
|
-
zoneValue =
|
|
231
|
+
value: function onValueChange(_ref) {
|
|
232
|
+
var dateValue = _ref.dateValue,
|
|
233
|
+
timeValue = _ref.timeValue,
|
|
234
|
+
zoneValue = _ref.zoneValue;
|
|
251
235
|
this.setState({
|
|
252
236
|
dateValue: dateValue,
|
|
253
237
|
timeValue: timeValue,
|
|
@@ -255,9 +239,9 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
255
239
|
});
|
|
256
240
|
|
|
257
241
|
if (dateValue && timeValue) {
|
|
258
|
-
var
|
|
242
|
+
var value = formatDateTimeZoneIntoIso(dateValue, timeValue, zoneValue);
|
|
259
243
|
|
|
260
|
-
var _this$parseValue = this.parseValue(
|
|
244
|
+
var _this$parseValue = this.parseValue(value, dateValue, timeValue, zoneValue),
|
|
261
245
|
parsedZone = _this$parseValue.zoneValue;
|
|
262
246
|
|
|
263
247
|
var valueWithValidZone = formatDateTimeZoneIntoIso(dateValue, timeValue, parsedZone);
|
|
@@ -322,17 +306,18 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
322
306
|
|
|
323
307
|
|
|
324
308
|
var isClearable = Boolean(dateValue || timeValue);
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
appearance: this.props.appearance,
|
|
309
|
+
var notFocusedOrIsDisabled = !(isFocused || isDisabled);
|
|
310
|
+
return jsx("div", _extends({
|
|
311
|
+
css: [baseContainerStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, bothProps.appearance === 'subtle' && subtleBgStyles, isFocused && isFocusedBorderStyles, bothProps.isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (bothProps.isInvalid ? isInvalidHoverStyles : hoverStyles)]
|
|
312
|
+
}, innerProps, {
|
|
330
313
|
"data-testid": testId
|
|
331
|
-
}),
|
|
314
|
+
}), jsx("input", {
|
|
332
315
|
name: name,
|
|
333
316
|
type: "hidden",
|
|
334
317
|
value: value
|
|
335
|
-
}),
|
|
318
|
+
}), jsx("div", {
|
|
319
|
+
css: datePickerContainerStyles
|
|
320
|
+
}, jsx(DatePicker, _extends({}, bothProps, {
|
|
336
321
|
autoFocus: autoFocus,
|
|
337
322
|
dateFormat: dateFormat,
|
|
338
323
|
hideIcon: true,
|
|
@@ -342,7 +327,9 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
342
327
|
value: dateValue,
|
|
343
328
|
locale: locale,
|
|
344
329
|
testId: testId && "".concat(testId, "--datepicker")
|
|
345
|
-
}, datePickerProps))),
|
|
330
|
+
}, datePickerProps))), jsx("div", {
|
|
331
|
+
css: timePickerContainerStyles
|
|
332
|
+
}, jsx(TimePicker, _extends({}, bothProps, {
|
|
346
333
|
hideIcon: true,
|
|
347
334
|
onChange: this.onTimeChange,
|
|
348
335
|
selectProps: mergedTimePickerSelectProps,
|
|
@@ -352,13 +339,12 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
352
339
|
timeFormat: timeFormat,
|
|
353
340
|
locale: locale,
|
|
354
341
|
testId: testId && "".concat(testId, "--timepicker")
|
|
355
|
-
}, timePickerProps))), isClearable && !isDisabled ?
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
React.createElement(IconContainer, {
|
|
342
|
+
}, timePickerProps))), isClearable && !isDisabled ? // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
343
|
+
jsx("div", {
|
|
344
|
+
css: iconContainerStyles,
|
|
359
345
|
onClick: this.onClear,
|
|
360
346
|
"data-testid": testId && "".concat(testId, "--icon--container")
|
|
361
|
-
},
|
|
347
|
+
}, jsx(SelectClearIcon, {
|
|
362
348
|
size: "small",
|
|
363
349
|
primaryColor: "inherit",
|
|
364
350
|
label: "clear"
|
|
@@ -30,7 +30,7 @@ import FixedLayer from '../internal/FixedLayer';
|
|
|
30
30
|
import parseTime from '../internal/parseTime';
|
|
31
31
|
import { convertTokens } from './utils';
|
|
32
32
|
var packageName = "@atlaskit/datetime-picker";
|
|
33
|
-
var packageVersion = "11.
|
|
33
|
+
var packageVersion = "11.1.3";
|
|
34
34
|
var menuStyles = {
|
|
35
35
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
36
36
|
position: 'static',
|
|
@@ -212,7 +212,7 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
212
212
|
|
|
213
213
|
_defineProperty(_assertThisInitialized(_this), "getSubtleControlStyles", function (selectStyles) {
|
|
214
214
|
return !selectStyles.control ? {
|
|
215
|
-
border: "2px solid ".concat(_this.getSafeState().isFocused ? "".concat(B100) : "transparent"),
|
|
215
|
+
border: "2px solid ".concat(_this.getSafeState().isFocused ? "var(--ds-border-focus, ".concat(B100, ")") : "transparent"),
|
|
216
216
|
backgroundColor: 'transparent',
|
|
217
217
|
padding: '1px'
|
|
218
218
|
} : {};
|
|
@@ -264,8 +264,8 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
_createClass(TimePicker, [{
|
|
267
|
-
key: "
|
|
268
|
-
value: function
|
|
267
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
268
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
269
269
|
if (this.props.locale !== nextProps.locale) {
|
|
270
270
|
this.setState({
|
|
271
271
|
l10n: createLocalizationProvider(nextProps.locale)
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { Component } from 'react';
|
|
2
3
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
4
|
import { CalendarRef } from '@atlaskit/calendar';
|
|
4
5
|
import { LocalizationProvider } from '@atlaskit/locale';
|
|
@@ -23,7 +24,7 @@ export interface Props extends WithAnalyticsEventsProps {
|
|
|
23
24
|
disabled?: string[];
|
|
24
25
|
/**
|
|
25
26
|
A filter function for disabling dates on the calendar. This does not affect what users can type into the picker.
|
|
26
|
-
|
|
27
|
+
|
|
27
28
|
The function is called with a date string in the format `YYYY-MM-DD` and should return `true` if the date should be disabled.
|
|
28
29
|
*/
|
|
29
30
|
disabledDateFilter?: (date: string) => boolean;
|
|
@@ -62,7 +63,7 @@ export interface Props extends WithAnalyticsEventsProps {
|
|
|
62
63
|
selectProps?: SelectProps;
|
|
63
64
|
/**
|
|
64
65
|
The spacing for the select control.
|
|
65
|
-
|
|
66
|
+
|
|
66
67
|
Compact is `gridSize() * 4`, default is `gridSize * 5`.
|
|
67
68
|
*/
|
|
68
69
|
spacing?: Spacing;
|
|
@@ -120,7 +121,7 @@ declare const datePickerDefaultProps: {
|
|
|
120
121
|
disabled: string[];
|
|
121
122
|
disabledDateFilter: (_: string) => boolean;
|
|
122
123
|
hideIcon: boolean;
|
|
123
|
-
icon:
|
|
124
|
+
icon: import("react").ComponentType<import("react-select").IndicatorProps<OptionType, false, import("@atlaskit/select").GroupType<OptionType>>>;
|
|
124
125
|
id: string;
|
|
125
126
|
innerProps: {};
|
|
126
127
|
isDisabled: boolean;
|
|
@@ -133,7 +134,7 @@ declare const datePickerDefaultProps: {
|
|
|
133
134
|
spacing: Spacing;
|
|
134
135
|
locale: string;
|
|
135
136
|
};
|
|
136
|
-
declare class DatePicker extends
|
|
137
|
+
declare class DatePicker extends Component<DatePickerProps, State> {
|
|
137
138
|
static defaultProps: {
|
|
138
139
|
appearance: Appearance;
|
|
139
140
|
autoFocus: boolean;
|
|
@@ -142,15 +143,15 @@ declare class DatePicker extends React.Component<DatePickerProps, State> {
|
|
|
142
143
|
disabled: string[];
|
|
143
144
|
disabledDateFilter: (_: string) => boolean;
|
|
144
145
|
hideIcon: boolean;
|
|
145
|
-
icon:
|
|
146
|
+
icon: import("react").ComponentType<import("react-select").IndicatorProps<OptionType, false, import("@atlaskit/select").GroupType<OptionType>>>;
|
|
146
147
|
id: string;
|
|
147
148
|
innerProps: {};
|
|
148
149
|
isDisabled: boolean;
|
|
149
150
|
isInvalid: boolean;
|
|
150
151
|
name: string;
|
|
151
|
-
onBlur: (event:
|
|
152
|
+
onBlur: (event: import("react").FocusEvent<HTMLInputElement>) => void;
|
|
152
153
|
onChange: (value: string) => void;
|
|
153
|
-
onFocus: (event:
|
|
154
|
+
onFocus: (event: import("react").FocusEvent<HTMLInputElement>) => void;
|
|
154
155
|
selectProps: {};
|
|
155
156
|
spacing: Spacing;
|
|
156
157
|
locale: string;
|
|
@@ -158,7 +159,7 @@ declare class DatePicker extends React.Component<DatePickerProps, State> {
|
|
|
158
159
|
calendarRef: CalendarRef | null;
|
|
159
160
|
containerRef: HTMLElement | null;
|
|
160
161
|
constructor(props: any);
|
|
161
|
-
|
|
162
|
+
UNSAFE_componentWillReceiveProps(nextProps: Readonly<DatePickerProps>): void;
|
|
162
163
|
getSafeState: () => {
|
|
163
164
|
inputValue: any;
|
|
164
165
|
isOpen: boolean;
|
|
@@ -209,7 +210,7 @@ declare class DatePicker extends React.Component<DatePickerProps, State> {
|
|
|
209
210
|
render(): JSX.Element;
|
|
210
211
|
}
|
|
211
212
|
export { DatePicker as DatePickerWithoutAnalytics };
|
|
212
|
-
declare const _default:
|
|
213
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Pick<DatePickerProps, "testId" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "disabledDateFilter" | "hideIcon" | "id" | "isDisabled" | "isInvalid" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "locale" | "maxDate" | "minDate" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "value" | "dateFormat" | "placeholder" | "weekStartDay">, "testId" | "maxDate" | "minDate" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "value" | "dateFormat" | "placeholder" | "weekStartDay"> & Partial<Pick<Pick<DatePickerProps, "testId" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "disabledDateFilter" | "hideIcon" | "id" | "isDisabled" | "isInvalid" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "locale" | "maxDate" | "minDate" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "value" | "dateFormat" | "placeholder" | "weekStartDay">, "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "disabledDateFilter" | "hideIcon" | "id" | "isDisabled" | "isInvalid" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "locale">> & Partial<Pick<{
|
|
213
214
|
appearance: Appearance;
|
|
214
215
|
autoFocus: boolean;
|
|
215
216
|
defaultIsOpen: boolean;
|
|
@@ -217,17 +218,17 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Pick<DatePicke
|
|
|
217
218
|
disabled: string[];
|
|
218
219
|
disabledDateFilter: (_: string) => boolean;
|
|
219
220
|
hideIcon: boolean;
|
|
220
|
-
icon:
|
|
221
|
+
icon: import("react").ComponentType<import("react-select").IndicatorProps<OptionType, false, import("@atlaskit/select").GroupType<OptionType>>>;
|
|
221
222
|
id: string;
|
|
222
223
|
innerProps: {};
|
|
223
224
|
isDisabled: boolean;
|
|
224
225
|
isInvalid: boolean;
|
|
225
226
|
name: string;
|
|
226
|
-
onBlur: (event:
|
|
227
|
+
onBlur: (event: import("react").FocusEvent<HTMLInputElement>) => void;
|
|
227
228
|
onChange: (value: string) => void;
|
|
228
|
-
onFocus: (event:
|
|
229
|
+
onFocus: (event: import("react").FocusEvent<HTMLInputElement>) => void;
|
|
229
230
|
selectProps: {};
|
|
230
231
|
spacing: Spacing;
|
|
231
232
|
locale: string;
|
|
232
|
-
}, never>> &
|
|
233
|
+
}, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "disabledDateFilter" | "hideIcon" | "id" | "isDisabled" | "isInvalid" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "locale" | "maxDate" | "minDate" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "value" | "dateFormat" | "placeholder" | "weekStartDay" | "key" | "analyticsContext"> & import("react").RefAttributes<any>>;
|
|
233
234
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
4
|
import { SelectProps } from '@atlaskit/select';
|
|
@@ -63,7 +64,7 @@ export interface Props extends WithAnalyticsEventsProps {
|
|
|
63
64
|
/**
|
|
64
65
|
* The spacing for the select control.
|
|
65
66
|
*
|
|
66
|
-
* Compact is `gridSize() * 4`, default is `gridSize * 5`.
|
|
67
|
+
* Compact is `gridSize() * 4`, default is `gridSize() * 5`.
|
|
67
68
|
*/
|
|
68
69
|
spacing?: Spacing;
|
|
69
70
|
/** Locale used for formatting dates and times. See [DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat). */
|
|
@@ -154,7 +155,7 @@ declare class DateTimePicker extends React.Component<DateTimePickerProps, State>
|
|
|
154
155
|
render(): JSX.Element;
|
|
155
156
|
}
|
|
156
157
|
export { DateTimePicker as DateTimePickerWithoutAnalytics };
|
|
157
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Pick<DateTimePickerProps, "testId" | "appearance" | "
|
|
158
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Pick<DateTimePickerProps, "testId" | "appearance" | "innerProps" | "autoFocus" | "defaultValue" | "hideIcon" | "id" | "isDisabled" | "isInvalid" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "locale" | "value" | "dateFormat" | "times" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "datePickerSelectProps" | "timePickerSelectProps" | "parseValue">, "testId" | "hideIcon" | "value" | "dateFormat" | "timeFormat" | "parseValue"> & Partial<Pick<Pick<DateTimePickerProps, "testId" | "appearance" | "innerProps" | "autoFocus" | "defaultValue" | "hideIcon" | "id" | "isDisabled" | "isInvalid" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "locale" | "value" | "dateFormat" | "times" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "datePickerSelectProps" | "timePickerSelectProps" | "parseValue">, "appearance" | "innerProps" | "autoFocus" | "defaultValue" | "id" | "isDisabled" | "isInvalid" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "locale" | "times" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "datePickerSelectProps" | "timePickerSelectProps">> & Partial<Pick<{
|
|
158
159
|
appearance: string;
|
|
159
160
|
autoFocus: boolean;
|
|
160
161
|
isDisabled: boolean;
|
|
@@ -174,5 +175,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Pick<DateTimeP
|
|
|
174
175
|
times: string[];
|
|
175
176
|
spacing: string;
|
|
176
177
|
locale: string;
|
|
177
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "appearance" | "
|
|
178
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "appearance" | "innerProps" | "autoFocus" | "defaultValue" | "hideIcon" | "id" | "isDisabled" | "isInvalid" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "locale" | "value" | "dateFormat" | "key" | "analyticsContext" | "times" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "datePickerSelectProps" | "timePickerSelectProps" | "parseValue"> & React.RefAttributes<any>>;
|
|
178
179
|
export default _default;
|
|
@@ -135,7 +135,7 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
|
|
|
135
135
|
isFocused: boolean;
|
|
136
136
|
l10n: LocalizationProvider;
|
|
137
137
|
};
|
|
138
|
-
|
|
138
|
+
UNSAFE_componentWillReceiveProps(nextProps: TimePickerProps): void;
|
|
139
139
|
getSafeState: () => State;
|
|
140
140
|
getOptions(): Array<Option>;
|
|
141
141
|
onChange: (v: {
|
|
@@ -170,7 +170,7 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
|
|
|
170
170
|
render(): JSX.Element;
|
|
171
171
|
}
|
|
172
172
|
export { TimePicker as TimePickerWithoutAnalytics };
|
|
173
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Pick<TimePickerProps, "testId" | "appearance" | "
|
|
173
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Pick<TimePickerProps, "testId" | "appearance" | "selectProps" | "innerProps" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "hideIcon" | "id" | "isDisabled" | "isInvalid" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "locale" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "value" | "placeholder" | "times" | "timeIsEditable" | "timeFormat">, "testId" | "isOpen" | "formatDisplayLabel" | "value" | "placeholder" | "timeFormat"> & Partial<Pick<Pick<TimePickerProps, "testId" | "appearance" | "selectProps" | "innerProps" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "hideIcon" | "id" | "isDisabled" | "isInvalid" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "locale" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "value" | "placeholder" | "times" | "timeIsEditable" | "timeFormat">, "appearance" | "selectProps" | "innerProps" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "hideIcon" | "id" | "isDisabled" | "isInvalid" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "locale" | "parseInputValue" | "times" | "timeIsEditable">> & Partial<Pick<{
|
|
174
174
|
appearance: Appearance;
|
|
175
175
|
autoFocus: boolean;
|
|
176
176
|
defaultIsOpen: boolean;
|
|
@@ -190,5 +190,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Pick<TimePicke
|
|
|
190
190
|
times: string[];
|
|
191
191
|
timeIsEditable: boolean;
|
|
192
192
|
locale: string;
|
|
193
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "appearance" | "
|
|
193
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "appearance" | "selectProps" | "innerProps" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "hideIcon" | "id" | "isDisabled" | "isInvalid" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "locale" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "value" | "placeholder" | "key" | "analyticsContext" | "times" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
|
|
194
194
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/datetime-picker",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.1.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/"
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"atlassian": {
|
|
18
18
|
"team": "Design System Team",
|
|
19
19
|
"deprecatedAutoEntryPoints": true,
|
|
20
|
-
"inPublicMirror": true,
|
|
21
20
|
"releaseModel": "scheduled",
|
|
22
21
|
"website": {
|
|
23
22
|
"name": "Date time picker"
|
|
@@ -31,10 +30,11 @@
|
|
|
31
30
|
"@atlaskit/popper": "^5.2.0",
|
|
32
31
|
"@atlaskit/select": "^15.2.0",
|
|
33
32
|
"@atlaskit/theme": "^12.0.0",
|
|
33
|
+
"@atlaskit/tokens": "^0.4.0",
|
|
34
34
|
"@babel/runtime": "^7.0.0",
|
|
35
|
-
"@emotion/
|
|
35
|
+
"@emotion/core": "^10.0.9",
|
|
36
36
|
"date-fns": "^2.17.0",
|
|
37
|
-
"lodash": "^4.17.
|
|
37
|
+
"lodash": "^4.17.21",
|
|
38
38
|
"react-scrolllock": "^5.0.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"@atlaskit/button": "^16.0.0",
|
|
46
46
|
"@atlaskit/docs": "*",
|
|
47
47
|
"@atlaskit/field-base": "^15.0.5",
|
|
48
|
-
"@atlaskit/field-range": "^9.0.0",
|
|
49
48
|
"@atlaskit/form": "^8.4.0",
|
|
50
|
-
"@atlaskit/modal-dialog": "^12.
|
|
49
|
+
"@atlaskit/modal-dialog": "^12.2.0",
|
|
50
|
+
"@atlaskit/range": "^5.0.11",
|
|
51
51
|
"@atlaskit/section-message": "^6.0.0",
|
|
52
52
|
"@atlaskit/ssr": "*",
|
|
53
53
|
"@atlaskit/textfield": "^5.0.0",
|
|
@@ -68,6 +68,13 @@
|
|
|
68
68
|
"techstack": {
|
|
69
69
|
"@atlassian/frontend": {
|
|
70
70
|
"import-structure": "atlassian-conventions"
|
|
71
|
+
},
|
|
72
|
+
"@repo/internal": {
|
|
73
|
+
"styling": [
|
|
74
|
+
"static",
|
|
75
|
+
"emotion"
|
|
76
|
+
],
|
|
77
|
+
"theming": "tokens"
|
|
71
78
|
}
|
|
72
79
|
},
|
|
73
80
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|