@atlaskit/datetime-picker 12.6.1 → 12.7.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 +23 -12
- package/dist/cjs/components/date-time-picker.js +1 -1
- package/dist/cjs/components/time-picker.js +1 -1
- package/dist/cjs/internal/fixed-layer.js +8 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/date-picker.js +24 -13
- package/dist/es2019/components/date-time-picker.js +1 -1
- package/dist/es2019/components/time-picker.js +1 -1
- package/dist/es2019/internal/fixed-layer.js +8 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/date-picker.js +24 -13
- package/dist/esm/components/date-time-picker.js +1 -1
- package/dist/esm/components/time-picker.js +1 -1
- package/dist/esm/internal/fixed-layer.js +8 -4
- package/dist/esm/version.json +1 -1
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/datetime-picker
|
|
2
2
|
|
|
3
|
+
## 12.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`774ed69ecef`](https://bitbucket.org/atlassian/atlassian-frontend/commits/774ed69ecef) - Internal changes to use space tokens for spacing values. There is no visual change.
|
|
8
|
+
|
|
9
|
+
## 12.7.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`1d5cd2e273c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1d5cd2e273c) - [ux] We are testing an input behavior change in date picker behind a feature flag. Now when entering a date in the input this value will persist after selecting a date instead of being cleared, acting like a standard input. If this fix is successful it will be available in a later release.
|
|
14
|
+
|
|
3
15
|
## 12.6.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -23,6 +23,7 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
23
23
|
var _calendar = _interopRequireDefault(require("@atlaskit/calendar"));
|
|
24
24
|
var _calendar2 = _interopRequireDefault(require("@atlaskit/icon/glyph/calendar"));
|
|
25
25
|
var _locale = require("@atlaskit/locale");
|
|
26
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
26
27
|
var _select = _interopRequireWildcard(require("@atlaskit/select"));
|
|
27
28
|
var _colors = require("@atlaskit/theme/colors");
|
|
28
29
|
var _constants = require("@atlaskit/theme/constants");
|
|
@@ -35,9 +36,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
35
36
|
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; }
|
|
36
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); }; }
|
|
37
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; } } /* eslint-disable @repo/internal/react/use-noop */ /** @jsx jsx */ // eslint-disable-next-line no-restricted-imports
|
|
38
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
39
39
|
var packageName = "@atlaskit/datetime-picker";
|
|
40
|
-
var packageVersion = "12.
|
|
40
|
+
var packageVersion = "12.7.1";
|
|
41
41
|
|
|
42
42
|
/* eslint-disable react/no-unused-prop-types */
|
|
43
43
|
|
|
@@ -258,13 +258,17 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
258
258
|
break;
|
|
259
259
|
case 'backspace':
|
|
260
260
|
case 'delete':
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
261
|
+
{
|
|
262
|
+
var inputCount = (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.date-picker-input-a11y-fix_cbbxs') ? 1 : 0;
|
|
263
|
+
if (value && event.target instanceof HTMLInputElement && event.target.value.length <= inputCount) {
|
|
264
|
+
// If being cleared from keyboard, don't change behaviour
|
|
265
|
+
_this.setState({
|
|
266
|
+
clearingFromIcon: false,
|
|
267
|
+
value: ''
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
break;
|
|
266
271
|
}
|
|
267
|
-
break;
|
|
268
272
|
case 'enter':
|
|
269
273
|
if (!_this.state.isOpen) {
|
|
270
274
|
return;
|
|
@@ -425,12 +429,17 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
425
429
|
locale = _this$props3.locale,
|
|
426
430
|
testId = _this$props3.testId,
|
|
427
431
|
weekStartDay = _this$props3.weekStartDay;
|
|
428
|
-
var ICON_PADDING = 2;
|
|
429
432
|
var _this$getSafeState7 = this.getSafeState(),
|
|
430
433
|
value = _this$getSafeState7.value,
|
|
431
434
|
calendarValue = _this$getSafeState7.calendarValue,
|
|
432
435
|
isOpen = _this$getSafeState7.isOpen,
|
|
433
436
|
selectInputValue = _this$getSafeState7.selectInputValue;
|
|
437
|
+
var actualSelectInputValue;
|
|
438
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.date-picker-input-a11y-fix_cbbxs')) {
|
|
439
|
+
actualSelectInputValue = selectInputValue || (value ? this.formatDate(value) : undefined);
|
|
440
|
+
} else {
|
|
441
|
+
actualSelectInputValue = selectInputValue;
|
|
442
|
+
}
|
|
434
443
|
var menuIsOpen = isOpen && !isDisabled;
|
|
435
444
|
var showClearIndicator = Boolean((value || selectInputValue) && !hideIcon);
|
|
436
445
|
var dropDownIcon = appearance === 'subtle' || hideIcon || showClearIndicator ? null : icon;
|
|
@@ -484,7 +493,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
484
493
|
isDisabled: isDisabled,
|
|
485
494
|
onBlur: this.onSelectBlur,
|
|
486
495
|
onFocus: this.onSelectFocus,
|
|
487
|
-
inputValue:
|
|
496
|
+
inputValue: actualSelectInputValue,
|
|
488
497
|
onInputChange: this.handleSelectInputChange,
|
|
489
498
|
components: selectComponents,
|
|
490
499
|
onChange: this.onSelectChange,
|
|
@@ -494,11 +503,13 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
494
503
|
},
|
|
495
504
|
indicatorsContainer: function indicatorsContainer(base) {
|
|
496
505
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
497
|
-
paddingLeft:
|
|
498
|
-
|
|
506
|
+
paddingLeft: "var(--ds-space-025, 2px)",
|
|
507
|
+
// ICON_PADDING = 2
|
|
508
|
+
paddingRight: "var(--ds-space-075, 6px)" // 8 - ICON_PADDING = 6
|
|
499
509
|
});
|
|
500
510
|
}
|
|
501
511
|
}),
|
|
512
|
+
|
|
502
513
|
placeholder: this.getPlaceholder(),
|
|
503
514
|
value: value && {
|
|
504
515
|
label: this.formatDate(value),
|
|
@@ -32,7 +32,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
32
32
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
33
33
|
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; } /* eslint-disable @repo/internal/react/use-noop */ /** @jsx jsx */ // eslint-disable-next-line no-restricted-imports
|
|
34
34
|
var packageName = "@atlaskit/datetime-picker";
|
|
35
|
-
var packageVersion = "12.
|
|
35
|
+
var packageVersion = "12.7.1";
|
|
36
36
|
|
|
37
37
|
/* eslint-disable react/no-unused-prop-types */
|
|
38
38
|
|
|
@@ -38,7 +38,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
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
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; } }
|
|
40
40
|
var packageName = "@atlaskit/datetime-picker";
|
|
41
|
-
var packageVersion = "12.
|
|
41
|
+
var packageVersion = "12.7.1";
|
|
42
42
|
|
|
43
43
|
/* eslint-disable react/no-unused-prop-types */
|
|
44
44
|
|
|
@@ -16,6 +16,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
16
16
|
var _reactScrolllock = _interopRequireDefault(require("react-scrolllock"));
|
|
17
17
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
18
18
|
var _icon = require("@atlaskit/icon");
|
|
19
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
20
|
var _popper = require("@atlaskit/popper");
|
|
20
21
|
var _constants = require("@atlaskit/theme/constants");
|
|
21
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -60,7 +61,6 @@ var FixedLayer = /*#__PURE__*/function (_React$Component) {
|
|
|
60
61
|
if (!containerRef) {
|
|
61
62
|
return /*#__PURE__*/_react.default.createElement("div", null);
|
|
62
63
|
}
|
|
63
|
-
var containerRect = containerRef.getBoundingClientRect();
|
|
64
64
|
return (
|
|
65
65
|
/*#__PURE__*/
|
|
66
66
|
/* Need to wrap layer in a fixed position div so that it will render its content as fixed
|
|
@@ -71,12 +71,16 @@ var FixedLayer = /*#__PURE__*/function (_React$Component) {
|
|
|
71
71
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
72
72
|
ref: ref,
|
|
73
73
|
"data-layer-child": true,
|
|
74
|
-
style: {
|
|
74
|
+
style: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.date-picker-input-a11y-fix_cbbxs') ? {
|
|
75
|
+
inset: 0,
|
|
76
|
+
pointerEvents: 'none',
|
|
77
|
+
background: 'transparent'
|
|
78
|
+
} : {
|
|
75
79
|
position: 'absolute',
|
|
76
80
|
top: 0,
|
|
77
|
-
height:
|
|
81
|
+
height: containerRef.getBoundingClientRect().height,
|
|
78
82
|
// Don't block the clear button
|
|
79
|
-
width:
|
|
83
|
+
width: containerRef.getBoundingClientRect().width - parseInt(_icon.sizes.small.slice(0, -2)) - (0, _constants.gridSize)(),
|
|
80
84
|
background: 'transparent'
|
|
81
85
|
}
|
|
82
86
|
});
|
package/dist/cjs/version.json
CHANGED
|
@@ -11,15 +11,15 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
11
11
|
import Calendar from '@atlaskit/calendar';
|
|
12
12
|
import CalendarIcon from '@atlaskit/icon/glyph/calendar';
|
|
13
13
|
import { createLocalizationProvider } from '@atlaskit/locale';
|
|
14
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import Select, { mergeStyles } from '@atlaskit/select';
|
|
15
16
|
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
16
|
-
|
|
17
|
-
import { borderRadius, gridSize, layers } from '@atlaskit/theme/constants';
|
|
17
|
+
import { borderRadius, layers } from '@atlaskit/theme/constants';
|
|
18
18
|
import { defaultDateFormat, EmptyComponent, padToTwo, placeholderDatetime } from '../internal';
|
|
19
19
|
import FixedLayer from '../internal/fixed-layer';
|
|
20
20
|
import { convertTokens } from './utils';
|
|
21
21
|
const packageName = "@atlaskit/datetime-picker";
|
|
22
|
-
const packageVersion = "12.
|
|
22
|
+
const packageVersion = "12.7.1";
|
|
23
23
|
|
|
24
24
|
/* eslint-disable react/no-unused-prop-types */
|
|
25
25
|
|
|
@@ -238,13 +238,17 @@ class DatePicker extends Component {
|
|
|
238
238
|
break;
|
|
239
239
|
case 'backspace':
|
|
240
240
|
case 'delete':
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
241
|
+
{
|
|
242
|
+
const inputCount = getBooleanFF('platform.design-system-team.date-picker-input-a11y-fix_cbbxs') ? 1 : 0;
|
|
243
|
+
if (value && event.target instanceof HTMLInputElement && event.target.value.length <= inputCount) {
|
|
244
|
+
// If being cleared from keyboard, don't change behaviour
|
|
245
|
+
this.setState({
|
|
246
|
+
clearingFromIcon: false,
|
|
247
|
+
value: ''
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
break;
|
|
246
251
|
}
|
|
247
|
-
break;
|
|
248
252
|
case 'enter':
|
|
249
253
|
if (!this.state.isOpen) {
|
|
250
254
|
return;
|
|
@@ -412,13 +416,18 @@ class DatePicker extends Component {
|
|
|
412
416
|
testId,
|
|
413
417
|
weekStartDay
|
|
414
418
|
} = this.props;
|
|
415
|
-
const ICON_PADDING = 2;
|
|
416
419
|
const {
|
|
417
420
|
value,
|
|
418
421
|
calendarValue,
|
|
419
422
|
isOpen,
|
|
420
423
|
selectInputValue
|
|
421
424
|
} = this.getSafeState();
|
|
425
|
+
let actualSelectInputValue;
|
|
426
|
+
if (getBooleanFF('platform.design-system-team.date-picker-input-a11y-fix_cbbxs')) {
|
|
427
|
+
actualSelectInputValue = selectInputValue || (value ? this.formatDate(value) : undefined);
|
|
428
|
+
} else {
|
|
429
|
+
actualSelectInputValue = selectInputValue;
|
|
430
|
+
}
|
|
422
431
|
const menuIsOpen = isOpen && !isDisabled;
|
|
423
432
|
const showClearIndicator = Boolean((value || selectInputValue) && !hideIcon);
|
|
424
433
|
const dropDownIcon = appearance === 'subtle' || hideIcon || showClearIndicator ? null : icon;
|
|
@@ -474,7 +483,7 @@ class DatePicker extends Component {
|
|
|
474
483
|
isDisabled: isDisabled,
|
|
475
484
|
onBlur: this.onSelectBlur,
|
|
476
485
|
onFocus: this.onSelectFocus,
|
|
477
|
-
inputValue:
|
|
486
|
+
inputValue: actualSelectInputValue,
|
|
478
487
|
onInputChange: this.handleSelectInputChange,
|
|
479
488
|
components: selectComponents,
|
|
480
489
|
onChange: this.onSelectChange,
|
|
@@ -485,10 +494,12 @@ class DatePicker extends Component {
|
|
|
485
494
|
}),
|
|
486
495
|
indicatorsContainer: base => ({
|
|
487
496
|
...base,
|
|
488
|
-
paddingLeft:
|
|
489
|
-
|
|
497
|
+
paddingLeft: "var(--ds-space-025, 2px)",
|
|
498
|
+
// ICON_PADDING = 2
|
|
499
|
+
paddingRight: "var(--ds-space-075, 6px)" // 8 - ICON_PADDING = 6
|
|
490
500
|
})
|
|
491
501
|
}),
|
|
502
|
+
|
|
492
503
|
placeholder: this.getPlaceholder(),
|
|
493
504
|
value: value && {
|
|
494
505
|
label: this.formatDate(value),
|
|
@@ -18,7 +18,7 @@ import DatePicker from './date-picker';
|
|
|
18
18
|
import TimePicker from './time-picker';
|
|
19
19
|
import { convertTokens } from './utils';
|
|
20
20
|
const packageName = "@atlaskit/datetime-picker";
|
|
21
|
-
const packageVersion = "12.
|
|
21
|
+
const packageVersion = "12.7.1";
|
|
22
22
|
|
|
23
23
|
/* eslint-disable react/no-unused-prop-types */
|
|
24
24
|
|
|
@@ -16,7 +16,7 @@ import FixedLayer from '../internal/fixed-layer';
|
|
|
16
16
|
import parseTime from '../internal/parse-time';
|
|
17
17
|
import { convertTokens } from './utils';
|
|
18
18
|
const packageName = "@atlaskit/datetime-picker";
|
|
19
|
-
const packageVersion = "12.
|
|
19
|
+
const packageVersion = "12.7.1";
|
|
20
20
|
|
|
21
21
|
/* eslint-disable react/no-unused-prop-types */
|
|
22
22
|
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import ScrollLock from 'react-scrolllock';
|
|
4
4
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
5
|
import { sizes } from '@atlaskit/icon';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { Manager, Popper, Reference } from '@atlaskit/popper';
|
|
7
8
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
8
9
|
import { gridSize, layers } from '@atlaskit/theme/constants';
|
|
@@ -32,7 +33,6 @@ export default class FixedLayer extends React.Component {
|
|
|
32
33
|
if (!containerRef) {
|
|
33
34
|
return /*#__PURE__*/React.createElement("div", null);
|
|
34
35
|
}
|
|
35
|
-
const containerRect = containerRef.getBoundingClientRect();
|
|
36
36
|
return (
|
|
37
37
|
/*#__PURE__*/
|
|
38
38
|
/* Need to wrap layer in a fixed position div so that it will render its content as fixed
|
|
@@ -43,12 +43,16 @@ export default class FixedLayer extends React.Component {
|
|
|
43
43
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
44
44
|
ref: ref,
|
|
45
45
|
"data-layer-child": true,
|
|
46
|
-
style: {
|
|
46
|
+
style: getBooleanFF('platform.design-system-team.date-picker-input-a11y-fix_cbbxs') ? {
|
|
47
|
+
inset: 0,
|
|
48
|
+
pointerEvents: 'none',
|
|
49
|
+
background: 'transparent'
|
|
50
|
+
} : {
|
|
47
51
|
position: 'absolute',
|
|
48
52
|
top: 0,
|
|
49
|
-
height:
|
|
53
|
+
height: containerRef.getBoundingClientRect().height,
|
|
50
54
|
// Don't block the clear button
|
|
51
|
-
width:
|
|
55
|
+
width: containerRef.getBoundingClientRect().width - parseInt(sizes.small.slice(0, -2)) - gridSize(),
|
|
52
56
|
background: 'transparent'
|
|
53
57
|
}
|
|
54
58
|
})), /*#__PURE__*/React.createElement(Popper, null, ({
|
package/dist/es2019/version.json
CHANGED
|
@@ -22,15 +22,15 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
22
22
|
import Calendar from '@atlaskit/calendar';
|
|
23
23
|
import CalendarIcon from '@atlaskit/icon/glyph/calendar';
|
|
24
24
|
import { createLocalizationProvider } from '@atlaskit/locale';
|
|
25
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
25
26
|
import Select, { mergeStyles } from '@atlaskit/select';
|
|
26
27
|
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
27
|
-
|
|
28
|
-
import { borderRadius, gridSize, layers } from '@atlaskit/theme/constants';
|
|
28
|
+
import { borderRadius, layers } from '@atlaskit/theme/constants';
|
|
29
29
|
import { defaultDateFormat, EmptyComponent, padToTwo, placeholderDatetime } from '../internal';
|
|
30
30
|
import FixedLayer from '../internal/fixed-layer';
|
|
31
31
|
import { convertTokens } from './utils';
|
|
32
32
|
var packageName = "@atlaskit/datetime-picker";
|
|
33
|
-
var packageVersion = "12.
|
|
33
|
+
var packageVersion = "12.7.1";
|
|
34
34
|
|
|
35
35
|
/* eslint-disable react/no-unused-prop-types */
|
|
36
36
|
|
|
@@ -251,13 +251,17 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
251
251
|
break;
|
|
252
252
|
case 'backspace':
|
|
253
253
|
case 'delete':
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
254
|
+
{
|
|
255
|
+
var inputCount = getBooleanFF('platform.design-system-team.date-picker-input-a11y-fix_cbbxs') ? 1 : 0;
|
|
256
|
+
if (value && event.target instanceof HTMLInputElement && event.target.value.length <= inputCount) {
|
|
257
|
+
// If being cleared from keyboard, don't change behaviour
|
|
258
|
+
_this.setState({
|
|
259
|
+
clearingFromIcon: false,
|
|
260
|
+
value: ''
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
break;
|
|
259
264
|
}
|
|
260
|
-
break;
|
|
261
265
|
case 'enter':
|
|
262
266
|
if (!_this.state.isOpen) {
|
|
263
267
|
return;
|
|
@@ -418,12 +422,17 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
418
422
|
locale = _this$props3.locale,
|
|
419
423
|
testId = _this$props3.testId,
|
|
420
424
|
weekStartDay = _this$props3.weekStartDay;
|
|
421
|
-
var ICON_PADDING = 2;
|
|
422
425
|
var _this$getSafeState7 = this.getSafeState(),
|
|
423
426
|
value = _this$getSafeState7.value,
|
|
424
427
|
calendarValue = _this$getSafeState7.calendarValue,
|
|
425
428
|
isOpen = _this$getSafeState7.isOpen,
|
|
426
429
|
selectInputValue = _this$getSafeState7.selectInputValue;
|
|
430
|
+
var actualSelectInputValue;
|
|
431
|
+
if (getBooleanFF('platform.design-system-team.date-picker-input-a11y-fix_cbbxs')) {
|
|
432
|
+
actualSelectInputValue = selectInputValue || (value ? this.formatDate(value) : undefined);
|
|
433
|
+
} else {
|
|
434
|
+
actualSelectInputValue = selectInputValue;
|
|
435
|
+
}
|
|
427
436
|
var menuIsOpen = isOpen && !isDisabled;
|
|
428
437
|
var showClearIndicator = Boolean((value || selectInputValue) && !hideIcon);
|
|
429
438
|
var dropDownIcon = appearance === 'subtle' || hideIcon || showClearIndicator ? null : icon;
|
|
@@ -477,7 +486,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
477
486
|
isDisabled: isDisabled,
|
|
478
487
|
onBlur: this.onSelectBlur,
|
|
479
488
|
onFocus: this.onSelectFocus,
|
|
480
|
-
inputValue:
|
|
489
|
+
inputValue: actualSelectInputValue,
|
|
481
490
|
onInputChange: this.handleSelectInputChange,
|
|
482
491
|
components: selectComponents,
|
|
483
492
|
onChange: this.onSelectChange,
|
|
@@ -487,11 +496,13 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
487
496
|
},
|
|
488
497
|
indicatorsContainer: function indicatorsContainer(base) {
|
|
489
498
|
return _objectSpread(_objectSpread({}, base), {}, {
|
|
490
|
-
paddingLeft:
|
|
491
|
-
|
|
499
|
+
paddingLeft: "var(--ds-space-025, 2px)",
|
|
500
|
+
// ICON_PADDING = 2
|
|
501
|
+
paddingRight: "var(--ds-space-075, 6px)" // 8 - ICON_PADDING = 6
|
|
492
502
|
});
|
|
493
503
|
}
|
|
494
504
|
}),
|
|
505
|
+
|
|
495
506
|
placeholder: this.getPlaceholder(),
|
|
496
507
|
value: value && {
|
|
497
508
|
label: this.formatDate(value),
|
|
@@ -28,7 +28,7 @@ import DatePicker from './date-picker';
|
|
|
28
28
|
import TimePicker from './time-picker';
|
|
29
29
|
import { convertTokens } from './utils';
|
|
30
30
|
var packageName = "@atlaskit/datetime-picker";
|
|
31
|
-
var packageVersion = "12.
|
|
31
|
+
var packageVersion = "12.7.1";
|
|
32
32
|
|
|
33
33
|
/* eslint-disable react/no-unused-prop-types */
|
|
34
34
|
|
|
@@ -29,7 +29,7 @@ import FixedLayer from '../internal/fixed-layer';
|
|
|
29
29
|
import parseTime from '../internal/parse-time';
|
|
30
30
|
import { convertTokens } from './utils';
|
|
31
31
|
var packageName = "@atlaskit/datetime-picker";
|
|
32
|
-
var packageVersion = "12.
|
|
32
|
+
var packageVersion = "12.7.1";
|
|
33
33
|
|
|
34
34
|
/* eslint-disable react/no-unused-prop-types */
|
|
35
35
|
|
|
@@ -13,6 +13,7 @@ import React from 'react';
|
|
|
13
13
|
import ScrollLock from 'react-scrolllock';
|
|
14
14
|
import noop from '@atlaskit/ds-lib/noop';
|
|
15
15
|
import { sizes } from '@atlaskit/icon';
|
|
16
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
16
17
|
import { Manager, Popper, Reference } from '@atlaskit/popper';
|
|
17
18
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
18
19
|
import { gridSize, layers } from '@atlaskit/theme/constants';
|
|
@@ -54,7 +55,6 @@ var FixedLayer = /*#__PURE__*/function (_React$Component) {
|
|
|
54
55
|
if (!containerRef) {
|
|
55
56
|
return /*#__PURE__*/React.createElement("div", null);
|
|
56
57
|
}
|
|
57
|
-
var containerRect = containerRef.getBoundingClientRect();
|
|
58
58
|
return (
|
|
59
59
|
/*#__PURE__*/
|
|
60
60
|
/* Need to wrap layer in a fixed position div so that it will render its content as fixed
|
|
@@ -65,12 +65,16 @@ var FixedLayer = /*#__PURE__*/function (_React$Component) {
|
|
|
65
65
|
return /*#__PURE__*/React.createElement("div", {
|
|
66
66
|
ref: ref,
|
|
67
67
|
"data-layer-child": true,
|
|
68
|
-
style: {
|
|
68
|
+
style: getBooleanFF('platform.design-system-team.date-picker-input-a11y-fix_cbbxs') ? {
|
|
69
|
+
inset: 0,
|
|
70
|
+
pointerEvents: 'none',
|
|
71
|
+
background: 'transparent'
|
|
72
|
+
} : {
|
|
69
73
|
position: 'absolute',
|
|
70
74
|
top: 0,
|
|
71
|
-
height:
|
|
75
|
+
height: containerRef.getBoundingClientRect().height,
|
|
72
76
|
// Don't block the clear button
|
|
73
|
-
width:
|
|
77
|
+
width: containerRef.getBoundingClientRect().width - parseInt(sizes.small.slice(0, -2)) - gridSize(),
|
|
74
78
|
background: 'transparent'
|
|
75
79
|
}
|
|
76
80
|
});
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/datetime-picker",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.7.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/"
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"@atlaskit/locale": "^2.5.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
41
41
|
"@atlaskit/popper": "^5.5.0",
|
|
42
|
-
"@atlaskit/select": "^16.
|
|
42
|
+
"@atlaskit/select": "^16.5.0",
|
|
43
43
|
"@atlaskit/theme": "^12.5.0",
|
|
44
|
-
"@atlaskit/tokens": "^1.
|
|
44
|
+
"@atlaskit/tokens": "^1.5.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@emotion/react": "^11.7.1",
|
|
47
47
|
"date-fns": "^2.17.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@atlaskit/docs": "*",
|
|
57
57
|
"@atlaskit/field-base": "^15.2.0",
|
|
58
58
|
"@atlaskit/form": "^8.11.0",
|
|
59
|
-
"@atlaskit/modal-dialog": "^12.
|
|
59
|
+
"@atlaskit/modal-dialog": "^12.6.0",
|
|
60
60
|
"@atlaskit/popup": "^1.6.0",
|
|
61
61
|
"@atlaskit/range": "^7.1.0",
|
|
62
62
|
"@atlaskit/section-message": "^6.4.0",
|
|
@@ -98,6 +98,9 @@
|
|
|
98
98
|
"platform-feature-flags": {
|
|
99
99
|
"platform.design-system-team.update-border-input_ff9l1": {
|
|
100
100
|
"type": "boolean"
|
|
101
|
+
},
|
|
102
|
+
"platform.design-system-team.date-picker-input-a11y-fix_cbbxs": {
|
|
103
|
+
"type": "boolean"
|
|
101
104
|
}
|
|
102
105
|
},
|
|
103
106
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|