@isma91/react-scheduler 4.0.0
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/.github/workflows/publish.yml +29 -0
- package/.github/workflows/tests.yml +35 -0
- package/.gitignore +32 -0
- package/.husky/pre-commit +2 -0
- package/.prettierignore +1 -0
- package/.prettierrc.json +7 -0
- package/.yarnrc.yml +1 -0
- package/LICENSE +24 -0
- package/README.md +172 -0
- package/dist/LICENSE +24 -0
- package/dist/README.md +172 -0
- package/dist/SchedulerComponent.d.ts +3 -0
- package/dist/components/common/Cell.d.ts +13 -0
- package/dist/components/common/LocaleArrow.d.ts +8 -0
- package/dist/components/common/ResourceHeader.d.ts +6 -0
- package/dist/components/common/Tabs.d.ts +16 -0
- package/dist/components/common/TodayTypo.d.ts +8 -0
- package/dist/components/common/WithResources.d.ts +6 -0
- package/dist/components/events/Actions.d.ts +8 -0
- package/dist/components/events/AgendaEventsList.d.ts +7 -0
- package/dist/components/events/CurrentTimeBar.d.ts +11 -0
- package/dist/components/events/EmptyAgenda.d.ts +2 -0
- package/dist/components/events/EventItem.d.ts +10 -0
- package/dist/components/events/EventItemPopover.d.ts +9 -0
- package/dist/components/events/MonthEvents.d.ts +13 -0
- package/dist/components/events/TodayEvents.d.ts +16 -0
- package/dist/components/hoc/DateProvider.d.ts +5 -0
- package/dist/components/inputs/DatePicker.d.ts +14 -0
- package/dist/components/inputs/Input.d.ts +19 -0
- package/dist/components/inputs/SelectInput.d.ts +22 -0
- package/dist/components/month/MonthTable.d.ts +8 -0
- package/dist/components/nav/DayDateBtn.d.ts +6 -0
- package/dist/components/nav/MonthDateBtn.d.ts +6 -0
- package/dist/components/nav/Navigation.d.ts +3 -0
- package/dist/components/nav/WeekDateBtn.d.ts +8 -0
- package/dist/components/week/WeekTable.d.ts +11 -0
- package/dist/helpers/constants.d.ts +4 -0
- package/dist/helpers/generals.d.ts +78 -0
- package/dist/hooks/useArrowDisable.d.ts +5 -0
- package/dist/hooks/useCellAttributes.d.ts +18 -0
- package/dist/hooks/useDragAttributes.d.ts +10 -0
- package/dist/hooks/useEventPermissions.d.ts +7 -0
- package/dist/hooks/useStore.d.ts +2 -0
- package/dist/hooks/useSyncScroll.d.ts +8 -0
- package/dist/hooks/useWindowResize.d.ts +4 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2853 -0
- package/dist/package.json +65 -0
- package/dist/positionManger/context.d.ts +14 -0
- package/dist/positionManger/provider.d.ts +5 -0
- package/dist/positionManger/usePosition.d.ts +4 -0
- package/dist/store/context.d.ts +2 -0
- package/dist/store/default.d.ts +245 -0
- package/dist/store/provider.d.ts +7 -0
- package/dist/store/types.d.ts +27 -0
- package/dist/styles/styles.d.ts +30 -0
- package/dist/types.d.ts +372 -0
- package/dist/views/Day.d.ts +2 -0
- package/dist/views/DayAgenda.d.ts +7 -0
- package/dist/views/Editor.d.ts +11 -0
- package/dist/views/Month.d.ts +2 -0
- package/dist/views/MonthAgenda.d.ts +7 -0
- package/dist/views/Week.d.ts +2 -0
- package/dist/views/WeekAgenda.d.ts +8 -0
- package/eslint.config.js +79 -0
- package/index.html +41 -0
- package/jest.config.ts +194 -0
- package/package.json +137 -0
- package/public/favicon.ico +0 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/scripts/post-pack.js +34 -0
- package/src/App.tsx +25 -0
- package/src/Page1.tsx +67 -0
- package/src/events.tsx +227 -0
- package/src/index.tsx +21 -0
- package/src/lib/SchedulerComponent.tsx +78 -0
- package/src/lib/__tests__/index.test.tsx +24 -0
- package/src/lib/components/common/Cell.tsx +52 -0
- package/src/lib/components/common/LocaleArrow.tsx +38 -0
- package/src/lib/components/common/ResourceHeader.tsx +73 -0
- package/src/lib/components/common/Tabs.tsx +119 -0
- package/src/lib/components/common/TodayTypo.tsx +44 -0
- package/src/lib/components/common/WithResources.tsx +98 -0
- package/src/lib/components/events/Actions.tsx +65 -0
- package/src/lib/components/events/AgendaEventsList.tsx +115 -0
- package/src/lib/components/events/CurrentTimeBar.tsx +59 -0
- package/src/lib/components/events/EmptyAgenda.tsx +27 -0
- package/src/lib/components/events/EventItem.tsx +180 -0
- package/src/lib/components/events/EventItemPopover.tsx +179 -0
- package/src/lib/components/events/MonthEvents.tsx +141 -0
- package/src/lib/components/events/TodayEvents.tsx +99 -0
- package/src/lib/components/hoc/DateProvider.tsx +19 -0
- package/src/lib/components/inputs/DatePicker.tsx +95 -0
- package/src/lib/components/inputs/Input.tsx +113 -0
- package/src/lib/components/inputs/SelectInput.tsx +164 -0
- package/src/lib/components/month/MonthTable.tsx +207 -0
- package/src/lib/components/nav/DayDateBtn.tsx +77 -0
- package/src/lib/components/nav/MonthDateBtn.tsx +80 -0
- package/src/lib/components/nav/Navigation.tsx +201 -0
- package/src/lib/components/nav/WeekDateBtn.tsx +89 -0
- package/src/lib/components/week/WeekTable.tsx +229 -0
- package/src/lib/helpers/constants.ts +4 -0
- package/src/lib/helpers/generals.tsx +354 -0
- package/src/lib/hooks/useArrowDisable.ts +26 -0
- package/src/lib/hooks/useCellAttributes.ts +67 -0
- package/src/lib/hooks/useDragAttributes.ts +31 -0
- package/src/lib/hooks/useEventPermissions.ts +42 -0
- package/src/lib/hooks/useStore.ts +8 -0
- package/src/lib/hooks/useSyncScroll.ts +31 -0
- package/src/lib/hooks/useWindowResize.ts +37 -0
- package/src/lib/index.tsx +14 -0
- package/src/lib/positionManger/context.ts +14 -0
- package/src/lib/positionManger/provider.tsx +113 -0
- package/src/lib/positionManger/usePosition.ts +8 -0
- package/src/lib/store/context.ts +5 -0
- package/src/lib/store/default.ts +157 -0
- package/src/lib/store/provider.tsx +211 -0
- package/src/lib/store/types.ts +33 -0
- package/src/lib/styles/styles.ts +256 -0
- package/src/lib/types.ts +423 -0
- package/src/lib/views/Day.tsx +265 -0
- package/src/lib/views/DayAgenda.tsx +57 -0
- package/src/lib/views/Editor.tsx +258 -0
- package/src/lib/views/Month.tsx +82 -0
- package/src/lib/views/MonthAgenda.tsx +84 -0
- package/src/lib/views/Week.tsx +92 -0
- package/src/lib/views/WeekAgenda.tsx +81 -0
- package/src/vite-env.d.ts +3 -0
- package/tsconfig.build.json +5 -0
- package/tsconfig.json +27 -0
- package/vite.config.js +40 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: npm publish
|
|
2
|
+
on:
|
|
3
|
+
release:
|
|
4
|
+
types: [created]
|
|
5
|
+
jobs:
|
|
6
|
+
publish:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- name: Checkout
|
|
10
|
+
uses: actions/checkout@v4
|
|
11
|
+
|
|
12
|
+
- name: Setup Node
|
|
13
|
+
uses: actions/setup-node@v4
|
|
14
|
+
with:
|
|
15
|
+
node-version: 20
|
|
16
|
+
registry-url: https://registry.npmjs.org/
|
|
17
|
+
|
|
18
|
+
- name: Install
|
|
19
|
+
run: npm install
|
|
20
|
+
|
|
21
|
+
- name: Pack
|
|
22
|
+
run: npm run build
|
|
23
|
+
|
|
24
|
+
- name: Publish
|
|
25
|
+
run: |
|
|
26
|
+
cd dist
|
|
27
|
+
npm publish
|
|
28
|
+
env:
|
|
29
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
branches: ["master"]
|
|
5
|
+
jobs:
|
|
6
|
+
Install:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
strategy:
|
|
9
|
+
matrix:
|
|
10
|
+
node-version: [20.x, 22.x]
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Create lock file
|
|
17
|
+
run: touch package-lock.json
|
|
18
|
+
|
|
19
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: ${{ matrix.node-version }}
|
|
23
|
+
cache: "npm"
|
|
24
|
+
|
|
25
|
+
- name: Install
|
|
26
|
+
run: npm install
|
|
27
|
+
|
|
28
|
+
- name: Format
|
|
29
|
+
run: npm run format:write
|
|
30
|
+
|
|
31
|
+
- name: Lint
|
|
32
|
+
run: npm run lint
|
|
33
|
+
|
|
34
|
+
- name: Test
|
|
35
|
+
run: npm run test:ci
|
package/.gitignore
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#
|
|
2
|
+
dist
|
|
3
|
+
.vscode
|
|
4
|
+
examples
|
|
5
|
+
|
|
6
|
+
#yarn
|
|
7
|
+
.yarn
|
|
8
|
+
yarn.lock
|
|
9
|
+
|
|
10
|
+
# dependencies
|
|
11
|
+
/node_modules
|
|
12
|
+
package-lock.json
|
|
13
|
+
/.pnp
|
|
14
|
+
.pnp.js
|
|
15
|
+
|
|
16
|
+
# testing
|
|
17
|
+
/coverage
|
|
18
|
+
*.tgz
|
|
19
|
+
|
|
20
|
+
# production
|
|
21
|
+
/build
|
|
22
|
+
|
|
23
|
+
# misc
|
|
24
|
+
.DS_Store
|
|
25
|
+
.env.local
|
|
26
|
+
.env.development.local
|
|
27
|
+
.env.test.local
|
|
28
|
+
.env.production.local
|
|
29
|
+
|
|
30
|
+
npm-debug.log*
|
|
31
|
+
yarn-debug.log*
|
|
32
|
+
yarn-error.log*
|
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dist
|
package/.prettierrc.json
ADDED
package/.yarnrc.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodeLinker: node-modules
|
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
This is free and unencumbered software released into the public domain.
|
|
2
|
+
|
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
4
|
+
distribute this software, either in source code form or as a compiled
|
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
|
6
|
+
means.
|
|
7
|
+
|
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
|
9
|
+
of this software dedicate any and all copyright interest in the
|
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
|
11
|
+
of the public at large and to the detriment of our heirs and
|
|
12
|
+
successors. We intend this dedication to be an overt act of
|
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
|
14
|
+
software under copyright law.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
For more information, please refer to <https://unlicense.org>
|
package/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# React Scheduler Component
|
|
2
|
+
|
|
3
|
+
> :rocket: **Fork Notice**: This is a modernized fork of [@aldabil/react-scheduler](https://github.com/aldabil21/react-scheduler) with:
|
|
4
|
+
> - React 19 support
|
|
5
|
+
> - MUI 7 / @mui/x-date-pickers 8 support
|
|
6
|
+
> - date-fns 4 support
|
|
7
|
+
> - Additional features (see changelog)
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@isma91/react-scheduler)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
> :warning: **Notice**: This component uses `mui`/`emotion`/`date-fns`. if your project is not already using these libs, this component may not be suitable.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```jsx
|
|
17
|
+
npm i @isma91/react-scheduler
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
If you plan to use `recurring` events in your scheduler, install `rrule` [package](https://www.npmjs.com/package/rrule)
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```jsx
|
|
25
|
+
import { Scheduler } from "@isma91/react-scheduler";
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Example
|
|
29
|
+
|
|
30
|
+
```jsx
|
|
31
|
+
<Scheduler
|
|
32
|
+
view="month"
|
|
33
|
+
events={[
|
|
34
|
+
{
|
|
35
|
+
event_id: 1,
|
|
36
|
+
title: "Event 1",
|
|
37
|
+
start: new Date("2021/5/2 09:30"),
|
|
38
|
+
end: new Date("2021/5/2 10:30"),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
event_id: 2,
|
|
42
|
+
title: "Event 2",
|
|
43
|
+
start: new Date("2021/5/4 10:00"),
|
|
44
|
+
end: new Date("2021/5/4 11:00"),
|
|
45
|
+
},
|
|
46
|
+
]}
|
|
47
|
+
/>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Scheduler Props
|
|
51
|
+
|
|
52
|
+
All props are _optional_
|
|
53
|
+
| Prop | Value |
|
|
54
|
+
|----------|-------------|
|
|
55
|
+
| height | number. Min height of table. <br> _Default_: 600
|
|
56
|
+
| view | string. Initial view to load. options: "week", "month", "day". <br> _Default_: "week" (if it's not null)
|
|
57
|
+
| agenda | boolean. Activate agenda view
|
|
58
|
+
| alwaysShowAgendaDays | boolean. if true, day rows without events will be shown
|
|
59
|
+
| month | Object. Month view props. <br> _default_: <pre>{<br>weekDays: [0, 1, 2, 3, 4, 5], <br>weekStartOn: 6, <br>startHour: 9, <br>endHour: 17,<br>cellRenderer?:(props: CellProps) => React.ReactNode,<br>navigation: true,<br>disableGoToDay: false<br>}</pre>
|
|
60
|
+
| week | Object. Week view props. <br> _default_: <pre>{ <br>weekDays: [0, 1, 2, 3, 4, 5], <br>weekStartOn: 6, <br>startHour: 9, <br>endHour: 17,<br>step: 60,<br>cellRenderer?:(props: CellProps) => React.ReactNode,<br>navigation: true,<br>disableGoToDay: false<br>}</pre>
|
|
61
|
+
| day | Object. Day view props. <br> _default_: <pre>{<br>startHour: 9, <br>endHour: 17, <br>step: 60,<br>cellRenderer?:(props: CellProps) => React.ReactNode,<br>hourRenderer?:(hour: string) => React.ReactNode,<br>navigation: true<br>}</pre>
|
|
62
|
+
| selectedDate | Date. Initial selected date. <br>_Default_: `new Date()`
|
|
63
|
+
| navigation | boolean. Show/Hide top bar date navigation. <br>_Default_: `true`
|
|
64
|
+
| navigationPickerProps | CalendarPickerProps for top bar date navigation. Ref [CalendarPicker API](https://mui.com/x/api/date-pickers/calendar-picker/#main-content)
|
|
65
|
+
| disableViewNavigator | boolean. Show/Hide top bar date View navigator. <br>_Default_: `false`
|
|
66
|
+
| events | Array of ProcessedEvent. <br>_Default_: [] <br> <pre>type ProcessedEvent = {<br>event*id: number or string;<br>title: string;<br>subtitle?: string;<br>start: Date;<br>end: Date;<br>disabled?: boolean;<br>recurring: RRule;<br>color?: string or "palette.path";<br>textColor?: string or "palette.path";<br>editable?: boolean;<br>deletable?: boolean;<br>draggable?: boolean;<br>allDay?: boolean;<br>agendaAvatar?: React.ReactElement \| string<br>sx?: Mui sx prop<br>} </pre>
|
|
67
|
+
| eventRenderer | Function(event:ProcessedEvent): React.ReactNode.<br> A function that overrides the event item render function, see demo \_Custom Event Renderer* below
|
|
68
|
+
| editable | boolean. If `true`, the scheduler cell click will not open the editor, and the event item will not show the edit button, this is applied to all events, and can be overridden in each event property, see `ProcessedEvent` type.
|
|
69
|
+
| deletable | boolean. Whether the event item will show the delete button, this is applied to all events, and can be overridden in each event property, see `ProcessedEvent` type.
|
|
70
|
+
| draggable | boolean. Whether activate drag&drop for the events, this is applied to all events, and can be overridden in each event property, see `ProcessedEvent` type.
|
|
71
|
+
| getRemoteEvents | Function(RemoteQuery). Return promise of array of events. Can be used as a callback to fetch events by parent component or fetch.<br><pre>type RemoteQuery = { <br> start: Date;<br> end: Date;<br> view: "day" \| "week" \| "month";<br>}</pre>
|
|
72
|
+
| fields | Array of extra fields with configurations. <br> Example: <pre> { <br> name: "description", <br> type: "input" , <br> config: { label: "Description", required: true, min: 3, email: true, variant: "outlined", ....<br>}</pre>
|
|
73
|
+
| loading | boolean. Loading state of the calendar table
|
|
74
|
+
| loadingComponent | Custom component to override the default `CircularProgress`
|
|
75
|
+
| onConfirm | Function(event, action). Return promise with the new added/edited event use with remote data. <br> _action_: `add` | `edit`
|
|
76
|
+
| onDelete | Function(id) Return promise with the deleted event id to use with remote data.
|
|
77
|
+
| customEditor | Function(scheduler). Override editor modal. <br> Provided prop _scheduler_ object with helper props: <br> <pre>{<br>state: state obj, <br>close(): void<br>loading(status: boolean): void<br>edited?: ProcessedEvent<br>onConfirm(event: ProcessedEvent, action:EventActions): void<br>}</pre>
|
|
78
|
+
| customViewer | Function(event: ProcessedEvent, close: () => void). Used to render fully customized content of the event popper. If used, `viewerExtraComponent` & `viewerTitleComponent` will be ignored
|
|
79
|
+
| viewerExtraComponent | Function(fields, event) OR Component. Additional component in event viewer popper
|
|
80
|
+
| viewerTitleComponent | Function(event). Helper function to render custom title in event popper
|
|
81
|
+
| viewerSubtitleComponent | Function(event). Helper function to render custom subtitle in event popper
|
|
82
|
+
| disableViewer | boolean. If true, the viewer popover will be disabled globally
|
|
83
|
+
| resources | Array. Resources array to split event views with resources <br>_Example_ <pre>{<br>assignee: 1,<br>text: "User One", <br>subtext: "Sales Manager", <br>avatar: "https://picsum.photos/200/300", <br>color: "#ab2d2d",<br> }</pre>
|
|
84
|
+
| resourceFields | Object. Map the resources correct fields. <br>_Example_:<pre>{<br>idField: "admin*id", <br>textField: "title", <br>subTextField: "mobile",<br>avatarField: "title", <br>colorField: "background",<br>}</pre>
|
|
85
|
+
| resourceHeaderComponent | Function(resource). Override header component of resource
|
|
86
|
+
| resourceViewMode | Display resources mode. <br>\_Options*: `default` | `vertical` | `tabs`
|
|
87
|
+
| onResourceChange | Function(resource: Resource): void. Triggered when the resource tabs changes, only applicable when `resourceViewMode="tabs"`
|
|
88
|
+
| direction | string. Table direction. `rtl` | `ltr`
|
|
89
|
+
| dialogMaxWidth | Edito dialog maxWith. Ex: `lg` | `md` | `sm`... _Default_:`md`
|
|
90
|
+
| locale | Locale of date-fns. _Default_: `enUS`
|
|
91
|
+
| hourFormat | Hour format. <br>_Options_: `12` | `24`. _Default_: `12`
|
|
92
|
+
| timeZone| String, time zone [IANA ID](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
|
|
93
|
+
| translations | Object. Translations view props. <br> _default_: <pre>{<br> navigation: {<br> month: "Month",<br> week: "Week",<br> day: "Day",<br> today: "Today"<br> agenda: "Agenda"<br> },<br> form: {<br> addTitle: "Add Event",<br> editTitle: "Edit Event",<br> confirm: "Confirm",<br> delete: "Delete",<br> cancel: "Cancel"<br> },<br> event: {<br> title: "Title",<br> subtitle: "Subtitle",<br> start: "Start",<br> end: "End",<br> allDay: "All Day"<br>},<br> validation: {<br> required: "Required",<br> invalidEmail: "Invalid Email",<br> onlyNumbers: "Only Numbers Allowed",<br> min: "Minimum {{min}} letters",<br> max: "Maximum {{max}} letters"<br> },<br> moreEvents: "More...",<br> noDataToDisplay: "No data to display",<br> loading: "Loading..."<br>}</pre>
|
|
94
|
+
| onEventDrop | Function(event: DragEvent<HTMLButtonElement>, droppedOn: Date, updatedEvent: ProcessedEvent, originalEvent: ProcessedEvent). Return a promise, used to update remote data of the dropped event. Return an event to update state internally, or void if event state is managed within component
|
|
95
|
+
| onEventClick | Function(event: ProcessedEvent): void. Triggered when an event item is clicked
|
|
96
|
+
| onEventEdit | Function(event: ProcessedEvent): void. Triggered when an event item is being edited from the popover
|
|
97
|
+
| onCellClick | Function(start: Date, end: Date, resourceKey?: string, resourceVal?: string | number): void. Triggered when a cell in the grid is clicked
|
|
98
|
+
| onSelectedDateChange | Function(date: Date): void. Triggered when the `selectedDate` prop changes by navigation date picker or `today` button
|
|
99
|
+
| onViewChange | Function(view: View, agenda?: boolean): void. Triggered when navigation view changes
|
|
100
|
+
| stickyNavigation | If `true`, the navigation controller bar will be sticky
|
|
101
|
+
| onClickMore | Function(date: Date, goToDay: Function(date: Date): void): void. Triggered when the "More..." button is clicked, it receives the date and a `goToDay` function that shows a day view for a specfic date.
|
|
102
|
+
| stickyNavigationOffset | number. Top offset in pixels when sticky navigation is enabled. <br>_Default_: `0` |
|
|
103
|
+
| stickyNavigationHeight | number. Height of the sticky navigation header in pixels. Used to calculate offset for sticky elements below the header. <br>_Default_: `40` |
|
|
104
|
+
| customHeaderContent | Function. Custom content to display in the scheduler header. Wrap with `useCallback` if using state/props to avoid re-renders. <br>_Example_: `() => <Button>Refresh</Button>` |
|
|
105
|
+
| currentTime | Date. Override the current time used for the time indicator bar. Useful when working with different timezones or for testing. <br>_Default_: `new Date()` |
|
|
106
|
+
| showCurrentTimeBar | boolean. Show/hide the current time indicator bar. <br>_Default_: `true` |
|
|
107
|
+
| currentTimeBarColor | string. Color of the current time indicator bar. <br>_Default_: `theme.palette.error.light` (red) |
|
|
108
|
+
| forceInlineMultiDay | boolean. When `true`, events spanning multiple days with `allDay: false` will be displayed in the time grid instead of the all-day header. Events will be split visually at midnight boundaries. <br>_Default_: `false` |
|
|
109
|
+
|
|
110
|
+
### SchedulerRef
|
|
111
|
+
|
|
112
|
+
Used to help manage and control the internal state of the `Scheduler` component from outside of `Scheduler` props, Example:
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
import { Scheduler } from "@isma91/react-scheduler";
|
|
116
|
+
import type { SchedulerRef } from "@isma91/react-scheduler/types"
|
|
117
|
+
|
|
118
|
+
const SomeComponent = () => {
|
|
119
|
+
const calendarRef = useRef<SchedulerRef>(null);
|
|
120
|
+
|
|
121
|
+
return <Fragment>
|
|
122
|
+
<div>
|
|
123
|
+
<Button onClick={()=>{
|
|
124
|
+
calendarRef.current.scheduler.handleState("day", "view");
|
|
125
|
+
}}>
|
|
126
|
+
Change View
|
|
127
|
+
</Button>
|
|
128
|
+
<Button onClick={()=>{
|
|
129
|
+
calendarRef.current.scheduler.triggerDialog(true, {
|
|
130
|
+
start: /*Put the start date*/,
|
|
131
|
+
end: /*Put the end date*/
|
|
132
|
+
})
|
|
133
|
+
}}>
|
|
134
|
+
Add Event Tomorrow
|
|
135
|
+
</Button>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<Scheduler
|
|
139
|
+
ref={calendarRef}
|
|
140
|
+
events={EVENTS}
|
|
141
|
+
//...
|
|
142
|
+
/>
|
|
143
|
+
</Fragment>
|
|
144
|
+
};
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The `calendarRef` holds the entire internal state of the Scheduler component. Perhaps the most useful method inside the `calendarRef` is `handleState`, example:
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
calendarRef.current.scheduler.handleState(value, key);
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
consider looking inside `SchedulerRef` type to see all fields & methods available.
|
|
154
|
+
|
|
155
|
+
### Demos
|
|
156
|
+
|
|
157
|
+
- [Basic](https://codesandbox.io/p/sandbox/standard-x24pqk)
|
|
158
|
+
- [Remote Data](https://codesandbox.io/s/remote-data-j13ei)
|
|
159
|
+
- [Custom Fields](https://codesandbox.io/s/custom-fields-b2kbv)
|
|
160
|
+
- [Editor/Viewer Override](https://codesandbox.io/s/customeditor-tt2pf)
|
|
161
|
+
- [Resources/View Mode](https://codesandbox.io/s/resources-7wlcy)
|
|
162
|
+
- [Custom Cell Action](https://codesandbox.io/s/custom-cell-action-n02dv)
|
|
163
|
+
- [Custom Event Renderer](https://codesandbox.io/s/custom-event-renderer-rkf4xw)
|
|
164
|
+
|
|
165
|
+
### Todos
|
|
166
|
+
|
|
167
|
+
- [ ] Tests
|
|
168
|
+
- [x] Drag&Drop - partially
|
|
169
|
+
- [ ] Resizable
|
|
170
|
+
- [x] Recurring events - partially
|
|
171
|
+
- [x] Localization
|
|
172
|
+
- [x] Hour format 12 | 24
|
package/dist/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
This is free and unencumbered software released into the public domain.
|
|
2
|
+
|
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
4
|
+
distribute this software, either in source code form or as a compiled
|
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
|
6
|
+
means.
|
|
7
|
+
|
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
|
9
|
+
of this software dedicate any and all copyright interest in the
|
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
|
11
|
+
of the public at large and to the detriment of our heirs and
|
|
12
|
+
successors. We intend this dedication to be an overt act of
|
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
|
14
|
+
software under copyright law.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
For more information, please refer to <https://unlicense.org>
|
package/dist/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# React Scheduler Component
|
|
2
|
+
|
|
3
|
+
> :rocket: **Fork Notice**: This is a modernized fork of [@aldabil/react-scheduler](https://github.com/aldabil21/react-scheduler) with:
|
|
4
|
+
> - React 19 support
|
|
5
|
+
> - MUI 7 / @mui/x-date-pickers 8 support
|
|
6
|
+
> - date-fns 4 support
|
|
7
|
+
> - Additional features (see changelog)
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@isma91/react-scheduler)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
> :warning: **Notice**: This component uses `mui`/`emotion`/`date-fns`. if your project is not already using these libs, this component may not be suitable.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```jsx
|
|
17
|
+
npm i @isma91/react-scheduler
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
If you plan to use `recurring` events in your scheduler, install `rrule` [package](https://www.npmjs.com/package/rrule)
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```jsx
|
|
25
|
+
import { Scheduler } from "@isma91/react-scheduler";
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Example
|
|
29
|
+
|
|
30
|
+
```jsx
|
|
31
|
+
<Scheduler
|
|
32
|
+
view="month"
|
|
33
|
+
events={[
|
|
34
|
+
{
|
|
35
|
+
event_id: 1,
|
|
36
|
+
title: "Event 1",
|
|
37
|
+
start: new Date("2021/5/2 09:30"),
|
|
38
|
+
end: new Date("2021/5/2 10:30"),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
event_id: 2,
|
|
42
|
+
title: "Event 2",
|
|
43
|
+
start: new Date("2021/5/4 10:00"),
|
|
44
|
+
end: new Date("2021/5/4 11:00"),
|
|
45
|
+
},
|
|
46
|
+
]}
|
|
47
|
+
/>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Scheduler Props
|
|
51
|
+
|
|
52
|
+
All props are _optional_
|
|
53
|
+
| Prop | Value |
|
|
54
|
+
|----------|-------------|
|
|
55
|
+
| height | number. Min height of table. <br> _Default_: 600
|
|
56
|
+
| view | string. Initial view to load. options: "week", "month", "day". <br> _Default_: "week" (if it's not null)
|
|
57
|
+
| agenda | boolean. Activate agenda view
|
|
58
|
+
| alwaysShowAgendaDays | boolean. if true, day rows without events will be shown
|
|
59
|
+
| month | Object. Month view props. <br> _default_: <pre>{<br>weekDays: [0, 1, 2, 3, 4, 5], <br>weekStartOn: 6, <br>startHour: 9, <br>endHour: 17,<br>cellRenderer?:(props: CellProps) => React.ReactNode,<br>navigation: true,<br>disableGoToDay: false<br>}</pre>
|
|
60
|
+
| week | Object. Week view props. <br> _default_: <pre>{ <br>weekDays: [0, 1, 2, 3, 4, 5], <br>weekStartOn: 6, <br>startHour: 9, <br>endHour: 17,<br>step: 60,<br>cellRenderer?:(props: CellProps) => React.ReactNode,<br>navigation: true,<br>disableGoToDay: false<br>}</pre>
|
|
61
|
+
| day | Object. Day view props. <br> _default_: <pre>{<br>startHour: 9, <br>endHour: 17, <br>step: 60,<br>cellRenderer?:(props: CellProps) => React.ReactNode,<br>hourRenderer?:(hour: string) => React.ReactNode,<br>navigation: true<br>}</pre>
|
|
62
|
+
| selectedDate | Date. Initial selected date. <br>_Default_: `new Date()`
|
|
63
|
+
| navigation | boolean. Show/Hide top bar date navigation. <br>_Default_: `true`
|
|
64
|
+
| navigationPickerProps | CalendarPickerProps for top bar date navigation. Ref [CalendarPicker API](https://mui.com/x/api/date-pickers/calendar-picker/#main-content)
|
|
65
|
+
| disableViewNavigator | boolean. Show/Hide top bar date View navigator. <br>_Default_: `false`
|
|
66
|
+
| events | Array of ProcessedEvent. <br>_Default_: [] <br> <pre>type ProcessedEvent = {<br>event*id: number or string;<br>title: string;<br>subtitle?: string;<br>start: Date;<br>end: Date;<br>disabled?: boolean;<br>recurring: RRule;<br>color?: string or "palette.path";<br>textColor?: string or "palette.path";<br>editable?: boolean;<br>deletable?: boolean;<br>draggable?: boolean;<br>allDay?: boolean;<br>agendaAvatar?: React.ReactElement \| string<br>sx?: Mui sx prop<br>} </pre>
|
|
67
|
+
| eventRenderer | Function(event:ProcessedEvent): React.ReactNode.<br> A function that overrides the event item render function, see demo \_Custom Event Renderer* below
|
|
68
|
+
| editable | boolean. If `true`, the scheduler cell click will not open the editor, and the event item will not show the edit button, this is applied to all events, and can be overridden in each event property, see `ProcessedEvent` type.
|
|
69
|
+
| deletable | boolean. Whether the event item will show the delete button, this is applied to all events, and can be overridden in each event property, see `ProcessedEvent` type.
|
|
70
|
+
| draggable | boolean. Whether activate drag&drop for the events, this is applied to all events, and can be overridden in each event property, see `ProcessedEvent` type.
|
|
71
|
+
| getRemoteEvents | Function(RemoteQuery). Return promise of array of events. Can be used as a callback to fetch events by parent component or fetch.<br><pre>type RemoteQuery = { <br> start: Date;<br> end: Date;<br> view: "day" \| "week" \| "month";<br>}</pre>
|
|
72
|
+
| fields | Array of extra fields with configurations. <br> Example: <pre> { <br> name: "description", <br> type: "input" , <br> config: { label: "Description", required: true, min: 3, email: true, variant: "outlined", ....<br>}</pre>
|
|
73
|
+
| loading | boolean. Loading state of the calendar table
|
|
74
|
+
| loadingComponent | Custom component to override the default `CircularProgress`
|
|
75
|
+
| onConfirm | Function(event, action). Return promise with the new added/edited event use with remote data. <br> _action_: `add` | `edit`
|
|
76
|
+
| onDelete | Function(id) Return promise with the deleted event id to use with remote data.
|
|
77
|
+
| customEditor | Function(scheduler). Override editor modal. <br> Provided prop _scheduler_ object with helper props: <br> <pre>{<br>state: state obj, <br>close(): void<br>loading(status: boolean): void<br>edited?: ProcessedEvent<br>onConfirm(event: ProcessedEvent, action:EventActions): void<br>}</pre>
|
|
78
|
+
| customViewer | Function(event: ProcessedEvent, close: () => void). Used to render fully customized content of the event popper. If used, `viewerExtraComponent` & `viewerTitleComponent` will be ignored
|
|
79
|
+
| viewerExtraComponent | Function(fields, event) OR Component. Additional component in event viewer popper
|
|
80
|
+
| viewerTitleComponent | Function(event). Helper function to render custom title in event popper
|
|
81
|
+
| viewerSubtitleComponent | Function(event). Helper function to render custom subtitle in event popper
|
|
82
|
+
| disableViewer | boolean. If true, the viewer popover will be disabled globally
|
|
83
|
+
| resources | Array. Resources array to split event views with resources <br>_Example_ <pre>{<br>assignee: 1,<br>text: "User One", <br>subtext: "Sales Manager", <br>avatar: "https://picsum.photos/200/300", <br>color: "#ab2d2d",<br> }</pre>
|
|
84
|
+
| resourceFields | Object. Map the resources correct fields. <br>_Example_:<pre>{<br>idField: "admin*id", <br>textField: "title", <br>subTextField: "mobile",<br>avatarField: "title", <br>colorField: "background",<br>}</pre>
|
|
85
|
+
| resourceHeaderComponent | Function(resource). Override header component of resource
|
|
86
|
+
| resourceViewMode | Display resources mode. <br>\_Options*: `default` | `vertical` | `tabs`
|
|
87
|
+
| onResourceChange | Function(resource: Resource): void. Triggered when the resource tabs changes, only applicable when `resourceViewMode="tabs"`
|
|
88
|
+
| direction | string. Table direction. `rtl` | `ltr`
|
|
89
|
+
| dialogMaxWidth | Edito dialog maxWith. Ex: `lg` | `md` | `sm`... _Default_:`md`
|
|
90
|
+
| locale | Locale of date-fns. _Default_: `enUS`
|
|
91
|
+
| hourFormat | Hour format. <br>_Options_: `12` | `24`. _Default_: `12`
|
|
92
|
+
| timeZone| String, time zone [IANA ID](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
|
|
93
|
+
| translations | Object. Translations view props. <br> _default_: <pre>{<br> navigation: {<br> month: "Month",<br> week: "Week",<br> day: "Day",<br> today: "Today"<br> agenda: "Agenda"<br> },<br> form: {<br> addTitle: "Add Event",<br> editTitle: "Edit Event",<br> confirm: "Confirm",<br> delete: "Delete",<br> cancel: "Cancel"<br> },<br> event: {<br> title: "Title",<br> subtitle: "Subtitle",<br> start: "Start",<br> end: "End",<br> allDay: "All Day"<br>},<br> validation: {<br> required: "Required",<br> invalidEmail: "Invalid Email",<br> onlyNumbers: "Only Numbers Allowed",<br> min: "Minimum {{min}} letters",<br> max: "Maximum {{max}} letters"<br> },<br> moreEvents: "More...",<br> noDataToDisplay: "No data to display",<br> loading: "Loading..."<br>}</pre>
|
|
94
|
+
| onEventDrop | Function(event: DragEvent<HTMLButtonElement>, droppedOn: Date, updatedEvent: ProcessedEvent, originalEvent: ProcessedEvent). Return a promise, used to update remote data of the dropped event. Return an event to update state internally, or void if event state is managed within component
|
|
95
|
+
| onEventClick | Function(event: ProcessedEvent): void. Triggered when an event item is clicked
|
|
96
|
+
| onEventEdit | Function(event: ProcessedEvent): void. Triggered when an event item is being edited from the popover
|
|
97
|
+
| onCellClick | Function(start: Date, end: Date, resourceKey?: string, resourceVal?: string | number): void. Triggered when a cell in the grid is clicked
|
|
98
|
+
| onSelectedDateChange | Function(date: Date): void. Triggered when the `selectedDate` prop changes by navigation date picker or `today` button
|
|
99
|
+
| onViewChange | Function(view: View, agenda?: boolean): void. Triggered when navigation view changes
|
|
100
|
+
| stickyNavigation | If `true`, the navigation controller bar will be sticky
|
|
101
|
+
| onClickMore | Function(date: Date, goToDay: Function(date: Date): void): void. Triggered when the "More..." button is clicked, it receives the date and a `goToDay` function that shows a day view for a specfic date.
|
|
102
|
+
| stickyNavigationOffset | number. Top offset in pixels when sticky navigation is enabled. <br>_Default_: `0` |
|
|
103
|
+
| stickyNavigationHeight | number. Height of the sticky navigation header in pixels. Used to calculate offset for sticky elements below the header. <br>_Default_: `40` |
|
|
104
|
+
| customHeaderContent | Function. Custom content to display in the scheduler header. Wrap with `useCallback` if using state/props to avoid re-renders. <br>_Example_: `() => <Button>Refresh</Button>` |
|
|
105
|
+
| currentTime | Date. Override the current time used for the time indicator bar. Useful when working with different timezones or for testing. <br>_Default_: `new Date()` |
|
|
106
|
+
| showCurrentTimeBar | boolean. Show/hide the current time indicator bar. <br>_Default_: `true` |
|
|
107
|
+
| currentTimeBarColor | string. Color of the current time indicator bar. <br>_Default_: `theme.palette.error.light` (red) |
|
|
108
|
+
| forceInlineMultiDay | boolean. When `true`, events spanning multiple days with `allDay: false` will be displayed in the time grid instead of the all-day header. Events will be split visually at midnight boundaries. <br>_Default_: `false` |
|
|
109
|
+
|
|
110
|
+
### SchedulerRef
|
|
111
|
+
|
|
112
|
+
Used to help manage and control the internal state of the `Scheduler` component from outside of `Scheduler` props, Example:
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
import { Scheduler } from "@isma91/react-scheduler";
|
|
116
|
+
import type { SchedulerRef } from "@isma91/react-scheduler/types"
|
|
117
|
+
|
|
118
|
+
const SomeComponent = () => {
|
|
119
|
+
const calendarRef = useRef<SchedulerRef>(null);
|
|
120
|
+
|
|
121
|
+
return <Fragment>
|
|
122
|
+
<div>
|
|
123
|
+
<Button onClick={()=>{
|
|
124
|
+
calendarRef.current.scheduler.handleState("day", "view");
|
|
125
|
+
}}>
|
|
126
|
+
Change View
|
|
127
|
+
</Button>
|
|
128
|
+
<Button onClick={()=>{
|
|
129
|
+
calendarRef.current.scheduler.triggerDialog(true, {
|
|
130
|
+
start: /*Put the start date*/,
|
|
131
|
+
end: /*Put the end date*/
|
|
132
|
+
})
|
|
133
|
+
}}>
|
|
134
|
+
Add Event Tomorrow
|
|
135
|
+
</Button>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<Scheduler
|
|
139
|
+
ref={calendarRef}
|
|
140
|
+
events={EVENTS}
|
|
141
|
+
//...
|
|
142
|
+
/>
|
|
143
|
+
</Fragment>
|
|
144
|
+
};
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The `calendarRef` holds the entire internal state of the Scheduler component. Perhaps the most useful method inside the `calendarRef` is `handleState`, example:
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
calendarRef.current.scheduler.handleState(value, key);
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
consider looking inside `SchedulerRef` type to see all fields & methods available.
|
|
154
|
+
|
|
155
|
+
### Demos
|
|
156
|
+
|
|
157
|
+
- [Basic](https://codesandbox.io/p/sandbox/standard-x24pqk)
|
|
158
|
+
- [Remote Data](https://codesandbox.io/s/remote-data-j13ei)
|
|
159
|
+
- [Custom Fields](https://codesandbox.io/s/custom-fields-b2kbv)
|
|
160
|
+
- [Editor/Viewer Override](https://codesandbox.io/s/customeditor-tt2pf)
|
|
161
|
+
- [Resources/View Mode](https://codesandbox.io/s/resources-7wlcy)
|
|
162
|
+
- [Custom Cell Action](https://codesandbox.io/s/custom-cell-action-n02dv)
|
|
163
|
+
- [Custom Event Renderer](https://codesandbox.io/s/custom-event-renderer-rkf4xw)
|
|
164
|
+
|
|
165
|
+
### Todos
|
|
166
|
+
|
|
167
|
+
- [ ] Tests
|
|
168
|
+
- [x] Drag&Drop - partially
|
|
169
|
+
- [ ] Resizable
|
|
170
|
+
- [x] Recurring events - partially
|
|
171
|
+
- [x] Localization
|
|
172
|
+
- [x] Hour format 12 | 24
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CellRenderedProps } from '../../types';
|
|
2
|
+
interface CellProps {
|
|
3
|
+
day: Date;
|
|
4
|
+
start: Date;
|
|
5
|
+
height: number;
|
|
6
|
+
end: Date;
|
|
7
|
+
resourceKey: string;
|
|
8
|
+
resourceVal: string | number;
|
|
9
|
+
cellRenderer?(props: CellRenderedProps): React.ReactNode;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const Cell: ({ day, start, end, resourceKey, resourceVal, cellRenderer, height, children, }: CellProps) => string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
13
|
+
export default Cell;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IconButtonProps } from '@mui/material';
|
|
2
|
+
import { MouseEvent } from 'react';
|
|
3
|
+
interface LocaleArrowProps extends Omit<IconButtonProps, "type"> {
|
|
4
|
+
type: "prev" | "next";
|
|
5
|
+
onClick?(e?: MouseEvent): void;
|
|
6
|
+
}
|
|
7
|
+
declare const LocaleArrow: ({ type, onClick, ...props }: LocaleArrowProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { LocaleArrow };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DefaultResource } from '../../types';
|
|
2
|
+
interface ResourceHeaderProps {
|
|
3
|
+
resource: DefaultResource;
|
|
4
|
+
}
|
|
5
|
+
declare const ResourceHeader: ({ resource }: ResourceHeaderProps) => string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
6
|
+
export { ResourceHeader };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export type ButtonTabProps = {
|
|
3
|
+
id: string | number;
|
|
4
|
+
label: string | React.ReactNode;
|
|
5
|
+
component: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
interface ButtonTabsProps {
|
|
8
|
+
tabs: ButtonTabProps[];
|
|
9
|
+
tab: string | number;
|
|
10
|
+
setTab(tab: string | number): void;
|
|
11
|
+
variant?: "scrollable" | "standard" | "fullWidth";
|
|
12
|
+
indicator?: "primary" | "secondary" | "info" | "error";
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
declare const ButtonTabs: ({ tabs, variant, tab, setTab, indicator, style, }: ButtonTabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export { ButtonTabs };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Locale } from 'date-fns';
|
|
2
|
+
interface TodayTypoProps {
|
|
3
|
+
date: Date;
|
|
4
|
+
onClick?(day: Date): void;
|
|
5
|
+
locale: Locale;
|
|
6
|
+
}
|
|
7
|
+
declare const TodayTypo: ({ date, onClick, locale }: TodayTypoProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default TodayTypo;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DefaultResource } from '../../types';
|
|
2
|
+
interface WithResourcesProps {
|
|
3
|
+
renderChildren(resource: DefaultResource): React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare const WithResources: ({ renderChildren }: WithResourcesProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { WithResources };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ProcessedEvent } from '../../types';
|
|
2
|
+
interface Props {
|
|
3
|
+
event: ProcessedEvent;
|
|
4
|
+
onDelete(): void;
|
|
5
|
+
onEdit(): void;
|
|
6
|
+
}
|
|
7
|
+
declare const EventActions: ({ event, onDelete, onEdit }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default EventActions;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProcessedEvent } from '../../types';
|
|
2
|
+
interface AgendaEventsListProps {
|
|
3
|
+
day: Date;
|
|
4
|
+
events: ProcessedEvent[];
|
|
5
|
+
}
|
|
6
|
+
declare const AgendaEventsList: ({ day, events }: AgendaEventsListProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default AgendaEventsList;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface CurrentTimeBarProps {
|
|
2
|
+
startHour: number;
|
|
3
|
+
step: number;
|
|
4
|
+
minuteHeight: number;
|
|
5
|
+
timeZone?: string;
|
|
6
|
+
zIndex?: number;
|
|
7
|
+
currentTime?: Date;
|
|
8
|
+
color?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const CurrentTimeBar: (props: CurrentTimeBarProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export default CurrentTimeBar;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ProcessedEvent } from '../../types';
|
|
2
|
+
interface EventItemProps {
|
|
3
|
+
event: ProcessedEvent;
|
|
4
|
+
multiday?: boolean;
|
|
5
|
+
hasPrev?: boolean;
|
|
6
|
+
hasNext?: boolean;
|
|
7
|
+
showdate?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const EventItem: ({ event, multiday, hasPrev, hasNext, showdate }: EventItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default EventItem;
|