gantt-lib 0.3.3 → 0.4.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/dist/styles.css CHANGED
@@ -227,6 +227,19 @@
227
227
  .gantt-day-btn.disabled:hover {
228
228
  background: transparent;
229
229
  }
230
+ .gantt-cal-nav {
231
+ display: flex;
232
+ gap: 4px;
233
+ padding: 8px;
234
+ border-top: 1px solid var(--gantt-input-border);
235
+ margin-top: 4px;
236
+ }
237
+ .gantt-cal-nav .gantt-btn {
238
+ flex: 1;
239
+ min-width: 0;
240
+ font-size: 0.8rem;
241
+ padding: 0 8px;
242
+ }
230
243
 
231
244
  /* src/styles.css */
232
245
  :root {
@@ -236,6 +249,7 @@
236
249
  --gantt-row-height: 30px;
237
250
  --gantt-header-height: 40px;
238
251
  --gantt-day-width: 30px;
252
+ --gantt-container-border-radius: 10px;
239
253
  --gantt-task-bar-default-color: #3b82f6;
240
254
  --gantt-task-bar-text-color: #ffffff;
241
255
  --gantt-task-bar-border-radius: 4px;
@@ -257,254 +271,6 @@
257
271
  --gantt-dependency-cycle-color: #ef4444;
258
272
  --gantt-expired-color: #ef4444;
259
273
  }
