@mlopezlara90/react-scheduler 1.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.
Files changed (56) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +124 -0
  3. package/SchedulerComponent.d.ts +3 -0
  4. package/components/common/Cell.d.ts +14 -0
  5. package/components/common/LocaleArrow.d.ts +8 -0
  6. package/components/common/ResourceHeader.d.ts +6 -0
  7. package/components/common/Tabs.d.ts +16 -0
  8. package/components/common/TodayTypo.d.ts +8 -0
  9. package/components/common/WithResources.d.ts +6 -0
  10. package/components/events/Actions.d.ts +8 -0
  11. package/components/events/AgendaEventsList.d.ts +7 -0
  12. package/components/events/CurrentTimeBar.d.ts +9 -0
  13. package/components/events/EmptyAgenda.d.ts +2 -0
  14. package/components/events/EventItem.d.ts +10 -0
  15. package/components/events/EventItemPopover.d.ts +9 -0
  16. package/components/events/MonthEvents.d.ts +13 -0
  17. package/components/events/TodayEvents.d.ts +13 -0
  18. package/components/hoc/DateProvider.d.ts +5 -0
  19. package/components/inputs/DatePicker.d.ts +14 -0
  20. package/components/inputs/Input.d.ts +19 -0
  21. package/components/inputs/SelectInput.d.ts +22 -0
  22. package/components/month/MonthTable.d.ts +8 -0
  23. package/components/nav/DayDateBtn.d.ts +6 -0
  24. package/components/nav/MonthDateBtn.d.ts +6 -0
  25. package/components/nav/Navigation.d.ts +5 -0
  26. package/components/nav/WeekDateBtn.d.ts +8 -0
  27. package/components/week/WeekTable.d.ts +11 -0
  28. package/helpers/constants.d.ts +4 -0
  29. package/helpers/generals.d.ts +70 -0
  30. package/hooks/useArrowDisable.d.ts +5 -0
  31. package/hooks/useCellAttributes.d.ts +18 -0
  32. package/hooks/useDragAttributes.d.ts +10 -0
  33. package/hooks/useEventPermissions.d.ts +7 -0
  34. package/hooks/useIsClient.d.ts +2 -0
  35. package/hooks/useStore.d.ts +2 -0
  36. package/hooks/useSyncScroll.d.ts +8 -0
  37. package/hooks/useWindowResize.d.ts +5 -0
  38. package/index.d.ts +3 -0
  39. package/index.js +2812 -0
  40. package/package.json +65 -0
  41. package/positionManger/context.d.ts +14 -0
  42. package/positionManger/provider.d.ts +5 -0
  43. package/positionManger/usePosition.d.ts +4 -0
  44. package/store/context.d.ts +2 -0
  45. package/store/default.d.ts +233 -0
  46. package/store/provider.d.ts +7 -0
  47. package/store/types.d.ts +27 -0
  48. package/styles/styles.d.ts +22 -0
  49. package/types.d.ts +327 -0
  50. package/views/Day.d.ts +2 -0
  51. package/views/DayAgenda.d.ts +7 -0
  52. package/views/Editor.d.ts +11 -0
  53. package/views/Month.d.ts +2 -0
  54. package/views/MonthAgenda.d.ts +7 -0
  55. package/views/Week.d.ts +2 -0
  56. package/views/WeekAgenda.d.ts +8 -0
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,124 @@
1
+ # React Scheduler Component
2
+
3
+ Customizable calendar and scheduling component for React applications, forked from `@aldabil/react-scheduler` with additional features and improvements.
4
+
5
+ ### Notes
6
+ This fork was created to address specific requirements for a project. *Not all functionalities have been tested yet*. <br>
7
+ For documentation, features, and additional usage examples, visit the [original npm package page](https://www.npmjs.com/package/@aldabil/react-scheduler).
8
+
9
+ ## Installation
10
+
11
+ > :warning: **Notice**: This component uses `mui`/`emotion`/`date-fns`. if your project is not already using these libs, this component may not be suitable.
12
+
13
+ ```jsx
14
+ npm i @mlopezlara90/react-scheduler
15
+ ```
16
+
17
+ If you plan to use `recurring` events in your scheduler, install `rrule` [package](https://www.npmjs.com/package/rrule)
18
+
19
+ ## Usage
20
+
21
+ ```jsx
22
+ import { Scheduler } from "@mlopezlara90/react-scheduler";
23
+ ```
24
+
25
+ ## Example
26
+
27
+ ```jsx
28
+ <Scheduler
29
+ view="month"
30
+ events={[
31
+ {
32
+ event_id: 1,
33
+ title: "Event 1",
34
+ start: new Date("2021/5/2 09:30"),
35
+ end: new Date("2021/5/2 10:30"),
36
+ },
37
+ {
38
+ event_id: 2,
39
+ title: "Event 2",
40
+ start: new Date("2021/5/4 10:00"),
41
+ end: new Date("2021/5/4 11:00"),
42
+ },
43
+ ]}
44
+ />
45
+ ```
46
+
47
+ ### Scheduler Props
48
+
49
+ All props are *optional*.
50
+
51
+ | Prop | Value | Default |
52
+ |---------------------|----------------------------------------------------------------------|-------------|
53
+ | navigationSlot | Slot in the navigation section. | `undefined` |
54
+
55
+ ### Original Props
56
+
57
+ Here are the original props supported by the library. <br>
58
+ [Click here to see the full list](https://www.npmjs.com/package/@aldabil/react-scheduler)
59
+
60
+ ---
61
+
62
+ ### SchedulerRef
63
+
64
+ Used to help manage and control the internal state of the `Scheduler` component from outside of `Scheduler` props, Example:
65
+
66
+ ```js
67
+ import { Scheduler } from "@mlopezlara90/react-scheduler";
68
+ import type { SchedulerRef } from "@mlopezlara90/react-scheduler/types"
69
+
70
+ const SomeComponent = () => {
71
+ const calendarRef = useRef<SchedulerRef>(null);
72
+
73
+ return <Fragment>
74
+ <div>
75
+ <Button onClick={()=>{
76
+ calendarRef.current.scheduler.handleState("day", "view");
77
+ }}>
78
+ Change View
79
+ </Button>
80
+ <Button onClick={()=>{
81
+ calendarRef.current.scheduler.triggerDialog(true, {
82
+ start: /*Put the start date*/,
83
+ end: /*Put the end date*/
84
+ })
85
+ }}>
86
+ Add Event Tomorrow
87
+ </Button>
88
+ </div>
89
+
90
+ <Scheduler
91
+ ref={calendarRef}
92
+ events={EVENTS}
93
+ //...
94
+ />
95
+ </Fragment>
96
+ };
97
+ ```
98
+
99
+ The `calendarRef` holds the entire internal state of the Scheduler component. Perhaps the most useful method inside the `calendarRef` is `handleState`, example:
100
+
101
+ ```
102
+ calendarRef.current.scheduler.handleState(value, key);
103
+ ```
104
+
105
+ consider looking inside `SchedulerRef` type to see all fields & methods available.
106
+
107
+ ### Demos
108
+
109
+ - [Basic](https://codesandbox.io/p/sandbox/standard-x24pqk)
110
+ - [Remote Data](https://codesandbox.io/s/remote-data-j13ei)
111
+ - [Custom Fields](https://codesandbox.io/s/custom-fields-b2kbv)
112
+ - [Editor/Viewer Override](https://codesandbox.io/s/customeditor-tt2pf)
113
+ - [Resources/View Mode](https://codesandbox.io/s/resources-7wlcy)
114
+ - [Custom Cell Action](https://codesandbox.io/s/custom-cell-action-n02dv)
115
+ - [Custom Event Renderer](https://codesandbox.io/s/custom-event-renderer-rkf4xw)
116
+
117
+ ### Todos
118
+
119
+ - [ ] Tests
120
+ - [x] Drag&Drop - partially
121
+ - [ ] Resizable
122
+ - [x] Recurring events - partially
123
+ - [x] Localization
124
+ - [x] Hour format 12 | 24
@@ -0,0 +1,3 @@
1
+ import { SchedulerRef } from './types';
2
+ declare const SchedulerComponent: import('react').ForwardRefExoticComponent<import('react').RefAttributes<SchedulerRef>>;
3
+ export default SchedulerComponent;
@@ -0,0 +1,14 @@
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
+ timeZone?: string;
12
+ }
13
+ declare const Cell: ({ day, start, end, resourceKey, resourceVal, cellRenderer, height, children, timeZone, }: 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;
14
+ 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,9 @@
1
+ interface CurrentTimeBarProps {
2
+ startHour: number;
3
+ step: number;
4
+ minuteHeight: number;
5
+ timeZone?: string;
6
+ zIndex?: number;
7
+ }
8
+ declare const CurrentTimeBar: (props: CurrentTimeBarProps) => import("react/jsx-runtime").JSX.Element | null;
9
+ export default CurrentTimeBar;
@@ -0,0 +1,2 @@
1
+ declare const EmptyAgenda: () => import("react/jsx-runtime").JSX.Element;
2
+ export default EmptyAgenda;
@@ -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;
@@ -0,0 +1,9 @@
1
+ import { MouseEvent } from 'react';
2
+ import { ProcessedEvent } from '../../types';
3
+ type Props = {
4
+ event: ProcessedEvent;
5
+ anchorEl: Element | null;
6
+ onTriggerViewer: (el?: MouseEvent<Element>) => void;
7
+ };
8
+ declare const EventItemPopover: ({ anchorEl, event, onTriggerViewer }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export default EventItemPopover;
@@ -0,0 +1,13 @@
1
+ import { ProcessedEvent } from '../../types';
2
+ interface MonthEventProps {
3
+ events: ProcessedEvent[];
4
+ resourceId?: string;
5
+ today: Date;
6
+ eachWeekStart: Date[];
7
+ eachFirstDayInCalcRow: Date | null;
8
+ daysList: Date[];
9
+ onViewMore(day: Date): void;
10
+ cellHeight: number;
11
+ }
12
+ declare const MonthEvents: ({ events, resourceId, today, eachWeekStart, eachFirstDayInCalcRow, daysList, onViewMore, cellHeight, }: MonthEventProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default MonthEvents;
@@ -0,0 +1,13 @@
1
+ import { ProcessedEvent } from '../../types';
2
+ interface TodayEventsProps {
3
+ todayEvents: ProcessedEvent[];
4
+ today: Date;
5
+ startHour: number;
6
+ endHour: number;
7
+ step: number;
8
+ minuteHeight: number;
9
+ direction: "rtl" | "ltr";
10
+ timeZone?: string;
11
+ }
12
+ declare const TodayEvents: ({ todayEvents, today, startHour, endHour, step, minuteHeight, direction, timeZone, }: TodayEventsProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default TodayEvents;
@@ -0,0 +1,5 @@
1
+ interface AuxProps {
2
+ children: React.ReactNode;
3
+ }
4
+ declare const DateProvider: ({ children }: AuxProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default DateProvider;
@@ -0,0 +1,14 @@
1
+ interface EditorDatePickerProps {
2
+ type?: "date" | "datetime";
3
+ label?: string;
4
+ variant?: "standard" | "filled" | "outlined";
5
+ value: Date | string;
6
+ name: string;
7
+ onChange(name: string, date: Date): void;
8
+ error?: boolean;
9
+ errMsg?: string;
10
+ touched?: boolean;
11
+ required?: boolean;
12
+ }
13
+ declare const EditorDatePicker: ({ type, value, label, name, onChange, variant, error, errMsg, touched, required, }: EditorDatePickerProps) => import("react/jsx-runtime").JSX.Element;
14
+ export { EditorDatePicker };
@@ -0,0 +1,19 @@
1
+ interface EditorInputProps {
2
+ variant?: "standard" | "filled" | "outlined";
3
+ label?: string;
4
+ placeholder?: string;
5
+ required?: boolean;
6
+ min?: number;
7
+ max?: number;
8
+ email?: boolean;
9
+ decimal?: boolean;
10
+ disabled?: boolean;
11
+ multiline?: boolean;
12
+ rows?: number;
13
+ value: string;
14
+ name: string;
15
+ onChange(name: string, value: string, isValid: boolean): void;
16
+ touched?: boolean;
17
+ }
18
+ declare const EditorInput: ({ variant, label, placeholder, value, name, required, min, max, email, decimal, onChange, disabled, multiline, rows, touched, }: EditorInputProps) => import("react/jsx-runtime").JSX.Element;
19
+ export { EditorInput };
@@ -0,0 +1,22 @@
1
+ export type SelectOption = {
2
+ id: string | number;
3
+ text: string;
4
+ value: string;
5
+ };
6
+ interface EditorSelectProps {
7
+ options: Array<SelectOption>;
8
+ value: string;
9
+ name: string;
10
+ onChange(name: string, value: string, isValid: boolean): void;
11
+ variant?: "standard" | "filled" | "outlined";
12
+ label?: string;
13
+ placeholder?: string;
14
+ required?: boolean;
15
+ disabled?: boolean;
16
+ touched?: boolean;
17
+ loading?: boolean;
18
+ multiple?: "default" | "chips";
19
+ errMsg?: string;
20
+ }
21
+ declare const EditorSelect: ({ options, value, name, required, onChange, label, disabled, touched, variant, loading, multiple, placeholder, errMsg, }: EditorSelectProps) => import("react/jsx-runtime").JSX.Element;
22
+ export { EditorSelect };
@@ -0,0 +1,8 @@
1
+ import { DefaultResource } from '../../types';
2
+ type Props = {
3
+ daysList: Date[];
4
+ resource?: DefaultResource;
5
+ eachWeekStart: Date[];
6
+ };
7
+ declare const MonthTable: ({ daysList, resource, eachWeekStart }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default MonthTable;
@@ -0,0 +1,6 @@
1
+ interface DayDateBtnProps {
2
+ selectedDate: Date;
3
+ onChange(value: Date): void;
4
+ }
5
+ declare const DayDateBtn: ({ selectedDate, onChange }: DayDateBtnProps) => import("react/jsx-runtime").JSX.Element;
6
+ export { DayDateBtn };
@@ -0,0 +1,6 @@
1
+ interface MonthDateBtnProps {
2
+ selectedDate: Date;
3
+ onChange(value: Date): void;
4
+ }
5
+ declare const MonthDateBtn: ({ selectedDate, onChange }: MonthDateBtnProps) => import("react/jsx-runtime").JSX.Element;
6
+ export { MonthDateBtn };
@@ -0,0 +1,5 @@
1
+ export type View = "month" | "week" | "day";
2
+ declare const Navigation: ({ children }: {
3
+ children?: React.ReactNode;
4
+ }) => import("react/jsx-runtime").JSX.Element | null;
5
+ export { Navigation };
@@ -0,0 +1,8 @@
1
+ import { WeekProps } from '../../types';
2
+ interface WeekDateBtnProps {
3
+ selectedDate: Date;
4
+ onChange(value: Date): void;
5
+ weekProps: WeekProps;
6
+ }
7
+ declare const WeekDateBtn: ({ selectedDate, onChange, weekProps }: WeekDateBtnProps) => import("react/jsx-runtime").JSX.Element;
8
+ export { WeekDateBtn };
@@ -0,0 +1,11 @@
1
+ import { DefaultResource, ProcessedEvent } from '../../types';
2
+ type Props = {
3
+ daysList: Date[];
4
+ hours: Date[];
5
+ cellHeight: number;
6
+ minutesHeight: number;
7
+ resource?: DefaultResource;
8
+ resourcedEvents: ProcessedEvent[];
9
+ };
10
+ declare const WeekTable: ({ daysList, hours, cellHeight, minutesHeight, resourcedEvents, resource, }: Props) => import("react/jsx-runtime").JSX.Element;
11
+ export default WeekTable;
@@ -0,0 +1,4 @@
1
+ export declare const BORDER_HEIGHT = 1;
2
+ export declare const MULTI_DAY_EVENT_HEIGHT = 28;
3
+ export declare const MONTH_NUMBER_HEIGHT = 27;
4
+ export declare const MONTH_BAR_HEIGHT = 23;
@@ -0,0 +1,70 @@
1
+ import { View } from '../components/nav/Navigation';
2
+ import { DefaultResource, FieldProps, ProcessedEvent, ResourceFields, SchedulerProps } from '../types';
3
+ import { StateEvent } from '../views/Editor';
4
+ export declare const getOneView: (state: Partial<SchedulerProps>) => View;
5
+ export declare const getAvailableViews: (state: SchedulerProps) => View[];
6
+ export declare const arraytizeFieldVal: (field: FieldProps, val: any, event?: StateEvent) => {
7
+ value: any;
8
+ validity: any;
9
+ };
10
+ export declare const getResourcedEvents: (events: ProcessedEvent[], resource: DefaultResource, resourceFields: ResourceFields, fields: FieldProps[]) => ProcessedEvent[];
11
+ export declare const traversCrossingEvents: (todayEvents: ProcessedEvent[], event: ProcessedEvent) => ProcessedEvent[];
12
+ export declare const calcMinuteHeight: (cellHeight: number, step: number) => number;
13
+ export declare const calcCellHeight: (tableHeight: number, hoursLength: number) => number;
14
+ export declare const differenceInDaysOmitTime: (start: Date, end: Date) => number;
15
+ export declare const convertRRuleDateToDate: (rruleDate: Date) => Date;
16
+ export declare const getRecurrencesForDate: (event: ProcessedEvent, today: Date, timeZone?: string) => {
17
+ start: Date;
18
+ end: Date;
19
+ convertedTz: boolean;
20
+ event_id: number | string;
21
+ title: React.ReactNode;
22
+ subtitle?: React.ReactNode;
23
+ recurring?: import('rrule').RRule;
24
+ disabled?: boolean;
25
+ color?: string;
26
+ textColor?: string;
27
+ editable?: boolean;
28
+ deletable?: boolean;
29
+ draggable?: boolean;
30
+ allDay?: boolean;
31
+ agendaAvatar?: React.ReactElement | string;
32
+ }[];
33
+ export declare const filterTodayEvents: (events: ProcessedEvent[], today: Date, timeZone?: string) => ProcessedEvent[];
34
+ export declare const filterTodayAgendaEvents: (events: ProcessedEvent[], today: Date) => ProcessedEvent[];
35
+ export declare const sortEventsByTheLengthest: (events: ProcessedEvent[]) => ProcessedEvent[];
36
+ export declare const sortEventsByTheEarliest: (events: ProcessedEvent[]) => ProcessedEvent[];
37
+ export declare const filterMultiDaySlot: (events: ProcessedEvent[], date: Date | Date[], timeZone?: string, lengthOnly?: boolean) => ProcessedEvent[];
38
+ export declare const convertEventTimeZone: (event: ProcessedEvent, timeZone?: string) => {
39
+ start: Date;
40
+ end: Date;
41
+ convertedTz: boolean;
42
+ event_id: number | string;
43
+ title: React.ReactNode;
44
+ subtitle?: React.ReactNode;
45
+ recurring?: import('rrule').RRule;
46
+ disabled?: boolean;
47
+ color?: string;
48
+ textColor?: string;
49
+ editable?: boolean;
50
+ deletable?: boolean;
51
+ draggable?: boolean;
52
+ allDay?: boolean;
53
+ agendaAvatar?: React.ReactElement | string;
54
+ };
55
+ export declare const getTimeZonedDate: (date: Date, timeZone?: string) => Date;
56
+ /**
57
+ * Performs the reverse of getTimeZonedDate, IE: the given date is assumed
58
+ * to already be in the provided timeZone and is reverted to the local
59
+ * browser's timeZone.
60
+ * @param date The date to convert.
61
+ * @param timeZone The timeZone to convert from.
62
+ * @returns A new date reverted from the given timeZone to local time.
63
+ */
64
+ export declare const revertTimeZonedDate: (date: Date, timeZone?: string) => Date;
65
+ export declare const isTimeZonedToday: ({ dateLeft, dateRight, timeZone, }: {
66
+ dateLeft: Date;
67
+ dateRight?: Date;
68
+ timeZone?: string;
69
+ }) => boolean;
70
+ export declare const getHourFormat: (hourFormat: "12" | "24") => "hh:mm a" | "HH:mm";
@@ -0,0 +1,5 @@
1
+ declare const useArrowDisable: () => {
2
+ prevDisabled: boolean;
3
+ nextDisabled: boolean;
4
+ };
5
+ export default useArrowDisable;
@@ -0,0 +1,18 @@
1
+ import { DragEvent } from 'react';
2
+ interface Props {
3
+ start: Date;
4
+ end: Date;
5
+ resourceKey: string;
6
+ resourceVal: string | number;
7
+ }
8
+ declare const useCellAttributes: ({ start, end, resourceKey, resourceVal }: Props) => {
9
+ [x: string]: string | number | boolean | ((e: DragEvent<HTMLButtonElement>) => void);
10
+ tabIndex: number;
11
+ disableRipple: boolean;
12
+ onClick: () => void;
13
+ onDragOver: (e: DragEvent<HTMLButtonElement>) => void;
14
+ onDragEnter: (e: DragEvent<HTMLButtonElement>) => void;
15
+ onDragLeave: (e: DragEvent<HTMLButtonElement>) => void;
16
+ onDrop: (e: DragEvent<HTMLButtonElement>) => void;
17
+ };
18
+ export default useCellAttributes;
@@ -0,0 +1,10 @@
1
+ import { DragEvent } from 'react';
2
+ import { ProcessedEvent } from '../types';
3
+ declare const useDragAttributes: (event: ProcessedEvent) => {
4
+ draggable: boolean;
5
+ onDragStart: (e: DragEvent<HTMLElement>) => void;
6
+ onDragEnd: (e: DragEvent<HTMLElement>) => void;
7
+ onDragOver: (e: DragEvent<HTMLElement>) => void;
8
+ onDragEnter: (e: DragEvent<HTMLElement>) => void;
9
+ };
10
+ export default useDragAttributes;
@@ -0,0 +1,7 @@
1
+ import { ProcessedEvent } from '../types';
2
+ declare const useEventPermissions: (event: ProcessedEvent) => {
3
+ canEdit: boolean | undefined;
4
+ canDelete: boolean | undefined;
5
+ canDrag: boolean | undefined;
6
+ };
7
+ export default useEventPermissions;
@@ -0,0 +1,2 @@
1
+ declare const useIsClient: () => boolean;
2
+ export default useIsClient;
@@ -0,0 +1,2 @@
1
+ declare const useStore: () => import('../store/types').Store;
2
+ export default useStore;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The solution to make headers sticky with overflow
3
+ */
4
+ declare const useSyncScroll: () => {
5
+ headersRef: import('react').RefObject<HTMLDivElement | null>;
6
+ bodyRef: import('react').RefObject<HTMLDivElement | null>;
7
+ };
8
+ export default useSyncScroll;
@@ -0,0 +1,5 @@
1
+ declare const useWindowResize: () => {
2
+ width: number;
3
+ height: number;
4
+ };
5
+ export default useWindowResize;
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { IScheduler, SchedulerRef } from './types';
2
+ declare const Scheduler: import('react').ForwardRefExoticComponent<IScheduler & import('react').RefAttributes<SchedulerRef>>;
3
+ export { Scheduler };