@atlaskit/datetime-picker 13.11.1 → 13.11.2
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 +8 -0
- package/dist/cjs/components/date-picker.js +30 -15
- package/dist/cjs/components/date-time-picker.js +69 -29
- package/dist/cjs/components/time-picker.js +2 -4
- package/dist/cjs/internal/fixed-layer-menu.js +50 -4
- package/dist/cjs/internal/menu.js +24 -9
- package/dist/cjs/internal/single-value.js +37 -4
- package/dist/es2019/components/date-picker.js +30 -15
- package/dist/es2019/components/date-time-picker.js +69 -29
- package/dist/es2019/components/time-picker.js +2 -4
- package/dist/es2019/internal/fixed-layer-menu.js +48 -2
- package/dist/es2019/internal/menu.js +53 -32
- package/dist/es2019/internal/single-value.js +36 -3
- package/dist/esm/components/date-picker.js +30 -15
- package/dist/esm/components/date-time-picker.js +69 -29
- package/dist/esm/components/time-picker.js +2 -4
- package/dist/esm/internal/fixed-layer-menu.js +50 -4
- package/dist/esm/internal/menu.js +25 -9
- package/dist/esm/internal/single-value.js +37 -4
- package/dist/types/internal/fixed-layer-menu.d.ts +1 -1
- package/dist/types/internal/single-value.d.ts +1 -1
- package/dist/types-ts4.5/internal/fixed-layer-menu.d.ts +1 -1
- package/dist/types-ts4.5/internal/single-value.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/datetime-picker
|
|
2
2
|
|
|
3
|
+
## 13.11.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#130953](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/130953)
|
|
8
|
+
[`a6c1f10b9f4b7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a6c1f10b9f4b7) -
|
|
9
|
+
Refactor internal types to make spread props explicit.
|
|
10
|
+
|
|
3
11
|
## 13.11.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -38,7 +38,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
38
38
|
* @jsx jsx
|
|
39
39
|
*/ // 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.11.
|
|
41
|
+
var packageVersion = "13.11.2";
|
|
42
42
|
var datePickerDefaultProps = {
|
|
43
43
|
appearance: 'default',
|
|
44
44
|
autoFocus: false,
|
|
@@ -447,8 +447,6 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
|
|
|
447
447
|
onCalendarSelect: this.onCalendarSelect,
|
|
448
448
|
calendarLocale: locale,
|
|
449
449
|
calendarWeekStartDay: weekStartDay,
|
|
450
|
-
nextMonthLabel: nextMonthLabel,
|
|
451
|
-
previousMonthLabel: previousMonthLabel,
|
|
452
450
|
shouldSetFocusOnCurrentDay: this.state.shouldSetFocusOnCurrentDay
|
|
453
451
|
};
|
|
454
452
|
var mergedStyles = (0, _select.mergeStyles)(selectStyles, {
|
|
@@ -485,31 +483,48 @@ var DatePickerComponent = exports.DatePickerWithoutAnalytics = /*#__PURE__*/func
|
|
|
485
483
|
value: value,
|
|
486
484
|
"data-testid": testId && "".concat(testId, "--input")
|
|
487
485
|
}), (0, _react2.jsx)(_select.default, (0, _extends2.default)({
|
|
486
|
+
appearance: this.props.appearance,
|
|
488
487
|
"aria-describedby": ariaDescribedBy,
|
|
489
488
|
"aria-label": label || undefined,
|
|
490
|
-
appearance: this.props.appearance,
|
|
491
|
-
enableAnimation: false,
|
|
492
|
-
menuIsOpen: menuIsOpen,
|
|
493
|
-
closeMenuOnSelect: true,
|
|
494
489
|
autoFocus: autoFocus,
|
|
490
|
+
closeMenuOnSelect: true,
|
|
491
|
+
components: selectComponents,
|
|
492
|
+
enableAnimation: false,
|
|
495
493
|
inputId: id,
|
|
494
|
+
inputValue: actualSelectInputValue,
|
|
496
495
|
isDisabled: isDisabled,
|
|
496
|
+
menuIsOpen: menuIsOpen,
|
|
497
497
|
onBlur: this.onSelectBlur,
|
|
498
|
+
onChange: this.onSelectChange,
|
|
498
499
|
onFocus: this.onSelectFocus,
|
|
499
|
-
inputValue: actualSelectInputValue,
|
|
500
500
|
onInputChange: this.handleSelectInputChange,
|
|
501
|
-
components: selectComponents,
|
|
502
|
-
onChange: this.onSelectChange
|
|
503
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
504
|
-
,
|
|
505
|
-
styles: mergedStyles,
|
|
506
501
|
placeholder: this.getPlaceholder(),
|
|
502
|
+
styles: mergedStyles,
|
|
507
503
|
value: initialValue
|
|
508
|
-
}, selectProps,
|
|
504
|
+
}, selectProps, {
|
|
505
|
+
// These are below the spread because I don't know what is in
|
|
506
|
+
// selectProps or not and what wil be overwritten
|
|
509
507
|
isClearable: true,
|
|
510
|
-
spacing: spacing,
|
|
511
508
|
isInvalid: isInvalid,
|
|
509
|
+
spacing: spacing,
|
|
512
510
|
testId: testId
|
|
511
|
+
// These aren't part of `Select`'s API, but we're using them here.
|
|
512
|
+
,
|
|
513
|
+
calendarContainerRef: calendarProps.calendarContainerRef,
|
|
514
|
+
calendarDisabled: calendarProps.calendarDisabled,
|
|
515
|
+
calendarDisabledDateFilter: calendarProps.calendarDisabledDateFilter,
|
|
516
|
+
calendarLocale: calendarProps.calendarLocale,
|
|
517
|
+
calendarMaxDate: calendarProps.calendarMaxDate,
|
|
518
|
+
calendarMinDate: calendarProps.calendarMinDate,
|
|
519
|
+
calendarRef: calendarProps.calendarRef,
|
|
520
|
+
calendarValue: calendarProps.calendarValue,
|
|
521
|
+
calendarView: calendarProps.calendarView,
|
|
522
|
+
calendarWeekStartDay: calendarProps.calendarWeekStartDay,
|
|
523
|
+
nextMonthLabel: nextMonthLabel,
|
|
524
|
+
onCalendarChange: calendarProps.onCalendarChange,
|
|
525
|
+
onCalendarSelect: calendarProps.onCalendarSelect,
|
|
526
|
+
previousMonthLabel: previousMonthLabel,
|
|
527
|
+
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay
|
|
513
528
|
})))
|
|
514
529
|
);
|
|
515
530
|
}
|
|
@@ -34,7 +34,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
34
34
|
* @jsx jsx
|
|
35
35
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
36
36
|
var packageName = "@atlaskit/datetime-picker";
|
|
37
|
-
var packageVersion = "13.11.
|
|
37
|
+
var packageVersion = "13.11.2";
|
|
38
38
|
// Make DatePicker 50% the width of DateTimePicker
|
|
39
39
|
// If rendering an icon container, shrink the TimePicker
|
|
40
40
|
var datePickerContainerStyles = (0, _react2.css)({
|
|
@@ -268,39 +268,79 @@ var DateTimePickerComponent = exports.DateTimePickerWithoutAnalytics = /*#__PURE
|
|
|
268
268
|
css: datePickerContainerStyles
|
|
269
269
|
}, (0, _react2.jsx)(_datePicker.default, (0, _extends2.default)({
|
|
270
270
|
appearance: appearance,
|
|
271
|
-
autoFocus: autoFocus,
|
|
272
|
-
dateFormat: dateFormat,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
271
|
+
autoFocus: datePickerProps.autoFocus || autoFocus,
|
|
272
|
+
dateFormat: datePickerProps.dateFormat || dateFormat,
|
|
273
|
+
defaultIsOpen: datePickerProps.defaultIsOpen,
|
|
274
|
+
defaultValue: datePickerProps.defaultValue,
|
|
275
|
+
disabled: datePickerProps.disabled,
|
|
276
|
+
disabledDateFilter: datePickerProps.disabledDateFilter,
|
|
277
|
+
formatDisplayLabel: datePickerProps.formatDisplayLabel,
|
|
278
|
+
hideIcon: datePickerProps.hideIcon || true,
|
|
279
|
+
icon: datePickerProps.icon,
|
|
280
|
+
id: datePickerProps.id || id,
|
|
281
|
+
innerProps: datePickerProps.innerProps,
|
|
282
|
+
isDisabled: datePickerProps.isDisabled || isDisabled,
|
|
283
|
+
isInvalid: datePickerProps.isInvalid || isInvalid
|
|
284
|
+
// If you set this or `value` explicitly like
|
|
285
|
+
// `isOpen={datePickerProps.isOpen}`, the date picker will set
|
|
286
|
+
// `isOpen` to `undefined` forever. I believe this has to do with
|
|
287
|
+
// the `getSafeState` function in the picker, since it overwrites
|
|
288
|
+
// state with values from the props.
|
|
289
|
+
}, datePickerProps.isOpen ? {
|
|
290
|
+
isOpen: datePickerProps.isOpen
|
|
291
|
+
} : {}, {
|
|
292
|
+
locale: datePickerProps.locale || locale,
|
|
293
|
+
maxDate: datePickerProps.maxDate,
|
|
294
|
+
minDate: datePickerProps.minDate,
|
|
295
|
+
name: datePickerProps.name,
|
|
296
|
+
nextMonthLabel: datePickerProps.nextMonthLabel,
|
|
297
|
+
onBlur: datePickerProps.onBlur || this.onBlur,
|
|
298
|
+
onChange: datePickerProps.onChange || this.onDateChange,
|
|
299
|
+
onFocus: datePickerProps.onFocus || this.onFocus,
|
|
300
|
+
parseInputValue: datePickerProps.parseInputValue,
|
|
301
|
+
placeholder: datePickerProps.placeholder,
|
|
302
|
+
previousMonthLabel: datePickerProps.previousMonthLabel,
|
|
281
303
|
selectProps: mergedDatePickerSelectProps,
|
|
282
|
-
spacing: spacing,
|
|
283
|
-
testId: testId && "".concat(testId, "--datepicker"),
|
|
284
|
-
value: dateValue
|
|
285
|
-
|
|
304
|
+
spacing: datePickerProps.spacing || spacing,
|
|
305
|
+
testId: testId && "".concat(testId, "--datepicker") || datePickerProps.testId,
|
|
306
|
+
value: dateValue,
|
|
307
|
+
weekStartDay: datePickerProps.weekStartDay
|
|
308
|
+
}))), (0, _react2.jsx)("div", {
|
|
286
309
|
css: timePickerContainerStyles
|
|
287
310
|
}, (0, _react2.jsx)(_timePicker.default, (0, _extends2.default)({
|
|
288
|
-
appearance: appearance,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
311
|
+
appearance: timePickerProps.appearance || appearance,
|
|
312
|
+
autoFocus: timePickerProps.autoFocus,
|
|
313
|
+
defaultIsOpen: timePickerProps.defaultIsOpen,
|
|
314
|
+
defaultValue: timePickerProps.defaultValue,
|
|
315
|
+
formatDisplayLabel: timePickerProps.formatDisplayLabel,
|
|
316
|
+
hideIcon: timePickerProps.hideIcon || true,
|
|
317
|
+
id: timePickerProps.id,
|
|
318
|
+
innerProps: timePickerProps.innerProps,
|
|
319
|
+
isDisabled: timePickerProps.isDisabled || isDisabled,
|
|
320
|
+
isInvalid: timePickerProps.isInvalid || isInvalid
|
|
321
|
+
// If you set this or `value` explicitly like
|
|
322
|
+
// `isOpen={datePickerProps.isOpen}`, the date picker will set
|
|
323
|
+
// `isOpen` to `undefined` forever. I believe this has to do with
|
|
324
|
+
// the `getSafeState` function in the picker, since it overwrites
|
|
325
|
+
// state with values from the props.
|
|
326
|
+
}, timePickerProps.isOpen ? {
|
|
327
|
+
isOpen: timePickerProps.isOpen
|
|
328
|
+
} : {}, {
|
|
329
|
+
locale: timePickerProps.locale || locale,
|
|
330
|
+
name: timePickerProps.name,
|
|
331
|
+
onBlur: timePickerProps.onBlur || this.onBlur,
|
|
332
|
+
onChange: timePickerProps.onChange || this.onTimeChange,
|
|
333
|
+
onFocus: timePickerProps.onFocus || this.onFocus,
|
|
334
|
+
parseInputValue: timePickerProps.parseInputValue,
|
|
335
|
+
placeholder: timePickerProps.placeholder,
|
|
296
336
|
selectProps: mergedTimePickerSelectProps,
|
|
297
|
-
spacing: spacing,
|
|
298
|
-
testId: testId && "".concat(testId, "--timepicker"),
|
|
299
|
-
timeFormat: timeFormat,
|
|
300
|
-
timeIsEditable: timeIsEditable,
|
|
301
|
-
times: times,
|
|
337
|
+
spacing: timePickerProps.spacing || spacing,
|
|
338
|
+
testId: timePickerProps.testId || testId && "".concat(testId, "--timepicker"),
|
|
339
|
+
timeFormat: timePickerProps.timeFormat || timeFormat,
|
|
340
|
+
timeIsEditable: timePickerProps.timeIsEditable || timeIsEditable,
|
|
341
|
+
times: timePickerProps.times || times,
|
|
302
342
|
value: timeValue
|
|
303
|
-
}
|
|
343
|
+
}))), isClearable && !isDisabled ? (0, _react2.jsx)("button", {
|
|
304
344
|
css: iconContainerStyles,
|
|
305
345
|
onClick: this.onClear,
|
|
306
346
|
"data-testid": testId && "".concat(testId, "--icon--container"),
|
|
@@ -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.11.
|
|
39
|
+
var packageVersion = "13.11.2";
|
|
40
40
|
var menuStyles = {
|
|
41
41
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
42
42
|
position: 'static',
|
|
@@ -321,9 +321,7 @@ var TimePickerComponent = exports.TimePickerWithoutAnalytics = /*#__PURE__*/func
|
|
|
321
321
|
placeholder: placeholder || l10n.formatTime(_internal.placeholderDatetime),
|
|
322
322
|
styles: mergedStyles,
|
|
323
323
|
value: initialValue,
|
|
324
|
-
spacing: spacing
|
|
325
|
-
// @ts-ignore caused by prop not part of @atlaskit/select
|
|
326
|
-
,
|
|
324
|
+
spacing: spacing,
|
|
327
325
|
fixedLayerRef: this.containerRef,
|
|
328
326
|
isInvalid: isInvalid,
|
|
329
327
|
testId: testId
|
|
@@ -10,7 +10,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
10
10
|
var _react = require("@emotion/react");
|
|
11
11
|
var _select = require("@atlaskit/select");
|
|
12
12
|
var _fixedLayer = _interopRequireDefault(require("../internal/fixed-layer"));
|
|
13
|
-
var _excluded = ["selectProps"];
|
|
13
|
+
var _excluded = ["className", "clearValue", "cx", "getStyles", "getValue", "hasValue", "innerProps", "innerRef", "isLoading", "isMulti", "isRtl", "maxMenuHeight", "menuPlacement", "menuPosition", "menuShouldScrollIntoView", "minMenuHeight", "options", "placement", "selectOption", "selectProps", "setValue", "theme", "children"];
|
|
14
14
|
/**
|
|
15
15
|
* @jsxRuntime classic
|
|
16
16
|
* @jsx jsx
|
|
@@ -20,14 +20,60 @@ var _excluded = ["selectProps"];
|
|
|
20
20
|
* This is the fixed layer menu used in the time picker.
|
|
21
21
|
*/
|
|
22
22
|
var FixedLayerMenu = exports.FixedLayerMenu = function FixedLayerMenu(_ref) {
|
|
23
|
-
var
|
|
23
|
+
var className = _ref.className,
|
|
24
|
+
clearValue = _ref.clearValue,
|
|
25
|
+
cx = _ref.cx,
|
|
26
|
+
getStyles = _ref.getStyles,
|
|
27
|
+
getValue = _ref.getValue,
|
|
28
|
+
hasValue = _ref.hasValue,
|
|
29
|
+
innerProps = _ref.innerProps,
|
|
30
|
+
innerRef = _ref.innerRef,
|
|
31
|
+
isLoading = _ref.isLoading,
|
|
32
|
+
isMulti = _ref.isMulti,
|
|
33
|
+
isRtl = _ref.isRtl,
|
|
34
|
+
maxMenuHeight = _ref.maxMenuHeight,
|
|
35
|
+
menuPlacement = _ref.menuPlacement,
|
|
36
|
+
menuPosition = _ref.menuPosition,
|
|
37
|
+
menuShouldScrollIntoView = _ref.menuShouldScrollIntoView,
|
|
38
|
+
minMenuHeight = _ref.minMenuHeight,
|
|
39
|
+
options = _ref.options,
|
|
40
|
+
placement = _ref.placement,
|
|
41
|
+
selectOption = _ref.selectOption,
|
|
42
|
+
selectProps = _ref.selectProps,
|
|
43
|
+
setValue = _ref.setValue,
|
|
44
|
+
theme = _ref.theme,
|
|
45
|
+
children = _ref.children,
|
|
24
46
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
25
47
|
return (0, _react.jsx)(_fixedLayer.default, {
|
|
26
48
|
inputValue: selectProps.inputValue,
|
|
27
49
|
containerRef: selectProps.fixedLayerRef,
|
|
28
50
|
content: (0, _react.jsx)(_select.components.Menu, (0, _extends2.default)({}, rest, {
|
|
29
|
-
|
|
30
|
-
|
|
51
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides, @atlaskit/ui-styling-standard/no-classname-prop
|
|
52
|
+
className: className,
|
|
53
|
+
clearValue: clearValue,
|
|
54
|
+
cx: cx,
|
|
55
|
+
getStyles: getStyles,
|
|
56
|
+
getValue: getValue,
|
|
57
|
+
hasValue: hasValue,
|
|
58
|
+
innerProps: innerProps,
|
|
59
|
+
innerRef: innerRef,
|
|
60
|
+
isLoading: isLoading,
|
|
61
|
+
isMulti: isMulti,
|
|
62
|
+
isRtl: isRtl,
|
|
63
|
+
maxMenuHeight: maxMenuHeight,
|
|
64
|
+
menuPlacement: menuPlacement,
|
|
65
|
+
menuPosition: menuPosition,
|
|
66
|
+
menuShouldScrollIntoView: false || menuShouldScrollIntoView,
|
|
67
|
+
minMenuHeight: minMenuHeight,
|
|
68
|
+
options: options,
|
|
69
|
+
placement: placement,
|
|
70
|
+
selectOption: selectOption,
|
|
71
|
+
selectProps: selectProps,
|
|
72
|
+
setValue: setValue
|
|
73
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides, @atlaskit/design-system/no-unsafe-style-overrides
|
|
74
|
+
,
|
|
75
|
+
theme: theme
|
|
76
|
+
}), children),
|
|
31
77
|
testId: selectProps.testId
|
|
32
78
|
});
|
|
33
79
|
};
|
|
@@ -19,13 +19,19 @@ var _fixedLayer = _interopRequireDefault(require("../internal/fixed-layer"));
|
|
|
19
19
|
*/
|
|
20
20
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
/**
|
|
23
|
+
* @param isos A series of ISO dates.
|
|
24
|
+
* @returns The last valid date within the array of ISO strings.
|
|
25
|
+
*/
|
|
26
|
+
function getValidDate(isos) {
|
|
27
|
+
return isos.reduce(function (acc, iso) {
|
|
28
|
+
var date = (0, _dateFns.parseISO)(iso);
|
|
29
|
+
return (0, _dateFns.isValid)(date) ? {
|
|
30
|
+
day: date.getDate(),
|
|
31
|
+
month: date.getMonth() + 1,
|
|
32
|
+
year: date.getFullYear()
|
|
33
|
+
} : acc;
|
|
34
|
+
}, {});
|
|
29
35
|
}
|
|
30
36
|
var menuStyles = (0, _react.css)({
|
|
31
37
|
zIndex: _constants.layers.dialog(),
|
|
@@ -41,6 +47,12 @@ var menuStyles = (0, _react.css)({
|
|
|
41
47
|
var Menu = exports.Menu = function Menu(_ref) {
|
|
42
48
|
var selectProps = _ref.selectProps,
|
|
43
49
|
innerProps = _ref.innerProps;
|
|
50
|
+
var calendarValue = selectProps.calendarValue,
|
|
51
|
+
calendarView = selectProps.calendarView;
|
|
52
|
+
var _getValidDate = getValidDate([calendarValue, calendarView]),
|
|
53
|
+
day = _getValidDate.day,
|
|
54
|
+
month = _getValidDate.month,
|
|
55
|
+
year = _getValidDate.year;
|
|
44
56
|
return (0, _react.jsx)(_layering.UNSAFE_LAYERING, {
|
|
45
57
|
isDisabled: false
|
|
46
58
|
}, (0, _react.jsx)(_fixedLayer.default, {
|
|
@@ -48,7 +60,10 @@ var Menu = exports.Menu = function Menu(_ref) {
|
|
|
48
60
|
containerRef: selectProps.calendarContainerRef,
|
|
49
61
|
content: (0, _react.jsx)("div", (0, _extends2.default)({
|
|
50
62
|
css: menuStyles
|
|
51
|
-
}, innerProps), (0, _react.jsx)(_calendar.default,
|
|
63
|
+
}, innerProps), (0, _react.jsx)(_calendar.default, {
|
|
64
|
+
day: day,
|
|
65
|
+
month: month,
|
|
66
|
+
year: year,
|
|
52
67
|
disabled: selectProps.calendarDisabled,
|
|
53
68
|
disabledDateFilter: selectProps.calendarDisabledDateFilter,
|
|
54
69
|
minDate: selectProps.calendarMinDate,
|
|
@@ -63,7 +78,7 @@ var Menu = exports.Menu = function Menu(_ref) {
|
|
|
63
78
|
locale: selectProps.calendarLocale,
|
|
64
79
|
testId: selectProps.testId && "".concat(selectProps.testId, "--calendar"),
|
|
65
80
|
weekStartDay: selectProps.calendarWeekStartDay
|
|
66
|
-
}))
|
|
81
|
+
})),
|
|
67
82
|
testId: selectProps.testId
|
|
68
83
|
}));
|
|
69
84
|
};
|
|
@@ -9,7 +9,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _select = require("@atlaskit/select");
|
|
12
|
-
var _excluded = ["children"];
|
|
12
|
+
var _excluded = ["children", "className", "clearValue", "cx", "data", "getStyles", "getValue", "hasValue", "isDisabled", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue", "theme"];
|
|
13
13
|
/**
|
|
14
14
|
* This creates a functional component that `react-select` will use to make the
|
|
15
15
|
* SingleValue part of the different pickers.
|
|
@@ -18,11 +18,44 @@ var makeSingleValue = exports.makeSingleValue = function makeSingleValue(_ref) {
|
|
|
18
18
|
var lang = _ref.lang;
|
|
19
19
|
return function (_ref2) {
|
|
20
20
|
var children = _ref2.children,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
className = _ref2.className,
|
|
22
|
+
clearValue = _ref2.clearValue,
|
|
23
|
+
cx = _ref2.cx,
|
|
24
|
+
data = _ref2.data,
|
|
25
|
+
getStyles = _ref2.getStyles,
|
|
26
|
+
getValue = _ref2.getValue,
|
|
27
|
+
hasValue = _ref2.hasValue,
|
|
28
|
+
isDisabled = _ref2.isDisabled,
|
|
29
|
+
isMulti = _ref2.isMulti,
|
|
30
|
+
isRtl = _ref2.isRtl,
|
|
31
|
+
options = _ref2.options,
|
|
32
|
+
selectOption = _ref2.selectOption,
|
|
33
|
+
selectProps = _ref2.selectProps,
|
|
34
|
+
setValue = _ref2.setValue,
|
|
35
|
+
theme = _ref2.theme,
|
|
36
|
+
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_select.components.SingleValue, (0, _extends2.default)({}, rest, {
|
|
38
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides, @atlaskit/ui-styling-standard/no-classname-prop
|
|
39
|
+
className: className,
|
|
40
|
+
clearValue: clearValue,
|
|
41
|
+
cx: cx,
|
|
42
|
+
data: data,
|
|
43
|
+
getStyles: getStyles,
|
|
44
|
+
getValue: getValue,
|
|
45
|
+
hasValue: hasValue,
|
|
23
46
|
innerProps: {
|
|
24
47
|
lang: lang
|
|
25
|
-
}
|
|
48
|
+
},
|
|
49
|
+
isDisabled: isDisabled,
|
|
50
|
+
isMulti: isMulti,
|
|
51
|
+
isRtl: isRtl,
|
|
52
|
+
options: options,
|
|
53
|
+
selectOption: selectOption,
|
|
54
|
+
selectProps: selectProps,
|
|
55
|
+
setValue: setValue
|
|
56
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-overrides, @atlaskit/design-system/no-unsafe-style-overrides
|
|
57
|
+
,
|
|
58
|
+
theme: theme
|
|
26
59
|
}), children);
|
|
27
60
|
};
|
|
28
61
|
};
|
|
@@ -20,7 +20,7 @@ import { getSafeCalendarValue, getShortISOString } from '../internal/parse-date'
|
|
|
20
20
|
import { convertTokens } from '../internal/parse-tokens';
|
|
21
21
|
import { makeSingleValue } from '../internal/single-value';
|
|
22
22
|
const packageName = "@atlaskit/datetime-picker";
|
|
23
|
-
const packageVersion = "13.11.
|
|
23
|
+
const packageVersion = "13.11.2";
|
|
24
24
|
const datePickerDefaultProps = {
|
|
25
25
|
appearance: 'default',
|
|
26
26
|
autoFocus: false,
|
|
@@ -448,8 +448,6 @@ class DatePickerComponent extends Component {
|
|
|
448
448
|
onCalendarSelect: this.onCalendarSelect,
|
|
449
449
|
calendarLocale: locale,
|
|
450
450
|
calendarWeekStartDay: weekStartDay,
|
|
451
|
-
nextMonthLabel,
|
|
452
|
-
previousMonthLabel,
|
|
453
451
|
shouldSetFocusOnCurrentDay: this.state.shouldSetFocusOnCurrentDay
|
|
454
452
|
};
|
|
455
453
|
const mergedStyles = mergeStyles(selectStyles, {
|
|
@@ -486,31 +484,48 @@ class DatePickerComponent extends Component {
|
|
|
486
484
|
value: value,
|
|
487
485
|
"data-testid": testId && `${testId}--input`
|
|
488
486
|
}), jsx(Select, _extends({
|
|
487
|
+
appearance: this.props.appearance,
|
|
489
488
|
"aria-describedby": ariaDescribedBy,
|
|
490
489
|
"aria-label": label || undefined,
|
|
491
|
-
appearance: this.props.appearance,
|
|
492
|
-
enableAnimation: false,
|
|
493
|
-
menuIsOpen: menuIsOpen,
|
|
494
|
-
closeMenuOnSelect: true,
|
|
495
490
|
autoFocus: autoFocus,
|
|
491
|
+
closeMenuOnSelect: true,
|
|
492
|
+
components: selectComponents,
|
|
493
|
+
enableAnimation: false,
|
|
496
494
|
inputId: id,
|
|
495
|
+
inputValue: actualSelectInputValue,
|
|
497
496
|
isDisabled: isDisabled,
|
|
497
|
+
menuIsOpen: menuIsOpen,
|
|
498
498
|
onBlur: this.onSelectBlur,
|
|
499
|
+
onChange: this.onSelectChange,
|
|
499
500
|
onFocus: this.onSelectFocus,
|
|
500
|
-
inputValue: actualSelectInputValue,
|
|
501
501
|
onInputChange: this.handleSelectInputChange,
|
|
502
|
-
components: selectComponents,
|
|
503
|
-
onChange: this.onSelectChange
|
|
504
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
505
|
-
,
|
|
506
|
-
styles: mergedStyles,
|
|
507
502
|
placeholder: this.getPlaceholder(),
|
|
503
|
+
styles: mergedStyles,
|
|
508
504
|
value: initialValue
|
|
509
|
-
}, selectProps,
|
|
505
|
+
}, selectProps, {
|
|
506
|
+
// These are below the spread because I don't know what is in
|
|
507
|
+
// selectProps or not and what wil be overwritten
|
|
510
508
|
isClearable: true,
|
|
511
|
-
spacing: spacing,
|
|
512
509
|
isInvalid: isInvalid,
|
|
510
|
+
spacing: spacing,
|
|
513
511
|
testId: testId
|
|
512
|
+
// These aren't part of `Select`'s API, but we're using them here.
|
|
513
|
+
,
|
|
514
|
+
calendarContainerRef: calendarProps.calendarContainerRef,
|
|
515
|
+
calendarDisabled: calendarProps.calendarDisabled,
|
|
516
|
+
calendarDisabledDateFilter: calendarProps.calendarDisabledDateFilter,
|
|
517
|
+
calendarLocale: calendarProps.calendarLocale,
|
|
518
|
+
calendarMaxDate: calendarProps.calendarMaxDate,
|
|
519
|
+
calendarMinDate: calendarProps.calendarMinDate,
|
|
520
|
+
calendarRef: calendarProps.calendarRef,
|
|
521
|
+
calendarValue: calendarProps.calendarValue,
|
|
522
|
+
calendarView: calendarProps.calendarView,
|
|
523
|
+
calendarWeekStartDay: calendarProps.calendarWeekStartDay,
|
|
524
|
+
nextMonthLabel: nextMonthLabel,
|
|
525
|
+
onCalendarChange: calendarProps.onCalendarChange,
|
|
526
|
+
onCalendarSelect: calendarProps.onCalendarSelect,
|
|
527
|
+
previousMonthLabel: previousMonthLabel,
|
|
528
|
+
shouldSetFocusOnCurrentDay: calendarProps.shouldSetFocusOnCurrentDay
|
|
514
529
|
})))
|
|
515
530
|
);
|
|
516
531
|
}
|
|
@@ -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.11.
|
|
23
|
+
const packageVersion = "13.11.2";
|
|
24
24
|
// Make DatePicker 50% the width of DateTimePicker
|
|
25
25
|
// If rendering an icon container, shrink the TimePicker
|
|
26
26
|
const datePickerContainerStyles = css({
|
|
@@ -256,39 +256,79 @@ class DateTimePickerComponent extends React.Component {
|
|
|
256
256
|
css: datePickerContainerStyles
|
|
257
257
|
}, jsx(DatePicker, _extends({
|
|
258
258
|
appearance: appearance,
|
|
259
|
-
autoFocus: autoFocus,
|
|
260
|
-
dateFormat: dateFormat,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
259
|
+
autoFocus: datePickerProps.autoFocus || autoFocus,
|
|
260
|
+
dateFormat: datePickerProps.dateFormat || dateFormat,
|
|
261
|
+
defaultIsOpen: datePickerProps.defaultIsOpen,
|
|
262
|
+
defaultValue: datePickerProps.defaultValue,
|
|
263
|
+
disabled: datePickerProps.disabled,
|
|
264
|
+
disabledDateFilter: datePickerProps.disabledDateFilter,
|
|
265
|
+
formatDisplayLabel: datePickerProps.formatDisplayLabel,
|
|
266
|
+
hideIcon: datePickerProps.hideIcon || true,
|
|
267
|
+
icon: datePickerProps.icon,
|
|
268
|
+
id: datePickerProps.id || id,
|
|
269
|
+
innerProps: datePickerProps.innerProps,
|
|
270
|
+
isDisabled: datePickerProps.isDisabled || isDisabled,
|
|
271
|
+
isInvalid: datePickerProps.isInvalid || isInvalid
|
|
272
|
+
// If you set this or `value` explicitly like
|
|
273
|
+
// `isOpen={datePickerProps.isOpen}`, the date picker will set
|
|
274
|
+
// `isOpen` to `undefined` forever. I believe this has to do with
|
|
275
|
+
// the `getSafeState` function in the picker, since it overwrites
|
|
276
|
+
// state with values from the props.
|
|
277
|
+
}, datePickerProps.isOpen ? {
|
|
278
|
+
isOpen: datePickerProps.isOpen
|
|
279
|
+
} : {}, {
|
|
280
|
+
locale: datePickerProps.locale || locale,
|
|
281
|
+
maxDate: datePickerProps.maxDate,
|
|
282
|
+
minDate: datePickerProps.minDate,
|
|
283
|
+
name: datePickerProps.name,
|
|
284
|
+
nextMonthLabel: datePickerProps.nextMonthLabel,
|
|
285
|
+
onBlur: datePickerProps.onBlur || this.onBlur,
|
|
286
|
+
onChange: datePickerProps.onChange || this.onDateChange,
|
|
287
|
+
onFocus: datePickerProps.onFocus || this.onFocus,
|
|
288
|
+
parseInputValue: datePickerProps.parseInputValue,
|
|
289
|
+
placeholder: datePickerProps.placeholder,
|
|
290
|
+
previousMonthLabel: datePickerProps.previousMonthLabel,
|
|
269
291
|
selectProps: mergedDatePickerSelectProps,
|
|
270
|
-
spacing: spacing,
|
|
271
|
-
testId: testId && `${testId}--datepicker
|
|
272
|
-
value: dateValue
|
|
273
|
-
|
|
292
|
+
spacing: datePickerProps.spacing || spacing,
|
|
293
|
+
testId: testId && `${testId}--datepicker` || datePickerProps.testId,
|
|
294
|
+
value: dateValue,
|
|
295
|
+
weekStartDay: datePickerProps.weekStartDay
|
|
296
|
+
}))), jsx("div", {
|
|
274
297
|
css: timePickerContainerStyles
|
|
275
298
|
}, jsx(TimePicker, _extends({
|
|
276
|
-
appearance: appearance,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
299
|
+
appearance: timePickerProps.appearance || appearance,
|
|
300
|
+
autoFocus: timePickerProps.autoFocus,
|
|
301
|
+
defaultIsOpen: timePickerProps.defaultIsOpen,
|
|
302
|
+
defaultValue: timePickerProps.defaultValue,
|
|
303
|
+
formatDisplayLabel: timePickerProps.formatDisplayLabel,
|
|
304
|
+
hideIcon: timePickerProps.hideIcon || true,
|
|
305
|
+
id: timePickerProps.id,
|
|
306
|
+
innerProps: timePickerProps.innerProps,
|
|
307
|
+
isDisabled: timePickerProps.isDisabled || isDisabled,
|
|
308
|
+
isInvalid: timePickerProps.isInvalid || isInvalid
|
|
309
|
+
// If you set this or `value` explicitly like
|
|
310
|
+
// `isOpen={datePickerProps.isOpen}`, the date picker will set
|
|
311
|
+
// `isOpen` to `undefined` forever. I believe this has to do with
|
|
312
|
+
// the `getSafeState` function in the picker, since it overwrites
|
|
313
|
+
// state with values from the props.
|
|
314
|
+
}, timePickerProps.isOpen ? {
|
|
315
|
+
isOpen: timePickerProps.isOpen
|
|
316
|
+
} : {}, {
|
|
317
|
+
locale: timePickerProps.locale || locale,
|
|
318
|
+
name: timePickerProps.name,
|
|
319
|
+
onBlur: timePickerProps.onBlur || this.onBlur,
|
|
320
|
+
onChange: timePickerProps.onChange || this.onTimeChange,
|
|
321
|
+
onFocus: timePickerProps.onFocus || this.onFocus,
|
|
322
|
+
parseInputValue: timePickerProps.parseInputValue,
|
|
323
|
+
placeholder: timePickerProps.placeholder,
|
|
284
324
|
selectProps: mergedTimePickerSelectProps,
|
|
285
|
-
spacing: spacing,
|
|
286
|
-
testId: testId && `${testId}--timepicker`,
|
|
287
|
-
timeFormat: timeFormat,
|
|
288
|
-
timeIsEditable: timeIsEditable,
|
|
289
|
-
times: times,
|
|
325
|
+
spacing: timePickerProps.spacing || spacing,
|
|
326
|
+
testId: timePickerProps.testId || testId && `${testId}--timepicker`,
|
|
327
|
+
timeFormat: timePickerProps.timeFormat || timeFormat,
|
|
328
|
+
timeIsEditable: timePickerProps.timeIsEditable || timeIsEditable,
|
|
329
|
+
times: timePickerProps.times || times,
|
|
290
330
|
value: timeValue
|
|
291
|
-
}
|
|
331
|
+
}))), isClearable && !isDisabled ? jsx("button", {
|
|
292
332
|
css: iconContainerStyles,
|
|
293
333
|
onClick: this.onClear,
|
|
294
334
|
"data-testid": testId && `${testId}--icon--container`,
|
|
@@ -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.11.
|
|
19
|
+
const packageVersion = "13.11.2";
|
|
20
20
|
const menuStyles = {
|
|
21
21
|
/* Need to remove default absolute positioning as that causes issues with position fixed */
|
|
22
22
|
position: 'static',
|
|
@@ -297,9 +297,7 @@ class TimePickerComponent extends React.Component {
|
|
|
297
297
|
placeholder: placeholder || l10n.formatTime(placeholderDatetime),
|
|
298
298
|
styles: mergedStyles,
|
|
299
299
|
value: initialValue,
|
|
300
|
-
spacing: spacing
|
|
301
|
-
// @ts-ignore caused by prop not part of @atlaskit/select
|
|
302
|
-
,
|
|
300
|
+
spacing: spacing,
|
|
303
301
|
fixedLayerRef: this.containerRef,
|
|
304
302
|
isInvalid: isInvalid,
|
|
305
303
|
testId: testId
|