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
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// src/utils/timeUtils.js
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Saat bazlı time slot'ları oluşturur
|
|
5
|
+
* @param {number} startHour - Başlangıç saati (0-23)
|
|
6
|
+
* @param {number} endHour - Bitiş saati (0-24)
|
|
7
|
+
* @param {number} intervalMinutes - Slot aralığı (dakika cinsinden)
|
|
8
|
+
* @returns {Array} - Time slot array [{hour, minute, display, totalMinutes}]
|
|
9
|
+
*/
|
|
10
|
+
export const generateTimeSlots = (startHour = 0, endHour = 24, intervalMinutes = 60) => {
|
|
11
|
+
const slots = [];
|
|
12
|
+
const totalMinutes = (endHour - startHour) * 60;
|
|
13
|
+
const slotCount = Math.floor(totalMinutes / intervalMinutes);
|
|
14
|
+
|
|
15
|
+
for (let i = 0; i <= slotCount; i++) {
|
|
16
|
+
const totalMinutesFromStart = i * intervalMinutes;
|
|
17
|
+
const hour = Math.floor(totalMinutesFromStart / 60) + startHour;
|
|
18
|
+
const minute = totalMinutesFromStart % 60;
|
|
19
|
+
|
|
20
|
+
// 24:00'ı 00:00 olarak göster
|
|
21
|
+
const displayHour = hour >= 24 ? 0 : hour;
|
|
22
|
+
const displayMinute = minute === 0 ? '00' : minute.toString().padStart(2, '0');
|
|
23
|
+
|
|
24
|
+
slots.push({
|
|
25
|
+
hour: displayHour,
|
|
26
|
+
minute,
|
|
27
|
+
display: `${displayHour.toString().padStart(2, '0')}:${displayMinute}`,
|
|
28
|
+
totalMinutes: totalMinutesFromStart,
|
|
29
|
+
rawHour: hour,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return slots;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Bir Date objesinden saat ve dakikayı alır
|
|
38
|
+
* @param {Date} date - Date objesi
|
|
39
|
+
* @returns {Object} - {hour, minute, totalMinutes}
|
|
40
|
+
*/
|
|
41
|
+
export const getTimeFromDate = (date) => {
|
|
42
|
+
if (!(date instanceof Date)) {
|
|
43
|
+
date = new Date(date);
|
|
44
|
+
}
|
|
45
|
+
const hour = date.getHours();
|
|
46
|
+
const minute = date.getMinutes();
|
|
47
|
+
return {
|
|
48
|
+
hour,
|
|
49
|
+
minute,
|
|
50
|
+
totalMinutes: hour * 60 + minute,
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Saat ve dakikadan toplam dakikayı hesaplar
|
|
56
|
+
* @param {number} hour - Saat (0-23)
|
|
57
|
+
* @param {number} minute - Dakika (0-59)
|
|
58
|
+
* @returns {number} - Toplam dakika
|
|
59
|
+
*/
|
|
60
|
+
export const timeToMinutes = (hour, minute = 0) => {
|
|
61
|
+
return hour * 60 + minute;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Toplam dakikayı saat ve dakikaya çevirir
|
|
66
|
+
* @param {number} totalMinutes - Toplam dakika
|
|
67
|
+
* @returns {Object} - {hour, minute}
|
|
68
|
+
*/
|
|
69
|
+
export const minutesToTime = (totalMinutes) => {
|
|
70
|
+
const hour = Math.floor(totalMinutes / 60);
|
|
71
|
+
const minute = totalMinutes % 60;
|
|
72
|
+
return { hour, minute };
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Bir event'in saat bazlı pozisyonunu hesaplar
|
|
77
|
+
* @param {Date} startDate - Başlangıç tarihi ve saati
|
|
78
|
+
* @param {Date} endDate - Bitiş tarihi ve saati
|
|
79
|
+
* @param {Date} dayStart - Günün başlangıcı (00:00)
|
|
80
|
+
* @param {number} startHour - Timeline başlangıç saati
|
|
81
|
+
* @param {number} endHour - Timeline bitiş saati
|
|
82
|
+
* @param {number} intervalMinutes - Slot aralığı
|
|
83
|
+
* @returns {Object} - {top, height, isVisible, startMinutes, endMinutes}
|
|
84
|
+
*/
|
|
85
|
+
export const calculateTimePosition = (
|
|
86
|
+
startDate,
|
|
87
|
+
endDate,
|
|
88
|
+
dayStart,
|
|
89
|
+
startHour = 0,
|
|
90
|
+
endHour = 24,
|
|
91
|
+
intervalMinutes = 60
|
|
92
|
+
) => {
|
|
93
|
+
// Günün başlangıç ve bitiş zamanlarını oluştur
|
|
94
|
+
const dayStartTime = new Date(dayStart);
|
|
95
|
+
dayStartTime.setHours(startHour, 0, 0, 0);
|
|
96
|
+
|
|
97
|
+
const dayEndTime = new Date(dayStart);
|
|
98
|
+
if (endHour === 24) {
|
|
99
|
+
dayEndTime.setHours(23, 59, 59, 999);
|
|
100
|
+
} else {
|
|
101
|
+
dayEndTime.setHours(endHour, 0, 0, 0);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Event başlangıç ve bitiş zamanları
|
|
105
|
+
const eventStart = new Date(startDate);
|
|
106
|
+
const eventEnd = new Date(endDate);
|
|
107
|
+
|
|
108
|
+
// Event bu gün içinde mi kontrol et
|
|
109
|
+
const dayDateStr = dayStartTime.toDateString();
|
|
110
|
+
const eventStartDateStr = eventStart.toDateString();
|
|
111
|
+
const eventEndDateStr = eventEnd.toDateString();
|
|
112
|
+
|
|
113
|
+
// Event bu günü kapsamıyorsa görünmez
|
|
114
|
+
if (eventEndDateStr < dayDateStr || eventStartDateStr > dayDateStr) {
|
|
115
|
+
return { isVisible: false, top: 0, height: 0, startMinutes: 0, endMinutes: 0 };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Gün içindeki dakika aralığını hesapla
|
|
119
|
+
const dayStartMinutes = startHour * 60;
|
|
120
|
+
const dayEndMinutes = endHour === 24 ? 24 * 60 : endHour * 60;
|
|
121
|
+
const dayTotalMinutes = dayEndMinutes - dayStartMinutes;
|
|
122
|
+
|
|
123
|
+
// Event'in gün içindeki başlangıç ve bitiş dakikaları
|
|
124
|
+
let eventStartMinutes = 0;
|
|
125
|
+
let eventEndMinutes = 0;
|
|
126
|
+
|
|
127
|
+
if (eventStartDateStr === dayDateStr) {
|
|
128
|
+
// Event bugün başlıyor
|
|
129
|
+
const time = getTimeFromDate(eventStart);
|
|
130
|
+
eventStartMinutes = time.totalMinutes;
|
|
131
|
+
} else {
|
|
132
|
+
// Event daha önce başlamış, günün başından itibaren göster
|
|
133
|
+
eventStartMinutes = dayStartMinutes;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (eventEndDateStr === dayDateStr) {
|
|
137
|
+
// Event bugün bitiyor
|
|
138
|
+
const time = getTimeFromDate(eventEnd);
|
|
139
|
+
eventEndMinutes = time.totalMinutes;
|
|
140
|
+
} else {
|
|
141
|
+
// Event daha sonra bitiyor, günün sonuna kadar göster
|
|
142
|
+
eventEndMinutes = dayEndMinutes;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Timeline sınırlarına göre ayarla
|
|
146
|
+
const effectiveStartMinutes = Math.max(eventStartMinutes, dayStartMinutes);
|
|
147
|
+
const effectiveEndMinutes = Math.min(eventEndMinutes, dayEndMinutes);
|
|
148
|
+
|
|
149
|
+
// Eğer etkili süre yoksa görünmez
|
|
150
|
+
if (effectiveEndMinutes <= effectiveStartMinutes) {
|
|
151
|
+
return { isVisible: false, top: 0, height: 0, startMinutes: 0, endMinutes: 0 };
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Pozisyon hesaplama (yüzde olarak)
|
|
155
|
+
const topPercentage = ((effectiveStartMinutes - dayStartMinutes) / dayTotalMinutes) * 100;
|
|
156
|
+
const heightPercentage = ((effectiveEndMinutes - effectiveStartMinutes) / dayTotalMinutes) * 100;
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
isVisible: true,
|
|
160
|
+
top: `${Math.max(0, topPercentage)}%`,
|
|
161
|
+
height: `${Math.min(100, heightPercentage)}%`,
|
|
162
|
+
startMinutes: effectiveStartMinutes,
|
|
163
|
+
endMinutes: effectiveEndMinutes,
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Bir tarih ve saati birleştirir
|
|
169
|
+
* @param {Date} date - Tarih
|
|
170
|
+
* @param {number} hour - Saat
|
|
171
|
+
* @param {number} minute - Dakika
|
|
172
|
+
* @returns {Date} - Birleştirilmiş Date objesi
|
|
173
|
+
*/
|
|
174
|
+
export const combineDateAndTime = (date, hour, minute = 0) => {
|
|
175
|
+
const newDate = new Date(date);
|
|
176
|
+
newDate.setHours(hour, minute, 0, 0);
|
|
177
|
+
return newDate;
|
|
178
|
+
};
|
|
179
|
+
|
|
@@ -1,40 +1,40 @@
|
|
|
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
|
-
};
|
|
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
40
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/utils/viewModeUtils.js
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* View mode'a göre hücre genişliğini hesaplar
|
|
5
|
+
* @param {string} viewMode - "day" | "week" | "month"
|
|
6
|
+
* @param {number} containerWidth - Container genişliği
|
|
7
|
+
* @param {number} dayRange - Gün aralığı
|
|
8
|
+
* @returns {number} - Hücre genişliği (px)
|
|
9
|
+
*/
|
|
10
|
+
export const calculateCellWidth = (viewMode, containerWidth, dayRange) => {
|
|
11
|
+
switch (viewMode) {
|
|
12
|
+
case 'day':
|
|
13
|
+
// Gün görünümü: Her gün için geniş hücreler
|
|
14
|
+
return Math.max(containerWidth / Math.min(dayRange, 7), 150);
|
|
15
|
+
case 'week':
|
|
16
|
+
// Hafta görünümü: Orta genişlik
|
|
17
|
+
return Math.max(containerWidth / Math.min(dayRange, 14), 80);
|
|
18
|
+
case 'month':
|
|
19
|
+
// Ay görünümü: Dar hücreler
|
|
20
|
+
return Math.max(containerWidth / dayRange, 40);
|
|
21
|
+
default:
|
|
22
|
+
return 56.95; // Varsayılan
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* View mode'a göre varsayılan dayRange'i döndürür
|
|
28
|
+
* @param {string} viewMode - "day" | "week" | "month"
|
|
29
|
+
* @returns {number} - Varsayılan dayRange
|
|
30
|
+
*/
|
|
31
|
+
export const getDefaultDayRange = (viewMode) => {
|
|
32
|
+
switch (viewMode) {
|
|
33
|
+
case 'day':
|
|
34
|
+
return 7; // 1 hafta
|
|
35
|
+
case 'week':
|
|
36
|
+
return 14; // 2 hafta
|
|
37
|
+
case 'month':
|
|
38
|
+
return 30; // 1 ay
|
|
39
|
+
default:
|
|
40
|
+
return 30;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* View mode'a göre container genişliğini hesaplar
|
|
46
|
+
* @param {string} viewMode - "day" | "week" | "month"
|
|
47
|
+
* @param {number} dayRange - Gün aralığı
|
|
48
|
+
* @param {number} cellWidth - Hücre genişliği
|
|
49
|
+
* @returns {number} - Container genişliği (px)
|
|
50
|
+
*/
|
|
51
|
+
export const calculateContainerWidth = (viewMode, dayRange, cellWidth) => {
|
|
52
|
+
return dayRange * cellWidth;
|
|
53
|
+
};
|
|
54
|
+
|
package/package.json
CHANGED
|
@@ -1,21 +1,88 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "akfatimeline",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A customizable timeline component for React applications",
|
|
5
|
-
"main": "
|
|
6
|
-
"module": "
|
|
5
|
+
"main": "./src/library.js",
|
|
6
|
+
"module": "./src/library.js",
|
|
7
|
+
"types": "./src/library.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"src",
|
|
11
|
+
"README.md",
|
|
12
|
+
"CHANGELOG.md"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./src/library.js",
|
|
17
|
+
"import": "./src/library.js",
|
|
18
|
+
"require": "./dist/Timeline.js",
|
|
19
|
+
"default": "./src/library.js"
|
|
20
|
+
},
|
|
21
|
+
"./css": "./src/components/Timeline/Timeline.css",
|
|
22
|
+
"./components/Timeline/Timeline.css": "./src/components/Timeline/Timeline.css",
|
|
23
|
+
"./Timeline": {
|
|
24
|
+
"types": "./src/components/Timeline/Timeline.js",
|
|
25
|
+
"import": "./src/components/Timeline/Timeline.js",
|
|
26
|
+
"require": "./dist/components/Timeline/Timeline.js",
|
|
27
|
+
"default": "./src/components/Timeline/Timeline.js"
|
|
28
|
+
},
|
|
29
|
+
"./DailyView": {
|
|
30
|
+
"types": "./src/components/Timeline/DailyView.js",
|
|
31
|
+
"import": "./src/components/Timeline/DailyView.js",
|
|
32
|
+
"require": "./dist/components/Timeline/DailyView.js",
|
|
33
|
+
"default": "./src/components/Timeline/DailyView.js"
|
|
34
|
+
},
|
|
35
|
+
"./ContextMenu": {
|
|
36
|
+
"types": "./src/components/Timeline/ContextMenu.js",
|
|
37
|
+
"import": "./src/components/Timeline/ContextMenu.js",
|
|
38
|
+
"require": "./dist/components/Timeline/ContextMenu.js",
|
|
39
|
+
"default": "./src/components/Timeline/ContextMenu.js"
|
|
40
|
+
},
|
|
41
|
+
"./EventDetailModal": {
|
|
42
|
+
"types": "./src/components/Timeline/EventDetailModal.js",
|
|
43
|
+
"import": "./src/components/Timeline/EventDetailModal.js",
|
|
44
|
+
"require": "./dist/components/Timeline/EventDetailModal.js",
|
|
45
|
+
"default": "./src/components/Timeline/EventDetailModal.js"
|
|
46
|
+
},
|
|
47
|
+
"./EventIcon": {
|
|
48
|
+
"types": "./src/components/Timeline/EventIcon.js",
|
|
49
|
+
"import": "./src/components/Timeline/EventIcon.js",
|
|
50
|
+
"require": "./dist/components/Timeline/EventIcon.js",
|
|
51
|
+
"default": "./src/components/Timeline/EventIcon.js"
|
|
52
|
+
},
|
|
53
|
+
"./EventBadge": {
|
|
54
|
+
"types": "./src/components/Timeline/EventBadge.js",
|
|
55
|
+
"import": "./src/components/Timeline/EventBadge.js",
|
|
56
|
+
"require": "./dist/components/Timeline/EventBadge.js",
|
|
57
|
+
"default": "./src/components/Timeline/EventBadge.js"
|
|
58
|
+
},
|
|
59
|
+
"./LoadingSpinner": {
|
|
60
|
+
"types": "./src/components/Timeline/LoadingSpinner.js",
|
|
61
|
+
"import": "./src/components/Timeline/LoadingSpinner.js",
|
|
62
|
+
"require": "./dist/components/Timeline/LoadingSpinner.js",
|
|
63
|
+
"default": "./src/components/Timeline/LoadingSpinner.js"
|
|
64
|
+
},
|
|
65
|
+
"./AutocompleteSelect": {
|
|
66
|
+
"types": "./src/components/Timeline/AutocompleteSelect.js",
|
|
67
|
+
"import": "./src/components/Timeline/AutocompleteSelect.js",
|
|
68
|
+
"require": "./dist/components/Timeline/AutocompleteSelect.js",
|
|
69
|
+
"default": "./src/components/Timeline/AutocompleteSelect.js"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
7
72
|
"dependencies": {
|
|
8
|
-
"
|
|
9
|
-
"react": "^19.
|
|
10
|
-
"react-
|
|
11
|
-
"react-
|
|
12
|
-
"
|
|
13
|
-
"uuid": "^11.0.3",
|
|
14
|
-
"web-vitals": "^4.2.4"
|
|
73
|
+
"react": "^19.2.3",
|
|
74
|
+
"react-dom": "^19.2.3",
|
|
75
|
+
"react-scripts": "^5.0.1",
|
|
76
|
+
"react-window": "^2.2.3",
|
|
77
|
+
"uuid": "^13.0.0"
|
|
15
78
|
},
|
|
16
79
|
"scripts": {
|
|
80
|
+
"dev": "react-scripts start",
|
|
17
81
|
"start": "react-scripts start",
|
|
18
|
-
"
|
|
82
|
+
"dev:clean": "react-scripts start --reset-cache",
|
|
83
|
+
"build": "webpack --mode production",
|
|
84
|
+
"build:dev": "webpack --mode development",
|
|
85
|
+
"build:watch": "webpack --mode development --watch",
|
|
19
86
|
"test": "react-scripts test",
|
|
20
87
|
"eject": "react-scripts eject"
|
|
21
88
|
},
|
|
@@ -49,21 +116,24 @@
|
|
|
49
116
|
},
|
|
50
117
|
"repository": {
|
|
51
118
|
"type": "git",
|
|
52
|
-
"url": "https://github.com/AKFAPLUS/akfatimeline.git"
|
|
119
|
+
"url": "git+https://github.com/AKFAPLUS/akfatimeline.git"
|
|
53
120
|
},
|
|
54
121
|
"bugs": {
|
|
55
122
|
"url": "https://github.com/AKFAPLUS/akfatimeline/issues"
|
|
56
123
|
},
|
|
57
|
-
"homepage": "
|
|
124
|
+
"homepage": ".",
|
|
58
125
|
"devDependencies": {
|
|
59
|
-
"@babel/core": "^7.
|
|
60
|
-
"@babel/preset-env": "^7.
|
|
61
|
-
"@babel/preset-react": "^7.
|
|
62
|
-
"
|
|
63
|
-
"
|
|
126
|
+
"@babel/core": "^7.28.5",
|
|
127
|
+
"@babel/preset-env": "^7.28.5",
|
|
128
|
+
"@babel/preset-react": "^7.28.5",
|
|
129
|
+
"autoprefixer": "^10.4.20",
|
|
130
|
+
"babel-loader": "^10.0.0",
|
|
131
|
+
"copy-webpack-plugin": "^13.0.1",
|
|
64
132
|
"css-loader": "^7.1.2",
|
|
133
|
+
"postcss": "^8.4.47",
|
|
65
134
|
"style-loader": "^4.0.0",
|
|
66
|
-
"
|
|
135
|
+
"tailwindcss": "^3.4.13",
|
|
136
|
+
"webpack": "^5.104.1",
|
|
67
137
|
"webpack-cli": "^6.0.1"
|
|
68
138
|
}
|
|
69
139
|
}
|