react-weekly-planning 1.0.28 → 1.0.30

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 (55) hide show
  1. package/README.md +3 -1
  2. package/__tests__/page.test.js +106 -46
  3. package/__tests__/page.test.tsx +117 -45
  4. package/babel.config.js +1 -0
  5. package/components/AddTask/index.js +17 -0
  6. package/components/AddTask/index.tsx +43 -0
  7. package/components/CalendarForWeek.js +50 -0
  8. package/components/CalendarForWeek.tsx +229 -0
  9. package/components/CalendarForday.js +34 -0
  10. package/components/CalendarForday.tsx +130 -0
  11. package/components/DayContainer/index.js +15 -0
  12. package/components/DayContainer/index.tsx +36 -0
  13. package/components/GroupContainer/index.js +15 -0
  14. package/components/GroupContainer/index.tsx +42 -0
  15. package/components/GroupsHeadContainer/index.js +9 -0
  16. package/components/GroupsHeadContainer/index.tsx +19 -0
  17. package/components/SumHoursContainer/index.js +15 -0
  18. package/components/SumHoursContainer/index.tsx +38 -0
  19. package/components/SumHoursHead/index.js +9 -0
  20. package/components/SumHoursHead/index.tsx +22 -0
  21. package/components/TaskContainer/index.js +35 -0
  22. package/components/TaskContainer/index.tsx +86 -0
  23. package/components/TaskList/index.js +5 -0
  24. package/components/TaskList/index.tsx +20 -0
  25. package/contexts/CalendarContext.js +12 -12
  26. package/contexts/CalendarContext.tsx +4 -0
  27. package/definitions/index.js +1 -1
  28. package/definitions/index.ts +668 -7
  29. package/docs/global.html +4982 -4982
  30. package/docs/index.html +474 -474
  31. package/docs/index.ts.html +121 -121
  32. package/docs/scripts/linenumber.js +26 -26
  33. package/docs/scripts/search.js +38 -38
  34. package/docs/styles/iframe.css +12 -12
  35. package/docs/styles/prettify-jsdoc.css +111 -111
  36. package/docs/styles/prettify-tomorrow.css +132 -132
  37. package/docs/styles/reset.css +44 -44
  38. package/hooks/useCalendarDateState.js +19 -0
  39. package/hooks/useCalendarDateState.ts +44 -0
  40. package/index.js +70 -248
  41. package/index.tsx +59 -605
  42. package/jest.config.js +9 -9
  43. package/lib/slyles.js +21 -0
  44. package/lib/slyles.ts +25 -0
  45. package/lib/utils.js +619 -490
  46. package/lib/utils.ts +687 -383
  47. package/out/index.html +128 -128
  48. package/out/scripts/linenumber.js +26 -26
  49. package/out/scripts/search.js +38 -38
  50. package/out/styles/iframe.css +12 -12
  51. package/out/styles/prettify-jsdoc.css +111 -111
  52. package/out/styles/prettify-tomorrow.css +132 -132
  53. package/out/styles/reset.css +44 -44
  54. package/package.json +81 -71
  55. package/style.css +26 -4
