akfatimeline 1.0.6 → 1.2.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/CHANGELOG.md +98 -35
- package/dist/Timeline.js +4309 -1677
- package/dist/components/Timeline/AutocompleteSelect.js +150 -0
- package/dist/components/Timeline/ContextMenu.js +149 -0
- package/dist/components/Timeline/DailyView.js +255 -0
- package/dist/components/Timeline/DatePickerComponent.js +13 -0
- package/{public/dist/dist → dist}/components/Timeline/DragAndDropHandler.js +34 -34
- package/dist/components/Timeline/EventBadge.js +26 -0
- package/dist/components/Timeline/EventDetailModal.js +138 -0
- package/dist/components/Timeline/EventIcon.js +47 -0
- package/dist/{dist/components → components}/Timeline/EventTooltip.js +206 -206
- package/dist/components/Timeline/FilterPanel.js +179 -0
- package/dist/{dist/components → components}/Timeline/Indicator.js +26 -26
- package/dist/components/Timeline/LoadingSpinner.js +48 -0
- package/dist/{dist/components → components}/Timeline/MasterHeader.js +104 -68
- package/{public/dist/dist → dist}/components/Timeline/Resources.js +53 -53
- package/dist/{dist/components → components}/Timeline/ResourcesHeader.js +14 -14
- package/dist/components/Timeline/Timeline.css +2491 -0
- package/dist/components/Timeline/Timeline.js +607 -0
- package/dist/{dist/components → components}/Timeline/TimelineCell.js +8 -8
- package/dist/components/Timeline/TimelineContent.js +838 -0
- package/{public/dist/dist → dist}/components/Timeline/TimelineEvents.js +114 -114
- package/dist/components/Timeline/TimelineHeader.js +54 -0
- package/{public/dist/dist → dist}/components/Timeline/TimelineMonthContainer.js +29 -29
- package/{public/dist/dist → dist}/components/Timeline/TimelineResources.js +16 -16
- package/{public/dist/dist → dist}/hooks/useDragAndDrop.js +80 -80
- package/dist/{dist/hooks → hooks}/useEventDragDrop.js +126 -126
- package/dist/hooks/useEventManagement.js +173 -0
- package/dist/hooks/useEventSelection.js +82 -0
- package/{public/dist/dist → dist}/hooks/useExtendEvent.js +28 -28
- package/dist/hooks/useKeyboardShortcuts.js +158 -0
- package/dist/hooks/useTouchGestures.js +90 -0
- package/dist/utils/conflictUtils.js +105 -0
- package/dist/{dist/utils → utils}/dateUtils.js +36 -36
- package/dist/{dist/utils → utils}/filterTimelineData.js +20 -20
- package/dist/utils/filterUtils.js +106 -0
- package/dist/utils/timeUtils.js +179 -0
- package/dist/{dist/utils → utils}/timelineUtils.js +39 -39
- package/dist/utils/viewModeUtils.js +54 -0
- package/package.json +89 -19
- package/src/App.js +300 -19
- package/src/components/Timeline/AutocompleteSelect.js +150 -0
- package/src/components/Timeline/ContextMenu.js +149 -0
- package/src/components/Timeline/DailyView.js +255 -0
- package/src/components/Timeline/DatePickerComponent.js +13 -17
- package/src/components/Timeline/DragAndDropHandler.js +34 -34
- package/src/components/Timeline/EventBadge.js +26 -0
- package/src/components/Timeline/EventDetailModal.js +138 -0
- package/src/components/Timeline/EventIcon.js +47 -0
- package/src/components/Timeline/EventTooltip.js +206 -206
- package/src/components/Timeline/FilterPanel.js +179 -0
- package/src/components/Timeline/Indicator.js +26 -26
- package/src/components/Timeline/LoadingSpinner.js +48 -0
- package/src/components/Timeline/MasterHeader.js +104 -68
- package/src/components/Timeline/Resources.js +53 -53
- package/src/components/Timeline/ResourcesHeader.js +14 -14
- package/src/components/Timeline/Timeline.css +2491 -616
- package/src/components/Timeline/Timeline.js +607 -309
- package/src/components/Timeline/TimelineCell.js +8 -8
- package/src/components/Timeline/TimelineContent.js +838 -446
- package/src/components/Timeline/TimelineEvents.js +114 -114
- package/src/components/Timeline/TimelineHeader.js +54 -43
- package/src/components/Timeline/TimelineMonthContainer.js +29 -29
- package/src/components/Timeline/TimelineResources.js +16 -16
- package/src/demo.css +4 -0
- package/src/hooks/useDragAndDrop.js +80 -80
- package/src/hooks/useEventDragDrop.js +126 -126
- package/src/hooks/useEventManagement.js +173 -0
- package/src/hooks/useEventSelection.js +82 -0
- package/src/hooks/useExtendEvent.js +28 -28
- package/src/hooks/useKeyboardShortcuts.js +158 -0
- package/src/hooks/useTouchGestures.js +90 -0
- package/src/index.js +1 -7
- package/src/library.js +26 -0
- package/src/utils/conflictUtils.js +105 -0
- package/src/utils/dateUtils.js +36 -36
- package/src/utils/filterTimelineData.js +20 -20
- package/src/utils/filterUtils.js +106 -0
- package/src/utils/timeUtils.js +179 -0
- package/src/utils/timelineUtils.js +39 -39
- package/src/utils/viewModeUtils.js +54 -0
- package/.babelrc +0 -6
- package/babel.config.json +0 -4
- package/dist/dist/components/Timeline/DatePickerComponent.js +0 -17
- package/dist/dist/components/Timeline/DragAndDropHandler.js +0 -35
- package/dist/dist/components/Timeline/Resources.js +0 -53
- package/dist/dist/components/Timeline/Timeline.css +0 -616
- package/dist/dist/components/Timeline/Timeline.js +0 -309
- package/dist/dist/components/Timeline/TimelineContent.js +0 -446
- package/dist/dist/components/Timeline/TimelineEvents.js +0 -114
- package/dist/dist/components/Timeline/TimelineHeader.js +0 -43
- package/dist/dist/components/Timeline/TimelineMonthContainer.js +0 -29
- package/dist/dist/components/Timeline/TimelineResources.js +0 -16
- package/dist/dist/hooks/useDragAndDrop.js +0 -80
- package/dist/dist/hooks/useExtendEvent.js +0 -28
- package/public/dist/Timeline.js +0 -3277
- package/public/dist/dist/components/Timeline/DatePickerComponent.js +0 -17
- package/public/dist/dist/components/Timeline/EventTooltip.js +0 -206
- package/public/dist/dist/components/Timeline/Indicator.js +0 -29
- package/public/dist/dist/components/Timeline/MasterHeader.js +0 -68
- package/public/dist/dist/components/Timeline/ResourcesHeader.js +0 -14
- package/public/dist/dist/components/Timeline/Timeline.css +0 -616
- package/public/dist/dist/components/Timeline/Timeline.js +0 -304
- package/public/dist/dist/components/Timeline/TimelineCell.js +0 -8
- package/public/dist/dist/components/Timeline/TimelineContent.js +0 -447
- package/public/dist/dist/components/Timeline/TimelineHeader.js +0 -43
- package/public/dist/dist/hooks/useEventDragDrop.js +0 -126
- package/public/dist/dist/utils/HorizontalVirtualScroll.js +0 -0
- package/public/dist/dist/utils/dateUtils.js +0 -36
- package/public/dist/dist/utils/filterTimelineData.js +0 -21
- package/public/dist/dist/utils/timelineUtils.js +0 -40
- package/public/favicon.ico +0 -0
- package/public/index kutuphane /304/261c/304/261n.html" +0 -43
- package/public/index tasarim icin.html +0 -20
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/src/App.css +0 -38
- package/src/App.test.js +0 -8
- package/src/dist/Timeline.js +0 -277
- package/src/index.css +0 -13
- package/src/logo.svg +0 -1
- package/src/reportWebVitals.js +0 -13
- package/src/setupTests.js +0 -5
- package/webpack.config.js +0 -49
- /package/dist/{dist/utils → utils}/HorizontalVirtualScroll.js +0 -0
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// src/utils/timelineUtils.js
|
|
2
|
-
|
|
3
|
-
export const generateTimelineData = (startYear, endYear) => {
|
|
4
|
-
const dayNames = ["Paz", "Pzt", "Sal", "Çar", "Per", "Cum", "Cmt"];
|
|
5
|
-
const monthNames = [
|
|
6
|
-
"Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran",
|
|
7
|
-
"Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık",
|
|
8
|
-
];
|
|
9
|
-
|
|
10
|
-
const dates = [];
|
|
11
|
-
const monthHeaders = [];
|
|
12
|
-
|
|
13
|
-
for (let year = startYear; year <= endYear; year++) {
|
|
14
|
-
for (let month = 1; month <= 12; month++) {
|
|
15
|
-
const daysInMonth = new Date(year, month, 0).getDate();
|
|
16
|
-
const startIndex = dates.length;
|
|
17
|
-
|
|
18
|
-
for (let day = 1; day <= daysInMonth; day++) {
|
|
19
|
-
const date = new Date(year, month - 1, day);
|
|
20
|
-
const dayName = dayNames[date.getDay()];
|
|
21
|
-
dates.push({
|
|
22
|
-
fullDate: date,
|
|
23
|
-
display: `${day} ${dayName}`,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const endIndex = dates.length - 1;
|
|
28
|
-
monthHeaders.push({
|
|
29
|
-
monthName: monthNames[month - 1],
|
|
30
|
-
year,
|
|
31
|
-
startIndex,
|
|
32
|
-
endIndex,
|
|
33
|
-
totalDays: endIndex - startIndex + 1,
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return { dates, monthHeaders };
|
|
39
|
-
};
|
|
40
|
-
|
package/public/favicon.ico
DELETED
|
Binary file
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<meta name="theme-color" content="#000000" />
|
|
8
|
-
<meta
|
|
9
|
-
name="description"
|
|
10
|
-
content="Web site created using create-react-app"
|
|
11
|
-
/>
|
|
12
|
-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
|
13
|
-
<!--
|
|
14
|
-
manifest.json provides metadata used when your web app is installed on a
|
|
15
|
-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
16
|
-
-->
|
|
17
|
-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
18
|
-
<!--
|
|
19
|
-
Notice the use of %PUBLIC_URL% in the tags above.
|
|
20
|
-
It will be replaced with the URL of the `public` folder during the build.
|
|
21
|
-
Only files inside the `public` folder can be referenced from the HTML.
|
|
22
|
-
|
|
23
|
-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
|
24
|
-
work correctly both with client-side routing and a non-root public URL.
|
|
25
|
-
Learn how to configure a non-root public URL by running `npm run build`.
|
|
26
|
-
-->
|
|
27
|
-
<title>React App</title>
|
|
28
|
-
</head>
|
|
29
|
-
<body>
|
|
30
|
-
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
31
|
-
<div id="root"></div>
|
|
32
|
-
<!--
|
|
33
|
-
This HTML file is a template.
|
|
34
|
-
If you open it directly in the browser, you will see an empty page.
|
|
35
|
-
|
|
36
|
-
You can add webfonts, meta tags, or analytics to this file.
|
|
37
|
-
The build step will place the bundled scripts into the <body> tag.
|
|
38
|
-
|
|
39
|
-
To begin the development, run `npm start` or `yarn start`.
|
|
40
|
-
To create a production bundle, use `npm run build` or `yarn build`.
|
|
41
|
-
-->
|
|
42
|
-
</body>
|
|
43
|
-
</html>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<link rel="icon" href="/favicon.ico" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<meta name="theme-color" content="#000000" />
|
|
8
|
-
<meta
|
|
9
|
-
name="description"
|
|
10
|
-
content="Web site created using create-react-app"
|
|
11
|
-
/>
|
|
12
|
-
<link rel="apple-touch-icon" href="/logo192.png" />
|
|
13
|
-
<link rel="manifest" href="/manifest.json" />
|
|
14
|
-
<title>React App</title>
|
|
15
|
-
</head>
|
|
16
|
-
<body>
|
|
17
|
-
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
18
|
-
<div id="root"></div>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
package/public/index.html
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<meta name="theme-color" content="#000000" />
|
|
8
|
-
<meta
|
|
9
|
-
name="description"
|
|
10
|
-
content="Web site created using create-react-app"
|
|
11
|
-
/>
|
|
12
|
-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
|
13
|
-
<!--
|
|
14
|
-
manifest.json provides metadata used when your web app is installed on a
|
|
15
|
-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
16
|
-
-->
|
|
17
|
-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
18
|
-
<!--
|
|
19
|
-
Notice the use of %PUBLIC_URL% in the tags above.
|
|
20
|
-
It will be replaced with the URL of the `public` folder during the build.
|
|
21
|
-
Only files inside the `public` folder can be referenced from the HTML.
|
|
22
|
-
|
|
23
|
-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
|
24
|
-
work correctly both with client-side routing and a non-root public URL.
|
|
25
|
-
Learn how to configure a non-root public URL by running `npm run build`.
|
|
26
|
-
-->
|
|
27
|
-
<title>React App</title>
|
|
28
|
-
</head>
|
|
29
|
-
<body>
|
|
30
|
-
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
31
|
-
<div id="root"></div>
|
|
32
|
-
<!--
|
|
33
|
-
This HTML file is a template.
|
|
34
|
-
If you open it directly in the browser, you will see an empty page.
|
|
35
|
-
|
|
36
|
-
You can add webfonts, meta tags, or analytics to this file.
|
|
37
|
-
The build step will place the bundled scripts into the <body> tag.
|
|
38
|
-
|
|
39
|
-
To begin the development, run `npm start` or `yarn start`.
|
|
40
|
-
To create a production bundle, use `npm run build` or `yarn build`.
|
|
41
|
-
-->
|
|
42
|
-
</body>
|
|
43
|
-
</html>
|
package/public/logo192.png
DELETED
|
Binary file
|
package/public/logo512.png
DELETED
|
Binary file
|
package/public/manifest.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"short_name": "React App",
|
|
3
|
-
"name": "Create React App Sample",
|
|
4
|
-
"icons": [
|
|
5
|
-
{
|
|
6
|
-
"src": "favicon.ico",
|
|
7
|
-
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
-
"type": "image/x-icon"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"src": "logo192.png",
|
|
12
|
-
"type": "image/png",
|
|
13
|
-
"sizes": "192x192"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"src": "logo512.png",
|
|
17
|
-
"type": "image/png",
|
|
18
|
-
"sizes": "512x512"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"start_url": ".",
|
|
22
|
-
"display": "standalone",
|
|
23
|
-
"theme_color": "#000000",
|
|
24
|
-
"background_color": "#ffffff"
|
|
25
|
-
}
|
package/public/robots.txt
DELETED
package/src/App.css
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
.App {
|
|
2
|
-
text-align: center;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.App-logo {
|
|
6
|
-
height: 40vmin;
|
|
7
|
-
pointer-events: none;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
11
|
-
.App-logo {
|
|
12
|
-
animation: App-logo-spin infinite 20s linear;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.App-header {
|
|
17
|
-
background-color: #282c34;
|
|
18
|
-
min-height: 100vh;
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
align-items: center;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
font-size: calc(10px + 2vmin);
|
|
24
|
-
color: white;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.App-link {
|
|
28
|
-
color: #61dafb;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@keyframes App-logo-spin {
|
|
32
|
-
from {
|
|
33
|
-
transform: rotate(0deg);
|
|
34
|
-
}
|
|
35
|
-
to {
|
|
36
|
-
transform: rotate(360deg);
|
|
37
|
-
}
|
|
38
|
-
}
|
package/src/App.test.js
DELETED
package/src/dist/Timeline.js
DELETED
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from "react";
|
|
2
|
-
import MasterHeader from "./MasterHeader";
|
|
3
|
-
import ResourcesHeader from "./ResourcesHeader";
|
|
4
|
-
import Resources from "./Resources";
|
|
5
|
-
import TimelineHeader from "./TimelineHeader";
|
|
6
|
-
import TimelineContent from "./TimelineContent";
|
|
7
|
-
import "./Timeline.css";
|
|
8
|
-
import EventTooltip from "./EventTooltip";
|
|
9
|
-
import { generateTimelineData } from "../../utils/timelineUtils";
|
|
10
|
-
|
|
11
|
-
const Timeline = ({
|
|
12
|
-
resources,
|
|
13
|
-
programDate = null,
|
|
14
|
-
events = [],
|
|
15
|
-
resourceSettings = {
|
|
16
|
-
showIdAsName: false,
|
|
17
|
-
isGrouped: true,
|
|
18
|
-
isCollapsible: true,
|
|
19
|
-
},
|
|
20
|
-
indicatorOn = false,
|
|
21
|
-
dropInfo,
|
|
22
|
-
setDropInfo,
|
|
23
|
-
|
|
24
|
-
masterHeaderView = true,
|
|
25
|
-
resourceHeaderContent = "Akfa Timeline",
|
|
26
|
-
eventsDragOn = true,
|
|
27
|
-
eventsExtendOn = true,
|
|
28
|
-
createNewEventOn = true,
|
|
29
|
-
onDragInfo,
|
|
30
|
-
onExtendInfo,
|
|
31
|
-
onCreateEventInfo,
|
|
32
|
-
// İsteğe bağlı event tıklama callback'leri
|
|
33
|
-
onEventClick,
|
|
34
|
-
onEventRightClick,
|
|
35
|
-
|
|
36
|
-
// Yatay scroll özelliği aç/kapa
|
|
37
|
-
horizontalScrollOn = false, // Varsayılan false
|
|
38
|
-
}) => {
|
|
39
|
-
// ---------------------------------------------------------
|
|
40
|
-
// 1) timelineData oluştur (dates, monthHeaders vs.)
|
|
41
|
-
// ---------------------------------------------------------
|
|
42
|
-
const timelineData = generateTimelineData(2020, 2030); // 10 yıllık veri
|
|
43
|
-
const { dates, monthHeaders } = timelineData;
|
|
44
|
-
|
|
45
|
-
// ---------------------------------------------------------
|
|
46
|
-
// 2) local state
|
|
47
|
-
// ---------------------------------------------------------
|
|
48
|
-
const [collapsedGroups, setCollapsedGroups] = useState({});
|
|
49
|
-
const [selectedDate, setSelectedDate] = useState(() => {
|
|
50
|
-
const date = programDate ? new Date(programDate) : new Date();
|
|
51
|
-
date.setDate(date.getDate() - 3);
|
|
52
|
-
return date;
|
|
53
|
-
});
|
|
54
|
-
const [localEvents, setLocalEvents] = useState(events);
|
|
55
|
-
|
|
56
|
-
const [selectedEvent, setSelectedEvent] = useState(null);
|
|
57
|
-
const [tooltipPosition, setTooltipPosition] = useState({ top: 0, left: 0 });
|
|
58
|
-
|
|
59
|
-
// dayRange = ekranda göstermeyi istediğimiz gün/hücre sayısı (ör. 30 gün)
|
|
60
|
-
const [dayRange, setDayRange] = useState(30);
|
|
61
|
-
|
|
62
|
-
const [isDarkMode, setIsDarkMode] = useState(false);
|
|
63
|
-
|
|
64
|
-
// ---------------------------------------------------------
|
|
65
|
-
// 3) Sabit hücre genişliği (örneğin 56.95 px)
|
|
66
|
-
// Container genişliği = dayRange * cellWidth
|
|
67
|
-
// ---------------------------------------------------------
|
|
68
|
-
const cellWidth = 56.95; // her gün/hücre ~57 piksel
|
|
69
|
-
const containerWidth = dayRange * cellWidth;
|
|
70
|
-
// örneğin dayRange=30 => containerWidth=30*56.95=1708.5 px
|
|
71
|
-
|
|
72
|
-
// ---------------------------------------------------------
|
|
73
|
-
// 4) Event Tooltip logic
|
|
74
|
-
// ---------------------------------------------------------
|
|
75
|
-
const handleEventClick = (event, e) => {
|
|
76
|
-
// Harici onEventClick callback'i varsa, önce onu tetikleyelim
|
|
77
|
-
if (onEventClick) {
|
|
78
|
-
onEventClick(event, e);
|
|
79
|
-
}
|
|
80
|
-
// Ardından tooltip göstermek istiyorsak:
|
|
81
|
-
const eventElement = e.currentTarget;
|
|
82
|
-
if (eventElement) {
|
|
83
|
-
const rect = eventElement.getBoundingClientRect();
|
|
84
|
-
setTooltipPosition({
|
|
85
|
-
top: rect.top + window.scrollY,
|
|
86
|
-
left: rect.left + rect.width / 2 + window.scrollX,
|
|
87
|
-
});
|
|
88
|
-
setSelectedEvent(event);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const handleCloseTooltip = () => {
|
|
93
|
-
setSelectedEvent(null);
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
// ---------------------------------------------------------
|
|
97
|
-
// 5) Tarih filtreleme => filteredDates
|
|
98
|
-
// ---------------------------------------------------------
|
|
99
|
-
const startIndex = dates.findIndex((d) => d.fullDate >= selectedDate);
|
|
100
|
-
const endIndex = startIndex + dayRange;
|
|
101
|
-
const filteredDates =
|
|
102
|
-
startIndex !== -1 ? dates.slice(startIndex, Math.min(endIndex, dates.length)) : [];
|
|
103
|
-
|
|
104
|
-
const today = programDate ? new Date(programDate) : new Date();
|
|
105
|
-
const todayIndex = filteredDates.findIndex(
|
|
106
|
-
(d) => new Date(d.fullDate).toDateString() === today.toDateString()
|
|
107
|
-
);
|
|
108
|
-
const totalDays = filteredDates.length;
|
|
109
|
-
|
|
110
|
-
// ---------------------------------------------------------
|
|
111
|
-
// 6) Grupları aç/kapa
|
|
112
|
-
// ---------------------------------------------------------
|
|
113
|
-
const toggleGroupCollapse = (groupName) => {
|
|
114
|
-
setCollapsedGroups((prev) => ({
|
|
115
|
-
...prev,
|
|
116
|
-
[groupName]: !prev[groupName],
|
|
117
|
-
}));
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
// ---------------------------------------------------------
|
|
121
|
-
// 7) Navigation fonksiyonları
|
|
122
|
-
// ---------------------------------------------------------
|
|
123
|
-
const handleToday = () => {
|
|
124
|
-
const date = programDate ? new Date(programDate) : new Date();
|
|
125
|
-
date.setDate(date.getDate() - 3);
|
|
126
|
-
setSelectedDate(date);
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
const handleAdvance = () =>
|
|
130
|
-
setSelectedDate((prev) => new Date(prev.getTime() + 5 * 24 * 60 * 60 * 1000));
|
|
131
|
-
|
|
132
|
-
const handleRetreat = () =>
|
|
133
|
-
setSelectedDate((prev) => new Date(prev.getTime() - 5 * 24 * 60 * 60 * 1000));
|
|
134
|
-
|
|
135
|
-
const handleMonthRetreat = () =>
|
|
136
|
-
setSelectedDate((prev) => {
|
|
137
|
-
const newDate = new Date(prev);
|
|
138
|
-
newDate.setMonth(newDate.getMonth() - 1);
|
|
139
|
-
return newDate;
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
const handleMonthAdvance = () =>
|
|
143
|
-
setSelectedDate((prev) => {
|
|
144
|
-
const newDate = new Date(prev);
|
|
145
|
-
newDate.setMonth(newDate.getMonth() + 1);
|
|
146
|
-
return newDate;
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
// ---------------------------------------------------------
|
|
150
|
-
// 8) Dark Mode
|
|
151
|
-
// ---------------------------------------------------------
|
|
152
|
-
const toggleDarkMode = () => {
|
|
153
|
-
setIsDarkMode((prevMode) => !prevMode);
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
useEffect(() => {
|
|
157
|
-
document.body.classList.toggle("dark-mode", isDarkMode);
|
|
158
|
-
}, [isDarkMode]);
|
|
159
|
-
|
|
160
|
-
// ---------------------------------------------------------
|
|
161
|
-
// 9) Ay başlıklarını filtrele
|
|
162
|
-
// ---------------------------------------------------------
|
|
163
|
-
const filteredMonthHeaders = monthHeaders
|
|
164
|
-
.map((header) => {
|
|
165
|
-
const adjustedStartIndex = Math.max(header.startIndex, startIndex);
|
|
166
|
-
const adjustedEndIndex = Math.min(header.endIndex, endIndex - 1);
|
|
167
|
-
return {
|
|
168
|
-
...header,
|
|
169
|
-
startIndex: adjustedStartIndex,
|
|
170
|
-
endIndex: adjustedEndIndex,
|
|
171
|
-
};
|
|
172
|
-
})
|
|
173
|
-
.filter((header) => header.startIndex <= header.endIndex);
|
|
174
|
-
|
|
175
|
-
// ---------------------------------------------------------
|
|
176
|
-
// 10) Return
|
|
177
|
-
// ---------------------------------------------------------
|
|
178
|
-
return (
|
|
179
|
-
<div className={`timeline-container ${isDarkMode ? "dark-mode" : ""}`}>
|
|
180
|
-
{/* Üst kısım: MasterHeader */}
|
|
181
|
-
{masterHeaderView && (
|
|
182
|
-
<div className="timeline-master-header">
|
|
183
|
-
<MasterHeader
|
|
184
|
-
onToday={handleToday}
|
|
185
|
-
onAdvance={handleAdvance}
|
|
186
|
-
onRetreat={handleRetreat}
|
|
187
|
-
onMonthAdvance={handleMonthAdvance}
|
|
188
|
-
onMonthRetreat={handleMonthRetreat}
|
|
189
|
-
dayRange={dayRange}
|
|
190
|
-
setDayRange={setDayRange} // dayRange'ı burada user değiştirebilir
|
|
191
|
-
isDarkMode={isDarkMode}
|
|
192
|
-
toggleDarkMode={toggleDarkMode}
|
|
193
|
-
/>
|
|
194
|
-
</div>
|
|
195
|
-
)}
|
|
196
|
-
{/* Body: Sol kısım => Resources, Sağ kısım => timeline */}
|
|
197
|
-
<div className="timeline-body">
|
|
198
|
-
<div className="timeline-resources-container">
|
|
199
|
-
<ResourcesHeader content={resourceHeaderContent} />
|
|
200
|
-
<Resources
|
|
201
|
-
groupedResources={resources}
|
|
202
|
-
toggleGroupCollapse={toggleGroupCollapse}
|
|
203
|
-
collapsedGroups={collapsedGroups}
|
|
204
|
-
resourceSettings={resourceSettings}
|
|
205
|
-
/>
|
|
206
|
-
</div>
|
|
207
|
-
|
|
208
|
-
{/*
|
|
209
|
-
Dış kap => .timeline-scrollable-container
|
|
210
|
-
horizontalScrollOn => overflow-x auto/hidden
|
|
211
|
-
*/}
|
|
212
|
-
<div
|
|
213
|
-
className="timeline-scrollable-container"
|
|
214
|
-
style={{
|
|
215
|
-
overflowX: horizontalScrollOn ? "auto" : "hidden",
|
|
216
|
-
}}
|
|
217
|
-
>
|
|
218
|
-
{/*
|
|
219
|
-
İç kap => .timeline-header-content-wrapper
|
|
220
|
-
Genişlik => dayRange * cellWidth px (eğer horizontalScrollOn=true)
|
|
221
|
-
Yoksa 100% (scroll devre dışı)
|
|
222
|
-
*/}
|
|
223
|
-
<div
|
|
224
|
-
className="timeline-header-content-wrapper"
|
|
225
|
-
style={{
|
|
226
|
-
width: horizontalScrollOn ? `${containerWidth}px` : "100%",
|
|
227
|
-
}}
|
|
228
|
-
>
|
|
229
|
-
<TimelineHeader
|
|
230
|
-
dates={filteredDates}
|
|
231
|
-
monthHeaders={filteredMonthHeaders}
|
|
232
|
-
/>
|
|
233
|
-
|
|
234
|
-
<TimelineContent
|
|
235
|
-
// Props
|
|
236
|
-
groupedResources={resources}
|
|
237
|
-
dates={filteredDates}
|
|
238
|
-
collapsedGroups={collapsedGroups}
|
|
239
|
-
events={localEvents}
|
|
240
|
-
setEvents={setLocalEvents}
|
|
241
|
-
onEventClick={handleEventClick}
|
|
242
|
-
todayIndex={todayIndex}
|
|
243
|
-
totalDays={totalDays}
|
|
244
|
-
indicatorOn={indicatorOn}
|
|
245
|
-
resourceSettings={resourceSettings}
|
|
246
|
-
toggleGroupCollapse={toggleGroupCollapse}
|
|
247
|
-
setDropInfo={setDropInfo}
|
|
248
|
-
|
|
249
|
-
// Yeni prop'lar
|
|
250
|
-
eventsDragOn={eventsDragOn}
|
|
251
|
-
eventsExtendOn={eventsExtendOn}
|
|
252
|
-
createNewEventOn={createNewEventOn}
|
|
253
|
-
onDragInfo={onDragInfo}
|
|
254
|
-
onExtendInfo={onExtendInfo}
|
|
255
|
-
onCreateEventInfo={onCreateEventInfo}
|
|
256
|
-
onEventRightClick={onEventRightClick}
|
|
257
|
-
/>
|
|
258
|
-
|
|
259
|
-
{/* Tooltip */}
|
|
260
|
-
{selectedEvent && (
|
|
261
|
-
<EventTooltip
|
|
262
|
-
event={selectedEvent}
|
|
263
|
-
position={tooltipPosition}
|
|
264
|
-
onClose={handleCloseTooltip}
|
|
265
|
-
onDelete={(eventId) =>
|
|
266
|
-
setLocalEvents((prev) => prev.filter((e) => e.id !== eventId))
|
|
267
|
-
}
|
|
268
|
-
/>
|
|
269
|
-
)}
|
|
270
|
-
</div>
|
|
271
|
-
</div>
|
|
272
|
-
</div>
|
|
273
|
-
</div>
|
|
274
|
-
);
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
export default Timeline;
|
package/src/index.css
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
body {
|
|
2
|
-
margin: 0;
|
|
3
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
|
4
|
-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
5
|
-
sans-serif;
|
|
6
|
-
-webkit-font-smoothing: antialiased;
|
|
7
|
-
-moz-osx-font-smoothing: grayscale;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
code {
|
|
11
|
-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
|
12
|
-
monospace;
|
|
13
|
-
}
|
package/src/logo.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
|
package/src/reportWebVitals.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const reportWebVitals = onPerfEntry => {
|
|
2
|
-
if (onPerfEntry && onPerfEntry instanceof Function) {
|
|
3
|
-
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
|
4
|
-
getCLS(onPerfEntry);
|
|
5
|
-
getFID(onPerfEntry);
|
|
6
|
-
getFCP(onPerfEntry);
|
|
7
|
-
getLCP(onPerfEntry);
|
|
8
|
-
getTTFB(onPerfEntry);
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default reportWebVitals;
|
package/src/setupTests.js
DELETED
package/webpack.config.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
mode: "production", // Üretim modu
|
|
6
|
-
entry: "./src/components/Timeline/Timeline.js", // Ana giriş dosyası
|
|
7
|
-
output: {
|
|
8
|
-
path: path.resolve(__dirname, "dist"), // Çıkış klasörü
|
|
9
|
-
filename: "Timeline.js", // Ana çıkış dosyası
|
|
10
|
-
library: "AkfaTimeline", // Kütüphane adı
|
|
11
|
-
libraryTarget: "umd", // Evrensel modül formatı
|
|
12
|
-
globalObject: "this",
|
|
13
|
-
},
|
|
14
|
-
resolve: {
|
|
15
|
-
extensions: [".js", ".jsx"], // Çözülebilecek dosya türleri
|
|
16
|
-
},
|
|
17
|
-
module: {
|
|
18
|
-
rules: [
|
|
19
|
-
{
|
|
20
|
-
test: /\.(js|jsx)$/, // JavaScript ve JSX dosyaları için
|
|
21
|
-
exclude: /node_modules/,
|
|
22
|
-
use: {
|
|
23
|
-
loader: "babel-loader",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
test: /\.css$/, // CSS dosyaları için
|
|
28
|
-
use: ["style-loader", "css-loader"],
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
optimization: {
|
|
33
|
-
minimize: false, // Terser'i devre dışı bırakıyoruz
|
|
34
|
-
},
|
|
35
|
-
externals: {
|
|
36
|
-
react: "react", // React ve ReactDOM'u dışa bırak
|
|
37
|
-
"react-dom": "react-dom",
|
|
38
|
-
},
|
|
39
|
-
plugins: [
|
|
40
|
-
// Gerekli dosyaları dist klasörüne kopyala
|
|
41
|
-
new CopyWebpackPlugin({
|
|
42
|
-
patterns: [
|
|
43
|
-
{ from: "src/components/Timeline", to: "dist/components/Timeline" },
|
|
44
|
-
{ from: "src/hooks", to: "dist/hooks" },
|
|
45
|
-
{ from: "src/utils", to: "dist/utils" },
|
|
46
|
-
],
|
|
47
|
-
}),
|
|
48
|
-
],
|
|
49
|
-
};
|
|
File without changes
|