@atlaskit/calendar 13.3.1 → 13.3.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 +78 -66
- package/codemods/utils.tsx +2 -1
- package/dist/cjs/calendar.js +51 -55
- package/dist/cjs/internal/components/date.js +25 -26
- package/dist/cjs/internal/components/header.js +1 -2
- package/dist/cjs/internal/components/week-day-grid.js +1 -2
- package/dist/cjs/internal/components/week-days.js +29 -35
- package/dist/cjs/internal/components/week-header.js +1 -2
- package/dist/cjs/internal/constants.js +4 -8
- package/dist/cjs/internal/hooks/use-handle-date-change.js +1 -1
- package/dist/cjs/internal/styles/date.js +2 -3
- package/dist/es2019/calendar.js +50 -53
- package/dist/es2019/internal/components/date.js +1 -1
- package/dist/es2019/internal/components/week-days.js +24 -29
- package/dist/es2019/internal/hooks/use-handle-date-change.js +1 -1
- package/dist/esm/calendar.js +50 -53
- package/dist/esm/internal/components/date.js +24 -24
- package/dist/esm/internal/components/week-days.js +28 -33
- package/dist/esm/internal/hooks/use-handle-date-change.js +1 -1
- package/dist/types/internal/hooks/use-handle-date-change.d.ts +1 -1
- package/dist/types-ts4.5/internal/hooks/use-handle-date-change.d.ts +1 -1
- package/package.json +7 -7
package/dist/cjs/calendar.js
CHANGED
|
@@ -35,7 +35,7 @@ var boxStyles = (0, _primitives.xcss)({
|
|
|
35
35
|
var analyticsAttributes = {
|
|
36
36
|
componentName: 'calendar',
|
|
37
37
|
packageName: "@atlaskit/calendar",
|
|
38
|
-
packageVersion: "13.3.
|
|
38
|
+
packageVersion: "13.3.3"
|
|
39
39
|
};
|
|
40
40
|
var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
|
|
41
41
|
var day = _ref.day,
|
|
@@ -191,58 +191,55 @@ var CalendarWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_re
|
|
|
191
191
|
return "".concat(monthsLong[previousMonth], " ").concat(showPreviousYear ? yearValue - 1 : yearValue);
|
|
192
192
|
};
|
|
193
193
|
var headerId = (0, _useUniqueId.default)('month-year-header');
|
|
194
|
-
return (
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
testId: testId
|
|
244
|
-
})))))
|
|
245
|
-
);
|
|
194
|
+
return (0, _react2.jsx)("div", {
|
|
195
|
+
className: className,
|
|
196
|
+
style: style,
|
|
197
|
+
onBlur: handleContainerBlur,
|
|
198
|
+
onFocus: handleContainerFocus,
|
|
199
|
+
"data-testid": testId && "".concat(testId, "--container"),
|
|
200
|
+
ref: ref
|
|
201
|
+
}, (0, _react2.jsx)(_primitives.Box, {
|
|
202
|
+
xcss: boxStyles,
|
|
203
|
+
padding: "space.200",
|
|
204
|
+
"aria-label": "calendar",
|
|
205
|
+
testId: testId && "".concat(testId, "--calendar")
|
|
206
|
+
}, (0, _react2.jsx)(_primitives.Stack, {
|
|
207
|
+
space: "space.150"
|
|
208
|
+
}, (0, _react2.jsx)(_header.default
|
|
209
|
+
// The month number needs to be translated to index in the month
|
|
210
|
+
// name array e.g. 1 (January) -> 0
|
|
211
|
+
, {
|
|
212
|
+
monthLongTitle: monthsLong[monthValue - 1],
|
|
213
|
+
year: yearValue,
|
|
214
|
+
nextMonthLabel: nextMonthLabel,
|
|
215
|
+
previousMonthLabel: previousMonthLabel,
|
|
216
|
+
nextHeading: getNextHeading(),
|
|
217
|
+
previousHeading: getPreviousHeading(),
|
|
218
|
+
handleClickNext: handleClickNext,
|
|
219
|
+
handleClickPrev: handleClickPrev,
|
|
220
|
+
headerId: headerId,
|
|
221
|
+
mode: mode,
|
|
222
|
+
tabIndex: tabIndex,
|
|
223
|
+
testId: testId
|
|
224
|
+
}), (0, _react2.jsx)(_primitives.Box, {
|
|
225
|
+
role: "grid",
|
|
226
|
+
tabIndex: tabIndex,
|
|
227
|
+
onKeyDown: handleContainerKeyDown,
|
|
228
|
+
"aria-labelledby": headerId,
|
|
229
|
+
testId: testId && "".concat(testId, "--calendar-dates")
|
|
230
|
+
}, (0, _react2.jsx)(_weekHeader.default, {
|
|
231
|
+
daysShort: daysShort,
|
|
232
|
+
mode: mode,
|
|
233
|
+
testId: testId
|
|
234
|
+
}), (0, _react2.jsx)(_weekDays.default, {
|
|
235
|
+
weeks: weeks,
|
|
236
|
+
handleClickDay: handleClickDay,
|
|
237
|
+
mode: mode,
|
|
238
|
+
monthsLong: monthsLong,
|
|
239
|
+
shouldSetFocus: shouldSetFocus,
|
|
240
|
+
tabIndex: tabIndex,
|
|
241
|
+
testId: testId
|
|
242
|
+
})))));
|
|
246
243
|
});
|
|
247
244
|
|
|
248
245
|
/**
|
|
@@ -264,5 +261,4 @@ var Calendar = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef
|
|
|
264
261
|
});
|
|
265
262
|
}));
|
|
266
263
|
Calendar.displayName = 'Calendar';
|
|
267
|
-
var _default = Calendar;
|
|
268
|
-
exports.default = _default;
|
|
264
|
+
var _default = exports.default = Calendar;
|
|
@@ -12,30 +12,30 @@ var _primitives = require("@atlaskit/primitives");
|
|
|
12
12
|
var _date = require("../styles/date");
|
|
13
13
|
/** @jsx jsx */
|
|
14
14
|
|
|
15
|
-
var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function Date(
|
|
16
|
-
var day =
|
|
17
|
-
|
|
18
|
-
isDisabled =
|
|
19
|
-
|
|
20
|
-
isFocused =
|
|
21
|
-
|
|
22
|
-
isToday =
|
|
23
|
-
dayLong =
|
|
24
|
-
month =
|
|
25
|
-
monthLong =
|
|
26
|
-
|
|
27
|
-
onClick =
|
|
28
|
-
|
|
29
|
-
isPreviouslySelected =
|
|
30
|
-
|
|
31
|
-
isSelected =
|
|
32
|
-
|
|
33
|
-
isSibling =
|
|
34
|
-
year =
|
|
35
|
-
mode =
|
|
36
|
-
shouldSetFocus =
|
|
37
|
-
tabIndex =
|
|
38
|
-
testId =
|
|
15
|
+
var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function Date(_ref2, _ref) {
|
|
16
|
+
var day = _ref2.children,
|
|
17
|
+
_ref2$isDisabled = _ref2.isDisabled,
|
|
18
|
+
isDisabled = _ref2$isDisabled === void 0 ? false : _ref2$isDisabled,
|
|
19
|
+
_ref2$isFocused = _ref2.isFocused,
|
|
20
|
+
isFocused = _ref2$isFocused === void 0 ? false : _ref2$isFocused,
|
|
21
|
+
_ref2$isToday = _ref2.isToday,
|
|
22
|
+
isToday = _ref2$isToday === void 0 ? false : _ref2$isToday,
|
|
23
|
+
dayLong = _ref2.dayLong,
|
|
24
|
+
month = _ref2.month,
|
|
25
|
+
monthLong = _ref2.monthLong,
|
|
26
|
+
_ref2$onClick = _ref2.onClick,
|
|
27
|
+
onClick = _ref2$onClick === void 0 ? _noop.default : _ref2$onClick,
|
|
28
|
+
_ref2$isPreviouslySel = _ref2.isPreviouslySelected,
|
|
29
|
+
isPreviouslySelected = _ref2$isPreviouslySel === void 0 ? false : _ref2$isPreviouslySel,
|
|
30
|
+
_ref2$isSelected = _ref2.isSelected,
|
|
31
|
+
isSelected = _ref2$isSelected === void 0 ? false : _ref2$isSelected,
|
|
32
|
+
_ref2$isSibling = _ref2.isSibling,
|
|
33
|
+
isSibling = _ref2$isSibling === void 0 ? false : _ref2$isSibling,
|
|
34
|
+
year = _ref2.year,
|
|
35
|
+
mode = _ref2.mode,
|
|
36
|
+
shouldSetFocus = _ref2.shouldSetFocus,
|
|
37
|
+
tabIndex = _ref2.tabIndex,
|
|
38
|
+
testId = _ref2.testId;
|
|
39
39
|
var dateRef = (0, _react.useRef)({
|
|
40
40
|
day: day,
|
|
41
41
|
month: month,
|
|
@@ -99,5 +99,4 @@ var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
99
99
|
Date.displayName = 'Date';
|
|
100
100
|
|
|
101
101
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
102
|
-
var _default = Date;
|
|
103
|
-
exports.default = _default;
|
|
102
|
+
var _default = exports.default = Date;
|
|
@@ -100,5 +100,4 @@ var Header = /*#__PURE__*/(0, _react.memo)(function Header(_ref) {
|
|
|
100
100
|
Header.displayName = 'Header';
|
|
101
101
|
|
|
102
102
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
103
|
-
var _default = Header;
|
|
104
|
-
exports.default = _default;
|
|
103
|
+
var _default = exports.default = Header;
|
|
@@ -20,42 +20,36 @@ var WeekDays = /*#__PURE__*/(0, _react.memo)(function WeekDays(_ref) {
|
|
|
20
20
|
shouldSetFocus = _ref.shouldSetFocus,
|
|
21
21
|
tabIndex = _ref.tabIndex,
|
|
22
22
|
testId = _ref.testId;
|
|
23
|
-
return (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0, _react2.jsx)(
|
|
28
|
-
|
|
29
|
-
testId: testId && "".concat(testId, "--
|
|
30
|
-
},
|
|
31
|
-
return (0, _react2.jsx)(
|
|
32
|
-
key:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
testId: testId
|
|
52
|
-
}, weekDay.day);
|
|
53
|
-
}));
|
|
54
|
-
}))
|
|
55
|
-
);
|
|
23
|
+
return (0, _react2.jsx)(_box.default, {
|
|
24
|
+
role: "rowgroup",
|
|
25
|
+
testId: testId && "".concat(testId, "--month")
|
|
26
|
+
}, weeks.map(function (week, i) {
|
|
27
|
+
return (0, _react2.jsx)(_weekDayGrid.default, {
|
|
28
|
+
key: i,
|
|
29
|
+
testId: testId && "".concat(testId, "--week")
|
|
30
|
+
}, week.values.map(function (weekDay) {
|
|
31
|
+
return (0, _react2.jsx)(_date.default, {
|
|
32
|
+
key: "".concat(week.id, "-").concat(weekDay.id),
|
|
33
|
+
isDisabled: weekDay.isDisabled,
|
|
34
|
+
isFocused: weekDay.isFocused,
|
|
35
|
+
isToday: weekDay.isToday,
|
|
36
|
+
dayLong: weekDay.weekDayName,
|
|
37
|
+
month: weekDay.month,
|
|
38
|
+
monthLong: monthsLong[weekDay.month - 1],
|
|
39
|
+
onClick: handleClickDay,
|
|
40
|
+
isPreviouslySelected: weekDay.isPreviouslySelected,
|
|
41
|
+
isSelected: weekDay.isSelected,
|
|
42
|
+
isSibling: weekDay.isSiblingMonth,
|
|
43
|
+
year: weekDay.year,
|
|
44
|
+
mode: mode,
|
|
45
|
+
shouldSetFocus: shouldSetFocus,
|
|
46
|
+
tabIndex: tabIndex,
|
|
47
|
+
testId: testId
|
|
48
|
+
}, weekDay.day);
|
|
49
|
+
}));
|
|
50
|
+
}));
|
|
56
51
|
});
|
|
57
52
|
WeekDays.displayName = 'WeekDays';
|
|
58
53
|
|
|
59
54
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
60
|
-
var _default = WeekDays;
|
|
61
|
-
exports.default = _default;
|
|
55
|
+
var _default = exports.default = WeekDays;
|
|
@@ -46,5 +46,4 @@ var WeekHeader = /*#__PURE__*/(0, _react.memo)(function WeekHeader(_ref) {
|
|
|
46
46
|
WeekHeader.displayName = 'WeekHeader';
|
|
47
47
|
|
|
48
48
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
49
|
-
var _default = WeekHeader;
|
|
50
|
-
exports.default = _default;
|
|
49
|
+
var _default = exports.default = WeekHeader;
|
|
@@ -4,16 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.monthsPerYear = exports.daysPerWeek = exports.blankStringArray = exports.arrowKeys = void 0;
|
|
7
|
-
var arrowKeys = {
|
|
7
|
+
var arrowKeys = exports.arrowKeys = {
|
|
8
8
|
ArrowDown: 'down',
|
|
9
9
|
ArrowLeft: 'left',
|
|
10
10
|
ArrowRight: 'right',
|
|
11
11
|
ArrowUp: 'up'
|
|
12
12
|
};
|
|
13
|
-
exports.
|
|
14
|
-
var
|
|
15
|
-
exports.
|
|
16
|
-
var monthsPerYear = 12;
|
|
17
|
-
exports.monthsPerYear = monthsPerYear;
|
|
18
|
-
var blankStringArray = [];
|
|
19
|
-
exports.blankStringArray = blankStringArray;
|
|
13
|
+
var daysPerWeek = exports.daysPerWeek = 7;
|
|
14
|
+
var monthsPerYear = exports.monthsPerYear = 12;
|
|
15
|
+
var blankStringArray = exports.blankStringArray = [];
|
|
@@ -54,7 +54,7 @@ function useHandleDateChange(_ref) {
|
|
|
54
54
|
yearValue = _ref$year[0],
|
|
55
55
|
setYearValue = _ref$year[1],
|
|
56
56
|
_ref$shouldSetFocus = (0, _slicedToArray2.default)(_ref.shouldSetFocus, 2),
|
|
57
|
-
|
|
57
|
+
_shouldSetFocus = _ref$shouldSetFocus[0],
|
|
58
58
|
setShouldSetFocus = _ref$shouldSetFocus[1],
|
|
59
59
|
onChange = _ref.onChange;
|
|
60
60
|
var dateRef = (0, _react.useRef)({
|
|
@@ -30,7 +30,7 @@ var borderColorFocused = {
|
|
|
30
30
|
light: "var(--ds-border-focused, ".concat(_colors.B200, ")"),
|
|
31
31
|
dark: "var(--ds-border-focused, ".concat(_colors.B100, ")")
|
|
32
32
|
};
|
|
33
|
-
var dateCellStyles = function dateCellStyles() {
|
|
33
|
+
var dateCellStyles = exports.dateCellStyles = function dateCellStyles() {
|
|
34
34
|
var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
|
|
35
35
|
return {
|
|
36
36
|
all: 'unset',
|
|
@@ -100,5 +100,4 @@ var dateCellStyles = function dateCellStyles() {
|
|
|
100
100
|
color: "var(--ds-text-disabled, ".concat(_colors.N40, ")")
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
};
|
|
104
|
-
exports.dateCellStyles = dateCellStyles;
|
|
103
|
+
};
|
package/dist/es2019/calendar.js
CHANGED
|
@@ -25,7 +25,7 @@ const boxStyles = xcss({
|
|
|
25
25
|
const analyticsAttributes = {
|
|
26
26
|
componentName: 'calendar',
|
|
27
27
|
packageName: "@atlaskit/calendar",
|
|
28
|
-
packageVersion: "13.3.
|
|
28
|
+
packageVersion: "13.3.3"
|
|
29
29
|
};
|
|
30
30
|
const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
31
31
|
day,
|
|
@@ -162,58 +162,55 @@ const CalendarWithMode = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
162
162
|
return `${monthsLong[previousMonth]} ${showPreviousYear ? yearValue - 1 : yearValue}`;
|
|
163
163
|
};
|
|
164
164
|
const headerId = useUniqueId('month-year-header');
|
|
165
|
-
return (
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
testId: testId
|
|
215
|
-
})))))
|
|
216
|
-
);
|
|
165
|
+
return jsx("div", {
|
|
166
|
+
className: className,
|
|
167
|
+
style: style,
|
|
168
|
+
onBlur: handleContainerBlur,
|
|
169
|
+
onFocus: handleContainerFocus,
|
|
170
|
+
"data-testid": testId && `${testId}--container`,
|
|
171
|
+
ref: ref
|
|
172
|
+
}, jsx(Box, {
|
|
173
|
+
xcss: boxStyles,
|
|
174
|
+
padding: "space.200",
|
|
175
|
+
"aria-label": "calendar",
|
|
176
|
+
testId: testId && `${testId}--calendar`
|
|
177
|
+
}, jsx(Stack, {
|
|
178
|
+
space: "space.150"
|
|
179
|
+
}, jsx(Header
|
|
180
|
+
// The month number needs to be translated to index in the month
|
|
181
|
+
// name array e.g. 1 (January) -> 0
|
|
182
|
+
, {
|
|
183
|
+
monthLongTitle: monthsLong[monthValue - 1],
|
|
184
|
+
year: yearValue,
|
|
185
|
+
nextMonthLabel: nextMonthLabel,
|
|
186
|
+
previousMonthLabel: previousMonthLabel,
|
|
187
|
+
nextHeading: getNextHeading(),
|
|
188
|
+
previousHeading: getPreviousHeading(),
|
|
189
|
+
handleClickNext: handleClickNext,
|
|
190
|
+
handleClickPrev: handleClickPrev,
|
|
191
|
+
headerId: headerId,
|
|
192
|
+
mode: mode,
|
|
193
|
+
tabIndex: tabIndex,
|
|
194
|
+
testId: testId
|
|
195
|
+
}), jsx(Box, {
|
|
196
|
+
role: "grid",
|
|
197
|
+
tabIndex: tabIndex,
|
|
198
|
+
onKeyDown: handleContainerKeyDown,
|
|
199
|
+
"aria-labelledby": headerId,
|
|
200
|
+
testId: testId && `${testId}--calendar-dates`
|
|
201
|
+
}, jsx(WeekHeaderComponent, {
|
|
202
|
+
daysShort: daysShort,
|
|
203
|
+
mode: mode,
|
|
204
|
+
testId: testId
|
|
205
|
+
}), jsx(WeekDaysComponent, {
|
|
206
|
+
weeks: weeks,
|
|
207
|
+
handleClickDay: handleClickDay,
|
|
208
|
+
mode: mode,
|
|
209
|
+
monthsLong: monthsLong,
|
|
210
|
+
shouldSetFocus: shouldSetFocus,
|
|
211
|
+
tabIndex: tabIndex,
|
|
212
|
+
testId: testId
|
|
213
|
+
})))));
|
|
217
214
|
});
|
|
218
215
|
|
|
219
216
|
/**
|
|
@@ -13,35 +13,30 @@ const WeekDays = /*#__PURE__*/memo(function WeekDays({
|
|
|
13
13
|
tabIndex,
|
|
14
14
|
testId
|
|
15
15
|
}) {
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
shouldSetFocus: shouldSetFocus,
|
|
41
|
-
tabIndex: tabIndex,
|
|
42
|
-
testId: testId
|
|
43
|
-
}, weekDay.day)))))
|
|
44
|
-
);
|
|
16
|
+
return jsx(Box, {
|
|
17
|
+
role: "rowgroup",
|
|
18
|
+
testId: testId && `${testId}--month`
|
|
19
|
+
}, weeks.map((week, i) => jsx(WeekdayGrid, {
|
|
20
|
+
key: i,
|
|
21
|
+
testId: testId && `${testId}--week`
|
|
22
|
+
}, week.values.map(weekDay => jsx(DateComponent, {
|
|
23
|
+
key: `${week.id}-${weekDay.id}`,
|
|
24
|
+
isDisabled: weekDay.isDisabled,
|
|
25
|
+
isFocused: weekDay.isFocused,
|
|
26
|
+
isToday: weekDay.isToday,
|
|
27
|
+
dayLong: weekDay.weekDayName,
|
|
28
|
+
month: weekDay.month,
|
|
29
|
+
monthLong: monthsLong[weekDay.month - 1],
|
|
30
|
+
onClick: handleClickDay,
|
|
31
|
+
isPreviouslySelected: weekDay.isPreviouslySelected,
|
|
32
|
+
isSelected: weekDay.isSelected,
|
|
33
|
+
isSibling: weekDay.isSiblingMonth,
|
|
34
|
+
year: weekDay.year,
|
|
35
|
+
mode: mode,
|
|
36
|
+
shouldSetFocus: shouldSetFocus,
|
|
37
|
+
tabIndex: tabIndex,
|
|
38
|
+
testId: testId
|
|
39
|
+
}, weekDay.day)))));
|
|
45
40
|
});
|
|
46
41
|
WeekDays.displayName = 'WeekDays';
|
|
47
42
|
|
|
@@ -36,7 +36,7 @@ export default function useHandleDateChange({
|
|
|
36
36
|
day: [dayValue, setDayValue],
|
|
37
37
|
month: [monthValue, setMonthValue],
|
|
38
38
|
year: [yearValue, setYearValue],
|
|
39
|
-
shouldSetFocus: [
|
|
39
|
+
shouldSetFocus: [_shouldSetFocus, setShouldSetFocus],
|
|
40
40
|
onChange
|
|
41
41
|
}) {
|
|
42
42
|
const dateRef = useRef({
|