From 5e9f6945c3bc064257405496f91e2acdce1164c9 Mon Sep 17 00:00:00 2001 From: MaTeMaTuK Date: Sun, 6 Feb 2022 21:52:49 +0100 Subject: [PATCH 1/2] hour mode, day of week, view date --- .gitignore | 1 + README.md | 2 +- example/src/App.tsx | 2 +- example/src/components/view-switcher.tsx | 6 ++ example/src/setupTests.ts | 2 +- package.json | 2 +- src/components/calendar/calendar.tsx | 66 ++++++++++++++++++-- src/components/gantt/gantt.tsx | 32 ++++++++++ src/components/task-list/task-list-table.tsx | 30 ++++----- src/helpers/date-helper.ts | 26 +++++++- src/types/public-types.ts | 2 + 11 files changed, 145 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 7005be7..ec5078d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ dist npm-debug.log* yarn-debug.log* yarn-error.log* +package-lock.json \ No newline at end of file diff --git a/README.md b/README.md index 87e554e..cc0d0af 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ npm start | onDateChange\* | (task: Task, children: Task[]) => void/boolean/Promise/Promise | Specifies the function to be executed when drag taskbar event on timeline has finished. | | onProgressChange\* | (task: Task, children: Task[]) => void/boolean/Promise/Promise | Specifies the function to be executed when drag taskbar progress event has finished. | | onExpanderClick\* | onExpanderClick: (task: Task) => void; | Specifies the function to be executed on the table expander click | -| timeStep | (task: Task) => number | A time step value for onDateChange. Specify in milliseconds. | +| timeStep | number | A time step value for onDateChange. Specify in milliseconds. | \* Chart undoes operation if method return false or error. Parameter children returns one level deep records. diff --git a/example/src/App.tsx b/example/src/App.tsx index e1843a1..b1115f2 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -9,7 +9,7 @@ const App = () => { const [view, setView] = React.useState(ViewMode.Day); const [tasks, setTasks] = React.useState(initTasks()); const [isChecked, setIsChecked] = React.useState(true); - let columnWidth = 60; + let columnWidth = 65; if (view === ViewMode.Month) { columnWidth = 300; } else if (view === ViewMode.Week) { diff --git a/example/src/components/view-switcher.tsx b/example/src/components/view-switcher.tsx index 44d96ae..cac872c 100644 --- a/example/src/components/view-switcher.tsx +++ b/example/src/components/view-switcher.tsx @@ -13,6 +13,12 @@ export const ViewSwitcher: React.SFC = ({ }) => { return (
+