@atlaskit/datetime-picker 13.7.1 → 13.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/components/date-picker.js +25 -13
- package/dist/cjs/components/date-time-picker.js +24 -11
- package/dist/cjs/components/time-picker.js +23 -11
- package/dist/cjs/internal/parse-time.js +2 -2
- package/dist/es2019/components/date-picker.js +22 -9
- package/dist/es2019/components/date-time-picker.js +20 -6
- package/dist/es2019/components/time-picker.js +19 -6
- package/dist/es2019/internal/parse-time.js +1 -1
- package/dist/esm/components/date-picker.js +28 -15
- package/dist/esm/components/date-time-picker.js +26 -12
- package/dist/esm/components/time-picker.js +25 -12
- package/dist/esm/internal/parse-time.js +1 -1
- package/dist/types/components/date-picker.d.ts +16 -7
- package/dist/types/components/date-time-picker.d.ts +13 -4
- package/dist/types/components/time-picker.d.ts +14 -5
- package/dist/types/internal/parse-time.d.ts +1 -1
- package/dist/types/types.d.ts +15 -0
- package/dist/types-ts4.5/components/date-picker.d.ts +16 -7
- package/dist/types-ts4.5/components/date-time-picker.d.ts +13 -4
- package/dist/types-ts4.5/components/time-picker.d.ts +14 -5
- package/dist/types-ts4.5/internal/parse-time.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +15 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/datetime-picker
|
|
2
2
|
|
|
3
|
+
## 13.7.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#121570](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/121570)
|
|
8
|
+
[`6026292f28f06`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6026292f28f06) -
|
|
9
|
+
[ux] Allows `aria-describedby` on all pickers. This will ensure messages from the form's field
|
|
10
|
+
component will be applied properly.
|
|
11
|
+
|
|
12
|
+
## 13.7.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#120049](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120049)
|
|
17
|
+
[`77504ff274f72`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77504ff274f72) -
|
|
18
|
+
DSP-19576: Assign names to anonymous default exports
|
|
19
|
+
|
|
3
20
|
## 13.7.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -38,7 +38,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
38
38
|
* @jsxRuntime classic
|
|
39
39
|
*/ /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
40
40
|
var packageName = "@atlaskit/datetime-picker";
|
|
41
|
-
var packageVersion = "13.7.
|
|
41
|
+
var packageVersion = "13.7.3";
|
|
42
42
|
var datePickerDefaultProps = {
|
|
43
43
|
appearance: 'default',
|
|
44
44
|
autoFocus: false,
|
|
@@ -69,12 +69,12 @@ var datePickerDefaultProps = {
|
|
|
69
69
|
// Not including a default prop for value as it will
|
|
70
70
|
// Make the component a controlled component
|
|
71
71
|
};
|
|
72
|
-
var
|
|
73
|
-
(0, _inherits2.default)(
|
|
74
|
-
var _super = _createSuper(
|
|
75
|
-
function
|
|
72
|
+
var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/function (_Component) {
|
|
73
|
+
(0, _inherits2.default)(DatePickerComponent, _Component);
|
|
74
|
+
var _super = _createSuper(DatePickerComponent);
|
|
75
|
+
function DatePickerComponent(props) {
|
|
76
76
|
var _this;
|
|
77
|
-
(0, _classCallCheck2.default)(this,
|
|
77
|
+
(0, _classCallCheck2.default)(this, DatePickerComponent);
|
|
78
78
|
_this = _super.call(this, props);
|
|
79
79
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "calendarRef", null);
|
|
80
80
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "containerRef", null);
|
|
@@ -229,7 +229,7 @@ var DatePicker = exports.DatePickerWithoutAnalytics = /*#__PURE__*/function (_Co
|
|
|
229
229
|
case 'backspace':
|
|
230
230
|
case 'delete':
|
|
231
231
|
{
|
|
232
|
-
var inputCount = (0, _platformFeatureFlags.
|
|
232
|
+
var inputCount = (0, _platformFeatureFlags.fg)('platform.design-system-team.date-picker-input-a11y-fix_cbbxs') ? 1 : 0;
|
|
233
233
|
if (value && event.target instanceof HTMLInputElement && event.target.value.length <= inputCount) {
|
|
234
234
|
// If being cleared from keyboard, don't change behaviour
|
|
235
235
|
_this.setState({
|
|
@@ -365,11 +365,12 @@ var DatePicker = exports.DatePickerWithoutAnalytics = /*#__PURE__*/function (_Co
|
|
|
365
365
|
};
|
|
366
366
|
return _this;
|
|
367
367
|
}
|
|
368
|
-
(0, _createClass2.default)(
|
|
368
|
+
(0, _createClass2.default)(DatePickerComponent, [{
|
|
369
369
|
key: "render",
|
|
370
370
|
value: function render() {
|
|
371
371
|
var _this$props3 = this.props,
|
|
372
372
|
appearance = _this$props3.appearance,
|
|
373
|
+
ariaDescribedBy = _this$props3['aria-describedby'],
|
|
373
374
|
autoFocus = _this$props3.autoFocus,
|
|
374
375
|
disabled = _this$props3.disabled,
|
|
375
376
|
hideIcon = _this$props3.hideIcon,
|
|
@@ -396,7 +397,7 @@ var DatePicker = exports.DatePickerWithoutAnalytics = /*#__PURE__*/function (_Co
|
|
|
396
397
|
isOpen = _this$getSafeState6.isOpen,
|
|
397
398
|
selectInputValue = _this$getSafeState6.selectInputValue;
|
|
398
399
|
var actualSelectInputValue;
|
|
399
|
-
if ((0, _platformFeatureFlags.
|
|
400
|
+
if ((0, _platformFeatureFlags.fg)('platform.design-system-team.date-picker-input-a11y-fix_cbbxs')) {
|
|
400
401
|
actualSelectInputValue = selectInputValue || (value ? this.formatDate(value) : undefined);
|
|
401
402
|
} else {
|
|
402
403
|
actualSelectInputValue = selectInputValue;
|
|
@@ -453,6 +454,7 @@ var DatePicker = exports.DatePickerWithoutAnalytics = /*#__PURE__*/function (_Co
|
|
|
453
454
|
value: value,
|
|
454
455
|
"data-testid": testId && "".concat(testId, "--input")
|
|
455
456
|
}), (0, _react2.jsx)(_select.default, (0, _extends2.default)({
|
|
457
|
+
"aria-describedby": ariaDescribedBy,
|
|
456
458
|
"aria-label": label || undefined,
|
|
457
459
|
appearance: this.props.appearance,
|
|
458
460
|
enableAnimation: false,
|
|
@@ -507,10 +509,19 @@ var DatePicker = exports.DatePickerWithoutAnalytics = /*#__PURE__*/function (_Co
|
|
|
507
509
|
}
|
|
508
510
|
}
|
|
509
511
|
}]);
|
|
510
|
-
return
|
|
512
|
+
return DatePickerComponent;
|
|
511
513
|
}(_react.Component);
|
|
512
|
-
(0, _defineProperty2.default)(
|
|
513
|
-
|
|
514
|
+
(0, _defineProperty2.default)(DatePickerComponent, "defaultProps", datePickerDefaultProps);
|
|
515
|
+
/**
|
|
516
|
+
* __Date picker__
|
|
517
|
+
*
|
|
518
|
+
* A date picker allows the user to select a particular date.
|
|
519
|
+
*
|
|
520
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/date-picker/examples)
|
|
521
|
+
* - [Code](https://atlassian.design/components/datetime-picker/date-picker/code)
|
|
522
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/date-picker/usage)
|
|
523
|
+
*/
|
|
524
|
+
var DatePicker = (0, _analyticsNext.withAnalyticsContext)({
|
|
514
525
|
componentName: 'datePicker',
|
|
515
526
|
packageName: packageName,
|
|
516
527
|
packageVersion: packageVersion
|
|
@@ -524,4 +535,5 @@ var _default = exports.default = (0, _analyticsNext.withAnalyticsContext)({
|
|
|
524
535
|
packageVersion: packageVersion
|
|
525
536
|
}
|
|
526
537
|
})
|
|
527
|
-
})(
|
|
538
|
+
})(DatePickerComponent));
|
|
539
|
+
var _default = exports.default = DatePicker;
|
|
@@ -33,7 +33,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
33
33
|
* @jsxRuntime classic
|
|
34
34
|
*/ /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
35
35
|
var packageName = "@atlaskit/datetime-picker";
|
|
36
|
-
var packageVersion = "13.7.
|
|
36
|
+
var packageVersion = "13.7.3";
|
|
37
37
|
// Make DatePicker 50% the width of DateTimePicker
|
|
38
38
|
// If rendering an icon container, shrink the TimePicker
|
|
39
39
|
var datePickerContainerStyles = (0, _react2.css)({
|
|
@@ -107,12 +107,12 @@ var dateTimePickerDefaultProps = {
|
|
|
107
107
|
};
|
|
108
108
|
var datePickerDefaultAriaLabel = exports.datePickerDefaultAriaLabel = 'Date';
|
|
109
109
|
var timePickerDefaultAriaLabel = exports.timePickerDefaultAriaLabel = 'Time';
|
|
110
|
-
var
|
|
111
|
-
(0, _inherits2.default)(
|
|
112
|
-
var _super = _createSuper(
|
|
113
|
-
function
|
|
110
|
+
var DateTimePickerComponent = exports.DateTimePickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
111
|
+
(0, _inherits2.default)(DateTimePickerComponent, _React$Component);
|
|
112
|
+
var _super = _createSuper(DateTimePickerComponent);
|
|
113
|
+
function DateTimePickerComponent() {
|
|
114
114
|
var _this;
|
|
115
|
-
(0, _classCallCheck2.default)(this,
|
|
115
|
+
(0, _classCallCheck2.default)(this, DateTimePickerComponent);
|
|
116
116
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
117
117
|
args[_key] = arguments[_key];
|
|
118
118
|
}
|
|
@@ -160,7 +160,7 @@ var DateTimePicker = exports.DateTimePickerWithoutAnalytics = /*#__PURE__*/funct
|
|
|
160
160
|
});
|
|
161
161
|
return _this;
|
|
162
162
|
}
|
|
163
|
-
(0, _createClass2.default)(
|
|
163
|
+
(0, _createClass2.default)(DateTimePickerComponent, [{
|
|
164
164
|
key: "parseValue",
|
|
165
165
|
value: function parseValue(value, dateValue, timeValue, zoneValue) {
|
|
166
166
|
if (this.props.parseValue) {
|
|
@@ -209,6 +209,7 @@ var DateTimePicker = exports.DateTimePickerWithoutAnalytics = /*#__PURE__*/funct
|
|
|
209
209
|
key: "render",
|
|
210
210
|
value: function render() {
|
|
211
211
|
var _this$props = this.props,
|
|
212
|
+
ariaDescribedBy = _this$props['aria-describedby'],
|
|
212
213
|
autoFocus = _this$props.autoFocus,
|
|
213
214
|
id = _this$props.id,
|
|
214
215
|
innerProps = _this$props.innerProps,
|
|
@@ -242,10 +243,12 @@ var DateTimePicker = exports.DateTimePickerWithoutAnalytics = /*#__PURE__*/funct
|
|
|
242
243
|
var _timePickerSelectProp = timePickerSelectProps.styles,
|
|
243
244
|
timePickerStyles = _timePickerSelectProp === void 0 ? {} : _timePickerSelectProp;
|
|
244
245
|
var mergedDatePickerSelectProps = _objectSpread(_objectSpread({}, datePickerSelectProps), {}, {
|
|
246
|
+
'aria-describedby': datePickerProps['aria-describedby'] || ariaDescribedBy,
|
|
245
247
|
'aria-label': datePickerProps['label'] || datePickerSelectProps['aria-label'] || datePickerDefaultAriaLabel,
|
|
246
248
|
styles: (0, _select.mergeStyles)(styles, datePickerStyles)
|
|
247
249
|
});
|
|
248
250
|
var mergedTimePickerSelectProps = _objectSpread(_objectSpread({}, timePickerSelectProps), {}, {
|
|
251
|
+
'aria-describedby': timePickerProps['aria-describedby'] || ariaDescribedBy,
|
|
249
252
|
'aria-label': timePickerProps['label'] || timePickerSelectProps['aria-label'] || timePickerDefaultAriaLabel,
|
|
250
253
|
styles: (0, _select.mergeStyles)(styles, timePickerStyles)
|
|
251
254
|
});
|
|
@@ -302,10 +305,19 @@ var DateTimePicker = exports.DateTimePickerWithoutAnalytics = /*#__PURE__*/funct
|
|
|
302
305
|
})) : null);
|
|
303
306
|
}
|
|
304
307
|
}]);
|
|
305
|
-
return
|
|
308
|
+
return DateTimePickerComponent;
|
|
306
309
|
}(_react.default.Component);
|
|
307
|
-
(0, _defineProperty2.default)(
|
|
308
|
-
|
|
310
|
+
(0, _defineProperty2.default)(DateTimePickerComponent, "defaultProps", dateTimePickerDefaultProps);
|
|
311
|
+
/**
|
|
312
|
+
* __Date time picker__
|
|
313
|
+
*
|
|
314
|
+
* A date time picker allows the user to select an associated date and time.
|
|
315
|
+
*
|
|
316
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/examples)
|
|
317
|
+
* - [Code](https://atlassian.design/components/datetime-picker/code)
|
|
318
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/usage)
|
|
319
|
+
*/
|
|
320
|
+
var DateTimePicker = (0, _analyticsNext.withAnalyticsContext)({
|
|
309
321
|
componentName: 'dateTimePicker',
|
|
310
322
|
packageName: packageName,
|
|
311
323
|
packageVersion: packageVersion
|
|
@@ -319,4 +331,5 @@ var _default = exports.default = (0, _analyticsNext.withAnalyticsContext)({
|
|
|
319
331
|
packageVersion: packageVersion
|
|
320
332
|
}
|
|
321
333
|
})
|
|
322
|
-
})(
|
|
334
|
+
})(DateTimePickerComponent));
|
|
335
|
+
var _default = exports.default = DateTimePicker;
|
|
@@ -36,7 +36,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
36
36
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // eslint-disable-next-line no-restricted-imports
|
|
37
37
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
38
38
|
var packageName = "@atlaskit/datetime-picker";
|
|
39
|
-
var packageVersion = "13.7.
|
|
39
|
+
var packageVersion = "13.7.3";
|
|
40
40
|
var menuStyles = {
|
|
41
41
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
42
42
|
position: 'static',
|
|
@@ -75,12 +75,12 @@ var timePickerDefaultProps = {
|
|
|
75
75
|
// Not including a default prop for value as it will
|
|
76
76
|
// Make the component a controlled component
|
|
77
77
|
};
|
|
78
|
-
var
|
|
79
|
-
(0, _inherits2.default)(
|
|
80
|
-
var _super = _createSuper(
|
|
81
|
-
function
|
|
78
|
+
var TimePickerComponent = exports.TimePickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
79
|
+
(0, _inherits2.default)(TimePickerComponent, _React$Component);
|
|
80
|
+
var _super = _createSuper(TimePickerComponent);
|
|
81
|
+
function TimePickerComponent() {
|
|
82
82
|
var _this;
|
|
83
|
-
(0, _classCallCheck2.default)(this,
|
|
83
|
+
(0, _classCallCheck2.default)(this, TimePickerComponent);
|
|
84
84
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
85
85
|
args[_key] = arguments[_key];
|
|
86
86
|
}
|
|
@@ -193,12 +193,13 @@ var TimePicker = exports.TimePickerWithoutAnalytics = /*#__PURE__*/function (_Re
|
|
|
193
193
|
});
|
|
194
194
|
return _this;
|
|
195
195
|
}
|
|
196
|
-
(0, _createClass2.default)(
|
|
196
|
+
(0, _createClass2.default)(TimePickerComponent, [{
|
|
197
197
|
key: "render",
|
|
198
198
|
value: function render() {
|
|
199
199
|
var _this2 = this;
|
|
200
200
|
var _this$props2 = this.props,
|
|
201
201
|
appearance = _this$props2.appearance,
|
|
202
|
+
ariaDescribedBy = _this$props2['aria-describedby'],
|
|
202
203
|
autoFocus = _this$props2.autoFocus,
|
|
203
204
|
formatDisplayLabel = _this$props2.formatDisplayLabel,
|
|
204
205
|
hideIcon = _this$props2.hideIcon,
|
|
@@ -299,6 +300,7 @@ var TimePicker = exports.TimePickerWithoutAnalytics = /*#__PURE__*/function (_Re
|
|
|
299
300
|
"data-testid": testId && "".concat(testId, "--input"),
|
|
300
301
|
onKeyDown: this.onSelectKeyDown
|
|
301
302
|
}), /*#__PURE__*/_react.default.createElement(SelectComponent, (0, _extends2.default)({
|
|
303
|
+
"aria-describedby": ariaDescribedBy,
|
|
302
304
|
"aria-label": label || undefined,
|
|
303
305
|
appearance: appearance,
|
|
304
306
|
autoFocus: autoFocus,
|
|
@@ -328,10 +330,19 @@ var TimePicker = exports.TimePickerWithoutAnalytics = /*#__PURE__*/function (_Re
|
|
|
328
330
|
}, otherSelectProps)));
|
|
329
331
|
}
|
|
330
332
|
}]);
|
|
331
|
-
return
|
|
333
|
+
return TimePickerComponent;
|
|
332
334
|
}(_react.default.Component);
|
|
333
|
-
(0, _defineProperty2.default)(
|
|
334
|
-
|
|
335
|
+
(0, _defineProperty2.default)(TimePickerComponent, "defaultProps", timePickerDefaultProps);
|
|
336
|
+
/**
|
|
337
|
+
* __Time picker__
|
|
338
|
+
*
|
|
339
|
+
* A time picker allows the user to select a specific time.
|
|
340
|
+
*
|
|
341
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/time-picker/examples)
|
|
342
|
+
* - [Code](https://atlassian.design/components/datetime-picker/time-picker/code)
|
|
343
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/time-picker/usage)
|
|
344
|
+
*/
|
|
345
|
+
var TimePicker = (0, _analyticsNext.withAnalyticsContext)({
|
|
335
346
|
componentName: 'timePicker',
|
|
336
347
|
packageName: packageName,
|
|
337
348
|
packageVersion: packageVersion
|
|
@@ -345,4 +356,5 @@ var _default = exports.default = (0, _analyticsNext.withAnalyticsContext)({
|
|
|
345
356
|
packageVersion: packageVersion
|
|
346
357
|
}
|
|
347
358
|
})
|
|
348
|
-
})(
|
|
359
|
+
})(TimePickerComponent));
|
|
360
|
+
var _default = exports.default = TimePicker;
|
|
@@ -7,7 +7,7 @@ exports.assignToDate = assignToDate;
|
|
|
7
7
|
exports.checkHour = checkHour;
|
|
8
8
|
exports.checkMinuteSecond = checkMinuteSecond;
|
|
9
9
|
exports.convertTo24hrTime = convertTo24hrTime;
|
|
10
|
-
exports.default =
|
|
10
|
+
exports.default = parseTime;
|
|
11
11
|
exports.formatSemi24 = formatSemi24;
|
|
12
12
|
exports.isValid = isValid;
|
|
13
13
|
exports.removeSpacer = removeSpacer;
|
|
@@ -115,7 +115,7 @@ function assignToDate(time) {
|
|
|
115
115
|
dateTime.setSeconds(time.seconds || 0, 0);
|
|
116
116
|
return dateTime;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function parseTime(time) {
|
|
119
119
|
var trimmedTime = time.toString().trim();
|
|
120
120
|
if (!isValid(trimmedTime)) {
|
|
121
121
|
throw RangeError('invalid time format');
|
|
@@ -13,7 +13,7 @@ import pick from 'lodash/pick';
|
|
|
13
13
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
14
14
|
import CalendarIcon from '@atlaskit/icon/glyph/calendar';
|
|
15
15
|
import { createLocalizationProvider } from '@atlaskit/locale';
|
|
16
|
-
import {
|
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
17
|
import Select, { mergeStyles } from '@atlaskit/select';
|
|
18
18
|
import { defaultDateFormat, EmptyComponent, padToTwo, placeholderDatetime } from '../internal';
|
|
19
19
|
import { Menu } from '../internal/menu';
|
|
@@ -21,7 +21,7 @@ import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date'
|
|
|
21
21
|
import { convertTokens } from '../internal/parse-tokens';
|
|
22
22
|
import { makeSingleValue } from '../internal/single-value';
|
|
23
23
|
const packageName = "@atlaskit/datetime-picker";
|
|
24
|
-
const packageVersion = "13.7.
|
|
24
|
+
const packageVersion = "13.7.3";
|
|
25
25
|
const datePickerDefaultProps = {
|
|
26
26
|
appearance: 'default',
|
|
27
27
|
autoFocus: false,
|
|
@@ -50,7 +50,7 @@ const datePickerDefaultProps = {
|
|
|
50
50
|
// Not including a default prop for value as it will
|
|
51
51
|
// Make the component a controlled component
|
|
52
52
|
};
|
|
53
|
-
class
|
|
53
|
+
class DatePickerComponent extends Component {
|
|
54
54
|
constructor(props) {
|
|
55
55
|
super(props);
|
|
56
56
|
_defineProperty(this, "calendarRef", null);
|
|
@@ -210,7 +210,7 @@ class DatePicker extends Component {
|
|
|
210
210
|
case 'backspace':
|
|
211
211
|
case 'delete':
|
|
212
212
|
{
|
|
213
|
-
const inputCount =
|
|
213
|
+
const inputCount = fg('platform.design-system-team.date-picker-input-a11y-fix_cbbxs') ? 1 : 0;
|
|
214
214
|
if (value && event.target instanceof HTMLInputElement && event.target.value.length <= inputCount) {
|
|
215
215
|
// If being cleared from keyboard, don't change behaviour
|
|
216
216
|
this.setState({
|
|
@@ -368,6 +368,7 @@ class DatePicker extends Component {
|
|
|
368
368
|
render() {
|
|
369
369
|
const {
|
|
370
370
|
appearance,
|
|
371
|
+
'aria-describedby': ariaDescribedBy,
|
|
371
372
|
autoFocus,
|
|
372
373
|
disabled,
|
|
373
374
|
hideIcon,
|
|
@@ -396,7 +397,7 @@ class DatePicker extends Component {
|
|
|
396
397
|
selectInputValue
|
|
397
398
|
} = this.getSafeState();
|
|
398
399
|
let actualSelectInputValue;
|
|
399
|
-
if (
|
|
400
|
+
if (fg('platform.design-system-team.date-picker-input-a11y-fix_cbbxs')) {
|
|
400
401
|
actualSelectInputValue = selectInputValue || (value ? this.formatDate(value) : undefined);
|
|
401
402
|
} else {
|
|
402
403
|
actualSelectInputValue = selectInputValue;
|
|
@@ -455,6 +456,7 @@ class DatePicker extends Component {
|
|
|
455
456
|
value: value,
|
|
456
457
|
"data-testid": testId && `${testId}--input`
|
|
457
458
|
}), jsx(Select, _extends({
|
|
459
|
+
"aria-describedby": ariaDescribedBy,
|
|
458
460
|
"aria-label": label || undefined,
|
|
459
461
|
appearance: this.props.appearance,
|
|
460
462
|
enableAnimation: false,
|
|
@@ -497,9 +499,19 @@ class DatePicker extends Component {
|
|
|
497
499
|
);
|
|
498
500
|
}
|
|
499
501
|
}
|
|
500
|
-
_defineProperty(
|
|
501
|
-
export {
|
|
502
|
-
|
|
502
|
+
_defineProperty(DatePickerComponent, "defaultProps", datePickerDefaultProps);
|
|
503
|
+
export { DatePickerComponent as DatePickerWithoutAnalytics };
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* __Date picker__
|
|
507
|
+
*
|
|
508
|
+
* A date picker allows the user to select a particular date.
|
|
509
|
+
*
|
|
510
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/date-picker/examples)
|
|
511
|
+
* - [Code](https://atlassian.design/components/datetime-picker/date-picker/code)
|
|
512
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/date-picker/usage)
|
|
513
|
+
*/
|
|
514
|
+
const DatePicker = withAnalyticsContext({
|
|
503
515
|
componentName: 'datePicker',
|
|
504
516
|
packageName,
|
|
505
517
|
packageVersion
|
|
@@ -513,4 +525,5 @@ export default withAnalyticsContext({
|
|
|
513
525
|
packageVersion
|
|
514
526
|
}
|
|
515
527
|
})
|
|
516
|
-
})(
|
|
528
|
+
})(DatePickerComponent));
|
|
529
|
+
export default DatePicker;
|
|
@@ -20,7 +20,7 @@ import { convertTokens } from '../internal/parse-tokens';
|
|
|
20
20
|
import DatePicker from './date-picker';
|
|
21
21
|
import TimePicker from './time-picker';
|
|
22
22
|
const packageName = "@atlaskit/datetime-picker";
|
|
23
|
-
const packageVersion = "13.7.
|
|
23
|
+
const packageVersion = "13.7.3";
|
|
24
24
|
// Make DatePicker 50% the width of DateTimePicker
|
|
25
25
|
// If rendering an icon container, shrink the TimePicker
|
|
26
26
|
const datePickerContainerStyles = css({
|
|
@@ -93,7 +93,7 @@ const dateTimePickerDefaultProps = {
|
|
|
93
93
|
};
|
|
94
94
|
export const datePickerDefaultAriaLabel = 'Date';
|
|
95
95
|
export const timePickerDefaultAriaLabel = 'Time';
|
|
96
|
-
class
|
|
96
|
+
class DateTimePickerComponent extends React.Component {
|
|
97
97
|
constructor(...args) {
|
|
98
98
|
super(...args);
|
|
99
99
|
_defineProperty(this, "state", {
|
|
@@ -192,6 +192,7 @@ class DateTimePicker extends React.Component {
|
|
|
192
192
|
}
|
|
193
193
|
render() {
|
|
194
194
|
const {
|
|
195
|
+
'aria-describedby': ariaDescribedBy,
|
|
195
196
|
autoFocus,
|
|
196
197
|
id,
|
|
197
198
|
innerProps,
|
|
@@ -230,11 +231,13 @@ class DateTimePicker extends React.Component {
|
|
|
230
231
|
} = timePickerSelectProps;
|
|
231
232
|
const mergedDatePickerSelectProps = {
|
|
232
233
|
...datePickerSelectProps,
|
|
234
|
+
'aria-describedby': datePickerProps['aria-describedby'] || ariaDescribedBy,
|
|
233
235
|
'aria-label': datePickerProps['label'] || datePickerSelectProps['aria-label'] || datePickerDefaultAriaLabel,
|
|
234
236
|
styles: mergeStyles(styles, datePickerStyles)
|
|
235
237
|
};
|
|
236
238
|
const mergedTimePickerSelectProps = {
|
|
237
239
|
...timePickerSelectProps,
|
|
240
|
+
'aria-describedby': timePickerProps['aria-describedby'] || ariaDescribedBy,
|
|
238
241
|
'aria-label': timePickerProps['label'] || timePickerSelectProps['aria-label'] || timePickerDefaultAriaLabel,
|
|
239
242
|
styles: mergeStyles(styles, timePickerStyles)
|
|
240
243
|
};
|
|
@@ -291,9 +294,19 @@ class DateTimePicker extends React.Component {
|
|
|
291
294
|
})) : null);
|
|
292
295
|
}
|
|
293
296
|
}
|
|
294
|
-
_defineProperty(
|
|
295
|
-
export {
|
|
296
|
-
|
|
297
|
+
_defineProperty(DateTimePickerComponent, "defaultProps", dateTimePickerDefaultProps);
|
|
298
|
+
export { DateTimePickerComponent as DateTimePickerWithoutAnalytics };
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* __Date time picker__
|
|
302
|
+
*
|
|
303
|
+
* A date time picker allows the user to select an associated date and time.
|
|
304
|
+
*
|
|
305
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/examples)
|
|
306
|
+
* - [Code](https://atlassian.design/components/datetime-picker/code)
|
|
307
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/usage)
|
|
308
|
+
*/
|
|
309
|
+
const DateTimePicker = withAnalyticsContext({
|
|
297
310
|
componentName: 'dateTimePicker',
|
|
298
311
|
packageName,
|
|
299
312
|
packageVersion
|
|
@@ -307,4 +320,5 @@ export default withAnalyticsContext({
|
|
|
307
320
|
packageVersion
|
|
308
321
|
}
|
|
309
322
|
})
|
|
310
|
-
})(
|
|
323
|
+
})(DateTimePickerComponent));
|
|
324
|
+
export default DateTimePicker;
|
|
@@ -16,7 +16,7 @@ import parseTime from '../internal/parse-time';
|
|
|
16
16
|
import { convertTokens } from '../internal/parse-tokens';
|
|
17
17
|
import { makeSingleValue } from '../internal/single-value';
|
|
18
18
|
const packageName = "@atlaskit/datetime-picker";
|
|
19
|
-
const packageVersion = "13.7.
|
|
19
|
+
const packageVersion = "13.7.3";
|
|
20
20
|
const menuStyles = {
|
|
21
21
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
22
22
|
position: 'static',
|
|
@@ -53,7 +53,7 @@ const timePickerDefaultProps = {
|
|
|
53
53
|
// Not including a default prop for value as it will
|
|
54
54
|
// Make the component a controlled component
|
|
55
55
|
};
|
|
56
|
-
class
|
|
56
|
+
class TimePickerComponent extends React.Component {
|
|
57
57
|
constructor(...args) {
|
|
58
58
|
super(...args);
|
|
59
59
|
_defineProperty(this, "containerRef", null);
|
|
@@ -173,6 +173,7 @@ class TimePicker extends React.Component {
|
|
|
173
173
|
render() {
|
|
174
174
|
const {
|
|
175
175
|
appearance,
|
|
176
|
+
'aria-describedby': ariaDescribedBy,
|
|
176
177
|
autoFocus,
|
|
177
178
|
formatDisplayLabel,
|
|
178
179
|
hideIcon,
|
|
@@ -275,6 +276,7 @@ class TimePicker extends React.Component {
|
|
|
275
276
|
"data-testid": testId && `${testId}--input`,
|
|
276
277
|
onKeyDown: this.onSelectKeyDown
|
|
277
278
|
}), /*#__PURE__*/React.createElement(SelectComponent, _extends({
|
|
279
|
+
"aria-describedby": ariaDescribedBy,
|
|
278
280
|
"aria-label": label || undefined,
|
|
279
281
|
appearance: appearance,
|
|
280
282
|
autoFocus: autoFocus,
|
|
@@ -304,9 +306,19 @@ class TimePicker extends React.Component {
|
|
|
304
306
|
}, otherSelectProps)));
|
|
305
307
|
}
|
|
306
308
|
}
|
|
307
|
-
_defineProperty(
|
|
308
|
-
export {
|
|
309
|
-
|
|
309
|
+
_defineProperty(TimePickerComponent, "defaultProps", timePickerDefaultProps);
|
|
310
|
+
export { TimePickerComponent as TimePickerWithoutAnalytics };
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* __Time picker__
|
|
314
|
+
*
|
|
315
|
+
* A time picker allows the user to select a specific time.
|
|
316
|
+
*
|
|
317
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/time-picker/examples)
|
|
318
|
+
* - [Code](https://atlassian.design/components/datetime-picker/time-picker/code)
|
|
319
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/time-picker/usage)
|
|
320
|
+
*/
|
|
321
|
+
const TimePicker = withAnalyticsContext({
|
|
310
322
|
componentName: 'timePicker',
|
|
311
323
|
packageName,
|
|
312
324
|
packageVersion
|
|
@@ -320,4 +332,5 @@ export default withAnalyticsContext({
|
|
|
320
332
|
packageVersion
|
|
321
333
|
}
|
|
322
334
|
})
|
|
323
|
-
})(
|
|
335
|
+
})(TimePickerComponent));
|
|
336
|
+
export default TimePicker;
|
|
@@ -102,7 +102,7 @@ export function assignToDate(time) {
|
|
|
102
102
|
dateTime.setSeconds(time.seconds || 0, 0);
|
|
103
103
|
return dateTime;
|
|
104
104
|
}
|
|
105
|
-
export default function (time) {
|
|
105
|
+
export default function parseTime(time) {
|
|
106
106
|
const trimmedTime = time.toString().trim();
|
|
107
107
|
if (!isValid(trimmedTime)) {
|
|
108
108
|
throw RangeError('invalid time format');
|
|
@@ -24,7 +24,7 @@ import pick from 'lodash/pick';
|
|
|
24
24
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
25
25
|
import CalendarIcon from '@atlaskit/icon/glyph/calendar';
|
|
26
26
|
import { createLocalizationProvider } from '@atlaskit/locale';
|
|
27
|
-
import {
|
|
27
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
28
28
|
import Select, { mergeStyles } from '@atlaskit/select';
|
|
29
29
|
import { defaultDateFormat, EmptyComponent, padToTwo, placeholderDatetime } from '../internal';
|
|
30
30
|
import { Menu } from '../internal/menu';
|
|
@@ -32,7 +32,7 @@ import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date'
|
|
|
32
32
|
import { convertTokens } from '../internal/parse-tokens';
|
|
33
33
|
import { makeSingleValue } from '../internal/single-value';
|
|
34
34
|
var packageName = "@atlaskit/datetime-picker";
|
|
35
|
-
var packageVersion = "13.7.
|
|
35
|
+
var packageVersion = "13.7.3";
|
|
36
36
|
var datePickerDefaultProps = {
|
|
37
37
|
appearance: 'default',
|
|
38
38
|
autoFocus: false,
|
|
@@ -63,12 +63,12 @@ var datePickerDefaultProps = {
|
|
|
63
63
|
// Not including a default prop for value as it will
|
|
64
64
|
// Make the component a controlled component
|
|
65
65
|
};
|
|
66
|
-
var
|
|
67
|
-
_inherits(
|
|
68
|
-
var _super = _createSuper(
|
|
69
|
-
function
|
|
66
|
+
var DatePickerComponent = /*#__PURE__*/function (_Component) {
|
|
67
|
+
_inherits(DatePickerComponent, _Component);
|
|
68
|
+
var _super = _createSuper(DatePickerComponent);
|
|
69
|
+
function DatePickerComponent(props) {
|
|
70
70
|
var _this;
|
|
71
|
-
_classCallCheck(this,
|
|
71
|
+
_classCallCheck(this, DatePickerComponent);
|
|
72
72
|
_this = _super.call(this, props);
|
|
73
73
|
_defineProperty(_assertThisInitialized(_this), "calendarRef", null);
|
|
74
74
|
_defineProperty(_assertThisInitialized(_this), "containerRef", null);
|
|
@@ -223,7 +223,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
223
223
|
case 'backspace':
|
|
224
224
|
case 'delete':
|
|
225
225
|
{
|
|
226
|
-
var inputCount =
|
|
226
|
+
var inputCount = fg('platform.design-system-team.date-picker-input-a11y-fix_cbbxs') ? 1 : 0;
|
|
227
227
|
if (value && event.target instanceof HTMLInputElement && event.target.value.length <= inputCount) {
|
|
228
228
|
// If being cleared from keyboard, don't change behaviour
|
|
229
229
|
_this.setState({
|
|
@@ -359,11 +359,12 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
359
359
|
};
|
|
360
360
|
return _this;
|
|
361
361
|
}
|
|
362
|
-
_createClass(
|
|
362
|
+
_createClass(DatePickerComponent, [{
|
|
363
363
|
key: "render",
|
|
364
364
|
value: function render() {
|
|
365
365
|
var _this$props3 = this.props,
|
|
366
366
|
appearance = _this$props3.appearance,
|
|
367
|
+
ariaDescribedBy = _this$props3['aria-describedby'],
|
|
367
368
|
autoFocus = _this$props3.autoFocus,
|
|
368
369
|
disabled = _this$props3.disabled,
|
|
369
370
|
hideIcon = _this$props3.hideIcon,
|
|
@@ -390,7 +391,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
390
391
|
isOpen = _this$getSafeState6.isOpen,
|
|
391
392
|
selectInputValue = _this$getSafeState6.selectInputValue;
|
|
392
393
|
var actualSelectInputValue;
|
|
393
|
-
if (
|
|
394
|
+
if (fg('platform.design-system-team.date-picker-input-a11y-fix_cbbxs')) {
|
|
394
395
|
actualSelectInputValue = selectInputValue || (value ? this.formatDate(value) : undefined);
|
|
395
396
|
} else {
|
|
396
397
|
actualSelectInputValue = selectInputValue;
|
|
@@ -447,6 +448,7 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
447
448
|
value: value,
|
|
448
449
|
"data-testid": testId && "".concat(testId, "--input")
|
|
449
450
|
}), jsx(Select, _extends({
|
|
451
|
+
"aria-describedby": ariaDescribedBy,
|
|
450
452
|
"aria-label": label || undefined,
|
|
451
453
|
appearance: this.props.appearance,
|
|
452
454
|
enableAnimation: false,
|
|
@@ -501,11 +503,21 @@ var DatePicker = /*#__PURE__*/function (_Component) {
|
|
|
501
503
|
}
|
|
502
504
|
}
|
|
503
505
|
}]);
|
|
504
|
-
return
|
|
506
|
+
return DatePickerComponent;
|
|
505
507
|
}(Component);
|
|
506
|
-
_defineProperty(
|
|
507
|
-
export {
|
|
508
|
-
|
|
508
|
+
_defineProperty(DatePickerComponent, "defaultProps", datePickerDefaultProps);
|
|
509
|
+
export { DatePickerComponent as DatePickerWithoutAnalytics };
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* __Date picker__
|
|
513
|
+
*
|
|
514
|
+
* A date picker allows the user to select a particular date.
|
|
515
|
+
*
|
|
516
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/date-picker/examples)
|
|
517
|
+
* - [Code](https://atlassian.design/components/datetime-picker/date-picker/code)
|
|
518
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/date-picker/usage)
|
|
519
|
+
*/
|
|
520
|
+
var DatePicker = withAnalyticsContext({
|
|
509
521
|
componentName: 'datePicker',
|
|
510
522
|
packageName: packageName,
|
|
511
523
|
packageVersion: packageVersion
|
|
@@ -519,4 +531,5 @@ export default withAnalyticsContext({
|
|
|
519
531
|
packageVersion: packageVersion
|
|
520
532
|
}
|
|
521
533
|
})
|
|
522
|
-
})(
|
|
534
|
+
})(DatePickerComponent));
|
|
535
|
+
export default DatePicker;
|
|
@@ -30,7 +30,7 @@ import { convertTokens } from '../internal/parse-tokens';
|
|
|
30
30
|
import DatePicker from './date-picker';
|
|
31
31
|
import TimePicker from './time-picker';
|
|
32
32
|
var packageName = "@atlaskit/datetime-picker";
|
|
33
|
-
var packageVersion = "13.7.
|
|
33
|
+
var packageVersion = "13.7.3";
|
|
34
34
|
// Make DatePicker 50% the width of DateTimePicker
|
|
35
35
|
// If rendering an icon container, shrink the TimePicker
|
|
36
36
|
var datePickerContainerStyles = css({
|
|
@@ -104,12 +104,12 @@ var dateTimePickerDefaultProps = {
|
|
|
104
104
|
};
|
|
105
105
|
export var datePickerDefaultAriaLabel = 'Date';
|
|
106
106
|
export var timePickerDefaultAriaLabel = 'Time';
|
|
107
|
-
var
|
|
108
|
-
_inherits(
|
|
109
|
-
var _super = _createSuper(
|
|
110
|
-
function
|
|
107
|
+
var DateTimePickerComponent = /*#__PURE__*/function (_React$Component) {
|
|
108
|
+
_inherits(DateTimePickerComponent, _React$Component);
|
|
109
|
+
var _super = _createSuper(DateTimePickerComponent);
|
|
110
|
+
function DateTimePickerComponent() {
|
|
111
111
|
var _this;
|
|
112
|
-
_classCallCheck(this,
|
|
112
|
+
_classCallCheck(this, DateTimePickerComponent);
|
|
113
113
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
114
114
|
args[_key] = arguments[_key];
|
|
115
115
|
}
|
|
@@ -157,7 +157,7 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
157
157
|
});
|
|
158
158
|
return _this;
|
|
159
159
|
}
|
|
160
|
-
_createClass(
|
|
160
|
+
_createClass(DateTimePickerComponent, [{
|
|
161
161
|
key: "parseValue",
|
|
162
162
|
value: function parseValue(value, dateValue, timeValue, zoneValue) {
|
|
163
163
|
if (this.props.parseValue) {
|
|
@@ -206,6 +206,7 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
206
206
|
key: "render",
|
|
207
207
|
value: function render() {
|
|
208
208
|
var _this$props = this.props,
|
|
209
|
+
ariaDescribedBy = _this$props['aria-describedby'],
|
|
209
210
|
autoFocus = _this$props.autoFocus,
|
|
210
211
|
id = _this$props.id,
|
|
211
212
|
innerProps = _this$props.innerProps,
|
|
@@ -239,10 +240,12 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
239
240
|
var _timePickerSelectProp = timePickerSelectProps.styles,
|
|
240
241
|
timePickerStyles = _timePickerSelectProp === void 0 ? {} : _timePickerSelectProp;
|
|
241
242
|
var mergedDatePickerSelectProps = _objectSpread(_objectSpread({}, datePickerSelectProps), {}, {
|
|
243
|
+
'aria-describedby': datePickerProps['aria-describedby'] || ariaDescribedBy,
|
|
242
244
|
'aria-label': datePickerProps['label'] || datePickerSelectProps['aria-label'] || datePickerDefaultAriaLabel,
|
|
243
245
|
styles: mergeStyles(styles, datePickerStyles)
|
|
244
246
|
});
|
|
245
247
|
var mergedTimePickerSelectProps = _objectSpread(_objectSpread({}, timePickerSelectProps), {}, {
|
|
248
|
+
'aria-describedby': timePickerProps['aria-describedby'] || ariaDescribedBy,
|
|
246
249
|
'aria-label': timePickerProps['label'] || timePickerSelectProps['aria-label'] || timePickerDefaultAriaLabel,
|
|
247
250
|
styles: mergeStyles(styles, timePickerStyles)
|
|
248
251
|
});
|
|
@@ -299,11 +302,21 @@ var DateTimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
299
302
|
})) : null);
|
|
300
303
|
}
|
|
301
304
|
}]);
|
|
302
|
-
return
|
|
305
|
+
return DateTimePickerComponent;
|
|
303
306
|
}(React.Component);
|
|
304
|
-
_defineProperty(
|
|
305
|
-
export {
|
|
306
|
-
|
|
307
|
+
_defineProperty(DateTimePickerComponent, "defaultProps", dateTimePickerDefaultProps);
|
|
308
|
+
export { DateTimePickerComponent as DateTimePickerWithoutAnalytics };
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* __Date time picker__
|
|
312
|
+
*
|
|
313
|
+
* A date time picker allows the user to select an associated date and time.
|
|
314
|
+
*
|
|
315
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/examples)
|
|
316
|
+
* - [Code](https://atlassian.design/components/datetime-picker/code)
|
|
317
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/usage)
|
|
318
|
+
*/
|
|
319
|
+
var DateTimePicker = withAnalyticsContext({
|
|
307
320
|
componentName: 'dateTimePicker',
|
|
308
321
|
packageName: packageName,
|
|
309
322
|
packageVersion: packageVersion
|
|
@@ -317,4 +330,5 @@ export default withAnalyticsContext({
|
|
|
317
330
|
packageVersion: packageVersion
|
|
318
331
|
}
|
|
319
332
|
})
|
|
320
|
-
})(
|
|
333
|
+
})(DateTimePickerComponent));
|
|
334
|
+
export default DateTimePicker;
|
|
@@ -28,7 +28,7 @@ import parseTime from '../internal/parse-time';
|
|
|
28
28
|
import { convertTokens } from '../internal/parse-tokens';
|
|
29
29
|
import { makeSingleValue } from '../internal/single-value';
|
|
30
30
|
var packageName = "@atlaskit/datetime-picker";
|
|
31
|
-
var packageVersion = "13.7.
|
|
31
|
+
var packageVersion = "13.7.3";
|
|
32
32
|
var menuStyles = {
|
|
33
33
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
34
34
|
position: 'static',
|
|
@@ -67,12 +67,12 @@ var timePickerDefaultProps = {
|
|
|
67
67
|
// Not including a default prop for value as it will
|
|
68
68
|
// Make the component a controlled component
|
|
69
69
|
};
|
|
70
|
-
var
|
|
71
|
-
_inherits(
|
|
72
|
-
var _super = _createSuper(
|
|
73
|
-
function
|
|
70
|
+
var TimePickerComponent = /*#__PURE__*/function (_React$Component) {
|
|
71
|
+
_inherits(TimePickerComponent, _React$Component);
|
|
72
|
+
var _super = _createSuper(TimePickerComponent);
|
|
73
|
+
function TimePickerComponent() {
|
|
74
74
|
var _this;
|
|
75
|
-
_classCallCheck(this,
|
|
75
|
+
_classCallCheck(this, TimePickerComponent);
|
|
76
76
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
77
77
|
args[_key] = arguments[_key];
|
|
78
78
|
}
|
|
@@ -185,12 +185,13 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
185
185
|
});
|
|
186
186
|
return _this;
|
|
187
187
|
}
|
|
188
|
-
_createClass(
|
|
188
|
+
_createClass(TimePickerComponent, [{
|
|
189
189
|
key: "render",
|
|
190
190
|
value: function render() {
|
|
191
191
|
var _this2 = this;
|
|
192
192
|
var _this$props2 = this.props,
|
|
193
193
|
appearance = _this$props2.appearance,
|
|
194
|
+
ariaDescribedBy = _this$props2['aria-describedby'],
|
|
194
195
|
autoFocus = _this$props2.autoFocus,
|
|
195
196
|
formatDisplayLabel = _this$props2.formatDisplayLabel,
|
|
196
197
|
hideIcon = _this$props2.hideIcon,
|
|
@@ -291,6 +292,7 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
291
292
|
"data-testid": testId && "".concat(testId, "--input"),
|
|
292
293
|
onKeyDown: this.onSelectKeyDown
|
|
293
294
|
}), /*#__PURE__*/React.createElement(SelectComponent, _extends({
|
|
295
|
+
"aria-describedby": ariaDescribedBy,
|
|
294
296
|
"aria-label": label || undefined,
|
|
295
297
|
appearance: appearance,
|
|
296
298
|
autoFocus: autoFocus,
|
|
@@ -320,11 +322,21 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
320
322
|
}, otherSelectProps)));
|
|
321
323
|
}
|
|
322
324
|
}]);
|
|
323
|
-
return
|
|
325
|
+
return TimePickerComponent;
|
|
324
326
|
}(React.Component);
|
|
325
|
-
_defineProperty(
|
|
326
|
-
export {
|
|
327
|
-
|
|
327
|
+
_defineProperty(TimePickerComponent, "defaultProps", timePickerDefaultProps);
|
|
328
|
+
export { TimePickerComponent as TimePickerWithoutAnalytics };
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* __Time picker__
|
|
332
|
+
*
|
|
333
|
+
* A time picker allows the user to select a specific time.
|
|
334
|
+
*
|
|
335
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/time-picker/examples)
|
|
336
|
+
* - [Code](https://atlassian.design/components/datetime-picker/time-picker/code)
|
|
337
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/time-picker/usage)
|
|
338
|
+
*/
|
|
339
|
+
var TimePicker = withAnalyticsContext({
|
|
328
340
|
componentName: 'timePicker',
|
|
329
341
|
packageName: packageName,
|
|
330
342
|
packageVersion: packageVersion
|
|
@@ -338,4 +350,5 @@ export default withAnalyticsContext({
|
|
|
338
350
|
packageVersion: packageVersion
|
|
339
351
|
}
|
|
340
352
|
})
|
|
341
|
-
})(
|
|
353
|
+
})(TimePickerComponent));
|
|
354
|
+
export default TimePicker;
|
|
@@ -102,7 +102,7 @@ export function assignToDate(time) {
|
|
|
102
102
|
dateTime.setSeconds(time.seconds || 0, 0);
|
|
103
103
|
return dateTime;
|
|
104
104
|
}
|
|
105
|
-
export default function (time) {
|
|
105
|
+
export default function parseTime(time) {
|
|
106
106
|
var trimmedTime = time.toString().trim();
|
|
107
107
|
if (!isValid(trimmedTime)) {
|
|
108
108
|
throw RangeError('invalid time format');
|
|
@@ -46,7 +46,7 @@ declare const datePickerDefaultProps: {
|
|
|
46
46
|
spacing: Spacing;
|
|
47
47
|
locale: string;
|
|
48
48
|
};
|
|
49
|
-
declare class
|
|
49
|
+
declare class DatePickerComponent extends Component<DatePickerProps, State> {
|
|
50
50
|
static defaultProps: {
|
|
51
51
|
appearance: Appearance;
|
|
52
52
|
autoFocus: boolean;
|
|
@@ -123,8 +123,17 @@ declare class DatePicker extends Component<DatePickerProps, State> {
|
|
|
123
123
|
getPlaceholder: () => string;
|
|
124
124
|
render(): jsx.JSX.Element;
|
|
125
125
|
}
|
|
126
|
-
export {
|
|
127
|
-
|
|
126
|
+
export { DatePickerComponent as DatePickerWithoutAnalytics };
|
|
127
|
+
/**
|
|
128
|
+
* __Date picker__
|
|
129
|
+
*
|
|
130
|
+
* A date picker allows the user to select a particular date.
|
|
131
|
+
*
|
|
132
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/date-picker/examples)
|
|
133
|
+
* - [Code](https://atlassian.design/components/datetime-picker/date-picker/code)
|
|
134
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/date-picker/usage)
|
|
135
|
+
*/
|
|
136
|
+
declare const DatePicker: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "aria-describedby" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "weekStartDay" | "value" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "dateFormat"> & Partial<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "disabledDateFilter" | "locale" | "autoFocus" | "defaultIsOpen" | "name" | "spacing" | "isInvalid" | "hideIcon">> & Partial<Pick<{
|
|
128
137
|
appearance: Appearance;
|
|
129
138
|
autoFocus: boolean;
|
|
130
139
|
defaultIsOpen: boolean;
|
|
@@ -139,11 +148,11 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit
|
|
|
139
148
|
isInvalid: boolean;
|
|
140
149
|
label: string;
|
|
141
150
|
name: string;
|
|
142
|
-
onBlur: (_event:
|
|
151
|
+
onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
143
152
|
onChange: (_value: string) => void;
|
|
144
|
-
onFocus: (_event:
|
|
153
|
+
onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
145
154
|
selectProps: {};
|
|
146
155
|
spacing: Spacing;
|
|
147
156
|
locale: string;
|
|
148
|
-
}, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "disabledDateFilter" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "locale" | "analyticsContext" | "weekStartDay" | "value" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "dateFormat"> & import("react").RefAttributes<any>>;
|
|
149
|
-
export default
|
|
157
|
+
}, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "disabledDateFilter" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "locale" | "analyticsContext" | "weekStartDay" | "value" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "dateFormat"> & import("react").RefAttributes<any>>;
|
|
158
|
+
export default DatePicker;
|
|
@@ -36,7 +36,7 @@ declare const dateTimePickerDefaultProps: {
|
|
|
36
36
|
};
|
|
37
37
|
export declare const datePickerDefaultAriaLabel = "Date";
|
|
38
38
|
export declare const timePickerDefaultAriaLabel = "Time";
|
|
39
|
-
declare class
|
|
39
|
+
declare class DateTimePickerComponent extends React.Component<DateTimePickerProps, State> {
|
|
40
40
|
static defaultProps: DateTimePickerProps;
|
|
41
41
|
state: State;
|
|
42
42
|
getSafeState: () => {
|
|
@@ -63,6 +63,15 @@ declare class DateTimePicker extends React.Component<DateTimePickerProps, State>
|
|
|
63
63
|
}): void;
|
|
64
64
|
render(): jsx.JSX.Element;
|
|
65
65
|
}
|
|
66
|
-
export {
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
export { DateTimePickerComponent as DateTimePickerWithoutAnalytics };
|
|
67
|
+
/**
|
|
68
|
+
* __Date time picker__
|
|
69
|
+
*
|
|
70
|
+
* A date time picker allows the user to select an associated date and time.
|
|
71
|
+
*
|
|
72
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/examples)
|
|
73
|
+
* - [Code](https://atlassian.design/components/datetime-picker/code)
|
|
74
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/usage)
|
|
75
|
+
*/
|
|
76
|
+
declare const DateTimePicker: React.ForwardRefExoticComponent<Pick<Pick<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "dateFormat" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps">> & Partial<Pick<DateTimePickerProps, "ref" | "createAnalyticsEvent">>, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "dateFormat" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps"> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "dateFormat" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps"> & React.RefAttributes<any>>;
|
|
77
|
+
export default DateTimePicker;
|
|
@@ -35,7 +35,7 @@ declare const timePickerDefaultProps: {
|
|
|
35
35
|
timeIsEditable: boolean;
|
|
36
36
|
locale: string;
|
|
37
37
|
};
|
|
38
|
-
declare class
|
|
38
|
+
declare class TimePickerComponent extends React.Component<TimePickerProps, State> {
|
|
39
39
|
containerRef: HTMLElement | null;
|
|
40
40
|
static defaultProps: {
|
|
41
41
|
appearance: Appearance;
|
|
@@ -79,8 +79,17 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
|
|
|
79
79
|
onSelectKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
80
80
|
render(): JSX.Element;
|
|
81
81
|
}
|
|
82
|
-
export {
|
|
83
|
-
|
|
82
|
+
export { TimePickerComponent as TimePickerWithoutAnalytics };
|
|
83
|
+
/**
|
|
84
|
+
* __Time picker__
|
|
85
|
+
*
|
|
86
|
+
* A time picker allows the user to select a specific time.
|
|
87
|
+
*
|
|
88
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/time-picker/examples)
|
|
89
|
+
* - [Code](https://atlassian.design/components/datetime-picker/time-picker/code)
|
|
90
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/time-picker/usage)
|
|
91
|
+
*/
|
|
92
|
+
declare const TimePicker: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "aria-describedby" | "value" | "isOpen" | "formatDisplayLabel" | "timeFormat"> & Partial<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "locale" | "autoFocus" | "defaultIsOpen" | "name" | "parseInputValue" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable">> & Partial<Pick<{
|
|
84
93
|
appearance: Appearance;
|
|
85
94
|
autoFocus: boolean;
|
|
86
95
|
defaultIsOpen: boolean;
|
|
@@ -101,5 +110,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePicke
|
|
|
101
110
|
times: string[];
|
|
102
111
|
timeIsEditable: boolean;
|
|
103
112
|
locale: string;
|
|
104
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "value" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
|
|
105
|
-
export default
|
|
113
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "value" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
|
|
114
|
+
export default TimePicker;
|
|
@@ -10,5 +10,5 @@ export declare function checkHour(hour: string, meridiem: string): string | null
|
|
|
10
10
|
export declare function checkMinuteSecond(value: string): string | null;
|
|
11
11
|
export declare function convertTo24hrTime(time: string): TimeObject | null;
|
|
12
12
|
export declare function assignToDate(time: TimeObject): Date;
|
|
13
|
-
export default function (time: string): string | Date;
|
|
13
|
+
export default function parseTime(time: string): string | Date;
|
|
14
14
|
export {};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
10
10
|
* **NOTE:** Appearance values will be ignored if styles are parsed through `selectProps`.
|
|
11
11
|
*/
|
|
12
12
|
appearance?: Appearance;
|
|
13
|
+
/**
|
|
14
|
+
* Used to associate accessible descriptions to the date picker.
|
|
15
|
+
*/
|
|
16
|
+
'aria-describedby'?: string;
|
|
13
17
|
/**
|
|
14
18
|
* Set the picker to autofocus on mount.
|
|
15
19
|
*/
|
|
@@ -159,6 +163,10 @@ export interface TimePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
159
163
|
* __NOTE:__ Appearance values will be ignored if styles are parsed through `selectProps`.
|
|
160
164
|
*/
|
|
161
165
|
appearance?: Appearance;
|
|
166
|
+
/**
|
|
167
|
+
* Used to associate accessible descriptions to the time picker.
|
|
168
|
+
*/
|
|
169
|
+
'aria-describedby'?: string;
|
|
162
170
|
/**
|
|
163
171
|
* Set the picker to autofocus on mount.
|
|
164
172
|
*/
|
|
@@ -272,6 +280,13 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
272
280
|
* `subtle` will remove the borders and background.
|
|
273
281
|
*/
|
|
274
282
|
appearance?: Appearance;
|
|
283
|
+
/**
|
|
284
|
+
* Used to associate accessible descriptions to both the date and time
|
|
285
|
+
* picker. If you want to associate individual accessible descriptions, this
|
|
286
|
+
* should be done through the `datePickerSelectProps` and
|
|
287
|
+
* `timePickerSelectProps`.
|
|
288
|
+
*/
|
|
289
|
+
'aria-describedby'?: string;
|
|
275
290
|
/**
|
|
276
291
|
* Set the picker to autofocus on mount.
|
|
277
292
|
*/
|
|
@@ -46,7 +46,7 @@ declare const datePickerDefaultProps: {
|
|
|
46
46
|
spacing: Spacing;
|
|
47
47
|
locale: string;
|
|
48
48
|
};
|
|
49
|
-
declare class
|
|
49
|
+
declare class DatePickerComponent extends Component<DatePickerProps, State> {
|
|
50
50
|
static defaultProps: {
|
|
51
51
|
appearance: Appearance;
|
|
52
52
|
autoFocus: boolean;
|
|
@@ -123,8 +123,17 @@ declare class DatePicker extends Component<DatePickerProps, State> {
|
|
|
123
123
|
getPlaceholder: () => string;
|
|
124
124
|
render(): jsx.JSX.Element;
|
|
125
125
|
}
|
|
126
|
-
export {
|
|
127
|
-
|
|
126
|
+
export { DatePickerComponent as DatePickerWithoutAnalytics };
|
|
127
|
+
/**
|
|
128
|
+
* __Date picker__
|
|
129
|
+
*
|
|
130
|
+
* A date picker allows the user to select a particular date.
|
|
131
|
+
*
|
|
132
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/date-picker/examples)
|
|
133
|
+
* - [Code](https://atlassian.design/components/datetime-picker/date-picker/code)
|
|
134
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/date-picker/usage)
|
|
135
|
+
*/
|
|
136
|
+
declare const DatePicker: import("react").ForwardRefExoticComponent<Pick<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "aria-describedby" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "weekStartDay" | "value" | "isOpen" | "parseInputValue" | "formatDisplayLabel" | "dateFormat"> & Partial<Pick<Omit<DatePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "disabledDateFilter" | "locale" | "autoFocus" | "defaultIsOpen" | "name" | "spacing" | "isInvalid" | "hideIcon">> & Partial<Pick<{
|
|
128
137
|
appearance: Appearance;
|
|
129
138
|
autoFocus: boolean;
|
|
130
139
|
defaultIsOpen: boolean;
|
|
@@ -139,11 +148,11 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<Pick<Omit
|
|
|
139
148
|
isInvalid: boolean;
|
|
140
149
|
label: string;
|
|
141
150
|
name: string;
|
|
142
|
-
onBlur: (_event:
|
|
151
|
+
onBlur: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
143
152
|
onChange: (_value: string) => void;
|
|
144
|
-
onFocus: (_event:
|
|
153
|
+
onFocus: (_event: React.FocusEvent<HTMLInputElement>) => void;
|
|
145
154
|
selectProps: {};
|
|
146
155
|
spacing: Spacing;
|
|
147
156
|
locale: string;
|
|
148
|
-
}, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "disabledDateFilter" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "locale" | "analyticsContext" | "weekStartDay" | "value" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "dateFormat"> & import("react").RefAttributes<any>>;
|
|
149
|
-
export default
|
|
157
|
+
}, never>> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "testId" | "label" | "icon" | "disabled" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "disabledDateFilter" | "maxDate" | "minDate" | "nextMonthLabel" | "previousMonthLabel" | "locale" | "analyticsContext" | "weekStartDay" | "value" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "dateFormat"> & import("react").RefAttributes<any>>;
|
|
158
|
+
export default DatePicker;
|
|
@@ -36,7 +36,7 @@ declare const dateTimePickerDefaultProps: {
|
|
|
36
36
|
};
|
|
37
37
|
export declare const datePickerDefaultAriaLabel = "Date";
|
|
38
38
|
export declare const timePickerDefaultAriaLabel = "Time";
|
|
39
|
-
declare class
|
|
39
|
+
declare class DateTimePickerComponent extends React.Component<DateTimePickerProps, State> {
|
|
40
40
|
static defaultProps: DateTimePickerProps;
|
|
41
41
|
state: State;
|
|
42
42
|
getSafeState: () => {
|
|
@@ -63,6 +63,15 @@ declare class DateTimePicker extends React.Component<DateTimePickerProps, State>
|
|
|
63
63
|
}): void;
|
|
64
64
|
render(): jsx.JSX.Element;
|
|
65
65
|
}
|
|
66
|
-
export {
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
export { DateTimePickerComponent as DateTimePickerWithoutAnalytics };
|
|
67
|
+
/**
|
|
68
|
+
* __Date time picker__
|
|
69
|
+
*
|
|
70
|
+
* A date time picker allows the user to select an associated date and time.
|
|
71
|
+
*
|
|
72
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/examples)
|
|
73
|
+
* - [Code](https://atlassian.design/components/datetime-picker/code)
|
|
74
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/usage)
|
|
75
|
+
*/
|
|
76
|
+
declare const DateTimePicker: React.ForwardRefExoticComponent<Pick<Pick<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "dateFormat" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps">> & Partial<Pick<DateTimePickerProps, "ref" | "createAnalyticsEvent">>, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "dateFormat" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps"> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "appearance" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "createAnalyticsEvent" | "value" | "autoFocus" | "name" | "spacing" | "isInvalid" | "dateFormat" | "timeIsEditable" | "timeFormat" | "datePickerProps" | "timePickerProps" | "parseValue" | "datePickerSelectProps" | "timePickerSelectProps"> & React.RefAttributes<any>>;
|
|
77
|
+
export default DateTimePicker;
|
|
@@ -35,7 +35,7 @@ declare const timePickerDefaultProps: {
|
|
|
35
35
|
timeIsEditable: boolean;
|
|
36
36
|
locale: string;
|
|
37
37
|
};
|
|
38
|
-
declare class
|
|
38
|
+
declare class TimePickerComponent extends React.Component<TimePickerProps, State> {
|
|
39
39
|
containerRef: HTMLElement | null;
|
|
40
40
|
static defaultProps: {
|
|
41
41
|
appearance: Appearance;
|
|
@@ -79,8 +79,17 @@ declare class TimePicker extends React.Component<TimePickerProps, State> {
|
|
|
79
79
|
onSelectKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
80
80
|
render(): JSX.Element;
|
|
81
81
|
}
|
|
82
|
-
export {
|
|
83
|
-
|
|
82
|
+
export { TimePickerComponent as TimePickerWithoutAnalytics };
|
|
83
|
+
/**
|
|
84
|
+
* __Time picker__
|
|
85
|
+
*
|
|
86
|
+
* A time picker allows the user to select a specific time.
|
|
87
|
+
*
|
|
88
|
+
* - [Examples](https://atlassian.design/components/datetime-picker/time-picker/examples)
|
|
89
|
+
* - [Code](https://atlassian.design/components/datetime-picker/time-picker/code)
|
|
90
|
+
* - [Usage](https://atlassian.design/components/datetime-picker/time-picker/usage)
|
|
91
|
+
*/
|
|
92
|
+
declare const TimePicker: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "testId" | "placeholder" | "aria-describedby" | "value" | "isOpen" | "formatDisplayLabel" | "timeFormat"> & Partial<Pick<Omit<TimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "times" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "defaultValue" | "id" | "onFocus" | "onBlur" | "onChange" | "locale" | "autoFocus" | "defaultIsOpen" | "name" | "parseInputValue" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable">> & Partial<Pick<{
|
|
84
93
|
appearance: Appearance;
|
|
85
94
|
autoFocus: boolean;
|
|
86
95
|
defaultIsOpen: boolean;
|
|
@@ -101,5 +110,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<TimePicke
|
|
|
101
110
|
times: string[];
|
|
102
111
|
timeIsEditable: boolean;
|
|
103
112
|
locale: string;
|
|
104
|
-
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "value" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
|
|
105
|
-
export default
|
|
113
|
+
}, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "times" | "testId" | "label" | "appearance" | "selectProps" | "innerProps" | "isDisabled" | "key" | "defaultValue" | "id" | "placeholder" | "aria-describedby" | "onFocus" | "onBlur" | "onChange" | "locale" | "analyticsContext" | "value" | "autoFocus" | "defaultIsOpen" | "isOpen" | "name" | "parseInputValue" | "formatDisplayLabel" | "spacing" | "isInvalid" | "hideIcon" | "timeIsEditable" | "timeFormat"> & React.RefAttributes<any>>;
|
|
114
|
+
export default TimePicker;
|
|
@@ -10,5 +10,5 @@ export declare function checkHour(hour: string, meridiem: string): string | null
|
|
|
10
10
|
export declare function checkMinuteSecond(value: string): string | null;
|
|
11
11
|
export declare function convertTo24hrTime(time: string): TimeObject | null;
|
|
12
12
|
export declare function assignToDate(time: TimeObject): Date;
|
|
13
|
-
export default function (time: string): string | Date;
|
|
13
|
+
export default function parseTime(time: string): string | Date;
|
|
14
14
|
export {};
|
|
@@ -10,6 +10,10 @@ export interface DatePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
10
10
|
* **NOTE:** Appearance values will be ignored if styles are parsed through `selectProps`.
|
|
11
11
|
*/
|
|
12
12
|
appearance?: Appearance;
|
|
13
|
+
/**
|
|
14
|
+
* Used to associate accessible descriptions to the date picker.
|
|
15
|
+
*/
|
|
16
|
+
'aria-describedby'?: string;
|
|
13
17
|
/**
|
|
14
18
|
* Set the picker to autofocus on mount.
|
|
15
19
|
*/
|
|
@@ -159,6 +163,10 @@ export interface TimePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
159
163
|
* __NOTE:__ Appearance values will be ignored if styles are parsed through `selectProps`.
|
|
160
164
|
*/
|
|
161
165
|
appearance?: Appearance;
|
|
166
|
+
/**
|
|
167
|
+
* Used to associate accessible descriptions to the time picker.
|
|
168
|
+
*/
|
|
169
|
+
'aria-describedby'?: string;
|
|
162
170
|
/**
|
|
163
171
|
* Set the picker to autofocus on mount.
|
|
164
172
|
*/
|
|
@@ -272,6 +280,13 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
|
|
|
272
280
|
* `subtle` will remove the borders and background.
|
|
273
281
|
*/
|
|
274
282
|
appearance?: Appearance;
|
|
283
|
+
/**
|
|
284
|
+
* Used to associate accessible descriptions to both the date and time
|
|
285
|
+
* picker. If you want to associate individual accessible descriptions, this
|
|
286
|
+
* should be done through the `datePickerSelectProps` and
|
|
287
|
+
* `timePickerSelectProps`.
|
|
288
|
+
*/
|
|
289
|
+
'aria-describedby'?: string;
|
|
275
290
|
/**
|
|
276
291
|
* Set the picker to autofocus on mount.
|
|
277
292
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/datetime-picker",
|
|
3
|
-
"version": "13.7.
|
|
3
|
+
"version": "13.7.3",
|
|
4
4
|
"description": "A date time picker allows the user to select an associated date and time.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@atlaskit/popper": "^6.1.0",
|
|
50
50
|
"@atlaskit/select": "^17.11.0",
|
|
51
51
|
"@atlaskit/theme": "^12.11.0",
|
|
52
|
-
"@atlaskit/tokens": "^1.
|
|
52
|
+
"@atlaskit/tokens": "^1.56.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@emotion/react": "^11.7.1",
|
|
55
55
|
"date-fns": "^2.17.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@af/accessibility-testing": "*",
|
|
64
64
|
"@af/integration-testing": "*",
|
|
65
65
|
"@af/visual-regression": "*",
|
|
66
|
-
"@atlaskit/button": "^
|
|
66
|
+
"@atlaskit/button": "^19.0.0",
|
|
67
67
|
"@atlaskit/docs": "*",
|
|
68
68
|
"@atlaskit/form": "^10.4.0",
|
|
69
69
|
"@atlaskit/modal-dialog": "^12.14.0",
|