@atlaskit/datetime-picker 19.3.0 → 19.3.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 +7 -0
- package/codemods/utils/create-remove-func-for.tsx +1 -1
- package/dist/cjs/components/date-picker.js +3 -3
- package/dist/cjs/components/date-time-picker.js +6 -5
- package/dist/cjs/components/time-picker.js +1 -1
- package/dist/cjs/internal/parse-date.js +1 -2
- package/dist/es2019/components/date-picker.js +2 -2
- package/dist/es2019/components/date-time-picker.js +3 -2
- package/dist/es2019/components/time-picker.js +1 -1
- package/dist/es2019/internal/parse-date.js +1 -2
- package/dist/esm/components/date-picker.js +2 -2
- package/dist/esm/components/date-time-picker.js +3 -2
- package/dist/esm/components/time-picker.js +1 -1
- package/dist/esm/internal/parse-date.js +1 -2
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/datetime-picker
|
|
2
2
|
|
|
3
|
+
## 19.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`43a440595095c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/43a440595095c) -
|
|
8
|
+
Remove the current-reference-date feature gate. Current-date parsing is now permanent.
|
|
9
|
+
|
|
3
10
|
## 19.3.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type JSCodeshift } from 'jscodeshift';
|
|
2
2
|
import { type Collection } from 'jscodeshift/src/Collection';
|
|
3
3
|
|
|
4
|
-
import { addCommentToStartOfFile, getNamedSpecifier } from '@atlaskit/codemod-utils';
|
|
4
|
+
import { addCommentToStartOfFile, getNamedSpecifier } from '@atlaskit/codemod-utils/support';
|
|
5
5
|
|
|
6
6
|
import { getJSXAttributesByName } from './get-jsx-attributes-by-name';
|
|
7
7
|
|
|
@@ -22,7 +22,7 @@ var _useId = require("@atlaskit/ds-lib/use-id");
|
|
|
22
22
|
var _calendar = _interopRequireDefault(require("@atlaskit/icon/core/calendar"));
|
|
23
23
|
var _localizationProvider = require("@atlaskit/locale/localization-provider");
|
|
24
24
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
25
|
-
var
|
|
25
|
+
var _box = require("@atlaskit/primitives/compiled/box");
|
|
26
26
|
var _styles = require("@atlaskit/react-select/styles");
|
|
27
27
|
var _default2 = _interopRequireDefault(require("@atlaskit/select/default"));
|
|
28
28
|
var _emptyComponent = require("../internal/empty-component");
|
|
@@ -47,7 +47,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
47
47
|
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; }
|
|
48
48
|
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; }
|
|
49
49
|
var packageName = "@atlaskit/datetime-picker";
|
|
50
|
-
var packageVersion = "19.
|
|
50
|
+
var packageVersion = "19.3.0";
|
|
51
51
|
var styles = {
|
|
52
52
|
pickerContainerStyle: "_kqswh2mm",
|
|
53
53
|
dropdownIndicatorStyles: "_1ul91k8s _1tke1k8s _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
@@ -498,7 +498,7 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, _forwarded
|
|
|
498
498
|
var menuIsOpen = getIsOpen() && !isDisabled;
|
|
499
499
|
var showClearIndicator = Boolean((getterValue || selectInputValue) && !hideIcon);
|
|
500
500
|
var clearIndicator = function clearIndicator(props) {
|
|
501
|
-
return /*#__PURE__*/React.createElement(
|
|
501
|
+
return /*#__PURE__*/React.createElement(_box.Box, {
|
|
502
502
|
xcss: styles.dropdownIndicatorStyles
|
|
503
503
|
}, /*#__PURE__*/React.createElement(Icon, props));
|
|
504
504
|
};
|
|
@@ -19,7 +19,8 @@ var _usePlatformLeafEventHandler = require("@atlaskit/analytics-next/usePlatform
|
|
|
19
19
|
var _button = _interopRequireDefault(require("@atlaskit/button/icon/button"));
|
|
20
20
|
var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/core/cross-circle"));
|
|
21
21
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
22
|
-
var
|
|
22
|
+
var _box = require("@atlaskit/primitives/compiled/box");
|
|
23
|
+
var _inline = require("@atlaskit/primitives/compiled/inline");
|
|
23
24
|
var _styles = require("@atlaskit/react-select/styles");
|
|
24
25
|
var _dateTimePickerContainer = require("../internal/date-time-picker-container");
|
|
25
26
|
var _formatDateTimeZoneIntoIso = require("../internal/format-date-time-zone-into-iso");
|
|
@@ -34,7 +35,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
34
35
|
// for typing `process`
|
|
35
36
|
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
36
37
|
var packageName = "@atlaskit/datetime-picker";
|
|
37
|
-
var packageVersion = "19.
|
|
38
|
+
var packageVersion = "19.3.0";
|
|
38
39
|
var analyticsAttributes = {
|
|
39
40
|
componentName: 'dateTimePicker',
|
|
40
41
|
packageName: packageName,
|
|
@@ -448,7 +449,7 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
448
449
|
type: "hidden",
|
|
449
450
|
value: dtState.value,
|
|
450
451
|
"data-testid": testId && "".concat(testId, "--input")
|
|
451
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
452
|
+
}), /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
452
453
|
xcss: compiledStyles.datePickerContainerStyles
|
|
453
454
|
}, /*#__PURE__*/_react.default.createElement(_datePicker.default, {
|
|
454
455
|
appearance: appearance,
|
|
@@ -490,7 +491,7 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
490
491
|
testId: testId && "".concat(testId, "--datepicker") || datePickerProps.testId,
|
|
491
492
|
value: dtState.dateValue,
|
|
492
493
|
weekStartDay: datePickerProps.weekStartDay
|
|
493
|
-
})), /*#__PURE__*/_react.default.createElement(
|
|
494
|
+
})), /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
494
495
|
xcss: compiledStyles.timePickerContainerStyles
|
|
495
496
|
}, /*#__PURE__*/_react.default.createElement(_timePicker.default, {
|
|
496
497
|
appearance: timePickerProps.appearance || appearance,
|
|
@@ -523,7 +524,7 @@ var DateTimePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
523
524
|
timeIsEditable: timePickerProps.timeIsEditable,
|
|
524
525
|
times: timePickerProps.times,
|
|
525
526
|
value: dtState.timeValue
|
|
526
|
-
})), hasClearButton ? /*#__PURE__*/_react.default.createElement(
|
|
527
|
+
})), hasClearButton ? /*#__PURE__*/_react.default.createElement(_inline.Inline, {
|
|
527
528
|
xcss: compiledStyles.iconContainerStyles
|
|
528
529
|
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
529
530
|
appearance: "subtle",
|
|
@@ -38,7 +38,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
38
38
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
39
39
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
40
40
|
var packageName = "@atlaskit/datetime-picker";
|
|
41
|
-
var packageVersion = "19.
|
|
41
|
+
var packageVersion = "19.3.0";
|
|
42
42
|
var defaultTimeFormat = 'h:mma';
|
|
43
43
|
var menuStyles = {
|
|
44
44
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.parseDate = void 0;
|
|
7
7
|
var _dateFns = require("date-fns");
|
|
8
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
9
8
|
var _defaultDateFormat = require("./default-date-format");
|
|
10
9
|
var _parseTokens = require("./parse-tokens");
|
|
11
10
|
/**
|
|
@@ -47,7 +46,7 @@ var parseDate = exports.parseDate = function parseDate(date, di) {
|
|
|
47
46
|
if (dateFormat) {
|
|
48
47
|
// date-fns uses the reference year to resolve two-digit years and fill
|
|
49
48
|
// omitted years. Use the current local date rather than the Unix epoch.
|
|
50
|
-
var referenceDate =
|
|
49
|
+
var referenceDate = new Date();
|
|
51
50
|
var parsed = (0, _dateFns.parse)(date, (0, _parseTokens.convertTokens)(dateFormat), referenceDate);
|
|
52
51
|
// `dateFormat` is a display format, so typed input does not always match
|
|
53
52
|
// it. Locale parsing stays as the fallback so those entries still work.
|
|
@@ -15,7 +15,7 @@ import { useId } from '@atlaskit/ds-lib/use-id';
|
|
|
15
15
|
import CalendarIcon from '@atlaskit/icon/core/calendar';
|
|
16
16
|
import { createLocalizationProvider } from '@atlaskit/locale/localization-provider';
|
|
17
17
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
18
|
-
import { Box } from '@atlaskit/primitives/compiled';
|
|
18
|
+
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
19
19
|
import { mergeStyles } from '@atlaskit/react-select/styles';
|
|
20
20
|
import Select from '@atlaskit/select/default';
|
|
21
21
|
import { EmptyComponent } from '../internal/empty-component';
|
|
@@ -32,7 +32,7 @@ import { parseDate } from '../internal/parse-date';
|
|
|
32
32
|
import { PickerButtonContainer } from '../internal/picker-button-container';
|
|
33
33
|
import { makeSingleValue } from '../internal/single-value';
|
|
34
34
|
const packageName = "@atlaskit/datetime-picker";
|
|
35
|
-
const packageVersion = "19.
|
|
35
|
+
const packageVersion = "19.3.0";
|
|
36
36
|
const styles = {
|
|
37
37
|
pickerContainerStyle: "_kqswh2mm",
|
|
38
38
|
dropdownIndicatorStyles: "_1ul91k8s _1tke1k8s _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
@@ -13,7 +13,8 @@ import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatfor
|
|
|
13
13
|
import IconButton from '@atlaskit/button/icon/button';
|
|
14
14
|
import SelectClearIcon from '@atlaskit/icon/core/cross-circle';
|
|
15
15
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
16
|
-
import { Box
|
|
16
|
+
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
17
|
+
import { Inline } from '@atlaskit/primitives/compiled/inline';
|
|
17
18
|
import { mergeStyles } from '@atlaskit/react-select/styles';
|
|
18
19
|
import { DateTimePickerContainer } from '../internal/date-time-picker-container';
|
|
19
20
|
import { formatDateTimeZoneIntoIso } from '../internal/format-date-time-zone-into-iso';
|
|
@@ -21,7 +22,7 @@ import { convertTokens } from '../internal/parse-tokens';
|
|
|
21
22
|
import DatePicker from './date-picker';
|
|
22
23
|
import TimePicker from './time-picker';
|
|
23
24
|
const packageName = "@atlaskit/datetime-picker";
|
|
24
|
-
const packageVersion = "19.
|
|
25
|
+
const packageVersion = "19.3.0";
|
|
25
26
|
const analyticsAttributes = {
|
|
26
27
|
componentName: 'dateTimePicker',
|
|
27
28
|
packageName,
|
|
@@ -25,7 +25,7 @@ import { PickerButtonContainer } from '../internal/picker-button-container';
|
|
|
25
25
|
import { placeholderDatetime } from '../internal/placeholder-date-time';
|
|
26
26
|
import { makeSingleValue } from '../internal/single-value';
|
|
27
27
|
const packageName = "@atlaskit/datetime-picker";
|
|
28
|
-
const packageVersion = "19.
|
|
28
|
+
const packageVersion = "19.3.0";
|
|
29
29
|
const defaultTimeFormat = 'h:mma';
|
|
30
30
|
const menuStyles = {
|
|
31
31
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
*/
|
|
18
18
|
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
19
19
|
import { isValid, parse } from 'date-fns';
|
|
20
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
21
20
|
import { defaultDateFormat } from './default-date-format';
|
|
22
21
|
import { convertTokens } from './parse-tokens';
|
|
23
22
|
|
|
@@ -43,7 +42,7 @@ export const parseDate = (date, di) => {
|
|
|
43
42
|
if (dateFormat) {
|
|
44
43
|
// date-fns uses the reference year to resolve two-digit years and fill
|
|
45
44
|
// omitted years. Use the current local date rather than the Unix epoch.
|
|
46
|
-
const referenceDate =
|
|
45
|
+
const referenceDate = new Date();
|
|
47
46
|
const parsed = parse(date, convertTokens(dateFormat), referenceDate);
|
|
48
47
|
// `dateFormat` is a display format, so typed input does not always match
|
|
49
48
|
// it. Locale parsing stays as the fallback so those entries still work.
|
|
@@ -23,7 +23,7 @@ import { useId } from '@atlaskit/ds-lib/use-id';
|
|
|
23
23
|
import CalendarIcon from '@atlaskit/icon/core/calendar';
|
|
24
24
|
import { createLocalizationProvider } from '@atlaskit/locale/localization-provider';
|
|
25
25
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
26
|
-
import { Box } from '@atlaskit/primitives/compiled';
|
|
26
|
+
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
27
27
|
import { mergeStyles } from '@atlaskit/react-select/styles';
|
|
28
28
|
import Select from '@atlaskit/select/default';
|
|
29
29
|
import { EmptyComponent } from '../internal/empty-component';
|
|
@@ -40,7 +40,7 @@ import { parseDate } from '../internal/parse-date';
|
|
|
40
40
|
import { PickerButtonContainer } from '../internal/picker-button-container';
|
|
41
41
|
import { makeSingleValue } from '../internal/single-value';
|
|
42
42
|
var packageName = "@atlaskit/datetime-picker";
|
|
43
|
-
var packageVersion = "19.
|
|
43
|
+
var packageVersion = "19.3.0";
|
|
44
44
|
var styles = {
|
|
45
45
|
pickerContainerStyle: "_kqswh2mm",
|
|
46
46
|
dropdownIndicatorStyles: "_1ul91k8s _1tke1k8s _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
@@ -20,7 +20,8 @@ import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatfor
|
|
|
20
20
|
import IconButton from '@atlaskit/button/icon/button';
|
|
21
21
|
import SelectClearIcon from '@atlaskit/icon/core/cross-circle';
|
|
22
22
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
23
|
-
import { Box
|
|
23
|
+
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
24
|
+
import { Inline } from '@atlaskit/primitives/compiled/inline';
|
|
24
25
|
import { mergeStyles } from '@atlaskit/react-select/styles';
|
|
25
26
|
import { DateTimePickerContainer } from '../internal/date-time-picker-container';
|
|
26
27
|
import { formatDateTimeZoneIntoIso } from '../internal/format-date-time-zone-into-iso';
|
|
@@ -28,7 +29,7 @@ import { convertTokens } from '../internal/parse-tokens';
|
|
|
28
29
|
import DatePicker from './date-picker';
|
|
29
30
|
import TimePicker from './time-picker';
|
|
30
31
|
var packageName = "@atlaskit/datetime-picker";
|
|
31
|
-
var packageVersion = "19.
|
|
32
|
+
var packageVersion = "19.3.0";
|
|
32
33
|
var analyticsAttributes = {
|
|
33
34
|
componentName: 'dateTimePicker',
|
|
34
35
|
packageName: packageName,
|
|
@@ -31,7 +31,7 @@ import { PickerButtonContainer } from '../internal/picker-button-container';
|
|
|
31
31
|
import { placeholderDatetime } from '../internal/placeholder-date-time';
|
|
32
32
|
import { makeSingleValue } from '../internal/single-value';
|
|
33
33
|
var packageName = "@atlaskit/datetime-picker";
|
|
34
|
-
var packageVersion = "19.
|
|
34
|
+
var packageVersion = "19.3.0";
|
|
35
35
|
var defaultTimeFormat = 'h:mma';
|
|
36
36
|
var menuStyles = {
|
|
37
37
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
*/
|
|
18
18
|
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
19
19
|
import { isValid, parse } from 'date-fns';
|
|
20
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
21
20
|
import { defaultDateFormat } from './default-date-format';
|
|
22
21
|
import { convertTokens } from './parse-tokens';
|
|
23
22
|
|
|
@@ -41,7 +40,7 @@ export var parseDate = function parseDate(date, di) {
|
|
|
41
40
|
if (dateFormat) {
|
|
42
41
|
// date-fns uses the reference year to resolve two-digit years and fill
|
|
43
42
|
// omitted years. Use the current local date rather than the Unix epoch.
|
|
44
|
-
var referenceDate =
|
|
43
|
+
var referenceDate = new Date();
|
|
45
44
|
var parsed = parse(date, convertTokens(dateFormat), referenceDate);
|
|
46
45
|
// `dateFormat` is a display format, so typed input does not always match
|
|
47
46
|
// it. Locale parsing stays as the fallback so those entries still work.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/datetime-picker",
|
|
3
|
-
"version": "19.3.
|
|
3
|
+
"version": "19.3.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/"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
49
49
|
"@atlaskit/react-select": "^4.12.0",
|
|
50
50
|
"@atlaskit/select": "^23.1.0",
|
|
51
|
-
"@atlaskit/tokens": "^20.
|
|
51
|
+
"@atlaskit/tokens": "^20.4.0",
|
|
52
52
|
"@atlaskit/top-layer": "^6.2.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@compiled/react": "^1.0.2",
|
|
@@ -91,9 +91,6 @@
|
|
|
91
91
|
"platform-dst-top-layer": {
|
|
92
92
|
"type": "boolean"
|
|
93
93
|
},
|
|
94
|
-
"platform-dst-dp-current-reference-date": {
|
|
95
|
-
"type": "boolean"
|
|
96
|
-
},
|
|
97
94
|
"platform-dst-motion-uplift-input": {
|
|
98
95
|
"type": "boolean",
|
|
99
96
|
"referenceOnly": true
|