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.
Files changed (128) hide show
  1. package/CHANGELOG.md +98 -35
  2. package/dist/Timeline.js +4309 -1677
  3. package/dist/components/Timeline/AutocompleteSelect.js +150 -0
  4. package/dist/components/Timeline/ContextMenu.js +149 -0
  5. package/dist/components/Timeline/DailyView.js +255 -0
  6. package/dist/components/Timeline/DatePickerComponent.js +13 -0
  7. package/{public/dist/dist → dist}/components/Timeline/DragAndDropHandler.js +34 -34
  8. package/dist/components/Timeline/EventBadge.js +26 -0
  9. package/dist/components/Timeline/EventDetailModal.js +138 -0
  10. package/dist/components/Timeline/EventIcon.js +47 -0
  11. package/dist/{dist/components → components}/Timeline/EventTooltip.js +206 -206
  12. package/dist/components/Timeline/FilterPanel.js +179 -0
  13. package/dist/{dist/components → components}/Timeline/Indicator.js +26 -26
  14. package/dist/components/Timeline/LoadingSpinner.js +48 -0
  15. package/dist/{dist/components → components}/Timeline/MasterHeader.js +104 -68
  16. package/{public/dist/dist → dist}/components/Timeline/Resources.js +53 -53
  17. package/dist/{dist/components → components}/Timeline/ResourcesHeader.js +14 -14
  18. package/dist/components/Timeline/Timeline.css +2491 -0
  19. package/dist/components/Timeline/Timeline.js +607 -0
  20. package/dist/{dist/components → components}/Timeline/TimelineCell.js +8 -8
  21. package/dist/components/Timeline/TimelineContent.js +838 -0
  22. package/{public/dist/dist → dist}/components/Timeline/TimelineEvents.js +114 -114
  23. package/dist/components/Timeline/TimelineHeader.js +54 -0
  24. package/{public/dist/dist → dist}/components/Timeline/TimelineMonthContainer.js +29 -29
  25. package/{public/dist/dist → dist}/components/Timeline/TimelineResources.js +16 -16
  26. package/{public/dist/dist → dist}/hooks/useDragAndDrop.js +80 -80
  27. package/dist/{dist/hooks → hooks}/useEventDragDrop.js +126 -126
  28. package/dist/hooks/useEventManagement.js +173 -0
  29. package/dist/hooks/useEventSelection.js +82 -0
  30. package/{public/dist/dist → dist}/hooks/useExtendEvent.js +28 -28
  31. package/dist/hooks/useKeyboardShortcuts.js +158 -0
  32. package/dist/hooks/useTouchGestures.js +90 -0
  33. package/dist/utils/conflictUtils.js +105 -0
  34. package/dist/{dist/utils → utils}/dateUtils.js +36 -36
  35. package/dist/{dist/utils → utils}/filterTimelineData.js +20 -20
  36. package/dist/utils/filterUtils.js +106 -0
  37. package/dist/utils/timeUtils.js +179 -0
  38. package/dist/{dist/utils → utils}/timelineUtils.js +39 -39
  39. package/dist/utils/viewModeUtils.js +54 -0
  40. package/package.json +89 -19
  41. package/src/App.js +300 -19
  42. package/src/components/Timeline/AutocompleteSelect.js +150 -0
  43. package/src/components/Timeline/ContextMenu.js +149 -0
  44. package/src/components/Timeline/DailyView.js +255 -0
  45. package/src/components/Timeline/DatePickerComponent.js +13 -17
  46. package/src/components/Timeline/DragAndDropHandler.js +34 -34
  47. package/src/components/Timeline/EventBadge.js +26 -0
  48. package/src/components/Timeline/EventDetailModal.js +138 -0
  49. package/src/components/Timeline/EventIcon.js +47 -0
  50. package/src/components/Timeline/EventTooltip.js +206 -206
  51. package/src/components/Timeline/FilterPanel.js +179 -0
  52. package/src/components/Timeline/Indicator.js +26 -26
  53. package/src/components/Timeline/LoadingSpinner.js +48 -0
  54. package/src/components/Timeline/MasterHeader.js +104 -68
  55. package/src/components/Timeline/Resources.js +53 -53
  56. package/src/components/Timeline/ResourcesHeader.js +14 -14
  57. package/src/components/Timeline/Timeline.css +2491 -616
  58. package/src/components/Timeline/Timeline.js +607 -309
  59. package/src/components/Timeline/TimelineCell.js +8 -8
  60. package/src/components/Timeline/TimelineContent.js +838 -446
  61. package/src/components/Timeline/TimelineEvents.js +114 -114
  62. package/src/components/Timeline/TimelineHeader.js +54 -43
  63. package/src/components/Timeline/TimelineMonthContainer.js +29 -29
  64. package/src/components/Timeline/TimelineResources.js +16 -16
  65. package/src/demo.css +4 -0
  66. package/src/hooks/useDragAndDrop.js +80 -80
  67. package/src/hooks/useEventDragDrop.js +126 -126
  68. package/src/hooks/useEventManagement.js +173 -0
  69. package/src/hooks/useEventSelection.js +82 -0
  70. package/src/hooks/useExtendEvent.js +28 -28
  71. package/src/hooks/useKeyboardShortcuts.js +158 -0
  72. package/src/hooks/useTouchGestures.js +90 -0
  73. package/src/index.js +1 -7
  74. package/src/library.js +26 -0
  75. package/src/utils/conflictUtils.js +105 -0
  76. package/src/utils/dateUtils.js +36 -36
  77. package/src/utils/filterTimelineData.js +20 -20
  78. package/src/utils/filterUtils.js +106 -0
  79. package/src/utils/timeUtils.js +179 -0
  80. package/src/utils/timelineUtils.js +39 -39
  81. package/src/utils/viewModeUtils.js +54 -0
  82. package/.babelrc +0 -6
  83. package/babel.config.json +0 -4
  84. package/dist/dist/components/Timeline/DatePickerComponent.js +0 -17
  85. package/dist/dist/components/Timeline/DragAndDropHandler.js +0 -35
  86. package/dist/dist/components/Timeline/Resources.js +0 -53
  87. package/dist/dist/components/Timeline/Timeline.css +0 -616
  88. package/dist/dist/components/Timeline/Timeline.js +0 -309
  89. package/dist/dist/components/Timeline/TimelineContent.js +0 -446
  90. package/dist/dist/components/Timeline/TimelineEvents.js +0 -114
  91. package/dist/dist/components/Timeline/TimelineHeader.js +0 -43
  92. package/dist/dist/components/Timeline/TimelineMonthContainer.js +0 -29
  93. package/dist/dist/components/Timeline/TimelineResources.js +0 -16
  94. package/dist/dist/hooks/useDragAndDrop.js +0 -80
  95. package/dist/dist/hooks/useExtendEvent.js +0 -28
  96. package/public/dist/Timeline.js +0 -3277
  97. package/public/dist/dist/components/Timeline/DatePickerComponent.js +0 -17
  98. package/public/dist/dist/components/Timeline/EventTooltip.js +0 -206
  99. package/public/dist/dist/components/Timeline/Indicator.js +0 -29
  100. package/public/dist/dist/components/Timeline/MasterHeader.js +0 -68
  101. package/public/dist/dist/components/Timeline/ResourcesHeader.js +0 -14
  102. package/public/dist/dist/components/Timeline/Timeline.css +0 -616
  103. package/public/dist/dist/components/Timeline/Timeline.js +0 -304
  104. package/public/dist/dist/components/Timeline/TimelineCell.js +0 -8
  105. package/public/dist/dist/components/Timeline/TimelineContent.js +0 -447
  106. package/public/dist/dist/components/Timeline/TimelineHeader.js +0 -43
  107. package/public/dist/dist/hooks/useEventDragDrop.js +0 -126
  108. package/public/dist/dist/utils/HorizontalVirtualScroll.js +0 -0
  109. package/public/dist/dist/utils/dateUtils.js +0 -36
  110. package/public/dist/dist/utils/filterTimelineData.js +0 -21
  111. package/public/dist/dist/utils/timelineUtils.js +0 -40
  112. package/public/favicon.ico +0 -0
  113. package/public/index kutuphane /304/261c/304/261n.html" +0 -43
  114. package/public/index tasarim icin.html +0 -20
  115. package/public/index.html +0 -43
  116. package/public/logo192.png +0 -0
  117. package/public/logo512.png +0 -0
  118. package/public/manifest.json +0 -25
  119. package/public/robots.txt +0 -3
  120. package/src/App.css +0 -38
  121. package/src/App.test.js +0 -8
  122. package/src/dist/Timeline.js +0 -277
  123. package/src/index.css +0 -13
  124. package/src/logo.svg +0 -1
  125. package/src/reportWebVitals.js +0 -13
  126. package/src/setupTests.js +0 -5
  127. package/webpack.config.js +0 -49
  128. /package/dist/{dist/utils → utils}/HorizontalVirtualScroll.js +0 -0
