@atlaskit/datetime-picker 12.7.12 → 12.8.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 +12 -0
- package/dist/cjs/components/date-picker.js +38 -19
- package/dist/cjs/components/date-time-picker.js +7 -7
- package/dist/cjs/components/time-picker.js +8 -9
- package/dist/cjs/internal/fixed-layer.js +2 -2
- package/dist/cjs/internal/index.js +3 -2
- package/dist/es2019/components/date-picker.js +35 -18
- package/dist/es2019/components/date-time-picker.js +5 -7
- package/dist/es2019/components/time-picker.js +5 -5
- package/dist/es2019/internal/index.js +3 -2
- package/dist/esm/components/date-picker.js +37 -20
- package/dist/esm/components/date-time-picker.js +7 -9
- package/dist/esm/components/time-picker.js +7 -7
- package/dist/esm/internal/fixed-layer.js +2 -2
- package/dist/esm/internal/index.js +3 -2
- package/dist/types/components/date-picker.d.ts +1 -0
- package/dist/types/components/date-time-picker.d.ts +0 -2
- package/dist/types/internal/index.d.ts +3 -0
- package/dist/types-ts4.5/components/date-picker.d.ts +1 -0
- package/dist/types-ts4.5/components/date-time-picker.d.ts +0 -2
- package/dist/types-ts4.5/internal/index.d.ts +3 -0
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/datetime-picker
|
|
2
2
|
|
|
3
|
+
## 12.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ae2b28c599a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ae2b28c599a) - Remove unused state value.
|
|
8
|
+
|
|
9
|
+
## 12.8.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`0ab32310305`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0ab32310305) - [ux] We are testing adding keyboard accessibility to the datepicker change behind a feature flag. If this fix is successful it will be available in a later release.
|
|
14
|
+
|
|
3
15
|
## 12.7.12
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -33,15 +33,12 @@ var _singleValue = require("../internal/single-value");
|
|
|
33
33
|
var _utils = require("./utils");
|
|
34
34
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
35
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
36
|
-
function ownKeys(
|
|
37
|
-
function _objectSpread(
|
|
36
|
+
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; }
|
|
37
|
+
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; }
|
|
38
38
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
39
|
-
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; } }
|
|
39
|
+
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; } } /** @jsx jsx */
|
|
40
40
|
var packageName = "@atlaskit/datetime-picker";
|
|
41
|
-
var packageVersion = "12.
|
|
42
|
-
|
|
43
|
-
/* eslint-disable react/no-unused-prop-types */
|
|
44
|
-
|
|
41
|
+
var packageVersion = "12.8.1";
|
|
45
42
|
function getValidDate(iso) {
|
|
46
43
|
var date = (0, _dateFns.parseISO)(iso);
|
|
47
44
|
return (0, _dateFns.isValid)(date) ? {
|
|
@@ -82,7 +79,7 @@ var Menu = function Menu(_ref) {
|
|
|
82
79
|
locale: selectProps.calendarLocale,
|
|
83
80
|
testId: selectProps.testId && "".concat(selectProps.testId, "--calendar"),
|
|
84
81
|
weekStartDay: selectProps.calendarWeekStartDay,
|
|
85
|
-
tabIndex: -1
|
|
82
|
+
tabIndex: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.accessible-datetime-picker_691ec') ? undefined : -1
|
|
86
83
|
}))),
|
|
87
84
|
testId: selectProps.testId
|
|
88
85
|
});
|
|
@@ -103,9 +100,13 @@ var datePickerDefaultProps = {
|
|
|
103
100
|
isDisabled: false,
|
|
104
101
|
isInvalid: false,
|
|
105
102
|
name: '',
|
|
103
|
+
// These disables are here for proper typing when used as defaults. They
|
|
104
|
+
// should *not* use the `noop` function.
|
|
105
|
+
/* eslint-disable @repo/internal/react/use-noop */
|
|
106
106
|
onBlur: function onBlur(event) {},
|
|
107
107
|
onChange: function onChange(value) {},
|
|
108
108
|
onFocus: function onFocus(event) {},
|
|
109
|
+
/* eslint-enable @repo/internal/react/use-noop */
|
|
109
110
|
selectProps: {},
|
|
110
111
|
spacing: 'default',
|
|
111
112
|
locale: 'en-US'
|
|
@@ -168,15 +169,24 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
168
169
|
});
|
|
169
170
|
}
|
|
170
171
|
});
|
|
171
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "
|
|
172
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onContainerBlur", function (event) {
|
|
172
173
|
var _this$containerRef;
|
|
173
174
|
var newlyFocusedElement = event.relatedTarget;
|
|
175
|
+
if (!((_this$containerRef = _this.containerRef) !== null && _this$containerRef !== void 0 && _this$containerRef.contains(newlyFocusedElement))) {
|
|
176
|
+
_this.setState({
|
|
177
|
+
isOpen: false
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onSelectBlur", function (event) {
|
|
182
|
+
var _this$containerRef2;
|
|
183
|
+
var newlyFocusedElement = event.relatedTarget;
|
|
174
184
|
if (_this.getSafeState().clearingFromIcon) {
|
|
175
185
|
// Don't close menu if blurring after the user has clicked clear
|
|
176
186
|
_this.setState({
|
|
177
187
|
clearingFromIcon: false
|
|
178
188
|
});
|
|
179
|
-
} else if (!((_this$
|
|
189
|
+
} else if (!((_this$containerRef2 = _this.containerRef) !== null && _this$containerRef2 !== void 0 && _this$containerRef2.contains(newlyFocusedElement))) {
|
|
180
190
|
// Don't close menu if focus is staying within the date picker's
|
|
181
191
|
// container. Makes keyboard accessibility of calendar possible
|
|
182
192
|
_this.setState({
|
|
@@ -238,29 +248,37 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
238
248
|
switch (keyPressed) {
|
|
239
249
|
case 'arrowup':
|
|
240
250
|
case 'arrowdown':
|
|
241
|
-
if (
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
251
|
+
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.accessible-datetime-picker_691ec')) {
|
|
252
|
+
if (_this.calendarRef) {
|
|
253
|
+
event.preventDefault();
|
|
254
|
+
var key = keyPressed === 'arrowup' ? 'up' : 'down';
|
|
255
|
+
_this.calendarRef.navigate(key);
|
|
256
|
+
}
|
|
257
|
+
_this.setState({
|
|
258
|
+
isOpen: true
|
|
259
|
+
});
|
|
245
260
|
}
|
|
246
|
-
_this.setState({
|
|
247
|
-
isOpen: true
|
|
248
|
-
});
|
|
249
261
|
break;
|
|
250
262
|
case 'arrowleft':
|
|
251
263
|
case 'arrowright':
|
|
252
|
-
if (_this.calendarRef) {
|
|
264
|
+
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.accessible-datetime-picker_691ec') && _this.calendarRef) {
|
|
253
265
|
event.preventDefault();
|
|
254
266
|
var _key = keyPressed === 'arrowleft' ? 'left' : 'right';
|
|
255
267
|
_this.calendarRef.navigate(_key);
|
|
256
268
|
}
|
|
257
269
|
break;
|
|
258
270
|
case 'escape':
|
|
259
|
-
case 'tab':
|
|
260
271
|
_this.setState({
|
|
261
272
|
isOpen: false
|
|
262
273
|
});
|
|
263
274
|
break;
|
|
275
|
+
case 'tab':
|
|
276
|
+
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.accessible-datetime-picker_691ec')) {
|
|
277
|
+
_this.setState({
|
|
278
|
+
isOpen: false
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
break;
|
|
264
282
|
case 'backspace':
|
|
265
283
|
case 'delete':
|
|
266
284
|
{
|
|
@@ -485,6 +503,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
485
503
|
// (DSP-11587)
|
|
486
504
|
(0, _react2.jsx)("div", (0, _extends2.default)({}, innerProps, {
|
|
487
505
|
role: "presentation",
|
|
506
|
+
onBlur: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.accessible-datetime-picker_691ec') ? this.onContainerBlur : undefined,
|
|
488
507
|
onClick: this.onInputClick,
|
|
489
508
|
onInput: this.onTextInput,
|
|
490
509
|
onKeyDown: this.onInputKeyDown,
|
|
@@ -28,13 +28,10 @@ var _timePicker = _interopRequireDefault(require("./time-picker"));
|
|
|
28
28
|
var _utils = require("./utils");
|
|
29
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
30
30
|
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; } }
|
|
31
|
-
function ownKeys(
|
|
32
|
-
function _objectSpread(
|
|
31
|
+
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; }
|
|
32
|
+
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; } /** @jsx jsx */
|
|
33
33
|
var packageName = "@atlaskit/datetime-picker";
|
|
34
|
-
var packageVersion = "12.
|
|
35
|
-
|
|
36
|
-
/* eslint-disable react/no-unused-prop-types */
|
|
37
|
-
|
|
34
|
+
var packageVersion = "12.8.1";
|
|
38
35
|
var isInvalidBorderStyles = (0, _react2.css)({
|
|
39
36
|
borderColor: "var(--ds-border-danger, ".concat(_colors.R400, ")")
|
|
40
37
|
});
|
|
@@ -137,9 +134,13 @@ var dateTimePickerDefaultProps = {
|
|
|
137
134
|
autoFocus: false,
|
|
138
135
|
isDisabled: false,
|
|
139
136
|
name: '',
|
|
137
|
+
// These disables are here for proper typing when used as defaults. They
|
|
138
|
+
// should *not* use the `noop` function.
|
|
139
|
+
/* eslint-disable @repo/internal/react/use-noop */
|
|
140
140
|
onBlur: function onBlur(event) {},
|
|
141
141
|
onChange: function onChange(value) {},
|
|
142
142
|
onFocus: function onFocus(event) {},
|
|
143
|
+
/* eslint-enable @repo/internal/react/use-noop */
|
|
143
144
|
innerProps: {},
|
|
144
145
|
id: '',
|
|
145
146
|
defaultValue: '',
|
|
@@ -171,7 +172,6 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
171
172
|
}
|
|
172
173
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
173
174
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
174
|
-
active: 0,
|
|
175
175
|
dateValue: '',
|
|
176
176
|
isFocused: false,
|
|
177
177
|
timeValue: '',
|
|
@@ -28,21 +28,16 @@ var _parseTime = _interopRequireDefault(require("../internal/parse-time"));
|
|
|
28
28
|
var _singleValue = require("../internal/single-value");
|
|
29
29
|
var _utils = require("./utils");
|
|
30
30
|
var _excluded = ["selectProps"],
|
|
31
|
-
_excluded2 = ["styles"];
|
|
32
|
-
/* eslint-disable @repo/internal/react/use-noop */
|
|
33
|
-
// eslint-disable-next-line no-restricted-imports
|
|
31
|
+
_excluded2 = ["styles"]; // eslint-disable-next-line no-restricted-imports
|
|
34
32
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
35
33
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
36
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
-
function ownKeys(
|
|
38
|
-
function _objectSpread(
|
|
35
|
+
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; }
|
|
36
|
+
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; }
|
|
39
37
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
40
38
|
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; } }
|
|
41
39
|
var packageName = "@atlaskit/datetime-picker";
|
|
42
|
-
var packageVersion = "12.
|
|
43
|
-
|
|
44
|
-
/* eslint-disable react/no-unused-prop-types */
|
|
45
|
-
|
|
40
|
+
var packageVersion = "12.8.1";
|
|
46
41
|
var menuStyles = {
|
|
47
42
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
48
43
|
position: 'static',
|
|
@@ -74,9 +69,13 @@ var timePickerDefaultProps = {
|
|
|
74
69
|
isDisabled: false,
|
|
75
70
|
isInvalid: false,
|
|
76
71
|
name: '',
|
|
72
|
+
// These disables are here for proper typing when used as defaults. They
|
|
73
|
+
// should *not* use the `noop` function.
|
|
74
|
+
/* eslint-disable @repo/internal/react/use-noop */
|
|
77
75
|
onBlur: function onBlur(event) {},
|
|
78
76
|
onChange: function onChange(value) {},
|
|
79
77
|
onFocus: function onFocus(event) {},
|
|
78
|
+
/* eslint-enable @repo/internal/react/use-noop */
|
|
80
79
|
parseInputValue: function parseInputValue(time, timeFormat) {
|
|
81
80
|
return (0, _parseTime.default)(time);
|
|
82
81
|
},
|
|
@@ -19,8 +19,8 @@ var _icon = require("@atlaskit/icon");
|
|
|
19
19
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
20
|
var _popper = require("@atlaskit/popper");
|
|
21
21
|
var _constants = require("@atlaskit/theme/constants");
|
|
22
|
-
function ownKeys(
|
|
23
|
-
function _objectSpread(
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
24
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
25
|
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; } } // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
26
26
|
/**
|
|
@@ -7,8 +7,9 @@ exports.defaultTimes = exports.defaultTimeFormat = exports.defaultDateFormat = e
|
|
|
7
7
|
exports.formatDateTimeZoneIntoIso = formatDateTimeZoneIntoIso;
|
|
8
8
|
exports.padToTwo = padToTwo;
|
|
9
9
|
exports.placeholderDatetime = void 0;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* This component is used to hide portions of Select component.
|
|
12
|
+
*/
|
|
12
13
|
var EmptyComponent = function EmptyComponent() {
|
|
13
14
|
return null;
|
|
14
15
|
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
/* eslint-disable @repo/internal/react/use-noop */
|
|
4
3
|
/** @jsx jsx */
|
|
5
4
|
import { Component } from 'react';
|
|
6
5
|
import { css, jsx } from '@emotion/react';
|
|
7
|
-
// eslint-disable-next-line no-restricted-imports
|
|
8
6
|
import { format, isValid, lastDayOfMonth, parseISO } from 'date-fns';
|
|
9
7
|
import pick from 'lodash/pick';
|
|
10
8
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -20,10 +18,7 @@ import FixedLayer from '../internal/fixed-layer';
|
|
|
20
18
|
import { makeSingleValue } from '../internal/single-value';
|
|
21
19
|
import { convertTokens } from './utils';
|
|
22
20
|
const packageName = "@atlaskit/datetime-picker";
|
|
23
|
-
const packageVersion = "12.
|
|
24
|
-
|
|
25
|
-
/* eslint-disable react/no-unused-prop-types */
|
|
26
|
-
|
|
21
|
+
const packageVersion = "12.8.1";
|
|
27
22
|
function getValidDate(iso) {
|
|
28
23
|
const date = parseISO(iso);
|
|
29
24
|
return isValid(date) ? {
|
|
@@ -64,7 +59,7 @@ const Menu = ({
|
|
|
64
59
|
locale: selectProps.calendarLocale,
|
|
65
60
|
testId: selectProps.testId && `${selectProps.testId}--calendar`,
|
|
66
61
|
weekStartDay: selectProps.calendarWeekStartDay,
|
|
67
|
-
tabIndex: -1
|
|
62
|
+
tabIndex: getBooleanFF('platform.design-system-team.accessible-datetime-picker_691ec') ? undefined : -1
|
|
68
63
|
}))),
|
|
69
64
|
testId: selectProps.testId
|
|
70
65
|
});
|
|
@@ -82,9 +77,13 @@ const datePickerDefaultProps = {
|
|
|
82
77
|
isDisabled: false,
|
|
83
78
|
isInvalid: false,
|
|
84
79
|
name: '',
|
|
80
|
+
// These disables are here for proper typing when used as defaults. They
|
|
81
|
+
// should *not* use the `noop` function.
|
|
82
|
+
/* eslint-disable @repo/internal/react/use-noop */
|
|
85
83
|
onBlur: event => {},
|
|
86
84
|
onChange: value => {},
|
|
87
85
|
onFocus: event => {},
|
|
86
|
+
/* eslint-enable @repo/internal/react/use-noop */
|
|
88
87
|
selectProps: {},
|
|
89
88
|
spacing: 'default',
|
|
90
89
|
locale: 'en-US'
|
|
@@ -146,15 +145,24 @@ class DatePicker extends Component {
|
|
|
146
145
|
});
|
|
147
146
|
}
|
|
148
147
|
});
|
|
149
|
-
_defineProperty(this, "
|
|
148
|
+
_defineProperty(this, "onContainerBlur", event => {
|
|
150
149
|
var _this$containerRef;
|
|
151
150
|
const newlyFocusedElement = event.relatedTarget;
|
|
151
|
+
if (!((_this$containerRef = this.containerRef) !== null && _this$containerRef !== void 0 && _this$containerRef.contains(newlyFocusedElement))) {
|
|
152
|
+
this.setState({
|
|
153
|
+
isOpen: false
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
_defineProperty(this, "onSelectBlur", event => {
|
|
158
|
+
var _this$containerRef2;
|
|
159
|
+
const newlyFocusedElement = event.relatedTarget;
|
|
152
160
|
if (this.getSafeState().clearingFromIcon) {
|
|
153
161
|
// Don't close menu if blurring after the user has clicked clear
|
|
154
162
|
this.setState({
|
|
155
163
|
clearingFromIcon: false
|
|
156
164
|
});
|
|
157
|
-
} else if (!((_this$
|
|
165
|
+
} else if (!((_this$containerRef2 = this.containerRef) !== null && _this$containerRef2 !== void 0 && _this$containerRef2.contains(newlyFocusedElement))) {
|
|
158
166
|
// Don't close menu if focus is staying within the date picker's
|
|
159
167
|
// container. Makes keyboard accessibility of calendar possible
|
|
160
168
|
this.setState({
|
|
@@ -218,29 +226,37 @@ class DatePicker extends Component {
|
|
|
218
226
|
switch (keyPressed) {
|
|
219
227
|
case 'arrowup':
|
|
220
228
|
case 'arrowdown':
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
229
|
+
if (!getBooleanFF('platform.design-system-team.accessible-datetime-picker_691ec')) {
|
|
230
|
+
if (this.calendarRef) {
|
|
231
|
+
event.preventDefault();
|
|
232
|
+
const key = keyPressed === 'arrowup' ? 'up' : 'down';
|
|
233
|
+
this.calendarRef.navigate(key);
|
|
234
|
+
}
|
|
235
|
+
this.setState({
|
|
236
|
+
isOpen: true
|
|
237
|
+
});
|
|
225
238
|
}
|
|
226
|
-
this.setState({
|
|
227
|
-
isOpen: true
|
|
228
|
-
});
|
|
229
239
|
break;
|
|
230
240
|
case 'arrowleft':
|
|
231
241
|
case 'arrowright':
|
|
232
|
-
if (this.calendarRef) {
|
|
242
|
+
if (!getBooleanFF('platform.design-system-team.accessible-datetime-picker_691ec') && this.calendarRef) {
|
|
233
243
|
event.preventDefault();
|
|
234
244
|
const key = keyPressed === 'arrowleft' ? 'left' : 'right';
|
|
235
245
|
this.calendarRef.navigate(key);
|
|
236
246
|
}
|
|
237
247
|
break;
|
|
238
248
|
case 'escape':
|
|
239
|
-
case 'tab':
|
|
240
249
|
this.setState({
|
|
241
250
|
isOpen: false
|
|
242
251
|
});
|
|
243
252
|
break;
|
|
253
|
+
case 'tab':
|
|
254
|
+
if (!getBooleanFF('platform.design-system-team.accessible-datetime-picker_691ec')) {
|
|
255
|
+
this.setState({
|
|
256
|
+
isOpen: false
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
break;
|
|
244
260
|
case 'backspace':
|
|
245
261
|
case 'delete':
|
|
246
262
|
{
|
|
@@ -475,6 +491,7 @@ class DatePicker extends Component {
|
|
|
475
491
|
// (DSP-11587)
|
|
476
492
|
jsx("div", _extends({}, innerProps, {
|
|
477
493
|
role: "presentation",
|
|
494
|
+
onBlur: getBooleanFF('platform.design-system-team.accessible-datetime-picker_691ec') ? this.onContainerBlur : undefined,
|
|
478
495
|
onClick: this.onInputClick,
|
|
479
496
|
onInput: this.onTextInput,
|
|
480
497
|
onKeyDown: this.onInputKeyDown,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
/* eslint-disable @repo/internal/react/use-noop */
|
|
4
3
|
/** @jsx jsx */
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import { css, jsx } from '@emotion/react';
|
|
7
|
-
// eslint-disable-next-line no-restricted-imports
|
|
8
6
|
import { format, isValid, parseISO } from 'date-fns';
|
|
9
7
|
import pick from 'lodash/pick';
|
|
10
8
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -17,10 +15,7 @@ import DatePicker from './date-picker';
|
|
|
17
15
|
import TimePicker from './time-picker';
|
|
18
16
|
import { convertTokens } from './utils';
|
|
19
17
|
const packageName = "@atlaskit/datetime-picker";
|
|
20
|
-
const packageVersion = "12.
|
|
21
|
-
|
|
22
|
-
/* eslint-disable react/no-unused-prop-types */
|
|
23
|
-
|
|
18
|
+
const packageVersion = "12.8.1";
|
|
24
19
|
const isInvalidBorderStyles = css({
|
|
25
20
|
borderColor: `var(--ds-border-danger, ${R400})`
|
|
26
21
|
});
|
|
@@ -122,9 +117,13 @@ const dateTimePickerDefaultProps = {
|
|
|
122
117
|
autoFocus: false,
|
|
123
118
|
isDisabled: false,
|
|
124
119
|
name: '',
|
|
120
|
+
// These disables are here for proper typing when used as defaults. They
|
|
121
|
+
// should *not* use the `noop` function.
|
|
122
|
+
/* eslint-disable @repo/internal/react/use-noop */
|
|
125
123
|
onBlur: event => {},
|
|
126
124
|
onChange: value => {},
|
|
127
125
|
onFocus: event => {},
|
|
126
|
+
/* eslint-enable @repo/internal/react/use-noop */
|
|
128
127
|
innerProps: {},
|
|
129
128
|
id: '',
|
|
130
129
|
defaultValue: '',
|
|
@@ -147,7 +146,6 @@ class DateTimePicker extends React.Component {
|
|
|
147
146
|
constructor(...args) {
|
|
148
147
|
super(...args);
|
|
149
148
|
_defineProperty(this, "state", {
|
|
150
|
-
active: 0,
|
|
151
149
|
dateValue: '',
|
|
152
150
|
isFocused: false,
|
|
153
151
|
timeValue: '',
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
/* eslint-disable @repo/internal/react/use-noop */
|
|
4
3
|
import React from 'react';
|
|
5
4
|
|
|
6
5
|
// eslint-disable-next-line no-restricted-imports
|
|
@@ -17,10 +16,7 @@ import parseTime from '../internal/parse-time';
|
|
|
17
16
|
import { makeSingleValue } from '../internal/single-value';
|
|
18
17
|
import { convertTokens } from './utils';
|
|
19
18
|
const packageName = "@atlaskit/datetime-picker";
|
|
20
|
-
const packageVersion = "12.
|
|
21
|
-
|
|
22
|
-
/* eslint-disable react/no-unused-prop-types */
|
|
23
|
-
|
|
19
|
+
const packageVersion = "12.8.1";
|
|
24
20
|
const menuStyles = {
|
|
25
21
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
26
22
|
position: 'static',
|
|
@@ -51,9 +47,13 @@ const timePickerDefaultProps = {
|
|
|
51
47
|
isDisabled: false,
|
|
52
48
|
isInvalid: false,
|
|
53
49
|
name: '',
|
|
50
|
+
// These disables are here for proper typing when used as defaults. They
|
|
51
|
+
// should *not* use the `noop` function.
|
|
52
|
+
/* eslint-disable @repo/internal/react/use-noop */
|
|
54
53
|
onBlur: event => {},
|
|
55
54
|
onChange: value => {},
|
|
56
55
|
onFocus: event => {},
|
|
56
|
+
/* eslint-enable @repo/internal/react/use-noop */
|
|
57
57
|
parseInputValue: (time, timeFormat) => parseTime(time),
|
|
58
58
|
selectProps: {},
|
|
59
59
|
spacing: 'default',
|
|
@@ -7,15 +7,13 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
import _extends from "@babel/runtime/helpers/extends";
|
|
10
|
-
function ownKeys(
|
|
11
|
-
function _objectSpread(
|
|
10
|
+
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; }
|
|
11
|
+
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) { _defineProperty(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; }
|
|
12
12
|
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); }; }
|
|
13
13
|
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; } }
|
|
14
|
-
/* eslint-disable @repo/internal/react/use-noop */
|
|
15
14
|
/** @jsx jsx */
|
|
16
15
|
import { Component } from 'react';
|
|
17
16
|
import { css, jsx } from '@emotion/react';
|
|
18
|
-
// eslint-disable-next-line no-restricted-imports
|
|
19
17
|
import { format, isValid, lastDayOfMonth, parseISO } from 'date-fns';
|
|
20
18
|
import pick from 'lodash/pick';
|
|
21
19
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -31,10 +29,7 @@ import FixedLayer from '../internal/fixed-layer';
|
|
|
31
29
|
import { makeSingleValue } from '../internal/single-value';
|
|
32
30
|
import { convertTokens } from './utils';
|
|
33
31
|
var packageName = "@atlaskit/datetime-picker";
|
|
34
|
-
var packageVersion = "12.
|
|
35
|
-
|
|
36
|
-
/* eslint-disable react/no-unused-prop-types */
|
|
37
|
-
|
|
32
|
+
var packageVersion = "12.8.1";
|
|
38
33
|
function getValidDate(iso) {
|
|
39
34
|
var date = parseISO(iso);
|
|
40
35
|
return isValid(date) ? {
|
|
@@ -75,7 +70,7 @@ var Menu = function Menu(_ref) {
|
|
|
75
70
|
locale: selectProps.calendarLocale,
|
|
76
71
|
testId: selectProps.testId && "".concat(selectProps.testId, "--calendar"),
|
|
77
72
|
weekStartDay: selectProps.calendarWeekStartDay,
|
|
78
|
-
tabIndex: -1
|
|
73
|
+
tabIndex: getBooleanFF('platform.design-system-team.accessible-datetime-picker_691ec') ? undefined : -1
|
|
79
74
|
}))),
|
|
80
75
|
testId: selectProps.testId
|
|
81
76
|
});
|
|
@@ -96,9 +91,13 @@ var datePickerDefaultProps = {
|
|
|
96
91
|
isDisabled: false,
|
|
97
92
|
isInvalid: false,
|
|
98
93
|
name: '',
|
|
94
|
+
// These disables are here for proper typing when used as defaults. They
|
|
95
|
+
// should *not* use the `noop` function.
|
|
96
|
+
/* eslint-disable @repo/internal/react/use-noop */
|
|
99
97
|
onBlur: function onBlur(event) {},
|
|
100
98
|
onChange: function onChange(value) {},
|
|
101
99
|
onFocus: function onFocus(event) {},
|
|
100
|
+
/* eslint-enable @repo/internal/react/use-noop */
|
|
102
101
|
selectProps: {},
|
|
103
102
|
spacing: 'default',
|
|
104
103
|
locale: 'en-US'
|
|
@@ -161,15 +160,24 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
161
160
|
});
|
|
162
161
|
}
|
|
163
162
|
});
|
|
164
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
163
|
+
_defineProperty(_assertThisInitialized(_this), "onContainerBlur", function (event) {
|
|
165
164
|
var _this$containerRef;
|
|
166
165
|
var newlyFocusedElement = event.relatedTarget;
|
|
166
|
+
if (!((_this$containerRef = _this.containerRef) !== null && _this$containerRef !== void 0 && _this$containerRef.contains(newlyFocusedElement))) {
|
|
167
|
+
_this.setState({
|
|
168
|
+
isOpen: false
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
_defineProperty(_assertThisInitialized(_this), "onSelectBlur", function (event) {
|
|
173
|
+
var _this$containerRef2;
|
|
174
|
+
var newlyFocusedElement = event.relatedTarget;
|
|
167
175
|
if (_this.getSafeState().clearingFromIcon) {
|
|
168
176
|
// Don't close menu if blurring after the user has clicked clear
|
|
169
177
|
_this.setState({
|
|
170
178
|
clearingFromIcon: false
|
|
171
179
|
});
|
|
172
|
-
} else if (!((_this$
|
|
180
|
+
} else if (!((_this$containerRef2 = _this.containerRef) !== null && _this$containerRef2 !== void 0 && _this$containerRef2.contains(newlyFocusedElement))) {
|
|
173
181
|
// Don't close menu if focus is staying within the date picker's
|
|
174
182
|
// container. Makes keyboard accessibility of calendar possible
|
|
175
183
|
_this.setState({
|
|
@@ -231,29 +239,37 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
231
239
|
switch (keyPressed) {
|
|
232
240
|
case 'arrowup':
|
|
233
241
|
case 'arrowdown':
|
|
234
|
-
if (
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
242
|
+
if (!getBooleanFF('platform.design-system-team.accessible-datetime-picker_691ec')) {
|
|
243
|
+
if (_this.calendarRef) {
|
|
244
|
+
event.preventDefault();
|
|
245
|
+
var key = keyPressed === 'arrowup' ? 'up' : 'down';
|
|
246
|
+
_this.calendarRef.navigate(key);
|
|
247
|
+
}
|
|
248
|
+
_this.setState({
|
|
249
|
+
isOpen: true
|
|
250
|
+
});
|
|
238
251
|
}
|
|
239
|
-
_this.setState({
|
|
240
|
-
isOpen: true
|
|
241
|
-
});
|
|
242
252
|
break;
|
|
243
253
|
case 'arrowleft':
|
|
244
254
|
case 'arrowright':
|
|
245
|
-
if (_this.calendarRef) {
|
|
255
|
+
if (!getBooleanFF('platform.design-system-team.accessible-datetime-picker_691ec') && _this.calendarRef) {
|
|
246
256
|
event.preventDefault();
|
|
247
257
|
var _key = keyPressed === 'arrowleft' ? 'left' : 'right';
|
|
248
258
|
_this.calendarRef.navigate(_key);
|
|
249
259
|
}
|
|
250
260
|
break;
|
|
251
261
|
case 'escape':
|
|
252
|
-
case 'tab':
|
|
253
262
|
_this.setState({
|
|
254
263
|
isOpen: false
|
|
255
264
|
});
|
|
256
265
|
break;
|
|
266
|
+
case 'tab':
|
|
267
|
+
if (!getBooleanFF('platform.design-system-team.accessible-datetime-picker_691ec')) {
|
|
268
|
+
_this.setState({
|
|
269
|
+
isOpen: false
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
break;
|
|
257
273
|
case 'backspace':
|
|
258
274
|
case 'delete':
|
|
259
275
|
{
|
|
@@ -478,6 +494,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
478
494
|
// (DSP-11587)
|
|
479
495
|
jsx("div", _extends({}, innerProps, {
|
|
480
496
|
role: "presentation",
|
|
497
|
+
onBlur: getBooleanFF('platform.design-system-team.accessible-datetime-picker_691ec') ? this.onContainerBlur : undefined,
|
|
481
498
|
onClick: this.onInputClick,
|
|
482
499
|
onInput: this.onTextInput,
|
|
483
500
|
onKeyDown: this.onInputKeyDown,
|
|
@@ -8,13 +8,11 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
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); }; }
|
|
10
10
|
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; } }
|
|
11
|
-
function ownKeys(
|
|
12
|
-
function _objectSpread(
|
|
13
|
-
/* eslint-disable @repo/internal/react/use-noop */
|
|
11
|
+
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; }
|
|
12
|
+
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) { _defineProperty(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; }
|
|
14
13
|
/** @jsx jsx */
|
|
15
14
|
import React from 'react';
|
|
16
15
|
import { css, jsx } from '@emotion/react';
|
|
17
|
-
// eslint-disable-next-line no-restricted-imports
|
|
18
16
|
import { format, isValid, parseISO } from 'date-fns';
|
|
19
17
|
import pick from 'lodash/pick';
|
|
20
18
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -27,10 +25,7 @@ import DatePicker from './date-picker';
|
|
|
27
25
|
import TimePicker from './time-picker';
|
|
28
26
|
import { convertTokens } from './utils';
|
|
29
27
|
var packageName = "@atlaskit/datetime-picker";
|
|
30
|
-
var packageVersion = "12.
|
|
31
|
-
|
|
32
|
-
/* eslint-disable react/no-unused-prop-types */
|
|
33
|
-
|
|
28
|
+
var packageVersion = "12.8.1";
|
|
34
29
|
var isInvalidBorderStyles = css({
|
|
35
30
|
borderColor: "var(--ds-border-danger, ".concat(R400, ")")
|
|
36
31
|
});
|
|
@@ -133,9 +128,13 @@ var dateTimePickerDefaultProps = {
|
|
|
133
128
|
autoFocus: false,
|
|
134
129
|
isDisabled: false,
|
|
135
130
|
name: '',
|
|
131
|
+
// These disables are here for proper typing when used as defaults. They
|
|
132
|
+
// should *not* use the `noop` function.
|
|
133
|
+
/* eslint-disable @repo/internal/react/use-noop */
|
|
136
134
|
onBlur: function onBlur(event) {},
|
|
137
135
|
onChange: function onChange(value) {},
|
|
138
136
|
onFocus: function onFocus(event) {},
|
|
137
|
+
/* eslint-enable @repo/internal/react/use-noop */
|
|
139
138
|
innerProps: {},
|
|
140
139
|
id: '',
|
|
141
140
|
defaultValue: '',
|
|
@@ -165,7 +164,6 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
165
164
|
}
|
|
166
165
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
167
166
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
168
|
-
active: 0,
|
|
169
167
|
dateValue: '',
|
|
170
168
|
isFocused: false,
|
|
171
169
|
timeValue: '',
|
|
@@ -9,11 +9,10 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
9
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
10
10
|
var _excluded = ["selectProps"],
|
|
11
11
|
_excluded2 = ["styles"];
|
|
12
|
-
function ownKeys(
|
|
13
|
-
function _objectSpread(
|
|
12
|
+
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; }
|
|
13
|
+
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) { _defineProperty(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; }
|
|
14
14
|
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); }; }
|
|
15
15
|
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; } }
|
|
16
|
-
/* eslint-disable @repo/internal/react/use-noop */
|
|
17
16
|
import React from 'react';
|
|
18
17
|
|
|
19
18
|
// eslint-disable-next-line no-restricted-imports
|
|
@@ -30,10 +29,7 @@ import parseTime from '../internal/parse-time';
|
|
|
30
29
|
import { makeSingleValue } from '../internal/single-value';
|
|
31
30
|
import { convertTokens } from './utils';
|
|
32
31
|
var packageName = "@atlaskit/datetime-picker";
|
|
33
|
-
var packageVersion = "12.
|
|
34
|
-
|
|
35
|
-
/* eslint-disable react/no-unused-prop-types */
|
|
36
|
-
|
|
32
|
+
var packageVersion = "12.8.1";
|
|
37
33
|
var menuStyles = {
|
|
38
34
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
39
35
|
position: 'static',
|
|
@@ -65,9 +61,13 @@ var timePickerDefaultProps = {
|
|
|
65
61
|
isDisabled: false,
|
|
66
62
|
isInvalid: false,
|
|
67
63
|
name: '',
|
|
64
|
+
// These disables are here for proper typing when used as defaults. They
|
|
65
|
+
// should *not* use the `noop` function.
|
|
66
|
+
/* eslint-disable @repo/internal/react/use-noop */
|
|
68
67
|
onBlur: function onBlur(event) {},
|
|
69
68
|
onChange: function onChange(value) {},
|
|
70
69
|
onFocus: function onFocus(event) {},
|
|
70
|
+
/* eslint-enable @repo/internal/react/use-noop */
|
|
71
71
|
parseInputValue: function parseInputValue(time, timeFormat) {
|
|
72
72
|
return parseTime(time);
|
|
73
73
|
},
|
|
@@ -5,8 +5,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function ownKeys(
|
|
9
|
-
function _objectSpread(
|
|
8
|
+
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; }
|
|
9
|
+
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) { _defineProperty(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; }
|
|
10
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); }; }
|
|
11
11
|
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; } }
|
|
12
12
|
import React from 'react';
|
|
@@ -232,6 +232,7 @@ declare class DatePicker extends Component<DatePickerProps, State> {
|
|
|
232
232
|
iso: string;
|
|
233
233
|
}) => void;
|
|
234
234
|
onInputClick: () => void;
|
|
235
|
+
onContainerBlur: (event: React.FocusEvent<HTMLElement>) => void;
|
|
235
236
|
onSelectBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
236
237
|
onSelectFocus: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
237
238
|
onTextInput: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -117,7 +117,6 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
117
117
|
}
|
|
118
118
|
type DateTimePickerProps = typeof dateTimePickerDefaultProps & DateTimePickerBaseProps;
|
|
119
119
|
interface State {
|
|
120
|
-
active: 0 | 1 | 2;
|
|
121
120
|
dateValue: string;
|
|
122
121
|
isFocused: boolean;
|
|
123
122
|
timeValue: string;
|
|
@@ -175,7 +174,6 @@ declare class DateTimePicker extends React.Component<DateTimePickerProps, State>
|
|
|
175
174
|
timeValue: string;
|
|
176
175
|
zoneValue: string;
|
|
177
176
|
value: string;
|
|
178
|
-
active: 0 | 1 | 2;
|
|
179
177
|
isFocused: boolean;
|
|
180
178
|
};
|
|
181
179
|
parseValue(value: string, dateValue: string, timeValue: string, zoneValue: string): {
|
|
@@ -232,6 +232,7 @@ declare class DatePicker extends Component<DatePickerProps, State> {
|
|
|
232
232
|
iso: string;
|
|
233
233
|
}) => void;
|
|
234
234
|
onInputClick: () => void;
|
|
235
|
+
onContainerBlur: (event: React.FocusEvent<HTMLElement>) => void;
|
|
235
236
|
onSelectBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
236
237
|
onSelectFocus: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
237
238
|
onTextInput: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -117,7 +117,6 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
117
117
|
}
|
|
118
118
|
type DateTimePickerProps = typeof dateTimePickerDefaultProps & DateTimePickerBaseProps;
|
|
119
119
|
interface State {
|
|
120
|
-
active: 0 | 1 | 2;
|
|
121
120
|
dateValue: string;
|
|
122
121
|
isFocused: boolean;
|
|
123
122
|
timeValue: string;
|
|
@@ -175,7 +174,6 @@ declare class DateTimePicker extends React.Component<DateTimePickerProps, State>
|
|
|
175
174
|
timeValue: string;
|
|
176
175
|
zoneValue: string;
|
|
177
176
|
value: string;
|
|
178
|
-
active: 0 | 1 | 2;
|
|
179
177
|
isFocused: boolean;
|
|
180
178
|
};
|
|
181
179
|
parseValue(value: string, dateValue: string, timeValue: string, zoneValue: string): {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/datetime-picker",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.8.1",
|
|
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/"
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
36
|
-
"@atlaskit/calendar": "^13.
|
|
36
|
+
"@atlaskit/calendar": "^13.3.0",
|
|
37
37
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
38
38
|
"@atlaskit/icon": "^21.12.0",
|
|
39
39
|
"@atlaskit/locale": "^2.5.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
41
41
|
"@atlaskit/popper": "^5.5.0",
|
|
42
42
|
"@atlaskit/select": "^16.5.0",
|
|
43
|
-
"@atlaskit/theme": "^12.
|
|
44
|
-
"@atlaskit/tokens": "^1.
|
|
43
|
+
"@atlaskit/theme": "^12.6.0",
|
|
44
|
+
"@atlaskit/tokens": "^1.18.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@emotion/react": "^11.7.1",
|
|
47
47
|
"date-fns": "^2.17.0",
|
|
@@ -101,6 +101,9 @@
|
|
|
101
101
|
},
|
|
102
102
|
"platform.design-system-team.date-picker-input-a11y-fix_cbbxs": {
|
|
103
103
|
"type": "boolean"
|
|
104
|
+
},
|
|
105
|
+
"platform.design-system-team.accessible-datetime-picker_691ec": {
|
|
106
|
+
"type": "boolean"
|
|
104
107
|
}
|
|
105
108
|
},
|
|
106
109
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|