akfatimeline 1.0.0 → 1.0.4
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/.babelrc +6 -0
- package/CHANGELOG.md +35 -0
- package/dist/Timeline.js +2292 -0
- package/dist/dist/components/Timeline/DragAndDropHandler.js +35 -0
- package/dist/dist/components/Timeline/EventTooltip.js +206 -0
- package/dist/dist/components/Timeline/Indicator.js +30 -0
- package/dist/dist/components/Timeline/MasterHeader.js +55 -0
- package/dist/dist/components/Timeline/Resources.js +53 -0
- package/dist/dist/components/Timeline/ResourcesHeader.js +14 -0
- package/dist/dist/components/Timeline/Timeline.css +534 -0
- package/dist/dist/components/Timeline/Timeline.js +277 -0
- package/dist/dist/components/Timeline/TimelineCell.js +8 -0
- package/dist/dist/components/Timeline/TimelineContent.js +422 -0
- package/dist/dist/components/Timeline/TimelineEvents.js +114 -0
- package/dist/dist/components/Timeline/TimelineHeader.js +43 -0
- package/dist/dist/components/Timeline/TimelineMonthContainer.js +29 -0
- package/dist/dist/components/Timeline/TimelineResources.js +16 -0
- package/dist/dist/hooks/useDragAndDrop.js +80 -0
- package/dist/dist/hooks/useEventDragDrop.js +120 -0
- package/dist/dist/hooks/useExtendEvent.js +28 -0
- package/dist/dist/utils/HorizontalVirtualScroll.js +0 -0
- package/dist/dist/utils/dateUtils.js +36 -0
- package/dist/dist/utils/filterTimelineData.js +21 -0
- package/dist/dist/utils/timelineUtils.js +40 -0
- package/package.json +20 -1
- package/public/index kutuphane /304/261c/304/261n.html" +43 -0
- package/public/index tasarim icin.html +20 -0
- package/src/App.js +161 -154
- package/src/components/Timeline/DatePickerComponent.js +17 -0
- package/src/components/Timeline/EventTooltip.js +1 -1
- package/src/components/Timeline/Indicator.js +1 -2
- package/src/components/Timeline/MasterHeader.js +36 -23
- package/src/components/Timeline/Timeline.css +90 -8
- package/src/components/Timeline/Timeline.js +71 -44
- package/src/components/Timeline/TimelineContent.js +154 -129
- package/src/hooks/useEventDragDrop.js +22 -16
- package/webpack.config.js +25 -7
- package/src/App copy.js +0 -185
- package/src/components/Timeline/TimelineContent copy.js +0 -421
package/src/App.js
CHANGED
|
@@ -1,200 +1,207 @@
|
|
|
1
|
-
// Gerekli kütüphaneleri import ediyoruz
|
|
2
1
|
import React, { useState } from "react";
|
|
3
|
-
// Timeline bileşenini import ediyoruz
|
|
4
2
|
import Timeline from "./components/Timeline/Timeline";
|
|
3
|
+
import EventTooltip from "./components/Timeline/EventTooltip"; // Tooltip bileşenini import ediyoruz
|
|
5
4
|
|
|
6
5
|
const App = () => {
|
|
7
|
-
// Timeline başlangıç tarihi (zorunlu, format: "YYYY-MM-DD")
|
|
8
6
|
const programDate = "2025-01-02";
|
|
9
7
|
|
|
10
|
-
// Timeline için etkinliklerin veri listesi
|
|
11
8
|
const events = [
|
|
12
9
|
{
|
|
13
|
-
id: "lux-101-1",
|
|
14
|
-
title: "Room 101
|
|
15
|
-
startDate: new Date("2025-01-01"), // Başlangıç tarihi (zorunlu, JS Date formatı)
|
|
16
|
-
endDate: new Date("2025-01-08"), // Bitiş tarihi (zorunlu, JS Date formatı)
|
|
17
|
-
resourceId: "lux-101", // Hangi kaynağa ait olduğunu belirten ID (zorunlu)
|
|
18
|
-
color: "#ff5733", // Etkinlik için özel renk (isteğe bağlı)
|
|
19
|
-
totalAmount: 500, // Ek alan: Toplam borç (isteğe bağlı)
|
|
20
|
-
amountPaid: 200, // Ek alan: Ödenen miktar (isteğe bağlı)
|
|
21
|
-
status: "Confirmed", // Ek alan: Rezervasyon durumu (isteğe bağlı)
|
|
22
|
-
note: "Misafirler özel talep olarak ekstra yastık istediler.", // Not (isteğe bağlı)
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: "lux-102-1",
|
|
26
|
-
title: "Room 102 Event",
|
|
27
|
-
startDate: new Date("2025-01-02"),
|
|
28
|
-
endDate: new Date("2025-01-04"),
|
|
29
|
-
resourceId: "lux-102",
|
|
30
|
-
color: "#33a1ff",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
id: "lux-103-1",
|
|
34
|
-
title: "Room 103 Event",
|
|
35
|
-
startDate: new Date("2025-01-01"),
|
|
36
|
-
endDate: new Date("2025-01-02"),
|
|
37
|
-
resourceId: "lux-103",
|
|
38
|
-
color: "#33ff57",
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: "fam-201-1",
|
|
42
|
-
title: "Suite 201 Event",
|
|
10
|
+
id: "lux-101-1",
|
|
11
|
+
title: "Room 101 Cleaning",
|
|
43
12
|
startDate: new Date("2025-01-01"),
|
|
44
|
-
endDate: new Date("2025-01-
|
|
45
|
-
resourceId: "
|
|
46
|
-
|
|
13
|
+
endDate: new Date("2025-01-03"),
|
|
14
|
+
resourceId: "lux-101",
|
|
15
|
+
status: "Completed", // Tamamlanmış
|
|
47
16
|
},
|
|
48
17
|
{
|
|
49
|
-
id: "
|
|
50
|
-
title: "
|
|
18
|
+
id: "lux-101-2",
|
|
19
|
+
title: "Room 101 Maintenance",
|
|
51
20
|
startDate: new Date("2025-01-03"),
|
|
52
21
|
endDate: new Date("2025-01-05"),
|
|
53
|
-
resourceId: "
|
|
54
|
-
|
|
22
|
+
resourceId: "lux-101",
|
|
23
|
+
status: "In-progress", // Devam Ediyor
|
|
55
24
|
},
|
|
56
25
|
{
|
|
57
|
-
id: "
|
|
58
|
-
title: "Room
|
|
59
|
-
startDate: new Date("2025-01-
|
|
60
|
-
endDate: new Date("2025-01-
|
|
61
|
-
resourceId: "
|
|
62
|
-
|
|
26
|
+
id: "lux-101-3",
|
|
27
|
+
title: "Room 101 Inspection",
|
|
28
|
+
startDate: new Date("2025-01-05"),
|
|
29
|
+
endDate: new Date("2025-01-07"),
|
|
30
|
+
resourceId: "lux-101",
|
|
31
|
+
status: "Cancelled", // İptal
|
|
63
32
|
},
|
|
64
33
|
{
|
|
65
|
-
id: "
|
|
66
|
-
title: "
|
|
67
|
-
startDate: new Date("2025-01-
|
|
68
|
-
endDate: new Date("2025-01-
|
|
69
|
-
resourceId: "
|
|
70
|
-
|
|
34
|
+
id: "lux-102-1",
|
|
35
|
+
title: "Room 102 Cleaning",
|
|
36
|
+
startDate: new Date("2025-01-07"),
|
|
37
|
+
endDate: new Date("2025-01-10"),
|
|
38
|
+
resourceId: "lux-102",
|
|
39
|
+
status: "Completed",
|
|
71
40
|
},
|
|
72
41
|
{
|
|
73
|
-
id: "
|
|
74
|
-
title: "
|
|
75
|
-
startDate: new Date("2025-01-
|
|
76
|
-
endDate: new Date("2025-01-
|
|
77
|
-
resourceId: "
|
|
78
|
-
|
|
42
|
+
id: "lux-102-2",
|
|
43
|
+
title: "Room 102 Maintenance",
|
|
44
|
+
startDate: new Date("2025-01-10"),
|
|
45
|
+
endDate: new Date("2025-01-15"),
|
|
46
|
+
resourceId: "lux-102",
|
|
47
|
+
status: "In-progress",
|
|
79
48
|
},
|
|
80
|
-
// Diğer etkinlikler...
|
|
81
49
|
];
|
|
50
|
+
|
|
82
51
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
groupName: "Luxury Rooms",
|
|
87
|
-
resources: [
|
|
88
|
-
{ id: "lux-101", name: "Room 101" }, // Kaynak ID ve adı (zorunlu)
|
|
89
|
-
{ id: "lux-102", name: "Room 102" },
|
|
90
|
-
{ id: "lux-103", name: "Room 103" },
|
|
91
|
-
{ id: "lux-104", name: "Room 104" },
|
|
92
|
-
],
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
groupName: "Family Suites",
|
|
52
|
+
|
|
53
|
+
const resources = [
|
|
54
|
+
{
|
|
55
|
+
groupName: "Luxury Rooms",
|
|
96
56
|
resources: [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
57
|
+
{ id: "lux-101", name: "Room 101" },
|
|
58
|
+
{ id: "lux-102", name: "Room 102" },
|
|
59
|
+
{ id: "lux-103", name: "Room 103" },
|
|
60
|
+
{ id: "lux-104", name: "Room 104" },
|
|
61
|
+
{ id: "lux-105", name: "Room 105" },
|
|
62
|
+
{ id: "lux-106", name: "Room 106" },
|
|
63
|
+
{ id: "lux-107", name: "Room 107" },
|
|
64
|
+
{ id: "lux-108", name: "Room 108" },
|
|
65
|
+
{ id: "lux-109", name: "Room 109" },
|
|
66
|
+
{ id: "lux-110", name: "Room 110" },
|
|
101
67
|
],
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
groupName: "
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
groupName: "Deluxe Rooms",
|
|
105
71
|
resources: [
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
72
|
+
{ id: "deluxe-201", name: "Room 201" },
|
|
73
|
+
{ id: "deluxe-202", name: "Room 202" },
|
|
74
|
+
{ id: "deluxe-203", name: "Room 203" },
|
|
75
|
+
{ id: "deluxe-204", name: "Room 204" },
|
|
76
|
+
{ id: "deluxe-205", name: "Room 205" },
|
|
77
|
+
{ id: "deluxe-206", name: "Room 206" },
|
|
78
|
+
{ id: "deluxe-207", name: "Room 207" },
|
|
79
|
+
{ id: "deluxe-208", name: "Room 208" },
|
|
80
|
+
{ id: "deluxe-209", name: "Room 209" },
|
|
81
|
+
{ id: "deluxe-210", name: "Room 210" },
|
|
110
82
|
],
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
groupName: "VIP Exclusive",
|
|
114
|
-
resources: [
|
|
115
|
-
{ id: "vip-401", name: "VIP 401" },
|
|
116
|
-
{ id: "vip-402", name: "VIP 402" },
|
|
117
|
-
{ id: "vip-403", name: "VIP 403" },
|
|
118
|
-
{ id: "vip-404", name: "VIP 404" },
|
|
83
|
+
},
|
|
84
|
+
];
|
|
119
85
|
|
|
120
|
-
],
|
|
121
|
-
},
|
|
122
|
-
];
|
|
123
86
|
|
|
124
|
-
// Kaynak ayarları (isteğe bağlı, varsayılan ayarlar mevcut)
|
|
125
87
|
const resourceSettings = {
|
|
126
|
-
showIdAsName: false,
|
|
127
|
-
isGrouped: true,
|
|
128
|
-
isCollapsible: true,
|
|
88
|
+
showIdAsName: false,
|
|
89
|
+
isGrouped: true,
|
|
90
|
+
isCollapsible: true,
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const eventStyleResolver = (event) => {
|
|
94
|
+
switch (event.status) {
|
|
95
|
+
case "Completed":
|
|
96
|
+
return {
|
|
97
|
+
backgroundColor: "#28a745",
|
|
98
|
+
color: "#fff",
|
|
99
|
+
border: "1px solid #28a745",
|
|
100
|
+
};
|
|
101
|
+
case "In-progress":
|
|
102
|
+
return {
|
|
103
|
+
backgroundColor: "#ffc107",
|
|
104
|
+
color: "#000",
|
|
105
|
+
border: "1px solid #ffc107",
|
|
106
|
+
};
|
|
107
|
+
case "Cancelled":
|
|
108
|
+
return {
|
|
109
|
+
backgroundColor: "#dc3545",
|
|
110
|
+
color: "#fff",
|
|
111
|
+
border: "1px solid #dc3545",
|
|
112
|
+
};
|
|
113
|
+
default:
|
|
114
|
+
return {
|
|
115
|
+
backgroundColor: "#ccc",
|
|
116
|
+
color: "#000",
|
|
117
|
+
border: "1px solid #ccc",
|
|
118
|
+
};
|
|
119
|
+
}
|
|
129
120
|
};
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
const [dayRange, setDayRange] = useState(30);
|
|
124
|
+
const [themeType, setThemeType] = useState("dark");
|
|
130
125
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const handleDragInfo = (dragData) => {
|
|
134
|
-
console.log("Dragged Event Info:", dragData);
|
|
126
|
+
const toggleTheme = () => {
|
|
127
|
+
setThemeType((prev) => (prev === "light" ? "dark" : "light"));
|
|
135
128
|
};
|
|
136
129
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
130
|
+
const handleToday = () => {
|
|
131
|
+
console.log("Bugüne git");
|
|
132
|
+
// Program tarihini bugüne getir
|
|
140
133
|
};
|
|
141
134
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
console.log("New Event Created:", newEventData);
|
|
135
|
+
const handleAdvance = () => {
|
|
136
|
+
console.log("5 gün ileri git");
|
|
145
137
|
};
|
|
146
138
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
console.log("Event clicked:", evt);
|
|
139
|
+
const handleRetreat = () => {
|
|
140
|
+
console.log("5 gün geri git");
|
|
150
141
|
};
|
|
151
142
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
ev.preventDefault(); // Varsayılan sağ tık menüsünü engeller
|
|
155
|
-
console.log("Event right-clicked:", evt);
|
|
143
|
+
const handleMonthAdvance = () => {
|
|
144
|
+
console.log("1 ay ileri git");
|
|
156
145
|
};
|
|
157
146
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const createNewEventOn = true; // true: Yeni etkinlik oluşturma özelliği aktif
|
|
162
|
-
const horizontalScrollOn = true; // true: Yatay kaydırma özelliği aktif
|
|
163
|
-
const [masterHeaderView, setMasterHeaderView] = useState(true); // true: Master Header gösterilir
|
|
164
|
-
const [resourceHeaderContent, setResourceHeaderContent] = useState("Akfa Timeline"); // Resources başlık içeriği
|
|
147
|
+
const handleMonthRetreat = () => {
|
|
148
|
+
console.log("1 ay geri git");
|
|
149
|
+
};
|
|
165
150
|
|
|
151
|
+
const handleDropInfo = (dropInfo) => {
|
|
152
|
+
console.log("Event dropped with info:", dropInfo);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
const handleExtendInfo = (extendedEventInfo) => {
|
|
157
|
+
console.log("Uzatılan etkinlik bilgisi:", extendedEventInfo);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const handleCreateEventInfo = (newEvent) => {
|
|
161
|
+
console.log("Oluşturulan yeni etkinlik bilgisi:", newEvent);
|
|
162
|
+
};
|
|
163
|
+
|
|
166
164
|
return (
|
|
167
|
-
<
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
165
|
+
<div>
|
|
166
|
+
<button onClick={toggleTheme}>
|
|
167
|
+
Temayı Değiştir ({themeType === "dark" ? "Karanlık" : "Aydınlık"})
|
|
168
|
+
</button>
|
|
169
|
+
<div style={{ margin: "20px 0" }}>
|
|
170
|
+
<button onClick={handleToday}>Bugüne Git</button>
|
|
171
|
+
<button onClick={handleRetreat}>5 Gün Geri</button>
|
|
172
|
+
<button onClick={handleAdvance}>5 Gün İleri</button>
|
|
173
|
+
<button onClick={handleMonthRetreat}>1 Ay Geri</button>
|
|
174
|
+
<button onClick={handleMonthAdvance}>1 Ay İleri</button>
|
|
175
|
+
</div>
|
|
176
|
+
<Timeline
|
|
177
|
+
resources={resources}
|
|
178
|
+
resourceSettings={resourceSettings}
|
|
179
|
+
programDate={programDate}
|
|
180
|
+
events={events}
|
|
181
|
+
indicatorOn={true}
|
|
182
|
+
horizontalScrollOn={true}
|
|
183
|
+
dayRange={dayRange}
|
|
184
|
+
setDayRange={setDayRange}
|
|
185
|
+
themeType={themeType} // Tema türü prop olarak geçiliyor
|
|
186
|
+
onToday={handleToday}
|
|
187
|
+
onAdvance={handleAdvance}
|
|
188
|
+
onRetreat={handleRetreat}
|
|
189
|
+
onMonthAdvance={handleMonthAdvance}
|
|
190
|
+
onMonthRetreat={handleMonthRetreat}
|
|
191
|
+
eventTooltipOn={true} // Tooltip'i aktif hale getiriyoruz
|
|
192
|
+
tooltipComponent={EventTooltip} // Tooltip bileşenini belirtiyoruz
|
|
193
|
+
tempEventStyle={{
|
|
194
|
+
backgroundColor: "rgba(235, 0, 235, 0.8)", // Örnek stil
|
|
195
|
+
color: "#fff",
|
|
196
|
+
borderRadius: "40px",
|
|
197
|
+
padding: "5px",
|
|
198
|
+
}}
|
|
199
|
+
eventStyleResolver={eventStyleResolver}
|
|
200
|
+
setDropInfo={handleDropInfo} // Callback'i buradan bağlıyoruz
|
|
201
|
+
onExtendInfo={handleExtendInfo} // Uzatma bilgisi
|
|
202
|
+
onCreateEventInfo={handleCreateEventInfo} // Yeni etkinlik bilgisi
|
|
203
|
+
/>
|
|
204
|
+
</div>
|
|
198
205
|
);
|
|
199
206
|
};
|
|
200
207
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { useRef, useEffect } from "react";
|
|
2
|
+
import flatpickr from "flatpickr";
|
|
3
|
+
import "flatpickr/dist/themes/material_green.css"; // Tema
|
|
4
|
+
|
|
5
|
+
const DatePickerComponent = ({ onDateSelect }) => {
|
|
6
|
+
const pickerRef = useRef();
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
flatpickr(pickerRef.current, {
|
|
10
|
+
onChange: ([selectedDate]) => onDateSelect(selectedDate),
|
|
11
|
+
});
|
|
12
|
+
}, []);
|
|
13
|
+
|
|
14
|
+
return <input type="text" ref={pickerRef} />;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default DatePickerComponent;
|
|
@@ -28,7 +28,7 @@ const EventTooltip = ({ event, position = { top: 0, left: 0 }, onClose, onEdit,
|
|
|
28
28
|
<div
|
|
29
29
|
style={{
|
|
30
30
|
position: "absolute",
|
|
31
|
-
top: top -
|
|
31
|
+
top: top - 200, // Tooltip'in biraz yukarıda görünmesi için
|
|
32
32
|
left: left + 70,
|
|
33
33
|
transform: "translateX(-50%)",
|
|
34
34
|
backgroundColor: "#ffffff",
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// src/components/Timeline/MasterHeader.js
|
|
2
1
|
import React from "react";
|
|
3
2
|
import "./Timeline.css"; // veya MasterHeader.css, eğer ayrı dosyaya koyacaksan
|
|
3
|
+
import "flatpickr/dist/themes/material_green.css"; // Flatpickr Tema
|
|
4
4
|
|
|
5
5
|
const MasterHeader = ({
|
|
6
|
+
selectedDate,
|
|
7
|
+
onDateSelect,
|
|
6
8
|
onToday,
|
|
7
9
|
onAdvance,
|
|
8
10
|
onRetreat,
|
|
@@ -10,44 +12,55 @@ const MasterHeader = ({
|
|
|
10
12
|
onMonthRetreat,
|
|
11
13
|
dayRange,
|
|
12
14
|
setDayRange,
|
|
13
|
-
isDarkMode,
|
|
14
|
-
toggleDarkMode,
|
|
15
15
|
}) => {
|
|
16
|
+
const formattedDate = new Date(
|
|
17
|
+
selectedDate.getTime() + 24 * 60 * 60 * 1000 - selectedDate.getTimezoneOffset() * 60000
|
|
18
|
+
)
|
|
19
|
+
.toISOString()
|
|
20
|
+
.split("T")[0]; // YYYY-MM-DD formatı
|
|
21
|
+
|
|
16
22
|
return (
|
|
17
23
|
<div className="master-header-container">
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
<div className="master-header-buttons">
|
|
25
|
+
<button className="master-header-btn" onClick={onMonthRetreat}>
|
|
26
|
+
1 Ay Geri
|
|
27
|
+
</button>
|
|
28
|
+
|
|
29
|
+
<button className="master-header-btn" onClick={onRetreat}>
|
|
30
|
+
5 Gün Geri
|
|
31
|
+
</button>
|
|
21
32
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
33
|
+
<input
|
|
34
|
+
type="date"
|
|
35
|
+
className="master-header-date-picker"
|
|
36
|
+
value={formattedDate} // Seçili tarih burada gösteriliyor
|
|
37
|
+
onChange={(e) => onDateSelect(e.target.value)} // Tarih seçimi
|
|
38
|
+
onKeyDown={(e) => e.preventDefault()} // Manuel girişleri engelle
|
|
39
|
+
/>
|
|
25
40
|
|
|
26
|
-
<button className="master-header-btn" onClick={onRetreat}>
|
|
27
|
-
5 Gün Geri
|
|
28
|
-
</button>
|
|
29
41
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
42
|
+
<button className="master-header-btn" onClick={onAdvance}>
|
|
43
|
+
5 Gün İleri
|
|
44
|
+
</button>
|
|
33
45
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
46
|
+
<button className="master-header-btn" onClick={onMonthAdvance}>
|
|
47
|
+
1 Ay İleri
|
|
48
|
+
</button>
|
|
49
|
+
|
|
50
|
+
<button className="master-header-btn" onClick={onToday}>
|
|
51
|
+
Bugün
|
|
52
|
+
</button>
|
|
53
|
+
</div>
|
|
37
54
|
|
|
38
55
|
<select
|
|
39
56
|
className="master-header-select"
|
|
40
57
|
value={dayRange}
|
|
41
|
-
onChange={(e) => setDayRange(parseInt(e.target.value))}
|
|
58
|
+
onChange={(e) => setDayRange(parseInt(e.target.value, 10))}
|
|
42
59
|
>
|
|
43
60
|
<option value={30}>30 Gün</option>
|
|
44
61
|
<option value={60}>60 Gün</option>
|
|
45
62
|
<option value={90}>90 Gün</option>
|
|
46
63
|
</select>
|
|
47
|
-
|
|
48
|
-
<button className="master-header-btn" onClick={toggleDarkMode}>
|
|
49
|
-
{isDarkMode ? "Light Mode" : "Dark Mode"}
|
|
50
|
-
</button>
|
|
51
64
|
</div>
|
|
52
65
|
);
|
|
53
66
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* src/components/Timeline/Timeline.css */
|
|
2
|
+
@import "flatpickr/dist/themes/material_green.css";
|
|
2
3
|
|
|
3
4
|
/*
|
|
4
5
|
Temel: "sales sayfası" temasıyla uyumlu renkler,
|
|
@@ -376,31 +377,31 @@
|
|
|
376
377
|
.master-header-container {
|
|
377
378
|
display: flex;
|
|
378
379
|
align-items: center;
|
|
380
|
+
justify-content: space-between; /* Butonlar solda, select sağda */
|
|
379
381
|
padding: 10px;
|
|
380
|
-
|
|
381
382
|
background-color: var(--header-background-color);
|
|
382
383
|
color: var(--header-text-color);
|
|
384
|
+
}
|
|
383
385
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
*/
|
|
386
|
+
.master-header-buttons {
|
|
387
|
+
display: flex; /* Yan yana dizilim */
|
|
388
|
+
align-items: center; /* Dikey hizalama */
|
|
387
389
|
}
|
|
388
390
|
|
|
389
|
-
/* Butonlar */
|
|
390
391
|
.master-header-btn {
|
|
391
392
|
background-color: transparent;
|
|
392
393
|
color: var(--header-text-color);
|
|
393
394
|
border: 1px solid var(--border-color);
|
|
394
395
|
border-radius: 4px;
|
|
395
396
|
padding: 6px 12px;
|
|
396
|
-
margin-right: 10px;
|
|
397
|
+
margin-right: 10px; /* Butonlar arasında mesafe */
|
|
397
398
|
cursor: pointer;
|
|
398
399
|
font-size: 14px;
|
|
399
400
|
transition: background-color 0.2s ease, color 0.2s ease;
|
|
400
401
|
}
|
|
401
402
|
|
|
402
403
|
.master-header-btn:hover {
|
|
403
|
-
background-color: rgba(25, 118, 210, 0.2); /*
|
|
404
|
+
background-color: rgba(25, 118, 210, 0.2); /* Açık tema hover */
|
|
404
405
|
}
|
|
405
406
|
|
|
406
407
|
.dark-mode .master-header-btn:hover {
|
|
@@ -411,9 +412,36 @@
|
|
|
411
412
|
outline: none;
|
|
412
413
|
}
|
|
413
414
|
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
/* Tarih seçici (Date Picker) */
|
|
418
|
+
.master-header-date-picker {
|
|
419
|
+
background-color: transparent;
|
|
420
|
+
color: var(--header-text-color);
|
|
421
|
+
border: 1px solid var(--border-color);
|
|
422
|
+
border-radius: 4px;
|
|
423
|
+
padding: 5px 12px;
|
|
424
|
+
margin-right: 10px; /* Butonlar arasında mesafe */
|
|
425
|
+
cursor: pointer;
|
|
426
|
+
font-size: 14px;
|
|
427
|
+
transition: background-color 0.2s ease, color 0.2s ease;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.master-header-date-picker:hover {
|
|
431
|
+
background-color: rgba(25, 118, 210, 0.2); /* Açık tema hover */
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.dark-mode .master-header-date-picker:hover {
|
|
435
|
+
background-color: rgba(76, 175, 80, 0.2); /* Koyu tema hover */
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.master-header-date-picker:focus {
|
|
439
|
+
outline: none;
|
|
440
|
+
}
|
|
441
|
+
|
|
414
442
|
/* Select */
|
|
415
443
|
.master-header-select {
|
|
416
|
-
margin-left:
|
|
444
|
+
margin-left: auto; /* Sağa yaslamak için */
|
|
417
445
|
background-color: transparent;
|
|
418
446
|
color: var(--header-text-color);
|
|
419
447
|
border: 1px solid var(--border-color);
|
|
@@ -427,6 +455,60 @@
|
|
|
427
455
|
outline: none;
|
|
428
456
|
}
|
|
429
457
|
|
|
458
|
+
/* Flatpickr Takvim Kutusu */
|
|
459
|
+
.flatpickr-calendar {
|
|
460
|
+
background-color: var(--background-color);
|
|
461
|
+
color: var(--text-color);
|
|
462
|
+
border: 1px solid var(--border-color);
|
|
463
|
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* Gölge efekti */
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
/* Flatpickr Günü */
|
|
468
|
+
.flatpickr-day {
|
|
469
|
+
background-color: var(--background-color); /* Arka plan rengi */
|
|
470
|
+
color: var(--text-color); /* Yazı rengi */
|
|
471
|
+
border-radius: 4px; /* Köşeleri yuvarlat */
|
|
472
|
+
cursor: pointer;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.flatpickr-day:hover {
|
|
476
|
+
background-color: rgba(25, 118, 210, 0.2); /* Hover efekti */
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.dark-mode .flatpickr-day:hover {
|
|
480
|
+
background-color: rgba(76, 175, 80, 0.2); /* Koyu tema hover efekti */
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/* Seçili Gün */
|
|
484
|
+
.flatpickr-day.selected {
|
|
485
|
+
background-color: #4caf50; /* Seçili gün rengi */
|
|
486
|
+
color: white; /* Seçili gün yazı rengi */
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/* Flatpickr Ay ve Yıl */
|
|
490
|
+
.flatpickr-months .flatpickr-month {
|
|
491
|
+
background-color: var(--background-color);
|
|
492
|
+
color: var(--text-color);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/* Flatpickr Ay İleri ve Geri Düğmeleri */
|
|
496
|
+
.flatpickr-prev-month, .flatpickr-next-month {
|
|
497
|
+
color: var(--text-color);
|
|
498
|
+
cursor: pointer;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/* Koyu Tema Örnekleri */
|
|
502
|
+
.dark-mode .flatpickr-calendar {
|
|
503
|
+
background-color: #1f2937; /* Koyu tema arka plan */
|
|
504
|
+
color: #ffffff; /* Koyu tema yazı rengi */
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.dark-mode .flatpickr-day.selected {
|
|
508
|
+
background-color: #4caf50;
|
|
509
|
+
color: white;
|
|
510
|
+
}
|
|
511
|
+
|
|
430
512
|
|
|
431
513
|
/* Container */
|
|
432
514
|
.timeline-content-container {
|