package/index.js CHANGED
@@ -1,248 +1,70 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
- import "./style.css";
14
- import { getWeekDays, getDayHourly, calculerEcartSemaine, getSessionStorageRecordForDragAndDrop, sumHoursByGroups, millisecondsToDate, compareWeekOffset, saveTasksToLocalStorage, } from "./lib/utils";
15
- const theadTrStyle = {
16
- color: "#0f5173",
17
- fontWeight: "300",
18
- position: "sticky",
19
- top: 0,
20
- };
21
- const groupTdStyle = {
22
- height: "auto",
23
- width: "150px",
24
- };
25
- const groupContainerStyle = {
26
- width: "100%",
27
- height: "100%",
28
- display: "flex",
29
- alignItems: "center",
30
- justifyContent: "space-between",
31
- gap: "0.75rem", // Correspond à gap-3
32
- padding: "0.75rem", // Correspond à p-3
33
- color: "#0f5173",
34
- cursor: "pointer",
35
- };
36
- /**
37
- * Calendar component to display tasks and groups in a weekly view.
38
- *
39
- * @param {Object} props - The props for the Calendar component.
40
- * @param {React.CSSProperties} [props.style] - Additional styles for the calendar component.
41
- * @param {string} [props.className] - Additional class names for the calendar component.
42
- * @param {Array} props.groups - Array of group data to be displayed in the calendar.
43
- * @param {number} [props.weekOffset] - Offset for the week (e.g., -1 for last week, 0 for current week, 1 for next week).
44
- * @param {Date} props.date - The current date to display in the calendar.
45
- * @param {Function} [props.groupRender] - Custom render function for a group.
46
- * @param {Function} [props.dayRender] - Custom render function for a day.
47
- * @param {React.CSSProperties} [props.rowsStyle] - Additional styles for the rows.
48
- * @param {React.CSSProperties} [props.groupsColsStyle] - Additional styles for the group columns.
49
- * @param {React.CSSProperties} [props.daysColsStyle] - Additional styles for the day columns.
50
- * @param {Function} [props.addTaskRender] - Custom render function for the add task button.
51
- * @param {Function} [props.handleAddTask] - Handler function for adding a new task.
52
- * @param {string} [props.dayClassName] - Additional class names for the days.
53
- * @param {React.CSSProperties} [props.dayStyle] - Additional styles for the days.
54
- * @param {string} [props.groupClassName] - Additional class names for the groups.
55
- * @param {React.CSSProperties} [props.groupStyle] - Additional styles for the groups.
56
- * @param {string} [props.addTaskClassName] - Additional class names for the add task button.
57
- * @param {React.CSSProperties} [props.addTaskStyle] - Additional styles for the add task button.
58
- * @param {Array} props.tasks - Array of tasks to be displayed in the calendar.
59
- * @param {Function} [props.handleDragTask] - Handler function for dragging a task.
60
- * @param {Function} [props.handleDropTask] - Handler function for dropping a task.
61
- * @param {Function} [props.taskRender] - Custom render function for a task.
62
- * @param {Function} [props.groupsHeadRender] - Custom render function for the groups header.
63
- * @param {Function} [props.sumHoursRender] - Custom render function for the sum of hours.
64
- * @param {Function} [props.sumHoursHeadRender] - Custom render function for the sum of hours header.
65
- * @param {Function} [props.handleDragTaskEnd] - Handler function for ending the drag of a task.
66
- * @param {string} [props.rowsClassName] - Additional class names for the rows.
67
- * @param {string} [props.daysColsClassName] - Additional class names for the day columns.
68
- * @param {string} [props.sumHoursContainerClassName] - Additional class names for the sum hours container.
69
- * @param {React.CSSProperties} [props.sumHoursContainerStyle] - Additional styles for the sum hours container.
70
- * @param {string} [props.groupHeadContainerClassName] - Additional class names for the group head container.
71
- * @param {React.CSSProperties} [props.groupHeadContainerStyle] - Additional styles for the group head container.
72
- * @param {string} [props.groupsColsClassName] - Additional class names for the group columns.
73
- * @param {string} [props.taskContainerClassName] - Additional class names for the task container.
74
- * @param {React.CSSProperties} [props.taskContainerStyle] - Additional styles for the task container.
75
- * @param {string} [props.sumHoursHeadClassName] - Additional class names for the sum hours header.
76
- * @param {React.CSSProperties} [props.sumHoursHeadStyle] - Additional styles for the sum hours header.
77
- * @param {Function} [props.handleClickGroup] - Handler function for clicking a group.
78
- * @param {Function} [props.handleClickTask] - Handler function for clicking a task.
79
- * @returns {JSX.Element} The rendered Calendar component.
80
- */
81
- const Calendar = ({ style, className, groups, weekOffset, date, groupRender, dayRender, rowsStyle, groupsColsStyle, daysColsStyle, addTaskRender, handleAddTask, dayClassName, dayStyle, groupClassName, groupStyle, addTaskClassName, addTaskStyle, tasks, handleDragTask, handleDropTask, taskRender, groupsHeadRender, sumHoursRender, sumHoursHeadRender, handleDragTaskEnd, rowsClassName, daysColsClassName, sumHoursContainerClassName, sumHoursContainerStyle, groupHeadContainerClassName, groupHeadContainerStyle, groupsColsClassName, taskContainerClassName, taskContainerStyle, sumHoursHeadClassName, sumHoursHeadStyle, handleClickGroup, handleClickTask, }) => {
82
- const weekOffsetByDate = calculerEcartSemaine(date);
83
- const weekDays = getWeekDays(weekOffsetByDate || weekOffset || 0);
84
- const dailyHours = getDayHourly(weekOffsetByDate || weekOffset || 0);
85
- const handleDragOver = (event) => {
86
- event.preventDefault();
87
- };
88
- saveTasksToLocalStorage(tasks);
89
- return (_jsxs("table", { className: `planningCalendar ${className}`, style: Object.assign({}, style), children: [_jsx("thead", { children: _jsxs("tr", { className: `${rowsClassName}`, style: Object.assign(Object.assign({}, theadTrStyle), rowsStyle), children: [_jsx("th", { className: "dayTh", children: _jsx(GroupsHeadContainer, { className: `${groupHeadContainerClassName}`, style: groupHeadContainerStyle, groupsHeadRender: groupsHeadRender }) }), weekDays.map((day, i) => (_jsx("th", { className: `${daysColsClassName}`, style: Object.assign({}, daysColsStyle), children: _jsx(DayContainer, { style: dayStyle, className: dayClassName, dayIndex: i, dayRender: dayRender, day: day.day, dayOfTheMonth: day.dayOfTheMonth, dayMonth: day.dayMonth, dayYear: day.dayYear }) }, i))), _jsx("th", { className: "totalTh", children: _jsx(SumHoursHead, { className: sumHoursHeadClassName, style: sumHoursHeadStyle, sumHoursHeadRender: sumHoursHeadRender }) })] }, "") }), _jsx("tbody", { children: groups === null || groups === void 0 ? void 0 : groups.map((group, i) => (_jsxs("tr", { className: `${rowsClassName}`, style: Object.assign({}, rowsStyle), children: [_jsx("td", { className: `${groupsColsClassName}`, style: Object.assign(Object.assign({}, groupTdStyle), groupsColsStyle), children: _jsx(GroupContainer, { style: groupStyle, className: groupClassName, groupRender: groupRender, currentGroup: group, handleClickGroup: handleClickGroup }) }, i), dailyHours.map((_, positionDay) => (_jsx("td", { onDragOver: handleDragOver, onDrop: (event) => {
90
- if (!handleDropTask || !tasks)
91
- return;
92
- const dropInfo = getSessionStorageRecordForDragAndDrop(tasks, positionDay, group.id);
93
- if (!dropInfo)
94
- return;
95
- handleDropTask(event, dropInfo.taskDropStart, dropInfo.taskDropEnd, dropInfo.taskDropDate, group.id, positionDay, dropInfo.newTask, dropInfo.newTasks);
96
- }, id: `td-${group.id}day-i`, children: _jsxs("div", { style: {
97
- display: "flex",
98
- width: "100%",
99
- height: "100%",
100
- flexDirection: "column",
101
- padding: "5px",
102
- }, children: [_jsx(_Fragment, { children: tasks === null || tasks === void 0 ? void 0 : tasks.filter((task) => task.dayIndex === positionDay &&
103
- task.groupId === group.id &&
104
- compareWeekOffset(date, weekOffset || 0, task.taskDate)).sort((a, b) => a.taskStart - b.taskStart).map((task, taskKey) => {
105
- return (_jsx(TaskContainer, { handleDragTask: handleDragTask, taskRender: taskRender, handleDragTaskEnd: handleDragTaskEnd, style: taskContainerStyle, className: `${taskContainerClassName}`, currentTask: task, handleClickTask: handleClickTask }, `${taskKey} task`));
106
- }) }), _jsx(AddTask, { addTaskStyle: addTaskStyle, addTaskClassName: addTaskClassName, currentGroup: group, dayInfo: dailyHours[positionDay], addTaskRender: addTaskRender, handleAddTask: handleAddTask })] }, positionDay) }, `td-${group.id}day-i${positionDay}`))), _jsx("td", { children: _jsx(SumHoursContainer, { groupId: group.id, tasks: tasks, weekOffset: weekOffset || 0, calendarDate: date, sumHoursRender: sumHoursRender, sumHoursByGroups: sumHoursByGroups(group.id, tasks, weekOffset || 0, date), className: sumHoursContainerClassName, style: sumHoursContainerStyle }) }, `${i}sumHours`)] }, `${i} tr`))) })] }));
107
- };
108
- const SumHoursHead = ({ sumHoursHeadRender, className, style, }) => {
109
- if (sumHoursHeadRender) {
110
- return _jsx(_Fragment, { children: sumHoursHeadRender() });
111
- }
112
- return (_jsx("div", { className: `${className}`, style: Object.assign({ textAlign: "right", marginRight: "5px" }, style), children: "Hours" }));
113
- };
114
- const SumHoursContainer = ({ groupId, tasks, weekOffset, calendarDate, sumHoursByGroups, sumHoursRender, className, style, }) => {
115
- if (sumHoursRender) {
116
- return (_jsx(_Fragment, { children: sumHoursRender({
117
- groupId,
118
- tasks,
119
- weekOffset,
120
- calendarDate,
121
- sumHoursByGroups,
122
- }) }));
123
- }
124
- return (_jsx("div", { style: Object.assign({ textAlign: "right", marginRight: "5px" }, style), className: `${className}`, children: sumHoursByGroups }));
125
- };
126
- const DayContainer = ({ dayIndex, dayOfTheMonth, day, dayMonth, dayYear, dayRender, className, style, }) => {
127
- if (dayRender) {
128
- return (_jsx(_Fragment, { children: dayRender({
129
- dayIndex,
130
- day,
131
- dayOfTheMonth,
132
- dayMonth,
133
- dayYear,
134
- }) }));
135
- }
136
- return (_jsx("div", { className: `${className}`, style: style, children: `${day}. ${dayOfTheMonth}` }));
137
- };
138
- const GroupContainer = ({ className, style, groupRender, currentGroup, handleClickGroup, }) => {
139
- if (groupRender) {
140
- return _jsx(_Fragment, { children: groupRender({ currentGroup }) });
141
- }
142
- const handleClick = () => {
143
- if (!handleClickGroup)
144
- return;
145
- handleClickGroup(currentGroup);
146
- };
147
- return (_jsxs("div", { onClick: handleClick, className: `${className}`, style: Object.assign(Object.assign({}, groupContainerStyle), style), children: [currentGroup.imageUrl && (_jsx("img", { width: 30, height: 30, src: currentGroup.imageUrl, alt: "groupimg" })), _jsx("label", { children: currentGroup.label && currentGroup.label })] }));
148
- };
149
- const AddTask = ({ currentGroup, handleAddTask, addTaskRender, dayInfo, addTaskStyle, addTaskClassName, }) => {
150
- if (addTaskRender) {
151
- return (_jsx(_Fragment, { children: addTaskRender({
152
- currentGroup,
153
- dayInfo,
154
- }) }));
155
- }
156
- const handleClick = () => {
157
- if (!handleAddTask)
158
- return;
159
- handleAddTask(currentGroup, dayInfo);
160
- };
161
- return (_jsx("div", { onClick: handleClick, style: addTaskStyle, className: `addPlanStyle ${addTaskClassName}`, children: "+" }));
162
- };
163
- const TaskContainer = ({ handleDragTask, taskRender, handleDragTaskEnd, style, className, currentTask, handleClickTask, }) => {
164
- const handleDragStart = (event) => {
165
- if (!handleDragTask)
166
- return;
167
- event.dataTransfer.effectAllowed = "move";
168
- event.dataTransfer.setData("text/plain", currentTask.taskId);
169
- window.sessionStorage.setItem("calendardragtaskId", currentTask.taskId);
170
- window.sessionStorage.setItem("calendardragtaskStart", `${currentTask.taskStart}`);
171
- window.sessionStorage.setItem("calendardragtaskEnd", `${currentTask.taskEnd}`);
172
- window.sessionStorage.setItem("calendardragdayIndex", `${currentTask.dayIndex}`);
173
- handleDragTask(event, currentTask);
174
- };
175
- const handleDragEnd = (event) => {
176
- if (!handleDragTaskEnd)
177
- return;
178
- handleDragTaskEnd(event);
179
- };
180
- const handleClick = () => {
181
- if (!handleClickTask)
182
- return;
183
- handleClickTask(currentTask);
184
- };
185
- if (taskRender) {
186
- return (_jsx("div", { onClick: handleClick, id: currentTask.taskId, className: `taskContainer ${className}`, style: Object.assign({}, style), draggable: true, onDragStart: handleDragStart, onDragEnd: handleDragEnd, children: taskRender({
187
- currentTask,
188
- }) }));
189
- }
190
- return (_jsxs("div", { onClick: handleClick, id: currentTask.taskId, className: `taskContainer ${className}`, style: Object.assign({}, style), draggable: true, onDragStart: handleDragStart, onDragEnd: handleDragEnd, children: [_jsx("p", { className: "tasklabel", children: currentTask.task && currentTask.task }), _jsx("p", { className: "taskhour", children: currentTask.taskStart &&
191
- currentTask.taskEnd &&
192
- `${millisecondsToDate(currentTask.taskStart).formattedDate} - ${millisecondsToDate(currentTask.taskEnd).formattedDate}` })] }));
193
- };
194
- const GroupsHeadContainer = ({ groupsHeadRender, style, className, }) => {
195
- if (groupsHeadRender) {
196
- return _jsx(_Fragment, { children: groupsHeadRender() });
197
- }
198
- return (_jsx("div", { className: `${className}`, style: style, children: "WeeklyCalendar" }));
199
- };
200
- export const updateCalendarDateWithOffset = (offset, calendarDate) => {
201
- const newDate = new Date(calendarDate);
202
- newDate.setDate(newDate.getDate() + offset);
203
- return newDate;
204
- };
205
- export const updateOffsetWithDateCalendar = (calendarDate) => {
206
- return calculerEcartSemaine(calendarDate);
207
- };
208
- export const millisecondsToHours = (milliseconds) => {
209
- return millisecondsToDate(milliseconds).formattedDate;
210
- };
211
- export const checkDuplicates = (tasks, taskStart, taskEnd, groupId) => {
212
- const findDuplicates = tasks === null || tasks === void 0 ? void 0 : tasks.filter((task) => (taskStart >= task.taskStart && taskStart < task.taskEnd) ||
213
- (taskEnd > task.taskStart && taskEnd < task.taskEnd) ||
214
- (taskStart <= task.taskStart &&
215
- taskEnd > task.taskStart &&
216
- taskEnd >= task.taskEnd &&
217
- taskStart <= task.taskEnd)).filter((task) => task.groupId === groupId);
218
- return findDuplicates.length > 0;
219
- };
220
- export const getSavedTasks = () => {
221
- const taskSavedString = window.localStorage.getItem("CalendarTaskSaved");
222
- if (!taskSavedString) {
223
- return [];
224
- }
225
- const tasksTable = JSON.parse(taskSavedString);
226
- const savedTasks = tasksTable.map((task) => {
227
- const { taskDate, taskExpiryDate } = task, rest = __rest(task, ["taskDate", "taskExpiryDate"]);
228
- if (taskExpiryDate) {
229
- return Object.assign({ taskDate: new Date(taskDate), taskExpiryDate: new Date(taskExpiryDate) }, rest);
230
- }
231
- });
232
- return savedTasks;
233
- };
234
- export const deleteTaskSaved = (taskId) => {
235
- const tasksSavedString = window.localStorage.getItem("CalendarTaskSaved");
236
- if (!tasksSavedString)
237
- return;
238
- const tasksSavedTable = JSON.parse(tasksSavedString);
239
- const taskIndex = tasksSavedTable.findIndex((task) => task.taskId === taskId);
240
- if (taskIndex) {
241
- tasksSavedTable.splice(taskIndex, 1);
242
- window.localStorage.setItem("CalendarTaskSaved", JSON.stringify(tasksSavedTable));
243
- }
244
- };
245
- export const deleteTasksSaved = () => {
246
- window.localStorage.removeItem("CalendarTaskSaved");
247
- };
248
- export default Calendar;
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import "./style.css";
3
+ import CalendarForWeek from "./components/CalendarForWeek";
4
+ import CalendarForDay from "./components/CalendarForday";
5
+ /**
6
+ * Calendar component to display tasks and groups in a weekly view.
7
+ *
8
+ * @param {CalendarPropsType} props - The props for the Calendar component.
9
+ * @param {number} [props.weekOffset] - Offset for the week (e.g., -7 for last week, 0 for current week, 7 for next week).
10
+ * @param {GroupFeildsType[]} props.groups - Array of group data to be displayed in the calendar.
11
+ * @param {string} [props.className] - Additional class names for the calendar component.
12
+ * @param {React.CSSProperties} [props.style] - Additional styles for the calendar component.
13
+ * @param {Date} props.date - The current date to display in the calendar.
14
+ * @param {(currentGroup: { currentGroup: GroupFeildsType }) => React.ReactNode} [props.groupRender] - Custom render function for a group.
15
+ * @param {({ dayIndex, day, dayOfTheMonth, dayMonth, dayYear }: { dayIndex: number; day: string; dayOfTheMonth: number; dayMonth: string; dayYear: number }) => React.ReactNode} [props.dayRender] - Custom render function for a day.
16
+ * @param {(currentTask: { currentTask: TaskFeildsType }) => React.ReactNode} [props.taskRender] - Custom render function for a task.
17
+ * @param {React.CSSProperties} [props.rowsStyle] - Additional styles for the rows.
18
+ * @param {string} [props.rowsClassName] - Additional class names for the rows.
19
+ * @param {React.CSSProperties} [props.groupsColsStyle] - Additional styles for the group columns.
20
+ * @param {string} [props.groupsColsClassName] - Additional class names for the group columns.
21
+ * @param {React.CSSProperties} [props.daysColsStyle] - Additional styles for the day columns.
22
+ * @param {string} [props.daysColsClassName] - Additional class names for the day columns.
23
+ * @param {string} [props.addTaskClassName] - Additional class names for the add-task button.
24
+ * @param {React.CSSProperties} [props.addTaskStyle] - Additional styles for the add-task button.
25
+ * @param {string} [props.groupContainerClassName] - Additional class names for the group containers.
26
+ * @param {React.CSSProperties} [props.groupContainerStyle] - Additional styles for the group containers.
27
+ * @param {string} [props.dayClassName] - Additional class names for the day elements.
28
+ * @param {React.CSSProperties} [props.dayStyle] - Additional styles for the day elements.
29
+ * @param {React.CSSProperties} [props.taskContainerStyle] - Additional styles for the task container.
30
+ * @param {string} [props.taskContainerClassName] - Additional class names for the task container.
31
+ * @param {React.CSSProperties} [props.groupHeadContainerStyle] - Additional styles for the group header container.
32
+ * @param {string} [props.groupHeadContainerClassName] - Additional class names for the group header container.
33
+ * @param {React.CSSProperties} [props.sumHoursContainerStyle] - Additional styles for the sum-of-hours container.
34
+ * @param {string} [props.sumHoursContainerClassName] - Additional class names for the sum-of-hours container.
35
+ * @param {React.CSSProperties} [props.sumHoursHeadStyle] - Additional styles for the sum-of-hours header.
36
+ * @param {string} [props.sumHoursHeadClassName] - Additional class names for the sum-of-hours header.
37
+ * @param {(currentGroup: GroupFeildsType, dayInfo: dayInfoType) => void} [props.handleAddTask] - Handler function for adding a new task.
38
+ * @param {({ currentGroup, dayInfo }: { currentGroup: GroupFeildsType; dayInfo: dayInfoType }) => React.ReactNode} [props.addTaskRender] - Custom render function for adding a task.
39
+ * @param {TasksType} props.tasks - Array of tasks to be displayed in the calendar.
40
+ * @param {(event: React.DragEvent<HTMLDivElement>, currentTask: TaskFeildsType) => void} [props.handleDragTask] - Handler function for dragging a task.
41
+ * @param {(event: React.DragEvent<HTMLDivElement>, taskStart: number, taskEnd: number, taskDate: Date, groupId: string, dayIndex: number, newTask: TaskFeildsType, newTasks: TasksType) => void} [props.handleDropTask] - Handler function for dropping a task.
42
+ * @param {(event: React.DragEvent<HTMLDivElement>) => void} [props.handleDragTaskEnd] - Handler function for ending the drag of a task.
43
+ * @param {() => React.ReactNode} [props.groupsHeadRender] - Custom render function for the groups header.
44
+ * @param {({
45
+ * groupId,
46
+ * tasks,
47
+ * weekOffset,
48
+ * calendarDate,
49
+ * sumHoursByGroups
50
+ * }: {
51
+ * groupId: string;
52
+ * tasks: TasksType;
53
+ * weekOffset: number;
54
+ * calendarDate: Date;
55
+ * sumHoursByGroups: number;
56
+ * }) => React.ReactNode} [props.sumHoursRender] - Custom render function for the sum of hours.
57
+ * @param {() => React.ReactNode} [props.sumHoursHeadRender] - Custom render function for the sum-of-hours header.
58
+ * @param {(currentTask: TaskFeildsType) => void} [props.handleClickTask] - Handler function for clicking a task.
59
+ * @param {(currentGroup: GroupFeildsType) => void} [props.handleClickGroup] - Handler function for clicking a group.
60
+ * @param {0|1|2|3|4|5|6} [props.dayOffset] - Offset index for the day column (0 = first day of week, …, 6 = last day).
61
+ * @param {React.CSSProperties} [props.dayColsStyle] - Additional styles for the day columns.
62
+ * @param {string} [props.dayColsClassName] - Additional class names for the day columns.
63
+ * @param {React.CSSProperties} [props.hoursColsStyle] - Additional styles for the hours columns.
64
+ * @param {string} [props.hoursColsClassName] - Additional class names for the hours columns.
65
+ */
66
+ const Calendar = (props) => {
67
+ return (_jsx(_Fragment, { children: _jsx(CalendarForWeek, Object.assign({}, props)) }));
68
+ };
69
+ export default Calendar;
70
+ export { CalendarForDay };