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.
Files changed (39) hide show
  1. package/.babelrc +6 -0
  2. package/CHANGELOG.md +35 -0
  3. package/dist/Timeline.js +2292 -0
  4. package/dist/dist/components/Timeline/DragAndDropHandler.js +35 -0
  5. package/dist/dist/components/Timeline/EventTooltip.js +206 -0
  6. package/dist/dist/components/Timeline/Indicator.js +30 -0
  7. package/dist/dist/components/Timeline/MasterHeader.js +55 -0
  8. package/dist/dist/components/Timeline/Resources.js +53 -0
  9. package/dist/dist/components/Timeline/ResourcesHeader.js +14 -0
  10. package/dist/dist/components/Timeline/Timeline.css +534 -0
  11. package/dist/dist/components/Timeline/Timeline.js +277 -0
  12. package/dist/dist/components/Timeline/TimelineCell.js +8 -0
  13. package/dist/dist/components/Timeline/TimelineContent.js +422 -0
  14. package/dist/dist/components/Timeline/TimelineEvents.js +114 -0
  15. package/dist/dist/components/Timeline/TimelineHeader.js +43 -0
  16. package/dist/dist/components/Timeline/TimelineMonthContainer.js +29 -0
  17. package/dist/dist/components/Timeline/TimelineResources.js +16 -0
  18. package/dist/dist/hooks/useDragAndDrop.js +80 -0
  19. package/dist/dist/hooks/useEventDragDrop.js +120 -0
  20. package/dist/dist/hooks/useExtendEvent.js +28 -0
  21. package/dist/dist/utils/HorizontalVirtualScroll.js +0 -0
  22. package/dist/dist/utils/dateUtils.js +36 -0
  23. package/dist/dist/utils/filterTimelineData.js +21 -0
  24. package/dist/dist/utils/timelineUtils.js +40 -0
  25. package/package.json +20 -1
  26. package/public/index kutuphane /304/261c/304/261n.html" +43 -0
  27. package/public/index tasarim icin.html +20 -0
  28. package/src/App.js +161 -154
  29. package/src/components/Timeline/DatePickerComponent.js +17 -0
  30. package/src/components/Timeline/EventTooltip.js +1 -1
  31. package/src/components/Timeline/Indicator.js +1 -2
  32. package/src/components/Timeline/MasterHeader.js +36 -23
  33. package/src/components/Timeline/Timeline.css +90 -8
  34. package/src/components/Timeline/Timeline.js +71 -44
  35. package/src/components/Timeline/TimelineContent.js +154 -129
  36. package/src/hooks/useEventDragDrop.js +22 -16
  37. package/webpack.config.js +25 -7
  38. package/src/App copy.js +0 -185
  39. package/src/components/Timeline/TimelineContent copy.js +0 -421
