Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: provide named exports api #1348

Merged
merged 1 commit into from
Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"./dist/react-big-calendar.js": {
"bundled": 553987,
"minified": 170205,
"gzipped": 50025
"bundled": 554087,
"minified": 170209,
"gzipped": 49950
},
"./dist/react-big-calendar.min.js": {
"bundled": 490228,
"minified": 150810,
"gzipped": 45487
"bundled": 490328,
"minified": 150824,
"gzipped": 45415
},
"dist/react-big-calendar.esm.js": {
"bundled": 169712,
"minified": 81562,
"gzipped": 20075,
"bundled": 169648,
"minified": 81524,
"gzipped": 20082,
"treeshaked": {
"rollup": {
"code": 62970,
"code": 59035,
"import_statements": 1402
},
"webpack": {
"code": 66409
"code": 62470
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ Regardless of your choice, you **must** choose a localizer to use this library:
#### Moment.js

```js
import BigCalendar from 'react-big-calendar'
import { Calendar, momentLocalizer } from 'react-big-calendar'
import moment from 'moment'

const localizer = BigCalendar.momentLocalizer(moment)
const localizer = momentLocalizer(moment)

const MyCalendar = props => (
<div>
<BigCalendar
<Calendar
localizer={localizer}
events={myEventsList}
startAccessor="start"
Expand All @@ -59,14 +59,14 @@ const MyCalendar = props => (
#### Globalize.js v0.1.1

```js
import BigCalendar from 'react-big-calendar'
import { Calendar, globalizeLocalizer } from 'react-big-calendar'
import globalize from 'globalize'

const localizer = BigCalendar.globalizeLocalizer(globalize)
const localizer = globalizeLocalizer(globalize)

const MyCalendar = props => (
<div>
<BigCalendar
<Calendar
localizer={localizer}
events={myEventsList}
startAccessor="start"
Expand Down
31 changes: 11 additions & 20 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
import Calendar from './Calendar'
import EventWrapper from './EventWrapper'
import BackgroundWrapper from './BackgroundWrapper'
import { DateLocalizer } from './localizer'
import momentLocalizer from './localizers/moment'
import globalizeLocalizer from './localizers/globalize'
import move from './utils/move'
import { views, navigate } from './utils/constants'

Object.assign(Calendar, {
DateLocalizer,
globalizeLocalizer,
momentLocalizer,
Views: views,
Navigate: navigate,
move,
components: {
eventWrapper: EventWrapper,
timeSlotWrapper: BackgroundWrapper,
dateCellWrapper: BackgroundWrapper,
},
})
export const components = {
eventWrapper: EventWrapper,
timeSlotWrapper: BackgroundWrapper,
dateCellWrapper: BackgroundWrapper,
}

export default Calendar
export { default as Calendar } from './Calendar'
export { DateLocalizer } from './localizer'
export { default as momentLocalizer } from './localizers/moment'
export { default as globalizeLocalizer } from './localizers/globalize'
export { default as move } from './utils/move'
export { views as Views, navigate as Navigate } from './utils/constants'