forked from jquense/react-big-calendar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(time-grid): allow consumer to set allDayMaxRows (jquense#2386)
* Add support for displaying Show more text in TimeGrid views via allDayMaxRows prop. * Prevent Background cells from capturing click on show more button.
- Loading branch information
Arturo Fornes
committed
Jun 2, 2023
1 parent
0b27f58
commit 1805b74
Showing
10 changed files
with
128 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Canvas, Story } from '@storybook/addon-docs' | ||
|
||
# allDayMaxRows | ||
|
||
- type: `number` | ||
- default: `Infinity` | ||
|
||
Determines a maximum amount of rows of events to display in the all day section for Week and Day views, will display `showMore` button if events excede this number. | ||
|
||
<Story id="props--all-day-max-rows" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react' | ||
import moment from 'moment' | ||
import { Calendar, Views, momentLocalizer } from '../../src' | ||
import allDayEvents from '../resources/allDayEvents' | ||
import mdx from './allDayMaxRows.mdx' | ||
|
||
const mLocalizer = momentLocalizer(moment) | ||
|
||
export default { | ||
title: 'props', | ||
component: Calendar, | ||
argTypes: { | ||
localizer: { control: { type: null } }, | ||
events: { control: { type: null } }, | ||
defaultDate: { control: { type: null } }, | ||
}, | ||
parameters: { | ||
docs: { | ||
page: mdx, | ||
}, | ||
}, | ||
} | ||
|
||
const Template = (args) => ( | ||
<div className="height600"> | ||
<Calendar {...args} /> | ||
</div> | ||
) | ||
|
||
export const AllDayMaxRows = Template.bind({}) | ||
AllDayMaxRows.storyName = 'allDayMaxRows' | ||
AllDayMaxRows.args = { | ||
defaultDate: new Date(2015, 3, 1), | ||
defaultView: Views.WEEK, | ||
events: allDayEvents, | ||
localizer: mLocalizer, | ||
allDayMaxRows: 2, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export default [ | ||
{ | ||
id: 0, | ||
title: 'All Day Event very long title', | ||
allDay: true, | ||
start: new Date(2015, 3, 0), | ||
end: new Date(2015, 3, 1), | ||
}, | ||
{ | ||
id: 1, | ||
title: '#2 All Day Event very long title', | ||
allDay: true, | ||
start: new Date(2015, 3, 0), | ||
end: new Date(2015, 3, 2), | ||
}, | ||
{ | ||
id: 2, | ||
title: '#3 All Day Event very long title', | ||
allDay: true, | ||
start: new Date(2015, 3, 0), | ||
end: new Date(2015, 3, 1), | ||
}, | ||
] |