260
- .gantt-container {
261
- width: 100%;
262
- font-family:
263
- system-ui,
264
- -apple-system,
265
- BlinkMacSystemFont,
266
- "Segoe UI",
267
- Roboto,
268
- sans-serif;
269
- border: 1px solid var(--gantt-grid-line-color, #e0e0e0);
270
- background-color: var(--gantt-cell-background, #ffffff);
271
- }
272
- .gantt-scrollContainer {
273
- overflow: auto;
274
- }
275
- .gantt-stickyHeader {
276
- position: sticky;
277
- top: 0;
278
- z-index: 10;
279
- background-color: var(--gantt-cell-background, #ffffff);
280
- border-bottom: 1px solid var(--gantt-grid-line-color, #e0e0e0);
281
- }
282
- .gantt-taskArea {
283
- position: relative;
284
- background-color: var(--gantt-cell-background, #ffffff);
285
- }
286
- .gantt-tr-row {
287
- position: relative;
288
- width: 100%;
289
- border-bottom: 1px solid var(--gantt-grid-line-color);
290
- box-sizing: border-box;
291
- }
292
- .gantt-tr-row:hover {
293
- background-color: rgba(0, 0, 0, 0.05);
294
- }
295
- .gantt-tr-taskBar {
296
- position: absolute;
297
- top: 50%;
298
- transform: translateY(-50%);
299
- border-radius: var(--gantt-task-bar-border-radius);
300
- display: flex;
301
- align-items: center;
302
- padding: 0 0.5rem;
303
- box-sizing: border-box;
304
- white-space: nowrap;
305
- overflow: visible;
306
- cursor: grab;
307
- }
308
- .gantt-tr-taskBar:hover {
309
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
310
- }
311
- .gantt-tr-taskBar.gantt-tr-dragging {
312
- cursor: grabbing;
313
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
314
- opacity: 1;
315
- transition: none !important;
316
- }
317
- .gantt-tr-taskName {
318
- color: var(--gantt-task-bar-text-color);
319
- font-size: 0.875rem;
320
- font-weight: 500;
321
- white-space: nowrap;
322
- overflow: hidden;
323
- text-overflow: ellipsis;
324
- max-width: 100%;
325
- }
326
- .gantt-tr-taskDuration {
327
- color: var(--gantt-task-bar-text-color);
328
- font-size: 0.875rem;
329
- font-weight: 500;
330
- white-space: nowrap;
331
- margin-right: 4px;
332
- }
333
- .gantt-tr-taskNameHidden {
334
- visibility: hidden;
335
- }
336
- .gantt-tr-rightLabels {
337
- position: absolute;
338
- top: 50%;
339
- transform: translateY(-50%);
340
- display: flex;
341
- align-items: center;
342
- gap: 4px;
343
- pointer-events: none;
344
- }
345
- .gantt-tr-dateLabelRight {
346
- position: static;
347
- margin-right: 0;
348
- }
349
- .gantt-tr-externalTaskName {
350
- font-size: 0.9rem;
351
- font-weight: 500;
352
- color: #00389f;
353
- white-space: nowrap;
354
- user-select: none;
355
- margin-left: 4px;
356
- }
357
- .gantt-tr-resizeHandle {
358
- position: absolute;
359
- top: 0;
360
- width: 8px;
361
- height: 100%;
362
- background-color: rgba(0, 0, 0, 0.1);
363
- cursor: ew-resize;
364
- }
365
- .gantt-tr-resizeHandleLeft {
366
- left: 0;
367
- }
368
- .gantt-tr-resizeHandleRight {
369
- right: 0;
370
- }
371
- .gantt-tr-resizeZoneLeft {
372
- cursor: ew-resize;
373
- }
374
- .gantt-tr-resizeZoneRight {
375
- cursor: ew-resize;
376
- }
377
- .gantt-tr-taskContainer {
378
- position: relative;
379
- width: 100%;
380
- height: 100%;
381
- display: flex;
382
- align-items: center;
383
- }
384
- .gantt-tr-leftLabels {
385
- position: absolute;
386
- top: 50%;
387
- transform: translateY(-50%);
388
- display: flex;
389
- align-items: center;
390
- pointer-events: none;
391
- }
392
- .gantt-tr-dateLabel {
393
- font-size: 0.85rem;
394
- color: #666666;
395
- white-space: nowrap;
396
- pointer-events: none;
397
- user-select: none;
398
- }
399
- .gantt-tr-dateLabelLeft {
400
- position: absolute;
401
- right: 100%;
402
- margin-right: 6px;
403
- top: 50%;
404
- transform: translateY(-50%);
405
- }
406
- .gantt-tsh-header {
407
- display: flex;
408
- flex-direction: column;
409
- background-color: var(--gantt-cell-background);
410
- border-bottom: var(--gantt-week-separator-width, 1px) solid var(--gantt-week-separator-color, #374151);
411
- box-sizing: border-box;
412
- }
413
- .gantt-tsh-monthRow {
414
- display: flex;
415
- border-bottom: var(--gantt-day-line-width, 1px) solid var(--gantt-day-line-color, #f3f4f6);
416
- align-items: center;
417
- }
418
- .gantt-tsh-monthCell {
419
- box-sizing: border-box;
420
- padding: 0.1rem 0.5rem;
421
- font-size: 0.75rem;
422
- font-weight: 600;
423
- color: #1f2937;
424
- border-left: var(--gantt-month-separator-width, 2px) solid var(--gantt-month-separator-color, #a1a1a1);
425
- text-align: left;
426
- }
427
- .gantt-tsh-monthCell:first-child {
428
- border-left: none;
429
- }
430
- .gantt-tsh-dayRow {
431
- display: grid;
432
- box-sizing: border-box;
433
- }
434
- .gantt-tsh-dayCell {
435
- display: flex;
436
- align-items: center;
437
- justify-content: center;
438
- box-sizing: border-box;
439
- }
440
- .gantt-tsh-monthBoundary {
441
- border-left: var(--gantt-month-separator-width, 2px) solid var(--gantt-month-separator-color, #a1a1a1);
442
- }
443
- .gantt-tsh-dayLabel {
444
- font-size: 0.75rem;
445
- font-weight: 500;
446
- color: #374151;
447
- }
448
- .gantt-tsh-weekendDay {
449
- background-color: var(--gantt-weekend-background, #fee2e2);
450
- }
451
- .gantt-tsh-weekendDay .gantt-tsh-dayLabel {
452
- color: #dc2626;
453
- }
454
- .gantt-tsh-today {
455
- background-color: #dc2626;
456
- border-radius: 0 4px 4px 0;
457
- }
458
- .gantt-tsh-today .gantt-tsh-dayLabel {
459
- color: #ffffff;
460
- }
461
- .gantt-gb-gridBackground {
462
- position: absolute;
463
- top: 0;
464
- left: 0;
465
- z-index: 0;
466
- pointer-events: none;
467
- }
468
- .gantt-gb-weekendBlock {
469
- position: absolute;
470
- top: 0;
471
- height: 100%;
472
- background-color: var(--gantt-weekend-background, #fee2e2);
473
- }
474
- .gantt-gb-gridLine {
475
- position: absolute;
476
- top: 0;
477
- height: 100%;
478
- background-color: var(--gantt-day-line-color, #f3f4f6);
479
- }
480
- .gantt-gb-monthSeparator {
481
- width: var(--gantt-month-separator-width, 2px);
482
- background-color: var(--gantt-month-separator-color, #374151);
483
- }
484
- .gantt-gb-weekSeparator {
485
- width: var(--gantt-week-separator-width, 1px);
486
- background-color: var(--gantt-week-separator-color, #d1d5db);
487
- }
488
- .gantt-gb-dayLine {
489
- width: var(--gantt-day-line-width, 1px);
490
- background-color: var(--gantt-day-line-color, #f3f4f6);
491
- }
492
- .gantt-ti-indicator {
493
- position: absolute;
494
- top: 0;
495
- bottom: 0;
496
- z-index: 5;
497
- pointer-events: none;
498
- }
499
- .gantt-dgl-guideLine {
500
- position: absolute;
501
- top: 0;
502
- width: 2px;
503
- background-color: var(--gantt-drag-guide-line-color, #3b82f6);
504
- z-index: 20;
505
- pointer-events: none;
506
- opacity: 0.6;
507
- }
508
274
 
509
275
  /* src/components/TimeScaleHeader/TimeScaleHeader.css */
510
276
  .gantt-tsh-header {
@@ -527,6 +293,8 @@
527
293
  color: #1f2937;
528
294
  border-left: var(--gantt-month-separator-width, 2px) solid var(--gantt-month-separator-color, #a1a1a1);
529
295
  text-align: left;
296
+ text-transform: uppercase;
297
+ letter-spacing: 0.04em;
530
298
  }
531
299
  .gantt-tsh-monthCell:first-child {
532
300
  border-left: none;
@@ -550,20 +318,23 @@
550
318
  color: #374151;
551
319
  }
552
320
  .gantt-tsh-weekendDay {
553
- background-color: var(--gantt-weekend-background, #fee2e2);
321
+ background-color: var(--gantt-weekend-background, #fef3f2);
554
322
  }
555
323
  .gantt-tsh-weekendDay .gantt-tsh-dayLabel {
556
- color: #dc2626;
324
+ color: #ef4444;
557
325
  }
558
326
  .gantt-tsh-today {
559
327
  background-color: #dc2626;
560
- border-radius: 0 4px 4px 0;
328
+ border-radius: 4px 4px 4px 0;
561
329
  }
562
330
  .gantt-tsh-today .gantt-tsh-dayLabel {
563
331
  color: #ffffff;
564
332
  }
565
333
 
566
334
  /* src/components/TaskRow/TaskRow.css */
335
+ :root {
336
+ --gantt-task-bar-border-radius: 6px;
337
+ }
567
338
  .gantt-tr-row {
568
339
  position: relative;
569
340
  width: 100%;
@@ -571,7 +342,7 @@
571
342
  box-sizing: border-box;
572
343
  }
573
344
  .gantt-tr-row:hover {
574
- background-color: rgba(0, 0, 0, 0.05);
345
+ background-color: rgba(59, 130, 246, 0.04);
575
346
  }
576
347
  .gantt-tr-taskBar {
577
348
  position: absolute;
@@ -584,9 +355,11 @@
584
355
  box-sizing: border-box;
585
356
  white-space: nowrap;
586
357
  overflow: hidden;
358
+ transition: box-shadow 0.15s ease;
587
359
  cursor: grab;
588
360
  }
589
361
  .gantt-tr-taskBar:hover {
362
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
590
363
  }
591
364
  .gantt-tr-taskBar.gantt-tr-dragging {
592
365
  cursor: grabbing;
@@ -617,7 +390,7 @@
617
390
  .gantt-tr-externalTaskName {
618
391
  font-size: 0.9rem;
619
392
  font-weight: 500;
620
- color: #00389f;
393
+ color: #2563eb;
621
394
  white-space: nowrap;
622
395
  user-select: none;
623
396
  margin-left: 4px;
@@ -625,9 +398,8 @@
625
398
  .gantt-tr-resizeHandle {
626
399
  position: absolute;
627
400
  top: 0;
628
- width: 8px;
401
+ width: 20px;
629
402
  height: 100%;
630
- background-color: rgba(0, 0, 0, 0.1);
631
403
  cursor: ew-resize;
632
404
  pointer-events: auto;
633
405
  z-index: 10;
@@ -661,7 +433,7 @@
661
433
  }
662
434
  .gantt-tr-dateLabel {
663
435
  font-size: 0.85rem;
664
- color: #666666;
436
+ color: #6b7280;
665
437
  white-space: nowrap;
666
438
  pointer-events: none;
667
439
  user-select: none;
@@ -705,7 +477,7 @@
705
477
  .gantt-tr-externalProgress {
706
478
  font-size: 0.85rem;
707
479
  font-weight: 500;
708
- color: #666666;
480
+ color: #6b7280;
709
481
  white-space: nowrap;
710
482
  margin-right: 4px;
711
483
  margin-left: 4px;
@@ -718,7 +490,7 @@
718
490
  left: 0;
719
491
  width: 100%;
720
492
  height: 0;
721
- border-top: 1px solid #999;
493
+ border-top: 1px solid var(--gantt-grid-line-color, #d1d5db);
722
494
  pointer-events: none;
723
495
  z-index: 0;
724
496
  }
@@ -732,7 +504,7 @@
732
504
  /* src/components/TodayIndicator/TodayIndicator.css */
733
505
  .gantt-ti-indicator {
734
506
  position: absolute;
735
- top: 0;
507
+ top: -1px;
736
508
  bottom: 0;
737
509
  z-index: 5;
738
510
  pointer-events: none;
@@ -855,7 +627,7 @@
855
627
  padding: 0 0.5rem;
856
628
  font-size: 0.75rem;
857
629
  font-weight: 600;
858
- color: #1f2937;
630
+ color: #6b7280;
859
631
  box-sizing: border-box;
860
632
  border-right: 1px solid var(--gantt-grid-line-color, #e0e0e0);
861
633
  }
@@ -871,9 +643,10 @@
871
643
  border-bottom: 1px solid var(--gantt-grid-line-color, #e0e0e0);
872
644
  box-sizing: border-box;
873
645
  cursor: pointer;
646
+ position: relative;
874
647
  }
875
648
  .gantt-tl-row:hover {
876
- background-color: rgba(0, 0, 0, 0.05);
649
+ background-color: rgba(59, 130, 246, 0.04);
877
650
  }
878
651
  .gantt-tl-row-selected {
879
652
  background-color: rgba(59, 130, 246, 0.15);
@@ -896,26 +669,16 @@
896
669
  flex-shrink: 0;
897
670
  cursor: pointer;
898
671
  }
899
- .gantt-tl-num-icon {
900
- display: none;
901
- color: #6b7280;
902
- }
903
- .gantt-tl-cell-number:hover .gantt-tl-num-label {
904
- display: none;
905
- }
906
- .gantt-tl-cell-number:hover .gantt-tl-num-icon {
907
- display: block;
908
- }
909
672
  .gantt-tl-headerCell.gantt-tl-cell-name {
910
673
  padding-left: 4px;
911
674
  }
912
675
  .gantt-tl-cell-name {
913
676
  flex: 1;
914
- min-width: 0;
677
+ min-width: 150px;
915
678
  position: relative;
916
679
  overflow: visible;
917
680
  align-items: center;
918
- padding: 0;
681
+ padding: 0 4px;
919
682
  }
920
683
  .gantt-tl-cell-date {
921
684
  width: 68px;
@@ -929,26 +692,28 @@
929
692
  -webkit-box-orient: vertical;
930
693
  -webkit-line-clamp: 2;
931
694
  overflow: hidden;
932
- width: 100%;
933
- height: 100%;
934
- padding: 0 0.2rem;
695
+ position: absolute;
696
+ inset: 0;
697
+ padding: 0 4px;
935
698
  font-size: 0.8rem;
936
699
  line-height: 1.2;
937
700
  font-family: inherit;
938
701
  color: #374151;
939
702
  background: transparent;
940
703
  border: none;
941
- cursor: text;
704
+ cursor: pointer;
942
705
  text-align: left;
943
706
  user-select: none;
944
707
  white-space: normal;
945
708
  word-break: break-word;
946
709
  box-sizing: border-box;
947
- min-height: 100%;
948
710
  }
949
711
  .gantt-tl-name-trigger:hover {
950
712
  background-color: rgba(59, 130, 246, 0.1);
951
713
  }
714
+ .gantt-tl-name-trigger:active {
715
+ background-color: rgba(59, 130, 246, 0.2);
716
+ }
952
717
  .gantt-tl-name-input {
953
718
  position: absolute;
954
719
  top: 0;
@@ -968,23 +733,64 @@
968
733
  .gantt-tl-name-locked {
969
734
  cursor: default !important;
970
735
  }
736
+ .gantt-tl-name-actions {
737
+ position: absolute;
738
+ right: 4px;
739
+ top: 50%;
740
+ transform: translateY(-50%);
741
+ display: flex;
742
+ gap: 4px;
743
+ align-items: center;
744
+ }
745
+ .gantt-tl-name-action-btn {
746
+ display: inline-flex;
747
+ align-items: center;
748
+ justify-content: center;
749
+ border: none;
750
+ border-radius: 4px;
751
+ width: 20px;
752
+ height: 20px;
753
+ padding: 0;
754
+ cursor: pointer;
755
+ opacity: 0;
756
+ pointer-events: none;
757
+ transition: opacity 0.15s ease, background-color 0.15s ease;
758
+ }
759
+ .gantt-tl-row:hover .gantt-tl-name-action-btn {
760
+ opacity: 1;
761
+ pointer-events: auto;
762
+ }
971
763
  .gantt-tl-cell-deps {
972
- width: 120px;
764
+ width: 90px;
973
765
  flex-shrink: 0;
974
766
  flex-wrap: wrap;
975
767
  gap: 2px;
976
768
  padding: 2px 4px;
977
769
  align-items: center;
978
- overflow: visible;
770
+ overflow: hidden;
979
771
  position: relative;
980
772
  }
773
+ .gantt-tl-action-insert {
774
+ background-color: #22c55e;
775
+ color: white;
776
+ }
777
+ .gantt-tl-action-insert:hover {
778
+ background-color: #16a34a;
779
+ }
780
+ .gantt-tl-action-delete {
781
+ background-color: #ef4444;
782
+ color: white;
783
+ }
784
+ .gantt-tl-action-delete:hover {
785
+ background-color: #dc2626;
786
+ }
981
787
  .gantt-tl-dep-type-trigger {
982
788
  display: flex;
983
789
  align-items: center;
984
790
  gap: 2px;
985
791
  font-size: 0.75rem;
986
792
  font-weight: 600;
987
- color: #1f2937;
793
+ color: #6b7280;
988
794
  background: transparent;
989
795
  border: none;
990
796
  cursor: pointer;
@@ -1033,7 +839,7 @@
1033
839
  gap: 1px;
1034
840
  background-color: rgba(59, 130, 246, 0.12);
1035
841
  border: 1px solid rgba(59, 130, 246, 0.3);
1036
- border-radius: 4px;
842
+ border-radius: 6px;
1037
843
  padding: 4px 4px;
1038
844
  font-size: 0.7rem;
1039
845
  color: #1d4ed8;
@@ -1096,7 +902,7 @@
1096
902
  align-items: center;
1097
903
  background-color: rgba(107, 114, 128, 0.12);
1098
904
  border: 1px solid rgba(107, 114, 128, 0.3);
1099
- border-radius: 4px;
905
+ border-radius: 6px;
1100
906
  padding: 4px 4px;
1101
907
  font-size: 0.7rem;
1102
908
  color: #6b7280;
@@ -1146,7 +952,7 @@
1146
952
  align-items: center;
1147
953
  justify-content: center;
1148
954
  background: transparent;
1149
- border: 1px dashed rgba(59, 130, 246, 0.4);
955
+ border: 1px solid rgba(59, 130, 246, 0.4);
1150
956
  border-radius: 4px;
1151
957
  width: 23px;
1152
958
  height: 23px;
@@ -1157,6 +963,18 @@
1157
963
  font-family: inherit;
1158
964
  flex-shrink: 0;
1159
965
  }
966
+ .gantt-tl-dep-add-hover {
967
+ opacity: 0;
968
+ pointer-events: none;
969
+ transition: opacity 0.15s ease;
970
+ }
971
+ .gantt-tl-row:hover .gantt-tl-dep-add-hover {
972
+ opacity: 1;
973
+ pointer-events: auto;
974
+ }
975
+ .gantt-tl-dep-add-hidden {
976
+ display: none !important;
977
+ }
1160
978
  .gantt-tl-dep-add:hover {
1161
979
  background-color: rgba(59, 130, 246, 0.1);
1162
980
  border-color: #3b82f6;
@@ -1169,14 +987,14 @@
1169
987
  background-color: rgba(59, 130, 246, 0.15);
1170
988
  }
1171
989
  .gantt-tl-row-picking-self .gantt-tl-cell-deps {
1172
- cursor: not-allowed;
990
+ cursor: pointer;
1173
991
  }
1174
992
  .gantt-tl-dep-source-hint {
1175
993
  font-size: 0.75rem;
1176
994
  color: #6b7280;
1177
995
  font-style: italic;
1178
996
  pointer-events: none;
1179
- white-space: nowrap;
997
+ white-space: normal;
1180
998
  }
1181
999
  .gantt-tl-dep-delete-label {
1182
1000
  display: inline-flex;
@@ -1221,6 +1039,29 @@
1221
1039
  z-index: 10;
1222
1040
  white-space: nowrap;
1223
1041
  }
1042
+ .gantt-tl-add-btn {
1043
+ width: 100%;
1044
+ padding: 6px 12px;
1045
+ text-align: left;
1046
+ background: transparent;
1047
+ border: none;
1048
+ border-top: 1px dashed var(--gantt-grid-line-color, #e0e0e0);
1049
+ cursor: pointer;
1050
+ font-size: 12px;
1051
+ color: var(--gantt-text-muted, #9ca3af);
1052
+ transition: background 0.15s ease, color 0.15s ease;
1053
+ font-family: inherit;
1054
+ }
1055
+ .gantt-tl-add-btn:hover {
1056
+ background: var(--gantt-hover-bg, rgba(0, 0, 0, 0.04));
1057
+ color: var(--gantt-text-color, #374151);
1058
+ }
1059
+ .gantt-tl-row-new {
1060
+ border-top: 1px dashed var(--gantt-grid-line-color, #e0e0e0);
1061
+ }
1062
+ .gantt-tl-cell-new-name {
1063
+ padding: 2px 4px;
1064
+ }
1224
1065
 
1225
1066
  /* src/components/GanttChart/GanttChart.css */
1226
1067
  .gantt-container {
@@ -1234,6 +1075,8 @@
1234
1075
  sans-serif;
1235
1076
  border: 1px solid var(--gantt-grid-line-color, #e0e0e0);
1236
1077
  background-color: var(--gantt-cell-background, #ffffff);
1078
+ border-radius: var(--gantt-container-border-radius, 10px);
1079
+ overflow: hidden;
1237
1080
  }
1238
1081
  .gantt-scrollContainer {
1239
1082
  overflow: auto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-lib",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "Lightweight React Gantt chart component library",
5
5
  "license": "MIT",
6
6
  "repository": {