react-day-picker 8.1.3 → 8.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -19
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/DayContent/DayContent.d.ts +1 -3
- package/dist/components/Dropdown/Dropdown.d.ts +4 -0
- package/dist/components/Head/Head.d.ts +1 -3
- package/dist/components/HeadRow/HeadRow.d.ts +4 -0
- package/dist/components/HeadRow/index.d.ts +1 -0
- package/dist/components/{Head → HeadRow}/utils/getWeekdays.d.ts +0 -0
- package/dist/components/{Head → HeadRow}/utils/index.d.ts +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +34 -26
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +34 -25
- package/dist/index.js.map +1 -1
- package/dist/react-day-picker.min.js +1 -1
- package/dist/style.css +14 -7
- package/dist/style.module.css +19 -12
- package/dist/style.module.css.d.ts +34 -34
- package/dist/types/DayPickerBase.d.ts +2 -0
- package/dist/types/Matchers.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Day/Day.test.tsx +2 -1
- package/src/components/Day/Day.tsx +1 -1
- package/src/components/DayContent/DayContent.test.tsx +1 -13
- package/src/components/DayContent/DayContent.tsx +2 -14
- package/src/components/Dropdown/Dropdown.test.tsx +1 -0
- package/src/components/Dropdown/Dropdown.tsx +5 -0
- package/src/components/Head/Head.test.tsx +13 -63
- package/src/components/Head/Head.tsx +5 -41
- package/src/components/HeadRow/HeadRow.test.tsx +109 -0
- package/src/components/HeadRow/HeadRow.tsx +49 -0
- package/src/components/HeadRow/index.ts +1 -0
- package/src/components/{Head → HeadRow}/utils/getWeekdays.test.ts +0 -0
- package/src/components/{Head → HeadRow}/utils/getWeekdays.ts +0 -0
- package/src/components/{Head → HeadRow}/utils/index.ts +0 -0
- package/src/components/MonthsDropdown/MonthsDropdown.test.tsx +11 -1
- package/src/components/MonthsDropdown/MonthsDropdown.tsx +1 -0
- package/src/components/MonthsDropdown/__snapshots__/MonthsDropdown.test.tsx.snap +48 -0
- package/src/components/Navigation/Navigation.test.tsx +6 -0
- package/src/components/Navigation/Navigation.tsx +2 -0
- package/src/components/Table/Table.test.tsx +2 -2
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +122 -586
- package/src/components/WeekNumber/WeekNumber.test.tsx +9 -2
- package/src/components/WeekNumber/WeekNumber.tsx +1 -0
- package/src/components/WeekNumber/__snapshots__/WeekNumber.test.tsx.snap +10 -1
- package/src/components/YearsDropdown/YearsDropdown.test.tsx +11 -1
- package/src/components/YearsDropdown/YearsDropdown.tsx +1 -0
- package/src/components/YearsDropdown/__snapshots__/YearsDropdown.test.tsx.snap +43 -0
- package/src/hooks/useDayRender/useDayRender.tsx +6 -2
- package/src/hooks/useInput/useInput.ts +2 -2
- package/src/index.ts +1 -0
- package/src/style.css +14 -7
- package/src/types/DayPickerBase.ts +2 -0
- package/src/types/Matchers.ts +1 -1
|
@@ -5,18 +5,11 @@ import { DayPickerProps } from 'DayPicker';
|
|
|
5
5
|
|
|
6
6
|
import { customRender } from 'test/render';
|
|
7
7
|
|
|
8
|
-
import { defaultClassNames } from 'contexts/DayPicker/defaultClassNames';
|
|
9
|
-
import { formatWeekdayName } from 'contexts/DayPicker/formatters';
|
|
10
|
-
import { labelWeekday } from 'contexts/DayPicker/labels';
|
|
11
|
-
|
|
12
8
|
import { Head } from './Head';
|
|
13
|
-
import { getWeekdays } from './utils/getWeekdays';
|
|
14
9
|
|
|
15
10
|
let container: HTMLElement;
|
|
16
11
|
let view: RenderResult;
|
|
17
12
|
|
|
18
|
-
let thElements: HTMLTableCellElement[];
|
|
19
|
-
|
|
20
13
|
function setup(dayPickerProps: DayPickerProps = {}) {
|
|
21
14
|
view = customRender(
|
|
22
15
|
<table>
|
|
@@ -25,7 +18,6 @@ function setup(dayPickerProps: DayPickerProps = {}) {
|
|
|
25
18
|
dayPickerProps
|
|
26
19
|
);
|
|
27
20
|
container = view.container.firstChild as HTMLTableCellElement;
|
|
28
|
-
thElements = Array.from(container.getElementsByTagName('th'));
|
|
29
21
|
}
|
|
30
22
|
|
|
31
23
|
const dayPickerProps = {
|
|
@@ -53,65 +45,23 @@ describe('when rendered', () => {
|
|
|
53
45
|
test('thead should have the `head` class', () => {
|
|
54
46
|
expect(container.firstChild).toHaveClass(dayPickerProps.classNames.head);
|
|
55
47
|
});
|
|
56
|
-
|
|
57
|
-
test('tr element should have the `head_row` style', () => {
|
|
58
|
-
expect(container.firstChild?.firstChild).toHaveStyle(
|
|
59
|
-
dayPickerProps.styles.head_row
|
|
60
|
-
);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
test('tr element should have the `head_row` class', () => {
|
|
64
|
-
expect(container.firstChild?.firstChild).toHaveClass(
|
|
65
|
-
dayPickerProps.classNames.head_row
|
|
66
|
-
);
|
|
67
|
-
});
|
|
68
|
-
test('should render 7 head elements', () => {
|
|
69
|
-
expect(thElements).toHaveLength(7);
|
|
70
|
-
});
|
|
71
|
-
test('should render the head elements with the "head_cell" class name', () => {
|
|
72
|
-
thElements.forEach((el) => {
|
|
73
|
-
expect(el).toHaveClass(dayPickerProps.classNames.head_cell);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
test('the formatted weekday name should be ARIA-hidden', () => {
|
|
77
|
-
const weekdays = getWeekdays();
|
|
78
|
-
weekdays.forEach((weekday) => {
|
|
79
|
-
const text = formatWeekdayName(weekday);
|
|
80
|
-
expect(screen.getByText(text)).toHaveAttribute('aria-hidden', 'true');
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
test('the label should not be visible', () => {
|
|
84
|
-
const weekdays = getWeekdays();
|
|
85
|
-
weekdays.forEach((weekday) => {
|
|
86
|
-
const text = labelWeekday(weekday);
|
|
87
|
-
expect(screen.getByText(text)).toHaveClass(defaultClassNames.vhidden);
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
48
|
});
|
|
91
49
|
|
|
92
|
-
describe('when
|
|
50
|
+
describe('when using a custom HeadRow component', () => {
|
|
93
51
|
beforeEach(() => {
|
|
94
|
-
setup({
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
thElements.forEach((el) => {
|
|
104
|
-
expect(el).toHaveClass(dayPickerProps.classNames.head_cell);
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
test('should render the head elements with the "head_cell" style', () => {
|
|
108
|
-
thElements.forEach((el) => {
|
|
109
|
-
expect(el).toHaveStyle(dayPickerProps.styles.head_cell);
|
|
52
|
+
setup({
|
|
53
|
+
...dayPickerProps,
|
|
54
|
+
components: {
|
|
55
|
+
HeadRow: () => (
|
|
56
|
+
<tr>
|
|
57
|
+
<td>custom head</td>
|
|
58
|
+
</tr>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
110
61
|
});
|
|
111
62
|
});
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
});
|
|
63
|
+
|
|
64
|
+
test('should render the custom component', () => {
|
|
65
|
+
expect(screen.getByText('custom head')).toBeInTheDocument();
|
|
116
66
|
});
|
|
117
67
|
});
|
|
@@ -1,51 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
+
import { HeadRow } from 'components/HeadRow';
|
|
3
4
|
import { useDayPicker } from 'contexts/DayPicker';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Render the Head component - i.e. the table head with the weekday names.
|
|
9
|
-
*/
|
|
6
|
+
/** Render the table head. */
|
|
10
7
|
export function Head(): JSX.Element {
|
|
11
|
-
const {
|
|
12
|
-
|
|
13
|
-
styles,
|
|
14
|
-
showWeekNumber,
|
|
15
|
-
locale,
|
|
16
|
-
weekStartsOn,
|
|
17
|
-
formatters: { formatWeekdayName },
|
|
18
|
-
labels: { labelWeekday }
|
|
19
|
-
} = useDayPicker();
|
|
20
|
-
|
|
21
|
-
const weekdays = getWeekdays(locale, weekStartsOn);
|
|
22
|
-
|
|
8
|
+
const { classNames, styles, components } = useDayPicker();
|
|
9
|
+
const HeadRowComponent = components?.HeadRow ?? HeadRow;
|
|
23
10
|
return (
|
|
24
11
|
<thead style={styles.head} className={classNames.head}>
|
|
25
|
-
<
|
|
26
|
-
{showWeekNumber && (
|
|
27
|
-
<th
|
|
28
|
-
scope="col"
|
|
29
|
-
style={styles.head_cell}
|
|
30
|
-
className={classNames.head_cell}
|
|
31
|
-
></th>
|
|
32
|
-
)}
|
|
33
|
-
{weekdays.map((weekday, i) => (
|
|
34
|
-
<th
|
|
35
|
-
key={i}
|
|
36
|
-
scope="col"
|
|
37
|
-
className={classNames.head_cell}
|
|
38
|
-
style={styles.head_cell}
|
|
39
|
-
>
|
|
40
|
-
<span aria-hidden={true}>
|
|
41
|
-
{formatWeekdayName(weekday, { locale })}
|
|
42
|
-
</span>
|
|
43
|
-
<span className={classNames.vhidden}>
|
|
44
|
-
{labelWeekday(weekday, { locale })}
|
|
45
|
-
</span>
|
|
46
|
-
</th>
|
|
47
|
-
))}
|
|
48
|
-
</tr>
|
|
12
|
+
<HeadRowComponent />
|
|
49
13
|
</thead>
|
|
50
14
|
);
|
|
51
15
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { RenderResult, screen } from '@testing-library/react';
|
|
4
|
+
import { DayPickerProps } from 'DayPicker';
|
|
5
|
+
|
|
6
|
+
import { customRender } from 'test/render';
|
|
7
|
+
|
|
8
|
+
import { defaultClassNames } from 'contexts/DayPicker/defaultClassNames';
|
|
9
|
+
import { formatWeekdayName } from 'contexts/DayPicker/formatters';
|
|
10
|
+
import { labelWeekday } from 'contexts/DayPicker/labels';
|
|
11
|
+
|
|
12
|
+
import { HeadRow } from './HeadRow';
|
|
13
|
+
import { getWeekdays } from './utils/getWeekdays';
|
|
14
|
+
|
|
15
|
+
let container: HTMLElement;
|
|
16
|
+
let view: RenderResult;
|
|
17
|
+
|
|
18
|
+
let thElements: HTMLTableCellElement[];
|
|
19
|
+
|
|
20
|
+
function setup(dayPickerProps: DayPickerProps = {}) {
|
|
21
|
+
view = customRender(
|
|
22
|
+
<table>
|
|
23
|
+
<thead>
|
|
24
|
+
<HeadRow />
|
|
25
|
+
</thead>
|
|
26
|
+
</table>,
|
|
27
|
+
dayPickerProps
|
|
28
|
+
);
|
|
29
|
+
container = view.container.firstChild?.firstChild as HTMLTableRowElement;
|
|
30
|
+
thElements = Array.from(container.getElementsByTagName('th'));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const dayPickerProps = {
|
|
34
|
+
styles: {
|
|
35
|
+
head: { color: 'red' },
|
|
36
|
+
head_row: { color: 'blue' },
|
|
37
|
+
head_cell: { color: 'green' }
|
|
38
|
+
},
|
|
39
|
+
classNames: {
|
|
40
|
+
head: 'foo',
|
|
41
|
+
head_row: 'foo_row',
|
|
42
|
+
head_cell: 'foo_head-cell'
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
describe('when rendered', () => {
|
|
47
|
+
beforeEach(() => {
|
|
48
|
+
setup(dayPickerProps);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test('tr element should have the `head_row` style', () => {
|
|
52
|
+
expect(container.firstChild).toHaveStyle(dayPickerProps.styles.head_row);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('tr element should have the `head_row` class', () => {
|
|
56
|
+
expect(container.firstChild).toHaveClass(
|
|
57
|
+
dayPickerProps.classNames.head_row
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
test('should render 7 head elements', () => {
|
|
61
|
+
expect(thElements).toHaveLength(7);
|
|
62
|
+
});
|
|
63
|
+
test('should render the head elements with the "head_cell" class name', () => {
|
|
64
|
+
thElements.forEach((el) => {
|
|
65
|
+
expect(el).toHaveClass(dayPickerProps.classNames.head_cell);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
test('the formatted weekday name should be ARIA-hidden', () => {
|
|
69
|
+
const weekdays = getWeekdays();
|
|
70
|
+
weekdays.forEach((weekday) => {
|
|
71
|
+
const text = formatWeekdayName(weekday);
|
|
72
|
+
expect(screen.getByText(text)).toHaveAttribute('aria-hidden', 'true');
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
test('the label should not be visible', () => {
|
|
76
|
+
const weekdays = getWeekdays();
|
|
77
|
+
weekdays.forEach((weekday) => {
|
|
78
|
+
const text = labelWeekday(weekday);
|
|
79
|
+
expect(screen.getByText(text)).toHaveClass(defaultClassNames.vhidden);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
describe('when showing the week numbers', () => {
|
|
85
|
+
beforeEach(() => {
|
|
86
|
+
setup({ ...dayPickerProps, showWeekNumber: true });
|
|
87
|
+
});
|
|
88
|
+
test('should render 8 head elements', () => {
|
|
89
|
+
expect(thElements).toHaveLength(8);
|
|
90
|
+
});
|
|
91
|
+
test('the first head element should be empty', () => {
|
|
92
|
+
expect(thElements[0]).toHaveTextContent('');
|
|
93
|
+
});
|
|
94
|
+
test('should render the head elements with the "head_cell" class name', () => {
|
|
95
|
+
thElements.forEach((el) => {
|
|
96
|
+
expect(el).toHaveClass(dayPickerProps.classNames.head_cell);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
test('should render the head elements with the "head_cell" style', () => {
|
|
100
|
+
thElements.forEach((el) => {
|
|
101
|
+
expect(el).toHaveStyle(dayPickerProps.styles.head_cell);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
test('should render the head elements with the "col" scope', () => {
|
|
105
|
+
thElements.forEach((el) => {
|
|
106
|
+
expect(el).toHaveAttribute('scope', 'col');
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useDayPicker } from 'contexts/DayPicker';
|
|
4
|
+
|
|
5
|
+
import { getWeekdays } from './utils';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Render the HeadRow component - i.e. the table head row with the weekday names.
|
|
9
|
+
*/
|
|
10
|
+
export function HeadRow(): JSX.Element {
|
|
11
|
+
const {
|
|
12
|
+
classNames,
|
|
13
|
+
styles,
|
|
14
|
+
showWeekNumber,
|
|
15
|
+
locale,
|
|
16
|
+
weekStartsOn,
|
|
17
|
+
formatters: { formatWeekdayName },
|
|
18
|
+
labels: { labelWeekday }
|
|
19
|
+
} = useDayPicker();
|
|
20
|
+
|
|
21
|
+
const weekdays = getWeekdays(locale, weekStartsOn);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<tr style={styles.head_row} className={classNames.head_row}>
|
|
25
|
+
{showWeekNumber && (
|
|
26
|
+
<th
|
|
27
|
+
scope="col"
|
|
28
|
+
style={styles.head_cell}
|
|
29
|
+
className={classNames.head_cell}
|
|
30
|
+
></th>
|
|
31
|
+
)}
|
|
32
|
+
{weekdays.map((weekday, i) => (
|
|
33
|
+
<th
|
|
34
|
+
key={i}
|
|
35
|
+
scope="col"
|
|
36
|
+
className={classNames.head_cell}
|
|
37
|
+
style={styles.head_cell}
|
|
38
|
+
>
|
|
39
|
+
<span aria-hidden={true}>
|
|
40
|
+
{formatWeekdayName(weekday, { locale })}
|
|
41
|
+
</span>
|
|
42
|
+
<span className={classNames.vhidden}>
|
|
43
|
+
{labelWeekday(weekday, { locale })}
|
|
44
|
+
</span>
|
|
45
|
+
</th>
|
|
46
|
+
))}
|
|
47
|
+
</tr>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './HeadRow';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { screen } from '@testing-library/react';
|
|
4
4
|
import userEvent from '@testing-library/user-event';
|
|
5
|
-
import { differenceInMonths } from 'date-fns';
|
|
5
|
+
import { addMonths, differenceInMonths } from 'date-fns';
|
|
6
6
|
import { DayPickerProps } from 'DayPicker';
|
|
7
7
|
|
|
8
8
|
import { customRender } from 'test/render';
|
|
@@ -30,6 +30,16 @@ const props: MonthsDropdownProps = {
|
|
|
30
30
|
onChange: jest.fn()
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
describe('when fromDate and toDate are passed in', () => {
|
|
34
|
+
beforeEach(() => {
|
|
35
|
+
setup(props, { fromDate: new Date(), toDate: addMonths(new Date(), 1) });
|
|
36
|
+
});
|
|
37
|
+
test('should render the dropdown element', () => {
|
|
38
|
+
expect(root).toMatchSnapshot();
|
|
39
|
+
expect(select).toHaveAttribute('name', 'months');
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
33
43
|
describe('when "fromDate" is not set', () => {
|
|
34
44
|
beforeEach(() => {
|
|
35
45
|
setup(props, { fromDate: undefined });
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`when fromDate and toDate are passed in should render the dropdown element 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
class="rdp-dropdown_month"
|
|
6
|
+
>
|
|
7
|
+
<span
|
|
8
|
+
class="rdp-vhidden"
|
|
9
|
+
>
|
|
10
|
+
Month:
|
|
11
|
+
</span>
|
|
12
|
+
<select
|
|
13
|
+
aria-label="Month: "
|
|
14
|
+
class="rdp-dropdown"
|
|
15
|
+
name="months"
|
|
16
|
+
>
|
|
17
|
+
<option
|
|
18
|
+
value="0"
|
|
19
|
+
>
|
|
20
|
+
January
|
|
21
|
+
</option>
|
|
22
|
+
<option
|
|
23
|
+
value="1"
|
|
24
|
+
>
|
|
25
|
+
February
|
|
26
|
+
</option>
|
|
27
|
+
</select>
|
|
28
|
+
<div
|
|
29
|
+
aria-hidden="true"
|
|
30
|
+
class="rdp-caption_label"
|
|
31
|
+
>
|
|
32
|
+
January
|
|
33
|
+
<svg
|
|
34
|
+
class="rdp-dropdown_icon"
|
|
35
|
+
data-testid="iconDropdown"
|
|
36
|
+
height="8px"
|
|
37
|
+
viewBox="0 0 120 120"
|
|
38
|
+
width="8px"
|
|
39
|
+
>
|
|
40
|
+
<path
|
|
41
|
+
d="M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z"
|
|
42
|
+
fill="currentColor"
|
|
43
|
+
fill-rule="nonzero"
|
|
44
|
+
/>
|
|
45
|
+
</svg>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
`;
|
|
@@ -56,6 +56,12 @@ describe('when rendered', () => {
|
|
|
56
56
|
const icons = root.getElementsByTagName('svg');
|
|
57
57
|
expect(icons[1]).toHaveTextContent('IconRight');
|
|
58
58
|
});
|
|
59
|
+
test('the previous button should be named "previous-month"', () => {
|
|
60
|
+
expect(getPrevButton()).toHaveAttribute('name', 'previous-month');
|
|
61
|
+
});
|
|
62
|
+
test('the next button should be named "next-month"', () => {
|
|
63
|
+
expect(getNextButton()).toHaveAttribute('name', 'next-month');
|
|
64
|
+
});
|
|
59
65
|
beforeEach(() => {
|
|
60
66
|
userEvent.click(getPrevButton());
|
|
61
67
|
});
|
|
@@ -57,6 +57,7 @@ export function Navigation(props: NavigationProps): JSX.Element {
|
|
|
57
57
|
<div className={classNames.nav} style={styles.nav}>
|
|
58
58
|
{!props.hidePrevious && (
|
|
59
59
|
<Button
|
|
60
|
+
name="previous-month"
|
|
60
61
|
aria-label={previousLabel}
|
|
61
62
|
className={previousClassName}
|
|
62
63
|
style={styles.nav_button_previous}
|
|
@@ -78,6 +79,7 @@ export function Navigation(props: NavigationProps): JSX.Element {
|
|
|
78
79
|
)}
|
|
79
80
|
{!props.hideNext && (
|
|
80
81
|
<Button
|
|
82
|
+
name="next-month"
|
|
81
83
|
aria-label={nextLabel}
|
|
82
84
|
className={nextClassName}
|
|
83
85
|
style={styles.nav_button_next}
|
|
@@ -30,8 +30,8 @@ describe('when showing the week numbers', () => {
|
|
|
30
30
|
describe('when using custom components', () => {
|
|
31
31
|
const dayPickerProps: DayPickerProps = {
|
|
32
32
|
components: {
|
|
33
|
-
Head: () => <div>CustomHead
|
|
34
|
-
Row: () => <div>CustomRow
|
|
33
|
+
Head: () => <div>CustomHead</div>,
|
|
34
|
+
Row: () => <div>CustomRow</div>,
|
|
35
35
|
Footer: () => <div>CustomFooter</div>
|
|
36
36
|
}
|
|
37
37
|
};
|