@@ -0,0 +1,534 @@
1
+ /* src/components/Timeline/Timeline.css */
2
+
3
+ /*
4
+ Temel: "sales sayfası" temasıyla uyumlu renkler,
5
+ light vs. dark tanımları
6
+ */
7
+
8
+ :root {
9
+ /* Light Tema Varsayılan Renkler */
10
+ --background-color: #f5f5f2; /* Açık tema arka plan */
11
+ --text-color: #666; /* Açık tema yazı rengi */
12
+ --border-color: #bbb; /* Daha yumuşak border */
13
+
14
+ /* Header */
15
+ --header-background-color: #f5f5f2; /* Üst header, tablo header */
16
+ --header-text-color: #666;
17
+
18
+ /* Resources */
19
+ --resource-background-color: #f5f5f2;
20
+ --resource-text-color: #666;
21
+ --group-header-background-color: #dadada;
22
+
23
+ /* Timeline */
24
+ --timeline-header-background-color: #f5f5f2;
25
+ --timeline-cell-border-color: #ccc;
26
+ --timeline-event-background-color: #fff;
27
+ --timeline-event-border-color: #666;
28
+ --timeline-event-text-color: #666;
29
+
30
+ /* Scrollbar */
31
+ --scrollbar-thumb-background: #aaa;
32
+ --scrollbar-thumb-hover-background: #888;
33
+
34
+ --resource-width: 150px;
35
+ --cell-height: 40px;
36
+ --header-height: 60px;
37
+ --time-slot-height: 20px;
38
+ --container-height: 480px;
39
+
40
+ --timeline-new-event-background-color: #ff5722;
41
+ --timeline-new-event-text-color: #fff;
42
+
43
+ --timeline-event-background-color: #ff7f50;
44
+ --timeline-event-text-color: #fff;
45
+ --timeline-event-border-color: #fff;
46
+
47
+ --timeline-cell-selected-bg: rgba(25,118,210,0.2);
48
+
49
+ user-select: none; /* Metin seçimini engelle */
50
+ }
51
+
52
+ /* Koyu Tema */
53
+ .dark-mode {
54
+ /* Koyu tema */
55
+ --background-color: #16202a; /* Koyu tema arka plan */
56
+ --text-color: #ddd; /* Koyu tema yazı rengi */
57
+ --border-color: #444;
58
+
59
+ --header-background-color: #16202a;
60
+ --header-text-color: #bbb;
61
+
62
+ --resource-background-color: #16202a;
63
+ --resource-text-color: #bbb;
64
+ --group-header-background-color: #0d141b;
65
+
66
+ --timeline-header-background-color: #16202a;
67
+ --timeline-cell-border-color: #444;
68
+ --timeline-event-background-color: #2a2a2a;
69
+ --timeline-event-border-color: #222;
70
+ --timeline-event-text-color: #ddd;
71
+
72
+ --scrollbar-thumb-background: #555;
73
+ --scrollbar-thumb-hover-background: #888;
74
+
75
+ --timeline-new-event-background-color: #a83e20;
76
+ --timeline-new-event-text-color: #eee;
77
+
78
+ --timeline-event-background-color: #a83e20;
79
+ --timeline-event-text-color: #fff;
80
+ --timeline-event-border-color: #222;
81
+
82
+ --timeline-cell-selected-bg: rgba(76,175,80,0.2);
83
+ }
84
+
85
+ /* Genel Timeline Konteyner */
86
+ .timeline-container {
87
+ display: flex;
88
+ flex-direction: column;
89
+ width: 100%;
90
+ height: 100%;
91
+ border: 1px solid var(--border-color);
92
+ border-radius: 8px;
93
+ overflow: hidden;
94
+ box-sizing: border-box;
95
+ background-color: var(--background-color);
96
+ color: var(--text-color);
97
+ }
98
+
99
+ /* Master Header */
100
+ .timeline-master-header {
101
+ width: 100%;
102
+ background-color: var(--header-background-color);
103
+ color: var(--header-text-color);
104
+ border-bottom: 1px solid var(--border-color);
105
+ z-index: 10;
106
+ padding: 10px;
107
+ box-sizing: border-box;
108
+ }
109
+
110
+ /* Timeline Body */
111
+ .timeline-body {
112
+ display: flex;
113
+ flex: 1;
114
+ }
115
+
116
+ /* Sol Kısım: Resources */
117
+ .timeline-resources-container {
118
+ width: var(--resource-width);
119
+ display: flex;
120
+ flex-direction: column;
121
+ border-right: 1px solid var(--border-color);
122
+ position: sticky;
123
+ left: 0;
124
+ top: var(--header-height);
125
+ z-index: 2;
126
+ background-color: var(--resource-background-color);
127
+ overflow-y: auto;
128
+ }
129
+
130
+ /* Resources Header */
131
+ .resources-header {
132
+ background-color: var(--header-background-color);
133
+ color: var(--resource-text-color);
134
+ text-align: center;
135
+ width: var(--resource-width);
136
+ font-weight: bold;
137
+ display: flex;
138
+ flex-direction: column;
139
+ justify-content: center;
140
+ align-items: center;
141
+ height: calc(var(--header-height) * 2); /* Üst üste iki header yüksekliği */
142
+ border-right: 1px solid var(--border-color);
143
+ box-sizing: border-box;
144
+ }
145
+
146
+ /* Grup Başlığı Hücreleri */
147
+ .group-header-row {
148
+ display: flex;
149
+ height: var(--cell-height);
150
+ background-color: var(--group-header-background-color);
151
+ color: var(--resource-text-color);
152
+ font-weight: bold;
153
+ }
154
+
155
+ .group-header-cell {
156
+ flex: 1;
157
+ border: 1px solid var(--border-color);
158
+ text-align: center;
159
+ background-color: var(--group-header-background-color);
160
+ color: var(--resource-text-color);
161
+ height: var(--cell-height);
162
+ display: flex;
163
+ align-items: center;
164
+ justify-content: center;
165
+ }
166
+
167
+ /* Resource Grupları */
168
+ .resource-group {
169
+ display: flex;
170
+ flex-direction: column;
171
+ }
172
+
173
+ /* Resource Grup Header */
174
+ .resource-group-header {
175
+ background-color: var(--group-header-background-color);
176
+ color: var(--resource-text-color);
177
+ font-weight: bold;
178
+ height: var(--cell-height);
179
+ box-sizing: border-box;
180
+ display: flex;
181
+ align-items: center;
182
+ justify-content: space-between;
183
+ padding: 0 0px;
184
+ cursor: pointer;
185
+ border: 1px solid var(--border-color);
186
+ }
187
+
188
+ /* Resource Hücreleri */
189
+ .resource-cell {
190
+ padding: 0;
191
+ text-align: left;
192
+ background-color: var(--resource-background-color);
193
+ color: var(--resource-text-color);
194
+ height: var(--cell-height);
195
+ display: flex;
196
+ align-items: center;
197
+ border: 0.3px solid var(--border-color);
198
+ box-sizing: border-box;
199
+ }
200
+
201
+ /* Sağ Kısım: Timeline */
202
+ .timeline-scrollable-container {
203
+ flex: 1;
204
+ overflow-x: auto;
205
+ overflow-y: hidden;
206
+ display: flex;
207
+ flex-direction: column;
208
+ position: relative;
209
+ }
210
+
211
+ /* Header ve Content Wrapper */
212
+ .timeline-header-content-wrapper {
213
+ display: flex;
214
+ flex-direction: column;
215
+ }
216
+
217
+ /* Timeline Header */
218
+ .timeline-header {
219
+ display: flex;
220
+ background-color: var(--timeline-header-background-color);
221
+ color: var(--header-text-color);
222
+ position: sticky;
223
+ top: 0;
224
+ z-index: 2;
225
+ height: var(--header-height);
226
+ overflow: hidden;
227
+ box-sizing: border-box;
228
+ }
229
+
230
+ /* Timeline Content */
231
+ .timeline-content {
232
+ display: flex;
233
+ flex-direction: column;
234
+ }
235
+
236
+ /* Grup Container */
237
+ .group-container {
238
+ display: flex;
239
+ flex-direction: column;
240
+ }
241
+
242
+ /* Resource Satırları */
243
+ .resource-row {
244
+ display: flex;
245
+ box-sizing: border-box;
246
+ position: relative;
247
+ height: var(--cell-height);
248
+ border: 1px solid var(--border-color);
249
+ margin-top: -1px;
250
+ overflow: hidden;
251
+ }
252
+
253
+ /* Timeline Hücreleri */
254
+ .timeline-cell {
255
+ flex: 1;
256
+ border: 1px solid var(--timeline-cell-border-color);
257
+ height: 100%;
258
+ box-sizing: border-box;
259
+ }
260
+
261
+ /* Hücre Seçili Durumu */
262
+ .timeline-cell.selected {
263
+ background-color: rgba(25, 118, 210, 0.2); /* satır içi/hover */
264
+ }
265
+
266
+ /* Event Stilleri */
267
+ .event {
268
+ position: absolute;
269
+ background-color: var(--timeline-event-background-color);
270
+ color: var(--timeline-event-text-color);
271
+ font-size: 12px;
272
+ padding: 2px 5px;
273
+ border-radius: 4px;
274
+ text-align: left;
275
+ display: flex;
276
+ flex-direction: column;
277
+ justify-content: center;
278
+ box-sizing: border-box;
279
+ z-index: 10;
280
+ overflow: hidden;
281
+ text-overflow: ellipsis;
282
+ white-space: nowrap;
283
+ border: 1px solid var(--timeline-event-border-color);
284
+ cursor: pointer;
285
+ }
286
+
287
+ /* Event Time Stili */
288
+ .event-time {
289
+ font-size: 10px;
290
+ margin-top: 2px;
291
+ }
292
+
293
+ /* Scrollbar için */
294
+ .timeline-scrollable-container::-webkit-scrollbar {
295
+ height: 10px;
296
+ }
297
+
298
+ .timeline-scrollable-container::-webkit-scrollbar-thumb {
299
+ background: var(--scrollbar-thumb-background);
300
+ border-radius: 5px;
301
+ }
302
+
303
+ .timeline-scrollable-container::-webkit-scrollbar-thumb:hover {
304
+ background: var(--scrollbar-thumb-hover-background);
305
+ }
306
+
307
+ .resources-header {
308
+ background-color: var(--header-background-color);
309
+ color: var(--resource-text-color);
310
+ text-align: center;
311
+ width: var(--resource-width);
312
+ font-weight: bold;
313
+ display: flex;
314
+ flex-direction: column;
315
+ justify-content: center;
316
+ align-items: center;
317
+ height: 80px;
318
+ border-right: 1px solid var(--border-color);
319
+ box-sizing: border-box;
320
+ }
321
+
322
+ /* TimelineHeader Container */
323
+ .timeline-header-container {
324
+ flex: 1;
325
+ display: flex;
326
+ flex-direction: column;
327
+ }
328
+
329
+ /* Ay + Yıl satırı */
330
+ .timeline-header-month-row {
331
+ display: flex;
332
+ background-color: var(--header-background-color);
333
+ color: var(--header-text-color);
334
+ font-weight: bold;
335
+ font-size: 16px;
336
+ height: 40px;
337
+ line-height: 40px;
338
+ border-bottom: 1px solid var(--border-color);
339
+ }
340
+
341
+ /* Ay + Yıl hücreleri */
342
+ .timeline-header-month-cell {
343
+ text-align: center;
344
+ display: flex;
345
+ align-items: center;
346
+ justify-content: center;
347
+ /* border-right => dynamic, inline style if needed */
348
+ box-sizing: border-box;
349
+ }
350
+
351
+ /* Günlük Hücreler (tarih satırı) */
352
+ .timeline-header-day-row {
353
+ display: flex;
354
+ background-color: var(--timeline-header-background-color);
355
+ color: var(--header-text-color);
356
+ /* border-bottom: 1px solid var(--border-color); if needed */
357
+ }
358
+
359
+ /* Günlük hücre (her gün) */
360
+ .timeline-header-day-cell {
361
+ height: 40px;
362
+ line-height: 40px;
363
+ font-size: 14px;
364
+ white-space: nowrap;
365
+ overflow: hidden;
366
+ text-overflow: ellipsis;
367
+ text-align: center;
368
+ box-sizing: border-box;
369
+ }
370
+
371
+
372
+ /* src/components/Timeline/Timeline.css */
373
+ /* Ekleme: MasterHeader stili */
374
+
375
+ /* Kapsayıcı */
376
+ .master-header-container {
377
+ display: flex;
378
+ align-items: center;
379
+ padding: 10px;
380
+
381
+ background-color: var(--header-background-color);
382
+ color: var(--header-text-color);
383
+
384
+ /* eğer border vs. istersen
385
+ border-bottom: 1px solid var(--border-color);
386
+ */
387
+ }
388
+
389
+ /* Butonlar */
390
+ .master-header-btn {
391
+ background-color: transparent;
392
+ color: var(--header-text-color);
393
+ border: 1px solid var(--border-color);
394
+ border-radius: 4px;
395
+ padding: 6px 12px;
396
+ margin-right: 10px;
397
+ cursor: pointer;
398
+ font-size: 14px;
399
+ transition: background-color 0.2s ease, color 0.2s ease;
400
+ }
401
+
402
+ .master-header-btn:hover {
403
+ background-color: rgba(25, 118, 210, 0.2); /* Light tema hover */
404
+ }
405
+
406
+ .dark-mode .master-header-btn:hover {
407
+ background-color: rgba(76, 175, 80, 0.2); /* Koyu tema hover */
408
+ }
409
+
410
+ .master-header-btn:focus {
411
+ outline: none;
412
+ }
413
+
414
+ /* Select */
415
+ .master-header-select {
416
+ margin-left: 10px;
417
+ background-color: transparent;
418
+ color: var(--header-text-color);
419
+ border: 1px solid var(--border-color);
420
+ border-radius: 4px;
421
+ padding: 4px 8px;
422
+ font-size: 14px;
423
+ cursor: pointer;
424
+ }
425
+
426
+ .master-header-select:focus {
427
+ outline: none;
428
+ }
429
+
430
+
431
+ /* Container */
432
+ .timeline-content-container {
433
+ position: relative;
434
+ width: 100%;
435
+ height: auto; /* or as needed */
436
+ display: flex;
437
+ flex-direction: column;
438
+ }
439
+
440
+ /* Group container */
441
+ .timeline-group-container {
442
+ margin-bottom: 0px;
443
+ display: flex;
444
+ flex-direction: column;
445
+ }
446
+
447
+ /* Group header row */
448
+ .timeline-group-header-row {
449
+ display: flex;
450
+ margin-top: -0.08rem;
451
+ }
452
+
453
+ .timeline-group-header-cell {
454
+ flex: 1;
455
+ height: 2.58rem;
456
+ background-color: var(--group-header-background-color);
457
+ border: 1px solid var(--border-color);
458
+
459
+ box-sizing: border-box;
460
+ display: flex;
461
+ align-items: center;
462
+ justify-content: center;
463
+ }
464
+
465
+ /* Resource row */
466
+ .timeline-resource-row {
467
+ display: flex;
468
+ position: relative;
469
+ height: var(--cell-height, 40px);
470
+ border: 1px solid var(--border-color);
471
+ box-sizing: border-box;
472
+ }
473
+
474
+ /* Each day cell */
475
+ .timeline-cell {
476
+ flex: 1;
477
+ height: 100%;
478
+ position: relative;
479
+ border-left: 1px solid var(--border-color);
480
+ border-right: 1px solid var(--border-color);
481
+ box-sizing: border-box;
482
+ cursor: pointer;
483
+ }
484
+
485
+ /* "selected" day cell */
486
+ .timeline-cell.selected {
487
+ background-color: var(--timeline-cell-selected-bg, rgba(25,118,210,0.2));
488
+ }
489
+
490
+ /* Event */
491
+ .timeline-event {
492
+ position: absolute;
493
+ background-color: var(--timeline-event-background-color, #0093ce);
494
+ color: var(--timeline-event-text-color, #fff);
495
+ font-size: 14px;
496
+ padding: 5px;
497
+ border-radius: 20px;
498
+ box-sizing: border-box;
499
+ z-index: 10;
500
+ overflow: hidden;
501
+ text-overflow: ellipsis;
502
+ white-space: nowrap;
503
+ border: 1px solid var(--timeline-event-border-color, #fff);
504
+ top: 5px; /* or a variable offset if you want */
505
+ /* "left" and "width" are inline from JS */
506
+ }
507
+
508
+ /* Extend handle */
509
+ .timeline-event-extend-handle {
510
+ position: absolute;
511
+ right: 0;
512
+ top: 0;
513
+ width: 10px;
514
+ height: 100%;
515
+ background-color: rgba(0,0,0,0.2);
516
+ cursor: col-resize;
517
+ z-index: 20;
518
+ }
519
+
520
+ /* Temp event (while creating) */
521
+ .timeline-temp-event {
522
+ position: absolute;
523
+ background-color: var(--timeline-new-event-background-color, #0093ce);
524
+ color: var(--timeline-new-event-text-color, #fff);
525
+ opacity: 0.7;
526
+ border-radius: 20px;
527
+ z-index: 9;
528
+ display: flex;
529
+ align-items: center;
530
+ justify-content: center;
531
+ font-size: 14px;
532
+ /* "left"/"width" from JS: " ...calculatePosition(tempEvent, dates)" */
533
+ top: 5px;
534
+ }