Releases: knightburton/react-interval-calendar
v3.1.0
You can now override each and every slotProps type. With this you can pass custom properties into each slotProps with a simple module augmentation.
This will allow you to have custom properties that is available both on slotProps definition and component prop as well.
Most of the component props are available to override.
Look for exported interfaces with the name of the component that you want to augment and Overrides suffix.
Define your custom types like the following:
declare module '@knightburton/react-interval-calendar' {
interface ContainerPropsOverrides {
something?: boolean;
}
}
// In your component, you can define the value like the this
<IntervalCalendar
weekStartsOn={1}
start={new Date(2021, 1, 1)}
end={new Date(2021, 6, 31)}
slotProps={{ root: { something: true } }}
/>
// Also, this will be available on component props as well
const Root = ({ children, something }: ContainerProps): JSX.Element => <></>;The list of overridable component props:
ContainerPropsOverrides, HeaderPropsOverrides, HeaderCellPropsOverrides, HeaderCellContentPropsOverrides, BodyPropsOverrides, BodyRowPropsOverrides, BodyCellPropsOverrides, BodyCellContentPropsOverrides and EmptyPropsOverrides
v3.0.1
2023-10-16
FIXES
- Change the
BodyCellcomponentonClickproperty from mandatory tooptional
v3.0.0
2023-10-16
BREAKING CHANGES
- The component props moved into the
slotsprop - The className props moved into the
slotPropsprop alongside with the component other props
(all the usual HTML Element props are available now) - The
heightprop moved into theslotProps.rootpropstyleprop - The
showHeaderprop moved into theslotProps.headerprop asenabled - The
emptyLabelprop moved into theslotProps.emptyprop aslabel - The
onCellClickprop moved into theslotProps.bodyCellprop asonClickand the arguments list changed to
(event: React.MouseEvent<HTMLLIElement>, data: BodyCellData) => void
For further details check the Prop-Types and the Migration Guides.
v2.1.0
New Feature
The Calendar now can start render the weeks on the current (the browser Date) week. All the previous week - if there any - will be skipped for the initial render. To enable this feature, just pass startRenderOnCurrentWeek prop to the Calendar.
v2.0.1
Fix: Resolve the BodyCell onClick handler auto call on render.
v2.0.0
BREAKING CHANGE
The Interval Calendar implementation has completely changed.
Now it is much more close to a headless solution.
We dropped the theme solution and all the highlight related markings.
Now it gives the possibility to replace a lot of internal component with custom ones, alongside with the simplified classnames.
For the full prop changes please check the README.md file.
v1.0.2
Fix the getTimestamp date util param check.
v1.0.1
1.0.1
v1.0.0
Update the example application