@@ -1,206 +1,206 @@
1
- // src/components/Timeline/EventTooltip.js
2
- import React from "react";
3
-
4
- const EventTooltip = ({ event, position = { top: 0, left: 0 }, onClose, onEdit, onDelete }) => {
5
- if (!event) return null;
6
-
7
- const { top, left } = position;
8
-
9
- // Rezervasyon durumuna göre renk belirleme
10
- const getStatusColor = (status) => {
11
- switch (status) {
12
- case "Confirmed":
13
- return "#4caf50"; // Yeşil
14
- case "Pending":
15
- return "#ff9800"; // Turuncu
16
- case "Cancelled":
17
- return "#f44336"; // Kırmızı
18
- case "Completed":
19
- return "#2196f3"; // Mavi
20
- default:
21
- return "#9e9e9e"; // Gri
22
- }
23
- };
24
-
25
- const statusColor = getStatusColor(event.status);
26
-
27
- return (
28
- <div
29
- style={{
30
- position: "absolute",
31
- top: top - 200, // Tooltip'in biraz yukarıda görünmesi için
32
- left: left + 70,
33
- transform: "translateX(-50%)",
34
- backgroundColor: "#ffffff",
35
- color: "#333333",
36
- borderRadius: "10px",
37
- boxShadow: "0 8px 16px rgba(0, 0, 0, 0.2)",
38
- fontSize: "16px",
39
- zIndex: 1000,
40
- pointerEvents: "auto", // Tooltip'in tıklanabilir olmasını sağlar
41
- whiteSpace: "normal",
42
- maxWidth: "400px",
43
- width: "100%",
44
- transition: "opacity 0.3s ease, transform 0.3s ease",
45
- }}
46
- >
47
- {/* Kapatma Butonu */}
48
- {onClose && (
49
- <button
50
- onClick={onClose}
51
- style={{
52
- position: "absolute",
53
- top: "10px",
54
- right: "15px",
55
- background: "transparent",
56
- border: "none",
57
- color: "#aaa",
58
- fontSize: "24px",
59
- cursor: "pointer",
60
- transition: "color 0.2s",
61
- }}
62
- aria-label="Kapat"
63
- onMouseOver={(e) => (e.target.style.color = "#000")}
64
- onMouseOut={(e) => (e.target.style.color = "#aaa")}
65
- >
66
- &times;
67
- </button>
68
- )}
69
-
70
- {/* Header */}
71
- <div
72
- style={{
73
- backgroundColor: statusColor,
74
- color: "#ffffff",
75
- padding: "15px 20px",
76
- borderTopLeftRadius: "10px",
77
- borderTopRightRadius: "10px",
78
- display: "flex",
79
- flexDirection: "column",
80
- gap: "5px",
81
- }}
82
- >
83
- <div style={{ fontWeight: "bold", fontSize: "18px" }}>{event.title}</div>
84
- <div style={{ fontSize: "14px" }}>Rezervasyon ID: {event.reservationId}</div>
85
- </div>
86
-
87
- {/* İçerik */}
88
- <div style={{ padding: "20px", display: "flex", flexDirection: "column", gap: "15px" }}>
89
- {/* Misafirler */}
90
- {Array.isArray(event.guestNames) && (
91
- <div>
92
- <strong>Misafirler:</strong> {event.guestNames.join(", ")}
93
- </div>
94
- )}
95
-
96
- {/* Giriş ve Çıkış Tarihleri */}
97
- <div style={{ display: "flex", justifyContent: "space-between", marginBottom: "10px" }}>
98
- <div>
99
- <strong>Giriş:</strong> {new Date(event.startDate).toLocaleDateString()}
100
- </div>
101
- <div>
102
- <strong>Çıkış:</strong> {new Date(event.endDate).toLocaleDateString()}
103
- </div>
104
- </div>
105
-
106
- {/* Ödeme Bilgileri */}
107
- {(event.totalAmount !== undefined || event.amountPaid !== undefined) && (
108
- <div style={{ display: "flex", justifyContent: "space-between", marginBottom: "10px" }}>
109
- {event.amountPaid !== undefined && (
110
- <div>
111
- <strong>Ödenen Miktar:</strong> ${event.amountPaid.toFixed(2)}
112
- </div>
113
- )}
114
- {event.totalAmount !== undefined && (
115
- <div>
116
- <strong>Toplam Borç:</strong> ${event.totalAmount.toFixed(2)}
117
- </div>
118
- )}
119
- </div>
120
- )}
121
-
122
- {/* Rezervasyon Durumu */}
123
- {event.status && (
124
- <div>
125
- <strong>Durum:</strong> {event.status}
126
- </div>
127
- )}
128
-
129
- {/* Rezervasyon Notu */}
130
- {event.note && (
131
- <div>
132
- <strong>Not:</strong> {event.note}
133
- </div>
134
- )}
135
- </div>
136
-
137
-
138
- {/* Footer */}
139
- <div
140
- style={{
141
- padding: "15px 20px",
142
- borderTop: "1px solid #ddd",
143
- display: "flex",
144
- justifyContent: "flex-end",
145
- gap: "10px",
146
- borderBottomLeftRadius: "10px",
147
- borderBottomRightRadius: "10px",
148
- }}
149
- >
150
- {/* Düzenle Butonu */}
151
- {onEdit && (
152
- <button
153
- onClick={() => onEdit(event)}
154
- style={{
155
- padding: "8px 16px",
156
- backgroundColor: "#2196f3",
157
- color: "#ffffff",
158
- border: "none",
159
- borderRadius: "4px",
160
- cursor: "pointer",
161
- fontSize: "14px",
162
- display: "flex",
163
- alignItems: "center",
164
- gap: "5px",
165
- transition: "background-color 0.2s",
166
- }}
167
- onMouseOver={(e) => (e.target.style.backgroundColor = "#1976d2")}
168
- onMouseOut={(e) => (e.target.style.backgroundColor = "#2196f3")}
169
- >
170
- {/* Düzenle İkonu */}
171
- <span role="img" aria-label="Düzenle">✏️</span>
172
- Düzenle
173
- </button>
174
- )}
175
-
176
- {/* Sil Butonu */}
177
- {onDelete && (
178
- <button
179
- onClick={() => onDelete(event.id)}
180
- style={{
181
- padding: "8px 16px",
182
- backgroundColor: "#f44336",
183
- color: "#ffffff",
184
- border: "none",
185
- borderRadius: "4px",
186
- cursor: "pointer",
187
- fontSize: "14px",
188
- display: "flex",
189
- alignItems: "center",
190
- gap: "5px",
191
- transition: "background-color 0.2s",
192
- }}
193
- onMouseOver={(e) => (e.target.style.backgroundColor = "#d32f2f")}
194
- onMouseOut={(e) => (e.target.style.backgroundColor = "#f44336")}
195
- >
196
- {/* Sil İkonu */}
197
- <span role="img" aria-label="Sil">🗑️</span>
198
- Sil
199
- </button>
200
- )}
201
- </div>
202
- </div>
203
- );
204
- };
205
-
206
- export default EventTooltip;
1
+ // src/components/Timeline/EventTooltip.js
2
+ import React from "react";
3
+
4
+ const EventTooltip = ({ event, position = { top: 0, left: 0 }, onClose, onEdit, onDelete }) => {
5
+ if (!event) return null;
6
+
7
+ const { top, left } = position;
8
+
9
+ // Rezervasyon durumuna göre renk belirleme
10
+ const getStatusColor = (status) => {
11
+ switch (status) {
12
+ case "Confirmed":
13
+ return "#4caf50"; // Yeşil
14
+ case "Pending":
15
+ return "#ff9800"; // Turuncu
16
+ case "Cancelled":
17
+ return "#f44336"; // Kırmızı
18
+ case "Completed":
19
+ return "#2196f3"; // Mavi
20
+ default:
21
+ return "#9e9e9e"; // Gri
22
+ }
23
+ };
24
+
25
+ const statusColor = getStatusColor(event.status);
26
+
27
+ return (
28
+ <div
29
+ style={{
30
+ position: "absolute",
31
+ top: top - 200, // Tooltip'in biraz yukarıda görünmesi için
32
+ left: left + 70,
33
+ transform: "translateX(-50%)",
34
+ backgroundColor: "#ffffff",
35
+ color: "#333333",
36
+ borderRadius: "10px",
37
+ boxShadow: "0 8px 16px rgba(0, 0, 0, 0.2)",
38
+ fontSize: "16px",
39
+ zIndex: 1000,
40
+ pointerEvents: "auto", // Tooltip'in tıklanabilir olmasını sağlar
41
+ whiteSpace: "normal",
42
+ maxWidth: "400px",
43
+ width: "100%",
44
+ transition: "opacity 0.3s ease, transform 0.3s ease",
45
+ }}
46
+ >
47
+ {/* Kapatma Butonu */}
48
+ {onClose && (
49
+ <button
50
+ onClick={onClose}
51
+ style={{
52
+ position: "absolute",
53
+ top: "10px",
54
+ right: "15px",
55
+ background: "transparent",
56
+ border: "none",
57
+ color: "#aaa",
58
+ fontSize: "24px",
59
+ cursor: "pointer",
60
+ transition: "color 0.2s",
61
+ }}
62
+ aria-label="Kapat"
63
+ onMouseOver={(e) => (e.target.style.color = "#000")}
64
+ onMouseOut={(e) => (e.target.style.color = "#aaa")}
65
+ >
66
+ &times;
67
+ </button>
68
+ )}
69
+
70
+ {/* Header */}
71
+ <div
72
+ style={{
73
+ backgroundColor: statusColor,
74
+ color: "#ffffff",
75
+ padding: "15px 20px",
76
+ borderTopLeftRadius: "10px",
77
+ borderTopRightRadius: "10px",
78
+ display: "flex",
79
+ flexDirection: "column",
80
+ gap: "5px",
81
+ }}
82
+ >
83
+ <div style={{ fontWeight: "bold", fontSize: "18px" }}>{event.title}</div>
84
+ <div style={{ fontSize: "14px" }}>Rezervasyon ID: {event.reservationId}</div>
85
+ </div>
86
+
87
+ {/* İçerik */}
88
+ <div style={{ padding: "20px", display: "flex", flexDirection: "column", gap: "15px" }}>
89
+ {/* Misafirler */}
90
+ {Array.isArray(event.guestNames) && (
91
+ <div>
92
+ <strong>Misafirler:</strong> {event.guestNames.join(", ")}
93
+ </div>
94
+ )}
95
+
96
+ {/* Giriş ve Çıkış Tarihleri */}
97
+ <div style={{ display: "flex", justifyContent: "space-between", marginBottom: "10px" }}>
98
+ <div>
99
+ <strong>Giriş:</strong> {new Date(event.startDate).toLocaleDateString()}
100
+ </div>
101
+ <div>
102
+ <strong>Çıkış:</strong> {new Date(event.endDate).toLocaleDateString()}
103
+ </div>
104
+ </div>
105
+
106
+ {/* Ödeme Bilgileri */}
107
+ {(event.totalAmount !== undefined || event.amountPaid !== undefined) && (
108
+ <div style={{ display: "flex", justifyContent: "space-between", marginBottom: "10px" }}>
109
+ {event.amountPaid !== undefined && (
110
+ <div>
111
+ <strong>Ödenen Miktar:</strong> ${event.amountPaid.toFixed(2)}
112
+ </div>
113
+ )}
114
+ {event.totalAmount !== undefined && (
115
+ <div>
116
+ <strong>Toplam Borç:</strong> ${event.totalAmount.toFixed(2)}
117
+ </div>
118
+ )}
119
+ </div>
120
+ )}
121
+
122
+ {/* Rezervasyon Durumu */}
123
+ {event.status && (
124
+ <div>
125
+ <strong>Durum:</strong> {event.status}
126
+ </div>
127
+ )}
128
+
129
+ {/* Rezervasyon Notu */}
130
+ {event.note && (
131
+ <div>
132
+ <strong>Not:</strong> {event.note}
133
+ </div>
134
+ )}
135
+ </div>
136
+
137
+
138
+ {/* Footer */}
139
+ <div
140
+ style={{
141
+ padding: "15px 20px",
142
+ borderTop: "1px solid #ddd",
143
+ display: "flex",
144
+ justifyContent: "flex-end",
145
+ gap: "10px",
146
+ borderBottomLeftRadius: "10px",
147
+ borderBottomRightRadius: "10px",
148
+ }}
149
+ >
150
+ {/* Düzenle Butonu */}
151
+ {onEdit && (
152
+ <button
153
+ onClick={() => onEdit(event)}
154
+ style={{
155
+ padding: "8px 16px",
156
+ backgroundColor: "#2196f3",
157
+ color: "#ffffff",
158
+ border: "none",
159
+ borderRadius: "4px",
160
+ cursor: "pointer",
161
+ fontSize: "14px",
162
+ display: "flex",
163
+ alignItems: "center",
164
+ gap: "5px",
165
+ transition: "background-color 0.2s",
166
+ }}
167
+ onMouseOver={(e) => (e.target.style.backgroundColor = "#1976d2")}
168
+ onMouseOut={(e) => (e.target.style.backgroundColor = "#2196f3")}
169
+ >
170
+ {/* Düzenle İkonu */}
171
+ <span role="img" aria-label="Düzenle">✏️</span>
172
+ Düzenle
173
+ </button>
174
+ )}
175
+
176
+ {/* Sil Butonu */}
177
+ {onDelete && (
178
+ <button
179
+ onClick={() => onDelete(event.id)}
180
+ style={{
181
+ padding: "8px 16px",
182
+ backgroundColor: "#f44336",
183
+ color: "#ffffff",
184
+ border: "none",
185
+ borderRadius: "4px",
186
+ cursor: "pointer",
187
+ fontSize: "14px",
188
+ display: "flex",
189
+ alignItems: "center",
190
+ gap: "5px",
191
+ transition: "background-color 0.2s",
192
+ }}
193
+ onMouseOver={(e) => (e.target.style.backgroundColor = "#d32f2f")}
194
+ onMouseOut={(e) => (e.target.style.backgroundColor = "#f44336")}
195
+ >
196
+ {/* Sil İkonu */}
197
+ <span role="img" aria-label="Sil">🗑️</span>
198
+ Sil
199
+ </button>
200
+ )}
201
+ </div>
202
+ </div>
203
+ );
204
+ };
205
+
206
+ export default EventTooltip;
@@ -0,0 +1,179 @@
1
+ // src/components/Timeline/FilterPanel.js (Demo Component)
2
+
3
+ import React, { useState } from 'react';
4
+ import './Timeline.css';
5
+
6
+ const FilterPanel = ({
7
+ events,
8
+ resources,
9
+ onFilterChange,
10
+ onClearFilters
11
+ }) => {
12
+ const [searchTerm, setSearchTerm] = useState('');
13
+ const [selectedResources, setSelectedResources] = useState([]);
14
+ const [selectedStatuses, setSelectedStatuses] = useState([]);
15
+ const [startDate, setStartDate] = useState('');
16
+ const [endDate, setEndDate] = useState('');
17
+
18
+ // Tüm unique status'leri bul
19
+ const allStatuses = [...new Set(events.map(e => e.status).filter(Boolean))];
20
+
21
+ const handleSearchChange = (value) => {
22
+ setSearchTerm(value);
23
+ applyFilters({
24
+ searchTerm: value,
25
+ resourceIds: selectedResources,
26
+ statuses: selectedStatuses,
27
+ startDate: startDate ? new Date(startDate) : null,
28
+ endDate: endDate ? new Date(endDate) : null,
29
+ });
30
+ };
31
+
32
+ const handleResourceToggle = (resourceId) => {
33
+ const newResources = selectedResources.includes(resourceId)
34
+ ? selectedResources.filter(id => id !== resourceId)
35
+ : [...selectedResources, resourceId];
36
+ setSelectedResources(newResources);
37
+ applyFilters({
38
+ searchTerm,
39
+ resourceIds: newResources,
40
+ statuses: selectedStatuses,
41
+ startDate: startDate ? new Date(startDate) : null,
42
+ endDate: endDate ? new Date(endDate) : null,
43
+ });
44
+ };
45
+
46
+ const handleStatusToggle = (status) => {
47
+ const newStatuses = selectedStatuses.includes(status)
48
+ ? selectedStatuses.filter(s => s !== status)
49
+ : [...selectedStatuses, status];
50
+ setSelectedStatuses(newStatuses);
51
+ applyFilters({
52
+ searchTerm,
53
+ resourceIds: selectedResources,
54
+ statuses: newStatuses,
55
+ startDate: startDate ? new Date(startDate) : null,
56
+ endDate: endDate ? new Date(endDate) : null,
57
+ });
58
+ };
59
+
60
+ const handleDateChange = (type, value) => {
61
+ if (type === 'start') {
62
+ setStartDate(value);
63
+ applyFilters({
64
+ searchTerm,
65
+ resourceIds: selectedResources,
66
+ statuses: selectedStatuses,
67
+ startDate: value ? new Date(value) : null,
68
+ endDate: endDate ? new Date(endDate) : null,
69
+ });
70
+ } else {
71
+ setEndDate(value);
72
+ applyFilters({
73
+ searchTerm,
74
+ resourceIds: selectedResources,
75
+ statuses: selectedStatuses,
76
+ startDate: startDate ? new Date(startDate) : null,
77
+ endDate: value ? new Date(value) : null,
78
+ });
79
+ }
80
+ };
81
+
82
+ const applyFilters = (filters) => {
83
+ if (onFilterChange) {
84
+ onFilterChange(filters);
85
+ }
86
+ };
87
+
88
+ const handleClear = () => {
89
+ setSearchTerm('');
90
+ setSelectedResources([]);
91
+ setSelectedStatuses([]);
92
+ setStartDate('');
93
+ setEndDate('');
94
+ if (onClearFilters) {
95
+ onClearFilters();
96
+ }
97
+ };
98
+
99
+ // Tüm resource'ları düzleştir
100
+ const allResources = resources.flatMap(group => group.resources || []);
101
+
102
+ return (
103
+ <div className="filter-panel">
104
+ <div className="filter-panel-header">
105
+ <h3>Filtreler</h3>
106
+ <button onClick={handleClear} className="filter-clear-btn">
107
+ Temizle
108
+ </button>
109
+ </div>
110
+
111
+ <div className="filter-section">
112
+ <label>Arama</label>
113
+ <input
114
+ type="text"
115
+ placeholder="Event başlığına göre ara..."
116
+ value={searchTerm}
117
+ onChange={(e) => handleSearchChange(e.target.value)}
118
+ className="filter-search-input"
119
+ />
120
+ </div>
121
+
122
+ <div className="filter-section">
123
+ <label>Tarih Aralığı</label>
124
+ <div className="filter-date-range">
125
+ <input
126
+ type="date"
127
+ value={startDate}
128
+ onChange={(e) => handleDateChange('start', e.target.value)}
129
+ placeholder="Başlangıç"
130
+ className="filter-date-input"
131
+ />
132
+ <span> - </span>
133
+ <input
134
+ type="date"
135
+ value={endDate}
136
+ onChange={(e) => handleDateChange('end', e.target.value)}
137
+ placeholder="Bitiş"
138
+ className="filter-date-input"
139
+ />
140
+ </div>
141
+ </div>
142
+
143
+ <div className="filter-section">
144
+ <label>Resource'lar</label>
145
+ <div className="filter-checkbox-group">
146
+ {allResources.map(resource => (
147
+ <label key={resource.id} className="filter-checkbox">
148
+ <input
149
+ type="checkbox"
150
+ checked={selectedResources.includes(resource.id)}
151
+ onChange={() => handleResourceToggle(resource.id)}
152
+ />
153
+ <span>{resource.name || resource.id}</span>
154
+ </label>
155
+ ))}
156
+ </div>
157
+ </div>
158
+
159
+ <div className="filter-section">
160
+ <label>Status</label>
161
+ <div className="filter-checkbox-group">
162
+ {allStatuses.map(status => (
163
+ <label key={status} className="filter-checkbox">
164
+ <input
165
+ type="checkbox"
166
+ checked={selectedStatuses.includes(status)}
167
+ onChange={() => handleStatusToggle(status)}
168
+ />
169
+ <span>{status}</span>
170
+ </label>
171
+ ))}
172
+ </div>
173
+ </div>
174
+ </div>
175
+ );
176
+ };
177
+
178
+ export default FilterPanel;
179
+
@@ -1,26 +1,26 @@
1
- import React from "react";
2
-
3
- const Indicator = ({ todayIndex, totalDays }) => {
4
- if (todayIndex < 0 || todayIndex >= totalDays) {
5
- return null; // Bugün timeline dışında ise çizgiyi gösterme
6
- }
7
-
8
- return (
9
- <div
10
- style={{
11
- position: "absolute",
12
- top: 0,
13
- left: `calc(${(todayIndex + 0.5) / totalDays} * 100%)`, // Günün ortasına yerleştirmek için +0.5
14
- width: "2px",
15
- height: "100%",
16
- backgroundColor: "transparent",
17
- zIndex: 5,
18
- borderStyle: "dashed", // Kesikli çizgi için
19
- borderWidth: "0 0 0 2px", // Sadece sol tarafa kesikli çizgi
20
- borderColor: "red",
21
- }}
22
- ></div>
23
- );
24
- };
25
-
26
- export default Indicator;
1
+ import React from "react";
2
+
3
+ const Indicator = ({ todayIndex, totalDays }) => {
4
+ if (todayIndex < 0 || todayIndex >= totalDays) {
5
+ return null; // Bugün timeline dışında ise çizgiyi gösterme
6
+ }
7
+
8
+ return (
9
+ <div
10
+ style={{
11
+ position: "absolute",
12
+ top: 0,
13
+ left: `calc(${(todayIndex + 0.5) / totalDays} * 100%)`, // Günün ortasına yerleştirmek için +0.5
14
+ width: "2px",
15
+ height: "100%",
16
+ backgroundColor: "transparent",
17
+ zIndex: 5,
18
+ borderStyle: "dashed", // Kesikli çizgi için
19
+ borderWidth: "0 0 0 2px", // Sadece sol tarafa kesikli çizgi
20
+ borderColor: "red",
21
+ }}
22
+ ></div>
23
+ );
24
+ };
25
+
26
+ export default Indicator;