@atlaskit/datetime-picker 12.1.4 → 12.2.1
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 +20 -0
- package/dist/cjs/components/date-picker.js +10 -10
- package/dist/cjs/components/date-time-picker.js +23 -23
- package/dist/cjs/components/time-picker.js +4 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/date-picker.js +3 -3
- package/dist/es2019/components/date-time-picker.js +2 -2
- package/dist/es2019/components/time-picker.js +4 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/date-picker.js +3 -3
- package/dist/esm/components/date-time-picker.js +2 -2
- package/dist/esm/components/time-picker.js +4 -5
- package/dist/esm/version.json +1 -1
- package/dist/types/components/date-picker.d.ts +4 -3
- package/dist/types/components/date-time-picker.d.ts +4 -3
- package/dist/types/components/time-picker.d.ts +2 -2
- package/dist/types-ts4.0/components/date-picker.d.ts +288 -0
- package/dist/types-ts4.0/components/date-time-picker.d.ts +218 -0
- package/dist/types-ts4.0/components/time-picker.d.ts +228 -0
- package/dist/types-ts4.0/components/utils.d.ts +1 -0
- package/dist/types-ts4.0/index.d.ts +7 -0
- package/dist/types-ts4.0/internal/fixed-layer.d.ts +33 -0
- package/dist/types-ts4.0/internal/index.d.ts +10 -0
- package/dist/types-ts4.0/internal/parse-time.d.ts +14 -0
- package/dist/types-ts4.0/types.d.ts +3 -0
- package/package.json +19 -12
- package/types/package.json +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/datetime-picker
|
|
2
2
|
|
|
3
|
+
## 12.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
8
|
+
|
|
9
|
+
## 12.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`a91fbaf0552`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a91fbaf0552) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`0fbb2840aba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0fbb2840aba) - Add isInvalid prop to `@atlastkit/Select`. The prop indicates whether if the component is in the error state. If true, it visually shows a red border around the input.
|
|
18
|
+
|
|
19
|
+
This replaces validationState to make Select more consistent like other components that uses isInvalid prop.
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 12.1.4
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -29,7 +29,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
29
29
|
|
|
30
30
|
var _react = require("react");
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _react2 = require("@emotion/react");
|
|
33
33
|
|
|
34
34
|
var _dateFns = require("date-fns");
|
|
35
35
|
|
|
@@ -68,7 +68,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
68
68
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
69
69
|
|
|
70
70
|
var packageName = "@atlaskit/datetime-picker";
|
|
71
|
-
var packageVersion = "12.1
|
|
71
|
+
var packageVersion = "12.2.1";
|
|
72
72
|
/* eslint-disable react/no-unused-prop-types */
|
|
73
73
|
|
|
74
74
|
function getDateObj(date) {
|
|
@@ -84,7 +84,7 @@ function getValidDate(iso) {
|
|
|
84
84
|
return (0, _dateFns.isValid)(date) ? getDateObj(date) : {};
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
var menuStyles = (0,
|
|
87
|
+
var menuStyles = (0, _react2.css)({
|
|
88
88
|
zIndex: _constants.layers.dialog(),
|
|
89
89
|
backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N20, ")"),
|
|
90
90
|
borderRadius: "".concat((0, _constants.borderRadius)(), "px"),
|
|
@@ -95,12 +95,12 @@ var menuStyles = (0, _core.css)({
|
|
|
95
95
|
var Menu = function Menu(_ref) {
|
|
96
96
|
var selectProps = _ref.selectProps,
|
|
97
97
|
innerProps = _ref.innerProps;
|
|
98
|
-
return (0,
|
|
98
|
+
return (0, _react2.jsx)(_fixedLayer.default, {
|
|
99
99
|
inputValue: selectProps.inputValue,
|
|
100
100
|
containerRef: selectProps.calendarContainerRef,
|
|
101
|
-
content: (0,
|
|
101
|
+
content: (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
102
102
|
css: menuStyles
|
|
103
|
-
}, innerProps), (0,
|
|
103
|
+
}, innerProps), (0, _react2.jsx)(_calendar.default, (0, _extends2.default)({}, getValidDate(selectProps.calendarValue), getValidDate(selectProps.calendarView), {
|
|
104
104
|
disabled: selectProps.calendarDisabled,
|
|
105
105
|
disabledDateFilter: selectProps.calendarDisabledDateFilter,
|
|
106
106
|
minDate: selectProps.calendarMinDate,
|
|
@@ -536,20 +536,20 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
536
536
|
nextMonthLabel: nextMonthLabel,
|
|
537
537
|
previousMonthLabel: previousMonthLabel
|
|
538
538
|
};
|
|
539
|
-
return (0,
|
|
539
|
+
return (0, _react2.jsx)("div", (0, _extends2.default)({}, innerProps, {
|
|
540
540
|
role: "presentation",
|
|
541
541
|
onClick: this.onInputClick,
|
|
542
542
|
onInput: this.onSelectInput,
|
|
543
543
|
onKeyDown: this.onSelectKeyDown,
|
|
544
544
|
ref: this.getContainerRef,
|
|
545
545
|
"data-testid": testId && "".concat(testId, "--container")
|
|
546
|
-
}), (0,
|
|
546
|
+
}), (0, _react2.jsx)("input", {
|
|
547
547
|
id: selectProps.inputId,
|
|
548
548
|
name: name,
|
|
549
549
|
type: "hidden",
|
|
550
550
|
value: value,
|
|
551
551
|
"data-testid": testId && "".concat(testId, "--input")
|
|
552
|
-
}), (0,
|
|
552
|
+
}), (0, _react2.jsx)(_select.default, (0, _extends2.default)({
|
|
553
553
|
appearance: this.props.appearance,
|
|
554
554
|
enableAnimation: false,
|
|
555
555
|
menuIsOpen: menuIsOpen,
|
|
@@ -582,7 +582,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
582
582
|
}, selectProps, calendarProps, {
|
|
583
583
|
isClearable: true,
|
|
584
584
|
spacing: spacing,
|
|
585
|
-
|
|
585
|
+
isInvalid: isInvalid,
|
|
586
586
|
testId: testId
|
|
587
587
|
})));
|
|
588
588
|
}
|
|
@@ -25,7 +25,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
25
25
|
|
|
26
26
|
var _react = _interopRequireDefault(require("react"));
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _react2 = require("@emotion/react");
|
|
29
29
|
|
|
30
30
|
var _dateFns = require("date-fns");
|
|
31
31
|
|
|
@@ -58,27 +58,27 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
58
58
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
59
59
|
|
|
60
60
|
var packageName = "@atlaskit/datetime-picker";
|
|
61
|
-
var packageVersion = "12.1
|
|
61
|
+
var packageVersion = "12.2.1";
|
|
62
62
|
/* eslint-disable react/no-unused-prop-types */
|
|
63
63
|
|
|
64
|
-
var isInvalidBorderStyles = (0,
|
|
64
|
+
var isInvalidBorderStyles = (0, _react2.css)({
|
|
65
65
|
borderColor: "var(--ds-border-danger, ".concat(_colors.R400, ")")
|
|
66
66
|
});
|
|
67
|
-
var isFocusedBorderStyles = (0,
|
|
67
|
+
var isFocusedBorderStyles = (0, _react2.css)({
|
|
68
68
|
borderColor: "var(--ds-border-focused, ".concat(_colors.B100, ")")
|
|
69
69
|
});
|
|
70
|
-
var isFocusedStyles = (0,
|
|
70
|
+
var isFocusedStyles = (0, _react2.css)({
|
|
71
71
|
backgroundColor: "var(--ds-background-input-pressed, ".concat(_colors.N0, ")")
|
|
72
72
|
});
|
|
73
|
-
var subtleBgStyles = (0,
|
|
73
|
+
var subtleBgStyles = (0, _react2.css)({
|
|
74
74
|
backgroundColor: 'transparent',
|
|
75
75
|
borderColor: 'transparent'
|
|
76
76
|
});
|
|
77
|
-
var subtleFocusedBgStyles = (0,
|
|
77
|
+
var subtleFocusedBgStyles = (0, _react2.css)({
|
|
78
78
|
backgroundColor: "var(--ds-background-input-pressed, transparent)",
|
|
79
79
|
borderColor: 'transparent'
|
|
80
80
|
});
|
|
81
|
-
var noBgStyles = (0,
|
|
81
|
+
var noBgStyles = (0, _react2.css)({
|
|
82
82
|
backgroundColor: 'transparent',
|
|
83
83
|
borderColor: 'transparent',
|
|
84
84
|
'&:hover': {
|
|
@@ -86,24 +86,24 @@ var noBgStyles = (0, _core.css)({
|
|
|
86
86
|
borderColor: 'transparent'
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
|
-
var hoverStyles = (0,
|
|
89
|
+
var hoverStyles = (0, _react2.css)({
|
|
90
90
|
'&:hover': {
|
|
91
91
|
backgroundColor: "var(--ds-background-input-hovered, ".concat(_colors.N30, ")"),
|
|
92
92
|
borderColor: "var(--ds-border-input, ".concat(_colors.N30, ")")
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
|
-
var isInvalidHoverStyles = (0,
|
|
95
|
+
var isInvalidHoverStyles = (0, _react2.css)({
|
|
96
96
|
'&:hover': {
|
|
97
97
|
backgroundColor: "var(--ds-background-input-hovered, ".concat(_colors.N0, ")"),
|
|
98
98
|
borderColor: "var(--ds-border-danger, ".concat(_colors.R400, ")")
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
|
-
var isDisabledStyles = (0,
|
|
101
|
+
var isDisabledStyles = (0, _react2.css)({
|
|
102
102
|
'&:hover': {
|
|
103
103
|
cursor: 'default'
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
|
-
var baseContainerStyles = (0,
|
|
106
|
+
var baseContainerStyles = (0, _react2.css)({
|
|
107
107
|
display: 'flex',
|
|
108
108
|
backgroundColor: "var(--ds-background-input, ".concat(_colors.N20, ")"),
|
|
109
109
|
border: "2px solid ".concat("var(--ds-border-input, ".concat(_colors.N20, ")")),
|
|
@@ -115,17 +115,17 @@ var baseContainerStyles = (0, _core.css)({
|
|
|
115
115
|
}); // Make DatePicker 50% the width of DateTimePicker
|
|
116
116
|
// If rendering an icon container, shrink the TimePicker
|
|
117
117
|
|
|
118
|
-
var datePickerContainerStyles = (0,
|
|
118
|
+
var datePickerContainerStyles = (0, _react2.css)({
|
|
119
119
|
flexBasis: '50%',
|
|
120
120
|
flexGrow: 1,
|
|
121
121
|
flexShrink: 0
|
|
122
122
|
});
|
|
123
|
-
var timePickerContainerStyles = (0,
|
|
123
|
+
var timePickerContainerStyles = (0, _react2.css)({
|
|
124
124
|
flexBasis: '50%',
|
|
125
125
|
flexGrow: 1
|
|
126
126
|
});
|
|
127
127
|
var ICON_PADDING = 2;
|
|
128
|
-
var iconContainerStyles = (0,
|
|
128
|
+
var iconContainerStyles = (0, _react2.css)({
|
|
129
129
|
display: 'flex',
|
|
130
130
|
paddingTop: "6px",
|
|
131
131
|
paddingRight: "".concat((0, _constants.gridSize)(), "px"),
|
|
@@ -339,18 +339,18 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
339
339
|
var isClearable = Boolean(dateValue || timeValue);
|
|
340
340
|
var notFocusedOrIsDisabled = !(isFocused || isDisabled);
|
|
341
341
|
var labelId = (datePickerSelectProps === null || datePickerSelectProps === void 0 ? void 0 : datePickerSelectProps.inputId) || (timePickerSelectProps === null || timePickerSelectProps === void 0 ? void 0 : timePickerSelectProps.inputId) || '';
|
|
342
|
-
return (0,
|
|
342
|
+
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
343
343
|
css: [baseContainerStyles, isDisabled && isDisabledStyles, isFocused && isFocusedStyles, bothProps.appearance === 'subtle' && (isFocused ? subtleFocusedBgStyles : subtleBgStyles), isFocused && isFocusedBorderStyles, bothProps.isInvalid && isInvalidBorderStyles, notFocusedOrIsDisabled && (bothProps.isInvalid ? isInvalidHoverStyles : hoverStyles), bothProps.appearance === 'none' && noBgStyles]
|
|
344
344
|
}, innerProps, {
|
|
345
345
|
"data-testid": testId
|
|
346
|
-
}), (0,
|
|
346
|
+
}), (0, _react2.jsx)("input", {
|
|
347
347
|
id: labelId,
|
|
348
348
|
name: name,
|
|
349
349
|
type: "hidden",
|
|
350
350
|
value: value
|
|
351
|
-
}), (0,
|
|
351
|
+
}), (0, _react2.jsx)("div", {
|
|
352
352
|
css: datePickerContainerStyles
|
|
353
|
-
}, (0,
|
|
353
|
+
}, (0, _react2.jsx)(_datePicker.default, (0, _extends2.default)({}, bothProps, {
|
|
354
354
|
autoFocus: autoFocus,
|
|
355
355
|
dateFormat: dateFormat,
|
|
356
356
|
hideIcon: true,
|
|
@@ -360,9 +360,9 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
360
360
|
value: dateValue,
|
|
361
361
|
locale: locale,
|
|
362
362
|
testId: testId && "".concat(testId, "--datepicker")
|
|
363
|
-
}, datePickerProps))), (0,
|
|
363
|
+
}, datePickerProps))), (0, _react2.jsx)("div", {
|
|
364
364
|
css: timePickerContainerStyles
|
|
365
|
-
}, (0,
|
|
365
|
+
}, (0, _react2.jsx)(_timePicker.default, (0, _extends2.default)({}, bothProps, {
|
|
366
366
|
hideIcon: true,
|
|
367
367
|
onChange: this.onTimeChange,
|
|
368
368
|
selectProps: mergedTimePickerSelectProps,
|
|
@@ -373,11 +373,11 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
373
373
|
locale: locale,
|
|
374
374
|
testId: testId && "".concat(testId, "--timepicker")
|
|
375
375
|
}, timePickerProps))), isClearable && !isDisabled ? // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
376
|
-
(0,
|
|
376
|
+
(0, _react2.jsx)("div", {
|
|
377
377
|
css: iconContainerStyles,
|
|
378
378
|
onClick: this.onClear,
|
|
379
379
|
"data-testid": testId && "".concat(testId, "--icon--container")
|
|
380
|
-
}, (0,
|
|
380
|
+
}, (0, _react2.jsx)(_selectClear.default, {
|
|
381
381
|
size: "small",
|
|
382
382
|
primaryColor: "inherit",
|
|
383
383
|
label: "clear"
|
|
@@ -65,7 +65,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
65
65
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
66
66
|
|
|
67
67
|
var packageName = "@atlaskit/datetime-picker";
|
|
68
|
-
var packageVersion = "12.1
|
|
68
|
+
var packageVersion = "12.2.1";
|
|
69
69
|
var menuStyles = {
|
|
70
70
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
71
71
|
position: 'static',
|
|
@@ -320,7 +320,8 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
320
320
|
name = _this$props3.name,
|
|
321
321
|
selectProps = _this$props3.selectProps,
|
|
322
322
|
spacing = _this$props3.spacing,
|
|
323
|
-
testId = _this$props3.testId
|
|
323
|
+
testId = _this$props3.testId,
|
|
324
|
+
isInvalid = _this$props3.isInvalid;
|
|
324
325
|
var ICON_PADDING = 2;
|
|
325
326
|
|
|
326
327
|
var _this$getSafeState3 = this.getSafeState(),
|
|
@@ -328,7 +329,6 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
328
329
|
value = _this$getSafeState3$v === void 0 ? '' : _this$getSafeState3$v,
|
|
329
330
|
isOpen = _this$getSafeState3.isOpen;
|
|
330
331
|
|
|
331
|
-
var validationState = this.props.isInvalid ? 'error' : 'default';
|
|
332
332
|
var _selectProps$styles = selectProps.styles,
|
|
333
333
|
selectStyles = _selectProps$styles === void 0 ? {} : _selectProps$styles,
|
|
334
334
|
otherSelectProps = (0, _objectWithoutProperties2.default)(selectProps, _excluded2);
|
|
@@ -399,7 +399,7 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
399
399
|
value: labelAndValue,
|
|
400
400
|
spacing: spacing,
|
|
401
401
|
fixedLayerRef: this.containerRef,
|
|
402
|
-
|
|
402
|
+
isInvalid: isInvalid,
|
|
403
403
|
testId: testId
|
|
404
404
|
}, otherSelectProps)))
|
|
405
405
|
);
|
package/dist/cjs/version.json
CHANGED
|
@@ -5,7 +5,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
5
5
|
|
|
6
6
|
/** @jsx jsx */
|
|
7
7
|
import { Component } from 'react';
|
|
8
|
-
import { css, jsx } from '@emotion/
|
|
8
|
+
import { css, jsx } from '@emotion/react'; // eslint-disable-next-line no-restricted-imports
|
|
9
9
|
|
|
10
10
|
import { format, isValid, lastDayOfMonth, parseISO } from 'date-fns';
|
|
11
11
|
import pick from 'lodash/pick';
|
|
@@ -20,7 +20,7 @@ import { defaultDateFormat, EmptyClearIndicator, padToTwo, placeholderDatetime }
|
|
|
20
20
|
import FixedLayer from '../internal/fixed-layer';
|
|
21
21
|
import { convertTokens } from './utils';
|
|
22
22
|
const packageName = "@atlaskit/datetime-picker";
|
|
23
|
-
const packageVersion = "12.1
|
|
23
|
+
const packageVersion = "12.2.1";
|
|
24
24
|
/* eslint-disable react/no-unused-prop-types */
|
|
25
25
|
|
|
26
26
|
function getDateObj(date) {
|
|
@@ -534,7 +534,7 @@ class DatePicker extends Component {
|
|
|
534
534
|
}, selectProps, calendarProps, {
|
|
535
535
|
isClearable: true,
|
|
536
536
|
spacing: spacing,
|
|
537
|
-
|
|
537
|
+
isInvalid: isInvalid,
|
|
538
538
|
testId: testId
|
|
539
539
|
})));
|
|
540
540
|
}
|
|
@@ -5,7 +5,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
5
5
|
|
|
6
6
|
/** @jsx jsx */
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import { css, jsx } from '@emotion/
|
|
8
|
+
import { css, jsx } from '@emotion/react'; // eslint-disable-next-line no-restricted-imports
|
|
9
9
|
|
|
10
10
|
import { format, isValid, parseISO } from 'date-fns';
|
|
11
11
|
import pick from 'lodash/pick';
|
|
@@ -19,7 +19,7 @@ import DatePicker from './date-picker';
|
|
|
19
19
|
import TimePicker from './time-picker';
|
|
20
20
|
import { convertTokens } from './utils';
|
|
21
21
|
const packageName = "@atlaskit/datetime-picker";
|
|
22
|
-
const packageVersion = "12.1
|
|
22
|
+
const packageVersion = "12.2.1";
|
|
23
23
|
/* eslint-disable react/no-unused-prop-types */
|
|
24
24
|
|
|
25
25
|
const isInvalidBorderStyles = css({
|
|
@@ -15,7 +15,7 @@ import FixedLayer from '../internal/fixed-layer';
|
|
|
15
15
|
import parseTime from '../internal/parse-time';
|
|
16
16
|
import { convertTokens } from './utils';
|
|
17
17
|
const packageName = "@atlaskit/datetime-picker";
|
|
18
|
-
const packageVersion = "12.1
|
|
18
|
+
const packageVersion = "12.2.1";
|
|
19
19
|
const menuStyles = {
|
|
20
20
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
21
21
|
position: 'static',
|
|
@@ -262,14 +262,14 @@ class TimePicker extends React.Component {
|
|
|
262
262
|
name,
|
|
263
263
|
selectProps,
|
|
264
264
|
spacing,
|
|
265
|
-
testId
|
|
265
|
+
testId,
|
|
266
|
+
isInvalid
|
|
266
267
|
} = this.props;
|
|
267
268
|
const ICON_PADDING = 2;
|
|
268
269
|
const {
|
|
269
270
|
value = '',
|
|
270
271
|
isOpen
|
|
271
272
|
} = this.getSafeState();
|
|
272
|
-
const validationState = this.props.isInvalid ? 'error' : 'default';
|
|
273
273
|
const {
|
|
274
274
|
styles: selectStyles = {},
|
|
275
275
|
...otherSelectProps
|
|
@@ -337,7 +337,7 @@ class TimePicker extends React.Component {
|
|
|
337
337
|
value: labelAndValue,
|
|
338
338
|
spacing: spacing,
|
|
339
339
|
fixedLayerRef: this.containerRef,
|
|
340
|
-
|
|
340
|
+
isInvalid: isInvalid,
|
|
341
341
|
testId: testId
|
|
342
342
|
}, otherSelectProps)))
|
|
343
343
|
);
|
package/dist/es2019/version.json
CHANGED
|
@@ -20,7 +20,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
20
20
|
|
|
21
21
|
/** @jsx jsx */
|
|
22
22
|
import { Component } from 'react';
|
|
23
|
-
import { css, jsx } from '@emotion/
|
|
23
|
+
import { css, jsx } from '@emotion/react'; // eslint-disable-next-line no-restricted-imports
|
|
24
24
|
|
|
25
25
|
import { format, isValid, lastDayOfMonth, parseISO } from 'date-fns';
|
|
26
26
|
import pick from 'lodash/pick';
|
|
@@ -35,7 +35,7 @@ import { defaultDateFormat, EmptyClearIndicator, padToTwo, placeholderDatetime }
|
|
|
35
35
|
import FixedLayer from '../internal/fixed-layer';
|
|
36
36
|
import { convertTokens } from './utils';
|
|
37
37
|
var packageName = "@atlaskit/datetime-picker";
|
|
38
|
-
var packageVersion = "12.1
|
|
38
|
+
var packageVersion = "12.2.1";
|
|
39
39
|
/* eslint-disable react/no-unused-prop-types */
|
|
40
40
|
|
|
41
41
|
function getDateObj(date) {
|
|
@@ -569,7 +569,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
569
569
|
}, selectProps, calendarProps, {
|
|
570
570
|
isClearable: true,
|
|
571
571
|
spacing: spacing,
|
|
572
|
-
|
|
572
|
+
isInvalid: isInvalid,
|
|
573
573
|
testId: testId
|
|
574
574
|
})));
|
|
575
575
|
}
|
|
@@ -19,7 +19,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
19
19
|
|
|
20
20
|
/** @jsx jsx */
|
|
21
21
|
import React from 'react';
|
|
22
|
-
import { css, jsx } from '@emotion/
|
|
22
|
+
import { css, jsx } from '@emotion/react'; // eslint-disable-next-line no-restricted-imports
|
|
23
23
|
|
|
24
24
|
import { format, isValid, parseISO } from 'date-fns';
|
|
25
25
|
import pick from 'lodash/pick';
|
|
@@ -33,7 +33,7 @@ import DatePicker from './date-picker';
|
|
|
33
33
|
import TimePicker from './time-picker';
|
|
34
34
|
import { convertTokens } from './utils';
|
|
35
35
|
var packageName = "@atlaskit/datetime-picker";
|
|
36
|
-
var packageVersion = "12.1
|
|
36
|
+
var packageVersion = "12.2.1";
|
|
37
37
|
/* eslint-disable react/no-unused-prop-types */
|
|
38
38
|
|
|
39
39
|
var isInvalidBorderStyles = css({
|
|
@@ -32,7 +32,7 @@ import FixedLayer from '../internal/fixed-layer';
|
|
|
32
32
|
import parseTime from '../internal/parse-time';
|
|
33
33
|
import { convertTokens } from './utils';
|
|
34
34
|
var packageName = "@atlaskit/datetime-picker";
|
|
35
|
-
var packageVersion = "12.1
|
|
35
|
+
var packageVersion = "12.2.1";
|
|
36
36
|
var menuStyles = {
|
|
37
37
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
38
38
|
position: 'static',
|
|
@@ -302,7 +302,8 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
302
302
|
name = _this$props3.name,
|
|
303
303
|
selectProps = _this$props3.selectProps,
|
|
304
304
|
spacing = _this$props3.spacing,
|
|
305
|
-
testId = _this$props3.testId
|
|
305
|
+
testId = _this$props3.testId,
|
|
306
|
+
isInvalid = _this$props3.isInvalid;
|
|
306
307
|
var ICON_PADDING = 2;
|
|
307
308
|
|
|
308
309
|
var _this$getSafeState3 = this.getSafeState(),
|
|
@@ -310,8 +311,6 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
310
311
|
value = _this$getSafeState3$v === void 0 ? '' : _this$getSafeState3$v,
|
|
311
312
|
isOpen = _this$getSafeState3.isOpen;
|
|
312
313
|
|
|
313
|
-
var validationState = this.props.isInvalid ? 'error' : 'default';
|
|
314
|
-
|
|
315
314
|
var _selectProps$styles = selectProps.styles,
|
|
316
315
|
selectStyles = _selectProps$styles === void 0 ? {} : _selectProps$styles,
|
|
317
316
|
otherSelectProps = _objectWithoutProperties(selectProps, _excluded2);
|
|
@@ -383,7 +382,7 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
383
382
|
value: labelAndValue,
|
|
384
383
|
spacing: spacing,
|
|
385
384
|
fixedLayerRef: this.containerRef,
|
|
386
|
-
|
|
385
|
+
isInvalid: isInvalid,
|
|
387
386
|
testId: testId
|
|
388
387
|
}, otherSelectProps)))
|
|
389
388
|
);
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
3
4
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
5
|
import { CalendarRef } from '@atlaskit/calendar';
|
|
5
6
|
import { LocalizationProvider } from '@atlaskit/locale';
|
|
@@ -260,10 +261,10 @@ declare class DatePicker extends Component<DatePickerProps, State> {
|
|
|
260
261
|
*/
|
|
261
262
|
formatDate: (value: string) => string;
|
|
262
263
|
getPlaceholder: () => string;
|
|
263
|
-
render(): JSX.Element;
|
|
264
|
+
render(): jsx.JSX.Element;
|
|
264
265
|
}
|
|
265
266
|
export { DatePicker as DatePickerWithoutAnalytics };
|
|
266
|
-
declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof WithAnalyticsEventsProps>, "testId" | "maxDate" | "minDate" | "isOpen" | "nextMonthLabel" | "parseInputValue" | "formatDisplayLabel" | "previousMonthLabel" | "value" | "dateFormat" | "placeholder" | "weekStartDay"> & Partial<Pick<Omit<DatePickerProps, keyof WithAnalyticsEventsProps>, "icon" | "disabled" | "appearance" | "
|
|
267
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof WithAnalyticsEventsProps>, "testId" | "maxDate" | "minDate" | "isOpen" | "nextMonthLabel" | "parseInputValue" | "formatDisplayLabel" | "previousMonthLabel" | "value" | "dateFormat" | "placeholder" | "weekStartDay"> & Partial<Pick<Omit<DatePickerProps, keyof WithAnalyticsEventsProps>, "icon" | "disabled" | "appearance" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "disabledDateFilter" | "id" | "innerProps" | "isDisabled" | "name" | "onBlur" | "onChange" | "onFocus" | "selectProps" | "spacing" | "isInvalid" | "hideIcon" | "locale">> & Partial<Pick<{
|
|
267
268
|
appearance: Appearance;
|
|
268
269
|
autoFocus: boolean;
|
|
269
270
|
defaultIsOpen: boolean;
|
|
@@ -283,5 +284,5 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit
|
|
|
283
284
|
selectProps: {};
|
|
284
285
|
spacing: Spacing;
|
|
285
286
|
locale: string;
|
|
286
|
-
}, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "icon" | "disabled" | "appearance" | "
|
|
287
|
+
}, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "icon" | "disabled" | "appearance" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "disabledDateFilter" | "maxDate" | "minDate" | "id" | "innerProps" | "isDisabled" | "isOpen" | "name" | "nextMonthLabel" | "onBlur" | "onChange" | "onFocus" | "parseInputValue" | "formatDisplayLabel" | "previousMonthLabel" | "selectProps" | "spacing" | "value" | "isInvalid" | "hideIcon" | "dateFormat" | "placeholder" | "locale" | "weekStartDay" | "key" | "analyticsContext"> & import("react").RefAttributes<any>>;
|
|
287
288
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
3
4
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
5
|
import { SelectProps } from '@atlaskit/select';
|
|
5
6
|
import { Appearance, Spacing } from '../types';
|
|
@@ -190,10 +191,10 @@ declare class DateTimePicker extends React.Component<DateTimePickerProps, State>
|
|
|
190
191
|
timeValue: string;
|
|
191
192
|
zoneValue: string;
|
|
192
193
|
}): void;
|
|
193
|
-
render(): JSX.Element;
|
|
194
|
+
render(): jsx.JSX.Element;
|
|
194
195
|
}
|
|
195
196
|
export { DateTimePicker as DateTimePickerWithoutAnalytics };
|
|
196
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimePickerProps, keyof WithAnalyticsEventsProps>, "testId" | "value" | "dateFormat" | "timeFormat" | "parseValue"> & Partial<Pick<Omit<DateTimePickerProps, keyof WithAnalyticsEventsProps>, "appearance" | "
|
|
197
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimePickerProps, keyof WithAnalyticsEventsProps>, "testId" | "value" | "dateFormat" | "timeFormat" | "parseValue"> & Partial<Pick<Omit<DateTimePickerProps, keyof WithAnalyticsEventsProps>, "appearance" | "autoFocus" | "defaultValue" | "id" | "innerProps" | "isDisabled" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "isInvalid" | "locale" | "times" | "timeIsEditable" | "datePickerProps" | "timePickerProps" | "datePickerSelectProps" | "timePickerSelectProps">> & Partial<Pick<{
|
|
197
198
|
appearance: string;
|
|
198
199
|
autoFocus: boolean;
|
|
199
200
|
isDisabled: boolean;
|
|
@@ -213,5 +214,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DateTimeP
|
|
|
213
214
|
times: string[];
|
|
214
215
|
spacing: string;
|
|
215
216
|
locale: string;
|
|
216
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "appearance" | "
|
|
217
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "appearance" | "autoFocus" | "defaultValue" | "id" | "innerProps" | "isDisabled" | "name" | "onBlur" | "onChange" | "onFocus" | "spacing" | "value" | "isInvalid" | "dateFormat" | "locale" | "key" | "analyticsContext" | "times" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps"> & React.RefAttributes<any>>;
|
|
217
218
|
export default _default;
|
|
@@ -204,7 +204,7 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
|
|
|
204
204
|
render(): JSX.Element;
|
|
205
205
|
}
|
|
206
206
|
export { TimePicker as TimePickerWithoutAnalytics };
|
|
207
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof WithAnalyticsEventsProps>, "testId" | "isOpen" | "formatDisplayLabel" | "value" | "placeholder" | "timeFormat"> & Partial<Pick<Omit<TimePickerProps, keyof WithAnalyticsEventsProps>, "appearance" | "
|
|
207
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof WithAnalyticsEventsProps>, "testId" | "isOpen" | "formatDisplayLabel" | "value" | "placeholder" | "timeFormat"> & Partial<Pick<Omit<TimePickerProps, keyof WithAnalyticsEventsProps>, "appearance" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "id" | "innerProps" | "isDisabled" | "name" | "onBlur" | "onChange" | "onFocus" | "parseInputValue" | "selectProps" | "spacing" | "isInvalid" | "hideIcon" | "locale" | "times" | "timeIsEditable">> & Partial<Pick<{
|
|
208
208
|
appearance: Appearance;
|
|
209
209
|
autoFocus: boolean;
|
|
210
210
|
defaultIsOpen: boolean;
|
|
@@ -224,5 +224,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePicke
|
|
|
224
224
|
times: string[];
|
|
225
225
|
timeIsEditable: boolean;
|
|
226
226
|
locale: string;
|
|
227
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "appearance" | "
|
|
227
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "appearance" | "autoFocus" | "defaultIsOpen" | "defaultValue" | "id" | "innerProps" | "isDisabled" | "isOpen" | "name" | "onBlur" | "onChange" | "onFocus" | "parseInputValue" | "formatDisplayLabel" | "selectProps" | "spacing" | "value" | "isInvalid" | "hideIcon" | "placeholder" | "locale" | "key" | "analyticsContext" | "times" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
|
|
228
228
|
export default _default;
|